From 9d39b8e1a8d3d8b197767c5e891a9aa8eab4b883 Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 1 Sep 2023 11:45:18 +0100 Subject: [PATCH] Reformat code for clang-format 15 --- qrenderdoc/Code/BufferFormatter.cpp | 24 +- qrenderdoc/Code/CaptureContext.cpp | 64 +-- .../Code/Interface/ShaderProcessingTool.cpp | 6 +- qrenderdoc/Code/QRDUtils.cpp | 16 +- qrenderdoc/Code/QRDUtils.h | 4 +- qrenderdoc/Code/ReplayManager.cpp | 10 +- qrenderdoc/Code/Resources.h | 22 +- qrenderdoc/Code/pyrenderdoc/PythonContext.cpp | 9 +- qrenderdoc/Code/pyrenderdoc/PythonContext.h | 7 +- qrenderdoc/Code/qrenderdoc.cpp | 1 - qrenderdoc/Styles/RDStyle/RDStyle.cpp | 10 +- qrenderdoc/Widgets/CustomPaintWidget.cpp | 2 +- qrenderdoc/Widgets/Extended/RDTextEdit.cpp | 9 +- qrenderdoc/Widgets/Extended/RDTreeWidget.cpp | 1 - qrenderdoc/Windows/BufferViewer.cpp | 3 +- qrenderdoc/Windows/CommentView.cpp | 1 - .../Windows/Dialogs/AxisMappingDialog.cpp | 3 +- qrenderdoc/Windows/Dialogs/CaptureDialog.cpp | 1 - qrenderdoc/Windows/Dialogs/CrashDialog.cpp | 14 +- .../Windows/Dialogs/EnvironmentEditor.cpp | 4 +- qrenderdoc/Windows/Dialogs/LiveCapture.cpp | 9 +- qrenderdoc/Windows/Dialogs/RemoteManager.cpp | 2 +- qrenderdoc/Windows/Dialogs/SettingsDialog.cpp | 4 +- qrenderdoc/Windows/Dialogs/UpdateDialog.cpp | 13 +- .../Windows/Dialogs/VirtualFileDialog.cpp | 59 +- qrenderdoc/Windows/EventBrowser.cpp | 75 ++- qrenderdoc/Windows/MainWindow.cpp | 21 +- .../D3D11PipelineStateViewer.cpp | 178 ++++-- .../D3D12PipelineStateViewer.cpp | 155 +++-- .../PipelineState/GLPipelineStateViewer.cpp | 251 ++++---- .../PipelineState/PipelineStateViewer.cpp | 68 +-- .../VulkanPipelineStateViewer.cpp | 264 ++++++--- qrenderdoc/Windows/PythonShell.cpp | 25 +- qrenderdoc/Windows/ResourceInspector.cpp | 1 - qrenderdoc/Windows/ShaderMessageViewer.cpp | 15 +- qrenderdoc/Windows/ShaderViewer.cpp | 86 ++- qrenderdoc/Windows/TextureViewer.cpp | 8 +- renderdoc/android/android.cpp | 8 +- renderdoc/api/app/renderdoc_app.h | 12 +- renderdoc/api/replay/apidefs.h | 74 ++- renderdoc/api/replay/data_types.h | 14 +- renderdoc/api/replay/rdcstr.h | 4 +- renderdoc/api/replay/renderdoc_replay.h | 6 +- renderdoc/api/replay/replay_enums.h | 157 +++-- renderdoc/api/replay/stringise.h | 4 +- renderdoc/api/replay/version.h | 6 +- renderdoc/common/dds_readwrite.cpp | 9 +- renderdoc/common/wrapped_pool.h | 23 +- renderdoc/core/core.h | 27 +- renderdoc/core/replay_proxy.cpp | 2 +- renderdoc/core/settings.h | 10 +- renderdoc/core/sparse_page_table.cpp | 3 +- renderdoc/core/target_control.cpp | 3 +- renderdoc/data/glsl/array2ms.comp | 2 +- renderdoc/data/glsl/deptharr2ms.frag | 2 +- renderdoc/data/glsl/vk_depthbuf2ms.frag | 2 +- renderdoc/data/glsl/vk_texsample.h | 15 +- renderdoc/data/glsl_shaders.cpp | 7 +- renderdoc/data/hlsl/histogram.hlsl | 9 +- renderdoc/data/hlsl/mesh.hlsl | 16 +- renderdoc/data/hlsl/pixelhistory.hlsl | 5 +- renderdoc/data/hlsl/shaderdebug.hlsl | 3 +- renderdoc/data/hlsl/text.hlsl | 5 +- renderdoc/driver/d3d11/d3d11_context.cpp | 15 +- renderdoc/driver/d3d11/d3d11_context_wrap.cpp | 12 +- renderdoc/driver/d3d11/d3d11_debug.cpp | 3 +- renderdoc/driver/d3d11/d3d11_device.cpp | 8 +- renderdoc/driver/d3d11/d3d11_overlay.cpp | 12 +- renderdoc/driver/d3d11/d3d11_pixelhistory.cpp | 21 +- renderdoc/driver/d3d11/d3d11_rendermesh.cpp | 10 +- renderdoc/driver/d3d11/d3d11_rendertext.cpp | 5 +- renderdoc/driver/d3d11/d3d11_replay.cpp | 25 +- renderdoc/driver/d3d11/d3d11_resources.h | 3 +- renderdoc/driver/d3d11/d3d11_shader_cache.cpp | 8 +- renderdoc/driver/d3d11/d3d11_shaderdebug.cpp | 5 +- renderdoc/driver/d3d11/d3d11_video.cpp | 6 +- .../driver/d3d12/d3d12_command_list4_wrap.cpp | 8 +- .../driver/d3d12/d3d12_command_list_wrap.cpp | 10 +- .../driver/d3d12/d3d12_command_queue_wrap.cpp | 5 +- renderdoc/driver/d3d12/d3d12_commands.cpp | 4 +- renderdoc/driver/d3d12/d3d12_debug.cpp | 3 +- renderdoc/driver/d3d12/d3d12_device.h | 6 +- renderdoc/driver/d3d12/d3d12_device_wrap.cpp | 4 +- renderdoc/driver/d3d12/d3d12_manager.h | 4 +- renderdoc/driver/d3d12/d3d12_overlay.cpp | 4 +- renderdoc/driver/d3d12/d3d12_rendermesh.cpp | 5 +- renderdoc/driver/d3d12/d3d12_rendertext.cpp | 36 +- renderdoc/driver/d3d12/d3d12_resources.h | 75 ++- renderdoc/driver/d3d12/d3d12_shader_cache.cpp | 14 +- .../driver/d3d12/d3d12_shader_feedback.cpp | 6 +- renderdoc/driver/d3d12/d3d12_shaderdebug.cpp | 5 +- renderdoc/driver/dxgi/dxgi_common.cpp | 20 +- renderdoc/driver/dxgi/dxgi_wrapped.h | 10 +- renderdoc/driver/gl/cgl_platform_helpers.mm | 6 +- renderdoc/driver/gl/egl_hooks.cpp | 9 +- renderdoc/driver/gl/egl_platform.cpp | 6 +- renderdoc/driver/gl/gl_common.cpp | 60 +- renderdoc/driver/gl/gl_common.h | 15 +- renderdoc/driver/gl/gl_debug.cpp | 48 +- renderdoc/driver/gl/gl_driver.cpp | 9 +- renderdoc/driver/gl/gl_hooks.cpp | 2 +- renderdoc/driver/gl/gl_pixelhistory.cpp | 5 +- renderdoc/driver/gl/gl_postvs.cpp | 5 +- renderdoc/driver/gl/gl_program_iterate.cpp | 8 +- renderdoc/driver/gl/gl_rendermesh.cpp | 5 +- renderdoc/driver/gl/gl_renderstate.cpp | 45 +- renderdoc/driver/gl/gl_rendertexture.cpp | 5 +- renderdoc/driver/gl/gl_replay.cpp | 6 +- renderdoc/driver/gl/gl_resources.cpp | 30 +- renderdoc/driver/gl/glx_platform.cpp | 28 +- renderdoc/driver/gl/wgl_hooks.cpp | 10 +- .../gl/wrappers/gl_framebuffer_funcs.cpp | 6 +- .../driver/ihv/nv/nv_counter_enumerator.cpp | 9 +- .../metal/metal_command_buffer_bridge.mm | 8 +- .../metal/metal_command_queue_bridge.mm | 4 +- renderdoc/driver/metal/metal_common.cpp | 3 +- renderdoc/driver/metal/metal_core.cpp | 3 +- renderdoc/driver/metal/metal_device.cpp | 4 +- renderdoc/driver/metal/metal_device_bridge.mm | 64 +-- .../driver/metal/metal_function_bridge.mm | 4 +- renderdoc/driver/metal/metal_hook_bridge.mm | 9 +- .../metal_render_command_encoder_bridge.mm | 18 +- .../metal_render_pipeline_state_bridge.mm | 22 +- renderdoc/driver/metal/metal_resources.cpp | 7 +- .../driver/metal/metal_texture_bridge.mm | 4 +- renderdoc/driver/metal/metal_types.cpp | 2 +- renderdoc/driver/metal/metal_types.h | 5 +- .../driver/shaders/dxbc/dxbc_bytecode.cpp | 10 +- .../shaders/dxbc/dxbc_bytecode_editor.cpp | 21 +- .../driver/shaders/dxbc/dxbc_bytecode_ops.cpp | 3 +- .../shaders/dxbc/dxbc_bytecode_vendorext.cpp | 6 +- .../driver/shaders/dxbc/dxbc_container.cpp | 4 +- .../driver/shaders/dxbc/dxbc_container.h | 1 - renderdoc/driver/shaders/dxbc/dxbc_debug.cpp | 227 ++++---- renderdoc/driver/shaders/dxbc/dxbc_sdbg.h | 8 +- renderdoc/driver/shaders/dxbc/dxbc_spdb.cpp | 2 +- .../shaders/dxil/dxil_bytecode_editor.cpp | 27 +- .../driver/shaders/dxil/llvm_decoder.cpp | 50 +- .../driver/shaders/dxil/llvm_encoder.cpp | 124 +++- .../driver/shaders/spirv/spirv_debug.cpp | 122 ++-- .../shaders/spirv/spirv_debug_setup.cpp | 23 +- .../shaders/spirv/spirv_disassemble.cpp | 22 +- .../driver/shaders/spirv/spirv_reflect.cpp | 4 +- renderdoc/driver/vulkan/imgrefs_tests.cpp | 115 +++- renderdoc/driver/vulkan/vk_common.h | 99 ++-- renderdoc/driver/vulkan/vk_core.cpp | 539 ++++++++++++------ renderdoc/driver/vulkan/vk_debug.cpp | 172 ++++-- renderdoc/driver/vulkan/vk_dispatchtables.cpp | 4 +- renderdoc/driver/vulkan/vk_initstate.cpp | 28 +- renderdoc/driver/vulkan/vk_layer.cpp | 36 +- renderdoc/driver/vulkan/vk_manager.h | 8 +- renderdoc/driver/vulkan/vk_memory.cpp | 5 +- .../driver/vulkan/vk_msaa_buffer_conv.cpp | 38 +- renderdoc/driver/vulkan/vk_next_chains.cpp | 4 +- renderdoc/driver/vulkan/vk_outputwindow.cpp | 22 +- renderdoc/driver/vulkan/vk_overlay.cpp | 20 +- renderdoc/driver/vulkan/vk_pixelhistory.cpp | 52 +- renderdoc/driver/vulkan/vk_posix.cpp | 6 +- renderdoc/driver/vulkan/vk_postvs.cpp | 46 +- renderdoc/driver/vulkan/vk_rendermesh.cpp | 25 +- renderdoc/driver/vulkan/vk_rendertext.cpp | 14 +- renderdoc/driver/vulkan/vk_rendertexture.cpp | 8 +- renderdoc/driver/vulkan/vk_replay.cpp | 97 +++- renderdoc/driver/vulkan/vk_resources.cpp | 25 +- renderdoc/driver/vulkan/vk_resources.h | 39 +- renderdoc/driver/vulkan/vk_serialise.cpp | 19 +- .../driver/vulkan/vk_shader_feedback.cpp | 8 +- renderdoc/driver/vulkan/vk_shaderdebug.cpp | 81 ++- renderdoc/driver/vulkan/vk_state.cpp | 12 +- renderdoc/driver/vulkan/vk_state.h | 3 +- .../driver/vulkan/wrappers/vk_cmd_funcs.cpp | 18 +- .../vulkan/wrappers/vk_device_funcs.cpp | 12 +- .../driver/vulkan/wrappers/vk_draw_funcs.cpp | 7 +- .../vulkan/wrappers/vk_dynamic_funcs.cpp | 16 +- .../driver/vulkan/wrappers/vk_misc_funcs.cpp | 8 +- .../vulkan/wrappers/vk_resource_funcs.cpp | 16 +- .../driver/vulkan/wrappers/vk_sync_funcs.cpp | 8 +- .../driver/vulkan/wrappers/vk_wsi_funcs.cpp | 12 +- renderdoc/maths/formatpacking.cpp | 40 +- renderdoc/os/posix/android/android_hook.cpp | 2 +- renderdoc/os/posix/linux/linux_process.cpp | 3 +- renderdoc/os/posix/posix_process.cpp | 1 - renderdoc/os/posix/posix_threading.cpp | 2 +- renderdoc/os/win32/dia2_stubs.h | 2 +- renderdoc/os/win32/sys_win32_hooks.cpp | 211 +++---- renderdoc/os/win32/win32_callstack.cpp | 3 +- renderdoc/os/win32/win32_process.cpp | 2 +- renderdoc/os/win32/win32_shellext.cpp | 6 +- renderdoc/os/win32/win32_threading.cpp | 2 +- renderdoc/replay/basic_types_tests.cpp | 2 - renderdoc/replay/entry_points.cpp | 9 +- renderdoc/replay/replay_controller.cpp | 5 +- renderdoc/replay/replay_driver.cpp | 20 +- .../serialise/codecs/chrome_json_codec.cpp | 3 +- renderdoc/serialise/codecs/xml_codec.cpp | 6 +- renderdoc/serialise/rdcfile.cpp | 15 +- renderdoc/serialise/streamio_tests.cpp | 1 - renderdoccmd/renderdoccmd.cpp | 18 +- renderdoccmd/renderdoccmd_android.cpp | 3 +- renderdocshim/renderdocshim.cpp | 2 +- util/test/demos/android/android_platform.cpp | 44 +- util/test/demos/android/android_platform.h | 44 +- util/test/demos/android/android_window.cpp | 44 +- util/test/demos/android/android_window.h | 44 +- util/test/demos/apple/apple_platform.cpp | 44 +- util/test/demos/apple/apple_platform.h | 44 +- util/test/demos/apple/apple_window.cpp | 44 +- util/test/demos/apple/apple_window.h | 44 +- util/test/demos/apple/nuklear_appkit.h | 14 +- .../demos/d3d11/d3d11_binding_hazards.cpp | 3 +- util/test/demos/d3d11/d3d11_helpers.cpp | 195 +++++-- util/test/demos/d3d11/d3d11_helpers.h | 44 +- util/test/demos/d3d11/d3d11_mip_rtv.cpp | 4 +- .../demos/d3d11/d3d11_pixel_history_zoo.cpp | 7 +- .../demos/d3d11/d3d11_primitive_restart.cpp | 36 +- .../demos/d3d11/d3d11_resource_lifetimes.cpp | 20 +- util/test/demos/d3d11/d3d11_saturate.cpp | 6 +- .../demos/d3d11/d3d11_shader_debug_zoo.cpp | 35 +- .../demos/d3d11/d3d11_simple_dispatch.cpp | 6 +- util/test/demos/d3d11/d3d11_stream_out.cpp | 27 +- ...d11_structured_buffer_misaligned_dirty.cpp | 3 +- .../d3d11/d3d11_structured_buffer_read.cpp | 3 +- util/test/demos/d3d11/d3d11_test.cpp | 49 +- util/test/demos/d3d11/d3d11_test.h | 44 +- util/test/demos/d3d11/d3d11_texture_zoo.cpp | 19 +- .../demos/d3d11/d3d11_vertex_attr_zoo.cpp | 72 ++- .../test/demos/d3d11/d3d11_video_textures.cpp | 13 +- util/test/demos/d3d12/d3d12_compute_only.cpp | 3 +- .../demos/d3d12/d3d12_descriptor_indexing.cpp | 7 +- util/test/demos/d3d12/d3d12_helpers.cpp | 241 +++++--- util/test/demos/d3d12/d3d12_helpers.h | 44 +- util/test/demos/d3d12/d3d12_parameter_zoo.cpp | 3 +- .../demos/d3d12/d3d12_resource_lifetimes.cpp | 20 +- .../d3d12/d3d12_resource_mapping_zoo.cpp | 3 +- .../demos/d3d12/d3d12_shader_debug_zoo.cpp | 54 +- util/test/demos/d3d12/d3d12_test.cpp | 44 +- util/test/demos/d3d12/d3d12_test.h | 44 +- util/test/demos/d3d12/d3d12_texture_zoo.cpp | 17 +- .../demos/d3d12/d3d12_vertex_attr_zoo.cpp | 72 ++- util/test/demos/d3d12/d3d12_vertex_uav.cpp | 3 +- .../test/demos/d3d12/d3d12_video_textures.cpp | 3 +- util/test/demos/d3d12/d3d12_vrs.cpp | 3 +- util/test/demos/dx/d3d_helpers.cpp | 44 +- util/test/demos/dx/d3d_helpers.h | 44 +- util/test/demos/gl/gl_buffer_updates.cpp | 11 +- util/test/demos/gl/gl_cbuffer_zoo.cpp | 40 +- util/test/demos/gl/gl_discard_zoo.cpp | 5 +- util/test/demos/gl/gl_large_bcn_arrays.cpp | 6 +- util/test/demos/gl/gl_resource_lifetimes.cpp | 20 +- util/test/demos/gl/gl_spirv_shader.cpp | 20 +- util/test/demos/gl/gl_test.cpp | 44 +- util/test/demos/gl/gl_test.h | 44 +- util/test/demos/gl/gl_test_android.cpp | 44 +- util/test/demos/gl/gl_test_linux.cpp | 44 +- util/test/demos/gl/gl_test_win32.cpp | 44 +- util/test/demos/gl/gl_texture_zoo.cpp | 8 +- util/test/demos/linux/linux_platform.cpp | 44 +- util/test/demos/linux/linux_platform.h | 44 +- util/test/demos/linux/linux_window.cpp | 44 +- util/test/demos/linux/linux_window.h | 44 +- util/test/demos/main.cpp | 5 +- util/test/demos/renderdoc_app.h | 12 +- util/test/demos/test_common.cpp | 44 +- util/test/demos/test_common.h | 44 +- util/test/demos/texture_zoo.cpp | 54 +- util/test/demos/vk/vk_adv_cbuffer_zoo.cpp | 18 +- util/test/demos/vk/vk_blend.cpp | 12 +- util/test/demos/vk/vk_buffer_truncation.cpp | 16 +- util/test/demos/vk/vk_cbuffer_zoo.cpp | 26 +- util/test/demos/vk/vk_compute_only.cpp | 22 +- util/test/demos/vk/vk_custom_border_color.cpp | 13 +- .../test/demos/vk/vk_dedicated_allocation.cpp | 23 +- util/test/demos/vk/vk_descriptor_index.cpp | 67 ++- util/test/demos/vk/vk_descriptor_reuse.cpp | 39 +- .../demos/vk/vk_descriptor_variable_count.cpp | 49 +- util/test/demos/vk/vk_discard_rects.cpp | 3 +- util/test/demos/vk/vk_discard_zoo.cpp | 52 +- util/test/demos/vk/vk_draw_zoo.cpp | 30 +- util/test/demos/vk/vk_dynamic_rendering.cpp | 31 +- util/test/demos/vk/vk_extended_dyn_state.cpp | 13 +- util/test/demos/vk/vk_graphics_pipeline.cpp | 76 ++- util/test/demos/vk/vk_headers.h | 95 +-- util/test/demos/vk/vk_helpers.cpp | 52 +- util/test/demos/vk/vk_helpers.h | 100 ++-- util/test/demos/vk/vk_image_layouts.cpp | 13 +- .../demos/vk/vk_imageless_framebuffer.cpp | 31 +- util/test/demos/vk/vk_indirect.cpp | 54 +- util/test/demos/vk/vk_int8_ibuffer.cpp | 26 +- util/test/demos/vk/vk_large_buffer.cpp | 16 +- .../demos/vk/vk_large_descriptor_sets.cpp | 27 +- util/test/demos/vk/vk_leak_check.cpp | 13 +- util/test/demos/vk/vk_line_raster.cpp | 8 +- util/test/demos/vk/vk_load_store_none.cpp | 30 +- util/test/demos/vk/vk_mem_bench.cpp | 28 +- util/test/demos/vk/vk_mesh_zoo.cpp | 53 +- util/test/demos/vk/vk_misaligned_dirty.cpp | 16 +- util/test/demos/vk/vk_multi_entry.cpp | 28 +- util/test/demos/vk/vk_multi_present.cpp | 20 +- .../test/demos/vk/vk_multi_thread_windows.cpp | 8 +- util/test/demos/vk/vk_overlay_test.cpp | 70 ++- util/test/demos/vk/vk_parameter_zoo.cpp | 55 +- util/test/demos/vk/vk_pixel_history.cpp | 17 +- util/test/demos/vk/vk_postponed.cpp | 18 +- util/test/demos/vk/vk_query_pool.cpp | 8 +- .../demos/vk/vk_read_before_overwrite.cpp | 34 +- util/test/demos/vk/vk_resource_lifetimes.cpp | 80 ++- util/test/demos/vk/vk_robustness2.cpp | 22 +- util/test/demos/vk/vk_sample_locations.cpp | 25 +- util/test/demos/vk/vk_secondary_cmdbuf.cpp | 8 +- .../vk/vk_separate_depth_stencil_layouts.cpp | 46 +- util/test/demos/vk/vk_shader_debug_zoo.cpp | 95 +-- util/test/demos/vk/vk_shader_editing.cpp | 30 +- util/test/demos/vk/vk_shader_isa.cpp | 13 +- util/test/demos/vk/vk_shader_printf.cpp | 19 +- util/test/demos/vk/vk_simple_triangle.cpp | 18 +- util/test/demos/vk/vk_spec_constants.cpp | 14 +- util/test/demos/vk/vk_spirv_13_shaders.cpp | 8 +- .../demos/vk/vk_structured_buffer_nested.cpp | 18 +- util/test/demos/vk/vk_sync2.cpp | 13 +- util/test/demos/vk/vk_test.cpp | 71 +-- util/test/demos/vk/vk_test.h | 44 +- util/test/demos/vk/vk_texture_zoo.cpp | 42 +- util/test/demos/vk/vk_triangle_fan.cpp | 3 +- util/test/demos/vk/vk_validation_use.cpp | 13 +- util/test/demos/vk/vk_video_textures.cpp | 16 +- util/test/demos/vk/vk_vs_max_desc_set.cpp | 23 +- util/test/demos/win32/win32_platform.cpp | 44 +- util/test/demos/win32/win32_platform.h | 44 +- util/test/demos/win32/win32_window.cpp | 44 +- util/test/demos/win32/win32_window.h | 44 +- 330 files changed, 5856 insertions(+), 3850 deletions(-) diff --git a/qrenderdoc/Code/BufferFormatter.cpp b/qrenderdoc/Code/BufferFormatter.cpp index 21ab602c8..df430b7d7 100644 --- a/qrenderdoc/Code/BufferFormatter.cpp +++ b/qrenderdoc/Code/BufferFormatter.cpp @@ -783,8 +783,7 @@ ParsedFormat BufferFormatter::ParseFormatString(const QString &formatString, uin // try to pick up common aliases that people might use if(packrule == lit("d3dcbuffer") || packrule == lit("cbuffer") || packrule == lit("cb")) pack = Packing::D3DCB; - else if(packrule == lit("d3duav") || packrule == lit("uav") || - packrule == lit("structured")) + else if(packrule == lit("d3duav") || packrule == lit("uav") || packrule == lit("structured")) pack = Packing::D3DUAV; else if(packrule == lit("std140") || packrule == lit("ubo") || packrule == lit("gl") || packrule == lit("gles") || packrule == lit("opengl") || packrule == lit("glsl")) @@ -1007,8 +1006,9 @@ ParsedFormat BufferFormatter::ParseFormatString(const QString &formatString, uin bool matched = MatchBaseTypeDeclaration(baseType, false, tmp); - if(!matched || (VarTypeCompType(tmp.type.baseType) != CompType::UInt && - VarTypeCompType(tmp.type.baseType) != CompType::SInt) || + if(!matched || + (VarTypeCompType(tmp.type.baseType) != CompType::UInt && + VarTypeCompType(tmp.type.baseType) != CompType::SInt) || tmp.type.flags != ShaderVariableFlags::NoFlags) { reportError(tr("Invalid enum base type '%1', must be an integer type.").arg(baseType)); @@ -2338,9 +2338,7 @@ QString BufferFormatter::GetTextureFormatString(const TextureDescription &tex) case ResourceFormatType::BC4: case ResourceFormatType::ETC2: case ResourceFormatType::EAC: - case ResourceFormatType::PVRTC: - baseType = lit("[[hex]] int2"); - break; + case ResourceFormatType::PVRTC: baseType = lit("[[hex]] int2"); break; // 4x4 byte block, for 128-bit block formats case ResourceFormatType::BC2: case ResourceFormatType::BC3: @@ -3260,13 +3258,19 @@ QVariantList GetVariants(ResourceFormat format, const ShaderConstant &var, const uint32_t packed = readObj(data, end, ok); uint32_t mantissas[] = { - (packed >> 0) & 0x3f, (packed >> 11) & 0x3f, (packed >> 22) & 0x1f, + (packed >> 0) & 0x3f, + (packed >> 11) & 0x3f, + (packed >> 22) & 0x1f, }; int32_t exponents[] = { - int32_t(packed >> 6) & 0x1f, int32_t(packed >> 17) & 0x1f, int32_t(packed >> 27) & 0x1f, + int32_t(packed >> 6) & 0x1f, + int32_t(packed >> 17) & 0x1f, + int32_t(packed >> 27) & 0x1f, }; static const uint32_t leadbit[] = { - 0x40, 0x40, 0x20, + 0x40, + 0x40, + 0x20, }; for(int i = 0; i < 3; i++) diff --git a/qrenderdoc/Code/CaptureContext.cpp b/qrenderdoc/Code/CaptureContext.cpp index addd3f360..90ccf0e70 100644 --- a/qrenderdoc/Code/CaptureContext.cpp +++ b/qrenderdoc/Code/CaptureContext.cpp @@ -849,9 +849,9 @@ void CaptureContext::LoadCapture(const rdcstr &captureFile, const ReplayOptions QElapsedTimer loadTimer; loadTimer.start(); - ShowProgressDialog(m_MainWindow, tr("Loading Capture: %1").arg(QFileInfo(origFilename).fileName()), - [this]() { return !m_LoadInProgress; }, - [this]() { return UpdateLoadProgress(); }); + ShowProgressDialog( + m_MainWindow, tr("Loading Capture: %1").arg(QFileInfo(origFilename).fileName()), + [this]() { return !m_LoadInProgress; }, [this]() { return UpdateLoadProgress(); }); if(local) { @@ -1270,8 +1270,9 @@ void CaptureContext::RecompressCapture() th->wait(500); if(th->isRunning()) { - ShowProgressDialog(m_MainWindow, tr("Recompressing file."), [th]() { return !th->isRunning(); }, - [&progress]() { return progress; }); + ShowProgressDialog( + m_MainWindow, tr("Recompressing file."), [th]() { return !th->isRunning(); }, + [&progress]() { return progress; }); } th->deleteLater(); @@ -1477,7 +1478,6 @@ bool CaptureContext::ImportCapture(const CaptureFileFormat &fmt, const rdcstr &i float progress = 0.0f; LambdaThread *th = new LambdaThread([rdcfile, importfile, ext, &progress, &result]() { - ICaptureFile *file = RENDERDOC_OpenCaptureFile(); result = file->OpenFile(importfile, ext.toUtf8().data(), @@ -1499,8 +1499,9 @@ bool CaptureContext::ImportCapture(const CaptureFileFormat &fmt, const rdcstr &i th->wait(500); if(th->isRunning()) { - ShowProgressDialog(m_MainWindow, tr("Importing from %1, please wait...").arg(filename), - [th]() { return !th->isRunning(); }, [&progress]() { return progress; }); + ShowProgressDialog( + m_MainWindow, tr("Importing from %1, please wait...").arg(filename), + [th]() { return !th->isRunning(); }, [&progress]() { return progress; }); } th->deleteLater(); @@ -1564,9 +1565,9 @@ void CaptureContext::ExportCapture(const CaptureFileFormat &fmt, const rdcstr &e th->wait(500); if(th->isRunning()) { - ShowProgressDialog(m_MainWindow, - tr("Exporting %1 to %2, please wait...").arg(filename).arg(QString(fmt.name)), - [th]() { return !th->isRunning(); }, [&progress]() { return progress; }); + ShowProgressDialog( + m_MainWindow, tr("Exporting %1 to %2, please wait...").arg(filename).arg(QString(fmt.name)), + [th]() { return !th->isRunning(); }, [&progress]() { return progress; }); } th->deleteLater(); @@ -1974,7 +1975,6 @@ void CaptureContext::LoadEdits(const QString &data) auto replaceSaveCallback = [this](ICaptureContext *ctx, IShaderViewer *viewer, ResourceId id, ShaderStage stage, ShaderEncoding shaderEncoding, ShaderCompileFlags flags, rdcstr entryFunc, bytebuf shaderBytes) { - ApplyShaderEdit(viewer, id, stage, shaderEncoding, flags, entryFunc, shaderBytes); }; @@ -1984,14 +1984,14 @@ void CaptureContext::LoadEdits(const QString &data) for(QVariant e : editors) { - ShaderViewer *edit = - ShaderViewer::LoadEditor(*this, e.toMap(), replaceSaveCallback, replaceRevertCallback, - [this](ShaderViewer *view, bool closed) { - SetModification(CaptureModifications::EditedShaders); - if(closed) - m_ShaderEditors.removeOne(view); - }, - m_MainWindow->Widget()); + ShaderViewer *edit = ShaderViewer::LoadEditor( + *this, e.toMap(), replaceSaveCallback, replaceRevertCallback, + [this](ShaderViewer *view, bool closed) { + SetModification(CaptureModifications::EditedShaders); + if(closed) + m_ShaderEditors.removeOne(view); + }, + m_MainWindow->Widget()); if(edit) { @@ -2469,10 +2469,9 @@ IShaderViewer *CaptureContext::EditShader(ResourceId id, ShaderStage stage, cons if(id != ResourceId()) { auto replaceSaveCallback = [this, saveCallback]( - ICaptureContext *ctx, IShaderViewer *viewer, ResourceId id, ShaderStage stage, - ShaderEncoding shaderEncoding, ShaderCompileFlags flags, rdcstr entryFunc, - bytebuf shaderBytes) { - + ICaptureContext *ctx, IShaderViewer *viewer, ResourceId id, + ShaderStage stage, ShaderEncoding shaderEncoding, + ShaderCompileFlags flags, rdcstr entryFunc, bytebuf shaderBytes) { ApplyShaderEdit(viewer, id, stage, shaderEncoding, flags, entryFunc, shaderBytes); if(saveCallback) @@ -2487,14 +2486,15 @@ IShaderViewer *CaptureContext::EditShader(ResourceId id, ShaderStage stage, cons revertCallback(ctx, view, id); }; - viewer = ShaderViewer::EditShader(*this, id, stage, entryPoint, files, knownTool, shaderEncoding, - flags, replaceSaveCallback, replaceRevertCallback, - [this](ShaderViewer *view, bool closed) { - SetModification(CaptureModifications::EditedShaders); - if(closed) - m_ShaderEditors.removeOne(view); - }, - m_MainWindow->Widget()); + viewer = ShaderViewer::EditShader( + *this, id, stage, entryPoint, files, knownTool, shaderEncoding, flags, replaceSaveCallback, + replaceRevertCallback, + [this](ShaderViewer *view, bool closed) { + SetModification(CaptureModifications::EditedShaders); + if(closed) + m_ShaderEditors.removeOne(view); + }, + m_MainWindow->Widget()); m_ShaderEditors.push_back(viewer); SetModification(CaptureModifications::EditedShaders); diff --git a/qrenderdoc/Code/Interface/ShaderProcessingTool.cpp b/qrenderdoc/Code/Interface/ShaderProcessingTool.cpp index bec700ffd..4bd4684b2 100644 --- a/qrenderdoc/Code/Interface/ShaderProcessingTool.cpp +++ b/qrenderdoc/Code/Interface/ShaderProcessingTool.cpp @@ -163,9 +163,9 @@ static ShaderToolOutput RunTool(const ShaderProcessingTool &tool, QWidget *windo thread->start(); - ShowProgressDialog(window, QApplication::translate("ShaderProcessingTool", - "Please wait - running external tool"), - [thread]() { return !thread->isRunning(); }); + ShowProgressDialog( + window, QApplication::translate("ShaderProcessingTool", "Please wait - running external tool"), + [thread]() { return !thread->isRunning(); }); thread->deleteLater(); diff --git a/qrenderdoc/Code/QRDUtils.cpp b/qrenderdoc/Code/QRDUtils.cpp index 3ff5d8257..d271a5f8b 100644 --- a/qrenderdoc/Code/QRDUtils.cpp +++ b/qrenderdoc/Code/QRDUtils.cpp @@ -2574,8 +2574,7 @@ class RDProgressDialog : public QProgressDialog public: RDProgressDialog(const QString &labelText, QWidget *parent) // we add 1 so that the progress value never hits maximum until we are actually finished - : QProgressDialog(labelText, QString(), 0, maxProgress + 1, parent), - m_Label(this) + : QProgressDialog(labelText, QString(), 0, maxProgress + 1, parent), m_Label(this) { setWindowTitle(tr("Please Wait")); setWindowFlags(Qt::CustomizeWindowHint | Qt::Dialog | Qt::WindowTitleHint); @@ -2743,12 +2742,17 @@ bool RunProcessAsAdmin(const QString &fullExecutablePath, const QStringList &par #else // try to find a way to run the application elevated. const QString graphicalSudo[] = { - lit("kdesudo"), lit("gksudo"), lit("beesu"), + lit("kdesudo"), + lit("gksudo"), + lit("beesu"), }; // if none of the graphical options, then look for sudo and either const QString termEmulator[] = { - lit("x-terminal-emulator"), lit("gnome-terminal"), lit("konsole"), lit("xterm"), + lit("x-terminal-emulator"), + lit("gnome-terminal"), + lit("konsole"), + lit("xterm"), }; for(const QString &sudo : graphicalSudo) @@ -2840,8 +2844,8 @@ void RevealFilenameInExternalFileBrowser(const QString &filePath) { #if defined(Q_OS_WIN32) // on windows we can ask explorer to highlight the exact file. - QProcess::startDetached(lit("explorer.exe"), QStringList() << lit("/select,") - << QDir::toNativeSeparators(filePath)); + QProcess::startDetached(lit("explorer.exe"), + QStringList() << lit("/select,") << QDir::toNativeSeparators(filePath)); #else // on all other platforms, we just use QDesktopServices to invoke the external file browser on the // directory and hope that's close enough. diff --git a/qrenderdoc/Code/QRDUtils.h b/qrenderdoc/Code/QRDUtils.h index e660aba3b..8734eafcd 100644 --- a/qrenderdoc/Code/QRDUtils.h +++ b/qrenderdoc/Code/QRDUtils.h @@ -110,7 +110,9 @@ struct Rules switch(config) { - case std140: { break; + case std140: + { + break; } case std430: { diff --git a/qrenderdoc/Code/ReplayManager.cpp b/qrenderdoc/Code/ReplayManager.cpp index 851c16c0d..a1a96aa12 100644 --- a/qrenderdoc/Code/ReplayManager.cpp +++ b/qrenderdoc/Code/ReplayManager.cpp @@ -190,8 +190,9 @@ rdcstr ReplayManager::CopyCaptureToRemote(const rdcstr &localpath, QWidget *wind thread->start(); } - ShowProgressDialog(window, tr("Transferring..."), [&copied]() { return copied == 1; }, - [&progress]() { return progress; }); + ShowProgressDialog( + window, tr("Transferring..."), [&copied]() { return copied == 1; }, + [&progress]() { return progress; }); return remotepath; } @@ -224,8 +225,9 @@ void ReplayManager::CopyCaptureFromRemote(const rdcstr &remotepath, const rdcstr thread->start(); } - ShowProgressDialog(window, tr("Transferring..."), [&copied]() { return copied == 1; }, - [&progress]() { return progress; }); + ShowProgressDialog( + window, tr("Transferring..."), [&copied]() { return copied == 1; }, + [&progress]() { return progress; }); } bool ReplayManager::IsRunning() diff --git a/qrenderdoc/Code/Resources.h b/qrenderdoc/Code/Resources.h index a37e9aca3..1d538fafb 100644 --- a/qrenderdoc/Code/Resources.h +++ b/qrenderdoc/Code/Resources.h @@ -122,9 +122,15 @@ public: ~Resources(); #undef RESOURCE_DEF -#define RESOURCE_DEF(name, filename) \ - static const Resource &name() { return resources->name##_data; } \ - static const Resource &name##_2x() { return resources->name##_2x_data; } +#define RESOURCE_DEF(name, filename) \ + static const Resource &name() \ + { \ + return resources->name##_data; \ + } \ + static const Resource &name##_2x() \ + { \ + return resources->name##_2x_data; \ + } RESOURCE_LIST() private: @@ -152,7 +158,10 @@ struct Pixmaps else \ return Resources::name##_2x().pixmap; \ } \ - static const QPixmap &name(QWidget *widget) { return name(widget->devicePixelRatio()); } + static const QPixmap &name(QWidget *widget) \ + { \ + return name(widget->devicePixelRatio()); \ + } RESOURCE_LIST() }; @@ -160,6 +169,9 @@ struct Icons { #undef RESOURCE_DEF #define RESOURCE_DEF(name, filename) \ - static const QIcon &name() { return Resources::name().icon; } + static const QIcon &name() \ + { \ + return Resources::name().icon; \ + } RESOURCE_LIST() }; diff --git a/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp b/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp index 404751419..0dec8d261 100644 --- a/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp +++ b/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp @@ -910,7 +910,7 @@ void PythonContext::executeString(const QString &filename, const QString &source { PyObject *traceContext = PyDict_New(); - uintptr_t thisint = (uintptr_t) this; + uintptr_t thisint = (uintptr_t)this; uint64_t thisuint64 = (uint64_t)thisint; PyObject *thisobj = PyLong_FromUnsignedLongLong(thisuint64); @@ -1007,9 +1007,10 @@ void PythonContext::setGlobal(const char *varName, const char *typeName, void *o if(ret != 0) { - emit exception(lit("RuntimeError"), tr("Failed to set variable '%1' of type '%2'") - .arg(QString::fromUtf8(varName)) - .arg(QString::fromUtf8(typeName)), + emit exception(lit("RuntimeError"), + tr("Failed to set variable '%1' of type '%2'") + .arg(QString::fromUtf8(varName)) + .arg(QString::fromUtf8(typeName)), -1, {}); return; } diff --git a/qrenderdoc/Code/pyrenderdoc/PythonContext.h b/qrenderdoc/Code/pyrenderdoc/PythonContext.h index a1ba37bea..8e0765fb1 100644 --- a/qrenderdoc/Code/pyrenderdoc/PythonContext.h +++ b/qrenderdoc/Code/pyrenderdoc/PythonContext.h @@ -86,9 +86,10 @@ public: if(obj) setPyGlobal(varName, obj); else - emit exception(lit("RuntimeError"), tr("Failed to set variable '%1' of type '%2'") - .arg(QString::fromUtf8(varName)) - .arg(QString::fromUtf8(typeName)), + emit exception(lit("RuntimeError"), + tr("Failed to set variable '%1' of type '%2'") + .arg(QString::fromUtf8(varName)) + .arg(QString::fromUtf8(typeName)), -1, {}); } diff --git a/qrenderdoc/Code/qrenderdoc.cpp b/qrenderdoc/Code/qrenderdoc.cpp index 9c227a037..5745b0a61 100644 --- a/qrenderdoc/Code/qrenderdoc.cpp +++ b/qrenderdoc/Code/qrenderdoc.cpp @@ -633,7 +633,6 @@ int main(int argc, char *argv[]) QObject::connect( &py.ctx(), &PythonContext::exception, [&pythonExited](const QString &type, const QString &value, int, QList frames) { - if(type == lit("SystemExit")) { pythonExited = true; diff --git a/qrenderdoc/Styles/RDStyle/RDStyle.cpp b/qrenderdoc/Styles/RDStyle/RDStyle.cpp index cc0a70753..15a652721 100644 --- a/qrenderdoc/Styles/RDStyle/RDStyle.cpp +++ b/qrenderdoc/Styles/RDStyle/RDStyle.cpp @@ -414,9 +414,8 @@ QRect RDStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, (scroll->pageStep * ret.width()) / (range + scroll->pageStep)); slider.setWidth(qMin(slider.width(), sliderSize)); - slider.moveLeft(ret.left() + - (qreal(scroll->sliderPosition) / qreal(range)) * - (ret.width() - slider.width())); + slider.moveLeft(ret.left() + (qreal(scroll->sliderPosition) / qreal(range)) * + (ret.width() - slider.width())); } else { @@ -452,9 +451,8 @@ QRect RDStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, (scroll->pageStep * ret.height()) / (range + scroll->pageStep)); slider.setHeight(qMin(slider.height(), sliderSize)); - slider.moveTop(ret.top() + - (qreal(scroll->sliderPosition) / qreal(range)) * - (ret.height() - slider.height())); + slider.moveTop(ret.top() + (qreal(scroll->sliderPosition) / qreal(range)) * + (ret.height() - slider.height())); } else { diff --git a/qrenderdoc/Widgets/CustomPaintWidget.cpp b/qrenderdoc/Widgets/CustomPaintWidget.cpp index acd2d27df..ffa64cd72 100644 --- a/qrenderdoc/Widgets/CustomPaintWidget.cpp +++ b/qrenderdoc/Widgets/CustomPaintWidget.cpp @@ -46,7 +46,7 @@ CustomPaintWidgetInternal::~CustomPaintWidgetInternal() CustomPaintWidget::CustomPaintWidget(QWidget *parent) : QWidget(parent) { - m_Tag = QFormatStr("custompaint%1").arg((uintptr_t) this); + m_Tag = QFormatStr("custompaint%1").arg((uintptr_t)this); setAttribute(Qt::WA_OpaquePaintEvent); diff --git a/qrenderdoc/Widgets/Extended/RDTextEdit.cpp b/qrenderdoc/Widgets/Extended/RDTextEdit.cpp index 2cb01d9e1..6f18ac050 100644 --- a/qrenderdoc/Widgets/Extended/RDTextEdit.cpp +++ b/qrenderdoc/Widgets/Extended/RDTextEdit.cpp @@ -126,8 +126,9 @@ void RDTextEdit::enableCompletion() // if we're in the middle of a word, move to the end of it QString text = toPlainText(); - if(cur.position() > 0 && (text[cur.position() - 1].isLetterOrNumber() || - m_WordCharacters.contains(text[cur.position() - 1])) && + if(cur.position() > 0 && + (text[cur.position() - 1].isLetterOrNumber() || + m_WordCharacters.contains(text[cur.position() - 1])) && (text[cur.position()].isLetterOrNumber() || m_WordCharacters.contains(text[cur.position()]))) { @@ -200,9 +201,7 @@ void RDTextEdit::keyPressEvent(QKeyEvent *e) case Qt::Key_Enter: case Qt::Key_Tab: case Qt::Key_Backtab: - case Qt::Key_Escape: - e->ignore(); - return; + case Qt::Key_Escape: e->ignore(); return; // also the completer doesn't hide itself when the cursor is moved so make sure we do that // ourselves diff --git a/qrenderdoc/Widgets/Extended/RDTreeWidget.cpp b/qrenderdoc/Widgets/Extended/RDTreeWidget.cpp index 76e384c66..1c2897765 100644 --- a/qrenderdoc/Widgets/Extended/RDTreeWidget.cpp +++ b/qrenderdoc/Widgets/Extended/RDTreeWidget.cpp @@ -320,7 +320,6 @@ void RDTreeWidgetItem::sort(int column, Qt::SortOrder order) std::stable_sort(m_children.begin(), m_children.end(), [ctx, column, order](const RDTreeWidgetItem *a, const RDTreeWidgetItem *b) { - if(a->treeWidget()->m_SortComparison) return a->treeWidget()->m_SortComparison(column, order, a, b); diff --git a/qrenderdoc/Windows/BufferViewer.cpp b/qrenderdoc/Windows/BufferViewer.cpp index 95ffe0775..965e485c2 100644 --- a/qrenderdoc/Windows/BufferViewer.cpp +++ b/qrenderdoc/Windows/BufferViewer.cpp @@ -2270,8 +2270,7 @@ BufferViewer::BufferViewer(ICaptureContext &ctx, bool meshview, QWidget *parent) ui->matrixType->addItems({tr("Perspective"), tr("Orthographic")}); ui->axisMappingCombo->addItems({tr("Y-up, left handed"), tr("Y-up, right handed"), - tr("Z-up, left handed"), tr("Z-up, right handed"), - tr("Custom...")}); + tr("Z-up, left handed"), tr("Z-up, right handed"), tr("Custom...")}); ui->axisMappingCombo->setCurrentIndex(0); // wireframe only available on solid shaded options diff --git a/qrenderdoc/Windows/CommentView.cpp b/qrenderdoc/Windows/CommentView.cpp index af953097e..941f053fe 100644 --- a/qrenderdoc/Windows/CommentView.cpp +++ b/qrenderdoc/Windows/CommentView.cpp @@ -53,7 +53,6 @@ CommentView::CommentView(ICaptureContext &ctx, QWidget *parent) QObject::connect( m_commentsEditor, &ScintillaEdit::modified, [this](int type, int position, int length, int, const QByteArray &, int, int, int) { - // if there has been a change, restyle the region around the modification. We can't use just // word boundaries so search back to the last whitespace character - this means we will // restyle at most a line, likely much less. diff --git a/qrenderdoc/Windows/Dialogs/AxisMappingDialog.cpp b/qrenderdoc/Windows/Dialogs/AxisMappingDialog.cpp index e21cea550..10c0e0ff9 100644 --- a/qrenderdoc/Windows/Dialogs/AxisMappingDialog.cpp +++ b/qrenderdoc/Windows/Dialogs/AxisMappingDialog.cpp @@ -154,8 +154,7 @@ void AxisMappingDialog::setNewAxisMapping() duplicateDirection = zDirection; } - const QStringList directions = {tr("left/right"), tr("up/down"), - tr("into screen/out of screen")}; + const QStringList directions = {tr("left/right"), tr("up/down"), tr("into screen/out of screen")}; QString messageText; if(allAxesDegenerate) diff --git a/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp b/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp index fca0366f5..b56f1b4a0 100644 --- a/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp +++ b/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp @@ -568,7 +568,6 @@ void CaptureDialog::CheckAndroidSetup(QString &filename) ui->androidWarn->setVisible(false); LambdaThread *scan = new LambdaThread([this, filename]() { - rdcstr host = m_Ctx.Replay().CurrentRemote().Hostname(); RENDERDOC_CheckAndroidPackage(host, filename, &m_AndroidFlags); diff --git a/qrenderdoc/Windows/Dialogs/CrashDialog.cpp b/qrenderdoc/Windows/Dialogs/CrashDialog.cpp index 72f1bf53f..363dccfb0 100644 --- a/qrenderdoc/Windows/Dialogs/CrashDialog.cpp +++ b/qrenderdoc/Windows/Dialogs/CrashDialog.cpp @@ -314,12 +314,13 @@ void CrashDialog::on_send_clicked() // confirm if the user REALLY wants to upload their capture if(ui->captureUpload->isChecked()) { - QMessageBox::StandardButton result = RDDialog::question( - this, tr("Are you sure?"), tr("Uploading your capture file will send it privately to the " - "RenderDoc server where I can " - "use it to reproduce your problem.\n\nAre you sure you are " - "OK with sending the capture " - "securely to RenderDoc's website?")); + QMessageBox::StandardButton result = + RDDialog::question(this, tr("Are you sure?"), + tr("Uploading your capture file will send it privately to the " + "RenderDoc server where I can " + "use it to reproduce your problem.\n\nAre you sure you are " + "OK with sending the capture " + "securely to RenderDoc's website?")); if(result != QMessageBox::Yes) { @@ -498,7 +499,6 @@ void CrashDialog::sendReport() }); QObject::connect(m_Request, &QNetworkReply::finished, [this]() { - // don't do anything if we're finished after an error if(ui->uploadRetry->isEnabled()) return; diff --git a/qrenderdoc/Windows/Dialogs/EnvironmentEditor.cpp b/qrenderdoc/Windows/Dialogs/EnvironmentEditor.cpp index 91b6d79cc..210603806 100644 --- a/qrenderdoc/Windows/Dialogs/EnvironmentEditor.cpp +++ b/qrenderdoc/Windows/Dialogs/EnvironmentEditor.cpp @@ -68,7 +68,9 @@ EnvironmentEditor::EnvironmentEditor(QWidget *parent) QObject::connect(ui->appendValue, &QRadioButton::toggled, separatorLambda); ui->separator->addItems({ - ToQStr(EnvSep::Platform), ToQStr(EnvSep::SemiColon), ToQStr(EnvSep::Colon), + ToQStr(EnvSep::Platform), + ToQStr(EnvSep::SemiColon), + ToQStr(EnvSep::Colon), ToQStr(EnvSep::NoSep), }); diff --git a/qrenderdoc/Windows/Dialogs/LiveCapture.cpp b/qrenderdoc/Windows/Dialogs/LiveCapture.cpp index a8c04eac2..ade668ead 100644 --- a/qrenderdoc/Windows/Dialogs/LiveCapture.cpp +++ b/qrenderdoc/Windows/Dialogs/LiveCapture.cpp @@ -868,9 +868,10 @@ bool LiveCapture::saveCapture(Capture *cap, QString path) if(QString(m_Ctx.GetCaptureFilename()) == path) { - RDDialog::critical(this, tr("Cannot save"), tr("Can't overwrite currently open capture at %1\n" - "Close the capture or save to another location.") - .arg(path)); + RDDialog::critical(this, tr("Cannot save"), + tr("Can't overwrite currently open capture at %1\n" + "Close the capture or save to another location.") + .arg(path)); return false; } @@ -1370,7 +1371,6 @@ void LiveCapture::connectionThreadEntry() { float progress = msg.capProgress; GUIInvoke::call(this, [this, progress]() { - if(progress >= 0.0f && progress < 1.0f) { ui->progressLabel->setText(tr("Capture in Progress:")); @@ -1384,7 +1384,6 @@ void LiveCapture::connectionThreadEntry() ui->progressLabel->setVisible(false); ui->progressBar->setVisible(false); } - }); } diff --git a/qrenderdoc/Windows/Dialogs/RemoteManager.cpp b/qrenderdoc/Windows/Dialogs/RemoteManager.cpp index 8a751e488..9cec57cb6 100644 --- a/qrenderdoc/Windows/Dialogs/RemoteManager.cpp +++ b/qrenderdoc/Windows/Dialogs/RemoteManager.cpp @@ -222,7 +222,7 @@ void RemoteManager::refreshHost(RDTreeWidgetItem *node) // this function looks up the remote connections and for each one open // queries it for the API, target (usually executable name) and if any user is already connected - LambdaThread *th = new LambdaThread([ this, node, h = host ]() { + LambdaThread *th = new LambdaThread([this, node, h = host]() { QByteArray username = GetSystemUsername().toUtf8(); // make a mutable copy and check the status diff --git a/qrenderdoc/Windows/Dialogs/SettingsDialog.cpp b/qrenderdoc/Windows/Dialogs/SettingsDialog.cpp index 7b11cb855..c04710586 100644 --- a/qrenderdoc/Windows/Dialogs/SettingsDialog.cpp +++ b/qrenderdoc/Windows/Dialogs/SettingsDialog.cpp @@ -1030,8 +1030,8 @@ void SettingsDialog::on_editShaderTool_clicked() { ui->shaderTools->setItem(row, 0, new QTableWidgetItem(tool.name)); ui->shaderTools->setItem( - row, 1, new QTableWidgetItem( - QFormatStr("%1 -> %2").arg(ToQStr(tool.input)).arg(ToQStr(tool.output)))); + row, 1, + new QTableWidgetItem(QFormatStr("%1 -> %2").arg(ToQStr(tool.input)).arg(ToQStr(tool.output)))); m_Ctx.Config().ShaderProcessors[row] = tool; m_Ctx.Config().Save(); } diff --git a/qrenderdoc/Windows/Dialogs/UpdateDialog.cpp b/qrenderdoc/Windows/Dialogs/UpdateDialog.cpp index d9e609450..0146cfb3b 100644 --- a/qrenderdoc/Windows/Dialogs/UpdateDialog.cpp +++ b/qrenderdoc/Windows/Dialogs/UpdateDialog.cpp @@ -116,11 +116,12 @@ void UpdateDialog::on_close_clicked() void UpdateDialog::on_update_clicked() { - QMessageBox::StandardButton res = RDDialog::question( - this, tr("RenderDoc Update"), tr("This will close RenderDoc immediately - if you have any " - "unsaved work, save it first!\n" - "Continue?"), - QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel); + QMessageBox::StandardButton res = + RDDialog::question(this, tr("RenderDoc Update"), + tr("This will close RenderDoc immediately - if you have any " + "unsaved work, save it first!\n" + "Continue?"), + QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel); if(res == QMessageBox::Yes) { @@ -199,7 +200,6 @@ void UpdateDialog::on_update_clicked() }); QObject::connect(req, &QNetworkReply::finished, [this, req]() { - // don't do anything if we're finished after an error if(ui->update->isEnabled()) return; @@ -252,7 +252,6 @@ void UpdateDialog::on_update_clicked() QStringList() << lit("upgrade") << lit("--path") << appDir.absolutePath(), NULL, true); exit(0); - }); } } diff --git a/qrenderdoc/Windows/Dialogs/VirtualFileDialog.cpp b/qrenderdoc/Windows/Dialogs/VirtualFileDialog.cpp index d931961df..c98063f87 100644 --- a/qrenderdoc/Windows/Dialogs/VirtualFileDialog.cpp +++ b/qrenderdoc/Windows/Dialogs/VirtualFileDialog.cpp @@ -312,7 +312,9 @@ public: { switch(index.column()) { - case 0: { return node->file.filename; + case 0: + { + return node->file.filename; } case 1: { @@ -458,37 +460,38 @@ private: if(!(node->file.flags & PathProperty::Directory)) return; - Renderer.ListFolder(makePath(node), true, [node](const rdcstr &path, - const rdcarray &files) { - if(files.count() == 1 && (files[0].flags & PathProperty::ErrorAccessDenied)) - { - node->file.flags |= PathProperty::ErrorAccessDenied; - return; - } + Renderer.ListFolder( + makePath(node), true, [node](const rdcstr &path, const rdcarray &files) { + if(files.count() == 1 && (files[0].flags & PathProperty::ErrorAccessDenied)) + { + node->file.flags |= PathProperty::ErrorAccessDenied; + return; + } - QVector sortedFiles; - sortedFiles.reserve(files.count()); - for(const PathEntry &f : files) - sortedFiles.push_back(f); + QVector sortedFiles; + sortedFiles.reserve(files.count()); + for(const PathEntry &f : files) + sortedFiles.push_back(f); - std::sort(sortedFiles.begin(), sortedFiles.end(), [](const PathEntry &a, const PathEntry &b) { - // sort greater than so that files with the flag are sorted before those without - if((a.flags & PathProperty::Directory) != (b.flags & PathProperty::Directory)) - return (a.flags & PathProperty::Directory) > (b.flags & PathProperty::Directory); + std::sort( + sortedFiles.begin(), sortedFiles.end(), [](const PathEntry &a, const PathEntry &b) { + // sort greater than so that files with the flag are sorted before those without + if((a.flags & PathProperty::Directory) != (b.flags & PathProperty::Directory)) + return (a.flags & PathProperty::Directory) > (b.flags & PathProperty::Directory); - return strcmp(a.filename.c_str(), b.filename.c_str()) < 0; - }); + return strcmp(a.filename.c_str(), b.filename.c_str()) < 0; + }); - for(int i = 0; i < sortedFiles.count(); i++) - { - FSNode *child = new FSNode(); - child->parent = node; - child->parentIndex = i; - child->file = sortedFiles[i]; - child->populated = !(child->file.flags & PathProperty::Directory); - node->children.push_back(child); - } - }); + for(int i = 0; i < sortedFiles.count(); i++) + { + FSNode *child = new FSNode(); + child->parent = node; + child->parentIndex = i; + child->file = sortedFiles[i]; + child->populated = !(child->file.flags & PathProperty::Directory); + node->children.push_back(child); + } + }); } }; diff --git a/qrenderdoc/Windows/EventBrowser.cpp b/qrenderdoc/Windows/EventBrowser.cpp index 00223242d..f2107f4a6 100644 --- a/qrenderdoc/Windows/EventBrowser.cpp +++ b/qrenderdoc/Windows/EventBrowser.cpp @@ -1422,13 +1422,13 @@ public: #define STRINGIZE(a) STRINGIZE2(a) #endif -#define MAKE_BUILTIN_FILTER(filter_name) \ - m_BuiltinFilters[lit(STRINGIZE(filter_name))].makeFilter = [this]( \ - QString name, QString parameters, ParseTrace &trace) { \ - return filterFunction_##filter_name(name, parameters, trace); \ - }; \ - m_BuiltinFilters[lit(STRINGIZE(filter_name))].description = \ - filterDescription_##filter_name().trimmed(); +#define MAKE_BUILTIN_FILTER(filter_name) \ + m_BuiltinFilters[lit(STRINGIZE(filter_name))].makeFilter = \ + [this](QString name, QString parameters, ParseTrace &trace) { \ + return filterFunction_##filter_name(name, parameters, trace); \ + }; \ + m_BuiltinFilters[lit(STRINGIZE(filter_name))].description = \ + filterDescription_##filter_name().trimmed(); MAKE_BUILTIN_FILTER(regex); MAKE_BUILTIN_FILTER(param); @@ -1514,15 +1514,13 @@ public: { if(m_BuiltinFilters.contains(name)) { - qCritical() << "Registering filter function" << QString(name) - << "which is a builtin function."; + qCritical() << "Registering filter function" << QString(name) << "which is a builtin function."; return false; } if(m_CustomFilters[name].filter != NULL) { - qCritical() << "Registering filter function" << QString(name) - << "which is already registered."; + qCritical() << "Registering filter function" << QString(name) << "which is already registered."; return false; } @@ -1818,7 +1816,6 @@ searched for as a case-insensitive substring. return RichResourceTextFormat(*ctx, SDObject2Variant(o, false)) .contains(paramValue, Qt::CaseInsensitive); } - }; } @@ -2018,10 +2015,21 @@ and these can be queried with a filter such as $action(flags & Clear|Clear if(tokens.size() <= 1) return { - "EID", "actionId", "numIndices", + "EID", + "actionId", + "numIndices", // most aliases we don't autocomplete but this one we leave - "numVertices", "numInstances", "baseVertex", "indexOffset", "vertexOffset", - "instanceOffset", "dispatchX", "dispatchY", "dispatchZ", "dispatchSize", "duration", + "numVertices", + "numInstances", + "baseVertex", + "indexOffset", + "vertexOffset", + "instanceOffset", + "dispatchX", + "dispatchY", + "dispatchZ", + "dispatchSize", + "duration", "flags", }; @@ -2073,14 +2081,19 @@ and these can be queried with a filter such as $action(flags & Clear|Clear } static const NamedProp namedProps[] = { - NAMED_PROP("eventid", action->eventId), NAMED_PROP("eid", action->eventId), - NAMED_PROP("actionid", action->actionId), NAMED_PROP("numindices", action->numIndices), - NAMED_PROP("numindexes", action->numIndices), NAMED_PROP("numvertices", action->numIndices), - NAMED_PROP("numvertexes", action->numIndices), NAMED_PROP("indexcount", action->numIndices), + NAMED_PROP("eventid", action->eventId), + NAMED_PROP("eid", action->eventId), + NAMED_PROP("actionid", action->actionId), + NAMED_PROP("numindices", action->numIndices), + NAMED_PROP("numindexes", action->numIndices), + NAMED_PROP("numvertices", action->numIndices), + NAMED_PROP("numvertexes", action->numIndices), + NAMED_PROP("indexcount", action->numIndices), NAMED_PROP("vertexcount", action->numIndices), NAMED_PROP("numinstances", action->numInstances), NAMED_PROP("instancecount", action->numInstances), - NAMED_PROP("basevertex", action->baseVertex), NAMED_PROP("indexoffset", action->indexOffset), + NAMED_PROP("basevertex", action->baseVertex), + NAMED_PROP("indexoffset", action->indexOffset), NAMED_PROP("vertexoffset", action->vertexOffset), NAMED_PROP("instanceoffset", action->instanceOffset), NAMED_PROP("dispatchx", action->dispatchDimension[0]), @@ -2183,7 +2196,10 @@ and these can be queried with a filter such as $action(flags & Clear|Clear { // deliberately don't allow equality/inequality static const QStringList operators = { - lit("<"), lit(">"), lit("<="), lit(">="), + lit("<"), + lit(">"), + lit("<="), + lit(">="), }; int operatorIdx = tokens.size() > 1 ? operators.indexOf(tokens[1].text) : -1; @@ -2407,13 +2423,15 @@ Otherwise the event is included if it's a dispatch AND if the condition is true. }; static const NamedProp namedProps[] = { - NAMED_PROP("eventid", action->eventId), NAMED_PROP("eid", action->eventId), + NAMED_PROP("eventid", action->eventId), + NAMED_PROP("eid", action->eventId), NAMED_PROP("actionid", action->actionId), NAMED_PROP("dispatchx", action->dispatchDimension[0]), NAMED_PROP("dispatchy", action->dispatchDimension[1]), NAMED_PROP("dispatchz", action->dispatchDimension[2]), NAMED_PROP("x", action->dispatchDimension[0]), - NAMED_PROP("y", action->dispatchDimension[1]), NAMED_PROP("z", action->dispatchDimension[2]), + NAMED_PROP("y", action->dispatchDimension[1]), + NAMED_PROP("z", action->dispatchDimension[2]), NAMED_PROP("dispatchsize", action->dispatchDimension[0] * action->dispatchDimension[1] * action->dispatchDimension[2]), NAMED_PROP("size", action->dispatchDimension[0] * action->dispatchDimension[1] * @@ -2513,7 +2531,10 @@ Otherwise the event is included if it's a dispatch AND if the condition is true. { // deliberately don't allow equality/inequality static const QStringList operators = { - lit("<"), lit(">"), lit("<="), lit(">="), + lit("<"), + lit(">"), + lit("<="), + lit(">="), }; int operatorIdx = tokens.size() > 1 ? operators.indexOf(tokens[1].text) : -1; @@ -4265,7 +4286,8 @@ strings. These are documented on the left here, but for example will include any action that matches "Indexed" as a plain string match, OR is an action which renders more than 1000 indices.

-)EOD").trimmed()); +)EOD") + .trimmed()); } else if(f == lit("Literal String")) { @@ -4285,7 +4307,8 @@ or whitespace, will be case-insensitively matched against the event name. Note t this doesn't include all parameters, only those that appear in the name summary. For searching arbitrary parameters consider using the $param() function.

-)EOD").trimmed()); +)EOD") + .trimmed()); } else { diff --git a/qrenderdoc/Windows/MainWindow.cpp b/qrenderdoc/Windows/MainWindow.cpp index fec824c79..ce5a5b91c 100644 --- a/qrenderdoc/Windows/MainWindow.cpp +++ b/qrenderdoc/Windows/MainWindow.cpp @@ -657,7 +657,6 @@ void MainWindow::OnCaptureTrigger(const QString &exe, const QString &workingDir, return; LambdaThread *th = new LambdaThread([this, exe, workingDir, cmdLine, env, opts, callback]() { - if(isUnshareableDeviceInUse()) { RDDialog::warning(this, tr("RenderDoc is already capturing an app on this device"), @@ -673,7 +672,6 @@ void MainWindow::OnCaptureTrigger(const QString &exe, const QString &workingDir, m_Ctx.Replay().ExecuteAndInject(exe, workingDir, cmdLine, env, capturefile, opts); GUIInvoke::call(this, [this, exe, ret, callback]() { - if(ret.result.code == ResultCode::JDWPFailure) { RDDialog::critical( @@ -733,7 +731,6 @@ void MainWindow::OnInjectTrigger(uint32_t PID, const rdcarraysetText(tr("Checking remote server status...")); - LambdaThread *th = new LambdaThread([ this, h = host ]() { + LambdaThread *th = new LambdaThread([this, h = host]() { // make a mutable copy and see if the server is up RemoteHost host = h; host.CheckStatus(); @@ -2037,7 +2034,6 @@ void MainWindow::setRemoteHost(int hostIdx) if(host.Protocol() && host.IsVersionMismatch()) { GUIInvoke::blockcall(this, [this, &host]() { - QMessageBox::StandardButton res = RDDialog::question(this, tr("Unsupported version"), tr("Remote server on %1 has an incompatible version.\n" @@ -2563,8 +2559,9 @@ void MainWindow::on_action_Resolve_Symbols_triggered() finished = true; }); - ShowProgressDialog(this, tr("Resolving symbols, please wait..."), - [&finished]() { return finished; }, [&progress]() { return progress; }); + ShowProgressDialog( + this, tr("Resolving symbols, please wait..."), [&finished]() { return finished; }, + [&progress]() { return progress; }); if(m_Ctx.HasAPIInspector()) m_Ctx.GetAPIInspector()->Refresh(); @@ -2635,9 +2632,8 @@ void MainWindow::on_action_Start_Replay_Loop_triggered() else { popup.resize(100, 100); - popup.setWindowTitle(tr("Looping replay of %1 Displaying %2") - .arg(m_Ctx.GetCaptureFilename()) - .arg(tr("nothing"))); + popup.setWindowTitle( + tr("Looping replay of %1 Displaying %2").arg(m_Ctx.GetCaptureFilename()).arg(tr("nothing"))); } WindowingData winData = m_Ctx.CreateWindowingData(&popup); @@ -2881,8 +2877,7 @@ void MainWindow::on_action_Check_for_Updates_triggered() } case UpdateResult::Latest: { - RDDialog::information(this, tr("Latest version"), - tr("You are running the latest version.")); + RDDialog::information(this, tr("Latest version"), tr("You are running the latest version.")); break; } case UpdateResult::Upgrade: @@ -3141,7 +3136,7 @@ void MainWindow::showLaunchError(ResultDetails result) " Or if this is a custom build check that all ABIs are built at the same version as " "this program." #endif - ); + ); break; default: message = tr("Error encountered launching RenderDoc remote server: %1.").arg(result.Message()); diff --git a/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp index cd0a79760..35ce94115 100644 --- a/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp @@ -209,9 +209,8 @@ D3D11PipelineStateViewer::D3D11PipelineStateViewer(ICaptureContext &ctx, RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); ui->iaLayouts->setHeader(header); - ui->iaLayouts->setColumns({tr("Slot"), tr("Semantic"), tr("Index"), tr("Format"), - tr("Input Slot"), tr("Offset"), tr("Class"), tr("Step Rate"), - tr("Go")}); + ui->iaLayouts->setColumns({tr("Slot"), tr("Semantic"), tr("Index"), tr("Format"), tr("Input Slot"), + tr("Offset"), tr("Class"), tr("Step Rate"), tr("Go")}); header->setColumnStretchHints({1, 4, 2, 3, 2, 2, 1, 1, -1}); ui->iaLayouts->setClearSelectionOnFocusLoss(true); @@ -339,9 +338,8 @@ D3D11PipelineStateViewer::D3D11PipelineStateViewer(ICaptureContext &ctx, RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); ui->targetOutputs->setHeader(header); - ui->targetOutputs->setColumns({tr("Slot"), tr("Resource"), tr("Type"), tr("Width"), - tr("Height"), tr("Depth"), tr("Array Size"), tr("Format"), - tr("Go")}); + ui->targetOutputs->setColumns({tr("Slot"), tr("Resource"), tr("Type"), tr("Width"), tr("Height"), + tr("Depth"), tr("Array Size"), tr("Format"), tr("Go")}); header->setColumnStretchHints({2, 4, 2, 1, 1, 1, 1, 3, -1}); ui->targetOutputs->setHoverIconColumn(8, action, action_hover); @@ -398,12 +396,25 @@ D3D11PipelineStateViewer::D3D11PipelineStateViewer(ICaptureContext &ctx, ui->pipeFlow->setStages( { - lit("IA"), lit("VS"), lit("HS"), lit("DS"), lit("GS"), lit("RS"), lit("PS"), lit("OM"), + lit("IA"), + lit("VS"), + lit("HS"), + lit("DS"), + lit("GS"), + lit("RS"), + lit("PS"), + lit("OM"), lit("CS"), }, { - tr("Input Assembler"), tr("Vertex Shader"), tr("Hull Shader"), tr("Domain Shader"), - tr("Geometry Shader"), tr("Rasterizer"), tr("Pixel Shader"), tr("Output Merger"), + tr("Input Assembler"), + tr("Vertex Shader"), + tr("Hull Shader"), + tr("Domain Shader"), + tr("Geometry Shader"), + tr("Rasterizer"), + tr("Pixel Shader"), + tr("Output Merger"), tr("Compute Shader"), }); @@ -2546,8 +2557,9 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe } m_Common.exportHTMLTable( - xml, {tr("Slot"), tr("Semantic Name"), tr("Semantic Index"), tr("Format"), tr("Input Slot"), - tr("Byte Offset"), tr("Per Instance"), tr("Instance Data Step Rate")}, + xml, + {tr("Slot"), tr("Semantic Name"), tr("Semantic Index"), tr("Format"), tr("Input Slot"), + tr("Byte Offset"), tr("Per Instance"), tr("Instance Data Step Rate")}, rows); } @@ -2670,9 +2682,17 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe m_Common.exportHTMLTable(xml, { - tr("Slot"), tr("Name"), tr("View Type"), tr("Resource Type"), - tr("Width"), tr("Height"), tr("Depth"), tr("Array Size"), - tr("View Format"), tr("Resource Format"), tr("View Parameters"), + tr("Slot"), + tr("Name"), + tr("View Type"), + tr("Resource Type"), + tr("Width"), + tr("Height"), + tr("Depth"), + tr("Array Size"), + tr("View Format"), + tr("Resource Format"), + tr("View Parameters"), }, rows); } @@ -2695,9 +2715,17 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe m_Common.exportHTMLTable(xml, { - tr("Slot"), tr("Name"), tr("View Type"), tr("Resource Type"), - tr("Width"), tr("Height"), tr("Depth"), tr("Array Size"), - tr("View Format"), tr("Resource Format"), tr("View Parameters"), + tr("Slot"), + tr("Name"), + tr("View Type"), + tr("Resource Type"), + tr("Width"), + tr("Height"), + tr("Depth"), + tr("Array Size"), + tr("View Format"), + tr("Resource Format"), + tr("View Parameters"), }, rows); } @@ -2757,13 +2785,19 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe s.maxLOD == FLT_MAX ? lit("FLT_MAX") : QString::number(s.maxLOD), s.mipLODBias}); } - m_Common.exportHTMLTable( - xml, - { - tr("Slot"), tr("Addressing"), tr("Border Colour"), tr("Comparison"), tr("Filter"), - tr("Max Anisotropy"), tr("Min LOD"), tr("Max LOD"), tr("Mip Bias"), - }, - rows); + m_Common.exportHTMLTable(xml, + { + tr("Slot"), + tr("Addressing"), + tr("Border Colour"), + tr("Comparison"), + tr("Filter"), + tr("Max Anisotropy"), + tr("Min LOD"), + tr("Max LOD"), + tr("Mip Bias"), + }, + rows); } { @@ -2829,7 +2863,9 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe m_Common.exportHTMLTable(xml, { - tr("Slot"), tr("Interface Name"), tr("Instance Name"), + tr("Slot"), + tr("Interface Name"), + tr("Instance Name"), }, rows); } @@ -2885,13 +2921,13 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe xml.writeEndElement(); m_Common.exportHTMLTable( - xml, {tr("Scissor Enable"), tr("Line AA Enable"), tr("Multisample Enable"), - tr("Forced Sample Count"), tr("Conservative Raster")}, + xml, + {tr("Scissor Enable"), tr("Line AA Enable"), tr("Multisample Enable"), + tr("Forced Sample Count"), tr("Conservative Raster")}, {rs.state.scissorEnable ? tr("Yes") : tr("No"), rs.state.antialiasedLines ? tr("Yes") : tr("No"), rs.state.multisampleEnable ? tr("Yes") : tr("No"), rs.state.forcedSampleCount, - rs.state.conservativeRasterization != ConservativeRaster::Disabled ? tr("Yes") - : tr("No")}); + rs.state.conservativeRasterization != ConservativeRaster::Disabled ? tr("Yes") : tr("No")}); xml.writeStartElement(lit("p")); xml.writeEndElement(); @@ -2919,8 +2955,9 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe i++; } - m_Common.exportHTMLTable(xml, {tr("Slot"), tr("X"), tr("Y"), tr("Width"), tr("Height"), - tr("Min Depth"), tr("Max Depth"), tr("Enabled")}, + m_Common.exportHTMLTable(xml, + {tr("Slot"), tr("X"), tr("Y"), tr("Width"), tr("Height"), + tr("Min Depth"), tr("Max Depth"), tr("Enabled")}, rows); } @@ -2957,12 +2994,14 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe .arg(om.blendState.blendFactor[2], 0, 'f', 2) .arg(om.blendState.blendFactor[3], 0, 'f', 2); - m_Common.exportHTMLTable(xml, {tr("Independent Blend Enable"), tr("Alpha to Coverage"), - tr("Sample Mask"), tr("Blend Factor")}, + m_Common.exportHTMLTable(xml, + {tr("Independent Blend Enable"), tr("Alpha to Coverage"), + tr("Sample Mask"), tr("Blend Factor")}, { om.blendState.independentBlend ? tr("Yes") : tr("No"), om.blendState.alphaToCoverage ? tr("Yes") : tr("No"), - Formatter::Format(om.blendState.sampleMask, true), blendFactor, + Formatter::Format(om.blendState.sampleMask, true), + blendFactor, }); xml.writeStartElement(lit("h3")); @@ -2992,15 +3031,21 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe i++; } - m_Common.exportHTMLTable( - xml, - { - tr("Slot"), tr("Blend Enable"), tr("Logic Enable"), tr("Blend Source"), - tr("Blend Destination"), tr("Blend Operation"), tr("Alpha Blend Source"), - tr("Alpha Blend Destination"), tr("Alpha Blend Operation"), tr("Logic Operation"), - tr("Write Mask"), - }, - rows); + m_Common.exportHTMLTable(xml, + { + tr("Slot"), + tr("Blend Enable"), + tr("Logic Enable"), + tr("Blend Source"), + tr("Blend Destination"), + tr("Blend Operation"), + tr("Alpha Blend Source"), + tr("Alpha Blend Destination"), + tr("Alpha Blend Operation"), + tr("Logic Operation"), + tr("Write Mask"), + }, + rows); } { @@ -3029,8 +3074,9 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe xml.writeStartElement(lit("p")); xml.writeEndElement(); - m_Common.exportHTMLTable(xml, {tr("Face"), tr("Function"), tr("Pass Operation"), - tr("Fail Operation"), tr("Depth Fail Operation")}, + m_Common.exportHTMLTable(xml, + {tr("Face"), tr("Function"), tr("Pass Operation"), + tr("Fail Operation"), tr("Depth Fail Operation")}, { {tr("Front"), ToQStr(om.depthStencilState.frontFace.function), ToQStr(om.depthStencilState.frontFace.passOperation), @@ -3060,9 +3106,17 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe m_Common.exportHTMLTable(xml, { - tr("Slot"), tr("Name"), tr("View Type"), tr("Resource Type"), - tr("Width"), tr("Height"), tr("Depth"), tr("Array Size"), - tr("View Format"), tr("Resource Format"), tr("View Parameters"), + tr("Slot"), + tr("Name"), + tr("View Type"), + tr("Resource Type"), + tr("Width"), + tr("Height"), + tr("Depth"), + tr("Array Size"), + tr("View Format"), + tr("Resource Format"), + tr("View Parameters"), }, rows); } @@ -3092,9 +3146,17 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe m_Common.exportHTMLTable(xml, { - tr("Slot"), tr("Name"), tr("View Type"), tr("Resource Type"), - tr("Width"), tr("Height"), tr("Depth"), tr("Array Size"), - tr("View Format"), tr("Resource Format"), tr("View Parameters"), + tr("Slot"), + tr("Name"), + tr("View Type"), + tr("Resource Type"), + tr("Width"), + tr("Height"), + tr("Depth"), + tr("Array Size"), + tr("View Format"), + tr("Resource Format"), + tr("View Parameters"), }, rows); } @@ -3119,9 +3181,17 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe m_Common.exportHTMLTable(xml, { - tr("Slot"), tr("Name"), tr("View Type"), tr("Resource Type"), - tr("Width"), tr("Height"), tr("Depth"), tr("Array Size"), - tr("View Format"), tr("Resource Format"), tr("View Parameters"), + tr("Slot"), + tr("Name"), + tr("View Type"), + tr("Resource Type"), + tr("Width"), + tr("Height"), + tr("Depth"), + tr("Array Size"), + tr("View Format"), + tr("Resource Format"), + tr("View Parameters"), }, rows); } diff --git a/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp index 0a2d50254..6eee80584 100644 --- a/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp @@ -250,9 +250,8 @@ D3D12PipelineStateViewer::D3D12PipelineStateViewer(ICaptureContext &ctx, RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); ui->iaLayouts->setHeader(header); - ui->iaLayouts->setColumns({tr("Slot"), tr("Semantic"), tr("Index"), tr("Format"), - tr("Input Slot"), tr("Offset"), tr("Class"), tr("Step Rate"), - tr("Go")}); + ui->iaLayouts->setColumns({tr("Slot"), tr("Semantic"), tr("Index"), tr("Format"), tr("Input Slot"), + tr("Offset"), tr("Class"), tr("Step Rate"), tr("Go")}); header->setColumnStretchHints({1, 4, 2, 3, 2, 2, 1, 1, -1}); ui->iaLayouts->setClearSelectionOnFocusLoss(true); @@ -393,9 +392,8 @@ D3D12PipelineStateViewer::D3D12PipelineStateViewer(ICaptureContext &ctx, RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); ui->targetOutputs->setHeader(header); - ui->targetOutputs->setColumns({tr("Slot"), tr("Resource"), tr("Type"), tr("Width"), - tr("Height"), tr("Depth"), tr("Array Size"), tr("Format"), - tr("Go")}); + ui->targetOutputs->setColumns({tr("Slot"), tr("Resource"), tr("Type"), tr("Width"), tr("Height"), + tr("Depth"), tr("Array Size"), tr("Format"), tr("Go")}); header->setColumnStretchHints({2, 4, 2, 1, 1, 1, 1, 3, -1}); ui->targetOutputs->setHoverIconColumn(8, action, action_hover); @@ -440,12 +438,25 @@ D3D12PipelineStateViewer::D3D12PipelineStateViewer(ICaptureContext &ctx, ui->pipeFlow->setStages( { - lit("IA"), lit("VS"), lit("HS"), lit("DS"), lit("GS"), lit("RS"), lit("PS"), lit("OM"), + lit("IA"), + lit("VS"), + lit("HS"), + lit("DS"), + lit("GS"), + lit("RS"), + lit("PS"), + lit("OM"), lit("CS"), }, { - tr("Input Assembler"), tr("Vertex Shader"), tr("Hull Shader"), tr("Domain Shader"), - tr("Geometry Shader"), tr("Rasterizer"), tr("Pixel Shader"), tr("Output Merger"), + tr("Input Assembler"), + tr("Vertex Shader"), + tr("Hull Shader"), + tr("Domain Shader"), + tr("Geometry Shader"), + tr("Rasterizer"), + tr("Pixel Shader"), + tr("Output Merger"), tr("Compute Shader"), }); @@ -2087,11 +2098,14 @@ void D3D12PipelineStateViewer::setState() if(state.outputMerger.depthStencilState.stencilEnable) { ui->stencils->addTopLevelItem(new RDTreeWidgetItem({ - tr("Front"), ToQStr(state.outputMerger.depthStencilState.frontFace.function), + tr("Front"), + ToQStr(state.outputMerger.depthStencilState.frontFace.function), ToQStr(state.outputMerger.depthStencilState.frontFace.failOperation), ToQStr(state.outputMerger.depthStencilState.frontFace.depthFailOperation), - ToQStr(state.outputMerger.depthStencilState.frontFace.passOperation), QVariant(), - QVariant(), QVariant(), + ToQStr(state.outputMerger.depthStencilState.frontFace.passOperation), + QVariant(), + QVariant(), + QVariant(), })); m_Common.SetStencilTreeItemValue(ui->stencils->topLevelItem(0), 5, @@ -2102,10 +2116,13 @@ void D3D12PipelineStateViewer::setState() state.outputMerger.depthStencilState.frontFace.reference); ui->stencils->addTopLevelItem(new RDTreeWidgetItem({ - tr("Back"), ToQStr(state.outputMerger.depthStencilState.backFace.function), + tr("Back"), + ToQStr(state.outputMerger.depthStencilState.backFace.function), ToQStr(state.outputMerger.depthStencilState.backFace.failOperation), ToQStr(state.outputMerger.depthStencilState.backFace.depthFailOperation), - ToQStr(state.outputMerger.depthStencilState.backFace.passOperation), QVariant(), QVariant(), + ToQStr(state.outputMerger.depthStencilState.backFace.passOperation), + QVariant(), + QVariant(), QVariant(), })); @@ -2693,8 +2710,9 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe } m_Common.exportHTMLTable( - xml, {tr("Slot"), tr("Semantic Name"), tr("Semantic Index"), tr("Format"), tr("Input Slot"), - tr("Byte Offset"), tr("Per Instance"), tr("Instance Data Step Rate")}, + xml, + {tr("Slot"), tr("Semantic Name"), tr("Semantic Index"), tr("Format"), tr("Input Slot"), + tr("Byte Offset"), tr("Per Instance"), tr("Instance Data Step Rate")}, rows); } @@ -3122,9 +3140,10 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe xml.writeEndElement(); m_Common.exportHTMLTable( - xml, {tr("Root Sig El"), tr("Space"), tr("Register"), tr("Resource"), tr("View Type"), - tr("Resource Type"), tr("Width"), tr("Height"), tr("Depth"), tr("Array Size"), - tr("View Format"), tr("Resource Format"), tr("View Parameters")}, + xml, + {tr("Root Sig El"), tr("Space"), tr("Register"), tr("Resource"), tr("View Type"), + tr("Resource Type"), tr("Width"), tr("Height"), tr("Depth"), tr("Array Size"), + tr("View Format"), tr("Resource Format"), tr("View Parameters")}, rowsRO); xml.writeStartElement(lit("h3")); @@ -3132,17 +3151,19 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe xml.writeEndElement(); m_Common.exportHTMLTable( - xml, {tr("Root Sig El"), tr("Space"), tr("Register"), tr("Resource"), tr("View Type"), - tr("Resource Type"), tr("Width"), tr("Height"), tr("Depth"), tr("Array Size"), - tr("View Format"), tr("Resource Format"), tr("View Parameters")}, + xml, + {tr("Root Sig El"), tr("Space"), tr("Register"), tr("Resource"), tr("View Type"), + tr("Resource Type"), tr("Width"), tr("Height"), tr("Depth"), tr("Array Size"), + tr("View Format"), tr("Resource Format"), tr("View Parameters")}, rowsRW); xml.writeStartElement(lit("h3")); xml.writeCharacters(tr("Samplers")); xml.writeEndElement(); - m_Common.exportHTMLTable(xml, {tr("Root Sig El"), tr("Space"), tr("Register"), tr("Addressing"), - tr("Filter"), tr("LOD Clamp"), tr("LOD Bias")}, + m_Common.exportHTMLTable(xml, + {tr("Root Sig El"), tr("Space"), tr("Register"), tr("Addressing"), + tr("Filter"), tr("LOD Clamp"), tr("LOD Bias")}, rowsSampler); xml.writeStartElement(lit("h3")); @@ -3202,10 +3223,10 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe i++; } - m_Common.exportHTMLTable( - xml, {tr("Slot"), tr("Buffer"), tr("Offset"), tr("Byte Length"), tr("Counter Buffer"), - tr("Counter Offset"), tr("Counter Byte Length")}, - rows); + m_Common.exportHTMLTable(xml, + {tr("Slot"), tr("Buffer"), tr("Offset"), tr("Byte Length"), + tr("Counter Buffer"), tr("Counter Offset"), tr("Counter Byte Length")}, + rows); } } @@ -3224,8 +3245,9 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe xml.writeEndElement(); m_Common.exportHTMLTable( - xml, {tr("Line Rasteriztion"), tr("Forced Sample Count"), tr("Conservative Raster"), - tr("Sample Mask")}, + xml, + {tr("Line Rasteriztion"), tr("Forced Sample Count"), tr("Conservative Raster"), + tr("Sample Mask")}, {ToQStr(rs.state.lineRasterMode), rs.state.forcedSampleCount, rs.state.conservativeRasterization != ConservativeRaster::Disabled ? tr("Yes") : tr("No"), Formatter::Format(rs.sampleMask, true)}); @@ -3255,9 +3277,10 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe i++; } - m_Common.exportHTMLTable(xml, {tr("Slot"), tr("X"), tr("Y"), tr("Width"), tr("Height"), - tr("Min Depth"), tr("Max Depth")}, - rows); + m_Common.exportHTMLTable( + xml, + {tr("Slot"), tr("X"), tr("Y"), tr("Width"), tr("Height"), tr("Min Depth"), tr("Max Depth")}, + rows); } { @@ -3292,8 +3315,9 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe .arg(om.blendState.blendFactor[2], 0, 'f', 2) .arg(om.blendState.blendFactor[3], 0, 'f', 2); - m_Common.exportHTMLTable(xml, {tr("Independent Blend Enable"), tr("Alpha to Coverage"), - tr("Blend Factor"), tr("Multisampling Rate")}, + m_Common.exportHTMLTable(xml, + {tr("Independent Blend Enable"), tr("Alpha to Coverage"), + tr("Blend Factor"), tr("Multisampling Rate")}, {om.blendState.independentBlend ? tr("Yes") : tr("No"), om.blendState.alphaToCoverage ? tr("Yes") : tr("No"), blendFactor, tr("%1x %2 qual").arg(om.multiSampleCount).arg(om.multiSampleQuality)}); @@ -3325,15 +3349,21 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe i++; } - m_Common.exportHTMLTable( - xml, - { - tr("Slot"), tr("Blend Enable"), tr("Logic Enable"), tr("Blend Source"), - tr("Blend Destination"), tr("Blend Operation"), tr("Alpha Blend Source"), - tr("Alpha Blend Destination"), tr("Alpha Blend Operation"), tr("Logic Operation"), - tr("Write Mask"), - }, - rows); + m_Common.exportHTMLTable(xml, + { + tr("Slot"), + tr("Blend Enable"), + tr("Logic Enable"), + tr("Blend Source"), + tr("Blend Destination"), + tr("Blend Operation"), + tr("Alpha Blend Source"), + tr("Alpha Blend Destination"), + tr("Alpha Blend Operation"), + tr("Logic Operation"), + tr("Write Mask"), + }, + rows); } { @@ -3344,7 +3374,9 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe m_Common.exportHTMLTable( xml, { - tr("Depth Test Enable"), tr("Depth Writes Enable"), tr("Depth Function"), + tr("Depth Test Enable"), + tr("Depth Writes Enable"), + tr("Depth Function"), tr("Depth Bounds"), }, { @@ -3369,7 +3401,8 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe QList rows; rows.push_back({ - tr("Front"), Formatter::Format(om.depthStencilState.frontFace.reference, true), + tr("Front"), + Formatter::Format(om.depthStencilState.frontFace.reference, true), Formatter::Format(om.depthStencilState.frontFace.compareMask, true), Formatter::Format(om.depthStencilState.frontFace.writeMask, true), ToQStr(om.depthStencilState.frontFace.function), @@ -3379,7 +3412,8 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe }); rows.push_back({ - tr("back"), Formatter::Format(om.depthStencilState.backFace.reference, true), + tr("back"), + Formatter::Format(om.depthStencilState.backFace.reference, true), Formatter::Format(om.depthStencilState.backFace.compareMask, true), Formatter::Format(om.depthStencilState.backFace.writeMask, true), ToQStr(om.depthStencilState.backFace.function), @@ -3421,9 +3455,17 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe m_Common.exportHTMLTable(xml, { - tr("Slot"), tr("Name"), tr("View Type"), tr("Resource Type"), - tr("Width"), tr("Height"), tr("Depth"), tr("Array Size"), - tr("View Format"), tr("Resource Format"), tr("View Parameters"), + tr("Slot"), + tr("Name"), + tr("View Type"), + tr("Resource Type"), + tr("Width"), + tr("Height"), + tr("Depth"), + tr("Array Size"), + tr("View Format"), + tr("Resource Format"), + tr("View Parameters"), }, rows); } @@ -3444,9 +3486,16 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe m_Common.exportHTMLTable(xml, { - tr("Name"), tr("View Type"), tr("Resource Type"), tr("Width"), - tr("Height"), tr("Depth"), tr("Array Size"), tr("View Format"), - tr("Resource Format"), tr("View Parameters"), + tr("Name"), + tr("View Type"), + tr("Resource Type"), + tr("Width"), + tr("Height"), + tr("Depth"), + tr("Array Size"), + tr("View Format"), + tr("Resource Format"), + tr("View Parameters"), }, {exportViewHTML(om.depthTarget, false, NULL, extra)}); } diff --git a/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp index 7cd143c8e..ef9f29756 100644 --- a/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp @@ -293,8 +293,7 @@ GLPipelineStateViewer::GLPipelineStateViewer(ICaptureContext &ctx, PipelineState RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); ui->xfbBuffers->setHeader(header); - ui->xfbBuffers->setColumns( - {tr("Slot"), tr("Buffer"), tr("Byte Length"), tr("Offset"), tr("Go")}); + ui->xfbBuffers->setColumns({tr("Slot"), tr("Buffer"), tr("Byte Length"), tr("Offset"), tr("Go")}); header->setColumnStretchHints({1, 4, 3, 2, -1}); header->setMinimumSectionSize(40); @@ -323,8 +322,7 @@ GLPipelineStateViewer::GLPipelineStateViewer(ICaptureContext &ctx, PipelineState RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this); ui->scissors->setHeader(header); - ui->scissors->setColumns( - {tr("Slot"), tr("X"), tr("Y"), tr("Width"), tr("Height"), tr("Enabled")}); + ui->scissors->setColumns({tr("Slot"), tr("X"), tr("Y"), tr("Width"), tr("Height"), tr("Enabled")}); header->setColumnStretchHints({-1, -1, -1, -1, -1, 1}); header->setMinimumSectionSize(40); @@ -378,13 +376,26 @@ GLPipelineStateViewer::GLPipelineStateViewer(ICaptureContext &ctx, PipelineState ui->pipeFlow->setStages( { - lit("VTX"), lit("VS"), lit("TCS"), lit("TES"), lit("GS"), lit("RS"), lit("FS"), lit("FB"), + lit("VTX"), + lit("VS"), + lit("TCS"), + lit("TES"), + lit("GS"), + lit("RS"), + lit("FS"), + lit("FB"), lit("CS"), }, { - tr("Vertex Input"), tr("Vertex Shader"), tr("Tess. Control Shader"), - tr("Tess. Eval. Shader"), tr("Geometry Shader"), tr("Rasterizer"), tr("Fragment Shader"), - tr("Framebuffer Output"), tr("Compute Shader"), + tr("Vertex Input"), + tr("Vertex Shader"), + tr("Tess. Control Shader"), + tr("Tess. Eval. Shader"), + tr("Geometry Shader"), + tr("Rasterizer"), + tr("Fragment Shader"), + tr("Framebuffer Output"), + tr("Compute Shader"), }); ui->pipeFlow->setIsolatedStage(8); // compute shader isolated @@ -949,10 +960,13 @@ void GLPipelineStateViewer::setShaderState(const GLPipe::Shader &stage, RDLabel filter += QFormatStr(" (%1)").arg(ToQStr(s.filter.filter)); RDTreeWidgetItem *node = new RDTreeWidgetItem({ - slotname, s.resourceId != ResourceId() ? s.resourceId : r.resourceId, addressing, - filter, QFormatStr("%1 - %2") - .arg(s.minLOD == -FLT_MAX ? lit("0") : QString::number(s.minLOD)) - .arg(s.maxLOD == FLT_MAX ? lit("FLT_MAX") : QString::number(s.maxLOD)), + slotname, + s.resourceId != ResourceId() ? s.resourceId : r.resourceId, + addressing, + filter, + QFormatStr("%1 - %2") + .arg(s.minLOD == -FLT_MAX ? lit("0") : QString::number(s.minLOD)) + .arg(s.maxLOD == FLT_MAX ? lit("FLT_MAX") : QString::number(s.maxLOD)), s.mipLODBias, }); @@ -1176,12 +1190,10 @@ void GLPipelineStateViewer::setShaderState(const GLPipe::Shader &stage, RDLabel if(showNode(usedSlot, filledSlot)) { - QString binding = - readWriteType == GLReadWriteType::Image - ? tr("Image") - : readWriteType == GLReadWriteType::Atomic - ? tr("Atomic") - : readWriteType == GLReadWriteType::SSBO ? tr("SSBO") : tr("Unknown"); + QString binding = readWriteType == GLReadWriteType::Image ? tr("Image") + : readWriteType == GLReadWriteType::Atomic ? tr("Atomic") + : readWriteType == GLReadWriteType::SSBO ? tr("SSBO") + : tr("Unknown"); QString slotname = QFormatStr("%1: %2").arg(bindPoint).arg(res.name); QString dimensions; @@ -1759,8 +1771,8 @@ void GLPipelineStateViewer::setState() else indexstring = QString::number(prev); - RDTreeWidgetItem *node = new RDTreeWidgetItem({indexstring, s1.x, s1.y, s1.width, s1.height, - s1.enabled ? tr("True") : tr("False")}); + RDTreeWidgetItem *node = new RDTreeWidgetItem( + {indexstring, s1.x, s1.y, s1.width, s1.height, s1.enabled ? tr("True") : tr("False")}); if(s1.width == 0 || s1.height == 0) setEmptyRow(node); @@ -2243,10 +2255,14 @@ void GLPipelineStateViewer::setState() if(state.stencilState.stencilEnable) { ui->stencils->addTopLevelItem(new RDTreeWidgetItem({ - tr("Front"), ToQStr(state.stencilState.frontFace.function), + tr("Front"), + ToQStr(state.stencilState.frontFace.function), ToQStr(state.stencilState.frontFace.failOperation), ToQStr(state.stencilState.frontFace.depthFailOperation), - ToQStr(state.stencilState.frontFace.passOperation), QVariant(), QVariant(), QVariant(), + ToQStr(state.stencilState.frontFace.passOperation), + QVariant(), + QVariant(), + QVariant(), })); m_Common.SetStencilTreeItemValue(ui->stencils->topLevelItem(0), 5, @@ -2596,8 +2612,9 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Vert i++; } - m_Common.exportHTMLTable(xml, {tr("Slot"), tr("Enabled"), tr("Vertex Buffer Slot"), - tr("Format"), tr("Relative Offset"), tr("Generic Value")}, + m_Common.exportHTMLTable(xml, + {tr("Slot"), tr("Enabled"), tr("Vertex Buffer Slot"), tr("Format"), + tr("Relative Offset"), tr("Generic Value")}, rows); } @@ -2630,8 +2647,9 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Vert i++; } - m_Common.exportHTMLTable(xml, {tr("Slot"), tr("Buffer"), tr("Stride"), tr("Offset"), - tr("Instance Divisor"), tr("Byte Length")}, + m_Common.exportHTMLTable(xml, + {tr("Slot"), tr("Buffer"), tr("Stride"), tr("Offset"), + tr("Instance Divisor"), tr("Byte Length")}, rows); } @@ -2704,29 +2722,30 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Vert m_Common.exportHTMLTable(xml, { - tr("User Clip Plane"), tr("Enabled"), + tr("User Clip Plane"), + tr("Enabled"), }, clipPlaneRows); xml.writeStartElement(tr("p")); xml.writeEndElement(); - m_Common.exportHTMLTable( - xml, - { - tr("Default Inner Tessellation Level"), tr("Default Outer Tessellation level"), - }, - { - QFormatStr("%1, %2") - .arg(pipe.vertexProcessing.defaultInnerLevel[0]) - .arg(pipe.vertexProcessing.defaultInnerLevel[1]), + m_Common.exportHTMLTable(xml, + { + tr("Default Inner Tessellation Level"), + tr("Default Outer Tessellation level"), + }, + { + QFormatStr("%1, %2") + .arg(pipe.vertexProcessing.defaultInnerLevel[0]) + .arg(pipe.vertexProcessing.defaultInnerLevel[1]), - QFormatStr("%1, %2, %3, %4") - .arg(pipe.vertexProcessing.defaultOuterLevel[0]) - .arg(pipe.vertexProcessing.defaultOuterLevel[1]) - .arg(pipe.vertexProcessing.defaultOuterLevel[2]) - .arg(pipe.vertexProcessing.defaultOuterLevel[3]), - }); + QFormatStr("%1, %2, %3, %4") + .arg(pipe.vertexProcessing.defaultOuterLevel[0]) + .arg(pipe.vertexProcessing.defaultOuterLevel[1]) + .arg(pipe.vertexProcessing.defaultOuterLevel[2]) + .arg(pipe.vertexProcessing.defaultOuterLevel[3]), + }); } } @@ -3047,12 +3066,10 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad // show if { - QString binding = - readWriteType == GLReadWriteType::Image - ? tr("Image") - : readWriteType == GLReadWriteType::Atomic - ? tr("Atomic") - : readWriteType == GLReadWriteType::SSBO ? tr("SSBO") : tr("Unknown"); + QString binding = readWriteType == GLReadWriteType::Image ? tr("Image") + : readWriteType == GLReadWriteType::Atomic ? tr("Atomic") + : readWriteType == GLReadWriteType::SSBO ? tr("SSBO") + : tr("Unknown"); QString slotname = QFormatStr("%1: %2").arg(bindPoint).arg(res.name); QString name = m_Ctx.GetResourceName(id); @@ -3130,8 +3147,9 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad xml.writeEndElement(); m_Common.exportHTMLTable( - xml, {tr("Slot"), tr("Name"), tr("Type"), tr("Width"), tr("Height"), tr("Depth"), - tr("Array Size"), tr("Format"), tr("First Mip"), tr("Num Mips")}, + xml, + {tr("Slot"), tr("Name"), tr("Type"), tr("Width"), tr("Height"), tr("Depth"), + tr("Array Size"), tr("Format"), tr("First Mip"), tr("Num Mips")}, textureRows); } @@ -3167,12 +3185,16 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Shad xml.writeCharacters(tr("Read-write resources")); xml.writeEndElement(); - m_Common.exportHTMLTable( - xml, - { - tr("Binding"), tr("Resource"), tr("Name"), tr("Dimensions"), tr("Format"), tr("Access"), - }, - readwriteRows); + m_Common.exportHTMLTable(xml, + { + tr("Binding"), + tr("Resource"), + tr("Name"), + tr("Dimensions"), + tr("Format"), + tr("Access"), + }, + readwriteRows); } } @@ -3184,9 +3206,8 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Feed xml.writeCharacters(tr("States")); xml.writeEndElement(); - m_Common.exportHTMLTable( - xml, {tr("Active"), tr("Paused")}, - {xfb.active ? tr("Yes") : tr("No"), xfb.paused ? tr("Yes") : tr("No")}); + m_Common.exportHTMLTable(xml, {tr("Active"), tr("Paused")}, + {xfb.active ? tr("Yes") : tr("No"), xfb.paused ? tr("Yes") : tr("No")}); } { @@ -3242,9 +3263,10 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Rast xml.writeEndElement(); m_Common.exportHTMLTable( - xml, {tr("Multisample Enable"), tr("Sample Shading"), tr("Sample Mask"), - tr("Sample Coverage"), tr("Sample Coverage Invert"), tr("Alpha to Coverage"), - tr("Alpha to One"), tr("Min Sample Shading Rate")}, + xml, + {tr("Multisample Enable"), tr("Sample Shading"), tr("Sample Mask"), tr("Sample Coverage"), + tr("Sample Coverage Invert"), tr("Alpha to Coverage"), tr("Alpha to One"), + tr("Min Sample Shading Rate")}, { rs.state.multisampleEnable ? tr("Yes") : tr("No"), rs.state.sampleShading ? tr("Yes") : tr("No"), @@ -3259,18 +3281,21 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Rast xml.writeStartElement(tr("p")); xml.writeEndElement(); - m_Common.exportHTMLTable( - xml, - { - tr("Programmable Point Size"), tr("Fixed Point Size"), tr("Line Width"), - tr("Point Fade Threshold"), tr("Point Origin Upper Left"), - }, - { - rs.state.programmablePointSize ? tr("Yes") : tr("No"), - Formatter::Format(rs.state.pointSize), Formatter::Format(rs.state.lineWidth), - Formatter::Format(rs.state.pointFadeThreshold), - rs.state.pointOriginUpperLeft ? tr("Yes") : tr("No"), - }); + m_Common.exportHTMLTable(xml, + { + tr("Programmable Point Size"), + tr("Fixed Point Size"), + tr("Line Width"), + tr("Point Fade Threshold"), + tr("Point Origin Upper Left"), + }, + { + rs.state.programmablePointSize ? tr("Yes") : tr("No"), + Formatter::Format(rs.state.pointSize), + Formatter::Format(rs.state.lineWidth), + Formatter::Format(rs.state.pointFadeThreshold), + rs.state.pointOriginUpperLeft ? tr("Yes") : tr("No"), + }); xml.writeStartElement(tr("p")); xml.writeEndElement(); @@ -3289,7 +3314,10 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Rast m_Common.exportHTMLTable( xml, { - tr("Derivatives"), tr("Line Smooth"), tr("Poly Smooth"), tr("Tex Compression"), + tr("Derivatives"), + tr("Line Smooth"), + tr("Poly Smooth"), + tr("Tex Compression"), }, { ToQStr(pipe.hints.derivatives), @@ -3314,9 +3342,10 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Rast i++; } - m_Common.exportHTMLTable(xml, {tr("Slot"), tr("X"), tr("Y"), tr("Width"), tr("Height"), - tr("Min Depth"), tr("Max Depth")}, - rows); + m_Common.exportHTMLTable( + xml, + {tr("Slot"), tr("X"), tr("Y"), tr("Width"), tr("Height"), tr("Min Depth"), tr("Max Depth")}, + rows); } { @@ -3355,7 +3384,8 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Fram m_Common.exportHTMLTable(xml, {tr("Framebuffer SRGB"), tr("Blend Factor")}, { - fb.framebufferSRGB ? tr("Yes") : tr("No"), blendFactor, + fb.framebufferSRGB ? tr("Yes") : tr("No"), + blendFactor, }); xml.writeStartElement(tr("h3")); @@ -3383,15 +3413,21 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Fram i++; } - m_Common.exportHTMLTable( - xml, - { - tr("Slot"), tr("Blend Enable"), tr("Blend Source"), tr("Blend Destination"), - tr("Blend Operation"), tr("Alpha Blend Source"), tr("Alpha Blend Destination"), - tr("Alpha Blend Operation"), tr("Logic Operation Enabled"), tr("Logic Operation"), - tr("Write Mask"), - }, - rows); + m_Common.exportHTMLTable(xml, + { + tr("Slot"), + tr("Blend Enable"), + tr("Blend Source"), + tr("Blend Destination"), + tr("Blend Operation"), + tr("Alpha Blend Source"), + tr("Alpha Blend Destination"), + tr("Alpha Blend Operation"), + tr("Logic Operation Enabled"), + tr("Logic Operation"), + tr("Write Mask"), + }, + rows); } { @@ -3399,18 +3435,18 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Fram xml.writeCharacters(tr("Depth State")); xml.writeEndElement(); - m_Common.exportHTMLTable(xml, {tr("Depth Test Enable"), tr("Depth Writes Enable"), - tr("Depth Function"), tr("Depth Bounds")}, - { - pipe.depthState.depthEnable ? tr("Yes") : tr("No"), - pipe.depthState.depthWrites ? tr("Yes") : tr("No"), - ToQStr(pipe.depthState.depthFunction), - pipe.depthState.depthEnable - ? QFormatStr("%1 - %2") - .arg(Formatter::Format(pipe.depthState.nearBound)) - .arg(Formatter::Format(pipe.depthState.farBound)) - : tr("Disabled"), - }); + m_Common.exportHTMLTable( + xml, + {tr("Depth Test Enable"), tr("Depth Writes Enable"), tr("Depth Function"), tr("Depth Bounds")}, + { + pipe.depthState.depthEnable ? tr("Yes") : tr("No"), + pipe.depthState.depthWrites ? tr("Yes") : tr("No"), + ToQStr(pipe.depthState.depthFunction), + pipe.depthState.depthEnable ? QFormatStr("%1 - %2") + .arg(Formatter::Format(pipe.depthState.nearBound)) + .arg(Formatter::Format(pipe.depthState.farBound)) + : tr("Disabled"), + }); } { @@ -3425,8 +3461,9 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Fram xml.writeEndElement(); m_Common.exportHTMLTable( - xml, {tr("Face"), tr("Reference"), tr("Value Mask"), tr("Write Mask"), tr("Function"), - tr("Pass Operation"), tr("Fail Operation"), tr("Depth Fail Operation")}, + xml, + {tr("Face"), tr("Reference"), tr("Value Mask"), tr("Write Mask"), tr("Function"), + tr("Pass Operation"), tr("Fail Operation"), tr("Depth Fail Operation")}, { {tr("Front"), Formatter::Format(pipe.stencilState.frontFace.reference, true), Formatter::Format(pipe.stencilState.frontFace.compareMask, true), @@ -3485,7 +3522,10 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Fram m_Common.exportHTMLTable(xml, { - tr("Slot"), tr("Image"), tr("First mip"), tr("First array slice"), + tr("Slot"), + tr("Image"), + tr("First mip"), + tr("First array slice"), }, rows); @@ -3543,7 +3583,10 @@ void GLPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const GLPipe::Fram m_Common.exportHTMLTable(xml, { - tr("Slot"), tr("Image"), tr("First mip"), tr("First array slice"), + tr("Slot"), + tr("Image"), + tr("First mip"), + tr("First array slice"), }, rows); diff --git a/qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp index f561303e6..82b9ba3b4 100644 --- a/qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp @@ -1122,47 +1122,47 @@ void PipelineStateViewer::SetupShaderEditButton(QToolButton *button, ResourceId QAction *action = new QAction(label, menu); action->setIcon(Icons::page_white_edit()); - QObject::connect(action, &QAction::triggered, [this, pipelineId, shaderId, bindpointMapping, - shaderDetails]() { - QString entry; - QString src; + QObject::connect( + action, &QAction::triggered, [this, pipelineId, shaderId, bindpointMapping, shaderDetails]() { + QString entry; + QString src; - if(shaderDetails->encoding == ShaderEncoding::SPIRV || - shaderDetails->encoding == ShaderEncoding::OpenGLSPIRV) - { - m_Ctx.Replay().AsyncInvoke([this, pipelineId, shaderId, shaderDetails](IReplayController *r) { - rdcstr disasm = r->DisassembleShader(pipelineId, shaderDetails, ""); + if(shaderDetails->encoding == ShaderEncoding::SPIRV || + shaderDetails->encoding == ShaderEncoding::OpenGLSPIRV) + { + m_Ctx.Replay().AsyncInvoke( + [this, pipelineId, shaderId, shaderDetails](IReplayController *r) { + rdcstr disasm = r->DisassembleShader(pipelineId, shaderDetails, ""); - QString editeddisasm = - tr("#### PSEUDOCODE SPIR-V DISASSEMBLY ###\n") + - tr("#### Use a SPIR-V decompiler to get compileable source ###\n\n"); + QString editeddisasm = + tr("#### PSEUDOCODE SPIR-V DISASSEMBLY ###\n") + + tr("#### Use a SPIR-V decompiler to get compileable source ###\n\n"); - editeddisasm += disasm; + editeddisasm += disasm; + + GUIInvoke::call(this, [this, shaderId, shaderDetails, editeddisasm]() { + rdcstrpairs files; + files.push_back(rdcpair("pseudocode", editeddisasm)); + + EditShader(shaderId, shaderDetails->stage, shaderDetails->entryPoint, + shaderDetails->debugInfo.compileFlags, KnownShaderTool::Unknown, + ShaderEncoding::Unknown, files); + }); + }); + } + else if(shaderDetails->encoding == ShaderEncoding::DXBC || + shaderDetails->encoding == ShaderEncoding::DXIL) + { + entry = lit("EditedShader%1S").arg(ToQStr(shaderDetails->stage, GraphicsAPI::D3D11)[0]); - GUIInvoke::call(this, [this, shaderId, shaderDetails, editeddisasm]() { rdcstrpairs files; - files.push_back(rdcpair("pseudocode", editeddisasm)); + files.push_back(rdcpair( + "decompiled_stub.hlsl", GenerateHLSLStub(bindpointMapping, shaderDetails, entry))); - EditShader(shaderId, shaderDetails->stage, shaderDetails->entryPoint, - shaderDetails->debugInfo.compileFlags, KnownShaderTool::Unknown, - ShaderEncoding::Unknown, files); - }); + EditShader(shaderId, shaderDetails->stage, entry, shaderDetails->debugInfo.compileFlags, + KnownShaderTool::Unknown, ShaderEncoding::HLSL, files); + } }); - } - else if(shaderDetails->encoding == ShaderEncoding::DXBC || - shaderDetails->encoding == ShaderEncoding::DXIL) - { - entry = lit("EditedShader%1S").arg(ToQStr(shaderDetails->stage, GraphicsAPI::D3D11)[0]); - - rdcstrpairs files; - files.push_back(rdcpair( - "decompiled_stub.hlsl", GenerateHLSLStub(bindpointMapping, shaderDetails, entry))); - - EditShader(shaderId, shaderDetails->stage, entry, shaderDetails->debugInfo.compileFlags, - KnownShaderTool::Unknown, ShaderEncoding::HLSL, files); - } - - }); menu->addAction(action); } diff --git a/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp index af5edd1f6..afdd54188 100644 --- a/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp @@ -176,7 +176,8 @@ VulkanPipelineStateViewer::VulkanPipelineStateViewer(ICaptureContext &ctx, }; QToolButton *viewPredicateBufferButtons[] = { - ui->predicateBufferViewButton, ui->csPredicateBufferViewButton, + ui->predicateBufferViewButton, + ui->csPredicateBufferViewButton, }; RDTreeWidget *resources[] = { @@ -441,13 +442,26 @@ VulkanPipelineStateViewer::VulkanPipelineStateViewer(ICaptureContext &ctx, ui->pipeFlow->setStages( { - lit("VTX"), lit("VS"), lit("TCS"), lit("TES"), lit("GS"), lit("RS"), lit("FS"), lit("FB"), + lit("VTX"), + lit("VS"), + lit("TCS"), + lit("TES"), + lit("GS"), + lit("RS"), + lit("FS"), + lit("FB"), lit("CS"), }, { - tr("Vertex Input"), tr("Vertex Shader"), tr("Tess. Control Shader"), - tr("Tess. Eval. Shader"), tr("Geometry Shader"), tr("Rasterizer"), tr("Fragment Shader"), - tr("Framebuffer Output"), tr("Compute Shader"), + tr("Vertex Input"), + tr("Vertex Shader"), + tr("Tess. Control Shader"), + tr("Tess. Eval. Shader"), + tr("Geometry Shader"), + tr("Rasterizer"), + tr("Fragment Shader"), + tr("Framebuffer Output"), + tr("Compute Shader"), }); ui->pipeFlow->setIsolatedStage(8); // compute shader isolated @@ -1408,7 +1422,13 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, if(!isbuf) { node = new RDTreeWidgetItem({ - QString(), setname, slotname, ToQStr(bindType), ResourceId(), lit("-"), QString(), + QString(), + setname, + slotname, + ToQStr(bindType), + ResourceId(), + lit("-"), + QString(), QString(), }); @@ -1420,10 +1440,14 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, else { node = new RDTreeWidgetItem({ - QString(), setname, slotname, ToQStr(bindType), + QString(), + setname, + slotname, + ToQStr(bindType), descriptorBind ? descriptorBind->resourceResourceId : ResourceId(), tr("%1 bytes").arg(len), - QFormatStr("Viewing bytes %1").arg(formatByteRange(buf, descriptorBind)), QString(), + QFormatStr("Viewing bytes %1").arg(formatByteRange(buf, descriptorBind)), + QString(), }); node->setTag(tag); @@ -1438,9 +1462,14 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, else if(bindType == BindType::ReadOnlyTBuffer || bindType == BindType::ReadWriteTBuffer) { node = new RDTreeWidgetItem({ - QString(), setname, slotname, ToQStr(bindType), - descriptorBind ? descriptorBind->resourceResourceId : ResourceId(), format, - QFormatStr("bytes %1").arg(formatByteRange(buf, descriptorBind)), QString(), + QString(), + setname, + slotname, + ToQStr(bindType), + descriptorBind ? descriptorBind->resourceResourceId : ResourceId(), + format, + QFormatStr("bytes %1").arg(formatByteRange(buf, descriptorBind)), + QString(), }); node->setTag(tag); @@ -1456,7 +1485,13 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, if(descriptorBind == NULL || descriptorBind->samplerResourceId == ResourceId()) { node = new RDTreeWidgetItem({ - QString(), setname, slotname, ToQStr(bindType), ResourceId(), lit("-"), QString(), + QString(), + setname, + slotname, + ToQStr(bindType), + ResourceId(), + lit("-"), + QString(), QString(), }); @@ -1481,7 +1516,13 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, if(descriptorBind == NULL || descriptorBind->resourceResourceId == ResourceId()) { node = new RDTreeWidgetItem({ - QString(), setname, slotname, ToQStr(bindType), ResourceId(), lit("-"), QString(), + QString(), + setname, + slotname, + ToQStr(bindType), + ResourceId(), + lit("-"), + QString(), QString(), }); @@ -1525,8 +1566,14 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, dim += QFormatStr(", %1x MSAA").arg(samples); node = new RDTreeWidgetItem({ - QString(), setname, slotname, typeName, descriptorBind->resourceResourceId, dim, - format, QString(), + QString(), + setname, + slotname, + typeName, + descriptorBind->resourceResourceId, + dim, + format, + QString(), }); node->setTag(tag); @@ -1542,7 +1589,13 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails, if(descriptorBind == NULL || descriptorBind->samplerResourceId == ResourceId()) { samplerNode = new RDTreeWidgetItem({ - QString(), setname, slotname, ToQStr(bindType), ResourceId(), lit("-"), QString(), + QString(), + setname, + slotname, + ToQStr(bindType), + ResourceId(), + lit("-"), + QString(), QString(), }); @@ -3037,10 +3090,14 @@ void VulkanPipelineStateViewer::setState() if(state.depthStencil.stencilTestEnable) { ui->stencils->addTopLevelItem(new RDTreeWidgetItem({ - tr("Front"), ToQStr(state.depthStencil.frontFace.function), + tr("Front"), + ToQStr(state.depthStencil.frontFace.function), ToQStr(state.depthStencil.frontFace.failOperation), ToQStr(state.depthStencil.frontFace.depthFailOperation), - ToQStr(state.depthStencil.frontFace.passOperation), QVariant(), QVariant(), QVariant(), + ToQStr(state.depthStencil.frontFace.passOperation), + QVariant(), + QVariant(), + QVariant(), })); m_Common.SetStencilTreeItemValue(ui->stencils->topLevelItem(0), 5, @@ -3051,10 +3108,14 @@ void VulkanPipelineStateViewer::setState() state.depthStencil.frontFace.reference); ui->stencils->addTopLevelItem(new RDTreeWidgetItem({ - tr("Back"), ToQStr(state.depthStencil.backFace.function), + tr("Back"), + ToQStr(state.depthStencil.backFace.function), ToQStr(state.depthStencil.backFace.failOperation), ToQStr(state.depthStencil.backFace.depthFailOperation), - ToQStr(state.depthStencil.backFace.passOperation), QVariant(), QVariant(), QVariant(), + ToQStr(state.depthStencil.backFace.passOperation), + QVariant(), + QVariant(), + QVariant(), })); m_Common.SetStencilTreeItemValue(ui->stencils->topLevelItem(1), 5, @@ -3203,9 +3264,8 @@ void VulkanPipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, i QString format; - if(stage->reflection && - buf.bindPoint < (buf.rwRes ? stage->reflection->readWriteResources.size() - : stage->reflection->readOnlyResources.size())) + if(stage->reflection && buf.bindPoint < (buf.rwRes ? stage->reflection->readWriteResources.size() + : stage->reflection->readOnlyResources.size())) { const ShaderResource &shaderRes = buf.rwRes ? stage->reflection->readWriteResources[buf.bindPoint] @@ -3736,8 +3796,9 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: } } - m_Common.exportHTMLTable(xml, {tr("Set"), tr("Bind"), tr("Buffer"), tr("Byte Offset"), - tr("Byte Size"), tr("Number of Variables"), tr("Bytes Needed")}, + m_Common.exportHTMLTable(xml, + {tr("Set"), tr("Bind"), tr("Buffer"), tr("Byte Offset"), + tr("Byte Size"), tr("Number of Variables"), tr("Bytes Needed")}, rows); } @@ -3850,8 +3911,9 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: } m_Common.exportHTMLTable( - xml, {tr("Set"), tr("Bind"), tr("Resource"), tr("Type"), tr("Width"), tr("Height"), - tr("Depth"), tr("Array Size"), tr("Resource Format"), tr("View Parameters")}, + xml, + {tr("Set"), tr("Bind"), tr("Resource"), tr("Type"), tr("Width"), tr("Height"), tr("Depth"), + tr("Array Size"), tr("Resource Format"), tr("View Parameters")}, rows); } @@ -3946,8 +4008,9 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: } m_Common.exportHTMLTable( - xml, {tr("Set"), tr("Bind"), tr("Resource"), tr("Type"), tr("Width"), tr("Height"), - tr("Depth"), tr("Array Size"), tr("Resource Format"), tr("View Parameters")}, + xml, + {tr("Set"), tr("Bind"), tr("Resource"), tr("Type"), tr("Width"), tr("Height"), tr("Depth"), + tr("Array Size"), tr("Resource Format"), tr("View Parameters")}, rows); } } @@ -3990,8 +4053,9 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: i++; } - m_Common.exportHTMLTable(xml, {tr("Slot"), tr("Buffer"), tr("Byte Offset"), tr("Byte Length"), - tr("Counter Buffer"), tr("Counter Offset")}, + m_Common.exportHTMLTable(xml, + {tr("Slot"), tr("Buffer"), tr("Byte Offset"), tr("Byte Length"), + tr("Counter Buffer"), tr("Counter Offset")}, rows); } } @@ -4010,27 +4074,31 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: xml.writeStartElement(lit("p")); xml.writeEndElement(); - m_Common.exportHTMLTable( - xml, - { - tr("Depth Clamp Enable"), tr("Depth Clip Enable"), tr("Rasterizer Discard Enable"), - }, - { - rs.depthClampEnable ? tr("Yes") : tr("No"), rs.depthClipEnable ? tr("Yes") : tr("No"), - rs.rasterizerDiscardEnable ? tr("Yes") : tr("No"), - }); + m_Common.exportHTMLTable(xml, + { + tr("Depth Clamp Enable"), + tr("Depth Clip Enable"), + tr("Rasterizer Discard Enable"), + }, + { + rs.depthClampEnable ? tr("Yes") : tr("No"), + rs.depthClipEnable ? tr("Yes") : tr("No"), + rs.rasterizerDiscardEnable ? tr("Yes") : tr("No"), + }); xml.writeStartElement(lit("p")); xml.writeEndElement(); - m_Common.exportHTMLTable( - xml, {tr("Depth Bias Enable"), tr("Depth Bias"), tr("Depth Bias Clamp"), - tr("Slope Scaled Bias"), tr("Line Width")}, - { - rs.depthBiasEnable ? tr("Yes") : tr("No"), Formatter::Format(rs.depthBias), - Formatter::Format(rs.depthBiasClamp), Formatter::Format(rs.slopeScaledDepthBias), - Formatter::Format(rs.lineWidth), - }); + m_Common.exportHTMLTable(xml, + {tr("Depth Bias Enable"), tr("Depth Bias"), tr("Depth Bias Clamp"), + tr("Slope Scaled Bias"), tr("Line Width")}, + { + rs.depthBiasEnable ? tr("Yes") : tr("No"), + Formatter::Format(rs.depthBias), + Formatter::Format(rs.depthBiasClamp), + Formatter::Format(rs.slopeScaledDepthBias), + Formatter::Format(rs.lineWidth), + }); } const VKPipe::MultiSample &msaa = m_Ctx.CurVulkanPipelineState()->multisample; @@ -4041,8 +4109,9 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: xml.writeEndElement(); m_Common.exportHTMLTable( - xml, {tr("Raster Samples"), tr("Sample-rate shading"), tr("Min Sample Shading Rate"), - tr("Sample Mask")}, + xml, + {tr("Raster Samples"), tr("Sample-rate shading"), tr("Min Sample Shading Rate"), + tr("Sample Mask")}, {msaa.rasterSamples, msaa.sampleShadingEnable ? tr("Yes") : tr("No"), Formatter::Format(msaa.minSampleShading), Formatter::Format(msaa.sampleMask, true)}); } @@ -4113,7 +4182,8 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: { cb.alphaToCoverageEnable ? tr("Yes") : tr("No"), cb.alphaToOneEnable ? tr("Yes") : tr("No"), - logic ? ToQStr(cb.blends[0].logicOperation) : tr("Disabled"), blendConst, + logic ? ToQStr(cb.blends[0].logicOperation) : tr("Disabled"), + blendConst, }); xml.writeStartElement(lit("h3")); @@ -4137,14 +4207,19 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: i++; } - m_Common.exportHTMLTable( - xml, - { - tr("Slot"), tr("Blend Enable"), tr("Blend Source"), tr("Blend Destination"), - tr("Blend Operation"), tr("Alpha Blend Source"), tr("Alpha Blend Destination"), - tr("Alpha Blend Operation"), tr("Write Mask"), - }, - rows); + m_Common.exportHTMLTable(xml, + { + tr("Slot"), + tr("Blend Enable"), + tr("Blend Source"), + tr("Blend Destination"), + tr("Blend Operation"), + tr("Alpha Blend Source"), + tr("Alpha Blend Destination"), + tr("Alpha Blend Operation"), + tr("Write Mask"), + }, + rows); } void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe::DepthStencil &ds) @@ -4155,15 +4230,16 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: xml.writeEndElement(); m_Common.exportHTMLTable( - xml, {tr("Depth Test Enable"), tr("Depth Writes Enable"), tr("Depth Function"), - tr("Depth Bounds")}, + xml, + {tr("Depth Test Enable"), tr("Depth Writes Enable"), tr("Depth Function"), tr("Depth Bounds")}, { - ds.depthTestEnable ? tr("Yes") : tr("No"), ds.depthWriteEnable ? tr("Yes") : tr("No"), - ToQStr(ds.depthFunction), ds.depthBoundsEnable - ? QFormatStr("%1 - %2") - .arg(Formatter::Format(ds.minDepthBounds)) - .arg(Formatter::Format(ds.maxDepthBounds)) - : tr("Disabled"), + ds.depthTestEnable ? tr("Yes") : tr("No"), + ds.depthWriteEnable ? tr("Yes") : tr("No"), + ToQStr(ds.depthFunction), + ds.depthBoundsEnable ? QFormatStr("%1 - %2") + .arg(Formatter::Format(ds.minDepthBounds)) + .arg(Formatter::Format(ds.maxDepthBounds)) + : tr("Disabled"), }); } @@ -4177,18 +4253,24 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: QList rows; rows.push_back({ - tr("Front"), Formatter::Format(ds.frontFace.reference, true), + tr("Front"), + Formatter::Format(ds.frontFace.reference, true), Formatter::Format(ds.frontFace.compareMask, true), - Formatter::Format(ds.frontFace.writeMask, true), ToQStr(ds.frontFace.function), - ToQStr(ds.frontFace.passOperation), ToQStr(ds.frontFace.failOperation), + Formatter::Format(ds.frontFace.writeMask, true), + ToQStr(ds.frontFace.function), + ToQStr(ds.frontFace.passOperation), + ToQStr(ds.frontFace.failOperation), ToQStr(ds.frontFace.depthFailOperation), }); rows.push_back({ - tr("back"), Formatter::Format(ds.backFace.reference, true), + tr("back"), + Formatter::Format(ds.backFace.reference, true), Formatter::Format(ds.backFace.compareMask, true), - Formatter::Format(ds.backFace.writeMask, true), ToQStr(ds.backFace.function), - ToQStr(ds.backFace.passOperation), ToQStr(ds.backFace.failOperation), + Formatter::Format(ds.backFace.writeMask, true), + ToQStr(ds.backFace.function), + ToQStr(ds.backFace.passOperation), + ToQStr(ds.backFace.failOperation), ToQStr(ds.backFace.depthFailOperation), }); @@ -4236,14 +4318,21 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe:: i++; } - m_Common.exportHTMLTable( - xml, - { - tr("Slot"), tr("Image"), tr("Width"), tr("Height"), tr("Depth"), tr("Array Size"), - tr("First mip"), tr("Number of mips"), tr("First array layer"), tr("Number of layers"), - tr("Sample Count"), - }, - rows); + m_Common.exportHTMLTable(xml, + { + tr("Slot"), + tr("Image"), + tr("Width"), + tr("Height"), + tr("Depth"), + tr("Array Size"), + tr("First mip"), + tr("Number of mips"), + tr("First array layer"), + tr("Number of layers"), + tr("Sample Count"), + }, + rows); } { @@ -4376,7 +4465,9 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, m_Common.exportHTMLTable( xml, {tr("Predicate Passing"), tr("Is Inverted"), tr("Buffer"), tr("Byte Offset")}, { - cr.isPassing ? tr("Yes") : tr("No"), cr.isInverted ? tr("Yes") : tr("No"), bufferName, + cr.isPassing ? tr("Yes") : tr("No"), + cr.isInverted ? tr("Yes") : tr("No"), + bufferName, (qulonglong)cr.byteOffset, }); } @@ -4788,10 +4879,11 @@ void VulkanPipelineStateViewer::exportFOZ(QString dir, ResourceId pso) { const SDObject *createInfo = create->FindChildRecursively("CreateInfo"); - QVariant layoutData = ConvertSDObjectToFossilizeJSON( - createInfo, { - {"bindingCount", ""}, {"pBindings", "bindings"}, - }); + QVariant layoutData = + ConvertSDObjectToFossilizeJSON(createInfo, { + {"bindingCount", ""}, + {"pBindings", "bindings"}, + }); QVariantMap root({{lit("setLayouts"), QVariantMap({{GetFossilizeHash(id), layoutData}})}}); diff --git a/qrenderdoc/Windows/PythonShell.cpp b/qrenderdoc/Windows/PythonShell.cpp index 35760afb6..b2278c838 100644 --- a/qrenderdoc/Windows/PythonShell.cpp +++ b/qrenderdoc/Windows/PythonShell.cpp @@ -427,7 +427,7 @@ struct ExtensionInvoker : ObjectForwarder void MenuDisplaying(ContextMenu contextMenu, QMenu *menu, const ExtensionCallbackData &data) { InvokeVoidFunction( - (void (IExtensionManager::*)(ContextMenu, QMenu *, const ExtensionCallbackData &)) & + (void(IExtensionManager::*)(ContextMenu, QMenu *, const ExtensionCallbackData &)) & IExtensionManager::MenuDisplaying, contextMenu, menu, data); } @@ -435,7 +435,7 @@ struct ExtensionInvoker : ObjectForwarder const ExtensionCallbackData &data) { InvokeVoidFunction( - (void (IExtensionManager::*)(PanelMenu, QMenu *, QWidget *, const ExtensionCallbackData &)) & + (void(IExtensionManager::*)(PanelMenu, QMenu *, QWidget *, const ExtensionCallbackData &)) & IExtensionManager::MenuDisplaying, panelMenu, menu, extensionButton, data); } @@ -928,14 +928,15 @@ PythonShell::PythonShell(ICaptureContext &ctx, QWidget *parent) scriptEditor->colourise(0, -1); - QObject::connect(scriptEditor, &ScintillaEdit::modified, [this](int type, int, int, int, - const QByteArray &, int, int, int) { - if(type & (SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT | SC_MOD_BEFOREINSERT | SC_MOD_BEFOREDELETE)) - { - scriptEditor->markerDeleteAll(CURRENT_MARKER); - scriptEditor->markerDeleteAll(CURRENT_MARKER + 1); - } - }); + QObject::connect(scriptEditor, &ScintillaEdit::modified, + [this](int type, int, int, int, const QByteArray &, int, int, int) { + if(type & (SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT | SC_MOD_BEFOREINSERT | + SC_MOD_BEFOREDELETE)) + { + scriptEditor->markerDeleteAll(CURRENT_MARKER); + scriptEditor->markerDeleteAll(CURRENT_MARKER + 1); + } + }); QObject::connect(scriptEditor, &ScintillaEdit::charAdded, [this](int ch) { if(ch == '.') @@ -1033,7 +1034,6 @@ void PythonShell::RunScript() enableButtons(false); LambdaThread *thread = new LambdaThread([this, script, context]() { - scriptContext = context; context->executeString(lit("script.py"), script); scriptContext = NULL; @@ -1336,7 +1336,8 @@ try: help(%1) except ImportError: help(%1) -)").arg(ui->helpSearch->text())); +)") + .arg(ui->helpSearch->text())); context->Finish(); } diff --git a/qrenderdoc/Windows/ResourceInspector.cpp b/qrenderdoc/Windows/ResourceInspector.cpp index 89435a31d..5c6dc6646 100644 --- a/qrenderdoc/Windows/ResourceInspector.cpp +++ b/qrenderdoc/Windows/ResourceInspector.cpp @@ -294,7 +294,6 @@ void ResourceInspector::Inspect(ResourceId id) rdcarray entries = r->GetShaderEntryPoints(id); GUIInvoke::call(this, [this, entries, usage] { - if(!entries.isEmpty()) { m_Entries = entries; diff --git a/qrenderdoc/Windows/ShaderMessageViewer.cpp b/qrenderdoc/Windows/ShaderMessageViewer.cpp index 10b73378b..ee9c1d69f 100644 --- a/qrenderdoc/Windows/ShaderMessageViewer.cpp +++ b/qrenderdoc/Windows/ShaderMessageViewer.cpp @@ -862,10 +862,11 @@ void ShaderMessageViewer::refreshMessages() if(msg.stage == ShaderStage::Compute) { node = new RDTreeWidgetItem({ - QString(), QFormatStr("%1, %2, %3") - .arg(msg.location.compute.workgroup[0]) - .arg(msg.location.compute.workgroup[1]) - .arg(msg.location.compute.workgroup[2]), + QString(), + QFormatStr("%1, %2, %3") + .arg(msg.location.compute.workgroup[0]) + .arg(msg.location.compute.workgroup[1]) + .arg(msg.location.compute.workgroup[2]), QFormatStr("%1, %2, %3") .arg(msg.location.compute.thread[0]) .arg(msg.location.compute.thread[1]) @@ -880,9 +881,9 @@ void ShaderMessageViewer::refreshMessages() node = new RDTreeWidgetItem({QString(), QString(), location, text}); node->setData(0, debuggableRole, refl && refl->debugInfo.debuggable); - node->setData(1, gotoableRole, msg.stage == ShaderStage::Vertex || - msg.stage == ShaderStage::Pixel || - msg.stage == ShaderStage::Geometry); + node->setData(1, gotoableRole, + msg.stage == ShaderStage::Vertex || msg.stage == ShaderStage::Pixel || + msg.stage == ShaderStage::Geometry); } if(node) diff --git a/qrenderdoc/Windows/ShaderViewer.cpp b/qrenderdoc/Windows/ShaderViewer.cpp index 038ee47fb..853a251de 100644 --- a/qrenderdoc/Windows/ShaderViewer.cpp +++ b/qrenderdoc/Windows/ShaderViewer.cpp @@ -312,13 +312,14 @@ void ShaderViewer::editShader(ResourceId id, ShaderStage stage, const QString &e scintilla->setReadOnly(false); QObject::connect(scintilla, &ScintillaEdit::keyPressed, this, &ShaderViewer::editable_keyPressed); - QObject::connect(scintilla, &ScintillaEdit::modified, [this](int type, int, int, int, - const QByteArray &, int, int, int) { - if(type & (SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT | SC_MOD_BEFOREINSERT | SC_MOD_BEFOREDELETE)) - m_FindState = FindState(); + QObject::connect(scintilla, &ScintillaEdit::modified, + [this](int type, int, int, int, const QByteArray &, int, int, int) { + if(type & (SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT | SC_MOD_BEFOREINSERT | + SC_MOD_BEFOREDELETE)) + m_FindState = FindState(); - MarkModification(); - }); + MarkModification(); + }); m_Ctx.GetMainWindow()->RegisterShortcut(QKeySequence(QKeySequence::Refresh).toString(), this, [this](QWidget *) { on_refresh_clicked(); }); @@ -1000,10 +1001,10 @@ void ShaderViewer::debugShader(const ShaderBindpointMapping *bind, const ShaderR for(int i = 0; m_BackgroundRunning.available() == 1 && i < 100; i++) QThread::msleep(5); - ShowProgressDialog(this, tr("Debugging %1").arg(debugContext), - [this]() { return m_BackgroundRunning.available() == 0; }, NULL, - [this]() { m_BackgroundRunning.acquire(); }); - + ShowProgressDialog( + this, tr("Debugging %1").arg(debugContext), + [this]() { return m_BackgroundRunning.available() == 0; }, NULL, + [this]() { m_BackgroundRunning.acquire(); }); }); m_CurrentStateIdx = 0; @@ -1027,7 +1028,10 @@ void ShaderViewer::debugShader(const ShaderBindpointMapping *bind, const ShaderR &ShaderViewer::accessedResources_contextMenu); RDTreeWidgetItem *item = new RDTreeWidgetItem({ - QVariant(), QVariant(), QVariant(), QVariant(), + QVariant(), + QVariant(), + QVariant(), + QVariant(), }); item->setEditable(0, true); ui->watch->addTopLevelItem(item); @@ -1777,7 +1781,10 @@ void ShaderViewer::variables_contextMenu(const QPoint &pos) QObject::connect(&clearAll, &QAction::triggered, [this] { ui->watch->clear(); RDTreeWidgetItem *item = new RDTreeWidgetItem({ - QVariant(), QVariant(), QVariant(), QVariant(), + QVariant(), + QVariant(), + QVariant(), + QVariant(), }); item->setEditable(0, true); ui->watch->addTopLevelItem(item); @@ -2039,7 +2046,10 @@ void ShaderViewer::on_watch_itemChanged(RDTreeWidgetItem *item, int column) !ui->watch->topLevelItem(ui->watch->topLevelItemCount() - 1)->text(0).isEmpty()) { RDTreeWidgetItem *blankItem = new RDTreeWidgetItem({ - QVariant(), QVariant(), QVariant(), QVariant(), + QVariant(), + QVariant(), + QVariant(), + QVariant(), }); blankItem->setEditable(0, true); ui->watch->addTopLevelItem(blankItem); @@ -3652,8 +3662,8 @@ void ShaderViewer::updateDebugState() } } - if(isSourceDebugging() || - ui->docking->areaOf(m_CurInstructionScintilla) != ui->docking->areaOf(m_DisassemblyFrame)) + if(isSourceDebugging() || ui->docking->areaOf(m_CurInstructionScintilla) != + ui->docking->areaOf(m_DisassemblyFrame)) ToolWindowManager::raiseToolWindow(m_CurInstructionScintilla); int pos = m_CurInstructionScintilla->positionFromLine(lineInfo.lineStart - 1); @@ -3823,7 +3833,9 @@ void ShaderViewer::updateDebugState() QString childName = QFormatStr("%1[%2]").arg(ro.name).arg(a); RDTreeWidgetItem *child = new RDTreeWidgetItem({ QFormatStr("%1[%2]").arg(m_ShaderDetails->readOnlyResources[i].name).arg(a), - childName, lit("Resource"), ToQStr(roBind.resources[a].resourceId), + childName, + lit("Resource"), + ToQStr(roBind.resources[a].resourceId), }); child->setTag( QVariant::fromValue(VariableTag(DebugVariableType::ReadOnlyResource, childName))); @@ -3892,7 +3904,9 @@ void ShaderViewer::updateDebugState() QString childName = QFormatStr("%1[%2]").arg(rw.name).arg(a); RDTreeWidgetItem *child = new RDTreeWidgetItem({ QFormatStr("%1[%2]").arg(m_ShaderDetails->readWriteResources[i].name).arg(a), - childName, lit("RW Resource"), ToQStr(rwBind.resources[a].resourceId), + childName, + lit("RW Resource"), + ToQStr(rwBind.resources[a].resourceId), }); child->setTag( QVariant::fromValue(VariableTag(DebugVariableType::ReadWriteResource, childName))); @@ -3958,8 +3972,10 @@ void ShaderViewer::updateDebugState() { QString childName = QFormatStr("%1[%2]").arg(s.name).arg(a); RDTreeWidgetItem *child = new RDTreeWidgetItem({ - QFormatStr("%1[%2]").arg(m_ShaderDetails->samplers[i].name).arg(a), childName, - lit("Sampler"), samplerRep(bind, a, sampBind.resources[a].resourceId), + QFormatStr("%1[%2]").arg(m_ShaderDetails->samplers[i].name).arg(a), + childName, + lit("Sampler"), + samplerRep(bind, a, sampBind.resources[a].resourceId), }); child->setTag(QVariant::fromValue(VariableTag(DebugVariableType::Sampler, childName))); node->addChild(child); @@ -4129,7 +4145,10 @@ bool ShaderViewer::updateWatchVariable(RDTreeWidgetItem *watchItem, const RDTree { idx = watchItem->childCount(); RDTreeWidgetItem *item = new RDTreeWidgetItem({ - name, QVariant(), QVariant(), QVariant(), + name, + QVariant(), + QVariant(), + QVariant(), }); VariableTag tag = VariableTag(DebugVariableType::Variable, path); tag.state = WatchVarState::Valid; @@ -4210,7 +4229,10 @@ bool ShaderViewer::updateWatchVariable(RDTreeWidgetItem *watchItem, const RDTree dataSize * var.columns); RDTreeWidgetItem *item = new RDTreeWidgetItem({ - rowVar.name, QVariant(), QVariant(), QVariant(), + rowVar.name, + QVariant(), + QVariant(), + QVariant(), }); updateWatchVariable(item, varItem->child(r), path + ".row" + ToStr(r), ~0U, rowVar, regcast); @@ -4612,7 +4634,9 @@ RDTreeWidgetItem *ShaderViewer::makeSourceVariableNode(const SourceVariableMappi { for(uint32_t a = 0; a < bind.arraySize; a++) children.push_back(new RDTreeWidgetItem({ - QFormatStr("%1[%2]").arg(localName).arg(a), QString(), typeName, + QFormatStr("%1[%2]").arg(localName).arg(a), + QString(), + typeName, samplerRep(bind, a, res.resources[a].resourceId), })); @@ -4668,7 +4692,9 @@ RDTreeWidgetItem *ShaderViewer::makeSourceVariableNode(const SourceVariableMappi uint32_t count = qMin(bind.arraySize, (uint32_t)res.resources.size()); for(uint32_t a = 0; a < count; a++) children.push_back(new RDTreeWidgetItem({ - QFormatStr("%1[%2]").arg(localName).arg(a), QString(), typeName, + QFormatStr("%1[%2]").arg(localName).arg(a), + QString(), + typeName, ToQStr(res.resources[a].resourceId), })); @@ -5229,7 +5255,10 @@ void ShaderViewer::AddWatch(const rdcstr &variable) return; RDTreeWidgetItem *item = new RDTreeWidgetItem({ - QString(variable), QVariant(), QVariant(), QVariant(), + QString(variable), + QVariant(), + QVariant(), + QVariant(), }); item->setEditable(0, true); ui->watch->insertTopLevelItem(ui->watch->topLevelItemCount() - 1, item); @@ -5951,10 +5980,11 @@ bool ShaderViewer::ProcessIncludeDirectives(QString &source, const rdcstrpairs & void ShaderViewer::on_resetEdits_clicked() { - QMessageBox::StandardButton res = RDDialog::question( - this, tr("Are you sure?"), tr("Are you sure you want to reset all edits and restore the " - "shader source back to the original?"), - QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel); + QMessageBox::StandardButton res = + RDDialog::question(this, tr("Are you sure?"), + tr("Are you sure you want to reset all edits and restore the " + "shader source back to the original?"), + QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel); if(res != QMessageBox::Yes) return; diff --git a/qrenderdoc/Windows/TextureViewer.cpp b/qrenderdoc/Windows/TextureViewer.cpp index 3721fe478..4f035ea14 100644 --- a/qrenderdoc/Windows/TextureViewer.cpp +++ b/qrenderdoc/Windows/TextureViewer.cpp @@ -886,8 +886,10 @@ void TextureViewer::RT_UpdateVisualRange(IReplayController *r) fmt.compCount = 4; rdcfixedarray channels = { - m_TexDisplay.red ? true : false, m_TexDisplay.green && fmt.compCount > 1, - m_TexDisplay.blue && fmt.compCount > 2, m_TexDisplay.alpha && fmt.compCount > 3, + m_TexDisplay.red ? true : false, + m_TexDisplay.green && fmt.compCount > 1, + m_TexDisplay.blue && fmt.compCount > 2, + m_TexDisplay.alpha && fmt.compCount > 3, }; ResourceId textureId = m_TexDisplay.resourceId; @@ -3693,7 +3695,6 @@ void TextureViewer::AutoFitRange() return; m_Ctx.Replay().AsyncInvoke([this](IReplayController *r) { - ResourceId textureId = m_TexDisplay.resourceId; Subresource sub = m_TexDisplay.subresource; CompType typeCast = m_TexDisplay.typeCast; @@ -4103,7 +4104,6 @@ void TextureViewer::on_debugPixelContext_clicked() } done = true; - }); QString debugContext = tr("Pixel %1,%2").arg(x).arg(y); diff --git a/renderdoc/android/android.cpp b/renderdoc/android/android.cpp index 1776d8220..a1de000d9 100644 --- a/renderdoc/android/android.cpp +++ b/renderdoc/android/android.cpp @@ -970,9 +970,8 @@ struct AndroidController : public IDeviceProtocolHandler dev.name = Android::GetFriendlyName(d); if(!Android::IsSupported(d)) dev.name += " - (Android 5.x)"; - dev.portbase = - uint16_t(RenderDoc_ForwardPortBase + - RenderDoc::Inst().GetForwardedPortSlot() * RenderDoc_ForwardPortStride); + dev.portbase = uint16_t(RenderDoc_ForwardPortBase + RenderDoc::Inst().GetForwardedPortSlot() * + RenderDoc_ForwardPortStride); // silently forward the ports now. These may be refreshed but this will allow us to connect Android::adbForwardPorts(dev.portbase, d, 0, 0, true); @@ -1198,8 +1197,7 @@ ExecuteResult AndroidRemoteServer::ExecuteAndInject(const rdcstr &packageAndActi uint32_t ident = RenderDoc_FirstTargetControlPort; AndroidController::m_Inst.Invoke([this, &result, &ident, packageAndActivity, intentArgs, opts]() { - rdcstr packageName = - Android::GetPackageName(packageAndActivity); // Remove leading '/' if any + rdcstr packageName = Android::GetPackageName(packageAndActivity); // Remove leading '/' if any // adb shell cmd package resolve-activity -c android.intent.category.LAUNCHER com.jake.cube1 rdcstr activityName = Android::GetActivityName(packageAndActivity); diff --git a/renderdoc/api/app/renderdoc_app.h b/renderdoc/api/app/renderdoc_app.h index a4514c6b6..9cf0bf489 100644 --- a/renderdoc/api/app/renderdoc_app.h +++ b/renderdoc/api/app/renderdoc_app.h @@ -72,7 +72,8 @@ extern "C" { // RenderDoc capture options // -typedef enum RENDERDOC_CaptureOption { +typedef enum RENDERDOC_CaptureOption +{ // Allow the application to enable vsync // // Default - enabled @@ -246,7 +247,8 @@ typedef uint32_t(RENDERDOC_CC *pRENDERDOC_GetCaptureOptionU32)(RENDERDOC_Capture // If the option is invalid, -FLT_MAX is returned typedef float(RENDERDOC_CC *pRENDERDOC_GetCaptureOptionF32)(RENDERDOC_CaptureOption opt); -typedef enum RENDERDOC_InputButton { +typedef enum RENDERDOC_InputButton +{ // '0' - '9' matches ASCII values eRENDERDOC_Key_0 = 0x30, eRENDERDOC_Key_1 = 0x31, @@ -334,7 +336,8 @@ typedef void(RENDERDOC_CC *pRENDERDOC_SetFocusToggleKeys)(RENDERDOC_InputButton // If keys is NULL or num is 0, captures keys will be disabled typedef void(RENDERDOC_CC *pRENDERDOC_SetCaptureKeys)(RENDERDOC_InputButton *keys, int num); -typedef enum RENDERDOC_OverlayBits { +typedef enum RENDERDOC_OverlayBits +{ // This single bit controls whether the overlay is enabled or disabled globally eRENDERDOC_Overlay_Enabled = 0x1, @@ -570,7 +573,8 @@ typedef void(RENDERDOC_CC *pRENDERDOC_SetCaptureTitle)(const char *title); // Note that this means the API returned can be higher than the one you might have requested. // e.g. if you are running against a newer RenderDoc that supports 1.0.1, it will be returned // instead of 1.0.0. You can check this with the GetAPIVersion entry point -typedef enum RENDERDOC_Version { +typedef enum RENDERDOC_Version +{ eRENDERDOC_API_Version_1_0_0 = 10000, // RENDERDOC_API_1_0_0 = 1 00 00 eRENDERDOC_API_Version_1_0_1 = 10001, // RENDERDOC_API_1_0_1 = 1 00 01 eRENDERDOC_API_Version_1_0_2 = 10002, // RENDERDOC_API_1_0_2 = 1 00 02 diff --git a/renderdoc/api/replay/apidefs.h b/renderdoc/api/replay/apidefs.h index 2f55ec2fa..c3f93ddc4 100644 --- a/renderdoc/api/replay/apidefs.h +++ b/renderdoc/api/replay/apidefs.h @@ -199,44 +199,42 @@ constexpr inline unsigned int arraydim() #define ENUM_ARRAY_SIZE(enum_name) int(enum_name::Count) -// clang-format makes a even more of a mess of this multi-line macro than it usually does, for some -// reason. So we just disable it since it's still readable and this isn't really the intended case -// we are using clang-format for. +#define BITMASK_OPERATORS(enum_name) \ + \ + constexpr inline enum_name operator|(enum_name a, enum_name b) \ + { \ + typedef typename std::underlying_type::type etype; \ + return enum_name(etype(a) | etype(b)); \ + } \ + \ + constexpr inline EnumCastHelper operator&(enum_name a, enum_name b) \ + { \ + typedef typename std::underlying_type::type etype; \ + return EnumCastHelper(enum_name(etype(a) & etype(b))); \ + } \ + \ + constexpr inline enum_name operator~(enum_name a) \ + { \ + typedef typename std::underlying_type::type etype; \ + return enum_name(~etype(a)); \ + } \ + \ + inline enum_name &operator|=(enum_name &a, enum_name b) \ + { \ + return a = a | b; \ + } \ + \ + inline enum_name &operator&=(enum_name &a, enum_name b) \ + { \ + return a = a & b; \ + } -// clang-format off -#define BITMASK_OPERATORS(enum_name) \ - \ -constexpr inline enum_name operator|(enum_name a, enum_name b) \ -{ \ - typedef typename std::underlying_type::type etype; \ - return enum_name(etype(a) | etype(b)); \ -} \ - \ -constexpr inline EnumCastHelper operator&(enum_name a, enum_name b) \ -{ \ - typedef typename std::underlying_type::type etype; \ - return EnumCastHelper(enum_name(etype(a) & etype(b))); \ -} \ - \ -constexpr inline enum_name operator~(enum_name a) \ -{ \ - typedef typename std::underlying_type::type etype; \ - return enum_name(~etype(a)); \ -} \ - \ -inline enum_name &operator|=(enum_name &a, enum_name b) \ -{ return a = a | b; } \ - \ -inline enum_name &operator&=(enum_name &a, enum_name b) \ -{ return a = a & b; } - -#define ITERABLE_OPERATORS(enum_name) \ - \ -inline enum_name operator++(enum_name &a) \ -{ \ - typedef typename std::underlying_type::type etype; \ - return a = enum_name(etype(a)+1); \ -} -// clang-format on +#define ITERABLE_OPERATORS(enum_name) \ + \ + inline enum_name operator++(enum_name &a) \ + { \ + typedef typename std::underlying_type::type etype; \ + return a = enum_name(etype(a) + 1); \ + } #endif diff --git a/renderdoc/api/replay/data_types.h b/renderdoc/api/replay/data_types.h index 3dbb1f1b7..8a54eaeef 100644 --- a/renderdoc/api/replay/data_types.h +++ b/renderdoc/api/replay/data_types.h @@ -375,14 +375,12 @@ texel. case ResourceFormatType::Undefined: break; case ResourceFormatType::Regular: return compByteWidth * compCount; case ResourceFormatType::BC1: - case ResourceFormatType::BC4: - return 8; // 8 bytes for 4x4 block + case ResourceFormatType::BC4: return 8; // 8 bytes for 4x4 block case ResourceFormatType::BC2: case ResourceFormatType::BC3: case ResourceFormatType::BC5: case ResourceFormatType::BC6: - case ResourceFormatType::BC7: - return 16; // 16 bytes for 4x4 block + case ResourceFormatType::BC7: return 16; // 16 bytes for 4x4 block case ResourceFormatType::ETC2: return 8; case ResourceFormatType::EAC: if(compCount == 1) @@ -390,9 +388,8 @@ texel. else if(compCount == 2) return 16; // two channel RG11 EAC else - return 16; // RGBA8 EAC - case ResourceFormatType::ASTC: - return 16; // ASTC is always 128 bits per block + return 16; // RGBA8 EAC + case ResourceFormatType::ASTC: return 16; // ASTC is always 128 bits per block case ResourceFormatType::R10G10B10A2: case ResourceFormatType::R11G11B10: case ResourceFormatType::R9G9B9E5: return 4; @@ -406,8 +403,7 @@ texel. case ResourceFormatType::D32S8: return 5; // we define the size as tightly packed, so 5 bytes. case ResourceFormatType::S8: - case ResourceFormatType::A8: - return 1; + case ResourceFormatType::A8: return 1; // can't give a sensible answer for YUV formats as the texel varies. case ResourceFormatType::YUV8: return compCount; case ResourceFormatType::YUV10: diff --git a/renderdoc/api/replay/rdcstr.h b/renderdoc/api/replay/rdcstr.h index ae153ef6d..a922396d8 100644 --- a/renderdoc/api/replay/rdcstr.h +++ b/renderdoc/api/replay/rdcstr.h @@ -979,8 +979,8 @@ class rdcinflexiblestr #endif } -// we use tagged pointers on x86-64 to minimise storage. On other architecture this isn't safe -// so we have to keep it separate. This is still a storage win over rdcstr + // we use tagged pointers on x86-64 to minimise storage. On other architecture this isn't safe + // so we have to keep it separate. This is still a storage win over rdcstr #if defined(__x86_64__) || defined(_M_X64) // use a signed pointer to sign-extend for canonical form diff --git a/renderdoc/api/replay/renderdoc_replay.h b/renderdoc/api/replay/renderdoc_replay.h index 7f36f74b7..d747b6660 100644 --- a/renderdoc/api/replay/renderdoc_replay.h +++ b/renderdoc/api/replay/renderdoc_replay.h @@ -48,8 +48,10 @@ // this #define can be used to mark a program as a 'replay' program which should not be captured. // Any program used for such purpose must define and export this symbol in the main exe or one dll // that will be loaded before renderdoc.dll is loaded. -#define REPLAY_PROGRAM_MARKER() \ - extern "C" RENDERDOC_EXPORT_API void RENDERDOC_CC renderdoc__replay__marker() {} +#define REPLAY_PROGRAM_MARKER() \ + extern "C" RENDERDOC_EXPORT_API void RENDERDOC_CC renderdoc__replay__marker() \ + { \ + } // declare ResourceId extremely early so that it can be referenced in structured_data.h DOCUMENT(""); diff --git a/renderdoc/api/replay/replay_enums.h b/renderdoc/api/replay/replay_enums.h index 551d5e92f..7b705039b 100644 --- a/renderdoc/api/replay/replay_enums.h +++ b/renderdoc/api/replay/replay_enums.h @@ -296,15 +296,19 @@ DOCUMENT(R"(Get the byte size of a variable type. )"); constexpr uint32_t VarTypeByteSize(VarType type) { - // temporarily disable clang-format to make this more readable. - // Ideally we'd use a simple switch() but VS2015 doesn't support that :(. - // clang-format off - return (type == VarType::UByte || type == VarType::SByte) ? 1 - : (type == VarType::Half || type == VarType::UShort || type == VarType::SShort) ? 2 - : (type == VarType::Float || type == VarType::UInt || type == VarType::SInt || type == VarType::Bool || type == VarType::Enum) ? 4 - : (type == VarType::Double || type == VarType::ULong || type == VarType::SLong || type == VarType::GPUPointer) ? 8 - : 0; - // clang-format on + return (type == VarType::UByte || type == VarType::SByte) ? 1 + + : (type == VarType::Half || type == VarType::UShort || type == VarType::SShort) ? 2 + + : (type == VarType::Float || type == VarType::UInt || type == VarType::SInt || + type == VarType::Bool || type == VarType::Enum) + ? 4 + + : (type == VarType::Double || type == VarType::ULong || type == VarType::SLong || + type == VarType::GPUPointer) + ? 8 + + : 0; } DOCUMENT(R"(Represents the component type of a channel in a texture or element in a structure. @@ -388,20 +392,19 @@ DOCUMENT(R"(Get the component type of a variable type. )"); constexpr CompType VarTypeCompType(VarType type) { - // temporarily disable clang-format to make this more readable. - // Ideally we'd use a simple switch() but VS2015 doesn't support that :(. - // clang-format off - return (type == VarType::Double || type == VarType::Float || type == VarType::Half) ? CompType::Float + return (type == VarType::Double || type == VarType::Float || type == VarType::Half) + ? CompType::Float - : (type == VarType::ULong || type == VarType::UInt || type == VarType::UShort || - type == VarType::UByte || type == VarType::Bool || type == VarType::Enum || - type == VarType::GPUPointer) ? CompType::UInt + : (type == VarType::ULong || type == VarType::UInt || type == VarType::UShort || + type == VarType::UByte || type == VarType::Bool || type == VarType::Enum || + type == VarType::GPUPointer) + ? CompType::UInt - : (type == VarType::SLong || type == VarType::SInt || - type == VarType::SShort || type == VarType::SByte) ? CompType::SInt + : (type == VarType::SLong || type == VarType::SInt || type == VarType::SShort || + type == VarType::SByte) + ? CompType::SInt - : CompType::Typeless; - // clang-format on + : CompType::Typeless; } DOCUMENT(R"(A single source component for a destination texture swizzle. @@ -1731,20 +1734,16 @@ DOCUMENT(R"(Get the GPUVendor for a given PCI Vendor ID. )"); constexpr GPUVendor GPUVendorFromPCIVendor(uint32_t vendorID) { - // temporarily disable clang-format to make this more readable. - // Ideally we'd use a simple switch() but VS2015 doesn't support that :(. - // clang-format off - return vendorID == 0x13B5 ? GPUVendor::ARM - : vendorID == 0x1002 ? GPUVendor::AMD - : vendorID == 0x1010 ? GPUVendor::Imagination - : vendorID == 0x8086 ? GPUVendor::Intel - : vendorID == 0x10DE ? GPUVendor::nVidia - : vendorID == 0x5143 ? GPUVendor::Qualcomm - : vendorID == 0x1AE0 ? GPUVendor::Software // Google Swiftshader - : vendorID == 0x1414 ? GPUVendor::Software // Microsoft WARP - : vendorID == 0x144D ? GPUVendor::Samsung // Xclipse GPU - : GPUVendor::Unknown; - // clang-format on + return vendorID == 0x13B5 ? GPUVendor::ARM + : vendorID == 0x1002 ? GPUVendor::AMD + : vendorID == 0x1010 ? GPUVendor::Imagination + : vendorID == 0x8086 ? GPUVendor::Intel + : vendorID == 0x10DE ? GPUVendor::nVidia + : vendorID == 0x5143 ? GPUVendor::Qualcomm + : vendorID == 0x1AE0 ? GPUVendor::Software // Google Swiftshader + : vendorID == 0x1414 ? GPUVendor::Software // Microsoft WARP + : vendorID == 0x144D ? GPUVendor::Samsung // Xclipse GPU + : GPUVendor::Unknown; } DOCUMENT(R"(Identifies a Graphics API. @@ -1948,23 +1947,19 @@ DOCUMENT(R"(Returns the default executable name with no suffix for a given :clas )"); constexpr inline const char *ToolExecutable(KnownShaderTool tool) { - // temporarily disable clang-format to make this more readable. - // Ideally we'd use a simple switch() but VS2015 doesn't support that :(. - // clang-format off - return tool == KnownShaderTool::SPIRV_Cross ? "spirv-cross" : - tool == KnownShaderTool::SPIRV_Cross_OpenGL ? "spirv-cross" : - tool == KnownShaderTool::spirv_dis ? "spirv-dis" : - tool == KnownShaderTool::spirv_dis_OpenGL ? "spirv-dis" : - tool == KnownShaderTool::glslangValidatorGLSL ? "glslangValidator" : - tool == KnownShaderTool::glslangValidatorGLSL_OpenGL ? "glslangValidator" : - tool == KnownShaderTool::glslangValidatorHLSL ? "glslangValidator" : - tool == KnownShaderTool::spirv_as ? "spirv-as" : - tool == KnownShaderTool::spirv_as_OpenGL ? "spirv-as" : - tool == KnownShaderTool::dxcSPIRV ? "dxc" : - tool == KnownShaderTool::dxcDXIL ? "dxc" : - tool == KnownShaderTool::fxc ? "fxc" : - ""; - // clang-format on + return tool == KnownShaderTool::SPIRV_Cross ? "spirv-cross" + : tool == KnownShaderTool::SPIRV_Cross_OpenGL ? "spirv-cross" + : tool == KnownShaderTool::spirv_dis ? "spirv-dis" + : tool == KnownShaderTool::spirv_dis_OpenGL ? "spirv-dis" + : tool == KnownShaderTool::glslangValidatorGLSL ? "glslangValidator" + : tool == KnownShaderTool::glslangValidatorGLSL_OpenGL ? "glslangValidator" + : tool == KnownShaderTool::glslangValidatorHLSL ? "glslangValidator" + : tool == KnownShaderTool::spirv_as ? "spirv-as" + : tool == KnownShaderTool::spirv_as_OpenGL ? "spirv-as" + : tool == KnownShaderTool::dxcSPIRV ? "dxc" + : tool == KnownShaderTool::dxcDXIL ? "dxc" + : tool == KnownShaderTool::fxc ? "fxc" + : ""; } DOCUMENT(R"(Returns the expected default input :class:`~renderdoc.ShaderEncoding` that a @@ -1977,23 +1972,19 @@ tool. )"); constexpr inline ShaderEncoding ToolInput(KnownShaderTool tool) { - // temporarily disable clang-format to make this more readable. - // Ideally we'd use a simple switch() but VS2015 doesn't support that :(. - // clang-format off - return tool == KnownShaderTool::SPIRV_Cross ? ShaderEncoding::SPIRV : - tool == KnownShaderTool::SPIRV_Cross_OpenGL ? ShaderEncoding::OpenGLSPIRV : - tool == KnownShaderTool::spirv_dis ? ShaderEncoding::SPIRV : - tool == KnownShaderTool::spirv_dis_OpenGL ? ShaderEncoding::OpenGLSPIRV : - tool == KnownShaderTool::glslangValidatorGLSL ? ShaderEncoding::GLSL : - tool == KnownShaderTool::glslangValidatorGLSL_OpenGL ? ShaderEncoding::GLSL : - tool == KnownShaderTool::glslangValidatorHLSL ? ShaderEncoding::HLSL : - tool == KnownShaderTool::spirv_as ? ShaderEncoding::SPIRVAsm : - tool == KnownShaderTool::spirv_as_OpenGL ? ShaderEncoding::OpenGLSPIRVAsm : - tool == KnownShaderTool::dxcSPIRV ? ShaderEncoding::HLSL : - tool == KnownShaderTool::dxcDXIL ? ShaderEncoding::HLSL : - tool == KnownShaderTool::fxc ? ShaderEncoding::HLSL : - ShaderEncoding::Unknown; - // clang-format on + return tool == KnownShaderTool::SPIRV_Cross ? ShaderEncoding::SPIRV + : tool == KnownShaderTool::SPIRV_Cross_OpenGL ? ShaderEncoding::OpenGLSPIRV + : tool == KnownShaderTool::spirv_dis ? ShaderEncoding::SPIRV + : tool == KnownShaderTool::spirv_dis_OpenGL ? ShaderEncoding::OpenGLSPIRV + : tool == KnownShaderTool::glslangValidatorGLSL ? ShaderEncoding::GLSL + : tool == KnownShaderTool::glslangValidatorGLSL_OpenGL ? ShaderEncoding::GLSL + : tool == KnownShaderTool::glslangValidatorHLSL ? ShaderEncoding::HLSL + : tool == KnownShaderTool::spirv_as ? ShaderEncoding::SPIRVAsm + : tool == KnownShaderTool::spirv_as_OpenGL ? ShaderEncoding::OpenGLSPIRVAsm + : tool == KnownShaderTool::dxcSPIRV ? ShaderEncoding::HLSL + : tool == KnownShaderTool::dxcDXIL ? ShaderEncoding::HLSL + : tool == KnownShaderTool::fxc ? ShaderEncoding::HLSL + : ShaderEncoding::Unknown; } DOCUMENT(R"(Returns the expected default output :class:`~renderdoc.ShaderEncoding` that a @@ -2006,23 +1997,19 @@ tool. )"); constexpr inline ShaderEncoding ToolOutput(KnownShaderTool tool) { - // temporarily disable clang-format to make this more readable. - // Ideally we'd use a simple switch() but VS2015 doesn't support that :(. - // clang-format off - return tool == KnownShaderTool::SPIRV_Cross ? ShaderEncoding::GLSL : - tool == KnownShaderTool::SPIRV_Cross_OpenGL ? ShaderEncoding::GLSL : - tool == KnownShaderTool::spirv_dis ? ShaderEncoding::SPIRVAsm : - tool == KnownShaderTool::spirv_dis_OpenGL ? ShaderEncoding::OpenGLSPIRVAsm : - tool == KnownShaderTool::glslangValidatorGLSL ? ShaderEncoding::SPIRV : - tool == KnownShaderTool::glslangValidatorGLSL_OpenGL ? ShaderEncoding::OpenGLSPIRV : - tool == KnownShaderTool::glslangValidatorHLSL ? ShaderEncoding::SPIRV : - tool == KnownShaderTool::spirv_as ? ShaderEncoding::SPIRV : - tool == KnownShaderTool::spirv_as_OpenGL ? ShaderEncoding::OpenGLSPIRV : - tool == KnownShaderTool::dxcSPIRV ? ShaderEncoding::SPIRV : - tool == KnownShaderTool::dxcDXIL ? ShaderEncoding::DXIL : - tool == KnownShaderTool::fxc ? ShaderEncoding::DXBC : - ShaderEncoding::Unknown; - // clang-format on + return tool == KnownShaderTool::SPIRV_Cross ? ShaderEncoding::GLSL + : tool == KnownShaderTool::SPIRV_Cross_OpenGL ? ShaderEncoding::GLSL + : tool == KnownShaderTool::spirv_dis ? ShaderEncoding::SPIRVAsm + : tool == KnownShaderTool::spirv_dis_OpenGL ? ShaderEncoding::OpenGLSPIRVAsm + : tool == KnownShaderTool::glslangValidatorGLSL ? ShaderEncoding::SPIRV + : tool == KnownShaderTool::glslangValidatorGLSL_OpenGL ? ShaderEncoding::OpenGLSPIRV + : tool == KnownShaderTool::glslangValidatorHLSL ? ShaderEncoding::SPIRV + : tool == KnownShaderTool::spirv_as ? ShaderEncoding::SPIRV + : tool == KnownShaderTool::spirv_as_OpenGL ? ShaderEncoding::OpenGLSPIRV + : tool == KnownShaderTool::dxcSPIRV ? ShaderEncoding::SPIRV + : tool == KnownShaderTool::dxcDXIL ? ShaderEncoding::DXIL + : tool == KnownShaderTool::fxc ? ShaderEncoding::DXBC + : ShaderEncoding::Unknown; } DOCUMENT(R"(Check whether or not this is a human readable text representation. diff --git a/renderdoc/api/replay/stringise.h b/renderdoc/api/replay/stringise.h index 0c682a16e..8dd03b52d 100644 --- a/renderdoc/api/replay/stringise.h +++ b/renderdoc/api/replay/stringise.h @@ -55,7 +55,7 @@ rdcstr ToStr(const T &el) constexpr rdcliteral empty_ret = STRING_LITERAL(#type "(0)"); \ static_assert(std::is_same::value, \ "Type in macro doesn't match el"); \ - (void)(enumType) el; \ + (void)(enumType)el; \ switch(el) \ { \ default: break; @@ -89,7 +89,7 @@ rdcstr ToStr(const T &el) static_assert(std::is_same::value, \ "Type in macro doesn't match el"); \ uint64_t local = (uint64_t)el; \ - (void)(enumType) el; \ + (void)(enumType)el; \ rdcstr ret; #define STRINGISE_BITFIELD_VALUE(b) \ diff --git a/renderdoc/api/replay/version.h b/renderdoc/api/replay/version.h index ba8e006be..30f3065b0 100644 --- a/renderdoc/api/replay/version.h +++ b/renderdoc/api/replay/version.h @@ -65,13 +65,13 @@ extern "C" const char GitVersionHash[41]; // The friendly name of the distribution that packaged this build #if !defined(DISTRIBUTION_NAME) -//#define DISTRIBUTION_NAME "DistributionName" +// #define DISTRIBUTION_NAME "DistributionName" #endif // An arbitrary distribution version string. If set, this should include the major and minor // version numbers in it. #if !defined(DISTRIBUTION_VERSION) -//#define DISTRIBUTION_VERSION "MAJ.MIN-foo.4b" +// #define DISTRIBUTION_VERSION "MAJ.MIN-foo.4b" #endif // Set to an URL or email of who produced this build and should be the first point of contact for @@ -79,7 +79,7 @@ extern "C" const char GitVersionHash[41]; // If you're distributing builds for the public then do update this to point to your bugtracker or // similar. #if !defined(DISTRIBUTION_CONTACT) -//#define DISTRIBUTION_CONTACT "https://distribution.example/packages/renderdoc" +// #define DISTRIBUTION_CONTACT "https://distribution.example/packages/renderdoc" #endif /////////////////////////////////////////////////////////////////////////////////////// diff --git a/renderdoc/common/dds_readwrite.cpp b/renderdoc/common/dds_readwrite.cpp index 74454b661..ed89c0356 100644 --- a/renderdoc/common/dds_readwrite.cpp +++ b/renderdoc/common/dds_readwrite.cpp @@ -1017,8 +1017,7 @@ RDResult load_dds_from_file(StreamReader *reader, read_dds_data &ret) ret.format = DXGIFormat2ResourceFormat(headerDXT10.dxgiFormat); if(ret.format.type == ResourceFormatType::Undefined) { - RETURN_ERROR_RESULT(ResultCode::ImageUnsupported, - "Unsupported DXGI_FORMAT %u loaded from DDS", + RETURN_ERROR_RESULT(ResultCode::ImageUnsupported, "Unsupported DXGI_FORMAT %u loaded from DDS", uint32_t(headerDXT10.dxgiFormat)); } } @@ -1117,8 +1116,10 @@ RDResult load_dds_from_file(StreamReader *reader, read_dds_data &ret) else { const uint32_t bits[] = { - Bits::CountOnes(header.ddspf.dwRBitMask), Bits::CountOnes(header.ddspf.dwGBitMask), - Bits::CountOnes(header.ddspf.dwBBitMask), Bits::CountOnes(header.ddspf.dwABitMask), + Bits::CountOnes(header.ddspf.dwRBitMask), + Bits::CountOnes(header.ddspf.dwGBitMask), + Bits::CountOnes(header.ddspf.dwBBitMask), + Bits::CountOnes(header.ddspf.dwABitMask), }; if((bits[1] != 0 && bits[1] != bits[0]) || (bits[2] != 0 && bits[2] != bits[0]) || (bits[3] != 0 && bits[3] != bits[0])) diff --git a/renderdoc/common/wrapped_pool.h b/renderdoc/common/wrapped_pool.h index 2adb3941b..189e84675 100644 --- a/renderdoc/common/wrapped_pool.h +++ b/renderdoc/common/wrapped_pool.h @@ -167,7 +167,7 @@ private: } ~ItemPool() { - delete[](uint8_t *) items; + delete[](uint8_t *)items; delete[] freeStack; } void *Allocate() @@ -214,12 +214,21 @@ private: friend typename FriendMaker::Type; }; -#define ALLOCATE_WITH_WRAPPED_POOL(...) \ - typedef WrappingPool<__VA_ARGS__> PoolType; \ - static PoolType m_Pool; \ - void *operator new(size_t sz) { return m_Pool.Allocate(); } \ - void operator delete(void *p) { m_Pool.Deallocate(p); } \ - static bool IsAlloc(const void *p) { return m_Pool.IsAlloc(p); } +#define ALLOCATE_WITH_WRAPPED_POOL(...) \ + typedef WrappingPool<__VA_ARGS__> PoolType; \ + static PoolType m_Pool; \ + void *operator new(size_t sz) \ + { \ + return m_Pool.Allocate(); \ + } \ + void operator delete(void *p) \ + { \ + m_Pool.Deallocate(p); \ + } \ + static bool IsAlloc(const void *p) \ + { \ + return m_Pool.IsAlloc(p); \ + } #define WRAPPED_POOL_INST(a) \ a::PoolType a::m_Pool; \ DECLARE_STRINGISE_TYPE(a); diff --git a/renderdoc/core/core.h b/renderdoc/core/core.h index 7d873946b..ba4a5e125 100644 --- a/renderdoc/core/core.h +++ b/renderdoc/core/core.h @@ -296,11 +296,10 @@ ITERABLE_OPERATORS(LoadProgress); inline constexpr float ProgressWeight(LoadProgress section) { // values must sum to 1.0 - return section == LoadProgress::DebugManagerInit - ? 0.1f - : section == LoadProgress::FileInitialRead - ? 0.75f - : section == LoadProgress::FrameEventsRead ? 0.15f : 0.0f; + return section == LoadProgress::DebugManagerInit ? 0.1f + : section == LoadProgress::FileInitialRead ? 0.75f + : section == LoadProgress::FrameEventsRead ? 0.15f + : 0.0f; } enum class CaptureProgress @@ -331,17 +330,13 @@ ITERABLE_OPERATORS(CaptureProgress); inline constexpr float ProgressWeight(CaptureProgress section) { // values must sum to 1.0 - return section == CaptureProgress::PrepareInitialStates - ? 0.25f - : section == CaptureProgress::AddReferencedResources - ? 0.25f - : section == CaptureProgress::FrameCapture - ? 0.15f - : section == CaptureProgress::SerialiseInitialStates - ? 0.25f - : section == CaptureProgress::SerialiseFrameContents - ? 0.08f - : section == CaptureProgress::FileWriting ? 0.02f : 0.0f; + return section == CaptureProgress::PrepareInitialStates ? 0.25f + : section == CaptureProgress::AddReferencedResources ? 0.25f + : section == CaptureProgress::FrameCapture ? 0.15f + : section == CaptureProgress::SerialiseInitialStates ? 0.25f + : section == CaptureProgress::SerialiseFrameContents ? 0.08f + : section == CaptureProgress::FileWriting ? 0.02f + : 0.0f; } // utility function to fake progress with x going from 0 to infinity, mapping to 0% to 100% in an diff --git a/renderdoc/core/replay_proxy.cpp b/renderdoc/core/replay_proxy.cpp index 1c043d42f..c50197c1d 100644 --- a/renderdoc/core/replay_proxy.cpp +++ b/renderdoc/core/replay_proxy.cpp @@ -184,7 +184,7 @@ struct RemoteExecution #define REMOTE_EXECUTION() RemoteExecution exec(this); // uncomment the following to print verbose debugging prints for the remote proxy packets -//#define PROXY_DEBUG(...) RDCDEBUG(__VA_ARGS__) +// #define PROXY_DEBUG(...) RDCDEBUG(__VA_ARGS__) #if !defined(PROXY_DEBUG) #define PROXY_DEBUG(...) \ diff --git a/renderdoc/core/settings.h b/renderdoc/core/settings.h index 5f92567cc..a0056757f 100644 --- a/renderdoc/core/settings.h +++ b/renderdoc/core/settings.h @@ -58,7 +58,10 @@ CONFIG_SUPPORT_TYPE(rdcarray); #define RDOC_CONFIG(type, name, defaultValue, description) \ static ConfigVarRegistration CONCAT(config, __LINE__)( \ STRING_LITERAL(STRINGIZE(name)), defaultValue, false, STRING_LITERAL(description)); \ - const type &name() { return CONCAT(config, __LINE__).value(); } + const type &name() \ + { \ + return CONCAT(config, __LINE__).value(); \ + } #define RDOC_EXTERN_CONFIG(type, name) extern const type &name(); // debug configs get set to constants in official stable builds, they will remain configurable @@ -78,5 +81,8 @@ CONFIG_SUPPORT_TYPE(rdcarray); #define RDOC_DEBUG_CONFIG(type, name, defaultValue, description) \ static ConfigVarRegistration CONCAT(config, __LINE__)( \ STRING_LITERAL(STRINGIZE(name)), defaultValue, true, STRING_LITERAL(description)); \ - const type &name() { return CONCAT(config, __LINE__).value(); } + const type &name() \ + { \ + return CONCAT(config, __LINE__).value(); \ + } #endif diff --git a/renderdoc/core/sparse_page_table.cpp b/renderdoc/core/sparse_page_table.cpp index 98888efb3..c33fcf025 100644 --- a/renderdoc/core/sparse_page_table.cpp +++ b/renderdoc/core/sparse_page_table.cpp @@ -859,7 +859,8 @@ Coord PageTable::calcSubresourcePageDim(uint32_t subresource) const const uint32_t mipLevel = subresource % m_MipCount; const Sparse::Coord mipDim = { - RDCMAX(1U, m_TextureDim.x >> mipLevel), RDCMAX(1U, m_TextureDim.y >> mipLevel), + RDCMAX(1U, m_TextureDim.x >> mipLevel), + RDCMAX(1U, m_TextureDim.y >> mipLevel), RDCMAX(1U, m_TextureDim.z >> mipLevel), }; diff --git a/renderdoc/core/target_control.cpp b/renderdoc/core/target_control.cpp index 716e6c38a..08dd2520b 100644 --- a/renderdoc/core/target_control.cpp +++ b/renderdoc/core/target_control.cpp @@ -887,8 +887,7 @@ public: m_API = ToStr(driver); RDCLOG("Used API: %s (%s & %s)", msg.apiUse.name.c_str(), - presenting ? "Presenting" : "Not presenting", - supported ? "supported" : "not supported"); + presenting ? "Presenting" : "Not presenting", supported ? "supported" : "not supported"); if(!supportMessage.empty()) { diff --git a/renderdoc/data/glsl/array2ms.comp b/renderdoc/data/glsl/array2ms.comp index f58ea1653..ad2646b17 100644 --- a/renderdoc/data/glsl/array2ms.comp +++ b/renderdoc/data/glsl/array2ms.comp @@ -77,7 +77,7 @@ void main() int sampleIdx = sampleOffset + int(id.z % numMultiSamples); uvec4 data = - texelFetch(srcArray, ivec3(int(id.x), int(id.y), slice *numMultiSamples + sampleIdx), 0); + texelFetch(srcArray, ivec3(int(id.x), int(id.y), slice * numMultiSamples + sampleIdx), 0); imageStore(dstMS, ivec3(int(id.x), int(id.y), slice), sampleIdx, data); } diff --git a/renderdoc/data/glsl/deptharr2ms.frag b/renderdoc/data/glsl/deptharr2ms.frag index 5ecb7c296..62c9c6a7b 100644 --- a/renderdoc/data/glsl/deptharr2ms.frag +++ b/renderdoc/data/glsl/deptharr2ms.frag @@ -68,7 +68,7 @@ uniform ivec4 mscopy; void main() { ivec3 srcCoord = - ivec3(int(gl_FragCoord.x), int(gl_FragCoord.y), currentSlice *numMultiSamples + gl_SampleID); + ivec3(int(gl_FragCoord.x), int(gl_FragCoord.y), currentSlice * numMultiSamples + gl_SampleID); if(currentStencil < 256u) { diff --git a/renderdoc/data/glsl/vk_depthbuf2ms.frag b/renderdoc/data/glsl/vk_depthbuf2ms.frag index e803636fc..bb43502d7 100644 --- a/renderdoc/data/glsl/vk_depthbuf2ms.frag +++ b/renderdoc/data/glsl/vk_depthbuf2ms.frag @@ -56,7 +56,7 @@ mscopy; void main() { ivec3 srcCoord = - ivec3(int(gl_FragCoord.x), int(gl_FragCoord.y), currentSlice *numMultiSamples + gl_SampleID); + ivec3(int(gl_FragCoord.x), int(gl_FragCoord.y), currentSlice * numMultiSamples + gl_SampleID); uint idx = srcCoord.x + textureWidth * (srcCoord.y + (textureHeight * srcCoord.z)); float depth = 0; diff --git a/renderdoc/data/glsl/vk_texsample.h b/renderdoc/data/glsl/vk_texsample.h index 2d378eb83..fa3a66930 100644 --- a/renderdoc/data/glsl/vk_texsample.h +++ b/renderdoc/data/glsl/vk_texsample.h @@ -125,11 +125,20 @@ vec4 SampleTextureFloat4(int type, vec2 pos, float slice, int mipLevel, int samp float data[] = { // plane 0 - col.x, col.y, col.z, col.w, + col.x, + col.y, + col.z, + col.w, // plane 1 - col2.x, col2.y, col2.z, col2.w, + col2.x, + col2.y, + col2.z, + col2.w, // plane 3 - col3.x, col3.y, col3.z, col3.w, + col3.x, + col3.y, + col3.z, + col3.w, }; col = vec4(0, 0, 0, 1); diff --git a/renderdoc/data/glsl_shaders.cpp b/renderdoc/data/glsl_shaders.cpp index 65f137e80..a0339c6fb 100644 --- a/renderdoc/data/glsl_shaders.cpp +++ b/renderdoc/data/glsl_shaders.cpp @@ -111,10 +111,9 @@ rdcstr GenerateGLSLShader(const rdcstr &shader, ShaderType type, int version, co combined += shader; const char *c_src = combined.c_str(); - glslang::EShClient client = - type == ShaderType::Vulkan ? glslang::EShClientVulkan : type == ShaderType::GLSPIRV - ? glslang::EShClientOpenGL - : glslang::EShClientNone; + glslang::EShClient client = type == ShaderType::Vulkan ? glslang::EShClientVulkan + : type == ShaderType::GLSPIRV ? glslang::EShClientOpenGL + : glslang::EShClientNone; glslang::EShTargetClientVersion targetversion = type == ShaderType::Vulkan ? glslang::EShTargetVulkan_1_0 : glslang::EShTargetOpenGL_450; int inputVersion = client != glslang::EShClientNone ? 100 : 0; diff --git a/renderdoc/data/hlsl/histogram.hlsl b/renderdoc/data/hlsl/histogram.hlsl index a626692e1..84bcce380 100644 --- a/renderdoc/data/hlsl/histogram.hlsl +++ b/renderdoc/data/hlsl/histogram.hlsl @@ -37,8 +37,7 @@ RWBuffer MinMaxDestInt : register(u2); [numthreads(HGRAM_TILES_PER_BLOCK, HGRAM_TILES_PER_BLOCK, 1)] void RENDERDOC_TileMinMaxCS( uint3 tid : SV_GroupThreadID, uint3 gid - : SV_GroupID) -{ + : SV_GroupID) { uint texType = SHADER_RESTYPE; uint3 texDim = uint3(HistogramTextureResolution); @@ -155,8 +154,7 @@ RWBuffer MinMaxResultDestFloat : register(u0); RWBuffer MinMaxResultDestUInt : register(u1); RWBuffer MinMaxResultDestInt : register(u2); -[numthreads(1, 1, 1)] void RENDERDOC_ResultMinMaxCS() -{ +[numthreads(1, 1, 1)] void RENDERDOC_ResultMinMaxCS() { uint3 texDim = uint3(HistogramTextureResolution); uint blocksX = (int)ceil(float(texDim.x) / float(HGRAM_PIXELS_PER_TILE * HGRAM_TILES_PER_BLOCK)); @@ -219,8 +217,7 @@ RWBuffer HistogramDest : register(u0); [numthreads(HGRAM_TILES_PER_BLOCK, HGRAM_TILES_PER_BLOCK, 1)] void RENDERDOC_HistogramCS( uint3 tid : SV_GroupThreadID, uint3 gid - : SV_GroupID) -{ + : SV_GroupID) { uint texType = SHADER_RESTYPE; uint3 texDim = uint3(HistogramTextureResolution); diff --git a/renderdoc/data/hlsl/mesh.hlsl b/renderdoc/data/hlsl/mesh.hlsl index c326921e8..75c6a0934 100644 --- a/renderdoc/data/hlsl/mesh.hlsl +++ b/renderdoc/data/hlsl/mesh.hlsl @@ -71,8 +71,7 @@ cbuffer viewportCBuf : register(b0) }; [maxvertexcount(3)] void RENDERDOC_TriangleSizeGS(triangle meshV2F input[3], - inout TriangleStream TriStream) -{ + inout TriangleStream TriStream) { triSizeV2F output; float2 a = input[0].pos.xy / input[0].pos.w; @@ -100,14 +99,14 @@ cbuffer viewportCBuf : register(b0) TriStream.RestartStrip(); } -float4 RENDERDOC_TriangleSizePS(triSizeV2F IN) : SV_Target0 +float4 RENDERDOC_TriangleSizePS(triSizeV2F IN) + : SV_Target0 { return float4(max(IN.pixarea, 0.001f).xxx, 1.0f); } [maxvertexcount(3)] void RENDERDOC_MeshGS(triangle meshV2F input[3], - inout TriangleStream TriStream) -{ + inout TriangleStream TriStream) { meshV2F output; float4 faceEdgeA = mul(input[1].pos, InvProj) - mul(input[0].pos, InvProj); @@ -124,7 +123,8 @@ float4 RENDERDOC_TriangleSizePS(triSizeV2F IN) : SV_Target0 TriStream.RestartStrip(); } -float4 RENDERDOC_MeshPS(meshV2F IN) : SV_Target0 +float4 RENDERDOC_MeshPS(meshV2F IN) + : SV_Target0 { uint type = MeshDisplayFormat; @@ -306,8 +306,8 @@ void defaultPath(uint threadID) } } -[numthreads(1024, 1, 1)] void RENDERDOC_MeshPickCS(uint3 tid : SV_DispatchThreadID) -{ +[numthreads(1024, 1, 1)] void RENDERDOC_MeshPickCS(uint3 tid + : SV_DispatchThreadID) { if(PickMeshMode == MESH_OTHER) { defaultPath(tid.x); diff --git a/renderdoc/data/hlsl/pixelhistory.hlsl b/renderdoc/data/hlsl/pixelhistory.hlsl index 43fd7e742..6f1caa450 100644 --- a/renderdoc/data/hlsl/pixelhistory.hlsl +++ b/renderdoc/data/hlsl/pixelhistory.hlsl @@ -59,12 +59,11 @@ RWBuffer copyout_float : register(u1); RWBuffer copyout_uint : register(u2); RWBuffer copyout_int : register(u3); -[numthreads(1, 1, 1)] void RENDERDOC_PixelHistoryUnused() -{ +[numthreads(1, 1, 1)] void RENDERDOC_PixelHistoryUnused() { copyout_depth[dst_slot] = float4(-1.0f, -1.0f, 0.0f, 0.0f); } -[numthreads(1, 1, 1)] void RENDERDOC_PixelHistoryCopyPixel() + [numthreads(1, 1, 1)] void RENDERDOC_PixelHistoryCopyPixel() { if(multisampled) { diff --git a/renderdoc/data/hlsl/shaderdebug.hlsl b/renderdoc/data/hlsl/shaderdebug.hlsl index 8f0428390..0435c64aa 100644 --- a/renderdoc/data/hlsl/shaderdebug.hlsl +++ b/renderdoc/data/hlsl/shaderdebug.hlsl @@ -33,8 +33,7 @@ struct OutStruct RWStructuredBuffer outBuf : register(u1); -[numthreads(1, 1, 1)] void RENDERDOC_DebugMathOp() -{ +[numthreads(1, 1, 1)] void RENDERDOC_DebugMathOp() { switch(mathOp) { case DEBUG_SAMPLE_MATH_RCP: outBuf[0].outf[0] = rcp(mathInVal); break; diff --git a/renderdoc/data/hlsl/text.hlsl b/renderdoc/data/hlsl/text.hlsl index 01392cec3..52025ce7d 100644 --- a/renderdoc/data/hlsl/text.hlsl +++ b/renderdoc/data/hlsl/text.hlsl @@ -69,7 +69,10 @@ v2f RENDERDOC_TextVS(uint vid : SV_VertexID, uint inst : SV_InstanceID) { // easy-mode on FL10 and up, use vertex/instance index float2 verts[] = { - float2(0.0, 0.0), float2(1.0, 0.0), float2(0.0, 1.0), float2(1.0, 1.0), + float2(0.0, 0.0), + float2(1.0, 0.0), + float2(0.0, 1.0), + float2(1.0, 1.0), }; return Text(verts[vid], int(inst), chars[inst].x); diff --git a/renderdoc/driver/d3d11/d3d11_context.cpp b/renderdoc/driver/d3d11/d3d11_context.cpp index 54daa219b..314fb0728 100644 --- a/renderdoc/driver/d3d11/d3d11_context.cpp +++ b/renderdoc/driver/d3d11/d3d11_context.cpp @@ -385,8 +385,10 @@ bool WrappedID3D11DeviceContext::Serialise_BeginCaptureFrame(SerialiserType &ser SAFE_RELEASE(so.query); D3D11_QUERY queryTypes[] = { - D3D11_QUERY_SO_STATISTICS_STREAM0, D3D11_QUERY_SO_STATISTICS_STREAM1, - D3D11_QUERY_SO_STATISTICS_STREAM2, D3D11_QUERY_SO_STATISTICS_STREAM3, + D3D11_QUERY_SO_STATISTICS_STREAM0, + D3D11_QUERY_SO_STATISTICS_STREAM1, + D3D11_QUERY_SO_STATISTICS_STREAM2, + D3D11_QUERY_SO_STATISTICS_STREAM3, }; D3D11_QUERY_DESC qdesc; @@ -694,10 +696,7 @@ bool WrappedID3D11DeviceContext::IsFL11_1() bool WrappedID3D11DeviceContext::ProcessChunk(ReadSerialiser &ser, D3D11Chunk chunk) { - SERIALISE_ELEMENT(m_CurContextId) - .Named("Context"_lit) - .TypedAs("ID3D11DeviceContext *"_lit) - .Unimportant(); + SERIALISE_ELEMENT(m_CurContextId).Named("Context"_lit).TypedAs("ID3D11DeviceContext *"_lit).Unimportant(); SERIALISE_CHECK_READ_ERRORS(); @@ -899,9 +898,7 @@ bool WrappedID3D11DeviceContext::ProcessChunk(ReadSerialiser &ser, D3D11Chunk ch ret = Serialise_SwapDeviceContextState(ser, NULL, NULL); break; - case D3D11Chunk::SwapchainPresent: - ret = Serialise_Present(ser, 0, 0); - break; + case D3D11Chunk::SwapchainPresent: ret = Serialise_Present(ser, 0, 0); break; // in order to get a warning if we miss a case, we explicitly handle the device creation chunks // here. If we actually encounter one it's an error (we shouldn't see these inside the captured diff --git a/renderdoc/driver/d3d11/d3d11_context_wrap.cpp b/renderdoc/driver/d3d11/d3d11_context_wrap.cpp index 90d3eefda..16029fe8b 100644 --- a/renderdoc/driver/d3d11/d3d11_context_wrap.cpp +++ b/renderdoc/driver/d3d11/d3d11_context_wrap.cpp @@ -2234,8 +2234,10 @@ bool WrappedID3D11DeviceContext::Serialise_SOSetTargets(SerialiserType &ser, UIN SAFE_RELEASE(so.query); D3D11_QUERY queryTypes[] = { - D3D11_QUERY_SO_STATISTICS_STREAM0, D3D11_QUERY_SO_STATISTICS_STREAM1, - D3D11_QUERY_SO_STATISTICS_STREAM2, D3D11_QUERY_SO_STATISTICS_STREAM3, + D3D11_QUERY_SO_STATISTICS_STREAM0, + D3D11_QUERY_SO_STATISTICS_STREAM1, + D3D11_QUERY_SO_STATISTICS_STREAM2, + D3D11_QUERY_SO_STATISTICS_STREAM3, }; D3D11_QUERY_DESC qdesc; @@ -2351,8 +2353,10 @@ void WrappedID3D11DeviceContext::SOSetTargets(UINT NumBuffers, ID3D11Buffer *con SAFE_RELEASE(so.query); D3D11_QUERY queryTypes[] = { - D3D11_QUERY_SO_STATISTICS_STREAM0, D3D11_QUERY_SO_STATISTICS_STREAM1, - D3D11_QUERY_SO_STATISTICS_STREAM2, D3D11_QUERY_SO_STATISTICS_STREAM3, + D3D11_QUERY_SO_STATISTICS_STREAM0, + D3D11_QUERY_SO_STATISTICS_STREAM1, + D3D11_QUERY_SO_STATISTICS_STREAM2, + D3D11_QUERY_SO_STATISTICS_STREAM3, }; D3D11_QUERY_DESC qdesc; diff --git a/renderdoc/driver/d3d11/d3d11_debug.cpp b/renderdoc/driver/d3d11/d3d11_debug.cpp index c12af99ca..c938e37db 100644 --- a/renderdoc/driver/d3d11/d3d11_debug.cpp +++ b/renderdoc/driver/d3d11/d3d11_debug.cpp @@ -1232,7 +1232,8 @@ void D3D11Replay::MeshRendering::Init(WrappedID3D11Device *device) { // these elements are just for signature matching sake, so we don't need correct offsets/slots D3D11_INPUT_ELEMENT_DESC inputDescSecondary[2] = { - {"pos", 0, DXGI_FORMAT_R32G32B32A32_FLOAT}, {"sec", 0, DXGI_FORMAT_R8G8B8A8_UNORM}, + {"pos", 0, DXGI_FORMAT_R32G32B32A32_FLOAT}, + {"sec", 0, DXGI_FORMAT_R8G8B8A8_UNORM}, }; rdcstr meshhlsl = GetEmbeddedResource(mesh_hlsl); diff --git a/renderdoc/driver/d3d11/d3d11_device.cpp b/renderdoc/driver/d3d11/d3d11_device.cpp index be37dfde3..d1e6ff68d 100644 --- a/renderdoc/driver/d3d11/d3d11_device.cpp +++ b/renderdoc/driver/d3d11/d3d11_device.cpp @@ -1211,8 +1211,7 @@ bool WrappedID3D11Device::ProcessChunk(ReadSerialiser &ser, D3D11Chunk context) case D3D11Chunk::PostExecuteCommandList: case D3D11Chunk::PostFinishCommandListSet: case D3D11Chunk::SwapDeviceContextState: - case D3D11Chunk::SwapchainPresent: - return m_pImmediateContext->ProcessChunk(ser, context); + case D3D11Chunk::SwapchainPresent: return m_pImmediateContext->ProcessChunk(ser, context); // no explicit default so that we have compiler warnings if a chunk isn't explicitly handled. case D3D11Chunk::Max: break; @@ -2317,8 +2316,9 @@ bool WrappedID3D11Device::EndFrameCapture(DeviceOwnedWindow devWnd) m_TextRenderer->SetOutputWindow(swapper->GetHWND()); m_TextRenderer->RenderText( - 0.0f, 0.0f, StringFormat::Fmt("Failed to capture frame %u: %s", - m_CapturedFrames.back().frameNumber, reasonString)); + 0.0f, 0.0f, + StringFormat::Fmt("Failed to capture frame %u: %s", m_CapturedFrames.back().frameNumber, + reasonString)); } old.ApplyState(m_pImmediateContext); diff --git a/renderdoc/driver/d3d11/d3d11_overlay.cpp b/renderdoc/driver/d3d11/d3d11_overlay.cpp index c9c53d0bf..389118865 100644 --- a/renderdoc/driver/d3d11/d3d11_overlay.cpp +++ b/renderdoc/driver/d3d11/d3d11_overlay.cpp @@ -852,10 +852,8 @@ ResourceId D3D11Replay::RenderOverlay(ResourceId texid, FloatVector clearCol, De /*StencilEnable =*/FALSE, /*StencilReadMask =*/D3D11_DEFAULT_STENCIL_READ_MASK, /*StencilWriteMask =*/D3D11_DEFAULT_STENCIL_WRITE_MASK, - /*FrontFace =*/{D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, - D3D11_COMPARISON_ALWAYS}, - /*BackFace =*/{D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, - D3D11_COMPARISON_ALWAYS}, + /*FrontFace =*/{D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_COMPARISON_ALWAYS}, + /*BackFace =*/{D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_COMPARISON_ALWAYS}, }; ID3D11DepthStencilState *ds = NULL; @@ -1093,10 +1091,8 @@ ResourceId D3D11Replay::RenderOverlay(ResourceId texid, FloatVector clearCol, De /*StencilEnable =*/FALSE, /*StencilReadMask =*/D3D11_DEFAULT_STENCIL_READ_MASK, /*StencilWriteMask =*/D3D11_DEFAULT_STENCIL_WRITE_MASK, - /*FrontFace =*/{D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, - D3D11_COMPARISON_ALWAYS}, - /*BackFace =*/{D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, - D3D11_COMPARISON_ALWAYS}, + /*FrontFace =*/{D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_COMPARISON_ALWAYS}, + /*BackFace =*/{D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_COMPARISON_ALWAYS}, }; ID3D11DepthStencilState *ds = NULL; diff --git a/renderdoc/driver/d3d11/d3d11_pixelhistory.cpp b/renderdoc/driver/d3d11/d3d11_pixelhistory.cpp index 13931636f..9599b314c 100644 --- a/renderdoc/driver/d3d11/d3d11_pixelhistory.cpp +++ b/renderdoc/driver/d3d11/d3d11_pixelhistory.cpp @@ -1529,10 +1529,8 @@ rdcarray D3D11Replay::PixelHistory(rdcarray event /*StencilEnable =*/FALSE, /*StencilReadMask =*/D3D11_DEFAULT_STENCIL_READ_MASK, /*StencilWriteMask =*/D3D11_DEFAULT_STENCIL_WRITE_MASK, - /*FrontFace =*/{D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, - D3D11_COMPARISON_ALWAYS}, - /*BackFace =*/{D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, - D3D11_COMPARISON_ALWAYS}, + /*FrontFace =*/{D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_COMPARISON_ALWAYS}, + /*BackFace =*/{D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_COMPARISON_ALWAYS}, }; if(curDS) @@ -1825,9 +1823,8 @@ rdcarray D3D11Replay::PixelHistory(rdcarray event break; } - if(!mod.backfaceCulled && - (flags[i] & (TestEnabled_Scissor | TestMustPass_Scissor | TestMustFail_Scissor)) == - TestEnabled_Scissor) + if(!mod.backfaceCulled && (flags[i] & (TestEnabled_Scissor | TestMustPass_Scissor | + TestMustFail_Scissor)) == TestEnabled_Scissor) { do { @@ -2069,10 +2066,12 @@ rdcarray D3D11Replay::PixelHistory(rdcarray event /*StencilEnable =*/TRUE, /*StencilReadMask =*/D3D11_DEFAULT_STENCIL_READ_MASK, /*StencilWriteMask =*/D3D11_DEFAULT_STENCIL_WRITE_MASK, - /*FrontFace =*/{D3D11_STENCIL_OP_INCR_SAT, D3D11_STENCIL_OP_INCR_SAT, - D3D11_STENCIL_OP_INCR_SAT, D3D11_COMPARISON_GREATER_EQUAL}, - /*BackFace =*/{D3D11_STENCIL_OP_INCR_SAT, D3D11_STENCIL_OP_INCR_SAT, - D3D11_STENCIL_OP_INCR_SAT, D3D11_COMPARISON_GREATER_EQUAL}, + /*FrontFace =*/ + {D3D11_STENCIL_OP_INCR_SAT, D3D11_STENCIL_OP_INCR_SAT, D3D11_STENCIL_OP_INCR_SAT, + D3D11_COMPARISON_GREATER_EQUAL}, + /*BackFace =*/ + {D3D11_STENCIL_OP_INCR_SAT, D3D11_STENCIL_OP_INCR_SAT, D3D11_STENCIL_OP_INCR_SAT, + D3D11_COMPARISON_GREATER_EQUAL}, }; if(curDS) { diff --git a/renderdoc/driver/d3d11/d3d11_rendermesh.cpp b/renderdoc/driver/d3d11/d3d11_rendermesh.cpp index 124ffc987..ddd2ef99f 100644 --- a/renderdoc/driver/d3d11/d3d11_rendermesh.cpp +++ b/renderdoc/driver/d3d11/d3d11_rendermesh.cpp @@ -392,9 +392,8 @@ void D3D11Replay::RenderMesh(uint32_t eventId, const rdcarray &secon // will be N*M long, N adjacent prims of M verts each. M = primSize below rdcarray adjacentPrimVertices; - D3D11_PRIMITIVE_TOPOLOGY primTopo = - D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST; // tri or line list - uint32_t primSize = 3; // number of verts per primitive + D3D11_PRIMITIVE_TOPOLOGY primTopo = D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST; // tri or line list + uint32_t primSize = 3; // number of verts per primitive if(meshtopo == D3D11_PRIMITIVE_TOPOLOGY_LINELIST || meshtopo == D3D11_PRIMITIVE_TOPOLOGY_LINELIST_ADJ || @@ -492,7 +491,10 @@ void D3D11Replay::RenderMesh(uint32_t eventId, const rdcarray &secon m_pImmediateContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); FloatVector vertSprite[4] = { - activeVertex, activeVertex, activeVertex, activeVertex, + activeVertex, + activeVertex, + activeVertex, + activeVertex, }; hr = m_pImmediateContext->Map(m_MeshRender.TriHighlightHelper, 0, D3D11_MAP_WRITE_DISCARD, 0, diff --git a/renderdoc/driver/d3d11/d3d11_rendertext.cpp b/renderdoc/driver/d3d11/d3d11_rendertext.cpp index d7e72a4e8..8d9e078d8 100644 --- a/renderdoc/driver/d3d11/d3d11_rendertext.cpp +++ b/renderdoc/driver/d3d11/d3d11_rendertext.cpp @@ -34,7 +34,10 @@ #include "data/hlsl/hlsl_cbuffers.h" static Vec2f quadPos[] = { - Vec2f(0.0f, 0.0f), Vec2f(1.0f, 0.0f), Vec2f(0.0f, 1.0f), Vec2f(1.0f, 1.0f), + Vec2f(0.0f, 0.0f), + Vec2f(1.0f, 0.0f), + Vec2f(0.0f, 1.0f), + Vec2f(1.0f, 1.0f), }; // see d3d11_debug.cpp D3D11DebugManager::D3D11DebugManager for why we use this helper like this diff --git a/renderdoc/driver/d3d11/d3d11_replay.cpp b/renderdoc/driver/d3d11/d3d11_replay.cpp index 56b0eaea7..ad547c87b 100644 --- a/renderdoc/driver/d3d11/d3d11_replay.cpp +++ b/renderdoc/driver/d3d11/d3d11_replay.cpp @@ -3942,9 +3942,8 @@ bool D3D11Replay::IsTextureSupported(const TextureDescription &tex) return false; if(tex.dimension == 3 && (supp & D3D11_FORMAT_SUPPORT_TEXTURE3D) == 0) return false; - if(tex.msSamp > 1 && - (supp & - (D3D11_FORMAT_SUPPORT_MULTISAMPLE_LOAD | D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET)) == 0) + if(tex.msSamp > 1 && (supp & (D3D11_FORMAT_SUPPORT_MULTISAMPLE_LOAD | + D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET)) == 0) return false; return true; @@ -4192,16 +4191,16 @@ RDResult D3D11_CreateReplayDevice(RDCFile *rdc, const ReplayOptions &opts, IRepl "Capture requires ags to replay, but it's not available or can't be initialised"); } - CreateDeviceAndSwapChain = [agsDev]( - IDXGIAdapter *pAdapter, D3D_DRIVER_TYPE DriverType, HMODULE Software, UINT Flags, - CONST D3D_FEATURE_LEVEL *pFeatureLevels, UINT FeatureLevels, UINT SDKVersion, - CONST DXGI_SWAP_CHAIN_DESC *pSwapChainDesc, IDXGISwapChain **ppSwapChain, - ID3D11Device **ppDevice, D3D_FEATURE_LEVEL *pFeatureLevel, - ID3D11DeviceContext **ppImmediateContext) { - return agsDev->CreateD3D11(pAdapter, DriverType, Software, Flags, pFeatureLevels, - FeatureLevels, SDKVersion, pSwapChainDesc, ppSwapChain, ppDevice, - pFeatureLevel, ppImmediateContext); - }; + CreateDeviceAndSwapChain = + [agsDev](IDXGIAdapter *pAdapter, D3D_DRIVER_TYPE DriverType, HMODULE Software, UINT Flags, + CONST D3D_FEATURE_LEVEL *pFeatureLevels, UINT FeatureLevels, UINT SDKVersion, + CONST DXGI_SWAP_CHAIN_DESC *pSwapChainDesc, IDXGISwapChain **ppSwapChain, + ID3D11Device **ppDevice, D3D_FEATURE_LEVEL *pFeatureLevel, + ID3D11DeviceContext **ppImmediateContext) { + return agsDev->CreateD3D11(pAdapter, DriverType, Software, Flags, pFeatureLevels, + FeatureLevels, SDKVersion, pSwapChainDesc, ppSwapChain, + ppDevice, pFeatureLevel, ppImmediateContext); + }; } else if(initParams.VendorExtensions != GPUVendor::Unknown) { diff --git a/renderdoc/driver/d3d11/d3d11_resources.h b/renderdoc/driver/d3d11/d3d11_resources.h index abd1f0f75..9e1ed6053 100644 --- a/renderdoc/driver/d3d11/d3d11_resources.h +++ b/renderdoc/driver/d3d11/d3d11_resources.h @@ -946,8 +946,7 @@ public: }; class WrappedID3D11UnorderedAccessView1 - : public WrappedView1 + : public WrappedView1 { public: ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D11UnorderedAccessView1); diff --git a/renderdoc/driver/d3d11/d3d11_shader_cache.cpp b/renderdoc/driver/d3d11/d3d11_shader_cache.cpp index b3f5d1d38..e9bfd97fe 100644 --- a/renderdoc/driver/d3d11/d3d11_shader_cache.cpp +++ b/renderdoc/driver/d3d11/d3d11_shader_cache.cpp @@ -132,10 +132,10 @@ rdcstr D3D11ShaderCache::GetShaderBlob(const char *source, const char *entry, rdcstr cbuffers = GetEmbeddedResource(hlsl_cbuffers_h); rdcstr texsample = GetEmbeddedResource(hlsl_texsample_h); - EmbeddedD3DIncluder includer(includeDirs, - { - {"hlsl_texsample.h", texsample}, {"hlsl_cbuffers.h", cbuffers}, - }); + EmbeddedD3DIncluder includer(includeDirs, { + {"hlsl_texsample.h", texsample}, + {"hlsl_cbuffers.h", cbuffers}, + }); uint32_t hash = strhash(source); hash = strhash(entry, hash); diff --git a/renderdoc/driver/d3d11/d3d11_shaderdebug.cpp b/renderdoc/driver/d3d11/d3d11_shaderdebug.cpp index 0e2f984f9..afa354e34 100644 --- a/renderdoc/driver/d3d11/d3d11_shaderdebug.cpp +++ b/renderdoc/driver/d3d11/d3d11_shaderdebug.cpp @@ -2448,9 +2448,8 @@ void ExtractInputsPS(PSInput IN, float4 debug_pixelPos : SV_Position, DebugHit *hit = winner; rdcarray &ins = state.inputs; - if(!ins.empty() && - ins.back().name == - dxbc->GetDXBCByteCode()->GetRegisterName(DXBCBytecode::TYPE_INPUT_COVERAGE_MASK, 0)) + if(!ins.empty() && ins.back().name == dxbc->GetDXBCByteCode()->GetRegisterName( + DXBCBytecode::TYPE_INPUT_COVERAGE_MASK, 0)) ins.back().value.u32v[0] = hit->coverage; state.semantics.coverage = hit->coverage; diff --git a/renderdoc/driver/d3d11/d3d11_video.cpp b/renderdoc/driver/d3d11/d3d11_video.cpp index 410268baf..450164260 100644 --- a/renderdoc/driver/d3d11/d3d11_video.cpp +++ b/renderdoc/driver/d3d11/d3d11_video.cpp @@ -1256,8 +1256,7 @@ HRESULT STDMETHODCALLTYPE WrappedID3D11VideoContext::VideoProcessorGetBehaviorHi /* [annotation] */ _In_ ID3D11VideoProcessor *pVideoProcessor, /* [annotation] */ _In_ UINT OutputWidth, /* [annotation] */ _In_ UINT OutputHeight, /* [annotation] */ _In_ DXGI_FORMAT OutputFormat, /* [annotation] */ _In_ UINT StreamCount, - /* [annotation] */ _In_reads_(StreamCount) - const D3D11_VIDEO_PROCESSOR_STREAM_BEHAVIOR_HINT *pStreams, + /* [annotation] */ _In_reads_(StreamCount) const D3D11_VIDEO_PROCESSOR_STREAM_BEHAVIOR_HINT *pStreams, /* [annotation] */ _Out_ UINT *pBehaviorHints) { if(!m_pReal1) @@ -1319,8 +1318,7 @@ HRESULT STDMETHODCALLTYPE WrappedID3D11VideoContext::DecoderBeginFrame1( /* [annotation] */ _In_ ID3D11VideoDecoder *pDecoder, /* [annotation] */ _In_ ID3D11VideoDecoderOutputView *pView, UINT ContentKeySize, /* [annotation] */ _In_reads_bytes_opt_(ContentKeySize) const void *pContentKey, - /* [annotation] */ _In_range_(0, D3D11_4_VIDEO_DECODER_MAX_HISTOGRAM_COMPONENTS) - UINT NumComponentHistograms, + /* [annotation] */ _In_range_(0, D3D11_4_VIDEO_DECODER_MAX_HISTOGRAM_COMPONENTS) UINT NumComponentHistograms, /* [annotation] */ _In_reads_opt_(NumComponentHistograms) const UINT *pHistogramOffsets, /* [annotation] */ _In_reads_opt_(NumComponentHistograms) ID3D11Buffer *const *ppHistogramBuffers) { diff --git a/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp index e42a277fd..127547e1b 100644 --- a/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp @@ -127,8 +127,8 @@ static rdcstr MakeRenderPassOpString(bool ending, UINT NumRenderTargets, if(pDepthStencil->StencilEndingAccess.Type == pDepthStencil->DepthEndingAccess.Type) opDesc += "DS=" + ToHumanStr(pDepthStencil->DepthEndingAccess.Type); else - opDesc += "D=" + ToHumanStr(pDepthStencil->DepthEndingAccess.Type) + ", S=" + - ToHumanStr(pDepthStencil->StencilEndingAccess.Type); + opDesc += "D=" + ToHumanStr(pDepthStencil->DepthEndingAccess.Type) + + ", S=" + ToHumanStr(pDepthStencil->StencilEndingAccess.Type); } else { @@ -136,8 +136,8 @@ static rdcstr MakeRenderPassOpString(bool ending, UINT NumRenderTargets, if(pDepthStencil->StencilBeginningAccess.Type == pDepthStencil->DepthBeginningAccess.Type) opDesc += "DS=" + ToHumanStr(pDepthStencil->DepthBeginningAccess.Type); else - opDesc += "D=" + ToHumanStr(pDepthStencil->DepthBeginningAccess.Type) + ", S=" + - ToHumanStr(pDepthStencil->StencilBeginningAccess.Type); + opDesc += "D=" + ToHumanStr(pDepthStencil->DepthBeginningAccess.Type) + + ", S=" + ToHumanStr(pDepthStencil->StencilBeginningAccess.Type); } } } diff --git a/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp index 609c67c14..68913f341 100644 --- a/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp @@ -4659,9 +4659,8 @@ bool WrappedID3D12GraphicsCommandList::Serialise_ClearDepthStencilView( m_Cmd->HandlePreCallback(list, ActionFlags::Clear | ActionFlags::ClearDepthStencil); Unwrap(list)->ClearDepthStencilView(Unwrap(DepthStencilView), ClearFlags, Depth, Stencil, NumRects, pRects); - if(eventId && - m_Cmd->m_ActionCallback->PostMisc( - eventId, ActionFlags::Clear | ActionFlags::ClearDepthStencil, list)) + if(eventId && m_Cmd->m_ActionCallback->PostMisc( + eventId, ActionFlags::Clear | ActionFlags::ClearDepthStencil, list)) { Unwrap(list)->ClearDepthStencilView(Unwrap(DepthStencilView), ClearFlags, Depth, Stencil, NumRects, pRects); @@ -4766,9 +4765,8 @@ bool WrappedID3D12GraphicsCommandList::Serialise_ClearRenderTargetView( uint32_t eventId = m_Cmd->HandlePreCallback(list, ActionFlags::Clear | ActionFlags::ClearColor); Unwrap(list)->ClearRenderTargetView(Unwrap(RenderTargetView), ColorRGBA, NumRects, pRects); - if(eventId && - m_Cmd->m_ActionCallback->PostMisc(eventId, ActionFlags::Clear | ActionFlags::ClearColor, - list)) + if(eventId && m_Cmd->m_ActionCallback->PostMisc( + eventId, ActionFlags::Clear | ActionFlags::ClearColor, list)) { Unwrap(list)->ClearRenderTargetView(Unwrap(RenderTargetView), ColorRGBA, NumRects, pRects); m_Cmd->m_ActionCallback->PostRemisc(eventId, ActionFlags::Clear | ActionFlags::ClearColor, diff --git a/renderdoc/driver/d3d12/d3d12_command_queue_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_queue_wrap.cpp index 17b71b45b..167e6c90d 100644 --- a/renderdoc/driver/d3d12/d3d12_command_queue_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_command_queue_wrap.cpp @@ -181,8 +181,9 @@ void STDMETHODCALLTYPE WrappedID3D12CommandQueue::UpdateTileMappings( else { pageTable.setImageBoxRange( - regionStart.Subresource, {regionStart.X * texelShape.x, regionStart.Y * texelShape.y, - regionStart.Z * texelShape.z}, + regionStart.Subresource, + {regionStart.X * texelShape.x, regionStart.Y * texelShape.y, + regionStart.Z * texelShape.z}, {regionSize.Width * texelShape.x, regionSize.Height * texelShape.y, regionSize.Depth * texelShape.z}, memId, memoryOffsetInTiles * pageSize, singlePage); diff --git a/renderdoc/driver/d3d12/d3d12_commands.cpp b/renderdoc/driver/d3d12/d3d12_commands.cpp index 926731452..d753d34aa 100644 --- a/renderdoc/driver/d3d12/d3d12_commands.cpp +++ b/renderdoc/driver/d3d12/d3d12_commands.cpp @@ -921,9 +921,7 @@ bool WrappedID3D12CommandQueue::ProcessChunk(ReadSerialiser &ser, D3D12Chunk chu case D3D12Chunk::Swapchain_Present: ret = m_pDevice->Serialise_Present(ser, NULL, 0, 0); break; - case D3D12Chunk::List_ClearState: - ret = m_ReplayList->Serialise_ClearState(ser, NULL); - break; + case D3D12Chunk::List_ClearState: ret = m_ReplayList->Serialise_ClearState(ser, NULL); break; // in order to get a warning if we miss a case, we explicitly handle the device creation chunks // here. If we actually encounter one it's an error (we shouldn't see these inside the captured diff --git a/renderdoc/driver/d3d12/d3d12_debug.cpp b/renderdoc/driver/d3d12/d3d12_debug.cpp index 678c5878e..a4fd6b0d1 100644 --- a/renderdoc/driver/d3d12/d3d12_debug.cpp +++ b/renderdoc/driver/d3d12/d3d12_debug.cpp @@ -1939,7 +1939,8 @@ void D3D12Replay::TextureRendering::Init(WrappedID3D12Device *device, D3D12Debug ID3DBlob *TexRemap[3] = {}; DXGI_FORMAT formats[3] = { - DXGI_FORMAT_R8G8B8A8_TYPELESS, DXGI_FORMAT_R16G16B16A16_TYPELESS, + DXGI_FORMAT_R8G8B8A8_TYPELESS, + DXGI_FORMAT_R16G16B16A16_TYPELESS, DXGI_FORMAT_R32G32B32A32_TYPELESS, }; diff --git a/renderdoc/driver/d3d12/d3d12_device.h b/renderdoc/driver/d3d12/d3d12_device.h index 073649081..16150ce69 100644 --- a/renderdoc/driver/d3d12/d3d12_device.h +++ b/renderdoc/driver/d3d12/d3d12_device.h @@ -444,14 +444,16 @@ public: }; // these aren't documented, they're defined in D3D12TranslationLayer in the d3d11on12 codebase -typedef enum D3D12_COMPATIBILITY_SHARED_FLAGS { +typedef enum D3D12_COMPATIBILITY_SHARED_FLAGS +{ D3D12_COMPATIBILITY_SHARED_FLAG_NONE = 0, D3D12_COMPATIBILITY_SHARED_FLAG_NON_NT_HANDLE = 0x1, D3D12_COMPATIBILITY_SHARED_FLAG_KEYED_MUTEX = 0x2, D3D12_COMPATIBILITY_SHARED_FLAG_9_ON_12 = 0x4 } D3D12_COMPATIBILITY_SHARED_FLAGS; -typedef enum D3D12_REFLECT_SHARED_PROPERTY { +typedef enum D3D12_REFLECT_SHARED_PROPERTY +{ D3D12_REFLECT_SHARED_PROPERTY_D3D11_RESOURCE_FLAGS = 0, D3D12_REFELCT_SHARED_PROPERTY_COMPATIBILITY_SHARED_FLAGS = (D3D12_REFLECT_SHARED_PROPERTY_D3D11_RESOURCE_FLAGS + 1), diff --git a/renderdoc/driver/d3d12/d3d12_device_wrap.cpp b/renderdoc/driver/d3d12/d3d12_device_wrap.cpp index 002609d3f..dea8bf3b1 100644 --- a/renderdoc/driver/d3d12/d3d12_device_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_device_wrap.cpp @@ -901,9 +901,7 @@ bool WrappedID3D12Device::Serialise_CreateDescriptorHeap( SerialiserType &ser, const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, REFIID riid, void **ppvHeap) { - SERIALISE_ELEMENT_LOCAL(Descriptor, *pDescriptorHeapDesc) - .Named("pDescriptorHeapDesc"_lit) - .Important(); + SERIALISE_ELEMENT_LOCAL(Descriptor, *pDescriptorHeapDesc).Named("pDescriptorHeapDesc"_lit).Important(); SERIALISE_ELEMENT_LOCAL(guid, riid).Named("riid"_lit); SERIALISE_ELEMENT_LOCAL(pHeap, ((WrappedID3D12DescriptorHeap *)*ppvHeap)->GetResourceID()) .TypedAs("ID3D12DescriptorHeap *"_lit); diff --git a/renderdoc/driver/d3d12/d3d12_manager.h b/renderdoc/driver/d3d12/d3d12_manager.h index 8853c2ab2..3e059f04c 100644 --- a/renderdoc/driver/d3d12/d3d12_manager.h +++ b/renderdoc/driver/d3d12/d3d12_manager.h @@ -359,14 +359,14 @@ public: operator D3D12_CPU_DESCRIPTOR_HANDLE() const { D3D12_CPU_DESCRIPTOR_HANDLE handle; - handle.ptr = (SIZE_T) this; + handle.ptr = (SIZE_T)this; return handle; } operator D3D12_GPU_DESCRIPTOR_HANDLE() const { D3D12_GPU_DESCRIPTOR_HANDLE handle; - handle.ptr = (SIZE_T) this; + handle.ptr = (SIZE_T)this; return handle; } diff --git a/renderdoc/driver/d3d12/d3d12_overlay.cpp b/renderdoc/driver/d3d12/d3d12_overlay.cpp index 704712125..fd6bcccb8 100644 --- a/renderdoc/driver/d3d12/d3d12_overlay.cpp +++ b/renderdoc/driver/d3d12/d3d12_overlay.cpp @@ -1802,7 +1802,9 @@ ResourceId D3D12Replay::RenderOverlay(ResourceId texid, FloatVector clearCol, De rs.graphics.rootsig = GetResID(GetDebugManager()->GetMeshRootSig()); rs.graphics.sigelems = { - vertexElem, viewportElem, viewportConstElem, + vertexElem, + viewportElem, + viewportConstElem, }; rs.rts = {*(D3D12Descriptor *)rtv.ptr}; diff --git a/renderdoc/driver/d3d12/d3d12_rendermesh.cpp b/renderdoc/driver/d3d12/d3d12_rendermesh.cpp index 5c2f77cf6..ae7683445 100644 --- a/renderdoc/driver/d3d12/d3d12_rendermesh.cpp +++ b/renderdoc/driver/d3d12/d3d12_rendermesh.cpp @@ -835,7 +835,10 @@ void D3D12Replay::RenderMesh(uint32_t eventId, const rdcarray &secon cache = GetDebugManager()->CacheMeshDisplayPipelines(helper, helper); FloatVector vertSprite[4] = { - activeVertex, activeVertex, activeVertex, activeVertex, + activeVertex, + activeVertex, + activeVertex, + activeVertex, }; list->IASetPrimitiveTopology(MakeD3DPrimitiveTopology(helper.topology)); diff --git a/renderdoc/driver/d3d12/d3d12_rendertext.cpp b/renderdoc/driver/d3d12/d3d12_rendertext.cpp index a78706be7..cecab8573 100644 --- a/renderdoc/driver/d3d12/d3d12_rendertext.cpp +++ b/renderdoc/driver/d3d12/d3d12_rendertext.cpp @@ -328,18 +328,38 @@ D3D12TextRenderer::D3D12TextRenderer(WrappedID3D12Device *wrapper) const D3D12_STATIC_SAMPLER_DESC1 samplers[2] = { // point { - D3D12_FILTER_MIN_MAG_MIP_POINT, D3D12_TEXTURE_ADDRESS_MODE_CLAMP, - D3D12_TEXTURE_ADDRESS_MODE_CLAMP, D3D12_TEXTURE_ADDRESS_MODE_CLAMP, 0.0f, 1, - D3D12_COMPARISON_FUNC_ALWAYS, D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK, 0.0f, FLT_MAX, 0, 0, - D3D12_SHADER_VISIBILITY_PIXEL, D3D12_SAMPLER_FLAG_NONE, + D3D12_FILTER_MIN_MAG_MIP_POINT, + D3D12_TEXTURE_ADDRESS_MODE_CLAMP, + D3D12_TEXTURE_ADDRESS_MODE_CLAMP, + D3D12_TEXTURE_ADDRESS_MODE_CLAMP, + 0.0f, + 1, + D3D12_COMPARISON_FUNC_ALWAYS, + D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK, + 0.0f, + FLT_MAX, + 0, + 0, + D3D12_SHADER_VISIBILITY_PIXEL, + D3D12_SAMPLER_FLAG_NONE, }, // linear { - D3D12_FILTER_MIN_MAG_MIP_LINEAR, D3D12_TEXTURE_ADDRESS_MODE_CLAMP, - D3D12_TEXTURE_ADDRESS_MODE_CLAMP, D3D12_TEXTURE_ADDRESS_MODE_CLAMP, 0.0f, 1, - D3D12_COMPARISON_FUNC_ALWAYS, D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK, 0.0f, FLT_MAX, 1, 0, - D3D12_SHADER_VISIBILITY_PIXEL, D3D12_SAMPLER_FLAG_NONE, + D3D12_FILTER_MIN_MAG_MIP_LINEAR, + D3D12_TEXTURE_ADDRESS_MODE_CLAMP, + D3D12_TEXTURE_ADDRESS_MODE_CLAMP, + D3D12_TEXTURE_ADDRESS_MODE_CLAMP, + 0.0f, + 1, + D3D12_COMPARISON_FUNC_ALWAYS, + D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK, + 0.0f, + FLT_MAX, + 1, + 0, + D3D12_SHADER_VISIBILITY_PIXEL, + D3D12_SAMPLER_FLAG_NONE, }, }; diff --git a/renderdoc/driver/d3d12/d3d12_resources.h b/renderdoc/driver/d3d12/d3d12_resources.h index 9ff1fbf9d..89a5fe0c1 100644 --- a/renderdoc/driver/d3d12/d3d12_resources.h +++ b/renderdoc/driver/d3d12/d3d12_resources.h @@ -1259,35 +1259,62 @@ struct UnwrapHelper }; #undef D3D12_TYPE_MACRO -#define D3D12_TYPE_MACRO(iface) \ - template <> \ - struct UnwrapHelper \ - { \ - typedef CONCAT(Wrapped, iface) Outer; \ - static bool IsAlloc(void *ptr) { return Outer::IsAlloc(ptr); } \ - static D3D12ResourceType GetTypeEnum() { return (D3D12ResourceType)Outer::TypeEnum; } \ - static Outer *FromHandle(iface *wrapped) { return (Outer *)wrapped; } \ - }; \ - template <> \ - struct UnwrapHelper \ - { \ - typedef CONCAT(Wrapped, iface) Outer; \ - static bool IsAlloc(void *ptr) { return Outer::IsAlloc(ptr); } \ - static D3D12ResourceType GetTypeEnum() { return (D3D12ResourceType)Outer::TypeEnum; } \ - static Outer *FromHandle(iface *wrapped) { return (Outer *)wrapped; } \ +#define D3D12_TYPE_MACRO(iface) \ + template <> \ + struct UnwrapHelper \ + { \ + typedef CONCAT(Wrapped, iface) Outer; \ + static bool IsAlloc(void *ptr) \ + { \ + return Outer::IsAlloc(ptr); \ + } \ + static D3D12ResourceType GetTypeEnum() \ + { \ + return (D3D12ResourceType)Outer::TypeEnum; \ + } \ + static Outer *FromHandle(iface *wrapped) \ + { \ + return (Outer *)wrapped; \ + } \ + }; \ + template <> \ + struct UnwrapHelper \ + { \ + typedef CONCAT(Wrapped, iface) Outer; \ + static bool IsAlloc(void *ptr) \ + { \ + return Outer::IsAlloc(ptr); \ + } \ + static D3D12ResourceType GetTypeEnum() \ + { \ + return (D3D12ResourceType)Outer::TypeEnum; \ + } \ + static Outer *FromHandle(iface *wrapped) \ + { \ + return (Outer *)wrapped; \ + } \ }; ALL_D3D12_TYPES; // extra helpers here for '1' or '2' extended interfaces -#define D3D12_UNWRAP_EXTENDED(iface, ifaceX) \ - template <> \ - struct UnwrapHelper \ - { \ - typedef CONCAT(Wrapped, iface) Outer; \ - static bool IsAlloc(void *ptr) { return Outer::IsAlloc(ptr); } \ - static D3D12ResourceType GetTypeEnum() { return (D3D12ResourceType)Outer::TypeEnum; } \ - static Outer *FromHandle(ifaceX *wrapped) { return (Outer *)wrapped; } \ +#define D3D12_UNWRAP_EXTENDED(iface, ifaceX) \ + template <> \ + struct UnwrapHelper \ + { \ + typedef CONCAT(Wrapped, iface) Outer; \ + static bool IsAlloc(void *ptr) \ + { \ + return Outer::IsAlloc(ptr); \ + } \ + static D3D12ResourceType GetTypeEnum() \ + { \ + return (D3D12ResourceType)Outer::TypeEnum; \ + } \ + static Outer *FromHandle(ifaceX *wrapped) \ + { \ + return (Outer *)wrapped; \ + } \ }; D3D12_UNWRAP_EXTENDED(ID3D12Fence, ID3D12Fence1); diff --git a/renderdoc/driver/d3d12/d3d12_shader_cache.cpp b/renderdoc/driver/d3d12/d3d12_shader_cache.cpp index 40d05815d..e99b40b4a 100644 --- a/renderdoc/driver/d3d12/d3d12_shader_cache.cpp +++ b/renderdoc/driver/d3d12/d3d12_shader_cache.cpp @@ -340,10 +340,10 @@ rdcstr D3D12ShaderCache::GetShaderBlob(const char *source, const char *entry, rdcstr cbuffers = GetEmbeddedResource(hlsl_cbuffers_h); rdcstr texsample = GetEmbeddedResource(hlsl_texsample_h); - EmbeddedD3DIncluder includer(includeDirs, - { - {"hlsl_texsample.h", texsample}, {"hlsl_cbuffers.h", cbuffers}, - }); + EmbeddedD3DIncluder includer(includeDirs, { + {"hlsl_texsample.h", texsample}, + {"hlsl_cbuffers.h", cbuffers}, + }); uint32_t hash = strhash(source); hash = strhash(entry, hash); @@ -877,8 +877,10 @@ ID3DBlob *D3D12ShaderCache::MakeFixedColShader(FixedColVariant variant, bool dxi if(!ret) { const rdcstr embedded[] = { - GetEmbeddedResource(fixedcol_0_dxbc), GetEmbeddedResource(fixedcol_1_dxbc), - GetEmbeddedResource(fixedcol_2_dxbc), GetEmbeddedResource(fixedcol_3_dxbc), + GetEmbeddedResource(fixedcol_0_dxbc), + GetEmbeddedResource(fixedcol_1_dxbc), + GetEmbeddedResource(fixedcol_2_dxbc), + GetEmbeddedResource(fixedcol_3_dxbc), }; D3D12ShaderCacheCallbacks.Create((uint32_t)embedded[variant].size(), embedded[variant].data(), diff --git a/renderdoc/driver/d3d12/d3d12_shader_feedback.cpp b/renderdoc/driver/d3d12/d3d12_shader_feedback.cpp index 9bd8c38d4..c4dcb896e 100644 --- a/renderdoc/driver/d3d12/d3d12_shader_feedback.cpp +++ b/renderdoc/driver/d3d12/d3d12_shader_feedback.cpp @@ -843,7 +843,8 @@ static bool AnnotateDXILShader(const DXBC::DXBCContainer *dxbc, uint32_t space, f->instructions.insert(i++, byteOffset); byteOffset->type = i32; byteOffset->args = { - slotPlusBaseClamped, editor.CreateConstant(2U), + slotPlusBaseClamped, + editor.CreateConstant(2U), }; Instruction *atomicOr = editor.CreateInstruction(atomicBinOp); @@ -977,7 +978,8 @@ static bool AnnotateDXILShader(const DXBC::DXBCContainer *dxbc, uint32_t space, f->instructions.insert(i++, byteOffset); byteOffset->type = i32; byteOffset->args = { - slotPlusBase, editor.CreateConstant(2U), + slotPlusBase, + editor.CreateConstant(2U), }; uint32_t feedbackValue = magicFeedbackValue | (1 << (uint32_t)handleKind); diff --git a/renderdoc/driver/d3d12/d3d12_shaderdebug.cpp b/renderdoc/driver/d3d12/d3d12_shaderdebug.cpp index dafe65539..f7c18dafa 100644 --- a/renderdoc/driver/d3d12/d3d12_shaderdebug.cpp +++ b/renderdoc/driver/d3d12/d3d12_shaderdebug.cpp @@ -2409,8 +2409,9 @@ void ExtractInputsPS(PSInput IN, if(depthFunc == D3D12_COMPARISON_FUNC_EQUAL && depthTarget != ResourceId()) { float depthStencilValue[4] = {}; - PickPixel(depthTarget, x, y, Subresource(rs.dsv.GetDSV().Texture2DArray.MipSlice, - rs.dsv.GetDSV().Texture2DArray.FirstArraySlice, sample), + PickPixel(depthTarget, x, y, + Subresource(rs.dsv.GetDSV().Texture2DArray.MipSlice, + rs.dsv.GetDSV().Texture2DArray.FirstArraySlice, sample), CompType::Depth, depthStencilValue); existingDepth = depthStencilValue[0]; diff --git a/renderdoc/driver/dxgi/dxgi_common.cpp b/renderdoc/driver/dxgi/dxgi_common.cpp index 515550e09..e28694924 100644 --- a/renderdoc/driver/dxgi/dxgi_common.cpp +++ b/renderdoc/driver/dxgi/dxgi_common.cpp @@ -1056,8 +1056,7 @@ DXGI_FORMAT GetTypedFormat(DXGI_FORMAT f) case DXGI_FORMAT_R16G16_TYPELESS: return DXGI_FORMAT_R16G16_FLOAT; - case DXGI_FORMAT_R32_TYPELESS: - return DXGI_FORMAT_R32_FLOAT; + case DXGI_FORMAT_R32_TYPELESS: return DXGI_FORMAT_R32_FLOAT; // maybe not valid casts? case DXGI_FORMAT_R24G8_TYPELESS: return DXGI_FORMAT_R24_UNORM_X8_TYPELESS; @@ -1096,7 +1095,7 @@ DXGI_FORMAT GetTypedFormat(DXGI_FORMAT f, CompType typeCast) { switch(f) { - // these formats have multiple typed formats - use the hint to decide which to use + // these formats have multiple typed formats - use the hint to decide which to use case DXGI_FORMAT_R8_TYPELESS: { @@ -1329,8 +1328,7 @@ DXGI_FORMAT GetTypelessFormat(DXGI_FORMAT f) case DXGI_FORMAT_D32_FLOAT: // maybe not valid cast? case DXGI_FORMAT_R32_FLOAT: case DXGI_FORMAT_R32_UINT: - case DXGI_FORMAT_R32_SINT: - return DXGI_FORMAT_R32_TYPELESS; + case DXGI_FORMAT_R32_SINT: return DXGI_FORMAT_R32_TYPELESS; // maybe not valid casts? case DXGI_FORMAT_R24G8_TYPELESS: @@ -3241,8 +3239,16 @@ TEST_CASE("DXGI formats", "[format][d3d]") int i = 0; for(DXGI_FORMAT f : { - DXGI_FORMAT_AYUV, DXGI_FORMAT_Y410, DXGI_FORMAT_Y416, DXGI_FORMAT_NV12, DXGI_FORMAT_P010, - DXGI_FORMAT_P016, DXGI_FORMAT_YUY2, DXGI_FORMAT_Y210, DXGI_FORMAT_Y216, DXGI_FORMAT_P208, + DXGI_FORMAT_AYUV, + DXGI_FORMAT_Y410, + DXGI_FORMAT_Y416, + DXGI_FORMAT_NV12, + DXGI_FORMAT_P010, + DXGI_FORMAT_P016, + DXGI_FORMAT_YUY2, + DXGI_FORMAT_Y210, + DXGI_FORMAT_Y216, + DXGI_FORMAT_P208, }) { if(isUnsupportedFormat(f)) diff --git a/renderdoc/driver/dxgi/dxgi_wrapped.h b/renderdoc/driver/dxgi/dxgi_wrapped.h index 1dc0adef5..162945ce4 100644 --- a/renderdoc/driver/dxgi/dxgi_wrapped.h +++ b/renderdoc/driver/dxgi/dxgi_wrapped.h @@ -127,8 +127,14 @@ public: }; #define IMPLEMENT_IDXGIOBJECT_WITH_REFCOUNTDXGIOBJECT_CUSTOMQUERY \ - ULONG STDMETHODCALLTYPE AddRef() { return RefCountDXGIObject::AddRef(); } \ - ULONG STDMETHODCALLTYPE Release() { return RefCountDXGIObject::Release(); } \ + ULONG STDMETHODCALLTYPE AddRef() \ + { \ + return RefCountDXGIObject::AddRef(); \ + } \ + ULONG STDMETHODCALLTYPE Release() \ + { \ + return RefCountDXGIObject::Release(); \ + } \ HRESULT STDMETHODCALLTYPE SetPrivateData(REFIID Name, UINT DataSize, const void *pData) \ { \ return RefCountDXGIObject::SetPrivateData(Name, DataSize, pData); \ diff --git a/renderdoc/driver/gl/cgl_platform_helpers.mm b/renderdoc/driver/gl/cgl_platform_helpers.mm index 1f1384dfc..32b73b436 100644 --- a/renderdoc/driver/gl/cgl_platform_helpers.mm +++ b/renderdoc/driver/gl/cgl_platform_helpers.mm @@ -77,14 +77,14 @@ static void IncrementContextLockCount(int contextIndex) { #if RD_USE_CONTEXT_LOCK_COUNTS Atomic::Inc32(s_ContextLocksCount.data() + contextIndex); -#endif //#if RD_USE_CONTEXT_LOCK_COUNTS +#endif // #if RD_USE_CONTEXT_LOCK_COUNTS } static void DecrementContextLockCount(int contextIndex) { #if RD_USE_CONTEXT_LOCK_COUNTS Atomic::Dec32(s_ContextLocksCount.data() + contextIndex); -#endif //#if RD_USE_CONTEXT_LOCK_COUNTS +#endif // #if RD_USE_CONTEXT_LOCK_COUNTS } static void LockContext(int contextIndex) @@ -520,7 +520,7 @@ void NSGL_destroyContext(void *context) s_ContextPtrs[contextIndex] = nil; #if RD_USE_CONTEXT_LOCK_COUNTS RDCASSERT(0 == s_ContextLocksCount[contextIndex]); -#endif //#if RD_USE_CONTEXT_LOCK_COUNTS +#endif // #if RD_USE_CONTEXT_LOCK_COUNTS } } } diff --git a/renderdoc/driver/gl/egl_hooks.cpp b/renderdoc/driver/gl/egl_hooks.cpp index 8548b9730..a72f2055e 100644 --- a/renderdoc/driver/gl/egl_hooks.cpp +++ b/renderdoc/driver/gl/egl_hooks.cpp @@ -1107,10 +1107,11 @@ void EGLHook::RegisterHooks() #endif // register EGL hooks -#define EGL_REGISTER(func, isext, replayrequired) \ - LibraryHooks::RegisterFunctionHook( \ - "libEGL" LIBSUFFIX, FunctionHook("egl" STRINGIZE(func), (void **)&EGL.func, \ - (void *)&CONCAT(egl, CONCAT(func, _renderdoc_hooked)))); +#define EGL_REGISTER(func, isext, replayrequired) \ + LibraryHooks::RegisterFunctionHook( \ + "libEGL" LIBSUFFIX, \ + FunctionHook("egl" STRINGIZE(func), (void **)&EGL.func, \ + (void *)&CONCAT(egl, CONCAT(func, _renderdoc_hooked)))); EGL_HOOKED_SYMBOLS(EGL_REGISTER) #undef EGL_REGISTER } diff --git a/renderdoc/driver/gl/egl_platform.cpp b/renderdoc/driver/gl/egl_platform.cpp index 984195e72..ba89555f1 100644 --- a/renderdoc/driver/gl/egl_platform.cpp +++ b/renderdoc/driver/gl/egl_platform.cpp @@ -433,7 +433,9 @@ class EGLPlatform : public GLPlatform #define LIBSUFFIX ".so" #endif const char *libs[] = { - "libGLESv3" LIBSUFFIX, "libGLESv2" LIBSUFFIX ".2", "libGLESv2" LIBSUFFIX, + "libGLESv3" LIBSUFFIX, + "libGLESv2" LIBSUFFIX ".2", + "libGLESv2" LIBSUFFIX, "libGLESv1_CM" LIBSUFFIX, }; @@ -479,7 +481,7 @@ bool EGLDispatchTable::PopulateForReplay() if(!this->func) \ this->func = (CONCAT(PFN_egl, func))Process::GetFunctionAddress(handle, "egl" STRINGIZE(func)); \ if(!this->func && CheckConstParam(isext)) \ - this->func = (CONCAT(PFN_egl, func)) this->GetProcAddress("egl" STRINGIZE(func)); \ + this->func = (CONCAT(PFN_egl, func))this->GetProcAddress("egl" STRINGIZE(func)); \ \ if(!this->func && !CheckConstParam(isext)) \ { \ diff --git a/renderdoc/driver/gl/gl_common.cpp b/renderdoc/driver/gl/gl_common.cpp index a6c96398a..19344a07f 100644 --- a/renderdoc/driver/gl/gl_common.cpp +++ b/renderdoc/driver/gl/gl_common.cpp @@ -1921,36 +1921,24 @@ ResourceFormat MakeResourceFormat(GLenum target, GLenum fmt) case eGL_COMPRESSED_RGB_S3TC_DXT1_EXT: case eGL_COMPRESSED_SRGB_S3TC_DXT1_EXT: ret.compCount = 3; break; case eGL_COMPRESSED_RGBA_S3TC_DXT1_EXT: - case eGL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: - ret.compCount = 4; - break; + case eGL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: ret.compCount = 4; break; // BC2 case eGL_COMPRESSED_RGBA_S3TC_DXT3_EXT: - case eGL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: - ret.compCount = 4; - break; + case eGL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: ret.compCount = 4; break; // BC3 case eGL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - case eGL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: - ret.compCount = 4; - break; + case eGL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: ret.compCount = 4; break; // BC4 case eGL_COMPRESSED_RED_RGTC1: - case eGL_COMPRESSED_SIGNED_RED_RGTC1: - ret.compCount = 1; - break; + case eGL_COMPRESSED_SIGNED_RED_RGTC1: ret.compCount = 1; break; // BC5 case eGL_COMPRESSED_RG_RGTC2: - case eGL_COMPRESSED_SIGNED_RG_RGTC2: - ret.compCount = 2; - break; + case eGL_COMPRESSED_SIGNED_RG_RGTC2: ret.compCount = 2; break; // BC6 case eGL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB: - case eGL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB: - ret.compCount = 3; - break; + case eGL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB: ret.compCount = 3; break; // BC7 case eGL_COMPRESSED_RGBA_BPTC_UNORM_ARB: case eGL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB: ret.compCount = 4; break; @@ -2058,39 +2046,25 @@ ResourceFormat MakeResourceFormat(GLenum target, GLenum fmt) case eGL_COMPRESSED_RGB_S3TC_DXT1_EXT: case eGL_COMPRESSED_RGBA_S3TC_DXT1_EXT: case eGL_COMPRESSED_SRGB_S3TC_DXT1_EXT: - case eGL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: - ret.type = ResourceFormatType::BC1; - break; + case eGL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: ret.type = ResourceFormatType::BC1; break; // BC2 case eGL_COMPRESSED_RGBA_S3TC_DXT3_EXT: - case eGL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: - ret.type = ResourceFormatType::BC2; - break; + case eGL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: ret.type = ResourceFormatType::BC2; break; // BC3 case eGL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - case eGL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: - ret.type = ResourceFormatType::BC3; - break; + case eGL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: ret.type = ResourceFormatType::BC3; break; // BC4 case eGL_COMPRESSED_RED_RGTC1: - case eGL_COMPRESSED_SIGNED_RED_RGTC1: - ret.type = ResourceFormatType::BC4; - break; + case eGL_COMPRESSED_SIGNED_RED_RGTC1: ret.type = ResourceFormatType::BC4; break; // BC5 case eGL_COMPRESSED_RG_RGTC2: - case eGL_COMPRESSED_SIGNED_RG_RGTC2: - ret.type = ResourceFormatType::BC5; - break; + case eGL_COMPRESSED_SIGNED_RG_RGTC2: ret.type = ResourceFormatType::BC5; break; // BC6 case eGL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB: - case eGL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB: - ret.type = ResourceFormatType::BC6; - break; + case eGL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB: ret.type = ResourceFormatType::BC6; break; // BC7 case eGL_COMPRESSED_RGBA_BPTC_UNORM_ARB: - case eGL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB: - ret.type = ResourceFormatType::BC7; - break; + case eGL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB: ret.type = ResourceFormatType::BC7; break; // ETC1 case eGL_ETC1_RGB8_OES: // handle it as ETC2 // ETC2 @@ -2106,9 +2080,7 @@ ResourceFormat MakeResourceFormat(GLenum target, GLenum fmt) case eGL_COMPRESSED_R11_EAC: case eGL_COMPRESSED_SIGNED_R11_EAC: case eGL_COMPRESSED_RG11_EAC: - case eGL_COMPRESSED_SIGNED_RG11_EAC: - ret.type = ResourceFormatType::EAC; - break; + case eGL_COMPRESSED_SIGNED_RG11_EAC: ret.type = ResourceFormatType::EAC; break; // ASTC case eGL_COMPRESSED_RGBA_ASTC_4x4_KHR: case eGL_COMPRESSED_RGBA_ASTC_5x4_KHR: @@ -2157,9 +2129,7 @@ ResourceFormat MakeResourceFormat(GLenum target, GLenum fmt) case eGL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES: case eGL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES: case eGL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES: - case eGL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES: - ret.type = ResourceFormatType::ASTC; - break; + case eGL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES: ret.type = ResourceFormatType::ASTC; break; // PVRTC case eGL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT: case eGL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT: diff --git a/renderdoc/driver/gl/gl_common.h b/renderdoc/driver/gl/gl_common.h index 04e1d92d9..c500d669b 100644 --- a/renderdoc/driver/gl/gl_common.h +++ b/renderdoc/driver/gl/gl_common.h @@ -210,13 +210,14 @@ struct GLWindowingData CGLPixelFormatObj pix; }; -#define DECL_HOOK_EXPORT(function) \ - __attribute__((used)) static struct \ - { \ - const void *replacment; \ - const void *replacee; \ - } _interpose_def_##function __attribute__((section("__DATA,__interpose"))) = { \ - (const void *)(unsigned long)&GL_EXPORT_NAME(function), (const void *)(unsigned long)&function, \ +#define DECL_HOOK_EXPORT(function) \ + __attribute__((used)) static struct \ + { \ + const void *replacment; \ + const void *replacee; \ + } _interpose_def_##function __attribute__((section("__DATA,__interpose"))) = { \ + (const void *)(unsigned long)&GL_EXPORT_NAME(function), \ + (const void *)(unsigned long)&function, \ }; #elif ENABLED(RDOC_ANDROID) diff --git a/renderdoc/driver/gl/gl_debug.cpp b/renderdoc/driver/gl/gl_debug.cpp index ae01c97fc..84cb05261 100644 --- a/renderdoc/driver/gl/gl_debug.cpp +++ b/renderdoc/driver/gl/gl_debug.cpp @@ -985,15 +985,40 @@ void GLReplay::InitDebugData() Vec3f axisFrustum[] = { // axis marker vertices - Vec3f(0.0f, 0.0f, 0.0f), Vec3f(1.0f, 0.0f, 0.0f), Vec3f(0.0f, 0.0f, 0.0f), - Vec3f(0.0f, 1.0f, 0.0f), Vec3f(0.0f, 0.0f, 0.0f), Vec3f(0.0f, 0.0f, 1.0f), + Vec3f(0.0f, 0.0f, 0.0f), + Vec3f(1.0f, 0.0f, 0.0f), + Vec3f(0.0f, 0.0f, 0.0f), + Vec3f(0.0f, 1.0f, 0.0f), + Vec3f(0.0f, 0.0f, 0.0f), + Vec3f(0.0f, 0.0f, 1.0f), // frustum vertices - TLN, TRN, TRN, BRN, BRN, BLN, BLN, TLN, + TLN, + TRN, + TRN, + BRN, + BRN, + BLN, + BLN, + TLN, - TLN, TLF, TRN, TRF, BLN, BLF, BRN, BRF, + TLN, + TLF, + TRN, + TRF, + BLN, + BLF, + BRN, + BRF, - TLF, TRF, TRF, BRF, BRF, BLF, BLF, TLF, + TLF, + TRF, + TRF, + BRF, + BRF, + BLF, + BLF, + TLF, }; drv.glNamedBufferDataEXT(DebugData.axisFrustumBuffer, sizeof(axisFrustum), axisFrustum, @@ -1652,7 +1677,10 @@ void GLReplay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, const Subre if(IsSIntFormat(texDetails.internalFormat)) { int32_t casted[4] = { - (int32_t)pixel[0], (int32_t)pixel[1], (int32_t)pixel[2], (int32_t)pixel[3], + (int32_t)pixel[0], + (int32_t)pixel[1], + (int32_t)pixel[2], + (int32_t)pixel[3], }; memcpy(pixel, casted, sizeof(casted)); @@ -1660,7 +1688,10 @@ void GLReplay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, const Subre else if(IsUIntFormat(texDetails.internalFormat)) { uint32_t casted[4] = { - (uint32_t)pixel[0], (uint32_t)pixel[1], (uint32_t)pixel[2], (uint32_t)pixel[3], + (uint32_t)pixel[0], + (uint32_t)pixel[1], + (uint32_t)pixel[2], + (uint32_t)pixel[3], }; memcpy(pixel, casted, sizeof(casted)); @@ -1709,7 +1740,8 @@ bool GLReplay::GetMinMax(ResourceId texid, const Subresource &sub, CompType type // for depth/stencil we need to run the code twice - once to fetch depth and once to fetch // stencil - since we can't process float depth and int stencil at the same time Vec4f depth[2] = { - {0.0f, 0.0f, 0.0f, 0.0f}, {1.0f, 1.0f, 1.0f, 1.0f}, + {0.0f, 0.0f, 0.0f, 0.0f}, + {1.0f, 1.0f, 1.0f, 1.0f}, }; Vec4u stencil[2] = {{0, 0, 0, 0}, {1, 1, 1, 1}}; diff --git a/renderdoc/driver/gl/gl_driver.cpp b/renderdoc/driver/gl/gl_driver.cpp index 9929d74fa..f8ad55105 100644 --- a/renderdoc/driver/gl/gl_driver.cpp +++ b/renderdoc/driver/gl/gl_driver.cpp @@ -1777,9 +1777,7 @@ void WrappedOpenGL::FreeTargetResource(ResourceId id) switch(resource.Namespace) { - case eResShader: - glDeleteShader(resource.name); - break; + case eResShader: glDeleteShader(resource.name); break; // a compiled shader could have been promoted to a program if it were a glCreateShaderProgramv case eResProgram: glDeleteProgram(resource.name); break; default: RDCERR("Unexpected resource type to be freed"); break; @@ -2496,8 +2494,9 @@ bool WrappedOpenGL::EndFrameCapture(DeviceOwnedWindow devWnd) { ContextData &ctxdata = GetCtxData(); - RenderText(0.0f, 0.0f, StringFormat::Fmt("Failed to capture frame %u: %s", - m_CapturedFrames.back().frameNumber, reasonString)); + RenderText(0.0f, 0.0f, + StringFormat::Fmt("Failed to capture frame %u: %s", + m_CapturedFrames.back().frameNumber, reasonString)); // swallow all errors we might have inadvertantly caused. This is // better than letting an error propagate and maybe screw up the diff --git a/renderdoc/driver/gl/gl_hooks.cpp b/renderdoc/driver/gl/gl_hooks.cpp index 1b58c5c97..b34cf9477 100644 --- a/renderdoc/driver/gl/gl_hooks.cpp +++ b/renderdoc/driver/gl/gl_hooks.cpp @@ -331,7 +331,7 @@ void GLHook::RegisterHooks() #if ENABLED(RDOC_APPLE) -// dlsym is unreliable with interposing, we must fetch the functions directly here at compile-time. + // dlsym is unreliable with interposing, we must fetch the functions directly here at compile-time. #undef APPLE_FUNC #define APPLE_FUNC(function) CONCAT(unsupported_real_, function) = &function; diff --git a/renderdoc/driver/gl/gl_pixelhistory.cpp b/renderdoc/driver/gl/gl_pixelhistory.cpp index 515608be3..7b9881d35 100644 --- a/renderdoc/driver/gl/gl_pixelhistory.cpp +++ b/renderdoc/driver/gl/gl_pixelhistory.cpp @@ -707,7 +707,10 @@ void CopyMSSample(WrappedOpenGL *driver, const GLPixelHistoryResources &resource driver->glUniform1i(depthMSLoc, 0); driver->glUniform1i(stencilMSLoc, 1); - uint32_t newUniforms[6] = {uint32_t(sampleIdx), uint32_t(x), uint32_t(y), 1, + uint32_t newUniforms[6] = {uint32_t(sampleIdx), + uint32_t(x), + uint32_t(y), + 1, copyFramebuffer.dsTextureId != 0 || copyFramebuffer.depthTextureId != 0, copyFramebuffer.dsTextureId != 0 || copyFramebuffer.stencilTextureId != diff --git a/renderdoc/driver/gl/gl_postvs.cpp b/renderdoc/driver/gl/gl_postvs.cpp index 4fe2ef066..8fe4ae010 100644 --- a/renderdoc/driver/gl/gl_postvs.cpp +++ b/renderdoc/driver/gl/gl_postvs.cpp @@ -102,7 +102,10 @@ static void MakeVaryingsFromShaderReflection(ShaderReflection &refl, rdcarray 0) diff --git a/renderdoc/driver/gl/gl_program_iterate.cpp b/renderdoc/driver/gl/gl_program_iterate.cpp index 02f17c3ab..b623d7881 100644 --- a/renderdoc/driver/gl/gl_program_iterate.cpp +++ b/renderdoc/driver/gl/gl_program_iterate.cpp @@ -758,9 +758,7 @@ static void ForAllProgramUniforms(SerialiserType *ser, CaptureState state, case eGL_DOUBLE: case eGL_DOUBLE_VEC2: case eGL_DOUBLE_VEC3: - case eGL_DOUBLE_VEC4: - GL.glGetUniformdv(progSrc, srcLocation, dv); - break; + case eGL_DOUBLE_VEC4: GL.glGetUniformdv(progSrc, srcLocation, dv); break; // treat all samplers as just an int (since they just store their binding value) case eGL_SAMPLER_1D: @@ -838,9 +836,7 @@ static void ForAllProgramUniforms(SerialiserType *ser, CaptureState state, case eGL_INT: case eGL_INT_VEC2: case eGL_INT_VEC3: - case eGL_INT_VEC4: - GL.glGetUniformiv(progSrc, srcLocation, iv); - break; + case eGL_INT_VEC4: GL.glGetUniformiv(progSrc, srcLocation, iv); break; // bools are unsigned integers case eGL_UNSIGNED_INT: case eGL_BOOL: diff --git a/renderdoc/driver/gl/gl_rendermesh.cpp b/renderdoc/driver/gl/gl_rendermesh.cpp index 396976aa9..1fe6b3e5f 100644 --- a/renderdoc/driver/gl/gl_rendermesh.cpp +++ b/renderdoc/driver/gl/gl_rendermesh.cpp @@ -653,7 +653,10 @@ void GLReplay::RenderMesh(uint32_t eventId, const rdcarray &secondar drv.glUnmapBuffer(eGL_UNIFORM_BUFFER); FloatVector vertSprite[4] = { - activeVertex, activeVertex, activeVertex, activeVertex, + activeVertex, + activeVertex, + activeVertex, + activeVertex, }; drv.glBindBuffer(eGL_ARRAY_BUFFER, DebugData.triHighlightBuffer); diff --git a/renderdoc/driver/gl/gl_renderstate.cpp b/renderdoc/driver/gl/gl_renderstate.cpp index 1748fa5e5..a162ed9de 100644 --- a/renderdoc/driver/gl/gl_renderstate.cpp +++ b/renderdoc/driver/gl/gl_renderstate.cpp @@ -957,23 +957,36 @@ void GLRenderState::FetchState(WrappedOpenGL *driver) GLenum maxcount; } idxBufs[] = { { - AtomicCounter, ARRAY_COUNT(AtomicCounter), eGL_ATOMIC_COUNTER_BUFFER_BINDING, - eGL_ATOMIC_COUNTER_BUFFER_START, eGL_ATOMIC_COUNTER_BUFFER_SIZE, + AtomicCounter, + ARRAY_COUNT(AtomicCounter), + eGL_ATOMIC_COUNTER_BUFFER_BINDING, + eGL_ATOMIC_COUNTER_BUFFER_START, + eGL_ATOMIC_COUNTER_BUFFER_SIZE, eGL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS, }, { - ShaderStorage, ARRAY_COUNT(ShaderStorage), eGL_SHADER_STORAGE_BUFFER_BINDING, - eGL_SHADER_STORAGE_BUFFER_START, eGL_SHADER_STORAGE_BUFFER_SIZE, + ShaderStorage, + ARRAY_COUNT(ShaderStorage), + eGL_SHADER_STORAGE_BUFFER_BINDING, + eGL_SHADER_STORAGE_BUFFER_START, + eGL_SHADER_STORAGE_BUFFER_SIZE, eGL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, }, { - TransformFeedback, ARRAY_COUNT(TransformFeedback), eGL_TRANSFORM_FEEDBACK_BUFFER_BINDING, - eGL_TRANSFORM_FEEDBACK_BUFFER_START, eGL_TRANSFORM_FEEDBACK_BUFFER_SIZE, + TransformFeedback, + ARRAY_COUNT(TransformFeedback), + eGL_TRANSFORM_FEEDBACK_BUFFER_BINDING, + eGL_TRANSFORM_FEEDBACK_BUFFER_START, + eGL_TRANSFORM_FEEDBACK_BUFFER_SIZE, eGL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, }, { - UniformBinding, ARRAY_COUNT(UniformBinding), eGL_UNIFORM_BUFFER_BINDING, - eGL_UNIFORM_BUFFER_START, eGL_UNIFORM_BUFFER_SIZE, eGL_MAX_UNIFORM_BUFFER_BINDINGS, + UniformBinding, + ARRAY_COUNT(UniformBinding), + eGL_UNIFORM_BUFFER_BINDING, + eGL_UNIFORM_BUFFER_START, + eGL_UNIFORM_BUFFER_SIZE, + eGL_MAX_UNIFORM_BUFFER_BINDINGS, }, }; @@ -1423,19 +1436,27 @@ void GLRenderState::ApplyState(WrappedOpenGL *driver) GLenum maxcount; } idxBufs[] = { { - AtomicCounter, ARRAY_COUNT(AtomicCounter), eGL_ATOMIC_COUNTER_BUFFER, + AtomicCounter, + ARRAY_COUNT(AtomicCounter), + eGL_ATOMIC_COUNTER_BUFFER, eGL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS, }, { - ShaderStorage, ARRAY_COUNT(ShaderStorage), eGL_SHADER_STORAGE_BUFFER, + ShaderStorage, + ARRAY_COUNT(ShaderStorage), + eGL_SHADER_STORAGE_BUFFER, eGL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, }, { - TransformFeedback, ARRAY_COUNT(TransformFeedback), eGL_TRANSFORM_FEEDBACK_BUFFER, + TransformFeedback, + ARRAY_COUNT(TransformFeedback), + eGL_TRANSFORM_FEEDBACK_BUFFER, eGL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, }, { - UniformBinding, ARRAY_COUNT(UniformBinding), eGL_UNIFORM_BUFFER, + UniformBinding, + ARRAY_COUNT(UniformBinding), + eGL_UNIFORM_BUFFER, eGL_MAX_UNIFORM_BUFFER_BINDINGS, }, }; diff --git a/renderdoc/driver/gl/gl_rendertexture.cpp b/renderdoc/driver/gl/gl_rendertexture.cpp index 4f58b96d1..5d3b6eadd 100644 --- a/renderdoc/driver/gl/gl_rendertexture.cpp +++ b/renderdoc/driver/gl/gl_rendertexture.cpp @@ -422,8 +422,9 @@ bool GLReplay::RenderTextureInternal(TextureDisplay cfg, TexDisplayFlags flags) if(cfg.subresource.sample == ~0U) drv.glProgramUniform1i(customProgram, loc, -texDetails.samples); else - drv.glProgramUniform1i(customProgram, loc, (int)RDCCLAMP(cfg.subresource.sample, 0U, - (uint32_t)texDetails.samples - 1)); + drv.glProgramUniform1i( + customProgram, loc, + (int)RDCCLAMP(cfg.subresource.sample, 0U, (uint32_t)texDetails.samples - 1)); } loc = drv.glGetUniformLocation(customProgram, "RENDERDOC_TextureType"); diff --git a/renderdoc/driver/gl/gl_replay.cpp b/renderdoc/driver/gl/gl_replay.cpp index 2634d43cd..51f28ae99 100644 --- a/renderdoc/driver/gl/gl_replay.cpp +++ b/renderdoc/driver/gl/gl_replay.cpp @@ -3039,7 +3039,7 @@ void GLReplay::GetTextureData(ResourceId tex, const Subresource &sub, dst = data.data() + d * sliceSize; src = dst + (height - 1) * rowSize; - for(GLsizei i = 0; i> 1; i++) + for(GLsizei i = 0; i < height >> 1; i++) { memcpy(row, src, rowSize); memcpy(src, dst, rowSize); @@ -3978,7 +3978,9 @@ rdcarray GetReplayVersions(RDCDriver api) if(api == RDCDriver::OpenGLES) { return { - {3, 2}, {3, 1}, {3, 0}, + {3, 2}, + {3, 1}, + {3, 0}, }; } else diff --git a/renderdoc/driver/gl/gl_resources.cpp b/renderdoc/driver/gl/gl_resources.cpp index a54cb4471..e49a81f1a 100644 --- a/renderdoc/driver/gl/gl_resources.cpp +++ b/renderdoc/driver/gl/gl_resources.cpp @@ -95,48 +95,39 @@ size_t GetCompressedByteSize(GLsizei w, GLsizei h, GLsizei d, GLenum internalfor case eGL_COMPRESSED_RGB_S3TC_DXT1_EXT: case eGL_COMPRESSED_RGBA_S3TC_DXT1_EXT: case eGL_COMPRESSED_SRGB_S3TC_DXT1_EXT: - case eGL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: - return (AlignUp4(w) * AlignUp4(h) * d) / 2; + case eGL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: return (AlignUp4(w) * AlignUp4(h) * d) / 2; // BC2 case eGL_COMPRESSED_RGBA_S3TC_DXT3_EXT: - case eGL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: - return (AlignUp4(w) * AlignUp4(h) * d); + case eGL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: return (AlignUp4(w) * AlignUp4(h) * d); // BC3 case eGL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - case eGL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: - return (AlignUp4(w) * AlignUp4(h) * d); + case eGL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: return (AlignUp4(w) * AlignUp4(h) * d); // BC4 case eGL_COMPRESSED_RED_RGTC1: - case eGL_COMPRESSED_SIGNED_RED_RGTC1: - return (AlignUp4(w) * AlignUp4(h) * d) / 2; + case eGL_COMPRESSED_SIGNED_RED_RGTC1: return (AlignUp4(w) * AlignUp4(h) * d) / 2; // BC5 case eGL_COMPRESSED_RG_RGTC2: - case eGL_COMPRESSED_SIGNED_RG_RGTC2: - return (AlignUp4(w) * AlignUp4(h) * d); + case eGL_COMPRESSED_SIGNED_RG_RGTC2: return (AlignUp4(w) * AlignUp4(h) * d); // BC6 case eGL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB: - case eGL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB: - return (AlignUp4(w) * AlignUp4(h) * d); + case eGL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB: return (AlignUp4(w) * AlignUp4(h) * d); // BC7 case eGL_COMPRESSED_RGBA_BPTC_UNORM_ARB: - case eGL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB: - return (AlignUp4(w) * AlignUp4(h) * d); + case eGL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB: return (AlignUp4(w) * AlignUp4(h) * d); // ETC1 case eGL_ETC1_RGB8_OES: // ETC2 case eGL_COMPRESSED_RGB8_ETC2: case eGL_COMPRESSED_SRGB8_ETC2: case eGL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: - case eGL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: - return (AlignUp4(w) * AlignUp4(h) * d) / 2; + case eGL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: return (AlignUp4(w) * AlignUp4(h) * d) / 2; // EAC case eGL_COMPRESSED_RGBA8_ETC2_EAC: case eGL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: return (AlignUp4(w) * AlignUp4(h) * d); case eGL_COMPRESSED_R11_EAC: case eGL_COMPRESSED_SIGNED_R11_EAC: return (AlignUp4(w) * AlignUp4(h) * d) / 2; case eGL_COMPRESSED_RG11_EAC: - case eGL_COMPRESSED_SIGNED_RG11_EAC: - return (AlignUp4(w) * AlignUp4(h) * d); + case eGL_COMPRESSED_SIGNED_RG11_EAC: return (AlignUp4(w) * AlignUp4(h) * d); // ASTC case eGL_COMPRESSED_RGBA_ASTC_4x4_KHR: case eGL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: @@ -345,8 +336,7 @@ rdcfixedarray GetCompressedBlockSize(GLenum internalformat) case eGL_COMPRESSED_R11_EAC: case eGL_COMPRESSED_SIGNED_R11_EAC: case eGL_COMPRESSED_RG11_EAC: - case eGL_COMPRESSED_SIGNED_RG11_EAC: - return {4u, 4u, 1u}; + case eGL_COMPRESSED_SIGNED_RG11_EAC: return {4u, 4u, 1u}; // ASTC case eGL_COMPRESSED_RGBA_ASTC_4x4_KHR: case eGL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: diff --git a/renderdoc/driver/gl/glx_platform.cpp b/renderdoc/driver/gl/glx_platform.cpp index 84e5aeb39..4f1970871 100644 --- a/renderdoc/driver/gl/glx_platform.cpp +++ b/renderdoc/driver/gl/glx_platform.cpp @@ -513,20 +513,20 @@ bool GLXDispatchTable::PopulateForReplay() bool symbols_ok = true; -#define LOAD_FUNC(func) \ - if(!this->func) \ - this->func = (CONCAT(PFN_, func))Process::GetFunctionAddress(handle, STRINGIZE(func)); \ - \ - if(!func && this->glXGetProcAddressARB) \ - this->func = (CONCAT(PFN_, func)) this->glXGetProcAddressARB((const GLubyte *)STRINGIZE(func)); \ - \ - if(!func && this->glXGetProcAddress) \ - this->func = (CONCAT(PFN_, func)) this->glXGetProcAddress((const GLubyte *)STRINGIZE(func)); \ - \ - if(!func) \ - { \ - symbols_ok = false; \ - RDCWARN("Unable to load '%s'", STRINGIZE(func)); \ +#define LOAD_FUNC(func) \ + if(!this->func) \ + this->func = (CONCAT(PFN_, func))Process::GetFunctionAddress(handle, STRINGIZE(func)); \ + \ + if(!func && this->glXGetProcAddressARB) \ + this->func = (CONCAT(PFN_, func))this->glXGetProcAddressARB((const GLubyte *)STRINGIZE(func)); \ + \ + if(!func && this->glXGetProcAddress) \ + this->func = (CONCAT(PFN_, func))this->glXGetProcAddress((const GLubyte *)STRINGIZE(func)); \ + \ + if(!func) \ + { \ + symbols_ok = false; \ + RDCWARN("Unable to load '%s'", STRINGIZE(func)); \ } GLX_HOOKED_SYMBOLS(LOAD_FUNC) diff --git a/renderdoc/driver/gl/wgl_hooks.cpp b/renderdoc/driver/gl/wgl_hooks.cpp index e3f9f2472..db1270510 100644 --- a/renderdoc/driver/gl/wgl_hooks.cpp +++ b/renderdoc/driver/gl/wgl_hooks.cpp @@ -664,11 +664,11 @@ void WGLHook::RegisterHooks() LibraryHooks::RegisterLibraryHook("user32.dll", NULL); // register EGL hooks -#define WGL_REGISTER(library, func) \ - if(CheckConstParam(sizeof(library) > 2)) \ - { \ - LibraryHooks::RegisterFunctionHook(library, FunctionHook(STRINGIZE(func), (void **)&WGL.func, \ - (void *)&CONCAT(func, _hooked))); \ +#define WGL_REGISTER(library, func) \ + if(CheckConstParam(sizeof(library) > 2)) \ + { \ + LibraryHooks::RegisterFunctionHook( \ + library, FunctionHook(STRINGIZE(func), (void **)&WGL.func, (void *)&CONCAT(func, _hooked))); \ } WGL_HOOKED_SYMBOLS(WGL_REGISTER) #undef WGL_REGISTER diff --git a/renderdoc/driver/gl/wrappers/gl_framebuffer_funcs.cpp b/renderdoc/driver/gl/wrappers/gl_framebuffer_funcs.cpp index cb92c913f..d4d15c391 100644 --- a/renderdoc/driver/gl/wrappers/gl_framebuffer_funcs.cpp +++ b/renderdoc/driver/gl/wrappers/gl_framebuffer_funcs.cpp @@ -2132,10 +2132,8 @@ bool WrappedOpenGL::Serialise_glBlitNamedFramebuffer(SerialiserType &ser, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) { - SERIALISE_ELEMENT_LOCAL(readFramebuffer, FramebufferRes(GetCtx(), readFramebufferHandle)) - .Important(); - SERIALISE_ELEMENT_LOCAL(drawFramebuffer, FramebufferRes(GetCtx(), drawFramebufferHandle)) - .Important(); + SERIALISE_ELEMENT_LOCAL(readFramebuffer, FramebufferRes(GetCtx(), readFramebufferHandle)).Important(); + SERIALISE_ELEMENT_LOCAL(drawFramebuffer, FramebufferRes(GetCtx(), drawFramebufferHandle)).Important(); SERIALISE_ELEMENT(srcX0); SERIALISE_ELEMENT(srcY0); SERIALISE_ELEMENT(srcX1); diff --git a/renderdoc/driver/ihv/nv/nv_counter_enumerator.cpp b/renderdoc/driver/ihv/nv/nv_counter_enumerator.cpp index 87107a977..782bc6de2 100644 --- a/renderdoc/driver/ihv/nv/nv_counter_enumerator.cpp +++ b/renderdoc/driver/ihv/nv/nv_counter_enumerator.cpp @@ -44,8 +44,7 @@ struct NVCounterEnumerator::Impl public: nv::perf::MetricsEvaluator Evaluator; - nv::perf::CounterConfiguration - SelectedConfiguration; // configImage etc. for the current selection + nv::perf::CounterConfiguration SelectedConfiguration; // configImage etc. for the current selection rdcarray SelectedExternalIds; rdcarray SelectedEvalRequests; size_t SelectedNumPasses; @@ -420,7 +419,9 @@ bool NVCounterEnumerator::InitializeNvPerf() { rdcstr pluginsFolder = FileIO::GetAppFolderFilename("plugins/nv"); const char *paths[] = { - pluginsFolder.c_str(), "./plugins/nv", ".", + pluginsFolder.c_str(), + "./plugins/nv", + ".", }; NVPW_SetLibraryLoadPaths_Params params{NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE}; params.numPaths = sizeof(paths) / sizeof(paths[0]); @@ -442,7 +443,7 @@ CounterDescription NVCounterEnumerator::LibraryNotFoundMessage() #elif ENABLED(RDOC_LINUX) "plugins/nv/libnvperf_grfx_host.so" #endif - ); + ); if(pluginPath.empty()) { pluginPath = diff --git a/renderdoc/driver/metal/metal_command_buffer_bridge.mm b/renderdoc/driver/metal/metal_command_buffer_bridge.mm index 4acc05202..2bf1ebf1c 100644 --- a/renderdoc/driver/metal/metal_command_buffer_bridge.mm +++ b/renderdoc/driver/metal/metal_command_buffer_bridge.mm @@ -243,8 +243,8 @@ return [self.real parallelRenderCommandEncoderWithDescriptor:renderPassDescriptor]; } -- (nullable id)resourceStateCommandEncoder - API_AVAILABLE(macos(11.0), macCatalyst(14.0), ios(13.0)) +- (nullable id) + resourceStateCommandEncoder API_AVAILABLE(macos(11.0), macCatalyst(14.0), ios(13.0)) { METAL_NOT_HOOKED(); return [self.real resourceStateCommandEncoder]; @@ -258,8 +258,8 @@ return [self.real resourceStateCommandEncoderWithDescriptor:resourceStatePassDescriptor]; } -- (nullable id)accelerationStructureCommandEncoder - API_AVAILABLE(macos(11.0), ios(14.0)) +- (nullable id) + accelerationStructureCommandEncoder API_AVAILABLE(macos(11.0), ios(14.0)) { METAL_NOT_HOOKED(); return [self.real accelerationStructureCommandEncoder]; diff --git a/renderdoc/driver/metal/metal_command_queue_bridge.mm b/renderdoc/driver/metal/metal_command_queue_bridge.mm index 674e5514d..67f109e7d 100644 --- a/renderdoc/driver/metal/metal_command_queue_bridge.mm +++ b/renderdoc/driver/metal/metal_command_queue_bridge.mm @@ -100,8 +100,8 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-implementations" -- (void)insertDebugCaptureBoundary - API_DEPRECATED("Use MTLCaptureScope instead", macos(10.11, 10.13), ios(8.0, 11.0)) +- (void)insertDebugCaptureBoundary API_DEPRECATED("Use MTLCaptureScope instead", + macos(10.11, 10.13), ios(8.0, 11.0)) { METAL_NOT_HOOKED(); return [self.real insertDebugCaptureBoundary]; diff --git a/renderdoc/driver/metal/metal_common.cpp b/renderdoc/driver/metal/metal_common.cpp index b9a2377fb..611dcb43f 100644 --- a/renderdoc/driver/metal/metal_common.cpp +++ b/renderdoc/driver/metal/metal_common.cpp @@ -1558,7 +1558,8 @@ TEST_CASE("Metal formats", "[format][metal]") const uint32_t width = 24, height = 24; rdcarray > > yuvTests = { - {MTL::PixelFormatGBGR422, {24 * 24 * 2}}, {MTL::PixelFormatBGRG422, {24 * 24 * 2}}, + {MTL::PixelFormatGBGR422, {24 * 24 * 2}}, + {MTL::PixelFormatBGRG422, {24 * 24 * 2}}, }; for(rdcpair > yuvTest : yuvTests) diff --git a/renderdoc/driver/metal/metal_core.cpp b/renderdoc/driver/metal/metal_core.cpp index 1b69bdefe..6e0360778 100644 --- a/renderdoc/driver/metal/metal_core.cpp +++ b/renderdoc/driver/metal/metal_core.cpp @@ -405,8 +405,7 @@ bool WrappedMTLDevice::ProcessChunk(ReadSerialiser &ser, MetalChunk chunk) case MetalChunk::MTLBlitCommandEncoder_copyIndirectCommandBuffer: METAL_CHUNK_NOT_HANDLED(); case MetalChunk::MTLBlitCommandEncoder_optimizeIndirectCommandBuffer: METAL_CHUNK_NOT_HANDLED(); case MetalChunk::MTLBlitCommandEncoder_sampleCountersInBuffer: METAL_CHUNK_NOT_HANDLED(); - case MetalChunk::MTLBlitCommandEncoder_resolveCounters: - METAL_CHUNK_NOT_HANDLED(); + case MetalChunk::MTLBlitCommandEncoder_resolveCounters: METAL_CHUNK_NOT_HANDLED(); // no default to get compile error if a chunk is not handled case MetalChunk::Max: break; diff --git a/renderdoc/driver/metal/metal_device.cpp b/renderdoc/driver/metal/metal_device.cpp index 87b298fba..a058ca807 100644 --- a/renderdoc/driver/metal/metal_device.cpp +++ b/renderdoc/driver/metal/metal_device.cpp @@ -109,8 +109,8 @@ CA::MetalDrawable *hooked_CAMetalLayer_nextDrawable(id self, SEL _cmd) RDCASSERTEQUAL(Threading::GetTLSValue(WrappedMTLDevice::g_nextDrawableTLSSlot), 0); Threading::SetTLSValue(WrappedMTLDevice::g_nextDrawableTLSSlot, (void *)(uintptr_t) true); CA::MetalDrawable *caMtlDrawable = - ((CA::MetalDrawable * (*)(id, SEL))WrappedMTLDevice::g_real_CAMetalLayer_nextDrawable)(self, - _cmd); + ((CA::MetalDrawable * (*)(id, SEL)) WrappedMTLDevice::g_real_CAMetalLayer_nextDrawable)(self, + _cmd); device->RegisterDrawableInfo(caMtlDrawable); Threading::SetTLSValue(WrappedMTLDevice::g_nextDrawableTLSSlot, (void *)(uintptr_t) false); return caMtlDrawable; diff --git a/renderdoc/driver/metal/metal_device_bridge.mm b/renderdoc/driver/metal/metal_device_bridge.mm index 308e92c0f..2ccd2765d 100644 --- a/renderdoc/driver/metal/metal_device_bridge.mm +++ b/renderdoc/driver/metal/metal_device_bridge.mm @@ -170,9 +170,8 @@ return GetWrapped(self)->supportsPullModelInterpolation(); } -- (BOOL)areBarycentricCoordsSupported - API_DEPRECATED_WITH_REPLACEMENT("supportsShaderBarycentricCoordinates", macos(10.15, 13.0), - ios(14.0, 16.0))API_UNAVAILABLE(tvos) +- (BOOL)areBarycentricCoordsSupported API_DEPRECATED_WITH_REPLACEMENT( + "supportsShaderBarycentricCoordinates", macos(10.15, 13.0), ios(14.0, 16.0))API_UNAVAILABLE(tvos) { return GetWrapped(self)->areBarycentricCoordsSupported(); } @@ -337,8 +336,9 @@ completionHandler:(MTLNewLibraryCompletionHandler)completionHandler { METAL_NOT_HOOKED(); - return - [self.real newLibraryWithSource:source options:options completionHandler:completionHandler]; + return [self.real newLibraryWithSource:source + options:options + completionHandler:completionHandler]; } - (nullable id)newLibraryWithStitchedDescriptor:(MTLStitchedLibraryDescriptor *)descriptor @@ -358,8 +358,8 @@ } - (nullable id) -newRenderPipelineStateWithDescriptor:(MTLRenderPipelineDescriptor *)descriptor - error:(__autoreleasing NSError **)error + newRenderPipelineStateWithDescriptor:(MTLRenderPipelineDescriptor *)descriptor + error:(__autoreleasing NSError **)error { RDMTL::RenderPipelineDescriptor rdDescriptor((MTL::RenderPipelineDescriptor *)descriptor); return id( @@ -367,10 +367,10 @@ newRenderPipelineStateWithDescriptor:(MTLRenderPipelineDescriptor *)descriptor } - (nullable id) -newRenderPipelineStateWithDescriptor:(MTLRenderPipelineDescriptor *)descriptor - options:(MTLPipelineOption)options - reflection:(MTLAutoreleasedRenderPipelineReflection *__nullable)reflection - error:(__autoreleasing NSError **)error + newRenderPipelineStateWithDescriptor:(MTLRenderPipelineDescriptor *)descriptor + options:(MTLPipelineOption)options + reflection:(MTLAutoreleasedRenderPipelineReflection *__nullable)reflection + error:(__autoreleasing NSError **)error { METAL_NOT_HOOKED(); return [self.real newRenderPipelineStateWithDescriptor:descriptor @@ -399,18 +399,18 @@ newRenderPipelineStateWithDescriptor:(MTLRenderPipelineDescriptor *)descriptor } - (nullable id) -newComputePipelineStateWithFunction:(id)computeFunction - error:(__autoreleasing NSError **)error + newComputePipelineStateWithFunction:(id)computeFunction + error:(__autoreleasing NSError **)error { METAL_NOT_HOOKED(); return [self.real newComputePipelineStateWithFunction:computeFunction error:error]; } - (nullable id) -newComputePipelineStateWithFunction:(id)computeFunction - options:(MTLPipelineOption)options - reflection:(MTLAutoreleasedComputePipelineReflection *__nullable)reflection - error:(__autoreleasing NSError **)error + newComputePipelineStateWithFunction:(id)computeFunction + options:(MTLPipelineOption)options + reflection:(MTLAutoreleasedComputePipelineReflection *__nullable)reflection + error:(__autoreleasing NSError **)error { METAL_NOT_HOOKED(); return [self.real newComputePipelineStateWithFunction:computeFunction @@ -439,10 +439,10 @@ newComputePipelineStateWithFunction:(id)computeFunction } - (nullable id) -newComputePipelineStateWithDescriptor:(MTLComputePipelineDescriptor *)descriptor - options:(MTLPipelineOption)options - reflection:(MTLAutoreleasedComputePipelineReflection *__nullable)reflection - error:(__autoreleasing NSError **)error + newComputePipelineStateWithDescriptor:(MTLComputePipelineDescriptor *)descriptor + options:(MTLPipelineOption)options + reflection:(MTLAutoreleasedComputePipelineReflection *__nullable)reflection + error:(__autoreleasing NSError **)error API_AVAILABLE(macos(10.11), ios(9.0)) { METAL_NOT_HOOKED(); @@ -501,10 +501,10 @@ newComputePipelineStateWithDescriptor:(MTLComputePipelineDescriptor *)descriptor } - (nullable id) -newRenderPipelineStateWithTileDescriptor:(MTLTileRenderPipelineDescriptor *)descriptor - options:(MTLPipelineOption)options - reflection:(MTLAutoreleasedRenderPipelineReflection *__nullable)reflection - error:(__autoreleasing NSError **)error + newRenderPipelineStateWithTileDescriptor:(MTLTileRenderPipelineDescriptor *)descriptor + options:(MTLPipelineOption)options + reflection:(MTLAutoreleasedRenderPipelineReflection *__nullable)reflection + error:(__autoreleasing NSError **)error API_AVAILABLE(macos(11.0), macCatalyst(14.0), ios(11.0), tvos(14.5)) { METAL_NOT_HOOKED(); @@ -528,10 +528,10 @@ newRenderPipelineStateWithTileDescriptor:(MTLTileRenderPipelineDescriptor *)desc #if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_13_0 - (nullable id) -newRenderPipelineStateWithMeshDescriptor:(MTLMeshRenderPipelineDescriptor *)descriptor - options:(MTLPipelineOption)options - reflection:(MTLAutoreleasedRenderPipelineReflection *__nullable)reflection - error:(__autoreleasing NSError **)error + newRenderPipelineStateWithMeshDescriptor:(MTLMeshRenderPipelineDescriptor *)descriptor + options:(MTLPipelineOption)options + reflection:(MTLAutoreleasedRenderPipelineReflection *__nullable)reflection + error:(__autoreleasing NSError **)error API_AVAILABLE(macos(13.0), ios(16.0)) { METAL_NOT_HOOKED(); @@ -600,9 +600,9 @@ newRenderPipelineStateWithMeshDescriptor:(MTLMeshRenderPipelineDescriptor *)desc } - (nullable id) -newIndirectCommandBufferWithDescriptor:(MTLIndirectCommandBufferDescriptor *)descriptor - maxCommandCount:(NSUInteger)maxCount - options:(MTLResourceOptions)options + newIndirectCommandBufferWithDescriptor:(MTLIndirectCommandBufferDescriptor *)descriptor + maxCommandCount:(NSUInteger)maxCount + options:(MTLResourceOptions)options API_AVAILABLE(macos(10.14), ios(12.0)) { METAL_NOT_HOOKED(); diff --git a/renderdoc/driver/metal/metal_function_bridge.mm b/renderdoc/driver/metal/metal_function_bridge.mm index c579a5c38..58d913bbb 100644 --- a/renderdoc/driver/metal/metal_function_bridge.mm +++ b/renderdoc/driver/metal/metal_function_bridge.mm @@ -110,8 +110,8 @@ return self.real.name; } -- (NSDictionary *)functionConstantsDictionary - API_AVAILABLE(macos(10.12), ios(10.0)) +- (NSDictionary *) + functionConstantsDictionary API_AVAILABLE(macos(10.12), ios(10.0)) { return self.real.functionConstantsDictionary; } diff --git a/renderdoc/driver/metal/metal_hook_bridge.mm b/renderdoc/driver/metal/metal_hook_bridge.mm index a392eeb53..0365bc122 100644 --- a/renderdoc/driver/metal/metal_hook_bridge.mm +++ b/renderdoc/driver/metal/metal_hook_bridge.mm @@ -85,10 +85,11 @@ extern void AppleRegisterRealSymbol(const char *functionName, void *address); void MetalHook::RegisterGlobalHookedMetalFunctions() { -#define METAL_FUNC(func) \ - AppleRegisterRealSymbol(STRINGIZE(func), (void *)&::func); \ - LibraryHooks::RegisterFunctionHook("Metal", FunctionHook(STRINGIZE(func), (void **)&METAL.func, \ - (void *)&METAL_EXPORT_NAME(func))); +#define METAL_FUNC(func) \ + AppleRegisterRealSymbol(STRINGIZE(func), (void *)&::func); \ + LibraryHooks::RegisterFunctionHook( \ + "Metal", \ + FunctionHook(STRINGIZE(func), (void **)&METAL.func, (void *)&METAL_EXPORT_NAME(func))); ForEachMetalSupported(); #undef METAL_FUNC diff --git a/renderdoc/driver/metal/metal_render_command_encoder_bridge.mm b/renderdoc/driver/metal/metal_render_command_encoder_bridge.mm index ff4d4f22f..db9ed817b 100644 --- a/renderdoc/driver/metal/metal_render_command_encoder_bridge.mm +++ b/renderdoc/driver/metal/metal_render_command_encoder_bridge.mm @@ -413,8 +413,8 @@ API_AVAILABLE(macos(12.0), ios(15.0)) { METAL_NOT_HOOKED(); - return - [self.real setFragmentAccelerationStructure:accelerationStructure atBufferIndex:bufferIndex]; + return [self.real setFragmentAccelerationStructure:accelerationStructure + atBufferIndex:bufferIndex]; } - (void)setBlendColorRed:(float)red green:(float)green blue:(float)blue alpha:(float)alpha @@ -851,9 +851,8 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-implementations" -- (void)textureBarrier - API_DEPRECATED_WITH_REPLACEMENT("memoryBarrierWithScope:MTLBarrierScopeRenderTargets", - macos(10.11, 10.14))API_UNAVAILABLE(ios) +- (void)textureBarrier API_DEPRECATED_WITH_REPLACEMENT( + "memoryBarrierWithScope:MTLBarrierScopeRenderTargets", macos(10.11, 10.14))API_UNAVAILABLE(ios) { METAL_NOT_HOOKED(); return [self.real textureBarrier]; @@ -1094,8 +1093,8 @@ withBufferRange:(NSRange)range API_AVAILABLE(macos(12.0), ios(15.0)) { METAL_NOT_HOOKED(); - return - [self.real setTileIntersectionFunctionTables:intersectionFunctionTable withBufferRange:range]; + return [self.real setTileIntersectionFunctionTables:intersectionFunctionTable + withBufferRange:range]; } - (void)setTileAccelerationStructure:(nullable id)accelerationStructure @@ -1226,8 +1225,9 @@ withBarrier:(BOOL)barrier API_AVAILABLE(macos(10.15), ios(14.0)) { METAL_NOT_HOOKED(); - return - [self.real sampleCountersInBuffer:sampleBuffer atSampleIndex:sampleIndex withBarrier:barrier]; + return [self.real sampleCountersInBuffer:sampleBuffer + atSampleIndex:sampleIndex + withBarrier:barrier]; } @end diff --git a/renderdoc/driver/metal/metal_render_pipeline_state_bridge.mm b/renderdoc/driver/metal/metal_render_pipeline_state_bridge.mm index f1dc0f775..102274a44 100644 --- a/renderdoc/driver/metal/metal_render_pipeline_state_bridge.mm +++ b/renderdoc/driver/metal/metal_render_pipeline_state_bridge.mm @@ -75,20 +75,20 @@ return id(GetWrapped(self)->GetDevice()); } -- (NSUInteger)maxTotalThreadsPerThreadgroup - API_AVAILABLE(macos(11.0), macCatalyst(14.0), ios(11.0), tvos(14.5)) +- (NSUInteger)maxTotalThreadsPerThreadgroup API_AVAILABLE(macos(11.0), macCatalyst(14.0), ios(11.0), + tvos(14.5)) { return self.real.maxTotalThreadsPerThreadgroup; } -- (BOOL)threadgroupSizeMatchesTileSize - API_AVAILABLE(macos(11.0), macCatalyst(14.0), ios(11.0), tvos(14.5)) +- (BOOL)threadgroupSizeMatchesTileSize API_AVAILABLE(macos(11.0), macCatalyst(14.0), ios(11.0), + tvos(14.5)) { return self.real.threadgroupSizeMatchesTileSize; } -- (NSUInteger)imageblockSampleLength - API_AVAILABLE(macos(11.0), macCatalyst(14.0), ios(11.0), tvos(14.5)) +- (NSUInteger)imageblockSampleLength API_AVAILABLE(macos(11.0), macCatalyst(14.0), ios(11.0), + tvos(14.5)) { return self.real.imageblockSampleLength; } @@ -164,8 +164,8 @@ } - (nullable id) -newIntersectionFunctionTableWithDescriptor:(MTLIntersectionFunctionTableDescriptor *_Nonnull)descriptor - stage:(MTLRenderStages)stage + newIntersectionFunctionTableWithDescriptor:(MTLIntersectionFunctionTableDescriptor *_Nonnull)descriptor + stage:(MTLRenderStages)stage API_AVAILABLE(macos(12.0), ios(15.0)) { METAL_NOT_HOOKED(); @@ -173,9 +173,9 @@ newIntersectionFunctionTableWithDescriptor:(MTLIntersectionFunctionTableDescript } - (nullable id) -newRenderPipelineStateWithAdditionalBinaryFunctions: - (nonnull MTLRenderPipelineFunctionsDescriptor *)additionalBinaryFunctions - error:(__autoreleasing NSError **)error + newRenderPipelineStateWithAdditionalBinaryFunctions: + (nonnull MTLRenderPipelineFunctionsDescriptor *)additionalBinaryFunctions + error:(__autoreleasing NSError **)error API_AVAILABLE(macos(12.0), ios(15.0)) { METAL_NOT_HOOKED(); diff --git a/renderdoc/driver/metal/metal_resources.cpp b/renderdoc/driver/metal/metal_resources.cpp index ce8d31636..22793dfdf 100644 --- a/renderdoc/driver/metal/metal_resources.cpp +++ b/renderdoc/driver/metal/metal_resources.cpp @@ -42,8 +42,11 @@ ResourceId GetResID(WrappedMTLObject *obj) return obj->m_ID; } -#define IMPLEMENT_WRAPPED_TYPE_HELPERS(CPPTYPE) \ - MTL::CPPTYPE *Unwrap(WrappedMTL##CPPTYPE *obj) { return Unwrap(obj); } +#define IMPLEMENT_WRAPPED_TYPE_HELPERS(CPPTYPE) \ + MTL::CPPTYPE *Unwrap(WrappedMTL##CPPTYPE *obj) \ + { \ + return Unwrap(obj); \ + } METALCPP_WRAPPED_PROTOCOLS(IMPLEMENT_WRAPPED_TYPE_HELPERS) #undef IMPLEMENT_WRAPPED_TYPE_HELPERS diff --git a/renderdoc/driver/metal/metal_texture_bridge.mm b/renderdoc/driver/metal/metal_texture_bridge.mm index 2516dc2f2..a78793be4 100644 --- a/renderdoc/driver/metal/metal_texture_bridge.mm +++ b/renderdoc/driver/metal/metal_texture_bridge.mm @@ -138,8 +138,8 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-implementations" #pragma clang diagnostic ignored "-Wdeprecated-declarations" -- (id)rootResource - API_DEPRECATED("Use parentTexture or buffer instead", macos(10.11, 10.12), ios(8.0, 10.0)) +- (id)rootResource API_DEPRECATED("Use parentTexture or buffer instead", + macos(10.11, 10.12), ios(8.0, 10.0)) { return self.real.rootResource; } diff --git a/renderdoc/driver/metal/metal_types.cpp b/renderdoc/driver/metal/metal_types.cpp index ddaa6137c..f7e3240df 100644 --- a/renderdoc/driver/metal/metal_types.cpp +++ b/renderdoc/driver/metal/metal_types.cpp @@ -544,7 +544,7 @@ void RenderPassStencilAttachmentDescriptor::CopyTo(MTL::RenderPassStencilAttachm RenderPassSampleBufferAttachmentDescriptor::RenderPassSampleBufferAttachmentDescriptor( MTL::RenderPassSampleBufferAttachmentDescriptor *objc) : // TODO: when WrappedMTLCounterSampleBuffer exists - // sampleBuffer(GetWrapped(objc->sampleBuffer())), + // sampleBuffer(GetWrapped(objc->sampleBuffer())), startOfVertexSampleIndex(objc->startOfVertexSampleIndex()), endOfVertexSampleIndex(objc->endOfVertexSampleIndex()), startOfFragmentSampleIndex(objc->startOfFragmentSampleIndex()), diff --git a/renderdoc/driver/metal/metal_types.h b/renderdoc/driver/metal/metal_types.h index ae5a3da7d..1685e54ee 100644 --- a/renderdoc/driver/metal/metal_types.h +++ b/renderdoc/driver/metal/metal_types.h @@ -87,7 +87,10 @@ METALCPP_WRAPPED_PROTOCOLS(DECLARE_OBJC_HELPERS) #define DECLARE_UNIMPLEMENTED_WRAPPED_CPP_HELPERS(CPPTYPE) \ class WrappedMTL##CPPTYPE; \ - inline MTL::CPPTYPE *Unwrap(WrappedMTL##CPPTYPE *obj) { return (MTL::CPPTYPE *)obj; } + inline MTL::CPPTYPE *Unwrap(WrappedMTL##CPPTYPE *obj) \ + { \ + return (MTL::CPPTYPE *)obj; \ + } METALCPP_UNIMPLEMENTED_WRAPPED_PROTOCOLS(DECLARE_UNIMPLEMENTED_WRAPPED_CPP_HELPERS) #undef DECLARE_UNIMPLEMENTED_WRAPPED_CPP_HELPERS diff --git a/renderdoc/driver/shaders/dxbc/dxbc_bytecode.cpp b/renderdoc/driver/shaders/dxbc/dxbc_bytecode.cpp index 5bba39098..324622648 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_bytecode.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_bytecode.cpp @@ -363,10 +363,9 @@ DXBC::Reflection *Program::GuessReflection() uint32_t idx = (uint32_t)dcl.operand.indices[0].index; desc.name = StringFormat::Fmt("uav%u", idx); - desc.type = - DXBC::ShaderInputBind::TYPE_UAV_RWSTRUCTURED; // doesn't seem to be anything that - // determines append vs consume vs - // rwstructured + desc.type = DXBC::ShaderInputBind::TYPE_UAV_RWSTRUCTURED; // doesn't seem to be anything + // that determines append vs + // consume vs rwstructured if(dcl.structured.hasCounter) desc.type = DXBC::ShaderInputBind::TYPE_UAV_RWSTRUCTURED_WITH_COUNTER; desc.space = dcl.space; @@ -970,8 +969,7 @@ size_t NumOperands(OpcodeType op) case OPCODE_GATHER4_C_FEEDBACK: case OPCODE_GATHER4_PO_FEEDBACK: return 6; case OPCODE_SAMPLE_D_CLAMP_FEEDBACK: - case OPCODE_GATHER4_PO_C_FEEDBACK: - return 7; + case OPCODE_GATHER4_PO_C_FEEDBACK: return 7; // custom data doesn't have particular operands case OPCODE_CUSTOMDATA: diff --git a/renderdoc/driver/shaders/dxbc/dxbc_bytecode_editor.cpp b/renderdoc/driver/shaders/dxbc/dxbc_bytecode_editor.cpp index 0e0b24abf..762724533 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_bytecode_editor.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_bytecode_editor.cpp @@ -90,10 +90,13 @@ static const rdcarray opcodeOrder = { OPCODE_DCL_SAMPLER, // sorted by space, then register. Types can be intermixed as a result - OPCODE_DCL_RESOURCE, OPCODE_DCL_RESOURCE_RAW, OPCODE_DCL_RESOURCE_STRUCTURED, + OPCODE_DCL_RESOURCE, + OPCODE_DCL_RESOURCE_RAW, + OPCODE_DCL_RESOURCE_STRUCTURED, // sorted by space, then register. Types can be intermixed as a result - OPCODE_DCL_UNORDERED_ACCESS_VIEW_TYPED, OPCODE_DCL_UNORDERED_ACCESS_VIEW_RAW, + OPCODE_DCL_UNORDERED_ACCESS_VIEW_TYPED, + OPCODE_DCL_UNORDERED_ACCESS_VIEW_RAW, OPCODE_DCL_UNORDERED_ACCESS_VIEW_STRUCTURED, OPCODE_DCL_FUNCTION_BODY, @@ -103,15 +106,20 @@ static const rdcarray opcodeOrder = { OPCODE_DCL_INTERFACE, // these can be mixed in signature order - OPCODE_DCL_INPUT_PS, OPCODE_DCL_INPUT_PS_SIV, + OPCODE_DCL_INPUT_PS, + OPCODE_DCL_INPUT_PS_SIV, // last of the input group OPCODE_DCL_INPUT_PS_SGV, // these can in any order - OPCODE_DCL_INPUT, OPCODE_DCL_INPUT_SIV, OPCODE_DCL_INPUT_SGV, + OPCODE_DCL_INPUT, + OPCODE_DCL_INPUT_SIV, + OPCODE_DCL_INPUT_SGV, // similarly in any order - OPCODE_DCL_OUTPUT, OPCODE_DCL_OUTPUT_SIV, OPCODE_DCL_OUTPUT_SGV, + OPCODE_DCL_OUTPUT, + OPCODE_DCL_OUTPUT_SIV, + OPCODE_DCL_OUTPUT_SGV, OPCODE_DCL_TEMPS, @@ -139,7 +147,8 @@ static const rdcarray opcodeOrder = { OPCODE_DCL_MAX_OUTPUT_VERTEX_COUNT, // these happen in the separate phase declarations - OPCODE_DCL_HS_FORK_PHASE_INSTANCE_COUNT, OPCODE_DCL_HS_JOIN_PHASE_INSTANCE_COUNT, + OPCODE_DCL_HS_FORK_PHASE_INSTANCE_COUNT, + OPCODE_DCL_HS_JOIN_PHASE_INSTANCE_COUNT, }; size_t ProgramEditor::GetDeclarationPosition(OpcodeType op) diff --git a/renderdoc/driver/shaders/dxbc/dxbc_bytecode_ops.cpp b/renderdoc/driver/shaders/dxbc/dxbc_bytecode_ops.cpp index 35b8569f6..f348ad87e 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_bytecode_ops.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_bytecode_ops.cpp @@ -1245,7 +1245,8 @@ bool Program::DecodeOperand(uint32_t *&tokenStream, ToString flags, Operand &ret uint32_t indexDim = Oper::IndexDimension.Get(OperandToken0); OperandIndexType rep[] = { - Oper::Index0.Get(OperandToken0), Oper::Index1.Get(OperandToken0), + Oper::Index0.Get(OperandToken0), + Oper::Index1.Get(OperandToken0), Oper::Index2.Get(OperandToken0), }; diff --git a/renderdoc/driver/shaders/dxbc/dxbc_bytecode_vendorext.cpp b/renderdoc/driver/shaders/dxbc/dxbc_bytecode_vendorext.cpp index bb75f2300..15c85cd10 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_bytecode_vendorext.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_bytecode_vendorext.cpp @@ -102,8 +102,7 @@ DX12Op convert(DX11Op op) case DX11Op::Max3U: return DX12Op::Max3U; case DX11Op::Max3F: return DX12Op::Max3F; case DX11Op::BaryCoord: return DX12Op::BaryCoord; - case DX11Op::VtxParam: - return DX12Op::VtxParam; + case DX11Op::VtxParam: return DX12Op::VtxParam; // others match up exactly default: return DX12Op(op); } @@ -870,8 +869,7 @@ void Program::PostprocessVendorExtensions() switch(state) { case InstructionState::Broken: - case InstructionState::AMDUAVAtomic: - break; + case InstructionState::AMDUAVAtomic: break; // in Nothing an increment marks the beginning of an instruction of some type case InstructionState::Nothing: { diff --git a/renderdoc/driver/shaders/dxbc/dxbc_container.cpp b/renderdoc/driver/shaders/dxbc/dxbc_container.cpp index 75cbf94f7..e100b0f7d 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_container.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_container.cpp @@ -364,9 +364,7 @@ CBufferVariableType DXBCContainer::ParseRDEFType(const RDEFHeader *h, const byte case DXBC::VARTYPE_FLOAT: case DXBC::VARTYPE_MIN8FLOAT: case DXBC::VARTYPE_MIN10FLOAT: - case DXBC::VARTYPE_MIN16FLOAT: - ret.varType = VarType::Float; - break; + case DXBC::VARTYPE_MIN16FLOAT: ret.varType = VarType::Float; break; // new types are actually 16-bit, though alignment is still the same as 32-bit case DXBC::VARTYPE_INT16: ret.varType = VarType::SShort; break; case DXBC::VARTYPE_UINT16: ret.varType = VarType::UShort; break; diff --git a/renderdoc/driver/shaders/dxbc/dxbc_container.h b/renderdoc/driver/shaders/dxbc/dxbc_container.h index 30baf9633..9f87c57d9 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_container.h +++ b/renderdoc/driver/shaders/dxbc/dxbc_container.h @@ -29,7 +29,6 @@ #include "api/replay/rdcarray.h" #include "api/replay/rdcpair.h" #include "api/replay/rdcstr.h" -#include "api/replay/rdcstr.h" #include "common/common.h" #include "driver/dx/official/d3dcommon.h" #include "dxbc_common.h" diff --git a/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp b/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp index 029ed5f4e..38796f881 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp @@ -88,8 +88,7 @@ VarType OperationType(const DXBCBytecode::OpcodeType &op) case OPCODE_SYNC: case OPCODE_STORE_UAV_TYPED: case OPCODE_STORE_RAW: - case OPCODE_STORE_STRUCTURED: - return VarType::Float; + case OPCODE_STORE_STRUCTURED: return VarType::Float; // operations that can be either type, also just return float (fixed up later) case OPCODE_SAMPLE: @@ -272,26 +271,22 @@ bool OperationFlushing(const DXBCBytecode::OpcodeType &op) case OPCODE_LT: case OPCODE_GE: case OPCODE_EQ: - case OPCODE_NE: - return true; + case OPCODE_NE: return true; // can't generate denorms, or denorm inputs are implicitly rounded to 0, so don't bother // flushing case OPCODE_ITOF: case OPCODE_UTOF: case OPCODE_FTOI: - case OPCODE_FTOU: - return false; + case OPCODE_FTOU: return false; // we have to flush this manually since the input is halves encoded in uints case OPCODE_F16TOF32: - case OPCODE_F32TOF16: - return false; + case OPCODE_F32TOF16: return false; // implementation defined if this should flush or not, we choose not. case OPCODE_DTOF: - case OPCODE_FTOD: - return false; + case OPCODE_FTOD: return false; // any I/O or data movement operation that does not manipulate the data, such as using the // ld(22.4.6) instruction to access Resource data, or executing mov instruction or conditional @@ -300,8 +295,7 @@ bool OperationFlushing(const DXBCBytecode::OpcodeType &op) case OPCODE_MOV: case OPCODE_MOVC: case OPCODE_LD: - case OPCODE_LD_MS: - return false; + case OPCODE_LD_MS: return false; // sample operations flush denorms case OPCODE_SAMPLE: @@ -313,18 +307,15 @@ bool OperationFlushing(const DXBCBytecode::OpcodeType &op) case OPCODE_GATHER4: case OPCODE_GATHER4_C: case OPCODE_GATHER4_PO: - case OPCODE_GATHER4_PO_C: - return true; + case OPCODE_GATHER4_PO_C: return true; // don't flush eval ops as some inputs may be uint case OPCODE_EVAL_CENTROID: case OPCODE_EVAL_SAMPLE_INDEX: - case OPCODE_EVAL_SNAPPED: - return false; + case OPCODE_EVAL_SNAPPED: return false; // don't flush samplepos since an operand is scalar - case OPCODE_SAMPLE_POS: - return false; + case OPCODE_SAMPLE_POS: return false; // unclear if these flush and it's unlikely denorms will come up, so conservatively flush case OPCODE_SAMPLE_INFO: @@ -334,8 +325,7 @@ bool OperationFlushing(const DXBCBytecode::OpcodeType &op) case OPCODE_DERIV_RTX_FINE: case OPCODE_DERIV_RTY: case OPCODE_DERIV_RTY_COARSE: - case OPCODE_DERIV_RTY_FINE: - return true; + case OPCODE_DERIV_RTY_FINE: return true; // operations that don't work on floats don't flush case OPCODE_RESINFO: @@ -361,8 +351,7 @@ bool OperationFlushing(const DXBCBytecode::OpcodeType &op) case OPCODE_SYNC: case OPCODE_STORE_UAV_TYPED: case OPCODE_STORE_RAW: - case OPCODE_STORE_STRUCTURED: - return false; + case OPCODE_STORE_STRUCTURED: return false; // integer operations don't flush case OPCODE_AND: @@ -428,8 +417,7 @@ bool OperationFlushing(const DXBCBytecode::OpcodeType &op) case OPCODE_LD_RAW: case OPCODE_LD_UAV_TYPED: case OPCODE_LD_STRUCTURED: - case OPCODE_DTOU: - return false; + case OPCODE_DTOU: return false; // doubles do not flush case OPCODE_DADD: @@ -910,7 +898,9 @@ ShaderVariable abs(const ShaderVariable &v, const VarType type) r.value.s32v[i] = v.value.s32v[i] > 0 ? v.value.s32v[i] : -v.value.s32v[i]; break; } - case VarType::UInt: { break; + case VarType::UInt: + { + break; } case VarType::Float: { @@ -955,7 +945,9 @@ ShaderVariable neg(const ShaderVariable &v, const VarType type) r.value.s32v[i] = -v.value.s32v[i]; break; } - case VarType::UInt: { break; + case VarType::UInt: + { + break; } case VarType::Float: { @@ -1986,8 +1978,8 @@ void ThreadState::StepNext(ShaderDebugState *state, DebugAPIWrapper *apiWrapper, switch(op.operation) { - ///////////////////////////////////////////////////////////////////////////////////////////////////// - // Math operations + ///////////////////////////////////////////////////////////////////////////////////////////////////// + // Math operations case OPCODE_DADD: case OPCODE_IADD: @@ -2297,30 +2289,30 @@ void ThreadState::StepNext(ShaderDebugState *state, DebugAPIWrapper *apiWrapper, break; case OPCODE_INEG: SetDst(state, op.operands[0], op, neg(srcOpers[0], optype)); break; case OPCODE_IMIN: - SetDst( - state, op.operands[0], op, - ShaderVariable( - "", srcOpers[0].value.s32v[0] < srcOpers[1].value.s32v[0] ? srcOpers[0].value.s32v[0] - : srcOpers[1].value.s32v[0], - srcOpers[0].value.s32v[1] < srcOpers[1].value.s32v[1] ? srcOpers[0].value.s32v[1] - : srcOpers[1].value.s32v[1], - srcOpers[0].value.s32v[2] < srcOpers[1].value.s32v[2] ? srcOpers[0].value.s32v[2] - : srcOpers[1].value.s32v[2], - srcOpers[0].value.s32v[3] < srcOpers[1].value.s32v[3] ? srcOpers[0].value.s32v[3] - : srcOpers[1].value.s32v[3])); + SetDst(state, op.operands[0], op, + ShaderVariable( + "", + srcOpers[0].value.s32v[0] < srcOpers[1].value.s32v[0] ? srcOpers[0].value.s32v[0] + : srcOpers[1].value.s32v[0], + srcOpers[0].value.s32v[1] < srcOpers[1].value.s32v[1] ? srcOpers[0].value.s32v[1] + : srcOpers[1].value.s32v[1], + srcOpers[0].value.s32v[2] < srcOpers[1].value.s32v[2] ? srcOpers[0].value.s32v[2] + : srcOpers[1].value.s32v[2], + srcOpers[0].value.s32v[3] < srcOpers[1].value.s32v[3] ? srcOpers[0].value.s32v[3] + : srcOpers[1].value.s32v[3])); break; case OPCODE_UMIN: - SetDst( - state, op.operands[0], op, - ShaderVariable( - "", srcOpers[0].value.u32v[0] < srcOpers[1].value.u32v[0] ? srcOpers[0].value.u32v[0] - : srcOpers[1].value.u32v[0], - srcOpers[0].value.u32v[1] < srcOpers[1].value.u32v[1] ? srcOpers[0].value.u32v[1] - : srcOpers[1].value.u32v[1], - srcOpers[0].value.u32v[2] < srcOpers[1].value.u32v[2] ? srcOpers[0].value.u32v[2] - : srcOpers[1].value.u32v[2], - srcOpers[0].value.u32v[3] < srcOpers[1].value.u32v[3] ? srcOpers[0].value.u32v[3] - : srcOpers[1].value.u32v[3])); + SetDst(state, op.operands[0], op, + ShaderVariable( + "", + srcOpers[0].value.u32v[0] < srcOpers[1].value.u32v[0] ? srcOpers[0].value.u32v[0] + : srcOpers[1].value.u32v[0], + srcOpers[0].value.u32v[1] < srcOpers[1].value.u32v[1] ? srcOpers[0].value.u32v[1] + : srcOpers[1].value.u32v[1], + srcOpers[0].value.u32v[2] < srcOpers[1].value.u32v[2] ? srcOpers[0].value.u32v[2] + : srcOpers[1].value.u32v[2], + srcOpers[0].value.u32v[3] < srcOpers[1].value.u32v[3] ? srcOpers[0].value.u32v[3] + : srcOpers[1].value.u32v[3])); break; case OPCODE_DMIN: { @@ -2346,30 +2338,30 @@ void ThreadState::StepNext(ShaderDebugState *state, DebugAPIWrapper *apiWrapper, dxbc_min(srcOpers[0].value.f32v[3], srcOpers[1].value.f32v[3]))); break; case OPCODE_UMAX: - SetDst( - state, op.operands[0], op, - ShaderVariable( - "", srcOpers[0].value.u32v[0] >= srcOpers[1].value.u32v[0] ? srcOpers[0].value.u32v[0] - : srcOpers[1].value.u32v[0], - srcOpers[0].value.u32v[1] >= srcOpers[1].value.u32v[1] ? srcOpers[0].value.u32v[1] - : srcOpers[1].value.u32v[1], - srcOpers[0].value.u32v[2] >= srcOpers[1].value.u32v[2] ? srcOpers[0].value.u32v[2] - : srcOpers[1].value.u32v[2], - srcOpers[0].value.u32v[3] >= srcOpers[1].value.u32v[3] ? srcOpers[0].value.u32v[3] - : srcOpers[1].value.u32v[3])); + SetDst(state, op.operands[0], op, + ShaderVariable( + "", + srcOpers[0].value.u32v[0] >= srcOpers[1].value.u32v[0] ? srcOpers[0].value.u32v[0] + : srcOpers[1].value.u32v[0], + srcOpers[0].value.u32v[1] >= srcOpers[1].value.u32v[1] ? srcOpers[0].value.u32v[1] + : srcOpers[1].value.u32v[1], + srcOpers[0].value.u32v[2] >= srcOpers[1].value.u32v[2] ? srcOpers[0].value.u32v[2] + : srcOpers[1].value.u32v[2], + srcOpers[0].value.u32v[3] >= srcOpers[1].value.u32v[3] ? srcOpers[0].value.u32v[3] + : srcOpers[1].value.u32v[3])); break; case OPCODE_IMAX: - SetDst( - state, op.operands[0], op, - ShaderVariable( - "", srcOpers[0].value.s32v[0] >= srcOpers[1].value.s32v[0] ? srcOpers[0].value.s32v[0] - : srcOpers[1].value.s32v[0], - srcOpers[0].value.s32v[1] >= srcOpers[1].value.s32v[1] ? srcOpers[0].value.s32v[1] - : srcOpers[1].value.s32v[1], - srcOpers[0].value.s32v[2] >= srcOpers[1].value.s32v[2] ? srcOpers[0].value.s32v[2] - : srcOpers[1].value.s32v[2], - srcOpers[0].value.s32v[3] >= srcOpers[1].value.s32v[3] ? srcOpers[0].value.s32v[3] - : srcOpers[1].value.s32v[3])); + SetDst(state, op.operands[0], op, + ShaderVariable( + "", + srcOpers[0].value.s32v[0] >= srcOpers[1].value.s32v[0] ? srcOpers[0].value.s32v[0] + : srcOpers[1].value.s32v[0], + srcOpers[0].value.s32v[1] >= srcOpers[1].value.s32v[1] ? srcOpers[0].value.s32v[1] + : srcOpers[1].value.s32v[1], + srcOpers[0].value.s32v[2] >= srcOpers[1].value.s32v[2] ? srcOpers[0].value.s32v[2] + : srcOpers[1].value.s32v[2], + srcOpers[0].value.s32v[3] >= srcOpers[1].value.s32v[3] ? srcOpers[0].value.s32v[3] + : srcOpers[1].value.s32v[3])); break; case OPCODE_DMAX: { @@ -2513,8 +2505,10 @@ void ThreadState::StepNext(ShaderDebugState *state, DebugAPIWrapper *apiWrapper, case OPCODE_ISHL: { uint32_t shifts[] = { - srcOpers[1].value.u32v[0] & 0x1f, srcOpers[1].value.u32v[1] & 0x1f, - srcOpers[1].value.u32v[2] & 0x1f, srcOpers[1].value.u32v[3] & 0x1f, + srcOpers[1].value.u32v[0] & 0x1f, + srcOpers[1].value.u32v[1] & 0x1f, + srcOpers[1].value.u32v[2] & 0x1f, + srcOpers[1].value.u32v[3] & 0x1f, }; // if we were only given a single component, it's the form that shifts all components @@ -2533,8 +2527,10 @@ void ThreadState::StepNext(ShaderDebugState *state, DebugAPIWrapper *apiWrapper, case OPCODE_USHR: { uint32_t shifts[] = { - srcOpers[1].value.u32v[0] & 0x1f, srcOpers[1].value.u32v[1] & 0x1f, - srcOpers[1].value.u32v[2] & 0x1f, srcOpers[1].value.u32v[3] & 0x1f, + srcOpers[1].value.u32v[0] & 0x1f, + srcOpers[1].value.u32v[1] & 0x1f, + srcOpers[1].value.u32v[2] & 0x1f, + srcOpers[1].value.u32v[3] & 0x1f, }; // if we were only given a single component, it's the form that shifts all components @@ -2553,8 +2549,10 @@ void ThreadState::StepNext(ShaderDebugState *state, DebugAPIWrapper *apiWrapper, case OPCODE_ISHR: { uint32_t shifts[] = { - srcOpers[1].value.u32v[0] & 0x1f, srcOpers[1].value.u32v[1] & 0x1f, - srcOpers[1].value.u32v[2] & 0x1f, srcOpers[1].value.u32v[3] & 0x1f, + srcOpers[1].value.u32v[0] & 0x1f, + srcOpers[1].value.u32v[1] & 0x1f, + srcOpers[1].value.u32v[2] & 0x1f, + srcOpers[1].value.u32v[3] & 0x1f, }; // if we were only given a single component, it's the form that shifts all components @@ -2597,9 +2595,9 @@ void ThreadState::StepNext(ShaderDebugState *state, DebugAPIWrapper *apiWrapper, ~srcOpers[0].value.u32v[2], ~srcOpers[0].value.u32v[3])); break; - ///////////////////////////////////////////////////////////////////////////////////////////////////// - // transcendental functions with loose ULP requirements, so we pass them to the GPU to get - // more accurate (well, LESS accurate but more representative) answers. + ///////////////////////////////////////////////////////////////////////////////////////////////////// + // transcendental functions with loose ULP requirements, so we pass them to the GPU to get + // more accurate (well, LESS accurate but more representative) answers. case OPCODE_RCP: case OPCODE_RSQ: @@ -2636,8 +2634,8 @@ void ThreadState::StepNext(ShaderDebugState *state, DebugAPIWrapper *apiWrapper, break; } - ///////////////////////////////////////////////////////////////////////////////////////////////////// - // Misc + ///////////////////////////////////////////////////////////////////////////////////////////////////// + // Misc case OPCODE_NOP: case OPCODE_CUSTOMDATA: @@ -2794,8 +2792,8 @@ void ThreadState::StepNext(ShaderDebugState *state, DebugAPIWrapper *apiWrapper, break; } - ///////////////////////////////////////////////////////////////////////////////////////////////////// - // Comparison + ///////////////////////////////////////////////////////////////////////////////////////////////////// + // Comparison case OPCODE_EQ: SetDst(state, op.operands[0], op, @@ -2931,8 +2929,8 @@ void ThreadState::StepNext(ShaderDebugState *state, DebugAPIWrapper *apiWrapper, (srcOpers[0].value.u32v[3] >= srcOpers[1].value.u32v[3] ? ~0u : 0u))); break; - ///////////////////////////////////////////////////////////////////////////////////////////////////// - // Atomic instructions + ///////////////////////////////////////////////////////////////////////////////////////////////////// + // Atomic instructions case OPCODE_IMM_ATOMIC_ALLOC: { @@ -3625,7 +3623,10 @@ void ThreadState::StepNext(ShaderDebugState *state, DebugAPIWrapper *apiWrapper, else if(sampleCount == 2) { static const float pattern_2x[] = { - _SMP(4.0f), _SMP(4.0f), _SMP(-4.0f), _SMP(-4.0f), + _SMP(4.0f), + _SMP(4.0f), + _SMP(-4.0f), + _SMP(-4.0f), }; sample_pattern = &pattern_2x[0]; @@ -4111,8 +4112,8 @@ void ThreadState::StepNext(ShaderDebugState *state, DebugAPIWrapper *apiWrapper, break; } - ///////////////////////////////////////////////////////////////////////////////////////////////////// - // Flow control + ///////////////////////////////////////////////////////////////////////////////////////////////////// + // Flow control case OPCODE_SWITCH: { @@ -5198,11 +5199,11 @@ void GatherPSInputDataForInitialValues(const DXBC::DXBCContainer *dxbc, psInputDefinition += ";\n"; - int firstElem = sig.regChannelMask & 0x1 ? 0 : sig.regChannelMask & 0x2 - ? 1 - : sig.regChannelMask & 0x4 - ? 2 - : sig.regChannelMask & 0x8 ? 3 : -1; + int firstElem = sig.regChannelMask & 0x1 ? 0 + : sig.regChannelMask & 0x2 ? 1 + : sig.regChannelMask & 0x4 ? 2 + : sig.regChannelMask & 0x8 ? 3 + : -1; // arrays get added all at once (because in the struct data, they are contiguous even if // in the input signature they're not). @@ -5269,11 +5270,11 @@ ShaderDebugTrace *InterpretDebugger::BeginDebug(const DXBC::DXBCContainer *dxbcC v.name = dxbc->GetDXBCByteCode()->GetRegisterName(DXBCBytecode::TYPE_INPUT, sig.regIndex); v.rows = 1; - v.columns = sig.regChannelMask & 0x8 ? 4 : sig.regChannelMask & 0x4 - ? 3 - : sig.regChannelMask & 0x2 - ? 2 - : sig.regChannelMask & 0x1 ? 1 : 0; + v.columns = sig.regChannelMask & 0x8 ? 4 + : sig.regChannelMask & 0x4 ? 3 + : sig.regChannelMask & 0x2 ? 2 + : sig.regChannelMask & 0x1 ? 1 + : 0; v.type = sig.varType; ShaderVariable &dst = state.inputs[sig.regIndex]; @@ -5373,11 +5374,11 @@ ShaderDebugTrace *InterpretDebugger::BeginDebug(const DXBC::DXBCContainer *dxbcC v.name = dxbc->GetDXBCByteCode()->GetRegisterName(type, sig.regIndex); v.rows = 1; - v.columns = sig.regChannelMask & 0x8 ? 4 : sig.regChannelMask & 0x4 - ? 3 - : sig.regChannelMask & 0x2 - ? 2 - : sig.regChannelMask & 0x1 ? 1 : 0; + v.columns = sig.regChannelMask & 0x8 ? 4 + : sig.regChannelMask & 0x4 ? 3 + : sig.regChannelMask & 0x2 ? 2 + : sig.regChannelMask & 0x1 ? 1 + : 0; v.type = sig.varType; ShaderVariable &dst = state.variables[idx]; @@ -5485,12 +5486,20 @@ ShaderDebugTrace *InterpretDebugger::BeginDebug(const DXBC::DXBCContainer *dxbcC ResList lists[2] = { { - VarType::ReadOnlyResource, DebugVariableType::ReadOnlyResource, mapping.readOnlyResources, - refl.readOnlyResources, "tT", ret->readOnlyResources, + VarType::ReadOnlyResource, + DebugVariableType::ReadOnlyResource, + mapping.readOnlyResources, + refl.readOnlyResources, + "tT", + ret->readOnlyResources, }, { - VarType::ReadWriteResource, DebugVariableType::ReadWriteResource, - mapping.readWriteResources, refl.readWriteResources, "uU", ret->readWriteResources, + VarType::ReadWriteResource, + DebugVariableType::ReadWriteResource, + mapping.readWriteResources, + refl.readWriteResources, + "uU", + ret->readWriteResources, }, }; diff --git a/renderdoc/driver/shaders/dxbc/dxbc_sdbg.h b/renderdoc/driver/shaders/dxbc/dxbc_sdbg.h index 7cd1f90a2..ba80fa8fd 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_sdbg.h +++ b/renderdoc/driver/shaders/dxbc/dxbc_sdbg.h @@ -60,8 +60,7 @@ namespace DXBC // Completely understood struct SDBGHeader { - int32_t - version; // Always 0x00000054 it seems. Probably a version number, might be some other ID + int32_t version; // Always 0x00000054 it seems. Probably a version number, might be some other ID int32_t compilerSigOffset; // offset from asciiOffset at the end of this structure. int32_t entryFuncOffset; // offset from asciiOffset at the end of this structure. @@ -76,9 +75,8 @@ struct SDBGHeader CountOffset inputRegisters; // This lists which bits of which inputs are used - e.g. the // components in input // signature elements and cbuffers. - CountOffset - symbolTable; // This is a symbol table definitely, also includes 'virtual' symbols to match - // up ASM instructions to lines. + CountOffset symbolTable; // This is a symbol table definitely, also includes 'virtual' symbols + // to match up ASM instructions to lines. CountOffset scopes; // These are scopes - like for structures/functions. Also Globals/Locals // lists of variables // in scope for reference in ASM instructions diff --git a/renderdoc/driver/shaders/dxbc/dxbc_spdb.cpp b/renderdoc/driver/shaders/dxbc/dxbc_spdb.cpp index 48277da88..ab9e5d4d0 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_spdb.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_spdb.cpp @@ -32,7 +32,7 @@ #include "dxbc_spdb.h" // uncomment the following to print (very verbose) debugging prints for SPDB processing -//#define SPDBLOG(...) RDCDEBUG(__VA_ARGS__) +// #define SPDBLOG(...) RDCDEBUG(__VA_ARGS__) #ifndef SPDBLOG #define SPDBLOG(...) (void)(__VA_ARGS__) diff --git a/renderdoc/driver/shaders/dxil/dxil_bytecode_editor.cpp b/renderdoc/driver/shaders/dxil/dxil_bytecode_editor.cpp index d3b879915..cef567a0c 100644 --- a/renderdoc/driver/shaders/dxil/dxil_bytecode_editor.cpp +++ b/renderdoc/driver/shaders/dxil/dxil_bytecode_editor.cpp @@ -719,16 +719,20 @@ bytebuf ProgramEditor::EncodeProgram() writer.Record(LLVMBC::ModuleRecord::GLOBALVAR, { - typeIndex, uint64_t(((g.flags & GlobalFlags::IsConst) ? 1 : 0) | 0x2 | - ((uint32_t)g.type->addrSpace << 2)), - g.initialiser ? getValueID(g.initialiser) + 1 : 0, linkageValue, - Log2Floor((uint32_t)g.align) + 1, uint64_t(g.section + 1), + typeIndex, + uint64_t(((g.flags & GlobalFlags::IsConst) ? 1 : 0) | 0x2 | + ((uint32_t)g.type->addrSpace << 2)), + g.initialiser ? getValueID(g.initialiser) + 1 : 0, + linkageValue, + Log2Floor((uint32_t)g.align) + 1, + uint64_t(g.section + 1), // visibility 0U, // TLS mode 0U, // unnamed addr - unnamedAddr, (g.flags & GlobalFlags::ExternallyInitialised) ? 1U : 0U, + unnamedAddr, + (g.flags & GlobalFlags::ExternallyInitialised) ? 1U : 0U, // DLL storage class 0U, // comdat @@ -783,7 +787,8 @@ bytebuf ProgramEditor::EncodeProgram() uint64_t typeIndex = getTypeID(a.type); writer.Record(LLVMBC::ModuleRecord::ALIAS, { - typeIndex, getValueID(a.val), + typeIndex, + getValueID(a.val), // linkage 0U, // visibility @@ -1407,10 +1412,12 @@ bytebuf ProgramEditor::EncodeProgram() // new debug location const DebugLocation &loc = m_DebugLocations[inst->debugLoc]; - writer.Record(LLVMBC::FunctionRecord::DEBUG_LOC, - { - loc.line, loc.col, getMetaIDOrNull(loc.scope), getMetaIDOrNull(loc.inlinedAt), - }); + writer.Record(LLVMBC::FunctionRecord::DEBUG_LOC, { + loc.line, + loc.col, + getMetaIDOrNull(loc.scope), + getMetaIDOrNull(loc.inlinedAt), + }); debugLoc = inst->debugLoc; } diff --git a/renderdoc/driver/shaders/dxil/llvm_decoder.cpp b/renderdoc/driver/shaders/dxil/llvm_decoder.cpp index b949764c9..9f7407ea2 100644 --- a/renderdoc/driver/shaders/dxil/llvm_decoder.cpp +++ b/renderdoc/driver/shaders/dxil/llvm_decoder.cpp @@ -423,13 +423,25 @@ TEST_CASE("Check LLVM bitreader", "[llvm]") // values byte bits[] = { // dword 1 - 0x96, 0xf0, 0xA5, 0x3C, + 0x96, + 0xf0, + 0xA5, + 0x3C, // padding dword - 0x00, 0x00, 0x00, 0x00, + 0x00, + 0x00, + 0x00, + 0x00, // padding dword - 0x00, 0x00, 0x00, 0x00, + 0x00, + 0x00, + 0x00, + 0x00, // padding dword - 0x00, 0x00, 0x00, 0x00, + 0x00, + 0x00, + 0x00, + 0x00, }; LLVMBC::BitReader b(bits, sizeof(bits)); @@ -603,7 +615,8 @@ TEST_CASE("Check LLVM bitreader", "[llvm]") }; uint64_t expected[] = { - 0, 0, + 0, + 0, // i_vbr2 0x0003, // i_vbr3 @@ -787,12 +800,16 @@ TEST_CASE("Check LLVM bitreader", "[llvm]") // first i_4 value 0x04, // padding for alignment - 0x00, 0x00, 0x00, + 0x00, + 0x00, + 0x00, // second two i_4 values 0xF5, // i_24 value - 0xCA, 0x99, 0x23, + 0xCA, + 0x99, + 0x23, // no padding - already aligned @@ -857,19 +874,30 @@ TEST_CASE("Check LLVM bitreader", "[llvm]") // first vbr_6 length 0x06, // padding for alignment - 0x00, 0x00, 0x00, + 0x00, + 0x00, + 0x00, // blob data - 0xF5, 0x00, 0xCA, 0x40, 0x99, 0x23, + 0xF5, + 0x00, + 0xCA, + 0x40, + 0x99, + 0x23, // padding for trailing alignment - 0x00, 0x00, + 0x00, + 0x00, // i_20 dummy to get us to the point where two vbr_6 chunks would be aligned // we choose a length of 70, which is 0b10 00110, then vbr_6 encoded it becomes // 0b000010 100110 which is 0xA6, over 12 bits. That leaves 4 bits in the upper part of // the last byte of the i_20, and the remaining 8 in the next byte - 0x5B, 0xC2, 0x64, 0x0A, + 0x5B, + 0xC2, + 0x64, + 0x0A, }; LLVMBC::BitReader b(bits, sizeof(bits)); diff --git a/renderdoc/driver/shaders/dxil/llvm_encoder.cpp b/renderdoc/driver/shaders/dxil/llvm_encoder.cpp index 28b00e1d7..d922f1f12 100644 --- a/renderdoc/driver/shaders/dxil/llvm_encoder.cpp +++ b/renderdoc/driver/shaders/dxil/llvm_encoder.cpp @@ -99,19 +99,31 @@ enum class ValueSymtabAbbrev AbbrevDefinition ValueSymtabAbbrevDefs[] = { // Entry8 { - AbbFixed(3), AbbVBR(8), AbbArray(), AbbFixed(8), + AbbFixed(3), + AbbVBR(8), + AbbArray(), + AbbFixed(8), }, // Entry7 { - AbbLiteral(ValueSymtabRecord::ENTRY), AbbVBR(8), AbbArray(), AbbFixed(7), + AbbLiteral(ValueSymtabRecord::ENTRY), + AbbVBR(8), + AbbArray(), + AbbFixed(7), }, // Entry6 { - AbbLiteral(ValueSymtabRecord::ENTRY), AbbVBR(8), AbbArray(), AbbChar6(), + AbbLiteral(ValueSymtabRecord::ENTRY), + AbbVBR(8), + AbbArray(), + AbbChar6(), }, // BBEntry6 { - AbbLiteral(ValueSymtabRecord::BBENTRY), AbbVBR(8), AbbArray(), AbbChar6(), + AbbLiteral(ValueSymtabRecord::BBENTRY), + AbbVBR(8), + AbbArray(), + AbbChar6(), }, }; @@ -131,15 +143,20 @@ enum class ConstantsAbbrev AbbrevDefinition ConstantsAbbrevDefs[] = { // SetType { - AbbLiteral(ConstantsRecord::SETTYPE), AbbFixedTypes(), + AbbLiteral(ConstantsRecord::SETTYPE), + AbbFixedTypes(), }, // Integer { - AbbLiteral(ConstantsRecord::INTEGER), AbbVBR(8), + AbbLiteral(ConstantsRecord::INTEGER), + AbbVBR(8), }, // EvalCast { - AbbLiteral(ConstantsRecord::EVAL_CAST), AbbFixed(4), AbbFixedTypes(), AbbVBR(8), + AbbLiteral(ConstantsRecord::EVAL_CAST), + AbbFixed(4), + AbbFixedTypes(), + AbbVBR(8), }, // Null { @@ -150,19 +167,27 @@ AbbrevDefinition ConstantsAbbrevDefs[] = { AbbrevDefinition ConstantsGlobalAbbrevDefs[] = { // Aggregate { - AbbLiteral(ConstantsRecord::AGGREGATE), AbbArray(), AbbFixedConstants(), + AbbLiteral(ConstantsRecord::AGGREGATE), + AbbArray(), + AbbFixedConstants(), }, // String { - AbbLiteral(ConstantsRecord::STRING), AbbArray(), AbbFixed(8), + AbbLiteral(ConstantsRecord::STRING), + AbbArray(), + AbbFixed(8), }, // CString7 { - AbbLiteral(ConstantsRecord::CSTRING), AbbArray(), AbbFixed(7), + AbbLiteral(ConstantsRecord::CSTRING), + AbbArray(), + AbbFixed(7), }, // CString6 { - AbbLiteral(ConstantsRecord::CSTRING), AbbArray(), AbbChar6(), + AbbLiteral(ConstantsRecord::CSTRING), + AbbArray(), + AbbChar6(), }, }; @@ -181,19 +206,33 @@ enum class FunctionAbbrev AbbrevDefinition FunctionAbbrevDefs[] = { // Load { - AbbLiteral(FunctionRecord::INST_LOAD), AbbVBR(6), AbbFixedTypes(), AbbVBR(4), AbbFixed(1), + AbbLiteral(FunctionRecord::INST_LOAD), + AbbVBR(6), + AbbFixedTypes(), + AbbVBR(4), + AbbFixed(1), }, // BinOp { - AbbLiteral(FunctionRecord::INST_BINOP), AbbVBR(6), AbbVBR(6), AbbFixed(4), + AbbLiteral(FunctionRecord::INST_BINOP), + AbbVBR(6), + AbbVBR(6), + AbbFixed(4), }, // BinOpFlags { - AbbLiteral(FunctionRecord::INST_BINOP), AbbVBR(6), AbbVBR(6), AbbFixed(4), AbbFixed(7), + AbbLiteral(FunctionRecord::INST_BINOP), + AbbVBR(6), + AbbVBR(6), + AbbFixed(4), + AbbFixed(7), }, // Cast { - AbbLiteral(FunctionRecord::INST_CAST), AbbVBR(6), AbbFixedTypes(), AbbFixed(4), + AbbLiteral(FunctionRecord::INST_CAST), + AbbVBR(6), + AbbFixedTypes(), + AbbFixed(4), }, // RetVoid { @@ -201,7 +240,8 @@ AbbrevDefinition FunctionAbbrevDefs[] = { }, // RetValue { - AbbLiteral(FunctionRecord::INST_RET), AbbVBR(6), + AbbLiteral(FunctionRecord::INST_RET), + AbbVBR(6), }, // Unreachable { @@ -209,7 +249,11 @@ AbbrevDefinition FunctionAbbrevDefs[] = { }, // GEP { - AbbLiteral(FunctionRecord::INST_GEP), AbbFixed(1), AbbFixedTypes(), AbbArray(), AbbVBR(6), + AbbLiteral(FunctionRecord::INST_GEP), + AbbFixed(1), + AbbFixedTypes(), + AbbArray(), + AbbVBR(6), }, }; @@ -226,27 +270,42 @@ enum class TypeAbbrev AbbrevDefinition TypeAbbrevDefs[] = { // Pointer { - AbbLiteral(TypeRecord::POINTER), AbbFixedTypes(), AbbLiteral(0), + AbbLiteral(TypeRecord::POINTER), + AbbFixedTypes(), + AbbLiteral(0), }, // Function { - AbbLiteral(TypeRecord::FUNCTION), AbbFixed(1), AbbArray(), AbbFixedTypes(), + AbbLiteral(TypeRecord::FUNCTION), + AbbFixed(1), + AbbArray(), + AbbFixedTypes(), }, // AnonStruct { - AbbLiteral(TypeRecord::STRUCT_ANON), AbbFixed(1), AbbArray(), AbbFixedTypes(), + AbbLiteral(TypeRecord::STRUCT_ANON), + AbbFixed(1), + AbbArray(), + AbbFixedTypes(), }, // StructName { - AbbLiteral(TypeRecord::STRUCT_NAME), AbbArray(), AbbChar6(), + AbbLiteral(TypeRecord::STRUCT_NAME), + AbbArray(), + AbbChar6(), }, // NamedStruct { - AbbLiteral(TypeRecord::STRUCT_NAMED), AbbFixed(1), AbbArray(), AbbFixedTypes(), + AbbLiteral(TypeRecord::STRUCT_NAMED), + AbbFixed(1), + AbbArray(), + AbbFixedTypes(), }, // Array { - AbbLiteral(TypeRecord::ARRAY), AbbVBR(8), AbbFixedTypes(), + AbbLiteral(TypeRecord::ARRAY), + AbbVBR(8), + AbbFixedTypes(), }, }; @@ -260,15 +319,24 @@ enum class MetadataAbbrev AbbrevDefinition MetadataAbbrevDefs[] = { // String { - AbbLiteral(MetaDataRecord::STRING_OLD), AbbArray(), AbbFixed(8), + AbbLiteral(MetaDataRecord::STRING_OLD), + AbbArray(), + AbbFixed(8), }, // DebugLocation { - AbbLiteral(MetaDataRecord::LOCATION), AbbFixed(1), AbbVBR(6), AbbVBR(8), AbbVBR(6), AbbVBR(6), + AbbLiteral(MetaDataRecord::LOCATION), + AbbFixed(1), + AbbVBR(6), + AbbVBR(8), + AbbVBR(6), + AbbVBR(6), }, // Name { - AbbLiteral(MetaDataRecord::NAME), AbbArray(), AbbFixed(8), + AbbLiteral(MetaDataRecord::NAME), + AbbArray(), + AbbFixed(8), }, }; @@ -576,9 +644,7 @@ void BitcodeWriter::AutoRecord(uint32_t record, bool param, uint64_t val) // these abbrevs are available in all constants blocks case ConstantsRecord::SETTYPE: idx = (uint32_t)ConstantsAbbrev::SetType; break; case ConstantsRecord::INTEGER: idx = (uint32_t)ConstantsAbbrev::Integer; break; - case ConstantsRecord::EVAL_CAST: - idx = (uint32_t)ConstantsAbbrev::EvalCast; - break; + case ConstantsRecord::EVAL_CAST: idx = (uint32_t)ConstantsAbbrev::EvalCast; break; // LLVM doesn't seem to use this abbrev? // case ConstantsRecord::CONST_NULL: idx = (uint32_t)ConstantsAbbrev::Null; break; default: break; diff --git a/renderdoc/driver/shaders/spirv/spirv_debug.cpp b/renderdoc/driver/shaders/spirv/spirv_debug.cpp index 2412a81b2..acf7d811a 100644 --- a/renderdoc/driver/shaders/spirv/spirv_debug.cpp +++ b/renderdoc/driver/shaders/spirv/spirv_debug.cpp @@ -819,11 +819,11 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray break; } - ////////////////////////////////////////////////////////////////////////////// - // - // Composite/vector opcodes - // - ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + // + // Composite/vector opcodes + // + ////////////////////////////////////////////////////////////////////////////// case Op::CompositeExtract: { @@ -1072,11 +1072,11 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray break; } - ////////////////////////////////////////////////////////////////////////////// - // - // Conversion opcodes - // - ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + // + // Conversion opcodes + // + ////////////////////////////////////////////////////////////////////////////// case Op::ConvertFToS: case Op::ConvertFToU: @@ -1313,11 +1313,11 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray break; } - ////////////////////////////////////////////////////////////////////////////// - // - // Extended instruction set handling - // - ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + // + // Extended instruction set handling + // + ////////////////////////////////////////////////////////////////////////////// case Op::ExtInst: { @@ -1360,11 +1360,11 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray break; } - ////////////////////////////////////////////////////////////////////////////// - // - // Comparison opcodes - // - ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + // + // Comparison opcodes + // + ////////////////////////////////////////////////////////////////////////////// case Op::LogicalEqual: case Op::LogicalNotEqual: @@ -1735,11 +1735,11 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray break; } - ////////////////////////////////////////////////////////////////////////////// - // - // Bitwise/logical opcodes - // - ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + // + // Bitwise/logical opcodes + // + ////////////////////////////////////////////////////////////////////////////// case Op::BitCount: { @@ -1964,11 +1964,11 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray break; } - ////////////////////////////////////////////////////////////////////////////// - // - // Mathematical opcodes - // - ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + // + // Mathematical opcodes + // + ////////////////////////////////////////////////////////////////////////////// case Op::FMul: case Op::FDiv: @@ -2253,7 +2253,7 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray { for(uint8_t c = 0; c < a.columns; c++) { -// if b <= a we don't need to borrow, otherwise set the borrow bit + // if b <= a we don't need to borrow, otherwise set the borrow bit #undef _IMPL #define _IMPL(I, S, U) \ @@ -2508,11 +2508,11 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray break; } - ////////////////////////////////////////////////////////////////////////////// - // - // Image opcodes - // - ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + // + // Image opcodes + // + ////////////////////////////////////////////////////////////////////////////// case Op::SampledImage: { @@ -2826,11 +2826,11 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray break; } - ////////////////////////////////////////////////////////////////////////////// - // - // Block flow control opcodes - // - ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + // + // Block flow control opcodes + // + ////////////////////////////////////////////////////////////////////////////// case Op::MemoryBarrier: case Op::ControlBarrier: @@ -2908,11 +2908,11 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray break; } - ////////////////////////////////////////////////////////////////////////////// - // - // Misc opcodes - // - ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + // + // Misc opcodes + // + ////////////////////////////////////////////////////////////////////////////// case Op::CopyObject: case Op::CopyLogical: @@ -2961,11 +2961,11 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray break; } - ////////////////////////////////////////////////////////////////////////////// - // - // Function flow control opcodes - // - ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + // + // Function flow control opcodes + // + ////////////////////////////////////////////////////////////////////////////// case Op::FunctionCall: { @@ -3050,11 +3050,11 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray break; } - ////////////////////////////////////////////////////////////////////////////// - // - // Atomic opcodes - // - ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + // + // Atomic opcodes + // + ////////////////////////////////////////////////////////////////////////////// case Op::ImageTexelPointer: { @@ -3426,11 +3426,11 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray break; } - ////////////////////////////////////////////////////////////////////////////// - // - // Misc. opcodes - // - ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + // + // Misc. opcodes + // + ////////////////////////////////////////////////////////////////////////////// case Op::Undef: { diff --git a/renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp b/renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp index 038a720da..0cb92bf9f 100644 --- a/renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp +++ b/renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp @@ -924,9 +924,9 @@ ShaderDebugTrace *Debugger::BeginDebug(DebugAPIWrapper *api, const ShaderStage s // fill the interface variable auto fillInputCallback = [this, isInput, addSource, ret, &sigNames, &rawName, &sourceName]( - ShaderVariable &var, const Decorations &curDecorations, const DataType &type, - uint64_t location, const rdcstr &accessSuffix) { - + ShaderVariable &var, const Decorations &curDecorations, + const DataType &type, uint64_t location, + const rdcstr &accessSuffix) { if(!var.members.empty()) return; @@ -1095,9 +1095,8 @@ ShaderDebugTrace *Debugger::BeginDebug(DebugAPIWrapper *api, const ShaderStage s bindpoint.bind = (int32_t)bind; auto cbufferCallback = [this, &bindpoint]( - ShaderVariable &var, const Decorations &curDecorations, const DataType &type, - uint64_t offset, const rdcstr &) { - + ShaderVariable &var, const Decorations &curDecorations, + const DataType &type, uint64_t offset, const rdcstr &) { if(!var.members.empty()) return; @@ -2303,7 +2302,6 @@ ShaderVariable Debugger::ReadFromPointer(const ShaderVariable &ptr) const auto readCallback = [this, bind](ShaderVariable &var, const Decorations &dec, const DataType &type, uint64_t offset, const rdcstr &) { - // ignore any callbacks we get on the way up for structs/arrays, we don't need it we only read // or write at primitive level if(!var.members.empty()) @@ -2482,8 +2480,8 @@ void Debugger::WriteThroughPointer(ShaderVariable &ptr, const ShaderVariable &va bool rowMajor = checkPointerFlags(ptr, PointerFlags::RowMajorMatrix); auto writeCallback = [this, bind, matrixStride, rowMajor]( - const ShaderVariable &var, const Decorations &, const DataType &type, uint64_t offset, - const rdcstr &) { + const ShaderVariable &var, const Decorations &, const DataType &type, + uint64_t offset, const rdcstr &) { if(!var.members.empty()) return; @@ -3288,7 +3286,9 @@ void Debugger::RegisterOp(Iter it) rdcstr name = strings[dbg.arg(0)]; uint32_t tag = EvaluateConstant(dbg.arg(1), {}).value.u32v[0]; const rdcstr tagString[3] = { - "class ", "struct ", "union ", + "class ", + "struct ", + "union ", }; // don't use arg 2 source - assume the parent is in the same file so it's redundant @@ -3394,7 +3394,8 @@ void Debugger::RegisterOp(Iter it) case ShaderDbg::LocalVariable: { m_DebugInfo.locals[dbg.result] = { - strings[dbg.arg(0)], &m_DebugInfo.scopes[dbg.arg(5)], + strings[dbg.arg(0)], + &m_DebugInfo.scopes[dbg.arg(5)], &m_DebugInfo.types[dbg.arg(1)], }; diff --git a/renderdoc/driver/shaders/spirv/spirv_disassemble.cpp b/renderdoc/driver/shaders/spirv/spirv_disassemble.cpp index 385950161..50c62f842 100644 --- a/renderdoc/driver/shaders/spirv/spirv_disassemble.cpp +++ b/renderdoc/driver/shaders/spirv/spirv_disassemble.cpp @@ -336,8 +336,7 @@ rdcstr Reflector::Disassemble(const rdcstr &entryPoint, case Op::String: case Op::Name: case Op::MemberName: - case Op::ExtInstImport: - continue; + case Op::ExtInstImport: continue; // ignore decorations too, we already have these cached case Op::Decorate: @@ -347,8 +346,7 @@ rdcstr Reflector::Disassemble(const rdcstr &entryPoint, case Op::MemberDecorateString: case Op::DecorationGroup: case Op::GroupDecorate: - case Op::GroupMemberDecorate: - continue; + case Op::GroupMemberDecorate: continue; // suppress almost all types case Op::TypeVoid: @@ -447,9 +445,7 @@ rdcstr Reflector::Disassemble(const rdcstr &entryPoint, case VarType::UShort: ret += ToStr(value.u16v[0]); break; case VarType::UByte: ret += ToStr(value.u8v[0]); break; case VarType::SLong: ret += ToStr(value.s64v[0]); break; - case VarType::ULong: - ret += ToStr(value.u64v[0]); - break; + case VarType::ULong: ret += ToStr(value.u64v[0]); break; // none of these types are expected, either because they're opaque or (for struct) // because ConstantComposite should have been used case VarType::Enum: @@ -1212,9 +1208,9 @@ rdcstr Reflector::Disassemble(const rdcstr &entryPoint, break; } - //////////////////////////////////////////////////////////////////////////////////////// - // pretty printing unary instructions - //////////////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////////////// + // pretty printing unary instructions + //////////////////////////////////////////////////////////////////////////////////////// case Op::SNegate: case Op::FNegate: @@ -1242,9 +1238,9 @@ rdcstr Reflector::Disassemble(const rdcstr &entryPoint, break; } - //////////////////////////////////////////////////////////////////////////////////////// - // pretty printing binary instructions - //////////////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////////////// + // pretty printing binary instructions + //////////////////////////////////////////////////////////////////////////////////////// case Op::IAdd: case Op::FAdd: diff --git a/renderdoc/driver/shaders/spirv/spirv_reflect.cpp b/renderdoc/driver/shaders/spirv/spirv_reflect.cpp index 907bcd7ad..dbe5913c2 100644 --- a/renderdoc/driver/shaders/spirv/spirv_reflect.cpp +++ b/renderdoc/driver/shaders/spirv/spirv_reflect.cpp @@ -606,7 +606,8 @@ void Reflector::RegisterOp(Iter it) { debugSources[dbg.result] = sources.size(); sources.push_back({ - SourceLanguage::Unknown, strings[dbg.arg(0)], + SourceLanguage::Unknown, + strings[dbg.arg(0)], dbg.params.size() > 1 ? strings[dbg.arg(1)] : rdcstr(), }); } @@ -2148,7 +2149,6 @@ TEST_CASE("Validate SPIR-V reflection", "[spirv][reflection]") ShaderType type = ShaderType::Vulkan; auto compiler = [&type](ShaderStage stage, const rdcstr &source, const rdcstr &entryPoint, ShaderReflection &refl, ShaderBindpointMapping &mapping) { - rdcspv::Init(); RenderDoc::Inst().RegisterShutdownFunction(&rdcspv::Shutdown); diff --git a/renderdoc/driver/vulkan/imgrefs_tests.cpp b/renderdoc/driver/vulkan/imgrefs_tests.cpp index 5401d40c8..ec47ead54 100644 --- a/renderdoc/driver/vulkan/imgrefs_tests.cpp +++ b/renderdoc/driver/vulkan/imgrefs_tests.cpp @@ -151,13 +151,29 @@ TEST_CASE("Test ImgRefs type", "[imgrefs]") imgRefs.Update(range1, eFrameRef_PartialWrite); rdcarray expected = { // VK_IMAGE_ASPECT_DEPTH_BIT - eFrameRef_None, eFrameRef_None, eFrameRef_None, eFrameRef_None, eFrameRef_None, - eFrameRef_PartialWrite, eFrameRef_PartialWrite, eFrameRef_None, eFrameRef_None, - eFrameRef_None, eFrameRef_None, + eFrameRef_None, + eFrameRef_None, + eFrameRef_None, + eFrameRef_None, + eFrameRef_None, + eFrameRef_PartialWrite, + eFrameRef_PartialWrite, + eFrameRef_None, + eFrameRef_None, + eFrameRef_None, + eFrameRef_None, // VK_IMAGE_ASPECT_STENCIL_BIT - eFrameRef_Read, eFrameRef_Read, eFrameRef_Read, eFrameRef_Read, eFrameRef_Read, - eFrameRef_ReadBeforeWrite, eFrameRef_ReadBeforeWrite, eFrameRef_Read, eFrameRef_Read, - eFrameRef_Read, eFrameRef_Read, + eFrameRef_Read, + eFrameRef_Read, + eFrameRef_Read, + eFrameRef_Read, + eFrameRef_Read, + eFrameRef_ReadBeforeWrite, + eFrameRef_ReadBeforeWrite, + eFrameRef_Read, + eFrameRef_Read, + eFrameRef_Read, + eFrameRef_Read, }; CHECK(imgRefs.rangeRefs == expected); } @@ -176,36 +192,89 @@ TEST_CASE("Test ImgRefs type", "[imgrefs]") imgRefs.Update(range1, eFrameRef_PartialWrite); rdcarray expected = { // (Depth, level 0) - eFrameRef_None, eFrameRef_Read, eFrameRef_Read, eFrameRef_None, eFrameRef_None, + eFrameRef_None, + eFrameRef_Read, + eFrameRef_Read, + eFrameRef_None, + eFrameRef_None, // (Depth, level 1) - eFrameRef_None, eFrameRef_Read, eFrameRef_Read, eFrameRef_None, eFrameRef_None, + eFrameRef_None, + eFrameRef_Read, + eFrameRef_Read, + eFrameRef_None, + eFrameRef_None, // (Depth, level 2) - eFrameRef_PartialWrite, eFrameRef_ReadBeforeWrite, eFrameRef_ReadBeforeWrite, - eFrameRef_PartialWrite, eFrameRef_PartialWrite, + eFrameRef_PartialWrite, + eFrameRef_ReadBeforeWrite, + eFrameRef_ReadBeforeWrite, + eFrameRef_PartialWrite, + eFrameRef_PartialWrite, // (Depth, level 3) - eFrameRef_PartialWrite, eFrameRef_ReadBeforeWrite, eFrameRef_ReadBeforeWrite, - eFrameRef_PartialWrite, eFrameRef_PartialWrite, + eFrameRef_PartialWrite, + eFrameRef_ReadBeforeWrite, + eFrameRef_ReadBeforeWrite, + eFrameRef_PartialWrite, + eFrameRef_PartialWrite, // (Depth, level 4) - eFrameRef_PartialWrite, eFrameRef_ReadBeforeWrite, eFrameRef_ReadBeforeWrite, - eFrameRef_PartialWrite, eFrameRef_PartialWrite, + eFrameRef_PartialWrite, + eFrameRef_ReadBeforeWrite, + eFrameRef_ReadBeforeWrite, + eFrameRef_PartialWrite, + eFrameRef_PartialWrite, // (Depth, level 5) - eFrameRef_None, eFrameRef_Read, eFrameRef_Read, eFrameRef_None, eFrameRef_None, + eFrameRef_None, + eFrameRef_Read, + eFrameRef_Read, + eFrameRef_None, + eFrameRef_None, // (Depth, level 6) - eFrameRef_None, eFrameRef_Read, eFrameRef_Read, eFrameRef_None, eFrameRef_None, + eFrameRef_None, + eFrameRef_Read, + eFrameRef_Read, + eFrameRef_None, + eFrameRef_None, // (Stencil, level 0) - eFrameRef_None, eFrameRef_Read, eFrameRef_Read, eFrameRef_None, eFrameRef_None, + eFrameRef_None, + eFrameRef_Read, + eFrameRef_Read, + eFrameRef_None, + eFrameRef_None, // (Stencil, level 1) - eFrameRef_None, eFrameRef_Read, eFrameRef_Read, eFrameRef_None, eFrameRef_None, + eFrameRef_None, + eFrameRef_Read, + eFrameRef_Read, + eFrameRef_None, + eFrameRef_None, // (Stencil, level 2) - eFrameRef_None, eFrameRef_Read, eFrameRef_Read, eFrameRef_None, eFrameRef_None, + eFrameRef_None, + eFrameRef_Read, + eFrameRef_Read, + eFrameRef_None, + eFrameRef_None, // (Stencil, level 3) - eFrameRef_None, eFrameRef_Read, eFrameRef_Read, eFrameRef_None, eFrameRef_None, + eFrameRef_None, + eFrameRef_Read, + eFrameRef_Read, + eFrameRef_None, + eFrameRef_None, // (Stencil, level 4) - eFrameRef_None, eFrameRef_Read, eFrameRef_Read, eFrameRef_None, eFrameRef_None, + eFrameRef_None, + eFrameRef_Read, + eFrameRef_Read, + eFrameRef_None, + eFrameRef_None, // (Stencil, level 5) - eFrameRef_None, eFrameRef_Read, eFrameRef_Read, eFrameRef_None, eFrameRef_None, + eFrameRef_None, + eFrameRef_Read, + eFrameRef_Read, + eFrameRef_None, + eFrameRef_None, // (Stencil, level 6) - eFrameRef_None, eFrameRef_Read, eFrameRef_Read, eFrameRef_None, eFrameRef_None, + eFrameRef_None, + eFrameRef_Read, + eFrameRef_Read, + eFrameRef_None, + eFrameRef_None, }; CHECK(imgRefs.rangeRefs == expected); diff --git a/renderdoc/driver/vulkan/vk_common.h b/renderdoc/driver/vulkan/vk_common.h index 16021d3cf..ee32cbbe4 100644 --- a/renderdoc/driver/vulkan/vk_common.h +++ b/renderdoc/driver/vulkan/vk_common.h @@ -41,15 +41,28 @@ #else // make handles typed even on 32-bit, by relying on C++ -#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(obj) \ - struct obj \ - { \ - obj() : handle(0) {} \ - obj(uint64_t x) : handle(x) {} \ - bool operator==(const obj &other) const { return handle == other.handle; } \ - bool operator<(const obj &other) const { return handle < other.handle; } \ - bool operator!=(const obj &other) const { return handle != other.handle; } \ - uint64_t handle; \ +#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(obj) \ + struct obj \ + { \ + obj() : handle(0) \ + { \ + } \ + obj(uint64_t x) : handle(x) \ + { \ + } \ + bool operator==(const obj &other) const \ + { \ + return handle == other.handle; \ + } \ + bool operator<(const obj &other) const \ + { \ + return handle < other.handle; \ + } \ + bool operator!=(const obj &other) const \ + { \ + return handle != other.handle; \ + } \ + uint64_t handle; \ }; #define VK_NON_DISPATCHABLE_WRAPPER_STRUCT @@ -511,45 +524,43 @@ FrameRefType GetRefType(DescriptorSlotType descType); constexpr VkDescriptorType convert(DescriptorSlotType type) { - // temporarily disable clang-format to make this more readable. - // Ideally we'd use a simple switch() but VS2015 doesn't support that :(. - // clang-format off - return type == DescriptorSlotType::Unwritten ? VK_DESCRIPTOR_TYPE_MAX_ENUM - : type == DescriptorSlotType::Sampler ? VK_DESCRIPTOR_TYPE_SAMPLER - : type == DescriptorSlotType::CombinedImageSampler ? VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER - : type == DescriptorSlotType::SampledImage ? VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE - : type == DescriptorSlotType::StorageImage ? VK_DESCRIPTOR_TYPE_STORAGE_IMAGE - : type == DescriptorSlotType::UniformTexelBuffer ? VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER - : type == DescriptorSlotType::StorageTexelBuffer ? VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER - : type == DescriptorSlotType::UniformBuffer ? VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER - : type == DescriptorSlotType::StorageBuffer ? VK_DESCRIPTOR_TYPE_STORAGE_BUFFER - : type == DescriptorSlotType::UniformBufferDynamic ? VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC - : type == DescriptorSlotType::StorageBufferDynamic ? VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC - : type == DescriptorSlotType::InputAttachment ? VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT - : type == DescriptorSlotType::InlineBlock ? VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK - : VK_DESCRIPTOR_TYPE_MAX_ENUM; - // clang-format on + return type == DescriptorSlotType::Unwritten ? VK_DESCRIPTOR_TYPE_MAX_ENUM + : type == DescriptorSlotType::Sampler ? VK_DESCRIPTOR_TYPE_SAMPLER + : type == DescriptorSlotType::CombinedImageSampler + ? VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER + : type == DescriptorSlotType::SampledImage ? VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE + : type == DescriptorSlotType::StorageImage ? VK_DESCRIPTOR_TYPE_STORAGE_IMAGE + : type == DescriptorSlotType::UniformTexelBuffer ? VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER + : type == DescriptorSlotType::StorageTexelBuffer ? VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER + : type == DescriptorSlotType::UniformBuffer ? VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER + : type == DescriptorSlotType::StorageBuffer ? VK_DESCRIPTOR_TYPE_STORAGE_BUFFER + : type == DescriptorSlotType::UniformBufferDynamic + ? VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC + : type == DescriptorSlotType::StorageBufferDynamic + ? VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC + : type == DescriptorSlotType::InputAttachment ? VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT + : type == DescriptorSlotType::InlineBlock ? VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK + : VK_DESCRIPTOR_TYPE_MAX_ENUM; } constexpr DescriptorSlotType convert(VkDescriptorType type) { - // temporarily disable clang-format to make this more readable. - // Ideally we'd use a simple switch() but VS2015 doesn't support that :(. - // clang-format off - return type == VK_DESCRIPTOR_TYPE_SAMPLER ? DescriptorSlotType::Sampler - : type == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER ? DescriptorSlotType::CombinedImageSampler - : type == VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE ? DescriptorSlotType::SampledImage - : type == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE ? DescriptorSlotType::StorageImage - : type == VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER ? DescriptorSlotType::UniformTexelBuffer - : type == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER ? DescriptorSlotType::StorageTexelBuffer - : type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER ? DescriptorSlotType::UniformBuffer - : type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER ? DescriptorSlotType::StorageBuffer - : type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC ? DescriptorSlotType::UniformBufferDynamic - : type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC ? DescriptorSlotType::StorageBufferDynamic - : type == VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT ? DescriptorSlotType::InputAttachment - : type == VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK ? DescriptorSlotType::InlineBlock - : DescriptorSlotType::Unwritten; - // clang-format on + return type == VK_DESCRIPTOR_TYPE_SAMPLER ? DescriptorSlotType::Sampler + : type == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER + ? DescriptorSlotType::CombinedImageSampler + : type == VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE ? DescriptorSlotType::SampledImage + : type == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE ? DescriptorSlotType::StorageImage + : type == VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER ? DescriptorSlotType::UniformTexelBuffer + : type == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER ? DescriptorSlotType::StorageTexelBuffer + : type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER ? DescriptorSlotType::UniformBuffer + : type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER ? DescriptorSlotType::StorageBuffer + : type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC + ? DescriptorSlotType::UniformBufferDynamic + : type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC + ? DescriptorSlotType::StorageBufferDynamic + : type == VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT ? DescriptorSlotType::InputAttachment + : type == VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK ? DescriptorSlotType::InlineBlock + : DescriptorSlotType::Unwritten; } enum class DescriptorSlotImageLayout : EnumBaseType diff --git a/renderdoc/driver/vulkan/vk_core.cpp b/renderdoc/driver/vulkan/vk_core.cpp index f7a8f9009..bab984b44 100644 --- a/renderdoc/driver/vulkan/vk_core.cpp +++ b/renderdoc/driver/vulkan/vk_core.cpp @@ -825,55 +825,68 @@ bool operator<(const VkExtensionProperties &a, const VkExtensionProperties &b) // This list must be kept sorted according to the above sort operator! static const VkExtensionProperties supportedExtensions[] = { { - VK_AMD_BUFFER_MARKER_EXTENSION_NAME, VK_AMD_BUFFER_MARKER_SPEC_VERSION, + VK_AMD_BUFFER_MARKER_EXTENSION_NAME, + VK_AMD_BUFFER_MARKER_SPEC_VERSION, }, { - VK_AMD_DEVICE_COHERENT_MEMORY_EXTENSION_NAME, VK_AMD_DEVICE_COHERENT_MEMORY_SPEC_VERSION, + VK_AMD_DEVICE_COHERENT_MEMORY_EXTENSION_NAME, + VK_AMD_DEVICE_COHERENT_MEMORY_SPEC_VERSION, }, { - VK_AMD_DISPLAY_NATIVE_HDR_EXTENSION_NAME, VK_AMD_DISPLAY_NATIVE_HDR_SPEC_VERSION, + VK_AMD_DISPLAY_NATIVE_HDR_EXTENSION_NAME, + VK_AMD_DISPLAY_NATIVE_HDR_SPEC_VERSION, }, { - VK_AMD_GCN_SHADER_EXTENSION_NAME, VK_AMD_GCN_SHADER_SPEC_VERSION, + VK_AMD_GCN_SHADER_EXTENSION_NAME, + VK_AMD_GCN_SHADER_SPEC_VERSION, }, { - VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME, VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION, + VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME, + VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION, }, { - VK_AMD_GPU_SHADER_INT16_EXTENSION_NAME, VK_AMD_GPU_SHADER_INT16_SPEC_VERSION, + VK_AMD_GPU_SHADER_INT16_EXTENSION_NAME, + VK_AMD_GPU_SHADER_INT16_SPEC_VERSION, }, { VK_AMD_MEMORY_OVERALLOCATION_BEHAVIOR_EXTENSION_NAME, VK_AMD_MEMORY_OVERALLOCATION_BEHAVIOR_SPEC_VERSION, }, { - VK_AMD_MIXED_ATTACHMENT_SAMPLES_EXTENSION_NAME, VK_AMD_MIXED_ATTACHMENT_SAMPLES_SPEC_VERSION, + VK_AMD_MIXED_ATTACHMENT_SAMPLES_EXTENSION_NAME, + VK_AMD_MIXED_ATTACHMENT_SAMPLES_SPEC_VERSION, }, { - VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME, VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION, + VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME, + VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION, }, { - VK_AMD_SHADER_BALLOT_EXTENSION_NAME, VK_AMD_SHADER_BALLOT_SPEC_VERSION, + VK_AMD_SHADER_BALLOT_EXTENSION_NAME, + VK_AMD_SHADER_BALLOT_SPEC_VERSION, }, { - VK_AMD_SHADER_CORE_PROPERTIES_EXTENSION_NAME, VK_AMD_SHADER_CORE_PROPERTIES_SPEC_VERSION, + VK_AMD_SHADER_CORE_PROPERTIES_EXTENSION_NAME, + VK_AMD_SHADER_CORE_PROPERTIES_SPEC_VERSION, }, { VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME, VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_SPEC_VERSION, }, { - VK_AMD_SHADER_FRAGMENT_MASK_EXTENSION_NAME, VK_AMD_SHADER_FRAGMENT_MASK_SPEC_VERSION, + VK_AMD_SHADER_FRAGMENT_MASK_EXTENSION_NAME, + VK_AMD_SHADER_FRAGMENT_MASK_SPEC_VERSION, }, { VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_EXTENSION_NAME, VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_SPEC_VERSION, }, { - VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME, VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION, + VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME, + VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION, }, { - VK_AMD_TEXTURE_GATHER_BIAS_LOD_EXTENSION_NAME, VK_AMD_TEXTURE_GATHER_BIAS_LOD_SPEC_VERSION, + VK_AMD_TEXTURE_GATHER_BIAS_LOD_EXTENSION_NAME, + VK_AMD_TEXTURE_GATHER_BIAS_LOD_SPEC_VERSION, }, #ifdef VK_ANDROID_external_memory_android_hardware_buffer { @@ -882,18 +895,22 @@ static const VkExtensionProperties supportedExtensions[] = { }, #endif { - VK_EXT_4444_FORMATS_EXTENSION_NAME, VK_EXT_4444_FORMATS_SPEC_VERSION, + VK_EXT_4444_FORMATS_EXTENSION_NAME, + VK_EXT_4444_FORMATS_SPEC_VERSION, }, { - VK_EXT_ACQUIRE_DRM_DISPLAY_EXTENSION_NAME, VK_EXT_ACQUIRE_DRM_DISPLAY_SPEC_VERSION, + VK_EXT_ACQUIRE_DRM_DISPLAY_EXTENSION_NAME, + VK_EXT_ACQUIRE_DRM_DISPLAY_SPEC_VERSION, }, #ifdef VK_EXT_acquire_xlib_display { - VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME, VK_EXT_ACQUIRE_XLIB_DISPLAY_SPEC_VERSION, + VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME, + VK_EXT_ACQUIRE_XLIB_DISPLAY_SPEC_VERSION, }, #endif { - VK_EXT_ASTC_DECODE_MODE_EXTENSION_NAME, VK_EXT_ASTC_DECODE_MODE_SPEC_VERSION, + VK_EXT_ASTC_DECODE_MODE_EXTENSION_NAME, + VK_EXT_ASTC_DECODE_MODE_SPEC_VERSION, }, { VK_EXT_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_EXTENSION_NAME, @@ -904,137 +921,179 @@ static const VkExtensionProperties supportedExtensions[] = { VK_EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_SPEC_VERSION, }, { - VK_EXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME, VK_EXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION, + VK_EXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME, + VK_EXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION, }, { - VK_EXT_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME, VK_EXT_BUFFER_DEVICE_ADDRESS_SPEC_VERSION, + VK_EXT_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME, + VK_EXT_BUFFER_DEVICE_ADDRESS_SPEC_VERSION, }, { - VK_EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME, VK_EXT_CALIBRATED_TIMESTAMPS_SPEC_VERSION, + VK_EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME, + VK_EXT_CALIBRATED_TIMESTAMPS_SPEC_VERSION, }, { - VK_EXT_COLOR_WRITE_ENABLE_EXTENSION_NAME, VK_EXT_COLOR_WRITE_ENABLE_SPEC_VERSION, + VK_EXT_COLOR_WRITE_ENABLE_EXTENSION_NAME, + VK_EXT_COLOR_WRITE_ENABLE_SPEC_VERSION, }, { - VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME, VK_EXT_CONDITIONAL_RENDERING_SPEC_VERSION, + VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME, + VK_EXT_CONDITIONAL_RENDERING_SPEC_VERSION, }, { VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME, VK_EXT_CONSERVATIVE_RASTERIZATION_SPEC_VERSION, }, { - VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME, VK_EXT_CUSTOM_BORDER_COLOR_SPEC_VERSION, + VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME, + VK_EXT_CUSTOM_BORDER_COLOR_SPEC_VERSION, }, { - VK_EXT_DEBUG_MARKER_EXTENSION_NAME, VK_EXT_DEBUG_MARKER_SPEC_VERSION, + VK_EXT_DEBUG_MARKER_EXTENSION_NAME, + VK_EXT_DEBUG_MARKER_SPEC_VERSION, }, { - VK_EXT_DEBUG_REPORT_EXTENSION_NAME, VK_EXT_DEBUG_REPORT_SPEC_VERSION, + VK_EXT_DEBUG_REPORT_EXTENSION_NAME, + VK_EXT_DEBUG_REPORT_SPEC_VERSION, }, { - VK_EXT_DEBUG_UTILS_EXTENSION_NAME, VK_EXT_DEBUG_UTILS_SPEC_VERSION, + VK_EXT_DEBUG_UTILS_EXTENSION_NAME, + VK_EXT_DEBUG_UTILS_SPEC_VERSION, }, { - VK_EXT_DEPTH_CLAMP_ZERO_ONE_EXTENSION_NAME, VK_EXT_DEPTH_CLAMP_ZERO_ONE_SPEC_VERSION, + VK_EXT_DEPTH_CLAMP_ZERO_ONE_EXTENSION_NAME, + VK_EXT_DEPTH_CLAMP_ZERO_ONE_SPEC_VERSION, }, { - VK_EXT_DEPTH_CLIP_CONTROL_EXTENSION_NAME, VK_EXT_DEPTH_CLIP_CONTROL_SPEC_VERSION, + VK_EXT_DEPTH_CLIP_CONTROL_EXTENSION_NAME, + VK_EXT_DEPTH_CLIP_CONTROL_SPEC_VERSION, }, { - VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME, VK_EXT_DEPTH_CLIP_ENABLE_SPEC_VERSION, + VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME, + VK_EXT_DEPTH_CLIP_ENABLE_SPEC_VERSION, }, { - VK_EXT_DEPTH_RANGE_UNRESTRICTED_EXTENSION_NAME, VK_EXT_DEPTH_RANGE_UNRESTRICTED_SPEC_VERSION, + VK_EXT_DEPTH_RANGE_UNRESTRICTED_EXTENSION_NAME, + VK_EXT_DEPTH_RANGE_UNRESTRICTED_SPEC_VERSION, }, { - VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME, VK_EXT_DESCRIPTOR_INDEXING_SPEC_VERSION, + VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME, + VK_EXT_DESCRIPTOR_INDEXING_SPEC_VERSION, }, { - VK_EXT_DIRECT_MODE_DISPLAY_EXTENSION_NAME, VK_EXT_DIRECT_MODE_DISPLAY_SPEC_VERSION, + VK_EXT_DIRECT_MODE_DISPLAY_EXTENSION_NAME, + VK_EXT_DIRECT_MODE_DISPLAY_SPEC_VERSION, }, { - VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME, VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION, + VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME, + VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION, }, { - VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME, VK_EXT_DISPLAY_CONTROL_SPEC_VERSION, + VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME, + VK_EXT_DISPLAY_CONTROL_SPEC_VERSION, }, { - VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME, VK_EXT_DISPLAY_SURFACE_COUNTER_SPEC_VERSION, + VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME, + VK_EXT_DISPLAY_SURFACE_COUNTER_SPEC_VERSION, }, { - VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME, VK_EXT_EXTENDED_DYNAMIC_STATE_SPEC_VERSION, + VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME, + VK_EXT_EXTENDED_DYNAMIC_STATE_SPEC_VERSION, }, { - VK_EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME, VK_EXT_EXTENDED_DYNAMIC_STATE_2_SPEC_VERSION, + VK_EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME, + VK_EXT_EXTENDED_DYNAMIC_STATE_2_SPEC_VERSION, }, { - VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME, VK_EXT_EXTERNAL_MEMORY_DMA_BUF_SPEC_VERSION, + VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME, + VK_EXT_EXTERNAL_MEMORY_DMA_BUF_SPEC_VERSION, }, { - VK_EXT_FILTER_CUBIC_EXTENSION_NAME, VK_EXT_FILTER_CUBIC_SPEC_VERSION, + VK_EXT_FILTER_CUBIC_EXTENSION_NAME, + VK_EXT_FILTER_CUBIC_SPEC_VERSION, }, { - VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME, VK_EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION, + VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME, + VK_EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION, }, { - VK_EXT_FRAGMENT_DENSITY_MAP_2_EXTENSION_NAME, VK_EXT_FRAGMENT_DENSITY_MAP_2_SPEC_VERSION, + VK_EXT_FRAGMENT_DENSITY_MAP_2_EXTENSION_NAME, + VK_EXT_FRAGMENT_DENSITY_MAP_2_SPEC_VERSION, }, { - VK_EXT_FRAGMENT_SHADER_INTERLOCK_EXTENSION_NAME, VK_EXT_FRAGMENT_SHADER_INTERLOCK_SPEC_VERSION, + VK_EXT_FRAGMENT_SHADER_INTERLOCK_EXTENSION_NAME, + VK_EXT_FRAGMENT_SHADER_INTERLOCK_SPEC_VERSION, }, #ifdef VK_EXT_full_screen_exclusive { - VK_EXT_FULL_SCREEN_EXCLUSIVE_EXTENSION_NAME, VK_EXT_FULL_SCREEN_EXCLUSIVE_SPEC_VERSION, + VK_EXT_FULL_SCREEN_EXCLUSIVE_EXTENSION_NAME, + VK_EXT_FULL_SCREEN_EXCLUSIVE_SPEC_VERSION, }, #endif { - VK_EXT_GLOBAL_PRIORITY_EXTENSION_NAME, VK_EXT_GLOBAL_PRIORITY_SPEC_VERSION, + VK_EXT_GLOBAL_PRIORITY_EXTENSION_NAME, + VK_EXT_GLOBAL_PRIORITY_SPEC_VERSION, }, { - VK_EXT_GLOBAL_PRIORITY_QUERY_EXTENSION_NAME, VK_EXT_GLOBAL_PRIORITY_QUERY_SPEC_VERSION, + VK_EXT_GLOBAL_PRIORITY_QUERY_EXTENSION_NAME, + VK_EXT_GLOBAL_PRIORITY_QUERY_SPEC_VERSION, }, { - VK_EXT_GRAPHICS_PIPELINE_LIBRARY_EXTENSION_NAME, VK_EXT_GRAPHICS_PIPELINE_LIBRARY_SPEC_VERSION, + VK_EXT_GRAPHICS_PIPELINE_LIBRARY_EXTENSION_NAME, + VK_EXT_GRAPHICS_PIPELINE_LIBRARY_SPEC_VERSION, }, { - VK_EXT_HDR_METADATA_EXTENSION_NAME, VK_EXT_HDR_METADATA_SPEC_VERSION, + VK_EXT_HDR_METADATA_EXTENSION_NAME, + VK_EXT_HDR_METADATA_SPEC_VERSION, }, { - VK_EXT_HEADLESS_SURFACE_EXTENSION_NAME, VK_EXT_HEADLESS_SURFACE_SPEC_VERSION, + VK_EXT_HEADLESS_SURFACE_EXTENSION_NAME, + VK_EXT_HEADLESS_SURFACE_SPEC_VERSION, }, { - VK_EXT_HOST_QUERY_RESET_EXTENSION_NAME, VK_EXT_HOST_QUERY_RESET_SPEC_VERSION, + VK_EXT_HOST_QUERY_RESET_EXTENSION_NAME, + VK_EXT_HOST_QUERY_RESET_SPEC_VERSION, }, { - VK_EXT_IMAGE_2D_VIEW_OF_3D_EXTENSION_NAME, VK_EXT_IMAGE_2D_VIEW_OF_3D_SPEC_VERSION, + VK_EXT_IMAGE_2D_VIEW_OF_3D_EXTENSION_NAME, + VK_EXT_IMAGE_2D_VIEW_OF_3D_SPEC_VERSION, }, { - VK_EXT_IMAGE_ROBUSTNESS_EXTENSION_NAME, VK_EXT_IMAGE_ROBUSTNESS_SPEC_VERSION, + VK_EXT_IMAGE_ROBUSTNESS_EXTENSION_NAME, + VK_EXT_IMAGE_ROBUSTNESS_SPEC_VERSION, }, { - VK_EXT_IMAGE_VIEW_MIN_LOD_EXTENSION_NAME, VK_EXT_IMAGE_VIEW_MIN_LOD_SPEC_VERSION, + VK_EXT_IMAGE_VIEW_MIN_LOD_EXTENSION_NAME, + VK_EXT_IMAGE_VIEW_MIN_LOD_SPEC_VERSION, }, { - VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME, VK_EXT_INDEX_TYPE_UINT8_SPEC_VERSION, + VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME, + VK_EXT_INDEX_TYPE_UINT8_SPEC_VERSION, }, { - VK_EXT_INLINE_UNIFORM_BLOCK_EXTENSION_NAME, VK_EXT_INLINE_UNIFORM_BLOCK_SPEC_VERSION, + VK_EXT_INLINE_UNIFORM_BLOCK_EXTENSION_NAME, + VK_EXT_INLINE_UNIFORM_BLOCK_SPEC_VERSION, }, { - VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME, VK_EXT_LINE_RASTERIZATION_SPEC_VERSION, + VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME, + VK_EXT_LINE_RASTERIZATION_SPEC_VERSION, }, { - VK_EXT_LOAD_STORE_OP_NONE_EXTENSION_NAME, VK_EXT_LOAD_STORE_OP_NONE_SPEC_VERSION, + VK_EXT_LOAD_STORE_OP_NONE_EXTENSION_NAME, + VK_EXT_LOAD_STORE_OP_NONE_SPEC_VERSION, }, { - VK_EXT_MEMORY_BUDGET_EXTENSION_NAME, VK_EXT_MEMORY_BUDGET_SPEC_VERSION, + VK_EXT_MEMORY_BUDGET_EXTENSION_NAME, + VK_EXT_MEMORY_BUDGET_SPEC_VERSION, }, { - VK_EXT_MEMORY_PRIORITY_EXTENSION_NAME, VK_EXT_MEMORY_PRIORITY_SPEC_VERSION, + VK_EXT_MEMORY_PRIORITY_EXTENSION_NAME, + VK_EXT_MEMORY_PRIORITY_SPEC_VERSION, }, #ifdef VK_EXT_metal_surface { - VK_EXT_METAL_SURFACE_EXTENSION_NAME, VK_EXT_METAL_SURFACE_SPEC_VERSION, + VK_EXT_METAL_SURFACE_EXTENSION_NAME, + VK_EXT_METAL_SURFACE_SPEC_VERSION, }, #endif { @@ -1042,17 +1101,20 @@ static const VkExtensionProperties supportedExtensions[] = { VK_EXT_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_SPEC_VERSION, }, { - VK_EXT_MUTABLE_DESCRIPTOR_TYPE_EXTENSION_NAME, VK_EXT_MUTABLE_DESCRIPTOR_TYPE_SPEC_VERSION, + VK_EXT_MUTABLE_DESCRIPTOR_TYPE_EXTENSION_NAME, + VK_EXT_MUTABLE_DESCRIPTOR_TYPE_SPEC_VERSION, }, { - VK_EXT_NON_SEAMLESS_CUBE_MAP_EXTENSION_NAME, VK_EXT_NON_SEAMLESS_CUBE_MAP_SPEC_VERSION, + VK_EXT_NON_SEAMLESS_CUBE_MAP_EXTENSION_NAME, + VK_EXT_NON_SEAMLESS_CUBE_MAP_SPEC_VERSION, }, { VK_EXT_PAGEABLE_DEVICE_LOCAL_MEMORY_EXTENSION_NAME, VK_EXT_PAGEABLE_DEVICE_LOCAL_MEMORY_SPEC_VERSION, }, { - VK_EXT_PCI_BUS_INFO_EXTENSION_NAME, VK_EXT_PCI_BUS_INFO_SPEC_VERSION, + VK_EXT_PCI_BUS_INFO_EXTENSION_NAME, + VK_EXT_PCI_BUS_INFO_SPEC_VERSION, }, { VK_EXT_PIPELINE_CREATION_CACHE_CONTROL_EXTENSION_NAME, @@ -1063,7 +1125,8 @@ static const VkExtensionProperties supportedExtensions[] = { VK_EXT_PIPELINE_CREATION_FEEDBACK_SPEC_VERSION, }, { - VK_EXT_POST_DEPTH_COVERAGE_EXTENSION_NAME, VK_EXT_POST_DEPTH_COVERAGE_SPEC_VERSION, + VK_EXT_POST_DEPTH_COVERAGE_EXTENSION_NAME, + VK_EXT_POST_DEPTH_COVERAGE_SPEC_VERSION, }, { VK_EXT_PRIMITIVE_TOPOLOGY_LIST_RESTART_EXTENSION_NAME, @@ -1074,254 +1137,320 @@ static const VkExtensionProperties supportedExtensions[] = { VK_EXT_PRIMITIVES_GENERATED_QUERY_SPEC_VERSION, }, { - VK_EXT_PRIVATE_DATA_EXTENSION_NAME, VK_EXT_PRIVATE_DATA_SPEC_VERSION, + VK_EXT_PRIVATE_DATA_EXTENSION_NAME, + VK_EXT_PRIVATE_DATA_SPEC_VERSION, }, { - VK_EXT_PROVOKING_VERTEX_EXTENSION_NAME, VK_EXT_PROVOKING_VERTEX_SPEC_VERSION, + VK_EXT_PROVOKING_VERTEX_EXTENSION_NAME, + VK_EXT_PROVOKING_VERTEX_SPEC_VERSION, }, { - VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME, VK_EXT_QUEUE_FAMILY_FOREIGN_SPEC_VERSION, + VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME, + VK_EXT_QUEUE_FAMILY_FOREIGN_SPEC_VERSION, }, { VK_EXT_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_EXTENSION_NAME, VK_EXT_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_SPEC_VERSION, }, { - VK_EXT_RGBA10X6_FORMATS_EXTENSION_NAME, VK_EXT_RGBA10X6_FORMATS_SPEC_VERSION, + VK_EXT_RGBA10X6_FORMATS_EXTENSION_NAME, + VK_EXT_RGBA10X6_FORMATS_SPEC_VERSION, }, { - VK_EXT_ROBUSTNESS_2_EXTENSION_NAME, VK_EXT_ROBUSTNESS_2_SPEC_VERSION, + VK_EXT_ROBUSTNESS_2_EXTENSION_NAME, + VK_EXT_ROBUSTNESS_2_SPEC_VERSION, }, { - VK_EXT_SAMPLE_LOCATIONS_EXTENSION_NAME, VK_EXT_SAMPLE_LOCATIONS_SPEC_VERSION, + VK_EXT_SAMPLE_LOCATIONS_EXTENSION_NAME, + VK_EXT_SAMPLE_LOCATIONS_SPEC_VERSION, }, { - VK_EXT_SAMPLER_FILTER_MINMAX_EXTENSION_NAME, VK_EXT_SAMPLER_FILTER_MINMAX_SPEC_VERSION, + VK_EXT_SAMPLER_FILTER_MINMAX_EXTENSION_NAME, + VK_EXT_SAMPLER_FILTER_MINMAX_SPEC_VERSION, }, { - VK_EXT_SCALAR_BLOCK_LAYOUT_EXTENSION_NAME, VK_EXT_SCALAR_BLOCK_LAYOUT_SPEC_VERSION, + VK_EXT_SCALAR_BLOCK_LAYOUT_EXTENSION_NAME, + VK_EXT_SCALAR_BLOCK_LAYOUT_SPEC_VERSION, }, { - VK_EXT_SEPARATE_STENCIL_USAGE_EXTENSION_NAME, VK_EXT_SEPARATE_STENCIL_USAGE_SPEC_VERSION, + VK_EXT_SEPARATE_STENCIL_USAGE_EXTENSION_NAME, + VK_EXT_SEPARATE_STENCIL_USAGE_SPEC_VERSION, }, { - VK_EXT_SHADER_ATOMIC_FLOAT_EXTENSION_NAME, VK_EXT_SHADER_ATOMIC_FLOAT_SPEC_VERSION, + VK_EXT_SHADER_ATOMIC_FLOAT_EXTENSION_NAME, + VK_EXT_SHADER_ATOMIC_FLOAT_SPEC_VERSION, }, { - VK_EXT_SHADER_ATOMIC_FLOAT_2_EXTENSION_NAME, VK_EXT_SHADER_ATOMIC_FLOAT_2_SPEC_VERSION, + VK_EXT_SHADER_ATOMIC_FLOAT_2_EXTENSION_NAME, + VK_EXT_SHADER_ATOMIC_FLOAT_2_SPEC_VERSION, }, { VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_EXTENSION_NAME, VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_SPEC_VERSION, }, { - VK_EXT_SHADER_IMAGE_ATOMIC_INT64_EXTENSION_NAME, VK_EXT_SHADER_IMAGE_ATOMIC_INT64_SPEC_VERSION, + VK_EXT_SHADER_IMAGE_ATOMIC_INT64_EXTENSION_NAME, + VK_EXT_SHADER_IMAGE_ATOMIC_INT64_SPEC_VERSION, }, { - VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME, VK_EXT_SHADER_STENCIL_EXPORT_SPEC_VERSION, + VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME, + VK_EXT_SHADER_STENCIL_EXPORT_SPEC_VERSION, }, { - VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME, VK_EXT_SHADER_SUBGROUP_BALLOT_SPEC_VERSION, + VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME, + VK_EXT_SHADER_SUBGROUP_BALLOT_SPEC_VERSION, }, { - VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME, VK_EXT_SHADER_SUBGROUP_VOTE_SPEC_VERSION, + VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME, + VK_EXT_SHADER_SUBGROUP_VOTE_SPEC_VERSION, }, { VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME, VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_SPEC_VERSION, }, { - VK_EXT_SUBGROUP_SIZE_CONTROL_EXTENSION_NAME, VK_EXT_SUBGROUP_SIZE_CONTROL_SPEC_VERSION, + VK_EXT_SUBGROUP_SIZE_CONTROL_EXTENSION_NAME, + VK_EXT_SUBGROUP_SIZE_CONTROL_SPEC_VERSION, }, { - VK_EXT_SURFACE_MAINTENANCE_1_EXTENSION_NAME, VK_EXT_SURFACE_MAINTENANCE_1_SPEC_VERSION, + VK_EXT_SURFACE_MAINTENANCE_1_EXTENSION_NAME, + VK_EXT_SURFACE_MAINTENANCE_1_SPEC_VERSION, }, { - VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME, VK_EXT_SWAPCHAIN_COLOR_SPACE_SPEC_VERSION, + VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME, + VK_EXT_SWAPCHAIN_COLOR_SPACE_SPEC_VERSION, }, { - VK_EXT_SWAPCHAIN_MAINTENANCE_1_EXTENSION_NAME, VK_EXT_SWAPCHAIN_MAINTENANCE_1_SPEC_VERSION, + VK_EXT_SWAPCHAIN_MAINTENANCE_1_EXTENSION_NAME, + VK_EXT_SWAPCHAIN_MAINTENANCE_1_SPEC_VERSION, }, { - VK_EXT_TEXEL_BUFFER_ALIGNMENT_EXTENSION_NAME, VK_EXT_TEXEL_BUFFER_ALIGNMENT_SPEC_VERSION, + VK_EXT_TEXEL_BUFFER_ALIGNMENT_EXTENSION_NAME, + VK_EXT_TEXEL_BUFFER_ALIGNMENT_SPEC_VERSION, }, { - VK_EXT_TOOLING_INFO_EXTENSION_NAME, VK_EXT_TOOLING_INFO_SPEC_VERSION, + VK_EXT_TOOLING_INFO_EXTENSION_NAME, + VK_EXT_TOOLING_INFO_SPEC_VERSION, }, { - VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME, VK_EXT_TRANSFORM_FEEDBACK_SPEC_VERSION, + VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME, + VK_EXT_TRANSFORM_FEEDBACK_SPEC_VERSION, }, { - VK_EXT_VALIDATION_CACHE_EXTENSION_NAME, VK_EXT_VALIDATION_CACHE_SPEC_VERSION, + VK_EXT_VALIDATION_CACHE_EXTENSION_NAME, + VK_EXT_VALIDATION_CACHE_SPEC_VERSION, }, { - VK_EXT_VALIDATION_FEATURES_EXTENSION_NAME, VK_EXT_VALIDATION_FEATURES_SPEC_VERSION, + VK_EXT_VALIDATION_FEATURES_EXTENSION_NAME, + VK_EXT_VALIDATION_FEATURES_SPEC_VERSION, }, { - VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME, VK_EXT_VALIDATION_FLAGS_SPEC_VERSION, + VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME, + VK_EXT_VALIDATION_FLAGS_SPEC_VERSION, }, { - VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME, VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION, + VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME, + VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION, }, { VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME, VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_SPEC_VERSION, }, { - VK_EXT_YCBCR_2PLANE_444_FORMATS_EXTENSION_NAME, VK_EXT_YCBCR_2PLANE_444_FORMATS_SPEC_VERSION, + VK_EXT_YCBCR_2PLANE_444_FORMATS_EXTENSION_NAME, + VK_EXT_YCBCR_2PLANE_444_FORMATS_SPEC_VERSION, }, { - VK_EXT_YCBCR_IMAGE_ARRAYS_EXTENSION_NAME, VK_EXT_YCBCR_IMAGE_ARRAYS_SPEC_VERSION, + VK_EXT_YCBCR_IMAGE_ARRAYS_EXTENSION_NAME, + VK_EXT_YCBCR_IMAGE_ARRAYS_SPEC_VERSION, }, #ifdef VK_GGP_frame_token { - VK_GGP_FRAME_TOKEN_EXTENSION_NAME, VK_GGP_FRAME_TOKEN_SPEC_VERSION, + VK_GGP_FRAME_TOKEN_EXTENSION_NAME, + VK_GGP_FRAME_TOKEN_SPEC_VERSION, }, #endif #ifdef VK_GGP_stream_descriptor_surface { - VK_GGP_STREAM_DESCRIPTOR_SURFACE_EXTENSION_NAME, VK_GGP_STREAM_DESCRIPTOR_SURFACE_SPEC_VERSION, + VK_GGP_STREAM_DESCRIPTOR_SURFACE_EXTENSION_NAME, + VK_GGP_STREAM_DESCRIPTOR_SURFACE_SPEC_VERSION, }, #endif { - VK_GOOGLE_DECORATE_STRING_EXTENSION_NAME, VK_GOOGLE_DECORATE_STRING_SPEC_VERSION, + VK_GOOGLE_DECORATE_STRING_EXTENSION_NAME, + VK_GOOGLE_DECORATE_STRING_SPEC_VERSION, }, { - VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME, VK_GOOGLE_DISPLAY_TIMING_SPEC_VERSION, + VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME, + VK_GOOGLE_DISPLAY_TIMING_SPEC_VERSION, }, { - VK_GOOGLE_HLSL_FUNCTIONALITY_1_EXTENSION_NAME, VK_GOOGLE_HLSL_FUNCTIONALITY_1_SPEC_VERSION, + VK_GOOGLE_HLSL_FUNCTIONALITY_1_EXTENSION_NAME, + VK_GOOGLE_HLSL_FUNCTIONALITY_1_SPEC_VERSION, }, { - VK_GOOGLE_SURFACELESS_QUERY_EXTENSION_NAME, VK_GOOGLE_SURFACELESS_QUERY_SPEC_VERSION, + VK_GOOGLE_SURFACELESS_QUERY_EXTENSION_NAME, + VK_GOOGLE_SURFACELESS_QUERY_SPEC_VERSION, }, { - VK_GOOGLE_USER_TYPE_EXTENSION_NAME, VK_GOOGLE_USER_TYPE_SPEC_VERSION, + VK_GOOGLE_USER_TYPE_EXTENSION_NAME, + VK_GOOGLE_USER_TYPE_SPEC_VERSION, }, { - VK_IMG_FILTER_CUBIC_EXTENSION_NAME, VK_IMG_FILTER_CUBIC_SPEC_VERSION, + VK_IMG_FILTER_CUBIC_EXTENSION_NAME, + VK_IMG_FILTER_CUBIC_SPEC_VERSION, }, { - VK_IMG_FORMAT_PVRTC_EXTENSION_NAME, VK_IMG_FORMAT_PVRTC_SPEC_VERSION, + VK_IMG_FORMAT_PVRTC_EXTENSION_NAME, + VK_IMG_FORMAT_PVRTC_SPEC_VERSION, }, { - VK_KHR_16BIT_STORAGE_EXTENSION_NAME, VK_KHR_16BIT_STORAGE_SPEC_VERSION, + VK_KHR_16BIT_STORAGE_EXTENSION_NAME, + VK_KHR_16BIT_STORAGE_SPEC_VERSION, }, { - VK_KHR_8BIT_STORAGE_EXTENSION_NAME, VK_KHR_8BIT_STORAGE_SPEC_VERSION, + VK_KHR_8BIT_STORAGE_EXTENSION_NAME, + VK_KHR_8BIT_STORAGE_SPEC_VERSION, }, #ifdef VK_KHR_android_surface { - VK_KHR_ANDROID_SURFACE_EXTENSION_NAME, VK_KHR_ANDROID_SURFACE_SPEC_VERSION, + VK_KHR_ANDROID_SURFACE_EXTENSION_NAME, + VK_KHR_ANDROID_SURFACE_SPEC_VERSION, }, #endif { - VK_KHR_BIND_MEMORY_2_EXTENSION_NAME, VK_KHR_BIND_MEMORY_2_SPEC_VERSION, + VK_KHR_BIND_MEMORY_2_EXTENSION_NAME, + VK_KHR_BIND_MEMORY_2_SPEC_VERSION, }, { - VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME, VK_KHR_BUFFER_DEVICE_ADDRESS_SPEC_VERSION, + VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME, + VK_KHR_BUFFER_DEVICE_ADDRESS_SPEC_VERSION, }, { - VK_KHR_COPY_COMMANDS_2_EXTENSION_NAME, VK_KHR_COPY_COMMANDS_2_SPEC_VERSION, + VK_KHR_COPY_COMMANDS_2_EXTENSION_NAME, + VK_KHR_COPY_COMMANDS_2_SPEC_VERSION, }, { - VK_KHR_CREATE_RENDERPASS_2_EXTENSION_NAME, VK_KHR_CREATE_RENDERPASS_2_SPEC_VERSION, + VK_KHR_CREATE_RENDERPASS_2_EXTENSION_NAME, + VK_KHR_CREATE_RENDERPASS_2_SPEC_VERSION, }, { - VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME, VK_KHR_DEDICATED_ALLOCATION_SPEC_VERSION, + VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME, + VK_KHR_DEDICATED_ALLOCATION_SPEC_VERSION, }, { - VK_KHR_DEPTH_STENCIL_RESOLVE_EXTENSION_NAME, VK_KHR_DEPTH_STENCIL_RESOLVE_SPEC_VERSION, + VK_KHR_DEPTH_STENCIL_RESOLVE_EXTENSION_NAME, + VK_KHR_DEPTH_STENCIL_RESOLVE_SPEC_VERSION, }, { VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME, VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_SPEC_VERSION, }, { - VK_KHR_DEVICE_GROUP_EXTENSION_NAME, VK_KHR_DEVICE_GROUP_SPEC_VERSION, + VK_KHR_DEVICE_GROUP_EXTENSION_NAME, + VK_KHR_DEVICE_GROUP_SPEC_VERSION, }, { - VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME, VK_KHR_DEVICE_GROUP_CREATION_SPEC_VERSION, + VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME, + VK_KHR_DEVICE_GROUP_CREATION_SPEC_VERSION, }, #ifdef VK_KHR_display { - VK_KHR_DISPLAY_EXTENSION_NAME, VK_KHR_DISPLAY_SPEC_VERSION, + VK_KHR_DISPLAY_EXTENSION_NAME, + VK_KHR_DISPLAY_SPEC_VERSION, }, #endif #ifdef VK_KHR_display_swapchain { - VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME, VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION, + VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME, + VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION, }, #endif { - VK_KHR_DRAW_INDIRECT_COUNT_EXTENSION_NAME, VK_KHR_DRAW_INDIRECT_COUNT_SPEC_VERSION, + VK_KHR_DRAW_INDIRECT_COUNT_EXTENSION_NAME, + VK_KHR_DRAW_INDIRECT_COUNT_SPEC_VERSION, }, { - VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME, VK_KHR_DRIVER_PROPERTIES_SPEC_VERSION, + VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME, + VK_KHR_DRIVER_PROPERTIES_SPEC_VERSION, }, { - VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME, VK_KHR_DYNAMIC_RENDERING_SPEC_VERSION, + VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME, + VK_KHR_DYNAMIC_RENDERING_SPEC_VERSION, }, { - VK_KHR_EXTERNAL_FENCE_EXTENSION_NAME, VK_KHR_EXTERNAL_FENCE_SPEC_VERSION, + VK_KHR_EXTERNAL_FENCE_EXTENSION_NAME, + VK_KHR_EXTERNAL_FENCE_SPEC_VERSION, }, { VK_KHR_EXTERNAL_FENCE_CAPABILITIES_EXTENSION_NAME, VK_KHR_EXTERNAL_FENCE_CAPABILITIES_SPEC_VERSION, }, { - VK_KHR_EXTERNAL_FENCE_FD_EXTENSION_NAME, VK_KHR_EXTERNAL_FENCE_FD_SPEC_VERSION, + VK_KHR_EXTERNAL_FENCE_FD_EXTENSION_NAME, + VK_KHR_EXTERNAL_FENCE_FD_SPEC_VERSION, }, #ifdef VK_KHR_external_fence_win32 { - VK_KHR_EXTERNAL_FENCE_WIN32_EXTENSION_NAME, VK_KHR_EXTERNAL_FENCE_WIN32_SPEC_VERSION, + VK_KHR_EXTERNAL_FENCE_WIN32_EXTENSION_NAME, + VK_KHR_EXTERNAL_FENCE_WIN32_SPEC_VERSION, }, #endif { - VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME, VK_KHR_EXTERNAL_MEMORY_SPEC_VERSION, + VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME, + VK_KHR_EXTERNAL_MEMORY_SPEC_VERSION, }, { VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME, VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION, }, { - VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME, VK_KHR_EXTERNAL_MEMORY_FD_SPEC_VERSION, + VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME, + VK_KHR_EXTERNAL_MEMORY_FD_SPEC_VERSION, }, #ifdef VK_KHR_external_memory_win32 { - VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME, VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION, + VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME, + VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION, }, #endif { - VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME, VK_KHR_EXTERNAL_SEMAPHORE_SPEC_VERSION, + VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME, + VK_KHR_EXTERNAL_SEMAPHORE_SPEC_VERSION, }, { VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME, VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_SPEC_VERSION, }, { - VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME, VK_KHR_EXTERNAL_SEMAPHORE_FD_SPEC_VERSION, + VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME, + VK_KHR_EXTERNAL_SEMAPHORE_FD_SPEC_VERSION, }, #ifdef VK_KHR_external_semaphore_win32 { - VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME, VK_KHR_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION, + VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME, + VK_KHR_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION, }, #endif { - VK_KHR_FORMAT_FEATURE_FLAGS_2_EXTENSION_NAME, VK_KHR_FORMAT_FEATURE_FLAGS_2_SPEC_VERSION, + VK_KHR_FORMAT_FEATURE_FLAGS_2_EXTENSION_NAME, + VK_KHR_FORMAT_FEATURE_FLAGS_2_SPEC_VERSION, }, { VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME, VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_SPEC_VERSION, }, { - VK_KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME, VK_KHR_FRAGMENT_SHADING_RATE_SPEC_VERSION, + VK_KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME, + VK_KHR_FRAGMENT_SHADING_RATE_SPEC_VERSION, }, { - VK_KHR_GET_DISPLAY_PROPERTIES_2_EXTENSION_NAME, VK_KHR_GET_DISPLAY_PROPERTIES_2_SPEC_VERSION, + VK_KHR_GET_DISPLAY_PROPERTIES_2_EXTENSION_NAME, + VK_KHR_GET_DISPLAY_PROPERTIES_2_SPEC_VERSION, }, { - VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME, VK_KHR_GET_MEMORY_REQUIREMENTS_2_SPEC_VERSION, + VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME, + VK_KHR_GET_MEMORY_REQUIREMENTS_2_SPEC_VERSION, }, { VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, @@ -1332,86 +1461,108 @@ static const VkExtensionProperties supportedExtensions[] = { VK_KHR_GET_SURFACE_CAPABILITIES_2_SPEC_VERSION, }, { - VK_KHR_GLOBAL_PRIORITY_EXTENSION_NAME, VK_KHR_GLOBAL_PRIORITY_SPEC_VERSION, + VK_KHR_GLOBAL_PRIORITY_EXTENSION_NAME, + VK_KHR_GLOBAL_PRIORITY_SPEC_VERSION, }, { - VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME, VK_KHR_IMAGE_FORMAT_LIST_SPEC_VERSION, + VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME, + VK_KHR_IMAGE_FORMAT_LIST_SPEC_VERSION, }, { - VK_KHR_IMAGELESS_FRAMEBUFFER_EXTENSION_NAME, VK_KHR_IMAGELESS_FRAMEBUFFER_SPEC_VERSION, + VK_KHR_IMAGELESS_FRAMEBUFFER_EXTENSION_NAME, + VK_KHR_IMAGELESS_FRAMEBUFFER_SPEC_VERSION, }, { - VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME, VK_KHR_INCREMENTAL_PRESENT_SPEC_VERSION, + VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME, + VK_KHR_INCREMENTAL_PRESENT_SPEC_VERSION, }, { - VK_KHR_MAINTENANCE_1_EXTENSION_NAME, VK_KHR_MAINTENANCE_1_SPEC_VERSION, + VK_KHR_MAINTENANCE_1_EXTENSION_NAME, + VK_KHR_MAINTENANCE_1_SPEC_VERSION, }, { - VK_KHR_MAINTENANCE_2_EXTENSION_NAME, VK_KHR_MAINTENANCE_2_SPEC_VERSION, + VK_KHR_MAINTENANCE_2_EXTENSION_NAME, + VK_KHR_MAINTENANCE_2_SPEC_VERSION, }, { - VK_KHR_MAINTENANCE_3_EXTENSION_NAME, VK_KHR_MAINTENANCE_3_SPEC_VERSION, + VK_KHR_MAINTENANCE_3_EXTENSION_NAME, + VK_KHR_MAINTENANCE_3_SPEC_VERSION, }, { - VK_KHR_MAINTENANCE_4_EXTENSION_NAME, VK_KHR_MAINTENANCE_4_SPEC_VERSION, + VK_KHR_MAINTENANCE_4_EXTENSION_NAME, + VK_KHR_MAINTENANCE_4_SPEC_VERSION, }, { - VK_KHR_MULTIVIEW_EXTENSION_NAME, VK_KHR_MULTIVIEW_SPEC_VERSION, + VK_KHR_MULTIVIEW_EXTENSION_NAME, + VK_KHR_MULTIVIEW_SPEC_VERSION, }, { - VK_KHR_PERFORMANCE_QUERY_EXTENSION_NAME, VK_KHR_PERFORMANCE_QUERY_SPEC_VERSION, + VK_KHR_PERFORMANCE_QUERY_EXTENSION_NAME, + VK_KHR_PERFORMANCE_QUERY_SPEC_VERSION, }, { VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_EXTENSION_NAME, VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_SPEC_VERSION, }, { - VK_KHR_PIPELINE_LIBRARY_EXTENSION_NAME, VK_KHR_PIPELINE_LIBRARY_SPEC_VERSION, + VK_KHR_PIPELINE_LIBRARY_EXTENSION_NAME, + VK_KHR_PIPELINE_LIBRARY_SPEC_VERSION, }, { - VK_KHR_PRESENT_ID_EXTENSION_NAME, VK_KHR_PRESENT_ID_SPEC_VERSION, + VK_KHR_PRESENT_ID_EXTENSION_NAME, + VK_KHR_PRESENT_ID_SPEC_VERSION, }, { - VK_KHR_PRESENT_WAIT_EXTENSION_NAME, VK_KHR_PRESENT_WAIT_SPEC_VERSION, + VK_KHR_PRESENT_WAIT_EXTENSION_NAME, + VK_KHR_PRESENT_WAIT_SPEC_VERSION, }, { - VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME, VK_KHR_PUSH_DESCRIPTOR_SPEC_VERSION, + VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME, + VK_KHR_PUSH_DESCRIPTOR_SPEC_VERSION, }, { - VK_KHR_RELAXED_BLOCK_LAYOUT_EXTENSION_NAME, VK_KHR_RELAXED_BLOCK_LAYOUT_SPEC_VERSION, + VK_KHR_RELAXED_BLOCK_LAYOUT_EXTENSION_NAME, + VK_KHR_RELAXED_BLOCK_LAYOUT_SPEC_VERSION, }, { VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME, VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION, }, { - VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME, VK_KHR_SAMPLER_YCBCR_CONVERSION_SPEC_VERSION, + VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME, + VK_KHR_SAMPLER_YCBCR_CONVERSION_SPEC_VERSION, }, { VK_KHR_SEPARATE_DEPTH_STENCIL_LAYOUTS_EXTENSION_NAME, VK_KHR_SEPARATE_DEPTH_STENCIL_LAYOUTS_SPEC_VERSION, }, { - VK_KHR_SHADER_ATOMIC_INT64_EXTENSION_NAME, VK_KHR_SHADER_ATOMIC_INT64_SPEC_VERSION, + VK_KHR_SHADER_ATOMIC_INT64_EXTENSION_NAME, + VK_KHR_SHADER_ATOMIC_INT64_SPEC_VERSION, }, { - VK_KHR_SHADER_CLOCK_EXTENSION_NAME, VK_KHR_SHADER_CLOCK_SPEC_VERSION, + VK_KHR_SHADER_CLOCK_EXTENSION_NAME, + VK_KHR_SHADER_CLOCK_SPEC_VERSION, }, { - VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME, VK_KHR_SHADER_DRAW_PARAMETERS_SPEC_VERSION, + VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME, + VK_KHR_SHADER_DRAW_PARAMETERS_SPEC_VERSION, }, { - VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME, VK_KHR_SHADER_FLOAT16_INT8_SPEC_VERSION, + VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME, + VK_KHR_SHADER_FLOAT16_INT8_SPEC_VERSION, }, { - VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME, VK_KHR_SHADER_FLOAT_CONTROLS_SPEC_VERSION, + VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME, + VK_KHR_SHADER_FLOAT_CONTROLS_SPEC_VERSION, }, { VK_KHR_SHADER_INTEGER_DOT_PRODUCT_EXTENSION_NAME, VK_KHR_SHADER_INTEGER_DOT_PRODUCT_SPEC_VERSION, }, { - VK_KHR_SHADER_NON_SEMANTIC_INFO_EXTENSION_NAME, VK_KHR_SHADER_NON_SEMANTIC_INFO_SPEC_VERSION, + VK_KHR_SHADER_NON_SEMANTIC_INFO_EXTENSION_NAME, + VK_KHR_SHADER_NON_SEMANTIC_INFO_SPEC_VERSION, }, { VK_KHR_SHADER_SUBGROUP_EXTENDED_TYPES_EXTENSION_NAME, @@ -1426,57 +1577,69 @@ static const VkExtensionProperties supportedExtensions[] = { VK_KHR_SHADER_TERMINATE_INVOCATION_SPEC_VERSION, }, { - VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME, VK_KHR_SHARED_PRESENTABLE_IMAGE_SPEC_VERSION, + VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME, + VK_KHR_SHARED_PRESENTABLE_IMAGE_SPEC_VERSION, }, { - VK_KHR_SPIRV_1_4_EXTENSION_NAME, VK_KHR_SPIRV_1_4_SPEC_VERSION, + VK_KHR_SPIRV_1_4_EXTENSION_NAME, + VK_KHR_SPIRV_1_4_SPEC_VERSION, }, { VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_EXTENSION_NAME, VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_SPEC_VERSION, }, { - VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_SURFACE_SPEC_VERSION, + VK_KHR_SURFACE_EXTENSION_NAME, + VK_KHR_SURFACE_SPEC_VERSION, }, { VK_KHR_SURFACE_PROTECTED_CAPABILITIES_EXTENSION_NAME, VK_KHR_SURFACE_PROTECTED_CAPABILITIES_SPEC_VERSION, }, { - VK_KHR_SWAPCHAIN_EXTENSION_NAME, VK_KHR_SWAPCHAIN_SPEC_VERSION, + VK_KHR_SWAPCHAIN_EXTENSION_NAME, + VK_KHR_SWAPCHAIN_SPEC_VERSION, }, { - VK_KHR_SWAPCHAIN_MUTABLE_FORMAT_EXTENSION_NAME, VK_KHR_SWAPCHAIN_MUTABLE_FORMAT_SPEC_VERSION, + VK_KHR_SWAPCHAIN_MUTABLE_FORMAT_EXTENSION_NAME, + VK_KHR_SWAPCHAIN_MUTABLE_FORMAT_SPEC_VERSION, }, { - VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME, VK_KHR_SYNCHRONIZATION_2_SPEC_VERSION, + VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME, + VK_KHR_SYNCHRONIZATION_2_SPEC_VERSION, }, { - VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME, VK_KHR_TIMELINE_SEMAPHORE_SPEC_VERSION, + VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME, + VK_KHR_TIMELINE_SEMAPHORE_SPEC_VERSION, }, { VK_KHR_UNIFORM_BUFFER_STANDARD_LAYOUT_EXTENSION_NAME, VK_KHR_UNIFORM_BUFFER_STANDARD_LAYOUT_SPEC_VERSION, }, { - VK_KHR_VARIABLE_POINTERS_EXTENSION_NAME, VK_KHR_VARIABLE_POINTERS_SPEC_VERSION, + VK_KHR_VARIABLE_POINTERS_EXTENSION_NAME, + VK_KHR_VARIABLE_POINTERS_SPEC_VERSION, }, { - VK_KHR_VULKAN_MEMORY_MODEL_EXTENSION_NAME, VK_KHR_VULKAN_MEMORY_MODEL_SPEC_VERSION, + VK_KHR_VULKAN_MEMORY_MODEL_EXTENSION_NAME, + VK_KHR_VULKAN_MEMORY_MODEL_SPEC_VERSION, }, #ifdef VK_KHR_wayland_surface { - VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, VK_KHR_WAYLAND_SURFACE_SPEC_VERSION, + VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, + VK_KHR_WAYLAND_SURFACE_SPEC_VERSION, }, #endif #ifdef VK_KHR_win32_keyed_mutex { - VK_KHR_WIN32_KEYED_MUTEX_EXTENSION_NAME, VK_KHR_WIN32_KEYED_MUTEX_SPEC_VERSION, + VK_KHR_WIN32_KEYED_MUTEX_EXTENSION_NAME, + VK_KHR_WIN32_KEYED_MUTEX_SPEC_VERSION, }, #endif #ifdef VK_KHR_win32_surface { - VK_KHR_WIN32_SURFACE_EXTENSION_NAME, VK_KHR_WIN32_SURFACE_SPEC_VERSION, + VK_KHR_WIN32_SURFACE_EXTENSION_NAME, + VK_KHR_WIN32_SURFACE_SPEC_VERSION, }, #endif { @@ -1485,12 +1648,14 @@ static const VkExtensionProperties supportedExtensions[] = { }, #ifdef VK_KHR_xcb_surface { - VK_KHR_XCB_SURFACE_EXTENSION_NAME, VK_KHR_XCB_SURFACE_SPEC_VERSION, + VK_KHR_XCB_SURFACE_EXTENSION_NAME, + VK_KHR_XCB_SURFACE_SPEC_VERSION, }, #endif #ifdef VK_KHR_xlib_surface { - VK_KHR_XLIB_SURFACE_EXTENSION_NAME, VK_KHR_XLIB_SURFACE_SPEC_VERSION, + VK_KHR_XLIB_SURFACE_EXTENSION_NAME, + VK_KHR_XLIB_SURFACE_SPEC_VERSION, }, #endif { @@ -1499,17 +1664,21 @@ static const VkExtensionProperties supportedExtensions[] = { }, #ifdef VK_MVK_macos_surface { - VK_MVK_MACOS_SURFACE_EXTENSION_NAME, VK_MVK_MACOS_SURFACE_SPEC_VERSION, + VK_MVK_MACOS_SURFACE_EXTENSION_NAME, + VK_MVK_MACOS_SURFACE_SPEC_VERSION, }, #endif { - VK_NV_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME, VK_NV_COMPUTE_SHADER_DERIVATIVES_SPEC_VERSION, + VK_NV_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME, + VK_NV_COMPUTE_SHADER_DERIVATIVES_SPEC_VERSION, }, { - VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME, VK_NV_DEDICATED_ALLOCATION_SPEC_VERSION, + VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME, + VK_NV_DEDICATED_ALLOCATION_SPEC_VERSION, }, { - VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME, VK_NV_EXTERNAL_MEMORY_SPEC_VERSION, + VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME, + VK_NV_EXTERNAL_MEMORY_SPEC_VERSION, }, { VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME, @@ -1517,7 +1686,8 @@ static const VkExtensionProperties supportedExtensions[] = { }, #ifdef VK_NV_external_memory_win32 { - VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME, VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION, + VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME, + VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION, }, #endif { @@ -1533,18 +1703,21 @@ static const VkExtensionProperties supportedExtensions[] = { VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_SPEC_VERSION, }, { - VK_NV_SHADER_IMAGE_FOOTPRINT_EXTENSION_NAME, VK_NV_SHADER_IMAGE_FOOTPRINT_SPEC_VERSION, + VK_NV_SHADER_IMAGE_FOOTPRINT_EXTENSION_NAME, + VK_NV_SHADER_IMAGE_FOOTPRINT_SPEC_VERSION, }, { VK_NV_SHADER_SUBGROUP_PARTITIONED_EXTENSION_NAME, VK_NV_SHADER_SUBGROUP_PARTITIONED_SPEC_VERSION, }, { - VK_NV_VIEWPORT_ARRAY2_EXTENSION_NAME, VK_NV_VIEWPORT_ARRAY2_SPEC_VERSION, + VK_NV_VIEWPORT_ARRAY2_EXTENSION_NAME, + VK_NV_VIEWPORT_ARRAY2_SPEC_VERSION, }, #ifdef VK_NV_win32_keyed_mutex { - VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME, VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION, + VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME, + VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION, }, #endif { @@ -1556,10 +1729,12 @@ static const VkExtensionProperties supportedExtensions[] = { VK_QCOM_RENDER_PASS_SHADER_RESOLVE_SPEC_VERSION, }, { - VK_QCOM_RENDER_PASS_STORE_OPS_EXTENSION_NAME, VK_QCOM_RENDER_PASS_STORE_OPS_SPEC_VERSION, + VK_QCOM_RENDER_PASS_STORE_OPS_EXTENSION_NAME, + VK_QCOM_RENDER_PASS_STORE_OPS_SPEC_VERSION, }, { - VK_VALVE_MUTABLE_DESCRIPTOR_TYPE_EXTENSION_NAME, VK_VALVE_MUTABLE_DESCRIPTOR_TYPE_SPEC_VERSION, + VK_VALVE_MUTABLE_DESCRIPTOR_TYPE_EXTENSION_NAME, + VK_VALVE_MUTABLE_DESCRIPTOR_TYPE_SPEC_VERSION, }, }; @@ -1928,7 +2103,10 @@ void WrappedVulkan::StartFrameCapture(DeviceOwnedWindow devWnd) { VkMemoryBarrier memBarrier = { - VK_STRUCTURE_TYPE_MEMORY_BARRIER, NULL, VK_ACCESS_ALL_WRITE_BITS, VK_ACCESS_ALL_READ_BITS, + VK_STRUCTURE_TYPE_MEMORY_BARRIER, + NULL, + VK_ACCESS_ALL_WRITE_BITS, + VK_ACCESS_ALL_READ_BITS, }; VkCommandBuffer cmd = GetNextCmd(); @@ -2174,7 +2352,9 @@ bool WrappedVulkan::EndFrameCapture(DeviceOwnedWindow devWnd) 0, {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1}, { - 0, 0, 0, + 0, + 0, + 0, }, {imageInfo.extent.width, imageInfo.extent.height, 1}, }; @@ -3141,7 +3321,10 @@ void WrappedVulkan::ApplyInitialContents() // this is a very blunt instrument but it ensures we don't get random artifacts around // frame restart where we may be skipping a lot of important synchronisation VkMemoryBarrier memBarrier = { - VK_STRUCTURE_TYPE_MEMORY_BARRIER, NULL, VK_ACCESS_ALL_WRITE_BITS, VK_ACCESS_ALL_READ_BITS, + VK_STRUCTURE_TYPE_MEMORY_BARRIER, + NULL, + VK_ACCESS_ALL_WRITE_BITS, + VK_ACCESS_ALL_READ_BITS, }; VkCommandBuffer cmd = GetNextCmd(); diff --git a/renderdoc/driver/vulkan/vk_debug.cpp b/renderdoc/driver/vulkan/vk_debug.cpp index 9f4b031ac..21dde8505 100644 --- a/renderdoc/driver/vulkan/vk_debug.cpp +++ b/renderdoc/driver/vulkan/vk_debug.cpp @@ -278,9 +278,13 @@ static void create(WrappedVulkan *driver, const char *objName, const int line, V const VkPipelineColorBlendAttachmentState colAttach = { info.blendEnable, // colour blending - info.srcBlend, info.dstBlend, VK_BLEND_OP_ADD, + info.srcBlend, + info.dstBlend, + VK_BLEND_OP_ADD, // alpha blending - info.srcBlend, info.dstBlend, VK_BLEND_OP_ADD, + info.srcBlend, + info.dstBlend, + VK_BLEND_OP_ADD, // write mask info.writeMask, }; @@ -536,7 +540,9 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver) // allocate memory VkMemoryAllocateInfo allocInfo = { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, depthmrq.size + mrq.size, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, + NULL, + depthmrq.size + mrq.size, driver->GetGPULocalMemoryIndex(mrq.memoryTypeBits), }; @@ -566,7 +572,11 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver) {VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY}, { - viewAspectMask, 0, 1, 0, 1, + viewAspectMask, + 0, + 1, + 0, + 1, }, }; @@ -635,7 +645,10 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver) }; VkSampleCountFlagBits sampleCounts[] = { - VK_SAMPLE_COUNT_2_BIT, VK_SAMPLE_COUNT_4_BIT, VK_SAMPLE_COUNT_8_BIT, VK_SAMPLE_COUNT_16_BIT, + VK_SAMPLE_COUNT_2_BIT, + VK_SAMPLE_COUNT_4_BIT, + VK_SAMPLE_COUNT_8_BIT, + VK_SAMPLE_COUNT_16_BIT, }; RDCCOMPILE_ASSERT(ARRAY_COUNT(m_DepthArray2MSPipe) == ARRAY_COUNT(formats), @@ -782,8 +795,16 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver) VkWriteDescriptorSet writes[] = { { - VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, NULL, Unwrap(m_DiscardSet[i]), 0, 0, 1, - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, NULL, &bufInfo, NULL, + VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, + NULL, + Unwrap(m_DiscardSet[i]), + 0, + 0, + 1, + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, + NULL, + &bufInfo, + NULL, }, }; @@ -938,7 +959,9 @@ void VulkanDebugManager::CreateCustomShaderTex(uint32_t width, uint32_t height, m_pDriver->vkFreeMemory(m_Device, m_Custom.TexMem, NULL); VkMemoryAllocateInfo allocInfo = { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, mrq.size, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, + NULL, + mrq.size, m_pDriver->GetGPULocalMemoryIndex(mrq.memoryTypeBits), }; @@ -964,7 +987,11 @@ void VulkanDebugManager::CreateCustomShaderTex(uint32_t width, uint32_t height, {VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY}, { - VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1, + VK_IMAGE_ASPECT_COLOR_BIT, + 0, + 1, + 0, + 1, }, }; @@ -2011,8 +2038,9 @@ void VulkanDebugManager::FillWithDiscardPattern(VkCommandBuffer cmd, DiscardType baseType = BuiltinShaderBaseType::UInt; VkAttachmentReference attRef = { - 0, depth ? VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL - : VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + 0, + depth ? VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL + : VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, }; VkAttachmentDescription attDesc = { @@ -2028,7 +2056,8 @@ void VulkanDebugManager::FillWithDiscardPattern(VkCommandBuffer cmd, DiscardType }; VkSubpassDescription sub = { - 0, VK_PIPELINE_BIND_POINT_GRAPHICS, + 0, + VK_PIPELINE_BIND_POINT_GRAPHICS, }; if(depth) @@ -2106,7 +2135,11 @@ void VulkanDebugManager::FillWithDiscardPattern(VkCommandBuffer cmd, DiscardType {VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY}, { - aspectMask, 0, 1, a, 1, + aspectMask, + 0, + 1, + a, + 1, }, }; @@ -2170,13 +2203,18 @@ void VulkanDebugManager::FillWithDiscardPattern(VkCommandBuffer cmd, DiscardType uint32_t pass = 0; VkImageMemoryBarrier dstimBarrier = { - VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, NULL, + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + NULL, VK_ACCESS_ALL_READ_BITS | VK_ACCESS_ALL_WRITE_BITS, depth ? (VkAccessFlags)VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT : (VkAccessFlags)VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, - curLayout, depth ? VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL - : VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - VK_QUEUE_FAMILY_IGNORED, VK_QUEUE_FAMILY_IGNORED, Unwrap(image), barrierDiscardRange, + curLayout, + depth ? VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL + : VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, + VK_QUEUE_FAMILY_IGNORED, + VK_QUEUE_FAMILY_IGNORED, + Unwrap(image), + barrierDiscardRange, }; DoPipelineBarrier(cmd, 1, &dstimBarrier); @@ -2275,7 +2313,9 @@ void VulkanDebugManager::FillWithDiscardPattern(VkCommandBuffer cmd, DiscardType stage.Unmap(); VkBufferCreateInfo bufInfo = { - VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, NULL, 0, + VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, + NULL, + 0, pattern.size() * (PatternBatchWidth / DiscardPatternWidth) * (PatternBatchHeight / DiscardPatternHeight), VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT, @@ -2380,7 +2420,9 @@ void VulkanDebugManager::FillWithDiscardPattern(VkCommandBuffer cmd, DiscardType 0, {aspectFlags, m, a, 1}, { - (int)x, (int)y, (int)z, + (int)x, + (int)y, + (int)z, }, }; @@ -3437,7 +3479,9 @@ void VulkanReplay::TextureRendering::Init(WrappedVulkan *driver, VkDescriptorPoo VK_FORMAT_R8G8B8A8_SINT, VK_FORMAT_D16_UNORM}; VkImageType types[] = {VK_IMAGE_TYPE_1D, VK_IMAGE_TYPE_2D, VK_IMAGE_TYPE_3D, VK_IMAGE_TYPE_2D}; VkImageViewType viewtypes[] = { - VK_IMAGE_VIEW_TYPE_1D_ARRAY, VK_IMAGE_VIEW_TYPE_2D_ARRAY, VK_IMAGE_VIEW_TYPE_3D, + VK_IMAGE_VIEW_TYPE_1D_ARRAY, + VK_IMAGE_VIEW_TYPE_2D_ARRAY, + VK_IMAGE_VIEW_TYPE_3D, VK_IMAGE_VIEW_TYPE_2D_ARRAY, driver->GetDeviceEnabledFeatures().imageCubeArray ? VK_IMAGE_VIEW_TYPE_CUBE_ARRAY : VK_IMAGE_VIEW_TYPE_CUBE, @@ -3641,7 +3685,11 @@ void VulkanReplay::TextureRendering::Init(WrappedVulkan *driver, VkDescriptorPoo {VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY}, { - VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1, + VK_IMAGE_ASPECT_COLOR_BIT, + 0, + 1, + 0, + 1, }, }; @@ -3701,7 +3749,9 @@ void VulkanReplay::TextureRendering::Init(WrappedVulkan *driver, VkDescriptorPoo if(DummyBuffer != VK_NULL_HANDLE) { VkFormat bufViewTypes[] = { - VK_FORMAT_R32G32B32A32_SFLOAT, VK_FORMAT_R32G32B32A32_UINT, VK_FORMAT_R32G32B32A32_SINT, + VK_FORMAT_R32G32B32A32_SFLOAT, + VK_FORMAT_R32G32B32A32_UINT, + VK_FORMAT_R32G32B32A32_SINT, }; for(size_t i = 0; i < ARRAY_COUNT(bufViewTypes); i++) { @@ -3940,15 +3990,40 @@ void VulkanReplay::MeshRendering::Init(WrappedVulkan *driver, VkDescriptorPool d Vec4f axisFrustum[] = { // axis marker vertices - Vec4f(0.0f, 0.0f, 0.0f, 1.0f), Vec4f(1.0f, 0.0f, 0.0f, 1.0f), Vec4f(0.0f, 0.0f, 0.0f, 1.0f), - Vec4f(0.0f, 1.0f, 0.0f, 1.0f), Vec4f(0.0f, 0.0f, 0.0f, 1.0f), Vec4f(0.0f, 0.0f, 1.0f, 1.0f), + Vec4f(0.0f, 0.0f, 0.0f, 1.0f), + Vec4f(1.0f, 0.0f, 0.0f, 1.0f), + Vec4f(0.0f, 0.0f, 0.0f, 1.0f), + Vec4f(0.0f, 1.0f, 0.0f, 1.0f), + Vec4f(0.0f, 0.0f, 0.0f, 1.0f), + Vec4f(0.0f, 0.0f, 1.0f, 1.0f), // frustum vertices - TLN, TRN, TRN, BRN, BRN, BLN, BLN, TLN, + TLN, + TRN, + TRN, + BRN, + BRN, + BLN, + BLN, + TLN, - TLN, TLF, TRN, TRF, BLN, BLF, BRN, BRF, + TLN, + TLF, + TRN, + TRF, + BLN, + BLF, + BRN, + BRF, - TLF, TRF, TRF, BRF, BRF, BLF, BLF, TLF, + TLF, + TRF, + TRF, + BRF, + BRF, + BLF, + BLF, + TLF, }; // doesn't need to be ring'd as it's immutable @@ -4088,7 +4163,9 @@ void VulkanReplay::PixelPicking::Init(WrappedVulkan *driver, VkDescriptorPool de // allocate readback memory VkMemoryAllocateInfo allocInfo = { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, mrq.size, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, + NULL, + mrq.size, driver->GetGPULocalMemoryIndex(mrq.memoryTypeBits), }; @@ -4108,7 +4185,11 @@ void VulkanReplay::PixelPicking::Init(WrappedVulkan *driver, VkDescriptorPool de {VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY}, { - VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1, + VK_IMAGE_ASPECT_COLOR_BIT, + 0, + 1, + 0, + 1, }, }; @@ -4186,7 +4267,8 @@ void VulkanReplay::PixelHistory::Init(WrappedVulkan *driver, VkDescriptorPool de VkResult vkr = VK_SUCCESS; VkDescriptorPoolSize descPoolTypes[] = { - {VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 64}, {VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 32}, + {VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 64}, + {VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 32}, }; VkDescriptorPoolCreateInfo descPoolInfo = { @@ -4409,7 +4491,9 @@ void ShaderDebugData::Init(WrappedVulkan *driver, VkDescriptorPool descriptorPoo // allocate readback memory VkMemoryAllocateInfo allocInfo = { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, mrq.size, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, + NULL, + mrq.size, driver->GetGPULocalMemoryIndex(mrq.memoryTypeBits), }; @@ -4429,7 +4513,11 @@ void ShaderDebugData::Init(WrappedVulkan *driver, VkDescriptorPool descriptorPoo {VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY}, { - VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1, + VK_IMAGE_ASPECT_COLOR_BIT, + 0, + 1, + 0, + 1, }, }; @@ -4458,14 +4546,22 @@ void ShaderDebugData::Init(WrappedVulkan *driver, VkDescriptorPool descriptorPoo VkSubpassDependency deps[2] = { { - VK_SUBPASS_EXTERNAL, 0, VK_PIPELINE_STAGE_TRANSFER_BIT, - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_ACCESS_TRANSFER_READ_BIT, - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, 0, + VK_SUBPASS_EXTERNAL, + 0, + VK_PIPELINE_STAGE_TRANSFER_BIT, + VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, + VK_ACCESS_TRANSFER_READ_BIT, + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, + 0, }, { - 0, VK_SUBPASS_EXTERNAL, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, - VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, - VK_ACCESS_TRANSFER_READ_BIT, 0, + 0, + VK_SUBPASS_EXTERNAL, + VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, + VK_PIPELINE_STAGE_TRANSFER_BIT, + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, + VK_ACCESS_TRANSFER_READ_BIT, + 0, }, }; diff --git a/renderdoc/driver/vulkan/vk_dispatchtables.cpp b/renderdoc/driver/vulkan/vk_dispatchtables.cpp index 25f7e3784..252b30da4 100644 --- a/renderdoc/driver/vulkan/vk_dispatchtables.cpp +++ b/renderdoc/driver/vulkan/vk_dispatchtables.cpp @@ -38,8 +38,8 @@ void InitReplayTables(void *vulkanModule) { replay = true; -// not all functions will succeed - some need to be fetched through the below -// InitDeviceReplayTable() + // not all functions will succeed - some need to be fetched through the below + // InitDeviceReplayTable() #undef HookInit #define HookInit(name) \ diff --git a/renderdoc/driver/vulkan/vk_initstate.cpp b/renderdoc/driver/vulkan/vk_initstate.cpp index ae0d64b33..e7eb877e2 100644 --- a/renderdoc/driver/vulkan/vk_initstate.cpp +++ b/renderdoc/driver/vulkan/vk_initstate.cpp @@ -219,9 +219,12 @@ bool WrappedVulkan::Prepare_InitialState(WrappedVkRes *res) bufAlignment = (VkDeviceSize)GetByteSize(1, 1, 1, imageInfo.format, 0); VkBufferCreateInfo bufInfo = { - VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, NULL, 0, 0, VK_BUFFER_USAGE_TRANSFER_SRC_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT | - VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, + VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, + NULL, + 0, + 0, + VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT | + VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, }; VkImage realim = im->real.As(); @@ -378,7 +381,9 @@ bool WrappedVulkan::Prepare_InitialState(WrappedVkRes *res) 0, {aspectFlags, (uint32_t)m, (uint32_t)a, 1}, { - 0, 0, 0, + 0, + 0, + 0, }, extent, }; @@ -710,7 +715,7 @@ SparseBinding::SparseBinding(WrappedVulkan *vk, VkBuffer unwrappedBuffer, // ) // - ) + ) { // apply the previous bind for one more page previousBind.size += mrq.alignment; @@ -900,7 +905,9 @@ SparseBinding::SparseBinding(WrappedVulkan *vk, VkImage unwrappedImage, const Sparse::PageRangeMapping &mapping = table.getSubresource(sub); Sparse::Coord mipDim = { - RDCMAX(1U, texDim.x >> mip), RDCMAX(1U, texDim.y >> mip), RDCMAX(1U, texDim.z >> mip), + RDCMAX(1U, texDim.x >> mip), + RDCMAX(1U, texDim.y >> mip), + RDCMAX(1U, texDim.z >> mip), }; Sparse::Coord dim = table.calcSubresourcePageDim(sub); @@ -1562,7 +1569,10 @@ bool WrappedVulkan::Serialise_InitialState(SerialiserType &ser, ResourceId id, V // create a buffer with memory attached, which we will fill with the initial contents VkBufferCreateInfo gpuBufInfo = { - VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, NULL, 0, ContentsSize, + VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, + NULL, + 0, + ContentsSize, VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, }; @@ -2028,7 +2038,9 @@ void WrappedVulkan::Apply_InitialState(WrappedVkRes *live, const VkInitialConten 0, {aspectFlags, m, a, 1}, { - 0, 0, 0, + 0, + 0, + 0, }, extent, }; diff --git a/renderdoc/driver/vulkan/vk_layer.cpp b/renderdoc/driver/vulkan/vk_layer.cpp index 69e3f3356..77bb4702e 100644 --- a/renderdoc/driver/vulkan/vk_layer.cpp +++ b/renderdoc/driver/vulkan/vk_layer.cpp @@ -201,8 +201,11 @@ VulkanHook VulkanHook::vkhooks; // RenderDoc Intercepts, these must all be entry points with a dispatchable object // as the first parameter -#define HookDefine1(ret, function, t1, p1) \ - VKAPI_ATTR ret VKAPI_CALL CONCAT(hooked_, function)(t1 p1) { return CoreDisp(p1)->function(p1); } +#define HookDefine1(ret, function, t1, p1) \ + VKAPI_ATTR ret VKAPI_CALL CONCAT(hooked_, function)(t1 p1) \ + { \ + return CoreDisp(p1)->function(p1); \ + } #define HookDefine2(ret, function, t1, p1, t2, p2) \ VKAPI_ATTR ret VKAPI_CALL CONCAT(hooked_, function)(t1 p1, t2 p2) \ { \ @@ -330,7 +333,8 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL VK_LAYER_RENDERDOC_CaptureEnumera return VK_INCOMPLETE; const VkLayerProperties layerProperties = { - RENDERDOC_VULKAN_LAYER_NAME, VK_API_VERSION_1_0, + RENDERDOC_VULKAN_LAYER_NAME, + VK_API_VERSION_1_0, VK_MAKE_VERSION(RENDERDOC_VERSION_MAJOR, RENDERDOC_VERSION_MINOR, 0), "Debugging capture layer for RenderDoc", }; @@ -393,12 +397,12 @@ VK_LAYER_RENDERDOC_CaptureEnumerateInstanceExtensionProperties( // for promoted extensions, we return the function pointer for either name as an alias. #undef HookInitPromotedExtension -#define HookInitPromotedExtension(cond, function, suffix) \ - if(!strcmp(pName, STRINGIZE(CONCAT(vk, function))) || \ - !strcmp(pName, STRINGIZE(CONCAT(vk, CONCAT(function, suffix))))) \ - { \ - if(cond) \ - return (PFN_vkVoidFunction)&CONCAT(hooked_vk, function); \ +#define HookInitPromotedExtension(cond, function, suffix) \ + if(!strcmp(pName, STRINGIZE(CONCAT(vk, function))) || \ + !strcmp(pName, STRINGIZE(CONCAT(vk, CONCAT(function, suffix))))) \ + { \ + if(cond) \ + return (PFN_vkVoidFunction)&CONCAT(hooked_vk, function); \ } // proc addr routines @@ -486,7 +490,7 @@ VK_LAYER_RENDERDOC_CaptureGetInstanceProcAddr(VkInstance instance, const char *p HookInitVulkanInstanceExts(); -// GetInstanceProcAddr must also unconditionally return all device functions + // GetInstanceProcAddr must also unconditionally return all device functions #undef HookInitExtension #define HookInitExtension(cond, function) \ @@ -494,9 +498,9 @@ VK_LAYER_RENDERDOC_CaptureGetInstanceProcAddr(VkInstance instance, const char *p return (PFN_vkVoidFunction)&CONCAT(hooked_vk, function); #undef HookInitPromotedExtension -#define HookInitPromotedExtension(cond, function, suffix) \ - if(!strcmp(pName, STRINGIZE(CONCAT(vk, function))) || \ - !strcmp(pName, STRINGIZE(CONCAT(vk, CONCAT(function, suffix))))) \ +#define HookInitPromotedExtension(cond, function, suffix) \ + if(!strcmp(pName, STRINGIZE(CONCAT(vk, function))) || \ + !strcmp(pName, STRINGIZE(CONCAT(vk, CONCAT(function, suffix))))) \ return (PFN_vkVoidFunction)&CONCAT(hooked_vk, function); HookInitVulkanDevice(); @@ -571,9 +575,9 @@ VK_LAYER_RENDERDOC_Capture_layerGetPhysicalDeviceProcAddr(VkInstance instance, c return NULL; #undef HookInitPromotedExtension -#define HookInitPromotedExtension(cond, function, suffix) \ - if(!strcmp(pName, STRINGIZE(CONCAT(vk, function))) || \ - !strcmp(pName, STRINGIZE(CONCAT(vk, CONCAT(function, suffix))))) \ +#define HookInitPromotedExtension(cond, function, suffix) \ + if(!strcmp(pName, STRINGIZE(CONCAT(vk, function))) || \ + !strcmp(pName, STRINGIZE(CONCAT(vk, CONCAT(function, suffix))))) \ return NULL; HookInitVulkanInstanceExts(); diff --git a/renderdoc/driver/vulkan/vk_manager.h b/renderdoc/driver/vulkan/vk_manager.h index 7d8b96475..085529643 100644 --- a/renderdoc/driver/vulkan/vk_manager.h +++ b/renderdoc/driver/vulkan/vk_manager.h @@ -207,15 +207,15 @@ public: template realtype GetLiveHandle(ResourceId origid) { - return realtype((uint64_t)( - (typename UnwrapHelper::ParentType *)ResourceManager::GetLiveResource(origid))); + return realtype((uint64_t)(( + typename UnwrapHelper::ParentType *)ResourceManager::GetLiveResource(origid))); } template realtype GetCurrentHandle(ResourceId id) { - return realtype((uint64_t)( - (typename UnwrapHelper::ParentType *)ResourceManager::GetCurrentResource(id))); + return realtype((uint64_t)(( + typename UnwrapHelper::ParentType *)ResourceManager::GetCurrentResource(id))); } // handling memory & image layouts diff --git a/renderdoc/driver/vulkan/vk_memory.cpp b/renderdoc/driver/vulkan/vk_memory.cpp index 0bb764d5e..c271f056d 100644 --- a/renderdoc/driver/vulkan/vk_memory.cpp +++ b/renderdoc/driver/vulkan/vk_memory.cpp @@ -320,7 +320,10 @@ MemoryAllocation WrappedVulkan::AllocateMemoryForResource(bool buffer, VkMemoryR } VkMemoryAllocateInfo info = { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, allocSize * 1024 * 1024, memoryTypeIndex, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, + NULL, + allocSize * 1024 * 1024, + memoryTypeIndex, }; if(ret.size > info.allocationSize) diff --git a/renderdoc/driver/vulkan/vk_msaa_buffer_conv.cpp b/renderdoc/driver/vulkan/vk_msaa_buffer_conv.cpp index 4345206e5..d12fa636e 100644 --- a/renderdoc/driver/vulkan/vk_msaa_buffer_conv.cpp +++ b/renderdoc/driver/vulkan/vk_msaa_buffer_conv.cpp @@ -61,7 +61,11 @@ void VulkanDebugManager::CopyTex2DMSToBuffer(VkCommandBuffer cmd, VkBuffer destB {VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY}, { - VK_IMAGE_ASPECT_COLOR_BIT, 0, VK_REMAINING_MIP_LEVELS, 0, VK_REMAINING_ARRAY_LAYERS, + VK_IMAGE_ASPECT_COLOR_BIT, + 0, + VK_REMAINING_MIP_LEVELS, + 0, + VK_REMAINING_ARRAY_LAYERS, }, }; @@ -152,7 +156,8 @@ void VulkanDebugManager::CopyTex2DMSToBuffer(VkCommandBuffer cmd, VkBuffer destB const uint32_t maxInvoc = AlignUp(extent.width * extent.height, msDivider) / msDivider; Vec4u params[2] = { - {extent.width, currentSlice, currentSample, bs}, {maxInvoc, dispatchOffset, 0, 0}, + {extent.width, currentSlice, currentSample, bs}, + {maxInvoc, dispatchOffset, 0, 0}, }; ObjDisp(cmd)->CmdPushConstants(Unwrap(cmd), Unwrap(m_BufferMSPipeLayout), @@ -227,7 +232,11 @@ void VulkanDebugManager::CopyDepthTex2DMSToBuffer(VkCommandBuffer cmd, VkBuffer {VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_ZERO, VK_COMPONENT_SWIZZLE_ZERO, VK_COMPONENT_SWIZZLE_ZERO}, { - VK_IMAGE_ASPECT_DEPTH_BIT, 0, VK_REMAINING_MIP_LEVELS, 0, VK_REMAINING_ARRAY_LAYERS, + VK_IMAGE_ASPECT_DEPTH_BIT, + 0, + VK_REMAINING_MIP_LEVELS, + 0, + VK_REMAINING_ARRAY_LAYERS, }, }; @@ -333,15 +342,17 @@ void VulkanDebugManager::CopyDepthTex2DMSToBuffer(VkCommandBuffer cmd, VkBuffer for(uint32_t currentSample = baseSample; currentSample < numSamples + baseSample; currentSample++) { // for D16 and S8 textures, we need to multisample. - const uint32_t msDivider = - (fmt == VK_FORMAT_D16_UNORM) ? 2 : (fmt == VK_FORMAT_S8_UINT) ? 4 : 1; + const uint32_t msDivider = (fmt == VK_FORMAT_D16_UNORM) ? 2 + : (fmt == VK_FORMAT_S8_UINT) ? 4 + : 1; const uint32_t workGroupDivider = MS_DISPATCH_LOCAL_SIZE * msDivider; const uint32_t numWorkGroup = AlignUp(extent.width * extent.height, workGroupDivider) / workGroupDivider; const uint32_t maxInvoc = AlignUp(extent.width * extent.height, msDivider) / msDivider; Vec4u params[2] = { - {extent.width, currentSlice, currentSample, fmtIndex}, {maxInvoc, dispatchOffset, 0, 0}, + {extent.width, currentSlice, currentSample, fmtIndex}, + {maxInvoc, dispatchOffset, 0, 0}, }; ObjDisp(cmd)->CmdPushConstants(Unwrap(cmd), Unwrap(m_BufferMSPipeLayout), VK_SHADER_STAGE_ALL, @@ -398,7 +409,11 @@ void VulkanDebugManager::CopyBufferToTex2DMS(VkCommandBuffer cmd, VkImage destMS {VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY}, { - VK_IMAGE_ASPECT_COLOR_BIT, 0, VK_REMAINING_MIP_LEVELS, 0, VK_REMAINING_ARRAY_LAYERS, + VK_IMAGE_ASPECT_COLOR_BIT, + 0, + VK_REMAINING_MIP_LEVELS, + 0, + VK_REMAINING_ARRAY_LAYERS, }, }; @@ -488,7 +503,8 @@ void VulkanDebugManager::CopyBufferToTex2DMS(VkCommandBuffer cmd, VkImage destMS const uint32_t maxInvoc = AlignUp(extent.width * extent.height, msDivider) / msDivider; Vec4u params[2] = { - {extent.width, currentSlice, currentSample, bs}, {maxInvoc, dispatchOffset, 0, 0}, + {extent.width, currentSlice, currentSample, bs}, + {maxInvoc, dispatchOffset, 0, 0}, }; ObjDisp(cmd)->CmdPushConstants(Unwrap(cmd), Unwrap(m_BufferMSPipeLayout), @@ -592,7 +608,11 @@ void VulkanDebugManager::CopyDepthBufferToTex2DMS(VkCommandBuffer cmd, VkImage d {VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY}, { - aspectFlags, 0, VK_REMAINING_MIP_LEVELS, 0, VK_REMAINING_ARRAY_LAYERS, + aspectFlags, + 0, + VK_REMAINING_MIP_LEVELS, + 0, + VK_REMAINING_ARRAY_LAYERS, }, }; diff --git a/renderdoc/driver/vulkan/vk_next_chains.cpp b/renderdoc/driver/vulkan/vk_next_chains.cpp index 38d641637..9d6356c93 100644 --- a/renderdoc/driver/vulkan/vk_next_chains.cpp +++ b/renderdoc/driver/vulkan/vk_next_chains.cpp @@ -2782,8 +2782,8 @@ void CopyNextChainForPatching(const char *structName, byte *&tempMem, VkBaseInSt VkBaseInStructure *nextChainTail = infoStruct; const VkBaseInStructure *nextInput = (const VkBaseInStructure *)infoStruct->pNext; -// simplified version of UnwrapNextChain which just copies everything. Useful for when we need to -// shallow duplicate a next chain (e.g. because we'll copy and patch one struct) + // simplified version of UnwrapNextChain which just copies everything. Useful for when we need to + // shallow duplicate a next chain (e.g. because we'll copy and patch one struct) #undef COPY_STRUCT_CAPTURE_ONLY #define COPY_STRUCT_CAPTURE_ONLY(StructType, StructName) \ diff --git a/renderdoc/driver/vulkan/vk_outputwindow.cpp b/renderdoc/driver/vulkan/vk_outputwindow.cpp index 7495476b5..926fe9b9d 100644 --- a/renderdoc/driver/vulkan/vk_outputwindow.cpp +++ b/renderdoc/driver/vulkan/vk_outputwindow.cpp @@ -458,7 +458,9 @@ void VulkanReplay::OutputWindow::Create(WrappedVulkan *driver, VkDevice device, vt->GetImageMemoryRequirements(Unwrap(device), Unwrap(dsimg), &mrq); VkMemoryAllocateInfo allocInfo = { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, mrq.size, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, + NULL, + mrq.size, driver->GetGPULocalMemoryIndex(mrq.memoryTypeBits), }; @@ -610,7 +612,9 @@ void VulkanReplay::OutputWindow::Create(WrappedVulkan *driver, VkDevice device, vt->GetImageMemoryRequirements(Unwrap(device), Unwrap(bb), &mrq); VkMemoryAllocateInfo allocInfo = { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, mrq.size, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, + NULL, + mrq.size, driver->GetGPULocalMemoryIndex(mrq.memoryTypeBits), }; @@ -727,7 +731,9 @@ void VulkanReplay::GetOutputWindowData(uint64_t id, bytebuf &retData) vt->GetBufferMemoryRequirements(Unwrap(device), readbackBuf, &mrq); VkMemoryAllocateInfo allocInfo = { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, mrq.size, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, + NULL, + mrq.size, m_pDriver->GetReadbackMemoryIndex(mrq.memoryTypeBits), }; @@ -754,7 +760,9 @@ void VulkanReplay::GetOutputWindowData(uint64_t id, bytebuf &retData) 0, {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1}, { - 0, 0, 0, + 0, + 0, + 0, }, {outw.width, outw.height, 1}, }; @@ -1203,11 +1211,13 @@ void VulkanReplay::FlipOutputWindow(uint64_t id) VkImageBlit blit = { {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1}, { - {0, 0, 0}, {(int32_t)outw.width, (int32_t)outw.height, 1}, + {0, 0, 0}, + {(int32_t)outw.width, (int32_t)outw.height, 1}, }, {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1}, { - {0, 0, 0}, {(int32_t)outw.width, (int32_t)outw.height, 1}, + {0, 0, 0}, + {(int32_t)outw.width, (int32_t)outw.height, 1}, }, }; diff --git a/renderdoc/driver/vulkan/vk_overlay.cpp b/renderdoc/driver/vulkan/vk_overlay.cpp index f0c73d2cb..63e703a5d 100644 --- a/renderdoc/driver/vulkan/vk_overlay.cpp +++ b/renderdoc/driver/vulkan/vk_overlay.cpp @@ -572,7 +572,9 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D } VkMemoryAllocateInfo allocInfo = { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, mrq.size, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, + NULL, + mrq.size, m_pDriver->GetGPULocalMemoryIndex(mrq.memoryTypeBits), }; @@ -2027,7 +2029,9 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D } VkClearRect rect = { - state.renderArea, 0, 1, + state.renderArea, + 0, + 1, }; vt->CmdClearAttachments(Unwrap(cmd), (uint32_t)atts.size(), &atts[0], 1, &rect); @@ -2136,7 +2140,9 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D m_pDriver->vkGetImageMemoryRequirements(m_Device, quadImg, &mrq); VkMemoryAllocateInfo allocInfo = { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, mrq.size, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, + NULL, + mrq.size, m_pDriver->GetGPULocalMemoryIndex(mrq.memoryTypeBits), }; @@ -2209,7 +2215,10 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D DoPipelineBarrier(cmd, 1, &quadImBarrier); VkMemoryBarrier memBarrier = { - VK_STRUCTURE_TYPE_MEMORY_BARRIER, NULL, VK_ACCESS_ALL_WRITE_BITS, VK_ACCESS_ALL_READ_BITS, + VK_STRUCTURE_TYPE_MEMORY_BARRIER, + NULL, + VK_ACCESS_ALL_WRITE_BITS, + VK_ACCESS_ALL_READ_BITS, }; DoPipelineBarrier(cmd, 1, &memBarrier); @@ -2546,7 +2555,8 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D }; VkVertexInputAttributeDescription vertAttrs[] = { - {0, 0, VK_FORMAT_R32G32B32A32_SFLOAT, 0}, {1, 0, VK_FORMAT_R32G32B32A32_SFLOAT, 0}, + {0, 0, VK_FORMAT_R32G32B32A32_SFLOAT, 0}, + {1, 0, VK_FORMAT_R32G32B32A32_SFLOAT, 0}, }; VkPipelineVertexInputStateCreateInfo vi = { diff --git a/renderdoc/driver/vulkan/vk_pixelhistory.cpp b/renderdoc/driver/vulkan/vk_pixelhistory.cpp index 46700f98f..0392db016 100644 --- a/renderdoc/driver/vulkan/vk_pixelhistory.cpp +++ b/renderdoc/driver/vulkan/vk_pixelhistory.cpp @@ -246,9 +246,9 @@ struct PixelHistoryShaderCache { if(m_pDriver->GetExtensions(NULL).ext_KHR_buffer_device_address) { - dummybuf.Create(vk, vk->GetDev(), 1024, 1, GPUBuffer::eGPUBufferGPULocal | - GPUBuffer::eGPUBufferSSBO | - GPUBuffer::eGPUBufferAddressable); + dummybuf.Create(vk, vk->GetDev(), 1024, 1, + GPUBuffer::eGPUBufferGPULocal | GPUBuffer::eGPUBufferSSBO | + GPUBuffer::eGPUBufferAddressable); } else { @@ -1313,12 +1313,19 @@ protected: if(p.multisampled) { VkImageMemoryBarrier barrier = { - VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, NULL, + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + NULL, VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | VK_ACCESS_TRANSFER_WRITE_BIT | VK_ACCESS_MEMORY_WRITE_BIT, - VK_ACCESS_SHADER_READ_BIT, p.srcImageLayout, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, - VK_QUEUE_FAMILY_IGNORED, VK_QUEUE_FAMILY_IGNORED, Unwrap(p.srcImage), subresource}; + VK_ACCESS_SHADER_READ_BIT, + p.srcImageLayout, + VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, + VK_QUEUE_FAMILY_IGNORED, + VK_QUEUE_FAMILY_IGNORED, + Unwrap(p.srcImage), + subresource, + }; SanitiseOldImageLayout(barrier.oldLayout); VkDescriptorSet descSet = GetCopyDescriptor(p.srcImage, p.srcImageFormat, baseMip, baseSlice); @@ -1376,12 +1383,19 @@ protected: } VkImageMemoryBarrier barrier = { - VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, NULL, + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + NULL, VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | VK_ACCESS_TRANSFER_WRITE_BIT | VK_ACCESS_MEMORY_WRITE_BIT, - VK_ACCESS_TRANSFER_READ_BIT, p.srcImageLayout, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, - VK_QUEUE_FAMILY_IGNORED, VK_QUEUE_FAMILY_IGNORED, Unwrap(p.srcImage), subresource}; + VK_ACCESS_TRANSFER_READ_BIT, + p.srcImageLayout, + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, + VK_QUEUE_FAMILY_IGNORED, + VK_QUEUE_FAMILY_IGNORED, + Unwrap(p.srcImage), + subresource, + }; SanitiseOldImageLayout(barrier.oldLayout); DoPipelineBarrier(cmd, 1, &barrier); @@ -2989,8 +3003,9 @@ struct VulkanPixelHistoryPerFragmentCallback : VulkanPixelHistoryCallback m_pDriver->ReplayDraw(cmd, *action); state.EndRenderPass(cmd); - CopyImagePixel(cmd, colourCopyParams, (fragsProcessed + f) * sizeof(PerFragmentInfo) + - offsetof(struct PerFragmentInfo, postMod)); + CopyImagePixel(cmd, colourCopyParams, + (fragsProcessed + f) * sizeof(PerFragmentInfo) + + offsetof(struct PerFragmentInfo, postMod)); if(depthImage != VK_NULL_HANDLE) { @@ -2998,9 +3013,10 @@ struct VulkanPixelHistoryPerFragmentCallback : VulkanPixelHistoryCallback depthCopyParams.srcImage = m_CallbackInfo.dsImage; depthCopyParams.srcImageLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; depthCopyParams.srcImageFormat = m_CallbackInfo.dsFormat; - CopyImagePixel(cmd, depthCopyParams, (fragsProcessed + f) * sizeof(PerFragmentInfo) + - offsetof(struct PerFragmentInfo, postMod) + - offsetof(struct PixelHistoryValue, depth)); + CopyImagePixel(cmd, depthCopyParams, + (fragsProcessed + f) * sizeof(PerFragmentInfo) + + offsetof(struct PerFragmentInfo, postMod) + + offsetof(struct PixelHistoryValue, depth)); } } @@ -3462,7 +3478,9 @@ bool VulkanDebugManager::PixelHistorySetupResources(PixelHistoryResources &resou totalMemorySize = offset + stencilImageMrq.size; VkMemoryAllocateInfo allocInfo = { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, totalMemorySize, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, + NULL, + totalMemorySize, m_pDriver->GetGPULocalMemoryIndex(colorImageMrq.memoryTypeBits), }; vkr = m_pDriver->vkAllocateMemory(m_Device, &allocInfo, NULL, &gpuMem); @@ -3594,7 +3612,9 @@ bool VulkanDebugManager::PixelHistorySetupPerFragResources(PixelHistoryResources VkMemoryRequirements mrq = {}; m_pDriver->vkGetBufferMemoryRequirements(m_Device, resources.dstBuffer, &mrq); VkMemoryAllocateInfo allocInfo = { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, mrq.size, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, + NULL, + mrq.size, m_pDriver->GetReadbackMemoryIndex(mrq.memoryTypeBits), }; vkr = m_pDriver->vkAllocateMemory(m_Device, &allocInfo, NULL, &resources.bufferMemory); diff --git a/renderdoc/driver/vulkan/vk_posix.cpp b/renderdoc/driver/vulkan/vk_posix.cpp index d8e34aea9..ac0bb4e06 100644 --- a/renderdoc/driver/vulkan/vk_posix.cpp +++ b/renderdoc/driver/vulkan/vk_posix.cpp @@ -189,7 +189,7 @@ void WrappedVulkan::AddRequiredExtensions(bool instance, rdcarray &exten #elif defined(VK_USE_PLATFORM_METAL_EXT) VK_EXT_METAL_SURFACE_EXTENSION_NAME #endif - ); + ); #endif #if defined(VK_USE_PLATFORM_ANDROID_KHR) @@ -271,7 +271,7 @@ static rdcstr GenerateJSON(const rdcstr &sopath) while(idx >= 0) { json = json.substr(0, idx) + STRINGIZE(RENDERDOC_VERSION_MAJOR) + - json.substr(idx + sizeof(majorString) - 1); + json.substr(idx + sizeof(majorString) - 1); idx = json.find(majorString); } @@ -282,7 +282,7 @@ static rdcstr GenerateJSON(const rdcstr &sopath) while(idx >= 0) { json = json.substr(0, idx) + STRINGIZE(RENDERDOC_VERSION_MINOR) + - json.substr(idx + sizeof(minorString) - 1); + json.substr(idx + sizeof(minorString) - 1); idx = json.find(minorString); } diff --git a/renderdoc/driver/vulkan/vk_postvs.cpp b/renderdoc/driver/vulkan/vk_postvs.cpp index bbd2a2487..ac9b8750e 100644 --- a/renderdoc/driver/vulkan/vk_postvs.cpp +++ b/renderdoc/driver/vulkan/vk_postvs.cpp @@ -1606,16 +1606,27 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state) VkDescriptorSetLayoutBinding newBindings[] = { // output buffer { - 0, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_COMPUTE_BIT, NULL, + 0, + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, + 1, + VK_SHADER_STAGE_COMPUTE_BIT, + NULL, }, // index buffer (if needed) { - 1, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_COMPUTE_BIT, NULL, + 1, + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, + 1, + VK_SHADER_STAGE_COMPUTE_BIT, + NULL, }, // vertex buffers { - 2, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, MeshOutputBufferArraySize, - VK_SHADER_STAGE_COMPUTE_BIT, NULL, + 2, + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, + MeshOutputBufferArraySize, + VK_SHADER_STAGE_COMPUTE_BIT, + NULL, }, }; RDCCOMPILE_ASSERT(ARRAY_COUNT(newBindings) == MeshOutputReservedBindings, @@ -1744,7 +1755,9 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state) uint32_t maxInstance = action->instanceOffset + action->numInstances - 1; const VkMemoryAllocateFlagsInfo memFlags = { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO, NULL, VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO, + NULL, + VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT, }; if(action->flags & ActionFlags::Indexed) @@ -1904,7 +1917,9 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state) m_pDriver->vkGetBufferMemoryRequirements(dev, uniqIdxBuf, &mrq); VkMemoryAllocateInfo allocInfo = { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, mrq.size, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, + NULL, + mrq.size, m_pDriver->GetUploadMemoryIndex(mrq.memoryTypeBits), }; @@ -2215,7 +2230,9 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state) m_pDriver->vkGetBufferMemoryRequirements(dev, vbuffers[attr].buf, &mrq); VkMemoryAllocateInfo allocInfo = { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, mrq.size, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, + NULL, + mrq.size, m_pDriver->GetUploadMemoryIndex(mrq.memoryTypeBits), }; @@ -2490,7 +2507,9 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state) m_pDriver->vkGetBufferMemoryRequirements(dev, meshBuffer, &mrq); VkMemoryAllocateInfo allocInfo = { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, mrq.size, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, + NULL, + mrq.size, m_pDriver->GetGPULocalMemoryIndex(mrq.memoryTypeBits), }; @@ -2687,7 +2706,8 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state) meshbufbarrier.size = VK_WHOLE_SIZE; VkMemoryBarrier globalbarrier = { - VK_STRUCTURE_TYPE_MEMORY_BARRIER, NULL, + VK_STRUCTURE_TYPE_MEMORY_BARRIER, + NULL, VK_ACCESS_TRANSFER_WRITE_BIT | VK_ACCESS_HOST_WRITE_BIT, VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT, }; @@ -2728,7 +2748,9 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state) DoPipelineBarrier(cmd, 1, &meshbufbarrier); VkBufferCopy bufcopy = { - 0, 0, bufSize, + 0, + 0, + bufSize, }; // copy to readback buffer @@ -3172,7 +3194,9 @@ void VulkanReplay::FetchTessGSOut(uint32_t eventId, VulkanRenderState &state) m_pDriver->vkGetBufferMemoryRequirements(dev, meshBuffer, &mrq); VkMemoryAllocateInfo allocInfo = { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, mrq.size, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, + NULL, + mrq.size, m_pDriver->GetGPULocalMemoryIndex(mrq.memoryTypeBits), }; diff --git a/renderdoc/driver/vulkan/vk_rendermesh.cpp b/renderdoc/driver/vulkan/vk_rendermesh.cpp index b9208dbd4..b6cfd4bb9 100644 --- a/renderdoc/driver/vulkan/vk_rendermesh.cpp +++ b/renderdoc/driver/vulkan/vk_rendermesh.cpp @@ -160,11 +160,17 @@ VKMeshDisplayPipelines VulkanDebugManager::CacheMeshDisplayPipelines(VkPipelineL VkVertexInputAttributeDescription vertAttrs[] = { // primary { - 0, 0, primaryFmt, 0, + 0, + 0, + primaryFmt, + 0, }, // secondary { - 1, 0, primaryFmt, 0, + 1, + 0, + primaryFmt, + 0, }, }; @@ -194,7 +200,9 @@ VKMeshDisplayPipelines VulkanDebugManager::CacheMeshDisplayPipelines(VkPipelineL }; VkPipelineInputAssemblyStateCreateInfo ia = { - VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO, NULL, 0, + VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO, + NULL, + 0, primary.topology >= Topology::PatchList ? VK_PRIMITIVE_TOPOLOGY_POINT_LIST : MakeVkPrimitiveTopology(primary.topology), false, @@ -268,7 +276,8 @@ VKMeshDisplayPipelines VulkanDebugManager::CacheMeshDisplayPipelines(VkPipelineL VK_LOGIC_OP_NO_OP, 1, &attState, - {1.0f, 1.0f, 1.0f, 1.0f}}; + {1.0f, 1.0f, 1.0f, 1.0f}, + }; VkDynamicState dynstates[] = {VK_DYNAMIC_STATE_VIEWPORT}; @@ -470,7 +479,8 @@ void VulkanReplay::RenderMesh(uint32_t eventId, const rdcarray &seco Unwrap(outw.rpdepth), Unwrap(outw.fbdepth), {{ - 0, 0, + 0, + 0, }, {m_DebugWidth, m_DebugHeight}}, 0, @@ -1155,7 +1165,10 @@ void VulkanReplay::RenderMesh(uint32_t eventId, const rdcarray &seco cache = GetDebugManager()->CacheMeshDisplayPipelines(m_MeshRender.PipeLayout, helper, helper); FloatVector vertSprite[4] = { - activeVertex, activeVertex, activeVertex, activeVertex, + activeVertex, + activeVertex, + activeVertex, + activeVertex, }; vt->CmdBindDescriptorSets(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS, diff --git a/renderdoc/driver/vulkan/vk_rendertext.cpp b/renderdoc/driver/vulkan/vk_rendertext.cpp index 4d76a4aff..9b0bf9faf 100644 --- a/renderdoc/driver/vulkan/vk_rendertext.cpp +++ b/renderdoc/driver/vulkan/vk_rendertext.cpp @@ -185,7 +185,8 @@ VulkanTextRenderer::VulkanTextRenderer(WrappedVulkan *driver) VK_LOGIC_OP_NO_OP, 1, &attState, - {1.0f, 1.0f, 1.0f, 1.0f}}; + {1.0f, 1.0f, 1.0f, 1.0f}, + }; VkDynamicState dynstates[] = {VK_DYNAMIC_STATE_VIEWPORT}; @@ -363,7 +364,9 @@ VulkanTextRenderer::VulkanTextRenderer(WrappedVulkan *driver) // allocate readback memory VkMemoryAllocateInfo allocInfo = { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, mrq.size, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, + NULL, + mrq.size, driver->GetGPULocalMemoryIndex(mrq.memoryTypeBits), }; @@ -480,7 +483,9 @@ VulkanTextRenderer::VulkanTextRenderer(WrappedVulkan *driver) 0, {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1}, { - 0, 0, 0, + 0, + 0, + 0, }, {FONT_TEX_WIDTH, FONT_TEX_HEIGHT, 1}, }; @@ -573,7 +578,8 @@ void VulkanTextRenderer::BeginText(const TextPrintState &textstate) Unwrap(textstate.rp), Unwrap(textstate.fb), {{ - 0, 0, + 0, + 0, }, {textstate.w, textstate.h}}, 1, diff --git a/renderdoc/driver/vulkan/vk_rendertexture.cpp b/renderdoc/driver/vulkan/vk_rendertexture.cpp index 64ee823de..695b98b79 100644 --- a/renderdoc/driver/vulkan/vk_rendertexture.cpp +++ b/renderdoc/driver/vulkan/vk_rendertexture.cpp @@ -72,7 +72,10 @@ void VulkanReplay::CreateTexImageView(VkImage liveIm, const VulkanCreationInfo:: {VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY}, { - VK_IMAGE_ASPECT_COLOR_BIT, 0, RDCMAX(1U, iminfo.mipLevels), 0, + VK_IMAGE_ASPECT_COLOR_BIT, + 0, + RDCMAX(1U, iminfo.mipLevels), + 0, RDCMAX(1U, iminfo.arrayLayers), }, }; @@ -150,7 +153,8 @@ bool VulkanReplay::RenderTexture(TextureDisplay cfg) Unwrap(outw.rp), Unwrap(outw.fb), {{ - 0, 0, + 0, + 0, }, {m_DebugWidth, m_DebugHeight}}, 0, diff --git a/renderdoc/driver/vulkan/vk_replay.cpp b/renderdoc/driver/vulkan/vk_replay.cpp index ed2a588e2..c203684d2 100644 --- a/renderdoc/driver/vulkan/vk_replay.cpp +++ b/renderdoc/driver/vulkan/vk_replay.cpp @@ -480,7 +480,9 @@ void VulkanReplay::CachePipelineExecutables(ResourceId pipeline) VkPipeline pipe = m_pDriver->GetResourceManager()->GetCurrentHandle(pipeline); VkPipelineInfoKHR pipeInfo = { - VK_STRUCTURE_TYPE_PIPELINE_INFO_KHR, NULL, Unwrap(pipe), + VK_STRUCTURE_TYPE_PIPELINE_INFO_KHR, + NULL, + Unwrap(pipe), }; VkDevice dev = m_pDriver->GetDev(); @@ -508,7 +510,10 @@ void VulkanReplay::CachePipelineExecutables(ResourceId pipeline) rdcarray &irs = out.representations; VkPipelineExecutableInfoKHR pipeExecInfo = { - VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INFO_KHR, NULL, Unwrap(pipe), i, + VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INFO_KHR, + NULL, + Unwrap(pipe), + i, }; // enumerate statistics @@ -758,7 +763,8 @@ void VulkanReplay::RenderCheckerboard(FloatVector dark, FloatVector light) Unwrap(outw.rp), Unwrap(outw.fb), {{ - 0, 0, + 0, + 0, }, {m_DebugWidth, m_DebugHeight}}, 0, @@ -811,7 +817,8 @@ void VulkanReplay::RenderCheckerboard(FloatVector dark, FloatVector light) VkClearAttachment darkCol = {VK_IMAGE_ASPECT_COLOR_BIT, 0, {{{dark.x, dark.y, dark.z, dark.w}}}}; VkClearRect fullRect = {{ - {0, 0}, {outw.width, outw.height}, + {0, 0}, + {outw.width, outw.height}, }, 0, 1}; @@ -825,7 +832,8 @@ void VulkanReplay::RenderCheckerboard(FloatVector dark, FloatVector light) for(int32_t x = 0; x < (int32_t)outw.width; x += 128) { VkClearRect square = {{ - {x, y}, {64, 64}, + {x, y}, + {64, 64}, }, 0, 1}; @@ -883,7 +891,8 @@ void VulkanReplay::RenderHighlightBox(float w, float h, float scale) Unwrap(outw.rp), Unwrap(outw.fb), {{ - 0, 0, + 0, + 0, }, {m_DebugWidth, m_DebugHeight}}, 0, @@ -900,22 +909,26 @@ void VulkanReplay::RenderHighlightBox(float w, float h, float scale) VkClearRect rect[4] = { {{ - {tl.x, tl.y}, {1, sz}, + {tl.x, tl.y}, + {1, sz}, }, 0, 1}, {{ - {tl.x + (int32_t)sz, tl.y}, {1, sz + 1}, + {tl.x + (int32_t)sz, tl.y}, + {1, sz + 1}, }, 0, 1}, {{ - {tl.x, tl.y}, {sz, 1}, + {tl.x, tl.y}, + {sz, 1}, }, 0, 1}, {{ - {tl.x, tl.y + (int32_t)sz}, {sz, 1}, + {tl.x, tl.y + (int32_t)sz}, + {sz, 1}, }, 0, 1}, @@ -1860,11 +1873,13 @@ void VulkanReplay::SavePipelineState(uint32_t eventId) { rdcarray *dsts[] = { - &ret.graphics.descriptorSets, &ret.compute.descriptorSets, + &ret.graphics.descriptorSets, + &ret.compute.descriptorSets, }; const rdcarray *srcs[] = { - &state.graphics.descSets, &state.compute.descSets, + &state.graphics.descSets, + &state.compute.descSets, }; const VKDynamicShaderFeedback &usage = m_BindlessFeedback.Usage[eventId]; @@ -2446,7 +2461,8 @@ void VulkanReplay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, const S Unwrap(m_PixelPick.RP), Unwrap(m_PixelPick.FB), {{ - 0, 0, + 0, + 0, }, {1, 1}}, 1, @@ -2581,7 +2597,8 @@ bool VulkanReplay::GetMinMax(ResourceId texid, const Subresource &sub, CompType // for depth/stencil we need to run the code twice - once to fetch depth and once to fetch // stencil - since we can't process float depth and int stencil at the same time Vec4f depth[2] = { - {0.0f, 0.0f, 0.0f, 0.0f}, {1.0f, 1.0f, 1.0f, 1.0f}, + {0.0f, 0.0f, 0.0f, 0.0f}, + {1.0f, 1.0f, 1.0f, 1.0f}, }; Vec4u stencil[2] = {{0, 0, 0, 0}, {1, 1, 1, 1}}; @@ -2879,7 +2896,9 @@ bool VulkanReplay::GetMinMax(ResourceId texid, const Subresource &sub, CompType DoPipelineBarrier(cmd, 1, &tilebarrier); VkBufferCopy bufcopy = { - 0, 0, m_Histogram.m_MinMaxResult.totalsize, + 0, + 0, + m_Histogram.m_MinMaxResult.totalsize, }; vt->CmdCopyBuffer(Unwrap(cmd), Unwrap(m_Histogram.m_MinMaxResult.buf), @@ -3196,7 +3215,9 @@ bool VulkanReplay::GetHistogram(ResourceId texid, const Subresource &sub, CompTy DoPipelineBarrier(cmd, 1, &tilebarrier); VkBufferCopy bufcopy = { - 0, 0, m_Histogram.m_HistogramBuf.totalsize, + 0, + 0, + m_Histogram.m_HistogramBuf.totalsize, }; vt->CmdCopyBuffer(Unwrap(cmd), Unwrap(m_Histogram.m_HistogramBuf.buf), @@ -3437,7 +3458,9 @@ void VulkanReplay::GetTextureData(ResourceId tex, const Subresource &sub, vt->GetImageMemoryRequirements(Unwrap(dev), tmpImage, &mrq); VkMemoryAllocateInfo allocInfo = { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, mrq.size, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, + NULL, + mrq.size, m_pDriver->GetGPULocalMemoryIndex(mrq.memoryTypeBits), }; @@ -3557,7 +3580,11 @@ void VulkanReplay::GetTextureData(ResourceId tex, const Subresource &sub, {VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY}, { - VK_IMAGE_ASPECT_COLOR_BIT, 0, VK_REMAINING_MIP_LEVELS, i, 1, + VK_IMAGE_ASPECT_COLOR_BIT, + 0, + VK_REMAINING_MIP_LEVELS, + i, + 1, }, }; @@ -3588,7 +3615,8 @@ void VulkanReplay::GetTextureData(ResourceId tex, const Subresource &sub, tmpRP, tmpFB[i], {{ - 0, 0, + 0, + 0, }, {imCreateInfo.extent.width, imCreateInfo.extent.height}}, 1, @@ -3687,7 +3715,9 @@ void VulkanReplay::GetTextureData(ResourceId tex, const Subresource &sub, vt->GetImageMemoryRequirements(Unwrap(dev), tmpImage, &mrq); VkMemoryAllocateInfo allocInfo = { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, mrq.size, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, + NULL, + mrq.size, m_pDriver->GetGPULocalMemoryIndex(mrq.memoryTypeBits), }; @@ -3765,10 +3795,14 @@ void VulkanReplay::GetTextureData(ResourceId tex, const Subresource &sub, imCreateInfo.format, s.mip); // buffer size needs to be align to the int for shader writing - VkBufferCreateInfo bufInfo = {VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, NULL, 0, - AlignUp(dataSize, 4U), VK_BUFFER_USAGE_TRANSFER_SRC_BIT | - VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT}; + VkBufferCreateInfo bufInfo = { + VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, + NULL, + 0, + AlignUp(dataSize, 4U), + VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT, + }; vkr = vt->CreateBuffer(Unwrap(dev), &bufInfo, NULL, &readbackBuf); CheckVkResult(vkr); @@ -3778,7 +3812,9 @@ void VulkanReplay::GetTextureData(ResourceId tex, const Subresource &sub, vt->GetBufferMemoryRequirements(Unwrap(dev), readbackBuf, &mrq); VkMemoryAllocateInfo allocInfo = { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, mrq.size, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, + NULL, + mrq.size, m_pDriver->GetReadbackMemoryIndex(mrq.memoryTypeBits), }; vkr = vt->AllocateMemory(Unwrap(dev), &allocInfo, NULL, &readbackMem); @@ -3852,7 +3888,9 @@ void VulkanReplay::GetTextureData(ResourceId tex, const Subresource &sub, 0, {VK_IMAGE_ASPECT_NONE, s.mip, s.slice, 1}, { - 0, 0, 0, + 0, + 0, + 0, }, {RDCMAX(1U, imCreateInfo.extent.width >> s.mip), RDCMAX(1U, imCreateInfo.extent.height >> s.mip), @@ -3932,7 +3970,9 @@ void VulkanReplay::GetTextureData(ResourceId tex, const Subresource &sub, vt->GetBufferMemoryRequirements(Unwrap(dev), readbackBuf, &mrq); VkMemoryAllocateInfo allocInfo = { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, mrq.size, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, + NULL, + mrq.size, m_pDriver->GetReadbackMemoryIndex(mrq.memoryTypeBits), }; vkr = vt->AllocateMemory(Unwrap(dev), &allocInfo, NULL, &readbackMem); @@ -4261,7 +4301,8 @@ ResourceId VulkanReplay::ApplyCustomShader(TextureDisplay &display) Unwrap(GetDebugManager()->GetCustomRenderpass()), Unwrap(GetDebugManager()->GetCustomFramebuffer()), {{ - 0, 0, + 0, + 0, }, {RDCMAX(1U, iminfo.extent.width >> display.subresource.mip), RDCMAX(1U, iminfo.extent.height >> display.subresource.mip)}}, diff --git a/renderdoc/driver/vulkan/vk_resources.cpp b/renderdoc/driver/vulkan/vk_resources.cpp index 487212462..ad3db863e 100644 --- a/renderdoc/driver/vulkan/vk_resources.cpp +++ b/renderdoc/driver/vulkan/vk_resources.cpp @@ -1549,8 +1549,7 @@ BlockShape GetBlockShape(VkFormat Format, uint32_t plane) case VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG: case VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG: case VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG: - case VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG: - return {4, 4, 8}; + case VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG: return {4, 4, 8}; /* * YUV planar/packed subsampled textures. @@ -4689,12 +4688,22 @@ TEST_CASE("Vulkan formats", "[format][vulkan]") int i = 0; for(VkFormat f : { - VK_FORMAT_BC1_RGB_UNORM_BLOCK, VK_FORMAT_BC1_RGB_SRGB_BLOCK, - VK_FORMAT_BC1_RGBA_UNORM_BLOCK, VK_FORMAT_BC1_RGBA_SRGB_BLOCK, - VK_FORMAT_BC2_UNORM_BLOCK, VK_FORMAT_BC2_SRGB_BLOCK, VK_FORMAT_BC3_UNORM_BLOCK, - VK_FORMAT_BC3_SRGB_BLOCK, VK_FORMAT_BC4_UNORM_BLOCK, VK_FORMAT_BC4_SNORM_BLOCK, - VK_FORMAT_BC5_UNORM_BLOCK, VK_FORMAT_BC5_SNORM_BLOCK, VK_FORMAT_BC6H_UFLOAT_BLOCK, - VK_FORMAT_BC6H_SFLOAT_BLOCK, VK_FORMAT_BC7_UNORM_BLOCK, VK_FORMAT_BC7_SRGB_BLOCK, + VK_FORMAT_BC1_RGB_UNORM_BLOCK, + VK_FORMAT_BC1_RGB_SRGB_BLOCK, + VK_FORMAT_BC1_RGBA_UNORM_BLOCK, + VK_FORMAT_BC1_RGBA_SRGB_BLOCK, + VK_FORMAT_BC2_UNORM_BLOCK, + VK_FORMAT_BC2_SRGB_BLOCK, + VK_FORMAT_BC3_UNORM_BLOCK, + VK_FORMAT_BC3_SRGB_BLOCK, + VK_FORMAT_BC4_UNORM_BLOCK, + VK_FORMAT_BC4_SNORM_BLOCK, + VK_FORMAT_BC5_UNORM_BLOCK, + VK_FORMAT_BC5_SNORM_BLOCK, + VK_FORMAT_BC6H_UFLOAT_BLOCK, + VK_FORMAT_BC6H_SFLOAT_BLOCK, + VK_FORMAT_BC7_UNORM_BLOCK, + VK_FORMAT_BC7_SRGB_BLOCK, }) { INFO("Format is " << ToStr(f)); diff --git a/renderdoc/driver/vulkan/vk_resources.h b/renderdoc/driver/vulkan/vk_resources.h index ddd78127a..2f79f9886 100644 --- a/renderdoc/driver/vulkan/vk_resources.h +++ b/renderdoc/driver/vulkan/vk_resources.h @@ -586,24 +586,27 @@ struct UnwrapHelper { }; -#define UNWRAP_HELPER(vulkantype) \ - template <> \ - struct UnwrapHelper \ - { \ - typedef WrappedVkDispRes ParentType; \ - enum \ - { \ - DispatchableType = 1 \ - }; \ - typedef CONCAT(Wrapped, vulkantype) Outer; \ - static TypedRealHandle ToTypedHandle(vulkantype real) \ - { \ - TypedRealHandle h; \ - h.type = (VkResourceType)Outer::TypeEnum; \ - h.real = RealVkRes((void *)real); \ - return h; \ - } \ - static Outer *FromHandle(vulkantype wrapped) { return (Outer *)wrapped; } \ +#define UNWRAP_HELPER(vulkantype) \ + template <> \ + struct UnwrapHelper \ + { \ + typedef WrappedVkDispRes ParentType; \ + enum \ + { \ + DispatchableType = 1 \ + }; \ + typedef CONCAT(Wrapped, vulkantype) Outer; \ + static TypedRealHandle ToTypedHandle(vulkantype real) \ + { \ + TypedRealHandle h; \ + h.type = (VkResourceType)Outer::TypeEnum; \ + h.real = RealVkRes((void *)real); \ + return h; \ + } \ + static Outer *FromHandle(vulkantype wrapped) \ + { \ + return (Outer *)wrapped; \ + } \ }; #define UNWRAP_NONDISP_HELPER(vulkantype) \ diff --git a/renderdoc/driver/vulkan/vk_serialise.cpp b/renderdoc/driver/vulkan/vk_serialise.cpp index 70ef52349..87b7271b8 100644 --- a/renderdoc/driver/vulkan/vk_serialise.cpp +++ b/renderdoc/driver/vulkan/vk_serialise.cpp @@ -171,9 +171,8 @@ DECL_VKFLAG_EXT(VkPresentGravity, EXT); // serialise a member as flags - cast to the Bits enum for serialisation so the stringification // picks up the bitfield and doesn't treat it as uint32_t. Then we rename the type back to the base // flags type so the structured data is as accurate as possible. -#define SERIALISE_MEMBER_VKFLAGS(flagstype, name) \ - SERIALISE_MEMBER_TYPED(CONCAT(flagstype, Bits), name) \ - .TypedAs(STRING_LITERAL(STRINGIZE(flagstype))) +#define SERIALISE_MEMBER_VKFLAGS(flagstype, name) \ + SERIALISE_MEMBER_TYPED(CONCAT(flagstype, Bits), name).TypedAs(STRING_LITERAL(STRINGIZE(flagstype))) #define SERIALISE_MEMBER_ARRAY_VKFLAGS(flagstype, name, count) \ SERIALISE_MEMBER_ARRAY_TYPED(CONCAT(flagstype, Bits), name, count) \ @@ -5287,13 +5286,13 @@ void DoSerialise(SerialiserType &ser, VkDescriptorUpdateTemplateEntry &el) SERIALISE_MEMBER(descriptorCount); SERIALISE_MEMBER(descriptorType); -// these fields are size_t and should not be serialised as-is. They're not used so we can just -// serialise them as uint64_t. Unfortunately this wasn't correct initially and they were -// serialised as-is making a 32-bit/64-bit incompatibility, so for older versions all we can do is -// continue to serialise them as size_t as it's impossible to know which one was used. -// -// On mac we can't compile a size_t serialise, which is good in general but makes this backwards -// compatibility a bit more annoying. We just assume a 64-bit capture. + // these fields are size_t and should not be serialised as-is. They're not used so we can just + // serialise them as uint64_t. Unfortunately this wasn't correct initially and they were + // serialised as-is making a 32-bit/64-bit incompatibility, so for older versions all we can do is + // continue to serialise them as size_t as it's impossible to know which one was used. + // + // On mac we can't compile a size_t serialise, which is good in general but makes this backwards + // compatibility a bit more annoying. We just assume a 64-bit capture. #if DISABLED(RDOC_APPLE) if(ser.VersionAtLeast(0xE)) diff --git a/renderdoc/driver/vulkan/vk_shader_feedback.cpp b/renderdoc/driver/vulkan/vk_shader_feedback.cpp index f7fbf7703..eef6cf266 100644 --- a/renderdoc/driver/vulkan/vk_shader_feedback.cpp +++ b/renderdoc/driver/vulkan/vk_shader_feedback.cpp @@ -642,8 +642,8 @@ void AnnotateShader(const ShaderReflection &refl, const SPIRVPatchData &patchDat rdcarray idxs; auto fetchOrAddGlobalInput = [&editor, &idxs, &refl, &patchData, &locationGather, &newGlobals]( - const char *name, ShaderBuiltin builtin, rdcspv::BuiltIn spvBuiltin, rdcspv::Id varType, - bool integer) { + const char *name, ShaderBuiltin builtin, + rdcspv::BuiltIn spvBuiltin, rdcspv::Id varType, bool integer) { rdcspv::Id ret; rdcspv::Id ptrType = editor.DeclareType(rdcspv::Pointer(varType, rdcspv::StorageClass::Input)); @@ -1681,7 +1681,9 @@ bool VulkanReplay::FetchShaderFeedback(uint32_t eventId) VkDescriptorSetLayoutBinding newBindings[] = { // output buffer { - 0, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, + 0, + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, + 1, VkShaderStageFlags(result.compute ? VK_SHADER_STAGE_COMPUTE_BIT : VK_SHADER_STAGE_ALL_GRAPHICS), NULL, diff --git a/renderdoc/driver/vulkan/vk_shaderdebug.cpp b/renderdoc/driver/vulkan/vk_shaderdebug.cpp index 3cffb23d0..3aa73ceab 100644 --- a/renderdoc/driver/vulkan/vk_shaderdebug.cpp +++ b/renderdoc/driver/vulkan/vk_shaderdebug.cpp @@ -1229,19 +1229,40 @@ public: VkWriteDescriptorSet writeSets[] = { { - VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, NULL, Unwrap(m_DebugData.DescSet), - (uint32_t)ShaderDebugBind::Constants, 0, 1, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, NULL, - &uniformWriteInfo, NULL, + VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, + NULL, + Unwrap(m_DebugData.DescSet), + (uint32_t)ShaderDebugBind::Constants, + 0, + 1, + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, + NULL, + &uniformWriteInfo, + NULL, }, { - VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, NULL, Unwrap(m_DebugData.DescSet), - (uint32_t)constParams.dim, 0, 1, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, &imageWriteInfo, - NULL, NULL, + VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, + NULL, + Unwrap(m_DebugData.DescSet), + (uint32_t)constParams.dim, + 0, + 1, + VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, + &imageWriteInfo, + NULL, + NULL, }, { - VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, NULL, Unwrap(m_DebugData.DescSet), - (uint32_t)ShaderDebugBind::Sampler, 0, 1, VK_DESCRIPTOR_TYPE_SAMPLER, &samplerWriteInfo, - NULL, NULL, + VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, + NULL, + Unwrap(m_DebugData.DescSet), + (uint32_t)ShaderDebugBind::Sampler, + 0, + 1, + VK_DESCRIPTOR_TYPE_SAMPLER, + &samplerWriteInfo, + NULL, + NULL, }, }; @@ -1409,9 +1430,16 @@ public: VkWriteDescriptorSet writeSets[] = { { - VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, NULL, Unwrap(m_DebugData.DescSet), - (uint32_t)ShaderDebugBind::MathResult, 0, 1, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, NULL, - &storageWriteInfo, NULL, + VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, + NULL, + Unwrap(m_DebugData.DescSet), + (uint32_t)ShaderDebugBind::MathResult, + 0, + 1, + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, + NULL, + &storageWriteInfo, + NULL, }, }; @@ -1851,7 +1879,10 @@ private: }; const VkPipelineMultisampleStateCreateInfo msaa = { - VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, NULL, 0, VK_SAMPLE_COUNT_1_BIT, + VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, + NULL, + 0, + VK_SAMPLE_COUNT_1_BIT, }; const VkPipelineDepthStencilStateCreateInfo depthStencil = { @@ -2027,8 +2058,10 @@ private: func.add(rdcspv::OpLabel(editor.MakeId())); rdcspv::Id consts[] = { - editor.AddConstantImmediate(0), editor.AddConstantImmediate(1), - editor.AddConstantImmediate(2), editor.AddConstantImmediate(3), + editor.AddConstantImmediate(0), + editor.AddConstantImmediate(1), + editor.AddConstantImmediate(2), + editor.AddConstantImmediate(3), }; rdcspv::Id zerof; @@ -4355,20 +4388,28 @@ ShaderDebugTrace *VulkanReplay::DebugPixel(uint32_t eventId, uint32_t x, uint32_ VkSpecializationMapEntry specMaps[] = { { - (uint32_t)InputSpecConstant::Address, offsetof(SpecData, bufferAddress), sizeof(uint32_t), + (uint32_t)InputSpecConstant::Address, + offsetof(SpecData, bufferAddress), + sizeof(uint32_t), }, { - (uint32_t)InputSpecConstant::ArrayLength, offsetof(SpecData, arrayLength), + (uint32_t)InputSpecConstant::ArrayLength, + offsetof(SpecData, arrayLength), sizeof(SpecData::arrayLength), }, { - (uint32_t)InputSpecConstant::DestX, offsetof(SpecData, destX), sizeof(SpecData::destX), + (uint32_t)InputSpecConstant::DestX, + offsetof(SpecData, destX), + sizeof(SpecData::destX), }, { - (uint32_t)InputSpecConstant::DestY, offsetof(SpecData, destY), sizeof(SpecData::destY), + (uint32_t)InputSpecConstant::DestY, + offsetof(SpecData, destY), + sizeof(SpecData::destY), }, { - (uint32_t)InputSpecConstant::AddressMSB, offsetof(SpecData, bufferAddress) + 4, + (uint32_t)InputSpecConstant::AddressMSB, + offsetof(SpecData, bufferAddress) + 4, sizeof(uint32_t), }, }; diff --git a/renderdoc/driver/vulkan/vk_state.cpp b/renderdoc/driver/vulkan/vk_state.cpp index c12f8faea..792ed8e5a 100644 --- a/renderdoc/driver/vulkan/vk_state.cpp +++ b/renderdoc/driver/vulkan/vk_state.cpp @@ -95,8 +95,10 @@ void setupRenderingInfo(const VulkanRenderState::DynamicRendering &dynamicRender } structs->fragmentDensity = { - VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT, NULL, - Unwrap(dynamicRendering.fragmentDensityView), dynamicRendering.fragmentDensityLayout, + VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT, + NULL, + Unwrap(dynamicRendering.fragmentDensityView), + dynamicRendering.fragmentDensityLayout, }; if(dynamicRendering.fragmentDensityView != VK_NULL_HANDLE) @@ -120,8 +122,10 @@ void setupRenderingInfo(const VulkanRenderState::DynamicRendering &dynamicRender } structs->tileOnlyMSAA = { - VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_EXT, NULL, - dynamicRendering.tileOnlyMSAAEnable, dynamicRendering.tileOnlyMSAASampleCount, + VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_EXT, + NULL, + dynamicRendering.tileOnlyMSAAEnable, + dynamicRendering.tileOnlyMSAASampleCount, }; if(dynamicRendering.tileOnlyMSAAEnable) diff --git a/renderdoc/driver/vulkan/vk_state.h b/renderdoc/driver/vulkan/vk_state.h index 3cc591fe5..a1efa0623 100644 --- a/renderdoc/driver/vulkan/vk_state.h +++ b/renderdoc/driver/vulkan/vk_state.h @@ -245,7 +245,8 @@ struct VulkanRenderState // shading rate VkExtent2D pipelineShadingRate = {1, 1}; VkFragmentShadingRateCombinerOpKHR shadingRateCombiners[2] = { - VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR, VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR, + VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR, + VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR, }; // attachment feedback loop diff --git a/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp index 41390d2cc..5055ee5e2 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp @@ -572,8 +572,8 @@ rdcstr WrappedVulkan::MakeRenderPassOpString(bool store) if(atts[dsAttach].storeOp == atts[dsAttach].stencilStoreOp) opDesc += "DS=" + ToHumanStr(atts[dsAttach].storeOp); else - opDesc += "D=" + ToHumanStr(atts[dsAttach].storeOp) + ", S=" + - ToHumanStr(atts[dsAttach].stencilStoreOp); + opDesc += "D=" + ToHumanStr(atts[dsAttach].storeOp) + + ", S=" + ToHumanStr(atts[dsAttach].stencilStoreOp); } else { @@ -581,8 +581,8 @@ rdcstr WrappedVulkan::MakeRenderPassOpString(bool store) if(atts[dsAttach].loadOp == atts[dsAttach].stencilLoadOp) opDesc += "DS=" + ToHumanStr(atts[dsAttach].loadOp); else - opDesc += "D=" + ToHumanStr(atts[dsAttach].loadOp) + ", S=" + - ToHumanStr(atts[dsAttach].stencilLoadOp); + opDesc += "D=" + ToHumanStr(atts[dsAttach].loadOp) + + ", S=" + ToHumanStr(atts[dsAttach].stencilLoadOp); } } } @@ -1528,7 +1528,8 @@ bool WrappedVulkan::Serialise_vkEndCommandBuffer(SerialiserType &ser, VkCommandB info.pColorAttachments = renderstate.dynamicRendering.color.data(); VkRenderingFragmentDensityMapAttachmentInfoEXT fragmentDensity = { - VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT, NULL, + VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT, + NULL, renderstate.dynamicRendering.fragmentDensityView, renderstate.dynamicRendering.fragmentDensityLayout, }; @@ -1554,7 +1555,8 @@ bool WrappedVulkan::Serialise_vkEndCommandBuffer(SerialiserType &ser, VkCommandB } VkMultisampledRenderToSingleSampledInfoEXT tileOnlyMSAA = { - VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_EXT, NULL, + VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_EXT, + NULL, renderstate.dynamicRendering.tileOnlyMSAAEnable, renderstate.dynamicRendering.tileOnlyMSAASampleCount, }; @@ -3798,9 +3800,7 @@ bool WrappedVulkan::Serialise_vkCmdPushConstants(SerialiserType &ser, VkCommandB { SERIALISE_ELEMENT(commandBuffer); SERIALISE_ELEMENT(layout); - SERIALISE_ELEMENT_TYPED(VkShaderStageFlagBits, stageFlags) - .TypedAs("VkShaderStageFlags"_lit) - .Important(); + SERIALISE_ELEMENT_TYPED(VkShaderStageFlagBits, stageFlags).TypedAs("VkShaderStageFlags"_lit).Important(); SERIALISE_ELEMENT(start); SERIALISE_ELEMENT(length); SERIALISE_ELEMENT_ARRAY(values, length).Important(); diff --git a/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp index a9c9e6c8c..a47e7c531 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp @@ -3717,8 +3717,10 @@ bool WrappedVulkan::Serialise_vkCreateDevice(SerialiserType &ser, VkPhysicalDevi ImageBarrierSequence::SetMaxQueueFamilyIndex(qidx); VkCommandPoolCreateInfo poolInfo = { - VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, NULL, - VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, qidx, + VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, + NULL, + VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, + qidx, }; vkr = ObjDisp(device)->CreateCommandPool(Unwrap(device), &poolInfo, NULL, &m_ExternalQueues[qidx].pool); @@ -4165,8 +4167,10 @@ VkResult WrappedVulkan::vkCreateDevice(VkPhysicalDevice physicalDevice, ImageBarrierSequence::SetMaxQueueFamilyIndex(qidx); VkCommandPoolCreateInfo poolInfo = { - VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, NULL, - VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, qidx, + VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, + NULL, + VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, + qidx, }; vkr = ObjDisp(device)->CreateCommandPool(Unwrap(device), &poolInfo, NULL, &m_ExternalQueues[qidx].pool); diff --git a/renderdoc/driver/vulkan/wrappers/vk_draw_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_draw_funcs.cpp index 1ee6d6925..333dc76f3 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_draw_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_draw_funcs.cpp @@ -2400,10 +2400,9 @@ bool WrappedVulkan::Serialise_vkCmdClearDepthStencilImage( ->CmdClearDepthStencilImage(Unwrap(commandBuffer), Unwrap(image), imageLayout, &DepthStencil, rangeCount, pRanges); - if(eventId && - m_ActionCallback->PostMisc( - eventId, ActionFlags(ActionFlags::Clear | ActionFlags::ClearDepthStencil), - commandBuffer)) + if(eventId && m_ActionCallback->PostMisc( + eventId, ActionFlags(ActionFlags::Clear | ActionFlags::ClearDepthStencil), + commandBuffer)) { ObjDisp(commandBuffer) ->CmdClearDepthStencilImage(Unwrap(commandBuffer), Unwrap(image), imageLayout, diff --git a/renderdoc/driver/vulkan/wrappers/vk_dynamic_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_dynamic_funcs.cpp index 9022b5f22..976dd0109 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_dynamic_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_dynamic_funcs.cpp @@ -539,9 +539,7 @@ bool WrappedVulkan::Serialise_vkCmdSetStencilCompareMask(SerialiserType &ser, uint32_t compareMask) { SERIALISE_ELEMENT(commandBuffer); - SERIALISE_ELEMENT_TYPED(VkStencilFaceFlagBits, faceMask) - .TypedAs("VkStencilFaceFlags"_lit) - .Important(); + SERIALISE_ELEMENT_TYPED(VkStencilFaceFlagBits, faceMask).TypedAs("VkStencilFaceFlags"_lit).Important(); SERIALISE_ELEMENT(compareMask).Important(); Serialise_DebugMessages(ser); @@ -607,9 +605,7 @@ bool WrappedVulkan::Serialise_vkCmdSetStencilWriteMask(SerialiserType &ser, uint32_t writeMask) { SERIALISE_ELEMENT(commandBuffer); - SERIALISE_ELEMENT_TYPED(VkStencilFaceFlagBits, faceMask) - .TypedAs("VkStencilFaceFlags"_lit) - .Important(); + SERIALISE_ELEMENT_TYPED(VkStencilFaceFlagBits, faceMask).TypedAs("VkStencilFaceFlags"_lit).Important(); SERIALISE_ELEMENT(writeMask).Important(); Serialise_DebugMessages(ser); @@ -675,9 +671,7 @@ bool WrappedVulkan::Serialise_vkCmdSetStencilReference(SerialiserType &ser, uint32_t reference) { SERIALISE_ELEMENT(commandBuffer); - SERIALISE_ELEMENT_TYPED(VkStencilFaceFlagBits, faceMask) - .TypedAs("VkStencilFaceFlags"_lit) - .Important(); + SERIALISE_ELEMENT_TYPED(VkStencilFaceFlagBits, faceMask).TypedAs("VkStencilFaceFlags"_lit).Important(); SERIALISE_ELEMENT(reference).Important(); Serialise_DebugMessages(ser); @@ -742,9 +736,7 @@ bool WrappedVulkan::Serialise_vkCmdSetSampleLocationsEXT( const VkSampleLocationsInfoEXT *pSampleLocationsInfo) { SERIALISE_ELEMENT(commandBuffer); - SERIALISE_ELEMENT_LOCAL(sampleInfo, *pSampleLocationsInfo) - .Named("pSampleLocationsInfo"_lit) - .Important(); + SERIALISE_ELEMENT_LOCAL(sampleInfo, *pSampleLocationsInfo).Named("pSampleLocationsInfo"_lit).Important(); Serialise_DebugMessages(ser); diff --git a/renderdoc/driver/vulkan/wrappers/vk_misc_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_misc_funcs.cpp index a648a5372..fffa02bc7 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_misc_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_misc_funcs.cpp @@ -2028,9 +2028,7 @@ static ObjData GetObjData(VkObjectType objType, uint64_t object) // VkDisplayKHR, VkDisplayModeKHR, and VkValidationCacheEXT are not wrapped case VK_OBJECT_TYPE_DISPLAY_KHR: case VK_OBJECT_TYPE_DISPLAY_MODE_KHR: - case VK_OBJECT_TYPE_VALIDATION_CACHE_EXT: - ret.unwrapped = object; - break; + case VK_OBJECT_TYPE_VALIDATION_CACHE_EXT: ret.unwrapped = object; break; // debug report callback and messenger are not wrapped in the conventional way case VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT: @@ -2048,9 +2046,7 @@ static ObjData GetObjData(VkObjectType objType, uint64_t object) } // private data slots are not wrapped - case VK_OBJECT_TYPE_PRIVATE_DATA_SLOT: - ret.unwrapped = object; - break; + case VK_OBJECT_TYPE_PRIVATE_DATA_SLOT: ret.unwrapped = object; break; // these objects are not supported case VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR: diff --git a/renderdoc/driver/vulkan/wrappers/vk_resource_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_resource_funcs.cpp index 1448b3681..53249aec6 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_resource_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_resource_funcs.cpp @@ -639,7 +639,9 @@ VkResult WrappedVulkan::vkAllocateMemory(VkDevice device, const VkMemoryAllocate if(memFlags && (memFlags->flags & VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT)) { VkDeviceMemoryOpaqueCaptureAddressInfo getInfo = { - VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO, NULL, Unwrap(*pMemory), + VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO, + NULL, + Unwrap(*pMemory), }; memoryDeviceAddress.opaqueCaptureAddress = @@ -1415,7 +1417,9 @@ bool WrappedVulkan::Serialise_vkBindBufferMemory(SerialiserType &ser, VkDevice d if(bufInfo.usage & VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT) { VkBufferDeviceAddressInfo getInfo = { - VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO, NULL, Unwrap(buffer), + VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO, + NULL, + Unwrap(buffer), }; RDCCOMPILE_ASSERT(VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO == @@ -1755,7 +1759,9 @@ VkResult WrappedVulkan::vkCreateBuffer(VkDevice device, const VkBufferCreateInfo if((pCreateInfo->usage & VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT) != 0) { VkBufferDeviceAddressInfo getInfo = { - VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO, NULL, Unwrap(*pBuffer), + VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO, + NULL, + Unwrap(*pBuffer), }; if(GetExtensions(GetRecord(device)).ext_KHR_buffer_device_address) @@ -2825,7 +2831,9 @@ bool WrappedVulkan::Serialise_vkBindBufferMemory2(SerialiserType &ser, VkDevice if(bufInfo.usage & VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT) { VkBufferDeviceAddressInfo getInfo = { - VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO, NULL, Unwrap(bindInfo.buffer), + VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO, + NULL, + Unwrap(bindInfo.buffer), }; if(GetExtensions(GetRecord(device)).ext_KHR_buffer_device_address) diff --git a/renderdoc/driver/vulkan/wrappers/vk_sync_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_sync_funcs.cpp index 20942bb2b..82d93e10f 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_sync_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_sync_funcs.cpp @@ -822,7 +822,9 @@ bool WrappedVulkan::Serialise_vkCmdWaitEvents( // see top of this file for current event/fence handling VkEventCreateInfo evInfo = { - VK_STRUCTURE_TYPE_EVENT_CREATE_INFO, NULL, 0, + VK_STRUCTURE_TYPE_EVENT_CREATE_INFO, + NULL, + 0, }; if(IsActiveReplaying(m_State)) @@ -1347,7 +1349,9 @@ bool WrappedVulkan::Serialise_vkCmdWaitEvents2(SerialiserType &ser, VkCommandBuf if(commandBuffer != VK_NULL_HANDLE) { VkEventCreateInfo evInfo = { - VK_STRUCTURE_TYPE_EVENT_CREATE_INFO, NULL, 0, + VK_STRUCTURE_TYPE_EVENT_CREATE_INFO, + NULL, + 0, }; // don't wrap this event diff --git a/renderdoc/driver/vulkan/wrappers/vk_wsi_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_wsi_funcs.cpp index e5024d51a..448d360ed 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_wsi_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_wsi_funcs.cpp @@ -152,7 +152,9 @@ VkResult WrappedVulkan::vkRegisterDeviceEventEXT(VkDevice device, CACHE_THREAD_SERIALISER(); VkFenceCreateInfo createInfo = { - VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, NULL, VK_FENCE_CREATE_SIGNALED_BIT, + VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, + NULL, + VK_FENCE_CREATE_SIGNALED_BIT, }; SCOPED_SERIALISE_CHUNK(VulkanChunk::vkRegisterDeviceEventEXT); @@ -196,7 +198,9 @@ VkResult WrappedVulkan::vkRegisterDisplayEventEXT(VkDevice device, VkDisplayKHR CACHE_THREAD_SERIALISER(); VkFenceCreateInfo createInfo = { - VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, NULL, VK_FENCE_CREATE_SIGNALED_BIT, + VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, + NULL, + VK_FENCE_CREATE_SIGNALED_BIT, }; SCOPED_SERIALISE_CHUNK(VulkanChunk::vkRegisterDisplayEventEXT); @@ -421,7 +425,9 @@ bool WrappedVulkan::Serialise_vkCreateSwapchainKHR(SerialiserType &ser, VkDevice ObjDisp(device)->GetImageMemoryRequirements(Unwrap(device), Unwrap(im), &mrq); VkMemoryAllocateInfo allocInfo = { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, mrq.size, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, + NULL, + mrq.size, GetGPULocalMemoryIndex(mrq.memoryTypeBits), }; diff --git a/renderdoc/maths/formatpacking.cpp b/renderdoc/maths/formatpacking.cpp index c2f185985..16e3ef65d 100644 --- a/renderdoc/maths/formatpacking.cpp +++ b/renderdoc/maths/formatpacking.cpp @@ -80,7 +80,9 @@ Vec3f ConvertFromR9G9B9E5(uint32_t data) { // get mantissas uint32_t mantissas[] = { - ((data >> 0) & 0x1ff), ((data >> 9) & 0x1ff), ((data >> 18) & 0x1ff), + ((data >> 0) & 0x1ff), + ((data >> 9) & 0x1ff), + ((data >> 18) & 0x1ff), }; // get shared exponent @@ -155,10 +157,14 @@ uint32_t ConvertToR9G9B9E5(Vec3f data) Vec3f ConvertFromR11G11B10(uint32_t data) { uint32_t mantissas[3] = { - (data >> 0) & 0x3f, (data >> 11) & 0x3f, (data >> 22) & 0x1f, + (data >> 0) & 0x3f, + (data >> 11) & 0x3f, + (data >> 22) & 0x1f, }; int32_t exponents[3] = { - int32_t(data >> 6) & 0x1f, int32_t(data >> 17) & 0x1f, int32_t(data >> 27) & 0x1f, + int32_t(data >> 6) & 0x1f, + int32_t(data >> 17) & 0x1f, + int32_t(data >> 27) & 0x1f, }; Vec3f ret; @@ -217,18 +223,26 @@ uint32_t ConvertToR11G11B10(Vec3f data) { // convert each component to half first uint16_t halves[3] = { - ConvertToHalf(data.x), ConvertToHalf(data.y), ConvertToHalf(data.z), + ConvertToHalf(data.x), + ConvertToHalf(data.y), + ConvertToHalf(data.z), }; // extract mantissas, exponents, signs bool signs[3] = { - (halves[0] & 0x8000) != 0, (halves[1] & 0x8000) != 0, (halves[2] & 0x8000) != 0, + (halves[0] & 0x8000) != 0, + (halves[1] & 0x8000) != 0, + (halves[2] & 0x8000) != 0, }; uint32_t mantissas[3] = { - (halves[0] & 0x03FFU), (halves[1] & 0x03FFU), (halves[2] & 0x03FFU), + (halves[0] & 0x03FFU), + (halves[1] & 0x03FFU), + (halves[2] & 0x03FFU), }; uint32_t exponents[3] = { - (halves[0] & 0x7C00U) >> 10, (halves[1] & 0x7C00U) >> 10, (halves[2] & 0x7C00U) >> 10, + (halves[0] & 0x7C00U) >> 10, + (halves[1] & 0x7C00U) >> 10, + (halves[2] & 0x7C00U) >> 10, }; // normalise NaN/inf values so we can truncate mantissa without converting NaN to inf @@ -1388,10 +1402,7 @@ TEST_CASE("Check format conversion", "[format]") ((uint32_t((re)&0x1f) << 6) | (uint32_t((ge)&0x1f) << 17) | (uint32_t((be)&0x1f) << 27) | \ uint32_t((rm)&0x3f) << 0 | uint32_t((gm)&0x3f) << 11 | uint32_t((bm)&0x1f) << 22) -#define TEST11(e, m, f) \ - { \ - R11G11B10(e, m, 0, 0, 0, 0), Vec3f(f, 0.0f, 0.0f) \ - } +#define TEST11(e, m, f) {R11G11B10(e, m, 0, 0, 0, 0), Vec3f(f, 0.0f, 0.0f)} #define TEST10(e, m, f) \ { \ R11G11B10(0, 0, 0, 0, e, m), Vec3f(0.0f, 0.0f, f) \ @@ -1493,9 +1504,10 @@ TEST_CASE("Check format conversion", "[format]") SECTION("Spot test ConvertToR11G11B10") { #undef TEST11 -#define TEST11(f, e, m) \ - { \ - Vec3f(f, 0.0f, 0.0f), R11G11B10(e, m, 0, 0, 0, 0), \ +#define TEST11(f, e, m) \ + { \ + Vec3f(f, 0.0f, 0.0f), \ + R11G11B10(e, m, 0, 0, 0, 0), \ } #undef TEST10 diff --git a/renderdoc/os/posix/android/android_hook.cpp b/renderdoc/os/posix/android/android_hook.cpp index 2f6032ca6..e96e3c3ca 100644 --- a/renderdoc/os/posix/android/android_hook.cpp +++ b/renderdoc/os/posix/android/android_hook.cpp @@ -40,7 +40,7 @@ #include // uncomment the following to print (very verbose) debugging prints for the android PLT hooking -//#define HOOK_DEBUG_PRINT(...) RDCLOG(__VA_ARGS__) +// #define HOOK_DEBUG_PRINT(...) RDCLOG(__VA_ARGS__) #if !defined(HOOK_DEBUG_PRINT) #define HOOK_DEBUG_PRINT(...) \ diff --git a/renderdoc/os/posix/linux/linux_process.cpp b/renderdoc/os/posix/linux/linux_process.cpp index 9757d9e6d..488dfedb9 100644 --- a/renderdoc/os/posix/linux/linux_process.cpp +++ b/renderdoc/os/posix/linux/linux_process.cpp @@ -47,8 +47,7 @@ RDOC_CONFIG(bool, Linux_PtraceChildProcesses, true, "Use ptrace(2) to trace child processes at startup to ensure connection is made as " "early as possible."); -RDOC_CONFIG(bool, Linux_Debug_PtraceLogging, false, - "Enable verbose debug logging of ptrace usage."); +RDOC_CONFIG(bool, Linux_Debug_PtraceLogging, false, "Enable verbose debug logging of ptrace usage."); extern char **environ; diff --git a/renderdoc/os/posix/posix_process.cpp b/renderdoc/os/posix/posix_process.cpp index 6baca1269..01cc81c8a 100644 --- a/renderdoc/os/posix/posix_process.cpp +++ b/renderdoc/os/posix/posix_process.cpp @@ -33,7 +33,6 @@ #include #include #include -//#include "api/app/renderdoc_app.h" #include "api/replay/capture_options.h" #include "api/replay/control_types.h" #include "common/formatting.h" diff --git a/renderdoc/os/posix/posix_threading.cpp b/renderdoc/os/posix/posix_threading.cpp index 90d7b9a88..14f1f2ff5 100644 --- a/renderdoc/os/posix/posix_threading.cpp +++ b/renderdoc/os/posix/posix_threading.cpp @@ -251,7 +251,7 @@ void SetTLSValue(uint64_t slot, void *value) } if(slot - 1 >= slots->data.size()) - slots->data.resize((size_t)slot); + slots->data.resize((size_t)slot); } slots->data[(size_t)slot - 1] = value; diff --git a/renderdoc/os/win32/dia2_stubs.h b/renderdoc/os/win32/dia2_stubs.h index 04394c537..ad01bed85 100644 --- a/renderdoc/os/win32/dia2_stubs.h +++ b/renderdoc/os/win32/dia2_stubs.h @@ -25,7 +25,7 @@ #pragma once // Inline the couple of necessary definitions from dia2.h below -//#include +// #include // don't need these struct IDiaEnumSymbols; diff --git a/renderdoc/os/win32/sys_win32_hooks.cpp b/renderdoc/os/win32/sys_win32_hooks.cpp index aaa82ef07..e306fa399 100644 --- a/renderdoc/os/win32/sys_win32_hooks.cpp +++ b/renderdoc/os/win32/sys_win32_hooks.cpp @@ -197,12 +197,13 @@ private: return syshooks.WSACleanup()(); } - static BOOL WINAPI Hooked_CreateProcess( - const char *entryPoint, std::function - realFunc, - DWORD dwCreationFlags, bool inject, LPVOID pEnvironment, - LPPROCESS_INFORMATION lpProcessInformation) + static BOOL WINAPI + Hooked_CreateProcess(const char *entryPoint, + std::function + realFunc, + DWORD dwCreationFlags, bool inject, LPVOID pEnvironment, + LPPROCESS_INFORMATION lpProcessInformation) { bool recursive = syshooks.CheckRecurse(); @@ -409,15 +410,15 @@ private: __in DWORD dwCreationFlags, __in_opt LPVOID lpEnvironment, __in_opt LPCSTR lpCurrentDirectory, __in LPSTARTUPINFOA lpStartupInfo, __out LPPROCESS_INFORMATION lpProcessInformation) { - return Hooked_CreateProcess("CreateProcessA", - [=](DWORD flags, LPVOID env, LPPROCESS_INFORMATION pi) { - return syshooks.API110CreateProcessA()( - lpApplicationName, lpCommandLine, lpProcessAttributes, - lpThreadAttributes, bInheritHandles, flags, env, - lpCurrentDirectory, lpStartupInfo, pi); - }, - dwCreationFlags, ShouldInject(lpApplicationName, lpCommandLine), - lpEnvironment, lpProcessInformation); + return Hooked_CreateProcess( + "CreateProcessA", + [=](DWORD flags, LPVOID env, LPPROCESS_INFORMATION pi) { + return syshooks.API110CreateProcessA()( + lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, + bInheritHandles, flags, env, lpCurrentDirectory, lpStartupInfo, pi); + }, + dwCreationFlags, ShouldInject(lpApplicationName, lpCommandLine), lpEnvironment, + lpProcessInformation); } static BOOL WINAPI API110CreateProcessW_hook( @@ -427,15 +428,15 @@ private: __in DWORD dwCreationFlags, __in_opt LPVOID lpEnvironment, __in_opt LPCWSTR lpCurrentDirectory, __in LPSTARTUPINFOW lpStartupInfo, __out LPPROCESS_INFORMATION lpProcessInformation) { - return Hooked_CreateProcess("CreateProcessW", - [=](DWORD flags, LPVOID env, LPPROCESS_INFORMATION pi) { - return syshooks.API110CreateProcessW()( - lpApplicationName, lpCommandLine, lpProcessAttributes, - lpThreadAttributes, bInheritHandles, flags, env, - lpCurrentDirectory, lpStartupInfo, pi); - }, - dwCreationFlags, ShouldInject(lpApplicationName, lpCommandLine), - lpEnvironment, lpProcessInformation); + return Hooked_CreateProcess( + "CreateProcessW", + [=](DWORD flags, LPVOID env, LPPROCESS_INFORMATION pi) { + return syshooks.API110CreateProcessW()( + lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, + bInheritHandles, flags, env, lpCurrentDirectory, lpStartupInfo, pi); + }, + dwCreationFlags, ShouldInject(lpApplicationName, lpCommandLine), lpEnvironment, + lpProcessInformation); } static BOOL WINAPI API111CreateProcessA_hook( @@ -445,15 +446,15 @@ private: __in DWORD dwCreationFlags, __in_opt LPVOID lpEnvironment, __in_opt LPCSTR lpCurrentDirectory, __in LPSTARTUPINFOA lpStartupInfo, __out LPPROCESS_INFORMATION lpProcessInformation) { - return Hooked_CreateProcess("CreateProcessA", - [=](DWORD flags, LPVOID env, LPPROCESS_INFORMATION pi) { - return syshooks.API111CreateProcessA()( - lpApplicationName, lpCommandLine, lpProcessAttributes, - lpThreadAttributes, bInheritHandles, flags, env, - lpCurrentDirectory, lpStartupInfo, pi); - }, - dwCreationFlags, ShouldInject(lpApplicationName, lpCommandLine), - lpEnvironment, lpProcessInformation); + return Hooked_CreateProcess( + "CreateProcessA", + [=](DWORD flags, LPVOID env, LPPROCESS_INFORMATION pi) { + return syshooks.API111CreateProcessA()( + lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, + bInheritHandles, flags, env, lpCurrentDirectory, lpStartupInfo, pi); + }, + dwCreationFlags, ShouldInject(lpApplicationName, lpCommandLine), lpEnvironment, + lpProcessInformation); } static BOOL WINAPI API111CreateProcessW_hook( @@ -463,15 +464,15 @@ private: __in DWORD dwCreationFlags, __in_opt LPVOID lpEnvironment, __in_opt LPCWSTR lpCurrentDirectory, __in LPSTARTUPINFOW lpStartupInfo, __out LPPROCESS_INFORMATION lpProcessInformation) { - return Hooked_CreateProcess("CreateProcessW", - [=](DWORD flags, LPVOID env, LPPROCESS_INFORMATION pi) { - return syshooks.API111CreateProcessW()( - lpApplicationName, lpCommandLine, lpProcessAttributes, - lpThreadAttributes, bInheritHandles, flags, env, - lpCurrentDirectory, lpStartupInfo, pi); - }, - dwCreationFlags, ShouldInject(lpApplicationName, lpCommandLine), - lpEnvironment, lpProcessInformation); + return Hooked_CreateProcess( + "CreateProcessW", + [=](DWORD flags, LPVOID env, LPPROCESS_INFORMATION pi) { + return syshooks.API111CreateProcessW()( + lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, + bInheritHandles, flags, env, lpCurrentDirectory, lpStartupInfo, pi); + }, + dwCreationFlags, ShouldInject(lpApplicationName, lpCommandLine), lpEnvironment, + lpProcessInformation); } static BOOL WINAPI API112CreateProcessA_hook( @@ -481,15 +482,15 @@ private: __in DWORD dwCreationFlags, __in_opt LPVOID lpEnvironment, __in_opt LPCSTR lpCurrentDirectory, __in LPSTARTUPINFOA lpStartupInfo, __out LPPROCESS_INFORMATION lpProcessInformation) { - return Hooked_CreateProcess("CreateProcessA", - [=](DWORD flags, LPVOID env, LPPROCESS_INFORMATION pi) { - return syshooks.API112CreateProcessA()( - lpApplicationName, lpCommandLine, lpProcessAttributes, - lpThreadAttributes, bInheritHandles, flags, env, - lpCurrentDirectory, lpStartupInfo, pi); - }, - dwCreationFlags, ShouldInject(lpApplicationName, lpCommandLine), - lpEnvironment, lpProcessInformation); + return Hooked_CreateProcess( + "CreateProcessA", + [=](DWORD flags, LPVOID env, LPPROCESS_INFORMATION pi) { + return syshooks.API112CreateProcessA()( + lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, + bInheritHandles, flags, env, lpCurrentDirectory, lpStartupInfo, pi); + }, + dwCreationFlags, ShouldInject(lpApplicationName, lpCommandLine), lpEnvironment, + lpProcessInformation); } static BOOL WINAPI API112CreateProcessW_hook( @@ -499,15 +500,15 @@ private: __in DWORD dwCreationFlags, __in_opt LPVOID lpEnvironment, __in_opt LPCWSTR lpCurrentDirectory, __in LPSTARTUPINFOW lpStartupInfo, __out LPPROCESS_INFORMATION lpProcessInformation) { - return Hooked_CreateProcess("CreateProcessW", - [=](DWORD flags, LPVOID env, LPPROCESS_INFORMATION pi) { - return syshooks.API112CreateProcessW()( - lpApplicationName, lpCommandLine, lpProcessAttributes, - lpThreadAttributes, bInheritHandles, flags, env, - lpCurrentDirectory, lpStartupInfo, pi); - }, - dwCreationFlags, ShouldInject(lpApplicationName, lpCommandLine), - lpEnvironment, lpProcessInformation); + return Hooked_CreateProcess( + "CreateProcessW", + [=](DWORD flags, LPVOID env, LPPROCESS_INFORMATION pi) { + return syshooks.API112CreateProcessW()( + lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, + bInheritHandles, flags, env, lpCurrentDirectory, lpStartupInfo, pi); + }, + dwCreationFlags, ShouldInject(lpApplicationName, lpCommandLine), lpEnvironment, + lpProcessInformation); } static BOOL WINAPI CreateProcessAsUserA_hook( @@ -516,15 +517,15 @@ private: BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { - return Hooked_CreateProcess("CreateProcessAsUserA", - [=](DWORD flags, LPVOID env, LPPROCESS_INFORMATION pi) { - return syshooks.CreateProcessAsUserA()( - hToken, lpApplicationName, lpCommandLine, lpProcessAttributes, - lpThreadAttributes, bInheritHandles, flags, env, - lpCurrentDirectory, lpStartupInfo, pi); - }, - dwCreationFlags, ShouldInject(lpApplicationName, lpCommandLine), - lpEnvironment, lpProcessInformation); + return Hooked_CreateProcess( + "CreateProcessAsUserA", + [=](DWORD flags, LPVOID env, LPPROCESS_INFORMATION pi) { + return syshooks.CreateProcessAsUserA()( + hToken, lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, + bInheritHandles, flags, env, lpCurrentDirectory, lpStartupInfo, pi); + }, + dwCreationFlags, ShouldInject(lpApplicationName, lpCommandLine), lpEnvironment, + lpProcessInformation); } static BOOL WINAPI CreateProcessAsUserW_hook( @@ -533,15 +534,15 @@ private: BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { - return Hooked_CreateProcess("CreateProcessAsUserW", - [=](DWORD flags, LPVOID env, LPPROCESS_INFORMATION pi) { - return syshooks.CreateProcessAsUserW()( - hToken, lpApplicationName, lpCommandLine, lpProcessAttributes, - lpThreadAttributes, bInheritHandles, flags, env, - lpCurrentDirectory, lpStartupInfo, pi); - }, - dwCreationFlags, ShouldInject(lpApplicationName, lpCommandLine), - lpEnvironment, lpProcessInformation); + return Hooked_CreateProcess( + "CreateProcessAsUserW", + [=](DWORD flags, LPVOID env, LPPROCESS_INFORMATION pi) { + return syshooks.CreateProcessAsUserW()( + hToken, lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, + bInheritHandles, flags, env, lpCurrentDirectory, lpStartupInfo, pi); + }, + dwCreationFlags, ShouldInject(lpApplicationName, lpCommandLine), lpEnvironment, + lpProcessInformation); } static BOOL WINAPI CreateProcessWithLogonW_hook(LPCWSTR lpUsername, LPCWSTR lpDomain, @@ -569,15 +570,15 @@ private: BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { - return Hooked_CreateProcess("CreateProcessAsUserW", - [=](DWORD flags, LPVOID env, LPPROCESS_INFORMATION pi) { - return syshooks.API110CreateProcessAsUserW()( - hToken, lpApplicationName, lpCommandLine, lpProcessAttributes, - lpThreadAttributes, bInheritHandles, flags, env, - lpCurrentDirectory, lpStartupInfo, pi); - }, - dwCreationFlags, ShouldInject(lpApplicationName, lpCommandLine), - lpEnvironment, lpProcessInformation); + return Hooked_CreateProcess( + "CreateProcessAsUserW", + [=](DWORD flags, LPVOID env, LPPROCESS_INFORMATION pi) { + return syshooks.API110CreateProcessAsUserW()( + hToken, lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, + bInheritHandles, flags, env, lpCurrentDirectory, lpStartupInfo, pi); + }, + dwCreationFlags, ShouldInject(lpApplicationName, lpCommandLine), lpEnvironment, + lpProcessInformation); } static BOOL WINAPI API111CreateProcessAsUserW_hook( @@ -586,15 +587,15 @@ private: BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { - return Hooked_CreateProcess("CreateProcessAsUserW", - [=](DWORD flags, LPVOID env, LPPROCESS_INFORMATION pi) { - return syshooks.API111CreateProcessAsUserW()( - hToken, lpApplicationName, lpCommandLine, lpProcessAttributes, - lpThreadAttributes, bInheritHandles, flags, env, - lpCurrentDirectory, lpStartupInfo, pi); - }, - dwCreationFlags, ShouldInject(lpApplicationName, lpCommandLine), - lpEnvironment, lpProcessInformation); + return Hooked_CreateProcess( + "CreateProcessAsUserW", + [=](DWORD flags, LPVOID env, LPPROCESS_INFORMATION pi) { + return syshooks.API111CreateProcessAsUserW()( + hToken, lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, + bInheritHandles, flags, env, lpCurrentDirectory, lpStartupInfo, pi); + }, + dwCreationFlags, ShouldInject(lpApplicationName, lpCommandLine), lpEnvironment, + lpProcessInformation); } static BOOL WINAPI API112CreateProcessAsUserW_hook( @@ -603,15 +604,15 @@ private: BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { - return Hooked_CreateProcess("CreateProcessAsUserW", - [=](DWORD flags, LPVOID env, LPPROCESS_INFORMATION pi) { - return syshooks.API112CreateProcessAsUserW()( - hToken, lpApplicationName, lpCommandLine, lpProcessAttributes, - lpThreadAttributes, bInheritHandles, flags, env, - lpCurrentDirectory, lpStartupInfo, pi); - }, - dwCreationFlags, ShouldInject(lpApplicationName, lpCommandLine), - lpEnvironment, lpProcessInformation); + return Hooked_CreateProcess( + "CreateProcessAsUserW", + [=](DWORD flags, LPVOID env, LPPROCESS_INFORMATION pi) { + return syshooks.API112CreateProcessAsUserW()( + hToken, lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, + bInheritHandles, flags, env, lpCurrentDirectory, lpStartupInfo, pi); + }, + dwCreationFlags, ShouldInject(lpApplicationName, lpCommandLine), lpEnvironment, + lpProcessInformation); } }; diff --git a/renderdoc/os/win32/win32_callstack.cpp b/renderdoc/os/win32/win32_callstack.cpp index 44483ddd2..f930e6933 100644 --- a/renderdoc/os/win32/win32_callstack.cpp +++ b/renderdoc/os/win32/win32_callstack.cpp @@ -722,8 +722,7 @@ rdcstr Win32CallstackResolver::pdbBrowse(rdcstr startingPoint) ofn.lpstrFilter = L"PDB File\0*.pdb\0"; ofn.lpstrFile = outBuf; ofn.nMaxFile = MAX_PATH * 2 - 1; - ofn.Flags = - OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST; // | OFN_ENABLEINCLUDENOTIFY | OFN_ENABLEHOOK + ofn.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST; // | OFN_ENABLEINCLUDENOTIFY | OFN_ENABLEHOOK BOOL ret = GetOpenFileNameW(&ofn); diff --git a/renderdoc/os/win32/win32_process.cpp b/renderdoc/os/win32/win32_process.cpp index de943a1f8..e299fdefa 100644 --- a/renderdoc/os/win32/win32_process.cpp +++ b/renderdoc/os/win32/win32_process.cpp @@ -611,7 +611,7 @@ rdcpair Process::InjectIntoProcess(uint32_t pid, wchar_t renderdocPath[MAX_PATH] = {0}; GetModuleFileNameW(GetModuleHandleA(STRINGIZE(RDOC_BASE_NAME) ".dll"), &renderdocPath[0], - MAX_PATH - 1); + MAX_PATH - 1); wchar_t renderdocPathLower[MAX_PATH] = {0}; memcpy(renderdocPathLower, renderdocPath, MAX_PATH * sizeof(wchar_t)); diff --git a/renderdoc/os/win32/win32_shellext.cpp b/renderdoc/os/win32/win32_shellext.cpp index afc77020f..25fc3966b 100644 --- a/renderdoc/os/win32/win32_shellext.cpp +++ b/renderdoc/os/win32/win32_shellext.cpp @@ -482,8 +482,7 @@ struct RDCThumbnailProvider : public IThumbnailProvider, IInitializeWithStream case ResourceFormatType::BC7: DecompressBlockBC7(compBlockStart, decompressedBlock, NULL); break; - default: - return E_NOTIMPL; // other formats + default: return E_NOTIMPL; // other formats } unsigned char *decompPointer = decompressedBlock; @@ -543,8 +542,7 @@ struct RDCThumbnailProvider : public IThumbnailProvider, IInitializeWithStream decompImagePointer[(pixelInStride * 4) + 2] = (unsigned char)(blueF * 255); } break; - default: - return E_NOTIMPL; // other formats + default: return E_NOTIMPL; // other formats } decompImagePointer += decompressedStride; } diff --git a/renderdoc/os/win32/win32_threading.cpp b/renderdoc/os/win32/win32_threading.cpp index 3bb249bcf..7a4da4c54 100644 --- a/renderdoc/os/win32/win32_threading.cpp +++ b/renderdoc/os/win32/win32_threading.cpp @@ -259,7 +259,7 @@ void SetTLSValue(uint64_t slot, void *value) } if(slot - 1 >= slots->data.size()) - slots->data.resize((size_t)slot); + slots->data.resize((size_t)slot); } slots->data[(size_t)slot - 1] = value; diff --git a/renderdoc/replay/basic_types_tests.cpp b/renderdoc/replay/basic_types_tests.cpp index 9fa7a11d6..caae901c0 100644 --- a/renderdoc/replay/basic_types_tests.cpp +++ b/renderdoc/replay/basic_types_tests.cpp @@ -1325,7 +1325,6 @@ TEST_CASE("Test string type", "[basictypes][string]") SECTION("Assigning a string to itself") { auto lambda = [](rdcstr test) { - // create a version without doing self-insertion rdcstr test2 = test; @@ -1352,7 +1351,6 @@ TEST_CASE("Test string type", "[basictypes][string]") SECTION("Inserting from string into itself") { auto lambda = [](rdcstr test) { - // create a version without doing self-insertion rdcstr test2 = test; diff --git a/renderdoc/replay/entry_points.cpp b/renderdoc/replay/entry_points.cpp index 41c7c75f9..fee870990 100644 --- a/renderdoc/replay/entry_points.cpp +++ b/renderdoc/replay/entry_points.cpp @@ -759,8 +759,7 @@ static rdcstr ResourceFormatName(const ResourceFormat &fmt) else return fmt.SRGBCorrected() ? "ETC2_EAC_RGBA8_SRGB" : "ETC2_EAC_RGBA8_UNORM"; } - case ResourceFormatType::ASTC: - return fmt.SRGBCorrected() ? "ASTC_SRGB" : "ASTC_UNORM"; + case ResourceFormatType::ASTC: return fmt.SRGBCorrected() ? "ASTC_SRGB" : "ASTC_UNORM"; // 10:10:10 A2 is the only format that can have all the usual format types (unorm, snorm, // etc). So we break and handle it like any other format below. case ResourceFormatType::R10G10B10A2: @@ -985,9 +984,11 @@ extern "C" RENDERDOC_API int RENDERDOC_CC RENDERDOC_RunFunctionalTests(int pytho // specify script path StringFormat::UTF82Wide(scriptPath), // specify native library path - L"--renderdoc", StringFormat::UTF82Wide(libPath), + L"--renderdoc", + StringFormat::UTF82Wide(libPath), // specify python module path - L"--pyrenderdoc", StringFormat::UTF82Wide(modulePath), + L"--pyrenderdoc", + StringFormat::UTF82Wide(modulePath), // force in-process as we can't fork out to python to pass args L"--in-process", }); diff --git a/renderdoc/replay/replay_controller.cpp b/renderdoc/replay/replay_controller.cpp index 90a7118a4..6c1c1f9fe 100644 --- a/renderdoc/replay/replay_controller.cpp +++ b/renderdoc/replay/replay_controller.cpp @@ -1367,7 +1367,10 @@ ResultDetails ReplayController::SaveTexture(const TextureSave &saveData, const r // must be in this order as many viewers don't pay attention to channels and just assume // they are in this order EXRChannelInfo bgraChannels[4] = { - {"A"}, {"B"}, {"G"}, {"R"}, + {"A"}, + {"B"}, + {"G"}, + {"R"}, }; exrHeader.num_channels = 4; diff --git a/renderdoc/replay/replay_driver.cpp b/renderdoc/replay/replay_driver.cpp index 1c3e47ce2..199ea355a 100644 --- a/renderdoc/replay/replay_driver.cpp +++ b/renderdoc/replay/replay_driver.cpp @@ -1224,14 +1224,18 @@ bool HighlightCache::FetchHighlightPositions(const MeshDisplay &cfg, FloatVector // as above, unused since this is adjacency for previous triangle /*[3]=*/InterpretVertex(data, numidx - 5, cfg, dataEnd, true, valid), // 9 in diagram - /*[4]=*/InterpretVertex(data, numidx - 4, cfg, dataEnd, true, - valid), // 10 in diagram - /*[5]=*/InterpretVertex(data, numidx - 3, cfg, dataEnd, true, - valid), // 11 in diagram - /*[6]=*/InterpretVertex(data, numidx - 2, cfg, dataEnd, true, - valid), // 12 in diagram - /*[7]=*/InterpretVertex(data, numidx - 1, cfg, dataEnd, true, - valid), // 13 in diagram + + /*[4]=*/ // 10 in diagram + InterpretVertex(data, numidx - 4, cfg, dataEnd, true, valid), + + /*[5]=*/ // 11 in diagram + InterpretVertex(data, numidx - 3, cfg, dataEnd, true, valid), + + /*[6]=*/ // 12 in diagram + InterpretVertex(data, numidx - 2, cfg, dataEnd, true, valid), + + /*[7]=*/ // 13 in diagram + InterpretVertex(data, numidx - 1, cfg, dataEnd, true, valid), }; // these are the triangles on the far right of the MSDN diagram above diff --git a/renderdoc/serialise/codecs/chrome_json_codec.cpp b/renderdoc/serialise/codecs/chrome_json_codec.cpp index 40a20a59c..d81f20fb2 100644 --- a/renderdoc/serialise/codecs/chrome_json_codec.cpp +++ b/renderdoc/serialise/codecs/chrome_json_codec.cpp @@ -98,7 +98,8 @@ RDResult exportChrome(const rdcstr &filename, const RDCFile &rdc, const SDFile & static ConversionRegistration XMLConversionRegistration( &exportChrome, { - "chrome.json", "Chrome profiler JSON", + "chrome.json", + "Chrome profiler JSON", R"(Exports the chunk threadID, timestamp and duration data to a JSON format that can be loaded by chrome's profiler at chrome://tracing)", false, diff --git a/renderdoc/serialise/codecs/xml_codec.cpp b/renderdoc/serialise/codecs/xml_codec.cpp index 6f0fd6af9..9c8dd0b16 100644 --- a/renderdoc/serialise/codecs/xml_codec.cpp +++ b/renderdoc/serialise/codecs/xml_codec.cpp @@ -1155,7 +1155,8 @@ RDResult exportXMLOnly(const rdcstr &filename, const RDCFile &rdc, const SDFile static ConversionRegistration XMLZIPConversionRegistration( &importXMLZ, &exportXMLZ, { - "zip.xml", "XML+ZIP capture", + "zip.xml", + "XML+ZIP capture", R"(Stores the structured data in an xml tree, with large buffer data stored in indexed blobs in similarly named zip file.)", true, @@ -1164,7 +1165,8 @@ similarly named zip file.)", static ConversionRegistration XMLOnlyConversionRegistration( &exportXMLOnly, { - "xml", "XML capture", + "xml", + "XML capture", R"(Stores the structured data in an xml tree, with large buffer data omitted - that makes it easier to work with but it cannot then be imported.)", false, diff --git a/renderdoc/serialise/rdcfile.cpp b/renderdoc/serialise/rdcfile.cpp index cd6cf9b01..0e4493c52 100644 --- a/renderdoc/serialise/rdcfile.cpp +++ b/renderdoc/serialise/rdcfile.cpp @@ -471,8 +471,7 @@ void RDCFile::Init(StreamReader &reader) if(reader.AtEnd()) { - SET_ERROR_RESULT(m_Error, ResultCode::FileCorrupted, - "Invalid truncated ASCII data section"); + SET_ERROR_RESULT(m_Error, ResultCode::FileCorrupted, "Invalid truncated ASCII data section"); return; } @@ -493,8 +492,7 @@ void RDCFile::Init(StreamReader &reader) if(reader.IsErrored() || reader.AtEnd()) { - SET_ERROR_RESULT(m_Error, ResultCode::FileCorrupted, - "Invalid truncated ASCII data section"); + SET_ERROR_RESULT(m_Error, ResultCode::FileCorrupted, "Invalid truncated ASCII data section"); return; } @@ -515,8 +513,7 @@ void RDCFile::Init(StreamReader &reader) if(reader.IsErrored() || reader.AtEnd()) { - SET_ERROR_RESULT(m_Error, ResultCode::FileCorrupted, - "Invalid truncated ASCII data section"); + SET_ERROR_RESULT(m_Error, ResultCode::FileCorrupted, "Invalid truncated ASCII data section"); return; } @@ -537,8 +534,7 @@ void RDCFile::Init(StreamReader &reader) if(reader.IsErrored() || reader.AtEnd()) { - SET_ERROR_RESULT(m_Error, ResultCode::FileCorrupted, - "Invalid truncated ASCII data section"); + SET_ERROR_RESULT(m_Error, ResultCode::FileCorrupted, "Invalid truncated ASCII data section"); return; } @@ -558,8 +554,7 @@ void RDCFile::Init(StreamReader &reader) if(reader.IsErrored() || reader.AtEnd()) { - SET_ERROR_RESULT(m_Error, ResultCode::FileCorrupted, - "Invalid truncated ASCII data section"); + SET_ERROR_RESULT(m_Error, ResultCode::FileCorrupted, "Invalid truncated ASCII data section"); return; } diff --git a/renderdoc/serialise/streamio_tests.cpp b/renderdoc/serialise/streamio_tests.cpp index b2d3c3496..a7ba2c3e5 100644 --- a/renderdoc/serialise/streamio_tests.cpp +++ b/renderdoc/serialise/streamio_tests.cpp @@ -290,7 +290,6 @@ TEST_CASE("Test stream I/O operations over the network", "[streamio][network]") uint64_t vals[10] = {1, 6, 0, 5, 3, 8, 7, 9, 2, 4}; sendThread = Threading::CreateThread([&threadA, sender, &writer, &vals]() { - PerformanceTimer timer; for(int32_t i = 0; i < 128; i++) diff --git a/renderdoccmd/renderdoccmd.cpp b/renderdoccmd/renderdoccmd.cpp index 73d02858b..40a9e014d 100644 --- a/renderdoccmd/renderdoccmd.cpp +++ b/renderdoccmd/renderdoccmd.cpp @@ -513,7 +513,8 @@ public: if(DisplayRemoteServerPreview(false, {}).system != WindowingSystem::Unknown) previewWindow = &DisplayRemoteServerPreview; - RENDERDOC_BecomeRemoteServer(conv(host), port, []() { return killSignal; }, previewWindow); + RENDERDOC_BecomeRemoteServer( + conv(host), port, []() { return killSignal; }, previewWindow); std::cerr << std::endl << "Cleaning up from replay hosting." << std::endl; @@ -878,7 +879,7 @@ public: #if PYTHON_VERSION_MINOR > 0 && mode != "functional" #endif - ) + ) { std::cerr << "Unsupported test frame work '" << mode << "'" << std::endl << std::endl; std::cerr << parser.usage() << std::endl; @@ -1045,10 +1046,12 @@ public: { parser.set_footer(""); parser.add("section", 's', "The embedded section name."); - parser.add("file", 'f', m_Extract ? "The file to write the section contents to." - : "The file to read the section contents from."); - parser.add("no-clobber", 'n', m_Extract ? "Don't overwrite the file if it already exists." - : "Don't overwrite the section if it already exists."); + parser.add("file", 'f', + m_Extract ? "The file to write the section contents to." + : "The file to read the section contents from."); + parser.add("no-clobber", 'n', + m_Extract ? "Don't overwrite the file if it already exists." + : "Don't overwrite the section if it already exists."); if(!m_Extract) { @@ -1284,8 +1287,7 @@ public: parser.add("register", '\0', "Register RenderDoc's vulkan layer"); parser.add("user", '\0', "Install layer registration at user-local level instead of system-wide"); - parser.add("system", '\0', - "Install layer registration system-wide (requires admin privileges)"); + parser.add("system", '\0', "Install layer registration system-wide (requires admin privileges)"); } virtual const char *Description() { return "Vulkan layer registration needs attention"; } virtual bool IsInternalOnly() diff --git a/renderdoccmd/renderdoccmd_android.cpp b/renderdoccmd/renderdoccmd_android.cpp index 368bcd6b4..661d78655 100644 --- a/renderdoccmd/renderdoccmd_android.cpp +++ b/renderdoccmd/renderdoccmd_android.cpp @@ -385,8 +385,7 @@ std::vector getRenderdoccmdArgs() jmethodID gseid = env->GetMethodID(icl, "getStringExtra", "(Ljava/lang/String;)Ljava/lang/String;"); - jstring jsParam1 = - (jstring)env->CallObjectMethod(intent, gseid, env->NewStringUTF("renderdoccmd")); + jstring jsParam1 = (jstring)env->CallObjectMethod(intent, gseid, env->NewStringUTF("renderdoccmd")); std::vector ret; if(jsParam1) // Check if arg value found diff --git a/renderdocshim/renderdocshim.cpp b/renderdocshim/renderdocshim.cpp index a27ad452e..6b00243f1 100644 --- a/renderdocshim/renderdocshim.cpp +++ b/renderdocshim/renderdocshim.cpp @@ -46,7 +46,7 @@ typedef void(__cdecl *pINTERNAL_SetDebugLogFile)(const char *logfile); } while(0) #else // define this to something to get logging -//#define LOGPRINT(txt) OutputDebugStringW(txt) +// #define LOGPRINT(txt) OutputDebugStringW(txt) #define LOGPRINT(txt) \ do \ { \ diff --git a/util/test/demos/android/android_platform.cpp b/util/test/demos/android/android_platform.cpp index 17c07ac3b..0f3e40438 100644 --- a/util/test/demos/android/android_platform.cpp +++ b/util/test/demos/android/android_platform.cpp @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #include #include diff --git a/util/test/demos/android/android_platform.h b/util/test/demos/android/android_platform.h index 36e830945..0dbc46d7f 100644 --- a/util/test/demos/android/android_platform.h +++ b/util/test/demos/android/android_platform.h @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #pragma once diff --git a/util/test/demos/android/android_window.cpp b/util/test/demos/android/android_window.cpp index cc5848dfb..9811c3eba 100644 --- a/util/test/demos/android/android_window.cpp +++ b/util/test/demos/android/android_window.cpp @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #include "android_window.h" diff --git a/util/test/demos/android/android_window.h b/util/test/demos/android/android_window.h index 9f45fbd5b..1eac00033 100644 --- a/util/test/demos/android/android_window.h +++ b/util/test/demos/android/android_window.h @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #pragma once diff --git a/util/test/demos/apple/apple_platform.cpp b/util/test/demos/apple/apple_platform.cpp index c054d59e9..df32d1ee1 100644 --- a/util/test/demos/apple/apple_platform.cpp +++ b/util/test/demos/apple/apple_platform.cpp @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2022-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2022-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #include #include diff --git a/util/test/demos/apple/apple_platform.h b/util/test/demos/apple/apple_platform.h index dd1aad1be..9758965a2 100644 --- a/util/test/demos/apple/apple_platform.h +++ b/util/test/demos/apple/apple_platform.h @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2022-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2022-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #pragma once diff --git a/util/test/demos/apple/apple_window.cpp b/util/test/demos/apple/apple_window.cpp index c599e01eb..9a757f5bd 100644 --- a/util/test/demos/apple/apple_window.cpp +++ b/util/test/demos/apple/apple_window.cpp @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2022-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2022-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #include "apple_window.h" diff --git a/util/test/demos/apple/apple_window.h b/util/test/demos/apple/apple_window.h index 08cc3f3a3..84358d1ab 100644 --- a/util/test/demos/apple/apple_window.h +++ b/util/test/demos/apple/apple_window.h @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2022-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2022-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #pragma once diff --git a/util/test/demos/apple/nuklear_appkit.h b/util/test/demos/apple/nuklear_appkit.h index ea78403a5..e723e035a 100644 --- a/util/test/demos/apple/nuklear_appkit.h +++ b/util/test/demos/apple/nuklear_appkit.h @@ -983,8 +983,8 @@ bool nk_appkit_core_initialize(void) return event; }; - s_state.keyUpMonitor = - [NSEvent addLocalMonitorForEventsMatchingMask:NSEventMaskKeyUp handler:block]; + s_state.keyUpMonitor = [NSEvent addLocalMonitorForEventsMatchingMask:NSEventMaskKeyUp + handler:block]; CreateKeyTables(); @@ -1071,8 +1071,9 @@ float nk_appkit_drawing_get_text_width(nk_appkit_window *window, const char *tex { @autoreleasepool { - NSString *nsString = - [[NSString alloc] initWithBytes:(void *)text length:len encoding:NSASCIIStringEncoding]; + NSString *nsString = [[NSString alloc] initWithBytes:(void *)text + length:len + encoding:NSASCIIStringEncoding]; NSMutableDictionary *atts = [[NSMutableDictionary alloc] init]; [atts setObject:s_state.nsFont forKey:NSFontAttributeName]; NSSize bounds = [nsString sizeWithAttributes:atts]; @@ -1135,8 +1136,9 @@ void nk_appkit_drawing_text(nk_appkit_window *window, short x, short y, u_int16_ { float H = window->nsImage.size.height; float y0 = H - y - s_state.fontHeight; - NSString *nsString = - [[NSString alloc] initWithBytes:(void *)text length:len encoding:NSASCIIStringEncoding]; + NSString *nsString = [[NSString alloc] initWithBytes:(void *)text + length:len + encoding:NSASCIIStringEncoding]; NSMutableDictionary *atts = [[NSMutableDictionary alloc] init]; [atts setObject:s_state.nsFont forKey:NSFontAttributeName]; [atts setObject:[NSColor colorWithRed:bgR / 255.0f diff --git a/util/test/demos/d3d11/d3d11_binding_hazards.cpp b/util/test/demos/d3d11/d3d11_binding_hazards.cpp index 381b98ba4..677b3c285 100644 --- a/util/test/demos/d3d11/d3d11_binding_hazards.cpp +++ b/util/test/demos/d3d11/d3d11_binding_hazards.cpp @@ -197,7 +197,8 @@ void main() ctx->CSSetShader(cs, NULL, 0); ID3D11RenderTargetView *RTVs[] = { - rtv0, rtv0, + rtv0, + rtv0, }; // can't bind the same RTV to two slots diff --git a/util/test/demos/d3d11/d3d11_helpers.cpp b/util/test/demos/d3d11/d3d11_helpers.cpp index 7a0cb0139..752d11f34 100644 --- a/util/test/demos/d3d11/d3d11_helpers.cpp +++ b/util/test/demos/d3d11/d3d11_helpers.cpp @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #include "d3d11_helpers.h" #include "d3d11_test.h" @@ -548,62 +548,103 @@ void D3D11ViewCreator::SetupDescriptors() { // &firstMip, &numMips, &firstSlice, &numSlices { - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, }, { - &desc.srv.Texture1D.MostDetailedMip, &desc.srv.Texture1D.MipLevels, NULL, NULL, + &desc.srv.Texture1D.MostDetailedMip, + &desc.srv.Texture1D.MipLevels, + NULL, + NULL, }, { - &desc.srv.Texture1DArray.MostDetailedMip, &desc.srv.Texture1DArray.MipLevels, - &desc.srv.Texture1DArray.FirstArraySlice, &desc.srv.Texture1DArray.ArraySize, + &desc.srv.Texture1DArray.MostDetailedMip, + &desc.srv.Texture1DArray.MipLevels, + &desc.srv.Texture1DArray.FirstArraySlice, + &desc.srv.Texture1DArray.ArraySize, }, { - &desc.srv.Texture2D.MostDetailedMip, &desc.srv.Texture2D.MipLevels, NULL, NULL, + &desc.srv.Texture2D.MostDetailedMip, + &desc.srv.Texture2D.MipLevels, + NULL, + NULL, }, { - &desc.srv.Texture2DArray.MostDetailedMip, &desc.srv.Texture2DArray.MipLevels, - &desc.srv.Texture2DArray.FirstArraySlice, &desc.srv.Texture2DArray.ArraySize, + &desc.srv.Texture2DArray.MostDetailedMip, + &desc.srv.Texture2DArray.MipLevels, + &desc.srv.Texture2DArray.FirstArraySlice, + &desc.srv.Texture2DArray.ArraySize, }, { - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, }, { - NULL, NULL, &desc.srv.Texture2DMSArray.FirstArraySlice, + NULL, + NULL, + &desc.srv.Texture2DMSArray.FirstArraySlice, &desc.srv.Texture2DMSArray.ArraySize, }, { - &desc.srv.Texture3D.MostDetailedMip, &desc.srv.Texture2D.MipLevels, NULL, NULL, + &desc.srv.Texture3D.MostDetailedMip, + &desc.srv.Texture2D.MipLevels, + NULL, + NULL, }, }, // RTV { // &firstMip, &numMips, &firstSlice, &numSlices { - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, }, { - &desc.rtv.Texture1D.MipSlice, NULL, NULL, NULL, + &desc.rtv.Texture1D.MipSlice, + NULL, + NULL, + NULL, }, { - &desc.rtv.Texture1DArray.MipSlice, NULL, &desc.rtv.Texture1DArray.FirstArraySlice, + &desc.rtv.Texture1DArray.MipSlice, + NULL, + &desc.rtv.Texture1DArray.FirstArraySlice, &desc.rtv.Texture1DArray.ArraySize, }, { - &desc.rtv.Texture2D.MipSlice, NULL, NULL, NULL, + &desc.rtv.Texture2D.MipSlice, + NULL, + NULL, + NULL, }, { - &desc.rtv.Texture2DArray.MipSlice, NULL, &desc.rtv.Texture2DArray.FirstArraySlice, + &desc.rtv.Texture2DArray.MipSlice, + NULL, + &desc.rtv.Texture2DArray.FirstArraySlice, &desc.rtv.Texture2DArray.ArraySize, }, { - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, }, { - NULL, NULL, &desc.rtv.Texture2DMSArray.FirstArraySlice, + NULL, + NULL, + &desc.rtv.Texture2DMSArray.FirstArraySlice, &desc.rtv.Texture2DMSArray.ArraySize, }, { - &desc.rtv.Texture3D.MipSlice, NULL, &desc.rtv.Texture3D.FirstWSlice, + &desc.rtv.Texture3D.MipSlice, + NULL, + &desc.rtv.Texture3D.FirstWSlice, &desc.rtv.Texture3D.WSize, }, }, @@ -611,61 +652,103 @@ void D3D11ViewCreator::SetupDescriptors() { // &firstMip, &numMips, &firstSlice, &numSlices { - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, }, { - &desc.dsv.Texture1D.MipSlice, NULL, NULL, NULL, + &desc.dsv.Texture1D.MipSlice, + NULL, + NULL, + NULL, }, { - &desc.dsv.Texture1DArray.MipSlice, NULL, &desc.dsv.Texture1DArray.FirstArraySlice, + &desc.dsv.Texture1DArray.MipSlice, + NULL, + &desc.dsv.Texture1DArray.FirstArraySlice, &desc.dsv.Texture1DArray.ArraySize, }, { - &desc.dsv.Texture2D.MipSlice, NULL, NULL, NULL, + &desc.dsv.Texture2D.MipSlice, + NULL, + NULL, + NULL, }, { - &desc.dsv.Texture2DArray.MipSlice, NULL, &desc.dsv.Texture2DArray.FirstArraySlice, + &desc.dsv.Texture2DArray.MipSlice, + NULL, + &desc.dsv.Texture2DArray.FirstArraySlice, &desc.dsv.Texture2DArray.ArraySize, }, { - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, }, { - NULL, NULL, &desc.dsv.Texture2DMSArray.FirstArraySlice, + NULL, + NULL, + &desc.dsv.Texture2DMSArray.FirstArraySlice, &desc.dsv.Texture2DMSArray.ArraySize, }, { - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, }, }, // UAV { // &firstMip, &numMips, &firstSlice, &numSlices { - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, }, { - &desc.uav.Texture1D.MipSlice, NULL, NULL, NULL, + &desc.uav.Texture1D.MipSlice, + NULL, + NULL, + NULL, }, { - &desc.uav.Texture1DArray.MipSlice, NULL, &desc.uav.Texture1DArray.FirstArraySlice, + &desc.uav.Texture1DArray.MipSlice, + NULL, + &desc.uav.Texture1DArray.FirstArraySlice, &desc.uav.Texture1DArray.ArraySize, }, { - &desc.uav.Texture2D.MipSlice, NULL, NULL, NULL, + &desc.uav.Texture2D.MipSlice, + NULL, + NULL, + NULL, }, { - &desc.uav.Texture2DArray.MipSlice, NULL, &desc.uav.Texture2DArray.FirstArraySlice, + &desc.uav.Texture2DArray.MipSlice, + NULL, + &desc.uav.Texture2DArray.FirstArraySlice, &desc.uav.Texture2DArray.ArraySize, }, { - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, }, { - NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, }, { - &desc.uav.Texture3D.MipSlice, NULL, &desc.uav.Texture3D.FirstWSlice, + &desc.uav.Texture3D.MipSlice, + NULL, + &desc.uav.Texture3D.FirstWSlice, &desc.uav.Texture3D.WSize, }, }, diff --git a/util/test/demos/d3d11/d3d11_helpers.h b/util/test/demos/d3d11/d3d11_helpers.h index 80894a5ba..f202c874f 100644 --- a/util/test/demos/d3d11/d3d11_helpers.h +++ b/util/test/demos/d3d11/d3d11_helpers.h @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #pragma once diff --git a/util/test/demos/d3d11/d3d11_mip_rtv.cpp b/util/test/demos/d3d11/d3d11_mip_rtv.cpp index a9204c17a..622afc4bd 100644 --- a/util/test/demos/d3d11/d3d11_mip_rtv.cpp +++ b/util/test/demos/d3d11/d3d11_mip_rtv.cpp @@ -56,7 +56,9 @@ float4 main() : SV_Target0 ID3D11Texture2DPtr rt = MakeTexture(DXGI_FORMAT_R8G8B8A8_UNORM, 1024, 1024).RTV().Mips(6); ID3D11RenderTargetViewPtr rtv[4] = { - MakeRTV(rt).FirstMip(0), MakeRTV(rt).FirstMip(1), MakeRTV(rt).FirstMip(2), + MakeRTV(rt).FirstMip(0), + MakeRTV(rt).FirstMip(1), + MakeRTV(rt).FirstMip(2), MakeRTV(rt).FirstMip(3), }; diff --git a/util/test/demos/d3d11/d3d11_pixel_history_zoo.cpp b/util/test/demos/d3d11/d3d11_pixel_history_zoo.cpp index 8a6fdf916..decf3f929 100644 --- a/util/test/demos/d3d11/d3d11_pixel_history_zoo.cpp +++ b/util/test/demos/d3d11/d3d11_pixel_history_zoo.cpp @@ -261,8 +261,7 @@ RD_TEST(D3D11_Pixel_History_Zoo, D3D11GraphicsTest) case DXGI_FORMAT_D32_FLOAT: // maybe not valid cast? case DXGI_FORMAT_R32_FLOAT: case DXGI_FORMAT_R32_UINT: - case DXGI_FORMAT_R32_SINT: - return DXGI_FORMAT_R32_TYPELESS; + case DXGI_FORMAT_R32_SINT: return DXGI_FORMAT_R32_TYPELESS; // maybe not valid casts? case DXGI_FORMAT_R24G8_TYPELESS: @@ -673,8 +672,8 @@ void main() break; } - pushMarker("Test RTV: " + dxgiFormatName[f] + " & depth: " + - (df == DXGI_FORMAT_UNKNOWN ? "None" : dxgiFormatName[df])); + pushMarker("Test RTV: " + dxgiFormatName[f] + + " & depth: " + (df == DXGI_FORMAT_UNKNOWN ? "None" : dxgiFormatName[df])); ctx->OMSetRenderTargets(1, &rt.GetInterfacePtr(), dsv); diff --git a/util/test/demos/d3d11/d3d11_primitive_restart.cpp b/util/test/demos/d3d11/d3d11_primitive_restart.cpp index ae5b23948..616d8aa6f 100644 --- a/util/test/demos/d3d11/d3d11_primitive_restart.cpp +++ b/util/test/demos/d3d11/d3d11_primitive_restart.cpp @@ -67,26 +67,54 @@ RD_TEST(D3D11_Primitive_Restart, D3D11GraphicsTest) uint16_t idx[] = { // strip 0 - 0, 1, 2, 3, 4, 5, 6, 7, + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, // restart 0xffff, // strip 1 - 8, 9, 10, 11, 12, 13, 14, 15, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, }; ID3D11BufferPtr ib = MakeBuffer().Index().Data(idx); uint16_t idx2[] = { // strip 0 - 10, 11, 12, 13, 14, 15, 16, 17, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, // restart 0xffff, // strip 1 - 18, 19, 20, 21, 22, 23, 24, 25, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, }; ID3D11BufferPtr ib2 = MakeBuffer().Index().Data(idx2); diff --git a/util/test/demos/d3d11/d3d11_resource_lifetimes.cpp b/util/test/demos/d3d11/d3d11_resource_lifetimes.cpp index f02377bbb..573558a3a 100644 --- a/util/test/demos/d3d11/d3d11_resource_lifetimes.cpp +++ b/util/test/demos/d3d11/d3d11_resource_lifetimes.cpp @@ -136,13 +136,25 @@ float4 main(v2f IN) : SV_Target0 const uint32_t checker[4 * 4] = { // X X O O - 0xffffffff, 0xffffffff, 0, 0, + 0xffffffff, + 0xffffffff, + 0, + 0, // X X O O - 0xffffffff, 0xffffffff, 0, 0, + 0xffffffff, + 0xffffffff, + 0, + 0, // O O X X - 0, 0, 0xffffffff, 0xffffffff, + 0, + 0, + 0xffffffff, + 0xffffffff, // O O X X - 0, 0, 0xffffffff, 0xffffffff, + 0, + 0, + 0xffffffff, + 0xffffffff, }; ctx->UpdateSubresource(tex, 0, NULL, checker, 4 * sizeof(uint32_t), 0); diff --git a/util/test/demos/d3d11/d3d11_saturate.cpp b/util/test/demos/d3d11/d3d11_saturate.cpp index bc6cc80fd..b93a7dbe2 100644 --- a/util/test/demos/d3d11/d3d11_saturate.cpp +++ b/util/test/demos/d3d11/d3d11_saturate.cpp @@ -74,7 +74,8 @@ void main(float4 pos : SV_Position, out float4 a : SV_Target0, out float4 b : SV MakeTexture(DXGI_FORMAT_R32G32B32A32_FLOAT, 400, 400).RTV(), }; ID3D11RenderTargetViewPtr fltRT[2] = { - MakeRTV(fltTex[0]), MakeRTV(fltTex[1]), + MakeRTV(fltTex[0]), + MakeRTV(fltTex[1]), }; while(Running()) @@ -91,7 +92,8 @@ void main(float4 pos : SV_Position, out float4 a : SV_Target0, out float4 b : SV RSSetViewport({0.0f, 0.0f, (float)screenWidth, (float)screenHeight, 0.0f, 1.0f}); ID3D11RenderTargetView *rts[] = { - fltRT[0], fltRT[1], + fltRT[0], + fltRT[1], }; ctx->OMSetRenderTargets(2, rts, NULL); diff --git a/util/test/demos/d3d11/d3d11_shader_debug_zoo.cpp b/util/test/demos/d3d11/d3d11_shader_debug_zoo.cpp index e07451bb5..8f3ee6797 100644 --- a/util/test/demos/d3d11/d3d11_shader_debug_zoo.cpp +++ b/util/test/demos/d3d11/d3d11_shader_debug_zoo.cpp @@ -936,19 +936,40 @@ float4 main(v2f IN, uint samp : SV_SampleIndex) : SV_Target0 D3D11_INPUT_ELEMENT_DESC layoutdesc[] = { { - "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0, + "POSITION", + 0, + DXGI_FORMAT_R32G32B32_FLOAT, + 0, + 0, + D3D11_INPUT_PER_VERTEX_DATA, + 0, }, { - "ZERO", 0, DXGI_FORMAT_R32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, - D3D11_INPUT_PER_VERTEX_DATA, 0, + "ZERO", + 0, + DXGI_FORMAT_R32_FLOAT, + 0, + D3D11_APPEND_ALIGNED_ELEMENT, + D3D11_INPUT_PER_VERTEX_DATA, + 0, }, { - "ONE", 0, DXGI_FORMAT_R32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, - D3D11_INPUT_PER_VERTEX_DATA, 0, + "ONE", + 0, + DXGI_FORMAT_R32_FLOAT, + 0, + D3D11_APPEND_ALIGNED_ELEMENT, + D3D11_INPUT_PER_VERTEX_DATA, + 0, }, { - "NEGONE", 0, DXGI_FORMAT_R32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, - D3D11_INPUT_PER_VERTEX_DATA, 0, + "NEGONE", + 0, + DXGI_FORMAT_R32_FLOAT, + 0, + D3D11_APPEND_ALIGNED_ELEMENT, + D3D11_INPUT_PER_VERTEX_DATA, + 0, }, }; diff --git a/util/test/demos/d3d11/d3d11_simple_dispatch.cpp b/util/test/demos/d3d11/d3d11_simple_dispatch.cpp index adb7c4170..31252c5b8 100644 --- a/util/test/demos/d3d11/d3d11_simple_dispatch.cpp +++ b/util/test/demos/d3d11/d3d11_simple_dispatch.cpp @@ -67,10 +67,12 @@ void main() MakeTexture(DXGI_FORMAT_R32_UINT, 8, 8).SRV().UAV().RTV(), }; ID3D11ShaderResourceViewPtr srv[2] = { - MakeSRV(tex[0]), MakeSRV(tex[1]), + MakeSRV(tex[0]), + MakeSRV(tex[1]), }; ID3D11UnorderedAccessViewPtr uav[2] = { - MakeUAV(tex[0]), MakeUAV(tex[1]), + MakeUAV(tex[0]), + MakeUAV(tex[1]), }; ID3D11RenderTargetViewPtr texRTV = MakeRTV(tex[0]); diff --git a/util/test/demos/d3d11/d3d11_stream_out.cpp b/util/test/demos/d3d11/d3d11_stream_out.cpp index e7bf2becc..36321fb20 100644 --- a/util/test/demos/d3d11/d3d11_stream_out.cpp +++ b/util/test/demos/d3d11/d3d11_stream_out.cpp @@ -74,19 +74,38 @@ RD_TEST(D3D11_Stream_Out, D3D11GraphicsTest) ID3D11BufferPtr vb = MakeBuffer().Vertex().Data(DefaultTri); ID3D11BufferPtr so[3] = { - MakeBuffer().StreamOut().Vertex().Size(2048), MakeBuffer().StreamOut().Vertex().Size(2048), + MakeBuffer().StreamOut().Vertex().Size(2048), + MakeBuffer().StreamOut().Vertex().Size(2048), MakeBuffer().StreamOut().Vertex().Size(2048), }; D3D11_INPUT_ELEMENT_DESC layoutdesc[] = { { - "POSITION", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0, + "POSITION", + 0, + DXGI_FORMAT_R32G32B32A32_FLOAT, + 0, + 0, + D3D11_INPUT_PER_VERTEX_DATA, + 0, }, { - "COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, 0, D3D11_INPUT_PER_VERTEX_DATA, 0, + "COLOR", + 0, + DXGI_FORMAT_R32G32B32A32_FLOAT, + 1, + 0, + D3D11_INPUT_PER_VERTEX_DATA, + 0, }, { - "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0, + "TEXCOORD", + 0, + DXGI_FORMAT_R32G32_FLOAT, + 0, + 0, + D3D11_INPUT_PER_VERTEX_DATA, + 0, }, }; diff --git a/util/test/demos/d3d11/d3d11_structured_buffer_misaligned_dirty.cpp b/util/test/demos/d3d11/d3d11_structured_buffer_misaligned_dirty.cpp index ac49558fc..f1e29bd1d 100644 --- a/util/test/demos/d3d11/d3d11_structured_buffer_misaligned_dirty.cpp +++ b/util/test/demos/d3d11/d3d11_structured_buffer_misaligned_dirty.cpp @@ -86,7 +86,8 @@ float4 main() : SV_Target0 ID3D11BufferPtr structbuf = MakeBuffer().Structured(5 * sizeof(uint32_t)).Data(data).SRV().Mappable(); ID3D11ShaderResourceViewPtr structbufSRV[2] = { - MakeSRV(structbuf), MakeSRV(structbuf).FirstElement(5).NumElements(1), + MakeSRV(structbuf), + MakeSRV(structbuf).FirstElement(5).NumElements(1), }; while(Running()) diff --git a/util/test/demos/d3d11/d3d11_structured_buffer_read.cpp b/util/test/demos/d3d11/d3d11_structured_buffer_read.cpp index f41eb9afe..2ee107b22 100644 --- a/util/test/demos/d3d11/d3d11_structured_buffer_read.cpp +++ b/util/test/demos/d3d11/d3d11_structured_buffer_read.cpp @@ -74,7 +74,8 @@ float4 main() : SV_Target0 ID3D11BufferPtr structbuf = MakeBuffer().Structured(5 * sizeof(uint32_t)).Data(data).SRV(); ID3D11ShaderResourceViewPtr structbufSRV[2] = { - MakeSRV(structbuf), MakeSRV(structbuf).FirstElement(5).NumElements(1), + MakeSRV(structbuf), + MakeSRV(structbuf).FirstElement(5).NumElements(1), }; while(Running()) diff --git a/util/test/demos/d3d11/d3d11_test.cpp b/util/test/demos/d3d11/d3d11_test.cpp index 683b9154a..e16feb888 100644 --- a/util/test/demos/d3d11/d3d11_test.cpp +++ b/util/test/demos/d3d11/d3d11_test.cpp @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #define INITGUID @@ -589,7 +589,10 @@ D3D11_DEPTH_STENCIL_DESC D3D11GraphicsTest::GetDepthState() ret.StencilReadMask = D3D11_DEFAULT_STENCIL_READ_MASK; ret.StencilWriteMask = D3D11_DEFAULT_STENCIL_WRITE_MASK; const D3D11_DEPTH_STENCILOP_DESC op = { - D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_COMPARISON_ALWAYS, + D3D11_STENCIL_OP_KEEP, + D3D11_STENCIL_OP_KEEP, + D3D11_STENCIL_OP_KEEP, + D3D11_COMPARISON_ALWAYS, }; ret.FrontFace = op; ret.BackFace = op; diff --git a/util/test/demos/d3d11/d3d11_test.h b/util/test/demos/d3d11/d3d11_test.h index ee864583a..5ac8cb3a8 100644 --- a/util/test/demos/d3d11/d3d11_test.h +++ b/util/test/demos/d3d11/d3d11_test.h @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #pragma once diff --git a/util/test/demos/d3d11/d3d11_texture_zoo.cpp b/util/test/demos/d3d11/d3d11_texture_zoo.cpp index 2003dc002..b51b7444b 100644 --- a/util/test/demos/d3d11/d3d11_texture_zoo.cpp +++ b/util/test/demos/d3d11/d3d11_texture_zoo.cpp @@ -569,9 +569,12 @@ int4 main(float4 pos : SV_Position, uint samp : SV_SampleIndex) : SV_Target0 (texFmt == viewFmt) ? std::string(#texFmt + 12) \ : (std::string(#texFmt + 12) + "->" + (strchr(#viewFmt + 12, '_') + 1)) -#define TEST_CASE(texType, texFmt, viewFmt, compCount, byteWidth, dataType) \ - { \ - TEST_CASE_NAME(texFmt, viewFmt), texFmt, viewFmt, {texType, compCount, byteWidth, dataType}, \ +#define TEST_CASE(texType, texFmt, viewFmt, compCount, byteWidth, dataType) \ + { \ + TEST_CASE_NAME(texFmt, viewFmt), \ + texFmt, \ + viewFmt, \ + {texType, compCount, byteWidth, dataType}, \ } std::vector test_textures; @@ -1001,9 +1004,9 @@ int4 main(float4 pos : SV_Position, uint samp : SV_SampleIndex) : SV_Target0 else { ID3D11RenderTargetViewPtr rtv = - tex1 ? MakeRTV(tex1).Format(t.fmt.viewFmt).FirstSlice(sl).FirstMip(mp) - : tex2 ? MakeRTV(tex2).Format(t.fmt.viewFmt).FirstSlice(sl).FirstMip(mp) - : MakeRTV(tex3).Format(t.fmt.viewFmt).FirstSlice(sl).FirstMip(mp); + tex1 ? MakeRTV(tex1).Format(t.fmt.viewFmt).FirstSlice(sl).FirstMip(mp) + : tex2 ? MakeRTV(tex2).Format(t.fmt.viewFmt).FirstSlice(sl).FirstMip(mp) + : MakeRTV(tex3).Format(t.fmt.viewFmt).FirstSlice(sl).FirstMip(mp); Vec4i params(tex3 ? 0 : sl, mp, flags, tex3 ? sl : 0); ctx->UpdateSubresource(mscb, 0, NULL, ¶ms, sizeof(params), sizeof(params)); @@ -1113,7 +1116,9 @@ int4 main(float4 pos : SV_Position, uint samp : SV_SampleIndex) : SV_Target0 RSSetViewport(view); D3D11_RECT rect = { - (LONG)view.TopLeftX, (LONG)view.TopLeftY, LONG(view.TopLeftX + view.Width), + (LONG)view.TopLeftX, + (LONG)view.TopLeftY, + LONG(view.TopLeftX + view.Width), LONG(view.TopLeftY + view.Height), }; rect.left++; diff --git a/util/test/demos/d3d11/d3d11_vertex_attr_zoo.cpp b/util/test/demos/d3d11/d3d11_vertex_attr_zoo.cpp index 2fa6415dc..4884b60c4 100644 --- a/util/test/demos/d3d11/d3d11_vertex_attr_zoo.cpp +++ b/util/test/demos/d3d11/d3d11_vertex_attr_zoo.cpp @@ -161,36 +161,76 @@ void main(triangle v2f input[3], inout TriangleStream TriStream) D3D11_INPUT_ELEMENT_DESC layoutdesc[] = { { - "SNORM", 0, DXGI_FORMAT_R16G16B16A16_SNORM, 0, offsetof(vertin, i16), - D3D11_INPUT_PER_VERTEX_DATA, 0, + "SNORM", + 0, + DXGI_FORMAT_R16G16B16A16_SNORM, + 0, + offsetof(vertin, i16), + D3D11_INPUT_PER_VERTEX_DATA, + 0, }, { - "UNORM", 0, DXGI_FORMAT_R16G16B16A16_UNORM, 0, offsetof(vertin, u16), - D3D11_INPUT_PER_VERTEX_DATA, 0, + "UNORM", + 0, + DXGI_FORMAT_R16G16B16A16_UNORM, + 0, + offsetof(vertin, u16), + D3D11_INPUT_PER_VERTEX_DATA, + 0, }, { - "UINT", 0, DXGI_FORMAT_R16G16B16A16_UINT, 0, offsetof(vertin, u16), - D3D11_INPUT_PER_VERTEX_DATA, 0, + "UINT", + 0, + DXGI_FORMAT_R16G16B16A16_UINT, + 0, + offsetof(vertin, u16), + D3D11_INPUT_PER_VERTEX_DATA, + 0, }, { - "ARRAY", 0, DXGI_FORMAT_R32G32_FLOAT, 0, offsetof(vertin, arr0), - D3D11_INPUT_PER_VERTEX_DATA, 0, + "ARRAY", + 0, + DXGI_FORMAT_R32G32_FLOAT, + 0, + offsetof(vertin, arr0), + D3D11_INPUT_PER_VERTEX_DATA, + 0, }, { - "ARRAY", 1, DXGI_FORMAT_R32G32_FLOAT, 0, offsetof(vertin, arr1), - D3D11_INPUT_PER_VERTEX_DATA, 0, + "ARRAY", + 1, + DXGI_FORMAT_R32G32_FLOAT, + 0, + offsetof(vertin, arr1), + D3D11_INPUT_PER_VERTEX_DATA, + 0, }, { - "ARRAY", 2, DXGI_FORMAT_R32G32_FLOAT, 0, offsetof(vertin, arr2), - D3D11_INPUT_PER_VERTEX_DATA, 0, + "ARRAY", + 2, + DXGI_FORMAT_R32G32_FLOAT, + 0, + offsetof(vertin, arr2), + D3D11_INPUT_PER_VERTEX_DATA, + 0, }, { - "MATRIX", 0, DXGI_FORMAT_R32G32_FLOAT, 0, offsetof(vertin, mat0), - D3D11_INPUT_PER_VERTEX_DATA, 0, + "MATRIX", + 0, + DXGI_FORMAT_R32G32_FLOAT, + 0, + offsetof(vertin, mat0), + D3D11_INPUT_PER_VERTEX_DATA, + 0, }, { - "MATRIX", 1, DXGI_FORMAT_R32G32_FLOAT, 0, offsetof(vertin, mat1), - D3D11_INPUT_PER_VERTEX_DATA, 0, + "MATRIX", + 1, + DXGI_FORMAT_R32G32_FLOAT, + 0, + offsetof(vertin, mat1), + D3D11_INPUT_PER_VERTEX_DATA, + 0, }, }; diff --git a/util/test/demos/d3d11/d3d11_video_textures.cpp b/util/test/demos/d3d11/d3d11_video_textures.cpp index f47b3fed9..d83493da5 100644 --- a/util/test/demos/d3d11/d3d11_video_textures.cpp +++ b/util/test/demos/d3d11/d3d11_video_textures.cpp @@ -187,8 +187,14 @@ float4 main(v2f IN) : SV_Target0 bool video_loaded = false; // implement IUnknown - ULONG STDMETHODCALLTYPE AddRef() { return 1; } - ULONG STDMETHODCALLTYPE Release() { return 1; } + ULONG STDMETHODCALLTYPE AddRef() + { + return 1; + } + ULONG STDMETHODCALLTYPE Release() + { + return 1; + } HRESULT STDMETHODCALLTYPE QueryInterface(const IID &iid, void **obj) { if(iid == __uuidof(IUnknown)) @@ -819,7 +825,8 @@ float4 main(v2f IN) : SV_Target0 RSSetViewport({0.0f, 100.0f, 356.0f, 200.0f, 0.0f, 1.0f}); Vec4i videoConfig[] = { - Vec4i(videoWidth, videoHeight, 2, 2), Vec4i(0, 4, 5, 1), + Vec4i(videoWidth, videoHeight, 2, 2), + Vec4i(0, 4, 5, 1), }; if(annot) diff --git a/util/test/demos/d3d12/d3d12_compute_only.cpp b/util/test/demos/d3d12/d3d12_compute_only.cpp index 7deab1b0f..95327d89c 100644 --- a/util/test/demos/d3d12/d3d12_compute_only.cpp +++ b/util/test/demos/d3d12/d3d12_compute_only.cpp @@ -62,7 +62,8 @@ void main() ID3DBlobPtr csblob = Compile(compute, "main", "cs_5_0"); ID3D12RootSignaturePtr sig = MakeSig({ - uavParam(D3D12_SHADER_VISIBILITY_ALL, 0, 0), uavParam(D3D12_SHADER_VISIBILITY_ALL, 0, 1), + uavParam(D3D12_SHADER_VISIBILITY_ALL, 0, 0), + uavParam(D3D12_SHADER_VISIBILITY_ALL, 0, 1), constParam(D3D12_SHADER_VISIBILITY_ALL, 0, 0, 4), tableParam(D3D12_SHADER_VISIBILITY_ALL, D3D12_DESCRIPTOR_RANGE_TYPE_UAV, 0, 2, 1, 3), }); diff --git a/util/test/demos/d3d12/d3d12_descriptor_indexing.cpp b/util/test/demos/d3d12/d3d12_descriptor_indexing.cpp index 2cfbb52ff..a4320d704 100644 --- a/util/test/demos/d3d12/d3d12_descriptor_indexing.cpp +++ b/util/test/demos/d3d12/d3d12_descriptor_indexing.cpp @@ -277,9 +277,10 @@ float4 main(v2f IN) : SV_Target0 graphicspso[2] = MakePSO().RootSig(graphicssigs[2]).InputLayout().VS(vsblob[2]).PS(psblob[2]); computepso[3] = computepso[2]; - graphicssigs[3] = MakeSig({}, D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT | - D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED | - D3D12_ROOT_SIGNATURE_FLAG_CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED, + graphicssigs[3] = MakeSig({}, + D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT | + D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED | + D3D12_ROOT_SIGNATURE_FLAG_CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED, 0, NULL); graphicspso[3] = MakePSO().RootSig(graphicssigs[3]).InputLayout().VS(vsblob[2]).PS(psblob[3]); } diff --git a/util/test/demos/d3d12/d3d12_helpers.cpp b/util/test/demos/d3d12/d3d12_helpers.cpp index 54379b1d2..dd7e725d5 100644 --- a/util/test/demos/d3d12/d3d12_helpers.cpp +++ b/util/test/demos/d3d12/d3d12_helpers.cpp @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #include "d3d12_test.h" @@ -564,124 +564,233 @@ void D3D12ViewCreator::SetupDescriptors(ViewType viewType, ResourceType resType) // &firstMip, &numMips, &firstSlice, &numSlices, &planeSlice {NULL, NULL, NULL, NULL, NULL}, { - &desc.srv.Texture1D.MostDetailedMip, &desc.srv.Texture1D.MipLevels, NULL, NULL, NULL, + &desc.srv.Texture1D.MostDetailedMip, + &desc.srv.Texture1D.MipLevels, + NULL, + NULL, + NULL, }, { - &desc.srv.Texture1DArray.MostDetailedMip, &desc.srv.Texture1DArray.MipLevels, - &desc.srv.Texture1DArray.FirstArraySlice, &desc.srv.Texture1DArray.ArraySize, NULL, + &desc.srv.Texture1DArray.MostDetailedMip, + &desc.srv.Texture1DArray.MipLevels, + &desc.srv.Texture1DArray.FirstArraySlice, + &desc.srv.Texture1DArray.ArraySize, + NULL, }, { - &desc.srv.Texture2D.MostDetailedMip, &desc.srv.Texture2D.MipLevels, NULL, NULL, + &desc.srv.Texture2D.MostDetailedMip, + &desc.srv.Texture2D.MipLevels, + NULL, + NULL, &desc.srv.Texture2D.PlaneSlice, }, { - &desc.srv.Texture2DArray.MostDetailedMip, &desc.srv.Texture2DArray.MipLevels, - &desc.srv.Texture2DArray.FirstArraySlice, &desc.srv.Texture2DArray.ArraySize, + &desc.srv.Texture2DArray.MostDetailedMip, + &desc.srv.Texture2DArray.MipLevels, + &desc.srv.Texture2DArray.FirstArraySlice, + &desc.srv.Texture2DArray.ArraySize, &desc.srv.Texture2DArray.PlaneSlice, }, { - NULL, NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, + NULL, }, { - NULL, NULL, &desc.srv.Texture2DMSArray.FirstArraySlice, - &desc.srv.Texture2DMSArray.ArraySize, NULL, + NULL, + NULL, + &desc.srv.Texture2DMSArray.FirstArraySlice, + &desc.srv.Texture2DMSArray.ArraySize, + NULL, }, { - &desc.srv.Texture3D.MostDetailedMip, &desc.srv.Texture2D.MipLevels, NULL, NULL, NULL, + &desc.srv.Texture3D.MostDetailedMip, + &desc.srv.Texture2D.MipLevels, + NULL, + NULL, + NULL, }, }, // RTV { // &firstMip, &numMips, &firstSlice, &numSlices { - NULL, NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, + NULL, }, { - &desc.rtv.Texture1D.MipSlice, NULL, NULL, NULL, NULL, + &desc.rtv.Texture1D.MipSlice, + NULL, + NULL, + NULL, + NULL, }, { - &desc.rtv.Texture1DArray.MipSlice, NULL, &desc.rtv.Texture1DArray.FirstArraySlice, - &desc.rtv.Texture1DArray.ArraySize, NULL, + &desc.rtv.Texture1DArray.MipSlice, + NULL, + &desc.rtv.Texture1DArray.FirstArraySlice, + &desc.rtv.Texture1DArray.ArraySize, + NULL, }, { - &desc.rtv.Texture2D.MipSlice, NULL, NULL, NULL, &desc.rtv.Texture2D.PlaneSlice, + &desc.rtv.Texture2D.MipSlice, + NULL, + NULL, + NULL, + &desc.rtv.Texture2D.PlaneSlice, }, { - &desc.rtv.Texture2DArray.MipSlice, NULL, &desc.rtv.Texture2DArray.FirstArraySlice, - &desc.rtv.Texture2DArray.ArraySize, &desc.rtv.Texture2DArray.PlaneSlice, + &desc.rtv.Texture2DArray.MipSlice, + NULL, + &desc.rtv.Texture2DArray.FirstArraySlice, + &desc.rtv.Texture2DArray.ArraySize, + &desc.rtv.Texture2DArray.PlaneSlice, }, { - NULL, NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, + NULL, }, { - NULL, NULL, &desc.rtv.Texture2DMSArray.FirstArraySlice, - &desc.rtv.Texture2DMSArray.ArraySize, NULL, + NULL, + NULL, + &desc.rtv.Texture2DMSArray.FirstArraySlice, + &desc.rtv.Texture2DMSArray.ArraySize, + NULL, }, { - &desc.rtv.Texture3D.MipSlice, NULL, &desc.rtv.Texture3D.FirstWSlice, - &desc.rtv.Texture3D.WSize, NULL, + &desc.rtv.Texture3D.MipSlice, + NULL, + &desc.rtv.Texture3D.FirstWSlice, + &desc.rtv.Texture3D.WSize, + NULL, }, }, // DSV { // &firstMip, &numMips, &firstSlice, &numSlices { - NULL, NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, + NULL, }, { - &desc.dsv.Texture1D.MipSlice, NULL, NULL, NULL, NULL, + &desc.dsv.Texture1D.MipSlice, + NULL, + NULL, + NULL, + NULL, }, { - &desc.dsv.Texture1DArray.MipSlice, NULL, &desc.dsv.Texture1DArray.FirstArraySlice, - &desc.dsv.Texture1DArray.ArraySize, NULL, + &desc.dsv.Texture1DArray.MipSlice, + NULL, + &desc.dsv.Texture1DArray.FirstArraySlice, + &desc.dsv.Texture1DArray.ArraySize, + NULL, }, { - &desc.dsv.Texture2D.MipSlice, NULL, NULL, NULL, NULL, + &desc.dsv.Texture2D.MipSlice, + NULL, + NULL, + NULL, + NULL, }, { - &desc.dsv.Texture2DArray.MipSlice, NULL, &desc.dsv.Texture2DArray.FirstArraySlice, - &desc.dsv.Texture2DArray.ArraySize, NULL, + &desc.dsv.Texture2DArray.MipSlice, + NULL, + &desc.dsv.Texture2DArray.FirstArraySlice, + &desc.dsv.Texture2DArray.ArraySize, + NULL, }, { - NULL, NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, + NULL, }, { - NULL, NULL, &desc.dsv.Texture2DMSArray.FirstArraySlice, - &desc.dsv.Texture2DMSArray.ArraySize, NULL, + NULL, + NULL, + &desc.dsv.Texture2DMSArray.FirstArraySlice, + &desc.dsv.Texture2DMSArray.ArraySize, + NULL, }, { - NULL, NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, + NULL, }, }, // UAV { // &firstMip, &numMips, &firstSlice, &numSlices { - NULL, NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, + NULL, }, { - &desc.uav.Texture1D.MipSlice, NULL, NULL, NULL, NULL, + &desc.uav.Texture1D.MipSlice, + NULL, + NULL, + NULL, + NULL, }, { - &desc.uav.Texture1DArray.MipSlice, NULL, &desc.uav.Texture1DArray.FirstArraySlice, - &desc.uav.Texture1DArray.ArraySize, NULL, + &desc.uav.Texture1DArray.MipSlice, + NULL, + &desc.uav.Texture1DArray.FirstArraySlice, + &desc.uav.Texture1DArray.ArraySize, + NULL, }, { - &desc.uav.Texture2D.MipSlice, NULL, NULL, NULL, &desc.uav.Texture2D.PlaneSlice, + &desc.uav.Texture2D.MipSlice, + NULL, + NULL, + NULL, + &desc.uav.Texture2D.PlaneSlice, }, { - &desc.uav.Texture2DArray.MipSlice, NULL, &desc.uav.Texture2DArray.FirstArraySlice, - &desc.uav.Texture2DArray.ArraySize, &desc.uav.Texture2DArray.PlaneSlice, + &desc.uav.Texture2DArray.MipSlice, + NULL, + &desc.uav.Texture2DArray.FirstArraySlice, + &desc.uav.Texture2DArray.ArraySize, + &desc.uav.Texture2DArray.PlaneSlice, }, { - NULL, NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, + NULL, }, { - NULL, NULL, NULL, NULL, NULL, + NULL, + NULL, + NULL, + NULL, + NULL, }, { - &desc.uav.Texture3D.MipSlice, NULL, &desc.uav.Texture3D.FirstWSlice, - &desc.uav.Texture3D.WSize, NULL, + &desc.uav.Texture3D.MipSlice, + NULL, + &desc.uav.Texture3D.FirstWSlice, + &desc.uav.Texture3D.WSize, + NULL, }, }, }; diff --git a/util/test/demos/d3d12/d3d12_helpers.h b/util/test/demos/d3d12/d3d12_helpers.h index 4b6f58b1c..16b1ac2f4 100644 --- a/util/test/demos/d3d12/d3d12_helpers.h +++ b/util/test/demos/d3d12/d3d12_helpers.h @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #pragma once diff --git a/util/test/demos/d3d12/d3d12_parameter_zoo.cpp b/util/test/demos/d3d12/d3d12_parameter_zoo.cpp index 3158155c2..97201193e 100644 --- a/util/test/demos/d3d12/d3d12_parameter_zoo.cpp +++ b/util/test/demos/d3d12/d3d12_parameter_zoo.cpp @@ -184,7 +184,8 @@ float4 main() : SV_Target0 D3D12_GPU_DESCRIPTOR_HANDLE descGPUHandle = descHeap->GetGPUDescriptorHandleForHeapStart(); ID3D12DescriptorHeap *heaps[] = { - descHeap.GetInterfacePtr(), sampHeap.GetInterfacePtr(), + descHeap.GetInterfacePtr(), + sampHeap.GetInterfacePtr(), }; D3D12_SHADER_RESOURCE_VIEW_DESC srvDesc = {}; diff --git a/util/test/demos/d3d12/d3d12_resource_lifetimes.cpp b/util/test/demos/d3d12/d3d12_resource_lifetimes.cpp index 4891e2c67..015e18213 100644 --- a/util/test/demos/d3d12/d3d12_resource_lifetimes.cpp +++ b/util/test/demos/d3d12/d3d12_resource_lifetimes.cpp @@ -203,13 +203,25 @@ float4 main(v2f IN) : SV_Target0 const uint32_t checker[4 * 4] = { // X X O O - 0xffffffff, 0xffffffff, 0, 0, + 0xffffffff, + 0xffffffff, + 0, + 0, // X X O O - 0xffffffff, 0xffffffff, 0, 0, + 0xffffffff, + 0xffffffff, + 0, + 0, // O O X X - 0, 0, 0xffffffff, 0xffffffff, + 0, + 0, + 0xffffffff, + 0xffffffff, // O O X X - 0, 0, 0xffffffff, 0xffffffff, + 0, + 0, + 0xffffffff, + 0xffffffff, }; { diff --git a/util/test/demos/d3d12/d3d12_resource_mapping_zoo.cpp b/util/test/demos/d3d12/d3d12_resource_mapping_zoo.cpp index 718d5590c..57d97fdd0 100644 --- a/util/test/demos/d3d12/d3d12_resource_mapping_zoo.cpp +++ b/util/test/demos/d3d12/d3d12_resource_mapping_zoo.cpp @@ -318,7 +318,8 @@ float4 main(float4 pos : SV_Position) : SV_Target0 tableParam(D3D12_SHADER_VISIBILITY_PIXEL, D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 1, 0, UINT_MAX, 30), tableParam(D3D12_SHADER_VISIBILITY_PIXEL, D3D12_DESCRIPTOR_RANGE_TYPE_UAV, 0, 0, 1, 56), tableParam(D3D12_SHADER_VISIBILITY_PIXEL, D3D12_DESCRIPTOR_RANGE_TYPE_UAV, 0, 1, 1, 57), - cbvParam(D3D12_SHADER_VISIBILITY_PIXEL, 0, 0), cbvParam(D3D12_SHADER_VISIBILITY_PIXEL, 0, 1), + cbvParam(D3D12_SHADER_VISIBILITY_PIXEL, 0, 0), + cbvParam(D3D12_SHADER_VISIBILITY_PIXEL, 0, 1), tableParam(D3D12_SHADER_VISIBILITY_PIXEL, D3D12_DESCRIPTOR_RANGE_TYPE_CBV, 1, 0, 8, 0), }); diff --git a/util/test/demos/d3d12/d3d12_shader_debug_zoo.cpp b/util/test/demos/d3d12/d3d12_shader_debug_zoo.cpp index c0dd47aad..5312c8b28 100644 --- a/util/test/demos/d3d12/d3d12_shader_debug_zoo.cpp +++ b/util/test/demos/d3d12/d3d12_shader_debug_zoo.cpp @@ -809,20 +809,40 @@ float4 main(v2f IN, uint samp : SV_SampleIndex) : SV_Target0 std::vector inputLayout; inputLayout.reserve(4); inputLayout.push_back({ - "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, - D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0, + "POSITION", + 0, + DXGI_FORMAT_R32G32B32_FLOAT, + 0, + 0, + D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, + 0, }); inputLayout.push_back({ - "ZERO", 0, DXGI_FORMAT_R32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, - D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0, + "ZERO", + 0, + DXGI_FORMAT_R32_FLOAT, + 0, + D3D12_APPEND_ALIGNED_ELEMENT, + D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, + 0, }); inputLayout.push_back({ - "ONE", 0, DXGI_FORMAT_R32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, - D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0, + "ONE", + 0, + DXGI_FORMAT_R32_FLOAT, + 0, + D3D12_APPEND_ALIGNED_ELEMENT, + D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, + 0, }); inputLayout.push_back({ - "NEGONE", 0, DXGI_FORMAT_R32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, - D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0, + "NEGONE", + 0, + DXGI_FORMAT_R32_FLOAT, + 0, + D3D12_APPEND_ALIGNED_ELEMENT, + D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, + 0, }); D3D12_STATIC_SAMPLER_DESC staticSamp = {}; @@ -832,19 +852,28 @@ float4 main(v2f IN, uint samp : SV_SampleIndex) : SV_Target0 D3D12_DESCRIPTOR_RANGE1 multiRanges[3] = { { - D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 2, 30, 0, + D3D12_DESCRIPTOR_RANGE_TYPE_SRV, + 2, + 30, + 0, D3D12_DESCRIPTOR_RANGE_FLAG_DESCRIPTORS_VOLATILE | D3D12_DESCRIPTOR_RANGE_FLAG_DATA_VOLATILE, 30, }, { - D3D12_DESCRIPTOR_RANGE_TYPE_UAV, 3, 32, 0, + D3D12_DESCRIPTOR_RANGE_TYPE_UAV, + 3, + 32, + 0, D3D12_DESCRIPTOR_RANGE_FLAG_DESCRIPTORS_VOLATILE | D3D12_DESCRIPTOR_RANGE_FLAG_DATA_VOLATILE, D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND, }, { - D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 2, 40, 0, + D3D12_DESCRIPTOR_RANGE_TYPE_SRV, + 2, + 40, + 0, D3D12_DESCRIPTOR_RANGE_FLAG_DESCRIPTORS_VOLATILE | D3D12_DESCRIPTOR_RANGE_FLAG_DATA_VOLATILE, D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND, @@ -862,7 +891,8 @@ float4 main(v2f IN, uint samp : SV_SampleIndex) : SV_Target0 tableParam(D3D12_SHADER_VISIBILITY_PIXEL, D3D12_DESCRIPTOR_RANGE_TYPE_UAV, 0, 1, 2, 10), tableParam(D3D12_SHADER_VISIBILITY_PIXEL, D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 0, 100, 5, 20), tableParam(D3D12_SHADER_VISIBILITY_PIXEL, D3D12_DESCRIPTOR_RANGE_TYPE_UAV, 0, 4, 3, 30), - multiRangeParam, uavParam(D3D12_SHADER_VISIBILITY_PIXEL, 0, 21), + multiRangeParam, + uavParam(D3D12_SHADER_VISIBILITY_PIXEL, 0, 21), srvParam(D3D12_SHADER_VISIBILITY_PIXEL, 0, 20), }, D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT, 1, &staticSamp); diff --git a/util/test/demos/d3d12/d3d12_test.cpp b/util/test/demos/d3d12/d3d12_test.cpp index 733f0cb04..b084ac116 100644 --- a/util/test/demos/d3d12/d3d12_test.cpp +++ b/util/test/demos/d3d12/d3d12_test.cpp @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #define INITGUID diff --git a/util/test/demos/d3d12/d3d12_test.h b/util/test/demos/d3d12/d3d12_test.h index 58ad4206e..e2c5d922e 100644 --- a/util/test/demos/d3d12/d3d12_test.h +++ b/util/test/demos/d3d12/d3d12_test.h @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #pragma once diff --git a/util/test/demos/d3d12/d3d12_texture_zoo.cpp b/util/test/demos/d3d12/d3d12_texture_zoo.cpp index fed7ac3be..0e800b159 100644 --- a/util/test/demos/d3d12/d3d12_texture_zoo.cpp +++ b/util/test/demos/d3d12/d3d12_texture_zoo.cpp @@ -643,9 +643,12 @@ int4 main(float4 pos : SV_Position, uint samp : SV_SampleIndex) : SV_Target0 (texFmt == viewFmt) ? std::string(#texFmt + 12) \ : (std::string(#texFmt + 12) + "->" + (strchr(#viewFmt + 12, '_') + 1)) -#define TEST_CASE(texType, texFmt, viewFmt, compCount, byteWidth, dataType) \ - { \ - TEST_CASE_NAME(texFmt, viewFmt), texFmt, viewFmt, {texType, compCount, byteWidth, dataType}, \ +#define TEST_CASE(texType, texFmt, viewFmt, compCount, byteWidth, dataType) \ + { \ + TEST_CASE_NAME(texFmt, viewFmt), \ + texFmt, \ + viewFmt, \ + {texType, compCount, byteWidth, dataType}, \ } std::vector test_textures; @@ -1246,7 +1249,9 @@ int4 main(float4 pos : SV_Position, uint samp : SV_SampleIndex) : SV_Target0 { RSSetViewport(cmd, view); D3D12_RECT rect = { - (LONG)view.TopLeftX, (LONG)view.TopLeftY, LONG(view.TopLeftX + view.Width), + (LONG)view.TopLeftX, + (LONG)view.TopLeftY, + LONG(view.TopLeftX + view.Width), LONG(view.TopLeftY + view.Height), }; RSSetScissorRect(cmd, rect); @@ -1280,7 +1285,9 @@ int4 main(float4 pos : SV_Position, uint samp : SV_SampleIndex) : SV_Target0 RSSetViewport(cmd, view); D3D12_RECT rect = { - (LONG)view.TopLeftX, (LONG)view.TopLeftY, LONG(view.TopLeftX + view.Width), + (LONG)view.TopLeftX, + (LONG)view.TopLeftY, + LONG(view.TopLeftX + view.Width), LONG(view.TopLeftY + view.Height), }; rect.left++; diff --git a/util/test/demos/d3d12/d3d12_vertex_attr_zoo.cpp b/util/test/demos/d3d12/d3d12_vertex_attr_zoo.cpp index 496530d69..f7628492d 100644 --- a/util/test/demos/d3d12/d3d12_vertex_attr_zoo.cpp +++ b/util/test/demos/d3d12/d3d12_vertex_attr_zoo.cpp @@ -165,36 +165,76 @@ void main(triangle v2f input[3], inout TriangleStream TriStream) ID3D12PipelineStatePtr pso = MakePSO().RootSig(sig).VS(vsblob).PS(psblob).GS(gsblob).InputLayout({ { - "SNORM", 0, DXGI_FORMAT_R16G16B16A16_SNORM, 0, offsetof(vertin, i16), - D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0, + "SNORM", + 0, + DXGI_FORMAT_R16G16B16A16_SNORM, + 0, + offsetof(vertin, i16), + D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, + 0, }, { - "UNORM", 0, DXGI_FORMAT_R16G16B16A16_UNORM, 0, offsetof(vertin, u16), - D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0, + "UNORM", + 0, + DXGI_FORMAT_R16G16B16A16_UNORM, + 0, + offsetof(vertin, u16), + D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, + 0, }, { - "UINT", 0, DXGI_FORMAT_R16G16B16A16_UINT, 0, offsetof(vertin, u16), - D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0, + "UINT", + 0, + DXGI_FORMAT_R16G16B16A16_UINT, + 0, + offsetof(vertin, u16), + D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, + 0, }, { - "ARRAY", 0, DXGI_FORMAT_R32G32_FLOAT, 0, offsetof(vertin, arr0), - D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0, + "ARRAY", + 0, + DXGI_FORMAT_R32G32_FLOAT, + 0, + offsetof(vertin, arr0), + D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, + 0, }, { - "ARRAY", 1, DXGI_FORMAT_R32G32_FLOAT, 0, offsetof(vertin, arr1), - D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0, + "ARRAY", + 1, + DXGI_FORMAT_R32G32_FLOAT, + 0, + offsetof(vertin, arr1), + D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, + 0, }, { - "ARRAY", 2, DXGI_FORMAT_R32G32_FLOAT, 0, offsetof(vertin, arr2), - D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0, + "ARRAY", + 2, + DXGI_FORMAT_R32G32_FLOAT, + 0, + offsetof(vertin, arr2), + D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, + 0, }, { - "MATRIX", 0, DXGI_FORMAT_R32G32_FLOAT, 0, offsetof(vertin, mat0), - D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0, + "MATRIX", + 0, + DXGI_FORMAT_R32G32_FLOAT, + 0, + offsetof(vertin, mat0), + D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, + 0, }, { - "MATRIX", 1, DXGI_FORMAT_R32G32_FLOAT, 0, offsetof(vertin, mat1), - D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0, + "MATRIX", + 1, + DXGI_FORMAT_R32G32_FLOAT, + 0, + offsetof(vertin, mat1), + D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, + 0, }, }); diff --git a/util/test/demos/d3d12/d3d12_vertex_uav.cpp b/util/test/demos/d3d12/d3d12_vertex_uav.cpp index 58a024f7b..9f6520485 100644 --- a/util/test/demos/d3d12/d3d12_vertex_uav.cpp +++ b/util/test/demos/d3d12/d3d12_vertex_uav.cpp @@ -81,7 +81,8 @@ v2f main(uint vid : SV_VertexID) ID3D12ResourcePtr vb = MakeBuffer().Data(DefaultTri); ID3D12RootSignaturePtr sig = MakeSig({ - uavParam(D3D12_SHADER_VISIBILITY_ALL, 0, 0), uavParam(D3D12_SHADER_VISIBILITY_VERTEX, 0, 1), + uavParam(D3D12_SHADER_VISIBILITY_ALL, 0, 0), + uavParam(D3D12_SHADER_VISIBILITY_VERTEX, 0, 1), }); // 105202922 is the magic space renderdoc tries to use to avoid collisions diff --git a/util/test/demos/d3d12/d3d12_video_textures.cpp b/util/test/demos/d3d12/d3d12_video_textures.cpp index 87ca87661..8dbf62f5b 100644 --- a/util/test/demos/d3d12/d3d12_video_textures.cpp +++ b/util/test/demos/d3d12/d3d12_video_textures.cpp @@ -294,7 +294,8 @@ float4 main(v2f IN) : SV_Target0 .Mips(1) .InitialState(D3D12_RESOURCE_STATE_COPY_DEST); Vec4i cbdata[2] = { - Vec4i(rgba8.width, rgba8.height, horizDownsampleFactor, vertDownsampleFactor), config, + Vec4i(rgba8.width, rgba8.height, horizDownsampleFactor, vertDownsampleFactor), + config, }; ID3D12ResourcePtr cb = MakeBuffer().Data(cbdata); diff --git a/util/test/demos/d3d12/d3d12_vrs.cpp b/util/test/demos/d3d12/d3d12_vrs.cpp index 34f951a5b..bb0705679 100644 --- a/util/test/demos/d3d12/d3d12_vrs.cpp +++ b/util/test/demos/d3d12/d3d12_vrs.cpp @@ -186,7 +186,8 @@ OUT main(float3 pos : POSITION, float4 col : COLOR0) ID3D12GraphicsCommandList5Ptr cmd5 = cmd; D3D12_SHADING_RATE_COMBINER combiners[] = { - D3D12_SHADING_RATE_COMBINER_MAX, D3D12_SHADING_RATE_COMBINER_MAX, + D3D12_SHADING_RATE_COMBINER_MAX, + D3D12_SHADING_RATE_COMBINER_MAX, }; pushMarker(cmd, "First"); diff --git a/util/test/demos/dx/d3d_helpers.cpp b/util/test/demos/dx/d3d_helpers.cpp index 7a75edfa5..ce4c8c170 100644 --- a/util/test/demos/dx/d3d_helpers.cpp +++ b/util/test/demos/dx/d3d_helpers.cpp @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #include "d3d_helpers.h" #include "../test_common.h" diff --git a/util/test/demos/dx/d3d_helpers.h b/util/test/demos/dx/d3d_helpers.h index 9c7a5194f..c9c6846a7 100644 --- a/util/test/demos/dx/d3d_helpers.h +++ b/util/test/demos/dx/d3d_helpers.h @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #pragma once diff --git a/util/test/demos/gl/gl_buffer_updates.cpp b/util/test/demos/gl/gl_buffer_updates.cpp index ac8c1ebd4..2286826a5 100644 --- a/util/test/demos/gl/gl_buffer_updates.cpp +++ b/util/test/demos/gl/gl_buffer_updates.cpp @@ -221,16 +221,17 @@ void main() GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT); ptrs[CoherentMapWriteInvalidateRange] = (Vec4f *)glMapBufferRange( - GL_UNIFORM_BUFFER, 0, sizeof(Vec4f), GL_MAP_COHERENT_BIT | GL_MAP_PERSISTENT_BIT | - GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_RANGE_BIT); + GL_UNIFORM_BUFFER, 0, sizeof(Vec4f), + GL_MAP_COHERENT_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_RANGE_BIT); glBindBuffer(GL_UNIFORM_BUFFER, buffers[CoherentMapWriteInvalidateBuffer]); glBufferStorage(GL_UNIFORM_BUFFER, sizeof(Vec4f), &red, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT); - ptrs[CoherentMapWriteInvalidateBuffer] = (Vec4f *)glMapBufferRange( - GL_UNIFORM_BUFFER, 0, sizeof(Vec4f), GL_MAP_COHERENT_BIT | GL_MAP_PERSISTENT_BIT | - GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT); + ptrs[CoherentMapWriteInvalidateBuffer] = + (Vec4f *)glMapBufferRange(GL_UNIFORM_BUFFER, 0, sizeof(Vec4f), + GL_MAP_COHERENT_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_WRITE_BIT | + GL_MAP_INVALIDATE_BUFFER_BIT); glBindBuffer(GL_UNIFORM_BUFFER, buffers[CoherentMapWriteUnsynchronised]); glBufferStorage(GL_UNIFORM_BUFFER, sizeof(Vec4f), &red, diff --git a/util/test/demos/gl/gl_cbuffer_zoo.cpp b/util/test/demos/gl/gl_cbuffer_zoo.cpp index 59a09e339..267257d2b 100644 --- a/util/test/demos/gl/gl_cbuffer_zoo.cpp +++ b/util/test/demos/gl/gl_cbuffer_zoo.cpp @@ -504,13 +504,25 @@ void main() float vals[] = { // b[0] - 720.0f, 730.0f, 740.0f, 750.0f, + 720.0f, + 730.0f, + 740.0f, + 750.0f, // b[1] - 760.0f, 770.0f, 780.0f, 790.0f, + 760.0f, + 770.0f, + 780.0f, + 790.0f, // b[2] - 800.0f, 810.0f, 820.0f, 830.0f, + 800.0f, + 810.0f, + 820.0f, + 830.0f, // b[3] - 840.0f, 850.0f, 860.0f, 870.0f, + 840.0f, + 850.0f, + 860.0f, + 870.0f, }; location = glGetUniformLocation(program, "G[0].b"); @@ -559,13 +571,25 @@ void main() float vals2[] = { // b[0] - 1080.0f, 1090.0f, 1100.0f, 1110.0f, + 1080.0f, + 1090.0f, + 1100.0f, + 1110.0f, // b[1] - 1120.0f, 1130.0f, 1140.0f, 1150.0f, + 1120.0f, + 1130.0f, + 1140.0f, + 1150.0f, // b[2] - 1160.0f, 1170.0f, 1180.0f, 1190.0f, + 1160.0f, + 1170.0f, + 1180.0f, + 1190.0f, // b[3] - 1200.0f, 1210.0f, 1220.0f, 1230.0f, + 1200.0f, + 1210.0f, + 1220.0f, + 1230.0f, }; location = glGetUniformLocation(program, "G[1].b"); diff --git a/util/test/demos/gl/gl_discard_zoo.cpp b/util/test/demos/gl/gl_discard_zoo.cpp index e6e33ed2a..7f44620ad 100644 --- a/util/test/demos/gl/gl_discard_zoo.cpp +++ b/util/test/demos/gl/gl_discard_zoo.cpp @@ -32,7 +32,10 @@ RD_TEST(GL_Discard_Zoo, OpenGLGraphicsTest) uint32_t greens10_2[300 * 300]; - void SetDebugName(GLuint t, std::string name) { glObjectLabel(GL_TEXTURE, t, -1, name.c_str()); } + void SetDebugName(GLuint t, std::string name) + { + glObjectLabel(GL_TEXTURE, t, -1, name.c_str()); + } void Clear(GLuint t) { GLenum fmt = GL_NONE; diff --git a/util/test/demos/gl/gl_large_bcn_arrays.cpp b/util/test/demos/gl/gl_large_bcn_arrays.cpp index a6b67aa02..fa2c56dbb 100644 --- a/util/test/demos/gl/gl_large_bcn_arrays.cpp +++ b/util/test/demos/gl/gl_large_bcn_arrays.cpp @@ -113,8 +113,10 @@ void main() GLenum texbind = arraySize > 1 ? GL_TEXTURE_2D_ARRAY : GL_TEXTURE_2D; const char *names[] = { - arraySize > 1 ? "BC4 array" : "BC4", arraySize > 1 ? "BC5 array" : "BC5", - arraySize > 1 ? "BC6 array" : "BC6", arraySize > 1 ? "BC7 array" : "BC7", + arraySize > 1 ? "BC4 array" : "BC4", + arraySize > 1 ? "BC5 array" : "BC5", + arraySize > 1 ? "BC6 array" : "BC6", + arraySize > 1 ? "BC7 array" : "BC7", }; for(int fmt = 0; fmt < 4; fmt++) diff --git a/util/test/demos/gl/gl_resource_lifetimes.cpp b/util/test/demos/gl/gl_resource_lifetimes.cpp index 82de9b1f4..27960305e 100644 --- a/util/test/demos/gl/gl_resource_lifetimes.cpp +++ b/util/test/demos/gl/gl_resource_lifetimes.cpp @@ -326,13 +326,25 @@ void main() auto SetupTex = []() { const uint32_t checker[4 * 4] = { // X X O O - 0xffffffff, 0xffffffff, 0, 0, + 0xffffffff, + 0xffffffff, + 0, + 0, // X X O O - 0xffffffff, 0xffffffff, 0, 0, + 0xffffffff, + 0xffffffff, + 0, + 0, // O O X X - 0, 0, 0xffffffff, 0xffffffff, + 0, + 0, + 0xffffffff, + 0xffffffff, // O O X X - 0, 0, 0xffffffff, 0xffffffff, + 0, + 0, + 0xffffffff, + 0xffffffff, }; GLuint tex = 0; diff --git a/util/test/demos/gl/gl_spirv_shader.cpp b/util/test/demos/gl/gl_spirv_shader.cpp index bfb519549..aedc25a78 100644 --- a/util/test/demos/gl/gl_spirv_shader.cpp +++ b/util/test/demos/gl/gl_spirv_shader.cpp @@ -115,13 +115,25 @@ void main() uint32_t pixels[] = { // row 0 - 0xff0e1f00, 0xfff0b207, 0xff02ff00, 0xff03ff00, + 0xff0e1f00, + 0xfff0b207, + 0xff02ff00, + 0xff03ff00, // row 1 - 0xff090f00, 0xff081eb0, 0xff010005, 0xff905f00, + 0xff090f00, + 0xff081eb0, + 0xff010005, + 0xff905f00, // row 2 - 0xff502f03, 0xff004550, 0xff1020a0, 0xff120000, + 0xff502f03, + 0xff004550, + 0xff1020a0, + 0xff120000, // row 3 - 0xff0d3f00, 0xff6091d0, 0xff304ff0, 0xff800000, + 0xff0d3f00, + 0xff6091d0, + 0xff304ff0, + 0xff800000, }; glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 4, 4, GL_RGBA, GL_UNSIGNED_BYTE, pixels); diff --git a/util/test/demos/gl/gl_test.cpp b/util/test/demos/gl/gl_test.cpp index e4e7bc96e..63ba0c442 100644 --- a/util/test/demos/gl/gl_test.cpp +++ b/util/test/demos/gl/gl_test.cpp @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #include "gl_test.h" #include diff --git a/util/test/demos/gl/gl_test.h b/util/test/demos/gl/gl_test.h index 7014f2360..6b4bfbb0d 100644 --- a/util/test/demos/gl/gl_test.h +++ b/util/test/demos/gl/gl_test.h @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #pragma once diff --git a/util/test/demos/gl/gl_test_android.cpp b/util/test/demos/gl/gl_test_android.cpp index fdeba9426..16ad4aa09 100644 --- a/util/test/demos/gl/gl_test_android.cpp +++ b/util/test/demos/gl/gl_test_android.cpp @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #include "gl_test.h" #include diff --git a/util/test/demos/gl/gl_test_linux.cpp b/util/test/demos/gl/gl_test_linux.cpp index bb6c71b42..f26c7255f 100644 --- a/util/test/demos/gl/gl_test_linux.cpp +++ b/util/test/demos/gl/gl_test_linux.cpp @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #include "gl_test.h" #include diff --git a/util/test/demos/gl/gl_test_win32.cpp b/util/test/demos/gl/gl_test_win32.cpp index a24e38210..333b02725 100644 --- a/util/test/demos/gl/gl_test_win32.cpp +++ b/util/test/demos/gl/gl_test_win32.cpp @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #include "gl_test.h" #include diff --git a/util/test/demos/gl/gl_texture_zoo.cpp b/util/test/demos/gl/gl_texture_zoo.cpp index f3d77ff7a..50e03446f 100644 --- a/util/test/demos/gl/gl_texture_zoo.cpp +++ b/util/test/demos/gl/gl_texture_zoo.cpp @@ -752,9 +752,11 @@ void main() #define TEST_CASE_NAME(texFmt) #texFmt -#define TEST_CASE(texType, texFmt, compCount, byteWidth, dataType) \ - { \ - &(#texFmt)[3], texFmt, {texType, compCount, byteWidth, dataType}, \ +#define TEST_CASE(texType, texFmt, compCount, byteWidth, dataType) \ + { \ + &(#texFmt)[3], \ + texFmt, \ + {texType, compCount, byteWidth, dataType}, \ } std::vector test_textures; diff --git a/util/test/demos/linux/linux_platform.cpp b/util/test/demos/linux/linux_platform.cpp index 40166b97c..0a89708e7 100644 --- a/util/test/demos/linux/linux_platform.cpp +++ b/util/test/demos/linux/linux_platform.cpp @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #include #include diff --git a/util/test/demos/linux/linux_platform.h b/util/test/demos/linux/linux_platform.h index 36e830945..0dbc46d7f 100644 --- a/util/test/demos/linux/linux_platform.h +++ b/util/test/demos/linux/linux_platform.h @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #pragma once diff --git a/util/test/demos/linux/linux_window.cpp b/util/test/demos/linux/linux_window.cpp index 1c99f69fa..9a3224aae 100644 --- a/util/test/demos/linux/linux_window.cpp +++ b/util/test/demos/linux/linux_window.cpp @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #include "linux_window.h" diff --git a/util/test/demos/linux/linux_window.h b/util/test/demos/linux/linux_window.h index 387054f1b..bf132bc0f 100644 --- a/util/test/demos/linux/linux_window.h +++ b/util/test/demos/linux/linux_window.h @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #pragma once diff --git a/util/test/demos/main.cpp b/util/test/demos/main.cpp index b0d494d23..13bef691b 100644 --- a/util/test/demos/main.cpp +++ b/util/test/demos/main.cpp @@ -525,7 +525,10 @@ Usage: %s Test_Name [test_options] bool allow[(int)TestAPI::Count] = {}; bool nofilters = true; const char *allow_names[] = { - "D3D11", "Vulkan", "OpenGL", "D3D12", + "D3D11", + "Vulkan", + "OpenGL", + "D3D12", }; char name_filter[256] = {}; diff --git a/util/test/demos/renderdoc_app.h b/util/test/demos/renderdoc_app.h index 501aebbda..38b2651cb 100644 --- a/util/test/demos/renderdoc_app.h +++ b/util/test/demos/renderdoc_app.h @@ -72,7 +72,8 @@ extern "C" { // RenderDoc capture options // -typedef enum RENDERDOC_CaptureOption { +typedef enum RENDERDOC_CaptureOption +{ // Allow the application to enable vsync // // Default - enabled @@ -233,7 +234,8 @@ typedef uint32_t(RENDERDOC_CC *pRENDERDOC_GetCaptureOptionU32)(RENDERDOC_Capture // If the option is invalid, -FLT_MAX is returned typedef float(RENDERDOC_CC *pRENDERDOC_GetCaptureOptionF32)(RENDERDOC_CaptureOption opt); -typedef enum RENDERDOC_InputButton { +typedef enum RENDERDOC_InputButton +{ // '0' - '9' matches ASCII values eRENDERDOC_Key_0 = 0x30, eRENDERDOC_Key_1 = 0x31, @@ -321,7 +323,8 @@ typedef void(RENDERDOC_CC *pRENDERDOC_SetFocusToggleKeys)(RENDERDOC_InputButton // If keys is NULL or num is 0, captures keys will be disabled typedef void(RENDERDOC_CC *pRENDERDOC_SetCaptureKeys)(RENDERDOC_InputButton *keys, int num); -typedef enum RENDERDOC_OverlayBits { +typedef enum RENDERDOC_OverlayBits +{ // This single bit controls whether the overlay is enabled or disabled globally eRENDERDOC_Overlay_Enabled = 0x1, @@ -556,7 +559,8 @@ typedef void(RENDERDOC_CC *pRENDERDOC_SetCaptureTitle)(const char *title); // Note that this means the API returned can be higher than the one you might have requested. // e.g. if you are running against a newer RenderDoc that supports 1.0.1, it will be returned // instead of 1.0.0. You can check this with the GetAPIVersion entry point -typedef enum RENDERDOC_Version { +typedef enum RENDERDOC_Version +{ eRENDERDOC_API_Version_1_0_0 = 10000, // RENDERDOC_API_1_0_0 = 1 00 00 eRENDERDOC_API_Version_1_0_1 = 10001, // RENDERDOC_API_1_0_1 = 1 00 01 eRENDERDOC_API_Version_1_0_2 = 10002, // RENDERDOC_API_1_0_2 = 1 00 02 diff --git a/util/test/demos/test_common.cpp b/util/test/demos/test_common.cpp index 0441aba17..5446a074a 100644 --- a/util/test/demos/test_common.cpp +++ b/util/test/demos/test_common.cpp @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #include "test_common.h" #include diff --git a/util/test/demos/test_common.h b/util/test/demos/test_common.h index 0de06eb4e..cb40ed541 100644 --- a/util/test/demos/test_common.h +++ b/util/test/demos/test_common.h @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #pragma once diff --git a/util/test/demos/texture_zoo.cpp b/util/test/demos/texture_zoo.cpp index 20bd60c94..ea14baf1f 100644 --- a/util/test/demos/texture_zoo.cpp +++ b/util/test/demos/texture_zoo.cpp @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #include #include "test_common.h" @@ -38,7 +38,10 @@ void MakePixel(byte *data, const TexConfig &cfg, uint32_t x, uint32_t y, uint32_ { // start points for each component const float vals[] = { - 0.1f, 0.35f, 0.6f, 0.85f, + 0.1f, + 0.35f, + 0.6f, + 0.85f, }; for(uint32_t c = 0; c < cfg.componentCount; c++) @@ -99,7 +102,10 @@ void MakePixel(byte *data, const TexConfig &cfg, uint32_t x, uint32_t y, uint32_ { // same pattern as above but with integer values const int32_t vals[] = { - 10, 40, 70, 100, + 10, + 40, + 70, + 100, }; for(uint32_t c = 0; c < cfg.componentCount; c++) diff --git a/util/test/demos/vk/vk_adv_cbuffer_zoo.cpp b/util/test/demos/vk/vk_adv_cbuffer_zoo.cpp index 2327b14e8..6645173a6 100644 --- a/util/test/demos/vk/vk_adv_cbuffer_zoo.cpp +++ b/util/test/demos/vk/vk_adv_cbuffer_zoo.cpp @@ -287,7 +287,8 @@ void main() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -299,8 +300,9 @@ void main() VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); @@ -349,8 +351,9 @@ void main() cbufferdata.s = 19472; // 16.25f AllocatedBuffer cb( - this, vkh::BufferCreateInfo(sizeof(cbufferdata), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(cbufferdata), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); cb.upload(&cbufferdata, sizeof(cbufferdata)); @@ -377,8 +380,9 @@ void main() vkh::ImageSubresourceRange()); vkCmdBeginRenderPass( - cmd, vkh::RenderPassBeginInfo(mainWindow->rp, mainWindow->GetFB(), mainWindow->scissor, - {vkh::ClearValue(0.0f, 0.0f, 0.0f, 1.0f)}), + cmd, + vkh::RenderPassBeginInfo(mainWindow->rp, mainWindow->GetFB(), mainWindow->scissor, + {vkh::ClearValue(0.0f, 0.0f, 0.0f, 1.0f)}), VK_SUBPASS_CONTENTS_INLINE); vkh::cmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, layout, 0, {descset}, {}); diff --git a/util/test/demos/vk/vk_blend.cpp b/util/test/demos/vk/vk_blend.cpp index b56c86149..7b66a4965 100644 --- a/util/test/demos/vk/vk_blend.cpp +++ b/util/test/demos/vk/vk_blend.cpp @@ -82,10 +82,11 @@ RD_TEST(VK_Blend, VulkanGraphicsTest) triangles.push_back(TemplateTriangleBlue[2]); } - AllocatedBuffer vb(this, vkh::BufferCreateInfo(sizeof(DefaultA2V) * 3 * NUM_TRIANGLES_TOTAL, - VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), - VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); + AllocatedBuffer vb( + this, + vkh::BufferCreateInfo(sizeof(DefaultA2V) * 3 * NUM_TRIANGLES_TOTAL, + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), + VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(triangles.data(), sizeof(DefaultA2V) * 3 * NUM_TRIANGLES_TOTAL); @@ -131,7 +132,8 @@ RD_TEST(VK_Blend, VulkanGraphicsTest) pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; diff --git a/util/test/demos/vk/vk_buffer_truncation.cpp b/util/test/demos/vk/vk_buffer_truncation.cpp index 742923981..0eccb0114 100644 --- a/util/test/demos/vk/vk_buffer_truncation.cpp +++ b/util/test/demos/vk/vk_buffer_truncation.cpp @@ -109,7 +109,8 @@ void main() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -120,10 +121,10 @@ void main() VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo); - AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(OffsetTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), - VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); + AllocatedBuffer vb(this, + vkh::BufferCreateInfo(sizeof(OffsetTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), + VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(OffsetTri); @@ -135,8 +136,9 @@ void main() ib.upload(indices); AllocatedBuffer cb( - this, vkh::BufferCreateInfo(sizeof(cbufferdata), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(cbufferdata), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); cb.upload(cbufferdata); diff --git a/util/test/demos/vk/vk_cbuffer_zoo.cpp b/util/test/demos/vk/vk_cbuffer_zoo.cpp index a25462dc0..128295808 100644 --- a/util/test/demos/vk/vk_cbuffer_zoo.cpp +++ b/util/test/demos/vk/vk_cbuffer_zoo.cpp @@ -638,7 +638,8 @@ float4 main() : SV_Target0 pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -654,7 +655,8 @@ float4 main() : SV_Target0 memcpy(&data[1], &btrue, sizeof(btrue)); VkSpecializationMapEntry specmap[2] = { - {1, 0, sizeof(float)}, {3, 4, sizeof(VkBool32)}, + {1, 0, sizeof(float)}, + {3, 4, sizeof(VkBool32)}, }; VkSpecializationInfo spec = {}; @@ -673,8 +675,9 @@ float4 main() : SV_Target0 VkPipeline hlslpipe = createGraphicsPipeline(pipeCreateInfo); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); @@ -691,8 +694,9 @@ float4 main() : SV_Target0 Vec4f(float(i * 4 + 0), float(i * 4 + 1), float(i * 4 + 2), float(i * 4 + 3)); AllocatedBuffer cb( - this, vkh::BufferCreateInfo(sizeof(cbufferdata), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(cbufferdata), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); cb.upload(cbufferdata); @@ -716,8 +720,9 @@ float4 main() : SV_Target0 inlinedata.inline_d.b = 120.0f; AllocatedBuffer inlinecb( - this, vkh::BufferCreateInfo(sizeof(cbufferdata), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(cbufferdata), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); { @@ -767,8 +772,9 @@ float4 main() : SV_Target0 VkImage swapimg = StartUsingBackbuffer(cmd, VK_ACCESS_TRANSFER_WRITE_BIT, VK_IMAGE_LAYOUT_GENERAL); - vkCmdBeginRenderPass(cmd, vkh::RenderPassBeginInfo(renderPass, framebuffer, mainWindow->scissor, - {vkh::ClearValue(0.2f, 0.2f, 0.2f, 1.0f)}), + vkCmdBeginRenderPass(cmd, + vkh::RenderPassBeginInfo(renderPass, framebuffer, mainWindow->scissor, + {vkh::ClearValue(0.2f, 0.2f, 0.2f, 1.0f)}), VK_SUBPASS_CONTENTS_INLINE); vkh::cmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, layout, 0, {descset}, {}); diff --git a/util/test/demos/vk/vk_compute_only.cpp b/util/test/demos/vk/vk_compute_only.cpp index a04b7a138..514c5e012 100644 --- a/util/test/demos/vk/vk_compute_only.cpp +++ b/util/test/demos/vk/vk_compute_only.cpp @@ -80,17 +80,17 @@ void main() })); VkPipelineLayout layout = createPipelineLayout(vkh::PipelineLayoutCreateInfo( - {setLayout}, - { - vkh::PushConstantRange(VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof(Vec4i)), - })); + {setLayout}, { + vkh::PushConstantRange(VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof(Vec4i)), + })); VkPipeline pipe = createComputePipeline(vkh::ComputePipelineCreateInfo( layout, CompileShaderModule(comp, ShaderLang::glsl, ShaderStage::comp, "main"))); AllocatedImage tex( - this, vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, - VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_STORAGE_BIT), + this, + vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, + VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_STORAGE_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); setName(tex.image, "tex"); @@ -98,12 +98,14 @@ void main() VkImageView view = createImageView( vkh::ImageViewCreateInfo(tex.image, VK_IMAGE_VIEW_TYPE_2D, VK_FORMAT_R32G32B32A32_SFLOAT)); - AllocatedBuffer bufin(this, vkh::BufferCreateInfo(1024, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + AllocatedBuffer bufin(this, + vkh::BufferCreateInfo(1024, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); - AllocatedBuffer bufout(this, vkh::BufferCreateInfo(1024, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + AllocatedBuffer bufout(this, + vkh::BufferCreateInfo(1024, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); setName(bufin.buffer, "bufin"); diff --git a/util/test/demos/vk/vk_custom_border_color.cpp b/util/test/demos/vk/vk_custom_border_color.cpp index 65ed5de8e..d616c0add 100644 --- a/util/test/demos/vk/vk_custom_border_color.cpp +++ b/util/test/demos/vk/vk_custom_border_color.cpp @@ -81,7 +81,10 @@ void main() VkDescriptorSetLayout setlayout = createDescriptorSetLayout(vkh::DescriptorSetLayoutCreateInfo({ { - 0, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT, + 0, + VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, + 1, + VK_SHADER_STAGE_FRAGMENT_BIT, }, })); @@ -96,7 +99,8 @@ void main() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -122,8 +126,9 @@ void main() vb.upload(quad); AllocatedImage img( - this, vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, - VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT), + this, + vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, + VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); AllocatedBuffer uploadBuf( diff --git a/util/test/demos/vk/vk_dedicated_allocation.cpp b/util/test/demos/vk/vk_dedicated_allocation.cpp index 86a8bbc34..47306514f 100644 --- a/util/test/demos/vk/vk_dedicated_allocation.cpp +++ b/util/test/demos/vk/vk_dedicated_allocation.cpp @@ -76,7 +76,10 @@ void main() VkDescriptorSetLayout setlayout = createDescriptorSetLayout(vkh::DescriptorSetLayoutCreateInfo({ { - 0, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT, + 0, + VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, + 1, + VK_SHADER_STAGE_FRAGMENT_BIT, }, })); @@ -89,7 +92,8 @@ void main() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -101,8 +105,9 @@ void main() VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo( {VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT, VMA_MEMORY_USAGE_CPU_TO_GPU})); @@ -112,16 +117,18 @@ void main() LoadXPM(SmileyTexture, rgba8); AllocatedImage smiley( - this, vkh::ImageCreateInfo(rgba8.width, rgba8.height, 0, VK_FORMAT_R8G8B8A8_UNORM, - VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), + this, + vkh::ImageCreateInfo(rgba8.width, rgba8.height, 0, VK_FORMAT_R8G8B8A8_UNORM, + VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), VmaAllocationCreateInfo( {VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT, VMA_MEMORY_USAGE_GPU_ONLY})); VkImageView smileyview = createImageView( vkh::ImageViewCreateInfo(smiley.image, VK_IMAGE_VIEW_TYPE_2D, VK_FORMAT_R8G8B8A8_UNORM)); - AllocatedBuffer uploadBuf(this, vkh::BufferCreateInfo(rgba8.data.size() * sizeof(uint32_t), - VK_BUFFER_USAGE_TRANSFER_SRC_BIT), + AllocatedBuffer uploadBuf(this, + vkh::BufferCreateInfo(rgba8.data.size() * sizeof(uint32_t), + VK_BUFFER_USAGE_TRANSFER_SRC_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); uploadBuf.upload(rgba8.data.data(), rgba8.data.size() * sizeof(uint32_t)); diff --git a/util/test/demos/vk/vk_descriptor_index.cpp b/util/test/demos/vk/vk_descriptor_index.cpp index 6191f9dbe..9a4d0e211 100644 --- a/util/test/demos/vk/vk_descriptor_index.cpp +++ b/util/test/demos/vk/vk_descriptor_index.cpp @@ -292,7 +292,8 @@ void main() }; VkDescriptorBindingFlagsEXT bindFlags[3] = { - VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT_EXT, 0, + VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT_EXT, + 0, VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT_EXT, }; @@ -303,15 +304,21 @@ void main() vkh::DescriptorSetLayoutCreateInfo( { { - 0, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, DESC_ARRAY1_SIZE, + 0, + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, + DESC_ARRAY1_SIZE, VK_SHADER_STAGE_FRAGMENT_BIT | VK_SHADER_STAGE_COMPUTE_BIT, }, { - 1, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, DESC_ARRAY1_SIZE, + 1, + VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, + DESC_ARRAY1_SIZE, VK_SHADER_STAGE_FRAGMENT_BIT | VK_SHADER_STAGE_COMPUTE_BIT, }, { - 2, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, DESC_ARRAY2_SIZE, + 2, + VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, + DESC_ARRAY2_SIZE, VK_SHADER_STAGE_FRAGMENT_BIT | VK_SHADER_STAGE_COMPUTE_BIT, }, }) @@ -333,7 +340,8 @@ void main() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -346,7 +354,8 @@ void main() CompileShaderModule(comp, ShaderLang::glsl, ShaderStage::comp, "main"); VkSpecializationMapEntry specmap[2] = { - {1, 0 * sizeof(uint32_t), sizeof(uint32_t)}, {2, 1 * sizeof(uint32_t), sizeof(uint32_t)}, + {1, 0 * sizeof(uint32_t), sizeof(uint32_t)}, + {2, 1 * sizeof(uint32_t), sizeof(uint32_t)}, }; uint32_t specvals[2] = {1337, 1338}; @@ -374,15 +383,17 @@ void main() {Vec3f(0.5f, -0.5f, 0.0f), Vec4f(0.0f, 0.0f, 1.0f, right), Vec2f(1.0f, 0.0f)}, }; - AllocatedBuffer vb(this, vkh::BufferCreateInfo(sizeof(tri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + AllocatedBuffer vb(this, + vkh::BufferCreateInfo(sizeof(tri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(tri); AllocatedImage img( - this, vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, - VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), + this, + vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, + VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); setName(img.image, "Colour Tex"); @@ -403,8 +414,9 @@ void main() // create an image with black contents for all the indices we aren't using AllocatedImage badimg( - this, vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, - VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), + this, + vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, + VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); setName(badimg.image, "Black Tex"); @@ -458,17 +470,19 @@ void main() { CHECK_VKR(vkCreateDescriptorPool( - device, vkh::DescriptorPoolCreateInfo( - 8, - { - {VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, DESC_ARRAY2_SIZE * 10}, - {VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, DESC_ARRAY1_SIZE * 10}, - }), + device, + vkh::DescriptorPoolCreateInfo( + 8, + { + {VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, DESC_ARRAY2_SIZE * 10}, + {VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, DESC_ARRAY1_SIZE * 10}, + }), NULL, &descpool)); CHECK_VKR(vkAllocateDescriptorSets( - device, vkh::DescriptorSetAllocateInfo( - descpool, {setlayout, setlayout, setlayout, setlayout, setlayout}), + device, + vkh::DescriptorSetAllocateInfo(descpool, + {setlayout, setlayout, setlayout, setlayout, setlayout}), descset)); } @@ -583,16 +597,17 @@ void main() vkCmdFillBuffer(cmd, ssbo.buffer, 0, 1024 * 1024, 0); vkh::cmdPipelineBarrier( - cmd, {}, {vkh::BufferMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, - VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT, - ssbo.buffer)}); + cmd, {}, + {vkh::BufferMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, + VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT, + ssbo.buffer)}); // read the push constants, transform, pass them through the specified buffer to draw below vkCmdDispatch(cmd, 1, 1, 1); - vkh::cmdPipelineBarrier( - cmd, {}, {vkh::BufferMemoryBarrier(VK_ACCESS_SHADER_WRITE_BIT, VK_ACCESS_SHADER_READ_BIT, - ssbo.buffer)}); + vkh::cmdPipelineBarrier(cmd, {}, + {vkh::BufferMemoryBarrier(VK_ACCESS_SHADER_WRITE_BIT, + VK_ACCESS_SHADER_READ_BIT, ssbo.buffer)}); vkCmdBeginRenderPass( cmd, vkh::RenderPassBeginInfo(mainWindow->rp, mainWindow->GetFB(), mainWindow->scissor), diff --git a/util/test/demos/vk/vk_descriptor_reuse.cpp b/util/test/demos/vk/vk_descriptor_reuse.cpp index b78623d7d..d1905e99a 100644 --- a/util/test/demos/vk/vk_descriptor_reuse.cpp +++ b/util/test/demos/vk/vk_descriptor_reuse.cpp @@ -139,7 +139,8 @@ void main() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -151,8 +152,9 @@ void main() VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); @@ -166,12 +168,14 @@ void main() for(size_t i = 0; i < numBufs; i++) { val1bufs.push_back(AllocatedBuffer( - this, vkh::BufferCreateInfo(sizeof(Vec4f), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo( + sizeof(Vec4f), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU}))); val2bufs.push_back(AllocatedBuffer( - this, vkh::BufferCreateInfo(sizeof(Vec4f), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo( + sizeof(Vec4f), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU}))); val1bufs.back().upload(&val1, sizeof(Vec4f)); @@ -282,12 +286,13 @@ void main() for(size_t r = 0; r < ringSize; r++) { CHECK_VKR(vkCreateDescriptorPool( - device, vkh::DescriptorPoolCreateInfo( - descriptorCount, - { - {VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, descriptorCount * 3}, - {VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, descriptorCount * 2}, - }), + device, + vkh::DescriptorPoolCreateInfo( + descriptorCount, + { + {VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, descriptorCount * 3}, + {VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, descriptorCount * 2}, + }), NULL, &threadData[t].descPools[r])); } @@ -305,7 +310,8 @@ void main() // temporary std::vector work that is usually worth it for convenience VkDescriptorBufferInfo bufs[2] = { - vkh::DescriptorBufferInfo(VK_NULL_HANDLE), vkh::DescriptorBufferInfo(VK_NULL_HANDLE), + vkh::DescriptorBufferInfo(VK_NULL_HANDLE), + vkh::DescriptorBufferInfo(VK_NULL_HANDLE), }; VkDescriptorImageInfo imInfo[3] = { @@ -356,8 +362,9 @@ void main() vkBeginCommandBuffer(cmd, vkh::CommandBufferBeginInfo()); vkCmdBeginRenderPass( - cmd, vkh::RenderPassBeginInfo(renderPass, framebuffer[threadIndex], mainWindow->scissor, - {vkh::ClearValue(0.0f, 0.0f, 0.0f, 1.0f)}), + cmd, + vkh::RenderPassBeginInfo(renderPass, framebuffer[threadIndex], mainWindow->scissor, + {vkh::ClearValue(0.0f, 0.0f, 0.0f, 1.0f)}), VK_SUBPASS_CONTENTS_INLINE); vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, pipe); diff --git a/util/test/demos/vk/vk_descriptor_variable_count.cpp b/util/test/demos/vk/vk_descriptor_variable_count.cpp index ce70109b5..1456b3568 100644 --- a/util/test/demos/vk/vk_descriptor_variable_count.cpp +++ b/util/test/demos/vk/vk_descriptor_variable_count.cpp @@ -176,15 +176,16 @@ void main() descFlags.bindingCount = 1; descFlags.pBindingFlags = bindFlags; - VkDescriptorSetLayout setlayout = - createDescriptorSetLayout(vkh::DescriptorSetLayoutCreateInfo( - { - { - 0, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, - numDescriptorSetsInLayout, VK_SHADER_STAGE_FRAGMENT_BIT, - }, - }) - .next(&descFlags)); + VkDescriptorSetLayout setlayout = createDescriptorSetLayout( + vkh::DescriptorSetLayoutCreateInfo({ + { + 0, + VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, + numDescriptorSetsInLayout, + VK_SHADER_STAGE_FRAGMENT_BIT, + }, + }) + .next(&descFlags)); VkPipelineLayout layout = createPipelineLayout(vkh::PipelineLayoutCreateInfo( { @@ -201,7 +202,8 @@ void main() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -218,15 +220,17 @@ void main() {Vec3f(0.5f, -0.5f, 0.0f), Vec4f(0.0f, 0.0f, 1.0f, 1.0f), Vec2f(1.0f, 0.0f)}, }; - AllocatedBuffer vb(this, vkh::BufferCreateInfo(sizeof(tri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + AllocatedBuffer vb(this, + vkh::BufferCreateInfo(sizeof(tri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(tri); AllocatedImage img( - this, vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, - VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), + this, + vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, + VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); setName(img.image, "Colour Tex"); @@ -254,11 +258,12 @@ void main() { CHECK_VKR(vkCreateDescriptorPool( - device, vkh::DescriptorPoolCreateInfo(numDescriptorSets, - { - {VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, - numDescriptorSets * numDescriptorsPerSet + 100}, - }), + device, + vkh::DescriptorPoolCreateInfo( + numDescriptorSets, + { + {VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, numDescriptorSets * numDescriptorsPerSet + 100}, + }), NULL, &descpool)); std::vector setLayouts(numDescriptorSets, setlayout); @@ -269,8 +274,10 @@ void main() counts.back() = std::min(100U, numDescriptorSetsInLayout); VkDescriptorSetVariableDescriptorCountAllocateInfoEXT countInfo = { - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO_EXT, NULL, - numDescriptorSets, counts.data(), + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO_EXT, + NULL, + numDescriptorSets, + counts.data(), }; VkDescriptorSetAllocateInfo allocInfo = { diff --git a/util/test/demos/vk/vk_discard_rects.cpp b/util/test/demos/vk/vk_discard_rects.cpp index d67da09b8..058bd874b 100644 --- a/util/test/demos/vk/vk_discard_rects.cpp +++ b/util/test/demos/vk/vk_discard_rects.cpp @@ -78,7 +78,8 @@ RD_TEST(VK_Discard_Rectangles, VulkanGraphicsTest) pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; diff --git a/util/test/demos/vk/vk_discard_zoo.cpp b/util/test/demos/vk/vk_discard_zoo.cpp index ef7fc9078..beb52ee4e 100644 --- a/util/test/demos/vk/vk_discard_zoo.cpp +++ b/util/test/demos/vk/vk_discard_zoo.cpp @@ -159,13 +159,13 @@ void main() fmt == VK_FORMAT_D24_UNORM_S8_UINT || fmt == VK_FORMAT_D16_UNORM || fmt == VK_FORMAT_S8_UINT); - return AllocatedImage( - this, vkh::ImageCreateInfo(width, height, 0, fmt, - VK_IMAGE_USAGE_TRANSFER_DST_BIT | - (depth ? VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT - : VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT), - 1, arraySlices, (VkSampleCountFlagBits)samples), - VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); + return AllocatedImage(this, + vkh::ImageCreateInfo(width, height, 0, fmt, + VK_IMAGE_USAGE_TRANSFER_DST_BIT | + (depth ? VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT + : VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT), + 1, arraySlices, (VkSampleCountFlagBits)samples), + VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); } void Prepare(int argc, char **argv) @@ -286,9 +286,9 @@ void main() // create depth-stencil image AllocatedImage depthimg( this, - vkh::ImageCreateInfo(mainWindow->scissor.extent.width, mainWindow->scissor.extent.height, 0, - depthStencilFormat, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | - VK_IMAGE_USAGE_TRANSFER_DST_BIT), + vkh::ImageCreateInfo( + mainWindow->scissor.extent.width, mainWindow->scissor.extent.height, 0, depthStencilFormat, + VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); VkImageView depthview = createImageView(vkh::ImageViewCreateInfo( @@ -351,9 +351,10 @@ void main() VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo); AllocatedImage msaaimg( - this, vkh::ImageCreateInfo(mainWindow->scissor.extent.width, - mainWindow->scissor.extent.height, 0, mainWindow->format, - VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, 1, 1, VK_SAMPLE_COUNT_4_BIT), + this, + vkh::ImageCreateInfo(mainWindow->scissor.extent.width, mainWindow->scissor.extent.height, 0, + mainWindow->format, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, 1, 1, + VK_SAMPLE_COUNT_4_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); VkImageView msaaRTV = createImageView( @@ -366,8 +367,9 @@ void main() cbufferdata[0] = Vec4f(0.0f, 234.0f, 0.0f, 0.0f); AllocatedBuffer cb( - this, vkh::BufferCreateInfo(sizeof(cbufferdata), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(cbufferdata), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); cb.upload(cbufferdata); @@ -382,17 +384,21 @@ void main() VkFramebuffer fb = createFramebuffer(vkh::FramebufferCreateInfo( renderPass, {colview, depthview, ignoreview}, mainWindow->scissor.extent)); - AllocatedImage tex1d(this, vkh::ImageCreateInfo(300, 0, 0, VK_FORMAT_R16G16B16A16_SFLOAT, - VK_IMAGE_USAGE_TRANSFER_DST_BIT, 3, 5), + AllocatedImage tex1d(this, + vkh::ImageCreateInfo(300, 0, 0, VK_FORMAT_R16G16B16A16_SFLOAT, + VK_IMAGE_USAGE_TRANSFER_DST_BIT, 3, 5), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); - AllocatedImage tex3d(this, vkh::ImageCreateInfo(300, 300, 15, VK_FORMAT_R16G16B16A16_SFLOAT, - VK_IMAGE_USAGE_TRANSFER_DST_BIT, 3), + AllocatedImage tex3d(this, + vkh::ImageCreateInfo(300, 300, 15, VK_FORMAT_R16G16B16A16_SFLOAT, + VK_IMAGE_USAGE_TRANSFER_DST_BIT, 3), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); - AllocatedImage tex1dsub(this, vkh::ImageCreateInfo(300, 0, 0, VK_FORMAT_R16G16B16A16_SFLOAT, - VK_IMAGE_USAGE_TRANSFER_DST_BIT, 3, 5), + AllocatedImage tex1dsub(this, + vkh::ImageCreateInfo(300, 0, 0, VK_FORMAT_R16G16B16A16_SFLOAT, + VK_IMAGE_USAGE_TRANSFER_DST_BIT, 3, 5), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); - AllocatedImage tex3dsub(this, vkh::ImageCreateInfo(300, 300, 15, VK_FORMAT_R16G16B16A16_SFLOAT, - VK_IMAGE_USAGE_TRANSFER_DST_BIT, 3), + AllocatedImage tex3dsub(this, + vkh::ImageCreateInfo(300, 300, 15, VK_FORMAT_R16G16B16A16_SFLOAT, + VK_IMAGE_USAGE_TRANSFER_DST_BIT, 3), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); setName(tex1d.image, "Tex1D: DiscardAll"); diff --git a/util/test/demos/vk/vk_draw_zoo.cpp b/util/test/demos/vk/vk_draw_zoo.cpp index 281e755ab..28e8e83d8 100644 --- a/util/test/demos/vk/vk_draw_zoo.cpp +++ b/util/test/demos/vk/vk_draw_zoo.cpp @@ -120,7 +120,8 @@ void main() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -180,10 +181,11 @@ void main() {Vec3f(0.5f, 0.0f, 0.0f), Vec4f(1.0f, 0.1f, 1.0f, 0.0f), Vec2f(1.0f, 0.0f)}, }; - AllocatedBuffer vb1(this, vkh::BufferCreateInfo(sizeof(DefaultA2V) * 66000, - VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), - VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); + AllocatedBuffer vb1( + this, + vkh::BufferCreateInfo(sizeof(DefaultA2V) * 66000, + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), + VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); { DefaultA2V *src = (DefaultA2V *)vertData; @@ -269,16 +271,17 @@ void main() instData[14] = Vec4f(0.5f, 0.9f, 0.1f, 0.5f); } - AllocatedBuffer vb2( - this, vkh::BufferCreateInfo(sizeof(instData), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), - VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); + AllocatedBuffer vb2(this, + vkh::BufferCreateInfo(sizeof(instData), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), + VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb2.upload(instData); AllocatedBuffer ib1( - this, vkh::BufferCreateInfo(sizeof(uint32_t) * 100, VK_BUFFER_USAGE_INDEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(uint32_t) * 100, + VK_BUFFER_USAGE_INDEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); { @@ -348,8 +351,9 @@ void main() vkh::ClearColorValue(0.2f, 0.2f, 0.2f, 1.0f), 1, vkh::ImageSubresourceRange()); - vkCmdBeginRenderPass(cmd, vkh::RenderPassBeginInfo(renderPass, framebuffer, mainWindow->scissor, - {vkh::ClearValue(0.2f, 0.2f, 0.2f, 1.0f)}), + vkCmdBeginRenderPass(cmd, + vkh::RenderPassBeginInfo(renderPass, framebuffer, mainWindow->scissor, + {vkh::ClearValue(0.2f, 0.2f, 0.2f, 1.0f)}), VK_SUBPASS_CONTENTS_INLINE); vkCmdSetScissor(cmd, 0, 1, &mainWindow->scissor); diff --git a/util/test/demos/vk/vk_dynamic_rendering.cpp b/util/test/demos/vk/vk_dynamic_rendering.cpp index b3314983e..57d9b7a16 100644 --- a/util/test/demos/vk/vk_dynamic_rendering.cpp +++ b/util/test/demos/vk/vk_dynamic_rendering.cpp @@ -101,7 +101,9 @@ void main() VulkanGraphicsTest::Prepare(argc, argv); static VkPhysicalDeviceDynamicRenderingFeaturesKHR dynFeats = { - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR, NULL, VK_TRUE, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR, + NULL, + VK_TRUE, }; static VkPhysicalDeviceDescriptorIndexingFeaturesEXT descIndexing = { @@ -144,12 +146,14 @@ void main() descFlags.pBindingFlags = bindFlags; VkDescriptorSetLayout setlayout = createDescriptorSetLayout( - vkh::DescriptorSetLayoutCreateInfo( - { - { - 0, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 128, VK_SHADER_STAGE_FRAGMENT_BIT, - }, - }) + vkh::DescriptorSetLayoutCreateInfo({ + { + 0, + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, + 128, + VK_SHADER_STAGE_FRAGMENT_BIT, + }, + }) .next(&descFlags)); VkPipelineLayout layout = createPipelineLayout(vkh::PipelineLayoutCreateInfo( @@ -164,8 +168,9 @@ void main() cbufferdata[0] = Vec4f(0.0f, 1.0f, 0.0f, 1.0f); AllocatedBuffer cb( - this, vkh::BufferCreateInfo(sizeof(cbufferdata), VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(cbufferdata), VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); cb.upload(cbufferdata); @@ -197,7 +202,8 @@ void main() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -210,8 +216,9 @@ void main() VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); diff --git a/util/test/demos/vk/vk_extended_dyn_state.cpp b/util/test/demos/vk/vk_extended_dyn_state.cpp index 920074d4e..9212949df 100644 --- a/util/test/demos/vk/vk_extended_dyn_state.cpp +++ b/util/test/demos/vk/vk_extended_dyn_state.cpp @@ -100,7 +100,8 @@ RD_TEST(VK_Extended_Dynamic_State, VulkanGraphicsTest) pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, char)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -146,8 +147,9 @@ RD_TEST(VK_Extended_Dynamic_State, VulkanGraphicsTest) vb.upload(tris); AllocatedImage depthimg( - this, vkh::ImageCreateInfo(screenWidth, screenHeight, 0, VK_FORMAT_D32_SFLOAT_S8_UINT, - VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT), + this, + vkh::ImageCreateInfo(screenWidth, screenHeight, 0, VK_FORMAT_D32_SFLOAT_S8_UINT, + VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); VkImageView dsvview = createImageView(vkh::ImageViewCreateInfo( @@ -197,8 +199,9 @@ RD_TEST(VK_Extended_Dynamic_State, VulkanGraphicsTest) vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, pipe); vkCmdBeginRenderPass( - cmd, vkh::RenderPassBeginInfo(renderPass, fbs[mainWindow->imgIndex], mainWindow->scissor, - {{}, vkh::ClearValue(0.9f, 0xcc)}), + cmd, + vkh::RenderPassBeginInfo(renderPass, fbs[mainWindow->imgIndex], mainWindow->scissor, + {{}, vkh::ClearValue(0.9f, 0xcc)}), VK_SUBPASS_CONTENTS_INLINE); vkCmdSetViewportWithCountEXT(cmd, 1, &mainWindow->viewport); diff --git a/util/test/demos/vk/vk_graphics_pipeline.cpp b/util/test/demos/vk/vk_graphics_pipeline.cpp index e4b67d386..7c69d741a 100644 --- a/util/test/demos/vk/vk_graphics_pipeline.cpp +++ b/util/test/demos/vk/vk_graphics_pipeline.cpp @@ -128,12 +128,18 @@ void main() VkDescriptorSetLayout vsetlayout = createDescriptorSetLayout(vkh::DescriptorSetLayoutCreateInfo({ { - 0, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1, VK_SHADER_STAGE_VERTEX_BIT, + 0, + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, + 1, + VK_SHADER_STAGE_VERTEX_BIT, }, })); VkDescriptorSetLayout fsetlayout = createDescriptorSetLayout(vkh::DescriptorSetLayoutCreateInfo({ { - 0, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 16, VK_SHADER_STAGE_FRAGMENT_BIT, + 0, + VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, + 16, + VK_SHADER_STAGE_FRAGMENT_BIT, }, })); @@ -178,7 +184,8 @@ void main() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -264,9 +271,13 @@ void main() // blendEnable VK_FALSE, // color* - VK_BLEND_FACTOR_SRC_ALPHA, VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, VK_BLEND_OP_ADD, + VK_BLEND_FACTOR_SRC_ALPHA, + VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, + VK_BLEND_OP_ADD, // alpha* - VK_BLEND_FACTOR_SRC_ALPHA, VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, VK_BLEND_OP_ADD, + VK_BLEND_FACTOR_SRC_ALPHA, + VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, + VK_BLEND_OP_ADD, // colorWriteMask VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT, @@ -294,16 +305,18 @@ void main() VkPipeline pipe = createGraphicsPipeline(&linkedPipeInfo); AllocatedImage offimg( - this, vkh::ImageCreateInfo(screenWidth, screenHeight, 0, VK_FORMAT_R32G32B32A32_SFLOAT, - VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT), + this, + vkh::ImageCreateInfo(screenWidth, screenHeight, 0, VK_FORMAT_R32G32B32A32_SFLOAT, + VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); VkImageView offview = createImageView(vkh::ImageViewCreateInfo( offimg.image, VK_IMAGE_VIEW_TYPE_2D, VK_FORMAT_R32G32B32A32_SFLOAT)); AllocatedImage depthimg( - this, vkh::ImageCreateInfo(screenWidth, screenHeight, 0, VK_FORMAT_D32_SFLOAT_S8_UINT, - VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT), + this, + vkh::ImageCreateInfo(screenWidth, screenHeight, 0, VK_FORMAT_D32_SFLOAT_S8_UINT, + VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); VkImageView dsvview = createImageView(vkh::ImageViewCreateInfo( @@ -319,12 +332,14 @@ void main() renderPass, {mainWindow->GetView(i), offview, dsvview}, mainWindow->scissor.extent)); Vec4f cbufferdata[2] = { - Vec4f(-100.0f, -100.0f, 0.0f, 0.0f), Vec4f(1.0f, 1.0f, 1.0f, 1.0f), + Vec4f(-100.0f, -100.0f, 0.0f, 0.0f), + Vec4f(1.0f, 1.0f, 1.0f, 1.0f), }; AllocatedBuffer cb( - this, vkh::BufferCreateInfo(sizeof(cbufferdata), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(cbufferdata), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); cb.upload(cbufferdata); @@ -341,15 +356,17 @@ void main() LoadXPM(SmileyTexture, rgba8); AllocatedImage smiley( - this, vkh::ImageCreateInfo(rgba8.width, rgba8.height, 0, VK_FORMAT_R8G8B8A8_UNORM, - VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), + this, + vkh::ImageCreateInfo(rgba8.width, rgba8.height, 0, VK_FORMAT_R8G8B8A8_UNORM, + VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); VkImageView smileyview = createImageView( vkh::ImageViewCreateInfo(smiley.image, VK_IMAGE_VIEW_TYPE_2D, VK_FORMAT_R8G8B8A8_UNORM)); - AllocatedBuffer uploadBuf(this, vkh::BufferCreateInfo(rgba8.data.size() * sizeof(uint32_t), - VK_BUFFER_USAGE_TRANSFER_SRC_BIT), + AllocatedBuffer uploadBuf(this, + vkh::BufferCreateInfo(rgba8.data.size() * sizeof(uint32_t), + VK_BUFFER_USAGE_TRANSFER_SRC_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); uploadBuf.upload(rgba8.data.data(), rgba8.data.size() * sizeof(uint32_t)); @@ -376,8 +393,9 @@ void main() }); AllocatedImage badimg( - this, vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, - VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), + this, + vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, + VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); setName(badimg.image, "Black Tex"); @@ -419,8 +437,9 @@ void main() } AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); @@ -433,14 +452,15 @@ void main() StartUsingBackbuffer(cmd, VK_ACCESS_TRANSFER_WRITE_BIT, VK_IMAGE_LAYOUT_GENERAL); - vkCmdBeginRenderPass(cmd, - vkh::RenderPassBeginInfo( - renderPass, fbs[mainWindow->imgIndex], mainWindow->scissor, - { - vkh::ClearValue(0.2f, 0.2f, 0.2f, 1.0f), - vkh::ClearValue(0.0f, 0.0f, 0.2f, 1.0f), vkh::ClearValue(1.0f, 0), - }), - VK_SUBPASS_CONTENTS_INLINE); + vkCmdBeginRenderPass( + cmd, + vkh::RenderPassBeginInfo(renderPass, fbs[mainWindow->imgIndex], mainWindow->scissor, + { + vkh::ClearValue(0.2f, 0.2f, 0.2f, 1.0f), + vkh::ClearValue(0.0f, 0.0f, 0.2f, 1.0f), + vkh::ClearValue(1.0f, 0), + }), + VK_SUBPASS_CONTENTS_INLINE); vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, pipe); vkCmdPushConstants(cmd, fulllayout, VK_SHADER_STAGE_FRAGMENT_BIT, 0, 4, &idx); diff --git a/util/test/demos/vk/vk_headers.h b/util/test/demos/vk/vk_headers.h index 307a1757c..9ef72621a 100644 --- a/util/test/demos/vk/vk_headers.h +++ b/util/test/demos/vk/vk_headers.h @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #pragma once @@ -37,19 +37,44 @@ #else // make handles typed even on 32-bit, by relying on C++ -#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(obj) \ - struct obj \ - { \ - obj() : handle(0) {} \ - obj(uint64_t x) : handle(x) {} \ - bool operator==(const obj &other) const { return handle == other.handle; } \ - bool operator<(const obj &other) const { return handle < other.handle; } \ - bool operator!=(const obj &other) const { return handle != other.handle; } \ - bool operator==(const int &other) const { return handle == other; } \ - bool operator!=(const int &other) const { return handle != other; } \ - operator bool() const { return handle != 0; } \ - operator uint64_t() const { return handle; } \ - uint64_t handle; \ +#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(obj) \ + struct obj \ + { \ + obj() : handle(0) \ + { \ + } \ + obj(uint64_t x) : handle(x) \ + { \ + } \ + bool operator==(const obj &other) const \ + { \ + return handle == other.handle; \ + } \ + bool operator<(const obj &other) const \ + { \ + return handle < other.handle; \ + } \ + bool operator!=(const obj &other) const \ + { \ + return handle != other.handle; \ + } \ + bool operator==(const int &other) const \ + { \ + return handle == other; \ + } \ + bool operator!=(const int &other) const \ + { \ + return handle != other; \ + } \ + operator bool() const \ + { \ + return handle != 0; \ + } \ + operator uint64_t() const \ + { \ + return handle; \ + } \ + uint64_t handle; \ }; #endif diff --git a/util/test/demos/vk/vk_helpers.cpp b/util/test/demos/vk/vk_helpers.cpp index 8186afde1..2bd5f5323 100644 --- a/util/test/demos/vk/vk_helpers.cpp +++ b/util/test/demos/vk/vk_helpers.cpp @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #include #include @@ -225,9 +225,13 @@ GraphicsPipelineCreateInfo::GraphicsPipelineCreateInfo() // blendEnable VK_FALSE, // color* - VK_BLEND_FACTOR_SRC_ALPHA, VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, VK_BLEND_OP_ADD, + VK_BLEND_FACTOR_SRC_ALPHA, + VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, + VK_BLEND_OP_ADD, // alpha* - VK_BLEND_FACTOR_SRC_ALPHA, VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, VK_BLEND_OP_ADD, + VK_BLEND_FACTOR_SRC_ALPHA, + VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, + VK_BLEND_OP_ADD, // colorWriteMask VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT, diff --git a/util/test/demos/vk/vk_helpers.h b/util/test/demos/vk/vk_helpers.h index 3edde9c96..ebc1e1fe6 100644 --- a/util/test/demos/vk/vk_helpers.h +++ b/util/test/demos/vk/vk_helpers.h @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #pragma once @@ -265,8 +265,22 @@ struct DeviceQueueCreateInfo : public VkDeviceQueueCreateInfo DeviceQueueCreateInfo(uint32_t queueFamilyIndex, uint32_t queueCount, const std::vector &priorities = { - 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, - 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, + 1.0f, + 1.0f, + 1.0f, + 1.0f, + 1.0f, + 1.0f, + 1.0f, + 1.0f, + 1.0f, + 1.0f, + 1.0f, + 1.0f, + 1.0f, + 1.0f, + 1.0f, + 1.0f, }) : VkDeviceQueueCreateInfo() { @@ -598,14 +612,12 @@ struct SamplerCreateInfo : public VkSamplerCreateInfo struct ImageViewCreateInfo : public VkImageViewCreateInfo { - ImageViewCreateInfo(VkImage image, VkImageViewType viewType, VkFormat format, - VkComponentMapping components = {VK_COMPONENT_SWIZZLE_IDENTITY, - VK_COMPONENT_SWIZZLE_IDENTITY, - VK_COMPONENT_SWIZZLE_IDENTITY, - VK_COMPONENT_SWIZZLE_IDENTITY}, - VkImageSubresourceRange subresourceRange = {VK_IMAGE_ASPECT_COLOR_BIT, 0, - VK_REMAINING_MIP_LEVELS, 0, - VK_REMAINING_ARRAY_LAYERS}) + ImageViewCreateInfo( + VkImage image, VkImageViewType viewType, VkFormat format, + VkComponentMapping components = {VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, + VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY}, + VkImageSubresourceRange subresourceRange = { + VK_IMAGE_ASPECT_COLOR_BIT, 0, VK_REMAINING_MIP_LEVELS, 0, VK_REMAINING_ARRAY_LAYERS}) { sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; pNext = NULL; @@ -1441,17 +1453,21 @@ struct RenderPassCreator : private VkRenderPassCreateInfo subpasses.push_back({ // flags - 0, VK_PIPELINE_BIND_POINT_GRAPHICS, + 0, + VK_PIPELINE_BIND_POINT_GRAPHICS, // input attachments - (uint32_t)inputAttachments.size(), input, + (uint32_t)inputAttachments.size(), + input, // color attachments - (uint32_t)colorAttachments.size(), color, + (uint32_t)colorAttachments.size(), + color, // resolve attachments resolve, // depth stencil attachment depth, // preserve attachments - 0, NULL, + 0, + NULL, }); } @@ -1587,7 +1603,8 @@ struct RenderPassCreator2 : private VkRenderPassCreateInfo2KHR } subpasses.push_back({ - VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2_KHR, NULL, + VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2_KHR, + NULL, // flags 0, // pipelineBindPoint @@ -1595,15 +1612,18 @@ struct RenderPassCreator2 : private VkRenderPassCreateInfo2KHR // viewMask 0, // input attachments - (uint32_t)inputAttachments.size(), input, + (uint32_t)inputAttachments.size(), + input, // color attachments - (uint32_t)colorAttachments.size(), color, + (uint32_t)colorAttachments.size(), + color, // resolve attachments resolve, // depth stencil attachment depth, // preserve attachments - 0, NULL, + 0, + NULL, }); } diff --git a/util/test/demos/vk/vk_image_layouts.cpp b/util/test/demos/vk/vk_image_layouts.cpp index fda9abd9d..f5a0109bd 100644 --- a/util/test/demos/vk/vk_image_layouts.cpp +++ b/util/test/demos/vk/vk_image_layouts.cpp @@ -45,7 +45,8 @@ RD_TEST(VK_Image_Layouts, VulkanGraphicsTest) pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -57,8 +58,9 @@ RD_TEST(VK_Image_Layouts, VulkanGraphicsTest) VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); @@ -85,8 +87,9 @@ RD_TEST(VK_Image_Layouts, VulkanGraphicsTest) setName(preinitImg, "Image:Preinitialised"); AllocatedImage undefImg( - this, vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R8G8B8A8_UNORM, - VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), + this, + vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R8G8B8A8_UNORM, + VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); setName(undefImg.image, "Image:Undefined"); diff --git a/util/test/demos/vk/vk_imageless_framebuffer.cpp b/util/test/demos/vk/vk_imageless_framebuffer.cpp index 8b3e2b470..9d6a57be9 100644 --- a/util/test/demos/vk/vk_imageless_framebuffer.cpp +++ b/util/test/demos/vk/vk_imageless_framebuffer.cpp @@ -81,7 +81,8 @@ void main() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -93,8 +94,9 @@ void main() VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); @@ -126,15 +128,19 @@ void main() imageInfo.pViewFormats = &mainWindow->format; VkFramebufferAttachmentsCreateInfoKHR viewsInfo = { - VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO_KHR, NULL, 1, &imageInfo, + VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO_KHR, + NULL, + 1, + &imageInfo, }; - CHECK_VKR(vkCreateFramebuffer( - device, vkh::FramebufferCreateInfo(mainWindow->rp, {(VkImageView)0x1234}, - mainWindow->scissor.extent, 1, - VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT_KHR) - .next(&viewsInfo), - NULL, &fb)); + CHECK_VKR( + vkCreateFramebuffer(device, + vkh::FramebufferCreateInfo(mainWindow->rp, {(VkImageView)0x1234}, + mainWindow->scissor.extent, 1, + VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT_KHR) + .next(&viewsInfo), + NULL, &fb)); } VkCommandBuffer cmd = GetCommandBuffer(); @@ -150,7 +156,10 @@ void main() VkImageView curView = mainWindow->GetView(); VkRenderPassAttachmentBeginInfoKHR usedView = { - VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO_KHR, NULL, 1, &curView, + VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO_KHR, + NULL, + 1, + &curView, }; vkCmdBeginRenderPass( diff --git a/util/test/demos/vk/vk_indirect.cpp b/util/test/demos/vk/vk_indirect.cpp index e29504607..0b8cba80b 100644 --- a/util/test/demos/vk/vk_indirect.cpp +++ b/util/test/demos/vk/vk_indirect.cpp @@ -145,7 +145,8 @@ void main() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -265,16 +266,16 @@ void main() vkh::ClearColorValue(0.2f, 0.2f, 0.2f, 1.0f), 1, vkh::ImageSubresourceRange()); - vkh::cmdPipelineBarrier( - primary, {}, {vkh::BufferMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, - VK_ACCESS_TRANSFER_WRITE_BIT, ssbo.buffer)}); + vkh::cmdPipelineBarrier(primary, {}, + {vkh::BufferMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, + VK_ACCESS_TRANSFER_WRITE_BIT, ssbo.buffer)}); // clear the buffer so that we can't read any of the data back from outside the command buffer vkCmdFillBuffer(primary, ssbo.buffer, 0, ssbo_size, 0); - vkh::cmdPipelineBarrier( - primary, {}, {vkh::BufferMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, - VK_ACCESS_TRANSFER_WRITE_BIT, ssbo.buffer)}); + vkh::cmdPipelineBarrier(primary, {}, + {vkh::BufferMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, + VK_ACCESS_TRANSFER_WRITE_BIT, ssbo.buffer)}); { VkCommandBuffer cmd = primary; @@ -317,13 +318,14 @@ void main() popMarker(cmd); vkh::cmdPipelineBarrier( - cmd, {}, {vkh::BufferMemoryBarrier(VK_ACCESS_SHADER_WRITE_BIT, - VK_ACCESS_INDIRECT_COMMAND_READ_BIT, ssbo.buffer)}); + cmd, {}, + {vkh::BufferMemoryBarrier(VK_ACCESS_SHADER_WRITE_BIT, + VK_ACCESS_INDIRECT_COMMAND_READ_BIT, ssbo.buffer)}); } - vkCmdBeginRenderPass(primary, vkh::RenderPassBeginInfo(mainWindow->rp, mainWindow->GetFB(), - mainWindow->scissor), - VK_SUBPASS_CONTENTS_INLINE); + vkCmdBeginRenderPass( + primary, vkh::RenderPassBeginInfo(mainWindow->rp, mainWindow->GetFB(), mainWindow->scissor), + VK_SUBPASS_CONTENTS_INLINE); { VkCommandBuffer cmd = primary; @@ -463,8 +465,9 @@ void main() pushMarker(cmd, "Secondary: Dispatches"); vkh::cmdPipelineBarrier( - cmd, {}, {vkh::BufferMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, - VK_ACCESS_INDIRECT_COMMAND_READ_BIT, ssbo.buffer)}); + cmd, {}, + {vkh::BufferMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, + VK_ACCESS_INDIRECT_COMMAND_READ_BIT, ssbo.buffer)}); vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_COMPUTE, comppipe); vkh::cmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_COMPUTE, complayout, 0, {descset}, {}); @@ -482,8 +485,9 @@ void main() vkCmdDispatch(cmd, 1, 1, 1); vkh::cmdPipelineBarrier( - cmd, {}, {vkh::BufferMemoryBarrier(VK_ACCESS_SHADER_WRITE_BIT, - VK_ACCESS_INDIRECT_COMMAND_READ_BIT, ssbo.buffer)}); + cmd, {}, + {vkh::BufferMemoryBarrier(VK_ACCESS_SHADER_WRITE_BIT, + VK_ACCESS_INDIRECT_COMMAND_READ_BIT, ssbo.buffer)}); mode = 2; vkCmdPushConstants(cmd, complayout, VK_SHADER_STAGE_COMPUTE_BIT, 0, 4, &mode); @@ -494,17 +498,18 @@ void main() popMarker(cmd); vkh::cmdPipelineBarrier( - cmd, {}, {vkh::BufferMemoryBarrier(VK_ACCESS_SHADER_WRITE_BIT, - VK_ACCESS_INDIRECT_COMMAND_READ_BIT, ssbo.buffer)}); + cmd, {}, + {vkh::BufferMemoryBarrier(VK_ACCESS_SHADER_WRITE_BIT, + VK_ACCESS_INDIRECT_COMMAND_READ_BIT, ssbo.buffer)}); } vkEndCommandBuffer(dispatch_secondary); vkCmdExecuteCommands(primary, 1, &dispatch_secondary); - vkCmdBeginRenderPass(primary, vkh::RenderPassBeginInfo(mainWindow->rp, mainWindow->GetFB(), - mainWindow->scissor), - VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS); + vkCmdBeginRenderPass( + primary, vkh::RenderPassBeginInfo(mainWindow->rp, mainWindow->GetFB(), mainWindow->scissor), + VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS); VkCommandBuffer draw_secondary = GetCommandBuffer(VK_COMMAND_BUFFER_LEVEL_SECONDARY); @@ -599,9 +604,10 @@ void main() vkCmdEndRenderPass(primary); // restart the secondary renderpass - vkCmdBeginRenderPass(primary, vkh::RenderPassBeginInfo(mainWindow->rp, mainWindow->GetFB(), - mainWindow->scissor), - VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS); + vkCmdBeginRenderPass( + primary, + vkh::RenderPassBeginInfo(mainWindow->rp, mainWindow->GetFB(), mainWindow->scissor), + VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS); VkCommandBuffer count_secondary = GetCommandBuffer(VK_COMMAND_BUFFER_LEVEL_SECONDARY); cmds.push_back(count_secondary); diff --git a/util/test/demos/vk/vk_int8_ibuffer.cpp b/util/test/demos/vk/vk_int8_ibuffer.cpp index 20f7c19a0..640c8d334 100644 --- a/util/test/demos/vk/vk_int8_ibuffer.cpp +++ b/util/test/demos/vk/vk_int8_ibuffer.cpp @@ -56,7 +56,8 @@ RD_TEST(VK_Int8_IBuffer, VulkanGraphicsTest) pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -99,17 +100,32 @@ RD_TEST(VK_Int8_IBuffer, VulkanGraphicsTest) uint8_t idx[] = { // strip 0 - 0, 1, 2, 3, 4, 5, 6, 7, + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, // restart 0xff, // strip 1 - 8, 9, 10, 11, 12, 13, 14, 15, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, }; - AllocatedBuffer ib(this, vkh::BufferCreateInfo(sizeof(idx), VK_BUFFER_USAGE_INDEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + AllocatedBuffer ib(this, + vkh::BufferCreateInfo(sizeof(idx), VK_BUFFER_USAGE_INDEX_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); ib.upload(idx); diff --git a/util/test/demos/vk/vk_large_buffer.cpp b/util/test/demos/vk/vk_large_buffer.cpp index d4c9e3d2e..9b3d758a3 100644 --- a/util/test/demos/vk/vk_large_buffer.cpp +++ b/util/test/demos/vk/vk_large_buffer.cpp @@ -44,7 +44,8 @@ RD_TEST(VK_Large_Buffer, VulkanGraphicsTest) pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -64,10 +65,10 @@ RD_TEST(VK_Large_Buffer, VulkanGraphicsTest) ib.upload(indices); - AllocatedBuffer vb( - this, vkh::BufferCreateInfo(128 * 1024 * 1024, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), - VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); + AllocatedBuffer vb(this, + vkh::BufferCreateInfo(128 * 1024 * 1024, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), + VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); byte *ptr = vb.map(); if(ptr) @@ -80,8 +81,9 @@ RD_TEST(VK_Large_Buffer, VulkanGraphicsTest) } vb.unmap(); - AllocatedImage offimg(this, vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, - VK_IMAGE_USAGE_TRANSFER_DST_BIT), + AllocatedImage offimg(this, + vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, + VK_IMAGE_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); while(Running()) diff --git a/util/test/demos/vk/vk_large_descriptor_sets.cpp b/util/test/demos/vk/vk_large_descriptor_sets.cpp index 56491c269..f70b72a74 100644 --- a/util/test/demos/vk/vk_large_descriptor_sets.cpp +++ b/util/test/demos/vk/vk_large_descriptor_sets.cpp @@ -193,7 +193,8 @@ void main() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -205,8 +206,9 @@ void main() VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); @@ -215,15 +217,17 @@ void main() LoadXPM(SmileyTexture, rgba8); AllocatedImage smiley( - this, vkh::ImageCreateInfo(rgba8.width, rgba8.height, 0, VK_FORMAT_R8G8B8A8_UNORM, - VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), + this, + vkh::ImageCreateInfo(rgba8.width, rgba8.height, 0, VK_FORMAT_R8G8B8A8_UNORM, + VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); VkImageView smileyview = createImageView( vkh::ImageViewCreateInfo(smiley.image, VK_IMAGE_VIEW_TYPE_2D, VK_FORMAT_R8G8B8A8_UNORM)); - AllocatedBuffer uploadBuf(this, vkh::BufferCreateInfo(rgba8.data.size() * sizeof(uint32_t), - VK_BUFFER_USAGE_TRANSFER_SRC_BIT), + AllocatedBuffer uploadBuf(this, + vkh::BufferCreateInfo(rgba8.data.size() * sizeof(uint32_t), + VK_BUFFER_USAGE_TRANSFER_SRC_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); uploadBuf.upload(rgba8.data.data(), rgba8.data.size() * sizeof(uint32_t)); @@ -239,13 +243,14 @@ void main() updateAfterBind ? VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT : 0; CHECK_VKR(vkCreateDescriptorPool( - device, vkh::DescriptorPoolCreateInfo( - 8, {{VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, arraySize * 10}}, flags), + device, + vkh::DescriptorPoolCreateInfo(8, {{VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, arraySize * 10}}, flags), NULL, &descpool)); CHECK_VKR(vkAllocateDescriptorSets( - device, vkh::DescriptorSetAllocateInfo( - descpool, {setlayout, setlayout, setlayout, setlayout, setlayout}), + device, + vkh::DescriptorSetAllocateInfo(descpool, + {setlayout, setlayout, setlayout, setlayout, setlayout}), descset)); } diff --git a/util/test/demos/vk/vk_leak_check.cpp b/util/test/demos/vk/vk_leak_check.cpp index 7615bf67a..4113be32a 100644 --- a/util/test/demos/vk/vk_leak_check.cpp +++ b/util/test/demos/vk/vk_leak_check.cpp @@ -45,7 +45,8 @@ RD_TEST(VK_Leak_Check, VulkanGraphicsTest) pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -57,14 +58,16 @@ RD_TEST(VK_Leak_Check, VulkanGraphicsTest) VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); - AllocatedImage offimg(this, vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, - VK_IMAGE_USAGE_TRANSFER_DST_BIT), + AllocatedImage offimg(this, + vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, + VK_IMAGE_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); while(Running()) diff --git a/util/test/demos/vk/vk_line_raster.cpp b/util/test/demos/vk/vk_line_raster.cpp index 93b857d57..1ec7168b8 100644 --- a/util/test/demos/vk/vk_line_raster.cpp +++ b/util/test/demos/vk/vk_line_raster.cpp @@ -111,12 +111,14 @@ void main() pipeCreateInfo.rasterizationState.pNext = &lineRasterSetup; A2V linePoints[2] = { - {Vec3f(0.9f, 0.9f, 0.0f)}, {Vec3f(-0.9f, -0.9f, 0.0f)}, + {Vec3f(0.9f, 0.9f, 0.0f)}, + {Vec3f(-0.9f, -0.9f, 0.0f)}, }; AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(linePoints), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(linePoints), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(linePoints); diff --git a/util/test/demos/vk/vk_load_store_none.cpp b/util/test/demos/vk/vk_load_store_none.cpp index 0b31f6ca7..883b2f248 100644 --- a/util/test/demos/vk/vk_load_store_none.cpp +++ b/util/test/demos/vk/vk_load_store_none.cpp @@ -140,7 +140,8 @@ void main() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -155,9 +156,13 @@ void main() // blendEnable VK_FALSE, // color* - VK_BLEND_FACTOR_SRC_ALPHA, VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, VK_BLEND_OP_ADD, + VK_BLEND_FACTOR_SRC_ALPHA, + VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, + VK_BLEND_OP_ADD, // alpha* - VK_BLEND_FACTOR_SRC_ALPHA, VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, VK_BLEND_OP_ADD, + VK_BLEND_FACTOR_SRC_ALPHA, + VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, + VK_BLEND_OP_ADD, // colorWriteMask VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT, @@ -166,8 +171,9 @@ void main() VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); @@ -186,9 +192,10 @@ void main() }); // use the original pipeline's RP to clear and store - vkCmdBeginRenderPass(cmd, vkh::RenderPassBeginInfo(pipeRP, framebuffer, mainWindow->scissor, - {vkh::ClearValue(0.2f, 0.2f, 0.2f, 1.0f), - vkh::ClearValue(0.2f, 0.2f, 0.2f, 1.0f)}), + vkCmdBeginRenderPass(cmd, + vkh::RenderPassBeginInfo(pipeRP, framebuffer, mainWindow->scissor, + {vkh::ClearValue(0.2f, 0.2f, 0.2f, 1.0f), + vkh::ClearValue(0.2f, 0.2f, 0.2f, 1.0f)}), VK_SUBPASS_CONTENTS_INLINE); // clear a rect in the middle of the preserve attachment to green @@ -230,9 +237,10 @@ void main() VkImage swapimg = StartUsingBackbuffer(cmd, VK_ACCESS_TRANSFER_WRITE_BIT, VK_IMAGE_LAYOUT_GENERAL); - vkCmdBeginRenderPass(cmd, vkh::RenderPassBeginInfo(renderPass, framebuffer, mainWindow->scissor, - {vkh::ClearValue(0.2f, 0.2f, 0.2f, 1.0f), - vkh::ClearValue(1.0f, 0.2f, 0.2f, 1.0f)}), + vkCmdBeginRenderPass(cmd, + vkh::RenderPassBeginInfo(renderPass, framebuffer, mainWindow->scissor, + {vkh::ClearValue(0.2f, 0.2f, 0.2f, 1.0f), + vkh::ClearValue(1.0f, 0.2f, 0.2f, 1.0f)}), VK_SUBPASS_CONTENTS_INLINE); vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, pipe); diff --git a/util/test/demos/vk/vk_mem_bench.cpp b/util/test/demos/vk/vk_mem_bench.cpp index cb4fe424f..b688bfbc7 100644 --- a/util/test/demos/vk/vk_mem_bench.cpp +++ b/util/test/demos/vk/vk_mem_bench.cpp @@ -297,7 +297,8 @@ RD_TEST(VK_Mem_Bench, VulkanGraphicsTest) pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -333,10 +334,11 @@ RD_TEST(VK_Mem_Bench, VulkanGraphicsTest) VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo); - AllocatedBuffer vb(this, vkh::BufferCreateInfo(sizeof(DefaultTri) + 128 * 1024, - VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), - VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); + AllocatedBuffer vb( + this, + vkh::BufferCreateInfo(sizeof(DefaultTri) + 128 * 1024, + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), + VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); @@ -378,8 +380,9 @@ RD_TEST(VK_Mem_Bench, VulkanGraphicsTest) vkAllocateMemory(device, &info, NULL, &alloc.mem); vkCreateBuffer( - device, vkh::BufferCreateInfo(info.allocationSize, VK_BUFFER_USAGE_TRANSFER_SRC_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + device, + vkh::BufferCreateInfo(info.allocationSize, VK_BUFFER_USAGE_TRANSFER_SRC_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), NULL, &alloc.buf); vkBindBufferMemory(device, alloc.buf, alloc.mem, 0); @@ -472,9 +475,9 @@ RD_TEST(VK_Mem_Bench, VulkanGraphicsTest) vkCmdCopyBuffer(cmd, a.buf, readback.buffer, 1, ®ion); - vkh::cmdPipelineBarrier( - cmd, {}, {vkh::BufferMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, - readback.buffer)}); + vkh::cmdPipelineBarrier(cmd, {}, + {vkh::BufferMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, + VK_ACCESS_HOST_READ_BIT, readback.buffer)}); vkEndCommandBuffer(cmd); @@ -635,8 +638,9 @@ RD_TEST(VK_Mem_Bench, VulkanGraphicsTest) vkCmdCopyBuffer(cmd, a.buf, a.buf, 1, ®ion); vkCmdBeginRenderPass( - cmd, vkh::RenderPassBeginInfo(renderPass, framebuffer, mainWindow->scissor, - {vkh::ClearValue(0.2f, 0.2f, 0.2f, 1.0f)}), + cmd, + vkh::RenderPassBeginInfo(renderPass, framebuffer, mainWindow->scissor, + {vkh::ClearValue(0.2f, 0.2f, 0.2f, 1.0f)}), VK_SUBPASS_CONTENTS_INLINE); vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, pipe); diff --git a/util/test/demos/vk/vk_mesh_zoo.cpp b/util/test/demos/vk/vk_mesh_zoo.cpp index 23bb79363..8353b37b9 100644 --- a/util/test/demos/vk/vk_mesh_zoo.cpp +++ b/util/test/demos/vk/vk_mesh_zoo.cpp @@ -236,11 +236,12 @@ void main() }; // create depth-stencil image - AllocatedImage depthimg(this, vkh::ImageCreateInfo(mainWindow->scissor.extent.width, - mainWindow->scissor.extent.height, 0, - VK_FORMAT_D32_SFLOAT_S8_UINT, - VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT), - VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); + AllocatedImage depthimg( + this, + vkh::ImageCreateInfo(mainWindow->scissor.extent.width, mainWindow->scissor.extent.height, 0, + VK_FORMAT_D32_SFLOAT_S8_UINT, + VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT), + VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); VkImageView dsvview = createImageView(vkh::ImageViewCreateInfo( depthimg.image, VK_IMAGE_VIEW_TYPE_2D, VK_FORMAT_D32_SFLOAT_S8_UINT, {}, @@ -270,17 +271,15 @@ void main() renderPass, {mainWindow->GetView(i), dsvview}, mainWindow->scissor.extent)); VkPipelineLayout layout = createPipelineLayout(vkh::PipelineLayoutCreateInfo( - {}, - { - vkh::PushConstantRange(VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT, 0, - sizeof(Vec4f) * 2), - })); + {}, { + vkh::PushConstantRange(VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT, 0, + sizeof(Vec4f) * 2), + })); VkPipelineLayout layout2 = createPipelineLayout(vkh::PipelineLayoutCreateInfo( - {}, - { - vkh::PushConstantRange(VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(Vec4f) * 2), - })); + {}, { + vkh::PushConstantRange(VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(Vec4f) * 2), + })); vkh::GraphicsPipelineCreateInfo pipeCreateInfo; @@ -289,7 +288,8 @@ void main() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -339,7 +339,10 @@ void main() VkPipeline xfbpipe = VK_NULL_HANDLE; VkPipelineRasterizationStateStreamCreateInfoEXT rastInfo = { - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT, NULL, 0, 2, + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT, + NULL, + 0, + 2, }; VkBufferUsageFlags xfbUsage = VK_BUFFER_USAGE_TRANSFER_DST_BIT; @@ -377,8 +380,9 @@ void main() }; AllocatedBuffer cb( - this, vkh::BufferCreateInfo(sizeof(cbufferdata), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(cbufferdata), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); cb.upload(cbufferdata); @@ -397,8 +401,9 @@ void main() vkh::ImageSubresourceRange()); vkCmdBeginRenderPass( - cmd, vkh::RenderPassBeginInfo(renderPass, fbs[mainWindow->imgIndex], mainWindow->scissor, - {{}, vkh::ClearValue(1.0f, 0)}), + cmd, + vkh::RenderPassBeginInfo(renderPass, fbs[mainWindow->imgIndex], mainWindow->scissor, + {{}, vkh::ClearValue(1.0f, 0)}), VK_SUBPASS_CONTENTS_INLINE); vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, pipe); @@ -458,10 +463,14 @@ void main() if(xfbpipe != VK_NULL_HANDLE) { VkBuffer bufs[3] = { - xfbBuf.buffer, xfbBuf.buffer, xfbBuf.buffer, + xfbBuf.buffer, + xfbBuf.buffer, + xfbBuf.buffer, }; VkDeviceSize offs[3] = { - 0, 1024, 2048, + 0, + 1024, + 2048, }; vkCmdBindTransformFeedbackBuffersEXT(cmd, 0, 3, bufs, offs, NULL); diff --git a/util/test/demos/vk/vk_misaligned_dirty.cpp b/util/test/demos/vk/vk_misaligned_dirty.cpp index d78cd095e..b05820a42 100644 --- a/util/test/demos/vk/vk_misaligned_dirty.cpp +++ b/util/test/demos/vk/vk_misaligned_dirty.cpp @@ -45,7 +45,8 @@ RD_TEST(VK_Misaligned_Dirty, VulkanGraphicsTest) pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -65,15 +66,16 @@ RD_TEST(VK_Misaligned_Dirty, VulkanGraphicsTest) {}, }; - AllocatedBuffer copy_src( - this, vkh::BufferCreateInfo( - sizeof(tri), VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), - VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); + AllocatedBuffer copy_src(this, + vkh::BufferCreateInfo(sizeof(tri), VK_BUFFER_USAGE_TRANSFER_SRC_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), + VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); setName(copy_src.buffer, "copy_src"); - AllocatedBuffer vb(this, vkh::BufferCreateInfo(sizeof(tri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + AllocatedBuffer vb(this, + vkh::BufferCreateInfo(sizeof(tri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); setName(vb.buffer, "vb"); diff --git a/util/test/demos/vk/vk_multi_entry.cpp b/util/test/demos/vk/vk_multi_entry.cpp index b97eb0b01..faf30bca8 100644 --- a/util/test/demos/vk/vk_multi_entry.cpp +++ b/util/test/demos/vk/vk_multi_entry.cpp @@ -216,15 +216,17 @@ RD_TEST(VK_Multi_Entry, VulkanGraphicsTest) VkDescriptorSetLayout setlayout = createDescriptorSetLayout(vkh::DescriptorSetLayoutCreateInfo({ { - 0, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 100, VK_SHADER_STAGE_FRAGMENT_BIT, + 0, + VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, + 100, + VK_SHADER_STAGE_FRAGMENT_BIT, }, })); VkPipelineLayout layout = createPipelineLayout(vkh::PipelineLayoutCreateInfo( - {setlayout}, - { - vkh::PushConstantRange(VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(Vec4i)), - })); + {setlayout}, { + vkh::PushConstantRange(VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(Vec4i)), + })); vkh::GraphicsPipelineCreateInfo pipeCreateInfo; @@ -233,7 +235,8 @@ RD_TEST(VK_Multi_Entry, VulkanGraphicsTest) pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -241,7 +244,8 @@ RD_TEST(VK_Multi_Entry, VulkanGraphicsTest) combined_asm, ShaderLang::spvasm, ShaderStage::vert, "main", {}, SPIRVTarget::vulkan); pipeCreateInfo.stages = { - shad, shad, + shad, + shad, }; pipeCreateInfo.stages[1].stage = VK_SHADER_STAGE_FRAGMENT_BIT; @@ -249,15 +253,17 @@ RD_TEST(VK_Multi_Entry, VulkanGraphicsTest) VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); AllocatedImage img( - this, vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, - VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT), + this, + vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, + VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); VkImageView view = createImageView( diff --git a/util/test/demos/vk/vk_multi_present.cpp b/util/test/demos/vk/vk_multi_present.cpp index 485c13b3f..a0b7bc34c 100644 --- a/util/test/demos/vk/vk_multi_present.cpp +++ b/util/test/demos/vk/vk_multi_present.cpp @@ -45,7 +45,8 @@ RD_TEST(VK_Multi_Present, VulkanGraphicsTest) pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -81,15 +82,16 @@ RD_TEST(VK_Multi_Present, VulkanGraphicsTest) VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb[0].upload(red); - vb[1] = AllocatedBuffer( - this, vkh::BufferCreateInfo(sizeof(green), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), - VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); + vb[1] = + AllocatedBuffer(this, + vkh::BufferCreateInfo(sizeof(green), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), + VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb[1].upload(green); - vb[2] = AllocatedBuffer( - this, vkh::BufferCreateInfo(sizeof(blue), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), - VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); + vb[2] = AllocatedBuffer(this, + vkh::BufferCreateInfo(sizeof(blue), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), + VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb[2].upload(blue); std::vector windows = { diff --git a/util/test/demos/vk/vk_multi_thread_windows.cpp b/util/test/demos/vk/vk_multi_thread_windows.cpp index 432a9d3d4..5770b54c1 100644 --- a/util/test/demos/vk/vk_multi_thread_windows.cpp +++ b/util/test/demos/vk/vk_multi_thread_windows.cpp @@ -66,7 +66,8 @@ RD_TEST(VK_Multi_Thread_Windows, VulkanGraphicsTest) pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -78,8 +79,9 @@ RD_TEST(VK_Multi_Thread_Windows, VulkanGraphicsTest) VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); diff --git a/util/test/demos/vk/vk_overlay_test.cpp b/util/test/demos/vk/vk_overlay_test.cpp index 8989f21b8..f882c5d60 100644 --- a/util/test/demos/vk/vk_overlay_test.cpp +++ b/util/test/demos/vk/vk_overlay_test.cpp @@ -124,7 +124,10 @@ void main() VkDescriptorSetLayout setlayout = createDescriptorSetLayout(vkh::DescriptorSetLayoutCreateInfo({ { - 0, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 64, VK_SHADER_STAGE_FRAGMENT_BIT, + 0, + VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, + 64, + VK_SHADER_STAGE_FRAGMENT_BIT, }, })); @@ -212,11 +215,12 @@ void main() vb.upload(VBData); // create depth-stencil image - AllocatedImage depthimg(this, vkh::ImageCreateInfo(mainWindow->scissor.extent.width, - mainWindow->scissor.extent.height, 0, - VK_FORMAT_D32_SFLOAT_S8_UINT, - VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT), - VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); + AllocatedImage depthimg( + this, + vkh::ImageCreateInfo(mainWindow->scissor.extent.width, mainWindow->scissor.extent.height, 0, + VK_FORMAT_D32_SFLOAT_S8_UINT, + VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT), + VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); VkImageView dsvview = createImageView(vkh::ImageViewCreateInfo( depthimg.image, VK_IMAGE_VIEW_TYPE_2D, VK_FORMAT_D32_SFLOAT_S8_UINT, {}, @@ -264,7 +268,8 @@ void main() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -274,7 +279,8 @@ void main() }; VkSpecializationMapEntry specmap[2] = { - {1, 0 * sizeof(uint32_t), sizeof(uint32_t)}, {2, 1 * sizeof(uint32_t), sizeof(uint32_t)}, + {1, 0 * sizeof(uint32_t), sizeof(uint32_t)}, + {2, 1 * sizeof(uint32_t), sizeof(uint32_t)}, }; uint32_t specvals[2] = {1337, 1338}; @@ -384,16 +390,17 @@ void main() }; AllocatedImage msaaimg( - this, vkh::ImageCreateInfo(mainWindow->scissor.extent.width, - mainWindow->scissor.extent.height, 0, mainWindow->format, - VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, 1, 1, VK_SAMPLE_COUNT_4_BIT), + this, + vkh::ImageCreateInfo(mainWindow->scissor.extent.width, mainWindow->scissor.extent.height, 0, + mainWindow->format, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, 1, 1, + VK_SAMPLE_COUNT_4_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); AllocatedImage msaadepthimg( - this, vkh::ImageCreateInfo( - mainWindow->scissor.extent.width, mainWindow->scissor.extent.height, 0, - VK_FORMAT_D32_SFLOAT_S8_UINT, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, 1, 1, - VK_SAMPLE_COUNT_4_BIT), + this, + vkh::ImageCreateInfo(mainWindow->scissor.extent.width, mainWindow->scissor.extent.height, 0, + VK_FORMAT_D32_SFLOAT_S8_UINT, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, + 1, 1, VK_SAMPLE_COUNT_4_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); VkImageView msaaRTV = createImageView( @@ -406,9 +413,10 @@ void main() msaaRP, {msaaRTV, msaaDSV}, {mainWindow->scissor.extent.width, mainWindow->scissor.extent.height})); - AllocatedImage img(this, vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, - VK_IMAGE_USAGE_SAMPLED_BIT), - VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); + AllocatedImage img( + this, + vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, VK_IMAGE_USAGE_SAMPLED_BIT), + VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); setName(img.image, "Colour Tex"); @@ -478,12 +486,12 @@ void main() vkCmdSetScissor(cmd, 0, 1, &mainWindow->scissor); vkh::cmdBindVertexBuffers(cmd, 0, {vb.buffer}, {0}); - vkCmdBeginRenderPass( - cmd, vkh::RenderPassBeginInfo( - is_msaa ? msaaRP : renderPass, is_msaa ? msaaFB : fbs[mainWindow->imgIndex], - mainWindow->scissor, - {vkh::ClearValue(0.2f, 0.2f, 0.2f, 1.0f), vkh::ClearValue(1.0f, 0)}), - VK_SUBPASS_CONTENTS_INLINE); + vkCmdBeginRenderPass(cmd, + vkh::RenderPassBeginInfo( + is_msaa ? msaaRP : renderPass, + is_msaa ? msaaFB : fbs[mainWindow->imgIndex], mainWindow->scissor, + {vkh::ClearValue(0.2f, 0.2f, 0.2f, 1.0f), vkh::ClearValue(1.0f, 0)}), + VK_SUBPASS_CONTENTS_INLINE); // draw the setup triangles @@ -560,9 +568,10 @@ void main() vkCmdSetViewport(cmd, 0, 1, &v); vkCmdSetScissor(cmd, 0, 1, &s); - vkCmdBeginRenderPass(cmd, vkh::RenderPassBeginInfo(subrp, subfb[0], s, - {vkh::ClearValue(0.0f, 0.0f, 0.0f, 1.0f)}), - VK_SUBPASS_CONTENTS_INLINE); + vkCmdBeginRenderPass( + cmd, + vkh::RenderPassBeginInfo(subrp, subfb[0], s, {vkh::ClearValue(0.0f, 0.0f, 0.0f, 1.0f)}), + VK_SUBPASS_CONTENTS_INLINE); vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, whitepipe); @@ -592,9 +601,10 @@ void main() vkCmdSetViewport(cmd, 0, 1, &v); vkCmdSetScissor(cmd, 0, 1, &s); - vkCmdBeginRenderPass(cmd, vkh::RenderPassBeginInfo(subrp, subfb[1], s, - {vkh::ClearValue(0.0f, 0.0f, 0.0f, 1.0f)}), - VK_SUBPASS_CONTENTS_INLINE); + vkCmdBeginRenderPass( + cmd, + vkh::RenderPassBeginInfo(subrp, subfb[1], s, {vkh::ClearValue(0.0f, 0.0f, 0.0f, 1.0f)}), + VK_SUBPASS_CONTENTS_INLINE); vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, whitepipe); diff --git a/util/test/demos/vk/vk_parameter_zoo.cpp b/util/test/demos/vk/vk_parameter_zoo.cpp index 9ab2f60f6..27b8c99fe 100644 --- a/util/test/demos/vk/vk_parameter_zoo.cpp +++ b/util/test/demos/vk/vk_parameter_zoo.cpp @@ -590,7 +590,8 @@ void main() }; VkInputAttachmentAspectReference inputAspectReferences[2] = { - {0, 0, VK_IMAGE_ASPECT_COLOR_BIT}, {1, 0, VK_IMAGE_ASPECT_COLOR_BIT}, + {0, 0, VK_IMAGE_ASPECT_COLOR_BIT}, + {1, 0, VK_IMAGE_ASPECT_COLOR_BIT}, }; inputAspects.aspectReferenceCount = 2; @@ -611,7 +612,8 @@ void main() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -791,8 +793,9 @@ void main() else { vb = AllocatedBuffer( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); } @@ -1165,12 +1168,14 @@ void main() // check that stale views in descriptors don't cause problems if the handle is re-used VkImageView view1, view2; - CHECK_VKR(vkCreateImageView(device, vkh::ImageViewCreateInfo(img.image, VK_IMAGE_VIEW_TYPE_2D, - VK_FORMAT_R32G32B32A32_SFLOAT), - NULL, &view1)); - CHECK_VKR(vkCreateImageView(device, vkh::ImageViewCreateInfo(img.image, VK_IMAGE_VIEW_TYPE_2D, - VK_FORMAT_R32G32B32A32_SFLOAT), - NULL, &view2)); + CHECK_VKR(vkCreateImageView( + device, + vkh::ImageViewCreateInfo(img.image, VK_IMAGE_VIEW_TYPE_2D, VK_FORMAT_R32G32B32A32_SFLOAT), + NULL, &view1)); + CHECK_VKR(vkCreateImageView( + device, + vkh::ImageViewCreateInfo(img.image, VK_IMAGE_VIEW_TYPE_2D, VK_FORMAT_R32G32B32A32_SFLOAT), + NULL, &view2)); vkh::updateDescriptorSets( device, @@ -1187,9 +1192,10 @@ void main() // create view3. Under RD, this is expected to get the same handle as view2 (but a new ID) VkImageView view3; - CHECK_VKR(vkCreateImageView(device, vkh::ImageViewCreateInfo(img.image, VK_IMAGE_VIEW_TYPE_2D, - VK_FORMAT_R32G32B32A32_SFLOAT), - NULL, &view3)); + CHECK_VKR(vkCreateImageView( + device, + vkh::ImageViewCreateInfo(img.image, VK_IMAGE_VIEW_TYPE_2D, VK_FORMAT_R32G32B32A32_SFLOAT), + NULL, &view3)); if(rdoc) { @@ -1408,11 +1414,12 @@ void main() CHECK_VKR(vkCreateCommandPool(device, vkh::CommandPoolCreateInfo(), NULL, &cmdPool)); VkDescriptorPool descPool; CHECK_VKR(vkCreateDescriptorPool( - device, vkh::DescriptorPoolCreateInfo(128, - { - {VK_DESCRIPTOR_TYPE_SAMPLER, 1024}, - }, - VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT), + device, + vkh::DescriptorPoolCreateInfo(128, + { + {VK_DESCRIPTOR_TYPE_SAMPLER, 1024}, + }, + VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT), NULL, &descPool)); VkCommandBuffer emptyCmd = VK_NULL_HANDLE; @@ -1525,9 +1532,9 @@ void main() if(KHR_push_descriptor) setMarker(cmd, "KHR_push_descriptor"); - vkCmdBeginRenderPass(cmd, vkh::RenderPassBeginInfo(renderPass, fbs[mainWindow->imgIndex], - mainWindow->scissor), - VK_SUBPASS_CONTENTS_INLINE); + vkCmdBeginRenderPass( + cmd, vkh::RenderPassBeginInfo(renderPass, fbs[mainWindow->imgIndex], mainWindow->scissor), + VK_SUBPASS_CONTENTS_INLINE); vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, refpipe); @@ -1639,9 +1646,9 @@ void main() vkh::ClearColorValue(0.2f, 0.2f, 0.2f, 1.0f), 1, vkh::ImageSubresourceRange()); - vkCmdBeginRenderPass(cmd, vkh::RenderPassBeginInfo(renderPass, fbs[mainWindow->imgIndex], - mainWindow->scissor), - VK_SUBPASS_CONTENTS_INLINE); + vkCmdBeginRenderPass( + cmd, vkh::RenderPassBeginInfo(renderPass, fbs[mainWindow->imgIndex], mainWindow->scissor), + VK_SUBPASS_CONTENTS_INLINE); if(!tools.empty()) { diff --git a/util/test/demos/vk/vk_pixel_history.cpp b/util/test/demos/vk/vk_pixel_history.cpp index cedf95d29..a4c900420 100644 --- a/util/test/demos/vk/vk_pixel_history.cpp +++ b/util/test/demos/vk/vk_pixel_history.cpp @@ -311,7 +311,8 @@ void main() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -476,9 +477,10 @@ void main() VkPipeline mspipe = createGraphicsPipeline(pipeCreateInfo); AllocatedImage submsimg( - this, vkh::ImageCreateInfo(mainWindow->scissor.extent.width, - mainWindow->scissor.extent.height, 0, mainWindow->format, - VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, 1, 4, VK_SAMPLE_COUNT_4_BIT), + this, + vkh::ImageCreateInfo(mainWindow->scissor.extent.width, mainWindow->scissor.extent.height, 0, + mainWindow->format, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, 1, 4, + VK_SAMPLE_COUNT_4_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); setName(submsimg.image, "submsimg"); @@ -606,9 +608,10 @@ void main() { setMarker(cmd, "Multisampled: begin renderpass"); - vkCmdBeginRenderPass(cmd, vkh::RenderPassBeginInfo(submsrp, submsfb, mainWindow->scissor, - {vkh::ClearValue(0.f, 1.0f, 0.f, 1.0f), - vkh::ClearValue(0.f, 0)}), + vkCmdBeginRenderPass(cmd, + vkh::RenderPassBeginInfo( + submsrp, submsfb, mainWindow->scissor, + {vkh::ClearValue(0.f, 1.0f, 0.f, 1.0f), vkh::ClearValue(0.f, 0)}), VK_SUBPASS_CONTENTS_INLINE); vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, mspipe); diff --git a/util/test/demos/vk/vk_postponed.cpp b/util/test/demos/vk/vk_postponed.cpp index 2f32471f2..d566ffb7e 100644 --- a/util/test/demos/vk/vk_postponed.cpp +++ b/util/test/demos/vk/vk_postponed.cpp @@ -60,7 +60,8 @@ RD_TEST(VK_Postponed, VulkanGraphicsTest) pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -72,14 +73,16 @@ RD_TEST(VK_Postponed, VulkanGraphicsTest) VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); - AllocatedImage offimg(this, vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, - VK_IMAGE_USAGE_TRANSFER_DST_BIT), + AllocatedImage offimg(this, + vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, + VK_IMAGE_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); setName(offimg.image, "offimg"); @@ -104,8 +107,9 @@ RD_TEST(VK_Postponed, VulkanGraphicsTest) VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); postponedDediBufs[i] = AllocatedBuffer( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo( {VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT, VMA_MEMORY_USAGE_CPU_TO_GPU})); diff --git a/util/test/demos/vk/vk_query_pool.cpp b/util/test/demos/vk/vk_query_pool.cpp index 1072013d3..a8e51c608 100644 --- a/util/test/demos/vk/vk_query_pool.cpp +++ b/util/test/demos/vk/vk_query_pool.cpp @@ -50,7 +50,8 @@ RD_TEST(VK_Query_Pool, VulkanGraphicsTest) pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -61,8 +62,9 @@ RD_TEST(VK_Query_Pool, VulkanGraphicsTest) VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo); - AllocatedBuffer vb(this, vkh::BufferCreateInfo(4096, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + AllocatedBuffer vb(this, + vkh::BufferCreateInfo(4096, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); diff --git a/util/test/demos/vk/vk_read_before_overwrite.cpp b/util/test/demos/vk/vk_read_before_overwrite.cpp index 71df2db21..ae1b0f180 100644 --- a/util/test/demos/vk/vk_read_before_overwrite.cpp +++ b/util/test/demos/vk/vk_read_before_overwrite.cpp @@ -124,7 +124,8 @@ void main() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -146,35 +147,38 @@ void main() VkImageView storeView[2]; VkDescriptorSet sets[2]; - AllocatedBuffer outbuf(this, vkh::BufferCreateInfo(2048, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | - VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + AllocatedBuffer outbuf(this, + vkh::BufferCreateInfo(2048, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); setName(outbuf.buffer, "outbuf"); for(int i = 0; i < 2; i++) { - ssbo[i] = - AllocatedBuffer(this, vkh::BufferCreateInfo(1024, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | + ssbo[i] = AllocatedBuffer(this, + vkh::BufferCreateInfo(1024, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), - VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); - ubo[i] = - AllocatedBuffer(this, vkh::BufferCreateInfo(1024, VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), - VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); + VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); + ubo[i] = AllocatedBuffer(this, + vkh::BufferCreateInfo(1024, VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), + VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); sampled[i] = AllocatedImage( - this, vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, - VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT), + this, + vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, + VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); sampledView[i] = createImageView(vkh::ImageViewCreateInfo( sampled[i].image, VK_IMAGE_VIEW_TYPE_2D, VK_FORMAT_R32G32B32A32_SFLOAT)); storeIm[i] = AllocatedImage( - this, vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, - VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT), + this, + vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, + VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); storeView[i] = createImageView(vkh::ImageViewCreateInfo( diff --git a/util/test/demos/vk/vk_resource_lifetimes.cpp b/util/test/demos/vk/vk_resource_lifetimes.cpp index 7e6a81a09..146a9d277 100644 --- a/util/test/demos/vk/vk_resource_lifetimes.cpp +++ b/util/test/demos/vk/vk_resource_lifetimes.cpp @@ -98,13 +98,22 @@ void main() VkDescriptorSetLayout setlayout = createDescriptorSetLayout(vkh::DescriptorSetLayoutCreateInfo({ { - 0, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT, + 0, + VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, + 1, + VK_SHADER_STAGE_FRAGMENT_BIT, }, { - 1, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT, + 1, + VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, + 1, + VK_SHADER_STAGE_FRAGMENT_BIT, }, { - 2, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1, VK_SHADER_STAGE_FRAGMENT_BIT, + 2, + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, + 1, + VK_SHADER_STAGE_FRAGMENT_BIT, }, })); @@ -117,7 +126,8 @@ void main() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -129,8 +139,9 @@ void main() VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); @@ -139,23 +150,26 @@ void main() LoadXPM(SmileyTexture, rgba8); AllocatedImage smiley( - this, vkh::ImageCreateInfo(rgba8.width, rgba8.height, 0, VK_FORMAT_R8G8B8A8_UNORM, - VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), + this, + vkh::ImageCreateInfo(rgba8.width, rgba8.height, 0, VK_FORMAT_R8G8B8A8_UNORM, + VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); VkImageView smileyview = createImageView( vkh::ImageViewCreateInfo(smiley.image, VK_IMAGE_VIEW_TYPE_2D, VK_FORMAT_R8G8B8A8_UNORM)); AllocatedImage badimg( - this, vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R8G8B8A8_UNORM, - VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), + this, + vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R8G8B8A8_UNORM, + VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); VkImageView badview = createImageView( vkh::ImageViewCreateInfo(badimg.image, VK_IMAGE_VIEW_TYPE_2D, VK_FORMAT_R8G8B8A8_UNORM)); - AllocatedBuffer uploadBuf(this, vkh::BufferCreateInfo(rgba8.data.size() * sizeof(uint32_t), - VK_BUFFER_USAGE_TRANSFER_SRC_BIT), + AllocatedBuffer uploadBuf(this, + vkh::BufferCreateInfo(rgba8.data.size() * sizeof(uint32_t), + VK_BUFFER_USAGE_TRANSFER_SRC_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); uploadBuf.upload(rgba8.data.data(), rgba8.data.size() * sizeof(uint32_t)); @@ -254,8 +268,9 @@ void main() VkImage img = VK_NULL_HANDLE; vkCreateImage( - device, vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R8G8B8A8_UNORM, - VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), + device, + vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R8G8B8A8_UNORM, + VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), NULL, &img); return img; @@ -284,13 +299,25 @@ void main() const uint32_t checker[4 * 4] = { // X X O O - 0xffffffff, 0xffffffff, 0, 0, + 0xffffffff, + 0xffffffff, + 0, + 0, // X X O O - 0xffffffff, 0xffffffff, 0, 0, + 0xffffffff, + 0xffffffff, + 0, + 0, // O O X X - 0, 0, 0xffffffff, 0xffffffff, + 0, + 0, + 0xffffffff, + 0xffffffff, // O O X X - 0, 0, 0xffffffff, 0xffffffff, + 0, + 0, + 0xffffffff, + 0xffffffff, }; uploadBuf.upload(checker); @@ -309,7 +336,6 @@ void main() }; auto TrashImage = [this](VkImage img, VkDeviceMemory mem, VkImageView view) { - vkDestroyImageView(device, view, NULL); vkDestroyImage(device, img, NULL); vkFreeMemory(device, mem, NULL); @@ -319,17 +345,18 @@ void main() { CHECK_VKR(vkCreateDescriptorPool( - device, vkh::DescriptorPoolCreateInfo(8, - { - {VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1024}, - {VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1024}, - }, - VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT), + device, + vkh::DescriptorPoolCreateInfo(8, + { + {VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1024}, + {VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1024}, + }, + VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT), NULL, &descpool)); } auto SetupDescSet = [this, setlayout, descpool, smileysampler, checkersampler, smileyview]( - VkBuffer cb, VkImageView view) { + VkBuffer cb, VkImageView view) { VkDescriptorSet descset = VK_NULL_HANDLE; vkAllocateDescriptorSets(device, vkh::DescriptorSetAllocateInfo(descpool, {setlayout}), @@ -358,7 +385,6 @@ void main() }; auto TrashDescSet = [this, descpool, checkersampler, &badcb, badview](VkDescriptorSet descset) { - // update with bad data vkh::updateDescriptorSets( device, { diff --git a/util/test/demos/vk/vk_robustness2.cpp b/util/test/demos/vk/vk_robustness2.cpp index 816296583..eaf4d6fd6 100644 --- a/util/test/demos/vk/vk_robustness2.cpp +++ b/util/test/demos/vk/vk_robustness2.cpp @@ -182,10 +182,9 @@ void main() else { layout = createPipelineLayout(vkh::PipelineLayoutCreateInfo( - {setlayout}, - { - vkh::PushConstantRange(VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(Vec4i)), - })); + {setlayout}, { + vkh::PushConstantRange(VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(Vec4i)), + })); } vkh::GraphicsPipelineCreateInfo pipeCreateInfo; @@ -196,7 +195,8 @@ void main() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V), vkh::vertexBind(1, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 1, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 1, DefaultA2V, col), vkh::vertexAttr(2, 1, DefaultA2V, uv), }; @@ -212,15 +212,17 @@ void main() VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); - AllocatedImage offimg(this, vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, - VK_IMAGE_USAGE_STORAGE_BIT), - VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); + AllocatedImage offimg( + this, + vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, VK_IMAGE_USAGE_STORAGE_BIT), + VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); VkImageView store_view = createImageView(vkh::ImageViewCreateInfo( offimg.image, VK_IMAGE_VIEW_TYPE_2D, VK_FORMAT_R32G32B32A32_SFLOAT)); diff --git a/util/test/demos/vk/vk_sample_locations.cpp b/util/test/demos/vk/vk_sample_locations.cpp index ee2bf857e..f69f2c2ca 100644 --- a/util/test/demos/vk/vk_sample_locations.cpp +++ b/util/test/demos/vk/vk_sample_locations.cpp @@ -54,11 +54,12 @@ RD_TEST(VK_Sample_Locations, VulkanGraphicsTest) // create multi-sampled image AllocatedImage msaaimg( - this, vkh::ImageCreateInfo(mainWindow->scissor.extent.width, - mainWindow->scissor.extent.height, 0, mainWindow->format, - VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | - VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT, - 1, 1, VK_SAMPLE_COUNT_4_BIT), + this, + vkh::ImageCreateInfo(mainWindow->scissor.extent.width, mainWindow->scissor.extent.height, 0, + mainWindow->format, + VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | + VK_IMAGE_USAGE_SAMPLED_BIT, + 1, 1, VK_SAMPLE_COUNT_4_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); VkImageView msview = createImageView( @@ -95,7 +96,8 @@ RD_TEST(VK_Sample_Locations, VulkanGraphicsTest) pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -119,8 +121,9 @@ RD_TEST(VK_Sample_Locations, VulkanGraphicsTest) VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); @@ -170,10 +173,8 @@ RD_TEST(VK_Sample_Locations, VulkanGraphicsTest) float gridDim = sampleProps.sampleLocationCoordinateRange[1]; // rescales from [-8, 8] to [maxGrid[0], maxGrid[1]] in both dimension -#define SAMPLE_POS(x, y) \ - { \ - (((x) + 8.0f) / 16.0f) * gridDim + gridBase, (((y) + 8.0f) / 16.0f) * gridDim + gridBase \ - } +#define SAMPLE_POS(x, y) \ + {(((x) + 8.0f) / 16.0f) * gridDim + gridBase, (((y) + 8.0f) / 16.0f) * gridDim + gridBase} // vertical grid and degenerate VkSampleLocationEXT locations1[4] = { diff --git a/util/test/demos/vk/vk_secondary_cmdbuf.cpp b/util/test/demos/vk/vk_secondary_cmdbuf.cpp index d27cc1013..39a16c995 100644 --- a/util/test/demos/vk/vk_secondary_cmdbuf.cpp +++ b/util/test/demos/vk/vk_secondary_cmdbuf.cpp @@ -73,7 +73,8 @@ RD_TEST(VK_Secondary_CmdBuf, VulkanGraphicsTest) pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -139,8 +140,9 @@ RD_TEST(VK_Secondary_CmdBuf, VulkanGraphicsTest) vkh::ClearColorValue(0.2f, 0.2f, 0.2f, 1.0f), 1, vkh::ImageSubresourceRange()); - vkCmdBeginRenderPass(cmd, vkh::RenderPassBeginInfo(renderPass, framebuffer, size, - {vkh::ClearValue(0.2f, 0.2f, 0.2f, 1.0f)}), + vkCmdBeginRenderPass(cmd, + vkh::RenderPassBeginInfo(renderPass, framebuffer, size, + {vkh::ClearValue(0.2f, 0.2f, 0.2f, 1.0f)}), VK_SUBPASS_CONTENTS_INLINE); vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, pipe0); diff --git a/util/test/demos/vk/vk_separate_depth_stencil_layouts.cpp b/util/test/demos/vk/vk_separate_depth_stencil_layouts.cpp index e316e6b69..c2f945809 100644 --- a/util/test/demos/vk/vk_separate_depth_stencil_layouts.cpp +++ b/util/test/demos/vk/vk_separate_depth_stencil_layouts.cpp @@ -143,29 +143,33 @@ void main() }; AllocatedBuffer stencilVB( - this, vkh::BufferCreateInfo(sizeof(stencilTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(stencilTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); stencilVB.upload(stencilTri); AllocatedBuffer depthVB( - this, vkh::BufferCreateInfo(sizeof(depthTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(depthTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); depthVB.upload(depthTri); AllocatedBuffer inputAttVB( - this, vkh::BufferCreateInfo(sizeof(inputAttTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(inputAttTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); inputAttVB.upload(inputAttTri); AllocatedBuffer colorVB( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); colorVB.upload(colorTri); @@ -306,10 +310,11 @@ void main() CHECK_VKR(vkCreateImageView( device, vkh::ImageViewCreateInfo(colorImg.image, VK_IMAGE_VIEW_TYPE_2D, mainWindow->format), NULL, &colorView)); - CHECK_VKR(vkCreateFramebuffer( - device, vkh::FramebufferCreateInfo(renderPass, {colorView, depthStencilView}, - mainWindow->scissor.extent), - NULL, &frameBuffer)); + CHECK_VKR( + vkCreateFramebuffer(device, + vkh::FramebufferCreateInfo(renderPass, {colorView, depthStencilView}, + mainWindow->scissor.extent), + NULL, &frameBuffer)); } VkPipeline stencilPipe = VK_NULL_HANDLE; @@ -334,7 +339,8 @@ void main() stencilPipeCreateInfo.vertexInputState.vertexBindingDescriptions = { vkh::vertexBind(0, DefaultA2V)}; stencilPipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; stencilPipeCreateInfo.stages = { @@ -361,7 +367,8 @@ void main() depthPipeCreateInfo.vertexInputState.vertexBindingDescriptions = { vkh::vertexBind(0, DefaultA2V)}; depthPipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; depthPipeCreateInfo.stages = { @@ -388,7 +395,8 @@ void main() inputAttPipeCreateInfo.vertexInputState.vertexBindingDescriptions = { vkh::vertexBind(0, DefaultA2V)}; inputAttPipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; inputAttPipeCreateInfo.stages = { @@ -415,7 +423,8 @@ void main() colorPipeCreateInfo.vertexInputState.vertexBindingDescriptions = { vkh::vertexBind(0, DefaultA2V)}; colorPipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; colorPipeCreateInfo.stages = { @@ -455,8 +464,9 @@ void main() }); vkCmdBeginRenderPass( - cmd, vkh::RenderPassBeginInfo(renderPass, frameBuffer, mainWindow->scissor, - {vkh::ClearValue(1, 0, 1, 1), vkh::ClearValue(1.0f, 0)}), + cmd, + vkh::RenderPassBeginInfo(renderPass, frameBuffer, mainWindow->scissor, + {vkh::ClearValue(1, 0, 1, 1), vkh::ClearValue(1.0f, 0)}), VK_SUBPASS_CONTENTS_INLINE); vkCmdSetViewport(cmd, 0, 1, &mainWindow->viewport); vkCmdSetScissor(cmd, 0, 1, &mainWindow->scissor); diff --git a/util/test/demos/vk/vk_shader_debug_zoo.cpp b/util/test/demos/vk/vk_shader_debug_zoo.cpp index f1cc4c8b0..c18bb0f91 100644 --- a/util/test/demos/vk/vk_shader_debug_zoo.cpp +++ b/util/test/demos/vk/vk_shader_debug_zoo.cpp @@ -274,7 +274,8 @@ layout(location = 0, index = 0) out vec4 Color; #define inout_type in -)EOSHADER" + v2f + R"EOSHADER( +)EOSHADER" + v2f + + R"EOSHADER( vec4 varscope_test(int coord, vec2 inpos_param, vec2 inpos_incr_param) { @@ -656,7 +657,7 @@ void main() break; } )EOSHADER" - R"EOSHADER( + R"EOSHADER( case 51: { Color = fwidthFine(vec4(inpos, inposIncreased)); @@ -1023,7 +1024,7 @@ void main() break; } )EOSHADER" - R"EOSHADER( + R"EOSHADER( case 102: { uint a = zerou + 0x0dadbeef; @@ -1380,7 +1381,7 @@ void main() } #endif )EOSHADER" - R"EOSHADER( + R"EOSHADER( case 153: { vec3 cubeCoord = vec3(1.0f, -0.3f, 0.9f); @@ -3791,30 +3792,34 @@ OpMemberDecorate %cbuffer_struct 17 Offset 216 ; double doublePackSource Texture rgba8; LoadXPM(SmileyTexture, rgba8); - AllocatedImage queryTest(this, vkh::ImageCreateInfo(183, 347, 0, VK_FORMAT_R8G8B8A8_UNORM, - VK_IMAGE_USAGE_SAMPLED_BIT, 4, 3), + AllocatedImage queryTest(this, + vkh::ImageCreateInfo(183, 347, 0, VK_FORMAT_R8G8B8A8_UNORM, + VK_IMAGE_USAGE_SAMPLED_BIT, 4, 3), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); VkImageView queryTestView = createImageView(vkh::ImageViewCreateInfo( queryTest.image, VK_IMAGE_VIEW_TYPE_2D_ARRAY, VK_FORMAT_R8G8B8A8_UNORM)); AllocatedImage queryTestMS( - this, vkh::ImageCreateInfo(183, 347, 0, VK_FORMAT_R8G8B8A8_UNORM, - VK_IMAGE_USAGE_SAMPLED_BIT, 1, 5, VK_SAMPLE_COUNT_4_BIT), + this, + vkh::ImageCreateInfo(183, 347, 0, VK_FORMAT_R8G8B8A8_UNORM, VK_IMAGE_USAGE_SAMPLED_BIT, 1, + 5, VK_SAMPLE_COUNT_4_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); VkImageView queryTestMSView = createImageView(vkh::ImageViewCreateInfo( queryTestMS.image, VK_IMAGE_VIEW_TYPE_2D_ARRAY, VK_FORMAT_R8G8B8A8_UNORM)); AllocatedImage smiley( - this, vkh::ImageCreateInfo(rgba8.width, rgba8.height, 0, VK_FORMAT_R8G8B8A8_UNORM, - VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), + this, + vkh::ImageCreateInfo(rgba8.width, rgba8.height, 0, VK_FORMAT_R8G8B8A8_UNORM, + VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); VkImageView smileyview = createImageView( vkh::ImageViewCreateInfo(smiley.image, VK_IMAGE_VIEW_TYPE_2D, VK_FORMAT_R8G8B8A8_UNORM)); - AllocatedBuffer uploadBuf(this, vkh::BufferCreateInfo(rgba8.data.size() * sizeof(uint32_t), - VK_BUFFER_USAGE_TRANSFER_SRC_BIT), + AllocatedBuffer uploadBuf(this, + vkh::BufferCreateInfo(rgba8.data.size() * sizeof(uint32_t), + VK_BUFFER_USAGE_TRANSFER_SRC_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); AllocatedImage shadowimg(this, @@ -3892,9 +3897,10 @@ OpMemberDecorate %cbuffer_struct 17 Offset 216 ; double doublePackSource typeDataBuf.upload(typeData.data(), typeData.size()); AllocatedImage randomcube( - this, vkh::ImageCreateInfo(rgba8.width, rgba8.height, 0, VK_FORMAT_R8G8B8A8_UNORM, - VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT, 1, - 6, VK_SAMPLE_COUNT_1_BIT, VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT), + this, + vkh::ImageCreateInfo(rgba8.width, rgba8.height, 0, VK_FORMAT_R8G8B8A8_UNORM, + VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT, 1, 6, + VK_SAMPLE_COUNT_1_BIT, VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); VkImageView randomcubeview = createImageView(vkh::ImageViewCreateInfo( @@ -3971,8 +3977,9 @@ OpMemberDecorate %cbuffer_struct 17 Offset 216 ; double doublePackSource Vec4f cbufferdata[64] = {}; AllocatedBuffer cb( - this, vkh::BufferCreateInfo(sizeof(cbufferdata) * 2, VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(cbufferdata) * 2, VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); cbufferdata[1] = Vec4f(1.1f, 2.2f, 3.3f, 4.4f); @@ -4018,37 +4025,43 @@ OpMemberDecorate %cbuffer_struct 17 Offset 216 ; double doublePackSource cb.upload(cbufferdata); AllocatedBuffer texbuffer( - this, vkh::BufferCreateInfo(sizeof(cbufferdata), VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(cbufferdata), VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); texbuffer.upload(cbufferdata); AllocatedBuffer store_buffer( - this, vkh::BufferCreateInfo(1024 * sizeof(Vec4f), VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(1024 * sizeof(Vec4f), VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); - AllocatedBuffer atomic_buffer(this, vkh::BufferCreateInfo(texWidth * texHeight * sizeof(Vec4f), - VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), - VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); + AllocatedBuffer atomic_buffer( + this, + vkh::BufferCreateInfo(texWidth * texHeight * sizeof(Vec4f), + VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), + VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); AllocatedBuffer store_texbuffer( - this, vkh::BufferCreateInfo(1024 * sizeof(Vec4f), VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(1024 * sizeof(Vec4f), VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); AllocatedImage store_image( - this, vkh::ImageCreateInfo(128, 128, 0, VK_FORMAT_R32G32B32A32_SFLOAT, - VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_STORAGE_BIT), + this, + vkh::ImageCreateInfo(128, 128, 0, VK_FORMAT_R32G32B32A32_SFLOAT, + VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_STORAGE_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); VkImageView store_view = createImageView(vkh::ImageViewCreateInfo( store_image.image, VK_IMAGE_VIEW_TYPE_2D, VK_FORMAT_R32G32B32A32_SFLOAT)); AllocatedImage atomic_image( - this, vkh::ImageCreateInfo(texWidth, texHeight, 0, VK_FORMAT_R32_UINT, - VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_STORAGE_BIT), + this, + vkh::ImageCreateInfo(texWidth, texHeight, 0, VK_FORMAT_R32_UINT, + VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_STORAGE_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); VkImageView atomic_view = createImageView( vkh::ImageViewCreateInfo(atomic_image.image, VK_IMAGE_VIEW_TYPE_2D, VK_FORMAT_R32_UINT)); @@ -4072,8 +4085,9 @@ OpMemberDecorate %cbuffer_struct 17 Offset 216 ; double doublePackSource setName(atomic_image.image, "atomic_image"); AllocatedImage storezoo_u2D( - this, vkh::ImageCreateInfo(16, 16, 0, VK_FORMAT_R32G32B32A32_UINT, - VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_STORAGE_BIT), + this, + vkh::ImageCreateInfo(16, 16, 0, VK_FORMAT_R32G32B32A32_UINT, + VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_STORAGE_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); VkImageView storezoo_u2D_view = createImageView(vkh::ImageViewCreateInfo( storezoo_u2D.image, VK_IMAGE_VIEW_TYPE_2D, VK_FORMAT_R32G32B32A32_UINT)); @@ -4293,8 +4307,9 @@ OpMemberDecorate %cbuffer_struct 17 Offset 216 ; double doublePackSource {0, sizeof(Vec4f) * 16}); vkCmdPushConstants(cmd, layout, VK_SHADER_STAGE_FRAGMENT_BIT, 16, sizeof(Vec4i), &push); - vkCmdBeginRenderPass(cmd, vkh::RenderPassBeginInfo(renderPass, framebuffer, s, - {vkh::ClearValue(0.0f, 0.0f, 0.0f, 0.0f)}), + vkCmdBeginRenderPass(cmd, + vkh::RenderPassBeginInfo(renderPass, framebuffer, s, + {vkh::ClearValue(0.0f, 0.0f, 0.0f, 0.0f)}), VK_SUBPASS_CONTENTS_INLINE); pushMarker(cmd, "GLSL1 tests"); @@ -4314,8 +4329,9 @@ OpMemberDecorate %cbuffer_struct 17 Offset 216 ; double doublePackSource vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, asmpipe); - vkCmdBeginRenderPass(cmd, vkh::RenderPassBeginInfo(renderPass, framebuffer, s, - {vkh::ClearValue(0.0f, 0.0f, 0.0f, 0.0f)}), + vkCmdBeginRenderPass(cmd, + vkh::RenderPassBeginInfo(renderPass, framebuffer, s, + {vkh::ClearValue(0.0f, 0.0f, 0.0f, 0.0f)}), VK_SUBPASS_CONTENTS_INLINE); pushMarker(cmd, "ASM tests"); @@ -4364,8 +4380,9 @@ OpMemberDecorate %cbuffer_struct 17 Offset 216 ; double doublePackSource vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, glslpipe2); - vkCmdBeginRenderPass(cmd, vkh::RenderPassBeginInfo(renderPass, framebuffer, s, - {vkh::ClearValue(0.0f, 0.0f, 0.0f, 0.0f)}), + vkCmdBeginRenderPass(cmd, + vkh::RenderPassBeginInfo(renderPass, framebuffer, s, + {vkh::ClearValue(0.0f, 0.0f, 0.0f, 0.0f)}), VK_SUBPASS_CONTENTS_INLINE); pushMarker(cmd, "GLSL2 tests"); diff --git a/util/test/demos/vk/vk_shader_editing.cpp b/util/test/demos/vk/vk_shader_editing.cpp index 470ce87bf..9708e265f 100644 --- a/util/test/demos/vk/vk_shader_editing.cpp +++ b/util/test/demos/vk/vk_shader_editing.cpp @@ -123,7 +123,8 @@ void hlsl_main () pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -156,8 +157,9 @@ void hlsl_main () VkPipeline pipe2 = createGraphicsPipeline(pipeCreateInfo); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); @@ -169,20 +171,21 @@ void hlsl_main () })); VkPipelineLayout compLayout = createPipelineLayout(vkh::PipelineLayoutCreateInfo( - {compSetLayout}, - { - vkh::PushConstantRange(VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof(Vec4i)), - })); + {compSetLayout}, { + vkh::PushConstantRange(VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof(Vec4i)), + })); VkPipeline compPipe1 = createComputePipeline(vkh::ComputePipelineCreateInfo( compLayout, CompileShaderModule(comp, ShaderLang::hlsl, ShaderStage::comp, "hlsl_main"))); - AllocatedBuffer bufin(this, vkh::BufferCreateInfo(1024, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + AllocatedBuffer bufin(this, + vkh::BufferCreateInfo(1024, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); - AllocatedBuffer bufout(this, vkh::BufferCreateInfo(1024, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + AllocatedBuffer bufout(this, + vkh::BufferCreateInfo(1024, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); setName(bufin.buffer, "bufin"); @@ -207,8 +210,9 @@ void hlsl_main () VkImage swapimg = StartUsingBackbuffer(cmd, VK_ACCESS_TRANSFER_WRITE_BIT, VK_IMAGE_LAYOUT_GENERAL); - vkCmdBeginRenderPass(cmd, vkh::RenderPassBeginInfo(renderPass, framebuffer, mainWindow->scissor, - {vkh::ClearValue(0.2f, 0.2f, 0.2f, 1.0f)}), + vkCmdBeginRenderPass(cmd, + vkh::RenderPassBeginInfo(renderPass, framebuffer, mainWindow->scissor, + {vkh::ClearValue(0.2f, 0.2f, 0.2f, 1.0f)}), VK_SUBPASS_CONTENTS_INLINE); VkViewport v = mainWindow->viewport; diff --git a/util/test/demos/vk/vk_shader_isa.cpp b/util/test/demos/vk/vk_shader_isa.cpp index d0fbe56d2..e36e97565 100644 --- a/util/test/demos/vk/vk_shader_isa.cpp +++ b/util/test/demos/vk/vk_shader_isa.cpp @@ -45,7 +45,8 @@ RD_TEST(VK_Shader_ISA, VulkanGraphicsTest) pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -57,14 +58,16 @@ RD_TEST(VK_Shader_ISA, VulkanGraphicsTest) VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); - AllocatedImage offimg(this, vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, - VK_IMAGE_USAGE_TRANSFER_DST_BIT), + AllocatedImage offimg(this, + vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, + VK_IMAGE_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); while(Running()) diff --git a/util/test/demos/vk/vk_shader_printf.cpp b/util/test/demos/vk/vk_shader_printf.cpp index be92b7dee..5f058d8c7 100644 --- a/util/test/demos/vk/vk_shader_printf.cpp +++ b/util/test/demos/vk/vk_shader_printf.cpp @@ -126,7 +126,8 @@ void main() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -141,16 +142,18 @@ void main() layout, CompileShaderModule(common + comp, ShaderLang::glsl, ShaderStage::comp, "main"))); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); VkDeviceSize ssbo_size = 1024; - AllocatedBuffer ssbo(this, vkh::BufferCreateInfo(ssbo_size, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + AllocatedBuffer ssbo(this, + vkh::BufferCreateInfo(ssbo_size, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); setName(ssbo.buffer, "SSBO"); @@ -176,9 +179,9 @@ void main() vkh::ClearColorValue(0.2f, 0.2f, 0.2f, 1.0f), 1, vkh::ImageSubresourceRange()); - vkh::cmdPipelineBarrier( - cmd, {}, {vkh::BufferMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, - VK_ACCESS_TRANSFER_WRITE_BIT, ssbo.buffer)}); + vkh::cmdPipelineBarrier(cmd, {}, + {vkh::BufferMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, + VK_ACCESS_TRANSFER_WRITE_BIT, ssbo.buffer)}); vkCmdFillBuffer(cmd, ssbo.buffer, 0, ssbo_size, 0); diff --git a/util/test/demos/vk/vk_simple_triangle.cpp b/util/test/demos/vk/vk_simple_triangle.cpp index f7f5ed4d1..c046905e5 100644 --- a/util/test/demos/vk/vk_simple_triangle.cpp +++ b/util/test/demos/vk/vk_simple_triangle.cpp @@ -45,7 +45,8 @@ RD_TEST(VK_Simple_Triangle, VulkanGraphicsTest) pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -57,19 +58,22 @@ RD_TEST(VK_Simple_Triangle, VulkanGraphicsTest) VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); - AllocatedImage offimg(this, vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, - VK_IMAGE_USAGE_TRANSFER_DST_BIT), + AllocatedImage offimg(this, + vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, + VK_IMAGE_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); AllocatedImage offimgMS( - this, vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R16G16B16A16_SFLOAT, - VK_IMAGE_USAGE_TRANSFER_DST_BIT, 1, 1, VK_SAMPLE_COUNT_4_BIT), + this, + vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R16G16B16A16_SFLOAT, + VK_IMAGE_USAGE_TRANSFER_DST_BIT, 1, 1, VK_SAMPLE_COUNT_4_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); while(Running()) diff --git a/util/test/demos/vk/vk_spec_constants.cpp b/util/test/demos/vk/vk_spec_constants.cpp index 379382ec4..7416952c5 100644 --- a/util/test/demos/vk/vk_spec_constants.cpp +++ b/util/test/demos/vk/vk_spec_constants.cpp @@ -195,12 +195,15 @@ void main() } Vec4f cbufferdata[4] = { - Vec4f(1.0f, 0.0f, 0.0f, 0.0f), Vec4f(0.0, 1.0f, 0.0f, 0.0f), Vec4f(0.0, 0.0f, 1.0f, 0.0f), + Vec4f(1.0f, 0.0f, 0.0f, 0.0f), + Vec4f(0.0, 1.0f, 0.0f, 0.0f), + Vec4f(0.0, 0.0f, 1.0f, 0.0f), }; AllocatedBuffer cb( - this, vkh::BufferCreateInfo(sizeof(cbufferdata), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(cbufferdata), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); cb.upload(cbufferdata); @@ -214,8 +217,9 @@ void main() }); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); diff --git a/util/test/demos/vk/vk_spirv_13_shaders.cpp b/util/test/demos/vk/vk_spirv_13_shaders.cpp index 6856a39a8..f3f2f3623 100644 --- a/util/test/demos/vk/vk_spirv_13_shaders.cpp +++ b/util/test/demos/vk/vk_spirv_13_shaders.cpp @@ -75,7 +75,8 @@ void fragmain(in float4 incol : COL, out float4 ocol : SV_Target0) pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -94,8 +95,9 @@ void fragmain(in float4 incol : COL, out float4 ocol : SV_Target0) {Vec3f(0.5f, -0.5f, 0.0f), Vec4f(0.0f, 1.0f, 0.0f, 1.0f), Vec2f(1.0f, 0.0f)}, }; - AllocatedBuffer vb(this, vkh::BufferCreateInfo(sizeof(tri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + AllocatedBuffer vb(this, + vkh::BufferCreateInfo(sizeof(tri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(tri); diff --git a/util/test/demos/vk/vk_structured_buffer_nested.cpp b/util/test/demos/vk/vk_structured_buffer_nested.cpp index 31b07b824..37292ef89 100644 --- a/util/test/demos/vk/vk_structured_buffer_nested.cpp +++ b/util/test/demos/vk/vk_structured_buffer_nested.cpp @@ -211,7 +211,8 @@ float4 main() : SV_Target0 pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -228,8 +229,9 @@ float4 main() : SV_Target0 VkPipeline hlslpipe = createGraphicsPipeline(pipeCreateInfo); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); @@ -240,14 +242,16 @@ float4 main() : SV_Target0 data[i] = float(i); AllocatedBuffer ssbo( - this, vkh::BufferCreateInfo(sizeof(data), VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | - VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT), + this, + vkh::BufferCreateInfo(sizeof(data), VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | + VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); ssbo.upload(data); - AllocatedBuffer out_ssbo(this, vkh::BufferCreateInfo(1024, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + AllocatedBuffer out_ssbo(this, + vkh::BufferCreateInfo(1024, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); VkDescriptorSet descset = allocateDescriptorSet(setlayout); diff --git a/util/test/demos/vk/vk_sync2.cpp b/util/test/demos/vk/vk_sync2.cpp index bdbb8dead..8007523c0 100644 --- a/util/test/demos/vk/vk_sync2.cpp +++ b/util/test/demos/vk/vk_sync2.cpp @@ -66,7 +66,8 @@ RD_TEST(VK_Synchronization_2, VulkanGraphicsTest) pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -78,8 +79,9 @@ RD_TEST(VK_Synchronization_2, VulkanGraphicsTest) VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); @@ -119,8 +121,9 @@ RD_TEST(VK_Synchronization_2, VulkanGraphicsTest) setName(preinitImg, "Image:Preinitialised"); AllocatedImage undefImg( - this, vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R8G8B8A8_UNORM, - VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), + this, + vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R8G8B8A8_UNORM, + VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); setName(undefImg.image, "Image:Undefined"); diff --git a/util/test/demos/vk/vk_test.cpp b/util/test/demos/vk/vk_test.cpp index 1ed14b92c..a9c2b0596 100644 --- a/util/test/demos/vk/vk_test.cpp +++ b/util/test/demos/vk/vk_test.cpp @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #include "../test_common.h" @@ -649,9 +649,10 @@ bool VulkanGraphicsTest::Init() if(debugDevice) { CHECK_VKR(vkCreateDebugUtilsMessengerEXT( - instance, vkh::DebugUtilsMessengerCreateInfoEXT( - &vulkanCallback, NULL, VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT | - VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT), + instance, + vkh::DebugUtilsMessengerCreateInfoEXT(&vulkanCallback, NULL, + VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT | + VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT), NULL, &debugUtilsMessenger)); } @@ -762,7 +763,8 @@ bool VulkanGraphicsTest::Init() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -774,8 +776,9 @@ bool VulkanGraphicsTest::Init() DefaultTriPipe = createGraphicsPipeline(pipeCreateInfo); DefaultTriVB = AllocatedBuffer( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); DefaultTriVB.upload(DefaultTri); @@ -1246,8 +1249,9 @@ VulkanCommands::VulkanCommands(VulkanGraphicsTest *test) m_Test = test; CHECK_VKR(vkCreateCommandPool( - m_Test->device, vkh::CommandPoolCreateInfo(VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, - m_Test->queueFamilyIndex), + m_Test->device, + vkh::CommandPoolCreateInfo(VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, + m_Test->queueFamilyIndex), NULL, &cmdPool)); } @@ -1506,9 +1510,10 @@ bool VulkanWindow::CreateSwapchain() scissor = vkh::Rect2D({0, 0}, {width, height}); CHECK_VKR(vkCreateSwapchainKHR( - m_Test->device, vkh::SwapchainCreateInfoKHR( - surface, mode, surfaceFormat, {width, height}, - VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT), + m_Test->device, + vkh::SwapchainCreateInfoKHR( + surface, mode, surfaceFormat, {width, height}, + VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT), NULL, &swap)); CHECK_VKR(vkh::getSwapchainImagesKHR(imgs, m_Test->device, swap)); diff --git a/util/test/demos/vk/vk_test.h b/util/test/demos/vk/vk_test.h index e5fbc815b..d539e631a 100644 --- a/util/test/demos/vk/vk_test.h +++ b/util/test/demos/vk/vk_test.h @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #pragma once diff --git a/util/test/demos/vk/vk_texture_zoo.cpp b/util/test/demos/vk/vk_texture_zoo.cpp index b49b7f636..171e904c3 100644 --- a/util/test/demos/vk/vk_texture_zoo.cpp +++ b/util/test/demos/vk/vk_texture_zoo.cpp @@ -338,7 +338,8 @@ void main() pipeCreateInfo.renderPass = rp; pipeCreateInfo.stages = { - vs, CompileShaderModule(src, ShaderLang::glsl, ShaderStage::frag, "main"), + vs, + CompileShaderModule(src, ShaderLang::glsl, ShaderStage::frag, "main"), }; ret = PSOs[key] = createGraphicsPipeline(pipeCreateInfo); @@ -688,9 +689,12 @@ void main() (texFmt == viewFmt) ? std::string(&(#texFmt)[10]) \ : (std::string(&(#texFmt)[10]) + "->" + (strchr(&(#viewFmt)[10], '_') + 1)) -#define TEST_CASE(texType, texFmt, viewFmt, compCount, byteWidth, dataType) \ - { \ - TEST_CASE_NAME(texFmt, viewFmt), texFmt, viewFmt, {texType, compCount, byteWidth, dataType}, \ +#define TEST_CASE(texType, texFmt, viewFmt, compCount, byteWidth, dataType) \ + { \ + TEST_CASE_NAME(texFmt, viewFmt), \ + texFmt, \ + viewFmt, \ + {texType, compCount, byteWidth, dataType}, \ } std::vector test_textures; @@ -1084,7 +1088,8 @@ void main() pipeCreateInfo.layout = layout; pipeCreateInfo.stages = { - vs, vs, + vs, + vs, }; pipeCreateInfo.depthStencilState.depthCompareOp = VK_COMPARE_OP_ALWAYS; @@ -1134,8 +1139,9 @@ void main() vkh::cmdPipelineBarrier( cmd, { vkh::ImageMemoryBarrier( - 0, VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, + 0, + VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, t.res.image, vkh::ImageSubresourceRange(aspectMask)), }); @@ -1244,7 +1250,9 @@ void main() attRef->layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; pipeCreateInfo.dynamicState.dynamicStates = { - VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_SCISSOR, VK_DYNAMIC_STATE_STENCIL_REFERENCE, + VK_DYNAMIC_STATE_VIEWPORT, + VK_DYNAMIC_STATE_SCISSOR, + VK_DYNAMIC_STATE_STENCIL_REFERENCE, }; } else @@ -1261,7 +1269,8 @@ void main() attRef->layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; pipeCreateInfo.dynamicState.dynamicStates = { - VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_SCISSOR, + VK_DYNAMIC_STATE_VIEWPORT, + VK_DYNAMIC_STATE_SCISSOR, }; } @@ -1312,8 +1321,9 @@ void main() viewType = VK_IMAGE_VIEW_TYPE_2D_ARRAY; vkCreateImageView( - device, vkh::ImageViewCreateInfo(t.res.image, viewType, t.fmt.viewFmt, {}, - vkh::ImageSubresourceRange(aspectMask, mp, 1, sl, 1)), + device, + vkh::ImageViewCreateInfo(t.res.image, viewType, t.fmt.viewFmt, {}, + vkh::ImageSubresourceRange(aspectMask, mp, 1, sl, 1)), NULL, &tempView); vkCreateFramebuffer( device, vkh::FramebufferCreateInfo(tempRP, {tempView}, scissor.extent), NULL, &tempFB); @@ -1449,8 +1459,9 @@ void main() slice_test_3d.dim = 3; slice_test_3d.res = AllocatedImage( - this, vkh::ImageCreateInfo(64, 64, 64, VK_FORMAT_R32G32B32A32_SFLOAT, - VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT, 2), + this, + vkh::ImageCreateInfo(64, 64, 64, VK_FORMAT_R32G32B32A32_SFLOAT, + VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT, 2), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); slice_test_3d.view = createImageView(vkh::ImageViewCreateInfo( slice_test_3d.res.image, VK_IMAGE_VIEW_TYPE_3D, VK_FORMAT_R32G32B32A32_SFLOAT)); @@ -1567,8 +1578,9 @@ void main() VkImage swapimg = StartUsingBackbuffer(cmd, VK_ACCESS_TRANSFER_WRITE_BIT, VK_IMAGE_LAYOUT_GENERAL); - vkCmdBeginRenderPass(cmd, vkh::RenderPassBeginInfo(rp, framebuffer, mainWindow->scissor, - {vkh::ClearValue(0.2f, 0.2f, 0.2f, 1.0f)}), + vkCmdBeginRenderPass(cmd, + vkh::RenderPassBeginInfo(rp, framebuffer, mainWindow->scissor, + {vkh::ClearValue(0.2f, 0.2f, 0.2f, 1.0f)}), VK_SUBPASS_CONTENTS_INLINE); VkViewport view = {0.0f, 0.0f, 10.0f, 10.0f, 0.0f, 1.0f}; diff --git a/util/test/demos/vk/vk_triangle_fan.cpp b/util/test/demos/vk/vk_triangle_fan.cpp index b30f54a41..779963105 100644 --- a/util/test/demos/vk/vk_triangle_fan.cpp +++ b/util/test/demos/vk/vk_triangle_fan.cpp @@ -47,7 +47,8 @@ RD_TEST(VK_Triangle_Fan, VulkanGraphicsTest) pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; diff --git a/util/test/demos/vk/vk_validation_use.cpp b/util/test/demos/vk/vk_validation_use.cpp index 62a513d2a..7a5bff7e5 100644 --- a/util/test/demos/vk/vk_validation_use.cpp +++ b/util/test/demos/vk/vk_validation_use.cpp @@ -58,7 +58,8 @@ RD_TEST(VK_Validation_Use, VulkanGraphicsTest) pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -70,14 +71,16 @@ RD_TEST(VK_Validation_Use, VulkanGraphicsTest) VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); - AllocatedImage offimg(this, vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, - VK_IMAGE_USAGE_TRANSFER_DST_BIT), + AllocatedImage offimg(this, + vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, + VK_IMAGE_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); while(Running()) diff --git a/util/test/demos/vk/vk_video_textures.cpp b/util/test/demos/vk/vk_video_textures.cpp index 6fec45735..9f6f59b9a 100644 --- a/util/test/demos/vk/vk_video_textures.cpp +++ b/util/test/demos/vk/vk_video_textures.cpp @@ -253,7 +253,8 @@ void main() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -311,9 +312,10 @@ void main() TextureData textures[20] = {}; uint32_t texidx = 0; - AllocatedBuffer uploadBuf(this, vkh::BufferCreateInfo(rgba8.width * rgba8.height * 16, - VK_BUFFER_USAGE_TRANSFER_SRC_BIT), - VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); + AllocatedBuffer uploadBuf( + this, + vkh::BufferCreateInfo(rgba8.width * rgba8.height * 16, VK_BUFFER_USAGE_TRANSFER_SRC_BIT), + VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); auto make_tex = [&](const char *name, uint32_t subsampling, VkFormat texFmt, VkFormat viewFmt, VkFormat view2Fmt, VkFormat view3Fmt, Vec4i config, void *data, size_t sz, @@ -391,7 +393,8 @@ void main() VK_SAMPLE_COUNT_1_BIT, VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); Vec4i cbdata[2] = { - Vec4i(rgba8.width, rgba8.height, horizDownsampleFactor, vertDownsampleFactor), config, + Vec4i(rgba8.width, rgba8.height, horizDownsampleFactor, vertDownsampleFactor), + config, }; t.cb = AllocatedBuffer( @@ -575,7 +578,8 @@ void main() const byte *in = yuv8.data(); byte *out[3] = { - triplane8.data(), triplane8.data() + rgba8.width * rgba8.height, + triplane8.data(), + triplane8.data() + rgba8.width * rgba8.height, triplane8.data() + rgba8.width * rgba8.height * 2, }; diff --git a/util/test/demos/vk/vk_vs_max_desc_set.cpp b/util/test/demos/vk/vk_vs_max_desc_set.cpp index eff091e2e..36aa303da 100644 --- a/util/test/demos/vk/vk_vs_max_desc_set.cpp +++ b/util/test/demos/vk/vk_vs_max_desc_set.cpp @@ -109,7 +109,8 @@ void main() pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, DefaultA2V)}; pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = { - vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col), + vkh::vertexAttr(0, 0, DefaultA2V, pos), + vkh::vertexAttr(1, 0, DefaultA2V, col), vkh::vertexAttr(2, 0, DefaultA2V, uv), }; @@ -152,8 +153,9 @@ void main() VkPipeline pipe = createGraphicsPipeline(pipeCreateInfo); AllocatedBuffer vb( - this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(DefaultTri), + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); vb.upload(DefaultTri); @@ -161,15 +163,17 @@ void main() Vec4f cbufferdata = Vec4f(0.0f, 0.2f, 0.75f, 0.8f); AllocatedBuffer cb( - this, vkh::BufferCreateInfo(sizeof(cbufferdata), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | - VK_BUFFER_USAGE_TRANSFER_DST_BIT), + this, + vkh::BufferCreateInfo(sizeof(cbufferdata), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU})); cb.upload(&cbufferdata, sizeof(cbufferdata)); AllocatedImage img( - this, vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, - VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), + this, + vkh::ImageCreateInfo(4, 4, 0, VK_FORMAT_R32G32B32A32_SFLOAT, + VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_GPU_ONLY})); VkImageView imgview = createImageView( @@ -233,8 +237,9 @@ void main() vkh::ImageSubresourceRange()); vkCmdBeginRenderPass( - cmd, vkh::RenderPassBeginInfo(mainWindow->rp, mainWindow->GetFB(), mainWindow->scissor, - {vkh::ClearValue(0.0f, 0.0f, 0.0f, 1.0f)}), + cmd, + vkh::RenderPassBeginInfo(mainWindow->rp, mainWindow->GetFB(), mainWindow->scissor, + {vkh::ClearValue(0.0f, 0.0f, 0.0f, 1.0f)}), VK_SUBPASS_CONTENTS_INLINE); std::vector descsets(limits.maxBoundDescriptorSets, imgdescset); diff --git a/util/test/demos/win32/win32_platform.cpp b/util/test/demos/win32/win32_platform.cpp index 28d1e5249..f7996aa92 100644 --- a/util/test/demos/win32/win32_platform.cpp +++ b/util/test/demos/win32/win32_platform.cpp @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #include "../test_common.h" diff --git a/util/test/demos/win32/win32_platform.h b/util/test/demos/win32/win32_platform.h index 4bf4a4826..1a40bc825 100644 --- a/util/test/demos/win32/win32_platform.h +++ b/util/test/demos/win32/win32_platform.h @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #pragma once diff --git a/util/test/demos/win32/win32_window.cpp b/util/test/demos/win32/win32_window.cpp index 3342d02d7..2425f8b8c 100644 --- a/util/test/demos/win32/win32_window.cpp +++ b/util/test/demos/win32/win32_window.cpp @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #include "win32_window.h" #include diff --git a/util/test/demos/win32/win32_window.h b/util/test/demos/win32/win32_window.h index 431f02808..45e17ad62 100644 --- a/util/test/demos/win32/win32_window.h +++ b/util/test/demos/win32/win32_window.h @@ -1,26 +1,26 @@ /****************************************************************************** -* The MIT License (MIT) -* -* Copyright (c) 2019-2023 Baldur Karlsson -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -******************************************************************************/ + * The MIT License (MIT) + * + * Copyright (c) 2019-2023 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ #pragma once