Loading...
Searching...
No Matches
shaderFunction.h
1//
2// Copyright 2020 Pixar
3//
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
5// with the following modification; you may not use this file except in
6// compliance with the Apache License and the following modification to it:
7// Section 6. Trademarks. is deleted and replaced with:
8//
9// 6. Trademarks. This License does not grant permission to use the trade
10// names, trademarks, service marks, or product names of the Licensor
11// and its affiliates, except as required to comply with Section 4(c) of
12// the License and to reproduce the content of the NOTICE file.
13//
14// You may obtain a copy of the Apache License at
15//
16// http://www.apache.org/licenses/LICENSE-2.0
17//
18// Unless required by applicable law or agreed to in writing, software
19// distributed under the Apache License with the above modification is
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21// KIND, either express or implied. See the Apache License for the specific
22// language governing permissions and limitations under the Apache License.
23//
24#ifndef PXR_IMAGING_HGI_SHADERFUNCTION_H
25#define PXR_IMAGING_HGI_SHADERFUNCTION_H
26
27#include "pxr/pxr.h"
28#include "pxr/imaging/hgi/api.h"
29#include "pxr/imaging/hgi/enums.h"
30#include "pxr/imaging/hgi/handle.h"
31#include "pxr/imaging/hgi/shaderFunctionDesc.h"
32#include "pxr/imaging/hgi/types.h"
33
34PXR_NAMESPACE_OPEN_SCOPE
35
48{
49public:
50 HGI_API
51 virtual ~HgiShaderFunction();
52
54 HGI_API
56
58 HGI_API
59 virtual bool IsValid() const = 0;
60
62 HGI_API
63 virtual std::string const& GetCompileErrors() = 0;
64
67 HGI_API
68 virtual size_t GetByteSizeOfResource() const = 0;
69
81 HGI_API
82 virtual uint64_t GetRawResource() const = 0;
83
84protected:
85 HGI_API
87
88 HgiShaderFunctionDesc _descriptor;
89
90private:
91 HgiShaderFunction() = delete;
92 HgiShaderFunction & operator=(const HgiShaderFunction&) = delete;
93 HgiShaderFunction(const HgiShaderFunction&) = delete;
94};
95
97using HgiShaderFunctionHandleVector = std::vector<HgiShaderFunctionHandle>;
98
99PXR_NAMESPACE_CLOSE_SCOPE
100
101#endif
Handle that contains a hgi object and unique id.
Definition: handle.h:50
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.