diff --git a/lib/DXIL/DxilModule.cpp b/lib/DXIL/DxilModule.cpp index 68133f7393..61813e9508 100644 --- a/lib/DXIL/DxilModule.cpp +++ b/lib/DXIL/DxilModule.cpp @@ -288,27 +288,6 @@ unsigned DxilModule::GetGlobalFlags() const { return Flags; } -static bool RequiresRaytracingTier1_1(const DxilSubobjects *pSubobjects) { - if (!pSubobjects) - return false; - for (const auto &it : pSubobjects->GetSubobjects()) { - switch (it.second->GetKind()) { - case DXIL::SubobjectKind::RaytracingPipelineConfig1: - return true; - case DXIL::SubobjectKind::StateObjectConfig: { - uint32_t configFlags; - if (it.second->GetStateObjectConfig(configFlags) && - ((configFlags & - (unsigned)DXIL::StateObjectFlags::AllowStateObjectAdditions) != 0)) - return true; - } break; - default: - break; - } - } - return false; -} - void DxilModule::CollectShaderFlagsForModule(ShaderFlags &Flags) { ComputeShaderCompatInfo(); for (auto &itInfo : m_FuncToShaderCompat) @@ -380,10 +359,6 @@ void DxilModule::CollectShaderFlagsForModule(ShaderFlags &Flags) { bool hasCSRawAndStructuredViaShader4X = hasRawAndStructuredBuffer && m_pSM->GetMajor() == 4 && m_pSM->IsCS(); Flags.SetCSRawAndStructuredViaShader4X(hasCSRawAndStructuredViaShader4X); - - if (!Flags.GetRaytracingTier1_1()) { - Flags.SetRaytracingTier1_1(RequiresRaytracingTier1_1(GetSubobjects())); - } } void DxilModule::CollectShaderFlagsForModule() { diff --git a/lib/HLSL/DxilValidation.cpp b/lib/HLSL/DxilValidation.cpp index 8fe34fb281..e360a54ee3 100644 --- a/lib/HLSL/DxilValidation.cpp +++ b/lib/HLSL/DxilValidation.cpp @@ -4448,10 +4448,6 @@ static void ValidateResources(ValidationContext &ValCtx) { } static void ValidateShaderFlags(ValidationContext &ValCtx) { - // TODO: validate flags foreach entry. - if (ValCtx.isLibProfile) - return; - ShaderFlags calcFlags; ValCtx.DxilMod.CollectShaderFlagsForModule(calcFlags); const uint64_t mask = ShaderFlags::GetShaderFlagsRawForCollection(); diff --git a/tools/clang/test/HLSLFileCheck/shader_targets/raytracing/subobjects_raytracingPipelineConfig1.hlsl b/tools/clang/test/HLSLFileCheck/shader_targets/raytracing/subobjects_raytracingPipelineConfig1.hlsl index b763f8b5c6..a9a1bb9be1 100644 --- a/tools/clang/test/HLSLFileCheck/shader_targets/raytracing/subobjects_raytracingPipelineConfig1.hlsl +++ b/tools/clang/test/HLSLFileCheck/shader_targets/raytracing/subobjects_raytracingPipelineConfig1.hlsl @@ -1,5 +1,10 @@ // RUN: %dxilver 1.5 | %dxc -T lib_6_3 %s | FileCheck %s +// RaytracingTier1_1 flag should not be set on the module based on subobjects. +// This is not even set for compatibility with validator 1.7 because that +// validator did not validate the flags. +// CHECK-NOT: Raytracing tier 1.1 features + // CHECK: ; GlobalRootSignature grs = { <48 bytes> }; // CHECK: ; StateObjectConfig soc = { STATE_OBJECT_FLAG_ALLOW_LOCAL_DEPENDENCIES_ON_EXTERNAL_DEFINITIONS | STATE_OBJECT_FLAG_ALLOW_STATE_OBJECT_ADDITIONS }; // CHECK: ; LocalRootSignature lrs = { <48 bytes> }; @@ -27,6 +32,7 @@ RaytracingPipelineConfig1 rpc2 = {32, RAYTRACING_PIPELINE_FLAG_NONE }; TriangleHitGroup trHitGt = {"a", "b"}; ProceduralPrimitiveHitGroup ppHitGt = { "a", "b", "c"}; -int main(int i : INDEX) : SV_Target { - return 1; -} \ No newline at end of file +// DXR entry point to ensure RDAT flags match during validation. +[shader("raygeneration")] +void main(void) { +}