GteHLSLShaderType.h
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 #pragma once
9 
11 #include <fstream>
12 #include <vector>
13 
14 namespace gte
15 {
16 
18 {
19 public:
20  struct Description
21  {
22  D3D_SHADER_VARIABLE_CLASS varClass;
23  D3D_SHADER_VARIABLE_TYPE varType;
24  unsigned int numRows;
25  unsigned int numColumns;
26  unsigned int numElements;
27  unsigned int numChildren;
28  unsigned int offset;
30  };
31 
32  // Construction.
34 
35  // Deferred construction for shader reflection. These functions are
36  // intended to be write-once.
37  void SetDescription(D3D_SHADER_TYPE_DESC const& desc);
38  void SetName(std::string const& name);
39 
40  // This is non-const and is intended to be used as part of the Set*
41  // write-once system. HLSLShaderFactory::{GetVariables,GetTypes} are
42  // the clients and they ensure that i is a valid index.
43  HLSLShaderType& GetChild(unsigned int i);
44 
45  // For use in construction of lookup tables for name-offset pairs.
46  HLSLShaderType const& GetChild(unsigned int i) const;
47 
48  // Member access.
49  std::string const& GetName() const;
50  D3D_SHADER_VARIABLE_CLASS GetClass() const;
51  D3D_SHADER_VARIABLE_TYPE GetType() const;
52  unsigned int GetNumRows() const;
53  unsigned int GetNumColumns() const;
54  unsigned int GetNumElements() const;
55  unsigned int GetNumChildren() const;
56  unsigned int GetOffset() const;
57  std::string const& GetTypeName() const;
58  std::vector<HLSLShaderType> const& GetChildren() const;
59 
60  // Print to a text file for human readability.
61  void Print(std::ofstream& output, int indent) const;
62 
63 private:
66  std::vector<HLSLShaderType> mChildren;
67 
68  // Support for Print.
69  static std::string const msVarClass[];
70  static std::string const msVarType[];
71 };
72 
73 }
D3D_SHADER_VARIABLE_CLASS varClass
#define D3D_SHADER_TYPE_DESC
D3D_SHADER_VARIABLE_TYPE varType
GLuint const GLchar * name
Definition: glcorearb.h:781
std::vector< HLSLShaderType > mChildren
GLsizei const GLchar *const * string
Definition: glcorearb.h:809
#define GTE_IMPEXP
Definition: GTEngineDEF.h:63


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