GteHLSLTexture.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 }
16 
18  :
19  HLSLResource(desc, 0)
20 {
21  Initialize(desc);
22 }
23 
25  unsigned int index)
26  :
27  HLSLResource(desc, index, 0)
28 {
29  Initialize(desc);
30 }
31 
33 {
34  mNumComponents = ((desc.uFlags >> 2) + 1);
35 
36  switch (desc.Dimension)
37  {
38  case D3D_SRV_DIMENSION_TEXTURE1D:
39  mNumDimensions = 1;
40  break;
41  case D3D_SRV_DIMENSION_TEXTURE2D:
42  mNumDimensions = 2;
43  break;
44  case D3D_SRV_DIMENSION_TEXTURE3D:
45  mNumDimensions = 3;
46  break;
47  default:
48  mNumDimensions = 0;
49  break;
50  }
51 
52  mGpuWritable = (desc.Type == D3D_SIT_UAV_RWTYPED);
53 }
54 
55 unsigned int HLSLTexture::GetNumComponents() const
56 {
57  return mNumComponents;
58 }
59 
60 unsigned int HLSLTexture::GetNumDimensions() const
61 {
62  return mNumDimensions;
63 }
64 
66 {
67  return mGpuWritable;
68 }
69 
unsigned int mNumDimensions
unsigned int mNumComponents
virtual ~HLSLTexture()
#define D3D_SHADER_INPUT_BIND_DESC
bool IsGpuWritable() const
void Initialize(D3D_SHADER_INPUT_BIND_DESC const &desc)
unsigned int GetNumComponents() const
GLuint index
Definition: glcorearb.h:781
HLSLTexture(D3D_SHADER_INPUT_BIND_DESC const &desc)
unsigned int GetNumDimensions() const


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