diff --git a/.idea/src.iml b/.idea/src.iml
index bb57c00..6fdd171 100644
--- a/.idea/src.iml
+++ b/.idea/src.iml
@@ -15,6 +15,9 @@
+
+
+
diff --git a/librashader-capi/cbindgen.toml b/librashader-capi/cbindgen.toml
index ff08f9d..8096adc 100644
--- a/librashader-capi/cbindgen.toml
+++ b/librashader-capi/cbindgen.toml
@@ -28,7 +28,7 @@ include = [
"PFN_lbr_preset_get_param",
"PFN_lbr_preset_print",
"PFN_lbr_preset_get_runtime_param_names",
- "GLFilterChain"
+ "FilterChain"
]
@@ -37,5 +37,5 @@ include = [
[export.rename]
"LibrashaderError" = "_libra_error"
"ShaderPreset" = "_shader_preset"
-"GLFilterChain" = "_filter_chain_gl"
-"GLFilterChainOptions" = "filter_chain_gl_opt_t"
+"FilterChainGL" = "_filter_chain_gl"
+"FilterChainOptionsGL" = "filter_chain_gl_opt_t"
diff --git a/librashader-capi/librashader.h b/librashader-capi/librashader.h
index 71f866a..13f6653 100644
--- a/librashader-capi/librashader.h
+++ b/librashader-capi/librashader.h
@@ -9,7 +9,7 @@
#include
#include
-typedef struct FilterChain FilterChain;
+typedef struct _filter_chain_gl _filter_chain_gl;
typedef struct _libra_error _libra_error;
@@ -27,12 +27,34 @@ typedef struct _shader_preset *libra_shader_preset_t;
typedef const void *(*gl_loader_t)(const char*);
-typedef struct FilterChainOptions {
+typedef struct filter_chain_gl_opt_t {
uint16_t gl_version;
bool use_dsa;
-} FilterChainOptions;
+} filter_chain_gl_opt_t;
-typedef struct FilterChain *libra_gl_filter_chain_t;
+typedef struct _filter_chain_gl *libra_gl_filter_chain_t;
+
+typedef struct libra_source_image_gl_t {
+ uint32_t handle;
+ uint32_t format;
+ uint32_t width;
+ uint32_t height;
+} libra_source_image_gl_t;
+
+typedef struct libra_viewport_t {
+ float x;
+ float y;
+ uint32_t width;
+ uint32_t height;
+} libra_viewport_t;
+
+typedef struct libra_draw_framebuffer_gl_t {
+ uint32_t handle;
+ uint32_t texture;
+ uint32_t format;
+ uint32_t width;
+ uint32_t height;
+} libra_draw_framebuffer_gl_t;
/**
* Load a preset.
@@ -106,9 +128,16 @@ libra_error_t libra_gl_init_context(gl_loader_t loader);
* - `out` may be either null or uninitialized, but must be aligned.
*/
libra_error_t libra_gl_create_filter_chain(libra_shader_preset_t *preset,
- const struct FilterChainOptions *options,
+ const struct filter_chain_gl_opt_t *options,
libra_gl_filter_chain_t *out);
+libra_error_t libra_gl_filter_chain_frame(libra_gl_filter_chain_t *chain,
+ size_t frame_count,
+ struct libra_source_image_gl_t image,
+ struct libra_viewport_t viewport,
+ struct libra_draw_framebuffer_gl_t out,
+ const float *mvp);
+
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
diff --git a/librashader-capi/src/ctypes.rs b/librashader-capi/src/ctypes.rs
index 1668566..485f60c 100644
--- a/librashader-capi/src/ctypes.rs
+++ b/librashader-capi/src/ctypes.rs
@@ -7,3 +7,11 @@ pub type libra_error_t = *const LibrashaderError;
// #[cfg(feature = "runtime-opengl")]
pub type libra_gl_filter_chain_t = ManuallyDrop