RenderManAPI  24.0
RixShaderInfo.h
Go to the documentation of this file.
1 /*
2 # ------------------------------------------------------------------------------
3 #
4 # Copyright (c) 2020 Pixar. All rights reserved.
5 #
6 # The information in this file (the "Software") is provided for the exclusive
7 # use of the software licensees of Pixar ("Licensees"). Licensees have the
8 # right to incorporate the Software into other products for use by other
9 # authorized software licensees of Pixar, without fee. Except as expressly
10 # permitted herein, the Software may not be disclosed to third parties, copied
11 # or duplicated in any form, in whole or in part, without the prior written
12 # permission of Pixar.
13 #
14 # The copyright notices in the Software and this entire statement, including the
15 # above license grant, this restriction and the following disclaimer, must be
16 # included in all copies of the Software, in whole or in part, and all permitted
17 # derivative works of the Software, unless such copies or derivative works are
18 # solely in the form of machine-executable object code generated by a source
19 # language processor.
20 #
21 # PIXAR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
22 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL PIXAR BE
23 # LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
24 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
25 # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
26 # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. IN NO CASE WILL
27 # PIXAR'S TOTAL LIABILITY FOR ALL DAMAGES ARISING OUT OF OR IN CONNECTION WITH
28 # THE USE OR PERFORMANCE OF THIS SOFTWARE EXCEED $50.
29 #
30 # Pixar
31 # 1200 Park Ave
32 # Emeryville CA 94608
33 #
34 # ------------------------------------------------------------------------------
35 */
36 
37 #ifndef _RixShaderQuery_h
38 #define _RixShaderQuery_h
39 
40 #include "RixInterfaces.h"
41 
46 
47 public:
48 
51  {
61  };
62 
71  };
72 
75  {
82  };
83 
86  {
91  };
92 
93 public:
94 
95  virtual ~RixShaderParameter() {};
96 
98  virtual const char*
99  Name(void) const = 0;
100 
102  virtual const char*
103  StructName(void) const = 0;
104 
106  virtual RixShaderParameterType
107  Type(void) const = 0;
108 
110  virtual RixShaderBaseType
111  BaseType(void) const = 0;
112 
114  virtual RixShaderAggregateType
115  AggregateType(void) const = 0;
116 
119  VectorSemantics(void) const = 0;
120 
122  virtual bool
123  IsOutput(void) const = 0;
124 
126  virtual bool
127  IsStruct(void) const = 0;
128 
130  virtual bool
131  IsArray(void) const = 0;
132 
134  virtual int
135  ArrayLength(void) const = 0;
136 
138  virtual int
139  DefaultSize(void) const = 0;
140 
142  virtual const int*
143  DefaultI(void) const = 0;
144 
146  virtual const float*
147  DefaultF(void) const = 0;
148 
150  virtual const char**
151  DefaultS(void) const = 0;
152 
155  virtual int
156  MetaDataSize(void) const = 0;
157 
163  virtual const RixShaderParameter* const*
164  MetaData(void) const = 0;
165 
166 };
167 
173 
174 public:
175 
176  virtual ~RixShaderQuery(void) {};
177 
188  virtual bool
189  Open(const char* name, const char* searchPath) = 0;
190 
192  virtual const char*
193  LastError(void) = 0;
194 
197  virtual int
198  ParameterCount(void) const = 0;
199 
207  virtual const RixShaderParameter* const*
208  Parameters(void) const = 0;
209 
212  virtual int
213  MetaDataCount(void) const = 0;
214 
222  virtual const RixShaderParameter* const*
223  MetaData(void) const = 0;
224 
226  virtual const char*
227  ShaderName(void) const = 0;
228 
230  virtual const char*
231  ShaderType(void) const = 0;
232 };
233 
246 class RixShaderInfo : public RixInterface {
247 public:
248 
251  virtual RixShaderQuery*
252  CreateQuery(void) = 0;
253 
254 protected:
255 
257 
258 };
259 #endif
Definition: RixShaderInfo.h:76
RixShaderParameterType
parameter types
Definition: RixShaderInfo.h:50
RixShaderAggregateType
composed types
Definition: RixShaderInfo.h:74
Definition: RixShaderInfo.h:69
A generic way to interrogate shaders on disk about their parameters.
Definition: RixShaderInfo.h:246
virtual RixShaderParameterType Type(void) const =0
virtual int ArrayLength(void) const =0
virtual ~RixShaderQuery(void)
Definition: RixShaderInfo.h:176
Definition: RixShaderInfo.h:66
Definition: RixShaderInfo.h:54
virtual const char * ShaderName(void) const =0
Definition: RixShaderInfo.h:69
Definition: RixShaderInfo.h:70
virtual RixShaderQuery * CreateQuery(void)=0
A RixShaderQuery factory, callers are responsible for deleting the returned object when they are done...
RixShaderBaseType
data types
Definition: RixShaderInfo.h:64
Definition: RixShaderInfo.h:52
Definition: RixShaderInfo.h:60
virtual int ParameterCount(void) const =0
Call Parameters() first before calling this.
Definition: RixShaderInfo.h:66
Definition: RixShaderInfo.h:80
virtual const RixShaderParameter *const * MetaData(void) const =0
Shaders have meta data each represented by parameter object.
Definition: RixShaderInfo.h:67
Base class for all Rix interfaces.
Definition: RixInterfaces.h:133
Definition: RixShaderInfo.h:59
Definition: RixShaderInfo.h:70
virtual const int * DefaultI(void) const =0
Definition: RixShaderInfo.h:68
Definition: RixShaderInfo.h:55
Definition: RixShaderInfo.h:68
virtual int MetaDataCount(void) const =0
Call MetaData() first before calling this.
virtual int DefaultSize(void) const =0
Definition: RixShaderInfo.h:90
Definition: RixShaderInfo.h:58
RixShaderVectorSemantics
A vector's disposition.
Definition: RixShaderInfo.h:85
class RixShaderQuery obtained from RixShaderInfo::CreateQuery().
Definition: RixShaderInfo.h:172
virtual bool Open(const char *name, const char *searchPath)=0
loads the metadata of a shader from disk.
Definition: RixShaderInfo.h:66
Definition: RixShaderInfo.h:56
Definition: RixShaderInfo.h:81
RixShaderInfo()
Definition: RixShaderInfo.h:256
Definition: RixShaderInfo.h:68
virtual int MetaDataSize(void) const =0
Call Metadata() first before calling this.
Definition: RixShaderInfo.h:70
Definition: RixShaderInfo.h:67
Definition: RixShaderInfo.h:87
Definition: RixShaderInfo.h:77
Definition: RixShaderInfo.h:67
class RixShaderParameter Represents a single shader parameter or metadata item
Definition: RixShaderInfo.h:45
Definition: RixShaderInfo.h:70
virtual const RixShaderParameter *const * Parameters(void) const =0
The formal parameter list of a shader.
virtual const char * StructName(void) const =0
virtual RixShaderAggregateType AggregateType(void) const =0
Definition: RixShaderInfo.h:53
virtual const char * LastError(void)=0
Definition: RixShaderInfo.h:70
Definition: RixShaderInfo.h:69
Definition: RixShaderInfo.h:88
virtual const char * ShaderType(void) const =0
Definition: RixShaderInfo.h:78
Definition: RixShaderInfo.h:67
virtual RixShaderVectorSemantics VectorSemantics(void) const =0
Definition: RixShaderInfo.h:69
Definition: RixShaderInfo.h:68
virtual const float * DefaultF(void) const =0
Definition: RixShaderInfo.h:79
virtual const char ** DefaultS(void) const =0
virtual bool IsOutput(void) const =0
virtual const char * Name(void) const =0
Definition: RixShaderInfo.h:57
Definition: RixShaderInfo.h:70
virtual const RixShaderParameter *const * MetaData(void) const =0
if the parameter is a struct then its fields can be referenced through the meta data entries...
Definition: RixShaderInfo.h:65
virtual RixShaderBaseType BaseType(void) const =0
virtual ~RixShaderParameter()
Definition: RixShaderInfo.h:95
virtual bool IsStruct(void) const =0
Definition: RixShaderInfo.h:66
Definition: RixShaderInfo.h:89
Definition: RixShaderInfo.h:65
virtual bool IsArray(void) const =0