shairai / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

Refactor FBO attachments #963

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Currently FBO attachments have a few gotchas:

 * our code allocates new memory every set and glMakeCurrent
 * we need specialized helper functions to de-reference to the native render target
 * we use and Impl class for Default attachments, but not for the other types

We could clean this up quite a bit, and improve performance by not 
re-allocating and using virtual methods instead of ifs.

Original issue reported on code.google.com by jmad...@chromium.org on 1 Apr 2015 at 4:37

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Jamie Madill <jmadill@chromium.org>
Commit : c30c424ff044d6832d48d0150328dbadc59f739a

Code-Review  0 : Brandon Jones, Jamie Madill, Kenneth Russell
Code-Review  +2: Geoff Lang
Verified     0 : Brandon Jones, Geoff Lang, Kenneth Russell
Verified     +1: Jamie Madill
Commit Queue   : Chumped
Change-Id      : I7e1cb161d1e08f78b1c4d730a32ad09ac7e61e30
Reviewed-at    : https://chromium-review.googlesource.com/263482

Make egl::Surface ref-counted.

This will let us store references to Surface in FBO attachments,
even after the surface is destroyed.

BUG=angleproject:963

src/libANGLE/RefCountObject.cpp
src/libANGLE/Surface.cpp
src/libANGLE/Surface.h
src/libANGLE/Surface_unittest.cpp
src/libANGLE/renderer/DisplayImpl.cpp

Original comment by bugdro...@chromium.org on 1 Apr 2015 at 7:10

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Jamie Madill <jmadill@chromium.org>
Commit : c46f45d90638e554096ea8e042a872be68f6bea2

Code-Review  0 : Brandon Jones, Jamie Madill
Code-Review  +1: Kenneth Russell
Code-Review  +2: Geoff Lang
Verified     0 : Brandon Jones, Geoff Lang, Kenneth Russell
Verified     +1: Jamie Madill
Commit Queue   : Chumped
Change-Id      : I3e34849e8b1ccae0c91a79617ec6f64aaaab6b10
Reviewed-at    : https://chromium-review.googlesource.com/263483

Refactor DefaultAttachments.

Instead of using an Impl type for default attachments, store the
egl::Surface pointer where possible.

BUG=angleproject:963

src/libANGLE/Framebuffer.cpp
src/libANGLE/FramebufferAttachment.cpp
src/libANGLE/FramebufferAttachment.h
src/libANGLE/renderer/d3d/FramebufferD3D.cpp
src/libANGLE/renderer/d3d/SurfaceD3D.cpp
src/libANGLE/renderer/d3d/SurfaceD3D.h
src/libANGLE/renderer/d3d/SwapChainD3D.h
src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
src/libANGLE/renderer/d3d/d3d11/SwapChain11.h
src/libANGLE/renderer/d3d/d3d9/SwapChain9.cpp
src/libANGLE/renderer/d3d/d3d9/SwapChain9.h

Original comment by bugdro...@chromium.org on 2 Apr 2015 at 2:55

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Jamie Madill <jmadill@chromium.org>
Commit : 7f67b030a8ae26e3ff54f6d33c655fc69c0b9fdb

Code-Review  0 : Brandon Jones, Jamie Madill
Code-Review  +1: Kenneth Russell
Code-Review  +2: Geoff Lang
Verified     0 : Brandon Jones, Geoff Lang, Kenneth Russell
Verified     +1: Jamie Madill
Commit Queue   : Chumped
Change-Id      : I472e13664e45f9f05621dea3d28135d4e833fb3d
Reviewed-at    : https://chromium-review.googlesource.com/263485

Move resource storage to attachment base.

We can use GetAs() to retrieve the corresponding API object.

BUG=angleproject:963

src/libANGLE/FramebufferAttachment.cpp
src/libANGLE/FramebufferAttachment.h

Original comment by bugdro...@chromium.org on 2 Apr 2015 at 3:38

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Jamie Madill <jmadill@chromium.org>
Commit : 4ef3c241f204fbc800c23c4d96ea1e651ca5f4ed

