Skip to content

Commit

Permalink
Make Metal shaders target Metal Language Version 1.2 (macOS 10.12) fo…
Browse files Browse the repository at this point in the history
…r wider compatibility. References ultralight-ux/Ultralight#180
  • Loading branch information
adamjs committed Nov 8, 2019
1 parent 1a2fdbe commit 928533c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
48 changes: 24 additions & 24 deletions shaders/metal/bin/metal_shader.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,48 @@ unsigned char metal_shader[] = {
0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00,
0x4e, 0x41, 0x4d, 0x45, 0x0d, 0x00, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78,
0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x00, 0x54, 0x59, 0x50, 0x45, 0x01,
0x00, 0x00, 0x48, 0x41, 0x53, 0x48, 0x20, 0x00, 0x2a, 0x57, 0xf0, 0xf7,
0x38, 0x62, 0x90, 0x59, 0x96, 0x28, 0x16, 0x91, 0x0f, 0xa8, 0xb2, 0x68,
0xb7, 0xa7, 0xa7, 0x73, 0x00, 0x7e, 0x9e, 0xcb, 0x9a, 0x04, 0x94, 0xe8,
0xeb, 0x49, 0xe1, 0x24, 0x4d, 0x44, 0x53, 0x5a, 0x08, 0x00, 0x00, 0x11,
0x00, 0x00, 0x48, 0x41, 0x53, 0x48, 0x20, 0x00, 0xb8, 0xc0, 0x3f, 0xc5,
0xae, 0x5e, 0xec, 0x43, 0x08, 0x4b, 0x6d, 0x82, 0x72, 0x6b, 0x38, 0xd7,
0x58, 0x94, 0xda, 0xef, 0x49, 0xc9, 0xea, 0x6a, 0x44, 0xcc, 0xf7, 0xc2,
0x16, 0x9d, 0x1e, 0x4a, 0x4d, 0x44, 0x53, 0x5a, 0x08, 0x00, 0x00, 0x11,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x46, 0x46, 0x54, 0x18, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x56, 0x45, 0x52, 0x53, 0x08, 0x00, 0x02, 0x00, 0x01, 0x00, 0x02, 0x00,
0x01, 0x00, 0x45, 0x4e, 0x44, 0x54, 0x86, 0x00, 0x00, 0x00, 0x4e, 0x41,
0x56, 0x45, 0x52, 0x53, 0x08, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00,
0x02, 0x00, 0x45, 0x4e, 0x44, 0x54, 0x86, 0x00, 0x00, 0x00, 0x4e, 0x41,
0x4d, 0x45, 0x11, 0x00, 0x70, 0x61, 0x74, 0x68, 0x56, 0x65, 0x72, 0x74,
0x65, 0x78, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x00, 0x54, 0x59, 0x50,
0x45, 0x01, 0x00, 0x00, 0x48, 0x41, 0x53, 0x48, 0x20, 0x00, 0x39, 0x0d,
0x5a, 0xba, 0x6d, 0xed, 0xd5, 0xf2, 0xea, 0x10, 0x46, 0x93, 0x34, 0x36,
0x62, 0x9e, 0xef, 0xac, 0x78, 0x44, 0x3e, 0x6f, 0xe9, 0x50, 0xf5, 0x3b,
0x93, 0x1e, 0x61, 0x39, 0x5e, 0x13, 0x4d, 0x44, 0x53, 0x5a, 0x08, 0x00,
0x45, 0x01, 0x00, 0x00, 0x48, 0x41, 0x53, 0x48, 0x20, 0x00, 0x8c, 0x21,
0xc2, 0x17, 0xdb, 0x11, 0x60, 0x26, 0xc3, 0x3a, 0x9c, 0xca, 0x99, 0x09,
0xcd, 0x30, 0xe6, 0x1f, 0x89, 0x56, 0xd9, 0xd2, 0x31, 0x16, 0xb0, 0xe5,
0xfe, 0xfd, 0xa8, 0x05, 0x6d, 0x0f, 0x4d, 0x44, 0x53, 0x5a, 0x08, 0x00,
0xb0, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x46, 0x46, 0x54,
0x18, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x56, 0x45, 0x52, 0x53, 0x08, 0x00, 0x02, 0x00, 0x01, 0x00,
0x02, 0x00, 0x01, 0x00, 0x45, 0x4e, 0x44, 0x54, 0x84, 0x00, 0x00, 0x00,
0x01, 0x00, 0x02, 0x00, 0x45, 0x4e, 0x44, 0x54, 0x84, 0x00, 0x00, 0x00,
0x4e, 0x41, 0x4d, 0x45, 0x0f, 0x00, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65,
0x6e, 0x74, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x00, 0x54, 0x59, 0x50,
0x45, 0x01, 0x00, 0x01, 0x48, 0x41, 0x53, 0x48, 0x20, 0x00, 0x64, 0x03,
0x95, 0xa0, 0xb2, 0xb6, 0xf0, 0x6a, 0x38, 0x88, 0xc8, 0xf2, 0x8a, 0xf0,
0x28, 0xa2, 0xaf, 0x1f, 0x22, 0x92, 0x93, 0x16, 0x41, 0xe0, 0xb8, 0x2f,
0xdb, 0x87, 0x2d, 0x07, 0x82, 0xac, 0x4d, 0x44, 0x53, 0x5a, 0x08, 0x00,
0x45, 0x01, 0x00, 0x01, 0x48, 0x41, 0x53, 0x48, 0x20, 0x00, 0x83, 0xdf,
0xd1, 0x80, 0x1c, 0xd3, 0x09, 0xdc, 0xb8, 0x16, 0x3c, 0xda, 0x94, 0x8c,
0x6b, 0x54, 0xa7, 0x2b, 0x07, 0xde, 0xec, 0x09, 0xdd, 0xd5, 0x9c, 0xeb,
0x37, 0xeb, 0x91, 0x9e, 0x69, 0xf8, 0x4d, 0x44, 0x53, 0x5a, 0x08, 0x00,
0x10, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x46, 0x46, 0x54,
0x18, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x1f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x56, 0x45, 0x52, 0x53, 0x08, 0x00, 0x02, 0x00, 0x01, 0x00,
0x02, 0x00, 0x01, 0x00, 0x45, 0x4e, 0x44, 0x54, 0x88, 0x00, 0x00, 0x00,
0x01, 0x00, 0x02, 0x00, 0x45, 0x4e, 0x44, 0x54, 0x88, 0x00, 0x00, 0x00,
0x4e, 0x41, 0x4d, 0x45, 0x13, 0x00, 0x70, 0x61, 0x74, 0x68, 0x46, 0x72,
0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72,
0x00, 0x54, 0x59, 0x50, 0x45, 0x01, 0x00, 0x01, 0x48, 0x41, 0x53, 0x48,
0x20, 0x00, 0xf4, 0x99, 0xd0, 0xb6, 0x5f, 0xc9, 0x9d, 0x90, 0xd4, 0x57,
0xb3, 0xdb, 0x47, 0xec, 0xa7, 0x4b, 0x88, 0x9b, 0x79, 0x38, 0xa5, 0x76,
0x01, 0xdb, 0x91, 0xe0, 0x2d, 0x23, 0x0b, 0x4e, 0x81, 0xd6, 0x4d, 0x44,
0x20, 0x00, 0xb7, 0x4c, 0xca, 0x66, 0x47, 0xaf, 0xab, 0x48, 0xe5, 0xf9,
0x12, 0x6d, 0xda, 0x6f, 0x3b, 0x8f, 0x69, 0x0b, 0x68, 0xbb, 0x11, 0xbc,
0x4e, 0xbc, 0xf2, 0x20, 0xdd, 0x28, 0xa6, 0x29, 0x55, 0x89, 0x4d, 0x44,
0x53, 0x5a, 0x08, 0x00, 0xd0, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x4f, 0x46, 0x46, 0x54, 0x18, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x45, 0x52, 0x53, 0x08, 0x00,
0x02, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x45, 0x4e, 0x44, 0x54,
0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x45, 0x4e, 0x44, 0x54,
0x45, 0x4e, 0x44, 0x54, 0x04, 0x00, 0x00, 0x00, 0x45, 0x4e, 0x44, 0x54,
0x04, 0x00, 0x00, 0x00, 0x45, 0x4e, 0x44, 0x54, 0x04, 0x00, 0x00, 0x00,
0x45, 0x4e, 0x44, 0x54, 0x04, 0x00, 0x00, 0x00, 0x45, 0x4e, 0x44, 0x54,
Expand Down Expand Up @@ -302,7 +302,7 @@ unsigned char metal_shader[] = {
0x23, 0x08, 0x84, 0x34, 0x82, 0x40, 0x4c, 0x23, 0x08, 0x04, 0x35, 0x82,
0x40, 0x54, 0x23, 0x08, 0x84, 0x35, 0x82, 0x40, 0x5c, 0x33, 0x0c, 0x7c,
0x10, 0xf4, 0xc1, 0x0c, 0x81, 0x30, 0xc3, 0xe0, 0x07, 0x7c, 0xf0, 0x07,
0x33, 0x10, 0x83, 0x1f, 0xf0, 0xc1, 0x1f, 0xcc, 0x10, 0x10, 0x33, 0x04,
0x33, 0x10, 0x03, 0x1f, 0xf8, 0xc1, 0x1f, 0xcc, 0x10, 0x10, 0x33, 0x04,
0xc5, 0x0c, 0x81, 0x31, 0x43, 0x70, 0xcc, 0x50, 0x20, 0x89, 0xb2, 0x30,
0x33, 0x18, 0x8d, 0x93, 0x28, 0xcb, 0x33, 0x83, 0xd1, 0x40, 0x49, 0xb4,
0x48, 0x33, 0x18, 0xcd, 0x94, 0x28, 0x0b, 0x35, 0x83, 0xd1, 0x54, 0x89,
Expand Down Expand Up @@ -641,7 +641,7 @@ unsigned char metal_shader[] = {
0x23, 0x08, 0x84, 0x32, 0x82, 0x40, 0x2c, 0x23, 0x08, 0x04, 0x33, 0x82,
0x40, 0x34, 0x23, 0x08, 0x84, 0x33, 0x82, 0x40, 0x3c, 0x33, 0x0c, 0x6c,
0x10, 0xb4, 0xc1, 0x0c, 0x81, 0x30, 0xc3, 0xe0, 0x06, 0x6c, 0xf0, 0x06,
0x33, 0x10, 0x83, 0x1b, 0xb0, 0xc1, 0x1b, 0xcc, 0x10, 0x10, 0x33, 0x04,
0x33, 0x10, 0x03, 0x1b, 0xb8, 0xc1, 0x1b, 0xcc, 0x10, 0x10, 0x33, 0x04,
0xc5, 0x0c, 0x81, 0x31, 0x43, 0x70, 0xcc, 0x50, 0x20, 0x89, 0xb2, 0x30,
0x33, 0x18, 0x8d, 0x93, 0x28, 0xcb, 0x33, 0x83, 0xd1, 0x40, 0x49, 0xb4,
0x48, 0x33, 0x18, 0xcd, 0x94, 0x44, 0x0b, 0x35, 0x03, 0x31, 0x0a, 0xa4,
Expand Down Expand Up @@ -1374,7 +1374,7 @@ unsigned char metal_shader[] = {
0x0a, 0x23, 0x08, 0x09, 0x2b, 0x8c, 0x20, 0x24, 0xad, 0x30, 0x82, 0x10,
0x00, 0x23, 0x08, 0x80, 0x1c, 0x8c, 0x20, 0x08, 0xae, 0x30, 0xc3, 0x50,
0x0a, 0x81, 0x29, 0xcc, 0x10, 0x08, 0x33, 0x0c, 0xa7, 0x50, 0x0a, 0xa8,
0x30, 0x03, 0x31, 0x9c, 0x42, 0x29, 0xa0, 0xc2, 0x0c, 0x01, 0x31, 0x43,
0x30, 0x03, 0x31, 0x94, 0xc2, 0x29, 0xa0, 0xc2, 0x0c, 0x01, 0x31, 0x43,
0x50, 0xcc, 0x10, 0x18, 0x33, 0x04, 0xc7, 0x0c, 0x05, 0x82, 0x0a, 0xa8,
0x90, 0x28, 0x33, 0x04, 0xe7, 0x30, 0x03, 0x82, 0x0a, 0x0b, 0xd3, 0x24,
0x8a, 0xf3, 0xcc, 0x90, 0x94, 0x02, 0x14, 0x31, 0x52, 0xa2, 0x38, 0xd3,
Expand Down Expand Up @@ -3125,7 +3125,7 @@ unsigned char metal_shader[] = {
0x23, 0x08, 0xc7, 0x36, 0x82, 0x70, 0x70, 0x23, 0x08, 0x47, 0x37, 0x82,
0x70, 0x78, 0x23, 0x08, 0xc7, 0x37, 0x82, 0x40, 0x06, 0x60, 0x30, 0xc3,
0xc0, 0x06, 0x41, 0x1b, 0xcc, 0x10, 0x08, 0x33, 0x0c, 0x6e, 0xc0, 0x06,
0x6f, 0x30, 0x03, 0x31, 0xb8, 0x01, 0x1b, 0xbc, 0xc1, 0x0c, 0x01, 0x31,
0x6f, 0x30, 0x03, 0x31, 0xb0, 0x81, 0x1b, 0xbc, 0xc1, 0x0c, 0x01, 0x31,
0x43, 0x50, 0xcc, 0x10, 0x18, 0x33, 0x04, 0xc7, 0x0c, 0x05, 0xf2, 0x06,
0x6f, 0x90, 0x28, 0x33, 0x04, 0xa3, 0x30, 0x03, 0xf2, 0x06, 0x0b, 0xd3,
0x24, 0x8a, 0xf3, 0xcc, 0x90, 0xb0, 0x01, 0x14, 0x31, 0x52, 0xa2, 0x38,
Expand Down
2 changes: 1 addition & 1 deletion shaders/metal/util/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ rm -f metal_shader
rm -f obj.air

# Compile metal shader to intermediate IR (air)
xcrun -sdk macosx metal -c ../src/Shaders.metal -o obj.air
xcrun -sdk macosx metal -std=osx-metal1.2 -c ../src/Shaders.metal -o obj.air

# Archive air file into metallib format
xcrun -sdk macosx metallib obj.air -o metal_shader
Expand Down

0 comments on commit 928533c

Please sign in to comment.