Loading...
Searching...
No Matches
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
13PXR_NAMESPACE_OPEN_SCOPE
14
15class Hgi;
16
23{
24public:
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
44protected:
45 friend class HgiGL;
46
47 HGIGL_API
48 HgiGLShaderFunction(Hgi const* hgi, HgiShaderFunctionDesc const& desc);
49
50private:
51 HgiGLShaderFunction() = delete;
52 HgiGLShaderFunction & operator=(const HgiGLShaderFunction&) = delete;
54
55private:
56 std::string _errors;
57 uint32_t _shaderId;
58};
59
60
61PXR_NAMESPACE_CLOSE_SCOPE
62
63#endif
OpenGL implementation of the Hydra Graphics Interface.
Definition: hgi.h:55
OpenGL implementation of HgiShaderFunction.
HGIGL_API std::string const & GetCompileErrors() override
Returns shader compile errors.
HGIGL_API bool IsValid() const override
Returns false if any shader compile errors occured.
HGIGL_API size_t GetByteSizeOfResource() const override
Returns the byte size of the GPU shader function.
HGIGL_API uint64_t GetRawResource() const override
This function returns the handle to the Hgi backend's gpu resource, cast to a uint64_t.
HGIGL_API uint32_t GetShaderId() const
Returns the gl resource id of the shader.
Hydra Graphics Interface.
Definition: hgi.h:95
Represents one shader stage function (code snippet).
Describes the properties needed to create a GPU shader function.