src/libANGLE/renderer/d3d/d3d11/ResourceManager11.cpp


Log

Author Commit Date CI Message
Xinghua Cao 26143fdd 2017-11-01T18:19:05 ES31: Support bindImageTexture on Texture2D for compute shaders on D3D BUG=angleproject:1987 TEST=angle_end2end_tests Change-Id: I3b0afb441a41dbd7f204b1d1bba7884c8d203ce1 Reviewed-on: https://chromium-review.googlesource.com/749004 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 192199a7 2017-11-14T16:12:20 ResourceManager11: Store resource sizes 64-bit. This prevents possible size count overflow when in 32-bit mode with a lot of very large resources. Issue originally reported via Mozilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1412554 BUG=angleproject:2234 Change-Id: Idacfda98356c13bf22bc493ef7aa2bff1a287f97 Reviewed-on: https://chromium-review.googlesource.com/769749 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang a1506213 2017-09-21T10:49:18 Remove initialization of ImageD3D objects now that lazy init covers them Inintialize all D3D11 texture allocations with dummy values in debug. BUG=angleproject:2107 BUG=angleproject:1635 Change-Id: Ibcc6cc30480b32430563143f35f38dda16fdb83c Reviewed-on: https://chromium-review.googlesource.com/678477 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Bruce Dawson 6260b7aa 2017-06-19T11:07:19 Fix kResourceTypeNames initialization Due to a missing comma the kResourceTypeNames array contained a single long (concatenated) string instead of NumResourceTypes independent strings. This incorrect initialization caused a crash in out-of-memory situations, but this was only noticed on VC++ 2017 for some reason. This fix adds the missing comma and uses a static_assert to ensure that the array is initialized correctly. BUG=chromium:727671,728226,731089 Change-Id: I9f0f3d3725b9f773505506513afb6c349db3a7fb Reviewed-on: https://chromium-review.googlesource.com/539536 Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 63fa2e94 2017-06-01T17:11:41 D3D11: Consolidate Query allocation. This compiles the resource refactor for D3D11. The only remaining non-smart handles are for things like SwapChains and ID3D11Blob. This might be more easily managed by using angle::ComPtr or similar smart pointers instead of the Resource Manager class. BUG=angleproject:2034 Change-Id: I53c753a1c19b05c4e72859dd5046e3ed10866847 Reviewed-on: https://chromium-review.googlesource.com/506777 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 0fd806f1 2017-06-01T17:11:40 D3D11: Consolidate Shader allocation. Similar to the InputLayout init, this adds a small helper type to act as a wrapper around shader init data (binary and size). This also adds error trapping to the blit shader compilation. It also removes the LazyResource2 class, and the CompileXS helper methods. BUG=angleproject:2034 Change-Id: I3fd718393c8a0250e4263890f00d0e9147ec9567 Reviewed-on: https://chromium-review.googlesource.com/506776 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 5978e28d 2017-06-02T11:49:31 D3D11: Consolidate InputLayout allocation. This introduces a helper type to act as the initialization data type for input element arrays. A WrappedArray class acts as a helper class to wrap a C array and size into a C++ class, similar to std::array but without the data storage. Also move resource deallocation memory counting into a single code path. BUG=angleproject:2034 Change-Id: I5e108254777f0df65f5f60fe26e760c71b95b542 Reviewed-on: https://chromium-review.googlesource.com/506775 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill b7d5e303 2017-06-01T16:04:46 D3D11: Default init all textures. The resource manager factory methods will use ClearView or zero-filled buffers to set initial data. It assumes there are no 3D depth/stencil textures. This will lead to some wasteful re-creation of RTVs in some cases. This is a temporary measure until we can implement more efficient lazy resource init strategies. BUG=angleproject:1635 Change-Id: I590e76587d3d96a359beedb79e21d24930e5f2e0 Reviewed-on: https://chromium-review.googlesource.com/503254 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 20805650 2017-05-25T12:20:59 D3D11: Consolidate state allocation. This cleans up the allocation and deallocation of Blend, DepthStencil, Rasterizer, and Sampler states. This patch introduces a LazyResource2 class, basically a replacement for LazyResource, which will be removed once the refactor is done. BUG=angleproject:2034 Change-Id: I4fa759ae479807ff69a629f89a08b01800ba3f66 Reviewed-on: https://chromium-review.googlesource.com/503627 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill bdc1e2a2 2017-05-24T14:40:27 D3D11: Consolidate Buffer allocation. We now allocate and release all buffer resources from a single place, allowing us to allocate junk memory, clear on init, and track the currently allocated buffer memory. BUG=angleproject:2034 Change-Id: Id60b63a7f77bc369dfc494a7587ab06c8d34a8e2 Reviewed-on: https://chromium-review.googlesource.com/503253 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 2c479d6e 2017-05-24T14:37:22 D3D11: Use TextureHelper11 everywhere. This consolidates all texture allocation into ResourceManager11. It removes a lot of error checking and resource management code. In a few places we're storing some redundant information, like in TextureStorage11, we might store the Format pointer in two places, or the Texture's size. BUG=angleproject:2034 Change-Id: I9369e76925a67632c444c662e5667c5ed7875547 Reviewed-on: https://chromium-review.googlesource.com/503252 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill e0e009fe 2017-05-19T14:13:03 D3D11: Consolidate SRV allocation. This change also moves all SRV storage to use the custom smart pointer classes in ResourceManager11. Every single SRV is now allocated in ResourceManager11. For TextureStorage11 and RenderTarget11, we use a shared pointer type since the SRVs use shared ownership by both classes. BUG=angleproject:2034 Change-Id: I90666fbbbc23ff10870b7401f3da09ef79258136 Reviewed-on: https://chromium-review.googlesource.com/503250 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 764a1e76 2017-05-18T11:11:47 D3D11: Consolidate DSV allocation. This uses the new classes introduced in ResourceManager11. Smart pointers mean we can use ANGLE_TRY in more places, and don't need to manually release these views. There is now a single point in the D3D11 back-end where depth stencil views are allocated. BUG=angleproject:2034 Change-Id: If0de2529ece1298e8babf24c07cc4be9849cc4de Reviewed-on: https://chromium-review.googlesource.com/503249 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 403c1682 2017-05-18T11:11:46 D3D11: Add resource manager classes. The resource manager tracks the allocations and deallocations of all D3D11 resources that have device memory: Buffers and Textures (which are either 2D or 3D). It also tracks the number of active Views (DSV, RTV, and SRV, potentially UAV with ES 3.1). A new smart pointer type will wrap the resource deallocation so that the object notifies the manager when ANGLE is done with the resouce. This allows us to track precisely how much GPU memory we think we're using at any point, and will help prevent resource leaks for these object types. It also makes initialization and releasing much more trivial. The base class for a resource uses a template template parameter so that we can use a unique or shared pointer depending on if the object in question needs unique or shared ownership. For some resources (in our case, SRVs are shared between the TextureStorage11 and RenderTarget11 classes, and Textures are shared in many places) we need to have the ability to have shared ownership. Unique ownership is a little bit more efficient so supporting both can be helpful. In this patch RenderTargetView allocation is moved to use the unique smart pointer. BUG=angleproject:2034 Change-Id: Idb1245c24cd66733b8b5ca524c727350b2d2c745 Reviewed-on: https://chromium-review.googlesource.com/503248 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>