GteHLSLResource.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 
10 #if defined(GTE_USE_DX12)
11 #include <Graphics/DX12/GteDX12Include.h>
12 
13 #define ID3DShaderReflection ID3D12ShaderReflection
14 #define IID_ID3DShaderReflection IID_ID3D12ShaderReflection
15 #define ID3DShaderReflectionConstantBuffer ID3D12ShaderReflectionConstantBuffer
16 #define ID3DShaderReflectionType ID3D12ShaderReflectionType
17 #define ID3DShaderReflectionVariable ID3D12ShaderReflectionVariable
18 #define D3D_SHADER_DESC D3D12_SHADER_DESC
19 #define D3D_SIGNATURE_PARAMETER_DESC D3D12_SIGNATURE_PARAMETER_DESC
20 #define D3D_SHADER_VERSION_TYPE D3D12_SHADER_VERSION_TYPE
21 #define D3D_SHVER_GET_TYPE D3D12_SHVER_GET_TYPE
22 #define D3D_SHVER_GET_MAJOR D3D12_SHVER_GET_MAJOR
23 #define D3D_SHVER_GET_MINOR D3D12_SHVER_GET_MINOR
24 #define D3D_SHADER_BUFFER_DESC D3D12_SHADER_BUFFER_DESC
25 #define D3D_SHADER_INPUT_BIND_DESC D3D12_SHADER_INPUT_BIND_DESC
26 #define D3D_SHADER_VARIABLE_DESC D3D12_SHADER_VARIABLE_DESC
27 #define D3D_SHADER_TYPE_DESC D3D12_SHADER_TYPE_DESC
28 #else
30 
31 #define ID3DShaderReflection ID3D11ShaderReflection
32 #define IID_ID3DShaderReflection IID_ID3D11ShaderReflection
33 #define ID3DShaderReflectionConstantBuffer ID3D11ShaderReflectionConstantBuffer
34 #define ID3DShaderReflectionType ID3D11ShaderReflectionType
35 #define ID3DShaderReflectionVariable ID3D11ShaderReflectionVariable
36 #define D3D_SHADER_DESC D3D11_SHADER_DESC
37 #define D3D_SIGNATURE_PARAMETER_DESC D3D11_SIGNATURE_PARAMETER_DESC
38 #define D3D_SHADER_VERSION_TYPE D3D11_SHADER_VERSION_TYPE
39 #define D3D_SHVER_GET_TYPE D3D11_SHVER_GET_TYPE
40 #define D3D_SHVER_GET_MAJOR D3D11_SHVER_GET_MAJOR
41 #define D3D_SHVER_GET_MINOR D3D11_SHVER_GET_MINOR
42 #define D3D_SHADER_BUFFER_DESC D3D11_SHADER_BUFFER_DESC
43 #define D3D_SHADER_INPUT_BIND_DESC D3D11_SHADER_INPUT_BIND_DESC
44 #define D3D_SHADER_VARIABLE_DESC D3D11_SHADER_VARIABLE_DESC
45 #define D3D_SHADER_TYPE_DESC D3D11_SHADER_TYPE_DESC
46 #endif
47 
48 #include <fstream>
49 
50 namespace gte
51 {
52 
54 {
55 public:
56  // Abstract base class, destructor.
57  virtual ~HLSLResource();
58 protected:
59  // Construction.
61  unsigned int numBytes);
62  HLSLResource(D3D_SHADER_INPUT_BIND_DESC const& desc, unsigned int index,
63  unsigned int numBytes);
64 
65 public:
66  struct Description
67  {
69  D3D_SHADER_INPUT_TYPE type;
70  unsigned int bindPoint;
71  unsigned int bindCount;
72  unsigned int flags;
73  D3D_RESOURCE_RETURN_TYPE returnType;
74  D3D_SRV_DIMENSION dimension;
75  unsigned int numSamples;
76  };
77 
78  // Member access.
79  std::string const& GetName() const;
80  D3D_SHADER_INPUT_TYPE GetType() const;
81  unsigned int GetBindPoint() const;
82  unsigned int GetBindCount() const;
83  unsigned int GetFlags() const;
84  D3D_RESOURCE_RETURN_TYPE GetReturnType() const;
85  D3D_SRV_DIMENSION GetDimension() const;
86  unsigned int GetNumSamples() const;
87  unsigned int GetNumBytes() const;
88 
89  // Print to a text file for human readability.
90  virtual void Print(std::ofstream& output) const;
91 
92 private:
94  unsigned int mNumBytes;
95 
96  // Support for Print.
97  static std::string const msSIType[];
98  static std::string const msReturnType[];
99  static std::string const msSRVDimension[];
100 };
101 
102 }
unsigned int mNumBytes
GLsizei const GLchar *const * string
Definition: glcorearb.h:809
#define D3D_SHADER_INPUT_BIND_DESC
D3D_SHADER_INPUT_TYPE type
GLuint index
Definition: glcorearb.h:781
D3D_RESOURCE_RETURN_TYPE returnType
#define GTE_IMPEXP
Definition: GTEngineDEF.h:63


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