├── .build-android.dockerfile ├── .build-linux.dockerfile ├── .clang-format ├── .github └── workflows │ └── build.yml ├── .gitignore ├── .gitmodules ├── AUTHORS ├── CMakeLists.txt ├── CONTRIBUTING.md ├── CONTRIBUTORS ├── LICENSE ├── README.md ├── application_sandbox ├── 4444_formats │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── CMakeLists.txt ├── README.md ├── async_compute │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── particle.frag │ ├── particle.vert │ ├── particle_data_shared.h │ ├── particle_update.comp │ └── particle_velocity_update.comp ├── atomic_int64 │ ├── CMakeLists.txt │ ├── main.cpp │ ├── triangle.frag │ └── triangle.vert ├── blend_constants │ ├── CMakeLists.txt │ ├── README.md │ ├── blend.frag │ ├── blend.vert │ ├── icos.obj │ └── main.cpp ├── blit_image │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── buffer_device_address │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── bufferview │ ├── CMakeLists.txt │ ├── README.md │ ├── bufferview.frag │ ├── bufferview.vert │ └── main.cpp ├── calibrated_timestamps │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── clear_attachments │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── clear_colorimage │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── clear_depthimage │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ ├── depth.frag │ ├── depth.vert │ └── main.cpp ├── compute_particles │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── particle.frag │ ├── particle.vert │ ├── particle_data_shared.h │ ├── particle_update.comp │ └── particle_velocity_update.comp ├── conditional_rendering │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.comp │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── conservative_rasterization │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── copy_image_2d3d │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── copy_image_buffer │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── copy_querypool_results │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── wireframe.frag │ └── wireframe.vert ├── copy_querypool_results_host_reset │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── wireframe.frag │ └── wireframe.vert ├── create_renderpass2 │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ ├── final.frag │ ├── main.cpp │ └── passthrough.vert ├── cube │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── debug_utils │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── decorate_string │ ├── CMakeLists.txt │ ├── README.md │ ├── decorate_string.hlsl.frag │ ├── decorate_string.hlsl.frag.spvasm │ ├── decorate_string.hlsl.vert │ ├── decorate_string.hlsl.vert.spvasm │ └── main.cpp ├── depth_bounds │ ├── CMakeLists.txt │ ├── README.md │ └── main.cpp ├── depth_clip_control │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ ├── main.cpp │ ├── plane.frag │ └── plane.vert ├── depth_clip_enable │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── prism.frag │ └── prism.vert ├── depth_range_unrestricted │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── depth_readback │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.obj │ ├── cube.vert │ ├── main.cpp │ ├── plane.frag │ └── plane.vert ├── depth_stencil_resolve │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ ├── floor.frag │ ├── floor.vert │ ├── main.cpp │ └── mirror.vert ├── descriptor_indexing │ ├── CMakeLists.txt │ ├── descriptor_indexing.frag │ ├── descriptor_indexing.vert │ └── main.cpp ├── descriptor_update_template │ ├── CMakeLists.txt │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── dispatch │ ├── CMakeLists.txt │ ├── README.md │ ├── dispatch.comp │ ├── dispatch.frag │ ├── dispatch.vert │ └── main.cpp ├── dispatch_indirect │ ├── CMakeLists.txt │ ├── README.md │ ├── dispatch_indirect.comp │ ├── dispatch_indirect.frag │ ├── dispatch_indirect.vert │ └── main.cpp ├── display_properties2 │ ├── CMakeLists.txt │ └── main.cpp ├── display_timing │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── draw_indexed_indirect_count │ ├── CMakeLists.txt │ ├── README.md │ ├── diic.frag │ ├── diic.vert │ └── main.cpp ├── driver_properties │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── dummy │ ├── CMakeLists.txt │ ├── README.md │ └── main.cpp ├── dynamic_rendering_1_3 │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── dynamic_rendering_cube │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── execute_commands │ ├── CMakeLists.txt │ ├── README.md │ ├── execute_commands.comp │ ├── execute_commands.frag │ ├── execute_commands.vert │ └── main.cpp ├── extended_dynamic_state │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── extended_dynamic_state2 │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── external_buffer │ ├── CMakeLists.txt │ ├── buffer_export.cpp │ ├── buffer_import.cpp │ ├── cube.frag │ ├── cube.vert │ └── external_buffer.h ├── external_image │ ├── CMakeLists.txt │ ├── cube.frag │ ├── cube.vert │ ├── image_export.cpp │ ├── image_import.cpp │ ├── textured_cube.frag │ └── textured_cube.vert ├── external_memory_host │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── fence_test │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── fill_buffer │ ├── CMakeLists.txt │ ├── README.md │ ├── fill.frag │ ├── fill.vert │ └── main.cpp ├── foreign_buffer │ ├── CMakeLists.txt │ ├── buffer_export.cpp │ ├── buffer_import.cpp │ └── external_buffer.h ├── format_feature_flags2 │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── hdr_metadata │ ├── CMakeLists.txt │ ├── hdr_metadata.frag │ ├── hdr_metadata.vert │ └── main.cpp ├── imageless_framebuffer │ ├── CMakeLists.txt │ └── main.cpp ├── inline_uniform_block │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── khr_image_format_list │ ├── CMakeLists.txt │ ├── README.md │ ├── image_format_list.frag │ ├── image_format_list.vert │ └── main.cpp ├── many_commandbuffers_cube │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── memory_budget │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── memory_model │ ├── CMakeLists.txt │ ├── main.cpp │ ├── triangle.frag │ └── triangle.vert ├── mixed_sample_count │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ ├── floor.frag │ ├── floor.vert │ ├── main.cpp │ └── mirror.vert ├── multigpu_particles │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── particle.frag │ ├── particle.vert │ ├── particle_data_shared.h │ ├── particle_update.comp │ └── particle_velocity_update.comp ├── multiplanar_image_disjoint │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── multiplanar_image.frag │ └── multiplanar_image.vert ├── multiplanar_image_explicit │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── multiplanar_image.frag │ └── multiplanar_image.vert ├── multiplanar_image_non_disjoint │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── multiplanar_image.frag │ └── multiplanar_image.vert ├── mutable_swapchain_format │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── overlapping_frames │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── postprocessing.frag │ ├── postprocessing.vert │ ├── triangle.frag │ └── triangle.vert ├── passthrough │ ├── CMakeLists.txt │ ├── main.cpp │ ├── passthrough.glsl.frag │ ├── passthrough.glsl.vert │ ├── passthrough.hlsl.frag │ └── passthrough.hlsl.vert ├── pci_bus_info │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── pipeline_creation_feedback │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── pipeline_executable_properties │ ├── CMakeLists.txt │ └── main.cpp ├── present_region │ ├── CMakeLists.txt │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── private_data │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── protected_memory │ ├── CMakeLists.txt │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── push_descriptor │ ├── CMakeLists.txt │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── render_3d_image │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── render_depth_attachment │ ├── CMakeLists.txt │ ├── README.md │ ├── final.frag │ ├── intermediate.frag │ ├── main.cpp │ └── passthrough.vert ├── render_input_attachment │ ├── CMakeLists.txt │ ├── README.md │ ├── final.frag │ ├── intermediate.frag │ ├── main.cpp │ └── passthrough.vert ├── render_quad │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── render_quad.frag │ └── render_quad.vert ├── robustness2 │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── robustness2.frag │ └── robustness2.vert ├── sample_application_framework │ ├── CMakeLists.txt │ ├── README.md │ ├── sample_application.cpp │ └── sample_application.h ├── sample_locations │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ ├── floor.frag │ ├── floor.vert │ ├── main.cpp │ └── mirror.vert ├── sampler_minmax │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── textured_cube.frag │ └── textured_cube.vert ├── sampler_mirror_clamp_to_edge │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── textured_cube.frag │ └── textured_cube.vert ├── scalar_block_layout │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── scalar_block_layout.frag │ └── scalar_block_layout.vert ├── separate_depth_stencil_layouts │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ ├── main.cpp │ ├── torus.frag │ └── torus.vert ├── separate_stencil_usage │ ├── CMakeLists.txt │ ├── README.md │ ├── camera_model.vert │ ├── cube.frag │ ├── floor.frag │ ├── floor.vert │ ├── main.cpp │ ├── plane.frag │ └── plane.vert ├── set_event │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── set_event.frag │ └── set_event.vert ├── shader_16bit_storage │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── shader_core_properties │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── shader_demote │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── shader_float16_int8 │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── shader_float16_int8.frag │ └── shader_float16_int8.vert ├── shader_float_controls │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── shader_float_controls.frag │ ├── shader_float_controls.frag.spvasm │ ├── shader_float_controls.vert │ └── shader_float_controls.vert.spvasm ├── shader_info │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── shared_presentable_image │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── simple_compute │ ├── CMakeLists.txt │ ├── README.md │ ├── add_numbers.comp │ ├── inputs.h │ └── main.cpp ├── sparse_binding │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── sparse_binding.frag │ └── sparse_binding.vert ├── spirv_1_4 │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── spirv_1_4.frag │ ├── spirv_1_4.frag.spvasm │ ├── spirv_1_4.vert │ └── spirv_1_4.vert.spvasm ├── standard_uniform_buffer_layout │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── standard_uniform_buffer_layout.frag │ └── standard_uniform_buffer_layout.vert ├── stencil │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ ├── floor.frag │ ├── floor.vert │ ├── main.cpp │ └── mirror.vert ├── stencil_export │ ├── CMakeLists.txt │ ├── line.frag │ ├── line.vert │ └── main.cpp ├── storage_8bit │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── storage_8bit.frag │ └── storage_8bit.vert ├── subgroup_ballot │ ├── CMakeLists.txt │ ├── main.cpp │ ├── triangle.frag │ └── triangle.vert ├── subgroup_vote │ ├── CMakeLists.txt │ ├── main.cpp │ ├── triangle.frag │ └── triangle.vert ├── swapchain_colorspace │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── synchronization2_async_compute │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── particle.frag │ ├── particle.vert │ ├── particle_data_shared.h │ ├── particle_update.comp │ └── particle_velocity_update.comp ├── synchronization2_blit_image │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── synchronization2_set_event │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── set_event.frag │ └── set_event.vert ├── synchronization2_timeline_semaphore_simple │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── synchronization2_write_timestamp │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── write_timestamp.frag │ └── write_timestamp.vert ├── texel_buffer_alignment │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── texel_buffer_alignment.frag │ └── texel_buffer_alignment.vert ├── textured_cube │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── textured_cube.frag │ └── textured_cube.vert ├── timeline_semaphore_cross_queue │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── timeline_semaphore_host_signal_after_submit │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── timeline_semaphore_simple │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── tooling_info │ ├── CMakeLists.txt │ ├── README.md │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── transform_feedback │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── particle.frag │ ├── particle.vert │ ├── particle_data_shared.h │ └── particle_update.vert ├── viewport_index │ ├── CMakeLists.txt │ ├── cube.frag │ ├── cube.vert │ └── main.cpp ├── wait_fence_partial │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── postprocessing.frag │ ├── postprocessing.vert │ ├── triangle.frag │ └── triangle.vert ├── wireframe │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── wireframe.frag │ └── wireframe.vert └── write_timestamp │ ├── CMakeLists.txt │ ├── README.md │ ├── main.cpp │ ├── write_timestamp.frag │ └── write_timestamp.vert ├── cmake ├── README.md ├── android_project_template │ ├── app │ │ ├── .gitignore │ │ ├── CMakeLists.txt.in │ │ ├── build.gradle.in │ │ ├── proguard-rules.pro.in │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml.in │ │ │ ├── gdb-path.txt.in │ │ │ ├── jni │ │ │ └── Android.mk.in │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ └── strings.xml.in │ ├── build.gradle.in │ ├── gradle.properties.in │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── local.properties.in │ └── settings.gradle.in ├── build_apk.cmake ├── convert_img_to_c.py ├── convert_obj_to_c.py ├── empty_cmake_dep.in.cmake ├── generate_cmake_dep.py └── setup.cmake ├── shader_library ├── CMakeLists.txt ├── README.md ├── double_numbers.comp ├── foo │ ├── test.1.glsl │ ├── test.frag │ └── test.glsl ├── hardcode_pos_triangle.frag ├── hardcode_pos_triangle.vert ├── models │ └── model_setup.glsl ├── simple_fragment.frag ├── simple_vertex.vert └── test.vert ├── standard_images ├── CMakeLists.txt ├── README.md ├── multiplanar.jpg ├── particle.png ├── r8.png ├── rgb8.png └── star.png ├── standard_models ├── CMakeLists.txt ├── README.md ├── cube.obj ├── floor.obj ├── fullscreen_quad.obj ├── prism.obj └── torus_knot.obj ├── support ├── CMakeLists.txt ├── README.md ├── android_native_app_glue │ ├── CMakeLists.txt │ └── README.md ├── containers │ ├── CMakeLists.txt │ ├── README.md │ ├── allocator.h │ ├── deque.h │ ├── dummy.c │ ├── ordered_multimap.h │ ├── stl_compatible_allocator.h │ ├── string.h │ ├── unique_ptr.h │ ├── unordered_map.h │ ├── unordered_set.h │ └── vector.h ├── dynamic_loader │ ├── CMakeLists.txt │ ├── README.md │ ├── dynamic_library.cpp │ └── dynamic_library.h ├── entry │ ├── CMakeLists.txt │ ├── README.md │ ├── entry.cpp │ ├── entry.h │ ├── entry_config.h.in │ └── macos │ │ └── main.m ├── log │ ├── CMakeLists.txt │ ├── README.md │ ├── log.cpp │ └── log.h └── math_common │ ├── CMakeLists.txt │ ├── README.md │ ├── glsl │ ├── CMakeLists.txt │ └── include │ │ └── math_common.h │ ├── include │ └── math_common.h │ └── math_common.cpp ├── third_party ├── LICENCE.Vulkan-Headers ├── LICENCE.vk_layer ├── LICENSE.fpluti ├── LICENSE.googletest ├── LICENSE.mathfu ├── LICENSE.vectorial └── LICENSE.vk_callback_swapchain ├── tools ├── android.py ├── apk_runner.py ├── hlsl_test_framework.py ├── spirv_c_mfmt.py ├── struct_offsets.py └── vulkan_constants.py ├── vulkan_helpers ├── CMakeLists.txt ├── README.md ├── buffer_frame_data.h ├── helper_functions.cpp ├── helper_functions.h ├── known_device_infos.cpp ├── known_device_infos.h ├── shader_collection.h ├── structs.cpp ├── structs.h ├── vulkan_application.cpp ├── vulkan_application.h ├── vulkan_header_wrapper.h ├── vulkan_model.h └── vulkan_texture.h └── vulkan_wrapper ├── CMakeLists.txt ├── README.md ├── command_buffer_wrapper.h ├── descriptor_set_wrapper.h ├── device_wrapper.h ├── function_table.h ├── instance_wrapper.h ├── lazy_function.h ├── library_wrapper.cpp ├── library_wrapper.h ├── queue_wrapper.h ├── sub_objects.h └── swapchain.h /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | BasedOnStyle: Google 4 | DerivePointerAlignment: false 5 | PointerAlignment: Left 6 | ... 7 | 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/* 2 | build-*/ 3 | build_*/ 4 | 5 | # Vim swap 6 | [._]*.s[a-w][a-z] 7 | [._]s[a-w][a-z] 8 | 9 | # Python compiled files 10 | *.pyc 11 | 12 | # VSCode config files 13 | .vscode/ 14 | 15 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "third_party/mathfu"] 2 | path = third_party/mathfu 3 | url = https://github.com/google/mathfu 4 | [submodule "third_party/vk_callback_swapchain"] 5 | path = third_party/vk_callback_swapchain 6 | url = https://github.com/google/vk_callback_swapchain 7 | [submodule "third_party/Vulkan-Headers"] 8 | path = third_party/Vulkan-Headers 9 | url = https://github.com/KhronosGroup/Vulkan-Headers 10 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of vulkan_test_applications authors for copyright 2 | # purposes. 3 | # This file is distinct from the CONTRIBUTORS files. 4 | # See the latter for an explanation. 5 | 6 | # Names should be added to this file as: 7 | # Name or Organization 8 | # The email address is not required for organizations. 9 | 10 | Google Inc. -------------------------------------------------------------------------------- /CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # People who have agreed to one of the CLAs and can contribute patches. 2 | # The AUTHORS file lists the copyright holders; this file 3 | # lists people. For example, Google employees are listed here 4 | # but not in AUTHORS, because Google holds the copyright. 5 | # 6 | # https://developers.google.com/open-source/cla/individual 7 | # https://developers.google.com/open-source/cla/corporate 8 | # 9 | # Names should be added to this file as: 10 | # Name 11 | 12 | Andrew Woloszyn 13 | Qining Lu 14 | Nicholas Deakin 15 | -------------------------------------------------------------------------------- /application_sandbox/4444_formats/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(4444_formats_shaders 16 | SOURCES 17 | cube.frag 18 | cube.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(4444_formats 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | 4444_formats_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/4444_formats/README.md: -------------------------------------------------------------------------------- 1 | # 4444_formats 2 | 3 | This sample renders a cube with texture in VK_FORMAT_A4B4G4R4_UNORM_PACK16_EXT format. 4 | This is done by enabling the `VK_EXT_4444_formats` extension. -------------------------------------------------------------------------------- /application_sandbox/async_compute/README.md: -------------------------------------------------------------------------------- 1 | # Async Compute 2 | 3 | This sample creates a secondary queue that runs compute operations. If no 4 | dedicated compute queue family is found, then a second queue in the main 5 | graphics/compute family will be used. If this also cannot be found, then 6 | the application will terminate. 7 | 8 | These are run on a separate thread, and shuttled back to the main thread 9 | in a mailbox. The main thread will take whatever the most up-to-date 10 | simulation is, and render that as fast as possible. 11 | 12 | The actual simulation in question is an N-Body simulation of 64k particles. 13 | Each simulation frame, each particle is attracted to 1/128 of the other 14 | particles. The set of particles that each particle attracts to is rotated 15 | once per simulation frame. -------------------------------------------------------------------------------- /application_sandbox/atomic_int64/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(atomic_int64_shaders 16 | SOURCES 17 | triangle.frag 18 | triangle.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(atomic_int64 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | SHADERS 28 | atomic_int64_shaders 29 | ) 30 | -------------------------------------------------------------------------------- /application_sandbox/blend_constants/README.md: -------------------------------------------------------------------------------- 1 | # Blend Constants 2 | 3 | This sample renders a sphere, with a set of blend-constants. -------------------------------------------------------------------------------- /application_sandbox/blend_constants/blend.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 2) in vec3 normal; 20 | 21 | void main() { 22 | out_color = vec4(normal, 1.0); 23 | } -------------------------------------------------------------------------------- /application_sandbox/blit_image/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(blit_image_shaders 16 | SOURCES 17 | cube.frag 18 | cube.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(blit_image 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | blit_image_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/blit_image/README.md: -------------------------------------------------------------------------------- 1 | # Blit Image 2 | 3 | This sample renders a rotating cube, and then blits it upside down 4 | into the framebuffer. -------------------------------------------------------------------------------- /application_sandbox/blit_image/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/buffer_device_address/README.md: -------------------------------------------------------------------------------- 1 | # buffer_device_address 2 | 3 | The sample demonstrates the use of VK_KHR_buffer_device_address extension. 4 | The fragment shader accesses uniform data through device addresses for the 5 | buffers. 6 | -------------------------------------------------------------------------------- /application_sandbox/buffer_device_address/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | void main() { 22 | out_color = vec4(texcoord, 0.0, 1.0); 23 | } 24 | -------------------------------------------------------------------------------- /application_sandbox/bufferview/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(bufferview_shaders 16 | SOURCES 17 | bufferview.frag 18 | bufferview.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(bufferview 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | bufferview_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/bufferview/README.md: -------------------------------------------------------------------------------- 1 | # Buffer View 2 | 3 | This sample binds a buffer view to the fragment pipeline, and uses 4 | a texel fetch to get the blue channel of the output. This is updated 5 | every frame. -------------------------------------------------------------------------------- /application_sandbox/calibrated_timestamps/README.md: -------------------------------------------------------------------------------- 1 | # calibrated_timestamps 2 | 3 | THis sample renders a rotating cube on teh screen, and 4 | uses VK_EXT_calibrated_timestamps to query and print 5 | calibrated timestamps every 60 frames. 6 | 7 | -------------------------------------------------------------------------------- /application_sandbox/calibrated_timestamps/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/clear_attachments/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(clear_attachments_shaders 16 | SOURCES 17 | cube.frag 18 | cube.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(clear_attachments 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | clear_attachments_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/clear_attachments/README.md: -------------------------------------------------------------------------------- 1 | # Clear Attachments 2 | 3 | This sample renders a rotating cube, and then clears the center of the image. -------------------------------------------------------------------------------- /application_sandbox/clear_attachments/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/clear_colorimage/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(clear_colorimage_shaders 16 | SOURCES 17 | cube.frag 18 | cube.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(clear_colorimage 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | clear_colorimage_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/clear_colorimage/README.md: -------------------------------------------------------------------------------- 1 | # Clear Attachments 2 | 3 | This sample clears the background of an image using `vkCmdClearColorImage` 4 | rather than using the renderpass clear. -------------------------------------------------------------------------------- /application_sandbox/clear_colorimage/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/clear_depthimage/README.md: -------------------------------------------------------------------------------- 1 | # Clear Depth Image 2 | 3 | This sample clears the depth stencil with a non-standard value using 4 | `vkCmdClearDepthStencilImage`. The depth is then output to the framebuffer. -------------------------------------------------------------------------------- /application_sandbox/clear_depthimage/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } 26 | -------------------------------------------------------------------------------- /application_sandbox/clear_depthimage/depth.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | 20 | layout(input_attachment_index = 0, binding = 0, set = 0) uniform subpassInput depth; 21 | 22 | void main() { 23 | out_color = (subpassLoad(depth)-0.9)*30.0; 24 | } 25 | 26 | -------------------------------------------------------------------------------- /application_sandbox/clear_depthimage/depth.vert: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | #include "models/model_setup.glsl" 18 | 19 | void main() { 20 | gl_Position = get_position(); 21 | } 22 | -------------------------------------------------------------------------------- /application_sandbox/compute_particles/README.md: -------------------------------------------------------------------------------- 1 | # Compute Particles 2 | 3 | This sample is based on the `Async Compute` sample. The difference is this 4 | one uses semaphore for synchronization between the compute and graphic 5 | queue. 6 | -------------------------------------------------------------------------------- /application_sandbox/conditional_rendering/cube.comp: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 430 17 | 18 | layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in; 19 | 20 | layout (binding = 0, set = 0) buffer a2{ 21 | float data[1]; 22 | }; 23 | 24 | void main() { 25 | uint index = gl_GlobalInvocationID.x; 26 | data[index] = 1.0f; 27 | } 28 | -------------------------------------------------------------------------------- /application_sandbox/conditional_rendering/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout(location = 1) in vec2 texcoord; 20 | 21 | layout(set = 0, binding = 2) uniform samplerBuffer colorScale; 22 | 23 | void main() { 24 | vec3 color = vec3(texcoord, 1.0) * texelFetch(colorScale, 0).r; 25 | out_color = vec4(color, 1.0); 26 | } 27 | -------------------------------------------------------------------------------- /application_sandbox/conservative_rasterization/README.md: -------------------------------------------------------------------------------- 1 | # conservative_rasterization 2 | 3 | This sample renders a thin rotating stick that is rendered incorrectly without 4 | the use of conservative rasterization. Conservative rasterization is enabled by 5 | requesting the `VK_KHR_get_physical_device_properties2` instance extension and 6 | the `VK_EXT_conservative_rasterization` device extension. The use of 7 | conservative rasterization is controlled by creating a 8 | `VkPipelineRasterizationConservativeStateCreateInfoEXT` structure and passing it 9 | to the function `SetRasterizationExtension` on the graphics pipeline. 10 | -------------------------------------------------------------------------------- /application_sandbox/conservative_rasterization/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/copy_image_2d3d/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(copy_image_2d3d_shaders 16 | SOURCES 17 | cube.frag 18 | cube.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(copy_image_2d3d 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | copy_image_2d3d_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/copy_image_2d3d/README.md: -------------------------------------------------------------------------------- 1 | # 2D/3D Image Copy 2 | 3 | This sample copies a rendered 2D image to a 3D image, and then copies that 3D 4 | image to a swapchain image and presents it. 5 | -------------------------------------------------------------------------------- /application_sandbox/copy_image_2d3d/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/copy_image_buffer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(copy_image_buffer_shaders 16 | SOURCES 17 | cube.frag 18 | cube.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(copy_image_buffer 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | copy_image_buffer_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/copy_image_buffer/README.md: -------------------------------------------------------------------------------- 1 | # Buffer Image Copy 2 | 3 | This sample copies a rendered image to a buffer, and the copies that buffer 4 | to another location in the frambuffer. -------------------------------------------------------------------------------- /application_sandbox/copy_image_buffer/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/copy_querypool_results/README.md: -------------------------------------------------------------------------------- 1 | # Copy Querypool Results 2 | 3 | This sample renders a wireframe torus that is shaded based on the 4 | number of samples that passed the occlusion test in the previous frame. -------------------------------------------------------------------------------- /application_sandbox/copy_querypool_results_host_reset/README.md: -------------------------------------------------------------------------------- 1 | # Copy QueryPool Results (Host Reset) 2 | 3 | This sample renders a wireframe torus that is shaded based on the 4 | number of samples that passed the occlusion test in the previous frame. 5 | 6 | It is the same as `copy_querypool_results`, except that the Query Pool is reset 7 | on the host side using the `VK_EXT_host_query_reset` device extension. 8 | -------------------------------------------------------------------------------- /application_sandbox/create_renderpass2/README.md: -------------------------------------------------------------------------------- 1 | # create_renderpass2 2 | 3 | This sample renders two rotating cubes each rendered slighting differently using multiview with `vkCreateRenderPass2KHR`. 4 | -------------------------------------------------------------------------------- /application_sandbox/create_renderpass2/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/create_renderpass2/passthrough.vert: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | #include "models/model_setup.glsl" 18 | 19 | layout (location = 1) out vec2 texcoord; 20 | 21 | void main() { 22 | gl_Position = get_position(); 23 | texcoord = get_texcoord(); 24 | } -------------------------------------------------------------------------------- /application_sandbox/cube/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(cube_shaders 16 | SOURCES 17 | cube.frag 18 | cube.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(cube 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | cube_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/cube/README.md: -------------------------------------------------------------------------------- 1 | # Cube 2 | 3 | This sample renders a rotating cube on the screen. It is used as the 4 | basis for many other tests. -------------------------------------------------------------------------------- /application_sandbox/cube/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/debug_utils/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(debug_utils_shaders 16 | SOURCES 17 | cube.frag 18 | cube.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(debug_utils 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | debug_utils_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/debug_utils/README.md: -------------------------------------------------------------------------------- 1 | # Debug Utils 2 | 3 | This sample renders a rotating cube on the screen. It also uses the 4 | VK_EXT_debug_utils extension to name objects and label command buffers and 5 | queues and uses messengers to retrieve callbacks from layers. 6 | -------------------------------------------------------------------------------- /application_sandbox/debug_utils/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/decorate_string/README.md: -------------------------------------------------------------------------------- 1 | # Decorate String 2 | 3 | This sample uses HLSL semantics and `OpDecorateString` to render a rotating cube 4 | on the screen. The use of decorate string is enabled by requesting the device 5 | extensions `VK_GOOGLE_decorate_string` and `VK_GOOGLE_hlsl_functionality1`. 6 | Decorate string is used to set the user semantics `SV_POSITION` and `TEXCOORD` 7 | in the hlsl shader. -------------------------------------------------------------------------------- /application_sandbox/decorate_string/decorate_string.hlsl.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | struct VSOutput { 17 | float4 Position : SV_POSITION; 18 | float2 texcoord : TEXCOORD; 19 | }; 20 | 21 | float4 main(VSOutput input) { 22 | return float4(input.texcoord.xy, 0.0, 1.0); 23 | } -------------------------------------------------------------------------------- /application_sandbox/depth_bounds/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_vulkan_sample_application(depth_bounds 16 | SOURCES main.cpp 17 | LIBS 18 | vulkan_helpers 19 | SHADERS 20 | shader_library 21 | ) 22 | -------------------------------------------------------------------------------- /application_sandbox/depth_bounds/README.md: -------------------------------------------------------------------------------- 1 | # Set Depth Bounds 2 | 3 | This sample enables *depth bound test* and calls `vkCmdSetDepthBounds` to show a 4 | moving strip of a triangle. 5 | -------------------------------------------------------------------------------- /application_sandbox/depth_clip_control/README.md: -------------------------------------------------------------------------------- 1 | # VK_EXT_depth_clip_control 2 | 3 | This sample demonstrates the VK_EXT_depth_clip_control extension. This extension allows 4 | the clipping of depth values to be changed from the default range of [0, 1] to the OpenGL 5 | depth range of [-1, 1]. The sample renders two rotating cubes that would nominally be clipped 6 | by the near plane. The top cube uses the [0, 1] depth range and is clipped as expected. The 7 | second cube uses the [-1, 1] depth range and is not clipped. Additionally, the left side of the 8 | rendered image shows the depth buffer contents and demonstrates the remapping of depth values due 9 | to the NDC differences between the two cubes. 10 | -------------------------------------------------------------------------------- /application_sandbox/depth_clip_control/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | 20 | layout (location = 1) in vec2 texcoord; 21 | 22 | void main() { 23 | out_color = vec4(texcoord, 0.0, 1.0); 24 | } -------------------------------------------------------------------------------- /application_sandbox/depth_clip_control/plane.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | 20 | layout(input_attachment_index = 0, binding = 0, set = 0) uniform subpassInputMS depth; 21 | 22 | void main() { 23 | vec4 f = subpassLoad(depth, 1).rrrr; 24 | out_color = vec4(f.rgb, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/depth_clip_control/plane.vert: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | #include "models/model_setup.glsl" 18 | 19 | void main() { 20 | gl_Position = get_position(); 21 | } -------------------------------------------------------------------------------- /application_sandbox/depth_clip_enable/prism.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout (binding = 2, set = 0) uniform color_data { 19 | vec4 color; 20 | }; 21 | 22 | layout (location = 1) in vec3 normal; 23 | 24 | layout (location = 0) out vec4 out_color; 25 | 26 | void main() { 27 | float lighting = abs(normal.z); 28 | out_color = lighting*color; 29 | } 30 | -------------------------------------------------------------------------------- /application_sandbox/depth_range_unrestricted/README.md: -------------------------------------------------------------------------------- 1 | # Depth Range Unrestricted 2 | 3 | This sample renders a rotating cube with a depth range that exceeds the range 0 4 | to 1. The use of unrestricted depth range it enabled by requesting the 5 | `VK_EXT_depth_range_unrestricted` device extension. 6 | -------------------------------------------------------------------------------- /application_sandbox/depth_range_unrestricted/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/depth_readback/README.md: -------------------------------------------------------------------------------- 1 | # Depth Readback 2 | 3 | This sample demonstrates reading depth data back from a multisampled 4 | depth-buffer. -------------------------------------------------------------------------------- /application_sandbox/depth_readback/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/depth_readback/plane.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | 20 | layout(input_attachment_index = 0, binding = 0, set = 0) uniform subpassInputMS depth; 21 | 22 | void main() { 23 | vec4 f = subpassLoad(depth, 1).rrrr; 24 | out_color = vec4(pow(f.rgb, vec3(10.0, 10.0, 10.0)) , 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/depth_readback/plane.vert: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | #include "models/model_setup.glsl" 18 | 19 | void main() { 20 | gl_Position = get_position(); 21 | } -------------------------------------------------------------------------------- /application_sandbox/depth_stencil_resolve/README.md: -------------------------------------------------------------------------------- 1 | # depth_Stencil_resolve 2 | 3 | This sample renders a rotating cube on a black floor with the reflection of the 4 | cube shown on the floor. The reflection cube is confined within the floor by 5 | using stencil buffer. The stencil buffer is multisampled at the default 6 | multisample count and automatically resolved with a depth/stencil resolve in a 7 | VkRenderPass2 using the max resolve mode. 8 | -------------------------------------------------------------------------------- /application_sandbox/depth_stencil_resolve/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/depth_stencil_resolve/floor.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | 20 | void main() { 21 | out_color = vec4(0.0, 0.0, 0.0, 1.0); 22 | } 23 | -------------------------------------------------------------------------------- /application_sandbox/descriptor_update_template/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/dispatch/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(dispatch_shaders 16 | SOURCES 17 | dispatch.frag 18 | dispatch.vert 19 | dispatch.comp 20 | SHADER_DEPS 21 | shader_library 22 | ) 23 | 24 | add_vulkan_sample_application(dispatch 25 | SOURCES main.cpp 26 | LIBS 27 | vulkan_helpers 28 | MODELS 29 | standard_models 30 | SHADERS 31 | dispatch_shaders 32 | ) 33 | -------------------------------------------------------------------------------- /application_sandbox/dispatch/README.md: -------------------------------------------------------------------------------- 1 | # Dispatch 2 | 3 | This sample uses a compute shader to update the contents of a buffer 4 | that is then used to modulate the output of the fragment shader. -------------------------------------------------------------------------------- /application_sandbox/dispatch_indirect/README.md: -------------------------------------------------------------------------------- 1 | # Dispatch Indirect 2 | 3 | This sample indirectly dispatches a compute shader. The number of workgroups 4 | changes per frame, and that is refelected in the output of the fragment shader. -------------------------------------------------------------------------------- /application_sandbox/display_properties2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_vulkan_sample_application(display_properties2 16 | SOURCES main.cpp 17 | LIBS 18 | vulkan_helpers 19 | # MODELS 20 | # standard_models 21 | # SHADERS 22 | # cube_shaders 23 | ) 24 | -------------------------------------------------------------------------------- /application_sandbox/display_timing/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(display_timing_shaders 16 | SOURCES 17 | cube.frag 18 | cube.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(display_timing 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | display_timing_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/display_timing/README.md: -------------------------------------------------------------------------------- 1 | # Display Timing 2 | 3 | This sample renders a rotating cube on the screen and adjusts the image 4 | presentation duration when images are presented too early or too late. The use 5 | of diplay timing is enabled by requesting the device extension 6 | `VK_GOOGLE_display_timing`. Display timing is controlled through `SampleOptions` 7 | by calling the function `EnableDisplayTiming()`. -------------------------------------------------------------------------------- /application_sandbox/display_timing/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/draw_indexed_indirect_count/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(diic_shaders 16 | SOURCES 17 | diic.frag 18 | diic.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(draw_indexed_indirect_count 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | diic_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/draw_indexed_indirect_count/README.md: -------------------------------------------------------------------------------- 1 | # draw_indexed_indirect_count 2 | 3 | This sample renders a several rotating cubes on the screen, based on 4 | an indirect draw. -------------------------------------------------------------------------------- /application_sandbox/draw_indexed_indirect_count/diic.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/driver_properties/README.md: -------------------------------------------------------------------------------- 1 | # Driver Properties 2 | 3 | This sample renders a rotating cube on the screen and prints out driver 4 | properties to the console. The use of driver properties is enabled by requesting 5 | the instance extension `VK_KHR_get_physical_device_properties2` and the device 6 | extension `VK_KHR_driver_properties`. -------------------------------------------------------------------------------- /application_sandbox/driver_properties/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/dummy/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_vulkan_sample_application(dummy 16 | SOURCES main.cpp 17 | ) 18 | -------------------------------------------------------------------------------- /application_sandbox/dummy/README.md: -------------------------------------------------------------------------------- 1 | # Dummy 2 | 3 | This sample contains nothing, it is used for gradle build (android) to pull 4 | down dependencies. 5 | -------------------------------------------------------------------------------- /application_sandbox/dummy/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "support/entry/entry.h" 16 | 17 | #include 18 | 19 | int main_entry(const entry::EntryData* data) { 20 | data->logger()->LogInfo("Application Startup"); 21 | data->logger()->LogInfo("Application Shutdown"); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /application_sandbox/dynamic_rendering_1_3/README.md: -------------------------------------------------------------------------------- 1 | # Dynamic Rendering Cube 2 | 3 | This sample renders a rotating cube on the screen, but it does so 4 | using dynamic rendering. -------------------------------------------------------------------------------- /application_sandbox/dynamic_rendering_1_3/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/dynamic_rendering_cube/README.md: -------------------------------------------------------------------------------- 1 | # Dynamic Rendering Cube 2 | 3 | This sample renders a rotating cube on the screen, but it does so 4 | using dynamic rendering. -------------------------------------------------------------------------------- /application_sandbox/dynamic_rendering_cube/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/execute_commands/README.md: -------------------------------------------------------------------------------- 1 | # Execute Comands 2 | 3 | This sample is similar to dispatch, but it uses secondary command buffers 4 | for the compute/graphics work. -------------------------------------------------------------------------------- /application_sandbox/execute_commands/execute_commands.comp: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 430 17 | 18 | layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in; 19 | 20 | layout (binding = 0, set = 0) buffer a2{ 21 | float data[1]; 22 | }; 23 | 24 | void main() { 25 | uint tmp = uint(data[0]) % 128; 26 | tmp = tmp > 64 ? 128 - tmp : tmp; 27 | data[0] = tmp / 64.0; 28 | } 29 | -------------------------------------------------------------------------------- /application_sandbox/extended_dynamic_state/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | void main() { 22 | out_color = vec4(texcoord, 0.0, 1.0); 23 | } 24 | -------------------------------------------------------------------------------- /application_sandbox/extended_dynamic_state2/README.md: -------------------------------------------------------------------------------- 1 | # extended_dynamic_state2 2 | 3 | This sample renders 2 cubes which overlap with each other. Overlapping usually leads to z-fighting. 4 | To prevent it, the depth bias is toggled between the draw calls for each cube with 'vkCmdSetDepthBiasEnableEXT' -------------------------------------------------------------------------------- /application_sandbox/external_buffer/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/external_image/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/external_memory_host/README.md: -------------------------------------------------------------------------------- 1 | # external_memory_host 2 | 3 | This sample uses VK_EXT_external_memory_host. 4 | This sample renders a rotating cube on the screen, it uses external memory 5 | for model data buffer. 6 | 7 | -------------------------------------------------------------------------------- /application_sandbox/external_memory_host/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | void main() { 22 | out_color = vec4(texcoord, 0.0, 1.0); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /application_sandbox/fence_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(fence_test_shaders 16 | SOURCES 17 | cube.frag 18 | cube.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(fence_test 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | fence_test_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/fence_test/README.md: -------------------------------------------------------------------------------- 1 | # Fence Test 2 | 3 | This sample renders a rotating cube on the screen. It waits for a fence that 4 | will be signaled in the following frame. This is used to test frame loop can 5 | correctly reset the fence during loop. 6 | -------------------------------------------------------------------------------- /application_sandbox/fence_test/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/fill_buffer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(fill_buffer_shaders 16 | SOURCES 17 | fill.frag 18 | fill.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(fill_buffer 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | fill_buffer_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/fill_buffer/fill.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 2) in vec3 normal; 20 | 21 | layout (binding = 2, set = 0) uniform filled_data { 22 | vec4 multiplier; 23 | }; 24 | 25 | void main() { 26 | out_color = vec4(normal * multiplier.xyz, 1.0); 27 | } -------------------------------------------------------------------------------- /application_sandbox/format_feature_flags2/README.md: -------------------------------------------------------------------------------- 1 | # VK_KHR_format_feature_flags2 2 | 3 | This sample tests the VK_KHR_format_feature_flags2 extension. -------------------------------------------------------------------------------- /application_sandbox/format_feature_flags2/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/hdr_metadata/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(hdr_metadata_shaders 16 | SOURCES 17 | hdr_metadata.frag 18 | hdr_metadata.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(hdr_metadata 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | hdr_metadata_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/imageless_framebuffer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_vulkan_sample_application(imageless_framebuffer 16 | SOURCES main.cpp 17 | LIBS 18 | vulkan_helpers 19 | MODELS 20 | standard_models 21 | SHADERS 22 | cube_shaders 23 | ) 24 | -------------------------------------------------------------------------------- /application_sandbox/inline_uniform_block/README.md: -------------------------------------------------------------------------------- 1 | # inline_uniform_block 2 | 3 | This sample renders a rotating cube with texture on the screen. 4 | The alpha value of the texture is updated via the inline uniform block 5 | which is enabled by the device extension of `VK_EXT_inline_uniform_block`. -------------------------------------------------------------------------------- /application_sandbox/khr_image_format_list/README.md: -------------------------------------------------------------------------------- 1 | # khr_image_format_list 2 | 3 | Creates a texture that uses an image for with a compatible format. 4 | Also uses the khr_image_format_list extension to advertise that in advance. -------------------------------------------------------------------------------- /application_sandbox/many_commandbuffers_cube/README.md: -------------------------------------------------------------------------------- 1 | # Cube 2 | 3 | This sample renders a rotating cube on the screen. It is used as the 4 | basis for many other tests. -------------------------------------------------------------------------------- /application_sandbox/many_commandbuffers_cube/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/memory_budget/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(memory_budget_shaders 16 | SOURCES 17 | cube.frag 18 | cube.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(memory_budget 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | memory_budget_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/memory_budget/README.md: -------------------------------------------------------------------------------- 1 | # Memory Budget 2 | 3 | This sample renders a rotating cube on the screen and prints out memory budget 4 | information about each heap to the console. The use of the memory budget 5 | extension is enabled by requesting the instance extension 6 | `VK_KHR_get_physical_device_properties2` and the device extension 7 | `VK_EXT_memory_budget`. -------------------------------------------------------------------------------- /application_sandbox/memory_budget/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/memory_model/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(memory_model_shaders 16 | SOURCES 17 | triangle.frag 18 | triangle.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(memory_model 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | SHADERS 28 | memory_model_shaders 29 | ) 30 | -------------------------------------------------------------------------------- /application_sandbox/mixed_sample_count/README.md: -------------------------------------------------------------------------------- 1 | # mixed_sample_count 2 | 3 | This sample renders a rotating cube on a black floor with the reflection of the 4 | cube shown on the floor. The reflection cube is confined within the floor by 5 | using stencil buffer. The stencil buffer is multisampled at the default 6 | multisample count to improve coverage and the color buffer is sampled once. The 7 | mixed sample count is controlled by calling the functions `EnableMultisampling` 8 | and `EnableMixedMultisampling`. The use of mixed sample count is enabled by 9 | requesting the `VK_AMD_mixed_attachment_samples` 10 | -------------------------------------------------------------------------------- /application_sandbox/mixed_sample_count/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/mixed_sample_count/floor.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | 20 | void main() { 21 | out_color = vec4(0.0, 0.0, 0.0, 1.0); 22 | } 23 | -------------------------------------------------------------------------------- /application_sandbox/multigpu_particles/README.md: -------------------------------------------------------------------------------- 1 | # MultiGPU Particles 2 | 3 | This sample is WIP. In that it is not very well tested yet. 4 | The intended behavior is that for a multi-gpu context, this 5 | will simulate particles on one GPU, and render them on the 6 | other. 7 | 8 | In general, because the particles are small and plentiful, 9 | you should run with `-w=1000 -h=1000` otherwise you may not 10 | see them` 11 | 12 | Given that the simulation and rendering are independent 13 | operations, this should provide some amount of benefit. 14 | 15 | You can make tweaks to: 16 | 17 | `particle_data_shared.h:TOTAL_PARTICLES` \ 18 | `particle_velocity_update.comp:PARTICLE_SPLIT` 19 | 20 | in order to change the proportion of compute vs 21 | raster work. 22 | -------------------------------------------------------------------------------- /application_sandbox/multiplanar_image_disjoint/README.md: -------------------------------------------------------------------------------- 1 | # Multiplanar Image Disjoint 2 | 3 | This sample renders a rotating cube with a disjoint multiplanar texture that is 4 | sampled with a VkSamplerYcbcrConversion. Sampler Y’CBCR conversion and disjoint 5 | multiplanar image memory is enabled by requesting the 6 | `VK_KHR_get_physical_device_properties2` instance extension and the device 7 | extensions `VK_KHR_maintenance1`, `VK_KHR_get_memory_requirements2`, 8 | `VK_KHR_bind_memory2`, and `VK_KHR_sampler_ycbcr_conversion`. The multiplanar 9 | image is allocated with disjoint memory when the `VK_IMAGE_CREATE_DISJOINT_BIT` 10 | flag is passed in a texture's `InitializeData` function. 11 | -------------------------------------------------------------------------------- /application_sandbox/multiplanar_image_explicit/README.md: -------------------------------------------------------------------------------- 1 | # Multiplanar Image Explicit 2 | 3 | This sample renders a rotating cube with a multiplanar texture that is 4 | explicitly reconstructed with a VkSamplerYcbcrConversion. The sampler Y’CBCR 5 | conversion feature is enabled by requesting the 6 | `VK_KHR_get_physical_device_properties2` instance extension and the device 7 | extensions `VK_KHR_maintenance1`, `VK_KHR_get_memory_requirements2`, and 8 | `VK_KHR_sampler_ycbcr_conversion`. Explicit reconstruction is controlled by the 9 | forceExplicitReconstruction flag in `VkSamplerYcbcrConversionCreateInfo`. -------------------------------------------------------------------------------- /application_sandbox/multiplanar_image_non_disjoint/README.md: -------------------------------------------------------------------------------- 1 | # Multiplanar Image Non-Disjoint 2 | 3 | This sample renders a rotating cube with a multiplanar texture that is 4 | sampled with a VkSamplerYcbcrConversion. The sampler Y’CBCR conversion 5 | feature is enabled by requesting the `VK_KHR_get_physical_device_properties2` 6 | instance extension and the device extensions `VK_KHR_maintenance1`, 7 | `VK_KHR_get_memory_requirements2`, and `VK_KHR_sampler_ycbcr_conversion`. 8 | -------------------------------------------------------------------------------- /application_sandbox/mutable_swapchain_format/README.md: -------------------------------------------------------------------------------- 1 | # Mutable Swapchain Format 2 | 3 | This sample renders a rotating cube on the screen with a swapchain that is 4 | created with a UNORM format and image views with a SRGB format. To enable the 5 | creation of a swapchain with a mutable format the device extensions 6 | `VK_KHR_maintenance2`, `VK_KHR_image_format_list`, and 7 | `VK_KHR_swapchain_mutable_format` are requested. The creation of a swapchain 8 | with a mutable format is controlled by providing a 9 | `VkImageFormatListCreateInfoKHR` and setting the swapchain create info flag 10 | `VK_SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR`. -------------------------------------------------------------------------------- /application_sandbox/mutable_swapchain_format/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/overlapping_frames/README.md: -------------------------------------------------------------------------------- 1 | # Overlapping Frames 2 | 3 | This sample renders a rotating triangle using overlapping frames, i.e. at each 4 | main loop iteration, parts of several frames' rendering are being submitted. 5 | 6 | This technique is used by some engines to pipeline frame rendering work. For 7 | instance, a given rendering loop iteration may submit work for: the gbuffer 8 | rendering of frame N+1, and the post-processing rendering and presentation of 9 | frame N. 10 | 11 | See the top-level comment in the source code for details about this sample 12 | structure, and the associated Vulkan synchronization. 13 | -------------------------------------------------------------------------------- /application_sandbox/overlapping_frames/postprocessing.vert: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | #include "models/model_setup.glsl" 18 | 19 | layout(location = 0) out vec2 fragTexCoord; 20 | 21 | void main() { 22 | gl_Position = get_position(); 23 | fragTexCoord = get_texcoord(); 24 | } 25 | -------------------------------------------------------------------------------- /application_sandbox/overlapping_frames/triangle.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | #extension GL_ARB_separate_shader_objects : enable 18 | 19 | layout(location = 0) in vec3 fragColor; 20 | layout(location = 0) out vec4 outColor; 21 | 22 | void main() { 23 | outColor = vec4(fragColor, 1.0); 24 | } 25 | -------------------------------------------------------------------------------- /application_sandbox/passthrough/passthrough.glsl.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | 17 | #version 450 18 | 19 | layout (location = 0) in vec4 in_color; 20 | layout (location = 0) out vec4 out_color; 21 | 22 | void main() { 23 | out_color = in_color; 24 | } 25 | -------------------------------------------------------------------------------- /application_sandbox/passthrough/passthrough.glsl.vert: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | 17 | #version 450 18 | 19 | layout (location = 0) in vec4 position; 20 | layout (location = 1) in vec4 in_color; 21 | layout (location = 0) out vec4 out_color; 22 | 23 | void main() { 24 | gl_Position = position; 25 | out_color = in_color; 26 | } 27 | -------------------------------------------------------------------------------- /application_sandbox/passthrough/passthrough.hlsl.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | 17 | float4 main(float4 input: COLOR): SV_TARGET 18 | { 19 | return input; 20 | } 21 | -------------------------------------------------------------------------------- /application_sandbox/passthrough/passthrough.hlsl.vert: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | 17 | struct PSInput { 18 | float4 position : SV_POSITION; 19 | float4 color : COLOR; 20 | }; 21 | 22 | PSInput main(float4 position: POSITION, float4 color: COLOR) { 23 | PSInput result; 24 | result.position = position; 25 | result.color = color; 26 | return result; 27 | } 28 | 29 | -------------------------------------------------------------------------------- /application_sandbox/pci_bus_info/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(pci_bus_info_shaders 16 | SOURCES 17 | cube.frag 18 | cube.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(pci_bus_info 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | pci_bus_info_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/pci_bus_info/README.md: -------------------------------------------------------------------------------- 1 | # PCI Bus Info 2 | 3 | This sample gets `VkPhysicalDevicePCIBusInfoPropertiesEXT` and prints the 4 | information out to the console. The querying of this information is enabled by 5 | requesting the instance extension `VK_KHR_get_physical_device_properties2` and 6 | the device extension `VK_EXT_pci_bus_info`. -------------------------------------------------------------------------------- /application_sandbox/pci_bus_info/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/pipeline_creation_feedback/README.md: -------------------------------------------------------------------------------- 1 | # Pipeline Creation Feedback 2 | 3 | This sample renders a rotating cube on the screen and prints out the pipeline 4 | creation feedback information to the console. The use of pipeline creation 5 | feedback is enabled by requesting the `VK_EXT_pipeline_creation_feedback` device 6 | extension. Pipeline creation feedback is then aquired by setting a 7 | `VkPipelineCreationFeedbackCreateInfoEXT` as a pipline extension with the 8 | function `SetPipelineExtensions`. -------------------------------------------------------------------------------- /application_sandbox/pipeline_creation_feedback/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/pipeline_executable_properties/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_vulkan_sample_application(pipeline_executable_properties 16 | SOURCES main.cpp 17 | LIBS 18 | vulkan_helpers 19 | MODELS 20 | standard_models 21 | SHADERS 22 | cube_shaders 23 | ) 24 | -------------------------------------------------------------------------------- /application_sandbox/present_region/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(present_region_shaders 16 | SOURCES 17 | cube.frag 18 | cube.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(present_region 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | present_region_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/present_region/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/private_data/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(private_data_shaders 16 | SOURCES 17 | cube.frag 18 | cube.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(private_data 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | private_data_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/private_data/README.md: -------------------------------------------------------------------------------- 1 | # private_data 2 | 3 | This sample renders a rotating cube on the screen. It uses the 4 | VK_EXT_private_data extension to store a constant associated with 5 | a VkBuffer, and verifies the stored constant value before updating 6 | the rotation matrix. 7 | -------------------------------------------------------------------------------- /application_sandbox/private_data/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | void main() { 22 | out_color = vec4(texcoord, 0.0, 1.0); 23 | } 24 | -------------------------------------------------------------------------------- /application_sandbox/protected_memory/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(protected_memory_shaders 16 | SOURCES 17 | cube.frag 18 | cube.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(protected_memory 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | protected_memory_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/protected_memory/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/push_descriptor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(push_descriptor_shaders 16 | SOURCES 17 | cube.frag 18 | cube.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(push_descriptor 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | push_descriptor_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/push_descriptor/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/render_3d_image/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(render_3d_image_shaders 16 | SOURCES 17 | cube.frag 18 | cube.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(render_3d_image 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | render_3d_image_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/render_3d_image/README.md: -------------------------------------------------------------------------------- 1 | # Render 3D Image Slice 2 | 3 | This sample renders a slice of a 3D image, then copies the rendered slice to 4 | swapchain image and presents the content. 5 | -------------------------------------------------------------------------------- /application_sandbox/render_3d_image/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/render_depth_attachment/README.md: -------------------------------------------------------------------------------- 1 | # Render Depth Attachment 2 | 3 | This sample renders the raw data to a quad image to a depth attachment, then 4 | use the depth attachment as an input attachment to render the output. The 5 | width and height of the rendering targets (the swapchain images) must be at 6 | least as large as 400x400, i.e. run with argument `-w=400 -h=400` or larger 7 | numbers. 8 | -------------------------------------------------------------------------------- /application_sandbox/render_depth_attachment/final.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | precision highp float; 19 | 20 | layout(location = 0) out vec4 out_color; 21 | 22 | layout(input_attachment_index = 0, binding = 0, set = 0) uniform subpassInput depth_data; 23 | 24 | void main() { 25 | out_color = subpassLoad(depth_data).rrrr; 26 | } 27 | -------------------------------------------------------------------------------- /application_sandbox/render_depth_attachment/passthrough.vert: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | #include "models/model_setup.glsl" 18 | 19 | void main() { 20 | gl_Position = get_position(); 21 | } -------------------------------------------------------------------------------- /application_sandbox/render_input_attachment/README.md: -------------------------------------------------------------------------------- 1 | # Render Input Attachment 2 | 3 | This sample renders the raw data to a quad image to a color attachment, then 4 | use the color attachment as an input attachment to render the output. The 5 | width and height of the rendering targets (the swapchain images) must be at 6 | least as large as 400x400, i.e. run with argument `-w=400 -h=400` or larger 7 | numbers. -------------------------------------------------------------------------------- /application_sandbox/render_input_attachment/intermediate.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out uvec4 out_color; 19 | 20 | layout(input_attachment_index = 0, binding = 0, set = 0) uniform usubpassInput color_data; 21 | 22 | void main() { 23 | out_color = subpassLoad(color_data); 24 | } -------------------------------------------------------------------------------- /application_sandbox/render_input_attachment/passthrough.vert: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | #include "models/model_setup.glsl" 18 | 19 | void main() { 20 | gl_Position = get_position(); 21 | } -------------------------------------------------------------------------------- /application_sandbox/render_quad/README.md: -------------------------------------------------------------------------------- 1 | # Render Quad 2 | 3 | This sample renders an array of data to a quad image. The width and height of 4 | the rendering targets (the swapchain images) must be at least as large as 5 | 400x400, i.e. run with argument `-w=400 -h=400` or larger numbers. -------------------------------------------------------------------------------- /application_sandbox/render_quad/render_quad.vert: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | #include "models/model_setup.glsl" 18 | 19 | void main() { 20 | gl_Position = get_position(); 21 | } -------------------------------------------------------------------------------- /application_sandbox/robustness2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(robustness2_shaders 16 | SOURCES 17 | robustness2.frag 18 | robustness2.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(robustness2 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | robustness2_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/robustness2/README.md: -------------------------------------------------------------------------------- 1 | # robustness2 2 | 3 | 4 | This sample displays a rotating colourful cube and demonstrates the 5 | use of the VK_EXT_robustness2 extension. 6 | 7 | It uses the following: 8 | - out of bounds uniform buffer access 9 | - out of bounds storage buffer access 10 | - out of bounds image access 11 | - null descriptor set 12 | -------------------------------------------------------------------------------- /application_sandbox/sample_application_framework/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_vulkan_static_library(sample_application 16 | SOURCES 17 | sample_application.cpp 18 | sample_application.h 19 | LIBS 20 | vulkan_helpers 21 | ) 22 | -------------------------------------------------------------------------------- /application_sandbox/sample_application_framework/README.md: -------------------------------------------------------------------------------- 1 | # Sample Application Framework 2 | 3 | This is the main helper class from which all sample applications 4 | inherit. 5 | 6 | -------------------------------------------------------------------------------- /application_sandbox/sample_application_framework/sample_application.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Google Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Intentionally empty so that we create an actual .a file. -------------------------------------------------------------------------------- /application_sandbox/sample_locations/README.md: -------------------------------------------------------------------------------- 1 | # Sample Locations 2 | 3 | This sample renders a rotating cube on a black floor with the reflection of the 4 | cube shown on the floor the same way as in the stencil application. The stencil 5 | and depth buffer are multisampled with non-default sample locations using the 6 | sample locations extension. The use of sample locations is enabled by requesting 7 | the instance extension `VK_KHR_get_physical_device_properties2` and the device 8 | extension `VK_EXT_sample_locations`. Sample locations are controlled by 9 | extending the pipeline creation info with 10 | `VkPipelineSampleLocationsStateCreateInfoEXT` when creating the pipeline and 11 | extending the render pass begin info with 12 | `VkRenderPassSampleLocationsBeginInfoEXT`. -------------------------------------------------------------------------------- /application_sandbox/sample_locations/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/sample_locations/floor.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | 20 | void main() { 21 | out_color = vec4(0.0, 0.0, 0.0, 1.0); 22 | } 23 | -------------------------------------------------------------------------------- /application_sandbox/sampler_minmax/README.md: -------------------------------------------------------------------------------- 1 | # Sampler MinMax 2 | 3 | Draws a single textured cube on the screen. The texture is sampled using an 4 | extension to use a sampler reduction mode. -------------------------------------------------------------------------------- /application_sandbox/sampler_mirror_clamp_to_edge/README.md: -------------------------------------------------------------------------------- 1 | # Sampler Mirror Clamp To Edge 2 | 3 | Draws a single textured cube on the screen that is sampled with the 4 | `VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE` address mode. The use of mirror 5 | clamp to edge is enabled by requesting the device extension 6 | `VK_KHR_sampler_mirror_clamp_to_edge` -------------------------------------------------------------------------------- /application_sandbox/scalar_block_layout/README.md: -------------------------------------------------------------------------------- 1 | # Scalar Block Layout 2 | 3 | This sample renders a rotating cube on the screen and uses a uniform buffer with 4 | a scalar block layout to store color information. To enable the use of the 5 | scalar block layout the instance extension 6 | `VK_KHR_get_physical_device_properties2` and device extension 7 | `VK_EXT_scalar_block_layout` are requested. -------------------------------------------------------------------------------- /application_sandbox/scalar_block_layout/scalar_block_layout.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | layout (location = 2) in vec3 color; 21 | 22 | 23 | 24 | void main() { 25 | out_color = vec4(texcoord, 1.0, 1.0); 26 | out_color = out_color * vec4(color, 1.0); 27 | } -------------------------------------------------------------------------------- /application_sandbox/separate_depth_stencil_layouts/README.md: -------------------------------------------------------------------------------- 1 | # separate_depth_stencil_layouts 2 | 3 | Similar to depth_stencil_resolve, but vkCreatePhysicalDevice() has a 4 | VkPhysicalDeviceFeatures2 passed as the pNext, with a 5 | VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures set as the features' pNext. 6 | We utilize this with two image barriers each renderpass that only affect the 7 | depth/stencil image's depth aspect, to enable writing then reading a depth 8 | image. 9 | -------------------------------------------------------------------------------- /application_sandbox/separate_depth_stencil_layouts/torus.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | 20 | void main() { out_color = vec4(0.0, 0.0, 0.0, 1.0); } 21 | -------------------------------------------------------------------------------- /application_sandbox/separate_stencil_usage/README.md: -------------------------------------------------------------------------------- 1 | # Separate Stencil Usage 2 | 3 | This sample exercises the extension VK_EXT_separate_stencil_usage by creating 4 | a depth/stencil image where only the stencil aspect can be used as an input 5 | attachment. The sample first draws a cube and a plane, the pixels for the plane 6 | are also written to the stencil buffer. A second pass uses a full screen quad 7 | to draw the stencil buffer onto the right hand side of the image (creating a 8 | sort of color/stencil side-by-side). This second pass uses the stencil buffer 9 | as an input attachment to the fragment shader, which is made possible with the 10 | separate stencil usages (the depth aspect only supports depth/stencil attachment 11 | usage). 12 | -------------------------------------------------------------------------------- /application_sandbox/separate_stencil_usage/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout (location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | void main() { 22 | out_color = vec4(texcoord, 0.0, 1.0); 23 | } -------------------------------------------------------------------------------- /application_sandbox/separate_stencil_usage/floor.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout (location = 0) out vec4 out_color; 19 | 20 | void main() { 21 | out_color = vec4(0.2, 0.4, 0.8, 1.0); 22 | } 23 | -------------------------------------------------------------------------------- /application_sandbox/separate_stencil_usage/plane.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout (location = 0) out vec4 out_color; 19 | 20 | layout (input_attachment_index = 0, binding = 0, set = 0) uniform usubpassInput stencil; 21 | 22 | void main() { 23 | out_color = subpassLoad(stencil).rrrr; 24 | } 25 | -------------------------------------------------------------------------------- /application_sandbox/separate_stencil_usage/plane.vert: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | #include "models/model_setup.glsl" 18 | 19 | void main() { 20 | gl_Position = get_position(); 21 | } -------------------------------------------------------------------------------- /application_sandbox/set_event/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(set_event_shaders 16 | SOURCES 17 | set_event.frag 18 | set_event.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(set_event 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | set_event_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/set_event/README.md: -------------------------------------------------------------------------------- 1 | # Set Event 2 | 3 | This sample uses `VkEvent` and calls `vkSetEvent` and `vkCmdWaitEvents` to 4 | synchronize between host and device, to pass RGBA data for rendering. 5 | -------------------------------------------------------------------------------- /application_sandbox/shader_16bit_storage/README.md: -------------------------------------------------------------------------------- 1 | # shader_16bit_storage 2 | 3 | This sample renders a rotating cube on the screen, that fades in and out. 4 | Uses the VK_KHR_16bit_storage extension. 5 | -------------------------------------------------------------------------------- /application_sandbox/shader_core_properties/README.md: -------------------------------------------------------------------------------- 1 | # Shader Core Properties 2 | 3 | This sample renders a rotating cube on the screen and prints out the shader core 4 | properties to the console. The use of shader core properties is enabled by 5 | requesting the instance extension `VK_KHR_get_physical_device_properties2` and 6 | the device extension `VK_AMD_shader_core_properties`. -------------------------------------------------------------------------------- /application_sandbox/shader_core_properties/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/shader_demote/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(shader_demote_shaders 16 | SOURCES 17 | cube.frag 18 | cube.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(shader_demote 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | shader_demote_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/shader_demote/README.md: -------------------------------------------------------------------------------- 1 | # shader_demote 2 | 3 | This sample renders a rotating cube with a cut out circle in the middle 4 | of each face of the cube. It uses VK_EXT_shader_demote_to_helper_invocation 5 | Vulkan extension and "demote" keyword in the fragment shader to ignore 6 | output to framebuffer for some invocations. 7 | -------------------------------------------------------------------------------- /application_sandbox/shader_float16_int8/README.md: -------------------------------------------------------------------------------- 1 | # Shader Float16 Int8 2 | 3 | This sample renders a rotating cube on the screen with color data stored in 8bit 4 | integers and modified with float16 operations. The use of 16bit floats and 8bit 5 | integers is enabled by requesting the instance extension 6 | `VK_KHR_get_physical_device_properties2` and the device extensions 7 | `VK_KHR_storage_buffer_storage_class`, `VK_KHR_8bit_storage` and 8 | `VK_KHR_shader_float16_int8`. -------------------------------------------------------------------------------- /application_sandbox/shader_float_controls/README.md: -------------------------------------------------------------------------------- 1 | # Shader Float Controls 2 | 3 | This sample renders a rotating cube with color output calculated by a function 4 | that tests `VK_KHR_shader_float_controls`. Shader float controls are enabled by 5 | requesting the `VK_KHR_get_physical_device_properties2` instance extension and 6 | the device extension `VK_KHR_shader_float_controls`. The various shader float 7 | controls are enabled in the SPIR-V assembly shaders. -------------------------------------------------------------------------------- /application_sandbox/shader_info/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(shader_info_shaders 16 | SOURCES 17 | cube.frag 18 | cube.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(shader_info 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | shader_info_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/shader_info/README.md: -------------------------------------------------------------------------------- 1 | # Shader Info 2 | 3 | This sample renders a rotating cube on the screen and prints shader information 4 | and disassembly to the console. The use of shader info is enabled by requesting 5 | the device extension `VK_AMD_shader_info`. -------------------------------------------------------------------------------- /application_sandbox/shader_info/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/shared_presentable_image/README.md: -------------------------------------------------------------------------------- 1 | # Shared Presentable Image 2 | 3 | This sample renders a rotating cube on the screen using a swapchain with shared 4 | presentable images. The use of shared presentable images are enabled by 5 | requesting the instance extensions `VK_KHR_get_physical_device_properties2`, 6 | `VK_KHR_get_surface_capabilities2`, and requesting the device extension 7 | `VK_KHR_shared_presentable_image`. -------------------------------------------------------------------------------- /application_sandbox/shared_presentable_image/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/simple_compute/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(simple_compute_shaders 16 | SOURCES 17 | add_numbers.comp 18 | SHADER_DEPS 19 | shader_library 20 | ) 21 | 22 | add_vulkan_sample_application(simple_compute 23 | SOURCES main.cpp 24 | inputs.h 25 | LIBS 26 | vulkan_helpers 27 | SHADERS 28 | simple_compute_shaders 29 | ) 30 | -------------------------------------------------------------------------------- /application_sandbox/simple_compute/README.md: -------------------------------------------------------------------------------- 1 | # Simple Compute 2 | 3 | This sample just simply runs a computer shader. It computes the pariwise sum of 4 | each element in A and B and places them in C -------------------------------------------------------------------------------- /application_sandbox/simple_compute/inputs.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // Leave this define here, it is needed for the loop unroller 17 | 18 | #define LOCAL_X_SIZE 128 19 | const int kLocalXSize = LOCAL_X_SIZE; 20 | const int kNumStorageBuffers = 12; 21 | -------------------------------------------------------------------------------- /application_sandbox/sparse_binding/README.md: -------------------------------------------------------------------------------- 1 | # Sparse Binding 2 | 3 | Draws a single cube, whose texture is stored in a sparse binding image. 4 | -------------------------------------------------------------------------------- /application_sandbox/spirv_1_4/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | add_shader_library(spirv_1_4_shaders 15 | SOURCES 16 | spirv_1_4.frag.spvasm 17 | spirv_1_4.vert.spvasm 18 | SHADER_DEPS 19 | shader_library 20 | ) 21 | 22 | add_vulkan_sample_application(spirv_1_4 23 | SOURCES main.cpp 24 | LIBS 25 | vulkan_helpers 26 | MODELS 27 | standard_models 28 | SHADERS 29 | spirv_1_4_shaders 30 | ) 31 | -------------------------------------------------------------------------------- /application_sandbox/spirv_1_4/README.md: -------------------------------------------------------------------------------- 1 | # SPIR-V 1.4 2 | 3 | This sample renders a rotating cube with color output calculated by a function 4 | that tests `VK_KHR_shader_float_controls` as part of `VK_KHR_spirv_1_4`. Shader float controls are enabled by 5 | requesting the `VK_KHR_get_physical_device_properties2` instance extension and 6 | the device extension `VK_KHR_spirv_1_4`. The various shader float 7 | controls are enabled in the SPIR-V assembly shaders. -------------------------------------------------------------------------------- /application_sandbox/standard_uniform_buffer_layout/README.md: -------------------------------------------------------------------------------- 1 | # Standard Uniform Buffer Layout 2 | 3 | This sample renders a rotating cube on the screen and uses a uniform buffer with 4 | a standard uniform buffer layout to store color information. The use of the 5 | standard uniform buffer layout is enabled by requesting the instance extension 6 | `VK_KHR_get_physical_device_properties2` and device extension 7 | `VK_KHR_uniform_buffer_standard_layout`. -------------------------------------------------------------------------------- /application_sandbox/standard_uniform_buffer_layout/standard_uniform_buffer_layout.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | layout (location = 2) in vec3 color; 21 | 22 | 23 | 24 | void main() { 25 | out_color = vec4(texcoord, 1.0, 1.0); 26 | out_color = out_color * vec4(color, 1.0); 27 | } -------------------------------------------------------------------------------- /application_sandbox/stencil/README.md: -------------------------------------------------------------------------------- 1 | # Stencil 2 | 3 | This sample renders a rotating cube on a black floor with the reflection of the 4 | cube shown on the floor. The reflection cube is confined within the floor by 5 | using stencil buffer. The actual value in the stencil buffer and the value used 6 | to compare with the stencil buffer in a stencil test is controlled by calls to 7 | `vkCmdSetStencilReference`, `vkCmdSetStencilWriteMask` and 8 | `vkCmdSetStencilCompareMask`. 9 | -------------------------------------------------------------------------------- /application_sandbox/stencil/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/stencil/floor.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | 20 | void main() { 21 | out_color = vec4(0.0, 0.0, 0.0, 1.0); 22 | } 23 | -------------------------------------------------------------------------------- /application_sandbox/stencil_export/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(stencil_export_shaders 16 | SOURCES 17 | line.frag 18 | line.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(stencil_export 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | SHADERS 28 | stencil_export_shaders 29 | ) 30 | -------------------------------------------------------------------------------- /application_sandbox/storage_8bit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(storage_8bit_shaders 16 | SOURCES 17 | storage_8bit.frag 18 | storage_8bit.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(storage_8bit 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | storage_8bit_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/storage_8bit/README.md: -------------------------------------------------------------------------------- 1 | # Storage 8bit 2 | 3 | This sample renders a rotating cube on the screen with color data stored in 8bit 4 | integers. The use of 8bit storage is enabled by requesting the instance 5 | extension `VK_KHR_get_physical_device_properties2` and the device extensions 6 | `VK_KHR_storage_buffer_storage_class` and `VK_KHR_8bit_storage`. -------------------------------------------------------------------------------- /application_sandbox/storage_8bit/storage_8bit.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | layout (location = 2) in float red; 21 | layout (location = 3) in float green; 22 | layout (location = 4) in float blue; 23 | 24 | void main() { 25 | out_color = vec4(texcoord * vec2(red, green), blue, 1.0); 26 | } -------------------------------------------------------------------------------- /application_sandbox/subgroup_ballot/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(subgroup_ballot_shaders 16 | SOURCES 17 | triangle.frag 18 | triangle.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(subgroup_ballot 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | SHADERS 28 | subgroup_ballot_shaders 29 | ) 30 | -------------------------------------------------------------------------------- /application_sandbox/subgroup_vote/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(subgroup_vote_shaders 16 | SOURCES 17 | triangle.frag 18 | triangle.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(subgroup_vote 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | SHADERS 28 | subgroup_vote_shaders 29 | ) 30 | -------------------------------------------------------------------------------- /application_sandbox/swapchain_colorspace/README.md: -------------------------------------------------------------------------------- 1 | # Swapchain Colorspace 2 | 3 | This sample renders a rotating cube on the screen with swapchain that uses an 4 | extended colorspace if one is available. The use of extended swapchain 5 | colorspaces is enabled by requesting the instance extensions 6 | `VK_EXT_swapchain_colorspace` and `VK_KHR_get_surface_capabilities2`. The option 7 | of using an extended colorspace is controlled by setting the extended swapchain 8 | colorspace flag in `SampleOptions` with the function 9 | `EnableExtendedSwapchainColorSpace`. -------------------------------------------------------------------------------- /application_sandbox/swapchain_colorspace/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/synchronization2_async_compute/README.md: -------------------------------------------------------------------------------- 1 | # Async Compute (VK_KHR_synchronization2 version) 2 | 3 | This is based on the async_compute sample, using the VK_KHR_synchronization2 4 | extension. Specifically, this uses the vkQueueSubmit2KHR and 5 | vkCmdPipelineBarrier2KHR commands. -------------------------------------------------------------------------------- /application_sandbox/synchronization2_blit_image/README.md: -------------------------------------------------------------------------------- 1 | # Blit Image (VK_KHR_synchronization2 version) 2 | 3 | This is based on the blit_image sample, using the VK_KHR_synchronization2 4 | extension. Specifically, this uses the vkQueueSubmit2KHR and 5 | vkCmdPipelineBarrier2KHR commands. -------------------------------------------------------------------------------- /application_sandbox/synchronization2_blit_image/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/synchronization2_set_event/README.md: -------------------------------------------------------------------------------- 1 | # Set Event (VK_KHR_synchronization2 version) 2 | 3 | This is based on the set_event sample, using the VK_KHR_synchronization2 4 | extension. Specifically, this uses the vkCmdWaitEvents2KHR and 5 | vkQueueSubmit2KHR. -------------------------------------------------------------------------------- /application_sandbox/synchronization2_timeline_semaphore_simple/README.md: -------------------------------------------------------------------------------- 1 | # Timeline Semaphore Simple (VK_KHR_synchronization2 version) 2 | 3 | This is based on the timeline_semaphore_simple sample, using the VK_KHR_synchronization2 4 | extension. Specifically, this uses the vkQueueSubmit2KHR and VkSemaphoreSubmitInfoKHR. -------------------------------------------------------------------------------- /application_sandbox/synchronization2_timeline_semaphore_simple/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/synchronization2_write_timestamp/README.md: -------------------------------------------------------------------------------- 1 | # Write Timestamp (VK_KHR_synchronization2 version) 2 | 3 | This is based on the async_compute sample, using the VK_KHR_synchronization2 4 | extension. Specifically, this uses the vkQueueSubmit2KHR, 5 | vkCmdPipelineBarrier2KHR, vkCmdWriteTimestamp2KHR. 6 | -------------------------------------------------------------------------------- /application_sandbox/texel_buffer_alignment/README.md: -------------------------------------------------------------------------------- 1 | # VK_EXT_texel_buffer_alignment 2 | 3 | This sample exercises the VK_EXT_texel_buffer_alignment extension by allocating two 4 | types of texel buffers (one storage and one uniform) with the minimum required 5 | offset alignment. This minimum is queried from the device properties structure 6 | provided via this extension. The resulting buffers are then used in a shader 7 | to render a textured cube. The texture is a rough 2x3 texture where the top 1x3 8 | row is sourced from the uniform buffer and the bottom row from the storage 9 | buffer. The buffers are dynamically updated each frame to demonstrate that data 10 | can be written with the effective buffer offset alignment. 11 | -------------------------------------------------------------------------------- /application_sandbox/textured_cube/README.md: -------------------------------------------------------------------------------- 1 | # Textured Cube 2 | 3 | Draws a single textured cube on the screen. -------------------------------------------------------------------------------- /application_sandbox/timeline_semaphore_cross_queue/README.md: -------------------------------------------------------------------------------- 1 | # Timeline Semaphore CrossQueue 2 | 3 | Draws a simple cube on the screen. Unlike the timeline_semaphore_simple, 4 | this updates that draw matrix on a separate queue, and then transfers 5 | to the render queue. Most notably this runs the queue submits out of order. 6 | -------------------------------------------------------------------------------- /application_sandbox/timeline_semaphore_cross_queue/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/timeline_semaphore_host_signal_after_submit/README.md: -------------------------------------------------------------------------------- 1 | # Timeline Semaphore Host Signal After Submit 2 | 3 | Draws a simple cube on the screen. Inserts a timeline semaphore between 4 | the VkAcquireNextImage and main Submission, and uses the same timeline 5 | semaphore between the main submission and a dummy submission to signal 6 | VkQueuePresentKHR. 7 | 8 | As opposed to Timeline Semaphore Simple, this causes the queue to stall 9 | for approx 100ms after the call to VkQueueSubmit. -------------------------------------------------------------------------------- /application_sandbox/timeline_semaphore_host_signal_after_submit/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/timeline_semaphore_simple/README.md: -------------------------------------------------------------------------------- 1 | # Timeline Semaphore Simple 2 | 3 | Draws a simple cube on the screen. Inserts a timeline semaphore between 4 | the VkAcquireNextImage and main Submission, and uses the same timeline 5 | semaphore between the main submission and a dummy submission to signal 6 | VkQueuePresentKHR. -------------------------------------------------------------------------------- /application_sandbox/timeline_semaphore_simple/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/tooling_info/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(tooling_info_shaders 16 | SOURCES 17 | cube.frag 18 | cube.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(tooling_info 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | tooling_info_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/tooling_info/README.md: -------------------------------------------------------------------------------- 1 | # Tooling Info 2 | 3 | This sample renders a rotating cube on the screen and prints out tooling 4 | information to the console. The use of tooling information is enabled by 5 | requesting the device extension `VK_EXT_tooling_info`. 6 | -------------------------------------------------------------------------------- /application_sandbox/tooling_info/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } 26 | -------------------------------------------------------------------------------- /application_sandbox/transform_feedback/README.md: -------------------------------------------------------------------------------- 1 | # Transform Feedback 2 | 3 | This sample renders a rotating particle system that is updated using transform 4 | feedback. 5 | -------------------------------------------------------------------------------- /application_sandbox/transform_feedback/particle.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout(location = 1) in vec3 color; 20 | 21 | 22 | void main() { 23 | out_color = vec4(color, 0.75f); 24 | } -------------------------------------------------------------------------------- /application_sandbox/viewport_index/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(viewport_index_shaders 16 | SOURCES 17 | cube.frag 18 | cube.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(viewport_index 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | viewport_index_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/viewport_index/cube.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 out_color; 19 | layout (location = 1) in vec2 texcoord; 20 | 21 | 22 | 23 | void main() { 24 | out_color = vec4(texcoord, 0.0, 1.0); 25 | } -------------------------------------------------------------------------------- /application_sandbox/wait_fence_partial/README.md: -------------------------------------------------------------------------------- 1 | # Wait Fence Partial 2 | 3 | This sample renders a triangle with a post-processing effect split into two render passes. 4 | Each renderpass uses a different fence and with this example, we can test waiting on multiple 5 | fences without waiting for all. 6 | 7 | -------------------------------------------------------------------------------- /application_sandbox/wait_fence_partial/postprocessing.vert: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | #include "models/model_setup.glsl" 18 | 19 | layout(location = 0) out vec2 fragTexCoord; 20 | 21 | void main() { 22 | gl_Position = get_position(); 23 | fragTexCoord = get_texcoord(); 24 | } 25 | -------------------------------------------------------------------------------- /application_sandbox/wait_fence_partial/triangle.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | #extension GL_ARB_separate_shader_objects : enable 18 | 19 | layout(location = 0) in vec3 fragColor; 20 | layout(location = 0) out vec4 outColor; 21 | 22 | void main() { 23 | outColor = vec4(fragColor, 1.0); 24 | } 25 | -------------------------------------------------------------------------------- /application_sandbox/wireframe/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_shader_library(wireframe_shaders 16 | SOURCES 17 | wireframe.frag 18 | wireframe.vert 19 | SHADER_DEPS 20 | shader_library 21 | ) 22 | 23 | add_vulkan_sample_application(wireframe 24 | SOURCES main.cpp 25 | LIBS 26 | vulkan_helpers 27 | MODELS 28 | standard_models 29 | SHADERS 30 | wireframe_shaders 31 | ) 32 | -------------------------------------------------------------------------------- /application_sandbox/wireframe/README.md: -------------------------------------------------------------------------------- 1 | # Wireframe 2 | 3 | Draws a wireframe torus knot. -------------------------------------------------------------------------------- /application_sandbox/write_timestamp/README.md: -------------------------------------------------------------------------------- 1 | # Write Timestamp 2 | 3 | This sample renders a wireframe torus that is shaded based on the pipeline 4 | timestamp value in the previous frame. 5 | -------------------------------------------------------------------------------- /cmake/android_project_template/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /cmake/android_project_template/app/CMakeLists.txt.in: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | 17 | cmake_minimum_required(VERSION 3.4.1) 18 | 19 | set(CMAKE_GLSL_COMPILER @CMAKE_GLSL_COMPILER@) 20 | set(OUTPUT_FRAME @OUTPUT_FRAME@) 21 | set(OUTPUT_FILE @OUTPUT_FILE@) 22 | set(DEFAULT_WINDOW_WIDTH @DEFAULT_WINDOW_WIDTH@) 23 | set(DEFAULT_WINDOW_HEIGHT @DEFAULT_WINDOW_HEIGHT@) 24 | add_subdirectory(@VulkanTestApplications_SOURCE_DIR@ br) 25 | -------------------------------------------------------------------------------- /cmake/android_project_template/app/proguard-rules.pro.in: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /cmake/android_project_template/app/src/main/gdb-path.txt.in: -------------------------------------------------------------------------------- 1 | set solib-search-path @APK_BUILD_ROOT@app/build/intermediates/cmake/debug/lib/armeabi-v7a:@APK_BUILD_ROOT@app/build/intermediates/cmake/debug/lib/x86:@APK_BUILD_ROOT@app/build/intermediates/cmake/debug/lib/arm64-v8a:@APK_BUILD_ROOT@app/.externalNativeBuild/cmake/debug/obj/armeabi-v7a:@APK_BUILD_ROOT@app/.externalNativeBuild/cmake/debug/obj/x86:@APK_BUILD_ROOT@app/.externalNativeBuild/cmake/debug/obj/arm64-v8a -------------------------------------------------------------------------------- /cmake/android_project_template/app/src/main/jni/Android.mk.in: -------------------------------------------------------------------------------- 1 | APP_ABI=@ANDROID_ABIS_SPACES@ -------------------------------------------------------------------------------- /cmake/android_project_template/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/vulkan_test_applications/3d5feb1af52b74d7a61372300ed3d5f7f6e6644b/cmake/android_project_template/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /cmake/android_project_template/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/vulkan_test_applications/3d5feb1af52b74d7a61372300ed3d5f7f6e6644b/cmake/android_project_template/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /cmake/android_project_template/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/vulkan_test_applications/3d5feb1af52b74d7a61372300ed3d5f7f6e6644b/cmake/android_project_template/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /cmake/android_project_template/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/vulkan_test_applications/3d5feb1af52b74d7a61372300ed3d5f7f6e6644b/cmake/android_project_template/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /cmake/android_project_template/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/vulkan_test_applications/3d5feb1af52b74d7a61372300ed3d5f7f6e6644b/cmake/android_project_template/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /cmake/android_project_template/app/src/main/res/values/strings.xml.in: -------------------------------------------------------------------------------- 1 | 2 | @ANDROID_TARGET_NAME@ 3 | 4 | -------------------------------------------------------------------------------- /cmake/android_project_template/build.gradle.in: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | google() 7 | mavenCentral() 8 | } 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:3.2.0' 11 | 12 | // NOTE: Do not place your application dependencies here; they belong 13 | // in the individual module build.gradle files 14 | } 15 | } 16 | 17 | allprojects { 18 | repositories { 19 | jcenter() 20 | google() 21 | mavenCentral() 22 | } 23 | } 24 | 25 | task clean(type: Delete) { 26 | delete rootProject.buildDir 27 | } 28 | -------------------------------------------------------------------------------- /cmake/android_project_template/gradle.properties.in: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /cmake/android_project_template/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/vulkan_test_applications/3d5feb1af52b74d7a61372300ed3d5f7f6e6644b/cmake/android_project_template/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /cmake/android_project_template/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /cmake/android_project_template/local.properties.in: -------------------------------------------------------------------------------- 1 | ## This file is automatically generated by Android Studio. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must *NOT* be checked into Version Control Systems, 5 | # as it contains information specific to your local configuration. 6 | # 7 | # Location of the SDK. This is only used by Gradle. 8 | # For customization when using a Version Control System, please read the 9 | # header note. 10 | #Mon Aug 22 14:25:40 EDT 2016 11 | ndk.dir=@ANDROID_NDK@ 12 | sdk.dir=@ANDROID_SDK@ 13 | -------------------------------------------------------------------------------- /cmake/android_project_template/settings.gradle.in: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /cmake/empty_cmake_dep.in.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | set(FILE_DEPS) -------------------------------------------------------------------------------- /shader_library/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | add_shader_library(shader_library 17 | SOURCES 18 | double_numbers.comp 19 | hardcode_pos_triangle.frag 20 | hardcode_pos_triangle.vert 21 | simple_fragment.frag 22 | simple_vertex.vert 23 | test.vert 24 | foo/test.frag 25 | foo/test.glsl 26 | models/model_setup.glsl 27 | ) 28 | -------------------------------------------------------------------------------- /shader_library/README.md: -------------------------------------------------------------------------------- 1 | # Shader Library 2 | 3 | This contains a set of standard shaders that can be included in other 4 | applications. 5 | 6 | Of particular interest is models/model_setup.glsl. The vulkan model 7 | class that is present in `vulkan_helpers/vulkan_model.h` have a particular 8 | attribute layout. To use these models, and to future-proof any changes 9 | to that layout, the functions in `vulkan_model.h` can be used 10 | as they will be updated if the format changes. 11 | 12 | -------------------------------------------------------------------------------- /shader_library/foo/test.1.glsl: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | -------------------------------------------------------------------------------- /shader_library/foo/test.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | #include "test.glsl" 18 | 19 | void main() { 20 | } -------------------------------------------------------------------------------- /shader_library/foo/test.glsl: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | -------------------------------------------------------------------------------- /shader_library/hardcode_pos_triangle.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout(location = 0) out vec4 outColor; 19 | 20 | void main() { 21 | outColor = vec4(1.0, 0.0, 0.0, 1.0); 22 | } 23 | -------------------------------------------------------------------------------- /shader_library/hardcode_pos_triangle.vert: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | out gl_PerVertex { 19 | vec4 gl_Position; 20 | }; 21 | 22 | vec2 positions[3] = vec2[]( 23 | vec2(0.0, -0.5), 24 | vec2(0.5, 0.5), 25 | vec2(-0.5, 0.5) 26 | ); 27 | 28 | void main() { 29 | gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0); 30 | } 31 | -------------------------------------------------------------------------------- /shader_library/models/model_setup.glsl: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | layout(location = 0) in vec3 _position; 17 | layout(location = 1) in vec2 _texture_coord; 18 | layout(location = 2) in vec3 _normal; 19 | 20 | vec4 get_position() { 21 | return vec4(_position, 1.0); 22 | } 23 | 24 | vec2 get_texcoord() { 25 | return _texture_coord; 26 | } 27 | 28 | vec4 get_normal() { 29 | return vec4(_normal, 1.0); 30 | } -------------------------------------------------------------------------------- /shader_library/simple_fragment.frag: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout (location = 0) in vec2 texcoord; 19 | 20 | layout (location = 0) out vec4 fragColor; 21 | 22 | void main() { 23 | fragColor = vec4(texcoord.x, texcoord.y, 1.0-texcoord.x-texcoord.y, 1.0); 24 | } 25 | -------------------------------------------------------------------------------- /shader_library/simple_vertex.vert: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | 18 | layout (location = 0) in vec3 position; 19 | layout (location = 1) in vec2 uv; 20 | 21 | layout (location = 0) out vec2 texcoord; 22 | 23 | void main() { 24 | gl_Position = vec4(position, 1.0); 25 | texcoord = uv; 26 | } 27 | -------------------------------------------------------------------------------- /shader_library/test.vert: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #version 450 17 | #include "foo/test.glsl" 18 | #include "foo/test.1.glsl" 19 | 20 | void main() { 21 | } -------------------------------------------------------------------------------- /standard_images/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_texture_library(standard_images 16 | SOURCES 17 | particle.png 18 | r8.png 19 | rgb8.png 20 | star.png 21 | multiplanar.jpg 22 | ) 23 | -------------------------------------------------------------------------------- /standard_images/README.md: -------------------------------------------------------------------------------- 1 | # Standard Images 2 | 3 | This contains a small set of images that can be used in 4 | test applications. Any images used in more than one file should be 5 | added here. -------------------------------------------------------------------------------- /standard_images/multiplanar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/vulkan_test_applications/3d5feb1af52b74d7a61372300ed3d5f7f6e6644b/standard_images/multiplanar.jpg -------------------------------------------------------------------------------- /standard_images/particle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/vulkan_test_applications/3d5feb1af52b74d7a61372300ed3d5f7f6e6644b/standard_images/particle.png -------------------------------------------------------------------------------- /standard_images/r8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/vulkan_test_applications/3d5feb1af52b74d7a61372300ed3d5f7f6e6644b/standard_images/r8.png -------------------------------------------------------------------------------- /standard_images/rgb8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/vulkan_test_applications/3d5feb1af52b74d7a61372300ed3d5f7f6e6644b/standard_images/rgb8.png -------------------------------------------------------------------------------- /standard_images/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/vulkan_test_applications/3d5feb1af52b74d7a61372300ed3d5f7f6e6644b/standard_images/star.png -------------------------------------------------------------------------------- /standard_models/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_model_library(standard_models 16 | SOURCES 17 | fullscreen_quad.obj 18 | cube.obj 19 | prism.obj 20 | torus_knot.obj 21 | floor.obj 22 | ) 23 | -------------------------------------------------------------------------------- /standard_models/README.md: -------------------------------------------------------------------------------- 1 | # Standard Models 2 | 3 | This contains a small set of models that can be used in 4 | test applications. Any models used in more than one file should be 5 | added here. -------------------------------------------------------------------------------- /standard_models/floor.obj: -------------------------------------------------------------------------------- 1 | o Plane 1 2 | v -0.8 -0.5 -0.8 3 | v -0.8 -0.5 0.8 4 | v 0.8 -0.5 -0.8 5 | v 0.8 -0.5 0.8 6 | vt 0 1 7 | vt 1 1 8 | vt 0 0 9 | vt 1 0 10 | vn 0 1 0 11 | vn 0 1 0 12 | vn 0 1 0 13 | vn 0 1 0 14 | f 1/1/1 2/2/2 3/3/3 15 | f 2/2/2 4/4/4 3/3/3 16 | -------------------------------------------------------------------------------- /standard_models/fullscreen_quad.obj: -------------------------------------------------------------------------------- 1 | o Plane 1 2 | v -1 1 0 3 | v 1 1 0 4 | v -1 -1 0 5 | v 1 -1 0 6 | vt 0 1 7 | vt 1 1 8 | vt 0 0 9 | vt 1 0 10 | vn 0 0 1 11 | vn 0 0 1 12 | vn 0 0 1 13 | vn 0 0 1 14 | f 2/2/2 3/3/3 1/1/1 15 | f 2/2/2 4/4/4 3/3/3 16 | -------------------------------------------------------------------------------- /support/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | # Log must exist first since other libraries depend on it 17 | add_vulkan_subdirectory(log) 18 | 19 | add_vulkan_subdirectory(android_native_app_glue) 20 | add_vulkan_subdirectory(containers) 21 | add_vulkan_subdirectory(dynamic_loader) 22 | add_vulkan_subdirectory(entry) 23 | add_vulkan_subdirectory(math_common) 24 | -------------------------------------------------------------------------------- /support/README.md: -------------------------------------------------------------------------------- 1 | This contains all of the support libraries to handle the cross-platform 2 | creation of Applications. 3 | 4 | - [android_native_app_glue](android_native_app_glue/README.md) 5 | - [containers](containers/README.md) 6 | - [dynamic_loader](dynamic_loader/README.md) 7 | - [entry](entry/README.md) 8 | - [log](log/README.md) 9 | - [math_common](math_common/README.md) 10 | -------------------------------------------------------------------------------- /support/android_native_app_glue/README.md: -------------------------------------------------------------------------------- 1 | This library is meant for Android builds. This builds 2 | `android_native_app_glue`, which is a support library provided by the NDK 3 | to interface with a NativeActivity. 4 | 5 | It should get automatically included in any android apks built with 6 | `add_vulkan_executable`. -------------------------------------------------------------------------------- /support/containers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | add_vulkan_static_library(containers 17 | SOURCES 18 | dummy.c 19 | # Create a dummy library so that we can track dependencies properly 20 | allocator.h 21 | stl_compatible_allocator.h 22 | string.h 23 | unique_ptr.h 24 | unordered_map.h 25 | unordered_set.h 26 | vector.h) 27 | -------------------------------------------------------------------------------- /support/containers/README.md: -------------------------------------------------------------------------------- 1 | # Containers 2 | 3 | `containers` is a library that provides an allocator interface to memory 4 | allocation. 5 | 6 | Every piece of the framework uses the allocators for malloc/free operations. 7 | At the program's creation a default allocator is created, and at the end 8 | of a program, it is expected that the allocator contains no outstanding 9 | allocations. This is checked for every application type. 10 | 11 | Also provided are wrapped STL objects that all take allocators on creation. 12 | This allows normal STL functions/objects to be used without missing out on 13 | the usefulness provided by the allocator interface. 14 | 15 | In the future, if more complicated applications are necessary, more interesting 16 | and complex allocators can be created and slotted in at specific points. -------------------------------------------------------------------------------- /support/containers/dummy.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ -------------------------------------------------------------------------------- /support/dynamic_loader/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | if(UNIX) 17 | set(ADDITIONAL_LIBS dl) 18 | endif() 19 | 20 | add_vulkan_static_library(dynamic_loader 21 | SOURCES 22 | dynamic_library.h 23 | dynamic_library.cpp 24 | LIBS 25 | ${ADDITIONAL_LIBS} 26 | containers) 27 | -------------------------------------------------------------------------------- /support/dynamic_loader/README.md: -------------------------------------------------------------------------------- 1 | # Dynamic Loader 2 | 3 | The dynamic loader is used to load shader libraries at runtime. From 4 | the loader, you can get typed function pointers. -------------------------------------------------------------------------------- /support/log/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | set(ADDITIONAL_LIBS) 17 | if(ANDROID) 18 | set(ADDITIONAL_LIBS log) 19 | endif() 20 | 21 | add_vulkan_static_library(logger 22 | SOURCES 23 | log.cpp 24 | log.h 25 | LIBS 26 | ${ADDITIONAL_LIBS} 27 | containers) 28 | -------------------------------------------------------------------------------- /support/log/README.md: -------------------------------------------------------------------------------- 1 | The logging library provides system agnostic logging functionality. 2 | It will use `__android_log_print` on android and fprintf on other platforms. -------------------------------------------------------------------------------- /support/math_common/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | add_vulkan_static_library(math_common 17 | SOURCES 18 | math_common.cpp 19 | include/math_common.h) 20 | 21 | if (NOT BUILD_APKS) 22 | target_include_directories(math_common PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 23 | endif() 24 | 25 | 26 | add_vulkan_subdirectory(glsl) -------------------------------------------------------------------------------- /support/math_common/README.md: -------------------------------------------------------------------------------- 1 | # Common Math 2 | 3 | math_common contains types that can be used across both GLSL and 4 | C++. There is an equivalent math_common in the shader library that defines 5 | all of these same types. 6 | 7 | This means that struct definitions etc, can be shared between 8 | C++/GLSL so long as they use these types. -------------------------------------------------------------------------------- /support/math_common/glsl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_shader_library(math_common_glsl 3 | SOURCES 4 | include/math_common.h 5 | ) 6 | -------------------------------------------------------------------------------- /support/math_common/glsl/include/math_common.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #ifndef _MATH_COMMON_H_ 17 | #define _MATH_COMMON_H_ 18 | 19 | #define Mat44 mat4 20 | #define Vector4 vec4 21 | #define Vector3 vec3 22 | #define Vector2 vec2 23 | 24 | #endif // _MATH_COMMON_H_ -------------------------------------------------------------------------------- /support/math_common/math_common.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // Intentionally empty, just used so CMake generates a library. -------------------------------------------------------------------------------- /third_party/LICENCE.vk_layer: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015-2017 The Khronos Group Inc. 2 | Copyright (c) 2015-2017 Valve Corporation 3 | Copyright (c) 2015-2017 LunarG, Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | -------------------------------------------------------------------------------- /vulkan_helpers/README.md: -------------------------------------------------------------------------------- 1 | # Vulkan Helpers 2 | 3 | This library is meant to hide the vulkan functionality that is not 4 | currently under test. It will handle setting up default objects 5 | in order to test other functionality. -------------------------------------------------------------------------------- /vulkan_helpers/known_device_infos.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #include "vulkan_helpers/known_device_infos.h" 17 | 18 | namespace vulkan { 19 | const DeviceInfo PixelC{0x10DE, 0x92BA03D7}; 20 | const DeviceInfo NvidiaK2200{0x10DE, 0x13BA}; 21 | const DeviceInfo Nvidia965M{0x10DE, 0x1427}; 22 | } // namespace vulkan 23 | -------------------------------------------------------------------------------- /vulkan_wrapper/README.md: -------------------------------------------------------------------------------- 1 | # Vulkan Wrapper 2 | This library is designed to simplify the loading of vulkan functions. This will 3 | involve wrapping the dispatchable objects, as well as lazily loading function 4 | pointers as necessary. 5 | 6 | We lazily initialize the functions because we do not want to call 7 | or even resolve any functions from the loader that we do not use. This will 8 | let us more easily determine when a failure in a layer occurs. 9 | 10 | NOTE: The goal of this library is not to be fast, but more to be both 11 | easy to use and allow us to correctly handle a large variety of cases. --------------------------------------------------------------------------------