shaderFunction.h
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 
10 #include "pxr/imaging/hgi/shaderFunction.h"
11 #include "pxr/imaging/hgiGL/api.h"
12 
13 PXR_NAMESPACE_OPEN_SCOPE
14 
15 class Hgi;
16 
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 
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 
61 PXR_NAMESPACE_CLOSE_SCOPE
62 
63 #endif
HGIGL_API uint32_t GetShaderId() const
Returns the gl resource id of the shader.
HGIGL_API std::string const & GetCompileErrors() override
Returns shader compile errors.
Represents one shader stage function (code snippet).
HGIGL_API size_t GetByteSizeOfResource() const override
Returns the byte size of the GPU shader function.
HGIGL_API bool IsValid() const override
Returns false if any shader compile errors occured.
OpenGL implementation of the Hydra Graphics Interface.
Definition: hgi.h:54
HGIGL_API uint64_t GetRawResource() const override
This function returns the handle to the Hgi backend's gpu resource, cast to a uint64_t.
Hydra Graphics Interface.
Definition: hgi.h:94
OpenGL implementation of HgiShaderFunction.
Describes the properties needed to create a GPU shader function.