diff options
302 files changed, 4362 insertions, 1457 deletions
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/CMakeLists.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/CMakeLists.txt index 739ade7fa42..c058bef4096 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/CMakeLists.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/CMakeLists.txt @@ -4,6 +4,7 @@ include_directories(include) include_directories(src/mesa) include_directories(src/mapi) include_directories(src/glsl) +include_directories(src) option (DEBUG "Enable debugging" FALSE) @@ -16,7 +17,7 @@ else() set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -s") endif() -file(GLOB glcpp-library_sources src/glsl/glcpp/*.c) +file(GLOB glcpp-library_sources src/glsl/glcpp/*.c src/util/*.c) #file(GLOB glcpp-library_sources_remove src/glsl/glcpp/glcpp.c) #list(REMOVE_ITEM glcpp-library_sources ${glcpp-library_sources_remove}) add_library(glcpp-library ${glcpp-library_sources}) diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/Changelog.md b/3rdparty/bgfx/3rdparty/glsl-optimizer/Changelog.md index cdc1847647b..2c308bcf73c 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/Changelog.md +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/Changelog.md @@ -1,6 +1,38 @@ GLSL optimizer Change Log ========================= +2015 04 +------- + +Fixes: + +* Metal: fixed some bugs with translation of weird loops. + + +2015 02 +------- + +Tweaks: + +* Texture LOD sampling functions on GLES2.0 now produce a wrapper call, that does approximation + (mip bias) on devices that don't support GL_EXT_shader_texture_lod. +* Undefined precision integers on GLES now default to highp. + + +2015 01 +------- + +Fixes: + +* Float literals are printed with 7 significant digits now. +* Metal: GLSL mod() is properly translated into Metal's fmod(). +* Metal: Fixed some cases of reciprocal (1/x) printing missing half precision cast. +* GLES3: textureOffset with a mipmap bias is printed correctly now. +* Fixed a bug with loop inductor detection if the inductor was used before the loop for some things. +* Fixed printing of int/float bitcast operations. +* Improved precision determination of some constructs. + + 2014 10 ------- diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/include/c99_compat.h b/3rdparty/bgfx/3rdparty/glsl-optimizer/include/c99_compat.h index e8ae7dcf126..35f728c997f 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/include/c99_compat.h +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/include/c99_compat.h @@ -134,13 +134,7 @@ * C99 __func__ macro */ #ifndef __func__ -# if defined(_MSC_VER) -# if _MSC_VER >= 1300 -# define __func__ __FUNCTION__ -# else -# define __func__ "<unknown>" -# endif -# elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +# if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(_MSC_VER) /* C99 */ # elif defined(__SUNPRO_C) && defined(__C99FEATURES__) /* C99 */ @@ -150,6 +144,12 @@ # else # define __func__ "<unknown>" # endif +# elif defined(_MSC_VER) +# if _MSC_VER >= 1300 +# define __func__ __FUNCTION__ +# else +# define __func__ "<unknown>" +# endif # else # define __func__ "<unknown>" # endif diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/Makefile b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/Makefile index ccfeb7b3ad7..373bfeb8c46 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/Makefile +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/Makefile @@ -3,17 +3,21 @@ CPPFLAGS += -I../talloc \ -I../mesa \ -I../mapi \ - -I../../include + -I../../include \ + -I.. CXXFLAGS += -s -Wall -Os -fdata-sections -ffunction-sections CFLAGS += -s -Wall -Os -fdata-sections -ffunction-sections # This list gleaned from the VC project file. Update when needed -SRC = ast_expr.cpp \ +SRC = ast_array_index.cpp \ + ast_expr.cpp \ ast_function.cpp \ ast_to_hir.cpp \ ast_type.cpp \ builtin_functions.cpp \ + builtin_types.cpp \ + builtin_variables.cpp \ glsl_lexer.cpp \ glsl_optimizer.cpp \ glsl_parser.cpp \ @@ -42,21 +46,38 @@ SRC = ast_expr.cpp \ ir_unused_structs.cpp \ ir_validate.cpp \ ir_variable_refcount.cpp \ - link_functions.cpp \ + link_atomics.cpp \ linker.cpp \ + link_functions.cpp \ + link_interface_blocks.cpp \ + link_uniform_block_active_visitor.cpp \ + link_uniform_blocks.cpp \ + link_uniform_initializers.cpp \ + link_uniforms.cpp \ + link_varyings.cpp \ loop_analysis.cpp \ loop_controls.cpp \ loop_unroll.cpp \ + lower_clip_distance.cpp \ lower_discard.cpp \ + lower_discard_flow.cpp \ lower_if_to_cond_assign.cpp \ lower_instructions.cpp \ lower_jumps.cpp \ lower_mat_op_to_vec.cpp \ + lower_named_interface_blocks.cpp \ lower_noise.cpp \ + lower_offset_array.cpp \ + lower_output_reads.cpp \ + lower_packed_varyings.cpp \ + lower_packing_builtins.cpp \ + lower_ubo_reference.cpp \ lower_variable_index_to_cond_assign.cpp \ lower_vec_index_to_cond_assign.cpp \ lower_vec_index_to_swizzle.cpp \ lower_vector.cpp \ + lower_vector_insert.cpp \ + lower_vertex_id.cpp \ opt_algebraic.cpp \ opt_array_splitting.cpp \ opt_constant_folding.cpp \ @@ -65,6 +86,7 @@ SRC = ast_expr.cpp \ opt_copy_propagation.cpp \ opt_copy_propagation_elements.cpp \ opt_cse.cpp \ + opt_dead_builtin_variables.cpp \ opt_dead_builtin_varyings.cpp \ opt_dead_code.cpp \ opt_dead_code_local.cpp \ @@ -73,23 +95,26 @@ SRC = ast_expr.cpp \ opt_flip_matrices.cpp \ opt_function_inlining.cpp \ opt_if_simplification.cpp \ + opt_minmax.cpp \ opt_noop_swizzle.cpp \ + opt_rebalance_tree.cpp \ opt_redundant_jumps.cpp \ opt_structure_splitting.cpp \ opt_swizzle_swizzle.cpp \ opt_tree_grafting.cpp \ opt_vectorize.cpp \ - ralloc.c \ + opt_vector_splitting.cpp \ s_expression.cpp \ standalone_scaffolding.cpp \ strtod.c \ glcpp/glcpp-lex.c \ glcpp/glcpp-parse.c \ glcpp/pp.c \ - ../mesa/main/hash_table.c \ ../mesa/main/imports.c \ ../mesa/program/prog_hash_table.c \ - ../mesa/program/symbol_table.c + ../mesa/program/symbol_table.c \ + ../util/hash_table.c \ + ../util/ralloc.c OBJS1 = $(SRC:.cpp=.o) diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/builtin_functions.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/builtin_functions.cpp index 2848c2c527c..ee85b44bb8b 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/builtin_functions.cpp +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/builtin_functions.cpp @@ -53,7 +53,6 @@ * name and parameters. */ -#define _USE_MATH_DEFINES #include <stdarg.h> #include <stdio.h> #include "main/core.h" /* for struct gl_shader */ diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/builtin_variables.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/builtin_variables.cpp index d7dc8d536e1..e52ac1c988e 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/builtin_variables.cpp +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/builtin_variables.cpp @@ -934,14 +934,14 @@ builtin_variable_generator::generate_fs_special_vars() if (state->AMD_shader_stencil_export_warn) var->enable_extension_warning("GL_AMD_shader_stencil_export"); } - + if (state->EXT_frag_depth_enable) { ir_variable *const var = add_output(FRAG_RESULT_DEPTH, float_t, "gl_FragDepthEXT", glsl_precision_high); if (state->EXT_frag_depth_warn) var->enable_extension_warning("GL_EXT_frag_depth"); } - + if (state->EXT_shader_framebuffer_fetch_enable) { ir_variable *const var = add_input(VARYING_SLOT_VAR0, array(vec4_t, state->Const.MaxDrawBuffers), "gl_LastFragData", glsl_precision_medium); @@ -949,12 +949,6 @@ builtin_variable_generator::generate_fs_special_vars() var->enable_extension_warning("GL_EXT_shader_framebuffer_fetch"); } - { - ir_variable *var; - var = add_output(VARYING_SLOT_PRIMITIVE_ID, int_t, "gl_PrimitiveID", glsl_precision_high); - var->data.interpolation = INTERP_QUALIFIER_FLAT; - } - if (state->ARB_sample_shading_enable) { add_system_value(SYSTEM_VALUE_SAMPLE_ID, int_t, "gl_SampleID", glsl_precision_high); add_system_value(SYSTEM_VALUE_SAMPLE_POS, vec2_t, "gl_SamplePosition", glsl_precision_high); diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.c b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.c index 7105a8d162c..80ac1669c52 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.c +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.c @@ -21,7 +21,6 @@ #include <string.h> #include <errno.h> #include <stdlib.h> -#include <c99_compat.h> /* end standard C headers. */ @@ -35,7 +34,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -52,7 +51,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -185,7 +184,7 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) - + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -247,7 +246,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -823,9 +822,9 @@ static int yy_init_globals (yyscan_t yyscanner ); /* This must go here because YYSTYPE and YYLTYPE are included * from bison output in section 1.*/ # define yylval yyg->yylval_r - + # define yylloc yyg->yylloc_r - + int glcpp_lex_init (yyscan_t* scanner); int glcpp_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); @@ -864,9 +863,9 @@ YYSTYPE * glcpp_get_lval (yyscan_t yyscanner ); void glcpp_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); YYLTYPE *glcpp_get_lloc (yyscan_t yyscanner ); - + void glcpp_set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner ); - + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -880,7 +879,7 @@ extern int glcpp_wrap (yyscan_t yyscanner ); #endif static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner); - + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); #endif @@ -900,11 +899,11 @@ static int input (yyscan_t yyscanner ); #endif static void yy_push_state (int new_state ,yyscan_t yyscanner); - + static void yy_pop_state (yyscan_t yyscanner ); - + static int yy_top_state (yyscan_t yyscanner ); - + /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ @@ -1362,7 +1361,7 @@ YY_RULE_SETUP * While in the <DEFINE> state we also need to explicitly * handle a few other things that may appear before the * identifier: - * + * * * Comments, (handled above with the main support for * comments). * @@ -2185,7 +2184,7 @@ static void glcpp__load_buffer_state (yyscan_t yyscanner) YY_BUFFER_STATE glcpp__create_buffer (FILE * file, int size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - + b = (YY_BUFFER_STATE) glcpp_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in glcpp__create_buffer()" ); @@ -2251,7 +2250,7 @@ static void glcpp__load_buffer_state (yyscan_t yyscanner) } b->yy_is_interactive = 0; - + errno = oerrno; } @@ -2357,9 +2356,9 @@ static void glcpp_ensure_buffer_stack (yyscan_t yyscanner) , yyscanner); if ( ! yyg->yy_buffer_stack ) YY_FATAL_ERROR( "out of dynamic memory in glcpp_ensure_buffer_stack()" ); - + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + yyg->yy_buffer_stack_max = num_to_alloc; yyg->yy_buffer_stack_top = 0; return; @@ -2388,12 +2387,12 @@ static void glcpp_ensure_buffer_stack (yyscan_t yyscanner) * @param base the character buffer * @param size the size in bytes of the character buffer * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE glcpp__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) @@ -2429,7 +2428,7 @@ YY_BUFFER_STATE glcpp__scan_buffer (char * base, yy_size_t size , yyscan_t yys */ YY_BUFFER_STATE glcpp__scan_string (yyconst char * yystr , yyscan_t yyscanner) { - + return glcpp__scan_bytes(yystr,strlen(yystr) ,yyscanner); } @@ -2446,7 +2445,7 @@ YY_BUFFER_STATE glcpp__scan_bytes (yyconst char * yybytes, int _yybytes_len , char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) glcpp_alloc(n ,yyscanner ); @@ -2554,10 +2553,10 @@ YY_EXTRA_TYPE glcpp_get_extra (yyscan_t yyscanner) int glcpp_get_lineno (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - + if (! YY_CURRENT_BUFFER) return 0; - + return yylineno; } @@ -2567,10 +2566,10 @@ int glcpp_get_lineno (yyscan_t yyscanner) int glcpp_get_column (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - + if (! YY_CURRENT_BUFFER) return 0; - + return yycolumn; } @@ -2631,8 +2630,8 @@ void glcpp_set_lineno (int line_number , yyscan_t yyscanner) /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "glcpp_set_lineno called with no buffer" , yyscanner); - + yy_fatal_error( "glcpp_set_lineno called with no buffer" , yyscanner); + yylineno = line_number; } @@ -2646,8 +2645,8 @@ void glcpp_set_column (int column_no , yyscan_t yyscanner) /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "glcpp_set_column called with no buffer" , yyscanner); - + yy_fatal_error( "glcpp_set_column called with no buffer" , yyscanner); + yycolumn = column_no; } @@ -2700,13 +2699,13 @@ YYLTYPE *glcpp_get_lloc (yyscan_t yyscanner) struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yylloc; } - + void glcpp_set_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylloc = yylloc_param; } - + /* User-visible API */ /* glcpp_lex_init is special because it creates the scanner itself, so it is @@ -2754,20 +2753,20 @@ int glcpp_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals errno = EINVAL; return 1; } - + *ptr_yy_globals = (yyscan_t) glcpp_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); - + if (*ptr_yy_globals == NULL){ errno = ENOMEM; return 1; } - + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - + glcpp_set_extra (yy_user_defined, *ptr_yy_globals); - + return yy_init_globals ( *ptr_yy_globals ); } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l index 419f1a18974..8b20fabd9f8 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l @@ -25,7 +25,6 @@ #include <stdio.h> #include <string.h> #include <ctype.h> -#include <c99_compat.h> #include "glcpp.h" #include "glcpp-parse.h" diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.cpp index f20df456dca..df9b8be424a 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.cpp +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.cpp @@ -206,6 +206,14 @@ static inline void debug_print_ir (const char* name, exec_list* ir, _mesa_glsl_p #endif } + +struct precision_ctx +{ + exec_list* root_ir; + bool res; +}; + + static void propagate_precision_deref(ir_instruction *ir, void *data) { // variable deref with undefined precision: take from variable itself @@ -213,7 +221,7 @@ static void propagate_precision_deref(ir_instruction *ir, void *data) if (der && der->get_precision() == glsl_precision_undefined && der->var->data.precision != glsl_precision_undefined) { der->set_precision ((glsl_precision)der->var->data.precision); - *(bool*)data = true; + ((precision_ctx*)data)->res = true; } // array deref with undefined precision: take from array itself @@ -221,7 +229,7 @@ static void propagate_precision_deref(ir_instruction *ir, void *data) if (der_arr && der_arr->get_precision() == glsl_precision_undefined && der_arr->array->get_precision() != glsl_precision_undefined) { der_arr->set_precision (der_arr->array->get_precision()); - *(bool*)data = true; + ((precision_ctx*)data)->res = true; } // swizzle with undefined precision: take from swizzle argument @@ -229,7 +237,7 @@ static void propagate_precision_deref(ir_instruction *ir, void *data) if (swz && swz->get_precision() == glsl_precision_undefined && swz->val->get_precision() != glsl_precision_undefined) { swz->set_precision (swz->val->get_precision()); - *(bool*)data = true; + ((precision_ctx*)data)->res = true; } } @@ -252,32 +260,88 @@ static void propagate_precision_expr(ir_instruction *ir, void *data) if (expr->get_precision() != prec_params_max) { expr->set_precision (prec_params_max); - *(bool*)data = true; + ((precision_ctx*)data)->res = true; } } +struct undefined_ass_ctx +{ + ir_variable* var; + bool res; +}; + +static void has_only_undefined_precision_assignments(ir_instruction *ir, void *data) +{ + ir_assignment* ass = ir->as_assignment(); + if (!ass) + return; + undefined_ass_ctx* ctx = (undefined_ass_ctx*)data; + if (ass->whole_variable_written() != ctx->var) + return; + glsl_precision prec = ass->rhs->get_precision(); + if (prec == glsl_precision_undefined) + return; + ctx->res = false; +} + static void propagate_precision_assign(ir_instruction *ir, void *data) { ir_assignment* ass = ir->as_assignment(); - if (ass && ass->lhs && ass->rhs) + if (!ass || !ass->lhs || !ass->rhs) + return; + + glsl_precision lp = ass->lhs->get_precision(); + glsl_precision rp = ass->rhs->get_precision(); + + // for assignments with LHS having undefined precision, take it from RHS + if (rp != glsl_precision_undefined) { - glsl_precision lp = ass->lhs->get_precision(); - glsl_precision rp = ass->rhs->get_precision(); - if (rp == glsl_precision_undefined) - return; ir_variable* lhs_var = ass->lhs->variable_referenced(); if (lp == glsl_precision_undefined) { if (lhs_var) lhs_var->data.precision = rp; ass->lhs->set_precision (rp); - *(bool*)data = true; + ((precision_ctx*)data)->res = true; + } + return; + } + + // for assignments where LHS has precision, but RHS is a temporary variable + // with undefined precision that's only assigned from other undefined precision + // sources -> make the RHS variable take LHS precision + if (lp != glsl_precision_undefined && rp == glsl_precision_undefined) + { + ir_dereference* deref = ass->rhs->as_dereference(); + if (deref) + { + ir_variable* rhs_var = deref->variable_referenced(); + if (rhs_var && rhs_var->data.mode == ir_var_temporary && rhs_var->data.precision == glsl_precision_undefined) + { + undefined_ass_ctx ctx; + ctx.var = rhs_var; + // find if we only assign to it from undefined precision sources + ctx.res = true; + exec_list* root_ir = ((precision_ctx*)data)->root_ir; + foreach_in_list(ir_instruction, inst, root_ir) + { + visit_tree (ir, has_only_undefined_precision_assignments, &ctx); + } + if (ctx.res) + { + rhs_var->data.precision = lp; + ass->rhs->set_precision(lp); + ((precision_ctx*)data)->res = true; + } + } } + return; } } + static void propagate_precision_call(ir_instruction *ir, void *data) { ir_call* call = ir->as_call(); @@ -302,28 +366,29 @@ static void propagate_precision_call(ir_instruction *ir, void *data) if (call->return_deref->get_precision() != prec_params_max) { call->return_deref->set_precision (prec_params_max); - *(bool*)data = true; + ((precision_ctx*)data)->res = true; } } } - static bool propagate_precision(exec_list* list, bool assign_high_to_undefined) { bool anyProgress = false; - bool res; + precision_ctx ctx; + do { - res = false; + ctx.res = false; + ctx.root_ir = list; foreach_in_list(ir_instruction, ir, list) { - visit_tree (ir, propagate_precision_deref, &res); - visit_tree (ir, propagate_precision_assign, &res); - visit_tree (ir, propagate_precision_call, &res); - visit_tree (ir, propagate_precision_expr, &res); + visit_tree (ir, propagate_precision_deref, &ctx); + visit_tree (ir, propagate_precision_assign, &ctx); + visit_tree (ir, propagate_precision_call, &ctx); + visit_tree (ir, propagate_precision_expr, &ctx); } - anyProgress |= res; - } while (res); - anyProgress |= res; + anyProgress |= ctx.res; + } while (ctx.res); + anyProgress |= ctx.res; // for globals that have undefined precision, set it to highp if (assign_high_to_undefined) diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp index 27a8791bdbf..8e2569e42d9 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp @@ -47,6 +47,15 @@ static inline const char* get_precision_string (glsl_precision p) return ""; } +static const int tex_sampler_type_count = 7; +// [glsl_sampler_dim] +static const char* tex_sampler_dim_name[tex_sampler_type_count] = { + "1D", "2D", "3D", "Cube", "Rect", "Buf", "External", +}; +static int tex_sampler_dim_size[tex_sampler_type_count] = { + 1, 2, 3, 3, 2, 2, 2, +}; + struct ga_entry : public exec_node { ga_entry(ir_instruction* ir) @@ -86,6 +95,8 @@ public: , inside_loop_body(false) , skipped_this_ir(false) , previous_skipped(false) + , uses_texlod_impl(0) + , uses_texlodproj_impl(0) { indentation = 0; expression_depth = 0; @@ -145,8 +156,61 @@ public: bool inside_loop_body; bool skipped_this_ir; bool previous_skipped; + int uses_texlod_impl; // 3 bits per tex_dimension, bit set for each precision if any texture sampler needs the GLES2 lod workaround. + int uses_texlodproj_impl; // 3 bits per tex_dimension, bit set for each precision if any texture sampler needs the GLES2 lod workaround. }; +static void print_texlod_workarounds(int usage_bitfield, int usage_proj_bitfield, string_buffer &str) +{ + static const char *precStrings[3] = {"lowp", "mediump", "highp"}; + static const char *precNameStrings[3] = { "low_", "medium_", "high_" }; + // Print out the texlod workarounds + for (int prec = 0; prec < 3; prec++) + { + const char *precString = precStrings[prec]; + const char *precName = precNameStrings[prec]; + + for (int dim = 0; dim < tex_sampler_type_count; dim++) + { + int mask = 1 << (dim + (prec * 8)); + if (usage_bitfield & mask) + { + str.asprintf_append("%s vec4 impl_%stexture%sLodEXT(%s sampler%s sampler, highp vec%d coord, mediump float lod)\n", precString, precName, tex_sampler_dim_name[dim], precString, tex_sampler_dim_name[dim], tex_sampler_dim_size[dim]); + str.asprintf_append("{\n"); + str.asprintf_append("#if defined(GL_EXT_shader_texture_lod)\n"); + str.asprintf_append("\treturn texture%sLodEXT(sampler, coord, lod);\n", tex_sampler_dim_name[dim]); + str.asprintf_append("#else\n"); + str.asprintf_append("\treturn texture%s(sampler, coord, lod);\n", tex_sampler_dim_name[dim]); + str.asprintf_append("#endif\n"); + str.asprintf_append("}\n\n"); + } + if (usage_proj_bitfield & mask) + { + // 2D projected read also has a vec4 UV variant + if (dim == GLSL_SAMPLER_DIM_2D) + { + str.asprintf_append("%s vec4 impl_%stexture2DProjLodEXT(%s sampler2D sampler, highp vec4 coord, mediump float lod)\n", precString, precName, precString); + str.asprintf_append("{\n"); + str.asprintf_append("#if defined(GL_EXT_shader_texture_lod)\n"); + str.asprintf_append("\treturn texture%sProjLodEXT(sampler, coord, lod);\n", tex_sampler_dim_name[dim]); + str.asprintf_append("#else\n"); + str.asprintf_append("\treturn texture%sProj(sampler, coord, lod);\n", tex_sampler_dim_name[dim]); + str.asprintf_append("#endif\n"); + str.asprintf_append("}\n\n"); + } + str.asprintf_append("%s vec4 impl_%stexture%sProjLodEXT(%s sampler%s sampler, highp vec%d coord, mediump float lod)\n", precString, precName, tex_sampler_dim_name[dim], precString, tex_sampler_dim_name[dim], tex_sampler_dim_size[dim] + 1); + str.asprintf_append("{\n"); + str.asprintf_append("#if defined(GL_EXT_shader_texture_lod)\n"); + str.asprintf_append("\treturn texture%sProjLodEXT(sampler, coord, lod);\n", tex_sampler_dim_name[dim]); + str.asprintf_append("#else\n"); + str.asprintf_append("\treturn texture%sProj(sampler, coord, lod);\n", tex_sampler_dim_name[dim]); + str.asprintf_append("#endif\n"); + str.asprintf_append("}\n\n"); + } + } + } +} + char* _mesa_print_ir_glsl(exec_list *instructions, @@ -154,6 +218,7 @@ _mesa_print_ir_glsl(exec_list *instructions, char* buffer, PrintGlslMode mode) { string_buffer str(buffer); + string_buffer body(buffer); // print version & extensions if (state) { @@ -181,12 +246,16 @@ _mesa_print_ir_glsl(exec_list *instructions, } if (state->EXT_shader_framebuffer_fetch_enable) str.asprintf_append ("#extension GL_EXT_shader_framebuffer_fetch : enable\n"); + if (state->ARB_shader_bit_encoding_enable) + str.asprintf_append("#extension GL_ARB_shader_bit_encoding : enable\n"); } // remove unused struct declarations do_remove_unused_typedecls(instructions); global_print_tracker gtracker; + int uses_texlod_impl = 0; + int uses_texlodproj_impl = 0; loop_state* ls = analyze_loop_variables(instructions); if (ls->loop_found) @@ -201,15 +270,23 @@ _mesa_print_ir_glsl(exec_list *instructions, continue; } - ir_print_glsl_visitor v (str, >racker, mode, state->es_shader, state); + ir_print_glsl_visitor v (body, >racker, mode, state->es_shader, state); v.loopstate = ls; ir->accept(&v); if (ir->ir_type != ir_type_function && !v.skipped_this_ir) - str.asprintf_append (";\n"); + body.asprintf_append (";\n"); + + uses_texlod_impl |= v.uses_texlod_impl; + uses_texlodproj_impl |= v.uses_texlodproj_impl; } delete ls; + + print_texlod_workarounds(uses_texlod_impl, uses_texlodproj_impl, str); + + // Add the optimized glsl code + str.asprintf_append("%s", body.c_str()); return ralloc_strdup(buffer, str.c_str()); } @@ -280,7 +357,9 @@ void ir_print_glsl_visitor::print_precision (ir_instruction* ir, const glsl_type if (type && !type->is_float() && !type->is_sampler() && - (!type->is_array() || !type->element_type()->is_float()) + !type->is_integer() && + (!type->is_array() || !type->element_type()->is_float()) && + (!type->is_array() || !type->element_type()->is_integer()) ) { return; @@ -297,6 +376,14 @@ void ir_print_glsl_visitor::print_precision (ir_instruction* ir, const glsl_type { prec = glsl_precision_high; } + if (type && type->is_integer()) + { + if (prec == glsl_precision_undefined && type && type->is_integer()) + { + // Default to highp on integers + prec = glsl_precision_high; + } + } // skip precision for samplers that end up being lowp (default anyway) or undefined; // except always emit it for shadowmap samplers (some drivers don't implement @@ -529,10 +616,10 @@ static const char *const operator_glsl_strs[] = { "float", // u2f "int", // i2u "int", // u2i - "float", // bit i2f - "int", // bit f2i - "float", // bit u2f - "int", // bit f2u + "intBitsToFloat", // bit i2f + "floatBitsToInt", // bit f2i + "uintBitsToFloat", // bit u2f + "floatBitsToUint", // bit f2u "any", "trunc", "ceil", @@ -644,7 +731,7 @@ void ir_print_glsl_visitor::visit(ir_expression *ir) newline_indent(); if (ir->get_num_operands() == 1) { - if (ir->operation >= ir_unop_f2i && ir->operation < ir_unop_any) { + if (ir->operation >= ir_unop_f2i && ir->operation <= ir_unop_u2i) { print_type(buffer, ir->type, true); buffer.asprintf_append ("("); } else if (ir->operation == ir_unop_rcp) { @@ -723,14 +810,6 @@ void ir_print_glsl_visitor::visit(ir_expression *ir) --this->expression_depth; } -// [glsl_sampler_dim] -static const char* tex_sampler_dim_name[] = { - "1D", "2D", "3D", "Cube", "Rect", "Buf", "External", -}; -static int tex_sampler_dim_size[] = { - 1, 2, 3, 3, 2, 2, 2, -}; - void ir_print_glsl_visitor::visit(ir_texture *ir) { glsl_sampler_dim sampler_dim = (glsl_sampler_dim)ir->sampler->type->sampler_dimensionality; @@ -741,6 +820,37 @@ void ir_print_glsl_visitor::visit(ir_texture *ir) if (is_shadow) sampler_uv_dim += 1; const bool is_proj = (uv_dim > sampler_uv_dim); + const bool is_lod = (ir->op == ir_txl); + + if (is_lod && state->es_shader && state->language_version < 300 && state->stage == MESA_SHADER_FRAGMENT) + { + // Special workaround for GLES 2.0 LOD samplers to prevent a lot of debug spew. + const glsl_precision prec = ir->sampler->get_precision(); + const char *precString = ""; + // Sampler bitfield is 7 bits, so use 0-7 for lowp, 8-15 for mediump and 16-23 for highp. + int position = (int)sampler_dim; + switch (prec) + { + case glsl_precision_high: + position += 16; + precString = "_high_"; + break; + case glsl_precision_medium: + position += 8; + precString = "_medium_"; + break; + case glsl_precision_low: + default: + precString = "_low_"; + break; + } + buffer.asprintf_append("impl%s", precString); + if (is_proj) + uses_texlodproj_impl |= (1 << position); + else + uses_texlod_impl |= (1 << position); + } + // texture function name //ACS: shadow lookups and lookups with dimensionality included in the name were deprecated in 130 @@ -792,13 +902,6 @@ void ir_print_glsl_visitor::visit(ir_texture *ir) // texture coordinate ir->coordinate->accept(this); - // lod bias - if (ir->op == ir_txb) - { - buffer.asprintf_append (", "); - ir->lod_info.bias->accept(this); - } - // lod if (ir->op == ir_txl || ir->op == ir_txf) { @@ -814,11 +917,21 @@ void ir_print_glsl_visitor::visit(ir_texture *ir) buffer.asprintf_append (", "); ir->lod_info.grad.dPdy->accept(this); } + + // texel offset + if (ir->offset != NULL) + { + buffer.asprintf_append (", "); + ir->offset->accept(this); + } + + // lod bias + if (ir->op == ir_txb) + { + buffer.asprintf_append (", "); + ir->lod_info.bias->accept(this); + } - if (ir->offset != NULL) { - buffer.asprintf_append (", "); - ir->offset->accept(this); - } /* @@ -889,6 +1002,10 @@ void ir_print_glsl_visitor::visit(ir_swizzle *ir) } return; } + + // Swizzling scalar types is not allowed so just return now. + if (ir->val->type->vector_elements == 1) + return; buffer.asprintf_append ("."); for (unsigned i = 0; i < ir->mask.num_components; i++) { @@ -1140,7 +1257,15 @@ void ir_print_glsl_visitor::visit(ir_assignment *ir) emit_assignment_part (ir->lhs, ir->rhs, ir->write_mask, NULL); } -static void print_float (string_buffer& buffer, float f) + +#ifdef _MSC_VER +#define isnan(x) _isnan(x) +#define isinf(x) (!_finite(x)) +#endif + +#define fpcheck(x) (isnan(x) || isinf(x)) + +void print_float (string_buffer& buffer, float f) { // Kind of roundabout way, but this is to satisfy two things: // * MSVC and gcc-based compilers differ a bit in how they treat float @@ -1148,7 +1273,7 @@ static void print_float (string_buffer& buffer, float f) // * GLSL (early version at least) require floats to have ".0" or // exponential notation. char tmp[64]; - snprintf(tmp, 64, "%.6g", f); + snprintf(tmp, 64, "%.7g", f); char* posE = NULL; posE = strchr(tmp, 'e'); @@ -1198,12 +1323,28 @@ void ir_print_glsl_visitor::visit(ir_constant *ir) if (type == glsl_type::float_type) { + if (fpcheck(ir->value.f[0])) + { + // Non-printable float. If we have bit conversions, we're fine. otherwise do hand-wavey things in print_float(). + if ((state->es_shader && (state->language_version >= 300)) + || (state->language_version >= 330) + || (state->ARB_shader_bit_encoding_enable)) + { + buffer.asprintf_append("uintBitsToFloat(%uu)", ir->value.u[0]); + return; + } + } + print_float (buffer, ir->value.f[0]); return; } else if (type == glsl_type::int_type) { - buffer.asprintf_append ("%d", ir->value.i[0]); + // Need special handling for INT_MIN + if (ir->value.u[0] == 0x80000000) + buffer.asprintf_append("int(0x%X)", ir->value.i[0]); + else + buffer.asprintf_append ("%d", ir->value.i[0]); return; } else if (type == glsl_type::uint_type) @@ -1213,7 +1354,13 @@ void ir_print_glsl_visitor::visit(ir_constant *ir) || (state->language_version < 130)) buffer.asprintf_append("%u", ir->value.u[0]); else - buffer.asprintf_append("%uu", ir->value.u[0]); + { + // Old Adreno drivers try to be smart with '0u' and treat that as 'const int'. Sigh. + if (ir->value.u[0] == 0) + buffer.asprintf_append("uint(0)"); + else + buffer.asprintf_append("%uu", ir->value.u[0]); + } return; } @@ -1254,7 +1401,15 @@ void ir_print_glsl_visitor::visit(ir_constant *ir) buffer.asprintf_append("%uu", ir->value.u[i]); break; } - case GLSL_TYPE_INT: buffer.asprintf_append ("%d", ir->value.i[i]); break; + case GLSL_TYPE_INT: + { + // Need special handling for INT_MIN + if (ir->value.u[i] == 0x80000000) + buffer.asprintf_append("int(0x%X)", ir->value.i[i]); + else + buffer.asprintf_append("%d", ir->value.i[i]); + break; + } case GLSL_TYPE_FLOAT: print_float(buffer, ir->value.f[i]); break; case GLSL_TYPE_BOOL: buffer.asprintf_append ("%d", ir->value.b[i]); break; default: assert(0); @@ -1406,7 +1561,17 @@ bool ir_print_glsl_visitor::emit_canonical_for (ir_loop* ir) if (indvar->initial_value) { buffer.asprintf_append (" = "); + // if the var is an array add the proper initializer + if(var->type->is_vector()) + { + print_type(buffer, var->type, false); + buffer.asprintf_append ("("); + } indvar->initial_value->accept(this); + if(var->type->is_vector()) + { + buffer.asprintf_append (")"); + } } } } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.h b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.h index 409898b4f93..827cf2876c7 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.h +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.h @@ -99,4 +99,7 @@ private: }; +extern void print_float (string_buffer& buffer, float f); + + #endif /* IR_PRINT_GLSL_VISITOR_H */ diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_metal_visitor.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_metal_visitor.cpp index ebef625be78..b17bae47508 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_metal_visitor.cpp +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_metal_visitor.cpp @@ -179,6 +179,7 @@ public: virtual void visit(ir_end_primitive *); void emit_assignment_part (ir_dereference* lhs, ir_rvalue* rhs, unsigned write_mask, ir_rvalue* dstIndex); + bool can_emit_canonical_for (loop_variable_state *ls); bool emit_canonical_for (ir_loop* ir); metal_print_context& ctx; @@ -374,7 +375,7 @@ void ir_print_metal_visitor::newline_deindent() void ir_print_metal_visitor::print_var_name (ir_variable* v) { - uintptr_t id = (uintptr_t)hash_table_find (globals->var_hash, v); + long id = (long)hash_table_find (globals->var_hash, v); if (!id && v->data.mode == ir_var_temporary) { id = ++globals->var_counter; @@ -543,7 +544,7 @@ void ir_print_metal_visitor::visit(ir_variable *ir) // give an id to any variable defined in a function that is not an uniform if ((this->mode == kPrintGlslNone && ir->data.mode != ir_var_uniform)) { - uintptr_t id = (uintptr_t)hash_table_find (globals->var_hash, ir); + long id = (long)hash_table_find (globals->var_hash, ir); if (id == 0) { id = ++globals->var_counter; @@ -565,7 +566,8 @@ void ir_print_metal_visitor::visit(ir_variable *ir) if (!inside_loop_body) { loop_variable_state* inductor_state = loopstate->get_for_inductor(ir); - if (inductor_state && inductor_state->private_induction_variable_count == 1) + if (inductor_state && inductor_state->private_induction_variable_count == 1 && + can_emit_canonical_for(inductor_state)) { skipped_this_ir = true; return; @@ -801,10 +803,10 @@ static const char *const operator_glsl_strs[] = { "float", // u2f "int", // i2u "int", // u2i - "float", // bit i2f - "int", // bit f2i - "float", // bit u2f - "int", // bit f2u + "as_type_", // bit i2f + "as_type_", // bit f2i + "as_type_", // bit u2f + "as_type_", // bit f2u "any", "trunc", "ceil", @@ -847,7 +849,7 @@ static const char *const operator_glsl_strs[] = { "/", "carry_TODO", "borrow_TODO", - "mod", + "fmod", "<", ">", "<=", @@ -965,11 +967,16 @@ void ir_print_metal_visitor::visit(ir_expression *ir) { if (op0cast) print_cast (buffer, arg_prec, ir->operands[0]); - if (ir->operation >= ir_unop_f2i && ir->operation < ir_unop_any) { + if (ir->operation >= ir_unop_f2i && ir->operation <= ir_unop_u2i) { print_type(buffer, ir, ir->type, true); buffer.asprintf_append ("("); + } else if (ir->operation >= ir_unop_bitcast_i2f && ir->operation <= ir_unop_bitcast_f2u) { + buffer.asprintf_append("as_type<"); + print_type(buffer, ir, ir->type, true); + buffer.asprintf_append(">("); } else if (ir->operation == ir_unop_rcp) { - buffer.asprintf_append ("(1.0/("); + const bool halfCast = (arg_prec == glsl_precision_medium || arg_prec == glsl_precision_low); + buffer.asprintf_append (halfCast ? "((half)1.0/(" : "(1.0/("); } else { buffer.asprintf_append ("%s(", operator_glsl_strs[ir->operation]); } @@ -1445,7 +1452,8 @@ void ir_print_metal_visitor::visit(ir_assignment *ir) if (!ir->condition && whole_var) { loop_variable_state* inductor_state = loopstate->get_for_inductor(whole_var); - if (inductor_state && inductor_state->private_induction_variable_count == 1) + if (inductor_state && inductor_state->private_induction_variable_count == 1 && + can_emit_canonical_for(inductor_state)) { skipped_this_ir = true; return; @@ -1501,46 +1509,6 @@ void ir_print_metal_visitor::visit(ir_assignment *ir) emit_assignment_part (ir->lhs, ir->rhs, ir->write_mask, NULL); } -static void print_float (string_buffer& buffer, float f) -{ - // Kind of roundabout way, but this is to satisfy two things: - // * MSVC and gcc-based compilers differ a bit in how they treat float - // widht/precision specifiers. Want to match for tests. - // * GLSL (early version at least) require floats to have ".0" or - // exponential notation. - char tmp[64]; - snprintf(tmp, 64, "%.6g", f); - - char* posE = NULL; - posE = strchr(tmp, 'e'); - if (!posE) - posE = strchr(tmp, 'E'); - - #if defined(_MSC_VER) - // While gcc would print something like 1.0e+07, MSVC will print 1.0e+007 - - // only for exponential notation, it seems, will add one extra useless zero. Let's try to remove - // that so compiler output matches. - if (posE != NULL) - { - if((posE[1] == '+' || posE[1] == '-') && posE[2] == '0') - { - char* p = posE+2; - while (p[0]) - { - p[0] = p[1]; - ++p; - } - } - } - #endif - - buffer.asprintf_append ("%s", tmp); - - // need to append ".0"? - if (!strchr(tmp,'.') && (posE == NULL)) - buffer.asprintf_append(".0"); -} - void ir_print_metal_visitor::visit(ir_constant *ir) { const glsl_type* type = ir->type; @@ -1715,9 +1683,8 @@ ir_print_metal_visitor::visit(ir_if *ir) } -bool ir_print_metal_visitor::emit_canonical_for (ir_loop* ir) +bool ir_print_metal_visitor::can_emit_canonical_for (loop_variable_state *ls) { - loop_variable_state* const ls = this->loopstate->get(ir); if (ls == NULL) return false; @@ -1732,6 +1699,16 @@ bool ir_print_metal_visitor::emit_canonical_for (ir_loop* ir) if (terminatorCount != 1) return false; + return true; +} + +bool ir_print_metal_visitor::emit_canonical_for (ir_loop* ir) +{ + loop_variable_state* const ls = this->loopstate->get(ir); + + if (!can_emit_canonical_for(ls)) + return false; + hash_table* terminator_hash = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare); hash_table* induction_hash = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare); diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/linker.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/linker.cpp index ec6e409d39c..1069268fb60 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/linker.cpp +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/linker.cpp @@ -2531,7 +2531,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) } prog->ARB_fragment_coord_conventions_enable |= - GLboolean(prog->Shaders[i]->ARB_fragment_coord_conventions_enable); + prog->Shaders[i]->ARB_fragment_coord_conventions_enable; gl_shader_stage shader_type = prog->Shaders[i]->Stage; shader_list[shader_type][num_shaders[shader_type]] = prog->Shaders[i]; diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_analysis.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_analysis.cpp index 734a527b8d4..71fdcfc1a39 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_analysis.cpp +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_analysis.cpp @@ -121,8 +121,10 @@ loop_state::get_for_inductor(const ir_variable *ir) } void -loop_state::insert_inductor(ir_variable* var, loop_variable_state* state, ir_loop* loop) +loop_state::insert_inductor(loop_variable* loopvar, loop_variable_state* state, ir_loop* loop) { + ir_variable* var = loopvar->var; + // Check if this variable is already marked as "sure can't be a private inductor variable" if (hash_table_find(this->ht_non_inductors, var)) return; @@ -144,6 +146,29 @@ loop_state::insert_inductor(ir_variable* var, loop_variable_state* state, ir_loo return; } } + + // Check if this variable is used before the loop anywhere. If it is, it can't be a + // variable that's private to the loop. + // Skip over the IR that declared the variable or assigned the initial value though. + for (exec_node* node = loop->prev; + !node->is_head_sentinel(); + node = node->prev) + { + ir_instruction *ir = (ir_instruction *) node; + if (ir == loopvar->initial_value_ir) + continue; + if (ir->ir_type == ir_type_variable) + continue; + + ir->accept (&refs); + if (refs.find_variable_entry(var)) + { + // add to list of "non inductors", so that next loop does not try + // to add it as inductor again + hash_table_insert(this->ht_non_inductors, state, var); + return; + } + } state->private_induction_variable_count++; hash_table_insert(this->ht_inductors, state, var); @@ -345,7 +370,7 @@ loop_analysis::visit_leave(ir_loop *ir) foreach_in_list_safe(loop_variable, lv, &ls->variables) { ir_variable *var = lv->var; if (var != NULL) { - lv->initial_value = find_initial_value(ir, var); + lv->initial_value = find_initial_value(ir, var, &lv->initial_value_ir); } /* Move variables that are already marked as being loop constant to * a separate list. These trivially don't need to be tested. @@ -430,7 +455,7 @@ loop_analysis::visit_leave(ir_loop *ir) lv->remove(); ls->induction_variables.push_tail(lv); - loops->insert_inductor(lv->var, ls, ir); + loops->insert_inductor(lv, ls, ir); } } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_analysis.h b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_analysis.h index e68d579a6c4..09882d933d7 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_analysis.h +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_analysis.h @@ -58,7 +58,7 @@ unroll_loops(exec_list *instructions, loop_state *ls, const struct gl_shader_compiler_options *options); ir_rvalue * -find_initial_value(ir_loop *loop, ir_variable *var); +find_initial_value(ir_loop *loop, ir_variable *var, ir_instruction **out_containing_ir); int calculate_iterations(ir_rvalue *from, ir_rvalue *to, ir_rvalue *increment, @@ -168,6 +168,8 @@ public: /** Reference to initial value outside of the loop. */ ir_rvalue *initial_value; + /** IR that assigned the initial value. */ + ir_instruction *initial_value_ir; /** Number of assignments to the variable in the loop body. */ unsigned num_assignments; @@ -247,7 +249,7 @@ public: loop_variable_state *insert(ir_loop *ir); loop_variable_state* get_for_inductor (const ir_variable*); - void insert_inductor(ir_variable* var, loop_variable_state* state, ir_loop* loop); + void insert_inductor(loop_variable* loopvar, loop_variable_state* state, ir_loop* loop); bool loop_found; diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_controls.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_controls.cpp index 5029e103f27..87cce8957cb 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_controls.cpp +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/loop_controls.cpp @@ -44,8 +44,9 @@ * \c NULL if no initializer can be found. */ ir_rvalue * -find_initial_value(ir_loop *loop, ir_variable *var) +find_initial_value(ir_loop *loop, ir_variable *var, ir_instruction **out_containing_ir) { + *out_containing_ir = NULL; ir_variable_refcount_visitor refs; for (exec_node *node = loop->prev; @@ -74,7 +75,10 @@ find_initial_value(ir_loop *loop, ir_variable *var) ir_variable *assignee = assign->lhs->whole_variable_referenced(); if (assignee == var) + { + *out_containing_ir = assign; return (assign->condition != NULL) ? NULL : assign->rhs; + } break; } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/main.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/main.cpp index feed100822c..b9fe4cb4467 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/main.cpp +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/main.cpp @@ -40,11 +40,11 @@ static int glsl_version = 330; -extern "C" void -_mesa_error_no_memory(const char *caller) -{ - fprintf(stderr, "Mesa error: out of memory in %s", caller); -} +//extern "C" void +//_mesa_error_no_memory(const char *caller) +//{ +// fprintf(stderr, "Mesa error: out of memory in %s", caller); +//} static void initialize_context(struct gl_context *ctx, gl_api api) diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/opt_algebraic.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/opt_algebraic.cpp index ab1c1c9900f..ce3cc5c7492 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/opt_algebraic.cpp +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/opt_algebraic.cpp @@ -129,7 +129,7 @@ is_less_than_one(ir_constant *ir) return false; unsigned component = 0; - for (unsigned c = 0; c < ir->type->vector_elements; c++) { + for (int c = 0; c < ir->type->vector_elements; c++) { if (ir->get_float_component(c) < 1.0f) component++; } @@ -144,7 +144,7 @@ is_greater_than_zero(ir_constant *ir) return false; unsigned component = 0; - for (unsigned c = 0; c < ir->type->vector_elements; c++) { + for (int c = 0; c < ir->type->vector_elements; c++) { if (ir->get_float_component(c) > 0.0f) component++; } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.cpp index 80fdbe9af68..2d014b47a9f 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.cpp +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.cpp @@ -36,10 +36,9 @@ void -_mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr, +_mesa_reference_shader(struct gl_context *, struct gl_shader **ptr, struct gl_shader *sh) { - (void) ctx; *ptr = sh; } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl_optimizer_lib.gyp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl_optimizer_lib.gyp index bc318c5eb6b..37ae920360e 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl_optimizer_lib.gyp +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl_optimizer_lib.gyp @@ -7,6 +7,7 @@ 'target_name': 'glsl_optimizer_lib', 'type': 'static_library', 'include_dirs': [ + '.', 'glsl', 'mesa', '../include', @@ -138,8 +139,6 @@ 'glsl/opt_flip_matrices.cpp', 'glsl/opt_dead_builtin_varyings.cpp', 'glsl/program.h', - 'glsl/ralloc.c', - 'glsl/ralloc.h', 'glsl/s_expression.cpp', 'glsl/s_expression.h', 'glsl/standalone_scaffolding.cpp', @@ -153,8 +152,6 @@ 'mesa/main/dd.h', 'mesa/main/glheader.h', 'mesa/main/glminimal.h', - 'mesa/main/hash_table.c', - 'mesa/main/hash_table.h', 'mesa/main/imports.c', 'mesa/main/imports.h', 'mesa/main/macros.h', @@ -167,11 +164,15 @@ 'mesa/program/prog_statevars.h', 'mesa/program/symbol_table.c', 'mesa/program/symbol_table.h', + 'util/hash_table.c', + 'util/hash_table.h', + 'util/ralloc.c', + 'util/ralloc.h', ], 'conditions': [ ['OS=="win"', { 'include_dirs': [ - '../include/c99', + '../include/c99', ], 'defines': [ '_LIB', @@ -184,7 +185,7 @@ ], 'msvs_disabled_warnings': [4028, 4244, 4267, 4996], }], - ], + ], } ] -}
\ No newline at end of file +} diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/main/compiler.h b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/main/compiler.h index d289cd4002a..ce85e8f1f75 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/main/compiler.h +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/main/compiler.h @@ -248,11 +248,11 @@ static inline GLuint CPU_TO_LE32(GLuint x) #endif #ifndef M_PI_2 -#define M_PI_2 1.57079632679489661923 +#define M_PI_2 (1.57079632679489661923) #endif #ifndef M_PI_4 -#define M_PI_4 0.78539816339744830962 +#define M_PI_4 (0.785398163397448309616) #endif #ifndef M_E diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-out.txt index 9d5af71209f..a51639ceae4 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-out.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-out.txt @@ -2,7 +2,7 @@ void main () { vec4 c_1; c_1.zw = vec2(0.0, 0.0); - c_1.xy = vec2(-0.34413, 0.050045); + c_1.xy = vec2(-0.3441301, 0.05004501); gl_FragData[0] = c_1; } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES.txt index d08973d17af..5e8532a9fd5 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES.txt @@ -2,7 +2,7 @@ void main () { mediump vec4 c_1; c_1.zw = vec2(0.0, 0.0); - c_1.xy = vec2(-0.34413, 0.050045); + c_1.xy = vec2(-0.3441301, 0.05004501); gl_FragData[0] = c_1; } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3.txt index bad999c25ab..8c78396282f 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3.txt @@ -4,7 +4,7 @@ void main () { mediump vec4 c_1; c_1.zw = vec2(0.0, 0.0); - c_1.xy = vec2(-0.34413, 0.050045); + c_1.xy = vec2(-0.3441301, 0.05004501); _fragData = c_1; } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3Metal.txt index 06d0253949a..cb270ab79c7 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3Metal.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3Metal.txt @@ -12,7 +12,7 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]] xlatMtlShaderOutput _mtl_o; half4 c_1; c_1.zw = half2(float2(0.0, 0.0)); - c_1.xy = half2(float2(-0.34413, 0.050045)); + c_1.xy = half2(float2(-0.3441301, 0.05004501)); _mtl_o._fragData = c_1; return _mtl_o; } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-out.txt index 9d5af71209f..a51639ceae4 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-out.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-out.txt @@ -2,7 +2,7 @@ void main () { vec4 c_1; c_1.zw = vec2(0.0, 0.0); - c_1.xy = vec2(-0.34413, 0.050045); + c_1.xy = vec2(-0.3441301, 0.05004501); gl_FragData[0] = c_1; } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES.txt index d08973d17af..5e8532a9fd5 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES.txt @@ -2,7 +2,7 @@ void main () { mediump vec4 c_1; c_1.zw = vec2(0.0, 0.0); - c_1.xy = vec2(-0.34413, 0.050045); + c_1.xy = vec2(-0.3441301, 0.05004501); gl_FragData[0] = c_1; } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3.txt index ff5dd69e89e..4da5457043b 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3.txt @@ -4,7 +4,7 @@ void main () { mediump vec4 c_1; c_1.zw = vec2(0.0, 0.0); - c_1.xy = vec2(-0.34413, 0.050045); + c_1.xy = vec2(-0.3441301, 0.05004501); _fragData = c_1; } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3Metal.txt index 06d0253949a..cb270ab79c7 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3Metal.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3Metal.txt @@ -12,7 +12,7 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]] xlatMtlShaderOutput _mtl_o; half4 c_1; c_1.zw = half2(float2(0.0, 0.0)); - c_1.xy = half2(float2(-0.34413, 0.050045)); + c_1.xy = half2(float2(-0.3441301, 0.05004501)); _mtl_o._fragData = c_1; return _mtl_o; } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3.txt index ccf6706b2d0..73a494c030a 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3.txt @@ -7,7 +7,7 @@ void main () discard; }; a_2 = 4.0; - for (int i_1 = 0; i_1 < 10; i_1++, a_2 += 1.0) { + for (highp int i_1 = 0; i_1 < 10; i_1++, a_2 += 1.0) { }; while (true) { a_2 += 2.0; diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-inES3.txt new file mode 100644 index 00000000000..d16d86bb193 --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-inES3.txt @@ -0,0 +1,78 @@ +#version 300 es + +// from case 685794 at Unity; a particular form of a loop +// started to generate invalid shaders around Unity 4.6.3. + +out mediump vec4 _fragData; + + +struct v2f_surf { + mediump vec2 uv; + highp vec4 pos; +}; +uniform sampler2D _MainTex; +uniform mediump float _NumPasses; +uniform mediump vec4 _ContrastShift; +uniform mediump vec4 _SaturationShift; +uniform lowp vec4 _HueShift; +uniform lowp vec4 _LuminosityShift; + +lowp vec3 TestCycle2( in lowp vec3 res, in mediump float val ) +{ + return ((res - 0.5) * pow( (cos(val) + 1.0), val)); +} + +lowp vec3 TestCycle( in lowp vec3 rgb, in mediump float passes ) +{ + lowp vec3 res = rgb; + // a weird form of loop that was causing a bug + highp float i = 0.0; + for ( ; (i < 4.0); i += 1.0) { + + if ((i == passes)){ + break; + } + if ((i == 0.0)){ + res = TestCycle2( res, ((_ContrastShift.x * 3.0) + 12.0)); + } + else{ + if ((i == 1.0)){ + res = TestCycle2( res, ((_SaturationShift.y * 3.0) + 12.0)); + } + else{ + if ((i == 2.0)){ + res = TestCycle2( res, ((_HueShift.z * 3.0) + 12.0)); + } + else{ + res = TestCycle2( res, ((_LuminosityShift.x * 3.0) + 12.0)); + } + } + } + } + + return res; +} + +lowp vec3 surf( in mediump vec2 uv ) +{ + lowp vec4 t = texture(_MainTex, uv); + if (_NumPasses > 0.0) + t.xyz = TestCycle(t.xyz, _NumPasses); + return t.xyz; +} + +lowp vec4 frag_surf( in v2f_surf IN ) +{ + lowp vec3 col = surf( IN.uv); + return vec4( col, 1.0); +} +in mediump vec2 xlv_TEXCOORD0; +void main() { + lowp vec4 xl_retval; + v2f_surf xlt_IN; + xlt_IN.uv = vec2(xlv_TEXCOORD0); + xlt_IN.pos = vec4(0.0); + xl_retval = frag_surf(xlt_IN); + _fragData = vec4(xl_retval); +} + diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-outES3.txt new file mode 100644 index 00000000000..8e19a5f01da --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-outES3.txt @@ -0,0 +1,88 @@ +#version 300 es +out mediump vec4 _fragData; +uniform sampler2D _MainTex; +uniform mediump float _NumPasses; +uniform mediump vec4 _ContrastShift; +uniform mediump vec4 _SaturationShift; +uniform lowp vec4 _HueShift; +uniform lowp vec4 _LuminosityShift; +in mediump vec2 xlv_TEXCOORD0; +void main () +{ + lowp vec4 t_1; + lowp vec4 tmpvar_2; + tmpvar_2 = texture (_MainTex, xlv_TEXCOORD0); + t_1 = tmpvar_2; + if ((_NumPasses > 0.0)) { + mediump float passes_3; + passes_3 = _NumPasses; + highp float i_4; + lowp vec3 res_5; + res_5 = tmpvar_2.xyz; + i_4 = 0.0; + while (true) { + if ((i_4 >= 4.0)) { + break; + }; + if ((i_4 == passes_3)) { + break; + }; + if ((i_4 == 0.0)) { + lowp vec3 tmpvar_6; + mediump float val_7; + val_7 = ((_ContrastShift.x * 3.0) + 12.0); + mediump float tmpvar_8; + tmpvar_8 = pow ((cos(val_7) + 1.0), val_7); + tmpvar_6 = ((res_5 - 0.5) * tmpvar_8); + res_5 = tmpvar_6; + } else { + if ((i_4 == 1.0)) { + lowp vec3 tmpvar_9; + mediump float val_10; + val_10 = ((_SaturationShift.y * 3.0) + 12.0); + mediump float tmpvar_11; + tmpvar_11 = pow ((cos(val_10) + 1.0), val_10); + tmpvar_9 = ((res_5 - 0.5) * tmpvar_11); + res_5 = tmpvar_9; + } else { + if ((i_4 == 2.0)) { + lowp vec3 tmpvar_12; + mediump float val_13; + val_13 = ((_HueShift.z * 3.0) + 12.0); + mediump float tmpvar_14; + tmpvar_14 = pow ((cos(val_13) + 1.0), val_13); + tmpvar_12 = ((res_5 - 0.5) * tmpvar_14); + res_5 = tmpvar_12; + } else { + lowp vec3 tmpvar_15; + mediump float val_16; + val_16 = ((_LuminosityShift.x * 3.0) + 12.0); + mediump float tmpvar_17; + tmpvar_17 = pow ((cos(val_16) + 1.0), val_16); + tmpvar_15 = ((res_5 - 0.5) * tmpvar_17); + res_5 = tmpvar_15; + }; + }; + }; + i_4 += 1.0; + }; + t_1.xyz = res_5; + }; + lowp vec4 tmpvar_18; + tmpvar_18.w = 1.0; + tmpvar_18.xyz = t_1.xyz; + _fragData = tmpvar_18; +} + + +// stats: 37 alu 1 tex 7 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (medium float) 2x1 [-1] +// uniforms: 5 (total size: 0) +// #0: _NumPasses (medium float) 1x1 [-1] +// #1: _ContrastShift (medium float) 4x1 [-1] +// #2: _SaturationShift (medium float) 4x1 [-1] +// #3: _HueShift (low float) 4x1 [-1] +// #4: _LuminosityShift (low float) 4x1 [-1] +// textures: 1 +// #0: _MainTex (low 2d) 0x0 [-1] diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-outES3Metal.txt new file mode 100644 index 00000000000..7961441587a --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-outES3Metal.txt @@ -0,0 +1,97 @@ +#include <metal_stdlib> +using namespace metal; +struct xlatMtlShaderInput { + half2 xlv_TEXCOORD0; +}; +struct xlatMtlShaderOutput { + half4 _fragData [[color(0)]]; +}; +struct xlatMtlShaderUniform { + half _NumPasses; + half4 _ContrastShift; + half4 _SaturationShift; + half4 _HueShift; + half4 _LuminosityShift; +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , texture2d<half> _MainTex [[texture(0)]], sampler _mtlsmp__MainTex [[sampler(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 t_1; + half4 tmpvar_2; + tmpvar_2 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0)); + t_1 = tmpvar_2; + if ((_mtl_u._NumPasses > (half)0.0)) { + half passes_3; + passes_3 = _mtl_u._NumPasses; + float i_4; + half3 res_5; + res_5 = tmpvar_2.xyz; + i_4 = 0.0; + while (true) { + if ((i_4 >= 4.0)) { + break; + }; + if ((i_4 == (float)passes_3)) { + break; + }; + if ((i_4 == 0.0)) { + half3 tmpvar_6; + half val_7; + val_7 = ((_mtl_u._ContrastShift.x * (half)3.0) + (half)12.0); + half tmpvar_8; + tmpvar_8 = pow ((cos(val_7) + (half)1.0), val_7); + tmpvar_6 = ((res_5 - (half)0.5) * tmpvar_8); + res_5 = tmpvar_6; + } else { + if ((i_4 == 1.0)) { + half3 tmpvar_9; + half val_10; + val_10 = ((_mtl_u._SaturationShift.y * (half)3.0) + (half)12.0); + half tmpvar_11; + tmpvar_11 = pow ((cos(val_10) + (half)1.0), val_10); + tmpvar_9 = ((res_5 - (half)0.5) * tmpvar_11); + res_5 = tmpvar_9; + } else { + if ((i_4 == 2.0)) { + half3 tmpvar_12; + half val_13; + val_13 = ((_mtl_u._HueShift.z * (half)3.0) + (half)12.0); + half tmpvar_14; + tmpvar_14 = pow ((cos(val_13) + (half)1.0), val_13); + tmpvar_12 = ((res_5 - (half)0.5) * tmpvar_14); + res_5 = tmpvar_12; + } else { + half3 tmpvar_15; + half val_16; + val_16 = ((_mtl_u._LuminosityShift.x * (half)3.0) + (half)12.0); + half tmpvar_17; + tmpvar_17 = pow ((cos(val_16) + (half)1.0), val_16); + tmpvar_15 = ((res_5 - (half)0.5) * tmpvar_17); + res_5 = tmpvar_15; + }; + }; + }; + i_4 += 1.0; + }; + t_1.xyz = res_5; + }; + half4 tmpvar_18; + tmpvar_18.w = half(1.0); + tmpvar_18.xyz = t_1.xyz; + _mtl_o._fragData = tmpvar_18; + return _mtl_o; +} + + +// stats: 37 alu 1 tex 7 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (medium float) 2x1 [-1] +// uniforms: 5 (total size: 40) +// #0: _NumPasses (medium float) 1x1 [-1] loc 0 +// #1: _ContrastShift (medium float) 4x1 [-1] loc 8 +// #2: _SaturationShift (medium float) 4x1 [-1] loc 16 +// #3: _HueShift (low float) 4x1 [-1] loc 24 +// #4: _LuminosityShift (low float) 4x1 [-1] loc 32 +// textures: 1 +// #0: _MainTex (low 2d) 0x0 [-1] loc 0 diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/float-literals-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/float-literals-in.txt new file mode 100644 index 00000000000..dc621c5386b --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/float-literals-in.txt @@ -0,0 +1,21 @@ +varying vec2 uv; + +void main() +{ + vec4 c = vec4(0.0); + float a, b; + + a = uv.y * 1.111111e+6; + b = uv.y * 1.111110e+6; + c.x = a-b; + + a = uv.y * 1.23456789; + b = uv.y * 1.23456765; + c.y = a-b; + + a = uv.y * -1.234567e-6; + b = uv.y * -1.234565e-6; + c.z = a-b; + + gl_FragColor = c; +} diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/float-literals-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/float-literals-out.txt new file mode 100644 index 00000000000..38c1370a5c3 --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/float-literals-out.txt @@ -0,0 +1,23 @@ +varying vec2 uv; +void main () +{ + float b_1; + float a_2; + vec4 c_3; + c_3.w = 0.0; + a_2 = (uv.y * 1111111.0); + b_1 = (uv.y * 1111110.0); + c_3.x = (a_2 - b_1); + a_2 = (uv.y * 1.234568); + b_1 = (uv.y * 1.234568); + c_3.y = (a_2 - b_1); + a_2 = (uv.y * -1.234567e-06); + b_1 = (uv.y * -1.234565e-06); + c_3.z = (a_2 - b_1); + gl_FragColor = c_3; +} + + +// stats: 10 alu 0 tex 0 flow +// inputs: 1 +// #0: uv (high float) 2x1 [-1] diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-inES3.txt index 51f5c886d43..4baed65149b 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-inES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-inES3.txt @@ -55,8 +55,9 @@ vec4 xll_modf( vec4 x, out vec4 ip) { ip = vec4(i); return x-ip; } -mediump vec4 xlat_main( in highp vec4 uv ); -mediump vec4 xlat_main( in highp vec4 uv ) { + +mediump vec4 xlat_main (in highp vec4 uv) +{ mediump vec4 c; mediump vec4 d; c = vec4( 0.000000); @@ -68,8 +69,25 @@ mediump vec4 xlat_main( in highp vec4 uv ) { c.xy += xll_modf( uv.xy , d.xy ); c.xyz += xll_modf( uv.xyz , d.xyz ); c.xyzw += xll_modf( uv.xyzw , d.xyzw ); + + // GLSL mod function + c.x += mod(uv.x, d.x); + c.xy += mod(uv.xy, d.xy); + c.xyz += mod(uv.xyz, d.xyz); + + // inverse + c.x += 1.0/uv.x; // float + c.x += max(0.0, 1.0/uv.x); + + c.y += 1.0/c.z; // half + c.y += max(0.0, 1.0/c.w); + + // max with different precision arguments + c.x += max(uv.x, c.z); + return c; } + in highp vec4 xlv_TEXCOORD0; out mediump vec4 _fragData; void main() { diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES.txt index 8e947dbaee0..cb1132829d9 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES.txt @@ -97,31 +97,31 @@ void main () c_1 = (c_1 + tmpvar_22); highp float tmpvar_23; mediump float ip_24; - int tmpvar_25; + highp int tmpvar_25; tmpvar_25 = int(xlv_TEXCOORD0.x); ip_24 = float(tmpvar_25); tmpvar_23 = (xlv_TEXCOORD0.x - ip_24); c_1.x = (c_1.x + tmpvar_23); highp vec2 tmpvar_26; - mediump vec2 ip_27; - highp vec2 tmpvar_28; - tmpvar_28 = vec2(ivec2(xlv_TEXCOORD0.xy)); - ip_27 = tmpvar_28; - tmpvar_26 = (xlv_TEXCOORD0.xy - ip_27); + highp ivec2 tmpvar_27; + tmpvar_27 = ivec2(xlv_TEXCOORD0.xy); + mediump vec2 tmpvar_28; + tmpvar_28 = vec2(tmpvar_27); + tmpvar_26 = (xlv_TEXCOORD0.xy - tmpvar_28); c_1.xy = (c_1.xy + tmpvar_26); highp vec3 tmpvar_29; - mediump vec3 ip_30; - highp vec3 tmpvar_31; - tmpvar_31 = vec3(ivec3(xlv_TEXCOORD0.xyz)); - ip_30 = tmpvar_31; - tmpvar_29 = (xlv_TEXCOORD0.xyz - ip_30); + highp ivec3 tmpvar_30; + tmpvar_30 = ivec3(xlv_TEXCOORD0.xyz); + mediump vec3 tmpvar_31; + tmpvar_31 = vec3(tmpvar_30); + tmpvar_29 = (xlv_TEXCOORD0.xyz - tmpvar_31); c_1.xyz = (c_1.xyz + tmpvar_29); highp vec4 tmpvar_32; - mediump vec4 ip_33; - highp vec4 tmpvar_34; - tmpvar_34 = vec4(ivec4(xlv_TEXCOORD0)); - ip_33 = tmpvar_34; - tmpvar_32 = (xlv_TEXCOORD0 - ip_33); + highp ivec4 tmpvar_33; + tmpvar_33 = ivec4(xlv_TEXCOORD0); + mediump vec4 tmpvar_34; + tmpvar_34 = vec4(tmpvar_33); + tmpvar_32 = (xlv_TEXCOORD0 - tmpvar_34); c_1 = (c_1 + tmpvar_32); gl_FragData[0] = c_1; } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3.txt index 3c4a536a1e2..46cd23f7ce7 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3.txt @@ -99,36 +99,56 @@ void main () c_1 = (c_1 + tmpvar_22); highp float tmpvar_23; mediump float ip_24; - int tmpvar_25; + highp int tmpvar_25; tmpvar_25 = int(xlv_TEXCOORD0.x); ip_24 = float(tmpvar_25); tmpvar_23 = (xlv_TEXCOORD0.x - ip_24); c_1.x = (c_1.x + tmpvar_23); highp vec2 tmpvar_26; - mediump vec2 ip_27; - highp vec2 tmpvar_28; - tmpvar_28 = vec2(ivec2(xlv_TEXCOORD0.xy)); - ip_27 = tmpvar_28; - tmpvar_26 = (xlv_TEXCOORD0.xy - ip_27); + highp ivec2 tmpvar_27; + tmpvar_27 = ivec2(xlv_TEXCOORD0.xy); + mediump vec2 tmpvar_28; + tmpvar_28 = vec2(tmpvar_27); + tmpvar_26 = (xlv_TEXCOORD0.xy - tmpvar_28); c_1.xy = (c_1.xy + tmpvar_26); highp vec3 tmpvar_29; - mediump vec3 ip_30; - highp vec3 tmpvar_31; - tmpvar_31 = vec3(ivec3(xlv_TEXCOORD0.xyz)); - ip_30 = tmpvar_31; - tmpvar_29 = (xlv_TEXCOORD0.xyz - ip_30); + highp ivec3 tmpvar_30; + tmpvar_30 = ivec3(xlv_TEXCOORD0.xyz); + mediump vec3 tmpvar_31; + tmpvar_31 = vec3(tmpvar_30); + tmpvar_29 = (xlv_TEXCOORD0.xyz - tmpvar_31); c_1.xyz = (c_1.xyz + tmpvar_29); highp vec4 tmpvar_32; - mediump vec4 ip_33; - highp vec4 tmpvar_34; - tmpvar_34 = vec4(ivec4(xlv_TEXCOORD0)); - ip_33 = tmpvar_34; - tmpvar_32 = (xlv_TEXCOORD0 - ip_33); + highp ivec4 tmpvar_33; + tmpvar_33 = ivec4(xlv_TEXCOORD0); + mediump vec4 tmpvar_34; + tmpvar_34 = vec4(tmpvar_33); + tmpvar_32 = (xlv_TEXCOORD0 - tmpvar_34); c_1 = (c_1 + tmpvar_32); + highp float tmpvar_35; + tmpvar_35 = (float(mod (xlv_TEXCOORD0.x, tmpvar_34.x))); + c_1.x = (c_1.x + tmpvar_35); + highp vec2 tmpvar_36; + tmpvar_36 = (vec2(mod (xlv_TEXCOORD0.xy, tmpvar_34.xy))); + c_1.xy = (c_1.xy + tmpvar_36); + highp vec3 tmpvar_37; + tmpvar_37 = (vec3(mod (xlv_TEXCOORD0.xyz, tmpvar_34.xyz))); + c_1.xyz = (c_1.xyz + tmpvar_37); + highp float tmpvar_38; + tmpvar_38 = (1.0/(xlv_TEXCOORD0.x)); + c_1.x = (c_1.x + tmpvar_38); + highp float tmpvar_39; + tmpvar_39 = max (0.0, tmpvar_38); + c_1.x = (c_1.x + tmpvar_39); + c_1.y = (c_1.y + (1.0/(c_1.z))); + c_1.y = (c_1.y + max (0.0, (1.0/(c_1.w)))); + highp float tmpvar_40; + tmpvar_40 = max (xlv_TEXCOORD0.x, c_1.z); + c_1.x = (c_1.x + tmpvar_40); _fragData = c_1; } -// stats: 56 alu 0 tex 10 flow +// stats: 73 alu 0 tex 10 flow // inputs: 1 // #0: xlv_TEXCOORD0 (high float) 4x1 [-1] diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3Metal.txt index cdb4b924907..ef6d9b456b7 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3Metal.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3Metal.txt @@ -113,31 +113,51 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]] tmpvar_23 = (_mtl_i.xlv_TEXCOORD0.x - (float)ip_24); c_1.x = ((half)((float)c_1.x + tmpvar_23)); float2 tmpvar_26; - half2 ip_27; - float2 tmpvar_28; - tmpvar_28 = float2(int2(_mtl_i.xlv_TEXCOORD0.xy)); - ip_27 = half2(tmpvar_28); - tmpvar_26 = (_mtl_i.xlv_TEXCOORD0.xy - (float2)ip_27); + int2 tmpvar_27; + tmpvar_27 = int2(_mtl_i.xlv_TEXCOORD0.xy); + half2 tmpvar_28; + tmpvar_28 = half2(float2(tmpvar_27)); + tmpvar_26 = (_mtl_i.xlv_TEXCOORD0.xy - (float2)tmpvar_28); c_1.xy = ((half2)((float2)c_1.xy + tmpvar_26)); float3 tmpvar_29; - half3 ip_30; - float3 tmpvar_31; - tmpvar_31 = float3(int3(_mtl_i.xlv_TEXCOORD0.xyz)); - ip_30 = half3(tmpvar_31); - tmpvar_29 = (_mtl_i.xlv_TEXCOORD0.xyz - (float3)ip_30); + int3 tmpvar_30; + tmpvar_30 = int3(_mtl_i.xlv_TEXCOORD0.xyz); + half3 tmpvar_31; + tmpvar_31 = half3(float3(tmpvar_30)); + tmpvar_29 = (_mtl_i.xlv_TEXCOORD0.xyz - (float3)tmpvar_31); c_1.xyz = ((half3)((float3)c_1.xyz + tmpvar_29)); float4 tmpvar_32; - half4 ip_33; - float4 tmpvar_34; - tmpvar_34 = float4(int4(_mtl_i.xlv_TEXCOORD0)); - ip_33 = half4(tmpvar_34); - tmpvar_32 = (_mtl_i.xlv_TEXCOORD0 - (float4)ip_33); + int4 tmpvar_33; + tmpvar_33 = int4(_mtl_i.xlv_TEXCOORD0); + half4 tmpvar_34; + tmpvar_34 = half4(float4(tmpvar_33)); + tmpvar_32 = (_mtl_i.xlv_TEXCOORD0 - (float4)tmpvar_34); c_1 = ((half4)((float4)c_1 + tmpvar_32)); + float tmpvar_35; + tmpvar_35 = (float(fmod (_mtl_i.xlv_TEXCOORD0.x, (float)tmpvar_34.x))); + c_1.x = half(((float)c_1.x + tmpvar_35)); + float2 tmpvar_36; + tmpvar_36 = (float2(fmod (_mtl_i.xlv_TEXCOORD0.xy, (float2)tmpvar_34.xy))); + c_1.xy = half2(((float2)c_1.xy + tmpvar_36)); + float3 tmpvar_37; + tmpvar_37 = (float3(fmod (_mtl_i.xlv_TEXCOORD0.xyz, (float3)tmpvar_34.xyz))); + c_1.xyz = half3(((float3)c_1.xyz + tmpvar_37)); + float tmpvar_38; + tmpvar_38 = (1.0/(_mtl_i.xlv_TEXCOORD0.x)); + c_1.x = half(((float)c_1.x + tmpvar_38)); + float tmpvar_39; + tmpvar_39 = max (0.0, tmpvar_38); + c_1.x = half(((float)c_1.x + tmpvar_39)); + c_1.y = (c_1.y + ((half)1.0/(c_1.z))); + c_1.y = (c_1.y + max ((half)0.0, ((half)1.0/(c_1.w)))); + float tmpvar_40; + tmpvar_40 = max (_mtl_i.xlv_TEXCOORD0.x, (float)c_1.z); + c_1.x = half(((float)c_1.x + tmpvar_40)); _mtl_o._fragData = c_1; return _mtl_o; } -// stats: 56 alu 0 tex 10 flow +// stats: 73 alu 0 tex 10 flow // inputs: 1 // #0: xlv_TEXCOORD0 (high float) 4x1 [-1] diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-inES3.txt index e3b9418b462..3471a87ff17 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-inES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-inES3.txt @@ -8,7 +8,7 @@ uniform sampler2D _MainTex; uniform mediump vec4 _TerrainTreeLightColors[4]; lowp vec4 xlat_main (in v2f i) { highp int j = 0; - lowp vec4 col = texture2D( _MainTex, i.uv); + lowp vec4 col = texture( _MainTex, i.uv); mediump vec3 light = vec3(0.0); for ( ; (j < 3); (j++)) { light += col.xyz * i.nl[j] * _TerrainTreeLightColors[j].xyz; diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-inES3.txt index 8d2d608b7dd..73b6172a659 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-inES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-inES3.txt @@ -7,7 +7,7 @@ struct v2f { uniform sampler2D _MainTex; uniform mediump vec4 _TerrainTreeLightColors[4]; lowp vec4 xlat_main (in v2f i) { - lowp vec4 col = texture2D( _MainTex, i.uv); + lowp vec4 col = texture( _MainTex, i.uv); if (col.w < 0.5) discard; mediump vec3 light = vec3(0.0); diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-outES.txt index deb13948d6b..3b0113bf067 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-outES.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-outES.txt @@ -2,7 +2,7 @@ void main () { highp float f_1; f_1 = 0.0; - for (int i_2 = 0; i_2 < 32; i_2++) { + for (highp int i_2 = 0; i_2 < 32; i_2++) { f_1 = (f_1 + (gl_FragCoord.x * float(i_2))); }; highp vec4 tmpvar_3; diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-outES.txt index e0d32d30ec1..de5e0289e29 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-outES.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-outES.txt @@ -7,7 +7,7 @@ void main () lowp vec4 tmpvar_1; highp vec3 tmpvar_2; tmpvar_2 = xlv_nl; - int loopCount_4; + lowp int loopCount_4; mediump vec3 light_5; lowp vec4 col_6; lowp vec4 tmpvar_7; @@ -15,7 +15,7 @@ void main () col_6 = tmpvar_7; light_5 = vec3(0.0, 0.0, 0.0); loopCount_4 = int((tmpvar_7.w * 10.0)); - for (int j_3 = 0; j_3 < loopCount_4; j_3++) { + for (highp int j_3 = 0; j_3 < loopCount_4; j_3++) { light_5 = (light_5 + ((col_6.xyz * tmpvar_2[j_3] ) * _TerrainTreeLightColors[j_3].xyz)); diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-outES.txt index 19eddd50acc..bb9473b03d2 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-outES.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-outES.txt @@ -2,7 +2,7 @@ varying lowp float xx; void main () { lowp float c_1; - int tmpvar_3; + highp int tmpvar_3; if ((xx > 0.5)) { tmpvar_3 = 2; } else { @@ -12,7 +12,7 @@ void main () discard; }; c_1 = 0.0; - for (int i_2 = tmpvar_3; i_2 < 4; i_2++, c_1 = (c_1 + xx)) { + for (highp int i_2 = tmpvar_3; i_2 < 4; i_2++, c_1 = (c_1 + xx)) { }; lowp vec4 tmpvar_4; tmpvar_4 = vec4(c_1); diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-default-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-default-outES.txt index 44b73655f89..138e77f72be 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-default-outES.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-default-outES.txt @@ -8,20 +8,20 @@ uniform MyStruct s1; uniform float fh1; uniform highp float fh2; uniform mediump float fm; -uniform int il1; -uniform int il2; -uniform int im; +uniform highp int il1; +uniform lowp int il2; +uniform mediump int im; void main () { - int i_1; + highp int i_1; lowp float f_2; highp float tmpvar_3; tmpvar_3 = (((fh1 + fh2) + fm) + s1.f); f_2 = tmpvar_3; - int tmpvar_4; + mediump int tmpvar_4; tmpvar_4 = (((il1 + il2) + im) + s1.i); i_1 = tmpvar_4; - float tmpvar_5; + highp float tmpvar_5; if ((gl_FragCoord.x > 0.5)) { tmpvar_5 = 0.9; } else { diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-outES.txt index 0c8e9f8508e..c8a562aa297 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-outES.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-outES.txt @@ -5,13 +5,13 @@ uniform mediump float _EmberFadeStart; varying mediump vec2 xlv_TEXCOORD0; void main () { - lowp float t_1; - mediump float tmpvar_2; - tmpvar_2 = clamp (((_EmberFadeStart - 0.05) / (_EmberFadeStart - _EmberFadeEnd)), 0.0, 1.0); - t_1 = tmpvar_2; + mediump float x_1; + x_1 = ((_EmberFadeStart - 0.05) / (_EmberFadeStart - _EmberFadeEnd)); + lowp float tmpvar_2; + tmpvar_2 = clamp (x_1, 0.0, 1.0); lowp vec4 tmpvar_3; tmpvar_3.w = 1.0; - tmpvar_3.xyz = mix (texture2D (_MainTex, xlv_TEXCOORD0).xyz, texture2D (_BurntTex, xlv_TEXCOORD0).xyz, vec3(t_1)); + tmpvar_3.xyz = mix (texture2D (_MainTex, xlv_TEXCOORD0).xyz, texture2D (_BurntTex, xlv_TEXCOORD0).xyz, vec3(tmpvar_2)); gl_FragColor = tmpvar_3; } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-outES.txt index 17ca6d4570a..e132db421b7 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-outES.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-outES.txt @@ -5,13 +5,13 @@ uniform mediump float _EmberFadeStart; varying mediump vec2 xlv_TEXCOORD0; void main () { - lowp vec3 t_1; - mediump vec3 tmpvar_2; - tmpvar_2 = vec3(clamp (((_EmberFadeStart - 0.05) / (_EmberFadeStart - _EmberFadeEnd)), 0.0, 1.0)); - t_1 = tmpvar_2; + mediump float tmpvar_1; + tmpvar_1 = clamp (((_EmberFadeStart - 0.05) / (_EmberFadeStart - _EmberFadeEnd)), 0.0, 1.0); + lowp vec3 tmpvar_2; + tmpvar_2 = vec3(tmpvar_1); lowp vec4 tmpvar_3; tmpvar_3.w = 1.0; - tmpvar_3.xyz = mix (texture2D (_MainTex, xlv_TEXCOORD0).xyz, texture2D (_BurntTex, xlv_TEXCOORD0).xyz, t_1); + tmpvar_3.xyz = mix (texture2D (_MainTex, xlv_TEXCOORD0).xyz, texture2D (_BurntTex, xlv_TEXCOORD0).xyz, tmpvar_2); gl_FragColor = tmpvar_3; } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-inES3.txt new file mode 100644 index 00000000000..49922cbf773 --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-inES3.txt @@ -0,0 +1,28 @@ +#version 300 es + +// A very cut down variant of Unity's directional lightmap; +// has an inline medium precision matrix constructor, +// but even if dirBasis is declared as mediump +// some code was promoting it to high precision. + +out mediump vec4 _glesFragData; + +mat3 transposem3(mat3 m) { + return mat3( m[0][0], m[1][0], m[2][0], + m[0][1], m[1][1], m[2][1], + m[0][2], m[1][2], m[2][2]); +} + +in mediump vec3 inNormal; + +void main() +{ + mediump mat3 dirBasis = transposem3(mat3( + vec3( 0.8164966, 0.0, 0.5773503), + vec3( -0.4082483, 0.7071068, 0.5773503), + vec3( -0.4082483, -0.7071068, 0.5773503))); + mediump vec4 c; + c.xyz = dirBasis * inNormal; + c.w = 0.0; + _glesFragData = c; +} diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-outES3.txt new file mode 100644 index 00000000000..0f26e32ac16 --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-outES3.txt @@ -0,0 +1,25 @@ +#version 300 es +out mediump vec4 _glesFragData; +in mediump vec3 inNormal; +void main () +{ + mediump vec4 c_1; + mediump mat3 tmpvar_2; + tmpvar_2[uint(0)].x = 0.8164966; + tmpvar_2[uint(0)].y = -0.4082483; + tmpvar_2[uint(0)].z = -0.4082483; + tmpvar_2[1u].x = 0.0; + tmpvar_2[1u].y = 0.7071068; + tmpvar_2[1u].z = -0.7071068; + tmpvar_2[2u].x = 0.5773503; + tmpvar_2[2u].y = 0.5773503; + tmpvar_2[2u].z = 0.5773503; + c_1.xyz = (tmpvar_2 * inNormal); + c_1.w = 0.0; + _glesFragData = c_1; +} + + +// stats: 11 alu 0 tex 0 flow +// inputs: 1 +// #0: inNormal (medium float) 3x1 [-1] diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-outES3Metal.txt new file mode 100644 index 00000000000..80891a9b762 --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-outES3Metal.txt @@ -0,0 +1,34 @@ +#include <metal_stdlib> +using namespace metal; +struct xlatMtlShaderInput { + half3 inNormal; +}; +struct xlatMtlShaderOutput { + half4 _glesFragData [[color(0)]]; +}; +struct xlatMtlShaderUniform { +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 c_1; + half3x3 tmpvar_2; + tmpvar_2[0].x = half(0.8164966); + tmpvar_2[0].y = half(-0.4082483); + tmpvar_2[0].z = half(-0.4082483); + tmpvar_2[1].x = half(0.0); + tmpvar_2[1].y = half(0.7071068); + tmpvar_2[1].z = half(-0.7071068); + tmpvar_2[2].x = half(0.5773503); + tmpvar_2[2].y = half(0.5773503); + tmpvar_2[2].z = half(0.5773503); + c_1.xyz = (tmpvar_2 * _mtl_i.inNormal); + c_1.w = half(0.0); + _mtl_o._glesFragData = c_1; + return _mtl_o; +} + + +// stats: 11 alu 0 tex 0 flow +// inputs: 1 +// #0: inNormal (medium float) 3x1 [-1] diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-inES3.txt index 1e5641c652e..cee9269e6eb 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-inES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-inES3.txt @@ -9,12 +9,12 @@ uniform highp samplerCube cubehigh; mediump vec4 xlat_main(in highp vec4 uv) { mediump vec4 c; - c = texture2D(texlow, uv.xy); - c += texture2D(texmed, uv.xy); - c += texture2D(texhigh, uv.xy); - c += textureCube(cubelow, uv.xyz); - c += textureCube(cubemed, uv.xyz); - c += textureCube(cubehigh, uv.xyz); + c = texture(texlow, uv.xy); + c += texture(texmed, uv.xy); + c += texture(texhigh, uv.xy); + c += texture(cubelow, uv.xyz); + c += texture(cubemed, uv.xyz); + c += texture(cubehigh, uv.xyz); return c; } in highp vec4 varUV; diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES.txt index 7620496f4c9..5d39865c8cd 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES.txt @@ -1,11 +1,20 @@ #extension GL_EXT_shader_texture_lod : enable +lowp vec4 impl_low_texture2DLodEXT(lowp sampler2D sampler, highp vec2 coord, mediump float lod) +{ +#if defined(GL_EXT_shader_texture_lod) + return texture2DLodEXT(sampler, coord, lod); +#else + return texture2D(sampler, coord, lod); +#endif +} + uniform sampler2D tex; varying highp vec4 xlv_TEXCOORD0; void main () { mediump vec4 tmpvar_1; lowp vec4 tmpvar_2; - tmpvar_2 = texture2DLodEXT (tex, xlv_TEXCOORD0.xy, 0.0); + tmpvar_2 = impl_low_texture2DLodEXT (tex, xlv_TEXCOORD0.xy, 0.0); tmpvar_1 = tmpvar_2; gl_FragData[0] = tmpvar_1; } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3.txt index f10538fd201..a9a38f57417 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3.txt @@ -6,9 +6,9 @@ uniform lowp sampler3D vol; void main () { lowp vec4 c_1; - c_1 = (textureOffset (tex, uv.xy, ivec2(-2, -3)) + textureOffset (tex, uv.xy, 0.5, ivec2(4, 5))); + c_1 = (textureOffset (tex, uv.xy, ivec2(-2, -3)) + textureOffset (tex, uv.xy, ivec2(4, 5), 0.5)); c_1 = (c_1 + textureOffset (vol, uv, ivec3(-2, -3, -4))); - c_1 = (c_1 + textureOffset (vol, uv, -0.5, ivec3(4, 5, 6))); + c_1 = (c_1 + textureOffset (vol, uv, ivec3(4, 5, 6), -0.5)); c_1 = (c_1 + texelFetch (tex, ivec2(1, 2), 1)); c_1 = (c_1 + texelFetch (vol, ivec3(1, 2, 3), 2)); c_1 = (c_1 + texelFetchOffset (tex, ivec2(1, 2), 3, ivec2(-2, -3))); diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES.txt index 34d7157e174..2e61bbdab8d 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES.txt @@ -1,5 +1,23 @@ #extension GL_EXT_shader_texture_lod : enable #extension GL_EXT_shadow_samplers : enable +lowp vec4 impl_low_texture2DProjLodEXT(lowp sampler2D sampler, highp vec4 coord, mediump float lod) +{ +#if defined(GL_EXT_shader_texture_lod) + return texture2DProjLodEXT(sampler, coord, lod); +#else + return texture2DProj(sampler, coord, lod); +#endif +} + +lowp vec4 impl_low_texture2DProjLodEXT(lowp sampler2D sampler, highp vec3 coord, mediump float lod) +{ +#if defined(GL_EXT_shader_texture_lod) + return texture2DProjLodEXT(sampler, coord, lod); +#else + return texture2DProj(sampler, coord, lod); +#endif +} + uniform sampler2D tex; uniform lowp sampler2DShadow shadowmap; varying highp vec4 uv; @@ -7,8 +25,8 @@ void main () { lowp vec4 c_1; c_1 = (texture2DProj (tex, uv) + texture2DProj (tex, uv.xyz)); - c_1 = (c_1 + texture2DProjLodEXT (tex, uv, 1.0)); - c_1 = (c_1 + texture2DProjLodEXT (tex, uv.xyz, 1.0)); + c_1 = (c_1 + impl_low_texture2DProjLodEXT (tex, uv, 1.0)); + c_1 = (c_1 + impl_low_texture2DProjLodEXT (tex, uv.xyz, 1.0)); c_1 = (c_1 + vec4(shadow2DEXT (shadowmap, uv.xyz))); c_1 = (c_1 + vec4(shadow2DProjEXT (shadowmap, uv))); gl_FragColor = c_1; diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-inES3.txt new file mode 100644 index 00000000000..e85ddc5e200 --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-inES3.txt @@ -0,0 +1,136 @@ +#version 300 es + +// A variant produced by Unity's directional lightmap; +// has an inline medium precision matrix constructor, +// but even if unity_DirBasis is declared as mediump +// some code was promoting it to high precision. + +#define gl_FragColor _glesFragData[0] +#define gl_FragData _glesFragData +layout(location = 0)out mediump vec4 _glesFragData[4]; + +mat3 xll_transpose_mf3x3(mat3 m) { + return mat3( m[0][0], m[1][0], m[2][0], + m[0][1], m[1][1], m[2][1], + m[0][2], m[1][2], m[2][2]); +} +vec3 xll_saturate_vf3( vec3 x) { + return clamp( x, 0.0, 1.0); +} +struct SurfaceOutput { + lowp vec3 Albedo; + lowp vec3 Normal; + lowp vec3 Emission; + mediump float Specular; + lowp float Gloss; + lowp float Alpha; +}; +struct Input { + highp vec2 uv_MainTex; +}; +struct v2f_surf { + highp vec4 pos; + highp vec2 pack0; + lowp vec3 tSpace0; + lowp vec3 tSpace1; + lowp vec3 tSpace2; + highp vec4 lmap; +}; +uniform mediump vec4 _WorldSpaceLightPos0; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; +uniform lowp vec4 _LightColor0; +uniform lowp vec4 _SpecColor; +uniform sampler2D _MainTex; +uniform highp vec4 _MainTex_ST; +lowp vec3 DecodeLightmapDoubleLDR( in lowp vec4 color ) { + return (2.0 * color.xyz); +} +lowp vec3 DecodeLightmap( in lowp vec4 color ) { + + return DecodeLightmapDoubleLDR( color); +} +mediump vec3 DirLightmapDiffuse( in mediump mat3 dirBasis, in lowp vec4 color, in lowp vec4 scale, in mediump vec3 normal, in bool surfFuncWritesNormal, out mediump vec3 scalePerBasisVector ) { + mediump vec3 lm = DecodeLightmap( color); + + scalePerBasisVector = DecodeLightmap( scale); + if (surfFuncWritesNormal){ + + mediump vec3 normalInRnmBasis = xll_saturate_vf3((dirBasis * normal)); + lm *= dot( normalInRnmBasis, scalePerBasisVector); + } + + return lm; +} +mediump vec4 LightingLambert_DirLightmap( in SurfaceOutput s, in lowp vec4 color, in lowp vec4 scale, in bool surfFuncWritesNormal ) { + mediump mat3 unity_DirBasis = xll_transpose_mf3x3(mat3( vec3( 0.8164966, 0.0, 0.5773503), vec3( -0.4082483, 0.7071068, 0.5773503), vec3( -0.4082483, -0.7071068, 0.5773503))); + mediump vec3 scalePerBasisVector; + + mediump vec4 c; + c.xyz = DirLightmapDiffuse( unity_DirBasis, color, scale, s.Normal, surfFuncWritesNormal, scalePerBasisVector); + c.w = 0.0; + + return c; +} +void surf( in Input IN, inout SurfaceOutput o ) { + mediump vec4 c = texture( _MainTex, IN.uv_MainTex); + o.Albedo = c.xyz; + o.Alpha = c.w; + + o.Normal = ((c.xyz * 2.0) - 1.0); +} +lowp vec4 frag_surf( in v2f_surf IN ) { + Input surfIN; + + surfIN.uv_MainTex = IN.pack0.xy; + highp vec3 lightDir = _WorldSpaceLightPos0.xyz; + + SurfaceOutput o; + o.Albedo = vec3( 0.0); + o.Emission = vec3( 0.0); + + o.Specular = 0.0; + o.Alpha = 0.0; + o.Gloss = 0.0; + lowp vec3 normalWorldVertex = vec3( 0.0, 0.0, 1.0); + + surf( surfIN, o); + lowp float atten = 1.0; + + lowp vec4 c = vec4( 0.0); + + lowp vec4 lmtex = texture( unity_Lightmap, IN.lmap.xy); + lowp vec4 lmIndTex = texture( unity_LightmapInd, IN.lmap.xy); + mediump vec3 lm = LightingLambert_DirLightmap( o, lmtex, lmIndTex, true).xyz; + + lowp vec3 worldN; + worldN.x = dot( IN.tSpace0.xyz, o.Normal); + worldN.y = dot( IN.tSpace1.xyz, o.Normal); + worldN.z = dot( IN.tSpace2.xyz, o.Normal); + + o.Normal = worldN; + + c.w = o.Alpha; + + c.xyz += (o.Albedo * lm); + + c.w = 1.0; + return c; +} +in highp vec2 xlv_TEXCOORD0; +in lowp vec3 xlv_TEXCOORD1; +in lowp vec3 xlv_TEXCOORD2; +in lowp vec3 xlv_TEXCOORD3; +in highp vec4 xlv_TEXCOORD4; +void main() { + lowp vec4 xl_retval; + v2f_surf xlt_IN; + xlt_IN.pos = vec4(0.0); + xlt_IN.pack0 = vec2(xlv_TEXCOORD0); + xlt_IN.tSpace0 = vec3(xlv_TEXCOORD1); + xlt_IN.tSpace1 = vec3(xlv_TEXCOORD2); + xlt_IN.tSpace2 = vec3(xlv_TEXCOORD3); + xlt_IN.lmap = vec4(xlv_TEXCOORD4); + xl_retval = frag_surf( xlt_IN); + gl_FragData[0] = vec4(xl_retval); +} diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-outES3.txt new file mode 100644 index 00000000000..e2d412109ff --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-outES3.txt @@ -0,0 +1,55 @@ +#version 300 es +layout(location=0) out mediump vec4 _glesFragData[4]; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; +uniform sampler2D _MainTex; +in highp vec2 xlv_TEXCOORD0; +in highp vec4 xlv_TEXCOORD4; +void main () +{ + lowp vec4 c_1; + lowp vec3 tmpvar_2; + lowp vec3 tmpvar_3; + mediump vec4 c_4; + lowp vec4 tmpvar_5; + tmpvar_5 = texture (_MainTex, xlv_TEXCOORD0); + c_4 = tmpvar_5; + tmpvar_2 = c_4.xyz; + tmpvar_3 = ((c_4.xyz * 2.0) - 1.0); + mediump mat3 tmpvar_6; + tmpvar_6[uint(0)].x = 0.8164966; + tmpvar_6[uint(0)].y = -0.4082483; + tmpvar_6[uint(0)].z = -0.4082483; + tmpvar_6[1u].x = 0.0; + tmpvar_6[1u].y = 0.7071068; + tmpvar_6[1u].z = -0.7071068; + tmpvar_6[2u].x = 0.5773503; + tmpvar_6[2u].y = 0.5773503; + tmpvar_6[2u].z = 0.5773503; + mediump vec3 normal_7; + normal_7 = tmpvar_3; + mediump vec3 scalePerBasisVector_8; + mediump vec3 lm_9; + lowp vec3 tmpvar_10; + tmpvar_10 = (2.0 * texture (unity_Lightmap, xlv_TEXCOORD4.xy).xyz); + lm_9 = tmpvar_10; + lowp vec3 tmpvar_11; + tmpvar_11 = (2.0 * texture (unity_LightmapInd, xlv_TEXCOORD4.xy).xyz); + scalePerBasisVector_8 = tmpvar_11; + lm_9 = (lm_9 * dot (clamp ( + (tmpvar_6 * normal_7) + , 0.0, 1.0), scalePerBasisVector_8)); + c_1.xyz = (tmpvar_2 * lm_9); + c_1.w = 1.0; + _glesFragData[0] = c_1; +} + + +// stats: 19 alu 3 tex 0 flow +// inputs: 2 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// #1: xlv_TEXCOORD4 (high float) 4x1 [-1] +// textures: 3 +// #0: unity_Lightmap (low 2d) 0x0 [-1] +// #1: unity_LightmapInd (low 2d) 0x0 [-1] +// #2: _MainTex (low 2d) 0x0 [-1] diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-outES3Metal.txt new file mode 100644 index 00000000000..88dbe7f737a --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-outES3Metal.txt @@ -0,0 +1,64 @@ +#include <metal_stdlib> +using namespace metal; +struct xlatMtlShaderInput { + float2 xlv_TEXCOORD0; + float4 xlv_TEXCOORD4; +}; +struct xlatMtlShaderOutput { + half4 _glesFragData_0 [[color(0)]]; +}; +struct xlatMtlShaderUniform { +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , texture2d<half> unity_Lightmap [[texture(0)]], sampler _mtlsmp_unity_Lightmap [[sampler(0)]] + , texture2d<half> unity_LightmapInd [[texture(1)]], sampler _mtlsmp_unity_LightmapInd [[sampler(1)]] + , texture2d<half> _MainTex [[texture(2)]], sampler _mtlsmp__MainTex [[sampler(2)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 c_1; + half3 tmpvar_2; + half3 tmpvar_3; + half4 c_4; + half4 tmpvar_5; + tmpvar_5 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0)); + c_4 = tmpvar_5; + tmpvar_2 = c_4.xyz; + tmpvar_3 = ((c_4.xyz * (half)2.0) - (half)1.0); + half3x3 tmpvar_6; + tmpvar_6[0].x = half(0.8164966); + tmpvar_6[0].y = half(-0.4082483); + tmpvar_6[0].z = half(-0.4082483); + tmpvar_6[1].x = half(0.0); + tmpvar_6[1].y = half(0.7071068); + tmpvar_6[1].z = half(-0.7071068); + tmpvar_6[2].x = half(0.5773503); + tmpvar_6[2].y = half(0.5773503); + tmpvar_6[2].z = half(0.5773503); + half3 normal_7; + normal_7 = tmpvar_3; + half3 scalePerBasisVector_8; + half3 lm_9; + half3 tmpvar_10; + tmpvar_10 = ((half)2.0 * unity_Lightmap.sample(_mtlsmp_unity_Lightmap, (float2)(_mtl_i.xlv_TEXCOORD4.xy)).xyz); + lm_9 = tmpvar_10; + half3 tmpvar_11; + tmpvar_11 = ((half)2.0 * unity_LightmapInd.sample(_mtlsmp_unity_LightmapInd, (float2)(_mtl_i.xlv_TEXCOORD4.xy)).xyz); + scalePerBasisVector_8 = tmpvar_11; + lm_9 = (lm_9 * dot (clamp ( + (tmpvar_6 * normal_7) + , (half)0.0, (half)1.0), scalePerBasisVector_8)); + c_1.xyz = (tmpvar_2 * lm_9); + c_1.w = half(1.0); + _mtl_o._glesFragData_0 = c_1; + return _mtl_o; +} + + +// stats: 19 alu 3 tex 0 flow +// inputs: 2 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// #1: xlv_TEXCOORD4 (high float) 4x1 [-1] +// textures: 3 +// #0: unity_Lightmap (low 2d) 0x0 [-1] loc 0 +// #1: unity_LightmapInd (low 2d) 0x0 [-1] loc 1 +// #2: _MainTex (low 2d) 0x0 [-1] loc 2 diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-outES3.txt index a30082fbd25..1f09dc12cc5 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-outES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-outES3.txt @@ -19,7 +19,7 @@ void main () highp float tmpvar_5; tmpvar_5 = clamp (sampleOnEpipolarLine_3, 0.0, 1.0); sampleOnEpipolarLine_3 = tmpvar_5; - int tmpvar_6; + highp int tmpvar_6; tmpvar_6 = int(clamp (floor( (tmpvar_4 * 4.0) ), 0.0, 3.0)); diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-inES3.txt index 5af884e0b57..d8af75b617c 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-inES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-inES3.txt @@ -60,12 +60,12 @@ mediump vec4 UnpackNormal( in mediump vec4 packednormal ) { } void surf( in Input IN, inout SurfaceOutput o ) { vec4 tex; - tex = texture2D( _MainTex, IN.uv_MainTex); + tex = texture( _MainTex, IN.uv_MainTex); o.Albedo = (tex.xyz * _Color.xyz ); o.Gloss = tex.w ; o.Alpha = (tex.w * _Color.w ); o.Specular = _Shininess; - o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap))); + o.Normal = vec3( UnpackNormal( texture( _BumpMap, IN.uv_BumpMap))); } vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) { vec3 h; diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3.txt index e9f09eeec43..47da6025b7d 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3.txt @@ -45,7 +45,9 @@ void main () c_8.w = (tmpvar_3 + ((_LightColor0.w * _SpecColor.w) * spec_9)); c_1.xyz = (c_8.xyz + (tmpvar_2 * _uv3)); c_1.w = tmpvar_3; - _fragData = c_1; + lowp vec4 tmpvar_11; + tmpvar_11 = c_1; + _fragData = tmpvar_11; } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3Metal.txt index ccb11717f93..40f554b18a3 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3Metal.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3Metal.txt @@ -55,7 +55,9 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]] c_8.w = (tmpvar_3 + ((_mtl_u._LightColor0.w * _mtl_u._SpecColor.w) * spec_9)); c_1.xyz = (c_8.xyz + (tmpvar_2 * _mtl_i._uv3)); c_1.w = tmpvar_3; - _mtl_o._fragData = c_1; + half4 tmpvar_12; + tmpvar_12 = c_1; + _mtl_o._fragData = tmpvar_12; return _mtl_o; } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-inES3.txt index 8e5e2f72f85..86e532d7b87 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-inES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-inES3.txt @@ -38,7 +38,7 @@ mediump float unitySampleShadow( in highp vec4 eyePos ) { far = vec4( lessThan( vec4( z ), _LightSplitsFar) ); weights = (near * far); coord = vec4( ((((sc0 * weights.x ) + (sc1 * weights.y )) + (sc2 * weights.z )) + (sc3 * weights.w )), 1.00000); - shadow = ( (texture2D( _ShadowMapTexture, coord.xy ).x < coord.z ) ) ? ( _LightShadowData.x ) : ( 1.00000 ); + shadow = ( (texture( _ShadowMapTexture, coord.xy ).x < coord.z ) ) ? ( _LightShadowData.x ) : ( 1.00000 ); return shadow; } highp float Linear01Depth( in highp float z ) { @@ -58,7 +58,7 @@ mediump vec4 xlat_main( in v2f i ) { highp vec4 vpos; mediump float shadow; highp vec4 res; - depth = texture2D( _CameraDepthTexture, i.uv).x ; + depth = texture( _CameraDepthTexture, i.uv).x ; depth = Linear01Depth( depth); vpos = vec4( (i.ray * depth), 1.00000); shadow = unitySampleShadow( vpos); diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-inES3.txt index 7efdbbf3dd6..366fe2f4cac 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-inES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-inES3.txt @@ -1,7 +1,7 @@ #version 300 es out lowp vec4 _fragData; vec4 xll_tex2Dlod(sampler2D s, vec4 coord) { - return texture2DLod( s, coord.xy, coord.w); + return textureLod( s, coord.xy, coord.w); } uniform sampler2D _MainTex; uniform vec4 _MainTex_TexelSize; diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-out.txt index 03c51d95b35..5a7ad47a804 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-out.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-out.txt @@ -42,16 +42,16 @@ void main () vec4 tmpvar_24; tmpvar_24 = texture2DLod (_MainTex, tmpvar_23.xy, 0.0); float tmpvar_25; - tmpvar_25 = ((tmpvar_17.y * 1.96321) + tmpvar_17.x); + tmpvar_25 = ((tmpvar_17.y * 1.963211) + tmpvar_17.x); lumaN_15 = tmpvar_25; float tmpvar_26; - tmpvar_26 = ((tmpvar_19.y * 1.96321) + tmpvar_19.x); + tmpvar_26 = ((tmpvar_19.y * 1.963211) + tmpvar_19.x); float tmpvar_27; - tmpvar_27 = ((tmpvar_20.y * 1.96321) + tmpvar_20.x); + tmpvar_27 = ((tmpvar_20.y * 1.963211) + tmpvar_20.x); float tmpvar_28; - tmpvar_28 = ((tmpvar_22.y * 1.96321) + tmpvar_22.x); + tmpvar_28 = ((tmpvar_22.y * 1.963211) + tmpvar_22.x); float tmpvar_29; - tmpvar_29 = ((tmpvar_24.y * 1.96321) + tmpvar_24.x); + tmpvar_29 = ((tmpvar_24.y * 1.963211) + tmpvar_24.x); lumaS_14 = tmpvar_29; float tmpvar_30; tmpvar_30 = max (max (tmpvar_27, tmpvar_25), max (max (tmpvar_26, tmpvar_29), tmpvar_28)); @@ -60,7 +60,7 @@ void main () min (tmpvar_26, tmpvar_29) , tmpvar_28))); float tmpvar_32; - tmpvar_32 = max (0.0416667, (tmpvar_30 * 0.125)); + tmpvar_32 = max (0.04166667, (tmpvar_30 * 0.125)); if ((tmpvar_31 < tmpvar_32)) { tmpvar_2 = tmpvar_20.xyz; } else { @@ -69,7 +69,7 @@ void main () ((abs(( (((tmpvar_25 + tmpvar_26) + (tmpvar_28 + tmpvar_29)) * 0.25) - tmpvar_27)) / tmpvar_31) - 0.25) - ) * 1.33333)); + ) * 1.333333)); vec4 tmpvar_34; tmpvar_34.zw = vec2(0.0, 0.0); tmpvar_34.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy); @@ -93,15 +93,15 @@ void main () rgbL_13 = (((tmpvar_17.xyz + tmpvar_19.xyz) + (tmpvar_20.xyz + tmpvar_22.xyz)) + ((tmpvar_24.xyz + tmpvar_35.xyz) + ( (tmpvar_37.xyz + tmpvar_39.xyz) + tmpvar_41.xyz))); - rgbL_13 = (rgbL_13 * vec3(0.111111, 0.111111, 0.111111)); + rgbL_13 = (rgbL_13 * vec3(0.1111111, 0.1111111, 0.1111111)); float tmpvar_42; - tmpvar_42 = ((tmpvar_35.y * 1.96321) + tmpvar_35.x); + tmpvar_42 = ((tmpvar_35.y * 1.963211) + tmpvar_35.x); float tmpvar_43; - tmpvar_43 = ((tmpvar_37.y * 1.96321) + tmpvar_37.x); + tmpvar_43 = ((tmpvar_37.y * 1.963211) + tmpvar_37.x); float tmpvar_44; - tmpvar_44 = ((tmpvar_39.y * 1.96321) + tmpvar_39.x); + tmpvar_44 = ((tmpvar_39.y * 1.963211) + tmpvar_39.x); float tmpvar_45; - tmpvar_45 = ((tmpvar_41.y * 1.96321) + tmpvar_41.x); + tmpvar_45 = ((tmpvar_41.y * 1.963211) + tmpvar_41.x); bool tmpvar_46; tmpvar_46 = ((( abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_26)) + (0.25 * tmpvar_44))) @@ -186,12 +186,12 @@ void main () if (!(doneN_5)) { vec4 tmpvar_56; tmpvar_56 = texture2DLod (_MainTex, posN_10, 0.0); - lumaEndN_7 = ((tmpvar_56.y * 1.96321) + tmpvar_56.x); + lumaEndN_7 = ((tmpvar_56.y * 1.963211) + tmpvar_56.x); }; if (!(doneP_4)) { vec4 tmpvar_57; tmpvar_57 = texture2DLod (_MainTex, posP_9, 0.0); - lumaEndP_6 = ((tmpvar_57.y * 1.96321) + tmpvar_57.x); + lumaEndP_6 = ((tmpvar_57.y * 1.963211) + tmpvar_57.x); }; bool tmpvar_58; if (doneN_5) { diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3.txt index f0ee0edc0a6..371c8e0fcfb 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3.txt @@ -43,16 +43,16 @@ void main () lowp vec4 tmpvar_24; tmpvar_24 = textureLod (_MainTex, tmpvar_23.xy, 0.0); lowp float tmpvar_25; - tmpvar_25 = ((tmpvar_17.y * 1.96321) + tmpvar_17.x); + tmpvar_25 = ((tmpvar_17.y * 1.963211) + tmpvar_17.x); lumaN_15 = tmpvar_25; lowp float tmpvar_26; - tmpvar_26 = ((tmpvar_19.y * 1.96321) + tmpvar_19.x); + tmpvar_26 = ((tmpvar_19.y * 1.963211) + tmpvar_19.x); lowp float tmpvar_27; - tmpvar_27 = ((tmpvar_20.y * 1.96321) + tmpvar_20.x); + tmpvar_27 = ((tmpvar_20.y * 1.963211) + tmpvar_20.x); lowp float tmpvar_28; - tmpvar_28 = ((tmpvar_22.y * 1.96321) + tmpvar_22.x); + tmpvar_28 = ((tmpvar_22.y * 1.963211) + tmpvar_22.x); lowp float tmpvar_29; - tmpvar_29 = ((tmpvar_24.y * 1.96321) + tmpvar_24.x); + tmpvar_29 = ((tmpvar_24.y * 1.963211) + tmpvar_24.x); lumaS_14 = tmpvar_29; lowp float tmpvar_30; tmpvar_30 = max (max (tmpvar_27, tmpvar_25), max (max (tmpvar_26, tmpvar_29), tmpvar_28)); @@ -61,7 +61,7 @@ void main () min (tmpvar_26, tmpvar_29) , tmpvar_28))); lowp float tmpvar_32; - tmpvar_32 = max (0.0416667, (tmpvar_30 * 0.125)); + tmpvar_32 = max (0.04166667, (tmpvar_30 * 0.125)); if ((tmpvar_31 < tmpvar_32)) { tmpvar_2 = tmpvar_20.xyz; } else { @@ -70,7 +70,7 @@ void main () ((abs(( (((tmpvar_25 + tmpvar_26) + (tmpvar_28 + tmpvar_29)) * 0.25) - tmpvar_27)) / tmpvar_31) - 0.25) - ) * 1.33333)); + ) * 1.333333)); highp vec4 tmpvar_34; tmpvar_34.zw = vec2(0.0, 0.0); tmpvar_34.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy); @@ -94,15 +94,15 @@ void main () rgbL_13 = (((tmpvar_17.xyz + tmpvar_19.xyz) + (tmpvar_20.xyz + tmpvar_22.xyz)) + ((tmpvar_24.xyz + tmpvar_35.xyz) + ( (tmpvar_37.xyz + tmpvar_39.xyz) + tmpvar_41.xyz))); - rgbL_13 = (rgbL_13 * vec3(0.111111, 0.111111, 0.111111)); + rgbL_13 = (rgbL_13 * vec3(0.1111111, 0.1111111, 0.1111111)); lowp float tmpvar_42; - tmpvar_42 = ((tmpvar_35.y * 1.96321) + tmpvar_35.x); + tmpvar_42 = ((tmpvar_35.y * 1.963211) + tmpvar_35.x); lowp float tmpvar_43; - tmpvar_43 = ((tmpvar_37.y * 1.96321) + tmpvar_37.x); + tmpvar_43 = ((tmpvar_37.y * 1.963211) + tmpvar_37.x); lowp float tmpvar_44; - tmpvar_44 = ((tmpvar_39.y * 1.96321) + tmpvar_39.x); + tmpvar_44 = ((tmpvar_39.y * 1.963211) + tmpvar_39.x); lowp float tmpvar_45; - tmpvar_45 = ((tmpvar_41.y * 1.96321) + tmpvar_41.x); + tmpvar_45 = ((tmpvar_41.y * 1.963211) + tmpvar_41.x); bool tmpvar_46; tmpvar_46 = ((( abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_26)) + (0.25 * tmpvar_44))) @@ -183,16 +183,16 @@ void main () doneP_4 = bool(0); posN_10 = (posN_10 - tmpvar_53); posP_9 = (posP_9 + tmpvar_53); - for (int i_3 = 0; i_3 < 16; i_3++) { + for (highp int i_3 = 0; i_3 < 16; i_3++) { if (!(doneN_5)) { lowp vec4 tmpvar_56; tmpvar_56 = textureLod (_MainTex, posN_10, 0.0); - lumaEndN_7 = ((tmpvar_56.y * 1.96321) + tmpvar_56.x); + lumaEndN_7 = ((tmpvar_56.y * 1.963211) + tmpvar_56.x); }; if (!(doneP_4)) { lowp vec4 tmpvar_57; tmpvar_57 = textureLod (_MainTex, posP_9, 0.0); - lumaEndP_6 = ((tmpvar_57.y * 1.96321) + tmpvar_57.x); + lumaEndP_6 = ((tmpvar_57.y * 1.963211) + tmpvar_57.x); }; bool tmpvar_58; if (doneN_5) { diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3Metal.txt index 8eb42aa0a23..852c4e0d203 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3Metal.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3Metal.txt @@ -51,16 +51,16 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]] half4 tmpvar_24; tmpvar_24 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_23.xy), level(0.0)); half tmpvar_25; - tmpvar_25 = ((tmpvar_17.y * (half)1.96321) + tmpvar_17.x); + tmpvar_25 = ((tmpvar_17.y * (half)1.963211) + tmpvar_17.x); lumaN_15 = tmpvar_25; half tmpvar_26; - tmpvar_26 = ((tmpvar_19.y * (half)1.96321) + tmpvar_19.x); + tmpvar_26 = ((tmpvar_19.y * (half)1.963211) + tmpvar_19.x); half tmpvar_27; - tmpvar_27 = ((tmpvar_20.y * (half)1.96321) + tmpvar_20.x); + tmpvar_27 = ((tmpvar_20.y * (half)1.963211) + tmpvar_20.x); half tmpvar_28; - tmpvar_28 = ((tmpvar_22.y * (half)1.96321) + tmpvar_22.x); + tmpvar_28 = ((tmpvar_22.y * (half)1.963211) + tmpvar_22.x); half tmpvar_29; - tmpvar_29 = ((tmpvar_24.y * (half)1.96321) + tmpvar_24.x); + tmpvar_29 = ((tmpvar_24.y * (half)1.963211) + tmpvar_24.x); lumaS_14 = tmpvar_29; half tmpvar_30; tmpvar_30 = max (max (tmpvar_27, tmpvar_25), max (max (tmpvar_26, tmpvar_29), tmpvar_28)); @@ -69,7 +69,7 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]] min (tmpvar_26, tmpvar_29) , tmpvar_28))); half tmpvar_32; - tmpvar_32 = max ((half)0.0416667, (tmpvar_30 * (half)0.125)); + tmpvar_32 = max ((half)0.04166667, (tmpvar_30 * (half)0.125)); if ((tmpvar_31 < tmpvar_32)) { tmpvar_2 = tmpvar_20.xyz; } else { @@ -78,7 +78,7 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]] ((abs(( (((tmpvar_25 + tmpvar_26) + (tmpvar_28 + tmpvar_29)) * (half)0.25) - tmpvar_27)) / tmpvar_31) - (half)0.25) - ) * (half)1.33333)); + ) * (half)1.333333)); float4 tmpvar_34; tmpvar_34.zw = float2(0.0, 0.0); tmpvar_34.xy = (_mtl_i.xlv_TEXCOORD0 - _mtl_u._MainTex_TexelSize.xy); @@ -102,15 +102,15 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]] rgbL_13 = (((tmpvar_17.xyz + tmpvar_19.xyz) + (tmpvar_20.xyz + tmpvar_22.xyz)) + ((tmpvar_24.xyz + tmpvar_35.xyz) + ( (tmpvar_37.xyz + tmpvar_39.xyz) + tmpvar_41.xyz))); - rgbL_13 = (rgbL_13 * (half3)float3(0.111111, 0.111111, 0.111111)); + rgbL_13 = (rgbL_13 * (half3)float3(0.1111111, 0.1111111, 0.1111111)); half tmpvar_42; - tmpvar_42 = ((tmpvar_35.y * (half)1.96321) + tmpvar_35.x); + tmpvar_42 = ((tmpvar_35.y * (half)1.963211) + tmpvar_35.x); half tmpvar_43; - tmpvar_43 = ((tmpvar_37.y * (half)1.96321) + tmpvar_37.x); + tmpvar_43 = ((tmpvar_37.y * (half)1.963211) + tmpvar_37.x); half tmpvar_44; - tmpvar_44 = ((tmpvar_39.y * (half)1.96321) + tmpvar_39.x); + tmpvar_44 = ((tmpvar_39.y * (half)1.963211) + tmpvar_39.x); half tmpvar_45; - tmpvar_45 = ((tmpvar_41.y * (half)1.96321) + tmpvar_41.x); + tmpvar_45 = ((tmpvar_41.y * (half)1.963211) + tmpvar_41.x); bool tmpvar_46; tmpvar_46 = ((( abs(((((half)0.25 * tmpvar_42) + ((half)-0.5 * tmpvar_26)) + ((half)0.25 * tmpvar_44))) @@ -195,12 +195,12 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]] if (!(doneN_5)) { half4 tmpvar_56; tmpvar_56 = _MainTex.sample(_mtlsmp__MainTex, (float2)(posN_10), level(0.0)); - lumaEndN_7 = ((tmpvar_56.y * (half)1.96321) + tmpvar_56.x); + lumaEndN_7 = ((tmpvar_56.y * (half)1.963211) + tmpvar_56.x); }; if (!(doneP_4)) { half4 tmpvar_57; tmpvar_57 = _MainTex.sample(_mtlsmp__MainTex, (float2)(posP_9), level(0.0)); - lumaEndP_6 = ((tmpvar_57.y * (half)1.96321) + tmpvar_57.x); + lumaEndP_6 = ((tmpvar_57.y * (half)1.963211) + tmpvar_57.x); }; bool tmpvar_58; if (doneN_5) { diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-outES.txt index ad30543e3dc..8405c1fa905 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-outES.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-outES.txt @@ -1,4 +1,13 @@ #extension GL_EXT_shader_texture_lod : enable +lowp vec4 impl_low_texture2DLodEXT(lowp sampler2D sampler, highp vec2 coord, mediump float lod) +{ +#if defined(GL_EXT_shader_texture_lod) + return texture2DLodEXT(sampler, coord, lod); +#else + return texture2D(sampler, coord, lod); +#endif +} + uniform sampler2D _MainTex; uniform highp vec4 _MainTex_TexelSize; varying highp vec2 xlv_TEXCOORD0; @@ -19,23 +28,23 @@ void main () highp float lumaM_10; highp float lumaNe_11; lowp vec4 tmpvar_12; - tmpvar_12 = texture2DLodEXT (_MainTex, xlv_TEXCOORD1.xy, 0.0); + tmpvar_12 = impl_low_texture2DLodEXT (_MainTex, xlv_TEXCOORD1.xy, 0.0); highp float tmpvar_13; tmpvar_13 = tmpvar_12.y; lowp vec4 tmpvar_14; - tmpvar_14 = texture2DLodEXT (_MainTex, xlv_TEXCOORD1.xw, 0.0); + tmpvar_14 = impl_low_texture2DLodEXT (_MainTex, xlv_TEXCOORD1.xw, 0.0); highp float tmpvar_15; tmpvar_15 = tmpvar_14.y; lowp vec4 tmpvar_16; - tmpvar_16 = texture2DLodEXT (_MainTex, xlv_TEXCOORD1.zy, 0.0); + tmpvar_16 = impl_low_texture2DLodEXT (_MainTex, xlv_TEXCOORD1.zy, 0.0); highp float tmpvar_17; tmpvar_17 = tmpvar_16.y; lowp vec4 tmpvar_18; - tmpvar_18 = texture2DLodEXT (_MainTex, xlv_TEXCOORD1.zw, 0.0); + tmpvar_18 = impl_low_texture2DLodEXT (_MainTex, xlv_TEXCOORD1.zw, 0.0); highp float tmpvar_19; tmpvar_19 = tmpvar_18.y; lowp vec4 tmpvar_20; - tmpvar_20 = texture2DLodEXT (_MainTex, xlv_TEXCOORD0, 0.0); + tmpvar_20 = impl_low_texture2DLodEXT (_MainTex, xlv_TEXCOORD0, 0.0); lumaM_10 = tmpvar_20.y; lumaNe_11 = (tmpvar_17 + 0.00260417); highp float tmpvar_21; @@ -70,8 +79,8 @@ void main () highp vec4 tmpvar_29; tmpvar_29.zw = vec2(0.0, 0.0); tmpvar_29.xy = (xlv_TEXCOORD0 + (tmpvar_27 * fxaaConsoleRcpFrameOpt2_2.zw)); - rgbyA_5 = (texture2DLodEXT (_MainTex, tmpvar_25.xy, 0.0) + texture2DLodEXT (_MainTex, tmpvar_26.xy, 0.0)); - rgbyB_4 = (((texture2DLodEXT (_MainTex, tmpvar_28.xy, 0.0) + texture2DLodEXT (_MainTex, tmpvar_29.xy, 0.0)) * 0.25) + (rgbyA_5 * 0.25)); + rgbyA_5 = (impl_low_texture2DLodEXT (_MainTex, tmpvar_25.xy, 0.0) + impl_low_texture2DLodEXT (_MainTex, tmpvar_26.xy, 0.0)); + rgbyB_4 = (((impl_low_texture2DLodEXT (_MainTex, tmpvar_28.xy, 0.0) + impl_low_texture2DLodEXT (_MainTex, tmpvar_29.xy, 0.0)) * 0.25) + (rgbyA_5 * 0.25)); if (((rgbyB_4.y < tmpvar_22) || (rgbyB_4.y > tmpvar_21))) { rgbyB_4.xyz = (rgbyA_5.xyz * 0.5); }; diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-outES.txt index ac6895e731e..898fcd4d743 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-outES.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-outES.txt @@ -1,4 +1,13 @@ #extension GL_EXT_shader_texture_lod : enable +lowp vec4 impl_low_texture2DLodEXT(lowp sampler2D sampler, highp vec2 coord, mediump float lod) +{ +#if defined(GL_EXT_shader_texture_lod) + return texture2DLodEXT(sampler, coord, lod); +#else + return texture2D(sampler, coord, lod); +#endif +} + uniform sampler2D _MainTex; uniform highp vec4 _MainTex_TexelSize; varying highp vec2 xlv_TEXCOORD0; @@ -48,13 +57,13 @@ void main () highp vec2 posM_41; posM_41 = xlv_TEXCOORD0; lowp vec4 tmpvar_42; - tmpvar_42 = texture2DLodEXT (_MainTex, xlv_TEXCOORD0, 0.0); + tmpvar_42 = impl_low_texture2DLodEXT (_MainTex, xlv_TEXCOORD0, 0.0); rgbyM_40 = tmpvar_42; highp vec4 tmpvar_43; tmpvar_43.zw = vec2(0.0, 0.0); tmpvar_43.xy = (xlv_TEXCOORD0 + (vec2(0.0, 1.0) * _MainTex_TexelSize.xy)); lowp vec4 tmpvar_44; - tmpvar_44 = texture2DLodEXT (_MainTex, tmpvar_43.xy, 0.0); + tmpvar_44 = impl_low_texture2DLodEXT (_MainTex, tmpvar_43.xy, 0.0); highp vec4 rgba_45; rgba_45 = tmpvar_44; lumaS_39 = rgba_45.w; @@ -62,7 +71,7 @@ void main () tmpvar_46.zw = vec2(0.0, 0.0); tmpvar_46.xy = (xlv_TEXCOORD0 + (vec2(1.0, 0.0) * _MainTex_TexelSize.xy)); lowp vec4 tmpvar_47; - tmpvar_47 = texture2DLodEXT (_MainTex, tmpvar_46.xy, 0.0); + tmpvar_47 = impl_low_texture2DLodEXT (_MainTex, tmpvar_46.xy, 0.0); highp float tmpvar_48; highp vec4 rgba_49; rgba_49 = tmpvar_47; @@ -71,7 +80,7 @@ void main () tmpvar_50.zw = vec2(0.0, 0.0); tmpvar_50.xy = (xlv_TEXCOORD0 + (vec2(0.0, -1.0) * _MainTex_TexelSize.xy)); lowp vec4 tmpvar_51; - tmpvar_51 = texture2DLodEXT (_MainTex, tmpvar_50.xy, 0.0); + tmpvar_51 = impl_low_texture2DLodEXT (_MainTex, tmpvar_50.xy, 0.0); highp vec4 rgba_52; rgba_52 = tmpvar_51; lumaN_38 = rgba_52.w; @@ -79,7 +88,7 @@ void main () tmpvar_53.zw = vec2(0.0, 0.0); tmpvar_53.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 0.0) * _MainTex_TexelSize.xy)); lowp vec4 tmpvar_54; - tmpvar_54 = texture2DLodEXT (_MainTex, tmpvar_53.xy, 0.0); + tmpvar_54 = impl_low_texture2DLodEXT (_MainTex, tmpvar_53.xy, 0.0); highp float tmpvar_55; highp vec4 rgba_56; rgba_56 = tmpvar_54; @@ -96,28 +105,28 @@ void main () tmpvar_58.zw = vec2(0.0, 0.0); tmpvar_58.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy); lowp vec4 tmpvar_59; - tmpvar_59 = texture2DLodEXT (_MainTex, tmpvar_58.xy, 0.0); + tmpvar_59 = impl_low_texture2DLodEXT (_MainTex, tmpvar_58.xy, 0.0); highp vec4 rgba_60; rgba_60 = tmpvar_59; highp vec4 tmpvar_61; tmpvar_61.zw = vec2(0.0, 0.0); tmpvar_61.xy = (xlv_TEXCOORD0 + _MainTex_TexelSize.xy); lowp vec4 tmpvar_62; - tmpvar_62 = texture2DLodEXT (_MainTex, tmpvar_61.xy, 0.0); + tmpvar_62 = impl_low_texture2DLodEXT (_MainTex, tmpvar_61.xy, 0.0); highp vec4 rgba_63; rgba_63 = tmpvar_62; highp vec4 tmpvar_64; tmpvar_64.zw = vec2(0.0, 0.0); tmpvar_64.xy = (xlv_TEXCOORD0 + (vec2(1.0, -1.0) * _MainTex_TexelSize.xy)); lowp vec4 tmpvar_65; - tmpvar_65 = texture2DLodEXT (_MainTex, tmpvar_64.xy, 0.0); + tmpvar_65 = impl_low_texture2DLodEXT (_MainTex, tmpvar_64.xy, 0.0); highp vec4 rgba_66; rgba_66 = tmpvar_65; highp vec4 tmpvar_67; tmpvar_67.zw = vec2(0.0, 0.0); tmpvar_67.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 1.0) * _MainTex_TexelSize.xy)); lowp vec4 tmpvar_68; - tmpvar_68 = texture2DLodEXT (_MainTex, tmpvar_67.xy, 0.0); + tmpvar_68 = impl_low_texture2DLodEXT (_MainTex, tmpvar_67.xy, 0.0); highp vec4 rgba_69; rgba_69 = tmpvar_68; lumaNS_36 = (rgba_52.w + rgba_45.w); @@ -187,13 +196,13 @@ void main () posP_20.y = (posB_22.y + tmpvar_73); subpixD_19 = ((-2.0 * tmpvar_71) + 3.0); lowp vec4 tmpvar_74; - tmpvar_74 = texture2DLodEXT (_MainTex, posN_21, 0.0); + tmpvar_74 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0); highp vec4 rgba_75; rgba_75 = tmpvar_74; lumaEndN_18 = rgba_75.w; subpixE_17 = (tmpvar_71 * tmpvar_71); lowp vec4 tmpvar_76; - tmpvar_76 = texture2DLodEXT (_MainTex, posP_20, 0.0); + tmpvar_76 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0); highp vec4 rgba_77; rgba_77 = tmpvar_76; lumaEndP_16 = rgba_77.w; @@ -223,14 +232,14 @@ void main () if (doneNP_10) { if (!(doneN_12)) { lowp vec4 tmpvar_78; - tmpvar_78 = texture2DLodEXT (_MainTex, posN_21, 0.0); + tmpvar_78 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0); highp vec4 rgba_79; rgba_79 = tmpvar_78; lumaEndN_18 = rgba_79.w; }; if (!(doneP_11)) { lowp vec4 tmpvar_80; - tmpvar_80 = texture2DLodEXT (_MainTex, posP_20, 0.0); + tmpvar_80 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0); highp vec4 rgba_81; rgba_81 = tmpvar_80; lumaEndP_16 = rgba_81.w; @@ -259,14 +268,14 @@ void main () if (doneNP_10) { if (!(doneN_12)) { lowp vec4 tmpvar_82; - tmpvar_82 = texture2DLodEXT (_MainTex, posN_21, 0.0); + tmpvar_82 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0); highp vec4 rgba_83; rgba_83 = tmpvar_82; lumaEndN_18 = rgba_83.w; }; if (!(doneP_11)) { lowp vec4 tmpvar_84; - tmpvar_84 = texture2DLodEXT (_MainTex, posP_20, 0.0); + tmpvar_84 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0); highp vec4 rgba_85; rgba_85 = tmpvar_84; lumaEndP_16 = rgba_85.w; @@ -295,14 +304,14 @@ void main () if (doneNP_10) { if (!(doneN_12)) { lowp vec4 tmpvar_86; - tmpvar_86 = texture2DLodEXT (_MainTex, posN_21, 0.0); + tmpvar_86 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0); highp vec4 rgba_87; rgba_87 = tmpvar_86; lumaEndN_18 = rgba_87.w; }; if (!(doneP_11)) { lowp vec4 tmpvar_88; - tmpvar_88 = texture2DLodEXT (_MainTex, posP_20, 0.0); + tmpvar_88 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0); highp vec4 rgba_89; rgba_89 = tmpvar_88; lumaEndP_16 = rgba_89.w; @@ -331,14 +340,14 @@ void main () if (doneNP_10) { if (!(doneN_12)) { lowp vec4 tmpvar_90; - tmpvar_90 = texture2DLodEXT (_MainTex, posN_21, 0.0); + tmpvar_90 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0); highp vec4 rgba_91; rgba_91 = tmpvar_90; lumaEndN_18 = rgba_91.w; }; if (!(doneP_11)) { lowp vec4 tmpvar_92; - tmpvar_92 = texture2DLodEXT (_MainTex, posP_20, 0.0); + tmpvar_92 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0); highp vec4 rgba_93; rgba_93 = tmpvar_92; lumaEndP_16 = rgba_93.w; @@ -367,14 +376,14 @@ void main () if (doneNP_10) { if (!(doneN_12)) { lowp vec4 tmpvar_94; - tmpvar_94 = texture2DLodEXT (_MainTex, posN_21, 0.0); + tmpvar_94 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0); highp vec4 rgba_95; rgba_95 = tmpvar_94; lumaEndN_18 = rgba_95.w; }; if (!(doneP_11)) { lowp vec4 tmpvar_96; - tmpvar_96 = texture2DLodEXT (_MainTex, posP_20, 0.0); + tmpvar_96 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0); highp vec4 rgba_97; rgba_97 = tmpvar_96; lumaEndP_16 = rgba_97.w; @@ -403,14 +412,14 @@ void main () if (doneNP_10) { if (!(doneN_12)) { lowp vec4 tmpvar_98; - tmpvar_98 = texture2DLodEXT (_MainTex, posN_21, 0.0); + tmpvar_98 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0); highp vec4 rgba_99; rgba_99 = tmpvar_98; lumaEndN_18 = rgba_99.w; }; if (!(doneP_11)) { lowp vec4 tmpvar_100; - tmpvar_100 = texture2DLodEXT (_MainTex, posP_20, 0.0); + tmpvar_100 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0); highp vec4 rgba_101; rgba_101 = tmpvar_100; lumaEndP_16 = rgba_101.w; @@ -439,14 +448,14 @@ void main () if (doneNP_10) { if (!(doneN_12)) { lowp vec4 tmpvar_102; - tmpvar_102 = texture2DLodEXT (_MainTex, posN_21, 0.0); + tmpvar_102 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0); highp vec4 rgba_103; rgba_103 = tmpvar_102; lumaEndN_18 = rgba_103.w; }; if (!(doneP_11)) { lowp vec4 tmpvar_104; - tmpvar_104 = texture2DLodEXT (_MainTex, posP_20, 0.0); + tmpvar_104 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0); highp vec4 rgba_105; rgba_105 = tmpvar_104; lumaEndP_16 = rgba_105.w; @@ -475,14 +484,14 @@ void main () if (doneNP_10) { if (!(doneN_12)) { lowp vec4 tmpvar_106; - tmpvar_106 = texture2DLodEXT (_MainTex, posN_21, 0.0); + tmpvar_106 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0); highp vec4 rgba_107; rgba_107 = tmpvar_106; lumaEndN_18 = rgba_107.w; }; if (!(doneP_11)) { lowp vec4 tmpvar_108; - tmpvar_108 = texture2DLodEXT (_MainTex, posP_20, 0.0); + tmpvar_108 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0); highp vec4 rgba_109; rgba_109 = tmpvar_108; lumaEndP_16 = rgba_109.w; @@ -511,14 +520,14 @@ void main () if (doneNP_10) { if (!(doneN_12)) { lowp vec4 tmpvar_110; - tmpvar_110 = texture2DLodEXT (_MainTex, posN_21, 0.0); + tmpvar_110 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0); highp vec4 rgba_111; rgba_111 = tmpvar_110; lumaEndN_18 = rgba_111.w; }; if (!(doneP_11)) { lowp vec4 tmpvar_112; - tmpvar_112 = texture2DLodEXT (_MainTex, posP_20, 0.0); + tmpvar_112 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0); highp vec4 rgba_113; rgba_113 = tmpvar_112; lumaEndP_16 = rgba_113.w; @@ -547,14 +556,14 @@ void main () if (doneNP_10) { if (!(doneN_12)) { lowp vec4 tmpvar_114; - tmpvar_114 = texture2DLodEXT (_MainTex, posN_21, 0.0); + tmpvar_114 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0); highp vec4 rgba_115; rgba_115 = tmpvar_114; lumaEndN_18 = rgba_115.w; }; if (!(doneP_11)) { lowp vec4 tmpvar_116; - tmpvar_116 = texture2DLodEXT (_MainTex, posP_20, 0.0); + tmpvar_116 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0); highp vec4 rgba_117; rgba_117 = tmpvar_116; lumaEndP_16 = rgba_117.w; @@ -626,7 +635,7 @@ void main () posM_41.y = (xlv_TEXCOORD0.y + (tmpvar_121 * lengthSign_31)); }; lowp vec4 tmpvar_122; - tmpvar_122 = texture2DLodEXT (_MainTex, posM_41, 0.0); + tmpvar_122 = impl_low_texture2DLodEXT (_MainTex, posM_41, 0.0); highp vec4 tmpvar_123; tmpvar_123.xyz = tmpvar_122.xyz; tmpvar_123.w = rgbyM_40.w; diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-inES3.txt index f5cd5e6598a..582c7392de5 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-inES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-inES3.txt @@ -69,7 +69,7 @@ highp float DecodeFloatRGBA( in highp vec4 enc ) { } highp float SampleCubeDistance( in highp vec3 vec ) { highp vec4 packDist; - packDist = textureCube( _ShadowMapTexture, vec); + packDist = texture( _ShadowMapTexture, vec); return DecodeFloatRGBA( packDist); } mediump float unitySampleShadow( in highp vec3 vec, in highp float mydist ) { @@ -111,19 +111,19 @@ mediump vec4 xlat_main( in v2f i ) { highp float fade; i.ray = (i.ray * (_ProjectionParams.z / i.ray.z )); uv = (i.uv.xy / i.uv.w ); - nspec = texture2D( _CameraNormalsTexture, uv); + nspec = texture( _CameraNormalsTexture, uv); normal = ((nspec.xyz * 2.00000) - 1.00000); normal = normalize( normal ); - depth = texture2D( _CameraDepthTexture, uv).x ; + depth = texture( _CameraDepthTexture, uv).x ; depth = Linear01Depth( depth); vpos = vec4( (i.ray * depth), 1.00000); wpos = ( _CameraToWorld * vpos ).xyz ; tolight = (wpos - _LightPos.xyz ); lightDir = ( -normalize( tolight ) ); att = (dot( tolight, tolight) * _LightPos.w ); - atten = texture2D( _LightTextureB0, vec2( vec2( att))).w ; + atten = texture( _LightTextureB0, vec2( vec2( att))).w ; atten *= ComputeShadow( tolight, vpos.z , uv); - atten *= textureCube( _LightTexture0, ( _LightMatrix0 * vec4( wpos, 1.00000) ).xyz ).w ; + atten *= texture( _LightTexture0, ( _LightMatrix0 * vec4( wpos, 1.00000) ).xyz ).w ; diff = max( 0.000000, dot( lightDir, normal)); h = normalize( (lightDir - normalize( (wpos - _WorldSpaceCameraPos) )) ); spec = pow( max( 0.000000, dot( h, normal)), (nspec.w * 128.000)); diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES.txt index 62a4dc74ed8..8a1a837cb52 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES.txt @@ -56,101 +56,99 @@ void main () highp float mydist_19; mydist_19 = (sqrt(dot (tolight_6, tolight_6)) * _LightPositionRange.w); mydist_19 = (mydist_19 * 0.97); - mediump vec4 shadows_20; - highp vec4 shadowVals_21; - highp vec3 vec_22; - vec_22 = (tolight_6 + vec3(0.0078125, 0.0078125, 0.0078125)); - highp vec4 packDist_23; - lowp vec4 tmpvar_24; - tmpvar_24 = textureCube (_ShadowMapTexture, vec_22); - packDist_23 = tmpvar_24; - shadowVals_21.x = dot (packDist_23, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); - highp vec3 vec_25; - vec_25 = (tolight_6 + vec3(-0.0078125, -0.0078125, 0.0078125)); - highp vec4 packDist_26; - lowp vec4 tmpvar_27; - tmpvar_27 = textureCube (_ShadowMapTexture, vec_25); - packDist_26 = tmpvar_27; - shadowVals_21.y = dot (packDist_26, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); - highp vec3 vec_28; - vec_28 = (tolight_6 + vec3(-0.0078125, 0.0078125, -0.0078125)); - highp vec4 packDist_29; - lowp vec4 tmpvar_30; - tmpvar_30 = textureCube (_ShadowMapTexture, vec_28); - packDist_29 = tmpvar_30; - shadowVals_21.z = dot (packDist_29, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); - highp vec3 vec_31; - vec_31 = (tolight_6 + vec3(0.0078125, -0.0078125, -0.0078125)); - highp vec4 packDist_32; - lowp vec4 tmpvar_33; - tmpvar_33 = textureCube (_ShadowMapTexture, vec_31); - packDist_32 = tmpvar_33; - shadowVals_21.w = dot (packDist_32, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); - bvec4 tmpvar_34; - tmpvar_34 = lessThan (shadowVals_21, vec4(mydist_19)); - highp vec4 tmpvar_35; - tmpvar_35 = _LightShadowData.xxxx; + highp vec4 shadowVals_20; + highp vec3 vec_21; + vec_21 = (tolight_6 + vec3(0.0078125, 0.0078125, 0.0078125)); + highp vec4 packDist_22; + lowp vec4 tmpvar_23; + tmpvar_23 = textureCube (_ShadowMapTexture, vec_21); + packDist_22 = tmpvar_23; + shadowVals_20.x = dot (packDist_22, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); + highp vec3 vec_24; + vec_24 = (tolight_6 + vec3(-0.0078125, -0.0078125, 0.0078125)); + highp vec4 packDist_25; + lowp vec4 tmpvar_26; + tmpvar_26 = textureCube (_ShadowMapTexture, vec_24); + packDist_25 = tmpvar_26; + shadowVals_20.y = dot (packDist_25, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); + highp vec3 vec_27; + vec_27 = (tolight_6 + vec3(-0.0078125, 0.0078125, -0.0078125)); + highp vec4 packDist_28; + lowp vec4 tmpvar_29; + tmpvar_29 = textureCube (_ShadowMapTexture, vec_27); + packDist_28 = tmpvar_29; + shadowVals_20.z = dot (packDist_28, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); + highp vec3 vec_30; + vec_30 = (tolight_6 + vec3(0.0078125, -0.0078125, -0.0078125)); + highp vec4 packDist_31; + lowp vec4 tmpvar_32; + tmpvar_32 = textureCube (_ShadowMapTexture, vec_30); + packDist_31 = tmpvar_32; + shadowVals_20.w = dot (packDist_31, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); + bvec4 tmpvar_33; + tmpvar_33 = lessThan (shadowVals_20, vec4(mydist_19)); + highp vec4 tmpvar_34; + tmpvar_34 = _LightShadowData.xxxx; + highp float tmpvar_35; + if (tmpvar_33.x) { + tmpvar_35 = tmpvar_34.x; + } else { + tmpvar_35 = 1.0; + }; highp float tmpvar_36; - if (tmpvar_34.x) { - tmpvar_36 = tmpvar_35.x; + if (tmpvar_33.y) { + tmpvar_36 = tmpvar_34.y; } else { tmpvar_36 = 1.0; }; highp float tmpvar_37; - if (tmpvar_34.y) { - tmpvar_37 = tmpvar_35.y; + if (tmpvar_33.z) { + tmpvar_37 = tmpvar_34.z; } else { tmpvar_37 = 1.0; }; highp float tmpvar_38; - if (tmpvar_34.z) { - tmpvar_38 = tmpvar_35.z; + if (tmpvar_33.w) { + tmpvar_38 = tmpvar_34.w; } else { tmpvar_38 = 1.0; }; - highp float tmpvar_39; - if (tmpvar_34.w) { - tmpvar_39 = tmpvar_35.w; - } else { - tmpvar_39 = 1.0; - }; - highp vec4 tmpvar_40; - tmpvar_40.x = tmpvar_36; - tmpvar_40.y = tmpvar_37; - tmpvar_40.z = tmpvar_38; - tmpvar_40.w = tmpvar_39; - shadows_20 = tmpvar_40; - mediump float tmpvar_41; - tmpvar_41 = dot (shadows_20, vec4(0.25, 0.25, 0.25, 0.25)); - atten_4 = (atten_4 * tmpvar_41); - highp vec4 tmpvar_42; - tmpvar_42.w = 1.0; - tmpvar_42.xyz = wpos_7; - lowp vec4 tmpvar_43; - highp vec3 P_44; - P_44 = (_LightMatrix0 * tmpvar_42).xyz; - tmpvar_43 = textureCube (_LightTexture0, P_44); - atten_4 = (atten_4 * tmpvar_43.w); - highp vec3 tmpvar_45; - tmpvar_45 = normalize((lightDir_5 - normalize( + mediump vec4 tmpvar_39; + tmpvar_39.x = tmpvar_35; + tmpvar_39.y = tmpvar_36; + tmpvar_39.z = tmpvar_37; + tmpvar_39.w = tmpvar_38; + mediump float tmpvar_40; + tmpvar_40 = dot (tmpvar_39, vec4(0.25, 0.25, 0.25, 0.25)); + atten_4 = (atten_4 * tmpvar_40); + highp vec4 tmpvar_41; + tmpvar_41.w = 1.0; + tmpvar_41.xyz = wpos_7; + lowp vec4 tmpvar_42; + highp vec3 P_43; + P_43 = (_LightMatrix0 * tmpvar_41).xyz; + tmpvar_42 = textureCube (_LightTexture0, P_43); + atten_4 = (atten_4 * tmpvar_42.w); + highp vec3 tmpvar_44; + tmpvar_44 = normalize((lightDir_5 - normalize( (wpos_7 - _WorldSpaceCameraPos) ))); - h_3 = tmpvar_45; - mediump float tmpvar_46; - tmpvar_46 = pow (max (0.0, dot (h_3, normal_9)), (nspec_10.w * 128.0)); - spec_2 = tmpvar_46; + h_3 = tmpvar_44; + mediump float tmpvar_45; + tmpvar_45 = pow (max (0.0, dot (h_3, normal_9)), (nspec_10.w * 128.0)); + spec_2 = tmpvar_45; spec_2 = (spec_2 * clamp (atten_4, 0.0, 1.0)); res_1.xyz = (_LightColor.xyz * (max (0.0, dot (lightDir_5, normal_9) ) * atten_4)); - mediump vec3 c_47; - c_47 = _LightColor.xyz; - res_1.w = (spec_2 * dot (c_47, vec3(0.22, 0.707, 0.071))); - highp float tmpvar_48; - tmpvar_48 = clamp ((1.0 - ( + mediump vec3 c_46; + c_46 = _LightColor.xyz; + res_1.w = (spec_2 * dot (c_46, vec3(0.22, 0.707, 0.071))); + highp float tmpvar_47; + tmpvar_47 = clamp ((1.0 - ( (tmpvar_15.z * unity_LightmapFade.z) + unity_LightmapFade.w)), 0.0, 1.0); - res_1 = (res_1 * tmpvar_48); + res_1 = (res_1 * tmpvar_47); gl_FragData[0] = exp2(-(res_1)); } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3.txt index 2efec370870..bf1e2bc6640 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3.txt @@ -58,101 +58,99 @@ void main () highp float mydist_19; mydist_19 = (sqrt(dot (tolight_6, tolight_6)) * _LightPositionRange.w); mydist_19 = (mydist_19 * 0.97); - mediump vec4 shadows_20; - highp vec4 shadowVals_21; - highp vec3 vec_22; - vec_22 = (tolight_6 + vec3(0.0078125, 0.0078125, 0.0078125)); - highp vec4 packDist_23; - lowp vec4 tmpvar_24; - tmpvar_24 = texture (_ShadowMapTexture, vec_22); - packDist_23 = tmpvar_24; - shadowVals_21.x = dot (packDist_23, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); - highp vec3 vec_25; - vec_25 = (tolight_6 + vec3(-0.0078125, -0.0078125, 0.0078125)); - highp vec4 packDist_26; - lowp vec4 tmpvar_27; - tmpvar_27 = texture (_ShadowMapTexture, vec_25); - packDist_26 = tmpvar_27; - shadowVals_21.y = dot (packDist_26, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); - highp vec3 vec_28; - vec_28 = (tolight_6 + vec3(-0.0078125, 0.0078125, -0.0078125)); - highp vec4 packDist_29; - lowp vec4 tmpvar_30; - tmpvar_30 = texture (_ShadowMapTexture, vec_28); - packDist_29 = tmpvar_30; - shadowVals_21.z = dot (packDist_29, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); - highp vec3 vec_31; - vec_31 = (tolight_6 + vec3(0.0078125, -0.0078125, -0.0078125)); - highp vec4 packDist_32; - lowp vec4 tmpvar_33; - tmpvar_33 = texture (_ShadowMapTexture, vec_31); - packDist_32 = tmpvar_33; - shadowVals_21.w = dot (packDist_32, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); - bvec4 tmpvar_34; - tmpvar_34 = lessThan (shadowVals_21, vec4(mydist_19)); - highp vec4 tmpvar_35; - tmpvar_35 = _LightShadowData.xxxx; + highp vec4 shadowVals_20; + highp vec3 vec_21; + vec_21 = (tolight_6 + vec3(0.0078125, 0.0078125, 0.0078125)); + highp vec4 packDist_22; + lowp vec4 tmpvar_23; + tmpvar_23 = texture (_ShadowMapTexture, vec_21); + packDist_22 = tmpvar_23; + shadowVals_20.x = dot (packDist_22, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); + highp vec3 vec_24; + vec_24 = (tolight_6 + vec3(-0.0078125, -0.0078125, 0.0078125)); + highp vec4 packDist_25; + lowp vec4 tmpvar_26; + tmpvar_26 = texture (_ShadowMapTexture, vec_24); + packDist_25 = tmpvar_26; + shadowVals_20.y = dot (packDist_25, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); + highp vec3 vec_27; + vec_27 = (tolight_6 + vec3(-0.0078125, 0.0078125, -0.0078125)); + highp vec4 packDist_28; + lowp vec4 tmpvar_29; + tmpvar_29 = texture (_ShadowMapTexture, vec_27); + packDist_28 = tmpvar_29; + shadowVals_20.z = dot (packDist_28, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); + highp vec3 vec_30; + vec_30 = (tolight_6 + vec3(0.0078125, -0.0078125, -0.0078125)); + highp vec4 packDist_31; + lowp vec4 tmpvar_32; + tmpvar_32 = texture (_ShadowMapTexture, vec_30); + packDist_31 = tmpvar_32; + shadowVals_20.w = dot (packDist_31, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); + bvec4 tmpvar_33; + tmpvar_33 = lessThan (shadowVals_20, vec4(mydist_19)); + highp vec4 tmpvar_34; + tmpvar_34 = _LightShadowData.xxxx; + highp float tmpvar_35; + if (tmpvar_33.x) { + tmpvar_35 = tmpvar_34.x; + } else { + tmpvar_35 = 1.0; + }; highp float tmpvar_36; - if (tmpvar_34.x) { - tmpvar_36 = tmpvar_35.x; + if (tmpvar_33.y) { + tmpvar_36 = tmpvar_34.y; } else { tmpvar_36 = 1.0; }; highp float tmpvar_37; - if (tmpvar_34.y) { - tmpvar_37 = tmpvar_35.y; + if (tmpvar_33.z) { + tmpvar_37 = tmpvar_34.z; } else { tmpvar_37 = 1.0; }; highp float tmpvar_38; - if (tmpvar_34.z) { - tmpvar_38 = tmpvar_35.z; + if (tmpvar_33.w) { + tmpvar_38 = tmpvar_34.w; } else { tmpvar_38 = 1.0; }; - highp float tmpvar_39; - if (tmpvar_34.w) { - tmpvar_39 = tmpvar_35.w; - } else { - tmpvar_39 = 1.0; - }; - highp vec4 tmpvar_40; - tmpvar_40.x = tmpvar_36; - tmpvar_40.y = tmpvar_37; - tmpvar_40.z = tmpvar_38; - tmpvar_40.w = tmpvar_39; - shadows_20 = tmpvar_40; - mediump float tmpvar_41; - tmpvar_41 = dot (shadows_20, vec4(0.25, 0.25, 0.25, 0.25)); - atten_4 = (atten_4 * tmpvar_41); - highp vec4 tmpvar_42; - tmpvar_42.w = 1.0; - tmpvar_42.xyz = wpos_7; - lowp vec4 tmpvar_43; - highp vec3 P_44; - P_44 = (_LightMatrix0 * tmpvar_42).xyz; - tmpvar_43 = texture (_LightTexture0, P_44); - atten_4 = (atten_4 * tmpvar_43.w); - highp vec3 tmpvar_45; - tmpvar_45 = normalize((lightDir_5 - normalize( + mediump vec4 tmpvar_39; + tmpvar_39.x = tmpvar_35; + tmpvar_39.y = tmpvar_36; + tmpvar_39.z = tmpvar_37; + tmpvar_39.w = tmpvar_38; + mediump float tmpvar_40; + tmpvar_40 = dot (tmpvar_39, vec4(0.25, 0.25, 0.25, 0.25)); + atten_4 = (atten_4 * tmpvar_40); + highp vec4 tmpvar_41; + tmpvar_41.w = 1.0; + tmpvar_41.xyz = wpos_7; + lowp vec4 tmpvar_42; + highp vec3 P_43; + P_43 = (_LightMatrix0 * tmpvar_41).xyz; + tmpvar_42 = texture (_LightTexture0, P_43); + atten_4 = (atten_4 * tmpvar_42.w); + highp vec3 tmpvar_44; + tmpvar_44 = normalize((lightDir_5 - normalize( (wpos_7 - _WorldSpaceCameraPos) ))); - h_3 = tmpvar_45; - mediump float tmpvar_46; - tmpvar_46 = pow (max (0.0, dot (h_3, normal_9)), (nspec_10.w * 128.0)); - spec_2 = tmpvar_46; + h_3 = tmpvar_44; + mediump float tmpvar_45; + tmpvar_45 = pow (max (0.0, dot (h_3, normal_9)), (nspec_10.w * 128.0)); + spec_2 = tmpvar_45; spec_2 = (spec_2 * clamp (atten_4, 0.0, 1.0)); res_1.xyz = (_LightColor.xyz * (max (0.0, dot (lightDir_5, normal_9) ) * atten_4)); - mediump vec3 c_47; - c_47 = _LightColor.xyz; - res_1.w = (spec_2 * dot (c_47, vec3(0.22, 0.707, 0.071))); - highp float tmpvar_48; - tmpvar_48 = clamp ((1.0 - ( + mediump vec3 c_46; + c_46 = _LightColor.xyz; + res_1.w = (spec_2 * dot (c_46, vec3(0.22, 0.707, 0.071))); + highp float tmpvar_47; + tmpvar_47 = clamp ((1.0 - ( (tmpvar_15.z * unity_LightmapFade.z) + unity_LightmapFade.w)), 0.0, 1.0); - res_1 = (res_1 * tmpvar_48); + res_1 = (res_1 * tmpvar_47); _fragData = exp2(-(res_1)); } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3Metal.txt index 3617f59d4d1..1e43ec7a3f2 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3Metal.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3Metal.txt @@ -66,101 +66,99 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]] float mydist_19; mydist_19 = (sqrt(dot (tolight_6, tolight_6)) * _mtl_u._LightPositionRange.w); mydist_19 = (mydist_19 * 0.97); - half4 shadows_20; - float4 shadowVals_21; - float3 vec_22; - vec_22 = (tolight_6 + float3(0.0078125, 0.0078125, 0.0078125)); - float4 packDist_23; - half4 tmpvar_24; - tmpvar_24 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float3)(vec_22)); - packDist_23 = float4(tmpvar_24); - shadowVals_21.x = dot (packDist_23, float4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); - float3 vec_25; - vec_25 = (tolight_6 + float3(-0.0078125, -0.0078125, 0.0078125)); - float4 packDist_26; - half4 tmpvar_27; - tmpvar_27 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float3)(vec_25)); - packDist_26 = float4(tmpvar_27); - shadowVals_21.y = dot (packDist_26, float4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); - float3 vec_28; - vec_28 = (tolight_6 + float3(-0.0078125, 0.0078125, -0.0078125)); - float4 packDist_29; - half4 tmpvar_30; - tmpvar_30 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float3)(vec_28)); - packDist_29 = float4(tmpvar_30); - shadowVals_21.z = dot (packDist_29, float4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); - float3 vec_31; - vec_31 = (tolight_6 + float3(0.0078125, -0.0078125, -0.0078125)); - float4 packDist_32; - half4 tmpvar_33; - tmpvar_33 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float3)(vec_31)); - packDist_32 = float4(tmpvar_33); - shadowVals_21.w = dot (packDist_32, float4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); - bool4 tmpvar_34; - tmpvar_34 = bool4((shadowVals_21 < float4(mydist_19))); - float4 tmpvar_35; - tmpvar_35 = _mtl_u._LightShadowData.xxxx; + float4 shadowVals_20; + float3 vec_21; + vec_21 = (tolight_6 + float3(0.0078125, 0.0078125, 0.0078125)); + float4 packDist_22; + half4 tmpvar_23; + tmpvar_23 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float3)(vec_21)); + packDist_22 = float4(tmpvar_23); + shadowVals_20.x = dot (packDist_22, float4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); + float3 vec_24; + vec_24 = (tolight_6 + float3(-0.0078125, -0.0078125, 0.0078125)); + float4 packDist_25; + half4 tmpvar_26; + tmpvar_26 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float3)(vec_24)); + packDist_25 = float4(tmpvar_26); + shadowVals_20.y = dot (packDist_25, float4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); + float3 vec_27; + vec_27 = (tolight_6 + float3(-0.0078125, 0.0078125, -0.0078125)); + float4 packDist_28; + half4 tmpvar_29; + tmpvar_29 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float3)(vec_27)); + packDist_28 = float4(tmpvar_29); + shadowVals_20.z = dot (packDist_28, float4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); + float3 vec_30; + vec_30 = (tolight_6 + float3(0.0078125, -0.0078125, -0.0078125)); + float4 packDist_31; + half4 tmpvar_32; + tmpvar_32 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float3)(vec_30)); + packDist_31 = float4(tmpvar_32); + shadowVals_20.w = dot (packDist_31, float4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); + bool4 tmpvar_33; + tmpvar_33 = bool4((shadowVals_20 < float4(mydist_19))); + float4 tmpvar_34; + tmpvar_34 = _mtl_u._LightShadowData.xxxx; + float tmpvar_35; + if (tmpvar_33.x) { + tmpvar_35 = tmpvar_34.x; + } else { + tmpvar_35 = 1.0; + }; float tmpvar_36; - if (tmpvar_34.x) { - tmpvar_36 = tmpvar_35.x; + if (tmpvar_33.y) { + tmpvar_36 = tmpvar_34.y; } else { tmpvar_36 = 1.0; }; float tmpvar_37; - if (tmpvar_34.y) { - tmpvar_37 = tmpvar_35.y; + if (tmpvar_33.z) { + tmpvar_37 = tmpvar_34.z; } else { tmpvar_37 = 1.0; }; float tmpvar_38; - if (tmpvar_34.z) { - tmpvar_38 = tmpvar_35.z; + if (tmpvar_33.w) { + tmpvar_38 = tmpvar_34.w; } else { tmpvar_38 = 1.0; }; - float tmpvar_39; - if (tmpvar_34.w) { - tmpvar_39 = tmpvar_35.w; - } else { - tmpvar_39 = 1.0; - }; - float4 tmpvar_40; - tmpvar_40.x = tmpvar_36; - tmpvar_40.y = tmpvar_37; - tmpvar_40.z = tmpvar_38; - tmpvar_40.w = tmpvar_39; - shadows_20 = half4(tmpvar_40); - half tmpvar_41; - tmpvar_41 = dot (shadows_20, (half4)float4(0.25, 0.25, 0.25, 0.25)); - atten_4 = (atten_4 * (float)tmpvar_41); - float4 tmpvar_42; - tmpvar_42.w = 1.0; - tmpvar_42.xyz = wpos_7; - half4 tmpvar_43; - float3 P_44; - P_44 = (_mtl_u._LightMatrix0 * tmpvar_42).xyz; - tmpvar_43 = _LightTexture0.sample(_mtlsmp__LightTexture0, (float3)(P_44)); - atten_4 = (atten_4 * (float)tmpvar_43.w); - float3 tmpvar_45; - tmpvar_45 = normalize(((float3)lightDir_5 - normalize( + half4 tmpvar_39; + tmpvar_39.x = half(tmpvar_35); + tmpvar_39.y = half(tmpvar_36); + tmpvar_39.z = half(tmpvar_37); + tmpvar_39.w = half(tmpvar_38); + half tmpvar_40; + tmpvar_40 = dot (tmpvar_39, (half4)float4(0.25, 0.25, 0.25, 0.25)); + atten_4 = (atten_4 * (float)tmpvar_40); + float4 tmpvar_41; + tmpvar_41.w = 1.0; + tmpvar_41.xyz = wpos_7; + half4 tmpvar_42; + float3 P_43; + P_43 = (_mtl_u._LightMatrix0 * tmpvar_41).xyz; + tmpvar_42 = _LightTexture0.sample(_mtlsmp__LightTexture0, (float3)(P_43)); + atten_4 = (atten_4 * (float)tmpvar_42.w); + float3 tmpvar_44; + tmpvar_44 = normalize(((float3)lightDir_5 - normalize( (wpos_7 - _mtl_u._WorldSpaceCameraPos) ))); - h_3 = half3(tmpvar_45); - half tmpvar_46; - tmpvar_46 = pow (max ((half)0.0, dot (h_3, normal_9)), (nspec_10.w * (half)128.0)); - spec_2 = float(tmpvar_46); + h_3 = half3(tmpvar_44); + half tmpvar_45; + tmpvar_45 = pow (max ((half)0.0, dot (h_3, normal_9)), (nspec_10.w * (half)128.0)); + spec_2 = float(tmpvar_45); spec_2 = (spec_2 * clamp (atten_4, 0.0, 1.0)); res_1.xyz = half3((_mtl_u._LightColor.xyz * ((float)max ((half)0.0, dot (lightDir_5, normal_9) ) * atten_4))); - half3 c_47; - c_47 = half3(_mtl_u._LightColor.xyz); - res_1.w = half((spec_2 * (float)dot (c_47, (half3)float3(0.22, 0.707, 0.071)))); - float tmpvar_48; - tmpvar_48 = clamp ((1.0 - ( + half3 c_46; + c_46 = half3(_mtl_u._LightColor.xyz); + res_1.w = half((spec_2 * (float)dot (c_46, (half3)float3(0.22, 0.707, 0.071)))); + float tmpvar_47; + tmpvar_47 = clamp ((1.0 - ( (tmpvar_15.z * _mtl_u.unity_LightmapFade.z) + _mtl_u.unity_LightmapFade.w)), 0.0, 1.0); - res_1 = ((half4)((float4)res_1 * tmpvar_48)); + res_1 = ((half4)((float4)res_1 * tmpvar_47)); _mtl_o._fragData = exp2(-(res_1)); return _mtl_o; } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-inES3.txt index 1d4e0e6a8b4..e7a79e38202 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-inES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-inES3.txt @@ -35,13 +35,13 @@ lowp vec4 xlat_main( in v2f i ) { mediump float nh; mediump float spec; lowp vec4 c; - col = texture2D( _MainTex, i.uv); + col = texture( _MainTex, i.uv); xll_clip((col.w - _Cutoff)); #line 35 albedo = (col.xyz * i.color); - specular = (texture2D( _BumpSpecMap, i.uv).x * 128.000); + specular = (texture( _BumpSpecMap, i.uv).x * 128.000); #line 39 - trngls = texture2D( _TranslucencyMap, i.uv); + trngls = texture( _TranslucencyMap, i.uv); gloss = trngls.w; light = (vec3( UNITY_LIGHTMODEL_AMBIENT) * albedo); #line 44 diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-inES3.txt index 11741cf3be1..cc61bae0e57 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-inES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-inES3.txt @@ -85,12 +85,12 @@ uniform float _SelfIllumScale; uniform sampler2D _SelfIllum; vec3 Albedo( in vec4 texcoords ) { - vec3 albedo = (_Color.xyz * texture2D( _MainTex, texcoords.xy).xyz); - albedo *= (2.0 * texture2D( _DetailAlbedoMap, texcoords.zw).xyz); + vec3 albedo = (_Color.xyz * texture( _MainTex, texcoords.xy).xyz); + albedo *= (2.0 * texture( _DetailAlbedoMap, texcoords.zw).xyz); return albedo; } float Alpha( in vec2 uv ) { - return (texture2D( _AlphaMap, uv).w * _Color.w); + return (texture( _AlphaMap, uv).w * _Color.w); } float BlinnPhongTerm( in float roughness, in float NdotH ) { float m = (pow( roughness, 4.0) + 1e-05); @@ -177,10 +177,10 @@ vec3 EnvMap( in vec4 worldNormal ) { return fromRGBM( envTexel); } float Occlusion( in vec2 uv ) { - return texture2D( _Occlusion, uv).x; + return texture( _Occlusion, uv).x; } vec4 SpecularGloss( in vec2 uv ) { - vec4 specGloss = texture2D( _SpecGlossMap, uv); + vec4 specGloss = texture( _SpecGlossMap, uv); return vec4( specGloss.xyz, specGloss.w); } vec3 BlendNormals( in vec3 n1, in vec3 n2 ) { @@ -194,8 +194,8 @@ vec3 UnpackScaleNormal( in vec4 packednormal, in float bumpScale ) { return normal; } vec3 TangentNormal( in vec4 texcoords ) { - vec3 normalTangent = UnpackScaleNormal( texture2D( _BumpMap, texcoords.xy), _BumpScale); - vec3 detailNormalTangent = UnpackScaleNormal( texture2D( _DetailNormalMap, texcoords.zw), _DetailNormalMapScale); + vec3 normalTangent = UnpackScaleNormal( texture( _BumpMap, texcoords.xy), _BumpScale); + vec3 detailNormalTangent = UnpackScaleNormal( texture( _DetailNormalMap, texcoords.zw), _DetailNormalMapScale); normalTangent = BlendNormals( normalTangent, detailNormalTangent); return normalTangent; } @@ -204,7 +204,7 @@ mat3 TangentToWorld( in vec3 normal, in vec3 tangent, in vec3 flip ) { return xll_transpose_mf3x3(mat3( tangent, binormal, normal)); } float unitySampleShadow( in vec4 shadowCoord ) { - float shadow = texture2DProj( _ShadowMapTexture, shadowCoord).x; + float shadow = textureProj( _ShadowMapTexture, shadowCoord).x; return shadow; } vec4 frag( in VertexOutput i ) { @@ -224,15 +224,15 @@ vec4 frag( in VertexOutput i ) { vec3 lightDir = _WorldSpaceLightPos0.xyz; float subsurface = 1.0; vec3 ambient = vec3( 0.0); - vec4 lmtex = texture2D( unity_Lightmap, i.extra.xy); - vec4 lmIndTex = texture2D( unity_LightmapInd, i.extra.xy); + vec4 lmtex = texture( unity_Lightmap, i.extra.xy); + vec4 lmIndTex = texture( unity_LightmapInd, i.extra.xy); vec3 lightDirTangent; DecodeDirLightmap( normalTangent, lmtex, lmIndTex, lightColor, lightDirTangent); lightDir = (lightDirTangent * tanToWorld); lightDir = normalize(lightDir); vec3 baseColor = EnergyCalculator( specColor, specular, Albedo( i.tex)); vec3 color = BRDF_Disney_PBS( baseColor, (atten * lightColor), specColor, specular, roughness, normalWorld, lightDir, (-eyeVec), ambient, env); - color += (texture2D( _SelfIllum, i.tex.xy).xyz * _SelfIllumScale); + color += (texture( _SelfIllum, i.tex.xy).xyz * _SelfIllumScale); float alpha = Alpha( i.tex.xy); return vec4( color, alpha); } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3.txt index 2268ad0a8c9..2912d07e6b3 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3.txt @@ -33,9 +33,9 @@ void main () tmpvar_3 = xlv_TEXCOORD3.xyz; tmpvar_4 = (((xlv_TEXCOORD2.yzx * xlv_TEXCOORD3.zxy) - (xlv_TEXCOORD2.zxy * xlv_TEXCOORD3.yzx)) * xlv_TEXCOORD3.www); highp mat3 tmpvar_5; - tmpvar_5[0u].x = tmpvar_3.x; - tmpvar_5[0u].y = tmpvar_4.x; - tmpvar_5[0u].z = xlv_TEXCOORD2.x; + tmpvar_5[uint(0)].x = tmpvar_3.x; + tmpvar_5[uint(0)].y = tmpvar_4.x; + tmpvar_5[uint(0)].z = xlv_TEXCOORD2.x; tmpvar_5[1u].x = tmpvar_3.y; tmpvar_5[1u].y = tmpvar_4.y; tmpvar_5[1u].z = xlv_TEXCOORD2.y; @@ -89,9 +89,9 @@ void main () lowp vec4 tmpvar_20; tmpvar_20 = texture (unity_LightmapInd, xlv_TEXCOORD4.xy); highp mat3 tmpvar_21; - tmpvar_21[0u].x = 0.816497; - tmpvar_21[0u].y = -0.408248; - tmpvar_21[0u].z = -0.408248; + tmpvar_21[uint(0)].x = 0.816497; + tmpvar_21[uint(0)].y = -0.408248; + tmpvar_21[uint(0)].z = -0.408248; tmpvar_21[1u].x = 0.0; tmpvar_21[1u].y = 0.707107; tmpvar_21[1u].z = -0.707107; @@ -171,7 +171,9 @@ void main () (((1.0 - dot (tmpvar_12.xyz, vec3(0.299, 0.587, 0.114))) * (1.0 - tmpvar_14)) * pow (abs((1.0 - tmpvar_32)), 5.0)) * env_2)) + (texture (_SelfIllum, xlv_TEXCOORD0.xy).xyz * _SelfIllumScale)); tmpvar_38.w = (texture (_AlphaMap, xlv_TEXCOORD0.xy).w * _Color.w); - _fragData = tmpvar_38; + mediump vec4 tmpvar_39; + tmpvar_39 = tmpvar_38; + _fragData = tmpvar_39; } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3Metal.txt index c9268c7b10d..86355a1c017 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3Metal.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3Metal.txt @@ -149,7 +149,7 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]] half VdotH_34; VdotH_34 = (tmpvar_33 + (half)1e-05); half tmpvar_35; - tmpvar_35 = ((1.0/(( + tmpvar_35 = (((half)1.0/(( pow (tmpvar_14, (half)4.0) + (half)1e-05))) - (half)2.0); half tmpvar_36; @@ -179,7 +179,9 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]] ((((half)1.0 - dot (tmpvar_12.xyz, (half3)float3(0.299, 0.587, 0.114))) * ((half)1.0 - tmpvar_14)) * pow (abs(((half)1.0 - tmpvar_32)), (half)5.0)) * env_2)) + ((half3)((float3)_SelfIllum.sample(_mtlsmp__SelfIllum, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).xyz * _mtl_u._SelfIllumScale))); tmpvar_38.w = ((half)((float)_AlphaMap.sample(_mtlsmp__AlphaMap, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).w * _mtl_u._Color.w)); - _mtl_o._fragData = tmpvar_38; + half4 tmpvar_39; + tmpvar_39 = tmpvar_38; + _mtl_o._fragData = tmpvar_39; return _mtl_o; } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-inES3.txt index 58c99f661cd..732844f0e61 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-inES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-inES3.txt @@ -32,12 +32,12 @@ lowp vec3 UnpackNormal( in lowp vec4 packednormal ) { } void surf( in Input IN, inout SurfaceOutput o ) { lowp vec4 tex; - tex = texture2D( _MainTex, IN.uv_MainTex); + tex = texture( _MainTex, IN.uv_MainTex); o.Albedo = tex.xyz ; o.Gloss = tex.w ; o.Alpha = tex.w ; o.Specular = _Shininess; - o.Normal = UnpackNormal( texture2D( _BumpMap, IN.uv_MainTex)); + o.Normal = UnpackNormal( texture( _BumpMap, IN.uv_MainTex)); } lowp vec4 LightingMobileBlinnPhong( in SurfaceOutput s, in lowp vec3 lightDir, in lowp vec3 halfDir, in lowp float atten ) { lowp float diff; diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3.txt index a7b70f6737e..34fdad70dfe 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3.txt @@ -32,7 +32,7 @@ void main () depth_6 = (dot (tmpvar_10.zw, vec2(1.0, 0.00392157)) * _ProjectionParams.z); scale_5 = (_Params.x / depth_6); occ_4 = 0.0; - for (int s_3 = 0; s_3 < 8; s_3++) { + for (highp int s_3 = 0; s_3 < 8; s_3++) { mediump vec3 randomDir_14; highp vec3 tmpvar_15; highp vec3 I_16; @@ -43,7 +43,7 @@ void main () randomDir_14 = tmpvar_15; highp float tmpvar_17; tmpvar_17 = dot (viewNorm_7, randomDir_14); - highp float tmpvar_18; + mediump float tmpvar_18; if ((tmpvar_17 < 0.0)) { tmpvar_18 = 1.0; } else { diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3Metal.txt index e4b5aacfc56..d31961e7107 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3Metal.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3Metal.txt @@ -52,13 +52,13 @@ fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]] randomDir_14 = half3(tmpvar_15); float tmpvar_17; tmpvar_17 = dot (viewNorm_7, (float3)randomDir_14); - float tmpvar_18; + half tmpvar_18; if ((tmpvar_17 < 0.0)) { - tmpvar_18 = 1.0; + tmpvar_18 = half(1.0); } else { - tmpvar_18 = -1.0; + tmpvar_18 = half(-1.0); }; - randomDir_14 = (randomDir_14 * ((half)-(tmpvar_18))); + randomDir_14 = (randomDir_14 * -(tmpvar_18)); randomDir_14 = half3(((float3)randomDir_14 + (viewNorm_7 * 0.3))); float4 tmpvar_19; tmpvar_19 = float4(_CameraDepthNormalsTexture.sample(_mtlsmp__CameraDepthNormalsTexture, (float2)((tmpvar_2 + ((float2)randomDir_14.xy * scale_5))))); diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO8-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO8-outES.txt index 8f2a999d431..431cd9498eb 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO8-outES.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO8-outES.txt @@ -43,7 +43,7 @@ void main () depth_8 = (dot (depthnormal_10.zw, vec2(1.0, 0.00392157)) * _ProjectionParams.z); scale_7 = (_Params.x / depth_8); occ_6 = 0.0; - for (int s_5 = 0; s_5 < 8; s_5++) { + for (highp int s_5 = 0; s_5 < 8; s_5++) { highp vec4 sampleND_17; mediump vec3 randomDir_18; highp vec3 tmpvar_19; @@ -55,7 +55,7 @@ void main () randomDir_18 = tmpvar_19; highp float tmpvar_21; tmpvar_21 = dot (viewNorm_9, randomDir_18); - highp float tmpvar_22; + mediump float tmpvar_22; if ((tmpvar_21 < 0.0)) { tmpvar_22 = 1.0; } else { diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-inES.txt new file mode 100644 index 00000000000..5cebed77251 --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-inES.txt @@ -0,0 +1,31 @@ +uniform highp float uni1; +uniform mediump vec4 uni4; +uniform sampler2D tex1; + +// global variables that aren't uniforms +highp float mut_uni1; +mediump vec4 mut_uni4; + +highp vec3 SampleDiffuse(in highp vec2 uv) +{ + mut_uni4.xy = uv; + return vec3(texture2D(tex1,mut_uni4.xy)); +} +lowp vec4 xlat_main(in highp vec4 uv) +{ + lowp vec4 c = vec4(0.0); + c.x += mut_uni4.x; + c.xyz += SampleDiffuse(uv.xy); + c.z += mut_uni1; + mut_uni1 += 2.0; + c.w += mut_uni1; + return c; +} +varying highp vec4 var_uv; +void main() +{ + mut_uni1 = uni1; + mut_uni4 = uni4; + lowp vec4 r = xlat_main(var_uv); + gl_FragData[0] = r; +} diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-inES3.txt new file mode 100644 index 00000000000..781c8087abf --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-inES3.txt @@ -0,0 +1,68 @@ +#version 300 es + +uniform highp float uni1; +uniform mediump vec4 uni4; +uniform sampler2D tex1; +uniform lowp vec4 unity_ColorSpaceDouble; +uniform mediump vec3 _SkyTint; +uniform mediump float _AtmosphereThickness; + + +// global variables that aren't uniforms +highp float mut_uni1; +mediump vec4 mut_uni4; +// global variables that are modified in complex chains of assignments/branches +highp vec3 kSkyTintInGammaSpace; +highp float kKrESun; +highp float kKr4PI; + + +highp vec3 SampleDiffuse(in highp vec2 uv) +{ + mut_uni4.xy = uv; + return vec3(texture(tex1, mut_uni4.xy)); +} +lowp vec4 xlat_main(in highp vec4 uv) +{ + lowp vec4 c = vec4(0.0); + c.x += mut_uni4.x; + c.xyz += SampleDiffuse(uv.xy); + c.z += mut_uni1; + mut_uni1 += 2.0; + c.w += mut_uni1; + + mediump vec3 tmpvar_1; + if ((unity_ColorSpaceDouble.x > 2.0)) { + tmpvar_1 = pow (_SkyTint, vec3(0.454545, 0.454545, 0.454545)); + } else { + tmpvar_1 = _SkyTint; + }; + kSkyTintInGammaSpace = tmpvar_1; + highp vec3 tmpvar_2; + tmpvar_2 = (1.0/(pow (mix (vec3(0.5, 0.42, 0.325), vec3(0.8, 0.72, 0.625), + (vec3(1.0, 1.0, 1.0) - kSkyTintInGammaSpace) + ), vec3(4.0, 4.0, 4.0)))); + mediump float tmpvar_3; + mediump float cse_4; + cse_4 = pow (_AtmosphereThickness, 2.5); + tmpvar_3 = (mix (0.0, 0.0025, cse_4) * 20.0); + kKrESun = tmpvar_3; + mediump float tmpvar_5; + tmpvar_5 = (12.5664 * mix (0.0, 0.0025, cse_4)); + kKr4PI = tmpvar_5; + + if (uv.x > 0.5) + { + c.x += pow(kKrESun, kKr4PI); + } + return c; +} +in highp vec4 var_uv; +out mediump vec4 out_data; +void main() +{ + mut_uni1 = uni1; + mut_uni4 = uni4; + lowp vec4 r = xlat_main(var_uv); + out_data = r; +} diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES.txt new file mode 100644 index 00000000000..b9f081a3644 --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES.txt @@ -0,0 +1,35 @@ +uniform highp float uni1; +uniform mediump vec4 uni4; +uniform sampler2D tex1; +highp float mut_uni1; +mediump vec4 mut_uni4; +varying highp vec4 var_uv; +void main () +{ + mut_uni4.zw = uni4.zw; + lowp vec4 c_1; + c_1.yzw = vec3(0.0, 0.0, 0.0); + c_1.x = uni4.x; + highp vec3 tmpvar_2; + highp vec2 uv_3; + uv_3 = var_uv.xy; + mut_uni4.xy = uv_3; + lowp vec3 tmpvar_4; + tmpvar_4 = texture2D (tex1, mut_uni4.xy).xyz; + tmpvar_2 = tmpvar_4; + c_1.xyz = (c_1.xyz + tmpvar_2); + c_1.z = (c_1.z + uni1); + mut_uni1 = (uni1 + 2.0); + c_1.w = mut_uni1; + gl_FragData[0] = c_1; +} + + +// stats: 4 alu 1 tex 0 flow +// inputs: 1 +// #0: var_uv (high float) 4x1 [-1] +// uniforms: 2 (total size: 0) +// #0: uni1 (high float) 1x1 [-1] +// #1: uni4 (medium float) 4x1 [-1] +// textures: 1 +// #0: tex1 (low 2d) 0x0 [-1] diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES3.txt new file mode 100644 index 00000000000..8f6e58b3865 --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES3.txt @@ -0,0 +1,54 @@ +#version 300 es +uniform highp float uni1; +uniform mediump vec4 uni4; +uniform sampler2D tex1; +uniform mediump float _AtmosphereThickness; +highp float mut_uni1; +mediump vec4 mut_uni4; +highp float kKrESun; +highp float kKr4PI; +in highp vec4 var_uv; +out mediump vec4 out_data; +void main () +{ + mut_uni4.zw = uni4.zw; + mediump float tmpvar_5_1; + mediump float tmpvar_3_2; + lowp vec4 c_3; + c_3.yzw = vec3(0.0, 0.0, 0.0); + c_3.x = uni4.x; + highp vec3 tmpvar_4; + highp vec2 uv_5; + uv_5 = var_uv.xy; + mut_uni4.xy = uv_5; + lowp vec3 tmpvar_6; + tmpvar_6 = texture (tex1, mut_uni4.xy).xyz; + tmpvar_4 = tmpvar_6; + c_3.xyz = (c_3.xyz + tmpvar_4); + c_3.z = (c_3.z + uni1); + mut_uni1 = (uni1 + 2.0); + c_3.w = mut_uni1; + mediump float tmpvar_7; + tmpvar_7 = pow (_AtmosphereThickness, 2.5); + tmpvar_3_2 = (0.05 * tmpvar_7); + kKrESun = tmpvar_3_2; + tmpvar_5_1 = (tmpvar_7 * 0.031416); + kKr4PI = tmpvar_5_1; + if ((var_uv.x > 0.5)) { + highp float tmpvar_8; + tmpvar_8 = pow (kKrESun, kKr4PI); + c_3.x = (c_3.x + tmpvar_8); + }; + out_data = c_3; +} + + +// stats: 10 alu 1 tex 1 flow +// inputs: 1 +// #0: var_uv (high float) 4x1 [-1] +// uniforms: 3 (total size: 0) +// #0: uni1 (high float) 1x1 [-1] +// #1: uni4 (medium float) 4x1 [-1] +// #2: _AtmosphereThickness (medium float) 1x1 [-1] +// textures: 1 +// #0: tex1 (low 2d) 0x0 [-1] diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES3Metal.txt new file mode 100644 index 00000000000..71a1a1a4a0a --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES3Metal.txt @@ -0,0 +1,63 @@ +#include <metal_stdlib> +using namespace metal; +struct xlatMtlShaderInput { + float4 var_uv; +}; +struct xlatMtlShaderOutput { + half4 out_data [[color(0)]]; +}; +struct xlatMtlShaderUniform { + float uni1; + half4 uni4; + half _AtmosphereThickness; +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , texture2d<half> tex1 [[texture(0)]], sampler _mtlsmp_tex1 [[sampler(0)]]) +{ + xlatMtlShaderOutput _mtl_o; +float mut_uni1_1; +half4 mut_uni4_2; +float kKrESun_3; +float kKr4PI_4; + mut_uni4_2.zw = _mtl_u.uni4.zw; + half tmpvar_5_5; + half tmpvar_3_6; + half4 c_7; + c_7.yzw = half3(float3(0.0, 0.0, 0.0)); + c_7.x = _mtl_u.uni4.x; + float3 tmpvar_8; + float2 uv_9; + uv_9 = _mtl_i.var_uv.xy; + mut_uni4_2.xy = half2(uv_9); + half3 tmpvar_10; + tmpvar_10 = tex1.sample(_mtlsmp_tex1, (float2)(mut_uni4_2.xy)).xyz; + tmpvar_8 = float3(tmpvar_10); + c_7.xyz = half3(((float3)c_7.xyz + tmpvar_8)); + c_7.z = half(((float)c_7.z + _mtl_u.uni1)); + mut_uni1_1 = (_mtl_u.uni1 + 2.0); + c_7.w = half(mut_uni1_1); + half tmpvar_11; + tmpvar_11 = pow (_mtl_u._AtmosphereThickness, (half)2.5); + tmpvar_3_6 = ((half)0.05 * tmpvar_11); + kKrESun_3 = float(tmpvar_3_6); + tmpvar_5_5 = (tmpvar_11 * (half)0.031416); + kKr4PI_4 = float(tmpvar_5_5); + if ((_mtl_i.var_uv.x > 0.5)) { + float tmpvar_12; + tmpvar_12 = pow (kKrESun_3, kKr4PI_4); + c_7.x = half(((float)c_7.x + tmpvar_12)); + }; + _mtl_o.out_data = c_7; + return _mtl_o; +} + + +// stats: 10 alu 1 tex 1 flow +// inputs: 1 +// #0: var_uv (high float) 4x1 [-1] +// uniforms: 3 (total size: 18) +// #0: uni1 (high float) 1x1 [-1] loc 0 +// #1: uni4 (medium float) 4x1 [-1] loc 8 +// #2: _AtmosphereThickness (medium float) 1x1 [-1] loc 16 +// textures: 1 +// #0: tex1 (low 2d) 0x0 [-1] loc 0 diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp index 7d25969243e..fe23cd4dc43 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp @@ -256,8 +256,11 @@ static bool CheckGLSL (bool vertex, bool gles, const std::string& testName, cons src += "#define gl_LastFragData _glesLastFragData\n"; src += "varying lowp vec4 _glesLastFragData[4];\n"; } - src += "float shadow2DEXT (sampler2DShadow s, vec3 p) { return shadow2D(s,p).r; }\n"; - src += "float shadow2DProjEXT (sampler2DShadow s, vec4 p) { return shadow2DProj(s,p).r; }\n"; + if (!need3) + { + src += "float shadow2DEXT (sampler2DShadow s, vec3 p) { return shadow2D(s,p).r; }\n"; + src += "float shadow2DProjEXT (sampler2DShadow s, vec4 p) { return shadow2DProj(s,p).r; }\n"; + } } src += source; if (gles) @@ -274,8 +277,11 @@ static bool CheckGLSL (bool vertex, bool gles, const std::string& testName, cons replace_string (src, "precision ", "// precision ", 0); replace_string (src, "#version 300 es", "", 0); } - replace_string (src, "#extension GL_EXT_shader_framebuffer_fetch : require", "", 0); - replace_string (src, "#extension GL_EXT_shader_framebuffer_fetch : enable", "", 0); + + // can't check FB fetch on PC + if (src.find("#extension GL_EXT_shader_framebuffer_fetch") != std::string::npos) + return true; + if (gles && need3) { src = "#version 330\n" + src; @@ -283,22 +289,24 @@ static bool CheckGLSL (bool vertex, bool gles, const std::string& testName, cons const char* sourcePtr = src.c_str(); - GLhandleARB shader = glCreateShaderObjectARB (vertex ? GL_VERTEX_SHADER_ARB : GL_FRAGMENT_SHADER_ARB); - glShaderSourceARB (shader, 1, &sourcePtr, NULL); - glCompileShaderARB (shader); + GLuint shader = glCreateShader (vertex ? GL_VERTEX_SHADER : GL_FRAGMENT_SHADER); + glShaderSource (shader, 1, &sourcePtr, NULL); + glCompileShader (shader); GLint status; - glGetObjectParameterivARB (shader, GL_OBJECT_COMPILE_STATUS_ARB, &status); + + glGetShaderiv (shader, GL_COMPILE_STATUS, &status); + bool res = true; - if (status == 0) + if (status != GL_TRUE) { char log[20000]; log[0] = 0; GLsizei logLength; - glGetInfoLogARB (shader, sizeof(log), &logLength, log); + glGetShaderInfoLog (shader, sizeof(log), &logLength, log); printf ("\n %s: real glsl compiler error on %s:\n%s\n", testName.c_str(), prefix, log); res = false; } - glDeleteObjectARB (shader); + glDeleteShader (shader); return res; } @@ -312,13 +320,16 @@ static bool CheckMetal (bool vertex, bool gles, const std::string& testName, con FILE* f = fopen ("metalTemp.metal", "wb"); fwrite (source.c_str(), source.size(), 1, f); fclose (f); - + +#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) int res = system("/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/usr/bin/metal metalTemp.metal -o metalTemp.o -std=ios-metal1.0 -Wno-parentheses-equality"); if (res != 0) { printf ("\n %s: Metal compiler failed\n", testName.c_str()); return false; } +#endif // + return true; } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES.txt index 98c2d64705b..d7da4497b86 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES.txt @@ -54,7 +54,7 @@ void main () dir_15 = (localDir_9 / tmpvar_14); highp float tmpvar_16; tmpvar_16 = abs(dir_15.y); - vec3 tmpvar_17; + highp vec3 tmpvar_17; if ((tmpvar_16 > 0.999)) { tmpvar_17 = vec3(0.0, 0.0, 1.0); } else { diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES3.txt index 570f34f4d51..44b1aabb914 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES3.txt @@ -55,7 +55,7 @@ void main () dir_15 = (localDir_9 / tmpvar_14); highp float tmpvar_16; tmpvar_16 = abs(dir_15.y); - vec3 tmpvar_17; + highp vec3 tmpvar_17; if ((tmpvar_16 > 0.999)) { tmpvar_17 = vec3(0.0, 0.0, 1.0); } else { diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3.txt index f30ecafb9ed..f252e00e39e 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3.txt @@ -13,27 +13,27 @@ void main () tmpvar_3.w = 1.0; tmpvar_3.xyz = _WorldSpaceCameraPos; viewDir_1 = normalize(((_World2Object * tmpvar_3).xyz - _glesVertex.xyz)); - mediump float backContrib_4; + mediump float tmpvar_4; highp float tmpvar_5; tmpvar_5 = clamp (dot (viewDir_1, -(_TerrainTreeLightDirections[0])), 0.0, 1.0); - backContrib_4 = tmpvar_5; + tmpvar_4 = tmpvar_5; highp vec3 tmpvar_6; tmpvar_6.yz = tmpvar_2.yz; - tmpvar_6.x = (backContrib_4 * 2.0); - mediump float backContrib_7; + tmpvar_6.x = (tmpvar_4 * 2.0); + mediump float tmpvar_7; highp float tmpvar_8; tmpvar_8 = clamp (dot (viewDir_1, -(_TerrainTreeLightDirections[1])), 0.0, 1.0); - backContrib_7 = tmpvar_8; + tmpvar_7 = tmpvar_8; highp vec3 tmpvar_9; tmpvar_9.xz = tmpvar_6.xz; - tmpvar_9.y = (backContrib_7 * 2.0); - mediump float backContrib_10; + tmpvar_9.y = (tmpvar_7 * 2.0); + mediump float tmpvar_10; highp float tmpvar_11; tmpvar_11 = clamp (dot (viewDir_1, -(_TerrainTreeLightDirections[2])), 0.0, 1.0); - backContrib_10 = tmpvar_11; + tmpvar_10 = tmpvar_11; highp vec3 tmpvar_12; tmpvar_12.xy = tmpvar_9.xy; - tmpvar_12.z = (backContrib_10 * 2.0); + tmpvar_12.z = (tmpvar_10 * 2.0); tmpvar_2 = tmpvar_12; gl_Position = (glstate_matrix_mvp * _glesVertex); xlv_TEXCOORD2 = tmpvar_12; diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3Metal.txt index ba480af8e69..d2b15808665 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3Metal.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3Metal.txt @@ -22,27 +22,27 @@ vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], tmpvar_3.w = 1.0; tmpvar_3.xyz = _mtl_u._WorldSpaceCameraPos; viewDir_1 = normalize(((_mtl_u._World2Object * tmpvar_3).xyz - _mtl_i._glesVertex.xyz)); - half backContrib_4; + half tmpvar_4; float tmpvar_5; tmpvar_5 = clamp (dot (viewDir_1, -(_mtl_u._TerrainTreeLightDirections[0])), 0.0, 1.0); - backContrib_4 = half(tmpvar_5); + tmpvar_4 = half(tmpvar_5); float3 tmpvar_6; tmpvar_6.yz = tmpvar_2.yz; - tmpvar_6.x = float((backContrib_4 * (half)2.0)); - half backContrib_7; + tmpvar_6.x = float((tmpvar_4 * (half)2.0)); + half tmpvar_7; float tmpvar_8; tmpvar_8 = clamp (dot (viewDir_1, -(_mtl_u._TerrainTreeLightDirections[1])), 0.0, 1.0); - backContrib_7 = half(tmpvar_8); + tmpvar_7 = half(tmpvar_8); float3 tmpvar_9; tmpvar_9.xz = tmpvar_6.xz; - tmpvar_9.y = float((backContrib_7 * (half)2.0)); - half backContrib_10; + tmpvar_9.y = float((tmpvar_7 * (half)2.0)); + half tmpvar_10; float tmpvar_11; tmpvar_11 = clamp (dot (viewDir_1, -(_mtl_u._TerrainTreeLightDirections[2])), 0.0, 1.0); - backContrib_10 = half(tmpvar_11); + tmpvar_10 = half(tmpvar_11); float3 tmpvar_12; tmpvar_12.xy = tmpvar_9.xy; - tmpvar_12.z = float((backContrib_10 * (half)2.0)); + tmpvar_12.z = float((tmpvar_10 * (half)2.0)); tmpvar_2 = tmpvar_12; _mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * _mtl_i._glesVertex); _mtl_o.xlv_TEXCOORD2 = tmpvar_12; diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3.txt index cb0deb8a8c0..1c7d3b422ed 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3.txt @@ -7,7 +7,7 @@ out mediump vec2 xlv_TEXCOORD0; out lowp vec4 xlv_TEXCOORD1; void main () { - vec4 tmpvar_1; + highp vec4 tmpvar_1; tmpvar_1.xyz = normalize(_glesTANGENT.xyz); tmpvar_1.w = _glesTANGENT.w; lowp vec4 tmpvar_2; diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3Metal.txt index 1513d416af1..69cc59a3de7 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3Metal.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3Metal.txt @@ -16,20 +16,18 @@ struct xlatMtlShaderUniform { vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) { xlatMtlShaderOutput _mtl_o; - float2 tmpvar_1; - tmpvar_1 = _mtl_i._glesMultiTexCoord0.xy; + half2 tmpvar_1; + tmpvar_1 = half2(_mtl_i._glesMultiTexCoord0.xy); float4 tmpvar_2; tmpvar_2.xyz = normalize(_mtl_i._glesTANGENT.xyz); tmpvar_2.w = _mtl_i._glesTANGENT.w; - half2 uv_3; - uv_3 = half2(tmpvar_1); - half4 tmpvar_4; - tmpvar_4.xy = ((half2)(_mtl_i._glesMultiTexCoord0.xy * 0.3)); - tmpvar_4.xyz = half3(((float3)tmpvar_4.xyz + ((tmpvar_2.xyz * 0.5) + 0.5))); - tmpvar_4.w = half(0.0); + half4 tmpvar_3; + tmpvar_3.xy = (tmpvar_1 * (half)0.3); + tmpvar_3.xyz = half3(((float3)tmpvar_3.xyz + ((tmpvar_2.xyz * 0.5) + 0.5))); + tmpvar_3.w = half(0.0); _mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * _mtl_i._glesVertex); - _mtl_o.xlv_TEXCOORD0 = uv_3; - _mtl_o.xlv_TEXCOORD1 = tmpvar_4; + _mtl_o.xlv_TEXCOORD0 = tmpvar_1; + _mtl_o.xlv_TEXCOORD1 = tmpvar_3; return _mtl_o; } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3.txt index 2e23a7616e6..e62f0f22107 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3.txt @@ -40,13 +40,13 @@ vec4 Temp_0; vec4 Temp_1; vec4 Temp_2; vec4 Temp_3; -int tmpvar_1; +highp int tmpvar_1; void main () { Temp_0 = (dcl_Input0_POSITION0.yyyy * glstate_matrix_mvp[1]); Temp_0 = ((glstate_matrix_mvp[0] * dcl_Input0_POSITION0.xxxx) + Temp_0); Temp_0 = ((glstate_matrix_mvp[2] * dcl_Input0_POSITION0.zzzz) + Temp_0); - vec4 tmpvar_2; + highp vec4 tmpvar_2; tmpvar_2 = ((glstate_matrix_mvp[3] * dcl_Input0_POSITION0.wwww) + Temp_0); VtxGeoOutput1_TEXCOORD0.xy = ((dcl_Input2_TEXCOORD0.xyxx * _MainTex_ST.xyxx) + _MainTex_ST.zwzz).xy; Temp_0.xyz = (dcl_Input0_POSITION0.yyyy * glstate_matrix_modelview0[1].xyzx).xyz; diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-inES3.txt new file mode 100644 index 00000000000..9117dfa850b --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-inES3.txt @@ -0,0 +1,86 @@ +#version 300 es + +// This was produced at one point from Unity's Reflect/VertexLit +// shader's "Vertex Lit, emulated in shaders" pass by hlslcc. +// Loop analysis was not detecting that Temp_int[0] is used as +// both a loop induction variable (.w component) and for other uses +// outside the loop. + +precision highp float; + +uniform vec4 unity_LightColor[8]; +uniform vec4 unity_LightPosition[8]; +uniform vec4 unity_LightAtten[8]; +uniform vec4 unity_SpotDirection[8]; +uniform mat4 glstate_matrix_mvp; +uniform mat4 glstate_matrix_modelview0; +uniform mat4 glstate_matrix_invtrans_modelview0; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec4 glstate_lightmodel_ambient; +uniform vec4 _MainTex_ST; +uniform vec4 _Color; +uniform vec4 _ReflectColor; + in highp vec4 in_POSITION0; +vec4 Input0; + in highp vec4 in_NORMAL0; +vec4 Input1; + in highp vec4 in_TEXCOORD0; +vec4 Input2; + out highp vec4 TEXCOORD0; +#define Output0 TEXCOORD0 + out highp vec4 COLOR0; +#define Output1 COLOR0 +#undef Output2 +#define Output2 phase0_Output2 +vec4 phase0_Output2; +vec4 Temp[4]; +ivec4 Temp_int[4]; +void main() +{ + Input0 = in_POSITION0; + Input1 = in_NORMAL0; + Input2 = in_TEXCOORD0; + Temp_int[0] = floatBitsToInt(Input0.yyyy * glstate_matrix_mvp[1]); + Temp_int[0] = floatBitsToInt(glstate_matrix_mvp[0] * Input0.xxxx + intBitsToFloat(Temp_int[0])); + Temp_int[0] = floatBitsToInt(glstate_matrix_mvp[2] * Input0.zzzz + intBitsToFloat(Temp_int[0])); + Output2 = glstate_matrix_mvp[3] * Input0.wwww + intBitsToFloat(Temp_int[0]); + Output0.xy = Input2.xy * _MainTex_ST.xy + _MainTex_ST.zw; + Temp_int[0].xyz = floatBitsToInt(Input0.yyy * glstate_matrix_modelview0[1].xyz); + Temp_int[0].xyz = floatBitsToInt(glstate_matrix_modelview0[0].xyz * Input0.xxx + intBitsToFloat(Temp_int[0]).xyz); + Temp_int[0].xyz = floatBitsToInt(glstate_matrix_modelview0[2].xyz * Input0.zzz + intBitsToFloat(Temp_int[0]).xyz); + Temp_int[0].xyz = floatBitsToInt(glstate_matrix_modelview0[3].xyz * Input0.www + intBitsToFloat(Temp_int[0]).xyz); + Temp_int[1].xyz = floatBitsToInt(Input1.yyy * glstate_matrix_invtrans_modelview0[1].xyz); + Temp_int[1].xyz = floatBitsToInt(glstate_matrix_invtrans_modelview0[0].xyz * Input1.xxx + intBitsToFloat(Temp_int[1]).xyz); + Temp_int[1].xyz = floatBitsToInt(glstate_matrix_invtrans_modelview0[2].xyz * Input1.zzz + intBitsToFloat(Temp_int[1]).xyz); + Temp_int[0].w = floatBitsToInt(dot(intBitsToFloat(Temp_int[1]).xyz, intBitsToFloat(Temp_int[1]).xyz)); + Temp_int[0].w = floatBitsToInt(inversesqrt(intBitsToFloat(Temp_int[0]).w)); + Temp_int[1].xyz = floatBitsToInt(intBitsToFloat(Temp_int[0]).www * intBitsToFloat(Temp_int[1]).xyz); + Temp[2].xyz = glstate_lightmodel_ambient.xyz; + Temp_int[0].w = 0x0; + while(true){ + if ((Temp_int[0].w>= 0x4)) { break; } + Temp_int[1].w = int((Temp_int[0].w>=0x4) ? 0xFFFFFFFFu : 0u); + Temp[3].xyz = (-intBitsToFloat(Temp_int[0]).xyz) * unity_LightPosition[Temp_int[0].w + 0].www + unity_LightPosition[Temp_int[0].w + 0].xyz; + Temp_int[1].w = floatBitsToInt(dot(Temp[3].xyz, Temp[3].xyz)); + Temp[2].w = inversesqrt(intBitsToFloat(Temp_int[1]).w); + Temp[3].xyz = Temp[2].www * Temp[3].xyz; + Temp_int[1].w = floatBitsToInt(intBitsToFloat(Temp_int[1]).w * unity_LightAtten[Temp_int[0].w + 0].z + intBitsToFloat(0x3F800000)); + Temp_int[1].w = floatBitsToInt(float(intBitsToFloat(0x3F800000)) / intBitsToFloat(Temp_int[1]).w); + Temp[2].w = dot(Temp[3].xyz, unity_SpotDirection[Temp_int[0].w + 0].xyz); + Temp[2].w = max(Temp[2].w, intBitsToFloat(0x0)); + Temp[2].w = Temp[2].w + (-unity_LightAtten[Temp_int[0].w + 0].x); + Temp[2].w = Temp[2].w * unity_LightAtten[Temp_int[0].w + 0].y; + Temp[2].w = clamp(Temp[2].w, 0.0, 1.0); + Temp_int[1].w = floatBitsToInt(intBitsToFloat(Temp_int[1]).w * Temp[2].w); + Temp[2].w = dot(intBitsToFloat(Temp_int[1]).xyz, Temp[3].xyz); + Temp[2].w = max(Temp[2].w, intBitsToFloat(0x0)); + Temp_int[1].w = floatBitsToInt(intBitsToFloat(Temp_int[1]).w * Temp[2].w); + Temp[2].xyz = unity_LightColor[Temp_int[0].w + 0].xyz * intBitsToFloat(Temp_int[1]).www + Temp[2].xyz; + Temp_int[0].w = Temp_int[0].w + 0x1; + } + Output1.xyz = Temp[2].xyz * _Color.xyz; + Output1.w = _Color.w * _ReflectColor.w; + gl_Position = vec4(phase0_Output2); + return; +} diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3.txt new file mode 100644 index 00000000000..b1fca1d8e9b --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3.txt @@ -0,0 +1,87 @@ +#version 300 es +precision highp float; +uniform vec4 unity_LightColor[8]; +uniform vec4 unity_LightPosition[8]; +uniform vec4 unity_LightAtten[8]; +uniform vec4 unity_SpotDirection[8]; +uniform mat4 glstate_matrix_mvp; +uniform mat4 glstate_matrix_modelview0; +uniform mat4 glstate_matrix_invtrans_modelview0; +uniform vec4 glstate_lightmodel_ambient; +uniform vec4 _MainTex_ST; +uniform vec4 _Color; +uniform vec4 _ReflectColor; +in highp vec4 in_POSITION0; +in highp vec4 in_NORMAL0; +in highp vec4 in_TEXCOORD0; +out highp vec4 TEXCOORD0; +out highp vec4 COLOR0; +highp vec4 phase0_Output2; +highp vec4 Temp_2; +highp vec4 Temp_3; +highp ivec4 Temp_int_0; +highp ivec4 Temp_int_1; +void main () +{ + Temp_int_0 = floatBitsToInt((in_POSITION0.yyyy * glstate_matrix_mvp[1])); + Temp_int_0 = floatBitsToInt(((glstate_matrix_mvp[0] * in_POSITION0.xxxx) + intBitsToFloat(Temp_int_0))); + Temp_int_0 = floatBitsToInt(((glstate_matrix_mvp[2] * in_POSITION0.zzzz) + intBitsToFloat(Temp_int_0))); + phase0_Output2 = ((glstate_matrix_mvp[3] * in_POSITION0.wwww) + intBitsToFloat(Temp_int_0)); + TEXCOORD0.xy = ((in_TEXCOORD0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + Temp_int_0.xyz = floatBitsToInt((in_POSITION0.yyy * glstate_matrix_modelview0[1].xyz)); + Temp_int_0.xyz = floatBitsToInt(((glstate_matrix_modelview0[0].xyz * in_POSITION0.xxx) + intBitsToFloat(Temp_int_0).xyz)); + Temp_int_0.xyz = floatBitsToInt(((glstate_matrix_modelview0[2].xyz * in_POSITION0.zzz) + intBitsToFloat(Temp_int_0).xyz)); + Temp_int_0.xyz = floatBitsToInt(((glstate_matrix_modelview0[3].xyz * in_POSITION0.www) + intBitsToFloat(Temp_int_0).xyz)); + Temp_int_1.xyz = floatBitsToInt((in_NORMAL0.yyy * glstate_matrix_invtrans_modelview0[1].xyz)); + Temp_int_1.xyz = floatBitsToInt(((glstate_matrix_invtrans_modelview0[0].xyz * in_NORMAL0.xxx) + intBitsToFloat(Temp_int_1).xyz)); + Temp_int_1.xyz = floatBitsToInt(((glstate_matrix_invtrans_modelview0[2].xyz * in_NORMAL0.zzz) + intBitsToFloat(Temp_int_1).xyz)); + Temp_int_0.w = floatBitsToInt(dot (intBitsToFloat(Temp_int_1).xyz, intBitsToFloat(Temp_int_1).xyz)); + Temp_int_0.w = floatBitsToInt(inversesqrt(intBitsToFloat(Temp_int_0).w)); + Temp_int_1.xyz = floatBitsToInt((intBitsToFloat(Temp_int_0).www * intBitsToFloat(Temp_int_1).xyz)); + Temp_2.xyz = glstate_lightmodel_ambient.xyz; + Temp_int_0.w = 0; + for (; Temp_int_0.w < 4; Temp_int_0.w = (Temp_int_0.w + 1)) { + Temp_3.xyz = ((-( + intBitsToFloat(Temp_int_0) + .xyz) * unity_LightPosition[Temp_int_0.w].www) + unity_LightPosition[Temp_int_0.w].xyz); + Temp_int_1.w = floatBitsToInt(dot (Temp_3.xyz, Temp_3.xyz)); + Temp_2.w = inversesqrt(intBitsToFloat(Temp_int_1).w); + Temp_3.xyz = (Temp_2.www * Temp_3.xyz); + Temp_int_1.w = floatBitsToInt((( + intBitsToFloat(Temp_int_1) + .w * unity_LightAtten[Temp_int_0.w].z) + 1.0)); + Temp_int_1.w = floatBitsToInt((1.0/(intBitsToFloat(Temp_int_1).w))); + Temp_2.w = dot (Temp_3.xyz, unity_SpotDirection[Temp_int_0.w].xyz); + Temp_2.w = max (Temp_2.w, 0.0); + Temp_2.w = (Temp_2.w - unity_LightAtten[Temp_int_0.w].x); + Temp_2.w = (Temp_2.w * unity_LightAtten[Temp_int_0.w].y); + Temp_2.w = clamp (Temp_2.w, 0.0, 1.0); + Temp_int_1.w = floatBitsToInt((intBitsToFloat(Temp_int_1).w * Temp_2.w)); + Temp_2.w = dot (intBitsToFloat(Temp_int_1).xyz, Temp_3.xyz); + Temp_2.w = max (Temp_2.w, 0.0); + Temp_int_1.w = floatBitsToInt((intBitsToFloat(Temp_int_1).w * Temp_2.w)); + Temp_2.xyz = ((unity_LightColor[Temp_int_0.w].xyz * intBitsToFloat(Temp_int_1).www) + Temp_2.xyz); + }; + COLOR0.xyz = (Temp_2.xyz * _Color.xyz); + COLOR0.w = (_Color.w * _ReflectColor.w); + gl_Position = phase0_Output2; +} + + +// stats: 88 alu 0 tex 2 flow +// inputs: 3 +// #0: in_POSITION0 (high float) 4x1 [-1] +// #1: in_NORMAL0 (high float) 4x1 [-1] +// #2: in_TEXCOORD0 (high float) 4x1 [-1] +// uniforms: 11 (total size: 0) +// #0: unity_LightColor (high float) 4x1 [8] +// #1: unity_LightPosition (high float) 4x1 [8] +// #2: unity_LightAtten (high float) 4x1 [8] +// #3: unity_SpotDirection (high float) 4x1 [8] +// #4: glstate_matrix_mvp (high float) 4x4 [-1] +// #5: glstate_matrix_modelview0 (high float) 4x4 [-1] +// #6: glstate_matrix_invtrans_modelview0 (high float) 4x4 [-1] +// #7: glstate_lightmodel_ambient (high float) 4x1 [-1] +// #8: _MainTex_ST (high float) 4x1 [-1] +// #9: _Color (high float) 4x1 [-1] +// #10: _ReflectColor (high float) 4x1 [-1] diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3Metal.txt new file mode 100644 index 00000000000..ede21264b0c --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3Metal.txt @@ -0,0 +1,97 @@ +#include <metal_stdlib> +using namespace metal; +struct xlatMtlShaderInput { + float4 in_POSITION0 [[attribute(0)]]; + float4 in_NORMAL0 [[attribute(1)]]; + float4 in_TEXCOORD0 [[attribute(2)]]; +}; +struct xlatMtlShaderOutput { + float4 gl_Position [[position]]; + float4 TEXCOORD0; + float4 COLOR0; +}; +struct xlatMtlShaderUniform { + float4 unity_LightColor[8]; + float4 unity_LightPosition[8]; + float4 unity_LightAtten[8]; + float4 unity_SpotDirection[8]; + float4x4 glstate_matrix_mvp; + float4x4 glstate_matrix_modelview0; + float4x4 glstate_matrix_invtrans_modelview0; + float4 glstate_lightmodel_ambient; + float4 _MainTex_ST; + float4 _Color; + float4 _ReflectColor; +}; +; +vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; +float4 phase0_Output2_1; +float4 Temp_2_2; +float4 Temp_3_3; +int4 Temp_int_0_4; +int4 Temp_int_1_5; + Temp_int_0_4 = as_type<int4>((_mtl_i.in_POSITION0.yyyy * _mtl_u.glstate_matrix_mvp[1])); + Temp_int_0_4 = as_type<int4>(((_mtl_u.glstate_matrix_mvp[0] * _mtl_i.in_POSITION0.xxxx) + as_type<float4>(Temp_int_0_4))); + Temp_int_0_4 = as_type<int4>(((_mtl_u.glstate_matrix_mvp[2] * _mtl_i.in_POSITION0.zzzz) + as_type<float4>(Temp_int_0_4))); + phase0_Output2_1 = ((_mtl_u.glstate_matrix_mvp[3] * _mtl_i.in_POSITION0.wwww) + as_type<float4>(Temp_int_0_4)); + _mtl_o.TEXCOORD0.xy = ((_mtl_i.in_TEXCOORD0.xy * _mtl_u._MainTex_ST.xy) + _mtl_u._MainTex_ST.zw); + Temp_int_0_4.xyz = as_type<int3>((_mtl_i.in_POSITION0.yyy * _mtl_u.glstate_matrix_modelview0[1].xyz)); + Temp_int_0_4.xyz = as_type<int3>(((_mtl_u.glstate_matrix_modelview0[0].xyz * _mtl_i.in_POSITION0.xxx) + as_type<float4>(Temp_int_0_4).xyz)); + Temp_int_0_4.xyz = as_type<int3>(((_mtl_u.glstate_matrix_modelview0[2].xyz * _mtl_i.in_POSITION0.zzz) + as_type<float4>(Temp_int_0_4).xyz)); + Temp_int_0_4.xyz = as_type<int3>(((_mtl_u.glstate_matrix_modelview0[3].xyz * _mtl_i.in_POSITION0.www) + as_type<float4>(Temp_int_0_4).xyz)); + Temp_int_1_5.xyz = as_type<int3>((_mtl_i.in_NORMAL0.yyy * _mtl_u.glstate_matrix_invtrans_modelview0[1].xyz)); + Temp_int_1_5.xyz = as_type<int3>(((_mtl_u.glstate_matrix_invtrans_modelview0[0].xyz * _mtl_i.in_NORMAL0.xxx) + as_type<float4>(Temp_int_1_5).xyz)); + Temp_int_1_5.xyz = as_type<int3>(((_mtl_u.glstate_matrix_invtrans_modelview0[2].xyz * _mtl_i.in_NORMAL0.zzz) + as_type<float4>(Temp_int_1_5).xyz)); + Temp_int_0_4.w = as_type<int>(dot (as_type<float4>(Temp_int_1_5).xyz, as_type<float4>(Temp_int_1_5).xyz)); + Temp_int_0_4.w = as_type<int>(rsqrt(as_type<float4>(Temp_int_0_4).w)); + Temp_int_1_5.xyz = as_type<int3>((as_type<float4>(Temp_int_0_4).www * as_type<float4>(Temp_int_1_5).xyz)); + Temp_2_2.xyz = _mtl_u.glstate_lightmodel_ambient.xyz; + Temp_int_0_4.w = 0; + for (; Temp_int_0_4.w < 4; Temp_int_0_4.w = (Temp_int_0_4.w + 1)) { + Temp_3_3.xyz = ((-( + as_type<float4>(Temp_int_0_4) + .xyz) * _mtl_u.unity_LightPosition[Temp_int_0_4.w].www) + _mtl_u.unity_LightPosition[Temp_int_0_4.w].xyz); + Temp_int_1_5.w = as_type<int>(dot (Temp_3_3.xyz, Temp_3_3.xyz)); + Temp_2_2.w = rsqrt(as_type<float4>(Temp_int_1_5).w); + Temp_3_3.xyz = (Temp_2_2.www * Temp_3_3.xyz); + Temp_int_1_5.w = as_type<int>((( + as_type<float4>(Temp_int_1_5) + .w * _mtl_u.unity_LightAtten[Temp_int_0_4.w].z) + 1.0)); + Temp_int_1_5.w = as_type<int>((1.0/(as_type<float4>(Temp_int_1_5).w))); + Temp_2_2.w = dot (Temp_3_3.xyz, _mtl_u.unity_SpotDirection[Temp_int_0_4.w].xyz); + Temp_2_2.w = max (Temp_2_2.w, 0.0); + Temp_2_2.w = (Temp_2_2.w - _mtl_u.unity_LightAtten[Temp_int_0_4.w].x); + Temp_2_2.w = (Temp_2_2.w * _mtl_u.unity_LightAtten[Temp_int_0_4.w].y); + Temp_2_2.w = clamp (Temp_2_2.w, 0.0, 1.0); + Temp_int_1_5.w = as_type<int>((as_type<float4>(Temp_int_1_5).w * Temp_2_2.w)); + Temp_2_2.w = dot (as_type<float4>(Temp_int_1_5).xyz, Temp_3_3.xyz); + Temp_2_2.w = max (Temp_2_2.w, 0.0); + Temp_int_1_5.w = as_type<int>((as_type<float4>(Temp_int_1_5).w * Temp_2_2.w)); + Temp_2_2.xyz = ((_mtl_u.unity_LightColor[Temp_int_0_4.w].xyz * as_type<float4>(Temp_int_1_5).www) + Temp_2_2.xyz); + }; + _mtl_o.COLOR0.xyz = (Temp_2_2.xyz * _mtl_u._Color.xyz); + _mtl_o.COLOR0.w = (_mtl_u._Color.w * _mtl_u._ReflectColor.w); + _mtl_o.gl_Position = phase0_Output2_1; + return _mtl_o; +} + + +// stats: 88 alu 0 tex 2 flow +// inputs: 3 +// #0: in_POSITION0 (high float) 4x1 [-1] loc 0 +// #1: in_NORMAL0 (high float) 4x1 [-1] loc 1 +// #2: in_TEXCOORD0 (high float) 4x1 [-1] loc 2 +// uniforms: 11 (total size: 768) +// #0: unity_LightColor (high float) 4x1 [8] loc 0 +// #1: unity_LightPosition (high float) 4x1 [8] loc 128 +// #2: unity_LightAtten (high float) 4x1 [8] loc 256 +// #3: unity_SpotDirection (high float) 4x1 [8] loc 384 +// #4: glstate_matrix_mvp (high float) 4x4 [-1] loc 512 +// #5: glstate_matrix_modelview0 (high float) 4x4 [-1] loc 576 +// #6: glstate_matrix_invtrans_modelview0 (high float) 4x4 [-1] loc 640 +// #7: glstate_lightmodel_ambient (high float) 4x1 [-1] loc 704 +// #8: _MainTex_ST (high float) 4x1 [-1] loc 720 +// #9: _Color (high float) 4x1 [-1] loc 736 +// #10: _ReflectColor (high float) 4x1 [-1] loc 752 diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES3.txt index e503189b751..b2b531d5e26 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES3.txt @@ -19,7 +19,7 @@ void main () lowp vec3 tmpvar_4; lowp vec3 tmpvar_5; highp mat3 tmpvar_6; - tmpvar_6[0u] = _Object2World[0].xyz; + tmpvar_6[uint(0)] = _Object2World[0].xyz; tmpvar_6[1u] = _Object2World[1].xyz; tmpvar_6[2u] = _Object2World[2].xyz; mediump vec3 tmpvar_7; @@ -31,9 +31,9 @@ void main () tmpvar_8 = attrTangent.xyz; tmpvar_9 = (((attrNormal.yzx * attrTangent.zxy) - (attrNormal.zxy * attrTangent.yzx)) * attrTangent.w); mediump mat3 tmpvar_10; - tmpvar_10[0u].x = tmpvar_8.x; - tmpvar_10[0u].y = tmpvar_9.x; - tmpvar_10[0u].z = attrNormal.x; + tmpvar_10[uint(0)].x = tmpvar_8.x; + tmpvar_10[uint(0)].y = tmpvar_9.x; + tmpvar_10[uint(0)].z = attrNormal.x; tmpvar_10[1u].x = tmpvar_8.y; tmpvar_10[1u].y = tmpvar_9.y; tmpvar_10[1u].z = attrNormal.y; diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-out.txt index 924b1a0f6ac..d70c93488b6 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-out.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-out.txt @@ -1,7 +1,7 @@ varying vec3 var_a; void main () { - gl_Position = (gl_Vertex * vec4(0.182574, 0.365148, 0.547723, 0.730297)); + gl_Position = (gl_Vertex * vec4(0.1825742, 0.3651484, 0.5477225, 0.7302967)); var_a = (gl_Vertex.xyz * normalize(vec3(0.0, 0.0, 0.0))); } diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-outES3.txt index 6f463fcd797..283af1e397e 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-outES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-outES3.txt @@ -30,7 +30,7 @@ void main () tmpvar_8.xyz = tmpvar_1; viewpos_7 = (glstate_matrix_modelview0 * tmpvar_8).xyz; highp mat3 tmpvar_9; - tmpvar_9[0u] = glstate_matrix_invtrans_modelview0[0u].xyz; + tmpvar_9[uint(0)] = glstate_matrix_invtrans_modelview0[uint(0)].xyz; tmpvar_9[1u] = glstate_matrix_invtrans_modelview0[1u].xyz; tmpvar_9[2u] = glstate_matrix_invtrans_modelview0[2u].xyz; viewN_6 = (tmpvar_9 * n_2); diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-in.txt new file mode 100644 index 00000000000..878b0ec91fc --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-in.txt @@ -0,0 +1,121 @@ +// stripped down version of Nicholas' Static Sky +// hybrid lighting shader that exposed vector_insert_todo +// bug + +vec4 xll_tex2Dlod(sampler2D s, vec4 coord) { + return texture2DLod( s, coord.xy, coord.w); +} +mat3 xll_constructMat3_mf4x4( mat4 m) { + return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2])); +} +struct Lamp { + vec4 posRange; + vec4 colorImp; +}; +struct v2f { + vec4 pos; + vec3 diffuse; +}; +struct HybridAppData { + vec4 vertex; + vec4 tangent; + vec3 normal; + vec4 texcoord; + vec4 bakedCol; + vec2 bakedDir; +}; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _ProjectionParams; +uniform vec4 _ScreenParams; +uniform vec4 _ZBufferParams; +uniform vec4 _WorldSpaceLightPos0; + +uniform mat4 _Object2World; +uniform mat4 _World2Object; + + + +uniform float _RenderExposure; +uniform vec2 _DynLampInfo_bufferSize; +uniform sampler2D _DynLampInfo; +uniform float LightVertOffset; +uniform sampler2D LightVertTexture; +uniform vec4 LightVertTextureSize; +void CalcDynamicLight( in vec3 worldVert, in vec3 worldNorm, in Lamp lamp[4], inout vec3 hybridDir, inout vec3 hybridCol ) { + vec4 atten; + int i = 0; + for ( ; (i < 4); (i++)) { + + vec3 lightToVert = (lamp[i].posRange.xyz - worldVert); + float lengthSq = dot( lightToVert, lightToVert); + vec3 lightToVertNorm = (lightToVert * inversesqrt(lengthSq)); + + atten[i] = (lengthSq * lamp[i].posRange.w); + float nDotL = dot( lightToVertNorm, worldNorm); + float weight = (atten[i] * nDotL); + } + + int j = 0; + for ( ; (j < 4); (j++)) { + hybridCol += (lamp[j].colorImp.xyz * atten[j]); + } +} +void LoadBakedLight( out vec3 hybridCol, out vec3 hybridDir ) { +} +vec4 DoSampleGPUBuffer( in sampler2D buffer, in vec2 coord, in vec2 dimensions ) { + return xll_tex2Dlod( buffer, vec4( (coord / dimensions), 0.0, 0.0)); +} +void ReadLightArray3( in ivec4 lightIdx, out Lamp l0, out Lamp l1, out Lamp l2, out Lamp l3 ) { + + l0.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.x), 1.0), _DynLampInfo_bufferSize); + l0.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.x), 2.0), _DynLampInfo_bufferSize); + l1.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.y), 1.0), _DynLampInfo_bufferSize); + + l1.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.y), 2.0), _DynLampInfo_bufferSize); + l2.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.z), 1.0), _DynLampInfo_bufferSize); + l2.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.z), 2.0), _DynLampInfo_bufferSize); + + l3.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.w), 1.0), _DynLampInfo_bufferSize); + l3.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.w), 2.0), _DynLampInfo_bufferSize); +} +void DoCalcHybridLight2( in vec3 worldVert, in vec3 worldNorm, out vec3 hybridCol, in vec4 bakedColor, in vec2 bakedDir ) { + vec3 hybridDir; + LoadBakedLight( hybridCol, hybridDir); + + ivec4 lightIdx = ivec4( int(worldVert.x), int(worldVert.y), int(worldVert.z), int((-worldVert.x))); + Lamp l[4]; + ReadLightArray3( lightIdx, l[0], l[1], l[2], l[3]); + + CalcDynamicLight( worldVert, worldNorm, l, hybridDir, hybridCol); +} +vec3 CalcDiffuseHybridLight( in vec3 worldVert, in vec3 worldNorm, in vec4 bakedColor, in vec2 bakedDir ) { + vec3 hybridCol; + DoCalcHybridLight2( worldVert, worldNorm, hybridCol, bakedColor, bakedDir); + + return hybridCol; +} +v2f vert( in HybridAppData v ) { + v2f o; + + vec3 worldVert = (_Object2World * v.vertex).xyz; + vec3 worldNorm = normalize((xll_constructMat3_mf4x4( _Object2World) * v.normal.xyz)); + o.diffuse = CalcDiffuseHybridLight( worldVert, worldNorm, v.bakedCol, v.bakedDir); + + o.pos = (gl_ModelViewProjectionMatrix * v.vertex); + return o; +} +attribute vec4 TANGENT; +varying vec3 xlv_TEXCOORD2; +void main() { + v2f xl_retval; + HybridAppData xlt_v; + xlt_v.vertex = vec4(gl_Vertex); + xlt_v.tangent = vec4(TANGENT); + xlt_v.normal = vec3(gl_Normal); + xlt_v.texcoord = vec4(gl_MultiTexCoord0); + xlt_v.bakedCol = vec4(gl_Color); + xlt_v.bakedDir = vec2(gl_MultiTexCoord1); + xl_retval = vert( xlt_v); + gl_Position = vec4(xl_retval.pos); + xlv_TEXCOORD2 = vec3(xl_retval.diffuse); +} diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-inES.txt new file mode 100644 index 00000000000..644f5c9d6e2 --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-inES.txt @@ -0,0 +1,139 @@ +// stripped down version of Nicholas' Static Sky +// hybrid lighting shader that exposed vector_insert_todo +// bug + +#define gl_Vertex _glesVertex +attribute vec4 _glesVertex; +#define gl_Color _glesColor +attribute vec4 _glesColor; +#define gl_Normal _glesNormal +attribute vec3 _glesNormal; +#define gl_MultiTexCoord0 _glesMultiTexCoord0 +attribute vec4 _glesMultiTexCoord0; +#define gl_MultiTexCoord1 _glesMultiTexCoord1 +attribute vec4 _glesMultiTexCoord1; +#define TANGENT _glesTANGENT +attribute vec4 _glesTANGENT; +vec4 xll_tex2Dlod(sampler2D s, vec4 coord) { + return texture2DLod( s, coord.xy, coord.w); +} +mat3 xll_constructMat3_mf4x4( mat4 m) { + return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2])); +} +struct Lamp { + mediump vec4 posRange; + mediump vec4 colorImp; +}; +struct v2f { + highp vec4 pos; + mediump vec3 diffuse; +}; +struct HybridAppData { + highp vec4 vertex; + highp vec4 tangent; + highp vec3 normal; + highp vec4 texcoord; + lowp vec4 bakedCol; + mediump vec2 bakedDir; +}; +uniform highp vec4 _Time; +uniform highp vec4 _SinTime; +uniform highp vec4 _CosTime; +uniform highp vec3 _WorldSpaceCameraPos; +uniform highp vec4 _ProjectionParams; +uniform highp vec4 _ScreenParams; +uniform highp vec4 _ZBufferParams; +uniform highp vec4 _WorldSpaceLightPos0; +uniform highp vec4 _LightPositionRange; +uniform highp mat4 glstate_matrix_mvp; +uniform highp mat4 glstate_matrix_modelview0; +uniform highp mat4 glstate_matrix_invtrans_modelview0; +uniform highp mat4 _Object2World; +uniform highp mat4 _World2Object; +uniform highp mat4 glstate_matrix_transpose_modelview0; +uniform highp mat4 glstate_matrix_projection; +uniform lowp vec4 glstate_lightmodel_ambient; +uniform highp float _RenderExposure; +uniform mediump vec2 _DynLampInfo_bufferSize; +uniform sampler2D _DynLampInfo; +uniform highp float LightVertOffset; +uniform sampler2D LightVertTexture; +uniform highp vec4 LightVertTextureSize; +void CalcDynamicLight( in highp vec3 worldVert, in highp vec3 worldNorm, in Lamp lamp[4], inout mediump vec3 hybridDir, inout mediump vec3 hybridCol ) { + mediump vec4 atten; + highp int i = 0; + for ( ; (i < 4); (i++)) { + + highp vec3 lightToVert = (lamp[i].posRange.xyz - worldVert); + highp float lengthSq = dot( lightToVert, lightToVert); + highp vec3 lightToVertNorm = (lightToVert * inversesqrt(lengthSq)); + + atten[i] = (lengthSq * lamp[i].posRange.w); + mediump float nDotL = dot( lightToVertNorm, worldNorm); + mediump float weight = (atten[i] * nDotL); + } + + highp int j = 0; + for ( ; (j < 4); (j++)) { + hybridCol += (lamp[j].colorImp.xyz * atten[j]); + } +} +void LoadBakedLight( out mediump vec3 hybridCol, out mediump vec3 hybridDir ) { +} +mediump vec4 DoSampleGPUBuffer( in sampler2D buffer, in mediump vec2 coord, in mediump vec2 dimensions ) { + return xll_tex2Dlod( buffer, vec4( (coord / dimensions), 0.0, 0.0)); +} +void ReadLightArray3( in highp ivec4 lightIdx, out Lamp l0, out Lamp l1, out Lamp l2, out Lamp l3 ) { + + l0.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.x), 1.0), _DynLampInfo_bufferSize); + l0.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.x), 2.0), _DynLampInfo_bufferSize); + l1.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.y), 1.0), _DynLampInfo_bufferSize); + + l1.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.y), 2.0), _DynLampInfo_bufferSize); + l2.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.z), 1.0), _DynLampInfo_bufferSize); + l2.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.z), 2.0), _DynLampInfo_bufferSize); + + l3.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.w), 1.0), _DynLampInfo_bufferSize); + l3.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.w), 2.0), _DynLampInfo_bufferSize); +} +void DoCalcHybridLight2( in highp vec3 worldVert, in highp vec3 worldNorm, out mediump vec3 hybridCol, in lowp vec4 bakedColor, in mediump vec2 bakedDir ) { + mediump vec3 hybridDir; + LoadBakedLight( hybridCol, hybridDir); + + highp ivec4 lightIdx = ivec4( int(worldVert.x), int(worldVert.y), int(worldVert.z), int((-worldVert.x))); + Lamp l[4]; + ReadLightArray3( lightIdx, l[0], l[1], l[2], l[3]); + + CalcDynamicLight( worldVert, worldNorm, l, hybridDir, hybridCol); +} +highp vec3 CalcDiffuseHybridLight( in highp vec3 worldVert, in highp vec3 worldNorm, in mediump vec4 bakedColor, in mediump vec2 bakedDir ) { + mediump vec3 hybridCol; + DoCalcHybridLight2( worldVert, worldNorm, hybridCol, bakedColor, bakedDir); + + return hybridCol; +} +v2f vert( in HybridAppData v ) { + v2f o; + + highp vec3 worldVert = (_Object2World * v.vertex).xyz; + highp vec3 worldNorm = normalize((xll_constructMat3_mf4x4( _Object2World) * v.normal.xyz)); + o.diffuse = CalcDiffuseHybridLight( worldVert, worldNorm, v.bakedCol, v.bakedDir); + + o.pos = (glstate_matrix_mvp * v.vertex); + return o; +} + +varying mediump vec3 xlv_TEXCOORD2; +void main() { + v2f xl_retval; + HybridAppData xlt_v; + xlt_v.vertex = vec4(gl_Vertex); + xlt_v.tangent = vec4(TANGENT); + xlt_v.normal = vec3(gl_Normal); + xlt_v.texcoord = vec4(gl_MultiTexCoord0); + xlt_v.bakedCol = vec4(gl_Color); + xlt_v.bakedDir = vec2(gl_MultiTexCoord1); + xl_retval = vert( xlt_v); + gl_Position = vec4(xl_retval.pos); + xlv_TEXCOORD2 = vec3(xl_retval.diffuse); +} diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-inES3.txt new file mode 100644 index 00000000000..4ae8b08d92e --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-inES3.txt @@ -0,0 +1,134 @@ +#version 300 es + +// stripped down version of Nicholas' Static Sky +// hybrid lighting shader that exposed vector_insert_todo +// bug + +#define gl_Vertex _glesVertex +in vec4 _glesVertex; +#define gl_Color _glesColor +in vec4 _glesColor; +#define gl_Normal _glesNormal +in vec3 _glesNormal; +#define gl_MultiTexCoord0 _glesMultiTexCoord0 +in vec4 _glesMultiTexCoord0; +#define gl_MultiTexCoord1 _glesMultiTexCoord1 +in vec4 _glesMultiTexCoord1; +#define TANGENT _glesTANGENT +in vec4 _glesTANGENT; +vec4 xll_tex2Dlod(sampler2D s, vec4 coord) { + return textureLod( s, coord.xy, coord.w); +} +struct Lamp { + mediump vec4 posRange; + mediump vec4 colorImp; +}; +struct v2f { + highp vec4 pos; + mediump vec3 diffuse; +}; +struct HybridAppData { + highp vec4 vertex; + highp vec4 tangent; + highp vec3 normal; + highp vec4 texcoord; + lowp vec4 bakedCol; + mediump vec2 bakedDir; +}; +uniform highp vec3 _WorldSpaceCameraPos; +uniform highp vec4 _ProjectionParams; +uniform highp vec4 _ScreenParams; +uniform highp vec4 _ZBufferParams; +uniform highp vec4 _WorldSpaceLightPos0; +uniform highp mat4 glstate_matrix_mvp; +uniform highp mat4 glstate_matrix_modelview0; +uniform highp mat4 glstate_matrix_invtrans_modelview0; +uniform highp mat4 _Object2World; +uniform highp mat4 _World2Object; +uniform highp mat4 glstate_matrix_transpose_modelview0; +uniform highp mat4 glstate_matrix_projection; +uniform lowp vec4 glstate_lightmodel_ambient; +uniform highp float _RenderExposure; +uniform mediump vec2 _DynLampInfo_bufferSize; +uniform sampler2D _DynLampInfo; +uniform highp float LightVertOffset; +uniform sampler2D LightVertTexture; +uniform highp vec4 LightVertTextureSize; +void CalcDynamicLight( in highp vec3 worldVert, in highp vec3 worldNorm, in Lamp lamp[4], inout mediump vec3 hybridDir, inout mediump vec3 hybridCol ) { + mediump vec4 atten; + highp int i = 0; + for ( ; (i < 4); (i++)) { + + highp vec3 lightToVert = (lamp[i].posRange.xyz - worldVert); + highp float lengthSq = dot( lightToVert, lightToVert); + highp vec3 lightToVertNorm = (lightToVert * inversesqrt(lengthSq)); + + atten[i] = (lengthSq * lamp[i].posRange.w); + mediump float nDotL = dot( lightToVertNorm, worldNorm); + mediump float weight = (atten[i] * nDotL); + } + + highp int j = 0; + for ( ; (j < 4); (j++)) { + hybridCol += (lamp[j].colorImp.xyz * atten[j]); + } +} +void LoadBakedLight( out mediump vec3 hybridCol, out mediump vec3 hybridDir ) { +} +mediump vec4 DoSampleGPUBuffer( in sampler2D buffer, in mediump vec2 coord, in mediump vec2 dimensions ) { + return xll_tex2Dlod( buffer, vec4( (coord / dimensions), 0.0, 0.0)); +} +void ReadLightArray3( in highp ivec4 lightIdx, out Lamp l0, out Lamp l1, out Lamp l2, out Lamp l3 ) { + + l0.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.x), 1.0), _DynLampInfo_bufferSize); + l0.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.x), 2.0), _DynLampInfo_bufferSize); + l1.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.y), 1.0), _DynLampInfo_bufferSize); + + l1.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.y), 2.0), _DynLampInfo_bufferSize); + l2.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.z), 1.0), _DynLampInfo_bufferSize); + l2.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.z), 2.0), _DynLampInfo_bufferSize); + + l3.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.w), 1.0), _DynLampInfo_bufferSize); + l3.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.w), 2.0), _DynLampInfo_bufferSize); +} +void DoCalcHybridLight2( in highp vec3 worldVert, in highp vec3 worldNorm, out mediump vec3 hybridCol, in lowp vec4 bakedColor, in mediump vec2 bakedDir ) { + mediump vec3 hybridDir; + LoadBakedLight( hybridCol, hybridDir); + + highp ivec4 lightIdx = ivec4( int(worldVert.x), int(worldVert.y), int(worldVert.z), int((-worldVert.x))); + Lamp l[4]; + ReadLightArray3( lightIdx, l[0], l[1], l[2], l[3]); + + CalcDynamicLight( worldVert, worldNorm, l, hybridDir, hybridCol); +} +highp vec3 CalcDiffuseHybridLight( in highp vec3 worldVert, in highp vec3 worldNorm, in mediump vec4 bakedColor, in mediump vec2 bakedDir ) { + mediump vec3 hybridCol; + DoCalcHybridLight2( worldVert, worldNorm, hybridCol, bakedColor, bakedDir); + + return hybridCol; +} +v2f vert( in HybridAppData v ) { + v2f o; + + highp vec3 worldVert = (_Object2World * v.vertex).xyz; + highp vec3 worldNorm = normalize((mat3( _Object2World) * v.normal.xyz)); + o.diffuse = CalcDiffuseHybridLight( worldVert, worldNorm, v.bakedCol, v.bakedDir); + + o.pos = (glstate_matrix_mvp * v.vertex); + return o; +} + +out mediump vec3 xlv_TEXCOORD2; +void main() { + v2f xl_retval; + HybridAppData xlt_v; + xlt_v.vertex = vec4(gl_Vertex); + xlt_v.tangent = vec4(TANGENT); + xlt_v.normal = vec3(gl_Normal); + xlt_v.texcoord = vec4(gl_MultiTexCoord0); + xlt_v.bakedCol = vec4(gl_Color); + xlt_v.bakedDir = vec2(gl_MultiTexCoord1); + xl_retval = vert( xlt_v); + gl_Position = vec4(xl_retval.pos); + xlv_TEXCOORD2 = vec3(xl_retval.diffuse); +} diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-out.txt new file mode 100644 index 00000000000..64b42b38c57 --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-out.txt @@ -0,0 +1,109 @@ +uniform mat4 _Object2World; +uniform vec2 _DynLampInfo_bufferSize; +uniform sampler2D _DynLampInfo; +varying vec3 xlv_TEXCOORD2; +void main () +{ + vec3 tmpvar_1; + tmpvar_1 = (_Object2World * gl_Vertex).xyz; + vec3 hybridCol_2; + ivec4 tmpvar_3; + tmpvar_3.xyz = ivec3(tmpvar_1); + tmpvar_3.w = int(-(tmpvar_1.x)); + vec4 tmpvar_4; + vec4 tmpvar_5; + vec4 tmpvar_6; + vec4 tmpvar_7; + vec2 tmpvar_8; + tmpvar_8.y = 1.0; + tmpvar_8.x = float(tmpvar_3.x); + vec4 tmpvar_9; + tmpvar_9.zw = vec2(0.0, 0.0); + tmpvar_9.xy = (tmpvar_8 / _DynLampInfo_bufferSize); + tmpvar_4 = texture2DLod (_DynLampInfo, tmpvar_9.xy, 0.0); + vec2 tmpvar_10; + tmpvar_10.y = 2.0; + tmpvar_10.x = float(tmpvar_3.x); + vec4 tmpvar_11; + tmpvar_11.zw = vec2(0.0, 0.0); + tmpvar_11.xy = (tmpvar_10 / _DynLampInfo_bufferSize); + vec2 tmpvar_12; + tmpvar_12.y = 1.0; + tmpvar_12.x = float(tmpvar_3.y); + vec4 tmpvar_13; + tmpvar_13.zw = vec2(0.0, 0.0); + tmpvar_13.xy = (tmpvar_12 / _DynLampInfo_bufferSize); + tmpvar_5 = texture2DLod (_DynLampInfo, tmpvar_13.xy, 0.0); + vec2 tmpvar_14; + tmpvar_14.y = 2.0; + tmpvar_14.x = float(tmpvar_3.y); + vec4 tmpvar_15; + tmpvar_15.zw = vec2(0.0, 0.0); + tmpvar_15.xy = (tmpvar_14 / _DynLampInfo_bufferSize); + vec2 tmpvar_16; + tmpvar_16.y = 1.0; + tmpvar_16.x = float(tmpvar_3.z); + vec4 tmpvar_17; + tmpvar_17.zw = vec2(0.0, 0.0); + tmpvar_17.xy = (tmpvar_16 / _DynLampInfo_bufferSize); + tmpvar_6 = texture2DLod (_DynLampInfo, tmpvar_17.xy, 0.0); + vec2 tmpvar_18; + tmpvar_18.y = 2.0; + tmpvar_18.x = float(tmpvar_3.z); + vec4 tmpvar_19; + tmpvar_19.zw = vec2(0.0, 0.0); + tmpvar_19.xy = (tmpvar_18 / _DynLampInfo_bufferSize); + vec2 tmpvar_20; + tmpvar_20.y = 1.0; + tmpvar_20.x = float(tmpvar_3.w); + vec4 tmpvar_21; + tmpvar_21.zw = vec2(0.0, 0.0); + tmpvar_21.xy = (tmpvar_20 / _DynLampInfo_bufferSize); + tmpvar_7 = texture2DLod (_DynLampInfo, tmpvar_21.xy, 0.0); + vec2 tmpvar_22; + tmpvar_22.y = 2.0; + tmpvar_22.x = float(tmpvar_3.w); + vec4 tmpvar_23; + tmpvar_23.zw = vec2(0.0, 0.0); + tmpvar_23.xy = (tmpvar_22 / _DynLampInfo_bufferSize); + vec3 hybridCol_24; + vec4 atten_25; + vec3 tmpvar_26; + tmpvar_26 = (tmpvar_4.xyz - tmpvar_1); + vec4 tmpvar_27; + tmpvar_27.yzw = atten_25.yzw; + tmpvar_27.x = (dot (tmpvar_26, tmpvar_26) * tmpvar_4.w); + vec3 tmpvar_28; + tmpvar_28 = (tmpvar_5.xyz - tmpvar_1); + vec4 tmpvar_29; + tmpvar_29.xzw = tmpvar_27.xzw; + tmpvar_29.y = (dot (tmpvar_28, tmpvar_28) * tmpvar_5.w); + vec3 tmpvar_30; + tmpvar_30 = (tmpvar_6.xyz - tmpvar_1); + vec4 tmpvar_31; + tmpvar_31.xyw = tmpvar_29.xyw; + tmpvar_31.z = (dot (tmpvar_30, tmpvar_30) * tmpvar_6.w); + vec3 tmpvar_32; + tmpvar_32 = (tmpvar_7.xyz - tmpvar_1); + vec4 tmpvar_33; + tmpvar_33.xyz = tmpvar_31.xyz; + tmpvar_33.w = (dot (tmpvar_32, tmpvar_32) * tmpvar_7.w); + atten_25 = tmpvar_33; + hybridCol_24 = (hybridCol_2 + (texture2DLod (_DynLampInfo, tmpvar_11.xy, 0.0).xyz * tmpvar_27.x)); + hybridCol_24 = (hybridCol_24 + (texture2DLod (_DynLampInfo, tmpvar_15.xy, 0.0).xyz * tmpvar_29.y)); + hybridCol_24 = (hybridCol_24 + (texture2DLod (_DynLampInfo, tmpvar_19.xy, 0.0).xyz * tmpvar_31.z)); + hybridCol_24 = (hybridCol_24 + (texture2DLod (_DynLampInfo, tmpvar_23.xy, 0.0).xyz * tmpvar_33.w)); + gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); + xlv_TEXCOORD2 = hybridCol_24; +} + + +// stats: 57 alu 8 tex 0 flow +// inputs: 1 +// #0: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 3 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _Object2World (high float) 4x4 [-1] +// #2: _DynLampInfo_bufferSize (high float) 2x1 [-1] +// textures: 1 +// #0: _DynLampInfo (high 2d) 0x0 [-1] diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES.txt new file mode 100644 index 00000000000..692c217222e --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES.txt @@ -0,0 +1,163 @@ +attribute vec4 _glesVertex; +uniform highp mat4 glstate_matrix_mvp; +uniform highp mat4 _Object2World; +uniform mediump vec2 _DynLampInfo_bufferSize; +uniform sampler2D _DynLampInfo; +varying mediump vec3 xlv_TEXCOORD2; +void main () +{ + mediump vec3 tmpvar_1; + highp vec3 tmpvar_2; + tmpvar_2 = (_Object2World * _glesVertex).xyz; + highp vec3 tmpvar_3; + mediump vec3 hybridCol_4; + highp ivec4 tmpvar_5; + tmpvar_5.xyz = ivec3(tmpvar_2); + tmpvar_5.w = int(-(tmpvar_2.x)); + highp vec2 tmpvar_6; + tmpvar_6.y = 1.0; + tmpvar_6.x = float(tmpvar_5.x); + mediump vec4 tmpvar_7; + mediump vec2 coord_8; + coord_8 = tmpvar_6; + mediump vec4 tmpvar_9; + tmpvar_9.zw = vec2(0.0, 0.0); + tmpvar_9.xy = (coord_8 / _DynLampInfo_bufferSize); + lowp vec4 tmpvar_10; + tmpvar_10 = texture2DLod (_DynLampInfo, tmpvar_9.xy, 0.0); + tmpvar_7 = tmpvar_10; + highp vec2 tmpvar_11; + tmpvar_11.y = 2.0; + tmpvar_11.x = float(tmpvar_5.x); + mediump vec4 tmpvar_12; + mediump vec2 coord_13; + coord_13 = tmpvar_11; + mediump vec4 tmpvar_14; + tmpvar_14.zw = vec2(0.0, 0.0); + tmpvar_14.xy = (coord_13 / _DynLampInfo_bufferSize); + lowp vec4 tmpvar_15; + tmpvar_15 = texture2DLod (_DynLampInfo, tmpvar_14.xy, 0.0); + tmpvar_12 = tmpvar_15; + highp vec2 tmpvar_16; + tmpvar_16.y = 1.0; + tmpvar_16.x = float(tmpvar_5.y); + mediump vec4 tmpvar_17; + mediump vec2 coord_18; + coord_18 = tmpvar_16; + mediump vec4 tmpvar_19; + tmpvar_19.zw = vec2(0.0, 0.0); + tmpvar_19.xy = (coord_18 / _DynLampInfo_bufferSize); + lowp vec4 tmpvar_20; + tmpvar_20 = texture2DLod (_DynLampInfo, tmpvar_19.xy, 0.0); + tmpvar_17 = tmpvar_20; + highp vec2 tmpvar_21; + tmpvar_21.y = 2.0; + tmpvar_21.x = float(tmpvar_5.y); + mediump vec4 tmpvar_22; + mediump vec2 coord_23; + coord_23 = tmpvar_21; + mediump vec4 tmpvar_24; + tmpvar_24.zw = vec2(0.0, 0.0); + tmpvar_24.xy = (coord_23 / _DynLampInfo_bufferSize); + lowp vec4 tmpvar_25; + tmpvar_25 = texture2DLod (_DynLampInfo, tmpvar_24.xy, 0.0); + tmpvar_22 = tmpvar_25; + highp vec2 tmpvar_26; + tmpvar_26.y = 1.0; + tmpvar_26.x = float(tmpvar_5.z); + mediump vec4 tmpvar_27; + mediump vec2 coord_28; + coord_28 = tmpvar_26; + mediump vec4 tmpvar_29; + tmpvar_29.zw = vec2(0.0, 0.0); + tmpvar_29.xy = (coord_28 / _DynLampInfo_bufferSize); + lowp vec4 tmpvar_30; + tmpvar_30 = texture2DLod (_DynLampInfo, tmpvar_29.xy, 0.0); + tmpvar_27 = tmpvar_30; + highp vec2 tmpvar_31; + tmpvar_31.y = 2.0; + tmpvar_31.x = float(tmpvar_5.z); + mediump vec4 tmpvar_32; + mediump vec2 coord_33; + coord_33 = tmpvar_31; + mediump vec4 tmpvar_34; + tmpvar_34.zw = vec2(0.0, 0.0); + tmpvar_34.xy = (coord_33 / _DynLampInfo_bufferSize); + lowp vec4 tmpvar_35; + tmpvar_35 = texture2DLod (_DynLampInfo, tmpvar_34.xy, 0.0); + tmpvar_32 = tmpvar_35; + highp vec2 tmpvar_36; + tmpvar_36.y = 1.0; + tmpvar_36.x = float(tmpvar_5.w); + mediump vec4 tmpvar_37; + mediump vec2 coord_38; + coord_38 = tmpvar_36; + mediump vec4 tmpvar_39; + tmpvar_39.zw = vec2(0.0, 0.0); + tmpvar_39.xy = (coord_38 / _DynLampInfo_bufferSize); + lowp vec4 tmpvar_40; + tmpvar_40 = texture2DLod (_DynLampInfo, tmpvar_39.xy, 0.0); + tmpvar_37 = tmpvar_40; + highp vec2 tmpvar_41; + tmpvar_41.y = 2.0; + tmpvar_41.x = float(tmpvar_5.w); + mediump vec4 tmpvar_42; + mediump vec2 coord_43; + coord_43 = tmpvar_41; + mediump vec4 tmpvar_44; + tmpvar_44.zw = vec2(0.0, 0.0); + tmpvar_44.xy = (coord_43 / _DynLampInfo_bufferSize); + lowp vec4 tmpvar_45; + tmpvar_45 = texture2DLod (_DynLampInfo, tmpvar_44.xy, 0.0); + tmpvar_42 = tmpvar_45; + mediump vec3 hybridCol_46; + mediump vec4 atten_47; + highp vec3 tmpvar_48; + tmpvar_48 = (tmpvar_7.xyz - tmpvar_2); + highp float tmpvar_49; + tmpvar_49 = dot (tmpvar_48, tmpvar_48); + mediump vec4 tmpvar_50; + tmpvar_50.yzw = atten_47.yzw; + tmpvar_50.x = (tmpvar_49 * tmpvar_7.w); + highp vec3 tmpvar_51; + tmpvar_51 = (tmpvar_17.xyz - tmpvar_2); + highp float tmpvar_52; + tmpvar_52 = dot (tmpvar_51, tmpvar_51); + mediump vec4 tmpvar_53; + tmpvar_53.xzw = tmpvar_50.xzw; + tmpvar_53.y = (tmpvar_52 * tmpvar_17.w); + highp vec3 tmpvar_54; + tmpvar_54 = (tmpvar_27.xyz - tmpvar_2); + highp float tmpvar_55; + tmpvar_55 = dot (tmpvar_54, tmpvar_54); + mediump vec4 tmpvar_56; + tmpvar_56.xyw = tmpvar_53.xyw; + tmpvar_56.z = (tmpvar_55 * tmpvar_27.w); + highp vec3 tmpvar_57; + tmpvar_57 = (tmpvar_37.xyz - tmpvar_2); + highp float tmpvar_58; + tmpvar_58 = dot (tmpvar_57, tmpvar_57); + mediump vec4 tmpvar_59; + tmpvar_59.xyz = tmpvar_56.xyz; + tmpvar_59.w = (tmpvar_58 * tmpvar_37.w); + atten_47 = tmpvar_59; + hybridCol_46 = (hybridCol_4 + (tmpvar_12.xyz * tmpvar_50.x)); + hybridCol_46 = (hybridCol_46 + (tmpvar_22.xyz * tmpvar_53.y)); + hybridCol_46 = (hybridCol_46 + (tmpvar_32.xyz * tmpvar_56.z)); + hybridCol_46 = (hybridCol_46 + (tmpvar_42.xyz * tmpvar_59.w)); + tmpvar_3 = hybridCol_46; + tmpvar_1 = tmpvar_3; + gl_Position = (glstate_matrix_mvp * _glesVertex); + xlv_TEXCOORD2 = tmpvar_1; +} + + +// stats: 57 alu 8 tex 0 flow +// inputs: 1 +// #0: _glesVertex (high float) 4x1 [-1] +// uniforms: 3 (total size: 0) +// #0: glstate_matrix_mvp (high float) 4x4 [-1] +// #1: _Object2World (high float) 4x4 [-1] +// #2: _DynLampInfo_bufferSize (medium float) 2x1 [-1] +// textures: 1 +// #0: _DynLampInfo (low 2d) 0x0 [-1] diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3.txt new file mode 100644 index 00000000000..dc583a7a2c9 --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3.txt @@ -0,0 +1,164 @@ +#version 300 es +in vec4 _glesVertex; +uniform highp mat4 glstate_matrix_mvp; +uniform highp mat4 _Object2World; +uniform mediump vec2 _DynLampInfo_bufferSize; +uniform sampler2D _DynLampInfo; +out mediump vec3 xlv_TEXCOORD2; +void main () +{ + mediump vec3 tmpvar_1; + highp vec3 tmpvar_2; + tmpvar_2 = (_Object2World * _glesVertex).xyz; + highp vec3 tmpvar_3; + mediump vec3 hybridCol_4; + highp ivec4 tmpvar_5; + tmpvar_5.xyz = ivec3(tmpvar_2); + tmpvar_5.w = int(-(tmpvar_2.x)); + highp vec2 tmpvar_6; + tmpvar_6.y = 1.0; + tmpvar_6.x = float(tmpvar_5.x); + mediump vec4 tmpvar_7; + mediump vec2 coord_8; + coord_8 = tmpvar_6; + mediump vec4 tmpvar_9; + tmpvar_9.zw = vec2(0.0, 0.0); + tmpvar_9.xy = (coord_8 / _DynLampInfo_bufferSize); + lowp vec4 tmpvar_10; + tmpvar_10 = textureLod (_DynLampInfo, tmpvar_9.xy, 0.0); + tmpvar_7 = tmpvar_10; + highp vec2 tmpvar_11; + tmpvar_11.y = 2.0; + tmpvar_11.x = float(tmpvar_5.x); + mediump vec4 tmpvar_12; + mediump vec2 coord_13; + coord_13 = tmpvar_11; + mediump vec4 tmpvar_14; + tmpvar_14.zw = vec2(0.0, 0.0); + tmpvar_14.xy = (coord_13 / _DynLampInfo_bufferSize); + lowp vec4 tmpvar_15; + tmpvar_15 = textureLod (_DynLampInfo, tmpvar_14.xy, 0.0); + tmpvar_12 = tmpvar_15; + highp vec2 tmpvar_16; + tmpvar_16.y = 1.0; + tmpvar_16.x = float(tmpvar_5.y); + mediump vec4 tmpvar_17; + mediump vec2 coord_18; + coord_18 = tmpvar_16; + mediump vec4 tmpvar_19; + tmpvar_19.zw = vec2(0.0, 0.0); + tmpvar_19.xy = (coord_18 / _DynLampInfo_bufferSize); + lowp vec4 tmpvar_20; + tmpvar_20 = textureLod (_DynLampInfo, tmpvar_19.xy, 0.0); + tmpvar_17 = tmpvar_20; + highp vec2 tmpvar_21; + tmpvar_21.y = 2.0; + tmpvar_21.x = float(tmpvar_5.y); + mediump vec4 tmpvar_22; + mediump vec2 coord_23; + coord_23 = tmpvar_21; + mediump vec4 tmpvar_24; + tmpvar_24.zw = vec2(0.0, 0.0); + tmpvar_24.xy = (coord_23 / _DynLampInfo_bufferSize); + lowp vec4 tmpvar_25; + tmpvar_25 = textureLod (_DynLampInfo, tmpvar_24.xy, 0.0); + tmpvar_22 = tmpvar_25; + highp vec2 tmpvar_26; + tmpvar_26.y = 1.0; + tmpvar_26.x = float(tmpvar_5.z); + mediump vec4 tmpvar_27; + mediump vec2 coord_28; + coord_28 = tmpvar_26; + mediump vec4 tmpvar_29; + tmpvar_29.zw = vec2(0.0, 0.0); + tmpvar_29.xy = (coord_28 / _DynLampInfo_bufferSize); + lowp vec4 tmpvar_30; + tmpvar_30 = textureLod (_DynLampInfo, tmpvar_29.xy, 0.0); + tmpvar_27 = tmpvar_30; + highp vec2 tmpvar_31; + tmpvar_31.y = 2.0; + tmpvar_31.x = float(tmpvar_5.z); + mediump vec4 tmpvar_32; + mediump vec2 coord_33; + coord_33 = tmpvar_31; + mediump vec4 tmpvar_34; + tmpvar_34.zw = vec2(0.0, 0.0); + tmpvar_34.xy = (coord_33 / _DynLampInfo_bufferSize); + lowp vec4 tmpvar_35; + tmpvar_35 = textureLod (_DynLampInfo, tmpvar_34.xy, 0.0); + tmpvar_32 = tmpvar_35; + highp vec2 tmpvar_36; + tmpvar_36.y = 1.0; + tmpvar_36.x = float(tmpvar_5.w); + mediump vec4 tmpvar_37; + mediump vec2 coord_38; + coord_38 = tmpvar_36; + mediump vec4 tmpvar_39; + tmpvar_39.zw = vec2(0.0, 0.0); + tmpvar_39.xy = (coord_38 / _DynLampInfo_bufferSize); + lowp vec4 tmpvar_40; + tmpvar_40 = textureLod (_DynLampInfo, tmpvar_39.xy, 0.0); + tmpvar_37 = tmpvar_40; + highp vec2 tmpvar_41; + tmpvar_41.y = 2.0; + tmpvar_41.x = float(tmpvar_5.w); + mediump vec4 tmpvar_42; + mediump vec2 coord_43; + coord_43 = tmpvar_41; + mediump vec4 tmpvar_44; + tmpvar_44.zw = vec2(0.0, 0.0); + tmpvar_44.xy = (coord_43 / _DynLampInfo_bufferSize); + lowp vec4 tmpvar_45; + tmpvar_45 = textureLod (_DynLampInfo, tmpvar_44.xy, 0.0); + tmpvar_42 = tmpvar_45; + mediump vec3 hybridCol_46; + mediump vec4 atten_47; + highp vec3 tmpvar_48; + tmpvar_48 = (tmpvar_7.xyz - tmpvar_2); + highp float tmpvar_49; + tmpvar_49 = dot (tmpvar_48, tmpvar_48); + mediump vec4 tmpvar_50; + tmpvar_50.yzw = atten_47.yzw; + tmpvar_50.x = (tmpvar_49 * tmpvar_7.w); + highp vec3 tmpvar_51; + tmpvar_51 = (tmpvar_17.xyz - tmpvar_2); + highp float tmpvar_52; + tmpvar_52 = dot (tmpvar_51, tmpvar_51); + mediump vec4 tmpvar_53; + tmpvar_53.xzw = tmpvar_50.xzw; + tmpvar_53.y = (tmpvar_52 * tmpvar_17.w); + highp vec3 tmpvar_54; + tmpvar_54 = (tmpvar_27.xyz - tmpvar_2); + highp float tmpvar_55; + tmpvar_55 = dot (tmpvar_54, tmpvar_54); + mediump vec4 tmpvar_56; + tmpvar_56.xyw = tmpvar_53.xyw; + tmpvar_56.z = (tmpvar_55 * tmpvar_27.w); + highp vec3 tmpvar_57; + tmpvar_57 = (tmpvar_37.xyz - tmpvar_2); + highp float tmpvar_58; + tmpvar_58 = dot (tmpvar_57, tmpvar_57); + mediump vec4 tmpvar_59; + tmpvar_59.xyz = tmpvar_56.xyz; + tmpvar_59.w = (tmpvar_58 * tmpvar_37.w); + atten_47 = tmpvar_59; + hybridCol_46 = (hybridCol_4 + (tmpvar_12.xyz * tmpvar_50.x)); + hybridCol_46 = (hybridCol_46 + (tmpvar_22.xyz * tmpvar_53.y)); + hybridCol_46 = (hybridCol_46 + (tmpvar_32.xyz * tmpvar_56.z)); + hybridCol_46 = (hybridCol_46 + (tmpvar_42.xyz * tmpvar_59.w)); + tmpvar_3 = hybridCol_46; + tmpvar_1 = tmpvar_3; + gl_Position = (glstate_matrix_mvp * _glesVertex); + xlv_TEXCOORD2 = tmpvar_1; +} + + +// stats: 57 alu 8 tex 0 flow +// inputs: 1 +// #0: _glesVertex (high float) 4x1 [-1] +// uniforms: 3 (total size: 0) +// #0: glstate_matrix_mvp (high float) 4x4 [-1] +// #1: _Object2World (high float) 4x4 [-1] +// #2: _DynLampInfo_bufferSize (medium float) 2x1 [-1] +// textures: 1 +// #0: _DynLampInfo (low 2d) 0x0 [-1] diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3Metal.txt new file mode 100644 index 00000000000..a8e3d7ef567 --- /dev/null +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3Metal.txt @@ -0,0 +1,174 @@ +#include <metal_stdlib> +using namespace metal; +struct xlatMtlShaderInput { + float4 _glesVertex [[attribute(0)]]; +}; +struct xlatMtlShaderOutput { + float4 gl_Position [[position]]; + half3 xlv_TEXCOORD2; +}; +struct xlatMtlShaderUniform { + float4x4 glstate_matrix_mvp; + float4x4 _Object2World; + half2 _DynLampInfo_bufferSize; +}; +vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , texture2d<half> _DynLampInfo [[texture(0)]], sampler _mtlsmp__DynLampInfo [[sampler(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + half3 tmpvar_1; + float3 tmpvar_2; + tmpvar_2 = (_mtl_u._Object2World * _mtl_i._glesVertex).xyz; + float3 tmpvar_3; + half3 hybridCol_4; + int4 tmpvar_5; + tmpvar_5.xyz = int3(tmpvar_2); + tmpvar_5.w = int(-(tmpvar_2.x)); + float2 tmpvar_6; + tmpvar_6.y = 1.0; + tmpvar_6.x = float(tmpvar_5.x); + half4 tmpvar_7; + half2 coord_8; + coord_8 = half2(tmpvar_6); + half4 tmpvar_9; + tmpvar_9.zw = half2(float2(0.0, 0.0)); + tmpvar_9.xy = (coord_8 / _mtl_u._DynLampInfo_bufferSize); + half4 tmpvar_10; + tmpvar_10 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_9.xy), level(0.0)); + tmpvar_7 = tmpvar_10; + float2 tmpvar_11; + tmpvar_11.y = 2.0; + tmpvar_11.x = float(tmpvar_5.x); + half4 tmpvar_12; + half2 coord_13; + coord_13 = half2(tmpvar_11); + half4 tmpvar_14; + tmpvar_14.zw = half2(float2(0.0, 0.0)); + tmpvar_14.xy = (coord_13 / _mtl_u._DynLampInfo_bufferSize); + half4 tmpvar_15; + tmpvar_15 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_14.xy), level(0.0)); + tmpvar_12 = tmpvar_15; + float2 tmpvar_16; + tmpvar_16.y = 1.0; + tmpvar_16.x = float(tmpvar_5.y); + half4 tmpvar_17; + half2 coord_18; + coord_18 = half2(tmpvar_16); + half4 tmpvar_19; + tmpvar_19.zw = half2(float2(0.0, 0.0)); + tmpvar_19.xy = (coord_18 / _mtl_u._DynLampInfo_bufferSize); + half4 tmpvar_20; + tmpvar_20 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_19.xy), level(0.0)); + tmpvar_17 = tmpvar_20; + float2 tmpvar_21; + tmpvar_21.y = 2.0; + tmpvar_21.x = float(tmpvar_5.y); + half4 tmpvar_22; + half2 coord_23; + coord_23 = half2(tmpvar_21); + half4 tmpvar_24; + tmpvar_24.zw = half2(float2(0.0, 0.0)); + tmpvar_24.xy = (coord_23 / _mtl_u._DynLampInfo_bufferSize); + half4 tmpvar_25; + tmpvar_25 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_24.xy), level(0.0)); + tmpvar_22 = tmpvar_25; + float2 tmpvar_26; + tmpvar_26.y = 1.0; + tmpvar_26.x = float(tmpvar_5.z); + half4 tmpvar_27; + half2 coord_28; + coord_28 = half2(tmpvar_26); + half4 tmpvar_29; + tmpvar_29.zw = half2(float2(0.0, 0.0)); + tmpvar_29.xy = (coord_28 / _mtl_u._DynLampInfo_bufferSize); + half4 tmpvar_30; + tmpvar_30 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_29.xy), level(0.0)); + tmpvar_27 = tmpvar_30; + float2 tmpvar_31; + tmpvar_31.y = 2.0; + tmpvar_31.x = float(tmpvar_5.z); + half4 tmpvar_32; + half2 coord_33; + coord_33 = half2(tmpvar_31); + half4 tmpvar_34; + tmpvar_34.zw = half2(float2(0.0, 0.0)); + tmpvar_34.xy = (coord_33 / _mtl_u._DynLampInfo_bufferSize); + half4 tmpvar_35; + tmpvar_35 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_34.xy), level(0.0)); + tmpvar_32 = tmpvar_35; + float2 tmpvar_36; + tmpvar_36.y = 1.0; + tmpvar_36.x = float(tmpvar_5.w); + half4 tmpvar_37; + half2 coord_38; + coord_38 = half2(tmpvar_36); + half4 tmpvar_39; + tmpvar_39.zw = half2(float2(0.0, 0.0)); + tmpvar_39.xy = (coord_38 / _mtl_u._DynLampInfo_bufferSize); + half4 tmpvar_40; + tmpvar_40 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_39.xy), level(0.0)); + tmpvar_37 = tmpvar_40; + float2 tmpvar_41; + tmpvar_41.y = 2.0; + tmpvar_41.x = float(tmpvar_5.w); + half4 tmpvar_42; + half2 coord_43; + coord_43 = half2(tmpvar_41); + half4 tmpvar_44; + tmpvar_44.zw = half2(float2(0.0, 0.0)); + tmpvar_44.xy = (coord_43 / _mtl_u._DynLampInfo_bufferSize); + half4 tmpvar_45; + tmpvar_45 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_44.xy), level(0.0)); + tmpvar_42 = tmpvar_45; + half3 hybridCol_46; + half4 atten_47; + float3 tmpvar_48; + tmpvar_48 = ((float3)tmpvar_7.xyz - tmpvar_2); + float tmpvar_49; + tmpvar_49 = dot (tmpvar_48, tmpvar_48); + half4 tmpvar_50; + tmpvar_50.yzw = atten_47.yzw; + tmpvar_50.x = half((tmpvar_49 * (float)tmpvar_7.w)); + float3 tmpvar_51; + tmpvar_51 = ((float3)tmpvar_17.xyz - tmpvar_2); + float tmpvar_52; + tmpvar_52 = dot (tmpvar_51, tmpvar_51); + half4 tmpvar_53; + tmpvar_53.xzw = tmpvar_50.xzw; + tmpvar_53.y = half((tmpvar_52 * (float)tmpvar_17.w)); + float3 tmpvar_54; + tmpvar_54 = ((float3)tmpvar_27.xyz - tmpvar_2); + float tmpvar_55; + tmpvar_55 = dot (tmpvar_54, tmpvar_54); + half4 tmpvar_56; + tmpvar_56.xyw = tmpvar_53.xyw; + tmpvar_56.z = half((tmpvar_55 * (float)tmpvar_27.w)); + float3 tmpvar_57; + tmpvar_57 = ((float3)tmpvar_37.xyz - tmpvar_2); + float tmpvar_58; + tmpvar_58 = dot (tmpvar_57, tmpvar_57); + half4 tmpvar_59; + tmpvar_59.xyz = tmpvar_56.xyz; + tmpvar_59.w = half((tmpvar_58 * (float)tmpvar_37.w)); + atten_47 = tmpvar_59; + hybridCol_46 = (hybridCol_4 + (tmpvar_12.xyz * tmpvar_50.x)); + hybridCol_46 = (hybridCol_46 + (tmpvar_22.xyz * tmpvar_53.y)); + hybridCol_46 = (hybridCol_46 + (tmpvar_32.xyz * tmpvar_56.z)); + hybridCol_46 = (hybridCol_46 + (tmpvar_42.xyz * tmpvar_59.w)); + tmpvar_3 = float3(hybridCol_46); + tmpvar_1 = half3(tmpvar_3); + _mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * _mtl_i._glesVertex); + _mtl_o.xlv_TEXCOORD2 = tmpvar_1; + return _mtl_o; +} + + +// stats: 57 alu 8 tex 0 flow +// inputs: 1 +// #0: _glesVertex (high float) 4x1 [-1] loc 0 +// uniforms: 3 (total size: 132) +// #0: glstate_matrix_mvp (high float) 4x4 [-1] loc 0 +// #1: _Object2World (high float) 4x4 [-1] loc 64 +// #2: _DynLampInfo_bufferSize (medium float) 2x1 [-1] loc 128 +// textures: 1 +// #0: _DynLampInfo (low 2d) 0x0 [-1] loc 0 diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES3.txt index 3e7a98c5887..f5b1b028ee8 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES3.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES3.txt @@ -103,9 +103,9 @@ void main () tmpvar_6.xyz = normalize(tmpvar_14.xyz); binormal_4 = (((tmpvar_26.yzx * tmpvar_6.zxy) - (tmpvar_26.zxy * tmpvar_6.yzx)) * tmpvar_14.w); highp mat3 tmpvar_27; - tmpvar_27[0u].x = tmpvar_6.x; - tmpvar_27[0u].y = binormal_4.x; - tmpvar_27[0u].z = tmpvar_26.x; + tmpvar_27[uint(0)].x = tmpvar_6.x; + tmpvar_27[uint(0)].y = binormal_4.x; + tmpvar_27[uint(0)].z = tmpvar_26.x; tmpvar_27[1u].x = tmpvar_6.y; tmpvar_27[1u].y = binormal_4.y; tmpvar_27[1u].z = tmpvar_26.y; diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt index d56ff7840d9..eae958b8dca 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt @@ -68,7 +68,7 @@ void main () ) + (r2_16 * 0.0083333)) + ((r2_16 * r5_18) * -0.00019841)); s_11 = (s_15 * s_15); s_11 = (s_11 * s_11); - lighting_10 = (dot (s_11, vec4(0.6742, 0.6742, 0.26968, 0.13484)) * 0.7); + lighting_10 = (dot (s_11, vec4(0.6741998, 0.6741998, 0.2696799, 0.13484)) * 0.7); s_11 = (s_11 * TANGENT.y); waveMove_9.x = dot (s_11, vec4(0.024, 0.04, -0.12, 0.096)); waveMove_9.z = dot (s_11, vec4(0.006, 0.02, -0.02, 0.1)); diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt index 0da783fb5ab..29d43c82105 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt @@ -53,7 +53,7 @@ void main () ) + (r2_14 * 0.0083333)) + ((r2_14 * r5_16) * -0.00019841)); s_9 = (s_13 * s_13); s_9 = (s_9 * s_9); - lighting_8 = (dot (s_9, vec4(0.6742, 0.6742, 0.26968, 0.13484)) * 0.7); + lighting_8 = (dot (s_9, vec4(0.6741998, 0.6741998, 0.2696799, 0.13484)) * 0.7); s_9 = (s_9 * TANGENT.y); waveMove_7.x = dot (s_9, vec4(0.024, 0.04, -0.12, 0.096)); waveMove_7.z = dot (s_9, vec4(0.006, 0.02, -0.02, 0.1)); diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt index 8c36a5e2f5b..75c27cd6b3c 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt @@ -51,7 +51,7 @@ void main () ) + (r2_16 * 0.0083333)) + ((r2_16 * r5_18) * -0.00019841)); s_11 = (s_15 * s_15); s_11 = (s_11 * s_11); - lighting_10 = (dot (s_11, vec4(0.6742, 0.6742, 0.26968, 0.13484)) * 0.7); + lighting_10 = (dot (s_11, vec4(0.6741998, 0.6741998, 0.2696799, 0.13484)) * 0.7); s_11 = (s_11 * TANGENT.y); waveMove_9.x = dot (s_11, vec4(0.024, 0.04, -0.12, 0.096)); waveMove_9.z = dot (s_11, vec4(0.006, 0.02, -0.02, 0.1)); diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt index 5054e1f23f6..f733b576756 100644 --- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt +++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt @@ -36,7 +36,7 @@ void main () ) + (r2_10 * 0.0083333)) + ((r2_10 * r5_12) * -0.00019841)); s_5 = (s_9 * s_9); s_5 = (s_5 * s_5); - lighting_4 = (dot (s_5, vec4(0.6742, 0.6742, 0.26968, 0.13484)) * 0.7); + lighting_4 = (dot (s_5, vec4(0.6741998, 0.6741998, 0.2696799, 0.13484)) * 0.7); s_5 = (s_5 * (gl_Color.w * _WaveAndDistance.z)); waveMove_3.x = dot (s_5, vec4(0.024, 0.04, -0.12, 0.096)); waveMove_3.z = dot (s_5, vec4(0.006, 0.02, -0.02, 0.1)); diff --git a/3rdparty/bgfx/3rdparty/khronos/gl/glext.h b/3rdparty/bgfx/3rdparty/khronos/gl/glext.h index 3e53f343202..40b78d9a0af 100644 --- a/3rdparty/bgfx/3rdparty/khronos/gl/glext.h +++ b/3rdparty/bgfx/3rdparty/khronos/gl/glext.h @@ -465,7 +465,7 @@ GLAPI void APIENTRY glBlendEquation (GLenum mode); #ifndef GL_VERSION_1_5 #define GL_VERSION_1_5 1 #include <stddef.h> -#if 0 //defined(__APPLE__) && defined(__i386__) +#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1090) typedef long GLsizeiptr; typedef long GLintptr; #else @@ -4135,7 +4135,7 @@ GLAPI void APIENTRY glVertexBlendARB (GLint count); #ifndef GL_ARB_vertex_buffer_object #define GL_ARB_vertex_buffer_object 1 -#if 0 // defined(__APPLE__) && defined(__i386__) +#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1090) typedef long GLsizeiptrARB; typedef long GLintptrARB; #else diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h index f4f36f1833e..dbea1bc0a45 100644 --- a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h +++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h @@ -44,7 +44,7 @@ typedef int ImGuiColorEditMode; // enum ImGuiColorEditMode_ typedef int ImGuiWindowFlags; // enum ImGuiWindowFlags_ typedef int ImGuiSetCond; // enum ImGuiSetCondition_ typedef int ImGuiInputTextFlags; // enum ImGuiInputTextFlags_ -struct ImGuiTextEditCallbackData; // for advanced uses of InputText() +struct ImGuiTextEditCallbackData; // for advanced uses of InputText() typedef int (*ImGuiTextEditCallback)(ImGuiTextEditCallbackData *data); struct ImVec2 @@ -76,7 +76,7 @@ namespace ImGui IMGUI_API void MemFree(void* ptr); } -// std::vector<> like class to avoid dragging dependencies (also: windows implementation of STL with debug enabled is absurdly slow, so let's bypass it so our code runs fast in debug). +// std::vector<> like class to avoid dragging dependencies (also: windows implementation of STL with debug enabled is absurdly slow, so let's bypass it so our code runs fast in debug). // Use '#define ImVector std::vector' if you want to use the STL type or your own type. // Our implementation does NOT call c++ constructors! because the data types we use don't need them (but that could be added as well). Only provide the minimum functionalities we need. #ifndef ImVector @@ -117,14 +117,14 @@ public: inline void swap(ImVector<T>& rhs) { const size_t rhs_size = rhs.Size; rhs.Size = Size; Size = rhs_size; const size_t rhs_cap = rhs.Capacity; rhs.Capacity = Capacity; Capacity = rhs_cap; value_type* rhs_data = rhs.Data; rhs.Data = Data; Data = rhs_data; } inline void resize(size_t new_size) { if (new_size > Capacity) reserve(new_size); Size = new_size; } - inline void reserve(size_t new_capacity) - { + inline void reserve(size_t new_capacity) + { if (new_capacity <= Capacity) return; T* new_data = (value_type*)ImGui::MemAlloc(new_capacity * sizeof(value_type)); memcpy(new_data, Data, Size * sizeof(value_type)); ImGui::MemFree(Data); Data = new_data; - Capacity = new_capacity; + Capacity = new_capacity; } inline void push_back(const value_type& v) { if (Size == Capacity) reserve(Capacity ? Capacity * 2 : 4); Data[Size++] = v; } @@ -262,7 +262,7 @@ namespace ImGui IMGUI_API void TextWrapped(const char* fmt, ...); // shortcut for PushTextWrapPos(0.0f); Text(fmt, ...); PopTextWrapPos(); IMGUI_API void TextWrappedV(const char* fmt, va_list args); IMGUI_API void TextUnformatted(const char* text, const char* text_end = NULL); // doesn't require null terminated string if 'text_end' is specified. no copy done to any bounded stack buffer, recommended for long chunks of text. - IMGUI_API void LabelText(const char* label, const char* fmt, ...); // display text+label aligned the same way as value+label widgets + IMGUI_API void LabelText(const char* label, const char* fmt, ...); // display text+label aligned the same way as value+label widgets IMGUI_API void LabelTextV(const char* label, const char* fmt, va_list args); IMGUI_API void Bullet(); IMGUI_API void BulletText(const char* fmt, ...); @@ -343,7 +343,7 @@ namespace ImGui // Utilities IMGUI_API bool IsItemHovered(); // was the last item hovered by mouse? IMGUI_API bool IsItemActive(); // was the last item active? (e.g. button being held, text field being edited- items that don't interact will always return false) - IMGUI_API bool IsAnyItemActive(); // + IMGUI_API bool IsAnyItemActive(); // IMGUI_API ImVec2 GetItemBoxMin(); // get bounding box of last item IMGUI_API ImVec2 GetItemBoxMax(); // get bounding box of last item IMGUI_API bool IsClipped(const ImVec2& item_size); // to perform coarse clipping on user's side (as an optimization) @@ -569,9 +569,9 @@ struct ImGuiIO // User Functions //------------------------------------------------------------------ - // REQUIRED: rendering function. + // REQUIRED: rendering function. // See example code if you are unsure of how to implement this. - void (*RenderDrawListsFn)(ImDrawList** const draw_lists, int count); + void (*RenderDrawListsFn)(ImDrawList** const draw_lists, int count); // Optional: access OS clipboard // (default to use native Win32 clipboard on Windows, otherwise uses a private clipboard. Override to access OS clipboard on other architectures) @@ -594,7 +594,7 @@ struct ImGuiIO ImVec2 MousePos; // Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.) bool MouseDown[5]; // Mouse buttons. ImGui itself only uses button 0 (left button). Others buttons allows to track if mouse is being used by your application + available to user as a convenience via IsMouse** API. - float MouseWheel; // Mouse wheel: 1 unit scrolls about 5 lines text. + float MouseWheel; // Mouse wheel: 1 unit scrolls about 5 lines text. bool MouseDrawCursor; // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor). bool KeyCtrl; // Keyboard modifier pressed: Control bool KeyShift; // Keyboard modifier pressed: Shift @@ -706,13 +706,13 @@ struct ImGuiTextBuffer // - You want to store custom debug data easily without adding or editing structures in your code. struct ImGuiStorage { - struct Pair - { - ImGuiID key; - union { int val_i; float val_f; void* val_p; }; - Pair(ImGuiID _key, int _val_i) { key = _key; val_i = _val_i; } - Pair(ImGuiID _key, float _val_f) { key = _key; val_f = _val_f; } - Pair(ImGuiID _key, void* _val_p) { key = _key; val_p = _val_p; } + struct Pair + { + ImGuiID key; + union { int val_i; float val_f; void* val_p; }; + Pair(ImGuiID _key, int _val_i) { key = _key; val_i = _val_i; } + Pair(ImGuiID _key, float _val_f) { key = _key; val_f = _val_f; } + Pair(ImGuiID _key, void* _val_p) { key = _key; val_p = _val_p; } }; ImVector<Pair> Data; @@ -727,7 +727,7 @@ struct ImGuiStorage IMGUI_API void* GetVoidPtr(ImGuiID key) const; // default_val is NULL IMGUI_API void SetVoidPtr(ImGuiID key, void* val); - // - Get***Ref() functions finds pair, insert on demand if missing, return pointer. Useful if you intend to do Get+Set. + // - Get***Ref() functions finds pair, insert on demand if missing, return pointer. Useful if you intend to do Get+Set. // - References are only valid until a new value is added to the storage. Calling a Set***() function or a Get***Ref() function invalidates the pointer. // - A typical use case where this is convenient: // float* pvar = ImGui::GetFloatRef(key); ImGui::SliderFloat("var", pvar, 0, 100.0f); some_var += *pvar; @@ -833,7 +833,7 @@ struct ImDrawList // [Internal to ImGui] ImVector<ImVec4> clip_rect_stack; // [Internal] - ImVector<ImTextureID> texture_id_stack; // [Internal] + ImVector<ImTextureID> texture_id_stack; // [Internal] ImDrawVert* vtx_write; // [Internal] point within vtx_buffer after each add command (to avoid using the ImVector<> operators too much) ImDrawList() { Clear(); } @@ -843,7 +843,7 @@ struct ImDrawList IMGUI_API void PushTextureID(const ImTextureID& texture_id); IMGUI_API void PopTextureID(); - // Primitives + // Primitives IMGUI_API void AddLine(const ImVec2& a, const ImVec2& b, ImU32 col); IMGUI_API void AddRect(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners=0x0F); IMGUI_API void AddRectFilled(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners=0x0F); diff --git a/3rdparty/bgfx/README.md b/3rdparty/bgfx/README.md index 91fd26ba496..ca7d0a4f034 100644 --- a/3rdparty/bgfx/README.md +++ b/3rdparty/bgfx/README.md @@ -309,6 +309,10 @@ N-body simulation with compute shaders using buffers.  +### [25-c99](https://github.com/bkaradzic/bgfx/tree/master/examples/25-c99) + +Initialization and debug text with C99 API. + Dependencies ------------ diff --git a/3rdparty/bgfx/examples/02-metaballs/fs_metaballs.bin.h b/3rdparty/bgfx/examples/02-metaballs/fs_metaballs.bin.h index 868a47d431a..b16df2ddf5f 100644 --- a/3rdparty/bgfx/examples/02-metaballs/fs_metaballs.bin.h +++ b/3rdparty/bgfx/examples/02-metaballs/fs_metaballs.bin.h @@ -1,6 +1,6 @@ -static const uint8_t fs_metaballs_glsl[393] = +static const uint8_t fs_metaballs_glsl[398] = { - 0x46, 0x53, 0x48, 0x03, 0x03, 0x2c, 0xf5, 0x3f, 0x00, 0x00, 0x7a, 0x01, 0x00, 0x00, 0x76, 0x61, // FSH..,.?..z...va + 0x46, 0x53, 0x48, 0x03, 0x03, 0x2c, 0xf5, 0x3f, 0x00, 0x00, 0x7f, 0x01, 0x00, 0x00, 0x76, 0x61, // FSH..,.?......va 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // rying highp vec4 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, // v_color0;.varyi 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x76, 0x5f, // ng highp vec3 v_ @@ -10,21 +10,21 @@ static const uint8_t fs_metaballs_glsl[393] = 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x64, 0x6f, 0x74, 0x20, // tmpvar_1 = dot 0x28, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x28, 0x76, 0x5f, 0x6e, 0x6f, 0x72, // (normalize(v_nor 0x6d, 0x61, 0x6c, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, // mal), vec3(0.0, - 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, // 0.0, -1.0));. h - 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // ighp vec4 tmpvar - 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x77, // _2;. tmpvar_2.w - 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // = 1.0;. tmpvar - 0x5f, 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x70, 0x6f, 0x77, 0x20, 0x28, 0x28, 0x28, // _2.xyz = pow ((( - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x6f, 0x77, 0x20, 0x28, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // . pow (v_colo - 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x32, 0x2e, 0x32, // r0.xyz, vec3(2.2 - 0x2c, 0x20, 0x32, 0x2e, 0x32, 0x2c, 0x20, 0x32, 0x2e, 0x32, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, // , 2.2, 2.2)). - 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x20, 0x2b, 0x20, 0x70, 0x6f, // * tmpvar_1) + po - 0x77, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2c, 0x20, 0x33, 0x30, 0x2e, // w (tmpvar_1, 30. - 0x30, 0x29, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x30, 0x2e, 0x34, 0x35, 0x34, 0x35, // 0)), vec3(0.4545 - 0x34, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x35, 0x34, 0x35, 0x34, 0x35, 0x2c, 0x20, 0x30, 0x2e, // 45, 0.454545, 0. - 0x34, 0x35, 0x34, 0x35, 0x34, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, // 454545));. gl_F - 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ragColor = tmpva - 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // r_2;.}... + 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6d, // 0.0, -1.0));. m + 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, // ediump vec4 tmpv + 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, // ar_2;. tmpvar_2 + 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // .w = 1.0;. tmpv + 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x70, 0x6f, 0x77, 0x20, 0x28, // ar_2.xyz = pow ( + 0x28, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x6f, 0x77, 0x20, 0x28, 0x76, 0x5f, 0x63, 0x6f, // ((. pow (v_co + 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x32, // lor0.xyz, vec3(2 + 0x2e, 0x32, 0x2c, 0x20, 0x32, 0x2e, 0x32, 0x2c, 0x20, 0x32, 0x2e, 0x32, 0x29, 0x29, 0x0a, 0x20, // .2, 2.2, 2.2)). + 0x20, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x20, 0x2b, 0x20, // * tmpvar_1) + + 0x70, 0x6f, 0x77, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2c, 0x20, 0x33, // pow (tmpvar_1, 3 + 0x30, 0x2e, 0x30, 0x29, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x30, 0x2e, 0x34, 0x35, // 0.0)), vec3(0.45 + 0x34, 0x35, 0x34, 0x35, 0x34, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x35, 0x34, 0x35, 0x34, 0x35, 0x34, // 45454, 0.4545454 + 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x35, 0x34, 0x35, 0x34, 0x35, 0x34, 0x29, 0x29, 0x3b, 0x0a, 0x20, // , 0.4545454));. + 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, // gl_FragColor = + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // tmpvar_2;.}... }; static const uint8_t fs_metaballs_dx9[429] = { diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp b/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp index 3b1bc71daeb..ce8b5aac61c 100644 --- a/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp +++ b/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp @@ -675,7 +675,7 @@ struct HalfEdges m_offsets[ii] = uint32_t(he - m_data); std::vector<uint16_t>& row = edges[ii]; - for (uint32_t jj = 0, end = (uint32_t)row.size(); jj < end; ++jj) + for (uint32_t jj = 0, size = (uint32_t)row.size(); jj < size; ++jj) { he->m_secondIndex = row[jj]; he->m_marked = false; @@ -880,9 +880,9 @@ struct Group for (uint32_t ii = 0, size = m_numIndices/3; ii < size; ++ii) { const uint16_t* indices = &m_indices[ii*3]; - const uint16_t i0 = indices[0]; - const uint16_t i1 = indices[1]; - const uint16_t i2 = indices[2]; + uint16_t i0 = indices[0]; + uint16_t i1 = indices[1]; + uint16_t i2 = indices[2]; const float* v0 = (float*)&m_vertices[i0*stride]; const float* v1 = (float*)&m_vertices[i1*stride]; const float* v2 = (float*)&m_vertices[i2*stride]; @@ -899,15 +899,15 @@ struct Group //Use unique indices for EdgeMap. const uint16_t* uindices = &uniqueIndices[ii*3]; - const uint16_t ui0 = uindices[0]; - const uint16_t ui1 = uindices[1]; - const uint16_t ui2 = uindices[2]; + i0 = uindices[0]; + i1 = uindices[1]; + i2 = uindices[2]; const uint16_t triangleEdge[3][2] = { - {ui0, ui1}, - {ui1, ui2}, - {ui2, ui0}, + { i0, i1 }, + { i1, i2 }, + { i2, i0 }, }; for (uint8_t jj = 0; jj < 3; ++jj) @@ -1511,128 +1511,131 @@ void shadowVolumeCreate(ShadowVolume& _shadowVolume } else // ShadowVolumeAlgorithm::EdgeBased: { - uint32_t ii = 0; + { + uint32_t ii = 0; #if SV_USE_SIMD - uint32_t numEdgesRounded = numEdges & (~0x1); + uint32_t numEdgesRounded = numEdges & (~0x1); - using namespace bx; + using namespace bx; - const float4_t lx = float4_splat(_light[0]); - const float4_t ly = float4_splat(_light[1]); - const float4_t lz = float4_splat(_light[2]); + const float4_t lx = float4_splat(_light[0]); + const float4_t ly = float4_splat(_light[1]); + const float4_t lz = float4_splat(_light[2]); - for (; ii < numEdgesRounded; ii+=2) - { - const Edge& edge0 = edges[ii]; - const Edge& edge1 = edges[ii+1]; - const Plane* edgePlane0 = &edgePlanes[ii*2]; - const Plane* edgePlane1 = &edgePlanes[ii*2 + 2]; - - const float4_t reverse = float4_ild(edge0.m_faceReverseOrder[0] - , edge1.m_faceReverseOrder[0] - , edge0.m_faceReverseOrder[1] - , edge1.m_faceReverseOrder[1] - ); - - const float4_t v0 = float4_ld(edgePlane0[0].m_plane); - const float4_t v1 = float4_ld(edgePlane1[0].m_plane); - const float4_t v2 = float4_ld(edgePlane0[1].m_plane); - const float4_t v3 = float4_ld(edgePlane1[1].m_plane); - - const float4_t xxyy0 = float4_shuf_xAyB(v0, v2); - const float4_t zzww0 = float4_shuf_zCwD(v0, v2); - const float4_t xxyy1 = float4_shuf_xAyB(v1, v3); - const float4_t zzww1 = float4_shuf_zCwD(v1, v3); - - const float4_t vX = float4_shuf_xAyB(xxyy0, xxyy1); - const float4_t vY = float4_shuf_zCwD(xxyy0, xxyy1); - const float4_t vZ = float4_shuf_xAyB(zzww0, zzww1); - const float4_t vW = float4_shuf_zCwD(zzww0, zzww1); - - const float4_t r0 = float4_mul(vX, lx); - const float4_t r1 = float4_mul(vY, ly); - const float4_t r2 = float4_mul(vZ, lz); - - const float4_t dot = float4_add(r0, float4_add(r1, r2)); - const float4_t f = float4_add(dot, vW); - - const float4_t zero = float4_zero(); - const float4_t mask = float4_cmpgt(f, zero); - const float4_t onef = float4_splat(1.0f); - const float4_t tmp0 = float4_and(mask, onef); - const float4_t tmp1 = float4_ftoi(tmp0); - const float4_t tmp2 = float4_xor(tmp1, reverse); - const float4_t tmp3 = float4_sll(tmp2, 1); - const float4_t onei = float4_isplat(1); - const float4_t tmp4 = float4_isub(tmp3, onei); - - BX_ALIGN_DECL_16(int32_t res[4]); - float4_st(&res, tmp4); - - for (uint16_t jj = 0; jj < 2; ++jj) + for (; ii < numEdgesRounded; ii+=2) { - int16_t k = res[jj] + res[jj+2]; - if (k != 0) + const Edge& edge0 = edges[ii]; + const Edge& edge1 = edges[ii+1]; + const Plane* edgePlane0 = &edgePlanes[ii*2]; + const Plane* edgePlane1 = &edgePlanes[ii*2 + 2]; + + const float4_t reverse = + float4_ild(edge0.m_faceReverseOrder[0] + , edge1.m_faceReverseOrder[0] + , edge0.m_faceReverseOrder[1] + , edge1.m_faceReverseOrder[1] + ); + + const float4_t p00 = float4_ld(edgePlane0[0].m_plane); + const float4_t p10 = float4_ld(edgePlane1[0].m_plane); + const float4_t p01 = float4_ld(edgePlane0[1].m_plane); + const float4_t p11 = float4_ld(edgePlane1[1].m_plane); + + const float4_t xxyy0 = float4_shuf_xAyB(p00, p01); + const float4_t zzww0 = float4_shuf_zCwD(p00, p01); + const float4_t xxyy1 = float4_shuf_xAyB(p10, p11); + const float4_t zzww1 = float4_shuf_zCwD(p10, p11); + + const float4_t vX = float4_shuf_xAyB(xxyy0, xxyy1); + const float4_t vY = float4_shuf_zCwD(xxyy0, xxyy1); + const float4_t vZ = float4_shuf_xAyB(zzww0, zzww1); + const float4_t vW = float4_shuf_zCwD(zzww0, zzww1); + + const float4_t r0 = float4_mul(vX, lx); + const float4_t r1 = float4_mul(vY, ly); + const float4_t r2 = float4_mul(vZ, lz); + + const float4_t dot = float4_add(r0, float4_add(r1, r2)); + const float4_t f = float4_add(dot, vW); + + const float4_t zero = float4_zero(); + const float4_t mask = float4_cmpgt(f, zero); + const float4_t onef = float4_splat(1.0f); + const float4_t tmp0 = float4_and(mask, onef); + const float4_t tmp1 = float4_ftoi(tmp0); + const float4_t tmp2 = float4_xor(tmp1, reverse); + const float4_t tmp3 = float4_sll(tmp2, 1); + const float4_t onei = float4_isplat(1); + const float4_t tmp4 = float4_isub(tmp3, onei); + + BX_ALIGN_DECL_16(int32_t res[4]); + float4_st(&res, tmp4); + + for (uint16_t jj = 0; jj < 2; ++jj) { - float* v0 = (float*)&vertices[edges[ii+jj].m_i0*_stride]; - float* v1 = (float*)&vertices[edges[ii+jj].m_i1*_stride]; - verticesSide[vsideI++] = VertexData(v0, 0.0f, float(k)); - verticesSide[vsideI++] = VertexData(v0, 1.0f, float(k)); - verticesSide[vsideI++] = VertexData(v1, 0.0f, float(k)); - verticesSide[vsideI++] = VertexData(v1, 1.0f, float(k)); - - k = _textureAsStencil ? 1 : k; - uint16_t winding = uint16_t(k > 0); - for (uint8_t ii = 0, end = abs(k); ii < end; ++ii) + int16_t kk = res[jj] + res[jj+2]; + if (kk != 0) { - indicesSide[sideI++] = indexSide; - indicesSide[sideI++] = indexSide + 2 - winding; - indicesSide[sideI++] = indexSide + 1 + winding; + float* v0 = (float*)&vertices[edges[ii+jj].m_i0*_stride]; + float* v1 = (float*)&vertices[edges[ii+jj].m_i1*_stride]; + verticesSide[vsideI++] = VertexData(v0, 0.0f, float(kk) ); + verticesSide[vsideI++] = VertexData(v0, 1.0f, float(kk) ); + verticesSide[vsideI++] = VertexData(v1, 0.0f, float(kk) ); + verticesSide[vsideI++] = VertexData(v1, 1.0f, float(kk) ); + + kk = _textureAsStencil ? 1 : kk; + uint16_t winding = uint16_t(kk > 0); + for (uint8_t ll = 0, end = abs(kk); ll < end; ++ll) + { + indicesSide[sideI++] = indexSide; + indicesSide[sideI++] = indexSide + 2 - winding; + indicesSide[sideI++] = indexSide + 1 + winding; - indicesSide[sideI++] = indexSide + 2; - indicesSide[sideI++] = indexSide + 3 - winding*2; - indicesSide[sideI++] = indexSide + 1 + winding*2; - } + indicesSide[sideI++] = indexSide + 2; + indicesSide[sideI++] = indexSide + 3 - winding*2; + indicesSide[sideI++] = indexSide + 1 + winding*2; + } - indexSide += 4; + indexSide += 4; + } } } - } #endif - for (; ii < numEdges; ++ii) - { - const Edge& edge = edges[ii]; - const Plane* edgePlane = &edgePlanes[ii*2]; + for (; ii < numEdges; ++ii) + { + const Edge& edge = edges[ii]; + const Plane* edgePlane = &edgePlanes[ii*2]; - int16_t s0 = ( (vec3Dot(edgePlane[0].m_plane, _light) + edgePlane[0].m_plane[3]) > 0.0f) ^ edge.m_faceReverseOrder[0]; - int16_t s1 = ( (vec3Dot(edgePlane[1].m_plane, _light) + edgePlane[1].m_plane[3]) > 0.0f) ^ edge.m_faceReverseOrder[1]; - int16_t k = ( (s0 + s1) << 1) - 2; + int16_t s0 = ( (vec3Dot(edgePlane[0].m_plane, _light) + edgePlane[0].m_plane[3]) > 0.0f) ^ edge.m_faceReverseOrder[0]; + int16_t s1 = ( (vec3Dot(edgePlane[1].m_plane, _light) + edgePlane[1].m_plane[3]) > 0.0f) ^ edge.m_faceReverseOrder[1]; + int16_t kk = ( (s0 + s1) << 1) - 2; - if (k != 0) - { - float* v0 = (float*)&vertices[edge.m_i0*_stride]; - float* v1 = (float*)&vertices[edge.m_i1*_stride]; - verticesSide[vsideI++] = VertexData(v0, 0.0f, k); - verticesSide[vsideI++] = VertexData(v0, 1.0f, k); - verticesSide[vsideI++] = VertexData(v1, 0.0f, k); - verticesSide[vsideI++] = VertexData(v1, 1.0f, k); - - k = _textureAsStencil ? 1 : k; - uint16_t winding = uint16_t(k > 0); - for (uint8_t ii = 0, end = abs(k); ii < end; ++ii) + if (kk != 0) { - indicesSide[sideI++] = indexSide; - indicesSide[sideI++] = indexSide + 2 - winding; - indicesSide[sideI++] = indexSide + 1 + winding; + float* v0 = (float*)&vertices[edge.m_i0*_stride]; + float* v1 = (float*)&vertices[edge.m_i1*_stride]; + verticesSide[vsideI++] = VertexData(v0, 0.0f, kk); + verticesSide[vsideI++] = VertexData(v0, 1.0f, kk); + verticesSide[vsideI++] = VertexData(v1, 0.0f, kk); + verticesSide[vsideI++] = VertexData(v1, 1.0f, kk); + + kk = _textureAsStencil ? 1 : kk; + uint16_t winding = uint16_t(kk > 0); + for (uint8_t jj = 0, end = abs(kk); jj < end; ++jj) + { + indicesSide[sideI++] = indexSide; + indicesSide[sideI++] = indexSide + 2 - winding; + indicesSide[sideI++] = indexSide + 1 + winding; - indicesSide[sideI++] = indexSide + 2; - indicesSide[sideI++] = indexSide + 3 - winding*2; - indicesSide[sideI++] = indexSide + 1 + winding*2; - } + indicesSide[sideI++] = indexSide + 2; + indicesSide[sideI++] = indexSide + 3 - winding*2; + indicesSide[sideI++] = indexSide + 1 + winding*2; + } - indexSide += 4; + indexSide += 4; + } } } @@ -1643,10 +1646,10 @@ void shadowVolumeCreate(ShadowVolume& _shadowVolume { const Face& face = *iter; - float f = vec3Dot(face.m_plane, _light) + face.m_plane[3]; + float f = bx::vec3Dot(face.m_plane, _light) + face.m_plane[3]; bool frontFacing = (f > 0.0f); - for (uint8_t ii = 0, end = 1 + uint8_t(!_textureAsStencil); ii < end; ++ii) + for (uint8_t ii = 0, num = 1 + uint8_t(!_textureAsStencil); ii < num; ++ii) { if (frontFacing) { @@ -2791,15 +2794,15 @@ int _main_(int /*_argc*/, char** /*_argv*/) viewId += uint8_t(settings_useStencilTexture); // Draw shadow casters. - for (uint8_t ii = 0; ii < shadowCastersCount[currentScene]; ++ii) + for (uint8_t jj = 0; jj < shadowCastersCount[currentScene]; ++jj) { - shadowCasters[currentScene][ii].submit(viewId, drawDiffuse); + shadowCasters[currentScene][jj].submit(viewId, drawDiffuse); } // Draw shadow receivers. - for (uint8_t ii = 0; ii < shadowReceiversCount[currentScene]; ++ii) + for (uint8_t jj = 0; jj < shadowReceiversCount[currentScene]; ++jj) { - shadowReceivers[currentScene][ii].submit(viewId, drawDiffuse); + shadowReceivers[currentScene][jj].submit(viewId, drawDiffuse); } } diff --git a/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp b/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp index 3e4e7940a4a..9f7124c35ad 100644 --- a/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp +++ b/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp @@ -186,8 +186,8 @@ int _main_(int /*_argc*/, char** /*_argv*/) float view[16]; float proj[16]; - const float eye[3] = { 0.0f, 30.0f, -60.0f }; - const float at[3] = { 0.0f, 5.0f, 0.0f }; + float eye[3] = { 0.0f, 30.0f, -60.0f }; + float at[3] = { 0.0f, 5.0f, 0.0f }; bx::mtxLookAt(view, eye, at); const float aspect = float(int32_t(width) ) / float(int32_t(height) ); @@ -261,13 +261,14 @@ int _main_(int /*_argc*/, char** /*_argv*/) float lightView[16]; float lightProj[16]; - const float eye[3] = - { - -lightPos[0], - -lightPos[1], - -lightPos[2], - }; - const float at[3] = { 0.0f, 0.0f, 0.0f }; + eye[0] = -lightPos[0]; + eye[0] = -lightPos[1]; + eye[0] = -lightPos[2]; + + at[0] = 0.0f; + at[1] = 0.0f; + at[2] = 0.0f; + bx::mtxLookAt(lightView, eye, at); const float area = 30.0f; diff --git a/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp b/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp index 09dc689a5f2..6754ccd2f9e 100644 --- a/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp +++ b/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp @@ -2452,10 +2452,10 @@ int _main_(int /*_argc*/, char** /*_argv*/) } // Determine on-screen rectangle size where depth buffer will be drawn. - const uint16_t depthRectHeight = uint16_t(float(viewState.m_height) / 2.5f); - const uint16_t depthRectWidth = depthRectHeight; - const uint16_t depthRectX = 0; - const uint16_t depthRectY = viewState.m_height - depthRectHeight; + uint16_t depthRectHeight = uint16_t(float(viewState.m_height) / 2.5f); + uint16_t depthRectWidth = depthRectHeight; + uint16_t depthRectX = 0; + uint16_t depthRectY = viewState.m_height - depthRectHeight; // Setup views and render targets. bgfx::setViewRect(0, 0, 0, viewState.m_width, viewState.m_height); @@ -2583,10 +2583,10 @@ int _main_(int /*_argc*/, char** /*_argv*/) * RENDERVIEW_DRAWDEPTH_3_ID - Draw depth buffer for fourth split. */ - const uint16_t depthRectHeight = viewState.m_height / 3; - const uint16_t depthRectWidth = depthRectHeight; - const uint16_t depthRectX = 0; - const uint16_t depthRectY = viewState.m_height - depthRectHeight; + depthRectHeight = viewState.m_height / 3; + depthRectWidth = depthRectHeight; + depthRectX = 0; + depthRectY = viewState.m_height - depthRectHeight; bgfx::setViewRect(RENDERVIEW_SHADOWMAP_1_ID, 0, 0, currentShadowMapSize, currentShadowMapSize); bgfx::setViewRect(RENDERVIEW_SHADOWMAP_2_ID, 0, 0, currentShadowMapSize, currentShadowMapSize); @@ -2795,10 +2795,10 @@ int _main_(int /*_argc*/, char** /*_argv*/) ); // Trees. - for (uint8_t ii = 0; ii < numTrees; ++ii) + for (uint8_t jj = 0; jj < numTrees; ++jj) { treeMesh.submit(viewId - , mtxTrees[ii] + , mtxTrees[jj] , *currentSmSettings->m_progPack , s_renderStates[renderStateIndex] ); @@ -2851,7 +2851,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) float mtxShadow[16]; const float ymul = (s_flipV) ? 0.5f : -0.5f; - const float zadd = (DepthImpl::Linear == settings.m_depthImpl) ? 0.0f : 0.5f; + float zadd = (DepthImpl::Linear == settings.m_depthImpl) ? 0.0f : 0.5f; const float mtxBias[16] = { @@ -2870,7 +2870,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) else if (LightType::PointLight == settings.m_lightType) { const float s = (s_flipV) ? 1.0f : -1.0f; //sign - const float zadd = (DepthImpl::Linear == settings.m_depthImpl) ? 0.0f : 0.5f; + zadd = (DepthImpl::Linear == settings.m_depthImpl) ? 0.0f : 0.5f; const float mtxCropBias[2][TetrahedronFaces::Count][16] = { diff --git a/3rdparty/bgfx/examples/common/entry/entry.cpp b/3rdparty/bgfx/examples/common/entry/entry.cpp index 001232d5556..4eb25a51a96 100644 --- a/3rdparty/bgfx/examples/common/entry/entry.cpp +++ b/3rdparty/bgfx/examples/common/entry/entry.cpp @@ -29,11 +29,12 @@ namespace entry #if ENTRY_CONFIG_IMPLEMENT_DEFAULT_ALLOCATOR bx::ReallocatorI* getDefaultAllocator() { -BX_PRAGMA_DIAGNOSTIC_PUSH_MSVC(); +BX_PRAGMA_DIAGNOSTIC_PUSH(); BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4459); // warning C4459: declaration of 's_allocator' hides global declaration +BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wshadow"); static bx::CrtAllocator s_allocator; return &s_allocator; -BX_PRAGMA_DIAGNOSTIC_POP_MSVC(); +BX_PRAGMA_DIAGNOSTIC_POP(); } #endif // ENTRY_CONFIG_IMPLEMENT_DEFAULT_ALLOCATOR diff --git a/3rdparty/bgfx/examples/common/font/fs_font_basic.bin.h b/3rdparty/bgfx/examples/common/font/fs_font_basic.bin.h index 14bdfa3c488..b8a832bab8a 100644 --- a/3rdparty/bgfx/examples/common/font/fs_font_basic.bin.h +++ b/3rdparty/bgfx/examples/common/font/fs_font_basic.bin.h @@ -1,7 +1,7 @@ -static const uint8_t fs_font_basic_glsl[547] = +static const uint8_t fs_font_basic_glsl[553] = { 0x46, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x74, 0x65, 0x78, // FSH........u_tex - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x03, 0x02, 0x00, 0x00, 0x76, // Color..........v + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x09, 0x02, 0x00, 0x00, 0x76, // Color..........v 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // arying highp vec 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, // 4 v_color0;.vary 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, // ing highp vec4 v @@ -15,26 +15,26 @@ static const uint8_t fs_font_basic_glsl[547] = 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, // tmpvar_2 = textu 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, // reCube (u_texCol 0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, // or, v_texcoord0. - 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, // xyz);. int tmpv - 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, // ar_3;. tmpvar_3 - 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // = int(((v_texco - 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, // ord0.w * 4.0) + - 0x30, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, // 0.5));. rgba_1[ - 0x30, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x7a, 0x3b, // 0] = tmpvar_2.z; - 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x31, 0x5d, 0x20, 0x3d, 0x20, 0x74, // . rgba_1[1] = t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, // mpvar_2.y;. rgb - 0x61, 0x5f, 0x31, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // a_1[2] = tmpvar_ - 0x32, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x33, 0x5d, // 2.x;. rgba_1[3] - 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x77, 0x3b, 0x0a, 0x20, // = tmpvar_2.w;. - 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // lowp vec4 tmpva - 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, // r_4;. tmpvar_4. - 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, // xyz = v_color0.x - 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x77, // yz;. tmpvar_4.w - 0x20, 0x3d, 0x20, 0x28, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x20, 0x2a, // = (v_color0.w * - 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, // rgba_1[tmpvar_3 - 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, // ]);. gl_FragCol - 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x7d, // or = tmpvar_4;.} - 0x0a, 0x0a, 0x00, // ... + 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x69, 0x6e, // xyz);. highp in + 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // t tmpvar_3;. tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x28, 0x76, // pvar_3 = int(((v + 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x34, // _texcoord0.w * 4 + 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, // .0) + 0.5));. r + 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x30, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // gba_1[0] = tmpva + 0x72, 0x5f, 0x32, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, // r_2.z;. rgba_1[ + 0x31, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x79, 0x3b, // 1] = tmpvar_2.y; + 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x74, // . rgba_1[2] = t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, // mpvar_2.x;. rgb + 0x61, 0x5f, 0x31, 0x5b, 0x33, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // a_1[3] = tmpvar_ + 0x32, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // 2.w;. lowp vec4 + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_4;. tmp + 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x63, 0x6f, // var_4.xyz = v_co + 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // lor0.xyz;. tmpv + 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // ar_4.w = (v_colo + 0x72, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x74, 0x6d, // r0.w * rgba_1[tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, // pvar_3]);. gl_F + 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ragColor = tmpva + 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // r_4;.}... }; static const uint8_t fs_font_basic_dx9[445] = { diff --git a/3rdparty/bgfx/examples/common/font/fs_font_distance_field.bin.h b/3rdparty/bgfx/examples/common/font/fs_font_distance_field.bin.h index 56be0d33aaa..ededb41bb0c 100644 --- a/3rdparty/bgfx/examples/common/font/fs_font_distance_field.bin.h +++ b/3rdparty/bgfx/examples/common/font/fs_font_distance_field.bin.h @@ -1,7 +1,7 @@ -static const uint8_t fs_font_distance_field_glsl[1013] = +static const uint8_t fs_font_distance_field_glsl[1019] = { 0x46, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x74, 0x65, 0x78, // FSH........u_tex - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0xd5, 0x03, 0x00, 0x00, 0x76, // Color..........v + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0xdb, 0x03, 0x00, 0x00, 0x76, // Color..........v 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // arying highp vec 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, // 4 v_color0;.vary 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, // ing highp vec4 v @@ -15,55 +15,55 @@ static const uint8_t fs_font_distance_field_glsl[1013] = 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, // tmpvar_2 = textu 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, // reCube (u_texCol 0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, // or, v_texcoord0. - 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, // xyz);. int tmpv - 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, // ar_3;. tmpvar_3 - 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // = int(((v_texco - 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, // ord0.w * 4.0) + - 0x30, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, // 0.5));. rgba_1[ - 0x30, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x7a, 0x3b, // 0] = tmpvar_2.z; - 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x31, 0x5d, 0x20, 0x3d, 0x20, 0x74, // . rgba_1[1] = t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, // mpvar_2.y;. rgb - 0x61, 0x5f, 0x31, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // a_1[2] = tmpvar_ - 0x32, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x33, 0x5d, // 2.x;. rgba_1[3] - 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x77, 0x3b, 0x0a, 0x20, // = tmpvar_2.w;. - 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, // highp vec3 tmpv - 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, // ar_4;. tmpvar_4 - 0x20, 0x3d, 0x20, 0x64, 0x46, 0x64, 0x78, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // = dFdx(v_texcoo - 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, // rd0.xyz);. high - 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, // p vec3 tmpvar_5; - 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x64, 0x46, // . tmpvar_5 = dF - 0x64, 0x79, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, // dy(v_texcoord0.x - 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, // yz);. highp flo - 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x74, // at tmpvar_6;. t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x20, 0x3d, 0x20, 0x28, 0x38, 0x2e, 0x30, 0x20, 0x2a, // mpvar_6 = (8.0 * - 0x20, 0x28, 0x73, 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, // (sqrt(. dot - 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // (tmpvar_4, tmpva - 0x72, 0x5f, 0x34, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x20, 0x2b, 0x20, 0x73, 0x71, 0x72, 0x74, 0x28, // r_4). ) + sqrt( - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // . dot (tmpvar - 0x5f, 0x35, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x29, 0x0a, 0x20, 0x20, // _5, tmpvar_5). - 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, // )));. highp flo - 0x61, 0x74, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x65, 0x64, // at edge0_7;. ed - 0x67, 0x65, 0x30, 0x5f, 0x37, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2d, 0x20, 0x74, // ge0_7 = (0.5 - t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, // mpvar_6);. lowp - 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x3b, // float tmpvar_8; - 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x20, 0x3d, 0x20, 0x63, 0x6c, // . tmpvar_8 = cl - 0x61, 0x6d, 0x70, 0x20, 0x28, 0x28, 0x28, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x74, 0x6d, // amp (((rgba_1[tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x5d, 0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, // pvar_3] - edge0_ - 0x37, 0x29, 0x20, 0x2f, 0x20, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, // 7) / (. (0.5 - 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2d, // + tmpvar_6). - - 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x37, 0x29, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, // edge0_7)), 0.0, - 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, // 1.0);. lowp ve - 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x74, // c4 tmpvar_9;. t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x76, 0x5f, // mpvar_9.xyz = v_ - 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // color0.xyz;. tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x5f, 0x63, 0x6f, // pvar_9.w = (v_co - 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // lor0.w * (tmpvar - 0x5f, 0x38, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x20, 0x2a, // _8 * (tmpvar_8 * - 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x33, 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x28, 0x32, 0x2e, // . (3.0 - (2. - 0x30, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x29, 0x29, 0x0a, 0x20, // 0 * tmpvar_8)). - 0x20, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, // )));. gl_FragC - 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x3b, // olor = tmpvar_9; - 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // .}... + 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x69, 0x6e, // xyz);. highp in + 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // t tmpvar_3;. tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x28, 0x76, // pvar_3 = int(((v + 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x34, // _texcoord0.w * 4 + 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, // .0) + 0.5));. r + 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x30, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // gba_1[0] = tmpva + 0x72, 0x5f, 0x32, 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, // r_2.z;. rgba_1[ + 0x31, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x79, 0x3b, // 1] = tmpvar_2.y; + 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x74, // . rgba_1[2] = t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, // mpvar_2.x;. rgb + 0x61, 0x5f, 0x31, 0x5b, 0x33, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // a_1[3] = tmpvar_ + 0x32, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // 2.w;. highp vec + 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // 3 tmpvar_4;. tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x64, 0x46, 0x64, 0x78, 0x28, 0x76, 0x5f, // pvar_4 = dFdx(v_ + 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, // texcoord0.xyz);. + 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, // highp vec3 tmp + 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // var_5;. tmpvar_ + 0x35, 0x20, 0x3d, 0x20, 0x64, 0x46, 0x64, 0x79, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // 5 = dFdy(v_texco + 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, // ord0.xyz);. hig + 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // hp float tmpvar_ + 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x20, 0x3d, 0x20, // 6;. tmpvar_6 = + 0x28, 0x38, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x28, 0x73, 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, // (8.0 * (sqrt(. + 0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2c, // dot (tmpvar_4, + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x20, 0x2b, // tmpvar_4). ) + + 0x20, 0x73, 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, // sqrt(. dot ( + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // tmpvar_5, tmpvar + 0x5f, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, // _5). )));. hig + 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x37, // hp float edge0_7 + 0x3b, 0x0a, 0x20, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x37, 0x20, 0x3d, 0x20, 0x28, 0x30, // ;. edge0_7 = (0 + 0x2e, 0x35, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x29, 0x3b, 0x0a, // .5 - tmpvar_6);. + 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, // lowp float tmp + 0x76, 0x61, 0x72, 0x5f, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // var_8;. tmpvar_ + 0x38, 0x20, 0x3d, 0x20, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x28, 0x28, 0x72, 0x67, 0x62, // 8 = clamp (((rgb + 0x61, 0x5f, 0x31, 0x5b, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x5d, 0x20, 0x2d, 0x20, // a_1[tmpvar_3] - + 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x37, 0x29, 0x20, 0x2f, 0x20, 0x28, 0x0a, 0x20, 0x20, 0x20, // edge0_7) / (. + 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, // (0.5 + tmpvar_6 + 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x37, 0x29, 0x29, // ). - edge0_7)) + 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, // , 0.0, 1.0);. l + 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // owp vec4 tmpvar_ + 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x78, 0x79, // 9;. tmpvar_9.xy + 0x7a, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, // z = v_color0.xyz + 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x77, 0x20, 0x3d, // ;. tmpvar_9.w = + 0x20, 0x28, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x28, // (v_color0.w * ( + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, // tmpvar_8 * (tmpv + 0x61, 0x72, 0x5f, 0x38, 0x20, 0x2a, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x33, 0x2e, 0x30, // ar_8 * . (3.0 + 0x20, 0x2d, 0x20, 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // - (2.0 * tmpvar + 0x5f, 0x38, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, // _8)). )));. gl + 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, // _FragColor = tmp + 0x76, 0x61, 0x72, 0x5f, 0x39, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // var_9;.}... }; static const uint8_t fs_font_distance_field_dx9[737] = { diff --git a/3rdparty/bgfx/examples/common/font/fs_font_distance_field_subpixel.bin.h b/3rdparty/bgfx/examples/common/font/fs_font_distance_field_subpixel.bin.h index b410a8bd1d0..88896527dbe 100644 --- a/3rdparty/bgfx/examples/common/font/fs_font_distance_field_subpixel.bin.h +++ b/3rdparty/bgfx/examples/common/font/fs_font_distance_field_subpixel.bin.h @@ -1,7 +1,7 @@ -static const uint8_t fs_font_distance_field_subpixel_glsl[1262] = +static const uint8_t fs_font_distance_field_subpixel_glsl[1268] = { 0x46, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x74, 0x65, 0x78, // FSH........u_tex - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0xce, 0x04, 0x00, 0x00, 0x76, // Color..........v + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0xd4, 0x04, 0x00, 0x00, 0x76, // Color..........v 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // arying highp vec 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, // 4 v_color0;.vary 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, // ing highp vec4 v @@ -9,76 +9,77 @@ static const uint8_t fs_font_distance_field_subpixel_glsl[1262] = 0x6f, 0x72, 0x6d, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // orm lowp sampler 0x43, 0x75, 0x62, 0x65, 0x20, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, // Cube u_texColor; 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, // .void main ().{. - 0x20, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, // int tmpvar_1;. - 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, // tmpvar_1 = int - 0x28, 0x28, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x77, // (((v_texcoord0.w - 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x3b, // * 4.0) + 0.5)); - 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, // . highp vec3 tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // pvar_2;. tmpvar - 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x64, 0x46, 0x64, 0x78, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // _2 = dFdx(v_texc - 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, // oord0.xyz);. hi - 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ghp vec3 tmpvar_ - 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x20, 0x3d, 0x20, // 3;. tmpvar_3 = - 0x64, 0x46, 0x64, 0x79, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // dFdy(v_texcoord0 - 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // .xyz);. highp v - 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, // ec3 tmpvar_4;. - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x31, 0x36, // tmpvar_4 = (0.16 - 0x36, 0x36, 0x36, 0x37, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, // 6667 * tmpvar_2) - 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, // ;. lowp float t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_5;. tmpva - 0x72, 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, // r_5 = textureCub - 0x65, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x28, // e (u_texColor, ( - 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x20, // v_texcoord0.xyz - 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, 0x29, 0x2e, 0x7a, 0x79, 0x78, // - tmpvar_4)).zyx - 0x77, 0x5b, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x6c, // w[tmpvar_1];. l - 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // owp float tmpvar - 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x20, 0x3d, // _6;. tmpvar_6 = - 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, 0x75, 0x5f, // textureCube (u_ - 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, // texColor, (v_tex - 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, // coord0.xyz + tmp - 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, 0x29, 0x2e, 0x7a, 0x79, 0x78, 0x77, 0x5b, 0x74, 0x6d, 0x70, // var_4)).zyxw[tmp - 0x76, 0x61, 0x72, 0x5f, 0x31, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, // var_1];. lowp f - 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x3b, 0x0a, 0x20, // loat tmpvar_7;. - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x35, // tmpvar_7 = (0.5 - 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x2b, 0x20, 0x74, // * (tmpvar_5 + t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, // mpvar_6));. hig - 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // hp float tmpvar_ - 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x20, 0x3d, 0x20, // 8;. tmpvar_8 = - 0x28, 0x38, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x28, 0x73, 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, // (8.0 * (sqrt(. - 0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2c, // dot (tmpvar_2, - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x20, 0x2b, // tmpvar_2). ) + - 0x20, 0x73, 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, // sqrt(. dot ( - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // tmpvar_3, tmpvar - 0x5f, 0x33, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, // _3). )));. low - 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x3b, // p vec3 tmpvar_9; - 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x78, 0x20, 0x3d, 0x20, // . tmpvar_9.x = - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // tmpvar_5;. tmpv - 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ar_9.y = tmpvar_ - 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x7a, 0x20, // 7;. tmpvar_9.z - 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, // = tmpvar_6;. lo - 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // wp vec3 tmpvar_1 - 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // 0;. highp float - 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x31, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x65, 0x64, 0x67, // edge0_11;. edg - 0x65, 0x30, 0x5f, 0x31, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2d, 0x20, 0x74, // e0_11 = (0.5 - t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, // mpvar_8);. lowp - 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x3b, // vec3 tmpvar_12; - 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x20, 0x3d, 0x20, 0x63, // . tmpvar_12 = c - 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x28, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, // lamp (((tmpvar_9 - 0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x31, 0x31, 0x29, 0x20, 0x2f, 0x20, 0x28, // - edge0_11) / ( - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, // . (0.5 + tmpv - 0x61, 0x72, 0x5f, 0x38, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, // ar_8). - edge0 - 0x5f, 0x31, 0x31, 0x29, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, // _11)), 0.0, 1.0) - 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x20, 0x3d, 0x20, // ;. tmpvar_10 = - 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, // (tmpvar_12 * (tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x20, 0x2a, 0x20, 0x28, 0x33, 0x2e, 0x30, 0x20, 0x2d, // pvar_12 * (3.0 - - 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, // . (2.0 * tmp - 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, // var_12). )));. - 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x78, 0x79, // gl_FragColor.xy - 0x7a, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x20, 0x2a, // z = (tmpvar_10 * - 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, // v_color0.w);. - 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x77, 0x20, 0x3d, // gl_FragColor.w = - 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x20, 0x2a, 0x20, 0x76, 0x5f, 0x63, // (tmpvar_7 * v_c - 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // olor0.w);.}... + 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, // highp int tmpv + 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // ar_1;. tmpvar_1 + 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // = int(((v_texco + 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, // ord0.w * 4.0) + + 0x30, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // 0.5));. highp v + 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, // ec3 tmpvar_2;. + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x64, 0x46, 0x64, 0x78, 0x28, // tmpvar_2 = dFdx( + 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, // v_texcoord0.xyz) + 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, // ;. highp vec3 t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_3;. tmpva + 0x72, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x64, 0x46, 0x64, 0x79, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, // r_3 = dFdy(v_tex + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, // coord0.xyz);. h + 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // ighp vec3 tmpvar + 0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x20, 0x3d, // _4;. tmpvar_4 = + 0x20, 0x28, 0x30, 0x2e, 0x31, 0x36, 0x36, 0x36, 0x36, 0x37, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, // (0.166667 * tmp + 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, // var_2);. lowp f + 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, 0x20, // loat tmpvar_5;. + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, // tmpvar_5 = text + 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, // ureCube (u_texCo + 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // lor, (v_texcoord + 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, // 0.xyz - tmpvar_4 + 0x29, 0x29, 0x2e, 0x7a, 0x79, 0x78, 0x77, 0x5b, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // )).zyxw[tmpvar_1 + 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, // ];. lowp float + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // tmpvar_6;. tmpv + 0x61, 0x72, 0x5f, 0x36, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, // ar_6 = textureCu + 0x62, 0x65, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, // be (u_texColor, + 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, // (v_texcoord0.xyz + 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, 0x29, 0x2e, 0x7a, 0x79, // + tmpvar_4)).zy + 0x78, 0x77, 0x5b, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x5d, 0x3b, 0x0a, 0x20, 0x20, // xw[tmpvar_1];. + 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // lowp float tmpva + 0x72, 0x5f, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x20, // r_7;. tmpvar_7 + 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // = (0.5 * (tmpvar + 0x5f, 0x35, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x29, 0x29, 0x3b, // _5 + tmpvar_6)); + 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, // . highp float t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_8;. tmpva + 0x72, 0x5f, 0x38, 0x20, 0x3d, 0x20, 0x28, 0x38, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x28, 0x73, 0x71, // r_8 = (8.0 * (sq + 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, // rt(. dot (tmp + 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, // var_2, tmpvar_2) + 0x0a, 0x20, 0x20, 0x29, 0x20, 0x2b, 0x20, 0x73, 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, 0x20, // . ) + sqrt(. + 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2c, 0x20, // dot (tmpvar_3, + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x29, 0x29, 0x3b, // tmpvar_3). ))); + 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, // . lowp vec3 tmp + 0x76, 0x61, 0x72, 0x5f, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // var_9;. tmpvar_ + 0x39, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, // 9.x = tmpvar_5;. + 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x74, // tmpvar_9.y = t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_7;. tmpva + 0x72, 0x5f, 0x39, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, // r_9.z = tmpvar_6 + 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, // ;. lowp vec3 tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // pvar_10;. highp + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x31, 0x31, 0x3b, // float edge0_11; + 0x0a, 0x20, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x31, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x30, // . edge0_11 = (0 + 0x2e, 0x35, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x29, 0x3b, 0x0a, // .5 - tmpvar_8);. + 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, // lowp vec3 tmpv + 0x61, 0x72, 0x5f, 0x31, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ar_12;. tmpvar_ + 0x31, 0x32, 0x20, 0x3d, 0x20, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x28, 0x28, 0x74, 0x6d, // 12 = clamp (((tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x31, // pvar_9 - edge0_1 + 0x31, 0x29, 0x20, 0x2f, 0x20, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, // 1) / (. (0.5 + 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2d, // + tmpvar_8). - + 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x31, 0x31, 0x29, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, // edge0_11)), 0.0 + 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // , 1.0);. tmpvar + 0x5f, 0x31, 0x30, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, // _10 = (tmpvar_12 + 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x20, 0x2a, 0x20, // * (tmpvar_12 * + 0x28, 0x33, 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x32, 0x2e, 0x30, // (3.0 - . (2.0 + 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x29, 0x0a, 0x20, 0x20, // * tmpvar_12). + 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, // )));. gl_FragCo + 0x6c, 0x6f, 0x72, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, // lor.xyz = (tmpva + 0x72, 0x5f, 0x31, 0x30, 0x20, 0x2a, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, // r_10 * v_color0. + 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, // w);. gl_FragCol + 0x6f, 0x72, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, // or.w = (tmpvar_7 + 0x20, 0x2a, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, // * v_color0.w);. + 0x7d, 0x0a, 0x0a, 0x00, // }... }; static const uint8_t fs_font_distance_field_subpixel_dx9[885] = { diff --git a/3rdparty/bgfx/examples/common/imgui/fs_imgui_cubemap.bin.h b/3rdparty/bgfx/examples/common/imgui/fs_imgui_cubemap.bin.h index ca5779ba73f..74ce4a04639 100644 --- a/3rdparty/bgfx/examples/common/imgui/fs_imgui_cubemap.bin.h +++ b/3rdparty/bgfx/examples/common/imgui/fs_imgui_cubemap.bin.h @@ -1,28 +1,42 @@ -static const uint8_t fs_imgui_cubemap_glsl[363] = +static const uint8_t fs_imgui_cubemap_glsl[578] = { - 0x46, 0x53, 0x48, 0x03, 0xe3, 0xc2, 0x5c, 0x65, 0x02, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH....e...u_ima - 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x07, 0x01, 0x00, 0x00, // geLodEnabled.... - 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, // ...s_texColor... - 0x00, 0x01, 0x00, 0x33, 0x01, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, // ...3...varying h - 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, // ighp vec3 v_norm - 0x61, 0x6c, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, // al;.uniform high - 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, // p vec4 u_imageLo - 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, // dEnabled;.unifor - 0x6d, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x43, 0x75, // m lowp samplerCu - 0x62, 0x65, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x76, // be s_texColor;.v - 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, // oid main ().{. - 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // lowp vec4 tmpvar - 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, // _1;. tmpvar_1.x - 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, // yz = textureCube - 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, // Lod (s_texCol - 0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x2c, 0x20, 0x75, 0x5f, // or, v_normal, u_ - 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, // imageLodEnabled. - 0x78, 0x29, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // x).xyz;. tmpvar - 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, // _1.w = (0.2 + (0 - 0x2e, 0x38, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, // .8 * u_imageLodE - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, // nabled.y));. gl - 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, // _FragColor = tmp - 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // var_1;.}... + 0x46, 0x53, 0x48, 0x03, 0xe3, 0xc2, 0x5c, 0x65, 0x00, 0x00, 0x33, 0x02, 0x00, 0x00, 0x6c, 0x6f, // FSH....e..3...lo + 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x5f, 0x6c, 0x6f, 0x77, // wp vec4 impl_low + 0x5f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x4c, 0x6f, 0x64, 0x20, // _textureCubeLod + 0x20, 0x20, 0x28, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x43, // (lowp samplerC + 0x75, 0x62, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x68, 0x69, 0x67, // ube sampler, hig + 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6d, // hp vec3 coord, m + 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x6c, 0x6f, 0x64, // ediump float lod + 0x29, 0x0a, 0x7b, 0x0a, 0x23, 0x69, 0x66, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x28, // ).{.#if defined( + 0x47, 0x4c, 0x5f, 0x45, 0x58, 0x54, 0x5f, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x74, 0x65, // GL_EXT_shader_te + 0x78, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x6c, 0x6f, 0x64, 0x29, 0x0a, 0x09, 0x72, 0x65, 0x74, 0x75, // xture_lod)..retu + 0x72, 0x6e, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x4c, 0x6f, // rn textureCubeLo + 0x64, 0x20, 0x20, 0x20, 0x28, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x63, 0x6f, // d (sampler, co + 0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6c, 0x6f, 0x64, 0x29, 0x3b, 0x0a, 0x23, 0x65, 0x6c, 0x73, 0x65, // ord, lod);.#else + 0x0a, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, // ..return texture + 0x43, 0x75, 0x62, 0x65, 0x28, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x63, 0x6f, // Cube(sampler, co + 0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6c, 0x6f, 0x64, 0x29, 0x3b, 0x0a, 0x23, 0x65, 0x6e, 0x64, 0x69, // ord, lod);.#endi + 0x66, 0x0a, 0x7d, 0x0a, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, // f.}..varying hig + 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, // hp vec3 v_normal + 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // ;.uniform highp + 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, // vec4 u_imageLodE + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, // nabled;.uniform + 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x43, 0x75, 0x62, 0x65, // lowp samplerCube + 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x76, 0x6f, 0x69, // s_texColor;.voi + 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, // d main ().{. lo + 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // wp vec4 tmpvar_1 + 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, // ;. tmpvar_1.xyz + 0x20, 0x3d, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x5f, 0x6c, 0x6f, 0x77, 0x5f, 0x74, 0x65, 0x78, 0x74, // = impl_low_text + 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, 0x20, 0x28, 0x73, // ureCubeLod (s + 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, // _texColor, v_nor + 0x6d, 0x61, 0x6c, 0x2c, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, // mal, u_imageLodE + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, // nabled.x).xyz;. + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x30, // tmpvar_1.w = (0 + 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6d, // .2 + (0.8 * u_im + 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x79, 0x29, // ageLodEnabled.y) + 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, // );. gl_FragColo + 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, // r = tmpvar_1;.}. + 0x0a, 0x00, // .. }; static const uint8_t fs_imgui_cubemap_dx9[373] = { diff --git a/3rdparty/bgfx/examples/common/imgui/fs_imgui_image.bin.h b/3rdparty/bgfx/examples/common/imgui/fs_imgui_image.bin.h index c304d719ac0..3b3513a043b 100644 --- a/3rdparty/bgfx/examples/common/imgui/fs_imgui_image.bin.h +++ b/3rdparty/bgfx/examples/common/imgui/fs_imgui_image.bin.h @@ -1,28 +1,41 @@ -static const uint8_t fs_imgui_image_glsl[360] = +static const uint8_t fs_imgui_image_glsl[567] = { - 0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x02, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima - 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x07, 0x01, 0x00, 0x00, // geLodEnabled.... - 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, // ...s_texColor... - 0x00, 0x01, 0x00, 0x30, 0x01, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, // ...0...varying h - 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ighp vec2 v_texc - 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, // oord0;.uniform h - 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, // ighp vec4 u_imag - 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3b, 0x0a, 0x75, 0x6e, 0x69, // eLodEnabled;.uni - 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, 0x73, // form sampler2D s - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, // _texColor;.void - 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, // main ().{. lowp - 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, // vec4 tmpvar_1;. - 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, // tmpvar_1.xyz = - 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, // texture2DLod - 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, // (s_texColor, v_ - 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2c, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, // texcoord0, u_ima - 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x2e, // geLodEnabled.x). - 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, // xyz;. tmpvar_1. - 0x77, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, 0x20, // w = (0.2 + (0.8 - 0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, // * u_imageLodEnab - 0x6c, 0x65, 0x64, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, // led.y));. gl_Fr - 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // agColor = tmpvar - 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // _1;.}... + 0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x00, 0x00, 0x28, 0x02, 0x00, 0x00, 0x6c, 0x6f, // FSH.o.><..(...lo + 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x5f, 0x6c, 0x6f, 0x77, // wp vec4 impl_low + 0x5f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, // _texture2DLod + 0x28, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, // (lowp sampler2D + 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // sampler, highp v + 0x65, 0x63, 0x32, 0x20, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, // ec2 coord, mediu + 0x6d, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x6c, 0x6f, 0x64, 0x29, 0x0a, 0x7b, 0x0a, // mp float lod).{. + 0x23, 0x69, 0x66, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x28, 0x47, 0x4c, 0x5f, 0x45, // #if defined(GL_E + 0x58, 0x54, 0x5f, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, // XT_shader_textur + 0x65, 0x5f, 0x6c, 0x6f, 0x64, 0x29, 0x0a, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, // e_lod)..return t + 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, 0x28, 0x73, // exture2DLod (s + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6c, // ampler, coord, l + 0x6f, 0x64, 0x29, 0x3b, 0x0a, 0x23, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x09, 0x72, 0x65, 0x74, 0x75, // od);.#else..retu + 0x72, 0x6e, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x28, 0x73, 0x61, 0x6d, // rn texture2D(sam + 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6c, 0x6f, 0x64, // pler, coord, lod + 0x29, 0x3b, 0x0a, 0x23, 0x65, 0x6e, 0x64, 0x69, 0x66, 0x0a, 0x7d, 0x0a, 0x0a, 0x76, 0x61, 0x72, // );.#endif.}..var + 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, // ying highp vec2 + 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, // v_texcoord0;.uni + 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, // form highp vec4 + 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, // u_imageLodEnable + 0x64, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, // d;.uniform sampl + 0x65, 0x72, 0x32, 0x44, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, // er2D s_texColor; + 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, // .void main ().{. + 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, // lowp vec4 tmpv + 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // ar_1;. tmpvar_1 + 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x5f, 0x6c, 0x6f, 0x77, 0x5f, // .xyz = impl_low_ + 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, 0x20, // texture2DLod + 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, // (s_texColor, v_t + 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2c, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, // excoord0, u_imag + 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x2e, 0x78, // eLodEnabled.x).x + 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, // yz;. tmpvar_1.w + 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, 0x20, 0x2a, // = (0.2 + (0.8 * + 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, // u_imageLodEnabl + 0x65, 0x64, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, // ed.y));. gl_Fra + 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // gColor = tmpvar_ + 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // 1;.}... }; static const uint8_t fs_imgui_image_dx9[377] = { diff --git a/3rdparty/bgfx/examples/common/imgui/fs_imgui_image_swizz.bin.h b/3rdparty/bgfx/examples/common/imgui/fs_imgui_image_swizz.bin.h index 83d7b79f6a0..6dcfa501f69 100644 --- a/3rdparty/bgfx/examples/common/imgui/fs_imgui_image_swizz.bin.h +++ b/3rdparty/bgfx/examples/common/imgui/fs_imgui_image_swizz.bin.h @@ -1,32 +1,44 @@ -static const uint8_t fs_imgui_image_swizz_glsl[425] = +static const uint8_t fs_imgui_image_swizz_glsl[616] = { - 0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x03, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima - 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x07, 0x01, 0x00, 0x00, // geLodEnabled.... - 0x01, 0x00, 0x09, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, 0x6c, 0x65, 0x07, 0x01, 0x00, 0x00, // ...u_swizzle.... - 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, // ...s_texColor... - 0x00, 0x01, 0x00, 0x61, 0x01, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, // ...a...varying h - 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ighp vec2 v_texc - 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, // oord0;.uniform h - 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, // ighp vec4 u_imag - 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3b, 0x0a, 0x75, 0x6e, 0x69, // eLodEnabled;.uni + 0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x00, 0x00, 0x59, 0x02, 0x00, 0x00, 0x6c, 0x6f, // FSH.o.><..Y...lo + 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x5f, 0x6c, 0x6f, 0x77, // wp vec4 impl_low + 0x5f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, // _texture2DLod + 0x28, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, // (lowp sampler2D + 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // sampler, highp v + 0x65, 0x63, 0x32, 0x20, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, // ec2 coord, mediu + 0x6d, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x6c, 0x6f, 0x64, 0x29, 0x0a, 0x7b, 0x0a, // mp float lod).{. + 0x23, 0x69, 0x66, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x28, 0x47, 0x4c, 0x5f, 0x45, // #if defined(GL_E + 0x58, 0x54, 0x5f, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, // XT_shader_textur + 0x65, 0x5f, 0x6c, 0x6f, 0x64, 0x29, 0x0a, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, // e_lod)..return t + 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, 0x28, 0x73, // exture2DLod (s + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6c, // ampler, coord, l + 0x6f, 0x64, 0x29, 0x3b, 0x0a, 0x23, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x09, 0x72, 0x65, 0x74, 0x75, // od);.#else..retu + 0x72, 0x6e, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x28, 0x73, 0x61, 0x6d, // rn texture2D(sam + 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6c, 0x6f, 0x64, // pler, coord, lod + 0x29, 0x3b, 0x0a, 0x23, 0x65, 0x6e, 0x64, 0x69, 0x66, 0x0a, 0x7d, 0x0a, 0x0a, 0x76, 0x61, 0x72, // );.#endif.}..var + 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, // ying highp vec2 + 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, // v_texcoord0;.uni 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, // form highp vec4 - 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, 0x6c, 0x65, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, // u_swizzle;.unifo - 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, 0x73, 0x5f, 0x74, // rm sampler2D s_t - 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, // exColor;.void ma - 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, // in ().{. lowp v - 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, // ec4 tmpvar_1;. - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x76, // tmpvar_1.xyz = v - 0x65, 0x63, 0x33, 0x28, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, // ec3(dot (texture - 0x32, 0x44, 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // 2DLod (s_texC - 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // olor, v_texcoord - 0x30, 0x2c, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, // 0, u_imageLodEna - 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x2c, 0x20, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, // bled.x), u_swizz - 0x6c, 0x65, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // le));. tmpvar_1 - 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, // .w = (0.2 + (0.8 - 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, // * u_imageLodEna - 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, // bled.y));. gl_F - 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ragColor = tmpva - 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // r_1;.}... + 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, // u_imageLodEnable + 0x64, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // d;.uniform highp + 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, 0x6c, 0x65, 0x3b, // vec4 u_swizzle; + 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // .uniform sampler + 0x32, 0x44, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x76, // 2D s_texColor;.v + 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, // oid main ().{. + 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // lowp vec4 tmpvar + 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, // _1;. tmpvar_1.x + 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x69, // yz = vec3(dot (i + 0x6d, 0x70, 0x6c, 0x5f, 0x6c, 0x6f, 0x77, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, // mpl_low_texture2 + 0x44, 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, // DLod (s_texCo + 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // lor, v_texcoord0 + 0x2c, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, // , u_imageLodEnab + 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x2c, 0x20, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, 0x6c, // led.x), u_swizzl + 0x65, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, // e));. tmpvar_1. + 0x77, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, 0x20, // w = (0.2 + (0.8 + 0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, // * u_imageLodEnab + 0x6c, 0x65, 0x64, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, // led.y));. gl_Fr + 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // agColor = tmpvar + 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // _1;.}... }; static const uint8_t fs_imgui_image_swizz_dx9[441] = { diff --git a/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h b/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h index af5646500a1..2ecefd4d36d 100644 --- a/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h +++ b/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h @@ -1,26 +1,39 @@ -static const uint8_t fs_imgui_latlong_glsl[649] = +static const uint8_t fs_imgui_latlong_glsl[866] = { - 0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x02, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima - 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x07, 0x01, 0x00, 0x00, // geLodEnabled.... - 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, // ...s_texColor... - 0x00, 0x01, 0x00, 0x51, 0x02, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, // ...Q...varying h - 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ighp vec2 v_texc - 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, // oord0;.uniform h - 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, // ighp vec4 u_imag - 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3b, 0x0a, 0x75, 0x6e, 0x69, // eLodEnabled;.uni - 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, // form lowp sample - 0x72, 0x43, 0x75, 0x62, 0x65, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // rCube s_texColor - 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, // ;.void main ().{ - 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x72, 0x65, // . highp vec3 re - 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // sult_1;. highp - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, // float tmpvar_2;. - 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x5f, // tmpvar_2 = (v_ - 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x36, 0x2e, // texcoord0.x * 6. - 0x32, 0x38, 0x33, 0x31, 0x39, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // 28319);. highp - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, // float tmpvar_3;. - 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x5f, // tmpvar_3 = (v_ - 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x79, 0x20, 0x2a, 0x20, 0x33, 0x2e, // texcoord0.y * 3. - 0x31, 0x34, 0x31, 0x35, 0x39, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, // 14159);. result + 0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x00, 0x00, 0x53, 0x03, 0x00, 0x00, 0x6c, 0x6f, // FSH.o.><..S...lo + 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x5f, 0x6c, 0x6f, 0x77, // wp vec4 impl_low + 0x5f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x4c, 0x6f, 0x64, 0x20, // _textureCubeLod + 0x20, 0x20, 0x28, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x43, // (lowp samplerC + 0x75, 0x62, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x68, 0x69, 0x67, // ube sampler, hig + 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6d, // hp vec3 coord, m + 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x6c, 0x6f, 0x64, // ediump float lod + 0x29, 0x0a, 0x7b, 0x0a, 0x23, 0x69, 0x66, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x28, // ).{.#if defined( + 0x47, 0x4c, 0x5f, 0x45, 0x58, 0x54, 0x5f, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x74, 0x65, // GL_EXT_shader_te + 0x78, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x6c, 0x6f, 0x64, 0x29, 0x0a, 0x09, 0x72, 0x65, 0x74, 0x75, // xture_lod)..retu + 0x72, 0x6e, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x4c, 0x6f, // rn textureCubeLo + 0x64, 0x20, 0x20, 0x20, 0x28, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x63, 0x6f, // d (sampler, co + 0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6c, 0x6f, 0x64, 0x29, 0x3b, 0x0a, 0x23, 0x65, 0x6c, 0x73, 0x65, // ord, lod);.#else + 0x0a, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, // ..return texture + 0x43, 0x75, 0x62, 0x65, 0x28, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x63, 0x6f, // Cube(sampler, co + 0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6c, 0x6f, 0x64, 0x29, 0x3b, 0x0a, 0x23, 0x65, 0x6e, 0x64, 0x69, // ord, lod);.#endi + 0x66, 0x0a, 0x7d, 0x0a, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, // f.}..varying hig + 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // hp vec2 v_texcoo + 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, // rd0;.uniform hig + 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, // hp vec4 u_imageL + 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, // odEnabled;.unifo + 0x72, 0x6d, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x43, // rm lowp samplerC + 0x75, 0x62, 0x65, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, // ube s_texColor;. + 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, // void main ().{. + 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x72, 0x65, 0x73, 0x75, // highp vec3 resu + 0x6c, 0x74, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, // lt_1;. highp fl + 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, // oat tmpvar_2;. + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, // tmpvar_2 = (v_te + 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x36, 0x2e, 0x32, 0x38, // xcoord0.x * 6.28 + 0x33, 0x31, 0x38, 0x35, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, // 3185);. highp f + 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, // loat tmpvar_3;. + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x5f, 0x74, // tmpvar_3 = (v_t + 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x79, 0x20, 0x2a, 0x20, 0x33, 0x2e, 0x31, // excoord0.y * 3.1 + 0x34, 0x31, 0x35, 0x39, 0x33, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, // 41593);. result 0x5f, 0x31, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x28, 0x2d, 0x28, 0x73, 0x69, 0x6e, 0x28, 0x74, 0x6d, // _1.x = (-(sin(tm 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x73, 0x69, 0x6e, 0x28, 0x74, // pvar_3)) * sin(t 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, // mpvar_2));. res @@ -31,16 +44,17 @@ static const uint8_t fs_imgui_latlong_glsl[649] = 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, // tmpvar_2));. lo 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, // wp vec4 tmpvar_4 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, 0x79, 0x7a, // ;. tmpvar_4.xyz - 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x4c, 0x6f, // = textureCubeLo - 0x64, 0x20, 0x20, 0x20, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // d (s_texColor - 0x2c, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x2c, 0x20, 0x75, 0x5f, 0x69, 0x6d, // , result_1, u_im - 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, // ageLodEnabled.x) - 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, // .xyz;. tmpvar_4 - 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, // .w = (0.2 + (0.8 - 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, // * u_imageLodEna - 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, // bled.y));. gl_F - 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ragColor = tmpva - 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // r_4;.}... + 0x20, 0x3d, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x5f, 0x6c, 0x6f, 0x77, 0x5f, 0x74, 0x65, 0x78, 0x74, // = impl_low_text + 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, 0x20, 0x28, 0x73, // ureCubeLod (s + 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, // _texColor, resul + 0x74, 0x5f, 0x31, 0x2c, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, // t_1, u_imageLodE + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, // nabled.x).xyz;. + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x30, // tmpvar_4.w = (0 + 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6d, // .2 + (0.8 * u_im + 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x79, 0x29, // ageLodEnabled.y) + 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, // );. gl_FragColo + 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x7d, 0x0a, // r = tmpvar_4;.}. + 0x0a, 0x00, // .. }; static const uint8_t fs_imgui_latlong_dx9[537] = { diff --git a/3rdparty/bgfx/examples/common/imgui/imgui.cpp b/3rdparty/bgfx/examples/common/imgui/imgui.cpp index 646d13b0d0a..6df549c1c2f 100644 --- a/3rdparty/bgfx/examples/common/imgui/imgui.cpp +++ b/3rdparty/bgfx/examples/common/imgui/imgui.cpp @@ -456,7 +456,7 @@ struct Imgui } } - return bgfx::createTexture2D(_width, _height, 0, bgfx::TextureFormat::BGRA8, 0, mem); + return bgfx::createTexture2D(uint16_t(_width), uint16_t(_height), 0, bgfx::TextureFormat::BGRA8, 0, mem); } ImguiFontHandle create(const void* _data, uint32_t _size, float _fontSize) @@ -910,7 +910,7 @@ struct Imgui Area& area = getCurrentArea(); const uint16_t parentBottom = parentArea.m_scissorY + parentArea.m_scissorHeight; - const uint16_t childBottom = parentArea.m_widgetY + _height; + const uint16_t childBottom = parentArea.m_widgetY + _height; const uint16_t bottom = IMGUI_MIN(childBottom, parentBottom); const uint16_t top = IMGUI_MAX(parentArea.m_widgetY, parentArea.m_scissorY); diff --git a/3rdparty/bgfx/examples/common/imgui/makefile b/3rdparty/bgfx/examples/common/imgui/makefile index 16bd27b5537..70d3ff0e69d 100644 --- a/3rdparty/bgfx/examples/common/imgui/makefile +++ b/3rdparty/bgfx/examples/common/imgui/makefile @@ -5,8 +5,8 @@ include ../../../scripts/shader-embeded.mk -droidsans.ttf.h: ../runtime/font/droidsans.ttf - bin2c -f $(<) -o $(@) -n s_droidSansTtf +droidsans.ttf.h: ../../runtime/font/droidsans.ttf + @bin2c -f $(<) -o $(@) -n s_droidSansTtf rebuild: droidsans.ttf.h @make -s --no-print-directory clean all diff --git a/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp b/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp index 19726040b04..c12b494e47c 100644 --- a/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp +++ b/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp @@ -86,6 +86,7 @@ struct OcornutImguiContext ImGuiIO& io = ImGui::GetIO(); io.DisplaySize = ImVec2(1280.0f, 720.0f); io.DeltaTime = 1.0f / 60.0f; + io.IniFilename = NULL; // io.PixelCenterOffset = bgfx::RendererType::Direct3D9 == bgfx::getRendererType() ? -0.5f : 0.0f; const bgfx::Memory* vsmem; diff --git a/3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.bin.h b/3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.bin.h index bb168300e08..f3ddc68571a 100644 --- a/3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.bin.h +++ b/3rdparty/bgfx/examples/common/imgui/vs_imgui_latlong.bin.h @@ -10,16 +10,16 @@ static const uint8_t vs_imgui_latlong_glsl[337] = 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ighp vec2 v_texc 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, // oord0;.uniform h 0x69, 0x67, 0x68, 0x70, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, // ighp mat4 u_mode - 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, // lViewProj;.void + 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, // lViewProj;.void 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, // main ().{. high 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, // p vec4 tmpvar_1; - 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, // . tmpvar_1.w = + 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, // . tmpvar_1.w = 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, // 1.0;. tmpvar_1. 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, // xyz = a_position - 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, // ;. gl_Position + 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, // ;. gl_Position 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, // = (u_modelViewPr 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, // oj * tmpvar_1);. - 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, // v_texcoord0 = + 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, // v_texcoord0 = 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, // a_texcoord0;.}.. 0x00, // . }; diff --git a/3rdparty/bgfx/examples/common/nanovg/nanovg.cpp b/3rdparty/bgfx/examples/common/nanovg/nanovg.cpp index 7c472f2664b..2f0106dc4f3 100644 --- a/3rdparty/bgfx/examples/common/nanovg/nanovg.cpp +++ b/3rdparty/bgfx/examples/common/nanovg/nanovg.cpp @@ -36,6 +36,7 @@ BX_PRAGMA_DIAGNOSTIC_POP(); BX_PRAGMA_DIAGNOSTIC_PUSH(); BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wmissing-field-initializers"); +BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wshadow"); #define STB_IMAGE_IMPLEMENTATION #include <stb/stb_image.c> BX_PRAGMA_DIAGNOSTIC_POP(); diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_bump.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_bump.bin Binary files differindex bd1b0b39a34..2c5bad44d23 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_bump.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_bump.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_callback.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_callback.bin Binary files differindex 1f0a41a0aff..d55eef9ec9e 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_callback.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_callback.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_combine.bin Binary files differindex b4b21fe8080..6c4068356e3 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_combine.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_combine.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_geom.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_geom.bin Binary files differindex 02620f26c01..75244097861 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_geom.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_geom.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_light.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_light.bin Binary files differindex 52049826f78..be822092996 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_light.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_deferred_light.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_blur.bin Binary files differindex c3c7a756438..a67575a01d2 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_blur.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_blur.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_bright.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_bright.bin Binary files differindex 18080eaa428..631547846eb 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_bright.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_bright.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_lum.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_lum.bin Binary files differindex 84e8aa166a2..db6d2f22c7a 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_lum.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_lum.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_lumavg.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_lumavg.bin Binary files differindex cecee380bce..2e2f8d0a53c 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_lumavg.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_lumavg.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_mesh.bin Binary files differindex ce1cbecac17..a1dfd098153 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_mesh.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_mesh.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_skybox.bin Binary files differindex d60ebffb91e..8f3921cd48a 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_skybox.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_skybox.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_tonemap.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_tonemap.bin Binary files differindex 4057ab20740..e325d9aaf34 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_tonemap.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_hdr_tonemap.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_mesh.bin Binary files differindex 593b4035fd1..3b1e2a9d475 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_mesh.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_mesh.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_skybox.bin Binary files differindex 210b17f129e..2391fe7b564 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_skybox.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_ibl_skybox.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_mesh.bin Binary files differindex 83b7f6530c9..6778a6775b8 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_mesh.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_mesh.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb.bin Binary files differindex 90653eb664e..ca7e14ff481 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_separate.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_separate.bin Binary files differindex 5b8d4079865..69f3e65b1c8 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_separate.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_oit_wb_separate.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_particle.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_particle.bin Binary files differindex a35ea3a5893..1dad1e78498 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_particle.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_particle.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_raymarching.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_raymarching.bin Binary files differindex f8bc5713a8d..a74f5480d3c 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_raymarching.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_raymarching.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm.bin Binary files differindex c5fd1c3105e..5773bf8d645 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_csm.bin Binary files differindex 2cfb20997c9..906ba8f7f9a 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_csm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_csm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear.bin Binary files differindex ffa9fb102b3..2b3cde2337e 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_csm.bin Binary files differindex c6f7fc404ad..18b39077f70 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_csm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_csm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_omni.bin Binary files differindex f446b32afb5..a7cec2fea33 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_omni.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_omni.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_omni.bin Binary files differindex a54a3bf12cb..f4818f22a0f 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_omni.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_omni.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard.bin Binary files differindex db222dcd015..914747da536 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_csm.bin Binary files differindex 47599ed5381..c80ba6ecdec 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_csm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_csm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear.bin Binary files differindex 08aeefb2bb6..329b1225b88 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_csm.bin Binary files differindex eab327a4e77..01e40a99eae 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_csm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_csm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_omni.bin Binary files differindex a82249c8143..23e29df5357 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_omni.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_omni.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_omni.bin Binary files differindex 5024ad6b3a2..517e512e013 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_omni.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_omni.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf.bin Binary files differindex 0e09ce4bbc2..48bfc2ec60c 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_csm.bin Binary files differindex d9e11958c77..02667048c6d 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_csm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_csm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear.bin Binary files differindex 1cf99948eb9..a73e6cc979f 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_csm.bin Binary files differindex 669d1f1f2f2..eb61e6db2c6 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_csm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_csm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_omni.bin Binary files differindex e6f9d43efdb..698c291bcc5 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_omni.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_omni.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_omni.bin Binary files differindex 2a71d9446be..cb0d959d34c 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_omni.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_omni.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm.bin Binary files differindex 71239533f6f..907d6a7c57a 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_csm.bin Binary files differindex f9417cf3afa..410990553d4 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_csm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_csm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear.bin Binary files differindex 4186d25d3f4..37dc9ba8b27 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_csm.bin Binary files differindex 45e2553f530..4eb24bdf2ba 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_csm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_csm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_omni.bin Binary files differindex f6b420c98cc..d70201736cc 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_omni.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_omni.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_omni.bin Binary files differindex 1e3206f1685..4f12e4a01e6 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_omni.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_omni.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_texture.bin Binary files differindex b0e14f96314..48ad9bde0f2 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_texture.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_color_texture.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_hblur.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_hblur.bin Binary files differindex 794764bd595..ccd3ccb0b92 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_hblur.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_hblur.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_hblur_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_hblur_vsm.bin Binary files differindex 5d803164d9c..88a9091830f 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_hblur_vsm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_hblur_vsm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth.bin Binary files differindex 3d355ffeee2..32016f68624 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_linear.bin Binary files differindex 258fcd028f5..5e9e46a3f39 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_linear.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_linear.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm.bin Binary files differindex e10f6b04bd6..811e3eb7197 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm_linear.bin Binary files differindex 695cbd809cb..89ddb22f716 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm_linear.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm_linear.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth.bin Binary files differindex a8d5a8a0e19..ecc466bed9e 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth_vsm.bin Binary files differindex 8e960582593..e004d5bd2dd 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth_vsm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth_vsm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_vblur.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_vblur.bin Binary files differindex 794764bd595..ccd3ccb0b92 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_vblur.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_vblur.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_vblur_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_vblur_vsm.bin Binary files differindex 5d803164d9c..88a9091830f 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_vblur_vsm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowmaps_vblur_vsm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_color_lightning.bin Binary files differindex fd1141a446b..f0f4f35a2f2 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_color_lightning.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_color_lightning.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_color_texture.bin Binary files differindex b0e14f96314..48ad9bde0f2 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_color_texture.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_color_texture.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex1.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex1.bin Binary files differindex 4def09326e5..75de052c027 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex1.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex1.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex2.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex2.bin Binary files differindex 737f259a53c..765483377bb 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex2.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex2.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex1.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex1.bin Binary files differindex aefbc4af22e..abf74d5f109 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex1.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex1.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex2.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex2.bin Binary files differindex 25930887709..1fb23be2a48 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex2.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex2.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svside.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svside.bin Binary files differindex 0bca79b19a3..8e5f01d7440 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svside.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svside.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svsidetex.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svsidetex.bin Binary files differindex 4aba4fd2f1d..d01b3a0303d 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svsidetex.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_svsidetex.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_texture_lightning.bin Binary files differindex b37053471f5..ed4bd0584ea 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_texture_lightning.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_shadowvolume_texture_lightning.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_mesh.bin Binary files differindex d5aafc8fa96..f47b0335341 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_mesh.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_mesh.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_mesh_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_mesh_pd.bin Binary files differindex d8f982f2263..1a751a63f51 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_mesh_pd.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_mesh_pd.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_shadow_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_shadow_pd.bin Binary files differindex 3d355ffeee2..32016f68624 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_shadow_pd.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_sms_shadow_pd.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_lightning.bin Binary files differindex e0c5a4d87a9..e4d2da062ef 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_lightning.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_lightning.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_texture.bin Binary files differindex b0e14f96314..48ad9bde0f2 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_texture.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_color_texture.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_texture_lightning.bin Binary files differindex b770bf619f6..18d0cac34e4 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_texture_lightning.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_stencil_texture_lightning.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_tree.bin b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_tree.bin Binary files differindex 5ad82981e55..b268a905f43 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/gles/fs_tree.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/gles/fs_tree.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_init_instances.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_init_instances.bin Binary files differindex e1308e1fb07..dc22cc94a45 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_init_instances.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_init_instances.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_update_instances.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_update_instances.bin Binary files differindex 1ebe5635e9c..36acf9bd63c 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_update_instances.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_update_instances.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_bump.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_bump.bin Binary files differindex dd51243c4ea..6afd5f5bce6 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_bump.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_bump.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_callback.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_callback.bin Binary files differindex b38814929bf..7ee39df1960 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_callback.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_callback.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_combine.bin Binary files differindex 6051aa54b86..51568821223 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_combine.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_combine.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_light.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_light.bin Binary files differindex 584eb2a762b..df0a7d10736 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_light.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_light.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_blur.bin Binary files differindex 7875cc166fc..833c51dc4e1 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_blur.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_blur.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_bright.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_bright.bin Binary files differindex 57f4ab09e73..675f22c2d50 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_bright.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_bright.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_lum.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_lum.bin Binary files differindex c5e0455b9c5..499021728d4 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_lum.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_lum.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_mesh.bin Binary files differindex 351c86f6e6f..fc4ed71ccb3 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_mesh.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_mesh.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_tonemap.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_tonemap.bin Binary files differindex 0f0c0daad82..f636cca2d63 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_tonemap.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hdr_tonemap.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_mesh.bin Binary files differindex d8b9b213e7b..16e65568a00 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_mesh.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_mesh.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb.bin Binary files differindex aab19ec9816..f20d59cf4e0 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_separate.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_separate.bin Binary files differindex 67bc5941872..faf3b61feb2 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_separate.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_oit_wb_separate.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_raymarching.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_raymarching.bin Binary files differindex 46dd45cbc51..2fd4cee5af7 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_raymarching.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_raymarching.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm.bin Binary files differindex 58b1271f28f..278a8966a92 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_csm.bin Binary files differindex 33b90e79822..069d4edae92 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_csm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_csm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear.bin Binary files differindex 5dda3bf1e6f..4ddd96f2f55 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_csm.bin Binary files differindex abf0aeed6e3..dc17b2a33d5 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_csm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_csm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_omni.bin Binary files differindex 52100573247..d1f3dad4a7f 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_omni.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_omni.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_omni.bin Binary files differindex 41704971052..e9b32d94007 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_omni.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_omni.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard.bin Binary files differindex 44844939dc8..770919c8d60 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_csm.bin Binary files differindex bf7e8702bc8..c5634757c1f 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_csm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_csm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear.bin Binary files differindex fe24d2017ae..bf130fa6fa0 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_csm.bin Binary files differindex e81fb8835a6..69370b6389c 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_csm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_csm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_omni.bin Binary files differindex 1159daa2d6d..c989ab3c49c 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_omni.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_omni.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_omni.bin Binary files differindex 5079324c2b4..3312684c8f5 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_omni.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_omni.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf.bin Binary files differindex b11350e8be5..06571f9ccef 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_csm.bin Binary files differindex c8cebc0193b..5d70346d740 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_csm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_csm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear.bin Binary files differindex d02a8c67cb4..9a41ad4c4d6 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_csm.bin Binary files differindex 3af37e8d559..896d25f3c37 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_csm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_csm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_omni.bin Binary files differindex e043d034bc6..bc38e19c473 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_omni.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_omni.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_omni.bin Binary files differindex 973b40e544a..cbbda2ece80 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_omni.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_omni.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm.bin Binary files differindex 2c9669e24b0..53740d1999a 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_csm.bin Binary files differindex 8ef3b0b5ce0..f5c7d817a69 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_csm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_csm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear.bin Binary files differindex a0a4ef26696..cb7329ddb3c 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_csm.bin Binary files differindex e811c155236..3c739b5dab8 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_csm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_csm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_omni.bin Binary files differindex 73b2ccf68dd..cc4183adfa6 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_omni.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_omni.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_omni.bin Binary files differindex 060d27bac2d..dd433625fe5 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_omni.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_omni.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_texture.bin Binary files differindex 3d8b903438a..1985a019ffa 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_texture.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_color_texture.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_hblur.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_hblur.bin Binary files differindex eaee634cc15..d4604e69814 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_hblur.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_hblur.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_hblur_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_hblur_vsm.bin Binary files differindex 36fdf9192ee..67ff0cca32d 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_hblur_vsm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_hblur_vsm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth.bin Binary files differindex afcaa52de79..eb8f7c6bed4 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_linear.bin Binary files differindex a10b25f99a1..c8f04eea2b8 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_linear.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_linear.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth.bin Binary files differindex f088e157b8e..6c989953f4c 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_vblur.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_vblur.bin Binary files differindex eaee634cc15..d4604e69814 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_vblur.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_vblur.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_vblur_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_vblur_vsm.bin Binary files differindex 36fdf9192ee..67ff0cca32d 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_vblur_vsm.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowmaps_vblur_vsm.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_color_lightning.bin Binary files differindex 43082cc67ac..6e33b509f45 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_color_lightning.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_color_lightning.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_color_texture.bin Binary files differindex 3d8b903438a..1985a019ffa 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_color_texture.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_color_texture.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_texture_lightning.bin Binary files differindex 878dcf5f866..4a53ef15b18 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_texture_lightning.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_shadowvolume_texture_lightning.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_mesh.bin Binary files differindex 69a26dab6fd..e8a1b580115 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_mesh.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_mesh.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_mesh_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_mesh_pd.bin Binary files differindex 341dd92d739..d33ead89b0f 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_mesh_pd.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_mesh_pd.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_shadow_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_shadow_pd.bin Binary files differindex afcaa52de79..eb8f7c6bed4 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_shadow_pd.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_sms_shadow_pd.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_lightning.bin Binary files differindex 24b62460635..d36d01338cd 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_lightning.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_lightning.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_texture.bin Binary files differindex 3d8b903438a..1985a019ffa 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_texture.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_color_texture.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_texture_lightning.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_texture_lightning.bin Binary files differindex da513dea90c..474a9b3ccdf 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_texture_lightning.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_stencil_texture_lightning.bin diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_tree.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_tree.bin Binary files differindex 3c7cad2cb47..112f7772b48 100644 --- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_tree.bin +++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_tree.bin diff --git a/3rdparty/bgfx/include/bgfx.c99.h b/3rdparty/bgfx/include/bgfx.c99.h index 38b55e327bb..307fc4fd334 100644 --- a/3rdparty/bgfx/include/bgfx.c99.h +++ b/3rdparty/bgfx/include/bgfx.c99.h @@ -167,6 +167,12 @@ BGFX_HANDLE_T(bgfx_vertex_decl_handle); #undef BGFX_HANDLE_T /** + * + */ +typedef void (*bgfx_release_fn_t)(void* _ptr, void* _userData); + +/** + * */ typedef struct bgfx_memory { @@ -176,6 +182,7 @@ typedef struct bgfx_memory } bgfx_memory_t; /** + * */ typedef struct bgfx_transform { @@ -635,6 +642,11 @@ BGFX_C_API const bgfx_memory_t* bgfx_copy(const void* _data, uint32_t _size); BGFX_C_API const bgfx_memory_t* bgfx_make_ref(const void* _data, uint32_t _size); /** + * + */ +BGFX_C_API const bgfx_memory_t* bgfx_make_ref_release(const void* _data, uint32_t _size, bgfx_release_fn_t _releaseFn, void* _userData); + +/** * Set debug flags. * * @param _debug Available flags: diff --git a/3rdparty/bgfx/include/bgfx.h b/3rdparty/bgfx/include/bgfx.h index 257086a54fb..7462fc2274a 100644 --- a/3rdparty/bgfx/include/bgfx.h +++ b/3rdparty/bgfx/include/bgfx.h @@ -279,6 +279,9 @@ namespace bgfx } /// + typedef void (*ReleaseFn)(void* _ptr, void* _userData); + + /// struct Memory { uint8_t* data; @@ -604,8 +607,11 @@ namespace bgfx /// Make reference to data to pass to bgfx. Unlike `bgfx::alloc` this call /// doesn't allocate memory for data. It just copies pointer to data. You - /// must make sure data is available for at least 2 `bgfx::frame` calls. - const Memory* makeRef(const void* _data, uint32_t _size); + /// can pass `ReleaseFn` function pointer to release this memory after it's + /// consumed, or you must make sure data is available for at least 2 + /// `bgfx::frame` calls. `ReleaseFn` function must be able to be called + /// called from any thread. + const Memory* makeRef(const void* _data, uint32_t _size, ReleaseFn _releaseFn = NULL, void* _userData = NULL); /// Set debug flags. /// @@ -1058,6 +1064,14 @@ namespace bgfx /// @remarks /// This is debug only feature. /// + /// In graphics debugger view name will appear as: + /// + /// "nnnce <view name>" + /// ^ ^^ ^ + /// | |+-- eye (L/R) + /// | +-- compute (C) + /// +-- view id + /// void setViewName(uint8_t _id, const char* _name); /// Set view rectangle. Draw primitive outside view will be clipped. diff --git a/3rdparty/bgfx/scripts/bgfx.lua b/3rdparty/bgfx/scripts/bgfx.lua index b02fea8a40a..a3b1899fbc7 100644 --- a/3rdparty/bgfx/scripts/bgfx.lua +++ b/3rdparty/bgfx/scripts/bgfx.lua @@ -76,7 +76,7 @@ function bgfxProject(_name, _kind, _defines) "GLESv2", } - configuration { "mingw* or vs2008" } + configuration { "vs2008" } includedirs { "$(DXSDK_DIR)/include", } diff --git a/3rdparty/bgfx/scripts/example-common.lua b/3rdparty/bgfx/scripts/example-common.lua index d408224e319..96040b6bfe5 100644 --- a/3rdparty/bgfx/scripts/example-common.lua +++ b/3rdparty/bgfx/scripts/example-common.lua @@ -37,7 +37,7 @@ project ("example-common") } end - configuration { "mingw* or vs2008" } + configuration { "vs2008" } includedirs { "$(DXSDK_DIR)/include", } diff --git a/3rdparty/bgfx/scripts/shaderc.lua b/3rdparty/bgfx/scripts/shaderc.lua index 387dd5d2878..aa43154813a 100644 --- a/3rdparty/bgfx/scripts/shaderc.lua +++ b/3rdparty/bgfx/scripts/shaderc.lua @@ -33,7 +33,11 @@ project "shaderc" configuration { "mingw* or linux or osx" } buildoptions { - "-fno-strict-aliasing" -- glsl-optimizer has bugs if strict aliasing is used. + "-fno-strict-aliasing", -- glsl-optimizer has bugs if strict aliasing is used. + "-Wno-unused-parameter", + } + removebuildoptions { + "-Wshadow", -- glsl-optimizer is full of -Wshadow warnings ignore it. } configuration { "osx" } @@ -46,11 +50,13 @@ project "shaderc" path.join(GLSL_OPTIMIZER, "include/c99"), } - configuration { "windows" } + configuration { "vs*" } includedirs { "$(DXSDK_DIR)/include", } + + configuration { "windows" } links { "d3dx9", "d3dcompiler", @@ -102,7 +108,7 @@ project "shaderc" path.join(GLSL_OPTIMIZER, "src/util/**.h"), } - excludes { + removefiles { path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/glcpp.c"), path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/tests/**"), path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/**.l"), diff --git a/3rdparty/bgfx/src/bgfx.cpp b/3rdparty/bgfx/src/bgfx.cpp index 3a353942cc5..677d7e26a25 100644 --- a/3rdparty/bgfx/src/bgfx.cpp +++ b/3rdparty/bgfx/src/bgfx.cpp @@ -485,12 +485,12 @@ namespace bgfx memcpy(vertex, vert, sizeof(vert) ); vertex += 4; - indices[0] = startVertex+0; - indices[1] = startVertex+1; - indices[2] = startVertex+2; - indices[3] = startVertex+2; - indices[4] = startVertex+3; - indices[5] = startVertex+0; + indices[0] = uint16_t(startVertex+0); + indices[1] = uint16_t(startVertex+1); + indices[2] = uint16_t(startVertex+2); + indices[3] = uint16_t(startVertex+2); + indices[4] = uint16_t(startVertex+3); + indices[5] = uint16_t(startVertex+0); startVertex += 4; indices += 6; @@ -819,6 +819,10 @@ namespace bgfx BGFX_CHECK_RENDER_THREAD(); if (s_ctx->renderFrame() ) { + Context* ctx = s_ctx; + ctx->gameSemWait(); + s_ctx = NULL; + ctx->renderSemPost(); return RenderFrame::Exiting; } @@ -969,7 +973,7 @@ namespace bgfx for (uint32_t ii = 0; ii < BX_COUNTOF(m_viewRemap); ++ii) { - m_viewRemap[ii] = ii; + m_viewRemap[ii] = uint8_t(ii); } memset(m_fb, 0xff, sizeof(m_fb) ); @@ -1054,15 +1058,18 @@ namespace bgfx m_declRef.shutdown(m_vertexDeclHandle); #if BGFX_CONFIG_MULTITHREADED + // Render thread shutdown sequence. + renderSemWait(); // Wait for previous frame. + gameSemPost(); // OK to set context to NULL. + // s_ctx is NULL here. + renderSemWait(); // In RenderFrame::Exiting state. + if (m_thread.isRunning() ) { m_thread.shutdown(); } #endif // BGFX_CONFIG_MULTITHREADED - s_ctx = NULL; // Can't be used by renderFrame at this point. - renderSemWait(); - m_submit->destroy(); m_render->destroy(); @@ -1204,7 +1211,10 @@ namespace bgfx freeAllHandles(m_submit); m_submit->resetFreeHandles(); - m_submit->m_textVideoMem->resize(m_render->m_textVideoMem->m_small, m_resolution.m_width, m_resolution.m_height); + m_submit->m_textVideoMem->resize(m_render->m_textVideoMem->m_small + , m_resolution.m_width + , m_resolution.m_height + ); } bool Context::renderFrame() @@ -2099,18 +2109,41 @@ again: return mem; } - const Memory* makeRef(const void* _data, uint32_t _size) + struct MemoryRef { - Memory* mem = (Memory*)BX_ALLOC(g_allocator, sizeof(Memory) ); - mem->size = _size; - mem->data = (uint8_t*)_data; - return mem; + Memory mem; + ReleaseFn releaseFn; + void* userData; + }; + + const Memory* makeRef(const void* _data, uint32_t _size, ReleaseFn _releaseFn, void* _userData) + { + MemoryRef* memRef = (MemoryRef*)BX_ALLOC(g_allocator, sizeof(MemoryRef) ); + memRef->mem.size = _size; + memRef->mem.data = (uint8_t*)_data; + memRef->releaseFn = _releaseFn; + memRef->userData = _userData; + return &memRef->mem; + } + + bool isMemoryRef(const Memory* _mem) + { + return _mem->data != (uint8_t*)_mem + sizeof(Memory); } void release(const Memory* _mem) { BX_CHECK(NULL != _mem, "_mem can't be NULL"); - BX_FREE(g_allocator, const_cast<Memory*>(_mem) ); + Memory* mem = const_cast<Memory*>(_mem); + if (isMemoryRef(mem) ) + { + MemoryRef* memRef = reinterpret_cast<MemoryRef*>(mem); + if (NULL != memRef->releaseFn) + { + memRef->releaseFn(mem->data, memRef->userData); + } + } + BX_FREE(g_allocator, mem); } void setDebug(uint32_t _debug) @@ -2350,15 +2383,15 @@ again: { const ImageBlockInfo& blockInfo = getBlockInfo(_format); const uint8_t bpp = blockInfo.bitsPerPixel; - const uint32_t blockWidth = blockInfo.blockWidth; - const uint32_t blockHeight = blockInfo.blockHeight; - const uint32_t minBlockX = blockInfo.minBlockX; - const uint32_t minBlockY = blockInfo.minBlockY; + const uint16_t blockWidth = blockInfo.blockWidth; + const uint16_t blockHeight = blockInfo.blockHeight; + const uint16_t minBlockX = blockInfo.minBlockX; + const uint16_t minBlockY = blockInfo.minBlockY; - _width = bx::uint32_max(blockWidth * minBlockX, ( (_width + blockWidth - 1) / blockWidth)*blockWidth); - _height = bx::uint32_max(blockHeight * minBlockY, ( (_height + blockHeight - 1) / blockHeight)*blockHeight); - _depth = bx::uint32_max(1, _depth); - _numMips = bx::uint32_max(1, _numMips); + _width = bx::uint16_max(blockWidth * minBlockX, ( (_width + blockWidth - 1) / blockWidth)*blockWidth); + _height = bx::uint16_max(blockHeight * minBlockY, ( (_height + blockHeight - 1) / blockHeight)*blockHeight); + _depth = bx::uint16_max(1, _depth); + _numMips = uint8_t(bx::uint16_max(1, _numMips) ); uint32_t width = _width; uint32_t height = _height; @@ -2400,7 +2433,7 @@ again: { BGFX_CHECK_MAIN_THREAD(); - _numMips = bx::uint32_max(1, _numMips); + _numMips = uint8_t(bx::uint32_max(1, _numMips) ); if (BX_ENABLED(BGFX_CONFIG_DEBUG) && NULL != _mem) @@ -2441,7 +2474,7 @@ again: BGFX_CHECK_MAIN_THREAD(); BX_CHECK(0 != (g_caps.supported & BGFX_CAPS_TEXTURE_3D), "Texture3D is not supported! Use bgfx::getCaps to check backend renderer capabilities."); - _numMips = bx::uint32_max(1, _numMips); + _numMips = uint8_t(bx::uint32_max(1, _numMips) ); if (BX_ENABLED(BGFX_CONFIG_DEBUG) && NULL != _mem) @@ -2481,7 +2514,7 @@ again: { BGFX_CHECK_MAIN_THREAD(); - _numMips = bx::uint32_max(1, _numMips); + _numMips = uint8_t(bx::uint32_max(1, _numMips) ); if (BX_ENABLED(BGFX_CONFIG_DEBUG) && NULL != _mem) @@ -2621,10 +2654,10 @@ again: { BGFX_CHECK_MAIN_THREAD(); - const uint8_t rr = _rgba>>24; - const uint8_t gg = _rgba>>16; - const uint8_t bb = _rgba>> 8; - const uint8_t aa = _rgba>> 0; + const uint8_t rr = uint8_t(_rgba>>24); + const uint8_t gg = uint8_t(_rgba>>16); + const uint8_t bb = uint8_t(_rgba>> 8); + const uint8_t aa = uint8_t(_rgba>> 0); float rgba[4] = { @@ -3073,6 +3106,11 @@ BGFX_C_API const bgfx_memory_t* bgfx_make_ref(const void* _data, uint32_t _size) return (const bgfx_memory_t*)bgfx::makeRef(_data, _size); } +BGFX_C_API const bgfx_memory_t* bgfx_make_ref_release(const void* _data, uint32_t _size, bgfx_release_fn_t _releaseFn, void* _userData) +{ + return (const bgfx_memory_t*)bgfx::makeRef(_data, _size, _releaseFn, _userData); +} + BGFX_C_API void bgfx_set_debug(uint32_t _debug) { bgfx::setDebug(_debug); diff --git a/3rdparty/bgfx/src/bgfx_p.h b/3rdparty/bgfx/src/bgfx_p.h index efc413a62da..63a3032529c 100644 --- a/3rdparty/bgfx/src/bgfx_p.h +++ b/3rdparty/bgfx/src/bgfx_p.h @@ -379,7 +379,7 @@ namespace bgfx BX_FREE(g_allocator, m_mem); } - void resize(bool _small = false, uint16_t _width = BGFX_DEFAULT_WIDTH, uint16_t _height = BGFX_DEFAULT_HEIGHT) + void resize(bool _small = false, uint32_t _width = BGFX_DEFAULT_WIDTH, uint32_t _height = BGFX_DEFAULT_HEIGHT) { uint32_t width = bx::uint32_max(1, _width/8); uint32_t height = bx::uint32_max(1, _height/(_small ? 8 : 16) ); @@ -389,8 +389,8 @@ namespace bgfx || m_height != height || m_small != _small) { - m_small = _small; - m_width = (uint16_t)width; + m_small = _small; + m_width = (uint16_t)width; m_height = (uint16_t)height; uint32_t size = m_size; @@ -701,7 +701,7 @@ namespace bgfx void operator=(const CommandBuffer&); }; -#define SORT_KEY_RENDER_DRAW (UINT64_C(1)<<0x2b) +#define SORT_KEY_RENDER_DRAW (UINT64_C(1)<<0x36) #define SORT_KEY_VIEW_SHIFT UINT8_C(0x37) #define SORT_KEY_VIEW_MASK ( (uint64_t(BGFX_CONFIG_MAX_VIEWS-1) )<<SORT_KEY_VIEW_SHIFT) @@ -714,16 +714,16 @@ namespace bgfx { // | 3 2 1 0| // |fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210| - // | vvvvvvvvsssssssssssdttpppppppppdddddddddddddddddddddddddddddddd| - // | ^ ^^ ^ ^ ^| - // | | || | | || - // | view-+ seq-+| +-trans +-program depth-+| - // | +-draw | + // | vvvvvvvvdsssssssssssttpppppppppdddddddddddddddddddddddddddddddd| + // | ^^ ^ ^ ^ ^| + // | || | | | || + // | view-+| seq-+ +-trans +-program depth-+| + // | +-draw | const uint64_t depth = m_depth; const uint64_t program = uint64_t(m_program)<<0x20; const uint64_t trans = uint64_t(m_trans )<<0x29; - const uint64_t seq = uint64_t(m_seq )<<0x2c; + const uint64_t seq = uint64_t(m_seq )<<0x2b; const uint64_t view = uint64_t(m_view )<<SORT_KEY_VIEW_SHIFT; const uint64_t key = depth|program|trans|SORT_KEY_RENDER_DRAW|seq|view; return key; @@ -733,14 +733,14 @@ namespace bgfx { // | 3 2 1 0| // |fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210| - // | vvvvvvvvsssssssssssdppppppppp | - // | ^ ^^ ^ | - // | | || | | - // | view-+ seq-+| +-program | - // | +-draw | + // | vvvvvvvvdsssssssssssppppppppp | + // | ^^ ^ ^ | + // | || | | | + // | view-+| seq-+ +-program | + // | +-draw | const uint64_t program = uint64_t(m_program)<<0x22; - const uint64_t seq = uint64_t(m_seq )<<0x2c; + const uint64_t seq = uint64_t(m_seq )<<0x2b; const uint64_t view = uint64_t(m_view )<<SORT_KEY_VIEW_SHIFT; const uint64_t key = program|seq|view; return key; @@ -1418,7 +1418,7 @@ namespace bgfx { m_draw.m_instanceDataOffset = _idb->offset; m_draw.m_instanceDataStride = _idb->stride; - m_draw.m_numInstances = bx::uint32_min(_idb->num, _num); + m_draw.m_numInstances = uint16_t(bx::uint32_min(_idb->num, _num) ); m_draw.m_instanceDataBuffer = _idb->handle; BX_FREE(g_allocator, const_cast<InstanceDataBuffer*>(_idb) ); } @@ -1427,7 +1427,7 @@ namespace bgfx { m_draw.m_instanceDataOffset = _startVertex * _stride; m_draw.m_instanceDataStride = _stride; - m_draw.m_numInstances = _num; + m_draw.m_numInstances = uint16_t(_num); m_draw.m_instanceDataBuffer = _handle; } @@ -1768,9 +1768,9 @@ namespace bgfx if (0 < m_free.size() ) { - Free free = m_free.front(); + Free freeBlock = m_free.front(); m_free.pop_front(); - return free.m_ptr; + return freeBlock.m_ptr; } return 0; @@ -1934,11 +1934,10 @@ namespace bgfx { } - static int32_t renderThread(void* _userData) + static int32_t renderThread(void* /*_userData*/) { BX_TRACE("render thread start"); - Context* ctx = (Context*)_userData; - while (!ctx->renderFrame() ) {}; + while (RenderFrame::Exiting != bgfx::renderFrame() ) {}; BX_TRACE("render thread exit"); return EXIT_SUCCESS; } @@ -3069,10 +3068,10 @@ namespace bgfx { Clear& clear = m_clear[_id]; clear.m_flags = _flags; - clear.m_index[0] = _rgba>>24; - clear.m_index[1] = _rgba>>16; - clear.m_index[2] = _rgba>> 8; - clear.m_index[3] = _rgba>> 0; + clear.m_index[0] = uint8_t(_rgba>>24); + clear.m_index[1] = uint8_t(_rgba>>16); + clear.m_index[2] = uint8_t(_rgba>> 8); + clear.m_index[3] = uint8_t(_rgba>> 0); clear.m_depth = _depth; clear.m_stencil = _stencil; } diff --git a/3rdparty/bgfx/src/config.h b/3rdparty/bgfx/src/config.h index 07fde5584d9..791f39a7aad 100644 --- a/3rdparty/bgfx/src/config.h +++ b/3rdparty/bgfx/src/config.h @@ -180,7 +180,7 @@ # define BGFX_CONFIG_MAX_VIEWS 256 #endif // BGFX_CONFIG_MAX_VIEWS -#define BGFX_CONFIG_MAX_VIEW_NAME_RESERVED 5 +#define BGFX_CONFIG_MAX_VIEW_NAME_RESERVED 6 #ifndef BGFX_CONFIG_MAX_VIEW_NAME # define BGFX_CONFIG_MAX_VIEW_NAME 256 diff --git a/3rdparty/bgfx/src/glcontext_eagl.h b/3rdparty/bgfx/src/glcontext_eagl.h index 5c26a71f2a4..45ba0fbf3d0 100644 --- a/3rdparty/bgfx/src/glcontext_eagl.h +++ b/3rdparty/bgfx/src/glcontext_eagl.h @@ -21,7 +21,7 @@ namespace bgfx { namespace gl void create(uint32_t _width, uint32_t _height); void destroy(); - void resize(uint32_t _width, uint32_t _height, bool _vsync); + void resize(uint32_t _width, uint32_t _height, uint32_t _flags); static bool isSwapChainSupported(); SwapChainGL* createSwapChain(void* _nwh); diff --git a/3rdparty/bgfx/src/glcontext_eagl.mm b/3rdparty/bgfx/src/glcontext_eagl.mm index 4348eb65178..73eedd2b587 100644 --- a/3rdparty/bgfx/src/glcontext_eagl.mm +++ b/3rdparty/bgfx/src/glcontext_eagl.mm @@ -54,7 +54,7 @@ namespace bgfx { namespace gl GL_CHECK(glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8_OES, width, height) ); // from OES_packed_depth_stencil GL_CHECK(glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, m_depthStencilRbo) ); GL_CHECK(glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, m_depthStencilRbo) ); - + BX_CHECK(GL_FRAMEBUFFER_COMPLETE == glCheckFramebufferStatus(GL_FRAMEBUFFER) , "glCheckFramebufferStatus failed 0x%08x" , glCheckFramebufferStatus(GL_FRAMEBUFFER) @@ -85,9 +85,9 @@ namespace bgfx { namespace gl [context release]; } - void GlContext::resize(uint32_t _width, uint32_t _height, bool _vsync) + void GlContext::resize(uint32_t _width, uint32_t _height, uint32_t _flags) { - BX_UNUSED(_width, _height, _vsync); + BX_UNUSED(_width, _height, _flags); BX_TRACE("resize context"); } diff --git a/3rdparty/bgfx/src/glcontext_egl.cpp b/3rdparty/bgfx/src/glcontext_egl.cpp index a3fe4e77c80..93990746c5b 100644 --- a/3rdparty/bgfx/src/glcontext_egl.cpp +++ b/3rdparty/bgfx/src/glcontext_egl.cpp @@ -280,7 +280,7 @@ EGL_IMPORT # endif // BX_PLATFORM_RPI } - void GlContext::resize(uint32_t _width, uint32_t _height, bool _vsync) + void GlContext::resize(uint32_t _width, uint32_t _height, uint32_t _flags) { BX_UNUSED(_width, _height); # if BX_PLATFORM_ANDROID @@ -289,7 +289,8 @@ EGL_IMPORT ANativeWindow_setBuffersGeometry(g_bgfxAndroidWindow, _width, _height, format); # endif // BX_PLATFORM_ANDROID - eglSwapInterval(m_display, _vsync ? 1 : 0); + bool vsync = !!(_flags&BGFX_RESET_VSYNC); + eglSwapInterval(m_display, vsync ? 1 : 0); } bool GlContext::isSwapChainSupported() diff --git a/3rdparty/bgfx/src/glcontext_egl.h b/3rdparty/bgfx/src/glcontext_egl.h index 122591ca832..35a30c63f71 100644 --- a/3rdparty/bgfx/src/glcontext_egl.h +++ b/3rdparty/bgfx/src/glcontext_egl.h @@ -26,7 +26,7 @@ namespace bgfx { namespace gl void create(uint32_t _width, uint32_t _height); void destroy(); - void resize(uint32_t _width, uint32_t _height, bool _vsync); + void resize(uint32_t _width, uint32_t _height, uint32_t _flags); static bool isSwapChainSupported(); SwapChainGL* createSwapChain(void* _nwh); diff --git a/3rdparty/bgfx/src/glcontext_glx.cpp b/3rdparty/bgfx/src/glcontext_glx.cpp index 13a91de7daf..17ee8e825e7 100644 --- a/3rdparty/bgfx/src/glcontext_glx.cpp +++ b/3rdparty/bgfx/src/glcontext_glx.cpp @@ -225,9 +225,10 @@ namespace bgfx { namespace gl m_visualInfo = NULL; } - void GlContext::resize(uint32_t /*_width*/, uint32_t /*_height*/, bool _vsync) + void GlContext::resize(uint32_t /*_width*/, uint32_t /*_height*/, uint32_t _flags) { - int32_t interval = _vsync ? 1 : 0; + bool vsync = !!(_flags&BGFX_RESET_VSYNC); + int32_t interval = vsync ? 1 : 0; if (NULL != glXSwapIntervalEXT) { diff --git a/3rdparty/bgfx/src/glcontext_glx.h b/3rdparty/bgfx/src/glcontext_glx.h index cff6faa16a6..a931356cbdd 100644 --- a/3rdparty/bgfx/src/glcontext_glx.h +++ b/3rdparty/bgfx/src/glcontext_glx.h @@ -26,7 +26,7 @@ namespace bgfx { namespace gl void create(uint32_t _width, uint32_t _height); void destroy(); - void resize(uint32_t _width, uint32_t _height, bool _vsync); + void resize(uint32_t _width, uint32_t _height, uint32_t _flags); static bool isSwapChainSupported(); SwapChainGL* createSwapChain(void* _nwh); diff --git a/3rdparty/bgfx/src/glcontext_nsgl.h b/3rdparty/bgfx/src/glcontext_nsgl.h index c88673d8fe6..666926db984 100644 --- a/3rdparty/bgfx/src/glcontext_nsgl.h +++ b/3rdparty/bgfx/src/glcontext_nsgl.h @@ -21,7 +21,7 @@ namespace bgfx { namespace gl void create(uint32_t _width, uint32_t _height); void destroy(); - void resize(uint32_t _width, uint32_t _height, bool _vsync); + void resize(uint32_t _width, uint32_t _height, uint32_t _flags); static bool isSwapChainSupported(); SwapChainGL* createSwapChain(void* _nwh); diff --git a/3rdparty/bgfx/src/glcontext_nsgl.mm b/3rdparty/bgfx/src/glcontext_nsgl.mm index f01c7014131..236809223f7 100644 --- a/3rdparty/bgfx/src/glcontext_nsgl.mm +++ b/3rdparty/bgfx/src/glcontext_nsgl.mm @@ -40,17 +40,19 @@ namespace bgfx { namespace gl class AutoreleasePoolHolder { public: - AutoreleasePoolHolder() : pool([[NSAutoreleasePool alloc] init]) + AutoreleasePoolHolder() : m_pool([[NSAutoreleasePool alloc] init]) { } ~AutoreleasePoolHolder() { - [pool release]; + [m_pool release]; } private: - NSAutoreleasePool* pool; + AutoreleasePoolHolder(AutoreleasePoolHolder const&); + + NSAutoreleasePool* const m_pool; }; static void* s_opengl = NULL; @@ -99,6 +101,7 @@ namespace bgfx { namespace gl NSOpenGLView* glView = [[NSOpenGLView alloc] initWithFrame:glViewRect pixelFormat:pixelFormat]; [pixelFormat release]; +// [glView setWantsBestResolutionOpenGLSurface:YES]; [nsWindow setContentView:glView]; NSOpenGLContext* glContext = [glView openGLContext]; @@ -128,11 +131,12 @@ namespace bgfx { namespace gl bx::dlclose(s_opengl); } - void GlContext::resize(uint32_t _width, uint32_t _height, bool _vsync) + void GlContext::resize(uint32_t _width, uint32_t _height, uint32_t _flags) { BX_UNUSED(_width, _height); - GLint interval = _vsync ? 1 : 0; + bool vsync = !!(_flags&BGFX_RESET_VSYNC); + GLint interval = vsync ? 1 : 0; NSOpenGLContext* glContext = (NSOpenGLContext*)m_context; [glContext setValues:&interval forParameter:NSOpenGLCPSwapInterval]; [glContext update]; diff --git a/3rdparty/bgfx/src/glcontext_ppapi.cpp b/3rdparty/bgfx/src/glcontext_ppapi.cpp index 3910e7a13ee..f61244dbd38 100644 --- a/3rdparty/bgfx/src/glcontext_ppapi.cpp +++ b/3rdparty/bgfx/src/glcontext_ppapi.cpp @@ -38,7 +38,7 @@ namespace bgfx { namespace gl bool setInterfaces(PP_Instance _instance, const PPB_Instance* _instInterface, const PPB_Graphics3D* _graphicsInterface, PostSwapBuffersFn _postSwapBuffers); - void resize(uint32_t _width, uint32_t _height, bool /*_vsync*/) + void resize(uint32_t _width, uint32_t _height, uint32_t /*_flags*/) { m_graphicsInterface->ResizeBuffers(m_context, _width, _height); } @@ -147,10 +147,10 @@ namespace bgfx { namespace gl { } - void GlContext::resize(uint32_t _width, uint32_t _height, bool _vsync) + void GlContext::resize(uint32_t _width, uint32_t _height, uint32_t _flags) { s_ppapi.m_forceSwap = false; - s_ppapi.resize(_width, _height, _vsync); + s_ppapi.resize(_width, _height, _flags); } bool GlContext::isSwapChainSupported() diff --git a/3rdparty/bgfx/src/glcontext_ppapi.h b/3rdparty/bgfx/src/glcontext_ppapi.h index 3142b6acdf5..f54ea2bb5a8 100644 --- a/3rdparty/bgfx/src/glcontext_ppapi.h +++ b/3rdparty/bgfx/src/glcontext_ppapi.h @@ -25,7 +25,7 @@ namespace bgfx { namespace gl void create(uint32_t _width, uint32_t _height); void destroy(); - void resize(uint32_t _width, uint32_t _height, bool _vsync); + void resize(uint32_t _width, uint32_t _height, uint32_t _flags); static bool isSwapChainSupported(); SwapChainGL* createSwapChain(void* _nwh); diff --git a/3rdparty/bgfx/src/glcontext_wgl.cpp b/3rdparty/bgfx/src/glcontext_wgl.cpp index 84c32a06633..19ca6d99f72 100644 --- a/3rdparty/bgfx/src/glcontext_wgl.cpp +++ b/3rdparty/bgfx/src/glcontext_wgl.cpp @@ -287,11 +287,12 @@ namespace bgfx { namespace gl m_opengl32dll = NULL; } - void GlContext::resize(uint32_t /*_width*/, uint32_t /*_height*/, bool _vsync) + void GlContext::resize(uint32_t /*_width*/, uint32_t /*_height*/, uint32_t _flags) { if (NULL != wglSwapIntervalEXT) { - wglSwapIntervalEXT(_vsync ? 1 : 0); + bool vsync = !!(_flags&BGFX_RESET_VSYNC); + wglSwapIntervalEXT(vsync ? 1 : 0); } } diff --git a/3rdparty/bgfx/src/glcontext_wgl.h b/3rdparty/bgfx/src/glcontext_wgl.h index 98338f09410..1948622b88e 100644 --- a/3rdparty/bgfx/src/glcontext_wgl.h +++ b/3rdparty/bgfx/src/glcontext_wgl.h @@ -70,7 +70,7 @@ typedef void (APIENTRYP PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum z void create(uint32_t _width, uint32_t _height); void destroy(); - void resize(uint32_t _width, uint32_t _height, bool _vsync); + void resize(uint32_t _width, uint32_t _height, uint32_t _flags); static bool isSwapChainSupported(); SwapChainGL* createSwapChain(void* _nwh); diff --git a/3rdparty/bgfx/src/image.cpp b/3rdparty/bgfx/src/image.cpp index b420b2da364..f7aa4404b71 100644 --- a/3rdparty/bgfx/src/image.cpp +++ b/3rdparty/bgfx/src/image.cpp @@ -436,7 +436,7 @@ namespace bgfx } } - uint32_t bitRangeConvert(uint32_t _in, uint32_t _from, uint32_t _to) + uint8_t bitRangeConvert(uint32_t _in, uint32_t _from, uint32_t _to) { using namespace bx; uint32_t tmp0 = uint32_sll(1, _to); @@ -449,7 +449,7 @@ namespace bgfx uint32_t tmp7 = uint32_add(tmp5, tmp6); uint32_t result = uint32_srl(tmp7, _from); - return result; + return uint8_t(result); } void decodeBlockDxt(uint8_t _dst[16*4], const uint8_t _src[8]) @@ -986,7 +986,7 @@ namespace bgfx { 0, 8, 0, 8 }, }; - uint32_t morton2d(uint16_t _x, uint16_t _y) + uint32_t morton2d(uint32_t _x, uint32_t _y) { using namespace bx; const uint32_t tmpx = uint32_part1by1(_x); @@ -1099,9 +1099,9 @@ namespace bgfx const uint8_t wa = weight[0]; const uint8_t wb = weight[1]; - _dst[(yy*4 + xx)*4+0] = (ab * wa + bb * wb) >> 7; - _dst[(yy*4 + xx)*4+1] = (ag * wa + bg * wb) >> 7; - _dst[(yy*4 + xx)*4+2] = (ar * wa + br * wb) >> 7; + _dst[(yy*4 + xx)*4+0] = uint8_t( (ab * wa + bb * wb) >> 7); + _dst[(yy*4 + xx)*4+1] = uint8_t( (ag * wa + bg * wb) >> 7); + _dst[(yy*4 + xx)*4+2] = uint8_t( (ar * wa + br * wb) >> 7); _dst[(yy*4 + xx)*4+3] = 255; mod >>= 2; @@ -1209,10 +1209,10 @@ namespace bgfx const uint8_t wc = weight[2]; const uint8_t wd = weight[3]; - _dst[(yy*4 + xx)*4+0] = (ab * wa + bb * wb) >> 7; - _dst[(yy*4 + xx)*4+1] = (ag * wa + bg * wb) >> 7; - _dst[(yy*4 + xx)*4+2] = (ar * wa + br * wb) >> 7; - _dst[(yy*4 + xx)*4+3] = (aa * wc + ba * wd) >> 7; + _dst[(yy*4 + xx)*4+0] = uint8_t( (ab * wa + bb * wb) >> 7); + _dst[(yy*4 + xx)*4+1] = uint8_t( (ag * wa + bg * wb) >> 7); + _dst[(yy*4 + xx)*4+2] = uint8_t( (ar * wa + br * wb) >> 7); + _dst[(yy*4 + xx)*4+3] = uint8_t( (aa * wc + ba * wd) >> 7); mod >>= 2; factorTable += 4; @@ -1542,13 +1542,13 @@ namespace bgfx _imageContainer.m_data = NULL; _imageContainer.m_size = 0; _imageContainer.m_offset = (uint32_t)bx::seek(_reader); - _imageContainer.m_width = width; + _imageContainer.m_width = width; _imageContainer.m_height = height; - _imageContainer.m_depth = depth; - _imageContainer.m_format = format; - _imageContainer.m_numMips = (caps[0] & DDSCAPS_MIPMAP) ? mips : 1; + _imageContainer.m_depth = depth; + _imageContainer.m_format = uint8_t(format); + _imageContainer.m_numMips = uint8_t( (caps[0] & DDSCAPS_MIPMAP) ? mips : 1); _imageContainer.m_hasAlpha = hasAlpha; - _imageContainer.m_cubeMap = cubeMap; + _imageContainer.m_cubeMap = cubeMap; _imageContainer.m_ktx = false; return TextureFormat::Unknown != format; @@ -1719,13 +1719,13 @@ namespace bgfx _imageContainer.m_data = NULL; _imageContainer.m_size = 0; _imageContainer.m_offset = (uint32_t)offset; - _imageContainer.m_width = width; + _imageContainer.m_width = width; _imageContainer.m_height = height; - _imageContainer.m_depth = depth; - _imageContainer.m_format = format; - _imageContainer.m_numMips = numMips; + _imageContainer.m_depth = depth; + _imageContainer.m_format = uint8_t(format); + _imageContainer.m_numMips = uint8_t(numMips); _imageContainer.m_hasAlpha = hasAlpha; - _imageContainer.m_cubeMap = numFaces > 1; + _imageContainer.m_cubeMap = numFaces > 1; _imageContainer.m_ktx = true; return TextureFormat::Unknown != format; @@ -1865,13 +1865,13 @@ namespace bgfx _imageContainer.m_data = NULL; _imageContainer.m_size = 0; _imageContainer.m_offset = (uint32_t)offset; - _imageContainer.m_width = width; + _imageContainer.m_width = width; _imageContainer.m_height = height; - _imageContainer.m_depth = depth; - _imageContainer.m_format = format; - _imageContainer.m_numMips = numMips; + _imageContainer.m_depth = depth; + _imageContainer.m_format = uint8_t(format); + _imageContainer.m_numMips = uint8_t(numMips); _imageContainer.m_hasAlpha = hasAlpha; - _imageContainer.m_cubeMap = numFaces > 1; + _imageContainer.m_cubeMap = numFaces > 1; _imageContainer.m_ktx = false; return TextureFormat::Unknown != format; @@ -2175,13 +2175,13 @@ namespace bgfx if (side == _side && lod == _lod) { - _mip.m_width = width; - _mip.m_height = height; + _mip.m_width = width; + _mip.m_height = height; _mip.m_blockSize = blockSize; _mip.m_size = size; _mip.m_data = (const uint8_t*)_data + offset; - _mip.m_bpp = bpp; - _mip.m_format = type; + _mip.m_bpp = bpp; + _mip.m_format = uint8_t(type); _mip.m_hasAlpha = hasAlpha; return true; } diff --git a/3rdparty/bgfx/src/renderer_d3d11.cpp b/3rdparty/bgfx/src/renderer_d3d11.cpp index c69424ca7ab..20ac1323d98 100644 --- a/3rdparty/bgfx/src/renderer_d3d11.cpp +++ b/3rdparty/bgfx/src/renderer_d3d11.cpp @@ -155,7 +155,7 @@ namespace bgfx { namespace d3d11 * 0x01 // MIP_LINEAR */ - static const uint32_t s_textureFilter[3][3] = + static const uint8_t s_textureFilter[3][3] = { { 0x10, // min linear @@ -624,10 +624,25 @@ namespace bgfx { namespace d3d11 { hr = m_device->QueryInterface(s_deviceIIDs[ii], (void**)&device); BX_TRACE("D3D device 11.%d, hr %x", BX_COUNTOF(s_deviceIIDs)-1-ii, hr); - } - BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to create Direct3D11 device."); - hr = device->GetParent(IID_IDXGIAdapter, (void**)&adapter); + if (SUCCEEDED(hr) ) + { +BX_PRAGMA_DIAGNOSTIC_PUSH(); +BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4530) // warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc + try + { + // QueryInterface above can succeed, but getting adapter call might crash on Win7. + hr = device->GetAdapter(&adapter); + } + catch (...) + { + BX_TRACE("Failed to get adapter foro IID_IDXGIDevice%d.", BX_COUNTOF(s_deviceIIDs)-1-ii); + DX_RELEASE(device, 0); + hr = E_FAIL; + } +BX_PRAGMA_DIAGNOSTIC_POP(); + } + } BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to create Direct3D11 device."); // GPA increases device ref count. @@ -752,7 +767,7 @@ namespace bgfx { namespace d3d11 | (m_ovr.isInitialized() ? BGFX_CAPS_HMD : 0) ); g_caps.maxTextureSize = D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION; - g_caps.maxFBAttachments = bx::uint32_min(D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS); + g_caps.maxFBAttachments = uint8_t(bx::uint32_min(D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS) ); for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii) { @@ -796,7 +811,7 @@ namespace bgfx { namespace d3d11 for (uint32_t ii = 0; ii < BGFX_CONFIG_MAX_VIEWS; ++ii) { char name[BGFX_CONFIG_MAX_VIEW_NAME_RESERVED+1]; - bx::snprintf(name, sizeof(name), "%3d ", ii); + bx::snprintf(name, sizeof(name), "%3d ", ii); mbstowcs(s_viewNameW[ii], name, BGFX_CONFIG_MAX_VIEW_NAME_RESERVED); } @@ -1073,10 +1088,13 @@ namespace bgfx { namespace d3d11 void updateViewName(uint8_t _id, const char* _name) BX_OVERRIDE { - mbstowcs(&s_viewNameW[_id][BGFX_CONFIG_MAX_VIEW_NAME_RESERVED] - , _name - , BX_COUNTOF(s_viewNameW[0])-BGFX_CONFIG_MAX_VIEW_NAME_RESERVED - ); + if (BX_ENABLED(BGFX_CONFIG_DEBUG_PIX) ) + { + mbstowcs(&s_viewNameW[_id][BGFX_CONFIG_MAX_VIEW_NAME_RESERVED] + , _name + , BX_COUNTOF(s_viewNameW[0])-BGFX_CONFIG_MAX_VIEW_NAME_RESERVED + ); + } } void updateUniform(uint16_t _loc, const void* _data, uint32_t _size) BX_OVERRIDE @@ -1387,7 +1405,7 @@ namespace bgfx { namespace d3d11 } } - void setShaderUniform(uint8_t _flags, uint16_t _regIndex, const void* _val, uint16_t _numRegs) + void setShaderUniform(uint8_t _flags, uint32_t _regIndex, const void* _val, uint32_t _numRegs) { if (_flags&BGFX_UNIFORM_FRAGMENTBIT) { @@ -1401,12 +1419,12 @@ namespace bgfx { namespace d3d11 } } - void setShaderUniform4f(uint8_t _flags, uint16_t _regIndex, const void* _val, uint16_t _numRegs) + void setShaderUniform4f(uint8_t _flags, uint32_t _regIndex, const void* _val, uint32_t _numRegs) { setShaderUniform(_flags, _regIndex, _val, _numRegs); } - void setShaderUniform4x4f(uint8_t _flags, uint16_t _regIndex, const void* _val, uint16_t _numRegs) + void setShaderUniform4x4f(uint8_t _flags, uint32_t _regIndex, const void* _val, uint32_t _numRegs) { setShaderUniform(_flags, _regIndex, _val, _numRegs); } @@ -1436,7 +1454,14 @@ namespace bgfx { namespace d3d11 void setFrameBuffer(FrameBufferHandle _fbh, bool _msaa = true) { - BX_UNUSED(_msaa); + if (isValid(m_fbh) + && m_fbh.idx != _fbh.idx + && m_rtMsaa) + { + FrameBufferD3D11& frameBuffer = m_frameBuffers[m_fbh.idx]; + frameBuffer.resolve(); + } + if (!isValid(_fbh) ) { m_deviceCtx->OMSetRenderTargets(1, &m_backBufferColor, m_backBufferDepthStencil); @@ -1455,14 +1480,6 @@ namespace bgfx { namespace d3d11 m_currentDepthStencil = frameBuffer.m_dsv; } - if (isValid(m_fbh) - && m_fbh.idx != _fbh.idx - && m_rtMsaa) - { - FrameBufferD3D11& frameBuffer = m_frameBuffers[m_fbh.idx]; - frameBuffer.resolve(); - } - m_fbh = _fbh; m_rtMsaa = _msaa; } @@ -1511,7 +1528,7 @@ namespace bgfx { namespace d3d11 } } - void setInputLayout(const VertexDecl& _vertexDecl, const ProgramD3D11& _program, uint8_t _numInstanceData) + void setInputLayout(const VertexDecl& _vertexDecl, const ProgramD3D11& _program, uint16_t _numInstanceData) { uint64_t layoutHash = (uint64_t(_vertexDecl.m_hash)<<32) | _program.m_vsh->m_hash; layoutHash ^= _numInstanceData; @@ -1641,7 +1658,7 @@ namespace bgfx { namespace d3d11 drt->DestBlendAlpha = s_blendFactor[dstA][1]; drt->BlendOpAlpha = s_blendEquation[equA]; - uint32_t writeMask = (_state&BGFX_STATE_ALPHA_WRITE) ? D3D11_COLOR_WRITE_ENABLE_ALPHA : 0; + uint8_t writeMask = (_state&BGFX_STATE_ALPHA_WRITE) ? D3D11_COLOR_WRITE_ENABLE_ALPHA : 0; writeMask |= (_state&BGFX_STATE_RGB_WRITE) ? D3D11_COLOR_WRITE_ENABLE_RED|D3D11_COLOR_WRITE_ENABLE_GREEN|D3D11_COLOR_WRITE_ENABLE_BLUE : 0; drt->RenderTargetWriteMask = writeMask; @@ -2066,11 +2083,11 @@ namespace bgfx { namespace d3d11 case UniformType::_uniform: \ case UniformType::_uniform|BGFX_UNIFORM_FRAGMENTBIT: \ { \ - setShaderUniform(type, loc, data, num); \ + setShaderUniform(uint8_t(type), loc, data, num); \ } \ break; - switch ( (int32_t)type) + switch ( (uint32_t)type) { case UniformType::Uniform3x3fv: case UniformType::Uniform3x3fv|BGFX_UNIFORM_FRAGMENTBIT: \ @@ -2091,7 +2108,7 @@ namespace bgfx { namespace d3d11 mtx.un.val[ 9] = value[7]; mtx.un.val[10] = value[8]; mtx.un.val[11] = 0.0f; - setShaderUniform(type, loc, &mtx.un.val[0], 3); + setShaderUniform(uint8_t(type), loc, &mtx.un.val[0], 3); } } break; @@ -2562,7 +2579,7 @@ namespace bgfx { namespace d3d11 kind = "predefined"; m_predefined[m_numPredefined].m_loc = regIndex; m_predefined[m_numPredefined].m_count = regCount; - m_predefined[m_numPredefined].m_type = predefined|fragmentBit; + m_predefined[m_numPredefined].m_type = uint8_t(predefined|fragmentBit); m_numPredefined++; } else @@ -2647,7 +2664,7 @@ namespace bgfx { namespace d3d11 if (0 < size) { D3D11_BUFFER_DESC desc; - desc.ByteWidth = size; + desc.ByteWidth = (size + 0xf) & ~0xf; desc.Usage = D3D11_USAGE_DEFAULT; desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; desc.CPUAccessFlags = 0; @@ -2666,7 +2683,7 @@ namespace bgfx { namespace d3d11 if (imageParse(imageContainer, _mem->data, _mem->size) ) { uint8_t numMips = imageContainer.m_numMips; - const uint32_t startLod = bx::uint32_min(_skip, numMips-1); + const uint8_t startLod = uint8_t(bx::uint32_min(_skip, numMips-1) ); numMips -= startLod; const ImageBlockInfo& blockInfo = getBlockInfo(TextureFormat::Enum(imageContainer.m_format) ); const uint32_t textureWidth = bx::uint32_max(blockInfo.blockWidth, imageContainer.m_width >>startLod); @@ -2726,7 +2743,7 @@ namespace bgfx { namespace d3d11 uint32_t height = textureHeight; uint32_t depth = imageContainer.m_depth; - for (uint32_t lod = 0, num = numMips; lod < num; ++lod) + for (uint8_t lod = 0, num = numMips; lod < num; ++lod) { width = bx::uint32_max(1, width); height = bx::uint32_max(1, height); @@ -3217,18 +3234,26 @@ namespace bgfx { namespace d3d11 viewState.m_rect = _render->m_rect[view]; if (viewRestart) { - wchar_t* viewNameW = s_viewNameW[view]; - viewNameW[3] = eye ? L'R' : L'L'; - PIX_BEGINEVENT(D3DCOLOR_RGBA(0xff, 0x00, 0x00, 0xff), viewNameW); + if (BX_ENABLED(BGFX_CONFIG_DEBUG_PIX) ) + { + wchar_t* viewNameW = s_viewNameW[view]; + viewNameW[3] = L' '; + viewNameW[4] = eye ? L'R' : L'L'; + PIX_BEGINEVENT(D3DCOLOR_RGBA(0xff, 0x00, 0x00, 0xff), viewNameW); + } viewState.m_rect.m_x = eye * (viewState.m_rect.m_width+1)/2; viewState.m_rect.m_width /= 2; } else { - wchar_t* viewNameW = s_viewNameW[view]; - viewNameW[3] = L' '; - PIX_BEGINEVENT(D3DCOLOR_RGBA(0xff, 0x00, 0x00, 0xff), viewNameW); + if (BX_ENABLED(BGFX_CONFIG_DEBUG_PIX) ) + { + wchar_t* viewNameW = s_viewNameW[view]; + viewNameW[3] = L' '; + viewNameW[4] = L' '; + PIX_BEGINEVENT(D3DCOLOR_RGBA(0xff, 0x00, 0x00, 0xff), viewNameW); + } } const Rect& scissorRect = _render->m_scissor[view]; @@ -3258,6 +3283,14 @@ namespace bgfx { namespace d3d11 { wasCompute = true; + if (BX_ENABLED(BGFX_CONFIG_DEBUG_PIX) ) + { + wchar_t* viewNameW = s_viewNameW[view]; + viewNameW[3] = L'C'; + PIX_ENDEVENT(); + PIX_BEGINEVENT(D3DCOLOR_RGBA(0xff, 0x00, 0x00, 0xff), viewNameW); + } + deviceCtx->IASetVertexBuffers(0, 2, s_zero.m_buffer, s_zero.m_zero, s_zero.m_zero); deviceCtx->IASetIndexBuffer(NULL, DXGI_FORMAT_R16_UINT, 0); @@ -3376,6 +3409,14 @@ namespace bgfx { namespace d3d11 if (wasCompute) { + if (BX_ENABLED(BGFX_CONFIG_DEBUG_PIX) ) + { + wchar_t* viewNameW = s_viewNameW[view]; + viewNameW[3] = L' '; + PIX_ENDEVENT(); + PIX_BEGINEVENT(D3DCOLOR_RGBA(0xff, 0x00, 0x00, 0xff), viewNameW); + } + wasCompute = false; programIdx = invalidHandle; @@ -3563,7 +3604,7 @@ namespace bgfx { namespace d3d11 { uint32_t changes = 0; - for (uint32_t stage = 0; stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS; ++stage) + for (uint8_t stage = 0; stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS; ++stage) { const Binding& sampler = draw.m_bind[stage]; Binding& current = currentState.m_bind[stage]; @@ -3722,6 +3763,14 @@ namespace bgfx { namespace d3d11 if (wasCompute) { + if (BX_ENABLED(BGFX_CONFIG_DEBUG_PIX) ) + { + wchar_t* viewNameW = s_viewNameW[view]; + viewNameW[3] = L'C'; + PIX_ENDEVENT(); + PIX_BEGINEVENT(D3DCOLOR_RGBA(0xff, 0x00, 0x00, 0xff), viewNameW); + } + invalidateCompute(); } diff --git a/3rdparty/bgfx/src/renderer_d3d9.cpp b/3rdparty/bgfx/src/renderer_d3d9.cpp index 055eb5ed144..970485bb5d1 100644 --- a/3rdparty/bgfx/src/renderer_d3d9.cpp +++ b/3rdparty/bgfx/src/renderer_d3d9.cpp @@ -359,13 +359,13 @@ namespace bgfx { namespace d3d9 m_adapter = D3DADAPTER_DEFAULT; m_deviceType = D3DDEVTYPE_HAL; - uint8_t numGPUs = bx::uint32_min(BX_COUNTOF(g_caps.gpu), m_d3d9->GetAdapterCount() ); + uint8_t numGPUs = uint8_t(bx::uint32_min(BX_COUNTOF(g_caps.gpu), m_d3d9->GetAdapterCount() ) ); for (uint32_t ii = 0; ii < numGPUs; ++ii) { D3DADAPTER_IDENTIFIER9 desc; HRESULT hr = m_d3d9->GetAdapterIdentifier(ii, 0, &desc); if (SUCCEEDED(hr) ) - { + { BX_TRACE("Adapter #%d", ii); BX_TRACE("\tDriver: %s", desc.Driver); BX_TRACE("\tDescription: %s", desc.Description); @@ -470,10 +470,10 @@ namespace bgfx { namespace d3d9 | BGFX_CAPS_FRAGMENT_DEPTH | BGFX_CAPS_SWAP_CHAIN ); - g_caps.maxTextureSize = bx::uint32_min(m_caps.MaxTextureWidth, m_caps.MaxTextureHeight); + g_caps.maxTextureSize = uint16_t(bx::uint32_min(m_caps.MaxTextureWidth, m_caps.MaxTextureHeight) ); - m_caps.NumSimultaneousRTs = bx::uint32_min(m_caps.NumSimultaneousRTs, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS); - g_caps.maxFBAttachments = (uint8_t)m_caps.NumSimultaneousRTs; + m_caps.NumSimultaneousRTs = uint8_t(bx::uint32_min(m_caps.NumSimultaneousRTs, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS) ); + g_caps.maxFBAttachments = uint8_t(m_caps.NumSimultaneousRTs); m_caps.MaxAnisotropy = bx::uint32_min(m_caps.MaxAnisotropy, 1); @@ -598,7 +598,7 @@ namespace bgfx { namespace d3d9 for (uint32_t ii = 0; ii < BGFX_CONFIG_MAX_VIEWS; ++ii) { char name[BGFX_CONFIG_MAX_VIEW_NAME_RESERVED+1]; - bx::snprintf(name, sizeof(name), "%3d ", ii); + bx::snprintf(name, sizeof(name), "%3d ", ii); mbstowcs(s_viewNameW[ii], name, BGFX_CONFIG_MAX_VIEW_NAME_RESERVED); } @@ -874,10 +874,13 @@ namespace bgfx { namespace d3d9 void updateViewName(uint8_t _id, const char* _name) BX_OVERRIDE { - mbstowcs(&s_viewNameW[_id][BGFX_CONFIG_MAX_VIEW_NAME_RESERVED] - , _name - , BX_COUNTOF(s_viewNameW[0])-BGFX_CONFIG_MAX_VIEW_NAME_RESERVED - ); + if (BX_ENABLED(BGFX_CONFIG_DEBUG_PIX) ) + { + mbstowcs(&s_viewNameW[_id][BGFX_CONFIG_MAX_VIEW_NAME_RESERVED] + , _name + , BX_COUNTOF(s_viewNameW[0])-BGFX_CONFIG_MAX_VIEW_NAME_RESERVED + ); + } } void updateUniform(uint16_t _loc, const void* _data, uint32_t _size) BX_OVERRIDE @@ -1084,7 +1087,7 @@ namespace bgfx { namespace d3d9 m_rtMsaa = _msaa; } - void setShaderUniform(uint8_t _flags, uint16_t _regIndex, const void* _val, uint16_t _numRegs) + void setShaderUniform(uint8_t _flags, uint32_t _regIndex, const void* _val, uint32_t _numRegs) { if (_flags&BGFX_UNIFORM_FRAGMENTBIT) { @@ -1096,12 +1099,12 @@ namespace bgfx { namespace d3d9 } } - void setShaderUniform4f(uint8_t _flags, uint16_t _regIndex, const void* _val, uint16_t _numRegs) + void setShaderUniform4f(uint8_t _flags, uint32_t _regIndex, const void* _val, uint32_t _numRegs) { setShaderUniform(_flags, _regIndex, _val, _numRegs); } - void setShaderUniform4x4f(uint8_t _flags, uint16_t _regIndex, const void* _val, uint16_t _numRegs) + void setShaderUniform4x4f(uint8_t _flags, uint32_t _regIndex, const void* _val, uint32_t _numRegs) { setShaderUniform(_flags, _regIndex, _val, _numRegs); } @@ -1882,7 +1885,7 @@ namespace bgfx { namespace d3d9 }; BX_STATIC_ASSERT(Attrib::Count == BX_COUNTOF(s_attrib)-1); - static const D3DDECLTYPE s_attribType[][4][2] = + static const uint8_t s_attribType[][4][2] = { { { D3DDECLTYPE_UBYTE4, D3DDECLTYPE_UBYTE4N }, @@ -1936,17 +1939,17 @@ namespace bgfx { namespace d3d9 return elem; } - static IDirect3DVertexDeclaration9* createVertexDeclaration(const VertexDecl& _decl, uint8_t _numInstanceData) + static IDirect3DVertexDeclaration9* createVertexDeclaration(const VertexDecl& _decl, uint16_t _numInstanceData) { D3DVERTEXELEMENT9 vertexElements[Attrib::Count+1+BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT]; D3DVERTEXELEMENT9* elem = fillVertexDecl(vertexElements, _decl); const D3DVERTEXELEMENT9 inst = { 1, 0, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }; - for (uint32_t ii = 0; ii < _numInstanceData; ++ii) + for (uint8_t ii = 0; ii < _numInstanceData; ++ii) { memcpy(elem, &inst, sizeof(D3DVERTEXELEMENT9) ); - elem->UsageIndex = 8-_numInstanceData+ii; + elem->UsageIndex = uint8_t(8-_numInstanceData+ii); elem->Offset = ii*16; ++elem; } @@ -2026,9 +2029,9 @@ namespace bgfx { namespace d3d9 if (PredefinedUniform::Count != predefined) { kind = "predefined"; - m_predefined[m_numPredefined].m_loc = regIndex; + m_predefined[m_numPredefined].m_loc = regIndex; m_predefined[m_numPredefined].m_count = regCount; - m_predefined[m_numPredefined].m_type = predefined|fragmentBit; + m_predefined[m_numPredefined].m_type = uint8_t(predefined|fragmentBit); m_numPredefined++; } else @@ -2362,7 +2365,7 @@ namespace bgfx { namespace d3d9 if (imageParse(imageContainer, _mem->data, _mem->size) ) { uint8_t numMips = imageContainer.m_numMips; - const uint32_t startLod = bx::uint32_min(_skip, numMips-1); + const uint8_t startLod = uint8_t(bx::uint32_min(_skip, numMips-1) ); numMips -= startLod; const ImageBlockInfo& blockInfo = getBlockInfo(TextureFormat::Enum(imageContainer.m_format) ); const uint32_t textureWidth = bx::uint32_max(blockInfo.blockWidth, imageContainer.m_width >>startLod); @@ -2425,7 +2428,7 @@ namespace bgfx { namespace d3d9 uint32_t mipWidth = imageContainer.m_width; uint32_t mipHeight = imageContainer.m_height; - for (uint32_t lod = 0, num = numMips; lod < num; ++lod) + for (uint8_t lod = 0, num = numMips; lod < num; ++lod) { width = bx::uint32_max(1, width); height = bx::uint32_max(1, height); @@ -3012,7 +3015,7 @@ namespace bgfx { namespace d3d9 { uint32_t fstencil = unpackStencil(0, newStencil); uint32_t bstencil = unpackStencil(1, newStencil); - uint32_t frontAndBack = bstencil != BGFX_STENCIL_NONE && bstencil != fstencil; + uint8_t frontAndBack = bstencil != BGFX_STENCIL_NONE && bstencil != fstencil; DX_CHECK(device->SetRenderState(D3DRS_TWOSIDEDSTENCILMODE, 0 != frontAndBack) ); uint32_t fchanged = unpackStencil(0, changedStencil); @@ -3032,7 +3035,7 @@ namespace bgfx { namespace d3d9 // DX_CHECK(device->SetRenderState(D3DRS_STENCILWRITEMASK, wmask) ); // } - for (uint32_t ii = 0, num = frontAndBack+1; ii < num; ++ii) + for (uint8_t ii = 0, num = frontAndBack+1; ii < num; ++ii) { uint32_t stencil = unpackStencil(ii, newStencil); uint32_t changed = unpackStencil(ii, changedStencil); @@ -3218,7 +3221,7 @@ namespace bgfx { namespace d3d9 } { - for (uint32_t stage = 0; stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS; ++stage) + for (uint8_t stage = 0; stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS; ++stage) { const Binding& sampler = draw.m_bind[stage]; Binding& current = currentState.m_bind[stage]; diff --git a/3rdparty/bgfx/src/renderer_gl.cpp b/3rdparty/bgfx/src/renderer_gl.cpp index c35e9c5a30f..86a0c06f287 100644 --- a/3rdparty/bgfx/src/renderer_gl.cpp +++ b/3rdparty/bgfx/src/renderer_gl.cpp @@ -1355,14 +1355,14 @@ namespace bgfx { namespace gl : 0 ; - g_caps.maxTextureSize = glGet(GL_MAX_TEXTURE_SIZE); + g_caps.maxTextureSize = uint16_t(glGet(GL_MAX_TEXTURE_SIZE) ); if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) || BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30) || s_extension[Extension::EXT_draw_buffers ].m_supported || s_extension[Extension::WEBGL_draw_buffers].m_supported) { - g_caps.maxFBAttachments = bx::uint32_min(glGet(GL_MAX_COLOR_ATTACHMENTS), BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS); + g_caps.maxFBAttachments = uint8_t(bx::uint32_min(glGet(GL_MAX_COLOR_ATTACHMENTS), BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS) ); } m_vaoSupport = !!(BGFX_CONFIG_RENDERER_OPENGLES >= 30) @@ -1540,7 +1540,7 @@ namespace bgfx { namespace gl // Init reserved part of view name. for (uint32_t ii = 0; ii < BGFX_CONFIG_MAX_VIEWS; ++ii) { - bx::snprintf(s_viewName[ii], BGFX_CONFIG_MAX_VIEW_NAME_RESERVED+1, "%3d ", ii); + bx::snprintf(s_viewName[ii], BGFX_CONFIG_MAX_VIEW_NAME_RESERVED+1, "%3d ", ii); } ovrPostReset(); @@ -1795,10 +1795,13 @@ namespace bgfx { namespace gl void updateViewName(uint8_t _id, const char* _name) BX_OVERRIDE { - bx::strlcpy(&s_viewName[_id][BGFX_CONFIG_MAX_VIEW_NAME_RESERVED] - , _name - , BX_COUNTOF(s_viewName[0])-BGFX_CONFIG_MAX_VIEW_NAME_RESERVED - ); + if (BX_ENABLED(BGFX_CONFIG_DEBUG_PIX) ) + { + bx::strlcpy(&s_viewName[_id][BGFX_CONFIG_MAX_VIEW_NAME_RESERVED] + , _name + , BX_COUNTOF(s_viewName[0])-BGFX_CONFIG_MAX_VIEW_NAME_RESERVED + ); + } } void updateUniform(uint16_t _loc, const void* _data, uint32_t _size) BX_OVERRIDE @@ -1899,10 +1902,10 @@ namespace bgfx { namespace gl m_resolution = _resolution; m_resolution.m_flags = flags; - uint32_t msaa = (m_resolution.m_flags&BGFX_RESET_MSAA_MASK)>>BGFX_RESET_MSAA_SHIFT; - msaa = bx::uint32_min(m_maxMsaa, msaa == 0 ? 0 : 1<<msaa); - bool vsync = !!(m_resolution.m_flags&BGFX_RESET_VSYNC); - setRenderContextSize(_resolution.m_width, _resolution.m_height, msaa, vsync); + setRenderContextSize(m_resolution.m_width + , m_resolution.m_height + , m_resolution.m_flags + ); updateCapture(); ovrPreReset(); @@ -1915,7 +1918,7 @@ namespace bgfx { namespace gl } } - void setShaderUniform4f(uint8_t /*_flags*/, uint16_t _regIndex, const void* _val, uint16_t _numRegs) + void setShaderUniform4f(uint8_t /*_flags*/, uint32_t _regIndex, const void* _val, uint32_t _numRegs) { GL_CHECK(glUniform4fv(_regIndex , _numRegs @@ -1923,7 +1926,7 @@ namespace bgfx { namespace gl ) ); } - void setShaderUniform4x4f(uint8_t /*_flags*/, uint16_t _regIndex, const void* _val, uint16_t _numRegs) + void setShaderUniform4x4f(uint8_t /*_flags*/, uint32_t _regIndex, const void* _val, uint32_t _numRegs) { GL_CHECK(glUniformMatrix4fv(_regIndex , _numRegs @@ -1932,7 +1935,7 @@ namespace bgfx { namespace gl ) ); } - uint32_t setFrameBuffer(FrameBufferHandle _fbh, uint32_t _height, uint8_t _discard = BGFX_CLEAR_NONE, bool _msaa = true) + uint32_t setFrameBuffer(FrameBufferHandle _fbh, uint32_t _height, uint16_t _discard = BGFX_CLEAR_NONE, bool _msaa = true) { if (isValid(m_fbh) && m_fbh.idx != _fbh.idx @@ -2068,7 +2071,7 @@ namespace bgfx { namespace gl } } - void setRenderContextSize(uint32_t _width, uint32_t _height, uint32_t _msaa = 0, bool _vsync = false) + void setRenderContextSize(uint32_t _width, uint32_t _height, uint32_t _flags = 0) { if (_width != 0 || _height != 0) @@ -2086,9 +2089,12 @@ namespace bgfx { namespace gl { destroyMsaaFbo(); - m_glctx.resize(_width, _height, _vsync); + m_glctx.resize(_width, _height, _flags); + + uint32_t msaa = (_flags&BGFX_RESET_MSAA_MASK)>>BGFX_RESET_MSAA_SHIFT; + msaa = bx::uint32_min(m_maxMsaa, msaa == 0 ? 0 : 1<<msaa); - createMsaaFbo(_width, _height, _msaa); + createMsaaFbo(_width, _height, msaa); } } @@ -2629,7 +2635,7 @@ namespace bgfx { namespace gl bool m_rtMsaa; FrameBufferHandle m_fbh; - uint32_t m_fbDiscard; + uint16_t m_fbDiscard; Resolution m_resolution; void* m_capture; @@ -3056,9 +3062,9 @@ namespace bgfx { namespace gl PredefinedUniform::Enum predefined = nameToPredefinedUniformEnum(name); if (PredefinedUniform::Count != predefined) { - m_predefined[m_numPredefined].m_loc = loc; - m_predefined[m_numPredefined].m_type = predefined; - m_predefined[m_numPredefined].m_count = num; + m_predefined[m_numPredefined].m_loc = loc; + m_predefined[m_numPredefined].m_count = uint16_t(num); + m_predefined[m_numPredefined].m_type = uint8_t(predefined); m_numPredefined++; } else @@ -3072,7 +3078,7 @@ namespace bgfx { namespace gl } UniformType::Enum type = convertGlType(gltype); - m_constantBuffer->writeUniformHandle(type, 0, info->m_handle, num); + m_constantBuffer->writeUniformHandle(type, 0, info->m_handle, uint16_t(num) ); m_constantBuffer->write(loc); BX_TRACE("store %s %d", name, info->m_handle); } @@ -3135,7 +3141,7 @@ namespace bgfx { namespace gl memset(m_attributes, 0xff, sizeof(m_attributes) ); uint32_t used = 0; - for (uint32_t ii = 0; ii < Attrib::Count; ++ii) + for (uint8_t ii = 0; ii < Attrib::Count; ++ii) { GLint loc = glGetAttribLocation(m_id, s_attribName[ii]); if (-1 != loc) @@ -3372,8 +3378,8 @@ namespace bgfx { namespace gl if (imageParse(imageContainer, _mem->data, _mem->size) ) { uint8_t numMips = imageContainer.m_numMips; - const uint32_t startLod = bx::uint32_min(_skip, numMips-1); - numMips -= uint8_t(startLod); + const uint8_t startLod = uint8_t(bx::uint32_min(_skip, numMips-1) ); + numMips -= startLod; const ImageBlockInfo& blockInfo = getBlockInfo(TextureFormat::Enum(imageContainer.m_format) ); const uint32_t textureWidth = bx::uint32_max(blockInfo.blockWidth, imageContainer.m_width >>startLod); const uint32_t textureHeight = bx::uint32_max(blockInfo.blockHeight, imageContainer.m_height>>startLod); @@ -3450,7 +3456,7 @@ namespace bgfx { namespace gl uint32_t height = textureHeight; uint32_t depth = imageContainer.m_depth; - for (uint32_t lod = 0, num = numMips; lod < num; ++lod) + for (uint8_t lod = 0, num = numMips; lod < num; ++lod) { width = bx::uint32_max(blockWidth, width); height = bx::uint32_max(blockHeight, height); @@ -4278,7 +4284,7 @@ namespace bgfx { namespace gl } } - m_num = colorIdx; + m_num = uint8_t(colorIdx); if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) ) { @@ -4389,7 +4395,7 @@ namespace bgfx { namespace gl } } - void FrameBufferGL::discard(uint8_t _flags) + void FrameBufferGL::discard(uint16_t _flags) { GLenum buffers[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS+2]; uint32_t idx = 0; @@ -4508,10 +4514,11 @@ namespace bgfx { namespace gl uint32_t baseVertex = 0; GLuint currentVao = 0; + bool wasCompute = false; bool viewHasScissor = false; Rect viewScissorRect; viewScissorRect.clear(); - uint8_t discardFlags = BGFX_CLEAR_NONE; + uint16_t discardFlags = BGFX_CLEAR_NONE; const bool blendIndependentSupported = s_extension[Extension::ARB_draw_buffers_blend].m_supported; const bool computeSupported = (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) && s_extension[Extension::ARB_compute_shader].m_supported) @@ -4592,18 +4599,26 @@ namespace bgfx { namespace gl viewState.m_rect = _render->m_rect[view]; if (viewRestart) { - char* viewName = s_viewName[view]; - viewName[3] = eye ? 'R' : 'L'; - GL_CHECK(glInsertEventMarker(0, viewName) ); + if (BX_ENABLED(BGFX_CONFIG_DEBUG_PIX) ) + { + char* viewName = s_viewName[view]; + viewName[3] = ' '; + viewName[4] = eye ? 'R' : 'L'; + GL_CHECK(glInsertEventMarker(0, viewName) ); + } viewState.m_rect.m_x = eye * (viewState.m_rect.m_width+1)/2; viewState.m_rect.m_width /= 2; } else { - char* viewName = s_viewName[view]; - viewName[3] = ' '; - GL_CHECK(glInsertEventMarker(0, viewName) ); + if (BX_ENABLED(BGFX_CONFIG_DEBUG_PIX) ) + { + char* viewName = s_viewName[view]; + viewName[3] = ' '; + viewName[4] = ' '; + GL_CHECK(glInsertEventMarker(0, viewName) ); + } } const Rect& scissorRect = _render->m_scissor[view]; @@ -4633,6 +4648,18 @@ namespace bgfx { namespace gl if (isCompute) { + if (!wasCompute) + { + wasCompute = true; + + if (BX_ENABLED(BGFX_CONFIG_DEBUG_PIX) ) + { + char* viewName = s_viewName[view]; + viewName[3] = 'C'; + GL_CHECK(glInsertEventMarker(0, viewName) ); + } + } + if (computeSupported) { const RenderCompute& compute = renderItem.compute; @@ -4703,6 +4730,18 @@ namespace bgfx { namespace gl continue; } + if (wasCompute) + { + wasCompute = false; + + if (BX_ENABLED(BGFX_CONFIG_DEBUG_PIX) ) + { + char* viewName = s_viewName[view]; + viewName[3] = ' '; + GL_CHECK(glInsertEventMarker(0, viewName) ); + } + } + const RenderDraw& draw = renderItem.draw; const uint64_t newFlags = draw.m_flags; @@ -4764,7 +4803,7 @@ namespace bgfx { namespace gl GL_CHECK(glEnable(GL_STENCIL_TEST) ); uint32_t bstencil = unpackStencil(1, newStencil); - uint32_t frontAndBack = bstencil != BGFX_STENCIL_NONE && bstencil != unpackStencil(0, newStencil); + uint8_t frontAndBack = bstencil != BGFX_STENCIL_NONE && bstencil != unpackStencil(0, newStencil); // uint32_t bchanged = unpackStencil(1, changedStencil); // if (BGFX_STENCIL_FUNC_RMASK_MASK & bchanged) @@ -4773,7 +4812,7 @@ namespace bgfx { namespace gl // GL_CHECK(glStencilMask(wmask) ); // } - for (uint32_t ii = 0, num = frontAndBack+1; ii < num; ++ii) + for (uint8_t ii = 0, num = frontAndBack+1; ii < num; ++ii) { uint32_t stencil = unpackStencil(ii, newStencil); uint32_t changed = unpackStencil(ii, changedStencil); diff --git a/3rdparty/bgfx/src/renderer_gl.h b/3rdparty/bgfx/src/renderer_gl.h index 65dae432203..db4e1f06958 100644 --- a/3rdparty/bgfx/src/renderer_gl.h +++ b/3rdparty/bgfx/src/renderer_gl.h @@ -928,7 +928,7 @@ namespace bgfx { namespace gl void create(uint16_t _denseIdx, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _depthFormat); uint16_t destroy(); void resolve(); - void discard(uint8_t _flags); + void discard(uint16_t _flags); SwapChainGL* m_swapChain; GLuint m_fbo[2]; diff --git a/3rdparty/bgfx/tools/geometryc/geometryc.cpp b/3rdparty/bgfx/tools/geometryc/geometryc.cpp index f748e5c797a..ccf6a580b80 100644 --- a/3rdparty/bgfx/tools/geometryc/geometryc.cpp +++ b/3rdparty/bgfx/tools/geometryc/geometryc.cpp @@ -724,9 +724,9 @@ int main(int _argc, const char* _argv[]) { hasTexcoord = true; - for (Index3Map::iterator it = indexMap.begin(), itEnd = indexMap.end(); it != itEnd; ++it) + for (Index3Map::iterator jt = indexMap.begin(), jtEnd = indexMap.end(); jt != jtEnd; ++jt) { - it->second.m_texcoord = it->second.m_position; + jt->second.m_texcoord = jt->second.m_position; } } @@ -735,9 +735,9 @@ int main(int _argc, const char* _argv[]) { hasNormal = true; - for (Index3Map::iterator it = indexMap.begin(), itEnd = indexMap.end(); it != itEnd; ++it) + for (Index3Map::iterator jt = indexMap.begin(), jtEnd = indexMap.end(); jt != jtEnd; ++jt) { - it->second.m_normal = it->second.m_position; + jt->second.m_normal = jt->second.m_position; } } } @@ -848,14 +848,14 @@ int main(int _argc, const char* _argv[]) triReorderElapsed -= bx::getHPCounter(); for (PrimitiveArray::const_iterator primIt = primitives.begin(); primIt != primitives.end(); ++primIt) { - const Primitive& prim = *primIt; - triangleReorder(indexData + prim.m_startIndex, prim.m_numIndices, numVertices, 32); + const Primitive& prim1 = *primIt; + triangleReorder(indexData + prim1.m_startIndex, prim1.m_numIndices, numVertices, 32); if (compress) { triangleCompress(&memWriter - , indexData + prim.m_startIndex - , prim.m_numIndices - , vertexData + prim.m_startVertex + , indexData + prim1.m_startIndex + , prim1.m_numIndices + , vertexData + prim1.m_startVertex , numVertices , stride ); @@ -968,14 +968,14 @@ int main(int _argc, const char* _argv[]) triReorderElapsed -= bx::getHPCounter(); for (PrimitiveArray::const_iterator primIt = primitives.begin(); primIt != primitives.end(); ++primIt) { - const Primitive& prim = *primIt; - triangleReorder(indexData + prim.m_startIndex, prim.m_numIndices, numVertices, 32); + const Primitive& prim1 = *primIt; + triangleReorder(indexData + prim1.m_startIndex, prim1.m_numIndices, numVertices, 32); if (compress) { triangleCompress(&memWriter - , indexData + prim.m_startIndex - , prim.m_numIndices - , vertexData + prim.m_startVertex + , indexData + prim1.m_startIndex + , prim1.m_numIndices + , vertexData + prim1.m_startVertex , numVertices , stride ); diff --git a/3rdparty/bgfx/tools/shaderc/shaderc.cpp b/3rdparty/bgfx/tools/shaderc/shaderc.cpp index f25a03823df..93f4fe1fbb0 100644 --- a/3rdparty/bgfx/tools/shaderc/shaderc.cpp +++ b/3rdparty/bgfx/tools/shaderc/shaderc.cpp @@ -952,22 +952,22 @@ int main(int _argc, const char* _argv[]) { const char* precision = NULL; const char* interpolation = NULL; - const char* type = parse; + const char* typen = parse; - if (0 == strncmp(type, "lowp", 4) - || 0 == strncmp(type, "mediump", 7) - || 0 == strncmp(type, "highp", 5) ) + if (0 == strncmp(typen, "lowp", 4) + || 0 == strncmp(typen, "mediump", 7) + || 0 == strncmp(typen, "highp", 5) ) { - precision = type; - type = parse = bx::strws(bx::strword(parse) ); + precision = typen; + typen = parse = bx::strws(bx::strword(parse) ); } - if (0 == strncmp(type, "flat", 4) - || 0 == strncmp(type, "smooth", 6) - || 0 == strncmp(type, "noperspective", 13) ) + if (0 == strncmp(typen, "flat", 4) + || 0 == strncmp(typen, "smooth", 6) + || 0 == strncmp(typen, "noperspective", 13) ) { - interpolation = type; - type = parse = bx::strws(bx::strword(parse) ); + interpolation = typen; + typen = parse = bx::strws(bx::strword(parse) ); } const char* name = parse = bx::strws(bx::strword(parse) ); @@ -976,7 +976,7 @@ int main(int _argc, const char* _argv[]) const char* assign = parse = bx::strws(bx::strword(parse) ); const char* init = parse = bx::strws((*parse == '=' ? ++parse : parse)); - if (type < eol + if (typen < eol && name < eol && column < eol && ':' == *column @@ -993,7 +993,7 @@ int main(int _argc, const char* _argv[]) var.m_interpolation.assign(interpolation, bx::strword(interpolation)-interpolation); } - var.m_type.assign(type, bx::strword(type)-type); + var.m_type.assign(typen, bx::strword(typen)-typen); var.m_name.assign(name, bx::strword(name)-name); var.m_semantics.assign(semantics, bx::strword(semantics)-semantics); @@ -1101,9 +1101,6 @@ int main(int _argc, const char* _argv[]) return EXIT_FAILURE; } - uint32_t inputHash = 0; - uint32_t outputHash = 0; - if ('f' == shaderType) { bx::write(writer, BGFX_CHUNK_MAGIC_FSH); @@ -1653,7 +1650,6 @@ int main(int _argc, const char* _argv[]) if (0 != glsl) { - const char* profile = cmdLine.findOption('p', "profile"); if (NULL == profile) { writef(&writer diff --git a/3rdparty/bgfx/tools/shaderc/shaderc_dx11.cpp b/3rdparty/bgfx/tools/shaderc/shaderc_d3d11.cpp index e1f0d90ec10..4dcbb75bedd 100644 --- a/3rdparty/bgfx/tools/shaderc/shaderc_dx11.cpp +++ b/3rdparty/bgfx/tools/shaderc/shaderc_d3d11.cpp @@ -14,7 +14,10 @@ # define D3D_SVF_USED 2 #endif // D3D_SVF_USED +#ifndef IID_ID3D11ShaderReflection static const GUID GUID_ID3D11ShaderReflection = { 0x0a233719, 0x3960, 0x4578, { 0x9d, 0x7c, 0x20, 0x3b, 0x8b, 0x1d, 0x9c, 0xc1 } }; +# define IID_ID3D11ShaderReflection GUID_ID3D11ShaderReflection +#endif // IID_ID3D11ShaderReflection struct RemapInputSemantic { @@ -209,7 +212,7 @@ bool compileHLSLShaderDx11(bx::CommandLine& _cmdLine, const std::string& _code, ID3D11ShaderReflection* reflect = NULL; hr = D3DReflect(code->GetBufferPointer() , code->GetBufferSize() - , GUID_ID3D11ShaderReflection + , IID_ID3D11ShaderReflection , (void**)&reflect ); if (FAILED(hr) ) @@ -297,14 +300,14 @@ bool compileHLSLShaderDx11(bx::CommandLine& _cmdLine, const std::string& _code, hr = type->GetDesc(&constDesc); if (SUCCEEDED(hr) ) { - UniformType::Enum type = findUniformTypeDx11(constDesc); + UniformType::Enum uniformType = findUniformTypeDx11(constDesc); - if (UniformType::Count != type + if (UniformType::Count != uniformType && 0 != (varDesc.uFlags & D3D_SVF_USED) ) { Uniform un; un.name = varDesc.Name; - un.type = type; + un.type = uniformType; un.num = constDesc.Elements; un.regIndex = varDesc.StartOffset; un.regCount = BX_ALIGN_16(varDesc.Size)/16; @@ -315,7 +318,7 @@ bool compileHLSLShaderDx11(bx::CommandLine& _cmdLine, const std::string& _code, , varDesc.StartOffset , varDesc.Size , varDesc.uFlags - , type + , uniformType ); } else diff --git a/3rdparty/bgfx/tools/shaderc/shaderc_dx9.cpp b/3rdparty/bgfx/tools/shaderc/shaderc_d3d9.cpp index 93a4f44335b..7f301320d82 100644 --- a/3rdparty/bgfx/tools/shaderc/shaderc_dx9.cpp +++ b/3rdparty/bgfx/tools/shaderc/shaderc_d3d9.cpp @@ -14,6 +14,12 @@ BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wundef"); #include <d3dx9.h> BX_PRAGMA_DIAGNOSTIC_POP(); +#if defined(__MINGW32__) +# ifndef D3DXDisassembleShader +extern "C" HRESULT WINAPI D3DXDisassembleShader(CONST DWORD* pShader, BOOL EnableColorCode, LPCSTR pComments, LPD3DXBUFFER* ppDisassembly); +# endif // D3DXDisassembleShader +#endif // !defined(__MINGW32__) + struct UniformRemapDx9 { UniformType::Enum id; diff --git a/3rdparty/bgfx/tools/shaderc/shaderc_glsl.cpp b/3rdparty/bgfx/tools/shaderc/shaderc_glsl.cpp index 57fa39af9a3..f0e5cec82fe 100644 --- a/3rdparty/bgfx/tools/shaderc/shaderc_glsl.cpp +++ b/3rdparty/bgfx/tools/shaderc/shaderc_glsl.cpp @@ -65,18 +65,18 @@ bool compileGLSLShader(bx::CommandLine& _cmdLine, uint32_t _gles, const std::str if (0 != _gles) { - char* shader = const_cast<char*>(optimizedShader); - strreplace(shader, "gl_FragDepthEXT", "gl_FragDepth"); - - strreplace(shader, "texture2DLodEXT", "texture2DLod"); - strreplace(shader, "texture2DProjLodEXT", "texture2DProjLod"); - strreplace(shader, "textureCubeLodEXT", "textureCubeLod"); - strreplace(shader, "texture2DGradEXT", "texture2DGrad"); - strreplace(shader, "texture2DProjGradEXT", "texture2DProjGrad"); - strreplace(shader, "textureCubeGradEXT", "textureCubeGrad"); - - strreplace(shader, "shadow2DEXT", "shadow2D"); - strreplace(shader, "shadow2DProjEXT", "shadow2DProj"); + char* code = const_cast<char*>(optimizedShader); + strreplace(code, "gl_FragDepthEXT", "gl_FragDepth"); + + strreplace(code, "texture2DLodEXT", "texture2DLod"); + strreplace(code, "texture2DProjLodEXT", "texture2DProjLod"); + strreplace(code, "textureCubeLodEXT", "textureCubeLod"); + strreplace(code, "texture2DGradEXT", "texture2DGrad"); + strreplace(code, "texture2DProjGradEXT", "texture2DProjGrad"); + strreplace(code, "textureCubeGradEXT", "textureCubeGrad"); + + strreplace(code, "shadow2DEXT", "shadow2D"); + strreplace(code, "shadow2DProjEXT", "shadow2DProj"); } UniformArray uniforms; @@ -110,14 +110,14 @@ bool compileGLSLShader(bx::CommandLine& _cmdLine, uint32_t _gles, const std::str } const char* precision = NULL; - const char* type = parse; + const char* typen = parse; - if (0 == strncmp(type, "lowp", 4) - || 0 == strncmp(type, "mediump", 7) - || 0 == strncmp(type, "highp", 5) ) + if (0 == strncmp(typen, "lowp", 4) + || 0 == strncmp(typen, "mediump", 7) + || 0 == strncmp(typen, "highp", 5) ) { - precision = type; - type = parse = bx::strws(bx::strword(parse) ); + precision = typen; + typen = parse = bx::strws(bx::strword(parse) ); } BX_UNUSED(precision); @@ -125,13 +125,13 @@ bool compileGLSLShader(bx::CommandLine& _cmdLine, uint32_t _gles, const std::str char uniformType[256]; parse = bx::strword(parse); - if (0 == strncmp(type, "sampler", 7) ) + if (0 == strncmp(typen, "sampler", 7) ) { strcpy(uniformType, "int"); } else { - bx::strlcpy(uniformType, type, parse-type+1); + bx::strlcpy(uniformType, typen, parse-typen+1); } const char* name = parse = bx::strws(parse); @@ -181,8 +181,8 @@ bool compileGLSLShader(bx::CommandLine& _cmdLine, uint32_t _gles, const std::str uint8_t nameSize = (uint8_t)un.name.size(); bx::write(_writer, nameSize); bx::write(_writer, un.name.c_str(), nameSize); - uint8_t type = un.type; - bx::write(_writer, type); + uint8_t uniformType = un.type; + bx::write(_writer, uniformType); bx::write(_writer, un.num); bx::write(_writer, un.regIndex); bx::write(_writer, un.regCount); diff --git a/3rdparty/bx/3rdparty/CL/cl_platform.h b/3rdparty/bx/3rdparty/CL/cl_platform.h index 46b3d9dcdc3..cf7b2542d2c 100644 --- a/3rdparty/bx/3rdparty/CL/cl_platform.h +++ b/3rdparty/bx/3rdparty/CL/cl_platform.h @@ -454,7 +454,7 @@ typedef unsigned int cl_GLenum; /* Define alignment keys */ #if defined( __GNUC__ ) #define CL_ALIGNED(_x) __attribute__ ((aligned(_x))) -#elif defined( _WIN32) && (_MSC_VER) +#elif defined( _WIN32 ) && defined( _MSC_VER ) /* Alignment keys neutered on windows because MSVC can't swallow function arguments with alignment requirements */ /* http://msdn.microsoft.com/en-us/library/373ak2y1%28VS.71%29.aspx */ /* #include <crtdefs.h> */ diff --git a/3rdparty/bx/include/bx/fpumath.h b/3rdparty/bx/include/bx/fpumath.h index b85fb9c3ed6..37d4fec636e 100644 --- a/3rdparty/bx/include/bx/fpumath.h +++ b/3rdparty/bx/include/bx/fpumath.h @@ -14,10 +14,10 @@ namespace bx { - const float pi = 3.14159265358979323846f; - const float invPi = 1.0f/3.14159265358979323846f; - const float piHalf = 1.57079632679489661923f; - const float sqrt2 = 1.41421356237309504880f; + static const float pi = 3.14159265358979323846f; + static const float invPi = 1.0f/3.14159265358979323846f; + static const float piHalf = 1.57079632679489661923f; + static const float sqrt2 = 1.41421356237309504880f; inline float toRad(float _deg) { diff --git a/3rdparty/bx/include/bx/ringbuffer.h b/3rdparty/bx/include/bx/ringbuffer.h index 7e86cc80fcd..424c83e823f 100644 --- a/3rdparty/bx/include/bx/ringbuffer.h +++ b/3rdparty/bx/include/bx/ringbuffer.h @@ -201,11 +201,11 @@ namespace bx void read(char* _data, uint32_t _len) { - const uint32_t end = (m_read + _len) % m_control.m_size; + const uint32_t eof = (m_read + _len) % m_control.m_size; uint32_t wrap = 0; const char* from = &m_buffer[m_read]; - if (end < m_read) + if (eof < m_read) { wrap = m_control.m_size - m_read; memcpy(_data, from, wrap); @@ -215,7 +215,7 @@ namespace bx memcpy(_data, from, _len-wrap); - m_read = end; + m_read = eof; } void skip(uint32_t _len) @@ -271,11 +271,11 @@ namespace bx void write(const char* _data, uint32_t _len) { - const uint32_t end = (m_write + _len) % m_control.m_size; + const uint32_t eof = (m_write + _len) % m_control.m_size; uint32_t wrap = 0; char* to = &m_buffer[m_write]; - if (end < m_write) + if (eof < m_write) { wrap = m_control.m_size - m_write; memcpy(to, _data, wrap); @@ -285,16 +285,16 @@ namespace bx memcpy(to, _data, _len-wrap); - m_write = end; + m_write = eof; } void write(ReadRingBufferT<Control>& _read, uint32_t _len) { - const uint32_t end = (_read.m_read + _len) % _read.m_control.m_size; + const uint32_t eof = (_read.m_read + _len) % _read.m_control.m_size; uint32_t wrap = 0; const char* from = &_read.m_buffer[_read.m_read]; - if (end < _read.m_read) + if (eof < _read.m_read) { wrap = _read.m_control.m_size - _read.m_read; write(from, wrap); @@ -303,7 +303,7 @@ namespace bx write(from, _len-wrap); - _read.m_read = end; + _read.m_read = eof; } void skip(uint32_t _len) diff --git a/3rdparty/bx/include/bx/uint32_t.h b/3rdparty/bx/include/bx/uint32_t.h index ce04e047721..9e77295c5e5 100644 --- a/3rdparty/bx/include/bx/uint32_t.h +++ b/3rdparty/bx/include/bx/uint32_t.h @@ -648,7 +648,7 @@ namespace bx inline uint64_t uint64_cntlz(uint64_t _val) { #if BX_COMPILER_GCC || BX_COMPILER_CLANG - return __builtin_clz(_val); + return __builtin_clzll(_val); #elif BX_COMPILER_MSVC && BX_PLATFORM_WINDOWS && BX_ARCH_64BIT unsigned long index; _BitScanReverse64(&index, _val); @@ -669,7 +669,7 @@ namespace bx inline uint64_t uint64_cnttz(uint64_t _val) { #if BX_COMPILER_GCC || BX_COMPILER_CLANG - return __builtin_ctzl(_val); + return __builtin_ctzll(_val); #elif BX_COMPILER_MSVC && BX_PLATFORM_WINDOWS && BX_ARCH_64BIT unsigned long index; _BitScanForward64(&index, _val); diff --git a/3rdparty/bx/include/tinystl/hash_base.h b/3rdparty/bx/include/tinystl/hash_base.h index 9d70ef02057..73b5c9ebda8 100644 --- a/3rdparty/bx/include/tinystl/hash_base.h +++ b/3rdparty/bx/include/tinystl/hash_base.h @@ -84,6 +84,9 @@ namespace tinystl { const Key first; unordered_hash_node* next; unordered_hash_node* prev; + + private: + unordered_hash_node& operator=(const unordered_hash_node&); }; template<typename Key> diff --git a/3rdparty/bx/include/tinystl/string.h b/3rdparty/bx/include/tinystl/string.h index ba338c3956a..5397c98bb80 100644 --- a/3rdparty/bx/include/tinystl/string.h +++ b/3rdparty/bx/include/tinystl/string.h @@ -47,8 +47,8 @@ namespace tinystl { size_t size() const; bool empty() const; - void reserve(size_t size); - void resize(size_t size); + void reserve(size_t _size); + void resize(size_t _size); void append(const char* first, const char* last); void append(const char* str); @@ -145,7 +145,7 @@ namespace tinystl { return; } - const size_t size = (size_t)(m_last - m_first); + const size_t _size = (size_t)(m_last - m_first); pointer newfirst = (pointer)Alloc::static_allocate(capacity + 1); for (pointer it = m_first, newit = newfirst, end = m_last; it != end; ++it, ++newit) { @@ -157,17 +157,17 @@ namespace tinystl { } m_first = newfirst; - m_last = newfirst + size; + m_last = newfirst + _size; m_capacity = m_first + capacity; } template<typename Alloc> - inline void stringT<Alloc>::resize(size_t size) { - reserve(size); - for (pointer it = m_last, end = m_first + size + 1; it < end; ++it) + inline void stringT<Alloc>::resize(size_t _size) { + reserve(_size); + for (pointer it = m_last, end = m_first + _size + 1; it < end; ++it) *it = 0; - m_last += size; + m_last += _size; } template<typename Alloc> diff --git a/3rdparty/bx/include/tinystl/unordered_set.h b/3rdparty/bx/include/tinystl/unordered_set.h index a4caddd2529..976a412b124 100644 --- a/3rdparty/bx/include/tinystl/unordered_set.h +++ b/3rdparty/bx/include/tinystl/unordered_set.h @@ -81,12 +81,12 @@ namespace tinystl { { const size_t nbuckets = (size_t)(other.m_buckets.last - other.m_buckets.first); buffer_init<pointer, Alloc>(&m_buckets); - buffer_resize<pointer, Alloc>(&m_buckets, 9, 0); + buffer_resize<pointer, Alloc>(&m_buckets, nbuckets, 0); - for (pointer* it = *other.m_buckets.first; it; it = it->next) { + for (pointer it = *other.m_buckets.first; it; it = it->next) { unordered_hash_node<Key, void>* newnode = new(placeholder(), Alloc::static_allocate(sizeof(unordered_hash_node<Key, void>))) unordered_hash_node<Key, void>(*it); newnode->next = newnode->prev = 0; - unordered_hash_node_insert(newnode, hash(*it), m_buckets.first, nbuckets - 1); + unordered_hash_node_insert(newnode, hash(it->first), m_buckets.first, nbuckets - 1); } } diff --git a/3rdparty/bx/include/tinystl/vector.h b/3rdparty/bx/include/tinystl/vector.h index 1e05f01925f..3a8e28a4551 100644 --- a/3rdparty/bx/include/tinystl/vector.h +++ b/3rdparty/bx/include/tinystl/vector.h @@ -38,8 +38,8 @@ namespace tinystl { public: vector(); vector(const vector& other); - vector(size_t size); - vector(size_t size, const T& value); + vector(size_t _size); + vector(size_t _size, const T& value); vector(const T* first, const T* last); ~vector(); @@ -62,7 +62,7 @@ namespace tinystl { void resize(size_t size); void resize(size_t size, const T& value); void clear(); - void reserve(size_t capacity); + void reserve(size_t _capacity); void push_back(const T& t); void pop_back(); @@ -107,15 +107,15 @@ namespace tinystl { } template<typename T, typename Alloc> - inline vector<T, Alloc>::vector(size_t size) { + inline vector<T, Alloc>::vector(size_t _size) { buffer_init(&m_buffer); - buffer_resize(&m_buffer, size, T()); + buffer_resize(&m_buffer, _size, T()); } template<typename T, typename Alloc> - inline vector<T, Alloc>::vector(size_t size, const T& value) { + inline vector<T, Alloc>::vector(size_t _size, const T& value) { buffer_init(&m_buffer); - buffer_resize(&m_buffer, size, value); + buffer_resize(&m_buffer, _size, value); } template<typename T, typename Alloc> @@ -187,13 +187,13 @@ namespace tinystl { } template<typename T, typename Alloc> - inline void vector<T, Alloc>::resize(size_t size) { - buffer_resize(&m_buffer, size, T()); + inline void vector<T, Alloc>::resize(size_t _size) { + buffer_resize(&m_buffer, _size, T()); } template<typename T, typename Alloc> - inline void vector<T, Alloc>::resize(size_t size, const T& value) { - buffer_resize(&m_buffer, size, value); + inline void vector<T, Alloc>::resize(size_t _size, const T& value) { + buffer_resize(&m_buffer, _size, value); } template<typename T, typename Alloc> @@ -202,8 +202,8 @@ namespace tinystl { } template<typename T, typename Alloc> - inline void vector<T, Alloc>::reserve(size_t capacity) { - buffer_reserve(&m_buffer, capacity); + inline void vector<T, Alloc>::reserve(size_t _capacity) { + buffer_reserve(&m_buffer, _capacity); } template<typename T, typename Alloc> @@ -277,4 +277,4 @@ namespace tinystl { } } -#endif +#endif diff --git a/3rdparty/bx/scripts/toolchain.lua b/3rdparty/bx/scripts/toolchain.lua index 2d3f0817c7b..358bfbc9b50 100644 --- a/3rdparty/bx/scripts/toolchain.lua +++ b/3rdparty/bx/scripts/toolchain.lua @@ -361,7 +361,7 @@ function toolchain(_buildDir, _libDir) } configuration { "vs2008" } - includedirs { path.join(bxDir .. "include/compat/msvc/pre1600") } + includedirs { path.join(bxDir, "include/compat/msvc/pre1600") } configuration { "x32", "vs*" } targetdir (path.join(_buildDir, "win32_" .. _ACTION, "bin")) @@ -403,6 +403,11 @@ function toolchain(_buildDir, _libDir) "NoExceptions", } + configuration { "*-gcc* or osx" } + buildoptions { + "-Wshadow", + } + configuration { "mingw-*" } defines { "WIN32" } includedirs { path.join(bxDir, "include/compat/mingw") } diff --git a/3rdparty/bx/tests/unordered_set_copyctor.cpp b/3rdparty/bx/tests/unordered_set_copyctor.cpp new file mode 100644 index 00000000000..621df020772 --- /dev/null +++ b/3rdparty/bx/tests/unordered_set_copyctor.cpp @@ -0,0 +1,43 @@ +/*- +* Copyright 2012-2015 Matthew Endsley +* All rights reserved +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted providing that the following conditions +* are met: +* 1. Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* 2. 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. +* +* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. +*/ + +#include "test.h" + +#include <tinystl/allocator.h> +#include <tinystl/unordered_set.h> +#include <UnitTest++.h> + +TEST(uoset_copyctor) { + + // verify this compiles + typedef tinystl::unordered_set<unsigned int> set; + set s; + s.insert(32); + set other = s; + CHECK(other.find(32) != other.end()); + other.clear(); + CHECK(other.empty()); +} diff --git a/3rdparty/bx/tests/unordered_set_pod.cpp b/3rdparty/bx/tests/unordered_set_pod.cpp new file mode 100644 index 00000000000..ed408401f7e --- /dev/null +++ b/3rdparty/bx/tests/unordered_set_pod.cpp @@ -0,0 +1,39 @@ +/*- +* Copyright 2012-2015 Matthew Endsley +* All rights reserved +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted providing that the following conditions +* are met: +* 1. Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* 2. 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. +* +* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. +*/ + +#include "test.h" + +#include <tinystl/allocator.h> +#include <tinystl/unordered_set.h> +#include <UnitTest++.h> + +TEST(uoset_pod_compiles) { + + // verify this compiles + tinystl::unordered_set<unsigned int> s; + s.insert(32); + s.clear(); +} diff --git a/3rdparty/bx/tools/bin/darwin/genie b/3rdparty/bx/tools/bin/darwin/genie Binary files differindex 6a87e019ef2..93e518e687c 100644 --- a/3rdparty/bx/tools/bin/darwin/genie +++ b/3rdparty/bx/tools/bin/darwin/genie diff --git a/3rdparty/bx/tools/bin/linux/genie b/3rdparty/bx/tools/bin/linux/genie Binary files differindex 057e0249710..59318fd4cb5 100644 --- a/3rdparty/bx/tools/bin/linux/genie +++ b/3rdparty/bx/tools/bin/linux/genie diff --git a/3rdparty/bx/tools/bin/windows/genie.exe b/3rdparty/bx/tools/bin/windows/genie.exe Binary files differindex d4b655cc846..e3d94152944 100644 --- a/3rdparty/bx/tools/bin/windows/genie.exe +++ b/3rdparty/bx/tools/bin/windows/genie.exe |