VTK  9.7.20261127
vtkWebGPUSlangInternals.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
3#ifndef vtkWebGPUSlangInternals_h
4#define vtkWebGPUSlangInternals_h
5
6#include "vtkRenderingWebGPUModule.h"
8#include "vtkType.h"
9
10#include <cstddef>
11#include <cstdint>
12#include <string>
13#include <vector>
14
15VTK_ABI_NAMESPACE_BEGIN
16class vtkObject;
18
19class VTKRENDERINGWEBGPU_NO_EXPORT vtkWebGPUSlangInternals
20{
21public:
22 static constexpr std::uint32_t ParameterBinding = 16;
23
25
26 struct Program
27 {
28 const char* Source = nullptr;
29 std::vector<std::string> EntryPoints;
30 std::uint32_t ParameterGroup = 1;
32 };
33
34 static const Program& GetSurfaceProgram();
35
36 static bool IsRequested(vtkShaderProperty* property);
37
38 static bool GetGlobalRequest();
39 static void SetGlobalRequest(bool request);
41
42 static std::string GetUnsupportedCustomizations(vtkShaderProperty* property);
43
44 static std::string GetIgnoredSpecializations(const Program& program, vtkShaderProperty* property);
45
46 static void ReportIgnoredSpecializations(vtkObject* reporter, const Program& program,
47 vtkShaderProperty* property, std::string& reported);
48
49 static bool Compile(vtkShaderProperty* property,
50 const vtkSlangShaderManager::StringPairs& defines, std::string& wgsl, Parameters& parameters,
51 std::string& error, const std::string& label = std::string());
52
53 static bool Compile(const Program& program, vtkShaderProperty* property,
54 const vtkSlangShaderManager::StringPairs& defines, std::string& wgsl, Parameters& parameters,
55 std::string& error, const std::string& label = std::string(),
56 std::string* customizationError = nullptr);
57
58private:
59 static bool CompileOnce(const Program& program, vtkShaderProperty* property,
60 const vtkSlangShaderManager::StringPairs& defines, std::string& wgsl, Parameters& parameters,
61 std::string& error, const std::string& label);
62};
63
64VTK_ABI_NAMESPACE_END
65#endif
66// VTK-HeaderTest-Exclude: vtkWebGPUSlangInternals.h
abstract base class for most VTK objects
Definition vtkObject.h:162
represent GPU shader properties
std::vector< std::pair< std::string, std::string > > StringPairs
static bool GetGlobalRequest()
static const Program & GetSurfaceProgram()
static bool Compile(const Program &program, vtkShaderProperty *property, const vtkSlangShaderManager::StringPairs &defines, std::string &wgsl, Parameters &parameters, std::string &error, const std::string &label=std::string(), std::string *customizationError=nullptr)
static void ReportIgnoredSpecializations(vtkObject *reporter, const Program &program, vtkShaderProperty *property, std::string &reported)
static constexpr std::uint32_t ParameterBinding
static bool IsRequested(vtkShaderProperty *property)
static bool Compile(vtkShaderProperty *property, const vtkSlangShaderManager::StringPairs &defines, std::string &wgsl, Parameters &parameters, std::string &error, const std::string &label=std::string())
static std::string GetUnsupportedCustomizations(vtkShaderProperty *property)
static std::string GetIgnoredSpecializations(const Program &program, vtkShaderProperty *property)
static void SetGlobalRequest(bool request)
static vtkMTimeType GetRequestMTime(vtkShaderProperty *property)
vtkSlangShaderManager::Plan Parameters
std::vector< std::string > EntryPoints
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:321