HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
shaderFunction.h
Go to the documentation of this file.
1 //
2 // Copyright 2020 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_IMAGING_HGIGL_SHADERFUNCTION_H
8 #define PXR_IMAGING_HGIGL_SHADERFUNCTION_H
9 
11 #include "pxr/imaging/hgiGL/api.h"
12 
14 
15 class Hgi;
16 
17 ///
18 /// \class HgiGLShaderFunction
19 ///
20 /// OpenGL implementation of HgiShaderFunction
21 ///
23 {
24 public:
25  HGIGL_API
26  ~HgiGLShaderFunction() override;
27 
28  HGIGL_API
29  bool IsValid() const override;
30 
31  HGIGL_API
32  std::string const& GetCompileErrors() override;
33 
34  HGIGL_API
35  size_t GetByteSizeOfResource() const override;
36 
37  HGIGL_API
38  uint64_t GetRawResource() const override;
39 
40  /// Returns the gl resource id of the shader.
41  HGIGL_API
42  uint32_t GetShaderId() const;
43 
44 protected:
45  friend class HgiGL;
46 
47  HGIGL_API
48  HgiGLShaderFunction(Hgi const* hgi, HgiShaderFunctionDesc const& desc);
49 
50 private:
51  HgiGLShaderFunction() = delete;
52  HgiGLShaderFunction & operator=(const HgiGLShaderFunction&) = delete;
54 
55 private:
56  std::string _errors;
57  uint32_t _shaderId;
58 };
59 
60 
62 
63 #endif
HGIGL_API ~HgiGLShaderFunction() override
HGIGL_API uint64_t GetRawResource() const override
HGIGL_API std::string const & GetCompileErrors() override
Returns shader compile errors.
HGIGL_API uint32_t GetShaderId() const
Returns the gl resource id of the shader.
Definition: hgi.h:54
#define HGIGL_API
Definition: api.h:23
Definition: hgi.h:93
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HGIGL_API bool IsValid() const override
Returns false if any shader compile errors occured.
HGIGL_API size_t GetByteSizeOfResource() const override