Commit defeda29 by Le Hoang Quyen Committed by Commit Bot

Metal: autogen for EXT_draw_buffers & ANGLE_framebuffer_blit

Bug: angleproject:2634 Change-Id: I8f8ee91fb673301b8bd97c359ee39c411e2bf8da Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2336124 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJonah Ryan-Davis <jonahr@google.com>
parent add9b677
{
"src/libANGLE/renderer/metal/shaders/blit.metal":
"8a00929424273e07e4b63d4ab062f005",
"f02720a0f3d9624b67bdb808cbc94c7f",
"src/libANGLE/renderer/metal/shaders/clear.metal":
"1c231afc6100433a79fce49046aa5965",
"67da9886363c530132e5bc2199bab2db",
"src/libANGLE/renderer/metal/shaders/common.h":
"7f4fe9c0ee3fa9bee84ea6627df44e04",
"5888cfe052e6e6332e8c7c8949e888fb",
"src/libANGLE/renderer/metal/shaders/compiled/compiled_default_metallib_2_1_debug_ios_autogen.inc":
"39f2302c254c8490b0f5b4782355a9e4",
"src/libANGLE/renderer/metal/shaders/compiled/compiled_default_metallib_2_1_debug_ios_sim_autogen.inc":
"ab9be1624a4f15fc12647771727302b0",
"src/libANGLE/renderer/metal/shaders/compiled/compiled_default_metallib_2_1_debug_mac_autogen.inc":
"35f17267fa21f1f96d8a781d45485e1a",
"src/libANGLE/renderer/metal/shaders/compiled/compiled_default_metallib_2_1_ios_autogen.inc":
"81c4b4d1012dbcb7aa738f49bbed1645",
"src/libANGLE/renderer/metal/shaders/compiled/compiled_default_metallib_2_1_ios_sim_autogen.inc":
"3446979c2d6504cb421e1f0004f5f15f",
"src/libANGLE/renderer/metal/shaders/compiled/compiled_default_metallib_2_1_mac_autogen.inc":
"7839cf16e8e45e6dffa9454dd5d7d3dc",
"src/libANGLE/renderer/metal/shaders/compiled/compiled_default_metallib_debug_ios_autogen.inc":
"10478c8a544f5a79decd6707d7c222e1",
"82ccf14797364f2c3c5dee14227b2c24",
"src/libANGLE/renderer/metal/shaders/compiled/compiled_default_metallib_debug_ios_sim_autogen.inc":
"781104f2c328281b8e12509bf24e2e3a",
"28f453c423b4029ab876668e4f1e8b21",
"src/libANGLE/renderer/metal/shaders/compiled/compiled_default_metallib_debug_mac_autogen.inc":
"e3c377c317b4219623068780b03441cd",
"3f402a605d97be11664ee0bb642e616a",
"src/libANGLE/renderer/metal/shaders/compiled/compiled_default_metallib_ios_autogen.inc":
"1fc59139de5353ac94a58f2dfe70d1e7",
"52c9275b8582f9e7c4a6b0b77c857a72",
"src/libANGLE/renderer/metal/shaders/compiled/compiled_default_metallib_ios_sim_autogen.inc":
"32d664590f0a28063ea9e04d54126216",
"259bdeb1bc17ab5098e2be4032f5d608",
"src/libANGLE/renderer/metal/shaders/compiled/compiled_default_metallib_mac_autogen.inc":
"1bdfb6157311f1e462d2d11b7868fd57",
"e16bd5da4f614789be9e2545f2af4237",
"src/libANGLE/renderer/metal/shaders/compiled/mtl_default_shaders_autogen.inc":
"1614e50c13ceab6e72a5bc2c2dc32056",
"634a127f4e94f6bc3123e89850d010ee",
"src/libANGLE/renderer/metal/shaders/constants.h":
"9bb6e63bf2b48a7a56978c787bde4850",
"src/libANGLE/renderer/metal/shaders/gen_indices.metal":
"002511e2b980a7fca7e80cbda6a82712",
"87a76d5e12825111c0595f69e79f5d20",
"src/libANGLE/renderer/metal/shaders/gen_mtl_internal_shaders.py":
"43375642abef54e634e4c803b53de7d0"
"962d0f3229d91ab71ad555f9fa3fe0c3"
}
\ No newline at end of file
......@@ -25,6 +25,7 @@ namespace mtl
namespace
{
#define NUM_COLOR_OUTPUTS_CONSTANT_NAME @"kNumColorOutputs"
#define SOURCE_BUFFER_ALIGNED_CONSTANT_NAME @"kSourceBufferAligned"
#define SOURCE_IDX_IS_U8_CONSTANT_NAME @"kSourceIndexIsU8"
#define SOURCE_IDX_IS_U16_CONSTANT_NAME @"kSourceIndexIsU16"
......@@ -451,12 +452,26 @@ void ClearUtils::ensureRenderPipelineStateCacheInitialized(ContextMtl *ctx)
{
ANGLE_MTL_OBJC_SCOPE
{
NSError *err = nil;
id<MTLLibrary> shaderLib = ctx->getDisplay()->getDefaultShadersLib();
id<MTLFunction> vertexShader =
[[shaderLib newFunctionWithName:@"clearVS"] ANGLE_MTL_AUTORELEASE];
MTLFunctionConstantValues *funcConstants =
[[[MTLFunctionConstantValues alloc] init] ANGLE_MTL_AUTORELEASE];
// Use 1 color outputs for now.
uint32_t numOutputs = 1;
[funcConstants setConstantValue:&numOutputs
type:MTLDataTypeUInt
withName:NUM_COLOR_OUTPUTS_CONSTANT_NAME];
mClearRenderPipelineCache.setVertexShader(
ctx, [[shaderLib newFunctionWithName:@"clearVS"] ANGLE_MTL_AUTORELEASE]);
mClearRenderPipelineCache.setFragmentShader(
ctx, [[shaderLib newFunctionWithName:@"clearFS"] ANGLE_MTL_AUTORELEASE]);
id<MTLFunction> fragmentShader =
[[shaderLib newFunctionWithName:@"clearFS" constantValues:funcConstants
error:&err] ANGLE_MTL_AUTORELEASE];
ASSERT(fragmentShader);
mClearRenderPipelineCache.setVertexShader(ctx, vertexShader);
mClearRenderPipelineCache.setFragmentShader(ctx, fragmentShader);
}
}
......@@ -666,6 +681,12 @@ void ColorBlitUtils::ensureRenderPipelineStateCacheInitialized(ContextMtl *ctx,
type:MTLDataTypeBool
withName:UNMULTIPLY_ALPHA_CONSTANT_NAME];
// Use 1 color outputs for now.
uint32_t numOutputs = 1;
[funcConstants setConstantValue:&numOutputs
type:MTLDataTypeUInt
withName:NUM_COLOR_OUTPUTS_CONSTANT_NAME];
// Set texture type constant
[funcConstants setConstantValue:&textureType
type:MTLDataTypeInt
......
......@@ -9,15 +9,23 @@
using namespace rx::mtl_shader;
// function_constant(0) is already used by common.h
constant bool kPremultiplyAlpha [[function_constant(1)]];
constant bool kUnmultiplyAlpha [[function_constant(2)]];
constant int kSourceTextureType [[function_constant(3)]]; // Source texture type.
constant int kSourceTextureType [[function_constant(3)]]; // Source color/depth texture type.
constant int kSourceTexture2Type [[function_constant(4)]]; // Source stencil texture type.
constant bool kSourceTextureType2D = kSourceTextureType == kTextureType2D;
constant bool kSourceTextureType2DArray = kSourceTextureType == kTextureType2DArray;
constant bool kSourceTextureType2DMS = kSourceTextureType == kTextureType2DMultisample;
constant bool kSourceTextureTypeCube = kSourceTextureType == kTextureTypeCube;
constant bool kSourceTextureType3D = kSourceTextureType == kTextureType3D;
constant bool kSourceTexture2Type2D = kSourceTexture2Type == kTextureType2D;
constant bool kSourceTexture2Type2DArray = kSourceTexture2Type == kTextureType2DArray;
constant bool kSourceTexture2Type2DMS = kSourceTexture2Type == kTextureType2DMultisample;
constant bool kSourceTexture2TypeCube = kSourceTexture2Type == kTextureTypeCube;
struct BlitParams
{
// 0: lower left, 1: lower right, 2: upper left
......@@ -56,45 +64,20 @@ vertex BlitVSOut blitVS(unsigned int vid [[vertex_id]], constant BlitParams &opt
return output;
}
static inline float3 cubeTexcoords(float2 texcoords, int face)
template <typename SrcTexture2d>
static uint2 getImageCoords(SrcTexture2d srcTexture, float2 texCoords)
{
texcoords = 2.0 * texcoords - 1.0;
switch (face)
{
case 0:
return float3(1.0, -texcoords.y, -texcoords.x);
case 1:
return float3(-1.0, -texcoords.y, texcoords.x);
case 2:
return float3(texcoords.x, 1.0, texcoords.y);
case 3:
return float3(texcoords.x, -1.0, -texcoords.y);
case 4:
return float3(texcoords.x, -texcoords.y, 1.0);
case 5:
return float3(-texcoords.x, -texcoords.y, -1.0);
}
return float3(texcoords, 0);
uint2 dimens(srcTexture.get_width(), srcTexture.get_height());
uint2 coords = uint2(texCoords * float2(dimens));
return coords;
}
template <typename T>
static inline vec<T, 4> blitSampleTextureMS(texture2d_ms<T> srcTexture, float2 texCoords)
{
uint2 dimens(srcTexture.get_width(), srcTexture.get_height());
uint2 coords = uint2(texCoords * float2(dimens));
uint samples = srcTexture.get_num_samples();
vec<T, 4> output(0);
for (uint sample = 0; sample < samples; ++sample)
{
output += srcTexture.read(coords, sample);
}
output = output / samples;
return output;
uint2 coords = getImageCoords(srcTexture, texCoords);
return resolveTextureMS(srcTexture, coords);
}
template <typename T>
......@@ -173,7 +156,223 @@ static inline vec<T, 4> blitReadTexture(BLIT_COLOR_FS_PARAMS(T))
return output;
}
fragment float4 blitFS(BLIT_COLOR_FS_PARAMS(float))
fragment MultipleColorOutputs<float> blitFS(BLIT_COLOR_FS_PARAMS(float))
{
vec<float, 4> output = blitReadTexture(FORWARD_BLIT_COLOR_FS_PARAMS);
return toMultipleColorOutputs(output);
}
// Depth & stencil blitting.
struct FragmentDepthOut
{
float depth [[depth(any)]];
};
static inline float sampleDepth(
texture2d<float> srcTexture2d [[function_constant(kSourceTextureType2D)]],
texture2d_array<float> srcTexture2dArray [[function_constant(kSourceTextureType2DArray)]],
texture2d_ms<float> srcTexture2dMS [[function_constant(kSourceTextureType2DMS)]],
texturecube<float> srcTextureCube [[function_constant(kSourceTextureTypeCube)]],
float2 texCoords,
constant BlitParams &options)
{
float4 output;
constexpr sampler textureSampler(mag_filter::nearest, min_filter::nearest);
switch (kSourceTextureType)
{
case kTextureType2D:
output = srcTexture2d.sample(textureSampler, texCoords, level(options.srcLevel));
break;
case kTextureType2DArray:
output = srcTexture2dArray.sample(textureSampler, texCoords, options.srcLayer,
level(options.srcLevel));
break;
case kTextureType2DMultisample:
// Always use sample 0 for depth resolve:
output = srcTexture2dMS.read(getImageCoords(srcTexture2dMS, texCoords), 0);
break;
case kTextureTypeCube:
output =
srcTextureCube.sample(textureSampler, cubeTexcoords(texCoords, options.srcLayer),
level(options.srcLevel));
break;
}
return output.r;
}
fragment FragmentDepthOut blitDepthFS(BlitVSOut input [[stage_in]],
texture2d<float> srcTexture2d
[[texture(0), function_constant(kSourceTextureType2D)]],
texture2d_array<float> srcTexture2dArray
[[texture(0), function_constant(kSourceTextureType2DArray)]],
texture2d_ms<float> srcTexture2dMS
[[texture(0), function_constant(kSourceTextureType2DMS)]],
texturecube<float> srcTextureCube
[[texture(0), function_constant(kSourceTextureTypeCube)]],
constant BlitParams &options [[buffer(0)]])
{
FragmentDepthOut re;
re.depth = sampleDepth(srcTexture2d, srcTexture2dArray, srcTexture2dMS, srcTextureCube,
input.texCoords, options);
return re;
}
static inline uint32_t sampleStencil(
texture2d<uint32_t> srcTexture2d [[function_constant(kSourceTexture2Type2D)]],
texture2d_array<uint32_t> srcTexture2dArray [[function_constant(kSourceTexture2Type2DArray)]],
texture2d_ms<uint32_t> srcTexture2dMS [[function_constant(kSourceTexture2Type2DMS)]],
texturecube<uint32_t> srcTextureCube [[function_constant(kSourceTexture2TypeCube)]],
float2 texCoords,
int srcLevel,
int srcLayer)
{
uint4 output;
constexpr sampler textureSampler(mag_filter::nearest, min_filter::nearest);
switch (kSourceTexture2Type)
{
case kTextureType2D:
output = srcTexture2d.sample(textureSampler, texCoords, level(srcLevel));
break;
case kTextureType2DArray:
output = srcTexture2dArray.sample(textureSampler, texCoords, srcLayer, level(srcLevel));
break;
case kTextureType2DMultisample:
// Always use sample 0 for stencil resolve:
output = srcTexture2dMS.read(getImageCoords(srcTexture2dMS, texCoords), 0);
break;
case kTextureTypeCube:
output = srcTextureCube.sample(textureSampler, cubeTexcoords(texCoords, srcLayer),
level(srcLevel));
break;
}
return output.r;
}
// Write stencil to a buffer
struct BlitStencilToBufferParams
{
float2 srcStartTexCoords;
float2 srcTexCoordSteps;
int srcLevel;
int srcLayer;
uint2 dstSize;
uint dstBufferRowPitch;
// Is multisample resolve needed?
bool resolveMS;
};
kernel void blitStencilToBufferCS(ushort2 gIndices [[thread_position_in_grid]],
texture2d<uint32_t> srcTexture2d
[[texture(1), function_constant(kSourceTexture2Type2D)]],
texture2d_array<uint32_t> srcTexture2dArray
[[texture(1), function_constant(kSourceTexture2Type2DArray)]],
texture2d_ms<uint32_t> srcTexture2dMS
[[texture(1), function_constant(kSourceTexture2Type2DMS)]],
texturecube<uint32_t> srcTextureCube
[[texture(1), function_constant(kSourceTexture2TypeCube)]],
constant BlitStencilToBufferParams &options [[buffer(0)]],
device uchar *buffer [[buffer(1)]])
{
return blitReadTexture(FORWARD_BLIT_COLOR_FS_PARAMS);
if (gIndices.x >= options.dstSize.x || gIndices.y >= options.dstSize.y)
{
return;
}
float2 srcTexCoords = options.srcStartTexCoords + float2(gIndices) * options.srcTexCoordSteps;
if (kSourceTexture2Type == kTextureType2DMultisample && !options.resolveMS)
{
uint samples = srcTexture2dMS.get_num_samples();
uint2 imageCoords = getImageCoords(srcTexture2dMS, srcTexCoords);
uint bufferOffset = options.dstBufferRowPitch * gIndices.y + samples * gIndices.x;
for (uint sample = 0; sample < samples; ++sample)
{
uint stencilPerSample = srcTexture2dMS.read(imageCoords, sample).r;
buffer[bufferOffset + sample] = static_cast<uchar>(stencilPerSample);
}
}
else
{
uint32_t stencil =
sampleStencil(srcTexture2d, srcTexture2dArray, srcTexture2dMS, srcTextureCube,
srcTexCoords, options.srcLevel, options.srcLayer);
buffer[options.dstBufferRowPitch * gIndices.y + gIndices.x] = static_cast<uchar>(stencil);
}
}
// Fragment's stencil output is only available since Metal 2.1
#if __METAL_VERSION__ >= 210
struct FragmentStencilOut
{
uint32_t stencil [[stencil]];
};
struct FragmentDepthStencilOut
{
float depth [[depth(any)]];
uint32_t stencil [[stencil]];
};
fragment FragmentStencilOut blitStencilFS(
BlitVSOut input [[stage_in]],
texture2d<uint32_t> srcTexture2d [[texture(1), function_constant(kSourceTexture2Type2D)]],
texture2d_array<uint32_t> srcTexture2dArray
[[texture(1), function_constant(kSourceTexture2Type2DArray)]],
texture2d_ms<uint32_t> srcTexture2dMS
[[texture(1), function_constant(kSourceTexture2Type2DMS)]],
texturecube<uint32_t> srcTextureCube [[texture(1), function_constant(kSourceTexture2TypeCube)]],
constant BlitParams &options [[buffer(0)]])
{
FragmentStencilOut re;
re.stencil = sampleStencil(srcTexture2d, srcTexture2dArray, srcTexture2dMS, srcTextureCube,
input.texCoords, options.srcLevel, options.srcLayer);
return re;
}
fragment FragmentDepthStencilOut blitDepthStencilFS(
BlitVSOut input [[stage_in]],
// Source depth texture
texture2d<float> srcDepthTexture2d [[texture(0), function_constant(kSourceTextureType2D)]],
texture2d_array<float> srcDepthTexture2dArray
[[texture(0), function_constant(kSourceTextureType2DArray)]],
texture2d_ms<float> srcDepthTexture2dMS
[[texture(0), function_constant(kSourceTextureType2DMS)]],
texturecube<float> srcDepthTextureCube
[[texture(0), function_constant(kSourceTextureTypeCube)]],
// Source stencil texture
texture2d<uint32_t> srcStencilTexture2d
[[texture(1), function_constant(kSourceTexture2Type2D)]],
texture2d_array<uint32_t> srcStencilTexture2dArray
[[texture(1), function_constant(kSourceTexture2Type2DArray)]],
texture2d_ms<uint32_t> srcStencilTexture2dMS
[[texture(1), function_constant(kSourceTexture2Type2DMS)]],
texturecube<uint32_t> srcStencilTextureCube
[[texture(1), function_constant(kSourceTexture2TypeCube)]],
constant BlitParams &options [[buffer(0)]])
{
FragmentDepthStencilOut re;
re.depth = sampleDepth(srcDepthTexture2d, srcDepthTexture2dArray, srcDepthTexture2dMS,
srcDepthTextureCube, input.texCoords, options);
re.stencil =
sampleStencil(srcStencilTexture2d, srcStencilTexture2dArray, srcStencilTexture2dMS,
srcStencilTextureCube, input.texCoords, options.srcLevel, options.srcLayer);
return re;
}
#endif // __METAL_VERSION__ >= 210
......@@ -7,6 +7,8 @@
#include "common.h"
using namespace rx::mtl_shader;
struct ClearParams
{
float4 clearColor;
......@@ -19,7 +21,7 @@ vertex float4 clearVS(unsigned int vid [[ vertex_id ]],
return float4(gCorners[vid], clearParams.clearDepth, 1.0);
}
fragment float4 clearFS(constant ClearParams &clearParams [[buffer(0)]])
fragment MultipleColorOutputs<float> clearFS(constant ClearParams &clearParams [[buffer(0)]])
{
return clearParams.clearColor;
return toMultipleColorOutputs(clearParams.clearColor);
}
......@@ -23,7 +23,91 @@
using namespace metal;
// Common constant defined number of color outputs
constant uint32_t kNumColorOutputs [[function_constant(0)]];
constant bool kColorOutputAvailable0 = kNumColorOutputs > 0;
constant bool kColorOutputAvailable1 = kNumColorOutputs > 1;
constant bool kColorOutputAvailable2 = kNumColorOutputs > 2;
constant bool kColorOutputAvailable3 = kNumColorOutputs > 3;
namespace rx
{
namespace mtl_shader
{
// Full screen triangle's vertices
constant float2 gCorners[3] = {float2(-1.0f, -1.0f), float2(3.0f, -1.0f), float2(-1.0f, 3.0f)};
template <typename T>
struct MultipleColorOutputs
{
vec<T, 4> color0 [[color(0), function_constant(kColorOutputAvailable0)]];
vec<T, 4> color1 [[color(1), function_constant(kColorOutputAvailable1)]];
vec<T, 4> color2 [[color(2), function_constant(kColorOutputAvailable2)]];
vec<T, 4> color3 [[color(3), function_constant(kColorOutputAvailable3)]];
};
#define ANGLE_ASSIGN_COLOR_OUPUT(STRUCT_VARIABLE, COLOR_INDEX, VALUE) \
do \
{ \
if (kColorOutputAvailable##COLOR_INDEX) \
{ \
STRUCT_VARIABLE.color##COLOR_INDEX = VALUE; \
} \
} while (0)
template <typename T>
static inline MultipleColorOutputs<T> toMultipleColorOutputs(vec<T, 4> color)
{
MultipleColorOutputs<T> re;
ANGLE_ASSIGN_COLOR_OUPUT(re, 0, color);
ANGLE_ASSIGN_COLOR_OUPUT(re, 1, color);
ANGLE_ASSIGN_COLOR_OUPUT(re, 2, color);
ANGLE_ASSIGN_COLOR_OUPUT(re, 3, color);
return re;
}
static inline float3 cubeTexcoords(float2 texcoords, int face)
{
texcoords = 2.0 * texcoords - 1.0;
switch (face)
{
case 0:
return float3(1.0, -texcoords.y, -texcoords.x);
case 1:
return float3(-1.0, -texcoords.y, texcoords.x);
case 2:
return float3(texcoords.x, 1.0, texcoords.y);
case 3:
return float3(texcoords.x, -1.0, -texcoords.y);
case 4:
return float3(texcoords.x, -texcoords.y, 1.0);
case 5:
return float3(-texcoords.x, -texcoords.y, -1.0);
}
return float3(texcoords, 0);
}
template <typename T>
static inline vec<T, 4> resolveTextureMS(texture2d_ms<T> srcTexture, uint2 coords)
{
uint samples = srcTexture.get_num_samples();
vec<T, 4> output(0);
for (uint sample = 0; sample < samples; ++sample)
{
output += srcTexture.read(coords, sample);
}
output = output / samples;
return output;
}
} // namespace mtl_shader
} // namespace rx
#endif /* LIBANGLE_RENDERER_METAL_SHADERS_COMMON_H_ */
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -39,4 +39,30 @@
#include "compiled_default_metallib_debug_ios_autogen.inc"
#endif // TARGET_OS_OSX || TARGET_OS_MACCATALYST
#if TARGET_OS_OSX || TARGET_OS_MACCATALYST
#include "compiled_default_metallib_2_1_mac_autogen.inc"
#elif TARGET_OS_IOS && TARGET_OS_SIMULATOR // TARGET_OS_OSX || TARGET_OS_MACCATALYST
#include "compiled_default_metallib_2_1_ios_sim_autogen.inc"
#elif TARGET_OS_IOS // TARGET_OS_OSX || TARGET_OS_MACCATALYST
#include "compiled_default_metallib_2_1_ios_autogen.inc"
#endif // TARGET_OS_OSX || TARGET_OS_MACCATALYST
#if TARGET_OS_OSX || TARGET_OS_MACCATALYST
#include "compiled_default_metallib_2_1_debug_mac_autogen.inc"
#elif TARGET_OS_IOS && TARGET_OS_SIMULATOR // TARGET_OS_OSX || TARGET_OS_MACCATALYST
#include "compiled_default_metallib_2_1_debug_ios_sim_autogen.inc"
#elif TARGET_OS_IOS // TARGET_OS_OSX || TARGET_OS_MACCATALYST
#include "compiled_default_metallib_2_1_debug_ios_autogen.inc"
#endif // TARGET_OS_OSX || TARGET_OS_MACCATALYST
// clang-format on
......@@ -6,10 +6,13 @@
#include "common.h"
constant bool kSourceBufferAligned[[function_constant(0)]];
constant bool kSourceIndexIsU8[[function_constant(1)]];
constant bool kSourceIndexIsU16[[function_constant(2)]];
constant bool kSourceIndexIsU32[[function_constant(3)]];
using namespace rx::mtl_shader;
// function_constant(0) is already used by common.h
constant bool kSourceBufferAligned[[function_constant(1)]];
constant bool kSourceIndexIsU8[[function_constant(2)]];
constant bool kSourceIndexIsU16[[function_constant(3)]];
constant bool kSourceIndexIsU32[[function_constant(4)]];
constant bool kSourceBufferUnaligned = !kSourceBufferAligned;
constant bool kUseSourceBufferU8 = kSourceIndexIsU8 || kSourceBufferUnaligned;
constant bool kUseSourceBufferU16 = kSourceIndexIsU16 && kSourceBufferAligned;
......
......@@ -166,6 +166,12 @@ def main():
# yapf: disable
os_specific_autogen_files = [
'compiled/compiled_default_metallib_2_1_debug_ios_autogen.inc',
'compiled/compiled_default_metallib_2_1_debug_ios_sim_autogen.inc',
'compiled/compiled_default_metallib_2_1_debug_mac_autogen.inc',
'compiled/compiled_default_metallib_2_1_ios_autogen.inc',
'compiled/compiled_default_metallib_2_1_ios_sim_autogen.inc',
'compiled/compiled_default_metallib_2_1_mac_autogen.inc',
'compiled/compiled_default_metallib_debug_ios_autogen.inc',
'compiled/compiled_default_metallib_debug_ios_sim_autogen.inc',
'compiled/compiled_default_metallib_debug_mac_autogen.inc',
......@@ -210,6 +216,10 @@ def main():
boilerplate_code)
gen_precompiled_shaders(10.13, 11.0, 'compiled_default_metallib_debug',
'-gline-tables-only -MO', src_files, boilerplate_code)
gen_precompiled_shaders(10.14, 12.0, 'compiled_default_metallib_2_1', '', src_files,
boilerplate_code)
gen_precompiled_shaders(10.14, 12.0, 'compiled_default_metallib_2_1_debug',
'-gline-tables-only -MO', src_files, boilerplate_code)
os.system('echo "// clang-format on" >> compiled/mtl_default_shaders_autogen.inc')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment