blob: b2323fd6c9d2c63b8687c1c88445bc2fdf959f27 [file] [log] [blame]
/*
* Copyright 2021 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "src/gpu/ganesh/mtl/GrMtlTypesPriv.h"
GrMtlSurfaceInfo GrMtlTextureSpecToSurfaceInfo(const GrMtlTextureSpec& mtlSpec,
uint32_t sampleCount,
uint32_t levelCount,
GrProtected isProtected) {
GrMtlSurfaceInfo info;
// Shared info
info.fSampleCount = sampleCount;
info.fLevelCount = levelCount;
info.fProtected = isProtected;
// Mtl info
info.fFormat = mtlSpec.fFormat;
info.fUsage = mtlSpec.fUsage;
info.fStorageMode = mtlSpec.fStorageMode;
return info;
}