src/libANGLE/renderer/renderer_utils.h


Log

Author Commit Date CI Message
Jamie Madill f2f6d379 2018-01-10T21:37:23 Vulkan: Add PipelineDesc. The PipelineDesc class is a 512-byte packed description of the entire Vulkan pipeline state. It uses the alignas keyword and some static asserts to verify that the structures are packed. This ensures that when ANGLE uses MurmurHash to hash the entire struct, and memcmp to check for identity, that there are no garbage padding bits. This CL does not implement the Pipeline cache, but it will help, since now we have a packed type that can be used as the key to a hash map. Bug: angleproject:2163 Change-Id: I16efa927f08d30d89a9c4c8943edd211c6878ac8 Reviewed-on: https://chromium-review.googlesource.com/829893 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Corentin Wallez cda6af19 2017-10-30T19:20:37 Split pixelBuffer from pack/unpack state This will refactor will help use packed enums for buffer targets. BUG=angleproject:2169 Change-Id: Ie7ed3e105f89457c67027e6598d7e29503ad355c Reviewed-on: https://chromium-review.googlesource.com/745181 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 5ad26408 2017-10-17T15:32:06 Add destructor to MultisampleTextureInitializer. This was generating a warning for missing virtual destructor in some configurations. BUG=angleproject:2167 Change-Id: I05e335de4ab1160c6066665d588b50527ea34cbd Reviewed-on: https://chromium-review.googlesource.com/723980 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 42975644 2017-10-12T12:31:51 Move incomplete texture logic to shared helper. The incomplete texture handling is similar between the D3D and Vulkan back-ends. We create 1x1 textures, initialize them to black, and bind them when we detect incomplete textures. We would also bind incomplete textures when we detect feedback loops. In the GL back-end, we wouldn't detect feedback loops, and would allow the driver to handle incompleteness. Instead implement this in a shared helper class, and do the feedback loop detection in the front-end for every back-end. This makes our behaviour more consistent between back-ends, and prevents undefined behaviour. Because initializing multisample textures is tricky (they can't be updated with TexImage calls) we do a bit of a workaround so the back-end can clear the incomplete multisample texture initially. This progresses the initial Vulkan textures implementation. BUG=angleproject:2167 Change-Id: I79ddcc0711fcc986f2578a52ac6f701231d241ac Reviewed-on: https://chromium-review.googlesource.com/700993 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 9959f544 2017-09-12T15:22:56 Cleanups to ResourceSerial. Allow for "empty" bindings, which are valid but represent when no object is bound. BUG=angleproject:2052 Change-Id: I0a41d1f0db3f5736e9e8f8ca3a74f41b748fd2d2 Reviewed-on: https://chromium-review.googlesource.com/659225 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 0e7f1736 2017-09-09T23:32:50 D3D: Only scan cached shader executable lists once. Any time we would query ProgramD3D for a particular vertex or pixel shader, we would iterate over all the cached shaders of the program looking for the matching input or output layout signature. This change makes it so we only compute the index of the matching shader once, and subsequent calls will re-use the shader index. This should speed up the draw call benchmarks. Also include a fix to the Serial class that initializes a Serial value to an invalid sentinel value. This ensures that comparing any other Serial (including another invalid serial) to the invalid serial will return not-equals. BUG=angleproject:1155 Change-Id: I7d913bf08d0bedf6155eae0661b2a5fa94565cc9 Reviewed-on: https://chromium-review.googlesource.com/648730 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang d93cd6c2 2017-08-11T16:32:41 Refactor the CPU copy texture code into a function in renderer utils. BUG=angleproject:1932 Change-Id: Iab79f2a09c2d8a85d2a9dde34acf4d2151072c2b Reviewed-on: https://chromium-review.googlesource.com/612561 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill 222c517f 2017-07-19T16:15:42 Control Debug layers in ANGLE_platform_angle. Debug layers seem to be a universal thing among functional back-ends. D3D, OpenGL and Vulkan all need some kind of controls for debugging, so it seems to make sense to make this control part of the base extension. Default the extension to EGL_DONT_CARE, which allows the back-end to have a lot of flexibility in terms of implementation. Also enable the extension in the D3D11 and OpenGL back-ends, and set the extension to enabled for angle_end2end_tests. Remove EGLVulkanEXTTest since it no longer tests anything not tested in the base ANGLETest class. BUG=angleproject:2086 Change-Id: I52d8170effd1846b9afbe6e4052c699fe5cb0de8 Reviewed-on: https://chromium-review.googlesource.com/578369 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 4928b7ca 2017-06-20T12:57:39 Proliferate gl::Context everywhere. This gives the D3D back-end access to the GL state almost anywhere. This uses the onDestroy hook for Textures to push errors up from destructors, although they still don't quite make it to the Context. There are places, such as in EGL object (Context/Surface) destruction, where we end up calling through to GL implementation internals without having access to a gl::Context. We handle this via a proxy Context to a Display, basically a null context, that has access to impl-side state like the Renderer pointer if necessary. It does not have access to the normal GL state. Also Pass gl::Context to RefCountObject::release(). Since we're using destroy() methods now, we should not ever call the destructor directly. BUG=angleproject:1156 Change-Id: Ie4c32ad6bf6caaff0289901f30b5c6bafa2ce259 Reviewed-on: https://chromium-review.googlesource.com/529707 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill fb05bcba 2017-06-07T15:43:18 Move the vk Serial class to renderer_utils. This can be useful for other back-ends, for various types of state management. Also redesign the class to use an opaque factory instead of an increment operator. The class maintains the property of being ordered. Also assume we don't overflow with 64-bit serials. We could maybe redesign this to use 32-bit serials for memory constrained situations, and handle overflow more gracefully. I plan to use the serials to track state revisions for the vertex array class, to avoid doing redundant work. BUG=angleproject:1156 Change-Id: I02c78b228bc6e2fb3ee786fe67a4e607baaca18e Reviewed-on: https://chromium-review.googlesource.com/529704 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill dcc9b51d 2017-06-05T15:28:45 D3D11: Consolidate input layout application. This merges all calls to IASetInputLayout to a single place in StateManager11. This means we no longer have to invalidate the state for D3D11, and can always lazily apply the input layout state. Introduces a new ResourceSerial class to replace the uintptr_t and DirtyPointer design. BUG=angleproject:2052 Change-Id: I76b874218b754395f25a129967c769b1f8f82115 Reviewed-on: https://chromium-review.googlesource.com/523025 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill abaab233 2017-01-10T12:37:37 Vulkan: Introduce vk::Format. BUG=angleproject:1319 Change-Id: I88bcc6caa5d29565728848bada1563e47e383b29 Reviewed-on: https://chromium-review.googlesource.com/367753 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4f57e5f9 2016-10-27T17:36:53 D3D11: Make several format tables constexpr. This should guarantee the best memory access patterns. It introduces some indirections for some format queries, but most of these should be direct array lookups, or used infrequently. We can optimize this later if necessary. BUG=angleproject:1389 Change-Id: I5e2c8c530a07798494afd3ea36b6164d7564c02c Reviewed-on: https://chromium-review.googlesource.com/403314 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill b2e4863c 2016-08-09T18:08:03 Replace std::map with switch in load functions. BUG=angleproject:1455 Change-Id: Ica74ea5503efc0315bc4d98aa322da523a30b24c Reviewed-on: https://chromium-review.googlesource.com/367696 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 30712068 2016-08-09T11:10:36 Move fast copy functions into angle::Format. These tables were duplicated in D3D11 and D3D9, and would have to be further duplicated into Vulkan. BUG=angleproject:1455 Change-Id: Ice1b81417d7b14f933b61861c4a9997c260ef72e Reviewed-on: https://chromium-review.googlesource.com/367690 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 86e0b7f7 2016-08-09T11:10:29 Clean up PackPixels. BUG=angleproject:1455 Change-Id: I263719cc77ff80580a551683d062e862dee1bdab Reviewed-on: https://chromium-review.googlesource.com/365826 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill a5b1561e 2016-08-09T11:10:27 Place format info in angle::Format. Some bits of information, like the copy functions and mipmap gen functions, can be shared across back-ends in the angle::Format class. Also name the info struct angle::Format, and use an enum class angle::Format::ID to identify the particular format. This patch introduces a new table generator for angle formats and updates the D3D11 generator accordingly. BUG=angleproject:1455 Change-Id: I13b8b98822b1186c6a9e436dc232c18fef50980c Reviewed-on: https://chromium-review.googlesource.com/365824 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill d2b50a0b 2016-06-09T00:13:35 Move ReadPixels logic to helper methods. These routines were pretty much duplicated between D3D9 and D3D11. Since I was going to have to rewrite them again for Vulkan, I figured it would be best to move them into a common location and clean them up a bit. BUG=angleproject:1319 Change-Id: I15d39b052daf3e1020dbd0880f01ae84f3686a0a Reviewed-on: https://chromium-review.googlesource.com/349630 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>