Metal: MTLShader and MTLShaderGenerator implementation.

Full support for translation and compilation of shaders in Metal, using
GPUShaderCreateInfo. Includes render pipeline state creation and management,
enabling all standard GPU viewport rendering features in Metal.

Authored by Apple: Michael Parkin-White, Marco Giordano

Ref T96261

Reviewed By: fclem

Maniphest Tasks: T96261

Differential Revision: https://developer.blender.org/D15563
This commit is contained in:
Thomas Dinges
2022-09-01 22:22:32 +02:00
committed by Clément Foucault
parent ac07fb38a1
commit cc8ea6ac67
42 changed files with 9252 additions and 213 deletions

View File

@@ -673,6 +673,9 @@ static int constant_type_size(Type type)
case Type::FLOAT:
case Type::INT:
case Type::UINT:
case Type::UCHAR4:
case Type::CHAR4:
case blender::gpu::shader::Type::VEC3_101010I2:
return 4;
break;
case Type::VEC2:
@@ -695,6 +698,18 @@ static int constant_type_size(Type type)
case Type::MAT4:
return 64;
break;
case blender::gpu::shader::Type::UCHAR:
case blender::gpu::shader::Type::CHAR:
return 1;
break;
case blender::gpu::shader::Type::UCHAR2:
case blender::gpu::shader::Type::CHAR2:
return 2;
break;
case blender::gpu::shader::Type::UCHAR3:
case blender::gpu::shader::Type::CHAR3:
return 3;
break;
}
BLI_assert(false);
return -1;