@ -57,12 +57,14 @@ struct RenderPassTest: TestSuite::Tester {
void attachmentDescriptionConstructNoInit ( ) ;
void attachmentDescriptionConstructNoInit ( ) ;
template < class From , class To > void attachmentDescriptionConstructFromVk ( ) ;
template < class From , class To > void attachmentDescriptionConstructFromVk ( ) ;
template < class T > void attachmentDescriptionConvertToVk ( ) ;
template < class T > void attachmentDescriptionConvertToVk ( ) ;
void attachmentDescriptionConvertDisallowed ( ) ;
void attachmentReferenceConstruct ( ) ;
void attachmentReferenceConstruct ( ) ;
void attachmentReferenceConstructUnused ( ) ;
void attachmentReferenceConstructUnused ( ) ;
void attachmentReferenceConstructNoInit ( ) ;
void attachmentReferenceConstructNoInit ( ) ;
template < class From , class To > void attachmentReferenceConstructFromVk ( ) ;
template < class From , class To > void attachmentReferenceConstructFromVk ( ) ;
template < class T > void attachmentReferenceConvertToVk ( ) ;
template < class T > void attachmentReferenceConvertToVk ( ) ;
void attachmentReferenceConvertDisallowed ( ) ;
void subpassDescriptionConstruct ( ) ;
void subpassDescriptionConstruct ( ) ;
void subpassDescriptionConstructNoInit ( ) ;
void subpassDescriptionConstructNoInit ( ) ;
@ -79,12 +81,14 @@ struct RenderPassTest: TestSuite::Tester {
template < class T > void subpassDescriptionConvertToVk ( ) ;
template < class T > void subpassDescriptionConvertToVk ( ) ;
template < class T > void subpassDescriptionConvertToVkNoAttachments ( ) ;
template < class T > void subpassDescriptionConvertToVkNoAttachments ( ) ;
template < class T > void subpassDescriptionConvertToVkNoResolveAttachments ( ) ;
template < class T > void subpassDescriptionConvertToVkNoResolveAttachments ( ) ;
void subpassDescriptionConvertDisallowed ( ) ;
void subpassDescriptionRvalue ( ) ;
void subpassDescriptionRvalue ( ) ;
void subpassDependencyConstruct ( ) ;
void subpassDependencyConstruct ( ) ;
void subpassDependencyConstructNoInit ( ) ;
void subpassDependencyConstructNoInit ( ) ;
template < class From , class To > void subpassDependencyConstructFromVk ( ) ;
template < class From , class To > void subpassDependencyConstructFromVk ( ) ;
template < class T > void subpassDependencyConvertToVk ( ) ;
template < class T > void subpassDependencyConvertToVk ( ) ;
void subpassDependencyConvertDisallowed ( ) ;
void createInfoConstruct ( ) ;
void createInfoConstruct ( ) ;
void createInfoConstructNoInit ( ) ;
void createInfoConstructNoInit ( ) ;
@ -131,6 +135,7 @@ RenderPassTest::RenderPassTest() {
& RenderPassTest : : attachmentDescriptionConstructFromVk < VkAttachmentDescription , VkAttachmentDescription > ,
& RenderPassTest : : attachmentDescriptionConstructFromVk < VkAttachmentDescription , VkAttachmentDescription > ,
& RenderPassTest : : attachmentDescriptionConvertToVk < VkAttachmentDescription2 > ,
& RenderPassTest : : attachmentDescriptionConvertToVk < VkAttachmentDescription2 > ,
& RenderPassTest : : attachmentDescriptionConvertToVk < VkAttachmentDescription > ,
& RenderPassTest : : attachmentDescriptionConvertToVk < VkAttachmentDescription > ,
& RenderPassTest : : attachmentDescriptionConvertDisallowed ,
& RenderPassTest : : attachmentReferenceConstruct ,
& RenderPassTest : : attachmentReferenceConstruct ,
& RenderPassTest : : attachmentReferenceConstructUnused ,
& RenderPassTest : : attachmentReferenceConstructUnused ,
@ -141,6 +146,7 @@ RenderPassTest::RenderPassTest() {
& RenderPassTest : : attachmentReferenceConstructFromVk < VkAttachmentReference , VkAttachmentReference > ,
& RenderPassTest : : attachmentReferenceConstructFromVk < VkAttachmentReference , VkAttachmentReference > ,
& RenderPassTest : : attachmentReferenceConvertToVk < VkAttachmentReference2 > ,
& RenderPassTest : : attachmentReferenceConvertToVk < VkAttachmentReference2 > ,
& RenderPassTest : : attachmentReferenceConvertToVk < VkAttachmentReference > ,
& RenderPassTest : : attachmentReferenceConvertToVk < VkAttachmentReference > ,
& RenderPassTest : : attachmentReferenceConvertDisallowed ,
& RenderPassTest : : subpassDescriptionConstruct ,
& RenderPassTest : : subpassDescriptionConstruct ,
& RenderPassTest : : subpassDescriptionConstructNoInit ,
& RenderPassTest : : subpassDescriptionConstructNoInit ,
@ -163,6 +169,7 @@ RenderPassTest::RenderPassTest() {
& RenderPassTest : : subpassDescriptionConvertToVkNoAttachments < VkSubpassDescription > ,
& RenderPassTest : : subpassDescriptionConvertToVkNoAttachments < VkSubpassDescription > ,
& RenderPassTest : : subpassDescriptionConvertToVkNoResolveAttachments < VkSubpassDescription2 > ,
& RenderPassTest : : subpassDescriptionConvertToVkNoResolveAttachments < VkSubpassDescription2 > ,
& RenderPassTest : : subpassDescriptionConvertToVkNoResolveAttachments < VkSubpassDescription > ,
& RenderPassTest : : subpassDescriptionConvertToVkNoResolveAttachments < VkSubpassDescription > ,
& RenderPassTest : : subpassDescriptionConvertDisallowed ,
& RenderPassTest : : subpassDescriptionRvalue ,
& RenderPassTest : : subpassDescriptionRvalue ,
& RenderPassTest : : subpassDependencyConstruct ,
& RenderPassTest : : subpassDependencyConstruct ,
@ -173,6 +180,7 @@ RenderPassTest::RenderPassTest() {
& RenderPassTest : : subpassDependencyConstructFromVk < VkSubpassDependency , VkSubpassDependency > ,
& RenderPassTest : : subpassDependencyConstructFromVk < VkSubpassDependency , VkSubpassDependency > ,
& RenderPassTest : : subpassDependencyConvertToVk < VkSubpassDependency2 > ,
& RenderPassTest : : subpassDependencyConvertToVk < VkSubpassDependency2 > ,
& RenderPassTest : : subpassDependencyConvertToVk < VkSubpassDependency > ,
& RenderPassTest : : subpassDependencyConvertToVk < VkSubpassDependency > ,
& RenderPassTest : : subpassDependencyConvertDisallowed ,
& RenderPassTest : : createInfoConstruct ,
& RenderPassTest : : createInfoConstruct ,
& RenderPassTest : : createInfoConstructNoInit ,
& RenderPassTest : : createInfoConstructNoInit ,
@ -341,6 +349,20 @@ template<class T> void RenderPassTest::attachmentDescriptionConvertToVk() {
CORRADE_COMPARE ( out . finalLayout , VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL ) ;
CORRADE_COMPARE ( out . finalLayout , VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL ) ;
}
}
void RenderPassTest : : attachmentDescriptionConvertDisallowed ( ) {
# ifdef CORRADE_NO_ASSERT
CORRADE_SKIP ( " CORRADE_NO_ASSERT defined, can't test assertions " ) ;
# endif
AttachmentDescription description { PixelFormat { } , AttachmentLoadOperation { } , AttachmentStoreOperation { } , ImageLayout { } , ImageLayout { } } ;
description - > pNext = & description ;
std : : ostringstream out ;
Error redirectError { & out } ;
description . vkAttachmentDescription ( ) ;
CORRADE_COMPARE ( out . str ( ) , " Vk::AttachmentDescription: disallowing conversion to VkAttachmentDescription with non-empty pNext to prevent information loss \n " ) ;
}
void RenderPassTest : : attachmentReferenceConstruct ( ) {
void RenderPassTest : : attachmentReferenceConstruct ( ) {
AttachmentReference reference { 3 , ImageLayout : : ColorAttachment } ;
AttachmentReference reference { 3 , ImageLayout : : ColorAttachment } ;
CORRADE_COMPARE ( reference - > attachment , 3 ) ;
CORRADE_COMPARE ( reference - > attachment , 3 ) ;
@ -387,6 +409,20 @@ template<class T> void RenderPassTest::attachmentReferenceConvertToVk() {
CORRADE_COMPARE ( out . layout , VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL ) ;
CORRADE_COMPARE ( out . layout , VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL ) ;
}
}
void RenderPassTest : : attachmentReferenceConvertDisallowed ( ) {
# ifdef CORRADE_NO_ASSERT
CORRADE_SKIP ( " CORRADE_NO_ASSERT defined, can't test assertions " ) ;
# endif
AttachmentReference reference { 0 , ImageLayout { } } ;
reference - > pNext = & reference ;
std : : ostringstream out ;
Error redirectError { & out } ;
reference . vkAttachmentReference ( ) ;
CORRADE_COMPARE ( out . str ( ) , " Vk::AttachmentReference: disallowing conversion to VkAttachmentReference with non-empty pNext to prevent information loss \n " ) ;
}
void RenderPassTest : : subpassDescriptionConstruct ( ) {
void RenderPassTest : : subpassDescriptionConstruct ( ) {
/** @todo use a real flag once it exists */
/** @todo use a real flag once it exists */
SubpassDescription description { SubpassDescription : : Flag ( VK_INCOMPLETE ) } ;
SubpassDescription description { SubpassDescription : : Flag ( VK_INCOMPLETE ) } ;
@ -703,6 +739,20 @@ template<class T> void RenderPassTest::subpassDescriptionConvertToVkNoResolveAtt
CORRADE_VERIFY ( ! to . pResolveAttachments ) ;
CORRADE_VERIFY ( ! to . pResolveAttachments ) ;
}
}
void RenderPassTest : : subpassDescriptionConvertDisallowed ( ) {
# ifdef CORRADE_NO_ASSERT
CORRADE_SKIP ( " CORRADE_NO_ASSERT defined, can't test assertions " ) ;
# endif
SubpassDescription description ;
description - > pNext = & description ;
std : : ostringstream out ;
Error redirectError { & out } ;
description . vkSubpassDescription ( ) ;
CORRADE_COMPARE ( out . str ( ) , " Vk::SubpassDescription: disallowing conversion to VkSubpassDescription with non-empty pNext to prevent information loss \n " ) ;
}
void RenderPassTest : : subpassDescriptionRvalue ( ) {
void RenderPassTest : : subpassDescriptionRvalue ( ) {
SubpassDescription & & description = SubpassDescription { }
SubpassDescription & & description = SubpassDescription { }
. setInputAttachments ( Containers : : ArrayView < const AttachmentReference > { } )
. setInputAttachments ( Containers : : ArrayView < const AttachmentReference > { } )
@ -800,6 +850,20 @@ template<class T> void RenderPassTest::subpassDependencyConvertToVk() {
CORRADE_COMPARE ( out . dependencyFlags , VK_DEPENDENCY_BY_REGION_BIT ) ;
CORRADE_COMPARE ( out . dependencyFlags , VK_DEPENDENCY_BY_REGION_BIT ) ;
}
}
void RenderPassTest : : subpassDependencyConvertDisallowed ( ) {
# ifdef CORRADE_NO_ASSERT
CORRADE_SKIP ( " CORRADE_NO_ASSERT defined, can't test assertions " ) ;
# endif
SubpassDependency dependency { 0 , PipelineStages { } , Accesses { } , 1 , PipelineStages { } , Accesses { } } ;
dependency - > pNext = & dependency ;
std : : ostringstream out ;
Error redirectError { & out } ;
dependency . vkSubpassDependency ( ) ;
CORRADE_COMPARE ( out . str ( ) , " Vk::SubpassDependency: disallowing conversion to VkSubpassDependency with non-empty pNext to prevent information loss \n " ) ;
}
void RenderPassTest : : createInfoConstruct ( ) {
void RenderPassTest : : createInfoConstruct ( ) {
/** @todo use a real flag once it exists */
/** @todo use a real flag once it exists */
RenderPassCreateInfo info { RenderPassCreateInfo : : Flag ( VK_INCOMPLETE ) } ;
RenderPassCreateInfo info { RenderPassCreateInfo : : Flag ( VK_INCOMPLETE ) } ;