| 17 | }; |
| 18 | |
| 19 | TEST( Attachment, SampledAttachment ) |
| 20 | { |
| 21 | testBegin( "testSampledAttachment" ) |
| 22 | crg::ResourceHandler handler; |
| 23 | crg::FrameGraph graph{ handler, testCounts.testName }; |
| 24 | auto image = graph.createImage( test::createImage( "Test", crg::PixelFormat::eR32G32B32A32_SFLOAT ) ); |
| 25 | auto view = graph.createView( test::createView( "Test", image ) ); |
| 26 | crg::FramePass & pass = graph.createPass( "test", crg::RunnablePassCreator{} ); |
| 27 | auto tmpAttach1 = crg::Attachment::createDefault( view ); |
| 28 | auto tmpAttach2 = crg::Attachment::createDefault( view ); |
| 29 | tmpAttach2 = std::move( tmpAttach1 ); |
| 30 | tmpAttach1 = tmpAttach2; |
| 31 | auto viewAttach = std::move( tmpAttach2 ); |
| 32 | pass.addInputSampled( viewAttach, 1u ); |
| 33 | require( pass.getSampled().size() == 1u ) |
| 34 | auto attachIt = pass.getSampled().begin(); |
| 35 | auto const & attachment = attachIt->second; |
| 36 | check( attachment.attach->isImage() ) |
| 37 | check( attachment.attach->isInput() ) |
| 38 | check( !attachment.attach->isOutput() ) |
| 39 | check( !attachment.attach->isClearable() ) |
| 40 | check( !attachment.attach->isTransitionImageView() ) |
| 41 | check( !attachment.attach->isTransferImageView() ) |
| 42 | check( !attachment.attach->imageAttach.isDepthStencilTarget() ) |
| 43 | check( !attachment.attach->imageAttach.isDepthTarget() ) |
| 44 | check( !attachment.attach->imageAttach.isStencilTarget() ) |
| 45 | check( !attachment.attach->imageAttach.isStencilInputTarget() ) |
| 46 | check( !attachment.attach->imageAttach.isStencilOutputTarget() ) |
| 47 | check( attachment.attach->name == pass.getGroupName() + "/" + view.data->name + "/Spl" ) |
| 48 | checkEqual( attachment.attach->getLoadOp(), crg::AttachmentLoadOp::eDontCare ) |
| 49 | checkEqual( attachment.attach->getStoreOp(), crg::AttachmentStoreOp::eDontCare ) |
| 50 | checkEqual( attachment.attach->getStencilLoadOp(), crg::AttachmentLoadOp::eDontCare ) |
| 51 | checkEqual( attachment.attach->getStencilStoreOp(), crg::AttachmentStoreOp::eDontCare ) |
| 52 | check( attachment.attach->view() == view ) |
| 53 | check( attachIt->first == 1u ) |
| 54 | check( attachment.sampler == defaultSamplerDesc ) |
| 55 | checkEqual( attachment.attach->getImageLayout( false ), crg::ImageLayout::eShaderReadOnly ) |
| 56 | checkEqual( attachment.attach->getImageLayout( true ), crg::ImageLayout::eShaderReadOnly ) |
| 57 | testEnd() |
| 58 | } |
| 59 | |
| 60 | TEST( Attachment, SampledAttachmentT ) |
| 61 | { |
nothing calls this directly
no test coverage detected