2022-12-04 10:32:10 +11:00
|
|
|
language = "C"
|
|
|
|
cpp_compat = true
|
|
|
|
include_guard = "__LIBRASHADER_H__"
|
|
|
|
pragma_once = true
|
|
|
|
usize_is_size_t = true
|
2022-12-05 14:37:03 +11:00
|
|
|
documentation_style = "c++"
|
2023-01-27 11:05:48 +11:00
|
|
|
header = """
|
|
|
|
/*
|
|
|
|
librashader.h
|
|
|
|
SPDX-License-Identifier: MIT
|
|
|
|
This file is part of the librashader C headers.
|
|
|
|
|
|
|
|
Copyright 2022 chyyran
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
|
|
this software and associated documentation files (the "Software"), to deal in
|
|
|
|
the Software without restriction, including without limitation the rights to
|
|
|
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
|
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
|
|
subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in all
|
|
|
|
copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
|
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
|
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
|
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
"""
|
|
|
|
|
|
|
|
after_includes = """
|
|
|
|
#if defined(_WIN32) && defined(LIBRA_RUNTIME_D3D11)
|
|
|
|
#include <d3d11.h>
|
|
|
|
#else
|
|
|
|
typedef void ID3D11Device;
|
2023-02-11 10:08:11 +11:00
|
|
|
typedef void ID3D11DeviceContext;
|
2023-01-27 11:05:48 +11:00
|
|
|
typedef void ID3D11RenderTargetView;
|
|
|
|
typedef void ID3D11ShaderResourceView;
|
|
|
|
#endif
|
|
|
|
#if defined(LIBRA_RUNTIME_VULKAN)
|
|
|
|
#include <vulkan\\vulkan.h>
|
|
|
|
#else
|
|
|
|
typedef int32_t VkFormat;
|
|
|
|
typedef uint64_t VkImage;
|
|
|
|
typedef void* VkPhysicalDevice;
|
|
|
|
typedef void* VkInstance;
|
|
|
|
typedef void* VkCommandBuffer;
|
|
|
|
#endif
|
2023-02-06 18:17:30 +11:00
|
|
|
#if defined(_WIN32) && defined(LIBRA_RUNTIME_D3D12)
|
|
|
|
#include <d3d12.h>
|
|
|
|
#else
|
|
|
|
typedef void ID3D12GraphicsCommandList;
|
|
|
|
typedef void ID3D12Device;
|
|
|
|
typedef void ID3D12Resource;
|
|
|
|
typedef void D3D12_CPU_DESCRIPTOR_HANDLE;
|
|
|
|
#endif
|
2023-01-27 11:05:48 +11:00
|
|
|
"""
|
2023-01-14 08:05:13 +11:00
|
|
|
|
|
|
|
[defines]
|
|
|
|
"feature = runtime-opengl" = "LIBRA_RUNTIME_OPENGL"
|
2023-01-14 09:59:22 +11:00
|
|
|
"feature = runtime-vulkan" = "LIBRA_RUNTIME_VULKAN"
|
2023-02-06 18:17:30 +11:00
|
|
|
"feature = runtime-d3d11" = "LIBRA_RUNTIME_D3D11"
|
|
|
|
"feature = runtime-d3d12" = "LIBRA_RUNTIME_D3D12"
|
2023-01-14 08:05:13 +11:00
|
|
|
|
2023-02-11 10:08:11 +11:00
|
|
|
|
2022-12-04 10:32:10 +11:00
|
|
|
[parse]
|
|
|
|
parse_deps = true
|
|
|
|
include = ["librashader",
|
|
|
|
"librashader-presets",
|
|
|
|
"librashader-preprocess",
|
|
|
|
"librashader-reflect",
|
2022-12-05 15:54:47 +11:00
|
|
|
"librashader-runtime-gl",
|
2023-01-14 09:59:22 +11:00
|
|
|
"librashader-runtime-vk",
|
2023-02-06 18:17:30 +11:00
|
|
|
"librashader-runtime-d3d11",
|
|
|
|
"librashader-runtime-d3d12",
|
2022-12-04 10:32:10 +11:00
|
|
|
]
|
2023-01-14 08:05:13 +11:00
|
|
|
expand = ["librashader-capi"]
|
2022-12-04 10:32:10 +11:00
|
|
|
|
|
|
|
[struct]
|
|
|
|
|
|
|
|
[enum]
|
|
|
|
rename_variants = "ScreamingSnakeCase"
|
|
|
|
prefix_with_name = true
|
|
|
|
|
|
|
|
[export]
|
|
|
|
include = [
|
2023-02-12 07:37:21 +11:00
|
|
|
# instance
|
|
|
|
"PFN_libra_instance_abi_version",
|
|
|
|
"PFN_libra_instance_api_version",
|
|
|
|
|
2022-12-05 14:37:03 +11:00
|
|
|
# preset
|
2023-01-14 11:17:57 +11:00
|
|
|
"PFN_libra_preset_create",
|
2023-01-14 08:05:13 +11:00
|
|
|
"PFN_libra_preset_free",
|
|
|
|
"PFN_libra_preset_set_param",
|
|
|
|
"PFN_libra_preset_get_param",
|
|
|
|
"PFN_libra_preset_print",
|
2023-01-15 09:14:37 +11:00
|
|
|
"PFN_libra_preset_get_runtime_params",
|
|
|
|
"PFN_libra_preset_free_runtime_params",
|
2022-12-05 14:37:03 +11:00
|
|
|
|
|
|
|
# error
|
2023-01-14 08:05:13 +11:00
|
|
|
"PFN_libra_error_errno",
|
|
|
|
"PFN_libra_error_print",
|
|
|
|
"PFN_libra_error_free",
|
|
|
|
"PFN_libra_error_write",
|
|
|
|
"PFN_libra_error_free_string",
|
2022-12-05 16:06:37 +11:00
|
|
|
|
|
|
|
# gl
|
2023-01-14 08:05:13 +11:00
|
|
|
"PFN_libra_gl_init_context",
|
|
|
|
"PFN_libra_gl_filter_chain_create",
|
|
|
|
"PFN_libra_gl_filter_chain_frame",
|
2023-01-15 01:36:26 +11:00
|
|
|
"PFN_libra_gl_filter_chain_set_param",
|
|
|
|
"PFN_libra_gl_filter_chain_get_param",
|
|
|
|
"PFN_libra_gl_filter_chain_set_active_pass_count",
|
|
|
|
"PFN_libra_gl_filter_chain_get_active_pass_count",
|
2023-01-14 08:05:13 +11:00
|
|
|
"PFN_libra_gl_filter_chain_free",
|
2022-12-05 16:06:37 +11:00
|
|
|
|
2023-02-06 18:17:30 +11:00
|
|
|
# vulkan
|
|
|
|
"PFN_libra_vk_filter_chain_create",
|
2023-02-11 19:46:42 +11:00
|
|
|
"PFN_libra_vk_filter_chain_create_deferred",
|
2023-02-06 18:17:30 +11:00
|
|
|
"PFN_libra_vk_filter_chain_frame",
|
|
|
|
"PFN_libra_vk_filter_chain_set_param",
|
|
|
|
"PFN_libra_vk_filter_chain_get_param",
|
|
|
|
"PFN_libra_vk_filter_chain_set_active_pass_count",
|
|
|
|
"PFN_libra_vk_filter_chain_get_active_pass_count",
|
|
|
|
"PFN_libra_vk_filter_chain_free",
|
|
|
|
|
2022-12-05 16:06:37 +11:00
|
|
|
# d3d11
|
2023-01-14 08:05:13 +11:00
|
|
|
"PFN_libra_d3d11_filter_chain_create",
|
2023-02-11 19:46:42 +11:00
|
|
|
"PFN_libra_d3d11_filter_chain_create_deferred",
|
2023-01-14 08:05:13 +11:00
|
|
|
"PFN_libra_d3d11_filter_chain_frame",
|
2023-01-15 01:36:26 +11:00
|
|
|
"PFN_libra_d3d11_filter_chain_set_param",
|
|
|
|
"PFN_libra_d3d11_filter_chain_get_param",
|
|
|
|
"PFN_libra_d3d11_filter_chain_set_active_pass_count",
|
|
|
|
"PFN_libra_d3d11_filter_chain_get_active_pass_count",
|
2023-01-14 08:05:13 +11:00
|
|
|
"PFN_libra_d3d11_filter_chain_free",
|
2023-01-14 11:17:57 +11:00
|
|
|
|
2023-02-06 18:17:30 +11:00
|
|
|
|
2023-02-11 19:46:42 +11:00
|
|
|
# d3d12
|
2023-02-06 18:17:30 +11:00
|
|
|
"PFN_libra_d3d12_filter_chain_create",
|
2023-02-11 19:46:42 +11:00
|
|
|
"PFN_libra_d3d12_filter_chain_create_deferred",
|
2023-02-06 18:17:30 +11:00
|
|
|
"PFN_libra_d3d12_filter_chain_frame",
|
|
|
|
"PFN_libra_d3d12_filter_chain_set_param",
|
|
|
|
"PFN_libra_d3d12_filter_chain_get_param",
|
|
|
|
"PFN_libra_d3d12_filter_chain_set_active_pass_count",
|
|
|
|
"PFN_libra_d3d12_filter_chain_get_active_pass_count",
|
|
|
|
"PFN_libra_d3d12_filter_chain_free",
|
2022-12-04 10:32:10 +11:00
|
|
|
]
|
|
|
|
|
2023-02-11 10:08:11 +11:00
|
|
|
exclude = ["Option_ID3D11DeviceContext"]
|
|
|
|
|
2022-12-04 10:32:10 +11:00
|
|
|
[export.rename]
|
|
|
|
"LibrashaderError" = "_libra_error"
|
|
|
|
"ShaderPreset" = "_shader_preset"
|
2022-12-04 10:56:57 +11:00
|
|
|
"FilterChainGL" = "_filter_chain_gl"
|
2023-01-14 09:59:22 +11:00
|
|
|
"FilterChainVulkan" = "_filter_chain_vk"
|
2023-02-06 18:17:30 +11:00
|
|
|
"FilterChainD3D11" = "_filter_chain_d3d11"
|
|
|
|
"FilterChainD3D12" = "_filter_chain_d3d12"
|
2023-01-14 09:59:22 +11:00
|
|
|
|
|
|
|
# vulkan renames
|
|
|
|
"PhysicalDevice" = "VkPhysicalDevice"
|
|
|
|
"Instance" = "VkInstance"
|
|
|
|
"Device" = "VkDevice"
|
|
|
|
"CommandBuffer" = "VkCommandBuffer"
|
|
|
|
"Format" = "VkFormat"
|
2023-01-27 11:05:48 +11:00
|
|
|
"Image" = "VkImage"
|
|
|
|
|
2023-02-11 10:08:11 +11:00
|
|
|
# hack to get proper pointer indirection for COM pointers
|
|
|
|
# we don't need one for ID3D11DeviceContext.
|
|
|
|
"ID3D11Device" = "ID3D11Device *"
|
|
|
|
"ID3D11DeviceContext" = "ID3D11DeviceContext *"
|
|
|
|
"ID3D11RenderTargetView" = "ID3D11RenderTargetView *"
|
|
|
|
"ID3D11ShaderResourceView" = "ID3D11ShaderResourceView *"
|
|
|
|
|
|
|
|
# hack to force cbindgen to not generate option type for nullable ID3D11DeviceContext.
|
|
|
|
"Option_ID3D11DeviceContext" = "ID3D11DeviceContext *"
|
2023-02-06 18:17:30 +11:00
|
|
|
|
2023-02-11 10:08:11 +11:00
|
|
|
# hack to get proper pointer indirection for COM pointers
|
|
|
|
"ID3D12Device" = "ID3D12Device *"
|
|
|
|
"ID3D12Resource" = "ID3D12Resource *"
|
|
|
|
"ID3D12GraphicsCommandList" = "ID3D12GraphicsCommandList *"
|