NXTTest: expose SwapBuffers to test to make it easy to RenderDoc

RenderDoc uses presents as the points to start and end a capture, so to
debug test we have to do the following:

TEST_F(...)
    while(true) {
    	// All the test code
    	SwapBuffers();
    }
}
This commit is contained in:
Corentin Wallez 2017-07-12 13:17:35 -04:00 committed by Corentin Wallez
parent 11ce310de3
commit bcee1e5981
2 changed files with 5 additions and 0 deletions

View File

@ -188,6 +188,9 @@ void NXTTest::AddTextureExpectation(const char* file, int line, const nxt::Textu
deferredExpectations.push_back(deferred); deferredExpectations.push_back(deferred);
} }
void NXTTest::SwapBuffers() {
binding->SwapBuffers();
}
NXTTest::ReadbackReservation NXTTest::ReserveReadback(uint32_t readbackSize) { NXTTest::ReadbackReservation NXTTest::ReserveReadback(uint32_t readbackSize) {
// For now create a new MapRead buffer for each readback // For now create a new MapRead buffer for each readback

View File

@ -72,6 +72,8 @@ class NXTTest : public ::testing::TestWithParam<BackendType> {
void AddBufferExpectation(const char* file, int line, const nxt::Buffer& buffer, uint32_t offset, uint32_t size, detail::Expectation* expectation); void AddBufferExpectation(const char* file, int line, const nxt::Buffer& buffer, uint32_t offset, uint32_t size, detail::Expectation* expectation);
void AddTextureExpectation(const char* file, int line, const nxt::Texture& texture, uint32_t x, uint32_t y, uint32_t width, uint32_t height, uint32_t pixelSize, detail::Expectation* expectation); void AddTextureExpectation(const char* file, int line, const nxt::Texture& texture, uint32_t x, uint32_t y, uint32_t width, uint32_t height, uint32_t pixelSize, detail::Expectation* expectation);
void SwapBuffers();
private: private:
// MapRead buffers used to get data for the expectations // MapRead buffers used to get data for the expectations
struct ReadbackSlot { struct ReadbackSlot {