1111
1212
1313static char gDefaultMetallibSrc[] = R" (
14- # 1 " temp / master_source .metal"
14+ # 1 " temp_master_source .metal"
1515# 1 " < built- in > " 1
1616# 1 " < built- in > " 3
17- # 376 " < built- in > " 3
17+ # 392 " < built- in > " 3
1818# 1 " < command line> " 1
1919# 1 " < built- in > " 2
20- # 1 " temp / master_source .metal" 2
21- # 1 " temp / . ./ blit.metal" 1
20+ # 1 " temp_master_source .metal" 2
21+ # 1 " ./ blit.metal" 1
2222
2323
2424
2525
2626
2727
2828
29- # 1 " temp / . ./ common.h" 1
30- # 13 " temp / . ./ common.h"
29+ # 1 " ./ common.h" 1
30+ # 13 " ./ common.h"
3131# include <simd/simd.h>
3232# include <metal_stdlib>
3333
3434
3535
36- # 1 " temp / . ./ constants.h" 1
37- # 11 " temp / . ./ constants.h"
36+ # 1 " ./ constants.h" 1
37+ # 11 " ./ constants.h"
3838namespace rx
3939{
4040namespace mtl_shader
5555
5656}
5757}
58- # 18 " temp / . ./ common.h" 2
58+ # 18 " ./ common.h" 2
5959
6060
6161
@@ -89,7 +89,7 @@ struct MultipleColorOutputs
8989 vec<T, 4> color2 [[color(2), function_constant(kColorOutputAvailable2)]];
9090 vec<T, 4> color3 [[color(3), function_constant(kColorOutputAvailable3)]];
9191};
92- # 61 " temp / . ./ common.h"
92+ # 61 " ./ common.h"
9393template <typename T>
9494static inline MultipleColorOutputs<T> toMultipleColorOutputs(vec<T, 4> color)
9595{
@@ -292,7 +292,7 @@ static inline T floatToNormalized(float input)
292292
293293}
294294}
295- # 9 " temp / . ./ blit.metal" 2
295+ # 9 " ./ blit.metal" 2
296296
297297using namespace rx::mtl_shader;
298298
@@ -378,7 +378,7 @@ static inline vec<T, 4> blitSampleTexture3D(texture3d<T> srcTexture,
378378
379379 return srcTexture.sample(textureSampler, float3(texCoords, zCoord), level(options.srcLevel));
380380}
381- # 112 " temp / . ./ blit.metal"
381+ # 112 " ./ blit.metal"
382382template <typename T>
383383static inline vec<T, 4> blitReadTexture(BlitVSOut input [[stage_in]], texture2d<T> srcTexture2d [[texture(0), function_constant(kSourceTextureType2D)]], texture2d_array<T> srcTexture2dArray [[texture(0), function_constant(kSourceTextureType2DArray)]], texture2d_ms<T> srcTexture2dMS [[texture(0), function_constant(kSourceTextureType2DMS)]], texturecube<T> srcTextureCube [[texture(0), function_constant(kSourceTextureTypeCube)]], texture3d<T> srcTexture3d [[texture(0), function_constant(kSourceTextureType3D)]], sampler textureSampler [[sampler(0)]], constant BlitParams &options [[buffer(0)]])
384384{
@@ -668,9 +668,9 @@ fragment FragmentDepthStencilOut blitDepthStencilFS(
668668 return re;
669669}
670670#endif
671- # 2 " temp / master_source .metal" 2
672- # 1 " temp / . ./ clear.metal" 1
673- # 10 " temp / . ./ clear.metal"
671+ # 2 " temp_master_source .metal" 2
672+ # 1 " ./ clear.metal" 1
673+ # 10 " ./ clear.metal"
674674using namespace rx::mtl_shader;
675675
676676struct ClearParams
@@ -699,8 +699,8 @@ fragment MultipleColorOutputs<uint> clearUIntFS(constant ClearParams &clearParam
699699{
700700 return toMultipleColorOutputs(as_type<uint4>(clearParams.clearColor));
701701}
702- # 3 " temp / master_source .metal" 2
703- # 1 " temp / . ./ gen_indices.metal" 1
702+ # 3 " temp_master_source .metal" 2
703+ # 1 " ./ gen_indices.metal" 1
704704
705705
706706
@@ -874,8 +874,8 @@ kernel void genTriFanIndicesFromElements(
874874 output[3 * idx + 1] = getIndexU32(options.srcOffset, elemIdx - 1, inputU8, inputU16, inputU32);
875875 output[3 * idx + 2] = getIndexU32(options.srcOffset, elemIdx, inputU8, inputU16, inputU32);
876876}
877- # 4 " temp / master_source .metal" 2
878- # 1 " temp / . ./ gen_mipmap.metal" 1
877+ # 4 " temp_master_source .metal" 2
878+ # 1 " ./ gen_mipmap.metal" 1
879879
880880
881881
@@ -885,7 +885,7 @@ kernel void genTriFanIndicesFromElements(
885885
886886
887887using namespace rx::mtl_shader;
888- # 31 " temp / . ./ gen_mipmap.metal"
888+ # 31 " ./ gen_mipmap.metal"
889889struct GenMipParams
890890{
891891 uint srcLevel;
@@ -1072,15 +1072,15 @@ kernel void generate3DMipmaps(uint lIndex [[thread_index_in_threadgroup]],
10721072 dstMip4.write((options.sRGB ? sRGBtoLinear(texel1) : texel1), gIndices >> 3);
10731073 }
10741074}
1075- # 5 " temp / master_source .metal" 2
1076- # 1 " temp / . ./ copy_buffer.metal" 1
1077- # 12 " temp / . ./ copy_buffer.metal"
1075+ # 5 " temp_master_source .metal" 2
1076+ # 1 " ./ copy_buffer.metal" 1
1077+ # 12 " ./ copy_buffer.metal"
10781078#include <metal_pack>
10791079
10801080
10811081
1082- # 1 " temp / . ./ format_autogen.h" 1
1083- # 11 " temp / . ./ format_autogen.h"
1082+ # 1 " ./ format_autogen.h" 1
1083+ # 11 " ./ format_autogen.h"
10841084namespace rx
10851085{
10861086namespace mtl_shader
@@ -1320,7 +1320,7 @@ enum
13201320
13211321}
13221322}
1323- # 16 " temp / . ./ copy_buffer.metal" 2
1323+ # 16 " ./ copy_buffer.metal" 2
13241324
13251325using namespace rx::mtl_shader;
13261326
@@ -1360,7 +1360,7 @@ struct WritePixelParams
13601360
13611361 bool reverseTextureRowOrder;
13621362};
1363- # 120 " temp / . ./ copy_buffer.metal"
1363+ # 120 " ./ copy_buffer.metal"
13641364template <typename T>
13651365static inline void textureWrite(ushort3 gIndices,
13661366 constant CopyPixelParams &options,
@@ -1418,7 +1418,7 @@ static inline vec<T, 4> textureRead(ushort2 gIndices,
14181418 }
14191419 return color;
14201420}
1421- # 215 " temp / . ./ copy_buffer.metal"
1421+ # 215 " ./ copy_buffer.metal"
14221422static inline float4 readR5G6B5_UNORM(uint bufferOffset, constant uchar *buffer)
14231423{
14241424 float4 color;
@@ -2473,7 +2473,7 @@ static inline void writeR32G32B32A32_UINT(ushort2 gIndices, constant WritePixelP
24732473 intToBytes(color.b, bufferOffset + 8, buffer);
24742474 intToBytes(color.a, bufferOffset + 12, buffer);
24752475}
2476- # 1292 " temp / . ./ copy_buffer.metal"
2476+ # 1292 " ./ copy_buffer.metal"
24772477static inline int4 readR8_SSCALED(uint bufferOffset, constant uchar *buffer) { return readR8_SINT(bufferOffset, buffer); } static inline uint4 readR8_USCALED(uint bufferOffset, constant uchar *buffer) { return readR8_UINT(bufferOffset, buffer); } static inline int4 readR8G8_SSCALED(uint bufferOffset, constant uchar *buffer) { return readR8G8_SINT(bufferOffset, buffer); } static inline uint4 readR8G8_USCALED(uint bufferOffset, constant uchar *buffer) { return readR8G8_UINT(bufferOffset, buffer); } static inline int4 readR8G8B8_SSCALED(uint bufferOffset, constant uchar *buffer) { return readR8G8B8_SINT(bufferOffset, buffer); } static inline uint4 readR8G8B8_USCALED(uint bufferOffset, constant uchar *buffer) { return readR8G8B8_UINT(bufferOffset, buffer); } static inline int4 readR8G8B8A8_SSCALED(uint bufferOffset, constant uchar *buffer) { return readR8G8B8A8_SINT(bufferOffset, buffer); } static inline uint4 readR8G8B8A8_USCALED(uint bufferOffset, constant uchar *buffer) { return readR8G8B8A8_UINT(bufferOffset, buffer); }
24782478static inline int4 readR16_SSCALED(uint bufferOffset, constant uchar *buffer) { return readR16_SINT(bufferOffset, buffer); } static inline uint4 readR16_USCALED(uint bufferOffset, constant uchar *buffer) { return readR16_UINT(bufferOffset, buffer); } static inline int4 readR16G16_SSCALED(uint bufferOffset, constant uchar *buffer) { return readR16G16_SINT(bufferOffset, buffer); } static inline uint4 readR16G16_USCALED(uint bufferOffset, constant uchar *buffer) { return readR16G16_UINT(bufferOffset, buffer); } static inline int4 readR16G16B16_SSCALED(uint bufferOffset, constant uchar *buffer) { return readR16G16B16_SINT(bufferOffset, buffer); } static inline uint4 readR16G16B16_USCALED(uint bufferOffset, constant uchar *buffer) { return readR16G16B16_UINT(bufferOffset, buffer); } static inline int4 readR16G16B16A16_SSCALED(uint bufferOffset, constant uchar *buffer) { return readR16G16B16A16_SINT(bufferOffset, buffer); } static inline uint4 readR16G16B16A16_USCALED(uint bufferOffset, constant uchar *buffer) { return readR16G16B16A16_UINT(bufferOffset, buffer); }
24792479static inline int4 readR32_SSCALED(uint bufferOffset, constant uchar *buffer) { return readR32_SINT(bufferOffset, buffer); } static inline uint4 readR32_USCALED(uint bufferOffset, constant uchar *buffer) { return readR32_UINT(bufferOffset, buffer); } static inline int4 readR32G32_SSCALED(uint bufferOffset, constant uchar *buffer) { return readR32G32_SINT(bufferOffset, buffer); } static inline uint4 readR32G32_USCALED(uint bufferOffset, constant uchar *buffer) { return readR32G32_UINT(bufferOffset, buffer); } static inline int4 readR32G32B32_SSCALED(uint bufferOffset, constant uchar *buffer) { return readR32G32B32_SINT(bufferOffset, buffer); } static inline uint4 readR32G32B32_USCALED(uint bufferOffset, constant uchar *buffer) { return readR32G32B32_UINT(bufferOffset, buffer); } static inline int4 readR32G32B32A32_SSCALED(uint bufferOffset, constant uchar *buffer) { return readR32G32B32A32_SINT(bufferOffset, buffer); } static inline uint4 readR32G32B32A32_USCALED(uint bufferOffset, constant uchar *buffer) { return readR32G32B32A32_UINT(bufferOffset, buffer); }
@@ -2484,7 +2484,7 @@ static inline int4 readR10G10B10A2_SSCALED(uint bufferOffset, constant uchar *bu
24842484kernel void readFromBufferToFloatTexture(ushort3 gIndices [[thread_position_in_grid]], constant CopyPixelParams &options[[buffer(0)]], constant uchar *buffer [[buffer(1)]], texture2d<float, access::write> dstTexture2d [[texture(0), function_constant(kCopyTextureType2D)]], texture2d_array<float, access::write> dstTexture2dArray [[texture(0), function_constant(kCopyTextureType2DArray)]], texture3d<float, access::write> dstTexture3d [[texture(0), function_constant(kCopyTextureType3D)]], texturecube<float, access::write> dstTextureCube [[texture(0), function_constant(kCopyTextureTypeCube)]])
24852485{
24862486 if (gIndices.x >= options.copySize.x || gIndices.y >= options.copySize.y || gIndices.z >= options.copySize.z) { return; }
2487- # 1336 " temp / . ./ copy_buffer.metal"
2487+ # 1336 " ./ copy_buffer.metal"
24882488 uint bufferOffset = options.bufferStartOffset + (gIndices.z * options.bufferDepthPitch + gIndices.y * options.bufferRowPitch + gIndices.x * options.pixelSize);
24892489
24902490 switch (kCopyFormatType)
@@ -2498,7 +2498,7 @@ kernel void readFromBufferToFloatTexture(ushort3 gIndices [[thread_position_in_g
24982498kernel void readFromBufferToIntTexture(ushort3 gIndices [[thread_position_in_grid]], constant CopyPixelParams &options[[buffer(0)]], constant uchar *buffer [[buffer(1)]], texture2d<int, access::write> dstTexture2d [[texture(0), function_constant(kCopyTextureType2D)]], texture2d_array<int, access::write> dstTexture2dArray [[texture(0), function_constant(kCopyTextureType2DArray)]], texture3d<int, access::write> dstTexture3d [[texture(0), function_constant(kCopyTextureType3D)]], texturecube<int, access::write> dstTextureCube [[texture(0), function_constant(kCopyTextureTypeCube)]])
24992499{
25002500 if (gIndices.x >= options.copySize.x || gIndices.y >= options.copySize.y || gIndices.z >= options.copySize.z) { return; }
2501- # 1364 " temp / . ./ copy_buffer.metal"
2501+ # 1364 " ./ copy_buffer.metal"
25022502 uint bufferOffset = options.bufferStartOffset + (gIndices.z * options.bufferDepthPitch + gIndices.y * options.bufferRowPitch + gIndices.x * options.pixelSize);
25032503
25042504 switch (kCopyFormatType)
@@ -2512,7 +2512,7 @@ kernel void readFromBufferToIntTexture(ushort3 gIndices [[thread_position_in_gri
25122512kernel void readFromBufferToUIntTexture(ushort3 gIndices [[thread_position_in_grid]], constant CopyPixelParams &options[[buffer(0)]], constant uchar *buffer [[buffer(1)]], texture2d<uint, access::write> dstTexture2d [[texture(0), function_constant(kCopyTextureType2D)]], texture2d_array<uint, access::write> dstTexture2dArray [[texture(0), function_constant(kCopyTextureType2DArray)]], texture3d<uint, access::write> dstTexture3d [[texture(0), function_constant(kCopyTextureType3D)]], texturecube<uint, access::write> dstTextureCube [[texture(0), function_constant(kCopyTextureTypeCube)]])
25132513{
25142514 if (gIndices.x >= options.copySize.x || gIndices.y >= options.copySize.y || gIndices.z >= options.copySize.z) { return; }
2515- # 1392 " temp / . ./ copy_buffer.metal"
2515+ # 1392 " ./ copy_buffer.metal"
25162516 uint bufferOffset = options.bufferStartOffset + (gIndices.z * options.bufferDepthPitch + gIndices.y * options.bufferRowPitch + gIndices.x * options.pixelSize);
25172517
25182518 switch (kCopyFormatType)
@@ -2527,7 +2527,7 @@ kernel void readFromBufferToUIntTexture(ushort3 gIndices [[thread_position_in_gr
25272527kernel void writeFromFloatTextureToBuffer(ushort2 gIndices [[thread_position_in_grid]], constant WritePixelParams &options[[buffer(0)]], texture2d<float, access::read> srcTexture2d [[texture(0), function_constant(kCopyTextureType2D)]], texture2d_array<float, access::read> srcTexture2dArray [[texture(0), function_constant(kCopyTextureType2DArray)]], texture3d<float, access::read> srcTexture3d [[texture(0), function_constant(kCopyTextureType3D)]], texturecube<float, access::read> srcTextureCube [[texture(0), function_constant(kCopyTextureTypeCube)]], texture2d_ms<float, access::read> srcTexture2dMS [[texture(0), function_constant(kCopyTextureType2DMS)]], device uchar *buffer [[buffer(1)]])
25282528{
25292529 if (gIndices.x >= options.copySize.x || gIndices.y >= options.copySize.y) { return; }
2530- # 1439 " temp / . ./ copy_buffer.metal"
2530+ # 1439 " ./ copy_buffer.metal"
25312531 uint bufferOffset = options.bufferStartOffset + (gIndices.y * options.bufferRowPitch + gIndices.x * options.pixelSize);
25322532
25332533 switch (kCopyFormatType)
@@ -2541,7 +2541,7 @@ kernel void writeFromFloatTextureToBuffer(ushort2 gIndices [[thread_position_in_
25412541kernel void writeFromIntTextureToBuffer(ushort2 gIndices [[thread_position_in_grid]], constant WritePixelParams &options[[buffer(0)]], texture2d<int, access::read> srcTexture2d [[texture(0), function_constant(kCopyTextureType2D)]], texture2d_array<int, access::read> srcTexture2dArray [[texture(0), function_constant(kCopyTextureType2DArray)]], texture3d<int, access::read> srcTexture3d [[texture(0), function_constant(kCopyTextureType3D)]], texturecube<int, access::read> srcTextureCube [[texture(0), function_constant(kCopyTextureTypeCube)]], texture2d_ms<int, access::read> srcTexture2dMS [[texture(0), function_constant(kCopyTextureType2DMS)]], device uchar *buffer [[buffer(1)]])
25422542{
25432543 if (gIndices.x >= options.copySize.x || gIndices.y >= options.copySize.y) { return; }
2544- # 1464 " temp / . ./ copy_buffer.metal"
2544+ # 1464 " ./ copy_buffer.metal"
25452545 uint bufferOffset = options.bufferStartOffset + (gIndices.y * options.bufferRowPitch + gIndices.x * options.pixelSize);
25462546
25472547 switch (kCopyFormatType)
@@ -2555,7 +2555,7 @@ kernel void writeFromIntTextureToBuffer(ushort2 gIndices [[thread_position_in_gr
25552555kernel void writeFromUIntTextureToBuffer(ushort2 gIndices [[thread_position_in_grid]], constant WritePixelParams &options[[buffer(0)]], texture2d<uint, access::read> srcTexture2d [[texture(0), function_constant(kCopyTextureType2D)]], texture2d_array<uint, access::read> srcTexture2dArray [[texture(0), function_constant(kCopyTextureType2DArray)]], texture3d<uint, access::read> srcTexture3d [[texture(0), function_constant(kCopyTextureType3D)]], texturecube<uint, access::read> srcTextureCube [[texture(0), function_constant(kCopyTextureTypeCube)]], texture2d_ms<uint, access::read> srcTexture2dMS [[texture(0), function_constant(kCopyTextureType2DMS)]], device uchar *buffer [[buffer(1)]])
25562556{
25572557 if (gIndices.x >= options.copySize.x || gIndices.y >= options.copySize.y) { return; }
2558- # 1489 " temp / . ./ copy_buffer.metal"
2558+ # 1489 " ./ copy_buffer.metal"
25592559 uint bufferOffset = options.bufferStartOffset + (gIndices.y * options.bufferRowPitch + gIndices.x * options.pixelSize);
25602560
25612561 switch (kCopyFormatType)
@@ -2565,8 +2565,8 @@ kernel void writeFromUIntTextureToBuffer(ushort2 gIndices [[thread_position_in_g
25652565
25662566
25672567}
2568- # 6 " temp / master_source .metal" 2
2569- # 1 " temp / . ./ visibility.metal" 1
2568+ # 6 " temp_master_source .metal" 2
2569+ # 1 " ./ visibility.metal" 1
25702570
25712571
25722572
@@ -2620,7 +2620,7 @@ kernel void combineVisibilityResult(uint idx [[thread_position_in_grid]],
26202620 }
26212621 finalResults[0] = finalResult16x4;
26222622}
2623- # 7 " temp / master_source .metal" 2
2623+ # 7 " temp_master_source .metal" 2
26242624
26252625
26262626)" ;
0 commit comments