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_HGI_SHADERFUNCTION_H
8#define PXR_IMAGING_HGI_SHADERFUNCTION_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hgi/api.h"
12#include "pxr/imaging/hgi/enums.h"
13#include "pxr/imaging/hgi/handle.h"
14#include "pxr/imaging/hgi/shaderFunctionDesc.h"
15#include "pxr/imaging/hgi/types.h"
16
17PXR_NAMESPACE_OPEN_SCOPE
18
31{
32public:
33 HGI_API
34 virtual ~HgiShaderFunction();
35
37 HGI_API
39
41 HGI_API
42 virtual bool IsValid() const = 0;
43
45 HGI_API
46 virtual std::string const& GetCompileErrors() = 0;
47
50 HGI_API
51 virtual size_t GetByteSizeOfResource() const = 0;
52
64 HGI_API
65 virtual uint64_t GetRawResource() const = 0;
66
67protected:
68 HGI_API
70
71 HgiShaderFunctionDesc _descriptor;
72
73private:
74 HgiShaderFunction() = delete;
75 HgiShaderFunction & operator=(const HgiShaderFunction&) = delete;
76 HgiShaderFunction(const HgiShaderFunction&) = delete;
77};
78
80using HgiShaderFunctionHandleVector = std::vector<HgiShaderFunctionHandle>;
81
82PXR_NAMESPACE_CLOSE_SCOPE
83
84#endif
Handle that contains a hgi object and unique id.
Definition: handle.h:33
Represents one shader stage function (code snippet).
virtual HGI_API bool IsValid() const =0
Returns false if any shader compile errors occured.
virtual HGI_API uint64_t GetRawResource() const =0
This function returns the handle to the Hgi backend's gpu resource, cast to a uint64_t.
HGI_API HgiShaderFunctionDesc const & GetDescriptor() const
The descriptor describes the object.
virtual HGI_API std::string const & GetCompileErrors()=0
Returns shader compile errors.
virtual HGI_API size_t GetByteSizeOfResource() const =0
Returns the byte size of the GPU shader function.
Describes the properties needed to create a GPU shader function.