Remove fIntendedType from GrMtlBuffer. Add accessor to base class
Fixes unused member warning-as-error.
Change-Id: I9468a1b1cb106eeb7818afe87f5cda7eb75910de
Reviewed-on: https://skia-review.googlesource.com/c/189497
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrBuffer.h b/src/gpu/GrBuffer.h
index 128ec48..d90b587 100644
--- a/src/gpu/GrBuffer.h
+++ b/src/gpu/GrBuffer.h
@@ -102,6 +102,7 @@
protected:
GrBuffer(GrGpu*, size_t sizeInBytes, GrGpuBufferType, GrAccessPattern);
+ GrGpuBufferType intendedType() const { return fIntendedType; }
void* fMapPtr;
diff --git a/src/gpu/mtl/GrMtlBuffer.h b/src/gpu/mtl/GrMtlBuffer.h
index 97df71c..63a924b 100644
--- a/src/gpu/mtl/GrMtlBuffer.h
+++ b/src/gpu/mtl/GrMtlBuffer.h
@@ -44,7 +44,6 @@
void validate() const;
#endif
- GrGpuBufferType fIntendedType;
bool fIsDynamic;
id<MTLBuffer> fMtlBuffer;
id<MTLBuffer> fMappedBuffer;
diff --git a/src/gpu/mtl/GrMtlBuffer.mm b/src/gpu/mtl/GrMtlBuffer.mm
index 48c5df8..be81357 100644
--- a/src/gpu/mtl/GrMtlBuffer.mm
+++ b/src/gpu/mtl/GrMtlBuffer.mm
@@ -28,7 +28,6 @@
GrMtlBuffer::GrMtlBuffer(GrMtlGpu* gpu, size_t size, GrGpuBufferType intendedType,
GrAccessPattern accessPattern)
: INHERITED(gpu, size, intendedType, accessPattern)
- , fIntendedType(intendedType)
, fIsDynamic(accessPattern == kDynamic_GrAccessPattern) {
// TODO: We are treating all buffers as static access since we don't have an implementation to
// synchronize gpu and cpu access of a resource yet. See comments in GrMtlBuffer::internalMap()
@@ -170,10 +169,10 @@
#ifdef SK_DEBUG
void GrMtlBuffer::validate() const {
SkASSERT(fMtlBuffer == nil ||
- fIntendedType == GrGpuBufferType::kVertex ||
- fIntendedType == GrGpuBufferType::kIndex ||
- fIntendedType == GrGpuBufferType::kXferCpuToGpu ||
- fIntendedType == GrGpuBufferType::kXferGpuToCpu);
+ this->intendedType() == GrGpuBufferType::kVertex ||
+ this->intendedType() == GrGpuBufferType::kIndex ||
+ this->intendedType() == GrGpuBufferType::kXferCpuToGpu ||
+ this->intendedType() == GrGpuBufferType::kXferGpuToCpu);
SkASSERT(fMappedBuffer == nil || fMtlBuffer == nil ||
fMappedBuffer.length <= fMtlBuffer.length);
SkASSERT(fIsDynamic == false); // TODO: implement synchronization to allow dynamic access.