mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2025-09-12 05:16:21 -04:00
Minor cleanup work (#2090)
This commit is contained in:
parent
f03a052717
commit
8f9db1bad6
@ -75,8 +75,7 @@ InsertNewlineAtEOF : true
|
||||
IntegerLiteralSeparator :
|
||||
Binary : 4
|
||||
Decimal : 0
|
||||
Hex : 2
|
||||
HexMinDigits : 6
|
||||
Hex : 0
|
||||
KeepEmptyLinesAtTheStartOfBlocks : false
|
||||
LambdaBodyIndentation : Signature
|
||||
MaxEmptyLinesToKeep : 1
|
||||
|
@ -81,8 +81,7 @@ InsertNewlineAtEOF : true
|
||||
IntegerLiteralSeparator :
|
||||
Binary : 4
|
||||
Decimal : 0
|
||||
Hex : 2
|
||||
HexMinDigits : 6
|
||||
Hex : 0
|
||||
KeepEmptyLinesAtTheStartOfBlocks : false
|
||||
LambdaBodyIndentation : Signature
|
||||
MaxEmptyLinesToKeep : 1
|
||||
|
@ -84,8 +84,7 @@ InsertNewlineAtEOF : true
|
||||
IntegerLiteralSeparator :
|
||||
Binary : 4
|
||||
Decimal : 0
|
||||
Hex : 2
|
||||
HexMinDigits : 6
|
||||
Hex : 0
|
||||
KeepEmptyLinesAtTheStartOfBlocks : false
|
||||
LambdaBodyIndentation : Signature
|
||||
MaxEmptyLinesToKeep : 1
|
||||
|
@ -42,7 +42,7 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
uint32_t height = 64;
|
||||
vk::su::WindowData window = vk::su::createWindow( AppName, { width, height } );
|
||||
VkSurfaceKHR _surface;
|
||||
glfwCreateWindowSurface( static_cast<VkInstance>( *instance ), window.handle, nullptr, &_surface );
|
||||
glfwCreateWindowSurface( *instance, window.handle, nullptr, &_surface );
|
||||
vk::raii::SurfaceKHR surface( instance, _surface );
|
||||
|
||||
// determine a queueFamilyIndex that suports present
|
||||
|
@ -78,11 +78,8 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
assert( imageIndex < swapChainData.images.size() );
|
||||
|
||||
commandBuffer.begin( vk::CommandBufferBeginInfo() );
|
||||
vk::raii::su::setImageLayout( commandBuffer,
|
||||
static_cast<vk::Image>( swapChainData.images[imageIndex] ),
|
||||
swapChainData.colorFormat,
|
||||
vk::ImageLayout::eUndefined,
|
||||
vk::ImageLayout::eTransferDstOptimal );
|
||||
vk::raii::su::setImageLayout(
|
||||
commandBuffer, swapChainData.images[imageIndex], swapChainData.colorFormat, vk::ImageLayout::eUndefined, vk::ImageLayout::eTransferDstOptimal );
|
||||
|
||||
// in order to get a clean desctruction sequence, instantiate the DeviceMemory for the image first
|
||||
vk::raii::DeviceMemory deviceMemory( nullptr );
|
||||
@ -150,7 +147,7 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
// Intend to blit from this image, set the layout accordingly
|
||||
vk::raii::su::setImageLayout( commandBuffer, blitSourceImage, swapChainData.colorFormat, vk::ImageLayout::eGeneral, vk::ImageLayout::eTransferSrcOptimal );
|
||||
|
||||
vk::Image blitDestinationImage = static_cast<vk::Image>( swapChainData.images[imageIndex] );
|
||||
vk::Image blitDestinationImage = swapChainData.images[imageIndex];
|
||||
|
||||
// Do a 32x32 blit to all of the dst image - should get big squares
|
||||
vk::ImageSubresourceLayers imageSubresourceLayers( vk::ImageAspectFlagBits::eColor, 0, 0, 1 );
|
||||
@ -203,9 +200,9 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
result = presentQueue.presentKHR( presentInfoKHR );
|
||||
switch ( result )
|
||||
{
|
||||
case vk::Result::eSuccess: break;
|
||||
case vk::Result::eSuccess : break;
|
||||
case vk::Result::eSuboptimalKHR: std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; break;
|
||||
default: assert( false ); // an unexpected result is returned !
|
||||
default : assert( false ); // an unexpected result is returned !
|
||||
}
|
||||
std::this_thread::sleep_for( std::chrono::milliseconds( 1000 ) );
|
||||
|
||||
|
@ -47,8 +47,7 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
|
||||
/* VULKAN_KEY_START */
|
||||
|
||||
vk::DebugUtilsObjectNameInfoEXT debugUtilsObjectNameInfo(
|
||||
vk::ObjectType::eImage, NON_DISPATCHABLE_HANDLE_TO_UINT64_CAST( VkImage, static_cast<vk ::Image>( image ) ), "Image name" );
|
||||
vk::DebugUtilsObjectNameInfoEXT debugUtilsObjectNameInfo( vk::ObjectType::eImage, NON_DISPATCHABLE_HANDLE_TO_UINT64_CAST( VkImage, *image ), "Image name" );
|
||||
device.setDebugUtilsObjectNameEXT( debugUtilsObjectNameInfo );
|
||||
|
||||
/* VULKAN_KEY_END */
|
||||
|
@ -40,22 +40,19 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
for ( size_t i = 0; i < groupProperties.size(); i++ )
|
||||
{
|
||||
std::cout << "Group Properties " << i << " :\n";
|
||||
std::cout << "\t"
|
||||
<< "physicalDeviceCount = " << groupProperties[i].physicalDeviceCount << "\n";
|
||||
std::cout << "\t"
|
||||
<< "physicalDevices:\n";
|
||||
std::cout << "\t" << "physicalDeviceCount = " << groupProperties[i].physicalDeviceCount << "\n";
|
||||
std::cout << "\t" << "physicalDevices:\n";
|
||||
for ( size_t j = 0; j < groupProperties[i].physicalDeviceCount; j++ )
|
||||
{
|
||||
vk::raii::PhysicalDevice physicalDevice( instance, static_cast<VkPhysicalDevice>( groupProperties[i].physicalDevices[j] ) );
|
||||
vk::raii::PhysicalDevice physicalDevice( instance, groupProperties[i].physicalDevices[j] );
|
||||
std::cout << "\t\t" << j << " : " << physicalDevice.getProperties().deviceName << "\n";
|
||||
}
|
||||
std::cout << "\t"
|
||||
<< "subsetAllocation = " << !!groupProperties[i].subsetAllocation << "\n";
|
||||
std::cout << "\t" << "subsetAllocation = " << !!groupProperties[i].subsetAllocation << "\n";
|
||||
std::cout << "\n";
|
||||
|
||||
if ( 1 < groupProperties[i].physicalDeviceCount )
|
||||
{
|
||||
vk::raii::PhysicalDevice physicalDevice( instance, static_cast<VkPhysicalDevice>( groupProperties[i].physicalDevices[0] ) );
|
||||
vk::raii::PhysicalDevice physicalDevice( instance, groupProperties[i].physicalDevices[0] );
|
||||
|
||||
// get the QueueFamilyProperties of the first PhysicalDevice
|
||||
std::vector<vk::QueueFamilyProperties> queueFamilyProperties = physicalDevice.getQueueFamilyProperties();
|
||||
|
@ -581,7 +581,7 @@ static void keyCallback( GLFWwindow * window, int key, int /*scancode*/, int act
|
||||
switch ( key )
|
||||
{
|
||||
case GLFW_KEY_ESCAPE:
|
||||
case 'Q': glfwSetWindowShouldClose( window, 1 ); break;
|
||||
case 'Q' : glfwSetWindowShouldClose( window, 1 ); break;
|
||||
case 'R':
|
||||
{
|
||||
AppInfo * appInfo = reinterpret_cast<AppInfo *>( glfwGetWindowUserPointer( window ) );
|
||||
@ -725,7 +725,7 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
|
||||
// Create Window Surface (using glfw)
|
||||
VkSurfaceKHR glfwSurface;
|
||||
VkResult err = glfwCreateWindowSurface( static_cast<VkInstance>( *instance ), window, nullptr, &glfwSurface );
|
||||
VkResult err = glfwCreateWindowSurface( *instance, window, nullptr, &glfwSurface );
|
||||
check_vk_result( err );
|
||||
vk::raii::SurfaceKHR surface( instance, glfwSurface );
|
||||
|
||||
@ -1188,11 +1188,8 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
vk::WriteDescriptorSet writeDescriptorSet( *rayTracingDescriptorSets[backBufferIndex], 1, 0, bindings[1].descriptorType, imageInfo );
|
||||
device.updateDescriptorSets( writeDescriptorSet, nullptr );
|
||||
|
||||
vk::raii::su::setImageLayout( commandBuffer,
|
||||
static_cast<vk::Image>( swapChainData.images[backBufferIndex] ),
|
||||
surfaceFormat.format,
|
||||
vk::ImageLayout::eUndefined,
|
||||
vk::ImageLayout::eGeneral );
|
||||
vk::raii::su::setImageLayout(
|
||||
commandBuffer, swapChainData.images[backBufferIndex], surfaceFormat.format, vk::ImageLayout::eUndefined, vk::ImageLayout::eGeneral );
|
||||
|
||||
commandBuffer.bindPipeline( vk::PipelineBindPoint::eRayTracingNV, *rayTracingPipeline );
|
||||
|
||||
@ -1214,11 +1211,8 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
windowExtent.height,
|
||||
1 );
|
||||
|
||||
vk::raii::su::setImageLayout( commandBuffer,
|
||||
static_cast<vk::Image>( swapChainData.images[backBufferIndex] ),
|
||||
surfaceFormat.format,
|
||||
vk::ImageLayout::eGeneral,
|
||||
vk::ImageLayout::ePresentSrcKHR );
|
||||
vk::raii::su::setImageLayout(
|
||||
commandBuffer, swapChainData.images[backBufferIndex], surfaceFormat.format, vk::ImageLayout::eGeneral, vk::ImageLayout::ePresentSrcKHR );
|
||||
}
|
||||
|
||||
// frame end
|
||||
@ -1236,9 +1230,9 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
result = presentQueue.presentKHR( presentInfoKHR );
|
||||
switch ( result )
|
||||
{
|
||||
case vk::Result::eSuccess: break;
|
||||
case vk::Result::eSuccess : break;
|
||||
case vk::Result::eSuboptimalKHR: std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; break;
|
||||
default: assert( false ); // an unexpected result is returned !
|
||||
default : assert( false ); // an unexpected result is returned !
|
||||
}
|
||||
frameIndex = ( frameIndex + 1 ) % IMGUI_VK_QUEUED_FRAMES;
|
||||
|
||||
|
@ -147,11 +147,8 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
assert( result == vk::Result::eSuccess );
|
||||
assert( imageIndex < swapChainData.images.size() );
|
||||
|
||||
vk::raii::su::setImageLayout( commandBuffer,
|
||||
static_cast<vk::Image>( swapChainData.images[imageIndex] ),
|
||||
swapChainData.colorFormat,
|
||||
vk::ImageLayout::eUndefined,
|
||||
vk::ImageLayout::eColorAttachmentOptimal );
|
||||
vk::raii::su::setImageLayout(
|
||||
commandBuffer, swapChainData.images[imageIndex], swapChainData.colorFormat, vk::ImageLayout::eUndefined, vk::ImageLayout::eColorAttachmentOptimal );
|
||||
|
||||
const vk::DeviceSize offset = 0;
|
||||
vk::Viewport viewport( 0.0f, 0.0f, 200.0f, 200.0f, 0.0f, 1.0f );
|
||||
@ -198,7 +195,7 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
vk::ImageLayout::ePresentSrcKHR,
|
||||
VK_QUEUE_FAMILY_IGNORED,
|
||||
VK_QUEUE_FAMILY_IGNORED,
|
||||
static_cast<vk::Image>( swapChainData.images[imageIndex] ),
|
||||
swapChainData.images[imageIndex],
|
||||
imageSubresourceRange );
|
||||
commandBuffer.pipelineBarrier(
|
||||
vk::PipelineStageFlagBits::eColorAttachmentOutput, vk::PipelineStageFlagBits::eBottomOfPipe, vk::DependencyFlags(), nullptr, nullptr, prePresentBarrier );
|
||||
@ -216,9 +213,9 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
result = presentQueue.presentKHR( vk::PresentInfoKHR( {}, *swapChainData.swapChain, imageIndex, {} ) );
|
||||
switch ( result )
|
||||
{
|
||||
case vk::Result::eSuccess: break;
|
||||
case vk::Result::eSuccess : break;
|
||||
case vk::Result::eSuboptimalKHR: std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; break;
|
||||
default: assert( false ); // an unexpected result is returned !
|
||||
default : assert( false ); // an unexpected result is returned !
|
||||
}
|
||||
std::this_thread::sleep_for( std::chrono::milliseconds( 1000 ) );
|
||||
|
||||
|
@ -84,12 +84,11 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
std::cout << "PhysicalDevice " << i << "\n";
|
||||
if ( supportsGetSurfaceCapabilities2 )
|
||||
{
|
||||
auto surfaceCapabilities2 =
|
||||
physicalDevices[i]
|
||||
.getSurfaceCapabilities2KHR<vk::SurfaceCapabilities2KHR,
|
||||
vk::DisplayNativeHdrSurfaceCapabilitiesAMD,
|
||||
vk::SharedPresentSurfaceCapabilitiesKHR,
|
||||
vk::SurfaceProtectedCapabilitiesKHR>( { static_cast<vk::SurfaceKHR>( surfaceData.surface ) } );
|
||||
auto surfaceCapabilities2 = physicalDevices[i]
|
||||
.getSurfaceCapabilities2KHR<vk::SurfaceCapabilities2KHR,
|
||||
vk::DisplayNativeHdrSurfaceCapabilitiesAMD,
|
||||
vk::SharedPresentSurfaceCapabilitiesKHR,
|
||||
vk::SurfaceProtectedCapabilitiesKHR>( { *surfaceData.surface } );
|
||||
|
||||
vk::SurfaceCapabilitiesKHR const & surfaceCapabilities = surfaceCapabilities2.get<vk::SurfaceCapabilities2KHR>().surfaceCapabilities;
|
||||
cout( surfaceCapabilities );
|
||||
|
@ -315,7 +315,7 @@ namespace vk
|
||||
: extent( extent_ ), window( vk::su::createWindow( windowName, extent ) )
|
||||
{
|
||||
VkSurfaceKHR _surface;
|
||||
VkResult err = glfwCreateWindowSurface( static_cast<VkInstance>( *instance ), window.handle, nullptr, &_surface );
|
||||
VkResult err = glfwCreateWindowSurface( *instance, window.handle, nullptr, &_surface );
|
||||
if ( err != VK_SUCCESS )
|
||||
throw std::runtime_error( "Failed to create window!" );
|
||||
surface = vk::raii::SurfaceKHR( instance, _surface );
|
||||
|
@ -269,6 +269,16 @@ std::string VideoHppGenerator::generateStruct( std::pair<std::string, StructureD
|
||||
{
|
||||
return *reinterpret_cast<StdVideo${structureType}*>( this );
|
||||
}
|
||||
|
||||
operator StdVideo${structureType} const *() const VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
return reinterpret_cast<const StdVideo${structureType}*>( this );
|
||||
}
|
||||
|
||||
operator StdVideo${structureType} *() VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
return reinterpret_cast<StdVideo${structureType}*>( this );
|
||||
}
|
||||
${compareOperators}
|
||||
public:
|
||||
${members}
|
||||
|
@ -1083,80 +1083,88 @@ void VulkanHppGenerator::checkRequireCorrectness( std::vector<RequireData> const
|
||||
{
|
||||
for ( auto const & require : requireData )
|
||||
{
|
||||
std::vector<std::string> dependencies = tokenize( require.depends, "," );
|
||||
for ( auto const & depends : dependencies )
|
||||
{
|
||||
size_t separatorPos = depends.find( "::" );
|
||||
if ( separatorPos == std::string::npos )
|
||||
{
|
||||
checkForError( isFeature( depends ) || isExtension( depends ),
|
||||
require.xmlLine,
|
||||
section + " <" + name + "> depends on unknown extension or feature <" + depends + ">" );
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string structure = depends.substr( 0, separatorPos );
|
||||
std::string member = depends.substr( separatorPos + 2 );
|
||||
auto structIt = m_structs.find( structure );
|
||||
checkForError( structIt != m_structs.end(), require.xmlLine, section + " <" + name + "> requires member of an unknown struct <" + structure + ">" );
|
||||
checkForError( std::ranges::find_if( structIt->second.members, [&member]( auto const & md ) { return md.name == member; } ) !=
|
||||
structIt->second.members.end(),
|
||||
require.xmlLine,
|
||||
section + " <" + name + "> requires unknown member <" + member + "> as part of the struct <" + structure + ">" );
|
||||
}
|
||||
}
|
||||
checkRequireDependenciesCorrectness( require, section, name );
|
||||
checkRequireTypesCorrectness( require );
|
||||
}
|
||||
}
|
||||
|
||||
for ( auto const & type : require.types )
|
||||
void VulkanHppGenerator::checkRequireDependenciesCorrectness( RequireData const & require, std::string const & section, std::string const & name ) const
|
||||
{
|
||||
std::vector<std::string> dependencies = tokenize( require.depends, "," );
|
||||
for ( auto const & depends : dependencies )
|
||||
{
|
||||
size_t separatorPos = depends.find( "::" );
|
||||
if ( separatorPos == std::string::npos )
|
||||
{
|
||||
auto typeIt = m_types.find( type.name );
|
||||
assert( typeIt != m_types.end() );
|
||||
// every required type should be listed in the corresponding map
|
||||
switch ( typeIt->second.category )
|
||||
{
|
||||
case TypeCategory::Bitmask:
|
||||
checkForError( findByNameOrAlias( m_bitmasks, type.name ) != m_bitmasks.end(),
|
||||
typeIt->second.xmlLine,
|
||||
"required bitmask type <" + type.name + "> is not listed as bitmask" );
|
||||
break;
|
||||
case TypeCategory::BaseType:
|
||||
checkForError( m_baseTypes.contains( type.name ), typeIt->second.xmlLine, "required base type <" + type.name + "> is not listed as a base type" );
|
||||
break;
|
||||
case TypeCategory::Constant:
|
||||
checkForError( m_constants.contains( type.name ), typeIt->second.xmlLine, "required constant <" + type.name + "> is not listed as a constant" );
|
||||
break;
|
||||
case TypeCategory::Define:
|
||||
checkForError( m_defines.contains( type.name ), typeIt->second.xmlLine, "required define <" + type.name + "> is not listed as a define" );
|
||||
break;
|
||||
case TypeCategory::Enum:
|
||||
checkForError( findByNameOrAlias( m_enums, type.name ) != m_enums.end(),
|
||||
typeIt->second.xmlLine,
|
||||
"required enum type <" + type.name + "> is not listed as an enum" );
|
||||
break;
|
||||
case TypeCategory::ExternalType:
|
||||
checkForError(
|
||||
m_externalTypes.contains( type.name ), typeIt->second.xmlLine, "required external type <" + type.name + "> is not listed as an external type" );
|
||||
break;
|
||||
case TypeCategory::FuncPointer:
|
||||
checkForError(
|
||||
m_funcPointers.contains( type.name ), typeIt->second.xmlLine, "required funcpointer <" + type.name + "> is not listed as a funcpointer" );
|
||||
break;
|
||||
case TypeCategory::Handle:
|
||||
checkForError( findByNameOrAlias( m_handles, type.name ) != m_handles.end(),
|
||||
typeIt->second.xmlLine,
|
||||
"required handle type <" + type.name + "> is not listed as a handle" );
|
||||
break;
|
||||
case TypeCategory::Include:
|
||||
checkForError( m_includes.contains( type.name ), typeIt->second.xmlLine, "required include <" + type.name + "> is not listed as an include" );
|
||||
break;
|
||||
case TypeCategory::Struct:
|
||||
case TypeCategory::Union:
|
||||
checkForError( findByNameOrAlias( m_structs, type.name ) != m_structs.end(),
|
||||
typeIt->second.xmlLine,
|
||||
"required struct type <" + type.name + "> is not listed as a struct" );
|
||||
break;
|
||||
case TypeCategory::Unknown: break;
|
||||
default : assert( false ); break;
|
||||
}
|
||||
checkForError( isFeature( depends ) || isExtension( depends ),
|
||||
require.xmlLine,
|
||||
section + " <" + name + "> depends on unknown extension or feature <" + depends + ">" );
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string structure = depends.substr( 0, separatorPos );
|
||||
std::string member = depends.substr( separatorPos + 2 );
|
||||
auto structIt = m_structs.find( structure );
|
||||
checkForError( structIt != m_structs.end(), require.xmlLine, section + " <" + name + "> requires member of an unknown struct <" + structure + ">" );
|
||||
checkForError( std::ranges::find_if( structIt->second.members, [&member]( auto const & md ) { return md.name == member; } ) !=
|
||||
structIt->second.members.end(),
|
||||
require.xmlLine,
|
||||
section + " <" + name + "> requires unknown member <" + member + "> as part of the struct <" + structure + ">" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VulkanHppGenerator::checkRequireTypesCorrectness( RequireData const & require ) const
|
||||
{
|
||||
for ( auto const & type : require.types )
|
||||
{
|
||||
auto typeIt = m_types.find( type.name );
|
||||
assert( typeIt != m_types.end() );
|
||||
// every required type should be listed in the corresponding map
|
||||
switch ( typeIt->second.category )
|
||||
{
|
||||
case TypeCategory::Bitmask:
|
||||
checkForError( findByNameOrAlias( m_bitmasks, type.name ) != m_bitmasks.end(),
|
||||
typeIt->second.xmlLine,
|
||||
"required bitmask type <" + type.name + "> is not listed as bitmask" );
|
||||
break;
|
||||
case TypeCategory::BaseType:
|
||||
checkForError( m_baseTypes.contains( type.name ), typeIt->second.xmlLine, "required base type <" + type.name + "> is not listed as a base type" );
|
||||
break;
|
||||
case TypeCategory::Constant:
|
||||
checkForError( m_constants.contains( type.name ), typeIt->second.xmlLine, "required constant <" + type.name + "> is not listed as a constant" );
|
||||
break;
|
||||
case TypeCategory::Define:
|
||||
checkForError( m_defines.contains( type.name ), typeIt->second.xmlLine, "required define <" + type.name + "> is not listed as a define" );
|
||||
break;
|
||||
case TypeCategory::Enum:
|
||||
checkForError(
|
||||
findByNameOrAlias( m_enums, type.name ) != m_enums.end(), typeIt->second.xmlLine, "required enum type <" + type.name + "> is not listed as an enum" );
|
||||
break;
|
||||
case TypeCategory::ExternalType:
|
||||
checkForError(
|
||||
m_externalTypes.contains( type.name ), typeIt->second.xmlLine, "required external type <" + type.name + "> is not listed as an external type" );
|
||||
break;
|
||||
case TypeCategory::FuncPointer:
|
||||
checkForError(
|
||||
m_funcPointers.contains( type.name ), typeIt->second.xmlLine, "required funcpointer <" + type.name + "> is not listed as a funcpointer" );
|
||||
break;
|
||||
case TypeCategory::Handle:
|
||||
checkForError( findByNameOrAlias( m_handles, type.name ) != m_handles.end(),
|
||||
typeIt->second.xmlLine,
|
||||
"required handle type <" + type.name + "> is not listed as a handle" );
|
||||
break;
|
||||
case TypeCategory::Include:
|
||||
checkForError( m_includes.contains( type.name ), typeIt->second.xmlLine, "required include <" + type.name + "> is not listed as an include" );
|
||||
break;
|
||||
case TypeCategory::Struct:
|
||||
case TypeCategory::Union:
|
||||
checkForError( findByNameOrAlias( m_structs, type.name ) != m_structs.end(),
|
||||
typeIt->second.xmlLine,
|
||||
"required struct type <" + type.name + "> is not listed as a struct" );
|
||||
break;
|
||||
case TypeCategory::Unknown: break;
|
||||
default : assert( false ); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -529,6 +529,8 @@ private:
|
||||
void checkHandleCorrectness() const;
|
||||
void checkRequireCorrectness() const;
|
||||
void checkRequireCorrectness( std::vector<RequireData> const & requireData, std::string const & section, std::string const & name ) const;
|
||||
void checkRequireDependenciesCorrectness( RequireData const & require, std::string const & section, std::string const & name ) const;
|
||||
void checkRequireTypesCorrectness( RequireData const & require ) const;
|
||||
void checkSpirVCapabilityCorrectness() const;
|
||||
void checkStructCorrectness() const;
|
||||
void checkStructMemberCorrectness( std::string const & structureName, std::vector<MemberData> const & members, std::set<std::string> & sTypeValues ) const;
|
||||
|
@ -44,7 +44,7 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
vk::SurfaceKHR surface;
|
||||
{
|
||||
VkSurfaceKHR _surface;
|
||||
glfwCreateWindowSurface( static_cast<VkInstance>( instance ), window.handle, nullptr, &_surface );
|
||||
glfwCreateWindowSurface( instance, window.handle, nullptr, &_surface );
|
||||
surface = vk::SurfaceKHR( _surface );
|
||||
}
|
||||
|
||||
|
@ -595,7 +595,7 @@ static void keyCallback( GLFWwindow * window, int key, int /*scancode*/, int act
|
||||
switch ( key )
|
||||
{
|
||||
case GLFW_KEY_ESCAPE:
|
||||
case 'Q': glfwSetWindowShouldClose( window, 1 ); break;
|
||||
case 'Q' : glfwSetWindowShouldClose( window, 1 ); break;
|
||||
case 'R':
|
||||
{
|
||||
AppInfo * appInfo = reinterpret_cast<AppInfo *>( glfwGetWindowUserPointer( window ) );
|
||||
@ -725,7 +725,7 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
|
||||
// Create Window Surface (using glfw)
|
||||
vk::SurfaceKHR surface;
|
||||
VkResult err = glfwCreateWindowSurface( static_cast<VkInstance>( instance ), window, nullptr, reinterpret_cast<VkSurfaceKHR *>( &surface ) );
|
||||
VkResult err = glfwCreateWindowSurface( instance, window, nullptr, reinterpret_cast<VkSurfaceKHR *>( &surface ) );
|
||||
check_vk_result( err );
|
||||
|
||||
std::pair<uint32_t, uint32_t> graphicsAndPresentQueueFamilyIndex = vk::su::findGraphicsAndPresentQueueFamilyIndex( physicalDevice, surface );
|
||||
@ -1225,9 +1225,9 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
presentQueue.presentKHR( vk::PresentInfoKHR( perFrameData[frameIndex].renderCompleteSemaphore, swapChainData.swapChain, backBufferIndex ) );
|
||||
switch ( result )
|
||||
{
|
||||
case vk::Result::eSuccess: break;
|
||||
case vk::Result::eSuccess : break;
|
||||
case vk::Result::eSuboptimalKHR: std::cout << "vk::Queue::presentKHR returned vk::Result::eSuboptimalKHR !\n"; break;
|
||||
default: assert( false ); // an unexpected result is returned !
|
||||
default : assert( false ); // an unexpected result is returned !
|
||||
}
|
||||
frameIndex = ( frameIndex + 1 ) % IMGUI_VK_QUEUED_FRAMES;
|
||||
|
||||
|
@ -84,7 +84,7 @@ public:
|
||||
void createDeviceAndSwapChain( const vk::su::WindowData & window )
|
||||
{
|
||||
VkSurfaceKHR surface;
|
||||
VkResult err = glfwCreateWindowSurface( static_cast<VkInstance>( instance.get() ), window.handle, nullptr, &surface );
|
||||
VkResult err = glfwCreateWindowSurface( instance.get(), window.handle, nullptr, &surface );
|
||||
if ( err != VK_SUCCESS )
|
||||
throw std::runtime_error( "Failed to create window!" );
|
||||
vk::SharedSurfaceKHR sharedSurface{ surface, instance };
|
||||
|
@ -780,7 +780,7 @@ namespace vk
|
||||
: extent( extent_ ), window( vk::su::createWindow( windowName, extent ) )
|
||||
{
|
||||
VkSurfaceKHR _surface;
|
||||
VkResult err = glfwCreateWindowSurface( static_cast<VkInstance>( instance ), window.handle, nullptr, &_surface );
|
||||
VkResult err = glfwCreateWindowSurface( instance, window.handle, nullptr, &_surface );
|
||||
if ( err != VK_SUCCESS )
|
||||
throw std::runtime_error( "Failed to create window!" );
|
||||
surface = vk::SurfaceKHR( _surface );
|
||||
|
@ -41,7 +41,7 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
vk::UniqueInstance instance = vk::createInstanceUnique( vk::InstanceCreateInfo( {}, &appInfo ) );
|
||||
|
||||
auto h1 = std::hash<vk::Instance>{}( *instance );
|
||||
auto h2 = std::hash<VkInstance>{}( static_cast<VkInstance>( *instance ) );
|
||||
auto h2 = std::hash<VkInstance>{}( *instance );
|
||||
assert( h1 == h2 );
|
||||
|
||||
std::unordered_set<vk::Instance> uset;
|
||||
|
@ -96195,6 +96195,16 @@ namespace VULKAN_HPP_NAMESPACE
|
||||
return *reinterpret_cast<VkPhysicalDevicePresentMeteringFeaturesNV *>( this );
|
||||
}
|
||||
|
||||
operator VkPhysicalDevicePresentMeteringFeaturesNV const *() const VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
return reinterpret_cast<const VkPhysicalDevicePresentMeteringFeaturesNV *>( this );
|
||||
}
|
||||
|
||||
operator VkPhysicalDevicePresentMeteringFeaturesNV *() VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
return reinterpret_cast<VkPhysicalDevicePresentMeteringFeaturesNV *>( this );
|
||||
}
|
||||
|
||||
# if defined( VULKAN_HPP_USE_REFLECT )
|
||||
# if 14 <= VULKAN_HPP_CPP_VERSION
|
||||
auto
|
||||
@ -133180,6 +133190,16 @@ namespace VULKAN_HPP_NAMESPACE
|
||||
return *reinterpret_cast<VkSetPresentConfigNV *>( this );
|
||||
}
|
||||
|
||||
operator VkSetPresentConfigNV const *() const VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
return reinterpret_cast<const VkSetPresentConfigNV *>( this );
|
||||
}
|
||||
|
||||
operator VkSetPresentConfigNV *() VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
return reinterpret_cast<VkSetPresentConfigNV *>( this );
|
||||
}
|
||||
|
||||
# if defined( VULKAN_HPP_USE_REFLECT )
|
||||
# if 14 <= VULKAN_HPP_CPP_VERSION
|
||||
auto
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user