RetroArch
glslang_util.h
Go to the documentation of this file.
1 /* RetroArch - A frontend for libretro.
2  * Copyright (C) 2010-2017 - Hans-Kristian Arntzen
3  *
4  * RetroArch is free software: you can redistribute it and/or modify it under the terms
5  * of the GNU General Public License as published by the Free Software Found-
6  * ation, either version 3 of the License, or (at your option) any later version.
7  *
8  * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10  * PURPOSE. See the GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License along with RetroArch.
13  * If not, see <http://www.gnu.org/licenses/>.
14  */
15 
16 #ifndef GLSLANG_UTIL_HPP
17 #define GLSLANG_UTIL_HPP
18 
19 #include <stdint.h>
20 #include <retro_common_api.h>
21 
22 typedef enum glslang_format
23 {
25 
26  /* 8-bit */
37 
38  /* 10-bit */
41 
42  /* 16-bit */
52 
53  /* 32-bit */
63 
66 
68 
70 
72 
73 #ifdef __cplusplus
74 #include <vector>
75 #include <string>
76 
77 struct glslang_parameter
78 {
80  std::string desc;
81  float initial;
82  float minimum;
83  float maximum;
84  float step;
85 };
86 
87 struct glslang_meta
88 {
89  std::vector<glslang_parameter> parameters;
91  glslang_format rt_format;
92 
93  glslang_meta()
94  {
95  rt_format = SLANG_FORMAT_UNKNOWN;
96  }
97 };
98 
99 struct glslang_output
100 {
101  std::vector<uint32_t> vertex;
102  std::vector<uint32_t> fragment;
103  glslang_meta meta;
104 };
105 
106 bool glslang_compile_shader(const char *shader_path, glslang_output *output);
107 
108 /* Helpers for internal use. */
109 bool glslang_read_shader_file(const char *path, std::vector<std::string> *output, bool root_file);
110 bool glslang_parse_meta(const std::vector<std::string> &lines, glslang_meta *meta);
111 #endif
112 
113 #endif
114 
Definition: glslang_util.h:58
Definition: glslang_util.h:46
GLuint const GLchar * name
Definition: glext.h:6671
RETRO_BEGIN_DECLS const char * glslang_format_to_string(glslang_format fmt)
Definition: glslang_util.cpp:239
#define RETRO_BEGIN_DECLS
Definition: retro_common_api.h:41
Definition: glslang_util.h:29
Definition: glslang_util.h:48
Definition: glslang_util.h:60
GLsizei const GLchar ** path
Definition: glext.h:7901
bool glslang_parse_meta(const vector< string > &lines, glslang_meta *meta)
Definition: glslang_util.cpp:285
Definition: glslang_util.h:62
GLenum GLuint id
Definition: glext.h:6233
Definition: glslang_util.h:45
Definition: glslang_util.h:55
GLsizei const GLchar *const * string
Definition: glext.h:6699
Definition: glslang_util.h:31
glslang_format
Definition: glslang_util.h:22
Definition: glslang_util.h:43
Definition: glslang_util.h:33
Definition: glslang_util.h:59
Definition: glslang_util.h:36
Definition: glslang_util.h:28
Definition: glslang_util.h:64
Definition: glslang_util.h:47
Definition: glslang_util.h:24
Definition: glslang_util.h:27
Definition: glslang_util.h:61
Definition: glslang_util.h:54
Definition: glslang_util.h:39
Definition: glslang_util.h:50
bool glslang_read_shader_file(const char *path, vector< string > *output, bool root_file)
Definition: glslang_util.cpp:40
Definition: glslang_util.h:44
Definition: glslang_util.h:51
#define RETRO_END_DECLS
Definition: retro_common_api.h:42
Definition: glslang_util.h:32
bool glslang_compile_shader(const char *shader_path, glslang_output *output)
Definition: glslang_util.cpp:411
Definition: glslang_util.h:30
std::string output
Definition: Config.FromFile.cpp:44
static struct string_list * lines
Definition: connmanctl.c:27
Definition: glslang_util.h:40
Definition: glslang_util.h:57
Definition: glslang_util.h:56
Definition: glslang_util.h:49
Definition: glslang_util.h:34
Definition: glslang_util.h:35