Xiang Li b861507912 [DIrectX backend] emit metadata for entry.
New named metadata "dx.entryPoints" is added to save all entries.

Each entry is in format of
!{ptr to function, name, signature, resource table, extra}

For compute shader, the extra will save num of threads in format of {i32 x, i32 y, i32 z}

For library profile, an empty entry will be added to save the resource table for the library.

Signature and resource table metadata is not generated yet.

Differential Revision: https://reviews.llvm.org/D131807
2022-12-21 14:56:27 -05:00

42 lines
1.0 KiB
C++

//===- DXILMetadata.h - DXIL Metadata helper objects ----------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
///
/// \file This file contains helper objects for working with DXIL metadata.
///
//===----------------------------------------------------------------------===//
#ifndef LLVM_TARGET_DIRECTX_DXILMETADATA_H
#define LLVM_TARGET_DIRECTX_DXILMETADATA_H
#include <stdint.h>
namespace llvm {
class Module;
class NamedMDNode;
class VersionTuple;
namespace dxil {
class ValidatorVersionMD {
NamedMDNode *Entry;
public:
ValidatorVersionMD(Module &M);
void update(VersionTuple ValidatorVer);
bool isEmpty();
};
void createShaderModelMD(Module &M);
void createEntryMD(Module &M, const uint64_t ShaderFlags);
} // namespace dxil
} // namespace llvm
#endif // LLVM_TARGET_DIRECTX_DXILMETADATA_H