VulkanBenchmarks: refactor TriangleBenchmark into a more reusable base class

* Renamed TriangleBenchmark to DrawBenchmark * Added a set of hooks (virtual functions) that are invoked at certain points during execution of DrawBenchmark::init and renderFrame. These functions are prefixed with "do" to distinguish them. * Added some resource management functions in DrawBenchmark, such as addImage and addSampler for child classes to create these resources. We want these owned by the base class so that resources can be properly disposed of in the right order. * Removed enum class FragShadeType, and replaced with three classes derived from DrawBenchmark that implement the necessary hooks. * DrawBenchmark tracks the number of vertices provided via addVertexBuffer so that it can pass it to vk::CommandBuffer::draw(). Derived types can therefore provide as many (triangle) vertices as they like from doCreateVertexBuffers. Bug: b/176981107 Change-Id: I687f3d5ca09f7f93a3d6d7f68871a95bd083bf89 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52108Tested-by: 's avatarAntonio Maiorano <amaiorano@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 646a2770
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment