/** * Copy the contents of the depth/stencil attachment of the G-Buffer to the * current depth/stencil buffer. */ private void renderCopyDepthStencil( final R2GeometryBufferUsableType gbuffer, final AreaInclusiveUnsignedLType lbuffer_area) { final JCGLFramebufferUsableType gb_fb = gbuffer.primaryFramebuffer(); final JCGLFramebuffersType g_fb = this.g.getFramebuffers(); g_fb.framebufferReadBind(gb_fb); g_fb.framebufferBlit( gbuffer.area(), lbuffer_area, DEPTH_STENCIL, JCGLFramebufferBlitFilter.FRAMEBUFFER_BLIT_FILTER_NEAREST); g_fb.framebufferReadUnbind(); }
@Test public final void testFramebufferBindReadDeleted() { final Interfaces i = this.getInterfaces("main"); final JCGLFramebuffersType g_fb = i.getFramebuffers(); final JCGLTexturesType g_tx = i.getTextures(); final JCGLFramebufferBuilderType fbb = g_fb.framebufferNewBuilder(); final List<JCGLTextureUnitType> us = g_tx.textureGetUnits(); final JCGLTextureUnitType u0 = us.get(0); final JCGLTexture2DType t = g_tx.texture2DAllocate( u0, 64L, 64L, JCGLTextureFormat.TEXTURE_FORMAT_DEPTH_16_2BPP, JCGLTextureWrapS.TEXTURE_WRAP_REPEAT, JCGLTextureWrapT.TEXTURE_WRAP_REPEAT, JCGLTextureFilterMinification.TEXTURE_FILTER_NEAREST, JCGLTextureFilterMagnification.TEXTURE_FILTER_NEAREST); g_tx.textureUnitUnbind(u0); fbb.attachDepthTexture2D(t); final JCGLFramebufferType fb = g_fb.framebufferAllocate(fbb); g_fb.framebufferDelete(fb); this.expected.expect(JCGLExceptionDeleted.class); g_fb.framebufferReadBind(fb); }
@Test public final void testFramebufferBindReadDeleted() { final Interfaces i = this.getInterfaces("main"); final JCGLFramebuffersType g_fb = i.getFramebuffers(); final JCGLTexturesType g_tx = i.getTextures(); final JCGLFramebufferBuilderType fbb = g_fb.framebufferNewBuilder(); final List<JCGLTextureUnitType> us = g_tx.textureGetUnits(); final JCGLTextureUnitType u0 = us.get(0); final JCGLTexture2DType t = g_tx.texture2DAllocate( u0, 64L, 64L, JCGLTextureFormat.TEXTURE_FORMAT_DEPTH_16_2BPP, JCGLTextureWrapS.TEXTURE_WRAP_REPEAT, JCGLTextureWrapT.TEXTURE_WRAP_REPEAT, JCGLTextureFilterMinification.TEXTURE_FILTER_NEAREST, JCGLTextureFilterMagnification.TEXTURE_FILTER_NEAREST); g_tx.textureUnitUnbind(u0); fbb.attachDepthTexture2D(t); final JCGLFramebufferType fb = g_fb.framebufferAllocate(fbb); g_fb.framebufferDelete(fb); this.expected.expect(JCGLExceptionDeleted.class); g_fb.framebufferReadBind(fb); }
g_fb.framebufferReadBind(fb_read); g_fb.framebufferBlit( area,
g_fb.framebufferReadUnbind(); g_fb.framebufferDrawBind(fb_draw); g_fb.framebufferReadBind(fb_read);
g_fb.framebufferReadUnbind(); g_fb.framebufferDrawBind(fb_draw); g_fb.framebufferReadBind(fb_read);
g_fb.framebufferReadBind(fb_read); g_fb.framebufferBlit( area,
g_fb.framebufferDrawUnbind(); g_fb.framebufferReadBind(fb); Assert.assertEquals(Optional.of(fb), g_fb.framebufferReadGetBound()); Assert.assertTrue(g_fb.framebufferReadAnyIsBound()); Assert.assertFalse(g_fb.framebufferDrawIsBound(fb)); g_fb.framebufferReadBind(fb); Assert.assertEquals(Optional.of(fb), g_fb.framebufferReadGetBound()); Assert.assertTrue(g_fb.framebufferReadAnyIsBound());
g_fb.framebufferDrawUnbind(); g_fb.framebufferReadBind(fb); Assert.assertEquals(Optional.of(fb), g_fb.framebufferReadGetBound()); Assert.assertTrue(g_fb.framebufferReadAnyIsBound()); Assert.assertFalse(g_fb.framebufferDrawIsBound(fb)); g_fb.framebufferReadBind(fb); Assert.assertEquals(Optional.of(fb), g_fb.framebufferReadGetBound()); Assert.assertTrue(g_fb.framebufferReadAnyIsBound());
@Test public final void testFramebufferDeleteIdentitiesRead() { final Interfaces i = this.getInterfaces("main"); final JCGLFramebuffersType g_fb = i.getFramebuffers(); final JCGLTexturesType g_tx = i.getTextures(); final JCGLFramebufferBuilderType fbb = g_fb.framebufferNewBuilder(); final List<JCGLTextureUnitType> us = g_tx.textureGetUnits(); final JCGLTextureUnitType u0 = us.get(0); final JCGLTexture2DType t = g_tx.texture2DAllocate( u0, 64L, 64L, JCGLTextureFormat.TEXTURE_FORMAT_DEPTH_16_2BPP, JCGLTextureWrapS.TEXTURE_WRAP_REPEAT, JCGLTextureWrapT.TEXTURE_WRAP_REPEAT, JCGLTextureFilterMinification.TEXTURE_FILTER_NEAREST, JCGLTextureFilterMagnification.TEXTURE_FILTER_NEAREST); g_tx.textureUnitUnbind(u0); fbb.attachDepthTexture2D(t); final JCGLFramebufferType fb = g_fb.framebufferAllocate(fbb); g_fb.framebufferDrawUnbind(); g_fb.framebufferReadBind(fb); Assert.assertEquals(Optional.of(fb), g_fb.framebufferReadGetBound()); Assert.assertTrue(g_fb.framebufferReadAnyIsBound()); Assert.assertTrue(g_fb.framebufferReadIsBound(fb)); g_fb.framebufferDelete(fb); Assert.assertTrue(fb.isDeleted()); Assert.assertFalse(g_fb.framebufferReadAnyIsBound()); }
@Test public final void testFramebufferDeleteIdentitiesRead() { final Interfaces i = this.getInterfaces("main"); final JCGLFramebuffersType g_fb = i.getFramebuffers(); final JCGLTexturesType g_tx = i.getTextures(); final JCGLFramebufferBuilderType fbb = g_fb.framebufferNewBuilder(); final List<JCGLTextureUnitType> us = g_tx.textureGetUnits(); final JCGLTextureUnitType u0 = us.get(0); final JCGLTexture2DType t = g_tx.texture2DAllocate( u0, 64L, 64L, JCGLTextureFormat.TEXTURE_FORMAT_DEPTH_16_2BPP, JCGLTextureWrapS.TEXTURE_WRAP_REPEAT, JCGLTextureWrapT.TEXTURE_WRAP_REPEAT, JCGLTextureFilterMinification.TEXTURE_FILTER_NEAREST, JCGLTextureFilterMagnification.TEXTURE_FILTER_NEAREST); g_tx.textureUnitUnbind(u0); fbb.attachDepthTexture2D(t); final JCGLFramebufferType fb = g_fb.framebufferAllocate(fbb); g_fb.framebufferDrawUnbind(); g_fb.framebufferReadBind(fb); Assert.assertEquals(Optional.of(fb), g_fb.framebufferReadGetBound()); Assert.assertTrue(g_fb.framebufferReadAnyIsBound()); Assert.assertTrue(g_fb.framebufferReadIsBound(fb)); g_fb.framebufferDelete(fb); Assert.assertTrue(fb.isDeleted()); Assert.assertFalse(g_fb.framebufferReadAnyIsBound()); }
g_fb.framebufferDrawValidate()); g_fb.framebufferReadBind(fb_read); Assert.assertEquals( JCGLFramebufferStatus.FRAMEBUFFER_STATUS_COMPLETE,
g_fb.framebufferDrawValidate()); g_fb.framebufferReadBind(fb_read); Assert.assertEquals( JCGLFramebufferStatus.FRAMEBUFFER_STATUS_COMPLETE,