capi: swap width and height back
This commit is contained in:
parent
1e99c169db
commit
7900f8538e
7 changed files with 27 additions and 24 deletions
|
@ -149,10 +149,10 @@ typedef struct libra_source_image_gl_t {
|
||||||
uint32_t handle;
|
uint32_t handle;
|
||||||
/// The format of the source image.
|
/// The format of the source image.
|
||||||
uint32_t format;
|
uint32_t format;
|
||||||
/// The height of the source image.
|
|
||||||
uint32_t height;
|
|
||||||
/// The width of the source image.
|
/// The width of the source image.
|
||||||
uint32_t width;
|
uint32_t width;
|
||||||
|
/// The height of the source image.
|
||||||
|
uint32_t height;
|
||||||
} libra_source_image_gl_t;
|
} libra_source_image_gl_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -162,10 +162,10 @@ typedef struct libra_viewport_t {
|
||||||
float x;
|
float x;
|
||||||
/// The y offset in the viewport framebuffer to begin rendering from.
|
/// The y offset in the viewport framebuffer to begin rendering from.
|
||||||
float y;
|
float y;
|
||||||
/// The height of the viewport framebuffer.
|
|
||||||
uint32_t height;
|
|
||||||
/// The width of the viewport framebuffer.
|
/// The width of the viewport framebuffer.
|
||||||
uint32_t width;
|
uint32_t width;
|
||||||
|
/// The height of the viewport framebuffer.
|
||||||
|
uint32_t height;
|
||||||
} libra_viewport_t;
|
} libra_viewport_t;
|
||||||
|
|
||||||
#if defined(LIBRA_RUNTIME_OPENGL)
|
#if defined(LIBRA_RUNTIME_OPENGL)
|
||||||
|
@ -206,14 +206,14 @@ typedef struct _filter_chain_d3d11 *libra_d3d11_filter_chain_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(LIBRA_RUNTIME_D3D11)
|
#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 {
|
typedef struct libra_source_image_d3d11_t {
|
||||||
/// A shader resource view into the source image
|
/// A shader resource view into the source image
|
||||||
const ID3D11ShaderResourceView * handle;
|
const ID3D11ShaderResourceView * handle;
|
||||||
/// The height of the source image.
|
|
||||||
uint32_t height;
|
|
||||||
/// The width of the source image.
|
/// The width of the source image.
|
||||||
uint32_t width;
|
uint32_t width;
|
||||||
|
/// The height of the source image.
|
||||||
|
uint32_t height;
|
||||||
} libra_source_image_d3d11_t;
|
} libra_source_image_d3d11_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -267,10 +267,10 @@ typedef struct libra_image_vk_t {
|
||||||
VkImage handle;
|
VkImage handle;
|
||||||
/// The `VkFormat` of the source image.
|
/// The `VkFormat` of the source image.
|
||||||
VkFormat format;
|
VkFormat format;
|
||||||
/// The height of the source image.
|
|
||||||
uint32_t height;
|
|
||||||
/// The width of the source image.
|
/// The width of the source image.
|
||||||
uint32_t width;
|
uint32_t width;
|
||||||
|
/// The height of the source image.
|
||||||
|
uint32_t height;
|
||||||
} libra_image_vk_t;
|
} libra_image_vk_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,8 @@ pub struct libra_viewport_t {
|
||||||
pub x: f32,
|
pub x: f32,
|
||||||
/// The y offset in the viewport framebuffer to begin rendering from.
|
/// The y offset in the viewport framebuffer to begin rendering from.
|
||||||
pub y: f32,
|
pub y: f32,
|
||||||
/// The height of the viewport framebuffer.
|
|
||||||
pub height: u32,
|
|
||||||
/// The width of the viewport framebuffer.
|
/// The width of the viewport framebuffer.
|
||||||
pub width: u32,
|
pub width: u32,
|
||||||
|
/// The height of the viewport framebuffer.
|
||||||
|
pub height: u32,
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,10 +21,10 @@ use librashader::runtime::{FilterChainParameters, Size, Viewport};
|
||||||
pub struct libra_source_image_d3d11_t {
|
pub struct libra_source_image_d3d11_t {
|
||||||
/// A shader resource view into the source image
|
/// A shader resource view into the source image
|
||||||
pub handle: ManuallyDrop<ID3D11ShaderResourceView>,
|
pub handle: ManuallyDrop<ID3D11ShaderResourceView>,
|
||||||
/// The height of the source image.
|
|
||||||
pub height: u32,
|
|
||||||
/// The width of the source image.
|
/// The width of the source image.
|
||||||
pub width: u32,
|
pub width: u32,
|
||||||
|
/// The height of the source image.
|
||||||
|
pub height: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TryFrom<libra_source_image_d3d11_t> for D3D11InputView {
|
impl TryFrom<libra_source_image_d3d11_t> for D3D11InputView {
|
||||||
|
|
|
@ -23,10 +23,10 @@ pub struct libra_source_image_gl_t {
|
||||||
pub handle: u32,
|
pub handle: u32,
|
||||||
/// The format of the source image.
|
/// The format of the source image.
|
||||||
pub format: u32,
|
pub format: u32,
|
||||||
/// The height of the source image.
|
|
||||||
pub height: u32,
|
|
||||||
/// The width of the source image.
|
/// The width of the source image.
|
||||||
pub width: u32,
|
pub width: u32,
|
||||||
|
/// The height of the source image.
|
||||||
|
pub height: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// OpenGL parameters for the output framebuffer.
|
/// OpenGL parameters for the output framebuffer.
|
||||||
|
|
|
@ -28,10 +28,10 @@ pub struct libra_image_vk_t {
|
||||||
pub handle: vk::Image,
|
pub handle: vk::Image,
|
||||||
/// The `VkFormat` of the source image.
|
/// The `VkFormat` of the source image.
|
||||||
pub format: vk::Format,
|
pub format: vk::Format,
|
||||||
/// The height of the source image.
|
|
||||||
pub height: u32,
|
|
||||||
/// The width of the source image.
|
/// The width of the source image.
|
||||||
pub width: u32,
|
pub width: u32,
|
||||||
|
/// The height of the source image.
|
||||||
|
pub height: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Handles required to instantiate vulkan
|
/// Handles required to instantiate vulkan
|
||||||
|
|
|
@ -476,10 +476,12 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
|
||||||
|
|
||||||
deviceContext->CopyResource(framebufferCopy, framebufferTexture);
|
deviceContext->CopyResource(framebufferCopy, framebufferTexture);
|
||||||
|
|
||||||
libra_source_image_d3d11_t input = {framebufferCopySRV, framebufferVP.Height,
|
libra_source_image_d3d11_t input = {framebufferCopySRV,
|
||||||
framebufferVP.Width};
|
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_d3d11_opt_t frame_opt = {.clear_history = false,
|
||||||
.frame_direction = -1};
|
.frame_direction = -1};
|
||||||
|
|
||||||
|
|
|
@ -397,10 +397,11 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/,
|
||||||
|
|
||||||
assert(copySrv != nullptr);
|
assert(copySrv != nullptr);
|
||||||
|
|
||||||
libra_source_image_d3d11_t input = {copySrv, viewport.Height,
|
libra_source_image_d3d11_t input = {copySrv,
|
||||||
viewport.Width};
|
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,
|
libra.d3d11_filter_chain_frame(&filter_chain, frameCount, input, vp,
|
||||||
d3d11FrameBufferView, NULL, NULL);
|
d3d11FrameBufferView, NULL, NULL);
|
||||||
|
|
Loading…
Add table
Reference in a new issue