HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VEX_RslResolver.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: VEX_RslResolver.h ( VEX Library, C++)
7  *
8  * COMMENTS: Resolver for Rsl (RenderMan Shader Language).
9  *
10  * Since shader code can't be embedded in a RIB stream, the way this
11  * resolver works is that:
12  * - The resolver will save the object code to a pre-defined directory.
13  * - The shader name will be changed to point to the object code in
14  * question.
15  */
16 
17 #ifndef __VEX_RslResolver__
18 #define __VEX_RslResolver__
19 
20 #include "VEX_API.h"
21 #include <UT/UT_NonCopyable.h>
22 
23 class UT_String;
24 
25 // ============================================================================
27 {
28 public:
29  /// @{ Specifies where the temporary source code file is created
30  /// and where the compiled object file is saved.
31  static void setCachePath(const char *path);
32  static const char *getCachePath();
33  /// @}
34 
35  // Helper that simply replaces the shader name with the appropriate path.
36  static void patchShader(UT_String &shader, const char *path);
37 
38 protected:
39  VEX_RibResolver() = default;
40  virtual ~VEX_RibResolver();
42  virtual bool canResolve(const char *shader) = 0;
43  virtual bool doResolve(UT_String &shader, int context_type) = 0;
44 };
45 
46 // ============================================================================
48 {
49 public:
50  static bool canResolveShader(UT_String &shader);
51  static bool resolveShader(UT_String &shader, int context_type);
52 
53 protected:
55  ~VEX_RslResolver() override;
57  static VEX_RslResolver *getRslResolver(const char *shader);
58 };
59 
60 // ============================================================================
61 // TODO: factor out VEX_RslResolver and VEX_OslResolver into one class without
62 // static list of resolvers
64 {
65 public:
66  static bool canResolveShader(UT_String &shader);
67  static bool resolveShader(UT_String &shader, int context_type);
68 
69 protected:
71  ~VEX_OslResolver() override;
73  static VEX_OslResolver *getOslResolver(const char *shader);
74 };
75 #endif
76 
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
#define VEX_API
Definition: VEX_API.h:14
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
GLuint shader
Definition: glcorearb.h:785