Compare commits

...

5 Commits

Author SHA1 Message Date
Sharadh Rajaraman a1a5d4b689
Merge 9896e08beb into 7c480ca5aa 2025-11-12 14:42:10 +00:00
Jan Kuhlmann 7c480ca5aa
C++Module: Fix GCC error and replace `std.compat` with `std` (#2353)
* iunclude vulkan.h before the import

* replace std.compat with std
2025-11-12 13:49:10 +01:00
Andreas Süßenbach 5cd5bcf6de
Extent function call tests with Fence commands (#2359) 2025-11-12 13:42:37 +01:00
Sharadh Rajaraman 9896e08beb Adhere to some markdownlint recommendations
- `-` instead of `*`
- Spaces around lists
2025-11-11 21:58:53 +00:00
Sharadh Rajaraman 044bf61a3c Initial readme rework
- Remove HTML hyperlinks; markdown generates automatically
- Use backticks \` to demarcate config macros
- Remove `VULKAN_HPP_NO_STD_MODULE` option
2025-11-11 21:56:36 +00:00
7 changed files with 1144 additions and 1015 deletions

2038
README.md

File diff suppressed because it is too large Load Diff

View File

@ -24,7 +24,7 @@ module;
#include <vulkan/${api}_shared.hpp>
export module ${api}_hpp;
export import std.compat;
export import std;
export namespace VULKAN_HPP_NAMESPACE
{

View File

@ -1,3 +1,4 @@
#include <vulkan/${vulkan_h}>
#if !defined( VULKAN_HPP_CXX_MODULE )
// clang-format off
# include <vulkan/vulkan_hpp_macros.hpp>
@ -27,9 +28,8 @@
#else
# include <cassert>
# include <cstring>
import std.compat;
import std;
#endif
#include <vulkan/${vulkan_h}>
#if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL == 1
# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNX__ ) || defined( __Fuchsia__ )

View File

@ -504,6 +504,66 @@ int main( int /*argc*/, char ** /*argv*/ )
queue.bindSparse( bindSparseInfo, fence );
}
// Fence commands
{
vk::Device device;
vk::FenceCreateInfo fenceCreateInfo;
vk::AllocationCallbacks allocationCallbacks;
vk::Fence fence;
vk::Result result = device.createFence( &fenceCreateInfo, &allocationCallbacks, &fence );
}
{
vk::Device device;
vk::FenceCreateInfo fenceCreateInfo;
vk::Fence fence = device.createFence( fenceCreateInfo );
}
{
vk::Device device;
vk::Fence fence;
vk::AllocationCallbacks allocationCallbacks;
device.destroyFence( fence, &allocationCallbacks );
}
{
vk::Device device;
vk::Fence fence;
device.destroyFence( fence );
}
{
vk::Device device;
uint32_t fenceCount = 1;
vk::Fence fence;
vk::Result result = device.resetFences( fenceCount, &fence );
}
{
vk::Device device;
vk::Fence fence;
device.resetFences( fence );
}
{
vk::Device device;
vk::Fence fence;
vk::Result result = device.getFenceStatus( fence );
}
{
vk::Device device;
uint32_t fenceCount = 1;
vk::Fence fence;
vk::Bool32 waitAll = vk::True;
uint64_t timeout = 1000000000;
vk::Result result = device.waitForFences( fenceCount, &fence, waitAll, timeout );
}
{
vk::Device device;
vk::Fence fence;
vk::Bool32 waitAll = vk::True;
uint64_t timeout = 1000000000;
vk::Result result = device.waitForFences( fence, waitAll, timeout );
}
#if 0
{
vk::PhysicalDevice physicalDevice;

View File

@ -106,6 +106,11 @@ int main( int /*argc*/, char ** /*argv*/ )
vk::DeviceCreateInfo deviceCreateInfo;
vk::raii::Device device = physicalDevice.createDevice( deviceCreateInfo );
}
{
vk::raii::PhysicalDevice physicalDevice = nullptr;
vk::DeviceCreateInfo deviceCreateInfo;
vk::raii::Device device( physicalDevice, deviceCreateInfo );
}
// Extension discovery commands
{
@ -136,6 +141,12 @@ int main( int /*argc*/, char ** /*argv*/ )
uint32_t queueIndex = 0;
vk::raii::Queue queue = device.getQueue( queueFamilyIndex, queueIndex );
}
{
vk::raii::Device device = nullptr;
uint32_t queueFamilyIndex = 0;
uint32_t queueIndex = 0;
vk::raii::Queue queue( device, queueFamilyIndex, queueIndex );
}
{
vk::raii::Queue queue = nullptr;
@ -160,6 +171,11 @@ int main( int /*argc*/, char ** /*argv*/ )
vk::MemoryAllocateInfo memoryAllocateInfo;
vk::raii::DeviceMemory deviceMemory = device.allocateMemory( memoryAllocateInfo );
}
{
vk::raii::Device device = nullptr;
vk::MemoryAllocateInfo memoryAllocateInfo;
vk::raii::DeviceMemory deviceMemory( device, memoryAllocateInfo );
}
{
vk::raii::DeviceMemory deviceMemory = nullptr;
@ -240,5 +256,36 @@ int main( int /*argc*/, char ** /*argv*/ )
queue.bindSparse( bindSparseInfo, fence );
}
// Fence commands
{
vk::raii::Device device = nullptr;
vk::FenceCreateInfo fenceCreateInfo;
vk::raii::Fence fence = device.createFence( fenceCreateInfo );
}
{
vk::raii::Device device = nullptr;
vk::FenceCreateInfo fenceCreateInfo;
vk::raii::Fence fence( device, fenceCreateInfo );
}
{
vk::raii::Device device = nullptr;
vk::Fence fence;
device.resetFences( fence );
}
{
vk::raii::Fence fence = nullptr;
vk::Result result = fence.getStatus();
}
{
vk::raii::Device device = nullptr;
vk::Fence fence;
vk::Bool32 waitAll = vk::True;
uint64_t timeout = 1000000000;
vk::Result result = device.waitForFences( fence, waitAll, timeout );
}
return 0;
}

View File

@ -29,7 +29,7 @@ VULKAN_HPP_COMPILE_WARNING( VULKAN_HPP_CXX_MODULE_EXPERIMENTAL_WARNING )
#include <vulkan/vulkan_shared.hpp>
export module vulkan_hpp;
export import std.compat;
export import std;
export namespace VULKAN_HPP_NAMESPACE
{

View File

@ -8,6 +8,7 @@
#ifndef VULKAN_HPP
#define VULKAN_HPP
#include <vulkan/vulkan.h>
#if !defined( VULKAN_HPP_CXX_MODULE )
// clang-format off
# include <vulkan/vulkan_hpp_macros.hpp>
@ -37,9 +38,8 @@
#else
# include <cassert>
# include <cstring>
import std.compat;
import std;
#endif
#include <vulkan/vulkan.h>
#if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL == 1
# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNX__ ) || defined( __Fuchsia__ )
@ -150,7 +150,7 @@ namespace VULKAN_HPP_NAMESPACE
private:
VULKAN_HPP_CONSTEXPR_14 void copy( char const * data, size_t len ) VULKAN_HPP_NOEXCEPT
{
size_t n = ( std::min )( N - 1, len );
size_t n = (std::min)( N - 1, len );
for ( size_t i = 0; i < n; ++i )
{
( *this )[i] = data[i];