build: update glslang to latest version
This commit is contained in:
commit
413a51ee6d
710 changed files with 18932 additions and 14484 deletions
0
glslang/Include/BaseTypes.h
Executable file → Normal file
0
glslang/Include/BaseTypes.h
Executable file → Normal file
|
|
@ -94,6 +94,11 @@ std::string to_string(const T& val) {
|
|||
#pragma warning(disable : 4201) // nameless union
|
||||
#endif
|
||||
|
||||
// Allow compilation to WASI which does not support threads yet.
|
||||
#ifdef __wasi__
|
||||
#define DISABLE_THREAD_SUPPORT
|
||||
#endif
|
||||
|
||||
#include "PoolAlloc.h"
|
||||
|
||||
//
|
||||
|
|
|
|||
|
|
@ -95,10 +95,14 @@ public:
|
|||
default: append("UNKNOWN ERROR: "); break;
|
||||
}
|
||||
}
|
||||
void location(const TSourceLoc& loc, bool absolute = false) {
|
||||
void location(const TSourceLoc& loc, bool absolute = false, bool displayColumn = false) {
|
||||
const int maxSize = 24;
|
||||
char locText[maxSize];
|
||||
snprintf(locText, maxSize, ":%d", loc.line);
|
||||
if (displayColumn) {
|
||||
snprintf(locText, maxSize, ":%d:%d", loc.line, loc.column);
|
||||
} else {
|
||||
snprintf(locText, maxSize, ":%d", loc.line);
|
||||
}
|
||||
|
||||
if(loc.getFilename() == nullptr && shaderFileName != nullptr && absolute) {
|
||||
append(std::filesystem::absolute(shaderFileName).string());
|
||||
|
|
@ -119,9 +123,11 @@ public:
|
|||
append(s);
|
||||
append("\n");
|
||||
}
|
||||
void message(TPrefixType message, const char* s, const TSourceLoc& loc) {
|
||||
void message(TPrefixType message, const char* s, const TSourceLoc& loc, bool absolute = false,
|
||||
bool displayColumn = false)
|
||||
{
|
||||
prefix(message);
|
||||
location(loc);
|
||||
location(loc, absolute, displayColumn);
|
||||
append(s);
|
||||
append("\n");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -307,21 +307,6 @@ typedef TVector<TTypeLoc> TTypeList;
|
|||
|
||||
typedef TVector<TString*> TIdentifierList;
|
||||
|
||||
//
|
||||
// Following are a series of helper enums for managing layouts and qualifiers,
|
||||
// used for TPublicType, TType, others.
|
||||
//
|
||||
|
||||
enum TLayoutPacking {
|
||||
ElpNone,
|
||||
ElpShared, // default, but different than saying nothing
|
||||
ElpStd140,
|
||||
ElpStd430,
|
||||
ElpPacked,
|
||||
ElpScalar,
|
||||
ElpCount // If expanding, see bitfield width below
|
||||
};
|
||||
|
||||
enum TLayoutMatrix {
|
||||
ElmNone,
|
||||
ElmRowMajor,
|
||||
|
|
|
|||
|
|
@ -37,9 +37,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <stdlib.h>
|
||||
|
||||
#include "glslang_c_shader_types.h"
|
||||
#include "visibility.h"
|
||||
|
||||
typedef struct glslang_shader_s glslang_shader_t;
|
||||
typedef struct glslang_program_s glslang_program_t;
|
||||
typedef struct glslang_mapper_s glslang_mapper_t;
|
||||
typedef struct glslang_resolver_s glslang_resolver_t;
|
||||
|
||||
/* Version counterpart */
|
||||
typedef struct glslang_version_s {
|
||||
int major;
|
||||
int minor;
|
||||
int patch;
|
||||
const char* flavor;
|
||||
} glslang_version_t;
|
||||
|
||||
/* TLimits counterpart */
|
||||
typedef struct glslang_limits_s {
|
||||
|
|
@ -230,27 +241,14 @@ typedef struct glslang_spv_options_s {
|
|||
bool emit_nonsemantic_shader_debug_info;
|
||||
bool emit_nonsemantic_shader_debug_source;
|
||||
bool compile_only;
|
||||
bool optimize_allow_expanded_id_bound;
|
||||
} glslang_spv_options_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef GLSLANG_IS_SHARED_LIBRARY
|
||||
#ifdef _WIN32
|
||||
#ifdef GLSLANG_EXPORTING
|
||||
#define GLSLANG_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define GLSLANG_EXPORT __declspec(dllimport)
|
||||
#endif
|
||||
#elif __GNUC__ >= 4
|
||||
#define GLSLANG_EXPORT __attribute__((visibility("default")))
|
||||
#endif
|
||||
#endif // GLSLANG_IS_SHARED_LIBRARY
|
||||
|
||||
#ifndef GLSLANG_EXPORT
|
||||
#define GLSLANG_EXPORT
|
||||
#endif
|
||||
GLSLANG_EXPORT void glslang_get_version(glslang_version_t* version);
|
||||
|
||||
GLSLANG_EXPORT int glslang_initialize_process(void);
|
||||
GLSLANG_EXPORT void glslang_finalize_process(void);
|
||||
|
|
@ -262,9 +260,13 @@ GLSLANG_EXPORT void glslang_shader_shift_binding(glslang_shader_t* shader, glsla
|
|||
GLSLANG_EXPORT void glslang_shader_shift_binding_for_set(glslang_shader_t* shader, glslang_resource_type_t res, unsigned int base, unsigned int set);
|
||||
GLSLANG_EXPORT void glslang_shader_set_options(glslang_shader_t* shader, int options); // glslang_shader_options_t
|
||||
GLSLANG_EXPORT void glslang_shader_set_glsl_version(glslang_shader_t* shader, int version);
|
||||
GLSLANG_EXPORT void glslang_shader_set_default_uniform_block_set_and_binding(glslang_shader_t* shader, unsigned int set, unsigned int binding);
|
||||
GLSLANG_EXPORT void glslang_shader_set_default_uniform_block_name(glslang_shader_t* shader, const char *name);
|
||||
GLSLANG_EXPORT void glslang_shader_set_resource_set_binding(glslang_shader_t* shader, const char *const *bindings, unsigned int num_bindings);
|
||||
GLSLANG_EXPORT int glslang_shader_preprocess(glslang_shader_t* shader, const glslang_input_t* input);
|
||||
GLSLANG_EXPORT int glslang_shader_parse(glslang_shader_t* shader, const glslang_input_t* input);
|
||||
GLSLANG_EXPORT const char* glslang_shader_get_preprocessed_code(glslang_shader_t* shader);
|
||||
GLSLANG_EXPORT void glslang_shader_set_preprocessed_code(glslang_shader_t* shader, const char* code);
|
||||
GLSLANG_EXPORT const char* glslang_shader_get_info_log(glslang_shader_t* shader);
|
||||
GLSLANG_EXPORT const char* glslang_shader_get_info_debug_log(glslang_shader_t* shader);
|
||||
|
||||
|
|
@ -275,6 +277,7 @@ GLSLANG_EXPORT int glslang_program_link(glslang_program_t* program, int messages
|
|||
GLSLANG_EXPORT void glslang_program_add_source_text(glslang_program_t* program, glslang_stage_t stage, const char* text, size_t len);
|
||||
GLSLANG_EXPORT void glslang_program_set_source_file(glslang_program_t* program, glslang_stage_t stage, const char* file);
|
||||
GLSLANG_EXPORT int glslang_program_map_io(glslang_program_t* program);
|
||||
GLSLANG_EXPORT int glslang_program_map_io_with_resolver_and_mapper(glslang_program_t* program, glslang_resolver_t* resolver, glslang_mapper_t* mapper);
|
||||
GLSLANG_EXPORT void glslang_program_SPIRV_generate(glslang_program_t* program, glslang_stage_t stage);
|
||||
GLSLANG_EXPORT void glslang_program_SPIRV_generate_with_options(glslang_program_t* program, glslang_stage_t stage, glslang_spv_options_t* spv_options);
|
||||
GLSLANG_EXPORT size_t glslang_program_SPIRV_get_size(glslang_program_t* program);
|
||||
|
|
@ -284,6 +287,12 @@ GLSLANG_EXPORT const char* glslang_program_SPIRV_get_messages(glslang_program_t*
|
|||
GLSLANG_EXPORT const char* glslang_program_get_info_log(glslang_program_t* program);
|
||||
GLSLANG_EXPORT const char* glslang_program_get_info_debug_log(glslang_program_t* program);
|
||||
|
||||
GLSLANG_EXPORT glslang_mapper_t* glslang_glsl_mapper_create();
|
||||
GLSLANG_EXPORT void glslang_glsl_mapper_delete(glslang_mapper_t* mapper);
|
||||
|
||||
GLSLANG_EXPORT glslang_resolver_t* glslang_glsl_resolver_create(glslang_program_t* program, glslang_stage_t stage);
|
||||
GLSLANG_EXPORT void glslang_glsl_resolver_delete(glslang_resolver_t* resolver);
|
||||
|
||||
GLSLANG_EXPORT char* glslang_SPIRV_disassemble(const unsigned int* spv_words, size_t spv_words_len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
|
|
@ -175,6 +175,8 @@ typedef enum {
|
|||
GLSLANG_MSG_BUILTIN_SYMBOL_TABLE_BIT = (1 << 14),
|
||||
GLSLANG_MSG_ENHANCED = (1 << 15),
|
||||
GLSLANG_MSG_ABSOLUTE_PATH = (1 << 16),
|
||||
GLSLANG_MSG_DISPLAY_ERROR_COLUMN = (1 << 17),
|
||||
GLSLANG_MSG_LINK_TIME_OPTIMIZATION_BIT = (1 << 18),
|
||||
LAST_ELEMENT_MARKER(GLSLANG_MSG_COUNT),
|
||||
} glslang_messages_t;
|
||||
|
||||
|
|
|
|||
|
|
@ -1694,8 +1694,12 @@ typedef TVector<TStorageQualifier> TQualifierList;
|
|||
//
|
||||
class TIntermAggregate : public TIntermOperator {
|
||||
public:
|
||||
TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(nullptr) { }
|
||||
TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(nullptr) { }
|
||||
TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(nullptr) {
|
||||
endLoc.init();
|
||||
}
|
||||
TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(nullptr) {
|
||||
endLoc.init();
|
||||
}
|
||||
~TIntermAggregate() { delete pragmaTable; }
|
||||
virtual TIntermAggregate* getAsAggregate() { return this; }
|
||||
virtual const TIntermAggregate* getAsAggregate() const { return this; }
|
||||
|
|
@ -1719,6 +1723,9 @@ public:
|
|||
void setSpirvInstruction(const TSpirvInstruction& inst) { spirvInst = inst; }
|
||||
const TSpirvInstruction& getSpirvInstruction() const { return spirvInst; }
|
||||
|
||||
void setEndLoc(TSourceLoc loc) { endLoc = loc; }
|
||||
TSourceLoc getEndLoc() const { return endLoc; }
|
||||
|
||||
void setLinkType(TLinkType l) { linkType = l; }
|
||||
TLinkType getLinkType() const { return linkType; }
|
||||
protected:
|
||||
|
|
@ -1733,6 +1740,10 @@ protected:
|
|||
TPragmaTable* pragmaTable;
|
||||
TSpirvInstruction spirvInst;
|
||||
TLinkType linkType = ELinkNone;
|
||||
|
||||
// Marking the end source location of the aggregate.
|
||||
// This is currently only set for a compound statement or a function body, pointing to '}'.
|
||||
TSourceLoc endLoc;
|
||||
};
|
||||
|
||||
//
|
||||
|
|
|
|||
54
glslang/Include/visibility.h
Normal file
54
glslang/Include/visibility.h
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
//
|
||||
// Copyright (C) 2023 LunarG, Inc.
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following
|
||||
// disclaimer in the documentation and/or other materials provided
|
||||
// with the distribution.
|
||||
//
|
||||
// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
|
||||
// contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
#ifdef GLSLANG_IS_SHARED_LIBRARY
|
||||
#ifdef _WIN32
|
||||
#ifdef GLSLANG_EXPORTING
|
||||
#define GLSLANG_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define GLSLANG_EXPORT __declspec(dllimport)
|
||||
#endif
|
||||
#elif __GNUC__ >= 4
|
||||
#define GLSLANG_EXPORT __attribute__((visibility("default")))
|
||||
#endif
|
||||
#endif // GLSLANG_IS_SHARED_LIBRARY
|
||||
|
||||
#ifndef GLSLANG_EXPORT
|
||||
#define GLSLANG_EXPORT
|
||||
#endif
|
||||
|
||||
// Symbols marked with this macro are only meant for public use by the test suite
|
||||
// and do not appear in publicly installed headers. They are not considered to be
|
||||
// part of the glslang library ABI.
|
||||
#define GLSLANG_EXPORT_FOR_TESTS GLSLANG_EXPORT
|
||||
Loading…
Add table
Add a link
Reference in a new issue