Compare commits
2 Commits
pf/testing
...
ebridgewat
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43ab60521c | ||
|
|
b7c685647a |
@@ -65,7 +65,7 @@ static const Vertex TRIANGLE_VERTICES[3] = {
|
|||||||
{{cos(M_PI * 4 / 3), sin(M_PI * 4 / 3)}, 0xff0000ffu},
|
{{cos(M_PI * 4 / 3), sin(M_PI * 4 / 3)}, 0xff0000ffu},
|
||||||
};
|
};
|
||||||
|
|
||||||
static constexpr uint16_t TRIANGLE_INDICES[3] = { 0, 1, 2 };
|
static constexpr uint16_t TRIANGLE_INDICES[4] = { 0, 1, 2 , 0};
|
||||||
|
|
||||||
static void printUsage(char* name) {
|
static void printUsage(char* name) {
|
||||||
std::string exec_name(utils::Path(name).getName());
|
std::string exec_name(utils::Path(name).getName());
|
||||||
@@ -147,11 +147,11 @@ int main(int argc, char** argv) {
|
|||||||
app.vb->setBufferAt(*engine, 0,
|
app.vb->setBufferAt(*engine, 0,
|
||||||
VertexBuffer::BufferDescriptor(TRIANGLE_VERTICES, 36, nullptr));
|
VertexBuffer::BufferDescriptor(TRIANGLE_VERTICES, 36, nullptr));
|
||||||
app.ib = IndexBuffer::Builder()
|
app.ib = IndexBuffer::Builder()
|
||||||
.indexCount(3)
|
.indexCount(4)
|
||||||
.bufferType(IndexBuffer::IndexType::USHORT)
|
.bufferType(IndexBuffer::IndexType::USHORT)
|
||||||
.build(*engine);
|
.build(*engine);
|
||||||
app.ib->setBuffer(*engine,
|
app.ib->setBuffer(*engine,
|
||||||
IndexBuffer::BufferDescriptor(TRIANGLE_INDICES, 6, nullptr));
|
IndexBuffer::BufferDescriptor(TRIANGLE_INDICES, 8, nullptr));
|
||||||
app.mat = Material::Builder()
|
app.mat = Material::Builder()
|
||||||
.package(RESOURCES_BAKEDCOLOR_DATA, RESOURCES_BAKEDCOLOR_SIZE)
|
.package(RESOURCES_BAKEDCOLOR_DATA, RESOURCES_BAKEDCOLOR_SIZE)
|
||||||
.build(*engine);
|
.build(*engine);
|
||||||
|
|||||||
@@ -229,10 +229,10 @@ MaybeError ValidateWriteBuffer(const DeviceBase* device,
|
|||||||
uint64_t size) {
|
uint64_t size) {
|
||||||
DAWN_TRY(device->ValidateObject(buffer));
|
DAWN_TRY(device->ValidateObject(buffer));
|
||||||
|
|
||||||
// DAWN_INVALID_IF(bufferOffset % 4 != 0, "BufferOffset (%u) is not a multiple of 4.",
|
DAWN_INVALID_IF(bufferOffset % 4 != 0, "BufferOffset (%u) is not a multiple of 4.",
|
||||||
// bufferOffset);
|
bufferOffset);
|
||||||
//
|
|
||||||
// DAWN_INVALID_IF(size % 4 != 0, "Size (%u) is not a multiple of 4.", size);
|
DAWN_INVALID_IF(size % 4 != 0, "Size (%u) is not a multiple of 4.", size);
|
||||||
|
|
||||||
uint64_t bufferSize = buffer->GetSize();
|
uint64_t bufferSize = buffer->GetSize();
|
||||||
DAWN_INVALID_IF(bufferOffset > bufferSize || size > (bufferSize - bufferOffset),
|
DAWN_INVALID_IF(bufferOffset > bufferSize || size > (bufferSize - bufferOffset),
|
||||||
|
|||||||
Reference in New Issue
Block a user