1 /* 2 * Copyright 2021 Google LLC 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #ifndef skgpu_ResourceTypes_DEFINED 9 #define skgpu_ResourceTypes_DEFINED 10 11 #include "experimental/graphite/include/GraphiteTypes.h" 12 13 namespace skgpu { 14 15 /** 16 * Is the Texture renderable or not 17 */ 18 enum class Renderable : bool { 19 kNo = false, 20 kYes = true, 21 }; 22 23 enum class DepthStencilType { 24 kDepthOnly, 25 kStencilOnly, 26 kDepthStencil, 27 }; 28 29 /** 30 * What a GPU buffer will be used for 31 */ 32 enum class BufferType { 33 kVertex, 34 kIndex, 35 kXferCpuToGpu, 36 kXferGpuToCpu, 37 kUniform, 38 }; 39 static const int kBufferTypeCount = static_cast<int>(BufferType::kUniform) + 1; 40 41 /** 42 * When creating the memory for a resource should we use a memory type that prioritizes the 43 * effeciency of GPU reads even if it involves extra work to write CPU data to it. For example, we 44 * would want this for buffers that we cache to read the same data many times on the GPU. 45 */ 46 enum class PrioritizeGpuReads : bool { 47 kNo = false, 48 kYes = true, 49 }; 50 51 }; // namespace skgpu 52 53 #endif // skgpu_ResourceTypes_DEFINED 54