Skip to content

Commit

Permalink
capi: undo const qualification of chain in _filter_chain_get_param
Browse files Browse the repository at this point in the history
…and `_filter_chain_get_active_pass_count`

This should be done over an ABI bump, even if the headers weren't updated.
  • Loading branch information
chyyran committed Sep 13, 2024
1 parent 6f5b342 commit 98d8d91
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 24 deletions.
20 changes: 7 additions & 13 deletions include/librashader.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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 <https://github.com/libretro/RetroArch/pull/15023> 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.
Expand Down
4 changes: 2 additions & 2 deletions librashader-capi/src/runtime/d3d11/filter_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<f32>
) |chain| {
Expand Down Expand Up @@ -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<u32>
) |chain| {
assert_some_ptr!(chain);
Expand Down
4 changes: 2 additions & 2 deletions librashader-capi/src/runtime/d3d12/filter_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<f32>
) |chain| {
Expand Down Expand Up @@ -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<u32>
) |chain| {
assert_some_ptr!(chain);
Expand Down
4 changes: 2 additions & 2 deletions librashader-capi/src/runtime/d3d9/filter_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<f32>
) |chain| {
Expand Down Expand Up @@ -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<u32>
) |chain| {
assert_some_ptr!(chain);
Expand Down
2 changes: 1 addition & 1 deletion librashader-capi/src/runtime/gl/filter_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<f32>
) |chain| {
Expand Down
4 changes: 2 additions & 2 deletions librashader-capi/src/runtime/mtl/filter_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<f32>
) |chain| {
Expand Down Expand Up @@ -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<u32>
) |chain| {
assert_some_ptr!(chain);
Expand Down
4 changes: 2 additions & 2 deletions librashader-capi/src/runtime/vk/filter_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<f32>
) |chain| {
Expand Down Expand Up @@ -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<u32>
) |chain| {
assert_some_ptr!(chain);
Expand Down

0 comments on commit 98d8d91

Please sign in to comment.