Fix indirect draw test for MSVC

We need a negative number in a buffer of uint32_t, to test negative
baseVertex. MSVC requires an explicit cast here.

Bug: dawn:172
Change-Id: Iea6c609f11054ba02e5c041fff89def0557c8091
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8060
Commit-Queue: Idan Raiter <idanr@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Idan Raiter 2019-06-11 19:05:45 +00:00 committed by Commit Bot service account
parent 28232ce9f5
commit 8f813ac8a2
1 changed files with 6 additions and 2 deletions

View File

@ -135,12 +135,16 @@ TEST_P(DrawIndexedIndirectTest, BaseVertex) {
// Test a draw with only the last 3 indices of the second quad (bottom left triangle)
Test({3, 1, 3, 4, 0}, 0, 0, filled, notFilled);
const int negFour = -4;
uint32_t unsignedNegFour;
std::memcpy(&unsignedNegFour, &negFour, sizeof(int));
// Test negative baseVertex
// Test a draw with only the first 3 indices of the first quad (bottom left triangle)
Test({3, 1, 0, -4, 0}, 6 * sizeof(uint32_t), 0, filled, notFilled);
Test({3, 1, 0, unsignedNegFour, 0}, 6 * sizeof(uint32_t), 0, filled, notFilled);
// Test a draw with only the last 3 indices of the first quad (top right triangle)
Test({3, 1, 3, -4, 0}, 6 * sizeof(uint32_t), 0, notFilled, filled);
Test({3, 1, 3, unsignedNegFour, 0}, 6 * sizeof(uint32_t), 0, notFilled, filled);
}
TEST_P(DrawIndexedIndirectTest, IndirectOffset) {