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>
This commit is contained in:
Brian Salomon 2019-02-05 16:07:56 -05:00 committed by Skia Commit-Bot
parent 822d223972
commit 95548f6625
3 changed files with 5 additions and 6 deletions

View File

@ -102,6 +102,7 @@ public:
protected:
GrBuffer(GrGpu*, size_t sizeInBytes, GrGpuBufferType, GrAccessPattern);
GrGpuBufferType intendedType() const { return fIntendedType; }
void* fMapPtr;

View File

@ -44,7 +44,6 @@ private:
void validate() const;
#endif
GrGpuBufferType fIntendedType;
bool fIsDynamic;
id<MTLBuffer> fMtlBuffer;
id<MTLBuffer> fMappedBuffer;

View File

@ -28,7 +28,6 @@ sk_sp<GrMtlBuffer> GrMtlBuffer::Make(GrMtlGpu* gpu, size_t size, GrGpuBufferType
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 @@ void GrMtlBuffer::onUnmap() {
#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.