Skip to content

Commit

Permalink
[NFC] Move DxilValidation to a dedicated folder. (#6849)
Browse files Browse the repository at this point in the history
Move DxilValidation out of HLSL.
Also move code to validate dxil container into
DxilContainerValidation.cpp from DxilValidation.cpp.

This is a preparatory step for #6817.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
python3kgae and github-actions[bot] authored Aug 14, 2024
1 parent f810e92 commit 0e7591a
Show file tree
Hide file tree
Showing 17 changed files with 1,408 additions and 1,266 deletions.
1 change: 0 additions & 1 deletion include/dxc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ configure_file(

add_subdirectory(DXIL)
add_subdirectory(DxilContainer)
add_subdirectory(HLSL)
add_subdirectory(Support)
add_subdirectory(Tracing)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,7 @@ class DiagnosticInfo;

namespace hlsl {

#include "dxc/HLSL/DxilValidation.inc"

const char *GetValidationRuleText(ValidationRule value);
void GetValidationVersion(unsigned *pMajor, unsigned *pMinor);
HRESULT ValidateDxilModule(llvm::Module *pModule, llvm::Module *pDebugModule);

// DXIL Container Verification Functions (return false on failure)

bool VerifySignatureMatches(llvm::Module *pModule,
hlsl::DXIL::SignatureKind SigKind,
const void *pSigData, uint32_t SigSize);

// PSV = data for Pipeline State Validation
bool VerifyPSVMatches(llvm::Module *pModule, const void *pPSVData,
uint32_t PSVSize);

// PSV = data for Pipeline State Validation
bool VerifyRDATMatches(llvm::Module *pModule, const void *pRDATData,
uint32_t RDATSize);

bool VerifyFeatureInfoMatches(llvm::Module *pModule,
const void *pFeatureInfoData,
uint32_t FeatureInfoSize);

// Validate the container parts, assuming supplied module is valid, loaded from
// the container provided
Expand Down Expand Up @@ -106,4 +84,5 @@ class PrintDiagnosticContext {
static void PrintDiagnosticHandler(const llvm::DiagnosticInfo &DI,
void *Context);
};

} // namespace hlsl
1 change: 0 additions & 1 deletion include/dxc/HLSL/CMakeLists.txt

This file was deleted.

1 change: 1 addition & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ add_subdirectory(DxilPdbInfo) # HLSL Change
add_subdirectory(DxilPIXPasses) # HLSL Change
add_subdirectory(DxilDia) # HLSL Change
add_subdirectory(DxilRootSignature) # HLSL Change
add_subdirectory(DxilValidation) # HLSL Change
add_subdirectory(DxcBindingTable) # HLSL Change
add_subdirectory(DxrFallback) # HLSL Change
add_subdirectory(DxilCompression) # HLSL Change
15 changes: 15 additions & 0 deletions lib/DxilValidation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (C) Microsoft Corporation. All rights reserved.
# This file is distributed under the University of Illinois Open Source License. See LICENSE.TXT for details.
add_hlsl_hctgen(DxilValidationInc OUTPUT DxilValidation.inc BUILD_DIR)
add_hlsl_hctgen(DxilValidation OUTPUT DxilValidationImpl.inc BUILD_DIR)

add_llvm_library(LLVMDxilValidation
DxilContainerValidation.cpp
DxilValidation.cpp
DxilValidationUtils.cpp

ADDITIONAL_HEADER_DIRS
${LLVM_MAIN_INCLUDE_DIR}/llvm/IR
)

add_dependencies(LLVMDxilValidation intrinsics_gen)
Loading

0 comments on commit 0e7591a

Please sign in to comment.