diff --git a/include/librashader.h b/include/librashader.h index 90ccfb5..d034d1f 100644 --- a/include/librashader.h +++ b/include/librashader.h @@ -149,10 +149,10 @@ typedef struct libra_source_image_gl_t { uint32_t handle; /// The format of the source image. uint32_t format; - /// The height of the source image. - uint32_t height; /// The width of the source image. uint32_t width; + /// The height of the source image. + uint32_t height; } libra_source_image_gl_t; #endif @@ -162,10 +162,10 @@ typedef struct libra_viewport_t { float x; /// The y offset in the viewport framebuffer to begin rendering from. float y; - /// The height of the viewport framebuffer. - uint32_t height; /// The width of the viewport framebuffer. uint32_t width; + /// The height of the viewport framebuffer. + uint32_t height; } libra_viewport_t; #if defined(LIBRA_RUNTIME_OPENGL) @@ -206,14 +206,14 @@ typedef struct _filter_chain_d3d11 *libra_d3d11_filter_chain_t; #endif #if defined(LIBRA_RUNTIME_D3D11) -/// OpenGL parameters for the source image. +/// Direct3D 11 parameters for the source image. typedef struct libra_source_image_d3d11_t { /// A shader resource view into the source image const ID3D11ShaderResourceView * handle; - /// The height of the source image. - uint32_t height; /// The width of the source image. uint32_t width; + /// The height of the source image. + uint32_t height; } libra_source_image_d3d11_t; #endif @@ -261,16 +261,16 @@ typedef struct _filter_chain_vk *libra_vk_filter_chain_t; #endif #if defined(LIBRA_RUNTIME_VULKAN) -/// Vulkan parameters for the source image. +/// Vulkan parameters for the source image. typedef struct libra_image_vk_t { /// A raw `VkImage` handle to the source image. VkImage handle; /// The `VkFormat` of the source image. VkFormat format; - /// The height of the source image. - uint32_t height; /// The width of the source image. uint32_t width; + /// The height of the source image. + uint32_t height; } libra_image_vk_t; #endif diff --git a/librashader-capi/src/ctypes.rs b/librashader-capi/src/ctypes.rs index de6b6fc..9c82a45 100644 --- a/librashader-capi/src/ctypes.rs +++ b/librashader-capi/src/ctypes.rs @@ -33,8 +33,8 @@ pub struct libra_viewport_t { pub x: f32, /// The y offset in the viewport framebuffer to begin rendering from. pub y: f32, - /// The height of the viewport framebuffer. - pub height: u32, /// The width of the viewport framebuffer. pub width: u32, + /// The height of the viewport framebuffer. + pub height: u32, } diff --git a/librashader-capi/src/runtime/d3d11/filter_chain.rs b/librashader-capi/src/runtime/d3d11/filter_chain.rs index cdc74d1..76d427a 100644 --- a/librashader-capi/src/runtime/d3d11/filter_chain.rs +++ b/librashader-capi/src/runtime/d3d11/filter_chain.rs @@ -21,10 +21,10 @@ use librashader::runtime::{FilterChainParameters, Size, Viewport}; pub struct libra_source_image_d3d11_t { /// A shader resource view into the source image pub handle: ManuallyDrop, - /// The height of the source image. - pub height: u32, /// The width of the source image. pub width: u32, + /// The height of the source image. + pub height: u32, } impl TryFrom for D3D11InputView { diff --git a/librashader-capi/src/runtime/gl/filter_chain.rs b/librashader-capi/src/runtime/gl/filter_chain.rs index 924ee48..a6e1897 100644 --- a/librashader-capi/src/runtime/gl/filter_chain.rs +++ b/librashader-capi/src/runtime/gl/filter_chain.rs @@ -23,10 +23,10 @@ pub struct libra_source_image_gl_t { pub handle: u32, /// The format of the source image. pub format: u32, - /// The height of the source image. - pub height: u32, /// The width of the source image. pub width: u32, + /// The height of the source image. + pub height: u32, } /// OpenGL parameters for the output framebuffer. diff --git a/librashader-capi/src/runtime/vk/filter_chain.rs b/librashader-capi/src/runtime/vk/filter_chain.rs index 6bc5cf1..5d79026 100644 --- a/librashader-capi/src/runtime/vk/filter_chain.rs +++ b/librashader-capi/src/runtime/vk/filter_chain.rs @@ -28,10 +28,10 @@ pub struct libra_image_vk_t { pub handle: vk::Image, /// The `VkFormat` of the source image. pub format: vk::Format, - /// The height of the source image. - pub height: u32, /// The width of the source image. pub width: u32, + /// The height of the source image. + pub height: u32, } /// Handles required to instantiate vulkan diff --git a/test/capi-tests/librashader-capi-tests/dx11-example-2/code.cpp b/test/capi-tests/librashader-capi-tests/dx11-example-2/code.cpp index f9fba1f..1954b74 100644 --- a/test/capi-tests/librashader-capi-tests/dx11-example-2/code.cpp +++ b/test/capi-tests/librashader-capi-tests/dx11-example-2/code.cpp @@ -476,10 +476,12 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, deviceContext->CopyResource(framebufferCopy, framebufferTexture); - libra_source_image_d3d11_t input = {framebufferCopySRV, framebufferVP.Height, - framebufferVP.Width}; + libra_source_image_d3d11_t input = {framebufferCopySRV, + framebufferVP.Width, + framebufferVP.Height + }; - libra_viewport_t vp = {0, 0, framebufferVP.Height, framebufferVP.Width}; + libra_viewport_t vp = {0, 0, framebufferVP.Width, framebufferVP.Height,}; frame_d3d11_opt_t frame_opt = {.clear_history = false, .frame_direction = -1}; diff --git a/test/capi-tests/librashader-capi-tests/dx11-example/main.cpp b/test/capi-tests/librashader-capi-tests/dx11-example/main.cpp index 7aff0ba..5177d0f 100644 --- a/test/capi-tests/librashader-capi-tests/dx11-example/main.cpp +++ b/test/capi-tests/librashader-capi-tests/dx11-example/main.cpp @@ -397,10 +397,11 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, assert(copySrv != nullptr); - libra_source_image_d3d11_t input = {copySrv, viewport.Height, - viewport.Width}; + libra_source_image_d3d11_t input = {copySrv, + viewport.Width, + viewport.Height,}; - libra_viewport_t vp = {0, 0, viewport.Height, viewport.Width}; + libra_viewport_t vp = {0, 0, viewport.Width, viewport.Height, }; libra.d3d11_filter_chain_frame(&filter_chain, frameCount, input, vp, d3d11FrameBufferView, NULL, NULL);