GteHLSLShader.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>
9 #include <LowLevel/GteLogger.h>
10 #include <LowLevel/GteWrapper.h>
12 #include <algorithm>
13 #include <iomanip>
14 using namespace gte;
15 
16 
18  :
19  mName(""),
20  mEntry(""),
21  mTarget(""),
22  mNumXThreads(0),
23  mNumYThreads(0),
24  mNumZThreads(0)
25 {
26 }
27 
28 bool HLSLShader::IsValid() const
29 {
30  return mName != "" && mEntry != "" && mTarget != ""
31  && mCompiledCode.size() > 0;
32 }
33 
35 {
36  mDesc.creator = std::string(desc.Creator);
37  mDesc.shaderType = static_cast<D3D_SHADER_VERSION_TYPE>(D3D_SHVER_GET_TYPE(desc.Version));
38  mDesc.majorVersion = D3D11_SHVER_GET_MAJOR(desc.Version);
39  mDesc.minorVersion = D3D11_SHVER_GET_MINOR(desc.Version);
40  mDesc.flags = desc.Flags;
41  mDesc.numConstantBuffers = desc.ConstantBuffers;
42  mDesc.numBoundResources = desc.BoundResources;
43  mDesc.numInputParameters = desc.InputParameters;
44  mDesc.numOutputParameters = desc.OutputParameters;
45 
46  mDesc.instructions.numInstructions = desc.InstructionCount;
47  mDesc.instructions.numTemporaryRegisters = desc.TempRegisterCount;
48  mDesc.instructions.numTemporaryArrays = desc.TempArrayCount;
49  mDesc.instructions.numDefines = desc.DefCount;
50  mDesc.instructions.numDeclarations = desc.DclCount;
51  mDesc.instructions.numTextureNormal = desc.TextureNormalInstructions;
52  mDesc.instructions.numTextureLoad = desc.TextureLoadInstructions;
53  mDesc.instructions.numTextureComparison = desc.TextureCompInstructions;
54  mDesc.instructions.numTextureBias = desc.TextureBiasInstructions;
55  mDesc.instructions.numTextureGradient = desc.TextureGradientInstructions;
56  mDesc.instructions.numFloatArithmetic = desc.FloatInstructionCount;
57  mDesc.instructions.numSIntArithmetic = desc.IntInstructionCount;
58  mDesc.instructions.numUIntArithmetic = desc.UintInstructionCount;
59  mDesc.instructions.numStaticFlowControl = desc.StaticFlowControlCount;
60  mDesc.instructions.numDynamicFlowControl = desc.DynamicFlowControlCount;
61  mDesc.instructions.numMacro = desc.MacroInstructionCount;
62  mDesc.instructions.numArray = desc.ArrayInstructionCount;
63 
64  mDesc.gs.numCutInstructions = desc.CutInstructionCount;
65  mDesc.gs.numEmitInstructions = desc.EmitInstructionCount;
66  mDesc.gs.inputPrimitive = desc.InputPrimitive;
67  mDesc.gs.outputTopology = desc.GSOutputTopology;
68  mDesc.gs.maxOutputVertices = desc.GSMaxOutputVertexCount;
69 
70  mDesc.ts.numPatchConstants = desc.PatchConstantParameters;
71  mDesc.ts.numGSInstances = desc.cGSInstanceCount;
72  mDesc.ts.numControlPoints = desc.cControlPoints;
73  mDesc.ts.inputPrimitive = desc.InputPrimitive;
74  mDesc.ts.outputPrimitive = desc.HSOutputPrimitive;
75  mDesc.ts.partitioning = desc.HSPartitioning;
76  mDesc.ts.domain = desc.TessellatorDomain;
77 
78  mDesc.cs.numBarrierInstructions = desc.cBarrierInstructions;
79  mDesc.cs.numInterlockedInstructions = desc.cInterlockedInstructions;
80  mDesc.cs.numTextureStoreInstructions = desc.cTextureStoreInstructions;
81 }
82 
84 {
85  mName = name;
86 }
87 
89 {
90  mEntry = entry;
91 }
92 
94 {
95  mTarget = target;
96 }
97 
98 void HLSLShader::InsertInput(HLSLParameter const& parameter)
99 {
100  mInputs.push_back(parameter);
101 }
102 
104 {
105  mOutputs.push_back(parameter);
106 }
107 
109 {
110  mCBuffers.push_back(cbuffer);
111 }
112 
114 {
115  mTBuffers.push_back(tbuffer);
116 }
117 
119 {
120  mSBuffers.push_back(sbuffer);
121 }
122 
124 {
125  mRBuffers.push_back(rbuffer);
126 }
127 
129 {
130  mTextures.push_back(texture);
131 }
132 
133 void HLSLShader::Insert(HLSLTextureArray const& textureArray)
134 {
135  mTextureArrays.push_back(textureArray);
136 }
137 
138 void HLSLShader::Insert(HLSLSamplerState const& samplerState)
139 {
140  mSamplerStates.push_back(samplerState);
141 }
142 
144 {
145  mRBInfos.push_back(rbinfo);
146 }
147 
148 void HLSLShader::SetCompiledCode(size_t numBytes, void const* buffer)
149 {
150  mCompiledCode.resize(numBytes);
151  Memcpy(&mCompiledCode[0], buffer, numBytes);
152 }
153 
155 {
156  return mDesc;
157 }
158 
160 {
161  return mName;
162 }
163 
165 {
166  return mEntry;
167 }
168 
170 {
171  return mTarget;
172 }
173 
175 {
176  switch (mTarget[0])
177  {
178  case 'v':
179  return 0;
180  case 'g':
181  return 1;
182  case 'p':
183  return 2;
184  case 'c':
185  return 3;
186  default:
187  LogError("Invalid shader type.");
188  return 0;
189  }
190 }
191 
192 std::vector<HLSLParameter> const& HLSLShader::GetInputs() const
193 {
194  return mInputs;
195 }
196 
197 std::vector<HLSLParameter> const& HLSLShader::GetOutputs() const
198 {
199  return mOutputs;
200 }
201 
202 std::vector<HLSLConstantBuffer> const& HLSLShader::GetCBuffers() const
203 {
204  return mCBuffers;
205 }
206 
207 std::vector<HLSLTextureBuffer> const& HLSLShader::GetTBuffers() const
208 {
209  return mTBuffers;
210 }
211 
212 std::vector<HLSLStructuredBuffer> const& HLSLShader::GetSBuffers() const
213 {
214  return mSBuffers;
215 }
216 
217 std::vector<HLSLByteAddressBuffer> const& HLSLShader::GetRBuffers() const
218 {
219  return mRBuffers;
220 }
221 
222 std::vector<HLSLTexture> const& HLSLShader::GetTextures() const
223 {
224  return mTextures;
225 }
226 
227 std::vector<HLSLTextureArray> const& HLSLShader::GetTextureArrays() const
228 {
229  return mTextureArrays;
230 }
231 
232 std::vector<HLSLSamplerState> const& HLSLShader::GetSamplerStates() const
233 {
234  return mSamplerStates;
235 }
236 
237 std::vector<HLSLResourceBindInfo> const& HLSLShader::GetResourceBindInfos()
238  const
239 {
240  return mRBInfos;
241 }
242 
243 std::vector<unsigned char> const& HLSLShader::GetCompiledCode() const
244 {
245  return mCompiledCode;
246 }
247 
248 void HLSLShader::SetNumThreads(unsigned int numXThreads,
249  unsigned int numYThreads, unsigned int numZThreads)
250 {
251  mNumXThreads = numXThreads;
252  mNumYThreads = numYThreads;
253  mNumZThreads = numZThreads;
254 }
255 
256 unsigned int HLSLShader::GetNumXThreads() const
257 {
258  return mNumXThreads;
259 }
260 
261 unsigned int HLSLShader::GetNumYThreads() const
262 {
263  return mNumYThreads;
264 }
265 
266 unsigned int HLSLShader::GetNumZThreads() const
267 {
268  return mNumZThreads;
269 }
270 
271 void HLSLShader::Print(std::ofstream& output) const
272 {
273  output << mName << std::endl;
274  output << mEntry << std::endl;
275  output << mTarget << std::endl;
276  output << std::endl;
277 
278  output << "Description:" << std::endl;
279  output << "creator = " << mDesc.creator << std::endl;
280  int i = std::min((int)(mDesc.shaderType), 6);
281  output << "shader type = " << msShaderType[i] << std::endl;
282  output << "shader version = "
283  << mDesc.majorVersion << "." << mDesc.minorVersion << std::endl;
284  output << "compile flags =" << std::endl;
285  for (i = 0; i < 20; ++i)
286  {
287  if (mDesc.flags & (1 << i))
288  {
289  output << " " << msCompileFlags[i] << std::endl;
290  }
291  }
292  output << "constant buffers = "
293  << mDesc.numConstantBuffers << std::endl;
294  output << "bound resources = "
295  << mDesc.numBoundResources << std::endl;
296  output << "input parameters = "
297  << mDesc.numInputParameters << std::endl;
298  output << "output parameters = "
299  << mDesc.numOutputParameters << std::endl;
300  output << std::endl;
301 
302  output << "Instructions:" << std::endl;
303  output << "total instructions = "
304  << mDesc.instructions.numInstructions << std::endl;
305  output << "temporary registers = "
306  << mDesc.instructions.numTemporaryRegisters << std::endl;
307  output << "temporary arrays = "
308  << mDesc.instructions.numTemporaryArrays << std::endl;
309  output << "defines = "
310  << mDesc.instructions.numDefines << std::endl;
311  output << "declarations = "
312  << mDesc.instructions.numDeclarations << std::endl;
313  output << "texture normal = "
314  << mDesc.instructions.numTextureNormal << std::endl;
315  output << "texture load = "
316  << mDesc.instructions.numTextureLoad << std::endl;
317  output << "texture comparison = "
318  << mDesc.instructions.numTextureComparison << std::endl;
319  output << "texture bias = "
320  << mDesc.instructions.numTextureBias << std::endl;
321  output << "texture gradient = "
322  << mDesc.instructions.numTextureGradient << std::endl;
323  output << "float arithmetic = "
324  << mDesc.instructions.numFloatArithmetic << std::endl;
325  output << "signed int arithmetic = "
326  << mDesc.instructions.numSIntArithmetic << std::endl;
327  output << "unsigned int arithmetic = "
328  << mDesc.instructions.numUIntArithmetic << std::endl;
329  output << "static flow control = "
330  << mDesc.instructions.numStaticFlowControl << std::endl;
331  output << "dynamic flow control = "
332  << mDesc.instructions.numDynamicFlowControl << std::endl;
333  output << "macros = "
334  << mDesc.instructions.numMacro << std::endl;
335  output << "array = "
336  << mDesc.instructions.numArray << std::endl;
337  output << std::endl;
338 
339  output << "Geometry shader parameters:" << std::endl;
340  output << "cut instructions = "
341  << mDesc.gs.numCutInstructions << std::endl;
342  output << "emit instructions = "
343  << mDesc.gs.numEmitInstructions << std::endl;
344  output << "input primitive = "
345  << msPrimitive[mDesc.gs.inputPrimitive] << std::endl;
346  output << "output topology = "
347  << msPrimitiveTopology[mDesc.gs.outputTopology] << std::endl;
348  output << "max output vertices = "
349  << mDesc.gs.maxOutputVertices << std::endl;
350  output << std::endl;
351 
352  output << "Tessellation parameters:" << std::endl;
353  output << "patch constants = "
354  << mDesc.ts.numPatchConstants << std::endl;
355  output << "geometry shader instances = "
356  << mDesc.ts.numGSInstances << std::endl;
357  output << "patch constants = "
358  << mDesc.ts.numPatchConstants << std::endl;
359  output << "control points = "
360  << mDesc.ts.numControlPoints << std::endl;
361  output << "input primitive = "
362  << msPrimitive[mDesc.ts.inputPrimitive] << std::endl;
363  output << "output primitive = "
364  << msOutputPrimitive[mDesc.ts.outputPrimitive] << std::endl;
365  output << "partitioning = "
366  << msPartitioning[mDesc.ts.partitioning] << std::endl;
367  output << "domain = "
368  << msDomain[mDesc.ts.domain] << std::endl;
369  output << std::endl;
370 
371  output << "Compute shader parameters:" << std::endl;
372  output << "barrier instructions = "
373  << mDesc.cs.numBarrierInstructions << std::endl;
374  output << "interlocked instructions = "
375  << mDesc.cs.numInterlockedInstructions << std::endl;
376  output << "texture store instructions = "
377  << mDesc.cs.numTextureStoreInstructions << std::endl;
378  output << std::endl;
379 
380  i = 0;
381  for (auto const& obj : mInputs)
382  {
383  output << "Input[" << i << "]:" << std::endl;
384  obj.Print(output);
385  output << std::endl;
386  ++i;
387  }
388 
389  i = 0;
390  for (auto const& obj : mOutputs)
391  {
392  output << "Output[" << i << "]:" << std::endl;
393  obj.Print(output);
394  output << std::endl;
395  ++i;
396  }
397 
398  i = 0;
399  for (auto const& obj : mCBuffers)
400  {
401  output << "ConstantBuffer[" << i << "]:" << std::endl;
402  obj.Print(output);
403  output << std::endl;
404  ++i;
405  }
406 
407  i = 0;
408  for (auto const& obj : mTBuffers)
409  {
410  output << "TextureBuffer[" << i << "]:" << std::endl;
411  obj.Print(output);
412  output << std::endl;
413  ++i;
414  }
415 
416  i = 0;
417  for (auto const& obj : mSBuffers)
418  {
419  output << "StructuredBuffer[" << i << "]:" << std::endl;
420  obj.Print(output);
421  output << std::endl;
422  ++i;
423  }
424 
425  i = 0;
426  for (auto const& obj : mRBuffers)
427  {
428  output << "ByteAddressBuffer[" << i << "]:" << std::endl;
429  obj.Print(output);
430  output << std::endl;
431  ++i;
432  }
433 
434  i = 0;
435  for (auto const& obj : mTextures)
436  {
437  output << "Texture[" << i << "]:" << std::endl;
438  obj.Print(output);
439  output << std::endl;
440  ++i;
441  }
442 
443  i = 0;
444  for (auto const& obj : mTextureArrays)
445  {
446  output << "TextureArray[" << i << "]:" << std::endl;
447  obj.Print(output);
448  output << std::endl;
449  ++i;
450  }
451 
452  i = 0;
453  for (auto const& obj : mSamplerStates)
454  {
455  output << "SamplerState[" << i << "]:" << std::endl;
456  obj.Print(output);
457  output << std::endl;
458  ++i;
459  }
460 
461  i = 0;
462  for (auto const& obj : mRBInfos)
463  {
464  output << "ResourceBinding[" << i << "]:" << std::endl;
465  obj.Print(output);
466  output << std::endl;
467  ++i;
468  }
469 
470  output << "numthreads = (" << mNumXThreads << "," << mNumYThreads
471  << "," << mNumZThreads << ")" << std::endl << std::endl;
472 
473  output << "compiled code = ";
474  size_t size = mCompiledCode.size();
475  if (size > 0)
476  {
477  output << std::hex << std::endl;
478  size_t j = 0;
479  for (auto c : mCompiledCode)
480  {
481  unsigned int hc = static_cast<unsigned int>(c);
482  output << "0x" << std::setw(2) << std::setfill('0') << hc;
483  if ((++j % 16) == 0)
484  {
485  if (j != size)
486  {
487  output << std::endl;
488  }
489  }
490  else
491  {
492  output << ' ';
493  }
494  }
495  output << std::dec;
496  }
497  else
498  {
499  output << "none";
500  }
501  output << std::endl;
502 }
503 
504 
506 {
507  "pixel",
508  "vertex",
509  "geometry",
510  "domain",
511  "hull",
512  "compute",
513  "invalid"
514 };
515 
517 {
518  "D3DCOMPILE_DEBUG",
519  "D3DCOMPILE_SKIP_VALIDATION",
520  "D3DCOMPILE_SKIP_OPTIMIZATION",
521  "D3DCOMPILE_PACK_MATRIX_ROW_MAJOR",
522  "D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR",
523  "D3DCOMPILE_PARTIAL_PRECISION",
524  "D3DCOMPILE_FORCE_VS_SOFTWARE_NO_OPT",
525  "D3DCOMPILE_FORCE_PS_SOFTWARE_NO_OPT",
526  "D3DCOMPILE_NO_PRESHADER",
527  "D3DCOMPILE_AVOID_FLOW_CONTROL",
528  "D3DCOMPILE_PREFER_FLOW_CONTROL",
529  "D3DCOMPILE_ENABLE_STRICTNESS",
530  "D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY",
531  "D3DCOMPILE_IEEE_STRICTNESS",
532  "D3DCOMPILE_OPTIMIZATION_LEVEL0",
533  "D3DCOMPILE_OPTIMIZATION_LEVEL3",
534  "D3DCOMPILE_RESERVED16",
535  "D3DCOMPILE_RESERVED17",
536  "D3DCOMPILE_WARNINGS_ARE_ERRORS",
537  "D3DCOMPILE_RESOURCES_MAY_ALIAS"
538 };
539 
541 {
542  "D3D_PRIMITIVE_UNDEFINED",
543  "D3D_PRIMITIVE_POINT",
544  "D3D_PRIMITIVE_LINE",
545  "D3D_PRIMITIVE_TRIANGLE",
546  "", "", // 4-5 unused
547  "D3D_PRIMITIVE_LINE_ADJ",
548  "D3D_PRIMITIVE_TRIANGLE_ADJ",
549  "D3D_PRIMITIVE_1_CONTROL_POINT_PATCH",
550  "D3D_PRIMITIVE_2_CONTROL_POINT_PATCH",
551  "D3D_PRIMITIVE_3_CONTROL_POINT_PATCH",
552  "D3D_PRIMITIVE_4_CONTROL_POINT_PATCH",
553  "D3D_PRIMITIVE_5_CONTROL_POINT_PATCH",
554  "D3D_PRIMITIVE_6_CONTROL_POINT_PATCH",
555  "D3D_PRIMITIVE_7_CONTROL_POINT_PATCH",
556  "D3D_PRIMITIVE_8_CONTROL_POINT_PATCH",
557  "D3D_PRIMITIVE_9_CONTROL_POINT_PATCH",
558  "D3D_PRIMITIVE_10_CONTROL_POINT_PATCH",
559  "D3D_PRIMITIVE_11_CONTROL_POINT_PATCH",
560  "D3D_PRIMITIVE_12_CONTROL_POINT_PATCH",
561  "D3D_PRIMITIVE_13_CONTROL_POINT_PATCH",
562  "D3D_PRIMITIVE_14_CONTROL_POINT_PATCH",
563  "D3D_PRIMITIVE_15_CONTROL_POINT_PATCH",
564  "D3D_PRIMITIVE_16_CONTROL_POINT_PATCH",
565  "D3D_PRIMITIVE_17_CONTROL_POINT_PATCH",
566  "D3D_PRIMITIVE_18_CONTROL_POINT_PATCH",
567  "D3D_PRIMITIVE_19_CONTROL_POINT_PATCH",
568  "", // 27 unused (appears to be a numbering error)
569  "D3D_PRIMITIVE_20_CONTROL_POINT_PATCH",
570  "D3D_PRIMITIVE_21_CONTROL_POINT_PATCH",
571  "D3D_PRIMITIVE_22_CONTROL_POINT_PATCH",
572  "D3D_PRIMITIVE_23_CONTROL_POINT_PATCH",
573  "D3D_PRIMITIVE_24_CONTROL_POINT_PATCH",
574  "D3D_PRIMITIVE_25_CONTROL_POINT_PATCH",
575  "D3D_PRIMITIVE_26_CONTROL_POINT_PATCH",
576  "D3D_PRIMITIVE_27_CONTROL_POINT_PATCH",
577  "D3D_PRIMITIVE_28_CONTROL_POINT_PATCH",
578  "D3D_PRIMITIVE_29_CONTROL_POINT_PATCH",
579  "D3D_PRIMITIVE_30_CONTROL_POINT_PATCH",
580  "D3D_PRIMITIVE_31_CONTROL_POINT_PATCH",
581  "D3D_PRIMITIVE_32_CONTROL_POINT_PATCH"
582 };
583 
585 {
586  "D3D_PRIMITIVE_TOPOLOGY_UNDEFINED",
587  "D3D_PRIMITIVE_TOPOLOGY_POINTLIST",
588  "D3D_PRIMITIVE_TOPOLOGY_LINELIST",
589  "D3D_PRIMITIVE_TOPOLOGY_LINESTRIP",
590  "D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST",
591  "D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP",
592  "", "", "", "", // 6-9 unused
593  "D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = 10",
594  "D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = 11",
595  "D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = 12",
596  "D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = 13",
597  "", "", "", "", "", "", "", "", "", "",
598  "", "", "", "", "", "", "", "", "", // 14-32 unused
599  "D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST",
600  "D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST",
601  "D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST",
602  "D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST",
603  "D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST",
604  "D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST",
605  "D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST",
606  "D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST",
607  "D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST",
608  "D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST",
609  "D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST",
610  "D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST",
611  "D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST",
612  "D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST",
613  "D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST",
614  "D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST",
615  "D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST",
616  "D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST",
617  "D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST",
618  "D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST",
619  "D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST",
620  "D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST",
621  "D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST",
622  "D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST",
623  "D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST",
624  "D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST",
625  "D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST",
626  "D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST",
627  "D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST",
628  "D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST",
629  "D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST",
630  "D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST"
631 };
632 
634 {
635  "D3D_TESSELLATOR_OUTPUT_UNDEFINED",
636  "D3D_TESSELLATOR_OUTPUT_POINT",
637  "D3D_TESSELLATOR_OUTPUT_LINE",
638  "D3D_TESSELLATOR_OUTPUT_TRIANGLE_CW",
639  "D3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW"
640 };
641 
643 {
644  "D3D_TESSELLATOR_PARTITIONING_UNDEFINED",
645  "D3D_TESSELLATOR_PARTITIONING_INTEGER",
646  "D3D_TESSELLATOR_PARTITIONING_POW2",
647  "D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD",
648  "D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN"
649 };
650 
652 {
653  "D3D_TESSELLATOR_DOMAIN_UNDEFINED",
654  "D3D_TESSELLATOR_DOMAIN_ISOLINE",
655  "D3D_TESSELLATOR_DOMAIN_TRI",
656  "D3D_TESSELLATOR_DOMAIN_QUAD"
657 };
std::vector< unsigned char > mCompiledCode
std::vector< HLSLStructuredBuffer > const & GetSBuffers() const
std::vector< HLSLTexture > mTextures
Description mDesc
std::string mTarget
D3D_SHADER_VERSION_TYPE shaderType
Definition: GteHLSLShader.h:79
void SetTarget(std::string const &target)
void InsertOutput(HLSLParameter const &parameter)
std::vector< unsigned char > const & GetCompiledCode() const
bool IsValid() const
std::vector< HLSLParameter > mOutputs
std::string mName
void SetEntry(std::string const &entry)
std::vector< HLSLTextureArray > const & GetTextureArrays() const
std::string mEntry
GLhandleARB obj
Definition: glext.h:3929
GLuint const GLchar * name
Definition: glcorearb.h:781
void SetDescription(D3D_SHADER_DESC const &desc)
static std::string const msPrimitiveTopology[]
GLenum target
Definition: glcorearb.h:1662
GLsizeiptr size
Definition: glcorearb.h:659
unsigned int mNumYThreads
std::vector< HLSLConstantBuffer > mCBuffers
void Print(std::ofstream &output) const
std::vector< HLSLParameter > const & GetOutputs() const
int GetShaderTypeIndex() const
static std::string const msPartitioning[]
static std::string const msPrimitive[]
void SetCompiledCode(size_t numBytes, void const *buffer)
const GLubyte * c
Definition: glext.h:11671
std::vector< HLSLByteAddressBuffer > const & GetRBuffers() const
std::vector< HLSLSamplerState > const & GetSamplerStates() const
void InsertInput(HLSLParameter const &parameter)
unsigned int GetNumXThreads() const
GLsizei const GLchar *const * string
Definition: glcorearb.h:809
#define LogError(message)
Definition: GteLogger.h:92
std::vector< HLSLTexture > const & GetTextures() const
void SetNumThreads(unsigned int numXThreads, unsigned int numYThreads, unsigned int numZThreads)
GLuint texture
Definition: glcorearb.h:410
void SetName(std::string const &name)
std::vector< HLSLByteAddressBuffer > mRBuffers
std::vector< HLSLSamplerState > mSamplerStates
Description const & GetDescription() const
std::string const & GetTarget() const
static std::string const msOutputPrimitive[]
std::vector< HLSLTextureArray > mTextureArrays
static std::string const msDomain[]
D3D_TESSELLATOR_OUTPUT_PRIMITIVE outputPrimitive
Definition: GteHLSLShader.h:66
std::vector< HLSLStructuredBuffer > mSBuffers
D3D_TESSELLATOR_PARTITIONING partitioning
Definition: GteHLSLShader.h:67
std::string const & GetEntry() const
std::vector< HLSLConstantBuffer > const & GetCBuffers() const
std::vector< HLSLParameter > const & GetInputs() const
static std::string const msCompileFlags[]
unsigned int mNumZThreads
void Memcpy(void *target, void const *source, size_t count)
Definition: GteWrapper.cpp:16
static std::string const msShaderType[]
std::vector< HLSLTextureBuffer > const & GetTBuffers() const
#define D3D_SHVER_GET_TYPE
unsigned int mNumXThreads
void Insert(HLSLConstantBuffer const &cbuffer)
std::vector< HLSLParameter > mInputs
GLuint buffer
Definition: glcorearb.h:655
InstructionCount instructions
Definition: GteHLSLShader.h:87
unsigned int GetNumYThreads() const
std::vector< HLSLResourceBindInfo > const & GetResourceBindInfos() const
std::string const & GetName() const
#define D3D_SHADER_DESC
#define D3D_SHADER_VERSION_TYPE
unsigned int GetNumZThreads() const
std::vector< HLSLTextureBuffer > mTBuffers
std::vector< HLSLResourceBindInfo > mRBInfos


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