Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
S
swiftshader
  • Project
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Chen Yisong
  • swiftshader
  • Repository

Switch branch/tag
  • swiftshader
  • tests
  • VulkanUnitTests
  • Device.cpp
Find file
BlameHistoryPermalink
  • Antonio Maiorano's avatar
    Make vk-unittests use VulkanWrapper · 9d35d544
    Antonio Maiorano authored Feb 01, 2021
    This change moves the VulkanBenchmark and DrawBenchmark classes to
    VulkanWrapper so that they can be used from other unit tests -- namely,
    vk-unittests. In doing so, it became clear that using these as base
    classes wasn't great for writing googletests, as text fixtures are
    classes themselves, and this resulted in messy multiple inheritance. So
    I modified the two classes to use callback registration instead of
    virtual functions.
    
    Apart from reworking existing tests (e.g. see TriangleBenchmark.cpp), I
    also added a new DrawTests.cpp to vk-unittests with a unit test to make
    sure we don't crash when leaving out "gl_Position", a bug that sugoi@
    fixed in swiftshader-cl/51808. This is a good example of how easy it can
    be to write such unit tests now.
    
    List of changes:
    
    * Moved VulkanBenchmark and DrawBenchmark to VulkanWrapper, and renamed
      VulkanTester and DrawTester respectively.
    * ClearImageBenchmark refactored to aggregate a VulkanTester. This is an
      example where using a class is fine as we can still use the testers
      via aggregation.
    * TriangleBenchmark tests refactored to use DrawTester and register
      callbacks.
    * Moved compute tests to a ComputeTests.cpp.
    * Moved the other tests to BasicTests.cpp.
    * Added DrawTests.cpp with new DrawTests.VertexShaderNoPositionOutput
      test.
    * CMake: add VulkanWrapper target for unittests as well as benchmarks.
    * CMake: change FOLDER to better organize the tests and benchmarks for
      VS.
    
    Bug: b/176981107
    Change-Id: Ib1a0b85b3df787d2e39da08930414f9a14954a73
    Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52348
    Kokoro-Result: kokoro <noreply+kokoro@google.com>
    Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
    Tested-by: 's avatarAntonio Maiorano <amaiorano@google.com>
    Commit-Queue: Antonio Maiorano <amaiorano@google.com>
    9d35d544
Device.cpp 14.8 KB
EditWeb IDE
×

Replace Device.cpp

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.