Flutter Engine
The Flutter Engine
GrGLShaderStringBuilder.h
Go to the documentation of this file.
1/*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef GrGLShaderStringBuilder_DEFINED
9#define GrGLShaderStringBuilder_DEFINED
10
19
20#include <cstdint>
21#include <string>
22
23class GrGLGpu;
24
25namespace SkSL {
26
27enum class ProgramKind : int8_t;
28struct ProgramInterface;
29struct ProgramSettings;
30struct ShaderCaps;
31
32} // namespace SkSL
33
34namespace skgpu {
35
36class ShaderErrorHandler;
37
38inline bool SkSLToGLSL(const SkSL::ShaderCaps* caps,
39 const std::string& sksl,
42 std::string* glsl,
43 SkSL::ProgramInterface* outInterface,
44 ShaderErrorHandler* errorHandler) {
45 return SkSLToBackend(caps, &SkSL::ToGLSL, "GLSL",
46 sksl, programKind, settings, glsl, outInterface, errorHandler);
47}
48
49} // namespace skgpu
50
52 GrGLuint programId,
54 const std::string& glsl,
55 bool shaderWasCached,
58
59bool GrGLCheckLinkStatus(const GrGLGpu* gpu,
60 GrGLuint programID,
61 bool shaderWasCached,
63 const std::string* sksl[kGrShaderTypeCount],
64 const std::string glsl[kGrShaderTypeCount]);
65
66#endif
GrGLuint GrGLCompileAndAttachShader(const GrGLContext &glCtx, GrGLuint programId, GrGLenum type, const std::string &glsl, bool shaderWasCached, GrThreadSafePipelineBuilder::Stats *, GrContextOptions::ShaderErrorHandler *errorHandler)
bool GrGLCheckLinkStatus(const GrGLGpu *gpu, GrGLuint programID, bool shaderWasCached, GrContextOptions::ShaderErrorHandler *errorHandler, const std::string *sksl[kGrShaderTypeCount], const std::string glsl[kGrShaderTypeCount])
unsigned int GrGLuint
Definition: GrGLTypes.h:113
unsigned int GrGLenum
Definition: GrGLTypes.h:102
static const int kGrShaderTypeCount
Definition: GrTypesPriv.h:282
GLenum type
bool ToGLSL(Program &program, const ShaderCaps *caps, OutputStream &out)
string programKind
Definition: minify_sksl.py:40
Definition: GpuTools.h:21
bool SkSLToBackend(const SkSL::ShaderCaps *caps, bool(*toBackend)(SkSL::Program &, const SkSL::ShaderCaps *, std::string *), const char *backendLabel, const std::string &sksl, SkSL::ProgramKind programKind, const SkSL::ProgramSettings &settings, std::string *output, SkSL::ProgramInterface *outInterface, ShaderErrorHandler *errorHandler)
bool SkSLToGLSL(const SkSL::ShaderCaps *caps, const std::string &sksl, SkSL::ProgramKind programKind, const SkSL::ProgramSettings &settings, std::string *glsl, SkSL::ProgramInterface *outInterface, ShaderErrorHandler *errorHandler)