MetalCompute 1.0
An API to make GPU compute calls easier
Loading...
Searching...
No Matches
MTLComputeGlobals.hpp
Go to the documentation of this file.
1#include <iostream>
2#include <map>
3#define NS_PRIVATE_IMPLEMENTATION
4#define MTL_PRIVATE_IMPLEMENTATION
5#include "Metal.hpp"
6
7#pragma once
8
9namespace MTLCompute {
10
11 constexpr int MAX_BUFFERS = 31;
12 constexpr int MAX_TEXTURES = 128;
13 constexpr long MAX_TEXTURE_SIZE = 16384;
14 // i cant find the max buffer size
15
16 enum class ResourceStorage {
17 Shared = MTL::ResourceStorageModeShared,
18 Managed = MTL::ResourceStorageModeManaged,
19 Private = MTL::ResourceStorageModePrivate
20 };
21
22 enum class TextureType {
23 uint8 = MTL::PixelFormatR8Uint,
24 uint16 = MTL::PixelFormatR16Uint,
25 uint32 = MTL::PixelFormatR32Uint,
26
27 int8 = MTL::PixelFormatR8Sint,
28 int16 = MTL::PixelFormatR16Sint,
29 int32 = MTL::PixelFormatR32Sint,
30
31 float32 = MTL::PixelFormatR32Float,
32 };
33
34 inline std::map<TextureType, size_t> TextureTypeSizes = {
35 {TextureType::uint8, sizeof(uint8_t)},
36 {TextureType::uint16, sizeof(uint16_t)},
37 {TextureType::uint32, sizeof(uint32_t)},
38 {TextureType::int8, sizeof(int8_t)},
39 {TextureType::int16, sizeof(int16_t)},
40 {TextureType::int32, sizeof(int32_t)},
41 {TextureType::float32, sizeof(float_t)}
42 };
43
44}
Definition MTLComputeBuffer.hpp:7
constexpr long MAX_TEXTURE_SIZE
Definition MTLComputeGlobals.hpp:13
std::map< TextureType, size_t > TextureTypeSizes
Definition MTLComputeGlobals.hpp:34
constexpr int MAX_TEXTURES
Definition MTLComputeGlobals.hpp:12
TextureType
Definition MTLComputeGlobals.hpp:22
constexpr int MAX_BUFFERS
Definition MTLComputeGlobals.hpp:11
ResourceStorage
Definition MTLComputeGlobals.hpp:16