@@ -60,6 +60,7 @@ def FuncExtKhrLocalInt32ExtendedAtomics : FunctionExtension<"cl_khr_local_int32
6060def FuncExtKhrInt64BaseAtomics : FunctionExtension<"cl_khr_int64_base_atomics">;
6161def FuncExtKhrInt64ExtendedAtomics : FunctionExtension<"cl_khr_int64_extended_atomics">;
6262def FuncExtKhrMipmapImage : FunctionExtension<"cl_khr_mipmap_image">;
63+ def FuncExtKhrGlMsaaSharing : FunctionExtension<"cl_khr_gl_msaa_sharing">;
6364
6465// Multiple extensions
6566def FuncExtKhrMipmapAndWrite3d : FunctionExtension<"cl_khr_mipmap_image cl_khr_3d_image_writes">;
@@ -1312,3 +1313,39 @@ let Extension = FuncExtKhrMipmapImage in {
13121313 }
13131314 }
13141315}
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