From 98d8d91c660044ad00b4a76a0bf79425be5a5fd6 Mon Sep 17 00:00:00 2001 From: chyyran Date: Fri, 13 Sep 2024 17:17:18 -0400 Subject: [PATCH] capi: undo const qualification of chain in `_filter_chain_get_param` and `_filter_chain_get_active_pass_count` This should be done over an ABI bump, even if the headers weren't updated. --- include/librashader.h | 20 +++++++------------ .../src/runtime/d3d11/filter_chain.rs | 4 ++-- .../src/runtime/d3d12/filter_chain.rs | 4 ++-- .../src/runtime/d3d9/filter_chain.rs | 4 ++-- .../src/runtime/gl/filter_chain.rs | 2 +- .../src/runtime/mtl/filter_chain.rs | 4 ++-- .../src/runtime/vk/filter_chain.rs | 4 ++-- 7 files changed, 18 insertions(+), 24 deletions(-) diff --git a/include/librashader.h b/include/librashader.h index 8a4833e..0c726da 100644 --- a/include/librashader.h +++ b/include/librashader.h @@ -359,9 +359,9 @@ typedef struct _filter_chain_d3d11 *libra_d3d11_filter_chain_t; typedef struct libra_source_image_d3d11_t { /// A shader resource view into the source image ID3D11ShaderResourceView * handle; - /// The width of the source image. + /// This is currently ignored. uint32_t width; - /// The height of the source image. + /// This is currently ignored. uint32_t height; } libra_source_image_d3d11_t; #endif @@ -452,11 +452,11 @@ typedef struct libra_source_image_d3d12_t { ID3D12Resource * resource; /// A CPU descriptor handle to a shader resource view of the image. D3D12_CPU_DESCRIPTOR_HANDLE descriptor; - /// The format of the image. + /// This is currently ignored. DXGI_FORMAT format; - /// The width of the source image. + /// This is currently ignored. uint32_t width; - /// The height of the source image. + /// This is currently ignored. uint32_t height; } libra_source_image_d3d12_t; #endif @@ -1577,9 +1577,6 @@ libra_error_t libra_d3d9_filter_chain_create(libra_shader_preset_t *preset, #if (defined(_WIN32) && defined(LIBRA_RUNTIME_D3D9)) /// Draw a frame with the given parameters for the given filter chain. /// -/// If `device_context` is null, then commands are recorded onto the immediate context. Otherwise, -/// it will record commands onto the provided context. If the context is deferred, librashader -/// will not finalize command lists. The context must otherwise be associated with the `Id3d9Device` /// /// ## Safety /// - `chain` may be null, invalid, but not uninitialized. If `chain` is null or invalid, this @@ -1589,10 +1586,7 @@ libra_error_t libra_d3d9_filter_chain_create(libra_shader_preset_t *preset, /// - `opt` may be null, or if it is not null, must be an aligned pointer to a valid `frame_d3d9_opt_t` /// struct. /// - `out` must not be null. -/// - `image.handle` must not be null. -/// - If `device_context` is null, commands will be recorded onto the immediate context of the `Id3d9Device` -/// this filter chain was created with. The context must otherwise be associated with the `Id3d9Device` -/// the filter chain was created with. +/// - `image` must not be null. /// - You must ensure that only one thread has access to `chain` before you call this function. Only one /// thread at a time may call this function. libra_error_t libra_d3d9_filter_chain_frame(libra_d3d9_filter_chain_t *chain, @@ -1917,7 +1911,7 @@ LIBRASHADER_API_VERSION libra_instance_api_version(void); /// /// These automatically inferred variables, as well as all other variables can be overridden with /// `libra_preset_ctx_set_param`, but the expected string values must be provided. -/// See https://github.com/libretro/RetroArch/pull/15023 for a list of expected string values. +/// See for a list of expected string values. /// /// No variables can be removed once added to the context, however subsequent calls to set the same /// variable will overwrite the expected variable. diff --git a/librashader-capi/src/runtime/d3d11/filter_chain.rs b/librashader-capi/src/runtime/d3d11/filter_chain.rs index c5aa1ca..0c1a8c0 100644 --- a/librashader-capi/src/runtime/d3d11/filter_chain.rs +++ b/librashader-capi/src/runtime/d3d11/filter_chain.rs @@ -282,7 +282,7 @@ extern_fn! { /// - `chain` must be either null or a valid and aligned pointer to an initialized `libra_d3d11_filter_chain_t`. /// - `param_name` must be either null or a null terminated string. fn libra_d3d11_filter_chain_get_param( - chain: *const libra_d3d11_filter_chain_t, + chain: *mut libra_d3d11_filter_chain_t, param_name: *const c_char, out: *mut MaybeUninit ) |chain| { @@ -321,7 +321,7 @@ extern_fn! { /// ## Safety /// - `chain` must be either null or a valid and aligned pointer to an initialized `libra_d3d11_filter_chain_t`. fn libra_d3d11_filter_chain_get_active_pass_count( - chain: *const libra_d3d11_filter_chain_t, + chain: *mut libra_d3d11_filter_chain_t, out: *mut MaybeUninit ) |chain| { assert_some_ptr!(chain); diff --git a/librashader-capi/src/runtime/d3d12/filter_chain.rs b/librashader-capi/src/runtime/d3d12/filter_chain.rs index bda7972..53d60a0 100644 --- a/librashader-capi/src/runtime/d3d12/filter_chain.rs +++ b/librashader-capi/src/runtime/d3d12/filter_chain.rs @@ -302,7 +302,7 @@ extern_fn! { /// - `chain` must be either null or a valid and aligned pointer to an initialized `libra_d3d12_filter_chain_t`. /// - `param_name` must be either null or a null terminated string. fn libra_d3d12_filter_chain_get_param( - chain: *const libra_d3d12_filter_chain_t, + chain: *mut libra_d3d12_filter_chain_t, param_name: *const c_char, out: *mut MaybeUninit ) |chain| { @@ -341,7 +341,7 @@ extern_fn! { /// ## Safety /// - `chain` must be either null or a valid and aligned pointer to an initialized `libra_d3d12_filter_chain_t`. fn libra_d3d12_filter_chain_get_active_pass_count( - chain: *const libra_d3d12_filter_chain_t, + chain: *mut libra_d3d12_filter_chain_t, out: *mut MaybeUninit ) |chain| { assert_some_ptr!(chain); diff --git a/librashader-capi/src/runtime/d3d9/filter_chain.rs b/librashader-capi/src/runtime/d3d9/filter_chain.rs index 3be1c6f..80fbac7 100644 --- a/librashader-capi/src/runtime/d3d9/filter_chain.rs +++ b/librashader-capi/src/runtime/d3d9/filter_chain.rs @@ -192,7 +192,7 @@ extern_fn! { /// - `chain` must be either null or a valid and aligned pointer to an initialized `libra_d3d9_filter_chain_t`. /// - `param_name` must be either null or a null terminated string. fn libra_d3d9_filter_chain_get_param( - chain: *const libra_d3d9_filter_chain_t, + chain: *mut libra_d3d9_filter_chain_t, param_name: *const c_char, out: *mut MaybeUninit ) |chain| { @@ -231,7 +231,7 @@ extern_fn! { /// ## Safety /// - `chain` must be either null or a valid and aligned pointer to an initialized `libra_d3d9_filter_chain_t`. fn libra_d3d9_filter_chain_get_active_pass_count( - chain: *const libra_d3d9_filter_chain_t, + chain: *mut libra_d3d9_filter_chain_t, out: *mut MaybeUninit ) |chain| { assert_some_ptr!(chain); diff --git a/librashader-capi/src/runtime/gl/filter_chain.rs b/librashader-capi/src/runtime/gl/filter_chain.rs index dc19559..ce697b8 100644 --- a/librashader-capi/src/runtime/gl/filter_chain.rs +++ b/librashader-capi/src/runtime/gl/filter_chain.rs @@ -249,7 +249,7 @@ extern_fn! { /// - `chain` must be either null or a valid and aligned pointer to an initialized `libra_gl_filter_chain_t`. /// - `param_name` must be either null or a null terminated string. fn libra_gl_filter_chain_get_param( - chain: *const libra_gl_filter_chain_t, + chain: *mut libra_gl_filter_chain_t, param_name: *const c_char, out: *mut MaybeUninit ) |chain| { diff --git a/librashader-capi/src/runtime/mtl/filter_chain.rs b/librashader-capi/src/runtime/mtl/filter_chain.rs index 32425d1..46d612d 100644 --- a/librashader-capi/src/runtime/mtl/filter_chain.rs +++ b/librashader-capi/src/runtime/mtl/filter_chain.rs @@ -250,7 +250,7 @@ extern_fn! { /// - `chain` must be either null or a valid and aligned pointer to an initialized `libra_mtl_filter_chain_t`. /// - `param_name` must be either null or a null terminated string. fn libra_mtl_filter_chain_get_param( - chain: *const libra_mtl_filter_chain_t, + chain: *mut libra_mtl_filter_chain_t, param_name: *const c_char, out: *mut MaybeUninit ) |chain| { @@ -289,7 +289,7 @@ extern_fn! { /// ## Safety /// - `chain` must be either null or a valid and aligned pointer to an initialized `libra_mtl_filter_chain_t`. fn libra_mtl_filter_chain_get_active_pass_count( - chain: *const libra_mtl_filter_chain_t, + chain: *mut libra_mtl_filter_chain_t, out: *mut MaybeUninit ) |chain| { assert_some_ptr!(chain); diff --git a/librashader-capi/src/runtime/vk/filter_chain.rs b/librashader-capi/src/runtime/vk/filter_chain.rs index 5f51e16..b1181d5 100644 --- a/librashader-capi/src/runtime/vk/filter_chain.rs +++ b/librashader-capi/src/runtime/vk/filter_chain.rs @@ -328,7 +328,7 @@ extern_fn! { /// - `chain` must be either null or a valid and aligned pointer to an initialized `libra_vk_filter_chain_t`. /// - `param_name` must be either null or a null terminated string. fn libra_vk_filter_chain_get_param( - chain: *const libra_vk_filter_chain_t, + chain: *mut libra_vk_filter_chain_t, param_name: *const c_char, out: *mut MaybeUninit ) |chain| { @@ -367,7 +367,7 @@ extern_fn! { /// ## Safety /// - `chain` must be either null or a valid and aligned pointer to an initialized `libra_vk_filter_chain_t`. fn libra_vk_filter_chain_get_active_pass_count( - chain: *const libra_vk_filter_chain_t, + chain: *mut libra_vk_filter_chain_t, out: *mut MaybeUninit ) |chain| { assert_some_ptr!(chain);