LLVM 22.0.0git
DXContainerRootSignature.h
Go to the documentation of this file.
1//===- llvm/MC/DXContainerRootSignature.h - RootSignature -*- C++ -*- ========//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_MC_DXCONTAINERROOTSIGNATURE_H
10#define LLVM_MC_DXCONTAINERROOTSIGNATURE_H
11
14#include <cstdint>
15#include <limits>
16
17namespace llvm {
18
19class raw_ostream;
20namespace mcdxbc {
21
27
33
43
53
56
60
62 size_t Location) {
63 ParametersInfo.emplace_back(Type, Visibility, Location);
64 }
65
71
73 dxbc::ShaderVisibility Visibility,
74 RootDescriptor Descriptor) {
75 addInfo(Type, Visibility, Descriptors.size());
76 Descriptors.push_back(Descriptor);
77 }
78
80 dxbc::ShaderVisibility Visibility, DescriptorTable Table) {
81 addInfo(Type, Visibility, Tables.size());
82 Tables.push_back(Table);
83 }
84
85 const RootParameterInfo &getInfo(uint32_t Location) const {
86 const RootParameterInfo &Info = ParametersInfo[Location];
87 return Info;
88 }
89
90 const RootConstants &getConstant(size_t Index) const {
91 return Constants[Index];
92 }
93
94 const RootDescriptor &getRootDescriptor(size_t Index) const {
95 return Descriptors[Index];
96 }
97
98 const DescriptorTable &getDescriptorTable(size_t Index) const {
99 return Tables[Index];
100 }
101
102 size_t size() const { return ParametersInfo.size(); }
103
110};
127} // namespace mcdxbc
128} // namespace llvm
129
130#endif // LLVM_MC_DXCONTAINERROOTSIGNATURE_H
Analysis containing CSE Info
Definition CSEInfo.cpp:27
#define LLVM_ABI
Definition Compiler.h:213
This is an important base class in LLVM.
Definition Constant.h:43
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
The instances of the Type class are immutable: once they are created, they are never changed.
Definition Type.h:45
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
This is an optimization pass for GlobalISel generic memory operations.
SmallVector< dxbc::RTS0::v2::DescriptorRange > Ranges
SmallVector< dxbc::RTS0::v2::DescriptorRange >::const_iterator end() const
SmallVector< dxbc::RTS0::v2::DescriptorRange >::const_iterator begin() const
RootParameterInfo(dxbc::RootParameterType Type, dxbc::ShaderVisibility Visibility, size_t Location)
const RootDescriptor & getRootDescriptor(size_t Index) const
const DescriptorTable & getDescriptorTable(size_t Index) const
void addParameter(dxbc::RootParameterType Type, dxbc::ShaderVisibility Visibility, RootDescriptor Descriptor)
SmallVector< RootParameterInfo >::const_iterator begin() const
void addParameter(dxbc::RootParameterType Type, dxbc::ShaderVisibility Visibility, DescriptorTable Table)
SmallVector< RootParameterInfo > ParametersInfo
void addInfo(dxbc::RootParameterType Type, dxbc::ShaderVisibility Visibility, size_t Location)
const RootConstants & getConstant(size_t Index) const
void addParameter(dxbc::RootParameterType Type, dxbc::ShaderVisibility Visibility, RootConstants Constant)
SmallVector< RootParameterInfo >::const_iterator end() const
const RootParameterInfo & getInfo(uint32_t Location) const
LLVM_ABI uint32_t computeRootParametersOffset() const
LLVM_ABI void write(raw_ostream &OS) const
LLVM_ABI uint32_t computeStaticSamplersOffset() const
SmallVector< dxbc::RTS0::v1::StaticSampler > StaticSamplers
mcdxbc::RootParametersContainer ParametersContainer