Merge branch 'bkaradzic:master' into shaderc-custom-main
This commit is contained in:
commit
b4863b7d92
3
.github/workflows/main.yml
vendored
3
.github/workflows/main.yml
vendored
@ -211,10 +211,7 @@ jobs:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
include: [
|
||||
{ platform: arm },
|
||||
{ platform: arm64 },
|
||||
{ platform: x86 },
|
||||
{ platform: x86_64 },
|
||||
]
|
||||
name: android-${{ matrix.platform }}
|
||||
runs-on: ubuntu-22.04
|
||||
|
39
3rdparty/cgltf/cgltf.h
vendored
39
3rdparty/cgltf/cgltf.h
vendored
@ -65,7 +65,8 @@
|
||||
*
|
||||
* `cgltf_num_components` is a tiny utility that tells you the dimensionality of
|
||||
* a certain accessor type. This can be used before `cgltf_accessor_unpack_floats` to help allocate
|
||||
* the necessary amount of memory.
|
||||
* the necessary amount of memory. `cgltf_component_size` and `cgltf_calc_size` exist for
|
||||
* similar purposes.
|
||||
*
|
||||
* `cgltf_accessor_read_float` reads a certain element from a non-sparse accessor and converts it to
|
||||
* floating point, assuming that `cgltf_load_buffers` has already been called. The passed-in element
|
||||
@ -837,6 +838,8 @@ cgltf_bool cgltf_accessor_read_uint(const cgltf_accessor* accessor, cgltf_size i
|
||||
cgltf_size cgltf_accessor_read_index(const cgltf_accessor* accessor, cgltf_size index);
|
||||
|
||||
cgltf_size cgltf_num_components(cgltf_type type);
|
||||
cgltf_size cgltf_component_size(cgltf_component_type component_type);
|
||||
cgltf_size cgltf_calc_size(cgltf_type type, cgltf_component_type component_type);
|
||||
|
||||
cgltf_size cgltf_accessor_unpack_floats(const cgltf_accessor* accessor, cgltf_float* out, cgltf_size float_count);
|
||||
|
||||
@ -904,15 +907,15 @@ enum jsmnerr {
|
||||
};
|
||||
typedef struct {
|
||||
jsmntype_t type;
|
||||
int start;
|
||||
int end;
|
||||
ptrdiff_t start;
|
||||
ptrdiff_t end;
|
||||
int size;
|
||||
#ifdef JSMN_PARENT_LINKS
|
||||
int parent;
|
||||
#endif
|
||||
} jsmntok_t;
|
||||
typedef struct {
|
||||
unsigned int pos; /* offset in the JSON string */
|
||||
size_t pos; /* offset in the JSON string */
|
||||
unsigned int toknext; /* next token to allocate */
|
||||
int toksuper; /* superior token node, e.g parent object or array */
|
||||
} jsmn_parser;
|
||||
@ -1488,8 +1491,6 @@ cgltf_result cgltf_load_buffers(const cgltf_options* options, cgltf_data* data,
|
||||
return cgltf_result_success;
|
||||
}
|
||||
|
||||
static cgltf_size cgltf_calc_size(cgltf_type type, cgltf_component_type component_type);
|
||||
|
||||
static cgltf_size cgltf_calc_index_bound(cgltf_buffer_view* buffer_view, cgltf_size offset, cgltf_component_type component_type, cgltf_size count)
|
||||
{
|
||||
char* data = (char*)buffer_view->buffer->data + offset + buffer_view->offset;
|
||||
@ -2217,7 +2218,7 @@ static cgltf_size cgltf_component_read_index(const void* in, cgltf_component_typ
|
||||
case cgltf_component_type_r_32u:
|
||||
return *((const uint32_t*) in);
|
||||
case cgltf_component_type_r_32f:
|
||||
return (cgltf_size)*((const float*) in);
|
||||
return (cgltf_size)((cgltf_ssize)*((const float*) in));
|
||||
case cgltf_component_type_r_8u:
|
||||
return *((const uint8_t*) in);
|
||||
default:
|
||||
@ -2253,8 +2254,6 @@ static cgltf_float cgltf_component_read_float(const void* in, cgltf_component_ty
|
||||
return (cgltf_float)cgltf_component_read_integer(in, component_type);
|
||||
}
|
||||
|
||||
static cgltf_size cgltf_component_size(cgltf_component_type component_type);
|
||||
|
||||
static cgltf_bool cgltf_element_read_float(const uint8_t* element, cgltf_type type, cgltf_component_type component_type, cgltf_bool normalized, cgltf_float* out, cgltf_size element_size)
|
||||
{
|
||||
cgltf_size num_components = cgltf_num_components(type);
|
||||
@ -2505,7 +2504,7 @@ static int cgltf_json_strcmp(jsmntok_t const* tok, const uint8_t* json_chunk, co
|
||||
{
|
||||
CGLTF_CHECK_TOKTYPE(*tok, JSMN_STRING);
|
||||
size_t const str_len = strlen(str);
|
||||
size_t const name_length = tok->end - tok->start;
|
||||
size_t const name_length = (size_t)(tok->end - tok->start);
|
||||
return (str_len == name_length) ? strncmp((const char*)json_chunk + tok->start, str, str_len) : 128;
|
||||
}
|
||||
|
||||
@ -2513,7 +2512,7 @@ static int cgltf_json_to_int(jsmntok_t const* tok, const uint8_t* json_chunk)
|
||||
{
|
||||
CGLTF_CHECK_TOKTYPE(*tok, JSMN_PRIMITIVE);
|
||||
char tmp[128];
|
||||
int size = (cgltf_size)(tok->end - tok->start) < sizeof(tmp) ? tok->end - tok->start : (int)(sizeof(tmp) - 1);
|
||||
int size = (size_t)(tok->end - tok->start) < sizeof(tmp) ? (int)(tok->end - tok->start) : (int)(sizeof(tmp) - 1);
|
||||
strncpy(tmp, (const char*)json_chunk + tok->start, size);
|
||||
tmp[size] = 0;
|
||||
return CGLTF_ATOI(tmp);
|
||||
@ -2523,7 +2522,7 @@ static cgltf_size cgltf_json_to_size(jsmntok_t const* tok, const uint8_t* json_c
|
||||
{
|
||||
CGLTF_CHECK_TOKTYPE_RETTYPE(*tok, JSMN_PRIMITIVE, cgltf_size);
|
||||
char tmp[128];
|
||||
int size = (cgltf_size)(tok->end - tok->start) < sizeof(tmp) ? tok->end - tok->start : (int)(sizeof(tmp) - 1);
|
||||
int size = (size_t)(tok->end - tok->start) < sizeof(tmp) ? (int)(tok->end - tok->start) : (int)(sizeof(tmp) - 1);
|
||||
strncpy(tmp, (const char*)json_chunk + tok->start, size);
|
||||
tmp[size] = 0;
|
||||
return (cgltf_size)CGLTF_ATOLL(tmp);
|
||||
@ -2533,7 +2532,7 @@ static cgltf_float cgltf_json_to_float(jsmntok_t const* tok, const uint8_t* json
|
||||
{
|
||||
CGLTF_CHECK_TOKTYPE(*tok, JSMN_PRIMITIVE);
|
||||
char tmp[128];
|
||||
int size = (cgltf_size)(tok->end - tok->start) < sizeof(tmp) ? tok->end - tok->start : (int)(sizeof(tmp) - 1);
|
||||
int size = (size_t)(tok->end - tok->start) < sizeof(tmp) ? (int)(tok->end - tok->start) : (int)(sizeof(tmp) - 1);
|
||||
strncpy(tmp, (const char*)json_chunk + tok->start, size);
|
||||
tmp[size] = 0;
|
||||
return (cgltf_float)CGLTF_ATOF(tmp);
|
||||
@ -2541,7 +2540,7 @@ static cgltf_float cgltf_json_to_float(jsmntok_t const* tok, const uint8_t* json
|
||||
|
||||
static cgltf_bool cgltf_json_to_bool(jsmntok_t const* tok, const uint8_t* json_chunk)
|
||||
{
|
||||
int size = tok->end - tok->start;
|
||||
int size = (int)(tok->end - tok->start);
|
||||
return size == 4 && memcmp(json_chunk + tok->start, "true", 4) == 0;
|
||||
}
|
||||
|
||||
@ -2607,7 +2606,7 @@ static int cgltf_parse_json_string(cgltf_options* options, jsmntok_t const* toke
|
||||
{
|
||||
return CGLTF_ERROR_JSON;
|
||||
}
|
||||
int size = tokens[i].end - tokens[i].start;
|
||||
int size = (int)(tokens[i].end - tokens[i].start);
|
||||
char* result = (char*)options->memory.alloc_func(options->memory.user_data, size + 1);
|
||||
if (!result)
|
||||
{
|
||||
@ -5965,7 +5964,7 @@ cgltf_size cgltf_num_components(cgltf_type type) {
|
||||
}
|
||||
}
|
||||
|
||||
static cgltf_size cgltf_component_size(cgltf_component_type component_type) {
|
||||
cgltf_size cgltf_component_size(cgltf_component_type component_type) {
|
||||
switch (component_type)
|
||||
{
|
||||
case cgltf_component_type_r_8:
|
||||
@ -5983,7 +5982,7 @@ static cgltf_size cgltf_component_size(cgltf_component_type component_type) {
|
||||
}
|
||||
}
|
||||
|
||||
static cgltf_size cgltf_calc_size(cgltf_type type, cgltf_component_type component_type)
|
||||
cgltf_size cgltf_calc_size(cgltf_type type, cgltf_component_type component_type)
|
||||
{
|
||||
cgltf_size component_size = cgltf_component_size(component_type);
|
||||
if (type == cgltf_type_mat2 && component_size == 1)
|
||||
@ -6501,7 +6500,7 @@ static jsmntok_t *jsmn_alloc_token(jsmn_parser *parser,
|
||||
* Fills token type and boundaries.
|
||||
*/
|
||||
static void jsmn_fill_token(jsmntok_t *token, jsmntype_t type,
|
||||
int start, int end) {
|
||||
ptrdiff_t start, ptrdiff_t end) {
|
||||
token->type = type;
|
||||
token->start = start;
|
||||
token->end = end;
|
||||
@ -6514,7 +6513,7 @@ static void jsmn_fill_token(jsmntok_t *token, jsmntype_t type,
|
||||
static int jsmn_parse_primitive(jsmn_parser *parser, const char *js,
|
||||
size_t len, jsmntok_t *tokens, size_t num_tokens) {
|
||||
jsmntok_t *token;
|
||||
int start;
|
||||
ptrdiff_t start;
|
||||
|
||||
start = parser->pos;
|
||||
|
||||
@ -6564,7 +6563,7 @@ static int jsmn_parse_string(jsmn_parser *parser, const char *js,
|
||||
size_t len, jsmntok_t *tokens, size_t num_tokens) {
|
||||
jsmntok_t *token;
|
||||
|
||||
int start = parser->pos;
|
||||
ptrdiff_t start = parser->pos;
|
||||
|
||||
parser->pos++;
|
||||
|
||||
|
1
3rdparty/cgltf/cgltf_write.h
vendored
1
3rdparty/cgltf/cgltf_write.h
vendored
@ -1123,6 +1123,7 @@ static void cgltf_write_light(cgltf_write_context* context, const cgltf_light* l
|
||||
cgltf_write_floatprop(context, "outerConeAngle", light->spot_outer_cone_angle, 3.14159265358979323846f/4.0f);
|
||||
cgltf_write_line(context, "}");
|
||||
}
|
||||
cgltf_write_extras( context, &light->extras );
|
||||
cgltf_write_line(context, "}");
|
||||
}
|
||||
|
||||
|
2923
3rdparty/dear-imgui/imgui.cpp
vendored
2923
3rdparty/dear-imgui/imgui.cpp
vendored
File diff suppressed because it is too large
Load Diff
192
3rdparty/dear-imgui/imgui.h
vendored
192
3rdparty/dear-imgui/imgui.h
vendored
@ -1,17 +1,17 @@
|
||||
// dear imgui, v1.89.1 WIP
|
||||
// dear imgui, v1.89.6 WIP
|
||||
// (headers)
|
||||
|
||||
// Help:
|
||||
// - Read FAQ at http://dearimgui.org/faq
|
||||
// - Read FAQ at http://dearimgui.com/faq
|
||||
// - Newcomers, read 'Programmer guide' in imgui.cpp for notes on how to setup Dear ImGui in your codebase.
|
||||
// - Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp. All applications in examples/ are doing that.
|
||||
// Read imgui.cpp for details, links and comments.
|
||||
|
||||
// Resources:
|
||||
// - FAQ http://dearimgui.org/faq
|
||||
// - FAQ http://dearimgui.com/faq
|
||||
// - Homepage & latest https://github.com/ocornut/imgui
|
||||
// - Releases & changelog https://github.com/ocornut/imgui/releases
|
||||
// - Gallery https://github.com/ocornut/imgui/issues/5243 (please post your screenshots/video there!)
|
||||
// - Gallery https://github.com/ocornut/imgui/issues/5886 (please post your screenshots/video there!)
|
||||
// - Wiki https://github.com/ocornut/imgui/wiki (lots of good stuff there)
|
||||
// - Glossary https://github.com/ocornut/imgui/wiki/Glossary
|
||||
// - Issues & support https://github.com/ocornut/imgui/issues
|
||||
@ -22,8 +22,8 @@
|
||||
|
||||
// Library Version
|
||||
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM > 12345')
|
||||
#define IMGUI_VERSION "1.89.1 WIP"
|
||||
#define IMGUI_VERSION_NUM 18903
|
||||
#define IMGUI_VERSION "1.89.6 WIP"
|
||||
#define IMGUI_VERSION_NUM 18954
|
||||
#define IMGUI_HAS_TABLE
|
||||
|
||||
/*
|
||||
@ -37,7 +37,7 @@ Index of this file:
|
||||
// [SECTION] ImGuiStyle
|
||||
// [SECTION] ImGuiIO
|
||||
// [SECTION] Misc data structures (ImGuiInputTextCallbackData, ImGuiSizeCallbackData, ImGuiPayload, ImGuiTableSortSpecs, ImGuiTableColumnSortSpecs)
|
||||
// [SECTION] Helpers (ImGuiOnceUponAFrame, ImGuiTextFilter, ImGuiTextBuffer, ImGuiStorage, ImGuiListClipper, ImColor)
|
||||
// [SECTION] Helpers (ImGuiOnceUponAFrame, ImGuiTextFilter, ImGuiTextBuffer, ImGuiStorage, ImGuiListClipper, Math Operators, ImColor)
|
||||
// [SECTION] Drawing API (ImDrawCallback, ImDrawCmd, ImDrawIdx, ImDrawVert, ImDrawChannel, ImDrawListSplitter, ImDrawFlags, ImDrawListFlags, ImDrawList, ImDrawData)
|
||||
// [SECTION] Font API (ImFontConfig, ImFontGlyph, ImFontGlyphRangesBuilder, ImFontAtlasFlags, ImFontAtlas, ImFont)
|
||||
// [SECTION] Viewports (ImGuiViewportFlags, ImGuiViewport)
|
||||
@ -167,6 +167,7 @@ struct ImGuiViewport; // A Platform Window (always only one in 'ma
|
||||
// In Visual Studio IDE: CTRL+comma ("Edit.GoToAll") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot.
|
||||
// With Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols in comments.
|
||||
enum ImGuiKey : int; // -> enum ImGuiKey // Enum: A key identifier (ImGuiKey_XXX or ImGuiMod_XXX value)
|
||||
enum ImGuiMouseSource : int; // -> enum ImGuiMouseSource // Enum; A mouse input source identifier (Mouse, TouchScreen, Pen)
|
||||
typedef int ImGuiCol; // -> enum ImGuiCol_ // Enum: A color identifier for styling
|
||||
typedef int ImGuiCond; // -> enum ImGuiCond_ // Enum: A condition for many Set*() functions
|
||||
typedef int ImGuiDataType; // -> enum ImGuiDataType_ // Enum: A primary data type
|
||||
@ -255,8 +256,8 @@ struct ImVec2
|
||||
float x, y;
|
||||
constexpr ImVec2() : x(0.0f), y(0.0f) { }
|
||||
constexpr ImVec2(float _x, float _y) : x(_x), y(_y) { }
|
||||
float operator[] (size_t idx) const { IM_ASSERT(idx <= 1); return (&x)[idx]; } // We very rarely use this [] operator, the assert overhead is fine.
|
||||
float& operator[] (size_t idx) { IM_ASSERT(idx <= 1); return (&x)[idx]; } // We very rarely use this [] operator, the assert overhead is fine.
|
||||
float& operator[] (size_t idx) { IM_ASSERT(idx == 0 || idx == 1); return ((float*)(void*)(char*)this)[idx]; } // We very rarely use this [] operator, so the assert overhead is fine.
|
||||
float operator[] (size_t idx) const { IM_ASSERT(idx == 0 || idx == 1); return ((const float*)(const void*)(const char*)this)[idx]; }
|
||||
#ifdef IM_VEC2_CLASS_EXTRA
|
||||
IM_VEC2_CLASS_EXTRA // Define additional constructors and implicit cast operators in imconfig.h to convert back and forth between your math types and ImVec2.
|
||||
#endif
|
||||
@ -405,8 +406,8 @@ namespace ImGui
|
||||
IMGUI_API void PushStyleVar(ImGuiStyleVar idx, float val); // modify a style float variable. always use this if you modify the style after NewFrame().
|
||||
IMGUI_API void PushStyleVar(ImGuiStyleVar idx, const ImVec2& val); // modify a style ImVec2 variable. always use this if you modify the style after NewFrame().
|
||||
IMGUI_API void PopStyleVar(int count = 1);
|
||||
IMGUI_API void PushAllowKeyboardFocus(bool allow_keyboard_focus); // == tab stop enable. Allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets
|
||||
IMGUI_API void PopAllowKeyboardFocus();
|
||||
IMGUI_API void PushTabStop(bool tab_stop); // == tab stop enable. Allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets
|
||||
IMGUI_API void PopTabStop();
|
||||
IMGUI_API void PushButtonRepeat(bool repeat); // in 'repeat' mode, Button*() functions return repeated true in a typematic manner (using io.KeyRepeatDelay/io.KeyRepeatRate setting). Note that you can call IsItemActive() after any Button() to tell if the button is held in the current frame.
|
||||
IMGUI_API void PopButtonRepeat();
|
||||
|
||||
@ -419,7 +420,7 @@ namespace ImGui
|
||||
IMGUI_API void PopTextWrapPos();
|
||||
|
||||
// Style read access
|
||||
// - Use the style editor (ShowStyleEditor() function) to interactively see what the colors are)
|
||||
// - Use the ShowStyleEditor() function to interactively see/edit the colors.
|
||||
IMGUI_API ImFont* GetFont(); // get current font
|
||||
IMGUI_API float GetFontSize(); // get current font size (= height in pixels) of current font with current scale applied
|
||||
IMGUI_API ImVec2 GetFontTexUvWhitePixel(); // get UV coordinate for a while pixel, useful to draw custom shapes via the ImDrawList API
|
||||
@ -460,7 +461,7 @@ namespace ImGui
|
||||
IMGUI_API float GetFrameHeightWithSpacing(); // ~ FontSize + style.FramePadding.y * 2 + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of framed widgets)
|
||||
|
||||
// ID stack/scopes
|
||||
// Read the FAQ (docs/FAQ.md or http://dearimgui.org/faq) for more details about how ID are handled in dear imgui.
|
||||
// Read the FAQ (docs/FAQ.md or http://dearimgui.com/faq) for more details about how ID are handled in dear imgui.
|
||||
// - Those questions are answered and impacted by understanding of the ID stack system:
|
||||
// - "Q: Why is my widget not reacting when I click on it?"
|
||||
// - "Q: How can I have widgets with an empty label?"
|
||||
@ -493,6 +494,7 @@ namespace ImGui
|
||||
IMGUI_API void LabelTextV(const char* label, const char* fmt, va_list args) IM_FMTLIST(2);
|
||||
IMGUI_API void BulletText(const char* fmt, ...) IM_FMTARGS(1); // shortcut for Bullet()+Text()
|
||||
IMGUI_API void BulletTextV(const char* fmt, va_list args) IM_FMTLIST(1);
|
||||
IMGUI_API void SeparatorText(const char* label); // currently: formatted text with an horizontal line
|
||||
|
||||
// Widgets: Main
|
||||
// - Most widgets return true when the value has been changed or when pressed/selected
|
||||
@ -664,8 +666,8 @@ namespace ImGui
|
||||
|
||||
// Tooltips
|
||||
// - Tooltip are windows following the mouse. They do not take focus away.
|
||||
IMGUI_API void BeginTooltip(); // begin/append a tooltip window. to create full-featured tooltip (with any kind of items).
|
||||
IMGUI_API void EndTooltip();
|
||||
IMGUI_API bool BeginTooltip(); // begin/append a tooltip window. to create full-featured tooltip (with any kind of items).
|
||||
IMGUI_API void EndTooltip(); // only call EndTooltip() if BeginTooltip() returns true!
|
||||
IMGUI_API void SetTooltip(const char* fmt, ...) IM_FMTARGS(1); // set a text-only tooltip, typically use with ImGui::IsItemHovered(). override any previous call to SetTooltip().
|
||||
IMGUI_API void SetTooltipV(const char* fmt, va_list args) IM_FMTLIST(1);
|
||||
|
||||
@ -782,6 +784,7 @@ namespace ImGui
|
||||
IMGUI_API int GetColumnsCount();
|
||||
|
||||
// Tab Bars, Tabs
|
||||
// - Note: Tabs are automatically created by the docking system (when in 'docking' branch). Use this to create tab bars/tabs yourself.
|
||||
IMGUI_API bool BeginTabBar(const char* str_id, ImGuiTabBarFlags flags = 0); // create and append into a TabBar
|
||||
IMGUI_API void EndTabBar(); // only call EndTabBar() if BeginTabBar() returns true!
|
||||
IMGUI_API bool BeginTabItem(const char* label, bool* p_open = NULL, ImGuiTabItemFlags flags = 0); // create a Tab. Returns true if the Tab is selected.
|
||||
@ -845,6 +848,7 @@ namespace ImGui
|
||||
IMGUI_API bool IsAnyItemHovered(); // is any item hovered?
|
||||
IMGUI_API bool IsAnyItemActive(); // is any item active?
|
||||
IMGUI_API bool IsAnyItemFocused(); // is any item focused?
|
||||
IMGUI_API ImGuiID GetItemID(); // get ID of last item (~~ often same ImGui::GetID(label) beforehand)
|
||||
IMGUI_API ImVec2 GetItemRectMin(); // get upper-left bounding rectangle of the last item (screen space)
|
||||
IMGUI_API ImVec2 GetItemRectMax(); // get lower-right bounding rectangle of the last item (screen space)
|
||||
IMGUI_API ImVec2 GetItemRectSize(); // get size of last item
|
||||
@ -881,12 +885,11 @@ namespace ImGui
|
||||
IMGUI_API void ColorConvertRGBtoHSV(float r, float g, float b, float& out_h, float& out_s, float& out_v);
|
||||
IMGUI_API void ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float& out_g, float& out_b);
|
||||
|
||||
// Inputs Utilities: Keyboard
|
||||
// Without IMGUI_DISABLE_OBSOLETE_KEYIO: (legacy support)
|
||||
// - For 'ImGuiKey key' you can still use your legacy native/user indices according to how your backend/engine stored them in io.KeysDown[].
|
||||
// With IMGUI_DISABLE_OBSOLETE_KEYIO: (this is the way forward)
|
||||
// - Any use of 'ImGuiKey' will assert when key < 512 will be passed, previously reserved as native/user keys indices
|
||||
// - GetKeyIndex() is pass-through and therefore deprecated (gone if IMGUI_DISABLE_OBSOLETE_KEYIO is defined)
|
||||
// Inputs Utilities: Keyboard/Mouse/Gamepad
|
||||
// - the ImGuiKey enum contains all possible keyboard, mouse and gamepad inputs (e.g. ImGuiKey_A, ImGuiKey_MouseLeft, ImGuiKey_GamepadDpadUp...).
|
||||
// - before v1.87, we used ImGuiKey to carry native/user indices as defined by each backends. About use of those legacy ImGuiKey values:
|
||||
// - without IMGUI_DISABLE_OBSOLETE_KEYIO (legacy support): you can still use your legacy native/user indices (< 512) according to how your backend/engine stored them in io.KeysDown[], but need to cast them to ImGuiKey.
|
||||
// - with IMGUI_DISABLE_OBSOLETE_KEYIO (this is the way forward): any use of ImGuiKey will assert with key < 512. GetKeyIndex() is pass-through and therefore deprecated (gone if IMGUI_DISABLE_OBSOLETE_KEYIO is defined).
|
||||
IMGUI_API bool IsKeyDown(ImGuiKey key); // is key being held.
|
||||
IMGUI_API bool IsKeyPressed(ImGuiKey key, bool repeat = true); // was key pressed (went from !Down to Down)? if repeat=true, uses io.KeyRepeatDelay / KeyRepeatRate
|
||||
IMGUI_API bool IsKeyReleased(ImGuiKey key); // was key released (went from Down to !Down)?
|
||||
@ -894,7 +897,7 @@ namespace ImGui
|
||||
IMGUI_API const char* GetKeyName(ImGuiKey key); // [DEBUG] returns English name of the key. Those names a provided for debugging purpose and are not meant to be saved persistently not compared.
|
||||
IMGUI_API void SetNextFrameWantCaptureKeyboard(bool want_capture_keyboard); // Override io.WantCaptureKeyboard flag next frame (said flag is left for your application to handle, typically when true it instructs your app to ignore inputs). e.g. force capture keyboard when your widget is being hovered. This is equivalent to setting "io.WantCaptureKeyboard = want_capture_keyboard"; after the next NewFrame() call.
|
||||
|
||||
// Inputs Utilities: Mouse
|
||||
// Inputs Utilities: Mouse specific
|
||||
// - To refer to a mouse button, you may use named enums in your code e.g. ImGuiMouseButton_Left, ImGuiMouseButton_Right.
|
||||
// - You can also use regular integer: it is forever guaranteed that 0=Left, 1=Right, 2=Middle.
|
||||
// - Dragging operations are only reported after mouse has moved a certain distance away from the initial clicking position (see 'lock_threshold' and 'io.MouseDraggingThreshold')
|
||||
@ -1011,12 +1014,10 @@ enum ImGuiInputTextFlags_
|
||||
ImGuiInputTextFlags_CharsScientific = 1 << 17, // Allow 0123456789.+-*/eE (Scientific notation input)
|
||||
ImGuiInputTextFlags_CallbackResize = 1 << 18, // Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow. Notify when the string wants to be resized (for string types which hold a cache of their Size). You will be provided a new BufSize in the callback and NEED to honor it. (see misc/cpp/imgui_stdlib.h for an example of using this)
|
||||
ImGuiInputTextFlags_CallbackEdit = 1 << 19, // Callback on any edit (note that InputText() already returns true on edit, the callback is useful mainly to manipulate the underlying buffer while focus is active)
|
||||
ImGuiInputTextFlags_EscapeClearsAll = 1 << 20, // Escape key clears content if not empty, and deactivate otherwise (constrast to default behavior of Escape to revert)
|
||||
ImGuiInputTextFlags_EscapeClearsAll = 1 << 20, // Escape key clears content if not empty, and deactivate otherwise (contrast to default behavior of Escape to revert)
|
||||
|
||||
// Obsolete names (will be removed soon)
|
||||
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||
ImGuiInputTextFlags_AlwaysInsertMode = ImGuiInputTextFlags_AlwaysOverwrite // [renamed in 1.82] name was not matching behavior
|
||||
#endif
|
||||
// Obsolete names
|
||||
//ImGuiInputTextFlags_AlwaysInsertMode = ImGuiInputTextFlags_AlwaysOverwrite // [renamed in 1.82] name was not matching behavior
|
||||
};
|
||||
|
||||
// Flags for ImGui::TreeNodeEx(), ImGui::CollapsingHeader*()
|
||||
@ -1295,7 +1296,7 @@ enum ImGuiDragDropFlags_
|
||||
{
|
||||
ImGuiDragDropFlags_None = 0,
|
||||
// BeginDragDropSource() flags
|
||||
ImGuiDragDropFlags_SourceNoPreviewTooltip = 1 << 0, // By default, a successful call to BeginDragDropSource opens a tooltip so you can display a preview or description of the source contents. This flag disables this behavior.
|
||||
ImGuiDragDropFlags_SourceNoPreviewTooltip = 1 << 0, // Disable preview tooltip. By default, a successful call to BeginDragDropSource opens a tooltip so you can display a preview or description of the source contents. This flag disables this behavior.
|
||||
ImGuiDragDropFlags_SourceNoDisableHover = 1 << 1, // By default, when dragging we clear data so that IsItemHovered() will return false, to avoid subsequent user code submitting tooltips. This flag disables this behavior so you can still call IsItemHovered() on the source item.
|
||||
ImGuiDragDropFlags_SourceNoHoldToOpenOthers = 1 << 2, // Disable the behavior that allows to open tree nodes and collapsing header by holding over them while dragging a source item.
|
||||
ImGuiDragDropFlags_SourceAllowNullID = 1 << 3, // Allow items such as Text(), Image() that have no unique identifier to be used as drag source, by manufacturing a temporary identifier based on their window-relative position. This is extremely unusual within the dear imgui ecosystem and so we made it explicit.
|
||||
@ -1347,9 +1348,11 @@ enum ImGuiSortDirection_
|
||||
ImGuiSortDirection_Descending = 2 // Descending = 9->0, Z->A etc.
|
||||
};
|
||||
|
||||
// A key identifier (ImGuiKey_XXX or ImGuiMod_XXX value)
|
||||
// All our named keys are >= 512. Keys value 0 to 511 are left unused as legacy native/opaque key values (< 1.87)
|
||||
// A key identifier (ImGuiKey_XXX or ImGuiMod_XXX value): can represent Keyboard, Mouse and Gamepad values.
|
||||
// All our named keys are >= 512. Keys value 0 to 511 are left unused as legacy native/opaque key values (< 1.87).
|
||||
// Since >= 1.89 we increased typing (went from int to enum), some legacy code may need a cast to ImGuiKey.
|
||||
// Read details about the 1.87 and 1.89 transition : https://github.com/ocornut/imgui/issues/4921
|
||||
// Note that "Keys" related to physical keys and are not the same concept as input "Characters", the later are submitted via io.AddInputCharacter().
|
||||
enum ImGuiKey : int
|
||||
{
|
||||
// Keyboard
|
||||
@ -1404,8 +1407,8 @@ enum ImGuiKey : int
|
||||
ImGuiKey_KeypadEnter,
|
||||
ImGuiKey_KeypadEqual,
|
||||
|
||||
// Gamepad (some of those are analog values, 0.0f to 1.0f) // GAME NAVIGATION ACTION
|
||||
// (download controller mapping PNG/PSD at http://dearimgui.org/controls_sheets)
|
||||
// Gamepad (some of those are analog values, 0.0f to 1.0f) // NAVIGATION ACTION
|
||||
// (download controller mapping PNG/PSD at http://dearimgui.com/controls_sheets)
|
||||
ImGuiKey_GamepadStart, // Menu (Xbox) + (Switch) Start/Options (PS)
|
||||
ImGuiKey_GamepadBack, // View (Xbox) - (Switch) Share (PS)
|
||||
ImGuiKey_GamepadFaceLeft, // X (Xbox) Y (Switch) Square (PS) // Tap: Toggle Menu. Hold: Windowing mode (Focus/Move/Resize windows)
|
||||
@ -1431,7 +1434,7 @@ enum ImGuiKey : int
|
||||
ImGuiKey_GamepadRStickUp, // [Analog]
|
||||
ImGuiKey_GamepadRStickDown, // [Analog]
|
||||
|
||||
// Mouse Buttons (auto-submitted from AddMouseButtonEvent() calls)
|
||||
// Aliases: Mouse Buttons (auto-submitted from AddMouseButtonEvent() calls)
|
||||
// - This is mirroring the data also written to io.MouseDown[], io.MouseWheel, in a format allowing them to be accessed via standard key API.
|
||||
ImGuiKey_MouseLeft, ImGuiKey_MouseRight, ImGuiKey_MouseMiddle, ImGuiKey_MouseX1, ImGuiKey_MouseX2, ImGuiKey_MouseWheelX, ImGuiKey_MouseWheelY,
|
||||
|
||||
@ -1448,28 +1451,25 @@ enum ImGuiKey : int
|
||||
// In practice: it's complicated; mods are often provided from different sources. Keyboard layout, IME, sticky keys and
|
||||
// backends tend to interfere and break that equivalence. The safer decision is to relay that ambiguity down to the end-user...
|
||||
ImGuiMod_None = 0,
|
||||
ImGuiMod_Ctrl = 1 << 12,
|
||||
ImGuiMod_Shift = 1 << 13,
|
||||
ImGuiMod_Ctrl = 1 << 12, // Ctrl
|
||||
ImGuiMod_Shift = 1 << 13, // Shift
|
||||
ImGuiMod_Alt = 1 << 14, // Option/Menu
|
||||
ImGuiMod_Super = 1 << 15, // Cmd/Super/Windows
|
||||
ImGuiMod_Mask_ = 0xF000,
|
||||
#if defined(__APPLE__)
|
||||
ImGuiMod_Shortcut = ImGuiMod_Super,
|
||||
#else
|
||||
ImGuiMod_Shortcut = ImGuiMod_Ctrl,
|
||||
#endif
|
||||
ImGuiMod_Shortcut = 1 << 11, // Alias for Ctrl (non-macOS) _or_ Super (macOS).
|
||||
ImGuiMod_Mask_ = 0xF800, // 5-bits
|
||||
|
||||
// [Internal] Prior to 1.87 we required user to fill io.KeysDown[512] using their own native index + the io.KeyMap[] array.
|
||||
// We are ditching this method but keeping a legacy path for user code doing e.g. IsKeyPressed(MY_NATIVE_KEY_CODE)
|
||||
// If you need to iterate all keys (for e.g. an input mapper) you may use ImGuiKey_NamedKey_BEGIN..ImGuiKey_NamedKey_END.
|
||||
ImGuiKey_NamedKey_BEGIN = 512,
|
||||
ImGuiKey_NamedKey_END = ImGuiKey_COUNT,
|
||||
ImGuiKey_NamedKey_COUNT = ImGuiKey_NamedKey_END - ImGuiKey_NamedKey_BEGIN,
|
||||
#ifdef IMGUI_DISABLE_OBSOLETE_KEYIO
|
||||
ImGuiKey_KeysData_SIZE = ImGuiKey_NamedKey_COUNT, // Size of KeysData[]: only hold named keys
|
||||
ImGuiKey_KeysData_OFFSET = ImGuiKey_NamedKey_BEGIN, // First key stored in io.KeysData[0]. Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET).
|
||||
ImGuiKey_KeysData_SIZE = ImGuiKey_NamedKey_COUNT, // Size of KeysData[]: only hold named keys
|
||||
ImGuiKey_KeysData_OFFSET = ImGuiKey_NamedKey_BEGIN, // Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET) index.
|
||||
#else
|
||||
ImGuiKey_KeysData_SIZE = ImGuiKey_COUNT, // Size of KeysData[]: hold legacy 0..512 keycodes + named keys
|
||||
ImGuiKey_KeysData_OFFSET = 0, // First key stored in io.KeysData[0]. Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET).
|
||||
ImGuiKey_KeysData_SIZE = ImGuiKey_COUNT, // Size of KeysData[]: hold legacy 0..512 keycodes + named keys
|
||||
ImGuiKey_KeysData_OFFSET = 0, // Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET) index.
|
||||
#endif
|
||||
|
||||
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||
@ -1494,7 +1494,7 @@ enum ImGuiNavInput
|
||||
enum ImGuiConfigFlags_
|
||||
{
|
||||
ImGuiConfigFlags_None = 0,
|
||||
ImGuiConfigFlags_NavEnableKeyboard = 1 << 0, // Master keyboard navigation enable flag.
|
||||
ImGuiConfigFlags_NavEnableKeyboard = 1 << 0, // Master keyboard navigation enable flag. Enable full Tabbing + directional arrows + space/enter to activate.
|
||||
ImGuiConfigFlags_NavEnableGamepad = 1 << 1, // Master gamepad navigation enable flag. Backend also needs to set ImGuiBackendFlags_HasGamepad.
|
||||
ImGuiConfigFlags_NavEnableSetMousePos = 1 << 2, // Instruct navigation to move the mouse cursor. May be useful on TV/console systems where moving a virtual mouse is awkward. Will update io.MousePos and set io.WantSetMousePos=true. If enabled you MUST honor io.WantSetMousePos requests in your backend, otherwise ImGui will react as if the mouse is jumping around back and forth.
|
||||
ImGuiConfigFlags_NavNoCaptureKeyboard = 1 << 3, // Instruct navigation to not set the io.WantCaptureKeyboard flag when io.NavActive is set.
|
||||
@ -1610,6 +1610,9 @@ enum ImGuiStyleVar_
|
||||
ImGuiStyleVar_TabRounding, // float TabRounding
|
||||
ImGuiStyleVar_ButtonTextAlign, // ImVec2 ButtonTextAlign
|
||||
ImGuiStyleVar_SelectableTextAlign, // ImVec2 SelectableTextAlign
|
||||
ImGuiStyleVar_SeparatorTextBorderSize,// float SeparatorTextBorderSize
|
||||
ImGuiStyleVar_SeparatorTextAlign, // ImVec2 SeparatorTextAlign
|
||||
ImGuiStyleVar_SeparatorTextPadding,// ImVec2 SeparatorTextPadding
|
||||
ImGuiStyleVar_COUNT
|
||||
};
|
||||
|
||||
@ -1666,8 +1669,8 @@ enum ImGuiColorEditFlags_
|
||||
ImGuiColorEditFlags_PickerMask_ = ImGuiColorEditFlags_PickerHueWheel | ImGuiColorEditFlags_PickerHueBar,
|
||||
ImGuiColorEditFlags_InputMask_ = ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_InputHSV,
|
||||
|
||||
// Obsolete names (will be removed)
|
||||
// ImGuiColorEditFlags_RGB = ImGuiColorEditFlags_DisplayRGB, ImGuiColorEditFlags_HSV = ImGuiColorEditFlags_DisplayHSV, ImGuiColorEditFlags_HEX = ImGuiColorEditFlags_DisplayHex // [renamed in 1.69]
|
||||
// Obsolete names
|
||||
//ImGuiColorEditFlags_RGB = ImGuiColorEditFlags_DisplayRGB, ImGuiColorEditFlags_HSV = ImGuiColorEditFlags_DisplayHSV, ImGuiColorEditFlags_HEX = ImGuiColorEditFlags_DisplayHex // [renamed in 1.69]
|
||||
};
|
||||
|
||||
// Flags for DragFloat(), DragInt(), SliderFloat(), SliderInt() etc.
|
||||
@ -1682,10 +1685,8 @@ enum ImGuiSliderFlags_
|
||||
ImGuiSliderFlags_NoInput = 1 << 7, // Disable CTRL+Click or Enter key allowing to input text directly into the widget
|
||||
ImGuiSliderFlags_InvalidMask_ = 0x7000000F, // [Internal] We treat using those bits as being potentially a 'float power' argument from the previous API that has got miscast to this enum, and will trigger an assert if needed.
|
||||
|
||||
// Obsolete names (will be removed)
|
||||
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||
ImGuiSliderFlags_ClampOnInput = ImGuiSliderFlags_AlwaysClamp, // [renamed in 1.79]
|
||||
#endif
|
||||
// Obsolete names
|
||||
//ImGuiSliderFlags_ClampOnInput = ImGuiSliderFlags_AlwaysClamp, // [renamed in 1.79]
|
||||
};
|
||||
|
||||
// Identify a mouse button.
|
||||
@ -1715,6 +1716,18 @@ enum ImGuiMouseCursor_
|
||||
ImGuiMouseCursor_COUNT
|
||||
};
|
||||
|
||||
// Enumeration for AddMouseSourceEvent() actual source of Mouse Input data.
|
||||
// Historically we use "Mouse" terminology everywhere to indicate pointer data, e.g. MousePos, IsMousePressed(), io.AddMousePosEvent()
|
||||
// But that "Mouse" data can come from different source which occasionally may be useful for application to know about.
|
||||
// You can submit a change of pointer type using io.AddMouseSourceEvent().
|
||||
enum ImGuiMouseSource : int
|
||||
{
|
||||
ImGuiMouseSource_Mouse = 0, // Input is coming from an actual mouse.
|
||||
ImGuiMouseSource_TouchScreen, // Input is coming from a touch screen (no hovering prior to initial press, less precise initial press aiming, dual-axis wheeling possible).
|
||||
ImGuiMouseSource_Pen, // Input is coming from a pressure/magnetic pen (often used in conjunction with high-sampling rates).
|
||||
ImGuiMouseSource_COUNT
|
||||
};
|
||||
|
||||
// Enumeration for ImGui::SetWindow***(), SetNextWindow***(), SetNextItem***() functions
|
||||
// Represent a condition.
|
||||
// Important: Treat as a regular enum! Do NOT combine multiple values using binary operators! All the functions above treat 0 as a shortcut to ImGuiCond_Always.
|
||||
@ -1864,6 +1877,9 @@ struct ImGuiStyle
|
||||
ImGuiDir ColorButtonPosition; // Side of the color button in the ColorEdit4 widget (left/right). Defaults to ImGuiDir_Right.
|
||||
ImVec2 ButtonTextAlign; // Alignment of button text when button is larger than text. Defaults to (0.5f, 0.5f) (centered).
|
||||
ImVec2 SelectableTextAlign; // Alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). It's generally important to keep this left-aligned if you want to lay multiple items on a same line.
|
||||
float SeparatorTextBorderSize; // Thickkness of border in SeparatorText()
|
||||
ImVec2 SeparatorTextAlign; // Alignment of text within the separator. Defaults to (0.0f, 0.5f) (left aligned, center).
|
||||
ImVec2 SeparatorTextPadding; // Horizontal offset of text from each edge of the separator + spacing on other axis. Generally small values. .y is recommended to be == FramePadding.y.
|
||||
ImVec2 DisplayWindowPadding; // Window position are clamped to be visible within the display area or monitors by at least this amount. Only applies to regular windows.
|
||||
ImVec2 DisplaySafeAreaPadding; // If you cannot see the edges of your screen (e.g. on a TV) increase the safe area padding. Apply to popups/tooltips as well regular windows. NB: Prefer configuring your TV sets correctly!
|
||||
float MouseCursorScale; // Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later.
|
||||
@ -1915,7 +1931,7 @@ struct ImGuiIO
|
||||
float KeyRepeatRate; // = 0.050f // When holding a key/button, rate at which it repeats, in seconds.
|
||||
float HoverDelayNormal; // = 0.30 sec // Delay on hovering before IsItemHovered(ImGuiHoveredFlags_DelayNormal) returns true.
|
||||
float HoverDelayShort; // = 0.10 sec // Delay on hovering before IsItemHovered(ImGuiHoveredFlags_DelayShort) returns true.
|
||||
void* UserData; // = NULL // Store your own data for retrieval by callbacks.
|
||||
void* UserData; // = NULL // Store your own data.
|
||||
|
||||
ImFontAtlas*Fonts; // <auto> // Font atlas: load, rasterize and pack one or more fonts into a single texture.
|
||||
float FontGlobalScale; // = 1.0f // Global scale all fonts
|
||||
@ -1934,6 +1950,14 @@ struct ImGuiIO
|
||||
bool ConfigWindowsMoveFromTitleBarOnly; // = false // Enable allowing to move windows only when clicking on their title bar. Does not apply to windows without a title bar.
|
||||
float ConfigMemoryCompactTimer; // = 60.0f // Timer (in seconds) to free transient windows/tables memory buffers when unused. Set to -1.0f to disable.
|
||||
|
||||
// Debug options
|
||||
// - tools to test correct Begin/End and BeginChild/EndChild behaviors.
|
||||
// - presently Begn()/End() and BeginChild()EndChild() needs to ALWAYS be called in tandem, regardless of return value of BeginXXX()
|
||||
// this is inconsistent with other BeginXXX functions and create confusion for many users.
|
||||
// - we expect to update the API eventually. In the meanwhile we provided tools to facilitate checking user-code behavior.
|
||||
bool ConfigDebugBeginReturnValueOnce; // = false // First-time calls to Begin()/BeginChild() will return false. NEEDS TO BE SET AT APPLICATION BOOT TIME if you don't want to miss windows.
|
||||
bool ConfigDebugBeginReturnValueLoop; // = false // Some calls to Begin()/BeginChild() will return false. Will cycle through window depths then repeat. Suggested use: add "io.ConfigDebugBeginReturnValue = io.KeyShift" in your main loop then occasionally press SHIFT. Windows should be flickering while running.
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// Platform Functions
|
||||
// (the imgui_impl_xxxx backend files are setting those up for you)
|
||||
@ -1970,7 +1994,8 @@ struct ImGuiIO
|
||||
IMGUI_API void AddKeyAnalogEvent(ImGuiKey key, bool down, float v); // Queue a new key down/up event for analog values (e.g. ImGuiKey_Gamepad_ values). Dead-zones should be handled by the backend.
|
||||
IMGUI_API void AddMousePosEvent(float x, float y); // Queue a mouse position update. Use -FLT_MAX,-FLT_MAX to signify no mouse (e.g. app not focused and not hovered)
|
||||
IMGUI_API void AddMouseButtonEvent(int button, bool down); // Queue a mouse button change
|
||||
IMGUI_API void AddMouseWheelEvent(float wh_x, float wh_y); // Queue a mouse wheel update
|
||||
IMGUI_API void AddMouseWheelEvent(float wheel_x, float wheel_y); // Queue a mouse wheel update. wheel_y<0: scroll down, wheel_y>0: scroll up, wheel_x<0: scroll right, wheel_x>0: scroll left.
|
||||
IMGUI_API void AddMouseSourceEvent(ImGuiMouseSource source); // Queue a mouse source change (Mouse/TouchScreen/Pen)
|
||||
IMGUI_API void AddFocusEvent(bool focused); // Queue a gain/loss of focus for the application (generally based on OS/platform focus of your window)
|
||||
IMGUI_API void AddInputCharacter(unsigned int c); // Queue a new character input
|
||||
IMGUI_API void AddInputCharacterUTF16(ImWchar16 c); // Queue a new character input from a UTF-16 character, it can be a surrogate
|
||||
@ -2015,20 +2040,23 @@ struct ImGuiIO
|
||||
// [Internal] Dear ImGui will maintain those fields. Forward compatibility not guaranteed!
|
||||
//------------------------------------------------------------------
|
||||
|
||||
ImGuiContext* Ctx; // Parent UI context (needs to be set explicitly by parent).
|
||||
|
||||
// Main Input State
|
||||
// (this block used to be written by backend, since 1.87 it is best to NOT write to those directly, call the AddXXX functions above instead)
|
||||
// (reading from those variables is fair game, as they are extremely unlikely to be moving anywhere)
|
||||
ImVec2 MousePos; // Mouse position, in pixels. Set to ImVec2(-FLT_MAX, -FLT_MAX) if mouse is unavailable (on another screen, etc.)
|
||||
bool MouseDown[5]; // Mouse buttons: 0=left, 1=right, 2=middle + extras (ImGuiMouseButton_COUNT == 5). Dear ImGui mostly uses left and right buttons. Other buttons allow us to track if the mouse is being used by your application + available to user as a convenience via IsMouse** API.
|
||||
float MouseWheel; // Mouse wheel Vertical: 1 unit scrolls about 5 lines text.
|
||||
float MouseWheelH; // Mouse wheel Horizontal. Most users don't have a mouse with a horizontal wheel, may not be filled by all backends.
|
||||
float MouseWheel; // Mouse wheel Vertical: 1 unit scrolls about 5 lines text. >0 scrolls Up, <0 scrolls Down. Hold SHIFT to turn vertical scroll into horizontal scroll.
|
||||
float MouseWheelH; // Mouse wheel Horizontal. >0 scrolls Left, <0 scrolls Right. Most users don't have a mouse with a horizontal wheel, may not be filled by all backends.
|
||||
ImGuiMouseSource MouseSource; // Mouse actual input peripheral (Mouse/TouchScreen/Pen).
|
||||
bool KeyCtrl; // Keyboard modifier down: Control
|
||||
bool KeyShift; // Keyboard modifier down: Shift
|
||||
bool KeyAlt; // Keyboard modifier down: Alt
|
||||
bool KeySuper; // Keyboard modifier down: Cmd/Super/Windows
|
||||
|
||||
// Other state maintained from data above + IO function calls
|
||||
ImGuiKeyChord KeyMods; // Key mods flags (any of ImGuiMod_Ctrl/ImGuiMod_Shift/ImGuiMod_Alt/ImGuiMod_Super flags, same as io.KeyCtrl/KeyShift/KeyAlt/KeySuper but merged into flags). Read-only, updated by NewFrame()
|
||||
ImGuiKeyChord KeyMods; // Key mods flags (any of ImGuiMod_Ctrl/ImGuiMod_Shift/ImGuiMod_Alt/ImGuiMod_Super flags, same as io.KeyCtrl/KeyShift/KeyAlt/KeySuper but merged into flags. DOES NOT CONTAINS ImGuiMod_Shortcut which is pretranslated). Read-only, updated by NewFrame()
|
||||
ImGuiKeyData KeysData[ImGuiKey_KeysData_SIZE]; // Key state for all known keys. Use IsKeyXXX() functions to access this.
|
||||
bool WantCaptureMouseUnlessPopupClose; // Alternative to WantCaptureMouse: (WantCaptureMouse == true && WantCaptureMouseUnlessPopupClose == false) when a click over void is expected to close a popup.
|
||||
ImVec2 MousePosPrev; // Previous mouse position (note that MouseDelta is not necessary == MousePos-MousePosPrev, in case either position is invalid)
|
||||
@ -2041,6 +2069,7 @@ struct ImGuiIO
|
||||
bool MouseReleased[5]; // Mouse button went from Down to !Down
|
||||
bool MouseDownOwned[5]; // Track if button was clicked inside a dear imgui window or over void blocked by a popup. We don't request mouse capture from the application if click started outside ImGui bounds.
|
||||
bool MouseDownOwnedUnlessPopupClose[5]; // Track if button was clicked inside a dear imgui window.
|
||||
bool MouseWheelRequestAxisSwap; // On a non-Mac system, holding SHIFT requests WheelY to perform the equivalent of a WheelX event. On a Mac system this is already enforced by the system.
|
||||
float MouseDownDuration[5]; // Duration the mouse button has been down (0.0f == just clicked)
|
||||
float MouseDownDurationPrev[5]; // Previous time the mouse button has been down
|
||||
float MouseDragMaxDistanceSqr[5]; // Squared maximum distance of how much mouse has traveled from the clicking point (used for moving thresholds)
|
||||
@ -2070,6 +2099,7 @@ struct ImGuiIO
|
||||
// - ImGuiInputTextFlags_CallbackResize: Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow.
|
||||
struct ImGuiInputTextCallbackData
|
||||
{
|
||||
ImGuiContext* Ctx; // Parent UI context
|
||||
ImGuiInputTextFlags EventFlag; // One ImGuiInputTextFlags_Callback* // Read-only
|
||||
ImGuiInputTextFlags Flags; // What user passed to InputText() // Read-only
|
||||
void* UserData; // What user passed to InputText() // Read-only
|
||||
@ -2154,7 +2184,7 @@ struct ImGuiTableSortSpecs
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// [SECTION] Helpers (ImGuiOnceUponAFrame, ImGuiTextFilter, ImGuiTextBuffer, ImGuiStorage, ImGuiListClipper, ImColor)
|
||||
// [SECTION] Helpers (ImGuiOnceUponAFrame, ImGuiTextFilter, ImGuiTextBuffer, ImGuiStorage, ImGuiListClipper, Math Operators, ImColor)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Helper: Unicode defines
|
||||
@ -2294,6 +2324,7 @@ struct ImGuiStorage
|
||||
// - The clipper also handles various subtleties related to keyboard/gamepad navigation, wrapping etc.
|
||||
struct ImGuiListClipper
|
||||
{
|
||||
ImGuiContext* Ctx; // Parent UI context
|
||||
int DisplayStart; // First item to display, updated by each call to Step()
|
||||
int DisplayEnd; // End of items to display (exclusive)
|
||||
int ItemsCount; // [Internal] Number of items
|
||||
@ -2317,6 +2348,32 @@ struct ImGuiListClipper
|
||||
#endif
|
||||
};
|
||||
|
||||
// Helpers: ImVec2/ImVec4 operators
|
||||
// - It is important that we are keeping those disabled by default so they don't leak in user space.
|
||||
// - This is in order to allow user enabling implicit cast operators between ImVec2/ImVec4 and their own types (using IM_VEC2_CLASS_EXTRA in imconfig.h)
|
||||
// - You can use '#define IMGUI_DEFINE_MATH_OPERATORS' to import our operators, provided as a courtesy.
|
||||
#ifdef IMGUI_DEFINE_MATH_OPERATORS
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS_IMPLEMENTED
|
||||
IM_MSVC_RUNTIME_CHECKS_OFF
|
||||
static inline ImVec2 operator*(const ImVec2& lhs, const float rhs) { return ImVec2(lhs.x * rhs, lhs.y * rhs); }
|
||||
static inline ImVec2 operator/(const ImVec2& lhs, const float rhs) { return ImVec2(lhs.x / rhs, lhs.y / rhs); }
|
||||
static inline ImVec2 operator+(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x + rhs.x, lhs.y + rhs.y); }
|
||||
static inline ImVec2 operator-(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x - rhs.x, lhs.y - rhs.y); }
|
||||
static inline ImVec2 operator*(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x * rhs.x, lhs.y * rhs.y); }
|
||||
static inline ImVec2 operator/(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x / rhs.x, lhs.y / rhs.y); }
|
||||
static inline ImVec2 operator-(const ImVec2& lhs) { return ImVec2(-lhs.x, -lhs.y); }
|
||||
static inline ImVec2& operator*=(ImVec2& lhs, const float rhs) { lhs.x *= rhs; lhs.y *= rhs; return lhs; }
|
||||
static inline ImVec2& operator/=(ImVec2& lhs, const float rhs) { lhs.x /= rhs; lhs.y /= rhs; return lhs; }
|
||||
static inline ImVec2& operator+=(ImVec2& lhs, const ImVec2& rhs) { lhs.x += rhs.x; lhs.y += rhs.y; return lhs; }
|
||||
static inline ImVec2& operator-=(ImVec2& lhs, const ImVec2& rhs) { lhs.x -= rhs.x; lhs.y -= rhs.y; return lhs; }
|
||||
static inline ImVec2& operator*=(ImVec2& lhs, const ImVec2& rhs) { lhs.x *= rhs.x; lhs.y *= rhs.y; return lhs; }
|
||||
static inline ImVec2& operator/=(ImVec2& lhs, const ImVec2& rhs) { lhs.x /= rhs.x; lhs.y /= rhs.y; return lhs; }
|
||||
static inline ImVec4 operator+(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z, lhs.w + rhs.w); }
|
||||
static inline ImVec4 operator-(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z, lhs.w - rhs.w); }
|
||||
static inline ImVec4 operator*(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z, lhs.w * rhs.w); }
|
||||
IM_MSVC_RUNTIME_CHECKS_RESTORE
|
||||
#endif
|
||||
|
||||
// Helpers macros to generate 32-bit encoded colors
|
||||
// User can declare their own format by #defining the 5 _SHIFT/_MASK macros in their imconfig file.
|
||||
#ifndef IM_COL32_R_SHIFT
|
||||
@ -2604,10 +2661,9 @@ struct ImDrawList
|
||||
inline void PrimWriteIdx(ImDrawIdx idx) { *_IdxWritePtr = idx; _IdxWritePtr++; }
|
||||
inline void PrimVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col) { PrimWriteIdx((ImDrawIdx)_VtxCurrentIdx); PrimWriteVtx(pos, uv, col); } // Write vertex with unique index
|
||||
|
||||
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||
inline void AddBezierCurve(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments = 0) { AddBezierCubic(p1, p2, p3, p4, col, thickness, num_segments); } // OBSOLETED in 1.80 (Jan 2021)
|
||||
inline void PathBezierCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments = 0) { PathBezierCubicCurveTo(p2, p3, p4, num_segments); } // OBSOLETED in 1.80 (Jan 2021)
|
||||
#endif
|
||||
// Obsolete names
|
||||
//inline void AddBezierCurve(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments = 0) { AddBezierCubic(p1, p2, p3, p4, col, thickness, num_segments); } // OBSOLETED in 1.80 (Jan 2021)
|
||||
//inline void PathBezierCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments = 0) { PathBezierCubicCurveTo(p2, p3, p4, num_segments); } // OBSOLETED in 1.80 (Jan 2021)
|
||||
|
||||
// [Internal helpers]
|
||||
IMGUI_API void _ResetForNewFrame();
|
||||
@ -2659,7 +2715,7 @@ struct ImFontConfig
|
||||
bool PixelSnapH; // false // Align every glyph to pixel boundary. Useful e.g. if you are merging a non-pixel aligned font with the default font. If enabled, you can set OversampleH/V to 1.
|
||||
ImVec2 GlyphExtraSpacing; // 0, 0 // Extra spacing (in pixels) between glyphs. Only X axis is supported for now.
|
||||
ImVec2 GlyphOffset; // 0, 0 // Offset all glyphs from this font input.
|
||||
const ImWchar* GlyphRanges; // NULL // Pointer to a user-provided list of Unicode range (2 value per range, values are inclusive, zero-terminated list). THE ARRAY DATA NEEDS TO PERSIST AS LONG AS THE FONT IS ALIVE.
|
||||
const ImWchar* GlyphRanges; // NULL // THE ARRAY DATA NEEDS TO PERSIST AS LONG AS THE FONT IS ALIVE. Pointer to a user-provided list of Unicode range (2 value per range, values are inclusive, zero-terminated list).
|
||||
float GlyphMinAdvanceX; // 0 // Minimum AdvanceX for glyphs, set Min to align font icons, set both Min/Max to enforce mono-space font
|
||||
float GlyphMaxAdvanceX; // FLT_MAX // Maximum AdvanceX for glyphs
|
||||
bool MergeMode; // false // Merge into previous ImFont, so you can combine multiple inputs font into one ImFont (e.g. ASCII font + icons + Japanese glyphs). You may want to use GlyphOffset.y when merge font of different heights.
|
||||
@ -2812,6 +2868,7 @@ struct ImFontAtlas
|
||||
int TexDesiredWidth; // Texture width desired by user before Build(). Must be a power-of-two. If have many glyphs your graphics API have texture size restrictions you may want to increase texture width to decrease height.
|
||||
int TexGlyphPadding; // Padding between glyphs within texture in pixels. Defaults to 1. If your rendering method doesn't rely on bilinear filtering you may set this to 0 (will also need to set AntiAliasedLinesUseTex = false).
|
||||
bool Locked; // Marked as Locked by ImGui::NewFrame() so attempt to modify the atlas will assert.
|
||||
void* UserData; // Store your own atlas related user-data (if e.g. you have multiple font atlas).
|
||||
|
||||
// [Internal]
|
||||
// NB: Access texture data via GetTexData*() calls! Which will setup a default font for you.
|
||||
@ -2860,8 +2917,10 @@ struct ImFont
|
||||
const ImFontConfig* ConfigData; // 4-8 // in // // Pointer within ContainerAtlas->ConfigData
|
||||
short ConfigDataCount; // 2 // in // ~ 1 // Number of ImFontConfig involved in creating this font. Bigger than 1 when merging multiple font sources into one ImFont.
|
||||
ImWchar FallbackChar; // 2 // out // = FFFD/'?' // Character used if a glyph isn't found.
|
||||
ImWchar EllipsisChar; // 2 // out // = '...' // Character used for ellipsis rendering.
|
||||
ImWchar DotChar; // 2 // out // = '.' // Character used for ellipsis rendering (if a single '...' character isn't found)
|
||||
ImWchar EllipsisChar; // 2 // out // = '...'/'.'// Character used for ellipsis rendering.
|
||||
short EllipsisCharCount; // 1 // out // 1 or 3
|
||||
float EllipsisWidth; // 4 // out // Width
|
||||
float EllipsisCharStep; // 4 // out // Step between characters when EllipsisCount > 0
|
||||
bool DirtyLookupTables; // 1 // out //
|
||||
float Scale; // 4 // in // = 1.f // Base font scale, multiplied by the per-window font scale which you can adjust with SetWindowFontScale()
|
||||
float Ascent, Descent; // 4+4 // out // // Ascent: distance from top to bottom of e.g. 'A' [0..FontSize]
|
||||
@ -2964,6 +3023,9 @@ namespace ImGui
|
||||
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||
namespace ImGui
|
||||
{
|
||||
// OBSOLETED in 1.89.4 (from March 2023)
|
||||
static inline void PushAllowKeyboardFocus(bool tab_stop) { PushTabStop(tab_stop); }
|
||||
static inline void PopAllowKeyboardFocus() { PopTabStop(); }
|
||||
// OBSOLETED in 1.89 (from August 2022)
|
||||
IMGUI_API bool ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0, 0, 0, 0), const ImVec4& tint_col = ImVec4(1, 1, 1, 1)); // Use new ImageButton() signature (explicit item id, regular FramePadding)
|
||||
// OBSOLETED in 1.88 (from May 2022)
|
||||
|
451
3rdparty/dear-imgui/imgui_demo.cpp
vendored
451
3rdparty/dear-imgui/imgui_demo.cpp
vendored
@ -1,8 +1,8 @@
|
||||
// dear imgui, v1.89.1 WIP
|
||||
// dear imgui, v1.89.6 WIP
|
||||
// (demo code)
|
||||
|
||||
// Help:
|
||||
// - Read FAQ at http://dearimgui.org/faq
|
||||
// - Read FAQ at http://dearimgui.com/faq
|
||||
// - Newcomers, read 'Programmer guide' in imgui.cpp for notes on how to setup Dear ImGui in your codebase.
|
||||
// - Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp. All applications in examples/ are doing that.
|
||||
// Read imgui.cpp for more details, documentation and comments.
|
||||
@ -38,7 +38,7 @@
|
||||
// - We try to declare static variables in the local scope, as close as possible to the code using them.
|
||||
// - We never use any of the helpers/facilities used internally by Dear ImGui, unless available in the public API.
|
||||
// - We never use maths operators on ImVec2/ImVec4. For our other sources files we use them, and they are provided
|
||||
// by imgui_internal.h using the IMGUI_DEFINE_MATH_OPERATORS define. For your own sources file they are optional
|
||||
// by imgui.h using the IMGUI_DEFINE_MATH_OPERATORS define. For your own sources file they are optional
|
||||
// and require you either enable those, either provide your own via IM_VEC2_CLASS_EXTRA in imconfig.h.
|
||||
// Because we can't assume anything about your support of maths operators, we cannot use them in imgui_demo.cpp.
|
||||
|
||||
@ -211,9 +211,8 @@ static void ShowDemoWindowInputs();
|
||||
static void HelpMarker(const char* desc)
|
||||
{
|
||||
ImGui::TextDisabled("(?)");
|
||||
if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayShort))
|
||||
if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayShort) && ImGui::BeginTooltip())
|
||||
{
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);
|
||||
ImGui::TextUnformatted(desc);
|
||||
ImGui::PopTextWrapPos();
|
||||
@ -410,7 +409,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
||||
ImGui::BulletText("See the ShowDemoWindow() code in imgui_demo.cpp. <- you are here!");
|
||||
ImGui::BulletText("See comments in imgui.cpp.");
|
||||
ImGui::BulletText("See example applications in the examples/ folder.");
|
||||
ImGui::BulletText("Read the FAQ at http://www.dearimgui.org/faq/");
|
||||
ImGui::BulletText("Read the FAQ at http://www.dearimgui.com/faq/");
|
||||
ImGui::BulletText("Set 'io.ConfigFlags |= NavEnableKeyboard' for keyboard controls.");
|
||||
ImGui::BulletText("Set 'io.ConfigFlags |= NavEnableGamepad' for gamepad controls.");
|
||||
ImGui::Separator();
|
||||
@ -426,6 +425,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
||||
|
||||
if (ImGui::TreeNode("Configuration##2"))
|
||||
{
|
||||
ImGui::SeparatorText("General");
|
||||
ImGui::CheckboxFlags("io.ConfigFlags: NavEnableKeyboard", &io.ConfigFlags, ImGuiConfigFlags_NavEnableKeyboard);
|
||||
ImGui::SameLine(); HelpMarker("Enable keyboard controls.");
|
||||
ImGui::CheckboxFlags("io.ConfigFlags: NavEnableGamepad", &io.ConfigFlags, ImGuiConfigFlags_NavEnableGamepad);
|
||||
@ -448,6 +448,10 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
||||
ImGui::SameLine(); HelpMarker("Instruct backend to not alter mouse cursor shape and visibility.");
|
||||
ImGui::Checkbox("io.ConfigInputTrickleEventQueue", &io.ConfigInputTrickleEventQueue);
|
||||
ImGui::SameLine(); HelpMarker("Enable input queue trickling: some types of events submitted during the same frame (e.g. button down + up) will be spread over multiple frames, improving interactions with low framerates.");
|
||||
ImGui::Checkbox("io.MouseDrawCursor", &io.MouseDrawCursor);
|
||||
ImGui::SameLine(); HelpMarker("Instruct Dear ImGui to render a mouse cursor itself. Note that a mouse cursor rendered via your application GPU rendering path will feel more laggy than hardware cursor, but will be more in sync with your other visuals.\n\nSome desktop applications may use both kinds of cursors (e.g. enable software cursor only when resizing/dragging something).");
|
||||
|
||||
ImGui::SeparatorText("Widgets");
|
||||
ImGui::Checkbox("io.ConfigInputTextCursorBlink", &io.ConfigInputTextCursorBlink);
|
||||
ImGui::SameLine(); HelpMarker("Enable blinking cursor (optional as some users consider it to be distracting).");
|
||||
ImGui::Checkbox("io.ConfigInputTextEnterKeepActive", &io.ConfigInputTextEnterKeepActive);
|
||||
@ -457,11 +461,19 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
||||
ImGui::Checkbox("io.ConfigWindowsResizeFromEdges", &io.ConfigWindowsResizeFromEdges);
|
||||
ImGui::SameLine(); HelpMarker("Enable resizing of windows from their edges and from the lower-left corner.\nThis requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback.");
|
||||
ImGui::Checkbox("io.ConfigWindowsMoveFromTitleBarOnly", &io.ConfigWindowsMoveFromTitleBarOnly);
|
||||
ImGui::Checkbox("io.MouseDrawCursor", &io.MouseDrawCursor);
|
||||
ImGui::SameLine(); HelpMarker("Instruct Dear ImGui to render a mouse cursor itself. Note that a mouse cursor rendered via your application GPU rendering path will feel more laggy than hardware cursor, but will be more in sync with your other visuals.\n\nSome desktop applications may use both kinds of cursors (e.g. enable software cursor only when resizing/dragging something).");
|
||||
ImGui::Checkbox("io.ConfigMacOSXBehaviors", &io.ConfigMacOSXBehaviors);
|
||||
ImGui::Text("Also see Style->Rendering for rendering options.");
|
||||
|
||||
ImGui::SeparatorText("Debug");
|
||||
ImGui::BeginDisabled();
|
||||
ImGui::Checkbox("io.ConfigDebugBeginReturnValueOnce", &io.ConfigDebugBeginReturnValueOnce); // .
|
||||
ImGui::EndDisabled();
|
||||
ImGui::SameLine(); HelpMarker("First calls to Begin()/BeginChild() will return false.\n\nTHIS OPTION IS DISABLED because it needs to be set at application boot-time to make sense. Showing the disabled option is a way to make this feature easier to discover");
|
||||
ImGui::Checkbox("io.ConfigDebugBeginReturnValueLoop", &io.ConfigDebugBeginReturnValueLoop);
|
||||
ImGui::SameLine(); HelpMarker("Some calls to Begin()/BeginChild() will return false.\n\nWill cycle through window depths then repeat. Windows should be flickering while running.");
|
||||
|
||||
ImGui::TreePop();
|
||||
ImGui::Separator();
|
||||
ImGui::Spacing();
|
||||
}
|
||||
|
||||
IMGUI_DEMO_MARKER("Configuration/Backend Flags");
|
||||
@ -471,15 +483,15 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
||||
"Those flags are set by the backends (imgui_impl_xxx files) to specify their capabilities.\n"
|
||||
"Here we expose them as read-only fields to avoid breaking interactions with your backend.");
|
||||
|
||||
// Make a local copy to avoid modifying actual backend flags.
|
||||
// FIXME: We don't use BeginDisabled() to keep label bright, maybe we need a BeginReadonly() equivalent..
|
||||
ImGuiBackendFlags backend_flags = io.BackendFlags;
|
||||
ImGui::CheckboxFlags("io.BackendFlags: HasGamepad", &backend_flags, ImGuiBackendFlags_HasGamepad);
|
||||
ImGui::CheckboxFlags("io.BackendFlags: HasMouseCursors", &backend_flags, ImGuiBackendFlags_HasMouseCursors);
|
||||
ImGui::CheckboxFlags("io.BackendFlags: HasSetMousePos", &backend_flags, ImGuiBackendFlags_HasSetMousePos);
|
||||
ImGui::CheckboxFlags("io.BackendFlags: RendererHasVtxOffset", &backend_flags, ImGuiBackendFlags_RendererHasVtxOffset);
|
||||
// FIXME: Maybe we need a BeginReadonly() equivalent to keep label bright?
|
||||
ImGui::BeginDisabled();
|
||||
ImGui::CheckboxFlags("io.BackendFlags: HasGamepad", &io.BackendFlags, ImGuiBackendFlags_HasGamepad);
|
||||
ImGui::CheckboxFlags("io.BackendFlags: HasMouseCursors", &io.BackendFlags, ImGuiBackendFlags_HasMouseCursors);
|
||||
ImGui::CheckboxFlags("io.BackendFlags: HasSetMousePos", &io.BackendFlags, ImGuiBackendFlags_HasSetMousePos);
|
||||
ImGui::CheckboxFlags("io.BackendFlags: RendererHasVtxOffset", &io.BackendFlags, ImGuiBackendFlags_RendererHasVtxOffset);
|
||||
ImGui::EndDisabled();
|
||||
ImGui::TreePop();
|
||||
ImGui::Separator();
|
||||
ImGui::Spacing();
|
||||
}
|
||||
|
||||
IMGUI_DEMO_MARKER("Configuration/Style");
|
||||
@ -488,7 +500,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
||||
HelpMarker("The same contents can be accessed in 'Tools->Style Editor' or by calling the ShowStyleEditor() function.");
|
||||
ImGui::ShowStyleEditor();
|
||||
ImGui::TreePop();
|
||||
ImGui::Separator();
|
||||
ImGui::Spacing();
|
||||
}
|
||||
|
||||
IMGUI_DEMO_MARKER("Configuration/Capture, Logging");
|
||||
@ -556,6 +568,8 @@ static void ShowDemoWindowWidgets()
|
||||
IMGUI_DEMO_MARKER("Widgets/Basic");
|
||||
if (ImGui::TreeNode("Basic"))
|
||||
{
|
||||
ImGui::SeparatorText("General");
|
||||
|
||||
IMGUI_DEMO_MARKER("Widgets/Basic/Button");
|
||||
static int clicked = 0;
|
||||
if (ImGui::Button("Button"))
|
||||
@ -610,19 +624,41 @@ static void ShowDemoWindowWidgets()
|
||||
ImGui::SameLine();
|
||||
ImGui::Text("%d", counter);
|
||||
|
||||
ImGui::Separator();
|
||||
{
|
||||
// Tooltips
|
||||
IMGUI_DEMO_MARKER("Widgets/Basic/Tooltips");
|
||||
//ImGui::AlignTextToFramePadding();
|
||||
ImGui::Text("Tooltips:");
|
||||
|
||||
ImGui::SameLine();
|
||||
ImGui::SmallButton("Button");
|
||||
if (ImGui::IsItemHovered())
|
||||
ImGui::SetTooltip("I am a tooltip");
|
||||
|
||||
ImGui::SameLine();
|
||||
ImGui::SmallButton("Fancy");
|
||||
if (ImGui::IsItemHovered() && ImGui::BeginTooltip())
|
||||
{
|
||||
ImGui::Text("I am a fancy tooltip");
|
||||
static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
|
||||
ImGui::PlotLines("Curve", arr, IM_ARRAYSIZE(arr));
|
||||
ImGui::Text("Sin(time) = %f", sinf((float)ImGui::GetTime()));
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
ImGui::SmallButton("Delayed");
|
||||
if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNormal)) // With a delay
|
||||
ImGui::SetTooltip("I am a tooltip with a delay.");
|
||||
|
||||
ImGui::SameLine();
|
||||
HelpMarker(
|
||||
"Tooltip are created by using the IsItemHovered() function over any kind of item.");
|
||||
}
|
||||
|
||||
ImGui::LabelText("label", "Value");
|
||||
|
||||
{
|
||||
// Using the _simplified_ one-liner Combo() api here
|
||||
// See "Combo" section for examples of how to use the more flexible BeginCombo()/EndCombo() api.
|
||||
IMGUI_DEMO_MARKER("Widgets/Basic/Combo");
|
||||
const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIIIIII", "JJJJ", "KKKKKKK" };
|
||||
static int item_current = 0;
|
||||
ImGui::Combo("combo", &item_current, items, IM_ARRAYSIZE(items));
|
||||
ImGui::SameLine(); HelpMarker(
|
||||
"Using the simplified one-liner Combo API here.\nRefer to the \"Combo\" section below for an explanation of how to use the more flexible and general BeginCombo/EndCombo API.");
|
||||
}
|
||||
ImGui::SeparatorText("Inputs");
|
||||
|
||||
{
|
||||
// To wire InputText() with std::string or any other custom string type,
|
||||
@ -666,6 +702,8 @@ static void ShowDemoWindowWidgets()
|
||||
ImGui::InputFloat3("input float3", vec4a);
|
||||
}
|
||||
|
||||
ImGui::SeparatorText("Drags");
|
||||
|
||||
{
|
||||
IMGUI_DEMO_MARKER("Widgets/Basic/DragInt, DragFloat");
|
||||
static int i1 = 50, i2 = 42;
|
||||
@ -682,6 +720,8 @@ static void ShowDemoWindowWidgets()
|
||||
ImGui::DragFloat("drag small float", &f2, 0.0001f, 0.0f, 0.0f, "%.06f ns");
|
||||
}
|
||||
|
||||
ImGui::SeparatorText("Sliders");
|
||||
|
||||
{
|
||||
IMGUI_DEMO_MARKER("Widgets/Basic/SliderInt, SliderFloat");
|
||||
static int i1 = 0;
|
||||
@ -708,6 +748,8 @@ static void ShowDemoWindowWidgets()
|
||||
ImGui::SameLine(); HelpMarker("Using the format string parameter to display a name instead of the underlying integer.");
|
||||
}
|
||||
|
||||
ImGui::SeparatorText("Selectors/Pickers");
|
||||
|
||||
{
|
||||
IMGUI_DEMO_MARKER("Widgets/Basic/ColorEdit3, ColorEdit4");
|
||||
static float col1[3] = { 1.0f, 0.0f, 0.2f };
|
||||
@ -722,6 +764,17 @@ static void ShowDemoWindowWidgets()
|
||||
ImGui::ColorEdit4("color 2", col2);
|
||||
}
|
||||
|
||||
{
|
||||
// Using the _simplified_ one-liner Combo() api here
|
||||
// See "Combo" section for examples of how to use the more flexible BeginCombo()/EndCombo() api.
|
||||
IMGUI_DEMO_MARKER("Widgets/Basic/Combo");
|
||||
const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIIIIII", "JJJJ", "KKKKKKK" };
|
||||
static int item_current = 0;
|
||||
ImGui::Combo("combo", &item_current, items, IM_ARRAYSIZE(items));
|
||||
ImGui::SameLine(); HelpMarker(
|
||||
"Using the simplified one-liner Combo API here.\nRefer to the \"Combo\" section below for an explanation of how to use the more flexible and general BeginCombo/EndCombo API.");
|
||||
}
|
||||
|
||||
{
|
||||
// Using the _simplified_ one-liner ListBox() api here
|
||||
// See "List boxes" section for examples of how to use the more flexible BeginListBox()/EndListBox() api.
|
||||
@ -733,40 +786,6 @@ static void ShowDemoWindowWidgets()
|
||||
"Using the simplified one-liner ListBox API here.\nRefer to the \"List boxes\" section below for an explanation of how to use the more flexible and general BeginListBox/EndListBox API.");
|
||||
}
|
||||
|
||||
{
|
||||
// Tooltips
|
||||
IMGUI_DEMO_MARKER("Widgets/Basic/Tooltips");
|
||||
ImGui::AlignTextToFramePadding();
|
||||
ImGui::Text("Tooltips:");
|
||||
|
||||
ImGui::SameLine();
|
||||
ImGui::Button("Button");
|
||||
if (ImGui::IsItemHovered())
|
||||
ImGui::SetTooltip("I am a tooltip");
|
||||
|
||||
ImGui::SameLine();
|
||||
ImGui::Button("Fancy");
|
||||
if (ImGui::IsItemHovered())
|
||||
{
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::Text("I am a fancy tooltip");
|
||||
static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
|
||||
ImGui::PlotLines("Curve", arr, IM_ARRAYSIZE(arr));
|
||||
ImGui::Text("Sin(time) = %f", sinf((float)ImGui::GetTime()));
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
ImGui::Button("Delayed");
|
||||
if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNormal)) // Delay best used on items that highlight on hover, so this not a great example!
|
||||
ImGui::SetTooltip("I am a tooltip with a delay.");
|
||||
|
||||
ImGui::SameLine();
|
||||
HelpMarker(
|
||||
"Tooltip are created by using the IsItemHovered() function over any kind of item.");
|
||||
|
||||
}
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
@ -1026,16 +1045,17 @@ static void ShowDemoWindowWidgets()
|
||||
float my_tex_w = (float)io.Fonts->TexWidth;
|
||||
float my_tex_h = (float)io.Fonts->TexHeight;
|
||||
{
|
||||
static bool use_text_color_for_tint = false;
|
||||
ImGui::Checkbox("Use Text Color for Tint", &use_text_color_for_tint);
|
||||
ImGui::Text("%.0fx%.0f", my_tex_w, my_tex_h);
|
||||
ImVec2 pos = ImGui::GetCursorScreenPos();
|
||||
ImVec2 uv_min = ImVec2(0.0f, 0.0f); // Top-left
|
||||
ImVec2 uv_max = ImVec2(1.0f, 1.0f); // Lower-right
|
||||
ImVec4 tint_col = ImVec4(1.0f, 1.0f, 1.0f, 1.0f); // No tint
|
||||
ImVec4 border_col = ImVec4(1.0f, 1.0f, 1.0f, 0.5f); // 50% opaque white
|
||||
ImVec4 tint_col = use_text_color_for_tint ? ImGui::GetStyleColorVec4(ImGuiCol_Text) : ImVec4(1.0f, 1.0f, 1.0f, 1.0f); // No tint
|
||||
ImVec4 border_col = ImGui::GetStyleColorVec4(ImGuiCol_Border);
|
||||
ImGui::Image(my_tex_id, ImVec2(my_tex_w, my_tex_h), uv_min, uv_max, tint_col, border_col);
|
||||
if (ImGui::IsItemHovered())
|
||||
if (ImGui::IsItemHovered() && ImGui::BeginTooltip())
|
||||
{
|
||||
ImGui::BeginTooltip();
|
||||
float region_sz = 32.0f;
|
||||
float region_x = io.MousePos.x - pos.x - region_sz * 0.5f;
|
||||
float region_y = io.MousePos.y - pos.y - region_sz * 0.5f;
|
||||
@ -1689,7 +1709,7 @@ static void ShowDemoWindowWidgets()
|
||||
}
|
||||
|
||||
// Use functions to generate output
|
||||
// FIXME: This is rather awkward because current plot API only pass in indices.
|
||||
// FIXME: This is actually VERY awkward because current plot API only pass in indices.
|
||||
// We probably want an API passing floats and user provide sample rate/count.
|
||||
struct Funcs
|
||||
{
|
||||
@ -1697,7 +1717,7 @@ static void ShowDemoWindowWidgets()
|
||||
static float Saw(void*, int i) { return (i & 1) ? 1.0f : -1.0f; }
|
||||
};
|
||||
static int func_type = 0, display_count = 70;
|
||||
ImGui::Separator();
|
||||
ImGui::SeparatorText("Functions");
|
||||
ImGui::SetNextItemWidth(ImGui::GetFontSize() * 8);
|
||||
ImGui::Combo("func", &func_type, "Sin\0Saw\0");
|
||||
ImGui::SameLine();
|
||||
@ -1740,6 +1760,7 @@ static void ShowDemoWindowWidgets()
|
||||
static bool drag_and_drop = true;
|
||||
static bool options_menu = true;
|
||||
static bool hdr = false;
|
||||
ImGui::SeparatorText("Options");
|
||||
ImGui::Checkbox("With Alpha Preview", &alpha_preview);
|
||||
ImGui::Checkbox("With Half Alpha Preview", &alpha_half_preview);
|
||||
ImGui::Checkbox("With Drag and Drop", &drag_and_drop);
|
||||
@ -1748,6 +1769,7 @@ static void ShowDemoWindowWidgets()
|
||||
ImGuiColorEditFlags misc_flags = (hdr ? ImGuiColorEditFlags_HDR : 0) | (drag_and_drop ? 0 : ImGuiColorEditFlags_NoDragDrop) | (alpha_half_preview ? ImGuiColorEditFlags_AlphaPreviewHalf : (alpha_preview ? ImGuiColorEditFlags_AlphaPreview : 0)) | (options_menu ? 0 : ImGuiColorEditFlags_NoOptions);
|
||||
|
||||
IMGUI_DEMO_MARKER("Widgets/Color/ColorEdit");
|
||||
ImGui::SeparatorText("Inline color editor");
|
||||
ImGui::Text("Color widget:");
|
||||
ImGui::SameLine(); HelpMarker(
|
||||
"Click on the color square to open a color picker.\n"
|
||||
@ -1845,7 +1867,7 @@ static void ShowDemoWindowWidgets()
|
||||
ImGui::ColorButton("MyColor##3c", *(ImVec4*)&color, misc_flags | (no_border ? ImGuiColorEditFlags_NoBorder : 0), ImVec2(80, 80));
|
||||
|
||||
IMGUI_DEMO_MARKER("Widgets/Color/ColorPicker");
|
||||
ImGui::Text("Color picker:");
|
||||
ImGui::SeparatorText("Color picker");
|
||||
static bool alpha = true;
|
||||
static bool alpha_bar = true;
|
||||
static bool side_preview = true;
|
||||
@ -2016,7 +2038,7 @@ static void ShowDemoWindowWidgets()
|
||||
const float drag_speed = 0.2f;
|
||||
static bool drag_clamp = false;
|
||||
IMGUI_DEMO_MARKER("Widgets/Data Types/Drags");
|
||||
ImGui::Text("Drags:");
|
||||
ImGui::SeparatorText("Drags");
|
||||
ImGui::Checkbox("Clamp integers to 0..50", &drag_clamp);
|
||||
ImGui::SameLine(); HelpMarker(
|
||||
"As with every widget in dear imgui, we never modify values unless there is a user interaction.\n"
|
||||
@ -2036,7 +2058,7 @@ static void ShowDemoWindowWidgets()
|
||||
ImGui::DragScalar("drag double log",ImGuiDataType_Double, &f64_v, 0.0005f, &f64_zero, &f64_one, "0 < %.10f < 1", ImGuiSliderFlags_Logarithmic);
|
||||
|
||||
IMGUI_DEMO_MARKER("Widgets/Data Types/Sliders");
|
||||
ImGui::Text("Sliders");
|
||||
ImGui::SeparatorText("Sliders");
|
||||
ImGui::SliderScalar("slider s8 full", ImGuiDataType_S8, &s8_v, &s8_min, &s8_max, "%d");
|
||||
ImGui::SliderScalar("slider u8 full", ImGuiDataType_U8, &u8_v, &u8_min, &u8_max, "%u");
|
||||
ImGui::SliderScalar("slider s16 full", ImGuiDataType_S16, &s16_v, &s16_min, &s16_max, "%d");
|
||||
@ -2061,7 +2083,7 @@ static void ShowDemoWindowWidgets()
|
||||
ImGui::SliderScalar("slider double low log",ImGuiDataType_Double, &f64_v, &f64_zero, &f64_one, "%.10f", ImGuiSliderFlags_Logarithmic);
|
||||
ImGui::SliderScalar("slider double high", ImGuiDataType_Double, &f64_v, &f64_lo_a, &f64_hi_a, "%e grams");
|
||||
|
||||
ImGui::Text("Sliders (reverse)");
|
||||
ImGui::SeparatorText("Sliders (reverse)");
|
||||
ImGui::SliderScalar("slider s8 reverse", ImGuiDataType_S8, &s8_v, &s8_max, &s8_min, "%d");
|
||||
ImGui::SliderScalar("slider u8 reverse", ImGuiDataType_U8, &u8_v, &u8_max, &u8_min, "%u");
|
||||
ImGui::SliderScalar("slider s32 reverse", ImGuiDataType_S32, &s32_v, &s32_fifty, &s32_zero, "%d");
|
||||
@ -2071,7 +2093,7 @@ static void ShowDemoWindowWidgets()
|
||||
|
||||
IMGUI_DEMO_MARKER("Widgets/Data Types/Inputs");
|
||||
static bool inputs_step = true;
|
||||
ImGui::Text("Inputs");
|
||||
ImGui::SeparatorText("Inputs");
|
||||
ImGui::Checkbox("Show step buttons", &inputs_step);
|
||||
ImGui::InputScalar("input s8", ImGuiDataType_S8, &s8_v, inputs_step ? &s8_one : NULL, NULL, "%d");
|
||||
ImGui::InputScalar("input u8", ImGuiDataType_U8, &u8_v, inputs_step ? &u8_one : NULL, NULL, "%u");
|
||||
@ -2095,22 +2117,23 @@ static void ShowDemoWindowWidgets()
|
||||
static float vec4f[4] = { 0.10f, 0.20f, 0.30f, 0.44f };
|
||||
static int vec4i[4] = { 1, 5, 100, 255 };
|
||||
|
||||
ImGui::SeparatorText("2-wide");
|
||||
ImGui::InputFloat2("input float2", vec4f);
|
||||
ImGui::DragFloat2("drag float2", vec4f, 0.01f, 0.0f, 1.0f);
|
||||
ImGui::SliderFloat2("slider float2", vec4f, 0.0f, 1.0f);
|
||||
ImGui::InputInt2("input int2", vec4i);
|
||||
ImGui::DragInt2("drag int2", vec4i, 1, 0, 255);
|
||||
ImGui::SliderInt2("slider int2", vec4i, 0, 255);
|
||||
ImGui::Spacing();
|
||||
|
||||
ImGui::SeparatorText("3-wide");
|
||||
ImGui::InputFloat3("input float3", vec4f);
|
||||
ImGui::DragFloat3("drag float3", vec4f, 0.01f, 0.0f, 1.0f);
|
||||
ImGui::SliderFloat3("slider float3", vec4f, 0.0f, 1.0f);
|
||||
ImGui::InputInt3("input int3", vec4i);
|
||||
ImGui::DragInt3("drag int3", vec4i, 1, 0, 255);
|
||||
ImGui::SliderInt3("slider int3", vec4i, 0, 255);
|
||||
ImGui::Spacing();
|
||||
|
||||
ImGui::SeparatorText("4-wide");
|
||||
ImGui::InputFloat4("input float4", vec4f);
|
||||
ImGui::DragFloat4("drag float4", vec4f, 0.01f, 0.0f, 1.0f);
|
||||
ImGui::SliderFloat4("slider float4", vec4f, 0.0f, 1.0f);
|
||||
@ -2527,6 +2550,8 @@ static void ShowDemoWindowLayout()
|
||||
IMGUI_DEMO_MARKER("Layout/Child windows");
|
||||
if (ImGui::TreeNode("Child windows"))
|
||||
{
|
||||
ImGui::SeparatorText("Child windows");
|
||||
|
||||
HelpMarker("Use child windows to begin into a self-contained independent scrolling/clipping regions within a host window.");
|
||||
static bool disable_mouse_wheel = false;
|
||||
static bool disable_menu = false;
|
||||
@ -2579,7 +2604,7 @@ static void ShowDemoWindowLayout()
|
||||
ImGui::PopStyleVar();
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
ImGui::SeparatorText("Misc/Advanced");
|
||||
|
||||
// Demonstrate a few extra things
|
||||
// - Changing ImGuiCol_ChildBg (which is transparent black in default styles)
|
||||
@ -3343,8 +3368,7 @@ static void ShowDemoWindowPopups()
|
||||
ImGui::TextUnformatted(selected_fish == -1 ? "<None>" : names[selected_fish]);
|
||||
if (ImGui::BeginPopup("my_select_popup"))
|
||||
{
|
||||
ImGui::Text("Aquarium");
|
||||
ImGui::Separator();
|
||||
ImGui::SeparatorText("Aquarium");
|
||||
for (int i = 0; i < IM_ARRAYSIZE(names); i++)
|
||||
if (ImGui::Selectable(names[i]))
|
||||
selected_fish = i;
|
||||
@ -3438,11 +3462,14 @@ static void ShowDemoWindowPopups()
|
||||
// and BeginPopupContextItem() will use the last item ID as the popup ID.
|
||||
{
|
||||
const char* names[5] = { "Label1", "Label2", "Label3", "Label4", "Label5" };
|
||||
static int selected = -1;
|
||||
for (int n = 0; n < 5; n++)
|
||||
{
|
||||
ImGui::Selectable(names[n]);
|
||||
if (ImGui::Selectable(names[n], selected == n))
|
||||
selected = n;
|
||||
if (ImGui::BeginPopupContextItem()) // <-- use last item id as popup id
|
||||
{
|
||||
selected = n;
|
||||
ImGui::Text("This a popup for \"%s\"!", names[n]);
|
||||
if (ImGui::Button("Close"))
|
||||
ImGui::CloseCurrentPopup();
|
||||
@ -3518,7 +3545,7 @@ static void ShowDemoWindowPopups()
|
||||
|
||||
if (ImGui::BeginPopupModal("Delete?", NULL, ImGuiWindowFlags_AlwaysAutoResize))
|
||||
{
|
||||
ImGui::Text("All those beautiful files will be deleted.\nThis operation cannot be undone!\n\n");
|
||||
ImGui::Text("All those beautiful files will be deleted.\nThis operation cannot be undone!");
|
||||
ImGui::Separator();
|
||||
|
||||
//static int unused_i = 0;
|
||||
@ -3701,9 +3728,8 @@ static void EditTableSizingFlags(ImGuiTableFlags* p_flags)
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::TextDisabled("(?)");
|
||||
if (ImGui::IsItemHovered())
|
||||
if (ImGui::IsItemHovered() && ImGui::BeginTooltip())
|
||||
{
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 50.0f);
|
||||
for (int m = 0; m < IM_ARRAYSIZE(policies); m++)
|
||||
{
|
||||
@ -5043,18 +5069,23 @@ static void ShowDemoWindowTables()
|
||||
if (ImGui::TreeNode("Synced instances"))
|
||||
{
|
||||
HelpMarker("Multiple tables with the same identifier will share their settings, width, visibility, order etc.");
|
||||
|
||||
static ImGuiTableFlags flags = ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable | ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_NoSavedSettings;
|
||||
ImGui::CheckboxFlags("ImGuiTableFlags_ScrollY", &flags, ImGuiTableFlags_ScrollY);
|
||||
ImGui::CheckboxFlags("ImGuiTableFlags_SizingFixedFit", &flags, ImGuiTableFlags_SizingFixedFit);
|
||||
for (int n = 0; n < 3; n++)
|
||||
{
|
||||
char buf[32];
|
||||
sprintf(buf, "Synced Table %d", n);
|
||||
bool open = ImGui::CollapsingHeader(buf, ImGuiTreeNodeFlags_DefaultOpen);
|
||||
if (open && ImGui::BeginTable("Table", 3, ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable | ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_NoSavedSettings))
|
||||
if (open && ImGui::BeginTable("Table", 3, flags, ImVec2(0.0f, ImGui::GetTextLineHeightWithSpacing() * 5)))
|
||||
{
|
||||
ImGui::TableSetupColumn("One");
|
||||
ImGui::TableSetupColumn("Two");
|
||||
ImGui::TableSetupColumn("Three");
|
||||
ImGui::TableHeadersRow();
|
||||
for (int cell = 0; cell < 9; cell++)
|
||||
const int cell_count = (n == 1) ? 27 : 9; // Make second table have a scrollbar to verify that additional decoration is not affecting column positions.
|
||||
for (int cell = 0; cell < cell_count; cell++)
|
||||
{
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("this cell %d", cell);
|
||||
@ -5682,50 +5713,93 @@ static void ShowDemoWindowColumns()
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
namespace ImGui { extern ImGuiKeyData* GetKeyData(ImGuiKey key); }
|
||||
|
||||
static void ShowDemoWindowInputs()
|
||||
{
|
||||
IMGUI_DEMO_MARKER("Inputs, Navigation & Focus");
|
||||
if (ImGui::CollapsingHeader("Inputs, Navigation & Focus"))
|
||||
IMGUI_DEMO_MARKER("Inputs & Focus");
|
||||
if (ImGui::CollapsingHeader("Inputs & Focus"))
|
||||
{
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
|
||||
// Display ImGuiIO output flags
|
||||
IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Output");
|
||||
// Display inputs submitted to ImGuiIO
|
||||
IMGUI_DEMO_MARKER("Inputs & Focus/Inputs");
|
||||
ImGui::SetNextItemOpen(true, ImGuiCond_Once);
|
||||
if (ImGui::TreeNode("Output"))
|
||||
if (ImGui::TreeNode("Inputs"))
|
||||
{
|
||||
HelpMarker(
|
||||
"This is a simplified view. See more detailed input state:\n"
|
||||
"- in 'Tools->Metrics/Debugger->Inputs'.\n"
|
||||
"- in 'Tools->Debug Log->IO'.");
|
||||
if (ImGui::IsMousePosValid())
|
||||
ImGui::Text("Mouse pos: (%g, %g)", io.MousePos.x, io.MousePos.y);
|
||||
else
|
||||
ImGui::Text("Mouse pos: <INVALID>");
|
||||
ImGui::Text("Mouse delta: (%g, %g)", io.MouseDelta.x, io.MouseDelta.y);
|
||||
ImGui::Text("Mouse down:");
|
||||
for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (ImGui::IsMouseDown(i)) { ImGui::SameLine(); ImGui::Text("b%d (%.02f secs)", i, io.MouseDownDuration[i]); }
|
||||
ImGui::Text("Mouse wheel: %.1f", io.MouseWheel);
|
||||
|
||||
// We iterate both legacy native range and named ImGuiKey ranges, which is a little odd but this allows displaying the data for old/new backends.
|
||||
// User code should never have to go through such hoops! You can generally iterate between ImGuiKey_NamedKey_BEGIN and ImGuiKey_NamedKey_END.
|
||||
#ifdef IMGUI_DISABLE_OBSOLETE_KEYIO
|
||||
struct funcs { static bool IsLegacyNativeDupe(ImGuiKey) { return false; } };
|
||||
ImGuiKey start_key = ImGuiKey_NamedKey_BEGIN;
|
||||
#else
|
||||
struct funcs { static bool IsLegacyNativeDupe(ImGuiKey key) { return key < 512 && ImGui::GetIO().KeyMap[key] != -1; } }; // Hide Native<>ImGuiKey duplicates when both exists in the array
|
||||
ImGuiKey start_key = (ImGuiKey)0;
|
||||
#endif
|
||||
ImGui::Text("Keys down:"); for (ImGuiKey key = start_key; key < ImGuiKey_NamedKey_END; key = (ImGuiKey)(key + 1)) { if (funcs::IsLegacyNativeDupe(key) || !ImGui::IsKeyDown(key)) continue; ImGui::SameLine(); ImGui::Text((key < ImGuiKey_NamedKey_BEGIN) ? "\"%s\"" : "\"%s\" %d", ImGui::GetKeyName(key), key); }
|
||||
ImGui::Text("Keys mods: %s%s%s%s", io.KeyCtrl ? "CTRL " : "", io.KeyShift ? "SHIFT " : "", io.KeyAlt ? "ALT " : "", io.KeySuper ? "SUPER " : "");
|
||||
ImGui::Text("Chars queue:"); for (int i = 0; i < io.InputQueueCharacters.Size; i++) { ImWchar c = io.InputQueueCharacters[i]; ImGui::SameLine(); ImGui::Text("\'%c\' (0x%04X)", (c > ' ' && c <= 255) ? (char)c : '?', c); } // FIXME: We should convert 'c' to UTF-8 here but the functions are not public.
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
// Display ImGuiIO output flags
|
||||
IMGUI_DEMO_MARKER("Inputs & Focus/Outputs");
|
||||
ImGui::SetNextItemOpen(true, ImGuiCond_Once);
|
||||
if (ImGui::TreeNode("Outputs"))
|
||||
{
|
||||
HelpMarker(
|
||||
"The value of io.WantCaptureMouse and io.WantCaptureKeyboard are normally set by Dear ImGui "
|
||||
"to instruct your application of how to route inputs. Typically, when a value is true, it means "
|
||||
"Dear ImGui wants the corresponding inputs and we expect the underlying application to ignore them.\n\n"
|
||||
"The most typical case is: when hovering a window, Dear ImGui set io.WantCaptureMouse to true, "
|
||||
"and underlying application should ignore mouse inputs (in practice there are many and more subtle "
|
||||
"rules leading to how those flags are set).");
|
||||
ImGui::Text("io.WantCaptureMouse: %d", io.WantCaptureMouse);
|
||||
ImGui::Text("io.WantCaptureMouseUnlessPopupClose: %d", io.WantCaptureMouseUnlessPopupClose);
|
||||
ImGui::Text("io.WantCaptureKeyboard: %d", io.WantCaptureKeyboard);
|
||||
ImGui::Text("io.WantTextInput: %d", io.WantTextInput);
|
||||
ImGui::Text("io.WantSetMousePos: %d", io.WantSetMousePos);
|
||||
ImGui::Text("io.NavActive: %d, io.NavVisible: %d", io.NavActive, io.NavVisible);
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
// Display Mouse state
|
||||
IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Mouse State");
|
||||
if (ImGui::TreeNode("Mouse State"))
|
||||
{
|
||||
if (ImGui::IsMousePosValid())
|
||||
ImGui::Text("Mouse pos: (%g, %g)", io.MousePos.x, io.MousePos.y);
|
||||
else
|
||||
ImGui::Text("Mouse pos: <INVALID>");
|
||||
ImGui::Text("Mouse delta: (%g, %g)", io.MouseDelta.x, io.MouseDelta.y);
|
||||
IMGUI_DEMO_MARKER("Inputs & Focus/Outputs/WantCapture override");
|
||||
if (ImGui::TreeNode("WantCapture override"))
|
||||
{
|
||||
HelpMarker(
|
||||
"Hovering the colored canvas will override io.WantCaptureXXX fields.\n"
|
||||
"Notice how normally (when set to none), the value of io.WantCaptureKeyboard would be false when hovering and true when clicking.");
|
||||
static int capture_override_mouse = -1;
|
||||
static int capture_override_keyboard = -1;
|
||||
const char* capture_override_desc[] = { "None", "Set to false", "Set to true" };
|
||||
ImGui::SetNextItemWidth(ImGui::GetFontSize() * 15);
|
||||
ImGui::SliderInt("SetNextFrameWantCaptureMouse() on hover", &capture_override_mouse, -1, +1, capture_override_desc[capture_override_mouse + 1], ImGuiSliderFlags_AlwaysClamp);
|
||||
ImGui::SetNextItemWidth(ImGui::GetFontSize() * 15);
|
||||
ImGui::SliderInt("SetNextFrameWantCaptureKeyboard() on hover", &capture_override_keyboard, -1, +1, capture_override_desc[capture_override_keyboard + 1], ImGuiSliderFlags_AlwaysClamp);
|
||||
|
||||
int count = IM_ARRAYSIZE(io.MouseDown);
|
||||
ImGui::Text("Mouse down:"); for (int i = 0; i < count; i++) if (ImGui::IsMouseDown(i)) { ImGui::SameLine(); ImGui::Text("b%d (%.02f secs)", i, io.MouseDownDuration[i]); }
|
||||
ImGui::Text("Mouse clicked:"); for (int i = 0; i < count; i++) if (ImGui::IsMouseClicked(i)) { ImGui::SameLine(); ImGui::Text("b%d (%d)", i, ImGui::GetMouseClickedCount(i)); }
|
||||
ImGui::Text("Mouse released:"); for (int i = 0; i < count; i++) if (ImGui::IsMouseReleased(i)) { ImGui::SameLine(); ImGui::Text("b%d", i); }
|
||||
ImGui::Text("Mouse wheel: %.1f", io.MouseWheel);
|
||||
ImGui::Text("Pen Pressure: %.1f", io.PenPressure); // Note: currently unused
|
||||
ImGui::ColorButton("##panel", ImVec4(0.7f, 0.1f, 0.7f, 1.0f), ImGuiColorEditFlags_NoTooltip | ImGuiColorEditFlags_NoDragDrop, ImVec2(128.0f, 96.0f)); // Dummy item
|
||||
if (ImGui::IsItemHovered() && capture_override_mouse != -1)
|
||||
ImGui::SetNextFrameWantCaptureMouse(capture_override_mouse == 1);
|
||||
if (ImGui::IsItemHovered() && capture_override_keyboard != -1)
|
||||
ImGui::SetNextFrameWantCaptureKeyboard(capture_override_keyboard == 1);
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
// Display mouse cursors
|
||||
IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Mouse Cursors");
|
||||
IMGUI_DEMO_MARKER("Inputs & Focus/Mouse Cursors");
|
||||
if (ImGui::TreeNode("Mouse Cursors"))
|
||||
{
|
||||
const char* mouse_cursors_names[] = { "Arrow", "TextInput", "ResizeAll", "ResizeNS", "ResizeEW", "ResizeNESW", "ResizeNWSE", "Hand", "NotAllowed" };
|
||||
@ -5753,113 +5827,7 @@ static void ShowDemoWindowInputs()
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
// Display Keyboard/Mouse state
|
||||
IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Keyboard, Gamepad & Navigation State");
|
||||
if (ImGui::TreeNode("Keyboard, Gamepad & Navigation State"))
|
||||
{
|
||||
// We iterate both legacy native range and named ImGuiKey ranges, which is a little odd but this allows displaying the data for old/new backends.
|
||||
// User code should never have to go through such hoops: old code may use native keycodes, new code may use ImGuiKey codes.
|
||||
#ifdef IMGUI_DISABLE_OBSOLETE_KEYIO
|
||||
struct funcs { static bool IsLegacyNativeDupe(ImGuiKey) { return false; } };
|
||||
const ImGuiKey key_first = (ImGuiKey)ImGuiKey_NamedKey_BEGIN;
|
||||
#else
|
||||
struct funcs { static bool IsLegacyNativeDupe(ImGuiKey key) { return key < 512 && ImGui::GetIO().KeyMap[key] != -1; } }; // Hide Native<>ImGuiKey duplicates when both exists in the array
|
||||
const ImGuiKey key_first = (ImGuiKey)0;
|
||||
//ImGui::Text("Legacy raw:"); for (ImGuiKey key = key_first; key < ImGuiKey_COUNT; key++) { if (io.KeysDown[key]) { ImGui::SameLine(); ImGui::Text("\"%s\" %d", ImGui::GetKeyName(key), key); } }
|
||||
#endif
|
||||
ImGui::Text("Keys down:"); for (ImGuiKey key = key_first; key < ImGuiKey_COUNT; key = (ImGuiKey)(key + 1)) { if (funcs::IsLegacyNativeDupe(key)) continue; if (ImGui::IsKeyDown(key)) { ImGui::SameLine(); ImGui::Text("\"%s\" %d (%.02f)", ImGui::GetKeyName(key), key, ImGui::GetKeyData(key)->DownDuration); } }
|
||||
ImGui::Text("Keys pressed:"); for (ImGuiKey key = key_first; key < ImGuiKey_COUNT; key = (ImGuiKey)(key + 1)) { if (funcs::IsLegacyNativeDupe(key)) continue; if (ImGui::IsKeyPressed(key)) { ImGui::SameLine(); ImGui::Text("\"%s\" %d", ImGui::GetKeyName(key), key); } }
|
||||
ImGui::Text("Keys released:"); for (ImGuiKey key = key_first; key < ImGuiKey_COUNT; key = (ImGuiKey)(key + 1)) { if (funcs::IsLegacyNativeDupe(key)) continue; if (ImGui::IsKeyReleased(key)) { ImGui::SameLine(); ImGui::Text("\"%s\" %d", ImGui::GetKeyName(key), key); } }
|
||||
ImGui::Text("Keys mods: %s%s%s%s", io.KeyCtrl ? "CTRL " : "", io.KeyShift ? "SHIFT " : "", io.KeyAlt ? "ALT " : "", io.KeySuper ? "SUPER " : "");
|
||||
ImGui::Text("Chars queue:"); for (int i = 0; i < io.InputQueueCharacters.Size; i++) { ImWchar c = io.InputQueueCharacters[i]; ImGui::SameLine(); ImGui::Text("\'%c\' (0x%04X)", (c > ' ' && c <= 255) ? (char)c : '?', c); } // FIXME: We should convert 'c' to UTF-8 here but the functions are not public.
|
||||
|
||||
// Draw an arbitrary US keyboard layout to visualize translated keys
|
||||
{
|
||||
const ImVec2 key_size = ImVec2(35.0f, 35.0f);
|
||||
const float key_rounding = 3.0f;
|
||||
const ImVec2 key_face_size = ImVec2(25.0f, 25.0f);
|
||||
const ImVec2 key_face_pos = ImVec2(5.0f, 3.0f);
|
||||
const float key_face_rounding = 2.0f;
|
||||
const ImVec2 key_label_pos = ImVec2(7.0f, 4.0f);
|
||||
const ImVec2 key_step = ImVec2(key_size.x - 1.0f, key_size.y - 1.0f);
|
||||
const float key_row_offset = 9.0f;
|
||||
|
||||
ImVec2 board_min = ImGui::GetCursorScreenPos();
|
||||
ImVec2 board_max = ImVec2(board_min.x + 3 * key_step.x + 2 * key_row_offset + 10.0f, board_min.y + 3 * key_step.y + 10.0f);
|
||||
ImVec2 start_pos = ImVec2(board_min.x + 5.0f - key_step.x, board_min.y);
|
||||
|
||||
struct KeyLayoutData { int Row, Col; const char* Label; ImGuiKey Key; };
|
||||
const KeyLayoutData keys_to_display[] =
|
||||
{
|
||||
{ 0, 0, "", ImGuiKey_Tab }, { 0, 1, "Q", ImGuiKey_Q }, { 0, 2, "W", ImGuiKey_W }, { 0, 3, "E", ImGuiKey_E }, { 0, 4, "R", ImGuiKey_R },
|
||||
{ 1, 0, "", ImGuiKey_CapsLock }, { 1, 1, "A", ImGuiKey_A }, { 1, 2, "S", ImGuiKey_S }, { 1, 3, "D", ImGuiKey_D }, { 1, 4, "F", ImGuiKey_F },
|
||||
{ 2, 0, "", ImGuiKey_LeftShift },{ 2, 1, "Z", ImGuiKey_Z }, { 2, 2, "X", ImGuiKey_X }, { 2, 3, "C", ImGuiKey_C }, { 2, 4, "V", ImGuiKey_V }
|
||||
};
|
||||
|
||||
// Elements rendered manually via ImDrawList API are not clipped automatically.
|
||||
// While not strictly necessary, here IsItemVisible() is used to avoid rendering these shapes when they are out of view.
|
||||
ImGui::Dummy(ImVec2(board_max.x - board_min.x, board_max.y - board_min.y));
|
||||
if (ImGui::IsItemVisible())
|
||||
{
|
||||
ImDrawList* draw_list = ImGui::GetWindowDrawList();
|
||||
draw_list->PushClipRect(board_min, board_max, true);
|
||||
for (int n = 0; n < IM_ARRAYSIZE(keys_to_display); n++)
|
||||
{
|
||||
const KeyLayoutData* key_data = &keys_to_display[n];
|
||||
ImVec2 key_min = ImVec2(start_pos.x + key_data->Col * key_step.x + key_data->Row * key_row_offset, start_pos.y + key_data->Row * key_step.y);
|
||||
ImVec2 key_max = ImVec2(key_min.x + key_size.x, key_min.y + key_size.y);
|
||||
draw_list->AddRectFilled(key_min, key_max, IM_COL32(204, 204, 204, 255), key_rounding);
|
||||
draw_list->AddRect(key_min, key_max, IM_COL32(24, 24, 24, 255), key_rounding);
|
||||
ImVec2 face_min = ImVec2(key_min.x + key_face_pos.x, key_min.y + key_face_pos.y);
|
||||
ImVec2 face_max = ImVec2(face_min.x + key_face_size.x, face_min.y + key_face_size.y);
|
||||
draw_list->AddRect(face_min, face_max, IM_COL32(193, 193, 193, 255), key_face_rounding, ImDrawFlags_None, 2.0f);
|
||||
draw_list->AddRectFilled(face_min, face_max, IM_COL32(252, 252, 252, 255), key_face_rounding);
|
||||
ImVec2 label_min = ImVec2(key_min.x + key_label_pos.x, key_min.y + key_label_pos.y);
|
||||
draw_list->AddText(label_min, IM_COL32(64, 64, 64, 255), key_data->Label);
|
||||
if (ImGui::IsKeyDown(key_data->Key))
|
||||
draw_list->AddRectFilled(key_min, key_max, IM_COL32(255, 0, 0, 128), key_rounding);
|
||||
}
|
||||
draw_list->PopClipRect();
|
||||
}
|
||||
}
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
if (ImGui::TreeNode("Capture override"))
|
||||
{
|
||||
HelpMarker(
|
||||
"The value of io.WantCaptureMouse and io.WantCaptureKeyboard are normally set by Dear ImGui "
|
||||
"to instruct your application of how to route inputs. Typically, when a value is true, it means "
|
||||
"Dear ImGui wants the corresponding inputs and we expect the underlying application to ignore them.\n\n"
|
||||
"The most typical case is: when hovering a window, Dear ImGui set io.WantCaptureMouse to true, "
|
||||
"and underlying application should ignore mouse inputs (in practice there are many and more subtle "
|
||||
"rules leading to how those flags are set).");
|
||||
|
||||
ImGui::Text("io.WantCaptureMouse: %d", io.WantCaptureMouse);
|
||||
ImGui::Text("io.WantCaptureMouseUnlessPopupClose: %d", io.WantCaptureMouseUnlessPopupClose);
|
||||
ImGui::Text("io.WantCaptureKeyboard: %d", io.WantCaptureKeyboard);
|
||||
|
||||
HelpMarker(
|
||||
"Hovering the colored canvas will override io.WantCaptureXXX fields.\n"
|
||||
"Notice how normally (when set to none), the value of io.WantCaptureKeyboard would be false when hovering and true when clicking.");
|
||||
static int capture_override_mouse = -1;
|
||||
static int capture_override_keyboard = -1;
|
||||
const char* capture_override_desc[] = { "None", "Set to false", "Set to true" };
|
||||
ImGui::SetNextItemWidth(ImGui::GetFontSize() * 15);
|
||||
ImGui::SliderInt("SetNextFrameWantCaptureMouse()", &capture_override_mouse, -1, +1, capture_override_desc[capture_override_mouse + 1], ImGuiSliderFlags_AlwaysClamp);
|
||||
ImGui::SetNextItemWidth(ImGui::GetFontSize() * 15);
|
||||
ImGui::SliderInt("SetNextFrameWantCaptureKeyboard()", &capture_override_keyboard, -1, +1, capture_override_desc[capture_override_keyboard + 1], ImGuiSliderFlags_AlwaysClamp);
|
||||
|
||||
ImGui::ColorButton("##panel", ImVec4(0.7f, 0.1f, 0.7f, 1.0f), ImGuiColorEditFlags_NoTooltip | ImGuiColorEditFlags_NoDragDrop, ImVec2(256.0f, 192.0f)); // Dummy item
|
||||
if (ImGui::IsItemHovered() && capture_override_mouse != -1)
|
||||
ImGui::SetNextFrameWantCaptureMouse(capture_override_mouse == 1);
|
||||
if (ImGui::IsItemHovered() && capture_override_keyboard != -1)
|
||||
ImGui::SetNextFrameWantCaptureKeyboard(capture_override_keyboard == 1);
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Tabbing");
|
||||
IMGUI_DEMO_MARKER("Inputs & Focus/Tabbing");
|
||||
if (ImGui::TreeNode("Tabbing"))
|
||||
{
|
||||
ImGui::Text("Use TAB/SHIFT+TAB to cycle through keyboard editable fields.");
|
||||
@ -5867,15 +5835,15 @@ static void ShowDemoWindowInputs()
|
||||
ImGui::InputText("1", buf, IM_ARRAYSIZE(buf));
|
||||
ImGui::InputText("2", buf, IM_ARRAYSIZE(buf));
|
||||
ImGui::InputText("3", buf, IM_ARRAYSIZE(buf));
|
||||
ImGui::PushAllowKeyboardFocus(false);
|
||||
ImGui::PushTabStop(false);
|
||||
ImGui::InputText("4 (tab skip)", buf, IM_ARRAYSIZE(buf));
|
||||
ImGui::SameLine(); HelpMarker("Item won't be cycled through when using TAB or Shift+Tab.");
|
||||
ImGui::PopAllowKeyboardFocus();
|
||||
ImGui::PopTabStop();
|
||||
ImGui::InputText("5", buf, IM_ARRAYSIZE(buf));
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Focus from code");
|
||||
IMGUI_DEMO_MARKER("Inputs & Focus/Focus from code");
|
||||
if (ImGui::TreeNode("Focus from code"))
|
||||
{
|
||||
bool focus_1 = ImGui::Button("Focus on 1"); ImGui::SameLine();
|
||||
@ -5892,12 +5860,12 @@ static void ShowDemoWindowInputs()
|
||||
ImGui::InputText("2", buf, IM_ARRAYSIZE(buf));
|
||||
if (ImGui::IsItemActive()) has_focus = 2;
|
||||
|
||||
ImGui::PushAllowKeyboardFocus(false);
|
||||
ImGui::PushTabStop(false);
|
||||
if (focus_3) ImGui::SetKeyboardFocusHere();
|
||||
ImGui::InputText("3 (tab skip)", buf, IM_ARRAYSIZE(buf));
|
||||
if (ImGui::IsItemActive()) has_focus = 3;
|
||||
ImGui::SameLine(); HelpMarker("Item won't be cycled through when using TAB or Shift+Tab.");
|
||||
ImGui::PopAllowKeyboardFocus();
|
||||
ImGui::PopTabStop();
|
||||
|
||||
if (has_focus)
|
||||
ImGui::Text("Item with focus: %d", has_focus);
|
||||
@ -5917,7 +5885,7 @@ static void ShowDemoWindowInputs()
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Dragging");
|
||||
IMGUI_DEMO_MARKER("Inputs & Focus/Dragging");
|
||||
if (ImGui::TreeNode("Dragging"))
|
||||
{
|
||||
ImGui::TextWrapped("You can use ImGui::GetMouseDragDelta(0) to query for the dragged amount on any widget.");
|
||||
@ -6048,6 +6016,9 @@ void ImGui::ShowAboutWindow(bool* p_open)
|
||||
#endif
|
||||
#ifdef __clang_version__
|
||||
ImGui::Text("define: __clang_version__=%s", __clang_version__);
|
||||
#endif
|
||||
#ifdef __EMSCRIPTEN__
|
||||
ImGui::Text("define: __EMSCRIPTEN__");
|
||||
#endif
|
||||
ImGui::Separator();
|
||||
ImGui::Text("io.BackendPlatformName: %s", io.BackendPlatformName ? io.BackendPlatformName : "NULL");
|
||||
@ -6197,7 +6168,7 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
|
||||
{
|
||||
if (ImGui::BeginTabItem("Sizes"))
|
||||
{
|
||||
ImGui::Text("Main");
|
||||
ImGui::SeparatorText("Main");
|
||||
ImGui::SliderFloat2("WindowPadding", (float*)&style.WindowPadding, 0.0f, 20.0f, "%.0f");
|
||||
ImGui::SliderFloat2("FramePadding", (float*)&style.FramePadding, 0.0f, 20.0f, "%.0f");
|
||||
ImGui::SliderFloat2("CellPadding", (float*)&style.CellPadding, 0.0f, 20.0f, "%.0f");
|
||||
@ -6207,22 +6178,24 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
|
||||
ImGui::SliderFloat("IndentSpacing", &style.IndentSpacing, 0.0f, 30.0f, "%.0f");
|
||||
ImGui::SliderFloat("ScrollbarSize", &style.ScrollbarSize, 1.0f, 20.0f, "%.0f");
|
||||
ImGui::SliderFloat("GrabMinSize", &style.GrabMinSize, 1.0f, 20.0f, "%.0f");
|
||||
ImGui::Text("Borders");
|
||||
|
||||
ImGui::SeparatorText("Borders");
|
||||
ImGui::SliderFloat("WindowBorderSize", &style.WindowBorderSize, 0.0f, 1.0f, "%.0f");
|
||||
ImGui::SliderFloat("ChildBorderSize", &style.ChildBorderSize, 0.0f, 1.0f, "%.0f");
|
||||
ImGui::SliderFloat("PopupBorderSize", &style.PopupBorderSize, 0.0f, 1.0f, "%.0f");
|
||||
ImGui::SliderFloat("FrameBorderSize", &style.FrameBorderSize, 0.0f, 1.0f, "%.0f");
|
||||
ImGui::SliderFloat("TabBorderSize", &style.TabBorderSize, 0.0f, 1.0f, "%.0f");
|
||||
ImGui::Text("Rounding");
|
||||
|
||||
ImGui::SeparatorText("Rounding");
|
||||
ImGui::SliderFloat("WindowRounding", &style.WindowRounding, 0.0f, 12.0f, "%.0f");
|
||||
ImGui::SliderFloat("ChildRounding", &style.ChildRounding, 0.0f, 12.0f, "%.0f");
|
||||
ImGui::SliderFloat("FrameRounding", &style.FrameRounding, 0.0f, 12.0f, "%.0f");
|
||||
ImGui::SliderFloat("PopupRounding", &style.PopupRounding, 0.0f, 12.0f, "%.0f");
|
||||
ImGui::SliderFloat("ScrollbarRounding", &style.ScrollbarRounding, 0.0f, 12.0f, "%.0f");
|
||||
ImGui::SliderFloat("GrabRounding", &style.GrabRounding, 0.0f, 12.0f, "%.0f");
|
||||
ImGui::SliderFloat("LogSliderDeadzone", &style.LogSliderDeadzone, 0.0f, 12.0f, "%.0f");
|
||||
ImGui::SliderFloat("TabRounding", &style.TabRounding, 0.0f, 12.0f, "%.0f");
|
||||
ImGui::Text("Alignment");
|
||||
|
||||
ImGui::SeparatorText("Widgets");
|
||||
ImGui::SliderFloat2("WindowTitleAlign", (float*)&style.WindowTitleAlign, 0.0f, 1.0f, "%.2f");
|
||||
int window_menu_button_position = style.WindowMenuButtonPosition + 1;
|
||||
if (ImGui::Combo("WindowMenuButtonPosition", (int*)&window_menu_button_position, "None\0Left\0Right\0"))
|
||||
@ -6232,9 +6205,13 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
|
||||
ImGui::SameLine(); HelpMarker("Alignment applies when a button is larger than its text content.");
|
||||
ImGui::SliderFloat2("SelectableTextAlign", (float*)&style.SelectableTextAlign, 0.0f, 1.0f, "%.2f");
|
||||
ImGui::SameLine(); HelpMarker("Alignment applies when a selectable is larger than its text content.");
|
||||
ImGui::Text("Safe Area Padding");
|
||||
ImGui::SameLine(); HelpMarker("Adjust if you cannot see the edges of your screen (e.g. on a TV where scaling has not been configured).");
|
||||
ImGui::SliderFloat2("DisplaySafeAreaPadding", (float*)&style.DisplaySafeAreaPadding, 0.0f, 30.0f, "%.0f");
|
||||
ImGui::SliderFloat("SeparatorTextBorderSize", &style.SeparatorTextBorderSize, 0.0f, 10.0f, "%.0f");
|
||||
ImGui::SliderFloat2("SeparatorTextAlign", (float*)&style.SeparatorTextAlign, 0.0f, 1.0f, "%.2f");
|
||||
ImGui::SliderFloat2("SeparatorTextPadding", (float*)&style.SeparatorTextPadding, 0.0f, 40.0f, "%0.f");
|
||||
ImGui::SliderFloat("LogSliderDeadzone", &style.LogSliderDeadzone, 0.0f, 12.0f, "%.0f");
|
||||
|
||||
ImGui::SeparatorText("Misc");
|
||||
ImGui::SliderFloat2("DisplaySafeAreaPadding", (float*)&style.DisplaySafeAreaPadding, 0.0f, 30.0f, "%.0f"); ImGui::SameLine(); HelpMarker("Adjust if you cannot see the edges of your screen (e.g. on a TV where scaling has not been configured).");
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
|
||||
@ -6344,10 +6321,11 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
|
||||
|
||||
// When editing the "Circle Segment Max Error" value, draw a preview of its effect on auto-tessellated circles.
|
||||
ImGui::DragFloat("Circle Tessellation Max Error", &style.CircleTessellationMaxError , 0.005f, 0.10f, 5.0f, "%.2f", ImGuiSliderFlags_AlwaysClamp);
|
||||
if (ImGui::IsItemActive())
|
||||
{
|
||||
const bool show_samples = ImGui::IsItemActive();
|
||||
if (show_samples)
|
||||
ImGui::SetNextWindowPos(ImGui::GetCursorScreenPos());
|
||||
ImGui::BeginTooltip();
|
||||
if (show_samples && ImGui::BeginTooltip())
|
||||
{
|
||||
ImGui::TextUnformatted("(R = radius, N = number of segments)");
|
||||
ImGui::Spacing();
|
||||
ImDrawList* draw_list = ImGui::GetWindowDrawList();
|
||||
@ -6544,6 +6522,7 @@ static void ShowExampleMenuFile()
|
||||
IM_ASSERT(0);
|
||||
}
|
||||
if (ImGui::MenuItem("Checked", NULL, true)) {}
|
||||
ImGui::Separator();
|
||||
if (ImGui::MenuItem("Quit", "Alt+F4")) {}
|
||||
}
|
||||
|
||||
@ -7087,7 +7066,7 @@ static void ShowExampleAppLayout(bool* p_open)
|
||||
{
|
||||
if (ImGui::BeginMenu("File"))
|
||||
{
|
||||
if (ImGui::MenuItem("Close")) *p_open = false;
|
||||
if (ImGui::MenuItem("Close", "Ctrl+W")) { *p_open = false; }
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
ImGui::EndMenuBar();
|
||||
@ -7462,7 +7441,7 @@ static void ShowExampleAppFullscreen(bool* p_open)
|
||||
static ImGuiWindowFlags flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoSavedSettings;
|
||||
|
||||
// We demonstrate using the full viewport area or the work area (without menu-bars, task-bars etc.)
|
||||
// Based on your use case you may want one of the other.
|
||||
// Based on your use case you may want one or the other.
|
||||
const ImGuiViewport* viewport = ImGui::GetMainViewport();
|
||||
ImGui::SetNextWindowPos(use_work_area ? viewport->WorkPos : viewport->Pos);
|
||||
ImGui::SetNextWindowSize(use_work_area ? viewport->WorkSize : viewport->Size);
|
||||
|
101
3rdparty/dear-imgui/imgui_draw.cpp
vendored
101
3rdparty/dear-imgui/imgui_draw.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// dear imgui, v1.89.1 WIP
|
||||
// dear imgui, v1.89.6 WIP
|
||||
// (drawing and font code)
|
||||
|
||||
/*
|
||||
@ -26,13 +26,12 @@ Index of this file:
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
|
||||
#include "imgui.h"
|
||||
#ifndef IMGUI_DISABLE
|
||||
|
||||
#ifndef IMGUI_DEFINE_MATH_OPERATORS
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#endif
|
||||
|
||||
#include "imgui.h"
|
||||
#ifndef IMGUI_DISABLE
|
||||
#include "imgui_internal.h"
|
||||
#ifdef IMGUI_ENABLE_FREETYPE
|
||||
#include "misc/freetype/imgui_freetype.h"
|
||||
@ -389,6 +388,8 @@ void ImDrawList::_ResetForNewFrame()
|
||||
IM_STATIC_ASSERT(IM_OFFSETOF(ImDrawCmd, ClipRect) == 0);
|
||||
IM_STATIC_ASSERT(IM_OFFSETOF(ImDrawCmd, TextureId) == sizeof(ImVec4));
|
||||
IM_STATIC_ASSERT(IM_OFFSETOF(ImDrawCmd, VtxOffset) == sizeof(ImVec4) + sizeof(ImTextureID));
|
||||
if (_Splitter._Count > 1)
|
||||
_Splitter.Merge(this);
|
||||
|
||||
CmdBuffer.resize(0);
|
||||
IdxBuffer.resize(0);
|
||||
@ -447,11 +448,13 @@ void ImDrawList::AddDrawCmd()
|
||||
// Note that this leaves the ImDrawList in a state unfit for further commands, as most code assume that CmdBuffer.Size > 0 && CmdBuffer.back().UserCallback == NULL
|
||||
void ImDrawList::_PopUnusedDrawCmd()
|
||||
{
|
||||
if (CmdBuffer.Size == 0)
|
||||
return;
|
||||
ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1];
|
||||
if (curr_cmd->ElemCount == 0 && curr_cmd->UserCallback == NULL)
|
||||
while (CmdBuffer.Size > 0)
|
||||
{
|
||||
ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1];
|
||||
if (curr_cmd->ElemCount != 0 || curr_cmd->UserCallback != NULL)
|
||||
return;// break;
|
||||
CmdBuffer.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
void ImDrawList::AddCallback(ImDrawCallback callback, void* callback_data)
|
||||
@ -704,7 +707,7 @@ void ImDrawList::PrimQuadUV(const ImVec2& a, const ImVec2& b, const ImVec2& c, c
|
||||
// We avoid using the ImVec2 math operators here to reduce cost to a minimum for debug/non-inlined builds.
|
||||
void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32 col, ImDrawFlags flags, float thickness)
|
||||
{
|
||||
if (points_count < 2)
|
||||
if (points_count < 2 || (col & IM_COL32_A_MASK) == 0)
|
||||
return;
|
||||
|
||||
const bool closed = (flags & ImDrawFlags_Closed) != 0;
|
||||
@ -962,7 +965,7 @@ void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32
|
||||
// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
||||
void ImDrawList::AddConvexPolyFilled(const ImVec2* points, const int points_count, ImU32 col)
|
||||
{
|
||||
if (points_count < 3)
|
||||
if (points_count < 3 || (col & IM_COL32_A_MASK) == 0)
|
||||
return;
|
||||
|
||||
const ImVec2 uv = _Data->TexUvWhitePixel;
|
||||
@ -2380,7 +2383,12 @@ static bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas)
|
||||
ImFontBuildDstData& dst_tmp = dst_tmp_array[src_tmp.DstIndex];
|
||||
src_tmp.SrcRanges = cfg.GlyphRanges ? cfg.GlyphRanges : atlas->GetGlyphRangesDefault();
|
||||
for (const ImWchar* src_range = src_tmp.SrcRanges; src_range[0] && src_range[1]; src_range += 2)
|
||||
{
|
||||
// Check for valid range. This may also help detect *some* dangling pointers, because a common
|
||||
// user error is to setup ImFontConfig::GlyphRanges with a pointer to data that isn't persistent.
|
||||
IM_ASSERT(src_range[0] <= src_range[1]);
|
||||
src_tmp.GlyphsHighest = ImMax(src_tmp.GlyphsHighest, (int)src_range[1]);
|
||||
}
|
||||
dst_tmp.SrcCount++;
|
||||
dst_tmp.GlyphsHighest = ImMax(dst_tmp.GlyphsHighest, src_tmp.GlyphsHighest);
|
||||
}
|
||||
@ -2615,6 +2623,9 @@ void ImFontAtlasBuildPackCustomRects(ImFontAtlas* atlas, void* stbrp_context_opa
|
||||
|
||||
ImVector<ImFontAtlasCustomRect>& user_rects = atlas->CustomRects;
|
||||
IM_ASSERT(user_rects.Size >= 1); // We expect at least the default custom rects to be registered, else something went wrong.
|
||||
#ifdef __GNUC__
|
||||
if (user_rects.Size < 1) { __builtin_unreachable(); } // Workaround for GCC bug if IM_ASSERT() is defined to conditionally throw (see #5343)
|
||||
#endif
|
||||
|
||||
ImVector<stbrp_rect> pack_rects;
|
||||
pack_rects.resize(user_rects.Size);
|
||||
@ -2935,19 +2946,19 @@ const ImWchar* ImFontAtlas::GetGlyphRangesJapanese()
|
||||
// 2999 ideograms code points for Japanese
|
||||
// - 2136 Joyo (meaning "for regular use" or "for common use") Kanji code points
|
||||
// - 863 Jinmeiyo (meaning "for personal name") Kanji code points
|
||||
// - Sourced from the character information database of the Information-technology Promotion Agency, Japan
|
||||
// - https://mojikiban.ipa.go.jp/mji/
|
||||
// - Available under the terms of the Creative Commons Attribution-ShareAlike 2.1 Japan (CC BY-SA 2.1 JP).
|
||||
// - https://creativecommons.org/licenses/by-sa/2.1/jp/deed.en
|
||||
// - https://creativecommons.org/licenses/by-sa/2.1/jp/legalcode
|
||||
// - You can generate this code by the script at:
|
||||
// - https://github.com/vaiorabbit/everyday_use_kanji
|
||||
// - Sourced from official information provided by the government agencies of Japan:
|
||||
// - List of Joyo Kanji by the Agency for Cultural Affairs
|
||||
// - https://www.bunka.go.jp/kokugo_nihongo/sisaku/joho/joho/kijun/naikaku/kanji/
|
||||
// - List of Jinmeiyo Kanji by the Ministry of Justice
|
||||
// - http://www.moj.go.jp/MINJI/minji86.html
|
||||
// - Available under the terms of the Creative Commons Attribution 4.0 International (CC BY 4.0).
|
||||
// - https://creativecommons.org/licenses/by/4.0/legalcode
|
||||
// - You can generate this code by the script at:
|
||||
// - https://github.com/vaiorabbit/everyday_use_kanji
|
||||
// - References:
|
||||
// - List of Joyo Kanji
|
||||
// - (Official list by the Agency for Cultural Affairs) https://www.bunka.go.jp/kokugo_nihongo/sisaku/joho/joho/kakuki/14/tosin02/index.html
|
||||
// - (Wikipedia) https://en.wikipedia.org/wiki/List_of_j%C5%8Dy%C5%8D_kanji
|
||||
// - List of Jinmeiyo Kanji
|
||||
// - (Official list by the Ministry of Justice) http://www.moj.go.jp/MINJI/minji86.html
|
||||
// - (Wikipedia) https://en.wikipedia.org/wiki/Jinmeiy%C5%8D_kanji
|
||||
// - Missing 1 Joyo Kanji: U+20B9F (Kun'yomi: Shikaru, On'yomi: Shitsu,shichi), see https://github.com/ocornut/imgui/pull/3627 for details.
|
||||
// You can use ImFontGlyphRangesBuilder to create your own ranges derived from this, by merging existing ranges or adding new characters.
|
||||
@ -3110,7 +3121,8 @@ ImFont::ImFont()
|
||||
FallbackAdvanceX = 0.0f;
|
||||
FallbackChar = (ImWchar)-1;
|
||||
EllipsisChar = (ImWchar)-1;
|
||||
DotChar = (ImWchar)-1;
|
||||
EllipsisWidth = EllipsisCharStep = 0.0f;
|
||||
EllipsisCharCount = 0;
|
||||
FallbackGlyph = NULL;
|
||||
ContainerAtlas = NULL;
|
||||
ConfigData = NULL;
|
||||
@ -3198,8 +3210,20 @@ void ImFont::BuildLookupTable()
|
||||
const ImWchar dots_chars[] = { (ImWchar)'.', (ImWchar)0xFF0E };
|
||||
if (EllipsisChar == (ImWchar)-1)
|
||||
EllipsisChar = FindFirstExistingGlyph(this, ellipsis_chars, IM_ARRAYSIZE(ellipsis_chars));
|
||||
if (DotChar == (ImWchar)-1)
|
||||
DotChar = FindFirstExistingGlyph(this, dots_chars, IM_ARRAYSIZE(dots_chars));
|
||||
const ImWchar dot_char = FindFirstExistingGlyph(this, dots_chars, IM_ARRAYSIZE(dots_chars));
|
||||
if (EllipsisChar != (ImWchar)-1)
|
||||
{
|
||||
EllipsisCharCount = 1;
|
||||
EllipsisWidth = EllipsisCharStep = FindGlyph(EllipsisChar)->X1;
|
||||
}
|
||||
else if (dot_char != (ImWchar)-1)
|
||||
{
|
||||
const ImFontGlyph* glyph = FindGlyph(dot_char);
|
||||
EllipsisChar = dot_char;
|
||||
EllipsisCharCount = 3;
|
||||
EllipsisCharStep = (glyph->X1 - glyph->X0) + 1.0f;
|
||||
EllipsisWidth = EllipsisCharStep * 3.0f - 1.0f;
|
||||
}
|
||||
|
||||
// Setup fallback character
|
||||
const ImWchar fallback_chars[] = { (ImWchar)IM_UNICODE_CODEPOINT_INVALID, (ImWchar)'?', (ImWchar)' ' };
|
||||
@ -3367,6 +3391,7 @@ const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const c
|
||||
bool inside_word = true;
|
||||
|
||||
const char* s = text;
|
||||
IM_ASSERT(text_end != NULL);
|
||||
while (s < text_end)
|
||||
{
|
||||
unsigned int c = (unsigned int)*s;
|
||||
@ -3375,8 +3400,6 @@ const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const c
|
||||
next_s = s + 1;
|
||||
else
|
||||
next_s = s + ImTextCharFromUtf8(&c, s, text_end);
|
||||
if (c == 0)
|
||||
break;
|
||||
|
||||
if (c < 32)
|
||||
{
|
||||
@ -3482,15 +3505,9 @@ ImVec2 ImFont::CalcTextSizeA(float size, float max_width, float wrap_width, cons
|
||||
const char* prev_s = s;
|
||||
unsigned int c = (unsigned int)*s;
|
||||
if (c < 0x80)
|
||||
{
|
||||
s += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
s += ImTextCharFromUtf8(&c, s, text_end);
|
||||
if (c == 0) // Malformed UTF-8?
|
||||
break;
|
||||
}
|
||||
|
||||
if (c < 32)
|
||||
{
|
||||
@ -3570,7 +3587,7 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im
|
||||
// FIXME-OPT: This is not optimal as do first do a search for \n before calling CalcWordWrapPositionA().
|
||||
// If the specs for CalcWordWrapPositionA() were reworked to optionally return on \n we could combine both.
|
||||
// However it is still better than nothing performing the fast-forward!
|
||||
s = CalcWordWrapPositionA(scale, s, line_end, wrap_width);
|
||||
s = CalcWordWrapPositionA(scale, s, line_end ? line_end : text_end, wrap_width);
|
||||
s = CalcWordWrapNextLineStartA(s, text_end);
|
||||
}
|
||||
else
|
||||
@ -3602,10 +3619,9 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im
|
||||
const int idx_count_max = (int)(text_end - s) * 6;
|
||||
const int idx_expected_size = draw_list->IdxBuffer.Size + idx_count_max;
|
||||
draw_list->PrimReserve(idx_count_max, vtx_count_max);
|
||||
|
||||
ImDrawVert* vtx_write = draw_list->_VtxWritePtr;
|
||||
ImDrawIdx* idx_write = draw_list->_IdxWritePtr;
|
||||
unsigned int vtx_current_idx = draw_list->_VtxCurrentIdx;
|
||||
ImDrawVert* vtx_write = draw_list->_VtxWritePtr;
|
||||
ImDrawIdx* idx_write = draw_list->_IdxWritePtr;
|
||||
unsigned int vtx_index = draw_list->_VtxCurrentIdx;
|
||||
|
||||
const ImU32 col_untinted = col | ~IM_COL32_A_MASK;
|
||||
const char* word_wrap_eol = NULL;
|
||||
@ -3631,15 +3647,9 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im
|
||||
// Decode and advance source
|
||||
unsigned int c = (unsigned int)*s;
|
||||
if (c < 0x80)
|
||||
{
|
||||
s += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
s += ImTextCharFromUtf8(&c, s, text_end);
|
||||
if (c == 0) // Malformed UTF-8?
|
||||
break;
|
||||
}
|
||||
|
||||
if (c < 32)
|
||||
{
|
||||
@ -3710,14 +3720,14 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im
|
||||
|
||||
// We are NOT calling PrimRectUV() here because non-inlined causes too much overhead in a debug builds. Inlined here:
|
||||
{
|
||||
idx_write[0] = (ImDrawIdx)(vtx_current_idx); idx_write[1] = (ImDrawIdx)(vtx_current_idx+1); idx_write[2] = (ImDrawIdx)(vtx_current_idx+2);
|
||||
idx_write[3] = (ImDrawIdx)(vtx_current_idx); idx_write[4] = (ImDrawIdx)(vtx_current_idx+2); idx_write[5] = (ImDrawIdx)(vtx_current_idx+3);
|
||||
vtx_write[0].pos.x = x1; vtx_write[0].pos.y = y1; vtx_write[0].col = glyph_col; vtx_write[0].uv.x = u1; vtx_write[0].uv.y = v1;
|
||||
vtx_write[1].pos.x = x2; vtx_write[1].pos.y = y1; vtx_write[1].col = glyph_col; vtx_write[1].uv.x = u2; vtx_write[1].uv.y = v1;
|
||||
vtx_write[2].pos.x = x2; vtx_write[2].pos.y = y2; vtx_write[2].col = glyph_col; vtx_write[2].uv.x = u2; vtx_write[2].uv.y = v2;
|
||||
vtx_write[3].pos.x = x1; vtx_write[3].pos.y = y2; vtx_write[3].col = glyph_col; vtx_write[3].uv.x = u1; vtx_write[3].uv.y = v2;
|
||||
idx_write[0] = (ImDrawIdx)(vtx_index); idx_write[1] = (ImDrawIdx)(vtx_index + 1); idx_write[2] = (ImDrawIdx)(vtx_index + 2);
|
||||
idx_write[3] = (ImDrawIdx)(vtx_index); idx_write[4] = (ImDrawIdx)(vtx_index + 2); idx_write[5] = (ImDrawIdx)(vtx_index + 3);
|
||||
vtx_write += 4;
|
||||
vtx_current_idx += 4;
|
||||
vtx_index += 4;
|
||||
idx_write += 6;
|
||||
}
|
||||
}
|
||||
@ -3731,7 +3741,7 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im
|
||||
draw_list->CmdBuffer[draw_list->CmdBuffer.Size - 1].ElemCount -= (idx_expected_size - draw_list->IdxBuffer.Size);
|
||||
draw_list->_VtxWritePtr = vtx_write;
|
||||
draw_list->_IdxWritePtr = idx_write;
|
||||
draw_list->_VtxCurrentIdx = vtx_current_idx;
|
||||
draw_list->_VtxCurrentIdx = vtx_index;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -3783,6 +3793,7 @@ void ImGui::RenderArrow(ImDrawList* draw_list, ImVec2 pos, ImU32 col, ImGuiDir d
|
||||
|
||||
void ImGui::RenderBullet(ImDrawList* draw_list, ImVec2 pos, ImU32 col)
|
||||
{
|
||||
// FIXME-OPT: This should be baked in font.
|
||||
draw_list->AddCircleFilled(pos, draw_list->_Data->FontSize * 0.20f, col, 8);
|
||||
}
|
||||
|
||||
|
359
3rdparty/dear-imgui/imgui_internal.h
vendored
359
3rdparty/dear-imgui/imgui_internal.h
vendored
@ -1,10 +1,12 @@
|
||||
// dear imgui, v1.89.1 WIP
|
||||
// dear imgui, v1.89.6 WIP
|
||||
// (internal structures/api)
|
||||
|
||||
// You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility!
|
||||
// Set:
|
||||
// #define IMGUI_DEFINE_MATH_OPERATORS
|
||||
// To implement maths operators for ImVec2 (disabled by default to not collide with using IM_VEC2_CLASS_EXTRA along with your own math types+operators)
|
||||
// You may use this file to debug, understand or extend Dear ImGui features but we don't provide any guarantee of forward compatibility.
|
||||
// To implement maths operators for ImVec2 (disabled by default to not conflict with using IM_VEC2_CLASS_EXTRA with your own math types+operators), use:
|
||||
/*
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#include "imgui_internal.h"
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@ -56,7 +58,7 @@ Index of this file:
|
||||
#include <limits.h> // INT_MIN, INT_MAX
|
||||
|
||||
// Enable SSE intrinsics if available
|
||||
#if (defined __SSE__ || defined __x86_64__ || defined _M_X64) && !defined(IMGUI_DISABLE_SSE)
|
||||
#if (defined __SSE__ || defined __x86_64__ || defined _M_X64 || (defined(_M_IX86_FP) && (_M_IX86_FP >= 1))) && !defined(IMGUI_DISABLE_SSE)
|
||||
#define IMGUI_ENABLE_SSE
|
||||
#include <immintrin.h>
|
||||
#endif
|
||||
@ -93,6 +95,12 @@ Index of this file:
|
||||
#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
|
||||
#endif
|
||||
|
||||
// In 1.89.4, we moved the implementation of "courtesy maths operators" from imgui_internal.h in imgui.h
|
||||
// As they are frequently requested, we do not want to encourage to many people using imgui_internal.h
|
||||
#if defined(IMGUI_DEFINE_MATH_OPERATORS) && !defined(IMGUI_DEFINE_MATH_OPERATORS_IMPLEMENTED)
|
||||
#error Please '#define IMGUI_DEFINE_MATH_OPERATORS' _BEFORE_ including imgui.h!
|
||||
#endif
|
||||
|
||||
// Legacy defines
|
||||
#ifdef IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS // Renamed in 1.74
|
||||
#error Use IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
|
||||
@ -118,9 +126,11 @@ struct ImDrawListSharedData; // Data shared between all ImDrawList instan
|
||||
struct ImGuiColorMod; // Stacked color modifier, backup of modified data so we can restore it
|
||||
struct ImGuiContext; // Main Dear ImGui context
|
||||
struct ImGuiContextHook; // Hook for extensions like ImGuiTestEngine
|
||||
struct ImGuiDataVarInfo; // Variable information (e.g. to avoid style variables from an enum)
|
||||
struct ImGuiDataTypeInfo; // Type information associated to a ImGuiDataType enum
|
||||
struct ImGuiGroupData; // Stacked storage data for BeginGroup()/EndGroup()
|
||||
struct ImGuiInputTextState; // Internal state of the currently focused/edited text input box
|
||||
struct ImGuiInputTextDeactivateData;// Short term storage to backup text of a deactivating InputText() while another is stealing active id
|
||||
struct ImGuiLastItemData; // Status storage for last submitted items
|
||||
struct ImGuiLocEntry; // A localization entry.
|
||||
struct ImGuiMenuColumns; // Simple column measurement, currently used for MenuItem() only
|
||||
@ -154,6 +164,7 @@ typedef int ImGuiLayoutType; // -> enum ImGuiLayoutType_ // E
|
||||
// Flags
|
||||
typedef int ImGuiActivateFlags; // -> enum ImGuiActivateFlags_ // Flags: for navigation/focus function (will be for ActivateItem() later)
|
||||
typedef int ImGuiDebugLogFlags; // -> enum ImGuiDebugLogFlags_ // Flags: for ShowDebugLogWindow(), g.DebugLogFlags
|
||||
typedef int ImGuiFocusRequestFlags; // -> enum ImGuiFocusRequestFlags_ // Flags: for FocusWindow();
|
||||
typedef int ImGuiInputFlags; // -> enum ImGuiInputFlags_ // Flags: for IsKeyPressed(), IsMouseClicked(), SetKeyOwner(), SetItemKeyOwner() etc.
|
||||
typedef int ImGuiItemFlags; // -> enum ImGuiItemFlags_ // Flags: for PushItemFlag(), g.LastItemData.InFlags
|
||||
typedef int ImGuiItemStatusFlags; // -> enum ImGuiItemStatusFlags_ // Flags: for g.LastItemData.StatusFlags
|
||||
@ -206,16 +217,21 @@ namespace ImStb
|
||||
#ifndef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
|
||||
#define IMGUI_DEBUG_PRINTF(_FMT,...) printf(_FMT, __VA_ARGS__)
|
||||
#else
|
||||
#define IMGUI_DEBUG_PRINTF(_FMT,...)
|
||||
#define IMGUI_DEBUG_PRINTF(_FMT,...) ((void)0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Debug Logging for ShowDebugLogWindow(). This is designed for relatively rare events so please don't spam.
|
||||
#ifndef IMGUI_DISABLE_DEBUG_TOOLS
|
||||
#define IMGUI_DEBUG_LOG(...) ImGui::DebugLog(__VA_ARGS__)
|
||||
#else
|
||||
#define IMGUI_DEBUG_LOG(...) ((void)0)
|
||||
#endif
|
||||
#define IMGUI_DEBUG_LOG_ACTIVEID(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventActiveId) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
|
||||
#define IMGUI_DEBUG_LOG_FOCUS(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventFocus) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
|
||||
#define IMGUI_DEBUG_LOG_POPUP(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventPopup) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
|
||||
#define IMGUI_DEBUG_LOG_NAV(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventNav) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
|
||||
#define IMGUI_DEBUG_LOG_SELECTION(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventSelection)IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
|
||||
#define IMGUI_DEBUG_LOG_CLIPPER(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventClipper) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
|
||||
#define IMGUI_DEBUG_LOG_IO(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventIO) IMGUI_DEBUG_LOG(__VA_ARGS__); } while (0)
|
||||
|
||||
@ -312,8 +328,8 @@ namespace ImStb
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Helpers: Hashing
|
||||
IMGUI_API ImGuiID ImHashData(const void* data, size_t data_size, ImU32 seed = 0);
|
||||
IMGUI_API ImGuiID ImHashStr(const char* data, size_t data_size = 0, ImU32 seed = 0);
|
||||
IMGUI_API ImGuiID ImHashData(const void* data, size_t data_size, ImGuiID seed = 0);
|
||||
IMGUI_API ImGuiID ImHashStr(const char* data, size_t data_size = 0, ImGuiID seed = 0);
|
||||
|
||||
// Helpers: Sorting
|
||||
#ifndef ImQsort
|
||||
@ -368,29 +384,6 @@ IMGUI_API int ImTextCountCharsFromUtf8(const char* in_text, const char
|
||||
IMGUI_API int ImTextCountUtf8BytesFromChar(const char* in_text, const char* in_text_end); // return number of bytes to express one char in UTF-8
|
||||
IMGUI_API int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end); // return number of bytes to express string in UTF-8
|
||||
|
||||
// Helpers: ImVec2/ImVec4 operators
|
||||
// We are keeping those disabled by default so they don't leak in user space, to allow user enabling implicit cast operators between ImVec2 and their own types (using IM_VEC2_CLASS_EXTRA etc.)
|
||||
// We unfortunately don't have a unary- operator for ImVec2 because this would needs to be defined inside the class itself.
|
||||
#ifdef IMGUI_DEFINE_MATH_OPERATORS
|
||||
IM_MSVC_RUNTIME_CHECKS_OFF
|
||||
static inline ImVec2 operator*(const ImVec2& lhs, const float rhs) { return ImVec2(lhs.x * rhs, lhs.y * rhs); }
|
||||
static inline ImVec2 operator/(const ImVec2& lhs, const float rhs) { return ImVec2(lhs.x / rhs, lhs.y / rhs); }
|
||||
static inline ImVec2 operator+(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x + rhs.x, lhs.y + rhs.y); }
|
||||
static inline ImVec2 operator-(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x - rhs.x, lhs.y - rhs.y); }
|
||||
static inline ImVec2 operator*(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x * rhs.x, lhs.y * rhs.y); }
|
||||
static inline ImVec2 operator/(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x / rhs.x, lhs.y / rhs.y); }
|
||||
static inline ImVec2& operator*=(ImVec2& lhs, const float rhs) { lhs.x *= rhs; lhs.y *= rhs; return lhs; }
|
||||
static inline ImVec2& operator/=(ImVec2& lhs, const float rhs) { lhs.x /= rhs; lhs.y /= rhs; return lhs; }
|
||||
static inline ImVec2& operator+=(ImVec2& lhs, const ImVec2& rhs) { lhs.x += rhs.x; lhs.y += rhs.y; return lhs; }
|
||||
static inline ImVec2& operator-=(ImVec2& lhs, const ImVec2& rhs) { lhs.x -= rhs.x; lhs.y -= rhs.y; return lhs; }
|
||||
static inline ImVec2& operator*=(ImVec2& lhs, const ImVec2& rhs) { lhs.x *= rhs.x; lhs.y *= rhs.y; return lhs; }
|
||||
static inline ImVec2& operator/=(ImVec2& lhs, const ImVec2& rhs) { lhs.x /= rhs.x; lhs.y /= rhs.y; return lhs; }
|
||||
static inline ImVec4 operator+(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z, lhs.w + rhs.w); }
|
||||
static inline ImVec4 operator-(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z, lhs.w - rhs.w); }
|
||||
static inline ImVec4 operator*(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z, lhs.w * rhs.w); }
|
||||
IM_MSVC_RUNTIME_CHECKS_RESTORE
|
||||
#endif
|
||||
|
||||
// Helpers: File System
|
||||
#ifdef IMGUI_DISABLE_FILE_FUNCTIONS
|
||||
#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS
|
||||
@ -473,6 +466,7 @@ static inline ImVec2 ImRotate(const ImVec2& v, float cos_a, float sin_a)
|
||||
static inline float ImLinearSweep(float current, float target, float speed) { if (current < target) return ImMin(current + speed, target); if (current > target) return ImMax(current - speed, target); return current; }
|
||||
static inline ImVec2 ImMul(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x * rhs.x, lhs.y * rhs.y); }
|
||||
static inline bool ImIsFloatAboveGuaranteedIntegerPrecision(float f) { return f <= -16777216 || f >= 16777216; }
|
||||
static inline float ImExponentialMovingAverage(float avg, float sample, int n) { avg -= avg / n; avg += sample / n; return avg; }
|
||||
IM_MSVC_RUNTIME_CHECKS_RESTORE
|
||||
|
||||
// Helpers: Geometry
|
||||
@ -543,9 +537,12 @@ struct IMGUI_API ImRect
|
||||
bool IsInverted() const { return Min.x > Max.x || Min.y > Max.y; }
|
||||
ImVec4 ToVec4() const { return ImVec4(Min.x, Min.y, Max.x, Max.y); }
|
||||
};
|
||||
IM_MSVC_RUNTIME_CHECKS_RESTORE
|
||||
|
||||
// Helper: ImBitArray
|
||||
#define IM_BITARRAY_TESTBIT(_ARRAY, _N) ((_ARRAY[(_N) >> 5] & ((ImU32)1 << ((_N) & 31))) != 0) // Macro version of ImBitArrayTestBit(): ensure args have side-effect or are costly!
|
||||
#define IM_BITARRAY_CLEARBIT(_ARRAY, _N) ((_ARRAY[(_N) >> 5] &= ~((ImU32)1 << ((_N) & 31)))) // Macro version of ImBitArrayClearBit(): ensure args have side-effect or are costly!
|
||||
inline size_t ImBitArrayGetStorageSizeInBytes(int bitcount) { return (size_t)((bitcount + 31) >> 5) << 2; }
|
||||
inline void ImBitArrayClearAllBits(ImU32* arr, int bitcount){ memset(arr, 0, ImBitArrayGetStorageSizeInBytes(bitcount)); }
|
||||
inline bool ImBitArrayTestBit(const ImU32* arr, int n) { ImU32 mask = (ImU32)1 << (n & 31); return (arr[n >> 5] & mask) != 0; }
|
||||
inline void ImBitArrayClearBit(ImU32* arr, int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] &= ~mask; }
|
||||
inline void ImBitArraySetBit(ImU32* arr, int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] |= mask; }
|
||||
@ -562,6 +559,8 @@ inline void ImBitArraySetBitRange(ImU32* arr, int n, int n2) // Works on ran
|
||||
}
|
||||
}
|
||||
|
||||
typedef ImU32* ImBitArrayPtr; // Name for use in structs
|
||||
|
||||
// Helper: ImBitArray class (wrapper over ImBitArray functions)
|
||||
// Store 1-bit per value.
|
||||
template<int BITCOUNT, int OFFSET = 0>
|
||||
@ -571,11 +570,11 @@ struct ImBitArray
|
||||
ImBitArray() { ClearAllBits(); }
|
||||
void ClearAllBits() { memset(Storage, 0, sizeof(Storage)); }
|
||||
void SetAllBits() { memset(Storage, 255, sizeof(Storage)); }
|
||||
bool TestBit(int n) const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); return ImBitArrayTestBit(Storage, n); }
|
||||
bool TestBit(int n) const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); return IM_BITARRAY_TESTBIT(Storage, n); }
|
||||
void SetBit(int n) { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); ImBitArraySetBit(Storage, n); }
|
||||
void ClearBit(int n) { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); ImBitArrayClearBit(Storage, n); }
|
||||
void SetBitRange(int n, int n2) { n += OFFSET; n2 += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT && n2 > n && n2 <= BITCOUNT); ImBitArraySetBitRange(Storage, n, n2); } // Works on range [n..n2)
|
||||
bool operator[](int n) const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); return ImBitArrayTestBit(Storage, n); }
|
||||
bool operator[](int n) const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); return IM_BITARRAY_TESTBIT(Storage, n); }
|
||||
};
|
||||
|
||||
// Helper: ImBitVector
|
||||
@ -585,10 +584,11 @@ struct IMGUI_API ImBitVector
|
||||
ImVector<ImU32> Storage;
|
||||
void Create(int sz) { Storage.resize((sz + 31) >> 5); memset(Storage.Data, 0, (size_t)Storage.Size * sizeof(Storage.Data[0])); }
|
||||
void Clear() { Storage.clear(); }
|
||||
bool TestBit(int n) const { IM_ASSERT(n < (Storage.Size << 5)); return ImBitArrayTestBit(Storage.Data, n); }
|
||||
bool TestBit(int n) const { IM_ASSERT(n < (Storage.Size << 5)); return IM_BITARRAY_TESTBIT(Storage.Data, n); }
|
||||
void SetBit(int n) { IM_ASSERT(n < (Storage.Size << 5)); ImBitArraySetBit(Storage.Data, n); }
|
||||
void ClearBit(int n) { IM_ASSERT(n < (Storage.Size << 5)); ImBitArrayClearBit(Storage.Data, n); }
|
||||
};
|
||||
IM_MSVC_RUNTIME_CHECKS_RESTORE
|
||||
|
||||
// Helper: ImSpan<>
|
||||
// Pointing to a span of data we don't own.
|
||||
@ -792,10 +792,10 @@ enum ImGuiItemFlags_
|
||||
{
|
||||
// Controlled by user
|
||||
ImGuiItemFlags_None = 0,
|
||||
ImGuiItemFlags_NoTabStop = 1 << 0, // false // Disable keyboard tabbing (FIXME: should merge with _NoNav)
|
||||
ImGuiItemFlags_NoTabStop = 1 << 0, // false // Disable keyboard tabbing. This is a "lighter" version of ImGuiItemFlags_NoNav.
|
||||
ImGuiItemFlags_ButtonRepeat = 1 << 1, // false // Button() will return true multiple times based on io.KeyRepeatDelay and io.KeyRepeatRate settings.
|
||||
ImGuiItemFlags_Disabled = 1 << 2, // false // Disable interactions but doesn't affect visuals. See BeginDisabled()/EndDisabled(). See github.com/ocornut/imgui/issues/211
|
||||
ImGuiItemFlags_NoNav = 1 << 3, // false // Disable keyboard/gamepad directional navigation (FIXME: should merge with _NoTabStop)
|
||||
ImGuiItemFlags_NoNav = 1 << 3, // false // Disable any form of focusing (keyboard/gamepad directional navigation and SetKeyboardFocusHere() calls)
|
||||
ImGuiItemFlags_NoNavDefaultFocus = 1 << 4, // false // Disable item being a candidate for default focus (e.g. used by title bar items)
|
||||
ImGuiItemFlags_SelectableDontClosePopup = 1 << 5, // false // Disable MenuItem/Selectable() automatically closing their popup window
|
||||
ImGuiItemFlags_MixedValue = 1 << 6, // false // [BETA] Represent a mixed/indeterminate value, generally multi-selection where values differ. Currently only supported by Checkbox() (later should support all sorts of widgets)
|
||||
@ -822,11 +822,13 @@ enum ImGuiItemStatusFlags_
|
||||
ImGuiItemStatusFlags_FocusedByTabbing = 1 << 8, // Set when the Focusable item just got focused by Tabbing (FIXME: to be removed soon)
|
||||
ImGuiItemStatusFlags_Visible = 1 << 9, // [WIP] Set when item is overlapping the current clipping rectangle (Used internally. Please don't use yet: API/system will change as we refactor Itemadd()).
|
||||
|
||||
// Additional status + semantic for ImGuiTestEngine
|
||||
#ifdef IMGUI_ENABLE_TEST_ENGINE
|
||||
ImGuiItemStatusFlags_Openable = 1 << 20, // Item is an openable (e.g. TreeNode)
|
||||
ImGuiItemStatusFlags_Opened = 1 << 21, //
|
||||
ImGuiItemStatusFlags_Opened = 1 << 21, // Opened status
|
||||
ImGuiItemStatusFlags_Checkable = 1 << 22, // Item is a checkable (e.g. CheckBox, MenuItem)
|
||||
ImGuiItemStatusFlags_Checked = 1 << 23, //
|
||||
ImGuiItemStatusFlags_Checked = 1 << 23, // Checked status
|
||||
ImGuiItemStatusFlags_Inputable = 1 << 24, // Item is a text-inputable (e.g. InputText, SliderXXX, DragXXX)
|
||||
#endif
|
||||
};
|
||||
|
||||
@ -886,10 +888,9 @@ enum ImGuiSelectableFlagsPrivate_
|
||||
ImGuiSelectableFlags_SelectOnClick = 1 << 22, // Override button behavior to react on Click (default is Click+Release)
|
||||
ImGuiSelectableFlags_SelectOnRelease = 1 << 23, // Override button behavior to react on Release (default is Click+Release)
|
||||
ImGuiSelectableFlags_SpanAvailWidth = 1 << 24, // Span all avail width even if we declared less for layout purpose. FIXME: We may be able to remove this (added in 6251d379, 2bcafc86 for menus)
|
||||
ImGuiSelectableFlags_DrawHoveredWhenHeld = 1 << 25, // Always show active when held, even is not hovered. This concept could probably be renamed/formalized somehow.
|
||||
ImGuiSelectableFlags_SetNavIdOnHover = 1 << 26, // Set Nav/Focus ID on mouse hover (used by MenuItem)
|
||||
ImGuiSelectableFlags_NoPadWithHalfSpacing = 1 << 27, // Disable padding each side with ItemSpacing * 0.5f
|
||||
ImGuiSelectableFlags_NoSetKeyOwner = 1 << 28, // Don't set key/input owner on the initial click (note: mouse buttons are keys! often, the key in question will be ImGuiKey_MouseLeft!)
|
||||
ImGuiSelectableFlags_SetNavIdOnHover = 1 << 25, // Set Nav/Focus ID on mouse hover (used by MenuItem)
|
||||
ImGuiSelectableFlags_NoPadWithHalfSpacing = 1 << 26, // Disable padding each side with ItemSpacing * 0.5f
|
||||
ImGuiSelectableFlags_NoSetKeyOwner = 1 << 27, // Don't set key/input owner on the initial click (note: mouse buttons are keys! often, the key in question will be ImGuiKey_MouseLeft!)
|
||||
};
|
||||
|
||||
// Extend ImGuiTreeNodeFlags_
|
||||
@ -906,6 +907,16 @@ enum ImGuiSeparatorFlags_
|
||||
ImGuiSeparatorFlags_SpanAllColumns = 1 << 2,
|
||||
};
|
||||
|
||||
// Flags for FocusWindow(). This is not called ImGuiFocusFlags to avoid confusion with public-facing ImGuiFocusedFlags.
|
||||
// FIXME: Once we finishing replacing more uses of GetTopMostPopupModal()+IsWindowWithinBeginStackOf()
|
||||
// and FindBlockingModal() with this, we may want to change the flag to be opt-out instead of opt-in.
|
||||
enum ImGuiFocusRequestFlags_
|
||||
{
|
||||
ImGuiFocusRequestFlags_None = 0,
|
||||
ImGuiFocusRequestFlags_RestoreFocusedChild = 1 << 0, // Find last focused child (if any) and focus it instead.
|
||||
ImGuiFocusRequestFlags_UnlessBelowModal = 1 << 1, // Do not set focus if the window is below a modal.
|
||||
};
|
||||
|
||||
enum ImGuiTextFlags_
|
||||
{
|
||||
ImGuiTextFlags_None = 0,
|
||||
@ -956,6 +967,14 @@ enum ImGuiPopupPositionPolicy
|
||||
ImGuiPopupPositionPolicy_Tooltip,
|
||||
};
|
||||
|
||||
struct ImGuiDataVarInfo
|
||||
{
|
||||
ImGuiDataType Type;
|
||||
ImU32 Count; // 1+
|
||||
ImU32 Offset; // Offset in parent structure
|
||||
void* GetVarPtr(void* parent) const { return (void*)((unsigned char*)parent + Offset); }
|
||||
};
|
||||
|
||||
struct ImGuiDataTypeTempStorage
|
||||
{
|
||||
ImU8 Data[8]; // Can fit any data up to ImGuiDataType_COUNT
|
||||
@ -1042,10 +1061,20 @@ struct IMGUI_API ImGuiMenuColumns
|
||||
void CalcNextTotalWidth(bool update_offsets);
|
||||
};
|
||||
|
||||
// Internal temporary state for deactivating InputText() instances.
|
||||
struct IMGUI_API ImGuiInputTextDeactivatedState
|
||||
{
|
||||
ImGuiID ID; // widget id owning the text state (which just got deactivated)
|
||||
ImVector<char> TextA; // text buffer
|
||||
|
||||
ImGuiInputTextDeactivatedState() { memset(this, 0, sizeof(*this)); }
|
||||
void ClearFreeMemory() { ID = 0; TextA.clear(); }
|
||||
};
|
||||
// Internal state of the currently focused/edited text input box
|
||||
// For a given item ID, access with ImGui::GetInputTextState()
|
||||
struct IMGUI_API ImGuiInputTextState
|
||||
{
|
||||
ImGuiContext* Ctx; // parent UI context (needs to be set explicitly by parent).
|
||||
ImGuiID ID; // widget id owning the text state
|
||||
int CurLenW, CurLenA; // we need to maintain our buffer length in both UTF-8 and wchar format. UTF-8 length is valid even if TextA is not.
|
||||
ImVector<ImWchar> TextW; // edit buffer, we need to persist but can't guarantee the persistence of the user-provided buffer. so we copy into own buffer.
|
||||
@ -1175,8 +1204,8 @@ struct IMGUI_API ImGuiStackSizes
|
||||
short SizeOfDisabledStack;
|
||||
|
||||
ImGuiStackSizes() { memset(this, 0, sizeof(*this)); }
|
||||
void SetToCurrentState();
|
||||
void CompareWithCurrentState();
|
||||
void SetToContextState(ImGuiContext* ctx);
|
||||
void CompareWithContextState(ImGuiContext* ctx);
|
||||
};
|
||||
|
||||
// Data saved for each window pushed into the stack
|
||||
@ -1207,6 +1236,7 @@ struct ImGuiPtrOrIndex
|
||||
// [SECTION] Inputs support
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Bit array for named keys
|
||||
typedef ImBitArray<ImGuiKey_NamedKey_COUNT, -ImGuiKey_NamedKey_BEGIN> ImBitArrayForNamedKeys;
|
||||
|
||||
// [Internal] Key ranges
|
||||
@ -1246,19 +1276,18 @@ enum ImGuiInputEventType
|
||||
enum ImGuiInputSource
|
||||
{
|
||||
ImGuiInputSource_None = 0,
|
||||
ImGuiInputSource_Mouse,
|
||||
ImGuiInputSource_Mouse, // Note: may be Mouse or TouchScreen or Pen. See io.MouseSource to distinguish them.
|
||||
ImGuiInputSource_Keyboard,
|
||||
ImGuiInputSource_Gamepad,
|
||||
ImGuiInputSource_Clipboard, // Currently only used by InputText()
|
||||
ImGuiInputSource_Nav, // Stored in g.ActiveIdSource only
|
||||
ImGuiInputSource_COUNT
|
||||
};
|
||||
|
||||
// FIXME: Structures in the union below need to be declared as anonymous unions appears to be an extension?
|
||||
// Using ImVec2() would fail on Clang 'union member 'MousePos' has a non-trivial default constructor'
|
||||
struct ImGuiInputEventMousePos { float PosX, PosY; };
|
||||
struct ImGuiInputEventMouseWheel { float WheelX, WheelY; };
|
||||
struct ImGuiInputEventMouseButton { int Button; bool Down; };
|
||||
struct ImGuiInputEventMousePos { float PosX, PosY; ImGuiMouseSource MouseSource; };
|
||||
struct ImGuiInputEventMouseWheel { float WheelX, WheelY; ImGuiMouseSource MouseSource; };
|
||||
struct ImGuiInputEventMouseButton { int Button; bool Down; ImGuiMouseSource MouseSource; };
|
||||
struct ImGuiInputEventKey { ImGuiKey Key; bool Down; float AnalogValue; };
|
||||
struct ImGuiInputEventText { unsigned int Char; };
|
||||
struct ImGuiInputEventAppFocused { bool Focused; };
|
||||
@ -1267,6 +1296,7 @@ struct ImGuiInputEvent
|
||||
{
|
||||
ImGuiInputEventType Type;
|
||||
ImGuiInputSource Source;
|
||||
ImU32 EventId; // Unique, sequential increasing integer to identify an event (if you need to correlate them to other data).
|
||||
union
|
||||
{
|
||||
ImGuiInputEventMousePos MousePos; // if Type == ImGuiInputEventType_MousePos
|
||||
@ -1291,7 +1321,7 @@ typedef ImS16 ImGuiKeyRoutingIndex;
|
||||
struct ImGuiKeyRoutingData
|
||||
{
|
||||
ImGuiKeyRoutingIndex NextEntryIndex;
|
||||
ImU16 Mods; // Technically we'd only need 4 bits but for simplify we store ImGuiMod_ values which need 16 bits.
|
||||
ImU16 Mods; // Technically we'd only need 4-bits but for simplify we store ImGuiMod_ values which need 16-bits. ImGuiMod_Shortcut is already translated to Ctrl/Super.
|
||||
ImU8 RoutingNextScore; // Lower is better (0: perfect score)
|
||||
ImGuiID RoutingCurr;
|
||||
ImGuiID RoutingNext;
|
||||
@ -1407,8 +1437,8 @@ struct ImGuiListClipperData
|
||||
enum ImGuiActivateFlags_
|
||||
{
|
||||
ImGuiActivateFlags_None = 0,
|
||||
ImGuiActivateFlags_PreferInput = 1 << 0, // Favor activation that requires keyboard text input (e.g. for Slider/Drag). Default if keyboard is available.
|
||||
ImGuiActivateFlags_PreferTweak = 1 << 1, // Favor activation for tweaking with arrows or gamepad (e.g. for Slider/Drag). Default if keyboard is not available.
|
||||
ImGuiActivateFlags_PreferInput = 1 << 0, // Favor activation that requires keyboard text input (e.g. for Slider/Drag). Default for Enter key.
|
||||
ImGuiActivateFlags_PreferTweak = 1 << 1, // Favor activation for tweaking with arrows or gamepad (e.g. for Slider/Drag). Default for Space key and if keyboard is not used.
|
||||
ImGuiActivateFlags_TryToPreserveState = 1 << 2, // Request widget to preserve state if it can (e.g. InputText will try to preserve cursor/selection)
|
||||
};
|
||||
|
||||
@ -1443,6 +1473,7 @@ enum ImGuiNavMoveFlags_
|
||||
ImGuiNavMoveFlags_LoopY = 1 << 1,
|
||||
ImGuiNavMoveFlags_WrapX = 1 << 2, // On failed request, request from opposite side one line down (when NavDir==right) or one line up (when NavDir==left)
|
||||
ImGuiNavMoveFlags_WrapY = 1 << 3, // This is not super useful but provided for completeness
|
||||
ImGuiNavMoveFlags_WrapMask_ = ImGuiNavMoveFlags_LoopX | ImGuiNavMoveFlags_LoopY | ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_WrapY,
|
||||
ImGuiNavMoveFlags_AllowCurrentNavId = 1 << 4, // Allow scoring and considering the current NavId as a move target candidate. This is used when the move source is offset (e.g. pressing PageDown actually needs to send a Up move request, if we are pressing PageDown from the bottom-most item we need to stay in place)
|
||||
ImGuiNavMoveFlags_AlsoScoreVisibleSet = 1 << 5, // Store alternate result in NavMoveResultLocalVisible that only comprise elements that are already fully visible (used by PageUp/PageDown)
|
||||
ImGuiNavMoveFlags_ScrollToEdgeY = 1 << 6, // Force scrolling to min/max (used by Home/End) // FIXME-NAV: Aim to remove or reword, probably unnecessary
|
||||
@ -1594,6 +1625,7 @@ struct ImGuiWindowSettings
|
||||
ImVec2ih Size;
|
||||
bool Collapsed;
|
||||
bool WantApply; // Set when loaded from .ini data (to enable merging/loading .ini data into an already running context)
|
||||
bool WantDelete; // Set to invalidate/delete the settings entry
|
||||
|
||||
ImGuiWindowSettings() { memset(this, 0, sizeof(*this)); }
|
||||
char* GetName() { return (char*)(this + 1); }
|
||||
@ -1651,30 +1683,24 @@ enum ImGuiDebugLogFlags_
|
||||
ImGuiDebugLogFlags_EventPopup = 1 << 2,
|
||||
ImGuiDebugLogFlags_EventNav = 1 << 3,
|
||||
ImGuiDebugLogFlags_EventClipper = 1 << 4,
|
||||
ImGuiDebugLogFlags_EventIO = 1 << 5,
|
||||
ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventIO,
|
||||
ImGuiDebugLogFlags_EventSelection = 1 << 5,
|
||||
ImGuiDebugLogFlags_EventIO = 1 << 6,
|
||||
ImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventSelection | ImGuiDebugLogFlags_EventIO,
|
||||
ImGuiDebugLogFlags_OutputToTTY = 1 << 10, // Also send output to TTY
|
||||
};
|
||||
|
||||
struct ImGuiMetricsConfig
|
||||
{
|
||||
bool ShowDebugLog;
|
||||
bool ShowStackTool;
|
||||
bool ShowWindowsRects;
|
||||
bool ShowWindowsBeginOrder;
|
||||
bool ShowTablesRects;
|
||||
bool ShowDrawCmdMesh;
|
||||
bool ShowDrawCmdBoundingBoxes;
|
||||
int ShowWindowsRectsType;
|
||||
int ShowTablesRectsType;
|
||||
|
||||
ImGuiMetricsConfig()
|
||||
{
|
||||
ShowDebugLog = ShowStackTool = ShowWindowsRects = ShowWindowsBeginOrder = ShowTablesRects = false;
|
||||
ShowDrawCmdMesh = true;
|
||||
ShowDrawCmdBoundingBoxes = true;
|
||||
ShowWindowsRectsType = ShowTablesRectsType = -1;
|
||||
}
|
||||
bool ShowDebugLog = false;
|
||||
bool ShowStackTool = false;
|
||||
bool ShowWindowsRects = false;
|
||||
bool ShowWindowsBeginOrder = false;
|
||||
bool ShowTablesRects = false;
|
||||
bool ShowDrawCmdMesh = true;
|
||||
bool ShowDrawCmdBoundingBoxes = true;
|
||||
bool ShowAtlasTintedWithTextColor = false;
|
||||
int ShowWindowsRectsType = -1;
|
||||
int ShowTablesRectsType = -1;
|
||||
};
|
||||
|
||||
struct ImGuiStackLevelInfo
|
||||
@ -1728,8 +1754,6 @@ struct ImGuiContext
|
||||
bool Initialized;
|
||||
bool FontAtlasOwnedByContext; // IO.Fonts-> is owned by the ImGuiContext and will be destructed along with it.
|
||||
ImGuiIO IO;
|
||||
ImVector<ImGuiInputEvent> InputEventsQueue; // Input events which will be tricked/written into IO structure.
|
||||
ImVector<ImGuiInputEvent> InputEventsTrail; // Past input events processed in NewFrame(). This is to allow domain-specific application to access e.g mouse/pen trail.
|
||||
ImGuiStyle Style;
|
||||
ImFont* Font; // (Shortcut) == FontStack.empty() ? IO.Font : FontStack.back()
|
||||
float FontSize; // (Shortcut) == FontBaseSize * g.CurrentWindow->FontWindowScale == window->FontSize(). Text height for current window.
|
||||
@ -1746,6 +1770,12 @@ struct ImGuiContext
|
||||
bool TestEngineHookItems; // Will call test engine hooks: ImGuiTestEngineHook_ItemAdd(), ImGuiTestEngineHook_ItemInfo(), ImGuiTestEngineHook_Log()
|
||||
void* TestEngine; // Test engine user data
|
||||
|
||||
// Inputs
|
||||
ImVector<ImGuiInputEvent> InputEventsQueue; // Input events which will be trickled/written into IO structure.
|
||||
ImVector<ImGuiInputEvent> InputEventsTrail; // Past input events processed in NewFrame(). This is to allow domain-specific application to access e.g mouse/pen trail.
|
||||
ImGuiMouseSource InputEventsNextMouseSource;
|
||||
ImU32 InputEventsNextEventId;
|
||||
|
||||
// Windows state
|
||||
ImVector<ImGuiWindow*> Windows; // Windows, sorted in display order, back to front
|
||||
ImVector<ImGuiWindow*> WindowsFocusOrder; // Root windows, sorted in focus order, back to front.
|
||||
@ -1760,7 +1790,10 @@ struct ImGuiContext
|
||||
ImGuiWindow* MovingWindow; // Track the window we clicked on (in order to preserve focus). The actual window that is moved is generally MovingWindow->RootWindow.
|
||||
ImGuiWindow* WheelingWindow; // Track the window we started mouse-wheeling on. Until a timer elapse or mouse has moved, generally keep scrolling the same window even if during the course of scrolling the mouse ends up hovering a child window.
|
||||
ImVec2 WheelingWindowRefMousePos;
|
||||
int WheelingWindowStartFrame; // This may be set one frame before WheelingWindow is != NULL
|
||||
float WheelingWindowReleaseTimer;
|
||||
ImVec2 WheelingWindowWheelRemainder;
|
||||
ImVec2 WheelingAxisAvg;
|
||||
|
||||
// Item/widgets state and tracking information
|
||||
ImGuiID DebugHookIdInfo; // Will call core hooks: DebugHookIdInfo() from GetID functions, used by Stack Tool [next HoveredId/ActiveId to not pull in an extra cache-line]
|
||||
@ -1781,7 +1814,7 @@ struct ImGuiContext
|
||||
bool ActiveIdHasBeenEditedThisFrame;
|
||||
ImVec2 ActiveIdClickOffset; // Clicked offset from upper-left corner, if applicable (currently only set by ButtonBehavior)
|
||||
ImGuiWindow* ActiveIdWindow;
|
||||
ImGuiInputSource ActiveIdSource; // Activating with mouse or nav (gamepad/keyboard)
|
||||
ImGuiInputSource ActiveIdSource; // Activating source: ImGuiInputSource_Mouse OR ImGuiInputSource_Keyboard OR ImGuiInputSource_Gamepad
|
||||
int ActiveIdMouseButton;
|
||||
ImGuiID ActiveIdPreviousFrame;
|
||||
bool ActiveIdPreviousFrameIsAlive;
|
||||
@ -1828,17 +1861,16 @@ struct ImGuiContext
|
||||
ImGuiWindow* NavWindow; // Focused window for navigation. Could be called 'FocusedWindow'
|
||||
ImGuiID NavId; // Focused item for navigation
|
||||
ImGuiID NavFocusScopeId; // Identify a selection scope (selection code often wants to "clear other items" when landing on an item of the selection set)
|
||||
ImGuiID NavActivateId; // ~~ (g.ActiveId == 0) && (IsKeyPressed(ImGuiKey_Space) || IsKeyPressed(ImGuiKey_NavGamepadActivate)) ? NavId : 0, also set when calling ActivateItem()
|
||||
ImGuiID NavActivateDownId; // ~~ IsKeyDown(ImGuiKey_Space) || IsKeyDown(ImGuiKey_NavGamepadActivate) ? NavId : 0
|
||||
ImGuiID NavActivatePressedId; // ~~ IsKeyPressed(ImGuiKey_Space) || IsKeyPressed(ImGuiKey_NavGamepadActivate) ? NavId : 0 (no repeat)
|
||||
ImGuiID NavActivateInputId; // ~~ IsKeyPressed(ImGuiKey_Enter) || IsKeyPressed(ImGuiKey_NavGamepadInput) ? NavId : 0; ImGuiActivateFlags_PreferInput will be set and NavActivateId will be 0.
|
||||
ImGuiID NavActivateId; // ~~ (g.ActiveId == 0) && (IsKeyPressed(ImGuiKey_Space) || IsKeyDown(ImGuiKey_Enter) || IsKeyPressed(ImGuiKey_NavGamepadActivate)) ? NavId : 0, also set when calling ActivateItem()
|
||||
ImGuiID NavActivateDownId; // ~~ IsKeyDown(ImGuiKey_Space) || IsKeyDown(ImGuiKey_Enter) || IsKeyDown(ImGuiKey_NavGamepadActivate) ? NavId : 0
|
||||
ImGuiID NavActivatePressedId; // ~~ IsKeyPressed(ImGuiKey_Space) || IsKeyPressed(ImGuiKey_Enter) || IsKeyPressed(ImGuiKey_NavGamepadActivate) ? NavId : 0 (no repeat)
|
||||
ImGuiActivateFlags NavActivateFlags;
|
||||
ImGuiID NavJustMovedToId; // Just navigated to this id (result of a successfully MoveRequest).
|
||||
ImGuiID NavJustMovedToFocusScopeId; // Just navigated to this focus scope id (result of a successfully MoveRequest).
|
||||
ImGuiKeyChord NavJustMovedToKeyMods;
|
||||
ImGuiID NavNextActivateId; // Set by ActivateItem(), queued until next frame.
|
||||
ImGuiActivateFlags NavNextActivateFlags;
|
||||
ImGuiInputSource NavInputSource; // Keyboard or Gamepad mode? THIS WILL ONLY BE None or NavGamepad or NavKeyboard.
|
||||
ImGuiInputSource NavInputSource; // Keyboard or Gamepad mode? THIS CAN ONLY BE ImGuiInputSource_Keyboard or ImGuiInputSource_Mouse
|
||||
ImGuiNavLayer NavLayer; // Layer we are navigating on. For now the system is hard-coded for 0=main contents and 1=menu/title bar, may expose layers later.
|
||||
bool NavIdIsAlive; // Nav widget has been seen this frame ~~ NavRectRel is valid
|
||||
bool NavMousePosDirty; // When set we will update mouse position if (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) if set (NB: this not enabled by default)
|
||||
@ -1932,12 +1964,15 @@ struct ImGuiContext
|
||||
// Widget state
|
||||
ImVec2 MouseLastValidPos;
|
||||
ImGuiInputTextState InputTextState;
|
||||
ImGuiInputTextDeactivatedState InputTextDeactivatedState;
|
||||
ImFont InputTextPasswordFont;
|
||||
ImGuiID TempInputId; // Temporary text input when CTRL+clicking on a slider, etc.
|
||||
ImGuiColorEditFlags ColorEditOptions; // Store user options for color edit widgets
|
||||
float ColorEditLastHue; // Backup of last Hue associated to LastColor, so we can restore Hue in lossy RGB<>HSV round trips
|
||||
float ColorEditLastSat; // Backup of last Saturation associated to LastColor, so we can restore Saturation in lossy RGB<>HSV round trips
|
||||
ImU32 ColorEditLastColor; // RGB value with alpha set to 0.
|
||||
ImGuiID ColorEditCurrentID; // Set temporarily while inside of the parent-most ColorEdit4/ColorPicker4 (because they call each others).
|
||||
ImGuiID ColorEditSavedID; // ID we are saving/restoring HS for
|
||||
float ColorEditSavedHue; // Backup of last Hue associated to LastColor, so we can restore Hue in lossy RGB<>HSV round trips
|
||||
float ColorEditSavedSat; // Backup of last Saturation associated to LastColor, so we can restore Saturation in lossy RGB<>HSV round trips
|
||||
ImU32 ColorEditSavedColor; // RGB value with alpha set to 0.
|
||||
ImVec4 ColorPickerRef; // Initial/reference color at the time of opening the color picker.
|
||||
ImGuiComboPreviewData ComboPreviewData;
|
||||
float SliderGrabClickOffset;
|
||||
@ -1988,7 +2023,9 @@ struct ImGuiContext
|
||||
ImGuiDebugLogFlags DebugLogFlags;
|
||||
ImGuiTextBuffer DebugLogBuf;
|
||||
ImGuiTextIndex DebugLogIndex;
|
||||
ImU8 DebugLogClipperAutoDisableFrames;
|
||||
ImU8 DebugLocateFrames; // For DebugLocateItemOnHover(). This is used together with DebugLocateId which is in a hot/cached spot above.
|
||||
ImS8 DebugBeginReturnValueCullDepth; // Cycle between 0..9 then wrap around.
|
||||
bool DebugItemPickerActive; // Item picker is active (started with DebugStartItemPicker())
|
||||
ImU8 DebugItemPickerMouseButton;
|
||||
ImGuiID DebugItemPickerBreakId; // Will call IM_DEBUG_BREAK() when encountering this ID
|
||||
@ -2007,6 +2044,9 @@ struct ImGuiContext
|
||||
|
||||
ImGuiContext(ImFontAtlas* shared_font_atlas)
|
||||
{
|
||||
IO.Ctx = this;
|
||||
InputTextState.Ctx = this;
|
||||
|
||||
Initialized = false;
|
||||
FontAtlasOwnedByContext = shared_font_atlas ? false : true;
|
||||
Font = NULL;
|
||||
@ -2020,12 +2060,16 @@ struct ImGuiContext
|
||||
TestEngineHookItems = false;
|
||||
TestEngine = NULL;
|
||||
|
||||
InputEventsNextMouseSource = ImGuiMouseSource_Mouse;
|
||||
InputEventsNextEventId = 1;
|
||||
|
||||
WindowsActiveCount = 0;
|
||||
CurrentWindow = NULL;
|
||||
HoveredWindow = NULL;
|
||||
HoveredWindowUnderMovingWindow = NULL;
|
||||
MovingWindow = NULL;
|
||||
WheelingWindow = NULL;
|
||||
WheelingWindowStartFrame = -1;
|
||||
WheelingWindowReleaseTimer = 0.0f;
|
||||
|
||||
DebugHookIdInfo = 0;
|
||||
@ -2064,11 +2108,11 @@ struct ImGuiContext
|
||||
BeginMenuCount = 0;
|
||||
|
||||
NavWindow = NULL;
|
||||
NavId = NavFocusScopeId = NavActivateId = NavActivateDownId = NavActivatePressedId = NavActivateInputId = 0;
|
||||
NavId = NavFocusScopeId = NavActivateId = NavActivateDownId = NavActivatePressedId = 0;
|
||||
NavJustMovedToId = NavJustMovedToFocusScopeId = NavNextActivateId = 0;
|
||||
NavActivateFlags = NavNextActivateFlags = ImGuiActivateFlags_None;
|
||||
NavJustMovedToKeyMods = ImGuiMod_None;
|
||||
NavInputSource = ImGuiInputSource_None;
|
||||
NavInputSource = ImGuiInputSource_Keyboard;
|
||||
NavLayer = ImGuiNavLayer_Main;
|
||||
NavIdIsAlive = false;
|
||||
NavMousePosDirty = false;
|
||||
@ -2121,8 +2165,9 @@ struct ImGuiContext
|
||||
|
||||
TempInputId = 0;
|
||||
ColorEditOptions = ImGuiColorEditFlags_DefaultOptions_;
|
||||
ColorEditLastHue = ColorEditLastSat = 0.0f;
|
||||
ColorEditLastColor = 0;
|
||||
ColorEditCurrentID = ColorEditSavedID = 0;
|
||||
ColorEditSavedHue = ColorEditSavedSat = 0.0f;
|
||||
ColorEditSavedColor = 0;
|
||||
SliderGrabClickOffset = 0.0f;
|
||||
SliderCurrentAccum = 0.0f;
|
||||
SliderCurrentAccumDirty = false;
|
||||
@ -2155,7 +2200,9 @@ struct ImGuiContext
|
||||
|
||||
DebugLogFlags = ImGuiDebugLogFlags_OutputToTTY;
|
||||
DebugLocateId = 0;
|
||||
DebugLogClipperAutoDisableFrames = 0;
|
||||
DebugLocateFrames = 0;
|
||||
DebugBeginReturnValueCullDepth = -1;
|
||||
DebugItemPickerActive = false;
|
||||
DebugItemPickerMouseButton = ImGuiMouseButton_Left;
|
||||
DebugItemPickerBreakId = 0;
|
||||
@ -2191,14 +2238,15 @@ struct IMGUI_API ImGuiWindowTempData
|
||||
ImVec1 Indent; // Indentation / start position from left of window (increased by TreePush/TreePop, etc.)
|
||||
ImVec1 ColumnsOffset; // Offset to the current column (if ColumnsCurrent > 0). FIXME: This and the above should be a stack to allow use cases like Tree->Column->Tree. Need revamp columns API.
|
||||
ImVec1 GroupOffset;
|
||||
ImVec2 CursorStartPosLossyness;// Record the loss of precision of CursorStartPos due to really large scrolling amount. This is used by clipper to compensentate and fix the most common use case of large scroll area.
|
||||
ImVec2 CursorStartPosLossyness;// Record the loss of precision of CursorStartPos due to really large scrolling amount. This is used by clipper to compensate and fix the most common use case of large scroll area.
|
||||
|
||||
// Keyboard/Gamepad navigation
|
||||
ImGuiNavLayer NavLayerCurrent; // Current layer, 0..31 (we currently only use 0..1)
|
||||
short NavLayersActiveMask; // Which layers have been written to (result from previous frame)
|
||||
short NavLayersActiveMaskNext;// Which layers have been written to (accumulator for current frame)
|
||||
bool NavIsScrollPushableX; // Set when current work location may be scrolled horizontally when moving left / right. This is generally always true UNLESS within a column.
|
||||
bool NavHideHighlightOneFrame;
|
||||
bool NavHasScroll; // Set when scrolling can be used (ScrollMax > 0.0f)
|
||||
bool NavWindowHasScrollY; // Set per window when scrolling can be used (== ScrollMax.y > 0.0f)
|
||||
|
||||
// Miscellaneous
|
||||
bool MenuBarAppending; // FIXME: Remove this
|
||||
@ -2224,6 +2272,7 @@ struct IMGUI_API ImGuiWindowTempData
|
||||
// Storage for one window
|
||||
struct IMGUI_API ImGuiWindow
|
||||
{
|
||||
ImGuiContext* Ctx; // Parent UI context (needs to be set explicitly by parent).
|
||||
char* Name; // Window name, owned by the window.
|
||||
ImGuiID ID; // == ImHashStr(Name)
|
||||
ImGuiWindowFlags Flags; // See enum ImGuiWindowFlags_
|
||||
@ -2237,6 +2286,9 @@ struct IMGUI_API ImGuiWindow
|
||||
ImVec2 WindowPadding; // Window padding at the time of Begin().
|
||||
float WindowRounding; // Window rounding at the time of Begin(). May be clamped lower to avoid rendering artifacts with title bar, menu bar etc.
|
||||
float WindowBorderSize; // Window border size at the time of Begin().
|
||||
float DecoOuterSizeX1, DecoOuterSizeY1; // Left/Up offsets. Sum of non-scrolling outer decorations (X1 generally == 0.0f. Y1 generally = TitleBarHeight + MenuBarHeight). Locked during Begin().
|
||||
float DecoOuterSizeX2, DecoOuterSizeY2; // Right/Down offsets (X2 generally == ScrollbarSize.x, Y2 == ScrollbarSizes.y).
|
||||
float DecoInnerSizeX1, DecoInnerSizeY1; // Applied AFTER/OVER InnerRect. Specialized for Tables as they use specialized form of clipping and frozen rows/columns are inside InnerRect (and not part of regular decoration sizes).
|
||||
int NameBufLen; // Size of buffer storing Name. May be larger than strlen(Name)!
|
||||
ImGuiID MoveId; // == window->GetID("#MOVE")
|
||||
ImGuiID ChildId; // ID of corresponding item in parent window (for navigation to return from child window to parent window)
|
||||
@ -2331,10 +2383,10 @@ public:
|
||||
|
||||
// We don't use g.FontSize because the window may be != g.CurrentWindow.
|
||||
ImRect Rect() const { return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
|
||||
float CalcFontSize() const { ImGuiContext& g = *GImGui; float scale = g.FontBaseSize * FontWindowScale; if (ParentWindow) scale *= ParentWindow->FontWindowScale; return scale; }
|
||||
float TitleBarHeight() const { ImGuiContext& g = *GImGui; return (Flags & ImGuiWindowFlags_NoTitleBar) ? 0.0f : CalcFontSize() + g.Style.FramePadding.y * 2.0f; }
|
||||
float CalcFontSize() const { ImGuiContext& g = *Ctx; float scale = g.FontBaseSize * FontWindowScale; if (ParentWindow) scale *= ParentWindow->FontWindowScale; return scale; }
|
||||
float TitleBarHeight() const { ImGuiContext& g = *Ctx; return (Flags & ImGuiWindowFlags_NoTitleBar) ? 0.0f : CalcFontSize() + g.Style.FramePadding.y * 2.0f; }
|
||||
ImRect TitleBarRect() const { return ImRect(Pos, ImVec2(Pos.x + SizeFull.x, Pos.y + TitleBarHeight())); }
|
||||
float MenuBarHeight() const { ImGuiContext& g = *GImGui; return (Flags & ImGuiWindowFlags_MenuBar) ? DC.MenuBarOffset.y + CalcFontSize() + g.Style.FramePadding.y * 2.0f : 0.0f; }
|
||||
float MenuBarHeight() const { ImGuiContext& g = *Ctx; return (Flags & ImGuiWindowFlags_MenuBar) ? DC.MenuBarOffset.y + CalcFontSize() + g.Style.FramePadding.y * 2.0f : 0.0f; }
|
||||
ImRect MenuBarRect() const { float y1 = Pos.y + TitleBarHeight(); return ImRect(Pos.x, y1, Pos.x + SizeFull.x, y1 + MenuBarHeight()); }
|
||||
};
|
||||
|
||||
@ -2371,7 +2423,7 @@ struct ImGuiTabItem
|
||||
float RequestedWidth; // Width optionally requested by caller, -1.0f is unused
|
||||
ImS32 NameOffset; // When Window==NULL, offset to name within parent ImGuiTabBar::TabsNames
|
||||
ImS16 BeginOrder; // BeginTabItem() order, used to re-order tabs after toggling ImGuiTabBarFlags_Reorderable
|
||||
ImS16 IndexDuringLayout; // Index only used during TabBarLayout()
|
||||
ImS16 IndexDuringLayout; // Index only used during TabBarLayout(). Tabs gets reordered so 'Tabs[n].IndexDuringLayout == n' but may mismatch during additions.
|
||||
bool WantClose; // Marked as closed by SetTabItemClosed()
|
||||
|
||||
ImGuiTabItem() { memset(this, 0, sizeof(*this)); LastFrameVisible = LastFrameSelected = -1; RequestedWidth = -1.0f; NameOffset = -1; BeginOrder = IndexDuringLayout = -1; }
|
||||
@ -2413,12 +2465,6 @@ struct IMGUI_API ImGuiTabBar
|
||||
ImGuiTextBuffer TabsNames; // For non-docking tab bar we re-append names in a contiguous buffer.
|
||||
|
||||
ImGuiTabBar();
|
||||
int GetTabOrder(const ImGuiTabItem* tab) const { return Tabs.index_from_ptr(tab); }
|
||||
const char* GetTabName(const ImGuiTabItem* tab) const
|
||||
{
|
||||
IM_ASSERT(tab->NameOffset != -1 && tab->NameOffset < TabsNames.Buf.Size);
|
||||
return TabsNames.Buf.Data + tab->NameOffset;
|
||||
}
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -2426,12 +2472,11 @@ struct IMGUI_API ImGuiTabBar
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#define IM_COL32_DISABLE IM_COL32(0,0,0,1) // Special sentinel code which cannot be used as a regular color.
|
||||
#define IMGUI_TABLE_MAX_COLUMNS 64 // sizeof(ImU64) * 8. This is solely because we frequently encode columns set in a ImU64.
|
||||
#define IMGUI_TABLE_MAX_DRAW_CHANNELS (4 + 64 * 2) // See TableSetupDrawChannels()
|
||||
#define IMGUI_TABLE_MAX_COLUMNS 512 // May be further lifted
|
||||
|
||||
// Our current column maximum is 64 but we may raise that in the future.
|
||||
typedef ImS8 ImGuiTableColumnIdx;
|
||||
typedef ImU8 ImGuiTableDrawChannelIdx;
|
||||
typedef ImS16 ImGuiTableColumnIdx;
|
||||
typedef ImU16 ImGuiTableDrawChannelIdx;
|
||||
|
||||
// [Internal] sizeof() ~ 104
|
||||
// We use the terminology "Enabled" to refer to a column that is not Hidden by user/api.
|
||||
@ -2502,16 +2547,18 @@ struct ImGuiTableCellData
|
||||
ImGuiTableColumnIdx Column; // Column number
|
||||
};
|
||||
|
||||
// Per-instance data that needs preserving across frames (seemingly most others do not need to be preserved aside from debug needs, does that needs they could be moved to ImGuiTableTempData ?)
|
||||
// Per-instance data that needs preserving across frames (seemingly most others do not need to be preserved aside from debug needs. Does that means they could be moved to ImGuiTableTempData?)
|
||||
struct ImGuiTableInstanceData
|
||||
{
|
||||
float LastOuterHeight; // Outer height from last frame // FIXME: multi-instance issue (#3955)
|
||||
float LastFirstRowHeight; // Height of first row from last frame // FIXME: possible multi-instance issue?
|
||||
ImGuiID TableInstanceID;
|
||||
float LastOuterHeight; // Outer height from last frame
|
||||
float LastFirstRowHeight; // Height of first row from last frame (FIXME: this is used as "header height" and may be reworked)
|
||||
float LastFrozenHeight; // Height of frozen section from last frame
|
||||
|
||||
ImGuiTableInstanceData() { LastOuterHeight = LastFirstRowHeight = 0.0f; }
|
||||
ImGuiTableInstanceData() { TableInstanceID = 0; LastOuterHeight = LastFirstRowHeight = LastFrozenHeight = 0.0f; }
|
||||
};
|
||||
|
||||
// FIXME-TABLE: more transient data could be stored in a per-stacked table structure: DrawSplitter, SortSpecs, incoming RowData
|
||||
// FIXME-TABLE: more transient data could be stored in a stacked ImGuiTableTempData: e.g. SortSpecs, incoming RowData
|
||||
struct IMGUI_API ImGuiTable
|
||||
{
|
||||
ImGuiID ID;
|
||||
@ -2521,10 +2568,9 @@ struct IMGUI_API ImGuiTable
|
||||
ImSpan<ImGuiTableColumn> Columns; // Point within RawData[]
|
||||
ImSpan<ImGuiTableColumnIdx> DisplayOrderToIndex; // Point within RawData[]. Store display order of columns (when not reordered, the values are 0...Count-1)
|
||||
ImSpan<ImGuiTableCellData> RowCellData; // Point within RawData[]. Store cells background requests for current row.
|
||||
ImU64 EnabledMaskByDisplayOrder; // Column DisplayOrder -> IsEnabled map
|
||||
ImU64 EnabledMaskByIndex; // Column Index -> IsEnabled map (== not hidden by user/api) in a format adequate for iterating column without touching cold data
|
||||
ImU64 VisibleMaskByIndex; // Column Index -> IsVisibleX|IsVisibleY map (== not hidden by user/api && not hidden by scrolling/cliprect)
|
||||
ImU64 RequestOutputMaskByIndex; // Column Index -> IsVisible || AutoFit (== expect user to submit items)
|
||||
ImBitArrayPtr EnabledMaskByDisplayOrder; // Column DisplayOrder -> IsEnabled map
|
||||
ImBitArrayPtr EnabledMaskByIndex; // Column Index -> IsEnabled map (== not hidden by user/api) in a format adequate for iterating column without touching cold data
|
||||
ImBitArrayPtr VisibleMaskByIndex; // Column Index -> IsVisibleX|IsVisibleY map (== not hidden by user/api && not hidden by scrolling/cliprect)
|
||||
ImGuiTableFlags SettingsLoadedFlags; // Which data were loaded from the .ini file (e.g. when order is not altered we won't save order)
|
||||
int SettingsOffset; // Offset in g.SettingsTables
|
||||
int LastFrameActive;
|
||||
@ -2616,6 +2662,8 @@ struct IMGUI_API ImGuiTable
|
||||
bool IsResetDisplayOrderRequest;
|
||||
bool IsUnfrozenRows; // Set when we got past the frozen row.
|
||||
bool IsDefaultSizingPolicy; // Set if user didn't explicitly set a sizing policy in BeginTable()
|
||||
bool HasScrollbarYCurr; // Whether ANY instance of this table had a vertical scrollbar during the current frame.
|
||||
bool HasScrollbarYPrev; // Whether ANY instance of this table had a vertical scrollbar during the previous.
|
||||
bool MemoryCompacted;
|
||||
bool HostSkipItems; // Backup of InnerWindow->SkipItem at the end of BeginTable(), because we will overwrite InnerWindow->SkipItem on a per-column basis
|
||||
|
||||
@ -2710,12 +2758,13 @@ namespace ImGui
|
||||
IMGUI_API void SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiCond cond = 0);
|
||||
IMGUI_API void SetWindowCollapsed(ImGuiWindow* window, bool collapsed, ImGuiCond cond = 0);
|
||||
IMGUI_API void SetWindowHitTestHole(ImGuiWindow* window, const ImVec2& pos, const ImVec2& size);
|
||||
IMGUI_API void SetWindowHiddendAndSkipItemsForCurrentFrame(ImGuiWindow* window);
|
||||
inline ImRect WindowRectAbsToRel(ImGuiWindow* window, const ImRect& r) { ImVec2 off = window->DC.CursorStartPos; return ImRect(r.Min.x - off.x, r.Min.y - off.y, r.Max.x - off.x, r.Max.y - off.y); }
|
||||
inline ImRect WindowRectRelToAbs(ImGuiWindow* window, const ImRect& r) { ImVec2 off = window->DC.CursorStartPos; return ImRect(r.Min.x + off.x, r.Min.y + off.y, r.Max.x + off.x, r.Max.y + off.y); }
|
||||
|
||||
// Windows: Display Order and Focus Order
|
||||
IMGUI_API void FocusWindow(ImGuiWindow* window);
|
||||
IMGUI_API void FocusTopMostWindowUnderOne(ImGuiWindow* under_this_window, ImGuiWindow* ignore_window);
|
||||
IMGUI_API void FocusWindow(ImGuiWindow* window, ImGuiFocusRequestFlags flags = 0);
|
||||
IMGUI_API void FocusTopMostWindowUnderOne(ImGuiWindow* under_this_window, ImGuiWindow* ignore_window, ImGuiViewport* filter_viewport, ImGuiFocusRequestFlags flags);
|
||||
IMGUI_API void BringWindowToFocusFront(ImGuiWindow* window);
|
||||
IMGUI_API void BringWindowToDisplayFront(ImGuiWindow* window);
|
||||
IMGUI_API void BringWindowToDisplayBack(ImGuiWindow* window);
|
||||
@ -2753,13 +2802,16 @@ namespace ImGui
|
||||
IMGUI_API void MarkIniSettingsDirty();
|
||||
IMGUI_API void MarkIniSettingsDirty(ImGuiWindow* window);
|
||||
IMGUI_API void ClearIniSettings();
|
||||
IMGUI_API ImGuiWindowSettings* CreateNewWindowSettings(const char* name);
|
||||
IMGUI_API ImGuiWindowSettings* FindWindowSettings(ImGuiID id);
|
||||
IMGUI_API ImGuiWindowSettings* FindOrCreateWindowSettings(const char* name);
|
||||
IMGUI_API void AddSettingsHandler(const ImGuiSettingsHandler* handler);
|
||||
IMGUI_API void RemoveSettingsHandler(const char* type_name);
|
||||
IMGUI_API ImGuiSettingsHandler* FindSettingsHandler(const char* type_name);
|
||||
|
||||
// Settings - Windows
|
||||
IMGUI_API ImGuiWindowSettings* CreateNewWindowSettings(const char* name);
|
||||
IMGUI_API ImGuiWindowSettings* FindWindowSettingsByID(ImGuiID id);
|
||||
IMGUI_API ImGuiWindowSettings* FindWindowSettingsByWindow(ImGuiWindow* window);
|
||||
IMGUI_API void ClearWindowSettings(const char* name);
|
||||
|
||||
// Localization
|
||||
IMGUI_API void LocalizeRegisterEntries(const ImGuiLocEntry* entries, int count);
|
||||
inline const char* LocalizeGetMsg(ImGuiLocKey key) { ImGuiContext& g = *GImGui; const char* msg = g.LocalizationTable[key]; return msg ? msg : "*Missing Text*"; }
|
||||
@ -2779,7 +2831,6 @@ namespace ImGui
|
||||
//#endif
|
||||
|
||||
// Basic Accessors
|
||||
inline ImGuiID GetItemID() { ImGuiContext& g = *GImGui; return g.LastItemData.ID; } // Get ID of last item (~~ often same ImGui::GetID(label) beforehand)
|
||||
inline ImGuiItemStatusFlags GetItemStatusFlags(){ ImGuiContext& g = *GImGui; return g.LastItemData.StatusFlags; }
|
||||
inline ImGuiItemFlags GetItemFlags() { ImGuiContext& g = *GImGui; return g.LastItemData.InFlags; }
|
||||
inline ImGuiID GetActiveID() { ImGuiContext& g = *GImGui; return g.ActiveId; }
|
||||
@ -2793,12 +2844,14 @@ namespace ImGui
|
||||
IMGUI_API void MarkItemEdited(ImGuiID id); // Mark data associated to given item as "edited", used by IsItemDeactivatedAfterEdit() function.
|
||||
IMGUI_API void PushOverrideID(ImGuiID id); // Push given value as-is at the top of the ID stack (whereas PushID combines old and new hashes)
|
||||
IMGUI_API ImGuiID GetIDWithSeed(const char* str_id_begin, const char* str_id_end, ImGuiID seed);
|
||||
IMGUI_API ImGuiID GetIDWithSeed(int n, ImGuiID seed);
|
||||
|
||||
// Basic Helpers for widget code
|
||||
IMGUI_API void ItemSize(const ImVec2& size, float text_baseline_y = -1.0f);
|
||||
inline void ItemSize(const ImRect& bb, float text_baseline_y = -1.0f) { ItemSize(bb.GetSize(), text_baseline_y); } // FIXME: This is a misleading API since we expect CursorPos to be bb.Min.
|
||||
IMGUI_API bool ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb = NULL, ImGuiItemFlags extra_flags = 0);
|
||||
IMGUI_API bool ItemHoverable(const ImRect& bb, ImGuiID id);
|
||||
IMGUI_API bool IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFlags flags = 0);
|
||||
IMGUI_API bool IsClippedEx(const ImRect& bb, ImGuiID id);
|
||||
IMGUI_API void SetLastItemData(ImGuiID item_id, ImGuiItemFlags in_flags, ImGuiItemStatusFlags status_flags, const ImRect& item_rect);
|
||||
IMGUI_API ImVec2 CalcItemSize(ImVec2 size, float default_w, float default_h);
|
||||
@ -2811,6 +2864,7 @@ namespace ImGui
|
||||
// Parameter stacks (shared)
|
||||
IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled);
|
||||
IMGUI_API void PopItemFlag();
|
||||
IMGUI_API const ImGuiDataVarInfo* GetStyleVarInfo(ImGuiStyleVar idx);
|
||||
|
||||
// Logging/Capture
|
||||
IMGUI_API void LogBegin(ImGuiLogType type, int auto_open_depth); // -> BeginCapture() when we design v2 api, for now stay under the radar by using the old name.
|
||||
@ -2826,10 +2880,11 @@ namespace ImGui
|
||||
IMGUI_API void ClosePopupsExceptModals();
|
||||
IMGUI_API bool IsPopupOpen(ImGuiID id, ImGuiPopupFlags popup_flags);
|
||||
IMGUI_API bool BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_flags);
|
||||
IMGUI_API void BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags);
|
||||
IMGUI_API bool BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags);
|
||||
IMGUI_API ImRect GetPopupAllowedExtentRect(ImGuiWindow* window);
|
||||
IMGUI_API ImGuiWindow* GetTopMostPopupModal();
|
||||
IMGUI_API ImGuiWindow* GetTopMostAndVisiblePopupModal();
|
||||
IMGUI_API ImGuiWindow* FindBlockingModal(ImGuiWindow* window);
|
||||
IMGUI_API ImVec2 FindBestWindowPosForPopup(ImGuiWindow* window);
|
||||
IMGUI_API ImVec2 FindBestWindowPosForPopupEx(const ImVec2& ref_pos, const ImVec2& size, ImGuiDir* last_dir, const ImRect& r_outer, const ImRect& r_avoid, ImGuiPopupPositionPolicy policy);
|
||||
|
||||
@ -2853,6 +2908,7 @@ namespace ImGui
|
||||
IMGUI_API void NavMoveRequestCancel();
|
||||
IMGUI_API void NavMoveRequestApplyResult();
|
||||
IMGUI_API void NavMoveRequestTryWrapping(ImGuiWindow* window, ImGuiNavMoveFlags move_flags);
|
||||
IMGUI_API void NavUpdateCurrentWindowIsScrollPushableX();
|
||||
IMGUI_API void ActivateItem(ImGuiID id); // Remotely activate a button, checkbox, tree node etc. given its unique ID. activation is queued and processed on the next frame when the item is encountered again.
|
||||
IMGUI_API void SetNavWindow(ImGuiWindow* window);
|
||||
IMGUI_API void SetNavID(ImGuiID id, ImGuiNavLayer nav_layer, ImGuiID focus_scope_id, const ImRect& rect_rel);
|
||||
@ -2860,26 +2916,30 @@ namespace ImGui
|
||||
// Inputs
|
||||
// FIXME: Eventually we should aim to move e.g. IsActiveIdUsingKey() into IsKeyXXX functions.
|
||||
inline bool IsNamedKey(ImGuiKey key) { return key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END; }
|
||||
inline bool IsNamedKeyOrModKey(ImGuiKey key) { return (key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END) || key == ImGuiMod_Ctrl || key == ImGuiMod_Shift || key == ImGuiMod_Alt || key == ImGuiMod_Super; }
|
||||
inline bool IsNamedKeyOrModKey(ImGuiKey key) { return (key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END) || key == ImGuiMod_Ctrl || key == ImGuiMod_Shift || key == ImGuiMod_Alt || key == ImGuiMod_Super || key == ImGuiMod_Shortcut; }
|
||||
inline bool IsLegacyKey(ImGuiKey key) { return key >= ImGuiKey_LegacyNativeKey_BEGIN && key < ImGuiKey_LegacyNativeKey_END; }
|
||||
inline bool IsKeyboardKey(ImGuiKey key) { return key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END; }
|
||||
inline bool IsGamepadKey(ImGuiKey key) { return key >= ImGuiKey_Gamepad_BEGIN && key < ImGuiKey_Gamepad_END; }
|
||||
inline bool IsMouseKey(ImGuiKey key) { return key >= ImGuiKey_Mouse_BEGIN && key < ImGuiKey_Mouse_END; }
|
||||
inline bool IsAliasKey(ImGuiKey key) { return key >= ImGuiKey_Aliases_BEGIN && key < ImGuiKey_Aliases_END; }
|
||||
inline ImGuiKey ConvertSingleModFlagToKey(ImGuiKey key)
|
||||
inline ImGuiKeyChord ConvertShortcutMod(ImGuiKeyChord key_chord) { ImGuiContext& g = *GImGui; IM_ASSERT_PARANOID(key_chord & ImGuiMod_Shortcut); return (key_chord & ~ImGuiMod_Shortcut) | (g.IO.ConfigMacOSXBehaviors ? ImGuiMod_Super : ImGuiMod_Ctrl); }
|
||||
inline ImGuiKey ConvertSingleModFlagToKey(ImGuiContext* ctx, ImGuiKey key)
|
||||
{
|
||||
ImGuiContext& g = *ctx;
|
||||
if (key == ImGuiMod_Ctrl) return ImGuiKey_ReservedForModCtrl;
|
||||
if (key == ImGuiMod_Shift) return ImGuiKey_ReservedForModShift;
|
||||
if (key == ImGuiMod_Alt) return ImGuiKey_ReservedForModAlt;
|
||||
if (key == ImGuiMod_Super) return ImGuiKey_ReservedForModSuper;
|
||||
if (key == ImGuiMod_Shortcut) return (g.IO.ConfigMacOSXBehaviors ? ImGuiKey_ReservedForModSuper : ImGuiKey_ReservedForModCtrl);
|
||||
return key;
|
||||
}
|
||||
|
||||
IMGUI_API ImGuiKeyData* GetKeyData(ImGuiKey key);
|
||||
IMGUI_API ImGuiKeyData* GetKeyData(ImGuiContext* ctx, ImGuiKey key);
|
||||
inline ImGuiKeyData* GetKeyData(ImGuiKey key) { ImGuiContext& g = *GImGui; return GetKeyData(&g, key); }
|
||||
IMGUI_API void GetKeyChordName(ImGuiKeyChord key_chord, char* out_buf, int out_buf_size);
|
||||
inline ImGuiKey MouseButtonToKey(ImGuiMouseButton button) { IM_ASSERT(button >= 0 && button < ImGuiMouseButton_COUNT); return (ImGuiKey)(ImGuiKey_MouseLeft + button); }
|
||||
IMGUI_API bool IsMouseDragPastThreshold(ImGuiMouseButton button, float lock_threshold = -1.0f);
|
||||
IMGUI_API ImVec2 GetKeyVector2d(ImGuiKey key_left, ImGuiKey key_right, ImGuiKey key_up, ImGuiKey key_down);
|
||||
IMGUI_API ImVec2 GetKeyMagnitude2d(ImGuiKey key_left, ImGuiKey key_right, ImGuiKey key_up, ImGuiKey key_down);
|
||||
IMGUI_API float GetNavTweakPressedAmount(ImGuiAxis axis);
|
||||
IMGUI_API int CalcTypematicRepeatAmount(float t0, float t1, float repeat_delay, float repeat_rate);
|
||||
IMGUI_API void GetTypematicRepeatRate(ImGuiInputFlags flags, float* repeat_delay, float* repeat_rate);
|
||||
@ -2899,9 +2959,10 @@ namespace ImGui
|
||||
// Please open a GitHub Issue to submit your usage scenario or if there's a use case you need solved.
|
||||
IMGUI_API ImGuiID GetKeyOwner(ImGuiKey key);
|
||||
IMGUI_API void SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0);
|
||||
IMGUI_API void SetKeyOwnersForKeyChord(ImGuiKeyChord key, ImGuiID owner_id, ImGuiInputFlags flags = 0);
|
||||
IMGUI_API void SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags = 0); // Set key owner to last item if it is hovered or active. Equivalent to 'if (IsItemHovered() || IsItemActive()) { SetKeyOwner(key, GetItemID());'.
|
||||
IMGUI_API bool TestKeyOwner(ImGuiKey key, ImGuiID owner_id); // Test that key is either not owned, either owned by 'owner_id'
|
||||
inline ImGuiKeyOwnerData* GetKeyOwnerData(ImGuiKey key) { if (key & ImGuiMod_Mask_) key = ConvertSingleModFlagToKey(key); IM_ASSERT(IsNamedKey(key)); return &GImGui->KeysOwnerData[key - ImGuiKey_NamedKey_BEGIN]; }
|
||||
inline ImGuiKeyOwnerData* GetKeyOwnerData(ImGuiContext* ctx, ImGuiKey key) { if (key & ImGuiMod_Mask_) key = ConvertSingleModFlagToKey(ctx, key); IM_ASSERT(IsNamedKey(key)); return &ctx->KeysOwnerData[key - ImGuiKey_NamedKey_BEGIN]; }
|
||||
|
||||
// [EXPERIMENTAL] High-Level: Input Access functions w/ support for Key/Input Ownership
|
||||
// - Important: legacy IsKeyPressed(ImGuiKey, bool repeat=true) _DEFAULTS_ to repeat, new IsKeyPressed() requires _EXPLICIT_ ImGuiInputFlags_Repeat flag.
|
||||
@ -2985,7 +3046,8 @@ namespace ImGui
|
||||
IMGUI_API void TableDrawContextMenu(ImGuiTable* table);
|
||||
IMGUI_API bool TableBeginContextMenuPopup(ImGuiTable* table);
|
||||
IMGUI_API void TableMergeDrawChannels(ImGuiTable* table);
|
||||
inline ImGuiTableInstanceData* TableGetInstanceData(ImGuiTable* table, int instance_no) { if (instance_no == 0) return &table->InstanceDataFirst; return &table->InstanceDataExtra[instance_no - 1]; }
|
||||
inline ImGuiTableInstanceData* TableGetInstanceData(ImGuiTable* table, int instance_no) { if (instance_no == 0) return &table->InstanceDataFirst; return &table->InstanceDataExtra[instance_no - 1]; }
|
||||
inline ImGuiID TableGetInstanceID(ImGuiTable* table, int instance_no) { return TableGetInstanceData(table, instance_no)->TableInstanceID; }
|
||||
IMGUI_API void TableSortSpecsSanitize(ImGuiTable* table);
|
||||
IMGUI_API void TableSortSpecsBuild(ImGuiTable* table);
|
||||
IMGUI_API ImGuiSortDirection TableGetColumnNextSortDirection(ImGuiTableColumn* column);
|
||||
@ -2997,7 +3059,7 @@ namespace ImGui
|
||||
IMGUI_API void TableEndCell(ImGuiTable* table);
|
||||
IMGUI_API ImRect TableGetCellBgRect(const ImGuiTable* table, int column_n);
|
||||
IMGUI_API const char* TableGetColumnName(const ImGuiTable* table, int column_n);
|
||||
IMGUI_API ImGuiID TableGetColumnResizeID(const ImGuiTable* table, int column_n, int instance_no = 0);
|
||||
IMGUI_API ImGuiID TableGetColumnResizeID(ImGuiTable* table, int column_n, int instance_no = 0);
|
||||
IMGUI_API float TableGetMaxColumnWidth(const ImGuiTable* table, int column_n);
|
||||
IMGUI_API void TableSetColumnWidthAutoSingle(ImGuiTable* table, int column_n);
|
||||
IMGUI_API void TableSetColumnWidthAutoAll(ImGuiTable* table);
|
||||
@ -3016,15 +3078,22 @@ namespace ImGui
|
||||
IMGUI_API ImGuiTableSettings* TableSettingsFindByID(ImGuiID id);
|
||||
|
||||
// Tab Bars
|
||||
inline ImGuiTabBar* GetCurrentTabBar() { ImGuiContext& g = *GImGui; return g.CurrentTabBar; }
|
||||
IMGUI_API bool BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& bb, ImGuiTabBarFlags flags);
|
||||
IMGUI_API ImGuiTabItem* TabBarFindTabByID(ImGuiTabBar* tab_bar, ImGuiID tab_id);
|
||||
IMGUI_API ImGuiTabItem* TabBarFindTabByOrder(ImGuiTabBar* tab_bar, int order);
|
||||
IMGUI_API ImGuiTabItem* TabBarGetCurrentTab(ImGuiTabBar* tab_bar);
|
||||
inline int TabBarGetTabOrder(ImGuiTabBar* tab_bar, ImGuiTabItem* tab) { return tab_bar->Tabs.index_from_ptr(tab); }
|
||||
IMGUI_API const char* TabBarGetTabName(ImGuiTabBar* tab_bar, ImGuiTabItem* tab);
|
||||
IMGUI_API void TabBarRemoveTab(ImGuiTabBar* tab_bar, ImGuiID tab_id);
|
||||
IMGUI_API void TabBarCloseTab(ImGuiTabBar* tab_bar, ImGuiTabItem* tab);
|
||||
IMGUI_API void TabBarQueueReorder(ImGuiTabBar* tab_bar, const ImGuiTabItem* tab, int offset);
|
||||
IMGUI_API void TabBarQueueReorderFromMousePos(ImGuiTabBar* tab_bar, const ImGuiTabItem* tab, ImVec2 mouse_pos);
|
||||
IMGUI_API void TabBarQueueFocus(ImGuiTabBar* tab_bar, ImGuiTabItem* tab);
|
||||
IMGUI_API void TabBarQueueReorder(ImGuiTabBar* tab_bar, ImGuiTabItem* tab, int offset);
|
||||
IMGUI_API void TabBarQueueReorderFromMousePos(ImGuiTabBar* tab_bar, ImGuiTabItem* tab, ImVec2 mouse_pos);
|
||||
IMGUI_API bool TabBarProcessReorder(ImGuiTabBar* tab_bar);
|
||||
IMGUI_API bool TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, ImGuiTabItemFlags flags);
|
||||
IMGUI_API bool TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, ImGuiTabItemFlags flags, ImGuiWindow* docked_window);
|
||||
IMGUI_API ImVec2 TabItemCalcSize(const char* label, bool has_close_button_or_unsaved_marker);
|
||||
IMGUI_API ImVec2 TabItemCalcSize(ImGuiWindow* window);
|
||||
IMGUI_API void TabItemBackground(ImDrawList* draw_list, const ImRect& bb, ImGuiTabItemFlags flags, ImU32 col);
|
||||
IMGUI_API void TabItemLabelAndCloseButton(ImDrawList* draw_list, const ImRect& bb, ImGuiTabItemFlags flags, ImVec2 frame_padding, const char* label, ImGuiID tab_id, ImGuiID close_button_id, bool is_contents_visible, bool* out_just_closed, bool* out_text_clipped);
|
||||
|
||||
@ -3054,25 +3123,28 @@ namespace ImGui
|
||||
// Widgets
|
||||
IMGUI_API void TextEx(const char* text, const char* text_end = NULL, ImGuiTextFlags flags = 0);
|
||||
IMGUI_API bool ButtonEx(const char* label, const ImVec2& size_arg = ImVec2(0, 0), ImGuiButtonFlags flags = 0);
|
||||
IMGUI_API bool ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size_arg, ImGuiButtonFlags flags = 0);
|
||||
IMGUI_API bool ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col, ImGuiButtonFlags flags = 0);
|
||||
IMGUI_API void SeparatorEx(ImGuiSeparatorFlags flags);
|
||||
IMGUI_API void SeparatorTextEx(ImGuiID id, const char* label, const char* label_end, float extra_width);
|
||||
IMGUI_API bool CheckboxFlags(const char* label, ImS64* flags, ImS64 flags_value);
|
||||
IMGUI_API bool CheckboxFlags(const char* label, ImU64* flags, ImU64 flags_value);
|
||||
|
||||
// Widgets: Window Decorations
|
||||
IMGUI_API bool CloseButton(ImGuiID id, const ImVec2& pos);
|
||||
IMGUI_API bool CollapseButton(ImGuiID id, const ImVec2& pos);
|
||||
IMGUI_API bool ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size_arg, ImGuiButtonFlags flags = 0);
|
||||
IMGUI_API void Scrollbar(ImGuiAxis axis);
|
||||
IMGUI_API bool ScrollbarEx(const ImRect& bb, ImGuiID id, ImGuiAxis axis, ImS64* p_scroll_v, ImS64 avail_v, ImS64 contents_v, ImDrawFlags flags);
|
||||
IMGUI_API bool ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col);
|
||||
IMGUI_API ImRect GetWindowScrollbarRect(ImGuiWindow* window, ImGuiAxis axis);
|
||||
IMGUI_API ImGuiID GetWindowScrollbarID(ImGuiWindow* window, ImGuiAxis axis);
|
||||
IMGUI_API ImGuiID GetWindowResizeCornerID(ImGuiWindow* window, int n); // 0..3: corners
|
||||
IMGUI_API ImGuiID GetWindowResizeBorderID(ImGuiWindow* window, ImGuiDir dir);
|
||||
IMGUI_API void SeparatorEx(ImGuiSeparatorFlags flags);
|
||||
IMGUI_API bool CheckboxFlags(const char* label, ImS64* flags, ImS64 flags_value);
|
||||
IMGUI_API bool CheckboxFlags(const char* label, ImU64* flags, ImU64 flags_value);
|
||||
|
||||
// Widgets low-level behaviors
|
||||
IMGUI_API bool ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool* out_held, ImGuiButtonFlags flags = 0);
|
||||
IMGUI_API bool DragBehavior(ImGuiID id, ImGuiDataType data_type, void* p_v, float v_speed, const void* p_min, const void* p_max, const char* format, ImGuiSliderFlags flags);
|
||||
IMGUI_API bool SliderBehavior(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, void* p_v, const void* p_min, const void* p_max, const char* format, ImGuiSliderFlags flags, ImRect* out_grab_bb);
|
||||
IMGUI_API bool SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float* size1, float* size2, float min_size1, float min_size2, float hover_extend = 0.0f, float hover_visibility_delay = 0.0f);
|
||||
IMGUI_API bool SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float* size1, float* size2, float min_size1, float min_size2, float hover_extend = 0.0f, float hover_visibility_delay = 0.0f, ImU32 bg_col = 0);
|
||||
IMGUI_API bool TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* label, const char* label_end = NULL);
|
||||
IMGUI_API void TreePushOverrideID(ImGuiID id);
|
||||
IMGUI_API void TreeNodeSetOpen(ImGuiID id, bool open);
|
||||
@ -3098,6 +3170,7 @@ namespace ImGui
|
||||
|
||||
// InputText
|
||||
IMGUI_API bool InputTextEx(const char* label, const char* hint, char* buf, int buf_size, const ImVec2& size_arg, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback = NULL, void* user_data = NULL);
|
||||
IMGUI_API void InputTextDeactivateHook(ImGuiID id);
|
||||
IMGUI_API bool TempInputText(const ImRect& bb, ImGuiID id, const char* label, char* buf, int buf_size, ImGuiInputTextFlags flags);
|
||||
IMGUI_API bool TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImGuiDataType data_type, void* p_data, const char* format, const void* p_clamp_min = NULL, const void* p_clamp_max = NULL);
|
||||
inline bool TempInputIsActive(ImGuiID id) { ImGuiContext& g = *GImGui; return (g.ActiveId == id && g.TempInputId == id); }
|
||||
@ -3109,7 +3182,7 @@ namespace ImGui
|
||||
IMGUI_API void ColorPickerOptionsPopup(const float* ref_col, ImGuiColorEditFlags flags);
|
||||
|
||||
// Plot
|
||||
IMGUI_API int PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 frame_size);
|
||||
IMGUI_API int PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, const ImVec2& size_arg);
|
||||
|
||||
// Shade functions (write over already created vertices)
|
||||
IMGUI_API void ShadeVertsLinearColorGradientKeepAlpha(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, ImVec2 gradient_p0, ImVec2 gradient_p1, ImU32 col0, ImU32 col1);
|
||||
@ -3150,6 +3223,7 @@ namespace ImGui
|
||||
IMGUI_API void DebugNodeWindowsList(ImVector<ImGuiWindow*>* windows, const char* label);
|
||||
IMGUI_API void DebugNodeWindowsListByBeginStackParent(ImGuiWindow** windows, int windows_size, ImGuiWindow* parent_in_begin_stack);
|
||||
IMGUI_API void DebugNodeViewport(ImGuiViewportP* viewport);
|
||||
IMGUI_API void DebugRenderKeyboardPreview(ImDrawList* draw_list);
|
||||
IMGUI_API void DebugRenderViewportThumbnail(ImDrawList* draw_list, ImGuiViewportP* viewport, const ImRect& bb);
|
||||
|
||||
// Obsolete functions
|
||||
@ -3160,7 +3234,7 @@ namespace ImGui
|
||||
// Refactored focus/nav/tabbing system in 1.82 and 1.84. If you have old/custom copy-and-pasted widgets that used FocusableItemRegister():
|
||||
// (Old) IMGUI_VERSION_NUM < 18209: using 'ItemAdd(....)' and 'bool tab_focused = FocusableItemRegister(...)'
|
||||
// (Old) IMGUI_VERSION_NUM >= 18209: using 'ItemAdd(..., ImGuiItemAddFlags_Focusable)' and 'bool tab_focused = (GetItemStatusFlags() & ImGuiItemStatusFlags_Focused) != 0'
|
||||
// (New) IMGUI_VERSION_NUM >= 18413: using 'ItemAdd(..., ImGuiItemFlags_Inputable)' and 'bool tab_focused = (GetItemStatusFlags() & ImGuiItemStatusFlags_FocusedTabbing) != 0 || g.NavActivateInputId == id' (WIP)
|
||||
// (New) IMGUI_VERSION_NUM >= 18413: using 'ItemAdd(..., ImGuiItemFlags_Inputable)' and 'bool tab_focused = (GetItemStatusFlags() & ImGuiItemStatusFlags_FocusedTabbing) != 0 || (g.NavActivateId == id && (g.NavActivateFlags & ImGuiActivateFlags_PreferInput))' (WIP)
|
||||
// Widget code are simplified as there's no need to call FocusableItemUnregister() while managing the transition from regular widget to TempInputText()
|
||||
inline bool FocusableItemRegister(ImGuiWindow* window, ImGuiID id) { IM_ASSERT(0); IM_UNUSED(window); IM_UNUSED(id); return false; } // -> pass ImGuiItemAddFlags_Inputable flag to ItemAdd()
|
||||
inline void FocusableItemUnregister(ImGuiWindow* window) { IM_ASSERT(0); IM_UNUSED(window); } // -> unnecessary: TempInputText() uses ImGuiInputTextFlags_MergedItem
|
||||
@ -3200,14 +3274,15 @@ IMGUI_API void ImFontAtlasBuildMultiplyRectAlpha8(const unsigned char table
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifdef IMGUI_ENABLE_TEST_ENGINE
|
||||
extern void ImGuiTestEngineHook_ItemAdd(ImGuiContext* ctx, const ImRect& bb, ImGuiID id);
|
||||
extern void ImGuiTestEngineHook_ItemAdd(ImGuiContext* ctx, ImGuiID id, const ImRect& bb, const ImGuiLastItemData* item_data); // item_data may be NULL
|
||||
extern void ImGuiTestEngineHook_ItemInfo(ImGuiContext* ctx, ImGuiID id, const char* label, ImGuiItemStatusFlags flags);
|
||||
extern void ImGuiTestEngineHook_Log(ImGuiContext* ctx, const char* fmt, ...);
|
||||
extern const char* ImGuiTestEngine_FindItemDebugLabel(ImGuiContext* ctx, ImGuiID id);
|
||||
|
||||
#define IMGUI_TEST_ENGINE_ITEM_ADD(_BB,_ID) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemAdd(&g, _BB, _ID) // Register item bounding box
|
||||
#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemInfo(&g, _ID, _LABEL, _FLAGS) // Register item label and status flags (optional)
|
||||
#define IMGUI_TEST_ENGINE_LOG(_FMT,...) if (g.TestEngineHookItems) ImGuiTestEngineHook_Log(&g, _FMT, __VA_ARGS__) // Custom log entry from user land into test log
|
||||
// In IMGUI_VERSION_NUM >= 18934: changed IMGUI_TEST_ENGINE_ITEM_ADD(bb,id) to IMGUI_TEST_ENGINE_ITEM_ADD(id,bb,item_data);
|
||||
#define IMGUI_TEST_ENGINE_ITEM_ADD(_ID,_BB,_ITEM_DATA) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemAdd(&g, _ID, _BB, _ITEM_DATA) // Register item bounding box
|
||||
#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) if (g.TestEngineHookItems) ImGuiTestEngineHook_ItemInfo(&g, _ID, _LABEL, _FLAGS) // Register item label and status flags (optional)
|
||||
#define IMGUI_TEST_ENGINE_LOG(_FMT,...) if (g.TestEngineHookItems) ImGuiTestEngineHook_Log(&g, _FMT, __VA_ARGS__) // Custom log entry from user land into test log
|
||||
#else
|
||||
#define IMGUI_TEST_ENGINE_ITEM_ADD(_BB,_ID) ((void)0)
|
||||
#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) ((void)g)
|
||||
|
183
3rdparty/dear-imgui/imgui_tables.cpp
vendored
183
3rdparty/dear-imgui/imgui_tables.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// dear imgui, v1.89.1 WIP
|
||||
// dear imgui, v1.89.6 WIP
|
||||
// (tables and columns code)
|
||||
|
||||
/*
|
||||
@ -188,12 +188,12 @@ Index of this file:
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
|
||||
#include "imgui.h"
|
||||
#ifndef IMGUI_DISABLE
|
||||
|
||||
#ifndef IMGUI_DEFINE_MATH_OPERATORS
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#endif
|
||||
|
||||
#include "imgui.h"
|
||||
#ifndef IMGUI_DISABLE
|
||||
#include "imgui_internal.h"
|
||||
|
||||
// System includes
|
||||
@ -315,7 +315,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
||||
return false;
|
||||
|
||||
// Sanity checks
|
||||
IM_ASSERT(columns_count > 0 && columns_count <= IMGUI_TABLE_MAX_COLUMNS && "Only 1..64 columns allowed!");
|
||||
IM_ASSERT(columns_count > 0 && columns_count < IMGUI_TABLE_MAX_COLUMNS);
|
||||
if (flags & ImGuiTableFlags_ScrollX)
|
||||
IM_ASSERT(inner_width >= 0.0f);
|
||||
|
||||
@ -332,11 +332,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
||||
|
||||
// Acquire storage for the table
|
||||
ImGuiTable* table = g.Tables.GetOrAddByKey(id);
|
||||
const int instance_no = (table->LastFrameActive != g.FrameCount) ? 0 : table->InstanceCurrent + 1;
|
||||
const ImGuiID instance_id = id + instance_no;
|
||||
const ImGuiTableFlags table_last_flags = table->Flags;
|
||||
if (instance_no > 0)
|
||||
IM_ASSERT(table->ColumnsCount == columns_count && "BeginTable(): Cannot change columns count mid-frame while preserving same ID");
|
||||
|
||||
// Acquire temporary buffers
|
||||
const int table_idx = g.Tables.GetIndex(table);
|
||||
@ -352,17 +348,32 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
||||
flags = TableFixFlags(flags, outer_window);
|
||||
|
||||
// Initialize
|
||||
const int instance_no = (table->LastFrameActive != g.FrameCount) ? 0 : table->InstanceCurrent + 1;
|
||||
table->ID = id;
|
||||
table->Flags = flags;
|
||||
table->InstanceCurrent = (ImS16)instance_no;
|
||||
table->LastFrameActive = g.FrameCount;
|
||||
table->OuterWindow = table->InnerWindow = outer_window;
|
||||
table->ColumnsCount = columns_count;
|
||||
table->IsLayoutLocked = false;
|
||||
table->InnerWidth = inner_width;
|
||||
temp_data->UserOuterSize = outer_size;
|
||||
if (instance_no > 0 && table->InstanceDataExtra.Size < instance_no)
|
||||
table->InstanceDataExtra.push_back(ImGuiTableInstanceData());
|
||||
|
||||
// Instance data (for instance 0, TableID == TableInstanceID)
|
||||
ImGuiID instance_id;
|
||||
table->InstanceCurrent = (ImS16)instance_no;
|
||||
if (instance_no > 0)
|
||||
{
|
||||
IM_ASSERT(table->ColumnsCount == columns_count && "BeginTable(): Cannot change columns count mid-frame while preserving same ID");
|
||||
if (table->InstanceDataExtra.Size < instance_no)
|
||||
table->InstanceDataExtra.push_back(ImGuiTableInstanceData());
|
||||
instance_id = GetIDWithSeed(instance_no, GetIDWithSeed("##Instances", NULL, id)); // Push "##Instance" followed by (int)instance_no in ID stack.
|
||||
}
|
||||
else
|
||||
{
|
||||
instance_id = id;
|
||||
}
|
||||
ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent);
|
||||
table_instance->TableInstanceID = instance_id;
|
||||
|
||||
// When not using a child window, WorkRect.Max will grow as we append contents.
|
||||
if (use_child_window)
|
||||
@ -395,6 +406,14 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
||||
table->OuterRect = table->InnerWindow->Rect();
|
||||
table->InnerRect = table->InnerWindow->InnerRect;
|
||||
IM_ASSERT(table->InnerWindow->WindowPadding.x == 0.0f && table->InnerWindow->WindowPadding.y == 0.0f && table->InnerWindow->WindowBorderSize == 0.0f);
|
||||
|
||||
// When using multiple instances, ensure they have the same amount of horizontal decorations (aka vertical scrollbar) so stretched columns can be aligned)
|
||||
if (instance_no == 0)
|
||||
{
|
||||
table->HasScrollbarYPrev = table->HasScrollbarYCurr;
|
||||
table->HasScrollbarYCurr = false;
|
||||
}
|
||||
table->HasScrollbarYCurr |= (table->InnerWindow->ScrollMax.y > 0.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -404,7 +423,9 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
||||
}
|
||||
|
||||
// Push a standardized ID for both child-using and not-child-using tables
|
||||
PushOverrideID(instance_id);
|
||||
PushOverrideID(id);
|
||||
if (instance_no > 0)
|
||||
PushOverrideID(instance_id); // FIXME: Somehow this is not resolved by stack-tool, even tho GetIDWithSeed() submitted the symbol.
|
||||
|
||||
// Backup a copy of host window members we will modify
|
||||
ImGuiWindow* inner_window = table->InnerWindow;
|
||||
@ -462,6 +483,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
||||
|
||||
// Make table current
|
||||
g.CurrentTable = table;
|
||||
outer_window->DC.NavIsScrollPushableX = false; // Shortcut for NavUpdateCurrentWindowIsScrollPushableX();
|
||||
outer_window->DC.CurrentTableIdx = table_idx;
|
||||
if (inner_window != outer_window) // So EndChild() within the inner window can restore the table properly.
|
||||
inner_window->DC.CurrentTableIdx = table_idx;
|
||||
@ -573,16 +595,22 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
||||
void ImGui::TableBeginInitMemory(ImGuiTable* table, int columns_count)
|
||||
{
|
||||
// Allocate single buffer for our arrays
|
||||
ImSpanAllocator<3> span_allocator;
|
||||
const int columns_bit_array_size = (int)ImBitArrayGetStorageSizeInBytes(columns_count);
|
||||
ImSpanAllocator<6> span_allocator;
|
||||
span_allocator.Reserve(0, columns_count * sizeof(ImGuiTableColumn));
|
||||
span_allocator.Reserve(1, columns_count * sizeof(ImGuiTableColumnIdx));
|
||||
span_allocator.Reserve(2, columns_count * sizeof(ImGuiTableCellData), 4);
|
||||
for (int n = 3; n < 6; n++)
|
||||
span_allocator.Reserve(n, columns_bit_array_size);
|
||||
table->RawData = IM_ALLOC(span_allocator.GetArenaSizeInBytes());
|
||||
memset(table->RawData, 0, span_allocator.GetArenaSizeInBytes());
|
||||
span_allocator.SetArenaBasePtr(table->RawData);
|
||||
span_allocator.GetSpan(0, &table->Columns);
|
||||
span_allocator.GetSpan(1, &table->DisplayOrderToIndex);
|
||||
span_allocator.GetSpan(2, &table->RowCellData);
|
||||
table->EnabledMaskByDisplayOrder = (ImU32*)span_allocator.GetSpanPtrBegin(3);
|
||||
table->EnabledMaskByIndex = (ImU32*)span_allocator.GetSpanPtrBegin(4);
|
||||
table->VisibleMaskByIndex = (ImU32*)span_allocator.GetSpanPtrBegin(5);
|
||||
}
|
||||
|
||||
// Apply queued resizing/reordering/hiding requests
|
||||
@ -721,8 +749,8 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
||||
const ImGuiTableFlags table_sizing_policy = (table->Flags & ImGuiTableFlags_SizingMask_);
|
||||
table->IsDefaultDisplayOrder = true;
|
||||
table->ColumnsEnabledCount = 0;
|
||||
table->EnabledMaskByIndex = 0x00;
|
||||
table->EnabledMaskByDisplayOrder = 0x00;
|
||||
ImBitArrayClearAllBits(table->EnabledMaskByIndex, table->ColumnsCount);
|
||||
ImBitArrayClearAllBits(table->EnabledMaskByDisplayOrder, table->ColumnsCount);
|
||||
table->LeftMostEnabledColumn = -1;
|
||||
table->MinColumnWidth = ImMax(1.0f, g.Style.FramePadding.x * 1.0f); // g.Style.ColumnsMinSpacing; // FIXME-TABLE
|
||||
|
||||
@ -787,8 +815,8 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
||||
else
|
||||
table->LeftMostEnabledColumn = (ImGuiTableColumnIdx)column_n;
|
||||
column->IndexWithinEnabledSet = table->ColumnsEnabledCount++;
|
||||
table->EnabledMaskByIndex |= (ImU64)1 << column_n;
|
||||
table->EnabledMaskByDisplayOrder |= (ImU64)1 << column->DisplayOrder;
|
||||
ImBitArraySetBit(table->EnabledMaskByIndex, column_n);
|
||||
ImBitArraySetBit(table->EnabledMaskByDisplayOrder, column->DisplayOrder);
|
||||
prev_visible_column_idx = column_n;
|
||||
IM_ASSERT(column->IndexWithinEnabledSet <= column->DisplayOrder);
|
||||
|
||||
@ -836,7 +864,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
||||
table->LeftMostStretchedColumn = table->RightMostStretchedColumn = -1;
|
||||
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
||||
{
|
||||
if (!(table->EnabledMaskByIndex & ((ImU64)1 << column_n)))
|
||||
if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByIndex, column_n))
|
||||
continue;
|
||||
ImGuiTableColumn* column = &table->Columns[column_n];
|
||||
|
||||
@ -852,7 +880,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
||||
// Latch initial size for fixed columns and update it constantly for auto-resizing column (unless clipped!)
|
||||
if (column->AutoFitQueue != 0x00)
|
||||
column->WidthRequest = width_auto;
|
||||
else if ((column->Flags & ImGuiTableColumnFlags_WidthFixed) && !column_is_resizable && (table->RequestOutputMaskByIndex & ((ImU64)1 << column_n)))
|
||||
else if ((column->Flags & ImGuiTableColumnFlags_WidthFixed) && !column_is_resizable && column->IsRequestOutput)
|
||||
column->WidthRequest = width_auto;
|
||||
|
||||
// FIXME-TABLE: Increase minimum size during init frame to avoid biasing auto-fitting widgets
|
||||
@ -893,13 +921,14 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
||||
// [Part 4] Apply final widths based on requested widths
|
||||
const ImRect work_rect = table->WorkRect;
|
||||
const float width_spacings = (table->OuterPaddingX * 2.0f) + (table->CellSpacingX1 + table->CellSpacingX2) * (table->ColumnsEnabledCount - 1);
|
||||
const float width_avail = ((table->Flags & ImGuiTableFlags_ScrollX) && table->InnerWidth == 0.0f) ? table->InnerClipRect.GetWidth() : work_rect.GetWidth();
|
||||
const float width_removed = (table->HasScrollbarYPrev && !table->InnerWindow->ScrollbarY) ? g.Style.ScrollbarSize : 0.0f; // To synchronize decoration width of synched tables with mismatching scrollbar state (#5920)
|
||||
const float width_avail = ImMax(1.0f, (((table->Flags & ImGuiTableFlags_ScrollX) && table->InnerWidth == 0.0f) ? table->InnerClipRect.GetWidth() : work_rect.GetWidth()) - width_removed);
|
||||
const float width_avail_for_stretched_columns = width_avail - width_spacings - sum_width_requests;
|
||||
float width_remaining_for_stretched_columns = width_avail_for_stretched_columns;
|
||||
table->ColumnsGivenWidth = width_spacings + (table->CellPaddingX * 2.0f) * table->ColumnsEnabledCount;
|
||||
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
||||
{
|
||||
if (!(table->EnabledMaskByIndex & ((ImU64)1 << column_n)))
|
||||
if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByIndex, column_n))
|
||||
continue;
|
||||
ImGuiTableColumn* column = &table->Columns[column_n];
|
||||
|
||||
@ -926,7 +955,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
||||
if (width_remaining_for_stretched_columns >= 1.0f && !(table->Flags & ImGuiTableFlags_PreciseWidths))
|
||||
for (int order_n = table->ColumnsCount - 1; stretch_sum_weights > 0.0f && width_remaining_for_stretched_columns >= 1.0f && order_n >= 0; order_n--)
|
||||
{
|
||||
if (!(table->EnabledMaskByDisplayOrder & ((ImU64)1 << order_n)))
|
||||
if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByDisplayOrder, order_n))
|
||||
continue;
|
||||
ImGuiTableColumn* column = &table->Columns[table->DisplayOrderToIndex[order_n]];
|
||||
if (!(column->Flags & ImGuiTableColumnFlags_WidthStretch))
|
||||
@ -957,14 +986,13 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
||||
float offset_x = ((table->FreezeColumnsCount > 0) ? table->OuterRect.Min.x : work_rect.Min.x) + table->OuterPaddingX - table->CellSpacingX1;
|
||||
ImRect host_clip_rect = table->InnerClipRect;
|
||||
//host_clip_rect.Max.x += table->CellPaddingX + table->CellSpacingX2;
|
||||
table->VisibleMaskByIndex = 0x00;
|
||||
table->RequestOutputMaskByIndex = 0x00;
|
||||
ImBitArrayClearAllBits(table->VisibleMaskByIndex, table->ColumnsCount);
|
||||
for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
|
||||
{
|
||||
const int column_n = table->DisplayOrderToIndex[order_n];
|
||||
ImGuiTableColumn* column = &table->Columns[column_n];
|
||||
|
||||
column->NavLayerCurrent = (ImS8)((table->FreezeRowsCount > 0 || column_n < table->FreezeColumnsCount) ? ImGuiNavLayer_Menu : ImGuiNavLayer_Main);
|
||||
column->NavLayerCurrent = (ImS8)(table->FreezeRowsCount > 0 ? ImGuiNavLayer_Menu : ImGuiNavLayer_Main); // Use Count NOT request so Header line changes layer when frozen
|
||||
|
||||
if (offset_x_frozen && table->FreezeColumnsCount == visible_n)
|
||||
{
|
||||
@ -975,7 +1003,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
||||
// Clear status flags
|
||||
column->Flags &= ~ImGuiTableColumnFlags_StatusMask_;
|
||||
|
||||
if ((table->EnabledMaskByDisplayOrder & ((ImU64)1 << order_n)) == 0)
|
||||
if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByDisplayOrder, order_n))
|
||||
{
|
||||
// Hidden column: clear a few fields and we are done with it for the remainder of the function.
|
||||
// We set a zero-width clip rect but set Min.y/Max.y properly to not interfere with the clipper.
|
||||
@ -1028,12 +1056,10 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
||||
column->IsVisibleY = true; // (column->ClipRect.Max.y > column->ClipRect.Min.y);
|
||||
const bool is_visible = column->IsVisibleX; //&& column->IsVisibleY;
|
||||
if (is_visible)
|
||||
table->VisibleMaskByIndex |= ((ImU64)1 << column_n);
|
||||
ImBitArraySetBit(table->VisibleMaskByIndex, column_n);
|
||||
|
||||
// Mark column as requesting output from user. Note that fixed + non-resizable sets are auto-fitting at all times and therefore always request output.
|
||||
column->IsRequestOutput = is_visible || column->AutoFitQueue != 0 || column->CannotSkipItemsQueue != 0;
|
||||
if (column->IsRequestOutput)
|
||||
table->RequestOutputMaskByIndex |= ((ImU64)1 << column_n);
|
||||
|
||||
// Mark column as SkipItems (ignoring all items/layout)
|
||||
column->IsSkipItems = !column->IsEnabled || table->HostSkipItems;
|
||||
@ -1119,11 +1145,18 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
||||
EndPopup();
|
||||
}
|
||||
|
||||
// [Part 13] Sanitize and build sort specs before we have a change to use them for display.
|
||||
// [Part 12] Sanitize and build sort specs before we have a change to use them for display.
|
||||
// This path will only be exercised when sort specs are modified before header rows (e.g. init or visibility change)
|
||||
if (table->IsSortSpecsDirty && (table->Flags & ImGuiTableFlags_Sortable))
|
||||
TableSortSpecsBuild(table);
|
||||
|
||||
// [Part 13] Setup inner window decoration size (for scrolling / nav tracking to properly take account of frozen rows/columns)
|
||||
if (table->FreezeColumnsRequest > 0)
|
||||
table->InnerWindow->DecoInnerSizeX1 = table->Columns[table->DisplayOrderToIndex[table->FreezeColumnsRequest - 1]].MaxX - table->OuterRect.Min.x;
|
||||
if (table->FreezeRowsRequest > 0)
|
||||
table->InnerWindow->DecoInnerSizeY1 = table_instance->LastFrozenHeight;
|
||||
table_instance->LastFrozenHeight = 0.0f;
|
||||
|
||||
// Initial state
|
||||
ImGuiWindow* inner_window = table->InnerWindow;
|
||||
if (table->Flags & ImGuiTableFlags_NoClip)
|
||||
@ -1153,7 +1186,7 @@ void ImGui::TableUpdateBorders(ImGuiTable* table)
|
||||
|
||||
for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
|
||||
{
|
||||
if (!(table->EnabledMaskByDisplayOrder & ((ImU64)1 << order_n)))
|
||||
if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByDisplayOrder, order_n))
|
||||
continue;
|
||||
|
||||
const int column_n = table->DisplayOrderToIndex[order_n];
|
||||
@ -1289,7 +1322,7 @@ void ImGui::EndTable()
|
||||
float auto_fit_width_for_stretched = 0.0f;
|
||||
float auto_fit_width_for_stretched_min = 0.0f;
|
||||
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
||||
if (table->EnabledMaskByIndex & ((ImU64)1 << column_n))
|
||||
if (IM_BITARRAY_TESTBIT(table->EnabledMaskByIndex, column_n))
|
||||
{
|
||||
ImGuiTableColumn* column = &table->Columns[column_n];
|
||||
float column_width_request = ((column->Flags & ImGuiTableColumnFlags_WidthFixed) && !(column->Flags & ImGuiTableColumnFlags_NoResize)) ? column->WidthRequest : TableGetColumnWidthAuto(table, column);
|
||||
@ -1329,8 +1362,10 @@ void ImGui::EndTable()
|
||||
}
|
||||
|
||||
// Pop from id stack
|
||||
IM_ASSERT_USER_ERROR(inner_window->IDStack.back() == table->ID + table->InstanceCurrent, "Mismatching PushID/PopID!");
|
||||
IM_ASSERT_USER_ERROR(inner_window->IDStack.back() == table_instance->TableInstanceID, "Mismatching PushID/PopID!");
|
||||
IM_ASSERT_USER_ERROR(outer_window->DC.ItemWidthStack.Size >= temp_data->HostBackupItemWidthStackSize, "Too many PopItemWidth!");
|
||||
if (table->InstanceCurrent > 0)
|
||||
PopID();
|
||||
PopID();
|
||||
|
||||
// Restore window data that we modified
|
||||
@ -1402,6 +1437,7 @@ void ImGui::EndTable()
|
||||
g.CurrentTable->DrawSplitter = &temp_data->DrawSplitter;
|
||||
}
|
||||
outer_window->DC.CurrentTableIdx = g.CurrentTable ? g.Tables.GetIndex(g.CurrentTable) : -1;
|
||||
NavUpdateCurrentWindowIsScrollPushableX();
|
||||
}
|
||||
|
||||
// See "COLUMN SIZING POLICIES" comments at the top of this file
|
||||
@ -1600,11 +1636,11 @@ ImRect ImGui::TableGetCellBgRect(const ImGuiTable* table, int column_n)
|
||||
}
|
||||
|
||||
// Return the resizing ID for the right-side of the given column.
|
||||
ImGuiID ImGui::TableGetColumnResizeID(const ImGuiTable* table, int column_n, int instance_no)
|
||||
ImGuiID ImGui::TableGetColumnResizeID(ImGuiTable* table, int column_n, int instance_no)
|
||||
{
|
||||
IM_ASSERT(column_n >= 0 && column_n < table->ColumnsCount);
|
||||
ImGuiID id = table->ID + 1 + (instance_no * table->ColumnsCount) + column_n;
|
||||
return id;
|
||||
ImGuiID instance_id = TableGetInstanceID(table, instance_no);
|
||||
return instance_id + 1 + column_n; // FIXME: #6140: still not ideal
|
||||
}
|
||||
|
||||
// Return -1 when table is not hovered. return columns_count if the unused space at the right of visible columns is hovered.
|
||||
@ -1635,7 +1671,7 @@ void ImGui::TableSetBgColor(ImGuiTableBgTarget target, ImU32 color, int column_n
|
||||
return;
|
||||
if (column_n == -1)
|
||||
column_n = table->CurrentColumn;
|
||||
if ((table->VisibleMaskByIndex & ((ImU64)1 << column_n)) == 0)
|
||||
if (!IM_BITARRAY_TESTBIT(table->VisibleMaskByIndex, column_n))
|
||||
return;
|
||||
if (table->RowCellDataCurrent < 0 || table->RowCellData[table->RowCellDataCurrent].Column != column_n)
|
||||
table->RowCellDataCurrent++;
|
||||
@ -1839,17 +1875,15 @@ void ImGui::TableEndRow(ImGuiTable* table)
|
||||
// get the new cursor position.
|
||||
if (unfreeze_rows_request)
|
||||
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
||||
{
|
||||
ImGuiTableColumn* column = &table->Columns[column_n];
|
||||
column->NavLayerCurrent = (ImS8)((column_n < table->FreezeColumnsCount) ? ImGuiNavLayer_Menu : ImGuiNavLayer_Main);
|
||||
}
|
||||
table->Columns[column_n].NavLayerCurrent = ImGuiNavLayer_Main;
|
||||
if (unfreeze_rows_actual)
|
||||
{
|
||||
IM_ASSERT(table->IsUnfrozenRows == false);
|
||||
const float y0 = ImMax(table->RowPosY2 + 1, window->InnerClipRect.Min.y);
|
||||
table->IsUnfrozenRows = true;
|
||||
TableGetInstanceData(table, table->InstanceCurrent)->LastFrozenHeight = y0 - table->OuterRect.Min.y;
|
||||
|
||||
// BgClipRect starts as table->InnerClipRect, reduce it now and make BgClipRectForDrawCmd == BgClipRect
|
||||
float y0 = ImMax(table->RowPosY2 + 1, window->InnerClipRect.Min.y);
|
||||
table->BgClipRect.Min.y = table->Bg2ClipRectForDrawCmd.Min.y = ImMin(y0, window->InnerClipRect.Max.y);
|
||||
table->BgClipRect.Max.y = table->Bg2ClipRectForDrawCmd.Max.y = window->InnerClipRect.Max.y;
|
||||
table->Bg2DrawChannelCurrent = table->Bg2DrawChannelUnfrozen;
|
||||
@ -1912,7 +1946,7 @@ bool ImGui::TableSetColumnIndex(int column_n)
|
||||
|
||||
// Return whether the column is visible. User may choose to skip submitting items based on this return value,
|
||||
// however they shouldn't skip submitting for columns that may have the tallest contribution to row height.
|
||||
return (table->RequestOutputMaskByIndex & ((ImU64)1 << column_n)) != 0;
|
||||
return table->Columns[column_n].IsRequestOutput;
|
||||
}
|
||||
|
||||
// [Public] Append into the next column, wrap and create a new row when already on last column
|
||||
@ -1937,8 +1971,7 @@ bool ImGui::TableNextColumn()
|
||||
|
||||
// Return whether the column is visible. User may choose to skip submitting items based on this return value,
|
||||
// however they shouldn't skip submitting for columns that may have the tallest contribution to row height.
|
||||
int column_n = table->CurrentColumn;
|
||||
return (table->RequestOutputMaskByIndex & ((ImU64)1 << column_n)) != 0;
|
||||
return table->Columns[table->CurrentColumn].IsRequestOutput;
|
||||
}
|
||||
|
||||
|
||||
@ -1968,10 +2001,6 @@ void ImGui::TableBeginCell(ImGuiTable* table, int column_n)
|
||||
window->WorkRect.Max.x = column->WorkMaxX;
|
||||
window->DC.ItemWidth = column->ItemWidth;
|
||||
|
||||
// To allow ImGuiListClipper to function we propagate our row height
|
||||
if (!column->IsEnabled)
|
||||
window->DC.CursorPos.y = ImMax(window->DC.CursorPos.y, table->RowPosY2);
|
||||
|
||||
window->SkipItems = column->IsSkipItems;
|
||||
if (column->IsSkipItems)
|
||||
{
|
||||
@ -2018,7 +2047,8 @@ void ImGui::TableEndCell(ImGuiTable* table)
|
||||
else
|
||||
p_max_pos_x = table->IsUnfrozenRows ? &column->ContentMaxXUnfrozen : &column->ContentMaxXFrozen;
|
||||
*p_max_pos_x = ImMax(*p_max_pos_x, window->DC.CursorMaxPos.x);
|
||||
table->RowPosY2 = ImMax(table->RowPosY2, window->DC.CursorMaxPos.y + table->CellPaddingY);
|
||||
if (column->IsEnabled)
|
||||
table->RowPosY2 = ImMax(table->RowPosY2, window->DC.CursorMaxPos.y + table->CellPaddingY);
|
||||
column->ItemWidth = window->DC.ItemWidth;
|
||||
|
||||
// Propagate text baseline for the entire row
|
||||
@ -2278,7 +2308,7 @@ void ImGui::TableSetupDrawChannels(ImGuiTable* table)
|
||||
const int freeze_row_multiplier = (table->FreezeRowsCount > 0) ? 2 : 1;
|
||||
const int channels_for_row = (table->Flags & ImGuiTableFlags_NoClip) ? 1 : table->ColumnsEnabledCount;
|
||||
const int channels_for_bg = 1 + 1 * freeze_row_multiplier;
|
||||
const int channels_for_dummy = (table->ColumnsEnabledCount < table->ColumnsCount || table->VisibleMaskByIndex != table->EnabledMaskByIndex) ? +1 : 0;
|
||||
const int channels_for_dummy = (table->ColumnsEnabledCount < table->ColumnsCount || (memcmp(table->VisibleMaskByIndex, table->EnabledMaskByIndex, ImBitArrayGetStorageSizeInBytes(table->ColumnsCount)) != 0)) ? +1 : 0;
|
||||
const int channels_total = channels_for_bg + (channels_for_row * freeze_row_multiplier) + channels_for_dummy;
|
||||
table->DrawSplitter->Split(table->InnerWindow->DrawList, channels_total);
|
||||
table->DummyDrawChannel = (ImGuiTableDrawChannelIdx)((channels_for_dummy > 0) ? channels_total - 1 : -1);
|
||||
@ -2352,19 +2382,26 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table)
|
||||
// Track which groups we are going to attempt to merge, and which channels goes into each group.
|
||||
struct MergeGroup
|
||||
{
|
||||
ImRect ClipRect;
|
||||
int ChannelsCount;
|
||||
ImBitArray<IMGUI_TABLE_MAX_DRAW_CHANNELS> ChannelsMask;
|
||||
|
||||
MergeGroup() { ChannelsCount = 0; }
|
||||
ImRect ClipRect;
|
||||
int ChannelsCount = 0;
|
||||
ImBitArrayPtr ChannelsMask = NULL;
|
||||
};
|
||||
int merge_group_mask = 0x00;
|
||||
MergeGroup merge_groups[4];
|
||||
|
||||
// Use a reusable temp buffer for the merge masks as they are dynamically sized.
|
||||
const int max_draw_channels = (4 + table->ColumnsCount * 2);
|
||||
const int size_for_masks_bitarrays_one = (int)ImBitArrayGetStorageSizeInBytes(max_draw_channels);
|
||||
g.TempBuffer.reserve(size_for_masks_bitarrays_one * 5);
|
||||
memset(g.TempBuffer.Data, 0, size_for_masks_bitarrays_one * 5);
|
||||
for (int n = 0; n < IM_ARRAYSIZE(merge_groups); n++)
|
||||
merge_groups[n].ChannelsMask = (ImBitArrayPtr)(void*)(g.TempBuffer.Data + (size_for_masks_bitarrays_one * n));
|
||||
ImBitArrayPtr remaining_mask = (ImBitArrayPtr)(void*)(g.TempBuffer.Data + (size_for_masks_bitarrays_one * 4));
|
||||
|
||||
// 1. Scan channels and take note of those which can be merged
|
||||
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
||||
{
|
||||
if ((table->VisibleMaskByIndex & ((ImU64)1 << column_n)) == 0)
|
||||
if (!IM_BITARRAY_TESTBIT(table->VisibleMaskByIndex, column_n))
|
||||
continue;
|
||||
ImGuiTableColumn* column = &table->Columns[column_n];
|
||||
|
||||
@ -2396,11 +2433,11 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table)
|
||||
}
|
||||
|
||||
const int merge_group_n = (has_freeze_h && column_n < table->FreezeColumnsCount ? 0 : 1) + (has_freeze_v && merge_group_sub_n == 0 ? 0 : 2);
|
||||
IM_ASSERT(channel_no < IMGUI_TABLE_MAX_DRAW_CHANNELS);
|
||||
IM_ASSERT(channel_no < max_draw_channels);
|
||||
MergeGroup* merge_group = &merge_groups[merge_group_n];
|
||||
if (merge_group->ChannelsCount == 0)
|
||||
merge_group->ClipRect = ImRect(+FLT_MAX, +FLT_MAX, -FLT_MAX, -FLT_MAX);
|
||||
merge_group->ChannelsMask.SetBit(channel_no);
|
||||
ImBitArraySetBit(merge_group->ChannelsMask, channel_no);
|
||||
merge_group->ChannelsCount++;
|
||||
merge_group->ClipRect.Add(src_channel->_CmdBuffer[0].ClipRect);
|
||||
merge_group_mask |= (1 << merge_group_n);
|
||||
@ -2436,9 +2473,8 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table)
|
||||
const int LEADING_DRAW_CHANNELS = 2;
|
||||
g.DrawChannelsTempMergeBuffer.resize(splitter->_Count - LEADING_DRAW_CHANNELS); // Use shared temporary storage so the allocation gets amortized
|
||||
ImDrawChannel* dst_tmp = g.DrawChannelsTempMergeBuffer.Data;
|
||||
ImBitArray<IMGUI_TABLE_MAX_DRAW_CHANNELS> remaining_mask; // We need 132-bit of storage
|
||||
remaining_mask.SetBitRange(LEADING_DRAW_CHANNELS, splitter->_Count);
|
||||
remaining_mask.ClearBit(table->Bg2DrawChannelUnfrozen);
|
||||
ImBitArraySetBitRange(remaining_mask, LEADING_DRAW_CHANNELS, splitter->_Count);
|
||||
ImBitArrayClearBit(remaining_mask, table->Bg2DrawChannelUnfrozen);
|
||||
IM_ASSERT(has_freeze_v == false || table->Bg2DrawChannelUnfrozen != TABLE_DRAW_CHANNEL_BG2_FROZEN);
|
||||
int remaining_count = splitter->_Count - (has_freeze_v ? LEADING_DRAW_CHANNELS + 1 : LEADING_DRAW_CHANNELS);
|
||||
//ImRect host_rect = (table->InnerWindow == table->OuterWindow) ? table->InnerClipRect : table->HostClipRect;
|
||||
@ -2471,14 +2507,14 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table)
|
||||
GetOverlayDrawList()->AddLine(merge_group->ClipRect.Max, merge_clip_rect.Max, IM_COL32(255, 100, 0, 200));
|
||||
#endif
|
||||
remaining_count -= merge_group->ChannelsCount;
|
||||
for (int n = 0; n < IM_ARRAYSIZE(remaining_mask.Storage); n++)
|
||||
remaining_mask.Storage[n] &= ~merge_group->ChannelsMask.Storage[n];
|
||||
for (int n = 0; n < (size_for_masks_bitarrays_one >> 2); n++)
|
||||
remaining_mask[n] &= ~merge_group->ChannelsMask[n];
|
||||
for (int n = 0; n < splitter->_Count && merge_channels_count != 0; n++)
|
||||
{
|
||||
// Copy + overwrite new clip rect
|
||||
if (!merge_group->ChannelsMask.TestBit(n))
|
||||
if (!IM_BITARRAY_TESTBIT(merge_group->ChannelsMask, n))
|
||||
continue;
|
||||
merge_group->ChannelsMask.ClearBit(n);
|
||||
IM_BITARRAY_CLEARBIT(merge_group->ChannelsMask, n);
|
||||
merge_channels_count--;
|
||||
|
||||
ImDrawChannel* channel = &splitter->_Channels[n];
|
||||
@ -2496,7 +2532,7 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table)
|
||||
// Append unmergeable channels that we didn't reorder at the end of the list
|
||||
for (int n = 0; n < splitter->_Count && remaining_count != 0; n++)
|
||||
{
|
||||
if (!remaining_mask.TestBit(n))
|
||||
if (!IM_BITARRAY_TESTBIT(remaining_mask, n))
|
||||
continue;
|
||||
ImDrawChannel* channel = &splitter->_Channels[n];
|
||||
memcpy(dst_tmp++, channel, sizeof(ImDrawChannel));
|
||||
@ -2528,7 +2564,7 @@ void ImGui::TableDrawBorders(ImGuiTable* table)
|
||||
{
|
||||
for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
|
||||
{
|
||||
if (!(table->EnabledMaskByDisplayOrder & ((ImU64)1 << order_n)))
|
||||
if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByDisplayOrder, order_n))
|
||||
continue;
|
||||
|
||||
const int column_n = table->DisplayOrderToIndex[order_n];
|
||||
@ -2856,10 +2892,9 @@ void ImGui::TableHeadersRow()
|
||||
continue;
|
||||
|
||||
// Push an id to allow unnamed labels (generally accidental, but let's behave nicely with them)
|
||||
// - in your own code you may omit the PushID/PopID all-together, provided you know they won't collide
|
||||
// - table->InstanceCurrent is only >0 when we use multiple BeginTable/EndTable calls with same identifier.
|
||||
// In your own code you may omit the PushID/PopID all-together, provided you know they won't collide.
|
||||
const char* name = (TableGetColumnFlags(column_n) & ImGuiTableColumnFlags_NoHeaderLabel) ? "" : TableGetColumnName(column_n);
|
||||
PushID(table->InstanceCurrent * table->ColumnsCount + column_n);
|
||||
PushID(column_n);
|
||||
TableHeader(name);
|
||||
PopID();
|
||||
}
|
||||
@ -2974,7 +3009,7 @@ void ImGui::TableHeader(const char* label)
|
||||
}
|
||||
|
||||
// Sort order arrow
|
||||
const float ellipsis_max = cell_r.Max.x - w_arrow - w_sort_text;
|
||||
const float ellipsis_max = ImMax(cell_r.Max.x - w_arrow - w_sort_text, label_pos.x);
|
||||
if ((table->Flags & ImGuiTableFlags_Sortable) && !(column->Flags & ImGuiTableColumnFlags_NoSort))
|
||||
{
|
||||
if (column->SortOrder != -1)
|
||||
@ -3869,6 +3904,7 @@ void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiOldColumnFl
|
||||
columns->Count = columns_count;
|
||||
columns->Flags = flags;
|
||||
window->DC.CurrentColumns = columns;
|
||||
window->DC.NavIsScrollPushableX = false; // Shortcut for NavUpdateCurrentWindowIsScrollPushableX();
|
||||
|
||||
columns->HostCursorPosY = window->DC.CursorPos.y;
|
||||
columns->HostCursorMaxPosX = window->DC.CursorMaxPos.x;
|
||||
@ -4059,6 +4095,7 @@ void ImGui::EndColumns()
|
||||
window->DC.CurrentColumns = NULL;
|
||||
window->DC.ColumnsOffset.x = 0.0f;
|
||||
window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
|
||||
NavUpdateCurrentWindowIsScrollPushableX();
|
||||
}
|
||||
|
||||
void ImGui::Columns(int columns_count, const char* id, bool border)
|
||||
|
596
3rdparty/dear-imgui/imgui_widgets.cpp
vendored
596
3rdparty/dear-imgui/imgui_widgets.cpp
vendored
File diff suppressed because it is too large
Load Diff
@ -207,7 +207,7 @@ namespace ImGui
|
||||
|
||||
AlignTextToFramePadding();
|
||||
PushItemWidth(50);
|
||||
PushAllowKeyboardFocus(false);
|
||||
PushTabStop(false);
|
||||
int rows_backup = Rows;
|
||||
if (DragInt("##rows", &Rows, 0.2f, 4, 32, "%.0f rows"))
|
||||
{
|
||||
@ -216,7 +216,7 @@ namespace ImGui
|
||||
SetWindowSize(new_window_size);
|
||||
}
|
||||
|
||||
PopAllowKeyboardFocus();
|
||||
PopTabStop();
|
||||
PopItemWidth();
|
||||
SameLine();
|
||||
Text("Range %0*x..%0*x", addr_digits_count, (int)base_display_addr, addr_digits_count, (int)base_display_addr+mem_size-1);
|
||||
|
@ -102,7 +102,7 @@ bool InitThread()
|
||||
return false;
|
||||
}
|
||||
|
||||
if (OS_GetTLSValue(ThreadInitializeIndex) != 0)
|
||||
if (OS_GetTLSValue(ThreadInitializeIndex) != nullptr)
|
||||
return true;
|
||||
|
||||
if (! OS_SetTLSValue(ThreadInitializeIndex, (void *)1)) {
|
||||
@ -130,8 +130,8 @@ bool DetachThread()
|
||||
//
|
||||
// Function is re-entrant and this thread may not have been initialized.
|
||||
//
|
||||
if (OS_GetTLSValue(ThreadInitializeIndex) != 0) {
|
||||
if (!OS_SetTLSValue(ThreadInitializeIndex, (void *)0)) {
|
||||
if (OS_GetTLSValue(ThreadInitializeIndex) != nullptr) {
|
||||
if (!OS_SetTLSValue(ThreadInitializeIndex, nullptr)) {
|
||||
assert(0 && "DetachThread(): Unable to clear init flag.");
|
||||
success = false;
|
||||
}
|
||||
|
35
3rdparty/glslang/SPIRV/GLSL.ext.ARM.h
vendored
Normal file
35
3rdparty/glslang/SPIRV/GLSL.ext.ARM.h
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
** Copyright (c) 2022 ARM Limited
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
** of this software and/or associated documentation files (the "Materials"),
|
||||
** to deal in the Materials without restriction, including without limitation
|
||||
** the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
** and/or sell copies of the Materials, and to permit persons to whom the
|
||||
** Materials are furnished to do so, subject to the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included in
|
||||
** all copies or substantial portions of the Materials.
|
||||
**
|
||||
** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
|
||||
** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
|
||||
** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
|
||||
** IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
#ifndef GLSLextARM_H
|
||||
#define GLSLextARM_H
|
||||
|
||||
static const int GLSLextARMVersion = 100;
|
||||
static const int GLSLextARMRevision = 1;
|
||||
|
||||
static const char * const E_SPV_ARM_core_builtins = "SPV_ARM_core_builtins";
|
||||
|
||||
#endif // #ifndef GLSLextARM_H
|
1
3rdparty/glslang/SPIRV/GLSL.ext.EXT.h
vendored
1
3rdparty/glslang/SPIRV/GLSL.ext.EXT.h
vendored
@ -39,6 +39,7 @@ static const char* const E_SPV_EXT_shader_atomic_float_add = "SPV_EXT_shader_ato
|
||||
static const char* const E_SPV_EXT_shader_atomic_float16_add = "SPV_EXT_shader_atomic_float16_add";
|
||||
static const char* const E_SPV_EXT_shader_atomic_float_min_max = "SPV_EXT_shader_atomic_float_min_max";
|
||||
static const char* const E_SPV_EXT_shader_image_int64 = "SPV_EXT_shader_image_int64";
|
||||
static const char* const E_SPV_EXT_shader_tile_image = "SPV_EXT_shader_tile_image";
|
||||
static const char* const E_SPV_EXT_mesh_shader = "SPV_EXT_mesh_shader";
|
||||
|
||||
#endif // #ifndef GLSLextEXT_H
|
||||
|
1
3rdparty/glslang/SPIRV/GLSL.ext.KHR.h
vendored
1
3rdparty/glslang/SPIRV/GLSL.ext.KHR.h
vendored
@ -54,5 +54,6 @@ static const char* const E_SPV_KHR_workgroup_memory_explicit_layout = "SPV_KHR_w
|
||||
static const char* const E_SPV_KHR_subgroup_uniform_control_flow = "SPV_KHR_subgroup_uniform_control_flow";
|
||||
static const char* const E_SPV_KHR_fragment_shader_barycentric = "SPV_KHR_fragment_shader_barycentric";
|
||||
static const char* const E_SPV_AMD_shader_early_and_late_fragment_tests = "SPV_AMD_shader_early_and_late_fragment_tests";
|
||||
static const char* const E_SPV_KHR_ray_tracing_position_fetch = "SPV_KHR_ray_tracing_position_fetch";
|
||||
|
||||
#endif // #ifndef GLSLextKHR_H
|
||||
|
3
3rdparty/glslang/SPIRV/GLSL.ext.NV.h
vendored
3
3rdparty/glslang/SPIRV/GLSL.ext.NV.h
vendored
@ -81,4 +81,7 @@ const char* const E_SPV_NV_cooperative_matrix = "SPV_NV_cooperative_matrix";
|
||||
//SPV_NV_shader_sm_builtins
|
||||
const char* const E_SPV_NV_shader_sm_builtins = "SPV_NV_shader_sm_builtins";
|
||||
|
||||
//SPV_NV_shader_execution_reorder
|
||||
const char* const E_SPV_NV_shader_invocation_reorder = "SPV_NV_shader_invocation_reorder";
|
||||
|
||||
#endif // #ifndef GLSLextNV_H
|
||||
|
610
3rdparty/glslang/SPIRV/GlslangToSpv.cpp
vendored
Normal file → Executable file
610
3rdparty/glslang/SPIRV/GlslangToSpv.cpp
vendored
Normal file → Executable file
@ -49,6 +49,7 @@ namespace spv {
|
||||
#include "GLSL.ext.EXT.h"
|
||||
#include "GLSL.ext.AMD.h"
|
||||
#include "GLSL.ext.NV.h"
|
||||
#include "GLSL.ext.ARM.h"
|
||||
#include "NonSemanticDebugPrintf.h"
|
||||
}
|
||||
|
||||
@ -174,7 +175,7 @@ protected:
|
||||
spv::Id convertGlslangStructToSpvType(const glslang::TType&, const glslang::TTypeList* glslangStruct,
|
||||
glslang::TLayoutPacking, const glslang::TQualifier&);
|
||||
void decorateStructType(const glslang::TType&, const glslang::TTypeList* glslangStruct, glslang::TLayoutPacking,
|
||||
const glslang::TQualifier&, spv::Id);
|
||||
const glslang::TQualifier&, spv::Id, const std::vector<spv::Id>& spvMembers);
|
||||
spv::Id makeArraySizeId(const glslang::TArraySizes&, int dim);
|
||||
spv::Id accessChainLoad(const glslang::TType& type);
|
||||
void accessChainStore(const glslang::TType& type, spv::Id rvalue);
|
||||
@ -277,12 +278,10 @@ protected:
|
||||
// requiring local translation to and from SPIR-V type on every access.
|
||||
// Maps <builtin-variable-id -> AST-required-type-id>
|
||||
std::unordered_map<spv::Id, spv::Id> forceType;
|
||||
|
||||
// Used later for generating OpTraceKHR/OpExecuteCallableKHR
|
||||
std::unordered_map<unsigned int, glslang::TIntermSymbol *> locationToSymbol[2];
|
||||
|
||||
// Used by Task shader while generating opearnds for OpEmitMeshTasksEXT
|
||||
spv::Id taskPayloadID;
|
||||
// Used later for generating OpTraceKHR/OpExecuteCallableKHR/OpHitObjectRecordHit*/OpHitObjectGetShaderBindingTableData
|
||||
std::unordered_map<unsigned int, glslang::TIntermSymbol *> locationToSymbol[4];
|
||||
};
|
||||
|
||||
//
|
||||
@ -352,6 +351,7 @@ spv::Dim TranslateDimensionality(const glslang::TSampler& sampler)
|
||||
case glslang::EsdRect: return spv::DimRect;
|
||||
case glslang::EsdBuffer: return spv::DimBuffer;
|
||||
case glslang::EsdSubpass: return spv::DimSubpassData;
|
||||
case glslang::EsdAttachmentEXT: return spv::DimTileImageDataEXT;
|
||||
default:
|
||||
assert(0);
|
||||
return spv::Dim2D;
|
||||
@ -376,26 +376,25 @@ spv::Decoration TranslatePrecisionDecoration(const glslang::TType& type)
|
||||
}
|
||||
|
||||
// Translate glslang type to SPIR-V block decorations.
|
||||
spv::Decoration TranslateBlockDecoration(const glslang::TType& type, bool useStorageBuffer)
|
||||
spv::Decoration TranslateBlockDecoration(const glslang::TStorageQualifier storage, bool useStorageBuffer)
|
||||
{
|
||||
if (type.getBasicType() == glslang::EbtBlock) {
|
||||
switch (type.getQualifier().storage) {
|
||||
case glslang::EvqUniform: return spv::DecorationBlock;
|
||||
case glslang::EvqBuffer: return useStorageBuffer ? spv::DecorationBlock : spv::DecorationBufferBlock;
|
||||
case glslang::EvqVaryingIn: return spv::DecorationBlock;
|
||||
case glslang::EvqVaryingOut: return spv::DecorationBlock;
|
||||
case glslang::EvqShared: return spv::DecorationBlock;
|
||||
switch (storage) {
|
||||
case glslang::EvqUniform: return spv::DecorationBlock;
|
||||
case glslang::EvqBuffer: return useStorageBuffer ? spv::DecorationBlock : spv::DecorationBufferBlock;
|
||||
case glslang::EvqVaryingIn: return spv::DecorationBlock;
|
||||
case glslang::EvqVaryingOut: return spv::DecorationBlock;
|
||||
case glslang::EvqShared: return spv::DecorationBlock;
|
||||
#ifndef GLSLANG_WEB
|
||||
case glslang::EvqPayload: return spv::DecorationBlock;
|
||||
case glslang::EvqPayloadIn: return spv::DecorationBlock;
|
||||
case glslang::EvqHitAttr: return spv::DecorationBlock;
|
||||
case glslang::EvqCallableData: return spv::DecorationBlock;
|
||||
case glslang::EvqCallableDataIn: return spv::DecorationBlock;
|
||||
case glslang::EvqPayload: return spv::DecorationBlock;
|
||||
case glslang::EvqPayloadIn: return spv::DecorationBlock;
|
||||
case glslang::EvqHitAttr: return spv::DecorationBlock;
|
||||
case glslang::EvqCallableData: return spv::DecorationBlock;
|
||||
case glslang::EvqCallableDataIn: return spv::DecorationBlock;
|
||||
case glslang::EvqHitObjectAttrNV: return spv::DecorationBlock;
|
||||
#endif
|
||||
default:
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
|
||||
return spv::DecorationMax;
|
||||
@ -468,6 +467,7 @@ spv::Decoration TranslateLayoutDecoration(const glslang::TType& type, glslang::T
|
||||
case glslang::EvqHitAttr:
|
||||
case glslang::EvqCallableData:
|
||||
case glslang::EvqCallableDataIn:
|
||||
case glslang::EvqHitObjectAttrNV:
|
||||
return spv::DecorationMax;
|
||||
#endif
|
||||
default:
|
||||
@ -1011,6 +1011,8 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
|
||||
return spv::BuiltInRayTmaxKHR;
|
||||
case glslang::EbvCullMask:
|
||||
return spv::BuiltInCullMaskKHR;
|
||||
case glslang::EbvPositionFetch:
|
||||
return spv::BuiltInHitTriangleVertexPositionsKHR;
|
||||
case glslang::EbvInstanceCustomIndex:
|
||||
return spv::BuiltInInstanceCustomIndexKHR;
|
||||
case glslang::EbvHitT:
|
||||
@ -1106,6 +1108,28 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
|
||||
builder.addExtension(spv::E_SPV_NV_shader_sm_builtins);
|
||||
builder.addCapability(spv::CapabilityShaderSMBuiltinsNV);
|
||||
return spv::BuiltInSMIDNV;
|
||||
|
||||
// ARM builtins
|
||||
case glslang::EbvCoreCountARM:
|
||||
builder.addExtension(spv::E_SPV_ARM_core_builtins);
|
||||
builder.addCapability(spv::CapabilityCoreBuiltinsARM);
|
||||
return spv::BuiltInCoreCountARM;
|
||||
case glslang::EbvCoreIDARM:
|
||||
builder.addExtension(spv::E_SPV_ARM_core_builtins);
|
||||
builder.addCapability(spv::CapabilityCoreBuiltinsARM);
|
||||
return spv::BuiltInCoreIDARM;
|
||||
case glslang::EbvCoreMaxIDARM:
|
||||
builder.addExtension(spv::E_SPV_ARM_core_builtins);
|
||||
builder.addCapability(spv::CapabilityCoreBuiltinsARM);
|
||||
return spv::BuiltInCoreMaxIDARM;
|
||||
case glslang::EbvWarpIDARM:
|
||||
builder.addExtension(spv::E_SPV_ARM_core_builtins);
|
||||
builder.addCapability(spv::CapabilityCoreBuiltinsARM);
|
||||
return spv::BuiltInWarpIDARM;
|
||||
case glslang::EbvWarpMaxIDARM:
|
||||
builder.addExtension(spv::E_SPV_ARM_core_builtins);
|
||||
builder.addCapability(spv::CapabilityCoreBuiltinsARM);
|
||||
return spv::BuiltInWarpMaxIDARM;
|
||||
#endif
|
||||
|
||||
default:
|
||||
@ -1276,7 +1300,7 @@ spv::LoopControlMask TGlslangToSpvTraverser::TranslateLoopControl(const glslang:
|
||||
// Translate glslang type to SPIR-V storage class.
|
||||
spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::TType& type)
|
||||
{
|
||||
if (type.getBasicType() == glslang::EbtRayQuery)
|
||||
if (type.getBasicType() == glslang::EbtRayQuery || type.getBasicType() == glslang::EbtHitObjectNV)
|
||||
return spv::StorageClassPrivate;
|
||||
#ifndef GLSLANG_WEB
|
||||
if (type.getQualifier().isSpirvByReference()) {
|
||||
@ -1288,12 +1312,17 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T
|
||||
return spv::StorageClassInput;
|
||||
if (type.getQualifier().isPipeOutput())
|
||||
return spv::StorageClassOutput;
|
||||
if (type.getQualifier().storage == glslang::EvqTileImageEXT || type.isAttachmentEXT()) {
|
||||
builder.addExtension(spv::E_SPV_EXT_shader_tile_image);
|
||||
builder.addCapability(spv::CapabilityTileImageColorReadAccessEXT);
|
||||
return spv::StorageClassTileImageEXT;
|
||||
}
|
||||
|
||||
if (glslangIntermediate->getSource() != glslang::EShSourceHlsl ||
|
||||
type.getQualifier().storage == glslang::EvqUniform) {
|
||||
if (type.isAtomic())
|
||||
return spv::StorageClassAtomicCounter;
|
||||
if (type.containsOpaque())
|
||||
if (type.containsOpaque() && !glslangIntermediate->getBindlessMode())
|
||||
return spv::StorageClassUniformConstant;
|
||||
}
|
||||
|
||||
@ -1333,6 +1362,7 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T
|
||||
case glslang::EvqCallableData: return spv::StorageClassCallableDataKHR;
|
||||
case glslang::EvqCallableDataIn: return spv::StorageClassIncomingCallableDataKHR;
|
||||
case glslang::EvqtaskPayloadSharedEXT : return spv::StorageClassTaskPayloadWorkgroupEXT;
|
||||
case glslang::EvqHitObjectAttrNV: return spv::StorageClassHitObjectAttributeNV;
|
||||
case glslang::EvqSpirvStorageClass: return static_cast<spv::StorageClass>(type.getQualifier().spirvStorageClass);
|
||||
#endif
|
||||
default:
|
||||
@ -1658,6 +1688,24 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion,
|
||||
builder.addExtension(spv::E_SPV_KHR_post_depth_coverage);
|
||||
}
|
||||
|
||||
if (glslangIntermediate->getNonCoherentColorAttachmentReadEXT()) {
|
||||
builder.addCapability(spv::CapabilityTileImageColorReadAccessEXT);
|
||||
builder.addExecutionMode(shaderEntry, spv::ExecutionModeNonCoherentColorAttachmentReadEXT);
|
||||
builder.addExtension(spv::E_SPV_EXT_shader_tile_image);
|
||||
}
|
||||
|
||||
if (glslangIntermediate->getNonCoherentDepthAttachmentReadEXT()) {
|
||||
builder.addCapability(spv::CapabilityTileImageDepthReadAccessEXT);
|
||||
builder.addExecutionMode(shaderEntry, spv::ExecutionModeNonCoherentDepthAttachmentReadEXT);
|
||||
builder.addExtension(spv::E_SPV_EXT_shader_tile_image);
|
||||
}
|
||||
|
||||
if (glslangIntermediate->getNonCoherentStencilAttachmentReadEXT()) {
|
||||
builder.addCapability(spv::CapabilityTileImageStencilReadAccessEXT);
|
||||
builder.addExecutionMode(shaderEntry, spv::ExecutionModeNonCoherentStencilAttachmentReadEXT);
|
||||
builder.addExtension(spv::E_SPV_EXT_shader_tile_image);
|
||||
}
|
||||
|
||||
if (glslangIntermediate->isDepthReplacing())
|
||||
builder.addExecutionMode(shaderEntry, spv::ExecutionModeDepthReplacing);
|
||||
|
||||
@ -1835,13 +1883,16 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion,
|
||||
builder.addCapability(spv::CapabilityRayTracingNV);
|
||||
builder.addExtension("SPV_NV_ray_tracing");
|
||||
}
|
||||
if (glslangIntermediate->getStage() != EShLangRayGen && glslangIntermediate->getStage() != EShLangCallable)
|
||||
{
|
||||
if (extensions.find("GL_EXT_ray_cull_mask") != extensions.end()) {
|
||||
builder.addCapability(spv::CapabilityRayCullMaskKHR);
|
||||
builder.addExtension("SPV_KHR_ray_cull_mask");
|
||||
}
|
||||
}
|
||||
if (glslangIntermediate->getStage() != EShLangRayGen && glslangIntermediate->getStage() != EShLangCallable) {
|
||||
if (extensions.find("GL_EXT_ray_cull_mask") != extensions.end()) {
|
||||
builder.addCapability(spv::CapabilityRayCullMaskKHR);
|
||||
builder.addExtension("SPV_KHR_ray_cull_mask");
|
||||
}
|
||||
if (extensions.find("GL_EXT_ray_tracing_position_fetch") != extensions.end()) {
|
||||
builder.addCapability(spv::CapabilityRayTracingPositionFetchKHR);
|
||||
builder.addExtension("SPV_KHR_ray_tracing_position_fetch");
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case EShLangTask:
|
||||
@ -1982,6 +2033,10 @@ void TGlslangToSpvTraverser::dumpSpv(std::vector<unsigned int>& out)
|
||||
//
|
||||
void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol)
|
||||
{
|
||||
// We update the line information even though no code might be generated here
|
||||
// This is helpful to yield correct lines for control flow instructions
|
||||
builder.setLine(symbol->getLoc().line, symbol->getLoc().getFilename());
|
||||
|
||||
SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder);
|
||||
if (symbol->getType().isStruct())
|
||||
glslangTypeToIdMap[symbol->getType().getStruct()] = symbol->getId();
|
||||
@ -2133,6 +2188,9 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T
|
||||
node->getRight()->traverse(this);
|
||||
spv::Id rValue = accessChainLoad(node->getRight()->getType());
|
||||
|
||||
// reset line number for assignment
|
||||
builder.setLine(node->getLoc().line, node->getLoc().getFilename());
|
||||
|
||||
if (node->getOp() != glslang::EOpAssign) {
|
||||
// the left is also an r-value
|
||||
builder.setAccessChain(lValue);
|
||||
@ -2559,6 +2617,35 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
|
||||
|
||||
spv::Builder::AccessChain::CoherentFlags lvalueCoherentFlags;
|
||||
|
||||
const auto hitObjectOpsWithLvalue = [](glslang::TOperator op) {
|
||||
switch(op) {
|
||||
case glslang::EOpReorderThreadNV:
|
||||
case glslang::EOpHitObjectGetCurrentTimeNV:
|
||||
case glslang::EOpHitObjectGetHitKindNV:
|
||||
case glslang::EOpHitObjectGetPrimitiveIndexNV:
|
||||
case glslang::EOpHitObjectGetGeometryIndexNV:
|
||||
case glslang::EOpHitObjectGetInstanceIdNV:
|
||||
case glslang::EOpHitObjectGetInstanceCustomIndexNV:
|
||||
case glslang::EOpHitObjectGetObjectRayDirectionNV:
|
||||
case glslang::EOpHitObjectGetObjectRayOriginNV:
|
||||
case glslang::EOpHitObjectGetWorldRayDirectionNV:
|
||||
case glslang::EOpHitObjectGetWorldRayOriginNV:
|
||||
case glslang::EOpHitObjectGetWorldToObjectNV:
|
||||
case glslang::EOpHitObjectGetObjectToWorldNV:
|
||||
case glslang::EOpHitObjectGetRayTMaxNV:
|
||||
case glslang::EOpHitObjectGetRayTMinNV:
|
||||
case glslang::EOpHitObjectIsEmptyNV:
|
||||
case glslang::EOpHitObjectIsHitNV:
|
||||
case glslang::EOpHitObjectIsMissNV:
|
||||
case glslang::EOpHitObjectRecordEmptyNV:
|
||||
case glslang::EOpHitObjectGetShaderBindingTableRecordIndexNV:
|
||||
case glslang::EOpHitObjectGetShaderRecordBufferHandleNV:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
if (node->getOp() == glslang::EOpAtomicCounterIncrement ||
|
||||
node->getOp() == glslang::EOpAtomicCounterDecrement ||
|
||||
@ -2573,7 +2660,8 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
|
||||
node->getOp() == glslang::EOpRayQueryGetIntersectionCandidateAABBOpaque ||
|
||||
node->getOp() == glslang::EOpRayQueryTerminate ||
|
||||
node->getOp() == glslang::EOpRayQueryConfirmIntersection ||
|
||||
(node->getOp() == glslang::EOpSpirvInst && operandNode->getAsTyped()->getQualifier().isSpirvByReference())) {
|
||||
(node->getOp() == glslang::EOpSpirvInst && operandNode->getAsTyped()->getQualifier().isSpirvByReference()) ||
|
||||
hitObjectOpsWithLvalue(node->getOp())) {
|
||||
operand = builder.accessChainGetLValue(); // Special case l-value operands
|
||||
lvalueCoherentFlags = builder.getAccessChain().coherentFlags;
|
||||
lvalueCoherentFlags |= TranslateCoherent(operandNode->getAsTyped()->getType());
|
||||
@ -2708,6 +2796,12 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
|
||||
case glslang::EOpRayQueryConfirmIntersection:
|
||||
builder.createNoResultOp(spv::OpRayQueryConfirmIntersectionKHR, operand);
|
||||
return false;
|
||||
case glslang::EOpReorderThreadNV:
|
||||
builder.createNoResultOp(spv::OpReorderThreadWithHitObjectNV, operand);
|
||||
return false;
|
||||
case glslang::EOpHitObjectRecordEmptyNV:
|
||||
builder.createNoResultOp(spv::OpHitObjectRecordEmptyNV, operand);
|
||||
return false;
|
||||
#endif
|
||||
|
||||
default:
|
||||
@ -3199,6 +3293,48 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
||||
builder.addExtension(spv::E_SPV_EXT_fragment_shader_interlock);
|
||||
noReturnValue = true;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectTraceRayNV:
|
||||
case glslang::EOpHitObjectTraceRayMotionNV:
|
||||
case glslang::EOpHitObjectGetAttributesNV:
|
||||
case glslang::EOpHitObjectExecuteShaderNV:
|
||||
case glslang::EOpHitObjectRecordEmptyNV:
|
||||
case glslang::EOpHitObjectRecordMissNV:
|
||||
case glslang::EOpHitObjectRecordMissMotionNV:
|
||||
case glslang::EOpHitObjectRecordHitNV:
|
||||
case glslang::EOpHitObjectRecordHitMotionNV:
|
||||
case glslang::EOpHitObjectRecordHitWithIndexNV:
|
||||
case glslang::EOpHitObjectRecordHitWithIndexMotionNV:
|
||||
case glslang::EOpReorderThreadNV:
|
||||
noReturnValue = true;
|
||||
//Fallthrough
|
||||
case glslang::EOpHitObjectIsEmptyNV:
|
||||
case glslang::EOpHitObjectIsMissNV:
|
||||
case glslang::EOpHitObjectIsHitNV:
|
||||
case glslang::EOpHitObjectGetRayTMinNV:
|
||||
case glslang::EOpHitObjectGetRayTMaxNV:
|
||||
case glslang::EOpHitObjectGetObjectRayOriginNV:
|
||||
case glslang::EOpHitObjectGetObjectRayDirectionNV:
|
||||
case glslang::EOpHitObjectGetWorldRayOriginNV:
|
||||
case glslang::EOpHitObjectGetWorldRayDirectionNV:
|
||||
case glslang::EOpHitObjectGetObjectToWorldNV:
|
||||
case glslang::EOpHitObjectGetWorldToObjectNV:
|
||||
case glslang::EOpHitObjectGetInstanceCustomIndexNV:
|
||||
case glslang::EOpHitObjectGetInstanceIdNV:
|
||||
case glslang::EOpHitObjectGetGeometryIndexNV:
|
||||
case glslang::EOpHitObjectGetPrimitiveIndexNV:
|
||||
case glslang::EOpHitObjectGetHitKindNV:
|
||||
case glslang::EOpHitObjectGetCurrentTimeNV:
|
||||
case glslang::EOpHitObjectGetShaderBindingTableRecordIndexNV:
|
||||
case glslang::EOpHitObjectGetShaderRecordBufferHandleNV:
|
||||
builder.addExtension(spv::E_SPV_NV_shader_invocation_reorder);
|
||||
builder.addCapability(spv::CapabilityShaderInvocationReorderNV);
|
||||
break;
|
||||
case glslang::EOpRayQueryGetIntersectionTriangleVertexPositionsEXT:
|
||||
builder.addExtension(spv::E_SPV_KHR_ray_tracing_position_fetch);
|
||||
builder.addCapability(spv::CapabilityRayQueryPositionFetchKHR);
|
||||
noReturnValue = true;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case glslang::EOpDebugPrintf:
|
||||
@ -3256,6 +3392,22 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
||||
lvalue = true;
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case glslang::EOpHitObjectRecordHitNV:
|
||||
case glslang::EOpHitObjectRecordHitMotionNV:
|
||||
case glslang::EOpHitObjectRecordHitWithIndexNV:
|
||||
case glslang::EOpHitObjectRecordHitWithIndexMotionNV:
|
||||
case glslang::EOpHitObjectTraceRayNV:
|
||||
case glslang::EOpHitObjectTraceRayMotionNV:
|
||||
case glslang::EOpHitObjectExecuteShaderNV:
|
||||
case glslang::EOpHitObjectRecordMissNV:
|
||||
case glslang::EOpHitObjectRecordMissMotionNV:
|
||||
case glslang::EOpHitObjectGetAttributesNV:
|
||||
if (arg == 0)
|
||||
lvalue = true;
|
||||
break;
|
||||
|
||||
case glslang::EOpRayQueryInitialize:
|
||||
case glslang::EOpRayQueryTerminate:
|
||||
case glslang::EOpRayQueryConfirmIntersection:
|
||||
@ -3356,6 +3508,15 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
||||
if (glslangOperands[arg]->getAsTyped()->getQualifier().isSpirvByReference())
|
||||
lvalue = true;
|
||||
break;
|
||||
case glslang::EOpReorderThreadNV:
|
||||
//Three variants of reorderThreadNV, two of them use hitObjectNV
|
||||
if (arg == 0 && glslangOperands.size() != 2)
|
||||
lvalue = true;
|
||||
break;
|
||||
case glslang::EOpRayQueryGetIntersectionTriangleVertexPositionsEXT:
|
||||
if (arg == 0 || arg == 2)
|
||||
lvalue = true;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
@ -3412,7 +3573,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
||||
} else if (arg == 2) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// for l-values, pass the address, for r-values, pass the value
|
||||
@ -3448,17 +3609,30 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
||||
glslangOp == glslang::EOpRayQueryGetIntersectionObjectRayDirection ||
|
||||
glslangOp == glslang::EOpRayQueryGetIntersectionObjectRayOrigin ||
|
||||
glslangOp == glslang::EOpRayQueryGetIntersectionObjectToWorld ||
|
||||
glslangOp == glslang::EOpRayQueryGetIntersectionWorldToObject
|
||||
glslangOp == glslang::EOpRayQueryGetIntersectionWorldToObject ||
|
||||
glslangOp == glslang::EOpRayQueryGetIntersectionTriangleVertexPositionsEXT
|
||||
)) {
|
||||
bool cond = glslangOperands[arg]->getAsConstantUnion()->getConstArray()[0].getBConst();
|
||||
operands.push_back(builder.makeIntConstant(cond ? 1 : 0));
|
||||
} else if ((arg == 10 && glslangOp == glslang::EOpTraceKHR) ||
|
||||
(arg == 11 && glslangOp == glslang::EOpTraceRayMotionNV) ||
|
||||
(arg == 1 && glslangOp == glslang::EOpExecuteCallableKHR)) {
|
||||
const int opdNum = glslangOp == glslang::EOpTraceKHR ? 10 : (glslangOp == glslang::EOpTraceRayMotionNV ? 11 : 1);
|
||||
(arg == 1 && glslangOp == glslang::EOpExecuteCallableKHR) ||
|
||||
(arg == 1 && glslangOp == glslang::EOpHitObjectExecuteShaderNV) ||
|
||||
(arg == 11 && glslangOp == glslang::EOpHitObjectTraceRayNV) ||
|
||||
(arg == 12 && glslangOp == glslang::EOpHitObjectTraceRayMotionNV)) {
|
||||
const int set = glslangOp == glslang::EOpExecuteCallableKHR ? 1 : 0;
|
||||
|
||||
const int location = glslangOperands[opdNum]->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
const int location = glslangOperands[arg]->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
auto itNode = locationToSymbol[set].find(location);
|
||||
visitSymbol(itNode->second);
|
||||
spv::Id symId = getSymbolId(itNode->second);
|
||||
operands.push_back(symId);
|
||||
} else if ((arg == 12 && glslangOp == glslang::EOpHitObjectRecordHitNV) ||
|
||||
(arg == 13 && glslangOp == glslang::EOpHitObjectRecordHitMotionNV) ||
|
||||
(arg == 11 && glslangOp == glslang::EOpHitObjectRecordHitWithIndexNV) ||
|
||||
(arg == 12 && glslangOp == glslang::EOpHitObjectRecordHitWithIndexMotionNV) ||
|
||||
(arg == 1 && glslangOp == glslang::EOpHitObjectGetAttributesNV)) {
|
||||
const int location = glslangOperands[arg]->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
const int set = 2;
|
||||
auto itNode = locationToSymbol[set].find(location);
|
||||
visitSymbol(itNode->second);
|
||||
spv::Id symId = getSymbolId(itNode->second);
|
||||
@ -3502,6 +3676,19 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
||||
|
||||
builder.createNoResultOp(spv::OpCooperativeMatrixStoreNV, idImmOps);
|
||||
result = 0;
|
||||
} else if (node->getOp() == glslang::EOpRayQueryGetIntersectionTriangleVertexPositionsEXT) {
|
||||
std::vector<spv::IdImmediate> idImmOps;
|
||||
|
||||
idImmOps.push_back(spv::IdImmediate(true, operands[0])); // q
|
||||
idImmOps.push_back(spv::IdImmediate(true, operands[1])); // committed
|
||||
|
||||
spv::Id typeId = builder.makeArrayType(builder.makeVectorType(builder.makeFloatType(32), 3),
|
||||
builder.makeUintConstant(3), 0);
|
||||
// do the op
|
||||
spv::Id result = builder.createOp(spv::OpRayQueryGetIntersectionTriangleVertexPositionsKHR, typeId, idImmOps);
|
||||
// store the result to the pointer (out param 'm')
|
||||
builder.createStore(result, operands[2]);
|
||||
result = 0;
|
||||
} else
|
||||
#endif
|
||||
if (atomic) {
|
||||
@ -3654,10 +3841,11 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang
|
||||
// Find a way of executing both sides and selecting the right result.
|
||||
const auto executeBothSides = [&]() -> void {
|
||||
// execute both sides
|
||||
spv::Id resultType = convertGlslangToSpvType(node->getType());
|
||||
node->getTrueBlock()->traverse(this);
|
||||
spv::Id trueValue = accessChainLoad(node->getTrueBlock()->getAsTyped()->getType());
|
||||
node->getFalseBlock()->traverse(this);
|
||||
spv::Id falseValue = accessChainLoad(node->getTrueBlock()->getAsTyped()->getType());
|
||||
spv::Id falseValue = accessChainLoad(node->getFalseBlock()->getAsTyped()->getType());
|
||||
|
||||
builder.setLine(node->getLoc().line, node->getLoc().getFilename());
|
||||
|
||||
@ -3666,8 +3854,8 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang
|
||||
return;
|
||||
|
||||
// emit code to select between trueValue and falseValue
|
||||
|
||||
// see if OpSelect can handle it
|
||||
// see if OpSelect can handle the result type, and that the SPIR-V types
|
||||
// of the inputs match the result type.
|
||||
if (isOpSelectable()) {
|
||||
// Emit OpSelect for this selection.
|
||||
|
||||
@ -3679,10 +3867,18 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang
|
||||
builder.getNumComponents(trueValue)));
|
||||
}
|
||||
|
||||
// If the types do not match, it is because of mismatched decorations on aggregates.
|
||||
// Since isOpSelectable only lets us get here for SPIR-V >= 1.4, we can use OpCopyObject
|
||||
// to get matching types.
|
||||
if (builder.getTypeId(trueValue) != resultType) {
|
||||
trueValue = builder.createUnaryOp(spv::OpCopyLogical, resultType, trueValue);
|
||||
}
|
||||
if (builder.getTypeId(falseValue) != resultType) {
|
||||
falseValue = builder.createUnaryOp(spv::OpCopyLogical, resultType, falseValue);
|
||||
}
|
||||
|
||||
// OpSelect
|
||||
result = builder.createTriOp(spv::OpSelect,
|
||||
convertGlslangToSpvType(node->getType()), condition,
|
||||
trueValue, falseValue);
|
||||
result = builder.createTriOp(spv::OpSelect, resultType, condition, trueValue, falseValue);
|
||||
|
||||
builder.clearAccessChain();
|
||||
builder.setAccessChainRValue(result);
|
||||
@ -3690,7 +3886,7 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang
|
||||
// We need control flow to select the result.
|
||||
// TODO: Once SPIR-V OpSelect allows arbitrary types, eliminate this path.
|
||||
result = builder.createVariable(TranslatePrecisionDecoration(node->getType()),
|
||||
spv::StorageClassFunction, convertGlslangToSpvType(node->getType()));
|
||||
spv::StorageClassFunction, resultType);
|
||||
|
||||
// Selection control:
|
||||
const spv::SelectionControlMask control = TranslateSelectionControl(*node);
|
||||
@ -3699,10 +3895,15 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang
|
||||
spv::Builder::If ifBuilder(condition, control, builder);
|
||||
|
||||
// emit the "then" statement
|
||||
builder.createStore(trueValue, result);
|
||||
builder.clearAccessChain();
|
||||
builder.setAccessChainLValue(result);
|
||||
multiTypeStore(node->getType(), trueValue);
|
||||
|
||||
ifBuilder.makeBeginElse();
|
||||
// emit the "else" statement
|
||||
builder.createStore(falseValue, result);
|
||||
builder.clearAccessChain();
|
||||
builder.setAccessChainLValue(result);
|
||||
multiTypeStore(node->getType(), falseValue);
|
||||
|
||||
// finish off the control flow
|
||||
ifBuilder.makeEndIf();
|
||||
@ -3729,16 +3930,26 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang
|
||||
// emit the "then" statement
|
||||
if (node->getTrueBlock() != nullptr) {
|
||||
node->getTrueBlock()->traverse(this);
|
||||
if (result != spv::NoResult)
|
||||
builder.createStore(accessChainLoad(node->getTrueBlock()->getAsTyped()->getType()), result);
|
||||
if (result != spv::NoResult) {
|
||||
spv::Id load = accessChainLoad(node->getTrueBlock()->getAsTyped()->getType());
|
||||
|
||||
builder.clearAccessChain();
|
||||
builder.setAccessChainLValue(result);
|
||||
multiTypeStore(node->getType(), load);
|
||||
}
|
||||
}
|
||||
|
||||
if (node->getFalseBlock() != nullptr) {
|
||||
ifBuilder.makeBeginElse();
|
||||
// emit the "else" statement
|
||||
node->getFalseBlock()->traverse(this);
|
||||
if (result != spv::NoResult)
|
||||
builder.createStore(accessChainLoad(node->getFalseBlock()->getAsTyped()->getType()), result);
|
||||
if (result != spv::NoResult) {
|
||||
spv::Id load = accessChainLoad(node->getFalseBlock()->getAsTyped()->getType());
|
||||
|
||||
builder.clearAccessChain();
|
||||
builder.setAccessChainLValue(result);
|
||||
multiTypeStore(node->getType(), load);
|
||||
}
|
||||
}
|
||||
|
||||
// finish off the control flow
|
||||
@ -4284,6 +4495,13 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
|
||||
case glslang::EbtString:
|
||||
// no type used for OpString
|
||||
return 0;
|
||||
|
||||
case glslang::EbtHitObjectNV: {
|
||||
builder.addExtension(spv::E_SPV_NV_shader_invocation_reorder);
|
||||
builder.addCapability(spv::CapabilityShaderInvocationReorderNV);
|
||||
spvType = builder.makeHitObjectNVType();
|
||||
}
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case glslang::EbtSpirvType: {
|
||||
// GL_EXT_spirv_intrinsics
|
||||
@ -4535,7 +4753,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangStructToSpvType(const glslang::TTy
|
||||
structMap[explicitLayout][qualifier.layoutMatrix][glslangMembers] = spvType;
|
||||
|
||||
// Decorate it
|
||||
decorateStructType(type, glslangMembers, explicitLayout, qualifier, spvType);
|
||||
decorateStructType(type, glslangMembers, explicitLayout, qualifier, spvType, spvMembers);
|
||||
|
||||
for (int i = 0; i < (int)deferredForwardPointers.size(); ++i) {
|
||||
auto it = deferredForwardPointers[i];
|
||||
@ -4549,7 +4767,8 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type,
|
||||
const glslang::TTypeList* glslangMembers,
|
||||
glslang::TLayoutPacking explicitLayout,
|
||||
const glslang::TQualifier& qualifier,
|
||||
spv::Id spvType)
|
||||
spv::Id spvType,
|
||||
const std::vector<spv::Id>& spvMembers)
|
||||
{
|
||||
// Name and decorate the non-hidden members
|
||||
int offset = -1;
|
||||
@ -4702,7 +4921,19 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type,
|
||||
|
||||
// Decorate the structure
|
||||
builder.addDecoration(spvType, TranslateLayoutDecoration(type, qualifier.layoutMatrix));
|
||||
builder.addDecoration(spvType, TranslateBlockDecoration(type, glslangIntermediate->usingStorageBuffer()));
|
||||
const auto basicType = type.getBasicType();
|
||||
const auto typeStorageQualifier = type.getQualifier().storage;
|
||||
if (basicType == glslang::EbtBlock) {
|
||||
builder.addDecoration(spvType, TranslateBlockDecoration(typeStorageQualifier, glslangIntermediate->usingStorageBuffer()));
|
||||
} else if (basicType == glslang::EbtStruct && glslangIntermediate->getSpv().vulkan > 0) {
|
||||
const auto hasRuntimeArray = !spvMembers.empty() && builder.getOpCode(spvMembers.back()) == spv::OpTypeRuntimeArray;
|
||||
if (hasRuntimeArray) {
|
||||
builder.addDecoration(spvType, TranslateBlockDecoration(typeStorageQualifier, glslangIntermediate->usingStorageBuffer()));
|
||||
}
|
||||
}
|
||||
|
||||
if (qualifier.hasHitObjectShaderRecordNV())
|
||||
builder.addDecoration(spvType, spv::DecorationHitObjectShaderRecordBufferNV);
|
||||
}
|
||||
|
||||
// Turn the expression forming the array size into an id.
|
||||
@ -5083,7 +5314,7 @@ bool TGlslangToSpvTraverser::originalParam(glslang::TStorageQualifier qualifier,
|
||||
return true;
|
||||
if (glslangIntermediate->getSource() == glslang::EShSourceHlsl)
|
||||
return paramType.getBasicType() == glslang::EbtBlock;
|
||||
return paramType.containsOpaque() || // sampler, etc.
|
||||
return (paramType.containsOpaque() && !glslangIntermediate->getBindlessMode()) || // sampler, etc.
|
||||
#ifndef GLSLANG_WEB
|
||||
paramType.getQualifier().isSpirvByReference() || // spirv_by_reference
|
||||
#endif
|
||||
@ -5230,6 +5461,10 @@ void TGlslangToSpvTraverser::collectRayTracingLinkerObjects()
|
||||
set = 1;
|
||||
break;
|
||||
|
||||
case glslang::EvqHitObjectAttrNV:
|
||||
set = 2;
|
||||
break;
|
||||
|
||||
default:
|
||||
set = -1;
|
||||
}
|
||||
@ -5378,6 +5613,10 @@ void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate&
|
||||
if (i == 7)
|
||||
lvalue = true;
|
||||
break;
|
||||
case glslang::EOpRayQueryGetIntersectionTriangleVertexPositionsEXT:
|
||||
if (i == 2)
|
||||
lvalue = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -5537,6 +5776,17 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
|
||||
return result;
|
||||
}
|
||||
|
||||
if (cracked.attachmentEXT) {
|
||||
if (opIt != arguments.end()) {
|
||||
spv::IdImmediate sample = { true, *opIt };
|
||||
operands.push_back(sample);
|
||||
}
|
||||
spv::Id result = builder.createOp(spv::OpColorAttachmentReadEXT, resultType(), operands);
|
||||
builder.addExtension(spv::E_SPV_EXT_shader_tile_image);
|
||||
builder.setPrecision(result, precision);
|
||||
return result;
|
||||
}
|
||||
|
||||
spv::IdImmediate coord = { true, *(opIt++) };
|
||||
operands.push_back(coord);
|
||||
if (node->getOp() == glslang::EOpImageLoad || node->getOp() == glslang::EOpImageLoadLod) {
|
||||
@ -6874,12 +7124,102 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDe
|
||||
case glslang::EOpConvUvec2ToAccStruct:
|
||||
unaryOp = spv::OpConvertUToAccelerationStructureKHR;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectIsEmptyNV:
|
||||
unaryOp = spv::OpHitObjectIsEmptyNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectIsMissNV:
|
||||
unaryOp = spv::OpHitObjectIsMissNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectIsHitNV:
|
||||
unaryOp = spv::OpHitObjectIsHitNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetObjectRayOriginNV:
|
||||
unaryOp = spv::OpHitObjectGetObjectRayOriginNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetObjectRayDirectionNV:
|
||||
unaryOp = spv::OpHitObjectGetObjectRayDirectionNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetWorldRayOriginNV:
|
||||
unaryOp = spv::OpHitObjectGetWorldRayOriginNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetWorldRayDirectionNV:
|
||||
unaryOp = spv::OpHitObjectGetWorldRayDirectionNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetObjectToWorldNV:
|
||||
unaryOp = spv::OpHitObjectGetObjectToWorldNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetWorldToObjectNV:
|
||||
unaryOp = spv::OpHitObjectGetWorldToObjectNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetRayTMinNV:
|
||||
unaryOp = spv::OpHitObjectGetRayTMinNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetRayTMaxNV:
|
||||
unaryOp = spv::OpHitObjectGetRayTMaxNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetPrimitiveIndexNV:
|
||||
unaryOp = spv::OpHitObjectGetPrimitiveIndexNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetInstanceIdNV:
|
||||
unaryOp = spv::OpHitObjectGetInstanceIdNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetInstanceCustomIndexNV:
|
||||
unaryOp = spv::OpHitObjectGetInstanceCustomIndexNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetGeometryIndexNV:
|
||||
unaryOp = spv::OpHitObjectGetGeometryIndexNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetHitKindNV:
|
||||
unaryOp = spv::OpHitObjectGetHitKindNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetCurrentTimeNV:
|
||||
unaryOp = spv::OpHitObjectGetCurrentTimeNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetShaderBindingTableRecordIndexNV:
|
||||
unaryOp = spv::OpHitObjectGetShaderBindingTableRecordIndexNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetShaderRecordBufferHandleNV:
|
||||
unaryOp = spv::OpHitObjectGetShaderRecordBufferHandleNV;
|
||||
break;
|
||||
|
||||
#endif
|
||||
|
||||
case glslang::EOpCopyObject:
|
||||
unaryOp = spv::OpCopyObject;
|
||||
break;
|
||||
|
||||
case glslang::EOpDepthAttachmentReadEXT:
|
||||
builder.addExtension(spv::E_SPV_EXT_shader_tile_image);
|
||||
builder.addCapability(spv::CapabilityTileImageDepthReadAccessEXT);
|
||||
unaryOp = spv::OpDepthAttachmentReadEXT;
|
||||
decorations.precision = spv::NoPrecision;
|
||||
break;
|
||||
case glslang::EOpStencilAttachmentReadEXT:
|
||||
builder.addExtension(spv::E_SPV_EXT_shader_tile_image);
|
||||
builder.addCapability(spv::CapabilityTileImageStencilReadAccessEXT);
|
||||
unaryOp = spv::OpStencilAttachmentReadEXT;
|
||||
decorations.precision = spv::DecorationRelaxedPrecision;
|
||||
break;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
@ -8615,6 +8955,122 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
|
||||
case glslang::EOpCooperativeMatrixMulAdd:
|
||||
opCode = spv::OpCooperativeMatrixMulAddNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectTraceRayNV:
|
||||
builder.createNoResultOp(spv::OpHitObjectTraceRayNV, operands);
|
||||
return 0;
|
||||
case glslang::EOpHitObjectTraceRayMotionNV:
|
||||
builder.createNoResultOp(spv::OpHitObjectTraceRayMotionNV, operands);
|
||||
return 0;
|
||||
case glslang::EOpHitObjectRecordHitNV:
|
||||
builder.createNoResultOp(spv::OpHitObjectRecordHitNV, operands);
|
||||
return 0;
|
||||
case glslang::EOpHitObjectRecordHitMotionNV:
|
||||
builder.createNoResultOp(spv::OpHitObjectRecordHitMotionNV, operands);
|
||||
return 0;
|
||||
case glslang::EOpHitObjectRecordHitWithIndexNV:
|
||||
builder.createNoResultOp(spv::OpHitObjectRecordHitWithIndexNV, operands);
|
||||
return 0;
|
||||
case glslang::EOpHitObjectRecordHitWithIndexMotionNV:
|
||||
builder.createNoResultOp(spv::OpHitObjectRecordHitWithIndexMotionNV, operands);
|
||||
return 0;
|
||||
case glslang::EOpHitObjectRecordMissNV:
|
||||
builder.createNoResultOp(spv::OpHitObjectRecordMissNV, operands);
|
||||
return 0;
|
||||
case glslang::EOpHitObjectRecordMissMotionNV:
|
||||
builder.createNoResultOp(spv::OpHitObjectRecordMissMotionNV, operands);
|
||||
return 0;
|
||||
case glslang::EOpHitObjectExecuteShaderNV:
|
||||
builder.createNoResultOp(spv::OpHitObjectExecuteShaderNV, operands);
|
||||
return 0;
|
||||
case glslang::EOpHitObjectIsEmptyNV:
|
||||
typeId = builder.makeBoolType();
|
||||
opCode = spv::OpHitObjectIsEmptyNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectIsMissNV:
|
||||
typeId = builder.makeBoolType();
|
||||
opCode = spv::OpHitObjectIsMissNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectIsHitNV:
|
||||
typeId = builder.makeBoolType();
|
||||
opCode = spv::OpHitObjectIsHitNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetRayTMinNV:
|
||||
typeId = builder.makeFloatType(32);
|
||||
opCode = spv::OpHitObjectGetRayTMinNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetRayTMaxNV:
|
||||
typeId = builder.makeFloatType(32);
|
||||
opCode = spv::OpHitObjectGetRayTMaxNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetObjectRayOriginNV:
|
||||
typeId = builder.makeVectorType(builder.makeFloatType(32), 3);
|
||||
opCode = spv::OpHitObjectGetObjectRayOriginNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetObjectRayDirectionNV:
|
||||
typeId = builder.makeVectorType(builder.makeFloatType(32), 3);
|
||||
opCode = spv::OpHitObjectGetObjectRayDirectionNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetWorldRayOriginNV:
|
||||
typeId = builder.makeVectorType(builder.makeFloatType(32), 3);
|
||||
opCode = spv::OpHitObjectGetWorldRayOriginNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetWorldRayDirectionNV:
|
||||
typeId = builder.makeVectorType(builder.makeFloatType(32), 3);
|
||||
opCode = spv::OpHitObjectGetWorldRayDirectionNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetWorldToObjectNV:
|
||||
typeId = builder.makeMatrixType(builder.makeFloatType(32), 4, 3);
|
||||
opCode = spv::OpHitObjectGetWorldToObjectNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetObjectToWorldNV:
|
||||
typeId = builder.makeMatrixType(builder.makeFloatType(32), 4, 3);
|
||||
opCode = spv::OpHitObjectGetObjectToWorldNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetInstanceCustomIndexNV:
|
||||
typeId = builder.makeIntegerType(32, 1);
|
||||
opCode = spv::OpHitObjectGetInstanceCustomIndexNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetInstanceIdNV:
|
||||
typeId = builder.makeIntegerType(32, 1);
|
||||
opCode = spv::OpHitObjectGetInstanceIdNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetGeometryIndexNV:
|
||||
typeId = builder.makeIntegerType(32, 1);
|
||||
opCode = spv::OpHitObjectGetGeometryIndexNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetPrimitiveIndexNV:
|
||||
typeId = builder.makeIntegerType(32, 1);
|
||||
opCode = spv::OpHitObjectGetPrimitiveIndexNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetHitKindNV:
|
||||
typeId = builder.makeIntegerType(32, 0);
|
||||
opCode = spv::OpHitObjectGetHitKindNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetCurrentTimeNV:
|
||||
typeId = builder.makeFloatType(32);
|
||||
opCode = spv::OpHitObjectGetCurrentTimeNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetShaderBindingTableRecordIndexNV:
|
||||
typeId = builder.makeIntegerType(32, 0);
|
||||
opCode = spv::OpHitObjectGetShaderBindingTableRecordIndexNV;
|
||||
return 0;
|
||||
case glslang::EOpHitObjectGetAttributesNV:
|
||||
builder.createNoResultOp(spv::OpHitObjectGetAttributesNV, operands);
|
||||
return 0;
|
||||
case glslang::EOpHitObjectGetShaderRecordBufferHandleNV:
|
||||
typeId = builder.makeVectorType(builder.makeUintType(32), 2);
|
||||
opCode = spv::OpHitObjectGetShaderRecordBufferHandleNV;
|
||||
break;
|
||||
case glslang::EOpReorderThreadNV: {
|
||||
if (operands.size() == 2) {
|
||||
builder.createNoResultOp(spv::OpReorderThreadWithHintNV, operands);
|
||||
} else {
|
||||
builder.createNoResultOp(spv::OpReorderThreadWithHitObjectNV, operands);
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
break;
|
||||
#endif // GLSLANG_WEB
|
||||
default:
|
||||
return 0;
|
||||
@ -8854,6 +9310,30 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv:
|
||||
return builder.createOp(spv::OpReadClockKHR, typeId, args);
|
||||
}
|
||||
#endif
|
||||
case glslang::EOpStencilAttachmentReadEXT:
|
||||
case glslang::EOpDepthAttachmentReadEXT:
|
||||
{
|
||||
builder.addExtension(spv::E_SPV_EXT_shader_tile_image);
|
||||
|
||||
spv::Decoration precision;
|
||||
spv::Op spv_op;
|
||||
if (op == glslang::EOpStencilAttachmentReadEXT)
|
||||
{
|
||||
precision = spv::DecorationRelaxedPrecision;
|
||||
spv_op = spv::OpStencilAttachmentReadEXT;
|
||||
builder.addCapability(spv::CapabilityTileImageStencilReadAccessEXT);
|
||||
}
|
||||
else
|
||||
{
|
||||
precision = spv::NoPrecision;
|
||||
spv_op = spv::OpDepthAttachmentReadEXT;
|
||||
builder.addCapability(spv::CapabilityTileImageDepthReadAccessEXT);
|
||||
}
|
||||
|
||||
std::vector<spv::Id> args; // Dummy args
|
||||
spv::Id result = builder.createOp(spv_op, typeId, args);
|
||||
return builder.setPrecision(result, precision);
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -8924,13 +9404,17 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
|
||||
}
|
||||
|
||||
if (symbol->getQualifier().hasLocation()) {
|
||||
if (!(glslangIntermediate->isRayTracingStage() && glslangIntermediate->IsRequestedExtension(glslang::E_GL_EXT_ray_tracing)
|
||||
if (!(glslangIntermediate->isRayTracingStage() &&
|
||||
(glslangIntermediate->IsRequestedExtension(glslang::E_GL_EXT_ray_tracing) ||
|
||||
glslangIntermediate->IsRequestedExtension(glslang::E_GL_NV_shader_invocation_reorder))
|
||||
&& (builder.getStorageClass(id) == spv::StorageClassRayPayloadKHR ||
|
||||
builder.getStorageClass(id) == spv::StorageClassIncomingRayPayloadKHR ||
|
||||
builder.getStorageClass(id) == spv::StorageClassCallableDataKHR ||
|
||||
builder.getStorageClass(id) == spv::StorageClassIncomingCallableDataKHR))) {
|
||||
// Location values are used to link TraceRayKHR and ExecuteCallableKHR to corresponding variables
|
||||
// but are not valid in SPIRV since they are supported only for Input/Output Storage classes.
|
||||
builder.getStorageClass(id) == spv::StorageClassIncomingCallableDataKHR ||
|
||||
builder.getStorageClass(id) == spv::StorageClassHitObjectAttributeNV))) {
|
||||
// Location values are used to link TraceRayKHR/ExecuteCallableKHR/HitObjectGetAttributesNV
|
||||
// to corresponding variables but are not valid in SPIRV since they are supported only
|
||||
// for Input/Output Storage classes.
|
||||
builder.addDecoration(id, spv::DecorationLocation, symbol->getQualifier().layoutLocation);
|
||||
}
|
||||
}
|
||||
@ -9069,10 +9553,10 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
|
||||
std::vector<spv::Id> operandIds;
|
||||
assert(!decorateId.second.empty());
|
||||
for (auto extraOperand : decorateId.second) {
|
||||
if (extraOperand->getQualifier().isSpecConstant())
|
||||
operandIds.push_back(getSymbolId(extraOperand->getAsSymbolNode()));
|
||||
else
|
||||
if (extraOperand->getQualifier().isFrontEndConstant())
|
||||
operandIds.push_back(createSpvConstant(*extraOperand));
|
||||
else
|
||||
operandIds.push_back(getSymbolId(extraOperand->getAsSymbolNode()));
|
||||
}
|
||||
builder.addDecorationId(id, static_cast<spv::Decoration>(decorateId.first), operandIds);
|
||||
}
|
||||
@ -9615,7 +10099,7 @@ void GlslangToSpv(const TIntermediate& intermediate, std::vector<unsigned int>&
|
||||
{
|
||||
TIntermNode* root = intermediate.getTreeRoot();
|
||||
|
||||
if (root == 0)
|
||||
if (root == nullptr)
|
||||
return;
|
||||
|
||||
SpvOptions defaultOptions;
|
||||
|
6
3rdparty/glslang/SPIRV/SPVRemapper.cpp
vendored
6
3rdparty/glslang/SPIRV/SPVRemapper.cpp
vendored
@ -36,10 +36,6 @@
|
||||
#include "SPVRemapper.h"
|
||||
#include "doc.h"
|
||||
|
||||
#if !defined (use_cpp11)
|
||||
// ... not supported before C++11
|
||||
#else // defined (use_cpp11)
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include "../glslang/Include/Common.h"
|
||||
@ -1528,5 +1524,3 @@ namespace spv {
|
||||
|
||||
} // namespace SPV
|
||||
|
||||
#endif // defined (use_cpp11)
|
||||
|
||||
|
28
3rdparty/glslang/SPIRV/SPVRemapper.h
vendored
28
3rdparty/glslang/SPIRV/SPVRemapper.h
vendored
@ -43,12 +43,6 @@
|
||||
|
||||
namespace spv {
|
||||
|
||||
// MSVC defines __cplusplus as an older value, even when it supports almost all of 11.
|
||||
// We handle that here by making our own symbol.
|
||||
#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1700)
|
||||
# define use_cpp11 1
|
||||
#endif
|
||||
|
||||
class spirvbin_base_t
|
||||
{
|
||||
public:
|
||||
@ -74,27 +68,6 @@ public:
|
||||
|
||||
} // namespace SPV
|
||||
|
||||
#if !defined (use_cpp11)
|
||||
#include <cstdio>
|
||||
#include <cstdint>
|
||||
|
||||
namespace spv {
|
||||
class spirvbin_t : public spirvbin_base_t
|
||||
{
|
||||
public:
|
||||
spirvbin_t(int /*verbose = 0*/) { }
|
||||
|
||||
void remap(std::vector<std::uint32_t>& /*spv*/, unsigned int /*opts = 0*/)
|
||||
{
|
||||
printf("Tool not compiled for C++11, which is required for SPIR-V remapping.\n");
|
||||
exit(5);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace SPV
|
||||
|
||||
#else // defined (use_cpp11)
|
||||
|
||||
#include <functional>
|
||||
#include <cstdint>
|
||||
#include <unordered_map>
|
||||
@ -308,5 +281,4 @@ private:
|
||||
|
||||
} // namespace SPV
|
||||
|
||||
#endif // defined (use_cpp11)
|
||||
#endif // SPIRVREMAPPER_H
|
||||
|
107
3rdparty/glslang/SPIRV/SpvBuilder.cpp
vendored
107
3rdparty/glslang/SPIRV/SpvBuilder.cpp
vendored
@ -71,9 +71,9 @@ Builder::Builder(unsigned int spvVersion, unsigned int magicNumber, SpvBuildLogg
|
||||
addressModel(AddressingModelLogical),
|
||||
memoryModel(MemoryModelGLSL450),
|
||||
builderNumber(magicNumber),
|
||||
buildPoint(0),
|
||||
buildPoint(nullptr),
|
||||
uniqueId(0),
|
||||
entryPointFunction(0),
|
||||
entryPointFunction(nullptr),
|
||||
generatingOpCodeForSpecConst(false),
|
||||
logger(buildLogger)
|
||||
{
|
||||
@ -144,6 +144,7 @@ void Builder::addLine(Id fileName, int lineNum, int column)
|
||||
|
||||
void Builder::addDebugScopeAndLine(Id fileName, int lineNum, int column)
|
||||
{
|
||||
assert(!currentDebugScopeId.empty());
|
||||
if (currentDebugScopeId.top() != lastDebugScopeId) {
|
||||
spv::Id resultId = getUniqueId();
|
||||
Instruction* scopeInst = new Instruction(resultId, makeVoidType(), OpExtInst);
|
||||
@ -650,8 +651,12 @@ Id Builder::makeDebugFunctionType(Id returnType, const std::vector<Id>& paramTyp
|
||||
type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsPublic));
|
||||
type->addIdOperand(debugId[returnType]);
|
||||
for (auto const paramType : paramTypes) {
|
||||
assert(isPointerType(paramType) || isArrayType(paramType));
|
||||
type->addIdOperand(debugId[getContainedTypeId(paramType)]);
|
||||
if (isPointerType(paramType) || isArrayType(paramType)) {
|
||||
type->addIdOperand(debugId[getContainedTypeId(paramType)]);
|
||||
}
|
||||
else {
|
||||
type->addIdOperand(debugId[paramType]);
|
||||
}
|
||||
}
|
||||
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
|
||||
module.mapInstruction(type);
|
||||
@ -1067,6 +1072,12 @@ Id Builder::makeDebugCompilationUnit() {
|
||||
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(sourceInst));
|
||||
module.mapInstruction(sourceInst);
|
||||
nonSemanticShaderCompilationUnitId = resultId;
|
||||
|
||||
// We can reasonably assume that makeDebugCompilationUnit will be called before any of
|
||||
// debug-scope stack. Function scopes and lexical scopes will occur afterward.
|
||||
assert(currentDebugScopeId.empty());
|
||||
currentDebugScopeId.push(nonSemanticShaderCompilationUnitId);
|
||||
|
||||
return resultId;
|
||||
}
|
||||
|
||||
@ -1096,6 +1107,8 @@ Id Builder::createDebugGlobalVariable(Id const type, char const*const name, Id c
|
||||
Id Builder::createDebugLocalVariable(Id type, char const*const name, size_t const argNumber)
|
||||
{
|
||||
assert(name != nullptr);
|
||||
assert(!currentDebugScopeId.empty());
|
||||
|
||||
Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), OpExtInst);
|
||||
inst->addIdOperand(nonSemanticShaderDebugInfo);
|
||||
inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugLocalVariable);
|
||||
@ -1176,6 +1189,21 @@ Id Builder::makeRayQueryType()
|
||||
|
||||
return type->getResultId();
|
||||
}
|
||||
|
||||
Id Builder::makeHitObjectNVType()
|
||||
{
|
||||
Instruction *type;
|
||||
if (groupedTypes[OpTypeHitObjectNV].size() == 0) {
|
||||
type = new Instruction(getUniqueId(), NoType, OpTypeHitObjectNV);
|
||||
groupedTypes[OpTypeHitObjectNV].push_back(type);
|
||||
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
|
||||
module.mapInstruction(type);
|
||||
} else {
|
||||
type = groupedTypes[OpTypeHitObjectNV].back();
|
||||
}
|
||||
|
||||
return type->getResultId();
|
||||
}
|
||||
#endif
|
||||
|
||||
Id Builder::getDerefTypeId(Id resultId) const
|
||||
@ -1675,7 +1703,7 @@ Id Builder::importNonSemanticShaderDebugInfoInstructions()
|
||||
|
||||
Id Builder::findCompositeConstant(Op typeClass, Id typeId, const std::vector<Id>& comps)
|
||||
{
|
||||
Instruction* constant = 0;
|
||||
Instruction* constant = nullptr;
|
||||
bool found = false;
|
||||
for (int i = 0; i < (int)groupedConstants[typeClass].size(); ++i) {
|
||||
constant = groupedConstants[typeClass][i];
|
||||
@ -1702,7 +1730,7 @@ Id Builder::findCompositeConstant(Op typeClass, Id typeId, const std::vector<Id>
|
||||
|
||||
Id Builder::findStructConstant(Id typeId, const std::vector<Id>& comps)
|
||||
{
|
||||
Instruction* constant = 0;
|
||||
Instruction* constant = nullptr;
|
||||
bool found = false;
|
||||
for (int i = 0; i < (int)groupedStructConstants[typeId].size(); ++i) {
|
||||
constant = groupedStructConstants[typeId][i];
|
||||
@ -2047,11 +2075,16 @@ Function* Builder::makeFunctionEntry(Decoration precision, Id returnType, const
|
||||
assert(paramTypes.size() == paramNames.size());
|
||||
for(size_t p = 0; p < paramTypes.size(); ++p)
|
||||
{
|
||||
auto const& paramType = paramTypes[p];
|
||||
assert(isPointerType(paramType) || isArrayType(paramType));
|
||||
assert(debugId[getContainedTypeId(paramType)] != 0);
|
||||
auto getParamTypeId = [this](Id const& typeId) {
|
||||
if (isPointerType(typeId) || isArrayType(typeId)) {
|
||||
return getContainedTypeId(typeId);
|
||||
}
|
||||
else {
|
||||
return typeId;
|
||||
}
|
||||
};
|
||||
auto const& paramName = paramNames[p];
|
||||
auto const debugLocalVariableId = createDebugLocalVariable(debugId[getContainedTypeId(paramType)], paramName, p+1);
|
||||
auto const debugLocalVariableId = createDebugLocalVariable(debugId[getParamTypeId(paramTypes[p])], paramName, p+1);
|
||||
debugId[firstParamId + p] = debugLocalVariableId;
|
||||
|
||||
makeDebugDeclare(debugLocalVariableId, firstParamId + p);
|
||||
@ -2095,6 +2128,8 @@ Id Builder::makeDebugFunction(Function* function, Id nameId, Id funcTypeId) {
|
||||
}
|
||||
|
||||
Id Builder::makeDebugLexicalBlock(uint32_t line) {
|
||||
assert(!currentDebugScopeId.empty());
|
||||
|
||||
Id lexId = getUniqueId();
|
||||
auto lex = new Instruction(lexId, makeVoidType(), OpExtInst);
|
||||
lex->addIdOperand(nonSemanticShaderDebugInfo);
|
||||
@ -2734,52 +2769,49 @@ Id Builder::createBuiltinCall(Id resultType, Id builtins, int entryPoint, const
|
||||
Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse, bool fetch, bool proj, bool gather,
|
||||
bool noImplicitLod, const TextureParameters& parameters, ImageOperandsMask signExtensionMask)
|
||||
{
|
||||
static const int maxTextureArgs = 10;
|
||||
Id texArgs[maxTextureArgs] = {};
|
||||
std::vector<Id> texArgs;
|
||||
|
||||
//
|
||||
// Set up the fixed arguments
|
||||
//
|
||||
int numArgs = 0;
|
||||
bool explicitLod = false;
|
||||
texArgs[numArgs++] = parameters.sampler;
|
||||
texArgs[numArgs++] = parameters.coords;
|
||||
texArgs.push_back(parameters.sampler);
|
||||
texArgs.push_back(parameters.coords);
|
||||
if (parameters.Dref != NoResult)
|
||||
texArgs[numArgs++] = parameters.Dref;
|
||||
texArgs.push_back(parameters.Dref);
|
||||
if (parameters.component != NoResult)
|
||||
texArgs[numArgs++] = parameters.component;
|
||||
texArgs.push_back(parameters.component);
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
if (parameters.granularity != NoResult)
|
||||
texArgs[numArgs++] = parameters.granularity;
|
||||
texArgs.push_back(parameters.granularity);
|
||||
if (parameters.coarse != NoResult)
|
||||
texArgs[numArgs++] = parameters.coarse;
|
||||
texArgs.push_back(parameters.coarse);
|
||||
#endif
|
||||
|
||||
//
|
||||
// Set up the optional arguments
|
||||
//
|
||||
int optArgNum = numArgs; // track which operand, if it exists, is the mask of optional arguments
|
||||
++numArgs; // speculatively make room for the mask operand
|
||||
size_t optArgNum = texArgs.size(); // the position of the mask for the optional arguments, if any.
|
||||
ImageOperandsMask mask = ImageOperandsMaskNone; // the mask operand
|
||||
if (parameters.bias) {
|
||||
mask = (ImageOperandsMask)(mask | ImageOperandsBiasMask);
|
||||
texArgs[numArgs++] = parameters.bias;
|
||||
texArgs.push_back(parameters.bias);
|
||||
}
|
||||
if (parameters.lod) {
|
||||
mask = (ImageOperandsMask)(mask | ImageOperandsLodMask);
|
||||
texArgs[numArgs++] = parameters.lod;
|
||||
texArgs.push_back(parameters.lod);
|
||||
explicitLod = true;
|
||||
} else if (parameters.gradX) {
|
||||
mask = (ImageOperandsMask)(mask | ImageOperandsGradMask);
|
||||
texArgs[numArgs++] = parameters.gradX;
|
||||
texArgs[numArgs++] = parameters.gradY;
|
||||
texArgs.push_back(parameters.gradX);
|
||||
texArgs.push_back(parameters.gradY);
|
||||
explicitLod = true;
|
||||
} else if (noImplicitLod && ! fetch && ! gather) {
|
||||
// have to explicitly use lod of 0 if not allowed to have them be implicit, and
|
||||
// we would otherwise be about to issue an implicit instruction
|
||||
mask = (ImageOperandsMask)(mask | ImageOperandsLodMask);
|
||||
texArgs[numArgs++] = makeFloatConstant(0.0);
|
||||
texArgs.push_back(makeFloatConstant(0.0));
|
||||
explicitLod = true;
|
||||
}
|
||||
if (parameters.offset) {
|
||||
@ -2789,24 +2821,24 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
|
||||
addCapability(CapabilityImageGatherExtended);
|
||||
mask = (ImageOperandsMask)(mask | ImageOperandsOffsetMask);
|
||||
}
|
||||
texArgs[numArgs++] = parameters.offset;
|
||||
texArgs.push_back(parameters.offset);
|
||||
}
|
||||
if (parameters.offsets) {
|
||||
addCapability(CapabilityImageGatherExtended);
|
||||
mask = (ImageOperandsMask)(mask | ImageOperandsConstOffsetsMask);
|
||||
texArgs[numArgs++] = parameters.offsets;
|
||||
texArgs.push_back(parameters.offsets);
|
||||
}
|
||||
#ifndef GLSLANG_WEB
|
||||
if (parameters.sample) {
|
||||
mask = (ImageOperandsMask)(mask | ImageOperandsSampleMask);
|
||||
texArgs[numArgs++] = parameters.sample;
|
||||
texArgs.push_back(parameters.sample);
|
||||
}
|
||||
if (parameters.lodClamp) {
|
||||
// capability if this bit is used
|
||||
addCapability(CapabilityMinLod);
|
||||
|
||||
mask = (ImageOperandsMask)(mask | ImageOperandsMinLodMask);
|
||||
texArgs[numArgs++] = parameters.lodClamp;
|
||||
texArgs.push_back(parameters.lodClamp);
|
||||
}
|
||||
if (parameters.nonprivate) {
|
||||
mask = mask | ImageOperandsNonPrivateTexelKHRMask;
|
||||
@ -2816,10 +2848,9 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
|
||||
}
|
||||
#endif
|
||||
mask = mask | signExtensionMask;
|
||||
if (mask == ImageOperandsMaskNone)
|
||||
--numArgs; // undo speculative reservation for the mask argument
|
||||
else
|
||||
texArgs[optArgNum] = mask;
|
||||
// insert the operand for the mask, if any bits were set.
|
||||
if (mask != ImageOperandsMaskNone)
|
||||
texArgs.insert(texArgs.begin() + optArgNum, mask);
|
||||
|
||||
//
|
||||
// Set up the instruction
|
||||
@ -2923,11 +2954,11 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
|
||||
|
||||
// Build the SPIR-V instruction
|
||||
Instruction* textureInst = new Instruction(getUniqueId(), resultType, opCode);
|
||||
for (int op = 0; op < optArgNum; ++op)
|
||||
for (size_t op = 0; op < optArgNum; ++op)
|
||||
textureInst->addIdOperand(texArgs[op]);
|
||||
if (optArgNum < numArgs)
|
||||
if (optArgNum < texArgs.size())
|
||||
textureInst->addImmediateOperand(texArgs[optArgNum]);
|
||||
for (int op = optArgNum + 1; op < numArgs; ++op)
|
||||
for (size_t op = optArgNum + 1; op < texArgs.size(); ++op)
|
||||
textureInst->addIdOperand(texArgs[op]);
|
||||
setPrecision(textureInst->getResultId(), precision);
|
||||
buildPoint->addInstruction(std::unique_ptr<Instruction>(textureInst));
|
||||
@ -3332,7 +3363,7 @@ Builder::If::If(Id cond, unsigned int ctrl, Builder& gb) :
|
||||
builder(gb),
|
||||
condition(cond),
|
||||
control(ctrl),
|
||||
elseBlock(0)
|
||||
elseBlock(nullptr)
|
||||
{
|
||||
function = &builder.getBuildPoint()->getParent();
|
||||
|
||||
|
4
3rdparty/glslang/SPIRV/SpvBuilder.h
vendored
4
3rdparty/glslang/SPIRV/SpvBuilder.h
vendored
@ -240,6 +240,8 @@ public:
|
||||
Id makeAccelerationStructureType();
|
||||
// rayQueryEXT type
|
||||
Id makeRayQueryType();
|
||||
// hitObjectNV type
|
||||
Id makeHitObjectNVType();
|
||||
|
||||
// For querying about types.
|
||||
Id getTypeId(Id resultId) const { return module.getTypeId(resultId); }
|
||||
@ -414,7 +416,7 @@ public:
|
||||
// The returned pointer is only valid for the lifetime of this builder.
|
||||
Function* makeFunctionEntry(Decoration precision, Id returnType, const char* name,
|
||||
const std::vector<Id>& paramTypes, const std::vector<char const*>& paramNames,
|
||||
const std::vector<std::vector<Decoration>>& precisions, Block **entry = 0);
|
||||
const std::vector<std::vector<Decoration>>& precisions, Block **entry = nullptr);
|
||||
|
||||
// Create a return. An 'implicit' return is one not appearing in the source
|
||||
// code. In the case of an implicit return, no post-return block is inserted.
|
||||
|
1
3rdparty/glslang/SPIRV/SpvPostProcess.cpp
vendored
1
3rdparty/glslang/SPIRV/SpvPostProcess.cpp
vendored
@ -52,6 +52,7 @@ namespace spv {
|
||||
#include "GLSL.ext.EXT.h"
|
||||
#include "GLSL.ext.AMD.h"
|
||||
#include "GLSL.ext.NV.h"
|
||||
#include "GLSL.ext.ARM.h"
|
||||
}
|
||||
|
||||
namespace spv {
|
||||
|
53
3rdparty/glslang/SPIRV/SpvTools.cpp
vendored
53
3rdparty/glslang/SPIRV/SpvTools.cpp
vendored
@ -212,8 +212,7 @@ void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector
|
||||
optimizer.RegisterPass(spvtools::CreateInterpolateFixupPass());
|
||||
if (options->optimizeSize) {
|
||||
optimizer.RegisterPass(spvtools::CreateRedundancyEliminationPass());
|
||||
if (intermediate.getStage() == EShLanguage::EShLangVertex)
|
||||
optimizer.RegisterPass(spvtools::CreateEliminateDeadInputComponentsPass());
|
||||
optimizer.RegisterPass(spvtools::CreateEliminateDeadInputComponentsSafePass());
|
||||
}
|
||||
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass());
|
||||
optimizer.RegisterPass(spvtools::CreateCFGCleanupPass());
|
||||
@ -224,6 +223,56 @@ void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector
|
||||
optimizer.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions);
|
||||
}
|
||||
|
||||
bool SpirvToolsAnalyzeDeadOutputStores(spv_target_env target_env, std::vector<unsigned int>& spirv,
|
||||
std::unordered_set<uint32_t>* live_locs,
|
||||
std::unordered_set<uint32_t>* live_builtins,
|
||||
spv::SpvBuildLogger*)
|
||||
{
|
||||
spvtools::Optimizer optimizer(target_env);
|
||||
optimizer.SetMessageConsumer(OptimizerMesssageConsumer);
|
||||
|
||||
optimizer.RegisterPass(spvtools::CreateAnalyzeLiveInputPass(live_locs, live_builtins));
|
||||
|
||||
spvtools::OptimizerOptions spvOptOptions;
|
||||
optimizer.SetTargetEnv(target_env);
|
||||
spvOptOptions.set_run_validator(false);
|
||||
return optimizer.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions);
|
||||
}
|
||||
|
||||
void SpirvToolsEliminateDeadOutputStores(spv_target_env target_env, std::vector<unsigned int>& spirv,
|
||||
std::unordered_set<uint32_t>* live_locs,
|
||||
std::unordered_set<uint32_t>* live_builtins,
|
||||
spv::SpvBuildLogger*)
|
||||
{
|
||||
spvtools::Optimizer optimizer(target_env);
|
||||
optimizer.SetMessageConsumer(OptimizerMesssageConsumer);
|
||||
|
||||
optimizer.RegisterPass(spvtools::CreateEliminateDeadOutputStoresPass(live_locs, live_builtins));
|
||||
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass(false, true));
|
||||
optimizer.RegisterPass(spvtools::CreateEliminateDeadOutputComponentsPass());
|
||||
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass(false, true));
|
||||
|
||||
spvtools::OptimizerOptions spvOptOptions;
|
||||
optimizer.SetTargetEnv(target_env);
|
||||
spvOptOptions.set_run_validator(false);
|
||||
optimizer.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions);
|
||||
}
|
||||
|
||||
void SpirvToolsEliminateDeadInputComponents(spv_target_env target_env, std::vector<unsigned int>& spirv,
|
||||
spv::SpvBuildLogger*)
|
||||
{
|
||||
spvtools::Optimizer optimizer(target_env);
|
||||
optimizer.SetMessageConsumer(OptimizerMesssageConsumer);
|
||||
|
||||
optimizer.RegisterPass(spvtools::CreateEliminateDeadInputComponentsPass());
|
||||
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass());
|
||||
|
||||
spvtools::OptimizerOptions spvOptOptions;
|
||||
optimizer.SetTargetEnv(target_env);
|
||||
spvOptOptions.set_run_validator(false);
|
||||
optimizer.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions);
|
||||
}
|
||||
|
||||
// Apply the SPIRV-Tools optimizer to strip debug info from SPIR-V. This is implicitly done by
|
||||
// SpirvToolsTransform if spvOptions->stripDebugInfo is set, but can be called separately if
|
||||
// optimization is disabled.
|
||||
|
19
3rdparty/glslang/SPIRV/SpvTools.h
vendored
19
3rdparty/glslang/SPIRV/SpvTools.h
vendored
@ -65,6 +65,9 @@ struct SpvOptions {
|
||||
|
||||
#if ENABLE_OPT
|
||||
|
||||
// Translate glslang's view of target versioning to what SPIRV-Tools uses.
|
||||
spv_target_env MapToSpirvToolsEnv(const SpvVersion& spvVersion, spv::SpvBuildLogger* logger);
|
||||
|
||||
// Use the SPIRV-Tools disassembler to print SPIR-V using a SPV_ENV_UNIVERSAL_1_3 environment.
|
||||
void SpirvToolsDisassemble(std::ostream& out, const std::vector<unsigned int>& spirv);
|
||||
|
||||
@ -80,6 +83,22 @@ void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector<
|
||||
void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
|
||||
spv::SpvBuildLogger*, const SpvOptions*);
|
||||
|
||||
// Apply the SPIRV-Tools EliminateDeadInputComponents pass to generated SPIR-V. Put result in |spirv|.
|
||||
void SpirvToolsEliminateDeadInputComponents(spv_target_env target_env, std::vector<unsigned int>& spirv,
|
||||
spv::SpvBuildLogger*);
|
||||
|
||||
// Apply the SPIRV-Tools AnalyzeDeadOutputStores pass to generated SPIR-V. Put result in |live_locs|.
|
||||
// Return true if the result is valid.
|
||||
bool SpirvToolsAnalyzeDeadOutputStores(spv_target_env target_env, std::vector<unsigned int>& spirv,
|
||||
std::unordered_set<uint32_t>* live_locs,
|
||||
std::unordered_set<uint32_t>* live_builtins, spv::SpvBuildLogger*);
|
||||
|
||||
// Apply the SPIRV-Tools EliminateDeadOutputStores and AggressiveDeadCodeElimination passes to generated SPIR-V using
|
||||
// |live_locs|. Put result in |spirv|.
|
||||
void SpirvToolsEliminateDeadOutputStores(spv_target_env target_env, std::vector<unsigned int>& spirv,
|
||||
std::unordered_set<uint32_t>* live_locs,
|
||||
std::unordered_set<uint32_t>* live_builtins, spv::SpvBuildLogger*);
|
||||
|
||||
// Apply the SPIRV-Tools optimizer to strip debug info from SPIR-V. This is implicitly done by
|
||||
// SpirvToolsTransform if spvOptions->stripDebugInfo is set, but can be called separately if
|
||||
// optimization is disabled.
|
||||
|
61
3rdparty/glslang/SPIRV/disassemble.cpp
vendored
61
3rdparty/glslang/SPIRV/disassemble.cpp
vendored
@ -54,6 +54,8 @@ namespace spv {
|
||||
#include "GLSL.std.450.h"
|
||||
#include "GLSL.ext.AMD.h"
|
||||
#include "GLSL.ext.NV.h"
|
||||
#include "GLSL.ext.ARM.h"
|
||||
#include "NonSemanticShaderDebugInfo100.h"
|
||||
}
|
||||
}
|
||||
const char* GlslStd450DebugNames[spv::GLSLstd450Count];
|
||||
@ -62,6 +64,7 @@ namespace spv {
|
||||
|
||||
static const char* GLSLextAMDGetDebugNames(const char*, unsigned);
|
||||
static const char* GLSLextNVGetDebugNames(const char*, unsigned);
|
||||
static const char* NonSemanticShaderDebugInfo100GetDebugNames(unsigned);
|
||||
|
||||
static void Kill(std::ostream& out, const char* message)
|
||||
{
|
||||
@ -76,6 +79,7 @@ enum ExtInstSet {
|
||||
GLSLextNVInst,
|
||||
OpenCLExtInst,
|
||||
NonSemanticDebugPrintfExtInst,
|
||||
NonSemanticShaderDebugInfo100
|
||||
};
|
||||
|
||||
// Container class for a single instance of a SPIR-V stream, with methods for disassembly.
|
||||
@ -501,6 +505,8 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
|
||||
extInstSet = OpenCLExtInst;
|
||||
} else if (strcmp("NonSemantic.DebugPrintf", name) == 0) {
|
||||
extInstSet = NonSemanticDebugPrintfExtInst;
|
||||
} else if (strcmp("NonSemantic.Shader.DebugInfo.100", name) == 0) {
|
||||
extInstSet = NonSemanticShaderDebugInfo100;
|
||||
} else if (strcmp(spv::E_SPV_AMD_shader_ballot, name) == 0 ||
|
||||
strcmp(spv::E_SPV_AMD_shader_trinary_minmax, name) == 0 ||
|
||||
strcmp(spv::E_SPV_AMD_shader_explicit_vertex_parameter, name) == 0 ||
|
||||
@ -526,6 +532,8 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
|
||||
out << "(" << GLSLextNVGetDebugNames(name, entrypoint) << ")";
|
||||
} else if (extInstSet == NonSemanticDebugPrintfExtInst) {
|
||||
out << "(DebugPrintf)";
|
||||
} else if (extInstSet == NonSemanticShaderDebugInfo100) {
|
||||
out << "(" << NonSemanticShaderDebugInfo100GetDebugNames(entrypoint) << ")";
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -749,6 +757,59 @@ static const char* GLSLextNVGetDebugNames(const char* name, unsigned entrypoint)
|
||||
return "Bad";
|
||||
}
|
||||
|
||||
static const char* NonSemanticShaderDebugInfo100GetDebugNames(unsigned entrypoint)
|
||||
{
|
||||
switch (entrypoint) {
|
||||
case NonSemanticShaderDebugInfo100DebugInfoNone: return "DebugInfoNone";
|
||||
case NonSemanticShaderDebugInfo100DebugCompilationUnit: return "DebugCompilationUnit";
|
||||
case NonSemanticShaderDebugInfo100DebugTypeBasic: return "DebugTypeBasic";
|
||||
case NonSemanticShaderDebugInfo100DebugTypePointer: return "DebugTypePointer";
|
||||
case NonSemanticShaderDebugInfo100DebugTypeQualifier: return "DebugTypeQualifier";
|
||||
case NonSemanticShaderDebugInfo100DebugTypeArray: return "DebugTypeArray";
|
||||
case NonSemanticShaderDebugInfo100DebugTypeVector: return "DebugTypeVector";
|
||||
case NonSemanticShaderDebugInfo100DebugTypedef: return "DebugTypedef";
|
||||
case NonSemanticShaderDebugInfo100DebugTypeFunction: return "DebugTypeFunction";
|
||||
case NonSemanticShaderDebugInfo100DebugTypeEnum: return "DebugTypeEnum";
|
||||
case NonSemanticShaderDebugInfo100DebugTypeComposite: return "DebugTypeComposite";
|
||||
case NonSemanticShaderDebugInfo100DebugTypeMember: return "DebugTypeMember";
|
||||
case NonSemanticShaderDebugInfo100DebugTypeInheritance: return "DebugTypeInheritance";
|
||||
case NonSemanticShaderDebugInfo100DebugTypePtrToMember: return "DebugTypePtrToMember";
|
||||
case NonSemanticShaderDebugInfo100DebugTypeTemplate: return "DebugTypeTemplate";
|
||||
case NonSemanticShaderDebugInfo100DebugTypeTemplateParameter: return "DebugTypeTemplateParameter";
|
||||
case NonSemanticShaderDebugInfo100DebugTypeTemplateTemplateParameter: return "DebugTypeTemplateTemplateParameter";
|
||||
case NonSemanticShaderDebugInfo100DebugTypeTemplateParameterPack: return "DebugTypeTemplateParameterPack";
|
||||
case NonSemanticShaderDebugInfo100DebugGlobalVariable: return "DebugGlobalVariable";
|
||||
case NonSemanticShaderDebugInfo100DebugFunctionDeclaration: return "DebugFunctionDeclaration";
|
||||
case NonSemanticShaderDebugInfo100DebugFunction: return "DebugFunction";
|
||||
case NonSemanticShaderDebugInfo100DebugLexicalBlock: return "DebugLexicalBlock";
|
||||
case NonSemanticShaderDebugInfo100DebugLexicalBlockDiscriminator: return "DebugLexicalBlockDiscriminator";
|
||||
case NonSemanticShaderDebugInfo100DebugScope: return "DebugScope";
|
||||
case NonSemanticShaderDebugInfo100DebugNoScope: return "DebugNoScope";
|
||||
case NonSemanticShaderDebugInfo100DebugInlinedAt: return "DebugInlinedAt";
|
||||
case NonSemanticShaderDebugInfo100DebugLocalVariable: return "DebugLocalVariable";
|
||||
case NonSemanticShaderDebugInfo100DebugInlinedVariable: return "DebugInlinedVariable";
|
||||
case NonSemanticShaderDebugInfo100DebugDeclare: return "DebugDeclare";
|
||||
case NonSemanticShaderDebugInfo100DebugValue: return "DebugValue";
|
||||
case NonSemanticShaderDebugInfo100DebugOperation: return "DebugOperation";
|
||||
case NonSemanticShaderDebugInfo100DebugExpression: return "DebugExpression";
|
||||
case NonSemanticShaderDebugInfo100DebugMacroDef: return "DebugMacroDef";
|
||||
case NonSemanticShaderDebugInfo100DebugMacroUndef: return "DebugMacroUndef";
|
||||
case NonSemanticShaderDebugInfo100DebugImportedEntity: return "DebugImportedEntity";
|
||||
case NonSemanticShaderDebugInfo100DebugSource: return "DebugSource";
|
||||
case NonSemanticShaderDebugInfo100DebugFunctionDefinition: return "DebugFunctionDefinition";
|
||||
case NonSemanticShaderDebugInfo100DebugSourceContinued: return "DebugSourceContinued";
|
||||
case NonSemanticShaderDebugInfo100DebugLine: return "DebugLine";
|
||||
case NonSemanticShaderDebugInfo100DebugNoLine: return "DebugNoLine";
|
||||
case NonSemanticShaderDebugInfo100DebugBuildIdentifier: return "DebugBuildIdentifier";
|
||||
case NonSemanticShaderDebugInfo100DebugStoragePath: return "DebugStoragePath";
|
||||
case NonSemanticShaderDebugInfo100DebugEntryPoint: return "DebugEntryPoint";
|
||||
case NonSemanticShaderDebugInfo100DebugTypeMatrix: return "DebugTypeMatrix";
|
||||
default: return "Bad";
|
||||
}
|
||||
|
||||
return "Bad";
|
||||
}
|
||||
|
||||
void Disassemble(std::ostream& out, const std::vector<unsigned int>& stream)
|
||||
{
|
||||
SpirvStream SpirvStream(out, stream);
|
||||
|
261
3rdparty/glslang/SPIRV/doc.cpp
vendored
Normal file → Executable file
261
3rdparty/glslang/SPIRV/doc.cpp
vendored
Normal file → Executable file
@ -53,6 +53,7 @@ namespace spv {
|
||||
#include "GLSL.ext.EXT.h"
|
||||
#include "GLSL.ext.AMD.h"
|
||||
#include "GLSL.ext.NV.h"
|
||||
#include "GLSL.ext.ARM.h"
|
||||
}
|
||||
}
|
||||
|
||||
@ -214,6 +215,10 @@ const char* ExecutionModeString(int mode)
|
||||
case ExecutionModeNoGlobalOffsetINTEL: return "NoGlobalOffsetINTEL";
|
||||
case ExecutionModeNumSIMDWorkitemsINTEL: return "NumSIMDWorkitemsINTEL";
|
||||
|
||||
case ExecutionModeNonCoherentColorAttachmentReadEXT: return "NonCoherentColorAttachmentReadEXT";
|
||||
case ExecutionModeNonCoherentDepthAttachmentReadEXT: return "NonCoherentDepthAttachmentReadEXT";
|
||||
case ExecutionModeNonCoherentStencilAttachmentReadEXT: return "NonCoherentStencilAttachmentReadEXT";
|
||||
|
||||
case ExecutionModeCeiling:
|
||||
default: return "Bad";
|
||||
}
|
||||
@ -245,6 +250,8 @@ const char* StorageClassString(int StorageClass)
|
||||
|
||||
case StorageClassPhysicalStorageBufferEXT: return "PhysicalStorageBufferEXT";
|
||||
case StorageClassTaskPayloadWorkgroupEXT: return "TaskPayloadWorkgroupEXT";
|
||||
case StorageClassHitObjectAttributeNV: return "HitObjectAttributeNV";
|
||||
case StorageClassTileImageEXT: return "TileImageEXT";
|
||||
default: return "Bad";
|
||||
}
|
||||
}
|
||||
@ -319,6 +326,8 @@ const char* DecorationString(int decoration)
|
||||
case DecorationHlslSemanticGOOGLE: return "DecorationHlslSemanticGOOGLE";
|
||||
case DecorationRestrictPointerEXT: return "DecorationRestrictPointerEXT";
|
||||
case DecorationAliasedPointerEXT: return "DecorationAliasedPointerEXT";
|
||||
|
||||
case DecorationHitObjectShaderRecordBufferNV: return "DecorationHitObjectShaderRecordBufferNV";
|
||||
}
|
||||
}
|
||||
|
||||
@ -400,6 +409,7 @@ const char* BuiltInString(int builtIn)
|
||||
case BuiltInRayTminKHR: return "RayTminKHR";
|
||||
case BuiltInRayTmaxKHR: return "RayTmaxKHR";
|
||||
case BuiltInCullMaskKHR: return "CullMaskKHR";
|
||||
case BuiltInHitTriangleVertexPositionsKHR: return "HitTriangleVertexPositionsKHR";
|
||||
case BuiltInInstanceCustomIndexKHR: return "InstanceCustomIndexKHR";
|
||||
case BuiltInRayGeometryIndexKHR: return "RayGeometryIndexKHR";
|
||||
case BuiltInObjectToWorldKHR: return "ObjectToWorldKHR";
|
||||
@ -439,6 +449,11 @@ const char* BuiltInString(int builtIn)
|
||||
case BuiltInPrimitiveLineIndicesEXT: return "PrimitiveLineIndicesEXT";
|
||||
case BuiltInPrimitiveTriangleIndicesEXT: return "PrimitiveTriangleIndicesEXT";
|
||||
case BuiltInCullPrimitiveEXT: return "CullPrimitiveEXT";
|
||||
case BuiltInCoreCountARM: return "CoreCountARM";
|
||||
case BuiltInCoreIDARM: return "CoreIDARM";
|
||||
case BuiltInCoreMaxIDARM: return "CoreMaxIDARM";
|
||||
case BuiltInWarpIDARM: return "WarpIDARM";
|
||||
case BuiltInWarpMaxIDARM: return "BuiltInWarpMaxIDARM";
|
||||
|
||||
default: return "Bad";
|
||||
}
|
||||
@ -454,6 +469,7 @@ const char* DimensionString(int dim)
|
||||
case 4: return "Rect";
|
||||
case 5: return "Buffer";
|
||||
case 6: return "SubpassData";
|
||||
case DimTileImageDataEXT: return "TileImageDataEXT";
|
||||
|
||||
default: return "Bad";
|
||||
}
|
||||
@ -941,6 +957,8 @@ const char* CapabilityString(int info)
|
||||
case CapabilityRayQueryKHR: return "RayQueryKHR";
|
||||
case CapabilityRayTracingProvisionalKHR: return "RayTracingProvisionalKHR";
|
||||
case CapabilityRayTraversalPrimitiveCullingKHR: return "RayTraversalPrimitiveCullingKHR";
|
||||
case CapabilityRayTracingPositionFetchKHR: return "RayTracingPositionFetchKHR";
|
||||
case CapabilityRayQueryPositionFetchKHR: return "RayQueryPositionFetchKHR";
|
||||
case CapabilityComputeDerivativeGroupQuadsNV: return "ComputeDerivativeGroupQuadsNV";
|
||||
case CapabilityComputeDerivativeGroupLinearNV: return "ComputeDerivativeGroupLinearNV";
|
||||
case CapabilityFragmentBarycentricKHR: return "FragmentBarycentricKHR";
|
||||
@ -980,6 +998,10 @@ const char* CapabilityString(int info)
|
||||
case CapabilityFragmentShaderPixelInterlockEXT: return "CapabilityFragmentShaderPixelInterlockEXT";
|
||||
case CapabilityFragmentShaderShadingRateInterlockEXT: return "CapabilityFragmentShaderShadingRateInterlockEXT";
|
||||
|
||||
case CapabilityTileImageColorReadAccessEXT: return "TileImageColorReadAccessEXT";
|
||||
case CapabilityTileImageDepthReadAccessEXT: return "TileImageDepthReadAccessEXT";
|
||||
case CapabilityTileImageStencilReadAccessEXT: return "TileImageStencilReadAccessEXT";
|
||||
|
||||
case CapabilityFragmentShadingRateKHR: return "FragmentShadingRateKHR";
|
||||
|
||||
case CapabilityDemoteToHelperInvocationEXT: return "DemoteToHelperInvocationEXT";
|
||||
@ -998,7 +1020,9 @@ const char* CapabilityString(int info)
|
||||
case CapabilityWorkgroupMemoryExplicitLayoutKHR: return "CapabilityWorkgroupMemoryExplicitLayoutKHR";
|
||||
case CapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR: return "CapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR";
|
||||
case CapabilityWorkgroupMemoryExplicitLayout16BitAccessKHR: return "CapabilityWorkgroupMemoryExplicitLayout16BitAccessKHR";
|
||||
case CapabilityCoreBuiltinsARM: return "CoreBuiltinsARM";
|
||||
|
||||
case CapabilityShaderInvocationReorderNV: return "ShaderInvocationReorderNV";
|
||||
default: return "Bad";
|
||||
}
|
||||
}
|
||||
@ -1441,6 +1465,7 @@ const char* OpcodeString(int op)
|
||||
case OpRayQueryGetWorldRayOriginKHR: return "OpRayQueryGetWorldRayOriginKHR";
|
||||
case OpRayQueryGetIntersectionObjectToWorldKHR: return "OpRayQueryGetIntersectionObjectToWorldKHR";
|
||||
case OpRayQueryGetIntersectionWorldToObjectKHR: return "OpRayQueryGetIntersectionWorldToObjectKHR";
|
||||
case OpRayQueryGetIntersectionTriangleVertexPositionsKHR: return "OpRayQueryGetIntersectionTriangleVertexPositionsKHR";
|
||||
|
||||
case OpTypeCooperativeMatrixNV: return "OpTypeCooperativeMatrixNV";
|
||||
case OpCooperativeMatrixLoadNV: return "OpCooperativeMatrixLoadNV";
|
||||
@ -1453,6 +1478,44 @@ const char* OpcodeString(int op)
|
||||
case OpBeginInvocationInterlockEXT: return "OpBeginInvocationInterlockEXT";
|
||||
case OpEndInvocationInterlockEXT: return "OpEndInvocationInterlockEXT";
|
||||
|
||||
case OpTypeHitObjectNV: return "OpTypeHitObjectNV";
|
||||
case OpHitObjectTraceRayNV: return "OpHitObjectTraceRayNV";
|
||||
case OpHitObjectTraceRayMotionNV: return "OpHitObjectTraceRayMotionNV";
|
||||
case OpHitObjectRecordHitNV: return "OpHitObjectRecordHitNV";
|
||||
case OpHitObjectRecordHitMotionNV: return "OpHitObjectRecordHitMotionNV";
|
||||
case OpHitObjectRecordHitWithIndexNV: return "OpHitObjectRecordHitWithIndexNV";
|
||||
case OpHitObjectRecordHitWithIndexMotionNV: return "OpHitObjectRecordHitWithIndexMotionNV";
|
||||
case OpHitObjectRecordMissNV: return "OpHitObjectRecordMissNV";
|
||||
case OpHitObjectRecordMissMotionNV: return "OpHitObjectRecordMissMotionNV";
|
||||
case OpHitObjectRecordEmptyNV: return "OpHitObjectRecordEmptyNV";
|
||||
case OpHitObjectExecuteShaderNV: return "OpHitObjectExecuteShaderNV";
|
||||
case OpReorderThreadWithHintNV: return "OpReorderThreadWithHintNV";
|
||||
case OpReorderThreadWithHitObjectNV: return "OpReorderThreadWithHitObjectNV";
|
||||
case OpHitObjectGetCurrentTimeNV: return "OpHitObjectGetCurrentTimeNV";
|
||||
case OpHitObjectGetAttributesNV: return "OpHitObjectGetAttributesNV";
|
||||
case OpHitObjectGetHitKindNV: return "OpHitObjectGetFrontFaceNV";
|
||||
case OpHitObjectGetPrimitiveIndexNV: return "OpHitObjectGetPrimitiveIndexNV";
|
||||
case OpHitObjectGetGeometryIndexNV: return "OpHitObjectGetGeometryIndexNV";
|
||||
case OpHitObjectGetInstanceIdNV: return "OpHitObjectGetInstanceIdNV";
|
||||
case OpHitObjectGetInstanceCustomIndexNV: return "OpHitObjectGetInstanceCustomIndexNV";
|
||||
case OpHitObjectGetObjectRayDirectionNV: return "OpHitObjectGetObjectRayDirectionNV";
|
||||
case OpHitObjectGetObjectRayOriginNV: return "OpHitObjectGetObjectRayOriginNV";
|
||||
case OpHitObjectGetWorldRayDirectionNV: return "OpHitObjectGetWorldRayDirectionNV";
|
||||
case OpHitObjectGetWorldRayOriginNV: return "OpHitObjectGetWorldRayOriginNV";
|
||||
case OpHitObjectGetWorldToObjectNV: return "OpHitObjectGetWorldToObjectNV";
|
||||
case OpHitObjectGetObjectToWorldNV: return "OpHitObjectGetObjectToWorldNV";
|
||||
case OpHitObjectGetRayTMaxNV: return "OpHitObjectGetRayTMaxNV";
|
||||
case OpHitObjectGetRayTMinNV: return "OpHitObjectGetRayTMinNV";
|
||||
case OpHitObjectIsEmptyNV: return "OpHitObjectIsEmptyNV";
|
||||
case OpHitObjectIsHitNV: return "OpHitObjectIsHitNV";
|
||||
case OpHitObjectIsMissNV: return "OpHitObjectIsMissNV";
|
||||
case OpHitObjectGetShaderBindingTableRecordIndexNV: return "OpHitObjectGetShaderBindingTableRecordIndexNV";
|
||||
case OpHitObjectGetShaderRecordBufferHandleNV: return "OpHitObjectGetShaderRecordBufferHandleNV";
|
||||
|
||||
case OpColorAttachmentReadEXT: return "OpColorAttachmentReadEXT";
|
||||
case OpDepthAttachmentReadEXT: return "OpDepthAttachmentReadEXT";
|
||||
case OpStencilAttachmentReadEXT: return "OpStencilAttachmentReadEXT";
|
||||
|
||||
default:
|
||||
return "Bad";
|
||||
}
|
||||
@ -1607,7 +1670,7 @@ void Parameterize()
|
||||
DecorationOperands[DecorationInputAttachmentIndex].push(OperandLiteralNumber, "'Attachment Index'");
|
||||
DecorationOperands[DecorationAlignment].push(OperandLiteralNumber, "'Alignment'");
|
||||
|
||||
OperandClassParams[OperandSource].set(0, SourceString, 0);
|
||||
OperandClassParams[OperandSource].set(0, SourceString, nullptr);
|
||||
OperandClassParams[OperandExecutionModel].set(0, ExecutionModelString, nullptr);
|
||||
OperandClassParams[OperandAddressing].set(0, AddressingString, nullptr);
|
||||
OperandClassParams[OperandMemory].set(0, MemoryString, nullptr);
|
||||
@ -1639,7 +1702,7 @@ void Parameterize()
|
||||
OperandClassParams[OperandKernelEnqueueFlags].set(0, KernelEnqueueFlagsString, nullptr);
|
||||
OperandClassParams[OperandKernelProfilingInfo].set(0, KernelProfilingInfoString, nullptr, true);
|
||||
OperandClassParams[OperandCapability].set(0, CapabilityString, nullptr);
|
||||
OperandClassParams[OperandOpcode].set(OpCodeMask + 1, OpcodeString, 0);
|
||||
OperandClassParams[OperandOpcode].set(OpCodeMask + 1, OpcodeString, nullptr);
|
||||
|
||||
// set name of operator, an initial set of <id> style operands, and the description
|
||||
|
||||
@ -2980,6 +3043,10 @@ void Parameterize()
|
||||
InstructionDesc[OpRayQueryGetIntersectionWorldToObjectKHR].operands.push(OperandId, "'Committed'");
|
||||
InstructionDesc[OpRayQueryGetIntersectionWorldToObjectKHR].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[OpRayQueryGetIntersectionTriangleVertexPositionsKHR].operands.push(OperandId, "'RayQuery'");
|
||||
InstructionDesc[OpRayQueryGetIntersectionTriangleVertexPositionsKHR].operands.push(OperandId, "'Committed'");
|
||||
InstructionDesc[OpRayQueryGetIntersectionWorldToObjectKHR].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[OpImageSampleFootprintNV].operands.push(OperandId, "'Sampled Image'");
|
||||
InstructionDesc[OpImageSampleFootprintNV].operands.push(OperandId, "'Coordinate'");
|
||||
InstructionDesc[OpImageSampleFootprintNV].operands.push(OperandId, "'Granularity'");
|
||||
@ -3030,6 +3097,196 @@ void Parameterize()
|
||||
InstructionDesc[OpDemoteToHelperInvocationEXT].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[OpReadClockKHR].operands.push(OperandScope, "'Scope'");
|
||||
|
||||
InstructionDesc[OpTypeHitObjectNV].setResultAndType(true, false);
|
||||
|
||||
InstructionDesc[OpHitObjectGetShaderRecordBufferHandleNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectGetShaderRecordBufferHandleNV].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[OpReorderThreadWithHintNV].operands.push(OperandId, "'Hint'");
|
||||
InstructionDesc[OpReorderThreadWithHintNV].operands.push(OperandId, "'Bits'");
|
||||
InstructionDesc[OpReorderThreadWithHintNV].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[OpReorderThreadWithHitObjectNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpReorderThreadWithHitObjectNV].operands.push(OperandId, "'Hint'");
|
||||
InstructionDesc[OpReorderThreadWithHitObjectNV].operands.push(OperandId, "'Bits'");
|
||||
InstructionDesc[OpReorderThreadWithHitObjectNV].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[OpHitObjectGetCurrentTimeNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectGetCurrentTimeNV].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[OpHitObjectGetHitKindNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectGetHitKindNV].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[OpHitObjectGetPrimitiveIndexNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectGetPrimitiveIndexNV].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[OpHitObjectGetGeometryIndexNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectGetGeometryIndexNV].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[OpHitObjectGetInstanceIdNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectGetInstanceIdNV].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[OpHitObjectGetInstanceCustomIndexNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectGetInstanceCustomIndexNV].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[OpHitObjectGetObjectRayDirectionNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectGetObjectRayDirectionNV].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[OpHitObjectGetObjectRayOriginNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectGetObjectRayOriginNV].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[OpHitObjectGetWorldRayDirectionNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectGetWorldRayDirectionNV].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[OpHitObjectGetWorldRayOriginNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectGetWorldRayOriginNV].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[OpHitObjectGetWorldToObjectNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectGetWorldToObjectNV].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[OpHitObjectGetObjectToWorldNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectGetObjectToWorldNV].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[OpHitObjectGetRayTMaxNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectGetRayTMaxNV].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[OpHitObjectGetRayTMinNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectGetRayTMinNV].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[OpHitObjectGetShaderBindingTableRecordIndexNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectGetShaderBindingTableRecordIndexNV].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[OpHitObjectIsEmptyNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectIsEmptyNV].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[OpHitObjectIsHitNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectIsHitNV].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[OpHitObjectIsMissNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectIsMissNV].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[OpHitObjectGetAttributesNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectGetAttributesNV].operands.push(OperandId, "'HitObjectAttribute'");
|
||||
InstructionDesc[OpHitObjectGetAttributesNV].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[OpHitObjectExecuteShaderNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectExecuteShaderNV].operands.push(OperandId, "'Payload'");
|
||||
InstructionDesc[OpHitObjectExecuteShaderNV].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'Acceleration Structure'");
|
||||
InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'InstanceId'");
|
||||
InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'PrimitiveId'");
|
||||
InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'GeometryIndex'");
|
||||
InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'HitKind'");
|
||||
InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'SBT Record Offset'");
|
||||
InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'SBT Record Stride'");
|
||||
InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'Origin'");
|
||||
InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'TMin'");
|
||||
InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'Direction'");
|
||||
InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'TMax'");
|
||||
InstructionDesc[OpHitObjectRecordHitNV].operands.push(OperandId, "'HitObject Attribute'");
|
||||
InstructionDesc[OpHitObjectRecordHitNV].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'Acceleration Structure'");
|
||||
InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'InstanceId'");
|
||||
InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'PrimitiveId'");
|
||||
InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'GeometryIndex'");
|
||||
InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'HitKind'");
|
||||
InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'SBT Record Offset'");
|
||||
InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'SBT Record Stride'");
|
||||
InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'Origin'");
|
||||
InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'TMin'");
|
||||
InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'Direction'");
|
||||
InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'TMax'");
|
||||
InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'Current Time'");
|
||||
InstructionDesc[OpHitObjectRecordHitMotionNV].operands.push(OperandId, "'HitObject Attribute'");
|
||||
InstructionDesc[OpHitObjectRecordHitMotionNV].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexNV].operands.push(OperandId, "'Acceleration Structure'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexNV].operands.push(OperandId, "'InstanceId'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexNV].operands.push(OperandId, "'PrimitiveId'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexNV].operands.push(OperandId, "'GeometryIndex'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexNV].operands.push(OperandId, "'HitKind'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexNV].operands.push(OperandId, "'SBT Record Index'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexNV].operands.push(OperandId, "'Origin'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexNV].operands.push(OperandId, "'TMin'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexNV].operands.push(OperandId, "'Direction'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexNV].operands.push(OperandId, "'TMax'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexNV].operands.push(OperandId, "'HitObject Attribute'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexNV].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'Acceleration Structure'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'InstanceId'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'PrimitiveId'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'GeometryIndex'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'HitKind'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'SBT Record Index'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'Origin'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'TMin'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'Direction'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'TMax'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'Current Time'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].operands.push(OperandId, "'HitObject Attribute'");
|
||||
InstructionDesc[OpHitObjectRecordHitWithIndexMotionNV].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[OpHitObjectRecordMissNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectRecordMissNV].operands.push(OperandId, "'SBT Index'");
|
||||
InstructionDesc[OpHitObjectRecordMissNV].operands.push(OperandId, "'Origin'");
|
||||
InstructionDesc[OpHitObjectRecordMissNV].operands.push(OperandId, "'TMin'");
|
||||
InstructionDesc[OpHitObjectRecordMissNV].operands.push(OperandId, "'Direction'");
|
||||
InstructionDesc[OpHitObjectRecordMissNV].operands.push(OperandId, "'TMax'");
|
||||
InstructionDesc[OpHitObjectRecordMissNV].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[OpHitObjectRecordMissMotionNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectRecordMissMotionNV].operands.push(OperandId, "'SBT Index'");
|
||||
InstructionDesc[OpHitObjectRecordMissMotionNV].operands.push(OperandId, "'Origin'");
|
||||
InstructionDesc[OpHitObjectRecordMissMotionNV].operands.push(OperandId, "'TMin'");
|
||||
InstructionDesc[OpHitObjectRecordMissMotionNV].operands.push(OperandId, "'Direction'");
|
||||
InstructionDesc[OpHitObjectRecordMissMotionNV].operands.push(OperandId, "'TMax'");
|
||||
InstructionDesc[OpHitObjectRecordMissMotionNV].operands.push(OperandId, "'Current Time'");
|
||||
InstructionDesc[OpHitObjectRecordMissMotionNV].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[OpHitObjectRecordEmptyNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectRecordEmptyNV].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[OpHitObjectTraceRayNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectTraceRayNV].operands.push(OperandId, "'Acceleration Structure'");
|
||||
InstructionDesc[OpHitObjectTraceRayNV].operands.push(OperandId, "'RayFlags'");
|
||||
InstructionDesc[OpHitObjectTraceRayNV].operands.push(OperandId, "'Cullmask'");
|
||||
InstructionDesc[OpHitObjectTraceRayNV].operands.push(OperandId, "'SBT Record Offset'");
|
||||
InstructionDesc[OpHitObjectTraceRayNV].operands.push(OperandId, "'SBT Record Stride'");
|
||||
InstructionDesc[OpHitObjectTraceRayNV].operands.push(OperandId, "'Miss Index'");
|
||||
InstructionDesc[OpHitObjectTraceRayNV].operands.push(OperandId, "'Origin'");
|
||||
InstructionDesc[OpHitObjectTraceRayNV].operands.push(OperandId, "'TMin'");
|
||||
InstructionDesc[OpHitObjectTraceRayNV].operands.push(OperandId, "'Direction'");
|
||||
InstructionDesc[OpHitObjectTraceRayNV].operands.push(OperandId, "'TMax'");
|
||||
InstructionDesc[OpHitObjectTraceRayNV].operands.push(OperandId, "'Payload'");
|
||||
InstructionDesc[OpHitObjectTraceRayNV].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'Acceleration Structure'");
|
||||
InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'RayFlags'");
|
||||
InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'Cullmask'");
|
||||
InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'SBT Record Offset'");
|
||||
InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'SBT Record Stride'");
|
||||
InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'Miss Index'");
|
||||
InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'Origin'");
|
||||
InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'TMin'");
|
||||
InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'Direction'");
|
||||
InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'TMax'");
|
||||
InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'Time'");
|
||||
InstructionDesc[OpHitObjectTraceRayMotionNV].operands.push(OperandId, "'Payload'");
|
||||
InstructionDesc[OpHitObjectTraceRayMotionNV].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[OpColorAttachmentReadEXT].operands.push(OperandId, "'Attachment'");
|
||||
InstructionDesc[OpColorAttachmentReadEXT].operands.push(OperandId, "'Sample'", true);
|
||||
InstructionDesc[OpStencilAttachmentReadEXT].operands.push(OperandId, "'Sample'", true);
|
||||
InstructionDesc[OpDepthAttachmentReadEXT].operands.push(OperandId, "'Sample'", true);
|
||||
}
|
||||
|
||||
}; // end spv namespace
|
||||
|
4
3rdparty/glslang/SPIRV/doc.h
vendored
4
3rdparty/glslang/SPIRV/doc.h
vendored
@ -190,7 +190,7 @@ protected:
|
||||
// Parameterize an enumerant
|
||||
class EnumParameters {
|
||||
public:
|
||||
EnumParameters() : desc(0) { }
|
||||
EnumParameters() : desc(nullptr) { }
|
||||
const char* desc;
|
||||
};
|
||||
|
||||
@ -198,7 +198,7 @@ public:
|
||||
class EnumDefinition : public EnumParameters {
|
||||
public:
|
||||
EnumDefinition() :
|
||||
ceiling(0), bitmask(false), getName(0), enumParams(0), operandParams(0) { }
|
||||
ceiling(0), bitmask(false), getName(nullptr), enumParams(nullptr), operandParams(nullptr) { }
|
||||
void set(int ceil, const char* (*name)(int), EnumParameters* ep, bool mask = false)
|
||||
{
|
||||
ceiling = ceil;
|
||||
|
13
3rdparty/glslang/SPIRV/hex_float.h
vendored
13
3rdparty/glslang/SPIRV/hex_float.h
vendored
@ -23,19 +23,6 @@
|
||||
#include <limits>
|
||||
#include <sstream>
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1800
|
||||
namespace std {
|
||||
bool isnan(double f)
|
||||
{
|
||||
return ::_isnan(f) != 0;
|
||||
}
|
||||
bool isinf(double f)
|
||||
{
|
||||
return ::_finite(f) == 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "bitutils.h"
|
||||
|
||||
namespace spvutils {
|
||||
|
218
3rdparty/glslang/SPIRV/spirv.hpp
vendored
218
3rdparty/glslang/SPIRV/spirv.hpp
vendored
@ -1,19 +1,19 @@
|
||||
// Copyright (c) 2014-2020 The Khronos Group Inc.
|
||||
//
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and/or associated documentation files (the "Materials"),
|
||||
// to deal in the Materials without restriction, including without limitation
|
||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
// and/or sell copies of the Materials, and to permit persons to whom the
|
||||
// Materials are furnished to do so, subject to the following conditions:
|
||||
//
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Materials.
|
||||
//
|
||||
//
|
||||
// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
|
||||
// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
|
||||
// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
|
||||
//
|
||||
// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
|
||||
//
|
||||
// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
@ -26,8 +26,8 @@
|
||||
// the Binary Section of the SPIR-V specification.
|
||||
|
||||
// Enumeration tokens for SPIR-V, in various styles:
|
||||
// C, C++, C++11, JSON, Lua, Python, C#, D
|
||||
//
|
||||
// C, C++, C++11, JSON, Lua, Python, C#, D, Beef
|
||||
//
|
||||
// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
|
||||
// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
|
||||
// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL
|
||||
@ -36,7 +36,9 @@
|
||||
// - C# will use enum classes in the Specification class located in the "Spv" namespace,
|
||||
// e.g.: Spv.Specification.SourceLanguage.GLSL
|
||||
// - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL
|
||||
//
|
||||
// - Beef will use enum classes in the Specification class located in the "Spv" namespace,
|
||||
// e.g.: Spv.Specification.SourceLanguage.GLSL
|
||||
//
|
||||
// Some tokens act like mask values, which can be OR'd together,
|
||||
// while others are mutually exclusive. The mask-like ones have
|
||||
// "Mask" in their name, and a parallel enum that has the shift
|
||||
@ -66,6 +68,7 @@ enum SourceLanguage {
|
||||
SourceLanguageOpenCL_CPP = 4,
|
||||
SourceLanguageHLSL = 5,
|
||||
SourceLanguageCPP_for_OpenCL = 6,
|
||||
SourceLanguageSYCL = 7,
|
||||
SourceLanguageMax = 0x7fffffff,
|
||||
};
|
||||
|
||||
@ -153,6 +156,9 @@ enum ExecutionMode {
|
||||
ExecutionModeSubgroupsPerWorkgroupId = 37,
|
||||
ExecutionModeLocalSizeId = 38,
|
||||
ExecutionModeLocalSizeHintId = 39,
|
||||
ExecutionModeNonCoherentColorAttachmentReadEXT = 4169,
|
||||
ExecutionModeNonCoherentDepthAttachmentReadEXT = 4170,
|
||||
ExecutionModeNonCoherentStencilAttachmentReadEXT = 4171,
|
||||
ExecutionModeSubgroupUniformControlFlowKHR = 4421,
|
||||
ExecutionModePostDepthCoverage = 4446,
|
||||
ExecutionModeDenormPreserve = 4459,
|
||||
@ -192,6 +198,8 @@ enum ExecutionMode {
|
||||
ExecutionModeNoGlobalOffsetINTEL = 5895,
|
||||
ExecutionModeNumSIMDWorkitemsINTEL = 5896,
|
||||
ExecutionModeSchedulerTargetFmaxMhzINTEL = 5903,
|
||||
ExecutionModeStreamingInterfaceINTEL = 6154,
|
||||
ExecutionModeNamedBarrierCountINTEL = 6417,
|
||||
ExecutionModeMax = 0x7fffffff,
|
||||
};
|
||||
|
||||
@ -209,6 +217,7 @@ enum StorageClass {
|
||||
StorageClassAtomicCounter = 10,
|
||||
StorageClassImage = 11,
|
||||
StorageClassStorageBuffer = 12,
|
||||
StorageClassTileImageEXT = 4172,
|
||||
StorageClassCallableDataKHR = 5328,
|
||||
StorageClassCallableDataNV = 5328,
|
||||
StorageClassIncomingCallableDataKHR = 5329,
|
||||
@ -223,6 +232,7 @@ enum StorageClass {
|
||||
StorageClassShaderRecordBufferNV = 5343,
|
||||
StorageClassPhysicalStorageBuffer = 5349,
|
||||
StorageClassPhysicalStorageBufferEXT = 5349,
|
||||
StorageClassHitObjectAttributeNV = 5385,
|
||||
StorageClassTaskPayloadWorkgroupEXT = 5402,
|
||||
StorageClassCodeSectionINTEL = 5605,
|
||||
StorageClassDeviceOnlyINTEL = 5936,
|
||||
@ -238,6 +248,7 @@ enum Dim {
|
||||
DimRect = 4,
|
||||
DimBuffer = 5,
|
||||
DimSubpassData = 6,
|
||||
DimTileImageDataEXT = 4173,
|
||||
DimMax = 0x7fffffff,
|
||||
};
|
||||
|
||||
@ -448,6 +459,7 @@ enum FunctionParameterAttribute {
|
||||
FunctionParameterAttributeNoCapture = 5,
|
||||
FunctionParameterAttributeNoWrite = 6,
|
||||
FunctionParameterAttributeNoReadWrite = 7,
|
||||
FunctionParameterAttributeRuntimeAlignedINTEL = 5940,
|
||||
FunctionParameterAttributeMax = 0x7fffffff,
|
||||
};
|
||||
|
||||
@ -518,6 +530,7 @@ enum Decoration {
|
||||
DecorationRestrictPointerEXT = 5355,
|
||||
DecorationAliasedPointer = 5356,
|
||||
DecorationAliasedPointerEXT = 5356,
|
||||
DecorationHitObjectShaderRecordBufferNV = 5386,
|
||||
DecorationBindlessSamplerNV = 5398,
|
||||
DecorationBindlessImageNV = 5399,
|
||||
DecorationBoundSamplerNV = 5400,
|
||||
@ -556,12 +569,27 @@ enum Decoration {
|
||||
DecorationPrefetchINTEL = 5902,
|
||||
DecorationStallEnableINTEL = 5905,
|
||||
DecorationFuseLoopsInFunctionINTEL = 5907,
|
||||
DecorationMathOpDSPModeINTEL = 5909,
|
||||
DecorationAliasScopeINTEL = 5914,
|
||||
DecorationNoAliasINTEL = 5915,
|
||||
DecorationInitiationIntervalINTEL = 5917,
|
||||
DecorationMaxConcurrencyINTEL = 5918,
|
||||
DecorationPipelineEnableINTEL = 5919,
|
||||
DecorationBufferLocationINTEL = 5921,
|
||||
DecorationIOPipeStorageINTEL = 5944,
|
||||
DecorationFunctionFloatingPointModeINTEL = 6080,
|
||||
DecorationSingleElementVectorINTEL = 6085,
|
||||
DecorationVectorComputeCallableFunctionINTEL = 6087,
|
||||
DecorationMediaBlockIOINTEL = 6140,
|
||||
DecorationConduitKernelArgumentINTEL = 6175,
|
||||
DecorationRegisterMapKernelArgumentINTEL = 6176,
|
||||
DecorationMMHostInterfaceAddressWidthINTEL = 6177,
|
||||
DecorationMMHostInterfaceDataWidthINTEL = 6178,
|
||||
DecorationMMHostInterfaceLatencyINTEL = 6179,
|
||||
DecorationMMHostInterfaceReadWriteModeINTEL = 6180,
|
||||
DecorationMMHostInterfaceMaxBurstINTEL = 6181,
|
||||
DecorationMMHostInterfaceWaitRequestINTEL = 6182,
|
||||
DecorationStableKernelArgumentINTEL = 6183,
|
||||
DecorationMax = 0x7fffffff,
|
||||
};
|
||||
|
||||
@ -607,6 +635,11 @@ enum BuiltIn {
|
||||
BuiltInSubgroupLocalInvocationId = 41,
|
||||
BuiltInVertexIndex = 42,
|
||||
BuiltInInstanceIndex = 43,
|
||||
BuiltInCoreIDARM = 4160,
|
||||
BuiltInCoreCountARM = 4161,
|
||||
BuiltInCoreMaxIDARM = 4162,
|
||||
BuiltInWarpIDARM = 4163,
|
||||
BuiltInWarpMaxIDARM = 4164,
|
||||
BuiltInSubgroupEqMask = 4416,
|
||||
BuiltInSubgroupEqMaskKHR = 4416,
|
||||
BuiltInSubgroupGeMask = 4417,
|
||||
@ -684,6 +717,7 @@ enum BuiltIn {
|
||||
BuiltInHitKindKHR = 5333,
|
||||
BuiltInHitKindNV = 5333,
|
||||
BuiltInCurrentRayTimeNV = 5334,
|
||||
BuiltInHitTriangleVertexPositionsKHR = 5335,
|
||||
BuiltInIncomingRayFlagsKHR = 5351,
|
||||
BuiltInIncomingRayFlagsNV = 5351,
|
||||
BuiltInRayGeometryIndexKHR = 5352,
|
||||
@ -725,6 +759,8 @@ enum LoopControlShift {
|
||||
LoopControlMaxInterleavingINTELShift = 21,
|
||||
LoopControlSpeculatedIterationsINTELShift = 22,
|
||||
LoopControlNoFusionINTELShift = 23,
|
||||
LoopControlLoopCountINTELShift = 24,
|
||||
LoopControlMaxReinvocationDelayINTELShift = 25,
|
||||
LoopControlMax = 0x7fffffff,
|
||||
};
|
||||
|
||||
@ -747,6 +783,8 @@ enum LoopControlMask {
|
||||
LoopControlMaxInterleavingINTELMask = 0x00200000,
|
||||
LoopControlSpeculatedIterationsINTELMask = 0x00400000,
|
||||
LoopControlNoFusionINTELMask = 0x00800000,
|
||||
LoopControlLoopCountINTELMask = 0x01000000,
|
||||
LoopControlMaxReinvocationDelayINTELMask = 0x02000000,
|
||||
};
|
||||
|
||||
enum FunctionControlShift {
|
||||
@ -819,6 +857,8 @@ enum MemoryAccessShift {
|
||||
MemoryAccessMakePointerVisibleKHRShift = 4,
|
||||
MemoryAccessNonPrivatePointerShift = 5,
|
||||
MemoryAccessNonPrivatePointerKHRShift = 5,
|
||||
MemoryAccessAliasScopeINTELMaskShift = 16,
|
||||
MemoryAccessNoAliasINTELMaskShift = 17,
|
||||
MemoryAccessMax = 0x7fffffff,
|
||||
};
|
||||
|
||||
@ -833,6 +873,8 @@ enum MemoryAccessMask {
|
||||
MemoryAccessMakePointerVisibleKHRMask = 0x00000010,
|
||||
MemoryAccessNonPrivatePointerMask = 0x00000020,
|
||||
MemoryAccessNonPrivatePointerKHRMask = 0x00000020,
|
||||
MemoryAccessAliasScopeINTELMaskMask = 0x00010000,
|
||||
MemoryAccessNoAliasINTELMaskMask = 0x00020000,
|
||||
};
|
||||
|
||||
enum Scope {
|
||||
@ -946,6 +988,10 @@ enum Capability {
|
||||
CapabilityShaderLayer = 69,
|
||||
CapabilityShaderViewportIndex = 70,
|
||||
CapabilityUniformDecoration = 71,
|
||||
CapabilityCoreBuiltinsARM = 4165,
|
||||
CapabilityTileImageColorReadAccessEXT = 4166,
|
||||
CapabilityTileImageDepthReadAccessEXT = 4167,
|
||||
CapabilityTileImageStencilReadAccessEXT = 4168,
|
||||
CapabilityFragmentShadingRateKHR = 4422,
|
||||
CapabilitySubgroupBallotKHR = 4423,
|
||||
CapabilityDrawParameters = 4427,
|
||||
@ -995,7 +1041,7 @@ enum Capability {
|
||||
CapabilityMeshShadingNV = 5266,
|
||||
CapabilityImageFootprintNV = 5282,
|
||||
CapabilityMeshShadingEXT = 5283,
|
||||
CapabilityFragmentBarycentricKHR = 5284,
|
||||
CapabilityFragmentBarycentricKHR = 5284,
|
||||
CapabilityFragmentBarycentricNV = 5284,
|
||||
CapabilityComputeDerivativeGroupQuadsNV = 5288,
|
||||
CapabilityFragmentDensityEXT = 5291,
|
||||
@ -1025,6 +1071,7 @@ enum Capability {
|
||||
CapabilityUniformTexelBufferArrayNonUniformIndexingEXT = 5311,
|
||||
CapabilityStorageTexelBufferArrayNonUniformIndexing = 5312,
|
||||
CapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312,
|
||||
CapabilityRayTracingPositionFetchKHR = 5336,
|
||||
CapabilityRayTracingNV = 5340,
|
||||
CapabilityRayTracingMotionBlurNV = 5341,
|
||||
CapabilityVulkanMemoryModel = 5345,
|
||||
@ -1042,7 +1089,10 @@ enum Capability {
|
||||
CapabilityFragmentShaderPixelInterlockEXT = 5378,
|
||||
CapabilityDemoteToHelperInvocation = 5379,
|
||||
CapabilityDemoteToHelperInvocationEXT = 5379,
|
||||
CapabilityRayTracingOpacityMicromapEXT = 5381,
|
||||
CapabilityShaderInvocationReorderNV = 5383,
|
||||
CapabilityBindlessTextureNV = 5390,
|
||||
CapabilityRayQueryPositionFetchKHR = 5391,
|
||||
CapabilitySubgroupShuffleINTEL = 5568,
|
||||
CapabilitySubgroupBufferBlockIOINTEL = 5569,
|
||||
CapabilitySubgroupImageBlockIOINTEL = 5570,
|
||||
@ -1075,9 +1125,13 @@ enum Capability {
|
||||
CapabilityFPGAMemoryAccessesINTEL = 5898,
|
||||
CapabilityFPGAClusterAttributesINTEL = 5904,
|
||||
CapabilityLoopFuseINTEL = 5906,
|
||||
CapabilityFPGADSPControlINTEL = 5908,
|
||||
CapabilityMemoryAccessAliasingINTEL = 5910,
|
||||
CapabilityFPGAInvocationPipeliningAttributesINTEL = 5916,
|
||||
CapabilityFPGABufferLocationINTEL = 5920,
|
||||
CapabilityArbitraryPrecisionFixedPointINTEL = 5922,
|
||||
CapabilityUSMStorageClassesINTEL = 5935,
|
||||
CapabilityRuntimeAlignedAttributeINTEL = 5939,
|
||||
CapabilityIOPipesINTEL = 5943,
|
||||
CapabilityBlockingPipesINTEL = 5945,
|
||||
CapabilityFPGARegINTEL = 5948,
|
||||
@ -1091,12 +1145,16 @@ enum Capability {
|
||||
CapabilityDotProductKHR = 6019,
|
||||
CapabilityRayCullMaskKHR = 6020,
|
||||
CapabilityBitInstructions = 6025,
|
||||
CapabilityGroupNonUniformRotateKHR = 6026,
|
||||
CapabilityAtomicFloat32AddEXT = 6033,
|
||||
CapabilityAtomicFloat64AddEXT = 6034,
|
||||
CapabilityLongConstantCompositeINTEL = 6089,
|
||||
CapabilityOptNoneINTEL = 6094,
|
||||
CapabilityAtomicFloat16AddEXT = 6095,
|
||||
CapabilityDebugInfoModuleINTEL = 6114,
|
||||
CapabilitySplitBarrierINTEL = 6141,
|
||||
CapabilityFPGAArgumentInterfacesINTEL = 6174,
|
||||
CapabilityGroupUniformArithmeticKHR = 6400,
|
||||
CapabilityMax = 0x7fffffff,
|
||||
};
|
||||
|
||||
@ -1111,6 +1169,7 @@ enum RayFlagsShift {
|
||||
RayFlagsCullNoOpaqueKHRShift = 7,
|
||||
RayFlagsSkipTrianglesKHRShift = 8,
|
||||
RayFlagsSkipAABBsKHRShift = 9,
|
||||
RayFlagsForceOpacityMicromap2StateEXTShift = 10,
|
||||
RayFlagsMax = 0x7fffffff,
|
||||
};
|
||||
|
||||
@ -1126,6 +1185,7 @@ enum RayFlagsMask {
|
||||
RayFlagsCullNoOpaqueKHRMask = 0x00000080,
|
||||
RayFlagsSkipTrianglesKHRMask = 0x00000100,
|
||||
RayFlagsSkipAABBsKHRMask = 0x00000200,
|
||||
RayFlagsForceOpacityMicromap2StateEXTMask = 0x00000400,
|
||||
};
|
||||
|
||||
enum RayQueryIntersection {
|
||||
@ -1546,12 +1606,16 @@ enum Op {
|
||||
OpPtrEqual = 401,
|
||||
OpPtrNotEqual = 402,
|
||||
OpPtrDiff = 403,
|
||||
OpColorAttachmentReadEXT = 4160,
|
||||
OpDepthAttachmentReadEXT = 4161,
|
||||
OpStencilAttachmentReadEXT = 4162,
|
||||
OpTerminateInvocation = 4416,
|
||||
OpSubgroupBallotKHR = 4421,
|
||||
OpSubgroupFirstInvocationKHR = 4422,
|
||||
OpSubgroupAllKHR = 4428,
|
||||
OpSubgroupAnyKHR = 4429,
|
||||
OpSubgroupAllEqualKHR = 4430,
|
||||
OpGroupNonUniformRotateKHR = 4431,
|
||||
OpSubgroupReadInvocationKHR = 4432,
|
||||
OpTraceRayKHR = 4445,
|
||||
OpExecuteCallableKHR = 4446,
|
||||
@ -1588,6 +1652,39 @@ enum Op {
|
||||
OpFragmentMaskFetchAMD = 5011,
|
||||
OpFragmentFetchAMD = 5012,
|
||||
OpReadClockKHR = 5056,
|
||||
OpHitObjectRecordHitMotionNV = 5249,
|
||||
OpHitObjectRecordHitWithIndexMotionNV = 5250,
|
||||
OpHitObjectRecordMissMotionNV = 5251,
|
||||
OpHitObjectGetWorldToObjectNV = 5252,
|
||||
OpHitObjectGetObjectToWorldNV = 5253,
|
||||
OpHitObjectGetObjectRayDirectionNV = 5254,
|
||||
OpHitObjectGetObjectRayOriginNV = 5255,
|
||||
OpHitObjectTraceRayMotionNV = 5256,
|
||||
OpHitObjectGetShaderRecordBufferHandleNV = 5257,
|
||||
OpHitObjectGetShaderBindingTableRecordIndexNV = 5258,
|
||||
OpHitObjectRecordEmptyNV = 5259,
|
||||
OpHitObjectTraceRayNV = 5260,
|
||||
OpHitObjectRecordHitNV = 5261,
|
||||
OpHitObjectRecordHitWithIndexNV = 5262,
|
||||
OpHitObjectRecordMissNV = 5263,
|
||||
OpHitObjectExecuteShaderNV = 5264,
|
||||
OpHitObjectGetCurrentTimeNV = 5265,
|
||||
OpHitObjectGetAttributesNV = 5266,
|
||||
OpHitObjectGetHitKindNV = 5267,
|
||||
OpHitObjectGetPrimitiveIndexNV = 5268,
|
||||
OpHitObjectGetGeometryIndexNV = 5269,
|
||||
OpHitObjectGetInstanceIdNV = 5270,
|
||||
OpHitObjectGetInstanceCustomIndexNV = 5271,
|
||||
OpHitObjectGetWorldRayDirectionNV = 5272,
|
||||
OpHitObjectGetWorldRayOriginNV = 5273,
|
||||
OpHitObjectGetRayTMaxNV = 5274,
|
||||
OpHitObjectGetRayTMinNV = 5275,
|
||||
OpHitObjectIsEmptyNV = 5276,
|
||||
OpHitObjectIsHitNV = 5277,
|
||||
OpHitObjectIsMissNV = 5278,
|
||||
OpReorderThreadWithHitObjectNV = 5279,
|
||||
OpReorderThreadWithHintNV = 5280,
|
||||
OpTypeHitObjectNV = 5281,
|
||||
OpImageSampleFootprintNV = 5283,
|
||||
OpEmitMeshTasksEXT = 5294,
|
||||
OpSetMeshOutputsEXT = 5295,
|
||||
@ -1600,6 +1697,7 @@ enum Op {
|
||||
OpTraceNV = 5337,
|
||||
OpTraceMotionNV = 5338,
|
||||
OpTraceRayMotionNV = 5339,
|
||||
OpRayQueryGetIntersectionTriangleVertexPositionsKHR = 5340,
|
||||
OpTypeAccelerationStructureKHR = 5341,
|
||||
OpTypeAccelerationStructureNV = 5341,
|
||||
OpExecuteCallableNV = 5344,
|
||||
@ -1820,6 +1918,9 @@ enum Op {
|
||||
OpArbitraryFloatPowRINTEL = 5881,
|
||||
OpArbitraryFloatPowNINTEL = 5882,
|
||||
OpLoopControlINTEL = 5887,
|
||||
OpAliasDomainDeclINTEL = 5911,
|
||||
OpAliasScopeDeclINTEL = 5912,
|
||||
OpAliasScopeListDeclINTEL = 5913,
|
||||
OpFixedSqrtINTEL = 5923,
|
||||
OpFixedRecipINTEL = 5924,
|
||||
OpFixedRsqrtINTEL = 5925,
|
||||
@ -1858,10 +1959,23 @@ enum Op {
|
||||
OpTypeStructContinuedINTEL = 6090,
|
||||
OpConstantCompositeContinuedINTEL = 6091,
|
||||
OpSpecConstantCompositeContinuedINTEL = 6092,
|
||||
OpControlBarrierArriveINTEL = 6142,
|
||||
OpControlBarrierWaitINTEL = 6143,
|
||||
OpGroupIMulKHR = 6401,
|
||||
OpGroupFMulKHR = 6402,
|
||||
OpGroupBitwiseAndKHR = 6403,
|
||||
OpGroupBitwiseOrKHR = 6404,
|
||||
OpGroupBitwiseXorKHR = 6405,
|
||||
OpGroupLogicalAndKHR = 6406,
|
||||
OpGroupLogicalOrKHR = 6407,
|
||||
OpGroupLogicalXorKHR = 6408,
|
||||
OpMax = 0x7fffffff,
|
||||
};
|
||||
|
||||
#ifdef SPV_ENABLE_UTILITY_CODE
|
||||
#ifndef __cplusplus
|
||||
#include <stdbool.h>
|
||||
#endif
|
||||
inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
|
||||
*hasResult = *hasResultType = false;
|
||||
switch (opcode) {
|
||||
@ -2210,12 +2324,16 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
|
||||
case OpPtrEqual: *hasResult = true; *hasResultType = true; break;
|
||||
case OpPtrNotEqual: *hasResult = true; *hasResultType = true; break;
|
||||
case OpPtrDiff: *hasResult = true; *hasResultType = true; break;
|
||||
case OpColorAttachmentReadEXT: *hasResult = true; *hasResultType = true; break;
|
||||
case OpDepthAttachmentReadEXT: *hasResult = true; *hasResultType = true; break;
|
||||
case OpStencilAttachmentReadEXT: *hasResult = true; *hasResultType = true; break;
|
||||
case OpTerminateInvocation: *hasResult = false; *hasResultType = false; break;
|
||||
case OpSubgroupBallotKHR: *hasResult = true; *hasResultType = true; break;
|
||||
case OpSubgroupFirstInvocationKHR: *hasResult = true; *hasResultType = true; break;
|
||||
case OpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break;
|
||||
case OpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break;
|
||||
case OpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break;
|
||||
case OpGroupNonUniformRotateKHR: *hasResult = true; *hasResultType = true; break;
|
||||
case OpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break;
|
||||
case OpTraceRayKHR: *hasResult = false; *hasResultType = false; break;
|
||||
case OpExecuteCallableKHR: *hasResult = false; *hasResultType = false; break;
|
||||
@ -2246,10 +2364,43 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
|
||||
case OpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break;
|
||||
case OpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break;
|
||||
case OpReadClockKHR: *hasResult = true; *hasResultType = true; break;
|
||||
case OpHitObjectRecordHitMotionNV: *hasResult = false; *hasResultType = false; break;
|
||||
case OpHitObjectRecordHitWithIndexMotionNV: *hasResult = false; *hasResultType = false; break;
|
||||
case OpHitObjectRecordMissMotionNV: *hasResult = false; *hasResultType = false; break;
|
||||
case OpHitObjectGetWorldToObjectNV: *hasResult = true; *hasResultType = true; break;
|
||||
case OpHitObjectGetObjectToWorldNV: *hasResult = true; *hasResultType = true; break;
|
||||
case OpHitObjectGetObjectRayDirectionNV: *hasResult = true; *hasResultType = true; break;
|
||||
case OpHitObjectGetObjectRayOriginNV: *hasResult = true; *hasResultType = true; break;
|
||||
case OpHitObjectTraceRayMotionNV: *hasResult = false; *hasResultType = false; break;
|
||||
case OpHitObjectGetShaderRecordBufferHandleNV: *hasResult = true; *hasResultType = true; break;
|
||||
case OpHitObjectGetShaderBindingTableRecordIndexNV: *hasResult = true; *hasResultType = true; break;
|
||||
case OpHitObjectRecordEmptyNV: *hasResult = false; *hasResultType = false; break;
|
||||
case OpHitObjectTraceRayNV: *hasResult = false; *hasResultType = false; break;
|
||||
case OpHitObjectRecordHitNV: *hasResult = false; *hasResultType = false; break;
|
||||
case OpHitObjectRecordHitWithIndexNV: *hasResult = false; *hasResultType = false; break;
|
||||
case OpHitObjectRecordMissNV: *hasResult = false; *hasResultType = false; break;
|
||||
case OpHitObjectExecuteShaderNV: *hasResult = false; *hasResultType = false; break;
|
||||
case OpHitObjectGetCurrentTimeNV: *hasResult = true; *hasResultType = true; break;
|
||||
case OpHitObjectGetAttributesNV: *hasResult = false; *hasResultType = false; break;
|
||||
case OpHitObjectGetHitKindNV: *hasResult = true; *hasResultType = true; break;
|
||||
case OpHitObjectGetPrimitiveIndexNV: *hasResult = true; *hasResultType = true; break;
|
||||
case OpHitObjectGetGeometryIndexNV: *hasResult = true; *hasResultType = true; break;
|
||||
case OpHitObjectGetInstanceIdNV: *hasResult = true; *hasResultType = true; break;
|
||||
case OpHitObjectGetInstanceCustomIndexNV: *hasResult = true; *hasResultType = true; break;
|
||||
case OpHitObjectGetWorldRayDirectionNV: *hasResult = true; *hasResultType = true; break;
|
||||
case OpHitObjectGetWorldRayOriginNV: *hasResult = true; *hasResultType = true; break;
|
||||
case OpHitObjectGetRayTMaxNV: *hasResult = true; *hasResultType = true; break;
|
||||
case OpHitObjectGetRayTMinNV: *hasResult = true; *hasResultType = true; break;
|
||||
case OpHitObjectIsEmptyNV: *hasResult = true; *hasResultType = true; break;
|
||||
case OpHitObjectIsHitNV: *hasResult = true; *hasResultType = true; break;
|
||||
case OpHitObjectIsMissNV: *hasResult = true; *hasResultType = true; break;
|
||||
case OpReorderThreadWithHitObjectNV: *hasResult = false; *hasResultType = false; break;
|
||||
case OpReorderThreadWithHintNV: *hasResult = false; *hasResultType = false; break;
|
||||
case OpTypeHitObjectNV: *hasResult = true; *hasResultType = false; break;
|
||||
case OpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; break;
|
||||
case OpGroupNonUniformPartitionNV: *hasResult = true; *hasResultType = true; break;
|
||||
case OpEmitMeshTasksEXT: *hasResult = false; *hasResultType = false; break;
|
||||
case OpSetMeshOutputsEXT: *hasResult = false; *hasResultType = false; break;
|
||||
case OpGroupNonUniformPartitionNV: *hasResult = true; *hasResultType = true; break;
|
||||
case OpWritePackedPrimitiveIndices4x8NV: *hasResult = false; *hasResultType = false; break;
|
||||
case OpReportIntersectionNV: *hasResult = true; *hasResultType = true; break;
|
||||
case OpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break;
|
||||
@ -2257,6 +2408,7 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
|
||||
case OpTraceNV: *hasResult = false; *hasResultType = false; break;
|
||||
case OpTraceMotionNV: *hasResult = false; *hasResultType = false; break;
|
||||
case OpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break;
|
||||
case OpRayQueryGetIntersectionTriangleVertexPositionsKHR: *hasResult = true; *hasResultType = true; break;
|
||||
case OpTypeAccelerationStructureNV: *hasResult = true; *hasResultType = false; break;
|
||||
case OpExecuteCallableNV: *hasResult = false; *hasResultType = false; break;
|
||||
case OpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break;
|
||||
@ -2473,6 +2625,9 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
|
||||
case OpArbitraryFloatPowRINTEL: *hasResult = true; *hasResultType = true; break;
|
||||
case OpArbitraryFloatPowNINTEL: *hasResult = true; *hasResultType = true; break;
|
||||
case OpLoopControlINTEL: *hasResult = false; *hasResultType = false; break;
|
||||
case OpAliasDomainDeclINTEL: *hasResult = true; *hasResultType = false; break;
|
||||
case OpAliasScopeDeclINTEL: *hasResult = true; *hasResultType = false; break;
|
||||
case OpAliasScopeListDeclINTEL: *hasResult = true; *hasResultType = false; break;
|
||||
case OpFixedSqrtINTEL: *hasResult = true; *hasResultType = true; break;
|
||||
case OpFixedRecipINTEL: *hasResult = true; *hasResultType = true; break;
|
||||
case OpFixedRsqrtINTEL: *hasResult = true; *hasResultType = true; break;
|
||||
@ -2511,23 +2666,64 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
|
||||
case OpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break;
|
||||
case OpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
|
||||
case OpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
|
||||
case OpControlBarrierArriveINTEL: *hasResult = false; *hasResultType = false; break;
|
||||
case OpControlBarrierWaitINTEL: *hasResult = false; *hasResultType = false; break;
|
||||
case OpGroupIMulKHR: *hasResult = true; *hasResultType = true; break;
|
||||
case OpGroupFMulKHR: *hasResult = true; *hasResultType = true; break;
|
||||
case OpGroupBitwiseAndKHR: *hasResult = true; *hasResultType = true; break;
|
||||
case OpGroupBitwiseOrKHR: *hasResult = true; *hasResultType = true; break;
|
||||
case OpGroupBitwiseXorKHR: *hasResult = true; *hasResultType = true; break;
|
||||
case OpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break;
|
||||
case OpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break;
|
||||
case OpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break;
|
||||
}
|
||||
}
|
||||
#endif /* SPV_ENABLE_UTILITY_CODE */
|
||||
|
||||
// Overload operator| for mask bit combining
|
||||
// Overload bitwise operators for mask bit combining
|
||||
|
||||
inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); }
|
||||
inline ImageOperandsMask operator&(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) & unsigned(b)); }
|
||||
inline ImageOperandsMask operator^(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) ^ unsigned(b)); }
|
||||
inline ImageOperandsMask operator~(ImageOperandsMask a) { return ImageOperandsMask(~unsigned(a)); }
|
||||
inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); }
|
||||
inline FPFastMathModeMask operator&(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) & unsigned(b)); }
|
||||
inline FPFastMathModeMask operator^(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) ^ unsigned(b)); }
|
||||
inline FPFastMathModeMask operator~(FPFastMathModeMask a) { return FPFastMathModeMask(~unsigned(a)); }
|
||||
inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); }
|
||||
inline SelectionControlMask operator&(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) & unsigned(b)); }
|
||||
inline SelectionControlMask operator^(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) ^ unsigned(b)); }
|
||||
inline SelectionControlMask operator~(SelectionControlMask a) { return SelectionControlMask(~unsigned(a)); }
|
||||
inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); }
|
||||
inline LoopControlMask operator&(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) & unsigned(b)); }
|
||||
inline LoopControlMask operator^(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) ^ unsigned(b)); }
|
||||
inline LoopControlMask operator~(LoopControlMask a) { return LoopControlMask(~unsigned(a)); }
|
||||
inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); }
|
||||
inline FunctionControlMask operator&(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) & unsigned(b)); }
|
||||
inline FunctionControlMask operator^(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) ^ unsigned(b)); }
|
||||
inline FunctionControlMask operator~(FunctionControlMask a) { return FunctionControlMask(~unsigned(a)); }
|
||||
inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); }
|
||||
inline MemorySemanticsMask operator&(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) & unsigned(b)); }
|
||||
inline MemorySemanticsMask operator^(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) ^ unsigned(b)); }
|
||||
inline MemorySemanticsMask operator~(MemorySemanticsMask a) { return MemorySemanticsMask(~unsigned(a)); }
|
||||
inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); }
|
||||
inline MemoryAccessMask operator&(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) & unsigned(b)); }
|
||||
inline MemoryAccessMask operator^(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) ^ unsigned(b)); }
|
||||
inline MemoryAccessMask operator~(MemoryAccessMask a) { return MemoryAccessMask(~unsigned(a)); }
|
||||
inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); }
|
||||
inline KernelProfilingInfoMask operator&(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) & unsigned(b)); }
|
||||
inline KernelProfilingInfoMask operator^(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) ^ unsigned(b)); }
|
||||
inline KernelProfilingInfoMask operator~(KernelProfilingInfoMask a) { return KernelProfilingInfoMask(~unsigned(a)); }
|
||||
inline RayFlagsMask operator|(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) | unsigned(b)); }
|
||||
inline RayFlagsMask operator&(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) & unsigned(b)); }
|
||||
inline RayFlagsMask operator^(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) ^ unsigned(b)); }
|
||||
inline RayFlagsMask operator~(RayFlagsMask a) { return RayFlagsMask(~unsigned(a)); }
|
||||
inline FragmentShadingRateMask operator|(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) | unsigned(b)); }
|
||||
inline FragmentShadingRateMask operator&(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) & unsigned(b)); }
|
||||
inline FragmentShadingRateMask operator^(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) ^ unsigned(b)); }
|
||||
inline FragmentShadingRateMask operator~(FragmentShadingRateMask a) { return FragmentShadingRateMask(~unsigned(a)); }
|
||||
|
||||
} // end namespace spv
|
||||
|
||||
#endif // #ifndef spirv_HPP
|
||||
|
||||
|
40
3rdparty/glslang/StandAlone/StandAlone.cpp
vendored
40
3rdparty/glslang/StandAlone/StandAlone.cpp
vendored
@ -258,6 +258,17 @@ public:
|
||||
text.append("\n");
|
||||
}
|
||||
|
||||
void addText(std::string preambleText)
|
||||
{
|
||||
fixLine(preambleText);
|
||||
|
||||
Processes.push_back("preamble-text");
|
||||
Processes.back().append(preambleText);
|
||||
|
||||
text.append(preambleText);
|
||||
text.append("\n");
|
||||
}
|
||||
|
||||
protected:
|
||||
void fixLine(std::string& line)
|
||||
{
|
||||
@ -504,7 +515,7 @@ void ProcessGlobalBlockSettings(int& argc, char**& argv, std::string* name, unsi
|
||||
|
||||
if (set) {
|
||||
errno = 0;
|
||||
int setVal = ::strtol(argv[curArg], NULL, 10);
|
||||
int setVal = ::strtol(argv[curArg], nullptr, 10);
|
||||
if (errno || setVal < 0) {
|
||||
printf("%s: invalid set\n", argv[curArg]);
|
||||
usage();
|
||||
@ -516,7 +527,7 @@ void ProcessGlobalBlockSettings(int& argc, char**& argv, std::string* name, unsi
|
||||
|
||||
if (binding) {
|
||||
errno = 0;
|
||||
int bindingVal = ::strtol(argv[curArg], NULL, 10);
|
||||
int bindingVal = ::strtol(argv[curArg], nullptr, 10);
|
||||
if (errno || bindingVal < 0) {
|
||||
printf("%s: invalid binding\n", argv[curArg]);
|
||||
usage();
|
||||
@ -594,12 +605,12 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
|
||||
const auto getUniformOverride = [getStringOperand]() {
|
||||
const char *arg = getStringOperand("-u<name>:<location>");
|
||||
const char *split = strchr(arg, ':');
|
||||
if (split == NULL) {
|
||||
if (split == nullptr) {
|
||||
printf("%s: missing location\n", arg);
|
||||
exit(EFailUsage);
|
||||
}
|
||||
errno = 0;
|
||||
int location = ::strtol(split + 1, NULL, 10);
|
||||
int location = ::strtol(split + 1, nullptr, 10);
|
||||
if (errno) {
|
||||
printf("%s: invalid location\n", arg);
|
||||
exit(EFailUsage);
|
||||
@ -626,7 +637,7 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
|
||||
} else if (lowerword == "uniform-base") {
|
||||
if (argc <= 1)
|
||||
Error("no <base> provided", lowerword.c_str());
|
||||
uniformBase = ::strtol(argv[1], NULL, 10);
|
||||
uniformBase = ::strtol(argv[1], nullptr, 10);
|
||||
bumpArg();
|
||||
break;
|
||||
} else if (lowerword == "client") {
|
||||
@ -727,6 +738,13 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
|
||||
} else if (lowerword == "no-storage-format" || // synonyms
|
||||
lowerword == "nsf") {
|
||||
Options |= EOptionNoStorageFormat;
|
||||
} else if (lowerword == "preamble-text" ||
|
||||
lowerword == "p") {
|
||||
if (argc > 1)
|
||||
UserPreamble.addText(argv[1]);
|
||||
else
|
||||
Error("expects <text>", argv[0]);
|
||||
bumpArg();
|
||||
} else if (lowerword == "relaxed-errors") {
|
||||
Options |= EOptionRelaxedErrors;
|
||||
} else if (lowerword == "reflect-strict-array-suffix") {
|
||||
@ -926,6 +944,9 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
|
||||
else
|
||||
Error("unknown -O option");
|
||||
break;
|
||||
case 'P':
|
||||
UserPreamble.addText(getStringOperand("-P<text>"));
|
||||
break;
|
||||
case 'R':
|
||||
VulkanRulesRelaxed = true;
|
||||
break;
|
||||
@ -1161,7 +1182,7 @@ void CompileShaders(glslang::TWorklist& worklist)
|
||||
} else {
|
||||
while (worklist.remove(workItem)) {
|
||||
ShHandle compiler = ShConstructCompiler(FindLanguage(workItem->name), Options);
|
||||
if (compiler == 0)
|
||||
if (compiler == nullptr)
|
||||
return;
|
||||
|
||||
CompileFile(workItem->name.c_str(), compiler);
|
||||
@ -1297,7 +1318,7 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
|
||||
sources.push_back(compUnit.fileNameList[i]);
|
||||
}
|
||||
glslang::TShader* shader = new glslang::TShader(compUnit.stage);
|
||||
shader->setStringsWithLengthsAndNames(compUnit.text, NULL, compUnit.fileNameList, compUnit.count);
|
||||
shader->setStringsWithLengthsAndNames(compUnit.text, nullptr, compUnit.fileNameList, compUnit.count);
|
||||
if (entryPointName)
|
||||
shader->setEntryPoint(entryPointName);
|
||||
if (sourceEntryPointName) {
|
||||
@ -1832,7 +1853,7 @@ void CompileFile(const char* fileName, ShHandle compiler)
|
||||
SetMessageOptions(messages);
|
||||
|
||||
if (UserPreamble.isSet())
|
||||
Error("-D and -U options require -l (linking)\n");
|
||||
Error("-D, -U and -P options require -l (linking)\n");
|
||||
|
||||
for (int i = 0; i < ((Options & EOptionMemoryLeakMode) ? 100 : 1); ++i) {
|
||||
for (int j = 0; j < ((Options & EOptionMemoryLeakMode) ? 100 : 1); ++j) {
|
||||
@ -1902,6 +1923,9 @@ void usage()
|
||||
" is searched first, followed by left-to-right order of -I\n"
|
||||
" -Od disables optimization; may cause illegal SPIR-V for HLSL\n"
|
||||
" -Os optimizes SPIR-V to minimize size\n"
|
||||
" -P<text> | --preamble-text <text> | --P <text>\n"
|
||||
" inject custom preamble text, which is treated as if it\n"
|
||||
" appeared immediately after the version declaration (if any).\n"
|
||||
" -R use relaxed verification rules for generating Vulkan SPIR-V,\n"
|
||||
" allowing the use of default uniforms, atomic_uints, and\n"
|
||||
" gl_VertexID and gl_InstanceID keywords.\n"
|
||||
|
6
3rdparty/glslang/StandAlone/spirv-remap.cpp
vendored
6
3rdparty/glslang/StandAlone/spirv-remap.cpp
vendored
@ -157,7 +157,7 @@ namespace {
|
||||
}
|
||||
|
||||
// Print helpful usage message to stdout, and exit
|
||||
void usage(const char* const name, const char* const msg = 0)
|
||||
void usage(const char* const name, const char* const msg = nullptr)
|
||||
{
|
||||
if (msg)
|
||||
std::cout << msg << std::endl << std::endl;
|
||||
@ -245,7 +245,7 @@ namespace {
|
||||
verbosity = 1;
|
||||
|
||||
if (a < argc) {
|
||||
char* end_ptr = 0;
|
||||
char* end_ptr = nullptr;
|
||||
int verb = ::strtol(argv[a], &end_ptr, 10);
|
||||
// If we have not read to the end of the string or
|
||||
// the string contained no elements, then we do not want to
|
||||
@ -352,13 +352,11 @@ int main(int argc, char** argv)
|
||||
int opts;
|
||||
int verbosity;
|
||||
|
||||
#ifdef use_cpp11
|
||||
// handle errors by exiting
|
||||
spv::spirvbin_t::registerErrorHandler(errHandler);
|
||||
|
||||
// Log messages to std::cout
|
||||
spv::spirvbin_t::registerLogHandler(logHandler);
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
usage(argv[0]);
|
||||
|
4
3rdparty/glslang/build_info.h
vendored
4
3rdparty/glslang/build_info.h
vendored
@ -34,8 +34,8 @@
|
||||
#ifndef GLSLANG_BUILD_INFO
|
||||
#define GLSLANG_BUILD_INFO
|
||||
|
||||
#define GLSLANG_VERSION_MAJOR 11
|
||||
#define GLSLANG_VERSION_MINOR 12
|
||||
#define GLSLANG_VERSION_MAJOR 12
|
||||
#define GLSLANG_VERSION_MINOR 1
|
||||
#define GLSLANG_VERSION_PATCH 0
|
||||
#define GLSLANG_VERSION_FLAVOR ""
|
||||
|
||||
|
@ -80,25 +80,6 @@ typedef struct glslang_program_s {
|
||||
(CallbackIncluder::callbacks::free_include_result)
|
||||
*/
|
||||
class CallbackIncluder : public glslang::TShader::Includer {
|
||||
public:
|
||||
/* Wrapper of IncludeResult which stores a glsl_include_result object internally */
|
||||
class CallbackIncludeResult : public glslang::TShader::Includer::IncludeResult {
|
||||
public:
|
||||
CallbackIncludeResult(const std::string& headerName, const char* const headerData, const size_t headerLength,
|
||||
void* userData, glsl_include_result_t* includeResult)
|
||||
: glslang::TShader::Includer::IncludeResult(headerName, headerData, headerLength, userData),
|
||||
includeResult(includeResult)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~CallbackIncludeResult() {}
|
||||
|
||||
protected:
|
||||
friend class CallbackIncluder;
|
||||
|
||||
glsl_include_result_t* includeResult;
|
||||
};
|
||||
|
||||
public:
|
||||
CallbackIncluder(glsl_include_callbacks_t _callbacks, void* _context) : callbacks(_callbacks), context(_context) {}
|
||||
|
||||
@ -110,9 +91,7 @@ public:
|
||||
if (this->callbacks.include_system) {
|
||||
glsl_include_result_t* result =
|
||||
this->callbacks.include_system(this->context, headerName, includerName, inclusionDepth);
|
||||
|
||||
return new CallbackIncludeResult(std::string(headerName), result->header_data, result->header_length,
|
||||
nullptr, result);
|
||||
return makeIncludeResult(result);
|
||||
}
|
||||
|
||||
return glslang::TShader::Includer::includeSystem(headerName, includerName, inclusionDepth);
|
||||
@ -124,9 +103,7 @@ public:
|
||||
if (this->callbacks.include_local) {
|
||||
glsl_include_result_t* result =
|
||||
this->callbacks.include_local(this->context, headerName, includerName, inclusionDepth);
|
||||
|
||||
return new CallbackIncludeResult(std::string(headerName), result->header_data, result->header_length,
|
||||
nullptr, result);
|
||||
return makeIncludeResult(result);
|
||||
}
|
||||
|
||||
return glslang::TShader::Includer::includeLocal(headerName, includerName, inclusionDepth);
|
||||
@ -139,22 +116,25 @@ public:
|
||||
if (result == nullptr)
|
||||
return;
|
||||
|
||||
if (this->callbacks.free_include_result && (result->userData == nullptr)) {
|
||||
CallbackIncludeResult* innerResult = static_cast<CallbackIncludeResult*>(result);
|
||||
/* use internal free() function */
|
||||
this->callbacks.free_include_result(this->context, innerResult->includeResult);
|
||||
/* ignore internal fields of TShader::Includer::IncludeResult */
|
||||
delete result;
|
||||
return;
|
||||
if (this->callbacks.free_include_result) {
|
||||
this->callbacks.free_include_result(this->context, static_cast<glsl_include_result_t*>(result->userData));
|
||||
}
|
||||
|
||||
delete[] static_cast<char*>(result->userData);
|
||||
delete result;
|
||||
}
|
||||
|
||||
private:
|
||||
CallbackIncluder() {}
|
||||
|
||||
IncludeResult* makeIncludeResult(glsl_include_result_t* result) {
|
||||
if (!result) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return new glslang::TShader::Includer::IncludeResult(
|
||||
std::string(result->header_name), result->header_data, result->header_length, result);
|
||||
}
|
||||
|
||||
/* C callback pointers */
|
||||
glsl_include_callbacks_t callbacks;
|
||||
/* User-defined context */
|
||||
@ -394,8 +374,11 @@ GLSLANG_EXPORT const char* glslang_shader_get_preprocessed_code(glslang_shader_t
|
||||
|
||||
GLSLANG_EXPORT int glslang_shader_preprocess(glslang_shader_t* shader, const glslang_input_t* input)
|
||||
{
|
||||
DirStackFileIncluder Includer;
|
||||
/* TODO: use custom callbacks if they are available in 'i->callbacks' */
|
||||
DirStackFileIncluder dirStackFileIncluder;
|
||||
CallbackIncluder callbackIncluder(input->callbacks, input->callbacks_ctx);
|
||||
glslang::TShader::Includer& Includer = (input->callbacks.include_local||input->callbacks.include_system)
|
||||
? static_cast<glslang::TShader::Includer&>(callbackIncluder)
|
||||
: static_cast<glslang::TShader::Includer&>(dirStackFileIncluder);
|
||||
return shader->shader->preprocess(
|
||||
reinterpret_cast<const TBuiltInResource*>(input->resource),
|
||||
input->default_version,
|
||||
|
@ -82,7 +82,7 @@ void DeleteUniformMap(TUniformMap* map)
|
||||
|
||||
TShHandleBase* ConstructBindings()
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void DeleteBindingList(TShHandleBase* bindingList)
|
||||
|
@ -36,6 +36,7 @@
|
||||
#ifndef HLSLATTRIBUTES_H_
|
||||
#define HLSLATTRIBUTES_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <unordered_map>
|
||||
#include <functional>
|
||||
|
||||
|
278
3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp
vendored
278
3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp
vendored
@ -823,8 +823,10 @@ bool HlslGrammar::acceptLayoutQualifierList(TQualifier& qualifier)
|
||||
// | UINT
|
||||
// | BOOL
|
||||
//
|
||||
bool HlslGrammar::acceptTemplateVecMatBasicType(TBasicType& basicType)
|
||||
bool HlslGrammar::acceptTemplateVecMatBasicType(TBasicType& basicType,
|
||||
TPrecisionQualifier& precision)
|
||||
{
|
||||
precision = EpqNone;
|
||||
switch (peek()) {
|
||||
case EHTokFloat:
|
||||
basicType = EbtFloat;
|
||||
@ -842,6 +844,23 @@ bool HlslGrammar::acceptTemplateVecMatBasicType(TBasicType& basicType)
|
||||
case EHTokBool:
|
||||
basicType = EbtBool;
|
||||
break;
|
||||
case EHTokHalf:
|
||||
basicType = parseContext.hlslEnable16BitTypes() ? EbtFloat16 : EbtFloat;
|
||||
break;
|
||||
case EHTokMin16float:
|
||||
case EHTokMin10float:
|
||||
basicType = parseContext.hlslEnable16BitTypes() ? EbtFloat16 : EbtFloat;
|
||||
precision = EpqMedium;
|
||||
break;
|
||||
case EHTokMin16int:
|
||||
case EHTokMin12int:
|
||||
basicType = parseContext.hlslEnable16BitTypes() ? EbtInt16 : EbtInt;
|
||||
precision = EpqMedium;
|
||||
break;
|
||||
case EHTokMin16uint:
|
||||
basicType = parseContext.hlslEnable16BitTypes() ? EbtUint16 : EbtUint;
|
||||
precision = EpqMedium;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@ -867,7 +886,8 @@ bool HlslGrammar::acceptVectorTemplateType(TType& type)
|
||||
}
|
||||
|
||||
TBasicType basicType;
|
||||
if (! acceptTemplateVecMatBasicType(basicType)) {
|
||||
TPrecisionQualifier precision;
|
||||
if (! acceptTemplateVecMatBasicType(basicType, precision)) {
|
||||
expected("scalar type");
|
||||
return false;
|
||||
}
|
||||
@ -890,7 +910,7 @@ bool HlslGrammar::acceptVectorTemplateType(TType& type)
|
||||
|
||||
const int vecSizeI = vecSize->getAsConstantUnion()->getConstArray()[0].getIConst();
|
||||
|
||||
new(&type) TType(basicType, EvqTemporary, vecSizeI);
|
||||
new(&type) TType(basicType, EvqTemporary, precision, vecSizeI);
|
||||
|
||||
if (vecSizeI == 1)
|
||||
type.makeVector();
|
||||
@ -919,7 +939,8 @@ bool HlslGrammar::acceptMatrixTemplateType(TType& type)
|
||||
}
|
||||
|
||||
TBasicType basicType;
|
||||
if (! acceptTemplateVecMatBasicType(basicType)) {
|
||||
TPrecisionQualifier precision;
|
||||
if (! acceptTemplateVecMatBasicType(basicType, precision)) {
|
||||
expected("scalar type");
|
||||
return false;
|
||||
}
|
||||
@ -956,7 +977,7 @@ bool HlslGrammar::acceptMatrixTemplateType(TType& type)
|
||||
if (! acceptLiteral(cols))
|
||||
return false;
|
||||
|
||||
new(&type) TType(basicType, EvqTemporary, 0,
|
||||
new(&type) TType(basicType, EvqTemporary, precision, 0,
|
||||
rows->getAsConstantUnion()->getConstArray()[0].getIConst(),
|
||||
cols->getAsConstantUnion()->getConstArray()[0].getIConst());
|
||||
|
||||
@ -2064,6 +2085,251 @@ bool HlslGrammar::acceptType(TType& type, TIntermNode*& nodeList)
|
||||
new(&type) TType(EbtDouble, EvqTemporary, 0, 4, 4);
|
||||
break;
|
||||
|
||||
case EHTokMin16float1x1:
|
||||
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 1, 1);
|
||||
break;
|
||||
case EHTokMin16float1x2:
|
||||
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 1, 2);
|
||||
break;
|
||||
case EHTokMin16float1x3:
|
||||
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 1, 3);
|
||||
break;
|
||||
case EHTokMin16float1x4:
|
||||
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 1, 4);
|
||||
break;
|
||||
case EHTokMin16float2x1:
|
||||
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 2, 1);
|
||||
break;
|
||||
case EHTokMin16float2x2:
|
||||
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 2, 2);
|
||||
break;
|
||||
case EHTokMin16float2x3:
|
||||
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 2, 3);
|
||||
break;
|
||||
case EHTokMin16float2x4:
|
||||
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 2, 4);
|
||||
break;
|
||||
case EHTokMin16float3x1:
|
||||
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 3, 1);
|
||||
break;
|
||||
case EHTokMin16float3x2:
|
||||
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 3, 2);
|
||||
break;
|
||||
case EHTokMin16float3x3:
|
||||
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 3, 3);
|
||||
break;
|
||||
case EHTokMin16float3x4:
|
||||
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 3, 4);
|
||||
break;
|
||||
case EHTokMin16float4x1:
|
||||
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 4, 1);
|
||||
break;
|
||||
case EHTokMin16float4x2:
|
||||
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 4, 2);
|
||||
break;
|
||||
case EHTokMin16float4x3:
|
||||
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 4, 3);
|
||||
break;
|
||||
case EHTokMin16float4x4:
|
||||
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 4, 4);
|
||||
break;
|
||||
|
||||
case EHTokMin10float1x1:
|
||||
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 1, 1);
|
||||
break;
|
||||
case EHTokMin10float1x2:
|
||||
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 1, 2);
|
||||
break;
|
||||
case EHTokMin10float1x3:
|
||||
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 1, 3);
|
||||
break;
|
||||
case EHTokMin10float1x4:
|
||||
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 1, 4);
|
||||
break;
|
||||
case EHTokMin10float2x1:
|
||||
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 2, 1);
|
||||
break;
|
||||
case EHTokMin10float2x2:
|
||||
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 2, 2);
|
||||
break;
|
||||
case EHTokMin10float2x3:
|
||||
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 2, 3);
|
||||
break;
|
||||
case EHTokMin10float2x4:
|
||||
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 2, 4);
|
||||
break;
|
||||
case EHTokMin10float3x1:
|
||||
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 3, 1);
|
||||
break;
|
||||
case EHTokMin10float3x2:
|
||||
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 3, 2);
|
||||
break;
|
||||
case EHTokMin10float3x3:
|
||||
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 3, 3);
|
||||
break;
|
||||
case EHTokMin10float3x4:
|
||||
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 3, 4);
|
||||
break;
|
||||
case EHTokMin10float4x1:
|
||||
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 4, 1);
|
||||
break;
|
||||
case EHTokMin10float4x2:
|
||||
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 4, 2);
|
||||
break;
|
||||
case EHTokMin10float4x3:
|
||||
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 4, 3);
|
||||
break;
|
||||
case EHTokMin10float4x4:
|
||||
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 4, 4);
|
||||
break;
|
||||
|
||||
case EHTokMin16int1x1:
|
||||
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 1, 1);
|
||||
break;
|
||||
case EHTokMin16int1x2:
|
||||
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 1, 2);
|
||||
break;
|
||||
case EHTokMin16int1x3:
|
||||
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 1, 3);
|
||||
break;
|
||||
case EHTokMin16int1x4:
|
||||
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 1, 4);
|
||||
break;
|
||||
case EHTokMin16int2x1:
|
||||
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 2, 1);
|
||||
break;
|
||||
case EHTokMin16int2x2:
|
||||
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 2, 2);
|
||||
break;
|
||||
case EHTokMin16int2x3:
|
||||
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 2, 3);
|
||||
break;
|
||||
case EHTokMin16int2x4:
|
||||
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 2, 4);
|
||||
break;
|
||||
case EHTokMin16int3x1:
|
||||
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 3, 1);
|
||||
break;
|
||||
case EHTokMin16int3x2:
|
||||
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 3, 2);
|
||||
break;
|
||||
case EHTokMin16int3x3:
|
||||
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 3, 3);
|
||||
break;
|
||||
case EHTokMin16int3x4:
|
||||
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 3, 4);
|
||||
break;
|
||||
case EHTokMin16int4x1:
|
||||
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 4, 1);
|
||||
break;
|
||||
case EHTokMin16int4x2:
|
||||
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 4, 2);
|
||||
break;
|
||||
case EHTokMin16int4x3:
|
||||
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 4, 3);
|
||||
break;
|
||||
case EHTokMin16int4x4:
|
||||
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 4, 4);
|
||||
break;
|
||||
|
||||
case EHTokMin12int1x1:
|
||||
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 1, 1);
|
||||
break;
|
||||
case EHTokMin12int1x2:
|
||||
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 1, 2);
|
||||
break;
|
||||
case EHTokMin12int1x3:
|
||||
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 1, 3);
|
||||
break;
|
||||
case EHTokMin12int1x4:
|
||||
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 1, 4);
|
||||
break;
|
||||
case EHTokMin12int2x1:
|
||||
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 2, 1);
|
||||
break;
|
||||
case EHTokMin12int2x2:
|
||||
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 2, 2);
|
||||
break;
|
||||
case EHTokMin12int2x3:
|
||||
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 2, 3);
|
||||
break;
|
||||
case EHTokMin12int2x4:
|
||||
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 2, 4);
|
||||
break;
|
||||
case EHTokMin12int3x1:
|
||||
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 3, 1);
|
||||
break;
|
||||
case EHTokMin12int3x2:
|
||||
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 3, 2);
|
||||
break;
|
||||
case EHTokMin12int3x3:
|
||||
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 3, 3);
|
||||
break;
|
||||
case EHTokMin12int3x4:
|
||||
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 3, 4);
|
||||
break;
|
||||
case EHTokMin12int4x1:
|
||||
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 4, 1);
|
||||
break;
|
||||
case EHTokMin12int4x2:
|
||||
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 4, 2);
|
||||
break;
|
||||
case EHTokMin12int4x3:
|
||||
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 4, 3);
|
||||
break;
|
||||
case EHTokMin12int4x4:
|
||||
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 4, 4);
|
||||
break;
|
||||
|
||||
case EHTokMin16uint1x1:
|
||||
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 1, 1);
|
||||
break;
|
||||
case EHTokMin16uint1x2:
|
||||
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 1, 2);
|
||||
break;
|
||||
case EHTokMin16uint1x3:
|
||||
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 1, 3);
|
||||
break;
|
||||
case EHTokMin16uint1x4:
|
||||
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 1, 4);
|
||||
break;
|
||||
case EHTokMin16uint2x1:
|
||||
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 2, 1);
|
||||
break;
|
||||
case EHTokMin16uint2x2:
|
||||
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 2, 2);
|
||||
break;
|
||||
case EHTokMin16uint2x3:
|
||||
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 2, 3);
|
||||
break;
|
||||
case EHTokMin16uint2x4:
|
||||
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 2, 4);
|
||||
break;
|
||||
case EHTokMin16uint3x1:
|
||||
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 3, 1);
|
||||
break;
|
||||
case EHTokMin16uint3x2:
|
||||
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 3, 2);
|
||||
break;
|
||||
case EHTokMin16uint3x3:
|
||||
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 3, 3);
|
||||
break;
|
||||
case EHTokMin16uint3x4:
|
||||
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 3, 4);
|
||||
break;
|
||||
case EHTokMin16uint4x1:
|
||||
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 4, 1);
|
||||
break;
|
||||
case EHTokMin16uint4x2:
|
||||
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 4, 2);
|
||||
break;
|
||||
case EHTokMin16uint4x3:
|
||||
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 4, 3);
|
||||
break;
|
||||
case EHTokMin16uint4x4:
|
||||
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 4, 4);
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@ -3794,7 +4060,7 @@ bool HlslGrammar::acceptIterationStatement(TIntermNode*& statement, const TAttri
|
||||
parseContext.unnestLooping();
|
||||
--parseContext.controlFlowNestingLevel;
|
||||
|
||||
loopNode = intermediate.addLoop(statement, condition, 0, false, loc);
|
||||
loopNode = intermediate.addLoop(statement, condition, nullptr, false, loc);
|
||||
statement = loopNode;
|
||||
break;
|
||||
|
||||
|
2
3rdparty/glslang/glslang/HLSL/hlslGrammar.h
vendored
2
3rdparty/glslang/glslang/HLSL/hlslGrammar.h
vendored
@ -76,7 +76,7 @@ namespace glslang {
|
||||
bool acceptLayoutQualifierList(TQualifier&);
|
||||
bool acceptType(TType&);
|
||||
bool acceptType(TType&, TIntermNode*& nodeList);
|
||||
bool acceptTemplateVecMatBasicType(TBasicType&);
|
||||
bool acceptTemplateVecMatBasicType(TBasicType&, TPrecisionQualifier&);
|
||||
bool acceptVectorTemplateType(TType&);
|
||||
bool acceptMatrixTemplateType(TType&);
|
||||
bool acceptTessellationDeclType(TBuiltInVariable&);
|
||||
|
@ -1177,10 +1177,13 @@ void HlslParseContext::flatten(const TVariable& variable, bool linkage, bool arr
|
||||
if (type.isBuiltIn() && !type.isStruct())
|
||||
return;
|
||||
|
||||
|
||||
auto entry = flattenMap.insert(std::make_pair(variable.getUniqueId(),
|
||||
TFlattenData(type.getQualifier().layoutBinding,
|
||||
type.getQualifier().layoutLocation)));
|
||||
|
||||
if (type.isStruct() && type.getStruct()->size()==0)
|
||||
return;
|
||||
// if flattening arrayed io struct, array each member of dereferenced type
|
||||
if (arrayed) {
|
||||
const TType dereferencedType(type, 0);
|
||||
@ -1596,7 +1599,7 @@ void HlslParseContext::handleFunctionDeclarator(const TSourceLoc& loc, TFunction
|
||||
//
|
||||
bool builtIn;
|
||||
TSymbol* symbol = symbolTable.find(function.getMangledName(), &builtIn);
|
||||
const TFunction* prevDec = symbol ? symbol->getAsFunction() : 0;
|
||||
const TFunction* prevDec = symbol ? symbol->getAsFunction() : nullptr;
|
||||
|
||||
if (prototype) {
|
||||
// All built-in functions are defined, even though they don't have a body.
|
||||
@ -2472,7 +2475,7 @@ TIntermNode* HlslParseContext::handleReturnValue(const TSourceLoc& loc, TIntermT
|
||||
void HlslParseContext::handleFunctionArgument(TFunction* function,
|
||||
TIntermTyped*& arguments, TIntermTyped* newArg)
|
||||
{
|
||||
TParameter param = { 0, new TType, nullptr };
|
||||
TParameter param = { nullptr, new TType, nullptr };
|
||||
param.type->shallowCopy(newArg->getType());
|
||||
|
||||
function->addParameter(param);
|
||||
@ -7565,7 +7568,6 @@ const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, TFunction
|
||||
candidateList[0]->getBuiltInOp() == EOpMethodRestartStrip ||
|
||||
candidateList[0]->getBuiltInOp() == EOpMethodIncrementCounter ||
|
||||
candidateList[0]->getBuiltInOp() == EOpMethodDecrementCounter ||
|
||||
candidateList[0]->getBuiltInOp() == EOpMethodAppend ||
|
||||
candidateList[0]->getBuiltInOp() == EOpMethodConsume)) {
|
||||
return candidateList[0];
|
||||
}
|
||||
@ -7790,18 +7792,18 @@ const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, TFunction
|
||||
// Handle aggregates: put all args into the new function call
|
||||
for (int arg = 0; arg < int(args->getAsAggregate()->getSequence().size()); ++arg) {
|
||||
// TODO: But for constness, we could avoid the new & shallowCopy, and use the pointer directly.
|
||||
TParameter param = { 0, new TType, nullptr };
|
||||
TParameter param = { nullptr, new TType, nullptr };
|
||||
param.type->shallowCopy(args->getAsAggregate()->getSequence()[arg]->getAsTyped()->getType());
|
||||
convertedCall.addParameter(param);
|
||||
}
|
||||
} else if (args->getAsUnaryNode()) {
|
||||
// Handle unaries: put all args into the new function call
|
||||
TParameter param = { 0, new TType, nullptr };
|
||||
TParameter param = { nullptr, new TType, nullptr };
|
||||
param.type->shallowCopy(args->getAsUnaryNode()->getOperand()->getAsTyped()->getType());
|
||||
convertedCall.addParameter(param);
|
||||
} else if (args->getAsTyped()) {
|
||||
// Handle bare e.g, floats, not in an aggregate.
|
||||
TParameter param = { 0, new TType, nullptr };
|
||||
TParameter param = { nullptr, new TType, nullptr };
|
||||
param.type->shallowCopy(args->getAsTyped()->getType());
|
||||
convertedCall.addParameter(param);
|
||||
} else {
|
||||
@ -9046,7 +9048,8 @@ void HlslParseContext::fixBlockUniformOffsets(const TQualifier& qualifier, TType
|
||||
// "The specified offset must be a multiple
|
||||
// of the base alignment of the type of the block member it qualifies, or a compile-time error results."
|
||||
if (! IsMultipleOfPow2(memberQualifier.layoutOffset, memberAlignment))
|
||||
error(memberLoc, "must be a multiple of the member's alignment", "offset", "");
|
||||
error(memberLoc, "must be a multiple of the member's alignment", "offset",
|
||||
"(layout offset = %d | member alignment = %d)", memberQualifier.layoutOffset, memberAlignment);
|
||||
|
||||
// "The offset qualifier forces the qualified member to start at or after the specified
|
||||
// integral-constant expression, which will be its byte offset from the beginning of the buffer.
|
||||
|
@ -147,14 +147,14 @@ public:
|
||||
void declareTypedef(const TSourceLoc&, const TString& identifier, const TType&);
|
||||
void declareStruct(const TSourceLoc&, TString& structName, TType&);
|
||||
TSymbol* lookupUserType(const TString&, TType&);
|
||||
TIntermNode* declareVariable(const TSourceLoc&, const TString& identifier, TType&, TIntermTyped* initializer = 0);
|
||||
TIntermNode* declareVariable(const TSourceLoc&, const TString& identifier, TType&, TIntermTyped* initializer = nullptr);
|
||||
void lengthenList(const TSourceLoc&, TIntermSequence& list, int size, TIntermTyped* scalarInit);
|
||||
TIntermTyped* handleConstructor(const TSourceLoc&, TIntermTyped*, const TType&);
|
||||
TIntermTyped* addConstructor(const TSourceLoc&, TIntermTyped*, const TType&);
|
||||
TIntermTyped* convertArray(TIntermTyped*, const TType&);
|
||||
TIntermTyped* constructAggregate(TIntermNode*, const TType&, int, const TSourceLoc&);
|
||||
TIntermTyped* constructBuiltIn(const TType&, TOperator, TIntermTyped*, const TSourceLoc&, bool subset);
|
||||
void declareBlock(const TSourceLoc&, TType&, const TString* instanceName = 0);
|
||||
void declareBlock(const TSourceLoc&, TType&, const TString* instanceName = nullptr);
|
||||
void declareStructBufferCounter(const TSourceLoc& loc, const TType& bufferType, const TString& name);
|
||||
void fixBlockLocations(const TSourceLoc&, TQualifier&, TTypeList&, bool memberWithLocation, bool memberWithoutLocation);
|
||||
void fixXfbOffsets(TQualifier&, TTypeList&);
|
||||
@ -171,10 +171,10 @@ public:
|
||||
void unnestAnnotations() { --annotationNestingLevel; }
|
||||
int getAnnotationNestingLevel() { return annotationNestingLevel; }
|
||||
void pushScope() { symbolTable.push(); }
|
||||
void popScope() { symbolTable.pop(0); }
|
||||
void popScope() { symbolTable.pop(nullptr); }
|
||||
|
||||
void pushThisScope(const TType&, const TVector<TFunctionDeclarator>&);
|
||||
void popThisScope() { symbolTable.pop(0); }
|
||||
void popThisScope() { symbolTable.pop(nullptr); }
|
||||
|
||||
void pushImplicitThis(TVariable* thisParameter) { implicitThisStack.push_back(thisParameter); }
|
||||
void popImplicitThis() { implicitThisStack.pop_back(); }
|
||||
|
@ -564,8 +564,8 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c
|
||||
{ "GetRenderTargetSamplePosition", "V2", "F", "V1", "I", EShLangAll, false },
|
||||
{ "GroupMemoryBarrier", nullptr, nullptr, "-", "-", EShLangCS, false },
|
||||
{ "GroupMemoryBarrierWithGroupSync", nullptr, nullptr, "-", "-", EShLangCS, false },
|
||||
{ "InterlockedAdd", "-", "-", "SVM,,>", "UI,,", EShLangPSCS, false },
|
||||
{ "InterlockedAdd", "-", "-", "SVM,", "UI,", EShLangPSCS, false },
|
||||
{ "InterlockedAdd", "-", "-", "SVM,,>", "FUI,,", EShLangPSCS, false },
|
||||
{ "InterlockedAdd", "-", "-", "SVM,", "FUI,", EShLangPSCS, false },
|
||||
{ "InterlockedAnd", "-", "-", "SVM,,>", "UI,,", EShLangPSCS, false },
|
||||
{ "InterlockedAnd", "-", "-", "SVM,", "UI,", EShLangPSCS, false },
|
||||
{ "InterlockedCompareExchange", "-", "-", "SVM,,,>", "UI,,,", EShLangPSCS, false },
|
||||
|
160
3rdparty/glslang/glslang/HLSL/hlslScanContext.cpp
vendored
160
3rdparty/glslang/glslang/HLSL/hlslScanContext.cpp
vendored
@ -312,6 +312,86 @@ void HlslScanContext::fillInKeywordMap()
|
||||
(*KeywordMap)["double4x2"] = EHTokDouble4x2;
|
||||
(*KeywordMap)["double4x3"] = EHTokDouble4x3;
|
||||
(*KeywordMap)["double4x4"] = EHTokDouble4x4;
|
||||
(*KeywordMap)["min16float1x1"] = EHTokMin16float1x1;
|
||||
(*KeywordMap)["min16float1x2"] = EHTokMin16float1x2;
|
||||
(*KeywordMap)["min16float1x3"] = EHTokMin16float1x3;
|
||||
(*KeywordMap)["min16float1x4"] = EHTokMin16float1x4;
|
||||
(*KeywordMap)["min16float2x1"] = EHTokMin16float2x1;
|
||||
(*KeywordMap)["min16float2x2"] = EHTokMin16float2x2;
|
||||
(*KeywordMap)["min16float2x3"] = EHTokMin16float2x3;
|
||||
(*KeywordMap)["min16float2x4"] = EHTokMin16float2x4;
|
||||
(*KeywordMap)["min16float3x1"] = EHTokMin16float3x1;
|
||||
(*KeywordMap)["min16float3x2"] = EHTokMin16float3x2;
|
||||
(*KeywordMap)["min16float3x3"] = EHTokMin16float3x3;
|
||||
(*KeywordMap)["min16float3x4"] = EHTokMin16float3x4;
|
||||
(*KeywordMap)["min16float4x1"] = EHTokMin16float4x1;
|
||||
(*KeywordMap)["min16float4x2"] = EHTokMin16float4x2;
|
||||
(*KeywordMap)["min16float4x3"] = EHTokMin16float4x3;
|
||||
(*KeywordMap)["min16float4x4"] = EHTokMin16float4x4;
|
||||
(*KeywordMap)["min10float1x1"] = EHTokMin10float1x1;
|
||||
(*KeywordMap)["min10float1x2"] = EHTokMin10float1x2;
|
||||
(*KeywordMap)["min10float1x3"] = EHTokMin10float1x3;
|
||||
(*KeywordMap)["min10float1x4"] = EHTokMin10float1x4;
|
||||
(*KeywordMap)["min10float2x1"] = EHTokMin10float2x1;
|
||||
(*KeywordMap)["min10float2x2"] = EHTokMin10float2x2;
|
||||
(*KeywordMap)["min10float2x3"] = EHTokMin10float2x3;
|
||||
(*KeywordMap)["min10float2x4"] = EHTokMin10float2x4;
|
||||
(*KeywordMap)["min10float3x1"] = EHTokMin10float3x1;
|
||||
(*KeywordMap)["min10float3x2"] = EHTokMin10float3x2;
|
||||
(*KeywordMap)["min10float3x3"] = EHTokMin10float3x3;
|
||||
(*KeywordMap)["min10float3x4"] = EHTokMin10float3x4;
|
||||
(*KeywordMap)["min10float4x1"] = EHTokMin10float4x1;
|
||||
(*KeywordMap)["min10float4x2"] = EHTokMin10float4x2;
|
||||
(*KeywordMap)["min10float4x3"] = EHTokMin10float4x3;
|
||||
(*KeywordMap)["min10float4x4"] = EHTokMin10float4x4;
|
||||
(*KeywordMap)["min16int1x1"] = EHTokMin16int1x1;
|
||||
(*KeywordMap)["min16int1x2"] = EHTokMin16int1x2;
|
||||
(*KeywordMap)["min16int1x3"] = EHTokMin16int1x3;
|
||||
(*KeywordMap)["min16int1x4"] = EHTokMin16int1x4;
|
||||
(*KeywordMap)["min16int2x1"] = EHTokMin16int2x1;
|
||||
(*KeywordMap)["min16int2x2"] = EHTokMin16int2x2;
|
||||
(*KeywordMap)["min16int2x3"] = EHTokMin16int2x3;
|
||||
(*KeywordMap)["min16int2x4"] = EHTokMin16int2x4;
|
||||
(*KeywordMap)["min16int3x1"] = EHTokMin16int3x1;
|
||||
(*KeywordMap)["min16int3x2"] = EHTokMin16int3x2;
|
||||
(*KeywordMap)["min16int3x3"] = EHTokMin16int3x3;
|
||||
(*KeywordMap)["min16int3x4"] = EHTokMin16int3x4;
|
||||
(*KeywordMap)["min16int4x1"] = EHTokMin16int4x1;
|
||||
(*KeywordMap)["min16int4x2"] = EHTokMin16int4x2;
|
||||
(*KeywordMap)["min16int4x3"] = EHTokMin16int4x3;
|
||||
(*KeywordMap)["min16int4x4"] = EHTokMin16int4x4;
|
||||
(*KeywordMap)["min12int1x1"] = EHTokMin12int1x1;
|
||||
(*KeywordMap)["min12int1x2"] = EHTokMin12int1x2;
|
||||
(*KeywordMap)["min12int1x3"] = EHTokMin12int1x3;
|
||||
(*KeywordMap)["min12int1x4"] = EHTokMin12int1x4;
|
||||
(*KeywordMap)["min12int2x1"] = EHTokMin12int2x1;
|
||||
(*KeywordMap)["min12int2x2"] = EHTokMin12int2x2;
|
||||
(*KeywordMap)["min12int2x3"] = EHTokMin12int2x3;
|
||||
(*KeywordMap)["min12int2x4"] = EHTokMin12int2x4;
|
||||
(*KeywordMap)["min12int3x1"] = EHTokMin12int3x1;
|
||||
(*KeywordMap)["min12int3x2"] = EHTokMin12int3x2;
|
||||
(*KeywordMap)["min12int3x3"] = EHTokMin12int3x3;
|
||||
(*KeywordMap)["min12int3x4"] = EHTokMin12int3x4;
|
||||
(*KeywordMap)["min12int4x1"] = EHTokMin12int4x1;
|
||||
(*KeywordMap)["min12int4x2"] = EHTokMin12int4x2;
|
||||
(*KeywordMap)["min12int4x3"] = EHTokMin12int4x3;
|
||||
(*KeywordMap)["min12int4x4"] = EHTokMin12int4x4;
|
||||
(*KeywordMap)["min16uint1x1"] = EHTokMin16uint1x1;
|
||||
(*KeywordMap)["min16uint1x2"] = EHTokMin16uint1x2;
|
||||
(*KeywordMap)["min16uint1x3"] = EHTokMin16uint1x3;
|
||||
(*KeywordMap)["min16uint1x4"] = EHTokMin16uint1x4;
|
||||
(*KeywordMap)["min16uint2x1"] = EHTokMin16uint2x1;
|
||||
(*KeywordMap)["min16uint2x2"] = EHTokMin16uint2x2;
|
||||
(*KeywordMap)["min16uint2x3"] = EHTokMin16uint2x3;
|
||||
(*KeywordMap)["min16uint2x4"] = EHTokMin16uint2x4;
|
||||
(*KeywordMap)["min16uint3x1"] = EHTokMin16uint3x1;
|
||||
(*KeywordMap)["min16uint3x2"] = EHTokMin16uint3x2;
|
||||
(*KeywordMap)["min16uint3x3"] = EHTokMin16uint3x3;
|
||||
(*KeywordMap)["min16uint3x4"] = EHTokMin16uint3x4;
|
||||
(*KeywordMap)["min16uint4x1"] = EHTokMin16uint4x1;
|
||||
(*KeywordMap)["min16uint4x2"] = EHTokMin16uint4x2;
|
||||
(*KeywordMap)["min16uint4x3"] = EHTokMin16uint4x3;
|
||||
(*KeywordMap)["min16uint4x4"] = EHTokMin16uint4x4;
|
||||
|
||||
(*KeywordMap)["sampler"] = EHTokSampler;
|
||||
(*KeywordMap)["sampler1D"] = EHTokSampler1d;
|
||||
@ -806,6 +886,86 @@ EHlslTokenClass HlslScanContext::tokenizeIdentifier()
|
||||
case EHTokDouble4x2:
|
||||
case EHTokDouble4x3:
|
||||
case EHTokDouble4x4:
|
||||
case EHTokMin16float1x1:
|
||||
case EHTokMin16float1x2:
|
||||
case EHTokMin16float1x3:
|
||||
case EHTokMin16float1x4:
|
||||
case EHTokMin16float2x1:
|
||||
case EHTokMin16float2x2:
|
||||
case EHTokMin16float2x3:
|
||||
case EHTokMin16float2x4:
|
||||
case EHTokMin16float3x1:
|
||||
case EHTokMin16float3x2:
|
||||
case EHTokMin16float3x3:
|
||||
case EHTokMin16float3x4:
|
||||
case EHTokMin16float4x1:
|
||||
case EHTokMin16float4x2:
|
||||
case EHTokMin16float4x3:
|
||||
case EHTokMin16float4x4:
|
||||
case EHTokMin10float1x1:
|
||||
case EHTokMin10float1x2:
|
||||
case EHTokMin10float1x3:
|
||||
case EHTokMin10float1x4:
|
||||
case EHTokMin10float2x1:
|
||||
case EHTokMin10float2x2:
|
||||
case EHTokMin10float2x3:
|
||||
case EHTokMin10float2x4:
|
||||
case EHTokMin10float3x1:
|
||||
case EHTokMin10float3x2:
|
||||
case EHTokMin10float3x3:
|
||||
case EHTokMin10float3x4:
|
||||
case EHTokMin10float4x1:
|
||||
case EHTokMin10float4x2:
|
||||
case EHTokMin10float4x3:
|
||||
case EHTokMin10float4x4:
|
||||
case EHTokMin16int1x1:
|
||||
case EHTokMin16int1x2:
|
||||
case EHTokMin16int1x3:
|
||||
case EHTokMin16int1x4:
|
||||
case EHTokMin16int2x1:
|
||||
case EHTokMin16int2x2:
|
||||
case EHTokMin16int2x3:
|
||||
case EHTokMin16int2x4:
|
||||
case EHTokMin16int3x1:
|
||||
case EHTokMin16int3x2:
|
||||
case EHTokMin16int3x3:
|
||||
case EHTokMin16int3x4:
|
||||
case EHTokMin16int4x1:
|
||||
case EHTokMin16int4x2:
|
||||
case EHTokMin16int4x3:
|
||||
case EHTokMin16int4x4:
|
||||
case EHTokMin12int1x1:
|
||||
case EHTokMin12int1x2:
|
||||
case EHTokMin12int1x3:
|
||||
case EHTokMin12int1x4:
|
||||
case EHTokMin12int2x1:
|
||||
case EHTokMin12int2x2:
|
||||
case EHTokMin12int2x3:
|
||||
case EHTokMin12int2x4:
|
||||
case EHTokMin12int3x1:
|
||||
case EHTokMin12int3x2:
|
||||
case EHTokMin12int3x3:
|
||||
case EHTokMin12int3x4:
|
||||
case EHTokMin12int4x1:
|
||||
case EHTokMin12int4x2:
|
||||
case EHTokMin12int4x3:
|
||||
case EHTokMin12int4x4:
|
||||
case EHTokMin16uint1x1:
|
||||
case EHTokMin16uint1x2:
|
||||
case EHTokMin16uint1x3:
|
||||
case EHTokMin16uint1x4:
|
||||
case EHTokMin16uint2x1:
|
||||
case EHTokMin16uint2x2:
|
||||
case EHTokMin16uint2x3:
|
||||
case EHTokMin16uint2x4:
|
||||
case EHTokMin16uint3x1:
|
||||
case EHTokMin16uint3x2:
|
||||
case EHTokMin16uint3x3:
|
||||
case EHTokMin16uint3x4:
|
||||
case EHTokMin16uint4x1:
|
||||
case EHTokMin16uint4x2:
|
||||
case EHTokMin16uint4x3:
|
||||
case EHTokMin16uint4x4:
|
||||
return keyword;
|
||||
|
||||
// texturing types
|
||||
|
80
3rdparty/glslang/glslang/HLSL/hlslTokens.h
vendored
80
3rdparty/glslang/glslang/HLSL/hlslTokens.h
vendored
@ -249,6 +249,86 @@ enum EHlslTokenClass {
|
||||
EHTokDouble4x2,
|
||||
EHTokDouble4x3,
|
||||
EHTokDouble4x4,
|
||||
EHTokMin16float1x1,
|
||||
EHTokMin16float1x2,
|
||||
EHTokMin16float1x3,
|
||||
EHTokMin16float1x4,
|
||||
EHTokMin16float2x1,
|
||||
EHTokMin16float2x2,
|
||||
EHTokMin16float2x3,
|
||||
EHTokMin16float2x4,
|
||||
EHTokMin16float3x1,
|
||||
EHTokMin16float3x2,
|
||||
EHTokMin16float3x3,
|
||||
EHTokMin16float3x4,
|
||||
EHTokMin16float4x1,
|
||||
EHTokMin16float4x2,
|
||||
EHTokMin16float4x3,
|
||||
EHTokMin16float4x4,
|
||||
EHTokMin10float1x1,
|
||||
EHTokMin10float1x2,
|
||||
EHTokMin10float1x3,
|
||||
EHTokMin10float1x4,
|
||||
EHTokMin10float2x1,
|
||||
EHTokMin10float2x2,
|
||||
EHTokMin10float2x3,
|
||||
EHTokMin10float2x4,
|
||||
EHTokMin10float3x1,
|
||||
EHTokMin10float3x2,
|
||||
EHTokMin10float3x3,
|
||||
EHTokMin10float3x4,
|
||||
EHTokMin10float4x1,
|
||||
EHTokMin10float4x2,
|
||||
EHTokMin10float4x3,
|
||||
EHTokMin10float4x4,
|
||||
EHTokMin16int1x1,
|
||||
EHTokMin16int1x2,
|
||||
EHTokMin16int1x3,
|
||||
EHTokMin16int1x4,
|
||||
EHTokMin16int2x1,
|
||||
EHTokMin16int2x2,
|
||||
EHTokMin16int2x3,
|
||||
EHTokMin16int2x4,
|
||||
EHTokMin16int3x1,
|
||||
EHTokMin16int3x2,
|
||||
EHTokMin16int3x3,
|
||||
EHTokMin16int3x4,
|
||||
EHTokMin16int4x1,
|
||||
EHTokMin16int4x2,
|
||||
EHTokMin16int4x3,
|
||||
EHTokMin16int4x4,
|
||||
EHTokMin12int1x1,
|
||||
EHTokMin12int1x2,
|
||||
EHTokMin12int1x3,
|
||||
EHTokMin12int1x4,
|
||||
EHTokMin12int2x1,
|
||||
EHTokMin12int2x2,
|
||||
EHTokMin12int2x3,
|
||||
EHTokMin12int2x4,
|
||||
EHTokMin12int3x1,
|
||||
EHTokMin12int3x2,
|
||||
EHTokMin12int3x3,
|
||||
EHTokMin12int3x4,
|
||||
EHTokMin12int4x1,
|
||||
EHTokMin12int4x2,
|
||||
EHTokMin12int4x3,
|
||||
EHTokMin12int4x4,
|
||||
EHTokMin16uint1x1,
|
||||
EHTokMin16uint1x2,
|
||||
EHTokMin16uint1x3,
|
||||
EHTokMin16uint1x4,
|
||||
EHTokMin16uint2x1,
|
||||
EHTokMin16uint2x2,
|
||||
EHTokMin16uint2x3,
|
||||
EHTokMin16uint2x4,
|
||||
EHTokMin16uint3x1,
|
||||
EHTokMin16uint3x2,
|
||||
EHTokMin16uint3x3,
|
||||
EHTokMin16uint3x4,
|
||||
EHTokMin16uint4x1,
|
||||
EHTokMin16uint4x2,
|
||||
EHTokMin16uint4x3,
|
||||
EHTokMin16uint4x4,
|
||||
|
||||
// texturing types
|
||||
EHTokSampler,
|
||||
|
14
3rdparty/glslang/glslang/Include/BaseTypes.h
vendored
Normal file → Executable file
14
3rdparty/glslang/glslang/Include/BaseTypes.h
vendored
Normal file → Executable file
@ -65,6 +65,7 @@ enum TBasicType {
|
||||
EbtAccStruct,
|
||||
EbtReference,
|
||||
EbtRayQuery,
|
||||
EbtHitObjectNV,
|
||||
#ifndef GLSLANG_WEB
|
||||
// SPIR-V type defined by spirv_type
|
||||
EbtSpirvType,
|
||||
@ -104,6 +105,7 @@ enum TStorageQualifier {
|
||||
EvqHitAttr,
|
||||
EvqCallableData,
|
||||
EvqCallableDataIn,
|
||||
EvqHitObjectAttrNV,
|
||||
|
||||
EvqtaskPayloadSharedEXT,
|
||||
|
||||
@ -132,6 +134,8 @@ enum TStorageQualifier {
|
||||
EvqFragDepth,
|
||||
EvqFragStencil,
|
||||
|
||||
EvqTileImageEXT,
|
||||
|
||||
// end of list
|
||||
EvqLast
|
||||
};
|
||||
@ -316,6 +320,15 @@ enum TBuiltInVariable {
|
||||
EbvByteAddressBuffer,
|
||||
EbvRWByteAddressBuffer,
|
||||
|
||||
// ARM specific core builtins
|
||||
EbvCoreCountARM,
|
||||
EbvCoreIDARM,
|
||||
EbvCoreMaxIDARM,
|
||||
EbvWarpIDARM,
|
||||
EbvWarpMaxIDARM,
|
||||
|
||||
EbvPositionFetch,
|
||||
|
||||
EbvLast
|
||||
};
|
||||
|
||||
@ -368,6 +381,7 @@ __inline const char* GetStorageQualifierString(TStorageQualifier q)
|
||||
case EvqCallableData: return "callableDataNV"; break;
|
||||
case EvqCallableDataIn: return "callableDataInNV"; break;
|
||||
case EvqtaskPayloadSharedEXT: return "taskPayloadSharedEXT"; break;
|
||||
case EvqHitObjectAttrNV:return "hitObjectAttributeNV"; break;
|
||||
default: return "unknown qualifier";
|
||||
}
|
||||
}
|
||||
|
1
3rdparty/glslang/glslang/Include/Common.h
vendored
1
3rdparty/glslang/glslang/Include/Common.h
vendored
@ -56,6 +56,7 @@
|
||||
#include <vector>
|
||||
|
||||
#if defined(__ANDROID__) || (defined(_MSC_VER) && _MSC_VER < 1700)
|
||||
#include <sstream>
|
||||
|
||||
namespace std {
|
||||
template<typename T>
|
||||
|
8
3rdparty/glslang/glslang/Include/PoolAlloc.h
vendored
8
3rdparty/glslang/glslang/Include/PoolAlloc.h
vendored
@ -37,7 +37,7 @@
|
||||
#ifndef _POOLALLOC_INCLUDED_
|
||||
#define _POOLALLOC_INCLUDED_
|
||||
|
||||
#ifdef _DEBUG
|
||||
#ifndef NDEBUG
|
||||
# define GUARD_BLOCKS // define to enable guard block sanity checking
|
||||
#endif
|
||||
|
||||
@ -74,7 +74,7 @@ namespace glslang {
|
||||
|
||||
class TAllocation {
|
||||
public:
|
||||
TAllocation(size_t size, unsigned char* mem, TAllocation* prev = 0) :
|
||||
TAllocation(size_t size, unsigned char* mem, TAllocation* prev = nullptr) :
|
||||
size(size), mem(mem), prevAlloc(prev) {
|
||||
// Allocations are bracketed:
|
||||
// [allocationHeader][initialGuardBlock][userData][finalGuardBlock]
|
||||
@ -171,7 +171,7 @@ public:
|
||||
void popAll();
|
||||
|
||||
//
|
||||
// Call allocate() to actually acquire memory. Returns 0 if no memory
|
||||
// Call allocate() to actually acquire memory. Returns nullptr if no memory
|
||||
// available, otherwise a properly aligned pointer to 'numBytes' of memory.
|
||||
//
|
||||
void* allocate(size_t numBytes);
|
||||
@ -189,7 +189,7 @@ protected:
|
||||
struct tHeader {
|
||||
tHeader(tHeader* nextPage, size_t pageCount) :
|
||||
#ifdef GUARD_BLOCKS
|
||||
lastAllocation(0),
|
||||
lastAllocation(nullptr),
|
||||
#endif
|
||||
nextPage(nextPage), pageCount(pageCount) { }
|
||||
|
||||
|
16
3rdparty/glslang/glslang/Include/ShHandle.h
vendored
16
3rdparty/glslang/glslang/Include/ShHandle.h
vendored
@ -58,9 +58,9 @@ class TShHandleBase {
|
||||
public:
|
||||
TShHandleBase() { pool = new glslang::TPoolAllocator; }
|
||||
virtual ~TShHandleBase() { delete pool; }
|
||||
virtual TCompiler* getAsCompiler() { return 0; }
|
||||
virtual TLinker* getAsLinker() { return 0; }
|
||||
virtual TUniformMap* getAsUniformMap() { return 0; }
|
||||
virtual TCompiler* getAsCompiler() { return nullptr; }
|
||||
virtual TLinker* getAsLinker() { return nullptr; }
|
||||
virtual TUniformMap* getAsUniformMap() { return nullptr; }
|
||||
virtual glslang::TPoolAllocator* getPool() const { return pool; }
|
||||
private:
|
||||
glslang::TPoolAllocator* pool;
|
||||
@ -123,11 +123,11 @@ public:
|
||||
infoSink(iSink),
|
||||
executable(e),
|
||||
haveReturnableObjectCode(false),
|
||||
appAttributeBindings(0),
|
||||
fixedAttributeBindings(0),
|
||||
excludedAttributes(0),
|
||||
appAttributeBindings(nullptr),
|
||||
fixedAttributeBindings(nullptr),
|
||||
excludedAttributes(nullptr),
|
||||
excludedCount(0),
|
||||
uniformBindings(0) { }
|
||||
uniformBindings(nullptr) { }
|
||||
virtual TLinker* getAsLinker() { return this; }
|
||||
virtual ~TLinker() { }
|
||||
virtual bool link(TCompilerList&, TUniformMap*) = 0;
|
||||
@ -137,7 +137,7 @@ public:
|
||||
virtual void getAttributeBindings(ShBindingTable const **t) const = 0;
|
||||
virtual void setExcludedAttributes(const int* attributes, int count) { excludedAttributes = attributes; excludedCount = count; }
|
||||
virtual ShBindingTable* getUniformBindings() const { return uniformBindings; }
|
||||
virtual const void* getObjectCode() const { return 0; } // a real compiler would be returning object code here
|
||||
virtual const void* getObjectCode() const { return nullptr; } // a real compiler would be returning object code here
|
||||
virtual TInfoSink& getInfoSink() { return infoSink; }
|
||||
TInfoSink& infoSink;
|
||||
protected:
|
||||
|
110
3rdparty/glslang/glslang/Include/Types.h
vendored
110
3rdparty/glslang/glslang/Include/Types.h
vendored
@ -72,6 +72,7 @@ enum TSamplerDim {
|
||||
EsdRect,
|
||||
EsdBuffer,
|
||||
EsdSubpass, // goes only with non-sampled image (image is true)
|
||||
EsdAttachmentEXT,
|
||||
EsdNumDims
|
||||
};
|
||||
|
||||
@ -90,6 +91,7 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
|
||||
bool isBuffer() const { return false; }
|
||||
bool isRect() const { return false; }
|
||||
bool isSubpass() const { return false; }
|
||||
bool isAttachmentEXT() const { return false; }
|
||||
bool isCombined() const { return true; }
|
||||
bool isImage() const { return false; }
|
||||
bool isImageClass() const { return false; }
|
||||
@ -122,8 +124,9 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
|
||||
bool isBuffer() const { return dim == EsdBuffer; }
|
||||
bool isRect() const { return dim == EsdRect; }
|
||||
bool isSubpass() const { return dim == EsdSubpass; }
|
||||
bool isAttachmentEXT() const { return dim == EsdAttachmentEXT; }
|
||||
bool isCombined() const { return combined; }
|
||||
bool isImage() const { return image && !isSubpass(); }
|
||||
bool isImage() const { return image && !isSubpass() && !isAttachmentEXT();}
|
||||
bool isImageClass() const { return image; }
|
||||
bool isMultiSample() const { return ms; }
|
||||
bool isExternal() const { return external; }
|
||||
@ -214,6 +217,15 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
|
||||
dim = EsdSubpass;
|
||||
ms = m;
|
||||
}
|
||||
|
||||
// make an AttachmentEXT
|
||||
void setAttachmentEXT(TBasicType t)
|
||||
{
|
||||
clear();
|
||||
type = t;
|
||||
image = true;
|
||||
dim = EsdAttachmentEXT;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool operator==(const TSampler& right) const
|
||||
@ -264,7 +276,9 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
|
||||
default: break;
|
||||
}
|
||||
if (isImageClass()) {
|
||||
if (isSubpass())
|
||||
if (isAttachmentEXT())
|
||||
s.append("attachmentEXT");
|
||||
else if (isSubpass())
|
||||
s.append("subpass");
|
||||
else
|
||||
s.append("image");
|
||||
@ -285,10 +299,11 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
|
||||
case Esd3D: s.append("3D"); break;
|
||||
case EsdCube: s.append("Cube"); break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case Esd1D: s.append("1D"); break;
|
||||
case EsdRect: s.append("2DRect"); break;
|
||||
case EsdBuffer: s.append("Buffer"); break;
|
||||
case EsdSubpass: s.append("Input"); break;
|
||||
case Esd1D: s.append("1D"); break;
|
||||
case EsdRect: s.append("2DRect"); break;
|
||||
case EsdBuffer: s.append("Buffer"); break;
|
||||
case EsdSubpass: s.append("Input"); break;
|
||||
case EsdAttachmentEXT: s.append(""); break;
|
||||
#endif
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
@ -429,6 +444,12 @@ enum TLayoutFormat {
|
||||
ElfR16ui,
|
||||
ElfR8ui,
|
||||
ElfR64ui,
|
||||
ElfExtSizeGuard, // to help with comparisons
|
||||
ElfSize1x8,
|
||||
ElfSize1x16,
|
||||
ElfSize1x32,
|
||||
ElfSize2x32,
|
||||
ElfSize4x32,
|
||||
|
||||
ElfCount
|
||||
};
|
||||
@ -863,6 +884,9 @@ public:
|
||||
bool isAnyCallable() const {
|
||||
return storage == EvqCallableData || storage == EvqCallableDataIn;
|
||||
}
|
||||
bool isHitObjectAttrNV() const {
|
||||
return storage == EvqHitObjectAttrNV;
|
||||
}
|
||||
|
||||
// True if this type of IO is supposed to be arrayed with extra level for per-vertex data
|
||||
bool isArrayedIo(EShLanguage language) const
|
||||
@ -898,6 +922,9 @@ public:
|
||||
// -2048 as the default value indicating layoutSecondaryViewportRelative is not set
|
||||
layoutSecondaryViewportRelativeOffset = -2048;
|
||||
layoutShaderRecord = false;
|
||||
layoutHitObjectShaderRecordNV = false;
|
||||
layoutBindlessSampler = false;
|
||||
layoutBindlessImage = false;
|
||||
layoutBufferReferenceAlign = layoutBufferReferenceAlignEnd;
|
||||
layoutFormat = ElfNone;
|
||||
#endif
|
||||
@ -997,10 +1024,14 @@ public:
|
||||
bool layoutViewportRelative;
|
||||
int layoutSecondaryViewportRelativeOffset;
|
||||
bool layoutShaderRecord;
|
||||
bool layoutHitObjectShaderRecordNV;
|
||||
|
||||
// GL_EXT_spirv_intrinsics
|
||||
int spirvStorageClass;
|
||||
TSpirvDecorate* spirvDecorate;
|
||||
|
||||
bool layoutBindlessSampler;
|
||||
bool layoutBindlessImage;
|
||||
#endif
|
||||
|
||||
bool hasUniformLayout() const
|
||||
@ -1123,6 +1154,7 @@ public:
|
||||
TLayoutFormat getFormat() const { return layoutFormat; }
|
||||
bool isPushConstant() const { return layoutPushConstant; }
|
||||
bool isShaderRecord() const { return layoutShaderRecord; }
|
||||
bool hasHitObjectShaderRecordNV() const { return layoutHitObjectShaderRecordNV; }
|
||||
bool hasBufferReference() const { return layoutBufferReference; }
|
||||
bool hasBufferReferenceAlign() const
|
||||
{
|
||||
@ -1132,6 +1164,14 @@ public:
|
||||
{
|
||||
return nonUniform;
|
||||
}
|
||||
bool isBindlessSampler() const
|
||||
{
|
||||
return layoutBindlessSampler;
|
||||
}
|
||||
bool isBindlessImage() const
|
||||
{
|
||||
return layoutBindlessImage;
|
||||
}
|
||||
|
||||
// GL_EXT_spirv_intrinsics
|
||||
bool hasSprivDecorate() const { return spirvDecorate != nullptr; }
|
||||
@ -1241,6 +1281,11 @@ public:
|
||||
case ElfR8ui: return "r8ui";
|
||||
case ElfR64ui: return "r64ui";
|
||||
case ElfR64i: return "r64i";
|
||||
case ElfSize1x8: return "size1x8";
|
||||
case ElfSize1x16: return "size1x16";
|
||||
case ElfSize1x32: return "size1x32";
|
||||
case ElfSize2x32: return "size2x32";
|
||||
case ElfSize4x32: return "size4x32";
|
||||
default: return "none";
|
||||
}
|
||||
}
|
||||
@ -1364,6 +1409,9 @@ struct TShaderQualifiers {
|
||||
bool earlyFragmentTests; // fragment input
|
||||
bool postDepthCoverage; // fragment input
|
||||
bool earlyAndLateFragmentTestsAMD; //fragment input
|
||||
bool nonCoherentColorAttachmentReadEXT; // fragment input
|
||||
bool nonCoherentDepthAttachmentReadEXT; // fragment input
|
||||
bool nonCoherentStencilAttachmentReadEXT; // fragment input
|
||||
TLayoutDepth layoutDepth;
|
||||
TLayoutStencil layoutStencil;
|
||||
bool blendEquation; // true if any blend equation was specified
|
||||
@ -1403,6 +1451,9 @@ struct TShaderQualifiers {
|
||||
earlyFragmentTests = false;
|
||||
earlyAndLateFragmentTestsAMD = false;
|
||||
postDepthCoverage = false;
|
||||
nonCoherentColorAttachmentReadEXT = false;
|
||||
nonCoherentDepthAttachmentReadEXT = false;
|
||||
nonCoherentStencilAttachmentReadEXT = false;
|
||||
layoutDepth = EldNone;
|
||||
layoutStencil = ElsNone;
|
||||
blendEquation = false;
|
||||
@ -1460,6 +1511,12 @@ struct TShaderQualifiers {
|
||||
earlyAndLateFragmentTestsAMD = true;
|
||||
if (src.postDepthCoverage)
|
||||
postDepthCoverage = true;
|
||||
if (src.nonCoherentColorAttachmentReadEXT)
|
||||
nonCoherentColorAttachmentReadEXT = true;
|
||||
if (src.nonCoherentDepthAttachmentReadEXT)
|
||||
nonCoherentDepthAttachmentReadEXT = true;
|
||||
if (src.nonCoherentStencilAttachmentReadEXT)
|
||||
nonCoherentStencilAttachmentReadEXT = true;
|
||||
if (src.layoutDepth)
|
||||
layoutDepth = src.layoutDepth;
|
||||
if (src.layoutStencil)
|
||||
@ -1573,8 +1630,9 @@ public:
|
||||
#endif
|
||||
|
||||
// "Image" is a superset of "Subpass"
|
||||
bool isImage() const { return basicType == EbtSampler && sampler.isImage(); }
|
||||
bool isSubpass() const { return basicType == EbtSampler && sampler.isSubpass(); }
|
||||
bool isImage() const { return basicType == EbtSampler && sampler.isImage(); }
|
||||
bool isSubpass() const { return basicType == EbtSampler && sampler.isSubpass(); }
|
||||
bool isAttachmentEXT() const { return basicType == EbtSampler && sampler.isAttachmentEXT(); }
|
||||
};
|
||||
|
||||
//
|
||||
@ -1864,9 +1922,11 @@ public:
|
||||
virtual bool isArray() const { return arraySizes != nullptr; }
|
||||
virtual bool isSizedArray() const { return isArray() && arraySizes->isSized(); }
|
||||
virtual bool isUnsizedArray() const { return isArray() && !arraySizes->isSized(); }
|
||||
virtual bool isImplicitlySizedArray() const { return isArray() && arraySizes->isImplicitlySized(); }
|
||||
virtual bool isArrayVariablyIndexed() const { assert(isArray()); return arraySizes->isVariablyIndexed(); }
|
||||
virtual void setArrayVariablyIndexed() { assert(isArray()); arraySizes->setVariablyIndexed(); }
|
||||
virtual void updateImplicitArraySize(int size) { assert(isArray()); arraySizes->updateImplicitSize(size); }
|
||||
virtual void setImplicitlySized(bool isImplicitSized) { arraySizes->setImplicitlySized(isImplicitSized); }
|
||||
virtual bool isStruct() const { return basicType == EbtStruct || basicType == EbtBlock; }
|
||||
virtual bool isFloatingDomain() const { return basicType == EbtFloat || basicType == EbtDouble || basicType == EbtFloat16; }
|
||||
virtual bool isIntegerDomain() const
|
||||
@ -1889,15 +1949,18 @@ public:
|
||||
}
|
||||
virtual bool isOpaque() const { return basicType == EbtSampler
|
||||
#ifndef GLSLANG_WEB
|
||||
|| basicType == EbtAtomicUint || basicType == EbtAccStruct || basicType == EbtRayQuery
|
||||
|| basicType == EbtAtomicUint || basicType == EbtAccStruct || basicType == EbtRayQuery
|
||||
|| basicType == EbtHitObjectNV
|
||||
#endif
|
||||
; }
|
||||
virtual bool isBuiltIn() const { return getQualifier().builtIn != EbvNone; }
|
||||
|
||||
// "Image" is a superset of "Subpass"
|
||||
virtual bool isImage() const { return basicType == EbtSampler && getSampler().isImage(); }
|
||||
virtual bool isAttachmentEXT() const { return basicType == EbtSampler && getSampler().isAttachmentEXT(); }
|
||||
virtual bool isImage() const { return basicType == EbtSampler && getSampler().isImage(); }
|
||||
virtual bool isSubpass() const { return basicType == EbtSampler && getSampler().isSubpass(); }
|
||||
virtual bool isTexture() const { return basicType == EbtSampler && getSampler().isTexture(); }
|
||||
virtual bool isBindlessImage() const { return isImage() && qualifier.layoutBindlessImage; }
|
||||
virtual bool isBindlessTexture() const { return isTexture() && qualifier.layoutBindlessSampler; }
|
||||
// Check the block-name convention of creating a block without populating it's members:
|
||||
virtual bool isUnusableName() const { return isStruct() && structure == nullptr; }
|
||||
virtual bool isParameterized() const { return typeParameters != nullptr; }
|
||||
@ -1954,6 +2017,11 @@ public:
|
||||
return contains([](const TType* t) { return t->isOpaque(); } );
|
||||
}
|
||||
|
||||
virtual bool containsSampler() const
|
||||
{
|
||||
return contains([](const TType* t) { return t->isTexture() || t->isImage(); });
|
||||
}
|
||||
|
||||
// Recursively checks if the type contains a built-in variable
|
||||
virtual bool containsBuiltIn() const
|
||||
{
|
||||
@ -2087,8 +2155,12 @@ public:
|
||||
// an explicit array.
|
||||
void adoptImplicitArraySizes(bool skipNonvariablyIndexed)
|
||||
{
|
||||
if (isUnsizedArray() && !(skipNonvariablyIndexed || isArrayVariablyIndexed()))
|
||||
if (isUnsizedArray() &&
|
||||
(qualifier.builtIn == EbvSampleMask ||
|
||||
!(skipNonvariablyIndexed || isArrayVariablyIndexed()))) {
|
||||
changeOuterArraySize(getImplicitArraySize());
|
||||
setImplicitlySized(true);
|
||||
}
|
||||
// For multi-dim per-view arrays, set unsized inner dimension size to 1
|
||||
if (qualifier.isPerView() && arraySizes && arraySizes->isInnerUnsized())
|
||||
arraySizes->clearInnerUnsized();
|
||||
@ -2283,8 +2355,16 @@ public:
|
||||
appendStr(" layoutSecondaryViewportRelativeOffset=");
|
||||
appendInt(qualifier.layoutSecondaryViewportRelativeOffset);
|
||||
}
|
||||
|
||||
if (qualifier.layoutShaderRecord)
|
||||
appendStr(" shaderRecordNV");
|
||||
if (qualifier.layoutHitObjectShaderRecordNV)
|
||||
appendStr(" hitobjectshaderrecordnv");
|
||||
|
||||
if (qualifier.layoutBindlessSampler)
|
||||
appendStr(" layoutBindlessSampler");
|
||||
if (qualifier.layoutBindlessImage)
|
||||
appendStr(" layoutBindlessImage");
|
||||
|
||||
appendStr(")");
|
||||
}
|
||||
@ -2544,6 +2624,7 @@ public:
|
||||
void setStruct(TTypeList* s) { assert(isStruct()); structure = s; }
|
||||
TTypeList* getWritableStruct() const { assert(isStruct()); return structure; } // This should only be used when known to not be sharing with other threads
|
||||
void setBasicType(const TBasicType& t) { basicType = t; }
|
||||
void setVectorSize(int s) { vectorSize = s; }
|
||||
|
||||
int computeNumComponents() const
|
||||
{
|
||||
@ -2711,7 +2792,10 @@ public:
|
||||
bool sameArrayness(const TType& right) const
|
||||
{
|
||||
return ((arraySizes == nullptr && right.arraySizes == nullptr) ||
|
||||
(arraySizes != nullptr && right.arraySizes != nullptr && *arraySizes == *right.arraySizes));
|
||||
(arraySizes != nullptr && right.arraySizes != nullptr &&
|
||||
(*arraySizes == *right.arraySizes ||
|
||||
(arraySizes->isImplicitlySized() && right.arraySizes->isDefaultImplicitlySized()) ||
|
||||
(right.arraySizes->isImplicitlySized() && arraySizes->isDefaultImplicitlySized()))));
|
||||
}
|
||||
|
||||
// See if two type's arrayness match in everything except their outer dimension
|
||||
|
19
3rdparty/glslang/glslang/Include/arrays.h
vendored
19
3rdparty/glslang/glslang/Include/arrays.h
vendored
@ -222,7 +222,7 @@ protected:
|
||||
struct TArraySizes {
|
||||
POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())
|
||||
|
||||
TArraySizes() : implicitArraySize(1), variablyIndexed(false) { }
|
||||
TArraySizes() : implicitArraySize(0), implicitlySized(true), variablyIndexed(false){ }
|
||||
|
||||
// For breaking into two non-shared copies, independently modifiable.
|
||||
TArraySizes& operator=(const TArraySizes& from)
|
||||
@ -230,6 +230,7 @@ struct TArraySizes {
|
||||
implicitArraySize = from.implicitArraySize;
|
||||
variablyIndexed = from.variablyIndexed;
|
||||
sizes = from.sizes;
|
||||
implicitlySized = from.implicitlySized;
|
||||
|
||||
return *this;
|
||||
}
|
||||
@ -256,11 +257,17 @@ struct TArraySizes {
|
||||
void addInnerSize(int s, TIntermTyped* n) { sizes.push_back((unsigned)s, n); }
|
||||
void addInnerSize(TArraySize pair) {
|
||||
sizes.push_back(pair.size, pair.node);
|
||||
implicitlySized = false;
|
||||
}
|
||||
void addInnerSizes(const TArraySizes& s) { sizes.push_back(s.sizes); }
|
||||
void changeOuterSize(int s) { sizes.changeFront((unsigned)s); }
|
||||
int getImplicitSize() const { return implicitArraySize; }
|
||||
void updateImplicitSize(int s) { implicitArraySize = std::max(implicitArraySize, s); }
|
||||
void changeOuterSize(int s) {
|
||||
sizes.changeFront((unsigned)s);
|
||||
implicitlySized = false;
|
||||
}
|
||||
int getImplicitSize() const { return implicitArraySize > 0 ? implicitArraySize : 1; }
|
||||
void updateImplicitSize(int s) {
|
||||
implicitArraySize = (std::max)(implicitArraySize, s);
|
||||
}
|
||||
bool isInnerUnsized() const
|
||||
{
|
||||
for (int d = 1; d < sizes.size(); ++d) {
|
||||
@ -295,6 +302,9 @@ struct TArraySizes {
|
||||
|
||||
bool hasUnsized() const { return getOuterSize() == UnsizedArraySize || isInnerUnsized(); }
|
||||
bool isSized() const { return getOuterSize() != UnsizedArraySize; }
|
||||
bool isImplicitlySized() const { return implicitlySized; }
|
||||
bool isDefaultImplicitlySized() const { return implicitlySized && implicitArraySize == 0; }
|
||||
void setImplicitlySized(bool isImplicitSizing) { implicitlySized = isImplicitSizing; }
|
||||
void dereference() { sizes.pop_front(); }
|
||||
void copyDereferenced(const TArraySizes& rhs)
|
||||
{
|
||||
@ -333,6 +343,7 @@ protected:
|
||||
// the implicit size of the array, if not variably indexed and
|
||||
// otherwise legal.
|
||||
int implicitArraySize;
|
||||
bool implicitlySized;
|
||||
bool variablyIndexed; // true if array is indexed with a non compile-time constant
|
||||
};
|
||||
|
||||
|
@ -157,28 +157,17 @@ typedef struct glslang_resource_s {
|
||||
int max_task_work_group_size_y_ext;
|
||||
int max_task_work_group_size_z_ext;
|
||||
int max_mesh_view_count_ext;
|
||||
int maxDualSourceDrawBuffersEXT;
|
||||
union
|
||||
{
|
||||
int max_dual_source_draw_buffers_ext;
|
||||
|
||||
/* Incorrectly capitalized name retained for backward compatibility */
|
||||
int maxDualSourceDrawBuffersEXT;
|
||||
};
|
||||
|
||||
glslang_limits_t limits;
|
||||
} glslang_resource_t;
|
||||
|
||||
typedef struct glslang_input_s {
|
||||
glslang_source_t language;
|
||||
glslang_stage_t stage;
|
||||
glslang_client_t client;
|
||||
glslang_target_client_version_t client_version;
|
||||
glslang_target_language_t target_language;
|
||||
glslang_target_language_version_t target_language_version;
|
||||
/** Shader source code */
|
||||
const char* code;
|
||||
int default_version;
|
||||
glslang_profile_t default_profile;
|
||||
int force_default_version_and_profile;
|
||||
int forward_compatible;
|
||||
glslang_messages_t messages;
|
||||
const glslang_resource_t* resource;
|
||||
} glslang_input_t;
|
||||
|
||||
/* Inclusion result structure allocated by C include_local/include_system callbacks */
|
||||
typedef struct glsl_include_result_s {
|
||||
/* Header file name or NULL if inclusion failed */
|
||||
@ -208,6 +197,25 @@ typedef struct glsl_include_callbacks_s {
|
||||
glsl_free_include_result_func free_include_result;
|
||||
} glsl_include_callbacks_t;
|
||||
|
||||
typedef struct glslang_input_s {
|
||||
glslang_source_t language;
|
||||
glslang_stage_t stage;
|
||||
glslang_client_t client;
|
||||
glslang_target_client_version_t client_version;
|
||||
glslang_target_language_t target_language;
|
||||
glslang_target_language_version_t target_language_version;
|
||||
/** Shader source code */
|
||||
const char* code;
|
||||
int default_version;
|
||||
glslang_profile_t default_profile;
|
||||
int force_default_version_and_profile;
|
||||
int forward_compatible;
|
||||
glslang_messages_t messages;
|
||||
const glslang_resource_t* resource;
|
||||
glsl_include_callbacks_t callbacks;
|
||||
void* callbacks_ctx;
|
||||
} glslang_input_t;
|
||||
|
||||
/* SpvOptions counterpart */
|
||||
typedef struct glslang_spv_options_s {
|
||||
bool generate_debug_info;
|
||||
|
102
3rdparty/glslang/glslang/Include/intermediate.h
vendored
102
3rdparty/glslang/glslang/Include/intermediate.h
vendored
@ -827,6 +827,7 @@ enum TOperator {
|
||||
EOpSubpassLoadMS,
|
||||
EOpSparseImageLoad,
|
||||
EOpSparseImageLoadLod,
|
||||
EOpColorAttachmentReadEXT, // Fragment only
|
||||
|
||||
EOpImageGuardEnd,
|
||||
|
||||
@ -968,7 +969,42 @@ enum TOperator {
|
||||
EOpRayQueryGetIntersectionObjectToWorld,
|
||||
EOpRayQueryGetIntersectionWorldToObject,
|
||||
|
||||
//
|
||||
// GL_NV_shader_invocation_reorder
|
||||
//
|
||||
|
||||
EOpHitObjectTraceRayNV,
|
||||
EOpHitObjectTraceRayMotionNV,
|
||||
EOpHitObjectRecordHitNV,
|
||||
EOpHitObjectRecordHitMotionNV,
|
||||
EOpHitObjectRecordHitWithIndexNV,
|
||||
EOpHitObjectRecordHitWithIndexMotionNV,
|
||||
EOpHitObjectRecordMissNV,
|
||||
EOpHitObjectRecordMissMotionNV,
|
||||
EOpHitObjectRecordEmptyNV,
|
||||
EOpHitObjectExecuteShaderNV,
|
||||
EOpHitObjectIsEmptyNV,
|
||||
EOpHitObjectIsMissNV,
|
||||
EOpHitObjectIsHitNV,
|
||||
EOpHitObjectGetRayTMinNV,
|
||||
EOpHitObjectGetRayTMaxNV,
|
||||
EOpHitObjectGetObjectRayOriginNV,
|
||||
EOpHitObjectGetObjectRayDirectionNV,
|
||||
EOpHitObjectGetWorldRayOriginNV,
|
||||
EOpHitObjectGetWorldRayDirectionNV,
|
||||
EOpHitObjectGetWorldToObjectNV,
|
||||
EOpHitObjectGetObjectToWorldNV,
|
||||
EOpHitObjectGetInstanceCustomIndexNV,
|
||||
EOpHitObjectGetInstanceIdNV,
|
||||
EOpHitObjectGetGeometryIndexNV,
|
||||
EOpHitObjectGetPrimitiveIndexNV,
|
||||
EOpHitObjectGetHitKindNV,
|
||||
EOpHitObjectGetShaderBindingTableRecordIndexNV,
|
||||
EOpHitObjectGetShaderRecordBufferHandleNV,
|
||||
EOpHitObjectGetAttributesNV,
|
||||
EOpHitObjectGetCurrentTimeNV,
|
||||
EOpReorderThreadNV,
|
||||
|
||||
// HLSL operations
|
||||
//
|
||||
|
||||
@ -1055,6 +1091,13 @@ enum TOperator {
|
||||
// Shader Clock Ops
|
||||
EOpReadClockSubgroupKHR,
|
||||
EOpReadClockDeviceKHR,
|
||||
|
||||
// GL_EXT_ray_tracing_position_fetch
|
||||
EOpRayQueryGetIntersectionTriangleVertexPositionsEXT,
|
||||
|
||||
// Shader tile image ops
|
||||
EOpStencilAttachmentReadEXT, // Fragment only
|
||||
EOpDepthAttachmentReadEXT, // Fragment only
|
||||
};
|
||||
|
||||
class TIntermTraverser;
|
||||
@ -1086,31 +1129,31 @@ public:
|
||||
virtual const glslang::TSourceLoc& getLoc() const { return loc; }
|
||||
virtual void setLoc(const glslang::TSourceLoc& l) { loc = l; }
|
||||
virtual void traverse(glslang::TIntermTraverser*) = 0;
|
||||
virtual glslang::TIntermTyped* getAsTyped() { return 0; }
|
||||
virtual glslang::TIntermOperator* getAsOperator() { return 0; }
|
||||
virtual glslang::TIntermConstantUnion* getAsConstantUnion() { return 0; }
|
||||
virtual glslang::TIntermAggregate* getAsAggregate() { return 0; }
|
||||
virtual glslang::TIntermUnary* getAsUnaryNode() { return 0; }
|
||||
virtual glslang::TIntermBinary* getAsBinaryNode() { return 0; }
|
||||
virtual glslang::TIntermSelection* getAsSelectionNode() { return 0; }
|
||||
virtual glslang::TIntermSwitch* getAsSwitchNode() { return 0; }
|
||||
virtual glslang::TIntermMethod* getAsMethodNode() { return 0; }
|
||||
virtual glslang::TIntermSymbol* getAsSymbolNode() { return 0; }
|
||||
virtual glslang::TIntermBranch* getAsBranchNode() { return 0; }
|
||||
virtual glslang::TIntermLoop* getAsLoopNode() { return 0; }
|
||||
virtual glslang::TIntermTyped* getAsTyped() { return nullptr; }
|
||||
virtual glslang::TIntermOperator* getAsOperator() { return nullptr; }
|
||||
virtual glslang::TIntermConstantUnion* getAsConstantUnion() { return nullptr; }
|
||||
virtual glslang::TIntermAggregate* getAsAggregate() { return nullptr; }
|
||||
virtual glslang::TIntermUnary* getAsUnaryNode() { return nullptr; }
|
||||
virtual glslang::TIntermBinary* getAsBinaryNode() { return nullptr; }
|
||||
virtual glslang::TIntermSelection* getAsSelectionNode() { return nullptr; }
|
||||
virtual glslang::TIntermSwitch* getAsSwitchNode() { return nullptr; }
|
||||
virtual glslang::TIntermMethod* getAsMethodNode() { return nullptr; }
|
||||
virtual glslang::TIntermSymbol* getAsSymbolNode() { return nullptr; }
|
||||
virtual glslang::TIntermBranch* getAsBranchNode() { return nullptr; }
|
||||
virtual glslang::TIntermLoop* getAsLoopNode() { return nullptr; }
|
||||
|
||||
virtual const glslang::TIntermTyped* getAsTyped() const { return 0; }
|
||||
virtual const glslang::TIntermOperator* getAsOperator() const { return 0; }
|
||||
virtual const glslang::TIntermConstantUnion* getAsConstantUnion() const { return 0; }
|
||||
virtual const glslang::TIntermAggregate* getAsAggregate() const { return 0; }
|
||||
virtual const glslang::TIntermUnary* getAsUnaryNode() const { return 0; }
|
||||
virtual const glslang::TIntermBinary* getAsBinaryNode() const { return 0; }
|
||||
virtual const glslang::TIntermSelection* getAsSelectionNode() const { return 0; }
|
||||
virtual const glslang::TIntermSwitch* getAsSwitchNode() const { return 0; }
|
||||
virtual const glslang::TIntermMethod* getAsMethodNode() const { return 0; }
|
||||
virtual const glslang::TIntermSymbol* getAsSymbolNode() const { return 0; }
|
||||
virtual const glslang::TIntermBranch* getAsBranchNode() const { return 0; }
|
||||
virtual const glslang::TIntermLoop* getAsLoopNode() const { return 0; }
|
||||
virtual const glslang::TIntermTyped* getAsTyped() const { return nullptr; }
|
||||
virtual const glslang::TIntermOperator* getAsOperator() const { return nullptr; }
|
||||
virtual const glslang::TIntermConstantUnion* getAsConstantUnion() const { return nullptr; }
|
||||
virtual const glslang::TIntermAggregate* getAsAggregate() const { return nullptr; }
|
||||
virtual const glslang::TIntermUnary* getAsUnaryNode() const { return nullptr; }
|
||||
virtual const glslang::TIntermBinary* getAsBinaryNode() const { return nullptr; }
|
||||
virtual const glslang::TIntermSelection* getAsSelectionNode() const { return nullptr; }
|
||||
virtual const glslang::TIntermSwitch* getAsSwitchNode() const { return nullptr; }
|
||||
virtual const glslang::TIntermMethod* getAsMethodNode() const { return nullptr; }
|
||||
virtual const glslang::TIntermSymbol* getAsSymbolNode() const { return nullptr; }
|
||||
virtual const glslang::TIntermBranch* getAsBranchNode() const { return nullptr; }
|
||||
virtual const glslang::TIntermLoop* getAsLoopNode() const { return nullptr; }
|
||||
virtual ~TIntermNode() { }
|
||||
|
||||
protected:
|
||||
@ -1358,6 +1401,7 @@ struct TCrackedTextureOp {
|
||||
bool subpass;
|
||||
bool lodClamp;
|
||||
bool fragMask;
|
||||
bool attachmentEXT;
|
||||
};
|
||||
|
||||
//
|
||||
@ -1414,6 +1458,7 @@ public:
|
||||
cracked.gather = false;
|
||||
cracked.grad = false;
|
||||
cracked.subpass = false;
|
||||
cracked.attachmentEXT = false;
|
||||
cracked.lodClamp = false;
|
||||
cracked.fragMask = false;
|
||||
|
||||
@ -1574,6 +1619,9 @@ public:
|
||||
case EOpSubpassLoadMS:
|
||||
cracked.subpass = true;
|
||||
break;
|
||||
case EOpColorAttachmentReadEXT:
|
||||
cracked.attachmentEXT = true;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
@ -1616,8 +1664,8 @@ protected:
|
||||
//
|
||||
class TIntermUnary : public TIntermOperator {
|
||||
public:
|
||||
TIntermUnary(TOperator o, TType& t) : TIntermOperator(o, t), operand(0) {}
|
||||
TIntermUnary(TOperator o) : TIntermOperator(o), operand(0) {}
|
||||
TIntermUnary(TOperator o, TType& t) : TIntermOperator(o, t), operand(nullptr) {}
|
||||
TIntermUnary(TOperator o) : TIntermOperator(o), operand(nullptr) {}
|
||||
virtual void traverse(TIntermTraverser*);
|
||||
virtual void setOperand(TIntermTyped* o) { operand = o; }
|
||||
virtual TIntermTyped* getOperand() { return operand; }
|
||||
@ -1819,7 +1867,7 @@ public:
|
||||
|
||||
TIntermNode *getParentNode()
|
||||
{
|
||||
return path.size() == 0 ? NULL : path.back();
|
||||
return path.size() == 0 ? nullptr : path.back();
|
||||
}
|
||||
|
||||
const bool preVisit;
|
||||
|
@ -212,9 +212,9 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
|
||||
|
||||
case EbtInt64:
|
||||
if (rightUnionArray[i] == 0ll)
|
||||
newConstArray[i].setI64Const(0x7FFFFFFFFFFFFFFFll);
|
||||
else if (rightUnionArray[i].getI64Const() == -1 && leftUnionArray[i].getI64Const() == (long long)-0x8000000000000000ll)
|
||||
newConstArray[i].setI64Const((long long)-0x8000000000000000ll);
|
||||
newConstArray[i].setI64Const(LLONG_MAX);
|
||||
else if (rightUnionArray[i].getI64Const() == -1 && leftUnionArray[i].getI64Const() == LLONG_MIN)
|
||||
newConstArray[i].setI64Const(LLONG_MIN);
|
||||
else
|
||||
newConstArray[i].setI64Const(leftUnionArray[i].getI64Const() / rightUnionArray[i].getI64Const());
|
||||
break;
|
||||
@ -226,7 +226,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
|
||||
newConstArray[i].setU64Const(leftUnionArray[i].getU64Const() / rightUnionArray[i].getU64Const());
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
return nullptr;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -354,7 +354,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
|
||||
break;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TIntermConstantUnion *newNode = new TIntermConstantUnion(newConstArray, returnType);
|
||||
@ -1345,7 +1345,7 @@ TIntermTyped* TIntermediate::foldDereference(TIntermTyped* node, int index, cons
|
||||
{
|
||||
TType dereferencedType(node->getType(), index);
|
||||
dereferencedType.getQualifier().storage = EvqConst;
|
||||
TIntermTyped* result = 0;
|
||||
TIntermTyped* result = nullptr;
|
||||
int size = dereferencedType.computeNumComponents();
|
||||
|
||||
// arrays, vectors, matrices, all use simple multiplicative math
|
||||
@ -1365,7 +1365,7 @@ TIntermTyped* TIntermediate::foldDereference(TIntermTyped* node, int index, cons
|
||||
|
||||
result = addConstantUnion(TConstUnionArray(node->getAsConstantUnion()->getConstArray(), start, size), node->getType(), loc);
|
||||
|
||||
if (result == 0)
|
||||
if (result == nullptr)
|
||||
result = node;
|
||||
else
|
||||
result->setType(dereferencedType);
|
||||
@ -1387,7 +1387,7 @@ TIntermTyped* TIntermediate::foldSwizzle(TIntermTyped* node, TSwizzleSelectors<T
|
||||
|
||||
TIntermTyped* result = addConstantUnion(constArray, node->getType(), loc);
|
||||
|
||||
if (result == 0)
|
||||
if (result == nullptr)
|
||||
result = node;
|
||||
else
|
||||
result->setType(TType(node->getBasicType(), EvqConst, selectors.size()));
|
||||
|
294
3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp
vendored
Normal file → Executable file
294
3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp
vendored
Normal file → Executable file
@ -524,6 +524,7 @@ TBuiltIns::TBuiltIns()
|
||||
dimMap[EsdRect] = 2;
|
||||
dimMap[EsdBuffer] = 1;
|
||||
dimMap[EsdSubpass] = 2; // potentially unused for now
|
||||
dimMap[EsdAttachmentEXT] = 2; // potentially unused for now
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -4440,6 +4441,24 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"\n");
|
||||
}
|
||||
|
||||
// GL_EXT_shader_tile_image
|
||||
if (spvVersion.vulkan > 0) {
|
||||
stageBuiltins[EShLangFragment].append(
|
||||
"lowp uint stencilAttachmentReadEXT();"
|
||||
"lowp uint stencilAttachmentReadEXT(int);"
|
||||
"highp float depthAttachmentReadEXT();"
|
||||
"highp float depthAttachmentReadEXT(int);"
|
||||
"\n");
|
||||
stageBuiltins[EShLangFragment].append(
|
||||
"vec4 colorAttachmentReadEXT(attachmentEXT);"
|
||||
"vec4 colorAttachmentReadEXT(attachmentEXT, int);"
|
||||
"ivec4 colorAttachmentReadEXT(iattachmentEXT);"
|
||||
"ivec4 colorAttachmentReadEXT(iattachmentEXT, int);"
|
||||
"uvec4 colorAttachmentReadEXT(uattachmentEXT);"
|
||||
"uvec4 colorAttachmentReadEXT(uattachmentEXT, int);"
|
||||
"\n");
|
||||
}
|
||||
|
||||
// GL_ARB_derivative_control
|
||||
if (profile != EEsProfile && version >= 400) {
|
||||
stageBuiltins[EShLangFragment].append(derivativeControls);
|
||||
@ -4550,7 +4569,8 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"\n");
|
||||
}
|
||||
|
||||
// Builtins for GL_NV_ray_tracing/GL_NV_ray_tracing_motion_blur/GL_EXT_ray_tracing/GL_EXT_ray_query
|
||||
// Builtins for GL_NV_ray_tracing/GL_NV_ray_tracing_motion_blur/GL_EXT_ray_tracing/GL_EXT_ray_query/
|
||||
// GL_NV_shader_invocation_reorder/GL_KHR_ray_tracing_position_Fetch
|
||||
if (profile != EEsProfile && version >= 460) {
|
||||
commonBuiltins.append("void rayQueryInitializeEXT(rayQueryEXT, accelerationStructureEXT, uint, uint, vec3, float, vec3, float);"
|
||||
"void rayQueryTerminateEXT(rayQueryEXT);"
|
||||
@ -4575,6 +4595,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"vec3 rayQueryGetIntersectionObjectRayOriginEXT(rayQueryEXT, bool);"
|
||||
"mat4x3 rayQueryGetIntersectionObjectToWorldEXT(rayQueryEXT, bool);"
|
||||
"mat4x3 rayQueryGetIntersectionWorldToObjectEXT(rayQueryEXT, bool);"
|
||||
"void rayQueryGetIntersectionTriangleVertexPositionsEXT(rayQueryEXT, bool, out vec3[3]);"
|
||||
"\n");
|
||||
|
||||
stageBuiltins[EShLangRayGen].append(
|
||||
@ -4583,6 +4604,39 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void executeCallableNV(uint, int);"
|
||||
"void executeCallableEXT(uint, int);"
|
||||
"void hitObjectTraceRayNV(hitObjectNV,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void hitObjectTraceRayMotionNV(hitObjectNV,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);"
|
||||
"void hitObjectRecordHitNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void hitObjectRecordHitMotionNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,uint,vec3,float,vec3,float,float,int);"
|
||||
"void hitObjectRecordHitWithIndexNV(hitObjectNV, accelerationStructureEXT,int,int,int,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void hitObjectRecordHitWithIndexMotionNV(hitObjectNV, accelerationStructureEXT,int,int,int,uint,uint,vec3,float,vec3,float,float,int);"
|
||||
"void hitObjectRecordMissNV(hitObjectNV,uint,vec3,float,vec3,float);"
|
||||
"void hitObjectRecordMissMotionNV(hitObjectNV,uint,vec3,float,vec3,float,float);"
|
||||
"void hitObjectRecordEmptyNV(hitObjectNV);"
|
||||
"void hitObjectExecuteShaderNV(hitObjectNV,int);"
|
||||
"bool hitObjectIsEmptyNV(hitObjectNV);"
|
||||
"bool hitObjectIsMissNV(hitObjectNV);"
|
||||
"bool hitObjectIsHitNV(hitObjectNV);"
|
||||
"float hitObjectGetRayTMinNV(hitObjectNV);"
|
||||
"float hitObjectGetRayTMaxNV(hitObjectNV);"
|
||||
"vec3 hitObjectGetWorldRayOriginNV(hitObjectNV);"
|
||||
"vec3 hitObjectGetWorldRayDirectionNV(hitObjectNV);"
|
||||
"vec3 hitObjectGetObjectRayOriginNV(hitObjectNV);"
|
||||
"vec3 hitObjectGetObjectRayDirectionNV(hitObjectNV);"
|
||||
"mat4x3 hitObjectGetWorldToObjectNV(hitObjectNV);"
|
||||
"mat4x3 hitObjectGetObjectToWorldNV(hitObjectNV);"
|
||||
"int hitObjectGetInstanceCustomIndexNV(hitObjectNV);"
|
||||
"int hitObjectGetInstanceIdNV(hitObjectNV);"
|
||||
"int hitObjectGetGeometryIndexNV(hitObjectNV);"
|
||||
"int hitObjectGetPrimitiveIndexNV(hitObjectNV);"
|
||||
"uint hitObjectGetHitKindNV(hitObjectNV);"
|
||||
"void hitObjectGetAttributesNV(hitObjectNV,int);"
|
||||
"float hitObjectGetCurrentTimeNV(hitObjectNV);"
|
||||
"uint hitObjectGetShaderBindingTableRecordIndexNV(hitObjectNV);"
|
||||
"uvec2 hitObjectGetShaderRecordBufferHandleNV(hitObjectNV);"
|
||||
"void reorderThreadNV(uint, uint);"
|
||||
"void reorderThreadNV(hitObjectNV);"
|
||||
"void reorderThreadNV(hitObjectNV, uint, uint);"
|
||||
"\n");
|
||||
stageBuiltins[EShLangIntersect].append(
|
||||
"bool reportIntersectionNV(float, uint);"
|
||||
@ -4598,6 +4652,36 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void executeCallableNV(uint, int);"
|
||||
"void executeCallableEXT(uint, int);"
|
||||
"void hitObjectTraceRayNV(hitObjectNV,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void hitObjectTraceRayMotionNV(hitObjectNV,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);"
|
||||
"void hitObjectRecordHitNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void hitObjectRecordHitMotionNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,uint,vec3,float,vec3,float,float,int);"
|
||||
"void hitObjectRecordHitWithIndexNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void hitObjectRecordHitWithIndexMotionNV(hitObjectNV, accelerationStructureEXT,int,int,int,uint,uint,vec3,float,vec3,float,float,int);"
|
||||
"void hitObjectRecordMissNV(hitObjectNV, uint, vec3, float, vec3, float);"
|
||||
"void hitObjectRecordMissMotionNV(hitObjectNV,uint,vec3,float,vec3,float,float);"
|
||||
"void hitObjectRecordEmptyNV(hitObjectNV);"
|
||||
"void hitObjectExecuteShaderNV(hitObjectNV, int);"
|
||||
"bool hitObjectIsEmptyNV(hitObjectNV);"
|
||||
"bool hitObjectIsMissNV(hitObjectNV);"
|
||||
"bool hitObjectIsHitNV(hitObjectNV);"
|
||||
"float hitObjectGetRayTMinNV(hitObjectNV);"
|
||||
"float hitObjectGetRayTMaxNV(hitObjectNV);"
|
||||
"vec3 hitObjectGetWorldRayOriginNV(hitObjectNV);"
|
||||
"vec3 hitObjectGetWorldRayDirectionNV(hitObjectNV);"
|
||||
"vec3 hitObjectGetObjectRayOriginNV(hitObjectNV);"
|
||||
"vec3 hitObjectGetObjectRayDirectionNV(hitObjectNV);"
|
||||
"mat4x3 hitObjectGetWorldToObjectNV(hitObjectNV);"
|
||||
"mat4x3 hitObjectGetObjectToWorldNV(hitObjectNV);"
|
||||
"int hitObjectGetInstanceCustomIndexNV(hitObjectNV);"
|
||||
"int hitObjectGetInstanceIdNV(hitObjectNV);"
|
||||
"int hitObjectGetGeometryIndexNV(hitObjectNV);"
|
||||
"int hitObjectGetPrimitiveIndexNV(hitObjectNV);"
|
||||
"uint hitObjectGetHitKindNV(hitObjectNV);"
|
||||
"void hitObjectGetAttributesNV(hitObjectNV,int);"
|
||||
"float hitObjectGetCurrentTimeNV(hitObjectNV);"
|
||||
"uint hitObjectGetShaderBindingTableRecordIndexNV(hitObjectNV);"
|
||||
"uvec2 hitObjectGetShaderRecordBufferHandleNV(hitObjectNV);"
|
||||
"\n");
|
||||
stageBuiltins[EShLangMiss].append(
|
||||
"void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
@ -4605,6 +4689,36 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void executeCallableNV(uint, int);"
|
||||
"void executeCallableEXT(uint, int);"
|
||||
"void hitObjectTraceRayNV(hitObjectNV,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void hitObjectTraceRayMotionNV(hitObjectNV,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);"
|
||||
"void hitObjectRecordHitNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void hitObjectRecordHitMotionNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,uint,vec3,float,vec3,float,float,int);"
|
||||
"void hitObjectRecordHitWithIndexNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void hitObjectRecordHitWithIndexMotionNV(hitObjectNV, accelerationStructureEXT,int,int,int,uint,uint,vec3,float,vec3,float,float,int);"
|
||||
"void hitObjectRecordMissNV(hitObjectNV, uint, vec3, float, vec3, float);"
|
||||
"void hitObjectRecordMissMotionNV(hitObjectNV,uint,vec3,float,vec3,float,float);"
|
||||
"void hitObjectRecordEmptyNV(hitObjectNV);"
|
||||
"void hitObjectExecuteShaderNV(hitObjectNV, int);"
|
||||
"bool hitObjectIsEmptyNV(hitObjectNV);"
|
||||
"bool hitObjectIsMissNV(hitObjectNV);"
|
||||
"bool hitObjectIsHitNV(hitObjectNV);"
|
||||
"float hitObjectGetRayTMinNV(hitObjectNV);"
|
||||
"float hitObjectGetRayTMaxNV(hitObjectNV);"
|
||||
"vec3 hitObjectGetWorldRayOriginNV(hitObjectNV);"
|
||||
"vec3 hitObjectGetWorldRayDirectionNV(hitObjectNV);"
|
||||
"vec3 hitObjectGetObjectRayOriginNV(hitObjectNV);"
|
||||
"vec3 hitObjectGetObjectRayDirectionNV(hitObjectNV);"
|
||||
"mat4x3 hitObjectGetWorldToObjectNV(hitObjectNV);"
|
||||
"mat4x3 hitObjectGetObjectToWorldNV(hitObjectNV);"
|
||||
"int hitObjectGetInstanceCustomIndexNV(hitObjectNV);"
|
||||
"int hitObjectGetInstanceIdNV(hitObjectNV);"
|
||||
"int hitObjectGetGeometryIndexNV(hitObjectNV);"
|
||||
"int hitObjectGetPrimitiveIndexNV(hitObjectNV);"
|
||||
"uint hitObjectGetHitKindNV(hitObjectNV);"
|
||||
"void hitObjectGetAttributesNV(hitObjectNV,int);"
|
||||
"float hitObjectGetCurrentTimeNV(hitObjectNV);"
|
||||
"uint hitObjectGetShaderBindingTableRecordIndexNV(hitObjectNV);"
|
||||
"uvec2 hitObjectGetShaderRecordBufferHandleNV(hitObjectNV);"
|
||||
"\n");
|
||||
stageBuiltins[EShLangCallable].append(
|
||||
"void executeCallableNV(uint, int);"
|
||||
@ -5737,6 +5851,12 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"in highp uint gl_SMCountNV;"
|
||||
"in highp uint gl_WarpIDNV;"
|
||||
"in highp uint gl_SMIDNV;"
|
||||
// GL_ARM_shader_core_builtins
|
||||
"in highp uint gl_CoreIDARM;"
|
||||
"in highp uint gl_CoreCountARM;"
|
||||
"in highp uint gl_CoreMaxIDARM;"
|
||||
"in highp uint gl_WarpIDARM;"
|
||||
"in highp uint gl_WarpMaxIDARM;"
|
||||
"\n";
|
||||
const char* fragmentSubgroupDecls =
|
||||
"flat in mediump uint gl_SubgroupSize;"
|
||||
@ -5751,6 +5871,12 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"flat in highp uint gl_SMCountNV;"
|
||||
"flat in highp uint gl_WarpIDNV;"
|
||||
"flat in highp uint gl_SMIDNV;"
|
||||
// GL_ARM_shader_core_builtins
|
||||
"flat in highp uint gl_CoreIDARM;"
|
||||
"flat in highp uint gl_CoreCountARM;"
|
||||
"flat in highp uint gl_CoreMaxIDARM;"
|
||||
"flat in highp uint gl_WarpIDARM;"
|
||||
"flat in highp uint gl_WarpMaxIDARM;"
|
||||
"\n";
|
||||
const char* computeSubgroupDecls =
|
||||
"in highp uint gl_NumSubgroups;"
|
||||
@ -5770,6 +5896,12 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"in highp uint gl_SMCountNV;"
|
||||
"in highp volatile uint gl_WarpIDNV;"
|
||||
"in highp volatile uint gl_SMIDNV;"
|
||||
// GL_ARM_shader_core_builtins
|
||||
"in highp uint gl_CoreIDARM;"
|
||||
"in highp uint gl_CoreCountARM;"
|
||||
"in highp uint gl_CoreMaxIDARM;"
|
||||
"in highp uint gl_WarpIDARM;"
|
||||
"in highp uint gl_WarpMaxIDARM;"
|
||||
"\n";
|
||||
|
||||
stageBuiltins[EShLangVertex] .append(subgroupDecls);
|
||||
@ -5906,6 +6038,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"in uint gl_IncomingRayFlagsEXT;"
|
||||
"in float gl_CurrentRayTimeNV;"
|
||||
"in uint gl_CullMaskEXT;"
|
||||
"in vec3 gl_HitTriangleVertexPositionsEXT[3];"
|
||||
"\n";
|
||||
const char *missDecls =
|
||||
"in uvec3 gl_LaunchIDNV;"
|
||||
@ -6087,6 +6220,8 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
|
||||
for (int dim = Esd2D; dim <= EsdCube; ++dim) { // 2D, 3D, and Cube
|
||||
#else
|
||||
for (int dim = Esd1D; dim < EsdNumDims; ++dim) { // 1D, ..., buffer, subpass
|
||||
if (dim == EsdAttachmentEXT)
|
||||
continue;
|
||||
if (dim == EsdSubpass && spvVersion.vulkan == 0)
|
||||
continue;
|
||||
if (dim == EsdSubpass && (image || shadow || arrayed))
|
||||
@ -6132,6 +6267,8 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
|
||||
#ifndef GLSLANG_WEB
|
||||
if (dim == EsdSubpass) {
|
||||
sampler.setSubpass(bTypes[bType], ms ? true : false);
|
||||
} else if (dim == EsdAttachmentEXT) {
|
||||
sampler.setAttachmentEXT(bTypes[bType]);
|
||||
} else
|
||||
#endif
|
||||
if (image) {
|
||||
@ -8036,6 +8173,19 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
BuiltInVariable("gl_SMCountNV", EbvSMCount, symbolTable);
|
||||
BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable);
|
||||
BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable);
|
||||
|
||||
// GL_ARM_shader_core_builtins
|
||||
symbolTable.setVariableExtensions("gl_CoreCountARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
symbolTable.setVariableExtensions("gl_CoreIDARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
symbolTable.setVariableExtensions("gl_CoreMaxIDARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
symbolTable.setVariableExtensions("gl_WarpIDARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
symbolTable.setVariableExtensions("gl_WarpMaxIDARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
|
||||
BuiltInVariable("gl_CoreCountARM", EbvCoreCountARM, symbolTable);
|
||||
BuiltInVariable("gl_CoreIDARM", EbvCoreIDARM, symbolTable);
|
||||
BuiltInVariable("gl_CoreMaxIDARM", EbvCoreMaxIDARM, symbolTable);
|
||||
BuiltInVariable("gl_WarpIDARM", EbvWarpIDARM, symbolTable);
|
||||
BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable);
|
||||
}
|
||||
|
||||
if (language == EShLangGeometry || language == EShLangVertex) {
|
||||
@ -8110,6 +8260,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
symbolTable.setFunctionExtensions("rayQueryGetIntersectionWorldToObjectEXT", 1, &E_GL_EXT_ray_query);
|
||||
symbolTable.setFunctionExtensions("rayQueryGetWorldRayOriginEXT", 1, &E_GL_EXT_ray_query);
|
||||
symbolTable.setFunctionExtensions("rayQueryGetWorldRayDirectionEXT", 1, &E_GL_EXT_ray_query);
|
||||
symbolTable.setFunctionExtensions("rayQueryGetIntersectionTriangleVertexPositionsEXT", 1, &E_GL_EXT_ray_tracing_position_fetch);
|
||||
symbolTable.setVariableExtensions("gl_RayFlagsSkipAABBEXT", 1, &E_GL_EXT_ray_flags_primitive_culling);
|
||||
symbolTable.setVariableExtensions("gl_RayFlagsSkipTrianglesEXT", 1, &E_GL_EXT_ray_flags_primitive_culling);
|
||||
symbolTable.setVariableExtensions("gl_RayFlagsForceOpacityMicromap2StateEXT", 1, &E_GL_EXT_opacity_micromap);
|
||||
@ -8551,6 +8702,19 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
BuiltInVariable("gl_SMCountNV", EbvSMCount, symbolTable);
|
||||
BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable);
|
||||
BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable);
|
||||
|
||||
// GL_ARM_shader_core_builtins
|
||||
symbolTable.setVariableExtensions("gl_CoreCountARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
symbolTable.setVariableExtensions("gl_CoreIDARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
symbolTable.setVariableExtensions("gl_CoreMaxIDARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
symbolTable.setVariableExtensions("gl_WarpIDARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
symbolTable.setVariableExtensions("gl_WarpMaxIDARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
|
||||
BuiltInVariable("gl_CoreCountARM", EbvCoreCountARM, symbolTable);
|
||||
BuiltInVariable("gl_CoreIDARM", EbvCoreIDARM, symbolTable);
|
||||
BuiltInVariable("gl_CoreMaxIDARM", EbvCoreMaxIDARM, symbolTable);
|
||||
BuiltInVariable("gl_WarpIDARM", EbvWarpIDARM, symbolTable);
|
||||
BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable);
|
||||
}
|
||||
|
||||
if (profile == EEsProfile) {
|
||||
@ -8591,6 +8755,11 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
|
||||
}
|
||||
|
||||
// GL_EXT_shader_tile_image
|
||||
symbolTable.setFunctionExtensions("stencilAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image);
|
||||
symbolTable.setFunctionExtensions("depthAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image);
|
||||
symbolTable.setFunctionExtensions("colorAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image);
|
||||
#endif // !GLSLANG_WEB
|
||||
break;
|
||||
|
||||
@ -8694,6 +8863,19 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
BuiltInVariable("gl_SMCountNV", EbvSMCount, symbolTable);
|
||||
BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable);
|
||||
BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable);
|
||||
|
||||
// GL_ARM_shader_core_builtins
|
||||
symbolTable.setVariableExtensions("gl_CoreCountARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
symbolTable.setVariableExtensions("gl_CoreIDARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
symbolTable.setVariableExtensions("gl_CoreMaxIDARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
symbolTable.setVariableExtensions("gl_WarpIDARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
symbolTable.setVariableExtensions("gl_WarpMaxIDARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
|
||||
BuiltInVariable("gl_CoreCountARM", EbvCoreCountARM, symbolTable);
|
||||
BuiltInVariable("gl_CoreIDARM", EbvCoreIDARM, symbolTable);
|
||||
BuiltInVariable("gl_CoreMaxIDARM", EbvCoreMaxIDARM, symbolTable);
|
||||
BuiltInVariable("gl_WarpIDARM", EbvWarpIDARM, symbolTable);
|
||||
BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable);
|
||||
}
|
||||
|
||||
// GL_KHR_shader_subgroup
|
||||
@ -8781,6 +8963,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
symbolTable.setVariableExtensions("gl_IncomingRayFlagsNV", 1, &E_GL_NV_ray_tracing);
|
||||
symbolTable.setVariableExtensions("gl_IncomingRayFlagsEXT", 1, &E_GL_EXT_ray_tracing);
|
||||
symbolTable.setVariableExtensions("gl_CurrentRayTimeNV", 1, &E_GL_NV_ray_tracing_motion_blur);
|
||||
symbolTable.setVariableExtensions("gl_HitTriangleVertexPositionsEXT", 1, &E_GL_EXT_ray_tracing_position_fetch);
|
||||
|
||||
symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group);
|
||||
|
||||
@ -8795,6 +8978,38 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
symbolTable.setFunctionExtensions("executeCallableNV", 1, &E_GL_NV_ray_tracing);
|
||||
symbolTable.setFunctionExtensions("executeCallableEXT", 1, &E_GL_EXT_ray_tracing);
|
||||
|
||||
symbolTable.setFunctionExtensions("hitObjectTraceRayNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectTraceRayMotionNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectRecordHitNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectRecordHitMotionNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectRecordHitWithIndexNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectRecordHitWithIndexMotionNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectRecordMissNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectRecordMissMotionNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectRecordEmptyNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectExecuteShaderNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectIsEmptyNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectIsMissNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectIsHitNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetRayTMinNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetRayTMaxNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetObjectRayOriginNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetObjectRayDirectionNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetWorldRayOriginNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetWorldRayDirectionNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetWorldToObjectNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetbjectToWorldNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetInstanceCustomIndexNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetInstanceIdNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetGeometryIndexNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetPrimitiveIndexNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetHitKindNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetAttributesNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetCurrentTimeNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetShaderBindingTableRecordIndexNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetShaderRecordBufferHandleNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("reorderThreadNV", 1, &E_GL_NV_shader_invocation_reorder);
|
||||
|
||||
|
||||
BuiltInVariable("gl_LaunchIDNV", EbvLaunchId, symbolTable);
|
||||
BuiltInVariable("gl_LaunchIDEXT", EbvLaunchId, symbolTable);
|
||||
@ -8832,6 +9047,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
BuiltInVariable("gl_IncomingRayFlagsEXT", EbvIncomingRayFlags, symbolTable);
|
||||
BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable);
|
||||
BuiltInVariable("gl_CurrentRayTimeNV", EbvCurrentRayTimeNV, symbolTable);
|
||||
BuiltInVariable("gl_HitTriangleVertexPositionsEXT", EbvPositionFetch, symbolTable);
|
||||
|
||||
// GL_ARB_shader_ballot
|
||||
symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot);
|
||||
@ -8888,6 +9104,19 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
BuiltInVariable("gl_SMCountNV", EbvSMCount, symbolTable);
|
||||
BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable);
|
||||
BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable);
|
||||
|
||||
// GL_ARM_shader_core_builtins
|
||||
symbolTable.setVariableExtensions("gl_CoreCountARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
symbolTable.setVariableExtensions("gl_CoreIDARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
symbolTable.setVariableExtensions("gl_CoreMaxIDARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
symbolTable.setVariableExtensions("gl_WarpIDARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
symbolTable.setVariableExtensions("gl_WarpMaxIDARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
|
||||
BuiltInVariable("gl_CoreCountARM", EbvCoreCountARM, symbolTable);
|
||||
BuiltInVariable("gl_CoreIDARM", EbvCoreIDARM, symbolTable);
|
||||
BuiltInVariable("gl_CoreMaxIDARM", EbvCoreMaxIDARM, symbolTable);
|
||||
BuiltInVariable("gl_WarpIDARM", EbvWarpIDARM, symbolTable);
|
||||
BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable);
|
||||
}
|
||||
if ((profile == EEsProfile && version >= 310) ||
|
||||
(profile != EEsProfile && version >= 450)) {
|
||||
@ -9094,6 +9323,19 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
BuiltInVariable("gl_SMCountNV", EbvSMCount, symbolTable);
|
||||
BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable);
|
||||
BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable);
|
||||
|
||||
// GL_ARM_shader_core_builtins
|
||||
symbolTable.setVariableExtensions("gl_CoreCountARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
symbolTable.setVariableExtensions("gl_CoreIDARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
symbolTable.setVariableExtensions("gl_CoreMaxIDARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
symbolTable.setVariableExtensions("gl_WarpIDARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
symbolTable.setVariableExtensions("gl_WarpMaxIDARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
|
||||
BuiltInVariable("gl_CoreCountARM", EbvCoreCountARM, symbolTable);
|
||||
BuiltInVariable("gl_CoreIDARM", EbvCoreIDARM, symbolTable);
|
||||
BuiltInVariable("gl_CoreMaxIDARM", EbvCoreMaxIDARM, symbolTable);
|
||||
BuiltInVariable("gl_WarpIDARM", EbvWarpIDARM, symbolTable);
|
||||
BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable);
|
||||
}
|
||||
|
||||
if ((profile == EEsProfile && version >= 310) ||
|
||||
@ -9224,6 +9466,19 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
BuiltInVariable("gl_SMCountNV", EbvSMCount, symbolTable);
|
||||
BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable);
|
||||
BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable);
|
||||
|
||||
// GL_ARM_shader_core_builtins
|
||||
symbolTable.setVariableExtensions("gl_CoreCountARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
symbolTable.setVariableExtensions("gl_CoreIDARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
symbolTable.setVariableExtensions("gl_CoreMaxIDARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
symbolTable.setVariableExtensions("gl_WarpIDARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
symbolTable.setVariableExtensions("gl_WarpMaxIDARM", 1, &E_GL_ARM_shader_core_builtins);
|
||||
|
||||
BuiltInVariable("gl_CoreCountARM", EbvCoreCountARM, symbolTable);
|
||||
BuiltInVariable("gl_CoreIDARM", EbvCoreIDARM, symbolTable);
|
||||
BuiltInVariable("gl_CoreMaxIDARM", EbvCoreMaxIDARM, symbolTable);
|
||||
BuiltInVariable("gl_WarpIDARM", EbvWarpIDARM, symbolTable);
|
||||
BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable);
|
||||
}
|
||||
if ((profile == EEsProfile && version >= 310) ||
|
||||
(profile != EEsProfile && version >= 450)) {
|
||||
@ -9717,6 +9972,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
symbolTable.relateToOperator("rayQueryGetWorldRayOriginEXT", EOpRayQueryGetWorldRayOrigin);
|
||||
symbolTable.relateToOperator("rayQueryGetIntersectionObjectToWorldEXT", EOpRayQueryGetIntersectionObjectToWorld);
|
||||
symbolTable.relateToOperator("rayQueryGetIntersectionWorldToObjectEXT", EOpRayQueryGetIntersectionWorldToObject);
|
||||
symbolTable.relateToOperator("rayQueryGetIntersectionTriangleVertexPositionsEXT", EOpRayQueryGetIntersectionTriangleVertexPositionsEXT);
|
||||
}
|
||||
|
||||
symbolTable.relateToOperator("interpolateAtCentroid", EOpInterpolateAtCentroid);
|
||||
@ -9729,6 +9985,10 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
symbolTable.relateToOperator("beginInvocationInterlockARB", EOpBeginInvocationInterlock);
|
||||
symbolTable.relateToOperator("endInvocationInterlockARB", EOpEndInvocationInterlock);
|
||||
|
||||
symbolTable.relateToOperator("stencilAttachmentReadEXT", EOpStencilAttachmentReadEXT);
|
||||
symbolTable.relateToOperator("depthAttachmentReadEXT", EOpDepthAttachmentReadEXT);
|
||||
symbolTable.relateToOperator("colorAttachmentReadEXT", EOpColorAttachmentReadEXT);
|
||||
|
||||
break;
|
||||
|
||||
case EShLangCompute:
|
||||
@ -9759,6 +10019,38 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
symbolTable.relateToOperator("traceRayEXT", EOpTraceKHR);
|
||||
symbolTable.relateToOperator("executeCallableNV", EOpExecuteCallableNV);
|
||||
symbolTable.relateToOperator("executeCallableEXT", EOpExecuteCallableKHR);
|
||||
|
||||
symbolTable.relateToOperator("hitObjectTraceRayNV", EOpHitObjectTraceRayNV);
|
||||
symbolTable.relateToOperator("hitObjectTraceRayMotionNV", EOpHitObjectTraceRayMotionNV);
|
||||
symbolTable.relateToOperator("hitObjectRecordHitNV", EOpHitObjectRecordHitNV);
|
||||
symbolTable.relateToOperator("hitObjectRecordHitMotionNV", EOpHitObjectRecordHitMotionNV);
|
||||
symbolTable.relateToOperator("hitObjectRecordHitWithIndexNV", EOpHitObjectRecordHitWithIndexNV);
|
||||
symbolTable.relateToOperator("hitObjectRecordHitWithIndexMotionNV", EOpHitObjectRecordHitWithIndexMotionNV);
|
||||
symbolTable.relateToOperator("hitObjectRecordMissNV", EOpHitObjectRecordMissNV);
|
||||
symbolTable.relateToOperator("hitObjectRecordMissMotionNV", EOpHitObjectRecordMissMotionNV);
|
||||
symbolTable.relateToOperator("hitObjectRecordEmptyNV", EOpHitObjectRecordEmptyNV);
|
||||
symbolTable.relateToOperator("hitObjectExecuteShaderNV", EOpHitObjectExecuteShaderNV);
|
||||
symbolTable.relateToOperator("hitObjectIsEmptyNV", EOpHitObjectIsEmptyNV);
|
||||
symbolTable.relateToOperator("hitObjectIsMissNV", EOpHitObjectIsMissNV);
|
||||
symbolTable.relateToOperator("hitObjectIsHitNV", EOpHitObjectIsHitNV);
|
||||
symbolTable.relateToOperator("hitObjectGetRayTMinNV", EOpHitObjectGetRayTMinNV);
|
||||
symbolTable.relateToOperator("hitObjectGetRayTMaxNV", EOpHitObjectGetRayTMaxNV);
|
||||
symbolTable.relateToOperator("hitObjectGetObjectRayOriginNV", EOpHitObjectGetObjectRayOriginNV);
|
||||
symbolTable.relateToOperator("hitObjectGetObjectRayDirectionNV", EOpHitObjectGetObjectRayDirectionNV);
|
||||
symbolTable.relateToOperator("hitObjectGetWorldRayOriginNV", EOpHitObjectGetWorldRayOriginNV);
|
||||
symbolTable.relateToOperator("hitObjectGetWorldRayDirectionNV", EOpHitObjectGetWorldRayDirectionNV);
|
||||
symbolTable.relateToOperator("hitObjectGetWorldToObjectNV", EOpHitObjectGetWorldToObjectNV);
|
||||
symbolTable.relateToOperator("hitObjectGetObjectToWorldNV", EOpHitObjectGetObjectToWorldNV);
|
||||
symbolTable.relateToOperator("hitObjectGetInstanceCustomIndexNV", EOpHitObjectGetInstanceCustomIndexNV);
|
||||
symbolTable.relateToOperator("hitObjectGetInstanceIdNV", EOpHitObjectGetInstanceIdNV);
|
||||
symbolTable.relateToOperator("hitObjectGetGeometryIndexNV", EOpHitObjectGetGeometryIndexNV);
|
||||
symbolTable.relateToOperator("hitObjectGetPrimitiveIndexNV", EOpHitObjectGetPrimitiveIndexNV);
|
||||
symbolTable.relateToOperator("hitObjectGetHitKindNV", EOpHitObjectGetHitKindNV);
|
||||
symbolTable.relateToOperator("hitObjectGetAttributesNV", EOpHitObjectGetAttributesNV);
|
||||
symbolTable.relateToOperator("hitObjectGetCurrentTimeNV", EOpHitObjectGetCurrentTimeNV);
|
||||
symbolTable.relateToOperator("hitObjectGetShaderBindingTableRecordIndexNV", EOpHitObjectGetShaderBindingTableRecordIndexNV);
|
||||
symbolTable.relateToOperator("hitObjectGetShaderRecordBufferHandleNV", EOpHitObjectGetShaderRecordBufferHandleNV);
|
||||
symbolTable.relateToOperator("reorderThreadNV", EOpReorderThreadNV);
|
||||
}
|
||||
break;
|
||||
case EShLangIntersect:
|
||||
|
@ -352,7 +352,7 @@ TIntermTyped* TIntermediate::addIndex(TOperator op, TIntermTyped* base, TIntermT
|
||||
TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child,
|
||||
const TSourceLoc& loc)
|
||||
{
|
||||
if (child == 0)
|
||||
if (child == nullptr)
|
||||
return nullptr;
|
||||
|
||||
if (child->getType().getBasicType() == EbtBlock)
|
||||
@ -751,6 +751,11 @@ bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& ne
|
||||
case EbtInt64: newOp = EOpConvInt64ToUint; break;
|
||||
case EbtUint64: newOp = EOpConvUint64ToUint; break;
|
||||
#endif
|
||||
// For bindless texture type conversion, add a dummy convert op, just
|
||||
// to generate a new TIntermTyped
|
||||
// uvec2(any sampler type)
|
||||
// uvec2(any image type)
|
||||
case EbtSampler: newOp = EOpConvIntToUint; break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
@ -159,7 +159,8 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op,
|
||||
//
|
||||
switch (node->getBasicType()) {
|
||||
case EbtSampler:
|
||||
message = "can't modify a sampler";
|
||||
if (extensionTurnedOn(E_GL_ARB_bindless_texture) == false)
|
||||
message = "can't modify a sampler";
|
||||
break;
|
||||
case EbtVoid:
|
||||
message = "can't modify void";
|
||||
@ -174,6 +175,9 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op,
|
||||
case EbtRayQuery:
|
||||
message = "can't modify rayQueryEXT";
|
||||
break;
|
||||
case EbtHitObjectNV:
|
||||
message = "can't modify hitObjectNV";
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
@ -231,12 +235,12 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op,
|
||||
// Test for and give an error if the node can't be read from.
|
||||
void TParseContextBase::rValueErrorCheck(const TSourceLoc& loc, const char* op, TIntermTyped* node)
|
||||
{
|
||||
TIntermBinary* binaryNode = node->getAsBinaryNode();
|
||||
const TIntermSymbol* symNode = node->getAsSymbolNode();
|
||||
|
||||
if (! node)
|
||||
return;
|
||||
|
||||
TIntermBinary* binaryNode = node->getAsBinaryNode();
|
||||
const TIntermSymbol* symNode = node->getAsSymbolNode();
|
||||
|
||||
if (node->getQualifier().isWriteOnly()) {
|
||||
const TIntermTyped* leftMostTypeNode = TIntermediate::findLValueBase(node, true);
|
||||
|
||||
|
@ -80,10 +80,6 @@ TParseContext::TParseContext(TSymbolTable& symbolTable, TIntermediate& interm, b
|
||||
globalBufferDefaults.layoutMatrix = ElmColumnMajor;
|
||||
globalBufferDefaults.layoutPacking = spvVersion.spv != 0 ? ElpStd430 : ElpShared;
|
||||
|
||||
// use storage buffer on SPIR-V 1.3 and up
|
||||
if (spvVersion.spv >= EShTargetSpv_1_3)
|
||||
intermediate.setUseStorageBuffer();
|
||||
|
||||
globalInputDefaults.clear();
|
||||
globalOutputDefaults.clear();
|
||||
|
||||
@ -608,6 +604,15 @@ TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIn
|
||||
#ifndef GLSLANG_WEB
|
||||
if (base->getType().isUnsizedArray()) {
|
||||
base->getWritableType().updateImplicitArraySize(indexValue + 1);
|
||||
base->getWritableType().setImplicitlySized(true);
|
||||
if (base->getQualifier().builtIn == EbvClipDistance &&
|
||||
indexValue >= resources.maxClipDistances) {
|
||||
error(loc, "gl_ClipDistance", "[", "array index out of range '%d'", indexValue);
|
||||
}
|
||||
else if (base->getQualifier().builtIn == EbvCullDistance &&
|
||||
indexValue >= resources.maxCullDistances) {
|
||||
error(loc, "gl_CullDistance", "[", "array index out of range '%d'", indexValue);
|
||||
}
|
||||
// For 2D per-view builtin arrays, update the inner dimension size in parent type
|
||||
if (base->getQualifier().isPerView() && base->getQualifier().builtIn != EbvNone) {
|
||||
TIntermBinary* binaryNode = base->getAsBinaryNode();
|
||||
@ -1026,14 +1031,22 @@ TIntermTyped* TParseContext::handleDotDereference(const TSourceLoc& loc, TInterm
|
||||
inheritMemoryQualifiers(base->getQualifier(), result->getWritableType().getQualifier());
|
||||
} else {
|
||||
auto baseSymbol = base;
|
||||
while (baseSymbol->getAsSymbolNode() == nullptr)
|
||||
baseSymbol = baseSymbol->getAsBinaryNode()->getLeft();
|
||||
TString structName;
|
||||
structName.append("\'").append(baseSymbol->getAsSymbolNode()->getName().c_str()).append( "\'");
|
||||
error(loc, "no such field in structure", field.c_str(), structName.c_str());
|
||||
while (baseSymbol->getAsSymbolNode() == nullptr) {
|
||||
auto binaryNode = baseSymbol->getAsBinaryNode();
|
||||
if (binaryNode == nullptr) break;
|
||||
baseSymbol = binaryNode->getLeft();
|
||||
}
|
||||
if (baseSymbol->getAsSymbolNode() != nullptr) {
|
||||
TString structName;
|
||||
structName.append("\'").append(baseSymbol->getAsSymbolNode()->getName().c_str()).append("\'");
|
||||
error(loc, "no such field in structure", field.c_str(), structName.c_str());
|
||||
} else {
|
||||
error(loc, "no such field in structure", field.c_str(), "");
|
||||
}
|
||||
}
|
||||
} else
|
||||
error(loc, "does not apply to this type:", field.c_str(), base->getType().getCompleteString(intermediate.getEnhancedMsgs()).c_str());
|
||||
error(loc, "does not apply to this type:", field.c_str(),
|
||||
base->getType().getCompleteString(intermediate.getEnhancedMsgs()).c_str());
|
||||
|
||||
// Propagate noContraction up the dereference chain
|
||||
if (base->getQualifier().isNoContraction())
|
||||
@ -1165,7 +1178,7 @@ TFunction* TParseContext::handleFunctionDeclarator(const TSourceLoc& loc, TFunct
|
||||
if (symbol && builtIn && function.getBuiltInOp() == EOpSpirvInst)
|
||||
symbol = nullptr;
|
||||
#endif
|
||||
const TFunction* prevDec = symbol ? symbol->getAsFunction() : 0;
|
||||
const TFunction* prevDec = symbol ? symbol->getAsFunction() : nullptr;
|
||||
if (prevDec) {
|
||||
if (prevDec->isPrototyped() && prototype)
|
||||
profileRequires(loc, EEsProfile, 300, nullptr, "multiple prototypes for same function");
|
||||
@ -1389,7 +1402,8 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction
|
||||
#endif
|
||||
const TType& argType = arg->getAsTyped()->getType();
|
||||
const TQualifier& argQualifier = argType.getQualifier();
|
||||
if (argQualifier.isMemory() && (argType.containsOpaque() || argType.isReference())) {
|
||||
bool containsBindlessSampler = intermediate.getBindlessMode() && argType.containsSampler();
|
||||
if (argQualifier.isMemory() && !containsBindlessSampler && (argType.containsOpaque() || argType.isReference())) {
|
||||
const char* message = "argument cannot drop memory qualifier when passed to formal parameter";
|
||||
#ifndef GLSLANG_WEB
|
||||
if (argQualifier.volatil && ! formalQualifier.volatil)
|
||||
@ -1675,9 +1689,13 @@ TIntermNode* TParseContext::handleReturnValue(const TSourceLoc& loc, TIntermType
|
||||
error(loc, "type does not match, or is not convertible to, the function's return type", "return", "");
|
||||
branch = intermediate.addBranch(EOpReturn, value, loc);
|
||||
}
|
||||
} else
|
||||
} else {
|
||||
if (value->getType().isTexture() || value->getType().isImage()) {
|
||||
if (!extensionTurnedOn(E_GL_ARB_bindless_texture))
|
||||
error(loc, "sampler or image can be used as return type only when the extension GL_ARB_bindless_texture enabled", "return", "");
|
||||
}
|
||||
branch = intermediate.addBranch(EOpReturn, value, loc);
|
||||
|
||||
}
|
||||
branch->updatePrecision(currentFunctionType->getQualifier().precision);
|
||||
return branch;
|
||||
}
|
||||
@ -1928,6 +1946,9 @@ TIntermTyped* TParseContext::addAssign(const TSourceLoc& loc, TOperator op, TInt
|
||||
if ((op == EOpAddAssign || op == EOpSubAssign) && left->isReference())
|
||||
requireExtensions(loc, 1, &E_GL_EXT_buffer_reference2, "+= and -= on a buffer reference");
|
||||
|
||||
if (op == EOpAssign && left->getBasicType() == EbtSampler && right->getBasicType() == EbtSampler)
|
||||
requireExtensions(loc, 1, &E_GL_ARB_bindless_texture, "sampler assignment for bindless texture");
|
||||
|
||||
return intermediate.addAssign(op, left, right, loc);
|
||||
}
|
||||
|
||||
@ -2360,6 +2381,79 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
|
||||
}
|
||||
break;
|
||||
|
||||
case EOpHitObjectTraceRayNV:
|
||||
if (!(*argp)[11]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "payload number", "");
|
||||
else {
|
||||
unsigned int location = (*argp)[11]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(0, location) < 0)
|
||||
error(loc, "with layout(location =", "no rayPayloadEXT/rayPayloadInEXT declared", "%d)", location);
|
||||
}
|
||||
break;
|
||||
case EOpHitObjectTraceRayMotionNV:
|
||||
if (!(*argp)[12]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "payload number", "");
|
||||
else {
|
||||
unsigned int location = (*argp)[12]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(0, location) < 0)
|
||||
error(loc, "with layout(location =", "no rayPayloadEXT/rayPayloadInEXT declared", "%d)", location);
|
||||
}
|
||||
break;
|
||||
case EOpHitObjectExecuteShaderNV:
|
||||
if (!(*argp)[1]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "payload number", "");
|
||||
else {
|
||||
unsigned int location = (*argp)[1]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(0, location) < 0)
|
||||
error(loc, "with layout(location =", "no rayPayloadEXT/rayPayloadInEXT declared", "%d)", location);
|
||||
}
|
||||
break;
|
||||
case EOpHitObjectRecordHitNV:
|
||||
if (!(*argp)[12]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "hitobjectattribute number", "");
|
||||
else {
|
||||
unsigned int location = (*argp)[12]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(2, location) < 0)
|
||||
error(loc, "with layout(location =", "no hitObjectAttributeNV declared", "%d)", location);
|
||||
}
|
||||
break;
|
||||
case EOpHitObjectRecordHitMotionNV:
|
||||
if (!(*argp)[13]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "hitobjectattribute number", "");
|
||||
else {
|
||||
unsigned int location = (*argp)[13]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(2, location) < 0)
|
||||
error(loc, "with layout(location =", "no hitObjectAttributeNV declared", "%d)", location);
|
||||
}
|
||||
break;
|
||||
case EOpHitObjectRecordHitWithIndexNV:
|
||||
if (!(*argp)[11]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "hitobjectattribute number", "");
|
||||
else {
|
||||
unsigned int location = (*argp)[11]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(2, location) < 0)
|
||||
error(loc, "with layout(location =", "no hitObjectAttributeNV declared", "%d)", location);
|
||||
}
|
||||
break;
|
||||
case EOpHitObjectRecordHitWithIndexMotionNV:
|
||||
if (!(*argp)[12]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "hitobjectattribute number", "");
|
||||
else {
|
||||
unsigned int location = (*argp)[12]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(2, location) < 0)
|
||||
error(loc, "with layout(location =", "no hitObjectAttributeNV declared", "%d)", location);
|
||||
}
|
||||
break;
|
||||
case EOpHitObjectGetAttributesNV:
|
||||
if (!(*argp)[1]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "hitobjectattribute number", "");
|
||||
else {
|
||||
unsigned int location = (*argp)[1]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(2, location) < 0)
|
||||
error(loc, "with layout(location =", "no hitObjectAttributeNV declared", "%d)", location);
|
||||
}
|
||||
break;
|
||||
|
||||
case EOpRayQueryGetIntersectionType:
|
||||
case EOpRayQueryGetIntersectionT:
|
||||
case EOpRayQueryGetIntersectionInstanceCustomIndex:
|
||||
@ -2373,6 +2467,7 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
|
||||
case EOpRayQueryGetIntersectionObjectRayOrigin:
|
||||
case EOpRayQueryGetIntersectionObjectToWorld:
|
||||
case EOpRayQueryGetIntersectionWorldToObject:
|
||||
case EOpRayQueryGetIntersectionTriangleVertexPositionsEXT:
|
||||
if (!(*argp)[1]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "committed", "");
|
||||
break;
|
||||
@ -2811,6 +2906,14 @@ TFunction* TParseContext::handleConstructorCall(const TSourceLoc& loc, const TPu
|
||||
profileRequires(loc, EEsProfile, 300, nullptr, "arrayed constructor");
|
||||
}
|
||||
|
||||
// Reuse EOpConstructTextureSampler for bindless image constructor
|
||||
// uvec2 imgHandle;
|
||||
// imageLoad(image1D(imgHandle), 0);
|
||||
if (type.isImage() && extensionTurnedOn(E_GL_ARB_bindless_texture))
|
||||
{
|
||||
intermediate.setBindlessImageMode(currentCaller, AstRefTypeFunc);
|
||||
}
|
||||
|
||||
TOperator op = intermediate.mapTypeToConstructorOp(type);
|
||||
|
||||
if (op == EOpNull) {
|
||||
@ -3140,7 +3243,7 @@ void TParseContext::reservedPpErrorCheck(const TSourceLoc& loc, const char* iden
|
||||
ppWarn(loc, "\"defined\" is (un)defined:", op, identifier);
|
||||
else
|
||||
ppError(loc, "\"defined\" can't be (un)defined:", op, identifier);
|
||||
else if (strstr(identifier, "__") != 0 && !extensionTurnedOn(E_GL_EXT_spirv_intrinsics)) {
|
||||
else if (strstr(identifier, "__") != nullptr && !extensionTurnedOn(E_GL_EXT_spirv_intrinsics)) {
|
||||
// The extension GL_EXT_spirv_intrinsics allows us to declare macros prefixed with "__".
|
||||
if (isEsProfile() && version >= 300 &&
|
||||
(strcmp(identifier, "__LINE__") == 0 ||
|
||||
@ -3544,8 +3647,13 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
|
||||
return true;
|
||||
}
|
||||
if (op != EOpConstructStruct && op != EOpConstructNonuniform && typed->getBasicType() == EbtSampler) {
|
||||
error(loc, "cannot convert a sampler", constructorString.c_str(), "");
|
||||
return true;
|
||||
if (op == EOpConstructUVec2 && extensionTurnedOn(E_GL_ARB_bindless_texture)) {
|
||||
intermediate.setBindlessTextureMode(currentCaller, AstRefTypeFunc);
|
||||
}
|
||||
else {
|
||||
error(loc, "cannot convert a sampler", constructorString.c_str(), "");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (op != EOpConstructStruct && typed->isAtomic()) {
|
||||
error(loc, "cannot convert an atomic_uint", constructorString.c_str(), "");
|
||||
@ -3565,6 +3673,26 @@ bool TParseContext::constructorTextureSamplerError(const TSourceLoc& loc, const
|
||||
{
|
||||
TString constructorName = function.getType().getBasicTypeString(); // TODO: performance: should not be making copy; interface needs to change
|
||||
const char* token = constructorName.c_str();
|
||||
// verify the constructor for bindless texture, the input must be ivec2 or uvec2
|
||||
if (function.getParamCount() == 1) {
|
||||
TType* pType = function[0].type;
|
||||
TBasicType basicType = pType->getBasicType();
|
||||
bool isIntegerVec2 = ((basicType == EbtUint || basicType == EbtInt) && pType->getVectorSize() == 2);
|
||||
bool bindlessMode = extensionTurnedOn(E_GL_ARB_bindless_texture);
|
||||
if (isIntegerVec2 && bindlessMode) {
|
||||
if (pType->getSampler().isImage())
|
||||
intermediate.setBindlessImageMode(currentCaller, AstRefTypeFunc);
|
||||
else
|
||||
intermediate.setBindlessTextureMode(currentCaller, AstRefTypeFunc);
|
||||
return false;
|
||||
} else {
|
||||
if (!bindlessMode)
|
||||
error(loc, "sampler-constructor requires the extension GL_ARB_bindless_texture enabled", token, "");
|
||||
else
|
||||
error(loc, "sampler-constructor requires the input to be ivec2 or uvec2", token, "");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// exactly two arguments needed
|
||||
if (function.getParamCount() != 2) {
|
||||
@ -3660,13 +3788,35 @@ void TParseContext::samplerCheck(const TSourceLoc& loc, const TType& type, const
|
||||
if (type.getQualifier().storage == EvqUniform)
|
||||
return;
|
||||
|
||||
if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtSampler))
|
||||
error(loc, "non-uniform struct contains a sampler or image:", type.getBasicTypeString().c_str(), identifier.c_str());
|
||||
if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtSampler)) {
|
||||
// For bindless texture, sampler can be declared as an struct member
|
||||
if (extensionTurnedOn(E_GL_ARB_bindless_texture)) {
|
||||
if (type.getSampler().isImage())
|
||||
intermediate.setBindlessImageMode(currentCaller, AstRefTypeVar);
|
||||
else
|
||||
intermediate.setBindlessTextureMode(currentCaller, AstRefTypeVar);
|
||||
}
|
||||
else {
|
||||
error(loc, "non-uniform struct contains a sampler or image:", type.getBasicTypeString().c_str(), identifier.c_str());
|
||||
}
|
||||
}
|
||||
else if (type.getBasicType() == EbtSampler && type.getQualifier().storage != EvqUniform) {
|
||||
// non-uniform sampler
|
||||
// not yet: okay if it has an initializer
|
||||
// if (! initializer)
|
||||
error(loc, "sampler/image types can only be used in uniform variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str());
|
||||
// For bindless texture, sampler can be declared as an input/output/block member
|
||||
if (extensionTurnedOn(E_GL_ARB_bindless_texture)) {
|
||||
if (type.getSampler().isImage())
|
||||
intermediate.setBindlessImageMode(currentCaller, AstRefTypeVar);
|
||||
else
|
||||
intermediate.setBindlessTextureMode(currentCaller, AstRefTypeVar);
|
||||
}
|
||||
else {
|
||||
// non-uniform sampler
|
||||
// not yet: okay if it has an initializer
|
||||
// if (! initializer)
|
||||
if (type.getSampler().isAttachmentEXT() && type.getQualifier().storage != EvqTileImageEXT)
|
||||
error(loc, "can only be used in tileImageEXT variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str());
|
||||
else if (type.getQualifier().storage != EvqTileImageEXT)
|
||||
error(loc, "sampler/image types can only be used in uniform variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3732,7 +3882,7 @@ void TParseContext::memberQualifierCheck(glslang::TPublicType& publicType)
|
||||
//
|
||||
// Check/fix just a full qualifier (no variables or types yet, but qualifier is complete) at global level.
|
||||
//
|
||||
void TParseContext::globalQualifierFixCheck(const TSourceLoc& loc, TQualifier& qualifier, bool isMemberCheck)
|
||||
void TParseContext::globalQualifierFixCheck(const TSourceLoc& loc, TQualifier& qualifier, bool isMemberCheck, const TPublicType* publicType)
|
||||
{
|
||||
bool nonuniformOkay = false;
|
||||
|
||||
@ -3768,6 +3918,11 @@ void TParseContext::globalQualifierFixCheck(const TSourceLoc& loc, TQualifier& q
|
||||
{
|
||||
requireExtensions(loc, 1, &E_GL_EXT_scalar_block_layout, "default std430 layout for uniform");
|
||||
}
|
||||
|
||||
if (publicType != nullptr && publicType->isImage() &&
|
||||
(qualifier.layoutFormat > ElfExtSizeGuard && qualifier.layoutFormat < ElfCount))
|
||||
qualifier.layoutFormat = mapLegacyLayoutFormat(qualifier.layoutFormat, publicType->sampler.getBasicType());
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -3828,8 +3983,10 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali
|
||||
return;
|
||||
}
|
||||
|
||||
if (isTypeInt(publicType.basicType) || publicType.basicType == EbtDouble)
|
||||
profileRequires(loc, EEsProfile, 300, nullptr, "shader input/output");
|
||||
if (isTypeInt(publicType.basicType) || publicType.basicType == EbtDouble) {
|
||||
profileRequires(loc, EEsProfile, 300, nullptr, "non-float shader input/output");
|
||||
profileRequires(loc, ~EEsProfile, 130, nullptr, "non-float shader input/output");
|
||||
}
|
||||
|
||||
if (!qualifier.flat && !qualifier.isExplicitInterpolation() && !qualifier.isPervertexNV() && !qualifier.isPervertexEXT()) {
|
||||
if (isTypeInt(publicType.basicType) ||
|
||||
@ -3860,7 +4017,7 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali
|
||||
switch (language) {
|
||||
case EShLangVertex:
|
||||
if (publicType.basicType == EbtStruct) {
|
||||
error(loc, "cannot be a structure or array", GetStorageQualifierString(qualifier.storage), "");
|
||||
error(loc, "cannot be a structure", GetStorageQualifierString(qualifier.storage), "");
|
||||
return;
|
||||
}
|
||||
if (publicType.arraySizes) {
|
||||
@ -4075,7 +4232,7 @@ void TParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, cons
|
||||
if (dstSpirvDecorate.decorates.find(decorateString.first) != dstSpirvDecorate.decorates.end())
|
||||
error(loc, "too many SPIR-V decorate qualifiers", "spirv_decorate_string", "(decoration=%u)", decorateString.first);
|
||||
else
|
||||
dstSpirvDecorate.decorates.insert(decorateString);
|
||||
dstSpirvDecorate.decorateStrings.insert(decorateString);
|
||||
}
|
||||
} else {
|
||||
dst.spirvDecorate = src.spirvDecorate;
|
||||
@ -4172,7 +4329,7 @@ void TParseContext::precisionQualifierCheck(const TSourceLoc& loc, TBasicType ba
|
||||
|
||||
void TParseContext::parameterTypeCheck(const TSourceLoc& loc, TStorageQualifier qualifier, const TType& type)
|
||||
{
|
||||
if ((qualifier == EvqOut || qualifier == EvqInOut) && type.isOpaque())
|
||||
if ((qualifier == EvqOut || qualifier == EvqInOut) && type.isOpaque() && !intermediate.getBindlessMode())
|
||||
error(loc, "samplers and atomic_uints cannot be output parameters", type.getBasicTypeString().c_str(), "");
|
||||
if (!parsingBuiltins && type.contains16BitFloat())
|
||||
requireFloat16Arithmetic(loc, type.getBasicTypeString().c_str(), "float16 types can only be in uniform block or buffer storage");
|
||||
@ -4516,7 +4673,7 @@ void TParseContext::checkRuntimeSizable(const TSourceLoc& loc, const TIntermType
|
||||
|
||||
// check for additional things allowed by GL_EXT_nonuniform_qualifier
|
||||
if (base.getBasicType() == EbtSampler || base.getBasicType() == EbtAccStruct || base.getBasicType() == EbtRayQuery ||
|
||||
(base.getBasicType() == EbtBlock && base.getType().getQualifier().isUniformOrBuffer()))
|
||||
base.getBasicType() == EbtHitObjectNV || (base.getBasicType() == EbtBlock && base.getType().getQualifier().isUniformOrBuffer()))
|
||||
requireExtensions(loc, 1, &E_GL_EXT_nonuniform_qualifier, "variable index");
|
||||
else
|
||||
error(loc, "", "[", "array must be redeclared with a size before being indexed with a variable");
|
||||
@ -5019,6 +5176,7 @@ void TParseContext::paramCheckFixStorage(const TSourceLoc& loc, const TStorageQu
|
||||
case EvqIn:
|
||||
case EvqOut:
|
||||
case EvqInOut:
|
||||
case EvqTileImageEXT:
|
||||
type.getQualifier().storage = qualifier;
|
||||
break;
|
||||
case EvqGlobal:
|
||||
@ -5105,7 +5263,7 @@ void TParseContext::arrayObjectCheck(const TSourceLoc& loc, const TType& type, c
|
||||
|
||||
void TParseContext::opaqueCheck(const TSourceLoc& loc, const TType& type, const char* op)
|
||||
{
|
||||
if (containsFieldWithBasicType(type, EbtSampler))
|
||||
if (containsFieldWithBasicType(type, EbtSampler) && !extensionTurnedOn(E_GL_ARB_bindless_texture))
|
||||
error(loc, "can't use with samplers or structs containing samplers", op, "");
|
||||
}
|
||||
|
||||
@ -5206,7 +5364,7 @@ void TParseContext::inductiveLoopCheck(const TSourceLoc& loc, TIntermNode* init,
|
||||
bool badInit = false;
|
||||
if (! init || ! init->getAsAggregate() || init->getAsAggregate()->getSequence().size() != 1)
|
||||
badInit = true;
|
||||
TIntermBinary* binaryInit = 0;
|
||||
TIntermBinary* binaryInit = nullptr;
|
||||
if (! badInit) {
|
||||
// get the declaration assignment
|
||||
binaryInit = init->getAsAggregate()->getSequence()[0]->getAsBinaryNode();
|
||||
@ -5480,6 +5638,28 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
|
||||
intermediate.setUsePhysicalStorageBuffer();
|
||||
return;
|
||||
}
|
||||
if (id == "bindless_sampler") {
|
||||
requireExtensions(loc, 1, &E_GL_ARB_bindless_texture, "bindless_sampler");
|
||||
publicType.qualifier.layoutBindlessSampler = true;
|
||||
intermediate.setBindlessTextureMode(currentCaller, AstRefTypeLayout);
|
||||
return;
|
||||
}
|
||||
if (id == "bindless_image") {
|
||||
requireExtensions(loc, 1, &E_GL_ARB_bindless_texture, "bindless_image");
|
||||
publicType.qualifier.layoutBindlessImage = true;
|
||||
intermediate.setBindlessImageMode(currentCaller, AstRefTypeLayout);
|
||||
return;
|
||||
}
|
||||
if (id == "bound_sampler") {
|
||||
requireExtensions(loc, 1, &E_GL_ARB_bindless_texture, "bound_sampler");
|
||||
publicType.qualifier.layoutBindlessSampler = false;
|
||||
return;
|
||||
}
|
||||
if (id == "bound_image") {
|
||||
requireExtensions(loc, 1, &E_GL_ARB_bindless_texture, "bound_image");
|
||||
publicType.qualifier.layoutBindlessImage = false;
|
||||
return;
|
||||
}
|
||||
if (language == EShLangGeometry || language == EShLangTessEvaluation || language == EShLangMesh) {
|
||||
if (id == TQualifier::getGeometryString(ElgTriangles)) {
|
||||
publicType.shaderQualifiers.geometry = ElgTriangles;
|
||||
@ -5604,6 +5784,22 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
|
||||
publicType.shaderQualifiers.postDepthCoverage = true;
|
||||
return;
|
||||
}
|
||||
/* id is transformed into lower case in the beginning of this function. */
|
||||
if (id == "non_coherent_color_attachment_readext") {
|
||||
requireExtensions(loc, 1, &E_GL_EXT_shader_tile_image, "non_coherent_color_attachment_readEXT");
|
||||
publicType.shaderQualifiers.nonCoherentColorAttachmentReadEXT = true;
|
||||
return;
|
||||
}
|
||||
if (id == "non_coherent_depth_attachment_readext") {
|
||||
requireExtensions(loc, 1, &E_GL_EXT_shader_tile_image, "non_coherent_depth_attachment_readEXT");
|
||||
publicType.shaderQualifiers.nonCoherentDepthAttachmentReadEXT = true;
|
||||
return;
|
||||
}
|
||||
if (id == "non_coherent_stencil_attachment_readext") {
|
||||
requireExtensions(loc, 1, &E_GL_EXT_shader_tile_image, "non_coherent_stencil_attachment_readEXT");
|
||||
publicType.shaderQualifiers.nonCoherentStencilAttachmentReadEXT = true;
|
||||
return;
|
||||
}
|
||||
for (TLayoutDepth depth = (TLayoutDepth)(EldNone + 1); depth < EldCount; depth = (TLayoutDepth)(depth+1)) {
|
||||
if (id == TQualifier::getLayoutDepthString(depth)) {
|
||||
requireProfile(loc, ECoreProfile | ECompatibilityProfile, "depth layout qualifier");
|
||||
@ -5674,6 +5870,10 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
|
||||
}
|
||||
publicType.qualifier.layoutShaderRecord = true;
|
||||
return;
|
||||
} else if (id == "hitobjectshaderrecordnv") {
|
||||
requireExtensions(loc, 1, &E_GL_NV_shader_invocation_reorder, "hitobject shader record NV");
|
||||
publicType.qualifier.layoutHitObjectShaderRecordNV = true;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
@ -6015,7 +6215,7 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
|
||||
if (language == EShLangMesh || language == EShLangTask) {
|
||||
requireExtensions(loc, Num_AEP_mesh_shader, AEP_mesh_shader, "gl_WorkGroupSize");
|
||||
} else {
|
||||
profileRequires(loc, EEsProfile, 310, 0, "gl_WorkGroupSize");
|
||||
profileRequires(loc, EEsProfile, 310, nullptr, "gl_WorkGroupSize");
|
||||
profileRequires(loc, ~EEsProfile, 430, E_GL_ARB_compute_shader, "gl_WorkGroupSize");
|
||||
}
|
||||
#endif
|
||||
@ -6137,10 +6337,16 @@ void TParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQualifie
|
||||
dst.layoutSecondaryViewportRelativeOffset = src.layoutSecondaryViewportRelativeOffset;
|
||||
if (src.layoutShaderRecord)
|
||||
dst.layoutShaderRecord = true;
|
||||
if (src.layoutBindlessSampler)
|
||||
dst.layoutBindlessSampler = true;
|
||||
if (src.layoutBindlessImage)
|
||||
dst.layoutBindlessImage = true;
|
||||
if (src.pervertexNV)
|
||||
dst.pervertexNV = true;
|
||||
if (src.pervertexEXT)
|
||||
dst.pervertexEXT = true;
|
||||
if (src.layoutHitObjectShaderRecordNV)
|
||||
dst.layoutHitObjectShaderRecordNV = true;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -6288,6 +6494,8 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
|
||||
case EvqBuffer:
|
||||
if (type.getBasicType() == EbtBlock)
|
||||
error(loc, "cannot apply to uniform or buffer block", "location", "");
|
||||
else if (type.getBasicType() == EbtSampler && type.getSampler().isAttachmentEXT())
|
||||
error(loc, "only applies to", "location", "%s with storage tileImageEXT", type.getBasicTypeString().c_str());
|
||||
break;
|
||||
case EvqtaskPayloadSharedEXT:
|
||||
error(loc, "cannot apply to taskPayloadSharedEXT", "location", "");
|
||||
@ -6298,8 +6506,11 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
|
||||
case EvqHitAttr:
|
||||
case EvqCallableData:
|
||||
case EvqCallableDataIn:
|
||||
case EvqHitObjectAttrNV:
|
||||
break;
|
||||
#endif
|
||||
case EvqTileImageEXT:
|
||||
break;
|
||||
default:
|
||||
error(loc, "can only apply to uniform, buffer, in, or out storage qualifiers", "location", "");
|
||||
break;
|
||||
@ -6309,10 +6520,10 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
|
||||
int repeated = intermediate.addUsedLocation(qualifier, type, typeCollision);
|
||||
if (repeated >= 0 && ! typeCollision)
|
||||
error(loc, "overlapping use of location", "location", "%d", repeated);
|
||||
// "fragment-shader outputs ... if two variables are placed within the same
|
||||
// "fragment-shader outputs/tileImageEXT ... if two variables are placed within the same
|
||||
// location, they must have the same underlying type (floating-point or integer)"
|
||||
if (typeCollision && language == EShLangFragment && qualifier.isPipeOutput())
|
||||
error(loc, "fragment outputs sharing the same location must be the same basic type", "location", "%d", repeated);
|
||||
if (typeCollision && language == EShLangFragment && (qualifier.isPipeOutput() || qualifier.storage == EvqTileImageEXT))
|
||||
error(loc, "fragment outputs or tileImageEXTs sharing the same location", "location", "%d must be the same basic type", repeated);
|
||||
}
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
@ -6396,7 +6607,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
|
||||
!qualifier.hasAttachment() &&
|
||||
!qualifier.hasBufferReference())
|
||||
error(loc, "uniform/buffer blocks require layout(binding=X)", "binding", "");
|
||||
else if (spvVersion.vulkan > 0 && type.getBasicType() == EbtSampler)
|
||||
else if (spvVersion.vulkan > 0 && type.getBasicType() == EbtSampler && !type.getSampler().isAttachmentEXT())
|
||||
error(loc, "sampler/texture/image requires layout(binding=X)", "binding", "");
|
||||
}
|
||||
}
|
||||
@ -6418,7 +6629,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
|
||||
|
||||
// Image format
|
||||
if (qualifier.hasFormat()) {
|
||||
if (! type.isImage())
|
||||
if (! type.isImage() && !intermediate.getBindlessImageMode())
|
||||
error(loc, "only apply to images", TQualifier::getLayoutFormatString(qualifier.getFormat()), "");
|
||||
else {
|
||||
if (type.getSampler().type == EbtFloat && qualifier.getFormat() > ElfFloatGuard)
|
||||
@ -6437,7 +6648,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (type.isImage() && ! qualifier.isWriteOnly()) {
|
||||
} else if (type.isImage() && ! qualifier.isWriteOnly() && !intermediate.getBindlessImageMode()) {
|
||||
const char *explanation = "image variables not declared 'writeonly' and without a format layout qualifier";
|
||||
requireProfile(loc, ECoreProfile | ECompatibilityProfile, explanation);
|
||||
profileRequires(loc, ECoreProfile | ECompatibilityProfile, 0, E_GL_EXT_shader_image_load_formatted, explanation);
|
||||
@ -6458,6 +6669,8 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
|
||||
|
||||
// input attachment
|
||||
if (type.isSubpass()) {
|
||||
if (extensionTurnedOn(E_GL_EXT_shader_tile_image))
|
||||
error(loc, "can not be used with GL_EXT_shader_tile_image enabled", type.getSampler().getString().c_str(), "");
|
||||
if (! qualifier.hasAttachment())
|
||||
error(loc, "requires an input_attachment_index layout qualifier", "subpass", "");
|
||||
} else {
|
||||
@ -6625,6 +6838,14 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier
|
||||
error(loc, "cannot be used with shaderRecordNV", "set", "");
|
||||
|
||||
}
|
||||
|
||||
if (qualifier.storage == EvqTileImageEXT) {
|
||||
if (qualifier.hasSet())
|
||||
error(loc, "cannot be used with tileImageEXT", "set", "");
|
||||
if (!qualifier.hasLocation())
|
||||
error(loc, "can only be used with an explicit location", "tileImageEXT", "");
|
||||
}
|
||||
|
||||
if (qualifier.storage == EvqHitAttr && qualifier.hasLayout()) {
|
||||
error(loc, "cannot apply layout qualifiers to hitAttributeNV variable", "hitAttributeNV", "");
|
||||
}
|
||||
@ -6664,6 +6885,12 @@ void TParseContext::checkNoShaderLayouts(const TSourceLoc& loc, const TShaderQua
|
||||
error(loc, message, "early_fragment_tests", "");
|
||||
if (shaderQualifiers.postDepthCoverage)
|
||||
error(loc, message, "post_depth_coverage", "");
|
||||
if (shaderQualifiers.nonCoherentColorAttachmentReadEXT)
|
||||
error(loc, message, "non_coherent_color_attachment_readEXT", "");
|
||||
if (shaderQualifiers.nonCoherentDepthAttachmentReadEXT)
|
||||
error(loc, message, "non_coherent_depth_attachment_readEXT", "");
|
||||
if (shaderQualifiers.nonCoherentStencilAttachmentReadEXT)
|
||||
error(loc, message, "non_coherent_stencil_attachment_readEXT", "");
|
||||
if (shaderQualifiers.primitives != TQualifier::layoutNotSet) {
|
||||
if (language == EShLangMesh)
|
||||
error(loc, message, "max_primitives", "");
|
||||
@ -7082,7 +7309,7 @@ TIntermTyped* TParseContext::vkRelaxedRemapFunctionCall(const TSourceLoc& loc, T
|
||||
realFunc.addParameter(TParameter().copyParam((*function)[i]));
|
||||
}
|
||||
|
||||
TParameter tmpP = { 0, &uintType };
|
||||
TParameter tmpP = { nullptr, &uintType };
|
||||
realFunc.addParameter(TParameter().copyParam(tmpP));
|
||||
arguments = intermediate.growAggregate(arguments, intermediate.addConstantUnion(1, loc, true));
|
||||
|
||||
@ -7099,7 +7326,7 @@ TIntermTyped* TParseContext::vkRelaxedRemapFunctionCall(const TSourceLoc& loc, T
|
||||
realFunc.addParameter(TParameter().copyParam((*function)[i]));
|
||||
}
|
||||
|
||||
TParameter tmpP = { 0, &uintType };
|
||||
TParameter tmpP = { nullptr, &uintType };
|
||||
realFunc.addParameter(TParameter().copyParam(tmpP));
|
||||
arguments = intermediate.growAggregate(arguments, intermediate.addConstantUnion(-1, loc, true));
|
||||
|
||||
@ -7253,7 +7480,10 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden
|
||||
if (initializer) {
|
||||
if (type.getBasicType() == EbtRayQuery) {
|
||||
error(loc, "ray queries can only be initialized by using the rayQueryInitializeEXT intrinsic:", "=", identifier.c_str());
|
||||
} else if (type.getBasicType() == EbtHitObjectNV) {
|
||||
error(loc, "hit objects cannot be initialized using initializers", "=", identifier.c_str());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (type.isCoopMat()) {
|
||||
@ -7745,12 +7975,14 @@ TIntermTyped* TParseContext::addConstructor(const TSourceLoc& loc, TIntermNode*
|
||||
// Combined texture-sampler constructors are completely semantic checked
|
||||
// in constructorTextureSamplerError()
|
||||
if (op == EOpConstructTextureSampler) {
|
||||
if (aggrNode->getSequence()[1]->getAsTyped()->getType().getSampler().shadow) {
|
||||
// Transfer depth into the texture (SPIR-V image) type, as a hint
|
||||
// for tools to know this texture/image is a depth image.
|
||||
aggrNode->getSequence()[0]->getAsTyped()->getWritableType().getSampler().shadow = true;
|
||||
if (aggrNode != nullptr) {
|
||||
if (aggrNode->getSequence()[1]->getAsTyped()->getType().getSampler().shadow) {
|
||||
// Transfer depth into the texture (SPIR-V image) type, as a hint
|
||||
// for tools to know this texture/image is a depth image.
|
||||
aggrNode->getSequence()[0]->getAsTyped()->getWritableType().getSampler().shadow = true;
|
||||
}
|
||||
return intermediate.setAggregateOperator(aggrNode, op, type, loc);
|
||||
}
|
||||
return intermediate.setAggregateOperator(aggrNode, op, type, loc);
|
||||
}
|
||||
|
||||
TTypeList::const_iterator memberTypes;
|
||||
@ -7885,6 +8117,16 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
|
||||
TIntermTyped* newNode = intermediate.addBuiltInFunctionCall(node->getLoc(), EOpConvPtrToUvec2, true, node,
|
||||
type);
|
||||
return newNode;
|
||||
} else if (node->getType().getBasicType() == EbtSampler) {
|
||||
requireExtensions(loc, 1, &E_GL_ARB_bindless_texture, "sampler conversion to uvec2");
|
||||
// force the basic type of the constructor param to uvec2, otherwise spv builder will
|
||||
// report some errors
|
||||
TIntermTyped* newSrcNode = intermediate.createConversion(EbtUint, node);
|
||||
newSrcNode->getAsTyped()->getWritableType().setVectorSize(2);
|
||||
|
||||
TIntermTyped* newNode =
|
||||
intermediate.addBuiltInFunctionCall(node->getLoc(), EOpConstructUVec2, false, newSrcNode, type);
|
||||
return newNode;
|
||||
}
|
||||
case EOpConstructUVec3:
|
||||
case EOpConstructUVec4:
|
||||
@ -7898,7 +8140,15 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
|
||||
case EOpConstructBool:
|
||||
basicOp = EOpConstructBool;
|
||||
break;
|
||||
|
||||
case EOpConstructTextureSampler:
|
||||
if ((node->getType().getBasicType() == EbtUint || node->getType().getBasicType() == EbtInt) &&
|
||||
node->getType().getVectorSize() == 2) {
|
||||
requireExtensions(loc, 1, &E_GL_ARB_bindless_texture, "ivec2/uvec2 convert to texture handle");
|
||||
// No matter ivec2 or uvec2, Set EOpPackUint2x32 just to generate an opBitcast op code
|
||||
TIntermTyped* newNode =
|
||||
intermediate.addBuiltInFunctionCall(node->getLoc(), EOpPackUint2x32, true, node, type);
|
||||
return newNode;
|
||||
}
|
||||
#ifndef GLSLANG_WEB
|
||||
|
||||
case EOpConstructDVec2:
|
||||
@ -8245,6 +8495,30 @@ void TParseContext::inheritMemoryQualifiers(const TQualifier& from, TQualifier&
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// Update qualifier layoutBindlessImage & layoutBindlessSampler on block member
|
||||
//
|
||||
void TParseContext::updateBindlessQualifier(TType& memberType)
|
||||
{
|
||||
if (memberType.containsSampler()) {
|
||||
if (memberType.isStruct()) {
|
||||
TTypeList* typeList = memberType.getWritableStruct();
|
||||
for (unsigned int member = 0; member < typeList->size(); ++member) {
|
||||
TType* subMemberType = (*typeList)[member].type;
|
||||
updateBindlessQualifier(*subMemberType);
|
||||
}
|
||||
}
|
||||
else if (memberType.getSampler().isImage()) {
|
||||
intermediate.setBindlessImageMode(currentCaller, AstRefTypeLayout);
|
||||
memberType.getQualifier().layoutBindlessImage = true;
|
||||
}
|
||||
else {
|
||||
intermediate.setBindlessTextureMode(currentCaller, AstRefTypeLayout);
|
||||
memberType.getQualifier().layoutBindlessSampler = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Do everything needed to add an interface block.
|
||||
//
|
||||
@ -8297,8 +8571,13 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con
|
||||
}
|
||||
}
|
||||
|
||||
if (memberType.containsOpaque())
|
||||
error(memberLoc, "member of block cannot be or contain a sampler, image, or atomic_uint type", typeList[member].type->getFieldName().c_str(), "");
|
||||
// For bindless texture, sampler can be declared as uniform/storage block member,
|
||||
if (memberType.containsOpaque()) {
|
||||
if (memberType.containsSampler() && extensionTurnedOn(E_GL_ARB_bindless_texture))
|
||||
updateBindlessQualifier(memberType);
|
||||
else
|
||||
error(memberLoc, "member of block cannot be or contain a sampler, image, or atomic_uint type", typeList[member].type->getFieldName().c_str(), "");
|
||||
}
|
||||
|
||||
if (memberType.containsCoopMat())
|
||||
error(memberLoc, "member of block cannot be or contain a cooperative matrix type", typeList[member].type->getFieldName().c_str(), "");
|
||||
@ -8631,6 +8910,10 @@ void TParseContext::blockStageIoCheck(const TSourceLoc& loc, const TQualifier& q
|
||||
profileRequires(loc, ~EEsProfile, 460, 2, extsrt, "callableDataInNV block");
|
||||
requireStage(loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInNV block");
|
||||
break;
|
||||
case EvqHitObjectAttrNV:
|
||||
profileRequires(loc, ~EEsProfile, 460, E_GL_NV_shader_invocation_reorder, "hitObjectAttributeNV block");
|
||||
requireStage(loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | EShLangMissMask), "hitObjectAttributeNV block");
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
error(loc, "only uniform, buffer, in, or out blocks are supported", blockName->c_str(), "");
|
||||
@ -8787,7 +9070,8 @@ void TParseContext::fixBlockUniformOffsets(TQualifier& qualifier, TTypeList& typ
|
||||
// "The specified offset must be a multiple
|
||||
// of the base alignment of the type of the block member it qualifies, or a compile-time error results."
|
||||
if (! IsMultipleOfPow2(memberQualifier.layoutOffset, memberAlignment))
|
||||
error(memberLoc, "must be a multiple of the member's alignment", "offset", "");
|
||||
error(memberLoc, "must be a multiple of the member's alignment", "offset",
|
||||
"(layout offset = %d | member alignment = %d)", memberQualifier.layoutOffset, memberAlignment);
|
||||
|
||||
// GLSL: "It is a compile-time error to specify an offset that is smaller than the offset of the previous
|
||||
// member in the block or that lies within the previous member of the block"
|
||||
@ -9216,6 +9500,24 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con
|
||||
else
|
||||
error(loc, "can only apply to 'in'", "post_coverage_coverage", "");
|
||||
}
|
||||
if (publicType.shaderQualifiers.nonCoherentColorAttachmentReadEXT) {
|
||||
if (publicType.qualifier.storage == EvqVaryingIn)
|
||||
intermediate.setNonCoherentColorAttachmentReadEXT();
|
||||
else
|
||||
error(loc, "can only apply to 'in'", "non_coherent_color_attachment_readEXT", "");
|
||||
}
|
||||
if (publicType.shaderQualifiers.nonCoherentDepthAttachmentReadEXT) {
|
||||
if (publicType.qualifier.storage == EvqVaryingIn)
|
||||
intermediate.setNonCoherentDepthAttachmentReadEXT();
|
||||
else
|
||||
error(loc, "can only apply to 'in'", "non_coherent_depth_attachment_readEXT", "");
|
||||
}
|
||||
if (publicType.shaderQualifiers.nonCoherentStencilAttachmentReadEXT) {
|
||||
if (publicType.qualifier.storage == EvqVaryingIn)
|
||||
intermediate.setNonCoherentStencilAttachmentReadEXT();
|
||||
else
|
||||
error(loc, "can only apply to 'in'", "non_coherent_stencil_attachment_readEXT", "");
|
||||
}
|
||||
if (publicType.shaderQualifiers.hasBlendEquation()) {
|
||||
if (publicType.qualifier.storage != EvqVaryingOut)
|
||||
error(loc, "can only apply to 'out'", "blend equation", "");
|
||||
@ -9472,4 +9774,38 @@ const TTypeList* TParseContext::recordStructCopy(TStructRecord& record, const TT
|
||||
return originStruct;
|
||||
}
|
||||
|
||||
TLayoutFormat TParseContext::mapLegacyLayoutFormat(TLayoutFormat legacyLayoutFormat, TBasicType imageType)
|
||||
{
|
||||
TLayoutFormat layoutFormat = ElfNone;
|
||||
if (imageType == EbtFloat) {
|
||||
switch (legacyLayoutFormat) {
|
||||
case ElfSize1x16: layoutFormat = ElfR16f; break;
|
||||
case ElfSize1x32: layoutFormat = ElfR32f; break;
|
||||
case ElfSize2x32: layoutFormat = ElfRg32f; break;
|
||||
case ElfSize4x32: layoutFormat = ElfRgba32f; break;
|
||||
default: break;
|
||||
}
|
||||
} else if (imageType == EbtUint) {
|
||||
switch (legacyLayoutFormat) {
|
||||
case ElfSize1x8: layoutFormat = ElfR8ui; break;
|
||||
case ElfSize1x16: layoutFormat = ElfR16ui; break;
|
||||
case ElfSize1x32: layoutFormat = ElfR32ui; break;
|
||||
case ElfSize2x32: layoutFormat = ElfRg32ui; break;
|
||||
case ElfSize4x32: layoutFormat = ElfRgba32ui; break;
|
||||
default: break;
|
||||
}
|
||||
} else if (imageType == EbtInt) {
|
||||
switch (legacyLayoutFormat) {
|
||||
case ElfSize1x8: layoutFormat = ElfR8i; break;
|
||||
case ElfSize1x16: layoutFormat = ElfR16i; break;
|
||||
case ElfSize1x32: layoutFormat = ElfR32i; break;
|
||||
case ElfSize2x32: layoutFormat = ElfRg32i; break;
|
||||
case ElfSize4x32: layoutFormat = ElfRgba32i; break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
return layoutFormat;
|
||||
}
|
||||
|
||||
} // end namespace glslang
|
||||
|
@ -95,6 +95,10 @@ public:
|
||||
globalUniformSet(TQualifier::layoutSetEnd),
|
||||
atomicCounterBlockSet(TQualifier::layoutSetEnd)
|
||||
{
|
||||
// use storage buffer on SPIR-V 1.3 and up
|
||||
if (spvVersion.spv >= EShTargetSpv_1_3)
|
||||
intermediate.setUseStorageBuffer();
|
||||
|
||||
if (entryPoint != nullptr)
|
||||
sourceEntryPointName = *entryPoint;
|
||||
}
|
||||
@ -393,7 +397,7 @@ public:
|
||||
void accStructCheck(const TSourceLoc & loc, const TType & type, const TString & identifier);
|
||||
void transparentOpaqueCheck(const TSourceLoc&, const TType&, const TString& identifier);
|
||||
void memberQualifierCheck(glslang::TPublicType&);
|
||||
void globalQualifierFixCheck(const TSourceLoc&, TQualifier&, bool isMemberCheck = false);
|
||||
void globalQualifierFixCheck(const TSourceLoc&, TQualifier&, bool isMemberCheck = false, const TPublicType* publicType = nullptr);
|
||||
void globalQualifierTypeCheck(const TSourceLoc&, const TQualifier&, const TPublicType&);
|
||||
bool structQualifierErrorCheck(const TSourceLoc&, const TPublicType& pType);
|
||||
void mergeQualifiers(const TSourceLoc&, TQualifier& dst, const TQualifier& src, bool force);
|
||||
@ -438,12 +442,12 @@ public:
|
||||
const TFunction* findFunction400(const TSourceLoc& loc, const TFunction& call, bool& builtIn);
|
||||
const TFunction* findFunctionExplicitTypes(const TSourceLoc& loc, const TFunction& call, bool& builtIn);
|
||||
void declareTypeDefaults(const TSourceLoc&, const TPublicType&);
|
||||
TIntermNode* declareVariable(const TSourceLoc&, TString& identifier, const TPublicType&, TArraySizes* typeArray = 0, TIntermTyped* initializer = 0);
|
||||
TIntermNode* declareVariable(const TSourceLoc&, TString& identifier, const TPublicType&, TArraySizes* typeArray = nullptr, TIntermTyped* initializer = nullptr);
|
||||
TIntermTyped* addConstructor(const TSourceLoc&, TIntermNode*, const TType&);
|
||||
TIntermTyped* constructAggregate(TIntermNode*, const TType&, int, const TSourceLoc&);
|
||||
TIntermTyped* constructBuiltIn(const TType&, TOperator, TIntermTyped*, const TSourceLoc&, bool subset);
|
||||
void inheritMemoryQualifiers(const TQualifier& from, TQualifier& to);
|
||||
void declareBlock(const TSourceLoc&, TTypeList& typeList, const TString* instanceName = 0, TArraySizes* arraySizes = 0);
|
||||
void declareBlock(const TSourceLoc&, TTypeList& typeList, const TString* instanceName = nullptr, TArraySizes* arraySizes = nullptr);
|
||||
void blockStorageRemap(const TSourceLoc&, const TString*, TQualifier&);
|
||||
void blockStageIoCheck(const TSourceLoc&, const TQualifier&);
|
||||
void blockQualifierCheck(const TSourceLoc&, const TQualifier&, bool instanceName);
|
||||
@ -456,9 +460,11 @@ public:
|
||||
void addQualifierToExisting(const TSourceLoc&, TQualifier, TIdentifierList&);
|
||||
void invariantCheck(const TSourceLoc&, const TQualifier&);
|
||||
void updateStandaloneQualifierDefaults(const TSourceLoc&, const TPublicType&);
|
||||
void updateBindlessQualifier(TType& memberType);
|
||||
void wrapupSwitchSubsequence(TIntermAggregate* statements, TIntermNode* branchNode);
|
||||
TIntermNode* addSwitch(const TSourceLoc&, TIntermTyped* expression, TIntermAggregate* body);
|
||||
const TTypeList* recordStructCopy(TStructRecord&, const TType*, const TType*);
|
||||
TLayoutFormat mapLegacyLayoutFormat(TLayoutFormat legacyLayoutFormat, TBasicType imageType);
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
TAttributeType attributeFromName(const TString& name) const;
|
||||
|
@ -267,8 +267,8 @@ void* TPoolAllocator::allocate(size_t numBytes)
|
||||
//
|
||||
size_t numBytesToAlloc = allocationSize + headerSkip;
|
||||
tHeader* memory = reinterpret_cast<tHeader*>(::new char[numBytesToAlloc]);
|
||||
if (memory == 0)
|
||||
return 0;
|
||||
if (memory == nullptr)
|
||||
return nullptr;
|
||||
|
||||
// Use placement-new to initialize header
|
||||
new(memory) tHeader(inUseList, (numBytesToAlloc + pageSize - 1) / pageSize);
|
||||
@ -289,8 +289,8 @@ void* TPoolAllocator::allocate(size_t numBytes)
|
||||
freeList = freeList->nextPage;
|
||||
} else {
|
||||
memory = reinterpret_cast<tHeader*>(::new char[pageSize]);
|
||||
if (memory == 0)
|
||||
return 0;
|
||||
if (memory == nullptr)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Use placement-new to initialize header
|
||||
@ -308,7 +308,7 @@ void* TPoolAllocator::allocate(size_t numBytes)
|
||||
//
|
||||
void TAllocation::checkAllocList() const
|
||||
{
|
||||
for (const TAllocation* alloc = this; alloc != 0; alloc = alloc->prevAlloc)
|
||||
for (const TAllocation* alloc = this; alloc != nullptr; alloc = alloc->prevAlloc)
|
||||
alloc->check();
|
||||
}
|
||||
|
||||
|
@ -343,6 +343,7 @@ void TScanContext::fillInKeywordMap()
|
||||
|
||||
(*KeywordMap)["const"] = CONST;
|
||||
(*KeywordMap)["uniform"] = UNIFORM;
|
||||
(*KeywordMap)["tileImageEXT"] = TILEIMAGEEXT;
|
||||
(*KeywordMap)["buffer"] = BUFFER;
|
||||
(*KeywordMap)["in"] = IN;
|
||||
(*KeywordMap)["out"] = OUT;
|
||||
@ -685,6 +686,10 @@ void TScanContext::fillInKeywordMap()
|
||||
(*KeywordMap)["texture2DRect"] = TEXTURE2DRECT;
|
||||
(*KeywordMap)["texture1DArray"] = TEXTURE1DARRAY;
|
||||
|
||||
(*KeywordMap)["attachmentEXT"] = ATTACHMENTEXT;
|
||||
(*KeywordMap)["iattachmentEXT"] = IATTACHMENTEXT;
|
||||
(*KeywordMap)["uattachmentEXT"] = UATTACHMENTEXT;
|
||||
|
||||
(*KeywordMap)["subpassInput"] = SUBPASSINPUT;
|
||||
(*KeywordMap)["subpassInputMS"] = SUBPASSINPUTMS;
|
||||
(*KeywordMap)["isubpassInput"] = ISUBPASSINPUT;
|
||||
@ -765,6 +770,9 @@ void TScanContext::fillInKeywordMap()
|
||||
(*KeywordMap)["icoopmatNV"] = ICOOPMATNV;
|
||||
(*KeywordMap)["ucoopmatNV"] = UCOOPMATNV;
|
||||
|
||||
(*KeywordMap)["hitObjectNV"] = HITOBJECTNV;
|
||||
(*KeywordMap)["hitObjectAttributeNV"] = HITOBJECTATTRNV;
|
||||
|
||||
ReservedSet = new std::unordered_set<const char*, str_hash, str_eq>;
|
||||
|
||||
ReservedSet->insert("common");
|
||||
@ -939,6 +947,7 @@ int TScanContext::tokenizeIdentifier()
|
||||
switch (keyword) {
|
||||
case CONST:
|
||||
case UNIFORM:
|
||||
case TILEIMAGEEXT:
|
||||
case IN:
|
||||
case OUT:
|
||||
case INOUT:
|
||||
@ -1655,6 +1664,9 @@ int TScanContext::tokenizeIdentifier()
|
||||
case ISUBPASSINPUTMS:
|
||||
case USUBPASSINPUT:
|
||||
case USUBPASSINPUTMS:
|
||||
case ATTACHMENTEXT:
|
||||
case IATTACHMENTEXT:
|
||||
case UATTACHMENTEXT:
|
||||
if (parseContext.spvVersion.vulkan > 0)
|
||||
return keyword;
|
||||
else
|
||||
@ -1789,6 +1801,20 @@ int TScanContext::tokenizeIdentifier()
|
||||
parseContext.extensionTurnedOn(E_GL_EXT_spirv_intrinsics))
|
||||
return keyword;
|
||||
return identifierOrType();
|
||||
|
||||
case HITOBJECTNV:
|
||||
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||
(!parseContext.isEsProfile() && parseContext.version >= 460
|
||||
&& parseContext.extensionTurnedOn(E_GL_NV_shader_invocation_reorder)))
|
||||
return keyword;
|
||||
return identifierOrType();
|
||||
|
||||
case HITOBJECTATTRNV:
|
||||
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||
(!parseContext.isEsProfile() && parseContext.version >= 460
|
||||
&& parseContext.extensionTurnedOn(E_GL_NV_shader_invocation_reorder)))
|
||||
return keyword;
|
||||
return identifierOrType();
|
||||
#endif
|
||||
|
||||
default:
|
||||
|
@ -1357,7 +1357,7 @@ int ShInitialize()
|
||||
ShHandle ShConstructCompiler(const EShLanguage language, int debugOptions)
|
||||
{
|
||||
if (!InitThread())
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
TShHandleBase* base = static_cast<TShHandleBase*>(ConstructCompiler(language, debugOptions));
|
||||
|
||||
@ -1367,7 +1367,7 @@ ShHandle ShConstructCompiler(const EShLanguage language, int debugOptions)
|
||||
ShHandle ShConstructLinker(const EShExecutable executable, int debugOptions)
|
||||
{
|
||||
if (!InitThread())
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
TShHandleBase* base = static_cast<TShHandleBase*>(ConstructLinker(executable, debugOptions));
|
||||
|
||||
@ -1377,7 +1377,7 @@ ShHandle ShConstructLinker(const EShExecutable executable, int debugOptions)
|
||||
ShHandle ShConstructUniformMap()
|
||||
{
|
||||
if (!InitThread())
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
TShHandleBase* base = static_cast<TShHandleBase*>(ConstructUniformMap());
|
||||
|
||||
@ -1386,7 +1386,7 @@ ShHandle ShConstructUniformMap()
|
||||
|
||||
void ShDestruct(ShHandle handle)
|
||||
{
|
||||
if (handle == 0)
|
||||
if (handle == nullptr)
|
||||
return;
|
||||
|
||||
TShHandleBase* base = static_cast<TShHandleBase*>(handle);
|
||||
@ -1419,7 +1419,7 @@ int ShFinalize()
|
||||
for (int source = 0; source < SourceCount; ++source) {
|
||||
for (int stage = 0; stage < EShLangCount; ++stage) {
|
||||
delete SharedSymbolTables[version][spvVersion][p][source][stage];
|
||||
SharedSymbolTables[version][spvVersion][p][source][stage] = 0;
|
||||
SharedSymbolTables[version][spvVersion][p][source][stage] = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1432,7 +1432,7 @@ int ShFinalize()
|
||||
for (int source = 0; source < SourceCount; ++source) {
|
||||
for (int pc = 0; pc < EPcCount; ++pc) {
|
||||
delete CommonSymbolTable[version][spvVersion][p][source][pc];
|
||||
CommonSymbolTable[version][spvVersion][p][source][pc] = 0;
|
||||
CommonSymbolTable[version][spvVersion][p][source][pc] = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1475,12 +1475,12 @@ int ShCompile(
|
||||
)
|
||||
{
|
||||
// Map the generic handle to the C++ object
|
||||
if (handle == 0)
|
||||
if (handle == nullptr)
|
||||
return 0;
|
||||
|
||||
TShHandleBase* base = reinterpret_cast<TShHandleBase*>(handle);
|
||||
TCompiler* compiler = base->getAsCompiler();
|
||||
if (compiler == 0)
|
||||
if (compiler == nullptr)
|
||||
return 0;
|
||||
|
||||
SetThreadPoolAllocator(compiler->getPool());
|
||||
@ -1520,13 +1520,13 @@ int ShLinkExt(
|
||||
const ShHandle compHandles[],
|
||||
const int numHandles)
|
||||
{
|
||||
if (linkHandle == 0 || numHandles == 0)
|
||||
if (linkHandle == nullptr || numHandles == 0)
|
||||
return 0;
|
||||
|
||||
THandleList cObjects;
|
||||
|
||||
for (int i = 0; i < numHandles; ++i) {
|
||||
if (compHandles[i] == 0)
|
||||
if (compHandles[i] == nullptr)
|
||||
return 0;
|
||||
TShHandleBase* base = reinterpret_cast<TShHandleBase*>(compHandles[i]);
|
||||
if (base->getAsLinker()) {
|
||||
@ -1535,18 +1535,17 @@ int ShLinkExt(
|
||||
if (base->getAsCompiler())
|
||||
cObjects.push_back(base->getAsCompiler());
|
||||
|
||||
if (cObjects[i] == 0)
|
||||
if (cObjects[i] == nullptr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
TShHandleBase* base = reinterpret_cast<TShHandleBase*>(linkHandle);
|
||||
TLinker* linker = static_cast<TLinker*>(base->getAsLinker());
|
||||
|
||||
SetThreadPoolAllocator(linker->getPool());
|
||||
|
||||
if (linker == 0)
|
||||
if (linker == nullptr)
|
||||
return 0;
|
||||
|
||||
|
||||
SetThreadPoolAllocator(linker->getPool());
|
||||
linker->infoSink.info.erase();
|
||||
|
||||
for (int i = 0; i < numHandles; ++i) {
|
||||
@ -1569,7 +1568,7 @@ int ShLinkExt(
|
||||
//
|
||||
void ShSetEncryptionMethod(ShHandle handle)
|
||||
{
|
||||
if (handle == 0)
|
||||
if (handle == nullptr)
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1578,8 +1577,8 @@ void ShSetEncryptionMethod(ShHandle handle)
|
||||
//
|
||||
const char* ShGetInfoLog(const ShHandle handle)
|
||||
{
|
||||
if (handle == 0)
|
||||
return 0;
|
||||
if (handle == nullptr)
|
||||
return nullptr;
|
||||
|
||||
TShHandleBase* base = static_cast<TShHandleBase*>(handle);
|
||||
TInfoSink* infoSink;
|
||||
@ -1589,7 +1588,7 @@ const char* ShGetInfoLog(const ShHandle handle)
|
||||
else if (base->getAsLinker())
|
||||
infoSink = &(base->getAsLinker()->getInfoSink());
|
||||
else
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
infoSink->info << infoSink->debug.c_str();
|
||||
return infoSink->info.c_str();
|
||||
@ -1601,14 +1600,14 @@ const char* ShGetInfoLog(const ShHandle handle)
|
||||
//
|
||||
const void* ShGetExecutable(const ShHandle handle)
|
||||
{
|
||||
if (handle == 0)
|
||||
return 0;
|
||||
if (handle == nullptr)
|
||||
return nullptr;
|
||||
|
||||
TShHandleBase* base = reinterpret_cast<TShHandleBase*>(handle);
|
||||
|
||||
TLinker* linker = static_cast<TLinker*>(base->getAsLinker());
|
||||
if (linker == 0)
|
||||
return 0;
|
||||
if (linker == nullptr)
|
||||
return nullptr;
|
||||
|
||||
return linker->getObjectCode();
|
||||
}
|
||||
@ -1623,13 +1622,13 @@ const void* ShGetExecutable(const ShHandle handle)
|
||||
//
|
||||
int ShSetVirtualAttributeBindings(const ShHandle handle, const ShBindingTable* table)
|
||||
{
|
||||
if (handle == 0)
|
||||
if (handle == nullptr)
|
||||
return 0;
|
||||
|
||||
TShHandleBase* base = reinterpret_cast<TShHandleBase*>(handle);
|
||||
TLinker* linker = static_cast<TLinker*>(base->getAsLinker());
|
||||
|
||||
if (linker == 0)
|
||||
if (linker == nullptr)
|
||||
return 0;
|
||||
|
||||
linker->setAppAttributeBindings(table);
|
||||
@ -1642,13 +1641,13 @@ int ShSetVirtualAttributeBindings(const ShHandle handle, const ShBindingTable* t
|
||||
//
|
||||
int ShSetFixedAttributeBindings(const ShHandle handle, const ShBindingTable* table)
|
||||
{
|
||||
if (handle == 0)
|
||||
if (handle == nullptr)
|
||||
return 0;
|
||||
|
||||
TShHandleBase* base = reinterpret_cast<TShHandleBase*>(handle);
|
||||
TLinker* linker = static_cast<TLinker*>(base->getAsLinker());
|
||||
|
||||
if (linker == 0)
|
||||
if (linker == nullptr)
|
||||
return 0;
|
||||
|
||||
linker->setFixedAttributeBindings(table);
|
||||
@ -1660,12 +1659,12 @@ int ShSetFixedAttributeBindings(const ShHandle handle, const ShBindingTable* tab
|
||||
//
|
||||
int ShExcludeAttributes(const ShHandle handle, int *attributes, int count)
|
||||
{
|
||||
if (handle == 0)
|
||||
if (handle == nullptr)
|
||||
return 0;
|
||||
|
||||
TShHandleBase* base = reinterpret_cast<TShHandleBase*>(handle);
|
||||
TLinker* linker = static_cast<TLinker*>(base->getAsLinker());
|
||||
if (linker == 0)
|
||||
if (linker == nullptr)
|
||||
return 0;
|
||||
|
||||
linker->setExcludedAttributes(attributes, count);
|
||||
@ -1681,12 +1680,12 @@ int ShExcludeAttributes(const ShHandle handle, int *attributes, int count)
|
||||
//
|
||||
int ShGetUniformLocation(const ShHandle handle, const char* name)
|
||||
{
|
||||
if (handle == 0)
|
||||
if (handle == nullptr)
|
||||
return -1;
|
||||
|
||||
TShHandleBase* base = reinterpret_cast<TShHandleBase*>(handle);
|
||||
TUniformMap* uniformMap= base->getAsUniformMap();
|
||||
if (uniformMap == 0)
|
||||
if (uniformMap == nullptr)
|
||||
return -1;
|
||||
|
||||
return uniformMap->getLocation(name);
|
||||
@ -1954,14 +1953,14 @@ const char* TShader::getInfoDebugLog()
|
||||
|
||||
TProgram::TProgram() :
|
||||
#if !defined(GLSLANG_WEB)
|
||||
reflection(0),
|
||||
reflection(nullptr),
|
||||
#endif
|
||||
linked(false)
|
||||
{
|
||||
pool = new TPoolAllocator;
|
||||
infoSink = new TInfoSink;
|
||||
for (int s = 0; s < EShLangCount; ++s) {
|
||||
intermediate[s] = 0;
|
||||
intermediate[s] = nullptr;
|
||||
newedIntermediate[s] = false;
|
||||
}
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ void TQualifier::setSpirvDecorateId(int decoration, const TIntermAggregate* args
|
||||
TVector<const TIntermTyped*> extraOperands;
|
||||
for (auto arg : args->getSequence()) {
|
||||
auto extraOperand = arg->getAsTyped();
|
||||
assert(extraOperand != nullptr && extraOperand->getQualifier().isConstant());
|
||||
assert(extraOperand != nullptr);
|
||||
extraOperands.push_back(extraOperand);
|
||||
}
|
||||
spirvDecorate->decorateIds[decoration] = extraOperands;
|
||||
@ -202,30 +202,29 @@ TString TQualifier::getSpirvDecorateQualifierString() const
|
||||
const auto appendStr = [&](const char* s) { qualifierString.append(s); };
|
||||
|
||||
const auto appendDecorate = [&](const TIntermTyped* constant) {
|
||||
auto& constArray = constant->getAsConstantUnion() != nullptr ? constant->getAsConstantUnion()->getConstArray()
|
||||
: constant->getAsSymbolNode()->getConstArray();
|
||||
if (constant->getBasicType() == EbtFloat) {
|
||||
float value = static_cast<float>(constArray[0].getDConst());
|
||||
appendFloat(value);
|
||||
if (constant->getAsConstantUnion()) {
|
||||
auto& constArray = constant->getAsConstantUnion()->getConstArray();
|
||||
if (constant->getBasicType() == EbtFloat) {
|
||||
float value = static_cast<float>(constArray[0].getDConst());
|
||||
appendFloat(value);
|
||||
} else if (constant->getBasicType() == EbtInt) {
|
||||
int value = constArray[0].getIConst();
|
||||
appendInt(value);
|
||||
} else if (constant->getBasicType() == EbtUint) {
|
||||
unsigned value = constArray[0].getUConst();
|
||||
appendUint(value);
|
||||
} else if (constant->getBasicType() == EbtBool) {
|
||||
bool value = constArray[0].getBConst();
|
||||
appendBool(value);
|
||||
} else if (constant->getBasicType() == EbtString) {
|
||||
const TString* value = constArray[0].getSConst();
|
||||
appendStr(value->c_str());
|
||||
} else
|
||||
assert(0);
|
||||
} else {
|
||||
assert(constant->getAsSymbolNode());
|
||||
appendStr(constant->getAsSymbolNode()->getName().c_str());
|
||||
}
|
||||
else if (constant->getBasicType() == EbtInt) {
|
||||
int value = constArray[0].getIConst();
|
||||
appendInt(value);
|
||||
}
|
||||
else if (constant->getBasicType() == EbtUint) {
|
||||
unsigned value = constArray[0].getUConst();
|
||||
appendUint(value);
|
||||
}
|
||||
else if (constant->getBasicType() == EbtBool) {
|
||||
bool value = constArray[0].getBConst();
|
||||
appendBool(value);
|
||||
}
|
||||
else if (constant->getBasicType() == EbtString) {
|
||||
const TString* value = constArray[0].getSConst();
|
||||
appendStr(value->c_str());
|
||||
}
|
||||
else
|
||||
assert(0);
|
||||
};
|
||||
|
||||
for (auto& decorate : spirvDecorate->decorates) {
|
||||
|
@ -78,6 +78,7 @@ void TType::buildMangledName(TString& mangledName) const
|
||||
case EbtAccStruct: mangledName += "as"; break;
|
||||
case EbtRayQuery: mangledName += "rq"; break;
|
||||
case EbtSpirvType: mangledName += "spv-t"; break;
|
||||
case EbtHitObjectNV: mangledName += "ho"; break;
|
||||
#endif
|
||||
case EbtSampler:
|
||||
switch (sampler.type) {
|
||||
@ -416,7 +417,7 @@ TAnonMember* TAnonMember::clone() const
|
||||
// copy of the original container.
|
||||
assert(0);
|
||||
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TSymbolTableLevel* TSymbolTableLevel::clone() const
|
||||
|
@ -84,7 +84,7 @@ typedef TVector<const char*> TExtensionList;
|
||||
class TSymbol {
|
||||
public:
|
||||
POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())
|
||||
explicit TSymbol(const TString *n) : name(n), uniqueId(0), extensions(0), writable(true) { }
|
||||
explicit TSymbol(const TString *n) : name(n), uniqueId(0), extensions(nullptr), writable(true) { }
|
||||
virtual TSymbol* clone() const = 0;
|
||||
virtual ~TSymbol() { } // rely on all symbol owned memory coming from the pool
|
||||
|
||||
@ -97,18 +97,18 @@ public:
|
||||
changeName(NewPoolTString(newName.c_str()));
|
||||
}
|
||||
virtual const TString& getMangledName() const { return getName(); }
|
||||
virtual TFunction* getAsFunction() { return 0; }
|
||||
virtual const TFunction* getAsFunction() const { return 0; }
|
||||
virtual TVariable* getAsVariable() { return 0; }
|
||||
virtual const TVariable* getAsVariable() const { return 0; }
|
||||
virtual const TAnonMember* getAsAnonMember() const { return 0; }
|
||||
virtual TFunction* getAsFunction() { return nullptr; }
|
||||
virtual const TFunction* getAsFunction() const { return nullptr; }
|
||||
virtual TVariable* getAsVariable() { return nullptr; }
|
||||
virtual const TVariable* getAsVariable() const { return nullptr; }
|
||||
virtual const TAnonMember* getAsAnonMember() const { return nullptr; }
|
||||
virtual const TType& getType() const = 0;
|
||||
virtual TType& getWritableType() = 0;
|
||||
virtual void setUniqueId(long long id) { uniqueId = id; }
|
||||
virtual long long getUniqueId() const { return uniqueId; }
|
||||
virtual void setExtensions(int numExts, const char* const exts[])
|
||||
{
|
||||
assert(extensions == 0);
|
||||
assert(extensions == nullptr);
|
||||
assert(numExts > 0);
|
||||
extensions = NewPoolObject(extensions);
|
||||
for (int e = 0; e < numExts; ++e)
|
||||
@ -229,7 +229,7 @@ struct TParameter {
|
||||
if (param.name)
|
||||
name = NewPoolTString(param.name->c_str());
|
||||
else
|
||||
name = 0;
|
||||
name = nullptr;
|
||||
type = param.type->clone();
|
||||
defaultValue = param.defaultValue;
|
||||
return *this;
|
||||
@ -243,7 +243,7 @@ struct TParameter {
|
||||
class TFunction : public TSymbol {
|
||||
public:
|
||||
explicit TFunction(TOperator o) :
|
||||
TSymbol(0),
|
||||
TSymbol(nullptr),
|
||||
op(o),
|
||||
defined(false), prototyped(false), implicitThis(false), illegalImplicitThis(false), defaultParamCount(0) { }
|
||||
TFunction(const TString *name, const TType& retType, TOperator tOp = EOpNull) :
|
||||
@ -319,6 +319,7 @@ public:
|
||||
|
||||
virtual TParameter& operator[](int i) { assert(writable); return parameters[i]; }
|
||||
virtual const TParameter& operator[](int i) const { return parameters[i]; }
|
||||
const TQualifier& getQualifier() const { return returnType.getQualifier(); }
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
virtual void setSpirvInstruction(const TSpirvInstruction& inst)
|
||||
@ -411,7 +412,7 @@ protected:
|
||||
class TSymbolTableLevel {
|
||||
public:
|
||||
POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())
|
||||
TSymbolTableLevel() : defaultPrecision(0), anonId(0), thisLevel(false) { }
|
||||
TSymbolTableLevel() : defaultPrecision(nullptr), anonId(0), thisLevel(false) { }
|
||||
~TSymbolTableLevel();
|
||||
|
||||
bool insert(const TString& name, TSymbol* symbol) {
|
||||
@ -493,7 +494,7 @@ public:
|
||||
{
|
||||
tLevel::const_iterator it = level.find(name);
|
||||
if (it == level.end())
|
||||
return 0;
|
||||
return nullptr;
|
||||
else
|
||||
return (*it).second;
|
||||
}
|
||||
@ -561,7 +562,7 @@ public:
|
||||
{
|
||||
// can call multiple times at one scope, will only latch on first call,
|
||||
// as we're tracking the previous scope's values, not the current values
|
||||
if (defaultPrecision != 0)
|
||||
if (defaultPrecision != nullptr)
|
||||
return;
|
||||
|
||||
defaultPrecision = new TPrecisionQualifier[EbtNumTypes];
|
||||
@ -573,7 +574,7 @@ public:
|
||||
{
|
||||
// can be called for table level pops that didn't set the
|
||||
// defaults
|
||||
if (defaultPrecision == 0 || p == 0)
|
||||
if (defaultPrecision == nullptr || p == nullptr)
|
||||
return;
|
||||
|
||||
for (int t = 0; t < EbtNumTypes; ++t)
|
||||
@ -622,7 +623,7 @@ public:
|
||||
|
||||
// don't deallocate levels passed in from elsewhere
|
||||
while (table.size() > adoptedLevels)
|
||||
pop(0);
|
||||
pop(nullptr);
|
||||
}
|
||||
|
||||
void adoptLevels(TSymbolTable& symTable)
|
||||
@ -783,7 +784,7 @@ public:
|
||||
|
||||
// Normal find of a symbol, that can optionally say whether the symbol was found
|
||||
// at a built-in level or the current top-scope level.
|
||||
TSymbol* find(const TString& name, bool* builtIn = 0, bool* currentScope = 0, int* thisDepthP = 0)
|
||||
TSymbol* find(const TString& name, bool* builtIn = nullptr, bool* currentScope = nullptr, int* thisDepthP = nullptr)
|
||||
{
|
||||
int level = currentLevel();
|
||||
TSymbol* symbol;
|
||||
@ -827,7 +828,7 @@ public:
|
||||
++thisDepth;
|
||||
symbol = table[level]->find(name);
|
||||
--level;
|
||||
} while (symbol == 0 && level >= 0);
|
||||
} while (symbol == nullptr && level >= 0);
|
||||
|
||||
if (! table[level + 1]->isThisLevel())
|
||||
thisDepth = 0;
|
||||
|
@ -227,6 +227,7 @@ void TParseVersions::initializeExtensionBehavior()
|
||||
extensionBehavior[E_GL_ARB_texture_query_lod] = EBhDisable;
|
||||
extensionBehavior[E_GL_ARB_vertex_attrib_64bit] = EBhDisable;
|
||||
extensionBehavior[E_GL_ARB_draw_instanced] = EBhDisable;
|
||||
extensionBehavior[E_GL_ARB_bindless_texture] = EBhDisable;
|
||||
extensionBehavior[E_GL_ARB_fragment_coord_conventions] = EBhDisable;
|
||||
|
||||
|
||||
@ -301,6 +302,11 @@ void TParseVersions::initializeExtensionBehavior()
|
||||
extensionBehavior[E_GL_NV_shader_sm_builtins] = EBhDisable;
|
||||
extensionBehavior[E_GL_NV_integer_cooperative_matrix] = EBhDisable;
|
||||
|
||||
extensionBehavior[E_GL_NV_shader_invocation_reorder] = EBhDisable;
|
||||
|
||||
// ARM
|
||||
extensionBehavior[E_GL_ARM_shader_core_builtins] = EBhDisable;
|
||||
|
||||
// AEP
|
||||
extensionBehavior[E_GL_ANDROID_extension_pack_es31a] = EBhDisable;
|
||||
extensionBehavior[E_GL_KHR_blend_equation_advanced] = EBhDisable;
|
||||
@ -348,6 +354,8 @@ void TParseVersions::initializeExtensionBehavior()
|
||||
extensionBehavior[E_GL_EXT_spirv_intrinsics] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_mesh_shader] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_opacity_micromap] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_ray_tracing_position_fetch] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_shader_tile_image] = EBhDisable;
|
||||
|
||||
// OVR extensions
|
||||
extensionBehavior[E_GL_OVR_multiview] = EBhDisable;
|
||||
@ -370,6 +378,9 @@ void TParseVersions::initializeExtensionBehavior()
|
||||
extensionBehavior[E_GL_EXT_shader_subgroup_extended_types_float16] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_shader_atomic_float] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_shader_atomic_float2] = EBhDisable;
|
||||
|
||||
// Record extensions not for spv.
|
||||
spvUnsupportedExt.push_back(E_GL_ARB_bindless_texture);
|
||||
}
|
||||
|
||||
#endif // GLSLANG_WEB
|
||||
@ -437,7 +448,6 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
|
||||
} else { // !isEsProfile()
|
||||
preamble =
|
||||
"#define GL_FRAGMENT_PRECISION_HIGH 1\n"
|
||||
"#define GL_ARB_texture_rectangle 1\n"
|
||||
"#define GL_ARB_shading_language_420pack 1\n"
|
||||
"#define GL_ARB_texture_gather 1\n"
|
||||
@ -477,6 +487,7 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
"#define GL_ARB_vertex_attrib_64bit 1\n"
|
||||
"#define GL_ARB_draw_instanced 1\n"
|
||||
"#define GL_ARB_fragment_coord_conventions 1\n"
|
||||
"#define GL_ARB_bindless_texture 1\n"
|
||||
"#define GL_EXT_shader_non_constant_global_initializers 1\n"
|
||||
"#define GL_EXT_shader_image_load_formatted 1\n"
|
||||
"#define GL_EXT_post_depth_coverage 1\n"
|
||||
@ -513,6 +524,7 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
"#define GL_EXT_ray_query 1\n"
|
||||
"#define GL_EXT_ray_flags_primitive_culling 1\n"
|
||||
"#define GL_EXT_ray_cull_mask 1\n"
|
||||
"#define GL_EXT_ray_tracing_position_fetch 1\n"
|
||||
"#define GL_EXT_spirv_intrinsics 1\n"
|
||||
"#define GL_EXT_mesh_shader 1\n"
|
||||
|
||||
@ -544,6 +556,7 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
"#define GL_NV_mesh_shader 1\n"
|
||||
"#define GL_NV_cooperative_matrix 1\n"
|
||||
"#define GL_NV_integer_cooperative_matrix 1\n"
|
||||
"#define GL_NV_shader_execution_reorder 1\n"
|
||||
|
||||
"#define GL_EXT_shader_explicit_arithmetic_types 1\n"
|
||||
"#define GL_EXT_shader_explicit_arithmetic_types_int8 1\n"
|
||||
@ -576,6 +589,10 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
preamble += "#define GL_EXT_null_initializer 1\n";
|
||||
preamble += "#define GL_EXT_subgroup_uniform_control_flow 1\n";
|
||||
}
|
||||
if (version >= 130) {
|
||||
preamble +="#define GL_FRAGMENT_PRECISION_HIGH 1\n";
|
||||
}
|
||||
|
||||
#endif // GLSLANG_WEB
|
||||
}
|
||||
|
||||
@ -1066,8 +1083,8 @@ void TParseVersions::checkExtensionStage(const TSourceLoc& loc, const char * con
|
||||
if (strcmp(extension, "GL_NV_mesh_shader") == 0) {
|
||||
requireStage(loc, (EShLanguageMask)(EShLangTaskMask | EShLangMeshMask | EShLangFragmentMask),
|
||||
"#extension GL_NV_mesh_shader");
|
||||
profileRequires(loc, ECoreProfile, 450, 0, "#extension GL_NV_mesh_shader");
|
||||
profileRequires(loc, EEsProfile, 320, 0, "#extension GL_NV_mesh_shader");
|
||||
profileRequires(loc, ECoreProfile, 450, nullptr, "#extension GL_NV_mesh_shader");
|
||||
profileRequires(loc, EEsProfile, 320, nullptr, "#extension GL_NV_mesh_shader");
|
||||
if (extensionTurnedOn(E_GL_EXT_mesh_shader)) {
|
||||
error(loc, "GL_EXT_mesh_shader is already turned on, and not allowed with", "#extension", extension);
|
||||
}
|
||||
@ -1075,8 +1092,8 @@ void TParseVersions::checkExtensionStage(const TSourceLoc& loc, const char * con
|
||||
else if (strcmp(extension, "GL_EXT_mesh_shader") == 0) {
|
||||
requireStage(loc, (EShLanguageMask)(EShLangTaskMask | EShLangMeshMask | EShLangFragmentMask),
|
||||
"#extension GL_EXT_mesh_shader");
|
||||
profileRequires(loc, ECoreProfile, 450, 0, "#extension GL_EXT_mesh_shader");
|
||||
profileRequires(loc, EEsProfile, 320, 0, "#extension GL_EXT_mesh_shader");
|
||||
profileRequires(loc, ECoreProfile, 450, nullptr, "#extension GL_EXT_mesh_shader");
|
||||
profileRequires(loc, EEsProfile, 320, nullptr, "#extension GL_EXT_mesh_shader");
|
||||
if (extensionTurnedOn(E_GL_NV_mesh_shader)) {
|
||||
error(loc, "GL_NV_mesh_shader is already turned on, and not allowed with", "#extension", extension);
|
||||
}
|
||||
@ -1099,6 +1116,13 @@ void TParseVersions::extensionRequires(const TSourceLoc &loc, const char * const
|
||||
minSpvVersion = iter->second;
|
||||
requireSpv(loc, extension, minSpvVersion);
|
||||
}
|
||||
|
||||
if (spvVersion.spv != 0){
|
||||
for (auto ext : spvUnsupportedExt){
|
||||
if (strcmp(extension, ext.c_str()) == 0)
|
||||
error(loc, "not allowed when using generating SPIR-V codes", extension, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Call for any operation needing full GLSL integer data-type support.
|
||||
|
8
3rdparty/glslang/glslang/MachineIndependent/Versions.h
vendored
Normal file → Executable file
8
3rdparty/glslang/glslang/MachineIndependent/Versions.h
vendored
Normal file → Executable file
@ -163,6 +163,7 @@ const char* const E_GL_ARB_texture_query_lod = "GL_ARB_texture_query_
|
||||
const char* const E_GL_ARB_vertex_attrib_64bit = "GL_ARB_vertex_attrib_64bit";
|
||||
const char* const E_GL_ARB_draw_instanced = "GL_ARB_draw_instanced";
|
||||
const char* const E_GL_ARB_fragment_coord_conventions = "GL_ARB_fragment_coord_conventions";
|
||||
const char* const E_GL_ARB_bindless_texture = "GL_ARB_bindless_texture";
|
||||
|
||||
const char* const E_GL_KHR_shader_subgroup_basic = "GL_KHR_shader_subgroup_basic";
|
||||
const char* const E_GL_KHR_shader_subgroup_vote = "GL_KHR_shader_subgroup_vote";
|
||||
@ -264,6 +265,10 @@ const char* const E_GL_NV_fragment_shader_barycentric = "GL_NV_fragmen
|
||||
const char* const E_GL_NV_compute_shader_derivatives = "GL_NV_compute_shader_derivatives";
|
||||
const char* const E_GL_NV_shader_texture_footprint = "GL_NV_shader_texture_footprint";
|
||||
const char* const E_GL_NV_mesh_shader = "GL_NV_mesh_shader";
|
||||
const char* const E_GL_EXT_ray_tracing_position_fetch = "GL_EXT_ray_tracing_position_fetch";
|
||||
|
||||
// ARM
|
||||
const char* const E_GL_ARM_shader_core_builtins = "GL_ARM_shader_core_builtins";
|
||||
|
||||
// Arrays of extensions for the above viewportEXTs duplications
|
||||
|
||||
@ -273,6 +278,7 @@ const int Num_viewportEXTs = sizeof(viewportEXTs) / sizeof(viewportEXTs[0]);
|
||||
const char* const E_GL_NV_cooperative_matrix = "GL_NV_cooperative_matrix";
|
||||
const char* const E_GL_NV_shader_sm_builtins = "GL_NV_shader_sm_builtins";
|
||||
const char* const E_GL_NV_integer_cooperative_matrix = "GL_NV_integer_cooperative_matrix";
|
||||
const char* const E_GL_NV_shader_invocation_reorder = "GL_NV_shader_invocation_reorder";
|
||||
|
||||
// AEP
|
||||
const char* const E_GL_ANDROID_extension_pack_es31a = "GL_ANDROID_extension_pack_es31a";
|
||||
@ -322,6 +328,8 @@ const char* const E_GL_EXT_terminate_invocation = "GL_EXT_terminate_invocation";
|
||||
const char* const E_GL_EXT_shader_atomic_float = "GL_EXT_shader_atomic_float";
|
||||
const char* const E_GL_EXT_shader_atomic_float2 = "GL_EXT_shader_atomic_float2";
|
||||
|
||||
const char* const E_GL_EXT_shader_tile_image = "GL_EXT_shader_tile_image";
|
||||
|
||||
// Arrays of extensions for the above AEP duplications
|
||||
|
||||
const char* const AEP_geometry_shader[] = { E_GL_EXT_geometry_shader, E_GL_OES_geometry_shader };
|
||||
|
@ -211,6 +211,7 @@ GLSLANG_WEB_EXCLUDE_ON
|
||||
%token <lex> ACCSTRUCTEXT
|
||||
%token <lex> RAYQUERYEXT
|
||||
%token <lex> FCOOPMATNV ICOOPMATNV UCOOPMATNV
|
||||
%token <lex> HITOBJECTNV HITOBJECTATTRNV
|
||||
|
||||
// combined image/sampler
|
||||
%token <lex> SAMPLERCUBEARRAY SAMPLERCUBEARRAYSHADOW
|
||||
@ -278,6 +279,7 @@ GLSLANG_WEB_EXCLUDE_ON
|
||||
%token <lex> SPIRV_INSTRUCTION SPIRV_EXECUTION_MODE SPIRV_EXECUTION_MODE_ID
|
||||
%token <lex> SPIRV_DECORATE SPIRV_DECORATE_ID SPIRV_DECORATE_STRING
|
||||
%token <lex> SPIRV_TYPE SPIRV_STORAGE_CLASS SPIRV_BY_REFERENCE SPIRV_LITERAL
|
||||
%token <lex> ATTACHMENTEXT IATTACHMENTEXT UATTACHMENTEXT
|
||||
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
|
||||
@ -303,14 +305,14 @@ GLSLANG_WEB_EXCLUDE_OFF
|
||||
%token <lex> BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT
|
||||
%token <lex> TERMINATE_INVOCATION
|
||||
%token <lex> TERMINATE_RAY IGNORE_INTERSECTION
|
||||
%token <lex> UNIFORM SHARED BUFFER
|
||||
%token <lex> UNIFORM SHARED BUFFER TILEIMAGEEXT
|
||||
%token <lex> FLAT SMOOTH LAYOUT
|
||||
|
||||
GLSLANG_WEB_EXCLUDE_ON
|
||||
%token <lex> DOUBLECONSTANT INT16CONSTANT UINT16CONSTANT FLOAT16CONSTANT INT32CONSTANT UINT32CONSTANT
|
||||
%token <lex> INT64CONSTANT UINT64CONSTANT
|
||||
%token <lex> SUBROUTINE DEMOTE
|
||||
%token <lex> PAYLOADNV PAYLOADINNV HITATTRNV CALLDATANV CALLDATAINNV
|
||||
%token <lex> PAYLOADNV PAYLOADINNV HITATTRNV CALLDATANV CALLDATAINNV
|
||||
%token <lex> PAYLOADEXT PAYLOADINEXT HITATTREXT CALLDATAEXT CALLDATAINEXT
|
||||
%token <lex> PATCH SAMPLE NONUNIFORM
|
||||
%token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY DEVICECOHERENT QUEUEFAMILYCOHERENT WORKGROUPCOHERENT
|
||||
@ -377,7 +379,7 @@ GLSLANG_WEB_EXCLUDE_ON
|
||||
%type <interm.type> spirv_storage_class_qualifier
|
||||
%type <interm.type> spirv_decorate_qualifier
|
||||
%type <interm.intermNode> spirv_decorate_parameter_list spirv_decorate_parameter
|
||||
%type <interm.intermNode> spirv_decorate_id_parameter_list
|
||||
%type <interm.intermNode> spirv_decorate_id_parameter_list spirv_decorate_id_parameter
|
||||
%type <interm.intermNode> spirv_decorate_string_parameter_list
|
||||
%type <interm.type> spirv_type_specifier
|
||||
%type <interm.spirvTypeParams> spirv_type_parameter_list spirv_type_parameter
|
||||
@ -1218,7 +1220,7 @@ fully_specified_type
|
||||
parseContext.precisionQualifierCheck($$.loc, $$.basicType, $$.qualifier);
|
||||
}
|
||||
| type_qualifier type_specifier {
|
||||
parseContext.globalQualifierFixCheck($1.loc, $1.qualifier);
|
||||
parseContext.globalQualifierFixCheck($1.loc, $1.qualifier, false, &$2);
|
||||
parseContext.globalQualifierTypeCheck($1.loc, $1.qualifier, $2);
|
||||
|
||||
if ($2.arraySizes) {
|
||||
@ -1475,6 +1477,11 @@ storage_qualifier
|
||||
$$.init($1.loc);
|
||||
$$.qualifier.storage = EvqUniform;
|
||||
}
|
||||
| TILEIMAGEEXT {
|
||||
parseContext.globalCheck($1.loc, "tileImageEXT");
|
||||
$$.init($1.loc);
|
||||
$$.qualifier.storage = EvqTileImageEXT;
|
||||
}
|
||||
| SHARED {
|
||||
parseContext.globalCheck($1.loc, "shared");
|
||||
parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared");
|
||||
@ -1534,6 +1541,14 @@ GLSLANG_WEB_EXCLUDE_ON
|
||||
$$.init($1.loc);
|
||||
$$.qualifier.storage = EvqHitAttr;
|
||||
}
|
||||
| HITOBJECTATTRNV {
|
||||
parseContext.globalCheck($1.loc, "hitAttributeNV");
|
||||
parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask
|
||||
| EShLangMissMask), "hitObjectAttributeNV");
|
||||
parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_shader_invocation_reorder, "hitObjectAttributeNV");
|
||||
$$.init($1.loc);
|
||||
$$.qualifier.storage = EvqHitObjectAttrNV;
|
||||
}
|
||||
| HITATTREXT {
|
||||
parseContext.globalCheck($1.loc, "hitAttributeEXT");
|
||||
parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask
|
||||
@ -3437,6 +3452,24 @@ GLSLANG_WEB_EXCLUDE_ON
|
||||
$$.sampler.set(EbtFloat, Esd2D);
|
||||
$$.sampler.yuv = true;
|
||||
}
|
||||
| ATTACHMENTEXT {
|
||||
parseContext.requireStage($1.loc, EShLangFragment, "attachmentEXT input");
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtSampler;
|
||||
$$.sampler.setAttachmentEXT(EbtFloat);
|
||||
}
|
||||
| IATTACHMENTEXT {
|
||||
parseContext.requireStage($1.loc, EShLangFragment, "attachmentEXT input");
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtSampler;
|
||||
$$.sampler.setAttachmentEXT(EbtInt);
|
||||
}
|
||||
| UATTACHMENTEXT {
|
||||
parseContext.requireStage($1.loc, EShLangFragment, "attachmentEXT input");
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtSampler;
|
||||
$$.sampler.setAttachmentEXT(EbtUint);
|
||||
}
|
||||
| SUBPASSINPUT {
|
||||
parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
@ -3509,6 +3542,10 @@ GLSLANG_WEB_EXCLUDE_ON
|
||||
parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V type specifier");
|
||||
$$ = $1;
|
||||
}
|
||||
| HITOBJECTNV {
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtHitObjectNV;
|
||||
}
|
||||
GLSLANG_WEB_EXCLUDE_OFF
|
||||
| struct_specifier {
|
||||
$$ = $1;
|
||||
@ -4334,23 +4371,33 @@ spirv_decorate_parameter
|
||||
}
|
||||
|
||||
spirv_decorate_id_parameter_list
|
||||
: constant_expression {
|
||||
if ($1->getBasicType() != EbtFloat &&
|
||||
$1->getBasicType() != EbtInt &&
|
||||
$1->getBasicType() != EbtUint &&
|
||||
$1->getBasicType() != EbtBool)
|
||||
parseContext.error($1->getLoc(), "this type not allowed", $1->getType().getBasicString(), "");
|
||||
: spirv_decorate_id_parameter {
|
||||
$$ = parseContext.intermediate.makeAggregate($1);
|
||||
}
|
||||
| spirv_decorate_id_parameter_list COMMA constant_expression {
|
||||
if ($3->getBasicType() != EbtFloat &&
|
||||
$3->getBasicType() != EbtInt &&
|
||||
$3->getBasicType() != EbtUint &&
|
||||
$3->getBasicType() != EbtBool)
|
||||
parseContext.error($3->getLoc(), "this type not allowed", $3->getType().getBasicString(), "");
|
||||
| spirv_decorate_id_parameter_list COMMA spirv_decorate_id_parameter {
|
||||
$$ = parseContext.intermediate.growAggregate($1, $3);
|
||||
}
|
||||
|
||||
spirv_decorate_id_parameter
|
||||
: variable_identifier {
|
||||
if ($1->getAsConstantUnion() || $1->getAsSymbolNode())
|
||||
$$ = $1;
|
||||
else
|
||||
parseContext.error($1->getLoc(), "only allow constants or variables which are not elements of a composite", "", "");
|
||||
}
|
||||
| FLOATCONSTANT {
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true);
|
||||
}
|
||||
| INTCONSTANT {
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true);
|
||||
}
|
||||
| UINTCONSTANT {
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true);
|
||||
}
|
||||
| BOOLCONSTANT {
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true);
|
||||
}
|
||||
|
||||
spirv_decorate_string_parameter_list
|
||||
: STRING_LITERAL {
|
||||
$$ = parseContext.intermediate.makeAggregate(
|
||||
|
@ -151,7 +151,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
||||
|
||||
%parse-param {glslang::TParseContext* pParseContext}
|
||||
%lex-param {parseContext}
|
||||
%define api.pure // enable thread safety
|
||||
%pure-parser // enable thread safety
|
||||
%expect 1 // One shift reduce conflict because of if | else
|
||||
|
||||
%token <lex> CONST BOOL INT UINT FLOAT
|
||||
@ -211,6 +211,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
||||
%token <lex> ACCSTRUCTEXT
|
||||
%token <lex> RAYQUERYEXT
|
||||
%token <lex> FCOOPMATNV ICOOPMATNV UCOOPMATNV
|
||||
%token <lex> HITOBJECTNV HITOBJECTATTRNV
|
||||
|
||||
// combined image/sampler
|
||||
%token <lex> SAMPLERCUBEARRAY SAMPLERCUBEARRAYSHADOW
|
||||
@ -278,6 +279,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
||||
%token <lex> SPIRV_INSTRUCTION SPIRV_EXECUTION_MODE SPIRV_EXECUTION_MODE_ID
|
||||
%token <lex> SPIRV_DECORATE SPIRV_DECORATE_ID SPIRV_DECORATE_STRING
|
||||
%token <lex> SPIRV_TYPE SPIRV_STORAGE_CLASS SPIRV_BY_REFERENCE SPIRV_LITERAL
|
||||
%token <lex> ATTACHMENTEXT IATTACHMENTEXT UATTACHMENTEXT
|
||||
|
||||
|
||||
|
||||
@ -303,14 +305,14 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
||||
%token <lex> BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT
|
||||
%token <lex> TERMINATE_INVOCATION
|
||||
%token <lex> TERMINATE_RAY IGNORE_INTERSECTION
|
||||
%token <lex> UNIFORM SHARED BUFFER
|
||||
%token <lex> UNIFORM SHARED BUFFER TILEIMAGEEXT
|
||||
%token <lex> FLAT SMOOTH LAYOUT
|
||||
|
||||
|
||||
%token <lex> DOUBLECONSTANT INT16CONSTANT UINT16CONSTANT FLOAT16CONSTANT INT32CONSTANT UINT32CONSTANT
|
||||
%token <lex> INT64CONSTANT UINT64CONSTANT
|
||||
%token <lex> SUBROUTINE DEMOTE
|
||||
%token <lex> PAYLOADNV PAYLOADINNV HITATTRNV CALLDATANV CALLDATAINNV
|
||||
%token <lex> PAYLOADNV PAYLOADINNV HITATTRNV CALLDATANV CALLDATAINNV
|
||||
%token <lex> PAYLOADEXT PAYLOADINEXT HITATTREXT CALLDATAEXT CALLDATAINEXT
|
||||
%token <lex> PATCH SAMPLE NONUNIFORM
|
||||
%token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY DEVICECOHERENT QUEUEFAMILYCOHERENT WORKGROUPCOHERENT
|
||||
@ -377,7 +379,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
||||
%type <interm.type> spirv_storage_class_qualifier
|
||||
%type <interm.type> spirv_decorate_qualifier
|
||||
%type <interm.intermNode> spirv_decorate_parameter_list spirv_decorate_parameter
|
||||
%type <interm.intermNode> spirv_decorate_id_parameter_list
|
||||
%type <interm.intermNode> spirv_decorate_id_parameter_list spirv_decorate_id_parameter
|
||||
%type <interm.intermNode> spirv_decorate_string_parameter_list
|
||||
%type <interm.type> spirv_type_specifier
|
||||
%type <interm.spirvTypeParams> spirv_type_parameter_list spirv_type_parameter
|
||||
@ -1218,7 +1220,7 @@ fully_specified_type
|
||||
parseContext.precisionQualifierCheck($$.loc, $$.basicType, $$.qualifier);
|
||||
}
|
||||
| type_qualifier type_specifier {
|
||||
parseContext.globalQualifierFixCheck($1.loc, $1.qualifier);
|
||||
parseContext.globalQualifierFixCheck($1.loc, $1.qualifier, false, &$2);
|
||||
parseContext.globalQualifierTypeCheck($1.loc, $1.qualifier, $2);
|
||||
|
||||
if ($2.arraySizes) {
|
||||
@ -1475,6 +1477,11 @@ storage_qualifier
|
||||
$$.init($1.loc);
|
||||
$$.qualifier.storage = EvqUniform;
|
||||
}
|
||||
| TILEIMAGEEXT {
|
||||
parseContext.globalCheck($1.loc, "tileImageEXT");
|
||||
$$.init($1.loc);
|
||||
$$.qualifier.storage = EvqTileImageEXT;
|
||||
}
|
||||
| SHARED {
|
||||
parseContext.globalCheck($1.loc, "shared");
|
||||
parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared");
|
||||
@ -1534,6 +1541,14 @@ storage_qualifier
|
||||
$$.init($1.loc);
|
||||
$$.qualifier.storage = EvqHitAttr;
|
||||
}
|
||||
| HITOBJECTATTRNV {
|
||||
parseContext.globalCheck($1.loc, "hitAttributeNV");
|
||||
parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask
|
||||
| EShLangMissMask), "hitObjectAttributeNV");
|
||||
parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_shader_invocation_reorder, "hitObjectAttributeNV");
|
||||
$$.init($1.loc);
|
||||
$$.qualifier.storage = EvqHitObjectAttrNV;
|
||||
}
|
||||
| HITATTREXT {
|
||||
parseContext.globalCheck($1.loc, "hitAttributeEXT");
|
||||
parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask
|
||||
@ -3437,6 +3452,24 @@ type_specifier_nonarray
|
||||
$$.sampler.set(EbtFloat, Esd2D);
|
||||
$$.sampler.yuv = true;
|
||||
}
|
||||
| ATTACHMENTEXT {
|
||||
parseContext.requireStage($1.loc, EShLangFragment, "attachmentEXT input");
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtSampler;
|
||||
$$.sampler.setAttachmentEXT(EbtFloat);
|
||||
}
|
||||
| IATTACHMENTEXT {
|
||||
parseContext.requireStage($1.loc, EShLangFragment, "attachmentEXT input");
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtSampler;
|
||||
$$.sampler.setAttachmentEXT(EbtInt);
|
||||
}
|
||||
| UATTACHMENTEXT {
|
||||
parseContext.requireStage($1.loc, EShLangFragment, "attachmentEXT input");
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtSampler;
|
||||
$$.sampler.setAttachmentEXT(EbtUint);
|
||||
}
|
||||
| SUBPASSINPUT {
|
||||
parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
@ -3509,6 +3542,10 @@ type_specifier_nonarray
|
||||
parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V type specifier");
|
||||
$$ = $1;
|
||||
}
|
||||
| HITOBJECTNV {
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtHitObjectNV;
|
||||
}
|
||||
|
||||
| struct_specifier {
|
||||
$$ = $1;
|
||||
@ -4334,23 +4371,33 @@ spirv_decorate_parameter
|
||||
}
|
||||
|
||||
spirv_decorate_id_parameter_list
|
||||
: constant_expression {
|
||||
if ($1->getBasicType() != EbtFloat &&
|
||||
$1->getBasicType() != EbtInt &&
|
||||
$1->getBasicType() != EbtUint &&
|
||||
$1->getBasicType() != EbtBool)
|
||||
parseContext.error($1->getLoc(), "this type not allowed", $1->getType().getBasicString(), "");
|
||||
: spirv_decorate_id_parameter {
|
||||
$$ = parseContext.intermediate.makeAggregate($1);
|
||||
}
|
||||
| spirv_decorate_id_parameter_list COMMA constant_expression {
|
||||
if ($3->getBasicType() != EbtFloat &&
|
||||
$3->getBasicType() != EbtInt &&
|
||||
$3->getBasicType() != EbtUint &&
|
||||
$3->getBasicType() != EbtBool)
|
||||
parseContext.error($3->getLoc(), "this type not allowed", $3->getType().getBasicString(), "");
|
||||
| spirv_decorate_id_parameter_list COMMA spirv_decorate_id_parameter {
|
||||
$$ = parseContext.intermediate.growAggregate($1, $3);
|
||||
}
|
||||
|
||||
spirv_decorate_id_parameter
|
||||
: variable_identifier {
|
||||
if ($1->getAsConstantUnion() || $1->getAsSymbolNode())
|
||||
$$ = $1;
|
||||
else
|
||||
parseContext.error($1->getLoc(), "only allow constants or variables which are not elements of a composite", "", "");
|
||||
}
|
||||
| FLOATCONSTANT {
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true);
|
||||
}
|
||||
| INTCONSTANT {
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true);
|
||||
}
|
||||
| UINTCONSTANT {
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true);
|
||||
}
|
||||
| BOOLCONSTANT {
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true);
|
||||
}
|
||||
|
||||
spirv_decorate_string_parameter_list
|
||||
: STRING_LITERAL {
|
||||
$$ = parseContext.intermediate.makeAggregate(
|
||||
|
10843
3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp
vendored
10843
3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp
vendored
File diff suppressed because it is too large
Load Diff
@ -217,298 +217,304 @@ extern int yydebug;
|
||||
FCOOPMATNV = 418, /* FCOOPMATNV */
|
||||
ICOOPMATNV = 419, /* ICOOPMATNV */
|
||||
UCOOPMATNV = 420, /* UCOOPMATNV */
|
||||
SAMPLERCUBEARRAY = 421, /* SAMPLERCUBEARRAY */
|
||||
SAMPLERCUBEARRAYSHADOW = 422, /* SAMPLERCUBEARRAYSHADOW */
|
||||
ISAMPLERCUBEARRAY = 423, /* ISAMPLERCUBEARRAY */
|
||||
USAMPLERCUBEARRAY = 424, /* USAMPLERCUBEARRAY */
|
||||
SAMPLER1D = 425, /* SAMPLER1D */
|
||||
SAMPLER1DARRAY = 426, /* SAMPLER1DARRAY */
|
||||
SAMPLER1DARRAYSHADOW = 427, /* SAMPLER1DARRAYSHADOW */
|
||||
ISAMPLER1D = 428, /* ISAMPLER1D */
|
||||
SAMPLER1DSHADOW = 429, /* SAMPLER1DSHADOW */
|
||||
SAMPLER2DRECT = 430, /* SAMPLER2DRECT */
|
||||
SAMPLER2DRECTSHADOW = 431, /* SAMPLER2DRECTSHADOW */
|
||||
ISAMPLER2DRECT = 432, /* ISAMPLER2DRECT */
|
||||
USAMPLER2DRECT = 433, /* USAMPLER2DRECT */
|
||||
SAMPLERBUFFER = 434, /* SAMPLERBUFFER */
|
||||
ISAMPLERBUFFER = 435, /* ISAMPLERBUFFER */
|
||||
USAMPLERBUFFER = 436, /* USAMPLERBUFFER */
|
||||
SAMPLER2DMS = 437, /* SAMPLER2DMS */
|
||||
ISAMPLER2DMS = 438, /* ISAMPLER2DMS */
|
||||
USAMPLER2DMS = 439, /* USAMPLER2DMS */
|
||||
SAMPLER2DMSARRAY = 440, /* SAMPLER2DMSARRAY */
|
||||
ISAMPLER2DMSARRAY = 441, /* ISAMPLER2DMSARRAY */
|
||||
USAMPLER2DMSARRAY = 442, /* USAMPLER2DMSARRAY */
|
||||
SAMPLEREXTERNALOES = 443, /* SAMPLEREXTERNALOES */
|
||||
SAMPLEREXTERNAL2DY2YEXT = 444, /* SAMPLEREXTERNAL2DY2YEXT */
|
||||
ISAMPLER1DARRAY = 445, /* ISAMPLER1DARRAY */
|
||||
USAMPLER1D = 446, /* USAMPLER1D */
|
||||
USAMPLER1DARRAY = 447, /* USAMPLER1DARRAY */
|
||||
F16SAMPLER1D = 448, /* F16SAMPLER1D */
|
||||
F16SAMPLER2D = 449, /* F16SAMPLER2D */
|
||||
F16SAMPLER3D = 450, /* F16SAMPLER3D */
|
||||
F16SAMPLER2DRECT = 451, /* F16SAMPLER2DRECT */
|
||||
F16SAMPLERCUBE = 452, /* F16SAMPLERCUBE */
|
||||
F16SAMPLER1DARRAY = 453, /* F16SAMPLER1DARRAY */
|
||||
F16SAMPLER2DARRAY = 454, /* F16SAMPLER2DARRAY */
|
||||
F16SAMPLERCUBEARRAY = 455, /* F16SAMPLERCUBEARRAY */
|
||||
F16SAMPLERBUFFER = 456, /* F16SAMPLERBUFFER */
|
||||
F16SAMPLER2DMS = 457, /* F16SAMPLER2DMS */
|
||||
F16SAMPLER2DMSARRAY = 458, /* F16SAMPLER2DMSARRAY */
|
||||
F16SAMPLER1DSHADOW = 459, /* F16SAMPLER1DSHADOW */
|
||||
F16SAMPLER2DSHADOW = 460, /* F16SAMPLER2DSHADOW */
|
||||
F16SAMPLER1DARRAYSHADOW = 461, /* F16SAMPLER1DARRAYSHADOW */
|
||||
F16SAMPLER2DARRAYSHADOW = 462, /* F16SAMPLER2DARRAYSHADOW */
|
||||
F16SAMPLER2DRECTSHADOW = 463, /* F16SAMPLER2DRECTSHADOW */
|
||||
F16SAMPLERCUBESHADOW = 464, /* F16SAMPLERCUBESHADOW */
|
||||
F16SAMPLERCUBEARRAYSHADOW = 465, /* F16SAMPLERCUBEARRAYSHADOW */
|
||||
IMAGE1D = 466, /* IMAGE1D */
|
||||
IIMAGE1D = 467, /* IIMAGE1D */
|
||||
UIMAGE1D = 468, /* UIMAGE1D */
|
||||
IMAGE2D = 469, /* IMAGE2D */
|
||||
IIMAGE2D = 470, /* IIMAGE2D */
|
||||
UIMAGE2D = 471, /* UIMAGE2D */
|
||||
IMAGE3D = 472, /* IMAGE3D */
|
||||
IIMAGE3D = 473, /* IIMAGE3D */
|
||||
UIMAGE3D = 474, /* UIMAGE3D */
|
||||
IMAGE2DRECT = 475, /* IMAGE2DRECT */
|
||||
IIMAGE2DRECT = 476, /* IIMAGE2DRECT */
|
||||
UIMAGE2DRECT = 477, /* UIMAGE2DRECT */
|
||||
IMAGECUBE = 478, /* IMAGECUBE */
|
||||
IIMAGECUBE = 479, /* IIMAGECUBE */
|
||||
UIMAGECUBE = 480, /* UIMAGECUBE */
|
||||
IMAGEBUFFER = 481, /* IMAGEBUFFER */
|
||||
IIMAGEBUFFER = 482, /* IIMAGEBUFFER */
|
||||
UIMAGEBUFFER = 483, /* UIMAGEBUFFER */
|
||||
IMAGE1DARRAY = 484, /* IMAGE1DARRAY */
|
||||
IIMAGE1DARRAY = 485, /* IIMAGE1DARRAY */
|
||||
UIMAGE1DARRAY = 486, /* UIMAGE1DARRAY */
|
||||
IMAGE2DARRAY = 487, /* IMAGE2DARRAY */
|
||||
IIMAGE2DARRAY = 488, /* IIMAGE2DARRAY */
|
||||
UIMAGE2DARRAY = 489, /* UIMAGE2DARRAY */
|
||||
IMAGECUBEARRAY = 490, /* IMAGECUBEARRAY */
|
||||
IIMAGECUBEARRAY = 491, /* IIMAGECUBEARRAY */
|
||||
UIMAGECUBEARRAY = 492, /* UIMAGECUBEARRAY */
|
||||
IMAGE2DMS = 493, /* IMAGE2DMS */
|
||||
IIMAGE2DMS = 494, /* IIMAGE2DMS */
|
||||
UIMAGE2DMS = 495, /* UIMAGE2DMS */
|
||||
IMAGE2DMSARRAY = 496, /* IMAGE2DMSARRAY */
|
||||
IIMAGE2DMSARRAY = 497, /* IIMAGE2DMSARRAY */
|
||||
UIMAGE2DMSARRAY = 498, /* UIMAGE2DMSARRAY */
|
||||
F16IMAGE1D = 499, /* F16IMAGE1D */
|
||||
F16IMAGE2D = 500, /* F16IMAGE2D */
|
||||
F16IMAGE3D = 501, /* F16IMAGE3D */
|
||||
F16IMAGE2DRECT = 502, /* F16IMAGE2DRECT */
|
||||
F16IMAGECUBE = 503, /* F16IMAGECUBE */
|
||||
F16IMAGE1DARRAY = 504, /* F16IMAGE1DARRAY */
|
||||
F16IMAGE2DARRAY = 505, /* F16IMAGE2DARRAY */
|
||||
F16IMAGECUBEARRAY = 506, /* F16IMAGECUBEARRAY */
|
||||
F16IMAGEBUFFER = 507, /* F16IMAGEBUFFER */
|
||||
F16IMAGE2DMS = 508, /* F16IMAGE2DMS */
|
||||
F16IMAGE2DMSARRAY = 509, /* F16IMAGE2DMSARRAY */
|
||||
I64IMAGE1D = 510, /* I64IMAGE1D */
|
||||
U64IMAGE1D = 511, /* U64IMAGE1D */
|
||||
I64IMAGE2D = 512, /* I64IMAGE2D */
|
||||
U64IMAGE2D = 513, /* U64IMAGE2D */
|
||||
I64IMAGE3D = 514, /* I64IMAGE3D */
|
||||
U64IMAGE3D = 515, /* U64IMAGE3D */
|
||||
I64IMAGE2DRECT = 516, /* I64IMAGE2DRECT */
|
||||
U64IMAGE2DRECT = 517, /* U64IMAGE2DRECT */
|
||||
I64IMAGECUBE = 518, /* I64IMAGECUBE */
|
||||
U64IMAGECUBE = 519, /* U64IMAGECUBE */
|
||||
I64IMAGEBUFFER = 520, /* I64IMAGEBUFFER */
|
||||
U64IMAGEBUFFER = 521, /* U64IMAGEBUFFER */
|
||||
I64IMAGE1DARRAY = 522, /* I64IMAGE1DARRAY */
|
||||
U64IMAGE1DARRAY = 523, /* U64IMAGE1DARRAY */
|
||||
I64IMAGE2DARRAY = 524, /* I64IMAGE2DARRAY */
|
||||
U64IMAGE2DARRAY = 525, /* U64IMAGE2DARRAY */
|
||||
I64IMAGECUBEARRAY = 526, /* I64IMAGECUBEARRAY */
|
||||
U64IMAGECUBEARRAY = 527, /* U64IMAGECUBEARRAY */
|
||||
I64IMAGE2DMS = 528, /* I64IMAGE2DMS */
|
||||
U64IMAGE2DMS = 529, /* U64IMAGE2DMS */
|
||||
I64IMAGE2DMSARRAY = 530, /* I64IMAGE2DMSARRAY */
|
||||
U64IMAGE2DMSARRAY = 531, /* U64IMAGE2DMSARRAY */
|
||||
TEXTURECUBEARRAY = 532, /* TEXTURECUBEARRAY */
|
||||
ITEXTURECUBEARRAY = 533, /* ITEXTURECUBEARRAY */
|
||||
UTEXTURECUBEARRAY = 534, /* UTEXTURECUBEARRAY */
|
||||
TEXTURE1D = 535, /* TEXTURE1D */
|
||||
ITEXTURE1D = 536, /* ITEXTURE1D */
|
||||
UTEXTURE1D = 537, /* UTEXTURE1D */
|
||||
TEXTURE1DARRAY = 538, /* TEXTURE1DARRAY */
|
||||
ITEXTURE1DARRAY = 539, /* ITEXTURE1DARRAY */
|
||||
UTEXTURE1DARRAY = 540, /* UTEXTURE1DARRAY */
|
||||
TEXTURE2DRECT = 541, /* TEXTURE2DRECT */
|
||||
ITEXTURE2DRECT = 542, /* ITEXTURE2DRECT */
|
||||
UTEXTURE2DRECT = 543, /* UTEXTURE2DRECT */
|
||||
TEXTUREBUFFER = 544, /* TEXTUREBUFFER */
|
||||
ITEXTUREBUFFER = 545, /* ITEXTUREBUFFER */
|
||||
UTEXTUREBUFFER = 546, /* UTEXTUREBUFFER */
|
||||
TEXTURE2DMS = 547, /* TEXTURE2DMS */
|
||||
ITEXTURE2DMS = 548, /* ITEXTURE2DMS */
|
||||
UTEXTURE2DMS = 549, /* UTEXTURE2DMS */
|
||||
TEXTURE2DMSARRAY = 550, /* TEXTURE2DMSARRAY */
|
||||
ITEXTURE2DMSARRAY = 551, /* ITEXTURE2DMSARRAY */
|
||||
UTEXTURE2DMSARRAY = 552, /* UTEXTURE2DMSARRAY */
|
||||
F16TEXTURE1D = 553, /* F16TEXTURE1D */
|
||||
F16TEXTURE2D = 554, /* F16TEXTURE2D */
|
||||
F16TEXTURE3D = 555, /* F16TEXTURE3D */
|
||||
F16TEXTURE2DRECT = 556, /* F16TEXTURE2DRECT */
|
||||
F16TEXTURECUBE = 557, /* F16TEXTURECUBE */
|
||||
F16TEXTURE1DARRAY = 558, /* F16TEXTURE1DARRAY */
|
||||
F16TEXTURE2DARRAY = 559, /* F16TEXTURE2DARRAY */
|
||||
F16TEXTURECUBEARRAY = 560, /* F16TEXTURECUBEARRAY */
|
||||
F16TEXTUREBUFFER = 561, /* F16TEXTUREBUFFER */
|
||||
F16TEXTURE2DMS = 562, /* F16TEXTURE2DMS */
|
||||
F16TEXTURE2DMSARRAY = 563, /* F16TEXTURE2DMSARRAY */
|
||||
SUBPASSINPUT = 564, /* SUBPASSINPUT */
|
||||
SUBPASSINPUTMS = 565, /* SUBPASSINPUTMS */
|
||||
ISUBPASSINPUT = 566, /* ISUBPASSINPUT */
|
||||
ISUBPASSINPUTMS = 567, /* ISUBPASSINPUTMS */
|
||||
USUBPASSINPUT = 568, /* USUBPASSINPUT */
|
||||
USUBPASSINPUTMS = 569, /* USUBPASSINPUTMS */
|
||||
F16SUBPASSINPUT = 570, /* F16SUBPASSINPUT */
|
||||
F16SUBPASSINPUTMS = 571, /* F16SUBPASSINPUTMS */
|
||||
SPIRV_INSTRUCTION = 572, /* SPIRV_INSTRUCTION */
|
||||
SPIRV_EXECUTION_MODE = 573, /* SPIRV_EXECUTION_MODE */
|
||||
SPIRV_EXECUTION_MODE_ID = 574, /* SPIRV_EXECUTION_MODE_ID */
|
||||
SPIRV_DECORATE = 575, /* SPIRV_DECORATE */
|
||||
SPIRV_DECORATE_ID = 576, /* SPIRV_DECORATE_ID */
|
||||
SPIRV_DECORATE_STRING = 577, /* SPIRV_DECORATE_STRING */
|
||||
SPIRV_TYPE = 578, /* SPIRV_TYPE */
|
||||
SPIRV_STORAGE_CLASS = 579, /* SPIRV_STORAGE_CLASS */
|
||||
SPIRV_BY_REFERENCE = 580, /* SPIRV_BY_REFERENCE */
|
||||
SPIRV_LITERAL = 581, /* SPIRV_LITERAL */
|
||||
LEFT_OP = 582, /* LEFT_OP */
|
||||
RIGHT_OP = 583, /* RIGHT_OP */
|
||||
INC_OP = 584, /* INC_OP */
|
||||
DEC_OP = 585, /* DEC_OP */
|
||||
LE_OP = 586, /* LE_OP */
|
||||
GE_OP = 587, /* GE_OP */
|
||||
EQ_OP = 588, /* EQ_OP */
|
||||
NE_OP = 589, /* NE_OP */
|
||||
AND_OP = 590, /* AND_OP */
|
||||
OR_OP = 591, /* OR_OP */
|
||||
XOR_OP = 592, /* XOR_OP */
|
||||
MUL_ASSIGN = 593, /* MUL_ASSIGN */
|
||||
DIV_ASSIGN = 594, /* DIV_ASSIGN */
|
||||
ADD_ASSIGN = 595, /* ADD_ASSIGN */
|
||||
MOD_ASSIGN = 596, /* MOD_ASSIGN */
|
||||
LEFT_ASSIGN = 597, /* LEFT_ASSIGN */
|
||||
RIGHT_ASSIGN = 598, /* RIGHT_ASSIGN */
|
||||
AND_ASSIGN = 599, /* AND_ASSIGN */
|
||||
XOR_ASSIGN = 600, /* XOR_ASSIGN */
|
||||
OR_ASSIGN = 601, /* OR_ASSIGN */
|
||||
SUB_ASSIGN = 602, /* SUB_ASSIGN */
|
||||
STRING_LITERAL = 603, /* STRING_LITERAL */
|
||||
LEFT_PAREN = 604, /* LEFT_PAREN */
|
||||
RIGHT_PAREN = 605, /* RIGHT_PAREN */
|
||||
LEFT_BRACKET = 606, /* LEFT_BRACKET */
|
||||
RIGHT_BRACKET = 607, /* RIGHT_BRACKET */
|
||||
LEFT_BRACE = 608, /* LEFT_BRACE */
|
||||
RIGHT_BRACE = 609, /* RIGHT_BRACE */
|
||||
DOT = 610, /* DOT */
|
||||
COMMA = 611, /* COMMA */
|
||||
COLON = 612, /* COLON */
|
||||
EQUAL = 613, /* EQUAL */
|
||||
SEMICOLON = 614, /* SEMICOLON */
|
||||
BANG = 615, /* BANG */
|
||||
DASH = 616, /* DASH */
|
||||
TILDE = 617, /* TILDE */
|
||||
PLUS = 618, /* PLUS */
|
||||
STAR = 619, /* STAR */
|
||||
SLASH = 620, /* SLASH */
|
||||
PERCENT = 621, /* PERCENT */
|
||||
LEFT_ANGLE = 622, /* LEFT_ANGLE */
|
||||
RIGHT_ANGLE = 623, /* RIGHT_ANGLE */
|
||||
VERTICAL_BAR = 624, /* VERTICAL_BAR */
|
||||
CARET = 625, /* CARET */
|
||||
AMPERSAND = 626, /* AMPERSAND */
|
||||
QUESTION = 627, /* QUESTION */
|
||||
INVARIANT = 628, /* INVARIANT */
|
||||
HIGH_PRECISION = 629, /* HIGH_PRECISION */
|
||||
MEDIUM_PRECISION = 630, /* MEDIUM_PRECISION */
|
||||
LOW_PRECISION = 631, /* LOW_PRECISION */
|
||||
PRECISION = 632, /* PRECISION */
|
||||
PACKED = 633, /* PACKED */
|
||||
RESOURCE = 634, /* RESOURCE */
|
||||
SUPERP = 635, /* SUPERP */
|
||||
FLOATCONSTANT = 636, /* FLOATCONSTANT */
|
||||
INTCONSTANT = 637, /* INTCONSTANT */
|
||||
UINTCONSTANT = 638, /* UINTCONSTANT */
|
||||
BOOLCONSTANT = 639, /* BOOLCONSTANT */
|
||||
IDENTIFIER = 640, /* IDENTIFIER */
|
||||
TYPE_NAME = 641, /* TYPE_NAME */
|
||||
CENTROID = 642, /* CENTROID */
|
||||
IN = 643, /* IN */
|
||||
OUT = 644, /* OUT */
|
||||
INOUT = 645, /* INOUT */
|
||||
STRUCT = 646, /* STRUCT */
|
||||
VOID = 647, /* VOID */
|
||||
WHILE = 648, /* WHILE */
|
||||
BREAK = 649, /* BREAK */
|
||||
CONTINUE = 650, /* CONTINUE */
|
||||
DO = 651, /* DO */
|
||||
ELSE = 652, /* ELSE */
|
||||
FOR = 653, /* FOR */
|
||||
IF = 654, /* IF */
|
||||
DISCARD = 655, /* DISCARD */
|
||||
RETURN = 656, /* RETURN */
|
||||
SWITCH = 657, /* SWITCH */
|
||||
CASE = 658, /* CASE */
|
||||
DEFAULT = 659, /* DEFAULT */
|
||||
TERMINATE_INVOCATION = 660, /* TERMINATE_INVOCATION */
|
||||
TERMINATE_RAY = 661, /* TERMINATE_RAY */
|
||||
IGNORE_INTERSECTION = 662, /* IGNORE_INTERSECTION */
|
||||
UNIFORM = 663, /* UNIFORM */
|
||||
SHARED = 664, /* SHARED */
|
||||
BUFFER = 665, /* BUFFER */
|
||||
FLAT = 666, /* FLAT */
|
||||
SMOOTH = 667, /* SMOOTH */
|
||||
LAYOUT = 668, /* LAYOUT */
|
||||
DOUBLECONSTANT = 669, /* DOUBLECONSTANT */
|
||||
INT16CONSTANT = 670, /* INT16CONSTANT */
|
||||
UINT16CONSTANT = 671, /* UINT16CONSTANT */
|
||||
FLOAT16CONSTANT = 672, /* FLOAT16CONSTANT */
|
||||
INT32CONSTANT = 673, /* INT32CONSTANT */
|
||||
UINT32CONSTANT = 674, /* UINT32CONSTANT */
|
||||
INT64CONSTANT = 675, /* INT64CONSTANT */
|
||||
UINT64CONSTANT = 676, /* UINT64CONSTANT */
|
||||
SUBROUTINE = 677, /* SUBROUTINE */
|
||||
DEMOTE = 678, /* DEMOTE */
|
||||
PAYLOADNV = 679, /* PAYLOADNV */
|
||||
PAYLOADINNV = 680, /* PAYLOADINNV */
|
||||
HITATTRNV = 681, /* HITATTRNV */
|
||||
CALLDATANV = 682, /* CALLDATANV */
|
||||
CALLDATAINNV = 683, /* CALLDATAINNV */
|
||||
PAYLOADEXT = 684, /* PAYLOADEXT */
|
||||
PAYLOADINEXT = 685, /* PAYLOADINEXT */
|
||||
HITATTREXT = 686, /* HITATTREXT */
|
||||
CALLDATAEXT = 687, /* CALLDATAEXT */
|
||||
CALLDATAINEXT = 688, /* CALLDATAINEXT */
|
||||
PATCH = 689, /* PATCH */
|
||||
SAMPLE = 690, /* SAMPLE */
|
||||
NONUNIFORM = 691, /* NONUNIFORM */
|
||||
COHERENT = 692, /* COHERENT */
|
||||
VOLATILE = 693, /* VOLATILE */
|
||||
RESTRICT = 694, /* RESTRICT */
|
||||
READONLY = 695, /* READONLY */
|
||||
WRITEONLY = 696, /* WRITEONLY */
|
||||
DEVICECOHERENT = 697, /* DEVICECOHERENT */
|
||||
QUEUEFAMILYCOHERENT = 698, /* QUEUEFAMILYCOHERENT */
|
||||
WORKGROUPCOHERENT = 699, /* WORKGROUPCOHERENT */
|
||||
SUBGROUPCOHERENT = 700, /* SUBGROUPCOHERENT */
|
||||
NONPRIVATE = 701, /* NONPRIVATE */
|
||||
SHADERCALLCOHERENT = 702, /* SHADERCALLCOHERENT */
|
||||
NOPERSPECTIVE = 703, /* NOPERSPECTIVE */
|
||||
EXPLICITINTERPAMD = 704, /* EXPLICITINTERPAMD */
|
||||
PERVERTEXEXT = 705, /* PERVERTEXEXT */
|
||||
PERVERTEXNV = 706, /* PERVERTEXNV */
|
||||
PERPRIMITIVENV = 707, /* PERPRIMITIVENV */
|
||||
PERVIEWNV = 708, /* PERVIEWNV */
|
||||
PERTASKNV = 709, /* PERTASKNV */
|
||||
PERPRIMITIVEEXT = 710, /* PERPRIMITIVEEXT */
|
||||
TASKPAYLOADWORKGROUPEXT = 711, /* TASKPAYLOADWORKGROUPEXT */
|
||||
PRECISE = 712 /* PRECISE */
|
||||
HITOBJECTNV = 421, /* HITOBJECTNV */
|
||||
HITOBJECTATTRNV = 422, /* HITOBJECTATTRNV */
|
||||
SAMPLERCUBEARRAY = 423, /* SAMPLERCUBEARRAY */
|
||||
SAMPLERCUBEARRAYSHADOW = 424, /* SAMPLERCUBEARRAYSHADOW */
|
||||
ISAMPLERCUBEARRAY = 425, /* ISAMPLERCUBEARRAY */
|
||||
USAMPLERCUBEARRAY = 426, /* USAMPLERCUBEARRAY */
|
||||
SAMPLER1D = 427, /* SAMPLER1D */
|
||||
SAMPLER1DARRAY = 428, /* SAMPLER1DARRAY */
|
||||
SAMPLER1DARRAYSHADOW = 429, /* SAMPLER1DARRAYSHADOW */
|
||||
ISAMPLER1D = 430, /* ISAMPLER1D */
|
||||
SAMPLER1DSHADOW = 431, /* SAMPLER1DSHADOW */
|
||||
SAMPLER2DRECT = 432, /* SAMPLER2DRECT */
|
||||
SAMPLER2DRECTSHADOW = 433, /* SAMPLER2DRECTSHADOW */
|
||||
ISAMPLER2DRECT = 434, /* ISAMPLER2DRECT */
|
||||
USAMPLER2DRECT = 435, /* USAMPLER2DRECT */
|
||||
SAMPLERBUFFER = 436, /* SAMPLERBUFFER */
|
||||
ISAMPLERBUFFER = 437, /* ISAMPLERBUFFER */
|
||||
USAMPLERBUFFER = 438, /* USAMPLERBUFFER */
|
||||
SAMPLER2DMS = 439, /* SAMPLER2DMS */
|
||||
ISAMPLER2DMS = 440, /* ISAMPLER2DMS */
|
||||
USAMPLER2DMS = 441, /* USAMPLER2DMS */
|
||||
SAMPLER2DMSARRAY = 442, /* SAMPLER2DMSARRAY */
|
||||
ISAMPLER2DMSARRAY = 443, /* ISAMPLER2DMSARRAY */
|
||||
USAMPLER2DMSARRAY = 444, /* USAMPLER2DMSARRAY */
|
||||
SAMPLEREXTERNALOES = 445, /* SAMPLEREXTERNALOES */
|
||||
SAMPLEREXTERNAL2DY2YEXT = 446, /* SAMPLEREXTERNAL2DY2YEXT */
|
||||
ISAMPLER1DARRAY = 447, /* ISAMPLER1DARRAY */
|
||||
USAMPLER1D = 448, /* USAMPLER1D */
|
||||
USAMPLER1DARRAY = 449, /* USAMPLER1DARRAY */
|
||||
F16SAMPLER1D = 450, /* F16SAMPLER1D */
|
||||
F16SAMPLER2D = 451, /* F16SAMPLER2D */
|
||||
F16SAMPLER3D = 452, /* F16SAMPLER3D */
|
||||
F16SAMPLER2DRECT = 453, /* F16SAMPLER2DRECT */
|
||||
F16SAMPLERCUBE = 454, /* F16SAMPLERCUBE */
|
||||
F16SAMPLER1DARRAY = 455, /* F16SAMPLER1DARRAY */
|
||||
F16SAMPLER2DARRAY = 456, /* F16SAMPLER2DARRAY */
|
||||
F16SAMPLERCUBEARRAY = 457, /* F16SAMPLERCUBEARRAY */
|
||||
F16SAMPLERBUFFER = 458, /* F16SAMPLERBUFFER */
|
||||
F16SAMPLER2DMS = 459, /* F16SAMPLER2DMS */
|
||||
F16SAMPLER2DMSARRAY = 460, /* F16SAMPLER2DMSARRAY */
|
||||
F16SAMPLER1DSHADOW = 461, /* F16SAMPLER1DSHADOW */
|
||||
F16SAMPLER2DSHADOW = 462, /* F16SAMPLER2DSHADOW */
|
||||
F16SAMPLER1DARRAYSHADOW = 463, /* F16SAMPLER1DARRAYSHADOW */
|
||||
F16SAMPLER2DARRAYSHADOW = 464, /* F16SAMPLER2DARRAYSHADOW */
|
||||
F16SAMPLER2DRECTSHADOW = 465, /* F16SAMPLER2DRECTSHADOW */
|
||||
F16SAMPLERCUBESHADOW = 466, /* F16SAMPLERCUBESHADOW */
|
||||
F16SAMPLERCUBEARRAYSHADOW = 467, /* F16SAMPLERCUBEARRAYSHADOW */
|
||||
IMAGE1D = 468, /* IMAGE1D */
|
||||
IIMAGE1D = 469, /* IIMAGE1D */
|
||||
UIMAGE1D = 470, /* UIMAGE1D */
|
||||
IMAGE2D = 471, /* IMAGE2D */
|
||||
IIMAGE2D = 472, /* IIMAGE2D */
|
||||
UIMAGE2D = 473, /* UIMAGE2D */
|
||||
IMAGE3D = 474, /* IMAGE3D */
|
||||
IIMAGE3D = 475, /* IIMAGE3D */
|
||||
UIMAGE3D = 476, /* UIMAGE3D */
|
||||
IMAGE2DRECT = 477, /* IMAGE2DRECT */
|
||||
IIMAGE2DRECT = 478, /* IIMAGE2DRECT */
|
||||
UIMAGE2DRECT = 479, /* UIMAGE2DRECT */
|
||||
IMAGECUBE = 480, /* IMAGECUBE */
|
||||
IIMAGECUBE = 481, /* IIMAGECUBE */
|
||||
UIMAGECUBE = 482, /* UIMAGECUBE */
|
||||
IMAGEBUFFER = 483, /* IMAGEBUFFER */
|
||||
IIMAGEBUFFER = 484, /* IIMAGEBUFFER */
|
||||
UIMAGEBUFFER = 485, /* UIMAGEBUFFER */
|
||||
IMAGE1DARRAY = 486, /* IMAGE1DARRAY */
|
||||
IIMAGE1DARRAY = 487, /* IIMAGE1DARRAY */
|
||||
UIMAGE1DARRAY = 488, /* UIMAGE1DARRAY */
|
||||
IMAGE2DARRAY = 489, /* IMAGE2DARRAY */
|
||||
IIMAGE2DARRAY = 490, /* IIMAGE2DARRAY */
|
||||
UIMAGE2DARRAY = 491, /* UIMAGE2DARRAY */
|
||||
IMAGECUBEARRAY = 492, /* IMAGECUBEARRAY */
|
||||
IIMAGECUBEARRAY = 493, /* IIMAGECUBEARRAY */
|
||||
UIMAGECUBEARRAY = 494, /* UIMAGECUBEARRAY */
|
||||
IMAGE2DMS = 495, /* IMAGE2DMS */
|
||||
IIMAGE2DMS = 496, /* IIMAGE2DMS */
|
||||
UIMAGE2DMS = 497, /* UIMAGE2DMS */
|
||||
IMAGE2DMSARRAY = 498, /* IMAGE2DMSARRAY */
|
||||
IIMAGE2DMSARRAY = 499, /* IIMAGE2DMSARRAY */
|
||||
UIMAGE2DMSARRAY = 500, /* UIMAGE2DMSARRAY */
|
||||
F16IMAGE1D = 501, /* F16IMAGE1D */
|
||||
F16IMAGE2D = 502, /* F16IMAGE2D */
|
||||
F16IMAGE3D = 503, /* F16IMAGE3D */
|
||||
F16IMAGE2DRECT = 504, /* F16IMAGE2DRECT */
|
||||
F16IMAGECUBE = 505, /* F16IMAGECUBE */
|
||||
F16IMAGE1DARRAY = 506, /* F16IMAGE1DARRAY */
|
||||
F16IMAGE2DARRAY = 507, /* F16IMAGE2DARRAY */
|
||||
F16IMAGECUBEARRAY = 508, /* F16IMAGECUBEARRAY */
|
||||
F16IMAGEBUFFER = 509, /* F16IMAGEBUFFER */
|
||||
F16IMAGE2DMS = 510, /* F16IMAGE2DMS */
|
||||
F16IMAGE2DMSARRAY = 511, /* F16IMAGE2DMSARRAY */
|
||||
I64IMAGE1D = 512, /* I64IMAGE1D */
|
||||
U64IMAGE1D = 513, /* U64IMAGE1D */
|
||||
I64IMAGE2D = 514, /* I64IMAGE2D */
|
||||
U64IMAGE2D = 515, /* U64IMAGE2D */
|
||||
I64IMAGE3D = 516, /* I64IMAGE3D */
|
||||
U64IMAGE3D = 517, /* U64IMAGE3D */
|
||||
I64IMAGE2DRECT = 518, /* I64IMAGE2DRECT */
|
||||
U64IMAGE2DRECT = 519, /* U64IMAGE2DRECT */
|
||||
I64IMAGECUBE = 520, /* I64IMAGECUBE */
|
||||
U64IMAGECUBE = 521, /* U64IMAGECUBE */
|
||||
I64IMAGEBUFFER = 522, /* I64IMAGEBUFFER */
|
||||
U64IMAGEBUFFER = 523, /* U64IMAGEBUFFER */
|
||||
I64IMAGE1DARRAY = 524, /* I64IMAGE1DARRAY */
|
||||
U64IMAGE1DARRAY = 525, /* U64IMAGE1DARRAY */
|
||||
I64IMAGE2DARRAY = 526, /* I64IMAGE2DARRAY */
|
||||
U64IMAGE2DARRAY = 527, /* U64IMAGE2DARRAY */
|
||||
I64IMAGECUBEARRAY = 528, /* I64IMAGECUBEARRAY */
|
||||
U64IMAGECUBEARRAY = 529, /* U64IMAGECUBEARRAY */
|
||||
I64IMAGE2DMS = 530, /* I64IMAGE2DMS */
|
||||
U64IMAGE2DMS = 531, /* U64IMAGE2DMS */
|
||||
I64IMAGE2DMSARRAY = 532, /* I64IMAGE2DMSARRAY */
|
||||
U64IMAGE2DMSARRAY = 533, /* U64IMAGE2DMSARRAY */
|
||||
TEXTURECUBEARRAY = 534, /* TEXTURECUBEARRAY */
|
||||
ITEXTURECUBEARRAY = 535, /* ITEXTURECUBEARRAY */
|
||||
UTEXTURECUBEARRAY = 536, /* UTEXTURECUBEARRAY */
|
||||
TEXTURE1D = 537, /* TEXTURE1D */
|
||||
ITEXTURE1D = 538, /* ITEXTURE1D */
|
||||
UTEXTURE1D = 539, /* UTEXTURE1D */
|
||||
TEXTURE1DARRAY = 540, /* TEXTURE1DARRAY */
|
||||
ITEXTURE1DARRAY = 541, /* ITEXTURE1DARRAY */
|
||||
UTEXTURE1DARRAY = 542, /* UTEXTURE1DARRAY */
|
||||
TEXTURE2DRECT = 543, /* TEXTURE2DRECT */
|
||||
ITEXTURE2DRECT = 544, /* ITEXTURE2DRECT */
|
||||
UTEXTURE2DRECT = 545, /* UTEXTURE2DRECT */
|
||||
TEXTUREBUFFER = 546, /* TEXTUREBUFFER */
|
||||
ITEXTUREBUFFER = 547, /* ITEXTUREBUFFER */
|
||||
UTEXTUREBUFFER = 548, /* UTEXTUREBUFFER */
|
||||
TEXTURE2DMS = 549, /* TEXTURE2DMS */
|
||||
ITEXTURE2DMS = 550, /* ITEXTURE2DMS */
|
||||
UTEXTURE2DMS = 551, /* UTEXTURE2DMS */
|
||||
TEXTURE2DMSARRAY = 552, /* TEXTURE2DMSARRAY */
|
||||
ITEXTURE2DMSARRAY = 553, /* ITEXTURE2DMSARRAY */
|
||||
UTEXTURE2DMSARRAY = 554, /* UTEXTURE2DMSARRAY */
|
||||
F16TEXTURE1D = 555, /* F16TEXTURE1D */
|
||||
F16TEXTURE2D = 556, /* F16TEXTURE2D */
|
||||
F16TEXTURE3D = 557, /* F16TEXTURE3D */
|
||||
F16TEXTURE2DRECT = 558, /* F16TEXTURE2DRECT */
|
||||
F16TEXTURECUBE = 559, /* F16TEXTURECUBE */
|
||||
F16TEXTURE1DARRAY = 560, /* F16TEXTURE1DARRAY */
|
||||
F16TEXTURE2DARRAY = 561, /* F16TEXTURE2DARRAY */
|
||||
F16TEXTURECUBEARRAY = 562, /* F16TEXTURECUBEARRAY */
|
||||
F16TEXTUREBUFFER = 563, /* F16TEXTUREBUFFER */
|
||||
F16TEXTURE2DMS = 564, /* F16TEXTURE2DMS */
|
||||
F16TEXTURE2DMSARRAY = 565, /* F16TEXTURE2DMSARRAY */
|
||||
SUBPASSINPUT = 566, /* SUBPASSINPUT */
|
||||
SUBPASSINPUTMS = 567, /* SUBPASSINPUTMS */
|
||||
ISUBPASSINPUT = 568, /* ISUBPASSINPUT */
|
||||
ISUBPASSINPUTMS = 569, /* ISUBPASSINPUTMS */
|
||||
USUBPASSINPUT = 570, /* USUBPASSINPUT */
|
||||
USUBPASSINPUTMS = 571, /* USUBPASSINPUTMS */
|
||||
F16SUBPASSINPUT = 572, /* F16SUBPASSINPUT */
|
||||
F16SUBPASSINPUTMS = 573, /* F16SUBPASSINPUTMS */
|
||||
SPIRV_INSTRUCTION = 574, /* SPIRV_INSTRUCTION */
|
||||
SPIRV_EXECUTION_MODE = 575, /* SPIRV_EXECUTION_MODE */
|
||||
SPIRV_EXECUTION_MODE_ID = 576, /* SPIRV_EXECUTION_MODE_ID */
|
||||
SPIRV_DECORATE = 577, /* SPIRV_DECORATE */
|
||||
SPIRV_DECORATE_ID = 578, /* SPIRV_DECORATE_ID */
|
||||
SPIRV_DECORATE_STRING = 579, /* SPIRV_DECORATE_STRING */
|
||||
SPIRV_TYPE = 580, /* SPIRV_TYPE */
|
||||
SPIRV_STORAGE_CLASS = 581, /* SPIRV_STORAGE_CLASS */
|
||||
SPIRV_BY_REFERENCE = 582, /* SPIRV_BY_REFERENCE */
|
||||
SPIRV_LITERAL = 583, /* SPIRV_LITERAL */
|
||||
ATTACHMENTEXT = 584, /* ATTACHMENTEXT */
|
||||
IATTACHMENTEXT = 585, /* IATTACHMENTEXT */
|
||||
UATTACHMENTEXT = 586, /* UATTACHMENTEXT */
|
||||
LEFT_OP = 587, /* LEFT_OP */
|
||||
RIGHT_OP = 588, /* RIGHT_OP */
|
||||
INC_OP = 589, /* INC_OP */
|
||||
DEC_OP = 590, /* DEC_OP */
|
||||
LE_OP = 591, /* LE_OP */
|
||||
GE_OP = 592, /* GE_OP */
|
||||
EQ_OP = 593, /* EQ_OP */
|
||||
NE_OP = 594, /* NE_OP */
|
||||
AND_OP = 595, /* AND_OP */
|
||||
OR_OP = 596, /* OR_OP */
|
||||
XOR_OP = 597, /* XOR_OP */
|
||||
MUL_ASSIGN = 598, /* MUL_ASSIGN */
|
||||
DIV_ASSIGN = 599, /* DIV_ASSIGN */
|
||||
ADD_ASSIGN = 600, /* ADD_ASSIGN */
|
||||
MOD_ASSIGN = 601, /* MOD_ASSIGN */
|
||||
LEFT_ASSIGN = 602, /* LEFT_ASSIGN */
|
||||
RIGHT_ASSIGN = 603, /* RIGHT_ASSIGN */
|
||||
AND_ASSIGN = 604, /* AND_ASSIGN */
|
||||
XOR_ASSIGN = 605, /* XOR_ASSIGN */
|
||||
OR_ASSIGN = 606, /* OR_ASSIGN */
|
||||
SUB_ASSIGN = 607, /* SUB_ASSIGN */
|
||||
STRING_LITERAL = 608, /* STRING_LITERAL */
|
||||
LEFT_PAREN = 609, /* LEFT_PAREN */
|
||||
RIGHT_PAREN = 610, /* RIGHT_PAREN */
|
||||
LEFT_BRACKET = 611, /* LEFT_BRACKET */
|
||||
RIGHT_BRACKET = 612, /* RIGHT_BRACKET */
|
||||
LEFT_BRACE = 613, /* LEFT_BRACE */
|
||||
RIGHT_BRACE = 614, /* RIGHT_BRACE */
|
||||
DOT = 615, /* DOT */
|
||||
COMMA = 616, /* COMMA */
|
||||
COLON = 617, /* COLON */
|
||||
EQUAL = 618, /* EQUAL */
|
||||
SEMICOLON = 619, /* SEMICOLON */
|
||||
BANG = 620, /* BANG */
|
||||
DASH = 621, /* DASH */
|
||||
TILDE = 622, /* TILDE */
|
||||
PLUS = 623, /* PLUS */
|
||||
STAR = 624, /* STAR */
|
||||
SLASH = 625, /* SLASH */
|
||||
PERCENT = 626, /* PERCENT */
|
||||
LEFT_ANGLE = 627, /* LEFT_ANGLE */
|
||||
RIGHT_ANGLE = 628, /* RIGHT_ANGLE */
|
||||
VERTICAL_BAR = 629, /* VERTICAL_BAR */
|
||||
CARET = 630, /* CARET */
|
||||
AMPERSAND = 631, /* AMPERSAND */
|
||||
QUESTION = 632, /* QUESTION */
|
||||
INVARIANT = 633, /* INVARIANT */
|
||||
HIGH_PRECISION = 634, /* HIGH_PRECISION */
|
||||
MEDIUM_PRECISION = 635, /* MEDIUM_PRECISION */
|
||||
LOW_PRECISION = 636, /* LOW_PRECISION */
|
||||
PRECISION = 637, /* PRECISION */
|
||||
PACKED = 638, /* PACKED */
|
||||
RESOURCE = 639, /* RESOURCE */
|
||||
SUPERP = 640, /* SUPERP */
|
||||
FLOATCONSTANT = 641, /* FLOATCONSTANT */
|
||||
INTCONSTANT = 642, /* INTCONSTANT */
|
||||
UINTCONSTANT = 643, /* UINTCONSTANT */
|
||||
BOOLCONSTANT = 644, /* BOOLCONSTANT */
|
||||
IDENTIFIER = 645, /* IDENTIFIER */
|
||||
TYPE_NAME = 646, /* TYPE_NAME */
|
||||
CENTROID = 647, /* CENTROID */
|
||||
IN = 648, /* IN */
|
||||
OUT = 649, /* OUT */
|
||||
INOUT = 650, /* INOUT */
|
||||
STRUCT = 651, /* STRUCT */
|
||||
VOID = 652, /* VOID */
|
||||
WHILE = 653, /* WHILE */
|
||||
BREAK = 654, /* BREAK */
|
||||
CONTINUE = 655, /* CONTINUE */
|
||||
DO = 656, /* DO */
|
||||
ELSE = 657, /* ELSE */
|
||||
FOR = 658, /* FOR */
|
||||
IF = 659, /* IF */
|
||||
DISCARD = 660, /* DISCARD */
|
||||
RETURN = 661, /* RETURN */
|
||||
SWITCH = 662, /* SWITCH */
|
||||
CASE = 663, /* CASE */
|
||||
DEFAULT = 664, /* DEFAULT */
|
||||
TERMINATE_INVOCATION = 665, /* TERMINATE_INVOCATION */
|
||||
TERMINATE_RAY = 666, /* TERMINATE_RAY */
|
||||
IGNORE_INTERSECTION = 667, /* IGNORE_INTERSECTION */
|
||||
UNIFORM = 668, /* UNIFORM */
|
||||
SHARED = 669, /* SHARED */
|
||||
BUFFER = 670, /* BUFFER */
|
||||
TILEIMAGEEXT = 671, /* TILEIMAGEEXT */
|
||||
FLAT = 672, /* FLAT */
|
||||
SMOOTH = 673, /* SMOOTH */
|
||||
LAYOUT = 674, /* LAYOUT */
|
||||
DOUBLECONSTANT = 675, /* DOUBLECONSTANT */
|
||||
INT16CONSTANT = 676, /* INT16CONSTANT */
|
||||
UINT16CONSTANT = 677, /* UINT16CONSTANT */
|
||||
FLOAT16CONSTANT = 678, /* FLOAT16CONSTANT */
|
||||
INT32CONSTANT = 679, /* INT32CONSTANT */
|
||||
UINT32CONSTANT = 680, /* UINT32CONSTANT */
|
||||
INT64CONSTANT = 681, /* INT64CONSTANT */
|
||||
UINT64CONSTANT = 682, /* UINT64CONSTANT */
|
||||
SUBROUTINE = 683, /* SUBROUTINE */
|
||||
DEMOTE = 684, /* DEMOTE */
|
||||
PAYLOADNV = 685, /* PAYLOADNV */
|
||||
PAYLOADINNV = 686, /* PAYLOADINNV */
|
||||
HITATTRNV = 687, /* HITATTRNV */
|
||||
CALLDATANV = 688, /* CALLDATANV */
|
||||
CALLDATAINNV = 689, /* CALLDATAINNV */
|
||||
PAYLOADEXT = 690, /* PAYLOADEXT */
|
||||
PAYLOADINEXT = 691, /* PAYLOADINEXT */
|
||||
HITATTREXT = 692, /* HITATTREXT */
|
||||
CALLDATAEXT = 693, /* CALLDATAEXT */
|
||||
CALLDATAINEXT = 694, /* CALLDATAINEXT */
|
||||
PATCH = 695, /* PATCH */
|
||||
SAMPLE = 696, /* SAMPLE */
|
||||
NONUNIFORM = 697, /* NONUNIFORM */
|
||||
COHERENT = 698, /* COHERENT */
|
||||
VOLATILE = 699, /* VOLATILE */
|
||||
RESTRICT = 700, /* RESTRICT */
|
||||
READONLY = 701, /* READONLY */
|
||||
WRITEONLY = 702, /* WRITEONLY */
|
||||
DEVICECOHERENT = 703, /* DEVICECOHERENT */
|
||||
QUEUEFAMILYCOHERENT = 704, /* QUEUEFAMILYCOHERENT */
|
||||
WORKGROUPCOHERENT = 705, /* WORKGROUPCOHERENT */
|
||||
SUBGROUPCOHERENT = 706, /* SUBGROUPCOHERENT */
|
||||
NONPRIVATE = 707, /* NONPRIVATE */
|
||||
SHADERCALLCOHERENT = 708, /* SHADERCALLCOHERENT */
|
||||
NOPERSPECTIVE = 709, /* NOPERSPECTIVE */
|
||||
EXPLICITINTERPAMD = 710, /* EXPLICITINTERPAMD */
|
||||
PERVERTEXEXT = 711, /* PERVERTEXEXT */
|
||||
PERVERTEXNV = 712, /* PERVERTEXNV */
|
||||
PERPRIMITIVENV = 713, /* PERPRIMITIVENV */
|
||||
PERVIEWNV = 714, /* PERVIEWNV */
|
||||
PERTASKNV = 715, /* PERTASKNV */
|
||||
PERPRIMITIVEEXT = 716, /* PERPRIMITIVEEXT */
|
||||
TASKPAYLOADWORKGROUPEXT = 717, /* TASKPAYLOADWORKGROUPEXT */
|
||||
PRECISE = 718 /* PRECISE */
|
||||
};
|
||||
typedef enum yytokentype yytoken_kind_t;
|
||||
#endif
|
||||
@ -556,7 +562,7 @@ union YYSTYPE
|
||||
glslang::TArraySizes* typeParameters;
|
||||
} interm;
|
||||
|
||||
#line 560 "MachineIndependent/glslang_tab.cpp.h"
|
||||
#line 566 "MachineIndependent/glslang_tab.cpp.h"
|
||||
|
||||
};
|
||||
typedef union YYSTYPE YYSTYPE;
|
||||
|
@ -663,6 +663,8 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
||||
case EOpSubpassLoad: out.debug << "subpassLoad"; break;
|
||||
case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break;
|
||||
|
||||
case EOpColorAttachmentReadEXT: out.debug << "colorAttachmentReadEXT"; break;
|
||||
|
||||
case EOpConstructReference: out.debug << "Construct reference type"; break;
|
||||
|
||||
case EOpDeclare: out.debug << "Declare"; break;
|
||||
@ -1060,6 +1062,8 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
||||
case EOpSubpassLoad: out.debug << "subpassLoad"; break;
|
||||
case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break;
|
||||
|
||||
case EOpColorAttachmentReadEXT: out.debug << "colorAttachmentReadEXT"; break;
|
||||
|
||||
case EOpTraceNV: out.debug << "traceNV"; break;
|
||||
case EOpTraceRayMotionNV: out.debug << "traceRayMotionNV"; break;
|
||||
case EOpTraceKHR: out.debug << "traceRayKHR"; break;
|
||||
@ -1097,6 +1101,7 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
||||
case EOpRayQueryGetWorldRayOrigin: out.debug << "rayQueryGetWorldRayOriginEXT"; break;
|
||||
case EOpRayQueryGetIntersectionObjectToWorld: out.debug << "rayQueryGetIntersectionObjectToWorldEXT"; break;
|
||||
case EOpRayQueryGetIntersectionWorldToObject: out.debug << "rayQueryGetIntersectionWorldToObjectEXT"; break;
|
||||
case EOpRayQueryGetIntersectionTriangleVertexPositionsEXT: out.debug << "rayQueryGetIntersectionTriangleVertexPositionsEXT"; break;
|
||||
|
||||
case EOpCooperativeMatrixLoad: out.debug << "Load cooperative matrix"; break;
|
||||
case EOpCooperativeMatrixStore: out.debug << "Store cooperative matrix"; break;
|
||||
@ -1105,9 +1110,43 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
||||
case EOpIsHelperInvocation: out.debug << "IsHelperInvocation"; break;
|
||||
case EOpDebugPrintf: out.debug << "Debug printf"; break;
|
||||
|
||||
case EOpHitObjectTraceRayNV: out.debug << "HitObjectTraceRayNV"; break;
|
||||
case EOpHitObjectTraceRayMotionNV: out.debug << "HitObjectTraceRayMotionNV"; break;
|
||||
case EOpHitObjectRecordHitNV: out.debug << "HitObjectRecordHitNV"; break;
|
||||
case EOpHitObjectRecordHitMotionNV: out.debug << "HitObjectRecordHitMotionNV"; break;
|
||||
case EOpHitObjectRecordHitWithIndexNV: out.debug << "HitObjectRecordHitWithIndexNV"; break;
|
||||
case EOpHitObjectRecordHitWithIndexMotionNV: out.debug << "HitObjectRecordHitWithIndexMotionNV"; break;
|
||||
case EOpHitObjectRecordMissNV: out.debug << "HitObjectRecordMissNV"; break;
|
||||
case EOpHitObjectRecordMissMotionNV: out.debug << "HitObjectRecordMissMotionNV"; break;
|
||||
case EOpHitObjectRecordEmptyNV: out.debug << "HitObjectRecordEmptyNV"; break;
|
||||
case EOpHitObjectExecuteShaderNV: out.debug << "HitObjectExecuteShaderNV"; break;
|
||||
case EOpHitObjectIsEmptyNV: out.debug << "HitObjectIsEmptyNV"; break;
|
||||
case EOpHitObjectIsMissNV: out.debug << "HitObjectIsMissNV"; break;
|
||||
case EOpHitObjectIsHitNV: out.debug << "HitObjectIsHitNV"; break;
|
||||
case EOpHitObjectGetRayTMinNV: out.debug << "HitObjectGetRayTMinNV"; break;
|
||||
case EOpHitObjectGetRayTMaxNV: out.debug << "HitObjectGetRayTMaxNV"; break;
|
||||
case EOpHitObjectGetObjectRayOriginNV: out.debug << "HitObjectGetObjectRayOriginNV"; break;
|
||||
case EOpHitObjectGetObjectRayDirectionNV: out.debug << "HitObjectGetObjectRayDirectionNV"; break;
|
||||
case EOpHitObjectGetWorldRayOriginNV: out.debug << "HitObjectGetWorldRayOriginNV"; break;
|
||||
case EOpHitObjectGetWorldRayDirectionNV: out.debug << "HitObjectGetWorldRayDirectionNV"; break;
|
||||
case EOpHitObjectGetObjectToWorldNV: out.debug << "HitObjectGetObjectToWorldNV"; break;
|
||||
case EOpHitObjectGetWorldToObjectNV: out.debug << "HitObjectGetWorldToObjectNV"; break;
|
||||
case EOpHitObjectGetInstanceCustomIndexNV: out.debug<< "HitObjectGetInstanceCustomIndexNV"; break;
|
||||
case EOpHitObjectGetInstanceIdNV: out.debug << "HitObjectGetInstaneIdNV"; break;
|
||||
case EOpHitObjectGetGeometryIndexNV: out.debug << "HitObjectGetGeometryIndexNV"; break;
|
||||
case EOpHitObjectGetPrimitiveIndexNV: out.debug << "HitObjectGetPrimitiveIndexNV"; break;
|
||||
case EOpHitObjectGetHitKindNV: out.debug << "HitObjectGetHitKindNV"; break;
|
||||
case EOpHitObjectGetAttributesNV: out.debug << "HitObjectGetAttributesNV"; break;
|
||||
case EOpHitObjectGetCurrentTimeNV: out.debug << "HitObjectGetCurrentTimeNV"; break;
|
||||
case EOpHitObjectGetShaderBindingTableRecordIndexNV: out.debug << "HitObjectGetShaderBindingTableRecordIndexNV"; break;
|
||||
case EOpHitObjectGetShaderRecordBufferHandleNV: out.debug << "HitObjectReadShaderRecordBufferHandleNV"; break;
|
||||
case EOpReorderThreadNV: out.debug << "ReorderThreadNV"; break;
|
||||
|
||||
#ifndef GLSLANG_WEB
|
||||
case EOpSpirvInst: out.debug << "spirv_instruction"; break;
|
||||
#endif
|
||||
case EOpStencilAttachmentReadEXT: out.debug << "stencilAttachmentReadEXT"; break;
|
||||
case EOpDepthAttachmentReadEXT: out.debug << "depthAttachmentReadEXT"; break;
|
||||
|
||||
default: out.debug.message(EPrefixError, "Bad aggregation op");
|
||||
}
|
||||
@ -1512,6 +1551,12 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree)
|
||||
infoSink.debug << "using early_fragment_tests\n";
|
||||
if (postDepthCoverage)
|
||||
infoSink.debug << "using post_depth_coverage\n";
|
||||
if (nonCoherentColorAttachmentReadEXT)
|
||||
infoSink.debug << "using non_coherent_color_attachment_readEXT\n";
|
||||
if (nonCoherentDepthAttachmentReadEXT)
|
||||
infoSink.debug << "using non_coherent_depth_attachment_readEXT\n";
|
||||
if (nonCoherentStencilAttachmentReadEXT)
|
||||
infoSink.debug << "using non_coherent_stencil_attachment_readEXT\n";
|
||||
if (depthLayout != EldNone)
|
||||
infoSink.debug << "using " << TQualifier::getLayoutDepthString(depthLayout) << "\n";
|
||||
if (blendEquations != 0) {
|
||||
@ -1552,7 +1597,7 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree)
|
||||
break;
|
||||
}
|
||||
|
||||
if (treeRoot == 0 || ! tree)
|
||||
if (treeRoot == nullptr || ! tree)
|
||||
return;
|
||||
|
||||
TOutputTraverser it(infoSink);
|
||||
|
@ -271,6 +271,9 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit)
|
||||
|
||||
MERGE_TRUE(earlyFragmentTests);
|
||||
MERGE_TRUE(postDepthCoverage);
|
||||
MERGE_TRUE(nonCoherentColorAttachmentReadEXT);
|
||||
MERGE_TRUE(nonCoherentDepthAttachmentReadEXT);
|
||||
MERGE_TRUE(nonCoherentStencilAttachmentReadEXT);
|
||||
|
||||
if (depthLayout == EldNone)
|
||||
depthLayout = unit.depthLayout;
|
||||
@ -749,6 +752,21 @@ void TIntermediate::mergeLinkerObjects(TInfoSink& infoSink, TIntermSequence& lin
|
||||
symbol->getQualifier().layoutLocation = unitSymbol->getQualifier().layoutLocation;
|
||||
}
|
||||
|
||||
// Update implicit array sizes
|
||||
if (symbol->getWritableType().isImplicitlySizedArray() && unitSymbol->getType().isImplicitlySizedArray()) {
|
||||
if (unitSymbol->getType().getImplicitArraySize() > symbol->getType().getImplicitArraySize()){
|
||||
symbol->getWritableType().updateImplicitArraySize(unitSymbol->getType().getImplicitArraySize());
|
||||
}
|
||||
}
|
||||
else if (symbol->getWritableType().isImplicitlySizedArray() && unitSymbol->getType().isSizedArray()) {
|
||||
if (symbol->getWritableType().getImplicitArraySize() > unitSymbol->getType().getOuterArraySize())
|
||||
error(infoSink, "Implicit size of unsized array doesn't match same symbol among multiple shaders.");
|
||||
}
|
||||
else if (unitSymbol->getType().isImplicitlySizedArray() && symbol->getWritableType().isSizedArray()) {
|
||||
if (unitSymbol->getType().getImplicitArraySize() > symbol->getWritableType().getOuterArraySize())
|
||||
error(infoSink, "Implicit size of unsized array doesn't match same symbol among multiple shaders.");
|
||||
}
|
||||
|
||||
// Update implicit array sizes
|
||||
mergeImplicitArraySizes(symbol->getWritableType(), unitSymbol->getType());
|
||||
|
||||
@ -759,6 +777,19 @@ void TIntermediate::mergeLinkerObjects(TInfoSink& infoSink, TIntermSequence& lin
|
||||
else if (symbol->getQualifier().isPushConstant() && unitSymbol->getQualifier().isPushConstant() && getStage() == unitStage)
|
||||
error(infoSink, "Only one push_constant block is allowed per stage");
|
||||
}
|
||||
|
||||
// Check conflicts between preset primitives and sizes of I/O variables among multiple geometry shaders
|
||||
if (language == EShLangGeometry && unitStage == EShLangGeometry)
|
||||
{
|
||||
TIntermSymbol* unitSymbol = unitLinkerObjects[unitLinkObj]->getAsSymbolNode();
|
||||
if (unitSymbol->isArray() && unitSymbol->getQualifier().storage == EvqVaryingIn && unitSymbol->getQualifier().builtIn == EbvNone)
|
||||
if ((unitSymbol->getArraySizes()->isImplicitlySized() &&
|
||||
unitSymbol->getArraySizes()->getImplicitSize() != TQualifier::mapGeometryToSize(getInputPrimitive())) ||
|
||||
(! unitSymbol->getArraySizes()->isImplicitlySized() &&
|
||||
unitSymbol->getArraySizes()->getDimSize(0) != TQualifier::mapGeometryToSize(getInputPrimitive())))
|
||||
error(infoSink, "Not all array sizes match across all geometry shaders in the program");
|
||||
}
|
||||
|
||||
if (merge) {
|
||||
linkerObjects.push_back(unitLinkerObjects[unitLinkObj]);
|
||||
|
||||
@ -863,7 +894,8 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
|
||||
else {
|
||||
arraysMatch = symbol.getType().sameArrayness(unitSymbol.getType()) ||
|
||||
(symbol.getType().isArray() && unitSymbol.getType().isArray() &&
|
||||
(symbol.getType().isUnsizedArray() || unitSymbol.getType().isUnsizedArray()));
|
||||
(symbol.getType().isImplicitlySizedArray() || unitSymbol.getType().isImplicitlySizedArray() ||
|
||||
symbol.getType().isUnsizedArray() || unitSymbol.getType().isUnsizedArray()));
|
||||
}
|
||||
|
||||
int lpidx = -1;
|
||||
@ -1383,7 +1415,7 @@ void TIntermediate::checkCallGraphCycles(TInfoSink& infoSink)
|
||||
TCall* newRoot;
|
||||
do {
|
||||
// See if we have unvisited parts of the graph.
|
||||
newRoot = 0;
|
||||
newRoot = nullptr;
|
||||
for (TGraph::iterator call = callGraph.begin(); call != callGraph.end(); ++call) {
|
||||
if (! call->visited) {
|
||||
newRoot = &(*call);
|
||||
@ -1517,7 +1549,10 @@ void TIntermediate::checkCallGraphBodies(TInfoSink& infoSink, bool keepUncalled)
|
||||
if (! keepUncalled) {
|
||||
for (int f = 0; f < (int)functionSequence.size(); ++f) {
|
||||
if (! reachable[f])
|
||||
{
|
||||
resetTopLevelUncalledStatus(functionSequence[f]->getAsAggregate()->getName());
|
||||
functionSequence[f] = nullptr;
|
||||
}
|
||||
}
|
||||
functionSequence.erase(std::remove(functionSequence.begin(), functionSequence.end(), nullptr), functionSequence.end());
|
||||
}
|
||||
@ -1585,7 +1620,7 @@ bool TIntermediate::userOutputUsed() const
|
||||
return found;
|
||||
}
|
||||
|
||||
// Accumulate locations used for inputs, outputs, and uniforms, payload and callable data
|
||||
// Accumulate locations used for inputs, outputs, and uniforms, payload, callable data, and tileImageEXT
|
||||
// and check for collisions as the accumulation is done.
|
||||
//
|
||||
// Returns < 0 if no collision, >= 0 if collision and the value returned is a colliding value.
|
||||
@ -1607,10 +1642,14 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
|
||||
set = 2;
|
||||
else if (qualifier.storage == EvqBuffer)
|
||||
set = 3;
|
||||
else if (qualifier.storage == EvqTileImageEXT)
|
||||
set = 4;
|
||||
else if (qualifier.isAnyPayload())
|
||||
setRT = 0;
|
||||
else if (qualifier.isAnyCallable())
|
||||
setRT = 1;
|
||||
else if (qualifier.isHitObjectAttrNV())
|
||||
setRT = 2;
|
||||
else
|
||||
return -1;
|
||||
|
||||
@ -1650,7 +1689,7 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
|
||||
// slot irrespective of type.
|
||||
int collision = -1; // no collision
|
||||
#ifndef GLSLANG_WEB
|
||||
if (qualifier.isAnyPayload() || qualifier.isAnyCallable()) {
|
||||
if (qualifier.isAnyPayload() || qualifier.isAnyCallable() || qualifier.isHitObjectAttrNV()) {
|
||||
TRange range(qualifier.layoutLocation, qualifier.layoutLocation);
|
||||
collision = checkLocationRT(setRT, qualifier.layoutLocation);
|
||||
if (collision < 0)
|
||||
@ -1697,7 +1736,10 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
|
||||
}
|
||||
|
||||
// combine location and component ranges
|
||||
TIoRange range(locationRange, componentRange, type.getBasicType(), qualifier.hasIndex() ? qualifier.getIndex() : 0);
|
||||
TBasicType basicTy = type.getBasicType();
|
||||
if (basicTy == EbtSampler && type.getSampler().isAttachmentEXT())
|
||||
basicTy = type.getSampler().type;
|
||||
TIoRange range(locationRange, componentRange, basicTy, qualifier.hasIndex() ? qualifier.getIndex() : 0);
|
||||
|
||||
// check for collisions, except for vertex inputs on desktop targeting OpenGL
|
||||
if (! (!isEsProfile() && language == EShLangVertex && qualifier.isPipeInput()) || spvVersion.vulkan > 0)
|
||||
@ -1728,6 +1770,19 @@ int TIntermediate::checkLocationRange(int set, const TIoRange& range, const TTyp
|
||||
}
|
||||
}
|
||||
|
||||
// check typeCollision between tileImageEXT and out
|
||||
if (set == 4 || set == 1) {
|
||||
// if the set is "tileImageEXT", check against "out" and vice versa
|
||||
int againstSet = (set == 4) ? 1 : 4;
|
||||
for (size_t r = 0; r < usedIo[againstSet].size(); ++r) {
|
||||
if (range.location.overlap(usedIo[againstSet][r].location) && type.getBasicType() != usedIo[againstSet][r].basicType) {
|
||||
// aliased-type mismatch
|
||||
typeCollision = true;
|
||||
return std::max(range.location.start, usedIo[againstSet][r].location.start);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return -1; // no collision
|
||||
}
|
||||
|
||||
@ -2012,6 +2067,15 @@ int TIntermediate::getBaseAlignmentScalar(const TType& type, int& size)
|
||||
case EbtInt16:
|
||||
case EbtUint16: size = 2; return 2;
|
||||
case EbtReference: size = 8; return 8;
|
||||
case EbtSampler:
|
||||
{
|
||||
if (type.isBindlessImage() || type.isBindlessTexture()) {
|
||||
size = 8; return 8;
|
||||
}
|
||||
else {
|
||||
size = 4; return 4;
|
||||
}
|
||||
}
|
||||
default: size = 4; return 4;
|
||||
}
|
||||
}
|
||||
|
@ -225,6 +225,16 @@ enum ComputeDerivativeMode {
|
||||
LayoutDerivativeGroupLinear, // derivative_group_linearNV
|
||||
};
|
||||
|
||||
//
|
||||
// Status type on AST level. Some uncalled status or functions would be reset in call graph.
|
||||
// Currently we will keep status set by explicitly declared layout or variable decl.
|
||||
//
|
||||
enum AstRefType {
|
||||
AstRefTypeVar, // Status set by variable decl
|
||||
AstRefTypeFunc, // Status set by function decl
|
||||
AstRefTypeLayout, // Status set by layout decl
|
||||
};
|
||||
|
||||
class TIdMaps {
|
||||
public:
|
||||
TMap<TString, long long>& operator[](long long i) { return maps[i]; }
|
||||
@ -284,7 +294,7 @@ public:
|
||||
explicit TIntermediate(EShLanguage l, int v = 0, EProfile p = ENoProfile) :
|
||||
language(l),
|
||||
profile(p), version(v),
|
||||
treeRoot(0),
|
||||
treeRoot(nullptr),
|
||||
resources(TBuiltInResource{}),
|
||||
numEntryPoints(0), numErrors(0), numPushConstants(0), recursive(false),
|
||||
invertY(false),
|
||||
@ -311,7 +321,12 @@ public:
|
||||
inputPrimitive(ElgNone), outputPrimitive(ElgNone),
|
||||
pixelCenterInteger(false), originUpperLeft(false),texCoordBuiltinRedeclared(false),
|
||||
vertexSpacing(EvsNone), vertexOrder(EvoNone), interlockOrdering(EioNone), pointMode(false), earlyFragmentTests(false),
|
||||
postDepthCoverage(false), earlyAndLateFragmentTestsAMD(false), depthLayout(EldNone), stencilLayout(ElsNone),
|
||||
postDepthCoverage(false), earlyAndLateFragmentTestsAMD(false),
|
||||
nonCoherentColorAttachmentReadEXT(false),
|
||||
nonCoherentDepthAttachmentReadEXT(false),
|
||||
nonCoherentStencilAttachmentReadEXT(false),
|
||||
depthLayout(EldNone),
|
||||
stencilLayout(ElsNone),
|
||||
hlslFunctionality1(false),
|
||||
blendEquations(0), xfbMode(false), multiStream(false),
|
||||
layoutOverrideCoverage(false),
|
||||
@ -628,6 +643,9 @@ public:
|
||||
bool getXfbMode() const { return false; }
|
||||
bool isMultiStream() const { return false; }
|
||||
TLayoutGeometry getOutputPrimitive() const { return ElgNone; }
|
||||
bool getNonCoherentColorAttachmentReadEXT() const { return false; }
|
||||
bool getNonCoherentDepthAttachmentReadEXT() const { return false; }
|
||||
bool getNonCoherentStencilAttachmentReadEXT() const { return false; }
|
||||
bool getPostDepthCoverage() const { return false; }
|
||||
bool getEarlyFragmentTests() const { return false; }
|
||||
TLayoutDepth getDepth() const { return EldNone; }
|
||||
@ -744,6 +762,65 @@ public:
|
||||
useVariablePointers = true;
|
||||
processes.addProcess("use-variable-pointers");
|
||||
}
|
||||
// Set the global flag for bindless texture
|
||||
void setBindlessTextureMode(const TString& currentCaller, AstRefType type)
|
||||
{
|
||||
// When type is not func, currentCaller should be "" (empty string)
|
||||
bindlessTextureModeCaller[currentCaller] = type;
|
||||
}
|
||||
|
||||
// Get the global flag for bindless texture
|
||||
bool getBindlessTextureMode() const
|
||||
{
|
||||
return (bindlessTextureModeCaller.size() > 0);
|
||||
}
|
||||
|
||||
// Set the global flag for bindless image
|
||||
void setBindlessImageMode(const TString& currentCaller, AstRefType type)
|
||||
{
|
||||
// When type is not func, currentCaller should be "" (empty string)
|
||||
bindlessImageModeCaller[currentCaller] = type;
|
||||
}
|
||||
|
||||
// Get the global flag for bindless image
|
||||
bool getBindlessImageMode() const
|
||||
{
|
||||
return (bindlessImageModeCaller.size() > 0);
|
||||
}
|
||||
|
||||
// Get the global flag for bindless texture
|
||||
bool resetTopLevelUncalledStatus(const TString& deadCaller)
|
||||
{
|
||||
// For reflection collection purpose, currently uniform layout setting and some
|
||||
// flags introduced by variables (IO, global, etc,.) won't be reset here.
|
||||
// Remove each global status (AST top level) introduced by uncalled functions.
|
||||
// If a status is set by several functions, keep those which in call graph.
|
||||
bool result = false;
|
||||
|
||||
// For two types of bindless mode flag, we would only reset which is set by an uncalled function.
|
||||
// If one status flag's key in caller vec is empty, it should be come from a non-function setting.
|
||||
if (!bindlessTextureModeCaller.empty()) {
|
||||
auto caller = bindlessTextureModeCaller.find(deadCaller);
|
||||
if (caller != bindlessTextureModeCaller.end() && bindlessTextureModeCaller[deadCaller] == AstRefTypeFunc) {
|
||||
bindlessTextureModeCaller.erase(caller);
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
if (!bindlessImageModeCaller.empty()) {
|
||||
auto caller = bindlessImageModeCaller.find(deadCaller);
|
||||
if (caller != bindlessImageModeCaller.end() && bindlessImageModeCaller[deadCaller] == AstRefTypeFunc) {
|
||||
bindlessImageModeCaller.erase(caller);
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool getBindlessMode() const
|
||||
{
|
||||
return getBindlessTextureMode() || getBindlessImageMode();
|
||||
}
|
||||
|
||||
bool usingVariablePointers() const { return useVariablePointers; }
|
||||
|
||||
#ifdef ENABLE_HLSL
|
||||
@ -825,6 +902,12 @@ public:
|
||||
return true;
|
||||
}
|
||||
TLayoutGeometry getOutputPrimitive() const { return outputPrimitive; }
|
||||
void setNonCoherentColorAttachmentReadEXT() { nonCoherentColorAttachmentReadEXT = true; }
|
||||
bool getNonCoherentColorAttachmentReadEXT() const { return nonCoherentColorAttachmentReadEXT; }
|
||||
void setNonCoherentDepthAttachmentReadEXT() { nonCoherentDepthAttachmentReadEXT = true; }
|
||||
bool getNonCoherentDepthAttachmentReadEXT() const { return nonCoherentDepthAttachmentReadEXT; }
|
||||
void setNonCoherentStencilAttachmentReadEXT() { nonCoherentStencilAttachmentReadEXT = true; }
|
||||
bool getNonCoherentStencilAttachmentReadEXT() const { return nonCoherentStencilAttachmentReadEXT; }
|
||||
void setPostDepthCoverage() { postDepthCoverage = true; }
|
||||
bool getPostDepthCoverage() const { return postDepthCoverage; }
|
||||
void setEarlyFragmentTests() { earlyFragmentTests = true; }
|
||||
@ -1146,6 +1229,9 @@ protected:
|
||||
bool earlyFragmentTests;
|
||||
bool postDepthCoverage;
|
||||
bool earlyAndLateFragmentTestsAMD;
|
||||
bool nonCoherentColorAttachmentReadEXT;
|
||||
bool nonCoherentDepthAttachmentReadEXT;
|
||||
bool nonCoherentStencilAttachmentReadEXT;
|
||||
TLayoutDepth depthLayout;
|
||||
TLayoutStencil stencilLayout;
|
||||
bool hlslFunctionality1;
|
||||
@ -1188,7 +1274,8 @@ protected:
|
||||
|
||||
TSpirvRequirement* spirvRequirement;
|
||||
TSpirvExecutionMode* spirvExecutionMode;
|
||||
|
||||
std::map<TString, AstRefType> bindlessTextureModeCaller;
|
||||
std::map<TString, AstRefType> bindlessImageModeCaller;
|
||||
std::unordered_map<std::string, int> uniformLocationOverrides;
|
||||
int uniformLocationBase;
|
||||
TNumericFeatures numericFeatures;
|
||||
@ -1198,8 +1285,9 @@ protected:
|
||||
std::unordered_set<int> usedConstantId; // specialization constant ids used
|
||||
std::vector<TOffsetRange> usedAtomics; // sets of bindings used by atomic counters
|
||||
std::vector<TIoRange> usedIo[4]; // sets of used locations, one for each of in, out, uniform, and buffers
|
||||
std::vector<TRange> usedIoRT[2]; // sets of used location, one for rayPayload/rayPayloadIN and other
|
||||
// for callableData/callableDataIn
|
||||
std::vector<TRange> usedIoRT[4]; // sets of used location, one for rayPayload/rayPayloadIN,
|
||||
// one for callableData/callableDataIn, one for hitObjectAttributeNV and
|
||||
// one for shaderrecordhitobjectNV
|
||||
// set of names of statically read/written I/O that might need extra checking
|
||||
std::set<TString> ioAccessed;
|
||||
|
||||
|
@ -198,7 +198,7 @@ void TConstTraverser::visitConstantUnion(TIntermConstantUnion* node)
|
||||
|
||||
bool TIntermediate::parseConstTree(TIntermNode* root, TConstUnionArray unionArray, TOperator constructorType, const TType& t, bool singleConstantParam)
|
||||
{
|
||||
if (root == 0)
|
||||
if (root == nullptr)
|
||||
return false;
|
||||
|
||||
TConstTraverser it(unionArray, singleConstantParam, constructorType, t);
|
||||
|
@ -65,7 +65,7 @@ public:
|
||||
infoSink(infoSink), version(version),
|
||||
language(language),
|
||||
spvVersion(spvVersion),
|
||||
intermediate(interm), messages(messages), numErrors(0), currentScanner(0) { }
|
||||
intermediate(interm), messages(messages), numErrors(0), currentScanner(nullptr) { }
|
||||
virtual ~TParseVersions() { }
|
||||
void requireStage(const TSourceLoc&, EShLanguageMask, const char* featureDesc);
|
||||
void requireStage(const TSourceLoc&, EShLanguage, const char* featureDesc);
|
||||
@ -226,6 +226,7 @@ public:
|
||||
protected:
|
||||
TMap<TString, TExtensionBehavior> extensionBehavior; // for each extension string, what its current behavior is
|
||||
TMap<TString, unsigned int> extensionMinSpv; // for each extension string, store minimum spirv required
|
||||
TVector<TString> spvUnsupportedExt; // for extensions reserved for spv usage.
|
||||
EShMessages messages; // errors/warnings/rule-sets
|
||||
int numErrors; // number of compile-time errors encountered
|
||||
TInputScanner* currentScanner;
|
||||
|
@ -1126,9 +1126,6 @@ int TPpContext::tMacroInput::scan(TPpToken* ppToken)
|
||||
pasting = true;
|
||||
}
|
||||
|
||||
// HLSL does expand macros before concatenation
|
||||
if (pasting && pp->parseContext.isReadingHLSL())
|
||||
pasting = false;
|
||||
|
||||
// TODO: preprocessor: properly handle whitespace (or lack of it) between tokens when expanding
|
||||
if (token == PpAtomIdentifier) {
|
||||
@ -1138,9 +1135,12 @@ int TPpContext::tMacroInput::scan(TPpToken* ppToken)
|
||||
break;
|
||||
if (i >= 0) {
|
||||
TokenStream* arg = expandedArgs[i];
|
||||
if (arg == nullptr || pasting)
|
||||
bool expanded = !!arg && !pasting;
|
||||
// HLSL does expand macros before concatenation
|
||||
if (arg == nullptr || (pasting && !pp->parseContext.isReadingHLSL()) ) {
|
||||
arg = args[i];
|
||||
pp->pushTokenStreamInput(*arg, prepaste);
|
||||
}
|
||||
pp->pushTokenStreamInput(*arg, prepaste, expanded);
|
||||
|
||||
return pp->scanToken(ppToken);
|
||||
}
|
||||
@ -1183,6 +1183,9 @@ MacroExpandResult TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, b
|
||||
{
|
||||
ppToken->space = false;
|
||||
int macroAtom = atomStrings.getAtom(ppToken->name);
|
||||
if (ppToken->fullyExpanded)
|
||||
return MacroExpandNotStarted;
|
||||
|
||||
switch (macroAtom) {
|
||||
case PpAtomLineMacro:
|
||||
// Arguments which are macro have been replaced in the first stage.
|
||||
@ -1214,8 +1217,10 @@ MacroExpandResult TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, b
|
||||
MacroSymbol* macro = macroAtom == 0 ? nullptr : lookupMacroDef(macroAtom);
|
||||
|
||||
// no recursive expansions
|
||||
if (macro != nullptr && macro->busy)
|
||||
if (macro != nullptr && macro->busy) {
|
||||
ppToken->fullyExpanded = true;
|
||||
return MacroExpandNotStarted;
|
||||
}
|
||||
|
||||
// not expanding undefined macros
|
||||
if ((macro == nullptr || macro->undef) && ! expandUndef)
|
||||
|
@ -85,7 +85,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
namespace glslang {
|
||||
|
||||
TPpContext::TPpContext(TParseContextBase& pc, const std::string& rootFileName, TShader::Includer& inclr) :
|
||||
preamble(0), strings(0), previous_token('\n'), parseContext(pc), includer(inclr), inComment(false),
|
||||
preamble(nullptr), strings(nullptr), previous_token('\n'), parseContext(pc), includer(inclr), inComment(false),
|
||||
rootFileName(rootFileName),
|
||||
currentSourceFile(rootFileName),
|
||||
disableEscapeSequences(false)
|
||||
|
@ -102,6 +102,7 @@ public:
|
||||
i64val = 0;
|
||||
loc.init();
|
||||
name[0] = 0;
|
||||
fullyExpanded = false;
|
||||
}
|
||||
|
||||
// Used for comparing macro definitions, so checks what is relevant for that.
|
||||
@ -117,6 +118,8 @@ public:
|
||||
// True if a space (for white space or a removed comment) should also be
|
||||
// recognized, in front of the token returned:
|
||||
bool space;
|
||||
|
||||
bool fullyExpanded;
|
||||
// Numeric value of the token:
|
||||
union {
|
||||
int ival;
|
||||
@ -475,16 +478,27 @@ protected:
|
||||
//
|
||||
// From PpTokens.cpp
|
||||
//
|
||||
void pushTokenStreamInput(TokenStream&, bool pasting = false);
|
||||
void pushTokenStreamInput(TokenStream&, bool pasting = false, bool expanded = false);
|
||||
void UngetToken(int token, TPpToken*);
|
||||
|
||||
class tTokenInput : public tInput {
|
||||
public:
|
||||
tTokenInput(TPpContext* pp, TokenStream* t, bool prepasting) :
|
||||
tTokenInput(TPpContext* pp, TokenStream* t, bool prepasting, bool expanded) :
|
||||
tInput(pp),
|
||||
tokens(t),
|
||||
lastTokenPastes(prepasting) { }
|
||||
virtual int scan(TPpToken *ppToken) override { return tokens->getToken(pp->parseContext, ppToken); }
|
||||
lastTokenPastes(prepasting),
|
||||
preExpanded(expanded) { }
|
||||
virtual int scan(TPpToken *ppToken) override {
|
||||
int token = tokens->getToken(pp->parseContext, ppToken);
|
||||
ppToken->fullyExpanded = preExpanded;
|
||||
if (tokens->atEnd() && token == PpAtomIdentifier) {
|
||||
int macroAtom = pp->atomStrings.getAtom(ppToken->name);
|
||||
MacroSymbol* macro = macroAtom == 0 ? nullptr : pp->lookupMacroDef(macroAtom);
|
||||
if (macro && macro->functionLike)
|
||||
ppToken->fullyExpanded = false;
|
||||
}
|
||||
return token;
|
||||
}
|
||||
virtual int getch() override { assert(0); return EndOfInput; }
|
||||
virtual void ungetch() override { assert(0); }
|
||||
virtual bool peekPasting() override { return tokens->peekTokenizedPasting(lastTokenPastes); }
|
||||
@ -492,6 +506,7 @@ protected:
|
||||
protected:
|
||||
TokenStream* tokens;
|
||||
bool lastTokenPastes; // true if the last token in the input is to be pasted, rather than consumed as a token
|
||||
bool preExpanded;
|
||||
};
|
||||
|
||||
class tUngotTokenInput : public tInput {
|
||||
|
@ -480,9 +480,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
||||
E_GL_EXT_shader_explicit_arithmetic_types_int16 };
|
||||
static const int Num_Int16_Extensions = sizeof(Int16_Extensions) / sizeof(Int16_Extensions[0]);
|
||||
|
||||
ppToken->ival = 0;
|
||||
ppToken->i64val = 0;
|
||||
ppToken->space = false;
|
||||
ppToken->clear();
|
||||
ch = getch();
|
||||
for (;;) {
|
||||
while (ch == ' ' || ch == '\t') {
|
||||
|
@ -85,9 +85,6 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef _CRT_SECURE_NO_WARNINGS
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/)
|
||||
#define snprintf sprintf_s
|
||||
#endif
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
@ -121,7 +118,7 @@ int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken
|
||||
if (atom == '#') {
|
||||
if (peekToken('#')) {
|
||||
parseContext.requireProfile(ppToken->loc, ~EEsProfile, "token pasting (##)");
|
||||
parseContext.profileRequires(ppToken->loc, ~EEsProfile, 130, 0, "token pasting (##)");
|
||||
parseContext.profileRequires(ppToken->loc, ~EEsProfile, 130, nullptr, "token pasting (##)");
|
||||
currentPos++;
|
||||
atom = PpAtomPaste;
|
||||
}
|
||||
@ -195,9 +192,9 @@ bool TPpContext::TokenStream::peekUntokenizedPasting()
|
||||
return pasting;
|
||||
}
|
||||
|
||||
void TPpContext::pushTokenStreamInput(TokenStream& ts, bool prepasting)
|
||||
void TPpContext::pushTokenStreamInput(TokenStream& ts, bool prepasting, bool expanded)
|
||||
{
|
||||
pushInput(new tTokenInput(this, &ts, prepasting));
|
||||
pushInput(new tTokenInput(this, &ts, prepasting, expanded));
|
||||
ts.reset();
|
||||
}
|
||||
|
||||
|
@ -423,7 +423,7 @@ getSymbolToDefinitionMappingAndPreciseSymbolIDs(const glslang::TIntermediate& in
|
||||
ReturnBranchNodeSet());
|
||||
|
||||
TIntermNode* root = intermediate.getTreeRoot();
|
||||
if (root == 0)
|
||||
if (root == nullptr)
|
||||
return result_tuple;
|
||||
|
||||
NodeMapping& symbol_definition_mapping = std::get<0>(result_tuple);
|
||||
|
@ -682,7 +682,7 @@ public:
|
||||
}
|
||||
|
||||
// For a binary operation indexing into an aggregate, chase down the base of the aggregate.
|
||||
// Return 0 if the topology does not fit this situation.
|
||||
// Return nullptr if the topology does not fit this situation.
|
||||
TIntermSymbol* findBase(const TIntermBinary* node)
|
||||
{
|
||||
TIntermSymbol *base = node->getLeft()->getAsSymbolNode();
|
||||
|
@ -76,7 +76,7 @@ OS_TLSIndex OS_AllocTLSIndex()
|
||||
//
|
||||
// Create global pool key.
|
||||
//
|
||||
if ((pthread_key_create(&pPoolIndex, NULL)) != 0) {
|
||||
if ((pthread_key_create(&pPoolIndex, nullptr)) != 0) {
|
||||
assert(0 && "OS_AllocTLSIndex(): Unable to allocate Thread Local Storage");
|
||||
return OS_INVALID_TLS_INDEX;
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ HANDLE GlobalLock;
|
||||
|
||||
void InitGlobalLock()
|
||||
{
|
||||
GlobalLock = CreateMutex(0, false, 0);
|
||||
GlobalLock = CreateMutex(nullptr, false, nullptr);
|
||||
}
|
||||
|
||||
void GetGlobalLock()
|
||||
@ -128,7 +128,7 @@ void ReleaseGlobalLock()
|
||||
|
||||
unsigned int __stdcall EnterGenericThread (void* entry)
|
||||
{
|
||||
return ((TThreadEntrypoint)entry)(0);
|
||||
return ((TThreadEntrypoint)entry)(nullptr);
|
||||
}
|
||||
|
||||
//#define DUMP_COUNTERS
|
||||
|
@ -41,7 +41,7 @@ namespace glslang {
|
||||
// Thread Local Storage Operations
|
||||
//
|
||||
typedef void* OS_TLSIndex;
|
||||
#define OS_INVALID_TLS_INDEX ((void*)0)
|
||||
#define OS_INVALID_TLS_INDEX nullptr
|
||||
|
||||
OS_TLSIndex OS_AllocTLSIndex();
|
||||
bool OS_SetTLSValue(OS_TLSIndex nIndex, void *lpvValue);
|
||||
|
@ -505,6 +505,8 @@ void DecodeResourceLimits(TBuiltInResource* resources, char* config)
|
||||
resources->maxTaskWorkGroupSizeZ_EXT = value;
|
||||
else if (tokenStr == "MaxMeshViewCountEXT")
|
||||
resources->maxMeshViewCountEXT = value;
|
||||
else if (tokenStr == "MaxDualSourceDrawBuffersEXT")
|
||||
resources->maxDualSourceDrawBuffersEXT = value;
|
||||
else if (tokenStr == "nonInductiveForLoops")
|
||||
resources->limits.nonInductiveForLoops = (value != 0);
|
||||
else if (tokenStr == "whileLoops")
|
41
3rdparty/glslang/hlsl/stub.cpp
vendored
41
3rdparty/glslang/hlsl/stub.cpp
vendored
@ -1,41 +0,0 @@
|
||||
//
|
||||
// Copyright (C) 2020 Google, 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 Google, Inc., 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.
|
||||
//
|
||||
|
||||
// The HLSL source is directly embedded into the glslang target when ENABLE_HLSL
|
||||
// is set.
|
||||
// This source now lives at: glslang/HLSL/
|
||||
// The HLSL target is now just a stub that exists for backwards compatibility
|
||||
// for projects that referenced this target. As a target requires at least one
|
||||
// source file to build, this file acts as that stub.
|
85
3rdparty/khronos/EGL/egl.h
vendored
85
3rdparty/khronos/EGL/egl.h
vendored
@ -6,39 +6,24 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2013-2017 The Khronos Group Inc.
|
||||
** Copyright 2013-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
/*
|
||||
** This header is generated from the Khronos EGL XML API Registry.
|
||||
** The current version of the Registry, generator scripts
|
||||
** used to make the header, and the header can be found at
|
||||
** http://www.khronos.org/registry/egl
|
||||
**
|
||||
** Khronos $Git commit SHA1: 726475c203 $ on $Git commit date: 2018-10-03 23:51:49 -0700 $
|
||||
** Khronos $Git commit SHA1: 6fb1daea15 $ on $Git commit date: 2022-05-25 09:41:13 -0600 $
|
||||
*/
|
||||
|
||||
#include <EGL/eglplatform.h>
|
||||
|
||||
/* Generated on date 20181204 */
|
||||
#ifndef EGL_EGL_PROTOTYPES
|
||||
#define EGL_EGL_PROTOTYPES 1
|
||||
#endif
|
||||
|
||||
/* Generated on date 20220525 */
|
||||
|
||||
/* Generated C header for:
|
||||
* API: egl
|
||||
@ -118,6 +103,31 @@ typedef void (*__eglMustCastToProperFunctionPointerType)(void);
|
||||
#define EGL_VERSION 0x3054
|
||||
#define EGL_WIDTH 0x3057
|
||||
#define EGL_WINDOW_BIT 0x0004
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLCHOOSECONFIGPROC) (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOPYBUFFERSPROC) (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target);
|
||||
typedef EGLContext (EGLAPIENTRYP PFNEGLCREATECONTEXTPROC) (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list);
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPBUFFERSURFACEPROC) (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEPROC) (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list);
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEWINDOWSURFACEPROC) (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYCONTEXTPROC) (EGLDisplay dpy, EGLContext ctx);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSURFACEPROC) (EGLDisplay dpy, EGLSurface surface);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETCONFIGATTRIBPROC) (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETCONFIGSPROC) (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
||||
typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETCURRENTDISPLAYPROC) (void);
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLGETCURRENTSURFACEPROC) (EGLint readdraw);
|
||||
typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETDISPLAYPROC) (EGLNativeDisplayType display_id);
|
||||
typedef EGLint (EGLAPIENTRYP PFNEGLGETERRORPROC) (void);
|
||||
typedef __eglMustCastToProperFunctionPointerType (EGLAPIENTRYP PFNEGLGETPROCADDRESSPROC) (const char *procname);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLINITIALIZEPROC) (EGLDisplay dpy, EGLint *major, EGLint *minor);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLMAKECURRENTPROC) (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYCONTEXTPROC) (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
|
||||
typedef const char *(EGLAPIENTRYP PFNEGLQUERYSTRINGPROC) (EGLDisplay dpy, EGLint name);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSPROC) (EGLDisplay dpy, EGLSurface surface);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLTERMINATEPROC) (EGLDisplay dpy);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITGLPROC) (void);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITNATIVEPROC) (EGLint engine);
|
||||
#if EGL_EGL_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target);
|
||||
EGLAPI EGLContext EGLAPIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list);
|
||||
@ -142,6 +152,7 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface surface
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglTerminate (EGLDisplay dpy);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL (void);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine);
|
||||
#endif
|
||||
#endif /* EGL_VERSION_1_0 */
|
||||
|
||||
#ifndef EGL_VERSION_1_1
|
||||
@ -160,10 +171,16 @@ EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine);
|
||||
#define EGL_TEXTURE_RGB 0x305D
|
||||
#define EGL_TEXTURE_RGBA 0x305E
|
||||
#define EGL_TEXTURE_TARGET 0x3081
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDTEXIMAGEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLRELEASETEXIMAGEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSURFACEATTRIBPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPINTERVALPROC) (EGLDisplay dpy, EGLint interval);
|
||||
#if EGL_EGL_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval (EGLDisplay dpy, EGLint interval);
|
||||
#endif
|
||||
#endif /* EGL_VERSION_1_1 */
|
||||
|
||||
#ifndef EGL_VERSION_1_2
|
||||
@ -199,11 +216,18 @@ typedef void *EGLClientBuffer;
|
||||
#define EGL_SWAP_BEHAVIOR 0x3093
|
||||
#define EGL_UNKNOWN EGL_CAST(EGLint,-1)
|
||||
#define EGL_VERTICAL_RESOLUTION 0x3091
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDAPIPROC) (EGLenum api);
|
||||
typedef EGLenum (EGLAPIENTRYP PFNEGLQUERYAPIPROC) (void);
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPBUFFERFROMCLIENTBUFFERPROC) (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLRELEASETHREADPROC) (void);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITCLIENTPROC) (void);
|
||||
#if EGL_EGL_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI (EGLenum api);
|
||||
EGLAPI EGLenum EGLAPIENTRY eglQueryAPI (void);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread (void);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void);
|
||||
#endif
|
||||
#endif /* EGL_VERSION_1_2 */
|
||||
|
||||
#ifndef EGL_VERSION_1_3
|
||||
@ -232,7 +256,10 @@ EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void);
|
||||
#define EGL_OPENGL_API 0x30A2
|
||||
#define EGL_OPENGL_BIT 0x0008
|
||||
#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400
|
||||
typedef EGLContext (EGLAPIENTRYP PFNEGLGETCURRENTCONTEXTPROC) (void);
|
||||
#if EGL_EGL_PROTOTYPES
|
||||
EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext (void);
|
||||
#endif
|
||||
#endif /* EGL_VERSION_1_4 */
|
||||
|
||||
#ifndef EGL_VERSION_1_5
|
||||
@ -284,6 +311,17 @@ typedef void *EGLImage;
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8
|
||||
#define EGL_IMAGE_PRESERVED 0x30D2
|
||||
#define EGL_NO_IMAGE EGL_CAST(EGLImage,0)
|
||||
typedef EGLSync (EGLAPIENTRYP PFNEGLCREATESYNCPROC) (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCPROC) (EGLDisplay dpy, EGLSync sync);
|
||||
typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCPROC) (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBPROC) (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value);
|
||||
typedef EGLImage (EGLAPIENTRYP PFNEGLCREATEIMAGEPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEPROC) (EGLDisplay dpy, EGLImage image);
|
||||
typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYPROC) (EGLenum platform, void *native_display, const EGLAttrib *attrib_list);
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list);
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC) (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITSYNCPROC) (EGLDisplay dpy, EGLSync sync, EGLint flags);
|
||||
#if EGL_EGL_PROTOTYPES
|
||||
EGLAPI EGLSync EGLAPIENTRY eglCreateSync (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySync (EGLDisplay dpy, EGLSync sync);
|
||||
EGLAPI EGLint EGLAPIENTRY eglClientWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout);
|
||||
@ -294,6 +332,7 @@ EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplay (EGLenum platform, void *nat
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags);
|
||||
#endif
|
||||
#endif /* EGL_VERSION_1_5 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
203
3rdparty/khronos/EGL/eglext.h
vendored
203
3rdparty/khronos/EGL/eglext.h
vendored
@ -6,39 +6,20 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2013-2017 The Khronos Group Inc.
|
||||
** Copyright 2013-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
/*
|
||||
** This header is generated from the Khronos EGL XML API Registry.
|
||||
** The current version of the Registry, generator scripts
|
||||
** used to make the header, and the header can be found at
|
||||
** http://www.khronos.org/registry/egl
|
||||
**
|
||||
** Khronos $Git commit SHA1: 7866a17153 $ on $Git commit date: 2019-01-25 23:06:48 -0800 $
|
||||
** Khronos $Git commit SHA1: 6fb1daea15 $ on $Git commit date: 2022-05-25 09:41:13 -0600 $
|
||||
*/
|
||||
|
||||
#include <EGL/eglplatform.h>
|
||||
|
||||
#define EGL_EGLEXT_VERSION 20190125
|
||||
#define EGL_EGLEXT_VERSION 20220525
|
||||
|
||||
/* Generated C header for:
|
||||
* API: egl
|
||||
@ -443,9 +424,9 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR (EGLDisplay dpy,
|
||||
|
||||
#ifndef EGL_KHR_swap_buffers_with_damage
|
||||
#define EGL_KHR_swap_buffers_with_damage 1
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageKHR (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects);
|
||||
#endif
|
||||
#endif /* EGL_KHR_swap_buffers_with_damage */
|
||||
|
||||
@ -462,6 +443,10 @@ EGLAPI EGLint EGLAPIENTRY eglWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLin
|
||||
#endif
|
||||
#endif /* EGL_KHR_wait_sync */
|
||||
|
||||
#ifndef EGL_ANDROID_GLES_layers
|
||||
#define EGL_ANDROID_GLES_layers 1
|
||||
#endif /* EGL_ANDROID_GLES_layers */
|
||||
|
||||
#ifndef EGL_ANDROID_blob_cache
|
||||
#define EGL_ANDROID_blob_cache 1
|
||||
typedef khronos_ssize_t EGLsizeiANDROID;
|
||||
@ -589,11 +574,25 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE (EGLDisplay dpy, EGLSu
|
||||
#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1
|
||||
#endif /* EGL_ANGLE_surface_d3d_texture_2d_share_handle */
|
||||
|
||||
#ifndef EGL_ANGLE_sync_control_rate
|
||||
#define EGL_ANGLE_sync_control_rate 1
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETMSCRATEANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *numerator, EGLint *denominator);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetMscRateANGLE (EGLDisplay dpy, EGLSurface surface, EGLint *numerator, EGLint *denominator);
|
||||
#endif
|
||||
#endif /* EGL_ANGLE_sync_control_rate */
|
||||
|
||||
#ifndef EGL_ANGLE_window_fixed_size
|
||||
#define EGL_ANGLE_window_fixed_size 1
|
||||
#define EGL_FIXED_SIZE_ANGLE 0x3201
|
||||
#endif /* EGL_ANGLE_window_fixed_size */
|
||||
|
||||
#ifndef EGL_ARM_image_format
|
||||
#define EGL_ARM_image_format 1
|
||||
#define EGL_COLOR_COMPONENT_TYPE_UNSIGNED_INTEGER_ARM 0x3287
|
||||
#define EGL_COLOR_COMPONENT_TYPE_INTEGER_ARM 0x3288
|
||||
#endif /* EGL_ARM_image_format */
|
||||
|
||||
#ifndef EGL_ARM_implicit_external_sync
|
||||
#define EGL_ARM_implicit_external_sync 1
|
||||
#define EGL_SYNC_PRIOR_COMMANDS_IMPLICIT_EXTERNAL_ARM 0x328A
|
||||
@ -652,6 +651,11 @@ EGLAPI EGLBoolean EGLAPIENTRY eglCompositorSwapPolicyEXT (EGLint external_win_id
|
||||
#endif
|
||||
#endif /* EGL_EXT_compositor */
|
||||
|
||||
#ifndef EGL_EXT_config_select_group
|
||||
#define EGL_EXT_config_select_group 1
|
||||
#define EGL_CONFIG_SELECT_GROUP_EXT 0x34C0
|
||||
#endif /* EGL_EXT_config_select_group */
|
||||
|
||||
#ifndef EGL_EXT_create_context_robustness
|
||||
#define EGL_EXT_create_context_robustness 1
|
||||
#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF
|
||||
@ -684,6 +688,11 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT (EGLDisplay dpy, EGLint a
|
||||
#define EGL_DRM_MASTER_FD_EXT 0x333C
|
||||
#endif /* EGL_EXT_device_drm */
|
||||
|
||||
#ifndef EGL_EXT_device_drm_render_node
|
||||
#define EGL_EXT_device_drm_render_node 1
|
||||
#define EGL_DRM_RENDER_NODE_FILE_EXT 0x3377
|
||||
#endif /* EGL_EXT_device_drm_render_node */
|
||||
|
||||
#ifndef EGL_EXT_device_enumeration
|
||||
#define EGL_EXT_device_enumeration 1
|
||||
#endif /* EGL_EXT_device_enumeration */
|
||||
@ -691,12 +700,33 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT (EGLDisplay dpy, EGLint a
|
||||
#ifndef EGL_EXT_device_openwf
|
||||
#define EGL_EXT_device_openwf 1
|
||||
#define EGL_OPENWF_DEVICE_ID_EXT 0x3237
|
||||
#define EGL_OPENWF_DEVICE_EXT 0x333D
|
||||
#endif /* EGL_EXT_device_openwf */
|
||||
|
||||
#ifndef EGL_EXT_device_persistent_id
|
||||
#define EGL_EXT_device_persistent_id 1
|
||||
#define EGL_DEVICE_UUID_EXT 0x335C
|
||||
#define EGL_DRIVER_UUID_EXT 0x335D
|
||||
#define EGL_DRIVER_NAME_EXT 0x335E
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICEBINARYEXTPROC) (EGLDeviceEXT device, EGLint name, EGLint max_size, void *value, EGLint *size);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryDeviceBinaryEXT (EGLDeviceEXT device, EGLint name, EGLint max_size, void *value, EGLint *size);
|
||||
#endif
|
||||
#endif /* EGL_EXT_device_persistent_id */
|
||||
|
||||
#ifndef EGL_EXT_device_query
|
||||
#define EGL_EXT_device_query 1
|
||||
#endif /* EGL_EXT_device_query */
|
||||
|
||||
#ifndef EGL_EXT_device_query_name
|
||||
#define EGL_EXT_device_query_name 1
|
||||
#define EGL_RENDERER_EXT 0x335F
|
||||
#endif /* EGL_EXT_device_query_name */
|
||||
|
||||
#ifndef EGL_EXT_explicit_device
|
||||
#define EGL_EXT_explicit_device 1
|
||||
#endif /* EGL_EXT_explicit_device */
|
||||
|
||||
#ifndef EGL_EXT_gl_colorspace_bt2020_linear
|
||||
#define EGL_EXT_gl_colorspace_bt2020_linear 1
|
||||
#define EGL_GL_COLORSPACE_BT2020_LINEAR_EXT 0x333F
|
||||
@ -873,6 +903,17 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurfaceEXT (EGLDisplay dpy,
|
||||
#define EGL_PLATFORM_X11_SCREEN_EXT 0x31D6
|
||||
#endif /* EGL_EXT_platform_x11 */
|
||||
|
||||
#ifndef EGL_EXT_platform_xcb
|
||||
#define EGL_EXT_platform_xcb 1
|
||||
#define EGL_PLATFORM_XCB_EXT 0x31DC
|
||||
#define EGL_PLATFORM_XCB_SCREEN_EXT 0x31DE
|
||||
#endif /* EGL_EXT_platform_xcb */
|
||||
|
||||
#ifndef EGL_EXT_present_opaque
|
||||
#define EGL_EXT_present_opaque 1
|
||||
#define EGL_PRESENT_OPAQUE_EXT 0x31DF
|
||||
#endif /* EGL_EXT_present_opaque */
|
||||
|
||||
#ifndef EGL_EXT_protected_content
|
||||
#define EGL_EXT_protected_content 1
|
||||
#define EGL_PROTECTED_CONTENT_EXT 0x32C0
|
||||
@ -911,11 +952,36 @@ EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerOutputEXT (EGLDisplay dpy, EGLStr
|
||||
#define EGL_METADATA_SCALING_EXT 50000
|
||||
#endif /* EGL_EXT_surface_SMPTE2086_metadata */
|
||||
|
||||
#ifndef EGL_EXT_surface_compression
|
||||
#define EGL_EXT_surface_compression 1
|
||||
#define EGL_SURFACE_COMPRESSION_EXT 0x34B0
|
||||
#define EGL_SURFACE_COMPRESSION_PLANE1_EXT 0x328E
|
||||
#define EGL_SURFACE_COMPRESSION_PLANE2_EXT 0x328F
|
||||
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_NONE_EXT 0x34B1
|
||||
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_DEFAULT_EXT 0x34B2
|
||||
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_1BPC_EXT 0x34B4
|
||||
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_2BPC_EXT 0x34B5
|
||||
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_3BPC_EXT 0x34B6
|
||||
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_4BPC_EXT 0x34B7
|
||||
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_5BPC_EXT 0x34B8
|
||||
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_6BPC_EXT 0x34B9
|
||||
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_7BPC_EXT 0x34BA
|
||||
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_8BPC_EXT 0x34BB
|
||||
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_9BPC_EXT 0x34BC
|
||||
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_10BPC_EXT 0x34BD
|
||||
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_11BPC_EXT 0x34BE
|
||||
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_12BPC_EXT 0x34BF
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSUPPORTEDCOMPRESSIONRATESEXTPROC) (EGLDisplay dpy, EGLConfig config, const EGLAttrib *attrib_list, EGLint *rates, EGLint rate_size, EGLint *num_rates);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQuerySupportedCompressionRatesEXT (EGLDisplay dpy, EGLConfig config, const EGLAttrib *attrib_list, EGLint *rates, EGLint rate_size, EGLint *num_rates);
|
||||
#endif
|
||||
#endif /* EGL_EXT_surface_compression */
|
||||
|
||||
#ifndef EGL_EXT_swap_buffers_with_damage
|
||||
#define EGL_EXT_swap_buffers_with_damage 1
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects);
|
||||
#endif
|
||||
#endif /* EGL_EXT_swap_buffers_with_damage */
|
||||
|
||||
@ -1129,11 +1195,34 @@ EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface sur
|
||||
#endif
|
||||
#endif /* EGL_NV_post_sub_buffer */
|
||||
|
||||
#ifndef EGL_NV_quadruple_buffer
|
||||
#define EGL_NV_quadruple_buffer 1
|
||||
#define EGL_QUADRUPLE_BUFFER_NV 0x3231
|
||||
#endif /* EGL_NV_quadruple_buffer */
|
||||
|
||||
#ifndef EGL_NV_robustness_video_memory_purge
|
||||
#define EGL_NV_robustness_video_memory_purge 1
|
||||
#define EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x334C
|
||||
#endif /* EGL_NV_robustness_video_memory_purge */
|
||||
|
||||
#ifndef EGL_NV_stream_consumer_eglimage
|
||||
#define EGL_NV_stream_consumer_eglimage 1
|
||||
#define EGL_STREAM_CONSUMER_IMAGE_NV 0x3373
|
||||
#define EGL_STREAM_IMAGE_ADD_NV 0x3374
|
||||
#define EGL_STREAM_IMAGE_REMOVE_NV 0x3375
|
||||
#define EGL_STREAM_IMAGE_AVAILABLE_NV 0x3376
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMIMAGECONSUMERCONNECTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, const EGLuint64KHR *modifiers, const EGLAttrib *attrib_list);
|
||||
typedef EGLint (EGLAPIENTRYP PFNEGLQUERYSTREAMCONSUMEREVENTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMACQUIREIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMRELEASEIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglStreamImageConsumerConnectNV (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, const EGLuint64KHR *modifiers, const EGLAttrib *attrib_list);
|
||||
EGLAPI EGLint EGLAPIENTRY eglQueryStreamConsumerEventNV (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglStreamAcquireImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglStreamReleaseImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync);
|
||||
#endif
|
||||
#endif /* EGL_NV_stream_consumer_eglimage */
|
||||
|
||||
#ifndef EGL_NV_stream_consumer_gltexture_yuv
|
||||
#define EGL_NV_stream_consumer_gltexture_yuv 1
|
||||
#define EGL_YUV_PLANE0_TEXTURE_UNIT_NV 0x332C
|
||||
@ -1170,6 +1259,12 @@ EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalAttribsNV (EGLDi
|
||||
#define EGL_STREAM_CROSS_SYSTEM_NV 0x334F
|
||||
#endif /* EGL_NV_stream_cross_system */
|
||||
|
||||
#ifndef EGL_NV_stream_dma
|
||||
#define EGL_NV_stream_dma 1
|
||||
#define EGL_STREAM_DMA_NV 0x3371
|
||||
#define EGL_STREAM_DMA_SERVER_NV 0x3372
|
||||
#endif /* EGL_NV_stream_dma */
|
||||
|
||||
#ifndef EGL_NV_stream_fifo_next
|
||||
#define EGL_NV_stream_fifo_next 1
|
||||
#define EGL_PENDING_FRAME_NV 0x3329
|
||||
@ -1221,6 +1316,21 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamMetadataNV (EGLDisplay dpy, EGLStrea
|
||||
#endif
|
||||
#endif /* EGL_NV_stream_metadata */
|
||||
|
||||
#ifndef EGL_NV_stream_origin
|
||||
#define EGL_NV_stream_origin 1
|
||||
#define EGL_STREAM_FRAME_ORIGIN_X_NV 0x3366
|
||||
#define EGL_STREAM_FRAME_ORIGIN_Y_NV 0x3367
|
||||
#define EGL_STREAM_FRAME_MAJOR_AXIS_NV 0x3368
|
||||
#define EGL_CONSUMER_AUTO_ORIENTATION_NV 0x3369
|
||||
#define EGL_PRODUCER_AUTO_ORIENTATION_NV 0x336A
|
||||
#define EGL_LEFT_NV 0x336B
|
||||
#define EGL_RIGHT_NV 0x336C
|
||||
#define EGL_TOP_NV 0x336D
|
||||
#define EGL_BOTTOM_NV 0x336E
|
||||
#define EGL_X_AXIS_NV 0x336F
|
||||
#define EGL_Y_AXIS_NV 0x3370
|
||||
#endif /* EGL_NV_stream_origin */
|
||||
|
||||
#ifndef EGL_NV_stream_remote
|
||||
#define EGL_NV_stream_remote 1
|
||||
#define EGL_STREAM_STATE_INITIALIZING_NV 0x3240
|
||||
@ -1317,6 +1427,11 @@ EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV (void);
|
||||
#endif /* KHRONOS_SUPPORT_INT64 */
|
||||
#endif /* EGL_NV_system_time */
|
||||
|
||||
#ifndef EGL_NV_triple_buffer
|
||||
#define EGL_NV_triple_buffer 1
|
||||
#define EGL_TRIPLE_BUFFER_NV 0x3230
|
||||
#endif /* EGL_NV_triple_buffer */
|
||||
|
||||
#ifndef EGL_TIZEN_image_native_buffer
|
||||
#define EGL_TIZEN_image_native_buffer 1
|
||||
#define EGL_NATIVE_BUFFER_TIZEN 0x32A0
|
||||
@ -1327,6 +1442,40 @@ EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV (void);
|
||||
#define EGL_NATIVE_SURFACE_TIZEN 0x32A1
|
||||
#endif /* EGL_TIZEN_image_native_surface */
|
||||
|
||||
#ifndef EGL_WL_bind_wayland_display
|
||||
#define EGL_WL_bind_wayland_display 1
|
||||
#define PFNEGLBINDWAYLANDDISPLAYWL PFNEGLBINDWAYLANDDISPLAYWLPROC
|
||||
#define PFNEGLUNBINDWAYLANDDISPLAYWL PFNEGLUNBINDWAYLANDDISPLAYWLPROC
|
||||
#define PFNEGLQUERYWAYLANDBUFFERWL PFNEGLQUERYWAYLANDBUFFERWLPROC
|
||||
struct wl_display;
|
||||
struct wl_resource;
|
||||
#define EGL_WAYLAND_BUFFER_WL 0x31D5
|
||||
#define EGL_WAYLAND_PLANE_WL 0x31D6
|
||||
#define EGL_TEXTURE_Y_U_V_WL 0x31D7
|
||||
#define EGL_TEXTURE_Y_UV_WL 0x31D8
|
||||
#define EGL_TEXTURE_Y_XUXV_WL 0x31D9
|
||||
#define EGL_TEXTURE_EXTERNAL_WL 0x31DA
|
||||
#define EGL_WAYLAND_Y_INVERTED_WL 0x31DB
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWLPROC) (EGLDisplay dpy, struct wl_display *display);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWLPROC) (EGLDisplay dpy, struct wl_display *display);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWLPROC) (EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL (EGLDisplay dpy, struct wl_display *display);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL (EGLDisplay dpy, struct wl_display *display);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryWaylandBufferWL (EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value);
|
||||
#endif
|
||||
#endif /* EGL_WL_bind_wayland_display */
|
||||
|
||||
#ifndef EGL_WL_create_wayland_buffer_from_image
|
||||
#define EGL_WL_create_wayland_buffer_from_image 1
|
||||
#define PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWL PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWLPROC
|
||||
struct wl_buffer;
|
||||
typedef struct wl_buffer *(EGLAPIENTRYP PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWLPROC) (EGLDisplay dpy, EGLImageKHR image);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI struct wl_buffer *EGLAPIENTRY eglCreateWaylandBufferFromImageWL (EGLDisplay dpy, EGLImageKHR image);
|
||||
#endif
|
||||
#endif /* EGL_WL_create_wayland_buffer_from_image */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
55
3rdparty/khronos/EGL/eglplatform.h
vendored
55
3rdparty/khronos/EGL/eglplatform.h
vendored
@ -2,36 +2,17 @@
|
||||
#define __eglplatform_h_
|
||||
|
||||
/*
|
||||
** Copyright (c) 2007-2016 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
** Copyright 2007-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* Platform-specific types and definitions for egl.h
|
||||
* $Revision: 30994 $ on $Date: 2015-04-30 13:36:48 -0700 (Thu, 30 Apr 2015) $
|
||||
*
|
||||
* Adopters may modify khrplatform.h and this file to suit their platform.
|
||||
* You are encouraged to submit all modifications to the Khronos group so that
|
||||
* they can be included in future versions of this file. Please submit changes
|
||||
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
|
||||
* by filing a bug against product "EGL" component "Registry".
|
||||
* by filing an issue or pull request on the public Khronos EGL Registry, at
|
||||
* https://www.github.com/KhronosGroup/EGL-Registry/
|
||||
*/
|
||||
|
||||
#include <KHR/khrplatform.h>
|
||||
@ -67,7 +48,13 @@
|
||||
* implementations.
|
||||
*/
|
||||
|
||||
#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
|
||||
#if defined(EGL_NO_PLATFORM_SPECIFIC_TYPES)
|
||||
|
||||
typedef void *EGLNativeDisplayType;
|
||||
typedef void *EGLNativePixmapType;
|
||||
typedef void *EGLNativeWindowType;
|
||||
|
||||
#elif defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#endif
|
||||
@ -77,6 +64,12 @@ typedef HDC EGLNativeDisplayType;
|
||||
typedef HBITMAP EGLNativePixmapType;
|
||||
typedef HWND EGLNativeWindowType;
|
||||
|
||||
#elif defined(__EMSCRIPTEN__)
|
||||
|
||||
typedef int EGLNativeDisplayType;
|
||||
typedef int EGLNativePixmapType;
|
||||
typedef int EGLNativeWindowType;
|
||||
|
||||
#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
|
||||
|
||||
typedef int EGLNativeDisplayType;
|
||||
@ -110,7 +103,7 @@ typedef intptr_t EGLNativeDisplayType;
|
||||
typedef intptr_t EGLNativePixmapType;
|
||||
typedef intptr_t EGLNativeWindowType;
|
||||
|
||||
#elif defined(__unix__) || defined(USE_X11)
|
||||
#elif defined(USE_X11)
|
||||
|
||||
/* X11 (tentative) */
|
||||
#include <X11/Xlib.h>
|
||||
@ -120,6 +113,12 @@ typedef Display *EGLNativeDisplayType;
|
||||
typedef Pixmap EGLNativePixmapType;
|
||||
typedef Window EGLNativeWindowType;
|
||||
|
||||
#elif defined(__unix__)
|
||||
|
||||
typedef void *EGLNativeDisplayType;
|
||||
typedef khronos_uintptr_t EGLNativePixmapType;
|
||||
typedef khronos_uintptr_t EGLNativeWindowType;
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
|
||||
typedef int EGLNativeDisplayType;
|
||||
@ -134,6 +133,12 @@ typedef void *EGLNativeDisplayType;
|
||||
typedef khronos_uintptr_t EGLNativePixmapType;
|
||||
typedef khronos_uintptr_t EGLNativeWindowType;
|
||||
|
||||
#elif defined(__Fuchsia__)
|
||||
|
||||
typedef void *EGLNativeDisplayType;
|
||||
typedef khronos_uintptr_t EGLNativePixmapType;
|
||||
typedef khronos_uintptr_t EGLNativeWindowType;
|
||||
|
||||
#else
|
||||
#error "Platform not recognized"
|
||||
#endif
|
||||
|
29
3rdparty/khronos/GLES2/gl2.h
vendored
29
3rdparty/khronos/GLES2/gl2.h
vendored
@ -6,28 +6,9 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2013-2018 The Khronos Group Inc.
|
||||
** Copyright 2013-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: MIT
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
/*
|
||||
** This header is generated from the Khronos OpenGL / OpenGL ES XML
|
||||
** API Registry. The current version of the Registry, generator scripts
|
||||
** used to make the header, and the header can be found at
|
||||
@ -44,7 +25,7 @@ extern "C" {
|
||||
#define GL_GLES_PROTOTYPES 1
|
||||
#endif
|
||||
|
||||
/* Generated on date 20190228 */
|
||||
/* Generated on date 20220530 */
|
||||
|
||||
/* Generated C header for:
|
||||
* API: gles2
|
||||
@ -477,7 +458,7 @@ typedef void (GL_APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void);
|
||||
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert);
|
||||
typedef void (GL_APIENTRYP PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
|
||||
typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length);
|
||||
typedef void (GL_APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
|
||||
typedef void (GL_APIENTRYP PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask);
|
||||
typedef void (GL_APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask);
|
||||
@ -620,7 +601,7 @@ GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
|
||||
GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);
|
||||
GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
|
||||
GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length);
|
||||
GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
|
||||
GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
|
||||
GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
|
||||
|
398
3rdparty/khronos/GLES2/gl2ext.h
vendored
398
3rdparty/khronos/GLES2/gl2ext.h
vendored
@ -6,28 +6,9 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2013-2018 The Khronos Group Inc.
|
||||
** Copyright 2013-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: MIT
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
/*
|
||||
** This header is generated from the Khronos OpenGL / OpenGL ES XML
|
||||
** API Registry. The current version of the Registry, generator scripts
|
||||
** used to make the header, and the header can be found at
|
||||
@ -38,7 +19,7 @@ extern "C" {
|
||||
#define GL_APIENTRYP GL_APIENTRY*
|
||||
#endif
|
||||
|
||||
/* Generated on date 20190228 */
|
||||
/* Generated on date 20220530 */
|
||||
|
||||
/* Generated C header for:
|
||||
* API: gles2
|
||||
@ -197,6 +178,22 @@ GL_APICALL void GL_APIENTRY glGetnUniformuivKHR (GLuint program, GLint location,
|
||||
#endif
|
||||
#endif /* GL_KHR_robustness */
|
||||
|
||||
#ifndef GL_KHR_shader_subgroup
|
||||
#define GL_KHR_shader_subgroup 1
|
||||
#define GL_SUBGROUP_SIZE_KHR 0x9532
|
||||
#define GL_SUBGROUP_SUPPORTED_STAGES_KHR 0x9533
|
||||
#define GL_SUBGROUP_SUPPORTED_FEATURES_KHR 0x9534
|
||||
#define GL_SUBGROUP_QUAD_ALL_STAGES_KHR 0x9535
|
||||
#define GL_SUBGROUP_FEATURE_BASIC_BIT_KHR 0x00000001
|
||||
#define GL_SUBGROUP_FEATURE_VOTE_BIT_KHR 0x00000002
|
||||
#define GL_SUBGROUP_FEATURE_ARITHMETIC_BIT_KHR 0x00000004
|
||||
#define GL_SUBGROUP_FEATURE_BALLOT_BIT_KHR 0x00000008
|
||||
#define GL_SUBGROUP_FEATURE_SHUFFLE_BIT_KHR 0x00000010
|
||||
#define GL_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT_KHR 0x00000020
|
||||
#define GL_SUBGROUP_FEATURE_CLUSTERED_BIT_KHR 0x00000040
|
||||
#define GL_SUBGROUP_FEATURE_QUAD_BIT_KHR 0x00000080
|
||||
#endif /* GL_KHR_shader_subgroup */
|
||||
|
||||
#ifndef GL_KHR_texture_compression_astc_hdr
|
||||
#define GL_KHR_texture_compression_astc_hdr 1
|
||||
#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0
|
||||
@ -334,12 +331,12 @@ GL_APICALL GLboolean GL_APIENTRY glIsEnablediOES (GLenum target, GLuint index);
|
||||
typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXOESPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
|
||||
typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXOESPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
|
||||
typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXOESPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
|
||||
typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex);
|
||||
typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glDrawElementsBaseVertexOES (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
|
||||
GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertexOES (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
|
||||
GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexOES (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
|
||||
GL_APICALL void GL_APIENTRY glMultiDrawElementsBaseVertexEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex);
|
||||
GL_APICALL void GL_APIENTRY glMultiDrawElementsBaseVertexEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex);
|
||||
#endif
|
||||
#endif /* GL_OES_draw_elements_base_vertex */
|
||||
|
||||
@ -930,9 +927,9 @@ GL_APICALL void GL_APIENTRY glVertexAttribDivisorANGLE (GLuint index, GLuint div
|
||||
#ifndef GL_ANGLE_translated_shader_source
|
||||
#define GL_ANGLE_translated_shader_source 1
|
||||
#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0
|
||||
typedef void (GL_APIENTRYP PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source);
|
||||
typedef void (GL_APIENTRYP PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLE (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source);
|
||||
GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLE (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
|
||||
#endif
|
||||
#endif /* GL_ANGLE_translated_shader_source */
|
||||
|
||||
@ -1010,7 +1007,7 @@ typedef void (GL_APIENTRYP PFNGLDELETESYNCAPPLEPROC) (GLsync sync);
|
||||
typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
|
||||
typedef void (GL_APIENTRYP PFNGLWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
|
||||
typedef void (GL_APIENTRYP PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64 *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
|
||||
typedef void (GL_APIENTRYP PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL GLsync GL_APIENTRY glFenceSyncAPPLE (GLenum condition, GLbitfield flags);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsSyncAPPLE (GLsync sync);
|
||||
@ -1018,7 +1015,7 @@ GL_APICALL void GL_APIENTRY glDeleteSyncAPPLE (GLsync sync);
|
||||
GL_APICALL GLenum GL_APIENTRY glClientWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout);
|
||||
GL_APICALL void GL_APIENTRY glWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout);
|
||||
GL_APICALL void GL_APIENTRY glGetInteger64vAPPLE (GLenum pname, GLint64 *params);
|
||||
GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
|
||||
GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values);
|
||||
#endif
|
||||
#endif /* GL_APPLE_sync */
|
||||
|
||||
@ -1065,6 +1062,11 @@ GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei
|
||||
#define GL_ARM_shader_framebuffer_fetch_depth_stencil 1
|
||||
#endif /* GL_ARM_shader_framebuffer_fetch_depth_stencil */
|
||||
|
||||
#ifndef GL_ARM_texture_unnormalized_coordinates
|
||||
#define GL_ARM_texture_unnormalized_coordinates 1
|
||||
#define GL_TEXTURE_UNNORMALIZED_COORDINATES_ARM 0x8F6A
|
||||
#endif /* GL_ARM_texture_unnormalized_coordinates */
|
||||
|
||||
#ifndef GL_DMP_program_binary
|
||||
#define GL_DMP_program_binary 1
|
||||
#define GL_SMAPHS30_PROGRAM_BINARY_DMP 0x9251
|
||||
@ -1091,6 +1093,13 @@ GL_APICALL void GL_APIENTRY glEGLImageTargetTextureStorageEXT (GLuint texture, G
|
||||
#endif
|
||||
#endif /* GL_EXT_EGL_image_storage */
|
||||
|
||||
#ifndef GL_EXT_EGL_image_storage_compression
|
||||
#define GL_EXT_EGL_image_storage_compression 1
|
||||
#define GL_SURFACE_COMPRESSION_EXT 0x96C0
|
||||
#define GL_SURFACE_COMPRESSION_FIXED_RATE_NONE_EXT 0x96C1
|
||||
#define GL_SURFACE_COMPRESSION_FIXED_RATE_DEFAULT_EXT 0x96C2
|
||||
#endif /* GL_EXT_EGL_image_storage_compression */
|
||||
|
||||
#ifndef GL_EXT_YUV_target
|
||||
#define GL_EXT_YUV_target 1
|
||||
#define GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT 0x8BE7
|
||||
@ -1282,6 +1291,7 @@ typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTIVEXTPROC) (GLuint id, GLenum pnam
|
||||
typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVEXTPROC) (GLuint id, GLenum pname, GLuint *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64 *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64 *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETINTEGER64VEXTPROC) (GLenum pname, GLint64 *data);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glGenQueriesEXT (GLsizei n, GLuint *ids);
|
||||
GL_APICALL void GL_APIENTRY glDeleteQueriesEXT (GLsizei n, const GLuint *ids);
|
||||
@ -1294,6 +1304,7 @@ GL_APICALL void GL_APIENTRY glGetQueryObjectivEXT (GLuint id, GLenum pname, GLin
|
||||
GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT (GLuint id, GLenum pname, GLuint *params);
|
||||
GL_APICALL void GL_APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64 *params);
|
||||
GL_APICALL void GL_APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64 *params);
|
||||
GL_APICALL void GL_APIENTRY glGetInteger64vEXT (GLenum pname, GLint64 *data);
|
||||
#endif
|
||||
#endif /* GL_EXT_disjoint_timer_query */
|
||||
|
||||
@ -1408,6 +1419,46 @@ GL_APICALL void GL_APIENTRY glNamedBufferStorageExternalEXT (GLuint buffer, GLin
|
||||
#define GL_EXT_float_blend 1
|
||||
#endif /* GL_EXT_float_blend */
|
||||
|
||||
#ifndef GL_EXT_fragment_shading_rate
|
||||
#define GL_EXT_fragment_shading_rate 1
|
||||
#define GL_SHADING_RATE_1X1_PIXELS_EXT 0x96A6
|
||||
#define GL_SHADING_RATE_1X2_PIXELS_EXT 0x96A7
|
||||
#define GL_SHADING_RATE_2X1_PIXELS_EXT 0x96A8
|
||||
#define GL_SHADING_RATE_2X2_PIXELS_EXT 0x96A9
|
||||
#define GL_SHADING_RATE_1X4_PIXELS_EXT 0x96AA
|
||||
#define GL_SHADING_RATE_4X1_PIXELS_EXT 0x96AB
|
||||
#define GL_SHADING_RATE_4X2_PIXELS_EXT 0x96AC
|
||||
#define GL_SHADING_RATE_2X4_PIXELS_EXT 0x96AD
|
||||
#define GL_SHADING_RATE_4X4_PIXELS_EXT 0x96AE
|
||||
#define GL_SHADING_RATE_EXT 0x96D0
|
||||
#define GL_SHADING_RATE_ATTACHMENT_EXT 0x96D1
|
||||
#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_EXT 0x96D2
|
||||
#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_EXT 0x96D3
|
||||
#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_MIN_EXT 0x96D4
|
||||
#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_MAX_EXT 0x96D5
|
||||
#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_EXT 0x96D6
|
||||
#define GL_MIN_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_WIDTH_EXT 0x96D7
|
||||
#define GL_MAX_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_WIDTH_EXT 0x96D8
|
||||
#define GL_MIN_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_HEIGHT_EXT 0x96D9
|
||||
#define GL_MAX_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_HEIGHT_EXT 0x96DA
|
||||
#define GL_MAX_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_ASPECT_RATIO_EXT 0x96DB
|
||||
#define GL_MAX_FRAGMENT_SHADING_RATE_ATTACHMENT_LAYERS_EXT 0x96DC
|
||||
#define GL_FRAGMENT_SHADING_RATE_WITH_SHADER_DEPTH_STENCIL_WRITES_SUPPORTED_EXT 0x96DD
|
||||
#define GL_FRAGMENT_SHADING_RATE_WITH_SAMPLE_MASK_SUPPORTED_EXT 0x96DE
|
||||
#define GL_FRAGMENT_SHADING_RATE_ATTACHMENT_WITH_DEFAULT_FRAMEBUFFER_SUPPORTED_EXT 0x96DF
|
||||
#define GL_FRAGMENT_SHADING_RATE_NON_TRIVIAL_COMBINERS_SUPPORTED_EXT 0x8F6F
|
||||
typedef void (GL_APIENTRYP PFNGLGETFRAGMENTSHADINGRATESEXTPROC) (GLsizei samples, GLsizei maxCount, GLsizei *count, GLenum *shadingRates);
|
||||
typedef void (GL_APIENTRYP PFNGLSHADINGRATEEXTPROC) (GLenum rate);
|
||||
typedef void (GL_APIENTRYP PFNGLSHADINGRATECOMBINEROPSEXTPROC) (GLenum combinerOp0, GLenum combinerOp1);
|
||||
typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERSHADINGRATEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint baseLayer, GLsizei numLayers, GLsizei texelWidth, GLsizei texelHeight);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glGetFragmentShadingRatesEXT (GLsizei samples, GLsizei maxCount, GLsizei *count, GLenum *shadingRates);
|
||||
GL_APICALL void GL_APIENTRY glShadingRateEXT (GLenum rate);
|
||||
GL_APICALL void GL_APIENTRY glShadingRateCombinerOpsEXT (GLenum combinerOp0, GLenum combinerOp1);
|
||||
GL_APICALL void GL_APIENTRY glFramebufferShadingRateEXT (GLenum target, GLenum attachment, GLuint texture, GLint baseLayer, GLsizei numLayers, GLsizei texelWidth, GLsizei texelHeight);
|
||||
#endif
|
||||
#endif /* GL_EXT_fragment_shading_rate */
|
||||
|
||||
#ifndef GL_EXT_geometry_point_size
|
||||
#define GL_EXT_geometry_point_size 1
|
||||
#endif /* GL_EXT_geometry_point_size */
|
||||
@ -1601,6 +1652,10 @@ GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum target,
|
||||
#endif
|
||||
#endif /* GL_EXT_multisampled_render_to_texture */
|
||||
|
||||
#ifndef GL_EXT_multisampled_render_to_texture2
|
||||
#define GL_EXT_multisampled_render_to_texture2 1
|
||||
#endif /* GL_EXT_multisampled_render_to_texture2 */
|
||||
|
||||
#ifndef GL_EXT_multiview_draw_buffers
|
||||
#define GL_EXT_multiview_draw_buffers 1
|
||||
#define GL_COLOR_ATTACHMENT_EXT 0x90F0
|
||||
@ -1618,6 +1673,18 @@ GL_APICALL void GL_APIENTRY glGetIntegeri_vEXT (GLenum target, GLuint index, GLi
|
||||
#endif
|
||||
#endif /* GL_EXT_multiview_draw_buffers */
|
||||
|
||||
#ifndef GL_EXT_multiview_tessellation_geometry_shader
|
||||
#define GL_EXT_multiview_tessellation_geometry_shader 1
|
||||
#endif /* GL_EXT_multiview_tessellation_geometry_shader */
|
||||
|
||||
#ifndef GL_EXT_multiview_texture_multisample
|
||||
#define GL_EXT_multiview_texture_multisample 1
|
||||
#endif /* GL_EXT_multiview_texture_multisample */
|
||||
|
||||
#ifndef GL_EXT_multiview_timer_query
|
||||
#define GL_EXT_multiview_timer_query 1
|
||||
#endif /* GL_EXT_multiview_timer_query */
|
||||
|
||||
#ifndef GL_EXT_occlusion_query_boolean
|
||||
#define GL_EXT_occlusion_query_boolean 1
|
||||
#define GL_ANY_SAMPLES_PASSED_EXT 0x8C2F
|
||||
@ -1775,6 +1842,10 @@ GL_APICALL void GL_APIENTRY glImportSemaphoreWin32NameEXT (GLuint semaphore, GLe
|
||||
#endif
|
||||
#endif /* GL_EXT_semaphore_win32 */
|
||||
|
||||
#ifndef GL_EXT_separate_depth_stencil
|
||||
#define GL_EXT_separate_depth_stencil 1
|
||||
#endif /* GL_EXT_separate_depth_stencil */
|
||||
|
||||
#ifndef GL_EXT_separate_shader_objects
|
||||
#define GL_EXT_separate_shader_objects 1
|
||||
#define GL_ACTIVE_PROGRAM_EXT 0x8259
|
||||
@ -1930,6 +2001,10 @@ GL_APICALL void GL_APIENTRY glClearPixelLocalStorageuiEXT (GLsizei offset, GLsiz
|
||||
#endif
|
||||
#endif /* GL_EXT_shader_pixel_local_storage2 */
|
||||
|
||||
#ifndef GL_EXT_shader_samples_identical
|
||||
#define GL_EXT_shader_samples_identical 1
|
||||
#endif /* GL_EXT_shader_samples_identical */
|
||||
|
||||
#ifndef GL_EXT_shader_texture_lod
|
||||
#define GL_EXT_shader_texture_lod 1
|
||||
#endif /* GL_EXT_shader_texture_lod */
|
||||
@ -2188,6 +2263,10 @@ GL_APICALL void GL_APIENTRY glTexBufferRangeEXT (GLenum target, GLenum internalf
|
||||
#define GL_SKIP_DECODE_EXT 0x8A4A
|
||||
#endif /* GL_EXT_texture_sRGB_decode */
|
||||
|
||||
#ifndef GL_EXT_texture_shadow_lod
|
||||
#define GL_EXT_texture_shadow_lod 1
|
||||
#endif /* GL_EXT_texture_shadow_lod */
|
||||
|
||||
#ifndef GL_EXT_texture_storage
|
||||
#define GL_EXT_texture_storage 1
|
||||
#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F
|
||||
@ -2220,6 +2299,29 @@ GL_APICALL void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target
|
||||
#endif
|
||||
#endif /* GL_EXT_texture_storage */
|
||||
|
||||
#ifndef GL_EXT_texture_storage_compression
|
||||
#define GL_EXT_texture_storage_compression 1
|
||||
#define GL_NUM_SURFACE_COMPRESSION_FIXED_RATES_EXT 0x8F6E
|
||||
#define GL_SURFACE_COMPRESSION_FIXED_RATE_1BPC_EXT 0x96C4
|
||||
#define GL_SURFACE_COMPRESSION_FIXED_RATE_2BPC_EXT 0x96C5
|
||||
#define GL_SURFACE_COMPRESSION_FIXED_RATE_3BPC_EXT 0x96C6
|
||||
#define GL_SURFACE_COMPRESSION_FIXED_RATE_4BPC_EXT 0x96C7
|
||||
#define GL_SURFACE_COMPRESSION_FIXED_RATE_5BPC_EXT 0x96C8
|
||||
#define GL_SURFACE_COMPRESSION_FIXED_RATE_6BPC_EXT 0x96C9
|
||||
#define GL_SURFACE_COMPRESSION_FIXED_RATE_7BPC_EXT 0x96CA
|
||||
#define GL_SURFACE_COMPRESSION_FIXED_RATE_8BPC_EXT 0x96CB
|
||||
#define GL_SURFACE_COMPRESSION_FIXED_RATE_9BPC_EXT 0x96CC
|
||||
#define GL_SURFACE_COMPRESSION_FIXED_RATE_10BPC_EXT 0x96CD
|
||||
#define GL_SURFACE_COMPRESSION_FIXED_RATE_11BPC_EXT 0x96CE
|
||||
#define GL_SURFACE_COMPRESSION_FIXED_RATE_12BPC_EXT 0x96CF
|
||||
typedef void (GL_APIENTRYP PFNGLTEXSTORAGEATTRIBS2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, const GLint* attrib_list);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXSTORAGEATTRIBS3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, const GLint* attrib_list);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glTexStorageAttribs2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, const GLint* attrib_list);
|
||||
GL_APICALL void GL_APIENTRY glTexStorageAttribs3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, const GLint* attrib_list);
|
||||
#endif
|
||||
#endif /* GL_EXT_texture_storage_compression */
|
||||
|
||||
#ifndef GL_EXT_texture_type_2_10_10_10_REV
|
||||
#define GL_EXT_texture_type_2_10_10_10_REV 1
|
||||
#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368
|
||||
@ -2420,11 +2522,32 @@ GL_APICALL void GL_APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint quer
|
||||
#endif
|
||||
#endif /* GL_INTEL_performance_query */
|
||||
|
||||
#ifndef GL_MESA_bgra
|
||||
#define GL_MESA_bgra 1
|
||||
#define GL_BGR_EXT 0x80E0
|
||||
#endif /* GL_MESA_bgra */
|
||||
|
||||
#ifndef GL_MESA_framebuffer_flip_x
|
||||
#define GL_MESA_framebuffer_flip_x 1
|
||||
#define GL_FRAMEBUFFER_FLIP_X_MESA 0x8BBC
|
||||
#endif /* GL_MESA_framebuffer_flip_x */
|
||||
|
||||
#ifndef GL_MESA_framebuffer_flip_y
|
||||
#define GL_MESA_framebuffer_flip_y 1
|
||||
#define GL_FRAMEBUFFER_FLIP_Y_MESA 0x8BBB
|
||||
typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERPARAMETERIMESAPROC) (GLenum target, GLenum pname, GLint param);
|
||||
typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVMESAPROC) (GLenum target, GLenum pname, GLint *params);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glFramebufferParameteriMESA (GLenum target, GLenum pname, GLint param);
|
||||
GL_APICALL void GL_APIENTRY glGetFramebufferParameterivMESA (GLenum target, GLenum pname, GLint *params);
|
||||
#endif
|
||||
#endif /* GL_MESA_framebuffer_flip_y */
|
||||
|
||||
#ifndef GL_MESA_framebuffer_swap_xy
|
||||
#define GL_MESA_framebuffer_swap_xy 1
|
||||
#define GL_FRAMEBUFFER_SWAP_XY_MESA 0x8BBD
|
||||
#endif /* GL_MESA_framebuffer_swap_xy */
|
||||
|
||||
#ifndef GL_MESA_program_binary_formats
|
||||
#define GL_MESA_program_binary_formats 1
|
||||
#define GL_PROGRAM_BINARY_FORMAT_MESA 0x875F
|
||||
@ -2746,6 +2869,10 @@ GL_APICALL void GL_APIENTRY glFragmentCoverageColorNV (GLuint color);
|
||||
#endif
|
||||
#endif /* GL_NV_fragment_coverage_to_color */
|
||||
|
||||
#ifndef GL_NV_fragment_shader_barycentric
|
||||
#define GL_NV_fragment_shader_barycentric 1
|
||||
#endif /* GL_NV_fragment_shader_barycentric */
|
||||
|
||||
#ifndef GL_NV_fragment_shader_interlock
|
||||
#define GL_NV_fragment_shader_interlock 1
|
||||
#endif /* GL_NV_fragment_shader_interlock */
|
||||
@ -2773,11 +2900,11 @@ GL_APICALL void GL_APIENTRY glBlitFramebufferNV (GLint srcX0, GLint srcY0, GLint
|
||||
#define GL_COVERAGE_MODULATION_NV 0x9332
|
||||
#define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333
|
||||
typedef void (GL_APIENTRYP PFNGLCOVERAGEMODULATIONTABLENVPROC) (GLsizei n, const GLfloat *v);
|
||||
typedef void (GL_APIENTRYP PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufsize, GLfloat *v);
|
||||
typedef void (GL_APIENTRYP PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufSize, GLfloat *v);
|
||||
typedef void (GL_APIENTRYP PFNGLCOVERAGEMODULATIONNVPROC) (GLenum components);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glCoverageModulationTableNV (GLsizei n, const GLfloat *v);
|
||||
GL_APICALL void GL_APIENTRY glGetCoverageModulationTableNV (GLsizei bufsize, GLfloat *v);
|
||||
GL_APICALL void GL_APIENTRY glGetCoverageModulationTableNV (GLsizei bufSize, GLfloat *v);
|
||||
GL_APICALL void GL_APIENTRY glCoverageModulationNV (GLenum components);
|
||||
#endif
|
||||
#endif /* GL_NV_framebuffer_mixed_samples */
|
||||
@ -2925,9 +3052,9 @@ GL_APICALL void GL_APIENTRY glVertexAttribDivisorNV (GLuint index, GLuint diviso
|
||||
#define GL_SUPERSAMPLE_SCALE_X_NV 0x9372
|
||||
#define GL_SUPERSAMPLE_SCALE_Y_NV 0x9373
|
||||
#define GL_CONFORMANT_NV 0x9374
|
||||
typedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint *params);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glGetInternalformatSampleivNV (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint *params);
|
||||
GL_APICALL void GL_APIENTRY glGetInternalformatSampleivNV (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint *params);
|
||||
#endif
|
||||
#endif /* GL_NV_internalformat_sample_query */
|
||||
|
||||
@ -2959,6 +3086,82 @@ GL_APICALL void GL_APIENTRY glNamedBufferAttachMemoryNV (GLuint buffer, GLuint m
|
||||
#endif
|
||||
#endif /* GL_NV_memory_attachment */
|
||||
|
||||
#ifndef GL_NV_memory_object_sparse
|
||||
#define GL_NV_memory_object_sparse 1
|
||||
typedef void (GL_APIENTRYP PFNGLBUFFERPAGECOMMITMENTMEMNVPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXPAGECOMMITMENTMEMNVPROC) (GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit);
|
||||
typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTMEMNVPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXTUREPAGECOMMITMENTMEMNVPROC) (GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glBufferPageCommitmentMemNV (GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit);
|
||||
GL_APICALL void GL_APIENTRY glTexPageCommitmentMemNV (GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit);
|
||||
GL_APICALL void GL_APIENTRY glNamedBufferPageCommitmentMemNV (GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit);
|
||||
GL_APICALL void GL_APIENTRY glTexturePageCommitmentMemNV (GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit);
|
||||
#endif
|
||||
#endif /* GL_NV_memory_object_sparse */
|
||||
|
||||
#ifndef GL_NV_mesh_shader
|
||||
#define GL_NV_mesh_shader 1
|
||||
#define GL_MESH_SHADER_NV 0x9559
|
||||
#define GL_TASK_SHADER_NV 0x955A
|
||||
#define GL_MAX_MESH_UNIFORM_BLOCKS_NV 0x8E60
|
||||
#define GL_MAX_MESH_TEXTURE_IMAGE_UNITS_NV 0x8E61
|
||||
#define GL_MAX_MESH_IMAGE_UNIFORMS_NV 0x8E62
|
||||
#define GL_MAX_MESH_UNIFORM_COMPONENTS_NV 0x8E63
|
||||
#define GL_MAX_MESH_ATOMIC_COUNTER_BUFFERS_NV 0x8E64
|
||||
#define GL_MAX_MESH_ATOMIC_COUNTERS_NV 0x8E65
|
||||
#define GL_MAX_MESH_SHADER_STORAGE_BLOCKS_NV 0x8E66
|
||||
#define GL_MAX_COMBINED_MESH_UNIFORM_COMPONENTS_NV 0x8E67
|
||||
#define GL_MAX_TASK_UNIFORM_BLOCKS_NV 0x8E68
|
||||
#define GL_MAX_TASK_TEXTURE_IMAGE_UNITS_NV 0x8E69
|
||||
#define GL_MAX_TASK_IMAGE_UNIFORMS_NV 0x8E6A
|
||||
#define GL_MAX_TASK_UNIFORM_COMPONENTS_NV 0x8E6B
|
||||
#define GL_MAX_TASK_ATOMIC_COUNTER_BUFFERS_NV 0x8E6C
|
||||
#define GL_MAX_TASK_ATOMIC_COUNTERS_NV 0x8E6D
|
||||
#define GL_MAX_TASK_SHADER_STORAGE_BLOCKS_NV 0x8E6E
|
||||
#define GL_MAX_COMBINED_TASK_UNIFORM_COMPONENTS_NV 0x8E6F
|
||||
#define GL_MAX_MESH_WORK_GROUP_INVOCATIONS_NV 0x95A2
|
||||
#define GL_MAX_TASK_WORK_GROUP_INVOCATIONS_NV 0x95A3
|
||||
#define GL_MAX_MESH_TOTAL_MEMORY_SIZE_NV 0x9536
|
||||
#define GL_MAX_TASK_TOTAL_MEMORY_SIZE_NV 0x9537
|
||||
#define GL_MAX_MESH_OUTPUT_VERTICES_NV 0x9538
|
||||
#define GL_MAX_MESH_OUTPUT_PRIMITIVES_NV 0x9539
|
||||
#define GL_MAX_TASK_OUTPUT_COUNT_NV 0x953A
|
||||
#define GL_MAX_DRAW_MESH_TASKS_COUNT_NV 0x953D
|
||||
#define GL_MAX_MESH_VIEWS_NV 0x9557
|
||||
#define GL_MESH_OUTPUT_PER_VERTEX_GRANULARITY_NV 0x92DF
|
||||
#define GL_MESH_OUTPUT_PER_PRIMITIVE_GRANULARITY_NV 0x9543
|
||||
#define GL_MAX_MESH_WORK_GROUP_SIZE_NV 0x953B
|
||||
#define GL_MAX_TASK_WORK_GROUP_SIZE_NV 0x953C
|
||||
#define GL_MESH_WORK_GROUP_SIZE_NV 0x953E
|
||||
#define GL_TASK_WORK_GROUP_SIZE_NV 0x953F
|
||||
#define GL_MESH_VERTICES_OUT_NV 0x9579
|
||||
#define GL_MESH_PRIMITIVES_OUT_NV 0x957A
|
||||
#define GL_MESH_OUTPUT_TYPE_NV 0x957B
|
||||
#define GL_UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_NV 0x959C
|
||||
#define GL_UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_NV 0x959D
|
||||
#define GL_REFERENCED_BY_MESH_SHADER_NV 0x95A0
|
||||
#define GL_REFERENCED_BY_TASK_SHADER_NV 0x95A1
|
||||
#define GL_MESH_SHADER_BIT_NV 0x00000040
|
||||
#define GL_TASK_SHADER_BIT_NV 0x00000080
|
||||
#define GL_MESH_SUBROUTINE_NV 0x957C
|
||||
#define GL_TASK_SUBROUTINE_NV 0x957D
|
||||
#define GL_MESH_SUBROUTINE_UNIFORM_NV 0x957E
|
||||
#define GL_TASK_SUBROUTINE_UNIFORM_NV 0x957F
|
||||
#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV 0x959E
|
||||
#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV 0x959F
|
||||
typedef void (GL_APIENTRYP PFNGLDRAWMESHTASKSNVPROC) (GLuint first, GLuint count);
|
||||
typedef void (GL_APIENTRYP PFNGLDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect);
|
||||
typedef void (GL_APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect, GLsizei drawcount, GLsizei stride);
|
||||
typedef void (GL_APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTCOUNTNVPROC) (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glDrawMeshTasksNV (GLuint first, GLuint count);
|
||||
GL_APICALL void GL_APIENTRY glDrawMeshTasksIndirectNV (GLintptr indirect);
|
||||
GL_APICALL void GL_APIENTRY glMultiDrawMeshTasksIndirectNV (GLintptr indirect, GLsizei drawcount, GLsizei stride);
|
||||
GL_APICALL void GL_APIENTRY glMultiDrawMeshTasksIndirectCountNV (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
|
||||
#endif
|
||||
#endif /* GL_NV_mesh_shader */
|
||||
|
||||
#ifndef GL_NV_non_square_matrices
|
||||
#define GL_NV_non_square_matrices 1
|
||||
#define GL_FLOAT_MAT2x3_NV 0x8B65
|
||||
@ -3191,11 +3394,11 @@ typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHNVPROC) (GLuint path, GL
|
||||
typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode);
|
||||
typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
|
||||
typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
|
||||
typedef GLenum (GL_APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]);
|
||||
typedef GLenum (GL_APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint *baseAndCount);
|
||||
typedef GLenum (GL_APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
|
||||
typedef GLenum (GL_APIENTRYP PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
|
||||
typedef void (GL_APIENTRYP PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs);
|
||||
typedef void (GL_APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLfloat *params);
|
||||
typedef void (GL_APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
|
||||
typedef void (GL_APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode);
|
||||
typedef void (GL_APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m);
|
||||
@ -3268,11 +3471,11 @@ GL_APICALL void GL_APIENTRY glStencilThenCoverFillPathNV (GLuint path, GLenum fi
|
||||
GL_APICALL void GL_APIENTRY glStencilThenCoverStrokePathNV (GLuint path, GLint reference, GLuint mask, GLenum coverMode);
|
||||
GL_APICALL void GL_APIENTRY glStencilThenCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
|
||||
GL_APICALL void GL_APIENTRY glStencilThenCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
|
||||
GL_APICALL GLenum GL_APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]);
|
||||
GL_APICALL GLenum GL_APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint *baseAndCount);
|
||||
GL_APICALL GLenum GL_APIENTRY glPathGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
|
||||
GL_APICALL GLenum GL_APIENTRY glPathMemoryGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
|
||||
GL_APICALL void GL_APIENTRY glProgramPathFragmentInputGenNV (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs);
|
||||
GL_APICALL void GL_APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params);
|
||||
GL_APICALL void GL_APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLfloat *params);
|
||||
GL_APICALL void GL_APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
|
||||
GL_APICALL void GL_APIENTRY glMatrixLoadIdentityEXT (GLenum mode);
|
||||
GL_APICALL void GL_APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m);
|
||||
@ -3322,6 +3525,12 @@ GL_APICALL void GL_APIENTRY glPolygonModeNV (GLenum face, GLenum mode);
|
||||
#endif
|
||||
#endif /* GL_NV_polygon_mode */
|
||||
|
||||
#ifndef GL_NV_primitive_shading_rate
|
||||
#define GL_NV_primitive_shading_rate 1
|
||||
#define GL_SHADING_RATE_IMAGE_PER_PRIMITIVE_NV 0x95B1
|
||||
#define GL_SHADING_RATE_IMAGE_PALETTE_COUNT_NV 0x95B2
|
||||
#endif /* GL_NV_primitive_shading_rate */
|
||||
|
||||
#ifndef GL_NV_read_buffer
|
||||
#define GL_NV_read_buffer 1
|
||||
#define GL_READ_BUFFER_NV 0x0C02
|
||||
@ -3347,6 +3556,11 @@ GL_APICALL void GL_APIENTRY glReadBufferNV (GLenum mode);
|
||||
#define GL_NV_read_stencil 1
|
||||
#endif /* GL_NV_read_stencil */
|
||||
|
||||
#ifndef GL_NV_representative_fragment_test
|
||||
#define GL_NV_representative_fragment_test 1
|
||||
#define GL_REPRESENTATIVE_FRAGMENT_TEST_NV 0x937F
|
||||
#endif /* GL_NV_representative_fragment_test */
|
||||
|
||||
#ifndef GL_NV_sRGB_formats
|
||||
#define GL_NV_sRGB_formats 1
|
||||
#define GL_SLUMINANCE_NV 0x8C46
|
||||
@ -3405,6 +3619,56 @@ GL_APICALL void GL_APIENTRY glScissorExclusiveArrayvNV (GLuint first, GLsizei co
|
||||
#define GL_NV_shader_noperspective_interpolation 1
|
||||
#endif /* GL_NV_shader_noperspective_interpolation */
|
||||
|
||||
#ifndef GL_NV_shader_subgroup_partitioned
|
||||
#define GL_NV_shader_subgroup_partitioned 1
|
||||
#define GL_SUBGROUP_FEATURE_PARTITIONED_BIT_NV 0x00000100
|
||||
#endif /* GL_NV_shader_subgroup_partitioned */
|
||||
|
||||
#ifndef GL_NV_shader_texture_footprint
|
||||
#define GL_NV_shader_texture_footprint 1
|
||||
#endif /* GL_NV_shader_texture_footprint */
|
||||
|
||||
#ifndef GL_NV_shading_rate_image
|
||||
#define GL_NV_shading_rate_image 1
|
||||
#define GL_SHADING_RATE_IMAGE_NV 0x9563
|
||||
#define GL_SHADING_RATE_NO_INVOCATIONS_NV 0x9564
|
||||
#define GL_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV 0x9565
|
||||
#define GL_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV 0x9566
|
||||
#define GL_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV 0x9567
|
||||
#define GL_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV 0x9568
|
||||
#define GL_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV 0x9569
|
||||
#define GL_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV 0x956A
|
||||
#define GL_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV 0x956B
|
||||
#define GL_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV 0x956C
|
||||
#define GL_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV 0x956D
|
||||
#define GL_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV 0x956E
|
||||
#define GL_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV 0x956F
|
||||
#define GL_SHADING_RATE_IMAGE_BINDING_NV 0x955B
|
||||
#define GL_SHADING_RATE_IMAGE_TEXEL_WIDTH_NV 0x955C
|
||||
#define GL_SHADING_RATE_IMAGE_TEXEL_HEIGHT_NV 0x955D
|
||||
#define GL_SHADING_RATE_IMAGE_PALETTE_SIZE_NV 0x955E
|
||||
#define GL_MAX_COARSE_FRAGMENT_SAMPLES_NV 0x955F
|
||||
#define GL_SHADING_RATE_SAMPLE_ORDER_DEFAULT_NV 0x95AE
|
||||
#define GL_SHADING_RATE_SAMPLE_ORDER_PIXEL_MAJOR_NV 0x95AF
|
||||
#define GL_SHADING_RATE_SAMPLE_ORDER_SAMPLE_MAJOR_NV 0x95B0
|
||||
typedef void (GL_APIENTRYP PFNGLBINDSHADINGRATEIMAGENVPROC) (GLuint texture);
|
||||
typedef void (GL_APIENTRYP PFNGLGETSHADINGRATEIMAGEPALETTENVPROC) (GLuint viewport, GLuint entry, GLenum *rate);
|
||||
typedef void (GL_APIENTRYP PFNGLGETSHADINGRATESAMPLELOCATIONIVNVPROC) (GLenum rate, GLuint samples, GLuint index, GLint *location);
|
||||
typedef void (GL_APIENTRYP PFNGLSHADINGRATEIMAGEBARRIERNVPROC) (GLboolean synchronize);
|
||||
typedef void (GL_APIENTRYP PFNGLSHADINGRATEIMAGEPALETTENVPROC) (GLuint viewport, GLuint first, GLsizei count, const GLenum *rates);
|
||||
typedef void (GL_APIENTRYP PFNGLSHADINGRATESAMPLEORDERNVPROC) (GLenum order);
|
||||
typedef void (GL_APIENTRYP PFNGLSHADINGRATESAMPLEORDERCUSTOMNVPROC) (GLenum rate, GLuint samples, const GLint *locations);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glBindShadingRateImageNV (GLuint texture);
|
||||
GL_APICALL void GL_APIENTRY glGetShadingRateImagePaletteNV (GLuint viewport, GLuint entry, GLenum *rate);
|
||||
GL_APICALL void GL_APIENTRY glGetShadingRateSampleLocationivNV (GLenum rate, GLuint samples, GLuint index, GLint *location);
|
||||
GL_APICALL void GL_APIENTRY glShadingRateImageBarrierNV (GLboolean synchronize);
|
||||
GL_APICALL void GL_APIENTRY glShadingRateImagePaletteNV (GLuint viewport, GLuint first, GLsizei count, const GLenum *rates);
|
||||
GL_APICALL void GL_APIENTRY glShadingRateSampleOrderNV (GLenum order);
|
||||
GL_APICALL void GL_APIENTRY glShadingRateSampleOrderCustomNV (GLenum rate, GLuint samples, const GLint *locations);
|
||||
#endif
|
||||
#endif /* GL_NV_shading_rate_image */
|
||||
|
||||
#ifndef GL_NV_shadow_samplers_array
|
||||
#define GL_NV_shadow_samplers_array 1
|
||||
#define GL_SAMPLER_2D_ARRAY_SHADOW_NV 0x8DC4
|
||||
@ -3433,6 +3697,23 @@ GL_APICALL void GL_APIENTRY glScissorExclusiveArrayvNV (GLuint first, GLsizei co
|
||||
#define GL_NV_texture_npot_2D_mipmap 1
|
||||
#endif /* GL_NV_texture_npot_2D_mipmap */
|
||||
|
||||
#ifndef GL_NV_timeline_semaphore
|
||||
#define GL_NV_timeline_semaphore 1
|
||||
#define GL_TIMELINE_SEMAPHORE_VALUE_NV 0x9595
|
||||
#define GL_SEMAPHORE_TYPE_NV 0x95B3
|
||||
#define GL_SEMAPHORE_TYPE_BINARY_NV 0x95B4
|
||||
#define GL_SEMAPHORE_TYPE_TIMELINE_NV 0x95B5
|
||||
#define GL_MAX_TIMELINE_SEMAPHORE_VALUE_DIFFERENCE_NV 0x95B6
|
||||
typedef void (GL_APIENTRYP PFNGLCREATESEMAPHORESNVPROC) (GLsizei n, GLuint *semaphores);
|
||||
typedef void (GL_APIENTRYP PFNGLSEMAPHOREPARAMETERIVNVPROC) (GLuint semaphore, GLenum pname, const GLint *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETSEMAPHOREPARAMETERIVNVPROC) (GLuint semaphore, GLenum pname, GLint *params);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glCreateSemaphoresNV (GLsizei n, GLuint *semaphores);
|
||||
GL_APICALL void GL_APIENTRY glSemaphoreParameterivNV (GLuint semaphore, GLenum pname, const GLint *params);
|
||||
GL_APICALL void GL_APIENTRY glGetSemaphoreParameterivNV (GLuint semaphore, GLenum pname, GLint *params);
|
||||
#endif
|
||||
#endif /* GL_NV_timeline_semaphore */
|
||||
|
||||
#ifndef GL_NV_viewport_array
|
||||
#define GL_NV_viewport_array 1
|
||||
#define GL_MAX_VIEWPORTS_NV 0x825B
|
||||
@ -3599,6 +3880,14 @@ GL_APICALL void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLe
|
||||
#endif
|
||||
#endif /* GL_QCOM_extended_get2 */
|
||||
|
||||
#ifndef GL_QCOM_frame_extrapolation
|
||||
#define GL_QCOM_frame_extrapolation 1
|
||||
typedef void (GL_APIENTRYP PFNGLEXTRAPOLATETEX2DQCOMPROC) (GLuint src1, GLuint src2, GLuint output, GLfloat scaleFactor);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glExtrapolateTex2DQCOM (GLuint src1, GLuint src2, GLuint output, GLfloat scaleFactor);
|
||||
#endif
|
||||
#endif /* GL_QCOM_frame_extrapolation */
|
||||
|
||||
#ifndef GL_QCOM_framebuffer_foveated
|
||||
#define GL_QCOM_framebuffer_foveated 1
|
||||
#define GL_FOVEATION_ENABLE_BIT_QCOM 0x00000001
|
||||
@ -3611,11 +3900,27 @@ GL_APICALL void GL_APIENTRY glFramebufferFoveationParametersQCOM (GLuint framebu
|
||||
#endif
|
||||
#endif /* GL_QCOM_framebuffer_foveated */
|
||||
|
||||
#ifndef GL_QCOM_motion_estimation
|
||||
#define GL_QCOM_motion_estimation 1
|
||||
#define GL_MOTION_ESTIMATION_SEARCH_BLOCK_X_QCOM 0x8C90
|
||||
#define GL_MOTION_ESTIMATION_SEARCH_BLOCK_Y_QCOM 0x8C91
|
||||
typedef void (GL_APIENTRYP PFNGLTEXESTIMATEMOTIONQCOMPROC) (GLuint ref, GLuint target, GLuint output);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXESTIMATEMOTIONREGIONSQCOMPROC) (GLuint ref, GLuint target, GLuint output, GLuint mask);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glTexEstimateMotionQCOM (GLuint ref, GLuint target, GLuint output);
|
||||
GL_APICALL void GL_APIENTRY glTexEstimateMotionRegionsQCOM (GLuint ref, GLuint target, GLuint output, GLuint mask);
|
||||
#endif
|
||||
#endif /* GL_QCOM_motion_estimation */
|
||||
|
||||
#ifndef GL_QCOM_perfmon_global_mode
|
||||
#define GL_QCOM_perfmon_global_mode 1
|
||||
#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0
|
||||
#endif /* GL_QCOM_perfmon_global_mode */
|
||||
|
||||
#ifndef GL_QCOM_render_shared_exponent
|
||||
#define GL_QCOM_render_shared_exponent 1
|
||||
#endif /* GL_QCOM_render_shared_exponent */
|
||||
|
||||
#ifndef GL_QCOM_shader_framebuffer_fetch_noncoherent
|
||||
#define GL_QCOM_shader_framebuffer_fetch_noncoherent 1
|
||||
#define GL_FRAMEBUFFER_FETCH_NONCOHERENT_QCOM 0x96A2
|
||||
@ -3629,6 +3934,22 @@ GL_APICALL void GL_APIENTRY glFramebufferFetchBarrierQCOM (void);
|
||||
#define GL_QCOM_shader_framebuffer_fetch_rate 1
|
||||
#endif /* GL_QCOM_shader_framebuffer_fetch_rate */
|
||||
|
||||
#ifndef GL_QCOM_shading_rate
|
||||
#define GL_QCOM_shading_rate 1
|
||||
#define GL_SHADING_RATE_QCOM 0x96A4
|
||||
#define GL_SHADING_RATE_PRESERVE_ASPECT_RATIO_QCOM 0x96A5
|
||||
#define GL_SHADING_RATE_1X1_PIXELS_QCOM 0x96A6
|
||||
#define GL_SHADING_RATE_1X2_PIXELS_QCOM 0x96A7
|
||||
#define GL_SHADING_RATE_2X1_PIXELS_QCOM 0x96A8
|
||||
#define GL_SHADING_RATE_2X2_PIXELS_QCOM 0x96A9
|
||||
#define GL_SHADING_RATE_4X2_PIXELS_QCOM 0x96AC
|
||||
#define GL_SHADING_RATE_4X4_PIXELS_QCOM 0x96AE
|
||||
typedef void (GL_APIENTRYP PFNGLSHADINGRATEQCOMPROC) (GLenum rate);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glShadingRateQCOM (GLenum rate);
|
||||
#endif
|
||||
#endif /* GL_QCOM_shading_rate */
|
||||
|
||||
#ifndef GL_QCOM_texture_foveated
|
||||
#define GL_QCOM_texture_foveated 1
|
||||
#define GL_TEXTURE_FOVEATED_FEATURE_BITS_QCOM 0x8BFB
|
||||
@ -3642,6 +3963,11 @@ GL_APICALL void GL_APIENTRY glTextureFoveationParametersQCOM (GLuint texture, GL
|
||||
#endif
|
||||
#endif /* GL_QCOM_texture_foveated */
|
||||
|
||||
#ifndef GL_QCOM_texture_foveated2
|
||||
#define GL_QCOM_texture_foveated2 1
|
||||
#define GL_TEXTURE_FOVEATED_CUTOFF_DENSITY_QCOM 0x96A0
|
||||
#endif /* GL_QCOM_texture_foveated2 */
|
||||
|
||||
#ifndef GL_QCOM_texture_foveated_subsampled_layout
|
||||
#define GL_QCOM_texture_foveated_subsampled_layout 1
|
||||
#define GL_FOVEATION_SUBSAMPLED_LAYOUT_METHOD_BIT_QCOM 0x00000004
|
||||
|
15
3rdparty/khronos/GLES2/gl2platform.h
vendored
15
3rdparty/khronos/GLES2/gl2platform.h
vendored
@ -2,19 +2,8 @@
|
||||
#define __gl2platform_h_
|
||||
|
||||
/*
|
||||
** Copyright (c) 2017 The Khronos Group Inc.
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
** Copyright 2017-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h
|
||||
|
37
3rdparty/khronos/GLES3/gl3.h
vendored
37
3rdparty/khronos/GLES3/gl3.h
vendored
@ -6,28 +6,9 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2013-2018 The Khronos Group Inc.
|
||||
** Copyright 2013-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: MIT
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
/*
|
||||
** This header is generated from the Khronos OpenGL / OpenGL ES XML
|
||||
** API Registry. The current version of the Registry, generator scripts
|
||||
** used to make the header, and the header can be found at
|
||||
@ -44,7 +25,7 @@ extern "C" {
|
||||
#define GL_GLES_PROTOTYPES 1
|
||||
#endif
|
||||
|
||||
/* Generated on date 20190228 */
|
||||
/* Generated on date 20220530 */
|
||||
|
||||
/* Generated C header for:
|
||||
* API: gles2
|
||||
@ -477,7 +458,7 @@ typedef void (GL_APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void);
|
||||
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert);
|
||||
typedef void (GL_APIENTRYP PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
|
||||
typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length);
|
||||
typedef void (GL_APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
|
||||
typedef void (GL_APIENTRYP PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask);
|
||||
typedef void (GL_APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask);
|
||||
@ -620,7 +601,7 @@ GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
|
||||
GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);
|
||||
GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
|
||||
GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length);
|
||||
GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
|
||||
GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
|
||||
GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
|
||||
@ -1068,7 +1049,7 @@ typedef void (GL_APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync);
|
||||
typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
|
||||
typedef void (GL_APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
|
||||
typedef void (GL_APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *data);
|
||||
typedef void (GL_APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
|
||||
typedef void (GL_APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values);
|
||||
typedef void (GL_APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data);
|
||||
typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers);
|
||||
@ -1095,7 +1076,7 @@ typedef void (GL_APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsiz
|
||||
typedef void (GL_APIENTRYP PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
|
||||
typedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint *params);
|
||||
#if GL_GLES_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glReadBuffer (GLenum src);
|
||||
GL_APICALL void GL_APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices);
|
||||
@ -1173,7 +1154,7 @@ GL_APICALL void GL_APIENTRY glDeleteSync (GLsync sync);
|
||||
GL_APICALL GLenum GL_APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
|
||||
GL_APICALL void GL_APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
|
||||
GL_APICALL void GL_APIENTRY glGetInteger64v (GLenum pname, GLint64 *data);
|
||||
GL_APICALL void GL_APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
|
||||
GL_APICALL void GL_APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values);
|
||||
GL_APICALL void GL_APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data);
|
||||
GL_APICALL void GL_APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params);
|
||||
GL_APICALL void GL_APIENTRY glGenSamplers (GLsizei count, GLuint *samplers);
|
||||
@ -1200,7 +1181,7 @@ GL_APICALL void GL_APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numA
|
||||
GL_APICALL void GL_APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
GL_APICALL void GL_APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
GL_APICALL void GL_APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
|
||||
GL_APICALL void GL_APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
|
||||
GL_APICALL void GL_APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint *params);
|
||||
#endif
|
||||
#endif /* GL_ES_VERSION_3_0 */
|
||||
|
||||
|
39
3rdparty/khronos/GLES3/gl31.h
vendored
39
3rdparty/khronos/GLES3/gl31.h
vendored
@ -1,39 +1,18 @@
|
||||
#ifndef __gl31_h_
|
||||
#define __gl31_h_ 1
|
||||
#ifndef __gles2_gl31_h_
|
||||
#define __gles2_gl31_h_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2013-2016 The Khronos Group Inc.
|
||||
** Copyright 2013-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: MIT
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
/*
|
||||
** This header is generated from the Khronos OpenGL / OpenGL ES XML
|
||||
** API Registry. The current version of the Registry, generator scripts
|
||||
** used to make the header, and the header can be found at
|
||||
** http://www.opengl.org/registry/
|
||||
**
|
||||
** Khronos $Revision$ on $Date$
|
||||
** https://github.com/KhronosGroup/OpenGL-Registry
|
||||
*/
|
||||
|
||||
#include <GLES3/gl3platform.h>
|
||||
@ -46,7 +25,7 @@ extern "C" {
|
||||
#define GL_GLES_PROTOTYPES 1
|
||||
#endif
|
||||
|
||||
/* Generated on date 20161024 */
|
||||
/* Generated on date 20191013 */
|
||||
|
||||
/* Generated C header for:
|
||||
* API: gles2
|
||||
@ -64,8 +43,8 @@ extern "C" {
|
||||
typedef khronos_int8_t GLbyte;
|
||||
typedef khronos_float_t GLclampf;
|
||||
typedef khronos_int32_t GLfixed;
|
||||
typedef short GLshort;
|
||||
typedef unsigned short GLushort;
|
||||
typedef khronos_int16_t GLshort;
|
||||
typedef khronos_uint16_t GLushort;
|
||||
typedef void GLvoid;
|
||||
typedef struct __GLsync *GLsync;
|
||||
typedef khronos_int64_t GLint64;
|
||||
@ -672,7 +651,7 @@ GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei
|
||||
|
||||
#ifndef GL_ES_VERSION_3_0
|
||||
#define GL_ES_VERSION_3_0 1
|
||||
typedef unsigned short GLhalf;
|
||||
typedef khronos_uint16_t GLhalf;
|
||||
#define GL_READ_BUFFER 0x0C02
|
||||
#define GL_UNPACK_ROW_LENGTH 0x0CF2
|
||||
#define GL_UNPACK_SKIP_ROWS 0x0CF3
|
||||
|
39
3rdparty/khronos/GLES3/gl32.h
vendored
39
3rdparty/khronos/GLES3/gl32.h
vendored
@ -1,39 +1,18 @@
|
||||
#ifndef __gl32_h_
|
||||
#define __gl32_h_ 1
|
||||
#ifndef __gles2_gl32_h_
|
||||
#define __gles2_gl32_h_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2013-2016 The Khronos Group Inc.
|
||||
** Copyright 2013-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: MIT
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
/*
|
||||
** This header is generated from the Khronos OpenGL / OpenGL ES XML
|
||||
** API Registry. The current version of the Registry, generator scripts
|
||||
** used to make the header, and the header can be found at
|
||||
** http://www.opengl.org/registry/
|
||||
**
|
||||
** Khronos $Revision$ on $Date$
|
||||
** https://github.com/KhronosGroup/OpenGL-Registry
|
||||
*/
|
||||
|
||||
#include <GLES3/gl3platform.h>
|
||||
@ -46,7 +25,7 @@ extern "C" {
|
||||
#define GL_GLES_PROTOTYPES 1
|
||||
#endif
|
||||
|
||||
/* Generated on date 20161024 */
|
||||
/* Generated on date 20191013 */
|
||||
|
||||
/* Generated C header for:
|
||||
* API: gles2
|
||||
@ -64,8 +43,8 @@ extern "C" {
|
||||
typedef khronos_int8_t GLbyte;
|
||||
typedef khronos_float_t GLclampf;
|
||||
typedef khronos_int32_t GLfixed;
|
||||
typedef short GLshort;
|
||||
typedef unsigned short GLushort;
|
||||
typedef khronos_int16_t GLshort;
|
||||
typedef khronos_uint16_t GLushort;
|
||||
typedef void GLvoid;
|
||||
typedef struct __GLsync *GLsync;
|
||||
typedef khronos_int64_t GLint64;
|
||||
@ -672,7 +651,7 @@ GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei
|
||||
|
||||
#ifndef GL_ES_VERSION_3_0
|
||||
#define GL_ES_VERSION_3_0 1
|
||||
typedef unsigned short GLhalf;
|
||||
typedef khronos_uint16_t GLhalf;
|
||||
#define GL_READ_BUFFER 0x0C02
|
||||
#define GL_UNPACK_ROW_LENGTH 0x0CF2
|
||||
#define GL_UNPACK_SKIP_ROWS 0x0CF3
|
||||
|
24
3rdparty/khronos/GLES3/gl3ext.h
vendored
24
3rdparty/khronos/GLES3/gl3ext.h
vendored
@ -1,24 +0,0 @@
|
||||
#ifndef __gl3ext_h_
|
||||
#define __gl3ext_h_
|
||||
|
||||
/* $Revision: 17809 $ on $Date:: 2012-05-14 08:03:36 -0700 #$ */
|
||||
|
||||
/*
|
||||
* This document is licensed under the SGI Free Software B License Version
|
||||
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
|
||||
*/
|
||||
|
||||
/* OpenGL ES 3 Extensions
|
||||
*
|
||||
* After an OES extension's interactions with OpenGl ES 3.0 have been documented,
|
||||
* its tokens and function definitions should be added to this file in a manner
|
||||
* that does not conflict with gl2ext.h or gl3.h.
|
||||
*
|
||||
* Tokens and function definitions for extensions that have become standard
|
||||
* features in OpenGL ES 3.0 will not be added to this file.
|
||||
*
|
||||
* Applications using OpenGL-ES-2-only extensions should include gl2ext.h
|
||||
*/
|
||||
|
||||
#endif /* __gl3ext_h_ */
|
||||
|
15
3rdparty/khronos/GLES3/gl3platform.h
vendored
15
3rdparty/khronos/GLES3/gl3platform.h
vendored
@ -2,19 +2,8 @@
|
||||
#define __gl3platform_h_
|
||||
|
||||
/*
|
||||
** Copyright (c) 2017 The Khronos Group Inc.
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
** Copyright 2017-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* Platform-specific types and definitions for OpenGL ES 3.X gl3.h
|
||||
|
37
3rdparty/khronos/KHR/khrplatform.h
vendored
37
3rdparty/khronos/KHR/khrplatform.h
vendored
@ -90,12 +90,20 @@
|
||||
* int arg2) KHRONOS_APIATTRIBUTES;
|
||||
*/
|
||||
|
||||
#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
|
||||
# define KHRONOS_STATIC 1
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APICALL
|
||||
*-------------------------------------------------------------------------
|
||||
* This precedes the return type of the function in the function prototype.
|
||||
*/
|
||||
#if defined(_WIN32) && !defined(__SCITECH_SNAP__)
|
||||
#if defined(KHRONOS_STATIC)
|
||||
/* If the preprocessor constant KHRONOS_STATIC is defined, make the
|
||||
* header compatible with static linking. */
|
||||
# define KHRONOS_APICALL
|
||||
#elif defined(_WIN32)
|
||||
# define KHRONOS_APICALL __declspec(dllimport)
|
||||
#elif defined (__SYMBIAN32__)
|
||||
# define KHRONOS_APICALL IMPORT_C
|
||||
@ -145,6 +153,20 @@ typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
/*
|
||||
* To support platform where unsigned long cannot be used interchangeably with
|
||||
* inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t.
|
||||
* Ideally, we could just use (u)intptr_t everywhere, but this could result in
|
||||
* ABI breakage if khronos_uintptr_t is changed from unsigned long to
|
||||
* unsigned long long or similar (this results in different C++ name mangling).
|
||||
* To avoid changes for existing platforms, we restrict usage of intptr_t to
|
||||
* platforms where the size of a pointer is larger than the size of long.
|
||||
*/
|
||||
#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__)
|
||||
#if __SIZEOF_POINTER__ > __SIZEOF_LONG__
|
||||
#define KHRONOS_USE_INTPTR_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#elif defined(__VMS ) || defined(__sgi)
|
||||
|
||||
@ -227,14 +249,21 @@ typedef unsigned short int khronos_uint16_t;
|
||||
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
|
||||
* to be the only LLP64 architecture in current use.
|
||||
*/
|
||||
#ifdef _WIN64
|
||||
#ifdef KHRONOS_USE_INTPTR_T
|
||||
typedef intptr_t khronos_intptr_t;
|
||||
typedef uintptr_t khronos_uintptr_t;
|
||||
#elif defined(_WIN64)
|
||||
typedef signed long long int khronos_intptr_t;
|
||||
typedef unsigned long long int khronos_uintptr_t;
|
||||
typedef signed long long int khronos_ssize_t;
|
||||
typedef unsigned long long int khronos_usize_t;
|
||||
#else
|
||||
typedef signed long int khronos_intptr_t;
|
||||
typedef unsigned long int khronos_uintptr_t;
|
||||
#endif
|
||||
|
||||
#if defined(_WIN64)
|
||||
typedef signed long long int khronos_ssize_t;
|
||||
typedef unsigned long long int khronos_usize_t;
|
||||
#else
|
||||
typedef signed long int khronos_ssize_t;
|
||||
typedef unsigned long int khronos_usize_t;
|
||||
#endif
|
||||
|
67
3rdparty/khronos/gl/GRemedyGLExtensions.h
vendored
67
3rdparty/khronos/gl/GRemedyGLExtensions.h
vendored
@ -1,67 +0,0 @@
|
||||
// ------------------------------ GRemdeyGLExtensions.h ------------------------------
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
// © 2004 - 2012 Advanced Micro Devices, Inc. All rights reserved.
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
#ifndef __GREMDEYGLEXTENSIONS
|
||||
#define __GREMDEYGLEXTENSIONS
|
||||
|
||||
|
||||
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifndef APIENTRY
|
||||
#define APIENTRY
|
||||
#endif
|
||||
|
||||
#ifndef APIENTRYP
|
||||
#define APIENTRYP APIENTRY *
|
||||
#endif
|
||||
|
||||
#ifndef GLAPI
|
||||
#define GLAPI extern
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/* ----------------------- GL_GREMEDY_string_marker ----------------------- */
|
||||
|
||||
#ifndef GL_GREMEDY_string_marker
|
||||
#define GL_GREMEDY_string_marker 1
|
||||
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glStringMarkerGREMEDY(GLsizei len, const GLvoid *string);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
|
||||
typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC)(GLsizei len, const GLvoid *string);
|
||||
|
||||
#endif /* GL_GREMEDY_string_marker */
|
||||
|
||||
|
||||
|
||||
/* ----------------------- GL_GREMEDY_frame_terminator ----------------------- */
|
||||
|
||||
#ifndef GL_GREMEDY_frame_terminator
|
||||
#define GL_GREMEDY_frame_terminator 1
|
||||
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glFrameTerminatorGREMEDY(void);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
|
||||
typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC)(void);
|
||||
|
||||
#endif /* GL_GREMEDY_frame_terminator */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __GREMDEYGLEXTENSIONS */
|
219
3rdparty/khronos/gl/glcorearb.h
vendored
219
3rdparty/khronos/gl/glcorearb.h
vendored
@ -6,28 +6,9 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2013-2018 The Khronos Group Inc.
|
||||
** Copyright 2013-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: MIT
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
/*
|
||||
** This header is generated from the Khronos OpenGL / OpenGL ES XML
|
||||
** API Registry. The current version of the Registry, generator scripts
|
||||
** used to make the header, and the header can be found at
|
||||
@ -1573,7 +1554,7 @@ typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync);
|
||||
typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
|
||||
typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
|
||||
typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *data);
|
||||
typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
|
||||
typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values);
|
||||
typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data);
|
||||
typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
|
||||
@ -1593,7 +1574,7 @@ GLAPI void APIENTRY glDeleteSync (GLsync sync);
|
||||
GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
|
||||
GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
|
||||
GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *data);
|
||||
GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
|
||||
GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values);
|
||||
GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data);
|
||||
GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params);
|
||||
GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level);
|
||||
@ -1789,8 +1770,8 @@ typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location,
|
||||
typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar *name);
|
||||
typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar *name);
|
||||
typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values);
|
||||
typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
|
||||
typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
|
||||
typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
|
||||
typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
|
||||
typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint *indices);
|
||||
typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint *params);
|
||||
typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint *values);
|
||||
@ -1836,8 +1817,8 @@ GLAPI void APIENTRY glGetUniformdv (GLuint program, GLint location, GLdouble *pa
|
||||
GLAPI GLint APIENTRY glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar *name);
|
||||
GLAPI GLuint APIENTRY glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar *name);
|
||||
GLAPI void APIENTRY glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values);
|
||||
GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
|
||||
GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
|
||||
GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
|
||||
GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
|
||||
GLAPI void APIENTRY glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint *indices);
|
||||
GLAPI void APIENTRY glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint *params);
|
||||
GLAPI void APIENTRY glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint *values);
|
||||
@ -1895,7 +1876,7 @@ GLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pna
|
||||
#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F
|
||||
#define GL_UNDEFINED_VERTEX 0x8260
|
||||
typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void);
|
||||
typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
|
||||
typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length);
|
||||
typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
|
||||
typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f);
|
||||
typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d);
|
||||
@ -1984,7 +1965,7 @@ typedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfl
|
||||
typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glReleaseShaderCompiler (void);
|
||||
GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
|
||||
GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length);
|
||||
GLAPI void APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
|
||||
GLAPI void APIENTRY glDepthRangef (GLfloat n, GLfloat f);
|
||||
GLAPI void APIENTRY glClearDepthf (GLfloat d);
|
||||
@ -2191,7 +2172,7 @@ GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data)
|
||||
typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance);
|
||||
typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance);
|
||||
typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance);
|
||||
typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
|
||||
typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers);
|
||||
@ -2204,7 +2185,7 @@ typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum m
|
||||
GLAPI void APIENTRY glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance);
|
||||
GLAPI void APIENTRY glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance);
|
||||
GLAPI void APIENTRY glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance);
|
||||
GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
|
||||
GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint *params);
|
||||
GLAPI void APIENTRY glGetActiveAtomicCounterBufferiv (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params);
|
||||
GLAPI void APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
|
||||
GLAPI void APIENTRY glMemoryBarrier (GLbitfield barriers);
|
||||
@ -2484,7 +2465,7 @@ typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect);
|
||||
typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
|
||||
typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params);
|
||||
typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint64 *params);
|
||||
typedef void (APIENTRYP PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth);
|
||||
typedef void (APIENTRYP PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level);
|
||||
typedef void (APIENTRYP PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length);
|
||||
@ -2496,7 +2477,7 @@ typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum
|
||||
typedef void (APIENTRYP PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint *params);
|
||||
typedef GLuint (APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name);
|
||||
typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
|
||||
typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLint *params);
|
||||
typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar *name);
|
||||
typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name);
|
||||
typedef void (APIENTRYP PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding);
|
||||
@ -2528,7 +2509,7 @@ GLAPI void APIENTRY glDispatchComputeIndirect (GLintptr indirect);
|
||||
GLAPI void APIENTRY glCopyImageSubData (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
|
||||
GLAPI void APIENTRY glFramebufferParameteri (GLenum target, GLenum pname, GLint param);
|
||||
GLAPI void APIENTRY glGetFramebufferParameteriv (GLenum target, GLenum pname, GLint *params);
|
||||
GLAPI void APIENTRY glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params);
|
||||
GLAPI void APIENTRY glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint64 *params);
|
||||
GLAPI void APIENTRY glInvalidateTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth);
|
||||
GLAPI void APIENTRY glInvalidateTexImage (GLuint texture, GLint level);
|
||||
GLAPI void APIENTRY glInvalidateBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr length);
|
||||
@ -2540,7 +2521,7 @@ GLAPI void APIENTRY glMultiDrawElementsIndirect (GLenum mode, GLenum type, const
|
||||
GLAPI void APIENTRY glGetProgramInterfaceiv (GLuint program, GLenum programInterface, GLenum pname, GLint *params);
|
||||
GLAPI GLuint APIENTRY glGetProgramResourceIndex (GLuint program, GLenum programInterface, const GLchar *name);
|
||||
GLAPI void APIENTRY glGetProgramResourceName (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
|
||||
GLAPI void APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
|
||||
GLAPI void APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLint *params);
|
||||
GLAPI GLint APIENTRY glGetProgramResourceLocation (GLuint program, GLenum programInterface, const GLchar *name);
|
||||
GLAPI GLint APIENTRY glGetProgramResourceLocationIndex (GLuint program, GLenum programInterface, const GLchar *name);
|
||||
GLAPI void APIENTRY glShaderStorageBlockBinding (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding);
|
||||
@ -3838,6 +3819,12 @@ GLAPI void APIENTRY glTexBufferARB (GLenum target, GLenum internalformat, GLuint
|
||||
|
||||
#ifndef GL_ARB_viewport_array
|
||||
#define GL_ARB_viewport_array 1
|
||||
typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYDVNVPROC) (GLuint first, GLsizei count, const GLdouble *v);
|
||||
typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDDNVPROC) (GLuint index, GLdouble n, GLdouble f);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glDepthRangeArraydvNV (GLuint first, GLsizei count, const GLdouble *v);
|
||||
GLAPI void APIENTRY glDepthRangeIndexeddNV (GLuint index, GLdouble n, GLdouble f);
|
||||
#endif
|
||||
#endif /* GL_ARB_viewport_array */
|
||||
|
||||
#ifndef GL_KHR_blend_equation_advanced
|
||||
@ -3900,6 +3887,22 @@ GLAPI void APIENTRY glMaxShaderCompilerThreadsKHR (GLuint count);
|
||||
#define GL_CONTEXT_ROBUST_ACCESS 0x90F3
|
||||
#endif /* GL_KHR_robustness */
|
||||
|
||||
#ifndef GL_KHR_shader_subgroup
|
||||
#define GL_KHR_shader_subgroup 1
|
||||
#define GL_SUBGROUP_SIZE_KHR 0x9532
|
||||
#define GL_SUBGROUP_SUPPORTED_STAGES_KHR 0x9533
|
||||
#define GL_SUBGROUP_SUPPORTED_FEATURES_KHR 0x9534
|
||||
#define GL_SUBGROUP_QUAD_ALL_STAGES_KHR 0x9535
|
||||
#define GL_SUBGROUP_FEATURE_BASIC_BIT_KHR 0x00000001
|
||||
#define GL_SUBGROUP_FEATURE_VOTE_BIT_KHR 0x00000002
|
||||
#define GL_SUBGROUP_FEATURE_ARITHMETIC_BIT_KHR 0x00000004
|
||||
#define GL_SUBGROUP_FEATURE_BALLOT_BIT_KHR 0x00000008
|
||||
#define GL_SUBGROUP_FEATURE_SHUFFLE_BIT_KHR 0x00000010
|
||||
#define GL_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT_KHR 0x00000020
|
||||
#define GL_SUBGROUP_FEATURE_CLUSTERED_BIT_KHR 0x00000040
|
||||
#define GL_SUBGROUP_FEATURE_QUAD_BIT_KHR 0x00000080
|
||||
#endif /* GL_KHR_shader_subgroup */
|
||||
|
||||
#ifndef GL_KHR_texture_compression_astc_hdr
|
||||
#define GL_KHR_texture_compression_astc_hdr 1
|
||||
#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0
|
||||
@ -4010,6 +4013,10 @@ GLAPI void APIENTRY glEGLImageTargetTextureStorageEXT (GLuint texture, GLeglImag
|
||||
#endif
|
||||
#endif /* GL_EXT_EGL_image_storage */
|
||||
|
||||
#ifndef GL_EXT_EGL_sync
|
||||
#define GL_EXT_EGL_sync 1
|
||||
#endif /* GL_EXT_EGL_sync */
|
||||
|
||||
#ifndef GL_EXT_debug_label
|
||||
#define GL_EXT_debug_label 1
|
||||
#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F
|
||||
@ -4567,6 +4574,18 @@ GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLen
|
||||
#endif
|
||||
#endif /* GL_EXT_draw_instanced */
|
||||
|
||||
#ifndef GL_EXT_multiview_tessellation_geometry_shader
|
||||
#define GL_EXT_multiview_tessellation_geometry_shader 1
|
||||
#endif /* GL_EXT_multiview_tessellation_geometry_shader */
|
||||
|
||||
#ifndef GL_EXT_multiview_texture_multisample
|
||||
#define GL_EXT_multiview_texture_multisample 1
|
||||
#endif /* GL_EXT_multiview_texture_multisample */
|
||||
|
||||
#ifndef GL_EXT_multiview_timer_query
|
||||
#define GL_EXT_multiview_timer_query 1
|
||||
#endif /* GL_EXT_multiview_timer_query */
|
||||
|
||||
#ifndef GL_EXT_polygon_offset_clamp
|
||||
#define GL_EXT_polygon_offset_clamp 1
|
||||
#define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B
|
||||
@ -4643,6 +4662,11 @@ GLAPI void APIENTRY glFramebufferFetchBarrierEXT (void);
|
||||
#define GL_SR8_EXT 0x8FBD
|
||||
#endif /* GL_EXT_texture_sRGB_R8 */
|
||||
|
||||
#ifndef GL_EXT_texture_sRGB_RG8
|
||||
#define GL_EXT_texture_sRGB_RG8 1
|
||||
#define GL_SRG8_EXT 0x8FBE
|
||||
#endif /* GL_EXT_texture_sRGB_RG8 */
|
||||
|
||||
#ifndef GL_EXT_texture_sRGB_decode
|
||||
#define GL_EXT_texture_sRGB_decode 1
|
||||
#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48
|
||||
@ -4650,6 +4674,45 @@ GLAPI void APIENTRY glFramebufferFetchBarrierEXT (void);
|
||||
#define GL_SKIP_DECODE_EXT 0x8A4A
|
||||
#endif /* GL_EXT_texture_sRGB_decode */
|
||||
|
||||
#ifndef GL_EXT_texture_shadow_lod
|
||||
#define GL_EXT_texture_shadow_lod 1
|
||||
#endif /* GL_EXT_texture_shadow_lod */
|
||||
|
||||
#ifndef GL_EXT_texture_storage
|
||||
#define GL_EXT_texture_storage 1
|
||||
#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F
|
||||
#define GL_ALPHA8_EXT 0x803C
|
||||
#define GL_LUMINANCE8_EXT 0x8040
|
||||
#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
|
||||
#define GL_RGBA32F_EXT 0x8814
|
||||
#define GL_RGB32F_EXT 0x8815
|
||||
#define GL_ALPHA32F_EXT 0x8816
|
||||
#define GL_LUMINANCE32F_EXT 0x8818
|
||||
#define GL_LUMINANCE_ALPHA32F_EXT 0x8819
|
||||
#define GL_RGBA16F_EXT 0x881A
|
||||
#define GL_RGB16F_EXT 0x881B
|
||||
#define GL_ALPHA16F_EXT 0x881C
|
||||
#define GL_LUMINANCE16F_EXT 0x881E
|
||||
#define GL_LUMINANCE_ALPHA16F_EXT 0x881F
|
||||
#define GL_RGB10_A2_EXT 0x8059
|
||||
#define GL_RGB10_EXT 0x8052
|
||||
#define GL_BGRA8_EXT 0x93A1
|
||||
#define GL_R8_EXT 0x8229
|
||||
#define GL_RG8_EXT 0x822B
|
||||
#define GL_R32F_EXT 0x822E
|
||||
#define GL_RG32F_EXT 0x8230
|
||||
#define GL_R16F_EXT 0x822D
|
||||
#define GL_RG16F_EXT 0x822F
|
||||
typedef void (APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
|
||||
typedef void (APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
|
||||
GLAPI void APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
GLAPI void APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
|
||||
#endif
|
||||
#endif /* GL_EXT_texture_storage */
|
||||
|
||||
#ifndef GL_EXT_window_rectangles
|
||||
#define GL_EXT_window_rectangles 1
|
||||
#define GL_INCLUSIVE_EXT 0x8F10
|
||||
@ -4728,6 +4791,27 @@ GLAPI void APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLen
|
||||
#endif
|
||||
#endif /* GL_INTEL_performance_query */
|
||||
|
||||
#ifndef GL_MESA_framebuffer_flip_x
|
||||
#define GL_MESA_framebuffer_flip_x 1
|
||||
#define GL_FRAMEBUFFER_FLIP_X_MESA 0x8BBC
|
||||
#endif /* GL_MESA_framebuffer_flip_x */
|
||||
|
||||
#ifndef GL_MESA_framebuffer_flip_y
|
||||
#define GL_MESA_framebuffer_flip_y 1
|
||||
#define GL_FRAMEBUFFER_FLIP_Y_MESA 0x8BBB
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIMESAPROC) (GLenum target, GLenum pname, GLint param);
|
||||
typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVMESAPROC) (GLenum target, GLenum pname, GLint *params);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glFramebufferParameteriMESA (GLenum target, GLenum pname, GLint param);
|
||||
GLAPI void APIENTRY glGetFramebufferParameterivMESA (GLenum target, GLenum pname, GLint *params);
|
||||
#endif
|
||||
#endif /* GL_MESA_framebuffer_flip_y */
|
||||
|
||||
#ifndef GL_MESA_framebuffer_swap_xy
|
||||
#define GL_MESA_framebuffer_swap_xy 1
|
||||
#define GL_FRAMEBUFFER_SWAP_XY_MESA 0x8BBD
|
||||
#endif /* GL_MESA_framebuffer_swap_xy */
|
||||
|
||||
#ifndef GL_NV_bindless_multi_draw_indirect
|
||||
#define GL_NV_bindless_multi_draw_indirect 1
|
||||
typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount);
|
||||
@ -4981,6 +5065,22 @@ GLAPI void APIENTRY glConservativeRasterParameteriNV (GLenum pname, GLint param)
|
||||
#define GL_NV_conservative_raster_underestimation 1
|
||||
#endif /* GL_NV_conservative_raster_underestimation */
|
||||
|
||||
#ifndef GL_NV_depth_buffer_float
|
||||
#define GL_NV_depth_buffer_float 1
|
||||
#define GL_DEPTH_COMPONENT32F_NV 0x8DAB
|
||||
#define GL_DEPTH32F_STENCIL8_NV 0x8DAC
|
||||
#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD
|
||||
#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF
|
||||
typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar);
|
||||
typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth);
|
||||
typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glDepthRangedNV (GLdouble zNear, GLdouble zFar);
|
||||
GLAPI void APIENTRY glClearDepthdNV (GLdouble depth);
|
||||
GLAPI void APIENTRY glDepthBoundsdNV (GLdouble zmin, GLdouble zmax);
|
||||
#endif
|
||||
#endif /* GL_NV_depth_buffer_float */
|
||||
|
||||
#ifndef GL_NV_draw_vulkan_image
|
||||
#define GL_NV_draw_vulkan_image 1
|
||||
typedef void (APIENTRY *GLVULKANPROCNV)(void);
|
||||
@ -5032,11 +5132,11 @@ GLAPI void APIENTRY glFragmentCoverageColorNV (GLuint color);
|
||||
#define GL_COVERAGE_MODULATION_NV 0x9332
|
||||
#define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333
|
||||
typedef void (APIENTRYP PFNGLCOVERAGEMODULATIONTABLENVPROC) (GLsizei n, const GLfloat *v);
|
||||
typedef void (APIENTRYP PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufsize, GLfloat *v);
|
||||
typedef void (APIENTRYP PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufSize, GLfloat *v);
|
||||
typedef void (APIENTRYP PFNGLCOVERAGEMODULATIONNVPROC) (GLenum components);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glCoverageModulationTableNV (GLsizei n, const GLfloat *v);
|
||||
GLAPI void APIENTRY glGetCoverageModulationTableNV (GLsizei bufsize, GLfloat *v);
|
||||
GLAPI void APIENTRY glGetCoverageModulationTableNV (GLsizei bufSize, GLfloat *v);
|
||||
GLAPI void APIENTRY glCoverageModulationNV (GLenum components);
|
||||
#endif
|
||||
#endif /* GL_NV_framebuffer_mixed_samples */
|
||||
@ -5164,9 +5264,9 @@ GLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GL
|
||||
#define GL_SUPERSAMPLE_SCALE_X_NV 0x9372
|
||||
#define GL_SUPERSAMPLE_SCALE_Y_NV 0x9373
|
||||
#define GL_CONFORMANT_NV 0x9374
|
||||
typedef void (APIENTRYP PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint *params);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glGetInternalformatSampleivNV (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint *params);
|
||||
GLAPI void APIENTRY glGetInternalformatSampleivNV (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint *params);
|
||||
#endif
|
||||
#endif /* GL_NV_internalformat_sample_query */
|
||||
|
||||
@ -5198,6 +5298,20 @@ GLAPI void APIENTRY glNamedBufferAttachMemoryNV (GLuint buffer, GLuint memory, G
|
||||
#endif
|
||||
#endif /* GL_NV_memory_attachment */
|
||||
|
||||
#ifndef GL_NV_memory_object_sparse
|
||||
#define GL_NV_memory_object_sparse 1
|
||||
typedef void (APIENTRYP PFNGLBUFFERPAGECOMMITMENTMEMNVPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit);
|
||||
typedef void (APIENTRYP PFNGLTEXPAGECOMMITMENTMEMNVPROC) (GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit);
|
||||
typedef void (APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTMEMNVPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit);
|
||||
typedef void (APIENTRYP PFNGLTEXTUREPAGECOMMITMENTMEMNVPROC) (GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glBufferPageCommitmentMemNV (GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit);
|
||||
GLAPI void APIENTRY glTexPageCommitmentMemNV (GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit);
|
||||
GLAPI void APIENTRY glNamedBufferPageCommitmentMemNV (GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit);
|
||||
GLAPI void APIENTRY glTexturePageCommitmentMemNV (GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit);
|
||||
#endif
|
||||
#endif /* GL_NV_memory_object_sparse */
|
||||
|
||||
#ifndef GL_NV_mesh_shader
|
||||
#define GL_NV_mesh_shader 1
|
||||
#define GL_MESH_SHADER_NV 0x9559
|
||||
@ -5238,16 +5352,16 @@ GLAPI void APIENTRY glNamedBufferAttachMemoryNV (GLuint buffer, GLuint memory, G
|
||||
#define GL_MESH_OUTPUT_TYPE_NV 0x957B
|
||||
#define GL_UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_NV 0x959C
|
||||
#define GL_UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_NV 0x959D
|
||||
#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV 0x959E
|
||||
#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV 0x959F
|
||||
#define GL_REFERENCED_BY_MESH_SHADER_NV 0x95A0
|
||||
#define GL_REFERENCED_BY_TASK_SHADER_NV 0x95A1
|
||||
#define GL_MESH_SHADER_BIT_NV 0x00000040
|
||||
#define GL_TASK_SHADER_BIT_NV 0x00000080
|
||||
#define GL_MESH_SUBROUTINE_NV 0x957C
|
||||
#define GL_TASK_SUBROUTINE_NV 0x957D
|
||||
#define GL_MESH_SUBROUTINE_UNIFORM_NV 0x957E
|
||||
#define GL_TASK_SUBROUTINE_UNIFORM_NV 0x957F
|
||||
#define GL_MESH_SHADER_BIT_NV 0x00000040
|
||||
#define GL_TASK_SHADER_BIT_NV 0x00000080
|
||||
#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV 0x959E
|
||||
#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV 0x959F
|
||||
typedef void (APIENTRYP PFNGLDRAWMESHTASKSNVPROC) (GLuint first, GLuint count);
|
||||
typedef void (APIENTRYP PFNGLDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect);
|
||||
typedef void (APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect, GLsizei drawcount, GLsizei stride);
|
||||
@ -5467,11 +5581,11 @@ typedef void (APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHNVPROC) (GLuint path, GLenu
|
||||
typedef void (APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode);
|
||||
typedef void (APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
|
||||
typedef void (APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
|
||||
typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]);
|
||||
typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint *baseAndCount);
|
||||
typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
|
||||
typedef GLenum (APIENTRYP PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs);
|
||||
typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLfloat *params);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI GLuint APIENTRY glGenPathsNV (GLsizei range);
|
||||
GLAPI void APIENTRY glDeletePathsNV (GLuint path, GLsizei range);
|
||||
@ -5525,11 +5639,11 @@ GLAPI void APIENTRY glStencilThenCoverFillPathNV (GLuint path, GLenum fillMode,
|
||||
GLAPI void APIENTRY glStencilThenCoverStrokePathNV (GLuint path, GLint reference, GLuint mask, GLenum coverMode);
|
||||
GLAPI void APIENTRY glStencilThenCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
|
||||
GLAPI void APIENTRY glStencilThenCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
|
||||
GLAPI GLenum APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]);
|
||||
GLAPI GLenum APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint *baseAndCount);
|
||||
GLAPI GLenum APIENTRY glPathGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
|
||||
GLAPI GLenum APIENTRY glPathMemoryGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
|
||||
GLAPI void APIENTRY glProgramPathFragmentInputGenNV (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs);
|
||||
GLAPI void APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params);
|
||||
GLAPI void APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLfloat *params);
|
||||
#endif
|
||||
#endif /* GL_NV_path_rendering */
|
||||
|
||||
@ -5538,6 +5652,12 @@ GLAPI void APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInte
|
||||
#define GL_SHARED_EDGE_NV 0xC0
|
||||
#endif /* GL_NV_path_rendering_shared_edge */
|
||||
|
||||
#ifndef GL_NV_primitive_shading_rate
|
||||
#define GL_NV_primitive_shading_rate 1
|
||||
#define GL_SHADING_RATE_IMAGE_PER_PRIMITIVE_NV 0x95B1
|
||||
#define GL_SHADING_RATE_IMAGE_PALETTE_COUNT_NV 0x95B2
|
||||
#endif /* GL_NV_primitive_shading_rate */
|
||||
|
||||
#ifndef GL_NV_representative_fragment_test
|
||||
#define GL_NV_representative_fragment_test 1
|
||||
#define GL_REPRESENTATIVE_FRAGMENT_TEST_NV 0x937F
|
||||
@ -5641,6 +5761,11 @@ GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLs
|
||||
#define GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV 0x00000010
|
||||
#endif /* GL_NV_shader_buffer_store */
|
||||
|
||||
#ifndef GL_NV_shader_subgroup_partitioned
|
||||
#define GL_NV_shader_subgroup_partitioned 1
|
||||
#define GL_SUBGROUP_FEATURE_PARTITIONED_BIT_NV 0x00000100
|
||||
#endif /* GL_NV_shader_subgroup_partitioned */
|
||||
|
||||
#ifndef GL_NV_shader_texture_footprint
|
||||
#define GL_NV_shader_texture_footprint 1
|
||||
#endif /* GL_NV_shader_texture_footprint */
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user