GteHLSLParameter.cpp
Go to the documentation of this file.
1 // David Eberly, Geometric Tools, Redmond WA 98052
2 // Copyright (c) 1998-2017
3 // Distributed under the Boost Software License, Version 1.0.
4 // http://www.boost.org/LICENSE_1_0.txt
5 // http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6 // File Version: 3.0.1 (2016/09/12)
7 
8 #include <GTEnginePCH.h>
10 using namespace gte;
11 
12 
14 {
15  mDesc.semanticName = std::string(desc.SemanticName);
16  mDesc.semanticIndex = desc.SemanticIndex;
17  mDesc.registerIndex = desc.Register;
18  mDesc.systemValueType = desc.SystemValueType;
19  mDesc.componentType = desc.ComponentType;
20  mDesc.mask = desc.Mask;
21  mDesc.readWriteMask = desc.ReadWriteMask;
22  mDesc.stream = desc.Stream;
23  mDesc.minPrecision = desc.MinPrecision;
24 }
25 
27 {
28  return mDesc.semanticName;
29 }
30 
31 unsigned int HLSLParameter::GetSemanticIndex() const
32 {
33  return mDesc.semanticIndex;
34 }
35 
36 unsigned int HLSLParameter::GetRegisterIndex() const
37 {
38  return mDesc.registerIndex;
39 }
40 
42 {
43  return mDesc.systemValueType;
44 }
45 
46 D3D_REGISTER_COMPONENT_TYPE HLSLParameter::GetComponentType() const
47 {
48  return mDesc.componentType;
49 }
50 
51 unsigned int HLSLParameter::GetMask() const
52 {
53  return mDesc.mask;
54 }
55 
56 unsigned int HLSLParameter::GetReadWriteMask() const
57 {
58  return mDesc.readWriteMask;
59 }
60 
61 unsigned int HLSLParameter::GetStream() const
62 {
63  return mDesc.stream;
64 }
65 
66 D3D_MIN_PRECISION HLSLParameter::GetMinPrecision() const
67 {
68  return mDesc.minPrecision;
69 }
70 
71 void HLSLParameter::Print(std::ofstream& output) const
72 {
73  output << "semantic name = " << mDesc.semanticName << std::endl;
74  output << "semantic index = " << mDesc.semanticIndex << std::endl;
75  output << "register index = " << mDesc.registerIndex << std::endl;
76  output << "system value type = "
77  << msSVName[mDesc.systemValueType] << std::endl;
78  output << "register component type = "
79  << msComponentType[mDesc.componentType] << std::endl;
80 
81  output << std::hex << std::showbase;
82  output << "mask = " << mDesc.mask << std::endl;
83  output << "read-write mask = " << mDesc.readWriteMask << std::endl;
84  output << std::dec << std::noshowbase;
85 
86  output << "stream = " << mDesc.stream << std::endl;
87 
88  int i = static_cast<int>(mDesc.minPrecision);
89  if (i & 0x000000F0)
90  {
91  i = 6 + (i & 1);
92  }
93  output << "min precision = " << msMinPrecision[i] << std::endl;
94 }
95 
96 
98 {
99  "D3D_NAME_UNDEFINED",
100  "D3D_NAME_POSITION",
101  "D3D_NAME_CLIP_DISTANCE",
102  "D3D_NAME_CULL_DISTANCE",
103  "D3D_NAME_RENDER_TARGET_ARRAY_INDEX",
104  "D3D_NAME_VIEWPORT_ARRAY_INDEX",
105  "D3D_NAME_VERTEX_ID",
106  "D3D_NAME_PRIMITIVE_ID",
107  "D3D_NAME_INSTANCE_ID",
108  "D3D_NAME_IS_FRONT_FACE",
109  "D3D_NAME_SAMPLE_INDEX",
110  "D3D_NAME_FINAL_QUAD_EDGE_TESSFACTOR",
111  "D3D_NAME_FINAL_QUAD_INSIDE_TESSFACTOR",
112  "D3D_NAME_FINAL_TRI_EDGE_TESSFACTOR",
113  "D3D_NAME_FINAL_TRI_INSIDE_TESSFACTOR",
114  "D3D_NAME_FINAL_LINE_DETAIL_TESSFACTOR",
115  "D3D_NAME_FINAL_LINE_DENSITY_TESSFACTOR",
116  "", "", "", "", "", "", "", "", "", "", "", "",
117  "", "", "", "", "", "", "", "", "", "", "", "",
118  "", "", "", "", "", "", "", "", "", "", "", "",
119  "", "", "", "", "", "", "", "", "", "", "", // 17-63 unused
120  "D3D_NAME_TARGET",
121  "D3D_NAME_DEPTH",
122  "D3D_NAME_COVERAGE",
123  "D3D_NAME_DEPTH_GREATER_EQUAL",
124  "D3D_NAME_DEPTH_LESS_EQUAL"
125 };
126 
128 {
129  "D3D_REGISTER_COMPONENT_UNKNOWN",
130  "D3D_REGISTER_COMPONENT_UINT32",
131  "D3D_REGISTER_COMPONENT_SINT32",
132  "D3D_REGISTER_COMPONENT_FLOAT32"
133 };
134 
136 {
137  "D3D_MIN_PRECISION_DEFAULT",
138  "D3D_MIN_PRECISION_FLOAT_16",
139  "D3D_MIN_PRECISION_FLOAT_2_8",
140  "D3D_MIN_PRECISION_RESERVED",
141  "D3D_MIN_PRECISION_SINT_16",
142  "D3D_MIN_PRECISION_UINT_16",
143  "D3D_MIN_PRECISION_ANY_16",
144  "D3D_MIN_PRECISION_ANY_10"
145 };
void Print(std::ofstream &output) const
D3D_MIN_PRECISION GetMinPrecision() const
static std::string const msSVName[]
static std::string const msMinPrecision[]
D3D_NAME GetSystemValueType() const
unsigned int GetReadWriteMask() const
unsigned int GetMask() const
unsigned int GetRegisterIndex() const
#define D3D_SIGNATURE_PARAMETER_DESC
D3D_REGISTER_COMPONENT_TYPE componentType
GLsizei const GLchar *const * string
Definition: glcorearb.h:809
D3D_REGISTER_COMPONENT_TYPE GetComponentType() const
unsigned int GetSemanticIndex() const
static std::string const msComponentType[]
HLSLParameter(D3D_SIGNATURE_PARAMETER_DESC const &desc)
std::string const & GetSemanticName() const
unsigned int GetStream() const


geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 04:00:00