|
102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
|
#include "backend_sdl3gpu_private.h"#include "graphics_private.h"#include <dttr_log.h>#include <dttr_config.h>#include <math.h>#include <stdlib.h>#include <string.h>Go to the source code of this file.
Data Structures | |
| struct | graphics_pending_upload |
| struct | graphics_replay_stats |
| struct | graphics_replay_state |
Macros | |
| #define | DRIVER_DISPLAY_VULKAN "Vulkan" |
| #define | DRIVER_DISPLAY_DIRECT3D12 "Direct3D 12" |
Variables | |
| static const DTTR_RendererVtbl | renderer |
| #define DRIVER_DISPLAY_DIRECT3D12 "Direct3D 12" |
Definition at line 9 of file backend_sdl3gpu.c.
Referenced by driver_display_name().
| #define DRIVER_DISPLAY_VULKAN "Vulkan" |
Definition at line 8 of file backend_sdl3gpu.c.
Referenced by driver_display_name().
|
static |
Definition at line 368 of file backend_sdl3gpu.c.
References DTTR_UploadPoolSlot::capacity, create_upload_buffer(), DTTR_UPLOAD_POOL_SIZE, DTTR_UploadPoolSlot::in_use, NULL, state, and DTTR_UploadPoolSlot::transfer_buffer.
Referenced by upload_texture_data().
|
static |
Definition at line 803 of file backend_sdl3gpu.c.
References bind_frame_vertex_buffer(), DTTR_BatchRecord::clear, DTTR_BatchRecord::color, DTTR_BatchRecord::depth, DTTR_CLEAR_COLOR, DTTR_CLEAR_DEPTH, end_render_pass_if_active(), DTTR_BatchRecord::flags, msaa_enabled(), NULL, reset_replay_state(), set_default_viewport(), and state.
Referenced by replay_batch_records().
|
static |
Definition at line 753 of file backend_sdl3gpu.c.
References bind_frame_vertex_buffer(), DTTR_LOG_WARN, msaa_enabled(), NULL, set_default_viewport(), and state.
Referenced by draw_batch_record().
|
static |
Definition at line 950 of file backend_sdl3gpu.c.
References dttr_graphics_is_gpu_thread(), dttr_graphics_mod_frame_begin(), DTTR_LOG_ERROR, DTTR_LOG_WARN, NULL, release_deferred_texture_destroys(), state, and upload_pending_textures().
|
static |
Definition at line 423 of file backend_sdl3gpu.c.
References state.
Referenced by begin_clear_pass(), and begin_draw_pass_if_needed().
|
static |
Definition at line 264 of file backend_sdl3gpu.c.
References DTTR_UploadPoolSlot::capacity, DTTR_PIPELINE_COUNT, DTTR_SAMPLER_COUNT, DTTR_UPLOAD_POOL_SIZE, free, DTTR_UploadPoolSlot::in_use, NULL, release_window_device(), state, and DTTR_UploadPoolSlot::transfer_buffer.
Referenced by dttr_graphics_sdl3gpu_init().
|
static |
Definition at line 556 of file backend_sdl3gpu.c.
References dttr_config, dttr_graphics_ensure_staged_texture(), DTTR_MAX_STAGED_TEXTURES, free, NULL, st, state, and upload_texture_data().
Referenced by upload_pending_textures().
|
static |
Definition at line 187 of file backend_sdl3gpu.c.
References dttr_config, DTTR_DRIVER_DIRECT3D12, DTTR_DRIVER_VULKAN, dttr_graphics_requested_shader_formats(), DTTR_LOG_ERROR, graphics_api_driver_name(), NULL, state, and try_create_device_for_driver().
Referenced by dttr_graphics_sdl3gpu_init().
|
static |
Definition at line 347 of file backend_sdl3gpu.c.
References state.
Referenced by acquire_upload_pool_slot(), present_video_frame_bgra(), and upload_texture_data().
|
static |
Definition at line 465 of file backend_sdl3gpu.c.
References sdl3_gpu_backend_data::deferred_destroy_count, sdl3_gpu_backend_data::deferred_destroys, DTTR_MAX_STAGED_TEXTURES, st, and state.
|
static |
Definition at line 85 of file backend_sdl3gpu.c.
Referenced by release_window_device(), and try_create_device_for_driver().
|
static |
Definition at line 842 of file backend_sdl3gpu.c.
References begin_draw_pass_if_needed(), DTTR_BatchRecord::blend_mode, DTTR_BatchRecord::depth_test, DTTR_BatchRecord::depth_write, DTTR_BatchRecord::draw, graphics_replay_stats::draw_count, DTTR_PIPELINE_INDEX, DTTR_BatchRecord::first_vertex, graphics_replay_state::last_pipeline_idx, graphics_replay_state::last_sampler, graphics_replay_state::last_texture, graphics_replay_stats::pipeline_bind_count, reset_replay_state(), DTTR_BatchRecord::sampler, graphics_replay_stats::sampler_bind_count, state, DTTR_BatchRecord::texture, DTTR_BatchRecord::uniforms, and DTTR_BatchRecord::vertex_count.
Referenced by replay_batch_records().
|
static |
Definition at line 1298 of file backend_sdl3gpu.c.
References DRIVER_DISPLAY_DIRECT3D12, DRIVER_DISPLAY_VULKAN, DTTR_DRIVER_DIRECT3D12, and DTTR_DRIVER_VULKAN.
Referenced by get_driver_name().
| bool dttr_graphics_sdl3gpu_init | ( | DTTR_BackendState * | state | ) |
Definition at line 224 of file backend_sdl3gpu.c.
References cleanup(), create_device(), DTTR_BACKEND_SDL_GPU, dttr_config, dttr_graphics_sdl3gpu_create_pipelines(), dttr_graphics_sdl3gpu_create_resources(), dttr_graphics_shader_format_name(), DTTR_LOG_ERROR, DTTR_LOG_INFO, msaa_sample_count_to_int(), NULL, release_window_device(), renderer, select_msaa_sample_count(), and state.
|
static |
Definition at line 1006 of file backend_sdl3gpu.c.
References graphics_replay_stats::clear_count, graphics_replay_stats::draw_count, dst, dttr_config, dttr_graphics_compute_present_rect(), dttr_graphics_mod_after_game_frame(), dttr_graphics_mod_before_game_frame(), dttr_graphics_mod_frame_end(), dttr_graphics_mod_present_rect_after(), dttr_graphics_mod_present_rect_before(), dttr_imgui_render_game_sdl3gpu(), dttr_imgui_render_sdl3gpu(), DTTR_SCALING_METHOD_LOGICAL, DTTR_SCALING_MODE_INTEGER, DTTR_SCALING_MODE_STRETCH, DTTR_VERTEX_SIZE, DTTR_PresentRect::h, NULL, graphics_replay_stats::pipeline_bind_count, replay_batch_records(), graphics_replay_stats::sampler_bind_count, src, state, DTTR_PresentRect::w, DTTR_PresentRect::x, and DTTR_PresentRect::y.
|
static |
Definition at line 438 of file backend_sdl3gpu.c.
Referenced by begin_clear_pass(), and replay_batch_records().
|
static |
Definition at line 1130 of file backend_sdl3gpu.c.
Referenced by present_video_frame_bgra().
|
static |
Definition at line 661 of file backend_sdl3gpu.c.
References graphics_pending_upload::bytes, and state.
Referenced by upload_pending_textures().
|
static |
Definition at line 1310 of file backend_sdl3gpu.c.
References driver_display_name(), and state.
|
static |
Definition at line 175 of file backend_sdl3gpu.c.
References DTTR_DRIVER_DIRECT3D12, DTTR_DRIVER_VULKAN, DTTR_GRAPHICS_API_DIRECT3D12, DTTR_GRAPHICS_API_VULKAN, and NULL.
Referenced by create_device().
|
static |
Definition at line 342 of file backend_sdl3gpu.c.
Referenced by begin_clear_pass(), and begin_draw_pass_if_needed().
|
static |
Definition at line 23 of file backend_sdl3gpu.c.
Referenced by select_msaa_sample_count().
|
static |
Definition at line 36 of file backend_sdl3gpu.c.
Referenced by dttr_graphics_sdl3gpu_init(), and select_msaa_sample_count().
|
static |
Definition at line 1165 of file backend_sdl3gpu.c.
References create_upload_buffer(), dst, dttr_config, dttr_graphics_compute_present_rect(), dttr_graphics_is_gpu_thread(), ensure_video_texture(), DTTR_PresentRect::h, h, NULL, src, state, stride, DTTR_PresentRect::w, DTTR_PresentRect::x, and DTTR_PresentRect::y.
|
static |
Definition at line 448 of file backend_sdl3gpu.c.
References sdl3_gpu_backend_data::deferred_destroy_count, sdl3_gpu_backend_data::deferred_destroys, and state.
Referenced by begin_frame().
|
static |
Definition at line 359 of file backend_sdl3gpu.c.
References DTTR_UPLOAD_POOL_SIZE, and state.
Referenced by upload_texture_data().
|
static |
Definition at line 94 of file backend_sdl3gpu.c.
References destroy_device(), and state.
Referenced by cleanup(), dttr_graphics_sdl3gpu_init(), and try_create_device_for_driver().
|
static |
Definition at line 922 of file backend_sdl3gpu.c.
References begin_clear_pass(), graphics_replay_stats::clear_count, draw_batch_record(), DTTR_BATCH_CLEAR, end_render_pass_if_active(), NULL, reset_replay_state(), state, and DTTR_BatchRecord::type.
Referenced by end_frame().
|
static |
Definition at line 791 of file backend_sdl3gpu.c.
References graphics_replay_state::last_pipeline_idx, graphics_replay_state::last_sampler, graphics_replay_state::last_texture, and NULL.
Referenced by begin_clear_pass(), draw_batch_record(), and replay_batch_records().
|
static |
Definition at line 1293 of file backend_sdl3gpu.c.
References dttr_graphics_sdl3gpu_resize_render_textures(), and state.
|
static |
Definition at line 50 of file backend_sdl3gpu.c.
References dttr_config, DTTR_LOG_WARN, msaa_sample_count_from_config(), msaa_sample_count_to_int(), and state.
Referenced by dttr_graphics_sdl3gpu_init().
|
static |
Definition at line 725 of file backend_sdl3gpu.c.
Referenced by begin_clear_pass(), and begin_draw_pass_if_needed().
|
static |
Definition at line 104 of file backend_sdl3gpu.c.
References destroy_device(), dttr_graphics_select_shader_format_for_driver(), DTTR_LOG_ERROR, DTTR_LOG_WARN, release_window_device(), and state.
Referenced by create_device().
|
static |
Definition at line 692 of file backend_sdl3gpu.c.
References collect_and_upload_pending(), DTTR_MAX_STAGED_TEXTURES, generate_pending_mipmaps(), and state.
Referenced by begin_frame().
|
static |
Definition at line 480 of file backend_sdl3gpu.c.
References acquire_upload_pool_slot(), create_upload_buffer(), dst, dttr_config, free, h, NULL, release_upload_pool_slot(), src, and state.
Referenced by collect_and_upload_pending().
|
static |
Definition at line 20 of file backend_sdl3gpu.c.