Code-Review  0 : Brandon Jones, Jamie Madill
Code-Review  +1: Kenneth Russell
Code-Review  +2: Geoff Lang
Verified     0 : Brandon Jones, Geoff Lang, Kenneth Russell
Verified     +1: Jamie Madill
Commit Queue   : Chumped
Change-Id      : I5e6fa64822e637e1cc769be6fe777fa6e13a0d83
Reviewed-at    : https://chromium-review.googlesource.com/263484

Remove DefaultAttachment.

This class is no longer necessary or used.

BUG=angleproject:963

src/libANGLE/Framebuffer.h
src/libANGLE/FramebufferAttachment.cpp
src/libANGLE/FramebufferAttachment.h
src/libANGLE/renderer/DefaultAttachmentImpl.h
src/libANGLE/renderer/ImplFactory.h
src/libANGLE/renderer/d3d/FramebufferD3D.cpp
src/libANGLE/renderer/d3d/FramebufferD3D.h
src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
src/libANGLE/renderer/d3d/d3d11/Renderer11.h
src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp
src/libANGLE/renderer/d3d/d3d9/Renderer9.h
src/libANGLE/renderer/generate_new_renderer.py
src/libANGLE/renderer/gl/DefaultAttachmentGL.cpp
src/libANGLE/renderer/gl/DefaultAttachmentGL.h
src/libANGLE/renderer/gl/RendererGL.cpp
src/libANGLE/renderer/gl/RendererGL.h
src/libGLESv2.gypi
src/tests/angle_unittests_utils.h

Original comment by bugdro...@chromium.org on 2 Apr 2015 at 3:38

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Jamie Madill <jmadill@chromium.org>
Commit : 6c7a80d85de8dfe5a797518324280e173eb1f501

Code-Review  0 : Jamie Madill
Code-Review  +2: Geoff Lang
Verified     0 : Geoff Lang
Verified     +1: Jamie Madill
Commit Queue   : Chumped
Change-Id      : I1ac64aa0908a58d9780054084d5c205c61848763
Reviewed-at    : https://chromium-review.googlesource.com/263730

Detect RTTI properly on Clang.

This was giving a compile error on OSX. Also update the logic
slightly.

BUG=angleproject:963

src/common/debug.h

Original comment by bugdro...@chromium.org on 2 Apr 2015 at 5:16

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Jamie Madill <jmadill@chromium.org>
Commit : 7936a6d3c4a4f3895634ef58d915a1ca76bf7695

Code-Review  0 : Brandon Jones, Geoff Lang, Kenneth Russell
Code-Review  +2: Jamie Madill
Verified     0 : Brandon Jones, Geoff Lang, Kenneth Russell
Verified     +1: Jamie Madill
Commit Queue   : Chumped
Change-Id      : I1efb2e41aa08766189499995b3150aec6fd61c4e
Reviewed-at    : https://chromium-review.googlesource.com/263486

Move the texture index to attachment base.

This will let us squash the attachment types in a follow-up patch.

BUG=angleproject:963

src/libANGLE/FramebufferAttachment.cpp
src/libANGLE/FramebufferAttachment.h

Original comment by bugdro...@chromium.org on 2 Apr 2015 at 6:08

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Jamie Madill <jmadill@chromium.org>
Commit : 8cf4a39bbfd04fb30ad789777fa6f6de594f5048

Code-Review  0 : Brandon Jones, Geoff Lang, Kenneth Russell
Code-Review  +2: Jamie Madill
Verified     0 : Brandon Jones, Geoff Lang, Kenneth Russell
Verified     +1: Jamie Madill
Commit Queue   : Chumped
Change-Id      : I62419095a7b65486f54d74791027594e8e595e48
Reviewed-at    : https://chromium-review.googlesource.com/263629

Return a ref for FBO attachment image indexes.

This cleans up the syntax somewhat. Also place some more of the
helper methods in the header.

BUG=angleproject:963

src/libANGLE/Framebuffer.cpp
src/libANGLE/FramebufferAttachment.cpp
src/libANGLE/FramebufferAttachment.h
src/libANGLE/renderer/d3d/FramebufferD3D.cpp
src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
src/libANGLE/renderer/d3d/d3d11/Renderer11.h
src/libANGLE/validationES.cpp

