Skip to content

Commit

Permalink
[Release] Feature/c api 5 (#178)
Browse files Browse the repository at this point in the history
* added command list documentation

* migrate to pc

* added documentation for the rest of the core API

fixed Present2 not working
added fence waiting for resize

* Version Bump

* Restyle Feature/c api 5 (#179)

* Restyled by astyle

* Restyled by clang-format

* Restyled by whitespace

---------

Co-authored-by: Restyled.io <[email protected]>

---------

Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com>
Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
3 people authored Sep 29, 2024
1 parent 9194c15 commit 5fd453f
Show file tree
Hide file tree
Showing 48 changed files with 5,484 additions and 735 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

cmake_minimum_required(VERSION 3.22)

set(WISDOM_VERSION "0.3.3")
set(WISDOM_VERSION "0.3.4")
project("Wisdom" VERSION ${WISDOM_VERSION})

set(CMAKE_DEBUG_POSTFIX d)
Expand Down
7 changes: 7 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Version History

- 0.3.4

- Made a lot of views CPP API only, that makes C API more lightweight
- Finished documentation for C and CPP APIs
- Fixed Present2 for Vulkan not working correctly with moved swapchain
- Added a present fence to the swapchain for Vulkan, makes resizing slightly faster, works if the DynamicVSync is enabled, otherwise it is ignored

- 0.3.3

- Fixed Extension creation for C API yet again
Expand Down
29 changes: 29 additions & 0 deletions bindings/custom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,21 @@ extern "C" void DX12DeviceDestroy(DX12Device self)
std::destroy_at(memory.pre_type);
wisdom_free(memory.data());
}

extern "C" uint32_t DX12SwapChainGetBuffers(DX12SwapChain self, const DX12Texture** buffers)
{
auto* swapchain = reinterpret_cast<wis::DX12SwapChain*>(self);
uint32_t count = swapchain->GetInternal().back_buffer_count;
if (!buffers) {
return count;
}

auto&& [result, xcount] = swapchain->GetBuffers();
for (uint32_t i = 0; i < xcount; i++) {
buffers[i] = reinterpret_cast<const DX12Texture*>(result + i);
}
return xcount;
}
#endif // WISDOM_DX12

#if defined(WISDOM_VULKAN)
Expand Down Expand Up @@ -532,4 +547,18 @@ extern "C" void VKDeviceDestroy(VKDevice self)
std::destroy_at(memory.pre_type);
wisdom_free(memory.data());
}
extern "C" uint32_t VKSwapChainGetBuffers(VKSwapChain self, const VKTexture** buffers)
{
auto* swapchain = reinterpret_cast<wis::VKSwapChain*>(self);
uint32_t count = swapchain->GetInternal().back_buffer_count;
if (!buffers) {
return count;
}

auto&& [result, xcount] = swapchain->GetBuffers();
for (uint32_t i = 0; i < xcount; i++) {
buffers[i] = reinterpret_cast<const VKTexture*>(result + i);
}
return xcount;
}
#endif // WISDOM_VK
782 changes: 756 additions & 26 deletions bindings/wisdom.cpp

Large diffs are not rendered by default.

Loading

0 comments on commit 5fd453f

Please sign in to comment.