SPB Git

spb/forge Public MIT

Forge — LLM training from scratch in pure C++20 + Metal on Apple Silicon.

C++ 61.2% C 23% Python 7.6% TeX 7.2% CMake 1.1%
5.8 KB · 174 lines cpp
Raw Blame History
1//-------------------------------------------------------------------------------------------------------------------------------------------------------------2//3// Metal/MTLPixelFormat.hpp4//5// Copyright 2020-2025 Apple Inc.6//7// Licensed under the Apache License, Version 2.0 (the "License");8// you may not use this file except in compliance with the License.9// You may obtain a copy of the License at10//11//     http://www.apache.org/licenses/LICENSE-2.012//13// Unless required by applicable law or agreed to in writing, software14// distributed under the License is distributed on an "AS IS" BASIS,15// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.16// See the License for the specific language governing permissions and17// limitations under the License.18//19//-------------------------------------------------------------------------------------------------------------------------------------------------------------2021#pragma once2223#include "../Foundation/Foundation.hpp"24#include "MTLDefines.hpp"25#include "MTLHeaderBridge.hpp"26#include "MTLPrivate.hpp"2728namespace MTL29{30_MTL_ENUM(NS::UInteger, PixelFormat) {31    PixelFormatInvalid = 0,32    PixelFormatA8Unorm = 1,33    PixelFormatR8Unorm = 10,34    PixelFormatR8Unorm_sRGB = 11,35    PixelFormatR8Snorm = 12,36    PixelFormatR8Uint = 13,37    PixelFormatR8Sint = 14,38    PixelFormatR16Unorm = 20,39    PixelFormatR16Snorm = 22,40    PixelFormatR16Uint = 23,41    PixelFormatR16Sint = 24,42    PixelFormatR16Float = 25,43    PixelFormatRG8Unorm = 30,44    PixelFormatRG8Unorm_sRGB = 31,45    PixelFormatRG8Snorm = 32,46    PixelFormatRG8Uint = 33,47    PixelFormatRG8Sint = 34,48    PixelFormatB5G6R5Unorm = 40,49    PixelFormatA1BGR5Unorm = 41,50    PixelFormatABGR4Unorm = 42,51    PixelFormatBGR5A1Unorm = 43,52    PixelFormatR32Uint = 53,53    PixelFormatR32Sint = 54,54    PixelFormatR32Float = 55,55    PixelFormatRG16Unorm = 60,56    PixelFormatRG16Snorm = 62,57    PixelFormatRG16Uint = 63,58    PixelFormatRG16Sint = 64,59    PixelFormatRG16Float = 65,60    PixelFormatRGBA8Unorm = 70,61    PixelFormatRGBA8Unorm_sRGB = 71,62    PixelFormatRGBA8Snorm = 72,63    PixelFormatRGBA8Uint = 73,64    PixelFormatRGBA8Sint = 74,65    PixelFormatBGRA8Unorm = 80,66    PixelFormatBGRA8Unorm_sRGB = 81,67    PixelFormatRGB10A2Unorm = 90,68    PixelFormatRGB10A2Uint = 91,69    PixelFormatRG11B10Float = 92,70    PixelFormatRGB9E5Float = 93,71    PixelFormatBGR10A2Unorm = 94,72    PixelFormatBGR10_XR = 554,73    PixelFormatBGR10_XR_sRGB = 555,74    PixelFormatRG32Uint = 103,75    PixelFormatRG32Sint = 104,76    PixelFormatRG32Float = 105,77    PixelFormatRGBA16Unorm = 110,78    PixelFormatRGBA16Snorm = 112,79    PixelFormatRGBA16Uint = 113,80    PixelFormatRGBA16Sint = 114,81    PixelFormatRGBA16Float = 115,82    PixelFormatBGRA10_XR = 552,83    PixelFormatBGRA10_XR_sRGB = 553,84    PixelFormatRGBA32Uint = 123,85    PixelFormatRGBA32Sint = 124,86    PixelFormatRGBA32Float = 125,87    PixelFormatBC1_RGBA = 130,88    PixelFormatBC1_RGBA_sRGB = 131,89    PixelFormatBC2_RGBA = 132,90    PixelFormatBC2_RGBA_sRGB = 133,91    PixelFormatBC3_RGBA = 134,92    PixelFormatBC3_RGBA_sRGB = 135,93    PixelFormatBC4_RUnorm = 140,94    PixelFormatBC4_RSnorm = 141,95    PixelFormatBC5_RGUnorm = 142,96    PixelFormatBC5_RGSnorm = 143,97    PixelFormatBC6H_RGBFloat = 150,98    PixelFormatBC6H_RGBUfloat = 151,99    PixelFormatBC7_RGBAUnorm = 152,100    PixelFormatBC7_RGBAUnorm_sRGB = 153,101    PixelFormatPVRTC_RGB_2BPP = 160,102    PixelFormatPVRTC_RGB_2BPP_sRGB = 161,103    PixelFormatPVRTC_RGB_4BPP = 162,104    PixelFormatPVRTC_RGB_4BPP_sRGB = 163,105    PixelFormatPVRTC_RGBA_2BPP = 164,106    PixelFormatPVRTC_RGBA_2BPP_sRGB = 165,107    PixelFormatPVRTC_RGBA_4BPP = 166,108    PixelFormatPVRTC_RGBA_4BPP_sRGB = 167,109    PixelFormatEAC_R11Unorm = 170,110    PixelFormatEAC_R11Snorm = 172,111    PixelFormatEAC_RG11Unorm = 174,112    PixelFormatEAC_RG11Snorm = 176,113    PixelFormatEAC_RGBA8 = 178,114    PixelFormatEAC_RGBA8_sRGB = 179,115    PixelFormatETC2_RGB8 = 180,116    PixelFormatETC2_RGB8_sRGB = 181,117    PixelFormatETC2_RGB8A1 = 182,118    PixelFormatETC2_RGB8A1_sRGB = 183,119    PixelFormatASTC_4x4_sRGB = 186,120    PixelFormatASTC_5x4_sRGB = 187,121    PixelFormatASTC_5x5_sRGB = 188,122    PixelFormatASTC_6x5_sRGB = 189,123    PixelFormatASTC_6x6_sRGB = 190,124    PixelFormatASTC_8x5_sRGB = 192,125    PixelFormatASTC_8x6_sRGB = 193,126    PixelFormatASTC_8x8_sRGB = 194,127    PixelFormatASTC_10x5_sRGB = 195,128    PixelFormatASTC_10x6_sRGB = 196,129    PixelFormatASTC_10x8_sRGB = 197,130    PixelFormatASTC_10x10_sRGB = 198,131    PixelFormatASTC_12x10_sRGB = 199,132    PixelFormatASTC_12x12_sRGB = 200,133    PixelFormatASTC_4x4_LDR = 204,134    PixelFormatASTC_5x4_LDR = 205,135    PixelFormatASTC_5x5_LDR = 206,136    PixelFormatASTC_6x5_LDR = 207,137    PixelFormatASTC_6x6_LDR = 208,138    PixelFormatASTC_8x5_LDR = 210,139    PixelFormatASTC_8x6_LDR = 211,140    PixelFormatASTC_8x8_LDR = 212,141    PixelFormatASTC_10x5_LDR = 213,142    PixelFormatASTC_10x6_LDR = 214,143    PixelFormatASTC_10x8_LDR = 215,144    PixelFormatASTC_10x10_LDR = 216,145    PixelFormatASTC_12x10_LDR = 217,146    PixelFormatASTC_12x12_LDR = 218,147    PixelFormatASTC_4x4_HDR = 222,148    PixelFormatASTC_5x4_HDR = 223,149    PixelFormatASTC_5x5_HDR = 224,150    PixelFormatASTC_6x5_HDR = 225,151    PixelFormatASTC_6x6_HDR = 226,152    PixelFormatASTC_8x5_HDR = 228,153    PixelFormatASTC_8x6_HDR = 229,154    PixelFormatASTC_8x8_HDR = 230,155    PixelFormatASTC_10x5_HDR = 231,156    PixelFormatASTC_10x6_HDR = 232,157    PixelFormatASTC_10x8_HDR = 233,158    PixelFormatASTC_10x10_HDR = 234,159    PixelFormatASTC_12x10_HDR = 235,160    PixelFormatASTC_12x12_HDR = 236,161    PixelFormatGBGR422 = 240,162    PixelFormatBGRG422 = 241,163    PixelFormatDepth16Unorm = 250,164    PixelFormatDepth32Float = 252,165    PixelFormatStencil8 = 253,166    PixelFormatDepth24Unorm_Stencil8 = 255,167    PixelFormatDepth32Float_Stencil8 = 260,168    PixelFormatX32_Stencil8 = 261,169    PixelFormatX24_Stencil8 = 262,170    PixelFormatUnspecialized = 263,171};172173}174