├── .clang-format ├── .clang-tidy ├── .gitattributes ├── .gitignore ├── .readthedocs.yaml ├── BUILD.md ├── Buildinfo.properties.in ├── CMakeLists.txt ├── LICENSE.txt ├── NOTICES.txt ├── README.md ├── RELEASE_NOTES.txt ├── build ├── dependency_map.py ├── fetch_dependencies.py ├── pre_build.py └── qt.conf ├── cmake ├── dev_tools.cmake └── devtools_qt_helper.cmake ├── documentation ├── requirements.txt └── source │ ├── _static │ ├── style.css │ └── theme_overrides.css │ ├── _templates │ └── layout.html │ ├── blas_windows.rst │ ├── conf.py │ ├── index.rst │ ├── media │ ├── blas │ │ ├── blas_instances_1.png │ │ ├── blas_properties_1.png │ │ ├── blas_viewer_1.png │ │ ├── geometries_1.png │ │ ├── split_triangles_1.png │ │ ├── split_triangles_2.png │ │ ├── split_triangles_stats_1.png │ │ └── triangles_1.png │ ├── overview │ │ ├── driver_experiments_1.png │ │ ├── summary_1.png │ │ ├── system_info_1.png │ │ └── user_markers.png │ ├── ray │ │ ├── ray_history_1.png │ │ ├── ray_history_2.png │ │ ├── ray_inspector_1.jpg │ │ ├── ray_inspector_2.png │ │ ├── ray_inspector_3.jpg │ │ ├── ray_inspector_4.png │ │ └── ray_user_markers.png │ ├── recent_traces_1.png │ ├── reset.png │ ├── settings │ │ ├── dark_theme_1.png │ │ ├── dark_theme_prompt.png │ │ ├── general_1.png │ │ ├── keyboard_shortcuts_1.png │ │ └── themes_and_colors_1.png │ ├── tlas │ │ ├── blas_list_1.png │ │ ├── context_menu_1.png │ │ ├── depth_slider.png │ │ ├── instance_mask_filter.png │ │ ├── loop_count.jpg │ │ ├── popout_view_1.png │ │ ├── popout_view_2.png │ │ ├── popout_view_3.png │ │ ├── rebraiding_stats_1.png │ │ ├── tlas_instances_1.png │ │ ├── tlas_properties_1.png │ │ └── tlas_viewer_1.jpg │ ├── welcome_1.png │ ├── zoom_in.png │ ├── zoom_out.png │ ├── zoom_reset.png │ └── zoom_to_selection.png │ ├── overview.rst │ ├── quickstart.rst │ ├── ray_windows.rst │ ├── settings.rst │ └── tlas_windows.rst ├── samples ├── brick_wall.rra ├── character.rra ├── face_culling.rra ├── landscape.rra ├── scaffolding.rra ├── springs.rra ├── trees.rra └── update_blas.rra └── source ├── assets ├── acceleration_structure_overview-dark-theme.svg ├── acceleration_structure_overview.svg ├── amd_logo.svg ├── amd_logo_white.svg ├── arrow_gray_left.svg ├── arrow_gray_right.svg ├── browse_back_disabled.svg ├── browse_back_normal.svg ├── browse_back_pressed.svg ├── browse_fwd_disabled.svg ├── browse_fwd_normal.svg ├── browse_fwd_pressed.svg ├── checkbox_off.svg ├── checkbox_off_gray.svg ├── checkbox_on.svg ├── checkbox_on_gray.svg ├── icon_32x32.png ├── icon_48x48.png ├── kbd_mouse.svg ├── kbd_mouse_clickable-dark-theme.svg ├── kbd_mouse_clickable.svg ├── kbd_mouse_hover.svg ├── pulldown_off_gray.svg ├── pulldown_on_gray.svg ├── stop_128x128.png ├── third_party │ └── ionicons │ │ ├── LICENSE │ │ ├── information-circle-outline-clickable-dark-theme.svg │ │ ├── information-circle-outline-clickable.svg │ │ ├── information-circle-outline-hover.svg │ │ ├── information-circle-outline.svg │ │ ├── lock-closed-outline-clickable-dark-theme.svg │ │ ├── lock-closed-outline-clickable.svg │ │ ├── lock-closed-outline-hover.svg │ │ ├── lock-closed-outline.svg │ │ ├── lock-open-outline-clickable-dark-theme.svg │ │ ├── lock-open-outline-clickable.svg │ │ ├── lock-open-outline-hover.svg │ │ ├── lock-open-outline.svg │ │ ├── refresh-outline-clickable-dark-theme.svg │ │ ├── refresh-outline-clickable.svg │ │ ├── refresh-outline-hover.svg │ │ ├── refresh-outline.svg │ │ ├── scan-outline-clickable-dark-theme.svg │ │ ├── scan-outline-clickable.svg │ │ ├── scan-outline-hover.svg │ │ ├── scan-outline.svg │ │ ├── search_icon.png │ │ ├── wand-clickable-dark-theme.svg │ │ ├── wand-clickable.svg │ │ ├── wand-hover.svg │ │ └── wand.svg ├── zoom_in.svg ├── zoom_in_disabled.svg ├── zoom_out.svg ├── zoom_out_disabled.svg ├── zoom_reset.svg ├── zoom_reset_disabled.svg ├── zoom_to_selection.svg └── zoom_to_selection_disabled.svg ├── backend ├── CMakeLists.txt ├── api_info.cpp ├── api_info.h ├── asic_info.cpp ├── asic_info.h ├── bvh │ ├── bvh_bundle.cpp │ ├── bvh_bundle.h │ ├── bvh_index_reference_map.cpp │ ├── bvh_index_reference_map.h │ ├── dxr_definitions.h │ ├── dxr_type_conversion.cpp │ ├── dxr_type_conversion.h │ ├── flags_util.h │ ├── geometry_info.cpp │ ├── geometry_info.h │ ├── gpu_def.h │ ├── ibvh.cpp │ ├── ibvh.h │ ├── metadata_v1.cpp │ ├── metadata_v1.h │ ├── node_pointer.cpp │ ├── node_pointer.h │ ├── node_types │ │ ├── box_node.cpp │ │ ├── box_node.h │ │ ├── float16_box_node.cpp │ │ ├── float16_box_node.h │ │ ├── float32_box_node.cpp │ │ ├── float32_box_node.h │ │ ├── instance_node.cpp │ │ ├── instance_node.h │ │ ├── procedural_node.cpp │ │ ├── procedural_node.h │ │ ├── triangle_node.cpp │ │ └── triangle_node.h │ ├── parent_block.cpp │ ├── parent_block.h │ ├── rt_binary_file_defs.cpp │ ├── rt_binary_file_defs.h │ ├── rtip11 │ │ ├── encoded_rt_ip_11_bottom_level_bvh.cpp │ │ ├── encoded_rt_ip_11_bottom_level_bvh.h │ │ ├── encoded_rt_ip_11_top_level_bvh.cpp │ │ ├── encoded_rt_ip_11_top_level_bvh.h │ │ ├── rt_ip_11_acceleration_structure_header.cpp │ │ ├── rt_ip_11_acceleration_structure_header.h │ │ └── rt_ip_11_header.h │ ├── rtip31 │ │ ├── child_info.h │ │ ├── common.h │ │ ├── encoded_rt_ip_31_bottom_level_bvh.cpp │ │ ├── encoded_rt_ip_31_bottom_level_bvh.h │ │ ├── encoded_rt_ip_31_top_level_bvh.cpp │ │ ├── encoded_rt_ip_31_top_level_bvh.h │ │ ├── internal_node.h │ │ ├── math.h │ │ ├── primitive_node.h │ │ ├── ray_tracing_defs.h │ │ ├── rt_ip_31_acceleration_structure_header.cpp │ │ └── rt_ip_31_acceleration_structure_header.h │ ├── rtip_common │ │ ├── acceleration_structure_header.cpp │ │ ├── acceleration_structure_header.h │ │ ├── encoded_bottom_level_bvh.cpp │ │ ├── encoded_bottom_level_bvh.h │ │ ├── encoded_top_level_bvh.cpp │ │ ├── encoded_top_level_bvh.h │ │ ├── gpurt_accel_struct.h │ │ ├── i_acceleration_structure_header.cpp │ │ ├── i_acceleration_structure_header.h │ │ ├── i_acceleration_structure_post_build_info.cpp │ │ └── i_acceleration_structure_post_build_info.h │ ├── utils.cpp │ └── utils.h ├── linux │ └── safe_crt.cpp ├── math_util.cpp ├── math_util.h ├── public │ ├── linux │ │ └── safe_crt.h │ ├── rra_api_info.h │ ├── rra_asic_info.h │ ├── rra_assert.h │ ├── rra_async_ray_history_loader.h │ ├── rra_blas.h │ ├── rra_bvh.h │ ├── rra_error.h │ ├── rra_macro.h │ ├── rra_print.h │ ├── rra_ray_history.h │ ├── rra_rtip_info.h │ ├── rra_system_info.h │ ├── rra_tlas.h │ └── rra_trace_loader.h ├── ray_history │ ├── counter.h │ ├── loader.cpp │ ├── loader.h │ ├── ray_history.cpp │ ├── ray_history.h │ └── raytracing_counter.h ├── rra_api_info.cpp ├── rra_asic_info.cpp ├── rra_assert.cpp ├── rra_async_ray_history_loader.cpp ├── rra_blas.cpp ├── rra_blas_impl.h ├── rra_bvh.cpp ├── rra_bvh_impl.h ├── rra_configuration.h ├── rra_data_set.cpp ├── rra_data_set.h ├── rra_print.cpp ├── rra_ray_history.cpp ├── rra_rtip_info.cpp ├── rra_system_info.cpp ├── rra_tlas.cpp ├── rra_tlas_impl.h ├── rra_trace_loader.cpp ├── string_table.cpp ├── string_table.h ├── surface_area_heuristic.cpp ├── surface_area_heuristic.h ├── user_marker_history.cpp └── user_marker_history.h ├── frontend ├── CMakeLists.txt ├── constants.h ├── dark_mode_stylesheet.qss ├── io │ ├── axis_free_camera_controller.cpp │ ├── axis_free_camera_controller.h │ ├── cad_camera_controller.cpp │ ├── cad_camera_controller.h │ ├── camera_controllers.cpp │ ├── camera_controllers.h │ ├── fps_camera_controller.cpp │ ├── fps_camera_controller.h │ ├── viewer_io.cpp │ └── viewer_io.h ├── light_mode_stylesheet.qss ├── mac_osx │ ├── MacOSXBundleInfo.plist.in │ └── rra.icns ├── main.cpp ├── managers │ ├── load_animation_manager.cpp │ ├── load_animation_manager.h │ ├── message_manager.cpp │ ├── message_manager.h │ ├── navigation_manager.cpp │ ├── navigation_manager.h │ ├── pane_manager.cpp │ ├── pane_manager.h │ ├── trace_manager.cpp │ └── trace_manager.h ├── models │ ├── acceleration_structure_flags_table_item_delegate.cpp │ ├── acceleration_structure_flags_table_item_delegate.h │ ├── acceleration_structure_flags_table_item_model.cpp │ ├── acceleration_structure_flags_table_item_model.h │ ├── acceleration_structure_tree_view_item.cpp │ ├── acceleration_structure_tree_view_item.h │ ├── acceleration_structure_tree_view_item_delegate.cpp │ ├── acceleration_structure_tree_view_item_delegate.h │ ├── acceleration_structure_tree_view_model.cpp │ ├── acceleration_structure_tree_view_model.h │ ├── acceleration_structure_viewer_model.cpp │ ├── acceleration_structure_viewer_model.h │ ├── blas │ │ ├── blas_geometries_item_model.cpp │ │ ├── blas_geometries_item_model.h │ │ ├── blas_geometries_model.cpp │ │ ├── blas_geometries_model.h │ │ ├── blas_geometries_proxy_model.cpp │ │ ├── blas_geometries_proxy_model.h │ │ ├── blas_geometries_table_item_delegate.cpp │ │ ├── blas_geometries_table_item_delegate.h │ │ ├── blas_instances_model.cpp │ │ ├── blas_instances_model.h │ │ ├── blas_properties_model.cpp │ │ ├── blas_properties_model.h │ │ ├── blas_scene_collection_model.cpp │ │ ├── blas_scene_collection_model.h │ │ ├── blas_triangles_item_model.cpp │ │ ├── blas_triangles_item_model.h │ │ ├── blas_triangles_model.cpp │ │ ├── blas_triangles_model.h │ │ ├── blas_triangles_proxy_model.cpp │ │ ├── blas_triangles_proxy_model.h │ │ ├── blas_triangles_table_item_delegate.cpp │ │ ├── blas_triangles_table_item_delegate.h │ │ ├── blas_viewer_model.cpp │ │ └── blas_viewer_model.h │ ├── instance_list_table_item_delegate.cpp │ ├── instance_list_table_item_delegate.h │ ├── instances_item_model.cpp │ ├── instances_item_model.h │ ├── instances_proxy_model.cpp │ ├── instances_proxy_model.h │ ├── overview │ │ ├── device_configuration_model.cpp │ │ ├── device_configuration_model.h │ │ ├── summary_model.cpp │ │ └── summary_model.h │ ├── ray │ │ ├── ray_counters_item_model.cpp │ │ ├── ray_counters_item_model.h │ │ ├── ray_history_image_generator.cpp │ │ ├── ray_history_image_generator.h │ │ ├── ray_history_model.cpp │ │ ├── ray_history_model.h │ │ ├── ray_inspector_model.cpp │ │ ├── ray_inspector_model.h │ │ ├── ray_inspector_ray_table_proxy_model.h │ │ ├── ray_inspector_ray_tree_item.cpp │ │ ├── ray_inspector_ray_tree_item.h │ │ ├── ray_inspector_ray_tree_item_delegate.cpp │ │ ├── ray_inspector_ray_tree_item_delegate.h │ │ ├── ray_inspector_ray_tree_model.cpp │ │ ├── ray_inspector_ray_tree_model.h │ │ ├── ray_inspector_ray_tree_proxy_model.cpp │ │ ├── ray_inspector_ray_tree_proxy_model.h │ │ ├── ray_inspector_scene_collection_model.cpp │ │ ├── ray_inspector_scene_collection_model.h │ │ ├── ray_list_item_model.cpp │ │ ├── ray_list_item_model.h │ │ ├── ray_list_proxy_model.cpp │ │ ├── ray_list_proxy_model.h │ │ ├── ray_list_table_item_delegate.cpp │ │ └── ray_list_table_item_delegate.h │ ├── scene.cpp │ ├── scene.h │ ├── scene_collection_model.cpp │ ├── scene_collection_model.h │ ├── scene_node.cpp │ ├── scene_node.h │ ├── side_panels │ │ ├── side_panel_model.h │ │ ├── view_model.cpp │ │ └── view_model.h │ ├── table_item_delegate.cpp │ ├── table_item_delegate.h │ ├── table_proxy_model.cpp │ ├── table_proxy_model.h │ ├── tlas │ │ ├── blas_list_item_model.cpp │ │ ├── blas_list_item_model.h │ │ ├── blas_list_model.cpp │ │ ├── blas_list_model.h │ │ ├── blas_list_proxy_model.cpp │ │ ├── blas_list_proxy_model.h │ │ ├── blas_list_table_item_delegate.cpp │ │ ├── blas_list_table_item_delegate.h │ │ ├── tlas_instances_model.cpp │ │ ├── tlas_instances_model.h │ │ ├── tlas_properties_model.cpp │ │ ├── tlas_properties_model.h │ │ ├── tlas_scene_collection_model.cpp │ │ ├── tlas_scene_collection_model.h │ │ ├── tlas_viewer_model.cpp │ │ └── tlas_viewer_model.h │ ├── tree_view_proxy_model.cpp │ ├── tree_view_proxy_model.h │ ├── viewer_container_model.cpp │ └── viewer_container_model.h ├── resources.qrc ├── settings │ ├── geometry_settings.cpp │ ├── geometry_settings.h │ ├── settings.cpp │ ├── settings.h │ ├── settings_reader.cpp │ ├── settings_reader.h │ ├── settings_writer.cpp │ └── settings_writer.h ├── stylesheet.qss ├── util │ ├── file_util.cpp │ ├── file_util.h │ ├── log_file_writer.cpp │ ├── log_file_writer.h │ ├── rra_util.cpp │ ├── rra_util.h │ ├── stack_vector.h │ ├── string_util.cpp │ └── string_util.h ├── version.cpp ├── version.h.in ├── views │ ├── acceleration_structure_tree_view.cpp │ ├── acceleration_structure_tree_view.h │ ├── acceleration_structure_viewer_pane.cpp │ ├── acceleration_structure_viewer_pane.h │ ├── base_pane.cpp │ ├── base_pane.h │ ├── blas │ │ ├── blas_geometries_pane.cpp │ │ ├── blas_geometries_pane.h │ │ ├── blas_geometries_pane.ui │ │ ├── blas_instances_pane.cpp │ │ ├── blas_instances_pane.h │ │ ├── blas_instances_pane.ui │ │ ├── blas_properties_pane.cpp │ │ ├── blas_properties_pane.h │ │ ├── blas_properties_pane.ui │ │ ├── blas_triangles_pane.cpp │ │ ├── blas_triangles_pane.h │ │ ├── blas_triangles_pane.ui │ │ ├── blas_viewer_pane.cpp │ │ ├── blas_viewer_pane.h │ │ ├── blas_viewer_pane.ui │ │ └── triangle_group.ui │ ├── custom_widgets │ │ ├── binary_checkbox.cpp │ │ ├── binary_checkbox.h │ │ ├── color_picker_button.cpp │ │ ├── color_picker_button.h │ │ ├── color_picker_widget.cpp │ │ ├── color_picker_widget.h │ │ ├── colored_checkbox.cpp │ │ ├── colored_checkbox.h │ │ ├── colored_radio_button.cpp │ │ ├── colored_radio_button.h │ │ ├── depth_slider_widget.cpp │ │ ├── depth_slider_widget.h │ │ ├── dispatch_legend.cpp │ │ ├── dispatch_legend.h │ │ ├── dispatch_loading_bar.cpp │ │ ├── dispatch_loading_bar.h │ │ ├── double_slider_heatmap_widget.cpp │ │ ├── double_slider_heatmap_widget.h │ │ ├── icon_button.cpp │ │ ├── icon_button.h │ │ ├── ray_history_graphics_view.cpp │ │ ├── ray_history_graphics_view.h │ │ ├── read_only_checkbox.cpp │ │ ├── read_only_checkbox.h │ │ ├── rgp_histogram_widget.cpp │ │ ├── rgp_histogram_widget.h │ │ ├── slider_style.h │ │ ├── themes_and_colors_item_button.cpp │ │ ├── themes_and_colors_item_button.h │ │ ├── vertical_button_widget.cpp │ │ └── vertical_button_widget.h │ ├── debug_window.cpp │ ├── debug_window.h │ ├── debug_window.ui │ ├── license_dialog.cpp │ ├── license_dialog.h │ ├── license_dialog.ui │ ├── main_window.cpp │ ├── main_window.h │ ├── main_window.ui │ ├── overview │ │ ├── device_configuration_pane.cpp │ │ ├── device_configuration_pane.h │ │ ├── device_configuration_pane.ui │ │ ├── dispatch_pane.cpp │ │ ├── dispatch_pane.h │ │ ├── dispatch_pane.ui │ │ ├── summary_pane.cpp │ │ ├── summary_pane.h │ │ ├── summary_pane.ui │ │ ├── tlas_pane.cpp │ │ ├── tlas_pane.h │ │ └── tlas_pane.ui │ ├── ray │ │ ├── ray_history_pane.cpp │ │ ├── ray_history_pane.h │ │ ├── ray_history_pane.ui │ │ ├── ray_history_viewer_widget.ui │ │ ├── ray_inspector_pane.cpp │ │ ├── ray_inspector_pane.h │ │ ├── ray_inspector_pane.ui │ │ ├── ray_inspector_tree_view.cpp │ │ └── ray_inspector_tree_view.h │ ├── settings │ │ ├── keyboard_shortcuts_pane.cpp │ │ ├── keyboard_shortcuts_pane.h │ │ ├── keyboard_shortcuts_pane.ui │ │ ├── settings_pane.cpp │ │ ├── settings_pane.h │ │ ├── settings_pane.ui │ │ ├── themes_and_colors_pane.cpp │ │ ├── themes_and_colors_pane.h │ │ └── themes_and_colors_pane.ui │ ├── side_panels │ │ ├── side_pane_container.cpp │ │ ├── side_pane_container.h │ │ ├── side_pane_container.ui │ │ ├── view_pane.cpp │ │ ├── view_pane.h │ │ └── view_pane.ui │ ├── start │ │ ├── about_pane.cpp │ │ ├── about_pane.h │ │ ├── about_pane.ui │ │ ├── recent_traces_pane.cpp │ │ ├── recent_traces_pane.h │ │ ├── recent_traces_pane.ui │ │ ├── welcome_pane.cpp │ │ ├── welcome_pane.h │ │ └── welcome_pane.ui │ ├── tlas │ │ ├── blas_list_pane.cpp │ │ ├── blas_list_pane.h │ │ ├── blas_list_pane.ui │ │ ├── tlas_instances_pane.cpp │ │ ├── tlas_instances_pane.h │ │ ├── tlas_instances_pane.ui │ │ ├── tlas_properties_pane.cpp │ │ ├── tlas_properties_pane.h │ │ ├── tlas_properties_pane.ui │ │ ├── tlas_viewer_pane.cpp │ │ ├── tlas_viewer_pane.h │ │ └── tlas_viewer_pane.ui │ ├── viewer_container_widget.cpp │ ├── viewer_container_widget.h │ ├── viewer_container_widget.ui │ ├── widget_util.cpp │ └── widget_util.h └── windows │ ├── resource.h │ ├── rra.rc │ └── rra_icon.ico └── renderer ├── CMakeLists.txt ├── camera.cpp ├── graphics_context.cpp ├── heatmap.cpp ├── intersect.cpp ├── orientation_gizmo.cpp ├── public ├── camera.h ├── graphics_context.h ├── heatmap.h ├── include_vma.h ├── intersect.h ├── orientation_gizmo.h ├── render_state_adapter.h ├── renderer_adapter.h ├── renderer_interface.h ├── renderer_types.h ├── renderer_widget.h ├── shared.h └── view_state_adapter.h ├── renderer_interface.cpp ├── renderer_widget.cpp ├── shaders ├── BoundingVolumeHierarchyWire.hlsl ├── Clear.hlsl ├── Common.hlsl ├── GeometryColorAllowCompactionFlag.hlsl ├── GeometryColorAllowUpdateFlag.hlsl ├── GeometryColorBlasAverageDepth.hlsl ├── GeometryColorBlasAverageSAH.hlsl ├── GeometryColorBlasInstanceCount.hlsl ├── GeometryColorBlasInstanceId.hlsl ├── GeometryColorBlasMaxDepth.hlsl ├── GeometryColorBlasMinSAH.hlsl ├── GeometryColorBlasTriangleCount.hlsl ├── GeometryColorFinalOpacity.hlsl ├── GeometryColorGeometryIndex.hlsl ├── GeometryColorInstanceIndex.hlsl ├── GeometryColorInstanceMask.hlsl ├── GeometryColorLit.hlsl ├── GeometryColorLowMemoryFlag.hlsl ├── GeometryColorOpacity.hlsl ├── GeometryColorPreferFastBuildOrTrace.hlsl ├── GeometryColorRebraiding.hlsl ├── GeometryColorTechnical.hlsl ├── GeometryColorTreeLevel.hlsl ├── GeometryColorTriangleIndex.hlsl ├── GeometryColorTriangleSAH.hlsl ├── GeometryColorTriangleSplitting.hlsl ├── GeometryColorWireframe.hlsl ├── GeometryInstanceFacingCullDisable.hlsl ├── GeometryInstanceFlipFacing.hlsl ├── GeometryInstanceForceOpaqueOrNoOpaque.hlsl ├── Heatmap.hlsl ├── OrientationGizmo.hlsl ├── RayHistoryOffscreenRenderer.hlsl ├── RayInspectorOverlay.hlsl ├── RayInspectorOverlayIcons.hlsl ├── SelectionVolume.hlsl ├── TraversalShader.hlsl ├── rtip31 │ ├── GeometryColorPrimitiveStructure.hlsl │ └── TraversalShaderOBB.hlsl ├── shared_definitions.hlsl └── shared_impl.hlsl ├── shared.cpp └── vk ├── adapters ├── render_state_adapter.cpp └── view_state_adapter.cpp ├── bounding_volume_mesh.cpp ├── bounding_volume_mesh.h ├── buffer_guard.cpp ├── buffer_guard.h ├── framework ├── command_buffer_ring.cpp ├── command_buffer_ring.h ├── device.cpp ├── device.h ├── device_properties.cpp ├── device_properties.h ├── ext_debug_utils.cpp ├── ext_debug_utils.h ├── ext_gpu_validation.cpp ├── ext_gpu_validation.h ├── ext_validation.cpp ├── ext_validation.h ├── instance.cpp ├── instance.h ├── instance_properties.cpp ├── instance_properties.h ├── swap_chain.cpp └── swap_chain.h ├── image_guard.cpp ├── image_guard.h ├── mesh.h ├── orientation_gizmo_mesh.cpp ├── orientation_gizmo_mesh.h ├── ray_history_offscreen_renderer.cpp ├── ray_history_offscreen_renderer.h ├── render_module.cpp ├── render_module.h ├── render_modules ├── bounding_volume.cpp ├── bounding_volume.h ├── checker_clear.cpp ├── checker_clear.h ├── mesh_render_module.cpp ├── mesh_render_module.h ├── orientation_gizmo_module.cpp ├── orientation_gizmo_module.h ├── ray_inspector_overlay.cpp ├── ray_inspector_overlay.h ├── selection_module.cpp ├── selection_module.h ├── traversal.cpp └── traversal.h ├── renderer_vulkan.cpp ├── renderer_vulkan.h ├── util_vulkan.cpp ├── util_vulkan.h ├── vk_graphics_context.cpp └── vk_graphics_context.h /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: Google 2 | IndentWidth: 4 3 | UseTab: Never 4 | ColumnLimit: 160 5 | Language: Cpp 6 | AccessModifierOffset: -4 7 | BreakBeforeBraces: Custom 8 | BraceWrapping: 9 | 10 | AfterCaseLabel: true 11 | AfterClass: true 12 | AfterControlStatement: true 13 | AfterEnum: true 14 | AfterFunction: true 15 | AfterNamespace: true 16 | AfterObjCDeclaration: true 17 | AfterStruct: true 18 | AfterUnion: true 19 | AfterExternBlock: false 20 | BeforeCatch: true 21 | BeforeElse: true 22 | IndentBraces: false 23 | SplitEmptyFunction: true 24 | SplitEmptyRecord: true 25 | SplitEmptyNamespace: true 26 | ConstructorInitializerAllOnOneLineOrOnePerLine : false 27 | BreakConstructorInitializers: BeforeComma 28 | DerivePointerAlignment: false 29 | IndentCaseLabels: false 30 | NamespaceIndentation: All 31 | AlignConsecutiveAssignments: true 32 | AlignConsecutiveDeclarations: true 33 | AlignEscapedNewlines: Left 34 | AlignTrailingComments: true 35 | AlignOperands: true 36 | AllowShortFunctionsOnASingleLine: false 37 | AllowShortIfStatementsOnASingleLine: false 38 | AllowShortLoopsOnASingleLine: false 39 | AllowShortBlocksOnASingleLine: false 40 | ReflowComments: false 41 | SortIncludes: false 42 | SortUsingDeclarations: false 43 | BinPackArguments: false 44 | BinPackParameters: false 45 | ExperimentalAutoDetectBinPacking: false 46 | AllowAllParametersOfDeclarationOnNextLine: false -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.png filter=lfs diff=lfs merge=lfs -text 2 | *.rra filter=lfs diff=lfs merge=lfs -text 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.pyc 3 | *.orig 4 | __pycache__/ 5 | build/linux 6 | build/mac 7 | build/win 8 | cmake-build*/ 9 | .idea/ 10 | documentation/build 11 | documentation/source/_build 12 | source/frontend/version.h 13 | Buildinfo.properties 14 | external 15 | .vscode 16 | *.aps 17 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # Read the Docs configuration file. 2 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details. 3 | 4 | version: 2 5 | build: 6 | os: ubuntu-22.04 7 | tools: 8 | python: "3.11" 9 | jobs: 10 | post_checkout: 11 | # Download and uncompress the binary 12 | # https://git-lfs.github.com/ 13 | - wget https://github.com/git-lfs/git-lfs/releases/download/v3.1.4/git-lfs-linux-amd64-v3.1.4.tar.gz 14 | - tar xvfz git-lfs-linux-amd64-v3.1.4.tar.gz 15 | # Modify LFS config paths to point where git-lfs binary was downloaded 16 | - git config filter.lfs.process "`pwd`/git-lfs filter-process" 17 | - git config filter.lfs.smudge "`pwd`/git-lfs smudge -- %f" 18 | - git config filter.lfs.clean "`pwd`/git-lfs clean -- %f" 19 | # Make LFS available in current repository 20 | - ./git-lfs install 21 | # Download content from remote 22 | - ./git-lfs fetch 23 | # Make local files to have the real content on them 24 | - ./git-lfs checkout 25 | 26 | # Build documentation in the docs/source directory with Sphinx 27 | sphinx: 28 | configuration: documentation/source/conf.py 29 | 30 | # Explicitly set the version of Python and its requirements 31 | python: 32 | install: 33 | - requirements: documentation/requirements.txt 34 | -------------------------------------------------------------------------------- /Buildinfo.properties.in: -------------------------------------------------------------------------------- 1 | BUILD_NUMBER=@RRA_BUILD_NUMBER@ 2 | VERSION_NUMBER=@RRA_MAJOR_VERSION@.@RRA_MINOR_VERSION@ -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022-2025 Advanced Micro Devices, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /build/qt.conf: -------------------------------------------------------------------------------- 1 | [Paths] 2 | Prefix = ./ 3 | -------------------------------------------------------------------------------- /documentation/requirements.txt: -------------------------------------------------------------------------------- 1 | # Defining requirements for docs 2 | sphinx==5.3.0 3 | sphinx_rtd_theme==1.1.1 4 | readthedocs-sphinx-search==0.1.1 -------------------------------------------------------------------------------- /documentation/source/_static/style.css: -------------------------------------------------------------------------------- 1 | .wy-nav-content { 2 | max-width: none; 3 | } 4 | -------------------------------------------------------------------------------- /documentation/source/_static/theme_overrides.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | img { 4 | max-width: 100%; 5 | max-height: auto; 6 | box-shadow: 6px 6px #eee; 7 | -ms-interpolation-mode: bicubic; 8 | border: 1px solid #ccc; 9 | } 10 | 11 | table { 12 | font-size: 12px; 13 | } -------------------------------------------------------------------------------- /documentation/source/_templates/layout.html: -------------------------------------------------------------------------------- 1 | {% extends "!layout.html" %} 2 | {% block extrahead %} 3 | 4 | {% endblock %} 5 | -------------------------------------------------------------------------------- /documentation/source/media/blas/blas_instances_1.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:eb5b4f36aa873dfa8f3bd8a706858c4d0b2b4256350bac4a542d8f4b6a5a87b3 3 | size 95910 4 | -------------------------------------------------------------------------------- /documentation/source/media/blas/blas_properties_1.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b7dba14ae6fbe0991872779e50ce20eb7698301ab3f5f45a273af7f5f2130200 3 | size 33538 4 | -------------------------------------------------------------------------------- /documentation/source/media/blas/blas_viewer_1.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:800e75b232d9819c28f1a9e652aa83084baa850c173787c35043d9f041d41517 3 | size 262494 4 | -------------------------------------------------------------------------------- /documentation/source/media/blas/geometries_1.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0daffc0f21149f5d3bebfe27518355a32dfe6d76a39a3c2da64fac848a5caf94 3 | size 21181 4 | -------------------------------------------------------------------------------- /documentation/source/media/blas/split_triangles_1.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ebb9c57ea1e8879e95fc87bee5405a568a16567e07e9592b6bf601e923db74bb 3 | size 22081 4 | -------------------------------------------------------------------------------- /documentation/source/media/blas/split_triangles_2.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3728f639b83424613e9b865e49f4493394fd449fd1337fc3a20567c4162f90b1 3 | size 28587 4 | -------------------------------------------------------------------------------- /documentation/source/media/blas/split_triangles_stats_1.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:50d5e8e855ca8a093456d44f637c22a1874b69dbb97b5a2795e9126a5f9e0618 3 | size 28577 4 | -------------------------------------------------------------------------------- /documentation/source/media/blas/triangles_1.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:bc37f36eec10923dc57f4b11c8256d4069c462b0e37185287f56688b6fa52d1e 3 | size 90480 4 | -------------------------------------------------------------------------------- /documentation/source/media/overview/driver_experiments_1.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:11d1209323d5a356b1cf594289b712b875173cf297c53ea7c92b10d130f862ab 3 | size 97596 4 | -------------------------------------------------------------------------------- /documentation/source/media/overview/summary_1.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:96c807c18853ec9d9d954bd7d2f8e3b0e688ac9bdcc434656492070007d5b9dd 3 | size 122800 4 | -------------------------------------------------------------------------------- /documentation/source/media/overview/system_info_1.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e21477bca066d90c6d608cb3f8ee9bcb05ebe8c22cbeb233705c4da9ab243a9d 3 | size 49906 4 | -------------------------------------------------------------------------------- /documentation/source/media/overview/user_markers.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:005afa7c0387ec9b15970cecfbb0a261958575e3ed64e9b96266af3762b4f75a 3 | size 33646 4 | -------------------------------------------------------------------------------- /documentation/source/media/ray/ray_history_1.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:298b4657ec5f6aa1fa9963ef94f92b4d4847616687ce89a7dece06f08d711f2d 3 | size 177928 4 | -------------------------------------------------------------------------------- /documentation/source/media/ray/ray_history_2.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0c64203df84011f2c24e9d3eb8a63e8fb2f6f30f9b066f7a01d0d821d368f414 3 | size 149905 4 | -------------------------------------------------------------------------------- /documentation/source/media/ray/ray_inspector_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Tools/radeon_raytracing_analyzer/1fe3c6fb6da27b1a38726969c7c1874d274f567d/documentation/source/media/ray/ray_inspector_1.jpg -------------------------------------------------------------------------------- /documentation/source/media/ray/ray_inspector_2.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:09ebda7fe31352bfb98ded78acd316f5a16dc23c7d3ed2d48c05c2c444a9e174 3 | size 64564 4 | -------------------------------------------------------------------------------- /documentation/source/media/ray/ray_inspector_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Tools/radeon_raytracing_analyzer/1fe3c6fb6da27b1a38726969c7c1874d274f567d/documentation/source/media/ray/ray_inspector_3.jpg -------------------------------------------------------------------------------- /documentation/source/media/ray/ray_inspector_4.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b52041aa6d719f5c703ebdb1ec68433383c00a3b6dfb15fa95a38d4eaf969c8f 3 | size 19788 4 | -------------------------------------------------------------------------------- /documentation/source/media/ray/ray_user_markers.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fa76d7dbea091ed1b06cfef26cc8c43e2a9cb19cddb6725bc3f3577aa489eeeb 3 | size 16338 4 | -------------------------------------------------------------------------------- /documentation/source/media/recent_traces_1.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4665380fa49184e3813e68c3bba38f2cd2d2228d5699013c45de160c5318af73 3 | size 38955 4 | -------------------------------------------------------------------------------- /documentation/source/media/reset.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8e526f9b353370dd29182708f4deb0219bcae776b47114a04f04f0c4c62f9a3a 3 | size 728 4 | -------------------------------------------------------------------------------- /documentation/source/media/settings/dark_theme_1.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:bda97a5ec0ccf50ba971717dae14eb31e6858923a443f268d9e10d5a6c453e86 3 | size 83321 4 | -------------------------------------------------------------------------------- /documentation/source/media/settings/dark_theme_prompt.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1f3b707e2e459d21e70d34ea6cc1e77f88e1a0930d4454a263d07a9ad911eda0 3 | size 9393 4 | -------------------------------------------------------------------------------- /documentation/source/media/settings/general_1.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b8a1c17bdb7dcf252d1420e55db49381789c8b6203d0ead90a1f16f54b17ad3d 3 | size 44935 4 | -------------------------------------------------------------------------------- /documentation/source/media/settings/keyboard_shortcuts_1.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:15390ed0ca544b4d3a1dd63459b4680ab9462a4b627d8db66971c692300fa71c 3 | size 52964 4 | -------------------------------------------------------------------------------- /documentation/source/media/settings/themes_and_colors_1.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:afde1fa2fe5e2450f7d180cb82822e6950cca5c873c829d6232dc762d7d5e6ad 3 | size 46829 4 | -------------------------------------------------------------------------------- /documentation/source/media/tlas/blas_list_1.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:70182043ef4a64ef5261bba9e98f3bb8db95c47d41b1886b26c781837b551ea4 3 | size 102840 4 | -------------------------------------------------------------------------------- /documentation/source/media/tlas/context_menu_1.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:faaf98a2e07e6c5fdda0c0599d395c56b345022d0c5d91a17cd0877a3730e850 3 | size 28294 4 | -------------------------------------------------------------------------------- /documentation/source/media/tlas/depth_slider.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:45f3dca2b140573e8e7d1ffb024eefd6c9715d8b3dc367c7975f3611defc793b 3 | size 1033 4 | -------------------------------------------------------------------------------- /documentation/source/media/tlas/instance_mask_filter.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:04f22cfdfab6f541bc8944224ac51f5d3d5501f9f0ca317aecf9ac9407b22cb8 3 | size 2492 4 | -------------------------------------------------------------------------------- /documentation/source/media/tlas/loop_count.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Tools/radeon_raytracing_analyzer/1fe3c6fb6da27b1a38726969c7c1874d274f567d/documentation/source/media/tlas/loop_count.jpg -------------------------------------------------------------------------------- /documentation/source/media/tlas/popout_view_1.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:35ff141ad0e7308c6b2e76485abaf6156ba4c244dc135bcd64916d7510497580 3 | size 19354 4 | -------------------------------------------------------------------------------- /documentation/source/media/tlas/popout_view_2.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a3cfc9d010f2ac799b2fd333b37a3161bf951415f58a5ee2c3f3243dc4306ce3 3 | size 18793 4 | -------------------------------------------------------------------------------- /documentation/source/media/tlas/popout_view_3.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8b49c2fbb31b4928cfe26013e1fc56a18ec29333b3ae2d2e8093007295de13ac 3 | size 24555 4 | -------------------------------------------------------------------------------- /documentation/source/media/tlas/rebraiding_stats_1.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9ed6f1af7f797476ed2509ee970c6979fb2fff8c2ae498d64e5c795925211fe0 3 | size 32381 4 | -------------------------------------------------------------------------------- /documentation/source/media/tlas/tlas_instances_1.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:08a2cc5166e6bbc2b68a1420f06a6abfa574941e8ba293c4a109a15d9332822f 3 | size 102446 4 | -------------------------------------------------------------------------------- /documentation/source/media/tlas/tlas_properties_1.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b7888f584a7478413416d9103e6d2fd7b95365184bb83e2e2b7482b332c354f9 3 | size 27920 4 | -------------------------------------------------------------------------------- /documentation/source/media/tlas/tlas_viewer_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Tools/radeon_raytracing_analyzer/1fe3c6fb6da27b1a38726969c7c1874d274f567d/documentation/source/media/tlas/tlas_viewer_1.jpg -------------------------------------------------------------------------------- /documentation/source/media/welcome_1.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4e14548f6aab8c44b0efaac3a70be60a5a973396aa817ab8a6909055c2819e4f 3 | size 54236 4 | -------------------------------------------------------------------------------- /documentation/source/media/zoom_in.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e027edc3f48b3d348a03c62c80b78b084f4cd6508f57276fd3fa6265d2a6ff26 3 | size 1425 4 | -------------------------------------------------------------------------------- /documentation/source/media/zoom_out.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5673ce56c454c3df2c0d7c940232963777a107ab6d96d24c22a3196a02fc0e99 3 | size 1340 4 | -------------------------------------------------------------------------------- /documentation/source/media/zoom_reset.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:dbc5a15b44e17dc9f2f724bcd0494abf11be6e2aebf4c7bf828ee7fb546449a2 3 | size 1543 4 | -------------------------------------------------------------------------------- /documentation/source/media/zoom_to_selection.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a303f14f34205d4efdc60c55b8a2b5abefd1918c62b88a05043750e2518ad59c 3 | size 1281 4 | -------------------------------------------------------------------------------- /samples/brick_wall.rra: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:422a638a609bba8c3d9ef5b759e6d8f1e9a40e0995b2c36acacc06ace3a3d6f6 3 | size 28642240 4 | -------------------------------------------------------------------------------- /samples/character.rra: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4c511add32fefd61cc0add5f23d87e6cdfbfbd3f397ac45b1cd065ebfb9262a0 3 | size 28713744 4 | -------------------------------------------------------------------------------- /samples/face_culling.rra: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2b74c23e56e7c401250a8d3c94d1c41d28aaa60b36a73d840453295e379e58f4 3 | size 4542748 4 | -------------------------------------------------------------------------------- /samples/landscape.rra: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:dee8b87080c5272930ecc0d814c89a0fed7bc6fb7c70183e14d75b9f9aa66b80 3 | size 10906727 4 | -------------------------------------------------------------------------------- /samples/scaffolding.rra: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b5df46d2b049e01339a99a0223bb13d14f9e4e4c20848cc15020dfbec3c32130 3 | size 2149351 4 | -------------------------------------------------------------------------------- /samples/springs.rra: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cbc83ec2a269351e8f7d5f697b4b51fde2c49bd5bf1e00ca9ecb43d820671126 3 | size 3160048 4 | -------------------------------------------------------------------------------- /samples/trees.rra: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4444074a0a62dece7f2aae5e1f93fe629092f6040d32a0adf3dff620b3ac56b9 3 | size 12842552 4 | -------------------------------------------------------------------------------- /samples/update_blas.rra: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d4a2f9e906fbc1fd544b77a88f64a99964c7236cf91fcd5a5aabdca2d15989be 3 | size 1221062 4 | -------------------------------------------------------------------------------- /source/assets/amd_logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/arrow_gray_left.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/arrow_gray_right.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/browse_back_disabled.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/browse_back_normal.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/browse_back_pressed.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/browse_fwd_disabled.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/browse_fwd_normal.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/browse_fwd_pressed.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/checkbox_off.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/checkbox_off_gray.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/checkbox_on.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/checkbox_on_gray.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/icon_32x32.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8b706a266bf63949012266af6966b80c4bdf3b227356b235c49ec73f75047a3b 3 | size 1646 4 | -------------------------------------------------------------------------------- /source/assets/icon_48x48.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:79ba7e396a49bf6fdb780eba3b3d3711bc513071c0346c872b9a25c8b95a3ba3 3 | size 2486 4 | -------------------------------------------------------------------------------- /source/assets/kbd_mouse.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/kbd_mouse_clickable-dark-theme.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/kbd_mouse_clickable.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/kbd_mouse_hover.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/pulldown_off_gray.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/pulldown_on_gray.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/stop_128x128.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:75728c45b1715840d65c69cb368cdaee5b494aee7d6b0a07eb50a41f13778850 3 | size 2886 4 | -------------------------------------------------------------------------------- /source/assets/third_party/ionicons/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Drifty (http://drifty.com/) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /source/assets/third_party/ionicons/information-circle-outline.svg: -------------------------------------------------------------------------------- 1 | Information Circle -------------------------------------------------------------------------------- /source/assets/third_party/ionicons/lock-closed-outline-hover.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 63 | -------------------------------------------------------------------------------- /source/assets/third_party/ionicons/lock-closed-outline.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 37 | -------------------------------------------------------------------------------- /source/assets/third_party/ionicons/lock-open-outline.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 65 | -------------------------------------------------------------------------------- /source/assets/third_party/ionicons/scan-outline-clickable-dark-theme.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 51 | -------------------------------------------------------------------------------- /source/assets/third_party/ionicons/scan-outline-clickable.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 51 | -------------------------------------------------------------------------------- /source/assets/third_party/ionicons/scan-outline-hover.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 48 | -------------------------------------------------------------------------------- /source/assets/third_party/ionicons/scan-outline.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 36 | -------------------------------------------------------------------------------- /source/assets/third_party/ionicons/search_icon.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2e3d0684d52989104547f561162c14e8a467e002319863a86d33c092a30b8083 3 | size 346 4 | -------------------------------------------------------------------------------- /source/assets/third_party/ionicons/wand-clickable.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 41 | -------------------------------------------------------------------------------- /source/assets/third_party/ionicons/wand-hover.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 41 | -------------------------------------------------------------------------------- /source/assets/third_party/ionicons/wand.svg: -------------------------------------------------------------------------------- 1 | Color Wand -------------------------------------------------------------------------------- /source/assets/zoom_in.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/zoom_in_disabled.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/zoom_out.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/zoom_out_disabled.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/zoom_reset.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/zoom_reset_disabled.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/zoom_to_selection.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/assets/zoom_to_selection_disabled.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/backend/bvh/bvh_index_reference_map.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief BVH Index reference map implementation. 6 | //============================================================================= 7 | 8 | #include "bvh/bvh_index_reference_map.h" 9 | 10 | #include "rdf/rdf/inc/amdrdf.h" 11 | 12 | #include "public/rra_assert.h" 13 | 14 | namespace rta 15 | { 16 | // Collection of bvhs of different acceleration structure types. 17 | struct IndexReferenceEntry 18 | { 19 | std::uint64_t index; 20 | std::uintptr_t ptr; 21 | }; 22 | 23 | } // namespace rta 24 | -------------------------------------------------------------------------------- /source/backend/bvh/bvh_index_reference_map.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief BVH Index reference map definition. 6 | //============================================================================= 7 | 8 | #ifndef RRA_BACKEND_BVH_BVH_INDEX_REFERENCE_MAP_H_ 9 | #define RRA_BACKEND_BVH_BVH_INDEX_REFERENCE_MAP_H_ 10 | 11 | #include 12 | 13 | #include "rdf/rdf/inc/amdrdf.h" 14 | 15 | namespace rta 16 | { 17 | } // namespace rta 18 | 19 | #endif // RRA_BACKEND_BVH_BVH_INDEX_REFERENCE_MAP_H_ 20 | -------------------------------------------------------------------------------- /source/backend/bvh/geometry_info.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation of the geometry info class. 6 | //============================================================================= 7 | 8 | #include "geometry_info.h" 9 | 10 | namespace dxr 11 | { 12 | // Check if headers and descriptions are trivially copyable (memcpy support). 13 | static_assert(std::is_trivially_copyable::value, "DXR::AMD::GeometryInfo must be a trivially copyable class."); 14 | 15 | // Check if the size of structs is as expected. 16 | static_assert(sizeof(amd::GeometryInfo) == amd::kGeometryInfoSize, "Size of GeometryDesc does not match the expected byte size"); 17 | 18 | namespace amd 19 | { 20 | GeometryFlags GeometryInfo::GetGeometryFlags() const 21 | { 22 | return static_cast(geometry_flags); 23 | } 24 | 25 | std::uint32_t GeometryInfo::GetPrimitiveCount() const 26 | { 27 | return primitive_count; 28 | } 29 | 30 | std::uint32_t GeometryInfo::GetPrimitiveNodePtrsOffset() const 31 | { 32 | return primitive_node_ptrs_offset_; 33 | } 34 | } // namespace amd 35 | } // namespace dxr 36 | -------------------------------------------------------------------------------- /source/backend/bvh/geometry_info.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Definition for the geometry info class. 6 | //============================================================================= 7 | 8 | #ifndef RRA_BACKEND_BVH_GEOMETRY_INFO_H_ 9 | #define RRA_BACKEND_BVH_GEOMETRY_INFO_H_ 10 | 11 | #include "bvh/dxr_definitions.h" 12 | 13 | namespace dxr 14 | { 15 | namespace amd 16 | { 17 | class GeometryInfo final 18 | { 19 | public: 20 | /// @brief Constructor. 21 | GeometryInfo() = default; 22 | 23 | /// @brief Destructor. 24 | ~GeometryInfo() = default; 25 | 26 | /// @brief Obtain the geometry flags. 27 | /// 28 | /// @return The geometry flags. 29 | GeometryFlags GetGeometryFlags() const; 30 | 31 | /// @brief Obtain the primitive count. 32 | /// 33 | /// return The primitive count. 34 | std::uint32_t GetPrimitiveCount() const; 35 | 36 | /// @brief Get the offset to the primitive node pointers. 37 | /// 38 | /// @return The primitive node pointer offset. 39 | std::uint32_t GetPrimitiveNodePtrsOffset() const; 40 | 41 | private: 42 | union ///< Encodes the geometry flags (opaque, non_opaque, ...) and number of primitives. 43 | { 44 | struct 45 | { 46 | std::uint32_t primitive_count : 29; 47 | std::uint32_t geometry_flags : 3; 48 | }; 49 | std::uint32_t geometry_flags_and_primitive_count_ = 0; 50 | }; 51 | 52 | std::uint32_t geometry_buffer_offset_ = 0; ///< Byte offset to the geometry buffer (leaf nodes) 53 | 54 | std::uint32_t primitive_node_ptrs_offset_ = 55 | 0; ///< Byte offset from the base of all primitive node ptrs to this geometry's prim node ptrs. Each node pointer points to the primitive. 56 | }; 57 | 58 | } // namespace amd 59 | } // namespace dxr 60 | 61 | #endif // RRA_BACKEND_BVH_GEOMETRY_INFO_H_ 62 | -------------------------------------------------------------------------------- /source/backend/bvh/metadata_v1.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation of the V1 MetaData class. 6 | //============================================================================= 7 | 8 | #include "metadata_v1.h" 9 | 10 | namespace dxr 11 | { 12 | // Check if headers and descriptions are trivially copyable (memcpy support) 13 | static_assert(std::is_trivially_copyable::value, "DXR::AMD::MetaData must be a trivially copyable class."); 14 | 15 | // Check if the size of structs is as expected. 16 | static_assert(sizeof(rta::GpuVirtualAddress) == sizeof(std::uint64_t), "GpuVirtualAddress does not have the expected byte size"); 17 | static_assert(sizeof(amd::MetaDataV1) == amd::kMetaDataV1Size, "Metadata does not have the expected byte size."); 18 | 19 | } // namespace dxr 20 | 21 | namespace dxr 22 | { 23 | namespace amd 24 | { 25 | void MetaDataV1::SetGpuVa(const rta::GpuVirtualAddress gpu_address) 26 | { 27 | std::uint32_t high_bits = gpu_address >> 32; 28 | std::uint32_t low_bits = static_cast(gpu_address); 29 | 30 | id_low_ = low_bits; 31 | id_high_ = high_bits; 32 | } 33 | 34 | rta::GpuVirtualAddress MetaDataV1::GetGpuVirtualAddress() const 35 | { 36 | rta::GpuVirtualAddress gpu_va = static_cast(id_high_); 37 | gpu_va = (gpu_va << 32) | static_cast(id_low_); 38 | 39 | return gpu_va; 40 | } 41 | 42 | std::uint32_t MetaDataV1::GetByteSize() const 43 | { 44 | return byte_size_; 45 | } 46 | 47 | } // namespace amd 48 | } // namespace dxr 49 | -------------------------------------------------------------------------------- /source/backend/bvh/node_types/box_node.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Box node helper functions. 6 | //============================================================================= 7 | 8 | #include "bvh/node_types/box_node.h" 9 | 10 | #include "bvh/node_pointer.h" 11 | 12 | namespace dxr 13 | { 14 | namespace amd 15 | { 16 | std::uint32_t GetValidChildCountFromArray(const std::array& children) 17 | { 18 | std::uint32_t num_children = 0; 19 | for (const auto& c : children) 20 | { 21 | num_children += static_cast(!c.IsInvalid()); 22 | } 23 | 24 | return num_children; 25 | } 26 | 27 | } // namespace amd 28 | } // namespace dxr 29 | -------------------------------------------------------------------------------- /source/backend/bvh/node_types/box_node.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Box node helper functions. 6 | //============================================================================= 7 | 8 | #ifndef RRA_BACKEND_BVH_NODE_TYPES_BOX_NODE_H_ 9 | #define RRA_BACKEND_BVH_NODE_TYPES_BOX_NODE_H_ 10 | 11 | #include 12 | #include 13 | 14 | #include "bvh/node_pointer.h" 15 | 16 | namespace dxr 17 | { 18 | namespace amd 19 | { 20 | /// @brief Get the number of valid child nodes. 21 | /// 22 | /// @param children An array of child nodes. 23 | /// 24 | /// @return The number of valid child nodes. 25 | std::uint32_t GetValidChildCountFromArray(const std::array& children); 26 | 27 | } // namespace amd 28 | } // namespace dxr 29 | 30 | #endif // RRA_BACKEND_BVH_NODE_TYPES_BOX_NODE_H_ 31 | -------------------------------------------------------------------------------- /source/backend/bvh/node_types/float16_box_node.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation for a float 16 box node class. 6 | //============================================================================= 7 | 8 | #include "bvh/node_types/float16_box_node.h" 9 | #include "bvh/node_types/box_node.h" 10 | 11 | #include "bvh/utils.h" 12 | 13 | namespace dxr 14 | { 15 | // Check if headers and descriptions are trivially copyable (memcpy support). 16 | static_assert(std::is_trivially_copyable::value, "DXR::AMD::Float16BoxNode must be a trivially copyable class."); 17 | 18 | // Check if the size of structs is as expected. 19 | static_assert(sizeof(amd::Float16BoxNode) == amd::kFp16BoxNodeSize, "Float16BoxNode does not have the expected byte size."); 20 | 21 | namespace amd 22 | { 23 | const std::array& Float16BoxNode::GetChildren() const 24 | { 25 | return children_; 26 | } 27 | 28 | const std::array Float16BoxNode::GetBoundingBoxes() const 29 | { 30 | std::array fp32_bounding_boxes; 31 | 32 | rta::ConvertHalfToFloat(reinterpret_cast(bounding_boxes_.data()), reinterpret_cast(fp32_bounding_boxes.data()), 4 * 6); 33 | 34 | return fp32_bounding_boxes; 35 | } 36 | 37 | std::uint32_t Float16BoxNode::GetValidChildCount() const 38 | { 39 | return GetValidChildCountFromArray(children_); 40 | } 41 | 42 | } // namespace amd 43 | } // namespace dxr 44 | -------------------------------------------------------------------------------- /source/backend/bvh/node_types/float32_box_node.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation for a float 32 box node class. 6 | //============================================================================= 7 | 8 | #include "bvh/node_types/float32_box_node.h" 9 | #include "bvh/node_types/box_node.h" 10 | 11 | namespace dxr 12 | { 13 | // Check if headers and descriptions are trivially copyable (memcpy support). 14 | static_assert(std::is_trivially_copyable::value, "DXR::AMD::Float32BoxNode must be a trivially copyable class."); 15 | 16 | // Check if the size of structs is as expected. 17 | static_assert(sizeof(amd::Float32BoxNode) == amd::kFp32BoxNodeSize, "Float32BoxNode does not have the expected byte size."); 18 | 19 | namespace amd 20 | { 21 | const std::array& Float32BoxNode::GetChildren() const 22 | { 23 | return children_; 24 | } 25 | 26 | const std::array& Float32BoxNode::GetBoundingBoxes() const 27 | { 28 | return bounding_boxes_; 29 | } 30 | 31 | std::uint32_t Float32BoxNode::GetValidChildCount() const 32 | { 33 | return GetValidChildCountFromArray(children_); 34 | } 35 | } // namespace amd 36 | } // namespace dxr 37 | -------------------------------------------------------------------------------- /source/backend/bvh/node_types/float32_box_node.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Definition of a float 32 box node class. 6 | //============================================================================= 7 | 8 | #ifndef RRA_BACKEND_BVH_NODE_TYPES_FLOAT32_BOX_NODE_H_ 9 | #define RRA_BACKEND_BVH_NODE_TYPES_FLOAT32_BOX_NODE_H_ 10 | 11 | #include "bvh/node_pointer.h" 12 | 13 | namespace dxr 14 | { 15 | namespace amd 16 | { 17 | // Default layout of an internal node in Blas. 18 | class Float32BoxNode final 19 | { 20 | public: 21 | /// @brief Constructor. 22 | Float32BoxNode() = default; 23 | 24 | /// @brief Destructor. 25 | ~Float32BoxNode() = default; 26 | 27 | /// @brief Get the child nodes. 28 | /// 29 | /// @return The child nodes. 30 | const std::array& GetChildren() const; 31 | 32 | /// @brief Get the bounding volumes. 33 | /// 34 | /// @return The bounding volumes. 35 | const std::array& GetBoundingBoxes() const; 36 | 37 | /// @brief Get the number of valid child nodes. They can be scattered across all 4 positions. 38 | /// 39 | /// @return The number of valid child nodes. 40 | std::uint32_t GetValidChildCount() const; 41 | 42 | private: 43 | std::array children_ = {}; ///< Array of child nodes. 44 | std::array bounding_boxes_ = {}; ///< Array of bounding volumes. 45 | std::uint32_t reserved_ = 0; ///< Reserved. 46 | std::uint32_t reserved2_ = 0; ///< Reserved. 47 | std::array padding_ = {}; ///< Padding. 48 | }; 49 | } // namespace amd 50 | } // namespace dxr 51 | 52 | #endif // RRA_BACKEND_BVH_NODE_TYPES_FLOAT32_BOX_NODE_H_ 53 | -------------------------------------------------------------------------------- /source/backend/bvh/node_types/procedural_node.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation for a procedural node class. 6 | //============================================================================= 7 | 8 | #include "bvh/node_types/procedural_node.h" 9 | 10 | #include // --> isnan, isinf 11 | 12 | namespace dxr 13 | { 14 | // Check if headers and descriptions are trivially copyable (memcpy support). 15 | static_assert(std::is_trivially_copyable::value, "DXR::AMD::ProceduralNode must be a trivially copyable class."); 16 | 17 | // Check if the size of structs is as expected. 18 | static_assert(sizeof(amd::ProceduralNode) == amd::kLeafNodeSize, "ProceduralNode does not have the expected byte size."); 19 | 20 | namespace amd 21 | { 22 | const AxisAlignedBoundingBox& ProceduralNode::GetBoundingBox() const 23 | { 24 | return bounding_box_; 25 | } 26 | 27 | std::uint32_t ProceduralNode::GetGeometryIndex() const 28 | { 29 | return geometry_index; 30 | } 31 | 32 | GeometryFlags ProceduralNode::GetGeometryFlags() const 33 | { 34 | return static_cast(geometry_flags); 35 | } 36 | 37 | std::uint32_t ProceduralNode::GetPrimitiveIndex() const 38 | { 39 | return primitive_index_; 40 | } 41 | 42 | bool ProceduralNode::IsInactive() const 43 | { 44 | return std::isnan(bounding_box_.min.x); 45 | } 46 | 47 | bool ProceduralNode::ContainsNaN() const 48 | { 49 | return std::isnan(bounding_box_.min.x) || std::isnan(bounding_box_.min.y) || std::isnan(bounding_box_.min.z) || std::isnan(bounding_box_.max.x) || 50 | std::isnan(bounding_box_.max.y) || std::isnan(bounding_box_.max.z); 51 | } 52 | 53 | } // namespace amd 54 | } // namespace dxr 55 | -------------------------------------------------------------------------------- /source/backend/bvh/rtip11/rt_ip_11_acceleration_structure_header.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief RT IP 1.1 (Navi2x) specific acceleration structure header 6 | /// definition. 7 | //============================================================================= 8 | 9 | #include "bvh/rtip_common/acceleration_structure_header.h" 10 | 11 | #ifndef RRA_BACKEND_BVH_RT_IP_11_ACCELERATION_STRUCTURE_HEADER_H_ 12 | #define RRA_BACKEND_BVH_RT_IP_11_ACCELERATION_STRUCTURE_HEADER_H_ 13 | 14 | namespace rta 15 | { 16 | class DxrRtIp11AccelerationStructureHeader final : public RtIpCommonAccelerationStructureHeader 17 | { 18 | private: 19 | void LoadFromBufferImpl(const std::uint64_t size, 20 | const void* buffer, 21 | const RayTracingBinaryVersion& rt_binary_header_version = kSupportedRayTracingBinaryHeaderVersion); 22 | }; 23 | } // namespace rta 24 | #endif // RRA_BACKEND_BVH_RT_IP_11_ACCELERATION_STRUCTURE_HEADER_H_ 25 | -------------------------------------------------------------------------------- /source/backend/bvh/rtip11/rt_ip_11_header.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief RT IP 1.1 (Navi2x) specific chunk header definition. 6 | //============================================================================= 7 | 8 | #ifndef RRA_BACKEND_BVH_RT_IP_11_HEADER_H_ 9 | #define RRA_BACKEND_BVH_RT_IP_11_HEADER_H_ 10 | 11 | #endif // RRA_BACKEND_BVH_RT_IP_11_HEADER_H_ 12 | -------------------------------------------------------------------------------- /source/backend/bvh/rtip31/rt_ip_31_acceleration_structure_header.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief RT IP 3.1 (Navi4x) specific acceleration structure header 6 | /// implementation. 7 | //============================================================================= 8 | 9 | #include "rt_ip_31_acceleration_structure_header.h" 10 | 11 | #include // --> Linux, memcpy 12 | #include "bvh/dxr_type_conversion.h" 13 | #include "bvh/utils.h" 14 | 15 | namespace rta 16 | { 17 | void DxrRtIp31AccelerationStructureHeader::LoadFromBufferImpl(const std::uint64_t size, 18 | const void* buffer, 19 | const RayTracingBinaryVersion& rt_binary_header_version) 20 | { 21 | RRA_UNUSED(size); 22 | RRA_UNUSED(rt_binary_header_version); 23 | size_t struct_size = sizeof(AccelStructHeader); 24 | assert(size == struct_size); 25 | memcpy(&header_, buffer, struct_size); 26 | build_info_->LoadFromBuffer(sizeof(header_.info), &header_.info); 27 | #ifdef RRA_INTERNAL 28 | auto converted_version = rta::RayTracingBinaryVersion(header_.accelStructVersion); 29 | while (converted_version < kSupportedRayTracingBinaryHeaderVersion) 30 | { 31 | converted_version = ConvertToNextHeaderVersion(converted_version.version); 32 | } 33 | #endif 34 | } 35 | } // namespace rta 36 | -------------------------------------------------------------------------------- /source/backend/bvh/rtip31/rt_ip_31_acceleration_structure_header.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief RT IP 3.1 (Navi4x) specific acceleration structure header 6 | /// definition. 7 | //============================================================================= 8 | 9 | #include "bvh/rtip_common/acceleration_structure_header.h" 10 | 11 | #ifndef RRA_BACKEND_BVH_RT_IP_31_ACCELERATION_STRUCTURE_HEADER_H_ 12 | #define RRA_BACKEND_BVH_RT_IP_31_ACCELERATION_STRUCTURE_HEADER_H_ 13 | 14 | namespace rta 15 | { 16 | class DxrRtIp31AccelerationStructureHeader final : public RtIpCommonAccelerationStructureHeader 17 | { 18 | private: 19 | void LoadFromBufferImpl(const std::uint64_t size, 20 | const void* buffer, 21 | const RayTracingBinaryVersion& rt_binary_header_version = kSupportedRayTracingBinaryHeaderVersion); 22 | }; 23 | } // namespace rta 24 | #endif // RRA_BACKEND_BVH_RT_IP_31_ACCELERATION_STRUCTURE_HEADER_H_ 25 | -------------------------------------------------------------------------------- /source/backend/bvh/utils.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation of miscellaneous utility functions. 6 | //============================================================================= 7 | 8 | #include "utils.h" 9 | 10 | #include 11 | #include // --> Linux, memcpy 12 | #include 13 | #include // --> isnan, isinf, ceil 14 | 15 | namespace rta 16 | { 17 | void ConvertHalfToFloat(const std::uint16_t* input, float* output, std::int32_t count) 18 | { 19 | std::array buffer; 20 | 21 | while (count > 0) 22 | { 23 | std::memcpy(buffer.data(), input, std::min(count, 8) * sizeof(std::uint16_t)); 24 | 25 | __m128i half_vector = _mm_loadu_si128(reinterpret_cast<__m128i*>(buffer.data())); 26 | __m256 float_vector = _mm256_cvtph_ps(half_vector); 27 | _mm256_storeu_ps(reinterpret_cast(buffer.data()), float_vector); 28 | 29 | std::memcpy(output, buffer.data(), std::min(count, 8) * sizeof(float)); 30 | 31 | // Advance pointers 32 | input += 8; 33 | output += 8; 34 | 35 | // Decrement left elements 36 | count -= 8; 37 | } 38 | } 39 | 40 | std::uint32_t ComputeBoxNodePerInteriorNodeCount(const std::uint32_t interior_node_branching_factor) 41 | { 42 | return static_cast(std::ceil(interior_node_branching_factor / 4.f)); 43 | } 44 | 45 | } // namespace rta 46 | -------------------------------------------------------------------------------- /source/backend/bvh/utils.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Header for miscellaneous utility functions. 6 | //============================================================================= 7 | 8 | #ifndef RRA_BACKEND_BVH_UTILS_H_ 9 | #define RRA_BACKEND_BVH_UTILS_H_ 10 | 11 | #include 12 | 13 | namespace rta 14 | { 15 | /// @brief Converts count half-precision floats (uint16) stored in input array to floats in output array. 16 | /// 17 | /// @param [in] input The array of float16s to convert. 18 | /// @param [out] output The array to hold to converted float32s. 19 | /// @param [in] count The size of the array to convert. 20 | void ConvertHalfToFloat(const std::uint16_t* input, float* output, std::int32_t count); 21 | 22 | /// @brief Calculate how many box nodes per interior node count. 23 | /// 24 | /// @param [in] interior_node_branching_factor The branching factor. 25 | /// 26 | /// @return The node count. 27 | std::uint32_t ComputeBoxNodePerInteriorNodeCount(const std::uint32_t interior_node_branching_factor); 28 | 29 | } // namespace rta 30 | 31 | #endif // RRA_BACKEND_BVH_UTILS_H_ 32 | -------------------------------------------------------------------------------- /source/backend/math_util.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Header for the math utilities. 6 | //============================================================================= 7 | 8 | #ifndef RRA_BACKEND_MATH_UTIL_H_ 9 | #define RRA_BACKEND_MATH_UTIL_H_ 10 | 11 | #include "bvh/dxr_definitions.h" 12 | #include "rra_bvh_impl.h" 13 | 14 | namespace rra 15 | { 16 | namespace math_util 17 | { 18 | /// @brief Helper function to transform an AABB by tranforming all its corner points and against taking 19 | /// the minimum and maximum of these results. May increase the volume of the AABB up to a factor of 2. 20 | /// 21 | /// NOTE: A Matrix3x4 is a transposed 4x4 matrix with the translation in the last column rather than the 22 | /// last row. 23 | /// 24 | /// @param [in] bounding_box The bounding box to be transformed. 25 | /// @param [in] transform The transformation matrix to be applied. 26 | /// 27 | /// @return The transformed bounding box. 28 | BoundingVolumeExtents TransformAABB(const dxr::amd::AxisAlignedBoundingBox& bounding_box, const dxr::Matrix3x4& transform); 29 | 30 | } // namespace math_util 31 | } // namespace rra 32 | 33 | #endif // RRA_BACKEND_MATH_UTIL_H_ 34 | -------------------------------------------------------------------------------- /source/backend/public/rra_api_info.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Definition for the public API info interface. 6 | //============================================================================= 7 | 8 | #ifndef RRA_BACKEND_PUBLIC_RRA_API_INFO_H_ 9 | #define RRA_BACKEND_PUBLIC_RRA_API_INFO_H_ 10 | 11 | #include 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif // #ifdef __cplusplus 16 | 17 | /// @brief Get the name of the API used when taking the trace. 18 | /// 19 | /// @return The text string of the node name. 20 | const char* RraApiInfoGetApiName(); 21 | 22 | /// @brief Get whether or not the captured application uses Vulkan. 23 | /// 24 | /// @return True if the captured application uses Vulkan, false otherwise. 25 | bool RraApiInfoIsVulkan(); 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif // #ifdef __cplusplus 30 | #endif // RRA_BACKEND_PUBLIC_RRA_API_INFO_H_ 31 | -------------------------------------------------------------------------------- /source/backend/public/rra_macro.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Utility macro definitions. 6 | //============================================================================= 7 | 8 | #ifndef RRA_BACKEND_PUBLIC_RRA_MACRO_H_ 9 | #define RRA_BACKEND_PUBLIC_RRA_MACRO_H_ 10 | 11 | /// Helper macro to avoid warnings about unused variables. 12 | #define RRA_UNUSED(x) ((void)(x)) 13 | 14 | /// Helper macro to align an integer to the specified power of 2 boundary 15 | #define RRA_ALIGN_UP(x, y) (((x) + ((y)-1)) & ~((y)-1)) 16 | 17 | /// Helper macro to check if a value is aligned. 18 | #define RRA_IS_ALIGNED(x) (((x) != 0) && ((x) & ((x)-1))) 19 | 20 | /// Helper macro to stringify a value. 21 | #define RRA_STR(s) RRA_XSTR(s) 22 | #define RRA_XSTR(s) #s 23 | 24 | /// Helper macro to return the maximum of two values. 25 | #define RRA_MAXIMUM(x, y) (((x) > (y)) ? (x) : (y)) 26 | 27 | /// Helper macro to return the minimum of two values. 28 | #define RRA_MINIMUM(x, y) (((x) < (y)) ? (x) : (y)) 29 | 30 | /// Helper macro to do safe free on a pointer. 31 | #define RRA_SAFE_FREE(x) \ 32 | if (x) \ 33 | free(x) 34 | 35 | /// Helper macro to return the abs of an integer value. 36 | #define RRA_ABSOLUTE(x) (((x) < 0) ? (-(x)) : (x)) 37 | 38 | /// Helper macro to return sign of a value. 39 | #define RRA_SIGN(x) (((x) < 0) ? -1 : 1) 40 | 41 | /// Helper macro to work out the number of elements in an array. 42 | #define RRA_ARRAY_ELEMENTS(x) (int32_t)((sizeof(x) / sizeof(0 [x])) / ((size_t)(!(sizeof(x) % sizeof(0 [x]))))) 43 | 44 | #endif // #ifndef RRA_BACKEND_PUBLIC_RRA_MACRO_H_ 45 | -------------------------------------------------------------------------------- /source/backend/public/rra_print.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Printing helper functions for RRA. 6 | //============================================================================= 7 | 8 | #ifndef RRA_BACKEND_PUBLIC_RRA_PRINT_H_ 9 | #define RRA_BACKEND_PUBLIC_RRA_PRINT_H_ 10 | 11 | #include 12 | 13 | #include "rra_error.h" 14 | 15 | /// Callback function for printing. 16 | typedef void (*RraPrintingCallback)(const char* msg); 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif // #ifdef __cplusplus 21 | 22 | /// @brief Set the printing callback for backend functions to do logging. 23 | /// 24 | /// @param [in] callback_func The callback function to use for printing. 25 | /// @param [in] enable_printing Enable the print function that prints to stdout if no callback specified. 26 | /// May be useful to disable in case the backend is being used outside of RRA. 27 | void RraSetPrintingCallback(RraPrintingCallback callback_func, bool enable_printing); 28 | 29 | /// @brief Printing function to use. Will use printing function set with 30 | /// RraSetPrintingCallback. If nothing is set, then 31 | /// printf will be used. 32 | /// 33 | /// @param [in] format The formatting string. 34 | /// @param [in] ... Variable parameters determined by format. 35 | void RraPrint(const char* format, ...); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif // #ifdef __cplusplus 40 | #endif // #ifndef RRA_BACKEND_PUBLIC_RRA_PRINT_H_ 41 | -------------------------------------------------------------------------------- /source/backend/public/rra_rtip_info.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Definition for the public raytracing IP level info interface. 6 | //============================================================================= 7 | 8 | #ifndef RRA_BACKEND_PUBLIC_RRA_RTIP_INFO_H_ 9 | #define RRA_BACKEND_PUBLIC_RRA_RTIP_INFO_H_ 10 | 11 | #include 12 | #include "bvh/gpu_def.h" 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif // #ifdef __cplusplus 17 | 18 | /// @brief Get the ray tracing IP level that was used when the application was captured. 19 | /// 20 | /// @return The RtIp level. 21 | uint32_t RraRtipInfoGetRaytracingIpLevel(); 22 | 23 | /// @brief Get whether or not the RtIp level of this capture supports oriented bounding boxes. 24 | /// 25 | /// @return True if the current RtIp level supports oriented bounding boxes. 26 | bool RraRtipInfoGetOBBSupported(); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif // #ifdef __cplusplus 31 | #endif // RRA_BACKEND_PUBLIC_RRA_RTIP_INFO_H_ 32 | -------------------------------------------------------------------------------- /source/backend/rra_api_info.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation for the API info interface. 6 | //============================================================================= 7 | 8 | #include "public/rra_api_info.h" 9 | 10 | #include "rra_data_set.h" 11 | 12 | // External reference to the global dataset. 13 | extern RraDataSet data_set_; 14 | 15 | const char* RraApiInfoGetApiName() 16 | { 17 | return data_set_.api_info.GetApiName(); 18 | } 19 | 20 | bool RraApiInfoIsVulkan() 21 | { 22 | return data_set_.api_info.IsVulkan(); 23 | } 24 | -------------------------------------------------------------------------------- /source/backend/rra_assert.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation of assert. 6 | //============================================================================= 7 | 8 | #include "public/rra_assert.h" 9 | 10 | #include // for malloc() 11 | 12 | #ifdef _WIN32 13 | #define WIN32_LEAN_AND_MEAN 14 | #include // required for OutputDebugString() 15 | #include // required for sprintf_s 16 | #endif // #ifndef _WIN32 17 | 18 | static RraAssertCallback s_assert_callback; 19 | 20 | // set the printing callback function 21 | void RraAssertSetPrintingCallback(RraAssertCallback callback) 22 | { 23 | s_assert_callback = callback; 24 | return; 25 | } 26 | 27 | // implementation of assert reporting 28 | bool RraAssertReport(const char* file, int32_t line, const char* condition, const char* message) 29 | { 30 | if (!file) 31 | { 32 | return true; 33 | } 34 | 35 | #ifdef _WIN32 36 | // form the final assertion string and output to the TTY. 37 | const size_t buffer_size = (size_t)snprintf(nullptr, 0, "%s(%d): ASSERTION FAILED. %s\n", file, line, message ? message : condition) + 1; 38 | char* temp_buffer = static_cast(malloc(buffer_size)); 39 | if (!temp_buffer) 40 | { 41 | return true; 42 | } 43 | 44 | if (!message) 45 | { 46 | sprintf_s(temp_buffer, buffer_size, "%s(%d): ASSERTION FAILED. %s\n", file, line, condition); 47 | } 48 | else 49 | { 50 | sprintf_s(temp_buffer, buffer_size, "%s(%d): ASSERTION FAILED. %s\n", file, line, message); 51 | } 52 | 53 | if (!s_assert_callback) 54 | { 55 | OutputDebugStringA(temp_buffer); 56 | } 57 | else 58 | { 59 | s_assert_callback(temp_buffer); 60 | } 61 | 62 | // free the buffer. 63 | free(temp_buffer); 64 | 65 | #else 66 | RRA_UNUSED(line); 67 | RRA_UNUSED(condition); 68 | RRA_UNUSED(message); 69 | #endif 70 | 71 | return true; 72 | } 73 | -------------------------------------------------------------------------------- /source/backend/rra_blas_impl.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Definition for the BLAS interface. 6 | /// 7 | /// Contains all functions specific to the BLAS. 8 | //============================================================================= 9 | 10 | #ifndef RRA_BACKEND_RRA_BLAS_IMPL_H_ 11 | #define RRA_BACKEND_RRA_BLAS_IMPL_H_ 12 | 13 | #include "bvh/dxr_definitions.h" 14 | #include "bvh/rtip11/encoded_rt_ip_11_bottom_level_bvh.h" 15 | #include "public/rra_blas.h" 16 | #include "bvh/rtip31/primitive_node.h" 17 | 18 | /// @brief Get a pointer to the BLAS from the blas index passed in. 19 | /// 20 | /// @param [in] blas_index The index of the BLAS to retrieve. 21 | /// 22 | /// @return A pointer to the TLAS (or nullptr if it doesn't exist). 23 | rta::EncodedBottomLevelBvh* RraBlasGetBlasFromBlasIndex(uint64_t blas_index); 24 | 25 | /// @brief Get the surface area for a given triangle node. 26 | /// 27 | /// @param [in] triangle_node Reference to the triangle node whose surface area is to be calculated. 28 | /// @param [in] tri_count Number of triangles in triangle node. 29 | /// 30 | /// @return The triangle node surface area. 31 | float RraBlasGetTriangleSurfaceArea(const dxr::amd::TriangleNode& triangle_node, uint32_t tri_count); 32 | 33 | /// @brief Get the surface area for a given BLAS node. 34 | /// 35 | /// @param [in] blas The bottom level acceleration structure. 36 | /// @param [in] node_ptr The node pointer whose surface area is to be calculated. 37 | /// @param [out] out_surface_area The calculated surface area. 38 | /// 39 | /// @return RraOk if successful, an error code if not. 40 | RraErrorCode RraBlasGetSurfaceAreaImpl(const rta::EncodedBottomLevelBvh* blas, const dxr::amd::NodePointer* node_ptr, float* out_surface_area); 41 | 42 | #endif // RRA_BACKEND_RRA_BLAS_IMPL_H_ 43 | -------------------------------------------------------------------------------- /source/backend/rra_configuration.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Global configuration values for the RRA backend. 6 | //============================================================================= 7 | 8 | #ifndef RRA_BACKEND_RRA_CONFIGURATION_H_ 9 | #define RRA_BACKEND_RRA_CONFIGURATION_H_ 10 | 11 | /// The maximum nubmer of file path. 12 | #define RRA_MAXIMUM_FILE_PATH (8192) 13 | 14 | #define RRA_STRING_BUFFER_SIZE (2048) 15 | 16 | #endif // #ifndef RRA_BACKEND_RRA_CONFIGURATION_H_ 17 | -------------------------------------------------------------------------------- /source/backend/rra_print.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation of printing helper functions for RRA. 6 | //============================================================================= 7 | 8 | #include "public/rra_print.h" 9 | 10 | #include 11 | #include // for sprintf 12 | #include // for strcat 13 | 14 | #include "rra_configuration.h" 15 | 16 | #ifndef _WIN32 17 | #include "public/linux/safe_crt.h" 18 | #else 19 | #include 20 | #endif 21 | 22 | // The printing callback function. 23 | static RraPrintingCallback printing_func = nullptr; 24 | static bool is_printing_enabled = false; 25 | 26 | void RraSetPrintingCallback(RraPrintingCallback callback_func, bool enable_printing) 27 | { 28 | printing_func = callback_func; 29 | is_printing_enabled = enable_printing; 30 | } 31 | 32 | void RraPrint(const char* format, ...) 33 | { 34 | if (!is_printing_enabled) 35 | { 36 | return; 37 | } 38 | 39 | va_list args; 40 | va_start(args, format); 41 | 42 | if (printing_func == nullptr) 43 | { 44 | char buffer[RRA_STRING_BUFFER_SIZE]; 45 | vsnprintf(buffer, RRA_STRING_BUFFER_SIZE, format, args); 46 | #ifdef _WIN32 47 | const size_t len = strlen(buffer); 48 | buffer[len] = '\n'; 49 | buffer[len + 1] = '\0'; 50 | OutputDebugString(buffer); 51 | #else 52 | printf("%s\n", buffer); 53 | #endif 54 | } 55 | else 56 | { 57 | char buffer[RRA_STRING_BUFFER_SIZE]; 58 | vsnprintf(buffer, RRA_STRING_BUFFER_SIZE, format, args); 59 | printing_func(buffer); 60 | } 61 | 62 | va_end(args); 63 | } 64 | -------------------------------------------------------------------------------- /source/backend/rra_rtip_info.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation for the raytracing IP level info interface. 6 | //============================================================================= 7 | 8 | #include "public/rra_rtip_info.h" 9 | 10 | #include "rra_data_set.h" 11 | 12 | // External reference to the global dataset. 13 | extern RraDataSet data_set_; 14 | 15 | uint32_t RraRtipInfoGetRaytracingIpLevel() 16 | { 17 | return (uint32_t)data_set_.rtip_level; 18 | } 19 | 20 | bool RraRtipInfoGetOBBSupported() 21 | { 22 | if (data_set_.rtip_level == rta::RayTracingIpLevel::RtIp3_1) 23 | { 24 | return true; 25 | } 26 | return false; 27 | } 28 | -------------------------------------------------------------------------------- /source/backend/surface_area_heuristic.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Definition of the Surface area heuristic calculator. 6 | //============================================================================= 7 | 8 | #ifndef RRA_BACKEND_SURFACE_AREA_HEURISTIC_H_ 9 | #define RRA_BACKEND_SURFACE_AREA_HEURISTIC_H_ 10 | 11 | #include "rra_data_set.h" 12 | 13 | // Surface area heuristic calculator functions. Used only by the backend; no public interface. 14 | 15 | struct PrimitiveStructure; 16 | 17 | namespace rra 18 | { 19 | /// @brief Calculate the surface area heuristic values for all nodes in the TLASes and BLASes. 20 | /// 21 | /// @param [in] data_set The data set containing the loaded trace data. 22 | /// 23 | /// @return RraOk if successful, an error code if not. 24 | RraErrorCode CalculateSurfaceAreaHeuristics(RraDataSet& data_set); 25 | 26 | /// @brief Get the minimum surface area heuristic for a given node and its children. 27 | /// 28 | /// @param [in] bvh The acceleration structure where the node is located. 29 | /// @param [in] node_ptr The node of interest. 30 | /// @param [in] tri_only All non-triangle nodes will be ignored if this is true. 31 | /// 32 | /// @return The minimum surface area heuristic. 33 | float GetMinimumSurfaceAreaHeuristic(const rta::IBvh* bvh, const dxr::amd::NodePointer node_ptr, bool tri_only); 34 | 35 | /// @brief Get the average (mean) surface area heuristic for a given node and its children. 36 | /// 37 | /// @param [in] bvh The acceleration structure where the node is located. 38 | /// @param [in] node_ptr The node of interest. 39 | /// @param [in] tri_only All non-triangle nodes will be ignored if this is true. 40 | /// 41 | /// @return The average surface area heuristic. 42 | float GetAverageSurfaceAreaHeuristic(const rta::IBvh* bvh, const dxr::amd::NodePointer node_ptr, bool tri_only); 43 | } // namespace rra 44 | 45 | #endif // RRA_BACKEND_SURFACE_AREA_HEURISTIC_H_ 46 | -------------------------------------------------------------------------------- /source/frontend/io/camera_controllers.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Definitions to list camera controllers. 6 | //============================================================================= 7 | 8 | #include "camera_controllers.h" 9 | 10 | #include "cad_camera_controller.h" 11 | #include "fps_camera_controller.h" 12 | #include "axis_free_camera_controller.h" 13 | 14 | namespace rra 15 | { 16 | static const std::string kControlStyleSuffix = " control style"; 17 | 18 | CameraControllers::CameraControllers() 19 | { 20 | ViewerIO* controller = nullptr; 21 | 22 | controller = new CADController(); 23 | controllers_[controller->GetName() + kControlStyleSuffix] = controller; 24 | 25 | controller = new FPSController(); 26 | controllers_[controller->GetName() + kControlStyleSuffix] = controller; 27 | 28 | controller = new AxisFreeController(); 29 | controllers_[controller->GetName() + kControlStyleSuffix] = controller; 30 | } 31 | 32 | CameraControllers::~CameraControllers() 33 | { 34 | for (auto& i : controllers_) 35 | { 36 | delete i.second; 37 | } 38 | } 39 | 40 | std::vector CameraControllers::GetControllerNames() const 41 | { 42 | std::vector names; 43 | names.resize(controllers_.size()); 44 | for (auto& i : controllers_) 45 | { 46 | names[i.second->GetComboBoxIndex()] = i.first; 47 | } 48 | return names; 49 | } 50 | 51 | ViewerIO* CameraControllers::GetControllerByName(const std::string& controller_name) 52 | { 53 | return controllers_[controller_name]; 54 | } 55 | } // namespace rra 56 | -------------------------------------------------------------------------------- /source/frontend/io/camera_controllers.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Declaration to list camera controllers. 6 | //============================================================================= 7 | 8 | #ifndef RRA_CAMERA_CONTROLLERS_CAMERA_CONTROLLERS_H_ 9 | #define RRA_CAMERA_CONTROLLERS_CAMERA_CONTROLLERS_H_ 10 | 11 | #include "viewer_io.h" 12 | #include 13 | 14 | namespace rra 15 | { 16 | /// @brief A class to magane camera controllers. 17 | class CameraControllers 18 | { 19 | public: 20 | /// @brief Constructor. 21 | CameraControllers(); 22 | 23 | /// @brief Destructor. 24 | ~CameraControllers(); 25 | 26 | /// @brief Get the controller names. 27 | /// 28 | /// @returns A list of controller names. 29 | std::vector GetControllerNames() const; 30 | 31 | /// @brief Get a controller by its name. 32 | /// 33 | /// @param [in] controller_name The controller's name. 34 | /// 35 | /// @returns the controller with the matching name. 36 | ViewerIO* GetControllerByName(const std::string& controller_name); 37 | 38 | private: 39 | std::map controllers_; ///< The camera controllers. 40 | }; 41 | } // namespace rra 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /source/frontend/mac_osx/MacOSXBundleInfo.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${MACOSX_BUNDLE_EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | ${MACOSX_BUNDLE_ICON_FILE} 11 | CFBundleIdentifier 12 | com.AMD.RRA 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleLongVersionString 16 | RRA V1.0.XXXX 17 | CFBundleName 18 | RRA 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 000000 27 | CSResourcesFileMapped 28 | 29 | NSHumanReadableCopyright 30 | Copyright © 2021 AMD. All rights reserved 31 | NSPrincipalClass 32 | NsApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /source/frontend/mac_osx/rra.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Tools/radeon_raytracing_analyzer/1fe3c6fb6da27b1a38726969c7c1874d274f567d/source/frontend/mac_osx/rra.icns -------------------------------------------------------------------------------- /source/frontend/managers/message_manager.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation of the MessageManager class. 6 | /// 7 | /// Basically a bunch of signals that other UI elements can observe and react 8 | /// to. 9 | /// 10 | //============================================================================= 11 | 12 | #include "managers/message_manager.h" 13 | 14 | namespace rra 15 | { 16 | // Single instance of the Message Manager. 17 | static MessageManager message_manager; 18 | 19 | MessageManager& MessageManager::Get() 20 | { 21 | return message_manager; 22 | } 23 | } // namespace rra 24 | -------------------------------------------------------------------------------- /source/frontend/models/acceleration_structure_flags_table_item_delegate.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation of RRA's instance flags table item delegate. 6 | //============================================================================= 7 | 8 | #include "models/acceleration_structure_flags_table_item_delegate.h" 9 | #include "models/acceleration_structure_flags_table_item_model.h" 10 | #include "qpainter.h" 11 | 12 | FlagTableItemDelegate::FlagTableItemDelegate(QObject* parent) 13 | : TableItemDelegate(parent) 14 | { 15 | } 16 | 17 | FlagTableItemDelegate::~FlagTableItemDelegate() 18 | { 19 | } 20 | 21 | void FlagTableItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const 22 | { 23 | QColor color = index.data(Qt::ForegroundRole).value(); 24 | 25 | // We specify the color for the instance flags so we draw it manually. 26 | if (color.isValid()) 27 | { 28 | QString flag_text = index.data(Qt::DisplayRole).value(); 29 | 30 | painter->setPen(color); 31 | painter->drawText(option.rect, Qt::AlignLeft | Qt::AlignVCenter, flag_text); 32 | } 33 | else 34 | { 35 | TableItemDelegate::paint(painter, option, index); 36 | } 37 | } 38 | 39 | bool FlagTableItemDelegate::CheckboxAt(int row, int column) const 40 | { 41 | Q_UNUSED(row); 42 | switch (column) 43 | { 44 | case rra::kInstanceFlagsTableColumnCheckbox: 45 | return true; 46 | 47 | default: 48 | return false; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /source/frontend/models/acceleration_structure_flags_table_item_delegate.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Definition of RRA's instance flag table item delegate. 6 | //============================================================================= 7 | 8 | #ifndef RRA_MODELS_TLAS_INSTANCE_FLAGS_TABLE_ITEM_DELEGATE_H_ 9 | #define RRA_MODELS_TLAS_INSTANCE_FLAGS_TABLE_ITEM_DELEGATE_H_ 10 | 11 | #include "models/table_item_delegate.h" 12 | 13 | class FlagTableItemDelegate : public TableItemDelegate 14 | { 15 | Q_OBJECT 16 | public: 17 | /// @brief Constructor. 18 | /// 19 | /// @param [in] parent The parent object. 20 | FlagTableItemDelegate(QObject* parent = 0); 21 | 22 | /// @brief Destructor. 23 | virtual ~FlagTableItemDelegate(); 24 | 25 | /// @brief Custom painting for the flag table item. 26 | /// 27 | /// @param painter The Qt painter. 28 | /// @param option The Qt option. 29 | /// @param index The Qt index. 30 | virtual void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override; 31 | 32 | /// @brief Test if there is a checkbox at the given row and column. 33 | /// 34 | /// Called from the paint function to use a custom painter to draw checkboxes. 35 | /// This function can be overriden in derived classes to specify rows and 36 | /// columns containing checkboxes. By default, no checkboxes are present. 37 | /// 38 | /// @param [in] row The row to check. 39 | /// @param [in] column The column to check. 40 | /// 41 | /// @return true if a checkbox is in the specified cell, false if not. 42 | virtual bool CheckboxAt(int row, int column) const override; 43 | }; 44 | 45 | #endif // RRA_MODELS_TLAS_INSTANCE_FLAGS_TABLE_ITEM_DELEGATE_H_ 46 | -------------------------------------------------------------------------------- /source/frontend/models/blas/blas_geometries_table_item_delegate.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation of RRA's geometry list table item delegate. 6 | //============================================================================= 7 | 8 | #include "models/blas/blas_geometries_table_item_delegate.h" 9 | 10 | #include "models/blas/blas_geometries_item_model.h" 11 | 12 | GeometriesTableItemDelegate::GeometriesTableItemDelegate(QObject* parent) 13 | : TableItemDelegate(parent) 14 | { 15 | } 16 | 17 | GeometriesTableItemDelegate::GeometriesTableItemDelegate(ScaledTableView* table_view, QObject* parent) 18 | : TableItemDelegate(table_view, parent) 19 | { 20 | } 21 | 22 | GeometriesTableItemDelegate::~GeometriesTableItemDelegate() 23 | { 24 | } 25 | 26 | bool GeometriesTableItemDelegate::CheckboxAt(int row, int column) const 27 | { 28 | Q_UNUSED(row); 29 | switch (column) 30 | { 31 | case rra::kBlasGeometriesColumnGeometryFlagOpaque: 32 | case rra::kBlasGeometriesColumnGeometryFlagNoDuplicateAnyHit: 33 | return true; 34 | 35 | default: 36 | return false; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /source/frontend/models/blas/blas_geometries_table_item_delegate.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Definition of RRA's geometry list table item delegate. 6 | //============================================================================= 7 | 8 | #ifndef RRA_MODELS_GEOMETRIES_TABLE_ITEM_DELEGATE_H_ 9 | #define RRA_MODELS_GEOMETRIES_TABLE_ITEM_DELEGATE_H_ 10 | 11 | #include "models/table_item_delegate.h" 12 | 13 | class ScaledTableView; 14 | 15 | class GeometriesTableItemDelegate : public TableItemDelegate 16 | { 17 | Q_OBJECT 18 | public: 19 | /// @brief Constructor. 20 | /// 21 | /// @param [in] parent The parent object. 22 | GeometriesTableItemDelegate(QObject* parent = 0); 23 | 24 | /// @brief Constructor. 25 | /// 26 | /// @param [in] parent The parent object. 27 | /// @param [in] table_view The table view that contains this widget. 28 | GeometriesTableItemDelegate(ScaledTableView* table_view, QObject* parent = 0); 29 | 30 | /// @brief Destructor. 31 | virtual ~GeometriesTableItemDelegate(); 32 | 33 | /// @brief Test if there is a checkbox at the given row and column. 34 | /// 35 | /// Called from the paint function to use a custom painter to draw checkboxes. 36 | /// This function can be overriden in derived classes to specify rows and 37 | /// columns containing checkboxes. By default, no checkboxes are present. 38 | /// 39 | /// @param [in] row The row to check. 40 | /// @param [in] column The column to check. 41 | /// 42 | /// @return true if a checkbox is in the specified cell, false if not. 43 | bool CheckboxAt(int row, int column) const; 44 | }; 45 | 46 | #endif // RRA_MODELS_GEOMETRIES_TABLE_ITEM_DELEGATE_H_ 47 | -------------------------------------------------------------------------------- /source/frontend/models/blas/blas_triangles_table_item_delegate.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation of RRA's triangle list table item delegate. 6 | //============================================================================= 7 | 8 | #include "models/blas/blas_triangles_table_item_delegate.h" 9 | 10 | #include "models/blas/blas_triangles_item_model.h" 11 | 12 | TrianglesTableItemDelegate::TrianglesTableItemDelegate(QObject* parent) 13 | : TableItemDelegate(parent) 14 | { 15 | } 16 | 17 | TrianglesTableItemDelegate::TrianglesTableItemDelegate(ScaledTableView* table_view, QObject* parent) 18 | : TableItemDelegate(table_view, parent) 19 | { 20 | } 21 | 22 | TrianglesTableItemDelegate::~TrianglesTableItemDelegate() 23 | { 24 | } 25 | 26 | bool TrianglesTableItemDelegate::Vec3At(int row, int column) const 27 | { 28 | Q_UNUSED(row); 29 | switch (column) 30 | { 31 | case rra::kBlasTrianglesColumnVertex0: 32 | case rra::kBlasTrianglesColumnVertex1: 33 | case rra::kBlasTrianglesColumnVertex2: 34 | return true; 35 | 36 | default: 37 | return false; 38 | } 39 | } 40 | 41 | bool TrianglesTableItemDelegate::CheckboxAt(int row, int column) const 42 | { 43 | Q_UNUSED(row); 44 | switch (column) 45 | { 46 | case rra::kBlasTrianglesColumnGeometryFlagOpaque: 47 | case rra::kBlasTrianglesColumnGeometryFlagNoDuplicateAnyHit: 48 | case rra::kBlasTrianglesColumnActive: 49 | return true; 50 | 51 | default: 52 | return false; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /source/frontend/models/blas/blas_triangles_table_item_delegate.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Definition of RRA's triangle list table item delegate. 6 | //============================================================================= 7 | 8 | #ifndef RRA_MODELS_TRIANGLES_TABLE_ITEM_DELEGATE_H_ 9 | #define RRA_MODELS_TRIANGLES_TABLE_ITEM_DELEGATE_H_ 10 | 11 | #include "models/table_item_delegate.h" 12 | 13 | class ScaledTableView; 14 | 15 | class TrianglesTableItemDelegate : public TableItemDelegate 16 | { 17 | Q_OBJECT 18 | public: 19 | /// @brief Constructor. 20 | /// 21 | /// @param [in] parent The parent object. 22 | TrianglesTableItemDelegate(QObject* parent = 0); 23 | 24 | /// @brief Constructor. 25 | /// 26 | /// @param [in] parent The parent object. 27 | /// @param [in] table_view The table view that contains this widget. 28 | TrianglesTableItemDelegate(ScaledTableView* table_view, QObject* parent = 0); 29 | 30 | /// @brief Destructor. 31 | virtual ~TrianglesTableItemDelegate(); 32 | 33 | /// @brief Test if there is a vec3 at the given row and column. 34 | /// 35 | /// @param [in] row The row to check. 36 | /// @param [in] column The column to check. 37 | /// 38 | /// @return true if a vec3 is in the specified cell, false if not. 39 | virtual bool Vec3At(int row, int column) const override; 40 | 41 | /// @brief Test if there is a checkbox at the given row and column. 42 | /// 43 | /// Called from the paint function to use a custom painter to draw checkboxes. 44 | /// This function can be overriden in derived classes to specify rows and 45 | /// columns containing checkboxes. By default, no checkboxes are present. 46 | /// 47 | /// @param [in] row The row to check. 48 | /// @param [in] column The column to check. 49 | /// 50 | /// @return true if a checkbox is in the specified cell, false if not. 51 | bool CheckboxAt(int row, int column) const; 52 | }; 53 | 54 | #endif // RRA_MODELS_TRIANGLES_TABLE_ITEM_DELEGATE_H_ 55 | -------------------------------------------------------------------------------- /source/frontend/models/instance_list_table_item_delegate.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation of RRA's instance list table item delegate. 6 | //============================================================================= 7 | 8 | #include "models/instance_list_table_item_delegate.h" 9 | 10 | #include "models/instances_item_model.h" 11 | 12 | InstanceListTableItemDelegate::InstanceListTableItemDelegate(QObject* parent) 13 | : TableItemDelegate(parent) 14 | { 15 | } 16 | 17 | InstanceListTableItemDelegate::~InstanceListTableItemDelegate() 18 | { 19 | } 20 | 21 | bool InstanceListTableItemDelegate::CheckboxAt(int row, int column) const 22 | { 23 | Q_UNUSED(row); 24 | switch (column) 25 | { 26 | case rra::kInstancesColumnCullDisableFlag: 27 | case rra::kInstancesColumnFlipFacingFlag: 28 | case rra::kInstancesColumnForceOpaqueFlag: 29 | case rra::kInstancesColumnForceNoOpaqueFlag: 30 | return true; 31 | 32 | default: 33 | return false; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /source/frontend/models/instance_list_table_item_delegate.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Definition of RRA's instance list table item delegate. 6 | //============================================================================= 7 | 8 | #ifndef RRA_MODELS_INSTANCE_LIST_TABLE_ITEM_DELEGATE_H_ 9 | #define RRA_MODELS_INSTANCE_LIST_TABLE_ITEM_DELEGATE_H_ 10 | 11 | #include "models/table_item_delegate.h" 12 | 13 | class InstanceListTableItemDelegate : public TableItemDelegate 14 | { 15 | Q_OBJECT 16 | public: 17 | /// @brief Constructor. 18 | /// 19 | /// @param [in] parent The parent object. 20 | InstanceListTableItemDelegate(QObject* parent = 0); 21 | 22 | /// @brief Destructor. 23 | virtual ~InstanceListTableItemDelegate(); 24 | 25 | /// @brief Test if there is a checkbox at the given row and column. 26 | /// 27 | /// Called from the paint function to use a custom painter to draw checkboxes. 28 | /// This function can be overriden in derived classes to specify rows and 29 | /// columns containing checkboxes. By default, no checkboxes are present. 30 | /// 31 | /// @param [in] row The row to check. 32 | /// @param [in] column The column to check. 33 | /// 34 | /// @return true if a checkbox is in the specified cell, false if not. 35 | virtual bool CheckboxAt(int row, int column) const override; 36 | }; 37 | 38 | #endif // RRA_MODELS_INSTANCE_LIST_TABLE_ITEM_DELEGATE_H_ 39 | -------------------------------------------------------------------------------- /source/frontend/models/ray/ray_history_image_generator.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Ray history image generator. 6 | //============================================================================= 7 | 8 | #include "ray_history_image_generator.h" 9 | #include "vk/vk_graphics_context.h" 10 | #include "public/renderer_types.h" 11 | 12 | namespace rra 13 | { 14 | void GraphicsContextCreateRayHistoryStatsBuffer(uint32_t dispatch_id, renderer::DispatchIdData* out_max_count) 15 | { 16 | auto vk_graphics_context = rra::renderer::GetVkGraphicsContext(); 17 | vk_graphics_context->CreateRayHistoryStatsBuffer(dispatch_id, out_max_count); 18 | } 19 | 20 | QImage GraphicsContextRenderRayHistoryImage(uint32_t heatmap_min, 21 | uint32_t heatmap_max, 22 | uint32_t ray_index, 23 | uint32_t reshaped_x, 24 | uint32_t reshaped_y, 25 | uint32_t reshaped_z, 26 | renderer::RayHistoryColorMode color_mode, 27 | uint32_t slice_index, 28 | renderer::SlicePlane slice_plane) 29 | { 30 | auto vk_graphics_context = rra::renderer::GetVkGraphicsContext(); 31 | return vk_graphics_context->RenderRayHistoryImage( 32 | heatmap_min, heatmap_max, ray_index, reshaped_x, reshaped_y, reshaped_z, color_mode, slice_index, slice_plane); 33 | } 34 | 35 | void GraphicsContextSetRayHistoryHeatmapData(const renderer::HeatmapData& heatmap_data) 36 | { 37 | auto vk_graphics_context = rra::renderer::GetVkGraphicsContext(); 38 | vk_graphics_context->SetRayHistoryHeatmapData(heatmap_data); 39 | } 40 | } // namespace rra 41 | -------------------------------------------------------------------------------- /source/frontend/models/ray/ray_list_table_item_delegate.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation of RRA's blas list table item delegate. 6 | //============================================================================= 7 | 8 | #include "models/ray/ray_list_table_item_delegate.h" 9 | 10 | #include "models/ray/ray_history_model.h" 11 | 12 | RayListTableItemDelegate::RayListTableItemDelegate(QObject* parent) 13 | : TableItemDelegate(parent) 14 | { 15 | } 16 | 17 | RayListTableItemDelegate::~RayListTableItemDelegate() 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /source/frontend/models/ray/ray_list_table_item_delegate.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Definition of RRA's ray list table item delegate. 6 | //============================================================================= 7 | 8 | #ifndef RRA_MODELS_RAY_LIST_TABLE_ITEM_DELEGATE_H_ 9 | #define RRA_MODELS_RAY_LIST_TABLE_ITEM_DELEGATE_H_ 10 | 11 | #include "models/table_item_delegate.h" 12 | 13 | class RayListTableItemDelegate : public TableItemDelegate 14 | { 15 | Q_OBJECT 16 | public: 17 | /// @brief Constructor. 18 | /// 19 | /// @param [in] parent The parent object. 20 | RayListTableItemDelegate(QObject* parent = 0); 21 | 22 | /// @brief Destructor. 23 | virtual ~RayListTableItemDelegate(); 24 | }; 25 | 26 | #endif // RRA_MODELS_RAY_LIST_TABLE_ITEM_DELEGATE_H_ 27 | -------------------------------------------------------------------------------- /source/frontend/models/side_panels/side_panel_model.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Header for the side pane model base class. 6 | //============================================================================= 7 | 8 | #ifndef RRA_MODELS_SIDE_PANELS_SIDE_PANEL_MODEL_H_ 9 | #define RRA_MODELS_SIDE_PANELS_SIDE_PANEL_MODEL_H_ 10 | 11 | #include "qt_common/utils/model_view_mapper.h" 12 | 13 | #include "public/renderer_adapter.h" 14 | 15 | namespace rra 16 | { 17 | /// @brief The side panel model base class declaration. 18 | class SidePanelModel : public ModelViewMapper 19 | { 20 | public: 21 | /// @brief Constructor. 22 | explicit SidePanelModel(uint32_t model_count) 23 | : ModelViewMapper(model_count) 24 | { 25 | } 26 | 27 | /// @brief Destructor. 28 | virtual ~SidePanelModel() = default; 29 | 30 | /// @brief Set the renderer adapter instance. 31 | /// 32 | /// @param [in] adapter The renderer adapter instance. 33 | virtual void SetRendererAdapters(const rra::renderer::RendererAdapterMap& adapters) = 0; 34 | 35 | /// @brief Update the model with the current BVH state. 36 | /// 37 | /// Propagate the state to the UI. 38 | virtual void Update() = 0; 39 | }; 40 | } // namespace rra 41 | 42 | #endif // #define RRA_MODELS_SIDE_PANELS_SIDE_PANEL_MODEL_H_ 43 | -------------------------------------------------------------------------------- /source/frontend/models/tlas/blas_list_table_item_delegate.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation of RRA's blas list table item delegate. 6 | //============================================================================= 7 | 8 | #include "models/tlas/blas_list_table_item_delegate.h" 9 | 10 | #include "models/tlas/blas_list_model.h" 11 | 12 | BlasListTableItemDelegate::BlasListTableItemDelegate(QObject* parent) 13 | : TableItemDelegate(parent) 14 | { 15 | } 16 | 17 | BlasListTableItemDelegate::~BlasListTableItemDelegate() 18 | { 19 | } 20 | 21 | bool BlasListTableItemDelegate::CheckboxAt(int row, int column) const 22 | { 23 | Q_UNUSED(row); 24 | switch (column) 25 | { 26 | case rra::kBlasListColumnAllowCompaction: 27 | case rra::kBlasListColumnAllowUpdate: 28 | case rra::kBlasListColumnLowMemory: 29 | return true; 30 | 31 | default: 32 | return false; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /source/frontend/models/tlas/blas_list_table_item_delegate.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Definition of RRA's blas list table item delegate. 6 | //============================================================================= 7 | 8 | #ifndef RRA_MODELS_BLAS_LIST_TABLE_ITEM_DELEGATE_H_ 9 | #define RRA_MODELS_BLAS_LIST_TABLE_ITEM_DELEGATE_H_ 10 | 11 | #include "models/table_item_delegate.h" 12 | 13 | class BlasListTableItemDelegate : public TableItemDelegate 14 | { 15 | Q_OBJECT 16 | public: 17 | /// @brief Constructor. 18 | /// 19 | /// @param [in] parent The parent object. 20 | BlasListTableItemDelegate(QObject* parent = 0); 21 | 22 | /// @brief Destructor. 23 | virtual ~BlasListTableItemDelegate(); 24 | 25 | /// @brief Test if there is a checkbox at the given row and column. 26 | /// 27 | /// Called from the paint function to use a custom painter to draw checkboxes. 28 | /// This function can be overriden in derived classes to specify rows and 29 | /// columns containing checkboxes. By default, no checkboxes are present. 30 | /// 31 | /// @param [in] row The row to check. 32 | /// @param [in] column The column to check. 33 | /// 34 | /// @return true if a checkbox is in the specified cell, false if not. 35 | virtual bool CheckboxAt(int row, int column) const override; 36 | }; 37 | 38 | #endif // RRA_MODELS_BLAS_LIST_TABLE_ITEM_DELEGATE_H_ 39 | -------------------------------------------------------------------------------- /source/frontend/models/tree_view_proxy_model.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation of a proxy filter used to filter a tree view. 6 | //============================================================================= 7 | 8 | #include "models/tree_view_proxy_model.h" 9 | 10 | #include "models/acceleration_structure_tree_view_item.h" 11 | 12 | namespace rra 13 | { 14 | TreeViewProxyModel::TreeViewProxyModel(QObject* parent) 15 | : QSortFilterProxyModel(parent) 16 | { 17 | } 18 | 19 | TreeViewProxyModel::~TreeViewProxyModel() 20 | { 21 | } 22 | 23 | void TreeViewProxyModel::SetSearchText(const QString& search_text) 24 | { 25 | search_text_ = search_text; 26 | invalidate(); 27 | } 28 | 29 | bool TreeViewProxyModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const 30 | { 31 | QModelIndex index = sourceModel()->index(source_row, 0, source_parent); 32 | auto item_data = qvariant_cast(index.data(Qt::DisplayRole)); 33 | return (item_data.display_name.contains(search_text_)); 34 | } 35 | 36 | } // namespace rra 37 | -------------------------------------------------------------------------------- /source/frontend/models/tree_view_proxy_model.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Header for a proxy filter used to filter a tree view. 6 | //============================================================================= 7 | 8 | #ifndef RRA_MODELS_TREE_VIEW_PROXY_MODEL_H_ 9 | #define RRA_MODELS_TREE_VIEW_PROXY_MODEL_H_ 10 | 11 | #include 12 | #include 13 | 14 | namespace rra 15 | { 16 | /// @brief Base class to filter out and sort a table. 17 | class TreeViewProxyModel : public QSortFilterProxyModel 18 | { 19 | Q_OBJECT 20 | 21 | public: 22 | /// @brief Constructor. 23 | /// 24 | /// @param [in] parent The parent widget. 25 | explicit TreeViewProxyModel(QObject* parent = nullptr); 26 | 27 | /// @brief Destructor. 28 | virtual ~TreeViewProxyModel(); 29 | 30 | /// @brief Notify the proxy model of the search string. 31 | /// 32 | /// @param search_text The search string the user has selected. 33 | void SetSearchText(const QString& search_text); 34 | 35 | private: 36 | /// @brief Make the filter run across multiple columns. 37 | /// 38 | /// @param [in] source_row The target row. 39 | /// @param [in] source_parent The source parent. 40 | /// 41 | /// @return true if the row passed the filter, false if not. 42 | virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override; 43 | 44 | QString search_text_; ///< The search string. 45 | }; 46 | } // namespace rra 47 | 48 | #endif // RRA_MODELS_TREE_VIEW_PROXY_MODEL_H_ 49 | -------------------------------------------------------------------------------- /source/frontend/settings/geometry_settings.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Define the window geometry settings. 6 | //============================================================================= 7 | 8 | #ifndef RRA_SETTINGS_GEOMETRY_SETTINGS_H_ 9 | #define RRA_SETTINGS_GEOMETRY_SETTINGS_H_ 10 | 11 | #include 12 | 13 | #include "settings/settings.h" 14 | 15 | namespace rra 16 | { 17 | class GeometrySettings 18 | { 19 | public: 20 | /// @brief Constructor. 21 | GeometrySettings(); 22 | 23 | /// @brief Destructor. 24 | ~GeometrySettings(); 25 | 26 | /// @brief Saves a widget's position, size and state in the settings file as a hex string. 27 | /// 28 | /// @param [in] widget Pointer to the widget who's geometry is to be saved. 29 | static void Save(QWidget* widget); 30 | 31 | /// @brief Updates a widget's position, size and state from the settings file. 32 | /// 33 | /// @param [in] widget Pointer to the widget who's geometry is to be restored. 34 | static bool Restore(QWidget* widget); 35 | 36 | /// @brief Adjust a widget's geometry so that it fits on a single monitor. 37 | /// 38 | /// @param [in] widget Pointer to the widget who's geometry is to be adjusted. 39 | static void Adjust(QWidget* widget); 40 | }; 41 | } // namespace rra 42 | 43 | #endif // RRA_SETTINGS_GEOMETRY_SETTINGS_H_ 44 | -------------------------------------------------------------------------------- /source/frontend/settings/settings_reader.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Header for the XML settings reader. 6 | //============================================================================= 7 | 8 | #ifndef RRA_SETTINGS_SETTINGS_READER_H_ 9 | #define RRA_SETTINGS_SETTINGS_READER_H_ 10 | 11 | #include 12 | #include 13 | 14 | #include "settings/settings.h" 15 | 16 | namespace rra 17 | { 18 | /// @brief Support for the XML settings reader. 19 | class SettingsReader 20 | { 21 | public: 22 | /// @brief Constructor. 23 | /// 24 | /// @param [in] settings Output settings class. 25 | explicit SettingsReader(Settings* settings); 26 | 27 | /// @brief Destructor. 28 | ~SettingsReader(); 29 | 30 | /// @brief Begin reading XML file and make sure it's valid. 31 | /// 32 | /// @param [in] device The XML file represented by a Qt IO device. 33 | bool Read(QIODevice* device); 34 | 35 | private: 36 | /// @brief Read global settings and recently used files section. 37 | void ReadSettingsAndRecents(); 38 | 39 | /// @brief Read settings list. 40 | void ReadSettings(); 41 | 42 | /// @brief Read individual settings. 43 | void ReadSetting(); 44 | 45 | /// @brief Read recently opened file list. 46 | void ReadRecentFiles(); 47 | 48 | /// @brief Read individual recently opened files. 49 | void ReadRecentFile(); 50 | 51 | QXmlStreamReader reader_; ///< Qt's XML stream. 52 | Settings* settings_; ///< Belongs to the caller, not this class. 53 | }; 54 | } // namespace rra 55 | 56 | #endif // RRA_SETTINGS_SETTINGS_READER_H_ 57 | -------------------------------------------------------------------------------- /source/frontend/settings/settings_writer.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Header for the XML settings writer. 6 | //============================================================================= 7 | 8 | #ifndef RRA_SETTINGS_SETTINGS_WRITER_H_ 9 | #define RRA_SETTINGS_SETTINGS_WRITER_H_ 10 | 11 | #include 12 | #include 13 | 14 | #include "settings/settings.h" 15 | 16 | namespace rra 17 | { 18 | /// @brief Support for XML settings writer. 19 | class SettingsWriter 20 | { 21 | public: 22 | /// @brief Constructor. 23 | /// 24 | /// @param [in] settings Output settings class. 25 | explicit SettingsWriter(Settings* settings); 26 | 27 | /// @brief Destructor. 28 | ~SettingsWriter(); 29 | 30 | /// @brief Begin writing XML file and make sure it's valid. 31 | /// 32 | /// @param [in] device The XML file represented by a Qt IO device. 33 | bool Write(QIODevice* device); 34 | 35 | private: 36 | /// @brief Write global settings and recently used files section. 37 | void WriteSettingsAndRecents(); 38 | 39 | /// @brief Write settings list. 40 | void WriteSettings(); 41 | 42 | /// @brief Write individual settings. 43 | /// 44 | /// @param [in] setting The Setting structure to write out. 45 | void WriteSetting(const Setting& setting); 46 | 47 | /// @brief Write recently opened file list. 48 | void WriteRecentFiles(); 49 | 50 | /// @brief Write individual recently opened files. 51 | /// 52 | /// @param [in] recent_file The name of the file to write. 53 | void WriteRecentFile(const RecentFileData& recent_file); 54 | 55 | QXmlStreamWriter writer_; ///< Qt's XML stream. 56 | Settings* settings_; ///< Belongs to the caller, not this class. 57 | }; 58 | } // namespace rra 59 | 60 | #endif // RRA_SETTINGS_SETTINGS_WRITER_H_ 61 | -------------------------------------------------------------------------------- /source/frontend/util/file_util.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation of useful utility functions. 6 | //============================================================================= 7 | 8 | #include "util/file_util.h" 9 | 10 | #ifdef _WIN32 11 | #include 12 | #include 13 | #else 14 | #include 15 | #include 16 | #include 17 | 18 | #include "public/linux/safe_crt.h" 19 | #endif 20 | 21 | #include 22 | 23 | #include "public/rra_assert.h" 24 | 25 | #include "settings/settings.h" 26 | 27 | QString file_util::GetFileLocation() 28 | { 29 | QString file_location = ""; 30 | 31 | #ifdef _WIN32 32 | LPWSTR wsz_path = nullptr; 33 | HRESULT hr = SHGetKnownFolderPath(FOLDERID_RoamingAppData, 0, nullptr, &wsz_path); 34 | Q_UNUSED(hr); 35 | Q_ASSERT(hr == S_OK); 36 | if (hr == S_OK) 37 | { 38 | file_location = QString::fromUtf16(reinterpret_cast(wsz_path)); 39 | file_location.append("/" + rra::kExecutableBaseFilename); 40 | } 41 | 42 | #else 43 | 44 | struct passwd* pw = getpwuid(getuid()); 45 | if (pw != nullptr) 46 | { 47 | const char* homedir = pw->pw_dir; 48 | file_location = homedir; 49 | } 50 | file_location.append("/." + rra::kExecutableBaseFilename); 51 | #endif 52 | 53 | // Make sure the folder exists. If not, create it. 54 | std::string dir = file_location.toStdString(); 55 | if (QDir(dir.c_str()).exists() == false) 56 | { 57 | QDir qdir; 58 | qdir.mkpath(dir.c_str()); 59 | } 60 | 61 | return file_location; 62 | } 63 | -------------------------------------------------------------------------------- /source/frontend/util/file_util.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Header for useful utility functions. 6 | //============================================================================= 7 | 8 | #ifndef RRA_UTIL_FILE_UTIL_H_ 9 | #define RRA_UTIL_FILE_UTIL_H_ 10 | 11 | #include 12 | 13 | namespace file_util 14 | { 15 | /// @brief Get file path to RRA log/settings file. 16 | /// 17 | /// Find the 'Temp' folder on the local OS and create an RRA subfolder (on linux, create .RRA folder). 18 | /// 19 | /// @return The location of the settings and log file. 20 | QString GetFileLocation(); 21 | 22 | }; // namespace file_util 23 | 24 | #endif // RRA_UTIL_FILE_UTIL_H_ 25 | -------------------------------------------------------------------------------- /source/frontend/util/log_file_writer.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Declaration for the log file writer. 6 | //============================================================================= 7 | 8 | #ifndef RRA_UTIL_LOG_FILE_WRITER_H_ 9 | #define RRA_UTIL_LOG_FILE_WRITER_H_ 10 | 11 | #include 12 | #include 13 | 14 | namespace rra 15 | { 16 | /// @brief Log file writer class definition. 17 | class LogFileWriter 18 | { 19 | public: 20 | /// @brief Log levels used by the logger from most severe to least severe. 21 | enum LogLevel 22 | { 23 | kError, 24 | kWarning, 25 | kInfo, 26 | kDebug, 27 | }; 28 | 29 | /// @brief LogFileWriter instance get function. 30 | /// 31 | /// @return a reference to the LogFileWriter instance. 32 | static LogFileWriter& Get(); 33 | 34 | /// @brief Write a string to the log file. 35 | /// 36 | /// @param [in] log_level The log level to use for this message. 37 | /// @param [in] log_message The message to write to the log file. 38 | void WriteLog(LogLevel log_level, const char* log_message, ...); 39 | 40 | /// @brief Get the location of the log file. 41 | /// 42 | /// @return The location of the log file. 43 | QString GetLogFileLocation(); 44 | 45 | private: 46 | /// @brief Constructor. 47 | explicit LogFileWriter(); 48 | 49 | /// @brief Destructor. 50 | ~LogFileWriter(); 51 | 52 | /// @brief Write the log out to the log file. 53 | /// 54 | /// @param [in] log_message The message to write to the log file. 55 | void WriteLogMessage(const char* log_message); 56 | 57 | QMutex mutex_; ///< The mutex to write the log. 58 | static LogFileWriter* instance_; ///< LogFileWriter instance pointer. 59 | LogLevel log_level_; ///< The current log level. 60 | }; 61 | } // namespace rra 62 | 63 | #endif // RRA_UTIL_LOG_FILE_WRITER_H_ 64 | -------------------------------------------------------------------------------- /source/frontend/util/rra_util.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2018-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Header for rra_util which holds useful utility functions. 6 | //============================================================================= 7 | 8 | #ifndef RRA_UTIL_RRA_UTIL_H_ 9 | #define RRA_UTIL_RRA_UTIL_H_ 10 | 11 | #include 12 | 13 | namespace rra_util 14 | { 15 | /// @brief Get the text color that works best displayed on top of a given background color. 16 | /// 17 | /// Make the light color off-white so it can be seen against the white background. 18 | /// 19 | /// @param [in] background_color The color that the text is to be displayed on top of. 20 | /// @param [in] has_white_background Is the text drawn to a mainly white background? 21 | /// This will be the case for small objects that need coloring where the text 22 | /// extends onto the background. If this is the case and the text color needs to 23 | /// be light to contrast against a darker color, use a light gray rather than white. 24 | /// 25 | /// @return The text color, either black or white/light gray. 26 | QColor GetTextColorForBackground(const QColor& background_color, bool has_white_background = false); 27 | 28 | /// @brief Return whether a trace may be loaded. 29 | /// 30 | /// @param [in] trace_path The path to the trace. 31 | /// 32 | /// @return true if we may attempt an actual trace load, false otherwise. 33 | bool TraceValidToLoad(const QString& trace_path); 34 | 35 | }; // namespace rra_util 36 | 37 | #endif // RRA_UTIL_RRA_UTIL_H_ 38 | -------------------------------------------------------------------------------- /source/frontend/version.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Version number info. 6 | //============================================================================= 7 | 8 | #include "version.h" 9 | 10 | const char* version_string = "RraVersion=" PRODUCT_VERSION_STRING; 11 | -------------------------------------------------------------------------------- /source/frontend/version.h.in: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-@YEAR@ Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Version number info. 6 | //============================================================================= 7 | 8 | #ifndef RRA_VERSION_H 9 | #define RRA_VERSION_H 10 | 11 | #define STRINGIFY_MACRO_(a) #a 12 | #define STRINGIFY_MACRO(a) STRINGIFY_MACRO_(a) 13 | #define STRINGIFY_VERSION(major, minor, patch, build) \ 14 | STRINGIFY_MACRO(major) "." STRINGIFY_MACRO(minor) "." STRINGIFY_MACRO(patch) "." STRINGIFY_MACRO(build) 15 | 16 | #define PRODUCT_APP_NAME "Radeon Raytracing Analyzer" ///< Application name 17 | 18 | #ifdef BETA 19 | #define PRODUCT_BUILD_SUFFIX " - Beta" ///< The build suffix to apply to the product name.(alpha, beta etc.) 20 | #else 21 | #define PRODUCT_BUILD_SUFFIX "" ///< The build suffix to apply to the product name.(alpha, beta etc.) 22 | #endif 23 | 24 | #define PRODUCT_MAJOR_VERSION @RRA_MAJOR_VERSION@ ///< The major version number. 25 | #define PRODUCT_MINOR_VERSION @RRA_MINOR_VERSION@ ///< The minor version number. 26 | #define PRODUCT_BUGFIX_NUMBER @RRA_BUGFIX_NUMBER@ ///< The bugfix number. 27 | #define PRODUCT_BUILD_NUMBER @RRA_BUILD_NUMBER@ ///< The build number. 28 | #define PRODUCT_BUILD_DATE_STRING @DATE@ ///< The build date string. 29 | #define PRODUCT_BUILD_CURRENT_YEAR @YEAR_STRING@ ///< The current year. 30 | 31 | #define PRODUCT_VERSION_STRING STRINGIFY_VERSION(PRODUCT_MAJOR_VERSION, PRODUCT_MINOR_VERSION, PRODUCT_BUGFIX_NUMBER, PRODUCT_BUILD_NUMBER) 32 | #define PRODUCT_COPYRIGHT_STRING "Copyright (C) 2022-" PRODUCT_BUILD_CURRENT_YEAR " Advanced Micro Devices, Inc. All rights reserved." 33 | 34 | #endif // RRA_VERSION_H 35 | -------------------------------------------------------------------------------- /source/frontend/views/acceleration_structure_tree_view.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /// Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// \author AMD Developer Tools Team 4 | /// \file 5 | /// \brief Header file for an acceleration structure tree view. 6 | /// 7 | /// Based on a scaled treeview, it adds a right-click context menu. 8 | //============================================================================= 9 | 10 | #ifndef RRA_VIEWS_ACCELERATION_STRUCTURE_TREE_VIEW_H_ 11 | #define RRA_VIEWS_ACCELERATION_STRUCTURE_TREE_VIEW_H_ 12 | 13 | #include "qt_common/custom_widgets/scaled_tree_view.h" 14 | 15 | #include 16 | 17 | #include "models/acceleration_structure_viewer_model.h" 18 | 19 | /// This class implements a Tree View specific to an acceleration structure. 20 | class AccelerationStructureTreeView : public ScaledTreeView 21 | { 22 | Q_OBJECT 23 | 24 | public: 25 | /// Explicit constructor. 26 | /// 27 | /// @param [in] parent The parent widget. 28 | explicit AccelerationStructureTreeView(QWidget* parent = nullptr); 29 | 30 | /// @brief Set the viewer model. 31 | /// 32 | /// @param [in] model The viewer model to set. 33 | /// @param [in] current_bvh_index The current bvh index. 34 | void SetViewerModel(rra::AccelerationStructureViewerModel* model, uint64_t current_bvh_index); 35 | 36 | /// Destructor. 37 | virtual ~AccelerationStructureTreeView(); 38 | 39 | /// @brief Create a context menu to allow the user control over what they want to visualize in the scene. 40 | /// 41 | /// @param [in] event The event. 42 | virtual void contextMenuEvent(QContextMenuEvent* event) Q_DECL_OVERRIDE; 43 | 44 | protected: 45 | /// @brief Override the widget event handler. 46 | /// 47 | /// @param [in] event The event data. 48 | /// 49 | /// \returns True if the event was recognized and handled, and false otherwise. 50 | bool event(QEvent* event) Q_DECL_OVERRIDE; 51 | 52 | private: 53 | rra::AccelerationStructureViewerModel* model_ = nullptr; ///< The viewer model. 54 | uint64_t current_bvh_index_ = 0; ///< The current bvh index. 55 | }; 56 | 57 | #endif // RRA_VIEWS_ACCELERATION_STRUCTURE_TREE_VIEW_H_ 58 | -------------------------------------------------------------------------------- /source/frontend/views/base_pane.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation for a base pane class. 6 | //============================================================================= 7 | 8 | #include "base_pane.h" 9 | 10 | BasePane::BasePane(QWidget* parent) 11 | : QWidget(parent) 12 | { 13 | } 14 | 15 | BasePane::~BasePane() 16 | { 17 | } 18 | 19 | void BasePane::OnTraceClose() 20 | { 21 | } 22 | 23 | void BasePane::OnTraceOpen() 24 | { 25 | } 26 | 27 | void BasePane::Reset() 28 | { 29 | } 30 | -------------------------------------------------------------------------------- /source/frontend/views/base_pane.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Header for the base pane class. 6 | //============================================================================= 7 | 8 | #ifndef RRA_VIEWS_BASE_PANE_H_ 9 | #define RRA_VIEWS_BASE_PANE_H_ 10 | 11 | #include 12 | 13 | /// @brief Base class for a pane in the UI. 14 | class BasePane : public QWidget 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | /// @brief Constructor. 20 | /// 21 | /// @param [in] parent The parent widget. 22 | explicit BasePane(QWidget* parent = nullptr); 23 | 24 | /// @brief Destructor. 25 | virtual ~BasePane(); 26 | 27 | /// @brief Trace closed. 28 | virtual void OnTraceClose(); 29 | 30 | /// @brief Trace open. 31 | virtual void OnTraceOpen(); 32 | 33 | /// @brief Reset the UI. 34 | virtual void Reset(); 35 | }; 36 | 37 | #endif // RRA_VIEWS_BASE_PANE_H_ 38 | -------------------------------------------------------------------------------- /source/frontend/views/blas/blas_properties_pane.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Header for the BLAS properties pane. 6 | //============================================================================= 7 | 8 | #ifndef RRA_VIEWS_BLAS_BLAS_PROPERTIES_PANE_H_ 9 | #define RRA_VIEWS_BLAS_BLAS_PROPERTIES_PANE_H_ 10 | 11 | #include "ui_blas_properties_pane.h" 12 | 13 | #include "models/blas/blas_properties_model.h" 14 | #include "views/base_pane.h" 15 | 16 | /// @brief Class declaration. 17 | class BlasPropertiesPane : public BasePane 18 | { 19 | Q_OBJECT 20 | 21 | public: 22 | /// @brief Constructor. 23 | /// 24 | /// @param [in] parent The parent widget. 25 | explicit BlasPropertiesPane(QWidget* parent = nullptr); 26 | 27 | /// @brief Destructor. 28 | virtual ~BlasPropertiesPane(); 29 | 30 | private slots: 31 | /// @brief Set the TLAS index. 32 | /// 33 | /// Called when the user chooses a different TLAS from the combo box. 34 | /// Will force a redraw of the table, since the TLAS index has changed. 35 | /// 36 | /// @param [in] tlas_index The TLAS index to set. 37 | void SetTlasIndex(uint64_t tlas_index); 38 | 39 | /// @brief Set the BLAS index. 40 | /// 41 | /// Called when the user chooses a different BLAS from the combo box. 42 | /// Will force a redraw of the table, since the BLAS index has changed. 43 | /// 44 | /// @param [in] blas_index The BLAS index to select. 45 | void SetBlasIndex(uint64_t blas_index); 46 | 47 | private: 48 | Ui::BlasPropertiesPane* ui_; ///< Pointer to the Qt UI design. 49 | 50 | rra::BlasPropertiesModel* model_; ///< Container class for the widget models. 51 | uint64_t tlas_index_; ///< The currently selected TLAS index. 52 | }; 53 | 54 | #endif // RRA_VIEWS_BLAS_BLAS_PROPERTIES_PANE_H_ 55 | -------------------------------------------------------------------------------- /source/frontend/views/custom_widgets/color_picker_button.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Header for a color picker button. 6 | //============================================================================= 7 | 8 | #ifndef RRA_VIEWS_CUSTOM_WIDGETS_COLOR_PICKER_BUTTON_H_ 9 | #define RRA_VIEWS_CUSTOM_WIDGETS_COLOR_PICKER_BUTTON_H_ 10 | 11 | #include 12 | #include 13 | 14 | #include "qt_common/utils/color_palette.h" 15 | 16 | /// @brief Helper class for color picker. Allows custom button painting. 17 | class ColorPickerButton : public QPushButton 18 | { 19 | public: 20 | /// @brief Constructor. 21 | /// 22 | /// @param [in] parent The parent widget. 23 | explicit ColorPickerButton(QWidget* parent = nullptr); 24 | 25 | /// @brief Destructor. 26 | virtual ~ColorPickerButton(); 27 | 28 | /// @brief Set the color of the button. 29 | /// 30 | /// @param [in] color The button color. 31 | void SetColor(const QColor& color); 32 | 33 | /// @brief Provides the desired height for the specified width which will keep the button square. 34 | /// 35 | /// @param [in] width The pixel width of this widget. 36 | /// 37 | /// @return The desired pixel height of this width. 38 | virtual int heightForWidth(int width) const Q_DECL_OVERRIDE; 39 | 40 | /// @brief Size hint, which is the scaled default button dimensions. 41 | /// 42 | /// @return The scaled size hint. 43 | virtual QSize sizeHint() const Q_DECL_OVERRIDE; 44 | 45 | /// @brief Minimum size hint, which is the unscaled default button dimensions. 46 | /// 47 | /// @return The mimium size hint. 48 | virtual QSize minimumSizeHint() const Q_DECL_OVERRIDE; 49 | 50 | protected: 51 | /// @brief Picker button paint event. 52 | /// 53 | /// Overrides button draw function to implement custom drawing functionality. 54 | /// 55 | /// @param [in] event Qt paint event. 56 | virtual void paintEvent(QPaintEvent* event) Q_DECL_OVERRIDE; 57 | 58 | private: 59 | QColor button_color_; ///< Color of this button. 60 | }; 61 | 62 | #endif // RRA_VIEWS_CUSTOM_WIDGETS_COLOR_PICKER_BUTTON_H_ 63 | -------------------------------------------------------------------------------- /source/frontend/views/custom_widgets/dispatch_legend.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /// Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// \author AMD Developer Tools Team 4 | /// \file 5 | /// \brief Widget for a colored legend. 6 | //============================================================================= 7 | 8 | #include "dispatch_legend.h" 9 | 10 | #include "qt_common/utils/common_definitions.h" 11 | #include "qt_common/utils/qt_util.h" 12 | 13 | const float kLegendHeightRatio = 2.0f / 3.0f; 14 | 15 | DispatchLegend::DispatchLegend(QWidget* parent) 16 | : QWidget(parent) 17 | { 18 | setSizePolicy(QSizePolicy::Policy::Minimum, QSizePolicy::Policy::Minimum); 19 | } 20 | 21 | DispatchLegend::~DispatchLegend() 22 | { 23 | } 24 | 25 | void DispatchLegend::SetColor(const QColor& color) 26 | { 27 | color_ = color; 28 | } 29 | 30 | void DispatchLegend::paintEvent(QPaintEvent* event) 31 | { 32 | Q_UNUSED(event); 33 | 34 | // Set up the painter. 35 | QPainter painter; 36 | painter.begin(this); 37 | painter.setRenderHint(QPainter::Antialiasing); 38 | 39 | int w = height() * kLegendHeightRatio; 40 | int x = w / 2; 41 | int y = (height() - w + 1) / 2; // Add 1 to round up instead of down. 42 | 43 | painter.fillRect(x, y, w, w, color_); 44 | painter.end(); 45 | } 46 | -------------------------------------------------------------------------------- /source/frontend/views/custom_widgets/dispatch_legend.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /// Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// \author AMD Developer Tools Team 4 | /// \file 5 | /// \brief Widget for a colored legend. 6 | //============================================================================= 7 | 8 | #ifndef RRA_VIEWS_CUSTOM_WIDGETS_DISPATCH_LEGEND_H_ 9 | #define RRA_VIEWS_CUSTOM_WIDGETS_DISPATCH_LEGEND_H_ 10 | 11 | #include 12 | 13 | class DispatchLegend : public QWidget 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | /// Constructor 19 | /// 20 | /// @param [in] parent The parent widget 21 | DispatchLegend(QWidget* parent); 22 | 23 | /// Virtual destructor 24 | virtual ~DispatchLegend(); 25 | 26 | /// @brief Set the color of this widget. 27 | void SetColor(const QColor& color); 28 | 29 | protected: 30 | /// @brief Implementation of Qt's paint for this widget. 31 | /// 32 | /// @param [in] event The paint event. 33 | virtual void paintEvent(QPaintEvent* event) Q_DECL_OVERRIDE; 34 | 35 | private: 36 | QColor color_; ///< The color of the legend. 37 | }; 38 | 39 | #endif // RRA_VIEWS_CUSTOM_WIDGETS_DISPATCH_LEGEND_H_ 40 | -------------------------------------------------------------------------------- /source/frontend/views/custom_widgets/read_only_checkbox.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation for a read-only checkbox. Used for displaying 6 | /// boolean values in tables. 7 | //============================================================================= 8 | 9 | #include 10 | #include 11 | 12 | #include "views/custom_widgets/read_only_checkbox.h" 13 | 14 | #include "views/widget_util.h" 15 | 16 | ReadOnlyCheckBox::ReadOnlyCheckBox(QWidget* parent) 17 | : QCheckBox(parent) 18 | { 19 | setContentsMargins(10, 5, 10, 5); 20 | setAttribute(Qt::WA_TransparentForMouseEvents, true); 21 | setFocusPolicy(Qt::NoFocus); 22 | } 23 | 24 | ReadOnlyCheckBox::~ReadOnlyCheckBox() 25 | { 26 | } 27 | 28 | void ReadOnlyCheckBox::paintEvent(QPaintEvent* event) 29 | { 30 | Q_UNUSED(event); 31 | 32 | QPainter painter(this); 33 | QRect rect = QRect(0, 0, this->size().width(), this->size().height()); 34 | 35 | bool checked = (checkState() == Qt::CheckState::Checked) ? true : false; 36 | rra::widget_util::DrawCheckboxCell(&painter, rect, checked, false); 37 | } 38 | -------------------------------------------------------------------------------- /source/frontend/views/custom_widgets/read_only_checkbox.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Header for a read-only checkbox. Used for displaying boolean 6 | /// values in tables. 7 | //============================================================================= 8 | 9 | #ifndef RRA_VIEWS_CUSTOM_WIDGETS_READ_ONLY_CHECKBOX_H_ 10 | #define RRA_VIEWS_CUSTOM_WIDGETS_READ_ONLY_CHECKBOX_H_ 11 | 12 | #include 13 | 14 | /// @brief Helper class for read-only checkboxs. 15 | class ReadOnlyCheckBox : public QCheckBox 16 | { 17 | public: 18 | /// @brief Constructor. 19 | /// 20 | /// @param [in] parent The parent widget. 21 | explicit ReadOnlyCheckBox(QWidget* parent = nullptr); 22 | 23 | /// @brief Destructor. 24 | virtual ~ReadOnlyCheckBox(); 25 | 26 | /// @brief Read-only checkbox paint event. 27 | /// 28 | /// @param [in] event Qt paint event. 29 | virtual void paintEvent(QPaintEvent* event) Q_DECL_OVERRIDE; 30 | 31 | private: 32 | }; 33 | 34 | #endif // RRA_VIEWS_CUSTOM_WIDGETS_READ_ONLY_CHECKBOX_H_ 35 | -------------------------------------------------------------------------------- /source/frontend/views/custom_widgets/slider_style.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Header of a widget that provides additional styles for QSlider. 6 | //============================================================================= 7 | 8 | #ifndef RRA_VIEWS_CUSTOM_WIDGETS_SLIDER_STYLE_H_ 9 | #define RRA_VIEWS_CUSTOM_WIDGETS_SLIDER_STYLE_H_ 10 | 11 | #include 12 | 13 | class AbsoluteSliderPositionStyle : public QProxyStyle 14 | { 15 | public: 16 | using QProxyStyle::QProxyStyle; 17 | 18 | int styleHint(QStyle::StyleHint hint, const QStyleOption* option = 0, const QWidget* widget = 0, QStyleHintReturn* returnData = 0) const 19 | { 20 | if (hint == QStyle::SH_Slider_AbsoluteSetButtons) 21 | return (Qt::LeftButton | Qt::MiddleButton | Qt::RightButton); 22 | return QProxyStyle::styleHint(hint, option, widget, returnData); 23 | } 24 | }; 25 | 26 | #endif // RRA_VIEWS_CUSTOM_WIDGETS_SLIDER_STYLE_H_ 27 | -------------------------------------------------------------------------------- /source/frontend/views/custom_widgets/themes_and_colors_item_button.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Header for a helper class for custom button rendering for the 6 | /// themes and colors pane. 7 | //============================================================================= 8 | 9 | #ifndef RRA_VIEWS_CUSTOM_WIDGETS_THEMES_AND_COLORS_ITEM_BUTTON_H_ 10 | #define RRA_VIEWS_CUSTOM_WIDGETS_THEMES_AND_COLORS_ITEM_BUTTON_H_ 11 | 12 | #include "qt_common/custom_widgets/scaled_push_button.h" 13 | 14 | /// @brief Helper class for custom button rendering. 15 | class ThemesAndColorsItemButton : public ScaledPushButton 16 | { 17 | public: 18 | /// @brief Constructor. 19 | /// 20 | /// @param [in] parent The parent widget. 21 | explicit ThemesAndColorsItemButton(QWidget* parent = nullptr); 22 | 23 | /// @brief Destructor. 24 | virtual ~ThemesAndColorsItemButton(); 25 | 26 | /// @brief Themes and colors button color setter. 27 | /// 28 | /// Stores color and font color values for use in custom drawing. 29 | /// 30 | /// @param [in] color The color to set. 31 | void SetColor(const QColor& color); 32 | 33 | /// @brief Themes and colors button paint event. 34 | /// 35 | /// Overrides button draw function to implement custom drawing functionality. 36 | /// 37 | /// @param [in] event Qt paint event. 38 | virtual void paintEvent(QPaintEvent* event) Q_DECL_OVERRIDE; 39 | 40 | private: 41 | QColor button_color_; ///< Color of this button. 42 | QColor font_color_; ///< Font color of this button. 43 | }; 44 | 45 | #endif // RRA_VIEWS_CUSTOM_WIDGETS_THEMES_AND_COLORS_ITEM_BUTTON_H_ 46 | -------------------------------------------------------------------------------- /source/frontend/views/custom_widgets/vertical_button_widget.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation of a vertical QPushButton. 6 | //============================================================================= 7 | 8 | #include "views/custom_widgets/vertical_button_widget.h" 9 | 10 | #include 11 | 12 | static const float kVerticalLabelPointFontSize = 9.0F; ///< Font point size for vertical labels. 13 | 14 | VerticalButtonWidget::VerticalButtonWidget(QWidget* parent) 15 | : QPushButton(parent) 16 | { 17 | QFont tmp_font = font(); 18 | tmp_font.setPointSizeF(kVerticalLabelPointFontSize); 19 | setFont(tmp_font); 20 | } 21 | 22 | VerticalButtonWidget::~VerticalButtonWidget() 23 | { 24 | } 25 | 26 | void VerticalButtonWidget::paintEvent(QPaintEvent* event) 27 | { 28 | Q_UNUSED(event); 29 | 30 | QPainter painter(this); 31 | QFont tmp_font = font(); 32 | tmp_font.setPointSizeF(kVerticalLabelPointFontSize); 33 | painter.setFont(tmp_font); 34 | painter.rotate(90); 35 | painter.drawText(0, -5, text()); 36 | } 37 | 38 | QSize VerticalButtonWidget::minimumSizeHint() const 39 | { 40 | QSize minimum_size_hint = QFontMetrics(font()).size(0, text()); 41 | 42 | // Swap width and height. 43 | return QSize(minimum_size_hint.height(), minimum_size_hint.width()); 44 | } 45 | 46 | QSize VerticalButtonWidget::sizeHint() const 47 | { 48 | QSize size_hint = QFontMetrics(font()).size(0, text()); 49 | 50 | // Swap width and height. 51 | return QSize(size_hint.height(), size_hint.width()); 52 | } 53 | -------------------------------------------------------------------------------- /source/frontend/views/custom_widgets/vertical_button_widget.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Header file for a vertical QPushButton. 6 | //============================================================================= 7 | 8 | #ifndef RRA_VIEWS_CUSTOM_WIDGETS_VERTICAL_BUTTON_WIDGET_H_ 9 | #define RRA_VIEWS_CUSTOM_WIDGETS_VERTICAL_BUTTON_WIDGET_H_ 10 | 11 | #include 12 | 13 | /// This class implements a rotated QPushButton. 14 | class VerticalButtonWidget : public QPushButton 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | /// @brief Explicit constructor. 20 | /// 21 | /// @param [in] parent The parent widget. 22 | explicit VerticalButtonWidget(QWidget* parent = nullptr); 23 | 24 | /// @brief Virtual destructor. 25 | virtual ~VerticalButtonWidget(); 26 | 27 | protected: 28 | /// @brief Overridden paint event for this QPushButton. 29 | /// 30 | /// @param [in] event The paint event. 31 | virtual void paintEvent(QPaintEvent* event) Q_DECL_OVERRIDE; 32 | 33 | /// @brief Overridden minimum size hint. 34 | /// 35 | /// @return The minimum size hint. 36 | virtual QSize minimumSizeHint() const Q_DECL_OVERRIDE; 37 | 38 | /// @brief Overridden size hint. 39 | /// 40 | /// @return The size hint. 41 | virtual QSize sizeHint() const Q_DECL_OVERRIDE; 42 | }; 43 | 44 | #endif // RRA_VIEWS_CUSTOM_WIDGETS_VERTICAL_BUTTON_WIDGET_H_ 45 | -------------------------------------------------------------------------------- /source/frontend/views/debug_window.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Header for the debug window. 6 | //============================================================================= 7 | 8 | #ifndef RRA_VIEWS_DEBUG_WINDOW_H_ 9 | #define RRA_VIEWS_DEBUG_WINDOW_H_ 10 | 11 | #include "ui_debug_window.h" 12 | 13 | #include 14 | 15 | /// @brief Support for the debug window. 16 | class DebugWindow : public QDialog 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | /// @brief Constructor. 22 | explicit DebugWindow(); 23 | 24 | /// @brief Destructor. 25 | ~DebugWindow(); 26 | 27 | /// @brief Send a message to the debug window. Supports multiple arguments. 28 | /// 29 | /// @param [in] format The string containing format for each argument. 30 | static void DbgMsg(const char* format, ...); 31 | 32 | signals: 33 | /// @brief Signal that gets emitted when the debug window has new text to add. 34 | /// 35 | /// This will be picked up by the slot below. 36 | /// 37 | /// @param [in] string The new line of text to add. 38 | void EmitSetText(const QString& string); 39 | 40 | private slots: 41 | /// @brief Add a new line of text to the debug window. 42 | /// 43 | /// @param [in] string The new line of text to add. 44 | void SetText(const QString& string); 45 | 46 | private: 47 | /// @brief Helper function which to automatically scroll to the bottom on new line. 48 | void ScrollToBottom(); 49 | 50 | /// @brief Register the Debug Window such that it is accessible. 51 | /// 52 | /// This is only to be called once, when initializing MainWindow. 53 | void RegisterDbgWindow(); 54 | 55 | Ui::DebugWindow* ui_; ///< Pointer to the Qt UI design. 56 | }; 57 | 58 | #endif // RRA_VIEWS_DEBUG_WINDOW_H_ 59 | -------------------------------------------------------------------------------- /source/frontend/views/debug_window.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DebugWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 720 10 | 150 11 | 12 | 13 | 14 | Debug Output - use DbgMsg() or qDebug() 15 | 16 | 17 | 18 | :/Resources/assets/icon_48x48.png:/Resources/assets/icon_48x48.png 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /source/frontend/views/license_dialog.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Header for the click-through license dialog box. 6 | //============================================================================= 7 | 8 | #ifndef RRA_VIEWS_LICENSE_DIALOG_H_ 9 | #define RRA_VIEWS_LICENSE_DIALOG_H_ 10 | 11 | #include "ui_license_dialog.h" 12 | 13 | #include 14 | 15 | /// @brief Support for the agreement window. 16 | class LicenseDialog : public QDialog 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | /// @brief Constructor. 22 | explicit LicenseDialog(); 23 | 24 | /// @brief Destructor. 25 | virtual ~LicenseDialog(); 26 | 27 | /// @brief Has the user agreed to the license. 28 | /// 29 | /// @return true if so, false if not. 30 | bool AgreedToLicense(); 31 | 32 | signals: 33 | /// @brief Signal that the user agrees to the license. 34 | void AgreeToLicense(); 35 | 36 | private slots: 37 | /// @brief Make sure the user actually read the license. 38 | /// 39 | /// Only enable the agree button if scrolled to the bottom. 40 | void ScrollbarChanged(); 41 | 42 | /// @brief Kill the app. 43 | void Exit(); 44 | 45 | /// @brief Accept license agreement. 46 | void Agree(); 47 | 48 | private: 49 | /// @brief Kill the app. 50 | /// 51 | /// @param [in] event The CloseEvent. 52 | void closeEvent(QCloseEvent* event); 53 | 54 | Ui::LicenseDialog* ui_; ///< Pointer to the Qt UI design. 55 | }; 56 | 57 | #endif // RRA_VIEWS_LICENSE_DIALOG_H_ 58 | -------------------------------------------------------------------------------- /source/frontend/views/overview/device_configuration_pane.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Header for the Device configuration pane. 6 | //============================================================================= 7 | 8 | #ifndef RRA_VIEWS_OVERVIEW_DEVICE_CONFIGURATION_PANE_H_ 9 | #define RRA_VIEWS_OVERVIEW_DEVICE_CONFIGURATION_PANE_H_ 10 | 11 | #include "ui_device_configuration_pane.h" 12 | 13 | #include 14 | 15 | #include "models/overview/device_configuration_model.h" 16 | #include "views/base_pane.h" 17 | 18 | /// @brief Class declaration. 19 | class DeviceConfigurationPane : public BasePane 20 | { 21 | Q_OBJECT 22 | 23 | public: 24 | /// @brief Constructor. 25 | /// 26 | /// @param [in] parent The parent widget. 27 | explicit DeviceConfigurationPane(QWidget* parent = nullptr); 28 | 29 | /// @brief Destructor. 30 | ~DeviceConfigurationPane(); 31 | 32 | /// @brief Overridden Qt show event. Fired when this pane is opened. 33 | /// 34 | /// @param [in] event The show event object. 35 | virtual void showEvent(QShowEvent* event) Q_DECL_OVERRIDE; 36 | 37 | /// @brief Reset UI state. 38 | virtual void Reset() Q_DECL_OVERRIDE; 39 | 40 | private: 41 | /// @brief Refresh the UI. 42 | void Refresh(); 43 | 44 | /// @brief Update the pane based on the color theme. 45 | void OnColorThemeUpdated(); 46 | 47 | Ui::DeviceConfigurationPane* ui_; ///< Pointer to the Qt UI design. 48 | rra::DeviceConfigurationModel* model_; ///< The model for this pane. 49 | }; 50 | 51 | #endif // RRA_VIEWS_OVERVIEW_DEVICE_CONFIGURATION_PANE_H_ 52 | -------------------------------------------------------------------------------- /source/frontend/views/overview/tlas_pane.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2024-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Header for a tlas pane. 6 | //============================================================================= 7 | 8 | #ifndef RRA_VIEWS_OVERVIEW_TLAS_PANE_H_ 9 | #define RRA_VIEWS_OVERVIEW_TLAS_PANE_H_ 10 | 11 | #include "ui_tlas_pane.h" 12 | 13 | #include "views/overview/summary_pane.h" 14 | 15 | /// @brief Class declaration. 16 | class TlasPane : public QWidget 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | /// @brief Constructor. 22 | /// 23 | /// @param [in] parent Pointer to the parent widget. 24 | explicit TlasPane(QWidget* parent = nullptr); 25 | 26 | /// @brief Destructor. 27 | virtual ~TlasPane(); 28 | 29 | /// @brief Overridden paintEvent method. 30 | /// 31 | /// @param event The paint event object 32 | void paintEvent(QPaintEvent* event) Q_DECL_OVERRIDE; 33 | 34 | /// @brief Set the statistics for this TLAS pane. 35 | /// 36 | /// @param [in] summary_pane Pointer to the (parent) summary_pane. 37 | /// @param [in] tlas Reference to the TLAS statistics. 38 | /// @param [in] empty Is the TLAS empty. 39 | /// @param [in] rebraiding_enabled Is rebraiding enabled for this TLAS. 40 | void SetTlasStats(SummaryPane* summary_pane, const rra::TlasListStatistics& tlas, bool empty, bool rebraiding_enabled); 41 | 42 | private: 43 | Ui_TlasPane* ui_; ///< The Qt Instance of this object. 44 | }; 45 | 46 | #endif // RRA_VIEWS_OVERVIEW_TLAS_PANE_H_ 47 | -------------------------------------------------------------------------------- /source/frontend/views/ray/ray_inspector_tree_view.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /// Copyright (c) 2024-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// \author AMD Developer Tools Team 4 | /// \file 5 | /// \brief Implementation of a ray inspector tree view. 6 | /// 7 | /// Based on a scaled treeview, it adds a right-click context menu. 8 | //============================================================================= 9 | 10 | #include "ray_inspector_tree_view.h" 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | #include "io/viewer_io.h" 17 | 18 | RayInspectorTreeView::RayInspectorTreeView(QWidget* parent) 19 | : ScaledTreeView(parent) 20 | { 21 | } 22 | 23 | RayInspectorTreeView::~RayInspectorTreeView() 24 | { 25 | } 26 | 27 | void RayInspectorTreeView::SetFocusOnSelectedRayCallback(std::function focus_on_selected_ray) 28 | { 29 | focus_on_selected_ray_ = focus_on_selected_ray; 30 | } 31 | 32 | void RayInspectorTreeView::SetResetSceneCallback(std::function reset_scene) 33 | { 34 | reset_scene_ = reset_scene; 35 | } 36 | 37 | void RayInspectorTreeView::SetViewerModel(rra::RayInspectorModel* model, uint64_t current_bvh_index) 38 | { 39 | model_ = model; 40 | current_bvh_index_ = current_bvh_index; 41 | } 42 | 43 | bool RayInspectorTreeView::event(QEvent* event) 44 | { 45 | QKeyEvent* key_event{}; 46 | 47 | switch (event->type()) 48 | { 49 | case QEvent::Enter: 50 | break; 51 | case QEvent::KeyPress: 52 | key_event = static_cast(event); 53 | if (key_event->key() == Qt::Key_F) 54 | { 55 | if (focus_on_selected_ray_) 56 | { 57 | focus_on_selected_ray_(); 58 | } 59 | } 60 | if (key_event->key() == Qt::Key_R) 61 | { 62 | if (reset_scene_) 63 | { 64 | reset_scene_(); 65 | } 66 | } 67 | break; 68 | case QEvent::KeyRelease: 69 | break; 70 | default: 71 | break; 72 | } 73 | 74 | return ScaledTreeView::event(event); 75 | } 76 | -------------------------------------------------------------------------------- /source/frontend/views/settings/keyboard_shortcuts_pane.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation of Keyboard Shortcuts pane. 6 | //============================================================================= 7 | 8 | #include "views/settings/keyboard_shortcuts_pane.h" 9 | 10 | #include "views/widget_util.h" 11 | 12 | KeyboardShortcutsPane::KeyboardShortcutsPane(QWidget* parent) 13 | : BasePane(parent) 14 | , ui_(new Ui::KeyboardShortcutsPane) 15 | { 16 | ui_->setupUi(this); 17 | 18 | rra::widget_util::ApplyStandardPaneStyle(ui_->main_scroll_area_); 19 | } 20 | 21 | KeyboardShortcutsPane::~KeyboardShortcutsPane() 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /source/frontend/views/settings/keyboard_shortcuts_pane.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Header for the Keyboard Shortcuts pane. 6 | //============================================================================= 7 | 8 | #ifndef RRA_VIEWS_SETTINGS_KEYBOARD_SHORTCUTS_PANE_H_ 9 | #define RRA_VIEWS_SETTINGS_KEYBOARD_SHORTCUTS_PANE_H_ 10 | 11 | #include "ui_keyboard_shortcuts_pane.h" 12 | 13 | #include "views/base_pane.h" 14 | 15 | /// @brief Class declaration. 16 | class KeyboardShortcutsPane : public BasePane 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | /// @brief Constructor. 22 | /// 23 | /// @param [in] parent The parent widget. 24 | explicit KeyboardShortcutsPane(QWidget* parent = nullptr); 25 | 26 | /// @brief Destructor. 27 | virtual ~KeyboardShortcutsPane(); 28 | 29 | private: 30 | Ui::KeyboardShortcutsPane* ui_; ///< Pointer to the Qt UI design. 31 | }; 32 | 33 | #endif // RRA_VIEWS_SETTINGS_KEYBOARD_SHORTCUTS_PANE_H_ 34 | -------------------------------------------------------------------------------- /source/frontend/views/tlas/tlas_properties_pane.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Header for the TLAS properties pane. 6 | //============================================================================= 7 | 8 | #ifndef RRA_VIEWS_TLAS_TLAS_PROPERTIES_PANE_H_ 9 | #define RRA_VIEWS_TLAS_TLAS_PROPERTIES_PANE_H_ 10 | 11 | #include "ui_tlas_properties_pane.h" 12 | 13 | #include "models/tlas/tlas_properties_model.h" 14 | #include "views/base_pane.h" 15 | 16 | /// @brief Class declaration. 17 | class TlasPropertiesPane : public BasePane 18 | { 19 | Q_OBJECT 20 | 21 | public: 22 | /// @brief Constructor. 23 | /// 24 | /// @param [in] parent The parent widget. 25 | explicit TlasPropertiesPane(QWidget* parent = nullptr); 26 | 27 | /// @brief Destructor. 28 | virtual ~TlasPropertiesPane(); 29 | 30 | private slots: 31 | /// @brief Set the TLAS index. 32 | /// 33 | /// Called when the user chooses a different TLAS from the combo box. 34 | /// Will force a redraw of the table, since the TLAS index has changed. 35 | /// 36 | /// @param [in] tlas_index The TLAS index to set. 37 | void SetTlasIndex(uint64_t tlas_index); 38 | 39 | private: 40 | Ui::TlasPropertiesPane* ui_; ///< Pointer to the Qt UI design. 41 | 42 | rra::TlasPropertiesModel* model_; ///< Container class for the widget models. 43 | }; 44 | 45 | #endif // RRA_VIEWS_TLAS_TLAS_PROPERTIES_PANE_H_ 46 | -------------------------------------------------------------------------------- /source/frontend/windows/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | //============================================================================= 3 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 4 | /// @author AMD Developer Tools Team 5 | /// @file 6 | /// @brief Microsoft Visual C++ generated include file used by RRA.rc. 7 | //============================================================================= 8 | // Microsoft Visual C++ generated include file. 9 | // Used by RRC.rc 10 | // 11 | #define IDI_ICON1 101 12 | 13 | // Next default values for new objects 14 | // 15 | #ifdef APSTUDIO_INVOKED 16 | #ifndef APSTUDIO_READONLY_SYMBOLS 17 | #endif 18 | #endif 19 | -------------------------------------------------------------------------------- /source/frontend/windows/rra_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Tools/radeon_raytracing_analyzer/1fe3c6fb6da27b1a38726969c7c1874d274f567d/source/frontend/windows/rra_icon.ico -------------------------------------------------------------------------------- /source/renderer/public/graphics_context.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Definition of the Graphics Context functions. 6 | //============================================================================= 7 | 8 | #ifndef RRA_RENDERER_GRAPHICS_CONTEXT_H_ 9 | #define RRA_RENDERER_GRAPHICS_CONTEXT_H_ 10 | 11 | #include 12 | #include "public/renderer_interface.h" 13 | #include 14 | #include 15 | 16 | namespace rra 17 | { 18 | namespace renderer 19 | { 20 | /// @brief Create a graphics context. 21 | /// 22 | /// @param [in] parent qt widget information. 23 | /// @param [in] window_info The window information for the creation of graphics device, queues, and context. 24 | void CreateGraphicsContext(QWidget* parent); 25 | 26 | /// @brief Initialize the graphics context. Note: must be called after CreateGraphicsContext. 27 | /// 28 | /// @returns True if the context was initialized successfully and false in case of failure. 29 | bool InitializeGraphicsContext(std::shared_ptr info); 30 | 31 | /// @brief Get the human readable initialization error. 32 | /// 33 | /// @returns A human readable initialization error. 34 | std::string GetGraphicsContextInitializationError(); 35 | 36 | /// @brief Cleanup the graphics context. 37 | void CleanupGraphicsContext(); 38 | 39 | } // namespace renderer 40 | } // namespace rra 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /source/renderer/public/include_vma.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Include the vma header with the required pragmas. 6 | /// 7 | /// VMA recommends disabling warnings for "warnings as errors" compilations. 8 | //============================================================================= 9 | 10 | #ifdef _WIN32 11 | #pragma warning(push, 3) 12 | #else 13 | #pragma GCC diagnostic push 14 | 15 | #pragma GCC diagnostic ignored "-Wmissing-field-initializers" 16 | #pragma GCC diagnostic ignored "-Wunused-variable" 17 | #pragma GCC diagnostic ignored "-Wunused-parameter" 18 | #pragma GCC diagnostic ignored "-Wtype-limits" 19 | #endif 20 | #include 21 | #ifdef _WIN32 22 | #pragma warning(pop) 23 | #else 24 | #pragma GCC diagnostic pop 25 | #endif 26 | -------------------------------------------------------------------------------- /source/renderer/public/renderer_adapter.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Declaration for the Renderer Adapter interface. This component can 6 | /// be used by UI code to query and alter various renderer states. 7 | //============================================================================= 8 | 9 | #ifndef RRA_RENDERER_RENDERER_ADAPTER_H_ 10 | #define RRA_RENDERER_RENDERER_ADAPTER_H_ 11 | 12 | #include 13 | #include 14 | 15 | namespace rra 16 | { 17 | namespace renderer 18 | { 19 | enum class RendererAdapterType : uint8_t 20 | { 21 | kRendererAdapterTypeView, 22 | kRendererAdapterTypeRenderState, 23 | }; 24 | 25 | class RendererAdapter 26 | { 27 | public: 28 | /// @brief Constructor. 29 | RendererAdapter() = default; 30 | 31 | /// @brief Destructor. 32 | virtual ~RendererAdapter() = default; 33 | }; 34 | 35 | /// @brief A map used to associate a renderer adapter type with an instance. 36 | typedef std::map RendererAdapterMap; 37 | 38 | /// @brief Template method to get an adapter by type. 39 | /// 40 | /// @param [in] adapters The list of adapters. 41 | /// @param [in] type The type of adapter to get. 42 | /// 43 | /// @return The derived class if found, or nullptr. 44 | template 45 | AdapterType GetAdapter(const RendererAdapterMap& adapters, RendererAdapterType type) 46 | { 47 | AdapterType result = nullptr; 48 | 49 | auto render_state_adapter_iter = adapters.find(type); 50 | if (render_state_adapter_iter != adapters.end()) 51 | { 52 | result = dynamic_cast(render_state_adapter_iter->second); 53 | } 54 | 55 | return result; 56 | } 57 | 58 | } // namespace renderer 59 | 60 | } // namespace rra 61 | 62 | #endif // RRA_RENDERER_RENDERER_ADAPTER_H_ 63 | -------------------------------------------------------------------------------- /source/renderer/public/shared.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Decleration for shared shader functions. 6 | /// 7 | /// These functions and structures will be shared between shaders and included in C++ code 8 | /// to avoid code duplication. 9 | //============================================================================= 10 | 11 | #ifndef RRA_SHADERS_SHARED_ 12 | #define RRA_SHADERS_SHARED_ 13 | 14 | #include 15 | 16 | namespace rra 17 | { 18 | namespace renderer 19 | { 20 | typedef glm::mat4 float4x4; 21 | typedef glm::vec4 float4; 22 | typedef glm::vec3 float3; 23 | typedef glm::vec2 float2; 24 | typedef uint32_t uint; 25 | 26 | #include "shaders/shared_definitions.hlsl" 27 | } // namespace renderer 28 | } // namespace rra 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /source/renderer/shaders/Clear.hlsl: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Shader to clear the background. 6 | //============================================================================= 7 | 8 | struct CheckerColors 9 | { 10 | float4 checkerColor1; 11 | float4 checkerColor2; 12 | }; 13 | 14 | [[vk::push_constant]] CheckerColors checkerColors; 15 | 16 | struct PSInput 17 | { 18 | float4 position : SV_POSITION; 19 | }; 20 | 21 | PSInput VSMain(uint index : SV_VertexID) 22 | { 23 | PSInput result; 24 | float x = float(index / 2) * 4.0 - 1.0f; 25 | float y = float(index % 2) * 4.0 - 1.0f; 26 | result.position = float4(x, y, 0.0f, 1.0f); 27 | return result; 28 | } 29 | 30 | float4 PSMain(PSInput input) 31 | : SV_TARGET 32 | { 33 | float2 xy = floor(input.position / 64.0f).xy; 34 | float checker = fmod(xy.x + xy.y, 2.0f); 35 | return lerp(checkerColors.checkerColor1, checkerColors.checkerColor2, checker); 36 | } 37 | -------------------------------------------------------------------------------- /source/renderer/shaders/GeometryColorWireframe.hlsl: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Shader for rendering geometry wireframe. 6 | //============================================================================= 7 | 8 | #include "Common.hlsl" 9 | #include "shared_definitions.hlsl" 10 | 11 | cbuffer scene_ubo : register(b0) 12 | { 13 | SceneUBO scene_ubo; 14 | } 15 | 16 | ////////////////////////////////////////////////////////////////////////////////////////////////// 17 | 18 | struct PSInput 19 | { 20 | float4 position : SV_POSITION; 21 | float3 wireframe_color : METADATA0; 22 | float wireframe_size : METADATA1; 23 | float3 barycentric_coords : METADATA2; 24 | }; 25 | 26 | struct VSInput 27 | { 28 | [[vk::location(0)]] float3 position : POSITION; 29 | 30 | [[vk::location(1)]] float4x4 instance_transform : TRANSFORM; 31 | // A float4x4 must skip 4 byte location indices 1->5. 32 | [[vk::location(5)]] float4 wireframe_metadata : METADATA0; 33 | }; 34 | 35 | PSInput VSMain(VSInput input, uint vertexId : SV_VertexID) 36 | { 37 | PSInput result; 38 | 39 | result.position = mul(scene_ubo.view_projection, mul(input.instance_transform, float4(input.position, 1.0))); 40 | result.wireframe_color = input.wireframe_metadata.xyz; 41 | result.wireframe_size = input.wireframe_metadata.a; 42 | result.barycentric_coords = float3(0.0, 0.0, 0.0); 43 | result.barycentric_coords[vertexId % 3] = 1.0; 44 | 45 | return result; 46 | } 47 | 48 | float4 PSMain(PSInput input) 49 | : SV_TARGET 50 | { 51 | float4 discard_color = 0.0f; 52 | 53 | float3 fw = fwidth(input.barycentric_coords); 54 | float3 smooth_scaling = smoothstep(fw * (input.wireframe_size / -10.0f), fw * (input.wireframe_size), input.barycentric_coords); 55 | float wireframe_alpha = min(min(smooth_scaling.x, smooth_scaling.y), smooth_scaling.z); 56 | 57 | return lerp(float4(input.wireframe_color, 1.0f), discard_color, wireframe_alpha); 58 | } -------------------------------------------------------------------------------- /source/renderer/shaders/Heatmap.hlsl: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Shader for the heatmap rendering. 6 | //============================================================================= 7 | 8 | sampler heatmap_sampler : register(s1); 9 | Texture1D heatmap_buffer : register(t1); 10 | 11 | float4 heatmap_temp(float value) 12 | { 13 | return heatmap_buffer.SampleLevel(heatmap_sampler, value, 0); 14 | } 15 | -------------------------------------------------------------------------------- /source/renderer/shaders/OrientationGizmo.hlsl: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Shader for the orientation gizmo. 6 | //============================================================================= 7 | 8 | struct PSInput 9 | { 10 | float4 position : SV_POSITION; 11 | float4 color : COLOR; 12 | float fadeFactor : FADE_FACTOR; 13 | }; 14 | 15 | struct VSInput 16 | { 17 | // Vertex attributes 18 | [[vk::location(0)]] float3 position : SV_POSITION; 19 | 20 | // Instance attributes 21 | [[vk::location(1)]] float4 color : METADATA0; 22 | [[vk::location(2)]] float fadeFactor : METADATA1; 23 | [[vk::location(3)]] float4x4 transform : TRANSFORM; 24 | }; 25 | 26 | PSInput VSMain(VSInput input) 27 | { 28 | PSInput result; 29 | 30 | result.position = mul(float4(input.position, 1.0), input.transform); 31 | result.color = input.color; 32 | result.fadeFactor = input.fadeFactor; 33 | 34 | return result; 35 | } 36 | 37 | float4 PSMain(PSInput input) 38 | : SV_TARGET 39 | { 40 | float lineHeight = 0.05; 41 | float darkestMul = 0.8; 42 | 43 | // Get 1.0 when gizmo is closest to camera, and darkestMul when it's furthest 44 | float depthBlend = ((1.0 - input.position.z) - 0.5 + lineHeight) * ((1.0 - darkestMul) / (2.0 * lineHeight)) + darkestMul; 45 | depthBlend = lerp(1.0, depthBlend, input.fadeFactor); 46 | 47 | input.color.xyz *= depthBlend; 48 | return input.color; 49 | } 50 | -------------------------------------------------------------------------------- /source/renderer/shaders/shared_impl.hlsl: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2022 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation for shared shader functions. 6 | /// 7 | /// These functions will be shared between shaders and included in C++ code 8 | /// to avoid code duplication. 9 | /// 10 | /// When using in c++ shared.h file must be included before this file. 11 | //============================================================================= 12 | 13 | float rand(uint seed) 14 | { 15 | seed ^= 2747636419u; 16 | seed *= 2654435769u; 17 | seed ^= seed >> 16; 18 | seed *= 2654435769u; 19 | seed ^= seed >> 16; 20 | seed *= 2654435769u; 21 | 22 | return float(seed) / 4294967295.0f; // 2^32-1 23 | } 24 | 25 | float4 heatmap(float level) 26 | { 27 | level *= (3.14159265f * 0.5f); 28 | float r = float(sin(level)); 29 | float g = float(sin(level * 2.0f)); 30 | float b = float(cos(level)); 31 | 32 | return float4(r, g, b, 1.0f); 33 | } 34 | -------------------------------------------------------------------------------- /source/renderer/shared.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation and linking for shared shader functions. 6 | /// 7 | /// These functions will be shared between shaders and included in C++ code 8 | /// to avoid code duplication. 9 | //============================================================================= 10 | 11 | #include "public/shared.h" 12 | 13 | namespace rra 14 | { 15 | namespace renderer 16 | { 17 | #include "shaders/shared_impl.hlsl" 18 | } // namespace renderer 19 | } // namespace rra 20 | -------------------------------------------------------------------------------- /source/renderer/vk/adapters/view_state_adapter.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation for the Renderer Adapter type. 6 | //============================================================================= 7 | 8 | #include "public/view_state_adapter.h" 9 | 10 | namespace rra 11 | { 12 | namespace renderer 13 | { 14 | ViewStateAdapter::ViewStateAdapter(Camera* camera) 15 | : camera(camera) 16 | { 17 | } 18 | 19 | float ViewStateAdapter::GetFieldOfView() const 20 | { 21 | return camera->GetFieldOfView(); 22 | } 23 | 24 | void ViewStateAdapter::SetFieldOfView(float field_of_view) 25 | { 26 | camera->SetFieldOfView(field_of_view); 27 | } 28 | 29 | float ViewStateAdapter::GetNearPlaneMultiplier() const 30 | { 31 | return camera->GetNearClipMultiplier(); 32 | } 33 | 34 | void ViewStateAdapter::SetNearPlaneMultiplier(float near_plane_multiplier) 35 | { 36 | camera->SetNearClipMultiplier(near_plane_multiplier); 37 | } 38 | 39 | float ViewStateAdapter::GetMovementSpeed() const 40 | { 41 | return camera->GetMovementSpeed(); 42 | } 43 | 44 | void ViewStateAdapter::SetMovementSpeed(float movement_speed) 45 | { 46 | camera->SetMovementSpeed(movement_speed); 47 | } 48 | 49 | void ViewStateAdapter::SetCameraController(rra::renderer::CameraController* camera_controller) 50 | { 51 | camera->SetCameraController(camera_controller); 52 | } 53 | } // namespace renderer 54 | } // namespace rra 55 | -------------------------------------------------------------------------------- /source/renderer/vk/bounding_volume_mesh.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Declaration for static bounding volume mesh types. 6 | //============================================================================= 7 | 8 | #ifndef RRA_RENDERER_VK_BOUNDING_VOLUME_MESH_H_ 9 | #define RRA_RENDERER_VK_BOUNDING_VOLUME_MESH_H_ 10 | 11 | #include "mesh.h" 12 | 13 | namespace rra 14 | { 15 | namespace renderer 16 | { 17 | /// @brief This type is able to upload geometry for a solid cube. 18 | class SolidBoxMeshInfo : public TypedMesh 19 | { 20 | public: 21 | /// @brief Constructor. 22 | SolidBoxMeshInfo() = default; 23 | 24 | /// @brief Destructor. 25 | virtual ~SolidBoxMeshInfo() = default; 26 | 27 | protected: 28 | /// @brief Populate the provided vertex and index buffer arrays with geometric data. 29 | /// 30 | /// @param [out] indices The index buffer data. 31 | /// @param [out] vertices The vertex buffer data. 32 | virtual void GenerateGeometry(std::vector& indices, std::vector& vertices) override; 33 | }; 34 | 35 | /// @brief This type is able to upload geometry for a wireframe cube. 36 | class WireframeBoxMeshInfo : public TypedMesh 37 | { 38 | public: 39 | /// @brief Constructor. 40 | WireframeBoxMeshInfo() = default; 41 | 42 | /// @brief Destructor. 43 | virtual ~WireframeBoxMeshInfo() = default; 44 | 45 | protected: 46 | /// @brief Populate the provided vertex and index buffer arrays with geometric data. 47 | /// 48 | /// @param [out] indices The index buffer data. 49 | /// @param [out] vertices The vertex buffer data. 50 | virtual void GenerateGeometry(std::vector& indices, std::vector& vertices) override; 51 | }; 52 | } // namespace renderer 53 | } // namespace rra 54 | 55 | #endif // RRA_RENDERER_VK_BOUNDING_VOLUME_MESH_H_ 56 | -------------------------------------------------------------------------------- /source/renderer/vk/framework/ext_gpu_validation.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation for Vulkan GPU validation extensions functionality. 6 | //============================================================================= 7 | 8 | #include "ext_gpu_validation.h" 9 | 10 | #include "public/rra_print.h" 11 | 12 | #include 13 | 14 | namespace rra 15 | { 16 | namespace renderer 17 | { 18 | static VkValidationFeaturesEXT validation_features_ext = {}; 19 | static VkValidationFeatureEnableEXT enabled_validation_features[] = {VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT}; 20 | 21 | bool ExtGPUValidationCheckExtensions(InstanceProperties* instance_properties) 22 | { 23 | std::vector required_extension_names = {VK_EXT_VALIDATION_FEATURES_EXTENSION_NAME}; 24 | 25 | for (auto& ext : required_extension_names) 26 | { 27 | if (instance_properties->AddInstanceExtensionName(ext) == false) 28 | { 29 | RraPrint("GPU validation disabled, missing extension: %s.\n", ext); 30 | return false; 31 | } 32 | } 33 | 34 | validation_features_ext.sType = VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT; 35 | validation_features_ext.enabledValidationFeatureCount = 1; 36 | validation_features_ext.pEnabledValidationFeatures = enabled_validation_features; 37 | validation_features_ext.pNext = instance_properties->GetNext(); 38 | 39 | instance_properties->SetNewNext(&validation_features_ext); 40 | 41 | return true; 42 | } 43 | 44 | } // namespace renderer 45 | } // namespace rra 46 | -------------------------------------------------------------------------------- /source/renderer/vk/framework/ext_gpu_validation.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Declaration for Vulkan GPU validation extensions functionality. 6 | //============================================================================= 7 | 8 | #ifndef RRA_RENDERER_VK_FRAMEWORK_EXT_GPU_VALIDATION_H_ 9 | #define RRA_RENDERER_VK_FRAMEWORK_EXT_GPU_VALIDATION_H_ 10 | 11 | #include "device_properties.h" 12 | #include "instance_properties.h" 13 | 14 | namespace rra 15 | { 16 | namespace renderer 17 | { 18 | /// @brief Initialize the GPU validation extensions if they're available. 19 | /// 20 | /// @param [in] instance_properties The instance properties object. 21 | /// 22 | /// @returns True if the GPU validation extensions are supported, and false if not. 23 | bool ExtGPUValidationCheckExtensions(InstanceProperties* instance_properties); 24 | } // namespace renderer 25 | } // namespace rra 26 | 27 | #endif // RRA_RENDERER_VK_FRAMEWORK_EXT_GPU_VALIDATION_H_ 28 | -------------------------------------------------------------------------------- /source/renderer/vk/framework/ext_validation.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Declaration for Vulkan validation extensions functionality. 6 | //============================================================================= 7 | 8 | #ifndef RRA_RENDERER_VK_FRAMEWORK_EXT_VALIDATION_H_ 9 | #define RRA_RENDERER_VK_FRAMEWORK_EXT_VALIDATION_H_ 10 | 11 | #include "instance_properties.h" 12 | #include "device_properties.h" 13 | 14 | namespace rra 15 | { 16 | namespace renderer 17 | { 18 | /// @brief Check if the debug report instance extension is supported. 19 | /// 20 | /// @param [in] instance_properties The instance properties object. 21 | /// 22 | /// @returns True if the debug report instance extension is supported, and false if it's not. 23 | bool ExtDebugReportCheckInstanceExtensions(InstanceProperties* instance_properties); 24 | 25 | /// @brief Initialize the Debug Report procedure addresses. 26 | /// 27 | /// @param [in] instance The Vulkan instance. 28 | void ExtDebugReportGetProcAddresses(VkInstance instance); 29 | 30 | /// @brief Initialize the Debug Report extension upon creation. 31 | /// 32 | /// @param [in] instance The Vulkan instance. 33 | void ExtDebugReportOnCreate(VkInstance instance); 34 | 35 | /// @brief Destroy the Debug Report extension. 36 | /// 37 | /// @param [in] instance The Vulkan instance. 38 | void ExtDebugReportOnDestroy(VkInstance instance); 39 | } // namespace renderer 40 | } // namespace rra 41 | 42 | #endif // RRA_RENDERER_VK_FRAMEWORK_EXT_VALIDATION_H_ 43 | -------------------------------------------------------------------------------- /source/renderer/vk/framework/instance.h: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Declaration for the Vulkan instance wrapper object. 6 | //============================================================================= 7 | 8 | #ifndef RRA_RENDERER_VK_FRAMEWORK_INSTANCE_H_ 9 | #define RRA_RENDERER_VK_FRAMEWORK_INSTANCE_H_ 10 | 11 | #include 12 | 13 | #include "instance_properties.h" 14 | 15 | namespace rra 16 | { 17 | namespace renderer 18 | { 19 | /// @brief Create the Vulkan instance. 20 | /// 21 | /// @param [in] app_name The application name string. 22 | /// @param [in] engine_name The engine name string. 23 | /// @param [out] instance The handle to the new Vulkan instance. 24 | /// @param [out] physical_device The handle to the physical device. 25 | /// @param [in] instance_properties The instance properties object. 26 | /// 27 | /// @returns The instance creation return code. 28 | VkResult CreateInstance(const char* app_name, 29 | const char* engine_name, 30 | VkInstance* instance, 31 | VkPhysicalDevice* physical_device, 32 | InstanceProperties* instance_properties); 33 | 34 | /// @brief Create the Vulkan instance, enabling requested instance layers & extensions where supported. 35 | /// 36 | /// @param [in] app_info The application name and version info. 37 | /// @param [in] instance_properties The instance properties object. 38 | /// 39 | /// @returns A handle to the new instance. 40 | VkInstance CreateInstance(VkApplicationInfo app_info, InstanceProperties* instance_properties); 41 | 42 | /// @brief Destroy the given instance. 43 | /// 44 | /// @param [in] instance The instance to be destroyed. 45 | void DestroyInstance(VkInstance instance); 46 | } // namespace renderer 47 | } // namespace rra 48 | 49 | #endif // RRA_RENDERER_VK_FRAMEWORK_INSTANCE_H_ 50 | -------------------------------------------------------------------------------- /source/renderer/vk/render_module.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved. 3 | /// @author AMD Developer Tools Team 4 | /// @file 5 | /// @brief Implementation for the Vulkan render module. 6 | //============================================================================= 7 | 8 | #include "render_module.h" 9 | 10 | namespace rra 11 | { 12 | namespace renderer 13 | { 14 | RenderModule::RenderModule(RenderPassHint render_pass_hint) 15 | { 16 | render_pass_hint_ = render_pass_hint; 17 | } 18 | 19 | bool RenderModule::ShouldCopyDepthBuffer() const 20 | { 21 | return false; 22 | } 23 | 24 | void RenderModule::EveryFrameUpdate(Device* device, uint32_t current_frame) 25 | { 26 | // No-op by default. 27 | RRA_UNUSED(device); 28 | RRA_UNUSED(current_frame); 29 | } 30 | 31 | void RenderModule::Enable() 32 | { 33 | enabled_ = true; 34 | } 35 | 36 | void RenderModule::Disable() 37 | { 38 | enabled_ = false; 39 | } 40 | 41 | bool RenderModule::IsEnabled() const 42 | { 43 | return enabled_; 44 | } 45 | 46 | RenderPassHint RenderModule::GetRenderPassHint() const 47 | { 48 | return render_pass_hint_; 49 | } 50 | 51 | void RenderModule::SetRenderPassHint(RenderPassHint render_pass_hint) 52 | { 53 | render_pass_hint_ = render_pass_hint; 54 | } 55 | 56 | RendererInterface* RenderModule::GetRendererInterface() 57 | { 58 | return renderer_interface_; 59 | } 60 | 61 | void RenderModule::SetRendererInterface(RendererInterface* renderer_interface) 62 | { 63 | if (!renderer_interface_) 64 | { 65 | renderer_interface_ = renderer_interface; 66 | } 67 | } 68 | 69 | } // namespace renderer 70 | } // namespace rra 71 | --------------------------------------------------------------------------------