CommandBufferMTL: Address review comments

Renames indexTypeSize to indexFormatSize. I forgot to add the changes
prior to pushing the commit.

Bug: dawn:502
Change-Id: I38f19edc021141c5a5ab57c6220978b7c88b116e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33923
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2020-12-01 14:06:47 +00:00 committed by Commit Bot service account
parent a6a7e46e54
commit a92f0d2b61
1 changed files with 4 additions and 4 deletions

View File

@ -1031,7 +1031,7 @@ namespace dawn_native { namespace metal {
id<MTLBuffer> indexBuffer = nullptr; id<MTLBuffer> indexBuffer = nullptr;
uint32_t indexBufferBaseOffset = 0; uint32_t indexBufferBaseOffset = 0;
MTLIndexType indexBufferType; MTLIndexType indexBufferType;
uint64_t indexTypeSize = 0; uint64_t indexFormatSize = 0;
StorageBufferLengthTracker storageBufferLengths = {}; StorageBufferLengthTracker storageBufferLengths = {};
VertexBufferTracker vertexBuffers(&storageBufferLengths); VertexBufferTracker vertexBuffers(&storageBufferLengths);
@ -1084,7 +1084,7 @@ namespace dawn_native { namespace metal {
indexType:indexBufferType indexType:indexBufferType
indexBuffer:indexBuffer indexBuffer:indexBuffer
indexBufferOffset:indexBufferBaseOffset + indexBufferOffset:indexBufferBaseOffset +
draw->firstIndex * indexTypeSize draw->firstIndex * indexFormatSize
instanceCount:draw->instanceCount]; instanceCount:draw->instanceCount];
} else { } else {
[encoder drawIndexedPrimitives:lastPipeline->GetMTLPrimitiveTopology() [encoder drawIndexedPrimitives:lastPipeline->GetMTLPrimitiveTopology()
@ -1092,7 +1092,7 @@ namespace dawn_native { namespace metal {
indexType:indexBufferType indexType:indexBufferType
indexBuffer:indexBuffer indexBuffer:indexBuffer
indexBufferOffset:indexBufferBaseOffset + indexBufferOffset:indexBufferBaseOffset +
draw->firstIndex * indexTypeSize draw->firstIndex * indexFormatSize
instanceCount:draw->instanceCount instanceCount:draw->instanceCount
baseVertex:draw->baseVertex baseVertex:draw->baseVertex
baseInstance:draw->firstInstance]; baseInstance:draw->firstInstance];
@ -1196,7 +1196,7 @@ namespace dawn_native { namespace metal {
indexBuffer = b->GetMTLBuffer(); indexBuffer = b->GetMTLBuffer();
indexBufferBaseOffset = cmd->offset; indexBufferBaseOffset = cmd->offset;
indexBufferType = MTLIndexFormat(cmd->format); indexBufferType = MTLIndexFormat(cmd->format);
indexTypeSize = IndexFormatSize(cmd->format); indexFormatSize = IndexFormatSize(cmd->format);
break; break;
} }