Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/dxc/dxcapi.internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ enum LEGAL_INTRINSIC_COMPTYPES {
#ifdef ENABLE_SPIRV_CODEGEN
LICOMPTYPE_VK_BUFFER_POINTER = 56,
LICOMPTYPE_VK_SAMPLED_TEXTURE2D = 57,
LICOMPTYPE_COUNT = 58
LICOMPTYPE_VK_SAMPLED_TEXTURE2D_ARRAY = 58,
LICOMPTYPE_COUNT = 59
#else
LICOMPTYPE_COUNT = 56
#endif
Expand Down
2 changes: 0 additions & 2 deletions tools/clang/lib/AST/ASTContextHLSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1376,8 +1376,6 @@ CXXRecordDecl *hlsl::DeclareVkSampledTextureType(ASTContext &context,
DeclContext *declContext,
llvm::StringRef hlslTypeName,
QualType defaultParamType) {
// TODO(https://github.com/microsoft/DirectXShaderCompiler/issues/7979): Later
// generalize these to all SampledTexture types.
BuiltinTypeDeclBuilder Builder(declContext, hlslTypeName,
TagDecl::TagKind::TTK_Struct);

Expand Down
2 changes: 1 addition & 1 deletion tools/clang/lib/SPIRV/AstTypeProbe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ bool isSampledTexture(QualType type) {
const auto name = rt->getDecl()->getName();
// TODO(https://github.com/microsoft/DirectXShaderCompiler/issues/7979): Add
// other sampled texture types as needed.
if (name == "SampledTexture2D")
if (name == "SampledTexture2D" || name == "SampledTexture2DArray")
return true;
}
return false;
Expand Down
9 changes: 5 additions & 4 deletions tools/clang/lib/SPIRV/LowerTypeVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ const SpirvType *LowerTypeVisitor::lowerVkTypeInVkNamespace(
assert(visitedTypeStack.size() == visitedTypeStackSize);
return pointerType;
}
if (name == "SampledTexture2D") {
if (name == "SampledTexture2D" || name == "SampledTexture2DArray") {
const auto sampledType = hlsl::GetHLSLResourceResultType(type);
auto loweredType = lowerType(getElementType(astContext, sampledType), rule,
/*isRowMajor*/ llvm::None, srcLoc);
Expand All @@ -860,10 +860,11 @@ const SpirvType *LowerTypeVisitor::lowerVkTypeInVkNamespace(
loweredType = spvContext.getUIntType(32);
}

const bool isArray = (name == "SampledTexture2DArray");

const auto *imageType = spvContext.getImageType(
loweredType, spv::Dim::Dim2D, ImageType::WithDepth::No,
false /* array */, false /* ms */, ImageType::WithSampler::Yes,
spv::ImageFormat::Unknown);
loweredType, spv::Dim::Dim2D, ImageType::WithDepth::No, isArray,
false /* ms */, ImageType::WithSampler::Yes, spv::ImageFormat::Unknown);
return spvContext.getSampledImageType(imageType);
}
emitError("unknown type %0 in vk namespace", srcLoc) << type;
Expand Down
1 change: 1 addition & 0 deletions tools/clang/lib/SPIRV/SpirvEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4394,6 +4394,7 @@ SpirvEmitter::processBufferTextureGetDimensions(const CXXMemberCallExpr *expr) {
if ((typeName == "Texture1D" && numArgs > 1) ||
(typeName == "Texture2D" && numArgs > 2) ||
(typeName == "SampledTexture2D" && numArgs > 2) ||
(typeName == "SampledTexture2DArray" && numArgs > 3) ||
(typeName == "TextureCube" && numArgs > 2) ||
(typeName == "Texture3D" && numArgs > 3) ||
(typeName == "Texture1DArray" && numArgs > 2) ||
Expand Down
25 changes: 21 additions & 4 deletions tools/clang/lib/Sema/SemaHLSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ enum ArBasicKind {
AR_OBJECT_VK_SPV_INTRINSIC_RESULT_ID,
AR_OBJECT_VK_BUFFER_POINTER,
AR_OBJECT_VK_SAMPLED_TEXTURE2D,
AR_OBJECT_VK_SAMPLED_TEXTURE2D_ARRAY,
#endif // ENABLE_SPIRV_CODEGEN
// SPIRV change ends

Expand Down Expand Up @@ -562,6 +563,7 @@ const UINT g_uBasicKindProps[] = {
BPROP_OBJECT, // AR_OBJECT_VK_SPV_INTRINSIC_RESULT_ID use recordType
BPROP_OBJECT, // AR_OBJECT_VK_BUFFER_POINTER use recordType
BPROP_OBJECT | BPROP_RBUFFER, // AR_OBJECT_VK_SAMPLED_TEXTURE2D
BPROP_OBJECT | BPROP_RBUFFER, // AR_OBJECT_VK_SAMPLED_TEXTURE2D_ARRAY
#endif // ENABLE_SPIRV_CODEGEN
// SPIRV change ends

Expand Down Expand Up @@ -1272,6 +1274,8 @@ static const ArBasicKind g_VKBufferPointerCT[] = {AR_OBJECT_VK_BUFFER_POINTER,
AR_BASIC_UNKNOWN};
static const ArBasicKind g_VKSampledTexture2DCT[] = {
AR_OBJECT_VK_SAMPLED_TEXTURE2D, AR_BASIC_UNKNOWN};
static const ArBasicKind g_VKSampledTexture2DArrayCT[] = {
AR_OBJECT_VK_SAMPLED_TEXTURE2D_ARRAY, AR_BASIC_UNKNOWN};
#endif

// Basic kinds, indexed by a LEGAL_INTRINSIC_COMPTYPES value.
Expand Down Expand Up @@ -1334,8 +1338,9 @@ const ArBasicKind *g_LegalIntrinsicCompTypes[] = {
g_LinAlgCT, // LICOMPTYPE_LINALG
g_BuiltInTrianglePositionsCT, // LICOMPTYPE_BUILTIN_TRIANGLE_POSITIONS
#ifdef ENABLE_SPIRV_CODEGEN
g_VKBufferPointerCT, // LICOMPTYPE_VK_BUFFER_POINTER
g_VKSampledTexture2DCT, // LICOMPTYPE_VK_SAMPLED_TEXTURE2D
g_VKBufferPointerCT, // LICOMPTYPE_VK_BUFFER_POINTER
g_VKSampledTexture2DCT, // LICOMPTYPE_VK_SAMPLED_TEXTURE2D
g_VKSampledTexture2DArrayCT, // LICOMPTYPE_VK_SAMPLED_TEXTURE2D_ARRAY
#endif
};
static_assert(
Expand Down Expand Up @@ -1396,6 +1401,7 @@ static const ArBasicKind g_ArBasicKindsAsTypes[] = {
AR_OBJECT_VK_INTEGRAL_CONSTANT, AR_OBJECT_VK_LITERAL,
AR_OBJECT_VK_SPV_INTRINSIC_TYPE, AR_OBJECT_VK_SPV_INTRINSIC_RESULT_ID,
AR_OBJECT_VK_BUFFER_POINTER, AR_OBJECT_VK_SAMPLED_TEXTURE2D,
AR_OBJECT_VK_SAMPLED_TEXTURE2D_ARRAY,
#endif // ENABLE_SPIRV_CODEGEN
// SPIRV change ends

Expand Down Expand Up @@ -1508,6 +1514,7 @@ static const uint8_t g_ArBasicKindsTemplateCount[] = {
1, // AR_OBJECT_VK_SPV_INTRINSIC_RESULT_ID
2, // AR_OBJECT_VK_BUFFER_POINTER
1, // AR_OBJECT_VK_SAMPLED_TEXTURE2D
1, // AR_OBJECT_VK_SAMPLED_TEXTURE2D_ARRAY
#endif // ENABLE_SPIRV_CODEGEN
// SPIRV change ends

Expand Down Expand Up @@ -1662,6 +1669,7 @@ static const SubscriptOperatorRecord g_ArBasicKindsSubscripts[] = {
{0, MipsFalse, SampleFalse}, // AR_OBJECT_VK_SPV_INTRINSIC_RESULT_ID
{0, MipsFalse, SampleFalse}, // AR_OBJECT_VK_BUFFER_POINTER
{2, MipsTrue, SampleFalse}, // AR_OBJECT_VK_SAMPLED_TEXTURE2D
{3, MipsTrue, SampleFalse}, // AR_OBJECT_VK_SAMPLED_TEXTURE2D_ARRAY
#endif // ENABLE_SPIRV_CODEGEN
// SPIRV change ends

Expand Down Expand Up @@ -1832,6 +1840,7 @@ static const char *g_ArBasicTypeNames[] = {
"ext_result_id",
"BufferPointer",
"SampledTexture2D",
"SampledTexture2DArray",
#endif // ENABLE_SPIRV_CODEGEN
// SPIRV change ends

Expand Down Expand Up @@ -2489,6 +2498,10 @@ static void GetIntrinsicMethods(ArBasicKind kind,
*intrinsics = g_VkSampledTexture2DMethods;
*intrinsicCount = _countof(g_VkSampledTexture2DMethods);
break;
case AR_OBJECT_VK_SAMPLED_TEXTURE2D_ARRAY:
*intrinsics = g_VkSampledTexture2DArrayMethods;
*intrinsicCount = _countof(g_VkSampledTexture2DArrayMethods);
break;
#endif
case AR_OBJECT_HIT_OBJECT:
*intrinsics = g_DxHitObjectMethods;
Expand Down Expand Up @@ -4094,13 +4107,14 @@ class HLSLExternalSource : public ExternalSemaSource {
recordDecl = DeclareVkBufferPointerType(*m_context, m_vkNSDecl);
recordDecl->setImplicit(true);
m_vkBufferPointerTemplateDecl = recordDecl->getDescribedClassTemplate();
} else if (kind == AR_OBJECT_VK_SAMPLED_TEXTURE2D) {
} else if (kind == AR_OBJECT_VK_SAMPLED_TEXTURE2D ||
kind == AR_OBJECT_VK_SAMPLED_TEXTURE2D_ARRAY) {
if (!m_vkNSDecl)
continue;
QualType float4Type =
LookupVectorType(HLSLScalarType::HLSLScalarType_float, 4);
recordDecl = DeclareVkSampledTextureType(
*m_context, m_vkNSDecl, "SampledTexture2D", float4Type);
*m_context, m_vkNSDecl, g_ArBasicTypeNames[kind], float4Type);
if (Attr)
recordDecl->addAttr(Attr);
m_vkSampledTextureTemplateDecl =
Expand Down Expand Up @@ -5060,6 +5074,9 @@ class HLSLExternalSource : public ExternalSemaSource {
ResClass = DXIL::ResourceClass::UAV;
return true;
case AR_OBJECT_TEXTURE2D_ARRAY:
#ifdef ENABLE_SPIRV_CODEGEN
case AR_OBJECT_VK_SAMPLED_TEXTURE2D_ARRAY:
#endif
ResKind = DXIL::ResourceKind::Texture2DArray;
ResClass = DXIL::ResourceClass::SRV;
return true;
Expand Down
26 changes: 17 additions & 9 deletions tools/clang/test/CodeGenSPIRV/vk.sampledtexture.access.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,29 @@

// CHECK: [[cu12:%[0-9]+]] = OpConstantComposite %v2uint %uint_1 %uint_2

// CHECK: [[type_2d_image_1:%[a-zA-Z0-9_]+]] = OpTypeImage %float 2D 0 0 0 1 Unknown
// CHECK: [[type_sampled_image_1:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_2d_image_1]]
// CHECK: [[ptr_type_1:%[a-zA-Z0-9_]+]] = OpTypePointer UniformConstant [[type_sampled_image_1]]
// CHECK: [[type_2d_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float 2D 0 0 0 1 Unknown
// CHECK: [[type_2d_sampled_image:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_2d_image]]
// CHECK: [[type_2d_image_array:%[a-zA-Z0-9_]+]] = OpTypeImage %float 2D 0 1 0 1 Unknown
// CHECK: [[type_2d_sampled_image_array:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_2d_image_array]]

// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpVariable [[ptr_type_1]] UniformConstant

vk::SampledTexture2D<float4> tex1 : register(t1);
vk::SampledTexture2D<float4> tex2d;
vk::SampledTexture2DArray<float4> tex2dArray;

void main() {
// CHECK: OpStore %pos1 [[cu12]]
// CHECK-NEXT: [[pos1:%[0-9]+]] = OpLoad %v2uint %pos1
// CHECK-NEXT: [[tex1_load:%[a-zA-Z0-9_]+]] = OpLoad [[type_sampled_image_1]] [[tex1]]
// CHECK-NEXT: [[tex_img:%[0-9]+]] = OpImage [[type_2d_image_1]] [[tex1_load]]
// CHECK-NEXT: [[tex1_load:%[a-zA-Z0-9_]+]] = OpLoad [[type_2d_sampled_image]] %tex2d
// CHECK-NEXT: [[tex_img:%[0-9]+]] = OpImage [[type_2d_image]] [[tex1_load]]
// CHECK-NEXT: [[result1:%[0-9]+]] = OpImageFetch %v4float [[tex_img]] [[pos1]] Lod %uint_0
// CHECK-NEXT: OpStore %a1 [[result1]]
uint2 pos1 = uint2(1,2);
float4 a1 = tex1[pos1];
float4 a1 = tex2d[pos1];

// CHECK: [[pos2:%[0-9]+]] = OpLoad %v3uint %pos2
// CHECK-NEXT: [[tex2_load:%[a-zA-Z0-9_]+]] = OpLoad [[type_2d_sampled_image_array]] %tex2dArray
// CHECK-NEXT: [[tex2_img:%[0-9]+]] = OpImage [[type_2d_image_array]] [[tex2_load]]
// CHECK-NEXT: [[result2:%[0-9]+]] = OpImageFetch %v4float [[tex2_img]] [[pos2]] Lod %uint_0
// CHECK-NEXT: OpStore %a2 [[result2]]
uint3 pos2 = uint3(1,2,3);
float4 a2 = tex2dArray[pos2];
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,26 @@

// CHECK: OpCapability ImageQuery

vk::SampledTexture2D<float4> t1 : register(t0);
// CHECK: [[type_2d_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float 2D 0 0 0 1 Unknown
// CHECK: [[type_2d_sampled_image:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_2d_image]]
// CHECK: [[type_2d_image_array:%[a-zA-Z0-9_]+]] = OpTypeImage %float 2D 0 1 0 1 Unknown
// CHECK: [[type_2d_sampled_image_array:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_2d_image_array]]

// CHECK: %type_2d_image = OpTypeImage %float 2D 0 0 0 1 Unknown
// CHECK: %type_sampled_image = OpTypeSampledImage %type_2d_image
// CHECK: [[ptr:%[a-zA-Z0-9_]+]] = OpTypePointer UniformConstant %type_sampled_image

// CHECK: %t1 = OpVariable [[ptr]] UniformConstant
vk::SampledTexture2D<float4> tex2d;
vk::SampledTexture2DArray<float4> tex2dArray;

void main() {
float2 xy = float2(0.5, 0.5);

//CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad %type_sampled_image %t1
//CHECK: [[tex1_load:%[a-zA-Z0-9_]+]] = OpLoad [[type_2d_sampled_image]] %tex2d
//CHECK-NEXT: [[xy_load:%[a-zA-Z0-9_]+]] = OpLoad %v2float %xy
//CHECK-NEXT: [[query:%[a-zA-Z0-9_]+]] = OpImageQueryLod %v2float [[tex1]] [[xy_load]]
//CHECK-NEXT: [[query:%[a-zA-Z0-9_]+]] = OpImageQueryLod %v2float [[tex1_load]] [[xy_load]]
//CHECK-NEXT: {{%[0-9]+}} = OpCompositeExtract %float [[query]] 1
float lod1 = t1.CalculateLevelOfDetailUnclamped(xy);
float lod1 = tex2d.CalculateLevelOfDetailUnclamped(xy);

//CHECK: [[tex2_load:%[a-zA-Z0-9_]+]] = OpLoad [[type_2d_sampled_image_array]] %tex2dArray
//CHECK-NEXT: [[xy_load_2:%[a-zA-Z0-9_]+]] = OpLoad %v2float %xy
//CHECK-NEXT: [[query2:%[a-zA-Z0-9_]+]] = OpImageQueryLod %v2float [[tex2_load]] [[xy_load_2]]
//CHECK-NEXT: {{%[0-9]+}} = OpCompositeExtract %float [[query2]] 1
float lod2 = tex2dArray.CalculateLevelOfDetailUnclamped(xy);
}
22 changes: 14 additions & 8 deletions tools/clang/test/CodeGenSPIRV/vk.sampledtexture.calculate-lod.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,26 @@

// CHECK: OpCapability ImageQuery

vk::SampledTexture2D<float4> t1 : register(t0);
// CHECK: [[type_2d_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float 2D 0 0 0 1 Unknown
// CHECK: [[type_2d_sampled_image:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_2d_image]]
// CHECK: [[type_2d_image_array:%[a-zA-Z0-9_]+]] = OpTypeImage %float 2D 0 1 0 1 Unknown
// CHECK: [[type_2d_sampled_image_array:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_2d_image_array]]

// CHECK: %type_2d_image = OpTypeImage %float 2D 0 0 0 1 Unknown
// CHECK: %type_sampled_image = OpTypeSampledImage %type_2d_image
// CHECK: [[ptr:%[a-zA-Z0-9_]+]] = OpTypePointer UniformConstant %type_sampled_image

// CHECK: %t1 = OpVariable [[ptr]] UniformConstant
vk::SampledTexture2D<float4> tex2d;
vk::SampledTexture2DArray<float4> tex2dArray;

void main() {
float2 xy = float2(0.5, 0.5);

//CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad %type_sampled_image %t1
//CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpLoad [[type_2d_sampled_image]] %tex2d
//CHECK-NEXT: [[xy_load:%[a-zA-Z0-9_]+]] = OpLoad %v2float %xy
//CHECK-NEXT: [[query:%[a-zA-Z0-9_]+]] = OpImageQueryLod %v2float [[tex1]] [[xy_load]]
//CHECK-NEXT: {{%[0-9]+}} = OpCompositeExtract %float [[query]] 0
float lod = t1.CalculateLevelOfDetail(xy);
float lod = tex2d.CalculateLevelOfDetail(xy);

//CHECK: [[tex2:%[a-zA-Z0-9_]+]] = OpLoad [[type_2d_sampled_image_array]] %tex2dArray
//CHECK-NEXT: [[xy_load_2:%[a-zA-Z0-9_]+]] = OpLoad %v2float %xy
//CHECK-NEXT: [[query2:%[a-zA-Z0-9_]+]] = OpImageQueryLod %v2float [[tex2]] [[xy_load_2]]
//CHECK-NEXT: {{%[0-9]+}} = OpCompositeExtract %float [[query2]] 0
float lod2 = tex2dArray.CalculateLevelOfDetail(xy);
}
30 changes: 18 additions & 12 deletions tools/clang/test/CodeGenSPIRV/vk.sampledtexture.cmp-level.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,35 @@

// CHECK: [[v2fc:%[0-9]+]] = OpConstantComposite %v2float %float_0_5 %float_0_25
// CHECK: [[v2ic:%[0-9]+]] = OpConstantComposite %v2int %int_2 %int_3
// CHECK: [[v3fc:%[0-9]+]] = OpConstantComposite %v3float %float_0_5 %float_0_25 %float_0

// CHECK: [[type_2d_image_1:%[a-zA-Z0-9_]+]] = OpTypeImage %float 2D 0 0 0 1 Unknown
// CHECK: [[type_sampled_image_1:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_2d_image_1]]
// CHECK: [[ptr_type_1:%[a-zA-Z0-9_]+]] = OpTypePointer UniformConstant [[type_sampled_image_1]]
// CHECK: [[type_2d_image:%[a-zA-Z0-9_]+]] = OpTypeImage %float 2D 0 0 0 1 Unknown
// CHECK: [[type_2d_sampled_image:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_2d_image]]
// CHECK: [[type_2d_image_array:%[a-zA-Z0-9_]+]] = OpTypeImage %float 2D 0 1 0 1 Unknown
// CHECK: [[type_2d_sampled_image_array:%[a-zA-Z0-9_]+]] = OpTypeSampledImage [[type_2d_image_array]]

// CHECK: [[tex1:%[a-zA-Z0-9_]+]] = OpVariable [[ptr_type_1]] UniformConstant

vk::SampledTexture2D<float4> tex1 : register(t0);
vk::SampledTexture2D<float4> tex2d;
vk::SampledTexture2DArray<float4> tex2dArray;

float4 main() : SV_Target {
// CHECK: [[tex1_load:%[a-zA-Z0-9_]+]] = OpLoad [[type_sampled_image_1]] [[tex1]]
// CHECK: [[tex1_load:%[a-zA-Z0-9_]+]] = OpLoad [[type_2d_sampled_image]] %tex2d
// CHECK: [[sampled_result1:%[a-zA-Z0-9_]+]] = OpImageSampleDrefExplicitLod %float [[tex1_load]] [[v2fc]] %float_2 Lod %float_1
float val1 = tex1.SampleCmpLevel(float2(0.5, 0.25), 2.0f, 1.0f);
float val1 = tex2d.SampleCmpLevel(float2(0.5, 0.25), 2.0f, 1.0f);

// CHECK: [[tex2_load:%[a-zA-Z0-9_]+]] = OpLoad [[type_sampled_image_1]] [[tex1]]
// CHECK: [[tex2_load:%[a-zA-Z0-9_]+]] = OpLoad [[type_2d_sampled_image]] %tex2d
// CHECK: [[sampled_result2:%[a-zA-Z0-9_]+]] = OpImageSampleDrefExplicitLod %float [[tex2_load]] [[v2fc]] %float_2 Lod|ConstOffset %float_1 [[v2ic]]
float val2 = tex1.SampleCmpLevel(float2(0.5, 0.25), 2.0f, 1.0f, int2(2,3));
float val2 = tex2d.SampleCmpLevel(float2(0.5, 0.25), 2.0f, 1.0f, int2(2,3));

// CHECK: [[tex3_load:%[a-zA-Z0-9_]+]] = OpLoad [[type_sampled_image_1]] [[tex1]]
// CHECK: [[tex3_load:%[a-zA-Z0-9_]+]] = OpLoad [[type_2d_sampled_image]] %tex2d
// CHECK: [[sampled_result3:%[a-zA-Z0-9_]+]] = OpImageSparseSampleDrefExplicitLod %SparseResidencyStruct [[tex3_load]] [[v2fc]] %float_2 Lod|ConstOffset %float_1 [[v2ic]]
// CHECK: [[status_0:%[a-zA-Z0-9_]+]] = OpCompositeExtract %uint [[sampled_result3]] 0
// CHECK: OpStore %status [[status_0]]
uint status;
float val3 = tex1.SampleCmpLevel(float2(0.5, 0.25), 2.0f, 1.0f, int2(2,3), status);
float val3 = tex2d.SampleCmpLevel(float2(0.5, 0.25), 2.0f, 1.0f, int2(2,3), status);

// CHECK: [[load_arr1:%[a-zA-Z0-9_]+]] = OpLoad [[type_2d_sampled_image_array]] %tex2dArray
// CHECK: [[sampled_arr1:%[a-zA-Z0-9_]+]] = OpImageSampleDrefExplicitLod %float [[load_arr1]] [[v3fc]] %float_2 Lod %float_1
float val4 = tex2dArray.SampleCmpLevel(float3(0.5, 0.25, 0), 2.0f, 1.0f);

return 1.0;
}
Loading