GteHLSLProgramFactory.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.0 (2016/06/19)
7 
8 #pragma once
9 
11 
12 namespace gte
13 {
14 
16 {
17 public:
18  // The 'defaultVersion' can be set once on application initialization if
19  // you want an HLSL version different from our default when constructing a
20  // program factory.
21  static std::string defaultVersion; // "5_0" (Shader Model 5)
22  static std::string defaultVSEntry; // "VSMain"
23  static std::string defaultPSEntry; // "PSMain"
24  static std::string defaultGSEntry; // "GSMain"
25  static std::string defaultCSEntry; // "CSMain"
26  static unsigned int defaultFlags;
27  // enable strictness, ieee strictness, optimization level 3
28 
29  // Construction. The 'version' member is set to 'defaultVersion'. The
30  // 'defines' are empty.
31  virtual ~HLSLProgramFactory();
33 
34  // The returned value is used as a lookup index into arrays of strings
35  // corresponding to shader programs.
36  virtual int GetAPI() const;
37 
38  // Create a program for GPU display.
39  std::shared_ptr<VisualProgram> CreateFromBytecode(
40  std::vector<unsigned char> const& vsBytecode,
41  std::vector<unsigned char> const& psBytecode,
42  std::vector<unsigned char> const& gsBytecode);
43 
44  // Create a program for GPU computing.
45  std::shared_ptr<ComputeProgram> CreateFromBytecode(
46  std::vector<unsigned char> const& csBytecode);
47 
48 private:
49  // Create a program for GPU display. The files are loaded, converted to
50  // strings, and passed to CreateFromNamedSources. The filenames are
51  // passed as the 'xsName' parameters in case the shader compiler needs
52  // this for #include path searches.
53  virtual std::shared_ptr<VisualProgram> CreateFromNamedSources(
54  std::string const& vsName, std::string const& vsSource,
55  std::string const& psName, std::string const& psSource,
56  std::string const& gsName, std::string const& gsSource);
57 
58  // Create a program for GPU computing. The file is loaded, converted to
59  // a string, and passed to CreateFromNamedSource. The filename is passed
60  // as the 'csName' parameters in case the shader compiler needs this for
61  // #include path searches.
62  virtual std::shared_ptr<ComputeProgram> CreateFromNamedSource(
63  std::string const& csName, std::string const& csSource);
64 };
65 
66 }
static std::string defaultVersion
static std::string defaultCSEntry
static std::string defaultVSEntry
static std::string defaultGSEntry
GLsizei const GLchar *const * string
Definition: glcorearb.h:809
static std::string defaultPSEntry
static unsigned int defaultFlags
#define GTE_IMPEXP
Definition: GTEngineDEF.h:63


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