diff --git a/include/dxc/dxcapi.internal.h b/include/dxc/dxcapi.internal.h index 7a8d5204e5..6dbb899376 100644 --- a/include/dxc/dxcapi.internal.h +++ b/include/dxc/dxcapi.internal.h @@ -147,7 +147,9 @@ enum LEGAL_INTRINSIC_COMPTYPES { LICOMPTYPE_VK_SAMPLED_TEXTURE2DMS = 61, LICOMPTYPE_VK_SAMPLED_TEXTURE2DMS_ARRAY = 62, LICOMPTYPE_VK_SAMPLED_TEXTURE3D = 63, - LICOMPTYPE_COUNT = 64 + LICOMPTYPE_VK_SAMPLED_TEXTURECUBE = 64, + LICOMPTYPE_VK_SAMPLED_TEXTURECUBE_ARRAY = 65, + LICOMPTYPE_COUNT = 66 #else LICOMPTYPE_COUNT = 56 #endif diff --git a/tools/clang/lib/SPIRV/LowerTypeVisitor.cpp b/tools/clang/lib/SPIRV/LowerTypeVisitor.cpp index 4718c88f35..4c06cd4113 100644 --- a/tools/clang/lib/SPIRV/LowerTypeVisitor.cpp +++ b/tools/clang/lib/SPIRV/LowerTypeVisitor.cpp @@ -866,7 +866,10 @@ const SpirvType *LowerTypeVisitor::lowerVkTypeInVkNamespace( const spv::Dim dimension = suffix.startswith("1D") ? spv::Dim::Dim1D - : (suffix.startswith("2D") ? spv::Dim::Dim2D : spv::Dim::Dim3D); + : (suffix.startswith("2D") + ? spv::Dim::Dim2D + : (suffix.startswith("3D") ? spv::Dim::Dim3D + : spv::Dim::Cube)); const bool isArray = suffix.endswith("Array"); const bool isMS = suffix.find("MS") != StringRef::npos; diff --git a/tools/clang/lib/SPIRV/SpirvEmitter.cpp b/tools/clang/lib/SPIRV/SpirvEmitter.cpp index 049139af11..936359e25c 100644 --- a/tools/clang/lib/SPIRV/SpirvEmitter.cpp +++ b/tools/clang/lib/SPIRV/SpirvEmitter.cpp @@ -4417,6 +4417,8 @@ SpirvEmitter::processBufferTextureGetDimensions(const CXXMemberCallExpr *expr) { (typeName == "SampledTexture1DArray" && numArgs > 2) || (typeName == "SampledTexture2D" && numArgs > 2) || (typeName == "SampledTexture2DArray" && numArgs > 3) || + (typeName == "SampledTextureCUBE" && numArgs > 2) || + (typeName == "SampledTextureCUBEArray" && numArgs > 3) || (typeName == "SampledTexture3D" && numArgs > 3) || (typeName == "TextureCube" && numArgs > 2) || (typeName == "Texture3D" && numArgs > 3) || diff --git a/tools/clang/lib/Sema/SemaHLSL.cpp b/tools/clang/lib/Sema/SemaHLSL.cpp index ae40bcd618..9c5628a2c1 100644 --- a/tools/clang/lib/Sema/SemaHLSL.cpp +++ b/tools/clang/lib/Sema/SemaHLSL.cpp @@ -206,6 +206,8 @@ enum ArBasicKind { AR_OBJECT_VK_SAMPLED_TEXTURE2D_ARRAY, AR_OBJECT_VK_SAMPLED_TEXTURE2DMS, AR_OBJECT_VK_SAMPLED_TEXTURE2DMS_ARRAY, + AR_OBJECT_VK_SAMPLED_TEXTURECUBE, + AR_OBJECT_VK_SAMPLED_TEXTURECUBE_ARRAY, AR_OBJECT_VK_SAMPLED_TEXTURE3D, #endif // ENABLE_SPIRV_CODEGEN // SPIRV change ends @@ -573,6 +575,8 @@ const UINT g_uBasicKindProps[] = { BPROP_OBJECT | BPROP_RBUFFER, // AR_OBJECT_VK_SAMPLED_TEXTURE2D_ARRAY BPROP_OBJECT | BPROP_RBUFFER, // AR_OBJECT_VK_SAMPLED_TEXTURE2DMS BPROP_OBJECT | BPROP_RBUFFER, // AR_OBJECT_VK_SAMPLED_TEXTURE2DMS_ARRAY + BPROP_OBJECT | BPROP_RBUFFER, // AR_OBJECT_VK_SAMPLED_TEXTURECUBE + BPROP_OBJECT | BPROP_RBUFFER, // AR_OBJECT_VK_SAMPLED_TEXTURECUBE_ARRAY BPROP_OBJECT | BPROP_RBUFFER, // AR_OBJECT_VK_SAMPLED_TEXTURE3D #endif // ENABLE_SPIRV_CODEGEN // SPIRV change ends @@ -1294,6 +1298,10 @@ static const ArBasicKind g_VKSampledTexture2DMSCT[] = { AR_OBJECT_VK_SAMPLED_TEXTURE2DMS, AR_BASIC_UNKNOWN}; static const ArBasicKind g_VKSampledTexture2DMSArrayCT[] = { AR_OBJECT_VK_SAMPLED_TEXTURE2DMS_ARRAY, AR_BASIC_UNKNOWN}; +static const ArBasicKind g_VKSampledTextureCUBECT[] = { + AR_OBJECT_VK_SAMPLED_TEXTURECUBE, AR_BASIC_UNKNOWN}; +static const ArBasicKind g_VKSampledTextureCUBEArrayCT[] = { + AR_OBJECT_VK_SAMPLED_TEXTURECUBE_ARRAY, AR_BASIC_UNKNOWN}; static const ArBasicKind g_VKSampledTexture3DCT[] = { AR_OBJECT_VK_SAMPLED_TEXTURE3D, AR_BASIC_UNKNOWN}; #endif @@ -1365,6 +1373,8 @@ const ArBasicKind *g_LegalIntrinsicCompTypes[] = { g_VKSampledTexture2DArrayCT, // LICOMPTYPE_VK_SAMPLED_TEXTURE2D_ARRAY g_VKSampledTexture2DMSCT, // LICOMPTYPE_VK_SAMPLED_TEXTURE2DMS g_VKSampledTexture2DMSArrayCT, // LICOMPTYPE_VK_SAMPLED_TEXTURE2DMS_ARRAY + g_VKSampledTextureCUBECT, // LICOMPTYPE_VK_SAMPLED_TEXTURECUBE + g_VKSampledTextureCUBEArrayCT, // LICOMPTYPE_VK_SAMPLED_TEXTURECUBE_ARRAY g_VKSampledTexture3DCT, // LICOMPTYPE_VK_SAMPLED_TEXTURE3D #endif }; @@ -1428,7 +1438,8 @@ static const ArBasicKind g_ArBasicKindsAsTypes[] = { AR_OBJECT_VK_BUFFER_POINTER, AR_OBJECT_VK_SAMPLED_TEXTURE1D, AR_OBJECT_VK_SAMPLED_TEXTURE1D_ARRAY, AR_OBJECT_VK_SAMPLED_TEXTURE2D, AR_OBJECT_VK_SAMPLED_TEXTURE2D_ARRAY, AR_OBJECT_VK_SAMPLED_TEXTURE2DMS, - AR_OBJECT_VK_SAMPLED_TEXTURE2DMS_ARRAY, AR_OBJECT_VK_SAMPLED_TEXTURE3D, + AR_OBJECT_VK_SAMPLED_TEXTURE2DMS_ARRAY, AR_OBJECT_VK_SAMPLED_TEXTURECUBE, + AR_OBJECT_VK_SAMPLED_TEXTURECUBE_ARRAY, AR_OBJECT_VK_SAMPLED_TEXTURE3D, #endif // ENABLE_SPIRV_CODEGEN // SPIRV change ends @@ -1546,6 +1557,8 @@ static const uint8_t g_ArBasicKindsTemplateCount[] = { 1, // AR_OBJECT_VK_SAMPLED_TEXTURE2D_ARRAY 1, // AR_OBJECT_VK_SAMPLED_TEXTURE2DMS 1, // AR_OBJECT_VK_SAMPLED_TEXTURE2DMS_ARRAY + 1, // AR_OBJECT_VK_SAMPLED_TEXTURECUBE + 1, // AR_OBJECT_VK_SAMPLED_TEXTURECUBE_ARRAY 1, // AR_OBJECT_VK_SAMPLED_TEXTURE3D #endif // ENABLE_SPIRV_CODEGEN // SPIRV change ends @@ -1706,6 +1719,8 @@ static const SubscriptOperatorRecord g_ArBasicKindsSubscripts[] = { {3, MipsTrue, SampleFalse}, // AR_OBJECT_VK_SAMPLED_TEXTURE2D_ARRAY {2, MipsFalse, SampleTrue}, // AR_OBJECT_VK_SAMPLED_TEXTURE2DMS {3, MipsFalse, SampleTrue}, // AR_OBJECT_VK_SAMPLED_TEXTURE2DMS_ARRAY + {0, MipsFalse, SampleFalse}, // AR_OBJECT_VK_SAMPLED_TEXTURECUBE + {0, MipsFalse, SampleFalse}, // AR_OBJECT_VK_SAMPLED_TEXTURECUBE_ARRAY {3, MipsTrue, SampleFalse}, // AR_OBJECT_VK_SAMPLED_TEXTURE3D #endif // ENABLE_SPIRV_CODEGEN // SPIRV change ends @@ -1882,6 +1897,8 @@ static const char *g_ArBasicTypeNames[] = { "SampledTexture2DArray", "SampledTexture2DMS", "SampledTexture2DMSArray", + "SampledTextureCUBE", + "SampledTextureCUBEArray", "SampledTexture3D", #endif // ENABLE_SPIRV_CODEGEN // SPIRV change ends @@ -2563,6 +2580,14 @@ static void GetIntrinsicMethods(ArBasicKind kind, *intrinsics = g_VkSampledTexture2DMSArrayMethods; *intrinsicCount = _countof(g_VkSampledTexture2DMSArrayMethods); break; + case AR_OBJECT_VK_SAMPLED_TEXTURECUBE: + *intrinsics = g_VkSampledTextureCUBEMethods; + *intrinsicCount = _countof(g_VkSampledTextureCUBEMethods); + break; + case AR_OBJECT_VK_SAMPLED_TEXTURECUBE_ARRAY: + *intrinsics = g_VkSampledTextureCUBEArrayMethods; + *intrinsicCount = _countof(g_VkSampledTextureCUBEArrayMethods); + break; case AR_OBJECT_VK_SAMPLED_TEXTURE3D: *intrinsics = g_VkSampledTexture3DMethods; *intrinsicCount = _countof(g_VkSampledTexture3DMethods); @@ -4178,7 +4203,9 @@ class HLSLExternalSource : public ExternalSemaSource { kind == AR_OBJECT_VK_SAMPLED_TEXTURE2D_ARRAY || kind == AR_OBJECT_VK_SAMPLED_TEXTURE2DMS || kind == AR_OBJECT_VK_SAMPLED_TEXTURE2DMS_ARRAY || - kind == AR_OBJECT_VK_SAMPLED_TEXTURE3D) { + kind == AR_OBJECT_VK_SAMPLED_TEXTURE3D || + kind == AR_OBJECT_VK_SAMPLED_TEXTURECUBE || + kind == AR_OBJECT_VK_SAMPLED_TEXTURECUBE_ARRAY) { if (!m_vkNSDecl) continue; QualType float4Type = @@ -5174,10 +5201,16 @@ class HLSLExternalSource : public ExternalSemaSource { ResClass = DXIL::ResourceClass::UAV; return true; case AR_OBJECT_TEXTURECUBE: +#ifdef ENABLE_SPIRV_CODEGEN + case AR_OBJECT_VK_SAMPLED_TEXTURECUBE: +#endif ResKind = DXIL::ResourceKind::TextureCube; ResClass = DXIL::ResourceClass::SRV; return true; case AR_OBJECT_TEXTURECUBE_ARRAY: +#ifdef ENABLE_SPIRV_CODEGEN + case AR_OBJECT_VK_SAMPLED_TEXTURECUBE_ARRAY: +#endif ResKind = DXIL::ResourceKind::TextureCubeArray; ResClass = DXIL::ResourceClass::SRV; return true; diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.calculate-lod-unclamped.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.calculate-lod-unclamped.hlsl new file mode 100644 index 0000000000..acbedbdbd8 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.calculate-lod-unclamped.hlsl @@ -0,0 +1,17 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability ImageQuery +// CHECK: [[type_cube_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 0 0 1 Unknown +// CHECK: [[type_cube_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_image]] + +vk::SampledTextureCUBE tex; + +void main() { + float3 xyz = float3(0.5, 0.25, 0.75); + +// CHECK: [[tex_load:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[xyz_load:%[a-zA-Z0-9_]+]] = OpLoad %v3float %xyz +// CHECK: [[lod_query:%[a-zA-Z0-9_]+]] = OpImageQueryLod %v2float [[tex_load]] [[xyz_load]] +// CHECK: {{%[0-9]+}} = OpCompositeExtract %float [[lod_query]] 1 + float lod = tex.CalculateLevelOfDetailUnclamped(xyz); +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.calculate-lod.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.calculate-lod.hlsl new file mode 100644 index 0000000000..44fa10a0f7 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.calculate-lod.hlsl @@ -0,0 +1,17 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability ImageQuery +// CHECK: [[type_cube_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 0 0 1 Unknown +// CHECK: [[type_cube_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_image]] + +vk::SampledTextureCUBE tex; + +void main() { + float3 xyz = float3(0.5, 0.25, 0.75); + +// CHECK: [[tex_load:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[xyz_load:%[a-zA-Z0-9_]+]] = OpLoad %v3float %xyz +// CHECK: [[lod_query:%[a-zA-Z0-9_]+]] = OpImageQueryLod %v2float [[tex_load]] [[xyz_load]] +// CHECK: {{%[0-9]+}} = OpCompositeExtract %float [[lod_query]] 0 + float lod = tex.CalculateLevelOfDetail(xyz); +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-alpha.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-alpha.hlsl new file mode 100644 index 0000000000..61ad86723a --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-alpha.hlsl @@ -0,0 +1,24 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability SparseResidency + +// CHECK: [[v3fc:%[0-9]+]] = OpConstantComposite %v3float %float_0_5 %float_0_25 %float_0_75 +// CHECK: [[type_cube_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 0 0 1 Unknown +// CHECK: [[type_cube_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_image]] + +vk::SampledTextureCUBE texf4; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %texf4 +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageGather %v4float [[tex0]] [[v3fc]] %int_3 None + float4 a = texf4.GatherAlpha(float3(0.5, 0.25, 0.75)); + + uint status; +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %texf4 +// CHECK: [[b_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseGather %SparseResidencyStruct [[tex1]] [[v3fc]] %int_3 None +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[b_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float4 b = texf4.GatherAlpha(float3(0.5, 0.25, 0.75), status); + + return a + b; +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-blue.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-blue.hlsl new file mode 100644 index 0000000000..8aa7eb33cd --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-blue.hlsl @@ -0,0 +1,24 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability SparseResidency + +// CHECK: [[v3fc:%[0-9]+]] = OpConstantComposite %v3float %float_0_5 %float_0_25 %float_0_75 +// CHECK: [[type_cube_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 0 0 1 Unknown +// CHECK: [[type_cube_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_image]] + +vk::SampledTextureCUBE texf4; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %texf4 +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageGather %v4float [[tex0]] [[v3fc]] %int_2 None + float4 a = texf4.GatherBlue(float3(0.5, 0.25, 0.75)); + + uint status; +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %texf4 +// CHECK: [[b_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseGather %SparseResidencyStruct [[tex1]] [[v3fc]] %int_2 None +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[b_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float4 b = texf4.GatherBlue(float3(0.5, 0.25, 0.75), status); + + return a + b; +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-cmp-alpha.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-cmp-alpha.hlsl new file mode 100644 index 0000000000..365a31b68d --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-cmp-alpha.hlsl @@ -0,0 +1,13 @@ +// RUN: not %dxc -T ps_6_8 -E main -fcgl %s -spirv 2>&1 | FileCheck %s + +vk::SampledTextureCUBE tex; + +float4 main() : SV_Target { + float4 a = tex.GatherCmpAlpha(float3(0.5, 0.25, 0.75), 0.25f); + uint status; + float4 b = tex.GatherCmpAlpha(float3(0.5, 0.25, 0.75), 0.25f, status); + return a + b; +} + +// CHECK: error: no equivalent for GatherCmpAlpha intrinsic method in Vulkan +// CHECK: error: no equivalent for GatherCmpAlpha intrinsic method in Vulkan diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-cmp-blue.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-cmp-blue.hlsl new file mode 100644 index 0000000000..aa41bb3a0e --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-cmp-blue.hlsl @@ -0,0 +1,13 @@ +// RUN: not %dxc -T ps_6_8 -E main -fcgl %s -spirv 2>&1 | FileCheck %s + +vk::SampledTextureCUBE tex; + +float4 main() : SV_Target { + float4 a = tex.GatherCmpBlue(float3(0.5, 0.25, 0.75), 0.25f); + uint status; + float4 b = tex.GatherCmpBlue(float3(0.5, 0.25, 0.75), 0.25f, status); + return a + b; +} + +// CHECK: error: no equivalent for GatherCmpBlue intrinsic method in Vulkan +// CHECK: error: no equivalent for GatherCmpBlue intrinsic method in Vulkan diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-cmp-green.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-cmp-green.hlsl new file mode 100644 index 0000000000..fc2d7b36bc --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-cmp-green.hlsl @@ -0,0 +1,13 @@ +// RUN: not %dxc -T ps_6_8 -E main -fcgl %s -spirv 2>&1 | FileCheck %s + +vk::SampledTextureCUBE tex; + +float4 main() : SV_Target { + float4 a = tex.GatherCmpGreen(float3(0.5, 0.25, 0.75), 0.25f); + uint status; + float4 b = tex.GatherCmpGreen(float3(0.5, 0.25, 0.75), 0.25f, status); + return a + b; +} + +// CHECK: error: no equivalent for GatherCmpGreen intrinsic method in Vulkan +// CHECK: error: no equivalent for GatherCmpGreen intrinsic method in Vulkan diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-cmp-red.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-cmp-red.hlsl new file mode 100644 index 0000000000..0e06b01bff --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-cmp-red.hlsl @@ -0,0 +1,24 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability SparseResidency + +// CHECK: [[v3fc:%[0-9]+]] = OpConstantComposite %v3float %float_0_5 %float_0_25 %float_0_75 +// CHECK: [[type_cube_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 0 0 1 Unknown +// CHECK: [[type_cube_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_image]] + +vk::SampledTextureCUBE tex; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageDrefGather %v4float [[tex0]] [[v3fc]] %float_0_25 None + float4 a = tex.GatherCmpRed(float3(0.5, 0.25, 0.75), 0.25f); + + uint status; +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[b_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseDrefGather %SparseResidencyStruct [[tex1]] [[v3fc]] %float_0_25 None +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[b_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float4 b = tex.GatherCmpRed(float3(0.5, 0.25, 0.75), 0.25f, status); + + return a + b; +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-cmp.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-cmp.hlsl new file mode 100644 index 0000000000..6887bf6975 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-cmp.hlsl @@ -0,0 +1,24 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability SparseResidency + +// CHECK: [[v3fc:%[0-9]+]] = OpConstantComposite %v3float %float_0_5 %float_0_25 %float_0_75 +// CHECK: [[type_cube_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 0 0 1 Unknown +// CHECK: [[type_cube_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_image]] + +vk::SampledTextureCUBE tex; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageDrefGather %v4float [[tex0]] [[v3fc]] %float_0_25 None + float4 a = tex.GatherCmp(float3(0.5, 0.25, 0.75), 0.25f); + + uint status; +// CHECK: [[tex5:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[f_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseDrefGather %SparseResidencyStruct [[tex5]] [[v3fc]] %float_0_25 None +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[f_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float4 f = tex.GatherCmp(float3(0.5, 0.25, 0.75), 0.25f, status); + + return a + f; +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-green.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-green.hlsl new file mode 100644 index 0000000000..0377385d78 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-green.hlsl @@ -0,0 +1,24 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability SparseResidency + +// CHECK: [[v3fc:%[0-9]+]] = OpConstantComposite %v3float %float_0_5 %float_0_25 %float_0_75 +// CHECK: [[type_cube_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 0 0 1 Unknown +// CHECK: [[type_cube_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_image]] + +vk::SampledTextureCUBE texf4; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %texf4 +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageGather %v4float [[tex0]] [[v3fc]] %int_1 None + float4 a = texf4.GatherGreen(float3(0.5, 0.25, 0.75)); + + uint status; +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %texf4 +// CHECK: [[b_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseGather %SparseResidencyStruct [[tex1]] [[v3fc]] %int_1 None +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[b_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float4 b = texf4.GatherGreen(float3(0.5, 0.25, 0.75), status); + + return a + b; +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-red.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-red.hlsl new file mode 100644 index 0000000000..6b84a81d7f --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather-red.hlsl @@ -0,0 +1,24 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability SparseResidency + +// CHECK: [[v3fc:%[0-9]+]] = OpConstantComposite %v3float %float_0_5 %float_0_25 %float_0_75 +// CHECK: [[type_cube_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 0 0 1 Unknown +// CHECK: [[type_cube_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_image]] + +vk::SampledTextureCUBE texf4; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %texf4 +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageGather %v4float [[tex0]] [[v3fc]] %int_0 None + float4 a = texf4.GatherRed(float3(0.5, 0.25, 0.75)); + + uint status; +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %texf4 +// CHECK: [[b_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseGather %SparseResidencyStruct [[tex1]] [[v3fc]] %int_0 None +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[b_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float4 b = texf4.GatherRed(float3(0.5, 0.25, 0.75), status); + + return a + b; +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather.hlsl new file mode 100644 index 0000000000..1f746b6228 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.gather.hlsl @@ -0,0 +1,31 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability SparseResidency + +// CHECK: [[v3fc:%[0-9]+]] = OpConstantComposite %v3float %float_0_5 %float_0_25 %float_0_75 +// CHECK: [[type_cube_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 0 0 1 Unknown +// CHECK: [[type_cube_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_image]] +// CHECK: [[type_cube_image_uint:%[a-zA-Z0-9_]+]] = OpTypeImage %uint Cube 0 0 0 1 Unknown +// CHECK: [[type_cube_sampled_uint:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_image_uint]] + +vk::SampledTextureCUBE texf4; +vk::SampledTextureCUBE texu; + +float4 main() : SV_Target { +// CHECK: [[texf4_0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %texf4 +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageGather %v4float [[texf4_0]] [[v3fc]] %int_0 None + float4 a = texf4.Gather(float3(0.5, 0.25, 0.75)); + +// CHECK: [[texu_0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled_uint]] %texu +// CHECK: [[b:%[a-zA-Z0-9_]+]] = OpImageGather %v4uint [[texu_0]] [[v3fc]] %int_0 None + uint4 b = texu.Gather(float3(0.5, 0.25, 0.75)); + + uint status; +// CHECK: [[texf4_1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %texf4 +// CHECK: [[c_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseGather %SparseResidencyStruct [[texf4_1]] [[v3fc]] %int_0 None +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[c_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float4 c = texf4.Gather(float3(0.5, 0.25, 0.75), status); + + return a + c + float4(b); +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.get-dimensions.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.get-dimensions.hlsl new file mode 100644 index 0000000000..929ef58710 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.get-dimensions.hlsl @@ -0,0 +1,40 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability ImageQuery + +// CHECK: [[type_cube_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 0 0 1 Unknown +// CHECK: [[type_cube_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_image]] + +vk::SampledTextureCUBE tex; + +void main() { + uint mip = 1; + uint w, h, levels; + float fw, fh, flevels; + +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[img0:%[a-zA-Z0-9_]+]] = OpImage [[type_cube_image]] [[tex0]] +// CHECK: [[q0:%[a-zA-Z0-9_]+]] = OpImageQuerySizeLod %v2uint [[img0]] %int_0 + tex.GetDimensions(w, h); + +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[img1:%[a-zA-Z0-9_]+]] = OpImage [[type_cube_image]] [[tex1]] +// CHECK: [[mip_load:%[a-zA-Z0-9_]+]] = OpLoad %uint %mip +// CHECK: [[q1:%[a-zA-Z0-9_]+]] = OpImageQuerySizeLod %v2uint [[img1]] [[mip_load]] +// CHECK: [[q1_levels:%[a-zA-Z0-9_]+]] = OpImageQueryLevels %uint [[img1]] + tex.GetDimensions(mip, w, h, levels); + +// CHECK: [[tex2:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[img2:%[a-zA-Z0-9_]+]] = OpImage [[type_cube_image]] [[tex2]] +// CHECK: [[q2:%[a-zA-Z0-9_]+]] = OpImageQuerySizeLod %v2uint [[img2]] %int_0 +// CHECK: OpConvertUToF %float + tex.GetDimensions(fw, fh); + +// CHECK: [[tex3:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[img3:%[a-zA-Z0-9_]+]] = OpImage [[type_cube_image]] [[tex3]] +// CHECK: [[mip_load_1:%[a-zA-Z0-9_]+]] = OpLoad %uint %mip +// CHECK: [[q3:%[a-zA-Z0-9_]+]] = OpImageQuerySizeLod %v2uint [[img3]] [[mip_load_1]] +// CHECK: [[q3_levels:%[a-zA-Z0-9_]+]] = OpImageQueryLevels %uint [[img3]] +// CHECK: OpConvertUToF %float + tex.GetDimensions(mip, fw, fh, flevels); +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample-bias.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample-bias.hlsl new file mode 100644 index 0000000000..6f5f3d1b4c --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample-bias.hlsl @@ -0,0 +1,28 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability MinLod +// CHECK: OpCapability SparseResidency + +// CHECK: [[v3fc:%[0-9]+]] = OpConstantComposite %v3float %float_0_5 %float_0_25 %float_0_75 +// CHECK: [[type_cube_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 0 0 1 Unknown +// CHECK: [[type_cube_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_image]] + +vk::SampledTextureCUBE tex; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageSampleImplicitLod %v4float [[tex0]] [[v3fc]] Bias %float_1 + float4 a = tex.SampleBias(float3(0.5, 0.25, 0.75), 1.0f); + +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[b:%[a-zA-Z0-9_]+]] = OpImageSampleImplicitLod %v4float [[tex1]] [[v3fc]] Bias|MinLod %float_1 %float_0_5 + float4 b = tex.SampleBias(float3(0.5, 0.25, 0.75), 1.0f, 0.5f); + + uint status; +// CHECK: [[tex2:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[c_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseSampleImplicitLod %SparseResidencyStruct [[tex2]] [[v3fc]] Bias|MinLod %float_1 %float_0_5 +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[c_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float4 c = tex.SampleBias(float3(0.5, 0.25, 0.75), 1.0f, 0.5f, status); + return a + b + c; +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample-cmp-bias.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample-cmp-bias.hlsl new file mode 100644 index 0000000000..4c05fe5bc0 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample-cmp-bias.hlsl @@ -0,0 +1,28 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability MinLod +// CHECK: OpCapability SparseResidency + +// CHECK: [[v3fc:%[0-9]+]] = OpConstantComposite %v3float %float_0_5 %float_0_25 %float_0_75 +// CHECK: [[type_cube_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 0 0 1 Unknown +// CHECK: [[type_cube_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_image]] + +vk::SampledTextureCUBE tex; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageSampleDrefImplicitLod %float [[tex0]] [[v3fc]] %float_0_25 Bias %float_1 + float a = tex.SampleCmpBias(float3(0.5, 0.25, 0.75), 0.25f, 1.0f); + +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[b:%[a-zA-Z0-9_]+]] = OpImageSampleDrefImplicitLod %float [[tex1]] [[v3fc]] %float_0_25 Bias|MinLod %float_1 %float_0_5 + float b = tex.SampleCmpBias(float3(0.5, 0.25, 0.75), 0.25f, 1.0f, 0.5f); + + uint status; +// CHECK: [[tex2:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[c_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseSampleDrefImplicitLod %SparseResidencyStruct [[tex2]] [[v3fc]] %float_0_25 Bias|MinLod %float_1 %float_0_5 +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[c_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float c = tex.SampleCmpBias(float3(0.5, 0.25, 0.75), 0.25f, 1.0f, 0.5f, status); + return float4(a + b + c, 0, 0, 1); +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample-cmp-grad.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample-cmp-grad.hlsl new file mode 100644 index 0000000000..0792f0c58e --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample-cmp-grad.hlsl @@ -0,0 +1,37 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability MinLod +// CHECK: OpCapability SparseResidency + +// CHECK: [[v3fc:%[0-9]+]] = OpConstantComposite %v3float %float_0_5 %float_0_25 %float_0_75 +// CHECK: [[type_cube_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 0 0 1 Unknown +// CHECK: [[type_cube_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_image]] + +vk::SampledTextureCUBE tex; + +float4 main() : SV_Target { + float3 ddx = float3(1.0, 1.0, 1.0); + float3 ddy = float3(2.0, 2.0, 2.0); + +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[ddx_load:%[a-zA-Z0-9_]+]] = OpLoad %v3float %ddx +// CHECK: [[ddy_load:%[a-zA-Z0-9_]+]] = OpLoad %v3float %ddy +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageSampleDrefExplicitLod %float [[tex0]] [[v3fc]] %float_0_25 Grad [[ddx_load]] [[ddy_load]] + float a = tex.SampleCmpGrad(float3(0.5, 0.25, 0.75), 0.25f, ddx, ddy); + +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[ddx_load_1:%[a-zA-Z0-9_]+]] = OpLoad %v3float %ddx +// CHECK: [[ddy_load_1:%[a-zA-Z0-9_]+]] = OpLoad %v3float %ddy +// CHECK: [[b:%[a-zA-Z0-9_]+]] = OpImageSampleDrefExplicitLod %float [[tex1]] [[v3fc]] %float_0_25 Grad|MinLod [[ddx_load_1]] [[ddy_load_1]] %float_0_5 + float b = tex.SampleCmpGrad(float3(0.5, 0.25, 0.75), 0.25f, ddx, ddy, 0.5f); + + uint status; +// CHECK: [[tex2:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[ddx_load_2:%[a-zA-Z0-9_]+]] = OpLoad %v3float %ddx +// CHECK: [[ddy_load_2:%[a-zA-Z0-9_]+]] = OpLoad %v3float %ddy +// CHECK: [[c_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseSampleDrefExplicitLod %SparseResidencyStruct [[tex2]] [[v3fc]] %float_0_25 Grad|MinLod [[ddx_load_2]] [[ddy_load_2]] %float_0_5 +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[c_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float c = tex.SampleCmpGrad(float3(0.5, 0.25, 0.75), 0.25f, ddx, ddy, 0.5f, status); + return float4(a + b + c, 0, 0, 1); +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample-cmp-level-zero.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample-cmp-level-zero.hlsl new file mode 100644 index 0000000000..cc6189b5fb --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample-cmp-level-zero.hlsl @@ -0,0 +1,23 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability SparseResidency + +// CHECK: [[v3fc:%[0-9]+]] = OpConstantComposite %v3float %float_0_5 %float_0_25 %float_0_75 +// CHECK: [[type_cube_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 0 0 1 Unknown +// CHECK: [[type_cube_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_image]] + +vk::SampledTextureCUBE tex; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageSampleDrefExplicitLod %float [[tex0]] [[v3fc]] %float_0_25 Lod %float_0 + float a = tex.SampleCmpLevelZero(float3(0.5, 0.25, 0.75), 0.25f); + + uint status; +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[b_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseSampleDrefExplicitLod %SparseResidencyStruct [[tex1]] [[v3fc]] %float_0_25 Lod %float_0 +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[b_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float b = tex.SampleCmpLevelZero(float3(0.5, 0.25, 0.75), 0.25f, status); + return float4(a + b, 0, 0, 1); +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample-cmp-level.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample-cmp-level.hlsl new file mode 100644 index 0000000000..b72fa08521 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample-cmp-level.hlsl @@ -0,0 +1,23 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability SparseResidency + +// CHECK: [[v3fc:%[0-9]+]] = OpConstantComposite %v3float %float_0_5 %float_0_25 %float_0_75 +// CHECK: [[type_cube_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 0 0 1 Unknown +// CHECK: [[type_cube_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_image]] + +vk::SampledTextureCUBE tex; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageSampleDrefExplicitLod %float [[tex0]] [[v3fc]] %float_0_25 Lod %float_2 + float a = tex.SampleCmpLevel(float3(0.5, 0.25, 0.75), 0.25f, 2.0f); + + uint status; +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[b_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseSampleDrefExplicitLod %SparseResidencyStruct [[tex1]] [[v3fc]] %float_0_25 Lod %float_2 +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[b_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float b = tex.SampleCmpLevel(float3(0.5, 0.25, 0.75), 0.25f, 2.0f, status); + return float4(a + b, 0, 0, 1); +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample-cmp.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample-cmp.hlsl new file mode 100644 index 0000000000..64737fc3b4 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample-cmp.hlsl @@ -0,0 +1,28 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability MinLod +// CHECK: OpCapability SparseResidency + +// CHECK: [[v3fc:%[0-9]+]] = OpConstantComposite %v3float %float_0_5 %float_0_25 %float_0_75 +// CHECK: [[type_cube_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 0 0 1 Unknown +// CHECK: [[type_cube_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_image]] + +vk::SampledTextureCUBE tex; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageSampleDrefImplicitLod %float [[tex0]] [[v3fc]] %float_0_25 None + float a = tex.SampleCmp(float3(0.5, 0.25, 0.75), 0.25f); + +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[b:%[a-zA-Z0-9_]+]] = OpImageSampleDrefImplicitLod %float [[tex1]] [[v3fc]] %float_0_25 MinLod %float_0_5 + float b = tex.SampleCmp(float3(0.5, 0.25, 0.75), 0.25f, 0.5f); + + uint status; +// CHECK: [[tex2:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[c_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseSampleDrefImplicitLod %SparseResidencyStruct [[tex2]] [[v3fc]] %float_0_25 MinLod %float_0_5 +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[c_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float c = tex.SampleCmp(float3(0.5, 0.25, 0.75), 0.25f, 0.5f, status); + return float4(a + b + c, 0, 0, 1); +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample-grad.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample-grad.hlsl new file mode 100644 index 0000000000..7c93583a60 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample-grad.hlsl @@ -0,0 +1,37 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability MinLod +// CHECK: OpCapability SparseResidency + +// CHECK: [[v3fc:%[0-9]+]] = OpConstantComposite %v3float %float_0_5 %float_0_25 %float_0_75 +// CHECK: [[type_cube_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 0 0 1 Unknown +// CHECK: [[type_cube_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_image]] + +vk::SampledTextureCUBE tex; + +float4 main() : SV_Target { + float3 ddx = float3(1.0, 1.0, 1.0); + float3 ddy = float3(2.0, 2.0, 2.0); + +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[ddx_load:%[a-zA-Z0-9_]+]] = OpLoad %v3float %ddx +// CHECK: [[ddy_load:%[a-zA-Z0-9_]+]] = OpLoad %v3float %ddy +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageSampleExplicitLod %v4float [[tex0]] [[v3fc]] Grad [[ddx_load]] [[ddy_load]] + float4 a = tex.SampleGrad(float3(0.5, 0.25, 0.75), ddx, ddy); + +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[ddx_load_1:%[a-zA-Z0-9_]+]] = OpLoad %v3float %ddx +// CHECK: [[ddy_load_1:%[a-zA-Z0-9_]+]] = OpLoad %v3float %ddy +// CHECK: [[b:%[a-zA-Z0-9_]+]] = OpImageSampleExplicitLod %v4float [[tex1]] [[v3fc]] Grad|MinLod [[ddx_load_1]] [[ddy_load_1]] %float_0_5 + float4 b = tex.SampleGrad(float3(0.5, 0.25, 0.75), ddx, ddy, 0.5f); + + uint status; +// CHECK: [[tex2:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[ddx_load_2:%[a-zA-Z0-9_]+]] = OpLoad %v3float %ddx +// CHECK: [[ddy_load_2:%[a-zA-Z0-9_]+]] = OpLoad %v3float %ddy +// CHECK: [[c_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseSampleExplicitLod %SparseResidencyStruct [[tex2]] [[v3fc]] Grad|MinLod [[ddx_load_2]] [[ddy_load_2]] %float_0_5 +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[c_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float4 c = tex.SampleGrad(float3(0.5, 0.25, 0.75), ddx, ddy, 0.5f, status); + return a + b + c; +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample-level.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample-level.hlsl new file mode 100644 index 0000000000..3a59c4b891 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample-level.hlsl @@ -0,0 +1,23 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability SparseResidency + +// CHECK: [[v3fc:%[0-9]+]] = OpConstantComposite %v3float %float_0_5 %float_0_25 %float_0_75 +// CHECK: [[type_cube_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 0 0 1 Unknown +// CHECK: [[type_cube_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_image]] + +vk::SampledTextureCUBE tex; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageSampleExplicitLod %v4float [[tex0]] [[v3fc]] Lod %float_1 + float4 a = tex.SampleLevel(float3(0.5, 0.25, 0.75), 1.0f); + + uint status; +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[b_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseSampleExplicitLod %SparseResidencyStruct [[tex1]] [[v3fc]] Lod %float_1 +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[b_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float4 b = tex.SampleLevel(float3(0.5, 0.25, 0.75), 1.0f, status); + return a + b; +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample.hlsl new file mode 100644 index 0000000000..31a18d24b8 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCube/vk.sampledtexturecube.sample.hlsl @@ -0,0 +1,28 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability MinLod +// CHECK: OpCapability SparseResidency + +// CHECK: [[v3fc:%[0-9]+]] = OpConstantComposite %v3float %float_0_5 %float_0_25 %float_0_75 +// CHECK: [[type_cube_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 0 0 1 Unknown +// CHECK: [[type_cube_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_image]] + +vk::SampledTextureCUBE tex; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageSampleImplicitLod %v4float [[tex0]] [[v3fc]] None + float4 a = tex.Sample(float3(0.5, 0.25, 0.75)); + +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[b:%[a-zA-Z0-9_]+]] = OpImageSampleImplicitLod %v4float [[tex1]] [[v3fc]] MinLod %float_0_5 + float4 b = tex.Sample(float3(0.5, 0.25, 0.75), 0.5f); + + uint status; +// CHECK: [[tex2:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_sampled]] %tex +// CHECK: [[c_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseSampleImplicitLod %SparseResidencyStruct [[tex2]] [[v3fc]] MinLod %float_0_5 +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[c_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float4 c = tex.Sample(float3(0.5, 0.25, 0.75), 0.5f, status); + return a + b + c; +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.calculate-lod-unclamped.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.calculate-lod-unclamped.hlsl new file mode 100644 index 0000000000..98a805d649 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.calculate-lod-unclamped.hlsl @@ -0,0 +1,17 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability ImageQuery +// CHECK: [[type_cube_array_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 1 0 1 Unknown +// CHECK: [[type_cube_array_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_array_image]] + +vk::SampledTextureCUBEArray tex; + +void main() { + float3 xyz = float3(0.5, 0.25, 0.75); + +// CHECK: [[tex_load:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[xyz_load:%[a-zA-Z0-9_]+]] = OpLoad %v3float %xyz +// CHECK: [[lod_query:%[a-zA-Z0-9_]+]] = OpImageQueryLod %v2float [[tex_load]] [[xyz_load]] +// CHECK: {{%[0-9]+}} = OpCompositeExtract %float [[lod_query]] 1 + float lod = tex.CalculateLevelOfDetailUnclamped(xyz); +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.calculate-lod.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.calculate-lod.hlsl new file mode 100644 index 0000000000..08324d77d4 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.calculate-lod.hlsl @@ -0,0 +1,17 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability ImageQuery +// CHECK: [[type_cube_array_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 1 0 1 Unknown +// CHECK: [[type_cube_array_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_array_image]] + +vk::SampledTextureCUBEArray tex; + +void main() { + float3 xyz = float3(0.5, 0.25, 0.75); + +// CHECK: [[tex_load:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[xyz_load:%[a-zA-Z0-9_]+]] = OpLoad %v3float %xyz +// CHECK: [[lod_query:%[a-zA-Z0-9_]+]] = OpImageQueryLod %v2float [[tex_load]] [[xyz_load]] +// CHECK: {{%[0-9]+}} = OpCompositeExtract %float [[lod_query]] 0 + float lod = tex.CalculateLevelOfDetail(xyz); +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-alpha.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-alpha.hlsl new file mode 100644 index 0000000000..1e32d92eb4 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-alpha.hlsl @@ -0,0 +1,24 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability SparseResidency + +// CHECK: [[v4fc:%[0-9]+]] = OpConstantComposite %v4float %float_0_5 %float_0_25 %float_0_75 %float_1 +// CHECK: [[type_cube_array_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 1 0 1 Unknown +// CHECK: [[type_cube_array_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_array_image]] + +vk::SampledTextureCUBEArray texf4; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %texf4 +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageGather %v4float [[tex0]] [[v4fc]] %int_3 None + float4 a = texf4.GatherAlpha(float4(0.5, 0.25, 0.75, 1.0)); + + uint status; +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %texf4 +// CHECK: [[b_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseGather %SparseResidencyStruct [[tex1]] [[v4fc]] %int_3 None +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[b_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float4 b = texf4.GatherAlpha(float4(0.5, 0.25, 0.75, 1.0), status); + + return a + b; +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-blue.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-blue.hlsl new file mode 100644 index 0000000000..536d04c982 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-blue.hlsl @@ -0,0 +1,24 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability SparseResidency + +// CHECK: [[v4fc:%[0-9]+]] = OpConstantComposite %v4float %float_0_5 %float_0_25 %float_0_75 %float_1 +// CHECK: [[type_cube_array_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 1 0 1 Unknown +// CHECK: [[type_cube_array_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_array_image]] + +vk::SampledTextureCUBEArray texf4; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %texf4 +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageGather %v4float [[tex0]] [[v4fc]] %int_2 None + float4 a = texf4.GatherBlue(float4(0.5, 0.25, 0.75, 1.0)); + + uint status; +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %texf4 +// CHECK: [[b_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseGather %SparseResidencyStruct [[tex1]] [[v4fc]] %int_2 None +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[b_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float4 b = texf4.GatherBlue(float4(0.5, 0.25, 0.75, 1.0), status); + + return a + b; +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-cmp-alpha.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-cmp-alpha.hlsl new file mode 100644 index 0000000000..1fc1b68f11 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-cmp-alpha.hlsl @@ -0,0 +1,13 @@ +// RUN: not %dxc -T ps_6_8 -E main -fcgl %s -spirv 2>&1 | FileCheck %s + +vk::SampledTextureCUBEArray tex; + +float4 main() : SV_Target { + float4 a = tex.GatherCmpAlpha(float4(0.5, 0.25, 0.75, 1.0), 0.25f); + uint status; + float4 b = tex.GatherCmpAlpha(float4(0.5, 0.25, 0.75, 1.0), 0.25f, status); + return a + b; +} + +// CHECK: error: no equivalent for GatherCmpAlpha intrinsic method in Vulkan +// CHECK: error: no equivalent for GatherCmpAlpha intrinsic method in Vulkan diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-cmp-blue.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-cmp-blue.hlsl new file mode 100644 index 0000000000..86e6c7294a --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-cmp-blue.hlsl @@ -0,0 +1,13 @@ +// RUN: not %dxc -T ps_6_8 -E main -fcgl %s -spirv 2>&1 | FileCheck %s + +vk::SampledTextureCUBEArray tex; + +float4 main() : SV_Target { + float4 a = tex.GatherCmpBlue(float4(0.5, 0.25, 0.75, 1.0), 0.25f); + uint status; + float4 b = tex.GatherCmpBlue(float4(0.5, 0.25, 0.75, 1.0), 0.25f, status); + return a + b; +} + +// CHECK: error: no equivalent for GatherCmpBlue intrinsic method in Vulkan +// CHECK: error: no equivalent for GatherCmpBlue intrinsic method in Vulkan diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-cmp-green.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-cmp-green.hlsl new file mode 100644 index 0000000000..f6fdad1e38 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-cmp-green.hlsl @@ -0,0 +1,13 @@ +// RUN: not %dxc -T ps_6_8 -E main -fcgl %s -spirv 2>&1 | FileCheck %s + +vk::SampledTextureCUBEArray tex; + +float4 main() : SV_Target { + float4 a = tex.GatherCmpGreen(float4(0.5, 0.25, 0.75, 1.0), 0.25f); + uint status; + float4 b = tex.GatherCmpGreen(float4(0.5, 0.25, 0.75, 1.0), 0.25f, status); + return a + b; +} + +// CHECK: error: no equivalent for GatherCmpGreen intrinsic method in Vulkan +// CHECK: error: no equivalent for GatherCmpGreen intrinsic method in Vulkan diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-cmp-red.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-cmp-red.hlsl new file mode 100644 index 0000000000..7f84578d4f --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-cmp-red.hlsl @@ -0,0 +1,24 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability SparseResidency + +// CHECK: [[v4fc:%[0-9]+]] = OpConstantComposite %v4float %float_0_5 %float_0_25 %float_0_75 %float_1 +// CHECK: [[type_cube_array_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 1 0 1 Unknown +// CHECK: [[type_cube_array_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_array_image]] + +vk::SampledTextureCUBEArray tex; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageDrefGather %v4float [[tex0]] [[v4fc]] %float_0_25 None + float4 a = tex.GatherCmpRed(float4(0.5, 0.25, 0.75, 1.0), 0.25f); + + uint status; +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[b_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseDrefGather %SparseResidencyStruct [[tex1]] [[v4fc]] %float_0_25 None +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[b_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float4 b = tex.GatherCmpRed(float4(0.5, 0.25, 0.75, 1.0), 0.25f, status); + + return a + b; +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-cmp.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-cmp.hlsl new file mode 100644 index 0000000000..65b486df43 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-cmp.hlsl @@ -0,0 +1,24 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability SparseResidency + +// CHECK: [[v4fc:%[0-9]+]] = OpConstantComposite %v4float %float_0_5 %float_0_25 %float_0_75 %float_1 +// CHECK: [[type_cube_array_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 1 0 1 Unknown +// CHECK: [[type_cube_array_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_array_image]] + +vk::SampledTextureCUBEArray tex; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageDrefGather %v4float [[tex0]] [[v4fc]] %float_0_25 None + float4 a = tex.GatherCmp(float4(0.5, 0.25, 0.75, 1.0), 0.25f); + + uint status; +// CHECK: [[tex2:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[f_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseDrefGather %SparseResidencyStruct [[tex2]] [[v4fc]] %float_0_25 None +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[f_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float4 f = tex.GatherCmp(float4(0.5, 0.25, 0.75, 1.0), 0.25f, status); + + return a + f; +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-green.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-green.hlsl new file mode 100644 index 0000000000..36d2e9fd7a --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-green.hlsl @@ -0,0 +1,24 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability SparseResidency + +// CHECK: [[v4fc:%[0-9]+]] = OpConstantComposite %v4float %float_0_5 %float_0_25 %float_0_75 %float_1 +// CHECK: [[type_cube_array_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 1 0 1 Unknown +// CHECK: [[type_cube_array_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_array_image]] + +vk::SampledTextureCUBEArray texf4; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %texf4 +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageGather %v4float [[tex0]] [[v4fc]] %int_1 None + float4 a = texf4.GatherGreen(float4(0.5, 0.25, 0.75, 1.0)); + + uint status; +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %texf4 +// CHECK: [[b_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseGather %SparseResidencyStruct [[tex1]] [[v4fc]] %int_1 None +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[b_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float4 b = texf4.GatherGreen(float4(0.5, 0.25, 0.75, 1.0), status); + + return a + b; +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-red.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-red.hlsl new file mode 100644 index 0000000000..b9d80cffbc --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather-red.hlsl @@ -0,0 +1,24 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability SparseResidency + +// CHECK: [[v4fc:%[0-9]+]] = OpConstantComposite %v4float %float_0_5 %float_0_25 %float_0_75 %float_1 +// CHECK: [[type_cube_array_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 1 0 1 Unknown +// CHECK: [[type_cube_array_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_array_image]] + +vk::SampledTextureCUBEArray texf4; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %texf4 +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageGather %v4float [[tex0]] [[v4fc]] %int_0 None + float4 a = texf4.GatherRed(float4(0.5, 0.25, 0.75, 1.0)); + + uint status; +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %texf4 +// CHECK: [[b_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseGather %SparseResidencyStruct [[tex1]] [[v4fc]] %int_0 None +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[b_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float4 b = texf4.GatherRed(float4(0.5, 0.25, 0.75, 1.0), status); + + return a + b; +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather.hlsl new file mode 100644 index 0000000000..c6c7d8200d --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.gather.hlsl @@ -0,0 +1,31 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability SparseResidency + +// CHECK: [[v4fc:%[0-9]+]] = OpConstantComposite %v4float %float_0_5 %float_0_25 %float_0_75 %float_1 +// CHECK: [[type_cube_array_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 1 0 1 Unknown +// CHECK: [[type_cube_array_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_array_image]] +// CHECK: [[type_cube_array_image_uint:%[a-zA-Z0-9_]+]] = OpTypeImage %uint Cube 0 1 0 1 Unknown +// CHECK: [[type_cube_array_sampled_uint:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_array_image_uint]] + +vk::SampledTextureCUBEArray texf4; +vk::SampledTextureCUBEArray texu; + +float4 main() : SV_Target { +// CHECK: [[texf4_0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %texf4 +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageGather %v4float [[texf4_0]] [[v4fc]] %int_0 None + float4 a = texf4.Gather(float4(0.5, 0.25, 0.75, 1.0)); + +// CHECK: [[texu_0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled_uint]] %texu +// CHECK: [[b:%[a-zA-Z0-9_]+]] = OpImageGather %v4uint [[texu_0]] [[v4fc]] %int_0 None + uint4 b = texu.Gather(float4(0.5, 0.25, 0.75, 1.0)); + + uint status; +// CHECK: [[texf4_1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %texf4 +// CHECK: [[c_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseGather %SparseResidencyStruct [[texf4_1]] [[v4fc]] %int_0 None +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[c_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float4 c = texf4.Gather(float4(0.5, 0.25, 0.75, 1.0), status); + + return a + c + float4(b); +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.get-dimensions.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.get-dimensions.hlsl new file mode 100644 index 0000000000..c67aab8d33 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.get-dimensions.hlsl @@ -0,0 +1,40 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability ImageQuery + +// CHECK: [[type_cube_array_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 1 0 1 Unknown +// CHECK: [[type_cube_array_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_array_image]] + +vk::SampledTextureCUBEArray tex; + +void main() { + uint mip = 1; + uint w, h, e, levels; + float fw, fh, fe, flevels; + +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[img0:%[a-zA-Z0-9_]+]] = OpImage [[type_cube_array_image]] [[tex0]] +// CHECK: [[q0:%[a-zA-Z0-9_]+]] = OpImageQuerySizeLod %v3uint [[img0]] %int_0 + tex.GetDimensions(w, h, e); + +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[img1:%[a-zA-Z0-9_]+]] = OpImage [[type_cube_array_image]] [[tex1]] +// CHECK: [[mip_load:%[a-zA-Z0-9_]+]] = OpLoad %uint %mip +// CHECK: [[q1:%[a-zA-Z0-9_]+]] = OpImageQuerySizeLod %v3uint [[img1]] [[mip_load]] +// CHECK: [[q1_levels:%[a-zA-Z0-9_]+]] = OpImageQueryLevels %uint [[img1]] + tex.GetDimensions(mip, w, h, e, levels); + +// CHECK: [[tex2:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[img2:%[a-zA-Z0-9_]+]] = OpImage [[type_cube_array_image]] [[tex2]] +// CHECK: [[q2:%[a-zA-Z0-9_]+]] = OpImageQuerySizeLod %v3uint [[img2]] %int_0 +// CHECK: OpConvertUToF %float + tex.GetDimensions(fw, fh, fe); + +// CHECK: [[tex3:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[img3:%[a-zA-Z0-9_]+]] = OpImage [[type_cube_array_image]] [[tex3]] +// CHECK: [[mip_load_1:%[a-zA-Z0-9_]+]] = OpLoad %uint %mip +// CHECK: [[q3:%[a-zA-Z0-9_]+]] = OpImageQuerySizeLod %v3uint [[img3]] [[mip_load_1]] +// CHECK: [[q3_levels:%[a-zA-Z0-9_]+]] = OpImageQueryLevels %uint [[img3]] +// CHECK: OpConvertUToF %float + tex.GetDimensions(mip, fw, fh, fe, flevels); +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.sample-bias.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.sample-bias.hlsl new file mode 100644 index 0000000000..8339e290d5 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.sample-bias.hlsl @@ -0,0 +1,28 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability MinLod +// CHECK: OpCapability SparseResidency + +// CHECK: [[v4fc:%[0-9]+]] = OpConstantComposite %v4float %float_0_5 %float_0_25 %float_0_75 %float_1 +// CHECK: [[type_cube_array_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 1 0 1 Unknown +// CHECK: [[type_cube_array_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_array_image]] + +vk::SampledTextureCUBEArray tex; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageSampleImplicitLod %v4float [[tex0]] [[v4fc]] Bias %float_1 + float4 a = tex.SampleBias(float4(0.5, 0.25, 0.75, 1.0), 1.0f); + +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[b:%[a-zA-Z0-9_]+]] = OpImageSampleImplicitLod %v4float [[tex1]] [[v4fc]] Bias|MinLod %float_1 %float_0_5 + float4 b = tex.SampleBias(float4(0.5, 0.25, 0.75, 1.0), 1.0f, 0.5f); + + uint status; +// CHECK: [[tex2:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[c_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseSampleImplicitLod %SparseResidencyStruct [[tex2]] [[v4fc]] Bias|MinLod %float_1 %float_0_5 +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[c_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float4 c = tex.SampleBias(float4(0.5, 0.25, 0.75, 1.0), 1.0f, 0.5f, status); + return a + b + c; +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.sample-cmp-bias.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.sample-cmp-bias.hlsl new file mode 100644 index 0000000000..d2050a9a89 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.sample-cmp-bias.hlsl @@ -0,0 +1,28 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability MinLod +// CHECK: OpCapability SparseResidency + +// CHECK: [[v4fc:%[0-9]+]] = OpConstantComposite %v4float %float_0_5 %float_0_25 %float_0_75 %float_1 +// CHECK: [[type_cube_array_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 1 0 1 Unknown +// CHECK: [[type_cube_array_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_array_image]] + +vk::SampledTextureCUBEArray tex; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageSampleDrefImplicitLod %float [[tex0]] [[v4fc]] %float_0_25 Bias %float_1 + float a = tex.SampleCmpBias(float4(0.5, 0.25, 0.75, 1.0), 0.25f, 1.0f); + +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[b:%[a-zA-Z0-9_]+]] = OpImageSampleDrefImplicitLod %float [[tex1]] [[v4fc]] %float_0_25 Bias|MinLod %float_1 %float_0_5 + float b = tex.SampleCmpBias(float4(0.5, 0.25, 0.75, 1.0), 0.25f, 1.0f, 0.5f); + + uint status; +// CHECK: [[tex2:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[c_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseSampleDrefImplicitLod %SparseResidencyStruct [[tex2]] [[v4fc]] %float_0_25 Bias|MinLod %float_1 %float_0_5 +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[c_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float c = tex.SampleCmpBias(float4(0.5, 0.25, 0.75, 1.0), 0.25f, 1.0f, 0.5f, status); + return float4(a + b + c, 0, 0, 1); +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.sample-cmp-level-zero.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.sample-cmp-level-zero.hlsl new file mode 100644 index 0000000000..9087ea9509 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.sample-cmp-level-zero.hlsl @@ -0,0 +1,23 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability SparseResidency + +// CHECK: [[v4fc:%[0-9]+]] = OpConstantComposite %v4float %float_0_5 %float_0_25 %float_0_75 %float_1 +// CHECK: [[type_cube_array_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 1 0 1 Unknown +// CHECK: [[type_cube_array_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_array_image]] + +vk::SampledTextureCUBEArray tex; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageSampleDrefExplicitLod %float [[tex0]] [[v4fc]] %float_0_25 Lod %float_0 + float a = tex.SampleCmpLevelZero(float4(0.5, 0.25, 0.75, 1.0), 0.25f); + + uint status; +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[b_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseSampleDrefExplicitLod %SparseResidencyStruct [[tex1]] [[v4fc]] %float_0_25 Lod %float_0 +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[b_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float b = tex.SampleCmpLevelZero(float4(0.5, 0.25, 0.75, 1.0), 0.25f, status); + return float4(a + b, 0, 0, 1); +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.sample-cmp-level.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.sample-cmp-level.hlsl new file mode 100644 index 0000000000..cc8a8bc5ec --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.sample-cmp-level.hlsl @@ -0,0 +1,23 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability SparseResidency + +// CHECK: [[v4fc:%[0-9]+]] = OpConstantComposite %v4float %float_0_5 %float_0_25 %float_0_75 %float_1 +// CHECK: [[type_cube_array_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 1 0 1 Unknown +// CHECK: [[type_cube_array_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_array_image]] + +vk::SampledTextureCUBEArray tex; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageSampleDrefExplicitLod %float [[tex0]] [[v4fc]] %float_0_25 Lod %float_2 + float a = tex.SampleCmpLevel(float4(0.5, 0.25, 0.75, 1.0), 0.25f, 2.0f); + + uint status; +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[b_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseSampleDrefExplicitLod %SparseResidencyStruct [[tex1]] [[v4fc]] %float_0_25 Lod %float_2 +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[b_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float b = tex.SampleCmpLevel(float4(0.5, 0.25, 0.75, 1.0), 0.25f, 2.0f, status); + return float4(a + b, 0, 0, 1); +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.sample-cmp.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.sample-cmp.hlsl new file mode 100644 index 0000000000..53bbcb4e04 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.sample-cmp.hlsl @@ -0,0 +1,28 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability MinLod +// CHECK: OpCapability SparseResidency + +// CHECK: [[v4fc:%[0-9]+]] = OpConstantComposite %v4float %float_0_5 %float_0_25 %float_0_75 %float_1 +// CHECK: [[type_cube_array_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 1 0 1 Unknown +// CHECK: [[type_cube_array_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_array_image]] + +vk::SampledTextureCUBEArray tex; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageSampleDrefImplicitLod %float [[tex0]] [[v4fc]] %float_0_25 None + float a = tex.SampleCmp(float4(0.5, 0.25, 0.75, 1.0), 0.25f); + +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[b:%[a-zA-Z0-9_]+]] = OpImageSampleDrefImplicitLod %float [[tex1]] [[v4fc]] %float_0_25 MinLod %float_0_5 + float b = tex.SampleCmp(float4(0.5, 0.25, 0.75, 1.0), 0.25f, 0.5f); + + uint status; +// CHECK: [[tex2:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[c_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseSampleDrefImplicitLod %SparseResidencyStruct [[tex2]] [[v4fc]] %float_0_25 MinLod %float_0_5 +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[c_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float c = tex.SampleCmp(float4(0.5, 0.25, 0.75, 1.0), 0.25f, 0.5f, status); + return float4(a + b + c, 0, 0, 1); +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.sample-grad.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.sample-grad.hlsl new file mode 100644 index 0000000000..8b93f5f78e --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.sample-grad.hlsl @@ -0,0 +1,37 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability MinLod +// CHECK: OpCapability SparseResidency + +// CHECK: [[v4fc:%[0-9]+]] = OpConstantComposite %v4float %float_0_5 %float_0_25 %float_0_75 %float_1 +// CHECK: [[type_cube_array_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 1 0 1 Unknown +// CHECK: [[type_cube_array_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_array_image]] + +vk::SampledTextureCUBEArray tex; + +float4 main() : SV_Target { + float3 ddx = float3(1.0, 1.0, 1.0); + float3 ddy = float3(2.0, 2.0, 2.0); + +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[ddx_load:%[a-zA-Z0-9_]+]] = OpLoad %v3float %ddx +// CHECK: [[ddy_load:%[a-zA-Z0-9_]+]] = OpLoad %v3float %ddy +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageSampleExplicitLod %v4float [[tex0]] [[v4fc]] Grad [[ddx_load]] [[ddy_load]] + float4 a = tex.SampleGrad(float4(0.5, 0.25, 0.75, 1.0), ddx, ddy); + +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[ddx_load_1:%[a-zA-Z0-9_]+]] = OpLoad %v3float %ddx +// CHECK: [[ddy_load_1:%[a-zA-Z0-9_]+]] = OpLoad %v3float %ddy +// CHECK: [[b:%[a-zA-Z0-9_]+]] = OpImageSampleExplicitLod %v4float [[tex1]] [[v4fc]] Grad|MinLod [[ddx_load_1]] [[ddy_load_1]] %float_0_5 + float4 b = tex.SampleGrad(float4(0.5, 0.25, 0.75, 1.0), ddx, ddy, 0.5f); + + uint status; +// CHECK: [[tex2:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[ddx_load_2:%[a-zA-Z0-9_]+]] = OpLoad %v3float %ddx +// CHECK: [[ddy_load_2:%[a-zA-Z0-9_]+]] = OpLoad %v3float %ddy +// CHECK: [[c_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseSampleExplicitLod %SparseResidencyStruct [[tex2]] [[v4fc]] Grad|MinLod [[ddx_load_2]] [[ddy_load_2]] %float_0_5 +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[c_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float4 c = tex.SampleGrad(float4(0.5, 0.25, 0.75, 1.0), ddx, ddy, 0.5f, status); + return a + b + c; +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.sample-level.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.sample-level.hlsl new file mode 100644 index 0000000000..42ee643ec1 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.sample-level.hlsl @@ -0,0 +1,23 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability SparseResidency + +// CHECK: [[v4fc:%[0-9]+]] = OpConstantComposite %v4float %float_0_5 %float_0_25 %float_0_75 %float_1 +// CHECK: [[type_cube_array_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 1 0 1 Unknown +// CHECK: [[type_cube_array_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_array_image]] + +vk::SampledTextureCUBEArray tex; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageSampleExplicitLod %v4float [[tex0]] [[v4fc]] Lod %float_1 + float4 a = tex.SampleLevel(float4(0.5, 0.25, 0.75, 1.0), 1.0f); + + uint status; +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[b_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseSampleExplicitLod %SparseResidencyStruct [[tex1]] [[v4fc]] Lod %float_1 +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[b_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float4 b = tex.SampleLevel(float4(0.5, 0.25, 0.75, 1.0), 1.0f, status); + return a + b; +} diff --git a/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.sample.hlsl b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.sample.hlsl new file mode 100644 index 0000000000..15fc355366 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/SampledTexture/SampledTextureCubeArray/vk.sampledtexturecubearray.sample.hlsl @@ -0,0 +1,28 @@ +// RUN: %dxc -T ps_6_8 -E main -fcgl %s -spirv | FileCheck %s + +// CHECK: OpCapability MinLod +// CHECK: OpCapability SparseResidency + +// CHECK: [[v4fc:%[0-9]+]] = OpConstantComposite %v4float %float_0_5 %float_0_25 %float_0_75 %float_1 +// CHECK: [[type_cube_array_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float Cube 0 1 0 1 Unknown +// CHECK: [[type_cube_array_sampled:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_cube_array_image]] + +vk::SampledTextureCUBEArray tex; + +float4 main() : SV_Target { +// CHECK: [[tex0:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[a:%[a-zA-Z0-9_]+]] = OpImageSampleImplicitLod %v4float [[tex0]] [[v4fc]] None + float4 a = tex.Sample(float4(0.5, 0.25, 0.75, 1.0)); + +// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[b:%[a-zA-Z0-9_]+]] = OpImageSampleImplicitLod %v4float [[tex1]] [[v4fc]] MinLod %float_0_5 + float4 b = tex.Sample(float4(0.5, 0.25, 0.75, 1.0), 0.5f); + + uint status; +// CHECK: [[tex2:%[a-zA-Z0-9_]+]] = OpLoad [[type_cube_array_sampled]] %tex +// CHECK: [[c_sparse:%[a-zA-Z0-9_]+]] = OpImageSparseSampleImplicitLod %SparseResidencyStruct [[tex2]] [[v4fc]] MinLod %float_0_5 +// CHECK: [[status0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[c_sparse]] 0 +// CHECK: OpStore %status [[status0]] + float4 c = tex.Sample(float4(0.5, 0.25, 0.75, 1.0), 0.5f, status); + return a + b + c; +} diff --git a/utils/hct/gen_intrin_main.txt b/utils/hct/gen_intrin_main.txt index f688204aee..2768e1b65d 100644 --- a/utils/hct/gen_intrin_main.txt +++ b/utils/hct/gen_intrin_main.txt @@ -1541,4 +1541,111 @@ $classT [[]] SampleGrad(in float<3> x, in $type1 ddx, in $type1 ddy, in int<3> o } namespace + +namespace VkSampledTextureCUBEMethods { + +float [[ro]] CalculateLevelOfDetail(in float<3> x) : texcube_t_calc_lod; +float [[ro]] CalculateLevelOfDetailUnclamped(in float<3> x) : texcube_t_calc_lod_unclamped; +$match<0, -1> void<4> [[ro]] Gather(in float<3> x) : texcube_t_gather; +$match<0, -1> void<4> [[ro]] GatherAlpha(in float<3> x) : texcube_t_gather_alpha; +$match<0, -1> void<4> [[ro]] GatherBlue(in float<3> x) : texcube_t_gather_blue; +$match<0, -1> void<4> [[ro]] GatherCmp(in float<3> x, in float compareValue) : texcube_t_gather_comp; +$match<0, -1> void<4> [[ro]] GatherCmpAlpha(in float<3> x, in float compareValue) : texcube_t_gather_comp_alpha; +$match<0, -1> void<4> [[ro]] GatherCmpBlue(in float<3> x, in float compareValue) : texcube_t_gather_comp_blue; +$match<0, -1> void<4> [[ro]] GatherCmpGreen(in float<3> x, in float compareValue) : texcube_t_gather_comp_green; +$match<0, -1> void<4> [[ro]] GatherCmpRed(in float<3> x, in float compareValue) : texcube_t_gather_comp_red; +$match<0, -1> void<4> [[ro]] GatherGreen(in float<3> x) : texcube_t_gather_green; +$match<0, -1> void<4> [[ro]] GatherRed(in float<3> x) : texcube_t_gather_red; +void [[]] GetDimensions(in uint x, out uint_only width, out $type2 height, out $type2 levels) : resinfo_uint; +void [[]] GetDimensions(in uint x, out float_like width, out $type2 height, out $type2 levels) : resinfo; +void [[]] GetDimensions(out uint_only width, out $type1 height) : resinfo_uint_o; +void [[]] GetDimensions(out float_like width, out $type1 height) : resinfo_o; +$classT [[ro]] Sample(in float<3> x) : texcube_t; +$classT [[ro]] SampleBias(in float<3> x, in float bias) : texcube_t_bias; +float_like [[ro]] SampleCmp(in float<3> x, in float c) : texcube_t_comp; +float_like [[ro]] SampleCmpBias(in float<3> x, in float compareValue, in float bias) : texcube_t_comp_bias; +float_like [[ro]] SampleCmpGrad(in float<3> x, in float compareValue, in $match<1, 1> float<3> ddx, in $match<1, 1> float<3> ddy) : texcube_t_comp_dd; +float_like [[ro]] SampleCmpLevel(in float<3> x, in float c, in float lod); +float_like [[ro]] SampleCmpLevelZero(in float<3> x, in float c) : texcube_t_comp_lz; +$classT [[ro]] SampleGrad(in float<3> x, in $match<1, 1> float<3> ddx, in $match<1, 1> float<3> ddy) : texcube_t_dd; +$classT [[ro]] SampleLevel(in float<3> x, in float lod) : texcube_t_lod; +$classT [[ro]] Sample(in float<3> x, in float clamp) : texcube_t_cl; +$classT [[]] Sample(in float<3> x, in float clamp, out uint_only status) : texcube_t_cl_s; +float_like [[ro]] SampleCmp(in float<3> x, in float compareValue, in float clamp) : texcube_t_comp_cl; +float_like [[]] SampleCmp(in float<3> x, in float compareValue, in float clamp, out uint_only status) : texcube_t_comp_cl_s; +float_like [[ro]] SampleCmpBias(in float<3> x, in float compareValue, in float bias, in float clamp) : texcube_t_comp_bias_cl; +float_like [[]] SampleCmpBias(in float<3> x, in float compareValue, in float bias, in float clamp, out uint_only status) : texcube_t_comp_bias_cl_s; +float_like [[ro]] SampleCmpGrad(in float<3> x, in float compareValue, in $match<1, 1> float<3> ddx, in $match<1, 1> float<3> ddy, in float clamp) : texcube_t_comp_dd_o_cl; +float_like [[]] SampleCmpGrad(in float<3> x, in float compareValue, in $match<1, 1> float<3> ddx, in $match<1, 1> float<3> ddy, in float clamp, out uint_only status) : texcube_t_comp_dd_o_cl_s; +float_like [[]] SampleCmpLevel(in float<3> x, in float compareValue, in float lod, out uint_only status); +float_like [[]] SampleCmpLevelZero(in float<3> x, in float compareValue, out uint_only status) : texcube_t_comp_s; +$classT [[]] SampleLevel(in float<3> x, in float lod, out uint_only status) : texcube_t_lod_s; +$classT [[ro]] SampleBias(in float<3> x, in float bias, in float clamp) : texcube_t_bias_cl; +$classT [[]] SampleBias(in float<3> x, in float bias, in float clamp, out uint_only status) : texcube_t_bias_cl_s; +$classT [[ro]] SampleGrad(in float<3> x, in $match<1, 1> float<3> ddx, in $match<1, 1> float<3> ddy, in float clamp) : texcube_t_dd_cl; +$classT [[]] SampleGrad(in float<3> x, in $match<1, 1> float<3> ddx, in $match<1, 1> float<3> ddy, in float clamp, out uint_only status) : texcube_t_dd_cl_s; +$match<0, -1> void<4> [[]] Gather(in float<3> x, out uint_only status) : texcube_t_gather_s; +$match<0, -1> void<4> [[]] GatherRed(in float<3> x, out uint_only status) : texcube_t_gather_red_s; +$match<0, -1> void<4> [[]] GatherGreen(in float<3> x, out uint_only status) : texcube_t_gather_green_s; +$match<0, -1> void<4> [[]] GatherBlue(in float<3> x, out uint_only status) : texcube_t_gather_blue_s; +$match<0, -1> void<4> [[]] GatherAlpha(in float<3> x, out uint_only status) : texcube_t_gather_alpha_s; +$match<0, -1> void<4> [[]] GatherCmp(in float<3> x, in float compareValue, out uint_only status) : texcube_t_gather_comp_s; +$match<0, -1> void<4> [[]] GatherCmpRed(in float<3> x, in float compareValue, out uint_only status) : texcube_t_gather_comp_red_s; +$match<0, -1> void<4> [[]] GatherCmpGreen(in float<3> x, in float compareValue, out uint_only status) : texcube_t_gather_comp_green_s; +$match<0, -1> void<4> [[]] GatherCmpBlue(in float<3> x, in float compareValue, out uint_only status) : texcube_t_gather_comp_blue_s; +$match<0, -1> void<4> [[]] GatherCmpAlpha(in float<3> x, in float compareValue, out uint_only status) : texcube_t_gather_comp_alpha_s; +} namespace + +namespace VkSampledTextureCUBEArrayMethods { + +float [[ro]] CalculateLevelOfDetail(in float<3> x) : texcube_t_calc_lod_array; +float [[ro]] CalculateLevelOfDetailUnclamped(in float<3> x) : texcube_t_calc_lod_unclamped_array; +$match<0, -1> void<4> [[ro]] Gather(in float<4> x) : texcube_t_gather_array; +$match<0, -1> void<4> [[ro]] GatherAlpha(in float<4> x) : texcube_t_gather_alpha_array; +$match<0, -1> void<4> [[ro]] GatherBlue(in float<4> x) : texcube_t_gather_blue_array; +$match<0, -1> void<4> [[ro]] GatherCmp(in float<4> x, in float compareValue) : texcube_t_gather_comp_array; +$match<0, -1> void<4> [[ro]] GatherCmpAlpha(in float<4> x, in float compareValue) : texcube_t_gather_comp_alpha_array; +$match<0, -1> void<4> [[ro]] GatherCmpBlue(in float<4> x, in float compareValue) : texcube_t_gather_comp_blue_array; +$match<0, -1> void<4> [[ro]] GatherCmpGreen(in float<4> x, in float compareValue) : texcube_t_gather_comp_green_array; +$match<0, -1> void<4> [[ro]] GatherCmpRed(in float<4> x, in float compareValue) : texcube_t_gather_comp_red_array; +$match<0, -1> void<4> [[ro]] GatherGreen(in float<4> x) : texcube_t_gather_green_array; +$match<0, -1> void<4> [[ro]] GatherRed(in float<4> x) : texcube_t_gather_red_array; +void [[]] GetDimensions(in uint x, out uint_only width, out $type2 height, out $type2 elements, out $type2 levels) : resinfo_uint; +void [[]] GetDimensions(in uint x, out float_like width, out $type2 height, out $type2 elements, out $type2 levels) : resinfo; +void [[]] GetDimensions(out uint_only width, out $type1 height, out $type1 elements) : resinfo_uint_o; +void [[]] GetDimensions(out float_like width, out $type1 height, out $type1 elements) : resinfo_o; +$classT [[ro]] Sample(in float<4> x) : texcube_t_array; +$classT [[ro]] SampleBias(in float<4> x, in float bias) : texcube_t_bias_array; +float_like [[ro]] SampleCmp(in float<4> x, in float c) : texcube_t_comp_array; +float_like [[ro]] SampleCmpBias(in float<4> x, in float compareValue, in float bias) : texcube_t_comp_bias_array; +float_like [[ro]] SampleCmpLevel(in float<4> x, in float c, in float lod); +float_like [[ro]] SampleCmpLevelZero(in float<4> x, in float c) : texcube_t_comp_lz_array; +$classT [[ro]] SampleGrad(in float<4> x, in $match<2, 2> float<3> ddx, in $match<2, 2> float<3> ddy) : texcube_t_dd_array; +$classT [[ro]] SampleLevel(in float<4> x, in float lod) : texcube_t_lod_array; +$classT [[ro]] Sample(in float<4> x, in float clamp) : texcube_t_array_cl; +$classT [[]] Sample(in float<4> x, in float clamp, out uint_only status) : texcube_t_array_cl_s; +float_like [[ro]] SampleCmp(in float<4> x, in float compareValue, in float clamp) : texcube_t_comp_array_cl; +float_like [[]] SampleCmp(in float<4> x, in float compareValue, in float clamp, out uint_only status) : texcube_t_comp_array_cl_s; +float_like [[ro]] SampleCmpBias(in float<4> x, in float compareValue, in float bias, in float clamp) : texcube_t_comp_bias_array_cl; +float_like [[]] SampleCmpBias(in float<4> x, in float compareValue, in float bias, in float clamp, out uint_only status) : texcube_t_comp_bias_array_cl_s; +float_like [[]] SampleCmpLevel(in float<4> x, in float compareValue, in float lod, out uint_only status); +float_like [[]] SampleCmpLevelZero(in float<4> x, in float compareValue, out uint_only status) : texcube_t_comp_array_s; +$classT [[]] SampleLevel(in float<4> x, in float lod, out uint_only status) : texcube_t_lod_array_s; +$classT [[ro]] SampleBias(in float<4> x, in float bias, in float clamp) : texcube_t_bias_array_cl; +$classT [[]] SampleBias(in float<4> x, in float bias, in float clamp, out uint_only status) : texcube_t_bias_array_cl_s; +$classT [[ro]] SampleGrad(in float<4> x, in $match<2, 2> float<3> ddx, in $match<2, 2> float<3> ddy, in float clamp) : texcube_t_dd_array_cl; +$classT [[]] SampleGrad(in float<4> x, in $match<2, 2> float<3> ddx, in $match<2, 2> float<3> ddy, in float clamp, out uint_only status) : texcube_t_dd_array_cl_s; +$match<0, -1> void<4> [[]] Gather(in float<4> x, out uint_only status) : texcube_t_gather_array_s; +$match<0, -1> void<4> [[]] GatherRed(in float<4> x, out uint_only status) : texcube_t_gather_red_array_s; +$match<0, -1> void<4> [[]] GatherGreen(in float<4> x, out uint_only status) : texcube_t_gather_green_array_s; +$match<0, -1> void<4> [[]] GatherBlue(in float<4> x, out uint_only status) : texcube_t_gather_blue_array_s; +$match<0, -1> void<4> [[]] GatherAlpha(in float<4> x, out uint_only status) : texcube_t_gather_alpha_array_s; +$match<0, -1> void<4> [[]] GatherCmp(in float<4> x, in float compareValue, out uint_only status) : texcube_t_gather_comp_array_s; +$match<0, -1> void<4> [[]] GatherCmpRed(in float<4> x, in float compareValue, out uint_only status) : texcube_t_gather_comp_red_array_s; +$match<0, -1> void<4> [[]] GatherCmpGreen(in float<4> x, in float compareValue, out uint_only status) : texcube_t_gather_comp_green_array_s; +$match<0, -1> void<4> [[]] GatherCmpBlue(in float<4> x, in float compareValue, out uint_only status) : texcube_t_gather_comp_blue_array_s; +$match<0, -1> void<4> [[]] GatherCmpAlpha(in float<4> x, in float compareValue, out uint_only status) : texcube_t_gather_comp_alpha_array_s; +} namespace + + // SPIRV Change Ends