├── .github ├── ISSUE_TEMPLATE │ └── bug_report.md └── workflows │ ├── artifacts.yml │ ├── test-build-linux.yml │ └── test-build-windows.yml ├── .gitignore ├── .gitmodules ├── .mailmap ├── AUTHORS ├── CHANGELOG.md ├── COPYING ├── LICENSE ├── README.md ├── VP_D3D12_VKD3D_PROTON_profile.json ├── build-win32.txt ├── build-win64.txt ├── demos ├── .gitignore ├── demo.h ├── demo_win32.h ├── demo_xcb.h ├── gears.c ├── gears.hlsl ├── gears_ps_flat.h ├── gears_ps_smooth.h ├── gears_vs.h ├── meson.build ├── triangle.c ├── triangle.hlsl ├── triangle_ps.h └── triangle_vs.h ├── docs ├── sampler_feedback.md └── workgraphs.md ├── include ├── .gitignore ├── meson.build ├── private │ ├── copy_utils.h │ ├── hashmap.h │ ├── list.h │ ├── rbtree.h │ ├── renderdoc_app.h │ ├── vkd3d_atomic.h │ ├── vkd3d_common.h │ ├── vkd3d_debug.h │ ├── vkd3d_descriptor_qa_data.h │ ├── vkd3d_file_utils.h │ ├── vkd3d_memory.h │ ├── vkd3d_native_sync_handle.h │ ├── vkd3d_platform.h │ ├── vkd3d_profiling.h │ ├── vkd3d_rw_spinlock.h │ ├── vkd3d_spinlock.h │ ├── vkd3d_string.h │ ├── vkd3d_test.h │ ├── vkd3d_threads.h │ ├── vkd3d_utf8.h │ └── vulkan_private_extensions.h ├── shader-debug │ ├── GNUmakefile │ └── debug_channel.h ├── vkd3d.h ├── vkd3d_command_list_vkd3d_ext.idl ├── vkd3d_command_queue_vkd3d_ext.idl ├── vkd3d_core_interface.idl ├── vkd3d_d3d12.idl ├── vkd3d_d3d12sdklayers.idl ├── vkd3d_d3dcommon.idl ├── vkd3d_device_vkd3d_ext.idl ├── vkd3d_dxcapi.idl ├── vkd3d_dxgi.idl ├── vkd3d_dxgi1_2.idl ├── vkd3d_dxgi1_3.idl ├── vkd3d_dxgi1_4.idl ├── vkd3d_dxgi1_5.idl ├── vkd3d_dxgibase.idl ├── vkd3d_dxgiformat.idl ├── vkd3d_dxgitype.idl ├── vkd3d_shader.h ├── vkd3d_sonames.h ├── vkd3d_swapchain_factory.idl ├── vkd3d_types.h ├── vkd3d_unknown.idl ├── vkd3d_vk_includes.h ├── vkd3d_win32.h └── vkd3d_windows.h ├── libs ├── .gitignore ├── d3d12 │ ├── d3d12.def │ ├── main.c │ └── meson.build ├── d3d12core │ ├── d3d12core.def │ ├── debug.c │ ├── debug.h │ ├── main.c │ └── meson.build ├── meson.build ├── vkd3d-common │ ├── debug.c │ ├── file_utils.c │ ├── memory.c │ ├── meson.build │ ├── platform.c │ ├── profiling.c │ ├── string.c │ └── utf8.c ├── vkd3d-shader │ ├── 3rdparty │ │ └── md5 │ │ │ ├── README.md │ │ │ ├── md5.c │ │ │ └── md5.h │ ├── checksum.c │ ├── dxbc.c │ ├── dxil.c │ ├── meson.build │ ├── spirv.c │ ├── vkd3d_shader_main.c │ └── vkd3d_shader_private.h └── vkd3d │ ├── acceleration_structure.c │ ├── address_binding_tracker.c │ ├── breadcrumbs.c │ ├── bundle.c │ ├── cache.c │ ├── command.c │ ├── command_list_profiled.h │ ├── command_list_vkd3d_ext.c │ ├── command_queue_vkd3d_ext.c │ ├── debug_common.c │ ├── debug_ring.c │ ├── descriptor_debug.c │ ├── device.c │ ├── device_profiled.h │ ├── device_vkd3d_ext.c │ ├── heap.c │ ├── memory.c │ ├── meson.build │ ├── meta.c │ ├── meta_commands.c │ ├── queue_timeline.c │ ├── raytracing_pipeline.c │ ├── renderdoc.c │ ├── resource.c │ ├── shaders │ ├── cs_clear_uav_buffer_float.comp │ ├── cs_clear_uav_buffer_raw.comp │ ├── cs_clear_uav_buffer_uint.comp │ ├── cs_clear_uav_image_1d_array_float.comp │ ├── cs_clear_uav_image_1d_array_uint.comp │ ├── cs_clear_uav_image_1d_float.comp │ ├── cs_clear_uav_image_1d_uint.comp │ ├── cs_clear_uav_image_2d_array_float.comp │ ├── cs_clear_uav_image_2d_array_uint.comp │ ├── cs_clear_uav_image_2d_float.comp │ ├── cs_clear_uav_image_2d_uint.comp │ ├── cs_clear_uav_image_3d_float.comp │ ├── cs_clear_uav_image_3d_uint.comp │ ├── cs_emit_nv_memory_decompression_regions.comp │ ├── cs_emit_nv_memory_decompression_workgroups.comp │ ├── cs_execute_indirect_multi_dispatch.comp │ ├── cs_execute_indirect_multi_dispatch_state.comp │ ├── cs_execute_indirect_patch.comp │ ├── cs_execute_indirect_patch_debug_ring.comp │ ├── cs_predicate_command.comp │ ├── cs_predicate_command_execute_indirect.comp │ ├── cs_resolve_binary_queries.comp │ ├── cs_resolve_color_float.comp │ ├── cs_resolve_color_sint.comp │ ├── cs_resolve_color_uint.comp │ ├── cs_resolve_predicate.comp │ ├── cs_resolve_query.comp │ ├── cs_sampler_feedback_decode_buffer_min_mip.comp │ ├── cs_sampler_feedback_encode_buffer_min_mip.comp │ ├── cs_sampler_feedback_encode_image_min_mip.comp │ ├── cs_sampler_feedback_encode_image_mip_used.comp │ ├── fs_copy_image_float.frag │ ├── fs_copy_image_stencil.frag │ ├── fs_copy_image_stencil_no_export.frag │ ├── fs_copy_image_uint.frag │ ├── fs_resolve_color_float.frag │ ├── fs_resolve_color_sint.frag │ ├── fs_resolve_color_uint.frag │ ├── fs_resolve_depth.frag │ ├── fs_resolve_stencil.frag │ ├── fs_resolve_stencil_no_export.frag │ ├── fs_sampler_feedback_decode_image_min_mip.frag │ ├── fs_sampler_feedback_decode_image_mip_used.frag │ ├── fs_swapchain_fullscreen.frag │ ├── gs_fullscreen.geom │ ├── sampler_feedback_decode.h │ ├── sampler_feedback_encode.h │ ├── vs_fullscreen.vert │ ├── vs_fullscreen_layer.vert │ └── vs_swapchain_fullscreen.vert │ ├── shared_metadata.c │ ├── state.c │ ├── swapchain.c │ ├── utils.c │ ├── va_map.c │ ├── vkd3d_descriptor_debug.h │ ├── vkd3d_main.c │ ├── vkd3d_private.h │ ├── vkd3d_renderdoc.h │ ├── vkd3d_shaders.h │ └── vulkan_procs.h ├── meson.build ├── meson_options.txt ├── package-release.sh ├── profiles ├── PROFILES.md ├── generate_profile_solution.sh ├── profile-test.cpp ├── setup_profile_environment_common.sh ├── setup_profile_environment_fl_11_0_baseline.sh ├── setup_profile_environment_fl_11_1_baseline.sh ├── setup_profile_environment_fl_12_0_baseline.sh ├── setup_profile_environment_fl_12_0_optimal.sh ├── setup_profile_environment_fl_12_1_baseline.sh ├── setup_profile_environment_fl_12_2_baseline.sh ├── setup_profile_environment_fl_12_2_optimal.sh ├── setup_profile_environment_maximum_nv.sh └── setup_profile_environment_maximum_radv.sh ├── programs ├── meson.build ├── vkd3d-compiler │ ├── main.c │ └── meson.build ├── vkd3d-hlsl-build │ ├── dxbc_library.cpp │ ├── dxbc_library.h │ ├── dxil_library.cpp │ ├── dxil_library.h │ ├── main.cpp │ └── meson.build ├── vkd3d-profile.py └── vkd3d-rs-parse │ ├── main.c │ └── meson.build ├── setup_vkd3d_proton.sh ├── tests ├── .gitignore ├── d3d12.c ├── d3d12_bindless.c ├── d3d12_clear.c ├── d3d12_clip_cull_distance.c ├── d3d12_command.c ├── d3d12_copy.c ├── d3d12_crosstest.h ├── d3d12_depth_stencil.c ├── d3d12_descriptors.c ├── d3d12_device.c ├── d3d12_dstorage.c ├── d3d12_dstorage_blobs.h ├── d3d12_dxvk_interop_device.c ├── d3d12_enhanced_barriers.c ├── d3d12_geometry_shader.c ├── d3d12_invalid_usage.c ├── d3d12_mesh_shader.c ├── d3d12_pso.c ├── d3d12_pso_blob.c ├── d3d12_query.c ├── d3d12_raytracing.c ├── d3d12_render_target.c ├── d3d12_resource.c ├── d3d12_robustness.c ├── d3d12_root_signature.c ├── d3d12_rov.c ├── d3d12_sampler_feedback.c ├── d3d12_shaders.c ├── d3d12_sm_advanced.c ├── d3d12_sparse.c ├── d3d12_streamout.c ├── d3d12_sync.c ├── d3d12_tessellation.c ├── d3d12_test_utils.c ├── d3d12_test_utils.h ├── d3d12_tests.h ├── d3d12_va.c ├── d3d12_vrs.c ├── d3d12_win32_exclusive.c ├── d3d12_workgraphs.c ├── descriptor_performance.c ├── meson.build ├── pso_library_bloat.c ├── shaders │ ├── command │ │ ├── cbv_hoisting.cs_5_1.cs_6_0.hlsl │ │ ├── command_list_initial_pipeline_state.ps_5_0.hlsl │ │ ├── conditional_rendering.cs_5_0.hlsl │ │ ├── conservative_rasterization_ps.ps_5_0.ps_6_0.hlsl │ │ ├── conservative_rasterization_ps_underestimate.ps_5_0.ps_6_0.hlsl │ │ ├── conservative_rasterization_vs.vs_5_0.vs_6_0.hlsl │ │ ├── dispatch_zero_thread_groups.cs_5_0.hlsl │ │ ├── draw_depth_no_ps.vs_5_0.hlsl │ │ ├── draw_depth_only.ps_5_0.hlsl │ │ ├── draw_uav_only.ps_5_0.hlsl │ │ ├── execute_indirect_cs.cs_5_0.hlsl │ │ ├── execute_indirect_multi_dispatch.cs_5_0.hlsl │ │ ├── execute_indirect_multi_dispatch_root_constants.cs_5_0.hlsl │ │ ├── execute_indirect_multi_dispatch_root_descriptors.cs_5_0.hlsl │ │ ├── execute_indirect_ps.ps_5_0.hlsl │ │ ├── execute_indirect_state_predication_cs.cs_5_0.hlsl │ │ ├── execute_indirect_state_predication_ps.ps_5_0.hlsl │ │ ├── execute_indirect_state_predication_vs.vs_5_0.hlsl │ │ ├── execute_indirect_state_vs_code_large_cbv.vs_5_1.hlsl │ │ ├── execute_indirect_state_vs_code_small_cbv.vs_5_1.hlsl │ │ ├── execute_indirect_vs.vs_5_0.hlsl │ │ ├── fractional_viewports_ps.ps_5_0.hlsl │ │ ├── fractional_viewports_vs.vs_5_0.hlsl │ │ ├── headers │ │ │ ├── cbv_hoisting.h │ │ │ ├── command_list_initial_pipeline_state.h │ │ │ ├── conditional_rendering.h │ │ │ ├── conservative_rasterization_ps.h │ │ │ ├── conservative_rasterization_ps_underestimate.h │ │ │ ├── conservative_rasterization_vs.h │ │ │ ├── dispatch_zero_thread_groups.h │ │ │ ├── draw_depth_no_ps.h │ │ │ ├── draw_depth_only.h │ │ │ ├── draw_uav_only.h │ │ │ ├── execute_indirect_cs.h │ │ │ ├── execute_indirect_multi_dispatch.h │ │ │ ├── execute_indirect_multi_dispatch_root_constants.h │ │ │ ├── execute_indirect_multi_dispatch_root_descriptors.h │ │ │ ├── execute_indirect_ps.h │ │ │ ├── execute_indirect_state_predication_cs.h │ │ │ ├── execute_indirect_state_predication_ps.h │ │ │ ├── execute_indirect_state_predication_vs.h │ │ │ ├── execute_indirect_state_vs_code_large_cbv.h │ │ │ ├── execute_indirect_state_vs_code_small_cbv.h │ │ │ ├── execute_indirect_vs.h │ │ │ ├── fractional_viewports_ps.h │ │ │ ├── fractional_viewports_vs.h │ │ │ ├── indirect_state_vbo_offsets_ps.h │ │ │ ├── indirect_state_vbo_offsets_vs.h │ │ │ ├── multiple_render_targets.h │ │ │ ├── negative_viewports_ps.h │ │ │ ├── negative_viewports_vs.h │ │ │ ├── null_vbv_ps.h │ │ │ ├── null_vbv_vs.h │ │ │ ├── root_parameter_preservation_cs.h │ │ │ ├── root_parameter_preservation_ps.h │ │ │ ├── scissor.h │ │ │ ├── unaligned_vertex_stride_ps.h │ │ │ ├── unaligned_vertex_stride_vs.h │ │ │ ├── uninit_root_parameters.h │ │ │ ├── vbv_stride_edge_cases.h │ │ │ ├── zero_vertex_stride_ps.h │ │ │ └── zero_vertex_stride_vs.h │ │ ├── indirect_state_vbo_offsets_ps.ps_5_0.hlsl │ │ ├── indirect_state_vbo_offsets_vs.vs_5_0.hlsl │ │ ├── multiple_render_targets.ps_5_0.hlsl │ │ ├── negative_viewports_ps.ps_5_0.hlsl │ │ ├── negative_viewports_vs.vs_5_0.hlsl │ │ ├── null_vbv_ps.ps_5_0.hlsl │ │ ├── null_vbv_vs.vs_5_0.hlsl │ │ ├── root_parameter_preservation_cs.cs_5_0.hlsl │ │ ├── root_parameter_preservation_ps.ps_5_0.hlsl │ │ ├── scissor.ps_5_0.hlsl │ │ ├── unaligned_vertex_stride_ps.ps_5_0.hlsl │ │ ├── unaligned_vertex_stride_vs.vs_5_0.hlsl │ │ ├── uninit_root_parameters.cs_5_0.hlsl │ │ ├── vbv_stride_edge_cases.vs_5_0.hlsl │ │ ├── zero_vertex_stride_ps.ps_5_0.hlsl │ │ └── zero_vertex_stride_vs.vs_5_0.hlsl │ ├── copy │ │ ├── headers │ │ │ ├── ps_copy_sample_float.h │ │ │ ├── ps_copy_sample_uint.h │ │ │ ├── ps_resolve_setup_rt.h │ │ │ ├── ps_resolve_setup_simple.h │ │ │ └── ps_resolve_setup_stencil.h │ │ ├── ps_copy_sample_float.ps_5_0.hlsl │ │ ├── ps_copy_sample_uint.ps_5_0.hlsl │ │ ├── ps_resolve_setup_rt.ps_5_0.hlsl │ │ ├── ps_resolve_setup_simple.ps_5_0.hlsl │ │ └── ps_resolve_setup_stencil.ps_5_0.hlsl │ ├── depth_stencil │ │ ├── cs_load_depth.cs_5_0.hlsl │ │ ├── cs_load_stencil.cs_5_0.hlsl │ │ ├── headers │ │ │ ├── cs_load_depth.h │ │ │ ├── cs_load_stencil.h │ │ │ ├── ps_depth_bias_behaviour.h │ │ │ ├── ps_depth_clip.h │ │ │ ├── ps_depth_compare.h │ │ │ ├── ps_depth_stencil_layout.h │ │ │ ├── ps_early_depth_stencil.h │ │ │ ├── ps_front_back.h │ │ │ ├── ps_load_depth.h │ │ │ ├── ps_load_stencil.h │ │ │ ├── ps_read_only_depth.h │ │ │ ├── ps_sample_depth.h │ │ │ ├── ps_sample_depth_stencil.h │ │ │ ├── ps_sample_stencil.h │ │ │ ├── ps_stencil_export.h │ │ │ ├── ps_stencil_export_load.h │ │ │ ├── vs_constant_depth.h │ │ │ ├── vs_depth_bias_behaviour.h │ │ │ ├── vs_depth_stencil_layout.h │ │ │ └── vs_passthrough.h │ │ ├── ps_depth_bias_behaviour.ps_5_0.hlsl │ │ ├── ps_depth_clip.ps_5_0.hlsl │ │ ├── ps_depth_compare.ps_5_0.hlsl │ │ ├── ps_depth_stencil_layout.ps_5_0.hlsl │ │ ├── ps_early_depth_stencil.ps_5_0.hlsl │ │ ├── ps_front_back.ps_5_0.hlsl │ │ ├── ps_load_depth.ps_5_0.hlsl │ │ ├── ps_load_stencil.ps_5_0.hlsl │ │ ├── ps_read_only_depth.ps_5_0.hlsl │ │ ├── ps_sample_depth.ps_5_0.hlsl │ │ ├── ps_sample_depth_stencil.ps_5_0.hlsl │ │ ├── ps_sample_stencil.ps_5_0.hlsl │ │ ├── ps_stencil_export.ps_5_0.ps_6_0.hlsl │ │ ├── ps_stencil_export_load.ps_5_0.hlsl │ │ ├── vs_constant_depth.vs_5_0.hlsl │ │ ├── vs_depth_bias_behaviour.vs_5_0.hlsl │ │ ├── vs_depth_stencil_layout.vs_5_0.hlsl │ │ └── vs_passthrough.vs_5_0.hlsl │ ├── descriptors │ │ ├── copy_descriptors.cs_5_0.hlsl │ │ ├── copy_descriptors_range_sizes.ps_5_0.hlsl │ │ ├── descriptors_visibility.vs_5_0.hlsl │ │ ├── descriptors_visibility_ps.ps_5_0.hlsl │ │ ├── headers │ │ │ ├── copy_descriptors.h │ │ │ ├── copy_descriptors_range_sizes.h │ │ │ ├── descriptors_visibility.h │ │ │ ├── descriptors_visibility_ps.h │ │ │ ├── null_cbv.h │ │ │ ├── null_srv_buffer.h │ │ │ ├── null_srv_ld.h │ │ │ ├── null_srv_sample.h │ │ │ ├── null_uav_ld_buffer.h │ │ │ ├── null_uav_ld_texture.h │ │ │ ├── overlapping_bindings.h │ │ │ ├── root_descriptor_offset_sign.h │ │ │ ├── sampler_border_color.h │ │ │ ├── sampler_non_normalized_coordinates.h │ │ │ ├── sampler_rounding.h │ │ │ ├── sampler_rounding_gather.h │ │ │ ├── typed_buffer_many_objects.h │ │ │ ├── uav_3d_sliced_view_actual.h │ │ │ ├── uav_3d_sliced_view_poison.h │ │ │ ├── uav_counters_null_behavior.h │ │ │ ├── uav_robustness_oob_structure_element.h │ │ │ ├── undefined_descriptor_heap_mismatch_types_cbv.h │ │ │ ├── undefined_descriptor_heap_mismatch_types_srv_raw.h │ │ │ ├── undefined_descriptor_heap_mismatch_types_srv_tex.h │ │ │ ├── undefined_descriptor_heap_mismatch_types_srv_typed.h │ │ │ ├── undefined_descriptor_heap_mismatch_types_uav_raw.h │ │ │ ├── undefined_descriptor_heap_mismatch_types_uav_tex.h │ │ │ ├── undefined_descriptor_heap_mismatch_types_uav_typed.h │ │ │ ├── update_compute_descriptor_tables_buffer.h │ │ │ ├── update_compute_descriptor_tables_texture.h │ │ │ ├── update_descriptor_heap_after_closing.h │ │ │ ├── update_descriptor_tables.h │ │ │ ├── update_descriptor_tables_after_root_signature_change.h │ │ │ ├── update_root_descriptors.h │ │ │ ├── view_min_lod_load.h │ │ │ └── view_min_lod_sample.h │ │ ├── null_cbv.ps_5_0.hlsl │ │ ├── null_srv_buffer.ps_5_0.hlsl │ │ ├── null_srv_ld.ps_5_0.hlsl │ │ ├── null_srv_sample.ps_5_0.hlsl │ │ ├── null_uav_ld_buffer.ps_5_0.hlsl │ │ ├── null_uav_ld_texture.ps_5_0.hlsl │ │ ├── overlapping_bindings.cs_5_0.hlsl │ │ ├── root_descriptor_offset_sign.cs_6_0.hlsl │ │ ├── sampler_border_color.ps_5_0.hlsl │ │ ├── sampler_non_normalized_coordinates.ps_5_0.hlsl │ │ ├── sampler_rounding.cs_5_0.hlsl │ │ ├── sampler_rounding_gather.cs_5_0.hlsl │ │ ├── typed_buffer_many_objects.cs_5_1.cs_6_0.hlsl │ │ ├── uav_3d_sliced_view_actual.cs_5_0.hlsl │ │ ├── uav_3d_sliced_view_poison.cs_5_0.hlsl │ │ ├── uav_counters_null_behavior.cs_5_1.cs_6_0.hlsl │ │ ├── uav_robustness_oob_structure_element.cs_5_0.cs_6_0.hlsl │ │ ├── undefined_descriptor_heap_mismatch_types_cbv.cs_6_6.hlsl │ │ ├── undefined_descriptor_heap_mismatch_types_srv_raw.cs_6_6.hlsl │ │ ├── undefined_descriptor_heap_mismatch_types_srv_tex.cs_6_6.hlsl │ │ ├── undefined_descriptor_heap_mismatch_types_srv_typed.cs_6_6.hlsl │ │ ├── undefined_descriptor_heap_mismatch_types_uav_raw.cs_6_6.hlsl │ │ ├── undefined_descriptor_heap_mismatch_types_uav_tex.cs_6_6.hlsl │ │ ├── undefined_descriptor_heap_mismatch_types_uav_typed.cs_6_6.hlsl │ │ ├── update_compute_descriptor_tables_buffer.cs_5_0.hlsl │ │ ├── update_compute_descriptor_tables_texture.cs_5_0.hlsl │ │ ├── update_descriptor_heap_after_closing.ps_5_0.hlsl │ │ ├── update_descriptor_tables.ps_5_0.hlsl │ │ ├── update_descriptor_tables_after_root_signature_change.ps_5_0.hlsl │ │ ├── update_root_descriptors.cs_5_0.hlsl │ │ ├── view_min_lod_load.ps_5_0.hlsl │ │ └── view_min_lod_sample.ps_5_0.hlsl │ ├── mesh_shader │ │ ├── as_execute_indirect_state.as_6_5.hlsl │ │ ├── as_multi_workgroup.as_6_5.hlsl │ │ ├── as_simple.as_6_5.hlsl │ │ ├── headers │ │ │ ├── as_execute_indirect_state.h │ │ │ ├── as_multi_workgroup.h │ │ │ ├── as_simple.h │ │ │ ├── ms_clip_distance.h │ │ │ ├── ms_cull_primitive.h │ │ │ ├── ms_culling.h │ │ │ ├── ms_derivatives.h │ │ │ ├── ms_empty.h │ │ │ ├── ms_execute_indirect.h │ │ │ ├── ms_execute_indirect_state.h │ │ │ ├── ms_execute_indirect_state_payload.h │ │ │ ├── ms_interface_matching.h │ │ │ ├── ms_multi_workgroup.h │ │ │ ├── ms_nontrivial.h │ │ │ ├── ms_payload.h │ │ │ ├── ms_simple.h │ │ │ ├── ms_system_values.h │ │ │ ├── ps_color.h │ │ │ ├── ps_culling.h │ │ │ ├── ps_derivatives.h │ │ │ ├── ps_dummy.h │ │ │ ├── ps_execute_indirect_state.h │ │ │ ├── ps_green.h │ │ │ ├── ps_interface_matching.h │ │ │ ├── ps_system_values.h │ │ │ └── vs_dummy.h │ │ ├── ms_clip_distance.ms_6_5.hlsl │ │ ├── ms_cull_primitive.ms_6_5.hlsl │ │ ├── ms_culling.ms_6_5.hlsl │ │ ├── ms_derivatives.ms_6_6.hlsl │ │ ├── ms_empty.ms_6_5.hlsl │ │ ├── ms_execute_indirect.ms_6_5.hlsl │ │ ├── ms_execute_indirect_state.ms_6_5.hlsl │ │ ├── ms_execute_indirect_state_payload.ms_6_5.hlsl │ │ ├── ms_interface_matching.ms_6_5.hlsl │ │ ├── ms_multi_workgroup.ms_6_5.hlsl │ │ ├── ms_nontrivial.ms_6_5.hlsl │ │ ├── ms_payload.ms_6_5.hlsl │ │ ├── ms_simple.ms_6_5.hlsl │ │ ├── ms_system_values.ms_6_5.hlsl │ │ ├── ps_color.ps_6_0.hlsl │ │ ├── ps_culling.ps_6_0.hlsl │ │ ├── ps_derivatives.ps_6_6.hlsl │ │ ├── ps_dummy.ps_6_0.hlsl │ │ ├── ps_execute_indirect_state.ps_6_0.hlsl │ │ ├── ps_green.ps_6_0.hlsl │ │ ├── ps_interface_matching.ps_6_0.hlsl │ │ ├── ps_system_values.ps_6_0.hlsl │ │ └── vs_dummy.vs_6_0.hlsl │ ├── pso │ │ ├── cs_create_pso.cs_5_0.hlsl │ │ ├── cs_null_root_signature.cs_5_0.hlsl │ │ ├── ds_mismatch_1.ds_6_0.hlsl │ │ ├── ds_mismatch_2.ds_6_0.hlsl │ │ ├── ds_mismatch_3.ds_6_0.hlsl │ │ ├── ds_mismatch_4.ds_6_0.hlsl │ │ ├── ds_mismatch_5.ds_6_0.hlsl │ │ ├── ds_mismatch_6.ds_6_0.hlsl │ │ ├── ds_mismatch_ref.ds_6_0.hlsl │ │ ├── gs_mismatch_1.gs_6_0.hlsl │ │ ├── gs_mismatch_2.gs_6_0.hlsl │ │ ├── gs_mismatch_3.gs_6_0.hlsl │ │ ├── gs_mismatch_4.gs_6_0.hlsl │ │ ├── gs_mismatch_5.gs_6_0.hlsl │ │ ├── gs_mismatch_primid.gs_5_0.gs_6_0.hlsl │ │ ├── gs_mismatch_ref.gs_5_0.gs_6_0.hlsl │ │ ├── gs_mismatch_so_1.gs_6_0.hlsl │ │ ├── gs_mismatch_so_2.gs_6_0.hlsl │ │ ├── gs_multiview_export_layer_viewport.gs_6_1.hlsl │ │ ├── headers │ │ │ ├── cs_create_pso.h │ │ │ ├── cs_null_root_signature.h │ │ │ ├── ds_mismatch_1.h │ │ │ ├── ds_mismatch_2.h │ │ │ ├── ds_mismatch_3.h │ │ │ ├── ds_mismatch_4.h │ │ │ ├── ds_mismatch_5.h │ │ │ ├── ds_mismatch_6.h │ │ │ ├── ds_mismatch_ref.h │ │ │ ├── gs_mismatch_1.h │ │ │ ├── gs_mismatch_2.h │ │ │ ├── gs_mismatch_3.h │ │ │ ├── gs_mismatch_4.h │ │ │ ├── gs_mismatch_5.h │ │ │ ├── gs_mismatch_primid.h │ │ │ ├── gs_mismatch_ref.h │ │ │ ├── gs_mismatch_so_1.h │ │ │ ├── gs_mismatch_so_2.h │ │ │ ├── gs_multiview_export_layer_viewport.h │ │ │ ├── hs_mismatch_1.h │ │ │ ├── hs_mismatch_2.h │ │ │ ├── hs_mismatch_3.h │ │ │ ├── hs_mismatch_4.h │ │ │ ├── hs_mismatch_5.h │ │ │ ├── hs_mismatch_ref.h │ │ │ ├── ms_mismatch.h │ │ │ ├── ms_mismatch_min16float.h │ │ │ ├── ms_mismatch_primid.h │ │ │ ├── ms_view_id_passthrough.h │ │ │ ├── ps_append_aligned_element.h │ │ │ ├── ps_atoc.h │ │ │ ├── ps_count_samples.h │ │ │ ├── ps_create_pso.h │ │ │ ├── ps_dual_source.h │ │ │ ├── ps_dual_source_3rt.h │ │ │ ├── ps_export_coverage.h │ │ │ ├── ps_integer_blending.h │ │ │ ├── ps_integer_blending_no_rt.h │ │ │ ├── ps_interstage.h │ │ │ ├── ps_line_raster.h │ │ │ ├── ps_mismatch_1.h │ │ │ ├── ps_mismatch_10.h │ │ │ ├── ps_mismatch_2.h │ │ │ ├── ps_mismatch_3.h │ │ │ ├── ps_mismatch_4.h │ │ │ ├── ps_mismatch_5.h │ │ │ ├── ps_mismatch_6.h │ │ │ ├── ps_mismatch_7.h │ │ │ ├── ps_mismatch_8.h │ │ │ ├── ps_mismatch_9.h │ │ │ ├── ps_mismatch_float16.h │ │ │ ├── ps_mismatch_min16float.h │ │ │ ├── ps_mismatch_ref.h │ │ │ ├── ps_mismatch_so_1.h │ │ │ ├── ps_mismatch_so_2.h │ │ │ ├── ps_mismatch_sv_1.h │ │ │ ├── ps_mismatch_sv_2.h │ │ │ ├── ps_mismatch_sv_3.h │ │ │ ├── ps_mismatch_sv_4.h │ │ │ ├── ps_mismatch_sv_5.h │ │ │ ├── ps_mismatch_sv_6.h │ │ │ ├── ps_null_root_signature.h │ │ │ ├── ps_shader_io_1.h │ │ │ ├── ps_shader_io_2.h │ │ │ ├── ps_shader_io_3.h │ │ │ ├── ps_shader_io_4.h │ │ │ ├── ps_shader_io_5.h │ │ │ ├── ps_triangle_fan.h │ │ │ ├── ps_view_id_passthrough.h │ │ │ ├── vs_append_aligned_element.h │ │ │ ├── vs_create_pso.h │ │ │ ├── vs_dynamic_depth_bias.h │ │ │ ├── vs_index_strip_cut.h │ │ │ ├── vs_interstage.h │ │ │ ├── vs_line_raster.h │ │ │ ├── vs_mismatch.h │ │ │ ├── vs_mismatch_float16.h │ │ │ ├── vs_mismatch_min16float.h │ │ │ ├── vs_multiview_export_layer_viewport.h │ │ │ ├── vs_no_ps.h │ │ │ ├── vs_null_root_signature.h │ │ │ ├── vs_primitive_restart.h │ │ │ ├── vs_shader_io_1.h │ │ │ ├── vs_shader_io_2.h │ │ │ ├── vs_shader_io_5.h │ │ │ ├── vs_triangle_fan.h │ │ │ └── vs_view_id_passthrough.h │ │ ├── hs_mismatch_1.hs_6_0.hlsl │ │ ├── hs_mismatch_2.hs_6_0.hlsl │ │ ├── hs_mismatch_3.hs_6_0.hlsl │ │ ├── hs_mismatch_4.hs_6_0.hlsl │ │ ├── hs_mismatch_5.hs_6_0.hlsl │ │ ├── hs_mismatch_ref.hs_6_0.hlsl │ │ ├── ms_mismatch.ms_6_5.hlsl │ │ ├── ms_mismatch_min16float.ms_6_5.hlsl │ │ ├── ms_mismatch_primid.ms_6_5.hlsl │ │ ├── ms_view_id_passthrough.ms_6_5.hlsl │ │ ├── ps_append_aligned_element.ps_5_0.hlsl │ │ ├── ps_atoc.ps_5_0.ps_6_0.hlsl │ │ ├── ps_count_samples.ps_5_0.hlsl │ │ ├── ps_create_pso.ps_5_0.hlsl │ │ ├── ps_dual_source.ps_5_0.ps_6_0.hlsl │ │ ├── ps_dual_source_3rt.ps_5_0.ps_6_0.hlsl │ │ ├── ps_export_coverage.ps_5_0.ps_6_0.hlsl │ │ ├── ps_integer_blending.ps_5_0.hlsl │ │ ├── ps_integer_blending_no_rt.ps_5_0.hlsl │ │ ├── ps_interstage.ps_5_0.hlsl │ │ ├── ps_line_raster.ps_5_0.hlsl │ │ ├── ps_mismatch_1.ps_6_0.hlsl │ │ ├── ps_mismatch_10.ps_6_0.hlsl │ │ ├── ps_mismatch_2.ps_6_0.hlsl │ │ ├── ps_mismatch_3.ps_6_0.hlsl │ │ ├── ps_mismatch_4.ps_6_0.hlsl │ │ ├── ps_mismatch_5.ps_6_0.hlsl │ │ ├── ps_mismatch_6.ps_6_0.hlsl │ │ ├── ps_mismatch_7.ps_6_0.hlsl │ │ ├── ps_mismatch_8.ps_6_0.hlsl │ │ ├── ps_mismatch_9.ps_6_0.hlsl │ │ ├── ps_mismatch_min16float.ps_5_0.ps_6_0.hlsl │ │ ├── ps_mismatch_ref.ps_5_0.ps_6_0.hlsl │ │ ├── ps_mismatch_so_1.ps_6_0.hlsl │ │ ├── ps_mismatch_so_2.ps_6_0.hlsl │ │ ├── ps_mismatch_sv_1.ps_6_1.hlsl │ │ ├── ps_mismatch_sv_2.ps_6_1.hlsl │ │ ├── ps_mismatch_sv_3.ps_5_0.ps_6_0.hlsl │ │ ├── ps_mismatch_sv_4.ps_5_0.ps_6_0.hlsl │ │ ├── ps_mismatch_sv_5.ps_5_0.ps_6_0.hlsl │ │ ├── ps_mismatch_sv_6.ps_5_0.ps_6_0.hlsl │ │ ├── ps_null_root_signature.ps_5_0.hlsl │ │ ├── ps_shader_io_1.ps_5_0.hlsl │ │ ├── ps_shader_io_2.ps_5_0.hlsl │ │ ├── ps_shader_io_3.ps_5_0.hlsl │ │ ├── ps_shader_io_4.ps_5_0.hlsl │ │ ├── ps_shader_io_5.ps_5_0.hlsl │ │ ├── ps_triangle_fan.ps_5_0.hlsl │ │ ├── ps_view_id_passthrough.ps_6_0.hlsl │ │ ├── vs_append_aligned_element.vs_5_0.hlsl │ │ ├── vs_create_pso.vs_5_0.hlsl │ │ ├── vs_dynamic_depth_bias.vs_5_0.hlsl │ │ ├── vs_index_strip_cut.vs_5_0.hlsl │ │ ├── vs_interstage.vs_5_0.hlsl │ │ ├── vs_line_raster.vs_5_0.hlsl │ │ ├── vs_mismatch.vs_5_0.vs_6_0.hlsl │ │ ├── vs_mismatch_min16float.vs_5_0.vs_6_0.hlsl │ │ ├── vs_multiview_export_layer_viewport.vs_6_1.hlsl │ │ ├── vs_no_ps.vs_5_0.hlsl │ │ ├── vs_null_root_signature.vs_5_0.hlsl │ │ ├── vs_primitive_restart.vs_5_0.hlsl │ │ ├── vs_shader_io_1.vs_5_0.hlsl │ │ ├── vs_shader_io_2.vs_5_0.hlsl │ │ ├── vs_shader_io_5.vs_5_0.hlsl │ │ ├── vs_triangle_fan.vs_5_0.hlsl │ │ └── vs_view_id_passthrough.vs_6_1.hlsl │ ├── render_target │ │ ├── headers │ │ │ ├── ps_color.h │ │ │ ├── ps_flat_color.h │ │ │ ├── ps_multisample_color.h │ │ │ ├── ps_multisample_resolve.h │ │ │ ├── ps_no_attachments.h │ │ │ ├── ps_render_a8.h │ │ │ ├── ps_renderpass.h │ │ │ ├── ps_rt_mismatch.h │ │ │ ├── ps_unbound_rtv.h │ │ │ ├── ps_unknown_rtv.h │ │ │ ├── vs_flat_color.h │ │ │ └── vs_no_attachments.h │ │ ├── ps_color.ps_5_0.hlsl │ │ ├── ps_flat_color.ps_5_0.hlsl │ │ ├── ps_multisample_color.ps_5_0.hlsl │ │ ├── ps_multisample_resolve.ps_5_0.hlsl │ │ ├── ps_no_attachments.ps_5_0.hlsl │ │ ├── ps_render_a8.ps_5_0.ps_6_0.hlsl │ │ ├── ps_renderpass.ps_5_0.hlsl │ │ ├── ps_rt_mismatch.ps_5_0.hlsl │ │ ├── ps_unbound_rtv.ps_5_0.hlsl │ │ ├── ps_unknown_rtv.ps_5_0.hlsl │ │ ├── vs_flat_color.vs_5_0.hlsl │ │ └── vs_no_attachments.vs_5_0.hlsl │ ├── resource │ │ ├── cs_clear_buffer.cs_5_0.hlsl │ │ ├── cs_copy_simple.cs_5_0.hlsl │ │ ├── cs_large_tbo_load.cs_5_0.hlsl │ │ ├── cs_large_tbo_store.cs_5_0.hlsl │ │ ├── headers │ │ │ ├── cs_clear_buffer.h │ │ │ ├── cs_copy_simple.h │ │ │ ├── cs_large_tbo_load.h │ │ │ ├── cs_large_tbo_store.h │ │ │ ├── ps_copy_simple.h │ │ │ └── ps_store_buffer.h │ │ ├── ps_copy_simple.ps_5_0.hlsl │ │ └── ps_store_buffer.ps_5_0.hlsl │ ├── rt │ │ ├── default.lib_6_3.hlsl │ │ ├── default_assignment_bindings_rt.lib_6_3.hlsl │ │ ├── dummy_raygen.lib_6_3.hlsl │ │ ├── embedded_root_signature_subobject_rt.lib_6_3.hlsl │ │ ├── embedded_root_signature_subobject_rt_conflict.lib_6_3.hlsl │ │ ├── embedded_root_signature_subobject_rt_conflict_mixed.lib_6_3.hlsl │ │ ├── embedded_subobject.lib_6_3.hlsl │ │ ├── embedded_subobject_dupe.lib_6_3.hlsl │ │ ├── headers │ │ │ ├── default.h │ │ │ ├── default_assignment_bindings_rt.h │ │ │ ├── dummy_raygen.h │ │ │ ├── embedded_root_signature_subobject_rt.h │ │ │ ├── embedded_root_signature_subobject_rt_conflict.h │ │ │ ├── embedded_root_signature_subobject_rt_conflict_mixed.h │ │ │ ├── embedded_subobject.h │ │ │ ├── embedded_subobject_dupe.h │ │ │ ├── misfire.h │ │ │ ├── multi_rs.h │ │ │ ├── rayquery.h │ │ │ └── static_sampler_rt_lib.h │ │ ├── misfire.lib_6_3.hlsl │ │ ├── multi_rs.lib_6_3.hlsl │ │ ├── rayquery.cs_6_5.hlsl │ │ └── static_sampler_rt_lib.lib_6_3.hlsl │ ├── sm_advanced │ │ ├── cs_64bit_atomics.cs_6_6.hlsl │ │ ├── cs_64bit_atomics_shared.cs_6_6.hlsl │ │ ├── cs_64bit_atomics_typed.cs_6_6.hlsl │ │ ├── cs_cbv_layout_legacy_uint16.cs_6_2.enable-16bit-types.hlsl │ │ ├── cs_cbv_layout_legacy_uint64.cs_6_0.hlsl │ │ ├── cs_cbv_layout_modern_uint16.cs_6_2.enable-16bit-types.no-legacy-cbuf-layout.hlsl │ │ ├── cs_cbv_layout_modern_uint32.cs_6_0.no-legacy-cbuf-layout.hlsl │ │ ├── cs_cbv_layout_modern_uint64.cs_6_0.no-legacy-cbuf-layout.hlsl │ │ ├── cs_denorm_fp16_fp32_any.cs_6_2.denorm any.enable-16bit-types.hlsl │ │ ├── cs_denorm_fp16_fp32_ftz.cs_6_2.denorm ftz.enable-16bit-types.hlsl │ │ ├── cs_denorm_fp16_fp32_preserve.cs_6_2.denorm preserve.enable-16bit-types.hlsl │ │ ├── cs_denorm_fp16_fp64_fp32_any.cs_6_2.denorm any.enable-16bit-types.hlsl │ │ ├── cs_denorm_fp16_fp64_fp32_ftz.cs_6_2.denorm ftz.enable-16bit-types.hlsl │ │ ├── cs_denorm_fp16_fp64_fp32_preserve.cs_6_2.denorm preserve.enable-16bit-types.hlsl │ │ ├── cs_denorm_fp64_fp32_any.cs_6_2.denorm any.hlsl │ │ ├── cs_denorm_fp64_fp32_any_dxbc.cs_5_0.hlsl │ │ ├── cs_denorm_fp64_fp32_ftz.cs_6_2.denorm ftz.hlsl │ │ ├── cs_denorm_fp64_fp32_preserve.cs_6_2.denorm preserve.hlsl │ │ ├── cs_denorm_ftz.cs_6_2.denorm ftz.hlsl │ │ ├── cs_denorm_preserve.cs_6_2.denorm preserve.hlsl │ │ ├── cs_derivative_1d.cs_6_6.hlsl │ │ ├── cs_derivative_2d_aligned.cs_6_6.hlsl │ │ ├── cs_derivative_2d_unaligned.cs_6_6.hlsl │ │ ├── cs_dynamic_texture_offset.cs_6_7.hlsl │ │ ├── cs_integer_sampling.cs_6_7.hlsl │ │ ├── cs_multisample_uav.cs_6_7.hlsl │ │ ├── cs_pack_s16_s8_clamp.cs_6_6.enable-16bit-types.hlsl │ │ ├── cs_pack_s16_u8_clamp.cs_6_6.enable-16bit-types.hlsl │ │ ├── cs_pack_s32_s8_clamp.cs_6_6.hlsl │ │ ├── cs_pack_s32_u8_clamp.cs_6_6.hlsl │ │ ├── cs_pack_u16_u8.cs_6_6.enable-16bit-types.hlsl │ │ ├── cs_pack_u32_u8.cs_6_6.hlsl │ │ ├── cs_packed_dot2add.cs_6_4.enable-16bit-types.hlsl │ │ ├── cs_packed_i8dot.cs_6_4.hlsl │ │ ├── cs_packed_u8dot.cs_6_4.hlsl │ │ ├── cs_quad_swap_2d_sm60.cs_6_0.hlsl │ │ ├── cs_quad_swap_2d_sm66.cs_6_6.hlsl │ │ ├── cs_quad_swap_2d_unaligned.cs_6_6.hlsl │ │ ├── cs_quad_vote.cs_6_7.hlsl │ │ ├── cs_raw_gather_16.cs_6_7.enable-16bit-types.hlsl │ │ ├── cs_raw_gather_32.cs_6_7.hlsl │ │ ├── cs_raw_gather_64.cs_6_7.hlsl │ │ ├── cs_sample_cmp_level.cs_6_7.hlsl │ │ ├── cs_unpack_s8_s16.cs_6_6.enable-16bit-types.hlsl │ │ ├── cs_unpack_s8_s32.cs_6_6.hlsl │ │ ├── cs_unpack_u8_u16.cs_6_6.enable-16bit-types.hlsl │ │ ├── cs_unpack_u8_u32.cs_6_6.hlsl │ │ ├── cs_wave_match.cs_6_5.hlsl │ │ ├── cs_wave_multi_prefix.cs_6_5.hlsl │ │ ├── cs_wave_size_range_16.cs_6_8.hlsl │ │ ├── cs_wave_size_range_16_32.cs_6_8.hlsl │ │ ├── cs_wave_size_range_32.cs_6_8.hlsl │ │ ├── cs_wave_size_range_64.cs_6_8.hlsl │ │ ├── cs_wave_size_range_64_128.cs_6_8.hlsl │ │ ├── cs_wave_size_range_8_16.cs_6_8.hlsl │ │ ├── cs_wave_size_range_prefer_16.cs_6_8.hlsl │ │ ├── cs_wave_size_range_prefer_32.cs_6_8.hlsl │ │ ├── cs_wave_size_range_prefer_64.cs_6_8.hlsl │ │ ├── cs_wave_size_wave16.cs_6_6.hlsl │ │ ├── cs_wave_size_wave32.cs_6_6.hlsl │ │ ├── cs_wave_size_wave64.cs_6_6.hlsl │ │ ├── headers │ │ │ ├── cs_64bit_atomics.h │ │ │ ├── cs_64bit_atomics_shared.h │ │ │ ├── cs_64bit_atomics_typed.h │ │ │ ├── cs_cbv_layout_legacy_uint16.h │ │ │ ├── cs_cbv_layout_legacy_uint64.h │ │ │ ├── cs_cbv_layout_modern_uint16.h │ │ │ ├── cs_cbv_layout_modern_uint32.h │ │ │ ├── cs_cbv_layout_modern_uint64.h │ │ │ ├── cs_denorm_fp16_fp32_any.h │ │ │ ├── cs_denorm_fp16_fp32_ftz.h │ │ │ ├── cs_denorm_fp16_fp32_preserve.h │ │ │ ├── cs_denorm_fp16_fp64_fp32_any.h │ │ │ ├── cs_denorm_fp16_fp64_fp32_ftz.h │ │ │ ├── cs_denorm_fp16_fp64_fp32_preserve.h │ │ │ ├── cs_denorm_fp64_fp32_any.h │ │ │ ├── cs_denorm_fp64_fp32_any_dxbc.h │ │ │ ├── cs_denorm_fp64_fp32_ftz.h │ │ │ ├── cs_denorm_fp64_fp32_preserve.h │ │ │ ├── cs_denorm_ftz.h │ │ │ ├── cs_denorm_preserve.h │ │ │ ├── cs_derivative_1d.h │ │ │ ├── cs_derivative_2d_aligned.h │ │ │ ├── cs_derivative_2d_unaligned.h │ │ │ ├── cs_dynamic_texture_offset.h │ │ │ ├── cs_integer_sampling.h │ │ │ ├── cs_multisample_uav.h │ │ │ ├── cs_pack_s16_s8_clamp.h │ │ │ ├── cs_pack_s16_u8_clamp.h │ │ │ ├── cs_pack_s32_s8_clamp.h │ │ │ ├── cs_pack_s32_u8_clamp.h │ │ │ ├── cs_pack_u16_u8.h │ │ │ ├── cs_pack_u32_u8.h │ │ │ ├── cs_packed_dot2add.h │ │ │ ├── cs_packed_i8dot.h │ │ │ ├── cs_packed_u8dot.h │ │ │ ├── cs_quad_swap_2d_sm60.h │ │ │ ├── cs_quad_swap_2d_sm66.h │ │ │ ├── cs_quad_swap_2d_unaligned.h │ │ │ ├── cs_quad_vote.h │ │ │ ├── cs_raw_gather_16.h │ │ │ ├── cs_raw_gather_32.h │ │ │ ├── cs_raw_gather_64.h │ │ │ ├── cs_sample_cmp_level.h │ │ │ ├── cs_unpack_s8_s16.h │ │ │ ├── cs_unpack_s8_s32.h │ │ │ ├── cs_unpack_u8_u16.h │ │ │ ├── cs_unpack_u8_u32.h │ │ │ ├── cs_wave_match.h │ │ │ ├── cs_wave_multi_prefix.h │ │ │ ├── cs_wave_size_range_16.h │ │ │ ├── cs_wave_size_range_16_32.h │ │ │ ├── cs_wave_size_range_32.h │ │ │ ├── cs_wave_size_range_64.h │ │ │ ├── cs_wave_size_range_64_128.h │ │ │ ├── cs_wave_size_range_8_16.h │ │ │ ├── cs_wave_size_range_prefer_16.h │ │ │ ├── cs_wave_size_range_prefer_32.h │ │ │ ├── cs_wave_size_range_prefer_64.h │ │ │ ├── cs_wave_size_wave16.h │ │ │ ├── cs_wave_size_wave32.h │ │ │ ├── cs_wave_size_wave64.h │ │ │ ├── ps_barycentrics.h │ │ │ ├── ps_discard_atomic_loop.h │ │ │ ├── ps_fp16_native.h │ │ │ ├── ps_fp16_nonnative.h │ │ │ ├── ps_helper_lane_wave_ops_disabled.h │ │ │ ├── ps_helper_lane_wave_ops_enabled.h │ │ │ ├── ps_sample_cmp_grad_bias.h │ │ │ ├── vs_barycentrics.h │ │ │ ├── vs_draw_args.h │ │ │ ├── vs_fp16_native.h │ │ │ ├── vs_fp16_nonnative.h │ │ │ ├── vs_helper_lane_wave_ops.h │ │ │ └── vs_sample_cmp_grad_bias.h │ │ ├── ps_barycentrics.ps_6_1.hlsl │ │ ├── ps_discard_atomic_loop.ps_6_6.hlsl │ │ ├── ps_fp16_native.ps_6_2.enable-16bit-types.hlsl │ │ ├── ps_fp16_nonnative.ps_6_2.hlsl │ │ ├── ps_helper_lane_wave_ops_disabled.ps_6_7.hlsl │ │ ├── ps_helper_lane_wave_ops_enabled.ps_6_7.hlsl │ │ ├── ps_sample_cmp_grad_bias.ps_6_8.hlsl │ │ ├── vs_barycentrics.vs_6_0.hlsl │ │ ├── vs_draw_args.vs_6_8.hlsl │ │ ├── vs_fp16_native.vs_6_2.enable-16bit-types.hlsl │ │ ├── vs_fp16_nonnative.vs_6_2.hlsl │ │ ├── vs_helper_lane_wave_ops.vs_6_0.hlsl │ │ └── vs_sample_cmp_grad_bias.vs_6_8.hlsl │ ├── sparse │ │ ├── buffer_feedback_ld_raw.cs_5_0.cs_6_0.hlsl │ │ ├── buffer_feedback_ld_structured.cs_5_0.cs_6_0.hlsl │ │ ├── buffer_feedback_ld_typed.cs_5_0.cs_6_0.hlsl │ │ ├── buffer_feedback_ld_typed_uav.cs_5_0.cs_6_0.hlsl │ │ ├── ds_sparse_ps.ps_5_0.hlsl │ │ ├── ds_sparse_vs.vs_5_0.hlsl │ │ ├── headers │ │ │ ├── buffer_feedback_ld_raw.h │ │ │ ├── buffer_feedback_ld_structured.h │ │ │ ├── buffer_feedback_ld_typed.h │ │ │ ├── buffer_feedback_ld_typed_uav.h │ │ │ ├── ds_sparse_ps.h │ │ │ ├── ds_sparse_vs.h │ │ │ ├── sparse_query.h │ │ │ ├── texture_feedback_gather.h │ │ │ ├── texture_feedback_gather_po.h │ │ │ ├── texture_feedback_ld.h │ │ │ ├── texture_feedback_ld_uav.h │ │ │ ├── texture_feedback_sample.h │ │ │ ├── texture_feedback_sample_bias.h │ │ │ ├── texture_feedback_sample_grad.h │ │ │ ├── texture_feedback_sample_lod.h │ │ │ ├── texture_feedback_vs.h │ │ │ ├── update_tile_mappings.h │ │ │ ├── update_tile_mappings_cs_clear.h │ │ │ ├── update_tile_mappings_texture.h │ │ │ └── update_tile_mappings_texture_3d.h │ │ ├── sparse_query.cs_5_0.cs_6_0.hlsl │ │ ├── texture_feedback_gather.ps_5_0.ps_6_0.hlsl │ │ ├── texture_feedback_gather_po.ps_5_0.ps_6_0.hlsl │ │ ├── texture_feedback_ld.ps_5_0.ps_6_0.hlsl │ │ ├── texture_feedback_ld_uav.ps_5_0.ps_6_0.hlsl │ │ ├── texture_feedback_sample.ps_5_0.ps_6_0.hlsl │ │ ├── texture_feedback_sample_bias.ps_5_0.ps_6_0.hlsl │ │ ├── texture_feedback_sample_grad.ps_5_0.ps_6_0.hlsl │ │ ├── texture_feedback_sample_lod.ps_5_0.ps_6_0.hlsl │ │ ├── texture_feedback_vs.vs_5_0.vs_6_0.hlsl │ │ ├── update_tile_mappings.cs_5_0.hlsl │ │ ├── update_tile_mappings_cs_clear.cs_5_0.hlsl │ │ ├── update_tile_mappings_texture.cs_5_0.hlsl │ │ └── update_tile_mappings_texture_3d.cs_5_0.hlsl │ ├── vrs │ │ ├── headers │ │ │ ├── vrs.h │ │ │ ├── vrs_depth_ps.h │ │ │ ├── vrs_depth_ps_fixed.h │ │ │ ├── vrs_depth_vs.h │ │ │ ├── vrs_image.h │ │ │ ├── vrs_ps.h │ │ │ └── vrs_vs.h │ │ ├── vrs.ps_5_0.hlsl │ │ ├── vrs_depth_ps.ps_5_0.ps_6_0.hlsl │ │ ├── vrs_depth_ps_fixed.ps_5_0.ps_6_0.hlsl │ │ ├── vrs_depth_vs.vs_5_0.vs_6_0.hlsl │ │ ├── vrs_image.ps_5_0.hlsl │ │ ├── vrs_ps.ps_6_4.hlsl │ │ └── vrs_vs.vs_6_4.hlsl │ └── workgraph │ │ ├── basic.lib_6_8.hlsl │ │ ├── basic_recursion.lib_6_8.hlsl │ │ ├── broadcast_custom_input.lib_6_8.hlsl │ │ ├── broadcast_custom_input_u16_2.lib_6_8.enable-16bit-types.hlsl │ │ ├── broadcast_custom_input_uint.lib_6_8.hlsl │ │ ├── broadcast_custom_input_uint2.lib_6_8.hlsl │ │ ├── coalesce_custom_input.lib_6_8.hlsl │ │ ├── cross_group_sharing.lib_6_8.hlsl │ │ ├── headers │ │ ├── basic.h │ │ ├── basic_recursion.h │ │ ├── broadcast_custom_input.h │ │ ├── broadcast_custom_input_u16_2.h │ │ ├── broadcast_custom_input_uint.h │ │ ├── broadcast_custom_input_uint2.h │ │ ├── coalesce_custom_input.h │ │ ├── cross_group_sharing.h │ │ ├── local_root_signature.h │ │ ├── shared_inputs.h │ │ ├── thread_custom_input.h │ │ ├── two_level_broadcast.h │ │ ├── two_level_broadcast_node_array.h │ │ ├── two_level_empty_node.h │ │ ├── two_level_thread.h │ │ └── two_level_thread_node_array.h │ │ ├── local_root_signature.lib_6_8.hlsl │ │ ├── shared_inputs.lib_6_8.hlsl │ │ ├── thread_custom_input.lib_6_8.hlsl │ │ ├── two_level_broadcast.lib_6_8.hlsl │ │ ├── two_level_broadcast_node_array.lib_6_8.hlsl │ │ ├── two_level_empty_node.lib_6_8.hlsl │ │ ├── two_level_thread.lib_6_8.hlsl │ │ └── two_level_thread_node_array.lib_6_8.hlsl ├── test-runner.sh ├── vkd3d_api.c ├── vkd3d_common.c └── vkd3d_shader_api.c ├── vkd3d_build.h.in └── vkd3d_version.h.in /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Report crashes, rendering issues etc. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | Please describe your issue as accurately as possible. Include screenshots or videos if relevant 11 | 12 | ### Software information 13 | Name of the game, settings used etc. 14 | 15 | ### System information 16 | - GPU: 17 | - Driver: 18 | - Wine version: 19 | - VKD3D-Proton version: 20 | 21 | ### Log files 22 | Please attach Proton or Wine logs as a text file: 23 | - When using Proton, set the Steam launch options for your game to `PROTON_LOG=1 %command%` and attach the corresponding `steam-xxxxx.log` file in your home directory. 24 | - When using regular Wine, use `wine game.exe > game.log 2>&1` and attach the resulting `game.log` file. 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | build.* 3 | vkd3d-proton-*.tar.zst 4 | vkd3d-proton-*/ 5 | /profiles/vulkan 6 | /profiles/profile-test 7 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "subprojects/dxil-spirv"] 2 | path = subprojects/dxil-spirv 3 | url = https://github.com/HansKristian-Work/dxil-spirv 4 | [submodule "khronos/Vulkan-Headers"] 5 | path = khronos/Vulkan-Headers 6 | url = https://github.com/KhronosGroup/Vulkan-Headers 7 | [submodule "khronos/SPIRV-Headers"] 8 | path = khronos/SPIRV-Headers 9 | url = https://github.com/KhronosGroup/SPIRV-Headers 10 | -------------------------------------------------------------------------------- /.mailmap: -------------------------------------------------------------------------------- 1 | Conor McCarthy 2 | Ivan Fedorov 3 | James Beddek 4 | Roshan Chaudhari 5 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Alexander Gabello 2 | Alexandre Julliard 3 | Andrew Eikum 4 | Arkadiusz Hiler 5 | Biswapriyo Nath 6 | Chip Davis 7 | Conor McCarthy 8 | Danylo Piliaiev 9 | David Gow 10 | David McCloskey 11 | Derek Lesho 12 | Fabian Bornschein 13 | Georg Lehmann 14 | Hans-Kristian Arntzen 15 | Henri Verbeet 16 | Ivan Fedorov 17 | Jactry Zeng 18 | James Beddek 19 | Jens Peters 20 | Joshua Ashton 21 | Józef Kucia 22 | Juuso Alasuutari 23 | Krzysztof Bogacki 24 | Paul Gofman 25 | Philip Rebohle 26 | Rémi Bernon 27 | Robin Kertels 28 | Rodrigo Locatti 29 | Roshan Chaudhari 30 | Samuel Pitoiset 31 | Sveinar Søpler 32 | Sven Hesse 33 | Thomas Crider 34 | Zhiyi Zhang 35 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | Copyright 2016-2024 the vkd3d-proton project authors (see the file AUTHORS for a 2 | complete list) 3 | 4 | vkd3d-proton is free software; you can redistribute it and/or modify it under 5 | the terms of the GNU Lesser General Public License as published by the 6 | Free Software Foundation; either version 2.1 of the License, or (at 7 | your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, but 10 | WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA, 02110-1301 USA. 17 | -------------------------------------------------------------------------------- /build-win32.txt: -------------------------------------------------------------------------------- 1 | [binaries] 2 | c = 'i686-w64-mingw32-gcc' 3 | cpp = 'i686-w64-mingw32-g++' 4 | ar = 'i686-w64-mingw32-ar' 5 | strip = 'i686-w64-mingw32-strip' 6 | widl-mingw-tools-fallback = 'i686-w64-mingw32-widl' 7 | 8 | [properties] 9 | needs_exe_wrapper = true 10 | 11 | [host_machine] 12 | system = 'windows' 13 | cpu_family = 'x86' 14 | cpu = 'x86' 15 | endian = 'little' 16 | -------------------------------------------------------------------------------- /build-win64.txt: -------------------------------------------------------------------------------- 1 | [binaries] 2 | c = 'x86_64-w64-mingw32-gcc' 3 | cpp = 'x86_64-w64-mingw32-g++' 4 | ar = 'x86_64-w64-mingw32-ar' 5 | strip = 'x86_64-w64-mingw32-strip' 6 | widl-mingw-tools-fallback = 'x86_64-w64-mingw32-widl' 7 | 8 | [properties] 9 | needs_exe_wrapper = true 10 | 11 | [host_machine] 12 | system = 'windows' 13 | cpu_family = 'x86_64' 14 | cpu = 'x86_64' 15 | endian = 'little' 16 | -------------------------------------------------------------------------------- /demos/.gitignore: -------------------------------------------------------------------------------- 1 | gears 2 | triangle 3 | *.spv 4 | -------------------------------------------------------------------------------- /demos/meson.build: -------------------------------------------------------------------------------- 1 | demo_vkd3d_deps = [ 2 | threads_dep, vkd3d_common_dep 3 | ] 4 | 5 | if vkd3d_platform != 'windows' 6 | demo_vkd3d_deps += [ 7 | lib_m, 8 | lib_xcb, 9 | lib_xcbkeysyms, 10 | lib_d3d12 11 | ] 12 | else 13 | demo_vkd3d_deps += [ 14 | lib_dxgi, 15 | lib_d3d12 16 | ] 17 | endif 18 | 19 | executable('gears', 'gears.c', 20 | dependencies : demo_vkd3d_deps, 21 | include_directories : vkd3d_public_includes, 22 | install : true, 23 | gui_app : true) 24 | 25 | executable('triangle', 'triangle.c', 26 | dependencies : demo_vkd3d_deps, 27 | include_directories : vkd3d_public_includes, 28 | install : true, 29 | gui_app : true) 30 | -------------------------------------------------------------------------------- /demos/triangle.hlsl: -------------------------------------------------------------------------------- 1 | struct ps_in 2 | { 3 | float4 position : SV_POSITION; 4 | float4 colour : COLOR; 5 | }; 6 | 7 | struct ps_in vs_main(float4 position : POSITION, float4 colour : COLOR) 8 | { 9 | struct ps_in o; 10 | 11 | o.position = position; 12 | o.colour = colour; 13 | 14 | return o; 15 | } 16 | 17 | float4 ps_main(struct ps_in i) : SV_TARGET 18 | { 19 | return i.colour; 20 | } 21 | -------------------------------------------------------------------------------- /include/.gitignore: -------------------------------------------------------------------------------- 1 | config.h 2 | config.h.in 3 | stamp-h1 4 | vkd3d_d3d12.h 5 | vkd3d_d3d12sdklayers.h 6 | vkd3d_d3dcommon.h 7 | vkd3d_dxgi.h 8 | vkd3d_dxgi1_2.h 9 | vkd3d_dxgi1_3.h 10 | vkd3d_dxgi1_4.h 11 | vkd3d_dxgibase.h 12 | vkd3d_dxgiformat.h 13 | vkd3d_dxgitype.h 14 | -------------------------------------------------------------------------------- /include/meson.build: -------------------------------------------------------------------------------- 1 | vkd3d_idl = [ 2 | 'vkd3d_d3d12.idl', 3 | 'vkd3d_d3d12sdklayers.idl', 4 | 'vkd3d_d3dcommon.idl', 5 | 'vkd3d_dxcapi.idl', 6 | 'vkd3d_dxgi.idl', 7 | 'vkd3d_dxgi1_2.idl', 8 | 'vkd3d_dxgi1_3.idl', 9 | 'vkd3d_dxgi1_4.idl', 10 | 'vkd3d_dxgi1_5.idl', 11 | 'vkd3d_dxgibase.idl', 12 | 'vkd3d_dxgiformat.idl', 13 | 'vkd3d_dxgitype.idl', 14 | 'vkd3d_swapchain_factory.idl', 15 | 'vkd3d_command_list_vkd3d_ext.idl', 16 | 'vkd3d_command_queue_vkd3d_ext.idl', 17 | 'vkd3d_device_vkd3d_ext.idl', 18 | 'vkd3d_core_interface.idl', 19 | ] 20 | 21 | vkd3d_header_files = idl_generator.process(vkd3d_idl) 22 | -------------------------------------------------------------------------------- /include/private/vulkan_private_extensions.h: -------------------------------------------------------------------------------- 1 | #ifndef __VULKAN_PRIVATE_EXTENSIONS_H__ 2 | #define __VULKAN_PRIVATE_EXTENSIONS_H__ 3 | 4 | /* Nothing here at the moment. Add hacks here! */ 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /libs/.gitignore: -------------------------------------------------------------------------------- 1 | vkd3d_version.c 2 | -------------------------------------------------------------------------------- /libs/d3d12/d3d12.def: -------------------------------------------------------------------------------- 1 | LIBRARY d3d12.dll 2 | 3 | EXPORTS 4 | D3D12CreateDevice @101 5 | D3D12GetDebugInterface @102 6 | D3D12CreateRootSignatureDeserializer 7 | D3D12CreateVersionedRootSignatureDeserializer 8 | 9 | D3D12EnableExperimentalFeatures 10 | D3D12SerializeRootSignature 11 | D3D12SerializeVersionedRootSignature 12 | D3D12GetInterface 13 | -------------------------------------------------------------------------------- /libs/d3d12core/d3d12core.def: -------------------------------------------------------------------------------- 1 | LIBRARY d3d12core.dll 2 | 3 | EXPORTS 4 | D3D12GetInterface 5 | D3D12SDKVersion DATA PRIVATE 6 | -------------------------------------------------------------------------------- /libs/d3d12core/meson.build: -------------------------------------------------------------------------------- 1 | d3d12core_src = [ 2 | 'debug.c', 3 | 'main.c' 4 | ] 5 | 6 | if vkd3d_platform == 'windows' 7 | d3d12core_name_prefix = '' 8 | d3d12core_dependencies = [ vkd3d_dep, lib_dxgi ] 9 | else 10 | d3d12core_name_prefix = 'libvkd3d-proton-' 11 | d3d12core_dependencies = [ vkd3d_dep, lib_dl ] 12 | endif 13 | 14 | d3d12core_needs_defs = (not vkd3d_is_msvc) and (vkd3d_platform == 'windows') 15 | 16 | d3d12core_lib = shared_library('d3d12core', d3d12core_src, 17 | name_prefix : d3d12core_name_prefix, 18 | dependencies : d3d12core_dependencies, 19 | include_directories : vkd3d_private_includes, 20 | install : true, 21 | objects : d3d12core_needs_defs ? 'd3d12core.def' : [], 22 | vs_module_defs : 'd3d12core.def') 23 | 24 | d3d12core_dep = declare_dependency( 25 | link_with : d3d12core_lib, 26 | include_directories : vkd3d_public_includes) 27 | -------------------------------------------------------------------------------- /libs/meson.build: -------------------------------------------------------------------------------- 1 | subdir('vkd3d-common') 2 | subdir('vkd3d-shader') 3 | subdir('vkd3d') 4 | subdir('d3d12core') 5 | subdir('d3d12') 6 | -------------------------------------------------------------------------------- /libs/vkd3d-common/meson.build: -------------------------------------------------------------------------------- 1 | vkd3d_common_src = [ 2 | 'debug.c', 3 | 'memory.c', 4 | 'utf8.c', 5 | 'profiling.c', 6 | 'string.c', 7 | 'file_utils.c', 8 | 'platform.c', 9 | ] 10 | 11 | vkd3d_common_lib = static_library('vkd3d_common', vkd3d_common_src, vkd3d_header_files, 12 | include_directories : vkd3d_private_includes, 13 | dependencies : vkd3d_extra_libs) 14 | 15 | vkd3d_common_dep = declare_dependency( 16 | link_with : vkd3d_common_lib, 17 | include_directories : [ vkd3d_public_includes, vkd3d_common_lib.private_dir_include() ]) 18 | -------------------------------------------------------------------------------- /libs/vkd3d-shader/meson.build: -------------------------------------------------------------------------------- 1 | vkd3d_shader_src = [ 2 | 'checksum.c', 3 | 'dxil.c', 4 | 'dxbc.c', 5 | 'spirv.c', 6 | 'vkd3d_shader_main.c', 7 | '3rdparty/md5/md5.c', 8 | ] 9 | 10 | vkd3d_shader_lib = static_library('vkd3d-shader', vkd3d_shader_src, 11 | dependencies : [ vkd3d_common_dep, dxil_spirv_dep ], 12 | include_directories : vkd3d_private_includes) 13 | 14 | vkd3d_shader_dep = declare_dependency( 15 | link_with : vkd3d_shader_lib, 16 | dependencies : vkd3d_common_dep, 17 | include_directories : vkd3d_public_includes) 18 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/cs_clear_uav_buffer_float.comp: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | layout(local_size_x = 128) in; 4 | 5 | layout(binding = 0) 6 | writeonly uniform imageBuffer dst; 7 | 8 | layout(push_constant) 9 | uniform u_info_t { 10 | vec4 clear_value; 11 | ivec2 dst_offset; 12 | ivec2 dst_extent; 13 | } u_info; 14 | 15 | void main() { 16 | int thread_id = int(gl_GlobalInvocationID.x); 17 | 18 | if (thread_id < u_info.dst_extent.x) 19 | imageStore(dst, u_info.dst_offset.x + thread_id, u_info.clear_value); 20 | } 21 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/cs_clear_uav_buffer_raw.comp: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | layout(local_size_x = 128) in; 4 | 5 | layout(binding = 0) 6 | writeonly buffer dst_buf { 7 | uint data[]; 8 | } dst; 9 | 10 | layout(push_constant) 11 | uniform u_info_t { 12 | uvec4 clear_value; 13 | ivec2 dst_offset; 14 | ivec2 dst_extent; 15 | } u_info; 16 | 17 | void main() { 18 | int thread_id = int(gl_GlobalInvocationID.x); 19 | 20 | if (thread_id < u_info.dst_extent.x) 21 | dst.data[u_info.dst_offset.x + thread_id] = u_info.clear_value.x; 22 | } 23 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/cs_clear_uav_buffer_uint.comp: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | layout(local_size_x = 128) in; 4 | 5 | layout(binding = 0) 6 | writeonly uniform uimageBuffer dst; 7 | 8 | layout(push_constant) 9 | uniform u_info_t { 10 | uvec4 clear_value; 11 | ivec2 dst_offset; 12 | ivec2 dst_extent; 13 | } u_info; 14 | 15 | void main() { 16 | int thread_id = int(gl_GlobalInvocationID.x); 17 | 18 | if (thread_id < u_info.dst_extent.x) 19 | imageStore(dst, u_info.dst_offset.x + thread_id, u_info.clear_value); 20 | } 21 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/cs_clear_uav_image_1d_array_float.comp: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | layout(local_size_x = 64) in; 4 | 5 | layout(binding = 0) 6 | writeonly uniform image1DArray dst; 7 | 8 | layout(push_constant) 9 | uniform u_info_t { 10 | vec4 clear_value; 11 | ivec2 dst_offset; 12 | ivec2 dst_extent; 13 | } u_info; 14 | 15 | void main() { 16 | ivec3 thread_id = ivec3(gl_GlobalInvocationID); 17 | 18 | if (thread_id.x < u_info.dst_extent.x) 19 | imageStore(dst, ivec2(u_info.dst_offset.x + thread_id.x, thread_id.y), u_info.clear_value); 20 | } 21 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/cs_clear_uav_image_1d_array_uint.comp: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | layout(local_size_x = 64) in; 4 | 5 | layout(binding = 0) 6 | writeonly uniform uimage1DArray dst; 7 | 8 | layout(push_constant) 9 | uniform u_info_t { 10 | uvec4 clear_value; 11 | ivec2 dst_offset; 12 | ivec2 dst_extent; 13 | } u_info; 14 | 15 | void main() { 16 | ivec3 thread_id = ivec3(gl_GlobalInvocationID); 17 | 18 | if (thread_id.x < u_info.dst_extent.x) 19 | imageStore(dst, ivec2(u_info.dst_offset.x + thread_id.x, thread_id.y), u_info.clear_value); 20 | } 21 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/cs_clear_uav_image_1d_float.comp: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | layout(local_size_x = 64) in; 4 | 5 | layout(binding = 0) 6 | writeonly uniform image1D dst; 7 | 8 | layout(push_constant) 9 | uniform u_info_t { 10 | vec4 clear_value; 11 | ivec2 dst_offset; 12 | ivec2 dst_extent; 13 | } u_info; 14 | 15 | void main() { 16 | ivec3 thread_id = ivec3(gl_GlobalInvocationID); 17 | 18 | if (thread_id.x < u_info.dst_extent.x) 19 | imageStore(dst, u_info.dst_offset.x + thread_id.x, u_info.clear_value); 20 | } 21 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/cs_clear_uav_image_1d_uint.comp: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | layout(local_size_x = 64) in; 4 | 5 | layout(binding = 0) 6 | writeonly uniform uimage1D dst; 7 | 8 | layout(push_constant) 9 | uniform u_info_t { 10 | uvec4 clear_value; 11 | ivec2 dst_offset; 12 | ivec2 dst_extent; 13 | } u_info; 14 | 15 | void main() { 16 | ivec3 thread_id = ivec3(gl_GlobalInvocationID); 17 | 18 | if (thread_id.x < u_info.dst_extent.x) 19 | imageStore(dst, u_info.dst_offset.x + thread_id.x, u_info.clear_value); 20 | } 21 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/cs_clear_uav_image_2d_array_float.comp: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | layout(local_size_x = 8, local_size_y = 8) in; 4 | 5 | layout(binding = 0) 6 | writeonly uniform image2DArray dst; 7 | 8 | layout(push_constant) 9 | uniform u_info_t { 10 | vec4 clear_value; 11 | ivec2 dst_offset; 12 | ivec2 dst_extent; 13 | } u_info; 14 | 15 | void main() { 16 | ivec3 thread_id = ivec3(gl_GlobalInvocationID); 17 | 18 | if (all(lessThan(thread_id.xy, u_info.dst_extent.xy))) 19 | imageStore(dst, ivec3(u_info.dst_offset.xy + thread_id.xy, thread_id.z), u_info.clear_value); 20 | } 21 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/cs_clear_uav_image_2d_array_uint.comp: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | layout(local_size_x = 8, local_size_y = 8) in; 4 | 5 | layout(binding = 0) 6 | writeonly uniform uimage2DArray dst; 7 | 8 | layout(push_constant) 9 | uniform u_info_t { 10 | uvec4 clear_value; 11 | ivec2 dst_offset; 12 | ivec2 dst_extent; 13 | } u_info; 14 | 15 | void main() { 16 | ivec3 thread_id = ivec3(gl_GlobalInvocationID); 17 | 18 | if (all(lessThan(thread_id.xy, u_info.dst_extent.xy))) 19 | imageStore(dst, ivec3(u_info.dst_offset.xy + thread_id.xy, thread_id.z), u_info.clear_value); 20 | } 21 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/cs_clear_uav_image_2d_float.comp: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | layout(local_size_x = 8, local_size_y = 8) in; 4 | 5 | layout(binding = 0) 6 | writeonly uniform image2D dst; 7 | 8 | layout(push_constant) 9 | uniform u_info_t { 10 | vec4 clear_value; 11 | ivec2 dst_offset; 12 | ivec2 dst_extent; 13 | } u_info; 14 | 15 | void main() { 16 | ivec3 thread_id = ivec3(gl_GlobalInvocationID); 17 | 18 | if (all(lessThan(thread_id.xy, u_info.dst_extent.xy))) 19 | imageStore(dst, u_info.dst_offset.xy + thread_id.xy, u_info.clear_value); 20 | } 21 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/cs_clear_uav_image_2d_uint.comp: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | layout(local_size_x = 8, local_size_y = 8) in; 4 | 5 | layout(binding = 0) 6 | writeonly uniform uimage2D dst; 7 | 8 | layout(push_constant) 9 | uniform u_info_t { 10 | uvec4 clear_value; 11 | ivec2 dst_offset; 12 | ivec2 dst_extent; 13 | } u_info; 14 | 15 | void main() { 16 | ivec3 thread_id = ivec3(gl_GlobalInvocationID); 17 | 18 | if (all(lessThan(thread_id.xy, u_info.dst_extent.xy))) 19 | imageStore(dst, u_info.dst_offset.xy + thread_id.xy, u_info.clear_value); 20 | } 21 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/cs_clear_uav_image_3d_float.comp: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | layout(local_size_x = 4, local_size_y = 4, local_size_z = 4) in; 4 | 5 | layout(binding = 0) 6 | writeonly uniform image3D dst; 7 | 8 | layout(push_constant) 9 | uniform u_info_t { 10 | vec4 clear_value; 11 | ivec2 dst_offset; 12 | ivec2 dst_extent; 13 | } u_info; 14 | 15 | void main() { 16 | ivec3 thread_id = ivec3(gl_GlobalInvocationID); 17 | 18 | if (all(lessThan(thread_id.xy, u_info.dst_extent))) 19 | imageStore(dst, ivec3(u_info.dst_offset.xy, 0) + thread_id.xyz, u_info.clear_value); 20 | } 21 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/cs_clear_uav_image_3d_uint.comp: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | layout(local_size_x = 4, local_size_y = 4, local_size_z = 4) in; 4 | 5 | layout(binding = 0) 6 | writeonly uniform uimage3D dst; 7 | 8 | layout(push_constant) 9 | uniform u_info_t { 10 | uvec4 clear_value; 11 | ivec2 dst_offset; 12 | ivec2 dst_extent; 13 | } u_info; 14 | 15 | void main() { 16 | ivec3 thread_id = ivec3(gl_GlobalInvocationID); 17 | 18 | if (all(lessThan(thread_id.xy, u_info.dst_extent))) 19 | imageStore(dst, ivec3(u_info.dst_offset.xy, 0) + thread_id.xyz, u_info.clear_value); 20 | } 21 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/cs_resolve_binary_queries.comp: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | #extension GL_EXT_buffer_reference : require 4 | 5 | layout(local_size_x = 64) in; 6 | 7 | layout(std430, buffer_reference, buffer_reference_align = 8) 8 | writeonly buffer dst_buffer_t { 9 | uvec2 queries[]; 10 | }; 11 | 12 | layout(std430, buffer_reference, buffer_reference_align = 8) 13 | readonly buffer src_buffer_t { 14 | uvec2 queries[]; 15 | }; 16 | 17 | layout(push_constant) 18 | uniform u_info_t { 19 | dst_buffer_t dst_buffer; 20 | src_buffer_t src_buffer; 21 | uint query_count; 22 | }; 23 | 24 | void main() { 25 | uint thread_id = gl_GlobalInvocationID.x; 26 | 27 | if (thread_id < query_count) 28 | dst_buffer.queries[thread_id] = any(notEqual(src_buffer.queries[thread_id], uvec2(0))) ? uvec2(1, 0) : uvec2(0); 29 | } 30 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/cs_resolve_predicate.comp: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | #extension GL_EXT_buffer_reference : require 4 | 5 | layout(local_size_x = 1) in; 6 | 7 | layout(std430, buffer_reference, buffer_reference_align = 8) 8 | readonly buffer src_predicate_t { 9 | uvec2 data; 10 | }; 11 | 12 | layout(std430, buffer_reference, buffer_reference_align = 4) 13 | writeonly buffer dst_predicate_t { 14 | uint data; 15 | }; 16 | 17 | layout(push_constant) 18 | uniform u_info_t { 19 | src_predicate_t src; 20 | dst_predicate_t dst; 21 | bool invert; 22 | }; 23 | 24 | void main() { 25 | dst.data = (all(equal(src.data, 0u.xx)) != invert) ? 0u : 1u; 26 | } 27 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/cs_sampler_feedback_decode_buffer_min_mip.comp: -------------------------------------------------------------------------------- 1 | #version 450 2 | layout(local_size_x = 8, local_size_y = 8) in; 3 | 4 | #extension GL_GOOGLE_include_directive : require 5 | #include "sampler_feedback_decode.h" 6 | 7 | layout(set = 0, binding = 0, r8ui) uniform writeonly uimageBuffer OutputBuffer; 8 | 9 | void main() 10 | { 11 | ivec2 icoord = ivec2(gl_GlobalInvocationID.xy); 12 | 13 | if (any(greaterThanEqual(icoord, resolution))) 14 | return; 15 | 16 | int result = sampler_feedback_decode_min_mip(icoord, 0.0); 17 | imageStore(OutputBuffer, icoord.y * resolution.x + icoord.x, uvec4(result)); 18 | } 19 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/cs_sampler_feedback_encode_buffer_min_mip.comp: -------------------------------------------------------------------------------- 1 | #version 450 2 | layout(local_size_x = 8, local_size_y = 8) in; 3 | 4 | #extension GL_GOOGLE_include_directive : require 5 | #include "sampler_feedback_encode.h" 6 | 7 | layout(set = 0, binding = 2) uniform utextureBuffer InputBuffer; 8 | 9 | void main() 10 | { 11 | ivec2 coord = ivec2(gl_GlobalInvocationID.xy); 12 | if (all(lessThan(coord, resolution))) 13 | { 14 | uint value = texelFetch(InputBuffer, int(coord.y * resolution.x + coord.x)).x; 15 | sampler_feedback_encode_min_mip(coord, 0, value); 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/cs_sampler_feedback_encode_image_min_mip.comp: -------------------------------------------------------------------------------- 1 | #version 450 2 | layout(local_size_x = 8, local_size_y = 8) in; 3 | 4 | #extension GL_GOOGLE_include_directive : require 5 | #extension GL_EXT_samplerless_texture_functions : require 6 | #include "sampler_feedback_encode.h" 7 | 8 | layout(set = 0, binding = 1) uniform utexture2DArray InputBuffer; 9 | 10 | void main() 11 | { 12 | ivec2 coord = ivec2(gl_GlobalInvocationID.xy); 13 | if (all(lessThan(coord, resolution))) 14 | { 15 | uint value = texelFetch(InputBuffer, ivec3(coord + src_offset, gl_WorkGroupID.z), src_mip).x; 16 | sampler_feedback_encode_min_mip(coord, int(gl_WorkGroupID.z), value); 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/cs_sampler_feedback_encode_image_mip_used.comp: -------------------------------------------------------------------------------- 1 | #version 450 2 | layout(local_size_x = 8, local_size_y = 8) in; 3 | 4 | #extension GL_GOOGLE_include_directive : require 5 | #extension GL_EXT_samplerless_texture_functions : require 6 | #include "sampler_feedback_encode.h" 7 | 8 | layout(set = 0, binding = 1) uniform utexture2DArray InputBuffer; 9 | 10 | void main() 11 | { 12 | ivec2 coord = ivec2(gl_GlobalInvocationID.xy); 13 | if (all(lessThan(coord, resolution))) 14 | { 15 | uint value = texelFetch(InputBuffer, ivec3(coord + src_offset, gl_WorkGroupID.z), src_mip).x; 16 | sampler_feedback_encode_mip_used(coord, int(gl_WorkGroupID.z), value != 0); 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/fs_copy_image_float.frag: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | #extension GL_EXT_samplerless_texture_functions : enable 4 | 5 | #define MODE_1D 0 6 | #define MODE_2D 1 7 | #define MODE_MS 2 8 | 9 | layout(constant_id = 0) const uint c_mode = MODE_2D; 10 | 11 | layout(binding = 0) uniform texture1DArray tex_1d; 12 | layout(binding = 0) uniform texture2DArray tex_2d; 13 | layout(binding = 0) uniform texture2DMSArray tex_ms; 14 | 15 | layout(location = 0) out float o_color; 16 | 17 | layout(push_constant) 18 | uniform u_info_t { 19 | ivec2 offset; 20 | } u_info; 21 | 22 | void main() { 23 | ivec3 coord = ivec3(u_info.offset + ivec2(gl_FragCoord.xy), gl_Layer); 24 | float value; 25 | if (c_mode == MODE_1D) value = texelFetch(tex_1d, coord.xz, 0).r; 26 | if (c_mode == MODE_2D) value = texelFetch(tex_2d, coord, 0).r; 27 | if (c_mode == MODE_MS) value = texelFetch(tex_ms, coord, gl_SampleID).r; 28 | gl_FragDepth = o_color = value; 29 | } 30 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/fs_copy_image_stencil.frag: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | #extension GL_EXT_samplerless_texture_functions : enable 4 | #extension GL_ARB_shader_stencil_export : enable 5 | 6 | #define MODE_1D 0 7 | #define MODE_2D 1 8 | #define MODE_MS 2 9 | 10 | layout(constant_id = 0) const uint c_mode = MODE_2D; 11 | 12 | layout(binding = 0) uniform utexture1DArray tex_1d; 13 | layout(binding = 0) uniform utexture2DArray tex_2d; 14 | layout(binding = 0) uniform utexture2DMSArray tex_ms; 15 | 16 | layout(push_constant) 17 | uniform u_info_t { 18 | ivec2 offset; 19 | } u_info; 20 | 21 | void main() { 22 | ivec3 coord = ivec3(u_info.offset + ivec2(gl_FragCoord.xy), gl_Layer); 23 | uint value; 24 | if (c_mode == MODE_1D) value = texelFetch(tex_1d, coord.xz, 0).r; 25 | if (c_mode == MODE_2D) value = texelFetch(tex_2d, coord, 0).r; 26 | if (c_mode == MODE_MS) value = texelFetch(tex_ms, coord, gl_SampleID).r; 27 | gl_FragStencilRefARB = int(value); 28 | } 29 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/fs_copy_image_stencil_no_export.frag: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | #extension GL_EXT_samplerless_texture_functions : enable 4 | 5 | #define MODE_1D 0 6 | #define MODE_2D 1 7 | #define MODE_MS 2 8 | 9 | layout(constant_id = 0) const uint c_mode = MODE_2D; 10 | 11 | layout(binding = 0) uniform utexture1DArray tex_1d; 12 | layout(binding = 0) uniform utexture2DArray tex_2d; 13 | layout(binding = 0) uniform utexture2DMSArray tex_ms; 14 | 15 | layout(push_constant) 16 | uniform u_info_t { 17 | ivec2 offset; 18 | uint bit_mask; 19 | } u_info; 20 | 21 | void main() { 22 | ivec3 coord = ivec3(u_info.offset + ivec2(gl_FragCoord.xy), gl_Layer); 23 | uint value; 24 | if (c_mode == MODE_1D) value = texelFetch(tex_1d, coord.xz, 0).r; 25 | if (c_mode == MODE_2D) value = texelFetch(tex_2d, coord, 0).r; 26 | if (c_mode == MODE_MS) value = texelFetch(tex_ms, coord, gl_SampleID).r; 27 | if ((value & u_info.bit_mask) == 0) 28 | discard; 29 | } 30 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/fs_copy_image_uint.frag: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | #extension GL_EXT_samplerless_texture_functions : enable 4 | 5 | #define MODE_1D 0 6 | #define MODE_2D 1 7 | #define MODE_MS 2 8 | 9 | layout(constant_id = 0) const uint c_mode = MODE_2D; 10 | 11 | layout(binding = 0) uniform utexture1DArray tex_1d; 12 | layout(binding = 0) uniform utexture2DArray tex_2d; 13 | layout(binding = 0) uniform utexture2DMSArray tex_ms; 14 | 15 | layout(location = 0) out uint o_color; 16 | 17 | layout(push_constant) 18 | uniform u_info_t { 19 | ivec2 offset; 20 | } u_info; 21 | 22 | void main() { 23 | ivec3 coord = ivec3(u_info.offset + ivec2(gl_FragCoord.xy), gl_Layer); 24 | uint value; 25 | if (c_mode == MODE_1D) value = texelFetch(tex_1d, coord.xz, 0).r; 26 | if (c_mode == MODE_2D) value = texelFetch(tex_2d, coord, 0).r; 27 | if (c_mode == MODE_MS) value = texelFetch(tex_ms, coord, gl_SampleID).r; 28 | o_color = value; 29 | } 30 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/fs_resolve_color_sint.frag: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | #extension GL_EXT_samplerless_texture_functions : enable 4 | 5 | #define MODE_MIN 1 6 | #define MODE_MAX 2 7 | 8 | layout(constant_id = 0) const uint c_mode = 0; 9 | 10 | layout(binding = 0) uniform itexture2DMSArray tex_ms; 11 | 12 | layout(location = 0) out ivec4 o_color; 13 | 14 | layout(push_constant) 15 | uniform u_info_t { 16 | ivec2 offset; 17 | } u_info; 18 | 19 | void main() { 20 | ivec3 coord = ivec3(u_info.offset + ivec2(gl_FragCoord.xy), gl_Layer); 21 | 22 | uint samples = textureSamples(tex_ms); 23 | ivec4 color = texelFetch(tex_ms, coord, 0); 24 | 25 | for (uint i = 1; i < samples; i++) { 26 | ivec4 sample_value = texelFetch(tex_ms, coord, int(i)); 27 | 28 | switch (c_mode) { 29 | case MODE_MIN: color = min(color, sample_value); break; 30 | case MODE_MAX: color = max(color, sample_value); break; 31 | } 32 | } 33 | 34 | o_color = color; 35 | } 36 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/fs_resolve_color_uint.frag: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | #extension GL_EXT_samplerless_texture_functions : enable 4 | 5 | #define MODE_MIN 1 6 | #define MODE_MAX 2 7 | 8 | layout(constant_id = 0) const uint c_mode = 0; 9 | 10 | layout(binding = 0) uniform utexture2DMSArray tex_ms; 11 | 12 | layout(location = 0) out uvec4 o_color; 13 | 14 | layout(push_constant) 15 | uniform u_info_t { 16 | ivec2 offset; 17 | } u_info; 18 | 19 | void main() { 20 | ivec3 coord = ivec3(u_info.offset + ivec2(gl_FragCoord.xy), gl_Layer); 21 | 22 | uint samples = textureSamples(tex_ms); 23 | uvec4 color = texelFetch(tex_ms, coord, 0); 24 | 25 | for (uint i = 1; i < samples; i++) { 26 | uvec4 sample_value = texelFetch(tex_ms, coord, int(i)); 27 | 28 | switch (c_mode) { 29 | case MODE_MIN: color = min(color, sample_value); break; 30 | case MODE_MAX: color = max(color, sample_value); break; 31 | } 32 | } 33 | 34 | o_color = color; 35 | } 36 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/fs_sampler_feedback_decode_image_min_mip.frag: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | #extension GL_GOOGLE_include_directive : require 4 | #define ARRAY 5 | #include "sampler_feedback_decode.h" 6 | 7 | layout(location = 0) out uint Output; 8 | 9 | void main() 10 | { 11 | ivec2 icoord = ivec2(gl_FragCoord.xy) - dst_offset; // Compensate for viewport offset. 12 | int result = sampler_feedback_decode_min_mip(icoord, float(gl_Layer)); 13 | Output = uint(result); 14 | } 15 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/fs_sampler_feedback_decode_image_mip_used.frag: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | #extension GL_GOOGLE_include_directive : require 4 | #define ARRAY 5 | #include "sampler_feedback_decode.h" 6 | 7 | layout(location = 0) out uint Output; 8 | 9 | void main() 10 | { 11 | ivec2 icoord = ivec2(gl_FragCoord.xy) - dst_offset; // Compensate for viewport offset. 12 | bool result = sampler_feedback_decode_mip_used(icoord, mip_level, float(gl_Layer)); 13 | Output = result ? 0xffu : 0u; 14 | } 15 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/fs_swapchain_fullscreen.frag: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | layout(location = 0) out vec4 FragColor; 4 | layout(location = 0) in vec2 vUV; 5 | layout(set = 0, binding = 0) uniform sampler2D Tex; 6 | 7 | void main() 8 | { 9 | FragColor = textureLod(Tex, vUV, 0.0); 10 | } 11 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/gs_fullscreen.geom: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | layout(triangles) in; 4 | layout(triangle_strip, max_vertices = 3) out; 5 | 6 | layout(location = 0) in int i_layer[3]; 7 | 8 | void main() { 9 | for (int i = 0; i < 3; i++) { 10 | gl_Layer = i_layer[i]; 11 | gl_Position = gl_in[i].gl_Position; 12 | EmitVertex(); 13 | } 14 | 15 | EndPrimitive(); 16 | } 17 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/vs_fullscreen.vert: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | layout(location = 0) out int o_layer; 4 | 5 | void main() { 6 | o_layer = gl_InstanceIndex; 7 | gl_Position = vec4( 8 | float(gl_VertexIndex & 1) * 4.0f - 1.0f, 9 | float(gl_VertexIndex & 2) * 2.0f - 1.0f, 10 | 0.0f, 1.0f); 11 | } 12 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/vs_fullscreen_layer.vert: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | #extension GL_ARB_shader_viewport_layer_array : enable 4 | 5 | void main() { 6 | gl_Layer = gl_InstanceIndex; 7 | gl_Position = vec4( 8 | float(gl_VertexIndex & 1) * 4.0f - 1.0f, 9 | float(gl_VertexIndex & 2) * 2.0f - 1.0f, 10 | 0.0f, 1.0f); 11 | } 12 | -------------------------------------------------------------------------------- /libs/vkd3d/shaders/vs_swapchain_fullscreen.vert: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | layout(location = 0) out vec2 vUV; 4 | 5 | void main() 6 | { 7 | gl_Position = vec4( 8 | float(gl_VertexIndex & 1) * 4.0f - 1.0f, 9 | float(gl_VertexIndex & 2) * 2.0f - 1.0f, 10 | 0.0f, 1.0f); 11 | vUV = gl_Position.xy * 0.5 + 0.5; 12 | } 13 | -------------------------------------------------------------------------------- /meson_options.txt: -------------------------------------------------------------------------------- 1 | option('enable_tests', type : 'boolean', value : false) 2 | option('enable_extras', type : 'boolean', value : false) 3 | option('enable_profiling', type : 'boolean', value : false) 4 | option('enable_renderdoc', type : 'boolean', value : false) 5 | option('enable_descriptor_qa', type : 'boolean', value : false) 6 | option('enable_trace', type : 'combo', value : 'auto', choices : ['false', 'true', 'auto']) 7 | -------------------------------------------------------------------------------- /profiles/generate_profile_solution.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mkdir -p profiles/vulkan/debug 4 | 5 | if [ -z ${VULKAN_PROFILE_PREFIX} ]; then 6 | VULKAN_PROFILE_PREFIX="$HOME/.local" 7 | echo "Using VULKAN_PROFILE_PREFIX=$VULKAN_PROFILE_PREFIX." 8 | fi 9 | 10 | # Install Vulkan-Profiles to ~/.local prefix. 11 | 12 | python3 "${VULKAN_PROFILE_PREFIX}/share/vulkan/registry/gen_profiles_solution.py" \ 13 | --registry khronos/Vulkan-Headers/registry/vk.xml \ 14 | --input . \ 15 | --output-library-inc profiles/vulkan \ 16 | --output-library-src profiles/vulkan \ 17 | --output-doc profiles/PROFILES.md \ 18 | --validate --debug 19 | -------------------------------------------------------------------------------- /profiles/setup_profile_environment_common.sh: -------------------------------------------------------------------------------- 1 | export VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation:VK_LAYER_KHRONOS_profiles 2 | export VK_KHRONOS_PROFILES_DEFAULT_FEATURE_VALUES=DEFAULT_FEATURE_VALUES_FALSE 3 | export VK_KHRONOS_PROFILES_PROFILE_FILE=$(pwd)/VP_D3D12_VKD3D_PROTON_profile.json 4 | export VK_KHRONOS_PROFILES_PROFILE_NAME=${PROFILE_NAME} 5 | export VK_KHRONOS_PROFILES_SIMULATE_CAPABILITIES=SIMULATE_API_VERSION_BIT,SIMULATE_FEATURES_BIT,SIMULATE_PROPERTIES_BIT,SIMULATE_EXTENSIONS_BIT 6 | export VK_LAYER_PATH=/usr/share/vulkan/explicit_layer.d:~/.local/share/vulkan/explicit_layer.d 7 | export VK_KHRONOS_PROFILES_EMULATE_PORTABILITY=false 8 | export LD_LIBRARY_PATH="$HOME/.local/lib:$LD_LIBRARY_PATH" 9 | export VK_KHRONOS_PROFILES_DEBUG_ACTIONS=DEBUG_ACTION_FILE_BIT 10 | export VK_KHRONOS_PROFILES_DEBUG_FILENAME=/dev/null 11 | -------------------------------------------------------------------------------- /profiles/setup_profile_environment_fl_11_0_baseline.sh: -------------------------------------------------------------------------------- 1 | PROFILE_NAME=VP_D3D12_FL_11_0_baseline 2 | source profiles/setup_profile_environment_common.sh 3 | -------------------------------------------------------------------------------- /profiles/setup_profile_environment_fl_11_1_baseline.sh: -------------------------------------------------------------------------------- 1 | PROFILE_NAME=VP_D3D12_FL_11_1_baseline 2 | source profiles/setup_profile_environment_common.sh 3 | -------------------------------------------------------------------------------- /profiles/setup_profile_environment_fl_12_0_baseline.sh: -------------------------------------------------------------------------------- 1 | PROFILE_NAME=VP_D3D12_FL_12_0_baseline 2 | source profiles/setup_profile_environment_common.sh 3 | -------------------------------------------------------------------------------- /profiles/setup_profile_environment_fl_12_0_optimal.sh: -------------------------------------------------------------------------------- 1 | PROFILE_NAME=VP_D3D12_FL_12_0_optimal 2 | source profiles/setup_profile_environment_common.sh 3 | -------------------------------------------------------------------------------- /profiles/setup_profile_environment_fl_12_1_baseline.sh: -------------------------------------------------------------------------------- 1 | PROFILE_NAME=VP_D3D12_FL_12_1_baseline 2 | source profiles/setup_profile_environment_common.sh 3 | -------------------------------------------------------------------------------- /profiles/setup_profile_environment_fl_12_2_baseline.sh: -------------------------------------------------------------------------------- 1 | PROFILE_NAME=VP_D3D12_FL_12_2_baseline 2 | source profiles/setup_profile_environment_common.sh 3 | -------------------------------------------------------------------------------- /profiles/setup_profile_environment_fl_12_2_optimal.sh: -------------------------------------------------------------------------------- 1 | PROFILE_NAME=VP_D3D12_FL_12_2_optimal 2 | source profiles/setup_profile_environment_common.sh 3 | -------------------------------------------------------------------------------- /profiles/setup_profile_environment_maximum_nv.sh: -------------------------------------------------------------------------------- 1 | PROFILE_NAME=VP_D3D12_maximum_nv 2 | source profiles/setup_profile_environment_common.sh 3 | -------------------------------------------------------------------------------- /profiles/setup_profile_environment_maximum_radv.sh: -------------------------------------------------------------------------------- 1 | PROFILE_NAME=VP_D3D12_maximum_radv 2 | source profiles/setup_profile_environment_common.sh 3 | -------------------------------------------------------------------------------- /programs/meson.build: -------------------------------------------------------------------------------- 1 | subdir('vkd3d-compiler') 2 | subdir('vkd3d-hlsl-build') 3 | subdir('vkd3d-rs-parse') 4 | -------------------------------------------------------------------------------- /programs/vkd3d-compiler/meson.build: -------------------------------------------------------------------------------- 1 | executable('vkd3d-proton-compiler', 'main.c', 2 | dependencies : [ vkd3d_shader_dep, threads_dep ], 3 | include_directories : vkd3d_private_includes, 4 | install : true) 5 | -------------------------------------------------------------------------------- /programs/vkd3d-hlsl-build/meson.build: -------------------------------------------------------------------------------- 1 | vkd3d_hlsl_build_files = files( 2 | 'dxbc_library.cpp', 3 | 'dxil_library.cpp', 4 | 'main.cpp', 5 | ) 6 | 7 | hlsl_build_cpp_args = [] 8 | 9 | if not vkd3d_is_msvc 10 | hlsl_build_cpp_args += ['-Wno-cast-function-type'] 11 | endif 12 | 13 | if vkd3d_platform == 'windows' 14 | executable('vkd3d-hlsl-build', vkd3d_hlsl_build_files, vkd3d_header_files, 15 | include_directories : vkd3d_private_includes, 16 | cpp_args : hlsl_build_cpp_args) 17 | endif 18 | -------------------------------------------------------------------------------- /programs/vkd3d-rs-parse/meson.build: -------------------------------------------------------------------------------- 1 | executable('vkd3d-rs-parse', 'main.c', 2 | dependencies : [ vkd3d_shader_dep ], 3 | include_directories : [ vkd3d_private_includes ], 4 | install : true) 5 | -------------------------------------------------------------------------------- /tests/.gitignore: -------------------------------------------------------------------------------- 1 | /d3d12 2 | /d3d12_invalid_usage 3 | /vkd3d_api 4 | /vkd3d_common 5 | /vkd3d_shader_api 6 | -------------------------------------------------------------------------------- /tests/shaders/command/cbv_hoisting.cs_5_1.cs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | // Can be hoisted. 2 | cbuffer cbuf0 : register(b0) 3 | { 4 | uint v0; 5 | }; 6 | 7 | struct C { uint v; }; 8 | // Can be hoisted. 9 | ConstantBuffer cbuf1[1]: register(b1); 10 | // Cannot be hoisted. 11 | ConstantBuffer cbufs[2] : register(b2); 12 | 13 | RWByteAddressBuffer RWBuf : register(u0); 14 | 15 | [numthreads(4, 1, 1)] 16 | void main(uint thr : SV_DispatchThreadID) 17 | { 18 | uint wval; 19 | if (thr == 0) 20 | wval = v0; 21 | else if (thr == 2) 22 | wval = cbufs[0].v; 23 | else if (thr == 3) 24 | wval = cbufs[1].v; 25 | else 26 | { 27 | // Verify that we can convert this to a plain descriptor, even with weird indexing into array size of 1. 28 | // Array size of 1 means we have to access one descriptor. 29 | wval = cbuf1[NonUniformResourceIndex(thr - 1)].v; 30 | } 31 | 32 | RWBuf.Store(4 * thr, wval); 33 | } -------------------------------------------------------------------------------- /tests/shaders/command/command_list_initial_pipeline_state.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | void main(out float4 target : SV_Target) 2 | { 3 | target = float4(0.0f, 0.25f, 0.5f, 1.0f); 4 | } -------------------------------------------------------------------------------- /tests/shaders/command/conditional_rendering.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer cb 2 | { 3 | unsigned int offset; 4 | unsigned int value; 5 | }; 6 | 7 | RWByteAddressBuffer b; 8 | 9 | [numthreads(1, 1, 1)] 10 | void main() 11 | { 12 | b.Store(4 * offset, value); 13 | } -------------------------------------------------------------------------------- /tests/shaders/command/conservative_rasterization_ps.ps_5_0.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | void main() { } 2 | -------------------------------------------------------------------------------- /tests/shaders/command/conservative_rasterization_ps_underestimate.ps_5_0.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | void main(in uint ic : SV_InnerCoverage) { 2 | if (ic == 0) 3 | discard; 4 | } -------------------------------------------------------------------------------- /tests/shaders/command/conservative_rasterization_vs.vs_5_0.vs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main(float4 p : POSITION) : SV_Position 2 | { 3 | return p; 4 | } -------------------------------------------------------------------------------- /tests/shaders/command/dispatch_zero_thread_groups.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | RWByteAddressBuffer o; 2 | 3 | uint v; 4 | 5 | [numthreads(1, 1, 1)] 6 | void main() 7 | { 8 | o.Store(0, v); 9 | } -------------------------------------------------------------------------------- /tests/shaders/command/draw_depth_no_ps.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | void main(float4 in_position : POSITION, out float4 out_position : SV_POSITION) 2 | { 3 | out_position = in_position; 4 | } -------------------------------------------------------------------------------- /tests/shaders/command/draw_depth_only.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float depth; 2 | 3 | float main() : SV_Depth 4 | { 5 | return depth; 6 | } -------------------------------------------------------------------------------- /tests/shaders/command/draw_uav_only.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | RWTexture2D u; 2 | 3 | void main() 4 | { 5 | InterlockedAdd(u[uint2(0, 0)], 1); 6 | } -------------------------------------------------------------------------------- /tests/shaders/command/execute_indirect_cs.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | RWByteAddressBuffer o; 2 | 3 | [numthreads(1, 1, 1)] 4 | void main(uint3 group_id : SV_groupID) 5 | { 6 | uint idx = group_id.x + group_id.y * 2 + group_id.z * 6; 7 | o.Store(idx * 4, idx); 8 | } -------------------------------------------------------------------------------- /tests/shaders/command/execute_indirect_multi_dispatch.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer RWBuf : register(u0); 2 | 3 | [numthreads(1, 1, 1)] 4 | void main() 5 | { 6 | uint o; 7 | InterlockedAdd(RWBuf[0], 1, o); 8 | } -------------------------------------------------------------------------------- /tests/shaders/command/execute_indirect_multi_dispatch_root_constants.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer RWBuf : register(u0); 2 | cbuffer C : register(b0) { uint4 v; }; 3 | 4 | [numthreads(1, 1, 1)] 5 | void main() 6 | { 7 | uint o; 8 | InterlockedAdd(RWBuf[0], v.x | v.y | v.z | v.w, o); 9 | } -------------------------------------------------------------------------------- /tests/shaders/command/execute_indirect_multi_dispatch_root_descriptors.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer RWBuf : register(u0); 2 | 3 | [numthreads(1, 1, 1)] 4 | void main() 5 | { 6 | uint o; 7 | InterlockedAdd(RWBuf[0], 1, o); 8 | } -------------------------------------------------------------------------------- /tests/shaders/command/execute_indirect_ps.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | struct ps_data 2 | { 3 | float4 pos : SV_POSITION; 4 | float4 color : COLOR; 5 | }; 6 | 7 | float4 main(struct ps_data ps_input) : SV_Target 8 | { 9 | return ps_input.color; 10 | } -------------------------------------------------------------------------------- /tests/shaders/command/execute_indirect_state_predication_cs.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer C0 : register(b0) 2 | { 3 | uint offset; 4 | }; 5 | 6 | cbuffer C1 : register(b1) 7 | { 8 | uint multiplier; 9 | }; 10 | 11 | RWStructuredBuffer U : register(u0); 12 | 13 | [numthreads(1, 1, 1)] 14 | void main() 15 | { 16 | uint o; 17 | InterlockedAdd(U[offset], multiplier, o); 18 | } -------------------------------------------------------------------------------- /tests/shaders/command/execute_indirect_state_predication_ps.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer C0 : register(b0) 2 | { 3 | uint offset; 4 | }; 5 | 6 | cbuffer C1 : register(b1) 7 | { 8 | uint multiplier; 9 | }; 10 | 11 | RWStructuredBuffer U : register(u0); 12 | 13 | void main() 14 | { 15 | uint o; 16 | InterlockedAdd(U[offset], multiplier, o); 17 | } -------------------------------------------------------------------------------- /tests/shaders/command/execute_indirect_state_predication_vs.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer C0 : register(b0) 2 | { 3 | uint offset; 4 | }; 5 | 6 | cbuffer C1 : register(b1) 7 | { 8 | uint multiplier; 9 | }; 10 | 11 | RWStructuredBuffer U : register(u0); 12 | 13 | float4 main(uint vid : SV_VertexID) : SV_Position 14 | { 15 | float2 pos; 16 | pos.x = float(vid & 1) * 4.0 - 1.0; 17 | pos.y = float(vid & 2) * 2.0 - 1.0; 18 | return float4(pos.x, pos.y, 0.0, 1.0); 19 | } 20 | -------------------------------------------------------------------------------- /tests/shaders/command/execute_indirect_state_vs_code_large_cbv.vs_5_1.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer RootCBV : register(b0) 2 | { 3 | float a; 4 | }; 5 | 6 | StructuredBuffer RootSRV : register(t0); 7 | 8 | cbuffer RootConstants : register(b0, space1) 9 | { 10 | // Cannot use arrays for root constants in D3D12. 11 | float4 pad0, pad1, pad2, pad3, pad4, pad5, pad6, pad7, pad8, pad9, pad10; 12 | float4 root; 13 | }; 14 | 15 | float4 main(float c0 : COLOR0, float c1 : COLOR1, uint iid : SV_InstanceID) : SV_Position 16 | { 17 | return float4(c0, c1, a, RootSRV[0] + float(iid)) + root; 18 | } -------------------------------------------------------------------------------- /tests/shaders/command/execute_indirect_state_vs_code_small_cbv.vs_5_1.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer RootCBV : register(b0) 2 | { 3 | float a; 4 | }; 5 | 6 | StructuredBuffer RootSRV : register(t0); 7 | 8 | cbuffer RootConstants : register(b0, space1) 9 | { 10 | float4 root; 11 | }; 12 | 13 | float4 main(float c0 : COLOR0, float c1 : COLOR1, uint iid : SV_InstanceID) : SV_Position 14 | { 15 | return float4(c0, c1, a, RootSRV[0] + float(iid)) + root; 16 | } -------------------------------------------------------------------------------- /tests/shaders/command/execute_indirect_vs.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | struct vs_data 2 | { 3 | float4 pos : SV_POSITION; 4 | float4 color : COLOR; 5 | }; 6 | 7 | void main(in struct vs_data vs_input, out struct vs_data vs_output) 8 | { 9 | vs_output.pos = vs_input.pos; 10 | vs_output.color = vs_input.color; 11 | } -------------------------------------------------------------------------------- /tests/shaders/command/fractional_viewports_ps.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main(float4 position : SV_Position, 2 | float2 texcoord : TEXCOORD) : SV_Target 3 | { 4 | return float4(position.xy, texcoord); 5 | } -------------------------------------------------------------------------------- /tests/shaders/command/fractional_viewports_vs.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | void main(in float4 in_position : POSITION, 2 | in float2 in_texcoord : TEXCOORD, 3 | out float4 position : SV_Position, 4 | out float2 texcoord : TEXCOORD) 5 | { 6 | position = in_position; 7 | texcoord = in_texcoord; 8 | } -------------------------------------------------------------------------------- /tests/shaders/command/headers/draw_uav_only.h: -------------------------------------------------------------------------------- 1 | static const DWORD draw_uav_only_code_dxbc[] = 2 | { 3 | 0x43425844, 0x237a8398, 0xe7b34c17, 0xa28c91a4, 0xb3614d73, 0x00000001, 0x0000009c, 0x00000003, 4 | 0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, 5 | 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x00000048, 0x00000050, 0x00000012, 0x0100086a, 6 | 0x0400189c, 0x0011e000, 0x00000000, 0x00003333, 0x0a0000ad, 0x0011e000, 0x00000000, 0x00004002, 7 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00004001, 0x00000001, 0x0100003e, 8 | }; 9 | #ifdef __GNUC__ 10 | #define UNUSED_ARRAY_ATTR __attribute__((unused)) 11 | #else 12 | #define UNUSED_ARRAY_ATTR 13 | #endif 14 | UNUSED_ARRAY_ATTR static const D3D12_SHADER_BYTECODE draw_uav_only_dxbc = { draw_uav_only_code_dxbc, sizeof(draw_uav_only_code_dxbc) }; 15 | #undef UNUSED_ARRAY_ATTR 16 | -------------------------------------------------------------------------------- /tests/shaders/command/indirect_state_vbo_offsets_ps.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main(float4 c : C) : SV_Target 2 | { 3 | return c; 4 | } 5 | -------------------------------------------------------------------------------- /tests/shaders/command/indirect_state_vbo_offsets_vs.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VIn 2 | { 3 | uint i : I; 4 | uint vid : SV_VertexID; 5 | }; 6 | 7 | cbuffer Cbuf : register(b0) { float4 v; }; 8 | 9 | struct VOut 10 | { 11 | float4 c : C; 12 | float4 pos : SV_Position; 13 | }; 14 | 15 | VOut main(VIn vin) 16 | { 17 | VOut vout; 18 | vout.pos.x = 4.0 * float(vin.vid & 1) - 1.0; 19 | vout.pos.y = 2.0 * float(vin.vid & 2) - 1.0; 20 | vout.pos.z = 0.0; 21 | vout.pos.w = 1.0; 22 | vout.c = v; 23 | vout.c.x += float(vin.i); 24 | return vout; 25 | } 26 | -------------------------------------------------------------------------------- /tests/shaders/command/multiple_render_targets.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | void main(out float4 target0 : SV_Target0, out float4 target1 : SV_Target1, 2 | out float4 target2 : SV_Target2) 3 | { 4 | target0 = float4(1.0f, 0.0f, 0.0f, 1.0f); 5 | target1 = float4(2.0f, 0.0f, 0.0f, 1.0f); 6 | target2 = float4(3.0f, 0.0f, 0.0f, 1.0f); 7 | } -------------------------------------------------------------------------------- /tests/shaders/command/negative_viewports_ps.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main(float4 position : SV_Position, 2 | float2 texcoord : TEXCOORD) : SV_Target 3 | { 4 | return float4(position.xyz, texcoord.y); 5 | } -------------------------------------------------------------------------------- /tests/shaders/command/negative_viewports_vs.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | void main(in float4 in_position : POSITION, 2 | in float2 in_texcoord : TEXCOORD, 3 | out float4 position : SV_Position, 4 | out float2 texcoord : TEXCOORD) 5 | { 6 | position = in_position; 7 | texcoord = in_texcoord; 8 | } -------------------------------------------------------------------------------- /tests/shaders/command/null_vbv_ps.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | struct ps_data 2 | { 3 | float4 pos : SV_POSITION; 4 | float4 color : COLOR; 5 | }; 6 | 7 | float4 main(struct ps_data ps_input) : SV_Target 8 | { 9 | return ps_input.color; 10 | } -------------------------------------------------------------------------------- /tests/shaders/command/null_vbv_vs.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | struct vs_data 2 | { 3 | float4 pos : SV_POSITION; 4 | float4 color : COLOR; 5 | }; 6 | 7 | void main(in struct vs_data vs_input, out struct vs_data vs_output) 8 | { 9 | vs_output.pos = vs_input.pos; 10 | vs_output.color = vs_input.color; 11 | } -------------------------------------------------------------------------------- /tests/shaders/command/root_parameter_preservation_cs.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer RWBuf : register(u1); 2 | [numthreads(1, 1, 1)] 3 | void main() 4 | { 5 | uint v; 6 | InterlockedAdd(RWBuf[0], 1, v); 7 | } -------------------------------------------------------------------------------- /tests/shaders/command/root_parameter_preservation_ps.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer RWBuf : register(u1); 2 | float4 main() : SV_Target 3 | { 4 | uint v; 5 | InterlockedAdd(RWBuf[0], 100, v); 6 | return 1.0.xxxx; 7 | } -------------------------------------------------------------------------------- /tests/shaders/command/scissor.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main(float4 position : SV_POSITION) : SV_Target 2 | { 3 | return float4(0.0, 1.0, 0.0, 1.0); 4 | } -------------------------------------------------------------------------------- /tests/shaders/command/unaligned_vertex_stride_ps.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | struct ps_data 2 | { 3 | float4 pos : SV_POSITION; 4 | float4 color : COLOR; 5 | }; 6 | 7 | float4 main(struct ps_data ps_input) : SV_Target 8 | { 9 | return ps_input.color; 10 | } -------------------------------------------------------------------------------- /tests/shaders/command/unaligned_vertex_stride_vs.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | struct vs_data 2 | { 3 | float4 pos : SV_POSITION; 4 | float4 color : COLOR; 5 | }; 6 | 7 | void main(in struct vs_data vs_input, out struct vs_data vs_output) 8 | { 9 | vs_output.pos = vs_input.pos; 10 | vs_output.color = vs_input.color; 11 | } -------------------------------------------------------------------------------- /tests/shaders/command/uninit_root_parameters.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Buffer T : register(t0); 2 | RWStructuredBuffer U : register(u0); 3 | cbuffer C : register(b0) 4 | { 5 | float4 v; 6 | }; 7 | 8 | [numthreads(1, 1, 1)] 9 | void main(uint thr : SV_DispatchThreadID) 10 | { 11 | U[thr] = T.Load(thr) + v; 12 | } -------------------------------------------------------------------------------- /tests/shaders/command/vbv_stride_edge_cases.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main(float4 pos : POSITION) : SV_Position 2 | { 3 | return pos; 4 | } -------------------------------------------------------------------------------- /tests/shaders/command/zero_vertex_stride_ps.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | struct ps_data 2 | { 3 | float4 pos : SV_POSITION; 4 | float4 color : COLOR; 5 | }; 6 | 7 | float4 main(struct ps_data ps_input) : SV_Target 8 | { 9 | return ps_input.color; 10 | } -------------------------------------------------------------------------------- /tests/shaders/command/zero_vertex_stride_vs.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | struct vs_data 2 | { 3 | float4 pos : SV_POSITION; 4 | float4 color : COLOR; 5 | }; 6 | 7 | void main(in struct vs_data vs_input, out struct vs_data vs_output) 8 | { 9 | vs_output.pos = vs_input.pos; 10 | vs_output.color = vs_input.color; 11 | } -------------------------------------------------------------------------------- /tests/shaders/copy/ps_copy_sample_float.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t; 2 | 3 | float main(float4 position : SV_Position) : SV_Target 4 | { 5 | return t[int2(position.x, position.y)]; 6 | } 7 | -------------------------------------------------------------------------------- /tests/shaders/copy/ps_copy_sample_uint.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t; 2 | 3 | float main(float4 position : SV_Position) : SV_Target 4 | { 5 | return float(t[int2(position.x, position.y)]); 6 | } 7 | -------------------------------------------------------------------------------- /tests/shaders/copy/ps_resolve_setup_rt.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | struct out_t 2 | { 3 | float d : SV_DEPTH; 4 | float f : SV_TARGET0; 5 | uint u : SV_TARGET1; 6 | int s : SV_TARGET2; 7 | }; 8 | 9 | out_t main(in float4 pos : SV_Position, in uint sample_id : SV_SampleIndex) 10 | { 11 | uint value = (sample_id ^ 1) + 4 * uint(pos.x) + 16 * uint(pos.y); 12 | out_t result; 13 | result.d = float(value) / 64.0f; 14 | result.f = float(value) / 64.0f; 15 | result.u = value; 16 | result.s = int(value) - 32; 17 | return result; 18 | } 19 | -------------------------------------------------------------------------------- /tests/shaders/copy/ps_resolve_setup_simple.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main(in uint sample_id : SV_SampleIndex) : SV_Target 2 | { 3 | return float4(sample_id / 2, sample_id / 2, sample_id / 2, 1.0f); 4 | } 5 | -------------------------------------------------------------------------------- /tests/shaders/copy/ps_resolve_setup_stencil.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer sample_mask_t : register(b0) 2 | { 3 | uint sample_mask; 4 | }; 5 | 6 | uint main() : SV_Coverage 7 | { 8 | return sample_mask; 9 | } 10 | -------------------------------------------------------------------------------- /tests/shaders/depth_stencil/cs_load_depth.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t; 2 | RWTexture2D u; 3 | 4 | [numthreads(1, 1, 1)] 5 | void main(uint2 id : SV_GroupID) 6 | { 7 | u[id] = t[id]; 8 | } 9 | -------------------------------------------------------------------------------- /tests/shaders/depth_stencil/cs_load_stencil.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t; 2 | RWTexture2D u; 3 | 4 | [numthreads(1, 1, 1)] 5 | void main(uint2 id : SV_GroupID) 6 | { 7 | u[id] = t[id]; 8 | } 9 | -------------------------------------------------------------------------------- /tests/shaders/depth_stencil/headers/ps_depth_stencil_layout.h: -------------------------------------------------------------------------------- 1 | static const DWORD ps_depth_stencil_layout_code_dxbc[] = 2 | { 3 | 0x43425844, 0x499d4ed5, 0xbbe2842c, 0x179313ee, 0xde5cd5d9, 0x00000001, 0x00000064, 0x00000003, 4 | 0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, 5 | 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x00000010, 0x00000050, 0x00000004, 0x0100086a, 6 | 0x0100003e, 7 | }; 8 | #ifdef __GNUC__ 9 | #define UNUSED_ARRAY_ATTR __attribute__((unused)) 10 | #else 11 | #define UNUSED_ARRAY_ATTR 12 | #endif 13 | UNUSED_ARRAY_ATTR static const D3D12_SHADER_BYTECODE ps_depth_stencil_layout_dxbc = { ps_depth_stencil_layout_code_dxbc, sizeof(ps_depth_stencil_layout_code_dxbc) }; 14 | #undef UNUSED_ARRAY_ATTR 15 | -------------------------------------------------------------------------------- /tests/shaders/depth_stencil/headers/ps_early_depth_stencil.h: -------------------------------------------------------------------------------- 1 | static const DWORD ps_early_depth_stencil_code_dxbc[] = 2 | { 3 | 0x43425844, 0xd8c9f845, 0xadb9dbe2, 0x4e8aea86, 0x80f0b053, 0x00000001, 0x0000009c, 0x00000003, 4 | 0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, 5 | 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x00000048, 0x00000050, 0x00000012, 0x0100286a, 6 | 0x0400189c, 0x0011e000, 0x00000000, 0x00003333, 0x0a0000ad, 0x0011e000, 0x00000000, 0x00004002, 7 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00004001, 0x00000001, 0x0100003e, 8 | }; 9 | #ifdef __GNUC__ 10 | #define UNUSED_ARRAY_ATTR __attribute__((unused)) 11 | #else 12 | #define UNUSED_ARRAY_ATTR 13 | #endif 14 | UNUSED_ARRAY_ATTR static const D3D12_SHADER_BYTECODE ps_early_depth_stencil_dxbc = { ps_early_depth_stencil_code_dxbc, sizeof(ps_early_depth_stencil_code_dxbc) }; 15 | #undef UNUSED_ARRAY_ATTR 16 | -------------------------------------------------------------------------------- /tests/shaders/depth_stencil/ps_depth_bias_behaviour.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float main(in float4 pos : SV_POSITION) : SV_TARGET 2 | { 3 | return pos.z; 4 | } 5 | -------------------------------------------------------------------------------- /tests/shaders/depth_stencil/ps_depth_clip.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float depth; 2 | 3 | float4 main(float4 p : SV_Position, out float out_depth : SV_Depth) : SV_Target 4 | { 5 | out_depth = depth; 6 | return float4(0, 1, 0, 1); 7 | } 8 | -------------------------------------------------------------------------------- /tests/shaders/depth_stencil/ps_depth_compare.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t; 2 | SamplerComparisonState s : register(s1); 3 | 4 | float ref; 5 | 6 | float4 main(float4 position : SV_Position) : SV_Target 7 | { 8 | return t.SampleCmp(s, float2(position.x / 640.0f, position.y / 480.0f), ref); 9 | } 10 | -------------------------------------------------------------------------------- /tests/shaders/depth_stencil/ps_depth_stencil_layout.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | void main() { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /tests/shaders/depth_stencil/ps_early_depth_stencil.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | RWTexture2D u; 2 | 3 | [earlydepthstencil] 4 | void main() 5 | { 6 | InterlockedAdd(u[uint2(0, 0)], 1); 7 | } 8 | -------------------------------------------------------------------------------- /tests/shaders/depth_stencil/ps_front_back.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main(bool is_front_face : SV_IsFrontFace) : SV_TARGET 2 | { 3 | return is_front_face 4 | ? float4(1.0f, 0.0f, 0.0f, 0.0f) 5 | : float4(0.0f, 1.0f, 0.0f, 0.0f); 6 | } 7 | -------------------------------------------------------------------------------- /tests/shaders/depth_stencil/ps_load_depth.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t; 2 | 3 | float main(float4 position : SV_Position) : SV_Target 4 | { 5 | return t[int2(position.x, position.y)]; 6 | } 7 | -------------------------------------------------------------------------------- /tests/shaders/depth_stencil/ps_load_stencil.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t; 2 | 3 | uint4 main(float4 position : SV_Position) : SV_Target 4 | { 5 | return t[int2(position.x, position.y)]; 6 | } 7 | -------------------------------------------------------------------------------- /tests/shaders/depth_stencil/ps_read_only_depth.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 color; 2 | 3 | float4 main(float4 position : SV_POSITION) : SV_Target 4 | { 5 | return color; 6 | } 7 | -------------------------------------------------------------------------------- /tests/shaders/depth_stencil/ps_sample_depth.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t; 2 | SamplerState s; 3 | 4 | float4 main(float4 position : SV_Position) : SV_Target 5 | { 6 | return t.Sample(s, float2(position.x / 640.0f, position.y / 480.0f)); 7 | } 8 | -------------------------------------------------------------------------------- /tests/shaders/depth_stencil/ps_sample_depth_stencil.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | SamplerState samp; 2 | Texture2D depth_tex; 3 | Texture2D stencil_tex; 4 | 5 | float main(float4 position: SV_Position) : SV_Target 6 | { 7 | float2 s, p; 8 | float depth, stencil; 9 | depth_tex.GetDimensions(s.x, s.y); 10 | p = float2(s.x * position.x / 640.0f, s.y * position.y / 480.0f); 11 | depth = depth_tex.Sample(samp, p).r; 12 | stencil = stencil_tex.Load(int3(float3(p.x, p.y, 0))).y; 13 | return depth + stencil; 14 | } 15 | -------------------------------------------------------------------------------- /tests/shaders/depth_stencil/ps_sample_stencil.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t : register(t1); 2 | 3 | float4 main(float4 position : SV_Position) : SV_Target 4 | { 5 | float2 s; 6 | t.GetDimensions(s.x, s.y); 7 | return t.Load(int3(float3(s.x * position.x / 640.0f, s.y * position.y / 480.0f, 0))).y; 8 | } 9 | -------------------------------------------------------------------------------- /tests/shaders/depth_stencil/ps_stencil_export.ps_5_0.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | uint stencil_ref; 2 | 3 | uint main() : SV_StencilRef 4 | { 5 | return stencil_ref; 6 | } 7 | -------------------------------------------------------------------------------- /tests/shaders/depth_stencil/ps_stencil_export_load.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D tex : register(t0); 2 | 3 | uint4 main(float4 pos : SV_Position) : SV_TARGET 4 | { 5 | return tex[uint2(pos.xy)].g; 6 | } 7 | -------------------------------------------------------------------------------- /tests/shaders/depth_stencil/vs_constant_depth.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer constants : register(b0) 2 | { 3 | float depth; 4 | }; 5 | 6 | float4 main(in uint vid : SV_VERTEXID) : SV_POSITION 7 | { 8 | return float4( 9 | 4.0f * float(vid & 1) - 1.0f, 10 | 2.0f * float(vid & 2) - 1.0f, 11 | depth, 1.0f); 12 | } 13 | -------------------------------------------------------------------------------- /tests/shaders/depth_stencil/vs_depth_bias_behaviour.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main(in uint id : SV_VERTEXID) : SV_POSITION 2 | { 3 | float2 coords = float2((id << 1) & 2, id & 2); 4 | return float4(coords * float2(2, -2) + float2(-1, 1), 0.5f + dot(coords, float2(0.15f, 0.25f)), 1); 5 | } 6 | -------------------------------------------------------------------------------- /tests/shaders/depth_stencil/vs_depth_stencil_layout.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer C : register(b0) 2 | { 3 | float z; 4 | }; 5 | 6 | float4 main(uint vid : SV_VertexID) : SV_Position 7 | { 8 | if (vid == 0) 9 | return float4(-1.0, -1.0, z, 1.0); 10 | else if (vid == 1) 11 | return float4(-1.0, +3.0, z, 1.0); 12 | else 13 | return float4(+3.0, -1.0, z, 1.0); 14 | } 15 | -------------------------------------------------------------------------------- /tests/shaders/depth_stencil/vs_passthrough.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main(float4 pos : POSITION) : SV_Position 2 | { 3 | return pos; 4 | } 5 | -------------------------------------------------------------------------------- /tests/shaders/descriptors/copy_descriptors_range_sizes.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t; 2 | SamplerState s; 3 | 4 | float4 main(float4 position : SV_POSITION) : SV_Target 5 | { 6 | float2 p; 7 | 8 | p.x = position.x / 32.0f; 9 | p.y = position.y / 32.0f; 10 | return t.Sample(s, p); 11 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/descriptors_visibility.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | ByteAddressBuffer b; 2 | Texture2D t; 3 | SamplerState s; 4 | 5 | float4 cb; 6 | 7 | float4 main(uint id : SV_VertexID) : SV_Position 8 | { 9 | float2 coords = float2((id << 1) & 2, id & 2); 10 | uint i; 11 | 12 | if (cb.x != 4.0 || cb.y != 8.0 || cb.z != 16.0 || cb.w != 32.0) 13 | return (float4)0; 14 | 15 | for (i = 0; i <= 6; ++i) 16 | { 17 | if (b.Load(4 * i) != i) 18 | return (float4)0; 19 | } 20 | 21 | if (any(t.SampleLevel(s, (float2)0, 0) != float4(1.0, 1.0, 0.0, 1.0))) 22 | return (float4)0; 23 | 24 | return float4(coords * float2(2, -2) + float2(-1, 1), 0, 1); 25 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/descriptors_visibility_ps.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | ByteAddressBuffer b; 2 | Texture2D t; 3 | SamplerState s; 4 | 5 | float4 cb; 6 | 7 | float4 main(float4 position : SV_POSITION) : SV_Target 8 | { 9 | if (cb.x != 1.0 || cb.y != 2.0 || cb.z != 3.0 || cb.w != 4.0) 10 | return float4(1.0, 0.0, 0.0, 1.0); 11 | 12 | if (b.Load(0) != 2 || b.Load(4) != 4 || b.Load(8) != 8) 13 | return float4(1.0, 0.0, 0.0, 1.0); 14 | 15 | return t.Sample(s, float2(position.x / 32.0, position.y / 32.0)); 16 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/null_cbv.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | uint index; 2 | 3 | cbuffer null_cb 4 | { 5 | float4 data[1024]; 6 | }; 7 | 8 | float4 main() : SV_Target 9 | { 10 | return data[index]; 11 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/null_srv_buffer.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | ByteAddressBuffer t; 2 | 3 | uint location; 4 | 5 | float4 main(float4 position : SV_Position) : SV_Target 6 | { 7 | return t.Load(location); 8 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/null_srv_ld.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t; 2 | 3 | uint4 location; 4 | 5 | float4 main(float4 position : SV_Position) : SV_Target 6 | { 7 | return t.Load(location.xyz); 8 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/null_srv_sample.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t; 2 | SamplerState s; 3 | 4 | float4 main(float4 position : SV_Position) : SV_Target 5 | { 6 | return t.Sample(s, float2(position.x / 32.0f, position.y / 32.0f)); 7 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/null_uav_ld_buffer.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | RWByteAddressBuffer u; 2 | 3 | uint location; 4 | 5 | float4 main(float4 position : SV_Position) : SV_Target 6 | { 7 | return u.Load(4 * location); 8 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/null_uav_ld_texture.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | RWTexture2D u; 2 | 3 | float4 main(float4 position : SV_Position) : SV_Target 4 | { 5 | float2 s; 6 | u.GetDimensions(s.x, s.y); 7 | return u[s * float2(position.x / 640.0f, position.y / 480.0f)]; 8 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/overlapping_bindings.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | ByteAddressBuffer t0; 2 | ByteAddressBuffer t4 : register(t4); 3 | 4 | RWByteAddressBuffer u0; 5 | RWByteAddressBuffer u2 : register(u2); 6 | 7 | uint size; 8 | uint size2; 9 | 10 | [numthreads(1, 1, 1)] 11 | void main() 12 | { 13 | uint i; 14 | for (i = 0; i < size; ++i) 15 | u0.Store(4 * i, t0.Load(4 *i)); 16 | for (i = 0; i < size2; ++i) 17 | u2.Store(4 * i, t4.Load(4 * i)); 18 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/root_descriptor_offset_sign.cs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer RW : register(u0); 2 | StructuredBuffer R0 : register(t0); 3 | ByteAddressBuffer R1 : register(t1); 4 | 5 | [numthreads(1, 1, 1)] 6 | void main() 7 | { 8 | uint a = R0[-1]; // Negative index 9 | uint b = R0[1u << 30]; // offset 4 GB. Does it overflow back to 0? 10 | uint c = R1.Load(-4); // Negative offset 11 | uint d = R1.Load(0); 12 | RW[0] = uint4(a, b, c, d); 13 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/sampler_border_color.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t; 2 | SamplerState s; 3 | 4 | float4 main(float4 position : SV_POSITION) : SV_Target 5 | { 6 | return t.Sample(s, float2(-0.5f, 1.5f)); 7 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/sampler_non_normalized_coordinates.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | SamplerState s : register(s0); 2 | Texture2D t : register(t0); 3 | 4 | float4 main(float4 pos : SV_POSITION) : SV_TARGET 5 | { 6 | return t.Sample(s, pos.xy).xxxx; 7 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/sampler_rounding.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer RW : register(u0); 2 | Texture2D T : register(t0); 3 | SamplerState S : register(s0); 4 | 5 | cbuffer Buf : register(b0) 6 | { 7 | float2 uv; 8 | float uv_stride; 9 | }; 10 | 11 | [numthreads(1, 1, 1)] 12 | void main(uint thr : SV_DispatchThreadID) 13 | { 14 | RW[thr] = T.SampleLevel(S, uv + uv_stride * float(thr), 0.0); 15 | } 16 | -------------------------------------------------------------------------------- /tests/shaders/descriptors/sampler_rounding_gather.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer RW : register(u0); 2 | Texture2D T : register(t0); 3 | SamplerState S : register(s0); 4 | 5 | cbuffer Buf : register(b0) 6 | { 7 | float2 uv; 8 | float uv_stride; 9 | }; 10 | 11 | [numthreads(1, 1, 1)] 12 | void main(uint thr : SV_DispatchThreadID) 13 | { 14 | RW[thr] = T.GatherRed(S, uv + uv_stride * float(thr)).w; 15 | } 16 | -------------------------------------------------------------------------------- /tests/shaders/descriptors/uav_3d_sliced_view_actual.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer C : register(b0) { uint value; } 2 | RWTexture3D T : register(u0); 3 | 4 | [numthreads(4, 4, 16)] 5 | void main(uint3 thr : SV_DispatchThreadID) 6 | { 7 | uint w, h, d; 8 | T.GetDimensions(w, h, d); 9 | if (thr.z < d) 10 | T[thr] = value | (w << 8) | (h << 16) | (d << 24); 11 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/uav_3d_sliced_view_poison.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer C : register(b0) { uint value; } 2 | RWTexture3D T : register(u0); 3 | 4 | [numthreads(4, 4, 16)] 5 | void main(uint3 thr : SV_DispatchThreadID) 6 | { 7 | T[thr] = 0xdeadca7; 8 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/uav_counters_null_behavior.cs_5_1.cs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer RWBuf[4] : register(u0); 2 | 3 | [numthreads(1, 1, 1)] 4 | void main(int wg : SV_GroupID) 5 | { 6 | RWBuf[wg >> 2][wg & 3] = RWBuf[wg >> 2].IncrementCounter() + 64; 7 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/uav_robustness_oob_structure_element.cs_5_0.cs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct A { uint arr[4]; }; 2 | RWStructuredBuffer U0 : register(u0); 3 | 4 | cbuffer Cbuf : register(b0) { uint elem; uint index; uint value; }; 5 | 6 | [numthreads(1, 1, 1)] 7 | void main() 8 | { 9 | U0[elem].arr[index] = value; 10 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/undefined_descriptor_heap_mismatch_types_cbv.cs_6_6.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer Output : register(u0); 2 | 3 | struct Data { float v[1024]; }; 4 | 5 | [numthreads(1, 1, 1)] 6 | void main(uint thr : SV_DispatchThreadID) 7 | { 8 | ConstantBuffer T = ResourceDescriptorHeap[0]; 9 | Output[thr] = T.v[4 + thr]; 10 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/undefined_descriptor_heap_mismatch_types_srv_raw.cs_6_6.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer Output : register(u0); 2 | 3 | [numthreads(1, 1, 1)] 4 | void main(uint thr : SV_DispatchThreadID) 5 | { 6 | StructuredBuffer T = ResourceDescriptorHeap[0]; 7 | Output[thr] = T.Load(thr); 8 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/undefined_descriptor_heap_mismatch_types_srv_tex.cs_6_6.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer Output : register(u0); 2 | 3 | [numthreads(1, 1, 1)] 4 | void main(uint thr : SV_DispatchThreadID) 5 | { 6 | Texture2D T = ResourceDescriptorHeap[0]; 7 | Output[thr] = T.Load(int3(thr, 0, 0)); 8 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/undefined_descriptor_heap_mismatch_types_srv_typed.cs_6_6.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer Output : register(u0); 2 | 3 | [numthreads(1, 1, 1)] 4 | void main(uint thr : SV_DispatchThreadID) 5 | { 6 | Buffer T = ResourceDescriptorHeap[0]; 7 | Output[thr] = T.Load(thr); 8 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/undefined_descriptor_heap_mismatch_types_uav_raw.cs_6_6.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer Output : register(u0); 2 | 3 | [numthreads(1, 1, 1)] 4 | void main(uint thr : SV_DispatchThreadID) 5 | { 6 | RWStructuredBuffer T = ResourceDescriptorHeap[0]; 7 | Output[thr] = T.Load(thr); 8 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/undefined_descriptor_heap_mismatch_types_uav_tex.cs_6_6.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer Output : register(u0); 2 | 3 | [numthreads(1, 1, 1)] 4 | void main(uint thr : SV_DispatchThreadID) 5 | { 6 | RWTexture2D T = ResourceDescriptorHeap[0]; 7 | Output[thr] = T.Load(int2(thr, 0)); 8 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/undefined_descriptor_heap_mismatch_types_uav_typed.cs_6_6.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer Output : register(u0); 2 | 3 | [numthreads(1, 1, 1)] 4 | void main(uint thr : SV_DispatchThreadID) 5 | { 6 | RWBuffer T = ResourceDescriptorHeap[0]; 7 | Output[thr] = T.Load(thr); 8 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/update_descriptor_heap_after_closing.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t; 2 | SamplerState s; 3 | 4 | float4 main(float4 position : SV_POSITION) : SV_Target 5 | { 6 | float2 p; 7 | 8 | p.x = position.x / 32.0f; 9 | p.y = position.y / 32.0f; 10 | return t.Sample(s, p); 11 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/update_descriptor_tables.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t0; 2 | Texture2D t1; 3 | SamplerState s; 4 | 5 | float4 main(float4 position : SV_POSITION) : SV_Target 6 | { 7 | float2 p = float2(position.x / 32.0f, position.x / 32.0f); 8 | return float4(t0.Sample(s, p).r, t1.Sample(s, p).r, 0, 1); 9 | } 10 | -------------------------------------------------------------------------------- /tests/shaders/descriptors/update_descriptor_tables_after_root_signature_change.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t; 2 | SamplerState s; 3 | 4 | float4 main(float4 position : SV_POSITION) : SV_Target 5 | { 6 | float2 p; 7 | 8 | p.x = position.x / 32.0f; 9 | p.y = position.y / 32.0f; 10 | return t.Sample(s, p); 11 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/update_root_descriptors.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer cb 2 | { 3 | unsigned int offset; 4 | unsigned int value; 5 | }; 6 | 7 | RWByteAddressBuffer b; 8 | 9 | [numthreads(1, 1, 1)] 10 | void main() 11 | { 12 | b.Store(4 * offset, value); 13 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/view_min_lod_load.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D tex; 2 | float testLod; 3 | 4 | float4 main() : SV_Target 5 | { 6 | return tex.Load(int3(0, 0, int(testLod))); 7 | } -------------------------------------------------------------------------------- /tests/shaders/descriptors/view_min_lod_sample.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D tex; 2 | SamplerState s; 3 | float testLod; 4 | 5 | float4 main() : SV_Target 6 | { 7 | return tex.SampleLevel(s, float2(0, 0), testLod); 8 | } -------------------------------------------------------------------------------- /tests/shaders/mesh_shader/as_execute_indirect_state.as_6_5.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer Buf : register(u0); 2 | 3 | struct Payload 4 | { 5 | uint count; 6 | }; 7 | 8 | cbuffer Cbuf : register(b0) { uint3 groups; uint count; }; 9 | 10 | groupshared Payload p; 11 | 12 | [numthreads(1, 1, 1)] 13 | void main() 14 | { 15 | p.count = count; 16 | uint o; 17 | InterlockedAdd(Buf[0], 1, o); 18 | DispatchMesh(groups.x, groups.y, groups.z, p); 19 | } 20 | -------------------------------------------------------------------------------- /tests/shaders/mesh_shader/as_multi_workgroup.as_6_5.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer srv : register(t0); 2 | 3 | struct Payload 4 | { 5 | uint as_gid; 6 | }; 7 | 8 | [numthreads(1,1,1)] 9 | void main(in uint3 gid : SV_GroupID) 10 | { 11 | Payload payload = { gid.x }; 12 | DispatchMesh(srv[gid.x], 1, 1, payload); 13 | } 14 | -------------------------------------------------------------------------------- /tests/shaders/mesh_shader/as_simple.as_6_5.hlsl: -------------------------------------------------------------------------------- 1 | struct Payload 2 | { 3 | float4 color; 4 | }; 5 | 6 | [numthreads(1,1,1)] 7 | void main() 8 | { 9 | Payload payload = { float4(0.0f, 1.0f, 0.0f, 1.0f) }; 10 | DispatchMesh(1, 1, 1, payload); 11 | } 12 | -------------------------------------------------------------------------------- /tests/shaders/mesh_shader/ms_clip_distance.ms_6_5.hlsl: -------------------------------------------------------------------------------- 1 | struct OutputVertex 2 | { 3 | float4 pos : SV_POSITION; 4 | float clip : SV_CLIPDISTANCE; 5 | }; 6 | 7 | cbuffer input_data : register(b2) 8 | { 9 | float clip; 10 | }; 11 | 12 | [numthreads(4,1,1)] 13 | [outputtopology("triangle")] 14 | void main(in uint tid : SV_GroupIndex, out vertices OutputVertex v[4], out indices uint3 i[2]) 15 | { 16 | SetMeshOutputCounts(4, 2); 17 | 18 | v[tid].pos = float4(float(tid & 1) * 2.0f - 1.0f, float(tid & 2) - 1.0f, 0.0f, 1.0f); 19 | v[tid].clip = clip - float(tid); 20 | 21 | if (tid < 2) 22 | i[tid] = uint3(tid, 1 + 2 * tid, 2); 23 | } 24 | -------------------------------------------------------------------------------- /tests/shaders/mesh_shader/ms_cull_primitive.ms_6_5.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer buf : register(t0); 2 | 3 | struct PrimData 4 | { 5 | uint prim_id : UV_PRIMITIVE_ID; 6 | bool do_cull : SV_CULLPRIMITIVE; 7 | }; 8 | 9 | [numthreads(32,1,1)] 10 | [outputtopology("triangle")] 11 | void main(in uint tid : SV_GroupIndex, in uint3 gid : SV_GroupID, in uint3 did : SV_DispatchThreadID, 12 | out vertices float4 v[3] : SV_POSITION, out primitives PrimData p[32], out indices uint3 i[32]) 13 | { 14 | uint cull_mask = buf[gid.x]; 15 | 16 | SetMeshOutputCounts(3, 32); 17 | 18 | if (tid < 3) 19 | v[tid] = float4(float(tid & 1) * 4.0f - 1.0f, float(tid & 2) * 2.0f - 1.0f, 0.0f, 1.0f); 20 | 21 | i[tid] = uint3(0, 1, 2); 22 | p[tid].prim_id = did.x; 23 | p[tid].do_cull = !(cull_mask & (1u << tid)); 24 | } 25 | -------------------------------------------------------------------------------- /tests/shaders/mesh_shader/ms_empty.ms_6_5.hlsl: -------------------------------------------------------------------------------- 1 | [numthreads(1,1,1)] 2 | [outputtopology("triangle")] 3 | void main() 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /tests/shaders/mesh_shader/ms_execute_indirect.ms_6_5.hlsl: -------------------------------------------------------------------------------- 1 | [numthreads(4,1,1)] 2 | [outputtopology("triangle")] 3 | void main(in uint tid : SV_GroupIndex, out vertices float4 v[4] : SV_POSITION, out indices uint3 i[2]) 4 | { 5 | SetMeshOutputCounts(4, 2); 6 | 7 | v[tid] = float4(float(tid & 1) * 2.0f - 1.0f, float(tid & 2) - 1.0f, 0.0f, 1.0f); 8 | 9 | if (tid < 2) 10 | i[tid] = uint3(tid, 1 + 2 * tid, 2); 11 | } 12 | -------------------------------------------------------------------------------- /tests/shaders/mesh_shader/ms_execute_indirect_state.ms_6_5.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer Cbuf : register(b0) { uint count; }; 2 | RWStructuredBuffer Buf : register(u0); 3 | 4 | [numthreads(64, 1, 1)] 5 | [outputtopology("triangle")] 6 | void main(in uint tid : SV_GroupIndex, out vertices float4 v[3] : SV_POSITION, out indices uint3 i[64]) 7 | { 8 | SetMeshOutputCounts(3, count); 9 | 10 | if (tid < 3) 11 | v[tid] = float4(4.0 * float(tid & 1) - 1.0, 4.0 * float(tid & 2) - 1.0, 0.0, 1.0); 12 | 13 | if (tid < count) 14 | i[tid] = uint3(0, 1, 2); 15 | 16 | if (tid == 0) 17 | { 18 | uint o; 19 | InterlockedAdd(Buf[0], 1, o); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/shaders/mesh_shader/ms_execute_indirect_state_payload.ms_6_5.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer Buf : register(u0); 2 | 3 | struct Payload 4 | { 5 | uint count; 6 | }; 7 | 8 | [numthreads(64, 1, 1)] 9 | [outputtopology("triangle")] 10 | void main(in uint tid : SV_GroupIndex, in payload Payload p, out vertices float4 v[3] : SV_POSITION, out indices uint3 i[64]) 11 | { 12 | SetMeshOutputCounts(3, p.count); 13 | 14 | if (tid < 3) 15 | v[tid] = float4(float(tid & 1) * 4.0 - 1.0, 4.0 * float(tid & 2) - 1.0, 0.0, 1.0); 16 | 17 | if (tid < p.count) 18 | i[tid] = uint3(0, 1, 2); 19 | 20 | if (tid == 0) 21 | { 22 | uint o; 23 | InterlockedAdd(Buf[0], 1, o); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/shaders/mesh_shader/ms_interface_matching.ms_6_5.hlsl: -------------------------------------------------------------------------------- 1 | struct OutputVertex 2 | { 3 | float4 pos : SV_POSITION; 4 | float2 coord : UV_COORD; 5 | nointerpolation uint id : UV_VERTEX_ID; 6 | }; 7 | 8 | struct OutputPrimitive 9 | { 10 | float4 color : UV_COLOR; 11 | uint prim_data : UV_PRIMITIVE_DATA; 12 | }; 13 | 14 | [numthreads(3,1,1)] 15 | [outputtopology("triangle")] 16 | void main(in uint tid : SV_GroupIndex, out vertices OutputVertex v[16], out indices uint3 i[16], out primitives OutputPrimitive p[16]) 17 | { 18 | SetMeshOutputCounts(3, 1); 19 | 20 | float2 coord = float2(float(tid & 1) * 2.0f, float(tid & 2)); 21 | 22 | v[tid].pos = float4(coord * 2.0f - 1.0f, 0.0f, 1.0f); 23 | v[tid].coord = coord; 24 | v[tid].id = tid + 1; 25 | 26 | if (tid == 0) 27 | { 28 | i[0] = uint3(0, 1, 2); 29 | p[0].color = float4(0.0f, 1.0f, 0.0f, 1.0f); 30 | p[0].prim_data = 0xdeadbeef; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /tests/shaders/mesh_shader/ms_multi_workgroup.ms_6_5.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer uav : register(u1); 2 | 3 | struct Payload 4 | { 5 | uint as_gid; 6 | }; 7 | 8 | [outputtopology("triangle")] 9 | [numthreads(1,1,1)] 10 | void main(in payload Payload p, in uint3 gid : SV_GroupID) 11 | { 12 | InterlockedOr(uav[p.as_gid], 1u << gid.x); 13 | SetMeshOutputCounts(0, 0); 14 | } 15 | -------------------------------------------------------------------------------- /tests/shaders/mesh_shader/ms_nontrivial.ms_6_5.hlsl: -------------------------------------------------------------------------------- 1 | struct OutputVertex 2 | { 3 | float4 pos : SV_POSITION; 4 | }; 5 | 6 | [numthreads(3,1,1)] 7 | [outputtopology("triangle")] 8 | void main(in uint tid : SV_GroupIndex, out vertices OutputVertex v[3]) 9 | { 10 | SetMeshOutputCounts(3, 1); 11 | v[tid].pos = float4(0.0f, 0.0f, 0.0f, 1.0f); 12 | } 13 | -------------------------------------------------------------------------------- /tests/shaders/mesh_shader/ms_payload.ms_6_5.hlsl: -------------------------------------------------------------------------------- 1 | struct Payload 2 | { 3 | float4 color; 4 | }; 5 | 6 | struct Prim 7 | { 8 | float4 color : UV_COLOR; 9 | }; 10 | 11 | [numthreads(1,1,1)] 12 | [outputtopology("triangle")] 13 | void main(in uint tid : SV_GroupIndex, in payload Payload in_p, 14 | out vertices float4 v[3] : SV_POSITION, out primitives Prim p[1], out indices uint3 i[1]) 15 | { 16 | SetMeshOutputCounts(3, 1); 17 | v[0] = float4(-1.0f, -1.0f, 0.0f, 1.0f); 18 | v[1] = float4( 3.0f, -1.0f, 0.0f, 1.0f); 19 | v[2] = float4(-1.0f, 3.0f, 0.0f, 1.0f); 20 | i[0] = uint3(0, 1, 2); 21 | p[0].color = in_p.color; 22 | } 23 | -------------------------------------------------------------------------------- /tests/shaders/mesh_shader/ms_simple.ms_6_5.hlsl: -------------------------------------------------------------------------------- 1 | [numthreads(4,1,1)] 2 | [outputtopology("triangle")] 3 | void main(in uint tid : SV_GroupIndex, out vertices float4 v[4] : SV_POSITION, out indices uint3 i[2]) 4 | { 5 | SetMeshOutputCounts(4, 2); 6 | 7 | v[tid] = float4(float(tid & 1) * 2.0f - 1.0f, float(tid & 2) - 1.0f, 0.0f, 1.0f); 8 | 9 | if (tid < 2) 10 | i[tid] = uint3(tid, 1 + 2 * tid, 2); 11 | } 12 | -------------------------------------------------------------------------------- /tests/shaders/mesh_shader/ms_system_values.ms_6_5.hlsl: -------------------------------------------------------------------------------- 1 | struct PrimData 2 | { 3 | float4 color : UV_COLOR; 4 | uint prim_id : SV_PRIMITIVEID; 5 | uint rt_layer : SV_RENDERTARGETARRAYINDEX; 6 | }; 7 | 8 | [outputtopology("triangle")] 9 | [numthreads(8,1,1)] 10 | void main(in uint tid : SV_GROUPINDEX, 11 | out vertices float4 v[3] : SV_POSITION, out indices uint3 i[8], out primitives PrimData p[8]) 12 | { 13 | SetMeshOutputCounts(3, 8); 14 | 15 | if (tid == 0) 16 | { 17 | v[0] = float4(-1.0f, -1.0f, 0.0f, 1.0f); 18 | v[1] = float4( 3.0f, -1.0f, 0.0f, 1.0f); 19 | v[2] = float4(-1.0f, 3.0f, 0.0f, 1.0f); 20 | } 21 | 22 | i[tid] = uint3(0, 1, 2); 23 | 24 | p[tid].color = float4(float(tid & 1), float(tid & 2), float(tid & 4), 1.0f); 25 | p[tid].prim_id = (tid + 1) * (tid + 1); 26 | p[tid].rt_layer = tid; 27 | } 28 | -------------------------------------------------------------------------------- /tests/shaders/mesh_shader/ps_color.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main(in nointerpolation float4 color : UV_COLOR) : SV_TARGET0 2 | { 3 | return color; 4 | } 5 | -------------------------------------------------------------------------------- /tests/shaders/mesh_shader/ps_culling.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer uav : register(u1); 2 | 3 | void main(in nointerpolation uint p : UV_PRIMITIVE_ID) 4 | { 5 | uint dword_index = p >> 5; 6 | uint bit_index = p & 31; 7 | InterlockedOr(uav[dword_index], 1u << bit_index); 8 | } 9 | -------------------------------------------------------------------------------- /tests/shaders/mesh_shader/ps_derivatives.ps_6_6.hlsl: -------------------------------------------------------------------------------- 1 | float4 main(in float4 color : COLOR) : SV_TARGET 2 | { 3 | return color; 4 | } 5 | -------------------------------------------------------------------------------- /tests/shaders/mesh_shader/ps_dummy.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | void main() 2 | { 3 | 4 | } -------------------------------------------------------------------------------- /tests/shaders/mesh_shader/ps_execute_indirect_state.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer Buf : register(u0); 2 | 3 | void main() 4 | { 5 | uint o; 6 | InterlockedAdd(Buf[0], 1, o); 7 | } 8 | -------------------------------------------------------------------------------- /tests/shaders/mesh_shader/ps_green.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main() : SV_TARGET 2 | { 3 | return float4(0.0f, 1.0f, 0.0f, 1.0f); 4 | } 5 | -------------------------------------------------------------------------------- /tests/shaders/mesh_shader/ps_interface_matching.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer uav : register(u1); 2 | 3 | float4 main(in float2 coord : UV_COORD, 4 | nointerpolation in float4 color : UV_COLOR, 5 | nointerpolation in uint prim_data : UV_PRIMITIVE_DATA, 6 | nointerpolation uint id : UV_VERTEX_ID) : SV_TARGET0 7 | { 8 | uint2 r = uint2(round(2.0f * coord)); 9 | 10 | InterlockedOr(uav[0], prim_data); 11 | InterlockedOr(uav[1], r.x); 12 | InterlockedOr(uav[2], r.y); 13 | InterlockedOr(uav[3], id); 14 | return color; 15 | } 16 | -------------------------------------------------------------------------------- /tests/shaders/mesh_shader/ps_system_values.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer uav : register(u1); 2 | 3 | float4 main(in nointerpolation float4 color : UV_COLOR, 4 | in nointerpolation uint prim_id : SV_PRIMITIVEID) : SV_TARGET0 5 | { 6 | uint dword_index = prim_id >> 5; 7 | uint bit_index = prim_id & 31; 8 | InterlockedOr(uav[dword_index], 1u << bit_index); 9 | return color; 10 | } 11 | -------------------------------------------------------------------------------- /tests/shaders/mesh_shader/vs_dummy.vs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main() : SV_POSITION 2 | { 3 | return float4(0.0f, 0.0f, 0.0f, 1.0f); 4 | } 5 | -------------------------------------------------------------------------------- /tests/shaders/pso/cs_create_pso.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | [numthreads(1, 1, 1)] 2 | void main() 3 | { 4 | } 5 | -------------------------------------------------------------------------------- /tests/shaders/pso/cs_null_root_signature.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | #define rs_text "UAV(u0), RootConstants(num32BitConstants=1, b0)" 2 | 3 | RWStructuredBuffer buffer : register(u0); 4 | 5 | cbuffer info_t : register(b0) 6 | { 7 | uint value; 8 | }; 9 | 10 | [RootSignature(rs_text)] 11 | [numthreads(1,1,1)] 12 | void main() 13 | { 14 | buffer[0] = value; 15 | } 16 | -------------------------------------------------------------------------------- /tests/shaders/pso/ds_mismatch_1.ds_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct DsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | float2 arg1 : ARG1; 6 | uint4 arg2 : ARG2; 7 | }; 8 | 9 | struct HsOut 10 | { 11 | float4 position : SV_POSITION; 12 | }; 13 | 14 | struct HsPatch 15 | { 16 | float tf_outer[3] : SV_TESSFACTOR; 17 | float tf_inner : SV_INSIDETESSFACTOR; 18 | float3 arg0 : ARG0; 19 | float2 arg1 : ARG1; 20 | uint4 arg2 : ARG2; 21 | }; 22 | 23 | [domain("tri")] 24 | DsOut main(float3 coord : SV_DOMAINLOCATION, 25 | HsPatch patchconst, OutputPatch patch) 26 | { 27 | DsOut result; 28 | result.position = coord.x + patch[0].position + 29 | coord.y + patch[1].position + 30 | coord.z + patch[2].position; 31 | result.arg0 = patchconst.arg0; 32 | result.arg1 = patchconst.arg1; 33 | result.arg2 = patchconst.arg2; 34 | return result; 35 | } 36 | -------------------------------------------------------------------------------- /tests/shaders/pso/ds_mismatch_2.ds_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | float2 arg1 : ARG1; 6 | uint2 arg2 : ARG2; 7 | }; 8 | 9 | struct HsPatch 10 | { 11 | float tf_outer[3] : SV_TESSFACTOR; 12 | float tf_inner : SV_INSIDETESSFACTOR; 13 | }; 14 | 15 | [domain("tri")] 16 | VsOut main(float3 coord : SV_DOMAINLOCATION, 17 | HsPatch patchconst, OutputPatch patch) 18 | { 19 | VsOut result; 20 | result.position = coord.x + patch[0].position + 21 | coord.y + patch[1].position + 22 | coord.z + patch[2].position; 23 | result.arg0 = patch[0].arg0; 24 | result.arg1 = patch[0].arg1; 25 | result.arg2 = patch[0].arg2.xyxy; 26 | return result; 27 | } 28 | -------------------------------------------------------------------------------- /tests/shaders/pso/ds_mismatch_3.ds_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct DsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | float2 arg1 : ARG1; 6 | uint4 arg2 : ARG2; 7 | }; 8 | 9 | struct HsOut 10 | { 11 | float4 position : SV_POSITION; 12 | }; 13 | 14 | struct HsPatch 15 | { 16 | float tf_outer[3] : SV_TESSFACTOR; 17 | float tf_inner : SV_INSIDETESSFACTOR; 18 | float3 arg0 : ARG0; 19 | float2 arg1 : ARG1; 20 | uint2 arg2 : ARG2; 21 | }; 22 | 23 | [domain("tri")] 24 | DsOut main(float3 coord : SV_DOMAINLOCATION, 25 | HsPatch patchconst, OutputPatch patch) 26 | { 27 | DsOut result; 28 | result.position = coord.x + patch[0].position + 29 | coord.y + patch[1].position + 30 | coord.z + patch[2].position; 31 | result.arg0 = patchconst.arg0; 32 | result.arg1 = patchconst.arg1; 33 | result.arg2 = patchconst.arg2.xyxy; 34 | return result; 35 | } 36 | -------------------------------------------------------------------------------- /tests/shaders/pso/ds_mismatch_4.ds_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | float2 arg1 : ARG1; 6 | }; 7 | 8 | struct DsOut 9 | { 10 | float4 position : SV_POSITION; 11 | float3 arg0 : ARG0; 12 | float2 arg1 : ARG1; 13 | uint4 arg2 : ARG2; 14 | }; 15 | 16 | struct HsPatch 17 | { 18 | float tf_outer[3] : SV_TESSFACTOR; 19 | float tf_inner : SV_INSIDETESSFACTOR; 20 | }; 21 | 22 | [domain("tri")] 23 | DsOut main(float3 coord : SV_DOMAINLOCATION, 24 | HsPatch patchconst, OutputPatch patch) 25 | { 26 | DsOut result; 27 | result.position = coord.x + patch[0].position + 28 | coord.y + patch[1].position + 29 | coord.z + patch[2].position; 30 | result.arg0 = patch[0].arg0; 31 | result.arg1 = patch[0].arg1; 32 | result.arg2 = uint4(0, 0, 0, 0); 33 | return result; 34 | } 35 | -------------------------------------------------------------------------------- /tests/shaders/pso/ds_mismatch_5.ds_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct DsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | float2 arg1 : ARG1; 6 | uint4 arg2 : ARG2; 7 | }; 8 | 9 | struct HsOut 10 | { 11 | float4 position : SV_POSITION; 12 | }; 13 | 14 | struct HsPatch 15 | { 16 | float tf_outer[3] : SV_TESSFACTOR; 17 | float tf_inner : SV_INSIDETESSFACTOR; 18 | float3 arg0 : ARG0; 19 | float2 arg1 : ARG1; 20 | }; 21 | 22 | [domain("tri")] 23 | DsOut main(float3 coord : SV_DOMAINLOCATION, 24 | HsPatch patchconst, OutputPatch patch) 25 | { 26 | DsOut result; 27 | result.position = coord.x + patch[0].position + 28 | coord.y + patch[1].position + 29 | coord.z + patch[2].position; 30 | result.arg0 = patchconst.arg0; 31 | result.arg1 = patchconst.arg1; 32 | result.arg2 = uint4(0, 0, 0, 0); 33 | return result; 34 | } 35 | -------------------------------------------------------------------------------- /tests/shaders/pso/ds_mismatch_6.ds_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | float2 arg1 : ARG1; 6 | }; 7 | 8 | struct DsOut 9 | { 10 | float4 position : SV_POSITION; 11 | float3 arg0 : ARG0; 12 | float2 arg1 : ARG1; 13 | uint4 arg2 : ARG2; 14 | }; 15 | 16 | struct HsPatch 17 | { 18 | float tf_outer[3] : SV_TESSFACTOR; 19 | }; 20 | 21 | [domain("tri")] 22 | DsOut main(float3 coord : SV_DOMAINLOCATION, 23 | HsPatch patchconst, OutputPatch patch) 24 | { 25 | DsOut result; 26 | result.position = coord.x + patch[0].position + 27 | coord.y + patch[1].position + 28 | coord.z + patch[2].position; 29 | result.arg0 = patch[0].arg0; 30 | result.arg1 = patch[0].arg1; 31 | result.arg2 = uint4(0, 0, 0, 0); 32 | return result; 33 | } 34 | -------------------------------------------------------------------------------- /tests/shaders/pso/ds_mismatch_ref.ds_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | float2 arg1 : ARG1; 6 | uint4 arg2 : ARG2; 7 | }; 8 | 9 | struct HsPatch 10 | { 11 | float tf_outer[3] : SV_TESSFACTOR; 12 | float tf_inner : SV_INSIDETESSFACTOR; 13 | }; 14 | 15 | [domain("tri")] 16 | VsOut main(float3 coord : SV_DOMAINLOCATION, 17 | HsPatch patchconst, OutputPatch patch) 18 | { 19 | VsOut result; 20 | result.position = coord.x + patch[0].position + 21 | coord.y + patch[1].position + 22 | coord.z + patch[2].position; 23 | result.arg0 = patch[0].arg0; 24 | result.arg1 = patch[0].arg1; 25 | result.arg2 = patch[0].arg2; 26 | return result; 27 | } 28 | -------------------------------------------------------------------------------- /tests/shaders/pso/gs_mismatch_1.gs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | float arg1 : ARG1; 6 | }; 7 | 8 | struct GsOut 9 | { 10 | float4 position : SV_POSITION; 11 | float3 arg0 : ARG0; 12 | float2 arg1 : ARG1; 13 | uint4 arg2 : ARG2; 14 | }; 15 | 16 | [maxvertexcount(3)] 17 | void main(triangle VsOut vertices[3], inout PointStream out_stream) 18 | { 19 | for (uint i = 0; i < 3; i++) 20 | { 21 | GsOut result; 22 | result.position = vertices[i].position; 23 | result.arg0 = vertices[i].arg0; 24 | result.arg1 = vertices[i].arg1.xx; 25 | result.arg2 = uint4(0, 0, 0, 0); 26 | 27 | out_stream.Append(result); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tests/shaders/pso/gs_mismatch_2.gs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | float2 arg1 : ARG1; 6 | int4 arg2 : ARG2; 7 | }; 8 | 9 | struct GsOut 10 | { 11 | float4 position : SV_POSITION; 12 | float3 arg0 : ARG0; 13 | float2 arg1 : ARG1; 14 | uint4 arg2 : ARG2; 15 | }; 16 | 17 | [maxvertexcount(3)] 18 | void main(triangle VsOut vertices[3], inout PointStream out_stream) 19 | { 20 | for (uint i = 0; i < 3; i++) 21 | { 22 | GsOut result; 23 | result.position = vertices[i].position; 24 | result.arg0 = vertices[i].arg0; 25 | result.arg1 = vertices[i].arg1; 26 | result.arg2 = uint4(vertices[i].arg2); 27 | 28 | out_stream.Append(result); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /tests/shaders/pso/gs_mismatch_3.gs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : POSITION; 4 | float3 arg0 : ARG0; 5 | float2 arg1 : ARG1; 6 | uint4 arg2 : ARG2; 7 | }; 8 | 9 | struct GsOut 10 | { 11 | float4 position : SV_POSITION; 12 | float3 arg0 : ARG0; 13 | float2 arg1 : ARG1; 14 | uint4 arg2 : ARG2; 15 | }; 16 | 17 | [maxvertexcount(3)] 18 | void main(triangle VsOut vertices[3], inout PointStream out_stream) 19 | { 20 | for (uint i = 0; i < 3; i++) 21 | { 22 | GsOut result; 23 | result.position = vertices[i].position; 24 | result.arg0 = vertices[i].arg0; 25 | result.arg1 = vertices[i].arg1; 26 | result.arg2 = vertices[i].arg2; 27 | 28 | out_stream.Append(result); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /tests/shaders/pso/gs_mismatch_4.gs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | float2 arg1 : ARG1; 6 | uint arg2[4] : ARG2; 7 | }; 8 | 9 | struct GsOut 10 | { 11 | float4 position : SV_POSITION; 12 | float3 arg0 : ARG0; 13 | float2 arg1 : ARG1; 14 | uint4 arg2 : ARG2; 15 | }; 16 | 17 | [maxvertexcount(3)] 18 | void main(triangle VsOut vertices[3], inout PointStream out_stream) 19 | { 20 | for (uint i = 0; i < 3; i++) 21 | { 22 | GsOut result; 23 | result.position = vertices[i].position; 24 | result.arg0 = vertices[i].arg0; 25 | result.arg1 = vertices[i].arg1; 26 | result.arg2 = vertices[i].arg2[0].xxxx; 27 | 28 | out_stream.Append(result); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /tests/shaders/pso/gs_mismatch_5.gs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | float2 arg1 : ARG1; 6 | uint arg2 : ARG2; 7 | }; 8 | 9 | struct GsOut 10 | { 11 | float4 position : SV_POSITION; 12 | float3 arg0 : ARG0; 13 | float2 arg1 : ARG1; 14 | uint4 arg2 : ARG2; 15 | }; 16 | 17 | [maxvertexcount(3)] 18 | void main(triangle VsOut vertices[3], inout PointStream out_stream) 19 | { 20 | for (uint i = 0; i < 3; i++) 21 | { 22 | GsOut result; 23 | result.position = vertices[i].position; 24 | result.arg0 = vertices[i].arg0; 25 | result.arg1 = vertices[i].arg1; 26 | result.arg2 = vertices[i].arg2.xxxx; 27 | 28 | out_stream.Append(result); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /tests/shaders/pso/gs_mismatch_primid.gs_5_0.gs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | float2 arg1 : ARG1; 6 | uint4 arg2 : ARG2; 7 | }; 8 | 9 | struct GsOut 10 | { 11 | float4 position : SV_POSITION; 12 | float3 arg0 : ARG0; 13 | uint primid : SV_PRIMITIVEID; 14 | nointerpolation float2 arg1 : ARG1; 15 | uint4 arg2 : ARG2; 16 | }; 17 | 18 | [maxvertexcount(3)] 19 | void main(triangle VsOut vertices[3], in uint primid : SV_PRIMITIVEID, 20 | inout TriangleStream out_stream) 21 | { 22 | for (uint i = 0; i < 3; i++) 23 | { 24 | GsOut result; 25 | result.position = vertices[i].position; 26 | result.arg0 = vertices[i].arg0; 27 | result.arg1 = vertices[i].arg1; 28 | result.arg2 = vertices[i].arg2; 29 | result.primid = primid; 30 | 31 | out_stream.Append(result); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /tests/shaders/pso/gs_mismatch_ref.gs_5_0.gs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ArG0; 5 | float2 arg1 : arG1; 6 | uint4 arg2 : ARg2; 7 | }; 8 | 9 | [maxvertexcount(3)] 10 | void main(triangle VsOut vertices[3], inout PointStream out_stream) 11 | { 12 | for (uint i = 0; i < 3; i++) 13 | { 14 | out_stream.Append(vertices[i]); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/shaders/pso/gs_mismatch_so_2.gs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | float2 arg1 : ARG1; 6 | uint4 arg2 : ARG2; 7 | }; 8 | 9 | struct GsOut0 10 | { 11 | float4 position : SV_POSITION; 12 | float3 arg0 : ARG0; 13 | uint4 arg2 : ARG2; 14 | }; 15 | 16 | struct GsOut1 17 | { 18 | float2 arg1 : ARG1; 19 | }; 20 | 21 | [maxvertexcount(3)] 22 | void main(triangle VsOut vertices[3], 23 | inout PointStream out_stream0, 24 | inout PointStream out_stream1) 25 | { 26 | for (uint i = 0; i < 3; i++) 27 | { 28 | GsOut0 v0; 29 | v0.position = vertices[i].position; 30 | v0.arg0 = vertices[i].arg0; 31 | v0.arg2 = vertices[i].arg2; 32 | 33 | out_stream0.Append(v0); 34 | } 35 | 36 | GsOut1 v1; 37 | v1.arg1 = vertices[0].arg1; 38 | 39 | out_stream1.Append(v1); 40 | } 41 | -------------------------------------------------------------------------------- /tests/shaders/pso/gs_multiview_export_layer_viewport.gs_6_1.hlsl: -------------------------------------------------------------------------------- 1 | struct VertexData 2 | { 3 | float4 pos : SV_POSITION; 4 | uint rt_data : UV_VIEWID; 5 | uint layer : SV_RENDERTARGETARRAYINDEX; 6 | uint viewport : SV_VIEWPORTARRAYINDEX; 7 | }; 8 | 9 | [maxvertexcount(3)] 10 | void main(in uint view_id : SV_VIEWID, triangle VertexData vtx_in[3], inout TriangleStream vtx_out) 11 | { 12 | for (uint i = 0; i < 3; i++) 13 | { 14 | VertexData result; 15 | result.pos = vtx_in[i].pos; 16 | result.layer = vtx_in[i].layer; 17 | result.viewport = vtx_in[i].viewport; 18 | result.rt_data = view_id | (result.layer << 8) | (result.viewport << 16); 19 | 20 | vtx_out.Append(result); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/shaders/pso/headers/cs_create_pso.h: -------------------------------------------------------------------------------- 1 | static const DWORD cs_create_pso_code_dxbc[] = 2 | { 3 | 0x43425844, 0x1acc3ad0, 0x71c7b057, 0xc72c4306, 0xf432cb57, 0x00000001, 0x00000074, 0x00000003, 4 | 0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, 5 | 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x00000020, 0x00050050, 0x00000008, 0x0100086a, 6 | 0x0400009b, 0x00000001, 0x00000001, 0x00000001, 0x0100003e, 7 | }; 8 | #ifdef __GNUC__ 9 | #define UNUSED_ARRAY_ATTR __attribute__((unused)) 10 | #else 11 | #define UNUSED_ARRAY_ATTR 12 | #endif 13 | UNUSED_ARRAY_ATTR static const D3D12_SHADER_BYTECODE cs_create_pso_dxbc = { cs_create_pso_code_dxbc, sizeof(cs_create_pso_code_dxbc) }; 14 | #undef UNUSED_ARRAY_ATTR 15 | -------------------------------------------------------------------------------- /tests/shaders/pso/headers/ps_create_pso.h: -------------------------------------------------------------------------------- 1 | static const DWORD ps_create_pso_code_dxbc[] = 2 | { 3 | 0x43425844, 0x29b14cf3, 0xb991cf90, 0x9e455ffc, 0x4675b046, 0x00000001, 0x000000b4, 0x00000003, 4 | 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, 5 | 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 6 | 0x0000000f, 0x545f5653, 0x45475241, 0xabab0054, 0x58454853, 0x0000003c, 0x00000050, 0x0000000f, 7 | 0x0100086a, 0x03000065, 0x001020f2, 0x00000000, 0x08000036, 0x001020f2, 0x00000000, 0x00004002, 8 | 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x0100003e, 9 | }; 10 | #ifdef __GNUC__ 11 | #define UNUSED_ARRAY_ATTR __attribute__((unused)) 12 | #else 13 | #define UNUSED_ARRAY_ATTR 14 | #endif 15 | UNUSED_ARRAY_ATTR static const D3D12_SHADER_BYTECODE ps_create_pso_dxbc = { ps_create_pso_code_dxbc, sizeof(ps_create_pso_code_dxbc) }; 16 | #undef UNUSED_ARRAY_ATTR 17 | -------------------------------------------------------------------------------- /tests/shaders/pso/headers/ps_integer_blending.h: -------------------------------------------------------------------------------- 1 | static const DWORD ps_integer_blending_code_dxbc[] = 2 | { 3 | 0x43425844, 0x9f26b611, 0xc59570a7, 0x9b327871, 0xb1015fc6, 0x00000001, 0x000000a8, 0x00000003, 4 | 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, 5 | 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 6 | 0x00000e01, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x00000030, 0x00000050, 0x0000000c, 7 | 0x0100086a, 0x03000065, 0x00102012, 0x00000000, 0x05000036, 0x00102012, 0x00000000, 0x00004001, 8 | 0x0000000a, 0x0100003e, 9 | }; 10 | #ifdef __GNUC__ 11 | #define UNUSED_ARRAY_ATTR __attribute__((unused)) 12 | #else 13 | #define UNUSED_ARRAY_ATTR 14 | #endif 15 | UNUSED_ARRAY_ATTR static const D3D12_SHADER_BYTECODE ps_integer_blending_dxbc = { ps_integer_blending_code_dxbc, sizeof(ps_integer_blending_code_dxbc) }; 16 | #undef UNUSED_ARRAY_ATTR 17 | -------------------------------------------------------------------------------- /tests/shaders/pso/headers/ps_integer_blending_no_rt.h: -------------------------------------------------------------------------------- 1 | static const DWORD ps_integer_blending_no_rt_code_dxbc[] = 2 | { 3 | 0x43425844, 0x499d4ed5, 0xbbe2842c, 0x179313ee, 0xde5cd5d9, 0x00000001, 0x00000064, 0x00000003, 4 | 0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, 5 | 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x00000010, 0x00000050, 0x00000004, 0x0100086a, 6 | 0x0100003e, 7 | }; 8 | #ifdef __GNUC__ 9 | #define UNUSED_ARRAY_ATTR __attribute__((unused)) 10 | #else 11 | #define UNUSED_ARRAY_ATTR 12 | #endif 13 | UNUSED_ARRAY_ATTR static const D3D12_SHADER_BYTECODE ps_integer_blending_no_rt_dxbc = { ps_integer_blending_no_rt_code_dxbc, sizeof(ps_integer_blending_no_rt_code_dxbc) }; 14 | #undef UNUSED_ARRAY_ATTR 15 | -------------------------------------------------------------------------------- /tests/shaders/pso/headers/ps_line_raster.h: -------------------------------------------------------------------------------- 1 | static const DWORD ps_line_raster_code_dxbc[] = 2 | { 3 | 0x43425844, 0x30eae862, 0x9f6e83a9, 0xc82bb0e2, 0x23ff6513, 0x00000001, 0x000000b4, 0x00000003, 4 | 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, 5 | 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 6 | 0x0000000f, 0x545f5653, 0x45475241, 0xabab0054, 0x58454853, 0x0000003c, 0x00000050, 0x0000000f, 7 | 0x0100086a, 0x03000065, 0x001020f2, 0x00000000, 0x08000036, 0x001020f2, 0x00000000, 0x00004002, 8 | 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x0100003e, 9 | }; 10 | #ifdef __GNUC__ 11 | #define UNUSED_ARRAY_ATTR __attribute__((unused)) 12 | #else 13 | #define UNUSED_ARRAY_ATTR 14 | #endif 15 | UNUSED_ARRAY_ATTR static const D3D12_SHADER_BYTECODE ps_line_raster_dxbc = { ps_line_raster_code_dxbc, sizeof(ps_line_raster_code_dxbc) }; 16 | #undef UNUSED_ARRAY_ATTR 17 | -------------------------------------------------------------------------------- /tests/shaders/pso/hs_mismatch_ref.hs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | float2 arg1 : ARG1; 6 | uint4 arg2 : ARG2; 7 | }; 8 | 9 | struct HsPatch 10 | { 11 | float tf_outer[3] : SV_TESSFACTOR; 12 | float tf_inner : SV_INSIDETESSFACTOR; 13 | }; 14 | 15 | HsPatch main_patch() 16 | { 17 | HsPatch result; 18 | result.tf_outer[0] = 4.0f; 19 | result.tf_outer[1] = 4.0f; 20 | result.tf_outer[2] = 4.0f; 21 | result.tf_inner = 4.0f; 22 | return result; 23 | } 24 | 25 | [domain("tri")] 26 | [partitioning("integer")] 27 | [outputtopology("triangle_cw")] 28 | [outputcontrolpoints(3)] 29 | [patchconstantfunc("main_patch")] 30 | VsOut main(uint cid : SV_OutputControlPointID, InputPatch in_patch) 31 | { 32 | return in_patch[cid]; 33 | } 34 | -------------------------------------------------------------------------------- /tests/shaders/pso/ms_mismatch.ms_6_5.hlsl: -------------------------------------------------------------------------------- 1 | struct VertOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | uint4 arg2 : ARG2; 6 | }; 7 | 8 | struct PrimOut 9 | { 10 | float2 arg1 : ARG1; 11 | }; 12 | 13 | [outputtopology("triangle")] 14 | [numthreads(3,1,1)] 15 | void main(in uint tid : SV_GROUPINDEX, 16 | out vertices VertOut v[3], out indices uint3 i[1], 17 | out primitives PrimOut p[1]) 18 | { 19 | SetMeshOutputCounts(3, 1); 20 | 21 | VertOut vertex; 22 | /* Not drawing anything, just use some random non-constant positions */ 23 | vertex.position = float4(tid & 1, tid & 2, 0.0f, 1.0f); 24 | vertex.arg0 = float3(1.0f, 2.0f, 3.0f); 25 | vertex.arg2 = uint4(6, 7, 8, 9); 26 | 27 | v[tid] = vertex; 28 | 29 | PrimOut prim; 30 | prim.arg1 = float2(4.0f, 5.0f); 31 | 32 | if (tid == 0) 33 | { 34 | i[0] = uint3(0, 1, 2); 35 | p[0] = prim; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /tests/shaders/pso/ms_mismatch_min16float.ms_6_5.hlsl: -------------------------------------------------------------------------------- 1 | struct VertOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | uint4 arg2 : ARG2; 6 | }; 7 | 8 | struct PrimOut 9 | { 10 | min16float2 arg1 : ARG1; 11 | }; 12 | 13 | [outputtopology("triangle")] 14 | [numthreads(3,1,1)] 15 | void main(in uint tid : SV_GROUPINDEX, 16 | out vertices VertOut v[3], out indices uint3 i[1], 17 | out primitives PrimOut p[1]) 18 | { 19 | SetMeshOutputCounts(3, 1); 20 | 21 | VertOut vertex; 22 | /* Not drawing anything, just use some random non-constant positions */ 23 | vertex.position = float4(tid & 1, tid & 2, 0.0f, 1.0f); 24 | vertex.arg0 = float3(1.0f, 2.0f, 3.0f); 25 | vertex.arg2 = uint4(6, 7, 8, 9); 26 | 27 | v[tid] = vertex; 28 | 29 | PrimOut prim; 30 | prim.arg1 = float2(4.0f, 5.0f); 31 | 32 | if (tid == 0) 33 | { 34 | i[0] = uint3(0, 1, 2); 35 | p[0] = prim; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /tests/shaders/pso/ms_view_id_passthrough.ms_6_5.hlsl: -------------------------------------------------------------------------------- 1 | struct VertexData 2 | { 3 | float4 pos : SV_POSITION; 4 | uint rt_data : UV_VIEWID; 5 | }; 6 | 7 | [outputtopology("triangle")] 8 | [numthreads(3, 1, 1)] 9 | void main(in uint view_id : SV_VIEWID, in uint tid : SV_GROUPINDEX, 10 | out indices uint3 idx[3], out vertices VertexData vtx[1]) 11 | { 12 | SetMeshOutputCounts(3, 1); 13 | 14 | float2 coords = float2(tid & 2, (tid << 1) & 2); 15 | 16 | VertexData v; 17 | v.pos = float4(coords * float2(2, 2) + float2(-1, -1), 0, 1); 18 | v.rt_data = view_id; 19 | 20 | vtx[tid] = v; 21 | 22 | if (tid == 0) 23 | idx[tid] = uint3(0, 1, 2); 24 | } 25 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_append_aligned_element.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | struct vs_out 2 | { 3 | float4 position : SV_POSITION; 4 | float2 color_xy : COLOR0; 5 | float2 color_zw : COLOR1; 6 | }; 7 | 8 | float4 main(struct vs_out i) : SV_TARGET 9 | { 10 | return float4(i.color_xy.xy, i.color_zw.xy); 11 | } 12 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_atoc.ps_5_0.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer constants : register(b0) 2 | { 3 | float alpha; 4 | }; 5 | 6 | float4 main(in uint sample_mask : SV_COVERAGE) : SV_TARGET 7 | { 8 | float alpha_out = (sample_mask & 0xff) != 0 ? alpha : 0.0f; 9 | return float4(1.0f, 1.0f, 1.0f, alpha_out); 10 | } 11 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_count_samples.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2DMS tex_ms : register(t0); 2 | 3 | uint main(in float4 coord : SV_POSITION) : SV_TARGET 4 | { 5 | uint count = 0; 6 | 7 | for (uint i = 0; i < 4; i++) 8 | count += tex_ms.Load(int2(coord.xy), i).x != 0.0f ? 1u : 0u; 9 | 10 | return count; 11 | } 12 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_create_pso.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main() : SV_TARGET 2 | { 3 | return float4(1.0f, 1.0f, 1.0f, 1.0f); 4 | } 5 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_dual_source.ps_5_0.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 c0; 2 | float4 c1; 3 | 4 | void main(out float4 o0 : SV_Target0, out float4 o1 : SV_Target1) 5 | { 6 | o0 = c0; 7 | o1 = c1; 8 | } 9 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_dual_source_3rt.ps_5_0.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 c0; 2 | float4 c1; 3 | 4 | void main(out float4 o0 : SV_Target0, out float4 o1 : SV_Target1, out float4 o2 : SV_Target2) 5 | { 6 | o0 = c0; 7 | o1 = c1; 8 | o2 = 1.0.xxxx; 9 | } 10 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_export_coverage.ps_5_0.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer constants : register(b0) 2 | { 3 | uint sample_mask_in; 4 | }; 5 | 6 | float4 main(out uint sample_mask : SV_COVERAGE) : SV_TARGET 7 | { 8 | sample_mask = sample_mask_in; 9 | return float4(1.0f, 1.0f, 1.0f, 0.0f); 10 | } 11 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_integer_blending.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | uint main() : SV_Target 2 | { 3 | return 10; 4 | } 5 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_integer_blending_no_rt.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | void main() 2 | { 3 | } 4 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_interstage.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | void main(float4 position : SV_Position, float2 t0 : TEXCOORD0, 2 | nointerpolation float t1 : TEXCOORD1, uint t2 : TEXCOORD2, 3 | uint t3 : TEXCOORD3, float t4 : TEXCOORD4, out float4 o : SV_Target) 4 | { 5 | o.x = t0.y + t1; 6 | o.y = t2 + t3; 7 | o.z = t4; 8 | o.w = t0.x; 9 | } 10 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_line_raster.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main() : SV_TARGET 2 | { 3 | return float4(0.0f.xxx, 1.0f); 4 | } 5 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_mismatch_1.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | float2 arg1 : ARG1; 6 | uint arg2 : ARG2; 7 | }; 8 | 9 | struct PsOut 10 | { 11 | float4 color0 : SV_TARGET0; 12 | float2 color1 : SV_TARGET1; 13 | uint4 color2 : SV_TARGET2; 14 | }; 15 | 16 | PsOut main(VsOut data) 17 | { 18 | PsOut result; 19 | result.color0 = float4(data.arg0, 0.0f); 20 | result.color1 = data.arg1; 21 | result.color2 = uint4(data.arg2, 0, 0, 0); 22 | return result; 23 | } 24 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_mismatch_10.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | nointerpolation float2 arg1 : ARG1; 6 | bool front_face : SV_ISFRONTFACE; 7 | uint4 arg2 : ARG2; 8 | }; 9 | 10 | struct PsOut 11 | { 12 | float4 color0 : SV_TARGET0; 13 | float2 color1 : SV_TARGET1; 14 | uint4 color2 : SV_TARGET2; 15 | }; 16 | 17 | PsOut main(VsOut data) 18 | { 19 | PsOut result; 20 | result.color0 = float4(data.arg0, data.front_face ? 1.0f : 0.0f); 21 | result.color1 = data.arg1; 22 | result.color2 = data.arg2; 23 | return result; 24 | } 25 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_mismatch_2.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | float2 arg1 : ARG1; 6 | uint4 arg2 : FROG; 7 | }; 8 | 9 | struct PsOut 10 | { 11 | float4 color0 : SV_TARGET0; 12 | float2 color1 : SV_TARGET1; 13 | uint4 color2 : SV_TARGET2; 14 | }; 15 | 16 | PsOut main(VsOut data) 17 | { 18 | PsOut result; 19 | result.color0 = float4(data.arg0, 0.0f); 20 | result.color1 = data.arg1; 21 | result.color2 = data.arg2; 22 | return result; 23 | } 24 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_mismatch_3.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | uint4 arg2 : ARG2; 6 | }; 7 | 8 | struct PsOut 9 | { 10 | float4 color0 : SV_TARGET0; 11 | float2 color1 : SV_TARGET1; 12 | uint4 color2 : SV_TARGET2; 13 | }; 14 | 15 | PsOut main(VsOut data) 16 | { 17 | PsOut result; 18 | result.color0 = float4(data.arg0, 0.0f); 19 | result.color1 = float2(0.0f, 0.0f); 20 | result.color2 = data.arg2; 21 | return result; 22 | } 23 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_mismatch_4.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | float3 arg1 : ARG1; 6 | uint4 arg2 : ARG2; 7 | }; 8 | 9 | struct PsOut 10 | { 11 | float4 color0 : SV_TARGET0; 12 | float2 color1 : SV_TARGET1; 13 | uint4 color2 : SV_TARGET2; 14 | }; 15 | 16 | PsOut main(VsOut data) 17 | { 18 | PsOut result; 19 | result.color0 = float4(data.arg0, 0.0f); 20 | result.color1 = data.arg1.xy; 21 | result.color2 = data.arg2; 22 | return result; 23 | } 24 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_mismatch_5.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float2 arg0 : ARG0; 5 | float arg3 : ARG3; 6 | float2 arg1 : ARG1; 7 | uint4 arg2 : ARG2; 8 | }; 9 | 10 | struct PsOut 11 | { 12 | float4 color0 : SV_TARGET0; 13 | float2 color1 : SV_TARGET1; 14 | uint4 color2 : SV_TARGET2; 15 | }; 16 | 17 | PsOut main(VsOut data) 18 | { 19 | PsOut result; 20 | result.color0 = float4(data.arg0, data.arg3, 0.0f); 21 | result.color1 = data.arg1; 22 | result.color2 = data.arg2; 23 | return result; 24 | } 25 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_mismatch_6.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | float arg1 : ARG1; 6 | uint2 arg2 : ARG2; 7 | }; 8 | 9 | struct PsOut 10 | { 11 | float4 color0 : SV_TARGET0; 12 | float2 color1 : SV_TARGET1; 13 | uint4 color2 : SV_TARGET2; 14 | }; 15 | 16 | PsOut main(VsOut data) 17 | { 18 | PsOut result; 19 | result.color0 = float4(data.arg0, 0.0f); 20 | result.color1 = data.arg1.xx; 21 | result.color2 = data.arg2.xyxy; 22 | return result; 23 | } 24 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_mismatch_7.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | bool front_face : SV_ISFRONTFACE; 6 | }; 7 | 8 | struct PsOut 9 | { 10 | float4 color0 : SV_TARGET0; 11 | float2 color1 : SV_TARGET1; 12 | uint4 color2 : SV_TARGET2; 13 | }; 14 | 15 | PsOut main(VsOut data) 16 | { 17 | PsOut result; 18 | result.color0 = float4(data.arg0, 0.0f); 19 | result.color1 = float2(0.0f, 0.0f); 20 | result.color2 = uint4(uint(data.front_face), 0, 0, 0); 21 | return result; 22 | } 23 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_mismatch_8.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | int2 arg1 : ARG1; 6 | float4 arg2 : ARG2; 7 | }; 8 | 9 | struct PsOut 10 | { 11 | float4 color0 : SV_TARGET0; 12 | float2 color1 : SV_TARGET1; 13 | uint4 color2 : SV_TARGET2; 14 | }; 15 | 16 | PsOut main(VsOut data) 17 | { 18 | PsOut result; 19 | result.color0 = float4(data.arg0, 0.0f); 20 | result.color1 = float2(data.arg1); 21 | result.color2 = uint4(data.arg2); 22 | return result; 23 | } 24 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_mismatch_9.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | nointerpolation float arg1 : ARG1; 6 | uint4 arg2 : ARG2; 7 | }; 8 | 9 | struct PsOut 10 | { 11 | float4 color0 : SV_TARGET0; 12 | float2 color1 : SV_TARGET1; 13 | uint4 color2 : SV_TARGET2; 14 | }; 15 | 16 | PsOut main(VsOut data) 17 | { 18 | PsOut result; 19 | result.color0 = float4(data.arg0, 0.0f); 20 | result.color1 = data.arg1.xx; 21 | result.color2 = data.arg2; 22 | return result; 23 | } 24 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_mismatch_min16float.ps_5_0.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | min16float2 arg1 : ARG1; 6 | uint4 arg2 : ARG2; 7 | }; 8 | 9 | struct PsOut 10 | { 11 | float4 color0 : SV_TARGET0; 12 | float2 color1 : SV_TARGET1; 13 | uint4 color2 : SV_TARGET2; 14 | }; 15 | 16 | PsOut main(VsOut data) 17 | { 18 | PsOut result; 19 | result.color0 = float4(data.arg0, 0.0f); 20 | result.color1 = data.arg1; 21 | result.color2 = data.arg2; 22 | return result; 23 | } 24 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_mismatch_ref.ps_5_0.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | float2 arg1 : ARG1; 6 | uint4 arg2 : ARG2; 7 | }; 8 | 9 | struct PsOut 10 | { 11 | float4 color0 : SV_TARGET0; 12 | float2 color1 : SV_TARGET1; 13 | uint4 color2 : SV_TARGET2; 14 | }; 15 | 16 | PsOut main(VsOut data) 17 | { 18 | PsOut result; 19 | result.color0 = float4(data.arg0, 0.0f); 20 | result.color1 = data.arg1; 21 | result.color2 = data.arg2; 22 | return result; 23 | } 24 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_mismatch_so_1.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float2 arg1 : ARG1; 5 | }; 6 | 7 | struct PsOut 8 | { 9 | float4 color0 : SV_TARGET0; 10 | float2 color1 : SV_TARGET1; 11 | uint4 color2 : SV_TARGET2; 12 | }; 13 | 14 | PsOut main(VsOut data) 15 | { 16 | PsOut result; 17 | result.color0 = float4(0.0f, 0.0f, 0.0f, 0.0f); 18 | result.color1 = data.arg1; 19 | result.color2 = uint4(0, 0, 0, 0); 20 | return result; 21 | } 22 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_mismatch_so_2.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float2 arg1 : ARG1; 5 | float3 arg0 : ARG0; 6 | uint4 arg2 : ARG2; 7 | }; 8 | 9 | struct PsOut 10 | { 11 | float4 color0 : SV_TARGET0; 12 | float2 color1 : SV_TARGET1; 13 | uint4 color2 : SV_TARGET2; 14 | }; 15 | 16 | PsOut main(VsOut data) 17 | { 18 | PsOut result; 19 | result.color0 = float4(data.arg0, 0.0f); 20 | result.color1 = data.arg1; 21 | result.color2 = data.arg2; 22 | return result; 23 | } 24 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_mismatch_sv_1.ps_6_1.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 bary_coord : SV_BARYCENTRICS; 5 | uint sample_index : SV_SAMPLEINDEX; 6 | bool front_face : SV_ISFRONTFACE; 7 | }; 8 | 9 | struct PsOut 10 | { 11 | float4 color0 : SV_TARGET0; 12 | float2 color1 : SV_TARGET1; 13 | uint4 color2 : SV_TARGET2; 14 | }; 15 | 16 | PsOut main(VsOut data) 17 | { 18 | PsOut result; 19 | result.color0 = float4(data.bary_coord, 0.0f); 20 | result.color1 = data.position.xy; 21 | result.color2 = uint4(data.sample_index, uint(data.front_face), 0, 0); 22 | return result; 23 | } 24 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_mismatch_sv_2.ps_6_1.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float3 bary_coord : SV_BARYCENTRICS; 4 | uint sample_index : SV_SAMPLEINDEX; 5 | bool front_face : SV_ISFRONTFACE; 6 | float4 position : SV_POSITION; 7 | }; 8 | 9 | struct PsOut 10 | { 11 | float4 color0 : SV_TARGET0; 12 | float2 color1 : SV_TARGET1; 13 | uint4 color2 : SV_TARGET2; 14 | }; 15 | 16 | PsOut main(VsOut data) 17 | { 18 | PsOut result; 19 | result.color0 = float4(data.bary_coord, 0.0f); 20 | result.color1 = data.position.xy; 21 | result.color2 = uint4(data.sample_index, data.front_face, 0, 0); 22 | return result; 23 | } 24 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_mismatch_sv_3.ps_5_0.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | uint primid : SV_PRIMITIVEID; 6 | }; 7 | 8 | struct PsOut 9 | { 10 | float4 color0 : SV_TARGET0; 11 | float2 color1 : SV_TARGET1; 12 | uint4 color2 : SV_TARGET2; 13 | }; 14 | 15 | PsOut main(VsOut data) 16 | { 17 | PsOut result; 18 | result.color0 = float4(data.arg0, 0.0f); 19 | result.color1 = float2(0.0f, 0.0f); 20 | result.color2 = uint4(data.primid, 0, 0, 0); 21 | return result; 22 | } 23 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_mismatch_sv_4.ps_5_0.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | uint primid : SV_PRIMITIVEID; 4 | }; 5 | 6 | struct PsOut 7 | { 8 | float4 color0 : SV_TARGET0; 9 | float2 color1 : SV_TARGET1; 10 | uint4 color2 : SV_TARGET2; 11 | }; 12 | 13 | PsOut main(VsOut data) 14 | { 15 | PsOut result; 16 | result.color0 = float4(0.0f, 0.0f, 0.0f, 0.0f); 17 | result.color1 = float2(0.0f, 0.0f); 18 | result.color2 = uint4(data.primid, 0, 0, 0); 19 | return result; 20 | } 21 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_mismatch_sv_5.ps_5_0.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | uint primid : SV_PRIMITIVEID; 6 | nointerpolation float2 arg1 : ARG1; 7 | uint4 arg2 : ARG2; 8 | }; 9 | 10 | struct PsOut 11 | { 12 | float4 color0 : SV_TARGET0; 13 | float2 color1 : SV_TARGET1; 14 | uint4 color2 : SV_TARGET2; 15 | }; 16 | 17 | PsOut main(VsOut data) 18 | { 19 | PsOut result; 20 | result.color0 = float4(data.arg0, 0.0f); 21 | result.color1 = data.arg1; 22 | result.color2 = data.arg2 + data.primid; 23 | return result; 24 | } 25 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_mismatch_sv_6.ps_5_0.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsOut 2 | { 3 | float4 position : SV_POSITION; 4 | float3 arg0 : ARG0; 5 | nointerpolation float2 arg1 : ARG1; 6 | uint4 arg2 : ARG2; 7 | uint primid : SV_PRIMITIVEID; 8 | }; 9 | 10 | struct PsOut 11 | { 12 | float4 color0 : SV_TARGET0; 13 | float2 color1 : SV_TARGET1; 14 | uint4 color2 : SV_TARGET2; 15 | }; 16 | 17 | PsOut main(VsOut data) 18 | { 19 | PsOut result; 20 | result.color0 = float4(data.arg0, 0.0f); 21 | result.color1 = data.arg1; 22 | result.color2 = data.arg2 + data.primid; 23 | return result; 24 | } 25 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_null_root_signature.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | #define rs_text "RootConstants(num32BitConstants=4, b0)" 2 | 3 | cbuffer info_t : register(b0) 4 | { 5 | float4 color; 6 | }; 7 | 8 | [RootSignature(rs_text)] 9 | float4 main() : SV_TARGET0 10 | { 11 | return color; 12 | } 13 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_shader_io_1.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | void main(float4 position : SV_POSITION, uint in_uint : UINT, 2 | float3 in_float : FLOAT, out float4 out_float : SV_TARGET0, 3 | out uint4 out_uint : SV_TARGET1) 4 | { 5 | out_float.x = position.w; 6 | out_float.y = in_uint; 7 | out_float.z = in_float.z; 8 | out_float.w = 0; 9 | out_uint.x = 0xdeadbeef; 10 | out_uint.y = 0; 11 | out_uint.z = in_uint; 12 | out_uint.w = in_float.z; 13 | } 14 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_shader_io_2.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | void main(float4 position : Sv_Position, 2 | float2 texcoord0 : TEXCOORD0, float2 texcoord1 : TEXCOORD1, 3 | float4 texcoord2 : TEXCOORD2, float3 texcoord3 : TEXCOORD3, 4 | out float4 target0 : Sv_Target0, out uint4 target1 : SV_Target1) 5 | { 6 | target0.x = texcoord0.x + texcoord0.y; 7 | target0.y = texcoord1.x; 8 | target0.z = texcoord3.z; 9 | target0.w = texcoord1.y; 10 | 11 | target1.x = texcoord2.x; 12 | target1.y = texcoord2.y; 13 | target1.w = texcoord2.w; 14 | target1.z = 0; 15 | } 16 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_shader_io_3.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | void main(float4 position : Sv_Position, 2 | float2 texcoord0 : TEXCOORD0, float2 texcoord1 : TEXCOORD1, 3 | float4 texcoord2 : TEXCOORD2, float3 texcoord3 : TEXCOORD3, 4 | out float4 target0 : Sv_Target0, out uint4 target1 : SV_Target1) 5 | { 6 | target0.x = texcoord0.x; 7 | target0.y = texcoord1.y; 8 | target0.z = texcoord3.z; 9 | target0.w = texcoord3.z; 10 | 11 | target1.x = texcoord2.x; 12 | target1.y = 0; 13 | target1.w = texcoord2.w; 14 | target1.z = 0; 15 | } 16 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_shader_io_4.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | void main(float4 position : Sv_Position, 2 | float2 texcoord0 : TEXCOORD0, float2 texcoord1 : TEXCOORD1, 3 | float4 texcoord2 : TEXCOORD2, float3 texcoord3 : TEXCOORD3, 4 | out float4 target0 : Sv_Target0, out uint4 target1 : SV_Target1) 5 | { 6 | if (all(position.xy < float2(64, 64))) 7 | target0 = float4(0, 1, 0, 1); 8 | else 9 | target0 = float4(0, 0, 0, 0); 10 | 11 | target1.xyzw = 0; 12 | target1.y = position.w; 13 | } 14 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_shader_io_5.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | struct ps_data 2 | { 3 | float4 position : SV_Position; 4 | float4 color : COLOR; 5 | float3 color1 : COLOR1; 6 | float color2 : COLOR2; 7 | }; 8 | 9 | float4 main(ps_data i) : SV_Target 10 | { 11 | return float4(i.color.rgb, i.color2); 12 | } 13 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_triangle_fan.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main() : SV_TARGET 2 | { 3 | return 0.5f.xxxx; 4 | } 5 | -------------------------------------------------------------------------------- /tests/shaders/pso/ps_view_id_passthrough.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VertexData 2 | { 3 | float4 pos : SV_POSITION; 4 | uint rt_data : UV_VIEWID; 5 | }; 6 | 7 | uint main(in VertexData vertex_data) : SV_TARGET0 8 | { 9 | return vertex_data.rt_data; 10 | } 11 | -------------------------------------------------------------------------------- /tests/shaders/pso/vs_append_aligned_element.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | struct vs_in 2 | { 3 | float4 position : POSITION; 4 | float2 color_xy : COLOR0; 5 | float2 color_zw : COLOR1; 6 | unsigned int instance_id : SV_INSTANCEID; 7 | }; 8 | 9 | struct vs_out 10 | { 11 | float4 position : SV_POSITION; 12 | float2 color_xy : COLOR0; 13 | float2 color_zw : COLOR1; 14 | }; 15 | 16 | struct vs_out main(struct vs_in i) 17 | { 18 | struct vs_out o; 19 | 20 | o.position = i.position; 21 | o.position.x += i.instance_id * 0.5; 22 | o.color_xy = i.color_xy; 23 | o.color_zw = i.color_zw; 24 | 25 | return o; 26 | } 27 | -------------------------------------------------------------------------------- /tests/shaders/pso/vs_create_pso.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main(float4 pos : POS) : SV_POSITION 2 | { 3 | return pos; 4 | } 5 | -------------------------------------------------------------------------------- /tests/shaders/pso/vs_dynamic_depth_bias.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | SamplerState s : register(s0); 2 | Texture2D t : register(t0); 3 | 4 | cbuffer params : register(b0) 5 | { 6 | float depth; 7 | float slope; 8 | }; 9 | 10 | float4 main(in uint id : SV_VERTEXID) : SV_POSITION 11 | { 12 | float2 coords = float2((id << 1) & 2, id & 2); 13 | return float4(coords * float2(2, -2) + float2(-1, 1), depth + slope * coords.y, 1); 14 | } 15 | -------------------------------------------------------------------------------- /tests/shaders/pso/vs_index_strip_cut.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer results : register(u0); 2 | 3 | cbuffer push_args 4 | { 5 | uint test_index; 6 | uint strip_cut_value; 7 | }; 8 | 9 | float4 main(in uint id : SV_VERTEXID) : SV_POSITION 10 | { 11 | if (id == strip_cut_value) 12 | results[test_index] = 1u; 13 | 14 | return 0.0f.xxxx; 15 | } 16 | -------------------------------------------------------------------------------- /tests/shaders/pso/vs_interstage.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | struct vertex 2 | { 3 | float4 position : SV_Position; 4 | float2 t0 : TEXCOORD0; 5 | nointerpolation float t1 : TEXCOORD1; 6 | uint t2 : TEXCOORD2; 7 | uint t3 : TEXCOORD3; 8 | float t4 : TEXCOORD4; 9 | }; 10 | 11 | void main(in vertex vin, out vertex vout) 12 | { 13 | vout = vin; 14 | } 15 | -------------------------------------------------------------------------------- /tests/shaders/pso/vs_line_raster.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main(in uint id : SV_VERTEXID) : SV_POSITION 2 | { 3 | float x = float(id) * 2.0f - 1.0f; 4 | return float4(x, x * 0.55f, 0.0f, 1.0f); 5 | } 6 | -------------------------------------------------------------------------------- /tests/shaders/pso/vs_mismatch.vs_5_0.vs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsIn 2 | { 3 | float4 position : POSITION; 4 | }; 5 | 6 | struct VsOut 7 | { 8 | float4 position : SV_POSITION; 9 | float3 arg0 : ARG0; 10 | float2 arg1 : ARG1; 11 | uint4 arg2 : ARG2; 12 | }; 13 | 14 | VsOut main(VsIn data) 15 | { 16 | VsOut result; 17 | result.position = data.position; 18 | result.arg0 = float3(1.0f, 2.0f, 3.0f); 19 | result.arg1 = float2(4.0f, 5.0f); 20 | result.arg2 = uint4(6, 7, 8, 9); 21 | return result; 22 | } 23 | -------------------------------------------------------------------------------- /tests/shaders/pso/vs_mismatch_min16float.vs_5_0.vs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VsIn 2 | { 3 | float4 position : POSITION; 4 | }; 5 | 6 | struct VsOut 7 | { 8 | float4 position : SV_POSITION; 9 | float3 arg0 : ARG0; 10 | min16float2 arg1 : ARG1; 11 | uint4 arg2 : ARG2; 12 | }; 13 | 14 | VsOut main(VsIn data) 15 | { 16 | VsOut result; 17 | result.position = data.position; 18 | result.arg0 = float3(1.0f, 2.0f, 3.0f); 19 | result.arg1 = min16float2(4.0f, 5.0f); 20 | result.arg2 = uint4(6, 7, 8, 9); 21 | return result; 22 | } 23 | -------------------------------------------------------------------------------- /tests/shaders/pso/vs_multiview_export_layer_viewport.vs_6_1.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer globals : register(b0) 2 | { 3 | uint layer; 4 | uint viewport; 5 | }; 6 | 7 | struct VertexData 8 | { 9 | float4 pos : SV_POSITION; 10 | uint rt_data : UV_VIEWID; 11 | uint layer : SV_RENDERTARGETARRAYINDEX; 12 | uint viewport : SV_VIEWPORTARRAYINDEX; 13 | }; 14 | 15 | VertexData main(in uint id : SV_VERTEXID) 16 | { 17 | VertexData result; 18 | /* no view ID here */ 19 | result.rt_data = (layer << 8) | (viewport << 16); 20 | result.layer = layer; 21 | result.viewport = viewport; 22 | 23 | float2 coords = float2(id & 2, (id << 1) & 2); 24 | result.pos = float4(coords * float2(2, 2) + float2(-1, -1), 0, 1); 25 | return result; 26 | } 27 | -------------------------------------------------------------------------------- /tests/shaders/pso/vs_no_ps.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main(float4 a : A) : SV_Position 2 | { 3 | return a; 4 | } 5 | -------------------------------------------------------------------------------- /tests/shaders/pso/vs_null_root_signature.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | #define rs_text "RootConstants(num32BitConstants=4, b0)" 2 | 3 | [RootSignature(rs_text)] 4 | float4 main(uint vid : SV_VERTEXID) : SV_POSITION 5 | { 6 | return float4( 7 | -1.0f + 4.0f * float(vid % 2), 8 | -1.0f + 2.0f * float(vid & 2), 9 | 0.0f, 1.0f); 10 | } 11 | -------------------------------------------------------------------------------- /tests/shaders/pso/vs_primitive_restart.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main(int4 p : POSITION) : SV_Position 2 | { 3 | return p; 4 | } 5 | -------------------------------------------------------------------------------- /tests/shaders/pso/vs_shader_io_1.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | void main(float4 in_position : POSITION, uint4 in_uint : UINT, 2 | out float4 out_position : SV_POSITION, out uint out_uint : UINT, 3 | out float3 out_float : FLOAT) 4 | { 5 | out_position = in_position; 6 | out_uint = in_uint.y; 7 | out_float = float3(1, 2, 3); 8 | } 9 | -------------------------------------------------------------------------------- /tests/shaders/pso/vs_shader_io_2.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | void main(float4 in_position : POSITION, 2 | float4 in_texcoord0 : TEXCOORD0, float4 in_texcoord1 : TEXCOORD1, 3 | float4 in_texcoord2 : TEXCOORD2, 4 | out float4 position : Sv_Position, 5 | out float2 texcoord0 : TEXCOORD0, out float2 texcoord1 : TEXCOORD1, 6 | out float4 texcoord2 : TEXCOORD2, out float3 texcoord3 : TEXCOORD3) 7 | { 8 | position = in_position; 9 | texcoord0 = in_texcoord0.yx; 10 | texcoord1 = in_texcoord0.wz; 11 | texcoord2 = in_texcoord1; 12 | texcoord3 = in_texcoord2.yzx; 13 | } 14 | -------------------------------------------------------------------------------- /tests/shaders/pso/vs_shader_io_5.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | struct ps_data 2 | { 3 | float4 position : SV_Position; 4 | float4 color : COLOR; 5 | float3 color1 : COLOR1; 6 | float color2 : COLOR2; 7 | }; 8 | 9 | ps_data main(float4 position : POSITION) 10 | { 11 | ps_data o; 12 | o.position = position; 13 | o.color = float4(0, 1, 0, 1); 14 | o.color1 = (float3)0.5; 15 | o.color2 = 0.25; 16 | return o; 17 | } 18 | -------------------------------------------------------------------------------- /tests/shaders/pso/vs_triangle_fan.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main(in float2 pos : POSITION) : SV_POSITION 2 | { 3 | return float4(pos, 0.0f, 1.0f); 4 | } 5 | -------------------------------------------------------------------------------- /tests/shaders/pso/vs_view_id_passthrough.vs_6_1.hlsl: -------------------------------------------------------------------------------- 1 | float4 main(in uint id : SV_VERTEXID, in uint in_view_id : SV_VIEWID, 2 | out uint out_view_id : UV_VIEWID) : SV_POSITION 3 | { 4 | out_view_id = in_view_id; 5 | float2 coords = float2(id & 2, (id << 1) & 2); 6 | return float4(coords * float2(2, 2) + float2(-1, -1), 0, 1); 7 | } 8 | -------------------------------------------------------------------------------- /tests/shaders/render_target/ps_color.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 color; 2 | 3 | float4 main(float4 position : SV_POSITION) : SV_Target 4 | { 5 | return color; 6 | } 7 | -------------------------------------------------------------------------------- /tests/shaders/render_target/ps_flat_color.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main() : SV_Target 2 | { 3 | return 1.0.xxxx; 4 | } 5 | -------------------------------------------------------------------------------- /tests/shaders/render_target/ps_multisample_color.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main(uint id : SV_SampleIndex) : SV_Target 2 | { 3 | switch (id) 4 | { 5 | case 0: return float4(1.0f, 0.0f, 0.0f, 1.0f); 6 | case 1: return float4(0.0f, 1.0f, 0.0f, 1.0f); 7 | case 2: return float4(0.0f, 0.0f, 1.0f, 1.0f); 8 | default: return float4(0.0f, 0.0f, 0.0f, 1.0f); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/shaders/render_target/ps_multisample_resolve.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2DMS t; 2 | 3 | uint sample; 4 | uint rt_size; 5 | 6 | float4 main(float4 position : SV_Position) : SV_Target 7 | { 8 | float3 p; 9 | t.GetDimensions(p.x, p.y, p.z); 10 | p *= float3(position.x / rt_size, position.y / rt_size, 0); 11 | return t.Load((int2)p.xy, sample); 12 | } 13 | -------------------------------------------------------------------------------- /tests/shaders/render_target/ps_no_attachments.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VOut 2 | { 3 | float4 pos : SV_Position; 4 | uint layer : SV_RenderTargetArrayIndex; 5 | }; 6 | 7 | 8 | RWStructuredBuffer RWBuf : register(u0); 9 | void main(VOut pin) 10 | { 11 | int2 coord = int2(pin.pos.xy) - int2(10000, 12000); 12 | int write_coord = 16 * pin.layer + coord.y * 4 + coord.x; 13 | float4 write_value = float4(pin.pos.xy, pin.layer, 0.0); 14 | RWBuf[write_coord] = write_value; 15 | } 16 | -------------------------------------------------------------------------------- /tests/shaders/render_target/ps_render_a8.ps_5_0.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | void main(out float4 target : SV_Target) 2 | { 3 | target = float4(0.0f, 0.25f, 0.5f, 1.0f); 4 | } 5 | -------------------------------------------------------------------------------- /tests/shaders/render_target/ps_renderpass.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer color_t : register(b0) 2 | { 3 | float depth; 4 | uint3 colors; 5 | uint sample_mask; 6 | } 7 | 8 | struct out_t 9 | { 10 | float d : SV_Depth; 11 | float4 a : SV_Target0; 12 | float4 b : SV_Target1; 13 | float4 c : SV_Target2; 14 | uint sm : SV_Coverage; 15 | }; 16 | 17 | float4 unpack_unorm(uint un) 18 | { 19 | return float4((un >> 0) & 0xff, (un >> 8) & 0xff, 20 | (un >> 16) & 0xff, (un >> 24) & 0xff) / 255.0f; 21 | } 22 | 23 | out_t main() 24 | { 25 | out_t result; 26 | result.d = depth; 27 | result.a = unpack_unorm(colors.x); 28 | result.b = unpack_unorm(colors.y); 29 | result.c = unpack_unorm(colors.z); 30 | result.sm = sample_mask; 31 | return result; 32 | } 33 | -------------------------------------------------------------------------------- /tests/shaders/render_target/ps_rt_mismatch.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | void main(out float4 a : SV_TARGET0, out float4 b : SV_TARGET1) 2 | { 3 | a = b = float4(0.0f, 1.0f, 0.0f, 1.0f); 4 | } 5 | -------------------------------------------------------------------------------- /tests/shaders/render_target/ps_unbound_rtv.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | struct Outputs 2 | { 3 | float4 col0 : SV_TARGET0; 4 | float col1 : SV_TARGET1; 5 | }; 6 | 7 | Outputs main() 8 | { 9 | Outputs o; 10 | o.col0 = float4(1.0, 0.0, 0.0, 1.0); 11 | o.col1 = 0.5; 12 | return o; 13 | } 14 | -------------------------------------------------------------------------------- /tests/shaders/render_target/ps_unknown_rtv.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | void main(out float4 target1 : SV_Target1, out float4 target2 : SV_Target2) 2 | { 3 | target1 = float4(2.0f, 0.0f, 0.0f, 1.0f); 4 | target2 = float4(3.0f, 0.0f, 0.0f, 1.0f); 5 | } 6 | -------------------------------------------------------------------------------- /tests/shaders/render_target/vs_flat_color.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main(uint vid : SV_VertexID) : SV_Position 2 | { 3 | float4 pos; 4 | pos.x = float(vid & 1) * 4.0 - 1.0; 5 | pos.y = float(vid & 2) * 2.0 - 1.0; 6 | pos.z = 0.0; 7 | pos.w = 1.0; 8 | return pos; 9 | } 10 | -------------------------------------------------------------------------------- /tests/shaders/render_target/vs_no_attachments.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VOut 2 | { 3 | float4 pos : SV_Position; 4 | uint layer : SV_RenderTargetArrayIndex; 5 | }; 6 | 7 | VOut main(uint vid : SV_VertexID, uint iid : SV_InstanceID) 8 | { 9 | VOut v; 10 | if (vid == 0) 11 | v.pos = float4(-1, -1, 0, 1); 12 | else if (vid == 1) 13 | v.pos = float4(-1, +3, 0, 1); 14 | else 15 | v.pos = float4(+3, -1, 0, 1); 16 | v.layer = iid; 17 | return v; 18 | } 19 | -------------------------------------------------------------------------------- /tests/shaders/resource/cs_clear_buffer.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer Buf : register(u0); 2 | cbuffer CBuf : register(b0) { uint clear_value; }; 3 | 4 | [numthreads(64, 1, 1)] 5 | void main(uint thr : SV_DispatchThreadID) 6 | { 7 | Buf[thr] = clear_value; 8 | } 9 | -------------------------------------------------------------------------------- /tests/shaders/resource/cs_copy_simple.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D tex : register(t0); 2 | RWTexture2D uav : register(u0); 3 | 4 | [numthreads(4,4,1)] 5 | void main(uint3 tid : SV_DISPATCHTHREADID) 6 | { 7 | uav[tid.xy] = tex.Load(int3(tid.xy, 0)); 8 | } 9 | -------------------------------------------------------------------------------- /tests/shaders/resource/cs_large_tbo_load.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | struct Feedback 2 | { 3 | uint size; 4 | uint data; 5 | }; 6 | 7 | Buffer srv : register(t0); 8 | 9 | RWStructuredBuffer feedback : register(u1); 10 | 11 | cbuffer Args : register(b0) 12 | { 13 | uint offset; 14 | uint data; 15 | uint feedback_offset; 16 | }; 17 | 18 | [numthreads(1,1,1)] 19 | void main() 20 | { 21 | Feedback fb; 22 | srv.GetDimensions(fb.size); 23 | fb.data = srv[offset].x; 24 | 25 | feedback[feedback_offset] = fb; 26 | } 27 | -------------------------------------------------------------------------------- /tests/shaders/resource/cs_large_tbo_store.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | struct Feedback 2 | { 3 | uint size; 4 | uint data; 5 | }; 6 | 7 | RWBuffer uav : register(u0); 8 | 9 | RWStructuredBuffer feedback : register(u1); 10 | 11 | cbuffer Args : register(b0) 12 | { 13 | uint offset; 14 | uint data; 15 | uint feedback_offset; 16 | }; 17 | 18 | [numthreads(1,1,1)] 19 | void main() 20 | { 21 | Feedback fb; 22 | uav.GetDimensions(fb.size); 23 | fb.data = uav[offset].x; 24 | 25 | uav[offset] = data + 1; 26 | 27 | feedback[feedback_offset] = fb; 28 | } 29 | -------------------------------------------------------------------------------- /tests/shaders/resource/headers/ps_store_buffer.h: -------------------------------------------------------------------------------- 1 | static const DWORD ps_store_buffer_code_dxbc[] = 2 | { 3 | 0x43425844, 0x0dcbdd90, 0x7dad2857, 0x4ee149ee, 0x72a13d21, 0x00000001, 0x000000a4, 0x00000003, 4 | 0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, 5 | 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x00000050, 0x00000050, 0x00000014, 0x0100086a, 6 | 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x0300009d, 0x0011e000, 0x00000000, 0x090000a6, 7 | 0x0011e012, 0x00000000, 0x0020800a, 0x00000000, 0x00000000, 0x0020801a, 0x00000000, 0x00000000, 8 | 0x0100003e, 9 | }; 10 | #ifdef __GNUC__ 11 | #define UNUSED_ARRAY_ATTR __attribute__((unused)) 12 | #else 13 | #define UNUSED_ARRAY_ATTR 14 | #endif 15 | UNUSED_ARRAY_ATTR static const D3D12_SHADER_BYTECODE ps_store_buffer_dxbc = { ps_store_buffer_code_dxbc, sizeof(ps_store_buffer_code_dxbc) }; 16 | #undef UNUSED_ARRAY_ATTR 17 | -------------------------------------------------------------------------------- /tests/shaders/resource/ps_copy_simple.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D tex : register(t0); 2 | 3 | float4 main(float4 pos : SV_POSITION) : SV_TARGET 4 | { 5 | return tex.Load(int3(pos.xy, 0)); 6 | } 7 | -------------------------------------------------------------------------------- /tests/shaders/resource/ps_store_buffer.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | uint offset; 2 | uint value; 3 | 4 | RWByteAddressBuffer u; 5 | 6 | void main() 7 | { 8 | u.Store(offset, value); 9 | } 10 | -------------------------------------------------------------------------------- /tests/shaders/rt/default_assignment_bindings_rt.lib_6_3.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer U0 : register(u0); 2 | RWStructuredBuffer U1 : register(u1); 3 | RWStructuredBuffer U2 : register(u2); 4 | RWStructuredBuffer U3 : register(u3); 5 | 6 | [shader("raygeneration")] 7 | void Entry1() 8 | { 9 | U0[0] = 0; 10 | U3[0] = 0; 11 | } 12 | 13 | [shader("raygeneration")] 14 | void Entry2() 15 | { 16 | U1[0] = 0; 17 | U3[0] = 0; 18 | } 19 | 20 | [shader("raygeneration")] 21 | void Entry3() 22 | { 23 | U2[0] = 0; 24 | U1[0] = 0; 25 | } 26 | 27 | [shader("raygeneration")] 28 | void Entry4() 29 | { 30 | U3[0] = 0; 31 | U1[0] = 0; 32 | } -------------------------------------------------------------------------------- /tests/shaders/rt/dummy_raygen.lib_6_3.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer RW : register(u0); 2 | 3 | [shader("raygeneration")] 4 | void main() 5 | { 6 | RW[0] = 0; 7 | } -------------------------------------------------------------------------------- /tests/shaders/rt/embedded_root_signature_subobject_rt.lib_6_3.hlsl: -------------------------------------------------------------------------------- 1 | GlobalRootSignature grs = { "UAV(u0)" }; 2 | 3 | RWBuffer U : register(u0); 4 | 5 | [shader("raygeneration")] 6 | void main() 7 | { 8 | U[0] = float4(1, 2, 3, 4); 9 | } -------------------------------------------------------------------------------- /tests/shaders/rt/embedded_root_signature_subobject_rt_conflict.lib_6_3.hlsl: -------------------------------------------------------------------------------- 1 | GlobalRootSignature grs = { "UAV(u0)" }; 2 | GlobalRootSignature grs2 = { "UAV(u1)" }; 3 | 4 | RWBuffer U : register(u0); 5 | 6 | [shader("raygeneration")] 7 | void main() 8 | { 9 | U[0] = float4(1, 2, 3, 4); 10 | } -------------------------------------------------------------------------------- /tests/shaders/rt/embedded_root_signature_subobject_rt_conflict_mixed.lib_6_3.hlsl: -------------------------------------------------------------------------------- 1 | GlobalRootSignature grs = { "UAV(u1)" }; 2 | 3 | RWBuffer U : register(u0); 4 | 5 | [RootSignature("UAV(u0)")] 6 | [shader("compute")] 7 | [numthreads(1, 1, 1)] 8 | void main() 9 | { 10 | U[0] = float4(1, 2, 3, 4); 11 | } -------------------------------------------------------------------------------- /tests/shaders/rt/embedded_subobject_dupe.lib_6_3.hlsl: -------------------------------------------------------------------------------- 1 | RaytracingShaderConfig config = { 4, 8 }; 2 | RaytracingPipelineConfig pconfig = { 1 }; 3 | RaytracingShaderConfig config1 = { 8, 12 }; 4 | RaytracingPipelineConfig pconfig1 = { 2 }; 5 | 6 | [shader("raygeneration")] 7 | void RayGen() 8 | { 9 | } -------------------------------------------------------------------------------- /tests/shaders/rt/multi_rs.lib_6_3.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer U : register(u0); 2 | SamplerState S : register(s0); 3 | Texture2D T : register(t0); 4 | 5 | void run(uint v) 6 | { 7 | uint o; 8 | InterlockedAdd(U[0], v * uint(255.0 * T.SampleLevel(S, 1.25.xx, 0.0) + 0.5), o); 9 | } 10 | 11 | [shader("raygeneration")] 12 | void RayGen() 13 | { 14 | run(1); 15 | } 16 | 17 | [shader("raygeneration")] 18 | void RayGenCol() 19 | { 20 | run(10); 21 | } -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_cbv_layout_legacy_uint16.cs_6_2.enable-16bit-types.hlsl: -------------------------------------------------------------------------------- 1 | struct Vec8 { uint16_t4 lo; uint16_t4 hi; }; 2 | 3 | cbuffer Cbuf : register(b0) 4 | { 5 | Vec8 values_root[8]; 6 | }; 7 | 8 | cbuffer Cbuf : register(b0, space1) 9 | { 10 | Vec8 values_table[8]; 11 | }; 12 | 13 | RWStructuredBuffer RWBuf : register(u0); 14 | 15 | uint pack4(uint4 v) 16 | { 17 | return v.x | (v.y << 8) | (v.z << 16) | (v.w << 24); 18 | } 19 | 20 | [numthreads(8, 1, 1)] 21 | void main(uint thr : SV_DispatchThreadID) 22 | { 23 | Vec8 v_root = values_root[thr]; 24 | Vec8 v_table = values_table[thr]; 25 | uint4 lo = uint4(v_root.lo) + uint4(v_root.hi); 26 | uint4 hi = uint4(v_table.lo) + uint4(v_table.hi); 27 | RWBuf[2 * thr + 0] = pack4(lo); 28 | RWBuf[2 * thr + 1] = pack4(hi); 29 | } 30 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_cbv_layout_legacy_uint64.cs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer Cbuf : register(b0) 2 | { 3 | uint64_t4 values_root[8]; 4 | }; 5 | 6 | cbuffer Cbuf : register(b0, space1) 7 | { 8 | uint64_t4 values_table[8]; 9 | }; 10 | 11 | RWStructuredBuffer RWBuf : register(u0); 12 | 13 | uint pack4(uint4 v) 14 | { 15 | return v.x | (v.y << 8) | (v.z << 16) | (v.w << 24); 16 | } 17 | 18 | [numthreads(8, 1, 1)] 19 | void main(uint thr : SV_DispatchThreadID) 20 | { 21 | uint64_t4 v = values_root[thr] + values_table[thr]; 22 | uint4 lo = uint4(v); 23 | uint4 hi = uint4(v >> 32); 24 | RWBuf[2 * thr + 0] = pack4(lo); 25 | RWBuf[2 * thr + 1] = pack4(hi); 26 | } 27 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_cbv_layout_modern_uint16.cs_6_2.enable-16bit-types.no-legacy-cbuf-layout.hlsl: -------------------------------------------------------------------------------- 1 | struct Vec8 { uint16_t4 lo; uint16_t4 hi; }; 2 | 3 | cbuffer Cbuf : register(b0) 4 | { 5 | Vec8 values_root[8]; 6 | }; 7 | 8 | cbuffer Cbuf : register(b0, space1) 9 | { 10 | Vec8 values_table[8]; 11 | }; 12 | 13 | RWStructuredBuffer RWBuf : register(u0); 14 | 15 | uint pack4(uint4 v) 16 | { 17 | return v.x | (v.y << 8) | (v.z << 16) | (v.w << 24); 18 | } 19 | 20 | [numthreads(8, 1, 1)] 21 | void main(uint thr : SV_DispatchThreadID) 22 | { 23 | Vec8 v_root = values_root[thr]; 24 | Vec8 v_table = values_table[thr]; 25 | uint4 lo = uint4(v_root.lo) + uint4(v_root.hi); 26 | uint4 hi = uint4(v_table.lo) + uint4(v_table.hi); 27 | RWBuf[2 * thr + 0] = pack4(lo); 28 | RWBuf[2 * thr + 1] = pack4(hi); 29 | } 30 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_cbv_layout_modern_uint32.cs_6_0.no-legacy-cbuf-layout.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer Cbuf : register(b0) 2 | { 3 | uint4 values_root[8]; 4 | }; 5 | 6 | cbuffer Cbuf : register(b0, space1) 7 | { 8 | uint4 values_table[8]; 9 | }; 10 | 11 | RWStructuredBuffer RWBuf : register(u0); 12 | 13 | uint pack4(uint4 v) 14 | { 15 | return v.x | (v.y << 8) | (v.z << 16) | (v.w << 24); 16 | } 17 | 18 | [numthreads(8, 1, 1)] 19 | void main(uint thr : SV_DispatchThreadID) 20 | { 21 | uint4 lo = values_root[thr]; 22 | uint4 hi = values_table[thr]; 23 | RWBuf[2 * thr + 0] = pack4(lo); 24 | RWBuf[2 * thr + 1] = pack4(hi); 25 | } 26 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_cbv_layout_modern_uint64.cs_6_0.no-legacy-cbuf-layout.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer Cbuf : register(b0) 2 | { 3 | uint64_t4 values_root[8]; 4 | }; 5 | 6 | cbuffer Cbuf : register(b0, space1) 7 | { 8 | uint64_t4 values_table[8]; 9 | }; 10 | 11 | RWStructuredBuffer RWBuf : register(u0); 12 | 13 | uint pack4(uint4 v) 14 | { 15 | return v.x | (v.y << 8) | (v.z << 16) | (v.w << 24); 16 | } 17 | 18 | [numthreads(8, 1, 1)] 19 | void main(uint thr : SV_DispatchThreadID) 20 | { 21 | uint64_t4 v = values_root[thr] + values_table[thr]; 22 | uint4 lo = uint4(v); 23 | uint4 hi = uint4(v >> 32); 24 | RWBuf[2 * thr + 0] = pack4(lo); 25 | RWBuf[2 * thr + 1] = pack4(hi); 26 | } 27 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_denorm_fp16_fp32_any.cs_6_2.denorm any.enable-16bit-types.hlsl: -------------------------------------------------------------------------------- 1 | RWByteAddressBuffer RWBuf : register(u0); 2 | ByteAddressBuffer ROBuf : register(t0); 3 | 4 | [numthreads(1, 1, 1)] 5 | void main() 6 | { 7 | { 8 | float2 v = ROBuf.Load(16); 9 | precise float v2 = v.x + v.y; 10 | RWBuf.Store(8, v2); 11 | } 12 | 13 | { 14 | half4 v = ROBuf.Load(24); 15 | precise half2 v2 = v.xy + v.zw; 16 | RWBuf.Store(16, v2); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_denorm_fp16_fp32_ftz.cs_6_2.denorm ftz.enable-16bit-types.hlsl: -------------------------------------------------------------------------------- 1 | RWByteAddressBuffer RWBuf : register(u0); 2 | ByteAddressBuffer ROBuf : register(t0); 3 | 4 | [numthreads(1, 1, 1)] 5 | void main() 6 | { 7 | { 8 | float2 v = ROBuf.Load(16); 9 | precise float v2 = v.x + v.y; 10 | RWBuf.Store(8, v2); 11 | } 12 | 13 | { 14 | half4 v = ROBuf.Load(24); 15 | precise half2 v2 = v.xy + v.zw; 16 | RWBuf.Store(16, v2); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_denorm_fp16_fp32_preserve.cs_6_2.denorm preserve.enable-16bit-types.hlsl: -------------------------------------------------------------------------------- 1 | RWByteAddressBuffer RWBuf : register(u0); 2 | ByteAddressBuffer ROBuf : register(t0); 3 | 4 | [numthreads(1, 1, 1)] 5 | void main() 6 | { 7 | { 8 | float2 v = ROBuf.Load(16); 9 | precise float v2 = v.x + v.y; 10 | RWBuf.Store(8, v2); 11 | } 12 | 13 | { 14 | half4 v = ROBuf.Load(24); 15 | precise half2 v2 = v.xy + v.zw; 16 | RWBuf.Store(16, v2); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_denorm_fp16_fp64_fp32_any.cs_6_2.denorm any.enable-16bit-types.hlsl: -------------------------------------------------------------------------------- 1 | RWByteAddressBuffer RWBuf : register(u0); 2 | ByteAddressBuffer ROBuf : register(t0); 3 | 4 | [numthreads(1, 1, 1)] 5 | void main() 6 | { 7 | { 8 | double2 v = ROBuf.Load(0); 9 | precise double v2 = v.x + v.y; 10 | RWBuf.Store(0, v2); 11 | } 12 | 13 | { 14 | float2 v = ROBuf.Load(16); 15 | precise float v2 = v.x + v.y; 16 | RWBuf.Store(8, v2); 17 | } 18 | 19 | { 20 | half4 v = ROBuf.Load(24); 21 | precise half2 v2 = v.xy + v.zw; 22 | RWBuf.Store(16, v2); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_denorm_fp16_fp64_fp32_ftz.cs_6_2.denorm ftz.enable-16bit-types.hlsl: -------------------------------------------------------------------------------- 1 | RWByteAddressBuffer RWBuf : register(u0); 2 | ByteAddressBuffer ROBuf : register(t0); 3 | 4 | [numthreads(1, 1, 1)] 5 | void main() 6 | { 7 | { 8 | double2 v = ROBuf.Load(0); 9 | precise double v2 = v.x + v.y; 10 | RWBuf.Store(0, v2); 11 | } 12 | 13 | { 14 | float2 v = ROBuf.Load(16); 15 | precise float v2 = v.x + v.y; 16 | RWBuf.Store(8, v2); 17 | } 18 | 19 | { 20 | half4 v = ROBuf.Load(24); 21 | precise half2 v2 = v.xy + v.zw; 22 | RWBuf.Store(16, v2); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_denorm_fp16_fp64_fp32_preserve.cs_6_2.denorm preserve.enable-16bit-types.hlsl: -------------------------------------------------------------------------------- 1 | RWByteAddressBuffer RWBuf : register(u0); 2 | ByteAddressBuffer ROBuf : register(t0); 3 | 4 | [numthreads(1, 1, 1)] 5 | void main() 6 | { 7 | { 8 | double2 v = ROBuf.Load(0); 9 | precise double v2 = v.x + v.y; 10 | RWBuf.Store(0, v2); 11 | } 12 | 13 | { 14 | float2 v = ROBuf.Load(16); 15 | precise float v2 = v.x + v.y; 16 | RWBuf.Store(8, v2); 17 | } 18 | 19 | { 20 | half4 v = ROBuf.Load(24); 21 | precise half2 v2 = v.xy + v.zw; 22 | RWBuf.Store(16, v2); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_denorm_fp64_fp32_any.cs_6_2.denorm any.hlsl: -------------------------------------------------------------------------------- 1 | // -enable-16bit-types and -denorm ftz/preserve/any 2 | RWByteAddressBuffer RWBuf : register(u0); 3 | ByteAddressBuffer ROBuf : register(t0); 4 | 5 | [numthreads(1, 1, 1)] 6 | void main() 7 | { 8 | { 9 | double2 v = ROBuf.Load(0); 10 | precise double v2 = v.x + v.y; 11 | RWBuf.Store(0, v2); 12 | } 13 | 14 | { 15 | float2 v = ROBuf.Load(16); 16 | precise float v2 = v.x + v.y; 17 | RWBuf.Store(8, v2); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_denorm_fp64_fp32_any_dxbc.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | RWByteAddressBuffer RWBuf : register(u0); 2 | ByteAddressBuffer ROBuf : register(t0); 3 | 4 | [numthreads(1, 1, 1)] 5 | void main() 6 | { 7 | { 8 | uint4 loaded_v = ROBuf.Load4(0); 9 | double2 v = double2(asdouble(loaded_v.x, loaded_v.y), asdouble(loaded_v.z, loaded_v.w)); 10 | precise double v2 = v.x + v.y; 11 | asuint(v2, loaded_v.x, loaded_v.y); 12 | RWBuf.Store2(0, loaded_v.xy); 13 | } 14 | 15 | { 16 | float2 v = ROBuf.Load2(16); 17 | precise float v2 = v.x + v.y; 18 | RWBuf.Store(8, v2); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_denorm_fp64_fp32_ftz.cs_6_2.denorm ftz.hlsl: -------------------------------------------------------------------------------- 1 | RWByteAddressBuffer RWBuf : register(u0); 2 | ByteAddressBuffer ROBuf : register(t0); 3 | 4 | [numthreads(1, 1, 1)] 5 | void main() 6 | { 7 | { 8 | double2 v = ROBuf.Load(0); 9 | precise double v2 = v.x + v.y; 10 | RWBuf.Store(0, v2); 11 | } 12 | 13 | { 14 | float2 v = ROBuf.Load(16); 15 | precise float v2 = v.x + v.y; 16 | RWBuf.Store(8, v2); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_denorm_fp64_fp32_preserve.cs_6_2.denorm preserve.hlsl: -------------------------------------------------------------------------------- 1 | RWByteAddressBuffer RWBuf : register(u0); 2 | ByteAddressBuffer ROBuf : register(t0); 3 | 4 | [numthreads(1, 1, 1)] 5 | void main() 6 | { 7 | { 8 | double2 v = ROBuf.Load(0); 9 | precise double v2 = v.x + v.y; 10 | RWBuf.Store(0, v2); 11 | } 12 | 13 | { 14 | float2 v = ROBuf.Load(16); 15 | precise float v2 = v.x + v.y; 16 | RWBuf.Store(8, v2); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_denorm_ftz.cs_6_2.denorm ftz.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer RW : register(u0); 2 | StructuredBuffer RO : register(t0); 3 | 4 | [numthreads(1, 1, 1)] 5 | void main(uint3 id : SV_DispatchThreadID) 6 | { 7 | float v = RO[id.x]; 8 | v += v; 9 | RW[id.x] = v; 10 | } 11 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_denorm_preserve.cs_6_2.denorm preserve.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer RW : register(u0); 2 | StructuredBuffer RO : register(t0); 3 | 4 | [numthreads(1, 1, 1)] 5 | void main(uint3 id : SV_DispatchThreadID) 6 | { 7 | float v = RO[id.x]; 8 | v += v; 9 | RW[id.x] = v; 10 | } 11 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_derivative_1d.cs_6_6.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D Tex : register(t0); 2 | RWTexture2D SOut : register(u0); 3 | SamplerState Samp : register(s0); 4 | 5 | [numthreads(64, 1, 1)] 6 | void main(uint thr : SV_DispatchThreadID) 7 | { 8 | uint2 coord = uint2( 9 | (thr & 13u) | ((thr >> 3u) & 2u), 10 | ((thr >> 5u) << 1u) | ((thr >> 1u) & 1u)); 11 | float2 uv = float2(coord) / 32.0; 12 | float v = round(Tex.Sample(Samp, uv) * 255.0); 13 | float dx = ddx_fine(uv.x); 14 | float dy = ddy_fine(uv.y); 15 | float w = Tex.CalculateLevelOfDetailUnclamped(Samp, uv); 16 | SOut[coord] = float4(v, dx, dy, w); 17 | } 18 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_derivative_2d_aligned.cs_6_6.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D Tex : register(t0); 2 | RWTexture2D SOut : register(u0); 3 | SamplerState Samp : register(s0); 4 | 5 | [numthreads(8, 8, 1)] 6 | void main(uint2 thr : SV_DispatchThreadID) 7 | { 8 | float2 uv = float2(thr) / 32.0; // We should sample LOD 2 here. 9 | float v = round(Tex.Sample(Samp, uv) * 255.0); 10 | float dx = ddx_fine(uv.x); 11 | float dy = ddy_fine(uv.y); 12 | float w = Tex.CalculateLevelOfDetailUnclamped(Samp, uv); 13 | SOut[thr] = float4(v, dx, dy, w); 14 | } 15 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_dynamic_texture_offset.cs_6_7.hlsl: -------------------------------------------------------------------------------- 1 | struct TestInput 2 | { 3 | float2 uv; float mip; int2 offsets; 4 | }; 5 | 6 | Texture2D D : register(t0); 7 | SamplerState S : register(s0); 8 | StructuredBuffer T : register(t0, space1); 9 | RWStructuredBuffer Output : register(u0, space1); 10 | 11 | [numthreads(1, 1, 1)] 12 | void main(uint id : SV_DispatchThreadID) 13 | { 14 | TestInput input = T[id]; 15 | float result = D.SampleLevel(S, input.uv, input.mip, input.offsets); 16 | Output[id] = result; 17 | } 18 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_pack_s16_s8_clamp.cs_6_6.enable-16bit-types.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer RO : register(t0); 2 | RWStructuredBuffer RW : register(u0); 3 | 4 | [numthreads(1, 1, 1)] 5 | void main(uint thr : SV_DispatchThreadID) 6 | { 7 | RW[thr] = pack_clamp_s8(RO[thr]); 8 | } 9 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_pack_s16_u8_clamp.cs_6_6.enable-16bit-types.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer RO : register(t0); 2 | RWStructuredBuffer RW : register(u0); 3 | 4 | [numthreads(1, 1, 1)] 5 | void main(uint thr : SV_DispatchThreadID) 6 | { 7 | RW[thr] = pack_clamp_u8(RO[thr]); 8 | } 9 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_pack_s32_s8_clamp.cs_6_6.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer RO : register(t0); 2 | RWStructuredBuffer RW : register(u0); 3 | 4 | [numthreads(1, 1, 1)] 5 | void main(uint thr : SV_DispatchThreadID) 6 | { 7 | RW[thr] = pack_clamp_s8(RO[thr]); 8 | } 9 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_pack_s32_u8_clamp.cs_6_6.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer RO : register(t0); 2 | RWStructuredBuffer RW : register(u0); 3 | 4 | [numthreads(1, 1, 1)] 5 | void main(uint thr : SV_DispatchThreadID) 6 | { 7 | RW[thr] = pack_clamp_u8(RO[thr]); 8 | } 9 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_pack_u16_u8.cs_6_6.enable-16bit-types.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer RO : register(t0); 2 | RWStructuredBuffer RW : register(u0); 3 | 4 | [numthreads(1, 1, 1)] 5 | void main(uint thr : SV_DispatchThreadID) 6 | { 7 | RW[thr] = pack_u8(RO[thr]); 8 | } 9 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_pack_u32_u8.cs_6_6.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer RO : register(t0); 2 | RWStructuredBuffer RW : register(u0); 3 | 4 | [numthreads(1, 1, 1)] 5 | void main(uint thr : SV_DispatchThreadID) 6 | { 7 | RW[thr] = pack_u8(RO[thr]); 8 | } -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_packed_i8dot.cs_6_4.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer RW : register(u0); 2 | 3 | struct Inputs { uint a, b, acc; }; 4 | StructuredBuffer RO : register(t0); 5 | 6 | [numthreads(1, 1, 1)] 7 | void main(uint3 id : SV_DispatchThreadID) 8 | { 9 | Inputs v = RO[id.x]; 10 | uint acc = dot4add_i8packed(v.a, v.b, v.acc); 11 | RW[id.x] = acc; 12 | } 13 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_packed_u8dot.cs_6_4.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer RW : register(u0); 2 | 3 | struct Inputs { uint a, b, acc; }; 4 | StructuredBuffer RO : register(t0); 5 | 6 | [numthreads(1, 1, 1)] 7 | void main(uint3 id : SV_DispatchThreadID) 8 | { 9 | Inputs v = RO[id.x]; 10 | uint acc = dot4add_u8packed(v.a, v.b, v.acc); 11 | RW[id.x] = acc; 12 | } 13 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_quad_swap_2d_sm60.cs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D Tex : register(t0); 2 | RWTexture2D SOut : register(u0); 3 | 4 | [numthreads(8, 8, 1)] 5 | void main(uint2 thr : SV_DispatchThreadID) 6 | { 7 | float v = Tex.Load(uint3(thr, 0)); 8 | float horiz = QuadReadAcrossX(v); 9 | float vert = QuadReadAcrossY(v); 10 | float diag = QuadReadAcrossDiagonal(v); 11 | SOut[thr] = float4(v, horiz, vert, diag); 12 | } -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_quad_swap_2d_sm66.cs_6_6.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D Tex : register(t0); 2 | RWTexture2D SOut : register(u0); 3 | 4 | [numthreads(8, 8, 1)] 5 | void main(uint2 thr : SV_DispatchThreadID) 6 | { 7 | float v = Tex.Load(uint3(thr, 0)); 8 | float horiz = QuadReadAcrossX(v); 9 | float vert = QuadReadAcrossY(v); 10 | float diag = QuadReadAcrossDiagonal(v); 11 | SOut[thr] = float4(v, horiz, vert, diag); 12 | } 13 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_quad_swap_2d_unaligned.cs_6_6.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D Tex : register(t0); 2 | RWTexture2D SOut : register(u0); 3 | 4 | [numthreads(8, 9, 1)] 5 | void main(uint2 thr : SV_DispatchThreadID) 6 | { 7 | float v = Tex.Load(uint3(thr, 0)); 8 | float horiz = QuadReadAcrossX(v); 9 | float vert = QuadReadAcrossY(v); 10 | float diag = QuadReadAcrossDiagonal(v); 11 | SOut[thr] = float4(v, horiz, vert, diag); 12 | } 13 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_quad_vote.cs_6_7.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer A; 2 | RWStructuredBuffer B; 3 | 4 | [numthreads(4, 1, 1)] 5 | void main(uint id : SV_DispatchThreadID) 6 | { 7 | uint v = A[id]; 8 | bool effect = bool(v & 2); 9 | uint4 R; 10 | R.x = QuadAny(effect); 11 | R.y = QuadAll(effect); 12 | 13 | [branch] 14 | if (v & 1) 15 | { 16 | R.z = QuadAny(effect); 17 | R.w = QuadAll(effect); 18 | } 19 | else 20 | { 21 | R.z = ~0u; 22 | R.w = ~0u; 23 | } 24 | 25 | B[id] = R; 26 | } 27 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_raw_gather_16.cs_6_7.enable-16bit-types.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D D16 : register(t0); 2 | SamplerState S : register(s0); 3 | RWByteAddressBuffer U : register(u0); 4 | 5 | [numthreads(1, 1, 1)] 6 | void main(uint id : SV_DispatchThreadID) 7 | { 8 | U.Store(0, D16.GatherRaw(S, 0.5.xx)); 9 | U.Store(8, D16.GatherRed(S, 0.5.xx)); 10 | U.Store(16, D16.GatherGreen(S, 0.5.xx)); 11 | U.Store(24, D16.GatherBlue(S, 0.5.xx)); 12 | U.Store(32, D16.GatherAlpha(S, 0.5.xx)); 13 | } 14 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_raw_gather_32.cs_6_7.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D D32 : register(t0); 2 | SamplerState S : register(s0); 3 | RWByteAddressBuffer U : register(u0); 4 | 5 | [numthreads(1, 1, 1)] 6 | void main(uint id : SV_DispatchThreadID) 7 | { 8 | U.Store(0, D32.GatherRaw(S, 0.5.xx)); 9 | U.Store(16, D32.GatherRed(S, 0.5.xx)); 10 | U.Store(32, D32.GatherGreen(S, 0.5.xx)); 11 | U.Store(48, D32.GatherBlue(S, 0.5.xx)); 12 | U.Store(64, D32.GatherAlpha(S, 0.5.xx)); 13 | } 14 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_raw_gather_64.cs_6_7.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D D64 : register(t0); 2 | SamplerState S : register(s0); 3 | RWByteAddressBuffer U : register(u0); 4 | 5 | [numthreads(1, 1, 1)] 6 | void main(uint id : SV_DispatchThreadID) 7 | { 8 | U.Store(0, D64.GatherRaw(S, 0.5.xx)); 9 | // GatherRed and friends are not legal on 64-bit. 10 | } 11 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_sample_cmp_level.cs_6_7.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D D : register(t0); 2 | SamplerComparisonState S : register(s0); 3 | RWTexture2D U : register(u0); 4 | 5 | [numthreads(8, 8, 1)] 6 | void main(uint2 id : SV_DispatchThreadID) 7 | { 8 | float ref_value = float(id.x) / 8.0; 9 | float mip = 1.0 / 16.0 + 4.0 * float(id.y) / 8.0; 10 | float v = D.SampleCmpLevel(S, 0.5.xx, ref_value, mip); 11 | U[id] = v; 12 | } 13 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_unpack_s8_s16.cs_6_6.enable-16bit-types.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer RO : register(t0); 2 | RWStructuredBuffer RW : register(u0); 3 | 4 | [numthreads(1, 1, 1)] 5 | void main(uint thr : SV_DispatchThreadID) 6 | { 7 | RW[thr] = unpack_s8s16(RO[thr]); 8 | } 9 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_unpack_s8_s32.cs_6_6.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer RO : register(t0); 2 | RWStructuredBuffer RW : register(u0); 3 | 4 | [numthreads(1, 1, 1)] 5 | void main(uint thr : SV_DispatchThreadID) 6 | { 7 | RW[thr] = unpack_s8s16(RO[thr]); 8 | } 9 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_unpack_u8_u16.cs_6_6.enable-16bit-types.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer RO : register(t0); 2 | RWStructuredBuffer RW : register(u0); 3 | 4 | [numthreads(1, 1, 1)] 5 | void main(uint thr : SV_DispatchThreadID) 6 | { 7 | RW[thr] = unpack_u8u16(RO[thr]); 8 | } 9 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_unpack_u8_u32.cs_6_6.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer RO : register(t0); 2 | RWStructuredBuffer RW : register(u0); 3 | 4 | [numthreads(1, 1, 1)] 5 | void main(uint thr : SV_DispatchThreadID) 6 | { 7 | RW[thr] = unpack_u8u32(RO[thr]); 8 | } 9 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_wave_match.cs_6_5.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer RO : register(t0); 2 | RWStructuredBuffer RW : register(u0); 3 | 4 | [numthreads(16, 1, 1)] 5 | void main() 6 | { 7 | RW[WaveGetLaneIndex()] = WaveMatch(RO[WaveGetLaneIndex()]).x; 8 | } 9 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_wave_multi_prefix.cs_6_5.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer RO : register(t0); 2 | RWStructuredBuffer RW : register(u0); 3 | 4 | [numthreads(16, 1, 1)] 5 | void main() 6 | { 7 | uint4 mask = uint4(RO[WaveGetLaneIndex()], 0, 0, 0); 8 | RW[WaveGetLaneIndex() + 16 * 0] = WaveMultiPrefixSum(WaveGetLaneIndex() + 1, mask); 9 | RW[WaveGetLaneIndex() + 16 * 1] = WaveMultiPrefixProduct(WaveGetLaneIndex() + 1, mask); 10 | RW[WaveGetLaneIndex() + 16 * 2] = WaveMultiPrefixCountBits((mask.x & 0xaaaa) != 0, mask); 11 | RW[WaveGetLaneIndex() + 16 * 3] = WaveMultiPrefixBitAnd(WaveGetLaneIndex() + 1, mask); 12 | RW[WaveGetLaneIndex() + 16 * 4] = WaveMultiPrefixBitOr(WaveGetLaneIndex() + 1, mask); 13 | RW[WaveGetLaneIndex() + 16 * 5] = WaveMultiPrefixBitXor(WaveGetLaneIndex() + 1, mask); 14 | } 15 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_wave_size_range_16.cs_6_8.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer RO : register(t0); 2 | RWStructuredBuffer RW : register(u0); 3 | 4 | void run(uint thr) 5 | { 6 | RW[thr] = WavePrefixSum(RO[thr]); 7 | RW[thr + 128] = WaveGetLaneCount(); 8 | } 9 | 10 | [WaveSize(16)] 11 | [numthreads(128, 1, 1)] 12 | void main(uint thr : SV_DispatchThreadID) 13 | { 14 | run(thr); 15 | } 16 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_wave_size_range_16_32.cs_6_8.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer RO : register(t0); 2 | RWStructuredBuffer RW : register(u0); 3 | 4 | void run(uint thr) 5 | { 6 | RW[thr] = WavePrefixSum(RO[thr]); 7 | RW[thr + 128] = WaveGetLaneCount(); 8 | } 9 | 10 | [WaveSize(16,32)] 11 | [numthreads(128, 1, 1)] 12 | void main(uint thr : SV_DispatchThreadID) 13 | { 14 | run(thr); 15 | } 16 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_wave_size_range_32.cs_6_8.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer RO : register(t0); 2 | RWStructuredBuffer RW : register(u0); 3 | 4 | void run(uint thr) 5 | { 6 | RW[thr] = WavePrefixSum(RO[thr]); 7 | RW[thr + 128] = WaveGetLaneCount(); 8 | } 9 | 10 | [WaveSize(32)] 11 | [numthreads(128, 1, 1)] 12 | void main(uint thr : SV_DispatchThreadID) 13 | { 14 | run(thr); 15 | } 16 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_wave_size_range_64.cs_6_8.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer RO : register(t0); 2 | RWStructuredBuffer RW : register(u0); 3 | 4 | void run(uint thr) 5 | { 6 | RW[thr] = WavePrefixSum(RO[thr]); 7 | RW[thr + 128] = WaveGetLaneCount(); 8 | } 9 | 10 | [WaveSize(64)] 11 | [numthreads(128, 1, 1)] 12 | void main(uint thr : SV_DispatchThreadID) 13 | { 14 | run(thr); 15 | } 16 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_wave_size_range_64_128.cs_6_8.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer RO : register(t0); 2 | RWStructuredBuffer RW : register(u0); 3 | 4 | void run(uint thr) 5 | { 6 | RW[thr] = WavePrefixSum(RO[thr]); 7 | RW[thr + 128] = WaveGetLaneCount(); 8 | } 9 | 10 | [WaveSize(64,128)] 11 | [numthreads(128, 1, 1)] 12 | void main(uint thr : SV_DispatchThreadID) 13 | { 14 | run(thr); 15 | } 16 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_wave_size_range_8_16.cs_6_8.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer RO : register(t0); 2 | RWStructuredBuffer RW : register(u0); 3 | 4 | void run(uint thr) 5 | { 6 | RW[thr] = WavePrefixSum(RO[thr]); 7 | RW[thr + 128] = WaveGetLaneCount(); 8 | } 9 | 10 | [WaveSize(8,16)] 11 | [numthreads(128, 1, 1)] 12 | void main(uint thr : SV_DispatchThreadID) 13 | { 14 | run(thr); 15 | } 16 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_wave_size_range_prefer_16.cs_6_8.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer RO : register(t0); 2 | RWStructuredBuffer RW : register(u0); 3 | 4 | void run(uint thr) 5 | { 6 | RW[thr] = WavePrefixSum(RO[thr]); 7 | RW[thr + 128] = WaveGetLaneCount(); 8 | } 9 | 10 | [WaveSize(4,128,16)] 11 | [numthreads(128, 1, 1)] 12 | void main(uint thr : SV_DispatchThreadID) 13 | { 14 | run(thr); 15 | } 16 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_wave_size_range_prefer_32.cs_6_8.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer RO : register(t0); 2 | RWStructuredBuffer RW : register(u0); 3 | 4 | void run(uint thr) 5 | { 6 | RW[thr] = WavePrefixSum(RO[thr]); 7 | RW[thr + 128] = WaveGetLaneCount(); 8 | } 9 | 10 | [WaveSize(4,128,32)] 11 | [numthreads(128, 1, 1)] 12 | void main(uint thr : SV_DispatchThreadID) 13 | { 14 | run(thr); 15 | } 16 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_wave_size_range_prefer_64.cs_6_8.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer RO : register(t0); 2 | RWStructuredBuffer RW : register(u0); 3 | 4 | void run(uint thr) 5 | { 6 | RW[thr] = WavePrefixSum(RO[thr]); 7 | RW[thr + 128] = WaveGetLaneCount(); 8 | } 9 | 10 | [WaveSize(4,128,64)] 11 | [numthreads(128, 1, 1)] 12 | void main(uint thr : SV_DispatchThreadID) 13 | { 14 | run(thr); 15 | } 16 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_wave_size_wave16.cs_6_6.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer RO : register(t0); 2 | RWStructuredBuffer RW : register(u0); 3 | 4 | void run(uint thr) 5 | { 6 | RW[thr] = WavePrefixSum(RO[thr]); 7 | RW[thr + 128] = WaveGetLaneCount(); 8 | } 9 | 10 | [WaveSize(16)] 11 | [numthreads(128, 1, 1)] 12 | void main(uint thr : SV_DispatchThreadID) 13 | { 14 | run(thr); 15 | } 16 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_wave_size_wave32.cs_6_6.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer RO : register(t0); 2 | RWStructuredBuffer RW : register(u0); 3 | 4 | void run(uint thr) 5 | { 6 | RW[thr] = WavePrefixSum(RO[thr]); 7 | RW[thr + 128] = WaveGetLaneCount(); 8 | } 9 | 10 | [WaveSize(32)] 11 | [numthreads(128, 1, 1)] 12 | void main(uint thr : SV_DispatchThreadID) 13 | { 14 | run(thr); 15 | } 16 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/cs_wave_size_wave64.cs_6_6.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer RO : register(t0); 2 | RWStructuredBuffer RW : register(u0); 3 | 4 | void run(uint thr) 5 | { 6 | RW[thr] = WavePrefixSum(RO[thr]); 7 | RW[thr + 128] = WaveGetLaneCount(); 8 | } 9 | 10 | [WaveSize(64)] 11 | [numthreads(128, 1, 1)] 12 | void main(uint thr : SV_DispatchThreadID) 13 | { 14 | run(thr); 15 | } 16 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/ps_fp16_native.ps_6_2.enable-16bit-types.hlsl: -------------------------------------------------------------------------------- 1 | struct VOut 2 | { 3 | float4 pos : SV_Position; 4 | min16float2 v : V; 5 | }; 6 | 7 | StructuredBuffer A : register(t0); 8 | RWStructuredBuffer B : register(u0); 9 | 10 | min16float4 main(VOut vout) : SV_Target 11 | { 12 | min16float4 A0 = A[0]; 13 | min16float4 A1 = A[1]; 14 | B[0] = A0 + A1; 15 | B[1] = A0 - A1; 16 | return vout.v.xyxy * min16float(256.0 / 255.0); 17 | } 18 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/ps_fp16_nonnative.ps_6_2.hlsl: -------------------------------------------------------------------------------- 1 | struct VOut 2 | { 3 | float4 pos : SV_Position; 4 | min16float2 v : V; 5 | }; 6 | 7 | StructuredBuffer A : register(t0); 8 | RWStructuredBuffer B : register(u0); 9 | 10 | min16float4 main(VOut vout) : SV_Target 11 | { 12 | min16float4 A0 = A[0]; 13 | min16float4 A1 = A[1]; 14 | B[0] = A0 + A1; 15 | B[1] = A0 - A1; 16 | return vout.v.xyxy * min16float(256.0 / 255.0); 17 | } 18 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/ps_sample_cmp_grad_bias.ps_6_8.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D tex : register(t0); 2 | 3 | SamplerComparisonState samp : register(s0); 4 | 5 | cbuffer Args : register(b0) 6 | { 7 | float2 grad; 8 | float bias; 9 | float min_lod; 10 | float dref; 11 | }; 12 | 13 | float4 main(in float4 position : SV_POSITION, in float2 coord : TEXCOORD) : SV_Target 14 | { 15 | return float4( 16 | tex.SampleCmpBias(samp, coord, dref, bias, 0, min_lod), 17 | tex.SampleCmpGrad(samp, coord, dref, float2(grad.x, 0.0f), float2(0.0f, grad.y), 0, min_lod), 18 | tex.CalculateLevelOfDetail(samp, coord * exp2(bias)), 19 | tex.CalculateLevelOfDetailUnclamped(samp, coord * exp2(bias))); 20 | } 21 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/vs_barycentrics.vs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VOut 2 | { 3 | nointerpolation float attr0 : ATTR0; 4 | float attr1 : ATTR1; 5 | noperspective float attr2 : ATTR2; 6 | float4 pos : SV_Position; 7 | }; 8 | VOut main(float3 pos : POSITION, float attr : ATTR) 9 | { 10 | VOut vout; 11 | vout.pos = float4(pos.xy * pos.z, 0.0, pos.z); 12 | vout.attr0 = attr; 13 | vout.attr1 = attr; 14 | vout.attr2 = attr; 15 | return vout; 16 | } 17 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/vs_fp16_native.vs_6_2.enable-16bit-types.hlsl: -------------------------------------------------------------------------------- 1 | struct VOut 2 | { 3 | float4 pos : SV_Position; 4 | min16float2 v : V; 5 | }; 6 | 7 | VOut main(uint vert : SV_VertexID) 8 | { 9 | VOut vout; 10 | if (vert == 0) vout.pos = float4(-1, -1, 0, 1); 11 | else if (vert == 1) vout.pos = float4(-1, 3, 0, 1); 12 | else vout.pos = float4(3, -1, 0, 1); 13 | vout.v = min16float2(vout.pos.xy * 0.5 + 0.5); 14 | return vout; 15 | } 16 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/vs_fp16_nonnative.vs_6_2.hlsl: -------------------------------------------------------------------------------- 1 | struct VOut 2 | { 3 | float4 pos : SV_Position; 4 | min16float2 v : V; 5 | }; 6 | 7 | VOut main(uint vert : SV_VertexID) 8 | { 9 | VOut vout; 10 | if (vert == 0) vout.pos = float4(-1, -1, 0, 1); 11 | else if (vert == 1) vout.pos = float4(-1, 3, 0, 1); 12 | else vout.pos = float4(3, -1, 0, 1); 13 | vout.v = min16float2(vout.pos.xy * 0.5 + 0.5); 14 | return vout; 15 | } 16 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/vs_helper_lane_wave_ops.vs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | float4 main(uint vid : SV_VertexID) : SV_Position 2 | { 3 | if (vid == 0) 4 | return float4(-1.0, -1.0, 0.0, 1.0); 5 | else if (vid == 1) 6 | return float4(3.0, -1.0, 0.0, 1.0); 7 | else 8 | return float4(-1.0, 3.0, 0.0, 1.0); 9 | } 10 | -------------------------------------------------------------------------------- /tests/shaders/sm_advanced/vs_sample_cmp_grad_bias.vs_6_8.hlsl: -------------------------------------------------------------------------------- 1 | float4 main(uint vid : SV_VertexID, out float2 coord : TEXCOORD) : SV_Position 2 | { 3 | coord = float2(vid & 2, 2.0f * (vid & 1)); 4 | return float4(2.0f * coord - 1.0f, 0.0f, 1.0f); 5 | } 6 | -------------------------------------------------------------------------------- /tests/shaders/sparse/buffer_feedback_ld_raw.cs_5_0.cs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | ByteAddressBuffer buf : register(t0); 2 | RWByteAddressBuffer uav : register(u0); 3 | 4 | cbuffer args : register(b0) 5 | { 6 | uint stride; 7 | }; 8 | 9 | [numthreads(64, 1, 1)] 10 | void main(uint3 tid : SV_DISPATCHTHREADID) 11 | { 12 | uint fb; 13 | uint v = buf.Load(tid.x * stride, fb); 14 | uint s = CheckAccessFullyMapped(fb) ? 1 : 0; 15 | uav.Store2(8 * tid.x, uint2(v, s)); 16 | } -------------------------------------------------------------------------------- /tests/shaders/sparse/buffer_feedback_ld_structured.cs_5_0.cs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer buf : register(t0); 2 | RWByteAddressBuffer uav : register(u0); 3 | 4 | cbuffer args : register(b0) 5 | { 6 | uint stride; 7 | }; 8 | 9 | [numthreads(64, 1, 1)] 10 | void main(uint3 tid : SV_DISPATCHTHREADID) 11 | { 12 | uint fb; 13 | uint v = buf.Load(tid.x * stride, fb); 14 | uint s = CheckAccessFullyMapped(fb) ? 1 : 0; 15 | uav.Store2(8 * tid.x, uint2(v, s)); 16 | } -------------------------------------------------------------------------------- /tests/shaders/sparse/buffer_feedback_ld_typed.cs_5_0.cs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | Buffer buf : register(t0); 2 | RWByteAddressBuffer uav : register(u0); 3 | 4 | cbuffer args : register(b0) 5 | { 6 | uint stride; 7 | }; 8 | 9 | [numthreads(64, 1, 1)] 10 | void main(uint3 tid : SV_DISPATCHTHREADID) 11 | { 12 | uint fb; 13 | uint v = buf.Load(tid.x * stride, fb); 14 | uint s = CheckAccessFullyMapped(fb) ? 1 : 0; 15 | uav.Store2(8 * tid.x, uint2(v, s)); 16 | } -------------------------------------------------------------------------------- /tests/shaders/sparse/buffer_feedback_ld_typed_uav.cs_5_0.cs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | /* uint4 to work around what looks like an fxc bug */ 2 | RWBuffer buf : register(u1); 3 | RWByteAddressBuffer uav : register(u0); 4 | 5 | cbuffer args : register(b0) 6 | { 7 | uint stride; 8 | }; 9 | 10 | [numthreads(64, 1, 1)] 11 | void main(uint3 tid : SV_DISPATCHTHREADID) 12 | { 13 | uint fb; 14 | uint v = buf.Load(tid.x * stride, fb).r; 15 | uint s = CheckAccessFullyMapped(fb) ? 1 : 0; 16 | uav.Store2(8 * tid.x, uint2(v, s)); 17 | } -------------------------------------------------------------------------------- /tests/shaders/sparse/ds_sparse_ps.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer buf : register(b0) { float col; float iid_delta; }; 2 | 3 | struct VOut { float4 pos : SV_Position; uint iid : IID; }; 4 | 5 | RWStructuredBuffer Counter : register(u1); 6 | 7 | float main(VOut vin) : SV_Target 8 | { 9 | uint o; 10 | InterlockedAdd(Counter[0], 1, o); 11 | return col + float(vin.iid) * iid_delta; 12 | } 13 | -------------------------------------------------------------------------------- /tests/shaders/sparse/ds_sparse_vs.vs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer Buf : register(b0) { float depth; float iid_delta; }; 2 | 3 | struct VOut { float4 pos : SV_Position; uint iid : IID; }; 4 | 5 | VOut main(uint vid : SV_VertexID, uint iid : SV_InstanceID) 6 | { 7 | VOut vout; 8 | vout.pos.x = 4.0 * float(vid & 1) - 1.0; 9 | vout.pos.y = 2.0 * float(vid & 2) - 1.0; 10 | vout.pos.z = depth + iid_delta * float(iid); 11 | vout.pos.w = 1.0; 12 | vout.iid = iid; 13 | return vout; 14 | } 15 | -------------------------------------------------------------------------------- /tests/shaders/sparse/sparse_query.cs_5_0.cs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer RWBuf : register(u0); 2 | Buffer Buf : register(t0); 3 | 4 | [numthreads(1, 1, 1)] 5 | void main(uint thr : SV_DispatchThreadID) 6 | { 7 | uint code; 8 | 9 | // Sample mapped, but freed memory. See what CheckAccessFullyMapped returns. 10 | uint data = Buf.Load(thr, code); 11 | uint value = CheckAccessFullyMapped(code) ? (1u << 16) : 0u; 12 | value |= data & 0xffffu; 13 | RWBuf[2 * thr + 0] = value; 14 | 15 | // Sample not yet mapped memory. See what CheckAccessFullyMapped returns. 16 | data = Buf.Load(thr + 1024 * 1024, code); 17 | value = CheckAccessFullyMapped(code) ? (1u << 16) : 0u; 18 | value |= data & 0xffffu; 19 | 20 | RWBuf[2 * thr + 1] = value; 21 | } -------------------------------------------------------------------------------- /tests/shaders/sparse/texture_feedback_gather.ps_5_0.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | SamplerState samp : register(s0); 2 | Texture2D tex : register(t0); 3 | 4 | void main(float4 pos : SV_POSITION, float2 uv : UV_TEXCOORD, out float4 o0 : SV_TARGET0, out uint o1 : SV_TARGET1) 5 | { 6 | uint fb; 7 | o0 = tex.Gather(samp, uv, int2(0, 0), fb); 8 | o1 = CheckAccessFullyMapped(fb) ? 1 : 0; 9 | } -------------------------------------------------------------------------------- /tests/shaders/sparse/texture_feedback_gather_po.ps_5_0.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | SamplerState samp : register(s0); 2 | Texture2D tex : register(t0); 3 | 4 | cbuffer args : register(b0) 5 | { 6 | float2 offset; 7 | }; 8 | 9 | void main(float4 pos : SV_POSITION, float2 uv : UV_TEXCOORD, out float4 o0 : SV_TARGET0, out uint o1 : SV_TARGET1) 10 | { 11 | uint fb; 12 | int2 ofs = int2(offset); 13 | o0 = tex.GatherRed(samp, uv, ofs, ofs, ofs, ofs, fb); 14 | o1 = CheckAccessFullyMapped(fb) ? 1 : 0; 15 | } -------------------------------------------------------------------------------- /tests/shaders/sparse/texture_feedback_ld.ps_5_0.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D tex : register(t0); 2 | 3 | cbuffer args : register(b0) 4 | { 5 | float lod; 6 | }; 7 | 8 | void main(float4 pos : SV_POSITION, out float4 o0 : SV_TARGET0, out uint o1 : SV_TARGET1) 9 | { 10 | uint fb; 11 | o0 = tex.Load(int3(pos.xy, int(lod)), int2(0, 0), fb); 12 | o1 = CheckAccessFullyMapped(fb) ? 1 : 0; 13 | } -------------------------------------------------------------------------------- /tests/shaders/sparse/texture_feedback_ld_uav.ps_5_0.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | RWTexture2D tex : register(u2); 2 | 3 | void main(float4 pos : SV_POSITION, out float4 o0 : SV_TARGET0, out uint o1 : SV_TARGET1) 4 | { 5 | uint fb; 6 | o0 = tex.Load(int2(pos.xy), fb); 7 | o1 = CheckAccessFullyMapped(fb) ? 1 : 0; 8 | } -------------------------------------------------------------------------------- /tests/shaders/sparse/texture_feedback_sample.ps_5_0.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | SamplerState samp : register(s0); 2 | Texture2D tex : register(t0); 3 | 4 | cbuffer args : register(b0) 5 | { 6 | float lod_clamp; 7 | }; 8 | 9 | void main(float4 pos : SV_POSITION, float2 uv : UV_TEXCOORD, out float4 o0 : SV_TARGET0, out uint o1 : SV_TARGET1) 10 | { 11 | uint fb; 12 | o0 = tex.Sample(samp, uv, int2(0, 0), lod_clamp, fb); 13 | o1 = CheckAccessFullyMapped(fb) ? 1 : 0; 14 | } -------------------------------------------------------------------------------- /tests/shaders/sparse/texture_feedback_sample_bias.ps_5_0.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | SamplerState samp : register(s0); 2 | Texture2D tex : register(t0); 3 | 4 | cbuffer args : register(b0) 5 | { 6 | float lod_clamp; 7 | float lod_bias; 8 | }; 9 | 10 | void main(float4 pos : SV_POSITION, float2 uv : UV_TEXCOORD, out float4 o0 : SV_TARGET0, out uint o1 : SV_TARGET1) 11 | { 12 | uint fb; 13 | o0 = tex.SampleBias(samp, uv, lod_bias, int2(0, 0), lod_clamp, fb); 14 | o1 = CheckAccessFullyMapped(fb) ? 1 : 0; 15 | } -------------------------------------------------------------------------------- /tests/shaders/sparse/texture_feedback_sample_grad.ps_5_0.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | SamplerState samp : register(s0); 2 | Texture2D tex : register(t0); 3 | 4 | cbuffer args : register(b0) 5 | { 6 | float lod_clamp; 7 | float ddx; 8 | float ddy; 9 | }; 10 | 11 | void main(float4 pos : SV_POSITION, float2 uv : UV_TEXCOORD, out float4 o0 : SV_TARGET0, out uint o1 : SV_TARGET1) 12 | { 13 | uint fb; 14 | o0 = tex.SampleGrad(samp, uv, ddx, ddy, int2(0, 0), lod_clamp, fb); 15 | o1 = CheckAccessFullyMapped(fb) ? 1 : 0; 16 | } -------------------------------------------------------------------------------- /tests/shaders/sparse/texture_feedback_sample_lod.ps_5_0.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | SamplerState samp : register(s0); 2 | Texture2D tex : register(t0); 3 | 4 | cbuffer args : register(b0) 5 | { 6 | float lod; 7 | }; 8 | 9 | void main(float4 pos : SV_POSITION, float2 uv : UV_TEXCOORD, out float4 o0 : SV_TARGET0, out uint o1 : SV_TARGET1) 10 | { 11 | uint fb; 12 | o0 = tex.SampleLevel(samp, uv, lod, int2(0, 0), fb); 13 | o1 = CheckAccessFullyMapped(fb) ? 1 : 0; 14 | } -------------------------------------------------------------------------------- /tests/shaders/sparse/texture_feedback_vs.vs_5_0.vs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | void main(uint idx : SV_VERTEXID, out float4 pos : SV_POSITION, out float2 uv : UV_TEXCOORD) 2 | { 3 | uv = float2((idx << 1) & 2, idx & 2); 4 | pos = float4(2.0f * uv.x - 1.0f, 2.0f * (1.0f - uv.y) - 1.0f, 0.0f, 1.0f); 5 | } 6 | -------------------------------------------------------------------------------- /tests/shaders/sparse/update_tile_mappings.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | StructuredBuffer tiled_buffer : register(t0); 2 | RWStructuredBuffer out_buffer : register(u0); 3 | 4 | [numthreads(64, 1, 1)] 5 | void main(uint3 thread_id : SV_DispatchThreadID) 6 | { 7 | out_buffer[thread_id.x] = tiled_buffer[16384 * thread_id.x]; 8 | } -------------------------------------------------------------------------------- /tests/shaders/sparse/update_tile_mappings_cs_clear.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | RWTexture3D uav : register(u0); 2 | 3 | cbuffer clear_args 4 | { 5 | uint3 offset; 6 | uint value; 7 | }; 8 | 9 | [numthreads(4, 4, 4)] 10 | void main(uint3 coord : SV_DispatchThreadID) 11 | { 12 | uav[offset + coord] = value; 13 | } -------------------------------------------------------------------------------- /tests/shaders/sparse/update_tile_mappings_texture.cs_5_0.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D tiled_texture : register(t0); 2 | RWStructuredBuffer out_buffer : register(u0); 3 | 4 | [numthreads(28,1,1)] 5 | void main(uint3 thread_id : SV_DispatchThreadID) 6 | { 7 | uint2 tile_size = uint2(128, 128); 8 | uint tile_index = 0; 9 | uint tile_count = 4; 10 | uint mip_count = 10; 11 | uint mip_level = 0; 12 | 13 | while (thread_id.x >= tile_index + tile_count * tile_count && mip_level < mip_count) 14 | { 15 | tile_index += tile_count * tile_count; 16 | tile_count = max(tile_count / 2, 1); 17 | mip_level += 1; 18 | } 19 | 20 | uint2 tile_coord; 21 | tile_coord.x = (thread_id.x - tile_index) % tile_count; 22 | tile_coord.y = (thread_id.x - tile_index) / tile_count; 23 | 24 | out_buffer[thread_id.x] = tiled_texture.mips[mip_level][tile_coord * tile_size]; 25 | } -------------------------------------------------------------------------------- /tests/shaders/vrs/vrs.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | void main(in float4 vPos : SV_POSITION, out float4 o0 : SV_Target0) 2 | { 3 | o0 = float4(ddx(vPos.x) / 255.0, ddy(vPos.y) / 255.0, 0.0, 0.0); 4 | } -------------------------------------------------------------------------------- /tests/shaders/vrs/vrs_depth_ps.ps_5_0.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VSOut 2 | { 3 | float depth : D; 4 | float4 pos : SV_Position; 5 | }; 6 | 7 | struct POut 8 | { 9 | uint col : SV_Target; 10 | float depth : SV_Depth; 11 | }; 12 | 13 | POut main(VSOut vin) 14 | { 15 | POut p; 16 | const float epsilon = 1.0 / 256.0; 17 | p.col = uint(vin.depth * 64.0 + epsilon); // To avoid micro-FP precision issues in depth interpolation. 18 | p.depth = vin.depth; 19 | return p; 20 | } 21 | -------------------------------------------------------------------------------- /tests/shaders/vrs/vrs_depth_ps_fixed.ps_5_0.ps_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VSOut 2 | { 3 | float depth : D; 4 | float4 pos : SV_Position; 5 | }; 6 | 7 | struct POut 8 | { 9 | uint col : SV_Target; 10 | }; 11 | 12 | POut main(VSOut vin) 13 | { 14 | POut p; 15 | const float epsilon = 1.0 / 256.0; 16 | p.col = uint(vin.depth * 64.0 + epsilon); // To avoid micro-FP precision issues in depth interpolation. 17 | return p; 18 | } 19 | -------------------------------------------------------------------------------- /tests/shaders/vrs/vrs_depth_vs.vs_5_0.vs_6_0.hlsl: -------------------------------------------------------------------------------- 1 | struct VSOut 2 | { 3 | float depth : D; 4 | float4 pos : SV_Position; 5 | }; 6 | 7 | VSOut main(uint vid : SV_VertexID) 8 | { 9 | VSOut vout; 10 | vout.pos = float4(float(vid & 1) * 4.0 - 1.0, float(vid & 2) * 2.0 - 1.0, 0.0, 1.0); 11 | vout.depth = vout.pos.x * 0.5 + 0.5; 12 | vout.pos.z = vout.depth; 13 | return vout; 14 | } 15 | -------------------------------------------------------------------------------- /tests/shaders/vrs/vrs_image.ps_5_0.hlsl: -------------------------------------------------------------------------------- 1 | void main(in float4 vPos : SV_POSITION, out float4 o0 : SV_Target0) 2 | { 3 | o0 = float4(ddx(vPos.x) / 255.0, ddy(vPos.y) / 255.0, 0.0, 0.0); 4 | } -------------------------------------------------------------------------------- /tests/shaders/vrs/vrs_ps.ps_6_4.hlsl: -------------------------------------------------------------------------------- 1 | void main(in uint shading_rate : SV_ShadingRate, out float4 o0 : SV_Target0) 2 | { 3 | const uint D3D12_SHADING_RATE_VALID_MASK = 0x3; 4 | const uint D3D12_SHADING_RATE_X_AXIS_SHIFT = 2; 5 | o0 = float4( 6 | ((shading_rate >> D3D12_SHADING_RATE_X_AXIS_SHIFT) & D3D12_SHADING_RATE_VALID_MASK) / 255.0, 7 | (shading_rate & D3D12_SHADING_RATE_VALID_MASK) / 255.0, 8 | 0.0, 9 | 0.0); 10 | } -------------------------------------------------------------------------------- /tests/shaders/vrs/vrs_vs.vs_6_4.hlsl: -------------------------------------------------------------------------------- 1 | void main(uint id : SV_VertexID, out uint shading_rate : SV_ShadingRate, out float4 position : SV_Position) 2 | { 3 | shading_rate = 0x1; // 1x2 4 | float2 coords = float2((id << 1) & 2, id & 2); 5 | position = float4(coords * float2(2, -2) + float2(-1, 1), 0, 1); 6 | } -------------------------------------------------------------------------------- /tests/shaders/workgraph/basic.lib_6_8.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer RWBuf : register(u0); 2 | 3 | struct InputRecord 4 | { 5 | uint3 grid : SV_DispatchGrid; 6 | }; 7 | 8 | [Shader("node")] 9 | [NodeLaunch("broadcasting")] 10 | [NodeMaxDispatchGrid(2, 2, 2)] 11 | [NumThreads(2, 3, 4)] 12 | void BroadcastNode(DispatchNodeInputRecord input, uint3 thr : SV_DispatchThreadID) 13 | { 14 | uint idx = thr.z * 100 + thr.y * 10 + thr.x; 15 | uint o; 16 | InterlockedAdd(RWBuf[idx], 1, o); 17 | } 18 | 19 | -------------------------------------------------------------------------------- /tests/shaders/workgraph/broadcast_custom_input.lib_6_8.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer RWBuf : register(u0); 2 | 3 | struct Payload 4 | { 5 | uint v; 6 | uint w; 7 | }; 8 | 9 | [Shader("node")] 10 | [NodeLaunch("broadcasting")] 11 | [NodeDispatchGrid(3, 3, 2)] 12 | [NumThreads(2, 3, 4)] 13 | void BroadcastNode(DispatchNodeInputRecord payload, uint3 thr : SV_DispatchThreadID) 14 | { 15 | uint idx = thr.z * 100 + thr.y * 10 + thr.x; 16 | uint o; 17 | InterlockedAdd(RWBuf[idx], payload.Get().v ^ payload.Get().w, o); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /tests/shaders/workgraph/broadcast_custom_input_u16_2.lib_6_8.enable-16bit-types.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer RWBuf : register(u0); 2 | 3 | struct Payload 4 | { 5 | uint v; 6 | uint16_t2 size : SV_DispatchGrid; 7 | uint w; 8 | }; 9 | 10 | [Shader("node")] 11 | [NodeLaunch("broadcasting")] 12 | [NodeMaxDispatchGrid(3, 3, 2)] 13 | [NumThreads(2, 3, 4)] 14 | void BroadcastNode(DispatchNodeInputRecord payload, uint3 thr : SV_DispatchThreadID) 15 | { 16 | uint idx = thr.z * 100 + thr.y * 10 + thr.x; 17 | uint o; 18 | InterlockedAdd(RWBuf[idx], payload.Get().v ^ payload.Get().w, o); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /tests/shaders/workgraph/broadcast_custom_input_uint.lib_6_8.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer RWBuf : register(u0); 2 | 3 | struct Payload 4 | { 5 | uint v; 6 | uint size : SV_DispatchGrid; 7 | uint w; 8 | }; 9 | 10 | [Shader("node")] 11 | [NodeLaunch("broadcasting")] 12 | [NodeMaxDispatchGrid(3, 1, 1)] 13 | [NumThreads(2, 3, 4)] 14 | void BroadcastNode(DispatchNodeInputRecord payload, uint3 thr : SV_DispatchThreadID) 15 | { 16 | uint idx = thr.z * 100 + thr.y * 10 + thr.x; 17 | uint o; 18 | InterlockedAdd(RWBuf[idx], payload.Get().v ^ payload.Get().w, o); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /tests/shaders/workgraph/broadcast_custom_input_uint2.lib_6_8.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer RWBuf : register(u0); 2 | 3 | struct Payload 4 | { 5 | uint v; 6 | uint2 size : SV_DispatchGrid; 7 | uint w; 8 | }; 9 | 10 | [Shader("node")] 11 | [NodeLaunch("broadcasting")] 12 | [NodeMaxDispatchGrid(3, 3, 2)] 13 | [NumThreads(2, 3, 4)] 14 | void BroadcastNode(DispatchNodeInputRecord payload, uint3 thr : SV_DispatchThreadID) 15 | { 16 | uint idx = thr.z * 100 + thr.y * 10 + thr.x; 17 | uint o; 18 | InterlockedAdd(RWBuf[idx], payload.Get().v ^ payload.Get().w, o); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /tests/shaders/workgraph/coalesce_custom_input.lib_6_8.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer RWBuf : register(u0); 2 | 3 | struct Payload 4 | { 5 | uint idx; 6 | uint v; 7 | }; 8 | 9 | [Shader("node")] 10 | [NodeLaunch("coalescing")] 11 | [NumThreads(24, 1, 1)] 12 | void CoalesceNode([MaxRecords(3)] GroupNodeInputRecords payload, uint thr : SV_GroupThreadID) 13 | { 14 | uint count = payload.Count(); 15 | for (uint i = 0; i < count; i++) 16 | { 17 | Payload p = payload.Get(i); 18 | uint o; 19 | InterlockedAdd(RWBuf[p.idx + thr], p.v, o); 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /tests/shaders/workgraph/thread_custom_input.lib_6_8.hlsl: -------------------------------------------------------------------------------- 1 | RWStructuredBuffer RWBuf : register(u0); 2 | 3 | struct Payload 4 | { 5 | uint idx; 6 | uint v; 7 | }; 8 | 9 | [Shader("node")] 10 | [NodeLaunch("thread")] 11 | void ThreadNode(ThreadNodeInputRecord payload) 12 | { 13 | uint idx = payload.Get().idx; 14 | uint o; 15 | InterlockedAdd(RWBuf[idx], payload.Get().v, o); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /vkd3d_build.h.in: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static const uint64_t vkd3d_build = 0x@VCS_TAG@; 4 | -------------------------------------------------------------------------------- /vkd3d_version.h.in: -------------------------------------------------------------------------------- 1 | static const char vkd3d_version[] = "@VCS_TAG@"; 2 | --------------------------------------------------------------------------------