diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-04-27 13:34:57 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-04-27 13:36:56 +0300 |
commit | cdd4354c81f6f9ae3bc72b7abd5dbcfd74fa548e (patch) | |
tree | 065b357e7c98673201a8f4d3e9fc2fcc75db31e1 /source/blender/gpu/GPU_texture.h | |
parent | 68ca12a7fc0eea117103d894609eb46c169ec88b (diff) |
Metal: MTLTexture core implementation for Metal backend, with minimal surrounding functionality.
This covers implementation of the GPUTexture abstraction for the Metal backend, with additional utility functionality as required.
Some components have been temporarily disabled pending dependencies on upcoming Metal backend components, and these will be addressed as the backend is fleshed out.
One core challenge addressed in the Metal backend is the requirement for read/update routines for textures. MTLBlitCommandEncoders offer a limited range of the full functionality provided by OpenGLs texture update and read functions such that a series of compute kernels have been implemented to provide advanced functionality such as data format conversion and partial/swizzled component updates.
This diff is provided in full, but if further division is required for purposes of code review, this can be done.
Authored by Apple: Michael Parkin-White
Ref T96261
Reviewed By: fclem
Maniphest Tasks: T96261
Differential Revision: https://developer.blender.org/D14543
Diffstat (limited to 'source/blender/gpu/GPU_texture.h')
-rw-r--r-- | source/blender/gpu/GPU_texture.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h index 37edc2abeb2..bb0912f284b 100644 --- a/source/blender/gpu/GPU_texture.h +++ b/source/blender/gpu/GPU_texture.h @@ -175,8 +175,18 @@ typedef enum eGPUDataFormat { GPU_DATA_UINT_24_8, GPU_DATA_10_11_11_REV, GPU_DATA_2_10_10_10_REV, + GPU_DATA_HALF_FLOAT } eGPUDataFormat; +typedef enum eGPUTextureUsage { + GPU_TEXTURE_USAGE_SHADER_READ = (1 << 0), + GPU_TEXTURE_USAGE_SHADER_WRITE = (1 << 1), + GPU_TEXTURE_USAGE_ATTACHMENT = (1 << 2), + GPU_TEXTURE_USAGE_GENERAL = 0xFF +} eGPUTextureUsage; + +ENUM_OPERATORS(eGPUTextureUsage, GPU_TEXTURE_USAGE_GENERAL) + unsigned int GPU_texture_memory_usage_get(void); /** |