Original comment by bugdro...@chromium.org on 2 Apr 2015 at 6:09

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Jamie Madill <jmadill@chromium.org>
Commit : 77a72f6ecf6c2186cfe5150444af7e79fdece2fc

Code-Review  0 : Geoff Lang, Jamie Madill, Scott Graham
Code-Review  +2: Kenneth Russell
Verified     0 : Geoff Lang, Kenneth Russell, Scott Graham
Verified     +1: Jamie Madill
Commit Queue   : Chumped
Change-Id      : Icdee3a7db97c9b54d779dabf1e1f82a89fefc546
Reviewed-at    : https://chromium-review.googlesource.com/265064

Release Surface when calling makeCurrent with null.

Refactorings to egl::Surface to enable ref-counting were causing
a situation where we could have two Window surfaces alive at the
same time. This would confuse the window procedure logic in
SurfaceD3D. Releasing the surface fixes this issue and conforms
closely to the wording on the spec on when Surfaces should be
deleted. Also add a test for message loops and surfaces.

BUG=475085
BUG=angleproject:963

src/libANGLE/Context.cpp
src/libANGLE/Context.h
src/libANGLE/Display.cpp
src/libANGLE/State.cpp
src/libGLESv2/entry_points_egl.cpp
src/tests/angle_end2end_tests.gypi
src/tests/end2end_tests/ANGLETest.cpp
src/tests/standalone_tests/EGLSurfaceTest.cpp
util/EGLWindow.cpp
util/EGLWindow.h
util/Event.h
util/OSWindow.cpp
util/OSWindow.h
util/win32/Win32Window.cpp
util/win32/Win32Window.h

Original comment by bugdro...@chromium.org on 14 Apr 2015 at 8:46

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Jamie Madill <jmadill@chromium.org>
Commit : 5160ec11fcc5b562ef39704f68fec480a573c172

Code-Review  0 : Geoff Lang, Jamie Madill
Code-Review  +1: Kenneth Russell
Code-Review  +2: Brandon Jones
Verified     0 : Brandon Jones, Geoff Lang, Kenneth Russell
Verified     +1: Jamie Madill
Commit Queue   : Chumped
Change-Id      : Ib4b61da14efaf843478b059499c01e34f9c65e4f
Reviewed-at    : https://chromium-review.googlesource.com/263488

Squash the attachment types.

We can store all relevant information in the base class, which
lets us avoid using any virtual methods. This will finally let
us avoid using reallocations on FBO attachment sets.

BUG=angleproject:963

src/libANGLE/Framebuffer.cpp
src/libANGLE/FramebufferAttachment.cpp
src/libANGLE/FramebufferAttachment.h
src/libANGLE/renderer/d3d/FramebufferD3D.cpp
src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp
src/libANGLE/renderer/gl/FramebufferGL.cpp

Original comment by bugdro...@chromium.org on 15 Apr 2015 at 1:48

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Jamie Madill <jmadill@chromium.org>
Commit : 79481d654daf1ebc9c4596e853ec90b4f64d9e95

Code-Review  0 : Brandon Jones, Geoff Lang
Code-Review  +1: Kenneth Russell
Code-Review  +2: Jamie Madill
Verified     0 : Brandon Jones, Geoff Lang, Kenneth Russell
Verified     +1: Jamie Madill
Commit Queue   : Chumped
Change-Id      : Ia9a43dbc3b99475c00f6bc2ed5475deef55addc3
Reviewed-at    : https://chromium-review.googlesource.com/263487

Add FramebufferAttachmentObject base class.

This lets us share objects (Textures/RBs/Surface) in the attachment
class. It will let us squash the attachment classes into one type,
which will in turn let us store them by-value, instead of by-pointer.

BUG=angleproject:963

src/libANGLE/FramebufferAttachment.cpp
src/libANGLE/FramebufferAttachment.h
src/libANGLE/Renderbuffer.cpp
src/libANGLE/Renderbuffer.h
src/libANGLE/Surface.cpp
src/libANGLE/Surface.h
src/libANGLE/Texture.cpp
src/libANGLE/Texture.h
src/libANGLE/renderer/RenderbufferImpl.h
src/libANGLE/renderer/TextureImpl.h

