@@ -60,6 +60,7 @@ def FuncExtKhrLocalInt32ExtendedAtomics : FunctionExtension<"cl_khr_local_int32
60
60
def FuncExtKhrInt64BaseAtomics : FunctionExtension<"cl_khr_int64_base_atomics">;
61
61
def FuncExtKhrInt64ExtendedAtomics : FunctionExtension<"cl_khr_int64_extended_atomics">;
62
62
def FuncExtKhrMipmapImage : FunctionExtension<"cl_khr_mipmap_image">;
63
+ def FuncExtKhrGlMsaaSharing : FunctionExtension<"cl_khr_gl_msaa_sharing">;
63
64
64
65
// Multiple extensions
65
66
def FuncExtKhrMipmapAndWrite3d : FunctionExtension<"cl_khr_mipmap_image cl_khr_3d_image_writes">;
@@ -1312,3 +1313,39 @@ let Extension = FuncExtKhrMipmapImage in {
1312
1313
}
1313
1314
}
1314
1315
}
1316
+
1317
+
1318
+ //--------------------------------------------------------------------
1319
+ // OpenCL Extension v2.0 s18.3 - Creating OpenCL Memory Objects from OpenGL MSAA Textures
1320
+ let Extension = FuncExtKhrGlMsaaSharing in {
1321
+ // --- Table 6.13.14.3 ---
1322
+ foreach aQual = ["RO", "RW"] in {
1323
+ foreach imgTy = [Image2dMsaa] in {
1324
+ def : Builtin<"read_imagef", [VectorType<Float, 4>, ImageType<imgTy, aQual>, VectorType<Int, 2>, Int], Attr.Pure>;
1325
+ def : Builtin<"read_imagei", [VectorType<Int, 4>, ImageType<imgTy, aQual>, VectorType<Int, 2>, Int], Attr.Pure>;
1326
+ def : Builtin<"read_imageui", [VectorType<UInt, 4>, ImageType<imgTy, aQual>, VectorType<Int, 2>, Int], Attr.Pure>;
1327
+ }
1328
+ foreach imgTy = [Image2dArrayMsaa] in {
1329
+ def : Builtin<"read_imagef", [VectorType<Float, 4>, ImageType<imgTy, aQual>, VectorType<Int, 4>, Int], Attr.Pure>;
1330
+ def : Builtin<"read_imagei", [VectorType<Int, 4>, ImageType<imgTy, aQual>, VectorType<Int, 4>, Int], Attr.Pure>;
1331
+ def : Builtin<"read_imageui", [VectorType<UInt, 4>, ImageType<imgTy, aQual>, VectorType<Int, 4>, Int], Attr.Pure>;
1332
+ }
1333
+ foreach name = ["read_imagef"] in {
1334
+ def : Builtin<name, [Float, ImageType<Image2dMsaaDepth, aQual>, VectorType<Int, 2>, Int], Attr.Pure>;
1335
+ def : Builtin<name, [Float, ImageType<Image2dArrayMsaaDepth, aQual>, VectorType<Int, 4>, Int], Attr.Pure>;
1336
+ }
1337
+ }
1338
+
1339
+ // --- Table 6.13.14.5 ---
1340
+ foreach aQual = ["RO", "WO", "RW"] in {
1341
+ foreach imgTy = [Image2dMsaa, Image2dArrayMsaa, Image2dMsaaDepth, Image2dArrayMsaaDepth] in {
1342
+ foreach name = ["get_image_width", "get_image_height",
1343
+ "get_image_channel_data_type", "get_image_channel_order",
1344
+ "get_image_num_samples"] in {
1345
+ def : Builtin<name, [Int, ImageType<imgTy, aQual>], Attr.Const>;
1346
+ }
1347
+ def : Builtin<"get_image_dim", [VectorType<Int, 2>, ImageType<imgTy, aQual>], Attr.Const>;
1348
+ }
1349
+ def : Builtin<"get_image_array_size", [Size, ImageType<Image2dArrayMsaaDepth, aQual>], Attr.Const>;
1350
+ }
1351
+ }
0 commit comments