GteHLSLTextureArray.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_TEXTURE1DARRAY:
39  mNumDimensions = 1;
40  break;
41  case D3D_SRV_DIMENSION_TEXTURE2DARRAY:
42  case D3D_SRV_DIMENSION_TEXTURE2DMSARRAY:
43  case D3D_SRV_DIMENSION_TEXTURECUBE:
44  case D3D_SRV_DIMENSION_TEXTURECUBEARRAY:
45  mNumDimensions = 2;
46  break;
47  default:
48  mNumDimensions = 0;
49  break;
50  }
51 
52  mGpuWritable = (desc.Type == D3D_SIT_UAV_RWTYPED);
53 }
54 
56 {
57  return mNumComponents;
58 }
59 
61 {
62  return mNumDimensions;
63 }
64 
66 {
67  return mGpuWritable;
68 }
69 
unsigned int GetNumComponents() const
#define D3D_SHADER_INPUT_BIND_DESC
void Initialize(D3D_SHADER_INPUT_BIND_DESC const &desc)
GLuint index
Definition: glcorearb.h:781
HLSLTextureArray(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