Skip to content

Commit

Permalink
capi: add preset_ctx C API
Browse files Browse the repository at this point in the history
  • Loading branch information
chyyran committed Feb 9, 2024
1 parent 9732812 commit 2fbc7f9
Show file tree
Hide file tree
Showing 17 changed files with 3,173 additions and 629 deletions.
1,422 changes: 874 additions & 548 deletions include/librashader.h

Large diffs are not rendered by default.

343 changes: 295 additions & 48 deletions include/librashader_ld.h

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions librashader-build-script/src/main.rs
Expand Up @@ -73,8 +73,7 @@ pub fn main() {
let ext = ext.replace("_capi", "");
fs::rename(output_dir.join(artifact), output_dir.join(ext)).unwrap();
}
}
else if cfg!(target_family = "unix") {
} else if cfg!(target_family = "unix") {
let artifacts = &["liblibrashader_capi.so", "liblibrashader_capi.a"];
for artifact in artifacts {
let ext = artifact.strip_prefix("lib").unwrap();
Expand Down
23 changes: 22 additions & 1 deletion librashader-capi/cbindgen.toml
Expand Up @@ -99,6 +99,20 @@ include = [
"PFN_libra_preset_print",
"PFN_libra_preset_get_runtime_params",
"PFN_libra_preset_free_runtime_params",
"PFN_libra_preset_create_with_context",

"PFN_libra_preset_ctx_create",
"PFN_libra_preset_ctx_free",
"PFN_libra_preset_ctx_set_core_name",
"PFN_libra_preset_ctx_set_content_dir",
"PFN_libra_preset_ctx_set_param",
"PFN_libra_preset_ctx_set_core_rotation",
"PFN_libra_preset_ctx_set_user_rotation",
"PFN_libra_preset_ctx_set_screen_orientation",
"PFN_libra_preset_ctx_set_allow_rotation",
"PFN_libra_preset_ctx_set_view_aspect_orientation",
"PFN_libra_preset_ctx_set_core_aspect_orientation",
"PFN_libra_preset_ctx_set_runtime",

# error
"PFN_libra_error_errno",
Expand Down Expand Up @@ -147,13 +161,20 @@ include = [
"PFN_libra_d3d12_filter_chain_set_active_pass_count",
"PFN_libra_d3d12_filter_chain_get_active_pass_count",
"PFN_libra_d3d12_filter_chain_free",

"WildcardPresetContext"
]

exclude = ["Option_ID3D11DeviceContext"]

[export.rename]
"LibrashaderError" = "_libra_error"
"ShaderPreset" = "_shader_preset"

# I don't know why its literally just WildcardContext??
"WildcardContext" = "_preset_ctx"
"WildcardPresetContext" = "_aaaa_preset_ctx"

"FilterChainGL" = "_filter_chain_gl"
"FilterChainVulkan" = "_filter_chain_vk"
"FilterChainD3D11" = "_filter_chain_d3d11"
Expand All @@ -180,4 +201,4 @@ exclude = ["Option_ID3D11DeviceContext"]
# hack to get proper pointer indirection for COM pointers
"ID3D12Device" = "ID3D12Device *"
"ID3D12Resource" = "ID3D12Resource *"
"ID3D12GraphicsCommandList" = "ID3D12GraphicsCommandList *"
"ID3D12GraphicsCommandList" = "ID3D12GraphicsCommandList *"

0 comments on commit 2fbc7f9

Please sign in to comment.