RetroArch/gfx/drivers_shader/glslang_util.h

89 lines
2.4 KiB
C
Raw Normal View History

2016-02-16 20:24:00 +01:00
/* RetroArch - A frontend for libretro.
2017-01-22 13:40:32 +01:00
* Copyright (C) 2010-2017 - Hans-Kristian Arntzen
2019-02-03 15:49:35 -08:00
*
2016-02-16 20:24:00 +01:00
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
2019-08-18 18:01:21 +02:00
#ifndef GLSLANG_UTIL_H
#define GLSLANG_UTIL_H
2016-02-16 20:24:00 +01:00
#include <stdint.h>
#include <retro_common_api.h>
#include <lists/string_list.h>
#include "slang_reflection.h"
typedef enum glslang_format
{
SLANG_FORMAT_UNKNOWN = 0,
2018-04-27 23:21:44 +02:00
/* 8-bit */
SLANG_FORMAT_R8_UNORM,
SLANG_FORMAT_R8_UINT,
SLANG_FORMAT_R8_SINT,
SLANG_FORMAT_R8G8_UNORM,
SLANG_FORMAT_R8G8_UINT,
SLANG_FORMAT_R8G8_SINT,
SLANG_FORMAT_R8G8B8A8_UNORM,
SLANG_FORMAT_R8G8B8A8_UINT,
SLANG_FORMAT_R8G8B8A8_SINT,
SLANG_FORMAT_R8G8B8A8_SRGB,
2018-04-27 23:21:44 +02:00
/* 10-bit */
SLANG_FORMAT_A2B10G10R10_UNORM_PACK32,
SLANG_FORMAT_A2B10G10R10_UINT_PACK32,
2018-04-27 23:21:44 +02:00
/* 16-bit */
SLANG_FORMAT_R16_UINT,
SLANG_FORMAT_R16_SINT,
SLANG_FORMAT_R16_SFLOAT,
SLANG_FORMAT_R16G16_UINT,
SLANG_FORMAT_R16G16_SINT,
SLANG_FORMAT_R16G16_SFLOAT,
SLANG_FORMAT_R16G16B16A16_UINT,
SLANG_FORMAT_R16G16B16A16_SINT,
SLANG_FORMAT_R16G16B16A16_SFLOAT,
2018-04-27 23:21:44 +02:00
/* 32-bit */
SLANG_FORMAT_R32_UINT,
SLANG_FORMAT_R32_SINT,
SLANG_FORMAT_R32_SFLOAT,
SLANG_FORMAT_R32G32_UINT,
SLANG_FORMAT_R32G32_SINT,
SLANG_FORMAT_R32G32_SFLOAT,
SLANG_FORMAT_R32G32B32A32_UINT,
SLANG_FORMAT_R32G32B32A32_SINT,
SLANG_FORMAT_R32G32B32A32_SFLOAT,
SLANG_FORMAT_MAX
}glslang_format;
RETRO_BEGIN_DECLS
const char *glslang_format_to_string(glslang_format fmt);
2019-08-18 18:01:21 +02:00
enum glslang_format glslang_find_format(const char *fmt);
2019-08-18 18:01:21 +02:00
bool glslang_read_shader_file(const char *path,
struct string_list *output, bool root_file);
2016-02-16 20:24:00 +01:00
bool slang_texture_semantic_is_array(enum slang_texture_semantic sem);
enum slang_texture_semantic slang_name_to_texture_semantic_array(
const char *name, const char **names,
unsigned *index);
2019-08-18 18:01:21 +02:00
RETRO_END_DECLS
2016-02-16 20:24:00 +01:00
#endif