Original comment by bugdro...@chromium.org on 15 Apr 2015 at 1:48

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Jamie Madill <jmadill@chromium.org>
Commit : b6bda4afa054de2e83d8616433afe4b7066f85d4

Code-Review  0 : Jamie Madill, Kenneth Russell
Code-Review  +1: Geoff Lang
Code-Review  +2: Brandon Jones
Verified     0 : Brandon Jones, Geoff Lang, Kenneth Russell
Verified     +1: Jamie Madill
Commit Queue   : Chumped
Change-Id      : If825095458eaf9367f616f0bb54084025efb9882
Reviewed-at    : https://chromium-review.googlesource.com/265937

Make Framebuffer::Data members private.

This makes "Data" a proper class, and enforces access control when
used in FramebufferImpl. This gives a cleaner refactor when we
switch the internals of the class to use value types to store
attachments instead of pointer types.

BUG=angleproject:963

src/libANGLE/Framebuffer.cpp
src/libANGLE/Framebuffer.h
src/libANGLE/State.cpp
src/libANGLE/renderer/d3d/FramebufferD3D.cpp
src/libANGLE/renderer/d3d/ImageD3D.cpp
src/libANGLE/renderer/d3d/RendererD3D.cpp
src/libANGLE/renderer/d3d/d3d11/Clear11.cpp
src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp
src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
src/libANGLE/renderer/d3d/d3d9/Blit9.cpp
src/libANGLE/renderer/d3d/d3d9/Framebuffer9.cpp
src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp
src/libANGLE/validationES.cpp
src/libANGLE/validationES3.cpp

Original comment by bugdro...@chromium.org on 21 Apr 2015 at 12:34

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Jamie Madill <jmadill@chromium.org>
Commit : ed61a5f673cefe1fac580e96adaa3da698d448e3

Code-Review  0 : Brandon Jones, Jamie Madill, Kenneth Russell
Code-Review  +2: Geoff Lang
Verified     0 : Brandon Jones, Geoff Lang, Kenneth Russell
Verified     +1: Jamie Madill
Commit Queue   : Chumped
Change-Id      : Ibe7b8f8245f762916e0224fdc78796b1c933195f
Reviewed-at    : https://chromium-review.googlesource.com/263490

Remove non-const FBO attachment queries.

Methods that need to mutate the Framebuffer should use
setAttachment, etc, instead of using mutable pointers.

BUG=angleproject:963

src/libANGLE/Framebuffer.cpp
src/libANGLE/Framebuffer.h
src/libANGLE/State.cpp
src/libANGLE/validationES.cpp
src/libGLESv2/entry_points_gles_2_0.cpp

Original comment by bugdro...@chromium.org on 21 Apr 2015 at 12:35

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Jamie Madill <jmadill@chromium.org>
Commit : 13773b26dfb29b963ea727e1ebf7bdabdc5892b1

Code-Review  0 : Jamie Madill, Kenneth Russell
Code-Review  +1: Geoff Lang
Code-Review  +2: Brandon Jones
Verified     0 : Brandon Jones, Geoff Lang, Kenneth Russell
Verified     +1: Jamie Madill
Commit Queue   : Chumped
Change-Id      : Iafa4e4a0f3dd66c9e7452e0e96a0cbb9753487bb
Reviewed-at    : https://chromium-review.googlesource.com/263489

Store value types for FBO attachments.

This prevents us from re-allocating FBO attachments every set.
This change requires quite a bit of refactoring.

BUG=angleproject:963

src/libANGLE/Framebuffer.cpp
src/libANGLE/Framebuffer.h
src/libANGLE/FramebufferAttachment.cpp
src/libANGLE/FramebufferAttachment.h
src/libANGLE/renderer/d3d/FramebufferD3D.cpp
src/libANGLE/renderer/d3d/FramebufferD3D.h
src/libANGLE/renderer/d3d/d3d11/Clear11.cpp
src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp
src/libANGLE/validationES.cpp
src/libGLESv2/entry_points_gles_2_0.cpp
src/libGLESv2/entry_points_gles_3_0.cpp

Original comment by bugdro...@chromium.org on 21 Apr 2015 at 12:35