From 4a1a31b538de63ce0e774bd1185cf572f7c34f43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sat, 11 Oct 2014 12:32:43 -0700 Subject: [PATCH] Updated glsl-optimizer. --- 3rdparty/glsl-optimizer/.gitignore | 4 +- 3rdparty/glsl-optimizer/CMakeLists.txt | 5 + 3rdparty/glsl-optimizer/Changelog.md | 54 + 3rdparty/glsl-optimizer/README.md | 17 +- 3rdparty/glsl-optimizer/binding.gyp | 9 +- .../glsl-optimizer/contrib/glslopt/Main.cpp | 23 +- 3rdparty/glsl-optimizer/package.json | 25 +- .../vs2010/glsl_optimizer_lib.vcxproj | 24 +- .../vs2010/glsl_optimizer_lib.vcxproj.filters | 48 +- .../project.pbxproj | 78 +- 3rdparty/glsl-optimizer/removeDeletedByUs.sh | 1 + 3rdparty/glsl-optimizer/src/glsl/.gitignore | 4 + 3rdparty/glsl-optimizer/src/glsl/Makefile | 24 +- 3rdparty/glsl-optimizer/src/glsl/SConscript | 7 +- 3rdparty/glsl-optimizer/src/glsl/ast.h | 87 +- .../src/glsl/ast_array_index.cpp | 22 +- .../glsl-optimizer/src/glsl/ast_function.cpp | 133 +- .../glsl-optimizer/src/glsl/ast_to_hir.cpp | 2501 ++++--- 3rdparty/glsl-optimizer/src/glsl/ast_type.cpp | 169 +- .../src/glsl/builtin_functions.cpp | 365 +- .../glsl-optimizer/src/glsl/builtin_types.cpp | 83 +- .../src/glsl/builtin_variables.cpp | 153 +- .../glsl-optimizer/src/glsl/glcpp/glcpp-lex.c | 980 ++- .../glsl-optimizer/src/glsl/glcpp/glcpp-lex.l | 473 +- .../src/glsl/glcpp/glcpp-parse.c | 2013 +++--- .../src/glsl/glcpp/glcpp-parse.h | 76 +- .../src/glsl/glcpp/glcpp-parse.y | 641 +- .../glsl-optimizer/src/glsl/glcpp/glcpp.h | 15 +- 3rdparty/glsl-optimizer/src/glsl/glcpp/pp.c | 96 +- .../glsl-optimizer/src/glsl/glsl_lexer.cpp | 2098 +++--- .../glsl-optimizer/src/glsl/glsl_lexer.ll | 32 +- .../src/glsl/glsl_optimizer.cpp | 266 +- .../glsl-optimizer/src/glsl/glsl_optimizer.h | 28 +- .../glsl-optimizer/src/glsl/glsl_parser.cpp | 6296 +++++++++-------- .../glsl-optimizer/src/glsl/glsl_parser.h | 376 +- .../glsl-optimizer/src/glsl/glsl_parser.yy | 479 +- .../src/glsl/glsl_parser_extras.cpp | 249 +- .../src/glsl/glsl_parser_extras.h | 215 +- .../src/glsl/glsl_symbol_table.cpp | 27 +- .../src/glsl/glsl_symbol_table.h | 35 +- .../glsl-optimizer/src/glsl/glsl_types.cpp | 111 +- 3rdparty/glsl-optimizer/src/glsl/glsl_types.h | 69 +- .../src/glsl/hir_field_selection.cpp | 1 - 3rdparty/glsl-optimizer/src/glsl/ir.cpp | 218 +- 3rdparty/glsl-optimizer/src/glsl/ir.h | 633 +- .../src/glsl/ir_basic_block.cpp | 12 +- .../glsl-optimizer/src/glsl/ir_builder.cpp | 35 +- 3rdparty/glsl-optimizer/src/glsl/ir_builder.h | 7 +- 3rdparty/glsl-optimizer/src/glsl/ir_clone.cpp | 59 +- .../src/glsl/ir_constant_expression.cpp | 227 +- .../glsl-optimizer/src/glsl/ir_equals.cpp | 6 +- .../src/glsl/ir_expression_flattening.cpp | 6 +- .../glsl-optimizer/src/glsl/ir_function.cpp | 224 +- .../src/glsl/ir_function_detect_recursion.cpp | 8 +- .../src/glsl/ir_hierarchical_visitor.cpp | 204 +- .../src/glsl/ir_hierarchical_visitor.h | 35 +- .../glsl-optimizer/src/glsl/ir_hv_accept.cpp | 25 +- .../glsl-optimizer/src/glsl/ir_optimization.h | 35 +- .../src/glsl/ir_print_glsl_visitor.cpp | 203 +- .../src/glsl/ir_print_glsl_visitor.h | 61 + .../src/glsl/ir_print_metal_visitor.cpp | 1914 +++++ .../src/glsl/ir_print_metal_visitor.h | 36 + .../src/glsl/ir_print_visitor.cpp | 268 +- .../src/glsl/ir_print_visitor.h | 3 +- .../src/glsl/ir_rvalue_visitor.cpp | 40 +- .../src/glsl/ir_rvalue_visitor.h | 6 + 3rdparty/glsl-optimizer/src/glsl/ir_uniform.h | 18 +- .../src/glsl/ir_unused_structs.cpp | 7 +- .../glsl-optimizer/src/glsl/ir_validate.cpp | 68 +- .../src/glsl/ir_variable_refcount.cpp | 20 +- .../src/glsl/ir_variable_refcount.h | 6 + .../glsl-optimizer/src/glsl/link_atomics.cpp | 22 +- .../src/glsl/link_functions.cpp | 25 +- .../src/glsl/link_interface_blocks.cpp | 16 +- .../link_uniform_block_active_visitor.cpp | 97 +- .../glsl/link_uniform_block_active_visitor.h | 8 +- .../src/glsl/link_uniform_blocks.cpp | 47 +- .../src/glsl/link_uniform_initializers.cpp | 158 +- .../glsl-optimizer/src/glsl/link_uniforms.cpp | 244 +- .../glsl-optimizer/src/glsl/link_varyings.cpp | 464 +- .../glsl-optimizer/src/glsl/link_varyings.h | 17 + 3rdparty/glsl-optimizer/src/glsl/linker.cpp | 618 +- 3rdparty/glsl-optimizer/src/glsl/linker.h | 24 +- 3rdparty/glsl-optimizer/src/glsl/list.h | 641 +- .../glsl-optimizer/src/glsl/loop_analysis.cpp | 43 +- .../glsl-optimizer/src/glsl/loop_analysis.h | 30 +- .../glsl-optimizer/src/glsl/loop_controls.cpp | 21 +- .../glsl-optimizer/src/glsl/loop_unroll.cpp | 98 +- .../glsl-optimizer/src/glsl/lower_discard.cpp | 4 +- .../src/glsl/lower_if_to_cond_assign.cpp | 10 +- .../src/glsl/lower_instructions.cpp | 123 +- .../glsl-optimizer/src/glsl/lower_jumps.cpp | 8 +- .../src/glsl/lower_named_interface_blocks.cpp | 12 +- .../src/glsl/lower_offset_array.cpp | 91 + .../src/glsl/lower_output_reads.cpp | 4 +- .../src/glsl/lower_packed_varyings.cpp | 57 +- .../src/glsl/lower_ubo_reference.cpp | 245 +- .../lower_variable_index_to_cond_assign.cpp | 3 +- .../glsl/lower_vec_index_to_cond_assign.cpp | 3 +- .../src/glsl/lower_vec_index_to_swizzle.cpp | 3 +- .../src/glsl/lower_vector_insert.cpp | 8 +- .../src/glsl/lower_vertex_id.cpp | 144 + 3rdparty/glsl-optimizer/src/glsl/main.cpp | 9 +- .../glsl-optimizer/src/glsl/opt_algebraic.cpp | 209 +- .../src/glsl/opt_array_splitting.cpp | 38 +- .../src/glsl/opt_constant_folding.cpp | 5 + .../src/glsl/opt_constant_propagation.cpp | 20 +- .../src/glsl/opt_constant_variable.cpp | 9 +- .../src/glsl/opt_copy_propagation.cpp | 22 +- .../glsl/opt_copy_propagation_elements.cpp | 32 +- 3rdparty/glsl-optimizer/src/glsl/opt_cse.cpp | 15 +- .../src/glsl/opt_dead_builtin_variables.cpp | 81 + .../src/glsl/opt_dead_builtin_varyings.cpp | 9 +- .../glsl-optimizer/src/glsl/opt_dead_code.cpp | 39 +- .../src/glsl/opt_dead_code_local.cpp | 47 +- .../src/glsl/opt_dead_functions.cpp | 10 +- .../src/glsl/opt_flip_matrices.cpp | 3 +- .../src/glsl/opt_function_inlining.cpp | 13 +- .../src/glsl/opt_if_simplification.cpp | 10 +- .../glsl-optimizer/src/glsl/opt_minmax.cpp | 475 ++ .../src/glsl/opt_rebalance_tree.cpp | 321 + .../src/glsl/opt_redundant_jumps.cpp | 2 +- .../src/glsl/opt_structure_splitting.cpp | 13 +- .../src/glsl/opt_tree_grafting.cpp | 30 +- .../src/glsl/opt_vector_splitting.cpp | 485 ++ .../glsl-optimizer/src/glsl/opt_vectorize.cpp | 49 +- .../glsl-optimizer/src/glsl/s_expression.cpp | 6 +- .../src/glsl/standalone_scaffolding.cpp | 32 +- .../src/glsl/standalone_scaffolding.h | 3 - .../glsl-optimizer/src/glsl_optimizer_lib.gyp | 13 +- .../glsl-optimizer/src/mesa/main/.gitignore | 1 + .../glsl-optimizer/src/mesa/main/compiler.h | 110 +- .../glsl-optimizer/src/mesa/main/config.h | 19 + 3rdparty/glsl-optimizer/src/mesa/main/dd.h | 1 - .../glsl-optimizer/src/mesa/main/errors.h | 53 + .../glsl-optimizer/src/mesa/main/glminimal.h | 2 + .../glsl-optimizer/src/mesa/main/imports.c | 82 +- .../glsl-optimizer/src/mesa/main/imports.h | 87 +- .../glsl-optimizer/src/mesa/main/macros.h | 43 +- .../glsl-optimizer/src/mesa/main/mtypes.h | 306 +- .../src/mesa/program/prog_hash_table.c | 10 +- .../src/mesa/program/prog_statevars.h | 2 - .../src/mesa/program/symbol_table.c | 124 +- .../src/mesa/program/symbol_table.h | 13 - 3rdparty/glsl-optimizer/src/node/binding.cpp | 7 +- 3rdparty/glsl-optimizer/src/node/compiler.cpp | 49 +- 3rdparty/glsl-optimizer/src/node/compiler.h | 8 +- 3rdparty/glsl-optimizer/src/node/shader.cpp | 57 +- 3rdparty/glsl-optimizer/src/node/shader.h | 16 +- 3rdparty/glsl-optimizer/src/util/.gitignore | 1 + .../glsl-optimizer/src/util/Makefile.sources | 9 + 3rdparty/glsl-optimizer/src/util/SConscript | 38 + .../src/{mesa/main => util}/hash_table.c | 7 +- .../src/{mesa/main => util}/hash_table.h | 6 +- 3rdparty/glsl-optimizer/src/util/macros.h | 129 + .../src/{glsl => util}/ralloc.c | 0 .../src/{glsl => util}/ralloc.h | 26 +- .../tests/fragment/array-const-inES3.txt | 24 + .../tests/fragment/array-const-ir.txt | 64 - .../tests/fragment/array-const-irES.txt | 64 - .../tests/fragment/array-const-out.txt | 2 +- .../tests/fragment/array-const-outES.txt | 2 +- .../tests/fragment/array-const-outES3.txt | 12 + .../fragment/array-const-outES3Metal.txt | 21 + .../tests/fragment/array-constconst-inES3.txt | 26 + .../tests/fragment/array-constconst-ir.txt | 64 - .../tests/fragment/array-constconst-irES.txt | 64 - .../tests/fragment/array-constconst-out.txt | 2 +- .../tests/fragment/array-constconst-outES.txt | 2 +- .../fragment/array-constconst-outES3.txt | 12 + .../fragment/array-constconst-outES3Metal.txt | 21 + .../tests/fragment/ast-inES3.txt | 26 + .../glsl-optimizer/tests/fragment/ast-ir.txt | 70 - .../glsl-optimizer/tests/fragment/ast-out.txt | 18 +- .../tests/fragment/ast-outES3.txt | 27 + .../tests/fragment/ast-outES3Metal.txt | 37 + .../tests/fragment/basic-in.txt | 1 + .../tests/fragment/basic-ir.txt | 18 - .../tests/fragment/basic-irES.txt | 20 - .../tests/fragment/basic-out.txt | 3 +- .../tests/fragment/basic-outES.txt | 2 +- .../tests/fragment/bug-const-variable-ir.txt | 35 - .../tests/fragment/bug-const-variable-out.txt | 6 +- .../tests/fragment/bug-global-init-ir.txt | 19 - .../tests/fragment/bug-global-init-out.txt | 4 +- .../tests/fragment/bug-inline-names-ir.txt | 36 - .../tests/fragment/bug-inline-names-out.txt | 4 +- .../tests/fragment/bug-loop-null-from-ir.txt | 43 - .../tests/fragment/bug-loop-null-from-out.txt | 2 +- .../fragment/bug-loop-share-index-ir.txt | 53 - .../fragment/bug-loop-share-index-out.txt | 4 +- .../tests/fragment/bug-op-parens-ir.txt | 19 - .../tests/fragment/bug-op-parens-out.txt | 5 +- .../tests/fragment/bug-vectorize-tex-in.txt | 17 + .../tests/fragment/bug-vectorize-tex-out.txt | 22 + .../tests/fragment/builtin-vars-inES3.txt | 14 + .../tests/fragment/builtin-vars-outES3.txt | 25 + .../fragment/builtin-vars-outES3Metal.txt | 37 + .../tests/fragment/derivatives-ir.txt | 251 - .../tests/fragment/derivatives-irES.txt | 255 - .../tests/fragment/derivatives-out.txt | 12 +- .../tests/fragment/derivatives-outES.txt | 4 +- .../tests/fragment/estest1-ir.txt | 54 - .../tests/fragment/estest1-out.txt | 15 +- .../tests/fragment/fragdepth-inES3.txt | 13 + .../tests/fragment/fragdepth-ir.txt | 28 - .../tests/fragment/fragdepth-irES.txt | 29 - .../tests/fragment/fragdepth-out.txt | 2 +- .../tests/fragment/fragdepth-outES.txt | 2 +- .../tests/fragment/fragdepth-outES3.txt | 10 + .../tests/fragment/fragdepth-outES3Metal.txt | 20 + .../tests/fragment/framebuffer_fetch-inES.txt | 20 + .../fragment/framebuffer_fetch-inES3.txt | 24 + .../fragment/framebuffer_fetch-outES.txt | 21 + .../fragment/framebuffer_fetch-outES3.txt | 22 + .../framebuffer_fetch-outES3Metal.txt | 29 + .../tests/fragment/glsl120-basic-in.txt | 3 + .../tests/fragment/glsl120-basic-inES3.txt | 23 + .../tests/fragment/glsl120-basic-ir.txt | 40 - .../tests/fragment/glsl120-basic-out.txt | 9 +- .../tests/fragment/glsl120-basic-outES3.txt | 17 + .../fragment/glsl120-basic-outES3Metal.txt | 26 + .../tests/fragment/glsl140-basic-ir.txt | 10 - .../tests/fragment/glsl140-basic-out.txt | 4 +- .../tests/fragment/in-struct-ret-vals-ir.txt | 48 - .../fragment/in-struct-ret-vals-irES.txt | 50 - .../tests/fragment/in-struct-ret-vals-out.txt | 5 +- .../fragment/in-struct-ret-vals-outES.txt | 9 +- .../tests/fragment/in-vals-ret-vals-irES.txt | 36 - .../tests/fragment/in-vals-ret-vals-outES.txt | 9 +- .../tests/fragment/intrinsics-inES3.txt | 79 + .../tests/fragment/intrinsics-ir.txt | 350 - .../tests/fragment/intrinsics-irES.txt | 350 - .../tests/fragment/intrinsics-out.txt | 4 +- .../tests/fragment/intrinsics-outES.txt | 10 +- .../tests/fragment/intrinsics-outES3.txt | 134 + .../tests/fragment/intrinsics-outES3Metal.txt | 143 + .../tests/fragment/loop-for-inES3.txt | 25 + .../tests/fragment/loop-for-irES.txt | 63 - .../tests/fragment/loop-for-outES.txt | 29 +- .../tests/fragment/loop-for-outES3.txt | 31 + .../tests/fragment/loop-for-outES3Metal.txt | 40 + .../fragment/loop-forafterdiscard-inES3.txt | 26 + .../fragment/loop-forafterdiscard-irES.txt | 64 - .../fragment/loop-forafterdiscard-outES.txt | 29 +- .../fragment/loop-forafterdiscard-outES3.txt | 34 + .../loop-forafterdiscard-outES3Metal.txt | 43 + .../fragment/loop-forarounddiscard-irES.txt | 66 - .../fragment/loop-forarounddiscard-outES.txt | 29 +- .../tests/fragment/loop-fornounroll-irES.txt | 28 - .../tests/fragment/loop-fornounroll-outES.txt | 4 +- .../tests/fragment/loop-forunbounded-irES.txt | 65 - .../fragment/loop-forunbounded-outES.txt | 23 +- .../tests/fragment/loop-forvariants-ir.txt | 124 - .../tests/fragment/loop-forvariants-out.txt | 8 +- .../tests/fragment/mrt-inES.txt | 9 + .../glsl-optimizer/tests/fragment/mrt-ir.txt | 16 - .../tests/fragment/mrt-irES3.txt | 18 - .../tests/fragment/mrt-mixed-array-inES3.txt | 13 + .../tests/fragment/mrt-mixed-array-outES3.txt | 11 + .../fragment/mrt-mixed-array-outES3Metal.txt | 20 + .../glsl-optimizer/tests/fragment/mrt-out.txt | 2 +- .../tests/fragment/mrt-outES.txt | 11 + .../tests/fragment/mrt-outES3.txt | 2 +- .../tests/fragment/mrt-outES3Metal.txt | 24 + .../tests/fragment/mrt-unused-inES3.txt | 15 + .../tests/fragment/mrt-unused-outES3.txt | 19 + .../tests/fragment/mrt-unused-outES3Metal.txt | 28 + .../tests/fragment/nested-inlining-ir.txt | 33 - .../tests/fragment/nested-inlining-out.txt | 4 +- .../tests/fragment/opt-copyprop-struct-ir.txt | 23 - .../fragment/opt-copyprop-struct-out.txt | 4 +- .../fragment/opt-copypropelems-swizzle-ir.txt | 21 - .../opt-copypropelems-swizzle-out.txt | 6 +- .../tests/fragment/opt-dead-texloads-ir.txt | 25 - .../tests/fragment/opt-dead-texloads-out.txt | 4 +- .../opt-dead-texloadstreeshadow-inES3.txt | 85 + .../opt-dead-texloadstreeshadow-outES3.txt | 9 + ...pt-dead-texloadstreeshadow-outES3Metal.txt | 18 + .../tests/fragment/opt-deadcode-ir.txt | 51 - .../tests/fragment/opt-deadcode-out.txt | 4 +- .../tests/fragment/opt-deadcodestruct-ir.txt | 24 - .../tests/fragment/opt-deadcodestruct-out.txt | 2 +- .../fragment/opt-grafting-precision-inES3.txt | 15 + .../fragment/opt-grafting-precision-irES.txt | 28 - .../fragment/opt-grafting-precision-outES.txt | 7 +- .../opt-grafting-precision-outES3.txt | 23 + .../opt-grafting-precision-outES3Metal.txt | 32 + .../tests/fragment/opt-ifs-ir.txt | 18 - .../tests/fragment/opt-ifs-out.txt | 4 +- .../fragment/opt-inline-inoutstruct-ir.txt | 21 - .../fragment/opt-inline-inoutstruct-out.txt | 2 +- .../fragment/opt-movevars-sideeffect-irES.txt | 48 - .../opt-movevars-sideeffect-outES.txt | 10 +- .../opt-movevars-sideeffect2-irES.txt | 42 - .../opt-movevars-sideeffect2-outES.txt | 4 +- .../fragment/opt-movevars-simple-irES.txt | 32 - .../fragment/opt-movevars-simple-outES.txt | 4 +- .../tests/fragment/opt-vec-var-index-ir.txt | 33 - .../tests/fragment/opt-vec-var-index-out.txt | 2 +- .../tests/fragment/opt-vectorize-ifs-ir.txt | 37 - .../tests/fragment/opt-vectorize-ifs-out.txt | 8 +- .../fragment/opt-vectorize-retval-ir.txt | 85 - .../fragment/opt-vectorize-retval-out.txt | 41 +- .../tests/fragment/opt-vectorize-types-ir.txt | 37 - .../fragment/opt-vectorize-types-out.txt | 8 +- .../tests/fragment/pp-basic-ir.txt | 20 - .../tests/fragment/pp-basic-out.txt | 2 +- .../tests/fragment/prec-default-irES.txt | 46 - .../tests/fragment/prec-default-outES.txt | 12 +- .../tests/fragment/prec-expressions-inES3.txt | 17 + .../fragment/prec-expressions-outES3.txt | 24 + .../fragment/prec-expressions-outES3Metal.txt | 33 + .../tests/fragment/prec-inlineexpr1-irES.txt | 64 - .../tests/fragment/prec-inlineexpr1-outES.txt | 10 +- .../tests/fragment/prec-inlineexpr2-irES.txt | 64 - .../tests/fragment/prec-inlineexpr2-outES.txt | 10 +- .../tests/fragment/prec-temps-irES.txt | 106 - .../tests/fragment/prec-temps-outES.txt | 29 +- .../tests/fragment/prec-tempssimple-irES.txt | 44 - .../tests/fragment/prec-tempssimple-outES.txt | 33 +- .../tests/fragment/prec-treegrafting-irES.txt | 22 - .../fragment/prec-treegrafting-outES.txt | 6 +- .../fragment/qualifiers-layout-irES3.txt | 18 - .../fragment/qualifiers-layout-outES3.txt | 2 +- .../qualifiers-layout-outES3Metal.txt | 23 + .../fragment/sampler-precision-inES3.txt | 25 + .../tests/fragment/sampler-precision-irES.txt | 58 - .../fragment/sampler-precision-outES.txt | 44 +- .../fragment/sampler-precision-outES3.txt | 44 + .../sampler-precision-outES3Metal.txt | 53 + .../tests/fragment/small-float-ir.txt | 10 - .../tests/fragment/small-float-out.txt | 4 +- .../fragment/struct-array-var-index-ir.txt | 26 - .../fragment/struct-array-var-index-out.txt | 2 +- .../tests/fragment/struct-initializer-ir.txt | 134 - .../tests/fragment/struct-initializer-out.txt | 62 +- .../tests/fragment/struct-unused-ir.txt | 11 - .../tests/fragment/struct-unused-out.txt | 2 +- .../tests/fragment/swizzle-writemask-ir.txt | 16 - .../tests/fragment/swizzle-writemask-out.txt | 4 +- .../tests/fragment/syntax-irES.txt | 41 - .../tests/fragment/syntax-outES.txt | 2 +- .../tests/fragment/ternary-inES3.txt | 18 + .../tests/fragment/ternary-ir.txt | 76 - .../tests/fragment/ternary-irES.txt | 76 - .../tests/fragment/ternary-out.txt | 36 +- .../tests/fragment/ternary-outES.txt | 40 +- .../tests/fragment/ternary-outES3.txt | 51 + .../tests/fragment/ternary-outES3Metal.txt | 60 + .../tests/fragment/ternary-vec4-inES3.txt | 28 + .../tests/fragment/ternary-vec4-ir.txt | 159 - .../tests/fragment/ternary-vec4-irES.txt | 159 - .../tests/fragment/ternary-vec4-out.txt | 171 +- .../tests/fragment/ternary-vec4-outES.txt | 201 +- .../tests/fragment/ternary-vec4-outES3.txt | 176 + .../fragment/ternary-vec4-outES3Metal.txt | 185 + .../tests/fragment/tex2dgrad-inES3.txt | 8 +- .../tests/fragment/tex2dgrad-ir.txt | 23 - .../tests/fragment/tex2dgrad-irES.txt | 24 - .../tests/fragment/tex2dgrad-irES3.txt | 25 - .../tests/fragment/tex2dgrad-out.txt | 7 +- .../tests/fragment/tex2dgrad-outES.txt | 17 +- .../tests/fragment/tex2dgrad-outES3.txt | 21 +- .../tests/fragment/tex2dgrad-outES3Metal.txt | 35 + .../tests/fragment/tex2dlod-inES3.txt | 15 +- .../tests/fragment/tex2dlod-ir.txt | 42 - .../tests/fragment/tex2dlod-irES.txt | 42 - .../tests/fragment/tex2dlod-irES3.txt | 40 - .../tests/fragment/tex2dlod-out.txt | 6 +- .../tests/fragment/tex2dlod-outES.txt | 6 +- .../tests/fragment/tex2dlod-outES3.txt | 16 +- .../tests/fragment/tex2dlod-outES3Metal.txt | 33 + .../tests/fragment/tex2dshadow-inES3.txt | 14 +- .../tests/fragment/tex2dshadow-ir.txt | 60 - .../tests/fragment/tex2dshadow-irES.txt | 61 - .../tests/fragment/tex2dshadow-irES3.txt | 63 - .../tests/fragment/tex2dshadow-out.txt | 6 +- .../tests/fragment/tex2dshadow-outES.txt | 6 +- .../tests/fragment/tex2dshadow-outES3.txt | 17 +- .../fragment/tex2dshadow-outES3Metal.txt | 33 + .../tests/fragment/tex3D-ir.txt | 11 - .../tests/fragment/tex3D-irES3.txt | 14 - .../tests/fragment/tex3D-out.txt | 6 +- .../tests/fragment/tex3D-outES3.txt | 8 +- .../tests/fragment/tex3D-outES3Metal.txt | 25 + .../tests/fragment/texCubeShadow-irES3.txt | 20 - .../tests/fragment/texCubeShadow-outES3.txt | 6 +- .../fragment/texCubeShadow-outES3Metal.txt | 28 + .../tests/fragment/texOffset-irES3.txt | 53 - .../tests/fragment/texOffset-outES3.txt | 21 +- .../tests/fragment/texOffset-outES3Metal.txt | 34 + .../tests/fragment/texProj-inES3.txt | 20 + .../tests/fragment/texProj-irES.txt | 47 - .../tests/fragment/texProj-outES.txt | 19 +- .../tests/fragment/texProj-outES3.txt | 23 + .../tests/fragment/texProj-outES3Metal.txt | 33 + .../tests/fragment/types-writemask-ir.txt | 14 - .../tests/fragment/types-writemask-out.txt | 4 +- .../tests/fragment/varyings-ir.txt | 33 - .../tests/fragment/varyings-irES.txt | 33 - .../tests/fragment/varyings-out.txt | 2 +- .../tests/fragment/varyings-outES.txt | 2 +- .../tests/fragment/vface-ir.txt | 25 - .../tests/fragment/vface-irES.txt | 25 - .../tests/fragment/vface-out.txt | 4 +- .../tests/fragment/vface-outES.txt | 4 +- .../glsl-optimizer/tests/fragment/vpos-ir.txt | 28 - .../tests/fragment/vpos-irES.txt | 28 - .../tests/fragment/vpos-out.txt | 4 +- .../tests/fragment/vpos-outES.txt | 4 +- .../fragment/z-LightShaftsCoord-inES3.txt | 98 + .../fragment/z-LightShaftsCoord-outES3.txt | 128 + .../z-LightShaftsCoord-outES3Metal.txt | 138 + .../tests/fragment/z-alphabumpspec-inES3.txt | 118 + .../tests/fragment/z-alphabumpspec-ir.txt | 221 - .../tests/fragment/z-alphabumpspec-out.txt | 40 +- .../tests/fragment/z-alphabumpspec-outES3.txt | 65 + .../fragment/z-alphabumpspec-outES3Metal.txt | 76 + .../tests/fragment/z-collectshadows-inES3.txt | 81 + .../tests/fragment/z-collectshadows-ir.txt | 195 - .../tests/fragment/z-collectshadows-irES.txt | 197 - .../tests/fragment/z-collectshadows-out.txt | 29 +- .../tests/fragment/z-collectshadows-outES.txt | 60 +- .../fragment/z-collectshadows-outES3.txt | 91 + .../fragment/z-collectshadows-outES3Metal.txt | 100 + .../tests/fragment/z-flare-ir.txt | 30 - .../tests/fragment/z-flare-irES.txt | 32 - .../tests/fragment/z-flare-out.txt | 7 +- .../tests/fragment/z-flare-outES.txt | 7 +- .../tests/fragment/z-fxaa-preset1-ir.txt | 623 -- .../tests/fragment/z-fxaa-preset1-out.txt | 463 +- .../tests/fragment/z-fxaa-preset3-inES3.txt | 139 + .../tests/fragment/z-fxaa-preset3-ir.txt | 599 -- .../tests/fragment/z-fxaa-preset3-out.txt | 337 +- .../tests/fragment/z-fxaa-preset3-outES3.txt | 293 + .../fragment/z-fxaa-preset3-outES3Metal.txt | 302 + .../fragment/z-fxaa3-11-consolepc-ir.txt | 314 - .../fragment/z-fxaa3-11-consolepc-irES.txt | 311 - .../fragment/z-fxaa3-11-consolepc-out.txt | 95 +- .../fragment/z-fxaa3-11-consolepc-outES.txt | 93 +- .../tests/fragment/z-fxaa3-11-pc39-ir.txt | 1476 ---- .../tests/fragment/z-fxaa3-11-pc39-irES.txt | 1476 ---- .../tests/fragment/z-fxaa3-11-pc39-out.txt | 1054 ++- .../tests/fragment/z-fxaa3-11-pc39-outES.txt | 1052 ++- .../tests/fragment/z-particle-ir.txt | 46 - .../tests/fragment/z-particle-irES.txt | 46 - .../tests/fragment/z-particle-out.txt | 7 +- .../tests/fragment/z-particle-outES.txt | 7 +- .../tests/fragment/z-prepasslight-inES3.txt | 147 + .../tests/fragment/z-prepasslight-ir.txt | 529 -- .../tests/fragment/z-prepasslight-irES.txt | 529 -- .../tests/fragment/z-prepasslight-out.txt | 141 +- .../tests/fragment/z-prepasslight-outES.txt | 155 +- .../tests/fragment/z-prepasslight-outES3.txt | 180 + .../fragment/z-prepasslight-outES3Metal.txt | 189 + .../fragment/z-tonemap-usercurve-inES3.txt | 49 + .../fragment/z-tonemap-usercurve-outES3.txt | 46 + .../z-tonemap-usercurve-outES3Metal.txt | 55 + .../tests/fragment/z-treeleaf-ir.txt | 381 - .../tests/fragment/z-treeleaf-irES.txt | 381 - .../tests/fragment/z-treeleaf-out.txt | 20 +- .../tests/fragment/z-treeleaf-outES.txt | 100 +- .../tests/fragment/z-treeleafloop-inES3.txt | 81 + .../tests/fragment/z-treeleafloop-irES.txt | 171 - .../tests/fragment/z-treeleafloop-outES.txt | 84 +- .../tests/fragment/z-treeleafloop-outES3.txt | 89 + .../fragment/z-treeleafloop-outES3Metal.txt | 98 + .../fragment/z-unishader-dirlm-inES3.txt | 259 + .../tests/fragment/z-unishader-dirlm-ir.txt | 894 --- .../tests/fragment/z-unishader-dirlm-out.txt | 288 +- .../fragment/z-unishader-dirlm-outES3.txt | 205 + .../z-unishader-dirlm-outES3Metal.txt | 214 + .../tests/fragment/z-unity-spot-inES3.txt | 101 + .../tests/fragment/z-unity-spot-outES3.txt | 71 + .../fragment/z-unity-spot-outES3Metal.txt | 80 + .../tests/fragment/zun-Bumped_Diffuse-ir.txt | 159 - .../tests/fragment/zun-Bumped_Diffuse-out.txt | 6 +- .../tests/fragment/zun-Bumped_Diffuse1-ir.txt | 163 - .../fragment/zun-Bumped_Diffuse1-out.txt | 35 +- .../tests/fragment/zun-Bumped_Specular-ir.txt | 240 - .../fragment/zun-Bumped_Specular-out.txt | 37 +- .../fragment/zun-Bumped_Specular1-ir.txt | 221 - .../fragment/zun-Bumped_Specular1-out.txt | 23 +- .../fragment/zun-Bumped_Specular2-ir.txt | 320 - .../fragment/zun-Bumped_Specular2-out.txt | 41 +- .../tests/fragment/zun-Decal-ir.txt | 167 - .../tests/fragment/zun-Decal-out.txt | 22 +- .../tests/fragment/zun-Decal1-ir.txt | 176 - .../tests/fragment/zun-Decal1-out.txt | 23 +- .../tests/fragment/zun-Decal2-ir.txt | 157 - .../tests/fragment/zun-Decal2-out.txt | 29 +- .../tests/fragment/zun-Diffuse-ir.txt | 166 - .../tests/fragment/zun-Diffuse-out.txt | 18 +- .../tests/fragment/zun-Diffuse1-ir.txt | 95 - .../tests/fragment/zun-Diffuse1-out.txt | 4 +- .../tests/fragment/zun-Diffuse2-ir.txt | 281 - .../tests/fragment/zun-Diffuse2-out.txt | 29 +- .../zun-Diffuse_Alpha_Shadowed_ZWrite-ir.txt | 150 - .../zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt | 26 +- .../tests/fragment/zun-Diffuse_Detail-ir.txt | 199 - .../tests/fragment/zun-Diffuse_Detail-out.txt | 26 +- .../tests/fragment/zun-Diffuse_Detail1-ir.txt | 102 - .../fragment/zun-Diffuse_Detail1-out.txt | 4 +- .../zun-FX_Glass_Stained_BumpDistort-ir.txt | 95 - .../zun-FX_Glass_Stained_BumpDistort-out.txt | 15 +- .../fragment/zun-FX_Water_(simple)-ir.txt | 116 - .../fragment/zun-FX_Water_(simple)-out.txt | 9 +- .../tests/fragment/zun-Grab_Invert-ir.txt | 38 - .../tests/fragment/zun-Grab_Invert-out.txt | 6 +- ...un-Hidden_Camera-DepthNormalTexture-ir.txt | 128 - ...n-Hidden_Camera-DepthNormalTexture-out.txt | 27 +- ...n-Hidden_Camera-DepthNormalTexture1-ir.txt | 128 - ...-Hidden_Camera-DepthNormalTexture1-out.txt | 27 +- .../zun-Hidden_Camera-DepthTexture-ir.txt | 52 - .../zun-Hidden_Camera-DepthTexture-out.txt | 6 +- .../zun-Hidden_Color_Correction_Effect-ir.txt | 70 - ...zun-Hidden_Color_Correction_Effect-out.txt | 7 +- .../fragment/zun-Hidden_Edge_Detect_X-ir.txt | 84 - .../fragment/zun-Hidden_Edge_Detect_X-out.txt | 26 +- .../fragment/zun-Hidden_GlowConeTap-ir.txt | 66 - .../fragment/zun-Hidden_GlowConeTap-out.txt | 16 +- .../zun-Hidden_Glow_Downsample-ir.txt | 85 - .../zun-Hidden_Glow_Downsample-out.txt | 21 +- .../zun-Hidden_Grayscale_Effect-ir.txt | 75 - .../zun-Hidden_Grayscale_Effect-out.txt | 9 +- ...Hidden_Internal-CombineDepthNormals-ir.txt | 143 - ...idden_Internal-CombineDepthNormals-out.txt | 28 +- .../zun-Hidden_Internal-GUITextureBlit-ir.txt | 60 - ...zun-Hidden_Internal-GUITextureBlit-out.txt | 8 +- .../zun-Hidden_Internal-GUITextureClip-ir.txt | 60 - ...zun-Hidden_Internal-GUITextureClip-out.txt | 14 +- .../fragment/zun-Hidden_Internal-Halo-ir.txt | 51 - .../fragment/zun-Hidden_Internal-Halo-out.txt | 7 +- ...dden_Internal-PrePassCollectShadows-ir.txt | 195 - ...den_Internal-PrePassCollectShadows-out.txt | 29 +- ...zun-Hidden_Internal-PrePassLighting-ir.txt | 408 -- ...un-Hidden_Internal-PrePassLighting-out.txt | 107 +- .../zun-Hidden_Noise_Shader_RGB-ir.txt | 75 - .../zun-Hidden_Noise_Shader_RGB-out.txt | 10 +- .../zun-Hidden_Noise_Shader_YUV-ir.txt | 100 - .../zun-Hidden_Noise_Shader_YUV-out.txt | 10 +- .../zun-Hidden_Sepiatone_Effect-ir.txt | 59 - .../zun-Hidden_Sepiatone_Effect-out.txt | 6 +- .../zun-Hidden_Shadow-ScreenBlur-ir.txt | 217 - .../zun-Hidden_Shadow-ScreenBlur-out.txt | 111 +- .../zun-Hidden_ShowDepthNTexture-ir.txt | 132 - .../zun-Hidden_ShowDepthNTexture-out.txt | 19 +- .../zun-Hidden_ShowDepthTexture-ir.txt | 72 - .../zun-Hidden_ShowDepthTexture-out.txt | 9 +- ...-Hidden_TerrainEngine_BillboardTree-ir.txt | 66 - ...Hidden_TerrainEngine_BillboardTree-out.txt | 7 +- ...e_Details_BillboardWavingDoublePass-ir.txt | 170 - ..._Details_BillboardWavingDoublePass-out.txt | 29 +- ..._Details_BillboardWavingDoublePass1-ir.txt | 189 - ...Details_BillboardWavingDoublePass1-out.txt | 28 +- ..._Details_BillboardWavingDoublePass2-ir.txt | 108 - ...Details_BillboardWavingDoublePass2-out.txt | 9 +- ...den_TerrainEngine_Details_Vertexlit-ir.txt | 175 - ...en_TerrainEngine_Details_Vertexlit-out.txt | 18 +- ...en_TerrainEngine_Details_Vertexlit1-ir.txt | 290 - ...n_TerrainEngine_Details_Vertexlit1-out.txt | 28 +- ...rainEngine_Details_WavingDoublePass-ir.txt | 192 - ...ainEngine_Details_WavingDoublePass-out.txt | 30 +- ...ainEngine_Details_WavingDoublePass1-ir.txt | 209 - ...inEngine_Details_WavingDoublePass1-out.txt | 28 +- ...ainEngine_Details_WavingDoublePass2-ir.txt | 156 - ...inEngine_Details_WavingDoublePass2-out.txt | 31 +- ..._My_Soft_Occlusion_Leaves_rendertex-ir.txt | 44 - ...My_Soft_Occlusion_Leaves_rendertex-out.txt | 6 +- ...ngine_Soft_Occlusion_Bark_rendertex-ir.txt | 56 - ...gine_Soft_Occlusion_Bark_rendertex-out.txt | 7 +- ...ine_Soft_Occlusion_Leaves_rendertex-ir.txt | 70 - ...ne_Soft_Occlusion_Leaves_rendertex-out.txt | 9 +- ...ainEngine_Splatmap_Lightmap-AddPass-ir.txt | 221 - ...inEngine_Splatmap_Lightmap-AddPass-out.txt | 33 +- ...inEngine_Splatmap_Lightmap-AddPass1-ir.txt | 188 - ...nEngine_Splatmap_Lightmap-AddPass1-out.txt | 32 +- ...nEngine_Splatmap_Lightmap-FirstPass-ir.txt | 188 - ...Engine_Splatmap_Lightmap-FirstPass-out.txt | 32 +- ...Engine_Splatmap_Lightmap-FirstPass1-ir.txt | 333 - ...ngine_Splatmap_Lightmap-FirstPass1-out.txt | 32 +- ...n-Hidden_Tree_Bark_Shader_Rendertex-ir.txt | 54 - ...-Hidden_Tree_Bark_Shader_Rendertex-out.txt | 6 +- ...n-Hidden_Tree_Leaf_Shader_Rendertex-ir.txt | 65 - ...-Hidden_Tree_Leaf_Shader_Rendertex-out.txt | 8 +- ...n-Hidden_Tree_Optimized_Bark_Shader-ir.txt | 245 - ...-Hidden_Tree_Optimized_Bark_Shader-out.txt | 21 +- ...-Hidden_Tree_Optimized_Bark_Shader1-ir.txt | 122 - ...Hidden_Tree_Optimized_Bark_Shader1-out.txt | 9 +- ...n-Hidden_Tree_Optimized_Leaf_Shader-ir.txt | 361 - ...-Hidden_Tree_Optimized_Leaf_Shader-out.txt | 56 +- ...-Hidden_Tree_Optimized_Leaf_Shader1-ir.txt | 384 - ...Hidden_Tree_Optimized_Leaf_Shader1-out.txt | 58 +- .../zun-Hidden_Twirt_Effect_Shader-ir.txt | 91 - .../zun-Hidden_Twirt_Effect_Shader-out.txt | 23 +- .../fragment/zun-Hidden_Twist_Effect-ir.txt | 287 - .../fragment/zun-Hidden_Twist_Effect-out.txt | 32 +- ..._Shaders_Lightmapped_Bumped_Diffuse-ir.txt | 185 - ...Shaders_Lightmapped_Bumped_Diffuse-out.txt | 12 +- ...Shaders_Lightmapped_Bumped_Diffuse2-ir.txt | 178 - ...haders_Lightmapped_Bumped_Diffuse2-out.txt | 42 +- ...-Legacy_Shaders_Lightmapped_Diffuse-ir.txt | 198 - ...Legacy_Shaders_Lightmapped_Diffuse-out.txt | 12 +- .../fragment/zun-MobileBumpSpec-inES3.txt | 86 + .../fragment/zun-MobileBumpSpec-irES.txt | 189 - .../fragment/zun-MobileBumpSpec-outES.txt | 17 +- .../fragment/zun-MobileBumpSpec-outES3.txt | 48 + .../zun-MobileBumpSpec-outES3Metal.txt | 57 + ...zun-Nature_My_Soft_Occlusion_Leaves-ir.txt | 44 - ...un-Nature_My_Soft_Occlusion_Leaves-out.txt | 6 +- .../zun-Nature_Soft_Occlusion_Bark-ir.txt | 189 - .../zun-Nature_Soft_Occlusion_Bark-out.txt | 19 +- .../zun-Nature_Soft_Occlusion_Bark1-ir.txt | 155 - .../zun-Nature_Soft_Occlusion_Bark1-out.txt | 18 +- .../zun-Nature_Soft_Occlusion_Bark2-ir.txt | 117 - .../zun-Nature_Soft_Occlusion_Bark2-out.txt | 19 +- .../zun-Nature_Soft_Occlusion_Bark3-ir.txt | 315 - .../zun-Nature_Soft_Occlusion_Bark3-out.txt | 26 +- .../zun-Nature_Soft_Occlusion_Leaves-ir.txt | 183 - .../zun-Nature_Soft_Occlusion_Leaves-out.txt | 30 +- .../zun-Nature_Soft_Occlusion_Leaves1-ir.txt | 147 - .../zun-Nature_Soft_Occlusion_Leaves1-out.txt | 31 +- .../zun-Nature_Soft_Occlusion_Leaves2-ir.txt | 292 - .../zun-Nature_Soft_Occlusion_Leaves2-out.txt | 32 +- .../zun-Nature_Soft_Occlusion_Leaves3-ir.txt | 137 - .../zun-Nature_Soft_Occlusion_Leaves3-out.txt | 23 +- ...un-Nature_Vegetation_Two_Pass_unlit-ir.txt | 60 - ...n-Nature_Vegetation_Two_Pass_unlit-out.txt | 17 +- .../fragment/zun-Parallax_Diffuse-ir.txt | 246 - .../fragment/zun-Parallax_Diffuse-out.txt | 39 +- .../fragment/zun-Parallax_Diffuse1-ir.txt | 217 - .../fragment/zun-Parallax_Diffuse1-out.txt | 42 +- .../fragment/zun-Parallax_Diffuse2-ir.txt | 362 - .../fragment/zun-Parallax_Diffuse2-out.txt | 43 +- .../fragment/zun-Parallax_Specular-ir.txt | 300 - .../fragment/zun-Parallax_Specular-out.txt | 26 +- .../fragment/zun-Particles_Additive-ir.txt | 45 - .../fragment/zun-Particles_Additive-out.txt | 9 +- .../zun-Particles_Additive_(Soft)-ir.txt | 51 - .../zun-Particles_Additive_(Soft)-out.txt | 13 +- ...Particles_Alpha_Blended_Premultiply-ir.txt | 44 - ...articles_Alpha_Blended_Premultiply-out.txt | 7 +- .../fragment/zun-Particles_Multiply-ir.txt | 52 - .../fragment/zun-Particles_Multiply-out.txt | 13 +- .../zun-Particles_Multiply_(Double)-ir.txt | 59 - .../zun-Particles_Multiply_(Double)-out.txt | 7 +- .../zun-Particles__Additive-Multiply-ir.txt | 56 - .../zun-Particles__Additive-Multiply-out.txt | 11 +- .../zun-Reflective_Bumped_Diffuse-ir.txt | 199 - .../zun-Reflective_Bumped_Diffuse-out.txt | 13 +- .../zun-Reflective_Bumped_Diffuse1-ir.txt | 386 - .../zun-Reflective_Bumped_Diffuse1-out.txt | 60 +- .../zun-Reflective_Bumped_Specular-ir.txt | 255 - .../zun-Reflective_Bumped_Specular-out.txt | 25 +- .../zun-Reflective_Bumped_Specular1-ir.txt | 189 - .../zun-Reflective_Bumped_Specular1-out.txt | 8 +- .../zun-Reflective_Bumped_Specular2-ir.txt | 253 - .../zun-Reflective_Bumped_Specular2-out.txt | 64 +- .../zun-Reflective_Bumped_Unlit-ir.txt | 139 - .../zun-Reflective_Bumped_Unlit-out.txt | 17 +- .../fragment/zun-Reflective_Diffuse-ir.txt | 208 - .../fragment/zun-Reflective_Diffuse-out.txt | 13 +- .../fragment/zun-Reflective_Diffuse1-ir.txt | 167 - .../fragment/zun-Reflective_Diffuse1-out.txt | 34 +- .../zun-Reflective_Parallax_Diffuse-ir.txt | 284 - .../zun-Reflective_Parallax_Diffuse-out.txt | 16 +- .../zun-Reflective_Parallax_Diffuse1-ir.txt | 292 - .../zun-Reflective_Parallax_Diffuse1-out.txt | 75 +- .../zun-Reflective_Parallax_Specular-ir.txt | 296 - .../zun-Reflective_Parallax_Specular-out.txt | 27 +- .../zun-Reflective_Parallax_Specular1-ir.txt | 285 - .../zun-Reflective_Parallax_Specular1-out.txt | 27 +- .../fragment/zun-Reflective_Specular-ir.txt | 253 - .../fragment/zun-Reflective_Specular-out.txt | 25 +- .../fragment/zun-Reflective_Specular1-ir.txt | 121 - .../fragment/zun-Reflective_Specular1-out.txt | 6 +- .../fragment/zun-Reflective_Specular2-ir.txt | 179 - .../fragment/zun-Reflective_Specular2-out.txt | 39 +- .../tests/fragment/zun-RenderFX_Skybox-ir.txt | 60 - .../fragment/zun-RenderFX_Skybox-out.txt | 8 +- .../fragment/zun-RenderFX_Skybox_Cubed-ir.txt | 50 - .../zun-RenderFX_Skybox_Cubed-out.txt | 8 +- .../tests/fragment/zun-SSAO24-inES3.txt | 4 +- .../tests/fragment/zun-SSAO24-ir.txt | 309 - .../tests/fragment/zun-SSAO24-irES3.txt | 242 - .../tests/fragment/zun-SSAO24-out.txt | 41 +- .../tests/fragment/zun-SSAO24-outES3.txt | 110 +- .../tests/fragment/zun-SSAO24-outES3Metal.txt | 91 + .../tests/fragment/zun-SSAO8-irES.txt | 355 - .../tests/fragment/zun-SSAO8-outES.txt | 78 +- .../zun-Self-Illumin_Bumped_Diffuse-ir.txt | 221 - .../zun-Self-Illumin_Bumped_Diffuse-out.txt | 20 +- .../zun-Self-Illumin_Bumped_Diffuse1-ir.txt | 170 - .../zun-Self-Illumin_Bumped_Diffuse1-out.txt | 6 +- .../zun-Self-Illumin_Bumped_Diffuse2-ir.txt | 180 - .../zun-Self-Illumin_Bumped_Diffuse2-out.txt | 38 +- .../zun-Self-Illumin_Bumped_Specular-ir.txt | 177 - .../zun-Self-Illumin_Bumped_Specular-out.txt | 8 +- .../zun-Self-Illumin_Bumped_Specular1-ir.txt | 192 - .../zun-Self-Illumin_Bumped_Specular1-out.txt | 43 +- .../fragment/zun-Self-Illumin_Diffuse-ir.txt | 166 - .../fragment/zun-Self-Illumin_Diffuse-out.txt | 18 +- .../fragment/zun-Self-Illumin_Diffuse1-ir.txt | 298 - .../zun-Self-Illumin_Diffuse1-out.txt | 32 +- .../zun-Self-Illumin_Parallax_Diffuse-ir.txt | 271 - .../zun-Self-Illumin_Parallax_Diffuse-out.txt | 38 +- .../zun-Self-Illumin_Parallax_Diffuse1-ir.txt | 237 - ...zun-Self-Illumin_Parallax_Diffuse1-out.txt | 37 +- .../zun-Self-Illumin_Parallax_Diffuse2-ir.txt | 239 - ...zun-Self-Illumin_Parallax_Diffuse2-out.txt | 53 +- .../zun-Self-Illumin_Parallax_Specular-ir.txt | 291 - ...zun-Self-Illumin_Parallax_Specular-out.txt | 51 +- ...zun-Self-Illumin_Parallax_Specular1-ir.txt | 294 - ...un-Self-Illumin_Parallax_Specular1-out.txt | 52 +- .../fragment/zun-Self-Illumin_Specular-ir.txt | 245 - .../zun-Self-Illumin_Specular-out.txt | 33 +- .../zun-Self-Illumin_Specular1-ir.txt | 113 - .../zun-Self-Illumin_Specular1-out.txt | 6 +- .../zun-Self-Illumin_Specular2-ir.txt | 310 - .../zun-Self-Illumin_Specular2-out.txt | 39 +- .../tests/fragment/zun-Specular-ir.txt | 234 - .../tests/fragment/zun-Specular-out.txt | 23 +- .../tests/fragment/zun-Specular1-ir.txt | 102 - .../tests/fragment/zun-Specular1-out.txt | 6 +- .../tests/fragment/zun-Specular2-ir.txt | 293 - .../tests/fragment/zun-Specular2-out.txt | 30 +- .../tests/fragment/zun-Surface_2UV-ir.txt | 188 - .../tests/fragment/zun-Surface_2UV-out.txt | 15 +- .../tests/fragment/zun-Surface_2UV1-ir.txt | 135 - .../tests/fragment/zun-Surface_2UV1-out.txt | 24 +- .../zun-Surface_Colored_Specular-ir.txt | 232 - .../zun-Surface_Colored_Specular-out.txt | 11 +- .../zun-Surface_Colored_Specular1-ir.txt | 98 - .../zun-Surface_Colored_Specular1-out.txt | 4 +- .../fragment/zun-Surface_Custom_Data-ir.txt | 158 - .../fragment/zun-Surface_Custom_Data-out.txt | 9 +- .../fragment/zun-Surface_Custom_Data1-ir.txt | 144 - .../fragment/zun-Surface_Custom_Data1-out.txt | 8 +- .../fragment/zun-Surface_Custom_Data2-ir.txt | 270 - .../fragment/zun-Surface_Custom_Data2-out.txt | 22 +- .../fragment/zun-Surface_DecalAdd-ir.txt | 147 - .../fragment/zun-Surface_DecalAdd-out.txt | 9 +- .../fragment/zun-Surface_DecalAddBump3-ir.txt | 187 - .../zun-Surface_DecalAddBump3-out.txt | 10 +- .../fragment/zun-Surface_DecalAddBump5-ir.txt | 179 - .../zun-Surface_DecalAddBump5-out.txt | 10 +- .../zun-Surface_Diffuse_Wrapped-ir.txt | 149 - .../zun-Surface_Diffuse_Wrapped-out.txt | 9 +- .../tests/fragment/zun-Surface_Rim-ir.txt | 261 - .../tests/fragment/zun-Surface_Rim-out.txt | 8 +- .../tests/fragment/zun-Surface_Rim1-ir.txt | 272 - .../tests/fragment/zun-Surface_Rim1-out.txt | 27 +- .../tests/fragment/zun-Surface_Rim2-ir.txt | 312 - .../tests/fragment/zun-Surface_Rim2-out.txt | 28 +- .../fragment/zun-Surface_Rim_Bump-ir.txt | 321 - .../fragment/zun-Surface_Rim_Bump-out.txt | 11 +- .../fragment/zun-Surface_Rim_Bump1-ir.txt | 301 - .../fragment/zun-Surface_Rim_Bump1-out.txt | 11 +- .../fragment/zun-Surface_ScreenPos-ir.txt | 182 - .../fragment/zun-Surface_ScreenPos-out.txt | 9 +- .../fragment/zun-Surface_ScreenPos1-ir.txt | 162 - .../fragment/zun-Surface_ScreenPos1-out.txt | 9 +- .../fragment/zun-Surface_ScreenPos2-ir.txt | 97 - .../fragment/zun-Surface_ScreenPos2-out.txt | 4 +- .../zun-Surface_ScreenPosAlbedo-ir.txt | 94 - .../zun-Surface_ScreenPosAlbedo-out.txt | 4 +- .../zun-Surface_ScreenPosAlbedo1-ir.txt | 135 - .../zun-Surface_ScreenPosAlbedo1-out.txt | 20 +- .../tests/fragment/zun-Surface_Slices-ir.txt | 203 - .../tests/fragment/zun-Surface_Slices-out.txt | 10 +- .../tests/fragment/zun-Surface_Slices1-ir.txt | 150 - .../fragment/zun-Surface_Slices1-out.txt | 23 +- .../tests/fragment/zun-Surface_Slices2-ir.txt | 295 - .../fragment/zun-Surface_Slices2-out.txt | 23 +- .../tests/fragment/zun-Surface_Slices3-ir.txt | 329 - .../fragment/zun-Surface_Slices3-out.txt | 32 +- .../fragment/zun-Surface_WorldRefl-ir.txt | 138 - .../fragment/zun-Surface_WorldRefl-out.txt | 8 +- .../fragment/zun-Surface_WorldRefl1-ir.txt | 87 - .../fragment/zun-Surface_WorldRefl1-out.txt | 4 +- .../tests/fragment/zun-Test_CgNormals-ir.txt | 35 - .../tests/fragment/zun-Test_CgNormals-out.txt | 4 +- .../fragment/zun-Test_FontShaderCull-ir.txt | 39 - .../fragment/zun-Test_FontShaderCull-out.txt | 8 +- .../zun-Test_VertexShaderDepthTexture-ir.txt | 50 - .../zun-Test_VertexShaderDepthTexture-out.txt | 8 +- .../zun-Test_VertexShaderTexture-ir.txt | 38 - .../zun-Test_VertexShaderTexture-out.txt | 6 +- .../zun-Tests_Blend_Many_Textures-ir.txt | 132 - .../zun-Tests_Blend_Many_Textures-out.txt | 45 +- .../fragment/zun-Tests_Fwd-Def-Vert-ir.txt | 146 - .../fragment/zun-Tests_Fwd-Def-Vert-out.txt | 2 +- .../fragment/zun-Tests_Fwd-Def-Vert1-ir.txt | 84 - .../fragment/zun-Tests_Fwd-Def-Vert1-out.txt | 4 +- .../fragment/zun-TexGen_Cube_Refl-ir.txt | 44 - .../fragment/zun-TexGen_Cube_Refl-out.txt | 6 +- .../tests/fragment/zun-Toon_Basic-ir.txt | 59 - .../tests/fragment/zun-Toon_Basic-out.txt | 17 +- .../tests/fragment/zun-Toon_Lighted-ir.txt | 163 - .../tests/fragment/zun-Toon_Lighted-out.txt | 11 +- .../zun-Transparent_Bumped_Specular-ir.txt | 235 - .../zun-Transparent_Bumped_Specular-out.txt | 38 +- ...n-Transparent_Cutout_Bumped_Diffuse-ir.txt | 178 - ...-Transparent_Cutout_Bumped_Diffuse-out.txt | 27 +- ...-Transparent_Cutout_Bumped_Diffuse1-ir.txt | 174 - ...Transparent_Cutout_Bumped_Diffuse1-out.txt | 42 +- ...-Transparent_Cutout_Bumped_Specular-ir.txt | 180 - ...Transparent_Cutout_Bumped_Specular-out.txt | 11 +- ...Transparent_Cutout_Bumped_Specular1-ir.txt | 186 - ...ransparent_Cutout_Bumped_Specular1-out.txt | 47 +- .../zun-Transparent_Cutout_Diffuse-ir.txt | 200 - .../zun-Transparent_Cutout_Diffuse-out.txt | 28 +- .../zun-Transparent_Cutout_Specular-ir.txt | 202 - .../zun-Transparent_Cutout_Specular-out.txt | 36 +- .../zun-Transparent_Cutout_Specular1-ir.txt | 225 - .../zun-Transparent_Cutout_Specular1-out.txt | 40 +- .../zun-Transparent_Cutout_Specular2-ir.txt | 304 - .../zun-Transparent_Cutout_Specular2-out.txt | 41 +- .../fragment/zun-Transparent_Diffuse-ir.txt | 169 - .../fragment/zun-Transparent_Diffuse-out.txt | 25 +- .../fragment/zun-Transparent_Specular-ir.txt | 200 - .../fragment/zun-Transparent_Specular-out.txt | 36 +- .../fragment/zun-TreeCreatorLeavesRT-ir.txt | 162 - .../fragment/zun-TreeCreatorLeavesRT-out.txt | 36 +- .../zun-Tree_Editor_Bark_Shader-ir.txt | 216 - .../zun-Tree_Editor_Bark_Shader-out.txt | 21 +- .../zun-Tree_Editor_Bark_Shader1-ir.txt | 239 - .../zun-Tree_Editor_Bark_Shader1-out.txt | 23 +- .../zun-Tree_Editor_Leaf_Shader-ir.txt | 383 - .../zun-Tree_Editor_Leaf_Shader-out.txt | 63 +- .../zun-Tree_Editor_Leaf_Shader1-ir.txt | 387 - .../zun-Tree_Editor_Leaf_Shader1-out.txt | 79 +- .../tests/fragment/zun-Vertex_Colored-ir.txt | 55 - .../tests/fragment/zun-Vertex_Colored-out.txt | 7 +- .../fragment/zun-currently_adapted-ir.txt | 92 - .../fragment/zun-currently_adapted-out.txt | 22 +- .../fragment/zunity-MotionBlur-TileMax-ir.txt | 117 - .../zunity-MotionBlur-TileMax-out.txt | 8 +- .../tests/glsl_optimizer_tests.cpp | 215 +- 3rdparty/glsl-optimizer/tests/tests.js | 40 + .../tests/vertex/MF-GodRays-inES3.txt | 162 + .../tests/vertex/MF-GodRays-irES.txt | 555 -- .../tests/vertex/MF-GodRays-outES.txt | 210 +- .../tests/vertex/MF-GodRays-outES3.txt | 169 + .../tests/vertex/MF-GodRays-outES3Metal.txt | 178 + .../tests/vertex/bug-chained-assign-ir.txt | 25 - .../tests/vertex/bug-chained-assign-out.txt | 23 +- .../tests/vertex/bug-loops-for-while-in.txt | 21 + .../tests/vertex/bug-loops-for-while-out.txt | 30 + .../tests/vertex/bug-struct-uniform-ir.txt | 15 - .../tests/vertex/bug-struct-uniform-out.txt | 6 +- .../vertex/bug-swizzle-lhs-cast-inES3.txt | 53 + .../vertex/bug-swizzle-lhs-cast-outES3.txt | 50 + .../bug-swizzle-lhs-cast-outES3Metal.txt | 60 + .../tests/vertex/bug-varying-const-ir.txt | 16 - .../tests/vertex/bug-varying-const-out.txt | 4 +- .../tests/vertex/builtin-vars-inES3.txt | 15 + .../tests/vertex/builtin-vars-outES3.txt | 22 + .../tests/vertex/builtin-vars-outES3Metal.txt | 35 + .../tests/vertex/estest1-ir.txt | 23 - .../tests/vertex/estest1-out.txt | 6 +- .../tests/vertex/glsl140-basic-ir.txt | 18 - .../tests/vertex/glsl140-basic-out.txt | 7 +- .../tests/vertex/glsl140-integers-ir.txt | 48 - .../tests/vertex/glsl140-integers-out.txt | 14 +- .../tests/vertex/inputs-inES3.txt | 36 + .../tests/vertex/inputs-outES3.txt | 29 + .../tests/vertex/inputs-outES3Metal.txt | 43 + .../tests/vertex/loops-for-ir.txt | 151 - .../tests/vertex/loops-for-out.txt | 57 +- .../tests/vertex/loops-for-withvec4-in.txt | 188 + .../tests/vertex/loops-for-withvec4-inES3.txt | 188 + .../tests/vertex/loops-for-withvec4-out.txt | 151 + .../vertex/loops-for-withvec4-outES3.txt | 151 + .../vertex/loops-for-withvec4-outES3Metal.txt | 161 + .../tests/vertex/loops-forsimple-ir.txt | 31 - .../tests/vertex/loops-forsimple-out.txt | 6 +- .../tests/vertex/loops-forvarious-inES3.txt | 74 + .../tests/vertex/loops-forvarious-irES.txt | 164 - .../tests/vertex/loops-forvarious-outES.txt | 86 +- .../tests/vertex/loops-forvarious-outES3.txt | 45 + .../vertex/loops-forvarious-outES3Metal.txt | 55 + .../tests/vertex/loops-forwithcalls-ir.txt | 33 - .../tests/vertex/loops-forwithcalls-out.txt | 6 +- .../tests/vertex/matrix-casts-inES3.txt | 32 + .../tests/vertex/matrix-casts-outES3.txt | 37 + .../tests/vertex/matrix-casts-outES3Metal.txt | 53 + .../tests/vertex/opt-inline-varnames-ir.txt | 55 - .../tests/vertex/opt-inline-varnames-out.txt | 4 +- .../tests/vertex/opt-matrix-constr-ir.txt | 21 - .../tests/vertex/opt-matrix-constr-out.txt | 7 +- .../vertex/opt-matrix-transpose-mul-inES3.txt | 83 + .../vertex/opt-matrix-transpose-mul-irES.txt | 207 - .../vertex/opt-matrix-transpose-mul-outES.txt | 57 +- .../opt-matrix-transpose-mul-outES3.txt | 73 + .../opt-matrix-transpose-mul-outES3Metal.txt | 83 + .../tests/vertex/opt-negsub-ir.txt | 40 - .../tests/vertex/opt-negsub-out.txt | 12 +- .../tests/vertex/opt-normalize-ir.txt | 15 - .../tests/vertex/opt-normalize-out.txt | 4 +- .../tests/vertex/opt-unroll-ir.txt | 98 - .../tests/vertex/opt-unroll-out.txt | 58 +- .../tests/vertex/opt-unusedvars-ir.txt | 15 - .../tests/vertex/opt-unusedvars-out.txt | 7 +- .../tests/vertex/swizzle-casts-inES3.txt | 40 + .../tests/vertex/swizzle-casts-outES3.txt | 24 + .../vertex/swizzle-casts-outES3Metal.txt | 36 + .../tests/vertex/swizzlemask-ir.txt | 20 - .../tests/vertex/swizzlemask-out.txt | 4 +- .../tests/vertex/types-inES3.txt | 47 + .../glsl-optimizer/tests/vertex/types-ir.txt | 92 - .../tests/vertex/types-irES.txt | 97 - .../glsl-optimizer/tests/vertex/types-out.txt | 9 +- .../tests/vertex/types-outES.txt | 13 +- .../tests/vertex/types-outES3.txt | 29 + .../tests/vertex/types-outES3Metal.txt | 39 + .../tests/vertex/uniforms-arrays-inES3.txt | 54 + .../tests/vertex/uniforms-arrays-outES3.txt | 88 + .../vertex/uniforms-arrays-outES3Metal.txt | 98 + .../tests/vertex/z-NichsHybridLight-ir.txt | 587 -- .../tests/vertex/z-NichsHybridLight-out.txt | 151 +- .../tests/vertex/z-alphabumpspec-ir.txt | 301 - .../tests/vertex/z-alphabumpspec-out.txt | 87 +- .../tests/vertex/z-particle-ir.txt | 72 - .../tests/vertex/z-particle-irES.txt | 77 - .../tests/vertex/z-particle-out.txt | 9 +- .../tests/vertex/z-particle-outES.txt | 13 +- .../tests/vertex/z-prepasslight-inES3.txt | 45 + .../tests/vertex/z-prepasslight-ir.txt | 96 - .../tests/vertex/z-prepasslight-irES.txt | 101 - .../tests/vertex/z-prepasslight-out.txt | 31 +- .../tests/vertex/z-prepasslight-outES.txt | 31 +- .../tests/vertex/z-prepasslight-outES3.txt | 38 + .../vertex/z-prepasslight-outES3Metal.txt | 48 + .../tests/vertex/z-treeleaf-inES3.txt | 155 + .../tests/vertex/z-treeleaf-ir.txt | 432 -- .../tests/vertex/z-treeleaf-irES.txt | 437 -- .../tests/vertex/z-treeleaf-out.txt | 189 +- .../tests/vertex/z-treeleaf-outES.txt | 189 +- .../tests/vertex/z-treeleaf-outES3.txt | 157 + .../tests/vertex/z-treeleaf-outES3Metal.txt | 167 + .../tests/vertex/z-unishader-dirlm-ir.txt | 233 - .../tests/vertex/z-unishader-dirlm-out.txt | 47 +- .../tests/vertex/zun-Bumped_Diffuse-ir.txt | 177 - .../tests/vertex/zun-Bumped_Diffuse-out.txt | 21 +- .../tests/vertex/zun-Bumped_Diffuse1-ir.txt | 132 - .../tests/vertex/zun-Bumped_Diffuse1-out.txt | 42 +- .../tests/vertex/zun-Bumped_Specular-ir.txt | 439 -- .../tests/vertex/zun-Bumped_Specular-out.txt | 207 +- .../tests/vertex/zun-Bumped_Specular2-ir.txt | 149 - .../tests/vertex/zun-Bumped_Specular2-out.txt | 54 +- .../tests/vertex/zun-Decal-ir.txt | 164 - .../tests/vertex/zun-Decal-out.txt | 21 +- .../tests/vertex/zun-Diffuse-ir.txt | 172 - .../tests/vertex/zun-Diffuse-out.txt | 29 +- .../tests/vertex/zun-Diffuse2-ir.txt | 149 - .../tests/vertex/zun-Diffuse2-out.txt | 54 +- .../zun-Diffuse_Alpha_Shadowed_ZWrite-ir.txt | 218 - .../zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt | 66 +- .../zun-FX_Glass_Stained_BumpDistort-ir.txt | 106 - .../zun-FX_Glass_Stained_BumpDistort-out.txt | 18 +- .../tests/vertex/zun-FX_Water_(simple)-ir.txt | 120 - .../vertex/zun-FX_Water_(simple)-out.txt | 19 +- .../tests/vertex/zun-Grab_Invert-ir.txt | 53 - .../tests/vertex/zun-Grab_Invert-out.txt | 16 +- ...un-Hidden_Camera-DepthNormalTexture-ir.txt | 177 - ...n-Hidden_Camera-DepthNormalTexture-out.txt | 16 +- ...n-Hidden_Camera-DepthNormalTexture1-ir.txt | 255 - ...-Hidden_Camera-DepthNormalTexture1-out.txt | 62 +- .../zun-Hidden_Camera-DepthTexture-ir.txt | 136 - .../zun-Hidden_Camera-DepthTexture-out.txt | 19 +- .../vertex/zun-Hidden_Glow_Downsample-ir.txt | 130 - .../vertex/zun-Hidden_Glow_Downsample-out.txt | 61 +- .../zun-Hidden_Internal-GUITextureClip-ir.txt | 87 - ...zun-Hidden_Internal-GUITextureClip-out.txt | 11 +- ...zun-Hidden_Internal-PrePassLighting-ir.txt | 93 - ...un-Hidden_Internal-PrePassLighting-out.txt | 37 +- .../vertex/zun-Hidden_Noise_Shader_RGB-ir.txt | 97 - .../zun-Hidden_Noise_Shader_RGB-out.txt | 10 +- ...-Hidden_TerrainEngine_BillboardTree-ir.txt | 156 - ...Hidden_TerrainEngine_BillboardTree-out.txt | 66 +- ...e_Details_BillboardWavingDoublePass-ir.txt | 533 -- ..._Details_BillboardWavingDoublePass-out.txt | 252 +- ..._Details_BillboardWavingDoublePass1-ir.txt | 381 - ...Details_BillboardWavingDoublePass1-out.txt | 121 +- ..._Details_BillboardWavingDoublePass2-ir.txt | 298 - ...Details_BillboardWavingDoublePass2-out.txt | 83 +- ...ainEngine_Details_WavingDoublePass1-ir.txt | 352 - ...inEngine_Details_WavingDoublePass1-out.txt | 107 +- ...ngine_Soft_Occlusion_Bark_rendertex-ir.txt | 227 - ...gine_Soft_Occlusion_Bark_rendertex-out.txt | 62 +- ...ine_Soft_Occlusion_Leaves_rendertex-ir.txt | 227 - ...ne_Soft_Occlusion_Leaves_rendertex-out.txt | 62 +- ...ainEngine_Splatmap_Lightmap-AddPass-ir.txt | 384 - ...inEngine_Splatmap_Lightmap-AddPass-out.txt | 186 +- ...Engine_Splatmap_Lightmap-FirstPass1-ir.txt | 177 - ...ngine_Splatmap_Lightmap-FirstPass1-out.txt | 60 +- ...n-Hidden_Tree_Bark_Shader_Rendertex-ir.txt | 126 - ...-Hidden_Tree_Bark_Shader_Rendertex-out.txt | 12 +- ...n-Hidden_Tree_Leaf_Shader_Rendertex-ir.txt | 185 - ...-Hidden_Tree_Leaf_Shader_Rendertex-out.txt | 22 +- ...n-Hidden_Tree_Optimized_Bark_Shader-ir.txt | 399 -- ...-Hidden_Tree_Optimized_Bark_Shader-out.txt | 183 +- ...-Hidden_Tree_Optimized_Bark_Shader1-ir.txt | 266 - ...Hidden_Tree_Optimized_Bark_Shader1-out.txt | 77 +- ...n-Hidden_Tree_Optimized_Leaf_Shader-ir.txt | 447 -- ...-Hidden_Tree_Optimized_Leaf_Shader-out.txt | 207 +- ...-Hidden_Tree_Optimized_Leaf_Shader1-ir.txt | 458 -- ...Hidden_Tree_Optimized_Leaf_Shader1-out.txt | 216 +- .../vertex/zun-Hidden_Twist_Effect-ir.txt | 90 - .../vertex/zun-Hidden_Twist_Effect-out.txt | 17 +- ..._Shaders_Lightmapped_Bumped_Diffuse-ir.txt | 178 - ...Shaders_Lightmapped_Bumped_Diffuse-out.txt | 39 +- .../zun-Nature_Soft_Occlusion_Bark-ir.txt | 251 - .../zun-Nature_Soft_Occlusion_Bark-out.txt | 26 +- .../zun-Nature_Soft_Occlusion_Bark2-ir.txt | 161 - .../zun-Nature_Soft_Occlusion_Bark2-out.txt | 13 +- .../zun-Nature_Soft_Occlusion_Bark3-ir.txt | 216 - .../zun-Nature_Soft_Occlusion_Bark3-out.txt | 72 +- .../zun-Nature_Soft_Occlusion_Leaves1-ir.txt | 212 - .../zun-Nature_Soft_Occlusion_Leaves1-out.txt | 47 +- .../zun-Nature_Soft_Occlusion_Leaves3-ir.txt | 172 - .../zun-Nature_Soft_Occlusion_Leaves3-out.txt | 15 +- .../tests/vertex/zun-Parallax_Diffuse-ir.txt | 439 -- .../tests/vertex/zun-Parallax_Diffuse-out.txt | 207 +- .../tests/vertex/zun-Parallax_Diffuse1-ir.txt | 202 - .../vertex/zun-Parallax_Diffuse1-out.txt | 86 +- .../tests/vertex/zun-Parallax_Diffuse2-ir.txt | 219 - .../vertex/zun-Parallax_Diffuse2-out.txt | 104 +- .../tests/vertex/zun-Particles_Blend-ir.txt | 70 - .../tests/vertex/zun-Particles_Blend-out.txt | 9 +- .../zun-Reflective_Bumped_Diffuse-ir.txt | 178 - .../zun-Reflective_Bumped_Diffuse-out.txt | 39 +- .../zun-Reflective_Bumped_Diffuse1-ir.txt | 279 - .../zun-Reflective_Bumped_Diffuse1-out.txt | 103 +- .../zun-Reflective_Bumped_Specular-ir.txt | 206 - .../zun-Reflective_Bumped_Specular-out.txt | 41 +- .../zun-Reflective_Bumped_Specular1-ir.txt | 177 - .../zun-Reflective_Bumped_Specular1-out.txt | 21 +- .../zun-Reflective_Bumped_Specular2-ir.txt | 262 - .../zun-Reflective_Bumped_Specular2-out.txt | 85 +- .../vertex/zun-Reflective_Bumped_Unlit-ir.txt | 189 - .../zun-Reflective_Bumped_Unlit-out.txt | 32 +- .../vertex/zun-Reflective_Diffuse-ir.txt | 171 - .../vertex/zun-Reflective_Diffuse-out.txt | 29 +- .../vertex/zun-Reflective_Diffuse1-ir.txt | 197 - .../vertex/zun-Reflective_Diffuse1-out.txt | 65 +- .../zun-Reflective_Parallax_Diffuse-ir.txt | 205 - .../zun-Reflective_Parallax_Diffuse-out.txt | 41 +- .../zun-Reflective_Parallax_Diffuse1-ir.txt | 274 - .../zun-Reflective_Parallax_Diffuse1-out.txt | 97 +- .../zun-Reflective_Parallax_Specular-ir.txt | 206 - .../zun-Reflective_Parallax_Specular-out.txt | 41 +- .../zun-Reflective_Parallax_Specular1-ir.txt | 206 - .../zun-Reflective_Parallax_Specular1-out.txt | 41 +- .../vertex/zun-Reflective_Specular-ir.txt | 191 - .../vertex/zun-Reflective_Specular-out.txt | 32 +- .../vertex/zun-Reflective_Specular1-ir.txt | 104 - .../vertex/zun-Reflective_Specular1-out.txt | 8 +- .../vertex/zun-Reflective_Specular2-ir.txt | 197 - .../vertex/zun-Reflective_Specular2-out.txt | 65 +- .../vertex/zun-RenderFX_Skybox_Cubed-ir.txt | 54 - .../vertex/zun-RenderFX_Skybox_Cubed-out.txt | 7 +- .../zun-Self-Illumin_Bumped_Diffuse-ir.txt | 178 - .../zun-Self-Illumin_Bumped_Diffuse-out.txt | 40 +- .../zun-Self-Illumin_Bumped_Specular1-ir.txt | 135 - .../zun-Self-Illumin_Bumped_Specular1-out.txt | 37 +- .../vertex/zun-Self-Illumin_Diffuse1-ir.txt | 152 - .../vertex/zun-Self-Illumin_Diffuse1-out.txt | 49 +- .../zun-Self-Illumin_Parallax_Diffuse-ir.txt | 205 - .../zun-Self-Illumin_Parallax_Diffuse-out.txt | 41 +- ...zun-Self-Illumin_Parallax_Specular1-ir.txt | 206 - ...un-Self-Illumin_Parallax_Specular1-out.txt | 41 +- .../vertex/zun-Self-Illumin_Specular1-ir.txt | 104 - .../vertex/zun-Self-Illumin_Specular1-out.txt | 8 +- .../tests/vertex/zun-ShowDestAlpha-ir.txt | 38 - .../tests/vertex/zun-ShowDestAlpha-out.txt | 6 +- .../tests/vertex/zun-Specular-ir.txt | 191 - .../tests/vertex/zun-Specular-out.txt | 32 +- .../tests/vertex/zun-Specular1-ir.txt | 104 - .../tests/vertex/zun-Specular1-out.txt | 8 +- .../tests/vertex/zun-Specular2-ir.txt | 149 - .../tests/vertex/zun-Specular2-out.txt | 54 +- .../tests/vertex/zun-Surface_2UV-ir.txt | 174 - .../tests/vertex/zun-Surface_2UV-out.txt | 31 +- .../tests/vertex/zun-Surface_2UV1-ir.txt | 135 - .../tests/vertex/zun-Surface_2UV1-out.txt | 38 +- .../zun-Surface_Colored_Specular-ir.txt | 194 - .../zun-Surface_Colored_Specular-out.txt | 33 +- .../zun-Surface_Colored_Specular1-ir.txt | 104 - .../zun-Surface_Colored_Specular1-out.txt | 8 +- .../vertex/zun-Surface_Custom_Data-ir.txt | 186 - .../vertex/zun-Surface_Custom_Data-out.txt | 27 +- .../vertex/zun-Surface_Custom_Data1-ir.txt | 186 - .../vertex/zun-Surface_Custom_Data1-out.txt | 19 +- .../vertex/zun-Surface_Custom_Data2-ir.txt | 163 - .../vertex/zun-Surface_Custom_Data2-out.txt | 51 +- .../vertex/zun-Surface_DecalAddBump-ir.txt | 161 - .../vertex/zun-Surface_DecalAddBump-out.txt | 20 +- .../vertex/zun-Surface_DecalAddBump1-ir.txt | 132 - .../vertex/zun-Surface_DecalAddBump1-out.txt | 42 +- .../vertex/zun-Surface_DecalAddBump2-ir.txt | 183 - .../vertex/zun-Surface_DecalAddBump2-out.txt | 19 +- .../vertex/zun-Surface_DecalAddBump3-ir.txt | 306 - .../vertex/zun-Surface_DecalAddBump3-out.txt | 114 +- .../vertex/zun-Surface_Diffuse_Wrapped-ir.txt | 172 - .../zun-Surface_Diffuse_Wrapped-out.txt | 21 +- .../tests/vertex/zun-Surface_Rim-ir.txt | 161 - .../tests/vertex/zun-Surface_Rim-out.txt | 20 +- .../tests/vertex/zun-Surface_Rim1-ir.txt | 209 - .../tests/vertex/zun-Surface_Rim1-out.txt | 91 +- .../tests/vertex/zun-Surface_Rim2-ir.txt | 226 - .../tests/vertex/zun-Surface_Rim2-out.txt | 105 +- .../tests/vertex/zun-Surface_Rim_Bump-ir.txt | 175 - .../tests/vertex/zun-Surface_Rim_Bump-out.txt | 33 +- .../tests/vertex/zun-Surface_Rim_Bump1-ir.txt | 176 - .../vertex/zun-Surface_Rim_Bump1-out.txt | 33 +- .../tests/vertex/zun-Surface_ScreenPos-ir.txt | 160 - .../vertex/zun-Surface_ScreenPos-out.txt | 27 +- .../vertex/zun-Surface_ScreenPos1-ir.txt | 161 - .../vertex/zun-Surface_ScreenPos1-out.txt | 27 +- .../vertex/zun-Surface_ScreenPos2-ir.txt | 104 - .../vertex/zun-Surface_ScreenPos2-out.txt | 8 +- .../vertex/zun-Surface_ScreenPosAlbedo-ir.txt | 104 - .../zun-Surface_ScreenPosAlbedo-out.txt | 8 +- .../zun-Surface_ScreenPosAlbedo1-ir.txt | 132 - .../zun-Surface_ScreenPosAlbedo1-out.txt | 49 +- .../tests/vertex/zun-Surface_Slices-ir.txt | 181 - .../tests/vertex/zun-Surface_Slices-out.txt | 31 +- .../tests/vertex/zun-Surface_Slices1-ir.txt | 143 - .../tests/vertex/zun-Surface_Slices1-out.txt | 49 +- .../tests/vertex/zun-Surface_Slices2-ir.txt | 160 - .../tests/vertex/zun-Surface_Slices2-out.txt | 59 +- .../tests/vertex/zun-Surface_Slices3-ir.txt | 146 - .../tests/vertex/zun-Surface_Slices3-out.txt | 39 +- .../tests/vertex/zun-Surface_WorldRefl-ir.txt | 190 - .../vertex/zun-Surface_WorldRefl-out.txt | 34 +- .../vertex/zun-Surface_WorldRefl1-ir.txt | 104 - .../vertex/zun-Surface_WorldRefl1-out.txt | 8 +- .../tests/vertex/zun-Test_CgNormals-ir.txt | 91 - .../tests/vertex/zun-Test_CgNormals-out.txt | 8 +- .../zun-Test_VertexShaderDepthTexture-ir.txt | 83 - .../zun-Test_VertexShaderDepthTexture-out.txt | 9 +- .../zun-Test_VertexShaderTexture-ir.txt | 83 - .../zun-Test_VertexShaderTexture-out.txt | 9 +- .../tests/vertex/zun-TexGen_Cube_Refl-ir.txt | 104 - .../tests/vertex/zun-TexGen_Cube_Refl-out.txt | 28 +- .../tests/vertex/zun-Toon_Basic-ir.txt | 76 - .../tests/vertex/zun-Toon_Basic-out.txt | 10 +- .../zun-Transparent_Bumped_Specular-ir.txt | 206 - .../zun-Transparent_Bumped_Specular-out.txt | 41 +- ...n-Transparent_Cutout_Bumped_Diffuse-ir.txt | 166 - ...-Transparent_Cutout_Bumped_Diffuse-out.txt | 37 +- ...-Transparent_Cutout_Bumped_Diffuse1-ir.txt | 132 - ...Transparent_Cutout_Bumped_Diffuse1-out.txt | 42 +- ...-Transparent_Cutout_Bumped_Specular-ir.txt | 180 - ...Transparent_Cutout_Bumped_Specular-out.txt | 30 +- ...Transparent_Cutout_Bumped_Specular1-ir.txt | 132 - ...ransparent_Cutout_Bumped_Specular1-out.txt | 42 +- .../zun-Transparent_Cutout_Diffuse-ir.txt | 171 - .../zun-Transparent_Cutout_Diffuse-out.txt | 29 +- .../zun-Transparent_Cutout_Specular-ir.txt | 181 - .../zun-Transparent_Cutout_Specular-out.txt | 21 +- .../vertex/zun-Transparent_Specular-ir.txt | 192 - .../vertex/zun-Transparent_Specular-out.txt | 52 +- .../vertex/zun-TreeCreatorLeavesRT-ir.txt | 276 - .../vertex/zun-TreeCreatorLeavesRT-out.txt | 173 +- .../vertex/zun-Tree_Editor_Bark_Shader-ir.txt | 388 - .../zun-Tree_Editor_Bark_Shader-out.txt | 174 +- .../zun-Tree_Editor_Bark_Shader1-ir.txt | 399 -- .../zun-Tree_Editor_Bark_Shader1-out.txt | 183 +- .../vertex/zun-Tree_Editor_Leaf_Shader-ir.txt | 458 -- .../zun-Tree_Editor_Leaf_Shader-out.txt | 216 +- .../zun-Tree_Editor_Leaf_Shader1-ir.txt | 402 -- .../zun-Tree_Editor_Leaf_Shader1-out.txt | 167 +- .../tests/vertex/zun-Vertex_Colored-ir.txt | 106 - .../tests/vertex/zun-Vertex_Colored-out.txt | 18 +- examples/02-metaballs/fs_metaballs.bin.h | 53 +- examples/02-metaballs/vs_metaballs.bin.h | 51 +- examples/17-drawstress/fs_drawstress.bin.h | 14 +- examples/17-drawstress/vs_drawstress.bin.h | 40 +- examples/common/font/fs_font_basic.bin.h | 70 +- .../common/font/fs_font_distance_field.bin.h | 128 +- .../fs_font_distance_field_subpixel.bin.h | 150 +- examples/common/font/vs_font_basic.bin.h | 53 +- .../common/font/vs_font_distance_field.bin.h | 53 +- .../vs_font_distance_field_subpixel.bin.h | 53 +- examples/common/imgui/fs_imgui_color.bin.h | 14 +- examples/common/imgui/fs_imgui_cubemap.bin.h | 34 +- examples/common/imgui/fs_imgui_image.bin.h | 38 +- .../common/imgui/fs_imgui_image_swizz.bin.h | 44 +- examples/common/imgui/fs_imgui_texture.bin.h | 38 +- examples/common/imgui/vs_imgui_color.bin.h | 42 +- examples/common/imgui/vs_imgui_cubemap.bin.h | 43 +- examples/common/imgui/vs_imgui_image.bin.h | 43 +- examples/common/imgui/vs_imgui_texture.bin.h | 55 +- examples/common/nanovg/fs_nanovg_fill.bin.h | 347 +- examples/common/nanovg/vs_nanovg_fill.bin.h | 67 +- examples/runtime/shaders/gles/fs_bump.bin | Bin 4681 -> 4780 bytes examples/runtime/shaders/gles/fs_callback.bin | Bin 501 -> 491 bytes examples/runtime/shaders/gles/fs_cubes.bin | Bin 91 -> 89 bytes .../shaders/gles/fs_deferred_combine.bin | Bin 722 -> 720 bytes .../shaders/gles/fs_deferred_debug.bin | Bin 213 -> 211 bytes .../shaders/gles/fs_deferred_debug_line.bin | Bin 91 -> 89 bytes .../runtime/shaders/gles/fs_deferred_geom.bin | Bin 1017 -> 1005 bytes .../shaders/gles/fs_deferred_light.bin | Bin 1863 -> 1855 bytes examples/runtime/shaders/gles/fs_hdr_blur.bin | Bin 854 -> 950 bytes .../runtime/shaders/gles/fs_hdr_bright.bin | Bin 2269 -> 2376 bytes examples/runtime/shaders/gles/fs_hdr_lum.bin | Bin 2322 -> 2288 bytes .../runtime/shaders/gles/fs_hdr_lumavg.bin | Bin 3137 -> 3230 bytes examples/runtime/shaders/gles/fs_hdr_mesh.bin | Bin 1747 -> 1726 bytes .../runtime/shaders/gles/fs_hdr_skybox.bin | Bin 655 -> 652 bytes .../runtime/shaders/gles/fs_hdr_tonemap.bin | Bin 2420 -> 2631 bytes examples/runtime/shaders/gles/fs_ibl_mesh.bin | Bin 2023 -> 2000 bytes .../runtime/shaders/gles/fs_ibl_skybox.bin | Bin 549 -> 546 bytes .../runtime/shaders/gles/fs_instancing.bin | Bin 91 -> 89 bytes examples/runtime/shaders/gles/fs_mesh.bin | Bin 1434 -> 1410 bytes examples/runtime/shaders/gles/fs_oit.bin | Bin 103 -> 101 bytes examples/runtime/shaders/gles/fs_oit_wb.bin | Bin 379 -> 373 bytes .../runtime/shaders/gles/fs_oit_wb_blit.bin | Bin 413 -> 411 bytes .../shaders/gles/fs_oit_wb_separate.bin | Bin 326 -> 320 bytes .../shaders/gles/fs_oit_wb_separate_blit.bin | Bin 413 -> 411 bytes .../runtime/shaders/gles/fs_raymarching.bin | Bin 12772 -> 12579 bytes .../fs_shadowmaps_color_lightning_esm.bin | Bin 4257 -> 4196 bytes .../fs_shadowmaps_color_lightning_esm_csm.bin | Bin 10290 -> 10199 bytes ..._shadowmaps_color_lightning_esm_linear.bin | Bin 4301 -> 4240 bytes ...dowmaps_color_lightning_esm_linear_csm.bin | Bin 10510 -> 10419 bytes ...owmaps_color_lightning_esm_linear_omni.bin | Bin 7643 -> 7554 bytes ...fs_shadowmaps_color_lightning_esm_omni.bin | Bin 7597 -> 7508 bytes .../fs_shadowmaps_color_lightning_hard.bin | Bin 4127 -> 4068 bytes ...fs_shadowmaps_color_lightning_hard_csm.bin | Bin 9738 -> 9655 bytes ...shadowmaps_color_lightning_hard_linear.bin | Bin 4159 -> 4100 bytes ...owmaps_color_lightning_hard_linear_csm.bin | Bin 9874 -> 9791 bytes ...wmaps_color_lightning_hard_linear_omni.bin | Bin 7502 -> 7415 bytes ...s_shadowmaps_color_lightning_hard_omni.bin | Bin 7468 -> 7381 bytes .../fs_shadowmaps_color_lightning_pcf.bin | Bin 15900 -> 15689 bytes .../fs_shadowmaps_color_lightning_pcf_csm.bin | Bin 64042 -> 63329 bytes ..._shadowmaps_color_lightning_pcf_linear.bin | Bin 15953 -> 15740 bytes ...dowmaps_color_lightning_pcf_linear_csm.bin | Bin 64496 -> 63775 bytes ...owmaps_color_lightning_pcf_linear_omni.bin | Bin 19506 -> 19265 bytes ...fs_shadowmaps_color_lightning_pcf_omni.bin | Bin 19449 -> 19210 bytes .../fs_shadowmaps_color_lightning_vsm.bin | Bin 4681 -> 4620 bytes .../fs_shadowmaps_color_lightning_vsm_csm.bin | Bin 12228 -> 12137 bytes ..._shadowmaps_color_lightning_vsm_linear.bin | Bin 4725 -> 4664 bytes ...dowmaps_color_lightning_vsm_linear_csm.bin | Bin 12448 -> 12357 bytes ...owmaps_color_lightning_vsm_linear_omni.bin | Bin 8069 -> 7980 bytes ...fs_shadowmaps_color_lightning_vsm_omni.bin | Bin 8023 -> 7934 bytes .../gles/fs_shadowmaps_color_texture.bin | Bin 640 -> 636 bytes .../shaders/gles/fs_shadowmaps_hblur.bin | Bin 1597 -> 1670 bytes .../shaders/gles/fs_shadowmaps_hblur_vsm.bin | Bin 2845 -> 2648 bytes .../shaders/gles/fs_shadowmaps_packdepth.bin | Bin 305 -> 301 bytes .../gles/fs_shadowmaps_packdepth_linear.bin | Bin 257 -> 253 bytes .../gles/fs_shadowmaps_packdepth_vsm.bin | Bin 505 -> 495 bytes .../fs_shadowmaps_packdepth_vsm_linear.bin | Bin 414 -> 406 bytes .../shaders/gles/fs_shadowmaps_texture.bin | Bin 213 -> 211 bytes .../gles/fs_shadowmaps_unpackdepth.bin | Bin 375 -> 371 bytes .../gles/fs_shadowmaps_unpackdepth_vsm.bin | Bin 350 -> 346 bytes .../shaders/gles/fs_shadowmaps_vblur.bin | Bin 1597 -> 1670 bytes .../shaders/gles/fs_shadowmaps_vblur_vsm.bin | Bin 2845 -> 2648 bytes .../gles/fs_shadowvolume_color_lightning.bin | Bin 2365 -> 2311 bytes .../gles/fs_shadowvolume_color_texture.bin | Bin 640 -> 636 bytes .../gles/fs_shadowvolume_svbackcolor.bin | Bin 136 -> 134 bytes .../gles/fs_shadowvolume_svbacktex1.bin | Bin 443 -> 439 bytes .../gles/fs_shadowvolume_svbacktex2.bin | Bin 443 -> 439 bytes .../gles/fs_shadowvolume_svfrontcolor.bin | Bin 136 -> 134 bytes .../gles/fs_shadowvolume_svfronttex1.bin | Bin 440 -> 436 bytes .../gles/fs_shadowvolume_svfronttex2.bin | Bin 440 -> 436 bytes .../shaders/gles/fs_shadowvolume_svside.bin | Bin 472 -> 466 bytes .../gles/fs_shadowvolume_svsidecolor.bin | Bin 136 -> 134 bytes .../gles/fs_shadowvolume_svsidetex.bin | Bin 576 -> 568 bytes .../shaders/gles/fs_shadowvolume_texture.bin | Bin 213 -> 211 bytes .../fs_shadowvolume_texture_lightning.bin | Bin 2594 -> 2542 bytes examples/runtime/shaders/gles/fs_sms_mesh.bin | Bin 8184 -> 8391 bytes .../runtime/shaders/gles/fs_sms_mesh_pd.bin | Bin 8277 -> 8612 bytes .../runtime/shaders/gles/fs_sms_shadow_pd.bin | Bin 305 -> 301 bytes .../gles/fs_stencil_color_lightning.bin | Bin 2228 -> 2144 bytes .../shaders/gles/fs_stencil_color_texture.bin | Bin 640 -> 636 bytes .../shaders/gles/fs_stencil_texture.bin | Bin 213 -> 211 bytes .../gles/fs_stencil_texture_lightning.bin | Bin 2552 -> 2466 bytes examples/runtime/shaders/gles/fs_tree.bin | Bin 1270 -> 1252 bytes examples/runtime/shaders/gles/fs_update.bin | Bin 214 -> 217 bytes .../runtime/shaders/gles/fs_update_cmp.bin | Bin 232 -> 230 bytes examples/runtime/shaders/gles/vs_bump.bin | Bin 1793 -> 1743 bytes .../shaders/gles/vs_bump_instanced.bin | Bin 1996 -> 1936 bytes examples/runtime/shaders/gles/vs_callback.bin | Bin 520 -> 506 bytes examples/runtime/shaders/gles/vs_cubes.bin | Bin 335 -> 325 bytes .../shaders/gles/vs_deferred_combine.bin | Bin 347 -> 337 bytes .../shaders/gles/vs_deferred_debug.bin | Bin 347 -> 337 bytes .../shaders/gles/vs_deferred_debug_line.bin | Bin 335 -> 325 bytes .../runtime/shaders/gles/vs_deferred_geom.bin | Bin 1793 -> 1743 bytes .../shaders/gles/vs_deferred_light.bin | Bin 347 -> 337 bytes examples/runtime/shaders/gles/vs_hdr_blur.bin | Bin 1483 -> 1485 bytes .../runtime/shaders/gles/vs_hdr_bright.bin | Bin 347 -> 337 bytes examples/runtime/shaders/gles/vs_hdr_lum.bin | Bin 347 -> 337 bytes .../runtime/shaders/gles/vs_hdr_lumavg.bin | Bin 347 -> 337 bytes examples/runtime/shaders/gles/vs_hdr_mesh.bin | Bin 737 -> 674 bytes .../runtime/shaders/gles/vs_hdr_skybox.bin | Bin 347 -> 337 bytes .../runtime/shaders/gles/vs_hdr_tonemap.bin | Bin 1433 -> 1403 bytes examples/runtime/shaders/gles/vs_ibl_mesh.bin | Bin 695 -> 677 bytes .../runtime/shaders/gles/vs_ibl_skybox.bin | Bin 488 -> 474 bytes .../runtime/shaders/gles/vs_instancing.bin | Bin 624 -> 602 bytes examples/runtime/shaders/gles/vs_mesh.bin | Bin 1575 -> 1488 bytes examples/runtime/shaders/gles/vs_oit.bin | Bin 663 -> 604 bytes examples/runtime/shaders/gles/vs_oit_blit.bin | Bin 347 -> 337 bytes .../runtime/shaders/gles/vs_raymarching.bin | Bin 434 -> 420 bytes .../shaders/gles/vs_shadowmaps_color.bin | Bin 248 -> 242 bytes .../gles/vs_shadowmaps_color_lightning.bin | Bin 986 -> 958 bytes .../vs_shadowmaps_color_lightning_csm.bin | Bin 1622 -> 1578 bytes .../vs_shadowmaps_color_lightning_linear.bin | Bin 1082 -> 1003 bytes ..._shadowmaps_color_lightning_linear_csm.bin | Bin 2002 -> 1742 bytes ...shadowmaps_color_lightning_linear_omni.bin | Bin 1968 -> 1668 bytes .../vs_shadowmaps_color_lightning_omni.bin | Bin 1588 -> 1504 bytes .../gles/vs_shadowmaps_color_texture.bin | Bin 347 -> 337 bytes .../shaders/gles/vs_shadowmaps_depth.bin | Bin 248 -> 242 bytes .../shaders/gles/vs_shadowmaps_hblur.bin | Bin 1516 -> 1484 bytes .../shaders/gles/vs_shadowmaps_packdepth.bin | Bin 352 -> 301 bytes .../gles/vs_shadowmaps_packdepth_linear.bin | Bin 365 -> 314 bytes .../shaders/gles/vs_shadowmaps_texture.bin | Bin 347 -> 337 bytes .../gles/vs_shadowmaps_texture_lightning.bin | Bin 742 -> 720 bytes .../gles/vs_shadowmaps_unpackdepth.bin | Bin 347 -> 337 bytes .../shaders/gles/vs_shadowmaps_vblur.bin | Bin 1516 -> 1484 bytes .../gles/vs_shadowvolume_color_lightning.bin | Bin 643 -> 625 bytes .../gles/vs_shadowvolume_color_texture.bin | Bin 347 -> 337 bytes .../shaders/gles/vs_shadowvolume_svback.bin | Bin 452 -> 444 bytes .../shaders/gles/vs_shadowvolume_svfront.bin | Bin 248 -> 242 bytes .../shaders/gles/vs_shadowvolume_svside.bin | Bin 642 -> 628 bytes .../shaders/gles/vs_shadowvolume_texture.bin | Bin 347 -> 337 bytes .../vs_shadowvolume_texture_lightning.bin | Bin 742 -> 720 bytes examples/runtime/shaders/gles/vs_sms_mesh.bin | Bin 932 -> 906 bytes .../runtime/shaders/gles/vs_sms_shadow.bin | Bin 248 -> 242 bytes .../runtime/shaders/gles/vs_sms_shadow_pd.bin | Bin 352 -> 301 bytes .../runtime/shaders/gles/vs_stencil_color.bin | Bin 248 -> 242 bytes .../gles/vs_stencil_color_lightning.bin | Bin 643 -> 625 bytes .../shaders/gles/vs_stencil_color_texture.bin | Bin 347 -> 337 bytes .../shaders/gles/vs_stencil_texture.bin | Bin 347 -> 337 bytes .../gles/vs_stencil_texture_lightning.bin | Bin 742 -> 720 bytes examples/runtime/shaders/gles/vs_tree.bin | Bin 851 -> 787 bytes examples/runtime/shaders/gles/vs_update.bin | Bin 347 -> 337 bytes examples/runtime/shaders/glsl/fs_bump.bin | Bin 4368 -> 4462 bytes examples/runtime/shaders/glsl/fs_hdr_blur.bin | Bin 769 -> 915 bytes .../runtime/shaders/glsl/fs_hdr_bright.bin | Bin 2193 -> 2299 bytes examples/runtime/shaders/glsl/fs_hdr_lum.bin | Bin 2254 -> 2222 bytes .../runtime/shaders/glsl/fs_hdr_lumavg.bin | Bin 3034 -> 3124 bytes .../runtime/shaders/glsl/fs_hdr_tonemap.bin | Bin 2317 -> 2530 bytes .../runtime/shaders/glsl/fs_ibl_skybox.bin | Bin 515 -> 511 bytes .../runtime/shaders/glsl/fs_raymarching.bin | Bin 11902 -> 11925 bytes .../fs_shadowmaps_color_lightning_esm.bin | Bin 3962 -> 3959 bytes .../fs_shadowmaps_color_lightning_esm_csm.bin | Bin 9820 -> 9817 bytes ..._shadowmaps_color_lightning_esm_linear.bin | Bin 4006 -> 4003 bytes ...dowmaps_color_lightning_esm_linear_csm.bin | Bin 10040 -> 10037 bytes ...owmaps_color_lightning_esm_linear_omni.bin | Bin 7201 -> 7198 bytes ...fs_shadowmaps_color_lightning_esm_omni.bin | Bin 7155 -> 7152 bytes .../fs_shadowmaps_color_lightning_hard.bin | Bin 3840 -> 3837 bytes ...fs_shadowmaps_color_lightning_hard_csm.bin | Bin 9300 -> 9297 bytes ...shadowmaps_color_lightning_hard_linear.bin | Bin 3872 -> 3869 bytes ...owmaps_color_lightning_hard_linear_csm.bin | Bin 9436 -> 9433 bytes ...wmaps_color_lightning_hard_linear_omni.bin | Bin 7068 -> 7065 bytes ...s_shadowmaps_color_lightning_hard_omni.bin | Bin 7034 -> 7031 bytes .../fs_shadowmaps_color_lightning_pcf.bin | Bin 15128 -> 15076 bytes .../fs_shadowmaps_color_lightning_pcf_csm.bin | Bin 61717 -> 61490 bytes ..._shadowmaps_color_lightning_pcf_linear.bin | Bin 15173 -> 15121 bytes ...dowmaps_color_lightning_pcf_linear_csm.bin | Bin 62139 -> 61912 bytes ...owmaps_color_lightning_pcf_linear_omni.bin | Bin 18571 -> 18521 bytes ...fs_shadowmaps_color_lightning_pcf_omni.bin | Bin 18522 -> 18472 bytes .../fs_shadowmaps_color_lightning_vsm.bin | Bin 4361 -> 4358 bytes .../fs_shadowmaps_color_lightning_vsm_csm.bin | Bin 11658 -> 11655 bytes ..._shadowmaps_color_lightning_vsm_linear.bin | Bin 4405 -> 4402 bytes ...dowmaps_color_lightning_vsm_linear_csm.bin | Bin 11878 -> 11875 bytes ...owmaps_color_lightning_vsm_linear_omni.bin | Bin 7602 -> 7599 bytes ...fs_shadowmaps_color_lightning_vsm_omni.bin | Bin 7556 -> 7553 bytes .../shaders/glsl/fs_shadowmaps_hblur.bin | Bin 1507 -> 1591 bytes .../shaders/glsl/fs_shadowmaps_hblur_vsm.bin | Bin 2695 -> 2548 bytes .../shaders/glsl/fs_shadowmaps_vblur.bin | Bin 1507 -> 1591 bytes .../shaders/glsl/fs_shadowmaps_vblur_vsm.bin | Bin 2695 -> 2548 bytes .../glsl/fs_shadowvolume_color_lightning.bin | Bin 2094 -> 2082 bytes .../fs_shadowvolume_texture_lightning.bin | Bin 2316 -> 2304 bytes examples/runtime/shaders/glsl/fs_sms_mesh.bin | Bin 7561 -> 7911 bytes .../runtime/shaders/glsl/fs_sms_mesh_pd.bin | Bin 7803 -> 8249 bytes .../glsl/fs_stencil_color_lightning.bin | Bin 2076 -> 2036 bytes .../glsl/fs_stencil_texture_lightning.bin | Bin 2334 -> 2294 bytes examples/runtime/shaders/glsl/vs_hdr_blur.bin | Bin 1347 -> 1383 bytes examples/runtime/shaders/glsl/vs_hdr_mesh.bin | Bin 651 -> 614 bytes examples/runtime/shaders/glsl/vs_mesh.bin | Bin 1409 -> 1368 bytes examples/runtime/shaders/glsl/vs_oit.bin | Bin 593 -> 556 bytes .../vs_shadowmaps_color_lightning_linear.bin | Bin 962 -> 919 bytes ..._shadowmaps_color_lightning_linear_csm.bin | Bin 1794 -> 1610 bytes ...shadowmaps_color_lightning_linear_omni.bin | Bin 1752 -> 1536 bytes .../vs_shadowmaps_color_lightning_omni.bin | Bin 1404 -> 1372 bytes .../shaders/glsl/vs_shadowmaps_packdepth.bin | Bin 314 -> 277 bytes .../glsl/vs_shadowmaps_packdepth_linear.bin | Bin 327 -> 290 bytes .../runtime/shaders/glsl/vs_sms_shadow_pd.bin | Bin 314 -> 277 bytes examples/runtime/shaders/glsl/vs_tree.bin | Bin 749 -> 715 bytes scripts/shaderc.lua | 6 + 1394 files changed, 40096 insertions(+), 89698 deletions(-) create mode 100644 3rdparty/glsl-optimizer/src/glsl/ir_print_metal_visitor.cpp create mode 100644 3rdparty/glsl-optimizer/src/glsl/ir_print_metal_visitor.h create mode 100644 3rdparty/glsl-optimizer/src/glsl/lower_offset_array.cpp create mode 100644 3rdparty/glsl-optimizer/src/glsl/lower_vertex_id.cpp create mode 100644 3rdparty/glsl-optimizer/src/glsl/opt_dead_builtin_variables.cpp create mode 100644 3rdparty/glsl-optimizer/src/glsl/opt_minmax.cpp create mode 100644 3rdparty/glsl-optimizer/src/glsl/opt_rebalance_tree.cpp create mode 100644 3rdparty/glsl-optimizer/src/glsl/opt_vector_splitting.cpp create mode 100644 3rdparty/glsl-optimizer/src/mesa/main/errors.h create mode 100644 3rdparty/glsl-optimizer/src/util/.gitignore create mode 100644 3rdparty/glsl-optimizer/src/util/Makefile.sources create mode 100644 3rdparty/glsl-optimizer/src/util/SConscript rename 3rdparty/glsl-optimizer/src/{mesa/main => util}/hash_table.c (99%) rename 3rdparty/glsl-optimizer/src/{mesa/main => util}/hash_table.h (98%) create mode 100644 3rdparty/glsl-optimizer/src/util/macros.h rename 3rdparty/glsl-optimizer/src/{glsl => util}/ralloc.c (100%) rename 3rdparty/glsl-optimizer/src/{glsl => util}/ralloc.h (96%) create mode 100644 3rdparty/glsl-optimizer/tests/fragment/array-const-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/array-const-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/array-const-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/array-const-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/array-const-outES3Metal.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/array-constconst-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/array-constconst-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/array-constconst-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3Metal.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/ast-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/ast-ir.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/ast-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/ast-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/basic-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/basic-irES.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/bug-global-init-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/bug-inline-names-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/bug-loop-null-from-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-ir.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/bug-vectorize-tex-in.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/bug-vectorize-tex-out.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/builtin-vars-inES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/builtin-vars-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/builtin-vars-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/derivatives-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/derivatives-irES.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/estest1-ir.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/fragdepth-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/fragdepth-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/fragdepth-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES3Metal.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-inES.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-inES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES3Metal.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-ir.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-irES.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/intrinsics-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/intrinsics-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/intrinsics-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3Metal.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/loop-for-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/loop-for-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/loop-for-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/loop-for-outES3Metal.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-irES.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-irES.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-irES.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-ir.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/mrt-inES.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/mrt-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/mrt-irES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-inES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-outES3Metal.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/mrt-outES.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/mrt-outES3Metal.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/mrt-unused-inES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/mrt-unused-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/mrt-unused-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/nested-inlining-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/opt-copyprop-struct-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloads-ir.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-inES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/opt-deadcode-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/opt-deadcodestruct-ir.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/opt-ifs-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/opt-inline-inoutstruct-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect-irES.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-irES.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/opt-movevars-simple-irES.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/opt-vec-var-index-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-retval-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/pp-basic-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/prec-default-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/prec-expressions-inES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/prec-expressions-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/prec-expressions-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-irES.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-irES.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/prec-temps-irES.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-irES.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-irES.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-irES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-outES3Metal.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/sampler-precision-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/sampler-precision-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/small-float-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/struct-array-var-index-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/struct-initializer-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/struct-unused-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/swizzle-writemask-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/syntax-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/ternary-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/ternary-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/ternary-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/ternary-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/ternary-outES3Metal.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-irES.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-irES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/tex2dlod-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/tex2dlod-irES.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/tex2dlod-irES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-irES.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-irES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/tex3D-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/tex3D-irES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/tex3D-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-irES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/texOffset-irES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3Metal.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/texProj-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/texProj-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/texProj-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/texProj-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/types-writemask-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/varyings-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/varyings-irES.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/vface-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/vface-irES.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/vpos-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/vpos-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-inES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-outES3Metal.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-ir.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3Metal.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-flare-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-flare-irES.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-ir.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-ir.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-irES.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-irES.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-particle-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-particle-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3Metal.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-inES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES3Metal.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-ir.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3Metal.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-inES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Decal-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Grab_Invert-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthTexture-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-Halo-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Sepiatone_Effect-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Bark_Shader_Rendertex-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-ir.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Nature_My_Soft_Occlusion_Leaves-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive_(Soft)-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Alpha_Blended_Premultiply-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply_(Double)-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-irES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-SSAO8-irES.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Specular-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Test_CgNormals-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderTexture-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-TexGen_Cube_Refl-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-ir.txt create mode 100644 3rdparty/glsl-optimizer/tests/tests.js create mode 100644 3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-ir.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/bug-loops-for-while-in.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/bug-loops-for-while-out.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-ir.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-inES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-ir.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/builtin-vars-inES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/estest1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-ir.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/inputs-inES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/inputs-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/inputs-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/loops-for-ir.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-in.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-inES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-out.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-ir.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-ir.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/matrix-casts-inES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/matrix-casts-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/matrix-casts-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/opt-inline-varnames-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-ir.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/opt-negsub-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/opt-normalize-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/opt-unroll-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-ir.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-inES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/swizzlemask-ir.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/types-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/types-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/types-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/types-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/types-outES3Metal.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-inES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLight-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/z-particle-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/z-particle-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES3Metal.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-inES3.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-irES.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES3.txt create mode 100644 3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES3Metal.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Decal-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-FX_Glass_Stained_BumpDistort-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Grab_Invert-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Glow_Downsample-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-PrePassLighting-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Twist_Effect-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Particles_Blend-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-RenderFX_Skybox_Cubed-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Specular1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-ShowDestAlpha-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Specular-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Specular1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Test_CgNormals-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderDepthTexture-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderTexture-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Toon_Basic-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-ir.txt delete mode 100644 3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-ir.txt diff --git a/3rdparty/glsl-optimizer/.gitignore b/3rdparty/glsl-optimizer/.gitignore index 991ef389b..cb7c7ef8a 100644 --- a/3rdparty/glsl-optimizer/.gitignore +++ b/3rdparty/glsl-optimizer/.gitignore @@ -1,3 +1,4 @@ +node_modules *.a *.dll *.exe @@ -73,4 +74,5 @@ glsl_compiler .settings/ .pydevproject -build \ No newline at end of file +build +metalTemp.metal diff --git a/3rdparty/glsl-optimizer/CMakeLists.txt b/3rdparty/glsl-optimizer/CMakeLists.txt index 1215af7a3..739ade7fa 100644 --- a/3rdparty/glsl-optimizer/CMakeLists.txt +++ b/3rdparty/glsl-optimizer/CMakeLists.txt @@ -36,6 +36,11 @@ target_link_libraries(glsl_compiler glsl_optimizer) file(GLOB glsl_test_sources tests/*.cpp) add_executable(glsl_test ${glsl_test_sources}) target_link_libraries(glsl_test glsl_optimizer) +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + # OSX-specific build requirements + find_library(OpenGL_LIBRARY OpenGL ) + target_link_libraries(glsl_test ${OpenGL_LIBRARY}) +endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") file(GLOB glslopt_sources contrib/glslopt/*.cpp) add_executable(glslopt ${glslopt_sources}) diff --git a/3rdparty/glsl-optimizer/Changelog.md b/3rdparty/glsl-optimizer/Changelog.md index 8f7567f55..cdc184764 100644 --- a/3rdparty/glsl-optimizer/Changelog.md +++ b/3rdparty/glsl-optimizer/Changelog.md @@ -1,6 +1,60 @@ GLSL optimizer Change Log ========================= +2014 10 +------- + +Goodies: + +* Support for translating GLSL shaders into Apple Metal shading language. + Exactly same process; GLSL in (preferably ES3 variant), optimization passes, Metal out. + All uniforms currently will be put into one constant buffer. + Pass kGlslTargetMetal target to get Metal. +* Shader reflection API. See glslopt_shader_get_* functions. Binding indices + are only automatically assigned on Metal now; on GL/ES targets the reflection API is only + useful to get list of inputs/uniforms, their names and types. +* Improved dead code elimation: some cases of swizzled/masked assignments where same variable was on both sides + were not eliminated if that variable was totally unused later. +* Merged with upstream Mesa, comes with new optimizations (min/max pruning, tree rebalancing, vector_insert lowering). + +Fixes: + +* sampler3D declarations were missing precision qualifier on GLES3.0. + + +2014 09 +------- + +Goodies: + +* Supports GL_EXT_draw_buffers in ES2.0, for MRT. + + +2014 08 +------- + +Goodies: + +* Supports GL_EXT_shader_framebuffer_fetch now, in both ES2.0 & 3.0. + +Fixes: + +* Fixed printing of infinities & NaNs. +* Fixed vectorization pass in some cases going wrong on texture lookups. + + +2014 06 +------- + +Goodies: + +* Optimization: split vectors with only some used components into scalars. + +Fixes: + +* Fixed more issues with for-loop printing. +* Fixed printing of unsigned integer swizzled & constants. + 2014 03 ------- diff --git a/3rdparty/glsl-optimizer/README.md b/3rdparty/glsl-optimizer/README.md index aa89f1d3f..723d746d1 100644 --- a/3rdparty/glsl-optimizer/README.md +++ b/3rdparty/glsl-optimizer/README.md @@ -2,16 +2,19 @@ GLSL optimizer ============== A C++ library that takes GLSL shaders, does some GPU-independent optimizations on them -and outputs GLSL back. Optimizations are function inlining, dead code removal, copy propagation, +and outputs GLSL or Metal source back. Optimizations are function inlining, dead code removal, copy propagation, constant folding, constant propagation, arithmetic optimizations and so on. -Apparently quite a few mobile platforms are pretty bad at optimizing GLSL shaders; and +Apparently quite a few mobile platforms are pretty bad at optimizing shaders; and unfortunately they *also* lack offline shader compilers. So using a GLSL optimizer offline before can make the shader run much faster on a platform like that. See performance numbers in [this blog post](http://aras-p.info/blog/2010/09/29/glsl-optimizer/). +Even for drivers that have decent shader optimization, GLSL optimizer could be useful to just strip away +dead code, make shaders smaller and do uniform/input reflection offline. + Almost all actual code is [Mesa 3D's GLSL](http://cgit.freedesktop.org/mesa/mesa/log/) -compiler; all this library does is spits out optimized GLSL back, and adds GLES type precision +compiler; all this library does is spits out optimized GLSL or Metal back, and adds GLES type precision handling to the optimizer. This GLSL optimizer is made for [Unity's](http://unity3d.com/) purposes and is built-in @@ -19,7 +22,7 @@ starting with Unity 3.0. GLSL Optimizer is licensed according to the terms of the MIT license. -See badly maintained [change log](Changelog.md). +See [change log here](Changelog.md). Usage @@ -38,7 +41,7 @@ This will build the optimizer library and some executable binaries. Interface for the library is `src/glsl/glsl_optimizer.h`. General usage is: - ctx = glslopt_initialize(); + ctx = glslopt_initialize(targetVersion); for (lots of shaders) { shader = glslopt_optimize (ctx, shaderType, shaderSource, options); if (glslopt_get_status (shader)) { @@ -59,7 +62,7 @@ and run `glsl_optimizer_tests` project; in Xcode use `projects/xcode5/glsl_optim project. The test executable requires path to the `tests` folder as an argument. Each test comes as three text files; input, expected IR dump and expected optimized -GLSL dump. +GLSL dump. GLES3 tests are also converted into Metal. If you're making changes to the project and want pull requests accepted easier, I'd appreciate if there would be no test suite regressions. If you are implementing a @@ -70,7 +73,7 @@ Notes ----- * GLSL versions 1.10 and 1.20 are supported. 1.10 is the default, use #version 120 to specify -1.20. +1.20. Higher GLSL versions might work, but aren't tested now. * GLSL ES versions 1.00 and 3.00 are supported. diff --git a/3rdparty/glsl-optimizer/binding.gyp b/3rdparty/glsl-optimizer/binding.gyp index 92ae42c6e..50ebc7ab7 100644 --- a/3rdparty/glsl-optimizer/binding.gyp +++ b/3rdparty/glsl-optimizer/binding.gyp @@ -4,16 +4,19 @@ ], 'targets': [ { + "include_dirs" : [ + " #include #include @@ -9,15 +10,18 @@ static int printhelp(const char* msg) { if (msg) printf("%s\n\n\n", msg); printf("Usage: glslopt <-f|-v> []\n"); - printf("\t-f : fragment shader\n"); + printf("\t-f : fragment shader (default)\n"); printf("\t-v : vertex shader\n"); + printf("\t-1 : target OpenGL (default)\n"); + printf("\t-2 : target OpenGL ES 2.0\n"); + printf("\t-3 : target OpenGL ES 3.0\n"); printf("\n\tIf no output specified, output is to [input].out.\n"); return 1; } -static bool init() +static bool init(glslopt_target target) { - gContext = glslopt_initialize(kGlslTargetOpenGL); + gContext = glslopt_initialize(target); if( !gContext ) return false; return true; @@ -51,7 +55,7 @@ static char* loadFile(const char* filename) static bool saveFile(const char* filename, const char* data) { - int size = (int)strlen(data)+1; + int size = (int)strlen(data); FILE* file = fopen(filename, "wt"); if( !file ) @@ -101,6 +105,7 @@ int main(int argc, char* argv[]) return printhelp(NULL); bool vertexShader = false, freename = false; + glslopt_target languageTarget = kGlslTargetOpenGL; const char* source = 0; char* dest = 0; @@ -110,8 +115,14 @@ int main(int argc, char* argv[]) { if( 0 == strcmp("-v", argv[i]) ) vertexShader = true; - if( 0 == strcmp("-f", argv[i]) ) + else if( 0 == strcmp("-f", argv[i]) ) vertexShader = false; + else if( 0 == strcmp("-1", argv[i]) ) + languageTarget = kGlslTargetOpenGL; + else if( 0 == strcmp("-2", argv[i]) ) + languageTarget = kGlslTargetOpenGLES20; + else if( 0 == strcmp("-3", argv[i]) ) + languageTarget = kGlslTargetOpenGLES30; } else { @@ -125,7 +136,7 @@ int main(int argc, char* argv[]) if( !source ) return printhelp("Must give a source"); - if( !init() ) + if( !init(languageTarget) ) { printf("Failed to initialize glslopt!\n"); return 1; diff --git a/3rdparty/glsl-optimizer/package.json b/3rdparty/glsl-optimizer/package.json index dcce14002..017906e33 100644 --- a/3rdparty/glsl-optimizer/package.json +++ b/3rdparty/glsl-optimizer/package.json @@ -8,14 +8,31 @@ }, "repository": { "type": "git", - "url": "https://github.com/donny-dont/glsl-optimizer.git" + "url": "https://github.com/aras-p/glsl-optimizer.git" }, "keywords": [ "glsl", - "webgl" + "webgl", + "shader", + "optimize", + "optimizer", + "opengl", + "essl", + "es", + "opengles" ], - "author": "Don Olmstead", + "readmeFilename": "README.md", + "author": "Aras Pranckevičius", "license": "MIT", "gypfile": true, - "readmeFilename": "README.md" + "bugs": { + "url": "https://github.com/aras-p/glsl-optimizer/issues" + }, + "homepage": "https://github.com/aras-p/glsl-optimizer", + "directories": { + "test": "tests" + }, + "dependencies": { + "nan": "~1.2.0" + } } diff --git a/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj b/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj index 4e573f9a4..beea6fce9 100644 --- a/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj +++ b/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj @@ -72,7 +72,7 @@ Disabled - ../../src/mesa;../../include/c99;../../include;../../src/glsl;%(AdditionalIncludeDirectories) + ../../src/mesa;../../src;../../include/c99;../../include;../../src/glsl;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_LIB;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;__STDC_VERSION__=199901L;__STDC__;strdup=_strdup;%(PreprocessorDefinitions) false @@ -97,7 +97,7 @@ Disabled - ../../src/mesa;../../include/c99;../../include;../../src/glsl;%(AdditionalIncludeDirectories) + ../../src/mesa;../../src;../../include/c99;../../include;../../src/glsl;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_LIB;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;__STDC_VERSION__=199901L;__STDC__;strdup=_strdup;%(PreprocessorDefinitions) false @@ -120,7 +120,7 @@ MaxSpeed true - ../../src/mesa;../../include/c99;../../include;../../src/glsl;%(AdditionalIncludeDirectories) + ../../src/mesa;../../src;../../include/c99;../../include;../../src/glsl;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_LIB;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;__STDC_VERSION__=199901L;__STDC__;strdup=_strdup;%(PreprocessorDefinitions) @@ -145,7 +145,7 @@ MaxSpeed true - ../../src/mesa;../../include/c99;../../include;../../src/glsl;%(AdditionalIncludeDirectories) + ../../src/mesa;../../src;../../include/c99;../../include;../../src/glsl;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_LIB;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;__STDC_VERSION__=199901L;__STDC__;strdup=_strdup;%(PreprocessorDefinitions) @@ -179,6 +179,7 @@ + @@ -192,13 +193,11 @@ - - @@ -215,6 +214,8 @@ + + @@ -246,6 +247,7 @@ + @@ -273,6 +275,7 @@ + @@ -282,6 +285,7 @@ + true true @@ -296,6 +300,7 @@ + @@ -304,13 +309,15 @@ + + - + @@ -323,10 +330,11 @@ true - + + diff --git a/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj.filters b/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj.filters index 69d49d115..a8a71365a 100644 --- a/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj.filters +++ b/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj.filters @@ -60,6 +60,9 @@ src\glsl + + src\glsl + src\glsl @@ -87,9 +90,6 @@ src\glsl - - src\glsl - src\glsl @@ -153,9 +153,6 @@ src\glsl - - src\mesa\main - src\mesa\program @@ -174,6 +171,12 @@ src\glsl + + src\util + + + src\util + @@ -254,6 +257,9 @@ src\glsl + + src\glsl + src\glsl @@ -389,9 +395,6 @@ src\glsl - - src\glsl - src\glsl @@ -416,9 +419,6 @@ src\mesa\program - - src\mesa\main - src\mesa\main @@ -455,6 +455,9 @@ src\glsl + + src\glsl + src\glsl @@ -464,9 +467,21 @@ src\glsl + + src\glsl + src\glsl + + src\glsl + + + src\glsl + + + src\glsl + src\glsl @@ -476,6 +491,15 @@ src\glsl + + src\glsl + + + src\util + + + src\util + diff --git a/3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_lib.xcodeproj/project.pbxproj b/3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_lib.xcodeproj/project.pbxproj index 1e2632683..04a79805c 100644 --- a/3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_lib.xcodeproj/project.pbxproj +++ b/3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_lib.xcodeproj/project.pbxproj @@ -26,6 +26,16 @@ 2B3854711293BE5000F3E692 /* opt_structure_splitting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B38545A1293BE5000F3E692 /* opt_structure_splitting.cpp */; }; 2B3854721293BE5000F3E692 /* opt_swizzle_swizzle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B38545B1293BE5000F3E692 /* opt_swizzle_swizzle.cpp */; }; 2B3854731293BE5000F3E692 /* opt_tree_grafting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B38545C1293BE5000F3E692 /* opt_tree_grafting.cpp */; }; + 2B39E41519E959F9001C6A17 /* hash_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 2B39E41019E959F9001C6A17 /* hash_table.c */; }; + 2B39E41619E959F9001C6A17 /* hash_table.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B39E41119E959F9001C6A17 /* hash_table.h */; }; + 2B39E41719E959F9001C6A17 /* macros.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B39E41219E959F9001C6A17 /* macros.h */; }; + 2B39E41819E959F9001C6A17 /* ralloc.c in Sources */ = {isa = PBXBuildFile; fileRef = 2B39E41319E959F9001C6A17 /* ralloc.c */; }; + 2B39E41919E959F9001C6A17 /* ralloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B39E41419E959F9001C6A17 /* ralloc.h */; }; + 2B39E41F19E95FA7001C6A17 /* lower_offset_array.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B39E41A19E95FA7001C6A17 /* lower_offset_array.cpp */; }; + 2B39E42019E95FA7001C6A17 /* lower_vertex_id.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B39E41B19E95FA7001C6A17 /* lower_vertex_id.cpp */; }; + 2B39E42119E95FA7001C6A17 /* opt_dead_builtin_variables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B39E41C19E95FA7001C6A17 /* opt_dead_builtin_variables.cpp */; }; + 2B39E42219E95FA7001C6A17 /* opt_minmax.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B39E41D19E95FA7001C6A17 /* opt_minmax.cpp */; }; + 2B39E42319E95FA7001C6A17 /* opt_rebalance_tree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B39E41E19E95FA7001C6A17 /* opt_rebalance_tree.cpp */; }; 2B3A6B9015FA043D000DCBE1 /* link_uniforms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6B8E15FA043D000DCBE1 /* link_uniforms.cpp */; }; 2B3A6B9715FA0468000DCBE1 /* link_uniform_initializers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6B9515FA0468000DCBE1 /* link_uniform_initializers.cpp */; }; 2B3A6BA815FA0494000DCBE1 /* lower_clip_distance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6B9C15FA0494000DCBE1 /* lower_clip_distance.cpp */; }; @@ -60,8 +70,6 @@ 2B8979E2182CB62900718F8A /* link_atomics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B8979E1182CB62900718F8A /* link_atomics.cpp */; }; 2B92A05E15F9FF4700CFED4A /* builtin_variables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B92A05C15F9FF4700CFED4A /* builtin_variables.cpp */; }; 2B9F0A3D189664F3002FF617 /* opt_vectorize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B9F0A3C189664F3002FF617 /* opt_vectorize.cpp */; }; - 2BA07FAB1352E7BB00A1C074 /* ralloc.c in Sources */ = {isa = PBXBuildFile; fileRef = 2BA07FA91352E7BB00A1C074 /* ralloc.c */; }; - 2BA07FAC1352E7BB00A1C074 /* ralloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA07FAA1352E7BB00A1C074 /* ralloc.h */; }; 2BA55A9C1207FEA6002DC82D /* ast_expr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A511207FEA6002DC82D /* ast_expr.cpp */; }; 2BA55A9D1207FEA6002DC82D /* ast_function.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A521207FEA6002DC82D /* ast_function.cpp */; }; 2BA55A9E1207FEA6002DC82D /* ast_to_hir.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A531207FEA6002DC82D /* ast_to_hir.cpp */; }; @@ -118,6 +126,7 @@ 2BA7E14617D0AEB200D5C475 /* lower_vector_insert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA7E13C17D0AEB200D5C475 /* lower_vector_insert.cpp */; }; 2BA7E14817D0AEB200D5C475 /* opt_dead_builtin_varyings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA7E13D17D0AEB200D5C475 /* opt_dead_builtin_varyings.cpp */; }; 2BA7E14A17D0AEB200D5C475 /* opt_flip_matrices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA7E13E17D0AEB200D5C475 /* opt_flip_matrices.cpp */; }; + 2BA84CA619580C9D0021BE1D /* opt_vector_splitting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA84CA519580C9D0021BE1D /* opt_vector_splitting.cpp */; }; 2BB2F5B012B8F1580052C6B0 /* lower_discard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BB2F5AA12B8F1580052C6B0 /* lower_discard.cpp */; }; 2BB2F5B112B8F1580052C6B0 /* lower_instructions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BB2F5AB12B8F1580052C6B0 /* lower_instructions.cpp */; }; 2BB2F5B212B8F1580052C6B0 /* lower_vector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BB2F5AC12B8F1580052C6B0 /* lower_vector.cpp */; }; @@ -150,9 +159,9 @@ 2BBD9DBC1719698C00515007 /* lower_packed_varyings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBD9DB61719698900515007 /* lower_packed_varyings.cpp */; }; 2BBD9DBE1719698C00515007 /* lower_packing_builtins.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBD9DB71719698A00515007 /* lower_packing_builtins.cpp */; }; 2BBD9DC01719698C00515007 /* opt_flatten_nested_if_blocks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBD9DB81719698B00515007 /* opt_flatten_nested_if_blocks.cpp */; }; - 2BBD9DC4171969F700515007 /* hash_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 2BBD9DC2171969F700515007 /* hash_table.c */; }; - 2BBD9DC6171969F700515007 /* hash_table.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BBD9DC3171969F700515007 /* hash_table.h */; }; 2BBD9DC817196A3B00515007 /* imports.c in Sources */ = {isa = PBXBuildFile; fileRef = 2BBD9DC717196A3B00515007 /* imports.c */; }; + 2BCF3A8D19ADE1E50057C395 /* ir_print_metal_visitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BCF3A8B19ADE1E50057C395 /* ir_print_metal_visitor.cpp */; }; + 2BCF3A8E19ADE1E50057C395 /* ir_print_metal_visitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BCF3A8C19ADE1E50057C395 /* ir_print_metal_visitor.h */; }; 2BDCB95D184E182B0075CE6F /* ir_stats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BDCB95B184E182B0075CE6F /* ir_stats.cpp */; }; 2BDCB95E184E182B0075CE6F /* ir_stats.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BDCB95C184E182B0075CE6F /* ir_stats.h */; }; 2BEC22EA1356E98300B5E301 /* opt_copy_propagation_elements.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BEC22CB1356E94E00B5E301 /* opt_copy_propagation_elements.cpp */; }; @@ -178,6 +187,16 @@ 2B38545A1293BE5000F3E692 /* opt_structure_splitting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_structure_splitting.cpp; path = ../../src/glsl/opt_structure_splitting.cpp; sourceTree = SOURCE_ROOT; }; 2B38545B1293BE5000F3E692 /* opt_swizzle_swizzle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_swizzle_swizzle.cpp; path = ../../src/glsl/opt_swizzle_swizzle.cpp; sourceTree = SOURCE_ROOT; }; 2B38545C1293BE5000F3E692 /* opt_tree_grafting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_tree_grafting.cpp; path = ../../src/glsl/opt_tree_grafting.cpp; sourceTree = SOURCE_ROOT; }; + 2B39E41019E959F9001C6A17 /* hash_table.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = hash_table.c; path = ../../src/util/hash_table.c; sourceTree = ""; }; + 2B39E41119E959F9001C6A17 /* hash_table.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = hash_table.h; path = ../../src/util/hash_table.h; sourceTree = ""; }; + 2B39E41219E959F9001C6A17 /* macros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macros.h; path = ../../src/util/macros.h; sourceTree = ""; }; + 2B39E41319E959F9001C6A17 /* ralloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ralloc.c; path = ../../src/util/ralloc.c; sourceTree = ""; }; + 2B39E41419E959F9001C6A17 /* ralloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ralloc.h; path = ../../src/util/ralloc.h; sourceTree = ""; }; + 2B39E41A19E95FA7001C6A17 /* lower_offset_array.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_offset_array.cpp; path = ../../src/glsl/lower_offset_array.cpp; sourceTree = ""; }; + 2B39E41B19E95FA7001C6A17 /* lower_vertex_id.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_vertex_id.cpp; path = ../../src/glsl/lower_vertex_id.cpp; sourceTree = ""; }; + 2B39E41C19E95FA7001C6A17 /* opt_dead_builtin_variables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_dead_builtin_variables.cpp; path = ../../src/glsl/opt_dead_builtin_variables.cpp; sourceTree = ""; }; + 2B39E41D19E95FA7001C6A17 /* opt_minmax.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_minmax.cpp; path = ../../src/glsl/opt_minmax.cpp; sourceTree = ""; }; + 2B39E41E19E95FA7001C6A17 /* opt_rebalance_tree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_rebalance_tree.cpp; path = ../../src/glsl/opt_rebalance_tree.cpp; sourceTree = ""; }; 2B3A6B8E15FA043D000DCBE1 /* link_uniforms.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = link_uniforms.cpp; path = ../../src/glsl/link_uniforms.cpp; sourceTree = SOURCE_ROOT; }; 2B3A6B9515FA0468000DCBE1 /* link_uniform_initializers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = link_uniform_initializers.cpp; path = ../../src/glsl/link_uniform_initializers.cpp; sourceTree = SOURCE_ROOT; }; 2B3A6B9C15FA0494000DCBE1 /* lower_clip_distance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_clip_distance.cpp; path = ../../src/glsl/lower_clip_distance.cpp; sourceTree = SOURCE_ROOT; }; @@ -214,8 +233,6 @@ 2B8979E1182CB62900718F8A /* link_atomics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = link_atomics.cpp; path = ../../src/glsl/link_atomics.cpp; sourceTree = ""; }; 2B92A05C15F9FF4700CFED4A /* builtin_variables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = builtin_variables.cpp; path = ../../src/glsl/builtin_variables.cpp; sourceTree = SOURCE_ROOT; }; 2B9F0A3C189664F3002FF617 /* opt_vectorize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_vectorize.cpp; path = ../../src/glsl/opt_vectorize.cpp; sourceTree = ""; }; - 2BA07FA91352E7BB00A1C074 /* ralloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ralloc.c; path = ../../src/glsl/ralloc.c; sourceTree = SOURCE_ROOT; }; - 2BA07FAA1352E7BB00A1C074 /* ralloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ralloc.h; path = ../../src/glsl/ralloc.h; sourceTree = SOURCE_ROOT; }; 2BA0808A1352EBFB00A1C074 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = ../../src/glsl/main.cpp; sourceTree = SOURCE_ROOT; }; 2BA55A511207FEA6002DC82D /* ast_expr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ast_expr.cpp; path = ../../src/glsl/ast_expr.cpp; sourceTree = SOURCE_ROOT; }; 2BA55A521207FEA6002DC82D /* ast_function.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ast_function.cpp; path = ../../src/glsl/ast_function.cpp; sourceTree = SOURCE_ROOT; }; @@ -275,6 +292,7 @@ 2BA7E13C17D0AEB200D5C475 /* lower_vector_insert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_vector_insert.cpp; path = ../../src/glsl/lower_vector_insert.cpp; sourceTree = ""; }; 2BA7E13D17D0AEB200D5C475 /* opt_dead_builtin_varyings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_dead_builtin_varyings.cpp; path = ../../src/glsl/opt_dead_builtin_varyings.cpp; sourceTree = ""; }; 2BA7E13E17D0AEB200D5C475 /* opt_flip_matrices.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_flip_matrices.cpp; path = ../../src/glsl/opt_flip_matrices.cpp; sourceTree = ""; }; + 2BA84CA519580C9D0021BE1D /* opt_vector_splitting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_vector_splitting.cpp; path = ../../src/glsl/opt_vector_splitting.cpp; sourceTree = ""; }; 2BB2F5AA12B8F1580052C6B0 /* lower_discard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_discard.cpp; path = ../../src/glsl/lower_discard.cpp; sourceTree = SOURCE_ROOT; }; 2BB2F5AB12B8F1580052C6B0 /* lower_instructions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_instructions.cpp; path = ../../src/glsl/lower_instructions.cpp; sourceTree = SOURCE_ROOT; }; 2BB2F5AC12B8F1580052C6B0 /* lower_vector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_vector.cpp; path = ../../src/glsl/lower_vector.cpp; sourceTree = SOURCE_ROOT; }; @@ -308,9 +326,9 @@ 2BBD9DB61719698900515007 /* lower_packed_varyings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_packed_varyings.cpp; path = ../../src/glsl/lower_packed_varyings.cpp; sourceTree = ""; }; 2BBD9DB71719698A00515007 /* lower_packing_builtins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_packing_builtins.cpp; path = ../../src/glsl/lower_packing_builtins.cpp; sourceTree = ""; }; 2BBD9DB81719698B00515007 /* opt_flatten_nested_if_blocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_flatten_nested_if_blocks.cpp; path = ../../src/glsl/opt_flatten_nested_if_blocks.cpp; sourceTree = ""; }; - 2BBD9DC2171969F700515007 /* hash_table.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = hash_table.c; path = ../../src/mesa/main/hash_table.c; sourceTree = ""; }; - 2BBD9DC3171969F700515007 /* hash_table.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = hash_table.h; path = ../../src/mesa/main/hash_table.h; sourceTree = ""; }; 2BBD9DC717196A3B00515007 /* imports.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = imports.c; path = ../../src/mesa/main/imports.c; sourceTree = ""; }; + 2BCF3A8B19ADE1E50057C395 /* ir_print_metal_visitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_print_metal_visitor.cpp; path = ../../src/glsl/ir_print_metal_visitor.cpp; sourceTree = ""; }; + 2BCF3A8C19ADE1E50057C395 /* ir_print_metal_visitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_print_metal_visitor.h; path = ../../src/glsl/ir_print_metal_visitor.h; sourceTree = ""; }; 2BDCB95B184E182B0075CE6F /* ir_stats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_stats.cpp; path = ../../src/glsl/ir_stats.cpp; sourceTree = ""; }; 2BDCB95C184E182B0075CE6F /* ir_stats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_stats.h; path = ../../src/glsl/ir_stats.h; sourceTree = ""; }; 2BEC22CB1356E94E00B5E301 /* opt_copy_propagation_elements.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_copy_propagation_elements.cpp; path = ../../src/glsl/opt_copy_propagation_elements.cpp; sourceTree = SOURCE_ROOT; }; @@ -341,6 +359,7 @@ 08FB7795FE84155DC02AAC07 /* Source */ = { isa = PBXGroup; children = ( + 2B39E40F19E959E0001C6A17 /* util */, 2BB7259A135094A60057D8B5 /* mesa */, 2B47D9FC1209C85400937F2C /* program */, 2BA55A501207FE41002DC82D /* glsl */, @@ -356,6 +375,18 @@ name = Products; sourceTree = ""; }; + 2B39E40F19E959E0001C6A17 /* util */ = { + isa = PBXGroup; + children = ( + 2B39E41019E959F9001C6A17 /* hash_table.c */, + 2B39E41119E959F9001C6A17 /* hash_table.h */, + 2B39E41219E959F9001C6A17 /* macros.h */, + 2B39E41319E959F9001C6A17 /* ralloc.c */, + 2B39E41419E959F9001C6A17 /* ralloc.h */, + ); + name = util; + sourceTree = ""; + }; 2B47D9FC1209C85400937F2C /* program */ = { isa = PBXGroup; children = ( @@ -434,6 +465,8 @@ 2BA55A801207FEA6002DC82D /* ir_optimization.h */, 2BA55A811207FEA6002DC82D /* ir_print_glsl_visitor.cpp */, 2BA55A821207FEA6002DC82D /* ir_print_glsl_visitor.h */, + 2BCF3A8B19ADE1E50057C395 /* ir_print_metal_visitor.cpp */, + 2BCF3A8C19ADE1E50057C395 /* ir_print_metal_visitor.h */, 2BA55A831207FEA6002DC82D /* ir_print_visitor.cpp */, 2BA55A841207FEA6002DC82D /* ir_print_visitor.h */, 2B62490D12191339003F6EEE /* ir_rvalue_visitor.cpp */, @@ -473,6 +506,7 @@ 2B38544A1293BE5000F3E692 /* lower_mat_op_to_vec.cpp */, 2BA7E13B17D0AEB200D5C475 /* lower_named_interface_blocks.cpp */, 2BBA49251254706A00D42573 /* lower_noise.cpp */, + 2B39E41A19E95FA7001C6A17 /* lower_offset_array.cpp */, 2B3A6B9E15FA0494000DCBE1 /* lower_output_reads.cpp */, 2BBD9DB61719698900515007 /* lower_packed_varyings.cpp */, 2BBD9DB71719698A00515007 /* lower_packing_builtins.cpp */, @@ -482,6 +516,7 @@ 2B38544E1293BE5000F3E692 /* lower_vec_index_to_swizzle.cpp */, 2BB2F5AC12B8F1580052C6B0 /* lower_vector.cpp */, 2BA7E13C17D0AEB200D5C475 /* lower_vector_insert.cpp */, + 2B39E41B19E95FA7001C6A17 /* lower_vertex_id.cpp */, 2BA0808A1352EBFB00A1C074 /* main.cpp */, 2B38544F1293BE5000F3E692 /* opt_algebraic.cpp */, 2B3A6BA115FA0494000DCBE1 /* opt_array_splitting.cpp */, @@ -491,6 +526,7 @@ 2B3854531293BE5000F3E692 /* opt_copy_propagation.cpp */, 2BEC22CB1356E94E00B5E301 /* opt_copy_propagation_elements.cpp */, 2B8979DF182C195C00718F8A /* opt_cse.cpp */, + 2B39E41C19E95FA7001C6A17 /* opt_dead_builtin_variables.cpp */, 2BA7E13D17D0AEB200D5C475 /* opt_dead_builtin_varyings.cpp */, 2B3854551293BE5000F3E692 /* opt_dead_code.cpp */, 2B3854541293BE5000F3E692 /* opt_dead_code_local.cpp */, @@ -499,15 +535,16 @@ 2BA7E13E17D0AEB200D5C475 /* opt_flip_matrices.cpp */, 2B3854571293BE5000F3E692 /* opt_function_inlining.cpp */, 2B3854581293BE5000F3E692 /* opt_if_simplification.cpp */, + 2B39E41D19E95FA7001C6A17 /* opt_minmax.cpp */, 2B3854591293BE5000F3E692 /* opt_noop_swizzle.cpp */, + 2B39E41E19E95FA7001C6A17 /* opt_rebalance_tree.cpp */, 2BBA49271254706A00D42573 /* opt_redundant_jumps.cpp */, 2B38545A1293BE5000F3E692 /* opt_structure_splitting.cpp */, 2B38545B1293BE5000F3E692 /* opt_swizzle_swizzle.cpp */, 2B38545C1293BE5000F3E692 /* opt_tree_grafting.cpp */, 2B9F0A3C189664F3002FF617 /* opt_vectorize.cpp */, + 2BA84CA519580C9D0021BE1D /* opt_vector_splitting.cpp */, 2BA55A991207FEA6002DC82D /* program.h */, - 2BA07FA91352E7BB00A1C074 /* ralloc.c */, - 2BA07FAA1352E7BB00A1C074 /* ralloc.h */, 2BA55A9A1207FEA6002DC82D /* s_expression.cpp */, 2BA55A9B1207FEA6002DC82D /* s_expression.h */, 2B655A7613E0324F00B5278F /* standalone_scaffolding.cpp */, @@ -522,8 +559,6 @@ isa = PBXGroup; children = ( 2BBD9DC717196A3B00515007 /* imports.c */, - 2BBD9DC2171969F700515007 /* hash_table.c */, - 2BBD9DC3171969F700515007 /* hash_table.h */, 2BB7259B135094BE0057D8B5 /* compiler.h */, 2BB7259C135094BE0057D8B5 /* config.h */, 2BB7259D135094BE0057D8B5 /* context.h */, @@ -549,6 +584,7 @@ 2BA55AA01207FEA6002DC82D /* ast.h in Headers */, 2BA55AA71207FEA6002DC82D /* glsl_optimizer.h in Headers */, 2BA55AA91207FEA6002DC82D /* glsl_parser_extras.h in Headers */, + 2B39E41619E959F9001C6A17 /* hash_table.h in Headers */, 2BA55AAB1207FEA6002DC82D /* glsl_parser.h in Headers */, 2BA55AAD1207FEA6002DC82D /* glsl_symbol_table.h in Headers */, 2BA55AAF1207FEA6002DC82D /* glsl_types.h in Headers */, @@ -558,8 +594,10 @@ 2BA55AC31207FEA6002DC82D /* ir_hierarchical_visitor.h in Headers */, 2BA55ACB1207FEA6002DC82D /* ir_optimization.h in Headers */, 2BA55ACD1207FEA6002DC82D /* ir_print_glsl_visitor.h in Headers */, + 2B39E41919E959F9001C6A17 /* ralloc.h in Headers */, 2BA55ACF1207FEA6002DC82D /* ir_print_visitor.h in Headers */, 2BA55AD61207FEA6002DC82D /* ir_unused_structs.h in Headers */, + 2BCF3A8E19ADE1E50057C395 /* ir_print_metal_visitor.h in Headers */, 2BA55AD91207FEA6002DC82D /* ir_variable_refcount.h in Headers */, 2BA55ADD1207FEA6002DC82D /* ir_visitor.h in Headers */, 2BA55ADF1207FEA6002DC82D /* ir.h in Headers */, @@ -567,6 +605,7 @@ 2BA55AE31207FEA6002DC82D /* list.h in Headers */, 2BA55AE41207FEA6002DC82D /* program.h in Headers */, 2BA55AE61207FEA6002DC82D /* s_expression.h in Headers */, + 2B39E41719E959F9001C6A17 /* macros.h in Headers */, 2B47DA021209C87B00937F2C /* hash_table.h in Headers */, 2B47DA041209C87B00937F2C /* symbol_table.h in Headers */, 2B62491212191339003F6EEE /* ir_rvalue_visitor.h in Headers */, @@ -586,7 +625,6 @@ 2BA7E13F17D0AEB200D5C475 /* builtin_type_macros.h in Headers */, 2BDCB95E184E182B0075CE6F /* ir_stats.h in Headers */, 2BB725B5135094BE0057D8B5 /* simple_list.h in Headers */, - 2BA07FAC1352E7BB00A1C074 /* ralloc.h in Headers */, 2B655A7A13E0324F00B5278F /* standalone_scaffolding.h in Headers */, 2B3A6BDB15FA08E1000DCBE1 /* ir_builder.h in Headers */, 2B6AC7B9161EC99C0094FD86 /* prog_instruction.h in Headers */, @@ -596,7 +634,6 @@ 2B6AC8AD161ED9080094FD86 /* glminimal.h in Headers */, 2BBD9DB11719694100515007 /* link_uniform_block_active_visitor.h in Headers */, 2BBD9DBB1719698C00515007 /* link_varyings.h in Headers */, - 2BBD9DC6171969F700515007 /* hash_table.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -660,10 +697,12 @@ 2BA55AA41207FEA6002DC82D /* glsl_lexer.cpp in Sources */, 2BDCB95D184E182B0075CE6F /* ir_stats.cpp in Sources */, 2BA55AA61207FEA6002DC82D /* glsl_optimizer.cpp in Sources */, + 2B39E41F19E95FA7001C6A17 /* lower_offset_array.cpp in Sources */, 2BA55AA81207FEA6002DC82D /* glsl_parser_extras.cpp in Sources */, 2BA55AAA1207FEA6002DC82D /* glsl_parser.cpp in Sources */, 2BA55AAE1207FEA6002DC82D /* glsl_types.cpp in Sources */, 2BA55AB01207FEA6002DC82D /* hir_field_selection.cpp in Sources */, + 2BCF3A8D19ADE1E50057C395 /* ir_print_metal_visitor.cpp in Sources */, 2BA55AB21207FEA6002DC82D /* ir_basic_block.cpp in Sources */, 2BA55AB41207FEA6002DC82D /* ir_clone.cpp in Sources */, 2BA55AB51207FEA6002DC82D /* ir_constant_expression.cpp in Sources */, @@ -691,6 +730,7 @@ 2B78C91D1858B052007F5D2A /* ir_equals.cpp in Sources */, 2B6A99F61223B1670059FBED /* glcpp-parse.c in Sources */, 2B6A99FB1223B1670059FBED /* pp.c in Sources */, + 2BA84CA619580C9D0021BE1D /* opt_vector_splitting.cpp in Sources */, 2BBA49281254706A00D42573 /* glsl_symbol_table.cpp in Sources */, 2BBA492A1254706A00D42573 /* loop_analysis.cpp in Sources */, 2BBA492C1254706A00D42573 /* loop_controls.cpp in Sources */, @@ -701,6 +741,7 @@ 2BBA49301254706A00D42573 /* opt_redundant_jumps.cpp in Sources */, 2B38545F1293BE5000F3E692 /* lower_if_to_cond_assign.cpp in Sources */, 2B3854601293BE5000F3E692 /* lower_jumps.cpp in Sources */, + 2B39E42319E95FA7001C6A17 /* opt_rebalance_tree.cpp in Sources */, 2B3854611293BE5000F3E692 /* lower_mat_op_to_vec.cpp in Sources */, 2B3854641293BE5000F3E692 /* lower_vec_index_to_cond_assign.cpp in Sources */, 2B3854651293BE5000F3E692 /* lower_vec_index_to_swizzle.cpp in Sources */, @@ -709,6 +750,7 @@ 2B3854681293BE5000F3E692 /* opt_constant_propagation.cpp in Sources */, 2B3854691293BE5000F3E692 /* opt_constant_variable.cpp in Sources */, 2B38546A1293BE5000F3E692 /* opt_copy_propagation.cpp in Sources */, + 2B39E42019E95FA7001C6A17 /* lower_vertex_id.cpp in Sources */, 2B38546B1293BE5000F3E692 /* opt_dead_code_local.cpp in Sources */, 2B8979E2182CB62900718F8A /* link_atomics.cpp in Sources */, 2B38546C1293BE5000F3E692 /* opt_dead_code.cpp in Sources */, @@ -723,12 +765,13 @@ 2BB2F5B012B8F1580052C6B0 /* lower_discard.cpp in Sources */, 2BB2F5B112B8F1580052C6B0 /* lower_instructions.cpp in Sources */, 2BB2F5B212B8F1580052C6B0 /* lower_vector.cpp in Sources */, + 2B39E42219E95FA7001C6A17 /* opt_minmax.cpp in Sources */, 2BB2F5B412B8F1580052C6B0 /* strtod.c in Sources */, - 2BA07FAB1352E7BB00A1C074 /* ralloc.c in Sources */, 2BA7E14017D0AEB200D5C475 /* builtin_types.cpp in Sources */, 2BEC22EA1356E98300B5E301 /* opt_copy_propagation_elements.cpp in Sources */, 2B8979E0182C195C00718F8A /* opt_cse.cpp in Sources */, 2B655A7313E0322E00B5278F /* ir_function_detect_recursion.cpp in Sources */, + 2B39E42119E95FA7001C6A17 /* opt_dead_builtin_variables.cpp in Sources */, 2B655A7913E0324F00B5278F /* standalone_scaffolding.cpp in Sources */, 2BA7E14A17D0AEB200D5C475 /* opt_flip_matrices.cpp in Sources */, 2BA7E14217D0AEB200D5C475 /* link_interface_blocks.cpp in Sources */, @@ -736,11 +779,13 @@ 2B3A6B9015FA043D000DCBE1 /* link_uniforms.cpp in Sources */, 2B3A6B9715FA0468000DCBE1 /* link_uniform_initializers.cpp in Sources */, 2B3A6BA815FA0494000DCBE1 /* lower_clip_distance.cpp in Sources */, + 2B39E41819E959F9001C6A17 /* ralloc.c in Sources */, 2B3A6BA915FA0494000DCBE1 /* lower_discard_flow.cpp in Sources */, 2B3A6BAA15FA0494000DCBE1 /* lower_output_reads.cpp in Sources */, 2B3A6BAC15FA0494000DCBE1 /* lower_ubo_reference.cpp in Sources */, 2B3A6BAD15FA0494000DCBE1 /* opt_array_splitting.cpp in Sources */, 2B3A6BDA15FA08E1000DCBE1 /* ir_builder.cpp in Sources */, + 2B39E41519E959F9001C6A17 /* hash_table.c in Sources */, 2BBD9DAD1719694100515007 /* ast_array_index.cpp in Sources */, 2BBD9DAF1719694100515007 /* link_uniform_block_active_visitor.cpp in Sources */, 2BBD9DB21719694100515007 /* link_uniform_blocks.cpp in Sources */, @@ -748,7 +793,6 @@ 2BBD9DBC1719698C00515007 /* lower_packed_varyings.cpp in Sources */, 2BBD9DBE1719698C00515007 /* lower_packing_builtins.cpp in Sources */, 2BBD9DC01719698C00515007 /* opt_flatten_nested_if_blocks.cpp in Sources */, - 2BBD9DC4171969F700515007 /* hash_table.c in Sources */, 2BBD9DC817196A3B00515007 /* imports.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -793,6 +837,7 @@ HEADER_SEARCH_PATHS = ( ../../include, ../../src/mesa, + ../../src, ); MACOSX_DEPLOYMENT_TARGET = 10.6; ONLY_ACTIVE_ARCH = YES; @@ -808,6 +853,7 @@ HEADER_SEARCH_PATHS = ( ../../include, ../../src/mesa, + ../../src, ); MACOSX_DEPLOYMENT_TARGET = 10.6; }; diff --git a/3rdparty/glsl-optimizer/removeDeletedByUs.sh b/3rdparty/glsl-optimizer/removeDeletedByUs.sh index a7c526216..5777114e1 100644 --- a/3rdparty/glsl-optimizer/removeDeletedByUs.sh +++ b/3rdparty/glsl-optimizer/removeDeletedByUs.sh @@ -4,6 +4,7 @@ git rm -rf docs git rm -rf m4 git rm -rf src/egl git rm -rf src/glsl/glcpp/tests +git rm -rf src/loader git rm -rf src/mapi git rm -rf src/mesa/drivers git rm -rf src/mesa/main/tests diff --git a/3rdparty/glsl-optimizer/src/glsl/.gitignore b/3rdparty/glsl-optimizer/src/glsl/.gitignore index d5c2f5a3a..d15b9ec91 100644 --- a/3rdparty/glsl-optimizer/src/glsl/.gitignore +++ b/3rdparty/glsl-optimizer/src/glsl/.gitignore @@ -2,3 +2,7 @@ glsl_compiler glsl_parser.output builtincompiler glsl_test +subtest-cr/ +subtest-lf/ +subtest-cr-lf/ +subtest-lf-cr/ diff --git a/3rdparty/glsl-optimizer/src/glsl/Makefile b/3rdparty/glsl-optimizer/src/glsl/Makefile index 8b5831c98..ccfeb7b3a 100644 --- a/3rdparty/glsl-optimizer/src/glsl/Makefile +++ b/3rdparty/glsl-optimizer/src/glsl/Makefile @@ -2,17 +2,18 @@ CPPFLAGS += -I../talloc \ -I../mesa \ - -I../mapi + -I../mapi \ + -I../../include 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_expr.cpp \ ast_function.cpp \ ast_to_hir.cpp \ ast_type.cpp \ - builtin_function.cpp \ + builtin_functions.cpp \ glsl_lexer.cpp \ glsl_optimizer.cpp \ glsl_parser.cpp \ @@ -22,6 +23,7 @@ SRC = ast_expr.cpp \ hir_field_selection.cpp \ ir.cpp \ ir_basic_block.cpp \ + ir_builder.cpp \ ir_clone.cpp \ ir_constant_expression.cpp \ ir_equals.cpp \ @@ -33,12 +35,12 @@ SRC = ast_expr.cpp \ ir_hv_accept.cpp \ ir_import_prototypes.cpp \ ir_print_glsl_visitor.cpp \ + ir_print_metal_visitor.cpp \ ir_print_visitor.cpp \ - ir_reader.cpp \ ir_rvalue_visitor.cpp \ + ir_stats.cpp \ ir_unused_structs.cpp \ ir_validate.cpp \ - ir_variable.cpp \ ir_variable_refcount.cpp \ link_functions.cpp \ linker.cpp \ @@ -55,17 +57,20 @@ SRC = ast_expr.cpp \ lower_vec_index_to_cond_assign.cpp \ lower_vec_index_to_swizzle.cpp \ lower_vector.cpp \ - main.cpp \ opt_algebraic.cpp \ + opt_array_splitting.cpp \ opt_constant_folding.cpp \ opt_constant_propagation.cpp \ opt_constant_variable.cpp \ opt_copy_propagation.cpp \ opt_copy_propagation_elements.cpp \ + opt_cse.cpp \ + opt_dead_builtin_varyings.cpp \ opt_dead_code.cpp \ opt_dead_code_local.cpp \ opt_dead_functions.cpp \ - opt_discard_simplification.cpp \ + opt_flatten_nested_if_blocks.cpp \ + opt_flip_matrices.cpp \ opt_function_inlining.cpp \ opt_if_simplification.cpp \ opt_noop_swizzle.cpp \ @@ -80,9 +85,10 @@ SRC = ast_expr.cpp \ strtod.c \ glcpp/glcpp-lex.c \ glcpp/glcpp-parse.c \ - glcpp/glcpp.c \ glcpp/pp.c \ - ../mesa/program/hash_table.c \ + ../mesa/main/hash_table.c \ + ../mesa/main/imports.c \ + ../mesa/program/prog_hash_table.c \ ../mesa/program/symbol_table.c diff --git a/3rdparty/glsl-optimizer/src/glsl/SConscript b/3rdparty/glsl-optimizer/src/glsl/SConscript index fe9d50732..847e96246 100644 --- a/3rdparty/glsl-optimizer/src/glsl/SConscript +++ b/3rdparty/glsl-optimizer/src/glsl/SConscript @@ -8,12 +8,15 @@ env = env.Clone() env.Prepend(CPPPATH = [ '#include', + '#src', '#src/mapi', '#src/mesa', '#src/glsl', '#src/glsl/glcpp', ]) +env.Prepend(LIBS = [mesautil]) + # Make glcpp-parse.h and glsl_parser.h reachable from the include path. env.Append(CPPPATH = [Dir('.').abspath, Dir('glcpp').abspath]) @@ -55,7 +58,6 @@ if env['msvc']: # Copy these files to avoid generation object files into src/mesa/program env.Prepend(CPPPATH = ['#src/mesa/main']) -env.Command('hash_table.c', '#src/mesa/main/hash_table.c', Copy('$TARGET', '$SOURCE')) env.Command('imports.c', '#src/mesa/main/imports.c', Copy('$TARGET', '$SOURCE')) # Copy these files to avoid generation object files into src/mesa/program env.Prepend(CPPPATH = ['#src/mesa/program']) @@ -65,7 +67,6 @@ env.Command('symbol_table.c', '#src/mesa/program/symbol_table.c', Copy('$TARGET' compiler_objs = env.StaticObject(source_lists['GLSL_COMPILER_CXX_FILES']) mesa_objs = env.StaticObject([ - 'hash_table.c', 'imports.c', 'prog_hash_table.c', 'symbol_table.c', @@ -106,6 +107,6 @@ env.Alias('glsl_compiler', glsl_compiler) glcpp = env.Program( target = 'glcpp/glcpp', - source = ['glcpp/glcpp.c'] + mesa_objs, + source = ['glcpp/glcpp.c', 'tests/common.c'] + mesa_objs, ) env.Alias('glcpp', glcpp) diff --git a/3rdparty/glsl-optimizer/src/glsl/ast.h b/3rdparty/glsl-optimizer/src/glsl/ast.h index c6f45c008..d28915a03 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ast.h +++ b/3rdparty/glsl-optimizer/src/glsl/ast.h @@ -75,10 +75,10 @@ public: struct YYLTYPE locp; locp.source = this->location.source; - locp.first_line = this->location.line; - locp.first_column = this->location.column; - locp.last_line = locp.first_line; - locp.last_column = locp.first_column; + locp.first_line = this->location.first_line; + locp.first_column = this->location.first_column; + locp.last_line = this->location.last_line; + locp.last_column = this->location.last_column; return locp; } @@ -91,17 +91,35 @@ public: void set_location(const struct YYLTYPE &locp) { this->location.source = locp.source; - this->location.line = locp.first_line; - this->location.column = locp.first_column; + this->location.first_line = locp.first_line; + this->location.first_column = locp.first_column; + this->location.last_line = locp.last_line; + this->location.last_column = locp.last_column; + } + + /** + * Set the source location range of an AST node using two location nodes + * + * \sa ast_node::set_location + */ + void set_location_range(const struct YYLTYPE &begin, const struct YYLTYPE &end) + { + this->location.source = begin.source; + this->location.first_line = begin.first_line; + this->location.last_line = end.last_line; + this->location.first_column = begin.first_column; + this->location.last_column = end.last_column; } /** * Source location of the AST node. */ struct { - unsigned source; /**< GLSL source number. */ - unsigned line; /**< Line number within the source string. */ - unsigned column; /**< Column in the line. */ + unsigned source; /**< GLSL source number. */ + unsigned first_line; /**< First line number within the source string. */ + unsigned first_column; /**< First column in the first line. */ + unsigned last_line; /**< Last line number within the source string. */ + unsigned last_column; /**< Last column in the last line. */ } location; exec_node link; @@ -199,6 +217,13 @@ public: virtual ir_rvalue *hir(exec_list *instructions, struct _mesa_glsl_parse_state *state); + virtual void hir_no_rvalue(exec_list *instructions, + struct _mesa_glsl_parse_state *state); + + ir_rvalue *do_hir(exec_list *instructions, + struct _mesa_glsl_parse_state *state, + bool needs_rvalue); + virtual void print(void) const; enum ast_operators oper; @@ -269,6 +294,9 @@ public: virtual ir_rvalue *hir(exec_list *instructions, struct _mesa_glsl_parse_state *state); + virtual void hir_no_rvalue(exec_list *instructions, + struct _mesa_glsl_parse_state *state); + private: /** * Is this function call actually a constructor? @@ -280,14 +308,14 @@ class ast_array_specifier : public ast_node { public: /** Unsized array specifier ([]) */ explicit ast_array_specifier(const struct YYLTYPE &locp) - : dimension_count(1), is_unsized_array(true) + : is_unsized_array(true) { set_location(locp); } /** Sized array specifier ([dim]) */ ast_array_specifier(const struct YYLTYPE &locp, ast_expression *dim) - : dimension_count(1), is_unsized_array(false) + : is_unsized_array(false) { set_location(locp); array_dimensions.push_tail(&dim->link); @@ -296,14 +324,10 @@ public: void add_dimension(ast_expression *dim) { array_dimensions.push_tail(&dim->link); - dimension_count++; } virtual void print(void) const; - /* Count including sized and unsized dimensions */ - unsigned dimension_count; - /* If true, this means that the array has an unsized outermost dimension. */ bool is_unsized_array; @@ -345,6 +369,9 @@ public: virtual ir_rvalue *hir(exec_list *instructions, struct _mesa_glsl_parse_state *state); + + virtual void hir_no_rvalue(exec_list *instructions, + struct _mesa_glsl_parse_state *state); }; /** @@ -397,6 +424,7 @@ struct ast_type_qualifier { union { struct { unsigned invariant:1; + unsigned precise:1; unsigned constant:1; unsigned attribute:1; unsigned varying:1; @@ -477,6 +505,13 @@ struct ast_type_qualifier { unsigned read_only:1; /**< "readonly" qualifier. */ unsigned write_only:1; /**< "writeonly" qualifier. */ /** \} */ + + /** \name Layout qualifiers for GL_ARB_gpu_shader5 */ + /** \{ */ + unsigned invocations:1; + unsigned stream:1; /**< Has stream value assigned */ + unsigned explicit_stream:1; /**< stream value assigned explicitly by shader code */ + /** \} */ } /** \brief Set of flags, accessed by name. */ q; @@ -488,6 +523,9 @@ struct ast_type_qualifier { /** Precision of the type (highp/medium/lowp). */ unsigned precision:2; + /** Geometry shader invocations for GL_ARB_gpu_shader5. */ + int invocations; + /** * Location specified via GL_ARB_explicit_attrib_location layout * @@ -506,6 +544,9 @@ struct ast_type_qualifier { /** Maximum output vertices in GLSL 1.50 geometry shaders. */ int max_vertices; + /** Stream in GLSL 1.50 geometry shaders. */ + unsigned stream; + /** Input or output primitive type in GLSL 1.50 geometry shaders */ GLenum prim_type; @@ -587,6 +628,12 @@ struct ast_type_qualifier { bool merge_qualifier(YYLTYPE *loc, _mesa_glsl_parse_state *state, ast_type_qualifier q); + + bool merge_in_qualifier(YYLTYPE *loc, + _mesa_glsl_parse_state *state, + ast_type_qualifier q, + ast_node* &node); + }; class ast_declarator_list; @@ -705,13 +752,11 @@ public: exec_list declarations; /** - * Special flag for vertex shader "invariant" declarations. - * - * Vertex shaders can contain "invariant" variable redeclarations that do - * not include a type. For example, "invariant gl_Position;". This flag - * is used to note these cases when no type is specified. + * Flags for redeclarations. In these cases, no type is specified, to + * `type` is allowed to be NULL. In all other cases, this would be an error. */ - int invariant; + int invariant; /** < `invariant` redeclaration */ + int precise; /** < `precise` redeclaration */ }; diff --git a/3rdparty/glsl-optimizer/src/glsl/ast_array_index.cpp b/3rdparty/glsl-optimizer/src/glsl/ast_array_index.cpp index 9d17e098f..b64877b51 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ast_array_index.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ast_array_index.cpp @@ -88,8 +88,14 @@ update_max_array_access(ir_rvalue *ir, unsigned idx, YYLTYPE *loc, unsigned field_index = deref_record->record->type->field_index(deref_record->field); assert(field_index < interface_type->length); - if (idx > deref_var->var->max_ifc_array_access[field_index]) { - deref_var->var->max_ifc_array_access[field_index] = idx; + + unsigned *const max_ifc_array_access = + deref_var->var->get_max_ifc_array_access(); + + assert(max_ifc_array_access != NULL); + + if (idx > max_ifc_array_access[field_index]) { + max_ifc_array_access[field_index] = idx; /* Check whether this access will, as a side effect, implicitly * cause the size of a built-in array to be too large. @@ -181,7 +187,8 @@ _mesa_ast_array_index_to_hir(void *mem_ctx, if (array->type->is_unsized_array()) { _mesa_glsl_error(&loc, state, "unsized array index must be constant"); } else if (array->type->fields.array->is_interface() - && array->variable_referenced()->data.mode == ir_var_uniform) { + && array->variable_referenced()->data.mode == ir_var_uniform + && !state->is_version(400, 0) && !state->ARB_gpu_shader5_enable) { /* Page 46 in section 4.3.7 of the OpenGL ES 3.00 spec says: * * "All indexes used to index a uniform block array must be @@ -212,6 +219,13 @@ _mesa_ast_array_index_to_hir(void *mem_ctx, * as using a loop counter as the index to an array of samplers. If the * loop in unrolled, the code should compile correctly. Instead, emit a * warning. + * + * In GLSL 4.00 / ARB_gpu_shader5, this requirement is relaxed again to allow + * indexing with dynamically uniform expressions. Note that these are not + * required to be uniforms or expressions based on them, but merely that the + * values must not diverge between shader invocations run together. If the + * values *do* diverge, then the behavior of the operation requiring a + * dynamically uniform expression is undefined. */ if (array->type->element_type()->is_sampler()) { if (!state->is_version(130, 100)) { @@ -226,7 +240,7 @@ _mesa_ast_array_index_to_hir(void *mem_ctx, "expressions will be forbidden in GLSL 1.30 " "and later"); } - } else { + } else if (!state->is_version(400, 0) && !state->ARB_gpu_shader5_enable) { _mesa_glsl_error(&loc, state, "sampler arrays indexed with non-constant " "expressions is forbidden in GLSL 1.30 and " diff --git a/3rdparty/glsl-optimizer/src/glsl/ast_function.cpp b/3rdparty/glsl-optimizer/src/glsl/ast_function.cpp index b80307b45..de0ddd0e1 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ast_function.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ast_function.cpp @@ -41,8 +41,7 @@ process_parameters(exec_list *instructions, exec_list *actual_parameters, { unsigned count = 0; - foreach_list (n, parameters) { - ast_node *const ast = exec_node_data(ast_node, n, link); + foreach_list_typed(ast_node, ast, link, parameters) { ir_rvalue *result = ast->hir(instructions, state); ir_constant *const constant = result->constant_expression_value(); @@ -82,9 +81,7 @@ prototype_string(const glsl_type *return_type, const char *name, ralloc_asprintf_append(&str, "%s(", name); const char *comma = ""; - foreach_list(node, parameters) { - const ir_variable *const param = (ir_variable *) node; - + foreach_in_list(const ir_variable, param, parameters) { ralloc_asprintf_append(&str, "%s%s", comma, param->type->name); comma = ", "; } @@ -158,35 +155,35 @@ verify_image_parameter(YYLTYPE *loc, _mesa_glsl_parse_state *state, * qualifiers. [...] It is legal to have additional qualifiers * on a formal parameter, but not to have fewer." */ - if (actual->data.image.coherent && !formal->data.image.coherent) { + if (actual->data.image_coherent && !formal->data.image_coherent) { _mesa_glsl_error(loc, state, "function call parameter `%s' drops " "`coherent' qualifier", formal->name); return false; } - if (actual->data.image._volatile && !formal->data.image._volatile) { + if (actual->data.image_volatile && !formal->data.image_volatile) { _mesa_glsl_error(loc, state, "function call parameter `%s' drops " "`volatile' qualifier", formal->name); return false; } - if (actual->data.image.restrict_flag && !formal->data.image.restrict_flag) { + if (actual->data.image_restrict && !formal->data.image_restrict) { _mesa_glsl_error(loc, state, "function call parameter `%s' drops " "`restrict' qualifier", formal->name); return false; } - if (actual->data.image.read_only && !formal->data.image.read_only) { + if (actual->data.image_read_only && !formal->data.image_read_only) { _mesa_glsl_error(loc, state, "function call parameter `%s' drops " "`readonly' qualifier", formal->name); return false; } - if (actual->data.image.write_only && !formal->data.image.write_only) { + if (actual->data.image_write_only && !formal->data.image_write_only) { _mesa_glsl_error(loc, state, "function call parameter `%s' drops " "`writeonly' qualifier", formal->name); @@ -211,12 +208,11 @@ verify_parameter_modes(_mesa_glsl_parse_state *state, exec_node *actual_ir_node = actual_ir_parameters.head; exec_node *actual_ast_node = actual_ast_parameters.head; - foreach_list(formal_node, &sig->parameters) { + foreach_in_list(const ir_variable, formal, &sig->parameters) { /* The lists must be the same length. */ assert(!actual_ir_node->is_tail_sentinel()); assert(!actual_ast_node->is_tail_sentinel()); - const ir_variable *const formal = (ir_variable *) formal_node; const ir_rvalue *const actual = (ir_rvalue *) actual_ir_node; const ast_expression *const actual_ast = exec_node_data(ast_expression, actual_ast_node, link); @@ -235,6 +231,24 @@ verify_parameter_modes(_mesa_glsl_parse_state *state, return false; } + /* Verify that shader_in parameters are shader inputs */ + if (formal->data.must_be_shader_input) { + ir_variable *var = actual->variable_referenced(); + if (var && var->data.mode != ir_var_shader_in) { + _mesa_glsl_error(&loc, state, + "parameter `%s` must be a shader input", + formal->name); + return false; + } + + if (actual->ir_type == ir_type_swizzle) { + _mesa_glsl_error(&loc, state, + "parameter `%s` must not be swizzled", + formal->name); + return false; + } + } + /* Verify that 'out' and 'inout' actual parameters are lvalues. */ if (formal->data.mode == ir_var_function_out || formal->data.mode == ir_var_function_inout) { @@ -448,14 +462,17 @@ generate_call(exec_list *instructions, ir_function_signature *sig, ir_dereference_variable *deref = NULL; if (!sig->return_type->is_void()) { /* Create a new temporary to hold the return value. */ + char *const name = ir_variable::temporaries_allocate_names + ? ralloc_asprintf(ctx, "%s_retval", sig->function_name()) + : NULL; + ir_variable *var; - var = new(ctx) ir_variable(sig->return_type, - ralloc_asprintf(ctx, "%s_retval", - sig->function_name()), - ir_var_temporary, precision_for_call(sig,actual_parameters)); + var = new(ctx) ir_variable(sig->return_type, name, ir_var_temporary, precision_for_call(sig,actual_parameters)); instructions->push_tail(var); + ralloc_free(name); + deref = new(ctx) ir_dereference_variable(var); } ir_call *call = new(ctx) ir_call(sig, deref, actual_parameters); @@ -490,20 +507,21 @@ match_function_by_name(const char *name, goto done; /* no match */ if (f != NULL) { + /* In desktop GL, the presence of a user-defined signature hides any + * built-in signatures, so we must ignore them. In contrast, in ES2 + * user-defined signatures add new overloads, so we must consider them. + */ + bool allow_builtins = state->es_shader || !f->has_user_signature(); + /* Look for a match in the local shader. If exact, we're done. */ bool is_exact = false; sig = local_sig = f->matching_signature(state, actual_parameters, - &is_exact); + allow_builtins, &is_exact); if (is_exact) goto done; - if (!state->es_shader && f->has_user_signature()) { - /* In desktop GL, the presence of a user-defined signature hides any - * built-in signatures, so we must ignore them. In contrast, in ES2 - * user-defined signatures add new overloads, so we must proceed. - */ + if (!allow_builtins) goto done; - } } /* Local shader has no exact candidates; check the built-ins. */ @@ -532,9 +550,7 @@ print_function_prototypes(_mesa_glsl_parse_state *state, YYLTYPE *loc, if (f == NULL) return; - foreach_list (node, &f->signatures) { - ir_function_signature *sig = (ir_function_signature *) node; - + foreach_in_list(ir_function_signature, sig, &f->signatures) { if (sig->is_builtin() && !sig->is_builtin_available(state)) continue; @@ -744,8 +760,7 @@ process_vec_mat_constructor(exec_list *instructions, bool all_parameters_are_constant = true; /* Type cast each parameter and, if possible, fold constants. */ - foreach_list_safe(n, &actual_parameters) { - ir_rvalue *ir = (ir_rvalue *) n; + foreach_in_list_safe(ir_rvalue, ir, &actual_parameters) { ir_rvalue *result = ir; /* Apply implicit conversions (not the scalar constructor rules!). See @@ -755,7 +770,7 @@ process_vec_mat_constructor(exec_list *instructions, glsl_type::get_instance(GLSL_TYPE_FLOAT, ir->type->vector_elements, ir->type->matrix_columns); - if (result->type->can_implicitly_convert_to(desired_type)) { + if (result->type->can_implicitly_convert_to(desired_type, state)) { /* Even though convert_component() implements the constructor * conversion rules (not the implicit conversion rules), its safe * to use it here because we already checked that the implicit @@ -803,12 +818,22 @@ process_vec_mat_constructor(exec_list *instructions, instructions->push_tail(var); int i = 0; - foreach_list(node, &actual_parameters) { - ir_rvalue *rhs = (ir_rvalue *) node; - ir_rvalue *lhs = new(ctx) ir_dereference_array(var, - new(ctx) ir_constant(i)); - ir_instruction *assignment = new(ctx) ir_assignment(lhs, rhs, NULL); + foreach_in_list(ir_rvalue, rhs, &actual_parameters) { + ir_instruction *assignment = NULL; + + if (var->type->is_matrix()) { + ir_rvalue *lhs = new(ctx) ir_dereference_array(var, + new(ctx) ir_constant(i)); + assignment = new(ctx) ir_assignment(lhs, rhs, NULL); + } else { + /* use writemask rather than index for vector */ + assert(var->type->is_vector()); + assert(i < 4); + ir_dereference *lhs = new(ctx) ir_dereference_variable(var); + assignment = new(ctx) ir_assignment(lhs, rhs, NULL, (unsigned)(1 << i)); + } + instructions->push_tail(assignment); i++; @@ -873,8 +898,7 @@ process_array_constructor(exec_list *instructions, bool all_parameters_are_constant = true; /* Type cast each parameter and, if possible, fold constants. */ - foreach_list_safe(n, &actual_parameters) { - ir_rvalue *ir = (ir_rvalue *) n; + foreach_in_list_safe(ir_rvalue, ir, &actual_parameters) { ir_rvalue *result = ir; /* Apply implicit conversions (not the scalar constructor rules!). See @@ -884,7 +908,7 @@ process_array_constructor(exec_list *instructions, glsl_type::get_instance(GLSL_TYPE_FLOAT, ir->type->vector_elements, ir->type->matrix_columns); - if (result->type->can_implicitly_convert_to(desired_type)) { + if (result->type->can_implicitly_convert_to(desired_type, state)) { /* Even though convert_component() implements the constructor * conversion rules (not the implicit conversion rules), its safe * to use it here because we already checked that the implicit @@ -924,8 +948,7 @@ process_array_constructor(exec_list *instructions, instructions->push_tail(var); int i = 0; - foreach_list(node, &actual_parameters) { - ir_rvalue *rhs = (ir_rvalue *) node; + foreach_in_list(ir_rvalue, rhs, &actual_parameters) { ir_rvalue *lhs = new(ctx) ir_dereference_array(var, new(ctx) ir_constant(i)); @@ -946,8 +969,8 @@ static ir_constant * constant_record_constructor(const glsl_type *constructor_type, exec_list *parameters, void *mem_ctx) { - foreach_list(node, parameters) { - ir_constant *constant = ((ir_instruction *) node)->as_constant(); + foreach_in_list(ir_instruction, node, parameters) { + ir_constant *constant = node->as_constant(); if (constant == NULL) return NULL; node->replace_with(constant); @@ -1022,8 +1045,7 @@ emit_inline_vector_constructor(const glsl_type *type, unsigned ast_precision, memset(&data, 0, sizeof(data)); - foreach_list(node, parameters) { - ir_rvalue *param = (ir_rvalue *) node; + foreach_in_list(ir_rvalue, param, parameters) { var->data.precision = higher_precision ((glsl_precision)var->data.precision, param->get_precision()); unsigned rhs_components = param->type->components(); @@ -1081,8 +1103,7 @@ emit_inline_vector_constructor(const glsl_type *type, unsigned ast_precision, } base_component = 0; - foreach_list(node, parameters) { - ir_rvalue *param = (ir_rvalue *) node; + foreach_in_list(ir_rvalue, param, parameters) { unsigned rhs_components = param->type->components(); /* Do not try to assign more components to the vector than it has! @@ -1368,8 +1389,7 @@ emit_inline_matrix_constructor(const glsl_type *type, int ast_precision, unsigned col_idx = 0; unsigned row_idx = 0; - foreach_list (node, parameters) { - ir_rvalue *const rhs = (ir_rvalue *) node; + foreach_in_list(ir_rvalue, rhs, parameters) { const unsigned components_remaining_this_column = rows - row_idx; unsigned rhs_components = rhs->type->components(); unsigned rhs_base = 0; @@ -1613,10 +1633,10 @@ ast_function_expression::hir(exec_list *instructions, unsigned matrix_parameters = 0; unsigned nonmatrix_parameters = 0; exec_list actual_parameters; + glsl_precision params_precision = glsl_precision_undefined; - foreach_list (n, &this->expressions) { - ast_node *ast = exec_node_data(ast_node, n, link); - ir_rvalue *result = ast->hir(instructions, state)->as_rvalue(); + foreach_list_typed(ast_node, ast, link, &this->expressions) { + ir_rvalue *result = ast->hir(instructions, state); /* From page 50 (page 56 of the PDF) of the GLSL 1.50 spec: * @@ -1646,6 +1666,7 @@ ast_function_expression::hir(exec_list *instructions, nonmatrix_parameters++; actual_parameters.push_tail(result); + params_precision = higher_precision(params_precision, result->get_precision()); components_used += result->type->components(); } @@ -1695,9 +1716,7 @@ ast_function_expression::hir(exec_list *instructions, * need to break them up into a series of column vectors. */ if (constructor_type->base_type != GLSL_TYPE_FLOAT) { - foreach_list_safe(n, &actual_parameters) { - ir_rvalue *matrix = (ir_rvalue *) n; - + foreach_in_list_safe(ir_rvalue, matrix, &actual_parameters) { if (!matrix->type->is_matrix()) continue; @@ -1721,9 +1740,7 @@ ast_function_expression::hir(exec_list *instructions, bool all_parameters_are_constant = true; /* Type cast each parameter and, if possible, fold constants.*/ - foreach_list_safe(n, &actual_parameters) { - ir_rvalue *ir = (ir_rvalue *) n; - + foreach_in_list_safe(ir_rvalue, ir, &actual_parameters) { const glsl_type *desired_type = glsl_type::get_instance(constructor_type->base_type, ir->type->vector_elements, @@ -1755,13 +1772,13 @@ ast_function_expression::hir(exec_list *instructions, return dereference_component((ir_rvalue *) actual_parameters.head, 0); } else if (constructor_type->is_vector()) { - return emit_inline_vector_constructor(constructor_type, ast_precision_none, // TODO: type->precision, + return emit_inline_vector_constructor(constructor_type, params_precision, instructions, &actual_parameters, ctx); } else { assert(constructor_type->is_matrix()); - return emit_inline_matrix_constructor(constructor_type, ast_precision_none, // TODO: type->precision, + return emit_inline_matrix_constructor(constructor_type, params_precision, instructions, &actual_parameters, ctx); diff --git a/3rdparty/glsl-optimizer/src/glsl/ast_to_hir.cpp b/3rdparty/glsl-optimizer/src/glsl/ast_to_hir.cpp index c18249b1c..9223557f6 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ast_to_hir.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ast_to_hir.cpp @@ -49,13 +49,15 @@ * parser (and lexer) sources. */ -#include "main/core.h" /* for struct gl_extensions */ #include "glsl_symbol_table.h" #include "glsl_parser_extras.h" #include "ast.h" #include "glsl_types.h" #include "program/hash_table.h" #include "ir.h" +#include "ir_builder.h" + +using namespace ir_builder; static void detect_conflicting_assignments(struct _mesa_glsl_parse_state *state, @@ -121,8 +123,8 @@ _mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state) before_node = (ir_instruction*)before_node->next; } - foreach_list_safe(node, instructions) { - ir_variable *const var = ((ir_instruction *) node)->as_variable(); + foreach_in_list_safe(ir_instruction, node, instructions) { + ir_variable *const var = node->as_variable(); if (var == NULL) continue; @@ -134,6 +136,11 @@ _mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state) instructions->push_head(var); } + /* Figure out if gl_FragCoord is actually used in fragment shader */ + ir_variable *const var = state->symbols->get_variable("gl_FragCoord"); + if (var != NULL) + state->fs_uses_gl_fragcoord = var->data.used; + /* From section 7.1 (Built-In Language Variables) of the GLSL 4.10 spec: * * If multiple shaders using members of a built-in block belonging to @@ -170,6 +177,31 @@ _mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state) } +static ir_expression_operation +get_conversion_operation(const glsl_type *to, const glsl_type *from, + struct _mesa_glsl_parse_state *state) +{ + switch (to->base_type) { + case GLSL_TYPE_FLOAT: + switch (from->base_type) { + case GLSL_TYPE_INT: return ir_unop_i2f; + case GLSL_TYPE_UINT: return ir_unop_u2f; + default: return (ir_expression_operation)0; + } + + case GLSL_TYPE_UINT: + if (!state->is_version(400, 0) && !state->ARB_gpu_shader5_enable) + return (ir_expression_operation)0; + switch (from->base_type) { + case GLSL_TYPE_INT: return ir_unop_i2u; + default: return (ir_expression_operation)0; + } + + default: return (ir_expression_operation)0; + } +} + + /** * If a conversion is available, convert one operand to a different type * @@ -185,15 +217,13 @@ _mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state) */ bool apply_implicit_conversion(const glsl_type *to, ir_rvalue * &from, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { void *ctx = state; if (to->base_type == from->type->base_type) return true; - /* This conversion was added in GLSL 1.20. If the compilation mode is - * GLSL 1.10, the conversion is skipped. - */ + /* Prior to GLSL 1.20, there are no implicit conversions */ if (!state->is_version(120, 0)) return false; @@ -201,43 +231,32 @@ apply_implicit_conversion(const glsl_type *to, ir_rvalue * &from, * * "There are no implicit array or structure conversions. For * example, an array of int cannot be implicitly converted to an - * array of float. There are no implicit conversions between - * signed and unsigned integers." + * array of float. */ - /* FINISHME: The above comment is partially a lie. There is int/uint - * FINISHME: conversion for immediate constants. - */ - if (!to->is_float() || !from->type->is_numeric()) + if (!to->is_numeric() || !from->type->is_numeric()) return false; - /* Convert to a floating point type with the same number of components - * as the original type - i.e. int to float, not int to vec4. + /* We don't actually want the specific type `to`, we want a type + * with the same base type as `to`, but the same vector width as + * `from`. */ - to = glsl_type::get_instance(GLSL_TYPE_FLOAT, from->type->vector_elements, - from->type->matrix_columns); + to = glsl_type::get_instance(to->base_type, from->type->vector_elements, + from->type->matrix_columns); - switch (from->type->base_type) { - case GLSL_TYPE_INT: - from = new(ctx) ir_expression(ir_unop_i2f, to, from, NULL); - break; - case GLSL_TYPE_UINT: - from = new(ctx) ir_expression(ir_unop_u2f, to, from, NULL); - break; - case GLSL_TYPE_BOOL: - from = new(ctx) ir_expression(ir_unop_b2f, to, from, NULL); - break; - default: - assert(0); + ir_expression_operation op = get_conversion_operation(to, from->type, state); + if (op) { + from = new(ctx) ir_expression(op, to, from, NULL); + return true; + } else { + return false; } - - return true; } static const struct glsl_type * arithmetic_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, - bool multiply, - struct _mesa_glsl_parse_state *state, YYLTYPE *loc) + bool multiply, + struct _mesa_glsl_parse_state *state, YYLTYPE *loc) { const glsl_type *type_a = value_a->type; const glsl_type *type_b = value_b->type; @@ -250,7 +269,7 @@ arithmetic_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, */ if (!type_a->is_numeric() || !type_b->is_numeric()) { _mesa_glsl_error(loc, state, - "operands to arithmetic operators must be numeric"); + "operands to arithmetic operators must be numeric"); return glsl_type::error_type; } @@ -262,8 +281,8 @@ arithmetic_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, if (!apply_implicit_conversion(type_a, value_b, state) && !apply_implicit_conversion(type_b, value_a, state)) { _mesa_glsl_error(loc, state, - "could not implicitly convert operands to " - "arithmetic operator"); + "could not implicitly convert operands to " + "arithmetic operator"); return glsl_type::error_type; } type_a = value_a->type; @@ -280,7 +299,7 @@ arithmetic_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, */ if (type_a->base_type != type_b->base_type) { _mesa_glsl_error(loc, state, - "base type mismatch for arithmetic operator"); + "base type mismatch for arithmetic operator"); return glsl_type::error_type; } @@ -302,7 +321,7 @@ arithmetic_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, */ if (type_a->is_scalar()) { if (!type_b->is_scalar()) - return type_b; + return type_b; } else if (type_b->is_scalar()) { return type_a; } @@ -320,11 +339,11 @@ arithmetic_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, */ if (type_a->is_vector() && type_b->is_vector()) { if (type_a == type_b) { - return type_a; + return type_a; } else { - _mesa_glsl_error(loc, state, - "vector size mismatch for arithmetic operator"); - return glsl_type::error_type; + _mesa_glsl_error(loc, state, + "vector size mismatch for arithmetic operator"); + return glsl_type::error_type; } } @@ -355,64 +374,64 @@ arithmetic_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, */ if (! multiply) { if (type_a == type_b) - return type_a; + return type_a; } else { if (type_a->is_matrix() && type_b->is_matrix()) { - /* Matrix multiply. The columns of A must match the rows of B. Given - * the other previously tested constraints, this means the vector type - * of a row from A must be the same as the vector type of a column from - * B. - */ - if (type_a->row_type() == type_b->column_type()) { - /* The resulting matrix has the number of columns of matrix B and - * the number of rows of matrix A. We get the row count of A by - * looking at the size of a vector that makes up a column. The - * transpose (size of a row) is done for B. - */ - const glsl_type *const type = - glsl_type::get_instance(type_a->base_type, - type_a->column_type()->vector_elements, - type_b->row_type()->vector_elements); - assert(type != glsl_type::error_type); + /* Matrix multiply. The columns of A must match the rows of B. Given + * the other previously tested constraints, this means the vector type + * of a row from A must be the same as the vector type of a column from + * B. + */ + if (type_a->row_type() == type_b->column_type()) { + /* The resulting matrix has the number of columns of matrix B and + * the number of rows of matrix A. We get the row count of A by + * looking at the size of a vector that makes up a column. The + * transpose (size of a row) is done for B. + */ + const glsl_type *const type = + glsl_type::get_instance(type_a->base_type, + type_a->column_type()->vector_elements, + type_b->row_type()->vector_elements); + assert(type != glsl_type::error_type); - return type; - } + return type; + } } else if (type_a->is_matrix()) { - /* A is a matrix and B is a column vector. Columns of A must match - * rows of B. Given the other previously tested constraints, this - * means the vector type of a row from A must be the same as the - * vector the type of B. - */ - if (type_a->row_type() == type_b) { - /* The resulting vector has a number of elements equal to - * the number of rows of matrix A. */ - const glsl_type *const type = - glsl_type::get_instance(type_a->base_type, - type_a->column_type()->vector_elements, - 1); - assert(type != glsl_type::error_type); + /* A is a matrix and B is a column vector. Columns of A must match + * rows of B. Given the other previously tested constraints, this + * means the vector type of a row from A must be the same as the + * vector the type of B. + */ + if (type_a->row_type() == type_b) { + /* The resulting vector has a number of elements equal to + * the number of rows of matrix A. */ + const glsl_type *const type = + glsl_type::get_instance(type_a->base_type, + type_a->column_type()->vector_elements, + 1); + assert(type != glsl_type::error_type); - return type; - } + return type; + } } else { - assert(type_b->is_matrix()); + assert(type_b->is_matrix()); - /* A is a row vector and B is a matrix. Columns of A must match rows - * of B. Given the other previously tested constraints, this means - * the type of A must be the same as the vector type of a column from - * B. - */ - if (type_a == type_b->column_type()) { - /* The resulting vector has a number of elements equal to - * the number of columns of matrix B. */ - const glsl_type *const type = - glsl_type::get_instance(type_a->base_type, - type_b->row_type()->vector_elements, - 1); - assert(type != glsl_type::error_type); + /* A is a row vector and B is a matrix. Columns of A must match rows + * of B. Given the other previously tested constraints, this means + * the type of A must be the same as the vector type of a column from + * B. + */ + if (type_a == type_b->column_type()) { + /* The resulting vector has a number of elements equal to + * the number of columns of matrix B. */ + const glsl_type *const type = + glsl_type::get_instance(type_a->base_type, + type_b->row_type()->vector_elements, + 1); + assert(type != glsl_type::error_type); - return type; - } + return type; + } } _mesa_glsl_error(loc, state, "size mismatch for matrix multiplication"); @@ -429,7 +448,7 @@ arithmetic_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, static const struct glsl_type * unary_arithmetic_result_type(const struct glsl_type *type, - struct _mesa_glsl_parse_state *state, YYLTYPE *loc) + struct _mesa_glsl_parse_state *state, YYLTYPE *loc) { /* From GLSL 1.50 spec, page 57: * @@ -441,7 +460,7 @@ unary_arithmetic_result_type(const struct glsl_type *type, */ if (!type->is_numeric()) { _mesa_glsl_error(loc, state, - "operands to arithmetic operators must be numeric"); + "operands to arithmetic operators must be numeric"); return glsl_type::error_type; } @@ -515,8 +534,8 @@ bit_logic_result_type(const struct glsl_type *type_a, static const struct glsl_type * modulus_result_type(const struct glsl_type *type_a, - const struct glsl_type *type_b, - struct _mesa_glsl_parse_state *state, YYLTYPE *loc) + const struct glsl_type *type_b, + struct _mesa_glsl_parse_state *state, YYLTYPE *loc) { if (!state->check_version(130, 300, loc, "operator '%%' is reserved")) { return glsl_type::error_type; @@ -537,7 +556,7 @@ modulus_result_type(const struct glsl_type *type_a, } if (type_a->base_type != type_b->base_type) { _mesa_glsl_error(loc, state, - "operands of %% must have the same base type"); + "operands of %% must have the same base type"); return glsl_type::error_type; } @@ -548,8 +567,8 @@ modulus_result_type(const struct glsl_type *type_a, */ if (type_a->is_vector()) { if (!type_b->is_vector() - || (type_a->vector_elements == type_b->vector_elements)) - return type_a; + || (type_a->vector_elements == type_b->vector_elements)) + return type_a; } else return type_b; @@ -563,7 +582,7 @@ modulus_result_type(const struct glsl_type *type_a, static const struct glsl_type * relational_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, - struct _mesa_glsl_parse_state *state, YYLTYPE *loc) + struct _mesa_glsl_parse_state *state, YYLTYPE *loc) { const glsl_type *type_a = value_a->type; const glsl_type *type_b = value_b->type; @@ -578,8 +597,8 @@ relational_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, || !type_a->is_scalar() || !type_b->is_scalar()) { _mesa_glsl_error(loc, state, - "operands to relational operators must be scalar and " - "numeric"); + "operands to relational operators must be scalar and " + "numeric"); return glsl_type::error_type; } @@ -590,8 +609,8 @@ relational_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, if (!apply_implicit_conversion(type_a, value_b, state) && !apply_implicit_conversion(type_b, value_a, state)) { _mesa_glsl_error(loc, state, - "could not implicitly convert operands to " - "relational operator"); + "could not implicitly convert operands to " + "relational operator"); return glsl_type::error_type; } type_a = value_a->type; @@ -634,13 +653,13 @@ shift_result_type(const struct glsl_type *type_a, */ if (!type_a->is_integer()) { _mesa_glsl_error(loc, state, "LHS of operator %s must be an integer or " - "integer vector", ast_expression::operator_string(op)); + "integer vector", ast_expression::operator_string(op)); return glsl_type::error_type; } if (!type_b->is_integer()) { _mesa_glsl_error(loc, state, "RHS of operator %s must be an integer or " - "integer vector", ast_expression::operator_string(op)); + "integer vector", ast_expression::operator_string(op)); return glsl_type::error_type; } @@ -649,8 +668,8 @@ shift_result_type(const struct glsl_type *type_a, */ if (type_a->is_scalar() && !type_b->is_scalar()) { _mesa_glsl_error(loc, state, "if the first operand of %s is scalar, the " - "second must be scalar as well", - ast_expression::operator_string(op)); + "second must be scalar as well", + ast_expression::operator_string(op)); return glsl_type::error_type; } @@ -661,8 +680,8 @@ shift_result_type(const struct glsl_type *type_a, type_b->is_vector() && type_a->vector_elements != type_b->vector_elements) { _mesa_glsl_error(loc, state, "vector operands to operator %s must " - "have same number of elements", - ast_expression::operator_string(op)); + "have same number of elements", + ast_expression::operator_string(op)); return glsl_type::error_type; } @@ -747,11 +766,13 @@ mark_whole_array_access(ir_rvalue *access) } } -ir_rvalue * +static bool do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, - const char *non_lvalue_description, - ir_rvalue *lhs, ir_rvalue *rhs, bool is_initializer, - YYLTYPE lhs_loc) + const char *non_lvalue_description, + ir_rvalue *lhs, ir_rvalue *rhs, + ir_rvalue **out_rvalue, bool needs_rvalue, + bool is_initializer, + YYLTYPE lhs_loc) { void *ctx = state; bool error_emitted = (lhs->type->is_error() || rhs->type->is_error()); @@ -801,30 +822,28 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, if (non_lvalue_description != NULL) { _mesa_glsl_error(&lhs_loc, state, "assignment to %s", - non_lvalue_description); - error_emitted = true; - } else if (lhs->variable_referenced() != NULL - && lhs->variable_referenced()->data.read_only) { + non_lvalue_description); + error_emitted = true; + } else if (lhs_var != NULL && lhs_var->data.read_only) { _mesa_glsl_error(&lhs_loc, state, "assignment to read-only variable '%s'", - lhs->variable_referenced()->name); + lhs_var->name); error_emitted = true; - } else if (lhs->type->is_array() && !state->check_version(120, 300, &lhs_loc, "whole array assignment forbidden")) { - /* From page 32 (page 38 of the PDF) of the GLSL 1.10 spec: - * - * "Other binary or unary expressions, non-dereferenced - * arrays, function names, swizzles with repeated fields, - * and constants cannot be l-values." + /* From page 32 (page 38 of the PDF) of the GLSL 1.10 spec: + * + * "Other binary or unary expressions, non-dereferenced + * arrays, function names, swizzles with repeated fields, + * and constants cannot be l-values." * * The restriction on arrays is lifted in GLSL 1.20 and GLSL ES 3.00. - */ - error_emitted = true; + */ + error_emitted = true; } else if (!lhs->is_lvalue()) { - _mesa_glsl_error(& lhs_loc, state, "non-lvalue in assignment"); - error_emitted = true; + _mesa_glsl_error(& lhs_loc, state, "non-lvalue in assignment"); + error_emitted = true; } } @@ -839,24 +858,24 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, * is either not an l-value or not a whole array. */ if (lhs->type->is_unsized_array()) { - ir_dereference *const d = lhs->as_dereference(); + ir_dereference *const d = lhs->as_dereference(); - assert(d != NULL); + assert(d != NULL); - ir_variable *const var = d->variable_referenced(); + ir_variable *const var = d->variable_referenced(); - assert(var != NULL); + assert(var != NULL); - if (var->data.max_array_access >= unsigned(rhs->type->array_size())) { - /* FINISHME: This should actually log the location of the RHS. */ - _mesa_glsl_error(& lhs_loc, state, "array size must be > %u due to " - "previous access", - var->data.max_array_access); - } + if (var->data.max_array_access >= unsigned(rhs->type->array_size())) { + /* FINISHME: This should actually log the location of the RHS. */ + _mesa_glsl_error(& lhs_loc, state, "array size must be > %u due to " + "previous access", + var->data.max_array_access); + } - var->type = glsl_type::get_array_instance(lhs->type->element_type(), - rhs->type->array_size()); - d->type = var->type; + var->type = glsl_type::get_array_instance(lhs->type->element_type(), + rhs->type->array_size()); + d->type = var->type; } if (lhs->type->is_array()) { mark_whole_array_access(rhs); @@ -881,27 +900,33 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, * to handle things like: * * i = j += 1; - * - * So we always just store the computed value being assigned to a - * temporary and return a deref of that temporary. If the rvalue - * ends up not being used, the temp will get copy-propagated out. */ - ir_variable *var = new(ctx) ir_variable(rhs->type, "assignment_tmp", - ir_var_temporary, precision_from_ir(rhs)); - ir_dereference_variable *deref_var = new(ctx) ir_dereference_variable(var); - instructions->push_tail(var); - instructions->push_tail(new(ctx) ir_assignment(deref_var, rhs)); - deref_var = new(ctx) ir_dereference_variable(var); + if (needs_rvalue) { + ir_variable *var = new(ctx) ir_variable(rhs->type, "assignment_tmp", + ir_var_temporary, precision_from_ir(rhs)); + instructions->push_tail(var); + instructions->push_tail(assign(var, rhs)); - if (!error_emitted) - instructions->push_tail(new(ctx) ir_assignment(lhs, deref_var)); + if (!error_emitted) { + ir_dereference_variable *deref_var = new(ctx) ir_dereference_variable(var); + instructions->push_tail(new(ctx) ir_assignment(lhs, deref_var)); + } + ir_rvalue *rvalue = new(ctx) ir_dereference_variable(var); - if (extract_channel) { - return new(ctx) ir_expression(ir_binop_vector_extract, - new(ctx) ir_dereference_variable(var), - extract_channel->clone(ctx, NULL)); + if (extract_channel) { + rvalue = new(ctx) ir_expression(ir_binop_vector_extract, + rvalue, + extract_channel->clone(ctx, NULL)); + } + + *out_rvalue = rvalue; + } else { + if (!error_emitted) + instructions->push_tail(new(ctx) ir_assignment(lhs, rhs)); + *out_rvalue = NULL; } - return new(ctx) ir_dereference_variable(var); + + return error_emitted; } static ir_rvalue * @@ -913,7 +938,6 @@ get_lvalue_copy(exec_list *instructions, ir_rvalue *lvalue) var = new(ctx) ir_variable(lvalue->type, "_post_incdec_tmp", ir_var_temporary, precision_from_ir(lvalue)); instructions->push_tail(var); - var->data.mode = ir_var_auto; instructions->push_tail(new(ctx) ir_assignment(new(ctx) ir_dereference_variable(var), lvalue)); @@ -923,8 +947,7 @@ get_lvalue_copy(exec_list *instructions, ir_rvalue *lvalue) ir_rvalue * -ast_node::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) +ast_node::hir(exec_list *instructions, struct _mesa_glsl_parse_state *state) { (void) instructions; (void) state; @@ -932,6 +955,20 @@ ast_node::hir(exec_list *instructions, return NULL; } +void +ast_function_expression::hir_no_rvalue(exec_list *instructions, + struct _mesa_glsl_parse_state *state) +{ + (void)hir(instructions, state); +} + +void +ast_aggregate_initializer::hir_no_rvalue(exec_list *instructions, + struct _mesa_glsl_parse_state *state) +{ + (void)hir(instructions, state); +} + static ir_rvalue * do_comparison(void *mem_ctx, int operation, ir_rvalue *op0, ir_rvalue *op1) { @@ -952,19 +989,19 @@ do_comparison(void *mem_ctx, int operation, ir_rvalue *op0, ir_rvalue *op1) case GLSL_TYPE_ARRAY: { for (unsigned int i = 0; i < op0->type->length; i++) { - ir_rvalue *e0, *e1, *result; + ir_rvalue *e0, *e1, *result; - e0 = new(mem_ctx) ir_dereference_array(op0->clone(mem_ctx, NULL), - new(mem_ctx) ir_constant(i)); - e1 = new(mem_ctx) ir_dereference_array(op1->clone(mem_ctx, NULL), - new(mem_ctx) ir_constant(i)); - result = do_comparison(mem_ctx, operation, e0, e1); + e0 = new(mem_ctx) ir_dereference_array(op0->clone(mem_ctx, NULL), + new(mem_ctx) ir_constant(i)); + e1 = new(mem_ctx) ir_dereference_array(op1->clone(mem_ctx, NULL), + new(mem_ctx) ir_constant(i)); + result = do_comparison(mem_ctx, operation, e0, e1); - if (cmp) { - cmp = new(mem_ctx) ir_expression(join_op, cmp, result); - } else { - cmp = result; - } + if (cmp) { + cmp = new(mem_ctx) ir_expression(join_op, cmp, result); + } else { + cmp = result; + } } mark_whole_array_access(op0); @@ -974,20 +1011,20 @@ do_comparison(void *mem_ctx, int operation, ir_rvalue *op0, ir_rvalue *op1) case GLSL_TYPE_STRUCT: { for (unsigned int i = 0; i < op0->type->length; i++) { - ir_rvalue *e0, *e1, *result; - const char *field_name = op0->type->fields.structure[i].name; + ir_rvalue *e0, *e1, *result; + const char *field_name = op0->type->fields.structure[i].name; - e0 = new(mem_ctx) ir_dereference_record(op0->clone(mem_ctx, NULL), - field_name); - e1 = new(mem_ctx) ir_dereference_record(op1->clone(mem_ctx, NULL), - field_name); - result = do_comparison(mem_ctx, operation, e0, e1); + e0 = new(mem_ctx) ir_dereference_record(op0->clone(mem_ctx, NULL), + field_name); + e1 = new(mem_ctx) ir_dereference_record(op1->clone(mem_ctx, NULL), + field_name); + result = do_comparison(mem_ctx, operation, e0, e1); - if (cmp) { - cmp = new(mem_ctx) ir_expression(join_op, cmp, result); - } else { - cmp = result; - } + if (cmp) { + cmp = new(mem_ctx) ir_expression(join_op, cmp, result); + } else { + cmp = result; + } } break; } @@ -1032,8 +1069,8 @@ get_scalar_boolean_operand(exec_list *instructions, if (!*error_emitted) { YYLTYPE loc = expr->get_location(); _mesa_glsl_error(&loc, state, "%s of `%s' must be scalar boolean", - operand_name, - parent_expr->operator_string(parent_expr->oper)); + operand_name, + parent_expr->operator_string(parent_expr->oper)); *error_emitted = true; } @@ -1099,7 +1136,22 @@ constant_one_for_inc_dec(void *ctx, const glsl_type *type) ir_rvalue * ast_expression::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) +{ + return do_hir(instructions, state, true); +} + +void +ast_expression::hir_no_rvalue(exec_list *instructions, + struct _mesa_glsl_parse_state *state) +{ + do_hir(instructions, state, false); +} + +ir_rvalue * +ast_expression::do_hir(exec_list *instructions, + struct _mesa_glsl_parse_state *state, + bool needs_rvalue) { void *ctx = state; static const int operations[AST_NUM_OPERATORS] = { @@ -1167,18 +1219,18 @@ ast_expression::hir(exec_list *instructions, switch (this->oper) { case ast_aggregate: - assert(!"ast_aggregate: Should never get here."); - break; + assert(!"ast_aggregate: Should never get here."); + break; case ast_assign: { op[0] = this->subexpressions[0]->hir(instructions, state); op[1] = this->subexpressions[1]->hir(instructions, state); - result = do_assignment(instructions, state, - this->subexpressions[0]->non_lvalue_description, - op[0], op[1], false, - this->subexpressions[0]->get_location()); - error_emitted = result->type->is_error(); + error_emitted = + do_assignment(instructions, state, + this->subexpressions[0]->non_lvalue_description, + op[0], op[1], &result, needs_rvalue, false, + this->subexpressions[0]->get_location()); break; } @@ -1200,7 +1252,7 @@ ast_expression::hir(exec_list *instructions, error_emitted = type->is_error(); result = new(ctx) ir_expression(operations[this->oper], type, - op[0], NULL); + op[0], NULL); break; case ast_add: @@ -1211,12 +1263,12 @@ ast_expression::hir(exec_list *instructions, op[1] = this->subexpressions[1]->hir(instructions, state); type = arithmetic_result_type(op[0], op[1], - (this->oper == ast_mul), - state, & loc); + (this->oper == ast_mul), + state, & loc); error_emitted = type->is_error(); result = new(ctx) ir_expression(operations[this->oper], type, - op[0], op[1]); + op[0], op[1]); break; case ast_mod: @@ -1228,7 +1280,7 @@ ast_expression::hir(exec_list *instructions, assert(operations[this->oper] == ir_binop_mod); result = new(ctx) ir_expression(operations[this->oper], type, - op[0], op[1]); + op[0], op[1]); error_emitted = type->is_error(); break; @@ -1264,7 +1316,7 @@ ast_expression::hir(exec_list *instructions, && type->is_scalar())); result = new(ctx) ir_expression(operations[this->oper], type, - op[0], op[1]); + op[0], op[1]); error_emitted = type->is_error(); break; @@ -1283,15 +1335,15 @@ ast_expression::hir(exec_list *instructions, * case this conversion is done." */ if ((!apply_implicit_conversion(op[0]->type, op[1], state) - && !apply_implicit_conversion(op[1]->type, op[0], state)) - || (op[0]->type != op[1]->type)) { - _mesa_glsl_error(& loc, state, "operands of `%s' must have the same " - "type", (this->oper == ast_equal) ? "==" : "!="); - error_emitted = true; + && !apply_implicit_conversion(op[1]->type, op[0], state)) + || (op[0]->type != op[1]->type)) { + _mesa_glsl_error(& loc, state, "operands of `%s' must have the same " + "type", (this->oper == ast_equal) ? "==" : "!="); + error_emitted = true; } else if ((op[0]->type->is_array() || op[1]->type->is_array()) && !state->check_version(120, 300, &loc, "array comparisons forbidden")) { - error_emitted = true; + error_emitted = true; } else if ((op[0]->type->contains_opaque() || op[1]->type->contains_opaque())) { _mesa_glsl_error(&loc, state, "opaque type comparisons forbidden"); @@ -1299,10 +1351,10 @@ ast_expression::hir(exec_list *instructions, } if (error_emitted) { - result = new(ctx) ir_constant(false); + result = new(ctx) ir_constant(false); } else { - result = do_comparison(ctx, operations[this->oper], op[0], op[1]); - assert(result->type == glsl_type::bool_type); + result = do_comparison(ctx, operations[this->oper], op[0], op[1]); + assert(result->type == glsl_type::bool_type); } break; @@ -1315,7 +1367,7 @@ ast_expression::hir(exec_list *instructions, type = bit_logic_result_type(op[0]->type, op[1]->type, this->oper, state, &loc); result = new(ctx) ir_expression(operations[this->oper], type, - op[0], op[1]); + op[0], op[1]); error_emitted = op[0]->type->is_error() || op[1]->type->is_error(); break; @@ -1323,12 +1375,12 @@ ast_expression::hir(exec_list *instructions, op[0] = this->subexpressions[0]->hir(instructions, state); if (!state->check_bitwise_operations_allowed(&loc)) { - error_emitted = true; + error_emitted = true; } if (!op[0]->type->is_integer()) { - _mesa_glsl_error(&loc, state, "operand of `~' must be an integer"); - error_emitted = true; + _mesa_glsl_error(&loc, state, "operand of `~' must be an integer"); + error_emitted = true; } type = error_emitted ? glsl_type::error_type : op[0]->type; @@ -1338,35 +1390,35 @@ ast_expression::hir(exec_list *instructions, case ast_logic_and: { exec_list rhs_instructions; op[0] = get_scalar_boolean_operand(instructions, state, this, 0, - "LHS", &error_emitted); + "LHS", &error_emitted); op[1] = get_scalar_boolean_operand(&rhs_instructions, state, this, 1, - "RHS", &error_emitted); + "RHS", &error_emitted); if (rhs_instructions.is_empty()) { - result = new(ctx) ir_expression(ir_binop_logic_and, op[0], op[1]); - type = result->type; + result = new(ctx) ir_expression(ir_binop_logic_and, op[0], op[1]); + type = result->type; } else { - ir_variable *const tmp = new(ctx) ir_variable(glsl_type::bool_type, - "and_tmp", - ir_var_temporary, glsl_precision_low); - instructions->push_tail(tmp); + ir_variable *const tmp = new(ctx) ir_variable(glsl_type::bool_type, + "and_tmp", + ir_var_temporary, glsl_precision_low); + instructions->push_tail(tmp); - ir_if *const stmt = new(ctx) ir_if(op[0]); - instructions->push_tail(stmt); + ir_if *const stmt = new(ctx) ir_if(op[0]); + instructions->push_tail(stmt); - stmt->then_instructions.append_list(&rhs_instructions); - ir_dereference *const then_deref = new(ctx) ir_dereference_variable(tmp); - ir_assignment *const then_assign = - new(ctx) ir_assignment(then_deref, op[1]); - stmt->then_instructions.push_tail(then_assign); + stmt->then_instructions.append_list(&rhs_instructions); + ir_dereference *const then_deref = new(ctx) ir_dereference_variable(tmp); + ir_assignment *const then_assign = + new(ctx) ir_assignment(then_deref, op[1]); + stmt->then_instructions.push_tail(then_assign); - ir_dereference *const else_deref = new(ctx) ir_dereference_variable(tmp); - ir_assignment *const else_assign = - new(ctx) ir_assignment(else_deref, new(ctx) ir_constant(false)); - stmt->else_instructions.push_tail(else_assign); + ir_dereference *const else_deref = new(ctx) ir_dereference_variable(tmp); + ir_assignment *const else_assign = + new(ctx) ir_assignment(else_deref, new(ctx) ir_constant(false)); + stmt->else_instructions.push_tail(else_assign); - result = new(ctx) ir_dereference_variable(tmp); - type = tmp->type; + result = new(ctx) ir_dereference_variable(tmp); + type = tmp->type; } break; } @@ -1374,35 +1426,35 @@ ast_expression::hir(exec_list *instructions, case ast_logic_or: { exec_list rhs_instructions; op[0] = get_scalar_boolean_operand(instructions, state, this, 0, - "LHS", &error_emitted); + "LHS", &error_emitted); op[1] = get_scalar_boolean_operand(&rhs_instructions, state, this, 1, - "RHS", &error_emitted); + "RHS", &error_emitted); if (rhs_instructions.is_empty()) { - result = new(ctx) ir_expression(ir_binop_logic_or, op[0], op[1]); - type = result->type; + result = new(ctx) ir_expression(ir_binop_logic_or, op[0], op[1]); + type = result->type; } else { - ir_variable *const tmp = new(ctx) ir_variable(glsl_type::bool_type, - "or_tmp", - ir_var_temporary, glsl_precision_low); - instructions->push_tail(tmp); + ir_variable *const tmp = new(ctx) ir_variable(glsl_type::bool_type, + "or_tmp", + ir_var_temporary, glsl_precision_low); + instructions->push_tail(tmp); - ir_if *const stmt = new(ctx) ir_if(op[0]); - instructions->push_tail(stmt); + ir_if *const stmt = new(ctx) ir_if(op[0]); + instructions->push_tail(stmt); - ir_dereference *const then_deref = new(ctx) ir_dereference_variable(tmp); - ir_assignment *const then_assign = - new(ctx) ir_assignment(then_deref, new(ctx) ir_constant(true)); - stmt->then_instructions.push_tail(then_assign); + ir_dereference *const then_deref = new(ctx) ir_dereference_variable(tmp); + ir_assignment *const then_assign = + new(ctx) ir_assignment(then_deref, new(ctx) ir_constant(true)); + stmt->then_instructions.push_tail(then_assign); - stmt->else_instructions.append_list(&rhs_instructions); - ir_dereference *const else_deref = new(ctx) ir_dereference_variable(tmp); - ir_assignment *const else_assign = - new(ctx) ir_assignment(else_deref, op[1]); - stmt->else_instructions.push_tail(else_assign); + stmt->else_instructions.append_list(&rhs_instructions); + ir_dereference *const else_deref = new(ctx) ir_dereference_variable(tmp); + ir_assignment *const else_assign = + new(ctx) ir_assignment(else_deref, op[1]); + stmt->else_instructions.push_tail(else_assign); - result = new(ctx) ir_dereference_variable(tmp); - type = tmp->type; + result = new(ctx) ir_dereference_variable(tmp); + type = tmp->type; } break; } @@ -1415,20 +1467,20 @@ ast_expression::hir(exec_list *instructions, * expressions and result in a Boolean expression." */ op[0] = get_scalar_boolean_operand(instructions, state, this, 0, "LHS", - &error_emitted); + &error_emitted); op[1] = get_scalar_boolean_operand(instructions, state, this, 1, "RHS", - &error_emitted); + &error_emitted); result = new(ctx) ir_expression(operations[this->oper], glsl_type::bool_type, - op[0], op[1]); + op[0], op[1]); break; case ast_logic_not: op[0] = get_scalar_boolean_operand(instructions, state, this, 0, - "operand", &error_emitted); + "operand", &error_emitted); result = new(ctx) ir_expression(operations[this->oper], glsl_type::bool_type, - op[0], NULL); + op[0], NULL); break; case ast_mul_assign: @@ -1439,17 +1491,18 @@ ast_expression::hir(exec_list *instructions, op[1] = this->subexpressions[1]->hir(instructions, state); type = arithmetic_result_type(op[0], op[1], - (this->oper == ast_mul_assign), - state, & loc); + (this->oper == ast_mul_assign), + state, & loc); ir_rvalue *temp_rhs = new(ctx) ir_expression(operations[this->oper], type, - op[0], op[1]); + op[0], op[1]); - result = do_assignment(instructions, state, - this->subexpressions[0]->non_lvalue_description, - op[0]->clone(ctx, NULL), temp_rhs, false, - this->subexpressions[0]->get_location()); - error_emitted = (op[0]->type->is_error()); + error_emitted = + do_assignment(instructions, state, + this->subexpressions[0]->non_lvalue_description, + op[0]->clone(ctx, NULL), temp_rhs, + &result, needs_rvalue, false, + this->subexpressions[0]->get_location()); /* GLSL 1.10 does not allow array assignment. However, we don't have to * explicitly test for this because none of the binary expression @@ -1469,13 +1522,14 @@ ast_expression::hir(exec_list *instructions, ir_rvalue *temp_rhs; temp_rhs = new(ctx) ir_expression(operations[this->oper], type, - op[0], op[1]); + op[0], op[1]); - result = do_assignment(instructions, state, - this->subexpressions[0]->non_lvalue_description, - op[0]->clone(ctx, NULL), temp_rhs, false, - this->subexpressions[0]->get_location()); - error_emitted = type->is_error(); + error_emitted = + do_assignment(instructions, state, + this->subexpressions[0]->non_lvalue_description, + op[0]->clone(ctx, NULL), temp_rhs, + &result, needs_rvalue, false, + this->subexpressions[0]->get_location()); break; } @@ -1487,11 +1541,12 @@ ast_expression::hir(exec_list *instructions, &loc); ir_rvalue *temp_rhs = new(ctx) ir_expression(operations[this->oper], type, op[0], op[1]); - result = do_assignment(instructions, state, - this->subexpressions[0]->non_lvalue_description, - op[0]->clone(ctx, NULL), temp_rhs, false, - this->subexpressions[0]->get_location()); - error_emitted = op[0]->type->is_error() || op[1]->type->is_error(); + error_emitted = + do_assignment(instructions, state, + this->subexpressions[0]->non_lvalue_description, + op[0]->clone(ctx, NULL), temp_rhs, + &result, needs_rvalue, false, + this->subexpressions[0]->get_location()); break; } @@ -1504,11 +1559,12 @@ ast_expression::hir(exec_list *instructions, state, &loc); ir_rvalue *temp_rhs = new(ctx) ir_expression(operations[this->oper], type, op[0], op[1]); - result = do_assignment(instructions, state, - this->subexpressions[0]->non_lvalue_description, - op[0]->clone(ctx, NULL), temp_rhs, false, - this->subexpressions[0]->get_location()); - error_emitted = op[0]->type->is_error() || op[1]->type->is_error(); + error_emitted = + do_assignment(instructions, state, + this->subexpressions[0]->non_lvalue_description, + op[0]->clone(ctx, NULL), temp_rhs, + &result, needs_rvalue, false, + this->subexpressions[0]->get_location()); break; } @@ -1520,7 +1576,7 @@ ast_expression::hir(exec_list *instructions, * first expression, which must result in a scalar Boolean." */ op[0] = get_scalar_boolean_operand(instructions, state, this, 0, - "condition", &error_emitted); + "condition", &error_emitted); /* The :? operator is implemented by generating an anonymous temporary * followed by an if-statement. The last instruction in each branch of @@ -1543,16 +1599,16 @@ ast_expression::hir(exec_list *instructions, * expression." */ if ((!apply_implicit_conversion(op[1]->type, op[2], state) - && !apply_implicit_conversion(op[2]->type, op[1], state)) - || (op[1]->type != op[2]->type)) { - YYLTYPE loc = this->subexpressions[1]->get_location(); + && !apply_implicit_conversion(op[2]->type, op[1], state)) + || (op[1]->type != op[2]->type)) { + YYLTYPE loc = this->subexpressions[1]->get_location(); - _mesa_glsl_error(& loc, state, "second and third operands of ?: " - "operator must have matching types"); - error_emitted = true; - type = glsl_type::error_type; + _mesa_glsl_error(& loc, state, "second and third operands of ?: " + "operator must have matching types"); + error_emitted = true; + type = glsl_type::error_type; } else { - type = op[1]->type; + type = op[1]->type; } /* From page 33 (page 39 of the PDF) of the GLSL 1.10 spec: @@ -1564,7 +1620,7 @@ ast_expression::hir(exec_list *instructions, !state->check_version(120, 300, &loc, "second and third operands of ?: operator " "cannot be arrays")) { - error_emitted = true; + error_emitted = true; } ir_constant *cond_val = op[0]->constant_expression_value(); @@ -1572,32 +1628,32 @@ ast_expression::hir(exec_list *instructions, ir_constant *else_val = op[2]->constant_expression_value(); if (then_instructions.is_empty() - && else_instructions.is_empty() - && (cond_val != NULL) && (then_val != NULL) && (else_val != NULL)) { - result = (cond_val->value.b[0]) ? then_val : else_val; + && else_instructions.is_empty() + && (cond_val != NULL) && (then_val != NULL) && (else_val != NULL)) { + result = (cond_val->value.b[0]) ? then_val : else_val; } else { - ir_variable *const tmp = - new(ctx) ir_variable(type, "conditional_tmp", ir_var_temporary, higher_precision(op[1], op[2])); - instructions->push_tail(tmp); + ir_variable *const tmp = + new(ctx) ir_variable(type, "conditional_tmp", ir_var_temporary, higher_precision(op[1], op[2])); + instructions->push_tail(tmp); - ir_if *const stmt = new(ctx) ir_if(op[0]); - instructions->push_tail(stmt); + ir_if *const stmt = new(ctx) ir_if(op[0]); + instructions->push_tail(stmt); - then_instructions.move_nodes_to(& stmt->then_instructions); - ir_dereference *const then_deref = - new(ctx) ir_dereference_variable(tmp); - ir_assignment *const then_assign = - new(ctx) ir_assignment(then_deref, op[1]); - stmt->then_instructions.push_tail(then_assign); + then_instructions.move_nodes_to(& stmt->then_instructions); + ir_dereference *const then_deref = + new(ctx) ir_dereference_variable(tmp); + ir_assignment *const then_assign = + new(ctx) ir_assignment(then_deref, op[1]); + stmt->then_instructions.push_tail(then_assign); - else_instructions.move_nodes_to(& stmt->else_instructions); - ir_dereference *const else_deref = - new(ctx) ir_dereference_variable(tmp); - ir_assignment *const else_assign = - new(ctx) ir_assignment(else_deref, op[2]); - stmt->else_instructions.push_tail(else_assign); + else_instructions.move_nodes_to(& stmt->else_instructions); + ir_dereference *const else_deref = + new(ctx) ir_dereference_variable(tmp); + ir_assignment *const else_assign = + new(ctx) ir_assignment(else_deref, op[2]); + stmt->else_instructions.push_tail(else_assign); - result = new(ctx) ir_dereference_variable(tmp); + result = new(ctx) ir_dereference_variable(tmp); } break; } @@ -1605,7 +1661,7 @@ ast_expression::hir(exec_list *instructions, case ast_pre_inc: case ast_pre_dec: { this->non_lvalue_description = (this->oper == ast_pre_inc) - ? "pre-increment operation" : "pre-decrement operation"; + ? "pre-increment operation" : "pre-decrement operation"; op[0] = this->subexpressions[0]->hir(instructions, state); op[1] = constant_one_for_inc_dec(ctx, op[0]->type); @@ -1614,20 +1670,21 @@ ast_expression::hir(exec_list *instructions, ir_rvalue *temp_rhs; temp_rhs = new(ctx) ir_expression(operations[this->oper], type, - op[0], op[1]); + op[0], op[1]); - result = do_assignment(instructions, state, - this->subexpressions[0]->non_lvalue_description, - op[0]->clone(ctx, NULL), temp_rhs, false, - this->subexpressions[0]->get_location()); - error_emitted = op[0]->type->is_error(); + error_emitted = + do_assignment(instructions, state, + this->subexpressions[0]->non_lvalue_description, + op[0]->clone(ctx, NULL), temp_rhs, + &result, needs_rvalue, false, + this->subexpressions[0]->get_location()); break; } case ast_post_inc: case ast_post_dec: { this->non_lvalue_description = (this->oper == ast_post_inc) - ? "post-increment operation" : "post-decrement operation"; + ? "post-increment operation" : "post-decrement operation"; op[0] = this->subexpressions[0]->hir(instructions, state); op[1] = constant_one_for_inc_dec(ctx, op[0]->type); @@ -1637,19 +1694,21 @@ ast_expression::hir(exec_list *instructions, ir_rvalue *temp_rhs; temp_rhs = new(ctx) ir_expression(operations[this->oper], type, - op[0], op[1]); + op[0], op[1]); /* Get a temporary of a copy of the lvalue before it's modified. * This may get thrown away later. */ result = get_lvalue_copy(instructions, op[0]->clone(ctx, NULL)); - (void)do_assignment(instructions, state, - this->subexpressions[0]->non_lvalue_description, - op[0]->clone(ctx, NULL), temp_rhs, false, - this->subexpressions[0]->get_location()); + ir_rvalue *junk_rvalue; + error_emitted = + do_assignment(instructions, state, + this->subexpressions[0]->non_lvalue_description, + op[0]->clone(ctx, NULL), temp_rhs, + &junk_rvalue, false, false, + this->subexpressions[0]->get_location()); - error_emitted = op[0]->type->is_error(); break; } @@ -1664,10 +1723,10 @@ ast_expression::hir(exec_list *instructions, op[1] = subexpressions[1]->hir(instructions, state); result = _mesa_ast_array_index_to_hir(ctx, state, op[0], op[1], - loc, index_loc); + loc, index_loc); if (result->type->is_error()) - error_emitted = true; + error_emitted = true; break; } @@ -1685,17 +1744,17 @@ ast_expression::hir(exec_list *instructions, * as 'variable_identifier'. */ ir_variable *var = - state->symbols->get_variable(this->primary_expression.identifier); + state->symbols->get_variable(this->primary_expression.identifier); if (var != NULL) { - var->data.used = true; - result = new(ctx) ir_dereference_variable(var); + var->data.used = true; + result = new(ctx) ir_dereference_variable(var); } else { - _mesa_glsl_error(& loc, state, "`%s' undeclared", - this->primary_expression.identifier); + _mesa_glsl_error(& loc, state, "`%s' undeclared", + this->primary_expression.identifier); - result = ir_rvalue::error_value(ctx); - error_emitted = true; + result = ir_rvalue::error_value(ctx); + error_emitted = true; } break; } @@ -1731,37 +1790,37 @@ ast_expression::hir(exec_list *instructions, YYLTYPE previous_operand_loc = loc; foreach_list_typed (ast_node, ast, link, &this->expressions) { - /* If one of the operands of comma operator does not generate any - * code, we want to emit a warning. At each pass through the loop - * previous_tail_pred will point to the last instruction in the - * stream *before* processing the previous operand. Naturally, - * instructions->tail_pred will point to the last instruction in the - * stream *after* processing the previous operand. If the two - * pointers match, then the previous operand had no effect. - * - * The warning behavior here differs slightly from GCC. GCC will - * only emit a warning if none of the left-hand operands have an - * effect. However, it will emit a warning for each. I believe that - * there are some cases in C (especially with GCC extensions) where - * it is useful to have an intermediate step in a sequence have no - * effect, but I don't think these cases exist in GLSL. Either way, - * it would be a giant hassle to replicate that behavior. - */ - if (previous_tail_pred == instructions->tail_pred) { - _mesa_glsl_warning(&previous_operand_loc, state, - "left-hand operand of comma expression has " - "no effect"); - } + /* If one of the operands of comma operator does not generate any + * code, we want to emit a warning. At each pass through the loop + * previous_tail_pred will point to the last instruction in the + * stream *before* processing the previous operand. Naturally, + * instructions->tail_pred will point to the last instruction in the + * stream *after* processing the previous operand. If the two + * pointers match, then the previous operand had no effect. + * + * The warning behavior here differs slightly from GCC. GCC will + * only emit a warning if none of the left-hand operands have an + * effect. However, it will emit a warning for each. I believe that + * there are some cases in C (especially with GCC extensions) where + * it is useful to have an intermediate step in a sequence have no + * effect, but I don't think these cases exist in GLSL. Either way, + * it would be a giant hassle to replicate that behavior. + */ + if (previous_tail_pred == instructions->tail_pred) { + _mesa_glsl_warning(&previous_operand_loc, state, + "left-hand operand of comma expression has " + "no effect"); + } - /* tail_pred is directly accessed instead of using the get_tail() - * method for performance reasons. get_tail() has extra code to - * return NULL when the list is empty. We don't care about that - * here, so using tail_pred directly is fine. - */ - previous_tail_pred = instructions->tail_pred; - previous_operand_loc = ast->get_location(); + /* tail_pred is directly accessed instead of using the get_tail() + * method for performance reasons. get_tail() has extra code to + * return NULL when the list is empty. We don't care about that + * here, so using tail_pred directly is fine. + */ + previous_tail_pred = instructions->tail_pred; + previous_operand_loc = ast->get_location(); - result = ast->hir(instructions, state); + result = ast->hir(instructions, state); } /* Any errors should have already been emitted in the loop above. @@ -1771,9 +1830,9 @@ ast_expression::hir(exec_list *instructions, } } type = NULL; /* use result->type, not type. */ - assert(result != NULL); + assert(result != NULL || !needs_rvalue); - if (result->type->is_error() && !error_emitted) + if (result && result->type->is_error() && !error_emitted) _mesa_glsl_error(& loc, state, "type mismatch"); return result; @@ -1782,7 +1841,7 @@ ast_expression::hir(exec_list *instructions, ir_rvalue * ast_expression_statement::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { /* It is possible to have expression statements that don't have an * expression. This is the solitary semicolon: @@ -1794,7 +1853,7 @@ ast_expression_statement::hir(exec_list *instructions, * anything in that case. */ if (expression != NULL) - expression->hir(instructions, state); + expression->hir_no_rvalue(instructions, state); /* Statements do not have r-values. */ @@ -1804,7 +1863,7 @@ ast_expression_statement::hir(exec_list *instructions, ir_rvalue * ast_compound_statement::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { if (new_scope) state->symbols->push_scope(); @@ -1824,15 +1883,14 @@ ast_compound_statement::hir(exec_list *instructions, * Evaluate the given exec_node (which should be an ast_node representing * a single array dimension) and return its integer value. */ -static const unsigned +static unsigned process_array_size(exec_node *node, struct _mesa_glsl_parse_state *state) { exec_list dummy_instructions; ast_node *array_size = exec_node_data(ast_node, node, link); - ir_rvalue *const ir = array_size->hir(& dummy_instructions, - state); + ir_rvalue *const ir = array_size->hir(& dummy_instructions, state); YYLTYPE loc = array_size->get_location(); if (ir == NULL) { @@ -1913,8 +1971,7 @@ process_array_type(YYLTYPE *loc, const glsl_type *base, for (exec_node *node = array_specifier->array_dimensions.tail_pred; !node->is_head_sentinel(); node = node->prev) { unsigned array_size = process_array_size(node, state); - array_type = glsl_type::get_array_instance(array_type, - array_size); + array_type = glsl_type::get_array_instance(array_type, array_size); } if (array_specifier->is_unsized_array) @@ -1927,7 +1984,7 @@ process_array_type(YYLTYPE *loc, const glsl_type *base, const glsl_type * ast_type_specifier::glsl_type(const char **name, - struct _mesa_glsl_parse_state *state) const + struct _mesa_glsl_parse_state *state) const { const struct glsl_type *type; @@ -1983,7 +2040,7 @@ is_varying_var(ir_variable *var, gl_shader_stage target) case MESA_SHADER_VERTEX: return var->data.mode == ir_var_shader_out; case MESA_SHADER_FRAGMENT: - return var->data.mode == ir_var_shader_in; + return var->data.mode == ir_var_shader_in || var->data.mode == ir_var_shader_inout; default: return var->data.mode == ir_var_shader_out || var->data.mode == ir_var_shader_in; } @@ -1995,7 +2052,7 @@ is_varying_var(ir_variable *var, gl_shader_stage target) */ static void validate_matrix_layout_for_type(struct _mesa_glsl_parse_state *state, - YYLTYPE *loc, + YYLTYPE *loc, const glsl_type *type, ir_variable *var) { @@ -2154,11 +2211,51 @@ validate_explicit_location(const struct ast_type_qualifier *qual, { bool fail = false; - /* In the vertex shader only shader inputs can be given explicit - * locations. + /* Checks for GL_ARB_explicit_uniform_location. */ + if (qual->flags.q.uniform) { + if (!state->check_explicit_uniform_location_allowed(loc, var)) + return; + + const struct gl_context *const ctx = state->ctx; + unsigned max_loc = qual->location + var->type->uniform_locations() - 1; + + /* ARB_explicit_uniform_location specification states: + * + * "The explicitly defined locations and the generated locations + * must be in the range of 0 to MAX_UNIFORM_LOCATIONS minus one." + * + * "Valid locations for default-block uniform variable locations + * are in the range of 0 to the implementation-defined maximum + * number of uniform locations." + */ + if (qual->location < 0) { + _mesa_glsl_error(loc, state, + "explicit location < 0 for uniform %s", var->name); + return; + } + + if (max_loc >= ctx->Const.MaxUserAssignableUniformLocations) { + _mesa_glsl_error(loc, state, "location(s) consumed by uniform %s " + ">= MAX_UNIFORM_LOCATIONS (%u)", var->name, + ctx->Const.MaxUserAssignableUniformLocations); + return; + } + + var->data.explicit_location = true; + var->data.location = qual->location; + return; + } + + /* Between GL_ARB_explicit_attrib_location an + * GL_ARB_separate_shader_objects, the inputs and outputs of any shader + * stage can be assigned explicit locations. The checking here associates + * the correct extension with the correct stage's input / output: * - * In the fragment shader only shader outputs can be given explicit - * locations. + * input output + * ----- ------ + * vertex explicit_loc sso + * geometry sso sso + * fragment sso explicit_loc */ switch (state->stage) { case MESA_SHADER_VERTEX: @@ -2169,22 +2266,48 @@ validate_explicit_location(const struct ast_type_qualifier *qual, break; } + if (var->data.mode == ir_var_shader_out) { + if (!state->check_separate_shader_objects_allowed(loc, var)) + return; + + break; + } + fail = true; break; case MESA_SHADER_GEOMETRY: - _mesa_glsl_error(loc, state, - "geometry shader variables cannot be given " - "explicit locations"); - return; + if (var->data.mode == ir_var_shader_in || var->data.mode == ir_var_shader_out) { + if (!state->check_separate_shader_objects_allowed(loc, var)) + return; + + break; + } + + fail = true; + break; case MESA_SHADER_FRAGMENT: + if (var->data.mode == ir_var_shader_in) { + if (!state->check_separate_shader_objects_allowed(loc, var)) + return; + + break; + } + if (var->data.mode == ir_var_shader_out) { if (!state->check_explicit_attrib_location_allowed(loc, var)) return; break; } + // EXT_shader_framebuffer_fetch: + // ability to use the inout qualifier at global scope + // in a fragment shader, is optional and must be enabled by + // #extension GL_EXT_shader_framebuffer_fetch + if (var->data.mode == ir_var_shader_inout && state->EXT_shader_framebuffer_fetch_enable) { + break; + } fail = true; break; @@ -2200,7 +2323,7 @@ validate_explicit_location(const struct ast_type_qualifier *qual, _mesa_glsl_error(loc, state, "%s cannot be given an explicit location in %s shader", mode_string(var), - _mesa_shader_stage_to_string(state->stage)); + _mesa_shader_stage_to_string(state->stage)); } else { var->data.explicit_location = true; @@ -2212,9 +2335,26 @@ validate_explicit_location(const struct ast_type_qualifier *qual, * ensures that negative values stay negative. */ if (qual->location >= 0) { - var->data.location = (state->stage == MESA_SHADER_VERTEX) - ? (qual->location + VERT_ATTRIB_GENERIC0) - : (qual->location + FRAG_RESULT_DATA0); + switch (state->stage) { + case MESA_SHADER_VERTEX: + var->data.location = (var->data.mode == ir_var_shader_in) + ? (qual->location + VERT_ATTRIB_GENERIC0) + : (qual->location + VARYING_SLOT_VAR0); + break; + + case MESA_SHADER_GEOMETRY: + var->data.location = qual->location + VARYING_SLOT_VAR0; + break; + + case MESA_SHADER_FRAGMENT: + var->data.location = (var->data.mode == ir_var_shader_out || var->data.mode == ir_var_shader_inout) + ? (qual->location + FRAG_RESULT_DATA0) + : (qual->location + VARYING_SLOT_VAR0); + break; + case MESA_SHADER_COMPUTE: + assert(!"Unexpected shader type"); + break; + } } else { var->data.location = qual->location; } @@ -2238,8 +2378,6 @@ validate_explicit_location(const struct ast_type_qualifier *qual, } } } - - return; } static void @@ -2259,11 +2397,11 @@ apply_image_qualifier_to_variable(const struct ast_type_qualifier *qual, "global variables"); } - var->data.image.read_only |= qual->flags.q.read_only; - var->data.image.write_only |= qual->flags.q.write_only; - var->data.image.coherent |= qual->flags.q.coherent; - var->data.image._volatile |= qual->flags.q._volatile; - var->data.image.restrict_flag |= qual->flags.q.restrict_flag; + var->data.image_read_only |= qual->flags.q.read_only; + var->data.image_write_only |= qual->flags.q.write_only; + var->data.image_coherent |= qual->flags.q.coherent; + var->data.image_volatile |= qual->flags.q._volatile; + var->data.image_restrict |= qual->flags.q.restrict_flag; var->data.read_only = true; if (qual->flags.q.explicit_image_format) { @@ -2277,7 +2415,7 @@ apply_image_qualifier_to_variable(const struct ast_type_qualifier *qual, "base data type of the image"); } - var->data.image.format = qual->image_format; + var->data.image_format = qual->image_format; } else { if (var->data.mode == ir_var_uniform && !qual->flags.q.write_only) { _mesa_glsl_error(loc, state, "uniforms not qualified with " @@ -2285,28 +2423,67 @@ apply_image_qualifier_to_variable(const struct ast_type_qualifier *qual, "qualifier"); } - var->data.image.format = GL_NONE; + var->data.image_format = GL_NONE; } } } +static inline const char* +get_layout_qualifier_string(bool origin_upper_left, bool pixel_center_integer) +{ + if (origin_upper_left && pixel_center_integer) + return "origin_upper_left, pixel_center_integer"; + else if (origin_upper_left) + return "origin_upper_left"; + else if (pixel_center_integer) + return "pixel_center_integer"; + else + return " "; +} + +static inline bool +is_conflicting_fragcoord_redeclaration(struct _mesa_glsl_parse_state *state, + const struct ast_type_qualifier *qual) +{ + /* If gl_FragCoord was previously declared, and the qualifiers were + * different in any way, return true. + */ + if (state->fs_redeclares_gl_fragcoord) { + return (state->fs_pixel_center_integer != qual->flags.q.pixel_center_integer + || state->fs_origin_upper_left != qual->flags.q.origin_upper_left); + } + + return false; +} + static void apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, - ir_variable *var, - struct _mesa_glsl_parse_state *state, - YYLTYPE *loc, + ir_variable *var, + struct _mesa_glsl_parse_state *state, + YYLTYPE *loc, bool is_parameter) { STATIC_ASSERT(sizeof(qual->flags.q) <= sizeof(qual->flags.i)); if (qual->flags.q.invariant) { if (var->data.used) { - _mesa_glsl_error(loc, state, - "variable `%s' may not be redeclared " - "`invariant' after being used", - var->name); + _mesa_glsl_error(loc, state, + "variable `%s' may not be redeclared " + "`invariant' after being used", + var->name); } else { - var->data.invariant = 1; + var->data.invariant = 1; + } + } + + if (qual->flags.q.precise) { + if (var->data.used) { + _mesa_glsl_error(loc, state, + "variable `%s' may not be redeclared " + "`precise' after being used", + var->name); + } else { + var->data.precise = 1; } } @@ -2321,12 +2498,24 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, if (qual->flags.q.sample) var->data.sample = 1; + if (state->stage == MESA_SHADER_GEOMETRY && + qual->flags.q.out && qual->flags.q.stream) { + var->data.stream = qual->stream; + } + if (qual->flags.q.attribute && state->stage != MESA_SHADER_VERTEX) { var->type = glsl_type::error_type; _mesa_glsl_error(loc, state, - "`attribute' variables may not be declared in the " - "%s shader", - _mesa_shader_stage_to_string(state->stage)); + "`attribute' variables may not be declared in the " + "%s shader", + _mesa_shader_stage_to_string(state->stage)); + } + + /* Disallow layout qualifiers which may only appear on layout declarations. */ + if (qual->flags.q.prim_type) { + _mesa_glsl_error(loc, state, + "Primitive type may only be specified on GS input or output " + "layout declaration, not on variables."); } /* Section 6.1.1 (Function Calling Conventions) of the GLSL 1.10 spec says: @@ -2347,8 +2536,14 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, /* If there is no qualifier that changes the mode of the variable, leave * the setting alone. */ + assert(var->data.mode != ir_var_temporary); if (qual->flags.q.in && qual->flags.q.out) - var->data.mode = ir_var_function_inout; + { + if (!is_parameter && (state->stage == MESA_SHADER_FRAGMENT)) + var->data.mode = ir_var_shader_inout; + else + var->data.mode = ir_var_function_inout; + } else if (qual->flags.q.in) var->data.mode = is_parameter ? ir_var_function_in : ir_var_shader_in; else if (qual->flags.q.attribute @@ -2419,18 +2614,18 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, if (state->all_invariant && (state->current_function == NULL)) { switch (state->stage) { case MESA_SHADER_VERTEX: - if (var->data.mode == ir_var_shader_out) - var->data.invariant = true; - break; + if (var->data.mode == ir_var_shader_out) + var->data.invariant = true; + break; case MESA_SHADER_GEOMETRY: - if ((var->data.mode == ir_var_shader_in) + if ((var->data.mode == ir_var_shader_in) || (var->data.mode == ir_var_shader_out)) - var->data.invariant = true; - break; + var->data.invariant = true; + break; case MESA_SHADER_FRAGMENT: - if (var->data.mode == ir_var_shader_in) - var->data.invariant = true; - break; + if (var->data.mode == ir_var_shader_in) + var->data.invariant = true; + break; case MESA_SHADER_COMPUTE: /* Invariance isn't meaningful in compute shaders. */ break; @@ -2446,7 +2641,7 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, if ((qual->flags.q.origin_upper_left || qual->flags.q.pixel_center_integer) && (strcmp(var->name, "gl_FragCoord") != 0)) { const char *const qual_string = (qual->flags.q.origin_upper_left) - ? "origin_upper_left" : "pixel_center_integer"; + ? "origin_upper_left" : "pixel_center_integer"; _mesa_glsl_error(loc, state, "layout qualifier `%s' can only be applied to " @@ -2454,11 +2649,57 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, qual_string); } + if (var->name != NULL && strcmp(var->name, "gl_FragCoord") == 0) { + + /* Section 4.3.8.1, page 39 of GLSL 1.50 spec says: + * + * "Within any shader, the first redeclarations of gl_FragCoord + * must appear before any use of gl_FragCoord." + * + * Generate a compiler error if above condition is not met by the + * fragment shader. + */ + ir_variable *earlier = state->symbols->get_variable("gl_FragCoord"); + if (earlier != NULL && + earlier->data.used && + !state->fs_redeclares_gl_fragcoord) { + _mesa_glsl_error(loc, state, + "gl_FragCoord used before its first redeclaration " + "in fragment shader"); + } + + /* Make sure all gl_FragCoord redeclarations specify the same layout + * qualifiers. + */ + if (is_conflicting_fragcoord_redeclaration(state, qual)) { + const char *const qual_string = + get_layout_qualifier_string(qual->flags.q.origin_upper_left, + qual->flags.q.pixel_center_integer); + + const char *const state_string = + get_layout_qualifier_string(state->fs_origin_upper_left, + state->fs_pixel_center_integer); + + _mesa_glsl_error(loc, state, + "gl_FragCoord redeclared with different layout " + "qualifiers (%s) and (%s) ", + state_string, + qual_string); + } + state->fs_origin_upper_left = qual->flags.q.origin_upper_left; + state->fs_pixel_center_integer = qual->flags.q.pixel_center_integer; + state->fs_redeclares_gl_fragcoord_with_no_layout_qualifiers = + !qual->flags.q.origin_upper_left && !qual->flags.q.pixel_center_integer; + state->fs_redeclares_gl_fragcoord = + state->fs_origin_upper_left || + state->fs_pixel_center_integer || + state->fs_redeclares_gl_fragcoord_with_no_layout_qualifiers; + } + if (qual->flags.q.explicit_location) { validate_explicit_location(qual, var, state, loc); } else if (qual->flags.q.explicit_index) { - _mesa_glsl_error(loc, state, - "explicit index requires explicit location"); + _mesa_glsl_error(loc, state, "explicit index requires explicit location"); } if (qual->flags.q.explicit_binding && @@ -2497,6 +2738,36 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, const bool uses_deprecated_qualifier = qual->flags.q.attribute || qual->flags.q.varying; + + /* Validate auxiliary storage qualifiers */ + + /* From section 4.3.4 of the GLSL 1.30 spec: + * "It is an error to use centroid in in a vertex shader." + * + * From section 4.3.4 of the GLSL ES 3.00 spec: + * "It is an error to use centroid in or interpolation qualifiers in + * a vertex shader input." + */ + + /* Section 4.3.6 of the GLSL 1.30 specification states: + * "It is an error to use centroid out in a fragment shader." + * + * The GL_ARB_shading_language_420pack extension specification states: + * "It is an error to use auxiliary storage qualifiers or interpolation + * qualifiers on an output in a fragment shader." + */ + if (qual->flags.q.sample && (!is_varying_var(var, state->stage) || uses_deprecated_qualifier)) { + _mesa_glsl_error(loc, state, + "sample qualifier may only be used on `in` or `out` " + "variables between shader stages"); + } + if (qual->flags.q.centroid && !is_varying_var(var, state->stage)) { + _mesa_glsl_error(loc, state, + "centroid qualifier may only be used with `in', " + "`out' or `varying' variables between shader stages"); + } + + /* Is the 'layout' keyword used with parameters that allow relaxed checking. * Many implementations of GL_ARB_fragment_coord_conventions_enable and some * implementations (only Mesa?) GL_ARB_explicit_attrib_location_enable @@ -2522,13 +2793,13 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, if (qual->has_layout() && uses_deprecated_qualifier) { if (relaxed_layout_qualifier_checking) { - _mesa_glsl_warning(loc, state, - "`layout' qualifier may not be used with " - "`attribute' or `varying'"); + _mesa_glsl_warning(loc, state, + "`layout' qualifier may not be used with " + "`attribute' or `varying'"); } else { - _mesa_glsl_error(loc, state, - "`layout' qualifier may not be used with " - "`attribute' or `varying'"); + _mesa_glsl_error(loc, state, + "`layout' qualifier may not be used with " + "`attribute' or `varying'"); } } @@ -2545,7 +2816,7 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, _mesa_glsl_error(loc, state, "extension GL_AMD_conservative_depth or " "GL_ARB_conservative_depth must be enabled " - "to use depth layout qualifiers"); + "to use depth layout qualifiers"); } else if (depth_layout_count > 0 && strcmp(var->name, "gl_FragDepth") != 0) { _mesa_glsl_error(loc, state, @@ -2573,8 +2844,8 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, qual->flags.q.shared) { _mesa_glsl_error(loc, state, "uniform block layout qualifiers std140, packed, and " - "shared can only be applied to uniform blocks, not " - "members"); + "shared can only be applied to uniform blocks, not " + "members"); } if (qual->flags.q.row_major || qual->flags.q.column_major) { @@ -2610,7 +2881,7 @@ get_variable_being_redeclared(ir_variable *var, YYLTYPE loc, ir_variable *earlier = state->symbols->get_variable(var->name); if (earlier == NULL || (state->current_function != NULL && - !state->symbols->name_declared_this_scope(var->name))) { + !state->symbols->name_declared_this_scope(var->name))) { return NULL; } @@ -2631,19 +2902,19 @@ get_variable_being_redeclared(ir_variable *var, YYLTYPE loc, const unsigned size = unsigned(var->type->array_size()); check_builtin_array_max_size(var->name, size, loc, state); if ((size > 0) && (size <= earlier->data.max_array_access)) { - _mesa_glsl_error(& loc, state, "array size must be > %u due to " - "previous access", - earlier->data.max_array_access); + _mesa_glsl_error(& loc, state, "array size must be > %u due to " + "previous access", + earlier->data.max_array_access); } earlier->type = var->type; delete var; var = NULL; } else if ((state->ARB_fragment_coord_conventions_enable || - state->is_version(150, 0)) - && strcmp(var->name, "gl_FragCoord") == 0 - && earlier->type == var->type - && earlier->data.mode == var->data.mode) { + state->is_version(150, 0)) + && strcmp(var->name, "gl_FragCoord") == 0 + && earlier->type == var->type + && earlier->data.mode == var->data.mode) { /* Allow redeclaration of gl_FragCoord for ARB_fcc layout * qualifiers. */ @@ -2661,42 +2932,42 @@ get_variable_being_redeclared(ir_variable *var, YYLTYPE loc, * * gl_SecondaryColor */ } else if (state->is_version(130, 0) - && (strcmp(var->name, "gl_FrontColor") == 0 - || strcmp(var->name, "gl_BackColor") == 0 - || strcmp(var->name, "gl_FrontSecondaryColor") == 0 - || strcmp(var->name, "gl_BackSecondaryColor") == 0 - || strcmp(var->name, "gl_Color") == 0 - || strcmp(var->name, "gl_SecondaryColor") == 0) - && earlier->type == var->type - && earlier->data.mode == var->data.mode) { + && (strcmp(var->name, "gl_FrontColor") == 0 + || strcmp(var->name, "gl_BackColor") == 0 + || strcmp(var->name, "gl_FrontSecondaryColor") == 0 + || strcmp(var->name, "gl_BackSecondaryColor") == 0 + || strcmp(var->name, "gl_Color") == 0 + || strcmp(var->name, "gl_SecondaryColor") == 0) + && earlier->type == var->type + && earlier->data.mode == var->data.mode) { earlier->data.interpolation = var->data.interpolation; /* Layout qualifiers for gl_FragDepth. */ } else if ((state->AMD_conservative_depth_enable || state->ARB_conservative_depth_enable) - && strcmp(var->name, "gl_FragDepth") == 0 - && earlier->type == var->type - && earlier->data.mode == var->data.mode) { + && strcmp(var->name, "gl_FragDepth") == 0 + && earlier->type == var->type + && earlier->data.mode == var->data.mode) { /** From the AMD_conservative_depth spec: * Within any shader, the first redeclarations of gl_FragDepth * must appear before any use of gl_FragDepth. */ if (earlier->data.used) { - _mesa_glsl_error(&loc, state, - "the first redeclaration of gl_FragDepth " - "must appear before any use of gl_FragDepth"); + _mesa_glsl_error(&loc, state, + "the first redeclaration of gl_FragDepth " + "must appear before any use of gl_FragDepth"); } /* Prevent inconsistent redeclaration of depth layout qualifier. */ if (earlier->data.depth_layout != ir_depth_layout_none - && earlier->data.depth_layout != var->data.depth_layout) { - _mesa_glsl_error(&loc, state, - "gl_FragDepth: depth layout is declared here " - "as '%s, but it was previously declared as " - "'%s'", - depth_layout_string(var->data.depth_layout), - depth_layout_string(earlier->data.depth_layout)); + && earlier->data.depth_layout != var->data.depth_layout) { + _mesa_glsl_error(&loc, state, + "gl_FragDepth: depth layout is declared here " + "as '%s, but it was previously declared as " + "'%s'", + depth_layout_string(var->data.depth_layout), + depth_layout_string(earlier->data.depth_layout)); } earlier->data.depth_layout = var->data.depth_layout; @@ -2750,7 +3021,7 @@ process_initializer(ir_variable *var, ast_declaration *decl, */ if (var->type->contains_opaque()) { _mesa_glsl_error(& initializer_loc, state, - "cannot initialize opaque variable"); + "cannot initialize opaque variable"); } if ((var->data.mode == ir_var_shader_in) && (state->current_function == NULL)) { @@ -2769,8 +3040,7 @@ process_initializer(ir_variable *var, ast_declaration *decl, _mesa_ast_set_aggregate_type(var->type, decl->initializer); ir_dereference *const lhs = new(state) ir_dereference_variable(var); - ir_rvalue *rhs = decl->initializer->hir(initializer_instructions, - state); + ir_rvalue *rhs = decl->initializer->hir(initializer_instructions, state); /* Calculate the constant value if this is a const or uniform * declaration. @@ -2780,10 +3050,10 @@ process_initializer(ir_variable *var, ast_declaration *decl, ir_rvalue *new_rhs = validate_assignment(state, initializer_loc, var->type, rhs, true); if (new_rhs != NULL) { - rhs = new_rhs; + rhs = new_rhs; - ir_constant *constant_value = rhs->constant_expression_value(); - if (!constant_value) { + ir_constant *constant_value = rhs->constant_expression_value(); + if (!constant_value) { /* If ARB_shading_language_420pack is enabled, initializers of * const-qualified local variables do not have to be constant * expressions. Const-qualified global variables must still be @@ -2803,33 +3073,35 @@ process_initializer(ir_variable *var, ast_declaration *decl, } } } else { - rhs = constant_value; - var->constant_value = constant_value; - } + rhs = constant_value; + var->constant_value = constant_value; + } } else { - if (var->type->is_numeric()) { - /* Reduce cascading errors. */ - var->constant_value = ir_constant::zero(state, var->type); - } + if (var->type->is_numeric()) { + /* Reduce cascading errors. */ + var->constant_value = ir_constant::zero(state, var->type); + } } } if (rhs && !rhs->type->is_error()) { bool temp = var->data.read_only; if (type->qualifier.flags.q.constant) - var->data.read_only = false; + var->data.read_only = false; /* Never emit code to initialize a uniform. */ const glsl_type *initializer_type; if (!type->qualifier.flags.q.uniform) { - result = do_assignment(initializer_instructions, state, - NULL, - lhs, rhs, true, - type->get_location()); - initializer_type = result->type; + do_assignment(initializer_instructions, state, + NULL, + lhs, rhs, + &result, true, + true, + type->get_location()); + initializer_type = result->type; } else - initializer_type = rhs->type; + initializer_type = rhs->type; var->constant_initializer = rhs->constant_expression_value(); var->data.has_initializer = true; @@ -2886,7 +3158,7 @@ handle_geometry_shader_input_decl(struct _mesa_glsl_parse_state *state, { unsigned num_vertices = 0; if (state->gs_input_prim_type_specified) { - num_vertices = vertices_per_prim(state->gs_input_prim_type); + num_vertices = vertices_per_prim(state->in_qualifier->prim_type); } /* Geometry shader input variables must be arrays. Caller should have @@ -2961,7 +3233,7 @@ validate_identifier(const char *identifier, YYLTYPE loc, * OpenGL, and may not be declared in a shader as either a * variable or a function." */ - if (strncmp(identifier, "gl_", 3) == 0) { + if (is_gl_identifier(identifier)) { _mesa_glsl_error(&loc, state, "identifier `%s' uses reserved `gl_' prefix", identifier); @@ -2972,17 +3244,59 @@ validate_identifier(const char *identifier, YYLTYPE loc, * "In addition, all identifiers containing two * consecutive underscores (__) are reserved as * possible future keywords." + * + * The intention is that names containing __ are reserved for internal + * use by the implementation, and names prefixed with GL_ are reserved + * for use by Khronos. Names simply containing __ are dangerous to use, + * but should be allowed. + * + * A future version of the GLSL specification will clarify this. */ - _mesa_glsl_error(&loc, state, - "identifier `%s' uses reserved `__' string", - identifier); + _mesa_glsl_warning(&loc, state, + "identifier `%s' uses reserved `__' string", + identifier); } } +static bool +precision_qualifier_allowed(const glsl_type *type) +{ + /* Precision qualifiers apply to floating point, integer and sampler + * types. + * + * Section 4.5.2 (Precision Qualifiers) of the GLSL 1.30 spec says: + * "Any floating point or any integer declaration can have the type + * preceded by one of these precision qualifiers [...] Literal + * constants do not have precision qualifiers. Neither do Boolean + * variables. + * + * Section 4.5 (Precision and Precision Qualifiers) of the GLSL 1.30 + * spec also says: + * + * "Precision qualifiers are added for code portability with OpenGL + * ES, not for functionality. They have the same syntax as in OpenGL + * ES." + * + * Section 8 (Built-In Functions) of the GLSL ES 1.00 spec says: + * + * "uniform lowp sampler2D sampler; + * highp vec2 coord; + * ... + * lowp vec4 col = texture2D (sampler, coord); + * // texture2D returns lowp" + * + * From this, we infer that GLSL 1.30 (and later) should allow precision + * qualifiers on sampler types just like float and integer types. + */ + return type->is_float() + || type->is_integer() + || type->is_record() + || type->is_sampler(); +} ir_rvalue * ast_declarator_list::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { void *ctx = state; const struct glsl_type *decl_type; @@ -3005,39 +3319,33 @@ ast_declarator_list::hir(exec_list *instructions, assert(this->type == NULL); if (state->current_function != NULL) { - _mesa_glsl_error(& loc, state, - "all uses of `invariant' keyword must be at global " - "scope"); + _mesa_glsl_error(& loc, state, + "all uses of `invariant' keyword must be at global " + "scope"); } foreach_list_typed (ast_declaration, decl, link, &this->declarations) { - assert(decl->array_specifier == NULL); - assert(decl->initializer == NULL); + assert(decl->array_specifier == NULL); + assert(decl->initializer == NULL); - ir_variable *const earlier = - state->symbols->get_variable(decl->identifier); - if (earlier == NULL) { - _mesa_glsl_error(& loc, state, - "undeclared variable `%s' cannot be marked " - "invariant", decl->identifier); - } else if ((state->stage == MESA_SHADER_VERTEX) - && (earlier->data.mode != ir_var_shader_out)) { - _mesa_glsl_error(& loc, state, - "`%s' cannot be marked invariant, vertex shader " - "outputs only", decl->identifier); - } else if ((state->stage == MESA_SHADER_FRAGMENT) - && (earlier->data.mode != ir_var_shader_in)) { - _mesa_glsl_error(& loc, state, - "`%s' cannot be marked invariant, fragment shader " - "inputs only", decl->identifier); - } else if (earlier->data.used) { - _mesa_glsl_error(& loc, state, - "variable `%s' may not be redeclared " - "`invariant' after being used", - earlier->name); - } else { - earlier->data.invariant = true; - } + ir_variable *const earlier = + state->symbols->get_variable(decl->identifier); + if (earlier == NULL) { + _mesa_glsl_error(& loc, state, + "undeclared variable `%s' cannot be marked " + "invariant", decl->identifier); + } else if (!is_varying_var(earlier, state->stage)) { + _mesa_glsl_error(&loc, state, + "`%s' cannot be marked invariant; interfaces between " + "shader stages only.", decl->identifier); + } else if (earlier->data.used) { + _mesa_glsl_error(& loc, state, + "variable `%s' may not be redeclared " + "`invariant' after being used", + earlier->name); + } else { + earlier->data.invariant = true; + } } /* Invariant redeclarations do not have r-values. @@ -3045,8 +3353,45 @@ ast_declarator_list::hir(exec_list *instructions, return NULL; } + if (this->precise) { + assert(this->type == NULL); + + foreach_list_typed (ast_declaration, decl, link, &this->declarations) { + assert(decl->array_specifier == NULL); + assert(decl->initializer == NULL); + + ir_variable *const earlier = + state->symbols->get_variable(decl->identifier); + if (earlier == NULL) { + _mesa_glsl_error(& loc, state, + "undeclared variable `%s' cannot be marked " + "precise", decl->identifier); + } else if (state->current_function != NULL && + !state->symbols->name_declared_this_scope(decl->identifier)) { + /* Note: we have to check if we're in a function, since + * builtins are treated as having come from another scope. + */ + _mesa_glsl_error(& loc, state, + "variable `%s' from an outer scope may not be " + "redeclared `precise' in this scope", + earlier->name); + } else if (earlier->data.used) { + _mesa_glsl_error(& loc, state, + "variable `%s' may not be redeclared " + "`precise' after being used", + earlier->name); + } else { + earlier->data.precise = true; + } + } + + /* Precise redeclarations do not have r-values either. */ + return NULL; + } + assert(this->type != NULL); assert(!this->invariant); + assert(!this->precise); /* The type specifier may contain a structure definition. Process that * before any of the variable declarations. @@ -3134,16 +3479,16 @@ ast_declarator_list::hir(exec_list *instructions, */ if ((decl_type == NULL) || decl_type->is_void()) { - if (type_name != NULL) { - _mesa_glsl_error(& loc, state, - "invalid type `%s' in declaration of `%s'", - type_name, decl->identifier); - } else { - _mesa_glsl_error(& loc, state, - "invalid type in declaration of `%s'", - decl->identifier); - } - continue; + if (type_name != NULL) { + _mesa_glsl_error(& loc, state, + "invalid type `%s' in declaration of `%s'", + type_name, decl->identifier); + } else { + _mesa_glsl_error(& loc, state, + "invalid type in declaration of `%s'", + decl->identifier); + } + continue; } var_type = process_array_type(&loc, decl_type, decl->array_specifier, @@ -3174,7 +3519,7 @@ ast_declarator_list::hir(exec_list *instructions, /* From page 22 (page 28 of the PDF) of the GLSL 1.10 specification; * * "Global variables can only use the qualifiers const, - * attribute, uni form, or varying. Only one may be + * attribute, uniform, or varying. Only one may be * specified. * * Local variables can only use the qualifier const." @@ -3183,21 +3528,22 @@ ast_declarator_list::hir(exec_list *instructions, * any extension that adds the 'layout' keyword. */ if (!state->is_version(130, 300) - && !state->has_explicit_attrib_location() - && !state->ARB_fragment_coord_conventions_enable) { - if (this->type->qualifier.flags.q.out) { - _mesa_glsl_error(& loc, state, - "`out' qualifier in declaration of `%s' " - "only valid for function parameters in %s", - decl->identifier, state->get_version_string()); - } - if (this->type->qualifier.flags.q.in) { - _mesa_glsl_error(& loc, state, - "`in' qualifier in declaration of `%s' " - "only valid for function parameters in %s", - decl->identifier, state->get_version_string()); - } - /* FINISHME: Test for other invalid qualifiers. */ + && !state->has_explicit_attrib_location() + && !state->has_separate_shader_objects() + && !state->ARB_fragment_coord_conventions_enable) { + if (this->type->qualifier.flags.q.out) { + _mesa_glsl_error(& loc, state, + "`out' qualifier in declaration of `%s' " + "only valid for function parameters in %s", + decl->identifier, state->get_version_string()); + } + if (this->type->qualifier.flags.q.in) { + _mesa_glsl_error(& loc, state, + "`in' qualifier in declaration of `%s' " + "only valid for function parameters in %s", + decl->identifier, state->get_version_string()); + } + /* FINISHME: Test for other invalid qualifiers. */ } apply_type_qualifier_to_variable(& this->type->qualifier, var, state, @@ -3205,73 +3551,64 @@ ast_declarator_list::hir(exec_list *instructions, apply_precision_to_variable(this->type->qualifier, var, state); if (this->type->qualifier.flags.q.invariant) { - if ((state->stage == MESA_SHADER_VERTEX) && - var->data.mode != ir_var_shader_out) { - _mesa_glsl_error(& loc, state, - "`%s' cannot be marked invariant, vertex shader " - "outputs only", var->name); - } else if ((state->stage == MESA_SHADER_FRAGMENT) && - var->data.mode != ir_var_shader_in) { - /* FINISHME: Note that this doesn't work for invariant on - * a function signature inval - */ - _mesa_glsl_error(& loc, state, - "`%s' cannot be marked invariant, fragment shader " - "inputs only", var->name); - } + if (!is_varying_var(var, state->stage)) { + _mesa_glsl_error(&loc, state, + "`%s' cannot be marked invariant; interfaces between " + "shader stages only", var->name); + } } if (state->current_function != NULL) { - const char *mode = NULL; - const char *extra = ""; + const char *mode = NULL; + const char *extra = ""; - /* There is no need to check for 'inout' here because the parser will - * only allow that in function parameter lists. - */ - if (this->type->qualifier.flags.q.attribute) { - mode = "attribute"; - } else if (this->type->qualifier.flags.q.uniform) { - mode = "uniform"; - } else if (this->type->qualifier.flags.q.varying) { - mode = "varying"; - } else if (this->type->qualifier.flags.q.in) { - mode = "in"; - extra = " or in function parameter list"; - } else if (this->type->qualifier.flags.q.out) { - mode = "out"; - extra = " or in function parameter list"; - } + /* There is no need to check for 'inout' here because the parser will + * only allow that in function parameter lists. + */ + if (this->type->qualifier.flags.q.attribute) { + mode = "attribute"; + } else if (this->type->qualifier.flags.q.uniform) { + mode = "uniform"; + } else if (this->type->qualifier.flags.q.varying) { + mode = "varying"; + } else if (this->type->qualifier.flags.q.in) { + mode = "in"; + extra = " or in function parameter list"; + } else if (this->type->qualifier.flags.q.out) { + mode = "out"; + extra = " or in function parameter list"; + } - if (mode) { - _mesa_glsl_error(& loc, state, - "%s variable `%s' must be declared at " - "global scope%s", - mode, var->name, extra); - } + if (mode) { + _mesa_glsl_error(& loc, state, + "%s variable `%s' must be declared at " + "global scope%s", + mode, var->name, extra); + } } else if (var->data.mode == ir_var_shader_in) { var->data.read_only = true; - if (state->stage == MESA_SHADER_VERTEX) { - bool error_emitted = false; + if (state->stage == MESA_SHADER_VERTEX) { + bool error_emitted = false; - /* From page 31 (page 37 of the PDF) of the GLSL 1.50 spec: - * - * "Vertex shader inputs can only be float, floating-point - * vectors, matrices, signed and unsigned integers and integer - * vectors. Vertex shader inputs can also form arrays of these - * types, but not structures." - * - * From page 31 (page 27 of the PDF) of the GLSL 1.30 spec: - * - * "Vertex shader inputs can only be float, floating-point - * vectors, matrices, signed and unsigned integers and integer - * vectors. They cannot be arrays or structures." - * - * From page 23 (page 29 of the PDF) of the GLSL 1.20 spec: - * - * "The attribute qualifier can be used only with float, - * floating-point vectors, and matrices. Attribute variables - * cannot be declared as arrays or structures." + /* From page 31 (page 37 of the PDF) of the GLSL 1.50 spec: + * + * "Vertex shader inputs can only be float, floating-point + * vectors, matrices, signed and unsigned integers and integer + * vectors. Vertex shader inputs can also form arrays of these + * types, but not structures." + * + * From page 31 (page 27 of the PDF) of the GLSL 1.30 spec: + * + * "Vertex shader inputs can only be float, floating-point + * vectors, matrices, signed and unsigned integers and integer + * vectors. They cannot be arrays or structures." + * + * From page 23 (page 29 of the PDF) of the GLSL 1.20 spec: + * + * "The attribute qualifier can be used only with float, + * floating-point vectors, and matrices. Attribute variables + * cannot be declared as arrays or structures." * * From page 33 (page 39 of the PDF) of the GLSL ES 3.00 spec: * @@ -3279,35 +3616,35 @@ ast_declarator_list::hir(exec_list *instructions, * vectors, matrices, signed and unsigned integers and integer * vectors. Vertex shader inputs cannot be arrays or * structures." - */ + */ const glsl_type *check_type = var->type; while (check_type->is_array()) check_type = check_type->element_type(); - switch (check_type->base_type) { - case GLSL_TYPE_FLOAT: - break; - case GLSL_TYPE_UINT: - case GLSL_TYPE_INT: - if (state->is_version(120, 300)) - break; - /* FALLTHROUGH */ - default: - _mesa_glsl_error(& loc, state, - "vertex shader input / attribute cannot have " - "type %s`%s'", - var->type->is_array() ? "array of " : "", - check_type->name); - error_emitted = true; - } + switch (check_type->base_type) { + case GLSL_TYPE_FLOAT: + break; + case GLSL_TYPE_UINT: + case GLSL_TYPE_INT: + if (state->is_version(120, 300)) + break; + /* FALLTHROUGH */ + default: + _mesa_glsl_error(& loc, state, + "vertex shader input / attribute cannot have " + "type %s`%s'", + var->type->is_array() ? "array of " : "", + check_type->name); + error_emitted = true; + } - if (!error_emitted && var->type->is_array() && + if (!error_emitted && var->type->is_array() && !state->check_version(150, 0, &loc, "vertex shader input / attribute " "cannot have array type")) { - error_emitted = true; - } - } else if (state->stage == MESA_SHADER_GEOMETRY) { + error_emitted = true; + } + } else if (state->stage == MESA_SHADER_GEOMETRY) { /* From section 4.3.4 (Inputs) of the GLSL 1.50 spec: * * Geometry shader input variables get the per-vertex values @@ -3437,45 +3774,6 @@ ast_declarator_list::hir(exec_list *instructions, } - /* From section 4.3.4 of the GLSL 1.30 spec: - * "It is an error to use centroid in in a vertex shader." - * - * From section 4.3.4 of the GLSL ES 3.00 spec: - * "It is an error to use centroid in or interpolation qualifiers in - * a vertex shader input." - */ - if (state->is_version(130, 300) - && this->type->qualifier.flags.q.centroid - && this->type->qualifier.flags.q.in - && state->stage == MESA_SHADER_VERTEX) { - - _mesa_glsl_error(&loc, state, - "'centroid in' cannot be used in a vertex shader"); - } - - if (state->stage == MESA_SHADER_VERTEX - && this->type->qualifier.flags.q.sample - && this->type->qualifier.flags.q.in) { - - _mesa_glsl_error(&loc, state, - "'sample in' cannot be used in a vertex shader"); - } - - /* Section 4.3.6 of the GLSL 1.30 specification states: - * "It is an error to use centroid out in a fragment shader." - * - * The GL_ARB_shading_language_420pack extension specification states: - * "It is an error to use auxiliary storage qualifiers or interpolation - * qualifiers on an output in a fragment shader." - */ - if (state->stage == MESA_SHADER_FRAGMENT && - this->type->qualifier.flags.q.out && - this->type->qualifier.has_auxiliary_storage()) { - _mesa_glsl_error(&loc, state, - "auxiliary storage qualifiers cannot be used on " - "fragment shader outputs"); - } - /* Precision qualifiers exists only in GLSL versions 1.00 and >= 1.30. */ if (this->type->qualifier.precision != ast_precision_none) { @@ -3483,41 +3781,13 @@ ast_declarator_list::hir(exec_list *instructions, } - /* Precision qualifiers apply to floating point, integer and sampler - * types. - * - * Section 4.5.2 (Precision Qualifiers) of the GLSL 1.30 spec says: - * "Any floating point or any integer declaration can have the type - * preceded by one of these precision qualifiers [...] Literal - * constants do not have precision qualifiers. Neither do Boolean - * variables. - * - * Section 4.5 (Precision and Precision Qualifiers) of the GLSL 1.30 - * spec also says: - * - * "Precision qualifiers are added for code portability with OpenGL - * ES, not for functionality. They have the same syntax as in OpenGL - * ES." - * - * Section 8 (Built-In Functions) of the GLSL ES 1.00 spec says: - * - * "uniform lowp sampler2D sampler; - * highp vec2 coord; - * ... - * lowp vec4 col = texture2D (sampler, coord); - * // texture2D returns lowp" - * - * From this, we infer that GLSL 1.30 (and later) should allow precision - * qualifiers on sampler types just like float and integer types. + /* If a precision qualifier is allowed on a type, it is allowed on + * an array of that type. */ - if (this->type->qualifier.precision != ast_precision_none - && !var->type->is_float() - && !var->type->is_integer() - && !var->type->is_record() - && !var->type->is_sampler() - && !(var->type->is_array() - && (var->type->fields.array->is_float() - || var->type->fields.array->is_integer()))) { + if (!(this->type->qualifier.precision == ast_precision_none + || precision_qualifier_allowed(var->type) + || (var->type->is_array() + && precision_qualifier_allowed(var->type->fields.array)))) { _mesa_glsl_error(&loc, state, "precision qualifiers apply only to floating point" @@ -3542,11 +3812,15 @@ ast_declarator_list::hir(exec_list *instructions, * instruction stream. */ exec_list initializer_instructions; + + /* Examine var name here since var may get deleted in the next call */ + bool var_is_gl_id = is_gl_identifier(var->name); + ir_variable *earlier = get_variable_being_redeclared(var, decl->get_location(), state, false /* allow_all_redeclarations */); if (earlier != NULL) { - if (strncmp(var->name, "gl_", 3) == 0 && + if (var_is_gl_id && earlier->data.how_declared == ir_var_declared_in_block) { _mesa_glsl_error(&loc, state, "`%s' has already been redeclared using " @@ -3556,9 +3830,9 @@ ast_declarator_list::hir(exec_list *instructions, } if (decl->initializer != NULL) { - result = process_initializer((earlier == NULL) ? var : earlier, - decl, this->type, - &initializer_instructions, state); + result = process_initializer((earlier == NULL) ? var : earlier, + decl, this->type, + &initializer_instructions, state); } /* From page 23 (page 29 of the PDF) of the GLSL 1.10 spec: @@ -3568,14 +3842,14 @@ ast_declarator_list::hir(exec_list *instructions, * declared." */ if (this->type->qualifier.flags.q.constant && decl->initializer == NULL) { - _mesa_glsl_error(& loc, state, - "const declaration of `%s' must be initialized", - decl->identifier); + _mesa_glsl_error(& loc, state, + "const declaration of `%s' must be initialized", + decl->identifier); } if (state->es_shader) { - const glsl_type *const t = (earlier == NULL) - ? var->type : earlier->type; + const glsl_type *const t = (earlier == NULL) + ? var->type : earlier->type; if (t->is_unsized_array()) /* Section 10.17 of the GLSL ES 1.00 specification states that @@ -3607,40 +3881,40 @@ ast_declarator_list::hir(exec_list *instructions, if (earlier == NULL) { validate_identifier(decl->identifier, loc, state); - /* Add the variable to the symbol table. Note that the initializer's - * IR was already processed earlier (though it hasn't been emitted - * yet), without the variable in scope. - * - * This differs from most C-like languages, but it follows the GLSL - * specification. From page 28 (page 34 of the PDF) of the GLSL 1.50 - * spec: - * - * "Within a declaration, the scope of a name starts immediately - * after the initializer if present or immediately after the name - * being declared if not." - */ - if (!state->symbols->add_variable(var)) { - YYLTYPE loc = this->get_location(); - _mesa_glsl_error(&loc, state, "name `%s' already taken in the " - "current scope", decl->identifier); - continue; - } + /* Add the variable to the symbol table. Note that the initializer's + * IR was already processed earlier (though it hasn't been emitted + * yet), without the variable in scope. + * + * This differs from most C-like languages, but it follows the GLSL + * specification. From page 28 (page 34 of the PDF) of the GLSL 1.50 + * spec: + * + * "Within a declaration, the scope of a name starts immediately + * after the initializer if present or immediately after the name + * being declared if not." + */ + if (!state->symbols->add_variable(var)) { + YYLTYPE loc = this->get_location(); + _mesa_glsl_error(&loc, state, "name `%s' already taken in the " + "current scope", decl->identifier); + continue; + } - /* Push the variable declaration to the top. It means that all the - * variable declarations will appear in a funny last-to-first order, - * but otherwise we run into trouble if a function is prototyped, a - * global var is decled, then the function is defined with usage of - * the global var. See glslparsertest's CorrectModule.frag. - * However, do not insert declarations before default precision statements - * or type declarations. - */ - ir_instruction* before_node = (ir_instruction*)instructions->head; - while (before_node && (before_node->ir_type == ir_type_precision || before_node->ir_type == ir_type_typedecl)) - before_node = (ir_instruction*)before_node->next; - if (before_node) - before_node->insert_before(var); - else - instructions->push_head(var); + /* Push the variable declaration to the top. It means that all the + * variable declarations will appear in a funny last-to-first order, + * but otherwise we run into trouble if a function is prototyped, a + * global var is decled, then the function is defined with usage of + * the global var. See glslparsertest's CorrectModule.frag. + * However, do not insert declarations before default precision statements + * or type declarations. + */ + ir_instruction* before_node = (ir_instruction*)instructions->head; + while (before_node && (before_node->ir_type == ir_type_precision || before_node->ir_type == ir_type_typedecl)) + before_node = (ir_instruction*)before_node->next; + if (before_node) + before_node->insert_before(var); + else + instructions->push_head(var); } instructions->append_list(&initializer_instructions); @@ -3662,7 +3936,7 @@ ast_declarator_list::hir(exec_list *instructions, ir_rvalue * ast_parameter_declarator::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { void *ctx = state; const struct glsl_type *type; @@ -3673,13 +3947,13 @@ ast_parameter_declarator::hir(exec_list *instructions, if (type == NULL) { if (name != NULL) { - _mesa_glsl_error(& loc, state, - "invalid type `%s' in declaration of `%s'", - name, this->identifier); + _mesa_glsl_error(& loc, state, + "invalid type `%s' in declaration of `%s'", + name, this->identifier); } else { - _mesa_glsl_error(& loc, state, - "invalid type in declaration of `%s'", - this->identifier); + _mesa_glsl_error(& loc, state, + "invalid type in declaration of `%s'", + this->identifier); } type = glsl_type::error_type; @@ -3699,8 +3973,8 @@ ast_parameter_declarator::hir(exec_list *instructions, */ if (type->is_void()) { if (this->identifier != NULL) - _mesa_glsl_error(& loc, state, - "named parameter cannot have type `void'"); + _mesa_glsl_error(& loc, state, + "named parameter cannot have type `void'"); is_void = true; return NULL; @@ -3718,7 +3992,7 @@ ast_parameter_declarator::hir(exec_list *instructions, if (!type->is_error() && type->is_unsized_array()) { _mesa_glsl_error(&loc, state, "arrays passed as parameters must have " - "a declared size"); + "a declared size"); type = glsl_type::error_type; } @@ -3730,7 +4004,7 @@ ast_parameter_declarator::hir(exec_list *instructions, * for function parameters the default mode is 'in'. */ apply_type_qualifier_to_variable(& this->type->qualifier, var, state, & loc, - true); + true); apply_precision_to_variable(this->type->qualifier, var, state); /* From section 4.1.7 of the GLSL 4.40 spec: @@ -3777,9 +4051,9 @@ ast_parameter_declarator::hir(exec_list *instructions, void ast_parameter_declarator::parameters_to_hir(exec_list *ast_parameters, - bool formal, - exec_list *ir_parameters, - _mesa_glsl_parse_state *state) + bool formal, + exec_list *ir_parameters, + _mesa_glsl_parse_state *state) { ast_parameter_declarator *void_param = NULL; unsigned count = 0; @@ -3789,7 +4063,7 @@ ast_parameter_declarator::parameters_to_hir(exec_list *ast_parameters, param->hir(ir_parameters, state); if (param->is_void) - void_param = param; + void_param = param; count++; } @@ -3798,7 +4072,7 @@ ast_parameter_declarator::parameters_to_hir(exec_list *ast_parameters, YYLTYPE loc = void_param->get_location(); _mesa_glsl_error(& loc, state, - "`void' parameter must be only parameter"); + "`void' parameter must be only parameter"); } } @@ -3819,7 +4093,7 @@ emit_function(_mesa_glsl_parse_state *state, ir_function *f) ir_rvalue * ast_function::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { void *ctx = state; ir_function *f = NULL; @@ -3861,8 +4135,8 @@ ast_function::hir(exec_list *instructions, * signatures for functions with the same name. */ ast_parameter_declarator::parameters_to_hir(& this->parameters, - is_definition, - & hir_parameters, state); + is_definition, + & hir_parameters, state); const char *return_type_name; const glsl_type *return_type = @@ -3871,8 +4145,8 @@ ast_function::hir(exec_list *instructions, if (!return_type) { YYLTYPE loc = this->get_location(); _mesa_glsl_error(&loc, state, - "function `%s' has undeclared return type `%s'", - name, return_type_name); + "function `%s' has undeclared return type `%s'", + name, return_type_name); return_type = glsl_type::error_type; } @@ -3882,7 +4156,7 @@ ast_function::hir(exec_list *instructions, if (this->return_type->has_qualifiers()) { YYLTYPE loc = this->get_location(); _mesa_glsl_error(& loc, state, - "function `%s' return type has qualifiers", name); + "function `%s' return type has qualifiers", name); } /* Section 6.1 (Function Definitions) of the GLSL 1.20 spec says: @@ -3893,8 +4167,8 @@ ast_function::hir(exec_list *instructions, if (return_type->is_unsized_array()) { YYLTYPE loc = this->get_location(); _mesa_glsl_error(& loc, state, - "function `%s' return type array must be explicitly " - "sized", name); + "function `%s' return type array must be explicitly " + "sized", name); } /* From section 4.1.7 of the GLSL 4.40 spec: @@ -3909,28 +4183,43 @@ ast_function::hir(exec_list *instructions, name); } + /* Create an ir_function if one doesn't already exist. */ + f = state->symbols->get_function(name); + if (f == NULL) { + f = new(ctx) ir_function(name); + if (!state->symbols->add_function(f)) { + /* This function name shadows a non-function use of the same name. */ + YYLTYPE loc = this->get_location(); + + _mesa_glsl_error(&loc, state, "function name `%s' conflicts with " + "non-function", name); + return NULL; + } + + emit_function(state, f); + } + /* Verify that this function's signature either doesn't match a previously * seen signature for a function with the same name, or, if a match is found, * that the previously seen signature does not have an associated definition. */ - f = state->symbols->get_function(name); - if (f != NULL && (state->es_shader || f->has_user_signature())) { + if (state->es_shader || f->has_user_signature()) { sig = f->exact_matching_signature(state, &hir_parameters); if (sig != NULL) { - const char *badvar = sig->qualifiers_match(&hir_parameters); - if (badvar != NULL) { - YYLTYPE loc = this->get_location(); + const char *badvar = sig->qualifiers_match(&hir_parameters); + if (badvar != NULL) { + YYLTYPE loc = this->get_location(); - _mesa_glsl_error(&loc, state, "function `%s' parameter `%s' " - "qualifiers don't match prototype", name, badvar); - } + _mesa_glsl_error(&loc, state, "function `%s' parameter `%s' " + "qualifiers don't match prototype", name, badvar); + } - if (sig->return_type != return_type) { - YYLTYPE loc = this->get_location(); + if (sig->return_type != return_type) { + YYLTYPE loc = this->get_location(); - _mesa_glsl_error(&loc, state, "function `%s' return type doesn't " - "match prototype", name); - } + _mesa_glsl_error(&loc, state, "function `%s' return type doesn't " + "match prototype", name); + } if (sig->is_defined) { if (is_definition) { @@ -3943,34 +4232,22 @@ ast_function::hir(exec_list *instructions, */ return NULL; } - } + } } - } else { - f = new(ctx) ir_function(name); - if (!state->symbols->add_function(f)) { - /* This function name shadows a non-function use of the same name. */ - YYLTYPE loc = this->get_location(); - - _mesa_glsl_error(&loc, state, "function name `%s' conflicts with " - "non-function", name); - return NULL; - } - - emit_function(state, f); } /* Verify the return type of main() */ if (strcmp(name, "main") == 0) { if (! return_type->is_void()) { - YYLTYPE loc = this->get_location(); + YYLTYPE loc = this->get_location(); - _mesa_glsl_error(& loc, state, "main() must return void"); + _mesa_glsl_error(& loc, state, "main() must return void"); } if (!hir_parameters.is_empty()) { - YYLTYPE loc = this->get_location(); + YYLTYPE loc = this->get_location(); - _mesa_glsl_error(& loc, state, "main() must not take any parameters"); + _mesa_glsl_error(& loc, state, "main() must not take any parameters"); } } @@ -3992,7 +4269,7 @@ ast_function::hir(exec_list *instructions, ir_rvalue * ast_function_definition::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { prototype->is_definition = true; prototype->hir(instructions, state); @@ -4009,20 +4286,18 @@ ast_function_definition::hir(exec_list *instructions, * Add these to the symbol table. */ state->symbols->push_scope(); - foreach_list(n, &signature->parameters) { - ir_variable *const var = ((ir_instruction *) n)->as_variable(); - - assert(var != NULL); + foreach_in_list(ir_variable, var, &signature->parameters) { + assert(var->as_variable() != NULL); /* The only way a parameter would "exist" is if two parameters have * the same name. */ if (state->symbols->name_declared_this_scope(var->name)) { - YYLTYPE loc = this->get_location(); + YYLTYPE loc = this->get_location(); - _mesa_glsl_error(& loc, state, "parameter `%s' redeclared", var->name); + _mesa_glsl_error(& loc, state, "parameter `%s' redeclared", var->name); } else { - state->symbols->add_variable(var); + state->symbols->add_variable(var); } } @@ -4038,9 +4313,9 @@ ast_function_definition::hir(exec_list *instructions, if (!signature->return_type->is_void() && !state->found_return) { YYLTYPE loc = this->get_location(); _mesa_glsl_error(& loc, state, "function `%s' has non-void return type " - "%s, but no return statement", - signature->function_name(), - signature->return_type->name); + "%s, but no return statement", + signature->function_name(), + signature->return_type->name); } /* Function definitions do not have r-values. @@ -4051,7 +4326,7 @@ ast_function_definition::hir(exec_list *instructions, ir_rvalue * ast_jump_statement::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { void *ctx = state; @@ -4061,23 +4336,23 @@ ast_jump_statement::hir(exec_list *instructions, assert(state->current_function); if (opt_return_value) { - ir_rvalue *ret = opt_return_value->hir(instructions, state); + ir_rvalue *ret = opt_return_value->hir(instructions, state); - /* The value of the return type can be NULL if the shader says - * 'return foo();' and foo() is a function that returns void. - * - * NOTE: The GLSL spec doesn't say that this is an error. The type - * of the return value is void. If the return type of the function is - * also void, then this should compile without error. Seriously. - */ - const glsl_type *const ret_type = - (ret == NULL) ? glsl_type::void_type : ret->type; + /* The value of the return type can be NULL if the shader says + * 'return foo();' and foo() is a function that returns void. + * + * NOTE: The GLSL spec doesn't say that this is an error. The type + * of the return value is void. If the return type of the function is + * also void, then this should compile without error. Seriously. + */ + const glsl_type *const ret_type = + (ret == NULL) ? glsl_type::void_type : ret->type; /* Implicit conversions are not allowed for return values prior to * ARB_shading_language_420pack. */ if (state->current_function->return_type != ret_type) { - YYLTYPE loc = this->get_location(); + YYLTYPE loc = this->get_location(); if (state->ARB_shading_language_420pack_enable) { if (!apply_implicit_conversion(state->current_function->return_type, @@ -4114,18 +4389,18 @@ ast_jump_statement::hir(exec_list *instructions, "return argument"); } - inst = new(ctx) ir_return(ret); + inst = new(ctx) ir_return(ret); } else { - if (state->current_function->return_type->base_type != - GLSL_TYPE_VOID) { - YYLTYPE loc = this->get_location(); + if (state->current_function->return_type->base_type != + GLSL_TYPE_VOID) { + YYLTYPE loc = this->get_location(); - _mesa_glsl_error(& loc, state, - "`return' with no value, in function %s returning " - "non-void", - state->current_function->function_name()); - } - inst = new(ctx) ir_return; + _mesa_glsl_error(& loc, state, + "`return' with no value, in function %s returning " + "non-void", + state->current_function->function_name()); + } + inst = new(ctx) ir_return; } state->found_return = true; @@ -4135,10 +4410,10 @@ ast_jump_statement::hir(exec_list *instructions, case ast_discard: if (state->stage != MESA_SHADER_FRAGMENT) { - YYLTYPE loc = this->get_location(); + YYLTYPE loc = this->get_location(); - _mesa_glsl_error(& loc, state, - "`discard' may only appear in a fragment shader"); + _mesa_glsl_error(& loc, state, + "`discard' may only appear in a fragment shader"); } instructions->push_tail(new(ctx) ir_discard); break; @@ -4146,26 +4421,25 @@ ast_jump_statement::hir(exec_list *instructions, case ast_break: case ast_continue: if (mode == ast_continue && - state->loop_nesting_ast == NULL) { - YYLTYPE loc = this->get_location(); + state->loop_nesting_ast == NULL) { + YYLTYPE loc = this->get_location(); - _mesa_glsl_error(& loc, state, - "continue may only appear in a loop"); + _mesa_glsl_error(& loc, state, "continue may only appear in a loop"); } else if (mode == ast_break && - state->loop_nesting_ast == NULL && - state->switch_state.switch_nesting_ast == NULL) { - YYLTYPE loc = this->get_location(); + state->loop_nesting_ast == NULL && + state->switch_state.switch_nesting_ast == NULL) { + YYLTYPE loc = this->get_location(); - _mesa_glsl_error(& loc, state, - "break may only appear in a loop or a switch"); + _mesa_glsl_error(& loc, state, + "break may only appear in a loop or a switch"); } else { - /* For a loop, inline the for loop expression again, since we don't - * know where near the end of the loop body the normal copy of it is - * going to be placed. Same goes for the condition for a do-while - * loop. - */ - if (state->loop_nesting_ast != NULL && - mode == ast_continue) { + /* For a loop, inline the for loop expression again, since we don't + * know where near the end of the loop body the normal copy of it is + * going to be placed. Same goes for the condition for a do-while + * loop. + */ + if (state->loop_nesting_ast != NULL && + mode == ast_continue) { if (state->loop_nesting_ast->rest_expression) { state->loop_nesting_ast->rest_expression->hir(instructions, state); @@ -4176,26 +4450,26 @@ ast_jump_statement::hir(exec_list *instructions, } } - if (state->switch_state.is_switch_innermost && - mode == ast_break) { - /* Force break out of switch by setting is_break switch state. - */ - ir_variable *const is_break_var = state->switch_state.is_break_var; - ir_dereference_variable *const deref_is_break_var = - new(ctx) ir_dereference_variable(is_break_var); - ir_constant *const true_val = new(ctx) ir_constant(true); - ir_assignment *const set_break_var = - new(ctx) ir_assignment(deref_is_break_var, true_val); + if (state->switch_state.is_switch_innermost && + mode == ast_break) { + /* Force break out of switch by setting is_break switch state. + */ + ir_variable *const is_break_var = state->switch_state.is_break_var; + ir_dereference_variable *const deref_is_break_var = + new(ctx) ir_dereference_variable(is_break_var); + ir_constant *const true_val = new(ctx) ir_constant(true); + ir_assignment *const set_break_var = + new(ctx) ir_assignment(deref_is_break_var, true_val); - instructions->push_tail(set_break_var); - } - else { - ir_loop_jump *const jump = - new(ctx) ir_loop_jump((mode == ast_break) - ? ir_loop_jump::jump_break - : ir_loop_jump::jump_continue); - instructions->push_tail(jump); - } + instructions->push_tail(set_break_var); + } + else { + ir_loop_jump *const jump = + new(ctx) ir_loop_jump((mode == ast_break) + ? ir_loop_jump::jump_break + : ir_loop_jump::jump_continue); + instructions->push_tail(jump); + } } break; @@ -4209,7 +4483,7 @@ ast_jump_statement::hir(exec_list *instructions, ir_rvalue * ast_selection_statement::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { void *ctx = state; @@ -4228,7 +4502,7 @@ ast_selection_statement::hir(exec_list *instructions, YYLTYPE loc = this->condition->get_location(); _mesa_glsl_error(& loc, state, "if-statement condition must be scalar " - "boolean"); + "boolean"); } ir_if *const stmt = new(ctx) ir_if(condition); @@ -4255,7 +4529,7 @@ ast_selection_statement::hir(exec_list *instructions, ir_rvalue * ast_switch_statement::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { void *ctx = state; @@ -4272,9 +4546,9 @@ ast_switch_statement::hir(exec_list *instructions, YYLTYPE loc = this->test_expression->get_location(); _mesa_glsl_error(& loc, - state, - "switch-statement expression must be scalar " - "integer"); + state, + "switch-statement expression must be scalar " + "integer"); } /* Track the switch-statement nesting in a stack-like manner. @@ -4292,27 +4566,34 @@ ast_switch_statement::hir(exec_list *instructions, ir_rvalue *const is_fallthru_val = new (ctx) ir_constant(false); state->switch_state.is_fallthru_var = new(ctx) ir_variable(glsl_type::bool_type, - "switch_is_fallthru_tmp", - ir_var_temporary, glsl_precision_low); + "switch_is_fallthru_tmp", + ir_var_temporary, glsl_precision_low); instructions->push_tail(state->switch_state.is_fallthru_var); ir_dereference_variable *deref_is_fallthru_var = new(ctx) ir_dereference_variable(state->switch_state.is_fallthru_var); instructions->push_tail(new(ctx) ir_assignment(deref_is_fallthru_var, - is_fallthru_val)); + is_fallthru_val)); /* Initalize is_break state to false. */ ir_rvalue *const is_break_val = new (ctx) ir_constant(false); - state->switch_state.is_break_var = new(ctx) ir_variable(glsl_type::bool_type, - "switch_is_break_tmp", - ir_var_temporary, glsl_precision_low); + state->switch_state.is_break_var = + new(ctx) ir_variable(glsl_type::bool_type, + "switch_is_break_tmp", + ir_var_temporary, glsl_precision_low); instructions->push_tail(state->switch_state.is_break_var); ir_dereference_variable *deref_is_break_var = new(ctx) ir_dereference_variable(state->switch_state.is_break_var); instructions->push_tail(new(ctx) ir_assignment(deref_is_break_var, - is_break_val)); + is_break_val)); + + state->switch_state.run_default = + new(ctx) ir_variable(glsl_type::bool_type, + "run_default_tmp", + ir_var_temporary, glsl_precision_low); + instructions->push_tail(state->switch_state.run_default); /* Cache test expression. */ @@ -4333,7 +4614,7 @@ ast_switch_statement::hir(exec_list *instructions, void ast_switch_statement::test_to_hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { void *ctx = state; @@ -4343,8 +4624,8 @@ ast_switch_statement::test_to_hir(exec_list *instructions, state); state->switch_state.test_var = new(ctx) ir_variable(test_val->type, - "switch_test_tmp", - ir_var_temporary, test_val->get_precision()); + "switch_test_tmp", + ir_var_temporary, test_val->get_precision()); ir_dereference_variable *deref_test_var = new(ctx) ir_dereference_variable(state->switch_state.test_var); @@ -4355,7 +4636,7 @@ ast_switch_statement::test_to_hir(exec_list *instructions, ir_rvalue * ast_switch_body::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { if (stmts != NULL) stmts->hir(instructions, state); @@ -4366,10 +4647,73 @@ ast_switch_body::hir(exec_list *instructions, ir_rvalue * ast_case_statement_list::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { - foreach_list_typed (ast_case_statement, case_stmt, link, & this->cases) - case_stmt->hir(instructions, state); + exec_list default_case, after_default, tmp; + + foreach_list_typed (ast_case_statement, case_stmt, link, & this->cases) { + case_stmt->hir(&tmp, state); + + /* Default case. */ + if (state->switch_state.previous_default && default_case.is_empty()) { + default_case.append_list(&tmp); + continue; + } + + /* If default case found, append 'after_default' list. */ + if (!default_case.is_empty()) + after_default.append_list(&tmp); + else + instructions->append_list(&tmp); + } + + /* Handle the default case. This is done here because default might not be + * the last case. We need to add checks against following cases first to see + * if default should be chosen or not. + */ + if (!default_case.is_empty()) { + + ir_rvalue *const true_val = new (state) ir_constant(true); + ir_dereference_variable *deref_run_default_var = + new(state) ir_dereference_variable(state->switch_state.run_default); + + /* Choose to run default case initially, following conditional + * assignments might change this. + */ + ir_assignment *const init_var = + new(state) ir_assignment(deref_run_default_var, true_val); + instructions->push_tail(init_var); + + /* Default case was the last one, no checks required. */ + if (after_default.is_empty()) { + instructions->append_list(&default_case); + return NULL; + } + + foreach_in_list(ir_instruction, ir, &after_default) { + ir_assignment *assign = ir->as_assignment(); + + if (!assign) + continue; + + /* Clone the check between case label and init expression. */ + ir_expression *exp = (ir_expression*) assign->condition; + ir_expression *clone = exp->clone(state, NULL); + + ir_dereference_variable *deref_var = + new(state) ir_dereference_variable(state->switch_state.run_default); + ir_rvalue *const false_val = new (state) ir_constant(false); + + ir_assignment *const set_false = + new(state) ir_assignment(deref_var, false_val, clone); + + instructions->push_tail(set_false); + } + + /* Append default case and all cases after it. */ + instructions->append_list(&default_case); + instructions->append_list(&after_default); + } /* Case statements do not have r-values. */ return NULL; @@ -4377,7 +4721,7 @@ ast_case_statement_list::hir(exec_list *instructions, ir_rvalue * ast_case_statement::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { labels->hir(instructions, state); @@ -4389,8 +4733,8 @@ ast_case_statement::hir(exec_list *instructions, new(state) ir_dereference_variable(state->switch_state.is_break_var); ir_assignment *const reset_fallthru_on_break = new(state) ir_assignment(deref_is_fallthru_var, - false_val, - deref_is_break_var); + false_val, + deref_is_break_var); instructions->push_tail(reset_fallthru_on_break); /* Guard case statements depending on fallthru state. */ @@ -4410,7 +4754,7 @@ ast_case_statement::hir(exec_list *instructions, ir_rvalue * ast_case_label_list::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { foreach_list_typed (ast_case_label, label, link, & this->labels) label->hir(instructions, state); @@ -4421,7 +4765,7 @@ ast_case_label_list::hir(exec_list *instructions, ir_rvalue * ast_case_label::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { void *ctx = state; @@ -4439,62 +4783,107 @@ ast_case_label::hir(exec_list *instructions, ir_constant *label_const = label_rval->constant_expression_value(); if (!label_const) { - YYLTYPE loc = this->test_value->get_location(); + YYLTYPE loc = this->test_value->get_location(); - _mesa_glsl_error(& loc, state, - "switch statement case label must be a " - "constant expression"); + _mesa_glsl_error(& loc, state, + "switch statement case label must be a " + "constant expression"); - /* Stuff a dummy value in to allow processing to continue. */ - label_const = new(ctx) ir_constant(0); + /* Stuff a dummy value in to allow processing to continue. */ + label_const = new(ctx) ir_constant(0); } else { - ast_expression *previous_label = (ast_expression *) - hash_table_find(state->switch_state.labels_ht, - (void *)(uintptr_t)label_const->value.u[0]); + ast_expression *previous_label = (ast_expression *) + hash_table_find(state->switch_state.labels_ht, + (void *)(uintptr_t)label_const->value.u[0]); - if (previous_label) { - YYLTYPE loc = this->test_value->get_location(); - _mesa_glsl_error(& loc, state, - "duplicate case value"); + if (previous_label) { + YYLTYPE loc = this->test_value->get_location(); + _mesa_glsl_error(& loc, state, "duplicate case value"); - loc = previous_label->get_location(); - _mesa_glsl_error(& loc, state, - "this is the previous case label"); - } else { - hash_table_insert(state->switch_state.labels_ht, - this->test_value, - (void *)(uintptr_t)label_const->value.u[0]); - } + loc = previous_label->get_location(); + _mesa_glsl_error(& loc, state, "this is the previous case label"); + } else { + hash_table_insert(state->switch_state.labels_ht, + this->test_value, + (void *)(uintptr_t)label_const->value.u[0]); + } } ir_dereference_variable *deref_test_var = - new(ctx) ir_dereference_variable(state->switch_state.test_var); + new(ctx) ir_dereference_variable(state->switch_state.test_var); - ir_rvalue *const test_cond = new(ctx) ir_expression(ir_binop_all_equal, - label_const, - deref_test_var); + ir_expression *test_cond = new(ctx) ir_expression(ir_binop_all_equal, + label_const, + deref_test_var); + + /* + * From GLSL 4.40 specification section 6.2 ("Selection"): + * + * "The type of the init-expression value in a switch statement must + * be a scalar int or uint. The type of the constant-expression value + * in a case label also must be a scalar int or uint. When any pair + * of these values is tested for "equal value" and the types do not + * match, an implicit conversion will be done to convert the int to a + * uint (see section 4.1.10 “Implicit Conversions”) before the compare + * is done." + */ + if (label_const->type != state->switch_state.test_var->type) { + YYLTYPE loc = this->test_value->get_location(); + + const glsl_type *type_a = label_const->type; + const glsl_type *type_b = state->switch_state.test_var->type; + + /* Check if int->uint implicit conversion is supported. */ + bool integer_conversion_supported = + glsl_type::int_type->can_implicitly_convert_to(glsl_type::uint_type, + state); + + if ((!type_a->is_integer() || !type_b->is_integer()) || + !integer_conversion_supported) { + _mesa_glsl_error(&loc, state, "type mismatch with switch " + "init-expression and case label (%s != %s)", + type_a->name, type_b->name); + } else { + /* Conversion of the case label. */ + if (type_a->base_type == GLSL_TYPE_INT) { + if (!apply_implicit_conversion(glsl_type::uint_type, + test_cond->operands[0], state)) + _mesa_glsl_error(&loc, state, "implicit type conversion error"); + } else { + /* Conversion of the init-expression value. */ + if (!apply_implicit_conversion(glsl_type::uint_type, + test_cond->operands[1], state)) + _mesa_glsl_error(&loc, state, "implicit type conversion error"); + } + } + } ir_assignment *set_fallthru_on_test = - new(ctx) ir_assignment(deref_fallthru_var, - true_val, - test_cond); + new(ctx) ir_assignment(deref_fallthru_var, true_val, test_cond); instructions->push_tail(set_fallthru_on_test); } else { /* default case */ if (state->switch_state.previous_default) { - YYLTYPE loc = this->get_location(); - _mesa_glsl_error(& loc, state, - "multiple default labels in one switch"); + YYLTYPE loc = this->get_location(); + _mesa_glsl_error(& loc, state, + "multiple default labels in one switch"); - loc = state->switch_state.previous_default->get_location(); - _mesa_glsl_error(& loc, state, - "this is the first default label"); + loc = state->switch_state.previous_default->get_location(); + _mesa_glsl_error(& loc, state, "this is the first default label"); } state->switch_state.previous_default = this; + /* Set fallthru condition on 'run_default' bool. */ + ir_dereference_variable *deref_run_default = + new(ctx) ir_dereference_variable(state->switch_state.run_default); + ir_rvalue *const cond_true = new(ctx) ir_constant(true); + ir_expression *test_cond = new(ctx) ir_expression(ir_binop_all_equal, + cond_true, + deref_run_default); + /* Set falltrhu state. */ ir_assignment *set_fallthru = - new(ctx) ir_assignment(deref_fallthru_var, true_val); + new(ctx) ir_assignment(deref_fallthru_var, true_val, test_cond); instructions->push_tail(set_fallthru); } @@ -4505,34 +4894,34 @@ ast_case_label::hir(exec_list *instructions, void ast_iteration_statement::condition_to_hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { void *ctx = state; if (condition != NULL) { ir_rvalue *const cond = - condition->hir(instructions, state); + condition->hir(instructions, state); if ((cond == NULL) - || !cond->type->is_boolean() || !cond->type->is_scalar()) { - YYLTYPE loc = condition->get_location(); + || !cond->type->is_boolean() || !cond->type->is_scalar()) { + YYLTYPE loc = condition->get_location(); - _mesa_glsl_error(& loc, state, - "loop condition must be scalar boolean"); + _mesa_glsl_error(& loc, state, + "loop condition must be scalar boolean"); } else { - /* As the first code in the loop body, generate a block that looks - * like 'if (!condition) break;' as the loop termination condition. - */ - ir_rvalue *const not_cond = - new(ctx) ir_expression(ir_unop_logic_not, cond); + /* As the first code in the loop body, generate a block that looks + * like 'if (!condition) break;' as the loop termination condition. + */ + ir_rvalue *const not_cond = + new(ctx) ir_expression(ir_unop_logic_not, cond); - ir_if *const if_stmt = new(ctx) ir_if(not_cond); + ir_if *const if_stmt = new(ctx) ir_if(not_cond); - ir_jump *const break_stmt = - new(ctx) ir_loop_jump(ir_loop_jump::jump_break); + ir_jump *const break_stmt = + new(ctx) ir_loop_jump(ir_loop_jump::jump_break); - if_stmt->then_instructions.push_tail(break_stmt); - instructions->push_tail(if_stmt); + if_stmt->then_instructions.push_tail(break_stmt); + instructions->push_tail(if_stmt); } } } @@ -4540,7 +4929,7 @@ ast_iteration_statement::condition_to_hir(exec_list *instructions, ir_rvalue * ast_iteration_statement::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { void *ctx = state; @@ -4632,7 +5021,7 @@ is_valid_default_precision_type(const struct glsl_type *const type) ir_rvalue * ast_type_specifier::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { if (this->default_precision == ast_precision_none && this->structure == NULL) return NULL; @@ -4725,7 +5114,7 @@ ast_type_specifier::hir(exec_list *instructions, */ ir_variable *const junk = new(state) ir_variable(type, "#default precision", - ir_var_temporary, (glsl_precision)this->default_precision); + ir_var_auto, (glsl_precision)this->default_precision); state->symbols->add_variable(junk); state->had_float_precision = true; @@ -4772,12 +5161,12 @@ ast_type_specifier::hir(exec_list *instructions, */ unsigned ast_process_structure_or_interface_block(exec_list *instructions, - struct _mesa_glsl_parse_state *state, - exec_list *declarations, - YYLTYPE &loc, - glsl_struct_field **fields_ret, + struct _mesa_glsl_parse_state *state, + exec_list *declarations, + YYLTYPE &loc, + glsl_struct_field **fields_ret, bool is_interface, - bool block_row_major, + enum glsl_matrix_layout matrix_layout, bool allow_reserved_names, ir_variable_mode var_mode) { @@ -4789,9 +5178,7 @@ ast_process_structure_or_interface_block(exec_list *instructions, * 'declarations' list in each of the elements. */ foreach_list_typed (ast_declarator_list, decl_list, link, declarations) { - foreach_list_const (decl_ptr, & decl_list->declarations) { - decl_count++; - } + decl_count += decl_list->declarations.length(); } /* Allocate storage for the fields and process the field @@ -4800,7 +5187,7 @@ ast_process_structure_or_interface_block(exec_list *instructions, * other structure definitions or in interface blocks are processed. */ glsl_struct_field *const fields = ralloc_array(state, glsl_struct_field, - decl_count); + decl_count); unsigned i = 0; foreach_list_typed (ast_declarator_list, decl_list, link, declarations) { @@ -4812,15 +5199,15 @@ ast_process_structure_or_interface_block(exec_list *instructions, * embedded structure definitions have been removed from the language. */ if (state->es_shader && decl_list->type->specifier->structure != NULL) { - _mesa_glsl_error(&loc, state, "embedded structure definitions are " - "not allowed in GLSL ES 1.00"); + _mesa_glsl_error(&loc, state, "embedded structure definitions are " + "not allowed in GLSL ES 1.00"); } const glsl_type *decl_type = decl_list->type->glsl_type(& type_name, state); foreach_list_typed (ast_declaration, decl, link, - &decl_list->declarations) { + &decl_list->declarations) { if (!allow_reserved_names) validate_identifier(decl->identifier, loc, state); @@ -4875,17 +5262,20 @@ ast_process_structure_or_interface_block(exec_list *instructions, "members"); } - field_type = process_array_type(&loc, decl_type, + field_type = process_array_type(&loc, decl_type, decl->array_specifier, state); fields[i].type = field_type; - fields[i].name = decl->identifier; - fields[i].precision = (glsl_precision)decl_list->type->qualifier.precision; + fields[i].name = decl->identifier; + fields[i].precision = (glsl_precision)decl_list->type->qualifier.precision; fields[i].location = -1; fields[i].interpolation = interpret_interpolation_qualifier(qual, var_mode, state, &loc); fields[i].centroid = qual->flags.q.centroid ? 1 : 0; fields[i].sample = qual->flags.q.sample ? 1 : 0; + /* Only save explicitly defined streams in block's field */ + fields[i].stream = qual->flags.q.explicit_stream ? qual->stream : -1; + if (qual->flags.q.row_major || qual->flags.q.column_major) { if (!qual->flags.q.uniform) { _mesa_glsl_error(&loc, state, @@ -4901,16 +5291,39 @@ ast_process_structure_or_interface_block(exec_list *instructions, "with uniform interface blocks"); } - if (field_type->is_matrix() || - (field_type->is_array() && field_type->fields.array->is_matrix())) { - fields[i].row_major = block_row_major; - if (qual->flags.q.row_major) - fields[i].row_major = true; - else if (qual->flags.q.column_major) - fields[i].row_major = false; + if ((qual->flags.q.uniform || !is_interface) && + qual->has_auxiliary_storage()) { + _mesa_glsl_error(&loc, state, + "auxiliary storage qualifiers cannot be used " + "in uniform blocks or structures."); } - i++; + /* Propogate row- / column-major information down the fields of the + * structure or interface block. Structures need this data because + * the structure may contain a structure that contains ... a matrix + * that need the proper layout. + */ + if (field_type->without_array()->is_matrix() + || field_type->without_array()->is_record()) { + /* If no layout is specified for the field, inherit the layout + * from the block. + */ + fields[i].matrix_layout = matrix_layout; + + if (qual->flags.q.row_major) + fields[i].matrix_layout = GLSL_MATRIX_LAYOUT_ROW_MAJOR; + else if (qual->flags.q.column_major) + fields[i].matrix_layout = GLSL_MATRIX_LAYOUT_COLUMN_MAJOR; + + /* If we're processing an interface block, the matrix layout must + * be decided by this point. + */ + assert(!is_interface + || fields[i].matrix_layout == GLSL_MATRIX_LAYOUT_ROW_MAJOR + || fields[i].matrix_layout == GLSL_MATRIX_LAYOUT_COLUMN_MAJOR); + } + + i++; } } @@ -4923,7 +5336,7 @@ ast_process_structure_or_interface_block(exec_list *instructions, ir_rvalue * ast_struct_specifier::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { YYLTYPE loc = this->get_location(); @@ -4950,19 +5363,19 @@ ast_struct_specifier::hir(exec_list *instructions, */ if (state->language_version != 110 && state->struct_specifier_depth != 0) _mesa_glsl_error(&loc, state, - "embedded structure declartions are not allowed"); + "embedded structure declarations are not allowed"); state->struct_specifier_depth++; glsl_struct_field *fields; unsigned decl_count = ast_process_structure_or_interface_block(instructions, - state, - &this->declarations, - loc, - &fields, - false, + state, + &this->declarations, + loc, + &fields, false, + GLSL_MATRIX_LAYOUT_INHERITED, false /* allow_reserved_names */, ir_var_auto); @@ -4975,27 +5388,27 @@ ast_struct_specifier::hir(exec_list *instructions, _mesa_glsl_error(& loc, state, "struct `%s' previously defined", name); } else { const glsl_type **s = reralloc(state, state->user_structures, - const glsl_type *, - state->num_user_structures + 1); + const glsl_type *, + state->num_user_structures + 1); if (s != NULL) { - s[state->num_user_structures] = t; - state->user_structures = s; - state->num_user_structures++; - ir_typedecl_statement* stmt = new(state) ir_typedecl_statement(t); - - /* Push the struct declarations to the top. - * However, do not insert declarations before default precision - * statements or other declarations - */ - ir_instruction* before_node = (ir_instruction*)instructions->head; - while (before_node && - (before_node->ir_type == ir_type_precision || - before_node->ir_type == ir_type_typedecl)) - before_node = (ir_instruction*)before_node->next; - if (before_node) - before_node->insert_before(stmt); - else - instructions->push_head(stmt); + s[state->num_user_structures] = t; + state->user_structures = s; + state->num_user_structures++; + ir_typedecl_statement* stmt = new(state) ir_typedecl_statement(t); + + /* Push the struct declarations to the top. + * However, do not insert declarations before default precision + * statements or other declarations + */ + ir_instruction* before_node = (ir_instruction*)instructions->head; + while (before_node && + (before_node->ir_type == ir_type_precision || + before_node->ir_type == ir_type_typedecl)) + before_node = (ir_instruction*)before_node->next; + if (before_node) + before_node->insert_before(stmt); + else + instructions->push_head(stmt); } } @@ -5041,7 +5454,7 @@ private: ir_rvalue * ast_interface_block::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { YYLTYPE loc = this->get_location(); @@ -5077,10 +5490,21 @@ ast_interface_block::hir(exec_list *instructions, assert(!"interface block layout qualifier not found!"); } + enum glsl_matrix_layout matrix_layout = GLSL_MATRIX_LAYOUT_INHERITED; + if (this->layout.flags.q.row_major) + matrix_layout = GLSL_MATRIX_LAYOUT_ROW_MAJOR; + else if (this->layout.flags.q.column_major) + matrix_layout = GLSL_MATRIX_LAYOUT_COLUMN_MAJOR; + bool redeclaring_per_vertex = strcmp(this->block_name, "gl_PerVertex") == 0; - bool block_row_major = this->layout.flags.q.row_major; exec_list declared_variables; glsl_struct_field *fields; + + /* Treat an interface block as one level of nesting, so that embedded struct + * specifiers will be disallowed. + */ + state->struct_specifier_depth++; + unsigned int num_variables = ast_process_structure_or_interface_block(&declared_variables, state, @@ -5088,10 +5512,12 @@ ast_interface_block::hir(exec_list *instructions, loc, &fields, true, - block_row_major, + matrix_layout, redeclaring_per_vertex, var_mode); + state->struct_specifier_depth--; + if (!redeclaring_per_vertex) validate_identifier(this->block_name, loc, state); @@ -5136,7 +5562,7 @@ ast_interface_block::hir(exec_list *instructions, } if (this->instance_name != NULL) { _mesa_glsl_error(&loc, state, - "gl_PerVertex input may not be redeclared with " + "gl_PerVertex output may not be redeclared with " "an instance name"); } break; @@ -5294,6 +5720,9 @@ ast_interface_block::hir(exec_list *instructions, var_mode, glsl_precision_undefined); } + var->data.matrix_layout = matrix_layout == GLSL_MATRIX_LAYOUT_INHERITED + ? GLSL_MATRIX_LAYOUT_COLUMN_MAJOR : matrix_layout; + if (state->stage == MESA_SHADER_GEOMETRY && var_mode == ir_var_shader_in) handle_geometry_shader_input_decl(state, loc, var); @@ -5308,12 +5737,19 @@ ast_interface_block::hir(exec_list *instructions, earlier->reinit_interface_type(block_type); delete var; } else { + /* Propagate the "binding" keyword into this UBO's fields; + * the UBO declaration itself doesn't get an ir_variable unless it + * has an instance name. This is ugly. + */ + var->data.explicit_binding = this->layout.flags.q.explicit_binding; + var->data.binding = this->layout.binding; + state->symbols->add_variable(var); instructions->push_tail(var); } } else { /* In order to have an array size, the block must also be declared with - * an instane name. + * an instance name. */ assert(this->array_specifier == NULL); @@ -5327,11 +5763,29 @@ ast_interface_block::hir(exec_list *instructions, var->data.sample = fields[i].sample; var->init_interface_type(block_type); + if (fields[i].matrix_layout == GLSL_MATRIX_LAYOUT_INHERITED) { + var->data.matrix_layout = matrix_layout == GLSL_MATRIX_LAYOUT_INHERITED + ? GLSL_MATRIX_LAYOUT_COLUMN_MAJOR : matrix_layout; + } else { + var->data.matrix_layout = fields[i].matrix_layout; + } + + if (fields[i].stream != -1 && + ((unsigned)fields[i].stream) != this->layout.stream) { + _mesa_glsl_error(&loc, state, + "stream layout qualifier on " + "interface block member `%s' does not match " + "the interface block (%d vs %d)", + var->name, fields[i].stream, this->layout.stream); + } + + var->data.stream = this->layout.stream; + if (redeclaring_per_vertex) { ir_variable *earlier = get_variable_being_redeclared(var, loc, state, true /* allow_all_redeclarations */); - if (strncmp(var->name, "gl_", 3) != 0 || earlier == NULL) { + if (!is_gl_identifier(var->name) || earlier == NULL) { _mesa_glsl_error(&loc, state, "redeclaration of gl_PerVertex can only " "include built-in variables"); @@ -5381,8 +5835,8 @@ ast_interface_block::hir(exec_list *instructions, * thinking there are conflicting definitions of gl_PerVertex in the * shader. */ - foreach_list_safe(node, instructions) { - ir_variable *const var = ((ir_instruction *) node)->as_variable(); + foreach_in_list_safe(ir_instruction, node, instructions) { + ir_variable *const var = node->as_variable(); if (var != NULL && var->get_interface_type() == earlier_per_vertex && var->data.mode == var_mode) { @@ -5413,7 +5867,7 @@ ast_gs_input_layout::hir(exec_list *instructions, * was consistent with this one. */ if (state->gs_input_prim_type_specified && - state->gs_input_prim_type != this->prim_type) { + state->in_qualifier->prim_type != this->prim_type) { _mesa_glsl_error(&loc, state, "geometry shader input layout does not match" " previous declaration"); @@ -5434,13 +5888,12 @@ ast_gs_input_layout::hir(exec_list *instructions, } state->gs_input_prim_type_specified = true; - state->gs_input_prim_type = this->prim_type; /* If any shader inputs occurred before this declaration and did not * specify an array size, their size is determined now. */ - foreach_list (node, instructions) { - ir_variable *var = ((ir_instruction *) node)->as_variable(); + foreach_in_list(ir_instruction, node, instructions) { + ir_variable *var = node->as_variable(); if (var == NULL || var->data.mode != ir_var_shader_in) continue; @@ -5546,7 +5999,7 @@ ast_cs_input_layout::hir(exec_list *instructions, static void detect_conflicting_assignments(struct _mesa_glsl_parse_state *state, - exec_list *instructions) + exec_list *instructions) { bool gl_FragColor_assigned = false; bool gl_FragData_assigned = false; @@ -5557,22 +6010,22 @@ detect_conflicting_assignments(struct _mesa_glsl_parse_state *state, YYLTYPE loc; memset(&loc, 0, sizeof(loc)); - foreach_list(node, instructions) { - ir_variable *var = ((ir_instruction *)node)->as_variable(); + foreach_in_list(ir_instruction, node, instructions) { + ir_variable *var = node->as_variable(); if (!var || !var->data.assigned) - continue; + continue; if (strcmp(var->name, "gl_FragColor") == 0) - gl_FragColor_assigned = true; + gl_FragColor_assigned = true; else if (strcmp(var->name, "gl_FragData") == 0) - gl_FragData_assigned = true; - else if (strncmp(var->name, "gl_", 3) != 0) { - if (state->stage == MESA_SHADER_FRAGMENT && - var->data.mode == ir_var_shader_out) { - user_defined_fs_output_assigned = true; - user_defined_fs_output = var; - } + gl_FragData_assigned = true; + else if (!is_gl_identifier(var->name)) { + if (state->stage == MESA_SHADER_FRAGMENT && + var->data.mode == ir_var_shader_out) { + user_defined_fs_output_assigned = true; + user_defined_fs_output = var; + } } } @@ -5593,15 +6046,15 @@ detect_conflicting_assignments(struct _mesa_glsl_parse_state *state, */ if (gl_FragColor_assigned && gl_FragData_assigned) { _mesa_glsl_error(&loc, state, "fragment shader writes to both " - "`gl_FragColor' and `gl_FragData'"); + "`gl_FragColor' and `gl_FragData'"); } else if (gl_FragColor_assigned && user_defined_fs_output_assigned) { _mesa_glsl_error(&loc, state, "fragment shader writes to both " - "`gl_FragColor' and `%s'", - user_defined_fs_output->name); + "`gl_FragColor' and `%s'", + user_defined_fs_output->name); } else if (gl_FragData_assigned && user_defined_fs_output_assigned) { _mesa_glsl_error(&loc, state, "fragment shader writes to both " - "`gl_FragData' and `%s'", - user_defined_fs_output->name); + "`gl_FragData' and `%s'", + user_defined_fs_output->name); } } @@ -5647,8 +6100,8 @@ remove_per_vertex_blocks(exec_list *instructions, /* Remove any ir_variable declarations that refer to the interface block * we're removing. */ - foreach_list_safe(node, instructions) { - ir_variable *const var = ((ir_instruction *) node)->as_variable(); + foreach_in_list_safe(ir_instruction, node, instructions) { + ir_variable *const var = node->as_variable(); if (var != NULL && var->get_interface_type() == per_vertex && var->data.mode == mode) { state->symbols->disable_variable(var->name); diff --git a/3rdparty/glsl-optimizer/src/glsl/ast_type.cpp b/3rdparty/glsl-optimizer/src/glsl/ast_type.cpp index 200566c6d..b596cd59e 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ast_type.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ast_type.cpp @@ -122,14 +122,28 @@ ast_type_qualifier::merge_qualifier(YYLTYPE *loc, ubo_binding_mask.flags.q.explicit_binding = 1; ubo_binding_mask.flags.q.explicit_offset = 1; + ast_type_qualifier stream_layout_mask; + stream_layout_mask.flags.i = 0; + stream_layout_mask.flags.q.stream = 1; + /* Uniform block layout qualifiers get to overwrite each * other (rightmost having priority), while all other * qualifiers currently don't allow duplicates. */ + ast_type_qualifier allowed_duplicates_mask; + allowed_duplicates_mask.flags.i = + ubo_mat_mask.flags.i | + ubo_layout_mask.flags.i | + ubo_binding_mask.flags.i; - if ((this->flags.i & q.flags.i & ~(ubo_mat_mask.flags.i | - ubo_layout_mask.flags.i | - ubo_binding_mask.flags.i)) != 0) { + /* Geometry shaders can have several layout qualifiers + * assigning different stream values. + */ + if (state->stage == MESA_SHADER_GEOMETRY) + allowed_duplicates_mask.flags.i |= + stream_layout_mask.flags.i; + + if ((this->flags.i & q.flags.i & ~allowed_duplicates_mask.flags.i) != 0) { _mesa_glsl_error(loc, state, "duplicate layout qualifiers used"); return false; @@ -154,6 +168,49 @@ ast_type_qualifier::merge_qualifier(YYLTYPE *loc, this->max_vertices = q.max_vertices; } + if (q.flags.q.invocations) { + if (this->flags.q.invocations && this->invocations != q.invocations) { + _mesa_glsl_error(loc, state, + "geometry shader set conflicting invocations " + "(%d and %d)", this->invocations, q.invocations); + return false; + } + this->invocations = q.invocations; + } + + if (state->stage == MESA_SHADER_GEOMETRY && + state->has_explicit_attrib_stream()) { + if (q.flags.q.stream && q.stream >= state->ctx->Const.MaxVertexStreams) { + _mesa_glsl_error(loc, state, + "`stream' value is larger than MAX_VERTEX_STREAMS - 1 " + "(%d > %d)", + q.stream, state->ctx->Const.MaxVertexStreams - 1); + } + if (this->flags.q.explicit_stream && + this->stream >= state->ctx->Const.MaxVertexStreams) { + _mesa_glsl_error(loc, state, + "`stream' value is larger than MAX_VERTEX_STREAMS - 1 " + "(%d > %d)", + this->stream, state->ctx->Const.MaxVertexStreams - 1); + } + + if (!this->flags.q.explicit_stream) { + if (q.flags.q.stream) { + this->flags.q.stream = 1; + this->stream = q.stream; + } else if (!this->flags.q.stream && this->flags.q.out) { + /* Assign default global stream value */ + this->flags.q.stream = 1; + this->stream = state->out_qualifier->stream; + } + } else { + if (q.flags.q.explicit_stream) { + _mesa_glsl_error(loc, state, + "duplicate layout `stream' qualifier"); + } + } + } + if ((q.flags.i & ubo_mat_mask.flags.i) != 0) this->flags.i &= ~ubo_mat_mask.flags.i; if ((q.flags.i & ubo_layout_mask.flags.i) != 0) @@ -198,3 +255,109 @@ ast_type_qualifier::merge_qualifier(YYLTYPE *loc, return true; } +bool +ast_type_qualifier::merge_in_qualifier(YYLTYPE *loc, + _mesa_glsl_parse_state *state, + ast_type_qualifier q, + ast_node* &node) +{ + void *mem_ctx = state; + bool create_gs_ast = false; + bool create_cs_ast = false; + ast_type_qualifier valid_in_mask; + valid_in_mask.flags.i = 0; + + switch (state->stage) { + case MESA_SHADER_GEOMETRY: + if (q.flags.q.prim_type) { + /* Make sure this is a valid input primitive type. */ + switch (q.prim_type) { + case GL_POINTS: + case GL_LINES: + case GL_LINES_ADJACENCY: + case GL_TRIANGLES: + case GL_TRIANGLES_ADJACENCY: + break; + default: + _mesa_glsl_error(loc, state, + "invalid geometry shader input primitive type"); + break; + } + } + + create_gs_ast |= + q.flags.q.prim_type && + !state->in_qualifier->flags.q.prim_type; + + valid_in_mask.flags.q.prim_type = 1; + valid_in_mask.flags.q.invocations = 1; + break; + case MESA_SHADER_FRAGMENT: + if (q.flags.q.early_fragment_tests) { + state->early_fragment_tests = true; + } else { + _mesa_glsl_error(loc, state, "invalid input layout qualifier"); + } + break; + case MESA_SHADER_COMPUTE: + create_cs_ast |= + q.flags.q.local_size != 0 && + state->in_qualifier->flags.q.local_size == 0; + + valid_in_mask.flags.q.local_size = 7; + break; + default: + _mesa_glsl_error(loc, state, + "input layout qualifiers only valid in " + "geometry, fragment and compute shaders"); + break; + } + + /* Generate an error when invalid input layout qualifiers are used. */ + if ((q.flags.i & ~valid_in_mask.flags.i) != 0) { + _mesa_glsl_error(loc, state, + "invalid input layout qualifiers used"); + return false; + } + + /* Input layout qualifiers can be specified multiple + * times in separate declarations, as long as they match. + */ + if (this->flags.q.prim_type) { + if (q.flags.q.prim_type && + this->prim_type != q.prim_type) { + _mesa_glsl_error(loc, state, + "conflicting input primitive types specified"); + } + } else if (q.flags.q.prim_type) { + state->in_qualifier->flags.q.prim_type = 1; + state->in_qualifier->prim_type = q.prim_type; + } + + if (this->flags.q.invocations && + q.flags.q.invocations && + this->invocations != q.invocations) { + _mesa_glsl_error(loc, state, + "conflicting invocations counts specified"); + return false; + } else if (q.flags.q.invocations) { + this->flags.q.invocations = 1; + this->invocations = q.invocations; + } + + if (create_gs_ast) { + node = new(mem_ctx) ast_gs_input_layout(*loc, q.prim_type); + } else if (create_cs_ast) { + /* Infer a local_size of 1 for every unspecified dimension */ + unsigned local_size[3]; + for (int i = 0; i < 3; i++) { + if (q.flags.q.local_size & (1 << i)) + local_size[i] = q.local_size[i]; + else + local_size[i] = 1; + } + node = new(mem_ctx) ast_cs_input_layout(*loc, local_size); + } + + return true; +} diff --git a/3rdparty/glsl-optimizer/src/glsl/builtin_functions.cpp b/3rdparty/glsl-optimizer/src/glsl/builtin_functions.cpp index 680638b34..ee85b44bb 100644 --- a/3rdparty/glsl-optimizer/src/glsl/builtin_functions.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/builtin_functions.cpp @@ -62,6 +62,10 @@ #include "program/prog_instruction.h" #include +#define M_PIf ((float) M_PI) +#define M_PI_2f ((float) M_PI_2) +#define M_PI_4f ((float) M_PI_4) + using namespace ir_builder; /** @@ -69,7 +73,7 @@ using namespace ir_builder; * @{ */ static bool -always_available(const _mesa_glsl_parse_state *state) +always_available(const _mesa_glsl_parse_state *) { return true; } @@ -219,13 +223,6 @@ shader_integer_mix(const _mesa_glsl_parse_state *state) return v130(state) && state->EXT_shader_integer_mix_enable; } -static bool -shader_packing(const _mesa_glsl_parse_state *state) -{ - return state->ARB_shading_language_packing_enable || - state->is_version(400, 0); -} - static bool shader_packing_or_es3(const _mesa_glsl_parse_state *state) { @@ -233,12 +230,35 @@ shader_packing_or_es3(const _mesa_glsl_parse_state *state) state->is_version(400, 300); } +static bool +shader_packing_or_es3_or_gpu_shader5(const _mesa_glsl_parse_state *state) +{ + return state->ARB_shading_language_packing_enable || + state->ARB_gpu_shader5_enable || + state->is_version(400, 300); +} + static bool gpu_shader5(const _mesa_glsl_parse_state *state) { return state->is_version(400, 0) || state->ARB_gpu_shader5_enable; } +static bool +shader_packing_or_gpu_shader5(const _mesa_glsl_parse_state *state) +{ + return state->ARB_shading_language_packing_enable || + gpu_shader5(state); +} + +static bool +fs_gpu_shader5(const _mesa_glsl_parse_state *state) +{ + return state->stage == MESA_SHADER_FRAGMENT && + (state->is_version(400, 0) || state->ARB_gpu_shader5_enable); +} + + static bool texture_array_lod(const _mesa_glsl_parse_state *state) { @@ -323,6 +343,14 @@ fs_oes_derivatives(const _mesa_glsl_parse_state *state) state->OES_standard_derivatives_enable); } +static bool +fs_derivative_control(const _mesa_glsl_parse_state *state) +{ + return state->stage == MESA_SHADER_FRAGMENT && + (state->is_version(450, 0) || + state->ARB_derivative_control_enable); +} + static bool tex1d_lod(const _mesa_glsl_parse_state *state) { @@ -373,6 +401,12 @@ shader_image_load_store(const _mesa_glsl_parse_state *state) state->ARB_shader_image_load_store_enable); } +static bool +gs_streams(const _mesa_glsl_parse_state *state) +{ + return gpu_shader5(state) && gs_only(state); +} + /** @} */ /******************************************************************************/ @@ -434,6 +468,7 @@ private: ir_swizzle *matrix_elt(ir_variable *var, int col, int row); ir_expression *asin_expr(ir_variable *x); + void do_atan(ir_factory &body, const glsl_type *type, ir_variable *res, operand y_over_x); /** * Call function \param f with parameters specified as the linked @@ -608,12 +643,22 @@ private: B0(EmitVertex) B0(EndPrimitive) + ir_function_signature *_EmitStreamVertex(builtin_available_predicate avail, + const glsl_type *stream_type); + ir_function_signature *_EndStreamPrimitive(builtin_available_predicate avail, + const glsl_type *stream_type); B2(textureQueryLod); B1(textureQueryLevels); B1(dFdx); B1(dFdy); B1(fwidth); + B1(dFdxCoarse); + B1(dFdyCoarse); + B1(fwidthCoarse); + B1(dFdxFine); + B1(dFdyFine); + B1(fwidthFine); B1(noise1); B1(noise2); B1(noise3); @@ -631,6 +676,9 @@ private: B1(uaddCarry) B1(usubBorrow) B1(mulExtended) + B1(interpolateAtCentroid) + B1(interpolateAtOffset) + B1(interpolateAtSample) ir_function_signature *_atomic_intrinsic(builtin_available_predicate avail); ir_function_signature *_atomic_op(const char *intrinsic, @@ -699,7 +747,8 @@ builtin_builder::find(_mesa_glsl_parse_state *state, if (f == NULL) return NULL; - ir_function_signature *sig = f->matching_signature(state, actual_parameters); + ir_function_signature *sig = + f->matching_signature(state, actual_parameters, true); if (sig == NULL) return NULL; @@ -1017,16 +1066,16 @@ builtin_builder::create_builtins() _uintBitsToFloat(glsl_type::uvec4_type), NULL); - add_function("packUnorm2x16", _packUnorm2x16(shader_packing_or_es3), NULL); - add_function("packSnorm2x16", _packSnorm2x16(shader_packing_or_es3), NULL); - add_function("packUnorm4x8", _packUnorm4x8(shader_packing), NULL); - add_function("packSnorm4x8", _packSnorm4x8(shader_packing), NULL); - add_function("unpackUnorm2x16", _unpackUnorm2x16(shader_packing_or_es3), NULL); - add_function("unpackSnorm2x16", _unpackSnorm2x16(shader_packing_or_es3), NULL); - add_function("unpackUnorm4x8", _unpackUnorm4x8(shader_packing), NULL); - add_function("unpackSnorm4x8", _unpackSnorm4x8(shader_packing), NULL); - add_function("packHalf2x16", _packHalf2x16(shader_packing_or_es3), NULL); - add_function("unpackHalf2x16", _unpackHalf2x16(shader_packing_or_es3), NULL); + add_function("packUnorm2x16", _packUnorm2x16(shader_packing_or_es3_or_gpu_shader5), NULL); + add_function("packSnorm2x16", _packSnorm2x16(shader_packing_or_es3), NULL); + add_function("packUnorm4x8", _packUnorm4x8(shader_packing_or_gpu_shader5), NULL); + add_function("packSnorm4x8", _packSnorm4x8(shader_packing_or_gpu_shader5), NULL); + add_function("unpackUnorm2x16", _unpackUnorm2x16(shader_packing_or_es3_or_gpu_shader5), NULL); + add_function("unpackSnorm2x16", _unpackSnorm2x16(shader_packing_or_es3), NULL); + add_function("unpackUnorm4x8", _unpackUnorm4x8(shader_packing_or_gpu_shader5), NULL); + add_function("unpackSnorm4x8", _unpackSnorm4x8(shader_packing_or_gpu_shader5), NULL); + add_function("packHalf2x16", _packHalf2x16(shader_packing_or_es3), NULL); + add_function("unpackHalf2x16", _unpackHalf2x16(shader_packing_or_es3), NULL); F(length) F(distance) @@ -1722,6 +1771,14 @@ builtin_builder::create_builtins() add_function("EmitVertex", _EmitVertex(), NULL); add_function("EndPrimitive", _EndPrimitive(), NULL); + add_function("EmitStreamVertex", + _EmitStreamVertex(gs_streams, glsl_type::uint_type), + _EmitStreamVertex(gs_streams, glsl_type::int_type), + NULL); + add_function("EndStreamPrimitive", + _EndStreamPrimitive(gs_streams, glsl_type::uint_type), + _EndStreamPrimitive(gs_streams, glsl_type::int_type), + NULL); add_function("textureQueryLOD", _textureQueryLod(glsl_type::sampler1D_type, glsl_type::float_type), @@ -1852,8 +1909,8 @@ builtin_builder::create_builtins() NULL); add_function("texture2DProjLod", - _texture(ir_txl, v110_lod, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec3_type, TEX_PROJECT), - _texture(ir_txl, v110_lod, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txl, lod_exists_in_stage, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_txl, lod_exists_in_stage, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec4_type, TEX_PROJECT), NULL); add_function("texture3D", @@ -1880,7 +1937,7 @@ builtin_builder::create_builtins() NULL); add_function("textureCubeLod", - _texture(ir_txl, v110_lod, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type), + _texture(ir_txl, lod_exists_in_stage, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type), NULL); add_function("texture2DRect", @@ -2160,6 +2217,12 @@ builtin_builder::create_builtins() F(dFdx) F(dFdy) F(fwidth) + F(dFdxCoarse) + F(dFdyCoarse) + F(fwidthCoarse) + F(dFdxFine) + F(dFdyFine) + F(fwidthFine) F(noise1) F(noise2) F(noise3) @@ -2210,6 +2273,24 @@ builtin_builder::create_builtins() _mulExtended(glsl_type::uvec3_type), _mulExtended(glsl_type::uvec4_type), NULL); + add_function("interpolateAtCentroid", + _interpolateAtCentroid(glsl_type::float_type), + _interpolateAtCentroid(glsl_type::vec2_type), + _interpolateAtCentroid(glsl_type::vec3_type), + _interpolateAtCentroid(glsl_type::vec4_type), + NULL); + add_function("interpolateAtOffset", + _interpolateAtOffset(glsl_type::float_type), + _interpolateAtOffset(glsl_type::vec2_type), + _interpolateAtOffset(glsl_type::vec3_type), + _interpolateAtOffset(glsl_type::vec4_type), + NULL); + add_function("interpolateAtSample", + _interpolateAtSample(glsl_type::float_type), + _interpolateAtSample(glsl_type::vec2_type), + _interpolateAtSample(glsl_type::vec3_type), + _interpolateAtSample(glsl_type::vec4_type), + NULL); add_function("atomicCounter", _atomic_op("__intrinsic_atomic_read", @@ -2584,11 +2665,11 @@ ir_expression * builtin_builder::asin_expr(ir_variable *x) { return mul(sign(x), - sub(imm(1.5707964f), + sub(imm(M_PI_2f), mul(sqrt(sub(imm(1.0f), abs(x))), - add(imm(1.5707964f), + add(imm(M_PI_2f), mul(abs(x), - add(imm(-0.21460183f), + add(imm(M_PI_4f - 1.0f), mul(abs(x), add(imm(0.086566724f), mul(abs(x), imm(-0.03102955f)))))))))); @@ -2599,8 +2680,7 @@ builtin_builder::call(ir_function *f, ir_variable *ret, exec_list params) { exec_list actual_params; - foreach_list(node, ¶ms) { - ir_variable *var = (ir_variable *) node; + foreach_in_list(ir_variable, var, ¶ms) { actual_params.push_tail(var_ref(var)); } @@ -2632,7 +2712,7 @@ builtin_builder::_acos(const glsl_type *type) ir_variable *x = in_var(type, "x"); MAKE_SIG(type, always_available, 1, x); - body.emit(ret(sub(imm(1.5707964f), asin_expr(x)))); + body.emit(ret(sub(imm(M_PI_2f), asin_expr(x)))); return sig; } @@ -2659,23 +2739,19 @@ builtin_builder::_atan2(const glsl_type *type) ir_factory outer_then(&outer_if->then_instructions, mem_ctx); /* Then...call atan(y/x) */ - ir_variable *y_over_x = outer_then.make_temp(glsl_type::float_type, "y_over_x"); - outer_then.emit(assign(y_over_x, div(y, x))); - outer_then.emit(assign(r, mul(y_over_x, rsq(add(mul(y_over_x, y_over_x), - imm(1.0f)))))); - outer_then.emit(assign(r, asin_expr(r))); + do_atan(body, glsl_type::float_type, r, div(y, x)); /* ...and fix it up: */ ir_if *inner_if = new(mem_ctx) ir_if(less(x, imm(0.0f))); inner_if->then_instructions.push_tail( if_tree(gequal(y, imm(0.0f)), - assign(r, add(r, imm(3.141593f))), - assign(r, sub(r, imm(3.141593f))))); + assign(r, add(r, imm(M_PIf))), + assign(r, sub(r, imm(M_PIf))))); outer_then.emit(inner_if); /* Else... */ outer_if->else_instructions.push_tail( - assign(r, mul(sign(y), imm(1.5707965f)))); + assign(r, mul(sign(y), imm(M_PI_2f)))); body.emit(outer_if); @@ -2686,17 +2762,65 @@ builtin_builder::_atan2(const glsl_type *type) return sig; } +void +builtin_builder::do_atan(ir_factory &body, const glsl_type *type, ir_variable *res, operand y_over_x) +{ + /* + * range-reduction, first step: + * + * / y_over_x if |y_over_x| <= 1.0; + * x = < + * \ 1.0 / y_over_x otherwise + */ + ir_variable *x = body.make_temp(type, "atan_x"); + body.emit(assign(x, div(min2(abs(y_over_x), + imm(1.0f)), + max2(abs(y_over_x), + imm(1.0f))))); + + /* + * approximate atan by evaluating polynomial: + * + * x * 0.9999793128310355 - x^3 * 0.3326756418091246 + + * x^5 * 0.1938924977115610 - x^7 * 0.1173503194786851 + + * x^9 * 0.0536813784310406 - x^11 * 0.0121323213173444 + */ + ir_variable *tmp = body.make_temp(type, "atan_tmp"); + body.emit(assign(tmp, mul(x, x))); + body.emit(assign(tmp, mul(add(mul(sub(mul(add(mul(sub(mul(add(mul(imm(-0.0121323213173444f), + tmp), + imm(0.0536813784310406f)), + tmp), + imm(0.1173503194786851f)), + tmp), + imm(0.1938924977115610f)), + tmp), + imm(0.3326756418091246f)), + tmp), + imm(0.9999793128310355f)), + x))); + + /* range-reduction fixup */ + body.emit(assign(tmp, add(tmp, + mul(b2f(greater(abs(y_over_x), + imm(1.0f, type->components()))), + add(mul(tmp, + imm(-2.0f)), + imm(M_PI_2f)))))); + + /* sign fixup */ + body.emit(assign(res, mul(tmp, sign(y_over_x)))); +} + ir_function_signature * builtin_builder::_atan(const glsl_type *type) { ir_variable *y_over_x = in_var(type, "y_over_x"); MAKE_SIG(type, always_available, 1, y_over_x); - ir_variable *t = body.make_temp(type, "t"); - body.emit(assign(t, mul(y_over_x, rsq(add(mul(y_over_x, y_over_x), - imm(1.0f)))))); - - body.emit(ret(asin_expr(t))); + ir_variable *tmp = body.make_temp(type, "tmp"); + do_atan(body, type, tmp, y_over_x); + body.emit(ret(tmp)); return sig; } @@ -3095,7 +3219,7 @@ builtin_builder::_length(const glsl_type *type) ir_variable *x = in_var(type, "x"); MAKE_SIG(glsl_type::float_type, always_available, 1, x); - body.emit(ret(sqrt(dotlike(x, x)))); + body.emit(ret(sqrt(dot(x, x)))); return sig; } @@ -3185,7 +3309,7 @@ builtin_builder::_faceforward(const glsl_type *type) ir_variable *Nref = in_var(type, "Nref"); MAKE_SIG(type, always_available, 3, N, I, Nref); - body.emit(if_tree(less(dotlike(Nref, I), imm(0.0f)), + body.emit(if_tree(less(dot(Nref, I), imm(0.0f)), ret(N), ret(neg(N)))); return sig; @@ -3199,7 +3323,7 @@ builtin_builder::_reflect(const glsl_type *type) MAKE_SIG(type, always_available, 2, I, N); /* I - 2 * dot(N, I) * N */ - body.emit(ret(sub(I, mul(imm(2.0f), mul(dotlike(N, I), N))))); + body.emit(ret(sub(I, mul(imm(2.0f), mul(dot(N, I), N))))); return sig; } @@ -3213,7 +3337,7 @@ builtin_builder::_refract(const glsl_type *type) MAKE_SIG(type, always_available, 3, I, N, eta); ir_variable *n_dot_i = body.make_temp(glsl_type::float_type, "n_dot_i"); - body.emit(assign(n_dot_i, dotlike(N, I))); + body.emit(assign(n_dot_i, dot(N, I))); /* From the GLSL 1.10 specification: * k = 1.0 - eta * eta * (1.0 - dot(N, I) * dot(N, I)) @@ -3917,7 +4041,28 @@ builtin_builder::_EmitVertex() { MAKE_SIG(glsl_type::void_type, gs_only, 0); - body.emit(new(mem_ctx) ir_emit_vertex()); + ir_rvalue *stream = new(mem_ctx) ir_constant(0, 1); + body.emit(new(mem_ctx) ir_emit_vertex(stream)); + + return sig; +} + +ir_function_signature * +builtin_builder::_EmitStreamVertex(builtin_available_predicate avail, + const glsl_type *stream_type) +{ + /* Section 8.12 (Geometry Shader Functions) of the GLSL 4.0 spec says: + * + * "Emit the current values of output variables to the current output + * primitive on stream stream. The argument to stream must be a constant + * integral expression." + */ + ir_variable *stream = + new(mem_ctx) ir_variable(stream_type, "stream", ir_var_const_in, glsl_precision_undefined); + + MAKE_SIG(glsl_type::void_type, avail, 1, stream); + + body.emit(new(mem_ctx) ir_emit_vertex(var_ref(stream))); return sig; } @@ -3927,7 +4072,28 @@ builtin_builder::_EndPrimitive() { MAKE_SIG(glsl_type::void_type, gs_only, 0); - body.emit(new(mem_ctx) ir_end_primitive()); + ir_rvalue *stream = new(mem_ctx) ir_constant(0, 1); + body.emit(new(mem_ctx) ir_end_primitive(stream)); + + return sig; +} + +ir_function_signature * +builtin_builder::_EndStreamPrimitive(builtin_available_predicate avail, + const glsl_type *stream_type) +{ + /* Section 8.12 (Geometry Shader Functions) of the GLSL 4.0 spec says: + * + * "Completes the current output primitive on stream stream and starts + * a new one. The argument to stream must be a constant integral + * expression." + */ + ir_variable *stream = + new(mem_ctx) ir_variable(stream_type, "stream", ir_var_const_in, glsl_precision_undefined); + + MAKE_SIG(glsl_type::void_type, avail, 1, stream); + + body.emit(new(mem_ctx) ir_end_primitive(var_ref(stream))); return sig; } @@ -3966,7 +4132,11 @@ builtin_builder::_textureQueryLevels(const glsl_type *sampler_type) } UNOP(dFdx, ir_unop_dFdx, fs_oes_derivatives) +UNOP(dFdxCoarse, ir_unop_dFdx_coarse, fs_derivative_control) +UNOP(dFdxFine, ir_unop_dFdx_fine, fs_derivative_control) UNOP(dFdy, ir_unop_dFdy, fs_oes_derivatives) +UNOP(dFdyCoarse, ir_unop_dFdy_coarse, fs_derivative_control) +UNOP(dFdyFine, ir_unop_dFdy_fine, fs_derivative_control) ir_function_signature * builtin_builder::_fwidth(const glsl_type *type) @@ -3979,6 +4149,30 @@ builtin_builder::_fwidth(const glsl_type *type) return sig; } +ir_function_signature * +builtin_builder::_fwidthCoarse(const glsl_type *type) +{ + ir_variable *p = in_var(type, "p"); + MAKE_SIG(type, fs_derivative_control, 1, p); + + body.emit(ret(add(abs(expr(ir_unop_dFdx_coarse, p)), + abs(expr(ir_unop_dFdy_coarse, p))))); + + return sig; +} + +ir_function_signature * +builtin_builder::_fwidthFine(const glsl_type *type) +{ + ir_variable *p = in_var(type, "p"); + MAKE_SIG(type, fs_derivative_control, 1, p); + + body.emit(ret(add(abs(expr(ir_unop_dFdx_fine, p)), + abs(expr(ir_unop_dFdy_fine, p))))); + + return sig; +} + ir_function_signature * builtin_builder::_noise1(const glsl_type *type) { @@ -4245,6 +4439,44 @@ builtin_builder::_mulExtended(const glsl_type *type) return sig; } +ir_function_signature * +builtin_builder::_interpolateAtCentroid(const glsl_type *type) +{ + ir_variable *interpolant = in_var(type, "interpolant"); + interpolant->data.must_be_shader_input = 1; + MAKE_SIG(type, fs_gpu_shader5, 1, interpolant); + + body.emit(ret(interpolate_at_centroid(interpolant))); + + return sig; +} + +ir_function_signature * +builtin_builder::_interpolateAtOffset(const glsl_type *type) +{ + ir_variable *interpolant = in_var(type, "interpolant"); + interpolant->data.must_be_shader_input = 1; + ir_variable *offset = in_var(glsl_type::vec2_type, "offset"); + MAKE_SIG(type, fs_gpu_shader5, 2, interpolant, offset); + + body.emit(ret(interpolate_at_offset(interpolant, offset))); + + return sig; +} + +ir_function_signature * +builtin_builder::_interpolateAtSample(const glsl_type *type) +{ + ir_variable *interpolant = in_var(type, "interpolant"); + interpolant->data.must_be_shader_input = 1; + ir_variable *sample_num = in_var(glsl_type::int_type, "sample_num"); + MAKE_SIG(type, fs_gpu_shader5, 2, interpolant, sample_num); + + body.emit(ret(interpolate_at_sample(interpolant, sample_num))); + + return sig; +} + ir_function_signature * builtin_builder::_atomic_intrinsic(builtin_available_predicate avail) { @@ -4335,9 +4567,11 @@ builtin_builder::_image_prototype(const glsl_type *image_type, sig->parameters.push_tail(in_var(glsl_type::int_type, "sample")); /* Data arguments. */ - for (unsigned i = 0; i < num_arguments; ++i) - sig->parameters.push_tail(in_var(data_type, - ralloc_asprintf(NULL, "arg%d", i))); + for (unsigned i = 0; i < num_arguments; ++i) { + char *arg_name = ralloc_asprintf(NULL, "arg%d", i); + sig->parameters.push_tail(in_var(data_type, arg_name)); + ralloc_free(arg_name); + } /* Set the maximal set of qualifiers allowed for this image * built-in. Function calls with arguments having fewer @@ -4346,11 +4580,11 @@ builtin_builder::_image_prototype(const glsl_type *image_type, * accept everything that needs to be accepted, and reject cases * like loads from write-only or stores to read-only images. */ - image->data.image.read_only = flags & IMAGE_FUNCTION_READ_ONLY; - image->data.image.write_only = flags & IMAGE_FUNCTION_WRITE_ONLY; - image->data.image.coherent = true; - image->data.image._volatile = true; - image->data.image.restrict_flag = true; + image->data.image_read_only = (flags & IMAGE_FUNCTION_READ_ONLY) != 0; + image->data.image_write_only = (flags & IMAGE_FUNCTION_WRITE_ONLY) != 0; + image->data.image_coherent = true; + image->data.image_volatile = true; + image->data.image_restrict = true; return sig; } @@ -4407,14 +4641,15 @@ builtin_builder::_memory_barrier(builtin_available_predicate avail) /******************************************************************************/ //@TODO: implement -#define _glthread_DECLARE_STATIC_MUTEX(name) -#define _glthread_LOCK_MUTEX(name) -#define _glthread_UNLOCK_MUTEX(name) +typedef int mtx_t; +#define _MTX_INITIALIZER_NP 0 +#define mtx_lock(name) +#define mtx_unlock(name) /* The singleton instance of builtin_builder. */ static builtin_builder builtins; -_glthread_DECLARE_STATIC_MUTEX(builtins_lock); +static mtx_t builtins_lock = _MTX_INITIALIZER_NP; /** * External API (exposing the built-in module to the rest of the compiler): @@ -4423,17 +4658,17 @@ _glthread_DECLARE_STATIC_MUTEX(builtins_lock); void _mesa_glsl_initialize_builtin_functions() { - _glthread_LOCK_MUTEX(builtins_lock); + mtx_lock(&builtins_lock); builtins.initialize(); - _glthread_UNLOCK_MUTEX(builtins_lock); + mtx_unlock(&builtins_lock); } void _mesa_glsl_release_builtin_functions() { - _glthread_LOCK_MUTEX(builtins_lock); + mtx_lock(&builtins_lock); builtins.release(); - _glthread_UNLOCK_MUTEX(builtins_lock); + mtx_unlock(&builtins_lock); } ir_function_signature * @@ -4441,9 +4676,9 @@ _mesa_glsl_find_builtin_function(_mesa_glsl_parse_state *state, const char *name, exec_list *actual_parameters) { ir_function_signature * s; - _glthread_LOCK_MUTEX(builtins_lock); + mtx_lock(&builtins_lock); s = builtins.find(state, name, actual_parameters); - _glthread_UNLOCK_MUTEX(builtins_lock); + mtx_unlock(&builtins_lock); return s; } diff --git a/3rdparty/glsl-optimizer/src/glsl/builtin_types.cpp b/3rdparty/glsl-optimizer/src/glsl/builtin_types.cpp index 5e62f5419..0105d1fb8 100644 --- a/3rdparty/glsl-optimizer/src/glsl/builtin_types.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/builtin_types.cpp @@ -36,6 +36,7 @@ #include "glsl_types.h" #include "glsl_parser_extras.h" +#include "util/macros.h" /** * Declarations of type flyweights (glsl_type::_foo_type) and @@ -48,69 +49,69 @@ #define STRUCT_TYPE(NAME) \ const glsl_type glsl_type::_struct_##NAME##_type = \ - glsl_type(NAME##_fields, Elements(NAME##_fields), #NAME); \ + glsl_type(NAME##_fields, ARRAY_SIZE(NAME##_fields), #NAME); \ const glsl_type *const glsl_type::struct_##NAME##_type = \ &glsl_type::_struct_##NAME##_type; static const struct glsl_struct_field gl_DepthRangeParameters_fields[] = { - { glsl_type::float_type, "near", false, glsl_precision_high, -1 }, - { glsl_type::float_type, "far", false, glsl_precision_high, -1 }, - { glsl_type::float_type, "diff", false, glsl_precision_high, -1 }, + { glsl_type::float_type, "near", glsl_precision_high, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::float_type, "far", glsl_precision_high, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::float_type, "diff", glsl_precision_high, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, }; static const struct glsl_struct_field gl_PointParameters_fields[] = { - { glsl_type::float_type, "size", false, glsl_precision_undefined, -1 }, - { glsl_type::float_type, "sizeMin", false, glsl_precision_undefined, -1 }, - { glsl_type::float_type, "sizeMax", false, glsl_precision_undefined, -1 }, - { glsl_type::float_type, "fadeThresholdSize", false, glsl_precision_undefined, -1 }, - { glsl_type::float_type, "distanceConstantAttenuation", false, glsl_precision_undefined, -1 }, - { glsl_type::float_type, "distanceLinearAttenuation", false, glsl_precision_undefined, -1 }, - { glsl_type::float_type, "distanceQuadraticAttenuation", false, glsl_precision_undefined, -1 }, + { glsl_type::float_type, "size", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::float_type, "sizeMin", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::float_type, "sizeMax", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::float_type, "fadeThresholdSize", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::float_type, "distanceConstantAttenuation", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::float_type, "distanceLinearAttenuation", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::float_type, "distanceQuadraticAttenuation", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, }; static const struct glsl_struct_field gl_MaterialParameters_fields[] = { - { glsl_type::vec4_type, "emission", false, glsl_precision_undefined, -1 }, - { glsl_type::vec4_type, "ambient", false, glsl_precision_undefined, -1 }, - { glsl_type::vec4_type, "diffuse", false, glsl_precision_undefined, -1 }, - { glsl_type::vec4_type, "specular", false, glsl_precision_undefined, -1 }, - { glsl_type::float_type, "shininess", false, glsl_precision_undefined, -1 }, + { glsl_type::vec4_type, "emission", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::vec4_type, "ambient", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::vec4_type, "diffuse", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::vec4_type, "specular", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::float_type, "shininess", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, }; static const struct glsl_struct_field gl_LightSourceParameters_fields[] = { - { glsl_type::vec4_type, "ambient", false, glsl_precision_undefined, -1 }, - { glsl_type::vec4_type, "diffuse", false, glsl_precision_undefined, -1 }, - { glsl_type::vec4_type, "specular", false, glsl_precision_undefined, -1 }, - { glsl_type::vec4_type, "position", false, glsl_precision_undefined, -1 }, - { glsl_type::vec4_type, "halfVector", false, glsl_precision_undefined, -1 }, - { glsl_type::vec3_type, "spotDirection", false, glsl_precision_undefined, -1 }, - { glsl_type::float_type, "spotExponent", false, glsl_precision_undefined, -1 }, - { glsl_type::float_type, "spotCutoff", false, glsl_precision_undefined, -1 }, - { glsl_type::float_type, "spotCosCutoff", false, glsl_precision_undefined, -1 }, - { glsl_type::float_type, "constantAttenuation", false, glsl_precision_undefined, -1 }, - { glsl_type::float_type, "linearAttenuation", false, glsl_precision_undefined, -1 }, - { glsl_type::float_type, "quadraticAttenuation", false, glsl_precision_undefined, -1 }, + { glsl_type::vec4_type, "ambient", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::vec4_type, "diffuse", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::vec4_type, "specular", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::vec4_type, "position", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::vec4_type, "halfVector", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::vec3_type, "spotDirection", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::float_type, "spotExponent", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::float_type, "spotCutoff", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::float_type, "spotCosCutoff", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::float_type, "constantAttenuation", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::float_type, "linearAttenuation", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::float_type, "quadraticAttenuation", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, }; static const struct glsl_struct_field gl_LightModelParameters_fields[] = { - { glsl_type::vec4_type, "ambient", false, glsl_precision_undefined, -1 }, + { glsl_type::vec4_type, "ambient", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, }; static const struct glsl_struct_field gl_LightModelProducts_fields[] = { - { glsl_type::vec4_type, "sceneColor", false, glsl_precision_undefined, -1 }, + { glsl_type::vec4_type, "sceneColor", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, }; static const struct glsl_struct_field gl_LightProducts_fields[] = { - { glsl_type::vec4_type, "ambient", false, glsl_precision_undefined, -1 }, - { glsl_type::vec4_type, "diffuse", false, glsl_precision_undefined, -1 }, - { glsl_type::vec4_type, "specular", false, glsl_precision_undefined, -1 }, + { glsl_type::vec4_type, "ambient", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::vec4_type, "diffuse", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::vec4_type, "specular", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, }; static const struct glsl_struct_field gl_FogParameters_fields[] = { - { glsl_type::vec4_type, "color", false, glsl_precision_undefined, -1 }, - { glsl_type::float_type, "density", false, glsl_precision_undefined, -1 }, - { glsl_type::float_type, "start", false, glsl_precision_undefined, -1 }, - { glsl_type::float_type, "end", false, glsl_precision_undefined, -1 }, - { glsl_type::float_type, "scale", false, glsl_precision_undefined, -1 }, + { glsl_type::vec4_type, "color", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::float_type, "density", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::float_type, "start", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::float_type, "end", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, + { glsl_type::float_type, "scale", glsl_precision_undefined, -1, 0, 0, 0, GLSL_MATRIX_LAYOUT_INHERITED, 0 }, }; #include "builtin_type_macros.h" @@ -241,7 +242,7 @@ const static struct builtin_type_versions { T(atomic_uint, 420, 999) }; -const glsl_type *const deprecated_types[] = { +static const glsl_type *const deprecated_types[] = { glsl_type::struct_gl_PointParameters_type, glsl_type::struct_gl_MaterialParameters_type, glsl_type::struct_gl_LightSourceParameters_type, @@ -265,7 +266,7 @@ _mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state) { struct glsl_symbol_table *symbols = state->symbols; - for (unsigned i = 0; i < Elements(builtin_type_versions); i++) { + for (unsigned i = 0; i < ARRAY_SIZE(builtin_type_versions); i++) { const struct builtin_type_versions *const t = &builtin_type_versions[i]; if (state->is_version(t->min_gl, t->min_es)) { add_type(symbols, t->type); @@ -276,7 +277,7 @@ _mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state) * they're still present. We've removed them in 1.40+ (OpenGL 3.1+). */ if (!state->es_shader && state->language_version < 140) { - for (unsigned i = 0; i < Elements(deprecated_types); i++) { + for (unsigned i = 0; i < ARRAY_SIZE(deprecated_types); i++) { add_type(symbols, deprecated_types[i]); } } diff --git a/3rdparty/glsl-optimizer/src/glsl/builtin_variables.cpp b/3rdparty/glsl-optimizer/src/glsl/builtin_variables.cpp index e537c352c..e52ac1c98 100644 --- a/3rdparty/glsl-optimizer/src/glsl/builtin_variables.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/builtin_variables.cpp @@ -37,27 +37,27 @@ struct gl_builtin_uniform_element { }; struct gl_builtin_uniform_desc { const char *name; - struct gl_builtin_uniform_element *elements; + const struct gl_builtin_uniform_element *elements; unsigned int num_elements; }; -static struct gl_builtin_uniform_element gl_NumSamples_elements[] = { - {NULL, {STATE_NUM_SAMPLES, 0, 0}, SWIZZLE_XXXX} +static const struct gl_builtin_uniform_element gl_NumSamples_elements[] = { + {NULL, {STATE_NUM_SAMPLES, 0, 0}, SWIZZLE_XXXX} }; -static struct gl_builtin_uniform_element gl_DepthRange_elements[] = { +static const struct gl_builtin_uniform_element gl_DepthRange_elements[] = { {"near", {STATE_DEPTH_RANGE, 0, 0}, SWIZZLE_XXXX}, {"far", {STATE_DEPTH_RANGE, 0, 0}, SWIZZLE_YYYY}, {"diff", {STATE_DEPTH_RANGE, 0, 0}, SWIZZLE_ZZZZ}, }; -static struct gl_builtin_uniform_element gl_ClipPlane_elements[] = { +static const struct gl_builtin_uniform_element gl_ClipPlane_elements[] = { {NULL, {STATE_CLIPPLANE, 0, 0}, SWIZZLE_XYZW} }; -static struct gl_builtin_uniform_element gl_Point_elements[] = { +static const struct gl_builtin_uniform_element gl_Point_elements[] = { {"size", {STATE_POINT_SIZE}, SWIZZLE_XXXX}, {"sizeMin", {STATE_POINT_SIZE}, SWIZZLE_YYYY}, {"sizeMax", {STATE_POINT_SIZE}, SWIZZLE_ZZZZ}, @@ -67,7 +67,7 @@ static struct gl_builtin_uniform_element gl_Point_elements[] = { {"distanceQuadraticAttenuation", {STATE_POINT_ATTENUATION}, SWIZZLE_ZZZZ}, }; -static struct gl_builtin_uniform_element gl_FrontMaterial_elements[] = { +static const struct gl_builtin_uniform_element gl_FrontMaterial_elements[] = { {"emission", {STATE_MATERIAL, 0, STATE_EMISSION}, SWIZZLE_XYZW}, {"ambient", {STATE_MATERIAL, 0, STATE_AMBIENT}, SWIZZLE_XYZW}, {"diffuse", {STATE_MATERIAL, 0, STATE_DIFFUSE}, SWIZZLE_XYZW}, @@ -75,7 +75,7 @@ static struct gl_builtin_uniform_element gl_FrontMaterial_elements[] = { {"shininess", {STATE_MATERIAL, 0, STATE_SHININESS}, SWIZZLE_XXXX}, }; -static struct gl_builtin_uniform_element gl_BackMaterial_elements[] = { +static const struct gl_builtin_uniform_element gl_BackMaterial_elements[] = { {"emission", {STATE_MATERIAL, 1, STATE_EMISSION}, SWIZZLE_XYZW}, {"ambient", {STATE_MATERIAL, 1, STATE_AMBIENT}, SWIZZLE_XYZW}, {"diffuse", {STATE_MATERIAL, 1, STATE_DIFFUSE}, SWIZZLE_XYZW}, @@ -83,7 +83,7 @@ static struct gl_builtin_uniform_element gl_BackMaterial_elements[] = { {"shininess", {STATE_MATERIAL, 1, STATE_SHININESS}, SWIZZLE_XXXX}, }; -static struct gl_builtin_uniform_element gl_LightSource_elements[] = { +static const struct gl_builtin_uniform_element gl_LightSource_elements[] = { {"ambient", {STATE_LIGHT, 0, STATE_AMBIENT}, SWIZZLE_XYZW}, {"diffuse", {STATE_LIGHT, 0, STATE_DIFFUSE}, SWIZZLE_XYZW}, {"specular", {STATE_LIGHT, 0, STATE_SPECULAR}, SWIZZLE_XYZW}, @@ -102,67 +102,67 @@ static struct gl_builtin_uniform_element gl_LightSource_elements[] = { {"quadraticAttenuation", {STATE_LIGHT, 0, STATE_ATTENUATION}, SWIZZLE_ZZZZ}, }; -static struct gl_builtin_uniform_element gl_LightModel_elements[] = { +static const struct gl_builtin_uniform_element gl_LightModel_elements[] = { {"ambient", {STATE_LIGHTMODEL_AMBIENT, 0}, SWIZZLE_XYZW}, }; -static struct gl_builtin_uniform_element gl_FrontLightModelProduct_elements[] = { +static const struct gl_builtin_uniform_element gl_FrontLightModelProduct_elements[] = { {"sceneColor", {STATE_LIGHTMODEL_SCENECOLOR, 0}, SWIZZLE_XYZW}, }; -static struct gl_builtin_uniform_element gl_BackLightModelProduct_elements[] = { +static const struct gl_builtin_uniform_element gl_BackLightModelProduct_elements[] = { {"sceneColor", {STATE_LIGHTMODEL_SCENECOLOR, 1}, SWIZZLE_XYZW}, }; -static struct gl_builtin_uniform_element gl_FrontLightProduct_elements[] = { +static const struct gl_builtin_uniform_element gl_FrontLightProduct_elements[] = { {"ambient", {STATE_LIGHTPROD, 0, 0, STATE_AMBIENT}, SWIZZLE_XYZW}, {"diffuse", {STATE_LIGHTPROD, 0, 0, STATE_DIFFUSE}, SWIZZLE_XYZW}, {"specular", {STATE_LIGHTPROD, 0, 0, STATE_SPECULAR}, SWIZZLE_XYZW}, }; -static struct gl_builtin_uniform_element gl_BackLightProduct_elements[] = { +static const struct gl_builtin_uniform_element gl_BackLightProduct_elements[] = { {"ambient", {STATE_LIGHTPROD, 0, 1, STATE_AMBIENT}, SWIZZLE_XYZW}, {"diffuse", {STATE_LIGHTPROD, 0, 1, STATE_DIFFUSE}, SWIZZLE_XYZW}, {"specular", {STATE_LIGHTPROD, 0, 1, STATE_SPECULAR}, SWIZZLE_XYZW}, }; -static struct gl_builtin_uniform_element gl_TextureEnvColor_elements[] = { +static const struct gl_builtin_uniform_element gl_TextureEnvColor_elements[] = { {NULL, {STATE_TEXENV_COLOR, 0}, SWIZZLE_XYZW}, }; -static struct gl_builtin_uniform_element gl_EyePlaneS_elements[] = { +static const struct gl_builtin_uniform_element gl_EyePlaneS_elements[] = { {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_EYE_S}, SWIZZLE_XYZW}, }; -static struct gl_builtin_uniform_element gl_EyePlaneT_elements[] = { +static const struct gl_builtin_uniform_element gl_EyePlaneT_elements[] = { {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_EYE_T}, SWIZZLE_XYZW}, }; -static struct gl_builtin_uniform_element gl_EyePlaneR_elements[] = { +static const struct gl_builtin_uniform_element gl_EyePlaneR_elements[] = { {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_EYE_R}, SWIZZLE_XYZW}, }; -static struct gl_builtin_uniform_element gl_EyePlaneQ_elements[] = { +static const struct gl_builtin_uniform_element gl_EyePlaneQ_elements[] = { {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_EYE_Q}, SWIZZLE_XYZW}, }; -static struct gl_builtin_uniform_element gl_ObjectPlaneS_elements[] = { +static const struct gl_builtin_uniform_element gl_ObjectPlaneS_elements[] = { {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_OBJECT_S}, SWIZZLE_XYZW}, }; -static struct gl_builtin_uniform_element gl_ObjectPlaneT_elements[] = { +static const struct gl_builtin_uniform_element gl_ObjectPlaneT_elements[] = { {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_OBJECT_T}, SWIZZLE_XYZW}, }; -static struct gl_builtin_uniform_element gl_ObjectPlaneR_elements[] = { +static const struct gl_builtin_uniform_element gl_ObjectPlaneR_elements[] = { {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_OBJECT_R}, SWIZZLE_XYZW}, }; -static struct gl_builtin_uniform_element gl_ObjectPlaneQ_elements[] = { +static const struct gl_builtin_uniform_element gl_ObjectPlaneQ_elements[] = { {NULL, {STATE_TEXGEN, 0, STATE_TEXGEN_OBJECT_Q}, SWIZZLE_XYZW}, }; -static struct gl_builtin_uniform_element gl_Fog_elements[] = { +static const struct gl_builtin_uniform_element gl_Fog_elements[] = { {"color", {STATE_FOG_COLOR}, SWIZZLE_XYZW}, {"density", {STATE_FOG_PARAMS}, SWIZZLE_XXXX}, {"start", {STATE_FOG_PARAMS}, SWIZZLE_YYYY}, @@ -170,32 +170,24 @@ static struct gl_builtin_uniform_element gl_Fog_elements[] = { {"scale", {STATE_FOG_PARAMS}, SWIZZLE_WWWW}, }; -static struct gl_builtin_uniform_element gl_NormalScale_elements[] = { +static const struct gl_builtin_uniform_element gl_NormalScale_elements[] = { {NULL, {STATE_NORMAL_SCALE}, SWIZZLE_XXXX}, }; -static struct gl_builtin_uniform_element gl_BumpRotMatrix0MESA_elements[] = { - {NULL, {STATE_INTERNAL, STATE_ROT_MATRIX_0}, SWIZZLE_XYZW}, -}; - -static struct gl_builtin_uniform_element gl_BumpRotMatrix1MESA_elements[] = { - {NULL, {STATE_INTERNAL, STATE_ROT_MATRIX_1}, SWIZZLE_XYZW}, -}; - -static struct gl_builtin_uniform_element gl_FogParamsOptimizedMESA_elements[] = { +static const struct gl_builtin_uniform_element gl_FogParamsOptimizedMESA_elements[] = { {NULL, {STATE_INTERNAL, STATE_FOG_PARAMS_OPTIMIZED}, SWIZZLE_XYZW}, }; -static struct gl_builtin_uniform_element gl_CurrentAttribVertMESA_elements[] = { +static const struct gl_builtin_uniform_element gl_CurrentAttribVertMESA_elements[] = { {NULL, {STATE_INTERNAL, STATE_CURRENT_ATTRIB, 0}, SWIZZLE_XYZW}, }; -static struct gl_builtin_uniform_element gl_CurrentAttribFragMESA_elements[] = { +static const struct gl_builtin_uniform_element gl_CurrentAttribFragMESA_elements[] = { {NULL, {STATE_INTERNAL, STATE_CURRENT_ATTRIB_MAYBE_VP_CLAMPED, 0}, SWIZZLE_XYZW}, }; #define MATRIX(name, statevar, modifier) \ - static struct gl_builtin_uniform_element name ## _elements[] = { \ + static const struct gl_builtin_uniform_element name ## _elements[] = { \ { NULL, { statevar, 0, 0, 0, modifier}, SWIZZLE_XYZW }, \ { NULL, { statevar, 0, 1, 1, modifier}, SWIZZLE_XYZW }, \ { NULL, { statevar, 0, 2, 2, modifier}, SWIZZLE_XYZW }, \ @@ -238,7 +230,7 @@ MATRIX(gl_TextureMatrixTranspose, MATRIX(gl_TextureMatrixInverseTranspose, STATE_TEXTURE_MATRIX, STATE_MATRIX_INVERSE); -static struct gl_builtin_uniform_element gl_NormalMatrix_elements[] = { +static const struct gl_builtin_uniform_element gl_NormalMatrix_elements[] = { { NULL, { STATE_MODELVIEW_MATRIX, 0, 0, 0, STATE_MATRIX_INVERSE}, MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_Z) }, { NULL, { STATE_MODELVIEW_MATRIX, 0, 1, 1, STATE_MATRIX_INVERSE}, @@ -298,8 +290,6 @@ static const struct gl_builtin_uniform_desc _mesa_builtin_uniform_desc[] = { STATEVAR(gl_NormalMatrix), STATEVAR(gl_NormalScale), - STATEVAR(gl_BumpRotMatrix0MESA), - STATEVAR(gl_BumpRotMatrix1MESA), STATEVAR(gl_FogParamsOptimizedMESA), STATEVAR(gl_CurrentAttribVertMESA), STATEVAR(gl_CurrentAttribFragMESA), @@ -341,7 +331,7 @@ per_vertex_accumulator::add_field(int slot, const glsl_type *type, assert(this->num_fields < ARRAY_SIZE(this->fields)); this->fields[this->num_fields].type = type; this->fields[this->num_fields].name = name; - this->fields[this->num_fields].row_major = false; + this->fields[this->num_fields].matrix_layout = GLSL_MATRIX_LAYOUT_INHERITED; this->fields[this->num_fields].precision = prec; this->fields[this->num_fields].location = slot; this->fields[this->num_fields].interpolation = INTERP_QUALIFIER_NONE; @@ -402,7 +392,7 @@ private: ir_variable *add_variable(const char *name, const glsl_type *type, enum ir_variable_mode mode, int slot, glsl_precision prec); - ir_variable *add_uniform(const glsl_type *type, const char *name, glsl_precision prec); + ir_variable *add_uniform(const glsl_type *type, const char *name, glsl_precision prec = glsl_precision_undefined); ir_variable *add_const(const char *name, int value); ir_variable *add_const_ivec3(const char *name, int x, int y, int z); void add_varying(int slot, const glsl_type *type, const char *name, @@ -421,6 +411,7 @@ private: const glsl_type * const bool_t; const glsl_type * const int_t; + const glsl_type * const uint_t; const glsl_type * const float_t; const glsl_type * const vec2_t; const glsl_type * const vec3_t; @@ -437,7 +428,7 @@ builtin_variable_generator::builtin_variable_generator( exec_list *instructions, struct _mesa_glsl_parse_state *state) : instructions(instructions), state(state), symtab(state->symbols), compatibility(!state->is_version(140, 100)), - bool_t(glsl_type::bool_type), int_t(glsl_type::int_type), + bool_t(glsl_type::bool_type), int_t(glsl_type::int_type), uint_t(glsl_type::uint_type), float_t(glsl_type::float_type), vec2_t(glsl_type::vec2_type), vec3_t(glsl_type::vec3_type), vec4_t(glsl_type::vec4_type), mat3_t(glsl_type::mat3_type), mat4_t(glsl_type::mat4_type) @@ -506,16 +497,14 @@ builtin_variable_generator::add_uniform(const glsl_type *type, &_mesa_builtin_uniform_desc[i]; const unsigned array_count = type->is_array() ? type->length : 1; - uni->num_state_slots = array_count * statevar->num_elements; ir_state_slot *slots = - ralloc_array(uni, ir_state_slot, uni->num_state_slots); - - uni->state_slots = slots; + uni->allocate_state_slots(array_count * statevar->num_elements); for (unsigned a = 0; a < array_count; a++) { for (unsigned j = 0; j < statevar->num_elements; j++) { - struct gl_builtin_uniform_element *element = &statevar->elements[j]; + const struct gl_builtin_uniform_element *element = + &statevar->elements[j]; memcpy(slots->tokens, element->tokens, sizeof(element->tokens)); if (type->is_array()) { @@ -699,6 +688,12 @@ builtin_variable_generator::generate_constants() } if (state->is_version(430, 0) || state->ARB_compute_shader_enable) { + add_const("gl_MaxComputeAtomicCounterBuffers", MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS); + add_const("gl_MaxComputeAtomicCounters", MAX_COMPUTE_ATOMIC_COUNTERS); + add_const("gl_MaxComputeImageUniforms", MAX_COMPUTE_IMAGE_UNIFORMS); + add_const("gl_MaxComputeTextureImageUnits", MAX_COMPUTE_TEXTURE_IMAGE_UNITS); + add_const("gl_MaxComputeUniformComponents", MAX_COMPUTE_UNIFORM_COMPONENTS); + add_const_ivec3("gl_MaxComputeWorkGroupCount", state->Const.MaxComputeWorkGroupCount[0], state->Const.MaxComputeWorkGroupCount[1], @@ -763,24 +758,22 @@ builtin_variable_generator::generate_uniforms() add_uniform(array(vec4_t, VARYING_SLOT_MAX), "gl_CurrentAttribFragMESA", glsl_precision_undefined); if (compatibility) { - add_uniform(mat4_t, "gl_ModelViewMatrix", glsl_precision_undefined); - add_uniform(mat4_t, "gl_ProjectionMatrix", glsl_precision_undefined); - add_uniform(mat4_t, "gl_ModelViewProjectionMatrix", glsl_precision_undefined); - add_uniform(mat3_t, "gl_NormalMatrix", glsl_precision_undefined); - add_uniform(mat4_t, "gl_ModelViewMatrixInverse", glsl_precision_undefined); - add_uniform(mat4_t, "gl_ProjectionMatrixInverse", glsl_precision_undefined); - add_uniform(mat4_t, "gl_ModelViewProjectionMatrixInverse", glsl_precision_undefined); - add_uniform(mat4_t, "gl_ModelViewMatrixTranspose", glsl_precision_undefined); - add_uniform(mat4_t, "gl_ProjectionMatrixTranspose", glsl_precision_undefined); - add_uniform(mat4_t, "gl_ModelViewProjectionMatrixTranspose", glsl_precision_undefined); - add_uniform(mat4_t, "gl_ModelViewMatrixInverseTranspose", glsl_precision_undefined); - add_uniform(mat4_t, "gl_ProjectionMatrixInverseTranspose", glsl_precision_undefined); - add_uniform(mat4_t, "gl_ModelViewProjectionMatrixInverseTranspose", glsl_precision_undefined); - add_uniform(float_t, "gl_NormalScale", glsl_precision_undefined); - add_uniform(type("gl_LightModelParameters"), "gl_LightModel", glsl_precision_undefined); - add_uniform(vec2_t, "gl_BumpRotMatrix0MESA", glsl_precision_undefined); - add_uniform(vec2_t, "gl_BumpRotMatrix1MESA", glsl_precision_undefined); - add_uniform(vec4_t, "gl_FogParamsOptimizedMESA", glsl_precision_undefined); + add_uniform(mat4_t, "gl_ModelViewMatrix"); + add_uniform(mat4_t, "gl_ProjectionMatrix"); + add_uniform(mat4_t, "gl_ModelViewProjectionMatrix"); + add_uniform(mat3_t, "gl_NormalMatrix"); + add_uniform(mat4_t, "gl_ModelViewMatrixInverse"); + add_uniform(mat4_t, "gl_ProjectionMatrixInverse"); + add_uniform(mat4_t, "gl_ModelViewProjectionMatrixInverse"); + add_uniform(mat4_t, "gl_ModelViewMatrixTranspose"); + add_uniform(mat4_t, "gl_ProjectionMatrixTranspose"); + add_uniform(mat4_t, "gl_ModelViewProjectionMatrixTranspose"); + add_uniform(mat4_t, "gl_ModelViewMatrixInverseTranspose"); + add_uniform(mat4_t, "gl_ProjectionMatrixInverseTranspose"); + add_uniform(mat4_t, "gl_ModelViewProjectionMatrixInverseTranspose"); + add_uniform(float_t, "gl_NormalScale"); + add_uniform(type("gl_LightModelParameters"), "gl_LightModel"); + add_uniform(vec4_t, "gl_FogParamsOptimizedMESA"); const glsl_type *const mat4_array_type = array(mat4_t, state->Const.MaxTextureCoords); @@ -838,13 +831,15 @@ builtin_variable_generator::generate_vs_special_vars() { if (state->is_version(130, 300)) - add_system_value(SYSTEM_VALUE_VERTEX_ID, int_t, "gl_VertexID", glsl_precision_high); + add_system_value(SYSTEM_VALUE_VERTEX_ID, state->metal_target ? uint_t : int_t, "gl_VertexID", glsl_precision_high); if (state->ARB_draw_instanced_enable) add_system_value(SYSTEM_VALUE_INSTANCE_ID, int_t, "gl_InstanceIDARB", glsl_precision_high); if (state->ARB_draw_instanced_enable || state->is_version(140, 300)) - add_system_value(SYSTEM_VALUE_INSTANCE_ID, int_t, "gl_InstanceID", glsl_precision_high); + add_system_value(SYSTEM_VALUE_INSTANCE_ID, state->metal_target ? uint_t : int_t, "gl_InstanceID", glsl_precision_high); if (state->AMD_vertex_shader_layer_enable) add_output(VARYING_SLOT_LAYER, int_t, "gl_Layer", glsl_precision_high); + if (state->AMD_vertex_shader_viewport_index_enable) + add_output(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex", glsl_precision_high); if (compatibility) { add_input(VERT_ATTRIB_POS, vec4_t, "gl_Vertex", glsl_precision_high); add_input(VERT_ATTRIB_NORMAL, vec3_t, "gl_Normal", glsl_precision_medium); @@ -872,6 +867,8 @@ builtin_variable_generator::generate_gs_special_vars() add_output(VARYING_SLOT_LAYER, int_t, "gl_Layer", glsl_precision_high); if (state->ARB_viewport_array_enable) add_output(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex", glsl_precision_high); + if (state->ARB_gpu_shader5_enable) + add_system_value(SYSTEM_VALUE_INVOCATION_ID, int_t, "gl_InvocationID", glsl_precision_high); /* Although gl_PrimitiveID appears in tessellation control and tessellation * evaluation shaders, it has a different function there than it has in @@ -900,7 +897,7 @@ builtin_variable_generator::generate_fs_special_vars() add_input(VARYING_SLOT_POS, vec4_t, "gl_FragCoord", glsl_precision_high); add_input(VARYING_SLOT_FACE, bool_t, "gl_FrontFacing", glsl_precision_low); if (state->is_version(120, 100)) - add_input(VARYING_SLOT_PNTC, vec2_t, "gl_PointCoord", glsl_precision_medium); + add_input(VARYING_SLOT_PNTC, vec2_t, "gl_PointCoord", state->metal_target ? glsl_precision_high : glsl_precision_medium); if (state->is_version(150, 0)) { ir_variable *var = @@ -928,21 +925,28 @@ builtin_variable_generator::generate_fs_special_vars() ir_variable *const var = add_output(FRAG_RESULT_STENCIL, int_t, "gl_FragStencilRefARB", glsl_precision_high); if (state->ARB_shader_stencil_export_warn) - var->warn_extension = "GL_ARB_shader_stencil_export"; + var->enable_extension_warning("GL_ARB_shader_stencil_export"); } if (state->AMD_shader_stencil_export_enable) { ir_variable *const var = add_output(FRAG_RESULT_STENCIL, int_t, "gl_FragStencilRefAMD", glsl_precision_high); if (state->AMD_shader_stencil_export_warn) - var->warn_extension = "GL_AMD_shader_stencil_export"; + 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->warn_extension = "GL_EXT_frag_depth"; + 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); + if (state->EXT_shader_framebuffer_fetch_warn) + var->enable_extension_warning("GL_EXT_shader_framebuffer_fetch"); } if (state->ARB_sample_shading_enable) { @@ -961,6 +965,11 @@ builtin_variable_generator::generate_fs_special_vars() if (state->ARB_gpu_shader5_enable) { add_system_value(SYSTEM_VALUE_SAMPLE_MASK_IN, array(int_t, 1), "gl_SampleMaskIn", glsl_precision_high); } + + if (state->ARB_fragment_layer_viewport_enable) { + add_input(VARYING_SLOT_LAYER, int_t, "gl_Layer", glsl_precision_high); + add_input(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex", glsl_precision_high); + } } diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.c index ccd1a2b28..80ac1669c 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.c +++ b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.c @@ -358,8 +358,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 43 -#define YY_END_OF_BUFFER 44 +#define YY_NUM_RULES 52 +#define YY_END_OF_BUFFER 53 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -367,43 +367,45 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[152] = +static yyconst flex_int16_t yy_accept[174] = { 0, - 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, - 0, 0, 0, 0, 44, 39, 40, 41, 43, 38, - 43, 38, 38, 38, 25, 24, 38, 38, 38, 37, - 37, 38, 40, 23, 3, 4, 5, 42, 17, 17, - 17, 21, 39, 40, 32, 35, 33, 2, 1, 25, - 25, 0, 24, 24, 27, 29, 31, 30, 28, 37, - 37, 34, 40, 23, 23, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 5, 7, 0, 0, - 0, 0, 20, 21, 1, 26, 37, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 26, 37, 0, + 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 53, 48, 49, 50, 51, 50, + 47, 8, 47, 47, 47, 47, 47, 47, 31, 30, + 47, 47, 47, 45, 45, 47, 3, 4, 4, 5, + 29, 27, 51, 26, 24, 23, 13, 13, 24, 24, + 24, 24, 24, 24, 24, 24, 48, 50, 38, 43, + 39, 41, 42, 46, 2, 1, 46, 31, 46, 31, + 46, 30, 30, 33, 35, 37, 36, 34, 45, 45, + 40, 3, 4, 4, 4, 5, 6, 6, 5, 7, + 29, 27, 28, 1, 25, 26, 23, 13, 0, 0, - 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, - 0, 0, 37, 0, 0, 15, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 37, 0, 14, 16, 18, - 0, 11, 0, 10, 0, 22, 0, 36, 0, 18, - 0, 12, 0, 0, 19, 0, 9, 0, 0, 8, - 0 + 0, 0, 0, 0, 0, 0, 0, 0, 1, 32, + 32, 45, 4, 6, 28, 1, 0, 0, 0, 0, + 0, 0, 16, 0, 0, 0, 0, 0, 0, 32, + 45, 0, 0, 18, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 45, 0, 17, 19, 20, 0, 14, + 0, 12, 0, 22, 0, 45, 21, 20, 0, 15, + 11, 0, 44, 21, 0, 11, 11, 10, 0, 0, + 9, 11, 0 } ; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, + 4, 4, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 5, 1, 6, 1, 7, 8, 1, 9, - 7, 10, 7, 7, 7, 7, 11, 12, 13, 13, - 13, 13, 13, 13, 13, 14, 14, 1, 7, 15, - 16, 17, 1, 1, 18, 18, 18, 18, 18, 18, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 20, 19, 19, 21, 19, 19, - 7, 1, 7, 7, 19, 1, 22, 18, 18, 23, + 1, 2, 6, 1, 7, 1, 8, 9, 1, 10, + 8, 11, 12, 8, 13, 14, 15, 16, 17, 17, + 17, 17, 17, 17, 17, 18, 18, 1, 8, 19, + 20, 21, 1, 1, 22, 22, 22, 22, 23, 22, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, + 24, 24, 24, 24, 26, 24, 24, 27, 24, 24, + 8, 1, 8, 8, 24, 1, 28, 22, 22, 29, - 24, 25, 26, 19, 27, 19, 19, 28, 29, 30, - 31, 32, 19, 33, 34, 35, 36, 37, 19, 38, - 19, 19, 7, 39, 7, 7, 1, 1, 1, 1, + 30, 31, 32, 24, 33, 24, 24, 34, 35, 36, + 37, 38, 24, 39, 40, 41, 42, 43, 24, 44, + 24, 24, 8, 45, 8, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -420,144 +422,175 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[40] = +static yyconst flex_int32_t yy_meta[46] = { 0, - 1, 1, 2, 1, 1, 1, 1, 1, 3, 4, - 1, 5, 5, 5, 1, 1, 1, 5, 6, 6, - 6, 5, 7, 5, 5, 6, 6, 6, 6, 8, - 6, 6, 6, 6, 6, 6, 6, 6, 1 + 1, 2, 3, 2, 3, 1, 1, 1, 1, 4, + 5, 1, 1, 6, 1, 7, 7, 7, 1, 1, + 1, 7, 7, 7, 7, 7, 7, 7, 8, 7, + 7, 7, 7, 7, 7, 8, 7, 7, 7, 7, + 7, 7, 7, 7, 1 } ; -static yyconst flex_int16_t yy_base[166] = +static yyconst flex_int16_t yy_base[191] = { 0, - 0, 38, 0, 0, 38, 39, 321, 320, 319, 44, - 50, 0, 0, 0, 321, 319, 317, 325, 325, 302, - 311, 325, 308, 80, 80, 83, 83, 299, 88, 0, - 290, 274, 100, 118, 309, 325, 104, 325, 325, 106, - 107, 302, 309, 307, 325, 325, 325, 325, 0, 113, - 325, 0, 115, 325, 325, 325, 325, 325, 325, 0, - 283, 325, 111, 301, 300, 281, 110, 279, 276, 269, - 271, 276, 296, 325, 149, 325, 153, 325, 130, 120, - 151, 15, 325, 289, 0, 74, 270, 271, 96, 272, - 261, 258, 135, 262, 269, 267, 256, 325, 258, 260, + 0, 0, 43, 44, 55, 0, 47, 48, 99, 141, + 102, 103, 106, 107, 435, 433, 436, 428, 436, 429, + 411, 423, 436, 420, 416, 414, 99, 107, 169, 198, + 100, 406, 103, 0, 395, 379, 122, 418, 419, 144, + 0, 419, 115, 410, 436, 417, 413, 414, 120, 386, + 114, 384, 381, 374, 376, 381, 409, 436, 436, 436, + 436, 436, 436, 138, 436, 0, 139, 164, 197, 126, + 229, 0, 139, 436, 436, 436, 436, 436, 0, 378, + 436, 131, 403, 404, 436, 186, 401, 402, 197, 436, + 0, 402, 0, 163, 436, 393, 400, 436, 370, 133, - 261, 261, 257, 252, 258, 325, 257, 257, 255, 252, - 253, 242, 245, 231, 0, 325, 228, 219, 216, 213, - 208, 216, 148, 151, 147, 150, 148, 325, 325, 0, - 137, 325, 145, 167, 146, 325, 136, 0, 164, 0, - 135, 325, 0, 131, 155, 108, 0, 135, 91, 109, - 325, 178, 186, 194, 202, 206, 214, 222, 228, 236, - 240, 247, 255, 259, 267 + 371, 360, 357, 169, 361, 368, 366, 355, 0, 146, + 191, 360, 436, 436, 0, 227, 359, 360, 360, 356, + 351, 357, 436, 356, 356, 341, 329, 319, 301, 206, + 304, 297, 0, 436, 297, 288, 276, 280, 268, 261, + 220, 219, 216, 218, 214, 436, 436, 0, 203, 436, + 207, 232, 198, 436, 188, 164, 185, 0, 145, 436, + 251, 124, 0, 155, 117, 227, 259, 436, 138, 85, + 111, 234, 436, 264, 272, 280, 283, 285, 293, 301, + 309, 317, 322, 330, 338, 346, 354, 362, 368, 376 } ; -static yyconst flex_int16_t yy_def[166] = +static yyconst flex_int16_t yy_def[191] = { 0, - 151, 1, 152, 152, 153, 153, 154, 154, 155, 155, - 151, 11, 152, 152, 151, 151, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 156, - 156, 151, 151, 151, 157, 151, 158, 151, 151, 151, - 151, 159, 151, 151, 151, 151, 151, 151, 160, 151, - 151, 161, 151, 151, 151, 151, 151, 151, 151, 156, - 156, 151, 151, 34, 34, 151, 151, 151, 151, 151, - 151, 151, 157, 151, 158, 151, 158, 151, 151, 151, - 151, 151, 151, 159, 160, 161, 156, 151, 151, 151, - 151, 151, 162, 151, 151, 151, 151, 151, 156, 151, + 173, 1, 174, 174, 173, 5, 175, 175, 176, 176, + 175, 175, 175, 175, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 177, 177, + 173, 173, 173, 178, 178, 173, 179, 173, 173, 180, + 181, 173, 182, 183, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 177, 173, 184, 177, 30, 177, 69, + 69, 30, 69, 173, 173, 173, 173, 173, 178, 178, + 173, 179, 173, 173, 173, 180, 173, 173, 180, 173, + 181, 173, 185, 186, 173, 183, 173, 173, 173, 173, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 151, 151, 156, 151, 163, 151, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 156, 151, 151, 151, 164, - 151, 151, 151, 151, 151, 151, 151, 156, 151, 164, - 151, 151, 165, 151, 151, 151, 165, 151, 151, 151, - 0, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 151, 151, 151, 151, 151 + 173, 173, 173, 187, 173, 173, 173, 173, 184, 71, + 71, 178, 173, 173, 185, 186, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 69, + 178, 173, 188, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 178, 173, 173, 173, 189, 173, 173, + 173, 173, 173, 173, 173, 178, 173, 189, 173, 173, + 190, 173, 178, 173, 173, 190, 190, 173, 173, 173, + 173, 190, 0, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173 } ; -static yyconst flex_int16_t yy_nxt[365] = +static yyconst flex_int16_t yy_nxt[482] = { 0, - 16, 17, 18, 19, 20, 21, 22, 23, 22, 22, - 24, 25, 26, 26, 27, 28, 29, 30, 30, 30, - 30, 30, 31, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 32, 33, - 36, 36, 89, 34, 90, 40, 18, 37, 37, 41, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 19, 48, - 49, 50, 50, 98, 53, 53, 53, 55, 56, 51, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 23, + 23, 25, 26, 27, 28, 29, 30, 30, 31, 32, + 33, 34, 34, 34, 34, 34, 34, 34, 35, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 36, 38, 38, 39, 39, 18, + 18, 20, 20, 40, 40, 41, 42, 18, 19, 20, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 43, + 41, 41, 41, 41, 41, 41, 44, 44, 44, 44, + 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, + 44, 44, 44, 44, 44, 44, 44, 44, 44, 41, - 52, 63, 54, 58, 59, 64, 76, 79, 81, 98, - 150, 80, 63, 77, 78, 51, 64, 52, 54, 65, - 143, 81, 101, 46, 50, 50, 53, 53, 53, 102, - 82, 79, 51, 68, 54, 80, 150, 89, 149, 90, - 66, 67, 91, 82, 68, 69, 68, 92, 51, 70, - 54, 76, 81, 71, 72, 76, 145, 107, 151, 151, - 148, 146, 77, 78, 108, 145, 144, 143, 134, 142, - 141, 139, 138, 137, 82, 136, 135, 68, 19, 19, - 19, 19, 19, 19, 19, 19, 35, 35, 35, 35, - 35, 35, 35, 35, 38, 38, 38, 38, 38, 38, + 46, 47, 19, 48, 18, 18, 20, 20, 18, 18, + 20, 20, 171, 49, 64, 64, 64, 65, 74, 75, + 172, 66, 77, 78, 83, 65, 84, 50, 51, 94, + 65, 52, 53, 83, 66, 84, 54, 173, 173, 171, + 55, 56, 46, 47, 19, 48, 87, 100, 88, 101, + 173, 173, 102, 170, 89, 49, 164, 103, 90, 169, + 69, 69, 69, 69, 109, 118, 109, 69, 69, 50, + 51, 130, 119, 52, 53, 69, 69, 165, 54, 68, + 68, 67, 55, 56, 68, 68, 164, 130, 87, 70, + 88, 69, 163, 69, 70, 71, 173, 124, 69, 87, - 38, 38, 39, 39, 39, 39, 39, 39, 39, 39, - 60, 60, 60, 60, 73, 73, 73, 134, 73, 73, - 73, 73, 75, 75, 75, 75, 75, 75, 75, 75, - 84, 133, 84, 84, 84, 84, 85, 132, 85, 85, - 85, 85, 85, 85, 86, 131, 86, 106, 106, 106, - 106, 130, 129, 106, 106, 128, 128, 128, 128, 140, - 127, 140, 140, 140, 140, 140, 140, 147, 126, 147, - 147, 147, 147, 147, 147, 125, 124, 123, 122, 121, - 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, - 110, 109, 105, 104, 103, 100, 99, 83, 74, 97, + 173, 88, 67, 67, 125, 70, 69, 89, 67, 67, + 70, 90, 71, 72, 72, 72, 130, 173, 173, 69, + 69, 69, 69, 73, 162, 161, 69, 69, 109, 173, + 109, 173, 130, 152, 69, 69, 173, 160, 173, 73, + 173, 173, 159, 157, 110, 110, 110, 156, 155, 154, + 110, 111, 167, 168, 153, 168, 110, 110, 111, 110, + 167, 168, 152, 168, 37, 37, 37, 37, 37, 37, + 37, 37, 19, 19, 19, 19, 19, 19, 19, 19, + 45, 45, 45, 45, 45, 45, 45, 45, 67, 67, + 67, 79, 79, 82, 82, 82, 82, 151, 82, 82, - 96, 95, 94, 93, 88, 151, 151, 87, 44, 43, - 83, 74, 62, 61, 57, 47, 46, 45, 44, 43, - 151, 18, 19, 19, 15, 151, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 151, 151, 151, 151 + 82, 86, 86, 86, 86, 86, 86, 86, 86, 91, + 150, 149, 91, 91, 91, 91, 91, 93, 93, 93, + 93, 93, 93, 93, 93, 96, 148, 147, 96, 96, + 109, 109, 145, 109, 109, 109, 109, 109, 115, 144, + 143, 115, 115, 115, 115, 115, 116, 116, 142, 116, + 116, 116, 116, 116, 123, 123, 123, 123, 123, 123, + 141, 123, 146, 146, 146, 146, 146, 146, 158, 158, + 140, 158, 158, 158, 158, 158, 166, 166, 166, 166, + 166, 166, 166, 166, 139, 138, 137, 136, 135, 134, + 133, 132, 131, 129, 128, 127, 126, 122, 121, 120, + + 117, 97, 95, 92, 114, 114, 113, 113, 112, 57, + 108, 107, 106, 105, 104, 99, 98, 98, 97, 95, + 92, 85, 85, 81, 80, 76, 63, 62, 61, 60, + 59, 58, 58, 57, 173, 15, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173 } ; -static yyconst flex_int16_t yy_chk[365] = +static yyconst flex_int16_t yy_chk[482] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 5, 6, 82, 2, 82, 10, 10, 5, 6, 10, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 24, - 24, 25, 25, 86, 26, 26, 26, 27, 27, 25, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 4, 3, 4, 7, + 8, 7, 8, 3, 4, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 25, 33, 26, 29, 29, 33, 37, 40, 41, 86, - 150, 40, 63, 37, 37, 25, 63, 25, 26, 34, - 149, 80, 89, 34, 50, 50, 53, 53, 53, 89, - 41, 79, 50, 41, 53, 79, 148, 67, 146, 67, - 34, 34, 67, 80, 34, 34, 80, 67, 50, 34, - 53, 75, 81, 34, 34, 77, 145, 93, 75, 75, - 144, 141, 77, 77, 93, 139, 137, 135, 134, 133, - 131, 127, 126, 125, 81, 124, 123, 81, 152, 152, - 152, 152, 152, 152, 152, 152, 153, 153, 153, 153, - 153, 153, 153, 153, 154, 154, 154, 154, 154, 154, + 9, 9, 9, 9, 11, 12, 11, 12, 13, 14, + 13, 14, 171, 9, 27, 27, 27, 28, 31, 31, + 170, 28, 33, 33, 37, 43, 37, 9, 9, 43, + 49, 9, 9, 82, 49, 82, 9, 70, 70, 169, + 9, 9, 10, 10, 10, 10, 40, 51, 40, 51, + 73, 73, 51, 165, 40, 10, 164, 51, 40, 162, + 64, 67, 64, 67, 94, 100, 94, 64, 67, 10, + 10, 110, 100, 10, 10, 64, 67, 159, 10, 68, + 68, 68, 10, 10, 29, 29, 157, 110, 86, 68, + 86, 29, 156, 29, 29, 29, 86, 104, 29, 89, - 154, 154, 155, 155, 155, 155, 155, 155, 155, 155, - 156, 156, 156, 156, 157, 157, 157, 122, 157, 157, - 157, 157, 158, 158, 158, 158, 158, 158, 158, 158, - 159, 121, 159, 159, 159, 159, 160, 120, 160, 160, - 160, 160, 160, 160, 161, 119, 161, 162, 162, 162, - 162, 118, 117, 162, 162, 163, 163, 163, 163, 164, - 114, 164, 164, 164, 164, 164, 164, 165, 113, 165, - 165, 165, 165, 165, 165, 112, 111, 110, 109, 108, - 107, 105, 104, 103, 102, 101, 100, 99, 97, 96, - 95, 94, 92, 91, 90, 88, 87, 84, 73, 72, + 86, 89, 111, 111, 104, 68, 29, 89, 69, 69, + 29, 89, 29, 30, 30, 30, 111, 130, 130, 69, + 30, 69, 30, 30, 155, 153, 69, 30, 116, 166, + 116, 166, 111, 152, 69, 30, 172, 151, 172, 30, + 71, 71, 149, 145, 71, 71, 71, 144, 143, 142, + 71, 71, 161, 161, 141, 161, 71, 71, 71, 71, + 167, 167, 140, 167, 174, 174, 174, 174, 174, 174, + 174, 174, 175, 175, 175, 175, 175, 175, 175, 175, + 176, 176, 176, 176, 176, 176, 176, 176, 177, 177, + 177, 178, 178, 179, 179, 179, 179, 139, 179, 179, - 71, 70, 69, 68, 66, 65, 64, 61, 44, 43, - 42, 35, 32, 31, 28, 23, 21, 20, 17, 16, - 15, 9, 8, 7, 151, 151, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 151, 151, 151, 151 + 179, 180, 180, 180, 180, 180, 180, 180, 180, 181, + 138, 137, 181, 181, 181, 181, 181, 182, 182, 182, + 182, 182, 182, 182, 182, 183, 136, 135, 183, 183, + 184, 184, 132, 184, 184, 184, 184, 184, 185, 131, + 129, 185, 185, 185, 185, 185, 186, 186, 128, 186, + 186, 186, 186, 186, 187, 187, 187, 187, 187, 187, + 127, 187, 188, 188, 188, 188, 188, 188, 189, 189, + 126, 189, 189, 189, 189, 189, 190, 190, 190, 190, + 190, 190, 190, 190, 125, 124, 122, 121, 120, 119, + 118, 117, 112, 108, 107, 106, 105, 103, 102, 101, + + 99, 97, 96, 92, 88, 87, 84, 83, 80, 57, + 56, 55, 54, 53, 52, 50, 48, 47, 46, 44, + 42, 39, 38, 36, 35, 32, 26, 25, 24, 22, + 21, 20, 18, 16, 15, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173 } ; /* The intent behind this definition is that it'll catch @@ -618,34 +651,131 @@ void glcpp_set_column (int column_no , yyscan_t yyscanner); if (parser->has_new_source_number) \ yylloc->source = parser->new_source_number; \ yylloc->first_column = yycolumn + 1; \ - yylloc->first_line = yylineno; \ + yylloc->first_line = yylloc->last_line = yylineno; \ yycolumn += yyleng; \ + yylloc->last_column = yycolumn + 1; \ parser->has_new_line_number = 0; \ parser->has_new_source_number = 0; \ - } while(0); + } while(0); #define YY_USER_INIT \ do { \ yylineno = 1; \ - yycolumn = 1; \ + yycolumn = 0; \ yylloc->source = 0; \ } while(0) +/* It's ugly to have macros that have return statements inside of + * them, but flex-based lexer generation is all built around the + * return statement. + * + * To mitigate the ugliness, we defer as much of the logic as possible + * to an actual function, not a macro (see + * glcpplex_update_state_per_token) and we make the word RETURN + * prominent in all of the macros which may return. + * + * The most-commonly-used macro is RETURN_TOKEN which will perform all + * necessary state updates based on the provided token,, then + * conditionally return the token. It will not return a token if the + * parser is currently skipping tokens, (such as within #if + * 0...#else). + * + * The RETURN_TOKEN_NEVER_SKIP macro is a lower-level variant that + * makes the token returning unconditional. This is needed for things + * like #if and the tokens of its condition, (since these must be + * evaluated by the parser even when otherwise skipping). + * + * Finally, RETURN_STRING_TOKEN is a simple convenience wrapper on top + * of RETURN_TOKEN that performs a string copy of yytext before the + * return. + */ +#define RETURN_TOKEN_NEVER_SKIP(token) \ + do { \ + if (glcpp_lex_update_state_per_token (parser, token)) \ + return token; \ + } while (0) + +#define RETURN_TOKEN(token) \ + do { \ + if (! parser->skipping) { \ + RETURN_TOKEN_NEVER_SKIP(token); \ + } \ + } while(0) + +#define RETURN_STRING_TOKEN(token) \ + do { \ + if (! parser->skipping) { \ + yylval->str = ralloc_strdup (yyextra, yytext); \ + RETURN_TOKEN_NEVER_SKIP (token); \ + } \ + } while(0) + + +/* Update all state necessary for each token being returned. + * + * Here we'll be tracking newlines and spaces so that the lexer can + * alter its behavior as necessary, (for example, '#' has special + * significance if it is the first non-whitespace, non-comment token + * in a line, but does not otherwise). + * + * NOTE: If this function returns FALSE, then no token should be + * returned at all. This is used to suprress duplicate SPACE tokens. + */ +static int +glcpp_lex_update_state_per_token (glcpp_parser_t *parser, int token) +{ + /* After the first non-space token in a line, we won't + * allow any '#' to introduce a directive. */ + if (token == NEWLINE) { + parser->first_non_space_token_this_line = 1; + } else if (token != SPACE) { + parser->first_non_space_token_this_line = 0; + } + + /* Track newlines just to know whether a newline needs + * to be inserted if end-of-file comes early. */ + if (token == NEWLINE) { + parser->last_token_was_newline = 1; + } else { + parser->last_token_was_newline = 0; + } + + /* Track spaces to avoid emitting multiple SPACE + * tokens in a row. */ + if (token == SPACE) { + if (! parser->last_token_was_space) { + parser->last_token_was_space = 1; + return 1; + } else { + parser->last_token_was_space = 1; + return 0; + } + } else { + parser->last_token_was_space = 0; + return 1; + } +} + + +/* Note: When adding any start conditions to this list, you must also +* update the "Internal compiler error" catch-all rule near the end of +* this file. */ + /* The OTHER class is simply a catch-all for things that the CPP parser just doesn't care about. Since flex regular expressions that match longer strings take priority over those matching shorter strings, we have to be careful to avoid OTHER matching and hiding something that CPP does care about. So we simply exclude all characters that appear in any other expressions. */ -#line 641 "src/glsl/glcpp/glcpp-lex.c" +#line 771 "src/glsl/glcpp/glcpp-lex.c" #define INITIAL 0 -#define DONE 1 -#define COMMENT 2 -#define UNREACHABLE 3 -#define SKIP 4 -#define DEFINE 5 -#define NEWLINE_CATCHUP 6 +#define COMMENT 1 +#define DEFINE 2 +#define DONE 3 +#define HASH 4 +#define NEWLINE_CATCHUP 5 +#define UNREACHABLE 6 #define YY_EXTRA_TYPE glcpp_parser_t * @@ -874,9 +1004,6 @@ extern int glcpp_lex \ #endif #define YY_RULE_SETUP \ - if ( yyleng > 0 ) \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ - (yytext[yyleng - 1] == '\n'); \ YY_USER_ACTION /** The main scanner function which does all the work. @@ -888,7 +1015,7 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 95 "src/glsl/glcpp/glcpp-lex.l" +#line 195 "src/glsl/glcpp/glcpp-lex.l" glcpp_parser_t *parser = yyextra; @@ -907,52 +1034,49 @@ YY_DECL parser->commented_newlines--; if (parser->commented_newlines == 0) BEGIN INITIAL; - return NEWLINE; + RETURN_TOKEN_NEVER_SKIP (NEWLINE); } - /* The handling of the SKIP vs INITIAL start states requires - * some special handling. Typically, a lexer would change - * start states with statements like "BEGIN SKIP" within the - * lexer rules. We can't get away with that here, since we - * need the parser to actually evaluate expressions for - * directives like "#if". + /* Set up the parser->skipping bit here before doing any lexing. * - * So, here, in code that will be executed on every call to - * the lexer,and before any rules, we examine the skip_stack - * as set by the parser to know whether to change from INITIAL - * to SKIP or from SKIP back to INITIAL. + * This bit controls whether tokens are skipped, (as implemented by + * RETURN_TOKEN), such as between "#if 0" and "#endif". * - * Three cases cause us to switch out of the SKIP state and - * back to the INITIAL state: + * The parser maintains a skip_stack indicating whether we should be + * skipping, (and nested levels of #if/#ifdef/#ifndef/#endif) will + * push and pop items from the stack. * - * 1. The top of the skip_stack is of type SKIP_NO_SKIP - * This means we're still evaluating some #if - * hierarchy, but we're on a branch of it where - * content should not be skipped (such as "#if 1" or - * "#else" or so). + * Here are the rules for determining whether we are skipping: * - * 2. The skip_stack is NULL meaning that we've reached - * the last #endif. + * 1. If the skip stack is NULL, we are outside of all #if blocks + * and we are not skipping. * - * 3. The lexing_if bit is set. This indicates that we - * are lexing the expression following an "#if" of - * "#elif". Even inside an "#if 0" we need to lex this - * expression so the parser can correctly update the - * skip_stack state. + * 2. If the skip stack is non-NULL, the type of the top node in + * the stack determines whether to skip. A type of + * SKIP_NO_SKIP is used for blocks wheere we are emitting + * tokens, (such as between #if 1 and #endif, or after the + * #else of an #if 0, etc.). + * + * 3. The lexing_directive bit overrides the skip stack. This bit + * is set when we are actively lexing the expression for a + * pre-processor condition, (such as #if, #elif, or #else). In + * this case, even if otherwise skipping, we need to emit the + * tokens for this condition so that the parser can evaluate + * the expression. (For, #else, there's no expression, but we + * emit tokens so the parser can generate a nice error message + * if there are any tokens here). */ - if (YY_START == INITIAL || YY_START == SKIP) { - if (parser->lexing_if || - parser->skip_stack == NULL || - parser->skip_stack->type == SKIP_NO_SKIP) - { - BEGIN INITIAL; - } else { - BEGIN SKIP; - } + if (parser->skip_stack && + parser->skip_stack->type != SKIP_NO_SKIP && + ! parser->lexing_directive) + { + parser->skipping = 1; + } else { + parser->skipping = 0; } /* Single-line comments */ -#line 956 "src/glsl/glcpp/glcpp-lex.c" +#line 1080 "src/glsl/glcpp/glcpp-lex.c" yylval = yylval_param; @@ -997,7 +1121,6 @@ YY_DECL yy_bp = yy_cp; yy_current_state = yyg->yy_start; - yy_current_state += YY_AT_BOL(); yy_match: do { @@ -1010,13 +1133,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 152 ) + if ( yy_current_state >= 174 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_current_state != 151 ); + while ( yy_current_state != 173 ); yy_cp = yyg->yy_last_accepting_cpos; yy_current_state = yyg->yy_last_accepting_state; @@ -1038,378 +1161,512 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 158 "src/glsl/glcpp/glcpp-lex.l" +#line 255 "src/glsl/glcpp/glcpp-lex.l" { } YY_BREAK /* Multi-line comments */ case 2: YY_RULE_SETUP -#line 162 "src/glsl/glcpp/glcpp-lex.l" +#line 259 "src/glsl/glcpp/glcpp-lex.l" { yy_push_state(COMMENT, yyscanner); } YY_BREAK case 3: YY_RULE_SETUP -#line 163 "src/glsl/glcpp/glcpp-lex.l" +#line 260 "src/glsl/glcpp/glcpp-lex.l" YY_BREAK case 4: /* rule 4 can match eol */ YY_RULE_SETUP -#line 164 "src/glsl/glcpp/glcpp-lex.l" +#line 261 "src/glsl/glcpp/glcpp-lex.l" { yylineno++; yycolumn = 0; parser->commented_newlines++; } YY_BREAK case 5: YY_RULE_SETUP -#line 165 "src/glsl/glcpp/glcpp-lex.l" +#line 262 "src/glsl/glcpp/glcpp-lex.l" YY_BREAK case 6: /* rule 6 can match eol */ YY_RULE_SETUP -#line 166 "src/glsl/glcpp/glcpp-lex.l" +#line 263 "src/glsl/glcpp/glcpp-lex.l" { yylineno++; yycolumn = 0; parser->commented_newlines++; } YY_BREAK case 7: YY_RULE_SETUP -#line 167 "src/glsl/glcpp/glcpp-lex.l" +#line 264 "src/glsl/glcpp/glcpp-lex.l" { yy_pop_state(yyscanner); - if (yyextra->space_tokens) - return SPACE; + /* In the start condition, we don't want any SPACE token. */ + if (yyextra->space_tokens && YY_START != HASH) + RETURN_TOKEN (SPACE); } YY_BREAK case 8: YY_RULE_SETUP -#line 173 "src/glsl/glcpp/glcpp-lex.l" +#line 271 "src/glsl/glcpp/glcpp-lex.l" { - yylval->str = ralloc_strdup (yyextra, yytext); + + /* If the '#' is the first non-whitespace, non-comment token on this + * line, then it introduces a directive, switch to the start + * condition. + * + * Otherwise, this is just punctuation, so return the HASH_TOKEN + * token. */ + if (parser->first_non_space_token_this_line) { + BEGIN HASH; + } + + RETURN_TOKEN_NEVER_SKIP (HASH_TOKEN); +} + YY_BREAK +case 9: +YY_RULE_SETUP +#line 286 "src/glsl/glcpp/glcpp-lex.l" +{ + BEGIN INITIAL; yyextra->space_tokens = 0; - return HASH_VERSION; + RETURN_STRING_TOKEN (VERSION_TOKEN); +} + YY_BREAK +/* Swallow empty #pragma directives, (to avoid confusing the + * downstream compiler). + * + * Note: We use a simple regular expression for the lookahead + * here. Specifically, we cannot use the complete {NEWLINE} expression + * since it uses alternation and we've found that there's a flex bug + * where using alternation in the lookahead portion of a pattern + * triggers a buffer overrun. */ +case 10: +/* rule 10 can match eol */ +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 300 "src/glsl/glcpp/glcpp-lex.l" +{ + BEGIN INITIAL; } YY_BREAK /* glcpp doesn't handle #extension, #version, or #pragma directives. * Simply pass them through to the main compiler's lexer/parser. */ -case 9: -YY_RULE_SETUP -#line 181 "src/glsl/glcpp/glcpp-lex.l" -{ - if (parser->commented_newlines) - BEGIN NEWLINE_CATCHUP; - yylval->str = ralloc_strdup (yyextra, yytext); - yylineno++; - yycolumn = 0; - return OTHER; -} - YY_BREAK -case 10: -YY_RULE_SETUP -#line 190 "src/glsl/glcpp/glcpp-lex.l" -{ - return HASH_LINE; -} - YY_BREAK - case 11: YY_RULE_SETUP -#line 195 "src/glsl/glcpp/glcpp-lex.l" +#line 306 "src/glsl/glcpp/glcpp-lex.l" { - yyextra->lexing_if = 1; - yyextra->space_tokens = 0; - return HASH_IFDEF; + BEGIN INITIAL; + RETURN_STRING_TOKEN (PRAGMA); } YY_BREAK case 12: YY_RULE_SETUP -#line 201 "src/glsl/glcpp/glcpp-lex.l" +#line 311 "src/glsl/glcpp/glcpp-lex.l" { - yyextra->lexing_if = 1; - yyextra->space_tokens = 0; - return HASH_IFNDEF; + BEGIN INITIAL; + RETURN_TOKEN (LINE); } YY_BREAK case 13: /* rule 13 can match eol */ -*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ -yyg->yy_c_buf_p = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 207 "src/glsl/glcpp/glcpp-lex.l" +#line 316 "src/glsl/glcpp/glcpp-lex.l" { - yyextra->lexing_if = 1; - yyextra->space_tokens = 0; - return HASH_IF; + BEGIN INITIAL; + RETURN_TOKEN_NEVER_SKIP (NEWLINE); } YY_BREAK +/* For the pre-processor directives, we return these tokens + * even when we are otherwise skipping. */ case 14: -/* rule 14 can match eol */ -*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ -yyg->yy_c_buf_p = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 213 "src/glsl/glcpp/glcpp-lex.l" +#line 323 "src/glsl/glcpp/glcpp-lex.l" { - yyextra->lexing_if = 1; + BEGIN INITIAL; + yyextra->lexing_directive = 1; yyextra->space_tokens = 0; - return HASH_ELIF; + RETURN_TOKEN_NEVER_SKIP (IFDEF); } YY_BREAK case 15: YY_RULE_SETUP -#line 219 "src/glsl/glcpp/glcpp-lex.l" +#line 330 "src/glsl/glcpp/glcpp-lex.l" { + BEGIN INITIAL; + yyextra->lexing_directive = 1; yyextra->space_tokens = 0; - return HASH_ELSE; + RETURN_TOKEN_NEVER_SKIP (IFNDEF); } YY_BREAK case 16: +/* rule 16 can match eol */ +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp = yy_bp + 2; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 224 "src/glsl/glcpp/glcpp-lex.l" +#line 337 "src/glsl/glcpp/glcpp-lex.l" { + BEGIN INITIAL; + yyextra->lexing_directive = 1; yyextra->space_tokens = 0; - return HASH_ENDIF; + RETURN_TOKEN_NEVER_SKIP (IF); } YY_BREAK - case 17: +/* rule 17 can match eol */ +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp = yy_bp + 4; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 230 "src/glsl/glcpp/glcpp-lex.l" +#line 344 "src/glsl/glcpp/glcpp-lex.l" { - if (parser->commented_newlines) - BEGIN NEWLINE_CATCHUP; + BEGIN INITIAL; + yyextra->lexing_directive = 1; + yyextra->space_tokens = 0; + RETURN_TOKEN_NEVER_SKIP (ELIF); } YY_BREAK case 18: YY_RULE_SETUP -#line 235 "src/glsl/glcpp/glcpp-lex.l" +#line 351 "src/glsl/glcpp/glcpp-lex.l" { - char *p; - for (p = yytext; !isalpha(p[0]); p++); /* skip " # " */ - p += 5; /* skip "error" */ - glcpp_error(yylloc, yyextra, "#error%s", p); + BEGIN INITIAL; + yyextra->space_tokens = 0; + RETURN_TOKEN_NEVER_SKIP (ELSE); } YY_BREAK case 19: YY_RULE_SETUP -#line 242 "src/glsl/glcpp/glcpp-lex.l" +#line 357 "src/glsl/glcpp/glcpp-lex.l" { + BEGIN INITIAL; yyextra->space_tokens = 0; - yy_push_state(DEFINE, yyscanner); - return HASH_DEFINE; + RETURN_TOKEN_NEVER_SKIP (ENDIF); } YY_BREAK case 20: -*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ -yyg->yy_c_buf_p = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 248 "src/glsl/glcpp/glcpp-lex.l" +#line 363 "src/glsl/glcpp/glcpp-lex.l" { - yy_pop_state(yyscanner); - yylval->str = ralloc_strdup (yyextra, yytext); - return FUNC_IDENTIFIER; + BEGIN INITIAL; + RETURN_STRING_TOKEN (ERROR_TOKEN); } YY_BREAK +/* After we see a "#define" we enter the start state + * for the lexer. Within we are looking for the first + * identifier and specifically checking whether the identifier + * is followed by a '(' or not, (to lex either a + * FUNC_IDENTIFIER or an OBJ_IDENITIFIER token). + * + * While in the 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). + * + * * Whitespace (simply ignored) + * + * * Anything else, (not an identifier, not a comment, + * and not whitespace). This will generate an error. + */ case 21: YY_RULE_SETUP -#line 254 "src/glsl/glcpp/glcpp-lex.l" +#line 386 "src/glsl/glcpp/glcpp-lex.l" { - yy_pop_state(yyscanner); - yylval->str = ralloc_strdup (yyextra, yytext); - return OBJ_IDENTIFIER; + if (! parser->skipping) { + BEGIN DEFINE; + yyextra->space_tokens = 0; + RETURN_TOKEN (DEFINE_TOKEN); + } } YY_BREAK case 22: YY_RULE_SETUP -#line 260 "src/glsl/glcpp/glcpp-lex.l" +#line 394 "src/glsl/glcpp/glcpp-lex.l" { + BEGIN INITIAL; yyextra->space_tokens = 0; - return HASH_UNDEF; + RETURN_TOKEN (UNDEF); } YY_BREAK case 23: YY_RULE_SETUP -#line 265 "src/glsl/glcpp/glcpp-lex.l" +#line 400 "src/glsl/glcpp/glcpp-lex.l" { - yyextra->space_tokens = 0; - return HASH; + /* Nothing to do here. Importantly, don't leave the + * start condition, since it's legal to have space between the + * '#' and the directive.. */ } YY_BREAK +/* This will catch any non-directive garbage after a HASH */ case 24: YY_RULE_SETUP -#line 270 "src/glsl/glcpp/glcpp-lex.l" +#line 407 "src/glsl/glcpp/glcpp-lex.l" { - yylval->str = ralloc_strdup (yyextra, yytext); - return INTEGER_STRING; + BEGIN INITIAL; + RETURN_TOKEN (GARBAGE); } YY_BREAK +/* An identifier immediately followed by '(' */ case 25: +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 275 "src/glsl/glcpp/glcpp-lex.l" +#line 413 "src/glsl/glcpp/glcpp-lex.l" { - yylval->str = ralloc_strdup (yyextra, yytext); - return INTEGER_STRING; + BEGIN INITIAL; + RETURN_STRING_TOKEN (FUNC_IDENTIFIER); } YY_BREAK +/* An identifier not immediately followed by '(' */ case 26: YY_RULE_SETUP -#line 280 "src/glsl/glcpp/glcpp-lex.l" +#line 419 "src/glsl/glcpp/glcpp-lex.l" { - yylval->str = ralloc_strdup (yyextra, yytext); - return INTEGER_STRING; + BEGIN INITIAL; + RETURN_STRING_TOKEN (OBJ_IDENTIFIER); } YY_BREAK +/* Whitespace */ case 27: YY_RULE_SETUP -#line 285 "src/glsl/glcpp/glcpp-lex.l" +#line 425 "src/glsl/glcpp/glcpp-lex.l" { - return LEFT_SHIFT; + /* Just ignore it. Nothing to do here. */ } YY_BREAK +/* '/' not followed by '*', so not a comment. This is an error. */ case 28: +/* rule 28 can match eol */ YY_RULE_SETUP -#line 289 "src/glsl/glcpp/glcpp-lex.l" +#line 430 "src/glsl/glcpp/glcpp-lex.l" { - return RIGHT_SHIFT; + BEGIN INITIAL; + glcpp_error(yylloc, yyextra, "#define followed by a non-identifier: %s", yytext); + RETURN_STRING_TOKEN (INTEGER_STRING); } YY_BREAK +/* A character that can't start an identifier, comment, or + * space. This is an error. */ case 29: YY_RULE_SETUP -#line 293 "src/glsl/glcpp/glcpp-lex.l" +#line 438 "src/glsl/glcpp/glcpp-lex.l" { - return LESS_OR_EQUAL; + BEGIN INITIAL; + glcpp_error(yylloc, yyextra, "#define followed by a non-identifier: %s", yytext); + RETURN_STRING_TOKEN (INTEGER_STRING); } YY_BREAK case 30: YY_RULE_SETUP -#line 297 "src/glsl/glcpp/glcpp-lex.l" +#line 444 "src/glsl/glcpp/glcpp-lex.l" { - return GREATER_OR_EQUAL; + RETURN_STRING_TOKEN (INTEGER_STRING); } YY_BREAK case 31: YY_RULE_SETUP -#line 301 "src/glsl/glcpp/glcpp-lex.l" +#line 448 "src/glsl/glcpp/glcpp-lex.l" { - return EQUAL; + RETURN_STRING_TOKEN (INTEGER_STRING); } YY_BREAK case 32: YY_RULE_SETUP -#line 305 "src/glsl/glcpp/glcpp-lex.l" +#line 452 "src/glsl/glcpp/glcpp-lex.l" { - return NOT_EQUAL; + RETURN_STRING_TOKEN (INTEGER_STRING); } YY_BREAK case 33: YY_RULE_SETUP -#line 309 "src/glsl/glcpp/glcpp-lex.l" +#line 456 "src/glsl/glcpp/glcpp-lex.l" { - return AND; + RETURN_TOKEN (LEFT_SHIFT); } YY_BREAK case 34: YY_RULE_SETUP -#line 313 "src/glsl/glcpp/glcpp-lex.l" +#line 460 "src/glsl/glcpp/glcpp-lex.l" { - return OR; + RETURN_TOKEN (RIGHT_SHIFT); } YY_BREAK case 35: YY_RULE_SETUP -#line 317 "src/glsl/glcpp/glcpp-lex.l" +#line 464 "src/glsl/glcpp/glcpp-lex.l" { - if (parser->is_gles) - glcpp_error(yylloc, yyextra, "Token pasting (##) is illegal in GLES"); - return PASTE; + RETURN_TOKEN (LESS_OR_EQUAL); } YY_BREAK case 36: YY_RULE_SETUP -#line 323 "src/glsl/glcpp/glcpp-lex.l" +#line 468 "src/glsl/glcpp/glcpp-lex.l" { - return DEFINED; + RETURN_TOKEN (GREATER_OR_EQUAL); } YY_BREAK case 37: YY_RULE_SETUP -#line 327 "src/glsl/glcpp/glcpp-lex.l" +#line 472 "src/glsl/glcpp/glcpp-lex.l" { - yylval->str = ralloc_strdup (yyextra, yytext); - return IDENTIFIER; + RETURN_TOKEN (EQUAL); } YY_BREAK case 38: YY_RULE_SETUP -#line 332 "src/glsl/glcpp/glcpp-lex.l" +#line 476 "src/glsl/glcpp/glcpp-lex.l" { - return yytext[0]; + RETURN_TOKEN (NOT_EQUAL); } YY_BREAK case 39: YY_RULE_SETUP -#line 336 "src/glsl/glcpp/glcpp-lex.l" +#line 480 "src/glsl/glcpp/glcpp-lex.l" { - yylval->str = ralloc_strdup (yyextra, yytext); - return OTHER; + RETURN_TOKEN (AND); } YY_BREAK case 40: YY_RULE_SETUP -#line 341 "src/glsl/glcpp/glcpp-lex.l" +#line 484 "src/glsl/glcpp/glcpp-lex.l" { - if (yyextra->space_tokens) { - return SPACE; - } + RETURN_TOKEN (OR); } YY_BREAK case 41: -/* rule 41 can match eol */ YY_RULE_SETUP -#line 347 "src/glsl/glcpp/glcpp-lex.l" +#line 488 "src/glsl/glcpp/glcpp-lex.l" { - if (parser->commented_newlines) { - BEGIN NEWLINE_CATCHUP; - } - yyextra->lexing_if = 0; - yylineno++; - yycolumn = 0; - return NEWLINE; + RETURN_TOKEN (PLUS_PLUS); } YY_BREAK -/* Handle missing newline at EOF. */ -case YY_STATE_EOF(INITIAL): -#line 358 "src/glsl/glcpp/glcpp-lex.l" -{ - BEGIN DONE; /* Don't keep matching this rule forever. */ - yyextra->lexing_if = 0; - return NEWLINE; -} - YY_BREAK -/* We don't actually use the UNREACHABLE start condition. We - only have this action here so that we can pretend to call some - generated functions, (to avoid "defined but not used" - warnings. */ case 42: YY_RULE_SETUP -#line 368 "src/glsl/glcpp/glcpp-lex.l" +#line 492 "src/glsl/glcpp/glcpp-lex.l" { - unput('.'); - yy_top_state(yyextra); + RETURN_TOKEN (MINUS_MINUS); } YY_BREAK case 43: YY_RULE_SETUP -#line 373 "src/glsl/glcpp/glcpp-lex.l" -ECHO; +#line 496 "src/glsl/glcpp/glcpp-lex.l" +{ + if (! parser->skipping) { + if (parser->is_gles) + glcpp_error(yylloc, yyextra, "Token pasting (##) is illegal in GLES"); + RETURN_TOKEN (PASTE); + } +} YY_BREAK -#line 1407 "src/glsl/glcpp/glcpp-lex.c" -case YY_STATE_EOF(DONE): +case 44: +YY_RULE_SETUP +#line 504 "src/glsl/glcpp/glcpp-lex.l" +{ + RETURN_TOKEN (DEFINED); +} + YY_BREAK +case 45: +YY_RULE_SETUP +#line 508 "src/glsl/glcpp/glcpp-lex.l" +{ + RETURN_STRING_TOKEN (IDENTIFIER); +} + YY_BREAK +case 46: +YY_RULE_SETUP +#line 512 "src/glsl/glcpp/glcpp-lex.l" +{ + RETURN_STRING_TOKEN (OTHER); +} + YY_BREAK +case 47: +YY_RULE_SETUP +#line 516 "src/glsl/glcpp/glcpp-lex.l" +{ + RETURN_TOKEN (yytext[0]); +} + YY_BREAK +case 48: +YY_RULE_SETUP +#line 520 "src/glsl/glcpp/glcpp-lex.l" +{ + RETURN_STRING_TOKEN (OTHER); +} + YY_BREAK +case 49: +YY_RULE_SETUP +#line 524 "src/glsl/glcpp/glcpp-lex.l" +{ + if (yyextra->space_tokens) { + RETURN_TOKEN (SPACE); + } +} + YY_BREAK +/* We preserve all newlines, even between #if 0..#endif, so no + skipping.. */ +case 50: +/* rule 50 can match eol */ +YY_RULE_SETUP +#line 532 "src/glsl/glcpp/glcpp-lex.l" +{ + if (parser->commented_newlines) { + BEGIN NEWLINE_CATCHUP; + } else { + BEGIN INITIAL; + } + yyextra->space_tokens = 1; + yyextra->lexing_directive = 0; + yylineno++; + yycolumn = 0; + RETURN_TOKEN_NEVER_SKIP (NEWLINE); +} + YY_BREAK +case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(COMMENT): -case YY_STATE_EOF(UNREACHABLE): -case YY_STATE_EOF(SKIP): case YY_STATE_EOF(DEFINE): +case YY_STATE_EOF(HASH): +#line 545 "src/glsl/glcpp/glcpp-lex.l" +{ + if (YY_START == COMMENT) + glcpp_error(yylloc, yyextra, "Unterminated comment"); + BEGIN DONE; /* Don't keep matching this rule forever. */ + yyextra->lexing_directive = 0; + if (! parser->last_token_was_newline) + RETURN_TOKEN (NEWLINE); +} + YY_BREAK +/* This is a catch-all to avoid the annoying default flex action which + * matches any character and prints it. If any input ever matches this + * rule, then we have made a mistake above and need to fix one or more + * of the preceding patterns to match that input. */ +case 51: +YY_RULE_SETUP +#line 559 "src/glsl/glcpp/glcpp-lex.l" +{ + glcpp_error(yylloc, yyextra, "Internal compiler error: Unexpected character: %s", yytext); + + /* We don't actually use the UNREACHABLE start condition. We + only have this block here so that we can pretend to call some + generated functions, (to avoid "defined but not used" + warnings. */ + if (YY_START == UNREACHABLE) { + unput('.'); + yy_top_state(yyextra); + } +} + YY_BREAK +case 52: +YY_RULE_SETUP +#line 572 "src/glsl/glcpp/glcpp-lex.l" +YY_FATAL_ERROR( "flex scanner jammed" ); + YY_BREAK +#line 1667 "src/glsl/glcpp/glcpp-lex.c" +case YY_STATE_EOF(DONE): case YY_STATE_EOF(NEWLINE_CATCHUP): +case YY_STATE_EOF(UNREACHABLE): yyterminate(); case YY_END_OF_BUFFER: @@ -1691,7 +1948,6 @@ static int yy_get_next_buffer (yyscan_t yyscanner) struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_current_state = yyg->yy_start; - yy_current_state += YY_AT_BOL(); for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) { @@ -1704,7 +1960,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 152 ) + if ( yy_current_state >= 174 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1733,11 +1989,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 152 ) + if ( yy_current_state >= 174 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 151); + yy_is_jam = (yy_current_state == 173); return yy_is_jam ? 0 : yy_current_state; } @@ -1851,8 +2107,6 @@ static int yy_get_next_buffer (yyscan_t yyscanner) *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ yyg->yy_hold_char = *++yyg->yy_c_buf_p; - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); - return c; } #endif /* ifndef YY_NO_INPUT */ @@ -2627,7 +2881,7 @@ void glcpp_free (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 373 "src/glsl/glcpp/glcpp-lex.l" +#line 572 "src/glsl/glcpp/glcpp-lex.l" diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l index 07d8405e4..8b20fabd9 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l +++ b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l @@ -48,18 +48,112 @@ void glcpp_set_column (int column_no , yyscan_t yyscanner); if (parser->has_new_source_number) \ yylloc->source = parser->new_source_number; \ yylloc->first_column = yycolumn + 1; \ - yylloc->first_line = yylineno; \ + yylloc->first_line = yylloc->last_line = yylineno; \ yycolumn += yyleng; \ + yylloc->last_column = yycolumn + 1; \ parser->has_new_line_number = 0; \ parser->has_new_source_number = 0; \ - } while(0); + } while(0); #define YY_USER_INIT \ do { \ yylineno = 1; \ - yycolumn = 1; \ + yycolumn = 0; \ yylloc->source = 0; \ } while(0) + +/* It's ugly to have macros that have return statements inside of + * them, but flex-based lexer generation is all built around the + * return statement. + * + * To mitigate the ugliness, we defer as much of the logic as possible + * to an actual function, not a macro (see + * glcpplex_update_state_per_token) and we make the word RETURN + * prominent in all of the macros which may return. + * + * The most-commonly-used macro is RETURN_TOKEN which will perform all + * necessary state updates based on the provided token,, then + * conditionally return the token. It will not return a token if the + * parser is currently skipping tokens, (such as within #if + * 0...#else). + * + * The RETURN_TOKEN_NEVER_SKIP macro is a lower-level variant that + * makes the token returning unconditional. This is needed for things + * like #if and the tokens of its condition, (since these must be + * evaluated by the parser even when otherwise skipping). + * + * Finally, RETURN_STRING_TOKEN is a simple convenience wrapper on top + * of RETURN_TOKEN that performs a string copy of yytext before the + * return. + */ +#define RETURN_TOKEN_NEVER_SKIP(token) \ + do { \ + if (glcpp_lex_update_state_per_token (parser, token)) \ + return token; \ + } while (0) + +#define RETURN_TOKEN(token) \ + do { \ + if (! parser->skipping) { \ + RETURN_TOKEN_NEVER_SKIP(token); \ + } \ + } while(0) + +#define RETURN_STRING_TOKEN(token) \ + do { \ + if (! parser->skipping) { \ + yylval->str = ralloc_strdup (yyextra, yytext); \ + RETURN_TOKEN_NEVER_SKIP (token); \ + } \ + } while(0) + + +/* Update all state necessary for each token being returned. + * + * Here we'll be tracking newlines and spaces so that the lexer can + * alter its behavior as necessary, (for example, '#' has special + * significance if it is the first non-whitespace, non-comment token + * in a line, but does not otherwise). + * + * NOTE: If this function returns FALSE, then no token should be + * returned at all. This is used to suprress duplicate SPACE tokens. + */ +static int +glcpp_lex_update_state_per_token (glcpp_parser_t *parser, int token) +{ + /* After the first non-space token in a line, we won't + * allow any '#' to introduce a directive. */ + if (token == NEWLINE) { + parser->first_non_space_token_this_line = 1; + } else if (token != SPACE) { + parser->first_non_space_token_this_line = 0; + } + + /* Track newlines just to know whether a newline needs + * to be inserted if end-of-file comes early. */ + if (token == NEWLINE) { + parser->last_token_was_newline = 1; + } else { + parser->last_token_was_newline = 0; + } + + /* Track spaces to avoid emitting multiple SPACE + * tokens in a row. */ + if (token == SPACE) { + if (! parser->last_token_was_space) { + parser->last_token_was_space = 1; + return 1; + } else { + parser->last_token_was_space = 1; + return 0; + } + } else { + parser->last_token_was_space = 0; + return 1; + } +} + + %} %option bison-bridge bison-locations reentrant noyywrap @@ -67,15 +161,21 @@ void glcpp_set_column (int column_no , yyscan_t yyscanner); %option prefix="glcpp_" %option stack %option never-interactive +%option warn nodefault -%x DONE COMMENT UNREACHABLE SKIP DEFINE NEWLINE_CATCHUP + /* Note: When adding any start conditions to this list, you must also + * update the "Internal compiler error" catch-all rule near the end of + * this file. */ + +%x COMMENT DEFINE DONE HASH NEWLINE_CATCHUP UNREACHABLE SPACE [[:space:]] NONSPACE [^[:space:]] -NEWLINE [\n] HSPACE [ \t] -HASH ^{HSPACE}*#{HSPACE}* +HASH # +NEWLINE (\r\n|\n\r|\r|\n) IDENTIFIER [_a-zA-Z][_a-zA-Z0-9]* +PP_NUMBER [.]?[0-9]([._a-zA-Z0-9]|[eEpP][-+])* PUNCTUATION [][(){}.&*~!/%<>^|;,=+-] /* The OTHER class is simply a catch-all for things that the CPP @@ -110,264 +210,363 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? parser->commented_newlines--; if (parser->commented_newlines == 0) BEGIN INITIAL; - return NEWLINE; + RETURN_TOKEN_NEVER_SKIP (NEWLINE); } - /* The handling of the SKIP vs INITIAL start states requires - * some special handling. Typically, a lexer would change - * start states with statements like "BEGIN SKIP" within the - * lexer rules. We can't get away with that here, since we - * need the parser to actually evaluate expressions for - * directives like "#if". + /* Set up the parser->skipping bit here before doing any lexing. * - * So, here, in code that will be executed on every call to - * the lexer,and before any rules, we examine the skip_stack - * as set by the parser to know whether to change from INITIAL - * to SKIP or from SKIP back to INITIAL. + * This bit controls whether tokens are skipped, (as implemented by + * RETURN_TOKEN), such as between "#if 0" and "#endif". * - * Three cases cause us to switch out of the SKIP state and - * back to the INITIAL state: + * The parser maintains a skip_stack indicating whether we should be + * skipping, (and nested levels of #if/#ifdef/#ifndef/#endif) will + * push and pop items from the stack. * - * 1. The top of the skip_stack is of type SKIP_NO_SKIP - * This means we're still evaluating some #if - * hierarchy, but we're on a branch of it where - * content should not be skipped (such as "#if 1" or - * "#else" or so). + * Here are the rules for determining whether we are skipping: * - * 2. The skip_stack is NULL meaning that we've reached - * the last #endif. + * 1. If the skip stack is NULL, we are outside of all #if blocks + * and we are not skipping. * - * 3. The lexing_if bit is set. This indicates that we - * are lexing the expression following an "#if" of - * "#elif". Even inside an "#if 0" we need to lex this - * expression so the parser can correctly update the - * skip_stack state. + * 2. If the skip stack is non-NULL, the type of the top node in + * the stack determines whether to skip. A type of + * SKIP_NO_SKIP is used for blocks wheere we are emitting + * tokens, (such as between #if 1 and #endif, or after the + * #else of an #if 0, etc.). + * + * 3. The lexing_directive bit overrides the skip stack. This bit + * is set when we are actively lexing the expression for a + * pre-processor condition, (such as #if, #elif, or #else). In + * this case, even if otherwise skipping, we need to emit the + * tokens for this condition so that the parser can evaluate + * the expression. (For, #else, there's no expression, but we + * emit tokens so the parser can generate a nice error message + * if there are any tokens here). */ - if (YY_START == INITIAL || YY_START == SKIP) { - if (parser->lexing_if || - parser->skip_stack == NULL || - parser->skip_stack->type == SKIP_NO_SKIP) - { - BEGIN INITIAL; - } else { - BEGIN SKIP; - } + if (parser->skip_stack && + parser->skip_stack->type != SKIP_NO_SKIP && + ! parser->lexing_directive) + { + parser->skipping = 1; + } else { + parser->skipping = 0; } /* Single-line comments */ -"//"[^\n]* { +"//"[^\r\n]* { } /* Multi-line comments */ -"/*" { yy_push_state(COMMENT, yyscanner); } -[^*\n]* -[^*\n]*\n { yylineno++; yycolumn = 0; parser->commented_newlines++; } -"*"+[^*/\n]* -"*"+[^*/\n]*\n { yylineno++; yycolumn = 0; parser->commented_newlines++; } +"/*" { yy_push_state(COMMENT, yyscanner); } +[^*\r\n]* +[^*\r\n]*{NEWLINE} { yylineno++; yycolumn = 0; parser->commented_newlines++; } +"*"+[^*/\r\n]* +"*"+[^*/\r\n]*{NEWLINE} { yylineno++; yycolumn = 0; parser->commented_newlines++; } "*"+"/" { yy_pop_state(yyscanner); - if (yyextra->space_tokens) - return SPACE; + /* In the start condition, we don't want any SPACE token. */ + if (yyextra->space_tokens && YY_START != HASH) + RETURN_TOKEN (SPACE); } -{HASH}version{HSPACE}+ { - yylval->str = ralloc_strdup (yyextra, yytext); +{HASH} { + + /* If the '#' is the first non-whitespace, non-comment token on this + * line, then it introduces a directive, switch to the start + * condition. + * + * Otherwise, this is just punctuation, so return the HASH_TOKEN + * token. */ + if (parser->first_non_space_token_this_line) { + BEGIN HASH; + } + + RETURN_TOKEN_NEVER_SKIP (HASH_TOKEN); +} + +version{HSPACE}+ { + BEGIN INITIAL; yyextra->space_tokens = 0; - return HASH_VERSION; + RETURN_STRING_TOKEN (VERSION_TOKEN); +} + + /* Swallow empty #pragma directives, (to avoid confusing the + * downstream compiler). + * + * Note: We use a simple regular expression for the lookahead + * here. Specifically, we cannot use the complete {NEWLINE} expression + * since it uses alternation and we've found that there's a flex bug + * where using alternation in the lookahead portion of a pattern + * triggers a buffer overrun. */ +pragma{HSPACE}*/[\r\n] { + BEGIN INITIAL; } /* glcpp doesn't handle #extension, #version, or #pragma directives. * Simply pass them through to the main compiler's lexer/parser. */ -{HASH}(extension|pragma)[^\n]+ { - if (parser->commented_newlines) - BEGIN NEWLINE_CATCHUP; - yylval->str = ralloc_strdup (yyextra, yytext); - yylineno++; - yycolumn = 0; - return OTHER; +(extension|pragma)[^\r\n]* { + BEGIN INITIAL; + RETURN_STRING_TOKEN (PRAGMA); } -{HASH}line{HSPACE}+ { - return HASH_LINE; +line{HSPACE}+ { + BEGIN INITIAL; + RETURN_TOKEN (LINE); } -{ -{HASH}ifdef { - yyextra->lexing_if = 1; +{NEWLINE} { + BEGIN INITIAL; + RETURN_TOKEN_NEVER_SKIP (NEWLINE); +} + + /* For the pre-processor directives, we return these tokens + * even when we are otherwise skipping. */ +ifdef { + BEGIN INITIAL; + yyextra->lexing_directive = 1; yyextra->space_tokens = 0; - return HASH_IFDEF; + RETURN_TOKEN_NEVER_SKIP (IFDEF); } -{HASH}ifndef { - yyextra->lexing_if = 1; +ifndef { + BEGIN INITIAL; + yyextra->lexing_directive = 1; yyextra->space_tokens = 0; - return HASH_IFNDEF; + RETURN_TOKEN_NEVER_SKIP (IFNDEF); } -{HASH}if/[^_a-zA-Z0-9] { - yyextra->lexing_if = 1; +if/[^_a-zA-Z0-9] { + BEGIN INITIAL; + yyextra->lexing_directive = 1; yyextra->space_tokens = 0; - return HASH_IF; + RETURN_TOKEN_NEVER_SKIP (IF); } -{HASH}elif/[^_a-zA-Z0-9] { - yyextra->lexing_if = 1; +elif/[^_a-zA-Z0-9] { + BEGIN INITIAL; + yyextra->lexing_directive = 1; yyextra->space_tokens = 0; - return HASH_ELIF; + RETURN_TOKEN_NEVER_SKIP (ELIF); } -{HASH}else { +else { + BEGIN INITIAL; yyextra->space_tokens = 0; - return HASH_ELSE; + RETURN_TOKEN_NEVER_SKIP (ELSE); } -{HASH}endif { +endif { + BEGIN INITIAL; yyextra->space_tokens = 0; - return HASH_ENDIF; -} + RETURN_TOKEN_NEVER_SKIP (ENDIF); } -[^\n] { - if (parser->commented_newlines) - BEGIN NEWLINE_CATCHUP; +error[^\r\n]* { + BEGIN INITIAL; + RETURN_STRING_TOKEN (ERROR_TOKEN); } -{HASH}error.* { - char *p; - for (p = yytext; !isalpha(p[0]); p++); /* skip " # " */ - p += 5; /* skip "error" */ - glcpp_error(yylloc, yyextra, "#error%s", p); + /* After we see a "#define" we enter the start state + * for the lexer. Within we are looking for the first + * identifier and specifically checking whether the identifier + * is followed by a '(' or not, (to lex either a + * FUNC_IDENTIFIER or an OBJ_IDENITIFIER token). + * + * While in the 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). + * + * * Whitespace (simply ignored) + * + * * Anything else, (not an identifier, not a comment, + * and not whitespace). This will generate an error. + */ +define{HSPACE}* { + if (! parser->skipping) { + BEGIN DEFINE; + yyextra->space_tokens = 0; + RETURN_TOKEN (DEFINE_TOKEN); + } } -{HASH}define{HSPACE}+ { +undef { + BEGIN INITIAL; yyextra->space_tokens = 0; - yy_push_state(DEFINE, yyscanner); - return HASH_DEFINE; + RETURN_TOKEN (UNDEF); } +{HSPACE}+ { + /* Nothing to do here. Importantly, don't leave the + * start condition, since it's legal to have space between the + * '#' and the directive.. */ +} + + /* This will catch any non-directive garbage after a HASH */ +{NONSPACE} { + BEGIN INITIAL; + RETURN_TOKEN (GARBAGE); +} + + /* An identifier immediately followed by '(' */ {IDENTIFIER}/"(" { - yy_pop_state(yyscanner); - yylval->str = ralloc_strdup (yyextra, yytext); - return FUNC_IDENTIFIER; + BEGIN INITIAL; + RETURN_STRING_TOKEN (FUNC_IDENTIFIER); } + /* An identifier not immediately followed by '(' */ {IDENTIFIER} { - yy_pop_state(yyscanner); - yylval->str = ralloc_strdup (yyextra, yytext); - return OBJ_IDENTIFIER; + BEGIN INITIAL; + RETURN_STRING_TOKEN (OBJ_IDENTIFIER); } -{HASH}undef { - yyextra->space_tokens = 0; - return HASH_UNDEF; + /* Whitespace */ +{HSPACE}+ { + /* Just ignore it. Nothing to do here. */ } -{HASH} { - yyextra->space_tokens = 0; - return HASH; + /* '/' not followed by '*', so not a comment. This is an error. */ +[/][^*]{NONSPACE}* { + BEGIN INITIAL; + glcpp_error(yylloc, yyextra, "#define followed by a non-identifier: %s", yytext); + RETURN_STRING_TOKEN (INTEGER_STRING); +} + + /* A character that can't start an identifier, comment, or + * space. This is an error. */ +[^_a-zA-Z/[:space:]]{NONSPACE}* { + BEGIN INITIAL; + glcpp_error(yylloc, yyextra, "#define followed by a non-identifier: %s", yytext); + RETURN_STRING_TOKEN (INTEGER_STRING); } {DECIMAL_INTEGER} { - yylval->str = ralloc_strdup (yyextra, yytext); - return INTEGER_STRING; + RETURN_STRING_TOKEN (INTEGER_STRING); } {OCTAL_INTEGER} { - yylval->str = ralloc_strdup (yyextra, yytext); - return INTEGER_STRING; + RETURN_STRING_TOKEN (INTEGER_STRING); } {HEXADECIMAL_INTEGER} { - yylval->str = ralloc_strdup (yyextra, yytext); - return INTEGER_STRING; + RETURN_STRING_TOKEN (INTEGER_STRING); } "<<" { - return LEFT_SHIFT; + RETURN_TOKEN (LEFT_SHIFT); } ">>" { - return RIGHT_SHIFT; + RETURN_TOKEN (RIGHT_SHIFT); } "<=" { - return LESS_OR_EQUAL; + RETURN_TOKEN (LESS_OR_EQUAL); } ">=" { - return GREATER_OR_EQUAL; + RETURN_TOKEN (GREATER_OR_EQUAL); } "==" { - return EQUAL; + RETURN_TOKEN (EQUAL); } "!=" { - return NOT_EQUAL; + RETURN_TOKEN (NOT_EQUAL); } "&&" { - return AND; + RETURN_TOKEN (AND); } "||" { - return OR; + RETURN_TOKEN (OR); +} + +"++" { + RETURN_TOKEN (PLUS_PLUS); +} + +"--" { + RETURN_TOKEN (MINUS_MINUS); } "##" { - if (parser->is_gles) - glcpp_error(yylloc, yyextra, "Token pasting (##) is illegal in GLES"); - return PASTE; + if (! parser->skipping) { + if (parser->is_gles) + glcpp_error(yylloc, yyextra, "Token pasting (##) is illegal in GLES"); + RETURN_TOKEN (PASTE); + } } "defined" { - return DEFINED; + RETURN_TOKEN (DEFINED); } {IDENTIFIER} { - yylval->str = ralloc_strdup (yyextra, yytext); - return IDENTIFIER; + RETURN_STRING_TOKEN (IDENTIFIER); +} + +{PP_NUMBER} { + RETURN_STRING_TOKEN (OTHER); } {PUNCTUATION} { - return yytext[0]; + RETURN_TOKEN (yytext[0]); } {OTHER}+ { - yylval->str = ralloc_strdup (yyextra, yytext); - return OTHER; + RETURN_STRING_TOKEN (OTHER); } -{HSPACE}+ { +{HSPACE} { if (yyextra->space_tokens) { - return SPACE; + RETURN_TOKEN (SPACE); } } -\n { + /* We preserve all newlines, even between #if 0..#endif, so no + skipping.. */ +<*>{NEWLINE} { if (parser->commented_newlines) { BEGIN NEWLINE_CATCHUP; + } else { + BEGIN INITIAL; } - yyextra->lexing_if = 0; + yyextra->space_tokens = 1; + yyextra->lexing_directive = 0; yylineno++; yycolumn = 0; - return NEWLINE; + RETURN_TOKEN_NEVER_SKIP (NEWLINE); } - /* Handle missing newline at EOF. */ -<> { +<> { + if (YY_START == COMMENT) + glcpp_error(yylloc, yyextra, "Unterminated comment"); BEGIN DONE; /* Don't keep matching this rule forever. */ - yyextra->lexing_if = 0; - return NEWLINE; + yyextra->lexing_directive = 0; + if (! parser->last_token_was_newline) + RETURN_TOKEN (NEWLINE); } + /* This is a catch-all to avoid the annoying default flex action which + * matches any character and prints it. If any input ever matches this + * rule, then we have made a mistake above and need to fix one or more + * of the preceding patterns to match that input. */ + +<*>. { + glcpp_error(yylloc, yyextra, "Internal compiler error: Unexpected character: %s", yytext); + /* We don't actually use the UNREACHABLE start condition. We - only have this action here so that we can pretend to call some + only have this block here so that we can pretend to call some generated functions, (to avoid "defined but not used" warnings. */ -. { - unput('.'); - yy_top_state(yyextra); + if (YY_START == UNREACHABLE) { + unput('.'); + yy_top_state(yyextra); + } } %% diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.c index 31bbcc8da..21f7780b1 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.c +++ b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.c @@ -128,6 +128,9 @@ _string_list_append_item (string_list_t *list, const char *str); static int _string_list_contains (string_list_t *list, const char *member, int *index); +static const char * +_string_list_has_duplicate (string_list_t *list); + static int _string_list_length (string_list_t *list); @@ -176,18 +179,25 @@ _parser_active_list_pop (glcpp_parser_t *parser); static int _parser_active_list_contains (glcpp_parser_t *parser, const char *identifier); +typedef enum { + EXPANSION_MODE_IGNORE_DEFINED, + EXPANSION_MODE_EVALUATE_DEFINED +} expansion_mode_t; + /* Expand list, and begin lexing from the result (after first * prefixing a token of type 'head_token_type'). */ static void _glcpp_parser_expand_and_lex_from (glcpp_parser_t *parser, int head_token_type, - token_list_t *list); + token_list_t *list, + expansion_mode_t mode); /* Perform macro expansion in-place on the given list. */ static void _glcpp_parser_expand_token_list (glcpp_parser_t *parser, - token_list_t *list); + token_list_t *list, + expansion_mode_t mode); static void _glcpp_parser_print_expanded_token_list (glcpp_parser_t *parser, @@ -218,7 +228,7 @@ static void add_builtin_define(glcpp_parser_t *parser, const char *name, int value); -#line 222 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:339 */ +#line 232 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus @@ -242,7 +252,7 @@ add_builtin_define(glcpp_parser_t *parser, const char *name, int value); # define YY_GLCPP_PARSER_SRC_GLSL_GLCPP_GLCPP_PARSE_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG -# define YYDEBUG 0 +# define YYDEBUG 1 #endif #if YYDEBUG extern int glcpp_parser_debug; @@ -253,41 +263,45 @@ extern int glcpp_parser_debug; # define YYTOKENTYPE enum yytokentype { - COMMA_FINAL = 258, - DEFINED = 259, - ELIF_EXPANDED = 260, - HASH = 261, - HASH_DEFINE = 262, - FUNC_IDENTIFIER = 263, - OBJ_IDENTIFIER = 264, - HASH_ELIF = 265, - HASH_ELSE = 266, - HASH_ENDIF = 267, - HASH_IF = 268, - HASH_IFDEF = 269, - HASH_IFNDEF = 270, - HASH_LINE = 271, - HASH_UNDEF = 272, - HASH_VERSION = 273, - IDENTIFIER = 274, - IF_EXPANDED = 275, - INTEGER = 276, - INTEGER_STRING = 277, - LINE_EXPANDED = 278, - NEWLINE = 279, - OTHER = 280, - PLACEHOLDER = 281, - SPACE = 282, - PASTE = 283, - OR = 284, - AND = 285, - EQUAL = 286, - NOT_EQUAL = 287, - LESS_OR_EQUAL = 288, - GREATER_OR_EQUAL = 289, - LEFT_SHIFT = 290, - RIGHT_SHIFT = 291, - UNARY = 292 + DEFINED = 258, + ELIF_EXPANDED = 259, + HASH_TOKEN = 260, + DEFINE_TOKEN = 261, + FUNC_IDENTIFIER = 262, + OBJ_IDENTIFIER = 263, + ELIF = 264, + ELSE = 265, + ENDIF = 266, + ERROR_TOKEN = 267, + IF = 268, + IFDEF = 269, + IFNDEF = 270, + LINE = 271, + PRAGMA = 272, + UNDEF = 273, + VERSION_TOKEN = 274, + GARBAGE = 275, + IDENTIFIER = 276, + IF_EXPANDED = 277, + INTEGER = 278, + INTEGER_STRING = 279, + LINE_EXPANDED = 280, + NEWLINE = 281, + OTHER = 282, + PLACEHOLDER = 283, + SPACE = 284, + PLUS_PLUS = 285, + MINUS_MINUS = 286, + PASTE = 287, + OR = 288, + AND = 289, + EQUAL = 290, + NOT_EQUAL = 291, + LESS_OR_EQUAL = 292, + GREATER_OR_EQUAL = 293, + LEFT_SHIFT = 294, + RIGHT_SHIFT = 295, + UNARY = 296 }; #endif @@ -315,7 +329,7 @@ int glcpp_parser_parse (glcpp_parser_t *parser); /* Copy the second part of user declarations. */ -#line 319 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:358 */ +#line 333 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:358 */ #ifdef short # undef short @@ -559,21 +573,21 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 695 +#define YYLAST 652 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 60 +#define YYNTOKENS 64 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 26 +#define YYNNTS 25 /* YYNRULES -- Number of rules. */ -#define YYNRULES 115 +#define YYNRULES 118 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 181 +#define YYNSTATES 185 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 292 +#define YYMAXUTOK 296 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -585,16 +599,16 @@ static const yytype_uint8 yytranslate[] = 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 50, 2, 2, 2, 46, 33, 2, - 48, 49, 44, 42, 52, 43, 57, 45, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 58, - 36, 59, 37, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 54, 2, 2, 2, 50, 37, 2, + 52, 53, 48, 46, 56, 47, 61, 49, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 62, + 40, 63, 41, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 53, 2, 54, 32, 2, 2, 2, 2, 2, + 2, 57, 2, 58, 36, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 55, 31, 56, 51, 2, 2, 2, + 2, 2, 2, 59, 35, 60, 55, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -610,26 +624,26 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 34, 35, 38, 39, - 40, 41, 47 + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 38, 39, 42, 43, 44, 45, 51 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 188, 188, 190, 194, 197, 197, 208, 213, 214, - 218, 221, 224, 232, 245, 248, 251, 257, 257, 260, - 260, 270, 270, 292, 302, 302, 309, 309, 316, 341, - 361, 361, 374, 374, 377, 383, 389, 395, 404, 409, - 410, 415, 418, 421, 424, 427, 430, 433, 436, 439, - 442, 445, 448, 451, 454, 457, 460, 468, 476, 479, - 482, 485, 488, 491, 497, 502, 510, 511, 515, 521, - 522, 525, 527, 534, 538, 542, 547, 551, 558, 563, - 570, 574, 578, 582, 586, 593, 594, 595, 596, 597, - 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, - 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, - 618, 619, 620, 621, 622, 623 + 0, 205, 205, 207, 211, 212, 213, 218, 222, 227, + 232, 240, 253, 256, 259, 265, 268, 269, 269, 284, + 284, 287, 287, 304, 304, 327, 337, 337, 344, 344, + 351, 377, 397, 397, 410, 410, 413, 419, 425, 428, + 434, 437, 440, 446, 455, 460, 464, 471, 482, 493, + 500, 507, 514, 521, 528, 535, 542, 549, 556, 563, + 570, 577, 584, 596, 608, 615, 619, 623, 627, 631, + 637, 642, 650, 651, 655, 656, 659, 661, 667, 672, + 679, 683, 687, 691, 695, 699, 706, 707, 708, 709, + 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, + 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, + 730, 731, 732, 733, 734, 735, 736, 737, 738 }; #endif @@ -638,21 +652,21 @@ static const yytype_uint16 yyrline[] = First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "COMMA_FINAL", "DEFINED", - "ELIF_EXPANDED", "HASH", "HASH_DEFINE", "FUNC_IDENTIFIER", - "OBJ_IDENTIFIER", "HASH_ELIF", "HASH_ELSE", "HASH_ENDIF", "HASH_IF", - "HASH_IFDEF", "HASH_IFNDEF", "HASH_LINE", "HASH_UNDEF", "HASH_VERSION", - "IDENTIFIER", "IF_EXPANDED", "INTEGER", "INTEGER_STRING", - "LINE_EXPANDED", "NEWLINE", "OTHER", "PLACEHOLDER", "SPACE", "PASTE", - "OR", "AND", "'|'", "'^'", "'&'", "EQUAL", "NOT_EQUAL", "'<'", "'>'", - "LESS_OR_EQUAL", "GREATER_OR_EQUAL", "LEFT_SHIFT", "RIGHT_SHIFT", "'+'", - "'-'", "'*'", "'/'", "'%'", "UNARY", "'('", "')'", "'!'", "'~'", "','", - "'['", "']'", "'{'", "'}'", "'.'", "';'", "'='", "$accept", "input", - "line", "$@1", "expanded_line", "define", "control_line", "$@2", "$@3", - "$@4", "$@5", "$@6", "$@7", "$@8", "integer_constant", "expression", - "identifier_list", "text_line", "non_directive", "replacement_list", - "junk", "conditional_token", "conditional_tokens", "pp_tokens", - "preprocessing_token", "operator", YY_NULLPTR + "$end", "error", "$undefined", "DEFINED", "ELIF_EXPANDED", "HASH_TOKEN", + "DEFINE_TOKEN", "FUNC_IDENTIFIER", "OBJ_IDENTIFIER", "ELIF", "ELSE", + "ENDIF", "ERROR_TOKEN", "IF", "IFDEF", "IFNDEF", "LINE", "PRAGMA", + "UNDEF", "VERSION_TOKEN", "GARBAGE", "IDENTIFIER", "IF_EXPANDED", + "INTEGER", "INTEGER_STRING", "LINE_EXPANDED", "NEWLINE", "OTHER", + "PLACEHOLDER", "SPACE", "PLUS_PLUS", "MINUS_MINUS", "PASTE", "OR", "AND", + "'|'", "'^'", "'&'", "EQUAL", "NOT_EQUAL", "'<'", "'>'", "LESS_OR_EQUAL", + "GREATER_OR_EQUAL", "LEFT_SHIFT", "RIGHT_SHIFT", "'+'", "'-'", "'*'", + "'/'", "'%'", "UNARY", "'('", "')'", "'!'", "'~'", "','", "'['", "']'", + "'{'", "'}'", "'.'", "';'", "'='", "$accept", "input", "line", + "expanded_line", "define", "control_line", "$@1", "control_line_success", + "$@2", "$@3", "$@4", "$@5", "$@6", "$@7", "$@8", "control_line_error", + "integer_constant", "expression", "identifier_list", "text_line", + "replacement_list", "junk", "pp_tokens", "preprocessing_token", + "operator", YY_NULLPTR }; #endif @@ -664,16 +678,17 @@ static const yytype_uint16 yytoknum[] = 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 124, 94, 38, 286, 287, 60, 62, 288, 289, - 290, 291, 43, 45, 42, 47, 37, 292, 40, 41, - 33, 126, 44, 91, 93, 123, 125, 46, 59, 61 + 285, 286, 287, 288, 289, 124, 94, 38, 290, 291, + 60, 62, 292, 293, 294, 295, 43, 45, 42, 47, + 37, 296, 40, 41, 33, 126, 44, 91, 93, 123, + 125, 46, 59, 61 }; # endif -#define YYPACT_NINF -166 +#define YYPACT_NINF -142 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-166))) + (!!((Yystate) == (-142))) #define YYTABLE_NINF -1 @@ -684,25 +699,25 @@ static const yytype_uint16 yytoknum[] = STATE-NUM. */ static const yytype_int16 yypact[] = { - -166, 147, -166, 87, -10, -166, 190, -166, -166, -17, - -166, -166, -166, -166, 52, -166, 87, -166, 52, -166, - -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, - -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, - -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, - -166, -166, -166, -166, -166, -166, -166, 360, -166, -166, - -166, -166, -166, 87, 87, 87, 87, 87, -166, 519, - -166, -166, 401, 105, 31, -166, -166, 233, -166, 34, - 44, -166, 319, 67, 86, 483, 88, -8, 542, 48, - -166, -166, -166, -166, 560, -166, -166, -166, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, -166, -35, 483, -166, - -166, 96, -166, -166, -166, -166, 276, 483, 483, 442, - 92, 93, -166, -166, -166, 94, -166, 580, 596, 611, - 625, 638, 649, 649, 19, 19, 19, 19, 38, 38, - 66, 66, -166, -166, -166, 18, 95, 483, 72, -166, - 98, 483, 100, -166, -166, -166, -166, -166, 483, 26, - -166, -166, -166, -166, 101, 483, 107, -166, 108, -166, - -166 + -142, 134, -142, -142, -18, 578, -142, -18, -142, -15, + -142, -142, 26, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, + -142, -142, 182, -142, -142, -142, -142, -142, -18, -18, + -18, -18, -18, -142, 508, 7, 230, -142, -142, 9, + 25, -142, -142, -142, 35, -142, -15, 470, -142, 533, + 81, -142, -142, -142, -142, -142, -142, -23, -142, -142, + -142, -18, -18, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, -18, -18, -18, -18, -18, -18, -142, + 65, -142, 278, 38, 58, -142, -142, 470, 90, 91, + 470, -142, 92, 37, 326, -142, -142, 89, -142, 571, + 587, 602, 83, 102, 0, 0, 33, 33, 33, 33, + 20, 20, 60, 60, -142, -142, -142, 66, 470, -142, + -142, -142, -142, 374, 470, 470, 422, 109, 110, -142, + -142, -142, -14, 131, 470, -142, 136, 470, 172, -142, + -142, -142, -142, 470, 4, -142, -142, -142, 173, 470, + 179, -142, 175, -142, -142 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -710,41 +725,41 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 2, 0, 1, 0, 0, 17, 0, 30, 32, 21, - 24, 26, 5, 19, 0, 80, 0, 81, 0, 66, - 83, 84, 115, 111, 110, 109, 108, 92, 106, 107, - 102, 103, 104, 105, 100, 101, 94, 95, 93, 98, - 99, 87, 88, 97, 96, 113, 85, 86, 89, 90, - 91, 112, 114, 3, 8, 4, 7, 0, 78, 82, - 40, 38, 37, 0, 0, 0, 0, 0, 39, 0, - 36, 9, 0, 0, 0, 29, 76, 0, 75, 0, - 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, - 67, 79, 62, 61, 0, 59, 60, 11, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 68, 0, 69, 18, - 73, 0, 28, 77, 31, 33, 0, 71, 71, 0, - 0, 0, 34, 10, 12, 0, 63, 41, 42, 43, - 44, 45, 47, 46, 51, 50, 49, 48, 53, 52, - 55, 54, 58, 57, 56, 0, 0, 70, 0, 22, - 0, 72, 0, 6, 20, 35, 13, 64, 69, 0, - 14, 74, 25, 27, 0, 69, 0, 15, 0, 65, - 16 + 2, 0, 1, 83, 0, 0, 80, 0, 81, 0, + 72, 84, 85, 117, 118, 116, 112, 111, 110, 109, + 93, 107, 108, 103, 104, 105, 106, 101, 102, 95, + 96, 94, 99, 100, 88, 89, 98, 97, 114, 86, + 87, 90, 91, 92, 113, 115, 3, 7, 4, 15, + 16, 6, 0, 78, 82, 46, 44, 43, 0, 0, + 0, 0, 0, 45, 0, 19, 0, 32, 34, 0, + 23, 26, 28, 17, 0, 21, 0, 0, 38, 0, + 0, 5, 73, 85, 79, 68, 67, 0, 65, 66, + 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, + 0, 31, 0, 0, 0, 40, 25, 0, 0, 0, + 0, 39, 0, 0, 0, 8, 10, 0, 69, 47, + 48, 49, 50, 51, 53, 52, 57, 56, 55, 54, + 59, 58, 61, 60, 64, 63, 62, 0, 74, 20, + 30, 33, 35, 0, 76, 76, 0, 0, 0, 36, + 42, 11, 0, 0, 75, 24, 0, 77, 0, 18, + 22, 37, 70, 74, 0, 12, 27, 29, 0, 74, + 0, 13, 0, 71, 14 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, - -166, -166, -166, -166, -12, -11, -166, -166, -166, -165, - 3, -69, 51, 0, -6, -166 + -142, -142, -142, -142, -142, 47, -142, -142, -142, -142, + -142, -142, -142, -142, -142, -142, -5, -6, -142, -142, + -141, 49, -1, -50, -142 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 1, 53, 85, 54, 119, 55, 73, 86, 82, - 83, 84, 79, 80, 68, 69, 169, 56, 71, 156, - 160, 76, 77, 157, 58, 59 + -1, 1, 46, 47, 149, 48, 120, 49, 110, 122, + 117, 118, 119, 113, 114, 50, 63, 64, 174, 51, + 163, 166, 164, 53, 54 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -752,209 +767,201 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_uint8 yytable[] = { - 78, 57, 87, 174, 72, 88, 89, 81, 123, 15, - 178, 131, 17, 155, 70, 20, 132, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 167, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 120, 91, 92, 93, 94, 95, 96, 123, 124, 109, - 110, 111, 112, 113, 114, 115, 91, 168, 125, 61, - 62, 78, 134, 61, 62, 175, 78, 135, 176, 121, - 111, 112, 113, 114, 115, 129, 127, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 128, 60, 130, 61, 62, - 113, 114, 115, 117, 118, 158, 164, 165, 166, 170, - 78, 171, 172, 91, 173, 177, 179, 161, 161, 63, - 64, 162, 180, 126, 0, 65, 0, 66, 67, 0, - 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, - 0, 91, 3, 4, 5, 91, 0, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 0, 17, - 18, 19, 20, 0, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 74, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 0, 0, 15, - 0, 0, 17, 0, 75, 20, 0, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 74, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 0, 0, 15, 0, 0, 17, 0, 122, 20, 0, + 52, 79, 84, 55, 80, 56, 57, 172, 56, 57, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 58, 59, + 128, 5, 178, 109, 60, 115, 61, 62, 182, 173, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 116, 85, 86, 87, 88, 89, 179, 158, 81, + 180, 121, 84, 159, 151, 112, 104, 105, 106, 107, + 108, 123, 147, 148, 84, 127, 124, 102, 103, 104, + 105, 106, 107, 108, 152, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 84, 56, 57, 84, 126, 106, 107, + 108, 154, 155, 157, 84, 161, 153, 84, 162, 156, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 2, 170, 171, 3, 4, 5, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 167, 167, 6, 7, 175, 8, 9, + 10, 11, 176, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 3, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 177, 181, + 183, 184, 0, 6, 168, 0, 8, 0, 82, 11, + 0, 83, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 74, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 0, 0, 15, 0, 0, 17, 0, - 159, 20, 0, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 74, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 0, 0, 15, 0, - 0, 17, 0, 0, 20, 0, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 0, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 15, - 0, 0, 17, 0, 90, 20, 0, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 15, 0, 0, 17, 0, 116, 20, 0, 21, 22, + 31, 32, 33, 3, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 0, 0, 0, 0, + 0, 6, 0, 0, 8, 0, 111, 11, 0, 83, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 0, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 15, 0, 0, 17, 0, 163, 20, 0, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 0, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 15, 0, 0, 17, 0, 0, 20, 0, + 33, 3, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 0, 0, 0, 0, 0, 6, + 0, 0, 8, 0, 150, 11, 0, 83, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 3, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 0, 0, 0, 0, 0, 6, 0, 0, + 8, 0, 160, 11, 0, 83, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 3, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 0, 0, 0, 0, 0, 6, 0, 0, 8, 0, + 165, 11, 0, 83, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 3, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 0, 0, + 0, 0, 0, 6, 0, 0, 8, 0, 169, 11, + 0, 83, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 0, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 97, 0, 0, 0, 0, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 133, 0, 0, 0, - 0, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 0, 0, 136, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115 + 31, 32, 33, 3, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 0, 0, 0, 0, + 0, 6, 0, 0, 8, 0, 0, 11, 0, 83, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 0, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 90, 0, 0, 0, 0, 0, + 0, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 125, + 0, 0, 0, 0, 0, 0, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 65, 0, 0, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 0, + 0, 0, 0, 0, 78, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108 }; static const yytype_int16 yycheck[] = { - 6, 1, 14, 168, 4, 16, 18, 24, 77, 19, - 175, 19, 22, 48, 24, 25, 24, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 19, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 19, 57, 63, 64, 65, 66, 67, 126, 24, 40, - 41, 42, 43, 44, 45, 46, 72, 49, 24, 21, - 22, 77, 24, 21, 22, 49, 82, 89, 52, 48, - 42, 43, 44, 45, 46, 85, 19, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 19, 19, 19, 21, 22, - 44, 45, 46, 8, 9, 19, 24, 24, 24, 24, - 126, 49, 24, 129, 24, 24, 19, 127, 128, 42, - 43, 128, 24, 82, -1, 48, -1, 50, 51, -1, - -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, - -1, 157, 5, 6, 7, 161, -1, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, -1, 22, - 23, 24, 25, -1, 27, 28, 29, 30, 31, 32, + 1, 7, 52, 21, 9, 23, 24, 21, 23, 24, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 4, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, -1, -1, 19, - -1, -1, 22, -1, 24, 25, -1, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 4, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - -1, -1, 19, -1, -1, 22, -1, 24, 25, -1, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 43, 44, 45, 46, 47, 48, 49, 50, 46, 47, + 53, 5, 173, 26, 52, 26, 54, 55, 179, 53, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 26, 58, 59, 60, 61, 62, 53, 21, 12, + 56, 26, 112, 26, 26, 66, 46, 47, 48, 49, + 50, 76, 7, 8, 124, 80, 77, 44, 45, 46, + 47, 48, 49, 50, 26, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 153, 23, 24, 156, 26, 48, 49, + 50, 21, 21, 21, 164, 26, 117, 167, 52, 120, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 4, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, -1, -1, 19, -1, -1, 22, -1, - 24, 25, -1, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 4, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, -1, -1, 19, -1, - -1, 22, -1, -1, 25, -1, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 19, - -1, -1, 22, -1, 24, 25, -1, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 19, -1, -1, 22, -1, 24, 25, -1, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 19, -1, -1, 22, -1, 24, 25, -1, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 19, -1, -1, 22, -1, -1, 25, -1, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 24, -1, -1, -1, -1, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 24, -1, -1, -1, + 47, 48, 49, 50, 0, 26, 26, 3, 4, 5, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 154, 155, 21, 22, 26, 24, 25, + 26, 27, 26, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 3, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 26, 26, + 21, 26, -1, 21, 155, -1, 24, -1, 26, 27, -1, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 29, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 3, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, -1, -1, -1, -1, + -1, 21, -1, -1, 24, -1, 26, 27, -1, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, -1, -1, 49, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 31, 32, 33, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 3, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, -1, -1, -1, -1, -1, 21, + -1, -1, 24, -1, 26, 27, -1, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 3, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, -1, -1, -1, -1, -1, 21, -1, -1, + 24, -1, 26, 27, -1, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46 + 44, 45, 46, 47, 48, 49, 50, 3, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + -1, -1, -1, -1, -1, 21, -1, -1, 24, -1, + 26, 27, -1, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 3, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, -1, -1, + -1, -1, -1, 21, -1, -1, 24, -1, 26, 27, + -1, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 3, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, -1, -1, -1, -1, + -1, 21, -1, -1, 24, -1, -1, 27, -1, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, -1, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 26, -1, -1, -1, -1, -1, + -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 26, + -1, -1, -1, -1, -1, -1, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 6, -1, -1, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, -1, + -1, -1, -1, -1, 26, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 61, 0, 5, 6, 7, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 22, 23, 24, - 25, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 62, 64, 66, 77, 83, 84, 85, - 19, 21, 22, 42, 43, 48, 50, 51, 74, 75, - 24, 78, 83, 67, 4, 24, 81, 82, 84, 72, - 73, 24, 69, 70, 71, 63, 68, 74, 75, 74, - 24, 84, 75, 75, 75, 75, 75, 24, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 24, 8, 9, 65, - 19, 48, 24, 81, 24, 24, 82, 19, 19, 83, - 19, 19, 24, 24, 24, 74, 49, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 48, 79, 83, 19, 24, - 80, 83, 80, 24, 24, 24, 24, 19, 49, 76, - 24, 49, 24, 24, 79, 49, 52, 24, 79, 19, - 24 + 0, 65, 0, 3, 4, 5, 21, 22, 24, 25, + 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 66, 67, 69, 71, + 79, 83, 86, 87, 88, 21, 23, 24, 46, 47, + 52, 54, 55, 80, 81, 6, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 26, 81, + 80, 69, 26, 29, 87, 81, 81, 81, 81, 81, + 26, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 26, + 72, 26, 86, 77, 78, 26, 26, 74, 75, 76, + 70, 26, 73, 80, 86, 26, 26, 80, 53, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 7, 8, 68, + 26, 26, 26, 86, 21, 21, 86, 21, 21, 26, + 26, 26, 52, 84, 86, 26, 85, 86, 85, 26, + 26, 26, 21, 53, 82, 26, 26, 26, 84, 53, + 56, 26, 84, 21, 26 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 60, 61, 61, 62, 63, 62, 62, 62, 62, - 64, 64, 64, 64, 65, 65, 65, 67, 66, 68, - 66, 69, 66, 66, 70, 66, 71, 66, 66, 66, - 72, 66, 73, 66, 66, 66, 66, 74, 74, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 76, 76, 77, 77, 78, 79, - 79, 80, 80, 81, 81, 81, 82, 82, 83, 83, - 84, 84, 84, 84, 84, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85 + 0, 64, 65, 65, 66, 66, 66, 66, 67, 67, + 67, 67, 68, 68, 68, 69, 69, 70, 69, 72, + 71, 73, 71, 74, 71, 71, 75, 71, 76, 71, + 71, 71, 77, 71, 78, 71, 71, 71, 71, 71, + 79, 79, 79, 80, 80, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, + 87, 87, 87, 87, 87, 87, 88, 88, 88, 88, + 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, + 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, + 88, 88, 88, 88, 88, 88, 88, 88, 88 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { - 0, 2, 0, 2, 1, 0, 4, 1, 1, 2, - 3, 3, 3, 4, 3, 5, 6, 0, 3, 0, - 4, 0, 4, 2, 0, 5, 0, 5, 3, 2, - 0, 3, 0, 3, 3, 4, 2, 1, 1, 1, - 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, - 2, 2, 2, 3, 1, 3, 1, 2, 2, 0, - 1, 0, 1, 2, 4, 1, 1, 2, 1, 2, + 0, 2, 0, 2, 1, 2, 1, 1, 3, 3, + 3, 4, 3, 5, 6, 1, 1, 0, 5, 0, + 4, 0, 5, 0, 5, 3, 0, 6, 0, 6, + 4, 3, 0, 4, 0, 4, 4, 5, 2, 3, + 3, 3, 4, 1, 1, 1, 1, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 2, 2, 2, 2, 3, + 1, 3, 1, 2, 0, 1, 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1 + 1, 1, 1, 1, 1, 1, 1, 1, 1 }; @@ -1548,7 +1555,7 @@ YYLTYPE yylloc = yyloc_default; yychar = YYEMPTY; /* Cause a token to be read. */ /* User initialization code. */ -#line 155 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1429 */ +#line 165 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1429 */ { yylloc.first_line = 1; yylloc.first_column = 1; @@ -1557,7 +1564,7 @@ YYLTYPE yylloc = yyloc_default; yylloc.source = 0; } -#line 1561 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1429 */ +#line 1568 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1429 */ yylsp[0] = yylloc; goto yysetstate; @@ -1743,64 +1750,38 @@ yyreduce: YY_REDUCE_PRINT (yyn); switch (yyn) { - case 4: -#line 194 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "\n"); - } -#line 1752 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 5: -#line 197 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - glcpp_parser_resolve_implicit_version(parser); - } -#line 1760 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 6: -#line 199 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - - if (parser->skip_stack == NULL || - parser->skip_stack->type == SKIP_NO_SKIP) - { - _glcpp_parser_expand_and_lex_from (parser, - LINE_EXPANDED, (yyvsp[-1].token_list)); - } - } -#line 1774 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 7: -#line 208 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + case 6: +#line 213 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { _glcpp_parser_print_expanded_token_list (parser, (yyvsp[0].token_list)); ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "\n"); ralloc_free ((yyvsp[0].token_list)); } -#line 1784 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 1761 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 8: +#line 222 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + if (parser->is_gles && (yyvsp[-1].expression_value).undefined_macro) + glcpp_error(& (yylsp[-2]), parser, "undefined macro %s in expression (illegal in GLES)", (yyvsp[-1].expression_value).undefined_macro); + _glcpp_parser_skip_stack_push_if (parser, & (yylsp[-2]), (yyvsp[-1].expression_value).value); + } +#line 1771 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 9: +#line 227 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + if (parser->is_gles && (yyvsp[-1].expression_value).undefined_macro) + glcpp_error(& (yylsp[-2]), parser, "undefined macro %s in expression (illegal in GLES)", (yyvsp[-1].expression_value).undefined_macro); + _glcpp_parser_skip_stack_change_if (parser, & (yylsp[-2]), "elif", (yyvsp[-1].expression_value).value); + } +#line 1781 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 10: -#line 218 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - _glcpp_parser_skip_stack_push_if (parser, & (yylsp[-2]), (yyvsp[-1].ival)); - } -#line 1792 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 11: -#line 221 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - _glcpp_parser_skip_stack_change_if (parser, & (yylsp[-2]), "elif", (yyvsp[-1].ival)); - } -#line 1800 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 12: -#line 224 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 232 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { parser->has_new_line_number = 1; parser->new_line_number = (yyvsp[-1].ival); @@ -1809,11 +1790,11 @@ yyreduce: "#line %" PRIiMAX "\n", (yyvsp[-1].ival)); } -#line 1813 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 1794 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; - case 13: -#line 232 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + case 11: +#line 240 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { parser->has_new_line_number = 1; parser->new_line_number = (yyvsp[-2].ival); @@ -1824,72 +1805,110 @@ yyreduce: "#line %" PRIiMAX " %" PRIiMAX "\n", (yyvsp[-2].ival), (yyvsp[-1].ival)); } -#line 1828 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 1809 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; - case 14: -#line 245 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + case 12: +#line 253 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { _define_object_macro (parser, & (yylsp[-2]), (yyvsp[-2].str), (yyvsp[-1].token_list)); } -#line 1836 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 1817 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; - case 15: -#line 248 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + case 13: +#line 256 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { _define_function_macro (parser, & (yylsp[-4]), (yyvsp[-4].str), NULL, (yyvsp[-1].token_list)); } -#line 1844 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 1825 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; - case 16: -#line 251 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + case 14: +#line 259 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { _define_function_macro (parser, & (yylsp[-5]), (yyvsp[-5].str), (yyvsp[-3].string_list), (yyvsp[-1].token_list)); } -#line 1852 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 1833 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 15: +#line 265 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "\n"); + } +#line 1841 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 17: -#line 257 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 269 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { glcpp_parser_resolve_implicit_version(parser); } -#line 1860 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 1849 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 18: +#line 271 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + + if (parser->skip_stack == NULL || + parser->skip_stack->type == SKIP_NO_SKIP) + { + _glcpp_parser_expand_and_lex_from (parser, + LINE_EXPANDED, (yyvsp[-1].token_list), + EXPANSION_MODE_IGNORE_DEFINED); + } + } +#line 1864 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 19: -#line 260 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 284 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { glcpp_parser_resolve_implicit_version(parser); } -#line 1868 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 1872 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; - case 20: -#line 262 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + case 21: +#line 287 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { - macro_t *macro = hash_table_find (parser->defines, (yyvsp[-1].str)); + glcpp_parser_resolve_implicit_version(parser); + } +#line 1880 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 22: +#line 289 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + macro_t *macro; + if (strcmp("__LINE__", (yyvsp[-1].str)) == 0 + || strcmp("__FILE__", (yyvsp[-1].str)) == 0 + || strcmp("__VERSION__", (yyvsp[-1].str)) == 0) + glcpp_error(& (yylsp[-4]), parser, "Built-in (pre-defined)" + " macro names can not be undefined."); + + macro = hash_table_find (parser->defines, (yyvsp[-1].str)); if (macro) { hash_table_remove (parser->defines, (yyvsp[-1].str)); ralloc_free (macro); } ralloc_free ((yyvsp[-1].str)); } -#line 1881 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 1900 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; - case 21: -#line 270 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + case 23: +#line 304 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { glcpp_parser_resolve_implicit_version(parser); } -#line 1889 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 1908 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; - case 22: -#line 272 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + case 24: +#line 306 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { /* Be careful to only evaluate the 'if' expression if * we are not skipping. When we are skipping, we @@ -1902,70 +1921,71 @@ yyreduce: parser->skip_stack->type == SKIP_NO_SKIP) { _glcpp_parser_expand_and_lex_from (parser, - IF_EXPANDED, (yyvsp[-1].token_list)); + IF_EXPANDED, (yyvsp[-1].token_list), + EXPANSION_MODE_EVALUATE_DEFINED); } else { - _glcpp_parser_skip_stack_push_if (parser, & (yylsp[-3]), 0); + _glcpp_parser_skip_stack_push_if (parser, & (yylsp[-4]), 0); parser->skip_stack->type = SKIP_TO_ENDIF; } } -#line 1914 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 1934 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; - case 23: -#line 292 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + case 25: +#line 327 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { /* #if without an expression is only an error if we * are not skipping */ if (parser->skip_stack == NULL || parser->skip_stack->type == SKIP_NO_SKIP) { - glcpp_error(& (yylsp[-1]), parser, "#if with no expression"); + glcpp_error(& (yylsp[-2]), parser, "#if with no expression"); } - _glcpp_parser_skip_stack_push_if (parser, & (yylsp[-1]), 0); + _glcpp_parser_skip_stack_push_if (parser, & (yylsp[-2]), 0); } -#line 1929 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 24: -#line 302 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - glcpp_parser_resolve_implicit_version(parser); - } -#line 1937 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 25: -#line 304 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - macro_t *macro = hash_table_find (parser->defines, (yyvsp[-2].str)); - ralloc_free ((yyvsp[-2].str)); - _glcpp_parser_skip_stack_push_if (parser, & (yylsp[-4]), macro != NULL); - } -#line 1947 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 1949 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 26: -#line 309 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 337 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { glcpp_parser_resolve_implicit_version(parser); } -#line 1955 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 1957 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 27: -#line 311 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 339 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + macro_t *macro = hash_table_find (parser->defines, (yyvsp[-2].str)); + ralloc_free ((yyvsp[-2].str)); + _glcpp_parser_skip_stack_push_if (parser, & (yylsp[-5]), macro != NULL); + } +#line 1967 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 28: +#line 344 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + glcpp_parser_resolve_implicit_version(parser); + } +#line 1975 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 29: +#line 346 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { macro_t *macro = hash_table_find (parser->defines, (yyvsp[-2].str)); ralloc_free ((yyvsp[-2].str)); _glcpp_parser_skip_stack_push_if (parser, & (yylsp[-3]), macro == NULL); } -#line 1965 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 1985 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; - case 28: -#line 316 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + case 30: +#line 351 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { /* Be careful to only evaluate the 'elif' expression * if we are not skipping. When we are skipping, we @@ -1978,7 +1998,32 @@ yyreduce: parser->skip_stack->type == SKIP_TO_ELSE) { _glcpp_parser_expand_and_lex_from (parser, - ELIF_EXPANDED, (yyvsp[-1].token_list)); + ELIF_EXPANDED, (yyvsp[-1].token_list), + EXPANSION_MODE_EVALUATE_DEFINED); + } + else if (parser->skip_stack && + parser->skip_stack->has_else) + { + glcpp_error(& (yylsp[-3]), parser, "#elif after #else"); + } + else + { + _glcpp_parser_skip_stack_change_if (parser, & (yylsp[-3]), + "elif", 0); + } + } +#line 2016 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 31: +#line 377 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + /* #elif without an expression is an error unless we + * are skipping. */ + if (parser->skip_stack && + parser->skip_stack->type == SKIP_TO_ELSE) + { + glcpp_error(& (yylsp[-2]), parser, "#elif with no expression"); } else if (parser->skip_stack && parser->skip_stack->has_else) @@ -1989,94 +2034,108 @@ yyreduce: { _glcpp_parser_skip_stack_change_if (parser, & (yylsp[-2]), "elif", 0); + glcpp_warning(& (yylsp[-2]), parser, "ignoring illegal #elif without expression"); } } -#line 1995 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2041 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; - case 29: -#line 341 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - /* #elif without an expression is an error unless we - * are skipping. */ - if (parser->skip_stack && - parser->skip_stack->type == SKIP_TO_ELSE) - { - glcpp_error(& (yylsp[-1]), parser, "#elif with no expression"); - } - else if (parser->skip_stack && - parser->skip_stack->has_else) - { - glcpp_error(& (yylsp[-1]), parser, "#elif after #else"); - } - else - { - _glcpp_parser_skip_stack_change_if (parser, & (yylsp[-1]), - "elif", 0); - glcpp_warning(& (yylsp[-1]), parser, "ignoring illegal #elif without expression"); - } - } -#line 2020 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + case 32: +#line 397 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { parser->lexing_directive = 1; } +#line 2047 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; - case 30: -#line 361 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + case 33: +#line 397 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { if (parser->skip_stack && parser->skip_stack->has_else) { - glcpp_error(& (yylsp[0]), parser, "multiple #else"); + glcpp_error(& (yylsp[-3]), parser, "multiple #else"); } else { - _glcpp_parser_skip_stack_change_if (parser, & (yylsp[0]), "else", 1); + _glcpp_parser_skip_stack_change_if (parser, & (yylsp[-3]), "else", 1); if (parser->skip_stack) parser->skip_stack->has_else = true; } } -#line 2038 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 32: -#line 374 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - _glcpp_parser_skip_stack_pop (parser, & (yylsp[0])); - } -#line 2046 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2065 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 34: -#line 377 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 410 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { - if (parser->version_resolved) { - glcpp_error(& (yylsp[-2]), parser, "#version must appear on the first line"); - } - _glcpp_parser_handle_version_declaration(parser, (yyvsp[-1].ival), NULL, true); + _glcpp_parser_skip_stack_pop (parser, & (yylsp[-1])); } -#line 2057 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2073 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; - case 35: -#line 383 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + case 36: +#line 413 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { if (parser->version_resolved) { glcpp_error(& (yylsp[-3]), parser, "#version must appear on the first line"); } - _glcpp_parser_handle_version_declaration(parser, (yyvsp[-2].ival), (yyvsp[-1].str), true); + _glcpp_parser_handle_version_declaration(parser, (yyvsp[-1].ival), NULL, true); } -#line 2068 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 36: -#line 389 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - glcpp_parser_resolve_implicit_version(parser); - } -#line 2076 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2084 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 37: -#line 395 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 419 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + if (parser->version_resolved) { + glcpp_error(& (yylsp[-4]), parser, "#version must appear on the first line"); + } + _glcpp_parser_handle_version_declaration(parser, (yyvsp[-2].ival), (yyvsp[-1].str), true); + } +#line 2095 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 38: +#line 425 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + glcpp_parser_resolve_implicit_version(parser); + } +#line 2103 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 39: +#line 428 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "#%s", (yyvsp[-1].str)); + } +#line 2111 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 40: +#line 434 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + glcpp_error(& (yylsp[-2]), parser, "#%s", (yyvsp[-1].str)); + } +#line 2119 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 41: +#line 437 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + glcpp_error (& (yylsp[-2]), parser, "#define without macro name"); + } +#line 2127 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 42: +#line 440 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + glcpp_error (& (yylsp[-3]), parser, "Illegal non-directive after #"); + } +#line 2135 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 43: +#line 446 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { if (strlen ((yyvsp[0].str)) >= 3 && strncmp ((yyvsp[0].str), "0x", 2) == 0) { (yyval.ival) = (int)strtoll ((yyvsp[0].str) + 2, NULL, 16); @@ -2086,557 +2145,629 @@ yyreduce: (yyval.ival) = (int)strtoll ((yyvsp[0].str), NULL, 10); } } -#line 2090 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 38: -#line 404 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - (yyval.ival) = (yyvsp[0].ival); - } -#line 2098 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 40: -#line 410 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - if (parser->is_gles) - glcpp_error(& (yylsp[0]), parser, "undefined macro %s in expression (illegal in GLES)", (yyvsp[0].str)); - (yyval.ival) = 0; - } -#line 2108 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 41: -#line 415 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - (yyval.ival) = (yyvsp[-2].ival) || (yyvsp[0].ival); - } -#line 2116 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 42: -#line 418 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - (yyval.ival) = (yyvsp[-2].ival) && (yyvsp[0].ival); - } -#line 2124 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 43: -#line 421 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - (yyval.ival) = (yyvsp[-2].ival) | (yyvsp[0].ival); - } -#line 2132 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2149 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 44: -#line 424 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 455 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { - (yyval.ival) = (yyvsp[-2].ival) ^ (yyvsp[0].ival); + (yyval.ival) = (yyvsp[0].ival); } -#line 2140 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2157 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 45: -#line 427 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 460 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { - (yyval.ival) = (yyvsp[-2].ival) & (yyvsp[0].ival); + (yyval.expression_value).value = (yyvsp[0].ival); + (yyval.expression_value).undefined_macro = NULL; } -#line 2148 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2166 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 46: -#line 430 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 464 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { - (yyval.ival) = (yyvsp[-2].ival) != (yyvsp[0].ival); + (yyval.expression_value).value = 0; + if (parser->is_gles) + (yyval.expression_value).undefined_macro = ralloc_strdup (parser, (yyvsp[0].str)); + else + (yyval.expression_value).undefined_macro = NULL; } -#line 2156 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2178 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 47: -#line 433 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 471 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { - (yyval.ival) = (yyvsp[-2].ival) == (yyvsp[0].ival); + (yyval.expression_value).value = (yyvsp[-2].expression_value).value || (yyvsp[0].expression_value).value; + + /* Short-circuit: Only flag undefined from right side + * if left side evaluates to false. + */ + if ((yyvsp[-2].expression_value).undefined_macro) + (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro; + else if (! (yyvsp[-2].expression_value).value) + (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro; } -#line 2164 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2194 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 48: -#line 436 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 482 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { - (yyval.ival) = (yyvsp[-2].ival) >= (yyvsp[0].ival); + (yyval.expression_value).value = (yyvsp[-2].expression_value).value && (yyvsp[0].expression_value).value; + + /* Short-circuit: Only flag undefined from right-side + * if left side evaluates to true. + */ + if ((yyvsp[-2].expression_value).undefined_macro) + (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro; + else if ((yyvsp[-2].expression_value).value) + (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro; } -#line 2172 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2210 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 49: -#line 439 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 493 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { - (yyval.ival) = (yyvsp[-2].ival) <= (yyvsp[0].ival); + (yyval.expression_value).value = (yyvsp[-2].expression_value).value | (yyvsp[0].expression_value).value; + if ((yyvsp[-2].expression_value).undefined_macro) + (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro; + else + (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro; } -#line 2180 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2222 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 50: -#line 442 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 500 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { - (yyval.ival) = (yyvsp[-2].ival) > (yyvsp[0].ival); + (yyval.expression_value).value = (yyvsp[-2].expression_value).value ^ (yyvsp[0].expression_value).value; + if ((yyvsp[-2].expression_value).undefined_macro) + (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro; + else + (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro; } -#line 2188 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2234 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 51: -#line 445 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 507 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { - (yyval.ival) = (yyvsp[-2].ival) < (yyvsp[0].ival); + (yyval.expression_value).value = (yyvsp[-2].expression_value).value & (yyvsp[0].expression_value).value; + if ((yyvsp[-2].expression_value).undefined_macro) + (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro; + else + (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro; } -#line 2196 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2246 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 52: -#line 448 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 514 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { - (yyval.ival) = (yyvsp[-2].ival) >> (yyvsp[0].ival); + (yyval.expression_value).value = (yyvsp[-2].expression_value).value != (yyvsp[0].expression_value).value; + if ((yyvsp[-2].expression_value).undefined_macro) + (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro; + else + (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro; } -#line 2204 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2258 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 53: -#line 451 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 521 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { - (yyval.ival) = (yyvsp[-2].ival) << (yyvsp[0].ival); - } -#line 2212 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 54: -#line 454 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - (yyval.ival) = (yyvsp[-2].ival) - (yyvsp[0].ival); - } -#line 2220 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 55: -#line 457 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - (yyval.ival) = (yyvsp[-2].ival) + (yyvsp[0].ival); - } -#line 2228 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 56: -#line 460 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - if ((yyvsp[0].ival) == 0) { - yyerror (& (yylsp[-2]), parser, - "zero modulus in preprocessor directive"); - } else { - (yyval.ival) = (yyvsp[-2].ival) % (yyvsp[0].ival); - } - } -#line 2241 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 57: -#line 468 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - if ((yyvsp[0].ival) == 0) { - yyerror (& (yylsp[-2]), parser, - "division by 0 in preprocessor directive"); - } else { - (yyval.ival) = (yyvsp[-2].ival) / (yyvsp[0].ival); - } - } -#line 2254 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 58: -#line 476 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - (yyval.ival) = (yyvsp[-2].ival) * (yyvsp[0].ival); - } -#line 2262 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 59: -#line 479 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - (yyval.ival) = ! (yyvsp[0].ival); + (yyval.expression_value).value = (yyvsp[-2].expression_value).value == (yyvsp[0].expression_value).value; + if ((yyvsp[-2].expression_value).undefined_macro) + (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro; + else + (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro; } #line 2270 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; - case 60: -#line 482 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + case 54: +#line 528 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { - (yyval.ival) = ~ (yyvsp[0].ival); + (yyval.expression_value).value = (yyvsp[-2].expression_value).value >= (yyvsp[0].expression_value).value; + if ((yyvsp[-2].expression_value).undefined_macro) + (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro; + else + (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro; } -#line 2278 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2282 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; - case 61: -#line 485 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + case 55: +#line 535 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { - (yyval.ival) = - (yyvsp[0].ival); - } -#line 2286 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 62: -#line 488 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - (yyval.ival) = + (yyvsp[0].ival); + (yyval.expression_value).value = (yyvsp[-2].expression_value).value <= (yyvsp[0].expression_value).value; + if ((yyvsp[-2].expression_value).undefined_macro) + (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro; + else + (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro; } #line 2294 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; - case 63: -#line 491 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + case 56: +#line 542 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { - (yyval.ival) = (yyvsp[-1].ival); + (yyval.expression_value).value = (yyvsp[-2].expression_value).value > (yyvsp[0].expression_value).value; + if ((yyvsp[-2].expression_value).undefined_macro) + (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro; + else + (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro; } -#line 2302 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2306 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 57: +#line 549 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + (yyval.expression_value).value = (yyvsp[-2].expression_value).value < (yyvsp[0].expression_value).value; + if ((yyvsp[-2].expression_value).undefined_macro) + (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro; + else + (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro; + } +#line 2318 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 58: +#line 556 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + (yyval.expression_value).value = (yyvsp[-2].expression_value).value >> (yyvsp[0].expression_value).value; + if ((yyvsp[-2].expression_value).undefined_macro) + (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro; + else + (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro; + } +#line 2330 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 59: +#line 563 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + (yyval.expression_value).value = (yyvsp[-2].expression_value).value << (yyvsp[0].expression_value).value; + if ((yyvsp[-2].expression_value).undefined_macro) + (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro; + else + (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro; + } +#line 2342 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 60: +#line 570 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + (yyval.expression_value).value = (yyvsp[-2].expression_value).value - (yyvsp[0].expression_value).value; + if ((yyvsp[-2].expression_value).undefined_macro) + (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro; + else + (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro; + } +#line 2354 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 61: +#line 577 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + (yyval.expression_value).value = (yyvsp[-2].expression_value).value + (yyvsp[0].expression_value).value; + if ((yyvsp[-2].expression_value).undefined_macro) + (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro; + else + (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro; + } +#line 2366 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 62: +#line 584 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + if ((yyvsp[0].expression_value).value == 0) { + yyerror (& (yylsp[-2]), parser, + "zero modulus in preprocessor directive"); + } else { + (yyval.expression_value).value = (yyvsp[-2].expression_value).value % (yyvsp[0].expression_value).value; + } + if ((yyvsp[-2].expression_value).undefined_macro) + (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro; + else + (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro; + } +#line 2383 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 63: +#line 596 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + if ((yyvsp[0].expression_value).value == 0) { + yyerror (& (yylsp[-2]), parser, + "division by 0 in preprocessor directive"); + } else { + (yyval.expression_value).value = (yyvsp[-2].expression_value).value / (yyvsp[0].expression_value).value; + } + if ((yyvsp[-2].expression_value).undefined_macro) + (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro; + else + (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro; + } +#line 2400 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 64: -#line 497 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 608 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + (yyval.expression_value).value = (yyvsp[-2].expression_value).value * (yyvsp[0].expression_value).value; + if ((yyvsp[-2].expression_value).undefined_macro) + (yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro; + else + (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro; + } +#line 2412 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 65: +#line 615 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + (yyval.expression_value).value = ! (yyvsp[0].expression_value).value; + (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro; + } +#line 2421 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 66: +#line 619 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + (yyval.expression_value).value = ~ (yyvsp[0].expression_value).value; + (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro; + } +#line 2430 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 67: +#line 623 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + (yyval.expression_value).value = - (yyvsp[0].expression_value).value; + (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro; + } +#line 2439 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 68: +#line 627 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + (yyval.expression_value).value = + (yyvsp[0].expression_value).value; + (yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro; + } +#line 2448 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 69: +#line 631 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + (yyval.expression_value) = (yyvsp[-1].expression_value); + } +#line 2456 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 70: +#line 637 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { (yyval.string_list) = _string_list_create (parser); _string_list_append_item ((yyval.string_list), (yyvsp[0].str)); ralloc_steal ((yyval.string_list), (yyvsp[0].str)); } -#line 2312 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2466 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; - case 65: -#line 502 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + case 71: +#line 642 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { (yyval.string_list) = (yyvsp[-2].string_list); _string_list_append_item ((yyval.string_list), (yyvsp[0].str)); ralloc_steal ((yyval.string_list), (yyvsp[0].str)); } -#line 2322 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 66: -#line 510 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.token_list) = NULL; } -#line 2328 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 68: -#line 515 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - yyerror (& (yylsp[-1]), parser, "Invalid tokens after #"); - } -#line 2336 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 69: -#line 521 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.token_list) = NULL; } -#line 2342 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2476 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 72: -#line 527 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - glcpp_warning(&(yylsp[0]), parser, "extra tokens at end of directive"); - } -#line 2350 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 73: -#line 534 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - int v = hash_table_find (parser->defines, (yyvsp[0].str)) ? 1 : 0; - (yyval.token) = _token_create_ival (parser, INTEGER, v); - } -#line 2359 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 650 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.token_list) = NULL; } +#line 2482 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 74: -#line 538 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - int v = hash_table_find (parser->defines, (yyvsp[-1].str)) ? 1 : 0; - (yyval.token) = _token_create_ival (parser, INTEGER, v); - } -#line 2368 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 76: -#line 547 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { - (yyval.token_list) = _token_list_create (parser); - _token_list_append ((yyval.token_list), (yyvsp[0].token)); - } -#line 2377 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 655 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.token_list) = NULL; } +#line 2488 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 77: -#line 551 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 661 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { - (yyval.token_list) = (yyvsp[-1].token_list); - _token_list_append ((yyval.token_list), (yyvsp[0].token)); + glcpp_error(&(yylsp[0]), parser, "extra tokens at end of directive"); } -#line 2386 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2496 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 78: -#line 558 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 667 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { parser->space_tokens = 1; (yyval.token_list) = _token_list_create (parser); _token_list_append ((yyval.token_list), (yyvsp[0].token)); } -#line 2396 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2506 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 79: -#line 563 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 672 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { (yyval.token_list) = (yyvsp[-1].token_list); _token_list_append ((yyval.token_list), (yyvsp[0].token)); } -#line 2405 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2515 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 80: -#line 570 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 679 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { (yyval.token) = _token_create_str (parser, IDENTIFIER, (yyvsp[0].str)); (yyval.token)->location = yylloc; } -#line 2414 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2524 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 81: -#line 574 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 683 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { (yyval.token) = _token_create_str (parser, INTEGER_STRING, (yyvsp[0].str)); (yyval.token)->location = yylloc; } -#line 2423 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2533 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 82: -#line 578 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 687 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { (yyval.token) = _token_create_ival (parser, (yyvsp[0].ival), (yyvsp[0].ival)); (yyval.token)->location = yylloc; } -#line 2432 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2542 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 83: -#line 582 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 691 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { + (yyval.token) = _token_create_ival (parser, DEFINED, DEFINED); + (yyval.token)->location = yylloc; + } +#line 2551 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 84: +#line 695 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { (yyval.token) = _token_create_str (parser, OTHER, (yyvsp[0].str)); (yyval.token)->location = yylloc; } -#line 2441 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2560 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; - case 84: -#line 586 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + case 85: +#line 699 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { (yyval.token) = _token_create_ival (parser, SPACE, SPACE); (yyval.token)->location = yylloc; } -#line 2450 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ - break; - - case 85: -#line 593 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = '['; } -#line 2456 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2569 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 86: -#line 594 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = ']'; } -#line 2462 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 706 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = '['; } +#line 2575 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 87: -#line 595 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = '('; } -#line 2468 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 707 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = ']'; } +#line 2581 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 88: -#line 596 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = ')'; } -#line 2474 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 708 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = '('; } +#line 2587 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 89: -#line 597 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = '{'; } -#line 2480 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 709 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = ')'; } +#line 2593 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 90: -#line 598 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = '}'; } -#line 2486 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 710 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = '{'; } +#line 2599 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 91: -#line 599 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = '.'; } -#line 2492 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 711 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = '}'; } +#line 2605 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 92: -#line 600 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = '&'; } -#line 2498 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 712 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = '.'; } +#line 2611 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 93: -#line 601 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = '*'; } -#line 2504 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 713 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = '&'; } +#line 2617 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 94: -#line 602 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = '+'; } -#line 2510 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 714 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = '*'; } +#line 2623 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 95: -#line 603 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = '-'; } -#line 2516 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 715 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = '+'; } +#line 2629 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 96: -#line 604 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = '~'; } -#line 2522 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 716 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = '-'; } +#line 2635 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 97: -#line 605 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = '!'; } -#line 2528 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 717 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = '~'; } +#line 2641 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 98: -#line 606 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = '/'; } -#line 2534 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 718 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = '!'; } +#line 2647 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 99: -#line 607 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = '%'; } -#line 2540 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 719 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = '/'; } +#line 2653 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 100: -#line 608 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = LEFT_SHIFT; } -#line 2546 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 720 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = '%'; } +#line 2659 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 101: -#line 609 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = RIGHT_SHIFT; } -#line 2552 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 721 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = LEFT_SHIFT; } +#line 2665 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 102: -#line 610 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = '<'; } -#line 2558 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 722 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = RIGHT_SHIFT; } +#line 2671 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 103: -#line 611 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = '>'; } -#line 2564 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 723 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = '<'; } +#line 2677 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 104: -#line 612 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = LESS_OR_EQUAL; } -#line 2570 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 724 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = '>'; } +#line 2683 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 105: -#line 613 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = GREATER_OR_EQUAL; } -#line 2576 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 725 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = LESS_OR_EQUAL; } +#line 2689 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 106: -#line 614 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = EQUAL; } -#line 2582 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 726 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = GREATER_OR_EQUAL; } +#line 2695 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 107: -#line 615 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = NOT_EQUAL; } -#line 2588 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 727 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = EQUAL; } +#line 2701 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 108: -#line 616 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = '^'; } -#line 2594 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 728 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = NOT_EQUAL; } +#line 2707 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 109: -#line 617 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = '|'; } -#line 2600 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 729 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = '^'; } +#line 2713 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 110: -#line 618 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = AND; } -#line 2606 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 730 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = '|'; } +#line 2719 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 111: -#line 619 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = OR; } -#line 2612 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 731 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = AND; } +#line 2725 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 112: -#line 620 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = ';'; } -#line 2618 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 732 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = OR; } +#line 2731 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 113: -#line 621 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = ','; } -#line 2624 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 733 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = ';'; } +#line 2737 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 114: -#line 622 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ - { (yyval.ival) = '='; } -#line 2630 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 734 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = ','; } +#line 2743 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; case 115: -#line 623 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ +#line 735 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = '='; } +#line 2749 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 116: +#line 736 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ { (yyval.ival) = PASTE; } -#line 2636 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2755 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 117: +#line 737 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = PLUS_PLUS; } +#line 2761 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ + break; + + case 118: +#line 738 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */ + { (yyval.ival) = MINUS_MINUS; } +#line 2767 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ break; -#line 2640 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ +#line 2771 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2871,7 +3002,7 @@ yyreturn: #endif return yyresult; } -#line 626 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1906 */ +#line 741 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1906 */ string_list_t * @@ -2925,6 +3056,25 @@ _string_list_contains (string_list_t *list, const char *member, int *index) return 0; } +/* Return duplicate string in list (if any), NULL otherwise. */ +const char * +_string_list_has_duplicate (string_list_t *list) +{ + string_node_t *node, *dup; + + if (list == NULL) + return NULL; + + for (node = list->head; node; node = node->next) { + for (dup = node->next; dup; dup = dup->next) { + if (strcmp (node->str, dup->str) == 0) + return node->str; + } + } + + return NULL; +} + int _string_list_length (string_list_t *list) { @@ -3182,14 +3332,16 @@ _token_list_equal_ignoring_space (token_list_t *a, token_list_t *b) if (node_a == NULL || node_b == NULL) return 0; - - if (node_a->token->type == SPACE) { - node_a = node_a->next; - continue; - } - - if (node_b->token->type == SPACE) { - node_b = node_b->next; + /* Make sure whitespace appears in the same places in both. + * It need not be exactly the same amount of whitespace, + * though. + */ + if (node_a->token->type == SPACE + && node_b->token->type == SPACE) { + while (node_a->token->type == SPACE) + node_a = node_a->next; + while (node_b->token->type == SPACE) + node_b = node_b->next; continue; } @@ -3269,14 +3421,21 @@ _token_print (char **out, size_t *len, token_t *token) case PASTE: ralloc_asprintf_rewrite_tail (out, len, "##"); break; - case COMMA_FINAL: - ralloc_asprintf_rewrite_tail (out, len, ","); + case PLUS_PLUS: + ralloc_asprintf_rewrite_tail (out, len, "++"); + break; + case MINUS_MINUS: + ralloc_asprintf_rewrite_tail (out, len, "--"); + break; + case DEFINED: + ralloc_asprintf_rewrite_tail (out, len, "defined"); break; case PLACEHOLDER: /* Nothing to print. */ break; default: assert(!"Error: Don't know how to print token."); + break; } } @@ -3452,14 +3611,18 @@ glcpp_parser_create (const struct gl_extensions *extensions, gl_api api) parser->defines = hash_table_ctor (32, hash_table_string_hash, hash_table_string_compare); parser->active = NULL; - parser->lexing_if = 0; + parser->lexing_directive = 0; parser->space_tokens = 1; + parser->last_token_was_newline = 0; + parser->last_token_was_space = 0; + parser->first_non_space_token_this_line = 1; parser->newline_as_space = 0; parser->in_control_line = 0; parser->paren_count = 0; parser->commented_newlines = 0; parser->skip_stack = NULL; + parser->skipping = 0; parser->lex_from_list = NULL; parser->lex_from_node = NULL; @@ -3605,15 +3768,143 @@ _token_list_create_with_one_integer (void *ctx, int ival) return _token_list_create_with_one_ival (ctx, INTEGER, ival); } +/* Evaluate a DEFINED token node (based on subsequent tokens in the list). + * + * Note: This function must only be called when "node" is a DEFINED token, + * (and will abort with an assertion failure otherwise). + * + * If "node" is followed, (ignoring any SPACE tokens), by an IDENTIFIER token + * (optionally preceded and followed by '(' and ')' tokens) then the following + * occurs: + * + * If the identifier is a defined macro, this function returns 1. + * + * If the identifier is not a defined macro, this function returns 0. + * + * In either case, *last will be updated to the last node in the list + * consumed by the evaluation, (either the token of the identifier or the + * token of the closing parenthesis). + * + * In all other cases, (such as "node is the final node of the list", or + * "missing closing parenthesis", etc.), this function generates a + * preprocessor error, returns -1 and *last will not be set. + */ +static int +_glcpp_parser_evaluate_defined (glcpp_parser_t *parser, + token_node_t *node, + token_node_t **last) +{ + token_node_t *argument, *defined = node; + + assert (node->token->type == DEFINED); + + node = node->next; + + /* Ignore whitespace after DEFINED token. */ + while (node && node->token->type == SPACE) + node = node->next; + + if (node == NULL) + goto FAIL; + + if (node->token->type == IDENTIFIER || node->token->type == OTHER) { + argument = node; + } else if (node->token->type == '(') { + node = node->next; + + /* Ignore whitespace after '(' token. */ + while (node && node->token->type == SPACE) + node = node->next; + + if (node == NULL || (node->token->type != IDENTIFIER && + node->token->type != OTHER)) + { + goto FAIL; + } + + argument = node; + + node = node->next; + + /* Ignore whitespace after identifier, before ')' token. */ + while (node && node->token->type == SPACE) + node = node->next; + + if (node == NULL || node->token->type != ')') + goto FAIL; + } else { + goto FAIL; + } + + *last = node; + + return hash_table_find (parser->defines, + argument->token->value.str) ? 1 : 0; + +FAIL: + glcpp_error (&defined->token->location, parser, + "\"defined\" not followed by an identifier"); + return -1; +} + +/* Evaluate all DEFINED nodes in a given list, modifying the list in place. + */ +static void +_glcpp_parser_evaluate_defined_in_list (glcpp_parser_t *parser, + token_list_t *list) +{ + token_node_t *node, *node_prev, *replacement, *last = NULL; + int value; + + if (list == NULL) + return; + + node_prev = NULL; + node = list->head; + + while (node) { + + if (node->token->type != DEFINED) + goto NEXT; + + value = _glcpp_parser_evaluate_defined (parser, node, &last); + if (value == -1) + goto NEXT; + + replacement = ralloc (list, token_node_t); + replacement->token = _token_create_ival (list, INTEGER, value); + + /* Splice replacement node into list, replacing from "node" + * through "last". */ + if (node_prev) + node_prev->next = replacement; + else + list->head = replacement; + replacement->next = last->next; + if (last == list->tail) + list->tail = replacement; + + node = replacement; + + NEXT: + node_prev = node; + node = node->next; + } +} + /* Perform macro expansion on 'list', placing the resulting tokens * into a new list which is initialized with a first token of type * 'head_token_type'. Then begin lexing from the resulting list, * (return to the current lexing source when this list is exhausted). + * + * See the documentation of _glcpp_parser_expand_token_list for a description + * of the "mode" parameter. */ static void _glcpp_parser_expand_and_lex_from (glcpp_parser_t *parser, int head_token_type, - token_list_t *list) + token_list_t *list, + expansion_mode_t mode) { token_list_t *expanded; token_t *token; @@ -3621,7 +3912,7 @@ _glcpp_parser_expand_and_lex_from (glcpp_parser_t *parser, expanded = _token_list_create (parser); token = _token_create_ival (parser, head_token_type, head_token_type); _token_list_append (expanded, token); - _glcpp_parser_expand_token_list (parser, list); + _glcpp_parser_expand_token_list (parser, list, mode); _token_list_append_list (expanded, list); glcpp_parser_lex_from (parser, expanded); } @@ -3684,12 +3975,15 @@ _glcpp_parser_apply_pastes (glcpp_parser_t *parser, token_list_t *list) * *last to the last node in the list that was consumed by the * expansion. Specifically, *last will be set as follows: as the * token of the closing right parenthesis. + * + * See the documentation of _glcpp_parser_expand_token_list for a description + * of the "mode" parameter. */ static token_list_t * _glcpp_parser_expand_function (glcpp_parser_t *parser, token_node_t *node, - token_node_t **last) - + token_node_t **last, + expansion_mode_t mode) { macro_t *macro; const char *identifier; @@ -3758,7 +4052,8 @@ _glcpp_parser_expand_function (glcpp_parser_t *parser, expanded_argument = _token_list_copy (parser, argument); _glcpp_parser_expand_token_list (parser, - expanded_argument); + expanded_argument, + mode); _token_list_append_list (substituted, expanded_argument); } else { @@ -3798,11 +4093,15 @@ _glcpp_parser_expand_function (glcpp_parser_t *parser, * * As the token of the closing right parenthesis in the case of * function-like macro expansion. + * + * See the documentation of _glcpp_parser_expand_token_list for a description + * of the "mode" parameter. */ static token_list_t * _glcpp_parser_expand_node (glcpp_parser_t *parser, token_node_t *node, - token_node_t **last) + token_node_t **last, + expansion_mode_t mode) { token_t *token = node->token; const char *identifier; @@ -3810,14 +4109,6 @@ _glcpp_parser_expand_node (glcpp_parser_t *parser, /* We only expand identifiers */ if (token->type != IDENTIFIER) { - /* We change any COMMA into a COMMA_FINAL to prevent - * it being mistaken for an argument separator - * later. */ - if (token->type == ',') { - token->type = COMMA_FINAL; - token->value.ival = COMMA_FINAL; - } - return NULL; } @@ -3869,7 +4160,7 @@ _glcpp_parser_expand_node (glcpp_parser_t *parser, return replacement; } - return _glcpp_parser_expand_function (parser, node, last); + return _glcpp_parser_expand_function (parser, node, last, mode); } /* Push a new identifier onto the parser's active list. @@ -3928,11 +4219,28 @@ _parser_active_list_contains (glcpp_parser_t *parser, const char *identifier) /* Walk over the token list replacing nodes with their expansion. * Whenever nodes are expanded the walking will walk over the new * nodes, continuing to expand as necessary. The results are placed in - * 'list' itself; + * 'list' itself. + * + * The "mode" argument controls the handling of any DEFINED tokens that + * result from expansion as follows: + * + * EXPANSION_MODE_IGNORE_DEFINED: Any resulting DEFINED tokens will be + * left in the final list, unevaluated. This is the correct mode + * for expanding any list in any context other than a + * preprocessor conditional, (#if or #elif). + * + * EXPANSION_MODE_EVALUATE_DEFINED: Any resulting DEFINED tokens will be + * evaluated to 0 or 1 tokens depending on whether the following + * token is the name of a defined macro. If the DEFINED token is + * not followed by an (optionally parenthesized) identifier, then + * an error will be generated. This the correct mode for + * expanding any list in the context of a preprocessor + * conditional, (#if or #elif). */ static void _glcpp_parser_expand_token_list (glcpp_parser_t *parser, - token_list_t *list) + token_list_t *list, + expansion_mode_t mode) { token_node_t *node_prev; token_node_t *node, *last = NULL; @@ -3947,15 +4255,23 @@ _glcpp_parser_expand_token_list (glcpp_parser_t *parser, node_prev = NULL; node = list->head; + if (mode == EXPANSION_MODE_EVALUATE_DEFINED) + _glcpp_parser_evaluate_defined_in_list (parser, list); + while (node) { while (parser->active && parser->active->marker == node) _parser_active_list_pop (parser); - expansion = _glcpp_parser_expand_node (parser, node, &last); + expansion = _glcpp_parser_expand_node (parser, node, &last, mode); if (expansion) { token_node_t *n; + if (mode == EXPANSION_MODE_EVALUATE_DEFINED) { + _glcpp_parser_evaluate_defined_in_list (parser, + expansion); + } + for (n = node; n != last->next; n = n->next) while (parser->active && parser->active->marker == n) @@ -4008,7 +4324,7 @@ _glcpp_parser_print_expanded_token_list (glcpp_parser_t *parser, if (list == NULL) return; - _glcpp_parser_expand_token_list (parser, list); + _glcpp_parser_expand_token_list (parser, list, EXPANSION_MODE_IGNORE_DEFINED); _token_list_trim_trailing_space (list); @@ -4019,11 +4335,27 @@ static void _check_for_reserved_macro_name (glcpp_parser_t *parser, YYLTYPE *loc, const char *identifier) { - /* According to the GLSL specification, macro names starting with "__" - * or "GL_" are reserved for future use. So, don't allow them. + /* Section 3.3 (Preprocessor) of the GLSL 1.30 spec (and later) and + * the GLSL ES spec (all versions) say: + * + * "All macro names containing two consecutive underscores ( __ ) + * are reserved for future use as predefined macro names. All + * macro names prefixed with "GL_" ("GL" followed by a single + * underscore) are also reserved." + * + * The intention is that names containing __ are reserved for internal + * use by the implementation, and names prefixed with GL_ are reserved + * for use by Khronos. Since every extension adds a name prefixed + * with GL_ (i.e., the name of the extension), that should be an + * error. Names simply containing __ are dangerous to use, but should + * be allowed. + * + * A future version of the GLSL specification will clarify this. */ if (strstr(identifier, "__")) { - glcpp_error (loc, parser, "Macro names containing \"__\" are reserved.\n"); + glcpp_warning(loc, parser, + "Macro names containing \"__\" are reserved " + "for use by the implementation.\n"); } if (strncmp(identifier, "GL_", 3) == 0) { glcpp_error (loc, parser, "Macro names starting with \"GL_\" are reserved.\n"); @@ -4053,6 +4385,10 @@ _define_object_macro (glcpp_parser_t *parser, { macro_t *macro, *previous; + /* We define pre-defined macros before we've started parsing the + * actual file. So if there's no location defined yet, that's what + * were doing and we don't want to generate an error for using the + * reserved names. */ if (loc != NULL) _check_for_reserved_macro_name(parser, loc, identifier); @@ -4085,9 +4421,16 @@ _define_function_macro (glcpp_parser_t *parser, token_list_t *replacements) { macro_t *macro, *previous; + const char *dup; _check_for_reserved_macro_name(parser, loc, identifier); + /* Check for any duplicate parameter names. */ + if ((dup = _string_list_has_duplicate (parameters)) != NULL) { + glcpp_error (loc, parser, "Duplicate macro parameter \"%s\"", + dup); + } + macro = ralloc (parser, macro_t); ralloc_steal (macro, parameters); ralloc_steal (macro, replacements); @@ -4150,11 +4493,11 @@ glcpp_parser_lex (YYSTYPE *yylval, YYLTYPE *yylloc, glcpp_parser_t *parser) if (ret == NEWLINE) parser->in_control_line = 0; } - else if (ret == HASH_DEFINE || - ret == HASH_UNDEF || ret == HASH_IF || - ret == HASH_IFDEF || ret == HASH_IFNDEF || - ret == HASH_ELIF || ret == HASH_ELSE || - ret == HASH_ENDIF || ret == HASH) + else if (ret == DEFINE_TOKEN || + ret == UNDEF || ret == IF || + ret == IFDEF || ret == IFNDEF || + ret == ELIF || ret == ELSE || + ret == ENDIF || ret == HASH_TOKEN) { parser->in_control_line = 1; } @@ -4247,7 +4590,7 @@ _glcpp_parser_skip_stack_change_if (glcpp_parser_t *parser, YYLTYPE *loc, const char *type, int condition) { if (parser->skip_stack == NULL) { - glcpp_error (loc, parser, "%s without #if\n", type); + glcpp_error (loc, parser, "#%s without #if\n", type); return; } @@ -4295,13 +4638,17 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio /* Add pre-defined macros. */ if (parser->is_gles) { add_builtin_define(parser, "GL_ES", 1); + add_builtin_define(parser, "GL_EXT_separate_shader_objects", 1); if (extensions != NULL) { if (extensions->OES_EGL_image_external) add_builtin_define(parser, "GL_OES_EGL_image_external", 1); + if (extensions->OES_standard_derivatives) + add_builtin_define(parser, "GL_OES_standard_derivatives", 1); } } else { add_builtin_define(parser, "GL_ARB_draw_buffers", 1); + add_builtin_define(parser, "GL_ARB_separate_shader_objects", 1); add_builtin_define(parser, "GL_ARB_texture_rectangle", 1); add_builtin_define(parser, "GL_AMD_shader_trinary_minmax", 1); @@ -4317,9 +4664,15 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio add_builtin_define(parser, "GL_ARB_fragment_coord_conventions", 1); + if (extensions->ARB_fragment_layer_viewport) + add_builtin_define(parser, "GL_ARB_fragment_layer_viewport", 1); + if (extensions->ARB_explicit_attrib_location) add_builtin_define(parser, "GL_ARB_explicit_attrib_location", 1); + if (extensions->ARB_explicit_uniform_location) + add_builtin_define(parser, "GL_ARB_explicit_uniform_location", 1); + if (extensions->ARB_shader_texture_lod) add_builtin_define(parser, "GL_ARB_shader_texture_lod", 1); @@ -4358,6 +4711,9 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio if (extensions->AMD_vertex_shader_layer) add_builtin_define(parser, "GL_AMD_vertex_shader_layer", 1); + if (extensions->AMD_vertex_shader_viewport_index) + add_builtin_define(parser, "GL_AMD_vertex_shader_viewport_index", 1); + if (extensions->ARB_shading_language_420pack) add_builtin_define(parser, "GL_ARB_shading_language_420pack", 1); @@ -4378,6 +4734,9 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio if (extensions->ARB_shader_image_load_store) add_builtin_define(parser, "GL_ARB_shader_image_load_store", 1); + + if (extensions->ARB_derivative_control) + add_builtin_define(parser, "GL_ARB_derivative_control", 1); } } diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.h b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.h index 97e48602a..df0025778 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.h +++ b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.h @@ -34,7 +34,7 @@ # define YY_GLCPP_PARSER_SRC_GLSL_GLCPP_GLCPP_PARSE_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG -# define YYDEBUG 0 +# define YYDEBUG 1 #endif #if YYDEBUG extern int glcpp_parser_debug; @@ -45,41 +45,45 @@ extern int glcpp_parser_debug; # define YYTOKENTYPE enum yytokentype { - COMMA_FINAL = 258, - DEFINED = 259, - ELIF_EXPANDED = 260, - HASH = 261, - HASH_DEFINE = 262, - FUNC_IDENTIFIER = 263, - OBJ_IDENTIFIER = 264, - HASH_ELIF = 265, - HASH_ELSE = 266, - HASH_ENDIF = 267, - HASH_IF = 268, - HASH_IFDEF = 269, - HASH_IFNDEF = 270, - HASH_LINE = 271, - HASH_UNDEF = 272, - HASH_VERSION = 273, - IDENTIFIER = 274, - IF_EXPANDED = 275, - INTEGER = 276, - INTEGER_STRING = 277, - LINE_EXPANDED = 278, - NEWLINE = 279, - OTHER = 280, - PLACEHOLDER = 281, - SPACE = 282, - PASTE = 283, - OR = 284, - AND = 285, - EQUAL = 286, - NOT_EQUAL = 287, - LESS_OR_EQUAL = 288, - GREATER_OR_EQUAL = 289, - LEFT_SHIFT = 290, - RIGHT_SHIFT = 291, - UNARY = 292 + DEFINED = 258, + ELIF_EXPANDED = 259, + HASH_TOKEN = 260, + DEFINE_TOKEN = 261, + FUNC_IDENTIFIER = 262, + OBJ_IDENTIFIER = 263, + ELIF = 264, + ELSE = 265, + ENDIF = 266, + ERROR_TOKEN = 267, + IF = 268, + IFDEF = 269, + IFNDEF = 270, + LINE = 271, + PRAGMA = 272, + UNDEF = 273, + VERSION_TOKEN = 274, + GARBAGE = 275, + IDENTIFIER = 276, + IF_EXPANDED = 277, + INTEGER = 278, + INTEGER_STRING = 279, + LINE_EXPANDED = 280, + NEWLINE = 281, + OTHER = 282, + PLACEHOLDER = 283, + SPACE = 284, + PLUS_PLUS = 285, + MINUS_MINUS = 286, + PASTE = 287, + OR = 288, + AND = 289, + EQUAL = 290, + NOT_EQUAL = 291, + LESS_OR_EQUAL = 292, + GREATER_OR_EQUAL = 293, + LEFT_SHIFT = 294, + RIGHT_SHIFT = 295, + UNARY = 296 }; #endif diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.y b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.y index d93a7e2f2..9cc5f4ac5 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.y +++ b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.y @@ -57,6 +57,9 @@ _string_list_append_item (string_list_t *list, const char *str); static int _string_list_contains (string_list_t *list, const char *member, int *index); +static const char * +_string_list_has_duplicate (string_list_t *list); + static int _string_list_length (string_list_t *list); @@ -105,18 +108,25 @@ _parser_active_list_pop (glcpp_parser_t *parser); static int _parser_active_list_contains (glcpp_parser_t *parser, const char *identifier); +typedef enum { + EXPANSION_MODE_IGNORE_DEFINED, + EXPANSION_MODE_EVALUATE_DEFINED +} expansion_mode_t; + /* Expand list, and begin lexing from the result (after first * prefixing a token of type 'head_token_type'). */ static void _glcpp_parser_expand_and_lex_from (glcpp_parser_t *parser, int head_token_type, - token_list_t *list); + token_list_t *list, + expansion_mode_t mode); /* Perform macro expansion in-place on the given list. */ static void _glcpp_parser_expand_token_list (glcpp_parser_t *parser, - token_list_t *list); + token_list_t *list, + expansion_mode_t mode); static void _glcpp_parser_print_expanded_token_list (glcpp_parser_t *parser, @@ -164,13 +174,18 @@ add_builtin_define(glcpp_parser_t *parser, const char *name, int value); %lex-param {glcpp_parser_t *parser} %expect 0 -%token COMMA_FINAL DEFINED ELIF_EXPANDED HASH HASH_DEFINE FUNC_IDENTIFIER OBJ_IDENTIFIER HASH_ELIF HASH_ELSE HASH_ENDIF HASH_IF HASH_IFDEF HASH_IFNDEF HASH_LINE HASH_UNDEF HASH_VERSION IDENTIFIER IF_EXPANDED INTEGER INTEGER_STRING LINE_EXPANDED NEWLINE OTHER PLACEHOLDER SPACE + + /* We use HASH_TOKEN, DEFINE_TOKEN and VERSION_TOKEN (as opposed to + * HASH, DEFINE, and VERSION) to avoid conflicts with other symbols, + * (such as the and start conditions in the lexer). */ +%token DEFINED ELIF_EXPANDED HASH_TOKEN DEFINE_TOKEN FUNC_IDENTIFIER OBJ_IDENTIFIER ELIF ELSE ENDIF ERROR_TOKEN IF IFDEF IFNDEF LINE PRAGMA UNDEF VERSION_TOKEN GARBAGE IDENTIFIER IF_EXPANDED INTEGER INTEGER_STRING LINE_EXPANDED NEWLINE OTHER PLACEHOLDER SPACE PLUS_PLUS MINUS_MINUS %token PASTE -%type expression INTEGER operator SPACE integer_constant -%type IDENTIFIER FUNC_IDENTIFIER OBJ_IDENTIFIER INTEGER_STRING OTHER +%type INTEGER operator SPACE integer_constant +%type expression +%type IDENTIFIER FUNC_IDENTIFIER OBJ_IDENTIFIER INTEGER_STRING OTHER ERROR_TOKEN PRAGMA %type identifier_list -%type preprocessing_token conditional_token -%type pp_tokens replacement_list text_line conditional_tokens +%type preprocessing_token +%type pp_tokens replacement_list text_line %left OR %left AND %left '|' @@ -183,6 +198,8 @@ add_builtin_define(glcpp_parser_t *parser, const char *name, int value); %left '*' '/' '%' %right UNARY +%debug + %% input: @@ -191,35 +208,26 @@ input: ; line: - control_line { - ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "\n"); - } -| HASH_LINE { - glcpp_parser_resolve_implicit_version(parser); - } pp_tokens NEWLINE { - - if (parser->skip_stack == NULL || - parser->skip_stack->type == SKIP_NO_SKIP) - { - _glcpp_parser_expand_and_lex_from (parser, - LINE_EXPANDED, $3); - } - } + control_line +| SPACE control_line | text_line { _glcpp_parser_print_expanded_token_list (parser, $1); ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "\n"); ralloc_free ($1); } | expanded_line -| HASH non_directive ; expanded_line: IF_EXPANDED expression NEWLINE { - _glcpp_parser_skip_stack_push_if (parser, & @1, $2); + if (parser->is_gles && $2.undefined_macro) + glcpp_error(& @1, parser, "undefined macro %s in expression (illegal in GLES)", $2.undefined_macro); + _glcpp_parser_skip_stack_push_if (parser, & @1, $2.value); } | ELIF_EXPANDED expression NEWLINE { - _glcpp_parser_skip_stack_change_if (parser, & @1, "elif", $2); + if (parser->is_gles && $2.undefined_macro) + glcpp_error(& @1, parser, "undefined macro %s in expression (illegal in GLES)", $2.undefined_macro); + _glcpp_parser_skip_stack_change_if (parser, & @1, "elif", $2.value); } | LINE_EXPANDED integer_constant NEWLINE { parser->has_new_line_number = 1; @@ -254,22 +262,48 @@ define: ; control_line: - HASH_DEFINE { + control_line_success { + ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "\n"); + } +| control_line_error +| HASH_TOKEN LINE { + glcpp_parser_resolve_implicit_version(parser); + } pp_tokens NEWLINE { + + if (parser->skip_stack == NULL || + parser->skip_stack->type == SKIP_NO_SKIP) + { + _glcpp_parser_expand_and_lex_from (parser, + LINE_EXPANDED, $4, + EXPANSION_MODE_IGNORE_DEFINED); + } + } +; + +control_line_success: + HASH_TOKEN DEFINE_TOKEN { glcpp_parser_resolve_implicit_version(parser); } define -| HASH_UNDEF { +| HASH_TOKEN UNDEF { glcpp_parser_resolve_implicit_version(parser); } IDENTIFIER NEWLINE { - macro_t *macro = hash_table_find (parser->defines, $3); + macro_t *macro; + if (strcmp("__LINE__", $4) == 0 + || strcmp("__FILE__", $4) == 0 + || strcmp("__VERSION__", $4) == 0) + glcpp_error(& @1, parser, "Built-in (pre-defined)" + " macro names can not be undefined."); + + macro = hash_table_find (parser->defines, $4); if (macro) { - hash_table_remove (parser->defines, $3); + hash_table_remove (parser->defines, $4); ralloc_free (macro); } - ralloc_free ($3); + ralloc_free ($4); } -| HASH_IF { +| HASH_TOKEN IF { glcpp_parser_resolve_implicit_version(parser); - } conditional_tokens NEWLINE { + } pp_tokens NEWLINE { /* Be careful to only evaluate the 'if' expression if * we are not skipping. When we are skipping, we * simply push a new 0-valued 'if' onto the skip @@ -281,7 +315,8 @@ control_line: parser->skip_stack->type == SKIP_NO_SKIP) { _glcpp_parser_expand_and_lex_from (parser, - IF_EXPANDED, $3); + IF_EXPANDED, $4, + EXPANSION_MODE_EVALUATE_DEFINED); } else { @@ -289,7 +324,7 @@ control_line: parser->skip_stack->type = SKIP_TO_ENDIF; } } -| HASH_IF NEWLINE { +| HASH_TOKEN IF NEWLINE { /* #if without an expression is only an error if we * are not skipping */ if (parser->skip_stack == NULL || @@ -299,21 +334,21 @@ control_line: } _glcpp_parser_skip_stack_push_if (parser, & @1, 0); } -| HASH_IFDEF { +| HASH_TOKEN IFDEF { glcpp_parser_resolve_implicit_version(parser); } IDENTIFIER junk NEWLINE { - macro_t *macro = hash_table_find (parser->defines, $3); - ralloc_free ($3); + macro_t *macro = hash_table_find (parser->defines, $4); + ralloc_free ($4); _glcpp_parser_skip_stack_push_if (parser, & @1, macro != NULL); } -| HASH_IFNDEF { +| HASH_TOKEN IFNDEF { glcpp_parser_resolve_implicit_version(parser); } IDENTIFIER junk NEWLINE { - macro_t *macro = hash_table_find (parser->defines, $3); - ralloc_free ($3); - _glcpp_parser_skip_stack_push_if (parser, & @2, macro == NULL); + macro_t *macro = hash_table_find (parser->defines, $4); + ralloc_free ($4); + _glcpp_parser_skip_stack_push_if (parser, & @3, macro == NULL); } -| HASH_ELIF conditional_tokens NEWLINE { +| HASH_TOKEN ELIF pp_tokens NEWLINE { /* Be careful to only evaluate the 'elif' expression * if we are not skipping. When we are skipping, we * simply change to a 0-valued 'elif' on the skip @@ -325,7 +360,8 @@ control_line: parser->skip_stack->type == SKIP_TO_ELSE) { _glcpp_parser_expand_and_lex_from (parser, - ELIF_EXPANDED, $2); + ELIF_EXPANDED, $3, + EXPANSION_MODE_EVALUATE_DEFINED); } else if (parser->skip_stack && parser->skip_stack->has_else) @@ -338,7 +374,7 @@ control_line: "elif", 0); } } -| HASH_ELIF NEWLINE { +| HASH_TOKEN ELIF NEWLINE { /* #elif without an expression is an error unless we * are skipping. */ if (parser->skip_stack && @@ -358,7 +394,7 @@ control_line: glcpp_warning(& @1, parser, "ignoring illegal #elif without expression"); } } -| HASH_ELSE { +| HASH_TOKEN ELSE { parser->lexing_directive = 1; } NEWLINE { if (parser->skip_stack && parser->skip_stack->has_else) { @@ -370,25 +406,40 @@ control_line: if (parser->skip_stack) parser->skip_stack->has_else = true; } - } NEWLINE -| HASH_ENDIF { + } +| HASH_TOKEN ENDIF { _glcpp_parser_skip_stack_pop (parser, & @1); } NEWLINE -| HASH_VERSION integer_constant NEWLINE { +| HASH_TOKEN VERSION_TOKEN integer_constant NEWLINE { if (parser->version_resolved) { glcpp_error(& @1, parser, "#version must appear on the first line"); } - _glcpp_parser_handle_version_declaration(parser, $2, NULL, true); + _glcpp_parser_handle_version_declaration(parser, $3, NULL, true); } -| HASH_VERSION integer_constant IDENTIFIER NEWLINE { +| HASH_TOKEN VERSION_TOKEN integer_constant IDENTIFIER NEWLINE { if (parser->version_resolved) { glcpp_error(& @1, parser, "#version must appear on the first line"); } - _glcpp_parser_handle_version_declaration(parser, $2, $3, true); + _glcpp_parser_handle_version_declaration(parser, $3, $4, true); } -| HASH NEWLINE { +| HASH_TOKEN NEWLINE { glcpp_parser_resolve_implicit_version(parser); } +| HASH_TOKEN PRAGMA NEWLINE { + ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "#%s", $2); + } +; + +control_line_error: + HASH_TOKEN ERROR_TOKEN NEWLINE { + glcpp_error(& @1, parser, "#%s", $2); + } +| HASH_TOKEN DEFINE_TOKEN NEWLINE { + glcpp_error (& @1, parser, "#define without macro name"); + } +| HASH_TOKEN GARBAGE pp_tokens NEWLINE { + glcpp_error (& @1, parser, "Illegal non-directive after #"); + } ; integer_constant: @@ -406,87 +457,176 @@ integer_constant: } expression: - integer_constant + integer_constant { + $$.value = $1; + $$.undefined_macro = NULL; + } | IDENTIFIER { + $$.value = 0; if (parser->is_gles) - glcpp_error(& @1, parser, "undefined macro %s in expression (illegal in GLES)", $1); - $$ = 0; + $$.undefined_macro = ralloc_strdup (parser, $1); + else + $$.undefined_macro = NULL; } | expression OR expression { - $$ = $1 || $3; + $$.value = $1.value || $3.value; + + /* Short-circuit: Only flag undefined from right side + * if left side evaluates to false. + */ + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else if (! $1.value) + $$.undefined_macro = $3.undefined_macro; } | expression AND expression { - $$ = $1 && $3; + $$.value = $1.value && $3.value; + + /* Short-circuit: Only flag undefined from right-side + * if left side evaluates to true. + */ + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else if ($1.value) + $$.undefined_macro = $3.undefined_macro; } | expression '|' expression { - $$ = $1 | $3; + $$.value = $1.value | $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression '^' expression { - $$ = $1 ^ $3; + $$.value = $1.value ^ $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression '&' expression { - $$ = $1 & $3; + $$.value = $1.value & $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression NOT_EQUAL expression { - $$ = $1 != $3; + $$.value = $1.value != $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression EQUAL expression { - $$ = $1 == $3; + $$.value = $1.value == $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression GREATER_OR_EQUAL expression { - $$ = $1 >= $3; + $$.value = $1.value >= $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression LESS_OR_EQUAL expression { - $$ = $1 <= $3; + $$.value = $1.value <= $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression '>' expression { - $$ = $1 > $3; + $$.value = $1.value > $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression '<' expression { - $$ = $1 < $3; + $$.value = $1.value < $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression RIGHT_SHIFT expression { - $$ = $1 >> $3; + $$.value = $1.value >> $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression LEFT_SHIFT expression { - $$ = $1 << $3; + $$.value = $1.value << $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression '-' expression { - $$ = $1 - $3; + $$.value = $1.value - $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression '+' expression { - $$ = $1 + $3; + $$.value = $1.value + $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression '%' expression { - if ($3 == 0) { + if ($3.value == 0) { yyerror (& @1, parser, "zero modulus in preprocessor directive"); } else { - $$ = $1 % $3; + $$.value = $1.value % $3.value; } + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression '/' expression { - if ($3 == 0) { + if ($3.value == 0) { yyerror (& @1, parser, "division by 0 in preprocessor directive"); } else { - $$ = $1 / $3; + $$.value = $1.value / $3.value; } + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | expression '*' expression { - $$ = $1 * $3; + $$.value = $1.value * $3.value; + if ($1.undefined_macro) + $$.undefined_macro = $1.undefined_macro; + else + $$.undefined_macro = $3.undefined_macro; } | '!' expression %prec UNARY { - $$ = ! $2; + $$.value = ! $2.value; + $$.undefined_macro = $2.undefined_macro; } | '~' expression %prec UNARY { - $$ = ~ $2; + $$.value = ~ $2.value; + $$.undefined_macro = $2.undefined_macro; } | '-' expression %prec UNARY { - $$ = - $2; + $$.value = - $2.value; + $$.undefined_macro = $2.undefined_macro; } | '+' expression %prec UNARY { - $$ = + $2; + $$.value = + $2.value; + $$.undefined_macro = $2.undefined_macro; } | '(' expression ')' { $$ = $2; @@ -511,12 +651,6 @@ text_line: | pp_tokens NEWLINE ; -non_directive: - pp_tokens NEWLINE { - yyerror (& @1, parser, "Invalid tokens after #"); - } -; - replacement_list: /* empty */ { $$ = NULL; } | pp_tokens @@ -525,32 +659,7 @@ replacement_list: junk: /* empty */ | pp_tokens { - glcpp_warning(&@1, parser, "extra tokens at end of directive"); - } -; - -conditional_token: - /* Handle "defined" operator */ - DEFINED IDENTIFIER { - int v = hash_table_find (parser->defines, $2) ? 1 : 0; - $$ = _token_create_ival (parser, INTEGER, v); - } -| DEFINED '(' IDENTIFIER ')' { - int v = hash_table_find (parser->defines, $3) ? 1 : 0; - $$ = _token_create_ival (parser, INTEGER, v); - } -| preprocessing_token -; - -conditional_tokens: - /* Exactly the same as pp_tokens, but using conditional_token */ - conditional_token { - $$ = _token_list_create (parser); - _token_list_append ($$, $1); - } -| conditional_tokens conditional_token { - $$ = $1; - _token_list_append ($$, $2); + glcpp_error(&@1, parser, "extra tokens at end of directive"); } ; @@ -579,6 +688,10 @@ preprocessing_token: $$ = _token_create_ival (parser, $1, $1); $$->location = yylloc; } +| DEFINED { + $$ = _token_create_ival (parser, DEFINED, DEFINED); + $$->location = yylloc; + } | OTHER { $$ = _token_create_str (parser, OTHER, $1); $$->location = yylloc; @@ -621,6 +734,8 @@ operator: | ',' { $$ = ','; } | '=' { $$ = '='; } | PASTE { $$ = PASTE; } +| PLUS_PLUS { $$ = PLUS_PLUS; } +| MINUS_MINUS { $$ = MINUS_MINUS; } ; %% @@ -676,6 +791,25 @@ _string_list_contains (string_list_t *list, const char *member, int *index) return 0; } +/* Return duplicate string in list (if any), NULL otherwise. */ +const char * +_string_list_has_duplicate (string_list_t *list) +{ + string_node_t *node, *dup; + + if (list == NULL) + return NULL; + + for (node = list->head; node; node = node->next) { + for (dup = node->next; dup; dup = dup->next) { + if (strcmp (node->str, dup->str) == 0) + return node->str; + } + } + + return NULL; +} + int _string_list_length (string_list_t *list) { @@ -933,14 +1067,16 @@ _token_list_equal_ignoring_space (token_list_t *a, token_list_t *b) if (node_a == NULL || node_b == NULL) return 0; - - if (node_a->token->type == SPACE) { - node_a = node_a->next; - continue; - } - - if (node_b->token->type == SPACE) { - node_b = node_b->next; + /* Make sure whitespace appears in the same places in both. + * It need not be exactly the same amount of whitespace, + * though. + */ + if (node_a->token->type == SPACE + && node_b->token->type == SPACE) { + while (node_a->token->type == SPACE) + node_a = node_a->next; + while (node_b->token->type == SPACE) + node_b = node_b->next; continue; } @@ -1020,14 +1156,21 @@ _token_print (char **out, size_t *len, token_t *token) case PASTE: ralloc_asprintf_rewrite_tail (out, len, "##"); break; - case COMMA_FINAL: - ralloc_asprintf_rewrite_tail (out, len, ","); + case PLUS_PLUS: + ralloc_asprintf_rewrite_tail (out, len, "++"); + break; + case MINUS_MINUS: + ralloc_asprintf_rewrite_tail (out, len, "--"); + break; + case DEFINED: + ralloc_asprintf_rewrite_tail (out, len, "defined"); break; case PLACEHOLDER: /* Nothing to print. */ break; default: assert(!"Error: Don't know how to print token."); + break; } } @@ -1203,14 +1346,18 @@ glcpp_parser_create (const struct gl_extensions *extensions, gl_api api) parser->defines = hash_table_ctor (32, hash_table_string_hash, hash_table_string_compare); parser->active = NULL; - parser->lexing_if = 0; + parser->lexing_directive = 0; parser->space_tokens = 1; + parser->last_token_was_newline = 0; + parser->last_token_was_space = 0; + parser->first_non_space_token_this_line = 1; parser->newline_as_space = 0; parser->in_control_line = 0; parser->paren_count = 0; parser->commented_newlines = 0; parser->skip_stack = NULL; + parser->skipping = 0; parser->lex_from_list = NULL; parser->lex_from_node = NULL; @@ -1356,15 +1503,143 @@ _token_list_create_with_one_integer (void *ctx, int ival) return _token_list_create_with_one_ival (ctx, INTEGER, ival); } +/* Evaluate a DEFINED token node (based on subsequent tokens in the list). + * + * Note: This function must only be called when "node" is a DEFINED token, + * (and will abort with an assertion failure otherwise). + * + * If "node" is followed, (ignoring any SPACE tokens), by an IDENTIFIER token + * (optionally preceded and followed by '(' and ')' tokens) then the following + * occurs: + * + * If the identifier is a defined macro, this function returns 1. + * + * If the identifier is not a defined macro, this function returns 0. + * + * In either case, *last will be updated to the last node in the list + * consumed by the evaluation, (either the token of the identifier or the + * token of the closing parenthesis). + * + * In all other cases, (such as "node is the final node of the list", or + * "missing closing parenthesis", etc.), this function generates a + * preprocessor error, returns -1 and *last will not be set. + */ +static int +_glcpp_parser_evaluate_defined (glcpp_parser_t *parser, + token_node_t *node, + token_node_t **last) +{ + token_node_t *argument, *defined = node; + + assert (node->token->type == DEFINED); + + node = node->next; + + /* Ignore whitespace after DEFINED token. */ + while (node && node->token->type == SPACE) + node = node->next; + + if (node == NULL) + goto FAIL; + + if (node->token->type == IDENTIFIER || node->token->type == OTHER) { + argument = node; + } else if (node->token->type == '(') { + node = node->next; + + /* Ignore whitespace after '(' token. */ + while (node && node->token->type == SPACE) + node = node->next; + + if (node == NULL || (node->token->type != IDENTIFIER && + node->token->type != OTHER)) + { + goto FAIL; + } + + argument = node; + + node = node->next; + + /* Ignore whitespace after identifier, before ')' token. */ + while (node && node->token->type == SPACE) + node = node->next; + + if (node == NULL || node->token->type != ')') + goto FAIL; + } else { + goto FAIL; + } + + *last = node; + + return hash_table_find (parser->defines, + argument->token->value.str) ? 1 : 0; + +FAIL: + glcpp_error (&defined->token->location, parser, + "\"defined\" not followed by an identifier"); + return -1; +} + +/* Evaluate all DEFINED nodes in a given list, modifying the list in place. + */ +static void +_glcpp_parser_evaluate_defined_in_list (glcpp_parser_t *parser, + token_list_t *list) +{ + token_node_t *node, *node_prev, *replacement, *last = NULL; + int value; + + if (list == NULL) + return; + + node_prev = NULL; + node = list->head; + + while (node) { + + if (node->token->type != DEFINED) + goto NEXT; + + value = _glcpp_parser_evaluate_defined (parser, node, &last); + if (value == -1) + goto NEXT; + + replacement = ralloc (list, token_node_t); + replacement->token = _token_create_ival (list, INTEGER, value); + + /* Splice replacement node into list, replacing from "node" + * through "last". */ + if (node_prev) + node_prev->next = replacement; + else + list->head = replacement; + replacement->next = last->next; + if (last == list->tail) + list->tail = replacement; + + node = replacement; + + NEXT: + node_prev = node; + node = node->next; + } +} + /* Perform macro expansion on 'list', placing the resulting tokens * into a new list which is initialized with a first token of type * 'head_token_type'. Then begin lexing from the resulting list, * (return to the current lexing source when this list is exhausted). + * + * See the documentation of _glcpp_parser_expand_token_list for a description + * of the "mode" parameter. */ static void _glcpp_parser_expand_and_lex_from (glcpp_parser_t *parser, int head_token_type, - token_list_t *list) + token_list_t *list, + expansion_mode_t mode) { token_list_t *expanded; token_t *token; @@ -1372,7 +1647,7 @@ _glcpp_parser_expand_and_lex_from (glcpp_parser_t *parser, expanded = _token_list_create (parser); token = _token_create_ival (parser, head_token_type, head_token_type); _token_list_append (expanded, token); - _glcpp_parser_expand_token_list (parser, list); + _glcpp_parser_expand_token_list (parser, list, mode); _token_list_append_list (expanded, list); glcpp_parser_lex_from (parser, expanded); } @@ -1435,12 +1710,15 @@ _glcpp_parser_apply_pastes (glcpp_parser_t *parser, token_list_t *list) * *last to the last node in the list that was consumed by the * expansion. Specifically, *last will be set as follows: as the * token of the closing right parenthesis. + * + * See the documentation of _glcpp_parser_expand_token_list for a description + * of the "mode" parameter. */ static token_list_t * _glcpp_parser_expand_function (glcpp_parser_t *parser, token_node_t *node, - token_node_t **last) - + token_node_t **last, + expansion_mode_t mode) { macro_t *macro; const char *identifier; @@ -1509,7 +1787,8 @@ _glcpp_parser_expand_function (glcpp_parser_t *parser, expanded_argument = _token_list_copy (parser, argument); _glcpp_parser_expand_token_list (parser, - expanded_argument); + expanded_argument, + mode); _token_list_append_list (substituted, expanded_argument); } else { @@ -1549,11 +1828,15 @@ _glcpp_parser_expand_function (glcpp_parser_t *parser, * * As the token of the closing right parenthesis in the case of * function-like macro expansion. + * + * See the documentation of _glcpp_parser_expand_token_list for a description + * of the "mode" parameter. */ static token_list_t * _glcpp_parser_expand_node (glcpp_parser_t *parser, token_node_t *node, - token_node_t **last) + token_node_t **last, + expansion_mode_t mode) { token_t *token = node->token; const char *identifier; @@ -1561,14 +1844,6 @@ _glcpp_parser_expand_node (glcpp_parser_t *parser, /* We only expand identifiers */ if (token->type != IDENTIFIER) { - /* We change any COMMA into a COMMA_FINAL to prevent - * it being mistaken for an argument separator - * later. */ - if (token->type == ',') { - token->type = COMMA_FINAL; - token->value.ival = COMMA_FINAL; - } - return NULL; } @@ -1620,7 +1895,7 @@ _glcpp_parser_expand_node (glcpp_parser_t *parser, return replacement; } - return _glcpp_parser_expand_function (parser, node, last); + return _glcpp_parser_expand_function (parser, node, last, mode); } /* Push a new identifier onto the parser's active list. @@ -1679,11 +1954,28 @@ _parser_active_list_contains (glcpp_parser_t *parser, const char *identifier) /* Walk over the token list replacing nodes with their expansion. * Whenever nodes are expanded the walking will walk over the new * nodes, continuing to expand as necessary. The results are placed in - * 'list' itself; + * 'list' itself. + * + * The "mode" argument controls the handling of any DEFINED tokens that + * result from expansion as follows: + * + * EXPANSION_MODE_IGNORE_DEFINED: Any resulting DEFINED tokens will be + * left in the final list, unevaluated. This is the correct mode + * for expanding any list in any context other than a + * preprocessor conditional, (#if or #elif). + * + * EXPANSION_MODE_EVALUATE_DEFINED: Any resulting DEFINED tokens will be + * evaluated to 0 or 1 tokens depending on whether the following + * token is the name of a defined macro. If the DEFINED token is + * not followed by an (optionally parenthesized) identifier, then + * an error will be generated. This the correct mode for + * expanding any list in the context of a preprocessor + * conditional, (#if or #elif). */ static void _glcpp_parser_expand_token_list (glcpp_parser_t *parser, - token_list_t *list) + token_list_t *list, + expansion_mode_t mode) { token_node_t *node_prev; token_node_t *node, *last = NULL; @@ -1698,15 +1990,23 @@ _glcpp_parser_expand_token_list (glcpp_parser_t *parser, node_prev = NULL; node = list->head; + if (mode == EXPANSION_MODE_EVALUATE_DEFINED) + _glcpp_parser_evaluate_defined_in_list (parser, list); + while (node) { while (parser->active && parser->active->marker == node) _parser_active_list_pop (parser); - expansion = _glcpp_parser_expand_node (parser, node, &last); + expansion = _glcpp_parser_expand_node (parser, node, &last, mode); if (expansion) { token_node_t *n; + if (mode == EXPANSION_MODE_EVALUATE_DEFINED) { + _glcpp_parser_evaluate_defined_in_list (parser, + expansion); + } + for (n = node; n != last->next; n = n->next) while (parser->active && parser->active->marker == n) @@ -1759,7 +2059,7 @@ _glcpp_parser_print_expanded_token_list (glcpp_parser_t *parser, if (list == NULL) return; - _glcpp_parser_expand_token_list (parser, list); + _glcpp_parser_expand_token_list (parser, list, EXPANSION_MODE_IGNORE_DEFINED); _token_list_trim_trailing_space (list); @@ -1770,11 +2070,27 @@ static void _check_for_reserved_macro_name (glcpp_parser_t *parser, YYLTYPE *loc, const char *identifier) { - /* According to the GLSL specification, macro names starting with "__" - * or "GL_" are reserved for future use. So, don't allow them. + /* Section 3.3 (Preprocessor) of the GLSL 1.30 spec (and later) and + * the GLSL ES spec (all versions) say: + * + * "All macro names containing two consecutive underscores ( __ ) + * are reserved for future use as predefined macro names. All + * macro names prefixed with "GL_" ("GL" followed by a single + * underscore) are also reserved." + * + * The intention is that names containing __ are reserved for internal + * use by the implementation, and names prefixed with GL_ are reserved + * for use by Khronos. Since every extension adds a name prefixed + * with GL_ (i.e., the name of the extension), that should be an + * error. Names simply containing __ are dangerous to use, but should + * be allowed. + * + * A future version of the GLSL specification will clarify this. */ if (strstr(identifier, "__")) { - glcpp_error (loc, parser, "Macro names containing \"__\" are reserved.\n"); + glcpp_warning(loc, parser, + "Macro names containing \"__\" are reserved " + "for use by the implementation.\n"); } if (strncmp(identifier, "GL_", 3) == 0) { glcpp_error (loc, parser, "Macro names starting with \"GL_\" are reserved.\n"); @@ -1804,6 +2120,10 @@ _define_object_macro (glcpp_parser_t *parser, { macro_t *macro, *previous; + /* We define pre-defined macros before we've started parsing the + * actual file. So if there's no location defined yet, that's what + * were doing and we don't want to generate an error for using the + * reserved names. */ if (loc != NULL) _check_for_reserved_macro_name(parser, loc, identifier); @@ -1836,9 +2156,16 @@ _define_function_macro (glcpp_parser_t *parser, token_list_t *replacements) { macro_t *macro, *previous; + const char *dup; _check_for_reserved_macro_name(parser, loc, identifier); + /* Check for any duplicate parameter names. */ + if ((dup = _string_list_has_duplicate (parameters)) != NULL) { + glcpp_error (loc, parser, "Duplicate macro parameter \"%s\"", + dup); + } + macro = ralloc (parser, macro_t); ralloc_steal (macro, parameters); ralloc_steal (macro, replacements); @@ -1901,11 +2228,11 @@ glcpp_parser_lex (YYSTYPE *yylval, YYLTYPE *yylloc, glcpp_parser_t *parser) if (ret == NEWLINE) parser->in_control_line = 0; } - else if (ret == HASH_DEFINE || - ret == HASH_UNDEF || ret == HASH_IF || - ret == HASH_IFDEF || ret == HASH_IFNDEF || - ret == HASH_ELIF || ret == HASH_ELSE || - ret == HASH_ENDIF || ret == HASH) + else if (ret == DEFINE_TOKEN || + ret == UNDEF || ret == IF || + ret == IFDEF || ret == IFNDEF || + ret == ELIF || ret == ELSE || + ret == ENDIF || ret == HASH_TOKEN) { parser->in_control_line = 1; } @@ -1998,7 +2325,7 @@ _glcpp_parser_skip_stack_change_if (glcpp_parser_t *parser, YYLTYPE *loc, const char *type, int condition) { if (parser->skip_stack == NULL) { - glcpp_error (loc, parser, "%s without #if\n", type); + glcpp_error (loc, parser, "#%s without #if\n", type); return; } @@ -2046,13 +2373,17 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio /* Add pre-defined macros. */ if (parser->is_gles) { add_builtin_define(parser, "GL_ES", 1); + add_builtin_define(parser, "GL_EXT_separate_shader_objects", 1); if (extensions != NULL) { if (extensions->OES_EGL_image_external) add_builtin_define(parser, "GL_OES_EGL_image_external", 1); + if (extensions->OES_standard_derivatives) + add_builtin_define(parser, "GL_OES_standard_derivatives", 1); } } else { add_builtin_define(parser, "GL_ARB_draw_buffers", 1); + add_builtin_define(parser, "GL_ARB_separate_shader_objects", 1); add_builtin_define(parser, "GL_ARB_texture_rectangle", 1); add_builtin_define(parser, "GL_AMD_shader_trinary_minmax", 1); @@ -2068,9 +2399,15 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio add_builtin_define(parser, "GL_ARB_fragment_coord_conventions", 1); + if (extensions->ARB_fragment_layer_viewport) + add_builtin_define(parser, "GL_ARB_fragment_layer_viewport", 1); + if (extensions->ARB_explicit_attrib_location) add_builtin_define(parser, "GL_ARB_explicit_attrib_location", 1); + if (extensions->ARB_explicit_uniform_location) + add_builtin_define(parser, "GL_ARB_explicit_uniform_location", 1); + if (extensions->ARB_shader_texture_lod) add_builtin_define(parser, "GL_ARB_shader_texture_lod", 1); @@ -2109,6 +2446,9 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio if (extensions->AMD_vertex_shader_layer) add_builtin_define(parser, "GL_AMD_vertex_shader_layer", 1); + if (extensions->AMD_vertex_shader_viewport_index) + add_builtin_define(parser, "GL_AMD_vertex_shader_viewport_index", 1); + if (extensions->ARB_shading_language_420pack) add_builtin_define(parser, "GL_ARB_shading_language_420pack", 1); @@ -2129,6 +2469,9 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio if (extensions->ARB_shader_image_load_store) add_builtin_define(parser, "GL_ARB_shader_image_load_store", 1); + + if (extensions->ARB_derivative_control) + add_builtin_define(parser, "GL_ARB_derivative_control", 1); } } diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp.h b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp.h index 3be4240da..12c32883d 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp.h +++ b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp.h @@ -29,7 +29,7 @@ #include "main/mtypes.h" -#include "../ralloc.h" +#include "util/ralloc.h" #include "program/hash_table.h" @@ -37,6 +37,12 @@ /* Some data types used for parser values. */ +typedef struct expression_value { + intmax_t value; + char *undefined_macro; +} expression_value_t; + + typedef struct string_node { const char *str; struct string_node *next; @@ -55,6 +61,7 @@ typedef union YYSTYPE // Could be int, but results in some bugs with parsing of #version directives // in Apple LLVM Compiler 4.2 when building for 32 bit. intmax_t ival; + expression_value_t expression_value; char *str; string_list_t *string_list; token_t *token; @@ -170,13 +177,17 @@ struct glcpp_parser { yyscan_t scanner; struct hash_table *defines; active_list_t *active; - int lexing_if; + int lexing_directive; int space_tokens; + int last_token_was_newline; + int last_token_was_space; + int first_non_space_token_this_line; int newline_as_space; int in_control_line; int paren_count; int commented_newlines; skip_node_t *skip_stack; + int skipping; token_list_t *lex_from_list; token_node_t *lex_from_node; char *output; diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/pp.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/pp.c index 4a623f81e..a54bcbe16 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/pp.c +++ b/3rdparty/glsl-optimizer/src/glsl/glcpp/pp.c @@ -70,6 +70,42 @@ glcpp_warning (YYLTYPE *locp, glcpp_parser_t *parser, const char *fmt, ...) &parser->info_log_length, "\n"); } +/* Given str, (that's expected to start with a newline terminator of some + * sort), return a pointer to the first character in str after the newline. + * + * A newline terminator can be any of the following sequences: + * + * "\r\n" + * "\n\r" + * "\n" + * "\r" + * + * And the longest such sequence will be skipped. + */ +static const char * +skip_newline (const char *str) +{ + const char *ret = str; + + if (ret == NULL) + return ret; + + if (*ret == '\0') + return ret; + + if (*ret == '\r') { + ret++; + if (*ret && *ret == '\n') + ret++; + } else if (*ret == '\n') { + ret++; + if (*ret && *ret == '\r') + ret++; + } + + return ret; +} + /* Remove any line continuation characters in the shader, (whether in * preprocessing directives or in GLSL code). */ @@ -78,10 +114,49 @@ remove_line_continuations(glcpp_parser_t *ctx, const char *shader) { char *clean = ralloc_strdup(ctx, ""); const char *backslash, *newline, *search_start; + const char *cr, *lf; + char newline_separator[3]; int collapsed_newlines = 0; search_start = shader; + /* Determine what flavor of newlines this shader is using. GLSL + * provides for 4 different possible ways to separate lines, (using + * one or two characters): + * + * "\n" (line-feed, like Linux, Unix, and new Mac OS) + * "\r" (carriage-return, like old Mac files) + * "\r\n" (carriage-return + line-feed, like DOS files) + * "\n\r" (line-feed + carriage-return, like nothing, really) + * + * This code explicitly supports a shader that uses a mixture of + * newline terminators and will properly handle line continuation + * backslashes followed by any of the above. + * + * But, since we must also insert additional newlines in the output + * (for any collapsed lines) we attempt to maintain consistency by + * examining the first encountered newline terminator, and using the + * same terminator for any newlines we insert. + */ + cr = strchr(search_start, '\r'); + lf = strchr(search_start, '\n'); + + newline_separator[0] = '\n'; + newline_separator[1] = '\0'; + newline_separator[2] = '\0'; + + if (cr == NULL) { + /* Nothing to do. */ + } else if (lf == NULL) { + newline_separator[0] = '\r'; + } else if (lf == cr + 1) { + newline_separator[0] = '\r'; + newline_separator[1] = '\n'; + } else if (cr == lf + 1) { + newline_separator[0] = '\n'; + newline_separator[1] = '\r'; + } + while (true) { backslash = strchr(search_start, '\\'); @@ -91,17 +166,24 @@ remove_line_continuations(glcpp_parser_t *ctx, const char *shader) * line numbers. */ if (collapsed_newlines) { - newline = strchr(search_start, '\n'); + cr = strchr (search_start, '\r'); + lf = strchr (search_start, '\n'); + if (cr && lf) + newline = cr < lf ? cr : lf; + else if (cr) + newline = cr; + else + newline = lf; if (newline && (backslash == NULL || newline < backslash)) { ralloc_strncat(&clean, shader, newline - shader + 1); while (collapsed_newlines) { - ralloc_strcat(&clean, "\n"); + ralloc_strcat(&clean, newline_separator); collapsed_newlines--; } - shader = newline + 1; + shader = skip_newline (newline); search_start = shader; } } @@ -116,15 +198,11 @@ remove_line_continuations(glcpp_parser_t *ctx, const char *shader) * advance the shader pointer to the character after the * newline. */ - if (backslash[1] == '\n' || - (backslash[1] == '\r' && backslash[2] == '\n')) + if (backslash[1] == '\r' || backslash[1] == '\n') { collapsed_newlines++; ralloc_strncat(&clean, shader, backslash - shader); - if (backslash[1] == '\n') - shader = backslash + 2; - else - shader = backslash + 3; + shader = skip_newline (backslash + 1); search_start = shader; } } diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_lexer.cpp b/3rdparty/glsl-optimizer/src/glsl/glsl_lexer.cpp index a03736427..cfa582f3c 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_lexer.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_lexer.cpp @@ -358,8 +358,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 246 -#define YY_END_OF_BUFFER 247 +#define YY_NUM_RULES 248 +#define YY_END_OF_BUFFER 249 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -367,119 +367,119 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[1008] = +static yyconst flex_int16_t yy_accept[1009] = { 0, - 0, 0, 16, 16, 0, 0, 247, 245, 1, 21, - 245, 245, 245, 245, 245, 245, 245, 245, 174, 172, - 245, 245, 245, 244, 245, 244, 244, 244, 244, 244, - 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, - 244, 244, 244, 244, 244, 245, 1, 245, 246, 16, - 20, 246, 19, 17, 18, 14, 13, 1, 156, 165, - 157, 168, 162, 151, 164, 152, 171, 176, 163, 177, - 174, 0, 0, 179, 174, 0, 172, 172, 160, 153, - 155, 154, 161, 244, 169, 159, 244, 244, 244, 244, - 244, 244, 244, 244, 244, 244, 244, 244, 30, 244, + 0, 0, 16, 16, 0, 0, 249, 247, 1, 22, + 247, 247, 247, 247, 247, 247, 247, 247, 176, 174, + 247, 247, 247, 246, 247, 246, 246, 246, 246, 246, + 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, + 246, 246, 246, 246, 246, 247, 1, 247, 21, 16, + 20, 21, 19, 17, 18, 14, 13, 1, 158, 167, + 159, 170, 164, 153, 166, 154, 173, 178, 165, 179, + 176, 0, 0, 181, 176, 0, 174, 174, 162, 155, + 157, 156, 163, 246, 171, 161, 246, 246, 246, 246, + 246, 246, 246, 246, 246, 246, 246, 246, 31, 246, - 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, - 244, 244, 34, 244, 244, 61, 244, 244, 244, 244, - 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, - 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, - 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, - 170, 158, 1, 0, 0, 2, 0, 0, 0, 0, - 16, 15, 19, 18, 0, 176, 175, 0, 177, 0, - 178, 173, 166, 167, 244, 182, 244, 244, 244, 244, - 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, - 244, 244, 244, 244, 244, 244, 244, 244, 244, 33, + 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, + 246, 246, 35, 246, 246, 62, 246, 246, 246, 246, + 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, + 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, + 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, + 172, 160, 1, 0, 0, 2, 0, 0, 0, 0, + 16, 15, 19, 18, 0, 178, 177, 0, 179, 0, + 180, 175, 168, 169, 246, 184, 246, 246, 246, 246, + 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, + 246, 246, 246, 246, 246, 246, 246, 246, 246, 34, - 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, - 26, 244, 244, 244, 244, 244, 244, 244, 244, 244, - 244, 244, 62, 244, 244, 244, 244, 244, 244, 244, - 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, - 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, - 244, 244, 244, 244, 244, 244, 244, 244, 0, 0, - 0, 0, 15, 0, 176, 0, 175, 0, 177, 178, - 173, 244, 244, 244, 24, 244, 244, 228, 221, 244, - 244, 244, 244, 244, 244, 244, 244, 244, 244, 32, - 185, 244, 244, 244, 244, 68, 244, 244, 190, 203, + 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, + 27, 246, 246, 246, 246, 246, 246, 246, 246, 246, + 246, 246, 63, 246, 246, 246, 246, 246, 246, 246, + 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, + 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, + 246, 246, 246, 246, 246, 246, 246, 246, 0, 0, + 0, 0, 15, 0, 178, 0, 177, 0, 179, 180, + 175, 246, 246, 246, 25, 246, 246, 230, 223, 246, + 246, 246, 246, 246, 246, 246, 246, 246, 246, 33, + 187, 246, 246, 246, 246, 69, 246, 246, 192, 205, - 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, - 244, 244, 200, 224, 49, 50, 51, 244, 244, 244, - 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, - 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, - 244, 244, 188, 180, 244, 244, 27, 244, 244, 244, - 244, 244, 244, 244, 46, 47, 48, 149, 244, 244, - 244, 0, 0, 0, 0, 0, 175, 244, 244, 244, - 28, 37, 38, 39, 244, 183, 244, 244, 23, 244, - 244, 244, 244, 211, 212, 213, 244, 181, 244, 204, - 25, 214, 215, 216, 226, 208, 209, 210, 244, 244, + 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, + 246, 246, 202, 226, 50, 51, 52, 246, 246, 246, + 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, + 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, + 246, 246, 190, 182, 246, 246, 28, 246, 246, 246, + 246, 246, 246, 246, 47, 48, 49, 151, 246, 246, + 246, 0, 0, 0, 0, 0, 177, 246, 246, 246, + 29, 38, 39, 40, 246, 185, 246, 246, 24, 246, + 246, 246, 246, 213, 214, 215, 246, 183, 246, 206, + 26, 216, 217, 218, 228, 210, 211, 212, 246, 246, - 244, 63, 206, 244, 244, 244, 40, 41, 42, 244, - 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, - 241, 244, 244, 244, 244, 244, 244, 244, 244, 201, - 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, - 244, 184, 244, 244, 223, 43, 44, 45, 244, 244, - 31, 244, 0, 0, 0, 0, 231, 244, 244, 244, - 244, 229, 244, 244, 244, 202, 197, 234, 244, 244, - 244, 244, 244, 244, 193, 244, 244, 244, 150, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 244, 244, - 244, 244, 207, 189, 244, 244, 195, 244, 244, 244, + 246, 64, 208, 246, 246, 246, 41, 42, 43, 246, + 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, + 243, 246, 246, 246, 246, 246, 246, 246, 246, 203, + 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, + 246, 186, 246, 246, 225, 44, 45, 46, 246, 246, + 32, 246, 0, 0, 0, 0, 233, 246, 246, 246, + 246, 231, 246, 246, 246, 204, 199, 236, 246, 246, + 246, 246, 246, 246, 195, 246, 246, 246, 152, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 246, 246, + 246, 246, 209, 191, 246, 246, 197, 246, 246, 246, - 36, 244, 242, 220, 69, 196, 148, 244, 232, 191, - 244, 244, 244, 244, 244, 244, 244, 244, 244, 0, - 0, 0, 0, 244, 244, 244, 244, 244, 192, 35, - 244, 244, 244, 244, 244, 244, 105, 106, 107, 244, - 244, 244, 244, 244, 225, 244, 244, 244, 244, 244, - 244, 244, 244, 244, 244, 244, 244, 186, 244, 244, - 244, 244, 244, 64, 244, 244, 65, 244, 244, 0, - 0, 0, 0, 0, 244, 244, 66, 142, 29, 198, - 116, 117, 118, 244, 244, 244, 244, 244, 244, 244, - 244, 244, 244, 244, 244, 244, 244, 194, 244, 244, + 37, 246, 244, 222, 70, 198, 150, 246, 234, 193, + 246, 246, 246, 246, 246, 246, 246, 246, 246, 0, + 0, 0, 0, 246, 246, 246, 246, 246, 194, 36, + 246, 246, 246, 246, 246, 246, 107, 108, 109, 246, + 246, 246, 246, 246, 227, 246, 246, 246, 246, 106, + 246, 246, 246, 246, 246, 246, 246, 246, 188, 246, + 246, 246, 246, 246, 65, 246, 246, 66, 246, 246, + 0, 0, 0, 0, 0, 246, 246, 67, 144, 30, + 200, 118, 119, 120, 246, 246, 246, 246, 246, 246, + 246, 246, 246, 246, 246, 246, 246, 246, 196, 246, - 244, 145, 240, 144, 244, 244, 244, 244, 244, 244, - 244, 244, 187, 127, 128, 129, 244, 244, 205, 244, - 143, 244, 0, 0, 6, 0, 0, 0, 12, 3, - 244, 22, 244, 244, 244, 244, 244, 244, 244, 244, - 244, 114, 244, 244, 244, 109, 199, 67, 244, 244, - 244, 244, 244, 222, 244, 230, 227, 235, 71, 72, - 73, 244, 244, 244, 244, 244, 244, 244, 244, 244, - 244, 244, 244, 244, 244, 244, 146, 0, 0, 0, - 0, 0, 0, 0, 244, 244, 244, 125, 244, 244, - 120, 244, 244, 244, 244, 244, 244, 244, 244, 82, + 246, 246, 147, 242, 146, 246, 246, 246, 246, 246, + 246, 246, 246, 189, 129, 130, 131, 246, 246, 207, + 246, 145, 246, 0, 0, 6, 0, 0, 0, 12, + 3, 246, 23, 246, 246, 246, 246, 246, 246, 246, + 246, 246, 116, 246, 246, 246, 111, 201, 68, 246, + 246, 246, 246, 246, 224, 246, 232, 229, 237, 72, + 73, 74, 246, 246, 246, 246, 246, 246, 246, 246, + 246, 246, 246, 246, 246, 246, 246, 148, 0, 0, + 0, 0, 0, 0, 0, 246, 246, 246, 127, 246, + 246, 122, 246, 246, 246, 246, 246, 246, 246, 246, - 83, 84, 244, 244, 244, 244, 244, 244, 244, 244, - 244, 244, 244, 244, 244, 243, 244, 244, 136, 244, - 244, 131, 88, 89, 90, 244, 244, 4, 0, 5, - 0, 0, 0, 0, 0, 0, 147, 244, 244, 244, - 244, 244, 244, 244, 244, 244, 244, 108, 244, 110, - 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, - 244, 94, 244, 244, 244, 244, 74, 244, 244, 244, - 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, - 0, 0, 0, 0, 244, 244, 244, 119, 121, 244, - 111, 244, 112, 244, 244, 244, 244, 244, 95, 244, + 83, 84, 85, 246, 246, 246, 246, 246, 246, 246, + 246, 246, 246, 246, 246, 246, 245, 246, 246, 138, + 246, 246, 133, 89, 90, 91, 246, 246, 4, 0, + 5, 0, 0, 0, 0, 0, 0, 149, 246, 246, + 246, 246, 246, 246, 246, 246, 246, 246, 110, 246, + 112, 246, 246, 246, 246, 246, 246, 246, 246, 246, + 246, 246, 95, 246, 246, 246, 246, 75, 246, 246, + 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, + 246, 0, 0, 0, 0, 246, 246, 246, 121, 123, + 246, 113, 246, 114, 246, 246, 246, 246, 246, 96, - 244, 85, 244, 244, 244, 244, 244, 244, 244, 244, - 244, 244, 244, 244, 244, 244, 244, 130, 132, 244, - 244, 244, 96, 244, 244, 91, 0, 0, 0, 122, - 123, 244, 244, 244, 138, 244, 244, 139, 244, 244, - 244, 244, 244, 244, 244, 70, 244, 244, 244, 244, - 217, 244, 218, 233, 244, 244, 244, 133, 134, 244, - 244, 244, 244, 244, 244, 244, 244, 0, 0, 0, - 244, 244, 244, 244, 115, 113, 244, 244, 244, 236, - 238, 244, 75, 244, 76, 244, 244, 244, 244, 244, - 244, 244, 244, 244, 244, 244, 237, 239, 244, 0, + 246, 246, 86, 246, 246, 246, 246, 246, 246, 246, + 246, 246, 246, 246, 246, 246, 246, 246, 132, 134, + 246, 246, 246, 97, 246, 246, 92, 0, 0, 0, + 124, 125, 246, 246, 246, 140, 246, 246, 141, 246, + 246, 246, 246, 246, 246, 246, 71, 246, 246, 246, + 246, 219, 246, 220, 235, 246, 246, 246, 135, 136, + 246, 246, 246, 246, 246, 246, 246, 246, 0, 0, + 0, 246, 246, 246, 246, 117, 115, 246, 246, 246, + 238, 240, 246, 76, 246, 77, 246, 246, 246, 246, + 246, 246, 246, 246, 246, 246, 246, 239, 241, 246, - 0, 0, 0, 126, 124, 244, 244, 86, 87, 244, - 244, 244, 77, 244, 244, 244, 78, 244, 244, 244, - 137, 135, 92, 93, 244, 244, 0, 0, 0, 0, - 244, 244, 244, 244, 244, 244, 97, 244, 100, 244, - 244, 244, 244, 0, 0, 0, 0, 244, 244, 98, - 101, 244, 244, 244, 244, 79, 244, 99, 102, 0, - 0, 0, 7, 0, 0, 140, 141, 244, 244, 244, - 244, 104, 0, 0, 8, 0, 0, 244, 244, 219, - 244, 0, 0, 0, 80, 81, 244, 0, 0, 0, - 9, 244, 0, 0, 10, 103, 0, 0, 0, 0, + 0, 0, 0, 0, 128, 126, 246, 246, 87, 88, + 246, 246, 246, 78, 246, 246, 246, 79, 246, 246, + 246, 139, 137, 93, 94, 246, 246, 0, 0, 0, + 0, 246, 246, 246, 246, 246, 246, 98, 246, 101, + 246, 246, 246, 246, 0, 0, 0, 0, 246, 246, + 99, 102, 246, 246, 246, 246, 80, 246, 100, 103, + 0, 0, 0, 7, 0, 0, 142, 143, 246, 246, + 246, 246, 105, 0, 0, 8, 0, 0, 246, 246, + 221, 246, 0, 0, 0, 81, 82, 246, 0, 0, + 0, 9, 246, 0, 0, 10, 104, 0, 0, 0, - 0, 0, 0, 0, 0, 11, 0 + 0, 0, 0, 0, 0, 0, 11, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -525,239 +525,239 @@ static yyconst flex_int32_t yy_meta[71] = 5, 5, 5, 5, 5, 5, 5, 5, 5, 1 } ; -static yyconst flex_int16_t yy_base[1018] = +static yyconst flex_int16_t yy_base[1019] = { 0, - 0, 69, 75, 145, 1377, 1376, 1378, 1381, 70, 1381, - 1352, 1351, 94, 1350, 91, 92, 90, 1349, 202, 256, - 89, 1348, 95, 0, 79, 68, 64, 79, 124, 76, - 131, 1313, 127, 141, 81, 88, 82, 1307, 136, 126, - 183, 177, 149, 168, 134, 180, 206, 251, 1381, 140, - 1381, 1355, 239, 1381, 0, 1381, 1381, 228, 1381, 1381, - 1381, 1381, 1381, 1381, 1381, 1381, 1381, 231, 1381, 233, - 137, 307, 273, 1381, 1381, 0, 0, 1381, 1344, 1381, - 1381, 1381, 1343, 0, 1381, 1381, 1304, 1309, 115, 1306, - 1315, 1314, 1300, 1303, 1315, 244, 1309, 1296, 1293, 1307, + 0, 69, 75, 145, 1378, 1377, 1379, 1382, 70, 1382, + 1353, 1352, 94, 1351, 91, 92, 90, 1350, 202, 256, + 89, 1349, 95, 0, 79, 68, 64, 79, 124, 76, + 131, 1314, 127, 141, 81, 88, 82, 1308, 136, 126, + 183, 177, 149, 168, 134, 180, 206, 251, 1382, 140, + 1382, 1356, 239, 1382, 0, 1382, 1382, 228, 1382, 1382, + 1382, 1382, 1382, 1382, 1382, 1382, 1382, 231, 1382, 233, + 137, 307, 273, 1382, 1382, 0, 0, 1382, 1345, 1382, + 1382, 1382, 1344, 0, 1382, 1382, 1305, 1310, 115, 1307, + 1316, 1315, 1301, 1304, 1316, 244, 1310, 1297, 1294, 1308, - 1293, 1290, 1290, 1296, 126, 180, 1290, 1301, 1286, 1292, - 1296, 1297, 0, 1288, 1299, 254, 1298, 1293, 1273, 143, - 1277, 1291, 1281, 188, 1274, 271, 1287, 1289, 285, 1268, - 1276, 1273, 1262, 1271, 223, 252, 1276, 1271, 1274, 1262, - 1265, 246, 246, 226, 1275, 1262, 1275, 83, 1268, 1267, - 1381, 1381, 329, 334, 340, 1381, 1252, 1265, 1256, 1267, - 342, 0, 333, 0, 346, 1381, 329, 390, 1381, 353, - 397, 281, 1381, 1381, 1262, 0, 1257, 1252, 1256, 1266, - 1263, 328, 1246, 1246, 1258, 1249, 278, 1260, 1257, 1257, - 1255, 1252, 1243, 1250, 1236, 1234, 1247, 1232, 1249, 0, + 1294, 1291, 1291, 1297, 126, 180, 1291, 1302, 1287, 1293, + 1297, 1298, 0, 1289, 1300, 254, 1299, 1294, 1274, 143, + 1278, 1292, 1282, 188, 1275, 271, 1288, 1290, 285, 1269, + 1277, 1274, 1263, 1272, 223, 252, 1277, 1272, 1275, 1263, + 1266, 246, 246, 226, 1276, 1263, 1276, 83, 1269, 1268, + 1382, 1382, 329, 334, 340, 1382, 1253, 1266, 1257, 1268, + 342, 0, 333, 0, 346, 1382, 329, 390, 1382, 353, + 397, 281, 1382, 1382, 1263, 0, 1258, 1253, 1257, 1267, + 1264, 328, 1247, 1247, 1259, 1250, 278, 1261, 1258, 1258, + 1256, 1253, 1244, 1251, 1237, 1235, 1248, 1233, 1250, 0, - 1246, 1233, 1241, 1238, 1242, 1243, 1236, 1233, 1221, 1220, - 1234, 1237, 1224, 1233, 1220, 1227, 1217, 362, 1223, 1226, - 1216, 1224, 1212, 1216, 1207, 1222, 1221, 1211, 1218, 325, - 1201, 1220, 1203, 1201, 1212, 1201, 1196, 1194, 1196, 1207, - 1192, 1194, 1191, 1203, 1202, 1205, 1186, 326, 1195, 1190, - 1188, 1198, 1176, 402, 1195, 1197, 1185, 1177, 1176, 1180, - 1192, 1175, 0, 414, 421, 438, 1381, 445, 456, 1381, - 1381, 1170, 1181, 1180, 0, 1177, 405, 0, 0, 1170, - 1168, 1168, 1169, 1164, 1173, 1161, 1179, 1167, 408, 0, - 0, 1161, 1172, 1171, 1171, 0, 1155, 426, 0, 0, + 1247, 1234, 1242, 1239, 1243, 1244, 1237, 1234, 1222, 1221, + 1235, 1238, 1225, 1234, 1221, 1228, 1218, 362, 1224, 1227, + 1217, 1225, 1213, 1217, 1208, 1223, 1222, 1212, 1219, 325, + 1202, 1221, 1204, 1202, 1213, 1202, 1197, 1195, 1197, 1208, + 1193, 1195, 1192, 1204, 1203, 1206, 1187, 326, 1196, 1191, + 1189, 1199, 1177, 402, 1196, 1198, 1186, 1178, 1177, 1181, + 1193, 1176, 0, 414, 421, 438, 1382, 445, 456, 1382, + 1382, 1171, 1182, 1181, 0, 1178, 405, 0, 0, 1171, + 1169, 1169, 1170, 1165, 1174, 1162, 1180, 1168, 408, 0, + 0, 1162, 1173, 1172, 1172, 0, 1156, 426, 0, 0, - 1157, 450, 1165, 1166, 1156, 1150, 1149, 1150, 1149, 1149, - 461, 1144, 0, 0, 1140, 1139, 1138, 1140, 1141, 1146, - 1140, 1136, 1150, 1145, 1145, 1143, 1142, 1135, 1129, 1131, - 1130, 1133, 1133, 1125, 1128, 1123, 1132, 1137, 1124, 1121, - 1134, 1124, 0, 0, 1131, 1127, 0, 1118, 1118, 1124, - 1114, 1122, 464, 1119, 0, 0, 0, 0, 1108, 1121, - 1120, 1119, 1118, 1115, 1103, 473, 480, 1115, 1116, 1116, - 0, 0, 0, 0, 1102, 0, 1111, 1101, 0, 1100, - 1101, 1095, 1106, 0, 0, 0, 1096, 0, 1092, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1103, 486, + 1158, 450, 1166, 1167, 1157, 1151, 1150, 1151, 1150, 1150, + 461, 1145, 0, 0, 1141, 1140, 1139, 1141, 1142, 1147, + 1141, 1137, 1151, 1146, 1146, 1144, 1143, 1136, 1130, 1132, + 1131, 1134, 1134, 1126, 1129, 1124, 1133, 1138, 1125, 1122, + 1135, 1125, 0, 0, 1132, 1128, 0, 1119, 1119, 1125, + 1115, 1123, 464, 1120, 0, 0, 0, 0, 1109, 1122, + 1121, 1120, 1119, 1116, 1104, 473, 480, 1116, 1117, 1117, + 0, 0, 0, 0, 1103, 0, 1112, 1102, 0, 1101, + 1102, 1096, 1107, 0, 0, 0, 1097, 0, 1093, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1104, 486, - 1102, 0, 0, 1100, 1096, 1092, 0, 0, 0, 1084, - 467, 489, 498, 1089, 1085, 1091, 1081, 1079, 1093, 1077, - 0, 1077, 1091, 1079, 1075, 1082, 1076, 1088, 1083, 0, - 1081, 1078, 1082, 1065, 1063, 1066, 1073, 1079, 1074, 1073, - 1060, 0, 1062, 1063, 0, 0, 0, 0, 1060, 1064, - 0, 1057, 1057, 1112, 1056, 1059, 0, 1067, 1046, 1056, - 1050, 0, 1043, 1043, 1057, 0, 1059, 0, 503, 1073, - 1072, 1071, 1036, 1035, 0, 1053, 1052, 1047, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1035, 1049, - 1035, 1032, 0, 0, 1038, 1037, 0, 1033, 1041, 1040, + 1103, 0, 0, 1101, 1097, 1093, 0, 0, 0, 1085, + 467, 489, 498, 1090, 1086, 1092, 1082, 1080, 1094, 1078, + 0, 1078, 1092, 1080, 1076, 1083, 1077, 1089, 1084, 0, + 1082, 1079, 1083, 1066, 1064, 1067, 1074, 1080, 1075, 1074, + 1061, 0, 1063, 1064, 0, 0, 0, 0, 1061, 1065, + 0, 1058, 1058, 1113, 1057, 1060, 0, 1068, 1047, 1057, + 1051, 0, 1044, 1044, 1058, 0, 1060, 0, 503, 1074, + 1073, 1072, 1037, 1036, 0, 1054, 1053, 1048, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1036, 1050, + 1036, 1033, 0, 0, 1039, 344, 0, 1035, 1043, 1042, - 0, 1032, 1024, 0, 0, 0, 0, 1021, 0, 0, - 1020, 1032, 506, 1024, 1031, 1030, 1027, 1021, 1018, 1013, - 524, 1029, 1014, 1008, 1008, 1022, 1006, 1019, 0, 0, - 1011, 1036, 1035, 1034, 999, 998, 359, 500, 0, 1011, - 1014, 1012, 1000, 996, 0, 1009, 1006, 1005, 994, 993, - 983, 1001, 986, 989, 530, 994, 997, 0, 1015, 1014, - 1013, 978, 977, 0, 992, 978, 0, 989, 981, 983, - 548, 554, 1033, 976, 980, 983, 0, 0, 0, 0, - 1004, 550, 0, 980, 983, 967, 975, 965, 986, 975, - 971, 972, 972, 971, 956, 563, 969, 0, 970, 958, + 0, 1034, 1026, 0, 0, 0, 0, 1023, 0, 0, + 1022, 1034, 506, 1026, 1033, 1032, 1029, 1023, 1020, 1015, + 524, 1031, 1016, 1010, 1010, 1024, 1008, 1021, 0, 0, + 1013, 1038, 1037, 1036, 1001, 1000, 359, 500, 0, 1013, + 1016, 1014, 1002, 998, 0, 1011, 1008, 1007, 996, 0, + 995, 985, 1003, 988, 991, 530, 996, 999, 0, 1017, + 1016, 1015, 980, 979, 0, 994, 980, 0, 991, 983, + 985, 548, 554, 1035, 978, 982, 985, 0, 0, 0, + 0, 1006, 550, 0, 982, 985, 969, 977, 967, 988, + 977, 973, 974, 974, 973, 958, 563, 971, 0, 972, - 957, 0, 0, 0, 953, 983, 982, 981, 946, 945, - 941, 949, 0, 979, 551, 0, 955, 958, 0, 566, - 0, 935, 943, 600, 1381, 607, 0, 627, 594, 1381, - 943, 0, 939, 938, 959, 948, 946, 946, 933, 948, - 931, 964, 943, 944, 939, 960, 0, 0, 956, 955, - 954, 919, 918, 0, 918, 0, 0, 0, 365, 623, - 942, 929, 932, 914, 927, 914, 913, 934, 923, 921, - 921, 939, 938, 937, 902, 901, 0, 906, 649, 655, - 446, 923, 913, 901, 897, 898, 897, 930, 909, 906, - 927, 908, 904, 906, 889, 886, 900, 886, 885, 918, + 960, 959, 0, 0, 0, 955, 985, 984, 983, 948, + 947, 943, 951, 0, 981, 551, 0, 957, 960, 0, + 566, 0, 937, 945, 600, 1382, 607, 0, 627, 594, + 1382, 945, 0, 941, 940, 961, 950, 948, 948, 935, + 950, 933, 966, 945, 946, 941, 962, 0, 0, 958, + 957, 956, 921, 920, 0, 920, 0, 0, 0, 365, + 623, 944, 931, 934, 916, 929, 916, 915, 936, 925, + 923, 923, 941, 940, 939, 904, 903, 0, 908, 649, + 655, 446, 925, 915, 903, 899, 900, 899, 932, 911, + 908, 929, 910, 906, 908, 891, 888, 902, 888, 887, - 570, 0, 894, 897, 889, 880, 888, 878, 899, 888, - 884, 886, 884, 884, 883, 0, 870, 869, 902, 881, - 878, 899, 898, 651, 0, 874, 877, 1381, 508, 1381, - 677, 0, 683, 892, 875, 857, 0, 874, 873, 856, - 853, 854, 853, 845, 853, 843, 842, 0, 822, 0, - 819, 818, 817, 838, 827, 825, 825, 808, 810, 825, - 808, 841, 820, 821, 818, 815, 566, 802, 817, 816, - 798, 795, 796, 795, 792, 791, 812, 801, 23, 182, - 526, 204, 178, 214, 241, 247, 326, 0, 0, 332, - 356, 331, 362, 407, 447, 474, 472, 476, 525, 506, + 920, 570, 0, 896, 899, 891, 882, 890, 880, 901, + 890, 886, 888, 886, 886, 885, 0, 872, 871, 904, + 883, 880, 901, 900, 651, 0, 876, 879, 1382, 508, + 1382, 677, 0, 683, 894, 877, 859, 0, 876, 875, + 858, 855, 856, 855, 847, 855, 845, 851, 0, 845, + 0, 821, 820, 819, 840, 829, 827, 827, 810, 813, + 827, 810, 843, 822, 823, 820, 817, 566, 804, 819, + 818, 801, 797, 798, 797, 796, 793, 814, 803, 801, + 24, 526, 198, 173, 189, 199, 241, 254, 0, 0, + 326, 356, 335, 413, 468, 453, 488, 476, 491, 526, - 505, 528, 511, 517, 515, 534, 537, 536, 552, 538, - 543, 546, 559, 554, 545, 546, 570, 0, 0, 571, - 573, 574, 609, 590, 589, 612, 605, 590, 597, 0, - 0, 610, 611, 608, 0, 611, 596, 0, 613, 637, - 638, 623, 625, 629, 631, 0, 638, 648, 640, 648, - 671, 652, 0, 0, 651, 668, 669, 0, 0, 670, - 672, 673, 674, 659, 658, 661, 662, 722, 723, 673, - 659, 660, 684, 685, 0, 0, 663, 665, 673, 0, - 0, 674, 697, 671, 699, 694, 688, 675, 697, 695, - 688, 677, 678, 679, 680, 688, 0, 0, 689, 749, + 507, 506, 533, 513, 518, 531, 553, 538, 537, 553, + 541, 546, 550, 560, 555, 546, 563, 571, 0, 0, + 573, 574, 575, 610, 591, 590, 613, 606, 603, 598, + 0, 0, 611, 615, 611, 0, 612, 613, 0, 614, + 638, 639, 627, 627, 631, 645, 0, 639, 649, 641, + 649, 672, 653, 0, 0, 652, 669, 670, 0, 0, + 672, 673, 674, 675, 660, 659, 662, 663, 723, 724, + 674, 660, 661, 685, 686, 0, 0, 664, 666, 674, + 0, 0, 675, 698, 672, 700, 695, 689, 676, 698, + 696, 689, 678, 679, 680, 681, 689, 0, 0, 690, - 750, 751, 685, 0, 0, 707, 708, 0, 0, 712, - 713, 708, 0, 709, 694, 718, 0, 696, 706, 729, - 0, 0, 0, 0, 722, 723, 711, 768, 721, 723, - 714, 715, 707, 708, 732, 733, 0, 732, 742, 716, - 752, 716, 717, 721, 737, 786, 788, 723, 725, 0, - 0, 744, 745, 735, 743, 0, 759, 0, 0, 754, - 798, 799, 1381, 802, 801, 0, 0, 746, 747, 741, - 767, 0, 752, 812, 1381, 813, 766, 751, 752, 0, - 771, 767, 771, 821, 0, 0, 766, 781, 826, 827, - 1381, 764, 774, 831, 1381, 0, 771, 833, 836, 837, + 750, 751, 752, 686, 0, 0, 708, 709, 0, 0, + 713, 714, 709, 0, 710, 695, 719, 0, 697, 707, + 730, 0, 0, 0, 0, 723, 724, 712, 769, 722, + 724, 715, 716, 708, 709, 733, 734, 0, 733, 743, + 717, 753, 717, 718, 722, 738, 787, 789, 724, 726, + 0, 0, 745, 746, 736, 744, 0, 760, 0, 0, + 755, 799, 800, 1382, 803, 802, 0, 0, 747, 748, + 742, 768, 0, 753, 813, 1382, 814, 767, 752, 753, + 0, 772, 768, 772, 822, 0, 0, 767, 782, 827, + 828, 1382, 765, 775, 832, 1382, 0, 772, 834, 837, - 838, 787, 788, 844, 845, 1381, 1381, 883, 888, 891, - 894, 845, 846, 897, 901, 904, 906 + 838, 839, 788, 789, 845, 846, 1382, 1382, 884, 889, + 892, 895, 846, 847, 898, 902, 905, 907 } ; -static yyconst flex_int16_t yy_def[1018] = +static yyconst flex_int16_t yy_def[1019] = { 0, - 1007, 1, 1008, 1008, 1009, 1009, 1007, 1007, 1007, 1007, - 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, - 1007, 1007, 1007, 1010, 1007, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1007, 1007, 1007, 1007, 1007, - 1007, 1007, 1007, 1007, 1011, 1007, 1007, 1007, 1007, 1007, - 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1012, 1007, 1013, - 19, 1007, 1007, 1007, 1007, 1014, 20, 1007, 1007, 1007, - 1007, 1007, 1007, 1010, 1007, 1007, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, + 1008, 1, 1009, 1009, 1010, 1010, 1008, 1008, 1008, 1008, + 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, + 1008, 1008, 1008, 1011, 1008, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1008, 1008, 1008, 1008, 1008, + 1008, 1008, 1008, 1008, 1012, 1008, 1008, 1008, 1008, 1008, + 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1013, 1008, 1014, + 19, 1008, 1008, 1008, 1008, 1015, 20, 1008, 1008, 1008, + 1008, 1008, 1008, 1011, 1008, 1008, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, - 1007, 1015, 1007, 1011, 1007, 1007, 1013, 1007, 1007, 1007, - 1007, 1014, 1007, 1007, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, + 1008, 1016, 1008, 1012, 1008, 1008, 1014, 1008, 1008, 1008, + 1008, 1015, 1008, 1008, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1007, 1007, - 1007, 1007, 1015, 1007, 1007, 1007, 1007, 1007, 1007, 1007, - 1007, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1008, 1008, + 1008, 1008, 1016, 1008, 1008, 1008, 1008, 1008, 1008, 1008, + 1008, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1007, 1007, 1007, 1007, 1007, 1007, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1008, 1008, 1008, 1008, 1008, 1008, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1007, 1007, 1007, 1007, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1008, 1008, 1008, 1008, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1007, - 1007, 1007, 1007, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1007, - 1007, 1007, 1007, 1007, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1008, + 1008, 1008, 1008, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1008, 1008, 1008, 1008, 1008, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1007, 1007, 1007, 1007, 1016, 1007, 1007, 1007, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1007, 1007, 1007, - 1016, 1007, 1007, 1007, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1008, 1008, 1008, 1008, 1017, 1008, 1008, + 1008, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1008, 1008, + 1008, 1017, 1008, 1008, 1008, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1007, 1007, 1007, - 1007, 1017, 1007, 1007, 1007, 1007, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1017, 1007, 1007, 1007, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1008, 1008, + 1008, 1008, 1018, 1008, 1008, 1008, 1008, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1018, 1008, 1008, 1008, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1007, 1007, 1007, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1007, 1007, 1007, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1007, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1008, 1008, 1008, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1008, 1008, + 1008, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, - 1007, 1007, 1007, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1007, 1007, 1007, 1007, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1010, 1007, 1007, 1007, 1007, 1010, 1010, 1010, - 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1007, - 1007, 1007, 1007, 1007, 1007, 1010, 1010, 1010, 1010, 1010, - 1010, 1010, 1007, 1007, 1007, 1007, 1007, 1010, 1010, 1010, - 1010, 1007, 1007, 1007, 1010, 1010, 1010, 1007, 1007, 1007, - 1007, 1010, 1007, 1007, 1007, 1010, 1007, 1007, 1007, 1007, + 1008, 1008, 1008, 1008, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1008, 1008, 1008, + 1008, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1011, 1008, 1008, 1008, 1008, 1011, 1011, + 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, + 1008, 1008, 1008, 1008, 1008, 1008, 1011, 1011, 1011, 1011, + 1011, 1011, 1011, 1008, 1008, 1008, 1008, 1008, 1011, 1011, + 1011, 1011, 1008, 1008, 1008, 1011, 1011, 1011, 1008, 1008, + 1008, 1008, 1011, 1008, 1008, 1008, 1011, 1008, 1008, 1008, - 1007, 1007, 1007, 1007, 1007, 1007, 0, 1007, 1007, 1007, - 1007, 1007, 1007, 1007, 1007, 1007, 1007 + 1008, 1008, 1008, 1008, 1008, 1008, 1008, 0, 1008, 1008, + 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008 } ; -static yyconst flex_int16_t yy_nxt[1452] = +static yyconst flex_int16_t yy_nxt[1453] = { 0, 8, 9, 10, 9, 11, 8, 12, 13, 8, 8, 14, 15, 16, 17, 18, 19, 20, 20, 20, 20, @@ -766,7 +766,7 @@ static yyconst flex_int16_t yy_nxt[1452] = 24, 24, 25, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 24, 24, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 24, 24, 24, 46, - 47, 58, 825, 58, 48, 49, 50, 51, 50, 49, + 47, 58, 827, 58, 48, 49, 50, 51, 50, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 52, 49, 53, 53, 53, 53, 53, 53, 54, 49, 49, @@ -777,151 +777,151 @@ static yyconst flex_int16_t yy_nxt[1452] = 124, 161, 103, 161, 49, 49, 50, 51, 50, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 52, 49, 53, 53, 53, 53, 53, 53, 54, 49, 49, - 49, 110, 97, 177, 129, 104, 98, 178, 1007, 111, + 49, 110, 97, 177, 129, 104, 98, 178, 1008, 111, 126, 196, 99, 105, 130, 149, 106, 49, 100, 107, 113, 112, 197, 114, 150, 108, 127, 115, 116, 128, - 216, 142, 117, 1007, 151, 118, 143, 153, 217, 58, + 216, 142, 117, 1008, 151, 118, 143, 153, 217, 58, 144, 154, 146, 145, 49, 70, 147, 71, 71, 71, 71, 71, 71, 72, 198, 138, 148, 131, 139, 58, - 826, 58, 73, 74, 132, 133, 827, 140, 199, 134, - 221, 828, 75, 76, 141, 135, 136, 222, 137, 152, + 828, 58, 73, 74, 132, 133, 829, 140, 199, 134, + 221, 830, 75, 76, 141, 135, 136, 222, 137, 152, 73, 74, 155, 156, 163, 163, 163, 163, 163, 163, - 163, 165, 166, 168, 169, 75, 829, 237, 76, 70, + 163, 165, 166, 168, 169, 75, 831, 237, 76, 70, 250, 77, 77, 77, 77, 77, 77, 77, 251, 165, 166, 168, 169, 238, 170, 170, 73, 74, 171, 171, 171, 171, 171, 171, 171, 185, 78, 239, 248, 157, - 186, 187, 246, 247, 73, 74, 158, 249, 830, 208, - 159, 240, 209, 210, 831, 160, 211, 224, 212, 78, + 186, 187, 246, 247, 73, 74, 158, 249, 832, 208, + 159, 240, 209, 210, 833, 160, 211, 224, 212, 78, 70, 271, 72, 72, 72, 72, 72, 72, 72, 229, 153, 225, 58, 226, 154, 155, 156, 73, 74, 284, 285, 155, 156, 161, 271, 161, 230, 231, 163, 163, 163, 163, 163, 163, 163, 73, 74, 264, 264, 266, 267, 265, 265, 265, 265, 265, 265, 265, 171, 171, 171, 171, 171, 171, 171, 348, 278, 266, 267, 315, - 316, 317, 157, 329, 349, 586, 832, 330, 157, 158, - 279, 706, 833, 159, 834, 158, 835, 587, 160, 159, + 316, 317, 157, 329, 349, 587, 834, 330, 157, 158, + 279, 707, 550, 159, 835, 158, 551, 588, 160, 159, - 836, 268, 268, 707, 160, 269, 269, 269, 269, 269, + 836, 268, 268, 708, 160, 269, 269, 269, 269, 269, 269, 269, 171, 171, 171, 171, 171, 171, 171, 355, 356, 357, 372, 373, 374, 384, 385, 386, 270, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, - 265, 265, 265, 392, 393, 394, 270, 624, 625, 366, + 265, 265, 265, 392, 393, 394, 270, 625, 626, 366, 366, 837, 166, 367, 367, 367, 367, 367, 367, 367, 269, 269, 269, 269, 269, 269, 269, 396, 397, 398, 166, 269, 269, 269, 269, 269, 269, 269, 407, 408, 409, 446, 447, 448, 480, 481, 482, 169, 367, 367, 367, 367, 367, 367, 367, 367, 367, 367, 367, 367, - 367, 367, 470, 471, 472, 169, 483, 484, 485, 729, - 730, 267, 838, 473, 474, 486, 487, 488, 839, 532, - 533, 534, 559, 560, 561, 521, 588, 729, 730, 267, - 535, 536, 840, 562, 563, 589, 841, 590, 591, 571, - 572, 572, 572, 572, 572, 572, 606, 607, 608, 624, - 625, 842, 843, 844, 845, 624, 625, 609, 610, 846, - 611, 847, 848, 626, 626, 626, 626, 626, 626, 628, - 628, 628, 628, 628, 628, 628, 634, 667, 849, 649, - 650, 651, 672, 673, 674, 635, 668, 636, 669, 627, - 652, 653, 812, 675, 676, 629, 753, 850, 851, 852, + 367, 367, 470, 471, 472, 169, 483, 484, 485, 730, + 731, 267, 838, 473, 474, 486, 487, 488, 839, 532, + 533, 534, 560, 561, 562, 521, 589, 730, 731, 267, + 535, 536, 840, 563, 564, 590, 841, 591, 592, 572, + 573, 573, 573, 573, 573, 573, 607, 608, 609, 625, + 626, 842, 843, 844, 845, 625, 626, 610, 611, 846, + 612, 847, 848, 627, 627, 627, 627, 627, 627, 629, + 629, 629, 629, 629, 629, 629, 635, 668, 849, 650, + 651, 652, 673, 674, 675, 636, 669, 637, 670, 628, + 653, 654, 813, 676, 677, 630, 754, 850, 851, 852, - 853, 624, 625, 854, 813, 754, 855, 755, 624, 625, - 856, 857, 858, 859, 627, 679, 680, 680, 680, 680, - 680, 680, 626, 626, 626, 626, 626, 626, 624, 625, - 860, 861, 682, 862, 863, 864, 865, 866, 867, 868, - 869, 683, 628, 628, 628, 628, 628, 628, 628, 708, - 729, 730, 684, 870, 871, 872, 729, 730, 709, 873, - 710, 711, 874, 875, 731, 731, 731, 731, 731, 731, - 733, 733, 733, 733, 733, 733, 733, 776, 729, 730, - 876, 877, 878, 879, 729, 730, 777, 880, 778, 881, - 732, 882, 731, 731, 731, 731, 731, 731, 733, 733, + 853, 625, 626, 854, 814, 755, 855, 756, 625, 626, + 856, 857, 858, 859, 628, 680, 681, 681, 681, 681, + 681, 681, 627, 627, 627, 627, 627, 627, 625, 626, + 860, 861, 683, 862, 863, 864, 865, 866, 867, 868, + 869, 684, 629, 629, 629, 629, 629, 629, 629, 709, + 730, 731, 685, 870, 871, 872, 730, 731, 710, 873, + 711, 712, 874, 875, 732, 732, 732, 732, 732, 732, + 734, 734, 734, 734, 734, 734, 734, 777, 730, 731, + 876, 877, 878, 879, 730, 731, 778, 880, 779, 881, + 733, 882, 732, 732, 732, 732, 732, 732, 734, 734, - 733, 733, 733, 733, 733, 883, 884, 885, 886, 887, - 888, 889, 890, 891, 892, 732, 893, 894, 895, 896, - 897, 898, 899, 900, 901, 903, 904, 905, 906, 907, - 908, 902, 909, 910, 911, 912, 913, 914, 915, 916, + 734, 734, 734, 734, 734, 883, 884, 885, 886, 887, + 888, 889, 890, 891, 892, 733, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 904, 905, 906, 907, + 908, 909, 903, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, - 900, 901, 928, 930, 931, 932, 933, 934, 902, 935, - 936, 937, 938, 939, 940, 941, 942, 943, 944, 928, - 945, 947, 948, 949, 950, 951, 952, 953, 946, 954, - 955, 956, 957, 958, 959, 960, 961, 962, 966, 964, - 967, 968, 969, 970, 971, 963, 965, 972, 973, 974, + 927, 901, 902, 929, 931, 932, 933, 934, 935, 903, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, + 929, 946, 948, 949, 950, 951, 952, 953, 954, 947, + 955, 956, 957, 958, 959, 960, 961, 962, 963, 967, + 965, 968, 969, 970, 971, 972, 964, 966, 973, 974, - 962, 927, 976, 964, 978, 979, 980, 975, 963, 929, - 965, 981, 982, 974, 976, 983, 985, 986, 987, 988, - 989, 975, 990, 984, 992, 993, 929, 994, 990, 996, - 991, 997, 994, 998, 999, 995, 991, 999, 1001, 1001, - 995, 1000, 1003, 1004, 1000, 1005, 1005, 68, 167, 824, - 823, 822, 821, 1006, 1006, 820, 819, 818, 817, 977, - 816, 815, 814, 811, 810, 809, 808, 807, 806, 805, - 804, 977, 803, 802, 801, 800, 799, 798, 797, 796, - 795, 1002, 1002, 55, 55, 55, 55, 55, 56, 56, - 56, 56, 56, 84, 84, 84, 164, 164, 164, 172, + 975, 963, 928, 977, 965, 979, 980, 981, 976, 964, + 930, 966, 982, 983, 975, 977, 984, 986, 987, 988, + 989, 990, 976, 991, 985, 993, 994, 930, 995, 991, + 997, 992, 998, 995, 999, 1000, 996, 992, 1000, 1002, + 1002, 996, 1001, 1004, 1005, 1001, 1006, 1006, 68, 167, + 826, 825, 824, 823, 1007, 1007, 822, 821, 820, 819, + 978, 818, 817, 816, 815, 812, 811, 810, 809, 808, + 807, 806, 978, 805, 804, 803, 802, 801, 800, 799, + 798, 797, 1003, 1003, 55, 55, 55, 55, 55, 56, + 56, 56, 56, 56, 84, 84, 84, 164, 164, 164, - 172, 263, 794, 263, 263, 263, 681, 681, 781, 781, - 793, 792, 791, 790, 789, 788, 787, 786, 785, 784, - 783, 782, 780, 779, 775, 774, 773, 772, 771, 770, - 769, 768, 767, 766, 765, 764, 763, 762, 761, 760, - 759, 758, 757, 756, 752, 751, 750, 749, 748, 747, - 746, 745, 744, 743, 742, 741, 740, 739, 738, 737, - 736, 735, 734, 728, 727, 726, 725, 724, 723, 722, - 721, 720, 719, 718, 717, 716, 715, 714, 713, 712, - 705, 704, 703, 702, 701, 700, 699, 698, 697, 696, - 695, 694, 693, 692, 691, 690, 689, 688, 687, 686, + 172, 172, 263, 796, 263, 263, 263, 682, 682, 782, + 782, 795, 794, 793, 792, 791, 790, 789, 788, 787, + 786, 785, 784, 783, 781, 780, 776, 775, 774, 773, + 772, 771, 770, 769, 768, 767, 766, 765, 764, 763, + 762, 761, 760, 759, 758, 757, 753, 752, 751, 750, + 749, 748, 747, 746, 745, 744, 743, 742, 741, 740, + 739, 738, 737, 736, 735, 729, 728, 727, 726, 725, + 724, 723, 722, 721, 720, 719, 718, 717, 716, 715, + 714, 713, 706, 705, 704, 703, 702, 701, 700, 699, + 698, 697, 696, 695, 694, 693, 692, 691, 690, 689, - 685, 678, 677, 671, 670, 666, 665, 664, 663, 662, - 661, 660, 659, 658, 657, 656, 655, 654, 648, 647, - 646, 645, 644, 643, 642, 641, 640, 639, 638, 637, - 633, 632, 631, 630, 629, 623, 622, 621, 620, 619, - 618, 617, 616, 615, 614, 613, 612, 605, 604, 603, - 602, 601, 600, 599, 598, 597, 596, 595, 594, 593, - 592, 585, 584, 583, 582, 581, 580, 579, 578, 577, - 576, 575, 574, 573, 570, 569, 568, 567, 566, 565, - 564, 558, 557, 556, 555, 554, 553, 552, 551, 550, - 549, 548, 547, 546, 545, 544, 543, 542, 541, 540, + 688, 687, 686, 679, 678, 672, 671, 667, 666, 665, + 664, 663, 662, 661, 660, 659, 658, 657, 656, 655, + 649, 648, 647, 646, 645, 644, 643, 642, 641, 640, + 639, 638, 634, 633, 632, 631, 630, 624, 623, 622, + 621, 620, 619, 618, 617, 616, 615, 614, 613, 606, + 605, 604, 603, 602, 601, 600, 599, 598, 597, 596, + 595, 594, 593, 586, 585, 584, 583, 582, 581, 580, + 579, 578, 577, 576, 575, 574, 571, 570, 569, 568, + 567, 566, 565, 559, 558, 557, 556, 555, 554, 553, + 552, 549, 548, 547, 546, 545, 544, 543, 542, 541, - 539, 538, 537, 531, 530, 529, 528, 527, 526, 525, - 524, 523, 522, 521, 520, 519, 518, 517, 516, 515, - 514, 513, 512, 511, 510, 509, 508, 507, 506, 505, - 504, 503, 502, 501, 500, 499, 498, 497, 496, 495, - 494, 493, 492, 491, 490, 489, 479, 478, 477, 476, - 475, 469, 468, 467, 466, 465, 464, 463, 462, 461, - 460, 459, 458, 457, 456, 455, 454, 453, 452, 451, - 450, 449, 445, 444, 443, 442, 441, 440, 439, 438, - 437, 436, 435, 434, 433, 432, 431, 430, 429, 428, - 427, 426, 425, 424, 423, 422, 421, 420, 419, 418, + 540, 539, 538, 537, 531, 530, 529, 528, 527, 526, + 525, 524, 523, 522, 521, 520, 519, 518, 517, 516, + 515, 514, 513, 512, 511, 510, 509, 508, 507, 506, + 505, 504, 503, 502, 501, 500, 499, 498, 497, 496, + 495, 494, 493, 492, 491, 490, 489, 479, 478, 477, + 476, 475, 469, 468, 467, 466, 465, 464, 463, 462, + 461, 460, 459, 458, 457, 456, 455, 454, 453, 452, + 451, 450, 449, 445, 444, 443, 442, 441, 440, 439, + 438, 437, 436, 435, 434, 433, 432, 431, 430, 429, + 428, 427, 426, 425, 424, 423, 422, 421, 420, 419, - 417, 416, 415, 414, 413, 412, 411, 410, 406, 405, - 404, 403, 402, 401, 400, 399, 395, 391, 390, 389, - 388, 387, 383, 382, 381, 380, 379, 378, 377, 376, - 375, 371, 370, 369, 368, 365, 364, 363, 362, 361, - 360, 359, 358, 354, 353, 352, 351, 350, 347, 346, - 345, 344, 343, 342, 341, 340, 339, 338, 337, 336, - 335, 334, 333, 332, 331, 328, 327, 326, 325, 324, - 323, 322, 321, 320, 319, 318, 314, 313, 312, 311, - 310, 309, 308, 307, 306, 305, 304, 303, 302, 301, - 300, 299, 298, 297, 296, 295, 294, 293, 292, 291, + 418, 417, 416, 415, 414, 413, 412, 411, 410, 406, + 405, 404, 403, 402, 401, 400, 399, 395, 391, 390, + 389, 388, 387, 383, 382, 381, 380, 379, 378, 377, + 376, 375, 371, 370, 369, 368, 365, 364, 363, 362, + 361, 360, 359, 358, 354, 353, 352, 351, 350, 347, + 346, 345, 344, 343, 342, 341, 340, 339, 338, 337, + 336, 335, 334, 333, 332, 331, 328, 327, 326, 325, + 324, 323, 322, 321, 320, 319, 318, 314, 313, 312, + 311, 310, 309, 308, 307, 306, 305, 304, 303, 302, + 301, 300, 299, 298, 297, 296, 295, 294, 293, 292, - 290, 289, 288, 287, 286, 283, 282, 281, 280, 277, - 276, 275, 274, 273, 272, 262, 261, 260, 259, 258, - 257, 254, 253, 252, 245, 244, 243, 242, 241, 236, - 235, 234, 233, 232, 228, 227, 223, 220, 219, 218, - 215, 214, 213, 207, 206, 205, 204, 203, 202, 201, - 200, 195, 194, 193, 192, 191, 190, 189, 188, 184, - 183, 182, 181, 180, 179, 176, 175, 174, 173, 162, - 125, 109, 81, 69, 63, 60, 59, 1007, 57, 57, - 7, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, - 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, + 291, 290, 289, 288, 287, 286, 283, 282, 281, 280, + 277, 276, 275, 274, 273, 272, 262, 261, 260, 259, + 258, 257, 254, 253, 252, 245, 244, 243, 242, 241, + 236, 235, 234, 233, 232, 228, 227, 223, 220, 219, + 218, 215, 214, 213, 207, 206, 205, 204, 203, 202, + 201, 200, 195, 194, 193, 192, 191, 190, 189, 188, + 184, 183, 182, 181, 180, 179, 176, 175, 174, 173, + 162, 125, 109, 81, 69, 63, 60, 59, 1008, 57, + 57, 7, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, + 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, - 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, - 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, - 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, - 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, - 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, - 1007 + 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, + 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, + 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, + 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, + 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, + 1008, 1008 } ; -static yyconst flex_int16_t yy_chk[1452] = +static yyconst flex_int16_t yy_chk[1453] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -930,7 +930,7 @@ static yyconst flex_int16_t yy_chk[1452] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 9, 779, 9, 2, 3, 3, 3, 3, 3, + 2, 9, 781, 9, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, @@ -948,141 +948,141 @@ static yyconst flex_int16_t yy_chk[1452] = 120, 43, 34, 71, 46, 34, 43, 47, 120, 47, 43, 47, 44, 43, 4, 19, 44, 19, 19, 19, 19, 19, 19, 19, 106, 42, 44, 41, 42, 58, - 780, 58, 19, 19, 41, 41, 782, 42, 106, 41, - 124, 783, 19, 19, 42, 41, 41, 124, 41, 46, + 783, 58, 19, 19, 41, 41, 784, 42, 106, 41, + 124, 785, 19, 19, 42, 41, 41, 124, 41, 46, 19, 19, 48, 48, 53, 53, 53, 53, 53, 53, - 53, 68, 68, 70, 70, 19, 784, 135, 19, 20, + 53, 68, 68, 70, 70, 19, 786, 135, 19, 20, 144, 20, 20, 20, 20, 20, 20, 20, 144, 68, 68, 70, 70, 135, 73, 73, 20, 20, 73, 73, 73, 73, 73, 73, 73, 96, 20, 136, 143, 48, - 96, 96, 142, 142, 20, 20, 48, 143, 785, 116, - 48, 136, 116, 116, 786, 48, 116, 126, 116, 20, + 96, 96, 142, 142, 20, 20, 48, 143, 787, 116, + 48, 136, 116, 116, 788, 48, 116, 126, 116, 20, 72, 172, 72, 72, 72, 72, 72, 72, 72, 129, 153, 126, 153, 126, 153, 154, 154, 72, 72, 187, 187, 155, 155, 161, 172, 161, 129, 129, 163, 163, 163, 163, 163, 163, 163, 72, 72, 165, 165, 167, 167, 165, 165, 165, 165, 165, 165, 165, 170, 170, 170, 170, 170, 170, 170, 248, 182, 167, 167, 218, - 218, 218, 154, 230, 248, 537, 787, 230, 155, 154, - 182, 659, 790, 154, 791, 155, 792, 537, 154, 155, + 218, 218, 154, 230, 248, 537, 791, 230, 155, 154, + 182, 660, 496, 154, 792, 155, 496, 537, 154, 155, - 793, 168, 168, 659, 155, 168, 168, 168, 168, 168, + 793, 168, 168, 660, 155, 168, 168, 168, 168, 168, 168, 168, 171, 171, 171, 171, 171, 171, 171, 254, 254, 254, 277, 277, 277, 289, 289, 289, 171, 264, 264, 264, 264, 264, 264, 264, 265, 265, 265, 265, - 265, 265, 265, 298, 298, 298, 171, 681, 681, 266, + 265, 265, 265, 298, 298, 298, 171, 682, 682, 266, 266, 794, 265, 266, 266, 266, 266, 266, 266, 266, 268, 268, 268, 268, 268, 268, 268, 302, 302, 302, 265, 269, 269, 269, 269, 269, 269, 269, 311, 311, 311, 353, 353, 353, 411, 411, 411, 269, 366, 366, 366, 366, 366, 366, 366, 367, 367, 367, 367, 367, - 367, 367, 400, 400, 400, 269, 412, 412, 412, 729, - 729, 367, 795, 400, 400, 413, 413, 413, 796, 469, - 469, 469, 513, 513, 513, 521, 538, 781, 781, 367, + 367, 367, 400, 400, 400, 269, 412, 412, 412, 730, + 730, 367, 795, 400, 400, 413, 413, 413, 796, 469, + 469, 469, 513, 513, 513, 521, 538, 782, 782, 367, 469, 469, 797, 513, 513, 538, 798, 538, 538, 521, - 521, 521, 521, 521, 521, 521, 555, 555, 555, 571, - 571, 799, 800, 801, 802, 572, 572, 555, 555, 803, - 555, 804, 805, 571, 571, 571, 571, 571, 571, 572, - 572, 572, 572, 572, 572, 572, 582, 615, 806, 596, - 596, 596, 620, 620, 620, 582, 615, 582, 615, 571, - 596, 596, 767, 620, 620, 629, 701, 807, 808, 809, + 521, 521, 521, 521, 521, 521, 556, 556, 556, 572, + 572, 799, 800, 801, 802, 573, 573, 556, 556, 803, + 556, 804, 805, 572, 572, 572, 572, 572, 572, 573, + 573, 573, 573, 573, 573, 573, 583, 616, 806, 597, + 597, 597, 621, 621, 621, 583, 616, 583, 616, 572, + 597, 597, 768, 621, 621, 630, 702, 807, 808, 809, - 810, 624, 624, 811, 767, 701, 812, 701, 626, 626, - 813, 814, 815, 816, 571, 624, 624, 624, 624, 624, - 624, 624, 626, 626, 626, 626, 626, 626, 628, 628, - 817, 820, 629, 821, 822, 823, 824, 825, 826, 827, - 828, 629, 628, 628, 628, 628, 628, 628, 628, 660, - 679, 679, 629, 829, 832, 833, 680, 680, 660, 834, - 660, 660, 836, 837, 679, 679, 679, 679, 679, 679, - 680, 680, 680, 680, 680, 680, 680, 724, 731, 731, - 839, 840, 841, 842, 733, 733, 724, 843, 724, 844, - 679, 845, 731, 731, 731, 731, 731, 731, 733, 733, + 810, 625, 625, 811, 768, 702, 812, 702, 627, 627, + 813, 814, 815, 816, 572, 625, 625, 625, 625, 625, + 625, 625, 627, 627, 627, 627, 627, 627, 629, 629, + 817, 818, 630, 821, 822, 823, 824, 825, 826, 827, + 828, 630, 629, 629, 629, 629, 629, 629, 629, 661, + 680, 680, 630, 829, 830, 833, 681, 681, 661, 834, + 661, 661, 835, 837, 680, 680, 680, 680, 680, 680, + 681, 681, 681, 681, 681, 681, 681, 725, 732, 732, + 838, 840, 841, 842, 734, 734, 725, 843, 725, 844, + 680, 845, 732, 732, 732, 732, 732, 732, 734, 734, - 733, 733, 733, 733, 733, 847, 848, 849, 850, 851, - 852, 855, 856, 857, 860, 679, 861, 862, 863, 864, + 734, 734, 734, 734, 734, 846, 848, 849, 850, 851, + 852, 853, 856, 857, 858, 680, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, - 877, 869, 878, 879, 882, 883, 884, 885, 886, 887, - 888, 889, 890, 891, 892, 893, 894, 895, 896, 899, - 900, 901, 902, 903, 906, 907, 910, 911, 901, 912, - 914, 915, 916, 918, 919, 920, 925, 926, 927, 928, - 929, 930, 931, 932, 933, 934, 935, 936, 929, 938, - 939, 940, 941, 942, 943, 944, 945, 946, 948, 947, - 949, 952, 953, 954, 955, 946, 947, 957, 960, 961, + 875, 878, 870, 879, 880, 883, 884, 885, 886, 887, + 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, + 900, 901, 902, 903, 904, 907, 908, 911, 912, 902, + 913, 915, 916, 917, 919, 920, 921, 926, 927, 928, + 929, 930, 931, 932, 933, 934, 935, 936, 937, 930, + 939, 940, 941, 942, 943, 944, 945, 946, 947, 949, + 948, 950, 953, 954, 955, 956, 947, 948, 958, 961, - 962, 900, 965, 964, 968, 969, 970, 961, 962, 902, - 964, 971, 973, 974, 976, 977, 978, 979, 981, 982, - 983, 974, 984, 977, 987, 988, 928, 989, 990, 992, - 984, 993, 994, 997, 998, 989, 990, 999, 1000, 1001, - 994, 998, 1002, 1003, 999, 1004, 1005, 1012, 1013, 778, - 777, 776, 775, 1004, 1005, 774, 773, 772, 771, 965, - 770, 769, 768, 766, 765, 764, 763, 762, 761, 760, - 759, 976, 758, 757, 756, 755, 754, 753, 752, 751, - 749, 1000, 1001, 1008, 1008, 1008, 1008, 1008, 1009, 1009, - 1009, 1009, 1009, 1010, 1010, 1010, 1011, 1011, 1011, 1014, + 962, 963, 901, 966, 965, 969, 970, 971, 962, 963, + 903, 965, 972, 974, 975, 977, 978, 979, 980, 982, + 983, 984, 975, 985, 978, 988, 989, 929, 990, 991, + 993, 985, 994, 995, 998, 999, 990, 991, 1000, 1001, + 1002, 995, 999, 1003, 1004, 1000, 1005, 1006, 1013, 1014, + 780, 779, 778, 777, 1005, 1006, 776, 775, 774, 773, + 966, 772, 771, 770, 769, 767, 766, 765, 764, 763, + 762, 761, 977, 760, 759, 758, 757, 756, 755, 754, + 753, 752, 1001, 1002, 1009, 1009, 1009, 1009, 1009, 1010, + 1010, 1010, 1010, 1010, 1011, 1011, 1011, 1012, 1012, 1012, - 1014, 1015, 747, 1015, 1015, 1015, 1016, 1016, 1017, 1017, - 746, 745, 744, 743, 742, 741, 740, 739, 738, 736, - 735, 734, 727, 726, 723, 722, 721, 720, 719, 718, - 717, 715, 714, 713, 712, 711, 710, 709, 708, 707, - 706, 705, 704, 703, 700, 699, 698, 697, 696, 695, - 694, 693, 692, 691, 690, 689, 688, 687, 686, 685, - 684, 683, 682, 678, 676, 675, 674, 673, 672, 671, - 670, 669, 668, 667, 666, 665, 664, 663, 662, 661, - 655, 653, 652, 651, 650, 649, 646, 645, 644, 643, - 642, 641, 640, 639, 638, 637, 636, 635, 634, 633, + 1015, 1015, 1016, 750, 1016, 1016, 1016, 1017, 1017, 1018, + 1018, 748, 747, 746, 745, 744, 743, 742, 741, 740, + 739, 737, 736, 735, 728, 727, 724, 723, 722, 721, + 720, 719, 718, 716, 715, 714, 713, 712, 711, 710, + 709, 708, 707, 706, 705, 704, 701, 700, 699, 698, + 697, 696, 695, 694, 693, 692, 691, 690, 689, 688, + 687, 686, 685, 684, 683, 679, 677, 676, 675, 674, + 673, 672, 671, 670, 669, 668, 667, 666, 665, 664, + 663, 662, 656, 654, 653, 652, 651, 650, 647, 646, + 645, 644, 643, 642, 641, 640, 639, 638, 637, 636, - 631, 623, 622, 618, 617, 614, 612, 611, 610, 609, - 608, 607, 606, 605, 601, 600, 599, 597, 595, 594, - 593, 592, 591, 590, 589, 588, 587, 586, 585, 584, - 581, 576, 575, 574, 573, 570, 569, 568, 566, 565, - 563, 562, 561, 560, 559, 557, 556, 554, 553, 552, - 551, 550, 549, 548, 547, 546, 544, 543, 542, 541, - 540, 536, 535, 534, 533, 532, 531, 528, 527, 526, - 525, 524, 523, 522, 520, 519, 518, 517, 516, 515, - 514, 512, 511, 508, 503, 502, 500, 499, 498, 496, - 495, 492, 491, 490, 489, 478, 477, 476, 474, 473, + 635, 634, 632, 624, 623, 619, 618, 615, 613, 612, + 611, 610, 609, 608, 607, 606, 602, 601, 600, 598, + 596, 595, 594, 593, 592, 591, 590, 589, 588, 587, + 586, 585, 582, 577, 576, 575, 574, 571, 570, 569, + 567, 566, 564, 563, 562, 561, 560, 558, 557, 555, + 554, 553, 552, 551, 549, 548, 547, 546, 544, 543, + 542, 541, 540, 536, 535, 534, 533, 532, 531, 528, + 527, 526, 525, 524, 523, 522, 520, 519, 518, 517, + 516, 515, 514, 512, 511, 508, 503, 502, 500, 499, + 498, 495, 492, 491, 490, 489, 478, 477, 476, 474, - 472, 471, 470, 467, 465, 464, 463, 461, 460, 459, - 458, 456, 455, 454, 453, 452, 450, 449, 444, 443, - 441, 440, 439, 438, 437, 436, 435, 434, 433, 432, - 431, 429, 428, 427, 426, 425, 424, 423, 422, 420, - 419, 418, 417, 416, 415, 414, 410, 406, 405, 404, - 401, 399, 389, 387, 383, 382, 381, 380, 378, 377, - 375, 370, 369, 368, 365, 364, 363, 362, 361, 360, - 359, 354, 352, 351, 350, 349, 348, 346, 345, 342, - 341, 340, 339, 338, 337, 336, 335, 334, 333, 332, - 331, 330, 329, 328, 327, 326, 325, 324, 323, 322, + 473, 472, 471, 470, 467, 465, 464, 463, 461, 460, + 459, 458, 456, 455, 454, 453, 452, 450, 449, 444, + 443, 441, 440, 439, 438, 437, 436, 435, 434, 433, + 432, 431, 429, 428, 427, 426, 425, 424, 423, 422, + 420, 419, 418, 417, 416, 415, 414, 410, 406, 405, + 404, 401, 399, 389, 387, 383, 382, 381, 380, 378, + 377, 375, 370, 369, 368, 365, 364, 363, 362, 361, + 360, 359, 354, 352, 351, 350, 349, 348, 346, 345, + 342, 341, 340, 339, 338, 337, 336, 335, 334, 333, + 332, 331, 330, 329, 328, 327, 326, 325, 324, 323, - 321, 320, 319, 318, 317, 316, 315, 312, 310, 309, - 308, 307, 306, 305, 304, 303, 301, 297, 295, 294, - 293, 292, 288, 287, 286, 285, 284, 283, 282, 281, - 280, 276, 274, 273, 272, 262, 261, 260, 259, 258, - 257, 256, 255, 253, 252, 251, 250, 249, 247, 246, - 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, - 235, 234, 233, 232, 231, 229, 228, 227, 226, 225, - 224, 223, 222, 221, 220, 219, 217, 216, 215, 214, - 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, - 203, 202, 201, 199, 198, 197, 196, 195, 194, 193, + 322, 321, 320, 319, 318, 317, 316, 315, 312, 310, + 309, 308, 307, 306, 305, 304, 303, 301, 297, 295, + 294, 293, 292, 288, 287, 286, 285, 284, 283, 282, + 281, 280, 276, 274, 273, 272, 262, 261, 260, 259, + 258, 257, 256, 255, 253, 252, 251, 250, 249, 247, + 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, + 236, 235, 234, 233, 232, 231, 229, 228, 227, 226, + 225, 224, 223, 222, 221, 220, 219, 217, 216, 215, + 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, + 204, 203, 202, 201, 199, 198, 197, 196, 195, 194, - 192, 191, 190, 189, 188, 186, 185, 184, 183, 181, - 180, 179, 178, 177, 175, 160, 159, 158, 157, 150, - 149, 147, 146, 145, 141, 140, 139, 138, 137, 134, - 133, 132, 131, 130, 128, 127, 125, 123, 122, 121, - 119, 118, 117, 115, 114, 112, 111, 110, 109, 108, - 107, 104, 103, 102, 101, 100, 99, 98, 97, 95, - 94, 93, 92, 91, 90, 88, 87, 83, 79, 52, - 38, 32, 22, 18, 14, 12, 11, 7, 6, 5, - 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, - 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, + 193, 192, 191, 190, 189, 188, 186, 185, 184, 183, + 181, 180, 179, 178, 177, 175, 160, 159, 158, 157, + 150, 149, 147, 146, 145, 141, 140, 139, 138, 137, + 134, 133, 132, 131, 130, 128, 127, 125, 123, 122, + 121, 119, 118, 117, 115, 114, 112, 111, 110, 109, + 108, 107, 104, 103, 102, 101, 100, 99, 98, 97, + 95, 94, 93, 92, 91, 90, 88, 87, 83, 79, + 52, 38, 32, 22, 18, 14, 12, 11, 7, 6, + 5, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, + 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, - 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, - 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, - 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, - 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, - 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, - 1007 + 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, + 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, + 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, + 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, + 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, + 1008, 1008 } ; /* The intent behind this definition is that it'll catch @@ -1139,8 +1139,9 @@ static int classify_identifier(struct _mesa_glsl_parse_state *, const char *); do { \ yylloc->source = 0; \ yylloc->first_column = yycolumn + 1; \ - yylloc->first_line = yylineno + 1; \ + yylloc->first_line = yylloc->last_line = yylineno + 1; \ yycolumn += yyleng; \ + yylloc->last_column = yycolumn + 1; \ } while(0); #define YY_USER_INIT yylineno = 0; yycolumn = 0; @@ -1181,7 +1182,8 @@ static int classify_identifier(struct _mesa_glsl_parse_state *, const char *); "illegal use of reserved word `%s'", yytext); \ return ERROR_TOK; \ } else { \ - yylval->identifier = strdup(yytext); \ + void *mem_ctx = yyextra; \ + yylval->identifier = ralloc_strdup(mem_ctx, yytext); \ return classify_identifier(yyextra, yytext); \ } \ } while (0) @@ -1245,8 +1247,11 @@ literal_integer(char *text, int len, struct _mesa_glsl_parse_state *state, #define LITERAL_INTEGER(base) \ literal_integer(yytext, yyleng, yyextra, yylval, yylloc, base) +/* Note: When adding any start conditions to this list, you must also +* update the "Internal compiler error" catch-all rule near the end of +* this file. */ -#line 1250 "src/glsl/glsl_lexer.cpp" +#line 1255 "src/glsl/glsl_lexer.cpp" #define INITIAL 0 #define PP 1 @@ -1485,10 +1490,10 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 170 "src/glsl/glsl_lexer.ll" +#line 176 "src/glsl/glsl_lexer.ll" -#line 1492 "src/glsl/glsl_lexer.cpp" +#line 1497 "src/glsl/glsl_lexer.cpp" yylval = yylval_param; @@ -1546,13 +1551,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1008 ) + if ( yy_current_state >= 1009 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_current_state != 1007 ); + while ( yy_current_state != 1008 ); yy_cp = yyg->yy_last_accepting_cpos; yy_current_state = yyg->yy_last_accepting_state; @@ -1574,7 +1579,7 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 172 "src/glsl/glsl_lexer.ll" +#line 178 "src/glsl/glsl_lexer.ll" ; YY_BREAK /* Preprocessor tokens. */ @@ -1583,17 +1588,17 @@ case 2: yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 175 "src/glsl/glsl_lexer.ll" +#line 181 "src/glsl/glsl_lexer.ll" ; YY_BREAK case 3: YY_RULE_SETUP -#line 176 "src/glsl/glsl_lexer.ll" +#line 182 "src/glsl/glsl_lexer.ll" { BEGIN PP; return VERSION_TOK; } YY_BREAK case 4: YY_RULE_SETUP -#line 177 "src/glsl/glsl_lexer.ll" +#line 183 "src/glsl/glsl_lexer.ll" { BEGIN PP; return EXTENSION; } YY_BREAK case 5: @@ -1601,7 +1606,7 @@ case 5: yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 178 "src/glsl/glsl_lexer.ll" +#line 184 "src/glsl/glsl_lexer.ll" { /* Eat characters until the first digit is * encountered @@ -1623,7 +1628,7 @@ case 6: yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 193 "src/glsl/glsl_lexer.ll" +#line 199 "src/glsl/glsl_lexer.ll" { /* Eat characters until the first digit is * encountered @@ -1641,7 +1646,7 @@ YY_RULE_SETUP YY_BREAK case 7: YY_RULE_SETUP -#line 207 "src/glsl/glsl_lexer.ll" +#line 213 "src/glsl/glsl_lexer.ll" { BEGIN PP; return PRAGMA_DEBUG_ON; @@ -1649,7 +1654,7 @@ YY_RULE_SETUP YY_BREAK case 8: YY_RULE_SETUP -#line 211 "src/glsl/glsl_lexer.ll" +#line 217 "src/glsl/glsl_lexer.ll" { BEGIN PP; return PRAGMA_DEBUG_OFF; @@ -1657,7 +1662,7 @@ YY_RULE_SETUP YY_BREAK case 9: YY_RULE_SETUP -#line 215 "src/glsl/glsl_lexer.ll" +#line 221 "src/glsl/glsl_lexer.ll" { BEGIN PP; return PRAGMA_OPTIMIZE_ON; @@ -1665,7 +1670,7 @@ YY_RULE_SETUP YY_BREAK case 10: YY_RULE_SETUP -#line 219 "src/glsl/glsl_lexer.ll" +#line 225 "src/glsl/glsl_lexer.ll" { BEGIN PP; return PRAGMA_OPTIMIZE_OFF; @@ -1673,7 +1678,7 @@ YY_RULE_SETUP YY_BREAK case 11: YY_RULE_SETUP -#line 223 "src/glsl/glsl_lexer.ll" +#line 229 "src/glsl/glsl_lexer.ll" { BEGIN PP; return PRAGMA_INVARIANT_ALL; @@ -1681,46 +1686,47 @@ YY_RULE_SETUP YY_BREAK case 12: YY_RULE_SETUP -#line 227 "src/glsl/glsl_lexer.ll" +#line 233 "src/glsl/glsl_lexer.ll" { BEGIN PRAGMA; } YY_BREAK case 13: /* rule 13 can match eol */ YY_RULE_SETUP -#line 229 "src/glsl/glsl_lexer.ll" +#line 235 "src/glsl/glsl_lexer.ll" { BEGIN 0; yylineno++; yycolumn = 0; } YY_BREAK case 14: YY_RULE_SETUP -#line 230 "src/glsl/glsl_lexer.ll" +#line 236 "src/glsl/glsl_lexer.ll" { } YY_BREAK case 15: YY_RULE_SETUP -#line 232 "src/glsl/glsl_lexer.ll" +#line 238 "src/glsl/glsl_lexer.ll" { } YY_BREAK case 16: YY_RULE_SETUP -#line 233 "src/glsl/glsl_lexer.ll" +#line 239 "src/glsl/glsl_lexer.ll" { } YY_BREAK case 17: YY_RULE_SETUP -#line 234 "src/glsl/glsl_lexer.ll" +#line 240 "src/glsl/glsl_lexer.ll" return COLON; YY_BREAK case 18: YY_RULE_SETUP -#line 235 "src/glsl/glsl_lexer.ll" +#line 241 "src/glsl/glsl_lexer.ll" { - yylval->identifier = strdup(yytext); + void *mem_ctx = yyextra; + yylval->identifier = ralloc_strdup(mem_ctx, yytext); return IDENTIFIER; } YY_BREAK case 19: YY_RULE_SETUP -#line 239 "src/glsl/glsl_lexer.ll" +#line 246 "src/glsl/glsl_lexer.ll" { yylval->n = strtol(yytext, NULL, 10); return INTCONSTANT; @@ -1729,431 +1735,436 @@ YY_RULE_SETUP case 20: /* rule 20 can match eol */ YY_RULE_SETUP -#line 243 "src/glsl/glsl_lexer.ll" +#line 250 "src/glsl/glsl_lexer.ll" { BEGIN 0; yylineno++; yycolumn = 0; return EOL; } YY_BREAK case 21: -/* rule 21 can match eol */ YY_RULE_SETUP -#line 245 "src/glsl/glsl_lexer.ll" -{ yylineno++; yycolumn = 0; } +#line 251 "src/glsl/glsl_lexer.ll" +{ return yytext[0]; } YY_BREAK case 22: +/* rule 22 can match eol */ YY_RULE_SETUP -#line 247 "src/glsl/glsl_lexer.ll" -DEPRECATED_ES_KEYWORD(ATTRIBUTE); +#line 253 "src/glsl/glsl_lexer.ll" +{ yylineno++; yycolumn = 0; } YY_BREAK case 23: YY_RULE_SETUP -#line 248 "src/glsl/glsl_lexer.ll" -return CONST_TOK; +#line 255 "src/glsl/glsl_lexer.ll" +DEPRECATED_ES_KEYWORD(ATTRIBUTE); YY_BREAK case 24: YY_RULE_SETUP -#line 249 "src/glsl/glsl_lexer.ll" -return BOOL_TOK; +#line 256 "src/glsl/glsl_lexer.ll" +return CONST_TOK; YY_BREAK case 25: YY_RULE_SETUP -#line 250 "src/glsl/glsl_lexer.ll" -return FLOAT_TOK; +#line 257 "src/glsl/glsl_lexer.ll" +return BOOL_TOK; YY_BREAK case 26: YY_RULE_SETUP -#line 251 "src/glsl/glsl_lexer.ll" -return INT_TOK; +#line 258 "src/glsl/glsl_lexer.ll" +return FLOAT_TOK; YY_BREAK case 27: YY_RULE_SETUP -#line 252 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 130, 300, UINT_TOK); +#line 259 "src/glsl/glsl_lexer.ll" +return INT_TOK; YY_BREAK case 28: YY_RULE_SETUP -#line 254 "src/glsl/glsl_lexer.ll" -return BREAK; +#line 260 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, UINT_TOK); YY_BREAK case 29: YY_RULE_SETUP -#line 255 "src/glsl/glsl_lexer.ll" -return CONTINUE; +#line 262 "src/glsl/glsl_lexer.ll" +return BREAK; YY_BREAK case 30: YY_RULE_SETUP -#line 256 "src/glsl/glsl_lexer.ll" -return DO; +#line 263 "src/glsl/glsl_lexer.ll" +return CONTINUE; YY_BREAK case 31: YY_RULE_SETUP -#line 257 "src/glsl/glsl_lexer.ll" -return WHILE; +#line 264 "src/glsl/glsl_lexer.ll" +return DO; YY_BREAK case 32: YY_RULE_SETUP -#line 258 "src/glsl/glsl_lexer.ll" -return ELSE; +#line 265 "src/glsl/glsl_lexer.ll" +return WHILE; YY_BREAK case 33: YY_RULE_SETUP -#line 259 "src/glsl/glsl_lexer.ll" -return FOR; +#line 266 "src/glsl/glsl_lexer.ll" +return ELSE; YY_BREAK case 34: YY_RULE_SETUP -#line 260 "src/glsl/glsl_lexer.ll" -return IF; +#line 267 "src/glsl/glsl_lexer.ll" +return FOR; YY_BREAK case 35: YY_RULE_SETUP -#line 261 "src/glsl/glsl_lexer.ll" -return DISCARD; +#line 268 "src/glsl/glsl_lexer.ll" +return IF; YY_BREAK case 36: YY_RULE_SETUP -#line 262 "src/glsl/glsl_lexer.ll" -return RETURN; +#line 269 "src/glsl/glsl_lexer.ll" +return DISCARD; YY_BREAK case 37: YY_RULE_SETUP -#line 264 "src/glsl/glsl_lexer.ll" -return BVEC2; +#line 270 "src/glsl/glsl_lexer.ll" +return RETURN; YY_BREAK case 38: YY_RULE_SETUP -#line 265 "src/glsl/glsl_lexer.ll" -return BVEC3; +#line 272 "src/glsl/glsl_lexer.ll" +return BVEC2; YY_BREAK case 39: YY_RULE_SETUP -#line 266 "src/glsl/glsl_lexer.ll" -return BVEC4; +#line 273 "src/glsl/glsl_lexer.ll" +return BVEC3; YY_BREAK case 40: YY_RULE_SETUP -#line 267 "src/glsl/glsl_lexer.ll" -return IVEC2; +#line 274 "src/glsl/glsl_lexer.ll" +return BVEC4; YY_BREAK case 41: YY_RULE_SETUP -#line 268 "src/glsl/glsl_lexer.ll" -return IVEC3; +#line 275 "src/glsl/glsl_lexer.ll" +return IVEC2; YY_BREAK case 42: YY_RULE_SETUP -#line 269 "src/glsl/glsl_lexer.ll" -return IVEC4; +#line 276 "src/glsl/glsl_lexer.ll" +return IVEC3; YY_BREAK case 43: YY_RULE_SETUP -#line 270 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 130, 300, UVEC2); +#line 277 "src/glsl/glsl_lexer.ll" +return IVEC4; YY_BREAK case 44: YY_RULE_SETUP -#line 271 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 130, 300, UVEC3); +#line 278 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, UVEC2); YY_BREAK case 45: YY_RULE_SETUP -#line 272 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 130, 300, UVEC4); +#line 279 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, UVEC3); YY_BREAK case 46: YY_RULE_SETUP -#line 273 "src/glsl/glsl_lexer.ll" -return VEC2; +#line 280 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, UVEC4); YY_BREAK case 47: YY_RULE_SETUP -#line 274 "src/glsl/glsl_lexer.ll" -return VEC3; +#line 281 "src/glsl/glsl_lexer.ll" +return VEC2; YY_BREAK case 48: YY_RULE_SETUP -#line 275 "src/glsl/glsl_lexer.ll" -return VEC4; +#line 282 "src/glsl/glsl_lexer.ll" +return VEC3; YY_BREAK case 49: YY_RULE_SETUP -#line 276 "src/glsl/glsl_lexer.ll" -return MAT2X2; +#line 283 "src/glsl/glsl_lexer.ll" +return VEC4; YY_BREAK case 50: YY_RULE_SETUP -#line 277 "src/glsl/glsl_lexer.ll" -return MAT3X3; +#line 284 "src/glsl/glsl_lexer.ll" +return MAT2X2; YY_BREAK case 51: YY_RULE_SETUP -#line 278 "src/glsl/glsl_lexer.ll" -return MAT4X4; +#line 285 "src/glsl/glsl_lexer.ll" +return MAT3X3; YY_BREAK case 52: YY_RULE_SETUP -#line 279 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 300, 120, 300, MAT2X2); +#line 286 "src/glsl/glsl_lexer.ll" +return MAT4X4; YY_BREAK case 53: YY_RULE_SETUP -#line 280 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 300, 120, 300, MAT2X3); +#line 287 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 300, 120, 300, MAT2X2); YY_BREAK case 54: YY_RULE_SETUP -#line 281 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 300, 120, 300, MAT2X4); +#line 288 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 300, 120, 300, MAT2X3); YY_BREAK case 55: YY_RULE_SETUP -#line 282 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 300, 120, 300, MAT3X2); +#line 289 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 300, 120, 300, MAT2X4); YY_BREAK case 56: YY_RULE_SETUP -#line 283 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 300, 120, 300, MAT3X3); +#line 290 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 300, 120, 300, MAT3X2); YY_BREAK case 57: YY_RULE_SETUP -#line 284 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 300, 120, 300, MAT3X4); +#line 291 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 300, 120, 300, MAT3X3); YY_BREAK case 58: YY_RULE_SETUP -#line 285 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 300, 120, 300, MAT4X2); +#line 292 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 300, 120, 300, MAT3X4); YY_BREAK case 59: YY_RULE_SETUP -#line 286 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 300, 120, 300, MAT4X3); +#line 293 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 300, 120, 300, MAT4X2); YY_BREAK case 60: YY_RULE_SETUP -#line 287 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 300, 120, 300, MAT4X4); +#line 294 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 300, 120, 300, MAT4X3); YY_BREAK case 61: YY_RULE_SETUP -#line 289 "src/glsl/glsl_lexer.ll" -return IN_TOK; +#line 295 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 300, 120, 300, MAT4X4); YY_BREAK case 62: YY_RULE_SETUP -#line 290 "src/glsl/glsl_lexer.ll" -return OUT_TOK; +#line 297 "src/glsl/glsl_lexer.ll" +return IN_TOK; YY_BREAK case 63: YY_RULE_SETUP -#line 291 "src/glsl/glsl_lexer.ll" -return INOUT_TOK; +#line 298 "src/glsl/glsl_lexer.ll" +return OUT_TOK; YY_BREAK case 64: YY_RULE_SETUP -#line 292 "src/glsl/glsl_lexer.ll" -return UNIFORM; +#line 299 "src/glsl/glsl_lexer.ll" +return INOUT_TOK; YY_BREAK case 65: YY_RULE_SETUP -#line 293 "src/glsl/glsl_lexer.ll" -DEPRECATED_ES_KEYWORD(VARYING); +#line 300 "src/glsl/glsl_lexer.ll" +return UNIFORM; YY_BREAK case 66: YY_RULE_SETUP -#line 294 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 100, 120, 100, CENTROID); +#line 301 "src/glsl/glsl_lexer.ll" +DEPRECATED_ES_KEYWORD(VARYING); YY_BREAK case 67: YY_RULE_SETUP -#line 295 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 100, 120, 100, INVARIANT); +#line 302 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 300, 120, 300, CENTROID); YY_BREAK case 68: YY_RULE_SETUP -#line 296 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 100, 120, 100, FLAT); +#line 303 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 100, 120, 100, INVARIANT); YY_BREAK case 69: YY_RULE_SETUP -#line 297 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 100, 120, 100, SMOOTH); +#line 304 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 100, 130, 300, FLAT); YY_BREAK case 70: YY_RULE_SETUP -#line 298 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 100, 120, 100, NOPERSPECTIVE); +#line 305 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, SMOOTH); YY_BREAK case 71: YY_RULE_SETUP -#line 300 "src/glsl/glsl_lexer.ll" -DEPRECATED_ES_KEYWORD(SAMPLER1D); +#line 306 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 0, NOPERSPECTIVE); YY_BREAK case 72: YY_RULE_SETUP -#line 301 "src/glsl/glsl_lexer.ll" -return SAMPLER2D; +#line 308 "src/glsl/glsl_lexer.ll" +DEPRECATED_ES_KEYWORD(SAMPLER1D); YY_BREAK case 73: YY_RULE_SETUP -#line 302 "src/glsl/glsl_lexer.ll" -return SAMPLER3D; +#line 309 "src/glsl/glsl_lexer.ll" +return SAMPLER2D; YY_BREAK case 74: YY_RULE_SETUP -#line 303 "src/glsl/glsl_lexer.ll" -return SAMPLERCUBE; +#line 310 "src/glsl/glsl_lexer.ll" +return SAMPLER3D; YY_BREAK case 75: YY_RULE_SETUP -#line 304 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 130, 0, SAMPLER1DARRAY); +#line 311 "src/glsl/glsl_lexer.ll" +return SAMPLERCUBE; YY_BREAK case 76: YY_RULE_SETUP -#line 305 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 130, 300, SAMPLER2DARRAY); +#line 312 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 0, SAMPLER1DARRAY); YY_BREAK case 77: YY_RULE_SETUP -#line 306 "src/glsl/glsl_lexer.ll" -DEPRECATED_ES_KEYWORD(SAMPLER1DSHADOW); +#line 313 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, SAMPLER2DARRAY); YY_BREAK case 78: YY_RULE_SETUP -#line 307 "src/glsl/glsl_lexer.ll" -return SAMPLER2DSHADOW; +#line 314 "src/glsl/glsl_lexer.ll" +DEPRECATED_ES_KEYWORD(SAMPLER1DSHADOW); YY_BREAK case 79: YY_RULE_SETUP -#line 308 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 130, 300, SAMPLERCUBESHADOW); +#line 315 "src/glsl/glsl_lexer.ll" +return SAMPLER2DSHADOW; YY_BREAK case 80: YY_RULE_SETUP -#line 309 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 130, 0, SAMPLER1DARRAYSHADOW); +#line 316 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, SAMPLERCUBESHADOW); YY_BREAK case 81: YY_RULE_SETUP -#line 310 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 130, 300, SAMPLER2DARRAYSHADOW); +#line 317 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 0, SAMPLER1DARRAYSHADOW); YY_BREAK case 82: YY_RULE_SETUP -#line 311 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 130, 0, ISAMPLER1D); +#line 318 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, SAMPLER2DARRAYSHADOW); YY_BREAK case 83: YY_RULE_SETUP -#line 312 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 130, 300, ISAMPLER2D); +#line 319 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 0, ISAMPLER1D); YY_BREAK case 84: YY_RULE_SETUP -#line 313 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 130, 300, ISAMPLER3D); +#line 320 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, ISAMPLER2D); YY_BREAK case 85: YY_RULE_SETUP -#line 314 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 130, 300, ISAMPLERCUBE); +#line 321 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, ISAMPLER3D); YY_BREAK case 86: YY_RULE_SETUP -#line 315 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 130, 0, ISAMPLER1DARRAY); +#line 322 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, ISAMPLERCUBE); YY_BREAK case 87: YY_RULE_SETUP -#line 316 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 130, 300, ISAMPLER2DARRAY); +#line 323 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 0, ISAMPLER1DARRAY); YY_BREAK case 88: YY_RULE_SETUP -#line 317 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 130, 0, USAMPLER1D); +#line 324 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, ISAMPLER2DARRAY); YY_BREAK case 89: YY_RULE_SETUP -#line 318 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 130, 300, USAMPLER2D); +#line 325 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 0, USAMPLER1D); YY_BREAK case 90: YY_RULE_SETUP -#line 319 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 130, 300, USAMPLER3D); +#line 326 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, USAMPLER2D); YY_BREAK case 91: YY_RULE_SETUP -#line 320 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 130, 300, USAMPLERCUBE); +#line 327 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, USAMPLER3D); YY_BREAK case 92: YY_RULE_SETUP -#line 321 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 130, 0, USAMPLER1DARRAY); +#line 328 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, USAMPLERCUBE); YY_BREAK case 93: YY_RULE_SETUP -#line 322 "src/glsl/glsl_lexer.ll" +#line 329 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 0, USAMPLER1DARRAY); + YY_BREAK +case 94: +YY_RULE_SETUP +#line 330 "src/glsl/glsl_lexer.ll" KEYWORD(130, 300, 130, 300, USAMPLER2DARRAY); YY_BREAK /* additional keywords in ARB_texture_multisample, included in GLSL 1.50 */ /* these are reserved but not defined in GLSL 3.00 */ -case 94: -YY_RULE_SETUP -#line 326 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, SAMPLER2DMS); - YY_BREAK case 95: YY_RULE_SETUP -#line 327 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, ISAMPLER2DMS); +#line 334 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, SAMPLER2DMS); YY_BREAK case 96: YY_RULE_SETUP -#line 328 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, USAMPLER2DMS); +#line 335 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, ISAMPLER2DMS); YY_BREAK case 97: YY_RULE_SETUP -#line 329 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, SAMPLER2DMSARRAY); +#line 336 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, USAMPLER2DMS); YY_BREAK case 98: YY_RULE_SETUP -#line 330 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, ISAMPLER2DMSARRAY); +#line 337 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, SAMPLER2DMSARRAY); YY_BREAK case 99: YY_RULE_SETUP -#line 331 "src/glsl/glsl_lexer.ll" +#line 338 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, ISAMPLER2DMSARRAY); + YY_BREAK +case 100: +YY_RULE_SETUP +#line 339 "src/glsl/glsl_lexer.ll" KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, USAMPLER2DMSARRAY); YY_BREAK /* keywords available with ARB_texture_cube_map_array_enable extension on desktop GLSL */ -case 100: -YY_RULE_SETUP -#line 334 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, SAMPLERCUBEARRAY); - YY_BREAK case 101: YY_RULE_SETUP -#line 335 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, ISAMPLERCUBEARRAY); +#line 342 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, SAMPLERCUBEARRAY); YY_BREAK case 102: YY_RULE_SETUP -#line 336 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, USAMPLERCUBEARRAY); +#line 343 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, ISAMPLERCUBEARRAY); YY_BREAK case 103: YY_RULE_SETUP -#line 337 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, SAMPLERCUBEARRAYSHADOW); +#line 344 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, USAMPLERCUBEARRAY); YY_BREAK case 104: YY_RULE_SETUP -#line 339 "src/glsl/glsl_lexer.ll" +#line 345 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, SAMPLERCUBEARRAYSHADOW); + YY_BREAK +case 105: +YY_RULE_SETUP +#line 347 "src/glsl/glsl_lexer.ll" { if (yyextra->OES_EGL_image_external_enable) return SAMPLEREXTERNALOES; @@ -2161,396 +2172,389 @@ YY_RULE_SETUP return IDENTIFIER; } YY_BREAK -/* keywords available with ARB_shader_image_load_store */ -case 105: -YY_RULE_SETUP -#line 347 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE1D); - YY_BREAK +/* keywords available with ARB_gpu_shader5 */ case 106: YY_RULE_SETUP -#line 348 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2D); +#line 355 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_gpu_shader5_enable, PRECISE); YY_BREAK +/* keywords available with ARB_shader_image_load_store */ case 107: YY_RULE_SETUP -#line 349 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE3D); +#line 358 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE1D); YY_BREAK case 108: YY_RULE_SETUP -#line 350 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2DRECT); +#line 359 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2D); YY_BREAK case 109: YY_RULE_SETUP -#line 351 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGECUBE); +#line 360 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE3D); YY_BREAK case 110: YY_RULE_SETUP -#line 352 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGEBUFFER); +#line 361 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2DRECT); YY_BREAK case 111: YY_RULE_SETUP -#line 353 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE1DARRAY); +#line 362 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGECUBE); YY_BREAK case 112: YY_RULE_SETUP -#line 354 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2DARRAY); +#line 363 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGEBUFFER); YY_BREAK case 113: YY_RULE_SETUP -#line 355 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGECUBEARRAY); +#line 364 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE1DARRAY); YY_BREAK case 114: YY_RULE_SETUP -#line 356 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2DMS); +#line 365 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2DARRAY); YY_BREAK case 115: YY_RULE_SETUP -#line 357 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2DMSARRAY); +#line 366 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGECUBEARRAY); YY_BREAK case 116: YY_RULE_SETUP -#line 358 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE1D); +#line 367 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2DMS); YY_BREAK case 117: YY_RULE_SETUP -#line 359 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE2D); +#line 368 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2DMSARRAY); YY_BREAK case 118: YY_RULE_SETUP -#line 360 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE3D); +#line 369 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE1D); YY_BREAK case 119: YY_RULE_SETUP -#line 361 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE2DRECT); +#line 370 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE2D); YY_BREAK case 120: YY_RULE_SETUP -#line 362 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGECUBE); +#line 371 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE3D); YY_BREAK case 121: YY_RULE_SETUP -#line 363 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGEBUFFER); +#line 372 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE2DRECT); YY_BREAK case 122: YY_RULE_SETUP -#line 364 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE1DARRAY); +#line 373 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGECUBE); YY_BREAK case 123: YY_RULE_SETUP -#line 365 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE2DARRAY); +#line 374 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGEBUFFER); YY_BREAK case 124: YY_RULE_SETUP -#line 366 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGECUBEARRAY); +#line 375 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE1DARRAY); YY_BREAK case 125: YY_RULE_SETUP -#line 367 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE2DMS); +#line 376 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE2DARRAY); YY_BREAK case 126: YY_RULE_SETUP -#line 368 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE2DMSARRAY); +#line 377 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGECUBEARRAY); YY_BREAK case 127: YY_RULE_SETUP -#line 369 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE1D); +#line 378 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE2DMS); YY_BREAK case 128: YY_RULE_SETUP -#line 370 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE2D); +#line 379 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE2DMSARRAY); YY_BREAK case 129: YY_RULE_SETUP -#line 371 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE3D); +#line 380 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE1D); YY_BREAK case 130: YY_RULE_SETUP -#line 372 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE2DRECT); +#line 381 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE2D); YY_BREAK case 131: YY_RULE_SETUP -#line 373 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGECUBE); +#line 382 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE3D); YY_BREAK case 132: YY_RULE_SETUP -#line 374 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGEBUFFER); +#line 383 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE2DRECT); YY_BREAK case 133: YY_RULE_SETUP -#line 375 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE1DARRAY); +#line 384 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGECUBE); YY_BREAK case 134: YY_RULE_SETUP -#line 376 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE2DARRAY); +#line 385 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGEBUFFER); YY_BREAK case 135: YY_RULE_SETUP -#line 377 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGECUBEARRAY); +#line 386 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE1DARRAY); YY_BREAK case 136: YY_RULE_SETUP -#line 378 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE2DMS); +#line 387 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE2DARRAY); YY_BREAK case 137: YY_RULE_SETUP -#line 379 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE2DMSARRAY); +#line 388 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGECUBEARRAY); YY_BREAK case 138: YY_RULE_SETUP -#line 380 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 0, 0, IMAGE1DSHADOW); +#line 389 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE2DMS); YY_BREAK case 139: YY_RULE_SETUP -#line 381 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 0, 0, IMAGE2DSHADOW); +#line 390 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE2DMSARRAY); YY_BREAK case 140: YY_RULE_SETUP -#line 382 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 0, 0, IMAGE1DARRAYSHADOW); +#line 391 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, IMAGE1DSHADOW); YY_BREAK case 141: YY_RULE_SETUP -#line 383 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 0, 0, IMAGE2DARRAYSHADOW); +#line 392 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, IMAGE2DSHADOW); YY_BREAK case 142: YY_RULE_SETUP -#line 385 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, COHERENT); +#line 393 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, IMAGE1DARRAYSHADOW); YY_BREAK case 143: YY_RULE_SETUP -#line 386 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(110, 100, 420, 0, yyextra->ARB_shader_image_load_store_enable, VOLATILE); +#line 394 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, IMAGE2DARRAYSHADOW); YY_BREAK case 144: YY_RULE_SETUP -#line 387 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, RESTRICT); +#line 396 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, COHERENT); YY_BREAK case 145: YY_RULE_SETUP -#line 388 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, READONLY); +#line 397 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(110, 100, 420, 0, yyextra->ARB_shader_image_load_store_enable, VOLATILE); YY_BREAK case 146: YY_RULE_SETUP -#line 389 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, WRITEONLY); +#line 398 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, RESTRICT); YY_BREAK case 147: YY_RULE_SETUP -#line 391 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_atomic_counters_enable, ATOMIC_UINT); +#line 399 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, READONLY); YY_BREAK case 148: YY_RULE_SETUP -#line 393 "src/glsl/glsl_lexer.ll" -return STRUCT; +#line 400 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, WRITEONLY); YY_BREAK case 149: YY_RULE_SETUP -#line 394 "src/glsl/glsl_lexer.ll" -return VOID_TOK; +#line 402 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_atomic_counters_enable, ATOMIC_UINT); YY_BREAK case 150: YY_RULE_SETUP -#line 396 "src/glsl/glsl_lexer.ll" +#line 404 "src/glsl/glsl_lexer.ll" +return STRUCT; + YY_BREAK +case 151: +YY_RULE_SETUP +#line 405 "src/glsl/glsl_lexer.ll" +return VOID_TOK; + YY_BREAK +case 152: +YY_RULE_SETUP +#line 407 "src/glsl/glsl_lexer.ll" { if ((yyextra->is_version(140, 300)) || yyextra->AMD_conservative_depth_enable || yyextra->ARB_conservative_depth_enable || yyextra->ARB_explicit_attrib_location_enable + || yyextra->ARB_explicit_uniform_location_enable + || yyextra->has_separate_shader_objects() || yyextra->ARB_uniform_buffer_object_enable || yyextra->ARB_fragment_coord_conventions_enable || yyextra->ARB_shading_language_420pack_enable || yyextra->ARB_compute_shader_enable) { return LAYOUT_TOK; } else { - yylval->identifier = strdup(yytext); + void *mem_ctx = yyextra; + yylval->identifier = ralloc_strdup(mem_ctx, yytext); return classify_identifier(yyextra, yytext); } } YY_BREAK -case 151: -YY_RULE_SETUP -#line 412 "src/glsl/glsl_lexer.ll" -return INC_OP; - YY_BREAK -case 152: -YY_RULE_SETUP -#line 413 "src/glsl/glsl_lexer.ll" -return DEC_OP; - YY_BREAK case 153: YY_RULE_SETUP -#line 414 "src/glsl/glsl_lexer.ll" -return LE_OP; +#line 426 "src/glsl/glsl_lexer.ll" +return INC_OP; YY_BREAK case 154: YY_RULE_SETUP -#line 415 "src/glsl/glsl_lexer.ll" -return GE_OP; +#line 427 "src/glsl/glsl_lexer.ll" +return DEC_OP; YY_BREAK case 155: YY_RULE_SETUP -#line 416 "src/glsl/glsl_lexer.ll" -return EQ_OP; +#line 428 "src/glsl/glsl_lexer.ll" +return LE_OP; YY_BREAK case 156: YY_RULE_SETUP -#line 417 "src/glsl/glsl_lexer.ll" -return NE_OP; +#line 429 "src/glsl/glsl_lexer.ll" +return GE_OP; YY_BREAK case 157: YY_RULE_SETUP -#line 418 "src/glsl/glsl_lexer.ll" -return AND_OP; +#line 430 "src/glsl/glsl_lexer.ll" +return EQ_OP; YY_BREAK case 158: YY_RULE_SETUP -#line 419 "src/glsl/glsl_lexer.ll" -return OR_OP; +#line 431 "src/glsl/glsl_lexer.ll" +return NE_OP; YY_BREAK case 159: YY_RULE_SETUP -#line 420 "src/glsl/glsl_lexer.ll" -return XOR_OP; +#line 432 "src/glsl/glsl_lexer.ll" +return AND_OP; YY_BREAK case 160: YY_RULE_SETUP -#line 421 "src/glsl/glsl_lexer.ll" -return LEFT_OP; +#line 433 "src/glsl/glsl_lexer.ll" +return OR_OP; YY_BREAK case 161: YY_RULE_SETUP -#line 422 "src/glsl/glsl_lexer.ll" -return RIGHT_OP; +#line 434 "src/glsl/glsl_lexer.ll" +return XOR_OP; YY_BREAK case 162: YY_RULE_SETUP -#line 424 "src/glsl/glsl_lexer.ll" -return MUL_ASSIGN; +#line 435 "src/glsl/glsl_lexer.ll" +return LEFT_OP; YY_BREAK case 163: YY_RULE_SETUP -#line 425 "src/glsl/glsl_lexer.ll" -return DIV_ASSIGN; +#line 436 "src/glsl/glsl_lexer.ll" +return RIGHT_OP; YY_BREAK case 164: YY_RULE_SETUP -#line 426 "src/glsl/glsl_lexer.ll" -return ADD_ASSIGN; +#line 438 "src/glsl/glsl_lexer.ll" +return MUL_ASSIGN; YY_BREAK case 165: YY_RULE_SETUP -#line 427 "src/glsl/glsl_lexer.ll" -return MOD_ASSIGN; +#line 439 "src/glsl/glsl_lexer.ll" +return DIV_ASSIGN; YY_BREAK case 166: YY_RULE_SETUP -#line 428 "src/glsl/glsl_lexer.ll" -return LEFT_ASSIGN; +#line 440 "src/glsl/glsl_lexer.ll" +return ADD_ASSIGN; YY_BREAK case 167: YY_RULE_SETUP -#line 429 "src/glsl/glsl_lexer.ll" -return RIGHT_ASSIGN; +#line 441 "src/glsl/glsl_lexer.ll" +return MOD_ASSIGN; YY_BREAK case 168: YY_RULE_SETUP -#line 430 "src/glsl/glsl_lexer.ll" -return AND_ASSIGN; +#line 442 "src/glsl/glsl_lexer.ll" +return LEFT_ASSIGN; YY_BREAK case 169: YY_RULE_SETUP -#line 431 "src/glsl/glsl_lexer.ll" -return XOR_ASSIGN; +#line 443 "src/glsl/glsl_lexer.ll" +return RIGHT_ASSIGN; YY_BREAK case 170: YY_RULE_SETUP -#line 432 "src/glsl/glsl_lexer.ll" -return OR_ASSIGN; +#line 444 "src/glsl/glsl_lexer.ll" +return AND_ASSIGN; YY_BREAK case 171: YY_RULE_SETUP -#line 433 "src/glsl/glsl_lexer.ll" -return SUB_ASSIGN; +#line 445 "src/glsl/glsl_lexer.ll" +return XOR_ASSIGN; YY_BREAK case 172: YY_RULE_SETUP -#line 435 "src/glsl/glsl_lexer.ll" +#line 446 "src/glsl/glsl_lexer.ll" +return OR_ASSIGN; + YY_BREAK +case 173: +YY_RULE_SETUP +#line 447 "src/glsl/glsl_lexer.ll" +return SUB_ASSIGN; + YY_BREAK +case 174: +YY_RULE_SETUP +#line 449 "src/glsl/glsl_lexer.ll" { return LITERAL_INTEGER(10); } YY_BREAK -case 173: +case 175: YY_RULE_SETUP -#line 438 "src/glsl/glsl_lexer.ll" +#line 452 "src/glsl/glsl_lexer.ll" { return LITERAL_INTEGER(16); } YY_BREAK -case 174: +case 176: YY_RULE_SETUP -#line 441 "src/glsl/glsl_lexer.ll" +#line 455 "src/glsl/glsl_lexer.ll" { return LITERAL_INTEGER(8); } YY_BREAK -case 175: -YY_RULE_SETUP -#line 445 "src/glsl/glsl_lexer.ll" -{ - yylval->real = glsl_strtof(yytext, NULL); - return FLOATCONSTANT; - } - YY_BREAK -case 176: -YY_RULE_SETUP -#line 449 "src/glsl/glsl_lexer.ll" -{ - yylval->real = glsl_strtof(yytext, NULL); - return FLOATCONSTANT; - } - YY_BREAK case 177: YY_RULE_SETUP -#line 453 "src/glsl/glsl_lexer.ll" +#line 459 "src/glsl/glsl_lexer.ll" { yylval->real = glsl_strtof(yytext, NULL); return FLOATCONSTANT; @@ -2558,7 +2562,7 @@ YY_RULE_SETUP YY_BREAK case 178: YY_RULE_SETUP -#line 457 "src/glsl/glsl_lexer.ll" +#line 463 "src/glsl/glsl_lexer.ll" { yylval->real = glsl_strtof(yytext, NULL); return FLOATCONSTANT; @@ -2566,7 +2570,7 @@ YY_RULE_SETUP YY_BREAK case 179: YY_RULE_SETUP -#line 461 "src/glsl/glsl_lexer.ll" +#line 467 "src/glsl/glsl_lexer.ll" { yylval->real = glsl_strtof(yytext, NULL); return FLOATCONSTANT; @@ -2574,338 +2578,354 @@ YY_RULE_SETUP YY_BREAK case 180: YY_RULE_SETUP -#line 466 "src/glsl/glsl_lexer.ll" +#line 471 "src/glsl/glsl_lexer.ll" +{ + yylval->real = glsl_strtof(yytext, NULL); + return FLOATCONSTANT; + } + YY_BREAK +case 181: +YY_RULE_SETUP +#line 475 "src/glsl/glsl_lexer.ll" +{ + yylval->real = glsl_strtof(yytext, NULL); + return FLOATCONSTANT; + } + YY_BREAK +case 182: +YY_RULE_SETUP +#line 480 "src/glsl/glsl_lexer.ll" { yylval->n = 1; return BOOLCONSTANT; } YY_BREAK -case 181: +case 183: YY_RULE_SETUP -#line 470 "src/glsl/glsl_lexer.ll" +#line 484 "src/glsl/glsl_lexer.ll" { yylval->n = 0; return BOOLCONSTANT; } YY_BREAK /* Reserved words in GLSL 1.10. */ -case 182: -YY_RULE_SETUP -#line 477 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, ASM); - YY_BREAK -case 183: -YY_RULE_SETUP -#line 478 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, CLASS); - YY_BREAK case 184: YY_RULE_SETUP -#line 479 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, UNION); +#line 491 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, ASM); YY_BREAK case 185: YY_RULE_SETUP -#line 480 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, ENUM); +#line 492 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, CLASS); YY_BREAK case 186: YY_RULE_SETUP -#line 481 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, TYPEDEF); +#line 493 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, UNION); YY_BREAK case 187: YY_RULE_SETUP -#line 482 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, TEMPLATE); +#line 494 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, ENUM); YY_BREAK case 188: YY_RULE_SETUP -#line 483 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, THIS); +#line 495 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, TYPEDEF); YY_BREAK case 189: YY_RULE_SETUP -#line 484 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(110, 100, 140, 300, yyextra->ARB_uniform_buffer_object_enable, PACKED_TOK); +#line 496 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, TEMPLATE); YY_BREAK case 190: YY_RULE_SETUP -#line 485 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, GOTO); +#line 497 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, THIS); YY_BREAK case 191: YY_RULE_SETUP -#line 486 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 130, 300, SWITCH); +#line 498 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(110, 100, 140, 300, yyextra->ARB_uniform_buffer_object_enable, PACKED_TOK); YY_BREAK case 192: YY_RULE_SETUP -#line 487 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 130, 300, DEFAULT); +#line 499 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, GOTO); YY_BREAK case 193: YY_RULE_SETUP -#line 488 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, INLINE_TOK); +#line 500 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 130, 300, SWITCH); YY_BREAK case 194: YY_RULE_SETUP -#line 489 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, NOINLINE); +#line 501 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 130, 300, DEFAULT); YY_BREAK case 195: YY_RULE_SETUP -#line 490 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, PUBLIC_TOK); +#line 502 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, INLINE_TOK); YY_BREAK case 196: YY_RULE_SETUP -#line 491 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, STATIC); +#line 503 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, NOINLINE); YY_BREAK case 197: YY_RULE_SETUP -#line 492 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, EXTERN); +#line 504 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, PUBLIC_TOK); YY_BREAK case 198: YY_RULE_SETUP -#line 493 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, EXTERNAL); +#line 505 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, STATIC); YY_BREAK case 199: YY_RULE_SETUP -#line 494 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, INTERFACE); +#line 506 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, EXTERN); YY_BREAK case 200: YY_RULE_SETUP -#line 495 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, LONG_TOK); +#line 507 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, EXTERNAL); YY_BREAK case 201: YY_RULE_SETUP -#line 496 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, SHORT_TOK); +#line 508 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, INTERFACE); YY_BREAK case 202: YY_RULE_SETUP -#line 497 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 400, 0, DOUBLE_TOK); +#line 509 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, LONG_TOK); YY_BREAK case 203: YY_RULE_SETUP -#line 498 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, HALF); +#line 510 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, SHORT_TOK); YY_BREAK case 204: YY_RULE_SETUP -#line 499 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, FIXED_TOK); +#line 511 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 400, 0, DOUBLE_TOK); YY_BREAK case 205: YY_RULE_SETUP -#line 500 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, UNSIGNED); +#line 512 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, HALF); YY_BREAK case 206: YY_RULE_SETUP -#line 501 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, INPUT_TOK); +#line 513 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, FIXED_TOK); YY_BREAK case 207: YY_RULE_SETUP -#line 502 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, OUTPUT); +#line 514 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, UNSIGNED); YY_BREAK case 208: YY_RULE_SETUP -#line 503 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, HVEC2); +#line 515 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, INPUT_TOK); YY_BREAK case 209: YY_RULE_SETUP -#line 504 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, HVEC3); +#line 516 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, OUTPUT); YY_BREAK case 210: YY_RULE_SETUP -#line 505 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, HVEC4); +#line 517 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, HVEC2); YY_BREAK case 211: YY_RULE_SETUP -#line 506 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 400, 0, DVEC2); +#line 518 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, HVEC3); YY_BREAK case 212: YY_RULE_SETUP -#line 507 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 400, 0, DVEC3); +#line 519 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, HVEC4); YY_BREAK case 213: YY_RULE_SETUP -#line 508 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 400, 0, DVEC4); +#line 520 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 400, 0, DVEC2); YY_BREAK case 214: YY_RULE_SETUP -#line 509 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, FVEC2); +#line 521 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 400, 0, DVEC3); YY_BREAK case 215: YY_RULE_SETUP -#line 510 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, FVEC3); +#line 522 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 400, 0, DVEC4); YY_BREAK case 216: YY_RULE_SETUP -#line 511 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, FVEC4); +#line 523 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, FVEC2); YY_BREAK case 217: YY_RULE_SETUP -#line 512 "src/glsl/glsl_lexer.ll" -DEPRECATED_ES_KEYWORD(SAMPLER2DRECT); +#line 524 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, FVEC3); YY_BREAK case 218: YY_RULE_SETUP -#line 513 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, SAMPLER3DRECT); +#line 525 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, FVEC4); YY_BREAK case 219: YY_RULE_SETUP -#line 514 "src/glsl/glsl_lexer.ll" -DEPRECATED_ES_KEYWORD(SAMPLER2DRECTSHADOW); +#line 526 "src/glsl/glsl_lexer.ll" +DEPRECATED_ES_KEYWORD(SAMPLER2DRECT); YY_BREAK case 220: YY_RULE_SETUP -#line 515 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, SIZEOF); +#line 527 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, SAMPLER3DRECT); YY_BREAK case 221: YY_RULE_SETUP -#line 516 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, CAST); +#line 528 "src/glsl/glsl_lexer.ll" +DEPRECATED_ES_KEYWORD(SAMPLER2DRECTSHADOW); YY_BREAK case 222: YY_RULE_SETUP -#line 517 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, NAMESPACE); +#line 529 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, SIZEOF); YY_BREAK case 223: YY_RULE_SETUP -#line 518 "src/glsl/glsl_lexer.ll" -KEYWORD(110, 100, 0, 0, USING); +#line 530 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, CAST); YY_BREAK -/* Additional reserved words in GLSL 1.20. */ case 224: YY_RULE_SETUP -#line 521 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 100, 130, 100, LOWP); +#line 531 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, NAMESPACE); YY_BREAK case 225: YY_RULE_SETUP -#line 522 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 100, 130, 100, MEDIUMP); +#line 532 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, USING); YY_BREAK +/* Additional reserved words in GLSL 1.20. */ case 226: YY_RULE_SETUP -#line 523 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 100, 130, 100, HIGHP); +#line 535 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 100, 130, 100, LOWP); YY_BREAK case 227: YY_RULE_SETUP -#line 524 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 100, 130, 100, PRECISION); +#line 536 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 100, 130, 100, MEDIUMP); YY_BREAK -/* Additional reserved words in GLSL 1.30. */ case 228: YY_RULE_SETUP -#line 527 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 130, 300, CASE); +#line 537 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 100, 130, 100, HIGHP); YY_BREAK case 229: YY_RULE_SETUP -#line 528 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 0, 0, COMMON); +#line 538 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 100, 130, 100, PRECISION); YY_BREAK +/* Additional reserved words in GLSL 1.30. */ case 230: YY_RULE_SETUP -#line 529 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 0, 0, PARTITION); +#line 541 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, CASE); YY_BREAK case 231: YY_RULE_SETUP -#line 530 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 0, 0, ACTIVE); +#line 542 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, COMMON); YY_BREAK case 232: YY_RULE_SETUP -#line 531 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 100, 0, 0, SUPERP); +#line 543 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, PARTITION); YY_BREAK case 233: YY_RULE_SETUP -#line 532 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 140, 0, SAMPLERBUFFER); +#line 544 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, ACTIVE); YY_BREAK case 234: YY_RULE_SETUP -#line 533 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 300, 0, 0, FILTER); +#line 545 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 100, 0, 0, SUPERP); YY_BREAK case 235: YY_RULE_SETUP -#line 534 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(130, 0, 140, 0, yyextra->ARB_uniform_buffer_object_enable && !yyextra->es_shader, ROW_MAJOR); +#line 546 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 140, 0, SAMPLERBUFFER); YY_BREAK -/* Additional reserved words in GLSL 1.40 */ case 236: YY_RULE_SETUP -#line 537 "src/glsl/glsl_lexer.ll" -KEYWORD(140, 300, 140, 0, ISAMPLER2DRECT); +#line 547 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, FILTER); YY_BREAK case 237: YY_RULE_SETUP -#line 538 "src/glsl/glsl_lexer.ll" -KEYWORD(140, 300, 140, 0, USAMPLER2DRECT); +#line 548 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 0, 140, 0, yyextra->ARB_uniform_buffer_object_enable && !yyextra->es_shader, ROW_MAJOR); YY_BREAK +/* Additional reserved words in GLSL 1.40 */ case 238: YY_RULE_SETUP -#line 539 "src/glsl/glsl_lexer.ll" -KEYWORD(140, 300, 140, 0, ISAMPLERBUFFER); +#line 551 "src/glsl/glsl_lexer.ll" +KEYWORD(140, 300, 140, 0, ISAMPLER2DRECT); YY_BREAK case 239: YY_RULE_SETUP -#line 540 "src/glsl/glsl_lexer.ll" -KEYWORD(140, 300, 140, 0, USAMPLERBUFFER); +#line 552 "src/glsl/glsl_lexer.ll" +KEYWORD(140, 300, 140, 0, USAMPLER2DRECT); YY_BREAK -/* Additional reserved words in GLSL ES 3.00 */ case 240: YY_RULE_SETUP -#line 543 "src/glsl/glsl_lexer.ll" -KEYWORD(0, 300, 0, 0, RESOURCE); +#line 553 "src/glsl/glsl_lexer.ll" +KEYWORD(140, 300, 140, 0, ISAMPLERBUFFER); YY_BREAK case 241: YY_RULE_SETUP -#line 544 "src/glsl/glsl_lexer.ll" -KEYWORD(0, 300, 0, 0, PATCH); +#line 554 "src/glsl/glsl_lexer.ll" +KEYWORD(140, 300, 140, 0, USAMPLERBUFFER); YY_BREAK +/* Additional reserved words in GLSL ES 3.00 */ case 242: YY_RULE_SETUP -#line 545 "src/glsl/glsl_lexer.ll" -KEYWORD_WITH_ALT(400, 300, 400, 0, yyextra->ARB_gpu_shader5_enable, SAMPLE); +#line 557 "src/glsl/glsl_lexer.ll" +KEYWORD(0, 300, 0, 0, RESOURCE); YY_BREAK case 243: YY_RULE_SETUP -#line 546 "src/glsl/glsl_lexer.ll" -KEYWORD(0, 300, 0, 0, SUBROUTINE); +#line 558 "src/glsl/glsl_lexer.ll" +KEYWORD(0, 300, 0, 0, PATCH); YY_BREAK case 244: YY_RULE_SETUP -#line 549 "src/glsl/glsl_lexer.ll" +#line 559 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(400, 300, 400, 0, yyextra->ARB_gpu_shader5_enable, SAMPLE); + YY_BREAK +case 245: +YY_RULE_SETUP +#line 560 "src/glsl/glsl_lexer.ll" +KEYWORD(0, 300, 0, 0, SUBROUTINE); + YY_BREAK +case 246: +YY_RULE_SETUP +#line 563 "src/glsl/glsl_lexer.ll" { struct _mesa_glsl_parse_state *state = yyextra; void *ctx = state; @@ -2913,17 +2933,17 @@ YY_RULE_SETUP return classify_identifier(state, yytext); } YY_BREAK -case 245: +case 247: YY_RULE_SETUP -#line 556 "src/glsl/glsl_lexer.ll" +#line 570 "src/glsl/glsl_lexer.ll" { return yytext[0]; } YY_BREAK -case 246: +case 248: YY_RULE_SETUP -#line 558 "src/glsl/glsl_lexer.ll" -ECHO; +#line 572 "src/glsl/glsl_lexer.ll" +YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 2927 "src/glsl/glsl_lexer.cpp" +#line 2947 "src/glsl/glsl_lexer.cpp" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(PP): case YY_STATE_EOF(PRAGMA): @@ -3221,7 +3241,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1008 ) + if ( yy_current_state >= 1009 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -3250,11 +3270,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1008 ) + if ( yy_current_state >= 1009 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 1007); + yy_is_jam = (yy_current_state == 1008); return yy_is_jam ? 0 : yy_current_state; } @@ -4066,7 +4086,7 @@ void _mesa_glsl_lexer_free (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 558 "src/glsl/glsl_lexer.ll" +#line 572 "src/glsl/glsl_lexer.ll" diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_lexer.ll b/3rdparty/glsl-optimizer/src/glsl/glsl_lexer.ll index 1c32aba69..bc01ca367 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_lexer.ll +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_lexer.ll @@ -44,8 +44,9 @@ static int classify_identifier(struct _mesa_glsl_parse_state *, const char *); do { \ yylloc->source = 0; \ yylloc->first_column = yycolumn + 1; \ - yylloc->first_line = yylineno + 1; \ + yylloc->first_line = yylloc->last_line = yylineno + 1; \ yycolumn += yyleng; \ + yylloc->last_column = yycolumn + 1; \ } while(0); #define YY_USER_INIT yylineno = 0; yycolumn = 0; @@ -86,7 +87,8 @@ static int classify_identifier(struct _mesa_glsl_parse_state *, const char *); "illegal use of reserved word `%s'", yytext); \ return ERROR_TOK; \ } else { \ - yylval->identifier = strdup(yytext); \ + void *mem_ctx = yyextra; \ + yylval->identifier = ralloc_strdup(mem_ctx, yytext); \ return classify_identifier(yyextra, yytext); \ } \ } while (0) @@ -157,7 +159,11 @@ literal_integer(char *text, int len, struct _mesa_glsl_parse_state *state, %option never-interactive %option prefix="_mesa_glsl_lexer_" %option extra-type="struct _mesa_glsl_parse_state *" +%option warn nodefault + /* Note: When adding any start conditions to this list, you must also + * update the "Internal compiler error" catch-all rule near the end of + * this file. */ %x PP PRAGMA DEC_INT [1-9][0-9]* @@ -233,7 +239,8 @@ HASH ^{SPC}#{SPC} [ \t\r]* { } : return COLON; [_a-zA-Z][_a-zA-Z0-9]* { - yylval->identifier = strdup(yytext); + void *mem_ctx = yyextra; + yylval->identifier = ralloc_strdup(mem_ctx, yytext); return IDENTIFIER; } [1-9][0-9]* { @@ -241,6 +248,7 @@ HASH ^{SPC}#{SPC} return INTCONSTANT; } \n { BEGIN 0; yylineno++; yycolumn = 0; return EOL; } +. { return yytext[0]; } \n { yylineno++; yycolumn = 0; } @@ -291,11 +299,11 @@ out return OUT_TOK; inout return INOUT_TOK; uniform return UNIFORM; varying DEPRECATED_ES_KEYWORD(VARYING); -centroid KEYWORD(120, 100, 120, 100, CENTROID); -invariant KEYWORD(120, 100, 120, 100, INVARIANT); -flat KEYWORD(120, 100, 120, 100, FLAT); -smooth KEYWORD(120, 100, 120, 100, SMOOTH); -noperspective KEYWORD(120, 100, 120, 100, NOPERSPECTIVE); +centroid KEYWORD(120, 300, 120, 300, CENTROID); +invariant KEYWORD(120, 100, 120, 100, INVARIANT); +flat KEYWORD(130, 100, 130, 300, FLAT); +smooth KEYWORD(130, 300, 130, 300, SMOOTH); +noperspective KEYWORD(130, 300, 130, 0, NOPERSPECTIVE); sampler1D DEPRECATED_ES_KEYWORD(SAMPLER1D); sampler2D return SAMPLER2D; @@ -343,6 +351,9 @@ samplerExternalOES { return IDENTIFIER; } + /* keywords available with ARB_gpu_shader5 */ +precise KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_gpu_shader5_enable, PRECISE); + /* keywords available with ARB_shader_image_load_store */ image1D KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE1D); image2D KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2D); @@ -398,13 +409,16 @@ layout { || yyextra->AMD_conservative_depth_enable || yyextra->ARB_conservative_depth_enable || yyextra->ARB_explicit_attrib_location_enable + || yyextra->ARB_explicit_uniform_location_enable + || yyextra->has_separate_shader_objects() || yyextra->ARB_uniform_buffer_object_enable || yyextra->ARB_fragment_coord_conventions_enable || yyextra->ARB_shading_language_420pack_enable || yyextra->ARB_compute_shader_enable) { return LAYOUT_TOK; } else { - yylval->identifier = strdup(yytext); + void *mem_ctx = yyextra; + yylval->identifier = ralloc_strdup(mem_ctx, yytext); return classify_identifier(yyextra, yytext); } } diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.cpp b/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.cpp index 54de830fb..f20df456d 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.cpp @@ -3,6 +3,7 @@ #include "glsl_parser_extras.h" #include "glsl_parser.h" #include "ir_optimization.h" +#include "ir_print_metal_visitor.h" #include "ir_print_glsl_visitor.h" #include "ir_print_visitor.h" #include "ir_stats.h" @@ -37,6 +38,9 @@ initialize_mesa_context(struct gl_context *ctx, glslopt_target api) case kGlslTargetOpenGLES30: mesaAPI = API_OPENGL_CORE; break; + case kGlslTargetMetal: + mesaAPI = API_OPENGL_CORE; + break; } initialize_context_to_defaults (ctx, mesaAPI); @@ -50,12 +54,18 @@ initialize_mesa_context(struct gl_context *ctx, glslopt_target api) ctx->Extensions.OES_standard_derivatives = true; ctx->Extensions.EXT_shadow_samplers = true; ctx->Extensions.EXT_frag_depth = true; + ctx->Extensions.EXT_shader_framebuffer_fetch = true; break; case kGlslTargetOpenGLES30: ctx->Extensions.ARB_ES3_compatibility = true; + ctx->Extensions.EXT_shader_framebuffer_fetch = true; + break; + case kGlslTargetMetal: + ctx->Extensions.ARB_ES3_compatibility = true; + ctx->Extensions.EXT_shader_framebuffer_fetch = true; break; } - + // allow high amount of texcoords ctx->Const.MaxTextureCoordUnits = 16; @@ -64,6 +74,7 @@ initialize_mesa_context(struct gl_context *ctx, glslopt_target api) ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = 16; ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits = 16; + // For GLES2.0 this would be 1, but we do support GL_EXT_draw_buffers ctx->Const.MaxDrawBuffers = 8; ctx->Driver.NewShader = _mesa_new_shader; @@ -73,16 +84,16 @@ initialize_mesa_context(struct gl_context *ctx, glslopt_target api) struct glslopt_ctx { glslopt_ctx (glslopt_target target) { + this->target = target; mem_ctx = ralloc_context (NULL); initialize_mesa_context (&mesa_ctx, target); - max_unroll_iterations = 8; } ~glslopt_ctx() { ralloc_free (mem_ctx); } struct gl_context mesa_ctx; void* mem_ctx; - unsigned int max_unroll_iterations; + glslopt_target target; }; glslopt_ctx* glslopt_initialize (glslopt_target target) @@ -98,12 +109,19 @@ void glslopt_cleanup (glslopt_ctx* ctx) void glslopt_set_max_unroll_iterations (glslopt_ctx* ctx, unsigned iterations) { - ctx->max_unroll_iterations = iterations; + for (int i = 0; i < MESA_SHADER_STAGES; ++i) + ctx->mesa_ctx.Const.ShaderCompilerOptions[i].MaxUnrollIterations = iterations; } -struct glslopt_shader_input +struct glslopt_shader_var { const char* name; + glslopt_basic_type type; + glslopt_precision prec; + int vectorSize; + int matrixSize; + int arraySize; + int location; }; struct glslopt_shader @@ -124,7 +142,10 @@ struct glslopt_shader : rawOutput(0) , optimizedOutput(0) , status(false) + , uniformCount(0) + , uniformsSize(0) , inputCount(0) + , textureCount(0) , statsMath(0) , statsTex(0) , statsFlow(0) @@ -157,9 +178,15 @@ struct glslopt_shader struct gl_shader_program* whole_program; struct gl_shader* shader; + static const int kMaxShaderUniforms = 1024; static const int kMaxShaderInputs = 128; - glslopt_shader_input inputs[kMaxShaderInputs]; + static const int kMaxShaderTextures = 128; + glslopt_shader_var uniforms[kMaxShaderUniforms]; + glslopt_shader_var inputs[kMaxShaderInputs]; + glslopt_shader_var textures[kMaxShaderInputs]; + int uniformCount, uniformsSize; int inputCount; + int textureCount; int statsMath, statsTex, statsFlow; char* rawOutput; @@ -172,7 +199,7 @@ static inline void debug_print_ir (const char* name, exec_list* ir, _mesa_glsl_p { #if 0 printf("**** %s:\n", name); - //_mesa_print_ir (ir, state); +// _mesa_print_ir (ir, state); char* foobar = _mesa_print_ir_glsl(ir, state, ralloc_strdup(memctx, ""), kPrintGlslFragment); printf("%s\n", foobar); validate_ir_tree(ir); @@ -181,14 +208,23 @@ static inline void debug_print_ir (const char* name, exec_list* ir, _mesa_glsl_p static void propagate_precision_deref(ir_instruction *ir, void *data) { - // variable -> deference + // variable deref with undefined precision: take from variable itself ir_dereference_variable* der = ir->as_dereference_variable(); 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; } - // swizzle value -> swizzle + + // array deref with undefined precision: take from array itself + ir_dereference_array* der_arr = ir->as_dereference_array(); + 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; + } + + // swizzle with undefined precision: take from swizzle argument ir_swizzle* swz = ir->as_swizzle(); if (swz && swz->get_precision() == glsl_precision_undefined && swz->val->get_precision() != glsl_precision_undefined) { @@ -272,14 +308,14 @@ static void propagate_precision_call(ir_instruction *ir, void *data) } -static bool propagate_precision(exec_list* list) +static bool propagate_precision(exec_list* list, bool assign_high_to_undefined) { bool anyProgress = false; bool res; do { res = false; - foreach_list(node, list) { - ir_instruction* ir = (ir_instruction*)node; + 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); @@ -287,11 +323,30 @@ static bool propagate_precision(exec_list* list) } anyProgress |= res; } while (res); + anyProgress |= res; + + // for globals that have undefined precision, set it to highp + if (assign_high_to_undefined) + { + foreach_in_list(ir_instruction, ir, list) + { + ir_variable* var = ir->as_variable(); + if (var) + { + if (var->data.precision == glsl_precision_undefined) + { + var->data.precision = glsl_precision_high; + anyProgress = true; + } + } + } + } + return anyProgress; } -static void do_optimization_passes(exec_list* ir, bool linked, unsigned max_unroll_iterations, _mesa_glsl_parse_state* state, void* mem_ctx) +static void do_optimization_passes(exec_list* ir, bool linked, _mesa_glsl_parse_state* state, void* mem_ctx) { bool progress; do { @@ -305,9 +360,14 @@ static void do_optimization_passes(exec_list* ir, bool linked, unsigned max_unro } progress2 = do_if_simplification(ir); progress |= progress2; if (progress2) debug_print_ir ("After if simpl", ir, state, mem_ctx); progress2 = opt_flatten_nested_if_blocks(ir); progress |= progress2; if (progress2) debug_print_ir ("After if flatten", ir, state, mem_ctx); - progress2 = propagate_precision (ir); progress |= progress2; if (progress2) debug_print_ir ("After prec propagation", ir, state, mem_ctx); + progress2 = propagate_precision (ir, state->metal_target); progress |= progress2; if (progress2) debug_print_ir ("After prec propagation", ir, state, mem_ctx); progress2 = do_copy_propagation(ir); progress |= progress2; if (progress2) debug_print_ir ("After copy propagation", ir, state, mem_ctx); progress2 = do_copy_propagation_elements(ir); progress |= progress2; if (progress2) debug_print_ir ("After copy propagation elems", ir, state, mem_ctx); + if (state->es_shader && linked) + { + progress2 = optimize_split_vectors(ir, linked, OPT_SPLIT_ONLY_LOOP_INDUCTORS); progress |= progress2; if (progress2) debug_print_ir("After split vectors", ir, state, mem_ctx); + } + if (linked) { progress2 = do_vectorize(ir); progress |= progress2; if (progress2) debug_print_ir ("After vectorize", ir, state, mem_ctx); @@ -318,7 +378,7 @@ static void do_optimization_passes(exec_list* ir, bool linked, unsigned max_unro progress2 = do_dead_code_unlinked(ir); progress |= progress2; if (progress2) debug_print_ir ("After dead code unlinked", ir, state, mem_ctx); } progress2 = do_dead_code_local(ir); progress |= progress2; if (progress2) debug_print_ir ("After dead code local", ir, state, mem_ctx); - progress2 = propagate_precision (ir); progress |= progress2; if (progress2) debug_print_ir ("After prec propagation", ir, state, mem_ctx); + progress2 = propagate_precision (ir, state->metal_target); progress |= progress2; if (progress2) debug_print_ir ("After prec propagation", ir, state, mem_ctx); progress2 = do_tree_grafting(ir); progress |= progress2; if (progress2) debug_print_ir ("After tree grafting", ir, state, mem_ctx); progress2 = do_constant_propagation(ir); progress |= progress2; if (progress2) debug_print_ir ("After const propagation", ir, state, mem_ctx); if (linked) { @@ -327,15 +387,19 @@ static void do_optimization_passes(exec_list* ir, bool linked, unsigned max_unro progress2 = do_constant_variable_unlinked(ir); progress |= progress2; if (progress2) debug_print_ir ("After const variable unlinked", ir, state, mem_ctx); } progress2 = do_constant_folding(ir); progress |= progress2; if (progress2) debug_print_ir ("After const folding", ir, state, mem_ctx); + progress2 = do_minmax_prune(ir); progress |= progress2; if (progress2) debug_print_ir ("After minmax prune", ir, state, mem_ctx); progress2 = do_cse(ir); progress |= progress2; if (progress2) debug_print_ir ("After CSE", ir, state, mem_ctx); - progress2 = do_algebraic(ir); progress |= progress2; if (progress2) debug_print_ir ("After algebraic", ir, state, mem_ctx); + progress2 = do_rebalance_tree(ir); progress |= progress2; if (progress2) debug_print_ir ("After rebalance tree", ir, state, mem_ctx); + progress2 = do_algebraic(ir, state->ctx->Const.NativeIntegers, &state->ctx->Const.ShaderCompilerOptions[state->stage]); progress |= progress2; if (progress2) debug_print_ir ("After algebraic", ir, state, mem_ctx); progress2 = do_lower_jumps(ir); progress |= progress2; if (progress2) debug_print_ir ("After lower jumps", ir, state, mem_ctx); progress2 = do_vec_index_to_swizzle(ir); progress |= progress2; if (progress2) debug_print_ir ("After vec index to swizzle", ir, state, mem_ctx); + progress2 = lower_vector_insert(ir, false); progress |= progress2; if (progress2) debug_print_ir ("After lower vector insert", ir, state, mem_ctx); progress2 = do_swizzle_swizzle(ir); progress |= progress2; if (progress2) debug_print_ir ("After swizzle swizzle", ir, state, mem_ctx); progress2 = do_noop_swizzle(ir); progress |= progress2; if (progress2) debug_print_ir ("After noop swizzle", ir, state, mem_ctx); - progress2 = optimize_split_arrays(ir, linked); progress |= progress2; if (progress2) debug_print_ir ("After split arrays", ir, state, mem_ctx); + progress2 = optimize_split_arrays(ir, linked, state->metal_target && state->stage == MESA_SHADER_FRAGMENT); progress |= progress2; if (progress2) debug_print_ir ("After split arrays", ir, state, mem_ctx); + progress2 = optimize_split_vectors(ir, linked, OPT_SPLIT_ONLY_UNUSED); progress |= progress2; if (progress2) debug_print_ir("After split unused vectors", ir, state, mem_ctx); progress2 = optimize_redundant_jumps(ir); progress |= progress2; if (progress2) debug_print_ir ("After redundant jumps", ir, state, mem_ctx); - + // do loop stuff only when linked; otherwise causes duplicate loop induction variable // problems (ast-in.txt test) if (linked) @@ -343,27 +407,101 @@ static void do_optimization_passes(exec_list* ir, bool linked, unsigned max_unro loop_state *ls = analyze_loop_variables(ir); if (ls->loop_found) { progress2 = set_loop_controls(ir, ls); progress |= progress2; if (progress2) debug_print_ir ("After set loop", ir, state, mem_ctx); - progress2 = unroll_loops(ir, ls, max_unroll_iterations); progress |= progress2; if (progress2) debug_print_ir ("After unroll", ir, state, mem_ctx); + progress2 = unroll_loops(ir, ls, &state->ctx->Const.ShaderCompilerOptions[state->stage]); progress |= progress2; if (progress2) debug_print_ir ("After unroll", ir, state, mem_ctx); } delete ls; } } while (progress); + + if (!state->metal_target) + { + // GLSL/ES does not have saturate, so lower it + lower_instructions(ir, SAT_TO_CLAMP); + } } - -static void find_shader_inputs(glslopt_shader* sh, exec_list* ir) +static void glsl_type_to_optimizer_desc(const glsl_type* type, glsl_precision prec, glslopt_shader_var* out) { - foreach_list(node, ir) + out->arraySize = type->array_size(); + + // type; use element type when in array + if (type->is_array()) + type = type->element_type(); + + if (type->is_float()) + out->type = kGlslTypeFloat; + else if (type->is_integer()) + out->type = kGlslTypeInt; + else if (type->is_boolean()) + out->type = kGlslTypeBool; + else if (type->is_sampler()) { - ir_variable* const var = ((ir_instruction *)node)->as_variable(); - if (var == NULL || var->data.mode != ir_var_shader_in) + if (type->sampler_dimensionality == GLSL_SAMPLER_DIM_2D) + out->type = kGlslTypeTex2D; + else if (type->sampler_dimensionality == GLSL_SAMPLER_DIM_3D) + out->type = kGlslTypeTex3D; + else if (type->sampler_dimensionality == GLSL_SAMPLER_DIM_CUBE) + out->type = kGlslTypeTexCube; + else + out->type = kGlslTypeOther; + } + else + out->type = kGlslTypeOther; + + // sizes + out->vectorSize = type->vector_elements; + out->matrixSize = type->matrix_columns; + + // precision + switch (prec) + { + case glsl_precision_high: out->prec = kGlslPrecHigh; break; + case glsl_precision_medium: out->prec = kGlslPrecMedium; break; + case glsl_precision_low: out->prec = kGlslPrecLow; break; + default: out->prec = kGlslPrecHigh; break; + } +} + +static void find_shader_variables(glslopt_shader* sh, exec_list* ir) +{ + foreach_in_list(ir_instruction, node, ir) + { + ir_variable* const var = node->as_variable(); + if (var == NULL) continue; + if (var->data.mode == ir_var_shader_in) + { + if (sh->inputCount >= glslopt_shader::kMaxShaderInputs) + continue; - if (sh->inputCount >= glslopt_shader::kMaxShaderInputs) - return; - - sh->inputs[sh->inputCount].name = ralloc_strdup(sh, var->name); - ++sh->inputCount; + glslopt_shader_var& v = sh->inputs[sh->inputCount]; + v.name = ralloc_strdup(sh, var->name); + glsl_type_to_optimizer_desc(var->type, (glsl_precision)var->data.precision, &v); + v.location = var->data.explicit_location ? var->data.location : -1; + ++sh->inputCount; + } + if (var->data.mode == ir_var_uniform && !var->type->is_sampler()) + { + if (sh->uniformCount >= glslopt_shader::kMaxShaderUniforms) + continue; + + glslopt_shader_var& v = sh->uniforms[sh->uniformCount]; + v.name = ralloc_strdup(sh, var->name); + glsl_type_to_optimizer_desc(var->type, (glsl_precision)var->data.precision, &v); + v.location = var->data.explicit_location ? var->data.location : -1; + ++sh->uniformCount; + } + if (var->data.mode == ir_var_uniform && var->type->is_sampler()) + { + if (sh->textureCount >= glslopt_shader::kMaxShaderTextures) + continue; + + glslopt_shader_var& v = sh->textures[sh->textureCount]; + v.name = ralloc_strdup(sh, var->name); + glsl_type_to_optimizer_desc(var->type, (glsl_precision)var->data.precision, &v); + v.location = var->data.explicit_location ? var->data.location : -1; + ++sh->textureCount; + } } } @@ -397,8 +535,10 @@ glslopt_shader* glslopt_optimize (glslopt_ctx* ctx, glslopt_shader_type type, co shader->status = false; return shader; } - + _mesa_glsl_parse_state* state = new (shader) _mesa_glsl_parse_state (&ctx->mesa_ctx, shader->shader->Stage, shader); + if (ctx->target == kGlslTargetMetal) + state->metal_target = true; state->error = 0; if (!(options & kGlslOptionSkipPreprocessor)) @@ -425,7 +565,10 @@ glslopt_shader* glslopt_optimize (glslopt_ctx* ctx, glslopt_shader_type type, co // Un-optimized output if (!state->error) { validate_ir_tree(ir); - shader->rawOutput = _mesa_print_ir_glsl(ir, state, ralloc_strdup(shader, ""), printMode); + if (ctx->target == kGlslTargetMetal) + shader->rawOutput = _mesa_print_ir_metal(ir, state, ralloc_strdup(shader, ""), printMode, &shader->uniformsSize); + else + shader->rawOutput = _mesa_print_ir_glsl(ir, state, ralloc_strdup(shader, ""), printMode); } // Link built-in functions @@ -434,7 +577,7 @@ glslopt_shader* glslopt_optimize (glslopt_ctx* ctx, glslopt_shader_type type, co struct gl_shader* linked_shader = NULL; - if (!state->error && !ir->is_empty()) + if (!state->error && !ir->is_empty() && !(options & kGlslOptionNotFullShader)) { linked_shader = link_intrastage_shaders(shader, &ctx->mesa_ctx, @@ -456,20 +599,23 @@ glslopt_shader* glslopt_optimize (glslopt_ctx* ctx, glslopt_shader_type type, co if (!state->error && !ir->is_empty()) { const bool linked = !(options & kGlslOptionNotFullShader); - do_optimization_passes(ir, linked, ctx->max_unroll_iterations, state, shader); + do_optimization_passes(ir, linked, state, shader); validate_ir_tree(ir); } // Final optimized output if (!state->error) { - shader->optimizedOutput = _mesa_print_ir_glsl(ir, state, ralloc_strdup(shader, ""), printMode); + if (ctx->target == kGlslTargetMetal) + shader->optimizedOutput = _mesa_print_ir_metal(ir, state, ralloc_strdup(shader, ""), printMode, &shader->uniformsSize); + else + shader->optimizedOutput = _mesa_print_ir_glsl(ir, state, ralloc_strdup(shader, ""), printMode); } shader->status = !state->error; shader->infoLog = state->info_log; - find_shader_inputs(shader, ir); + find_shader_variables (shader, ir); if (!state->error) calculate_shader_stats (ir, &shader->statsMath, &shader->statsTex, &shader->statsFlow); @@ -512,9 +658,55 @@ int glslopt_shader_get_input_count (glslopt_shader* shader) return shader->inputCount; } -const char* glslopt_shader_get_input_name (glslopt_shader* shader, int index) +int glslopt_shader_get_uniform_count (glslopt_shader* shader) { - return shader->inputs[index].name; + return shader->uniformCount; +} + +int glslopt_shader_get_uniform_total_size (glslopt_shader* shader) +{ + return shader->uniformsSize; +} + +int glslopt_shader_get_texture_count (glslopt_shader* shader) +{ + return shader->textureCount; +} + +void glslopt_shader_get_input_desc (glslopt_shader* shader, int index, const char** outName, glslopt_basic_type* outType, glslopt_precision* outPrec, int* outVecSize, int* outMatSize, int* outArraySize, int* outLocation) +{ + const glslopt_shader_var& v = shader->inputs[index]; + *outName = v.name; + *outType = v.type; + *outPrec = v.prec; + *outVecSize = v.vectorSize; + *outMatSize = v.matrixSize; + *outArraySize = v.arraySize; + *outLocation = v.location; +} + +void glslopt_shader_get_uniform_desc (glslopt_shader* shader, int index, const char** outName, glslopt_basic_type* outType, glslopt_precision* outPrec, int* outVecSize, int* outMatSize, int* outArraySize, int* outLocation) +{ + const glslopt_shader_var& v = shader->uniforms[index]; + *outName = v.name; + *outType = v.type; + *outPrec = v.prec; + *outVecSize = v.vectorSize; + *outMatSize = v.matrixSize; + *outArraySize = v.arraySize; + *outLocation = v.location; +} + +void glslopt_shader_get_texture_desc (glslopt_shader* shader, int index, const char** outName, glslopt_basic_type* outType, glslopt_precision* outPrec, int* outVecSize, int* outMatSize, int* outArraySize, int* outLocation) +{ + const glslopt_shader_var& v = shader->textures[index]; + *outName = v.name; + *outType = v.type; + *outPrec = v.prec; + *outVecSize = v.vectorSize; + *outMatSize = v.matrixSize; + *outArraySize = v.arraySize; + *outLocation = v.location; } void glslopt_shader_get_stats (glslopt_shader* shader, int* approxMath, int* approxTex, int* approxFlow) diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.h b/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.h index 88cf56276..8dfc74bb0 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.h +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.h @@ -40,7 +40,26 @@ enum glslopt_options { enum glslopt_target { kGlslTargetOpenGL = 0, kGlslTargetOpenGLES20 = 1, - kGlslTargetOpenGLES30 = 2 + kGlslTargetOpenGLES30 = 2, + kGlslTargetMetal = 3, +}; + +// Type info +enum glslopt_basic_type { + kGlslTypeFloat = 0, + kGlslTypeInt, + kGlslTypeBool, + kGlslTypeTex2D, + kGlslTypeTex3D, + kGlslTypeTexCube, + kGlslTypeOther, + kGlslTypeCount +}; +enum glslopt_precision { + kGlslPrecHigh = 0, + kGlslPrecMedium, + kGlslPrecLow, + kGlslPrecCount }; glslopt_ctx* glslopt_initialize (glslopt_target target); @@ -56,7 +75,12 @@ const char* glslopt_get_log (glslopt_shader* shader); void glslopt_shader_delete (glslopt_shader* shader); int glslopt_shader_get_input_count (glslopt_shader* shader); -const char* glslopt_shader_get_input_name (glslopt_shader* shader, int index); +void glslopt_shader_get_input_desc (glslopt_shader* shader, int index, const char** outName, glslopt_basic_type* outType, glslopt_precision* outPrec, int* outVecSize, int* outMatSize, int* outArraySize, int* outLocation); +int glslopt_shader_get_uniform_count (glslopt_shader* shader); +int glslopt_shader_get_uniform_total_size (glslopt_shader* shader); +void glslopt_shader_get_uniform_desc (glslopt_shader* shader, int index, const char** outName, glslopt_basic_type* outType, glslopt_precision* outPrec, int* outVecSize, int* outMatSize, int* outArraySize, int* outLocation); +int glslopt_shader_get_texture_count (glslopt_shader* shader); +void glslopt_shader_get_texture_desc (glslopt_shader* shader, int index, const char** outName, glslopt_basic_type* outType, glslopt_precision* outPrec, int* outVecSize, int* outMatSize, int* outArraySize, int* outLocation); // Get *very* approximate shader stats: // Number of math, texture and flow control instructions. diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_parser.cpp b/3rdparty/glsl-optimizer/src/glsl/glsl_parser.cpp index 92e913040..42418d6ba 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_parser.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_parser.cpp @@ -95,6 +95,9 @@ #include #include #include +#ifndef _MSC_VER +#include +#endif #include #include "ast.h" @@ -146,7 +149,7 @@ static bool match_layout_qualifier(const char *s1, const char *s2, return strcasecmp(s1, s2); } -#line 150 "src/glsl/glsl_parser.cpp" /* yacc.c:339 */ +#line 153 "src/glsl/glsl_parser.cpp" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus @@ -216,193 +219,193 @@ extern int _mesa_glsl_debug; INOUT_TOK = 290, UNIFORM = 291, VARYING = 292, - NOPERSPECTIVE = 293, - FLAT = 294, - SMOOTH = 295, - MAT2X2 = 296, - MAT2X3 = 297, - MAT2X4 = 298, - MAT3X2 = 299, - MAT3X3 = 300, - MAT3X4 = 301, - MAT4X2 = 302, - MAT4X3 = 303, - MAT4X4 = 304, - SAMPLER1D = 305, - SAMPLER2D = 306, - SAMPLER3D = 307, - SAMPLERCUBE = 308, - SAMPLER1DSHADOW = 309, - SAMPLER2DSHADOW = 310, - SAMPLERCUBESHADOW = 311, - SAMPLER1DARRAY = 312, - SAMPLER2DARRAY = 313, - SAMPLER1DARRAYSHADOW = 314, - SAMPLER2DARRAYSHADOW = 315, - SAMPLERCUBEARRAY = 316, - SAMPLERCUBEARRAYSHADOW = 317, - ISAMPLER1D = 318, - ISAMPLER2D = 319, - ISAMPLER3D = 320, - ISAMPLERCUBE = 321, - ISAMPLER1DARRAY = 322, - ISAMPLER2DARRAY = 323, - ISAMPLERCUBEARRAY = 324, - USAMPLER1D = 325, - USAMPLER2D = 326, - USAMPLER3D = 327, - USAMPLERCUBE = 328, - USAMPLER1DARRAY = 329, - USAMPLER2DARRAY = 330, - USAMPLERCUBEARRAY = 331, - SAMPLER2DRECT = 332, - ISAMPLER2DRECT = 333, - USAMPLER2DRECT = 334, - SAMPLER2DRECTSHADOW = 335, - SAMPLERBUFFER = 336, - ISAMPLERBUFFER = 337, - USAMPLERBUFFER = 338, - SAMPLER2DMS = 339, - ISAMPLER2DMS = 340, - USAMPLER2DMS = 341, - SAMPLER2DMSARRAY = 342, - ISAMPLER2DMSARRAY = 343, - USAMPLER2DMSARRAY = 344, - SAMPLEREXTERNALOES = 345, - IMAGE1D = 346, - IMAGE2D = 347, - IMAGE3D = 348, - IMAGE2DRECT = 349, - IMAGECUBE = 350, - IMAGEBUFFER = 351, - IMAGE1DARRAY = 352, - IMAGE2DARRAY = 353, - IMAGECUBEARRAY = 354, - IMAGE2DMS = 355, - IMAGE2DMSARRAY = 356, - IIMAGE1D = 357, - IIMAGE2D = 358, - IIMAGE3D = 359, - IIMAGE2DRECT = 360, - IIMAGECUBE = 361, - IIMAGEBUFFER = 362, - IIMAGE1DARRAY = 363, - IIMAGE2DARRAY = 364, - IIMAGECUBEARRAY = 365, - IIMAGE2DMS = 366, - IIMAGE2DMSARRAY = 367, - UIMAGE1D = 368, - UIMAGE2D = 369, - UIMAGE3D = 370, - UIMAGE2DRECT = 371, - UIMAGECUBE = 372, - UIMAGEBUFFER = 373, - UIMAGE1DARRAY = 374, - UIMAGE2DARRAY = 375, - UIMAGECUBEARRAY = 376, - UIMAGE2DMS = 377, - UIMAGE2DMSARRAY = 378, - IMAGE1DSHADOW = 379, - IMAGE2DSHADOW = 380, - IMAGE1DARRAYSHADOW = 381, - IMAGE2DARRAYSHADOW = 382, - COHERENT = 383, - VOLATILE = 384, - RESTRICT = 385, - READONLY = 386, - WRITEONLY = 387, - ATOMIC_UINT = 388, - STRUCT = 389, - VOID_TOK = 390, - WHILE = 391, - IDENTIFIER = 392, - TYPE_IDENTIFIER = 393, - NEW_IDENTIFIER = 394, - FLOATCONSTANT = 395, - INTCONSTANT = 396, - UINTCONSTANT = 397, - BOOLCONSTANT = 398, - FIELD_SELECTION = 399, - LEFT_OP = 400, - RIGHT_OP = 401, - INC_OP = 402, - DEC_OP = 403, - LE_OP = 404, - GE_OP = 405, - EQ_OP = 406, - NE_OP = 407, - AND_OP = 408, - OR_OP = 409, - XOR_OP = 410, - MUL_ASSIGN = 411, - DIV_ASSIGN = 412, - ADD_ASSIGN = 413, - MOD_ASSIGN = 414, - LEFT_ASSIGN = 415, - RIGHT_ASSIGN = 416, - AND_ASSIGN = 417, - XOR_ASSIGN = 418, - OR_ASSIGN = 419, - SUB_ASSIGN = 420, - INVARIANT = 421, - LOWP = 422, - MEDIUMP = 423, - HIGHP = 424, - SUPERP = 425, - PRECISION = 426, - VERSION_TOK = 427, - EXTENSION = 428, - LINE = 429, - COLON = 430, - EOL = 431, - INTERFACE = 432, - OUTPUT = 433, - PRAGMA_DEBUG_ON = 434, - PRAGMA_DEBUG_OFF = 435, - PRAGMA_OPTIMIZE_ON = 436, - PRAGMA_OPTIMIZE_OFF = 437, - PRAGMA_INVARIANT_ALL = 438, - LAYOUT_TOK = 439, - ASM = 440, - CLASS = 441, - UNION = 442, - ENUM = 443, - TYPEDEF = 444, - TEMPLATE = 445, - THIS = 446, - PACKED_TOK = 447, - GOTO = 448, - INLINE_TOK = 449, - NOINLINE = 450, - PUBLIC_TOK = 451, - STATIC = 452, - EXTERN = 453, - EXTERNAL = 454, - LONG_TOK = 455, - SHORT_TOK = 456, - DOUBLE_TOK = 457, - HALF = 458, - FIXED_TOK = 459, - UNSIGNED = 460, - INPUT_TOK = 461, - OUPTUT = 462, - HVEC2 = 463, - HVEC3 = 464, - HVEC4 = 465, - DVEC2 = 466, - DVEC3 = 467, - DVEC4 = 468, - FVEC2 = 469, - FVEC3 = 470, - FVEC4 = 471, - SAMPLER3DRECT = 472, - SIZEOF = 473, - CAST = 474, - NAMESPACE = 475, - USING = 476, - RESOURCE = 477, - PATCH = 478, - SAMPLE = 479, + SAMPLE = 293, + NOPERSPECTIVE = 294, + FLAT = 295, + SMOOTH = 296, + MAT2X2 = 297, + MAT2X3 = 298, + MAT2X4 = 299, + MAT3X2 = 300, + MAT3X3 = 301, + MAT3X4 = 302, + MAT4X2 = 303, + MAT4X3 = 304, + MAT4X4 = 305, + SAMPLER1D = 306, + SAMPLER2D = 307, + SAMPLER3D = 308, + SAMPLERCUBE = 309, + SAMPLER1DSHADOW = 310, + SAMPLER2DSHADOW = 311, + SAMPLERCUBESHADOW = 312, + SAMPLER1DARRAY = 313, + SAMPLER2DARRAY = 314, + SAMPLER1DARRAYSHADOW = 315, + SAMPLER2DARRAYSHADOW = 316, + SAMPLERCUBEARRAY = 317, + SAMPLERCUBEARRAYSHADOW = 318, + ISAMPLER1D = 319, + ISAMPLER2D = 320, + ISAMPLER3D = 321, + ISAMPLERCUBE = 322, + ISAMPLER1DARRAY = 323, + ISAMPLER2DARRAY = 324, + ISAMPLERCUBEARRAY = 325, + USAMPLER1D = 326, + USAMPLER2D = 327, + USAMPLER3D = 328, + USAMPLERCUBE = 329, + USAMPLER1DARRAY = 330, + USAMPLER2DARRAY = 331, + USAMPLERCUBEARRAY = 332, + SAMPLER2DRECT = 333, + ISAMPLER2DRECT = 334, + USAMPLER2DRECT = 335, + SAMPLER2DRECTSHADOW = 336, + SAMPLERBUFFER = 337, + ISAMPLERBUFFER = 338, + USAMPLERBUFFER = 339, + SAMPLER2DMS = 340, + ISAMPLER2DMS = 341, + USAMPLER2DMS = 342, + SAMPLER2DMSARRAY = 343, + ISAMPLER2DMSARRAY = 344, + USAMPLER2DMSARRAY = 345, + SAMPLEREXTERNALOES = 346, + IMAGE1D = 347, + IMAGE2D = 348, + IMAGE3D = 349, + IMAGE2DRECT = 350, + IMAGECUBE = 351, + IMAGEBUFFER = 352, + IMAGE1DARRAY = 353, + IMAGE2DARRAY = 354, + IMAGECUBEARRAY = 355, + IMAGE2DMS = 356, + IMAGE2DMSARRAY = 357, + IIMAGE1D = 358, + IIMAGE2D = 359, + IIMAGE3D = 360, + IIMAGE2DRECT = 361, + IIMAGECUBE = 362, + IIMAGEBUFFER = 363, + IIMAGE1DARRAY = 364, + IIMAGE2DARRAY = 365, + IIMAGECUBEARRAY = 366, + IIMAGE2DMS = 367, + IIMAGE2DMSARRAY = 368, + UIMAGE1D = 369, + UIMAGE2D = 370, + UIMAGE3D = 371, + UIMAGE2DRECT = 372, + UIMAGECUBE = 373, + UIMAGEBUFFER = 374, + UIMAGE1DARRAY = 375, + UIMAGE2DARRAY = 376, + UIMAGECUBEARRAY = 377, + UIMAGE2DMS = 378, + UIMAGE2DMSARRAY = 379, + IMAGE1DSHADOW = 380, + IMAGE2DSHADOW = 381, + IMAGE1DARRAYSHADOW = 382, + IMAGE2DARRAYSHADOW = 383, + COHERENT = 384, + VOLATILE = 385, + RESTRICT = 386, + READONLY = 387, + WRITEONLY = 388, + ATOMIC_UINT = 389, + STRUCT = 390, + VOID_TOK = 391, + WHILE = 392, + IDENTIFIER = 393, + TYPE_IDENTIFIER = 394, + NEW_IDENTIFIER = 395, + FLOATCONSTANT = 396, + INTCONSTANT = 397, + UINTCONSTANT = 398, + BOOLCONSTANT = 399, + FIELD_SELECTION = 400, + LEFT_OP = 401, + RIGHT_OP = 402, + INC_OP = 403, + DEC_OP = 404, + LE_OP = 405, + GE_OP = 406, + EQ_OP = 407, + NE_OP = 408, + AND_OP = 409, + OR_OP = 410, + XOR_OP = 411, + MUL_ASSIGN = 412, + DIV_ASSIGN = 413, + ADD_ASSIGN = 414, + MOD_ASSIGN = 415, + LEFT_ASSIGN = 416, + RIGHT_ASSIGN = 417, + AND_ASSIGN = 418, + XOR_ASSIGN = 419, + OR_ASSIGN = 420, + SUB_ASSIGN = 421, + INVARIANT = 422, + PRECISE = 423, + LOWP = 424, + MEDIUMP = 425, + HIGHP = 426, + SUPERP = 427, + PRECISION = 428, + VERSION_TOK = 429, + EXTENSION = 430, + LINE = 431, + COLON = 432, + EOL = 433, + INTERFACE = 434, + OUTPUT = 435, + PRAGMA_DEBUG_ON = 436, + PRAGMA_DEBUG_OFF = 437, + PRAGMA_OPTIMIZE_ON = 438, + PRAGMA_OPTIMIZE_OFF = 439, + PRAGMA_INVARIANT_ALL = 440, + LAYOUT_TOK = 441, + ASM = 442, + CLASS = 443, + UNION = 444, + ENUM = 445, + TYPEDEF = 446, + TEMPLATE = 447, + THIS = 448, + PACKED_TOK = 449, + GOTO = 450, + INLINE_TOK = 451, + NOINLINE = 452, + PUBLIC_TOK = 453, + STATIC = 454, + EXTERN = 455, + EXTERNAL = 456, + LONG_TOK = 457, + SHORT_TOK = 458, + DOUBLE_TOK = 459, + HALF = 460, + FIXED_TOK = 461, + UNSIGNED = 462, + INPUT_TOK = 463, + HVEC2 = 464, + HVEC3 = 465, + HVEC4 = 466, + DVEC2 = 467, + DVEC3 = 468, + DVEC4 = 469, + FVEC2 = 470, + FVEC3 = 471, + FVEC4 = 472, + SAMPLER3DRECT = 473, + SIZEOF = 474, + CAST = 475, + NAMESPACE = 476, + USING = 477, + RESOURCE = 478, + PATCH = 479, SUBROUTINE = 480, ERROR_TOK = 481, COMMON = 482, @@ -419,7 +422,7 @@ extern int _mesa_glsl_debug; typedef union YYSTYPE YYSTYPE; union YYSTYPE { -#line 96 "src/glsl/glsl_parser.yy" /* yacc.c:355 */ +#line 99 "src/glsl/glsl_parser.yy" /* yacc.c:355 */ int n; float real; @@ -456,7 +459,7 @@ union YYSTYPE ast_node *else_statement; } selection_rest_statement; -#line 460 "src/glsl/glsl_parser.cpp" /* yacc.c:355 */ +#line 463 "src/glsl/glsl_parser.cpp" /* yacc.c:355 */ }; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 @@ -484,7 +487,7 @@ int _mesa_glsl_parse (struct _mesa_glsl_parse_state *state); /* Copy the second part of user declarations. */ -#line 488 "src/glsl/glsl_parser.cpp" /* yacc.c:358 */ +#line 491 "src/glsl/glsl_parser.cpp" /* yacc.c:358 */ #ifdef short # undef short @@ -728,16 +731,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 5 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 5407 +#define YYLAST 5440 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 257 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 108 /* YYNRULES -- Number of rules. */ -#define YYNRULES 380 +#define YYNRULES 386 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 532 +#define YYNSTATES 540 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ @@ -806,45 +809,45 @@ static const yytype_uint16 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 300, 300, 299, 311, 313, 320, 330, 331, 332, - 333, 334, 347, 349, 353, 354, 355, 359, 368, 376, - 387, 388, 392, 399, 406, 413, 420, 427, 434, 435, - 441, 445, 452, 458, 467, 471, 475, 476, 485, 486, - 490, 491, 495, 501, 513, 517, 523, 530, 540, 541, - 545, 546, 550, 556, 568, 579, 580, 586, 592, 602, - 603, 604, 605, 609, 610, 616, 622, 631, 632, 638, - 647, 648, 654, 663, 664, 670, 676, 682, 691, 692, - 698, 707, 708, 717, 718, 727, 728, 737, 738, 747, - 748, 757, 758, 767, 768, 777, 778, 787, 788, 789, - 790, 791, 792, 793, 794, 795, 796, 797, 801, 805, - 821, 825, 830, 834, 839, 846, 850, 851, 855, 860, - 868, 882, 892, 906, 911, 924, 928, 936, 948, 961, - 967, 973, 983, 988, 989, 999, 1009, 1019, 1033, 1040, - 1049, 1058, 1067, 1076, 1090, 1097, 1108, 1115, 1116, 1126, - 1127, 1131, 1317, 1415, 1441, 1447, 1456, 1462, 1468, 1478, - 1484, 1485, 1486, 1487, 1488, 1507, 1520, 1548, 1571, 1586, - 1606, 1620, 1626, 1634, 1640, 1646, 1652, 1658, 1664, 1670, - 1675, 1680, 1686, 1691, 1699, 1704, 1709, 1723, 1738, 1739, - 1747, 1753, 1759, 1768, 1769, 1770, 1771, 1772, 1773, 1774, - 1775, 1776, 1777, 1778, 1779, 1780, 1781, 1782, 1783, 1784, - 1785, 1786, 1787, 1788, 1789, 1790, 1791, 1792, 1793, 1794, - 1795, 1796, 1797, 1798, 1799, 1800, 1801, 1802, 1803, 1804, - 1805, 1806, 1807, 1808, 1809, 1810, 1811, 1812, 1813, 1814, - 1815, 1816, 1817, 1818, 1819, 1820, 1821, 1822, 1823, 1824, - 1825, 1826, 1827, 1828, 1829, 1830, 1831, 1832, 1833, 1834, - 1835, 1836, 1837, 1838, 1839, 1840, 1841, 1842, 1843, 1844, - 1845, 1846, 1847, 1848, 1849, 1850, 1851, 1852, 1853, 1854, - 1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, - 1865, 1866, 1867, 1868, 1872, 1877, 1882, 1890, 1898, 1907, - 1912, 1920, 1939, 1944, 1952, 1958, 1967, 1968, 1972, 1979, - 1986, 1993, 1999, 2000, 2004, 2005, 2006, 2007, 2008, 2009, - 2013, 2020, 2019, 2033, 2034, 2038, 2044, 2053, 2063, 2075, - 2081, 2090, 2099, 2104, 2112, 2116, 2134, 2142, 2147, 2155, - 2160, 2168, 2176, 2184, 2192, 2200, 2208, 2216, 2223, 2230, - 2240, 2241, 2245, 2247, 2253, 2258, 2267, 2273, 2279, 2285, - 2291, 2300, 2301, 2302, 2303, 2307, 2321, 2325, 2336, 2433, - 2439, 2445, 2455, 2459, 2464, 2472, 2477, 2485, 2509, 2517, - 2578 + 0, 303, 303, 302, 314, 316, 323, 333, 334, 335, + 336, 337, 350, 352, 356, 357, 358, 362, 371, 379, + 387, 398, 399, 403, 410, 417, 424, 431, 438, 445, + 446, 452, 456, 463, 469, 478, 482, 486, 487, 496, + 497, 501, 502, 506, 512, 524, 528, 534, 542, 553, + 554, 558, 559, 563, 569, 581, 593, 594, 600, 606, + 616, 617, 618, 619, 623, 624, 630, 636, 645, 646, + 652, 661, 662, 668, 677, 678, 684, 690, 696, 705, + 706, 712, 721, 722, 731, 732, 741, 742, 751, 752, + 761, 762, 771, 772, 781, 782, 791, 792, 801, 802, + 803, 804, 805, 806, 807, 808, 809, 810, 811, 815, + 819, 835, 839, 844, 848, 853, 860, 864, 865, 869, + 874, 882, 896, 906, 920, 925, 939, 943, 951, 959, + 971, 984, 990, 996, 1006, 1011, 1012, 1022, 1032, 1042, + 1056, 1063, 1073, 1083, 1093, 1103, 1115, 1130, 1137, 1148, + 1155, 1156, 1166, 1167, 1171, 1357, 1497, 1523, 1529, 1538, + 1544, 1550, 1560, 1566, 1571, 1572, 1573, 1574, 1575, 1594, + 1602, 1614, 1638, 1655, 1671, 1691, 1705, 1711, 1719, 1725, + 1731, 1737, 1743, 1749, 1770, 1776, 1781, 1786, 1792, 1797, + 1805, 1811, 1817, 1831, 1846, 1847, 1855, 1861, 1867, 1876, + 1877, 1878, 1879, 1880, 1881, 1882, 1883, 1884, 1885, 1886, + 1887, 1888, 1889, 1890, 1891, 1892, 1893, 1894, 1895, 1896, + 1897, 1898, 1899, 1900, 1901, 1902, 1903, 1904, 1905, 1906, + 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1914, 1915, 1916, + 1917, 1918, 1919, 1920, 1921, 1922, 1923, 1924, 1925, 1926, + 1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934, 1935, 1936, + 1937, 1938, 1939, 1940, 1941, 1942, 1943, 1944, 1945, 1946, + 1947, 1948, 1949, 1950, 1951, 1952, 1953, 1954, 1955, 1956, + 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, + 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, + 1980, 1985, 1990, 1998, 2005, 2014, 2019, 2027, 2046, 2051, + 2059, 2065, 2074, 2075, 2079, 2086, 2093, 2100, 2106, 2107, + 2111, 2112, 2113, 2114, 2115, 2116, 2120, 2127, 2126, 2140, + 2141, 2145, 2151, 2160, 2170, 2182, 2188, 2197, 2206, 2211, + 2219, 2223, 2241, 2249, 2254, 2262, 2267, 2275, 2283, 2291, + 2299, 2307, 2315, 2323, 2330, 2337, 2347, 2348, 2352, 2354, + 2360, 2365, 2374, 2380, 2386, 2392, 2398, 2407, 2408, 2409, + 2410, 2414, 2428, 2432, 2455, 2560, 2566, 2572, 2582, 2586, + 2592, 2601, 2606, 2614, 2638, 2646, 2654 }; #endif @@ -858,9 +861,9 @@ static const char *const yytname[] = "FOR", "IF", "DISCARD", "RETURN", "SWITCH", "CASE", "DEFAULT", "BVEC2", "BVEC3", "BVEC4", "IVEC2", "IVEC3", "IVEC4", "UVEC2", "UVEC3", "UVEC4", "VEC2", "VEC3", "VEC4", "CENTROID", "IN_TOK", "OUT_TOK", "INOUT_TOK", - "UNIFORM", "VARYING", "NOPERSPECTIVE", "FLAT", "SMOOTH", "MAT2X2", - "MAT2X3", "MAT2X4", "MAT3X2", "MAT3X3", "MAT3X4", "MAT4X2", "MAT4X3", - "MAT4X4", "SAMPLER1D", "SAMPLER2D", "SAMPLER3D", "SAMPLERCUBE", + "UNIFORM", "VARYING", "SAMPLE", "NOPERSPECTIVE", "FLAT", "SMOOTH", + "MAT2X2", "MAT2X3", "MAT2X4", "MAT3X2", "MAT3X3", "MAT3X4", "MAT4X2", + "MAT4X3", "MAT4X4", "SAMPLER1D", "SAMPLER2D", "SAMPLER3D", "SAMPLERCUBE", "SAMPLER1DSHADOW", "SAMPLER2DSHADOW", "SAMPLERCUBESHADOW", "SAMPLER1DARRAY", "SAMPLER2DARRAY", "SAMPLER1DARRAYSHADOW", "SAMPLER2DARRAYSHADOW", "SAMPLERCUBEARRAY", "SAMPLERCUBEARRAYSHADOW", @@ -887,17 +890,17 @@ static const char *const yytname[] = "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP", "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN", "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", "XOR_ASSIGN", - "OR_ASSIGN", "SUB_ASSIGN", "INVARIANT", "LOWP", "MEDIUMP", "HIGHP", - "SUPERP", "PRECISION", "VERSION_TOK", "EXTENSION", "LINE", "COLON", - "EOL", "INTERFACE", "OUTPUT", "PRAGMA_DEBUG_ON", "PRAGMA_DEBUG_OFF", - "PRAGMA_OPTIMIZE_ON", "PRAGMA_OPTIMIZE_OFF", "PRAGMA_INVARIANT_ALL", - "LAYOUT_TOK", "ASM", "CLASS", "UNION", "ENUM", "TYPEDEF", "TEMPLATE", - "THIS", "PACKED_TOK", "GOTO", "INLINE_TOK", "NOINLINE", "PUBLIC_TOK", - "STATIC", "EXTERN", "EXTERNAL", "LONG_TOK", "SHORT_TOK", "DOUBLE_TOK", - "HALF", "FIXED_TOK", "UNSIGNED", "INPUT_TOK", "OUPTUT", "HVEC2", "HVEC3", - "HVEC4", "DVEC2", "DVEC3", "DVEC4", "FVEC2", "FVEC3", "FVEC4", - "SAMPLER3DRECT", "SIZEOF", "CAST", "NAMESPACE", "USING", "RESOURCE", - "PATCH", "SAMPLE", "SUBROUTINE", "ERROR_TOK", "COMMON", "PARTITION", + "OR_ASSIGN", "SUB_ASSIGN", "INVARIANT", "PRECISE", "LOWP", "MEDIUMP", + "HIGHP", "SUPERP", "PRECISION", "VERSION_TOK", "EXTENSION", "LINE", + "COLON", "EOL", "INTERFACE", "OUTPUT", "PRAGMA_DEBUG_ON", + "PRAGMA_DEBUG_OFF", "PRAGMA_OPTIMIZE_ON", "PRAGMA_OPTIMIZE_OFF", + "PRAGMA_INVARIANT_ALL", "LAYOUT_TOK", "ASM", "CLASS", "UNION", "ENUM", + "TYPEDEF", "TEMPLATE", "THIS", "PACKED_TOK", "GOTO", "INLINE_TOK", + "NOINLINE", "PUBLIC_TOK", "STATIC", "EXTERN", "EXTERNAL", "LONG_TOK", + "SHORT_TOK", "DOUBLE_TOK", "HALF", "FIXED_TOK", "UNSIGNED", "INPUT_TOK", + "HVEC2", "HVEC3", "HVEC4", "DVEC2", "DVEC3", "DVEC4", "FVEC2", "FVEC3", + "FVEC4", "SAMPLER3DRECT", "SIZEOF", "CAST", "NAMESPACE", "USING", + "RESOURCE", "PATCH", "SUBROUTINE", "ERROR_TOK", "COMMON", "PARTITION", "ACTIVE", "FILTER", "ROW_MAJOR", "THEN", "'('", "')'", "'['", "']'", "'.'", "','", "'+'", "'-'", "'!'", "'~'", "'*'", "'/'", "'%'", "'<'", "'>'", "'&'", "'^'", "'|'", "'?'", "':'", "'='", "';'", "'{'", "'}'", @@ -978,12 +981,12 @@ static const yytype_uint16 yytoknum[] = }; # endif -#define YYPACT_NINF -393 +#define YYPACT_NINF -414 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-393))) + (!!((Yystate) == (-414))) -#define YYTABLE_NINF -372 +#define YYTABLE_NINF -378 #define yytable_value_is_error(Yytable_value) \ 0 @@ -992,60 +995,60 @@ static const yytype_uint16 yytoknum[] = STATE-NUM. */ static const yytype_int16 yypact[] = { - -85, -88, 33, -393, -94, -393, -133, -393, -393, -393, - -393, -80, -75, 4754, -393, -393, -67, -393, -393, -393, - -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, - -393, -393, -393, -393, -393, -393, 12, 19, 36, -393, - -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, - -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, - -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, - -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, - -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, - -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, - -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, - -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, - -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, - -393, -393, -115, -393, -393, 261, -393, -393, -393, 41, - -64, -48, 24, 29, 37, -51, -393, -393, 4754, -393, - -132, -41, -23, 1, -147, -393, 86, 35, 5064, 5269, - 5064, 5064, -393, -6, -393, 5064, -393, -393, -393, -393, - -393, 88, -393, -75, 4943, -24, -393, -393, -393, -393, - -393, 5064, -393, 5064, -393, 5269, -393, -393, -393, -393, - -393, -83, -393, -393, 517, -393, -393, 17, 17, -393, - -393, -393, -393, 5269, 17, 17, -75, -393, 10, 27, - -204, 38, -125, -121, -113, -393, -393, -393, -393, -393, - -393, 3639, 15, -393, 2, 69, -75, 1265, -393, 4943, - 22, -393, -393, 13, -148, -393, -393, 23, 25, 1999, - 45, 50, 31, 3176, 53, 54, -393, -393, -393, -393, - -393, 4085, 4085, 4085, -393, -393, -393, -393, -393, 34, - -393, 56, -393, -101, -393, -393, -393, 57, -145, 4308, - 63, 181, 4085, -3, -96, 42, -108, 66, 55, 60, - 52, 151, 152, -126, -393, -393, -140, -393, 59, 5083, - 77, -393, -393, -393, -393, 771, -393, -393, -393, -393, - -393, -393, -393, -393, -393, -75, -393, -393, -187, 2953, - -175, -393, -393, -393, -393, -393, -393, -393, 75, -393, - 3862, 4943, -393, -6, -138, -393, -393, -393, 1502, -393, - 79, -393, -83, -393, -393, 176, 2492, 4085, -393, -393, - -127, 4085, 3416, -393, -393, -117, -393, 1999, -393, -393, - 4085, 86, -393, -393, 4085, 80, -393, -393, -393, -393, - -393, -393, -393, -393, -393, -393, -393, -393, -393, 4085, - -393, 4085, 4085, 4085, 4085, 4085, 4085, 4085, 4085, 4085, - 4085, 4085, 4085, 4085, 4085, 4085, 4085, 4085, 4085, 4085, - 4085, 4085, -393, -393, -393, -6, 2953, -159, 2953, -393, - -393, 2953, -393, -393, 81, -75, 62, 4943, 15, -75, - -393, -393, -393, -393, -393, -393, 83, -393, -393, 3416, - -89, -393, -58, 82, -75, 85, -393, 1025, 90, 82, - -393, 89, -393, 87, -40, 4531, -393, -393, -393, -393, - -393, -3, -3, -96, -96, 42, 42, 42, 42, -108, - -108, 66, 55, 60, 52, 151, 152, -173, -393, 15, - -393, 2953, -393, -161, -393, -393, -112, 185, -393, -393, - 4085, -393, 73, 94, 1999, 76, 95, 2252, -393, -393, - -393, -393, -393, 4085, 96, -393, 4085, -393, 2730, -393, - -393, -6, 93, -39, 4085, 2252, 321, -393, -10, -393, - 2953, -393, -393, -393, -393, -393, -393, -393, 15, -393, - 98, 82, -393, 1999, 4085, 97, -393, -393, 1746, 1999, - -8, -393, -393, -393, -139, -393, -393, -393, -393, -393, - 1999, -393 + -129, -92, 53, -414, -103, -414, -57, -414, -414, -414, + -414, -58, -54, 4836, -414, -414, -51, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -17, -12, -414, 13, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -119, -414, -414, 266, 266, -414, + -414, -414, 15, -33, -14, -8, -3, 10, -37, -414, + 4652, -414, -196, -26, -27, 30, -199, -414, 54, 314, + 5129, 5301, 5129, 5129, -414, -15, -414, 5129, -414, -414, + -414, -414, -414, 82, -414, -54, 5007, -31, -414, -414, + -414, -414, -414, 5129, 5129, -414, 5129, -414, -414, -414, + 5301, -414, -414, -414, -414, -414, -107, -414, -414, -414, + 525, -414, -414, 36, 36, -414, -414, -414, 36, -414, + 5301, 36, 36, -54, -414, 3, 11, -197, 12, -123, + -116, -114, -414, -414, -414, -414, -414, -414, 3625, -5, + -414, -23, 68, -54, 1273, -414, 5007, -16, -414, -414, + -2, -143, -414, -414, 0, 1, 2007, 16, 20, 2, + 3184, 24, 28, -414, -414, -414, -414, -414, 4027, 4027, + 4027, -414, -414, -414, -414, -414, 6, -414, 32, -414, + -105, -414, -414, -414, 14, -122, 4228, 34, 222, 4027, + -18, -73, 26, -104, 27, 23, 25, 22, 119, 121, + -126, -414, -414, -160, -414, 21, 5149, 46, -414, -414, + -414, -414, 779, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -54, -414, -414, -193, 2961, -186, -414, + -414, -414, -414, -414, -414, -414, 47, -414, 3826, 5007, + -414, -15, -155, -414, -414, -414, 1510, -414, 60, -414, + -107, -414, -414, 147, 2500, 4027, -414, -414, -146, 4027, + 3424, -414, -414, -121, -414, 2007, -414, -414, 4027, 54, + -414, -414, 4027, 51, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -414, -414, -414, 4027, -414, 4027, + 4027, 4027, 4027, 4027, 4027, 4027, 4027, 4027, 4027, 4027, + 4027, 4027, 4027, 4027, 4027, 4027, 4027, 4027, 4027, 4027, + -414, -414, -414, -15, 2961, -174, 2961, -414, -414, 2961, + -414, -414, 50, -54, 38, 5007, -5, -54, -414, -414, + -414, -414, -414, -414, 55, -414, -414, 3424, -88, -414, + -87, 52, -54, 58, -414, 1033, 59, 52, -414, 63, + -414, 74, -76, 4429, -414, -414, -414, -414, -414, -18, + -18, -73, -73, 26, 26, 26, 26, -104, -104, 27, + 23, 25, 22, 119, 121, -156, -414, -5, -414, 2961, + -414, -176, -414, -414, -145, 157, -414, -414, 4027, -414, + 56, 77, 2007, 64, 61, 2260, -414, -414, -414, -414, + -414, 4027, 79, -414, 4027, -414, 2738, -414, -414, -15, + 66, -69, 4027, 2260, 303, -414, -6, -414, 2961, -414, + -414, -414, -414, -414, -414, -414, -5, -414, 67, 52, + -414, 2007, 4027, 70, -414, -414, 1754, 2007, -4, -414, + -414, -414, -117, -414, -414, -414, -414, -414, 2007, -414 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -1054,91 +1057,91 @@ static const yytype_int16 yypact[] = static const yytype_uint16 yydefact[] = { 4, 0, 0, 12, 0, 1, 2, 14, 15, 16, - 5, 0, 0, 0, 13, 6, 0, 174, 173, 197, - 194, 195, 196, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 198, 199, 200, 171, 176, 177, 178, 175, - 158, 157, 156, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 222, 223, 225, 226, 228, 229, - 230, 231, 232, 234, 235, 236, 237, 239, 240, 241, - 242, 244, 245, 246, 248, 249, 250, 251, 253, 221, - 238, 247, 227, 233, 243, 252, 254, 255, 256, 257, - 258, 259, 224, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 179, 180, 181, 182, - 183, 293, 0, 193, 192, 159, 296, 295, 294, 0, - 0, 0, 0, 0, 0, 0, 172, 363, 3, 362, - 0, 0, 117, 125, 0, 133, 138, 163, 162, 0, - 160, 161, 144, 188, 190, 164, 191, 18, 361, 114, - 366, 0, 364, 0, 0, 0, 176, 177, 178, 20, - 21, 159, 143, 163, 165, 0, 7, 8, 9, 10, - 11, 0, 19, 111, 0, 365, 115, 125, 125, 129, - 130, 131, 118, 0, 125, 125, 0, 112, 14, 16, - 139, 0, 176, 177, 178, 167, 367, 166, 145, 168, - 169, 0, 189, 170, 0, 0, 0, 0, 299, 0, - 0, 155, 154, 151, 0, 147, 153, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 25, 23, 24, 26, - 47, 0, 0, 0, 59, 60, 61, 62, 329, 321, - 325, 22, 28, 55, 30, 35, 36, 0, 0, 41, - 0, 63, 0, 67, 70, 73, 78, 81, 83, 85, - 87, 89, 91, 93, 95, 108, 0, 311, 0, 163, - 144, 314, 327, 313, 312, 0, 315, 316, 317, 318, - 319, 119, 126, 123, 124, 132, 127, 128, 134, 0, - 140, 120, 379, 380, 378, 184, 63, 110, 0, 45, - 0, 0, 17, 304, 0, 302, 298, 300, 0, 113, - 0, 146, 0, 357, 356, 0, 0, 0, 360, 358, - 0, 0, 0, 56, 57, 0, 320, 0, 32, 33, - 0, 0, 39, 38, 0, 193, 42, 44, 98, 99, - 101, 100, 103, 104, 105, 106, 107, 102, 97, 0, - 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 13, 6, 0, 179, 178, 203, + 200, 201, 202, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 204, 205, 206, 176, 181, 182, 183, 184, + 180, 177, 161, 160, 159, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 228, 229, 231, 232, + 234, 235, 236, 237, 238, 240, 241, 242, 243, 245, + 246, 247, 248, 250, 251, 252, 254, 255, 256, 257, + 259, 227, 244, 253, 233, 239, 249, 258, 260, 261, + 262, 263, 264, 265, 230, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 185, 186, + 187, 188, 189, 299, 0, 199, 198, 162, 163, 302, + 301, 300, 0, 0, 0, 0, 0, 0, 0, 369, + 3, 368, 0, 0, 118, 126, 0, 135, 140, 167, + 166, 0, 164, 165, 147, 194, 196, 168, 197, 18, + 367, 115, 372, 0, 370, 0, 0, 0, 181, 182, + 184, 21, 22, 162, 163, 145, 167, 170, 146, 169, + 0, 7, 8, 9, 10, 11, 0, 20, 19, 112, + 0, 371, 116, 126, 126, 131, 132, 133, 126, 119, + 0, 126, 126, 0, 113, 14, 16, 141, 0, 181, + 182, 184, 172, 373, 171, 148, 173, 174, 0, 195, + 175, 0, 0, 0, 0, 305, 0, 0, 158, 157, + 154, 0, 150, 156, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 26, 24, 25, 27, 48, 0, 0, + 0, 60, 61, 62, 63, 335, 327, 331, 23, 29, + 56, 31, 36, 37, 0, 0, 42, 0, 64, 0, + 68, 71, 74, 79, 82, 84, 86, 88, 90, 92, + 94, 96, 109, 0, 317, 0, 167, 147, 320, 333, + 319, 318, 0, 321, 322, 323, 324, 325, 120, 127, + 128, 124, 125, 134, 129, 130, 136, 0, 142, 121, + 385, 386, 384, 190, 64, 111, 0, 46, 0, 0, + 17, 310, 0, 308, 304, 306, 0, 114, 0, 149, + 0, 363, 362, 0, 0, 0, 366, 364, 0, 0, + 0, 57, 58, 0, 326, 0, 33, 34, 0, 0, + 40, 39, 0, 199, 43, 45, 99, 100, 102, 101, + 104, 105, 106, 107, 108, 103, 98, 0, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 330, 326, 328, 121, 0, 135, 0, 306, - 142, 0, 185, 186, 0, 0, 0, 375, 305, 0, - 301, 297, 149, 150, 152, 148, 0, 351, 350, 353, - 0, 359, 0, 334, 0, 0, 27, 0, 0, 34, - 31, 0, 37, 0, 0, 51, 43, 96, 64, 65, - 66, 68, 69, 71, 72, 76, 77, 74, 75, 79, - 80, 82, 84, 86, 88, 90, 92, 0, 109, 122, - 137, 0, 309, 0, 141, 187, 0, 372, 376, 303, - 0, 352, 0, 0, 0, 0, 0, 0, 322, 29, - 54, 49, 48, 0, 193, 52, 0, 136, 0, 307, - 377, 373, 0, 0, 354, 0, 333, 331, 0, 336, - 0, 324, 347, 323, 53, 94, 308, 310, 374, 368, - 0, 355, 349, 0, 0, 0, 337, 341, 0, 345, - 0, 335, 348, 332, 0, 340, 343, 342, 344, 338, - 346, 339 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 336, 332, 334, 122, 0, 137, 0, 312, 144, 0, + 191, 192, 0, 0, 0, 381, 311, 0, 307, 303, + 152, 153, 155, 151, 0, 357, 356, 359, 0, 365, + 0, 340, 0, 0, 28, 0, 0, 35, 32, 0, + 38, 0, 0, 52, 44, 97, 65, 66, 67, 69, + 70, 72, 73, 77, 78, 75, 76, 80, 81, 83, + 85, 87, 89, 91, 93, 0, 110, 123, 139, 0, + 315, 0, 143, 193, 0, 378, 382, 309, 0, 358, + 0, 0, 0, 0, 0, 0, 328, 30, 55, 50, + 49, 0, 199, 53, 0, 138, 0, 313, 383, 379, + 0, 0, 360, 0, 339, 337, 0, 342, 0, 330, + 353, 329, 54, 95, 314, 316, 380, 374, 0, 361, + 355, 0, 0, 0, 343, 347, 0, 351, 0, 341, + 354, 338, 0, 346, 349, 348, 350, 344, 352, 345 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -393, -393, -393, -393, -393, -393, 0, -393, -393, -119, - -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, - -393, -393, -393, -393, -14, -393, -141, -124, -111, -110, - -49, -35, -33, -32, -34, -12, -393, -196, -239, -393, - -240, 61, 6, 7, -393, -393, -393, -393, 159, -27, - -393, -393, -393, -393, -168, -11, -393, -393, 44, -393, - -393, -77, -393, -393, -203, -13, -393, -393, 58, -393, - 149, -210, -26, -29, -369, -393, 46, -238, -392, -393, - -393, -109, 233, 40, 48, -393, -393, -31, -393, -393, - -123, -393, -135, -393, -393, -393, -393, -393, -393, 248, - -393, -393, -142, -393, -393, -5, -393, -393 + -414, -414, -414, -414, -414, -414, -1, 174, -414, -128, + -414, -414, -414, -414, -414, -414, -414, -414, -414, -414, + -414, -414, -414, -414, -19, -414, -169, -142, -170, -162, + -67, -66, -68, -65, -64, -63, -414, -206, -228, -414, + -244, 7, -9, 5, -414, -414, -414, -414, 125, -52, + -414, -414, -414, -414, -168, -11, -414, -414, 17, -414, + -414, -86, -414, -414, -212, -13, -414, -414, -101, -414, + 93, -207, -77, -79, -381, -414, 45, -245, -413, -414, + -414, -163, 189, -10, 48, -414, -414, -84, -414, -414, + -167, -414, -172, -414, -414, -414, -414, -414, -414, 240, + -414, -414, -152, -414, -414, -24, -414, -414 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 2, 13, 3, 147, 6, 323, 14, 148, 261, - 262, 263, 428, 264, 265, 266, 267, 268, 269, 270, - 432, 433, 434, 435, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 369, - 286, 318, 287, 288, 151, 152, 153, 303, 202, 203, - 204, 304, 154, 155, 156, 183, 234, 414, 235, 236, - 158, 159, 160, 161, 222, 319, 163, 164, 165, 166, - 227, 228, 324, 325, 400, 463, 291, 292, 293, 294, - 347, 502, 503, 295, 296, 297, 497, 425, 298, 499, - 517, 518, 519, 520, 299, 419, 472, 473, 300, 167, - 168, 169, 170, 171, 492, 406, 407, 172 + -1, 2, 13, 3, 149, 6, 331, 14, 150, 268, + 269, 270, 436, 271, 272, 273, 274, 275, 276, 277, + 440, 441, 442, 443, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 377, + 293, 326, 294, 295, 153, 154, 155, 311, 209, 210, + 211, 312, 156, 157, 158, 186, 241, 422, 242, 243, + 160, 161, 162, 163, 229, 327, 165, 166, 167, 168, + 234, 235, 332, 333, 408, 471, 298, 299, 300, 301, + 355, 510, 511, 302, 303, 304, 505, 433, 305, 507, + 525, 526, 527, 528, 306, 427, 480, 481, 307, 169, + 170, 171, 172, 173, 500, 414, 415, 174 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -1146,62 +1149,284 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 162, 335, 157, 340, 11, 198, 226, 310, 514, 515, - 514, 515, 16, 345, -369, 216, 182, 327, -370, 149, - 150, 198, 7, 8, 9, 317, -371, 460, 389, 462, - 356, 221, 464, 5, 199, 200, 201, 211, 17, 18, - 12, 378, 379, 7, 8, 9, 348, 349, 221, 309, - 199, 200, 201, 4, 7, 8, 9, 394, 184, 226, - 320, 226, 7, 8, 9, 391, 396, 35, 212, 213, - 399, 214, 39, 40, 41, 42, 320, 488, 401, 486, - 215, 217, 10, 219, 220, 501, 331, 1, 223, 353, - 332, 206, 487, 354, 461, 489, 15, 420, 391, 391, - 409, 422, 423, 501, 184, 397, 215, 207, 173, 231, - 429, 391, 186, 531, 392, 436, 410, 426, 327, 507, - 408, 391, 193, 194, 317, 390, 409, 421, 187, 312, - 437, 521, 175, 313, 350, 162, 351, 157, 380, 381, - 174, 314, 490, 374, 375, 474, 218, 216, 232, 391, - 457, -369, 458, 405, 149, 150, 210, 399, -370, 399, - 226, 162, 399, 126, 127, 128, 129, 130, 136, 137, - 138, 302, 230, 225, 424, -371, 475, 306, 307, 423, - 391, 290, 191, 289, 136, 137, 138, 376, 377, 394, - 305, 233, 459, 196, 482, 510, 485, 185, 483, 391, - 188, 181, 136, 137, 138, 189, 308, 316, 136, 137, - 138, 205, 215, 190, 162, 197, 162, 382, 383, 145, - 412, 413, 399, 208, 8, 209, 290, 224, 289, 221, - 493, 229, 431, 441, 442, -116, 496, 343, 344, 405, - 371, 372, 373, -20, 504, 322, 516, 505, 529, 399, - 320, 424, 443, 444, 511, 205, 205, 321, 370, 146, - -21, 399, 205, 205, 17, 18, 330, 445, 446, 447, - 448, 311, 449, 450, 524, 523, 329, 333, 336, 334, - 526, 528, 290, 337, 289, 338, 341, 342, 508, -46, - 346, 352, 528, 35, 176, 177, 357, 178, 39, 40, - 41, 42, 386, 384, 387, 395, 316, 388, 162, 385, - -45, 402, 416, 193, -40, 162, 470, 465, 467, 477, - 391, 481, 480, 290, 491, 289, 479, 494, 495, 290, - -50, 498, 233, 513, 290, 451, 289, 358, 359, 360, - 361, 362, 363, 364, 365, 366, 367, 509, 500, 525, - 452, 430, 522, 453, 455, 454, 301, 438, 439, 440, - 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, - 316, 316, 316, 316, 316, 316, 415, 456, 328, 466, - 469, 404, 417, 195, 418, 530, 512, 427, 471, 126, - 127, 128, 129, 130, 162, 527, 192, 0, 179, 0, - 180, 0, 468, 0, 0, 0, 290, 0, 0, 0, - 0, 0, 0, 0, 290, 0, 289, 0, 0, 0, - 0, 0, 0, 0, 476, 0, 0, 181, 136, 137, - 138, 0, 0, 0, 368, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 145, 0, 0, 0, 0, + 164, 343, 159, 11, 151, 318, 348, 223, 233, 185, + 188, 16, 522, 523, 522, 523, 353, -375, 152, 7, + 8, 9, 325, 468, -376, 470, -377, 335, 472, 397, + 218, 7, 8, 9, 204, 7, 8, 9, 228, 213, + 204, 190, 228, 356, 357, 1, 386, 387, 364, 328, + 4, 187, 189, 5, 212, 214, 317, 402, 199, 200, + 404, 328, 496, 205, 206, 207, 233, 409, 233, 205, + 206, 207, 509, 222, 224, 10, 226, 227, 399, 469, + 497, 230, 399, 417, 7, 8, 9, 238, 495, 407, + 509, 339, 399, 417, 400, 340, 494, 187, 189, 418, + 222, 428, 212, 212, 405, 430, 431, 212, 429, 498, + 212, 212, 361, 434, 437, 515, 362, 399, 12, 416, + 15, 399, 325, -375, 239, 398, 175, 529, -376, 335, + 358, 320, 359, 177, 444, 539, 176, 164, 321, 159, + 322, 151, 388, 389, 223, 191, 482, 483, 225, 445, + 399, 399, 309, -377, 465, 152, 310, 217, 490, 314, + 315, 413, 491, 164, 192, 518, 382, 383, 233, 399, + 193, 466, 384, 385, 232, 194, 407, 237, 407, 390, + 391, 407, 432, 431, 139, 140, 141, 297, 195, 296, + 402, 467, 215, 8, 216, 240, 196, 313, 208, 139, + 140, 141, 420, 421, 208, 139, 140, 141, 202, 324, + 222, 203, 316, 449, 450, 493, 453, 454, 455, 456, + 228, 164, 231, 164, 236, 379, 380, 381, 457, 458, + 328, 439, 329, 297, 501, 296, -21, 504, 337, 351, + 352, 407, 451, 452, -22, 319, 330, 413, 360, 344, + 524, 338, 537, 345, 341, 342, 346, 349, 519, 432, + 378, 350, 354, 512, -117, -47, 513, 365, 407, 17, + 18, 392, 394, 395, 393, 199, 531, 396, 532, -46, + 407, 534, 536, 410, 424, -41, 473, 516, 478, 297, + 399, 296, 485, 536, 475, 487, 488, 499, 35, 178, + 179, 38, 180, 40, 41, 42, 43, 44, 489, 324, + 502, 503, 403, -51, 508, 521, 164, 17, 18, 506, + 517, 530, 533, 164, 197, 459, 461, 460, 308, 336, + 462, 297, 463, 296, 464, 412, 474, 297, 477, 240, + 520, 201, 297, 479, 296, 435, 35, 219, 220, 38, + 221, 40, 41, 42, 43, 44, 538, 423, 438, 535, + 446, 447, 448, 324, 324, 324, 324, 324, 324, 324, + 324, 324, 324, 324, 324, 324, 324, 324, 324, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 425, + 198, 476, 426, 0, 0, 128, 129, 130, 131, 132, + 0, 0, 164, 0, 181, 0, 182, 0, 0, 0, + 0, 0, 0, 0, 297, 0, 0, 0, 0, 0, + 0, 0, 297, 0, 296, 0, 0, 0, 0, 0, + 0, 484, 0, 183, 184, 139, 140, 141, 0, 0, + 0, 0, 0, 128, 129, 130, 131, 132, 0, 0, + 0, 0, 148, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 297, + 0, 296, 297, 0, 296, 376, 0, 0, 0, 0, + 0, 183, 184, 139, 140, 141, 0, 0, 0, 0, + 297, 0, 296, 0, 0, 0, 0, 0, 0, 0, + 148, 0, 0, 0, 0, 0, 0, 0, 297, 0, + 296, 0, 0, 297, 297, 296, 296, 0, 0, 0, + 0, 0, 0, 0, 0, 297, 0, 296, 17, 18, + 19, 20, 21, 22, 244, 245, 246, 0, 247, 248, + 249, 250, 251, 0, 0, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 0, 0, 0, 0, 128, 129, 130, 131, 132, 133, + 134, 135, 252, 181, 136, 182, 253, 254, 255, 256, + 257, 0, 0, 258, 259, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 290, 0, 289, 290, 0, 289, 0, 0, 0, + 0, 0, 137, 138, 139, 140, 141, 0, 142, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 290, 0, 289, 146, 0, 0, 0, 0, + 0, 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 290, 0, 289, 0, 0, 290, 290, 289, 289, 0, - 0, 0, 0, 0, 0, 0, 0, 290, 0, 289, - 17, 18, 19, 20, 21, 22, 237, 238, 239, 0, - 240, 241, 242, 243, 244, 0, 0, 23, 24, 25, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 260, 0, + 0, 0, 0, 0, 261, 262, 263, 264, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 265, + 266, 267, 17, 18, 19, 20, 21, 22, 244, 245, + 246, 0, 247, 248, 249, 250, 251, 0, 0, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 0, 0, 0, 0, 128, 129, + 130, 131, 132, 133, 134, 135, 252, 181, 136, 182, + 253, 254, 255, 256, 257, 0, 0, 258, 259, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 137, 138, 139, 140, + 141, 0, 142, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 148, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 260, 0, 0, 0, 0, 0, 261, 262, + 263, 264, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 265, 266, 401, 17, 18, 19, 20, + 21, 22, 244, 245, 246, 0, 247, 248, 249, 250, + 251, 0, 0, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 0, 0, + 0, 0, 128, 129, 130, 131, 132, 133, 134, 135, + 252, 181, 136, 182, 253, 254, 255, 256, 257, 0, + 0, 258, 259, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 137, 138, 139, 140, 141, 0, 142, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 260, 0, 0, 0, + 0, 0, 261, 262, 263, 264, 17, 18, 19, 20, + 21, 22, 0, 0, 0, 0, 0, 265, 266, 486, + 0, 0, 0, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 178, 179, 38, 180, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 0, 0, + 0, 0, 128, 129, 130, 131, 132, 133, 134, 135, + 0, 0, 136, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 183, 184, 139, 140, 141, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 17, 18, 19, 20, 21, 22, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 334, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 178, 179, 38, 180, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 0, 0, 0, 0, 128, + 129, 130, 131, 132, 133, 134, 135, 0, 0, 136, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 183, 184, 139, + 140, 141, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 148, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 17, 18, 19, + 20, 21, 22, 244, 245, 246, 419, 247, 248, 249, + 250, 251, 522, 523, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 0, + 0, 0, 0, 128, 129, 130, 131, 132, 133, 134, + 135, 252, 181, 136, 182, 253, 254, 255, 256, 257, + 0, 0, 258, 259, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 137, 138, 139, 140, 141, 0, 142, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 260, 0, 0, + 0, 0, 0, 261, 262, 263, 264, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 265, 266, + 17, 18, 19, 20, 21, 22, 244, 245, 246, 0, + 247, 248, 249, 250, 251, 0, 0, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 0, 38, 39, 40, 41, 42, 43, 44, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 0, 0, 0, 0, 128, 129, 130, 131, + 132, 133, 134, 135, 252, 181, 136, 182, 253, 254, + 255, 256, 257, 0, 0, 258, 259, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 137, 138, 139, 140, 141, 0, + 142, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 148, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 260, 0, 0, 0, 0, 0, 261, 262, 263, 264, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 265, 266, 17, 18, 19, 20, 21, 22, 244, + 245, 246, 0, 247, 248, 249, 250, 251, 0, 0, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 0, 0, 0, 0, 128, + 129, 130, 131, 132, 133, 134, 135, 252, 181, 136, + 182, 253, 254, 255, 256, 257, 0, 0, 258, 259, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 137, 138, 139, + 140, 141, 0, 142, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 148, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 260, 0, 0, 0, 0, 0, 261, + 262, 263, 264, 17, 18, 19, 20, 21, 22, 0, + 0, 0, 0, 0, 265, 200, 0, 0, 0, 0, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 0, 0, 0, 0, 128, + 129, 130, 131, 132, 133, 134, 135, 0, 181, 136, + 182, 253, 254, 255, 256, 257, 0, 0, 258, 259, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 137, 138, 139, + 140, 141, 0, 142, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 148, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 260, 0, 0, 0, 0, 0, 261, + 262, 263, 264, 19, 20, 21, 22, 0, 0, 0, + 0, 0, 0, 0, 265, 0, 0, 0, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, @@ -1210,388 +1435,9 @@ static const yytype_int16 yytable[] = 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 0, 0, 0, 0, 126, 127, 128, 129, 130, - 131, 132, 133, 245, 179, 134, 180, 246, 247, 248, - 249, 250, 0, 0, 251, 252, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 135, 136, 137, 138, 0, 139, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 145, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, - 253, 0, 0, 0, 0, 0, 254, 255, 256, 257, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 258, 259, 260, 17, 18, 19, 20, 21, 22, - 237, 238, 239, 0, 240, 241, 242, 243, 244, 0, - 0, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 0, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 0, 0, 0, 0, 126, - 127, 128, 129, 130, 131, 132, 133, 245, 179, 134, - 180, 246, 247, 248, 249, 250, 0, 0, 251, 252, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 135, 136, 137, - 138, 0, 139, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 145, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 146, 0, 0, 0, 0, - 0, 0, 0, 0, 253, 0, 0, 0, 0, 0, - 254, 255, 256, 257, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 258, 259, 393, 17, 18, - 19, 20, 21, 22, 237, 238, 239, 0, 240, 241, - 242, 243, 244, 0, 0, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 0, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 0, - 0, 0, 0, 126, 127, 128, 129, 130, 131, 132, - 133, 245, 179, 134, 180, 246, 247, 248, 249, 250, - 0, 0, 251, 252, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 135, 136, 137, 138, 0, 139, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 145, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 146, - 0, 0, 0, 0, 0, 0, 0, 0, 253, 0, - 0, 0, 0, 0, 254, 255, 256, 257, 17, 18, - 19, 20, 21, 22, 0, 0, 0, 0, 0, 258, - 259, 478, 0, 0, 0, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 176, 177, - 0, 178, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 0, - 0, 0, 0, 126, 127, 128, 129, 130, 131, 132, - 133, 0, 0, 134, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 181, 136, 137, 138, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 145, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 146, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 17, 18, 19, 20, 21, - 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 326, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 176, 177, 0, 178, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 0, 0, 0, 0, - 126, 127, 128, 129, 130, 131, 132, 133, 0, 0, - 134, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 181, 136, - 137, 138, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 145, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 146, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, - 18, 19, 20, 21, 22, 237, 238, 239, 411, 240, - 241, 242, 243, 244, 514, 515, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 0, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 0, 0, 0, 0, 126, 127, 128, 129, 130, 131, - 132, 133, 245, 179, 134, 180, 246, 247, 248, 249, - 250, 0, 0, 251, 252, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 135, 136, 137, 138, 0, 139, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 145, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 146, 0, 0, 0, 0, 0, 0, 0, 0, 253, - 0, 0, 0, 0, 0, 254, 255, 256, 257, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 258, 259, 17, 18, 19, 20, 21, 22, 237, 238, - 239, 0, 240, 241, 242, 243, 244, 0, 0, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 0, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 0, 0, 0, 0, 126, 127, 128, - 129, 130, 131, 132, 133, 245, 179, 134, 180, 246, - 247, 248, 249, 250, 0, 0, 251, 252, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 135, 136, 137, 138, 0, - 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 145, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 146, 0, 0, 0, 0, 0, 0, - 0, 0, 253, 0, 0, 0, 0, 0, 254, 255, - 256, 257, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 258, 259, 17, 18, 19, 20, 21, - 22, 237, 238, 239, 0, 240, 241, 242, 243, 244, - 0, 0, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 0, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 0, 0, 0, 0, - 126, 127, 128, 129, 130, 131, 132, 133, 245, 179, - 134, 180, 246, 247, 248, 249, 250, 0, 0, 251, - 252, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 135, 136, - 137, 138, 0, 139, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 145, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 146, 0, 0, 0, - 0, 0, 0, 0, 0, 253, 0, 0, 0, 0, - 0, 254, 255, 256, 257, 17, 18, 19, 20, 21, - 22, 0, 0, 0, 0, 0, 258, 194, 0, 0, - 0, 0, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 0, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 0, 0, 0, 0, - 126, 127, 128, 129, 130, 131, 132, 133, 0, 179, - 134, 180, 246, 247, 248, 249, 250, 0, 0, 251, - 252, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 135, 136, - 137, 138, 0, 139, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 145, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 146, 0, 0, 0, - 0, 0, 0, 0, 0, 253, 0, 0, 0, 0, - 0, 254, 255, 256, 257, 19, 20, 21, 22, 0, - 0, 0, 0, 0, 0, 0, 258, 0, 0, 0, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 131, 132, 133, 0, 179, 134, 180, - 246, 247, 248, 249, 250, 0, 0, 251, 252, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 19, 20, - 21, 22, 0, 253, 0, 0, 0, 0, 0, 254, - 255, 256, 257, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 398, 506, 0, 0, 0, - 0, 0, 0, 0, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 131, 132, 133, 0, - 179, 134, 180, 246, 247, 248, 249, 250, 0, 0, - 251, 252, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 19, 20, 21, 22, 0, 253, 0, 0, 0, - 0, 0, 254, 255, 256, 257, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 398, 0, - 0, 0, 0, 0, 0, 0, 0, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 131, - 132, 133, 0, 179, 134, 180, 246, 247, 248, 249, - 250, 0, 0, 251, 252, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 253, - 0, 0, 0, 0, 0, 254, 255, 256, 257, 17, - 18, 19, 20, 21, 22, 0, 0, 0, 0, 0, - 339, 0, 0, 0, 0, 0, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 176, - 177, 0, 178, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 0, 0, 0, 0, 126, 127, 128, 129, 130, 131, - 132, 133, 0, 179, 134, 180, 246, 247, 248, 249, - 250, 0, 0, 251, 252, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 181, 136, 137, 138, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 145, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 146, 0, 0, 0, 19, 20, 21, 22, 0, 253, - 0, 0, 0, 0, 0, 254, 255, 256, 257, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 131, 132, 133, 0, 179, 134, 180, 246, - 247, 248, 249, 250, 0, 0, 251, 252, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 19, 20, 21, - 22, 0, 253, 0, 0, 315, 0, 0, 254, 255, - 256, 257, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 131, 132, 133, 0, 179, - 134, 180, 246, 247, 248, 249, 250, 0, 0, 251, - 252, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 19, 20, 21, 22, 0, 253, 0, 0, 403, 0, - 0, 254, 255, 256, 257, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 131, 132, - 133, 0, 179, 134, 180, 246, 247, 248, 249, 250, - 0, 0, 251, 252, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 19, 20, 21, 22, 0, 253, 0, - 0, 0, 0, 0, 254, 255, 256, 257, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 131, 132, 355, 0, 179, 134, 180, 246, 247, - 248, 249, 250, 0, 0, 251, 252, 0, 0, 0, + 125, 126, 127, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 133, 134, 135, 0, 181, 136, 182, 253, + 254, 255, 256, 257, 0, 0, 258, 259, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1600,51 +1446,32 @@ static const yytype_int16 yytable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 20, 21, 22, - 0, 253, 0, 0, 0, 0, 0, 254, 255, 256, - 257, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 131, 132, 484, 0, 179, 134, - 180, 246, 247, 248, 249, 250, 0, 0, 251, 252, + 0, 260, 0, 0, 0, 0, 0, 261, 262, 263, + 264, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 406, 514, 0, 0, 0, 0, 0, + 0, 0, 0, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 133, 134, 135, 0, 181, + 136, 182, 253, 254, 255, 256, 257, 0, 0, 258, + 259, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 17, 18, 19, - 20, 21, 22, 0, 253, 0, 0, 0, 0, 0, - 254, 255, 256, 257, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 0, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 0, 0, - 0, 0, 126, 127, 128, 129, 130, 131, 132, 133, - 0, 0, 134, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 135, 136, 137, 138, 0, 139, 0, 0, 0, 0, - 0, 0, 0, 140, 141, 142, 143, 144, 145, 0, - 0, 0, 0, 0, 0, 0, 17, 18, 19, 20, - 21, 22, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 176, 177, 146, 178, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, + 20, 21, 22, 0, 260, 0, 0, 0, 0, 0, + 261, 262, 263, 264, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 406, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, @@ -1652,127 +1479,23 @@ static const yytype_int16 yytable[] = 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 17, 18, 0, - 0, 126, 127, 128, 129, 130, 131, 132, 133, 0, - 0, 134, 0, 0, 0, 0, 17, 18, 0, 0, - 0, 0, 0, 0, 0, 0, 35, 176, 177, 0, - 178, 39, 40, 41, 42, 0, 0, 0, 0, 181, - 136, 137, 138, 0, 0, 35, 36, 37, 0, 38, - 39, 40, 41, 42, 0, 0, 0, 145, 0, 0, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 133, 134, + 135, 0, 181, 136, 182, 253, 254, 255, 256, 257, + 0, 0, 258, 259, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 126, 127, 128, 129, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 126, 127, 128, 129, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 181, 136, 137, 138, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 145, 181, - 136, 137, 138, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 145, 0, 0, - 0, 0, 0, 0, 19, 20, 21, 22, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 146, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 0, 0, 0, 0, 0, 0, 146, 0, 0, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 131, 132, 133, 0, 0, 134 -}; - -static const yytype_int16 yycheck[] = -{ - 13, 239, 13, 243, 4, 4, 174, 210, 18, 19, - 18, 19, 12, 253, 139, 157, 135, 227, 139, 13, - 13, 4, 137, 138, 139, 221, 139, 396, 154, 398, - 269, 235, 401, 0, 33, 34, 35, 156, 3, 4, - 173, 149, 150, 137, 138, 139, 147, 148, 235, 253, - 33, 34, 35, 141, 137, 138, 139, 295, 135, 227, - 235, 229, 137, 138, 139, 238, 253, 32, 33, 34, - 309, 36, 37, 38, 39, 40, 235, 238, 253, 252, - 157, 158, 176, 160, 161, 477, 234, 172, 165, 234, - 238, 238, 461, 238, 253, 256, 176, 337, 238, 238, - 238, 341, 342, 495, 181, 308, 183, 254, 175, 192, - 350, 238, 176, 252, 254, 354, 254, 234, 328, 488, - 323, 238, 254, 255, 320, 251, 238, 254, 176, 254, - 369, 500, 132, 254, 235, 148, 237, 148, 246, 247, - 255, 254, 254, 239, 240, 234, 159, 289, 231, 238, - 390, 139, 391, 321, 148, 148, 156, 396, 139, 398, - 328, 174, 401, 128, 129, 130, 131, 132, 167, 168, - 169, 198, 185, 173, 342, 139, 234, 204, 205, 419, - 238, 194, 233, 194, 167, 168, 169, 145, 146, 427, - 203, 191, 395, 234, 234, 234, 435, 139, 238, 238, - 176, 166, 167, 168, 169, 176, 206, 221, 167, 168, - 169, 153, 289, 176, 227, 238, 229, 151, 152, 184, - 141, 142, 461, 137, 138, 139, 239, 139, 239, 235, - 470, 255, 351, 374, 375, 234, 474, 251, 252, 407, - 243, 244, 245, 233, 483, 176, 256, 486, 256, 488, - 235, 419, 376, 377, 494, 197, 198, 255, 272, 224, - 233, 500, 204, 205, 3, 4, 253, 378, 379, 380, - 381, 233, 382, 383, 514, 513, 254, 254, 233, 254, - 518, 519, 295, 233, 295, 254, 233, 233, 491, 233, - 256, 234, 530, 32, 33, 34, 233, 36, 37, 38, - 39, 40, 250, 248, 153, 305, 320, 155, 321, 249, - 233, 236, 136, 254, 234, 328, 233, 236, 256, 234, - 238, 234, 233, 336, 139, 336, 236, 254, 234, 342, - 234, 255, 332, 12, 347, 384, 347, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 254, 253, 252, - 385, 351, 254, 386, 388, 387, 197, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, - 384, 385, 386, 387, 388, 389, 332, 389, 229, 405, - 409, 320, 336, 150, 336, 520, 495, 347, 419, 128, - 129, 130, 131, 132, 407, 518, 148, -1, 137, -1, - 139, -1, 407, -1, -1, -1, 419, -1, -1, -1, - -1, -1, -1, -1, 427, -1, 427, -1, -1, -1, - -1, -1, -1, -1, 424, -1, -1, 166, 167, 168, - 169, -1, -1, -1, 253, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 184, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 474, -1, 474, 477, -1, 477, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 495, -1, 495, 224, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 513, -1, 513, -1, -1, 518, 519, 518, 519, -1, - -1, -1, -1, -1, -1, -1, -1, 530, -1, 530, - 3, 4, 5, 6, 7, 8, 9, 10, 11, -1, - 13, 14, 15, 16, 17, -1, -1, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, -1, -1, -1, -1, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, -1, -1, 147, 148, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 166, 167, 168, 169, -1, 171, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 184, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 224, -1, -1, -1, -1, -1, -1, -1, -1, - 233, -1, -1, -1, -1, -1, 239, 240, 241, 242, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 254, 255, 256, 3, 4, 5, 6, 7, 8, - 9, 10, 11, -1, 13, 14, 15, 16, 17, -1, - -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, -1, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 0, 0, 0, 0, 0, 0, 0, 260, 0, 0, + 0, 0, 0, 261, 262, 263, 264, 17, 18, 19, + 20, 21, 22, 0, 0, 0, 0, 0, 347, 0, + 0, 0, 0, 0, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 178, 179, 38, + 180, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, @@ -1780,72 +1503,19 @@ static const yytype_int16 yycheck[] = 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, -1, -1, -1, -1, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, -1, -1, 147, 148, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 166, 167, 168, - 169, -1, 171, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 184, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 224, -1, -1, -1, -1, - -1, -1, -1, -1, 233, -1, -1, -1, -1, -1, - 239, 240, 241, 242, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 254, 255, 256, 3, 4, - 5, 6, 7, 8, 9, 10, 11, -1, 13, 14, - 15, 16, 17, -1, -1, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, -1, - -1, -1, -1, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - -1, -1, 147, 148, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 166, 167, 168, 169, -1, 171, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 184, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, - -1, -1, -1, -1, -1, -1, -1, -1, 233, -1, - -1, -1, -1, -1, 239, 240, 241, 242, 3, 4, - 5, 6, 7, 8, -1, -1, -1, -1, -1, 254, - 255, 256, -1, -1, -1, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, -1, - -1, -1, -1, 128, 129, 130, 131, 132, 133, 134, - 135, -1, -1, 138, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 166, 167, 168, 169, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 184, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 3, 4, 5, 6, 7, - 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 256, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 0, + 0, 0, 0, 128, 129, 130, 131, 132, 133, 134, + 135, 0, 181, 136, 182, 253, 254, 255, 256, 257, + 0, 0, 258, 259, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 183, 184, 139, 140, 141, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 19, 20, 21, 22, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 260, 0, 0, + 0, 0, 0, 261, 262, 263, 264, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, @@ -1853,144 +1523,19 @@ static const yytype_int16 yycheck[] = 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, -1, -1, -1, -1, - 128, 129, 130, 131, 132, 133, 134, 135, -1, -1, - 138, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 166, 167, - 168, 169, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 184, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 224, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 256, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - -1, -1, -1, -1, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, -1, -1, 147, 148, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 166, 167, 168, 169, -1, 171, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 184, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 224, -1, -1, -1, -1, -1, -1, -1, -1, 233, - -1, -1, -1, -1, -1, 239, 240, 241, 242, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 254, 255, 3, 4, 5, 6, 7, 8, 9, 10, - 11, -1, 13, 14, 15, 16, 17, -1, -1, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, -1, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, -1, -1, -1, -1, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, -1, -1, 147, 148, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 166, 167, 168, 169, -1, - 171, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 184, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 224, -1, -1, -1, -1, -1, -1, - -1, -1, 233, -1, -1, -1, -1, -1, 239, 240, - 241, 242, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 254, 255, 3, 4, 5, 6, 7, - 8, 9, 10, 11, -1, 13, 14, 15, 16, 17, - -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, -1, -1, -1, -1, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, -1, -1, 147, - 148, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 166, 167, - 168, 169, -1, 171, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 184, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 224, -1, -1, -1, - -1, -1, -1, -1, -1, 233, -1, -1, -1, -1, - -1, 239, 240, 241, 242, 3, 4, 5, 6, 7, - 8, -1, -1, -1, -1, -1, 254, 255, -1, -1, - -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, -1, -1, -1, -1, - 128, 129, 130, 131, 132, 133, 134, 135, -1, 137, - 138, 139, 140, 141, 142, 143, 144, -1, -1, 147, - 148, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 166, 167, - 168, 169, -1, 171, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 184, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 224, -1, -1, -1, - -1, -1, -1, -1, -1, 233, -1, -1, -1, -1, - -1, 239, 240, 241, 242, 5, 6, 7, 8, -1, - -1, -1, -1, -1, -1, -1, 254, -1, -1, -1, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 133, 134, 135, -1, 137, 138, 139, - 140, 141, 142, 143, 144, -1, -1, 147, 148, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 5, 6, - 7, 8, -1, 233, -1, -1, -1, -1, -1, 239, - 240, 241, 242, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 255, 256, -1, -1, -1, - -1, -1, -1, -1, 41, 42, 43, 44, 45, 46, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 133, + 134, 135, 0, 181, 136, 182, 253, 254, 255, 256, + 257, 0, 0, 258, 259, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 19, 20, 21, 22, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 260, 0, + 0, 323, 0, 0, 261, 262, 263, 264, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, @@ -1998,46 +1543,60 @@ static const yytype_int16 yycheck[] = 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 133, 134, 135, -1, - 137, 138, 139, 140, 141, 142, 143, 144, -1, -1, - 147, 148, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 5, 6, 7, 8, -1, 233, -1, -1, -1, - -1, -1, 239, 240, 241, 242, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 255, -1, - -1, -1, -1, -1, -1, -1, -1, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 133, - 134, 135, -1, 137, 138, 139, 140, 141, 142, 143, - 144, -1, -1, 147, 148, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 233, - -1, -1, -1, -1, -1, 239, 240, 241, 242, 3, - 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, - 254, -1, -1, -1, -1, -1, 20, 21, 22, 23, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 133, 134, 135, 0, 181, 136, 182, 253, 254, 255, + 256, 257, 0, 0, 258, 259, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 19, 20, 21, 22, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 260, + 0, 0, 411, 0, 0, 261, 262, 263, 264, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 133, 134, 135, 0, 181, 136, 182, 253, 254, + 255, 256, 257, 0, 0, 258, 259, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 19, 20, 21, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 260, 0, 0, 0, 0, 0, 261, 262, 263, 264, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 133, 134, 363, 0, 181, 136, 182, 253, + 254, 255, 256, 257, 0, 0, 258, 259, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 19, 20, 21, 22, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 34, 260, 0, 0, 0, 0, 0, 261, 262, 263, + 264, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, @@ -2045,20 +1604,20 @@ static const yytype_int16 yycheck[] = 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - -1, -1, -1, -1, 128, 129, 130, 131, 132, 133, - 134, 135, -1, 137, 138, 139, 140, 141, 142, 143, - 144, -1, -1, 147, 148, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 166, 167, 168, 169, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 184, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 224, -1, -1, -1, 5, 6, 7, 8, -1, 233, - -1, -1, -1, -1, -1, 239, 240, 241, 242, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 124, 125, 126, 127, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 133, 134, 492, 0, 181, 136, 182, + 253, 254, 255, 256, 257, 0, 0, 258, 259, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 17, 18, 19, 20, 21, + 22, 0, 260, 0, 0, 0, 0, 0, 261, 262, + 263, 264, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, @@ -2067,43 +1626,135 @@ static const yytype_int16 yycheck[] = 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 133, 134, 135, -1, 137, 138, 139, 140, - 141, 142, 143, 144, -1, -1, 147, 148, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 5, 6, 7, - 8, -1, 233, -1, -1, 236, -1, -1, 239, 240, - 241, 242, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 133, 134, 135, -1, 137, - 138, 139, 140, 141, 142, 143, 144, -1, -1, 147, - 148, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 5, 6, 7, 8, -1, 233, -1, -1, 236, -1, - -1, 239, 240, 241, 242, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 41, 42, 43, 44, + 121, 122, 123, 124, 125, 126, 127, 0, 0, 0, + 0, 128, 129, 130, 131, 132, 133, 134, 135, 0, + 0, 136, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 137, + 138, 139, 140, 141, 0, 142, 0, 12, 0, 0, + 0, 0, 0, 143, 144, 145, 146, 147, 148, 17, + 18, 19, 20, 21, 22, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 0, 0, 0, 0, 128, 129, 130, 131, 132, + 133, 134, 135, 0, 0, 136, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 137, 138, 139, 140, 141, 0, 142, + 17, 18, 19, 20, 21, 22, 0, 143, 144, 145, + 146, 147, 148, 0, 0, 0, 0, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 178, 179, 38, 180, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 17, 18, 0, 0, 128, 129, 130, 131, + 132, 133, 134, 135, 0, 0, 136, 0, 0, 0, + 0, 0, 17, 18, 0, 0, 0, 0, 0, 0, + 0, 35, 178, 179, 38, 180, 40, 41, 42, 43, + 44, 0, 0, 0, 183, 184, 139, 140, 141, 0, + 0, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 0, 0, 148, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 128, 129, + 130, 131, 132, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 128, 129, + 130, 131, 132, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 183, 184, 139, 140, + 141, 0, 0, 0, 0, 0, 19, 20, 21, 22, + 0, 0, 0, 0, 0, 148, 183, 184, 139, 140, + 141, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 0, 0, 148, 0, 0, 0, 0, + 0, 0, 0, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 133, 134, 135, 0, 0, + 136 +}; + +static const yytype_int16 yycheck[] = +{ + 13, 246, 13, 4, 13, 217, 250, 159, 176, 137, + 138, 12, 18, 19, 18, 19, 260, 140, 13, 138, + 139, 140, 228, 404, 140, 406, 140, 234, 409, 155, + 158, 138, 139, 140, 4, 138, 139, 140, 235, 238, + 4, 142, 235, 148, 149, 174, 150, 151, 276, 235, + 142, 137, 138, 0, 155, 254, 253, 302, 254, 255, + 253, 235, 238, 33, 34, 35, 234, 253, 236, 33, + 34, 35, 485, 159, 160, 178, 162, 163, 238, 253, + 256, 167, 238, 238, 138, 139, 140, 194, 469, 317, + 503, 234, 238, 238, 254, 238, 252, 183, 184, 254, + 186, 345, 203, 204, 316, 349, 350, 208, 254, 254, + 211, 212, 234, 234, 358, 496, 238, 238, 175, 331, + 178, 238, 328, 140, 231, 251, 177, 508, 140, 336, + 235, 254, 237, 134, 362, 252, 255, 150, 254, 150, + 254, 150, 246, 247, 296, 178, 234, 234, 161, 377, + 238, 238, 204, 140, 398, 150, 208, 158, 234, 211, + 212, 329, 238, 176, 178, 234, 239, 240, 336, 238, + 178, 399, 146, 147, 175, 178, 404, 190, 406, 152, + 153, 409, 350, 427, 169, 170, 171, 200, 178, 200, + 435, 403, 138, 139, 140, 196, 233, 210, 168, 169, + 170, 171, 142, 143, 168, 169, 170, 171, 234, 228, + 296, 238, 213, 382, 383, 443, 386, 387, 388, 389, + 235, 234, 140, 236, 255, 243, 244, 245, 390, 391, + 235, 359, 255, 246, 478, 246, 233, 482, 254, 258, + 259, 469, 384, 385, 233, 233, 178, 415, 234, 233, + 256, 253, 256, 233, 254, 254, 254, 233, 502, 427, + 279, 233, 256, 491, 234, 233, 494, 233, 496, 3, + 4, 248, 250, 154, 249, 254, 521, 156, 522, 233, + 508, 526, 527, 236, 137, 234, 236, 499, 233, 302, + 238, 302, 234, 538, 256, 236, 233, 140, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 234, 328, + 254, 234, 313, 234, 253, 12, 329, 3, 4, 255, + 254, 254, 252, 336, 150, 392, 394, 393, 203, 236, + 395, 344, 396, 344, 397, 328, 413, 350, 417, 340, + 503, 152, 355, 427, 355, 355, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 528, 340, 359, 526, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 344, + 150, 415, 344, -1, -1, 129, 130, 131, 132, 133, + -1, -1, 415, -1, 138, -1, 140, -1, -1, -1, + -1, -1, -1, -1, 427, -1, -1, -1, -1, -1, + -1, -1, 435, -1, 435, -1, -1, -1, -1, -1, + -1, 432, -1, 167, 168, 169, 170, 171, -1, -1, + -1, -1, -1, 129, 130, 131, 132, 133, -1, -1, + -1, -1, 186, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 482, + -1, 482, 485, -1, 485, 253, -1, -1, -1, -1, + -1, 167, 168, 169, 170, 171, -1, -1, -1, -1, + 503, -1, 503, -1, -1, -1, -1, -1, -1, -1, + 186, -1, -1, -1, -1, -1, -1, -1, 521, -1, + 521, -1, -1, 526, 527, 526, 527, -1, -1, -1, + -1, -1, -1, -1, -1, 538, -1, 538, 3, 4, + 5, 6, 7, 8, 9, 10, 11, -1, 13, 14, + 15, 16, 17, -1, -1, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, @@ -2111,21 +1762,220 @@ static const yytype_int16 yycheck[] = 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 133, 134, - 135, -1, 137, 138, 139, 140, 141, 142, 143, 144, - -1, -1, 147, 148, -1, -1, -1, -1, -1, -1, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + -1, -1, -1, -1, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, -1, -1, 148, 149, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 167, 168, 169, 170, 171, -1, 173, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 186, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 233, -1, + -1, -1, -1, -1, 239, 240, 241, 242, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 254, + 255, 256, 3, 4, 5, 6, 7, 8, 9, 10, + 11, -1, 13, 14, 15, 16, 17, -1, -1, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, -1, -1, -1, -1, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, -1, -1, 148, 149, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 167, 168, 169, 170, + 171, -1, 173, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 186, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 233, -1, -1, -1, -1, -1, 239, 240, + 241, 242, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 254, 255, 256, 3, 4, 5, 6, + 7, 8, 9, 10, 11, -1, 13, 14, 15, 16, + 17, -1, -1, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, -1, -1, + -1, -1, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, -1, + -1, 148, 149, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 167, 168, 169, 170, 171, -1, 173, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 186, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 233, -1, -1, -1, + -1, -1, 239, 240, 241, 242, 3, 4, 5, 6, + 7, 8, -1, -1, -1, -1, -1, 254, 255, 256, + -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, -1, -1, + -1, -1, 129, 130, 131, 132, 133, 134, 135, 136, + -1, -1, 139, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 167, 168, 169, 170, 171, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 186, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 3, 4, 5, 6, 7, 8, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 256, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, -1, -1, -1, -1, 129, + 130, 131, 132, 133, 134, 135, 136, -1, -1, 139, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 5, 6, 7, 8, -1, 233, -1, - -1, -1, -1, -1, 239, 240, 241, 242, 20, 21, + -1, -1, -1, -1, -1, -1, -1, 167, 168, 169, + 170, 171, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 186, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 256, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, -1, + -1, -1, -1, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + -1, -1, 148, 149, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 167, 168, 169, 170, 171, -1, 173, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 186, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 233, -1, -1, + -1, -1, -1, 239, 240, 241, 242, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 254, 255, + 3, 4, 5, 6, 7, 8, 9, 10, 11, -1, + 13, 14, 15, 16, 17, -1, -1, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, -1, -1, -1, -1, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, -1, -1, 148, 149, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 167, 168, 169, 170, 171, -1, + 173, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 186, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 233, -1, -1, -1, -1, -1, 239, 240, 241, 242, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 254, 255, 3, 4, 5, 6, 7, 8, 9, + 10, 11, -1, 13, 14, 15, 16, 17, -1, -1, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, -1, -1, -1, -1, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, -1, -1, 148, 149, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 167, 168, 169, + 170, 171, -1, 173, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 186, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 233, -1, -1, -1, -1, -1, 239, + 240, 241, 242, 3, 4, 5, 6, 7, 8, -1, + -1, -1, -1, -1, 254, 255, -1, -1, -1, -1, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, -1, -1, -1, -1, 129, + 130, 131, 132, 133, 134, 135, 136, -1, 138, 139, + 140, 141, 142, 143, 144, 145, -1, -1, 148, 149, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 167, 168, 169, + 170, 171, -1, 173, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 186, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 233, -1, -1, -1, -1, -1, 239, + 240, 241, 242, 5, 6, 7, 8, -1, -1, -1, + -1, -1, -1, -1, 254, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, @@ -2134,9 +1984,9 @@ static const yytype_int16 yycheck[] = 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 133, 134, 135, -1, 137, 138, 139, 140, 141, - 142, 143, 144, -1, -1, 147, 148, -1, -1, -1, + 122, 123, 124, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 134, 135, 136, -1, 138, 139, 140, 141, + 142, 143, 144, 145, -1, -1, 148, 149, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -2147,8 +1997,8 @@ static const yytype_int16 yycheck[] = -1, -1, -1, -1, -1, -1, 5, 6, 7, 8, -1, 233, -1, -1, -1, -1, -1, 239, 240, 241, 242, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 41, 42, 43, 44, 45, 46, 47, 48, + 29, 30, 31, 255, 256, -1, -1, -1, -1, -1, + -1, -1, -1, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, @@ -2156,20 +2006,44 @@ static const yytype_int16 yycheck[] = 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 133, 134, 135, -1, 137, 138, - 139, 140, 141, 142, 143, 144, -1, -1, 147, 148, + 119, 120, 121, 122, 123, 124, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 134, 135, 136, -1, 138, + 139, 140, 141, 142, 143, 144, 145, -1, -1, 148, + 149, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 3, 4, 5, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, 6, 7, 8, -1, 233, -1, -1, -1, -1, -1, 239, 240, 241, 242, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, -1, + 26, 27, 28, 29, 30, 31, 255, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 134, 135, + 136, -1, 138, 139, 140, 141, 142, 143, 144, 145, + -1, -1, 148, 149, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 233, -1, -1, + -1, -1, -1, 239, 240, 241, 242, 3, 4, 5, + 6, 7, 8, -1, -1, -1, -1, -1, 254, -1, + -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, @@ -2178,51 +2052,100 @@ static const yytype_int16 yycheck[] = 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, -1, -1, - -1, -1, 128, 129, 130, 131, 132, 133, 134, 135, - -1, -1, 138, -1, -1, -1, -1, -1, -1, -1, + 116, 117, 118, 119, 120, 121, 122, 123, 124, -1, + -1, -1, -1, 129, 130, 131, 132, 133, 134, 135, + 136, -1, 138, 139, 140, 141, 142, 143, 144, 145, + -1, -1, 148, 149, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 167, 168, 169, 170, 171, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 166, 167, 168, 169, -1, 171, -1, -1, -1, -1, - -1, -1, -1, 179, 180, 181, 182, 183, 184, -1, - -1, -1, -1, -1, -1, -1, 3, 4, 5, 6, - 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 224, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 3, 4, -1, - -1, 128, 129, 130, 131, 132, 133, 134, 135, -1, - -1, 138, -1, -1, -1, -1, 3, 4, -1, -1, - -1, -1, -1, -1, -1, -1, 32, 33, 34, -1, - 36, 37, 38, 39, 40, -1, -1, -1, -1, 166, - 167, 168, 169, -1, -1, 32, 33, 34, -1, 36, - 37, 38, 39, 40, -1, -1, -1, 184, -1, -1, + 186, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 233, -1, -1, + -1, -1, -1, 239, 240, 241, 242, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 134, + 135, 136, -1, 138, 139, 140, 141, 142, 143, 144, + 145, -1, -1, 148, 149, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 224, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 128, 129, 130, 131, 132, -1, -1, -1, + -1, 5, 6, 7, 8, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 233, -1, + -1, 236, -1, -1, 239, 240, 241, 242, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 134, 135, 136, -1, 138, 139, 140, 141, 142, 143, + 144, 145, -1, -1, 148, 149, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 5, 6, 7, 8, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 233, + -1, -1, 236, -1, -1, 239, 240, 241, 242, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 134, 135, 136, -1, 138, 139, 140, 141, 142, + 143, 144, 145, -1, -1, 148, 149, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 5, 6, 7, 8, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 233, -1, -1, -1, -1, -1, 239, 240, 241, 242, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 134, 135, 136, -1, 138, 139, 140, 141, + 142, 143, 144, 145, -1, -1, 148, 149, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 128, 129, 130, 131, 132, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 166, 167, 168, 169, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 184, 166, - 167, 168, 169, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 184, -1, -1, -1, -1, -1, -1, 5, 6, 7, 8, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 224, 20, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, -1, -1, -1, -1, -1, -1, 224, -1, -1, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 31, 233, -1, -1, -1, -1, -1, 239, 240, 241, + 242, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, @@ -2230,18 +2153,20 @@ static const yytype_int16 yycheck[] = 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 133, 134, 135, -1, -1, 138 -}; - - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint16 yystos[] = -{ - 0, 172, 258, 260, 141, 0, 262, 137, 138, 139, - 176, 263, 173, 259, 264, 176, 263, 3, 4, 5, - 6, 7, 8, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 36, 37, + 121, 122, 123, 124, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 134, 135, 136, -1, 138, 139, 140, + 141, 142, 143, 144, 145, -1, -1, 148, 149, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 3, 4, 5, 6, 7, + 8, -1, 233, -1, -1, -1, -1, -1, 239, 240, + 241, 242, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, @@ -2250,48 +2175,134 @@ static const yytype_uint16 yystos[] = 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 128, 129, 130, 131, - 132, 133, 134, 135, 138, 166, 167, 168, 169, 171, - 179, 180, 181, 182, 183, 184, 224, 261, 265, 299, - 300, 301, 302, 303, 309, 310, 311, 312, 317, 318, - 319, 320, 322, 323, 324, 325, 326, 356, 357, 358, - 359, 360, 364, 175, 255, 263, 33, 34, 36, 137, - 139, 166, 266, 312, 318, 325, 176, 176, 176, 176, - 176, 233, 356, 254, 255, 339, 234, 238, 4, 33, - 34, 35, 305, 306, 307, 325, 238, 254, 137, 139, - 263, 266, 33, 34, 36, 318, 359, 318, 322, 318, - 318, 235, 321, 318, 139, 263, 311, 327, 328, 255, - 322, 192, 231, 263, 313, 315, 316, 9, 10, 11, - 13, 14, 15, 16, 17, 136, 140, 141, 142, 143, - 144, 147, 148, 233, 239, 240, 241, 242, 254, 255, - 256, 266, 267, 268, 270, 271, 272, 273, 274, 275, - 276, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 297, 299, 300, 312, - 322, 333, 334, 335, 336, 340, 341, 342, 345, 351, - 355, 305, 306, 304, 308, 322, 306, 306, 263, 253, - 321, 233, 254, 254, 254, 236, 281, 294, 298, 322, - 235, 255, 176, 263, 329, 330, 256, 328, 327, 254, - 253, 234, 238, 254, 254, 334, 233, 233, 254, 254, - 297, 233, 233, 281, 281, 297, 256, 337, 147, 148, - 235, 237, 234, 234, 238, 135, 295, 233, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 253, 296, - 281, 243, 244, 245, 239, 240, 145, 146, 149, 150, - 246, 247, 151, 152, 248, 249, 250, 153, 155, 154, - 251, 238, 254, 256, 334, 263, 253, 321, 255, 295, - 331, 253, 236, 236, 298, 311, 362, 363, 321, 238, - 254, 256, 141, 142, 314, 315, 136, 333, 341, 352, - 297, 254, 297, 297, 311, 344, 234, 340, 269, 297, - 263, 266, 277, 278, 279, 280, 295, 295, 281, 281, - 281, 283, 283, 284, 284, 285, 285, 285, 285, 286, - 286, 287, 288, 289, 290, 291, 292, 297, 295, 321, - 331, 253, 331, 332, 331, 236, 329, 256, 362, 330, - 233, 344, 353, 354, 234, 234, 263, 234, 256, 236, - 233, 234, 234, 238, 135, 295, 252, 331, 238, 256, - 254, 139, 361, 297, 254, 234, 334, 343, 255, 346, - 253, 335, 338, 339, 295, 295, 256, 331, 321, 254, - 234, 297, 338, 12, 18, 19, 256, 347, 348, 349, - 350, 331, 254, 334, 297, 252, 334, 347, 334, 256, - 349, 252 + 118, 119, 120, 121, 122, 123, 124, -1, -1, -1, + -1, 129, 130, 131, 132, 133, 134, 135, 136, -1, + -1, 139, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 167, + 168, 169, 170, 171, -1, 173, -1, 175, -1, -1, + -1, -1, -1, 181, 182, 183, 184, 185, 186, 3, + 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, -1, -1, -1, -1, 129, 130, 131, 132, 133, + 134, 135, 136, -1, -1, 139, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 167, 168, 169, 170, 171, -1, 173, + 3, 4, 5, 6, 7, 8, -1, 181, 182, 183, + 184, 185, 186, -1, -1, -1, -1, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 3, 4, -1, -1, 129, 130, 131, 132, + 133, 134, 135, 136, -1, -1, 139, -1, -1, -1, + -1, -1, 3, 4, -1, -1, -1, -1, -1, -1, + -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, -1, -1, -1, 167, 168, 169, 170, 171, -1, + -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, -1, -1, 186, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 129, 130, + 131, 132, 133, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 129, 130, + 131, 132, 133, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 167, 168, 169, 170, + 171, -1, -1, -1, -1, -1, 5, 6, 7, 8, + -1, -1, -1, -1, -1, 186, 167, 168, 169, 170, + 171, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, -1, -1, 186, -1, -1, -1, -1, + -1, -1, -1, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 134, 135, 136, -1, -1, + 139 +}; + + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint16 yystos[] = +{ + 0, 174, 258, 260, 142, 0, 262, 138, 139, 140, + 178, 263, 175, 259, 264, 178, 263, 3, 4, 5, + 6, 7, 8, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 129, 130, + 131, 132, 133, 134, 135, 136, 139, 167, 168, 169, + 170, 171, 173, 181, 182, 183, 184, 185, 186, 261, + 265, 299, 300, 301, 302, 303, 309, 310, 311, 312, + 317, 318, 319, 320, 322, 323, 324, 325, 326, 356, + 357, 358, 359, 360, 364, 177, 255, 263, 33, 34, + 36, 138, 140, 167, 168, 266, 312, 318, 266, 318, + 325, 178, 178, 178, 178, 178, 233, 264, 356, 254, + 255, 339, 234, 238, 4, 33, 34, 35, 168, 305, + 306, 307, 325, 238, 254, 138, 140, 263, 266, 33, + 34, 36, 318, 359, 318, 322, 318, 318, 235, 321, + 318, 140, 263, 311, 327, 328, 255, 322, 194, 231, + 263, 313, 315, 316, 9, 10, 11, 13, 14, 15, + 16, 17, 137, 141, 142, 143, 144, 145, 148, 149, + 233, 239, 240, 241, 242, 254, 255, 256, 266, 267, + 268, 270, 271, 272, 273, 274, 275, 276, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 297, 299, 300, 312, 322, 333, 334, + 335, 336, 340, 341, 342, 345, 351, 355, 305, 306, + 306, 304, 308, 322, 306, 306, 263, 253, 321, 233, + 254, 254, 254, 236, 281, 294, 298, 322, 235, 255, + 178, 263, 329, 330, 256, 328, 327, 254, 253, 234, + 238, 254, 254, 334, 233, 233, 254, 254, 297, 233, + 233, 281, 281, 297, 256, 337, 148, 149, 235, 237, + 234, 234, 238, 136, 295, 233, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 253, 296, 281, 243, + 244, 245, 239, 240, 146, 147, 150, 151, 246, 247, + 152, 153, 248, 249, 250, 154, 156, 155, 251, 238, + 254, 256, 334, 263, 253, 321, 255, 295, 331, 253, + 236, 236, 298, 311, 362, 363, 321, 238, 254, 256, + 142, 143, 314, 315, 137, 333, 341, 352, 297, 254, + 297, 297, 311, 344, 234, 340, 269, 297, 263, 266, + 277, 278, 279, 280, 295, 295, 281, 281, 281, 283, + 283, 284, 284, 285, 285, 285, 285, 286, 286, 287, + 288, 289, 290, 291, 292, 297, 295, 321, 331, 253, + 331, 332, 331, 236, 329, 256, 362, 330, 233, 344, + 353, 354, 234, 234, 263, 234, 256, 236, 233, 234, + 234, 238, 136, 295, 252, 331, 238, 256, 254, 140, + 361, 297, 254, 234, 334, 343, 255, 346, 253, 335, + 338, 339, 295, 295, 256, 331, 321, 254, 234, 297, + 338, 12, 18, 19, 256, 347, 348, 349, 350, 331, + 254, 334, 297, 252, 334, 347, 334, 256, 349, 252 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ @@ -2299,24 +2310,24 @@ static const yytype_uint16 yyr1[] = { 0, 257, 259, 258, 260, 260, 260, 261, 261, 261, 261, 261, 262, 262, 263, 263, 263, 264, 265, 265, - 266, 266, 267, 267, 267, 267, 267, 267, 268, 268, - 268, 268, 268, 268, 269, 270, 271, 271, 272, 272, - 273, 273, 274, 274, 275, 276, 276, 276, 277, 277, - 278, 278, 279, 279, 280, 281, 281, 281, 281, 282, - 282, 282, 282, 283, 283, 283, 283, 284, 284, 284, - 285, 285, 285, 286, 286, 286, 286, 286, 287, 287, - 287, 288, 288, 289, 289, 290, 290, 291, 291, 292, - 292, 293, 293, 294, 294, 295, 295, 296, 296, 296, - 296, 296, 296, 296, 296, 296, 296, 296, 297, 297, - 298, 299, 299, 299, 299, 300, 301, 301, 302, 302, - 303, 304, 304, 305, 305, 306, 306, 306, 306, 307, - 307, 307, 308, 309, 309, 309, 309, 309, 310, 310, - 310, 310, 310, 310, 311, 311, 312, 313, 313, 314, - 314, 315, 315, 315, 316, 316, 317, 317, 317, 318, - 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, - 318, 319, 319, 320, 320, 320, 320, 320, 320, 320, - 320, 320, 320, 320, 321, 321, 321, 321, 322, 322, - 323, 323, 323, 324, 324, 324, 324, 324, 324, 324, + 265, 266, 266, 267, 267, 267, 267, 267, 267, 268, + 268, 268, 268, 268, 268, 269, 270, 271, 271, 272, + 272, 273, 273, 274, 274, 275, 276, 276, 276, 277, + 277, 278, 278, 279, 279, 280, 281, 281, 281, 281, + 282, 282, 282, 282, 283, 283, 283, 283, 284, 284, + 284, 285, 285, 285, 286, 286, 286, 286, 286, 287, + 287, 287, 288, 288, 289, 289, 290, 290, 291, 291, + 292, 292, 293, 293, 294, 294, 295, 295, 296, 296, + 296, 296, 296, 296, 296, 296, 296, 296, 296, 297, + 297, 298, 299, 299, 299, 299, 300, 301, 301, 302, + 302, 303, 304, 304, 305, 305, 306, 306, 306, 306, + 306, 307, 307, 307, 308, 309, 309, 309, 309, 309, + 310, 310, 310, 310, 310, 310, 310, 311, 311, 312, + 313, 313, 314, 314, 315, 315, 315, 316, 316, 317, + 317, 317, 318, 318, 318, 318, 318, 318, 318, 318, + 318, 318, 318, 318, 318, 318, 319, 319, 320, 320, + 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, + 321, 321, 321, 321, 322, 322, 323, 323, 323, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, @@ -2326,16 +2337,16 @@ static const yytype_uint16 yyr1[] = 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, - 324, 324, 324, 324, 325, 325, 325, 326, 326, 327, - 327, 328, 329, 329, 330, 330, 331, 331, 331, 332, - 332, 333, 334, 334, 335, 335, 335, 335, 335, 335, - 336, 337, 336, 338, 338, 339, 339, 340, 340, 341, - 341, 342, 343, 343, 344, 344, 345, 346, 346, 347, - 347, 348, 348, 349, 349, 350, 350, 351, 351, 351, - 352, 352, 353, 353, 354, 354, 355, 355, 355, 355, - 355, 356, 356, 356, 356, 357, 358, 358, 359, 360, - 360, 360, 361, 361, 361, 362, 362, 363, 364, 364, - 364 + 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, + 325, 325, 325, 326, 326, 327, 327, 328, 329, 329, + 330, 330, 331, 331, 331, 332, 332, 333, 334, 334, + 335, 335, 335, 335, 335, 335, 336, 337, 336, 338, + 338, 339, 339, 340, 340, 341, 341, 342, 343, 343, + 344, 344, 345, 346, 346, 347, 347, 348, 348, 349, + 349, 350, 350, 351, 351, 351, 352, 352, 353, 353, + 354, 354, 355, 355, 355, 355, 355, 356, 356, 356, + 356, 357, 358, 358, 359, 360, 360, 360, 361, 361, + 361, 362, 362, 363, 364, 364, 364 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ @@ -2343,23 +2354,24 @@ static const yytype_uint8 yyr2[] = { 0, 2, 0, 4, 0, 3, 4, 2, 2, 2, 2, 2, 0, 2, 1, 1, 1, 5, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 3, 1, 4, - 1, 3, 2, 2, 1, 1, 1, 3, 2, 2, - 2, 1, 2, 3, 2, 1, 1, 1, 2, 2, - 2, 1, 2, 3, 2, 1, 2, 2, 2, 1, - 1, 1, 1, 1, 3, 3, 3, 1, 3, 3, - 1, 3, 3, 1, 3, 3, 3, 3, 1, 3, - 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, - 3, 1, 3, 1, 5, 1, 3, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, - 1, 2, 2, 4, 1, 2, 1, 1, 2, 3, - 3, 2, 3, 2, 2, 0, 2, 2, 2, 1, - 1, 1, 1, 1, 3, 4, 6, 5, 1, 2, - 3, 5, 4, 2, 1, 2, 4, 1, 3, 1, - 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, - 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 3, 3, 4, 1, 2, + 2, 1, 1, 1, 1, 1, 1, 1, 3, 1, + 4, 1, 3, 2, 2, 1, 1, 1, 3, 2, + 2, 2, 1, 2, 3, 2, 1, 1, 1, 2, + 2, 2, 1, 2, 3, 2, 1, 2, 2, 2, + 1, 1, 1, 1, 1, 3, 3, 3, 1, 3, + 3, 1, 3, 3, 1, 3, 3, 3, 3, 1, + 3, 3, 1, 3, 1, 3, 1, 3, 1, 3, + 1, 3, 1, 3, 1, 5, 1, 3, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 3, 1, 2, 2, 4, 1, 2, 1, 1, 2, + 3, 3, 2, 3, 2, 2, 0, 2, 2, 2, + 2, 1, 1, 1, 1, 1, 3, 4, 6, 5, + 1, 2, 3, 5, 4, 2, 2, 1, 2, 4, + 1, 3, 1, 1, 1, 3, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 3, 3, 4, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -2370,16 +2382,15 @@ static const yytype_uint8 yyr2[] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 5, 4, 1, - 2, 3, 1, 3, 1, 2, 1, 3, 4, 1, - 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 0, 4, 1, 1, 2, 3, 1, 2, 1, - 2, 5, 3, 1, 1, 4, 5, 2, 3, 3, - 2, 1, 2, 2, 2, 1, 2, 5, 7, 6, - 1, 1, 1, 0, 2, 3, 2, 2, 2, 3, - 2, 1, 1, 1, 1, 2, 1, 2, 7, 1, - 1, 1, 0, 1, 2, 1, 2, 3, 3, 3, - 3 + 1, 1, 1, 5, 4, 1, 2, 3, 1, 3, + 1, 2, 1, 3, 4, 1, 3, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 2, 0, 4, 1, + 1, 2, 3, 1, 2, 1, 2, 5, 3, 1, + 1, 4, 5, 2, 3, 3, 2, 1, 2, 2, + 2, 1, 2, 5, 7, 6, 1, 1, 1, 0, + 2, 3, 2, 2, 2, 3, 2, 1, 1, 1, + 1, 2, 1, 2, 7, 1, 1, 1, 0, 1, + 2, 1, 2, 3, 3, 3, 3 }; @@ -2973,7 +2984,7 @@ YYLTYPE yylloc = yyloc_default; yychar = YYEMPTY; /* Cause a token to be read. */ /* User initialization code. */ -#line 85 "src/glsl/glsl_parser.yy" /* yacc.c:1429 */ +#line 88 "src/glsl/glsl_parser.yy" /* yacc.c:1429 */ { yylloc.first_line = 1; yylloc.first_column = 1; @@ -2982,7 +2993,7 @@ YYLTYPE yylloc = yyloc_default; yylloc.source = 0; } -#line 2986 "src/glsl/glsl_parser.cpp" /* yacc.c:1429 */ +#line 2997 "src/glsl/glsl_parser.cpp" /* yacc.c:1429 */ yylsp[0] = yylloc; goto yysetstate; @@ -3169,38 +3180,27 @@ yyreduce: switch (yyn) { case 2: -#line 300 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 303 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { _mesa_glsl_initialize_types(state); } -#line 3177 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 3188 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 3: -#line 304 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 307 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { delete state->symbols; state->symbols = new(ralloc_parent(state)) glsl_symbol_table; _mesa_glsl_initialize_types(state); } -#line 3187 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 5: -#line 314 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - state->process_version_directive(&(yylsp[-1]), (yyvsp[-1].n), NULL); - if (state->error) { - YYERROR; - } - } #line 3198 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 6: -#line 321 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 5: +#line 317 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { - state->process_version_directive(&(yylsp[-2]), (yyvsp[-2].n), (yyvsp[-1].identifier)); + state->process_version_directive(&(yylsp[-1]), (yyvsp[-1].n), NULL); if (state->error) { YYERROR; } @@ -3208,8 +3208,19 @@ yyreduce: #line 3209 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; + case 6: +#line 324 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + state->process_version_directive(&(yylsp[-2]), (yyvsp[-2].n), (yyvsp[-1].identifier)); + if (state->error) { + YYERROR; + } + } +#line 3220 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + case 11: -#line 335 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 338 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { if (!state->is_version(120, 100)) { _mesa_glsl_warning(& (yylsp[-1]), state, @@ -3220,21 +3231,21 @@ yyreduce: state->all_invariant = true; } } -#line 3224 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 3235 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 17: -#line 360 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 363 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { if (!_mesa_glsl_process_extension((yyvsp[-3].identifier), & (yylsp[-3]), (yyvsp[-1].identifier), & (yylsp[-1]), state)) { YYERROR; } } -#line 3234 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 3245 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 18: -#line 369 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 372 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { /* FINISHME: The NULL test is required because pragmas are set to * FINISHME: NULL. (See production rule for external_declaration.) @@ -3242,11 +3253,11 @@ yyreduce: if ((yyvsp[0].node) != NULL) state->translation_unit.push_tail(& (yyvsp[0].node)->link); } -#line 3246 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 3257 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 19: -#line 377 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 380 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { /* FINISHME: The NULL test is required because pragmas are set to * FINISHME: NULL. (See production rule for external_declaration.) @@ -3254,559 +3265,575 @@ yyreduce: if ((yyvsp[0].node) != NULL) state->translation_unit.push_tail(& (yyvsp[0].node)->link); } -#line 3258 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 22: -#line 393 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_identifier, NULL, NULL, NULL); - (yyval.expression)->set_location(yylloc); - (yyval.expression)->primary_expression.identifier = (yyvsp[0].identifier); - } #line 3269 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; + case 20: +#line 387 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + if (!state->allow_extension_directive_midshader) { + _mesa_glsl_error(& (yylsp[0]), state, + "#extension directive is not allowed " + "in the middle of a shader"); + YYERROR; + } + } +#line 3282 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + case 23: -#line 400 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 404 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_int_constant, NULL, NULL, NULL); - (yyval.expression)->set_location(yylloc); - (yyval.expression)->primary_expression.int_constant = (yyvsp[0].n); + (yyval.expression) = new(ctx) ast_expression(ast_identifier, NULL, NULL, NULL); + (yyval.expression)->set_location((yylsp[0])); + (yyval.expression)->primary_expression.identifier = (yyvsp[0].identifier); } -#line 3280 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 3293 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 24: -#line 407 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 411 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_uint_constant, NULL, NULL, NULL); - (yyval.expression)->set_location(yylloc); - (yyval.expression)->primary_expression.uint_constant = (yyvsp[0].n); + (yyval.expression) = new(ctx) ast_expression(ast_int_constant, NULL, NULL, NULL); + (yyval.expression)->set_location((yylsp[0])); + (yyval.expression)->primary_expression.int_constant = (yyvsp[0].n); } -#line 3291 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 3304 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 25: -#line 414 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 418 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_float_constant, NULL, NULL, NULL); - (yyval.expression)->set_location(yylloc); - (yyval.expression)->primary_expression.float_constant = (yyvsp[0].real); + (yyval.expression) = new(ctx) ast_expression(ast_uint_constant, NULL, NULL, NULL); + (yyval.expression)->set_location((yylsp[0])); + (yyval.expression)->primary_expression.uint_constant = (yyvsp[0].n); } -#line 3302 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 3315 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 26: -#line 421 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 425 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_bool_constant, NULL, NULL, NULL); - (yyval.expression)->set_location(yylloc); - (yyval.expression)->primary_expression.bool_constant = (yyvsp[0].n); + (yyval.expression) = new(ctx) ast_expression(ast_float_constant, NULL, NULL, NULL); + (yyval.expression)->set_location((yylsp[0])); + (yyval.expression)->primary_expression.float_constant = (yyvsp[0].real); } -#line 3313 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 3326 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 27: -#line 428 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 432 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression(ast_bool_constant, NULL, NULL, NULL); + (yyval.expression)->set_location((yylsp[0])); + (yyval.expression)->primary_expression.bool_constant = (yyvsp[0].n); + } +#line 3337 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 28: +#line 439 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.expression) = (yyvsp[-1].expression); } -#line 3321 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 29: -#line 436 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_array_index, (yyvsp[-3].expression), (yyvsp[-1].expression), NULL); - (yyval.expression)->set_location(yylloc); - } -#line 3331 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 3345 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 30: -#line 442 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 447 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { - (yyval.expression) = (yyvsp[0].expression); + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression(ast_array_index, (yyvsp[-3].expression), (yyvsp[-1].expression), NULL); + (yyval.expression)->set_location_range((yylsp[-3]), (yylsp[0])); } -#line 3339 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 3355 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 31: -#line 446 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_field_selection, (yyvsp[-2].expression), NULL, NULL); - (yyval.expression)->set_location(yylloc); - (yyval.expression)->primary_expression.identifier = (yyvsp[0].identifier); - } -#line 3350 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 32: #line 453 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_post_inc, (yyvsp[-1].expression), NULL, NULL); - (yyval.expression)->set_location(yylloc); - } -#line 3360 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 33: -#line 459 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_post_dec, (yyvsp[-1].expression), NULL, NULL); - (yyval.expression)->set_location(yylloc); - } -#line 3370 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 37: -#line 477 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_field_selection, (yyvsp[-2].expression), (yyvsp[0].expression), NULL); - (yyval.expression)->set_location(yylloc); - } -#line 3380 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 42: -#line 496 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - (yyval.expression) = (yyvsp[-1].expression); - (yyval.expression)->set_location(yylloc); - (yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link); - } -#line 3390 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 43: -#line 502 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - (yyval.expression) = (yyvsp[-2].expression); - (yyval.expression)->set_location(yylloc); - (yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link); - } -#line 3400 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 45: -#line 518 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_function_expression((yyvsp[0].type_specifier)); - (yyval.expression)->set_location(yylloc); - } -#line 3410 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 46: -#line 524 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - ast_expression *callee = new(ctx) ast_expression((yyvsp[0].identifier)); - (yyval.expression) = new(ctx) ast_function_expression(callee); - (yyval.expression)->set_location(yylloc); - } -#line 3421 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 47: -#line 531 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - ast_expression *callee = new(ctx) ast_expression((yyvsp[0].identifier)); - (yyval.expression) = new(ctx) ast_function_expression(callee); - (yyval.expression)->set_location(yylloc); - } -#line 3432 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 52: -#line 551 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - (yyval.expression) = (yyvsp[-1].expression); - (yyval.expression)->set_location(yylloc); - (yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link); - } -#line 3442 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 53: -#line 557 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - (yyval.expression) = (yyvsp[-2].expression); - (yyval.expression)->set_location(yylloc); - (yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link); - } -#line 3452 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 54: -#line 569 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - ast_expression *callee = new(ctx) ast_expression((yyvsp[-1].identifier)); - (yyval.expression) = new(ctx) ast_function_expression(callee); - (yyval.expression)->set_location(yylloc); - } -#line 3463 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 56: -#line 581 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_pre_inc, (yyvsp[0].expression), NULL, NULL); - (yyval.expression)->set_location(yylloc); - } -#line 3473 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 57: -#line 587 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_pre_dec, (yyvsp[0].expression), NULL, NULL); - (yyval.expression)->set_location(yylloc); - } -#line 3483 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 58: -#line 593 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression((yyvsp[-1].n), (yyvsp[0].expression), NULL, NULL); - (yyval.expression)->set_location(yylloc); - } -#line 3493 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 59: -#line 602 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.n) = ast_plus; } -#line 3499 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 60: -#line 603 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.n) = ast_neg; } -#line 3505 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 61: -#line 604 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.n) = ast_logic_not; } -#line 3511 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 62: -#line 605 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.n) = ast_bit_not; } -#line 3517 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 64: -#line 611 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_mul, (yyvsp[-2].expression), (yyvsp[0].expression)); - (yyval.expression)->set_location(yylloc); - } -#line 3527 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 65: -#line 617 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_div, (yyvsp[-2].expression), (yyvsp[0].expression)); - (yyval.expression)->set_location(yylloc); - } -#line 3537 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 66: -#line 623 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_mod, (yyvsp[-2].expression), (yyvsp[0].expression)); - (yyval.expression)->set_location(yylloc); - } -#line 3547 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 68: -#line 633 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_add, (yyvsp[-2].expression), (yyvsp[0].expression)); - (yyval.expression)->set_location(yylloc); - } -#line 3557 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 69: -#line 639 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_sub, (yyvsp[-2].expression), (yyvsp[0].expression)); - (yyval.expression)->set_location(yylloc); - } -#line 3567 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 71: -#line 649 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_lshift, (yyvsp[-2].expression), (yyvsp[0].expression)); - (yyval.expression)->set_location(yylloc); - } -#line 3577 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 72: -#line 655 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_rshift, (yyvsp[-2].expression), (yyvsp[0].expression)); - (yyval.expression)->set_location(yylloc); - } -#line 3587 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 74: -#line 665 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_less, (yyvsp[-2].expression), (yyvsp[0].expression)); - (yyval.expression)->set_location(yylloc); - } -#line 3597 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 75: -#line 671 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_greater, (yyvsp[-2].expression), (yyvsp[0].expression)); - (yyval.expression)->set_location(yylloc); - } -#line 3607 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 76: -#line 677 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_lequal, (yyvsp[-2].expression), (yyvsp[0].expression)); - (yyval.expression)->set_location(yylloc); - } -#line 3617 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 77: -#line 683 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_gequal, (yyvsp[-2].expression), (yyvsp[0].expression)); - (yyval.expression)->set_location(yylloc); - } -#line 3627 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 79: -#line 693 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_equal, (yyvsp[-2].expression), (yyvsp[0].expression)); - (yyval.expression)->set_location(yylloc); - } -#line 3637 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 80: -#line 699 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_nequal, (yyvsp[-2].expression), (yyvsp[0].expression)); - (yyval.expression)->set_location(yylloc); - } -#line 3647 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 82: -#line 709 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_bit_and, (yyvsp[-2].expression), (yyvsp[0].expression)); - (yyval.expression)->set_location(yylloc); - } -#line 3657 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 84: -#line 719 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_bit_xor, (yyvsp[-2].expression), (yyvsp[0].expression)); - (yyval.expression)->set_location(yylloc); - } -#line 3667 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 86: -#line 729 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_bit_or, (yyvsp[-2].expression), (yyvsp[0].expression)); - (yyval.expression)->set_location(yylloc); - } -#line 3677 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 88: -#line 739 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_logic_and, (yyvsp[-2].expression), (yyvsp[0].expression)); - (yyval.expression)->set_location(yylloc); - } -#line 3687 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 90: -#line 749 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_logic_xor, (yyvsp[-2].expression), (yyvsp[0].expression)); - (yyval.expression)->set_location(yylloc); - } -#line 3697 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 92: -#line 759 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_logic_or, (yyvsp[-2].expression), (yyvsp[0].expression)); - (yyval.expression)->set_location(yylloc); - } -#line 3707 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 94: -#line 769 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_conditional, (yyvsp[-4].expression), (yyvsp[-2].expression), (yyvsp[0].expression)); - (yyval.expression)->set_location(yylloc); - } -#line 3717 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 96: -#line 779 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression((yyvsp[-1].n), (yyvsp[-2].expression), (yyvsp[0].expression), NULL); - (yyval.expression)->set_location(yylloc); - } -#line 3727 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 97: -#line 787 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.n) = ast_assign; } -#line 3733 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 98: -#line 788 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.n) = ast_mul_assign; } -#line 3739 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 99: -#line 789 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.n) = ast_div_assign; } -#line 3745 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 100: -#line 790 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.n) = ast_mod_assign; } -#line 3751 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 101: -#line 791 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.n) = ast_add_assign; } -#line 3757 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 102: -#line 792 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.n) = ast_sub_assign; } -#line 3763 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 103: -#line 793 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.n) = ast_ls_assign; } -#line 3769 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 104: -#line 794 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.n) = ast_rs_assign; } -#line 3775 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 105: -#line 795 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.n) = ast_and_assign; } -#line 3781 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 106: -#line 796 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.n) = ast_xor_assign; } -#line 3787 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 107: -#line 797 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.n) = ast_or_assign; } -#line 3793 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 108: -#line 802 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.expression) = (yyvsp[0].expression); } -#line 3801 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 3363 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 32: +#line 457 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression(ast_field_selection, (yyvsp[-2].expression), NULL, NULL); + (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0])); + (yyval.expression)->primary_expression.identifier = (yyvsp[0].identifier); + } +#line 3374 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 33: +#line 464 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression(ast_post_inc, (yyvsp[-1].expression), NULL, NULL); + (yyval.expression)->set_location_range((yylsp[-1]), (yylsp[0])); + } +#line 3384 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 34: +#line 470 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression(ast_post_dec, (yyvsp[-1].expression), NULL, NULL); + (yyval.expression)->set_location_range((yylsp[-1]), (yylsp[0])); + } +#line 3394 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 38: +#line 488 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression(ast_field_selection, (yyvsp[-2].expression), (yyvsp[0].expression), NULL); + (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0])); + } +#line 3404 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 43: +#line 507 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + (yyval.expression) = (yyvsp[-1].expression); + (yyval.expression)->set_location((yylsp[-1])); + (yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link); + } +#line 3414 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 44: +#line 513 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + (yyval.expression) = (yyvsp[-2].expression); + (yyval.expression)->set_location((yylsp[-2])); + (yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link); + } +#line 3424 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 46: +#line 529 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_function_expression((yyvsp[0].type_specifier)); + (yyval.expression)->set_location((yylsp[0])); + } +#line 3434 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 47: +#line 535 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + ast_expression *callee = new(ctx) ast_expression((yyvsp[0].identifier)); + callee->set_location((yylsp[0])); + (yyval.expression) = new(ctx) ast_function_expression(callee); + (yyval.expression)->set_location((yylsp[0])); + } +#line 3446 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 48: +#line 543 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + ast_expression *callee = new(ctx) ast_expression((yyvsp[0].identifier)); + callee->set_location((yylsp[0])); + (yyval.expression) = new(ctx) ast_function_expression(callee); + (yyval.expression)->set_location((yylsp[0])); + } +#line 3458 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 53: +#line 564 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + (yyval.expression) = (yyvsp[-1].expression); + (yyval.expression)->set_location((yylsp[-1])); + (yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link); + } +#line 3468 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 54: +#line 570 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + (yyval.expression) = (yyvsp[-2].expression); + (yyval.expression)->set_location((yylsp[-2])); + (yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link); + } +#line 3478 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 55: +#line 582 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + ast_expression *callee = new(ctx) ast_expression((yyvsp[-1].identifier)); + callee->set_location((yylsp[-1])); + (yyval.expression) = new(ctx) ast_function_expression(callee); + (yyval.expression)->set_location((yylsp[-1])); + } +#line 3490 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 57: +#line 595 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression(ast_pre_inc, (yyvsp[0].expression), NULL, NULL); + (yyval.expression)->set_location((yylsp[-1])); + } +#line 3500 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 58: +#line 601 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression(ast_pre_dec, (yyvsp[0].expression), NULL, NULL); + (yyval.expression)->set_location((yylsp[-1])); + } +#line 3510 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 59: +#line 607 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression((yyvsp[-1].n), (yyvsp[0].expression), NULL, NULL); + (yyval.expression)->set_location_range((yylsp[-1]), (yylsp[0])); + } +#line 3520 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 60: +#line 616 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.n) = ast_plus; } +#line 3526 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 61: +#line 617 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.n) = ast_neg; } +#line 3532 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 62: +#line 618 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.n) = ast_logic_not; } +#line 3538 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 63: +#line 619 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.n) = ast_bit_not; } +#line 3544 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 65: +#line 625 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_mul, (yyvsp[-2].expression), (yyvsp[0].expression)); + (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0])); + } +#line 3554 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 66: +#line 631 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_div, (yyvsp[-2].expression), (yyvsp[0].expression)); + (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0])); + } +#line 3564 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 67: +#line 637 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_mod, (yyvsp[-2].expression), (yyvsp[0].expression)); + (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0])); + } +#line 3574 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 69: +#line 647 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_add, (yyvsp[-2].expression), (yyvsp[0].expression)); + (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0])); + } +#line 3584 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 70: +#line 653 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_sub, (yyvsp[-2].expression), (yyvsp[0].expression)); + (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0])); + } +#line 3594 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 72: +#line 663 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_lshift, (yyvsp[-2].expression), (yyvsp[0].expression)); + (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0])); + } +#line 3604 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 73: +#line 669 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_rshift, (yyvsp[-2].expression), (yyvsp[0].expression)); + (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0])); + } +#line 3614 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 75: +#line 679 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_less, (yyvsp[-2].expression), (yyvsp[0].expression)); + (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0])); + } +#line 3624 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 76: +#line 685 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_greater, (yyvsp[-2].expression), (yyvsp[0].expression)); + (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0])); + } +#line 3634 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 77: +#line 691 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_lequal, (yyvsp[-2].expression), (yyvsp[0].expression)); + (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0])); + } +#line 3644 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 78: +#line 697 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_gequal, (yyvsp[-2].expression), (yyvsp[0].expression)); + (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0])); + } +#line 3654 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 80: +#line 707 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_equal, (yyvsp[-2].expression), (yyvsp[0].expression)); + (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0])); + } +#line 3664 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 81: +#line 713 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_nequal, (yyvsp[-2].expression), (yyvsp[0].expression)); + (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0])); + } +#line 3674 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 83: +#line 723 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_bit_and, (yyvsp[-2].expression), (yyvsp[0].expression)); + (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0])); + } +#line 3684 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 85: +#line 733 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_bit_xor, (yyvsp[-2].expression), (yyvsp[0].expression)); + (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0])); + } +#line 3694 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 87: +#line 743 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_bit_or, (yyvsp[-2].expression), (yyvsp[0].expression)); + (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0])); + } +#line 3704 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 89: +#line 753 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_logic_and, (yyvsp[-2].expression), (yyvsp[0].expression)); + (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0])); + } +#line 3714 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 91: +#line 763 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_logic_xor, (yyvsp[-2].expression), (yyvsp[0].expression)); + (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0])); + } +#line 3724 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 93: +#line 773 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_logic_or, (yyvsp[-2].expression), (yyvsp[0].expression)); + (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0])); + } +#line 3734 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 95: +#line 783 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression(ast_conditional, (yyvsp[-4].expression), (yyvsp[-2].expression), (yyvsp[0].expression)); + (yyval.expression)->set_location_range((yylsp[-4]), (yylsp[0])); + } +#line 3744 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 97: +#line 793 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression((yyvsp[-1].n), (yyvsp[-2].expression), (yyvsp[0].expression), NULL); + (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0])); + } +#line 3754 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 98: +#line 801 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.n) = ast_assign; } +#line 3760 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 99: +#line 802 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.n) = ast_mul_assign; } +#line 3766 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 100: +#line 803 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.n) = ast_div_assign; } +#line 3772 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 101: +#line 804 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.n) = ast_mod_assign; } +#line 3778 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 102: +#line 805 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.n) = ast_add_assign; } +#line 3784 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 103: +#line 806 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.n) = ast_sub_assign; } +#line 3790 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 104: +#line 807 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.n) = ast_ls_assign; } +#line 3796 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 105: +#line 808 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.n) = ast_rs_assign; } +#line 3802 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 106: +#line 809 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.n) = ast_and_assign; } +#line 3808 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 107: +#line 810 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.n) = ast_xor_assign; } +#line 3814 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 108: +#line 811 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.n) = ast_or_assign; } +#line 3820 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 109: -#line 806 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 816 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + (yyval.expression) = (yyvsp[0].expression); + } +#line 3828 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 110: +#line 820 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; if ((yyvsp[-2].expression)->oper != ast_sequence) { (yyval.expression) = new(ctx) ast_expression(ast_sequence, NULL, NULL, NULL); - (yyval.expression)->set_location(yylloc); + (yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0])); (yyval.expression)->expressions.push_tail(& (yyvsp[-2].expression)->link); } else { (yyval.expression) = (yyvsp[-2].expression); @@ -3814,138 +3841,139 @@ yyreduce: (yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link); } -#line 3818 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 3845 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 111: -#line 826 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 112: +#line 840 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { state->symbols->pop_scope(); (yyval.node) = (yyvsp[-1].function); } -#line 3827 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 112: -#line 831 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - (yyval.node) = (yyvsp[-1].declarator_list); - } -#line 3835 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 3854 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 113: -#line 835 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 845 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + (yyval.node) = (yyvsp[-1].declarator_list); + } +#line 3862 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 114: +#line 849 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyvsp[-1].type_specifier)->default_precision = (yyvsp[-2].n); (yyval.node) = (yyvsp[-1].type_specifier); } -#line 3844 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 3871 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 114: -#line 840 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 115: +#line 854 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } -#line 3852 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 3879 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 118: -#line 856 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 119: +#line 870 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.function) = (yyvsp[-1].function); (yyval.function)->parameters.push_tail(& (yyvsp[0].parameter_declarator)->link); } -#line 3861 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 3888 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 119: -#line 861 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 120: +#line 875 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.function) = (yyvsp[-2].function); (yyval.function)->parameters.push_tail(& (yyvsp[0].parameter_declarator)->link); } -#line 3870 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 120: -#line 869 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.function) = new(ctx) ast_function(); - (yyval.function)->set_location(yylloc); - (yyval.function)->return_type = (yyvsp[-2].fully_specified_type); - (yyval.function)->identifier = (yyvsp[-1].identifier); - - state->symbols->add_function(new(state) ir_function((yyvsp[-1].identifier))); - state->symbols->push_scope(); - } -#line 3885 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 3897 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 121: #line 883 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; - (yyval.parameter_declarator) = new(ctx) ast_parameter_declarator(); - (yyval.parameter_declarator)->set_location(yylloc); - (yyval.parameter_declarator)->type = new(ctx) ast_fully_specified_type(); - (yyval.parameter_declarator)->type->set_location(yylloc); - (yyval.parameter_declarator)->type->specifier = (yyvsp[-1].type_specifier); - (yyval.parameter_declarator)->identifier = (yyvsp[0].identifier); + (yyval.function) = new(ctx) ast_function(); + (yyval.function)->set_location((yylsp[-1])); + (yyval.function)->return_type = (yyvsp[-2].fully_specified_type); + (yyval.function)->identifier = (yyvsp[-1].identifier); + + state->symbols->add_function(new(state) ir_function((yyvsp[-1].identifier))); + state->symbols->push_scope(); } -#line 3899 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 3912 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 122: -#line 893 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 897 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; (yyval.parameter_declarator) = new(ctx) ast_parameter_declarator(); - (yyval.parameter_declarator)->set_location(yylloc); + (yyval.parameter_declarator)->set_location_range((yylsp[-1]), (yylsp[0])); (yyval.parameter_declarator)->type = new(ctx) ast_fully_specified_type(); - (yyval.parameter_declarator)->type->set_location(yylloc); - (yyval.parameter_declarator)->type->specifier = (yyvsp[-2].type_specifier); - (yyval.parameter_declarator)->identifier = (yyvsp[-1].identifier); - (yyval.parameter_declarator)->array_specifier = (yyvsp[0].array_specifier); + (yyval.parameter_declarator)->type->set_location((yylsp[-1])); + (yyval.parameter_declarator)->type->specifier = (yyvsp[-1].type_specifier); + (yyval.parameter_declarator)->identifier = (yyvsp[0].identifier); } -#line 3914 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 3926 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 123: #line 907 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { - (yyval.parameter_declarator) = (yyvsp[0].parameter_declarator); - (yyval.parameter_declarator)->type->qualifier = (yyvsp[-1].type_qualifier); + void *ctx = state; + (yyval.parameter_declarator) = new(ctx) ast_parameter_declarator(); + (yyval.parameter_declarator)->set_location_range((yylsp[-2]), (yylsp[0])); + (yyval.parameter_declarator)->type = new(ctx) ast_fully_specified_type(); + (yyval.parameter_declarator)->type->set_location((yylsp[-2])); + (yyval.parameter_declarator)->type->specifier = (yyvsp[-2].type_specifier); + (yyval.parameter_declarator)->identifier = (yyvsp[-1].identifier); + (yyval.parameter_declarator)->array_specifier = (yyvsp[0].array_specifier); } -#line 3923 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 3941 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 124: -#line 912 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 921 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { - void *ctx = state; - (yyval.parameter_declarator) = new(ctx) ast_parameter_declarator(); - (yyval.parameter_declarator)->set_location(yylloc); - (yyval.parameter_declarator)->type = new(ctx) ast_fully_specified_type(); + (yyval.parameter_declarator) = (yyvsp[0].parameter_declarator); (yyval.parameter_declarator)->type->qualifier = (yyvsp[-1].type_qualifier); - (yyval.parameter_declarator)->type->specifier = (yyvsp[0].type_specifier); } -#line 3936 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 3950 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 125: -#line 924 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 926 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.parameter_declarator) = new(ctx) ast_parameter_declarator(); + (yyval.parameter_declarator)->set_location((yylsp[0])); + (yyval.parameter_declarator)->type = new(ctx) ast_fully_specified_type(); + (yyval.parameter_declarator)->type->set_location_range((yylsp[-1]), (yylsp[0])); + (yyval.parameter_declarator)->type->qualifier = (yyvsp[-1].type_qualifier); + (yyval.parameter_declarator)->type->specifier = (yyvsp[0].type_specifier); + } +#line 3964 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 126: +#line 939 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).precision = ast_precision_none; } -#line 3945 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 3973 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 126: -#line 929 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 127: +#line 944 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { if ((yyvsp[0].type_qualifier).flags.q.constant) _mesa_glsl_error(&(yylsp[-1]), state, "duplicate const qualifier"); @@ -3953,27 +3981,39 @@ yyreduce: (yyval.type_qualifier) = (yyvsp[0].type_qualifier); (yyval.type_qualifier).flags.q.constant = 1; } -#line 3957 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 3985 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 127: -#line 937 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 128: +#line 952 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + if ((yyvsp[0].type_qualifier).flags.q.precise) + _mesa_glsl_error(&(yylsp[-1]), state, "duplicate precise qualifier"); + + (yyval.type_qualifier) = (yyvsp[0].type_qualifier); + (yyval.type_qualifier).flags.q.precise = 1; + } +#line 3997 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 129: +#line 960 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { if (((yyvsp[-1].type_qualifier).flags.q.in || (yyvsp[-1].type_qualifier).flags.q.out) && ((yyvsp[0].type_qualifier).flags.q.in || (yyvsp[0].type_qualifier).flags.q.out)) _mesa_glsl_error(&(yylsp[-1]), state, "duplicate in/out/inout qualifier"); if (!state->ARB_shading_language_420pack_enable && (yyvsp[0].type_qualifier).flags.q.constant) - _mesa_glsl_error(&(yylsp[-1]), state, "const must be specified before " - "in/out/inout"); + _mesa_glsl_error(&(yylsp[-1]), state, "in/out/inout must come after const " + "or precise"); (yyval.type_qualifier) = (yyvsp[-1].type_qualifier); (yyval.type_qualifier).merge_qualifier(&(yylsp[-1]), state, (yyvsp[0].type_qualifier)); } -#line 3973 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4013 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 128: -#line 949 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 130: +#line 972 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { if ((yyvsp[0].type_qualifier).precision != ast_precision_none) _mesa_glsl_error(&(yylsp[-1]), state, "duplicate precision qualifier"); @@ -3984,230 +4024,251 @@ yyreduce: (yyval.type_qualifier) = (yyvsp[0].type_qualifier); (yyval.type_qualifier).precision = (yyvsp[-1].n); } -#line 3988 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 129: -#line 962 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); - (yyval.type_qualifier).precision = ast_precision_none; - (yyval.type_qualifier).flags.q.in = 1; - } -#line 3998 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 130: -#line 968 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); - (yyval.type_qualifier).precision = ast_precision_none; - (yyval.type_qualifier).flags.q.out = 1; - } -#line 4008 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4028 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 131: -#line 974 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 985 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; + (yyval.type_qualifier).flags.q.in = 1; + } +#line 4038 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 132: +#line 991 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; + (yyval.type_qualifier).flags.q.out = 1; + } +#line 4048 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 133: +#line 997 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).precision = ast_precision_none; (yyval.type_qualifier).flags.q.in = 1; (yyval.type_qualifier).flags.q.out = 1; } -#line 4019 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4059 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 134: -#line 990 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 136: +#line 1013 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; ast_declaration *decl = new(ctx) ast_declaration((yyvsp[0].identifier), NULL, NULL); - decl->set_location(yylloc); + decl->set_location((yylsp[0])); (yyval.declarator_list) = (yyvsp[-2].declarator_list); (yyval.declarator_list)->declarations.push_tail(&decl->link); state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[0].identifier), ir_var_auto, glsl_precision_undefined)); } -#line 4033 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4073 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 135: -#line 1000 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 137: +#line 1023 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-1].identifier), (yyvsp[0].array_specifier), NULL); - decl->set_location(yylloc); + decl->set_location_range((yylsp[-1]), (yylsp[0])); (yyval.declarator_list) = (yyvsp[-3].declarator_list); (yyval.declarator_list)->declarations.push_tail(&decl->link); state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[-1].identifier), ir_var_auto, glsl_precision_undefined)); } -#line 4047 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4087 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 136: -#line 1010 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 138: +#line 1033 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-3].identifier), (yyvsp[-2].array_specifier), (yyvsp[0].expression)); - decl->set_location(yylloc); + decl->set_location_range((yylsp[-3]), (yylsp[-2])); (yyval.declarator_list) = (yyvsp[-5].declarator_list); (yyval.declarator_list)->declarations.push_tail(&decl->link); state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[-3].identifier), ir_var_auto, glsl_precision_undefined)); } -#line 4061 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4101 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 137: -#line 1020 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 139: +#line 1043 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-2].identifier), NULL, (yyvsp[0].expression)); - decl->set_location(yylloc); + decl->set_location((yylsp[-2])); (yyval.declarator_list) = (yyvsp[-4].declarator_list); (yyval.declarator_list)->declarations.push_tail(&decl->link); state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[-2].identifier), ir_var_auto, glsl_precision_undefined)); } -#line 4075 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4115 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 138: -#line 1034 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 140: +#line 1057 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; /* Empty declaration list is valid. */ (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[0].fully_specified_type)); - (yyval.declarator_list)->set_location(yylloc); + (yyval.declarator_list)->set_location((yylsp[0])); } -#line 4086 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 139: -#line 1041 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration((yyvsp[0].identifier), NULL, NULL); - - (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[-1].fully_specified_type)); - (yyval.declarator_list)->set_location(yylloc); - (yyval.declarator_list)->declarations.push_tail(&decl->link); - } -#line 4099 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 140: -#line 1050 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-1].identifier), (yyvsp[0].array_specifier), NULL); - - (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[-2].fully_specified_type)); - (yyval.declarator_list)->set_location(yylloc); - (yyval.declarator_list)->declarations.push_tail(&decl->link); - } -#line 4112 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4126 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 141: -#line 1059 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-3].identifier), (yyvsp[-2].array_specifier), (yyvsp[0].expression)); - - (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[-4].fully_specified_type)); - (yyval.declarator_list)->set_location(yylloc); - (yyval.declarator_list)->declarations.push_tail(&decl->link); - } -#line 4125 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 142: -#line 1068 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-2].identifier), NULL, (yyvsp[0].expression)); - - (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[-3].fully_specified_type)); - (yyval.declarator_list)->set_location(yylloc); - (yyval.declarator_list)->declarations.push_tail(&decl->link); - } -#line 4138 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 143: -#line 1077 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 1064 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; ast_declaration *decl = new(ctx) ast_declaration((yyvsp[0].identifier), NULL, NULL); + decl->set_location((yylsp[0])); + + (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[-1].fully_specified_type)); + (yyval.declarator_list)->set_location_range((yylsp[-1]), (yylsp[0])); + (yyval.declarator_list)->declarations.push_tail(&decl->link); + } +#line 4140 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 142: +#line 1074 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-1].identifier), (yyvsp[0].array_specifier), NULL); + decl->set_location_range((yylsp[-1]), (yylsp[0])); + + (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[-2].fully_specified_type)); + (yyval.declarator_list)->set_location_range((yylsp[-2]), (yylsp[0])); + (yyval.declarator_list)->declarations.push_tail(&decl->link); + } +#line 4154 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 143: +#line 1084 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-3].identifier), (yyvsp[-2].array_specifier), (yyvsp[0].expression)); + decl->set_location_range((yylsp[-3]), (yylsp[-2])); + + (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[-4].fully_specified_type)); + (yyval.declarator_list)->set_location_range((yylsp[-4]), (yylsp[-2])); + (yyval.declarator_list)->declarations.push_tail(&decl->link); + } +#line 4168 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 144: +#line 1094 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-2].identifier), NULL, (yyvsp[0].expression)); + decl->set_location((yylsp[-2])); + + (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[-3].fully_specified_type)); + (yyval.declarator_list)->set_location_range((yylsp[-3]), (yylsp[-2])); + (yyval.declarator_list)->declarations.push_tail(&decl->link); + } +#line 4182 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 145: +#line 1104 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration((yyvsp[0].identifier), NULL, NULL); + decl->set_location((yylsp[0])); (yyval.declarator_list) = new(ctx) ast_declarator_list(NULL); - (yyval.declarator_list)->set_location(yylloc); + (yyval.declarator_list)->set_location_range((yylsp[-1]), (yylsp[0])); (yyval.declarator_list)->invariant = true; (yyval.declarator_list)->declarations.push_tail(&decl->link); } -#line 4153 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 144: -#line 1091 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.fully_specified_type) = new(ctx) ast_fully_specified_type(); - (yyval.fully_specified_type)->set_location(yylloc); - (yyval.fully_specified_type)->specifier = (yyvsp[0].type_specifier); - } -#line 4164 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 145: -#line 1098 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.fully_specified_type) = new(ctx) ast_fully_specified_type(); - (yyval.fully_specified_type)->set_location(yylloc); - (yyval.fully_specified_type)->qualifier = (yyvsp[-1].type_qualifier); - (yyval.fully_specified_type)->specifier = (yyvsp[0].type_specifier); - } -#line 4176 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4198 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 146: -#line 1109 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 1116 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { - (yyval.type_qualifier) = (yyvsp[-1].type_qualifier); + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration((yyvsp[0].identifier), NULL, NULL); + decl->set_location((yylsp[0])); + + (yyval.declarator_list) = new(ctx) ast_declarator_list(NULL); + (yyval.declarator_list)->set_location_range((yylsp[-1]), (yylsp[0])); + (yyval.declarator_list)->precise = true; + + (yyval.declarator_list)->declarations.push_tail(&decl->link); } -#line 4184 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4214 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 147: +#line 1131 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.fully_specified_type) = new(ctx) ast_fully_specified_type(); + (yyval.fully_specified_type)->set_location((yylsp[0])); + (yyval.fully_specified_type)->specifier = (yyvsp[0].type_specifier); + } +#line 4225 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 148: -#line 1117 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 1138 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.fully_specified_type) = new(ctx) ast_fully_specified_type(); + (yyval.fully_specified_type)->set_location_range((yylsp[-1]), (yylsp[0])); + (yyval.fully_specified_type)->qualifier = (yyvsp[-1].type_qualifier); + (yyval.fully_specified_type)->specifier = (yyvsp[0].type_specifier); + } +#line 4237 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 149: +#line 1149 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + (yyval.type_qualifier) = (yyvsp[-1].type_qualifier); + } +#line 4245 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 151: +#line 1157 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.type_qualifier) = (yyvsp[-2].type_qualifier); if (!(yyval.type_qualifier).merge_qualifier(& (yylsp[0]), state, (yyvsp[0].type_qualifier))) { YYERROR; } } -#line 4195 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4256 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 149: -#line 1126 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 152: +#line 1166 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.n) = (yyvsp[0].n); } -#line 4201 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4262 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 150: -#line 1127 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 153: +#line 1167 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.n) = (yyvsp[0].n); } -#line 4207 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4268 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 151: -#line 1132 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 154: +#line 1172 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).precision = ast_precision_none; @@ -4295,7 +4356,7 @@ yyreduce: /* Layout qualifiers for GLSL 1.50 geometry shaders. */ if (!(yyval.type_qualifier).flags.i) { - struct { + static const struct { const char *s; GLenum e; } map[] = { @@ -4393,11 +4454,11 @@ yyreduce: YYERROR; } } -#line 4397 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4458 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 152: -#line 1318 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 155: +#line 1358 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).precision = ast_precision_none; @@ -4405,6 +4466,13 @@ yyreduce: if (match_layout_qualifier("location", (yyvsp[-2].identifier), state) == 0) { (yyval.type_qualifier).flags.q.explicit_location = 1; + if ((yyval.type_qualifier).flags.q.attribute == 1 && + state->ARB_explicit_attrib_location_warn) { + _mesa_glsl_warning(& (yylsp[-2]), state, + "GL_ARB_explicit_attrib_location layout " + "identifier `%s' used", (yyvsp[-2].identifier)); + } + if ((yyvsp[0].n) >= 0) { (yyval.type_qualifier).location = (yyvsp[0].n); } else { @@ -4454,7 +4522,23 @@ yyreduce: } } - static const char *local_size_qualifiers[3] = { + if (state->stage == MESA_SHADER_GEOMETRY) { + if (match_layout_qualifier("stream", (yyvsp[-2].identifier), state) == 0 && + state->check_explicit_attrib_stream_allowed(& (yylsp[0]))) { + (yyval.type_qualifier).flags.q.stream = 1; + + if ((yyvsp[0].n) < 0) { + _mesa_glsl_error(& (yylsp[0]), state, + "invalid stream %d specified", (yyvsp[0].n)); + YYERROR; + } else { + (yyval.type_qualifier).flags.q.explicit_stream = 1; + (yyval.type_qualifier).stream = (yyvsp[0].n); + } + } + } + + static const char * const local_size_qualifiers[3] = { "local_size_x", "local_size_y", "local_size_z", @@ -4482,6 +4566,29 @@ yyreduce: } } + if (match_layout_qualifier("invocations", (yyvsp[-2].identifier), state) == 0) { + (yyval.type_qualifier).flags.q.invocations = 1; + + if ((yyvsp[0].n) <= 0) { + _mesa_glsl_error(& (yylsp[0]), state, + "invalid invocations %d specified", (yyvsp[0].n)); + YYERROR; + } else if ((yyvsp[0].n) > MAX_GEOMETRY_SHADER_INVOCATIONS) { + _mesa_glsl_error(& (yylsp[0]), state, + "invocations (%d) exceeds " + "GL_MAX_GEOMETRY_SHADER_INVOCATIONS", (yyvsp[0].n)); + YYERROR; + } else { + (yyval.type_qualifier).invocations = (yyvsp[0].n); + if (!state->is_version(400, 0) && + !state->ARB_gpu_shader5_enable) { + _mesa_glsl_error(& (yylsp[0]), state, + "GL_ARB_gpu_shader5 invocations " + "qualifier specified", (yyvsp[0].n)); + } + } + } + /* If the identifier didn't match any known layout identifiers, * emit an error. */ @@ -4489,17 +4596,13 @@ yyreduce: _mesa_glsl_error(& (yylsp[-2]), state, "unrecognized layout identifier " "`%s'", (yyvsp[-2].identifier)); YYERROR; - } else if (state->ARB_explicit_attrib_location_warn) { - _mesa_glsl_warning(& (yylsp[-2]), state, - "GL_ARB_explicit_attrib_location layout " - "identifier `%s' used", (yyvsp[-2].identifier)); } } -#line 4499 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4602 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 153: -#line 1416 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 156: +#line 1498 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.type_qualifier) = (yyvsp[0].type_qualifier); /* Layout qualifiers for ARB_uniform_buffer_object. */ @@ -4513,98 +4616,118 @@ yyreduce: "layout qualifier `%s' is used", (yyvsp[0].type_qualifier)); } } -#line 4517 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4620 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 154: -#line 1442 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 157: +#line 1524 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).precision = ast_precision_none; (yyval.type_qualifier).flags.q.row_major = 1; } -#line 4527 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4630 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 155: -#line 1448 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 158: +#line 1530 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).precision = ast_precision_none; (yyval.type_qualifier).flags.q.packed = 1; } -#line 4537 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4640 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 156: -#line 1457 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 159: +#line 1539 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).precision = ast_precision_none; (yyval.type_qualifier).flags.q.smooth = 1; } -#line 4547 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4650 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 157: -#line 1463 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 160: +#line 1545 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).precision = ast_precision_none; (yyval.type_qualifier).flags.q.flat = 1; } -#line 4557 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4660 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 158: -#line 1469 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 161: +#line 1551 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).precision = ast_precision_none; (yyval.type_qualifier).flags.q.noperspective = 1; } -#line 4567 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4670 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 159: -#line 1479 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 162: +#line 1561 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).precision = ast_precision_none; (yyval.type_qualifier).flags.q.invariant = 1; } -#line 4577 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4680 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 164: -#line 1489 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 163: +#line 1567 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).flags.q.precise = 1; + } +#line 4689 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 168: +#line 1576 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(&(yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).precision = ast_precision_none; (yyval.type_qualifier).precision = (yyvsp[0].n); } -#line 4587 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4699 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 165: -#line 1508 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 169: +#line 1595 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + if ((yyvsp[0].type_qualifier).flags.q.precise) + _mesa_glsl_error(&(yylsp[-1]), state, "duplicate \"precise\" qualifier"); + + (yyval.type_qualifier) = (yyvsp[0].type_qualifier); + (yyval.type_qualifier).flags.q.precise = 1; + } +#line 4711 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 170: +#line 1603 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { if ((yyvsp[0].type_qualifier).flags.q.invariant) _mesa_glsl_error(&(yylsp[-1]), state, "duplicate \"invariant\" qualifier"); - if ((yyvsp[0].type_qualifier).has_layout()) { + if (!state->ARB_shading_language_420pack_enable && (yyvsp[0].type_qualifier).flags.q.precise) _mesa_glsl_error(&(yylsp[-1]), state, - "\"invariant\" cannot be used with layout(...)"); - } + "\"invariant\" must come after \"precise\""); (yyval.type_qualifier) = (yyvsp[0].type_qualifier); (yyval.type_qualifier).flags.q.invariant = 1; } -#line 4604 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4727 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 166: -#line 1521 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 171: +#line 1615 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { /* Section 4.3 of the GLSL 1.40 specification states: * "...qualified with one of these interpolation qualifiers" @@ -4619,51 +4742,41 @@ yyreduce: if ((yyvsp[0].type_qualifier).has_interpolation()) _mesa_glsl_error(&(yylsp[-1]), state, "duplicate interpolation qualifier"); - if ((yyvsp[0].type_qualifier).has_layout()) { - _mesa_glsl_error(&(yylsp[-1]), state, "interpolation qualifiers cannot be used " - "with layout(...)"); - } - - if (!state->ARB_shading_language_420pack_enable && (yyvsp[0].type_qualifier).flags.q.invariant) { + if (!state->ARB_shading_language_420pack_enable && + ((yyvsp[0].type_qualifier).flags.q.precise || (yyvsp[0].type_qualifier).flags.q.invariant)) { _mesa_glsl_error(&(yylsp[-1]), state, "interpolation qualifiers must come " - "after \"invariant\""); + "after \"precise\" or \"invariant\""); } (yyval.type_qualifier) = (yyvsp[-1].type_qualifier); (yyval.type_qualifier).merge_qualifier(&(yylsp[-1]), state, (yyvsp[0].type_qualifier)); } -#line 4636 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4755 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 167: -#line 1549 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 172: +#line 1639 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { - /* The GLSL 1.50 grammar indicates that a layout(...) declaration can be - * used standalone or immediately before a storage qualifier. It cannot - * be used with interpolation qualifiers or invariant. There does not - * appear to be any text indicating that it must come before the storage - * qualifier, but always seems to in examples. + /* In the absence of ARB_shading_language_420pack, layout qualifiers may + * appear no later than auxiliary storage qualifiers. There is no + * particularly clear spec language mandating this, but in all examples + * the layout qualifier precedes the storage qualifier. + * + * We allow combinations of layout with interpolation, invariant or + * precise qualifiers since these are useful in ARB_separate_shader_objects. + * There is no clear spec guidance on this either. */ if (!state->ARB_shading_language_420pack_enable && (yyvsp[0].type_qualifier).has_layout()) _mesa_glsl_error(&(yylsp[-1]), state, "duplicate layout(...) qualifiers"); - if ((yyvsp[0].type_qualifier).flags.q.invariant) - _mesa_glsl_error(&(yylsp[-1]), state, "layout(...) cannot be used with " - "the \"invariant\" qualifier"); - - if ((yyvsp[0].type_qualifier).has_interpolation()) { - _mesa_glsl_error(&(yylsp[-1]), state, "layout(...) cannot be used with " - "interpolation qualifiers"); - } - (yyval.type_qualifier) = (yyvsp[-1].type_qualifier); (yyval.type_qualifier).merge_qualifier(&(yylsp[-1]), state, (yyvsp[0].type_qualifier)); } -#line 4663 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4776 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 168: -#line 1572 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 173: +#line 1656 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { if ((yyvsp[0].type_qualifier).has_auxiliary_storage()) { _mesa_glsl_error(&(yylsp[-1]), state, @@ -4671,18 +4784,19 @@ yyreduce: } if (!state->ARB_shading_language_420pack_enable && - ((yyvsp[0].type_qualifier).flags.q.invariant || (yyvsp[0].type_qualifier).has_interpolation() || (yyvsp[0].type_qualifier).has_layout())) { + ((yyvsp[0].type_qualifier).flags.q.precise || (yyvsp[0].type_qualifier).flags.q.invariant || + (yyvsp[0].type_qualifier).has_interpolation() || (yyvsp[0].type_qualifier).has_layout())) { _mesa_glsl_error(&(yylsp[-1]), state, "auxiliary storage qualifiers must come " "just before storage qualifiers"); } (yyval.type_qualifier) = (yyvsp[-1].type_qualifier); (yyval.type_qualifier).merge_qualifier(&(yylsp[-1]), state, (yyvsp[0].type_qualifier)); } -#line 4682 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4796 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 169: -#line 1587 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 174: +#line 1672 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { /* Section 4.3 of the GLSL 1.20 specification states: * "Variable declarations may have a storage qualifier specified..." @@ -4692,21 +4806,21 @@ yyreduce: _mesa_glsl_error(&(yylsp[-1]), state, "duplicate storage qualifier"); if (!state->ARB_shading_language_420pack_enable && - ((yyvsp[0].type_qualifier).flags.q.invariant || (yyvsp[0].type_qualifier).has_interpolation() || (yyvsp[0].type_qualifier).has_layout() || - (yyvsp[0].type_qualifier).has_auxiliary_storage())) { + ((yyvsp[0].type_qualifier).flags.q.precise || (yyvsp[0].type_qualifier).flags.q.invariant || (yyvsp[0].type_qualifier).has_interpolation() || + (yyvsp[0].type_qualifier).has_layout() || (yyvsp[0].type_qualifier).has_auxiliary_storage())) { _mesa_glsl_error(&(yylsp[-1]), state, "storage qualifiers must come after " - "invariant, interpolation, layout and auxiliary " + "precise, invariant, interpolation, layout and auxiliary " "storage qualifiers"); } (yyval.type_qualifier) = (yyvsp[-1].type_qualifier); (yyval.type_qualifier).merge_qualifier(&(yylsp[-1]), state, (yyvsp[0].type_qualifier)); } -#line 4706 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4820 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 170: -#line 1607 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 175: +#line 1692 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { if ((yyvsp[0].type_qualifier).precision != ast_precision_none) _mesa_glsl_error(&(yylsp[-1]), state, "duplicate precision qualifier"); @@ -4717,154 +4831,181 @@ yyreduce: (yyval.type_qualifier) = (yyvsp[0].type_qualifier); (yyval.type_qualifier).precision = (yyvsp[-1].n); } -#line 4721 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4835 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 171: -#line 1621 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 176: +#line 1706 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).precision = ast_precision_none; (yyval.type_qualifier).flags.q.centroid = 1; } -#line 4731 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4845 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 172: -#line 1627 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 177: +#line 1712 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).flags.q.sample = 1; } -#line 4740 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4854 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 173: -#line 1635 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 178: +#line 1720 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).precision = ast_precision_none; (yyval.type_qualifier).flags.q.constant = 1; } -#line 4750 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4864 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 174: -#line 1641 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 179: +#line 1726 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).precision = ast_precision_none; (yyval.type_qualifier).flags.q.attribute = 1; } -#line 4760 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4874 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 175: -#line 1647 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 180: +#line 1732 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).precision = ast_precision_none; (yyval.type_qualifier).flags.q.varying = 1; } -#line 4770 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4884 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 176: -#line 1653 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 181: +#line 1738 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).precision = ast_precision_none; (yyval.type_qualifier).flags.q.in = 1; } -#line 4780 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4894 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 177: -#line 1659 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 182: +#line 1744 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).precision = ast_precision_none; (yyval.type_qualifier).flags.q.out = 1; } -#line 4790 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4904 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 178: -#line 1665 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 183: +#line 1750 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; + (yyval.type_qualifier).flags.q.in = 1; + (yyval.type_qualifier).flags.q.out = 1; + + if (state->stage == MESA_SHADER_GEOMETRY && + state->has_explicit_attrib_stream()) { + /* Section 4.3.8.2 (Output Layout Qualifiers) of the GLSL 4.00 + * spec says: + * + * "If the block or variable is declared with the stream + * identifier, it is associated with the specified stream; + * otherwise, it is associated with the current default stream." + */ + (yyval.type_qualifier).flags.q.stream = 1; + (yyval.type_qualifier).flags.q.explicit_stream = 0; + (yyval.type_qualifier).stream = state->out_qualifier->stream; + } + } +#line 4929 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 184: +#line 1771 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).precision = ast_precision_none; (yyval.type_qualifier).flags.q.uniform = 1; } -#line 4800 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4939 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 179: -#line 1671 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 185: +#line 1777 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).flags.q.coherent = 1; } -#line 4809 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4948 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 180: -#line 1676 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 186: +#line 1782 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).flags.q._volatile = 1; } -#line 4818 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4957 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 181: -#line 1681 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 187: +#line 1787 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { STATIC_ASSERT(sizeof((yyval.type_qualifier).flags.q) <= sizeof((yyval.type_qualifier).flags.i)); memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).flags.q.restrict_flag = 1; } -#line 4828 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4967 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 182: -#line 1687 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 188: +#line 1793 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).flags.q.read_only = 1; } -#line 4837 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4976 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 183: -#line 1692 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 189: +#line 1798 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).flags.q.write_only = 1; } -#line 4846 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4985 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 184: -#line 1700 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 190: +#line 1806 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; - (yyval.array_specifier) = new(ctx) ast_array_specifier(yylloc); + (yyval.array_specifier) = new(ctx) ast_array_specifier((yylsp[-1])); + (yyval.array_specifier)->set_location_range((yylsp[-1]), (yylsp[0])); } -#line 4855 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 4995 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 185: -#line 1705 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 191: +#line 1812 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; - (yyval.array_specifier) = new(ctx) ast_array_specifier(yylloc, (yyvsp[-1].expression)); + (yyval.array_specifier) = new(ctx) ast_array_specifier((yylsp[-2]), (yyvsp[-1].expression)); + (yyval.array_specifier)->set_location_range((yylsp[-2]), (yylsp[0])); } -#line 4864 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5005 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 186: -#line 1710 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 192: +#line 1818 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.array_specifier) = (yyvsp[-2].array_specifier); @@ -4878,11 +5019,11 @@ yyreduce: "be unsized"); } } -#line 4882 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5023 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 187: -#line 1724 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 193: +#line 1832 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.array_specifier) = (yyvsp[-3].array_specifier); @@ -4894,727 +5035,726 @@ yyreduce: (yyval.array_specifier)->add_dimension((yyvsp[-1].expression)); } -#line 4898 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5039 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 189: -#line 1740 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 195: +#line 1848 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.type_specifier) = (yyvsp[-1].type_specifier); (yyval.type_specifier)->array_specifier = (yyvsp[0].array_specifier); } -#line 4907 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 190: -#line 1748 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.type_specifier) = new(ctx) ast_type_specifier((yyvsp[0].identifier)); - (yyval.type_specifier)->set_location(yylloc); - } -#line 4917 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 191: -#line 1754 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.type_specifier) = new(ctx) ast_type_specifier((yyvsp[0].struct_specifier)); - (yyval.type_specifier)->set_location(yylloc); - } -#line 4927 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 192: -#line 1760 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.type_specifier) = new(ctx) ast_type_specifier((yyvsp[0].identifier)); - (yyval.type_specifier)->set_location(yylloc); - } -#line 4937 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 193: -#line 1768 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "void"; } -#line 4943 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 194: -#line 1769 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "float"; } -#line 4949 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 195: -#line 1770 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "int"; } -#line 4955 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5048 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 196: -#line 1771 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "uint"; } -#line 4961 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1856 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.type_specifier) = new(ctx) ast_type_specifier((yyvsp[0].identifier)); + (yyval.type_specifier)->set_location((yylsp[0])); + } +#line 5058 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 197: -#line 1772 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "bool"; } -#line 4967 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1862 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.type_specifier) = new(ctx) ast_type_specifier((yyvsp[0].struct_specifier)); + (yyval.type_specifier)->set_location((yylsp[0])); + } +#line 5068 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 198: -#line 1773 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "vec2"; } -#line 4973 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1868 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.type_specifier) = new(ctx) ast_type_specifier((yyvsp[0].identifier)); + (yyval.type_specifier)->set_location((yylsp[0])); + } +#line 5078 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 199: -#line 1774 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "vec3"; } -#line 4979 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1876 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "void"; } +#line 5084 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 200: -#line 1775 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "vec4"; } -#line 4985 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1877 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "float"; } +#line 5090 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 201: -#line 1776 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "bvec2"; } -#line 4991 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1878 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "int"; } +#line 5096 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 202: -#line 1777 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "bvec3"; } -#line 4997 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1879 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "uint"; } +#line 5102 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 203: -#line 1778 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "bvec4"; } -#line 5003 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1880 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "bool"; } +#line 5108 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 204: -#line 1779 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "ivec2"; } -#line 5009 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1881 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "vec2"; } +#line 5114 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 205: -#line 1780 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "ivec3"; } -#line 5015 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1882 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "vec3"; } +#line 5120 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 206: -#line 1781 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "ivec4"; } -#line 5021 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1883 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "vec4"; } +#line 5126 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 207: -#line 1782 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "uvec2"; } -#line 5027 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1884 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "bvec2"; } +#line 5132 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 208: -#line 1783 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "uvec3"; } -#line 5033 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1885 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "bvec3"; } +#line 5138 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 209: -#line 1784 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "uvec4"; } -#line 5039 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1886 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "bvec4"; } +#line 5144 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 210: -#line 1785 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "mat2"; } -#line 5045 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1887 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "ivec2"; } +#line 5150 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 211: -#line 1786 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "mat2x3"; } -#line 5051 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1888 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "ivec3"; } +#line 5156 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 212: -#line 1787 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "mat2x4"; } -#line 5057 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1889 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "ivec4"; } +#line 5162 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 213: -#line 1788 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "mat3x2"; } -#line 5063 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1890 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "uvec2"; } +#line 5168 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 214: -#line 1789 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "mat3"; } -#line 5069 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1891 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "uvec3"; } +#line 5174 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 215: -#line 1790 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "mat3x4"; } -#line 5075 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1892 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "uvec4"; } +#line 5180 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 216: -#line 1791 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "mat4x2"; } -#line 5081 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1893 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "mat2"; } +#line 5186 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 217: -#line 1792 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "mat4x3"; } -#line 5087 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1894 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "mat2x3"; } +#line 5192 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 218: -#line 1793 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "mat4"; } -#line 5093 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1895 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "mat2x4"; } +#line 5198 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 219: -#line 1794 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "sampler1D"; } -#line 5099 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1896 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "mat3x2"; } +#line 5204 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 220: -#line 1795 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "sampler2D"; } -#line 5105 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1897 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "mat3"; } +#line 5210 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 221: -#line 1796 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "sampler2DRect"; } -#line 5111 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1898 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "mat3x4"; } +#line 5216 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 222: -#line 1797 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "sampler3D"; } -#line 5117 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1899 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "mat4x2"; } +#line 5222 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 223: -#line 1798 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "samplerCube"; } -#line 5123 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1900 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "mat4x3"; } +#line 5228 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 224: -#line 1799 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "samplerExternalOES"; } -#line 5129 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1901 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "mat4"; } +#line 5234 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 225: -#line 1800 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "sampler1DShadow"; } -#line 5135 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1902 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "sampler1D"; } +#line 5240 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 226: -#line 1801 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "sampler2DShadow"; } -#line 5141 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1903 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "sampler2D"; } +#line 5246 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 227: -#line 1802 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "sampler2DRectShadow"; } -#line 5147 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1904 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "sampler2DRect"; } +#line 5252 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 228: -#line 1803 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "samplerCubeShadow"; } -#line 5153 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1905 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "sampler3D"; } +#line 5258 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 229: -#line 1804 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "sampler1DArray"; } -#line 5159 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1906 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "samplerCube"; } +#line 5264 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 230: -#line 1805 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "sampler2DArray"; } -#line 5165 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1907 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "samplerExternalOES"; } +#line 5270 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 231: -#line 1806 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "sampler1DArrayShadow"; } -#line 5171 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1908 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "sampler1DShadow"; } +#line 5276 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 232: -#line 1807 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "sampler2DArrayShadow"; } -#line 5177 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1909 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "sampler2DShadow"; } +#line 5282 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 233: -#line 1808 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "samplerBuffer"; } -#line 5183 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1910 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "sampler2DRectShadow"; } +#line 5288 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 234: -#line 1809 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "samplerCubeArray"; } -#line 5189 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1911 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "samplerCubeShadow"; } +#line 5294 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 235: -#line 1810 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "samplerCubeArrayShadow"; } -#line 5195 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1912 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "sampler1DArray"; } +#line 5300 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 236: -#line 1811 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "isampler1D"; } -#line 5201 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1913 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "sampler2DArray"; } +#line 5306 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 237: -#line 1812 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "isampler2D"; } -#line 5207 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1914 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "sampler1DArrayShadow"; } +#line 5312 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 238: -#line 1813 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "isampler2DRect"; } -#line 5213 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1915 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "sampler2DArrayShadow"; } +#line 5318 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 239: -#line 1814 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "isampler3D"; } -#line 5219 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1916 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "samplerBuffer"; } +#line 5324 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 240: -#line 1815 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "isamplerCube"; } -#line 5225 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1917 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "samplerCubeArray"; } +#line 5330 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 241: -#line 1816 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "isampler1DArray"; } -#line 5231 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1918 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "samplerCubeArrayShadow"; } +#line 5336 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 242: -#line 1817 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "isampler2DArray"; } -#line 5237 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1919 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "isampler1D"; } +#line 5342 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 243: -#line 1818 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "isamplerBuffer"; } -#line 5243 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1920 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "isampler2D"; } +#line 5348 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 244: -#line 1819 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "isamplerCubeArray"; } -#line 5249 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1921 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "isampler2DRect"; } +#line 5354 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 245: -#line 1820 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "usampler1D"; } -#line 5255 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1922 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "isampler3D"; } +#line 5360 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 246: -#line 1821 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "usampler2D"; } -#line 5261 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1923 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "isamplerCube"; } +#line 5366 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 247: -#line 1822 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "usampler2DRect"; } -#line 5267 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1924 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "isampler1DArray"; } +#line 5372 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 248: -#line 1823 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "usampler3D"; } -#line 5273 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1925 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "isampler2DArray"; } +#line 5378 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 249: -#line 1824 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "usamplerCube"; } -#line 5279 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1926 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "isamplerBuffer"; } +#line 5384 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 250: -#line 1825 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "usampler1DArray"; } -#line 5285 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1927 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "isamplerCubeArray"; } +#line 5390 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 251: -#line 1826 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "usampler2DArray"; } -#line 5291 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1928 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "usampler1D"; } +#line 5396 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 252: -#line 1827 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "usamplerBuffer"; } -#line 5297 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1929 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "usampler2D"; } +#line 5402 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 253: -#line 1828 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "usamplerCubeArray"; } -#line 5303 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1930 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "usampler2DRect"; } +#line 5408 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 254: -#line 1829 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "sampler2DMS"; } -#line 5309 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1931 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "usampler3D"; } +#line 5414 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 255: -#line 1830 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "isampler2DMS"; } -#line 5315 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1932 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "usamplerCube"; } +#line 5420 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 256: -#line 1831 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "usampler2DMS"; } -#line 5321 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1933 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "usampler1DArray"; } +#line 5426 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 257: -#line 1832 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "sampler2DMSArray"; } -#line 5327 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1934 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "usampler2DArray"; } +#line 5432 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 258: -#line 1833 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "isampler2DMSArray"; } -#line 5333 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1935 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "usamplerBuffer"; } +#line 5438 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 259: -#line 1834 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "usampler2DMSArray"; } -#line 5339 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1936 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "usamplerCubeArray"; } +#line 5444 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 260: -#line 1835 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "image1D"; } -#line 5345 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1937 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "sampler2DMS"; } +#line 5450 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 261: -#line 1836 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "image2D"; } -#line 5351 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1938 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "isampler2DMS"; } +#line 5456 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 262: -#line 1837 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "image3D"; } -#line 5357 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1939 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "usampler2DMS"; } +#line 5462 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 263: -#line 1838 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "image2DRect"; } -#line 5363 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1940 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "sampler2DMSArray"; } +#line 5468 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 264: -#line 1839 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "imageCube"; } -#line 5369 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1941 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "isampler2DMSArray"; } +#line 5474 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 265: -#line 1840 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "imageBuffer"; } -#line 5375 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1942 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "usampler2DMSArray"; } +#line 5480 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 266: -#line 1841 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "image1DArray"; } -#line 5381 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1943 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "image1D"; } +#line 5486 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 267: -#line 1842 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "image2DArray"; } -#line 5387 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1944 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "image2D"; } +#line 5492 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 268: -#line 1843 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "imageCubeArray"; } -#line 5393 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1945 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "image3D"; } +#line 5498 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 269: -#line 1844 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "image2DMS"; } -#line 5399 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1946 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "image2DRect"; } +#line 5504 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 270: -#line 1845 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "image2DMSArray"; } -#line 5405 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1947 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "imageCube"; } +#line 5510 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 271: -#line 1846 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "iimage1D"; } -#line 5411 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1948 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "imageBuffer"; } +#line 5516 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 272: -#line 1847 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "iimage2D"; } -#line 5417 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1949 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "image1DArray"; } +#line 5522 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 273: -#line 1848 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "iimage3D"; } -#line 5423 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1950 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "image2DArray"; } +#line 5528 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 274: -#line 1849 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "iimage2DRect"; } -#line 5429 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1951 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "imageCubeArray"; } +#line 5534 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 275: -#line 1850 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "iimageCube"; } -#line 5435 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1952 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "image2DMS"; } +#line 5540 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 276: -#line 1851 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "iimageBuffer"; } -#line 5441 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1953 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "image2DMSArray"; } +#line 5546 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 277: -#line 1852 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "iimage1DArray"; } -#line 5447 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1954 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "iimage1D"; } +#line 5552 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 278: -#line 1853 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "iimage2DArray"; } -#line 5453 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1955 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "iimage2D"; } +#line 5558 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 279: -#line 1854 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "iimageCubeArray"; } -#line 5459 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1956 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "iimage3D"; } +#line 5564 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 280: -#line 1855 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "iimage2DMS"; } -#line 5465 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1957 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "iimage2DRect"; } +#line 5570 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 281: -#line 1856 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "iimage2DMSArray"; } -#line 5471 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1958 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "iimageCube"; } +#line 5576 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 282: -#line 1857 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "uimage1D"; } -#line 5477 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1959 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "iimageBuffer"; } +#line 5582 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 283: -#line 1858 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "uimage2D"; } -#line 5483 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1960 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "iimage1DArray"; } +#line 5588 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 284: -#line 1859 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "uimage3D"; } -#line 5489 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1961 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "iimage2DArray"; } +#line 5594 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 285: -#line 1860 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "uimage2DRect"; } -#line 5495 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1962 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "iimageCubeArray"; } +#line 5600 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 286: -#line 1861 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "uimageCube"; } -#line 5501 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1963 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "iimage2DMS"; } +#line 5606 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 287: -#line 1862 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "uimageBuffer"; } -#line 5507 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1964 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "iimage2DMSArray"; } +#line 5612 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 288: -#line 1863 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "uimage1DArray"; } -#line 5513 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1965 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "uimage1D"; } +#line 5618 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 289: -#line 1864 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "uimage2DArray"; } -#line 5519 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1966 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "uimage2D"; } +#line 5624 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 290: -#line 1865 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "uimageCubeArray"; } -#line 5525 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1967 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "uimage3D"; } +#line 5630 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 291: -#line 1866 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "uimage2DMS"; } -#line 5531 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1968 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "uimage2DRect"; } +#line 5636 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 292: -#line 1867 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "uimage2DMSArray"; } -#line 5537 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1969 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "uimageCube"; } +#line 5642 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 293: -#line 1868 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.identifier) = "atomic_uint"; } -#line 5543 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 1970 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "uimageBuffer"; } +#line 5648 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 294: -#line 1873 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 1971 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "uimage1DArray"; } +#line 5654 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 295: +#line 1972 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "uimage2DArray"; } +#line 5660 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 296: +#line 1973 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "uimageCubeArray"; } +#line 5666 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 297: +#line 1974 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "uimage2DMS"; } +#line 5672 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 298: +#line 1975 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "uimage2DMSArray"; } +#line 5678 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 299: +#line 1976 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.identifier) = "atomic_uint"; } +#line 5684 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 300: +#line 1981 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { state->check_precision_qualifiers_allowed(&(yylsp[0])); (yyval.n) = ast_precision_high; } -#line 5552 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5693 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 295: -#line 1878 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 301: +#line 1986 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { state->check_precision_qualifiers_allowed(&(yylsp[0])); (yyval.n) = ast_precision_medium; } -#line 5561 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5702 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 296: -#line 1883 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 302: +#line 1991 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { state->check_precision_qualifiers_allowed(&(yylsp[0])); (yyval.n) = ast_precision_low; } -#line 5570 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5711 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 297: -#line 1891 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 303: +#line 1999 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; (yyval.struct_specifier) = new(ctx) ast_struct_specifier((yyvsp[-3].identifier), (yyvsp[-1].declarator_list)); - (yyval.struct_specifier)->set_location(yylloc); + (yyval.struct_specifier)->set_location_range((yylsp[-3]), (yylsp[0])); state->symbols->add_type((yyvsp[-3].identifier), glsl_type::void_type); - state->symbols->add_type_ast((yyvsp[-3].identifier), new(ctx) ast_type_specifier((yyval.struct_specifier))); } -#line 5582 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5722 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 298: -#line 1899 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 304: +#line 2006 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; (yyval.struct_specifier) = new(ctx) ast_struct_specifier(NULL, (yyvsp[-1].declarator_list)); - (yyval.struct_specifier)->set_location(yylloc); + (yyval.struct_specifier)->set_location_range((yylsp[-2]), (yylsp[0])); } -#line 5592 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5732 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 299: -#line 1908 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 305: +#line 2015 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.declarator_list) = (yyvsp[0].declarator_list); (yyvsp[0].declarator_list)->link.self_link(); } -#line 5601 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5741 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 300: -#line 1913 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 306: +#line 2020 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.declarator_list) = (yyvsp[-1].declarator_list); (yyval.declarator_list)->link.insert_before(& (yyvsp[0].declarator_list)->link); } -#line 5610 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5750 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 301: -#line 1921 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 307: +#line 2028 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; ast_fully_specified_type *const type = (yyvsp[-2].fully_specified_type); - type->set_location(yylloc); + type->set_location((yylsp[-2])); if (type->qualifier.flags.i != 0) _mesa_glsl_error(&(yylsp[-2]), state, @@ -5622,149 +5762,149 @@ yyreduce: "structure members"); (yyval.declarator_list) = new(ctx) ast_declarator_list(type); - (yyval.declarator_list)->set_location(yylloc); + (yyval.declarator_list)->set_location((yylsp[-1])); (yyval.declarator_list)->declarations.push_degenerate_list_at_head(& (yyvsp[-1].declaration)->link); } -#line 5630 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5770 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 302: -#line 1940 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 308: +#line 2047 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.declaration) = (yyvsp[0].declaration); (yyvsp[0].declaration)->link.self_link(); } -#line 5639 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5779 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 303: -#line 1945 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 309: +#line 2052 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.declaration) = (yyvsp[-2].declaration); (yyval.declaration)->link.insert_before(& (yyvsp[0].declaration)->link); } -#line 5648 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 304: -#line 1953 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.declaration) = new(ctx) ast_declaration((yyvsp[0].identifier), NULL, NULL); - (yyval.declaration)->set_location(yylloc); - } -#line 5658 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 305: -#line 1959 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.declaration) = new(ctx) ast_declaration((yyvsp[-1].identifier), (yyvsp[0].array_specifier), NULL); - (yyval.declaration)->set_location(yylloc); - } -#line 5668 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 307: -#line 1969 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - (yyval.expression) = (yyvsp[-1].expression); - } -#line 5676 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 308: -#line 1973 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - (yyval.expression) = (yyvsp[-2].expression); - } -#line 5684 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 309: -#line 1980 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_aggregate_initializer(); - (yyval.expression)->set_location(yylloc); - (yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link); - } -#line 5695 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5788 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 310: -#line 1987 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 2060 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.declaration) = new(ctx) ast_declaration((yyvsp[0].identifier), NULL, NULL); + (yyval.declaration)->set_location((yylsp[0])); + } +#line 5798 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 311: +#line 2066 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.declaration) = new(ctx) ast_declaration((yyvsp[-1].identifier), (yyvsp[0].array_specifier), NULL); + (yyval.declaration)->set_location_range((yylsp[-1]), (yylsp[0])); + } +#line 5808 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 313: +#line 2076 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + (yyval.expression) = (yyvsp[-1].expression); + } +#line 5816 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 314: +#line 2080 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + (yyval.expression) = (yyvsp[-2].expression); + } +#line 5824 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 315: +#line 2087 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_aggregate_initializer(); + (yyval.expression)->set_location((yylsp[0])); + (yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link); + } +#line 5835 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 316: +#line 2094 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyvsp[-2].expression)->expressions.push_tail(& (yyvsp[0].expression)->link); } -#line 5703 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5843 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 312: -#line 1999 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 318: +#line 2106 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.node) = (ast_node *) (yyvsp[0].compound_statement); } -#line 5709 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 320: -#line 2014 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.compound_statement) = new(ctx) ast_compound_statement(true, NULL); - (yyval.compound_statement)->set_location(yylloc); - } -#line 5719 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 321: -#line 2020 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - state->symbols->push_scope(); - } -#line 5727 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 322: -#line 2024 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.compound_statement) = new(ctx) ast_compound_statement(true, (yyvsp[-1].node)); - (yyval.compound_statement)->set_location(yylloc); - state->symbols->pop_scope(); - } -#line 5738 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 323: -#line 2033 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.node) = (ast_node *) (yyvsp[0].compound_statement); } -#line 5744 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 325: -#line 2039 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.compound_statement) = new(ctx) ast_compound_statement(false, NULL); - (yyval.compound_statement)->set_location(yylloc); - } -#line 5754 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5849 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 326: -#line 2045 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 2121 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; - (yyval.compound_statement) = new(ctx) ast_compound_statement(false, (yyvsp[-1].node)); - (yyval.compound_statement)->set_location(yylloc); + (yyval.compound_statement) = new(ctx) ast_compound_statement(true, NULL); + (yyval.compound_statement)->set_location_range((yylsp[-1]), (yylsp[0])); } -#line 5764 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5859 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 327: -#line 2054 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 2127 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + state->symbols->push_scope(); + } +#line 5867 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 328: +#line 2131 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.compound_statement) = new(ctx) ast_compound_statement(true, (yyvsp[-1].node)); + (yyval.compound_statement)->set_location_range((yylsp[-3]), (yylsp[0])); + state->symbols->pop_scope(); + } +#line 5878 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 329: +#line 2140 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.node) = (ast_node *) (yyvsp[0].compound_statement); } +#line 5884 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 331: +#line 2146 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.compound_statement) = new(ctx) ast_compound_statement(false, NULL); + (yyval.compound_statement)->set_location_range((yylsp[-1]), (yylsp[0])); + } +#line 5894 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 332: +#line 2152 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.compound_statement) = new(ctx) ast_compound_statement(false, (yyvsp[-1].node)); + (yyval.compound_statement)->set_location_range((yylsp[-2]), (yylsp[0])); + } +#line 5904 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 333: +#line 2161 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { if ((yyvsp[0].node) == NULL) { _mesa_glsl_error(& (yylsp[0]), state, " statement"); @@ -5774,11 +5914,11 @@ yyreduce: (yyval.node) = (yyvsp[0].node); (yyval.node)->link.self_link(); } -#line 5778 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5918 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 328: -#line 2064 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 334: +#line 2171 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { if ((yyvsp[0].node) == NULL) { _mesa_glsl_error(& (yylsp[0]), state, " statement"); @@ -5787,357 +5927,369 @@ yyreduce: (yyval.node) = (yyvsp[-1].node); (yyval.node)->link.insert_before(& (yyvsp[0].node)->link); } -#line 5791 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5931 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 329: -#line 2076 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 335: +#line 2183 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; (yyval.node) = new(ctx) ast_expression_statement(NULL); - (yyval.node)->set_location(yylloc); + (yyval.node)->set_location((yylsp[0])); } -#line 5801 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5941 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 330: -#line 2082 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 336: +#line 2189 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; (yyval.node) = new(ctx) ast_expression_statement((yyvsp[-1].expression)); - (yyval.node)->set_location(yylloc); + (yyval.node)->set_location((yylsp[-1])); } -#line 5811 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5951 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 331: -#line 2091 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 337: +#line 2198 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.node) = new(state) ast_selection_statement((yyvsp[-2].expression), (yyvsp[0].selection_rest_statement).then_statement, (yyvsp[0].selection_rest_statement).else_statement); - (yyval.node)->set_location(yylloc); + (yyval.node)->set_location_range((yylsp[-4]), (yylsp[0])); } -#line 5821 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5961 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 332: -#line 2100 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 338: +#line 2207 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.selection_rest_statement).then_statement = (yyvsp[-2].node); (yyval.selection_rest_statement).else_statement = (yyvsp[0].node); } -#line 5830 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5970 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 333: -#line 2105 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 339: +#line 2212 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.selection_rest_statement).then_statement = (yyvsp[0].node); (yyval.selection_rest_statement).else_statement = NULL; } -#line 5839 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5979 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 334: -#line 2113 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 340: +#line 2220 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.node) = (ast_node *) (yyvsp[0].expression); } -#line 5847 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 5987 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 335: -#line 2117 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 341: +#line 2224 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-2].identifier), NULL, (yyvsp[0].expression)); ast_declarator_list *declarator = new(ctx) ast_declarator_list((yyvsp[-3].fully_specified_type)); - decl->set_location(yylloc); - declarator->set_location(yylloc); + decl->set_location_range((yylsp[-2]), (yylsp[0])); + declarator->set_location((yylsp[-3])); declarator->declarations.push_tail(&decl->link); (yyval.node) = declarator; } -#line 5862 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6002 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 336: -#line 2135 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 342: +#line 2242 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.node) = new(state) ast_switch_statement((yyvsp[-2].expression), (yyvsp[0].switch_body)); - (yyval.node)->set_location(yylloc); + (yyval.node)->set_location_range((yylsp[-4]), (yylsp[0])); } -#line 5871 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6011 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 337: -#line 2143 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 343: +#line 2250 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.switch_body) = new(state) ast_switch_body(NULL); - (yyval.switch_body)->set_location(yylloc); + (yyval.switch_body)->set_location_range((yylsp[-1]), (yylsp[0])); } -#line 5880 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6020 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 338: -#line 2148 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 344: +#line 2255 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.switch_body) = new(state) ast_switch_body((yyvsp[-1].case_statement_list)); - (yyval.switch_body)->set_location(yylloc); + (yyval.switch_body)->set_location_range((yylsp[-2]), (yylsp[0])); } -#line 5889 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6029 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 339: -#line 2156 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 345: +#line 2263 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.case_label) = new(state) ast_case_label((yyvsp[-1].expression)); - (yyval.case_label)->set_location(yylloc); + (yyval.case_label)->set_location((yylsp[-1])); } -#line 5898 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6038 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 340: -#line 2161 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 346: +#line 2268 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.case_label) = new(state) ast_case_label(NULL); - (yyval.case_label)->set_location(yylloc); + (yyval.case_label)->set_location((yylsp[0])); } -#line 5907 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6047 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 341: -#line 2169 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 347: +#line 2276 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { ast_case_label_list *labels = new(state) ast_case_label_list(); labels->labels.push_tail(& (yyvsp[0].case_label)->link); (yyval.case_label_list) = labels; - (yyval.case_label_list)->set_location(yylloc); - } -#line 5919 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 342: -#line 2177 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - (yyval.case_label_list) = (yyvsp[-1].case_label_list); - (yyval.case_label_list)->labels.push_tail(& (yyvsp[0].case_label)->link); - } -#line 5928 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 343: -#line 2185 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - ast_case_statement *stmts = new(state) ast_case_statement((yyvsp[-1].case_label_list)); - stmts->set_location(yylloc); - - stmts->stmts.push_tail(& (yyvsp[0].node)->link); - (yyval.case_statement) = stmts; - } -#line 5940 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 344: -#line 2193 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - (yyval.case_statement) = (yyvsp[-1].case_statement); - (yyval.case_statement)->stmts.push_tail(& (yyvsp[0].node)->link); - } -#line 5949 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 345: -#line 2201 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - ast_case_statement_list *cases= new(state) ast_case_statement_list(); - cases->set_location(yylloc); - - cases->cases.push_tail(& (yyvsp[0].case_statement)->link); - (yyval.case_statement_list) = cases; - } -#line 5961 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 346: -#line 2209 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - (yyval.case_statement_list) = (yyvsp[-1].case_statement_list); - (yyval.case_statement_list)->cases.push_tail(& (yyvsp[0].case_statement)->link); - } -#line 5970 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 347: -#line 2217 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.node) = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_while, - NULL, (yyvsp[-2].node), NULL, (yyvsp[0].node)); - (yyval.node)->set_location(yylloc); - } -#line 5981 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 348: -#line 2224 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.node) = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_do_while, - NULL, (yyvsp[-2].expression), NULL, (yyvsp[-5].node)); - (yyval.node)->set_location(yylloc); - } -#line 5992 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 349: -#line 2231 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.node) = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_for, - (yyvsp[-3].node), (yyvsp[-2].for_rest_statement).cond, (yyvsp[-2].for_rest_statement).rest, (yyvsp[0].node)); - (yyval.node)->set_location(yylloc); - } -#line 6003 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 353: -#line 2247 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - (yyval.node) = NULL; - } -#line 6011 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 354: -#line 2254 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - (yyval.for_rest_statement).cond = (yyvsp[-1].node); - (yyval.for_rest_statement).rest = NULL; - } -#line 6020 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 355: -#line 2259 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - (yyval.for_rest_statement).cond = (yyvsp[-2].node); - (yyval.for_rest_statement).rest = (yyvsp[0].expression); - } -#line 6029 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 356: -#line 2268 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_continue, NULL); - (yyval.node)->set_location(yylloc); - } -#line 6039 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 357: -#line 2274 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_break, NULL); - (yyval.node)->set_location(yylloc); - } -#line 6049 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ - break; - - case 358: -#line 2280 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { - void *ctx = state; - (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, NULL); - (yyval.node)->set_location(yylloc); + (yyval.case_label_list)->set_location((yylsp[0])); } #line 6059 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 359: -#line 2286 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 348: +#line 2284 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + (yyval.case_label_list) = (yyvsp[-1].case_label_list); + (yyval.case_label_list)->labels.push_tail(& (yyvsp[0].case_label)->link); + } +#line 6068 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 349: +#line 2292 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + ast_case_statement *stmts = new(state) ast_case_statement((yyvsp[-1].case_label_list)); + stmts->set_location((yylsp[0])); + + stmts->stmts.push_tail(& (yyvsp[0].node)->link); + (yyval.case_statement) = stmts; + } +#line 6080 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 350: +#line 2300 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + (yyval.case_statement) = (yyvsp[-1].case_statement); + (yyval.case_statement)->stmts.push_tail(& (yyvsp[0].node)->link); + } +#line 6089 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 351: +#line 2308 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + ast_case_statement_list *cases= new(state) ast_case_statement_list(); + cases->set_location((yylsp[0])); + + cases->cases.push_tail(& (yyvsp[0].case_statement)->link); + (yyval.case_statement_list) = cases; + } +#line 6101 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 352: +#line 2316 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + (yyval.case_statement_list) = (yyvsp[-1].case_statement_list); + (yyval.case_statement_list)->cases.push_tail(& (yyvsp[0].case_statement)->link); + } +#line 6110 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 353: +#line 2324 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; - (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, (yyvsp[-1].expression)); - (yyval.node)->set_location(yylloc); + (yyval.node) = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_while, + NULL, (yyvsp[-2].node), NULL, (yyvsp[0].node)); + (yyval.node)->set_location_range((yylsp[-4]), (yylsp[-1])); } -#line 6069 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6121 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 354: +#line 2331 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.node) = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_do_while, + NULL, (yyvsp[-2].expression), NULL, (yyvsp[-5].node)); + (yyval.node)->set_location_range((yylsp[-6]), (yylsp[-1])); + } +#line 6132 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 355: +#line 2338 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.node) = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_for, + (yyvsp[-3].node), (yyvsp[-2].for_rest_statement).cond, (yyvsp[-2].for_rest_statement).rest, (yyvsp[0].node)); + (yyval.node)->set_location_range((yylsp[-5]), (yylsp[0])); + } +#line 6143 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 359: +#line 2354 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + (yyval.node) = NULL; + } +#line 6151 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 360: -#line 2292 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 2361 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { - void *ctx = state; - (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_discard, NULL); - (yyval.node)->set_location(yylloc); + (yyval.for_rest_statement).cond = (yyvsp[-1].node); + (yyval.for_rest_statement).rest = NULL; } -#line 6079 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6160 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 361: -#line 2300 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.node) = (yyvsp[0].function_definition); } -#line 6085 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 2366 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + (yyval.for_rest_statement).cond = (yyvsp[-2].node); + (yyval.for_rest_statement).rest = (yyvsp[0].expression); + } +#line 6169 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 362: -#line 2301 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.node) = (yyvsp[0].node); } -#line 6091 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 2375 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_continue, NULL); + (yyval.node)->set_location((yylsp[-1])); + } +#line 6179 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 363: -#line 2302 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.node) = NULL; } -#line 6097 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 2381 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_break, NULL); + (yyval.node)->set_location((yylsp[-1])); + } +#line 6189 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 364: -#line 2303 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ - { (yyval.node) = (yyvsp[0].node); } -#line 6103 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 2387 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, NULL); + (yyval.node)->set_location((yylsp[-1])); + } +#line 6199 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; case 365: -#line 2308 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ +#line 2393 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, (yyvsp[-1].expression)); + (yyval.node)->set_location_range((yylsp[-2]), (yylsp[-1])); + } +#line 6209 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 366: +#line 2399 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { + void *ctx = state; + (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_discard, NULL); + (yyval.node)->set_location((yylsp[-1])); + } +#line 6219 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 367: +#line 2407 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.node) = (yyvsp[0].function_definition); } +#line 6225 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 368: +#line 2408 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.node) = (yyvsp[0].node); } +#line 6231 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 369: +#line 2409 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.node) = NULL; } +#line 6237 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 370: +#line 2410 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + { (yyval.node) = (yyvsp[0].node); } +#line 6243 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ + break; + + case 371: +#line 2415 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; (yyval.function_definition) = new(ctx) ast_function_definition(); - (yyval.function_definition)->set_location(yylloc); + (yyval.function_definition)->set_location_range((yylsp[-1]), (yylsp[0])); (yyval.function_definition)->prototype = (yyvsp[-1].function); (yyval.function_definition)->body = (yyvsp[0].compound_statement); state->symbols->pop_scope(); } -#line 6117 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6257 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 366: -#line 2322 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 372: +#line 2429 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].interface_block); } -#line 6125 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6265 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 367: -#line 2326 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 373: +#line 2433 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { ast_interface_block *block = (yyvsp[0].interface_block); if (!block->layout.merge_qualifier(& (yylsp[-1]), state, (yyvsp[-1].type_qualifier))) { YYERROR; } + + foreach_list_typed (ast_declarator_list, member, link, &block->declarations) { + ast_type_qualifier& qualifier = member->type->qualifier; + if (qualifier.flags.q.stream && qualifier.stream != block->layout.stream) { + _mesa_glsl_error(& (yylsp[-1]), state, + "stream layout qualifier on " + "interface block member does not match " + "the interface block (%d vs %d)", + qualifier.stream, block->layout.stream); + YYERROR; + } + } (yyval.node) = block; } -#line 6137 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6289 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 368: -#line 2337 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 374: +#line 2456 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { ast_interface_block *const block = (yyvsp[-1].interface_block); @@ -6205,6 +6357,14 @@ yyreduce: block->layout.flags.i |= block_interface_qualifier; + if (state->stage == MESA_SHADER_GEOMETRY && + state->has_explicit_attrib_stream()) { + /* Assign global layout's stream value. */ + block->layout.flags.q.stream = 1; + block->layout.flags.q.explicit_stream = 0; + block->layout.stream = state->out_qualifier->stream; + } + foreach_list_typed (ast_declarator_list, member, link, &block->declarations) { ast_type_qualifier& qualifier = member->type->qualifier; if ((qualifier.flags.i & interface_type_mask) == 0) { @@ -6231,90 +6391,92 @@ yyreduce: (yyval.interface_block) = block; } -#line 6235 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6395 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 369: -#line 2434 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 375: +#line 2561 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).precision = ast_precision_none; (yyval.type_qualifier).flags.q.in = 1; } -#line 6245 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6405 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 370: -#line 2440 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 376: +#line 2567 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).precision = ast_precision_none; (yyval.type_qualifier).flags.q.out = 1; } -#line 6255 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6415 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 371: -#line 2446 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 377: +#line 2573 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); (yyval.type_qualifier).precision = ast_precision_none; (yyval.type_qualifier).flags.q.uniform = 1; } -#line 6265 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6425 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 372: -#line 2455 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 378: +#line 2582 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.interface_block) = new(state) ast_interface_block(*state->default_uniform_qualifier, NULL, NULL); } -#line 6274 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6434 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 373: -#line 2460 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 379: +#line 2587 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.interface_block) = new(state) ast_interface_block(*state->default_uniform_qualifier, (yyvsp[0].identifier), NULL); + (yyval.interface_block)->set_location((yylsp[0])); } -#line 6283 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6444 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 374: -#line 2465 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 380: +#line 2593 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.interface_block) = new(state) ast_interface_block(*state->default_uniform_qualifier, (yyvsp[-1].identifier), (yyvsp[0].array_specifier)); + (yyval.interface_block)->set_location_range((yylsp[-1]), (yylsp[0])); } -#line 6292 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6454 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 375: -#line 2473 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 381: +#line 2602 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.declarator_list) = (yyvsp[0].declarator_list); (yyvsp[0].declarator_list)->link.self_link(); } -#line 6301 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6463 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 376: -#line 2478 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 382: +#line 2607 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { (yyval.declarator_list) = (yyvsp[-1].declarator_list); (yyvsp[0].declarator_list)->link.insert_before(& (yyval.declarator_list)->link); } -#line 6310 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6472 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 377: -#line 2486 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 383: +#line 2615 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { void *ctx = state; ast_fully_specified_type *type = (yyvsp[-2].fully_specified_type); - type->set_location(yylloc); + type->set_location((yylsp[-2])); if (type->qualifier.flags.q.attribute) { _mesa_glsl_error(& (yylsp[-2]), state, @@ -6327,90 +6489,37 @@ yyreduce: } (yyval.declarator_list) = new(ctx) ast_declarator_list(type); - (yyval.declarator_list)->set_location(yylloc); + (yyval.declarator_list)->set_location((yylsp[-1])); (yyval.declarator_list)->declarations.push_degenerate_list_at_head(& (yyvsp[-1].declaration)->link); } -#line 6335 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6497 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 378: -#line 2510 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 384: +#line 2639 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { if (!state->default_uniform_qualifier->merge_qualifier(& (yylsp[-2]), state, (yyvsp[-2].type_qualifier))) { YYERROR; } (yyval.node) = NULL; } -#line 6346 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6508 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 379: -#line 2518 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 385: +#line 2647 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { - void *ctx = state; (yyval.node) = NULL; - switch (state->stage) { - case MESA_SHADER_GEOMETRY: { - if (!(yyvsp[-2].type_qualifier).flags.q.prim_type) { - _mesa_glsl_error(& (yylsp[-2]), state, - "input layout qualifiers must specify a primitive" - " type"); - } else { - /* Make sure this is a valid input primitive type. */ - switch ((yyvsp[-2].type_qualifier).prim_type) { - case GL_POINTS: - case GL_LINES: - case GL_LINES_ADJACENCY: - case GL_TRIANGLES: - case GL_TRIANGLES_ADJACENCY: - (yyval.node) = new(ctx) ast_gs_input_layout((yylsp[-2]), (yyvsp[-2].type_qualifier).prim_type); - break; - default: - _mesa_glsl_error(&(yylsp[-2]), state, - "invalid geometry shader input primitive type"); - break; - } - } - } - break; - case MESA_SHADER_FRAGMENT: - if ((yyvsp[-2].type_qualifier).flags.q.early_fragment_tests) { - state->early_fragment_tests = true; - } else { - _mesa_glsl_error(& (yylsp[-2]), state, "invalid input layout qualifier"); - } - break; - case MESA_SHADER_COMPUTE: { - if ((yyvsp[-2].type_qualifier).flags.q.local_size == 0) { - _mesa_glsl_error(& (yylsp[-2]), state, - "input layout qualifiers must specify a local " - "size"); - } else { - /* Infer a local_size of 1 for every unspecified dimension */ - unsigned local_size[3]; - for (int i = 0; i < 3; i++) { - if ((yyvsp[-2].type_qualifier).flags.q.local_size & (1 << i)) - local_size[i] = (yyvsp[-2].type_qualifier).local_size[i]; - else - local_size[i] = 1; - } - (yyval.node) = new(ctx) ast_cs_input_layout((yylsp[-2]), local_size); - } - } - break; - default: - _mesa_glsl_error(& (yylsp[-2]), state, - "input layout qualifiers only valid in " - "geometry, fragment and compute shaders"); - break; + if (!state->in_qualifier->merge_in_qualifier(& (yylsp[-2]), state, (yyvsp[-2].type_qualifier), (yyval.node))) { + YYERROR; } } -#line 6410 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6519 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; - case 380: -#line 2579 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ + case 386: +#line 2655 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */ { if (state->stage != MESA_SHADER_GEOMETRY) { _mesa_glsl_error(& (yylsp[-2]), state, @@ -6432,14 +6541,17 @@ yyreduce: } if (!state->out_qualifier->merge_qualifier(& (yylsp[-2]), state, (yyvsp[-2].type_qualifier))) YYERROR; + + /* Allow future assigments of global out's stream id value */ + state->out_qualifier->flags.q.explicit_stream = 0; } (yyval.node) = NULL; } -#line 6439 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6551 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ break; -#line 6443 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ +#line 6555 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_parser.h b/3rdparty/glsl-optimizer/src/glsl/glsl_parser.h index 200eeed75..715f0babc 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_parser.h +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_parser.h @@ -80,193 +80,193 @@ extern int _mesa_glsl_debug; INOUT_TOK = 290, UNIFORM = 291, VARYING = 292, - NOPERSPECTIVE = 293, - FLAT = 294, - SMOOTH = 295, - MAT2X2 = 296, - MAT2X3 = 297, - MAT2X4 = 298, - MAT3X2 = 299, - MAT3X3 = 300, - MAT3X4 = 301, - MAT4X2 = 302, - MAT4X3 = 303, - MAT4X4 = 304, - SAMPLER1D = 305, - SAMPLER2D = 306, - SAMPLER3D = 307, - SAMPLERCUBE = 308, - SAMPLER1DSHADOW = 309, - SAMPLER2DSHADOW = 310, - SAMPLERCUBESHADOW = 311, - SAMPLER1DARRAY = 312, - SAMPLER2DARRAY = 313, - SAMPLER1DARRAYSHADOW = 314, - SAMPLER2DARRAYSHADOW = 315, - SAMPLERCUBEARRAY = 316, - SAMPLERCUBEARRAYSHADOW = 317, - ISAMPLER1D = 318, - ISAMPLER2D = 319, - ISAMPLER3D = 320, - ISAMPLERCUBE = 321, - ISAMPLER1DARRAY = 322, - ISAMPLER2DARRAY = 323, - ISAMPLERCUBEARRAY = 324, - USAMPLER1D = 325, - USAMPLER2D = 326, - USAMPLER3D = 327, - USAMPLERCUBE = 328, - USAMPLER1DARRAY = 329, - USAMPLER2DARRAY = 330, - USAMPLERCUBEARRAY = 331, - SAMPLER2DRECT = 332, - ISAMPLER2DRECT = 333, - USAMPLER2DRECT = 334, - SAMPLER2DRECTSHADOW = 335, - SAMPLERBUFFER = 336, - ISAMPLERBUFFER = 337, - USAMPLERBUFFER = 338, - SAMPLER2DMS = 339, - ISAMPLER2DMS = 340, - USAMPLER2DMS = 341, - SAMPLER2DMSARRAY = 342, - ISAMPLER2DMSARRAY = 343, - USAMPLER2DMSARRAY = 344, - SAMPLEREXTERNALOES = 345, - IMAGE1D = 346, - IMAGE2D = 347, - IMAGE3D = 348, - IMAGE2DRECT = 349, - IMAGECUBE = 350, - IMAGEBUFFER = 351, - IMAGE1DARRAY = 352, - IMAGE2DARRAY = 353, - IMAGECUBEARRAY = 354, - IMAGE2DMS = 355, - IMAGE2DMSARRAY = 356, - IIMAGE1D = 357, - IIMAGE2D = 358, - IIMAGE3D = 359, - IIMAGE2DRECT = 360, - IIMAGECUBE = 361, - IIMAGEBUFFER = 362, - IIMAGE1DARRAY = 363, - IIMAGE2DARRAY = 364, - IIMAGECUBEARRAY = 365, - IIMAGE2DMS = 366, - IIMAGE2DMSARRAY = 367, - UIMAGE1D = 368, - UIMAGE2D = 369, - UIMAGE3D = 370, - UIMAGE2DRECT = 371, - UIMAGECUBE = 372, - UIMAGEBUFFER = 373, - UIMAGE1DARRAY = 374, - UIMAGE2DARRAY = 375, - UIMAGECUBEARRAY = 376, - UIMAGE2DMS = 377, - UIMAGE2DMSARRAY = 378, - IMAGE1DSHADOW = 379, - IMAGE2DSHADOW = 380, - IMAGE1DARRAYSHADOW = 381, - IMAGE2DARRAYSHADOW = 382, - COHERENT = 383, - VOLATILE = 384, - RESTRICT = 385, - READONLY = 386, - WRITEONLY = 387, - ATOMIC_UINT = 388, - STRUCT = 389, - VOID_TOK = 390, - WHILE = 391, - IDENTIFIER = 392, - TYPE_IDENTIFIER = 393, - NEW_IDENTIFIER = 394, - FLOATCONSTANT = 395, - INTCONSTANT = 396, - UINTCONSTANT = 397, - BOOLCONSTANT = 398, - FIELD_SELECTION = 399, - LEFT_OP = 400, - RIGHT_OP = 401, - INC_OP = 402, - DEC_OP = 403, - LE_OP = 404, - GE_OP = 405, - EQ_OP = 406, - NE_OP = 407, - AND_OP = 408, - OR_OP = 409, - XOR_OP = 410, - MUL_ASSIGN = 411, - DIV_ASSIGN = 412, - ADD_ASSIGN = 413, - MOD_ASSIGN = 414, - LEFT_ASSIGN = 415, - RIGHT_ASSIGN = 416, - AND_ASSIGN = 417, - XOR_ASSIGN = 418, - OR_ASSIGN = 419, - SUB_ASSIGN = 420, - INVARIANT = 421, - LOWP = 422, - MEDIUMP = 423, - HIGHP = 424, - SUPERP = 425, - PRECISION = 426, - VERSION_TOK = 427, - EXTENSION = 428, - LINE = 429, - COLON = 430, - EOL = 431, - INTERFACE = 432, - OUTPUT = 433, - PRAGMA_DEBUG_ON = 434, - PRAGMA_DEBUG_OFF = 435, - PRAGMA_OPTIMIZE_ON = 436, - PRAGMA_OPTIMIZE_OFF = 437, - PRAGMA_INVARIANT_ALL = 438, - LAYOUT_TOK = 439, - ASM = 440, - CLASS = 441, - UNION = 442, - ENUM = 443, - TYPEDEF = 444, - TEMPLATE = 445, - THIS = 446, - PACKED_TOK = 447, - GOTO = 448, - INLINE_TOK = 449, - NOINLINE = 450, - PUBLIC_TOK = 451, - STATIC = 452, - EXTERN = 453, - EXTERNAL = 454, - LONG_TOK = 455, - SHORT_TOK = 456, - DOUBLE_TOK = 457, - HALF = 458, - FIXED_TOK = 459, - UNSIGNED = 460, - INPUT_TOK = 461, - OUPTUT = 462, - HVEC2 = 463, - HVEC3 = 464, - HVEC4 = 465, - DVEC2 = 466, - DVEC3 = 467, - DVEC4 = 468, - FVEC2 = 469, - FVEC3 = 470, - FVEC4 = 471, - SAMPLER3DRECT = 472, - SIZEOF = 473, - CAST = 474, - NAMESPACE = 475, - USING = 476, - RESOURCE = 477, - PATCH = 478, - SAMPLE = 479, + SAMPLE = 293, + NOPERSPECTIVE = 294, + FLAT = 295, + SMOOTH = 296, + MAT2X2 = 297, + MAT2X3 = 298, + MAT2X4 = 299, + MAT3X2 = 300, + MAT3X3 = 301, + MAT3X4 = 302, + MAT4X2 = 303, + MAT4X3 = 304, + MAT4X4 = 305, + SAMPLER1D = 306, + SAMPLER2D = 307, + SAMPLER3D = 308, + SAMPLERCUBE = 309, + SAMPLER1DSHADOW = 310, + SAMPLER2DSHADOW = 311, + SAMPLERCUBESHADOW = 312, + SAMPLER1DARRAY = 313, + SAMPLER2DARRAY = 314, + SAMPLER1DARRAYSHADOW = 315, + SAMPLER2DARRAYSHADOW = 316, + SAMPLERCUBEARRAY = 317, + SAMPLERCUBEARRAYSHADOW = 318, + ISAMPLER1D = 319, + ISAMPLER2D = 320, + ISAMPLER3D = 321, + ISAMPLERCUBE = 322, + ISAMPLER1DARRAY = 323, + ISAMPLER2DARRAY = 324, + ISAMPLERCUBEARRAY = 325, + USAMPLER1D = 326, + USAMPLER2D = 327, + USAMPLER3D = 328, + USAMPLERCUBE = 329, + USAMPLER1DARRAY = 330, + USAMPLER2DARRAY = 331, + USAMPLERCUBEARRAY = 332, + SAMPLER2DRECT = 333, + ISAMPLER2DRECT = 334, + USAMPLER2DRECT = 335, + SAMPLER2DRECTSHADOW = 336, + SAMPLERBUFFER = 337, + ISAMPLERBUFFER = 338, + USAMPLERBUFFER = 339, + SAMPLER2DMS = 340, + ISAMPLER2DMS = 341, + USAMPLER2DMS = 342, + SAMPLER2DMSARRAY = 343, + ISAMPLER2DMSARRAY = 344, + USAMPLER2DMSARRAY = 345, + SAMPLEREXTERNALOES = 346, + IMAGE1D = 347, + IMAGE2D = 348, + IMAGE3D = 349, + IMAGE2DRECT = 350, + IMAGECUBE = 351, + IMAGEBUFFER = 352, + IMAGE1DARRAY = 353, + IMAGE2DARRAY = 354, + IMAGECUBEARRAY = 355, + IMAGE2DMS = 356, + IMAGE2DMSARRAY = 357, + IIMAGE1D = 358, + IIMAGE2D = 359, + IIMAGE3D = 360, + IIMAGE2DRECT = 361, + IIMAGECUBE = 362, + IIMAGEBUFFER = 363, + IIMAGE1DARRAY = 364, + IIMAGE2DARRAY = 365, + IIMAGECUBEARRAY = 366, + IIMAGE2DMS = 367, + IIMAGE2DMSARRAY = 368, + UIMAGE1D = 369, + UIMAGE2D = 370, + UIMAGE3D = 371, + UIMAGE2DRECT = 372, + UIMAGECUBE = 373, + UIMAGEBUFFER = 374, + UIMAGE1DARRAY = 375, + UIMAGE2DARRAY = 376, + UIMAGECUBEARRAY = 377, + UIMAGE2DMS = 378, + UIMAGE2DMSARRAY = 379, + IMAGE1DSHADOW = 380, + IMAGE2DSHADOW = 381, + IMAGE1DARRAYSHADOW = 382, + IMAGE2DARRAYSHADOW = 383, + COHERENT = 384, + VOLATILE = 385, + RESTRICT = 386, + READONLY = 387, + WRITEONLY = 388, + ATOMIC_UINT = 389, + STRUCT = 390, + VOID_TOK = 391, + WHILE = 392, + IDENTIFIER = 393, + TYPE_IDENTIFIER = 394, + NEW_IDENTIFIER = 395, + FLOATCONSTANT = 396, + INTCONSTANT = 397, + UINTCONSTANT = 398, + BOOLCONSTANT = 399, + FIELD_SELECTION = 400, + LEFT_OP = 401, + RIGHT_OP = 402, + INC_OP = 403, + DEC_OP = 404, + LE_OP = 405, + GE_OP = 406, + EQ_OP = 407, + NE_OP = 408, + AND_OP = 409, + OR_OP = 410, + XOR_OP = 411, + MUL_ASSIGN = 412, + DIV_ASSIGN = 413, + ADD_ASSIGN = 414, + MOD_ASSIGN = 415, + LEFT_ASSIGN = 416, + RIGHT_ASSIGN = 417, + AND_ASSIGN = 418, + XOR_ASSIGN = 419, + OR_ASSIGN = 420, + SUB_ASSIGN = 421, + INVARIANT = 422, + PRECISE = 423, + LOWP = 424, + MEDIUMP = 425, + HIGHP = 426, + SUPERP = 427, + PRECISION = 428, + VERSION_TOK = 429, + EXTENSION = 430, + LINE = 431, + COLON = 432, + EOL = 433, + INTERFACE = 434, + OUTPUT = 435, + PRAGMA_DEBUG_ON = 436, + PRAGMA_DEBUG_OFF = 437, + PRAGMA_OPTIMIZE_ON = 438, + PRAGMA_OPTIMIZE_OFF = 439, + PRAGMA_INVARIANT_ALL = 440, + LAYOUT_TOK = 441, + ASM = 442, + CLASS = 443, + UNION = 444, + ENUM = 445, + TYPEDEF = 446, + TEMPLATE = 447, + THIS = 448, + PACKED_TOK = 449, + GOTO = 450, + INLINE_TOK = 451, + NOINLINE = 452, + PUBLIC_TOK = 453, + STATIC = 454, + EXTERN = 455, + EXTERNAL = 456, + LONG_TOK = 457, + SHORT_TOK = 458, + DOUBLE_TOK = 459, + HALF = 460, + FIXED_TOK = 461, + UNSIGNED = 462, + INPUT_TOK = 463, + HVEC2 = 464, + HVEC3 = 465, + HVEC4 = 466, + DVEC2 = 467, + DVEC3 = 468, + DVEC4 = 469, + FVEC2 = 470, + FVEC3 = 471, + FVEC4 = 472, + SAMPLER3DRECT = 473, + SIZEOF = 474, + CAST = 475, + NAMESPACE = 476, + USING = 477, + RESOURCE = 478, + PATCH = 479, SUBROUTINE = 480, ERROR_TOK = 481, COMMON = 482, @@ -283,7 +283,7 @@ extern int _mesa_glsl_debug; typedef union YYSTYPE YYSTYPE; union YYSTYPE { -#line 96 "src/glsl/glsl_parser.yy" /* yacc.c:1909 */ +#line 99 "src/glsl/glsl_parser.yy" /* yacc.c:1909 */ int n; float real; diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_parser.yy b/3rdparty/glsl-optimizer/src/glsl/glsl_parser.yy index 8617fb55e..f8b85c1ef 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_parser.yy +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_parser.yy @@ -24,6 +24,9 @@ #include #include #include +#ifndef _MSC_VER +#include +#endif #include #include "ast.h" @@ -133,7 +136,7 @@ static bool match_layout_qualifier(const char *s1, const char *s2, %token ATTRIBUTE CONST_TOK BOOL_TOK FLOAT_TOK INT_TOK UINT_TOK %token BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT %token BVEC2 BVEC3 BVEC4 IVEC2 IVEC3 IVEC4 UVEC2 UVEC3 UVEC4 VEC2 VEC3 VEC4 -%token CENTROID IN_TOK OUT_TOK INOUT_TOK UNIFORM VARYING +%token CENTROID IN_TOK OUT_TOK INOUT_TOK UNIFORM VARYING SAMPLE %token NOPERSPECTIVE FLAT SMOOTH %token MAT2X2 MAT2X3 MAT2X4 %token MAT3X2 MAT3X3 MAT3X4 @@ -171,7 +174,7 @@ static bool match_layout_qualifier(const char *s1, const char *s2, %token AND_OP OR_OP XOR_OP MUL_ASSIGN DIV_ASSIGN ADD_ASSIGN %token MOD_ASSIGN LEFT_ASSIGN RIGHT_ASSIGN AND_ASSIGN XOR_ASSIGN OR_ASSIGN %token SUB_ASSIGN -%token INVARIANT +%token INVARIANT PRECISE %token LOWP MEDIUMP HIGHP SUPERP PRECISION %token VERSION_TOK EXTENSION LINE COLON EOL INTERFACE OUTPUT @@ -184,11 +187,11 @@ static bool match_layout_qualifier(const char *s1, const char *s2, */ %token ASM CLASS UNION ENUM TYPEDEF TEMPLATE THIS PACKED_TOK GOTO %token INLINE_TOK NOINLINE PUBLIC_TOK STATIC EXTERN EXTERNAL -%token LONG_TOK SHORT_TOK DOUBLE_TOK HALF FIXED_TOK UNSIGNED INPUT_TOK OUPTUT +%token LONG_TOK SHORT_TOK DOUBLE_TOK HALF FIXED_TOK UNSIGNED INPUT_TOK %token HVEC2 HVEC3 HVEC4 DVEC2 DVEC3 DVEC4 FVEC2 FVEC3 FVEC4 %token SAMPLER3DRECT %token SIZEOF CAST NAMESPACE USING -%token RESOURCE PATCH SAMPLE +%token RESOURCE PATCH %token SUBROUTINE %token ERROR_TOK @@ -381,6 +384,14 @@ external_declaration_list: if ($2 != NULL) state->translation_unit.push_tail(& $2->link); } + | external_declaration_list extension_statement { + if (!state->allow_extension_directive_midshader) { + _mesa_glsl_error(& @2, state, + "#extension directive is not allowed " + "in the middle of a shader"); + YYERROR; + } + } ; variable_identifier: @@ -393,35 +404,35 @@ primary_expression: { void *ctx = state; $$ = new(ctx) ast_expression(ast_identifier, NULL, NULL, NULL); - $$->set_location(yylloc); + $$->set_location(@1); $$->primary_expression.identifier = $1; } | INTCONSTANT { void *ctx = state; $$ = new(ctx) ast_expression(ast_int_constant, NULL, NULL, NULL); - $$->set_location(yylloc); + $$->set_location(@1); $$->primary_expression.int_constant = $1; } | UINTCONSTANT { void *ctx = state; $$ = new(ctx) ast_expression(ast_uint_constant, NULL, NULL, NULL); - $$->set_location(yylloc); + $$->set_location(@1); $$->primary_expression.uint_constant = $1; } | FLOATCONSTANT { void *ctx = state; $$ = new(ctx) ast_expression(ast_float_constant, NULL, NULL, NULL); - $$->set_location(yylloc); + $$->set_location(@1); $$->primary_expression.float_constant = $1; } | BOOLCONSTANT { void *ctx = state; $$ = new(ctx) ast_expression(ast_bool_constant, NULL, NULL, NULL); - $$->set_location(yylloc); + $$->set_location(@1); $$->primary_expression.bool_constant = $1; } | '(' expression ')' @@ -436,7 +447,7 @@ postfix_expression: { void *ctx = state; $$ = new(ctx) ast_expression(ast_array_index, $1, $3, NULL); - $$->set_location(yylloc); + $$->set_location_range(@1, @4); } | function_call { @@ -446,20 +457,20 @@ postfix_expression: { void *ctx = state; $$ = new(ctx) ast_expression(ast_field_selection, $1, NULL, NULL); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); $$->primary_expression.identifier = $3; } | postfix_expression INC_OP { void *ctx = state; $$ = new(ctx) ast_expression(ast_post_inc, $1, NULL, NULL); - $$->set_location(yylloc); + $$->set_location_range(@1, @2); } | postfix_expression DEC_OP { void *ctx = state; $$ = new(ctx) ast_expression(ast_post_dec, $1, NULL, NULL); - $$->set_location(yylloc); + $$->set_location_range(@1, @2); } ; @@ -477,7 +488,7 @@ function_call_or_method: { void *ctx = state; $$ = new(ctx) ast_expression(ast_field_selection, $1, $3, NULL); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); } ; @@ -495,13 +506,13 @@ function_call_header_with_parameters: function_call_header assignment_expression { $$ = $1; - $$->set_location(yylloc); + $$->set_location(@1); $$->expressions.push_tail(& $2->link); } | function_call_header_with_parameters ',' assignment_expression { $$ = $1; - $$->set_location(yylloc); + $$->set_location(@1); $$->expressions.push_tail(& $3->link); } ; @@ -518,21 +529,23 @@ function_identifier: { void *ctx = state; $$ = new(ctx) ast_function_expression($1); - $$->set_location(yylloc); + $$->set_location(@1); } | variable_identifier { void *ctx = state; ast_expression *callee = new(ctx) ast_expression($1); + callee->set_location(@1); $$ = new(ctx) ast_function_expression(callee); - $$->set_location(yylloc); + $$->set_location(@1); } | FIELD_SELECTION { void *ctx = state; ast_expression *callee = new(ctx) ast_expression($1); + callee->set_location(@1); $$ = new(ctx) ast_function_expression(callee); - $$->set_location(yylloc); + $$->set_location(@1); } ; @@ -550,13 +563,13 @@ method_call_header_with_parameters: method_call_header assignment_expression { $$ = $1; - $$->set_location(yylloc); + $$->set_location(@1); $$->expressions.push_tail(& $2->link); } | method_call_header_with_parameters ',' assignment_expression { $$ = $1; - $$->set_location(yylloc); + $$->set_location(@1); $$->expressions.push_tail(& $3->link); } ; @@ -569,8 +582,9 @@ method_call_header: { void *ctx = state; ast_expression *callee = new(ctx) ast_expression($1); + callee->set_location(@1); $$ = new(ctx) ast_function_expression(callee); - $$->set_location(yylloc); + $$->set_location(@1); } ; @@ -581,19 +595,19 @@ unary_expression: { void *ctx = state; $$ = new(ctx) ast_expression(ast_pre_inc, $2, NULL, NULL); - $$->set_location(yylloc); + $$->set_location(@1); } | DEC_OP unary_expression { void *ctx = state; $$ = new(ctx) ast_expression(ast_pre_dec, $2, NULL, NULL); - $$->set_location(yylloc); + $$->set_location(@1); } | unary_operator unary_expression { void *ctx = state; $$ = new(ctx) ast_expression($1, $2, NULL, NULL); - $$->set_location(yylloc); + $$->set_location_range(@1, @2); } ; @@ -611,19 +625,19 @@ multiplicative_expression: { void *ctx = state; $$ = new(ctx) ast_expression_bin(ast_mul, $1, $3); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); } | multiplicative_expression '/' unary_expression { void *ctx = state; $$ = new(ctx) ast_expression_bin(ast_div, $1, $3); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); } | multiplicative_expression '%' unary_expression { void *ctx = state; $$ = new(ctx) ast_expression_bin(ast_mod, $1, $3); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); } ; @@ -633,13 +647,13 @@ additive_expression: { void *ctx = state; $$ = new(ctx) ast_expression_bin(ast_add, $1, $3); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); } | additive_expression '-' multiplicative_expression { void *ctx = state; $$ = new(ctx) ast_expression_bin(ast_sub, $1, $3); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); } ; @@ -649,13 +663,13 @@ shift_expression: { void *ctx = state; $$ = new(ctx) ast_expression_bin(ast_lshift, $1, $3); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); } | shift_expression RIGHT_OP additive_expression { void *ctx = state; $$ = new(ctx) ast_expression_bin(ast_rshift, $1, $3); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); } ; @@ -665,25 +679,25 @@ relational_expression: { void *ctx = state; $$ = new(ctx) ast_expression_bin(ast_less, $1, $3); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); } | relational_expression '>' shift_expression { void *ctx = state; $$ = new(ctx) ast_expression_bin(ast_greater, $1, $3); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); } | relational_expression LE_OP shift_expression { void *ctx = state; $$ = new(ctx) ast_expression_bin(ast_lequal, $1, $3); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); } | relational_expression GE_OP shift_expression { void *ctx = state; $$ = new(ctx) ast_expression_bin(ast_gequal, $1, $3); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); } ; @@ -693,13 +707,13 @@ equality_expression: { void *ctx = state; $$ = new(ctx) ast_expression_bin(ast_equal, $1, $3); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); } | equality_expression NE_OP relational_expression { void *ctx = state; $$ = new(ctx) ast_expression_bin(ast_nequal, $1, $3); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); } ; @@ -709,7 +723,7 @@ and_expression: { void *ctx = state; $$ = new(ctx) ast_expression_bin(ast_bit_and, $1, $3); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); } ; @@ -719,7 +733,7 @@ exclusive_or_expression: { void *ctx = state; $$ = new(ctx) ast_expression_bin(ast_bit_xor, $1, $3); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); } ; @@ -729,7 +743,7 @@ inclusive_or_expression: { void *ctx = state; $$ = new(ctx) ast_expression_bin(ast_bit_or, $1, $3); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); } ; @@ -739,7 +753,7 @@ logical_and_expression: { void *ctx = state; $$ = new(ctx) ast_expression_bin(ast_logic_and, $1, $3); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); } ; @@ -749,7 +763,7 @@ logical_xor_expression: { void *ctx = state; $$ = new(ctx) ast_expression_bin(ast_logic_xor, $1, $3); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); } ; @@ -759,7 +773,7 @@ logical_or_expression: { void *ctx = state; $$ = new(ctx) ast_expression_bin(ast_logic_or, $1, $3); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); } ; @@ -769,7 +783,7 @@ conditional_expression: { void *ctx = state; $$ = new(ctx) ast_expression(ast_conditional, $1, $3, $5); - $$->set_location(yylloc); + $$->set_location_range(@1, @5); } ; @@ -779,7 +793,7 @@ assignment_expression: { void *ctx = state; $$ = new(ctx) ast_expression($2, $1, $3, NULL); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); } ; @@ -807,7 +821,7 @@ expression: void *ctx = state; if ($1->oper != ast_sequence) { $$ = new(ctx) ast_expression(ast_sequence, NULL, NULL, NULL); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); $$->expressions.push_tail(& $1->link); } else { $$ = $1; @@ -869,7 +883,7 @@ function_header: { void *ctx = state; $$ = new(ctx) ast_function(); - $$->set_location(yylloc); + $$->set_location(@2); $$->return_type = $1; $$->identifier = $2; @@ -883,9 +897,9 @@ parameter_declarator: { void *ctx = state; $$ = new(ctx) ast_parameter_declarator(); - $$->set_location(yylloc); + $$->set_location_range(@1, @2); $$->type = new(ctx) ast_fully_specified_type(); - $$->type->set_location(yylloc); + $$->type->set_location(@1); $$->type->specifier = $1; $$->identifier = $2; } @@ -893,9 +907,9 @@ parameter_declarator: { void *ctx = state; $$ = new(ctx) ast_parameter_declarator(); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); $$->type = new(ctx) ast_fully_specified_type(); - $$->type->set_location(yylloc); + $$->type->set_location(@1); $$->type->specifier = $1; $$->identifier = $2; $$->array_specifier = $3; @@ -912,8 +926,9 @@ parameter_declaration: { void *ctx = state; $$ = new(ctx) ast_parameter_declarator(); - $$->set_location(yylloc); + $$->set_location(@2); $$->type = new(ctx) ast_fully_specified_type(); + $$->type->set_location_range(@1, @2); $$->type->qualifier = $1; $$->type->specifier = $2; } @@ -933,14 +948,22 @@ parameter_qualifier: $$ = $2; $$.flags.q.constant = 1; } + | PRECISE parameter_qualifier + { + if ($2.flags.q.precise) + _mesa_glsl_error(&@1, state, "duplicate precise qualifier"); + + $$ = $2; + $$.flags.q.precise = 1; + } | parameter_direction_qualifier parameter_qualifier { if (($1.flags.q.in || $1.flags.q.out) && ($2.flags.q.in || $2.flags.q.out)) _mesa_glsl_error(&@1, state, "duplicate in/out/inout qualifier"); if (!state->ARB_shading_language_420pack_enable && $2.flags.q.constant) - _mesa_glsl_error(&@1, state, "const must be specified before " - "in/out/inout"); + _mesa_glsl_error(&@1, state, "in/out/inout must come after const " + "or precise"); $$ = $1; $$.merge_qualifier(&@1, state, $2); @@ -990,7 +1013,7 @@ init_declarator_list: { void *ctx = state; ast_declaration *decl = new(ctx) ast_declaration($3, NULL, NULL); - decl->set_location(yylloc); + decl->set_location(@3); $$ = $1; $$->declarations.push_tail(&decl->link); @@ -1000,7 +1023,7 @@ init_declarator_list: { void *ctx = state; ast_declaration *decl = new(ctx) ast_declaration($3, $4, NULL); - decl->set_location(yylloc); + decl->set_location_range(@3, @4); $$ = $1; $$->declarations.push_tail(&decl->link); @@ -1010,7 +1033,7 @@ init_declarator_list: { void *ctx = state; ast_declaration *decl = new(ctx) ast_declaration($3, $4, $6); - decl->set_location(yylloc); + decl->set_location_range(@3, @4); $$ = $1; $$->declarations.push_tail(&decl->link); @@ -1020,7 +1043,7 @@ init_declarator_list: { void *ctx = state; ast_declaration *decl = new(ctx) ast_declaration($3, NULL, $5); - decl->set_location(yylloc); + decl->set_location(@3); $$ = $1; $$->declarations.push_tail(&decl->link); @@ -1035,55 +1058,72 @@ single_declaration: void *ctx = state; /* Empty declaration list is valid. */ $$ = new(ctx) ast_declarator_list($1); - $$->set_location(yylloc); + $$->set_location(@1); } | fully_specified_type any_identifier { void *ctx = state; ast_declaration *decl = new(ctx) ast_declaration($2, NULL, NULL); + decl->set_location(@2); $$ = new(ctx) ast_declarator_list($1); - $$->set_location(yylloc); + $$->set_location_range(@1, @2); $$->declarations.push_tail(&decl->link); } | fully_specified_type any_identifier array_specifier { void *ctx = state; ast_declaration *decl = new(ctx) ast_declaration($2, $3, NULL); + decl->set_location_range(@2, @3); $$ = new(ctx) ast_declarator_list($1); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); $$->declarations.push_tail(&decl->link); } | fully_specified_type any_identifier array_specifier '=' initializer { void *ctx = state; ast_declaration *decl = new(ctx) ast_declaration($2, $3, $5); + decl->set_location_range(@2, @3); $$ = new(ctx) ast_declarator_list($1); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); $$->declarations.push_tail(&decl->link); } | fully_specified_type any_identifier '=' initializer { void *ctx = state; ast_declaration *decl = new(ctx) ast_declaration($2, NULL, $4); + decl->set_location(@2); $$ = new(ctx) ast_declarator_list($1); - $$->set_location(yylloc); + $$->set_location_range(@1, @2); $$->declarations.push_tail(&decl->link); } - | INVARIANT variable_identifier // Vertex only. + | INVARIANT variable_identifier { void *ctx = state; ast_declaration *decl = new(ctx) ast_declaration($2, NULL, NULL); + decl->set_location(@2); $$ = new(ctx) ast_declarator_list(NULL); - $$->set_location(yylloc); + $$->set_location_range(@1, @2); $$->invariant = true; $$->declarations.push_tail(&decl->link); } + | PRECISE variable_identifier + { + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration($2, NULL, NULL); + decl->set_location(@2); + + $$ = new(ctx) ast_declarator_list(NULL); + $$->set_location_range(@1, @2); + $$->precise = true; + + $$->declarations.push_tail(&decl->link); + } ; fully_specified_type: @@ -1091,14 +1131,14 @@ fully_specified_type: { void *ctx = state; $$ = new(ctx) ast_fully_specified_type(); - $$->set_location(yylloc); + $$->set_location(@1); $$->specifier = $1; } | type_qualifier type_specifier { void *ctx = state; $$ = new(ctx) ast_fully_specified_type(); - $$->set_location(yylloc); + $$->set_location_range(@1, @2); $$->qualifier = $1; $$->specifier = $2; } @@ -1216,7 +1256,7 @@ layout_qualifier_id: /* Layout qualifiers for GLSL 1.50 geometry shaders. */ if (!$$.flags.i) { - struct { + static const struct { const char *s; GLenum e; } map[] = { @@ -1322,6 +1362,13 @@ layout_qualifier_id: if (match_layout_qualifier("location", $1, state) == 0) { $$.flags.q.explicit_location = 1; + if ($$.flags.q.attribute == 1 && + state->ARB_explicit_attrib_location_warn) { + _mesa_glsl_warning(& @1, state, + "GL_ARB_explicit_attrib_location layout " + "identifier `%s' used", $1); + } + if ($3 >= 0) { $$.location = $3; } else { @@ -1371,7 +1418,23 @@ layout_qualifier_id: } } - static const char *local_size_qualifiers[3] = { + if (state->stage == MESA_SHADER_GEOMETRY) { + if (match_layout_qualifier("stream", $1, state) == 0 && + state->check_explicit_attrib_stream_allowed(& @3)) { + $$.flags.q.stream = 1; + + if ($3 < 0) { + _mesa_glsl_error(& @3, state, + "invalid stream %d specified", $3); + YYERROR; + } else { + $$.flags.q.explicit_stream = 1; + $$.stream = $3; + } + } + } + + static const char * const local_size_qualifiers[3] = { "local_size_x", "local_size_y", "local_size_z", @@ -1399,6 +1462,29 @@ layout_qualifier_id: } } + if (match_layout_qualifier("invocations", $1, state) == 0) { + $$.flags.q.invocations = 1; + + if ($3 <= 0) { + _mesa_glsl_error(& @3, state, + "invalid invocations %d specified", $3); + YYERROR; + } else if ($3 > MAX_GEOMETRY_SHADER_INVOCATIONS) { + _mesa_glsl_error(& @3, state, + "invocations (%d) exceeds " + "GL_MAX_GEOMETRY_SHADER_INVOCATIONS", $3); + YYERROR; + } else { + $$.invocations = $3; + if (!state->is_version(400, 0) && + !state->ARB_gpu_shader5_enable) { + _mesa_glsl_error(& @3, state, + "GL_ARB_gpu_shader5 invocations " + "qualifier specified", $3); + } + } + } + /* If the identifier didn't match any known layout identifiers, * emit an error. */ @@ -1406,10 +1492,6 @@ layout_qualifier_id: _mesa_glsl_error(& @1, state, "unrecognized layout identifier " "`%s'", $1); YYERROR; - } else if (state->ARB_explicit_attrib_location_warn) { - _mesa_glsl_warning(& @1, state, - "GL_ARB_explicit_attrib_location layout " - "identifier `%s' used", $1); } } | interface_block_layout_qualifier @@ -1481,6 +1563,11 @@ type_qualifier: $$.precision = ast_precision_none; $$.flags.q.invariant = 1; } + | PRECISE + { + memset(& $$, 0, sizeof($$)); + $$.flags.q.precise = 1; + } | auxiliary_storage_qualifier | storage_qualifier | interpolation_qualifier @@ -1502,17 +1589,24 @@ type_qualifier: * Each qualifier's rule ensures that the accumulated qualifiers on the right * side don't contain any that must appear on the left hand side. * For example, when processing a storage qualifier, we check that there are - * no auxiliary, interpolation, layout, or invariant qualifiers to the right. + * no auxiliary, interpolation, layout, invariant, or precise qualifiers to the right. */ + | PRECISE type_qualifier + { + if ($2.flags.q.precise) + _mesa_glsl_error(&@1, state, "duplicate \"precise\" qualifier"); + + $$ = $2; + $$.flags.q.precise = 1; + } | INVARIANT type_qualifier { if ($2.flags.q.invariant) _mesa_glsl_error(&@1, state, "duplicate \"invariant\" qualifier"); - if ($2.has_layout()) { + if (!state->ARB_shading_language_420pack_enable && $2.flags.q.precise) _mesa_glsl_error(&@1, state, - "\"invariant\" cannot be used with layout(...)"); - } + "\"invariant\" must come after \"precise\""); $$ = $2; $$.flags.q.invariant = 1; @@ -1532,14 +1626,10 @@ type_qualifier: if ($2.has_interpolation()) _mesa_glsl_error(&@1, state, "duplicate interpolation qualifier"); - if ($2.has_layout()) { - _mesa_glsl_error(&@1, state, "interpolation qualifiers cannot be used " - "with layout(...)"); - } - - if (!state->ARB_shading_language_420pack_enable && $2.flags.q.invariant) { + if (!state->ARB_shading_language_420pack_enable && + ($2.flags.q.precise || $2.flags.q.invariant)) { _mesa_glsl_error(&@1, state, "interpolation qualifiers must come " - "after \"invariant\""); + "after \"precise\" or \"invariant\""); } $$ = $1; @@ -1547,24 +1637,18 @@ type_qualifier: } | layout_qualifier type_qualifier { - /* The GLSL 1.50 grammar indicates that a layout(...) declaration can be - * used standalone or immediately before a storage qualifier. It cannot - * be used with interpolation qualifiers or invariant. There does not - * appear to be any text indicating that it must come before the storage - * qualifier, but always seems to in examples. + /* In the absence of ARB_shading_language_420pack, layout qualifiers may + * appear no later than auxiliary storage qualifiers. There is no + * particularly clear spec language mandating this, but in all examples + * the layout qualifier precedes the storage qualifier. + * + * We allow combinations of layout with interpolation, invariant or + * precise qualifiers since these are useful in ARB_separate_shader_objects. + * There is no clear spec guidance on this either. */ if (!state->ARB_shading_language_420pack_enable && $2.has_layout()) _mesa_glsl_error(&@1, state, "duplicate layout(...) qualifiers"); - if ($2.flags.q.invariant) - _mesa_glsl_error(&@1, state, "layout(...) cannot be used with " - "the \"invariant\" qualifier"); - - if ($2.has_interpolation()) { - _mesa_glsl_error(&@1, state, "layout(...) cannot be used with " - "interpolation qualifiers"); - } - $$ = $1; $$.merge_qualifier(&@1, state, $2); } @@ -1576,7 +1660,8 @@ type_qualifier: } if (!state->ARB_shading_language_420pack_enable && - ($2.flags.q.invariant || $2.has_interpolation() || $2.has_layout())) { + ($2.flags.q.precise || $2.flags.q.invariant || + $2.has_interpolation() || $2.has_layout())) { _mesa_glsl_error(&@1, state, "auxiliary storage qualifiers must come " "just before storage qualifiers"); } @@ -1593,10 +1678,10 @@ type_qualifier: _mesa_glsl_error(&@1, state, "duplicate storage qualifier"); if (!state->ARB_shading_language_420pack_enable && - ($2.flags.q.invariant || $2.has_interpolation() || $2.has_layout() || - $2.has_auxiliary_storage())) { + ($2.flags.q.precise || $2.flags.q.invariant || $2.has_interpolation() || + $2.has_layout() || $2.has_auxiliary_storage())) { _mesa_glsl_error(&@1, state, "storage qualifiers must come after " - "invariant, interpolation, layout and auxiliary " + "precise, invariant, interpolation, layout and auxiliary " "storage qualifiers"); } @@ -1661,6 +1746,27 @@ storage_qualifier: $$.precision = ast_precision_none; $$.flags.q.out = 1; } + | INOUT_TOK + { + memset(& $$, 0, sizeof($$)); + $$.precision = ast_precision_none; + $$.flags.q.in = 1; + $$.flags.q.out = 1; + + if (state->stage == MESA_SHADER_GEOMETRY && + state->has_explicit_attrib_stream()) { + /* Section 4.3.8.2 (Output Layout Qualifiers) of the GLSL 4.00 + * spec says: + * + * "If the block or variable is declared with the stream + * identifier, it is associated with the specified stream; + * otherwise, it is associated with the current default stream." + */ + $$.flags.q.stream = 1; + $$.flags.q.explicit_stream = 0; + $$.stream = state->out_qualifier->stream; + } + } | UNIFORM { memset(& $$, 0, sizeof($$)); @@ -1699,12 +1805,14 @@ array_specifier: '[' ']' { void *ctx = state; - $$ = new(ctx) ast_array_specifier(yylloc); + $$ = new(ctx) ast_array_specifier(@1); + $$->set_location_range(@1, @2); } | '[' constant_expression ']' { void *ctx = state; - $$ = new(ctx) ast_array_specifier(yylloc, $2); + $$ = new(ctx) ast_array_specifier(@1, $2); + $$->set_location_range(@1, @3); } | array_specifier '[' ']' { @@ -1748,19 +1856,19 @@ type_specifier_nonarray: { void *ctx = state; $$ = new(ctx) ast_type_specifier($1); - $$->set_location(yylloc); + $$->set_location(@1); } | struct_specifier { void *ctx = state; $$ = new(ctx) ast_type_specifier($1); - $$->set_location(yylloc); + $$->set_location(@1); } | TYPE_IDENTIFIER { void *ctx = state; $$ = new(ctx) ast_type_specifier($1); - $$->set_location(yylloc); + $$->set_location(@1); } ; @@ -1891,15 +1999,14 @@ struct_specifier: { void *ctx = state; $$ = new(ctx) ast_struct_specifier($2, $4); - $$->set_location(yylloc); + $$->set_location_range(@2, @5); state->symbols->add_type($2, glsl_type::void_type); - state->symbols->add_type_ast($2, new(ctx) ast_type_specifier($$)); } | STRUCT '{' struct_declaration_list '}' { void *ctx = state; $$ = new(ctx) ast_struct_specifier(NULL, $3); - $$->set_location(yylloc); + $$->set_location_range(@2, @4); } ; @@ -1921,7 +2028,7 @@ struct_declaration: { void *ctx = state; ast_fully_specified_type *const type = $1; - type->set_location(yylloc); + type->set_location(@1); if (type->qualifier.flags.i != 0) _mesa_glsl_error(&@1, state, @@ -1929,7 +2036,7 @@ struct_declaration: "structure members"); $$ = new(ctx) ast_declarator_list(type); - $$->set_location(yylloc); + $$->set_location(@2); $$->declarations.push_degenerate_list_at_head(& $2->link); } @@ -1953,13 +2060,13 @@ struct_declarator: { void *ctx = state; $$ = new(ctx) ast_declaration($1, NULL, NULL); - $$->set_location(yylloc); + $$->set_location(@1); } | any_identifier array_specifier { void *ctx = state; $$ = new(ctx) ast_declaration($1, $2, NULL); - $$->set_location(yylloc); + $$->set_location_range(@1, @2); } ; @@ -1980,7 +2087,7 @@ initializer_list: { void *ctx = state; $$ = new(ctx) ast_aggregate_initializer(); - $$->set_location(yylloc); + $$->set_location(@1); $$->expressions.push_tail(& $1->link); } | initializer_list ',' initializer @@ -2014,7 +2121,7 @@ compound_statement: { void *ctx = state; $$ = new(ctx) ast_compound_statement(true, NULL); - $$->set_location(yylloc); + $$->set_location_range(@1, @2); } | '{' { @@ -2024,7 +2131,7 @@ compound_statement: { void *ctx = state; $$ = new(ctx) ast_compound_statement(true, $3); - $$->set_location(yylloc); + $$->set_location_range(@1, @4); state->symbols->pop_scope(); } ; @@ -2039,13 +2146,13 @@ compound_statement_no_new_scope: { void *ctx = state; $$ = new(ctx) ast_compound_statement(false, NULL); - $$->set_location(yylloc); + $$->set_location_range(@1, @2); } | '{' statement_list '}' { void *ctx = state; $$ = new(ctx) ast_compound_statement(false, $2); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); } ; @@ -2076,13 +2183,13 @@ expression_statement: { void *ctx = state; $$ = new(ctx) ast_expression_statement(NULL); - $$->set_location(yylloc); + $$->set_location(@1); } | expression ';' { void *ctx = state; $$ = new(ctx) ast_expression_statement($1); - $$->set_location(yylloc); + $$->set_location(@1); } ; @@ -2091,7 +2198,7 @@ selection_statement: { $$ = new(state) ast_selection_statement($3, $5.then_statement, $5.else_statement); - $$->set_location(yylloc); + $$->set_location_range(@1, @5); } ; @@ -2118,8 +2225,8 @@ condition: void *ctx = state; ast_declaration *decl = new(ctx) ast_declaration($2, NULL, $4); ast_declarator_list *declarator = new(ctx) ast_declarator_list($1); - decl->set_location(yylloc); - declarator->set_location(yylloc); + decl->set_location_range(@2, @4); + declarator->set_location(@1); declarator->declarations.push_tail(&decl->link); $$ = declarator; @@ -2127,14 +2234,14 @@ condition: ; /* - * siwtch_statement grammar is based on the syntax described in the body + * switch_statement grammar is based on the syntax described in the body * of the GLSL spec, not in it's appendix!!! */ switch_statement: SWITCH '(' expression ')' switch_body { $$ = new(state) ast_switch_statement($3, $5); - $$->set_location(yylloc); + $$->set_location_range(@1, @5); } ; @@ -2142,12 +2249,12 @@ switch_body: '{' '}' { $$ = new(state) ast_switch_body(NULL); - $$->set_location(yylloc); + $$->set_location_range(@1, @2); } | '{' case_statement_list '}' { $$ = new(state) ast_switch_body($2); - $$->set_location(yylloc); + $$->set_location_range(@1, @3); } ; @@ -2155,12 +2262,12 @@ case_label: CASE expression ':' { $$ = new(state) ast_case_label($2); - $$->set_location(yylloc); + $$->set_location(@2); } | DEFAULT ':' { $$ = new(state) ast_case_label(NULL); - $$->set_location(yylloc); + $$->set_location(@2); } ; @@ -2171,7 +2278,7 @@ case_label_list: labels->labels.push_tail(& $1->link); $$ = labels; - $$->set_location(yylloc); + $$->set_location(@1); } | case_label_list case_label { @@ -2184,7 +2291,7 @@ case_statement: case_label_list statement { ast_case_statement *stmts = new(state) ast_case_statement($1); - stmts->set_location(yylloc); + stmts->set_location(@2); stmts->stmts.push_tail(& $2->link); $$ = stmts; @@ -2200,7 +2307,7 @@ case_statement_list: case_statement { ast_case_statement_list *cases= new(state) ast_case_statement_list(); - cases->set_location(yylloc); + cases->set_location(@1); cases->cases.push_tail(& $1->link); $$ = cases; @@ -2218,21 +2325,21 @@ iteration_statement: void *ctx = state; $$ = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_while, NULL, $3, NULL, $5); - $$->set_location(yylloc); + $$->set_location_range(@1, @4); } | DO statement WHILE '(' expression ')' ';' { void *ctx = state; $$ = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_do_while, NULL, $5, NULL, $2); - $$->set_location(yylloc); + $$->set_location_range(@1, @6); } | FOR '(' for_init_statement for_rest_statement ')' statement_no_new_scope { void *ctx = state; $$ = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_for, $3, $4.cond, $4.rest, $6); - $$->set_location(yylloc); + $$->set_location_range(@1, @6); } ; @@ -2268,31 +2375,31 @@ jump_statement: { void *ctx = state; $$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_continue, NULL); - $$->set_location(yylloc); + $$->set_location(@1); } | BREAK ';' { void *ctx = state; $$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_break, NULL); - $$->set_location(yylloc); + $$->set_location(@1); } | RETURN ';' { void *ctx = state; $$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, NULL); - $$->set_location(yylloc); + $$->set_location(@1); } | RETURN expression ';' { void *ctx = state; $$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, $2); - $$->set_location(yylloc); + $$->set_location_range(@1, @2); } | DISCARD ';' // Fragment shader only. { void *ctx = state; $$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_discard, NULL); - $$->set_location(yylloc); + $$->set_location(@1); } ; @@ -2308,7 +2415,7 @@ function_definition: { void *ctx = state; $$ = new(ctx) ast_function_definition(); - $$->set_location(yylloc); + $$->set_location_range(@1, @2); $$->prototype = $1; $$->body = $2; @@ -2328,6 +2435,18 @@ interface_block: if (!block->layout.merge_qualifier(& @1, state, $1)) { YYERROR; } + + foreach_list_typed (ast_declarator_list, member, link, &block->declarations) { + ast_type_qualifier& qualifier = member->type->qualifier; + if (qualifier.flags.q.stream && qualifier.stream != block->layout.stream) { + _mesa_glsl_error(& @1, state, + "stream layout qualifier on " + "interface block member does not match " + "the interface block (%d vs %d)", + qualifier.stream, block->layout.stream); + YYERROR; + } + } $$ = block; } ; @@ -2401,6 +2520,14 @@ basic_interface_block: block->layout.flags.i |= block_interface_qualifier; + if (state->stage == MESA_SHADER_GEOMETRY && + state->has_explicit_attrib_stream()) { + /* Assign global layout's stream value. */ + block->layout.flags.q.stream = 1; + block->layout.flags.q.explicit_stream = 0; + block->layout.stream = state->out_qualifier->stream; + } + foreach_list_typed (ast_declarator_list, member, link, &block->declarations) { ast_type_qualifier& qualifier = member->type->qualifier; if ((qualifier.flags.i & interface_type_mask) == 0) { @@ -2460,11 +2587,13 @@ instance_name_opt: { $$ = new(state) ast_interface_block(*state->default_uniform_qualifier, $1, NULL); + $$->set_location(@1); } | NEW_IDENTIFIER array_specifier { $$ = new(state) ast_interface_block(*state->default_uniform_qualifier, $1, $2); + $$->set_location_range(@1, @2); } ; @@ -2486,7 +2615,7 @@ member_declaration: { void *ctx = state; ast_fully_specified_type *type = $1; - type->set_location(yylloc); + type->set_location(@1); if (type->qualifier.flags.q.attribute) { _mesa_glsl_error(& @1, state, @@ -2499,7 +2628,7 @@ member_declaration: } $$ = new(ctx) ast_declarator_list(type); - $$->set_location(yylloc); + $$->set_location(@2); $$->declarations.push_degenerate_list_at_head(& $2->link); } @@ -2516,62 +2645,9 @@ layout_defaults: | layout_qualifier IN_TOK ';' { - void *ctx = state; $$ = NULL; - switch (state->stage) { - case MESA_SHADER_GEOMETRY: { - if (!$1.flags.q.prim_type) { - _mesa_glsl_error(& @1, state, - "input layout qualifiers must specify a primitive" - " type"); - } else { - /* Make sure this is a valid input primitive type. */ - switch ($1.prim_type) { - case GL_POINTS: - case GL_LINES: - case GL_LINES_ADJACENCY: - case GL_TRIANGLES: - case GL_TRIANGLES_ADJACENCY: - $$ = new(ctx) ast_gs_input_layout(@1, $1.prim_type); - break; - default: - _mesa_glsl_error(&@1, state, - "invalid geometry shader input primitive type"); - break; - } - } - } - break; - case MESA_SHADER_FRAGMENT: - if ($1.flags.q.early_fragment_tests) { - state->early_fragment_tests = true; - } else { - _mesa_glsl_error(& @1, state, "invalid input layout qualifier"); - } - break; - case MESA_SHADER_COMPUTE: { - if ($1.flags.q.local_size == 0) { - _mesa_glsl_error(& @1, state, - "input layout qualifiers must specify a local " - "size"); - } else { - /* Infer a local_size of 1 for every unspecified dimension */ - unsigned local_size[3]; - for (int i = 0; i < 3; i++) { - if ($1.flags.q.local_size & (1 << i)) - local_size[i] = $1.local_size[i]; - else - local_size[i] = 1; - } - $$ = new(ctx) ast_cs_input_layout(@1, local_size); - } - } - break; - default: - _mesa_glsl_error(& @1, state, - "input layout qualifiers only valid in " - "geometry, fragment and compute shaders"); - break; + if (!state->in_qualifier->merge_in_qualifier(& @1, state, $1, $$)) { + YYERROR; } } @@ -2597,6 +2673,9 @@ layout_defaults: } if (!state->out_qualifier->merge_qualifier(& @1, state, $1)) YYERROR; + + /* Allow future assigments of global out's stream id value */ + state->out_qualifier->flags.q.explicit_stream = 0; } $$ = NULL; } diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.cpp b/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.cpp index 2b5c4474a..58f0ba475 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.cpp @@ -30,7 +30,7 @@ extern "C" { #include "main/context.h" } -#include "ralloc.h" +#include "util/ralloc.h" #include "ast.h" #include "glsl_parser_extras.h" #include "glsl_parser.h" @@ -49,7 +49,7 @@ glsl_compute_version_string(void *mem_ctx, bool is_es, unsigned version) } -static unsigned known_desktop_glsl_versions[] = +static const unsigned known_desktop_glsl_versions[] = { 110, 120, 130, 140, 150, 330, 400, 410, 420, 430, 440 }; @@ -66,10 +66,6 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx, this->translation_unit.make_empty(); this->symbols = new(mem_ctx) glsl_symbol_table; - this->num_uniform_blocks = 0; - this->uniform_block_array_size = 0; - this->uniform_blocks = NULL; - this->info_log = ralloc_strdup(mem_ctx, ""); this->error = false; this->loop_nesting_ast = NULL; @@ -82,6 +78,7 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx, this->language_version = ctx->Const.ForceGLSLVersion ? ctx->Const.ForceGLSLVersion : 110; this->es_shader = false; + this->metal_target = false; this->had_version_string = false; this->had_float_precision = false; this->ARB_texture_rectangle_enable = true; @@ -203,13 +200,21 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx, this->default_uniform_qualifier->flags.q.shared = 1; this->default_uniform_qualifier->flags.q.column_major = 1; + this->fs_uses_gl_fragcoord = false; + this->fs_redeclares_gl_fragcoord = false; + this->fs_origin_upper_left = false; + this->fs_pixel_center_integer = false; + this->fs_redeclares_gl_fragcoord_with_no_layout_qualifiers = false; + this->gs_input_prim_type_specified = false; - this->gs_input_prim_type = GL_POINTS; this->gs_input_size = 0; + this->in_qualifier = new(this) ast_type_qualifier(); this->out_qualifier = new(this) ast_type_qualifier(); this->early_fragment_tests = false; memset(this->atomic_counter_offsets, 0, sizeof(this->atomic_counter_offsets)); + this->allow_extension_directive_midshader = + ctx->Const.AllowGLSLExtensionDirectiveMidShader; } /** @@ -386,8 +391,9 @@ _mesa_glsl_msg(const YYLTYPE *locp, _mesa_glsl_parse_state *state, /* Get the offset that the new message will be written to. */ int msg_offset = strlen(state->info_log); - ralloc_asprintf_append(&state->info_log, "%u:%u(%u): %s: ", - locp->source, + // format: + // (line,col): type: message + ralloc_asprintf_append(&state->info_log, "(%u,%u): %s: ", locp->first_line, locp->first_column, error ? "error" : "warning"); @@ -507,42 +513,62 @@ struct _mesa_glsl_extension { static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = { /* API availability */ /* name GL ES supported flag */ + + /* ARB extensions go here, sorted alphabetically. + */ EXT(ARB_arrays_of_arrays, true, false, ARB_arrays_of_arrays), + EXT(ARB_compute_shader, true, false, ARB_compute_shader), EXT(ARB_conservative_depth, true, false, ARB_conservative_depth), + EXT(ARB_derivative_control, true, false, ARB_derivative_control), EXT(ARB_draw_buffers, true, false, dummy_true), EXT(ARB_draw_instanced, true, false, ARB_draw_instanced), EXT(ARB_explicit_attrib_location, true, false, ARB_explicit_attrib_location), + EXT(ARB_explicit_uniform_location, true, false, ARB_explicit_uniform_location), EXT(ARB_fragment_coord_conventions, true, false, ARB_fragment_coord_conventions), - EXT(ARB_texture_rectangle, true, false, dummy_true), - EXT(EXT_texture_array, true, false, EXT_texture_array), - EXT(ARB_shader_texture_lod, true, false, ARB_shader_texture_lod), - EXT(EXT_shader_texture_lod, false, true, ARB_shader_texture_lod), - EXT(ARB_shader_stencil_export, true, false, ARB_shader_stencil_export), - EXT(AMD_conservative_depth, true, false, ARB_conservative_depth), - EXT(AMD_shader_stencil_export, true, false, ARB_shader_stencil_export), - EXT(OES_texture_3D, false, true, EXT_texture3D), - EXT(OES_EGL_image_external, false, true, OES_EGL_image_external), + EXT(ARB_fragment_layer_viewport, true, false, ARB_fragment_layer_viewport), + EXT(ARB_gpu_shader5, true, false, ARB_gpu_shader5), + EXT(ARB_sample_shading, true, false, ARB_sample_shading), + EXT(ARB_separate_shader_objects, true, false, dummy_true), + EXT(ARB_shader_atomic_counters, true, false, ARB_shader_atomic_counters), EXT(ARB_shader_bit_encoding, true, false, ARB_shader_bit_encoding), - EXT(ARB_uniform_buffer_object, true, false, ARB_uniform_buffer_object), - EXT(OES_standard_derivatives, false, true, OES_standard_derivatives), - EXT(EXT_shadow_samplers, false, true, EXT_shadow_samplers), - EXT(EXT_frag_depth, false, true, EXT_frag_depth), - EXT(ARB_texture_cube_map_array, true, false, ARB_texture_cube_map_array), - EXT(ARB_shading_language_packing, true, false, ARB_shading_language_packing), + EXT(ARB_shader_image_load_store, true, false, ARB_shader_image_load_store), + EXT(ARB_shader_stencil_export, true, false, ARB_shader_stencil_export), + EXT(ARB_shader_texture_lod, true, false, ARB_shader_texture_lod), EXT(ARB_shading_language_420pack, true, false, ARB_shading_language_420pack), + EXT(ARB_shading_language_packing, true, false, ARB_shading_language_packing), + EXT(ARB_texture_cube_map_array, true, false, ARB_texture_cube_map_array), + EXT(ARB_texture_gather, true, false, ARB_texture_gather), EXT(ARB_texture_multisample, true, false, ARB_texture_multisample), EXT(ARB_texture_query_levels, true, false, ARB_texture_query_levels), EXT(ARB_texture_query_lod, true, false, ARB_texture_query_lod), - EXT(ARB_gpu_shader5, true, false, ARB_gpu_shader5), - EXT(AMD_vertex_shader_layer, true, false, AMD_vertex_shader_layer), - EXT(EXT_shader_integer_mix, true, true, EXT_shader_integer_mix), - EXT(ARB_texture_gather, true, false, ARB_texture_gather), - EXT(ARB_shader_atomic_counters, true, false, ARB_shader_atomic_counters), - EXT(ARB_sample_shading, true, false, ARB_sample_shading), - EXT(AMD_shader_trinary_minmax, true, false, dummy_true), + EXT(ARB_texture_rectangle, true, false, dummy_true), + EXT(ARB_uniform_buffer_object, true, false, ARB_uniform_buffer_object), EXT(ARB_viewport_array, true, false, ARB_viewport_array), - EXT(ARB_compute_shader, true, false, ARB_compute_shader), - EXT(ARB_shader_image_load_store, true, false, ARB_shader_image_load_store), + + /* KHR extensions go here, sorted alphabetically. + */ + + /* OES extensions go here, sorted alphabetically. + */ + EXT(OES_EGL_image_external, false, true, OES_EGL_image_external), + EXT(OES_standard_derivatives, false, true, OES_standard_derivatives), + EXT(OES_texture_3D, false, true, EXT_texture3D), + + /* All other extensions go here, sorted alphabetically. + */ + EXT(AMD_conservative_depth, true, false, ARB_conservative_depth), + EXT(AMD_shader_stencil_export, true, false, ARB_shader_stencil_export), + EXT(AMD_shader_trinary_minmax, true, false, dummy_true), + EXT(AMD_vertex_shader_layer, true, false, AMD_vertex_shader_layer), + EXT(AMD_vertex_shader_viewport_index, true, false, AMD_vertex_shader_viewport_index), + EXT(EXT_draw_buffers, false, true, EXT_draw_buffers), + EXT(EXT_frag_depth, false, true, EXT_frag_depth), + EXT(EXT_separate_shader_objects, false, true, dummy_true), + EXT(EXT_shader_framebuffer_fetch, false, true, EXT_shader_framebuffer_fetch), + EXT(EXT_shader_integer_mix, true, true, EXT_shader_integer_mix), + EXT(EXT_shader_texture_lod, false, true, ARB_shader_texture_lod), + EXT(EXT_shadow_samplers, false, true, EXT_shadow_samplers), + EXT(EXT_texture_array, true, false, EXT_texture_array), }; #undef EXT @@ -646,7 +672,7 @@ _mesa_glsl_process_extension(const char *name, YYLTYPE *name_locp, if (extension && extension->compatible_with_state(state)) { extension->set_flags(state, behavior); } else { - static const char *const fmt = "extension `%s' unsupported in %s shader"; + static const char fmt[] = "extension `%s' unsupported in %s shader"; if (behavior == extension_require) { _mesa_glsl_error(name_locp, state, fmt, @@ -812,8 +838,10 @@ ast_node::print(void) const ast_node::ast_node(void) { this->location.source = 0; - this->location.line = 0; - this->location.column = 0; + this->location.first_line = 0; + this->location.first_column = 0; + this->location.last_line = 0; + this->location.last_column = 0; } @@ -830,8 +858,7 @@ ast_compound_statement::print(void) const { printf("{\n"); - foreach_list_const(n, &this->statements) { - ast_node *ast = exec_node_data(ast_node, n, link); + foreach_list_typed(ast_node, ast, link, &this->statements) { ast->print(); } @@ -910,11 +937,10 @@ ast_expression::print(void) const subexpressions[0]->print(); printf("( "); - foreach_list_const (n, &this->expressions) { - if (n != this->expressions.get_head()) + foreach_list_typed (ast_node, ast, link, &this->expressions) { + if (&ast->link != this->expressions.get_head()) printf(", "); - ast_node *ast = exec_node_data(ast_node, n, link); ast->print(); } @@ -946,11 +972,10 @@ ast_expression::print(void) const case ast_sequence: { printf("( "); - foreach_list_const(n, & this->expressions) { - if (n != this->expressions.get_head()) + foreach_list_typed (ast_node, ast, link, & this->expressions) { + if (&ast->link != this->expressions.get_head()) printf(", "); - ast_node *ast = exec_node_data(ast_node, n, link); ast->print(); } printf(") "); @@ -959,11 +984,10 @@ ast_expression::print(void) const case ast_aggregate: { printf("{ "); - foreach_list_const(n, & this->expressions) { - if (n != this->expressions.get_head()) + foreach_list_typed (ast_node, ast, link, & this->expressions) { + if (&ast->link != this->expressions.get_head()) printf(", "); - ast_node *ast = exec_node_data(ast_node, n, link); ast->print(); } printf("} "); @@ -1013,8 +1037,7 @@ ast_function::print(void) const return_type->print(); printf(" %s (", identifier); - foreach_list_const(n, & this->parameters) { - ast_node *ast = exec_node_data(ast_node, n, link); + foreach_list_typed(ast_node, ast, link, & this->parameters) { ast->print(); } @@ -1086,14 +1109,15 @@ ast_declarator_list::print(void) const if (type) type->print(); - else + else if (invariant) printf("invariant "); + else + printf("precise "); - foreach_list_const (ptr, & this->declarations) { - if (ptr != this->declarations.get_head()) + foreach_list_typed (ast_node, ast, link, & this->declarations) { + if (&ast->link != this->declarations.get_head()) printf(", "); - ast_node *ast = exec_node_data(ast_node, ptr, link); ast->print(); } @@ -1105,6 +1129,7 @@ ast_declarator_list::ast_declarator_list(ast_fully_specified_type *type) { this->type = type; this->invariant = false; + this->precise = false; } void @@ -1224,8 +1249,7 @@ ast_case_label::ast_case_label(ast_expression *test_value) void ast_case_label_list::print(void) const { - foreach_list_const(n, & this->labels) { - ast_node *ast = exec_node_data(ast_node, n, link); + foreach_list_typed(ast_node, ast, link, & this->labels) { ast->print(); } printf("\n"); @@ -1240,8 +1264,7 @@ ast_case_label_list::ast_case_label_list(void) void ast_case_statement::print(void) const { labels->print(); - foreach_list_const(n, & this->stmts) { - ast_node *ast = exec_node_data(ast_node, n, link); + foreach_list_typed(ast_node, ast, link, & this->stmts) { ast->print(); printf("\n"); } @@ -1256,8 +1279,7 @@ ast_case_statement::ast_case_statement(ast_case_label_list *labels) void ast_case_statement_list::print(void) const { - foreach_list_const(n, & this->cases) { - ast_node *ast = exec_node_data(ast_node, n, link); + foreach_list_typed(ast_node, ast, link, & this->cases) { ast->print(); } } @@ -1327,8 +1349,7 @@ void ast_struct_specifier::print(void) const { printf("struct %s { ", name); - foreach_list_const(n, &this->declarations) { - ast_node *ast = exec_node_data(ast_node, n, link); + foreach_list_typed(ast_node, ast, link, &this->declarations) { ast->print(); } printf("} "); @@ -1354,7 +1375,7 @@ set_shader_inout_layout(struct gl_shader *shader, { if (shader->Stage != MESA_SHADER_GEOMETRY) { /* Should have been prevented by the parser. */ - assert(!state->gs_input_prim_type_specified); + assert(!state->in_qualifier->flags.i); assert(!state->out_qualifier->flags.i); } @@ -1363,6 +1384,14 @@ set_shader_inout_layout(struct gl_shader *shader, assert(!state->cs_input_local_size_specified); } + if (shader->Stage != MESA_SHADER_FRAGMENT) { + /* Should have been prevented by the parser. */ + assert(!state->fs_uses_gl_fragcoord); + assert(!state->fs_redeclares_gl_fragcoord); + assert(!state->fs_pixel_center_integer); + assert(!state->fs_origin_upper_left); + } + switch (shader->Stage) { case MESA_SHADER_GEOMETRY: shader->Geom.VerticesOut = 0; @@ -1370,7 +1399,7 @@ set_shader_inout_layout(struct gl_shader *shader, shader->Geom.VerticesOut = state->out_qualifier->max_vertices; if (state->gs_input_prim_type_specified) { - shader->Geom.InputType = state->gs_input_prim_type; + shader->Geom.InputType = state->in_qualifier->prim_type; } else { shader->Geom.InputType = PRIM_UNKNOWN; } @@ -1380,6 +1409,10 @@ set_shader_inout_layout(struct gl_shader *shader, } else { shader->Geom.OutputType = PRIM_UNKNOWN; } + + shader->Geom.Invocations = 0; + if (state->in_qualifier->flags.q.invocations) + shader->Geom.Invocations = state->in_qualifier->invocations; break; case MESA_SHADER_COMPUTE: @@ -1392,6 +1425,15 @@ set_shader_inout_layout(struct gl_shader *shader, } break; + case MESA_SHADER_FRAGMENT: + shader->redeclares_gl_fragcoord = state->fs_redeclares_gl_fragcoord; + shader->uses_gl_fragcoord = state->fs_uses_gl_fragcoord; + shader->pixel_center_integer = state->fs_pixel_center_integer; + shader->origin_upper_left = state->fs_origin_upper_left; + shader->ARB_fragment_coord_conventions_enable = + state->ARB_fragment_coord_conventions_enable; + break; + default: /* Nothing to do. */ break; @@ -1408,6 +1450,9 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader, new(shader) _mesa_glsl_parse_state(ctx, shader->Stage, shader); const char *source = shader->Source; + if (ctx->Const.GenerateTemporaryNames) + ir_variable::temporaries_allocate_names = true; + state->error = !!glcpp_preprocess(state, &source, &state->info_log, &ctx->Extensions, ctx); @@ -1418,8 +1463,7 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader, } if (dump_ast) { - foreach_list_const(n, &state->translation_unit) { - ast_node *ast = exec_node_data(ast_node, n, link); + foreach_list_typed(ast_node, ast, link, &state->translation_unit) { ast->print(); } printf("\n\n"); @@ -1435,46 +1479,89 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader, /* Print out the unoptimized IR. */ if (dump_hir) { - _mesa_print_ir(shader->ir, state); + _mesa_print_ir(stdout, shader->ir, state); } } if (!state->error && !shader->ir->is_empty()) { struct gl_shader_compiler_options *options = - &ctx->ShaderCompilerOptions[shader->Stage]; + &ctx->Const.ShaderCompilerOptions[shader->Stage]; /* Do some optimization at compile time to reduce shader IR size * and reduce later work if the same shader is linked multiple times */ - while (do_common_optimization(shader->ir, false, false, 32, options)) + while (do_common_optimization(shader->ir, false, false, options, + ctx->Const.NativeIntegers)) ; validate_ir_tree(shader->ir); + + enum ir_variable_mode other; + switch (shader->Stage) { + case MESA_SHADER_VERTEX: + other = ir_var_shader_in; + break; + case MESA_SHADER_FRAGMENT: + other = ir_var_shader_out; + break; + default: + /* Something invalid to ensure optimize_dead_builtin_uniforms + * doesn't remove anything other than uniforms or constants. + */ + other = ir_var_mode_count; + break; + } + + optimize_dead_builtin_variables(shader->ir, other); + + validate_ir_tree(shader->ir); } if (shader->InfoLog) ralloc_free(shader->InfoLog); - shader->symbols = state->symbols; + shader->symbols = new(shader->ir) glsl_symbol_table; shader->CompileStatus = !state->error; shader->InfoLog = state->info_log; shader->Version = state->language_version; shader->IsES = state->es_shader; shader->uses_builtin_functions = state->uses_builtin_functions; - if (shader->UniformBlocks) - ralloc_free(shader->UniformBlocks); - shader->NumUniformBlocks = state->num_uniform_blocks; - shader->UniformBlocks = state->uniform_blocks; - ralloc_steal(shader, shader->UniformBlocks); - if (!state->error) set_shader_inout_layout(shader, state); /* Retain any live IR, but trash the rest. */ reparent_ir(shader->ir, shader->ir); + /* Destroy the symbol table. Create a new symbol table that contains only + * the variables and functions that still exist in the IR. The symbol + * table will be used later during linking. + * + * There must NOT be any freed objects still referenced by the symbol + * table. That could cause the linker to dereference freed memory. + * + * We don't have to worry about types or interface-types here because those + * are fly-weights that are looked up by glsl_type. + */ + foreach_in_list (ir_instruction, ir, shader->ir) { + switch (ir->ir_type) { + case ir_type_function: + shader->symbols->add_function((ir_function *) ir); + break; + case ir_type_variable: { + ir_variable *const var = (ir_variable *) ir; + + if (var->data.mode != ir_var_temporary) + shader->symbols->add_variable(var); + break; + } + default: + break; + } + } + + delete state->symbols; ralloc_free(state); } @@ -1500,8 +1587,8 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader, bool do_common_optimization(exec_list *ir, bool linked, bool uniform_locations_assigned, - unsigned max_unroll_iterations, - const struct gl_shader_compiler_options *options) + const struct gl_shader_compiler_options *options, + bool native_integers) { GLboolean progress = GL_FALSE; @@ -1536,21 +1623,23 @@ do_common_optimization(exec_list *ir, bool linked, else progress = do_constant_variable_unlinked(ir) || progress; progress = do_constant_folding(ir) || progress; + progress = do_minmax_prune(ir) || progress; progress = do_cse(ir) || progress; - progress = do_algebraic(ir) || progress; + progress = do_rebalance_tree(ir) || progress; + progress = do_algebraic(ir, native_integers, options) || progress; progress = do_lower_jumps(ir) || progress; progress = do_vec_index_to_swizzle(ir) || progress; progress = lower_vector_insert(ir, false) || progress; progress = do_swizzle_swizzle(ir) || progress; progress = do_noop_swizzle(ir) || progress; - progress = optimize_split_arrays(ir, linked) || progress; + progress = optimize_split_arrays(ir, linked, false) || progress; progress = optimize_redundant_jumps(ir) || progress; loop_state *ls = analyze_loop_variables(ir); if (ls->loop_found) { progress = set_loop_controls(ir, ls) || progress; - progress = unroll_loops(ir, ls, max_unroll_iterations) || progress; + progress = unroll_loops(ir, ls, options) || progress; } delete ls; diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.h b/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.h index 2c40a5111..746fd0dcf 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.h +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.h @@ -43,6 +43,9 @@ struct glsl_switch_state { ir_variable *is_break_var; class ast_switch_statement *switch_nesting_ast; + /** Used to set condition if 'default' label should be chosen. */ + ir_variable *run_default; + /** Table of constant values already used in case labels */ struct hash_table *labels_ht; class ast_case_label *previous_default; @@ -119,6 +122,19 @@ struct _mesa_glsl_parse_state { return check_version(130, 300, locp, "bit-wise operations are forbidden"); } + bool check_explicit_attrib_stream_allowed(YYLTYPE *locp) + { + if (!this->has_explicit_attrib_stream()) { + const char *const requirement = "GL_ARB_gpu_shader5 extension or GLSL 400"; + + _mesa_glsl_error(locp, this, "explicit stream requires %s", + requirement); + return false; + } + + return true; + } + bool check_explicit_attrib_location_allowed(YYLTYPE *locp, const ir_variable *var) { @@ -135,6 +151,42 @@ struct _mesa_glsl_parse_state { return true; } + bool check_separate_shader_objects_allowed(YYLTYPE *locp, + const ir_variable *var) + { + if (!this->has_separate_shader_objects()) { + const char *const requirement = this->es_shader + ? "GL_EXT_separate_shader_objects extension" + : "GL_ARB_separate_shader_objects extension or GLSL 420"; + + _mesa_glsl_error(locp, this, "%s explicit location requires %s", + mode_string(var), requirement); + return false; + } + + return true; + } + + bool check_explicit_uniform_location_allowed(YYLTYPE *locp, + const ir_variable *) + { + if (!this->has_explicit_attrib_location() || + !this->ARB_explicit_uniform_location_enable) { + _mesa_glsl_error(locp, this, + "uniform explicit location requires " + "GL_ARB_explicit_uniform_location and either " + "GL_ARB_explicit_attrib_location or GLSL 330."); + return false; + } + + return true; + } + + bool has_explicit_attrib_stream() const + { + return ARB_gpu_shader5_enable || is_version(400, 0); + } + bool has_explicit_attrib_location() const { return ARB_explicit_attrib_location_enable || is_version(330, 300); @@ -145,6 +197,12 @@ struct _mesa_glsl_parse_state { return ARB_uniform_buffer_object_enable || is_version(140, 300); } + bool has_separate_shader_objects() const + { + return ARB_separate_shader_objects_enable || is_version(410, 0) + || EXT_separate_shader_objects_enable; + } + void process_version_directive(YYLTYPE *locp, int version, const char *ident); @@ -153,10 +211,6 @@ struct _mesa_glsl_parse_state { exec_list translation_unit; glsl_symbol_table *symbols; - unsigned num_uniform_blocks; - unsigned uniform_block_array_size; - struct gl_uniform_block *uniform_blocks; - unsigned num_supported_versions; struct { unsigned ver; @@ -164,6 +218,7 @@ struct _mesa_glsl_parse_state { } supported_versions[12]; bool es_shader; + bool metal_target; unsigned language_version; bool had_version_string; bool had_float_precision; @@ -172,7 +227,7 @@ struct _mesa_glsl_parse_state { /** * Number of nested struct_specifier levels * - * Outside a struct_specifer, this is zero. + * Outside a struct_specifier, this is zero. */ unsigned struct_specifier_depth; @@ -183,6 +238,18 @@ struct _mesa_glsl_parse_state { */ struct ast_type_qualifier *default_uniform_qualifier; + /** + * Variables to track different cases if a fragment shader redeclares + * built-in variable gl_FragCoord. + * + * Note: These values are computed at ast_to_hir time rather than at parse + * time. + */ + bool fs_redeclares_gl_fragcoord; + bool fs_origin_upper_left; + bool fs_pixel_center_integer; + bool fs_redeclares_gl_fragcoord_with_no_layout_qualifiers; + /** * True if a geometry shader input primitive type was specified using a * layout directive. @@ -192,11 +259,8 @@ struct _mesa_glsl_parse_state { */ bool gs_input_prim_type_specified; - /** - * If gs_input_prim_type_specified is true, the primitive type that was - * specified. Otherwise ignored. - */ - GLenum gs_input_prim_type; + /** Input layout qualifiers from GLSL 1.50. (geometry shader controls)*/ + struct ast_type_qualifier *in_qualifier; /** * True if a compute shader input local size was specified using a layout @@ -324,84 +388,113 @@ struct _mesa_glsl_parse_state { * \name Enable bits for GLSL extensions */ /*@{*/ + /* ARB extensions go here, sorted alphabetically. + */ bool ARB_arrays_of_arrays_enable; bool ARB_arrays_of_arrays_warn; + bool ARB_compute_shader_enable; + bool ARB_compute_shader_warn; + bool ARB_conservative_depth_enable; + bool ARB_conservative_depth_warn; + bool ARB_derivative_control_enable; + bool ARB_derivative_control_warn; bool ARB_draw_buffers_enable; bool ARB_draw_buffers_warn; bool ARB_draw_instanced_enable; bool ARB_draw_instanced_warn; bool ARB_explicit_attrib_location_enable; bool ARB_explicit_attrib_location_warn; + bool ARB_explicit_uniform_location_enable; + bool ARB_explicit_uniform_location_warn; bool ARB_fragment_coord_conventions_enable; bool ARB_fragment_coord_conventions_warn; - bool ARB_texture_rectangle_enable; - bool ARB_texture_rectangle_warn; - bool ARB_texture_gather_enable; - bool ARB_texture_gather_warn; - bool EXT_texture_array_enable; - bool EXT_texture_array_warn; - bool ARB_shader_texture_lod_enable; - bool ARB_shader_texture_lod_warn; - bool EXT_shader_texture_lod_enable; - bool EXT_shader_texture_lod_warn; - bool EXT_shadow_samplers_enable; - bool EXT_shadow_samplers_warn; - bool EXT_frag_depth_enable; - bool EXT_frag_depth_warn; - bool ARB_shader_stencil_export_enable; - bool ARB_shader_stencil_export_warn; - bool AMD_conservative_depth_enable; - bool AMD_conservative_depth_warn; - bool ARB_conservative_depth_enable; - bool ARB_conservative_depth_warn; - bool AMD_shader_stencil_export_enable; - bool AMD_shader_stencil_export_warn; - bool OES_texture_3D_enable; - bool OES_texture_3D_warn; - bool OES_EGL_image_external_enable; - bool OES_EGL_image_external_warn; + bool ARB_fragment_layer_viewport_enable; + bool ARB_fragment_layer_viewport_warn; + bool ARB_gpu_shader5_enable; + bool ARB_gpu_shader5_warn; + bool ARB_sample_shading_enable; + bool ARB_sample_shading_warn; + bool ARB_separate_shader_objects_enable; + bool ARB_separate_shader_objects_warn; + bool ARB_shader_atomic_counters_enable; + bool ARB_shader_atomic_counters_warn; bool ARB_shader_bit_encoding_enable; bool ARB_shader_bit_encoding_warn; - bool ARB_uniform_buffer_object_enable; - bool ARB_uniform_buffer_object_warn; - bool OES_standard_derivatives_enable; - bool OES_standard_derivatives_warn; - bool ARB_texture_cube_map_array_enable; - bool ARB_texture_cube_map_array_warn; + bool ARB_shader_image_load_store_enable; + bool ARB_shader_image_load_store_warn; + bool ARB_shader_stencil_export_enable; + bool ARB_shader_stencil_export_warn; + bool ARB_shader_texture_lod_enable; + bool ARB_shader_texture_lod_warn; + bool ARB_shading_language_420pack_enable; + bool ARB_shading_language_420pack_warn; bool ARB_shading_language_packing_enable; bool ARB_shading_language_packing_warn; + bool ARB_texture_cube_map_array_enable; + bool ARB_texture_cube_map_array_warn; + bool ARB_texture_gather_enable; + bool ARB_texture_gather_warn; bool ARB_texture_multisample_enable; bool ARB_texture_multisample_warn; bool ARB_texture_query_levels_enable; bool ARB_texture_query_levels_warn; bool ARB_texture_query_lod_enable; bool ARB_texture_query_lod_warn; - bool ARB_gpu_shader5_enable; - bool ARB_gpu_shader5_warn; - bool AMD_vertex_shader_layer_enable; - bool AMD_vertex_shader_layer_warn; - bool ARB_shading_language_420pack_enable; - bool ARB_shading_language_420pack_warn; - bool ARB_sample_shading_enable; - bool ARB_sample_shading_warn; - bool EXT_shader_integer_mix_enable; - bool EXT_shader_integer_mix_warn; - bool ARB_shader_atomic_counters_enable; - bool ARB_shader_atomic_counters_warn; - bool AMD_shader_trinary_minmax_enable; - bool AMD_shader_trinary_minmax_warn; + bool ARB_texture_rectangle_enable; + bool ARB_texture_rectangle_warn; + bool ARB_uniform_buffer_object_enable; + bool ARB_uniform_buffer_object_warn; bool ARB_viewport_array_enable; bool ARB_viewport_array_warn; - bool ARB_compute_shader_enable; - bool ARB_compute_shader_warn; - bool ARB_shader_image_load_store_enable; - bool ARB_shader_image_load_store_warn; + + /* KHR extensions go here, sorted alphabetically. + */ + + /* OES extensions go here, sorted alphabetically. + */ + bool OES_EGL_image_external_enable; + bool OES_EGL_image_external_warn; + bool OES_standard_derivatives_enable; + bool OES_standard_derivatives_warn; + bool OES_texture_3D_enable; + bool OES_texture_3D_warn; + + /* All other extensions go here, sorted alphabetically. + */ + bool AMD_conservative_depth_enable; + bool AMD_conservative_depth_warn; + bool AMD_shader_stencil_export_enable; + bool AMD_shader_stencil_export_warn; + bool AMD_shader_trinary_minmax_enable; + bool AMD_shader_trinary_minmax_warn; + bool AMD_vertex_shader_layer_enable; + bool AMD_vertex_shader_layer_warn; + bool AMD_vertex_shader_viewport_index_enable; + bool AMD_vertex_shader_viewport_index_warn; + bool EXT_draw_buffers_enable; + bool EXT_draw_buffers_warn; + bool EXT_frag_depth_enable; + bool EXT_frag_depth_warn; + bool EXT_separate_shader_objects_enable; + bool EXT_separate_shader_objects_warn; + bool EXT_shader_framebuffer_fetch_enable; + bool EXT_shader_framebuffer_fetch_warn; + bool EXT_shader_integer_mix_enable; + bool EXT_shader_integer_mix_warn; + bool EXT_shader_texture_lod_enable; + bool EXT_shader_texture_lod_warn; + bool EXT_shadow_samplers_enable; + bool EXT_shadow_samplers_warn; + bool EXT_texture_array_enable; + bool EXT_texture_array_warn; + /*@}*/ /** Extensions supported by the OpenGL implementation. */ const struct gl_extensions *extensions; bool uses_builtin_functions; + bool fs_uses_gl_fragcoord; /** * For geometry shaders, size of the most recently seen input declaration @@ -416,6 +509,8 @@ struct _mesa_glsl_parse_state { /** Atomic counter offsets by binding */ unsigned atomic_counter_offsets[MAX_COMBINED_ATOMIC_BUFFERS]; + + bool allow_extension_directive_midshader; }; # define YYLLOC_DEFAULT(Current, Rhs, N) \ diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_symbol_table.cpp b/3rdparty/glsl-optimizer/src/glsl/glsl_symbol_table.cpp index 11569f47e..2294dda42 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_symbol_table.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_symbol_table.cpp @@ -124,6 +124,8 @@ bool glsl_symbol_table::name_declared_this_scope(const char *name) bool glsl_symbol_table::add_variable(ir_variable *v) { + assert(v->data.mode != ir_var_temporary); + if (this->separate_function_namespace) { /* In 1.10, functions and variables have separate namespaces. */ symbol_table_entry *existing = get_entry(v->name); @@ -162,23 +164,6 @@ bool glsl_symbol_table::add_type(const char *name, const glsl_type *t) return _mesa_symbol_table_add_symbol(table, -1, name, entry) == 0; } -static char *make_ast_name(const char *name) -{ - char *ast_name = new char[strlen("#ast.") + strlen(name) + 1]; - strcpy(ast_name, "#ast."); - strcat(ast_name + strlen("#ast."), name); - return ast_name; -} - -bool glsl_symbol_table::add_type_ast(const char *name, const class ast_type_specifier *a) -{ - symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(a); - char *ast_name = make_ast_name(name); - bool ret = _mesa_symbol_table_add_symbol(table, -1, ast_name, entry) == 0; - delete [] ast_name; - return ret; -} - bool glsl_symbol_table::add_interface(const char *name, const glsl_type *i, enum ir_variable_mode mode) { @@ -230,14 +215,6 @@ const glsl_type *glsl_symbol_table::get_type(const char *name) return entry != NULL ? entry->t : NULL; } -const class ast_type_specifier *glsl_symbol_table::get_type_ast(const char *name) -{ - char *ast_name = make_ast_name(name); - symbol_table_entry *entry = get_entry(ast_name); - delete [] ast_name; - return entry != NULL ? entry->a : NULL; -} - const glsl_type *glsl_symbol_table::get_interface(const char *name, enum ir_variable_mode mode) { diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_symbol_table.h b/3rdparty/glsl-optimizer/src/glsl/glsl_symbol_table.h index 0e62448e2..e32b88b86 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_symbol_table.h +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_symbol_table.h @@ -32,9 +32,9 @@ extern "C" { #include "program/symbol_table.h" } #include "ir.h" -#include "glsl_types.h" class symbol_table_entry; +struct glsl_type; /** * Facade class for _mesa_symbol_table @@ -43,37 +43,8 @@ class symbol_table_entry; * type safe and some symbol table invariants. */ struct glsl_symbol_table { -private: - static void - _glsl_symbol_table_destructor (glsl_symbol_table *table) - { - table->~glsl_symbol_table(); - } + DECLARE_RALLOC_CXX_OPERATORS(glsl_symbol_table) -public: - /* Callers of this ralloc-based new need not call delete. It's - * easier to just ralloc_free 'ctx' (or any of its ancestors). */ - static void* operator new(size_t size, void *ctx) - { - void *table; - - table = ralloc_size(ctx, size); - assert(table != NULL); - - ralloc_set_destructor(table, (void (*)(void*)) _glsl_symbol_table_destructor); - - return table; - } - - /* If the user *does* call delete, that's OK, we will just - * ralloc_free in that case. Here, C++ will have already called the - * destructor so tell ralloc not to do that again. */ - static void operator delete(void *table) - { - ralloc_set_destructor(table, NULL); - ralloc_free(table); - } - glsl_symbol_table(); ~glsl_symbol_table(); @@ -98,7 +69,6 @@ public: /*@{*/ bool add_variable(ir_variable *v); bool add_type(const char *name, const glsl_type *t); - bool add_type_ast(const char *name, const class ast_type_specifier *t); bool add_function(ir_function *f); bool add_interface(const char *name, const glsl_type *i, enum ir_variable_mode mode); @@ -115,7 +85,6 @@ public: /*@{*/ ir_variable *get_variable(const char *name); const glsl_type *get_type(const char *name); - const class ast_type_specifier *get_type_ast(const char *name); ir_function *get_function(const char *name); const glsl_type *get_interface(const char *name, enum ir_variable_mode mode); diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_types.cpp b/3rdparty/glsl-optimizer/src/glsl/glsl_types.cpp index 333a160c5..9135d0933 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_types.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_types.cpp @@ -22,9 +22,7 @@ */ #include -#include -#include "main/core.h" /* for Elements */ -#include "glsl_symbol_table.h" +#include "main/core.h" /* for Elements, MAX2 */ #include "glsl_parser_extras.h" #include "glsl_types.h" #include "main/glminimal.h" @@ -112,7 +110,7 @@ glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields, this->fields.structure[i].interpolation = fields[i].interpolation; this->fields.structure[i].centroid = fields[i].centroid; this->fields.structure[i].sample = fields[i].sample; - this->fields.structure[i].row_major = fields[i].row_major; + this->fields.structure[i].matrix_layout = fields[i].matrix_layout; } } @@ -141,7 +139,7 @@ glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields, this->fields.structure[i].interpolation = fields[i].interpolation; this->fields.structure[i].centroid = fields[i].centroid; this->fields.structure[i].sample = fields[i].sample; - this->fields.structure[i].row_major = fields[i].row_major; + this->fields.structure[i].matrix_layout = fields[i].matrix_layout; } } @@ -495,14 +493,28 @@ glsl_type::record_compare(const glsl_type *b) const if (this->interface_packing != b->interface_packing) return false; + /* From the GLSL 4.20 specification (Sec 4.2): + * + * "Structures must have the same name, sequence of type names, and + * type definitions, and field names to be considered the same type." + * + * GLSL ES behaves the same (Ver 1.00 Sec 4.2.4, Ver 3.00 Sec 4.2.5). + * + * Note that we cannot force type name check when comparing unnamed + * structure types, these have a unique name assigned during parsing. + */ + if (!this->is_anonymous() && !b->is_anonymous()) + if (strcmp(this->name, b->name) != 0) + return false; + for (unsigned i = 0; i < this->length; i++) { if (this->fields.structure[i].type != b->fields.structure[i].type) return false; if (strcmp(this->fields.structure[i].name, b->fields.structure[i].name) != 0) return false; - if (this->fields.structure[i].row_major - != b->fields.structure[i].row_major) + if (this->fields.structure[i].matrix_layout + != b->fields.structure[i].matrix_layout) return false; if (this->fields.structure[i].location != b->fields.structure[i].location) @@ -697,8 +709,35 @@ glsl_type::component_slots() const return 0; } +unsigned +glsl_type::uniform_locations() const +{ + unsigned size = 0; + + switch (this->base_type) { + case GLSL_TYPE_UINT: + case GLSL_TYPE_INT: + case GLSL_TYPE_FLOAT: + case GLSL_TYPE_BOOL: + case GLSL_TYPE_SAMPLER: + case GLSL_TYPE_IMAGE: + return 1; + + case GLSL_TYPE_STRUCT: + case GLSL_TYPE_INTERFACE: + for (unsigned i = 0; i < this->length; i++) + size += this->fields.structure[i].type->uniform_locations(); + return size; + case GLSL_TYPE_ARRAY: + return this->length * this->fields.array->uniform_locations(); + default: + return 0; + } +} + bool -glsl_type::can_implicitly_convert_to(const glsl_type *desired) const +glsl_type::can_implicitly_convert_to(const glsl_type *desired, + _mesa_glsl_parse_state *state) const { if (this == desired) return true; @@ -707,10 +746,23 @@ glsl_type::can_implicitly_convert_to(const glsl_type *desired) const if (this->matrix_columns > 1 || desired->matrix_columns > 1) return false; + /* Vector size must match. */ + if (this->vector_elements != desired->vector_elements) + return false; + /* int and uint can be converted to float. */ - return desired->is_float() - && this->is_integer() - && this->vector_elements == desired->vector_elements; + if (desired->is_float() && this->is_integer()) + return true; + + /* With GLSL 4.0 / ARB_gpu_shader5, int can be converted to uint. + * Note that state may be NULL here, when resolving function calls in the + * linker. By this time, all the state-dependent checks have already + * happened though, so allow anything that's allowed in any shader version. */ + if ((!state || state->is_version(400, 0) || state->ARB_gpu_shader5_enable) && + desired->base_type == GLSL_TYPE_UINT && this->base_type == GLSL_TYPE_INT) + return true; + + return false; } unsigned @@ -808,9 +860,18 @@ glsl_type::std140_base_alignment(bool row_major) const if (this->is_record()) { unsigned base_alignment = 16; for (unsigned i = 0; i < this->length; i++) { + bool field_row_major = row_major; + const enum glsl_matrix_layout matrix_layout = + glsl_matrix_layout(this->fields.structure[i].matrix_layout); + if (matrix_layout == GLSL_MATRIX_LAYOUT_ROW_MAJOR) { + field_row_major = true; + } else if (matrix_layout == GLSL_MATRIX_LAYOUT_COLUMN_MAJOR) { + field_row_major = false; + } + const struct glsl_type *field_type = this->fields.structure[i].type; base_alignment = MAX2(base_alignment, - field_type->std140_base_alignment(row_major)); + field_type->std140_base_alignment(field_row_major)); } return base_alignment; } @@ -854,8 +915,7 @@ glsl_type::std140_size(bool row_major) const * and rows, the matrix is stored identically to a row of * * row vectors with components each, according to rule (4). */ - if (this->is_matrix() || (this->is_array() && - this->fields.array->is_matrix())) { + if (this->without_array()->is_matrix()) { const struct glsl_type *element_type; const struct glsl_type *vec_type; unsigned int array_len; @@ -917,14 +977,29 @@ glsl_type::std140_size(bool row_major) const */ if (this->is_record()) { unsigned size = 0; + unsigned max_align = 0; + for (unsigned i = 0; i < this->length; i++) { + bool field_row_major = row_major; + const enum glsl_matrix_layout matrix_layout = + glsl_matrix_layout(this->fields.structure[i].matrix_layout); + if (matrix_layout == GLSL_MATRIX_LAYOUT_ROW_MAJOR) { + field_row_major = true; + } else if (matrix_layout == GLSL_MATRIX_LAYOUT_COLUMN_MAJOR) { + field_row_major = false; + } + const struct glsl_type *field_type = this->fields.structure[i].type; - unsigned align = field_type->std140_base_alignment(row_major); + unsigned align = field_type->std140_base_alignment(field_row_major); size = glsl_align(size, align); - size += field_type->std140_size(row_major); + size += field_type->std140_size(field_row_major); + + max_align = MAX2(align, max_align); + + if (field_type->is_record() && (i + 1 < this->length)) + size = glsl_align(size, 16); } - size = glsl_align(size, - this->fields.structure[0].type->std140_base_alignment(row_major)); + size = glsl_align(size, MAX2(max_align, 16)); return size; } diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_types.h b/3rdparty/glsl-optimizer/src/glsl/glsl_types.h index ad40bae8a..f45e6dd6f 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_types.h +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_types.h @@ -86,9 +86,30 @@ enum glsl_precision { glsl_precision_undefined, }; +enum glsl_matrix_layout { + /** + * The layout of the matrix is inherited from the object containing the + * matrix (the top level structure or the uniform block). + */ + GLSL_MATRIX_LAYOUT_INHERITED, + + /** + * Explicit column-major layout + * + * If a uniform block doesn't have an explicit layout set, it will default + * to this layout. + */ + GLSL_MATRIX_LAYOUT_COLUMN_MAJOR, + + /** + * Row-major layout + */ + GLSL_MATRIX_LAYOUT_ROW_MAJOR +}; + #ifdef __cplusplus #include "../mesa/main/glminimal.h" -#include "ralloc.h" +#include "util/ralloc.h" struct glsl_type { GLenum gl_type; @@ -187,7 +208,7 @@ struct glsl_type { /**@}*/ /** - * For numeric and boolean derrived types returns the basic scalar type + * For numeric and boolean derived types returns the basic scalar type * * If the type is a numeric or boolean scalar, vector, or matrix type, * this function gets the scalar type of the individual components. For @@ -262,6 +283,15 @@ struct glsl_type { */ unsigned component_slots() const; + /** + * Calculate the number of unique values from glGetUniformLocation for the + * elements of the type. + * + * This is used to allocate slots in the UniformRemapTable, the amount of + * locations may not match with actual used storage space by the driver. + */ + unsigned uniform_locations() const; + /** * Calculate the number of attribute slots required to hold this type * @@ -321,7 +351,8 @@ struct glsl_type { * integers. * \endverbatim */ - bool can_implicitly_convert_to(const glsl_type *desired) const; + bool can_implicitly_convert_to(const glsl_type *desired, + _mesa_glsl_parse_state *state) const; /** * Query whether or not a type is a scalar (non-vector and non-matrix). @@ -464,6 +495,26 @@ struct glsl_type { return base_type == GLSL_TYPE_ERROR; } + /** + * Query if a type is unnamed/anonymous (named by the parser) + */ + bool is_anonymous() const + { + return !strncmp(name, "#anon", 5); + } + + /** + * Get the type stripped of any arrays + * + * \return + * Pointer to the type of elements of the first non-array type for array + * types, or pointer to itself for non-array types. + */ + const glsl_type *without_array() const + { + return this->is_array() ? this->fields.array : this; + } + /** * Return the amount of atomic counter storage required for a type. */ @@ -646,7 +697,6 @@ private: struct glsl_struct_field { const struct glsl_type *type; const char *name; - bool row_major; glsl_precision precision; /** @@ -675,6 +725,17 @@ struct glsl_struct_field { * in ir_variable::sample). 0 otherwise. */ unsigned sample:1; + + /** + * Layout of the matrix. Uses glsl_matrix_layout values. + */ + unsigned matrix_layout:2; + + /** + * For interface blocks, it has a value if this variable uses multiple vertex + * streams (as in ir_variable::stream). -1 otherwise. + */ + int stream; }; static inline unsigned int diff --git a/3rdparty/glsl-optimizer/src/glsl/hir_field_selection.cpp b/3rdparty/glsl-optimizer/src/glsl/hir_field_selection.cpp index 1e92c89ae..0fa976811 100644 --- a/3rdparty/glsl-optimizer/src/glsl/hir_field_selection.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/hir_field_selection.cpp @@ -22,7 +22,6 @@ */ #include "ir.h" -#include "program/symbol_table.h" #include "glsl_parser_extras.h" #include "ast.h" #include "glsl_types.h" diff --git a/3rdparty/glsl-optimizer/src/glsl/ir.cpp b/3rdparty/glsl-optimizer/src/glsl/ir.cpp index 4401d85a5..636736e52 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir.cpp @@ -23,7 +23,6 @@ #include #include "main/core.h" /* for MAX2 */ #include "ir.h" -#include "ir_visitor.h" #include "glsl_types.h" glsl_precision higher_precision (ir_instruction* a, ir_instruction* b) @@ -38,8 +37,9 @@ glsl_precision higher_precision (ir_instruction* a, ir_instruction* b) } -ir_rvalue::ir_rvalue(glsl_precision precision) -: precision(precision) +ir_rvalue::ir_rvalue(enum ir_node_type t, glsl_precision precision) + : ir_instruction(t) + , precision(precision) { this->type = glsl_type::error_type; } @@ -166,8 +166,8 @@ ir_assignment::whole_variable_written() ir_assignment::ir_assignment(ir_dereference *lhs, ir_rvalue *rhs, ir_rvalue *condition, unsigned write_mask) + : ir_instruction(ir_type_assignment) { - this->ir_type = ir_type_assignment; this->condition = condition; this->rhs = rhs; this->lhs = lhs; @@ -186,8 +186,8 @@ ir_assignment::ir_assignment(ir_dereference *lhs, ir_rvalue *rhs, ir_assignment::ir_assignment(ir_rvalue *lhs, ir_rvalue *rhs, ir_rvalue *condition) + : ir_instruction(ir_type_assignment) { - this->ir_type = ir_type_assignment; this->condition = condition; this->rhs = rhs; @@ -211,9 +211,8 @@ ir_assignment::ir_assignment(ir_rvalue *lhs, ir_rvalue *rhs, ir_expression::ir_expression(int op, const struct glsl_type *type, ir_rvalue *op0, ir_rvalue *op1, ir_rvalue *op2, ir_rvalue *op3) -: ir_rvalue(higher_precision(higher_precision(op0,op1), higher_precision(op2,op3))) + : ir_rvalue(ir_type_expression, higher_precision(higher_precision(op0,op1), higher_precision(op2,op3))) { - this->ir_type = ir_type_expression; this->type = type; this->operation = ir_expression_operation(op); this->operands[0] = op0; @@ -229,10 +228,8 @@ ir_expression::ir_expression(int op, const struct glsl_type *type, } ir_expression::ir_expression(int op, ir_rvalue *op0) -: ir_rvalue(precision_from_ir(op0)) + : ir_rvalue(ir_type_expression, precision_from_ir(op0)) { - this->ir_type = ir_type_expression; - this->operation = ir_expression_operation(op); this->operands[0] = op0; this->operands[1] = NULL; @@ -265,8 +262,14 @@ ir_expression::ir_expression(int op, ir_rvalue *op0) case ir_unop_sin_reduced: case ir_unop_cos_reduced: case ir_unop_dFdx: + case ir_unop_dFdx_coarse: + case ir_unop_dFdx_fine: case ir_unop_dFdy: + case ir_unop_dFdy_coarse: + case ir_unop_dFdy_fine: case ir_unop_bitfield_reverse: + case ir_unop_interpolate_at_centroid: + case ir_unop_saturate: this->type = op0->type; break; @@ -340,10 +343,8 @@ ir_expression::ir_expression(int op, ir_rvalue *op0) } ir_expression::ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1) -: ir_rvalue(higher_precision(op0,op1)) + : ir_rvalue(ir_type_expression, higher_precision(op0,op1)) { - this->ir_type = ir_type_expression; - this->operation = ir_expression_operation(op); this->operands[0] = op0; this->operands[1] = op1; @@ -422,6 +423,8 @@ ir_expression::ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1) case ir_binop_rshift: case ir_binop_bfm: case ir_binop_ldexp: + case ir_binop_interpolate_at_offset: + case ir_binop_interpolate_at_sample: this->type = op0->type; this->set_precision(op0->get_precision()); break; @@ -439,10 +442,8 @@ ir_expression::ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1) ir_expression::ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1, ir_rvalue *op2) -: ir_rvalue(higher_precision(precision_from_ir(op0),higher_precision(op1,op2))) + : ir_rvalue(ir_type_expression, higher_precision(precision_from_ir(op0),higher_precision(op1,op2))) { - this->ir_type = ir_type_expression; - this->operation = ir_expression_operation(op); this->operands[0] = op0; this->operands[1] = op1; @@ -531,7 +532,11 @@ static const char *const operator_strs[] = { "sin_reduced", "cos_reduced", "dFdx", + "dFdxCoarse", + "dFdxFine", "dFdy", + "dFdyCoarse", + "dFdyFine", "packSnorm2x16", "packSnorm4x8", "packUnorm2x16", @@ -548,7 +553,9 @@ static const char *const operator_strs[] = { "bit_count", "find_msb", "find_lsb", + "sat", "noise", + "interpolate_at_centroid", "+", "-", "*", @@ -582,6 +589,8 @@ static const char *const operator_strs[] = { "ubo_load", "ldexp", "vector_extract", + "interpolate_at_offset", + "interpolate_at_sample", "fma", "clamp", "lrp", @@ -633,28 +642,25 @@ ir_expression::get_operator(const char *str) } ir_constant::ir_constant() -: ir_rvalue(glsl_precision_undefined) + : ir_rvalue(ir_type_constant, glsl_precision_undefined) { - this->ir_type = ir_type_constant; } ir_constant::ir_constant(const struct glsl_type *type, const ir_constant_data *data) -: ir_rvalue(glsl_precision_undefined) + : ir_rvalue(ir_type_constant, glsl_precision_undefined) { assert((type->base_type >= GLSL_TYPE_UINT) && (type->base_type <= GLSL_TYPE_BOOL)); - this->ir_type = ir_type_constant; this->type = type; memcpy(& this->value, data, sizeof(this->value)); } ir_constant::ir_constant(float f, unsigned vector_elements) -: ir_rvalue(glsl_precision_undefined) + : ir_rvalue(ir_type_constant, glsl_precision_undefined) { assert(vector_elements <= 4); - this->ir_type = ir_type_constant; this->type = glsl_type::get_instance(GLSL_TYPE_FLOAT, vector_elements, 1); for (unsigned i = 0; i < vector_elements; i++) { this->value.f[i] = f; @@ -665,10 +671,9 @@ ir_constant::ir_constant(float f, unsigned vector_elements) } ir_constant::ir_constant(unsigned int u, unsigned vector_elements) -: ir_rvalue(glsl_precision_undefined) + : ir_rvalue(ir_type_constant, glsl_precision_undefined) { assert(vector_elements <= 4); - this->ir_type = ir_type_constant; this->type = glsl_type::get_instance(GLSL_TYPE_UINT, vector_elements, 1); for (unsigned i = 0; i < vector_elements; i++) { this->value.u[i] = u; @@ -679,10 +684,9 @@ ir_constant::ir_constant(unsigned int u, unsigned vector_elements) } ir_constant::ir_constant(int integer, unsigned vector_elements) -: ir_rvalue(glsl_precision_undefined) + : ir_rvalue(ir_type_constant, glsl_precision_undefined) { assert(vector_elements <= 4); - this->ir_type = ir_type_constant; this->type = glsl_type::get_instance(GLSL_TYPE_INT, vector_elements, 1); for (unsigned i = 0; i < vector_elements; i++) { this->value.i[i] = integer; @@ -693,10 +697,9 @@ ir_constant::ir_constant(int integer, unsigned vector_elements) } ir_constant::ir_constant(bool b, unsigned vector_elements) -: ir_rvalue(glsl_precision_undefined) + : ir_rvalue(ir_type_constant, glsl_precision_undefined) { assert(vector_elements <= 4); - this->ir_type = ir_type_constant; this->type = glsl_type::get_instance(GLSL_TYPE_BOOL, vector_elements, 1); for (unsigned i = 0; i < vector_elements; i++) { this->value.b[i] = b; @@ -707,9 +710,8 @@ ir_constant::ir_constant(bool b, unsigned vector_elements) } ir_constant::ir_constant(const ir_constant *c, unsigned i) -: ir_rvalue(c->precision) + : ir_rvalue(ir_type_constant, c->precision) { - this->ir_type = ir_type_constant; this->type = c->type->get_base_type(); switch (this->type->base_type) { @@ -722,9 +724,8 @@ ir_constant::ir_constant(const ir_constant *c, unsigned i) } ir_constant::ir_constant(const struct glsl_type *type, exec_list *value_list) -: ir_rvalue(glsl_precision_undefined) + : ir_rvalue(ir_type_constant, glsl_precision_undefined) { - this->ir_type = ir_type_constant; this->type = type; assert(type->is_scalar() || type->is_vector() || type->is_matrix() @@ -733,8 +734,7 @@ ir_constant::ir_constant(const struct glsl_type *type, exec_list *value_list) if (type->is_array()) { this->array_elements = ralloc_array(this, ir_constant *, type->length); unsigned i = 0; - foreach_list(node, value_list) { - ir_constant *value = (ir_constant *) node; + foreach_in_list(ir_constant, value, value_list) { assert(value->as_constant() != NULL); this->array_elements[i++] = value; @@ -1035,9 +1035,7 @@ ir_constant::copy_offset(ir_constant *src, int offset) case GLSL_TYPE_STRUCT: { assert (src->type == this->type); this->components.make_empty(); - foreach_list(node, &src->components) { - ir_constant *const orig = (ir_constant *) node; - + foreach_in_list(ir_constant, orig, &src->components) { this->components.push_tail(orig->clone(this, NULL)); } break; @@ -1254,18 +1252,26 @@ ir_constant::is_basis() const return ones == 1; } -ir_loop::ir_loop() +bool +ir_constant::is_uint16_constant() const +{ + if (!type->is_integer()) + return false; + + return value.u[0] < (1 << 16); +} + +ir_loop::ir_loop() + : ir_instruction(ir_type_loop) { - this->ir_type = ir_type_loop; } ir_dereference_variable::ir_dereference_variable(ir_variable *var) -: ir_dereference(precision_from_ir(var)) + : ir_dereference(ir_type_dereference_variable, precision_from_ir(var)) { assert(var != NULL); - this->ir_type = ir_type_dereference_variable; this->var = var; this->type = var->type; } @@ -1273,9 +1279,8 @@ ir_dereference_variable::ir_dereference_variable(ir_variable *var) ir_dereference_array::ir_dereference_array(ir_rvalue *value, ir_rvalue *array_index) -: ir_dereference(precision_from_ir(value)) + : ir_dereference(ir_type_dereference_array, precision_from_ir(value)) { - this->ir_type = ir_type_dereference_array; this->array_index = array_index; this->set_array(value); } @@ -1283,11 +1288,10 @@ ir_dereference_array::ir_dereference_array(ir_rvalue *value, ir_dereference_array::ir_dereference_array(ir_variable *var, ir_rvalue *array_index) -: ir_dereference(precision_from_ir(var)) + : ir_dereference(ir_type_dereference_array, precision_from_ir(var)) { void *ctx = ralloc_parent(var); - this->ir_type = ir_type_dereference_array; this->array_index = array_index; this->set_array(new(ctx) ir_dereference_variable(var)); } @@ -1314,11 +1318,10 @@ ir_dereference_array::set_array(ir_rvalue *value) ir_dereference_record::ir_dereference_record(ir_rvalue *value, const char *field) -: ir_dereference(precision_from_ir(value)) + : ir_dereference(ir_type_dereference_record, precision_from_ir(value)) { assert(value != NULL); - this->ir_type = ir_type_dereference_record; this->record = value; this->field = ralloc_strdup(this, field); this->type = this->record->type->field_type(field); @@ -1329,11 +1332,10 @@ ir_dereference_record::ir_dereference_record(ir_rvalue *value, ir_dereference_record::ir_dereference_record(ir_variable *var, const char *field) -: ir_dereference(precision_from_ir(var)) + : ir_dereference(ir_type_dereference_record, precision_from_ir(var)) { void *ctx = ralloc_parent(var); - this->ir_type = ir_type_dereference_record; this->record = new(ctx) ir_dereference_variable(var); this->field = ralloc_strdup(this, field); this->type = this->record->type->field_type(field); @@ -1364,7 +1366,7 @@ ir_dereference::is_lvalue() const } -static const char *tex_opcode_strs[] = { "tex", "txb", "txl", "txd", "txf", "txf_ms", "txs", "lod", "tg4", "query_levels" }; +static const char * const tex_opcode_strs[] = { "tex", "txb", "txl", "txd", "txf", "txf_ms", "txs", "lod", "tg4", "query_levels" }; const char *ir_texture::opcode_string() { @@ -1452,25 +1454,22 @@ ir_swizzle::init_mask(const unsigned *comp, unsigned count) ir_swizzle::ir_swizzle(ir_rvalue *val, unsigned x, unsigned y, unsigned z, unsigned w, unsigned count) - : ir_rvalue(precision_from_ir(val)), val(val) + : ir_rvalue(ir_type_swizzle, precision_from_ir(val)), val(val) { const unsigned components[4] = { x, y, z, w }; - this->ir_type = ir_type_swizzle; this->init_mask(components, count); } ir_swizzle::ir_swizzle(ir_rvalue *val, const unsigned *comp, unsigned count) - : ir_rvalue(precision_from_ir(val)), val(val) + : ir_rvalue(ir_type_swizzle, precision_from_ir(val)), val(val) { - this->ir_type = ir_type_swizzle; this->init_mask(comp, count); } ir_swizzle::ir_swizzle(ir_rvalue *val, ir_swizzle_mask mask) -: ir_rvalue(precision_from_ir(val)) + : ir_rvalue(ir_type_swizzle, precision_from_ir(val)) { - this->ir_type = ir_type_swizzle; this->val = val; this->mask = mask; this->type = glsl_type::get_instance(val->type->base_type, @@ -1566,18 +1565,45 @@ ir_swizzle::variable_referenced() const return this->val->variable_referenced(); } + +bool ir_variable::temporaries_allocate_names = false; + +const char ir_variable::tmp_name[] = "compiler_temp"; + ir_variable::ir_variable(const struct glsl_type *type, const char *name, ir_variable_mode mode, glsl_precision precision) - : max_ifc_array_access(NULL) + : ir_instruction(ir_type_variable) { - this->ir_type = ir_type_variable; this->type = type; - this->name = ralloc_strdup(this, name); + + if (mode == ir_var_temporary && !ir_variable::temporaries_allocate_names) + name = NULL; + + /* The ir_variable clone method may call this constructor with name set to + * tmp_name. + */ + assert(name != NULL + || mode == ir_var_temporary + || mode == ir_var_function_in + || mode == ir_var_function_out + || mode == ir_var_function_inout); + assert(name != ir_variable::tmp_name + || mode == ir_var_temporary); + if (mode == ir_var_temporary + && (name == NULL || name == ir_variable::tmp_name)) { + this->name = ir_variable::tmp_name; + } else { + this->name = ralloc_strdup(this, name); + } + + this->u.max_ifc_array_access = NULL; + this->data.explicit_location = false; this->data.has_initializer = false; this->data.location = -1; this->data.location_frac = 0; - this->warn_extension = NULL; + this->data.binding = 0; + this->data.warn_extension_index = 0; this->constant_value = NULL; this->constant_initializer = NULL; this->data.origin_upper_left = false; @@ -1593,13 +1619,12 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name, this->data.precision = precision; this->data.interpolation = INTERP_QUALIFIER_NONE; this->data.max_array_access = 0; - this->data.atomic.buffer_index = 0; this->data.atomic.offset = 0; - this->data.image.read_only = false; - this->data.image.write_only = false; - this->data.image.coherent = false; - this->data.image._volatile = false; - this->data.image.restrict_flag = false; + this->data.image_read_only = false; + this->data.image_write_only = false; + this->data.image_coherent = false; + this->data.image_volatile = false; + this->data.image_restrict = false; if (type != NULL) { if (type->base_type == GLSL_TYPE_SAMPLER) @@ -1642,13 +1667,39 @@ ir_variable::determine_interpolation_mode(bool flat_shade) return INTERP_QUALIFIER_SMOOTH; } +const char *const ir_variable::warn_extension_table[] = { + "", + "GL_ARB_shader_stencil_export", + "GL_AMD_shader_stencil_export", +}; + +void +ir_variable::enable_extension_warning(const char *extension) +{ + for (unsigned i = 0; i < Elements(warn_extension_table); i++) { + if (strcmp(warn_extension_table[i], extension) == 0) { + this->data.warn_extension_index = i; + return; + } + } + + assert(!"Should not get here."); + this->data.warn_extension_index = 0; +} + +const char * +ir_variable::get_extension_warning() const +{ + return this->data.warn_extension_index == 0 + ? NULL : warn_extension_table[this->data.warn_extension_index]; +} ir_function_signature::ir_function_signature(const glsl_type *return_type, glsl_precision precision, builtin_available_predicate b) - : return_type(return_type), precision(precision), is_defined(false), is_intrinsic(false), + : ir_instruction(ir_type_function_signature), + return_type(return_type), precision(precision), is_defined(false), is_intrinsic(false), builtin_avail(b), _function(NULL) { - this->ir_type = ir_type_function_signature; this->origin = NULL; } @@ -1706,11 +1757,11 @@ ir_function_signature::qualifiers_match(exec_list *params) a->data.interpolation != b->data.interpolation || a->data.centroid != b->data.centroid || a->data.sample != b->data.sample || - a->data.image.read_only != b->data.image.read_only || - a->data.image.write_only != b->data.image.write_only || - a->data.image.coherent != b->data.image.coherent || - a->data.image._volatile != b->data.image._volatile || - a->data.image.restrict_flag != b->data.image.restrict_flag) { + a->data.image_read_only != b->data.image_read_only || + a->data.image_write_only != b->data.image_write_only || + a->data.image_coherent != b->data.image_coherent || + a->data.image_volatile != b->data.image_volatile || + a->data.image_restrict != b->data.image_restrict) { /* parameter a's qualifiers don't match */ return a->name; @@ -1732,8 +1783,8 @@ ir_function_signature::replace_parameters(exec_list *new_params) ir_function::ir_function(const char *name) + : ir_instruction(ir_type_function) { - this->ir_type = ir_type_function; this->name = ralloc_strdup(this, name); } @@ -1741,8 +1792,7 @@ ir_function::ir_function(const char *name) bool ir_function::has_user_signature() { - foreach_list(n, &this->signatures) { - ir_function_signature *const sig = (ir_function_signature *) n; + foreach_in_list(ir_function_signature, sig, &this->signatures) { if (!sig->is_builtin()) return true; } @@ -1753,7 +1803,7 @@ ir_function::has_user_signature() ir_rvalue * ir_rvalue::error_value(void *mem_ctx) { - ir_rvalue *v = new(mem_ctx) ir_rvalue(glsl_precision_undefined); + ir_rvalue *v = new(mem_ctx) ir_rvalue(ir_type_unset, glsl_precision_undefined); v->type = glsl_type::error_type; return v; @@ -1763,8 +1813,8 @@ ir_rvalue::error_value(void *mem_ctx) void visit_exec_list(exec_list *list, ir_visitor *visitor) { - foreach_list_safe(n, list) { - ((ir_instruction *) n)->accept(visitor); + foreach_in_list_safe(ir_instruction, node, list) { + node->accept(visitor); } } @@ -1785,8 +1835,7 @@ steal_memory(ir_instruction *ir, void *new_ctx) */ if (constant != NULL) { if (constant->type->is_record()) { - foreach_list(n, &constant->components) { - ir_constant *field = (ir_constant *) n; + foreach_in_list(ir_constant, field, &constant->components) { steal_memory(field, ir); } } else if (constant->type->is_array()) { @@ -1803,8 +1852,8 @@ steal_memory(ir_instruction *ir, void *new_ctx) void reparent_ir(exec_list *list, void *mem_ctx) { - foreach_list(node, list) { - visit_tree((ir_instruction *) node, steal_memory, mem_ctx); + foreach_in_list(ir_instruction, node, list) { + visit_tree(node, steal_memory, mem_ctx); } } @@ -1926,6 +1975,9 @@ mode_string(const ir_variable *var) case ir_var_shader_out: return "shader output"; + case ir_var_shader_inout: + return "shader inout"; + case ir_var_function_in: case ir_var_const_in: return "function input"; diff --git a/3rdparty/glsl-optimizer/src/glsl/ir.h b/3rdparty/glsl-optimizer/src/glsl/ir.h index d1a25d7a7..6d21d0e2e 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir.h +++ b/3rdparty/glsl-optimizer/src/glsl/ir.h @@ -29,7 +29,8 @@ #include #include -#include "ralloc.h" +#include "c99_compat.h" +#include "util/ralloc.h" #include "glsl_types.h" #include "list.h" #include "ir_visitor.h" @@ -60,33 +61,29 @@ * types, this allows writing very straightforward, readable code. */ enum ir_node_type { - /** - * Zero is unused so that the IR validator can detect cases where - * \c ir_instruction::ir_type has not been initialized. - */ - ir_type_unset, - ir_type_variable, - ir_type_assignment, - ir_type_call, - ir_type_constant, ir_type_dereference_array, ir_type_dereference_record, ir_type_dereference_variable, - ir_type_discard, + ir_type_constant, ir_type_expression, + ir_type_swizzle, + ir_type_texture, + ir_type_variable, + ir_type_assignment, + ir_type_call, ir_type_function, ir_type_function_signature, ir_type_if, ir_type_loop, ir_type_loop_jump, ir_type_return, - ir_type_swizzle, - ir_type_texture, ir_type_precision, ir_type_typedecl, + ir_type_discard, ir_type_emit_vertex, ir_type_end_primitive, - ir_type_max /**< maximum ir_type enum number, for validation */ + ir_type_max, /**< maximum ir_type enum number, for validation */ + ir_type_unset = ir_type_max }; @@ -109,6 +106,7 @@ public: /** ir_print_visitor helper for debugging. */ void print(void) const; + void fprint(FILE *f) const; virtual void accept(ir_visitor *) = 0; virtual ir_visitor_status accept(ir_hierarchical_visitor *) = 0; @@ -123,24 +121,58 @@ public: * Additional downcast functions will be added as needed. */ /*@{*/ - virtual class ir_variable * as_variable() { return NULL; } - virtual class ir_function * as_function() { return NULL; } - virtual class ir_dereference * as_dereference() { return NULL; } - virtual class ir_dereference_array * as_dereference_array() { return NULL; } - virtual class ir_dereference_variable *as_dereference_variable() { return NULL; } - virtual class ir_dereference_record *as_dereference_record() { return NULL; } - virtual class ir_expression * as_expression() { return NULL; } - virtual class ir_rvalue * as_rvalue() { return NULL; } - virtual class ir_loop * as_loop() { return NULL; } - virtual class ir_assignment * as_assignment() { return NULL; } - virtual class ir_call * as_call() { return NULL; } - virtual class ir_return * as_return() { return NULL; } - virtual class ir_if * as_if() { return NULL; } - virtual class ir_swizzle * as_swizzle() { return NULL; } - virtual class ir_texture * as_texture() { return NULL; } - virtual class ir_constant * as_constant() { return NULL; } - virtual class ir_discard * as_discard() { return NULL; } - virtual class ir_jump * as_jump() { return NULL; } + class ir_rvalue *as_rvalue() + { + if (ir_type == ir_type_dereference_array || + ir_type == ir_type_dereference_record || + ir_type == ir_type_dereference_variable || + ir_type == ir_type_constant || + ir_type == ir_type_expression || + ir_type == ir_type_swizzle || + ir_type == ir_type_texture) + return (class ir_rvalue *) this; + return NULL; + } + + class ir_dereference *as_dereference() + { + if (ir_type == ir_type_dereference_array || + ir_type == ir_type_dereference_record || + ir_type == ir_type_dereference_variable) + return (class ir_dereference *) this; + return NULL; + } + + class ir_jump *as_jump() + { + if (ir_type == ir_type_loop_jump || + ir_type == ir_type_return || + ir_type == ir_type_discard) + return (class ir_jump *) this; + return NULL; + } + + #define AS_CHILD(TYPE) \ + class ir_##TYPE * as_##TYPE() \ + { \ + return ir_type == ir_type_##TYPE ? (ir_##TYPE *) this : NULL; \ + } + AS_CHILD(variable) + AS_CHILD(function) + AS_CHILD(dereference_array) + AS_CHILD(dereference_variable) + AS_CHILD(dereference_record) + AS_CHILD(expression) + AS_CHILD(loop) + AS_CHILD(assignment) + AS_CHILD(call) + AS_CHILD(return) + AS_CHILD(if) + AS_CHILD(swizzle) + AS_CHILD(texture) + AS_CHILD(constant) + AS_CHILD(discard) + #undef AS_CHILD /*@}*/ /** @@ -154,9 +186,15 @@ public: virtual bool equals(ir_instruction *ir, enum ir_node_type ignore = ir_type_unset); protected: + ir_instruction(enum ir_node_type t) + : ir_type(t) + { + } + +private: ir_instruction() { - ir_type = ir_type_unset; + assert(!"Should not get here."); } }; @@ -179,11 +217,6 @@ public: virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL); - virtual ir_rvalue * as_rvalue() - { - return this; - } - ir_rvalue *as_rvalue_to_saturate(); virtual bool is_lvalue() const @@ -270,6 +303,13 @@ public: */ virtual bool is_basis() const; + /** + * Determine if an r-value is an unsigned integer constant which can be + * stored in 16 bits. + * + * \sa ir_constant::is_uint16_constant. + */ + virtual bool is_uint16_constant() const { return false; } /** * Return a generic value of error_type. @@ -279,7 +319,7 @@ public: static ir_rvalue *error_value(void *mem_ctx); protected: - ir_rvalue(glsl_precision precision); + ir_rvalue(enum ir_node_type t, glsl_precision precision); glsl_precision precision; }; @@ -293,6 +333,7 @@ enum ir_variable_mode { ir_var_uniform, /**< Variable declared as a uniform. */ ir_var_shader_in, ir_var_shader_out, + ir_var_shader_inout, ir_var_function_in, ir_var_function_out, ir_var_function_inout, @@ -382,11 +423,6 @@ public: virtual ir_variable *clone(void *mem_ctx, struct hash_table *ht) const; - virtual ir_variable *as_variable() - { - return this; - } - virtual void accept(ir_visitor *v) { v->visit(this); @@ -449,7 +485,7 @@ public: assert(this->interface_type == NULL); this->interface_type = type; if (this->is_interface_instance()) { - this->max_ifc_array_access = + this->u.max_ifc_array_access = rzalloc_array(this, unsigned, type->length); } } @@ -461,7 +497,7 @@ public: */ void change_interface_type(const struct glsl_type *type) { - if (this->max_ifc_array_access != NULL) { + if (this->u.max_ifc_array_access != NULL) { /* max_ifc_array_access has already been allocated, so make sure the * new interface has the same number of fields as the old one. */ @@ -478,7 +514,7 @@ public: */ void reinit_interface_type(const struct glsl_type *type) { - if (this->max_ifc_array_access != NULL) { + if (this->u.max_ifc_array_access != NULL) { #ifndef NDEBUG /* Redeclaring gl_PerVertex is only allowed if none of the built-ins * it defines have been accessed yet; so it's safe to throw away the @@ -486,10 +522,10 @@ public: * zero. */ for (unsigned i = 0; i < this->interface_type->length; i++) - assert(this->max_ifc_array_access[i] == 0); + assert(this->u.max_ifc_array_access[i] == 0); #endif - ralloc_free(this->max_ifc_array_access); - this->max_ifc_array_access = NULL; + ralloc_free(this->u.max_ifc_array_access); + this->u.max_ifc_array_access = NULL; } this->interface_type = NULL; init_interface_type(type); @@ -500,6 +536,72 @@ public: return this->interface_type; } + /** + * Get the max_ifc_array_access pointer + * + * A "set" function is not needed because the array is dynmically allocated + * as necessary. + */ + inline unsigned *get_max_ifc_array_access() + { + assert(this->data._num_state_slots == 0); + return this->u.max_ifc_array_access; + } + + inline unsigned get_num_state_slots() const + { + assert(!this->is_interface_instance() + || this->data._num_state_slots == 0); + return this->data._num_state_slots; + } + + inline void set_num_state_slots(unsigned n) + { + assert(!this->is_interface_instance() + || n == 0); + this->data._num_state_slots = n; + } + + inline ir_state_slot *get_state_slots() + { + return this->is_interface_instance() ? NULL : this->u.state_slots; + } + + inline const ir_state_slot *get_state_slots() const + { + return this->is_interface_instance() ? NULL : this->u.state_slots; + } + + inline ir_state_slot *allocate_state_slots(unsigned n) + { + assert(!this->is_interface_instance()); + + this->u.state_slots = ralloc_array(this, ir_state_slot, n); + this->data._num_state_slots = 0; + + if (this->u.state_slots != NULL) + this->data._num_state_slots = n; + + return this->u.state_slots; + } + + inline bool is_name_ralloced() const + { + return this->name != ir_variable::tmp_name; + } + + /** + * Enable emitting extension warnings for this variable + */ + void enable_extension_warning(const char *extension); + + /** + * Get the extension warning string for this variable + * + * If warnings are not enabled, \c NULL is returned. + */ + const char *get_extension_warning() const; + /** * Declared type of the variable */ @@ -510,19 +612,6 @@ public: */ const char *name; - /** - * For variables which satisfy the is_interface_instance() predicate, this - * points to an array of integers such that if the ith member of the - * interface block is an array, max_ifc_array_access[i] is the maximum - * array element of that member that has been accessed. If the ith member - * of the interface block is not an array, max_ifc_array_access[i] is - * unused. - * - * For variables whose type is not an interface block, this pointer is - * NULL. - */ - unsigned *max_ifc_array_access; - struct ir_variable_data { /** @@ -535,6 +624,7 @@ public: unsigned centroid:1; unsigned sample:1; unsigned invariant:1; + unsigned precise:1; /** * Has this variable been used for reading or writing? @@ -634,6 +724,11 @@ public: */ unsigned location_frac:2; + /** + * Layout of the matrix. Uses glsl_matrix_layout values. + */ + unsigned matrix_layout:2; + /** * Non-zero if this variable was created by lowering a named interface * block which was not an array. @@ -652,13 +747,66 @@ public: */ unsigned from_named_ifc_block_array:1; + /** + * Non-zero if the variable must be a shader input. This is useful for + * constraints on function parameters. + */ + unsigned must_be_shader_input:1; + + /** + * Output index for dual source blending. + * + * \note + * The GLSL spec only allows the values 0 or 1 for the index in \b dual + * source blending. + */ + unsigned index:1; + /** * \brief Layout qualifier for gl_FragDepth. * * This is not equal to \c ir_depth_layout_none if and only if this * variable is \c gl_FragDepth and a layout qualifier is specified. */ - ir_depth_layout depth_layout; + ir_depth_layout depth_layout:3; + + /** + * ARB_shader_image_load_store qualifiers. + */ + unsigned image_read_only:1; /**< "readonly" qualifier. */ + unsigned image_write_only:1; /**< "writeonly" qualifier. */ + unsigned image_coherent:1; + unsigned image_volatile:1; + unsigned image_restrict:1; + + /** + * Emit a warning if this variable is accessed. + */ + private: + uint8_t warn_extension_index; + + public: + /** Image internal format if specified explicitly, otherwise GL_NONE. */ + uint16_t image_format; + + private: + /** + * Number of state slots used + * + * \note + * This could be stored in as few as 7-bits, if necessary. If it is made + * smaller, add an assertion to \c ir_variable::allocate_state_slots to + * be safe. + */ + uint16_t _num_state_slots; + + public: + /** + * Initial binding point for a sampler, atomic, or UBO. + * + * For array types, this represents the binding point for the first element. + */ + int16_t binding; /** * Storage location of the base of this variable @@ -681,39 +829,17 @@ public: int location; /** - * output index for dual source blending. + * Vertex stream output identifier. */ - int index; - - /** - * Initial binding point for a sampler or UBO. - * - * For array types, this represents the binding point for the first element. - */ - int binding; + unsigned stream; /** * Location an atomic counter is stored at. */ struct { - unsigned buffer_index; unsigned offset; } atomic; - /** - * ARB_shader_image_load_store qualifiers. - */ - struct { - bool read_only; /**< "readonly" qualifier. */ - bool write_only; /**< "writeonly" qualifier. */ - bool coherent; - bool _volatile; - bool restrict_flag; - - /** Image internal format if specified explicitly, otherwise GL_NONE. */ - GLenum format; - } image; - /** * Highest element accessed with a constant expression array index * @@ -721,29 +847,12 @@ public: */ unsigned max_array_access; + /** + * Allow (only) ir_variable direct access private members. + */ + friend class ir_variable; } data; - /** - * Built-in state that backs this uniform - * - * Once set at variable creation, \c state_slots must remain invariant. - * This is because, ideally, this array would be shared by all clones of - * this variable in the IR tree. In other words, we'd really like for it - * to be a fly-weight. - * - * If the variable is not a uniform, \c num_state_slots will be zero and - * \c state_slots will be \c NULL. - */ - /*@{*/ - unsigned num_state_slots; /**< Number of state slots used */ - ir_state_slot *state_slots; /**< State descriptors. */ - /*@}*/ - - /** - * Emit a warning if this variable is accessed. - */ - const char *warn_extension; - /** * Value assigned in the initializer of a variable declared "const" */ @@ -760,6 +869,33 @@ public: ir_constant *constant_initializer; private: + static const char *const warn_extension_table[]; + + union { + /** + * For variables which satisfy the is_interface_instance() predicate, + * this points to an array of integers such that if the ith member of + * the interface block is an array, max_ifc_array_access[i] is the + * maximum array element of that member that has been accessed. If the + * ith member of the interface block is not an array, + * max_ifc_array_access[i] is unused. + * + * For variables whose type is not an interface block, this pointer is + * NULL. + */ + unsigned *max_ifc_array_access; + + /** + * Built-in state that backs this uniform + * + * Once set at variable creation, \c state_slots must remain invariant. + * + * If the variable is not a uniform, \c _num_state_slots will be zero + * and \c state_slots will be \c NULL. + */ + ir_state_slot *state_slots; + } u; + /** * For variables that are in an interface block or are an instance of an * interface block, this is the \c GLSL_TYPE_INTERFACE type for that block. @@ -767,6 +903,30 @@ private: * \sa ir_variable::location */ const glsl_type *interface_type; + + /** + * Name used for anonymous compiler temporaries + */ + static const char tmp_name[]; + +public: + /** + * Should the construct keep names for ir_var_temporary variables? + * + * When this global is false, names passed to the constructor for + * \c ir_var_temporary variables will be dropped. Instead, the variable will + * be named "compiler_temp". This name will be in static storage. + * + * \warning + * \b NEVER change the mode of an \c ir_var_temporary. + * + * \warning + * This variable is \b not thread-safe. It is global, \b not + * per-context. It begins life false. A context can, at some point, make + * it true. From that point on, it will be true forever. This should be + * okay since it will only be set true while debugging. + */ + static bool temporaries_allocate_names; }; /** @@ -919,11 +1079,6 @@ public: virtual ir_function *clone(void *mem_ctx, struct hash_table *ht) const; - virtual ir_function *as_function() - { - return this; - } - virtual void accept(ir_visitor *v) { v->visit(this); @@ -943,6 +1098,7 @@ public: */ ir_function_signature *matching_signature(_mesa_glsl_parse_state *state, const exec_list *actual_param, + bool allow_builtins, bool *match_is_exact); /** @@ -950,7 +1106,8 @@ public: * conversions into account. */ ir_function_signature *matching_signature(_mesa_glsl_parse_state *state, - const exec_list *actual_param); + const exec_list *actual_param, + bool allow_builtins); /** * Find a signature that exactly matches a set of actual parameters without @@ -986,18 +1143,12 @@ inline const char *ir_function_signature::function_name() const class ir_if : public ir_instruction { public: ir_if(ir_rvalue *condition) - : condition(condition) + : ir_instruction(ir_type_if), condition(condition) { - ir_type = ir_type_if; } virtual ir_if *clone(void *mem_ctx, struct hash_table *ht) const; - virtual ir_if *as_if() - { - return this; - } - virtual void accept(ir_visitor *v) { v->visit(this); @@ -1029,11 +1180,6 @@ public: virtual ir_visitor_status accept(ir_hierarchical_visitor *); - virtual ir_loop *as_loop() - { - return this; - } - /** List of ir_instruction that make up the body of the loop. */ exec_list body_instructions; }; @@ -1064,11 +1210,6 @@ public: virtual ir_visitor_status accept(ir_hierarchical_visitor *); - virtual ir_assignment * as_assignment() - { - return this; - } - /** * Get a whole variable written by an assignment * @@ -1184,7 +1325,11 @@ enum ir_expression_operation { */ /*@{*/ ir_unop_dFdx, + ir_unop_dFdx_coarse, + ir_unop_dFdx_fine, ir_unop_dFdy, + ir_unop_dFdy_coarse, + ir_unop_dFdy_fine, /*@}*/ /** @@ -1223,12 +1368,20 @@ enum ir_expression_operation { ir_unop_find_lsb, /*@}*/ + ir_unop_saturate, ir_unop_noise, + /** + * Interpolate fs input at centroid + * + * operand0 is the fs input. + */ + ir_unop_interpolate_at_centroid, + /** * A sentinel marking the last of the unary operations. */ - ir_last_unop = ir_unop_noise, + ir_last_unop = ir_unop_interpolate_at_centroid, ir_binop_add, ir_binop_sub, @@ -1346,10 +1499,26 @@ enum ir_expression_operation { */ ir_binop_vector_extract, + /** + * Interpolate fs input at offset + * + * operand0 is the fs input + * operand1 is the offset from the pixel center + */ + ir_binop_interpolate_at_offset, + + /** + * Interpolate fs input at sample position + * + * operand0 is the fs input + * operand1 is the sample ID + */ + ir_binop_interpolate_at_sample, + /** * A sentinel marking the last of the binary operations. */ - ir_last_binop = ir_binop_vector_extract, + ir_last_binop = ir_binop_interpolate_at_sample, /** * \name Fused floating-point multiply-add, part of ARB_gpu_shader5. @@ -1434,11 +1603,6 @@ public: */ ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1, ir_rvalue *op2); - virtual ir_expression *as_expression() - { - return this; - } - virtual bool equals(ir_instruction *ir, enum ir_node_type ignore = ir_type_unset); virtual ir_expression *clone(void *mem_ctx, struct hash_table *ht) const; @@ -1469,6 +1633,18 @@ public: ? this->type->vector_elements : get_num_operands(operation); } + /** + * Return whether the expression operates on vectors horizontally. + */ + bool is_horizontal() const + { + return operation == ir_binop_all_equal || + operation == ir_binop_any_nequal || + operation == ir_unop_any || + operation == ir_binop_dot || + operation == ir_quadop_vector; + } + /** * Return a string representing this expression's operator. */ @@ -1506,9 +1682,8 @@ public: ir_call(ir_function_signature *callee, ir_dereference_variable *return_deref, exec_list *actual_parameters) - : return_deref(return_deref), callee(callee) + : ir_instruction(ir_type_call), return_deref(return_deref), callee(callee) { - ir_type = ir_type_call; assert(callee->return_type != NULL); actual_parameters->move_nodes_to(& this->actual_parameters); this->use_builtin = callee->is_builtin(); @@ -1518,11 +1693,6 @@ public: virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL); - virtual ir_call *as_call() - { - return this; - } - virtual void accept(ir_visitor *v) { v->visit(this); @@ -1571,39 +1741,26 @@ public: /*@{*/ class ir_jump : public ir_instruction { protected: - ir_jump() + ir_jump(enum ir_node_type t) + : ir_instruction(t) { - ir_type = ir_type_unset; - } - -public: - virtual ir_jump *as_jump() - { - return this; } }; class ir_return : public ir_jump { public: ir_return() - : value(NULL) + : ir_jump(ir_type_return), value(NULL) { - this->ir_type = ir_type_return; } ir_return(ir_rvalue *value) - : value(value) + : ir_jump(ir_type_return), value(value) { - this->ir_type = ir_type_return; } virtual ir_return *clone(void *mem_ctx, struct hash_table *) const; - virtual ir_return *as_return() - { - return this; - } - ir_rvalue *get_value() const { return value; @@ -1636,8 +1793,8 @@ public: }; ir_loop_jump(jump_mode mode) + : ir_jump(ir_type_loop_jump) { - this->ir_type = ir_type_loop_jump; this->mode = mode; } @@ -1670,14 +1827,14 @@ public: class ir_discard : public ir_jump { public: ir_discard() + : ir_jump(ir_type_discard) { - this->ir_type = ir_type_discard; this->condition = NULL; } ir_discard(ir_rvalue *cond) + : ir_jump(ir_type_discard) { - this->ir_type = ir_type_discard; this->condition = cond; } @@ -1690,11 +1847,6 @@ public: virtual ir_visitor_status accept(ir_hierarchical_visitor *); - virtual ir_discard *as_discard() - { - return this; - } - ir_rvalue *condition; }; /*@}*/ @@ -1742,10 +1894,10 @@ enum ir_texture_opcode { class ir_texture : public ir_rvalue { public: ir_texture(enum ir_texture_opcode op) - : ir_rvalue(glsl_precision_low), op(op), sampler(NULL), coordinate(NULL), + : ir_rvalue(ir_type_texture, glsl_precision_low), + op(op), sampler(NULL), coordinate(NULL), offset(NULL) { - this->ir_type = ir_type_texture; memset(&lod_info, 0, sizeof(lod_info)); } @@ -1758,11 +1910,6 @@ public: v->visit(this); } - virtual ir_texture *as_texture() - { - return this; - } - virtual ir_visitor_status accept(ir_hierarchical_visitor *); virtual bool equals(ir_instruction *ir, enum ir_node_type ignore = ir_type_unset); @@ -1837,11 +1984,6 @@ public: virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL); - virtual ir_swizzle *as_swizzle() - { - return this; - } - /** * Construct an ir_swizzle from the textual representation. Can fail. */ @@ -1883,11 +2025,6 @@ class ir_dereference : public ir_rvalue { public: virtual ir_dereference *clone(void *mem_ctx, struct hash_table *) const = 0; - virtual ir_dereference *as_dereference() - { - return this; - } - bool is_lvalue() const; /** @@ -1895,17 +2032,8 @@ public: */ virtual ir_variable *variable_referenced() const = 0; - /** - * Get the constant that is ultimately referenced by an r-value, - * in a constant expression evaluation context. - * - * The offset is used when the reference is to a specific column of - * a matrix. - */ - virtual void constant_referenced(struct hash_table *variable_context, ir_constant *&store, int &offset) const = 0; - protected: - ir_dereference(glsl_precision precision) : ir_rvalue(precision) { } + ir_dereference(ir_node_type t, glsl_precision precision) : ir_rvalue(t, precision) { } }; @@ -1918,11 +2046,6 @@ public: virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL); - virtual ir_dereference_variable *as_dereference_variable() - { - return this; - } - virtual bool equals(ir_instruction *ir, enum ir_node_type ignore = ir_type_unset); /** @@ -1933,15 +2056,6 @@ public: return this->var; } - /** - * Get the constant that is ultimately referenced by an r-value, - * in a constant expression evaluation context. - * - * The offset is used when the reference is to a specific column of - * a matrix. - */ - virtual void constant_referenced(struct hash_table *variable_context, ir_constant *&store, int &offset) const; - virtual ir_variable *whole_variable_referenced() { /* ir_dereference_variable objects always dereference the entire @@ -1978,11 +2092,6 @@ public: virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL); - virtual ir_dereference_array *as_dereference_array() - { - return this; - } - virtual bool equals(ir_instruction *ir, enum ir_node_type ignore = ir_type_unset); /** @@ -1993,15 +2102,6 @@ public: return this->array->variable_referenced(); } - /** - * Get the constant that is ultimately referenced by an r-value, - * in a constant expression evaluation context. - * - * The offset is used when the reference is to a specific column of - * a matrix. - */ - virtual void constant_referenced(struct hash_table *variable_context, ir_constant *&store, int &offset) const; - virtual void accept(ir_visitor *v) { v->visit(this); @@ -2028,11 +2128,6 @@ public: virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL); - virtual ir_dereference_record *as_dereference_record() - { - return this; - } - /** * Get the variable that is ultimately referenced by an r-value */ @@ -2041,15 +2136,6 @@ public: return this->record->variable_referenced(); } - /** - * Get the constant that is ultimately referenced by an r-value, - * in a constant expression evaluation context. - * - * The offset is used when the reference is to a specific column of - * a matrix. - */ - virtual void constant_referenced(struct hash_table *variable_context, ir_constant *&store, int &offset) const; - virtual void accept(ir_visitor *v) { v->visit(this); @@ -2107,11 +2193,6 @@ public: virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL); - virtual ir_constant *as_constant() - { - return this; - } - virtual void accept(ir_visitor *v) { v->visit(this); @@ -2183,6 +2264,14 @@ public: virtual bool is_negative_one() const; virtual bool is_basis() const; + /** + * Return true for constants that could be stored as 16-bit unsigned values. + * + * Note that this will return true even for signed integer ir_constants, as + * long as the value is non-negative and fits in 16-bits. + */ + virtual bool is_uint16_constant() const; + /** * Value of the constant. * @@ -2209,6 +2298,7 @@ private: class ir_precision_statement : public ir_instruction { public: ir_precision_statement(const char *statement_to_store) + : ir_instruction(ir_type_precision) { ir_type = ir_type_precision; precision_statement = statement_to_store; @@ -2233,6 +2323,7 @@ public: class ir_typedecl_statement : public ir_instruction { public: ir_typedecl_statement(const glsl_type* type_decl) + : ir_instruction(ir_type_typedecl) { this->ir_type = ir_type_typedecl; this->type_decl = type_decl; @@ -2252,16 +2343,16 @@ public: -/*@}*/ - /** * IR instruction to emit a vertex in a geometry shader. */ class ir_emit_vertex : public ir_instruction { public: - ir_emit_vertex() + ir_emit_vertex(ir_rvalue *stream) + : ir_instruction(ir_type_emit_vertex), + stream(stream) { - ir_type = ir_type_emit_vertex; + assert(stream); } virtual void accept(ir_visitor *v) @@ -2269,12 +2360,19 @@ public: v->visit(this); } - virtual ir_emit_vertex *clone(void *mem_ctx, struct hash_table *) const + virtual ir_emit_vertex *clone(void *mem_ctx, struct hash_table *ht) const { - return new(mem_ctx) ir_emit_vertex(); + return new(mem_ctx) ir_emit_vertex(this->stream->clone(mem_ctx, ht)); } virtual ir_visitor_status accept(ir_hierarchical_visitor *); + + int stream_id() const + { + return stream->as_constant()->value.i[0]; + } + + ir_rvalue *stream; }; /** @@ -2283,9 +2381,11 @@ public: */ class ir_end_primitive : public ir_instruction { public: - ir_end_primitive() + ir_end_primitive(ir_rvalue *stream) + : ir_instruction(ir_type_end_primitive), + stream(stream) { - ir_type = ir_type_end_primitive; + assert(stream); } virtual void accept(ir_visitor *v) @@ -2293,14 +2393,23 @@ public: v->visit(this); } - virtual ir_end_primitive *clone(void *mem_ctx, struct hash_table *) const + virtual ir_end_primitive *clone(void *mem_ctx, struct hash_table *ht) const { - return new(mem_ctx) ir_end_primitive(); + return new(mem_ctx) ir_end_primitive(this->stream->clone(mem_ctx, ht)); } virtual ir_visitor_status accept(ir_hierarchical_visitor *); + + int stream_id() const + { + return stream->as_constant()->value.i[0]; + } + + ir_rvalue *stream; }; +/*@}*/ + /** * Apply a visitor to each IR node in a list */ @@ -2394,12 +2503,24 @@ prototype_string(const glsl_type *return_type, const char *name, const char * mode_string(const ir_variable *var); +/** + * Built-in / reserved GL variables names start with "gl_" + */ +static inline bool +is_gl_identifier(const char *s) +{ + return s && s[0] == 'g' && s[1] == 'l' && s[2] == '_'; +} + extern "C" { #endif /* __cplusplus */ -extern void _mesa_print_ir(struct exec_list *instructions, +extern void _mesa_print_ir(FILE *f, struct exec_list *instructions, struct _mesa_glsl_parse_state *state); +extern void +fprint_ir(FILE *f, const void *instruction); + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_basic_block.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_basic_block.cpp index 5076aa514..ef37eba73 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_basic_block.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_basic_block.cpp @@ -28,9 +28,7 @@ */ #include "ir.h" -#include "ir_visitor.h" #include "ir_basic_block.h" -#include "glsl_types.h" static ir_if* as_if_skip_discard (ir_instruction* ir) @@ -43,8 +41,7 @@ static ir_if* as_if_skip_discard (ir_instruction* ir) bool only_discards = true; int count = 0; - foreach_list(node, &irif->then_instructions) { - ir_instruction *iir = (ir_instruction *)node; + foreach_in_list(ir_instruction, iir, &irif->then_instructions) { if (!iir->as_discard()) { only_discards = false; @@ -85,8 +82,7 @@ void call_for_basic_blocks(exec_list *instructions, ir_instruction *leader = NULL; ir_instruction *last = NULL; - foreach_list(n, instructions) { - ir_instruction *ir = (ir_instruction *) n; + foreach_in_list(ir_instruction, ir, instructions) { ir_if *ir_if; ir_loop *ir_loop; ir_function *ir_function; @@ -117,9 +113,7 @@ void call_for_basic_blocks(exec_list *instructions, * and the body of main(). Perhaps those instructions ought * to live inside of main(). */ - foreach_list(func_node, &ir_function->signatures) { - ir_function_signature *ir_sig = (ir_function_signature *) func_node; - + foreach_in_list(ir_function_signature, ir_sig, &ir_function->signatures) { call_for_basic_blocks(&ir_sig->body, callback, data); } } diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_builder.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_builder.cpp index 83812d1be..b3b5cb06b 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_builder.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_builder.cpp @@ -35,11 +35,11 @@ ir_factory::emit(ir_instruction *ir) } ir_variable * -ir_factory::make_temp(const glsl_type *type, const char *name) +ir_factory::make_temp(const glsl_type *type, const char *name, glsl_precision prec) { ir_variable *var; - var = new(mem_ctx) ir_variable(type, name, ir_var_temporary, glsl_precision_undefined); + var = new(mem_ctx) ir_variable(type, name, ir_var_temporary, prec); emit(var); return var; @@ -251,13 +251,8 @@ ir_expression *round_even(operand a) return expr(ir_unop_round_even, a); } -ir_expression *dot(operand a, operand b) -{ - return expr(ir_binop_dot, a, b); -} - /* dot for vectors, mul for scalars */ -ir_expression *dotlike(operand a, operand b) +ir_expression *dot(operand a, operand b) { assert(a.val->type == b.val->type); @@ -276,11 +271,7 @@ clamp(operand a, operand b, operand c) ir_expression * saturate(operand a) { - void *mem_ctx = ralloc_parent(a.val); - - return expr(ir_binop_max, - expr(ir_binop_min, a, new(mem_ctx) ir_constant(1.0f)), - new(mem_ctx) ir_constant(0.0f)); + return expr(ir_unop_saturate, a); } ir_expression * @@ -505,6 +496,24 @@ b2f(operand a) return expr(ir_unop_b2f, a); } +ir_expression * +interpolate_at_centroid(operand a) +{ + return expr(ir_unop_interpolate_at_centroid, a); +} + +ir_expression * +interpolate_at_offset(operand a, operand b) +{ + return expr(ir_binop_interpolate_at_offset, a, b); +} + +ir_expression * +interpolate_at_sample(operand a, operand b) +{ + return expr(ir_binop_interpolate_at_sample, a, b); +} + ir_expression * fma(operand a, operand b, operand c) { diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_builder.h b/3rdparty/glsl-optimizer/src/glsl/ir_builder.h index f00e6f3b3..a39ce9997 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_builder.h +++ b/3rdparty/glsl-optimizer/src/glsl/ir_builder.h @@ -90,7 +90,7 @@ public: } void emit(ir_instruction *ir); - ir_variable *make_temp(const glsl_type *type, const char *name); + ir_variable *make_temp(const glsl_type *type, const char *name, glsl_precision prec = glsl_precision_undefined); ir_constant* constant(float f) @@ -139,7 +139,6 @@ ir_expression *carry(operand a, operand b); ir_expression *borrow(operand a, operand b); ir_expression *round_even(operand a); ir_expression *dot(operand a, operand b); -ir_expression *dotlike(operand a, operand b); ir_expression *clamp(operand a, operand b, operand c); ir_expression *saturate(operand a); ir_expression *abs(operand a); @@ -187,6 +186,10 @@ ir_expression *b2f(operand a); ir_expression *min2(operand a, operand b); ir_expression *max2(operand a, operand b); +ir_expression *interpolate_at_centroid(operand a); +ir_expression *interpolate_at_offset(operand a, operand b); +ir_expression *interpolate_at_sample(operand a, operand b); + ir_expression *fma(operand a, operand b, operand c); ir_expression *lrp(operand x, operand y, operand a); ir_expression *csel(operand a, operand b, operand c); diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_clone.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_clone.cpp index 10f750222..a32a83645 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_clone.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_clone.cpp @@ -28,7 +28,7 @@ #include "program/hash_table.h" ir_rvalue * -ir_rvalue::clone(void *mem_ctx, struct hash_table *ht) const +ir_rvalue::clone(void *mem_ctx, struct hash_table *) const { /* The only possible instantiation is the generic error value. */ return error_value(mem_ctx); @@ -45,25 +45,18 @@ ir_variable::clone(void *mem_ctx, struct hash_table *ht) const var->data.max_array_access = this->data.max_array_access; if (this->is_interface_instance()) { - var->max_ifc_array_access = + var->u.max_ifc_array_access = rzalloc_array(var, unsigned, this->interface_type->length); - memcpy(var->max_ifc_array_access, this->max_ifc_array_access, + memcpy(var->u.max_ifc_array_access, this->u.max_ifc_array_access, this->interface_type->length * sizeof(unsigned)); } memcpy(&var->data, &this->data, sizeof(var->data)); - var->warn_extension = this->warn_extension; - - var->num_state_slots = this->num_state_slots; - if (this->state_slots) { - /* FINISHME: This really wants to use something like talloc_reference, but - * FINISHME: ralloc doesn't have any similar function. - */ - var->state_slots = ralloc_array(var, ir_state_slot, - this->num_state_slots); - memcpy(var->state_slots, this->state_slots, - sizeof(this->state_slots[0]) * var->num_state_slots); + if (this->get_state_slots()) { + ir_state_slot *s = var->allocate_state_slots(this->get_num_state_slots()); + memcpy(s, this->get_state_slots(), + sizeof(s[0]) * var->get_num_state_slots()); } if (this->constant_value) @@ -125,13 +118,11 @@ ir_if::clone(void *mem_ctx, struct hash_table *ht) const { ir_if *new_if = new(mem_ctx) ir_if(this->condition->clone(mem_ctx, ht)); - foreach_list(n, &this->then_instructions) { - ir_instruction *ir = (ir_instruction *) n; + foreach_in_list(ir_instruction, ir, &this->then_instructions) { new_if->then_instructions.push_tail(ir->clone(mem_ctx, ht)); } - foreach_list(n, &this->else_instructions) { - ir_instruction *ir = (ir_instruction *) n; + foreach_in_list(ir_instruction, ir, &this->else_instructions) { new_if->else_instructions.push_tail(ir->clone(mem_ctx, ht)); } @@ -143,8 +134,7 @@ ir_loop::clone(void *mem_ctx, struct hash_table *ht) const { ir_loop *new_loop = new(mem_ctx) ir_loop(); - foreach_list(n, &this->body_instructions) { - ir_instruction *ir = (ir_instruction *) n; + foreach_in_list(ir_instruction, ir, &this->body_instructions) { new_loop->body_instructions.push_tail(ir->clone(mem_ctx, ht)); } @@ -160,8 +150,7 @@ ir_call::clone(void *mem_ctx, struct hash_table *ht) const exec_list new_parameters; - foreach_list(n, &this->actual_parameters) { - ir_instruction *ir = (ir_instruction *) n; + foreach_in_list(ir_instruction, ir, &this->actual_parameters) { new_parameters.push_tail(ir->clone(mem_ctx, ht)); } @@ -267,10 +256,12 @@ ir_assignment::clone(void *mem_ctx, struct hash_table *ht) const if (this->condition) new_condition = this->condition->clone(mem_ctx, ht); - return new(mem_ctx) ir_assignment(this->lhs->clone(mem_ctx, ht), - this->rhs->clone(mem_ctx, ht), - new_condition, - this->write_mask); + ir_assignment *cloned = + new(mem_ctx) ir_assignment(this->lhs->clone(mem_ctx, ht), + this->rhs->clone(mem_ctx, ht), + new_condition); + cloned->write_mask = this->write_mask; + return cloned; } ir_function * @@ -278,10 +269,7 @@ ir_function::clone(void *mem_ctx, struct hash_table *ht) const { ir_function *copy = new(mem_ctx) ir_function(this->name); - foreach_list_const(node, &this->signatures) { - const ir_function_signature *const sig = - (const ir_function_signature *const) node; - + foreach_in_list(const ir_function_signature, sig, &this->signatures) { ir_function_signature *sig_copy = sig->clone(mem_ctx, ht); copy->add_signature(sig_copy); @@ -302,9 +290,7 @@ ir_function_signature::clone(void *mem_ctx, struct hash_table *ht) const /* Clone the instruction list. */ - foreach_list_const(node, &this->body) { - const ir_instruction *const inst = (const ir_instruction *) node; - + foreach_in_list(const ir_instruction, inst, &this->body) { ir_instruction *const inst_copy = inst->clone(mem_ctx, ht); copy->body.push_tail(inst_copy); } @@ -324,9 +310,7 @@ ir_function_signature::clone_prototype(void *mem_ctx, struct hash_table *ht) con /* Clone the parameter list, but NOT the body. */ - foreach_list_const(node, &this->parameters) { - const ir_variable *const param = (const ir_variable *) node; - + foreach_in_list(const ir_variable, param, &this->parameters) { assert(const_cast(param)->as_variable() != NULL); ir_variable *const param_copy = param->clone(mem_ctx, ht); @@ -444,8 +428,7 @@ clone_ir_list(void *mem_ctx, exec_list *out, const exec_list *in) struct hash_table *ht = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare); - foreach_list_const(node, in) { - const ir_instruction *const original = (ir_instruction *) node; + foreach_in_list(const ir_instruction, original, in) { ir_instruction *copy = original->clone(mem_ctx, ht); out->push_tail(copy); diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_constant_expression.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_constant_expression.cpp index b0fb1b4e0..40954299e 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_constant_expression.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_constant_expression.cpp @@ -36,7 +36,6 @@ #include #include "main/core.h" /* for MAX2, MIN2, CLAMP */ #include "ir.h" -#include "ir_visitor.h" #include "glsl_types.h" #include "program/hash_table.h" @@ -53,7 +52,7 @@ static int isnormal(double x) } #endif -#if defined(_MSC_VER) +#if defined(_MSC_VER) && _MSC_VER < 1800 static double copysign(double x, double y) { return _copysign(x, y); @@ -386,8 +385,104 @@ unpack_half_1x16(uint16_t u) return _mesa_half_to_float(u); } +/** + * Get the constant that is ultimately referenced by an r-value, in a constant + * expression evaluation context. + * + * The offset is used when the reference is to a specific column of a matrix. + */ +static bool +constant_referenced(const ir_dereference *deref, + struct hash_table *variable_context, + ir_constant *&store, int &offset) +{ + store = NULL; + offset = 0; + + if (variable_context == NULL) + return false; + + switch (deref->ir_type) { + case ir_type_dereference_array: { + const ir_dereference_array *const da = + (const ir_dereference_array *) deref; + + ir_constant *const index_c = + da->array_index->constant_expression_value(variable_context); + + if (!index_c || !index_c->type->is_scalar() || !index_c->type->is_integer()) + break; + + const int index = index_c->type->base_type == GLSL_TYPE_INT ? + index_c->get_int_component(0) : + index_c->get_uint_component(0); + + ir_constant *substore; + int suboffset; + + const ir_dereference *const deref = da->array->as_dereference(); + if (!deref) + break; + + if (!constant_referenced(deref, variable_context, substore, suboffset)) + break; + + const glsl_type *const vt = da->array->type; + if (vt->is_array()) { + store = substore->get_array_element(index); + offset = 0; + } else if (vt->is_matrix()) { + store = substore; + offset = index * vt->vector_elements; + } else if (vt->is_vector()) { + store = substore; + offset = suboffset + index; + } + + break; + } + + case ir_type_dereference_record: { + const ir_dereference_record *const dr = + (const ir_dereference_record *) deref; + + const ir_dereference *const deref = dr->record->as_dereference(); + if (!deref) + break; + + ir_constant *substore; + int suboffset; + + if (!constant_referenced(deref, variable_context, substore, suboffset)) + break; + + /* Since we're dropping it on the floor... + */ + assert(suboffset == 0); + + store = substore->get_record_field(dr->field); + break; + } + + case ir_type_dereference_variable: { + const ir_dereference_variable *const dv = + (const ir_dereference_variable *) deref; + + store = (ir_constant *) hash_table_find(variable_context, dv->var); + break; + } + + default: + assert(!"Should not get here."); + break; + } + + return store != NULL; +} + + ir_constant * -ir_rvalue::constant_expression_value(struct hash_table *variable_context) +ir_rvalue::constant_expression_value(struct hash_table *) { assert(this->type->is_error()); return NULL; @@ -415,6 +510,8 @@ ir_expression::constant_expression_value(struct hash_table *variable_context) case ir_binop_lshift: case ir_binop_rshift: case ir_binop_ldexp: + case ir_binop_interpolate_at_offset: + case ir_binop_interpolate_at_sample: case ir_binop_vector_extract: case ir_triop_csel: case ir_triop_bitfield_extract: @@ -771,7 +868,11 @@ ir_expression::constant_expression_value(struct hash_table *variable_context) break; case ir_unop_dFdx: + case ir_unop_dFdx_coarse: + case ir_unop_dFdx_fine: case ir_unop_dFdy: + case ir_unop_dFdy_coarse: + case ir_unop_dFdy_fine: assert(op[0]->type->base_type == GLSL_TYPE_FLOAT); for (unsigned c = 0; c < op[0]->type->components(); c++) { data.f[c] = 0.0; @@ -1385,6 +1486,12 @@ ir_expression::constant_expression_value(struct hash_table *variable_context) } break; + case ir_unop_saturate: + for (unsigned c = 0; c < components; c++) { + data.f[c] = CLAMP(op[0]->value.f[c], 0.0f, 1.0f); + } + break; + case ir_triop_bitfield_extract: { int offset = op[1]->value.i[0]; int bits = op[2]->value.i[0]; @@ -1551,7 +1658,7 @@ ir_expression::constant_expression_value(struct hash_table *variable_context) ir_constant * -ir_texture::constant_expression_value(struct hash_table *variable_context) +ir_texture::constant_expression_value(struct hash_table *) { /* texture lookups aren't constant expressions */ return NULL; @@ -1587,19 +1694,6 @@ ir_swizzle::constant_expression_value(struct hash_table *variable_context) } -void -ir_dereference_variable::constant_referenced(struct hash_table *variable_context, - ir_constant *&store, int &offset) const -{ - if (variable_context) { - store = (ir_constant *)hash_table_find(variable_context, var); - offset = 0; - } else { - store = NULL; - offset = 0; - } -} - ir_constant * ir_dereference_variable::constant_expression_value(struct hash_table *variable_context) { @@ -1627,60 +1721,6 @@ ir_dereference_variable::constant_expression_value(struct hash_table *variable_c } -void -ir_dereference_array::constant_referenced(struct hash_table *variable_context, - ir_constant *&store, int &offset) const -{ - ir_constant *index_c = array_index->constant_expression_value(variable_context); - - if (!index_c || !index_c->type->is_scalar() || !index_c->type->is_integer()) { - store = 0; - offset = 0; - return; - } - - int index = index_c->type->base_type == GLSL_TYPE_INT ? - index_c->get_int_component(0) : - index_c->get_uint_component(0); - - ir_constant *substore; - int suboffset; - const ir_dereference *deref = array->as_dereference(); - if (!deref) { - store = 0; - offset = 0; - return; - } - - deref->constant_referenced(variable_context, substore, suboffset); - - if (!substore) { - store = 0; - offset = 0; - return; - } - - const glsl_type *vt = array->type; - if (vt->is_array()) { - store = substore->get_array_element(index); - offset = 0; - return; - } - if (vt->is_matrix()) { - store = substore; - offset = index * vt->vector_elements; - return; - } - if (vt->is_vector()) { - store = substore; - offset = suboffset + index; - return; - } - - store = 0; - offset = 0; -} - ir_constant * ir_dereference_array::constant_expression_value(struct hash_table *variable_context) { @@ -1736,33 +1776,8 @@ ir_dereference_array::constant_expression_value(struct hash_table *variable_cont } -void -ir_dereference_record::constant_referenced(struct hash_table *variable_context, - ir_constant *&store, int &offset) const -{ - ir_constant *substore; - int suboffset; - const ir_dereference *deref = record->as_dereference(); - if (!deref) { - store = 0; - offset = 0; - return; - } - - deref->constant_referenced(variable_context, substore, suboffset); - - if (!substore) { - store = 0; - offset = 0; - return; - } - - store = substore->get_record_field(field); - offset = 0; -} - ir_constant * -ir_dereference_record::constant_expression_value(struct hash_table *variable_context) +ir_dereference_record::constant_expression_value(struct hash_table *) { ir_constant *v = this->record->constant_expression_value(); @@ -1771,7 +1786,7 @@ ir_dereference_record::constant_expression_value(struct hash_table *variable_con ir_constant * -ir_assignment::constant_expression_value(struct hash_table *variable_context) +ir_assignment::constant_expression_value(struct hash_table *) { /* FINISHME: Handle CEs involving assignment (return RHS) */ return NULL; @@ -1779,7 +1794,7 @@ ir_assignment::constant_expression_value(struct hash_table *variable_context) ir_constant * -ir_constant::constant_expression_value(struct hash_table *variable_context) +ir_constant::constant_expression_value(struct hash_table *) { return this; } @@ -1796,8 +1811,7 @@ bool ir_function_signature::constant_expression_evaluate_expression_list(const s struct hash_table *variable_context, ir_constant **result) { - foreach_list(n, &body) { - ir_instruction *inst = (ir_instruction *)n; + foreach_in_list(ir_instruction, inst, &body) { switch(inst->ir_type) { /* (declare () type symbol) */ @@ -1820,9 +1834,8 @@ bool ir_function_signature::constant_expression_evaluate_expression_list(const s ir_constant *store = NULL; int offset = 0; - asg->lhs->constant_referenced(variable_context, store, offset); - if (!store) + if (!constant_referenced(asg->lhs, variable_context, store, offset)) return false; ir_constant *value = asg->rhs->constant_expression_value(variable_context); @@ -1853,9 +1866,9 @@ bool ir_function_signature::constant_expression_evaluate_expression_list(const s ir_constant *store = NULL; int offset = 0; - call->return_deref->constant_referenced(variable_context, store, offset); - if (!store) + if (!constant_referenced(call->return_deref, variable_context, + store, offset)) return false; ir_constant *value = call->constant_expression_value(variable_context); @@ -1937,8 +1950,8 @@ ir_function_signature::constant_expression_value(exec_list *actual_parameters, s */ const exec_node *parameter_info = origin ? origin->parameters.head : parameters.head; - foreach_list(n, actual_parameters) { - ir_constant *constant = ((ir_rvalue *) n)->constant_expression_value(variable_context); + foreach_in_list(ir_rvalue, n, actual_parameters) { + ir_constant *constant = n->constant_expression_value(variable_context); if (constant == NULL) { hash_table_dtor(deref_hash); return NULL; diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_equals.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_equals.cpp index 92001b745..57a04ecba 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_equals.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_equals.cpp @@ -41,13 +41,13 @@ possibly_null_equals(ir_instruction *a, ir_instruction *b, enum ir_node_type ign * about. */ bool -ir_instruction::equals(ir_instruction *ir, enum ir_node_type) +ir_instruction::equals(ir_instruction *, enum ir_node_type) { return false; } bool -ir_constant::equals(ir_instruction *ir, enum ir_node_type ignore) +ir_constant::equals(ir_instruction *ir, enum ir_node_type) { const ir_constant *other = ir->as_constant(); if (!other) @@ -65,7 +65,7 @@ ir_constant::equals(ir_instruction *ir, enum ir_node_type ignore) } bool -ir_dereference_variable::equals(ir_instruction *ir, enum ir_node_type ignore) +ir_dereference_variable::equals(ir_instruction *ir, enum ir_node_type) { const ir_dereference_variable *other = ir->as_dereference_variable(); if (!other) diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_expression_flattening.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_expression_flattening.cpp index 87af2c970..7108da6bd 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_expression_flattening.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_expression_flattening.cpp @@ -32,10 +32,8 @@ */ #include "ir.h" -#include "ir_visitor.h" #include "ir_rvalue_visitor.h" #include "ir_expression_flattening.h" -#include "glsl_types.h" class ir_expression_flattening_visitor : public ir_rvalue_visitor { public: @@ -59,9 +57,7 @@ do_expression_flattening(exec_list *instructions, { ir_expression_flattening_visitor v(predicate); - foreach_list(n, instructions) { - ir_instruction *ir = (ir_instruction *) n; - + foreach_in_list(ir_instruction, ir, instructions) { ir->accept(&v); } } diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_function.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_function.cpp index 40cf5894a..2b2643c64 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_function.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_function.cpp @@ -23,6 +23,8 @@ #include "glsl_types.h" #include "ir.h" +#include "glsl_parser_extras.h" +#include "main/errors.h" typedef enum { PARAMETER_LIST_NO_MATCH, @@ -38,7 +40,8 @@ typedef enum { * \see matching_signature() */ static parameter_list_match_t -parameter_lists_match(const exec_list *list_a, const exec_list *list_b) +parameter_lists_match(_mesa_glsl_parse_state *state, + const exec_list *list_a, const exec_list *list_b) { const exec_node *node_a = list_a->head; const exec_node *node_b = list_b->head; @@ -79,12 +82,12 @@ parameter_lists_match(const exec_list *list_a, const exec_list *list_b) case ir_var_const_in: case ir_var_function_in: - if (!actual->type->can_implicitly_convert_to(param->type)) + if (!actual->type->can_implicitly_convert_to(param->type, state)) return PARAMETER_LIST_NO_MATCH; break; case ir_var_function_out: - if (!param->type->can_implicitly_convert_to(actual->type)) + if (!param->type->can_implicitly_convert_to(actual->type, state)) return PARAMETER_LIST_NO_MATCH; break; @@ -115,21 +118,188 @@ parameter_lists_match(const exec_list *list_a, const exec_list *list_b) } +/* Classes of parameter match, sorted (mostly) best matches first. + * See is_better_parameter_match() below for the exceptions. + * */ +typedef enum { + PARAMETER_EXACT_MATCH, + PARAMETER_FLOAT_TO_DOUBLE, + PARAMETER_INT_TO_FLOAT, + PARAMETER_INT_TO_DOUBLE, + PARAMETER_OTHER_CONVERSION, +} parameter_match_t; + + +static parameter_match_t +get_parameter_match_type(const ir_variable *param, + const ir_rvalue *actual) +{ + const glsl_type *from_type; + const glsl_type *to_type; + + if (param->data.mode == ir_var_function_out) { + from_type = param->type; + to_type = actual->type; + } else { + from_type = actual->type; + to_type = param->type; + } + + if (from_type == to_type) + return PARAMETER_EXACT_MATCH; + + /* XXX: When ARB_gpu_shader_fp64 support is added, check for float->double, + * and int/uint->double conversions + */ + + if (to_type->base_type == GLSL_TYPE_FLOAT) + return PARAMETER_INT_TO_FLOAT; + + /* int -> uint and any other oddball conversions */ + return PARAMETER_OTHER_CONVERSION; +} + + +static bool +is_better_parameter_match(parameter_match_t a_match, + parameter_match_t b_match) +{ + /* From section 6.1 of the GLSL 4.00 spec (and the ARB_gpu_shader5 spec): + * + * 1. An exact match is better than a match involving any implicit + * conversion. + * + * 2. A match involving an implicit conversion from float to double + * is better than match involving any other implicit conversion. + * + * [XXX: Not in GLSL 4.0: Only in ARB_gpu_shader5: + * 3. A match involving an implicit conversion from either int or uint + * to float is better than a match involving an implicit conversion + * from either int or uint to double.] + * + * If none of the rules above apply to a particular pair of conversions, + * neither conversion is considered better than the other. + * + * -- + * + * Notably, the int->uint conversion is *not* considered to be better + * or worse than int/uint->float or int/uint->double. + */ + + if (a_match >= PARAMETER_INT_TO_FLOAT && b_match == PARAMETER_OTHER_CONVERSION) + return false; + + return a_match < b_match; +} + + +static bool +is_best_inexact_overload(const exec_list *actual_parameters, + ir_function_signature **matches, + int num_matches, + ir_function_signature *sig) +{ + /* From section 6.1 of the GLSL 4.00 spec (and the ARB_gpu_shader5 spec): + * + * "A function definition A is considered a better + * match than function definition B if: + * + * * for at least one function argument, the conversion for that argument + * in A is better than the corresponding conversion in B; and + * + * * there is no function argument for which the conversion in B is better + * than the corresponding conversion in A. + * + * If a single function definition is considered a better match than every + * other matching function definition, it will be used. Otherwise, a + * semantic error occurs and the shader will fail to compile." + */ + for (ir_function_signature **other = matches; + other < matches + num_matches; other++) { + if (*other == sig) + continue; + + const exec_node *node_a = sig->parameters.head; + const exec_node *node_b = (*other)->parameters.head; + const exec_node *node_p = actual_parameters->head; + + bool better_for_some_parameter = false; + + for (/* empty */ + ; !node_a->is_tail_sentinel() + ; node_a = node_a->next, + node_b = node_b->next, + node_p = node_p->next) { + parameter_match_t a_match = get_parameter_match_type( + (const ir_variable *)node_a, + (const ir_rvalue *)node_p); + parameter_match_t b_match = get_parameter_match_type( + (const ir_variable *)node_b, + (const ir_rvalue *)node_p); + + if (is_better_parameter_match(a_match, b_match)) + better_for_some_parameter = true; + + if (is_better_parameter_match(b_match, a_match)) + return false; /* B is better for this parameter */ + } + + if (!better_for_some_parameter) + return false; /* A must be better than B for some parameter */ + + } + + return true; +} + + +static ir_function_signature * +choose_best_inexact_overload(_mesa_glsl_parse_state *state, + const exec_list *actual_parameters, + ir_function_signature **matches, + int num_matches) +{ + if (num_matches == 0) + return NULL; + + if (num_matches == 1) + return *matches; + + /* Without GLSL 4.0 / ARB_gpu_shader5, there is no overload resolution + * among multiple inexact matches. Note that state may be NULL here if + * called from the linker; in that case we assume everything supported in + * any GLSL version is available. */ + if (!state || state->is_version(400, 0) || state->ARB_gpu_shader5_enable) { + for (ir_function_signature **sig = matches; sig < matches + num_matches; sig++) { + if (is_best_inexact_overload(actual_parameters, matches, num_matches, *sig)) + return *sig; + } + } + + return NULL; /* no best candidate */ +} + + ir_function_signature * ir_function::matching_signature(_mesa_glsl_parse_state *state, - const exec_list *actual_parameters) + const exec_list *actual_parameters, + bool allow_builtins) { bool is_exact; - return matching_signature(state, actual_parameters, &is_exact); + return matching_signature(state, actual_parameters, allow_builtins, + &is_exact); } ir_function_signature * ir_function::matching_signature(_mesa_glsl_parse_state *state, const exec_list *actual_parameters, - bool *is_exact) + bool allow_builtins, + bool *is_exact) { + ir_function_signature **inexact_matches = NULL; + ir_function_signature **inexact_matches_temp; ir_function_signature *match = NULL; - bool multiple_inexact_matches = false; + int num_inexact_matches = 0; /* From page 42 (page 49 of the PDF) of the GLSL 1.20 spec: * @@ -141,23 +311,30 @@ ir_function::matching_signature(_mesa_glsl_parse_state *state, * multiple ways to apply these conversions to the actual arguments of a * call such that the call can be made to match multiple signatures." */ - foreach_list(n, &this->signatures) { - ir_function_signature *const sig = (ir_function_signature *) n; - + foreach_in_list(ir_function_signature, sig, &this->signatures) { /* Skip over any built-ins that aren't available in this shader. */ - if (sig->is_builtin() && !sig->is_builtin_available(state)) + if (sig->is_builtin() && (!allow_builtins || + !sig->is_builtin_available(state))) continue; - switch (parameter_lists_match(& sig->parameters, actual_parameters)) { + switch (parameter_lists_match(state, & sig->parameters, actual_parameters)) { case PARAMETER_LIST_EXACT_MATCH: - *is_exact = true; - return sig; + *is_exact = true; + free(inexact_matches); + return sig; case PARAMETER_LIST_INEXACT_MATCH: - if (match == NULL) - match = sig; - else - multiple_inexact_matches = true; - continue; + inexact_matches_temp = (ir_function_signature **) + realloc(inexact_matches, + sizeof(*inexact_matches) * + (num_inexact_matches + 1)); + if (inexact_matches_temp == NULL) { + _mesa_error_no_memory(__func__); + free(inexact_matches); + return NULL; + } + inexact_matches = inexact_matches_temp; + inexact_matches[num_inexact_matches++] = sig; + continue; case PARAMETER_LIST_NO_MATCH: continue; default: @@ -175,9 +352,10 @@ ir_function::matching_signature(_mesa_glsl_parse_state *state, */ *is_exact = false; - if (multiple_inexact_matches) - return NULL; + match = choose_best_inexact_overload(state, actual_parameters, + inexact_matches, num_inexact_matches); + free(inexact_matches); return match; } @@ -211,9 +389,7 @@ ir_function_signature * ir_function::exact_matching_signature(_mesa_glsl_parse_state *state, const exec_list *actual_parameters) { - foreach_list(n, &this->signatures) { - ir_function_signature *const sig = (ir_function_signature *) n; - + foreach_in_list(ir_function_signature, sig, &this->signatures) { /* Skip over any built-ins that aren't available in this shader. */ if (sig->is_builtin() && !sig->is_builtin_available(state)) continue; diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_function_detect_recursion.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_function_detect_recursion.cpp index 5813315b6..b2334d2e4 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_function_detect_recursion.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_function_detect_recursion.cpp @@ -229,15 +229,13 @@ public: static void destroy_links(exec_list *list, function *f) { - foreach_list_safe(node, list) { - struct call_node *n = (struct call_node *) node; - + foreach_in_list_safe(call_node, node, list) { /* If this is the right function, remove it. Note that the loop cannot * terminate now. There can be multiple links to a function if it is * either called multiple times or calls multiple times. */ - if (n->func == f) - n->remove(); + if (node->func == f) + node->remove(); } } diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_hierarchical_visitor.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_hierarchical_visitor.cpp index 1968309dd..69965bcf6 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_hierarchical_visitor.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_hierarchical_visitor.cpp @@ -27,16 +27,18 @@ ir_hierarchical_visitor::ir_hierarchical_visitor() { this->base_ir = NULL; - this->callback = NULL; - this->data = NULL; + this->callback_enter = NULL; + this->callback_leave = NULL; + this->data_enter = NULL; + this->data_leave = NULL; this->in_assignee = false; } ir_visitor_status ir_hierarchical_visitor::visit(ir_rvalue *ir) { - if (this->callback != NULL) - this->callback(ir, this->data); + if (this->callback_enter != NULL) + this->callback_enter(ir, this->data_enter); return visit_continue; } @@ -44,8 +46,8 @@ ir_hierarchical_visitor::visit(ir_rvalue *ir) ir_visitor_status ir_hierarchical_visitor::visit(ir_variable *ir) { - if (this->callback != NULL) - this->callback(ir, this->data); + if (this->callback_enter != NULL) + this->callback_enter(ir, this->data_enter); return visit_continue; } @@ -53,8 +55,8 @@ ir_hierarchical_visitor::visit(ir_variable *ir) ir_visitor_status ir_hierarchical_visitor::visit(ir_constant *ir) { - if (this->callback != NULL) - this->callback(ir, this->data); + if (this->callback_enter != NULL) + this->callback_enter(ir, this->data_enter); return visit_continue; } @@ -62,8 +64,8 @@ ir_hierarchical_visitor::visit(ir_constant *ir) ir_visitor_status ir_hierarchical_visitor::visit(ir_loop_jump *ir) { - if (this->callback != NULL) - this->callback(ir, this->data); + if (this->callback_enter != NULL) + this->callback_enter(ir, this->data_enter); return visit_continue; } @@ -71,8 +73,8 @@ ir_hierarchical_visitor::visit(ir_loop_jump *ir) ir_visitor_status ir_hierarchical_visitor::visit(ir_precision_statement *ir) { - if (this->callback != NULL) - this->callback(ir, this->data); + if (this->callback_enter != NULL) + this->callback_enter(ir, this->data_enter); return visit_continue; } @@ -80,26 +82,8 @@ ir_hierarchical_visitor::visit(ir_precision_statement *ir) ir_visitor_status ir_hierarchical_visitor::visit(ir_typedecl_statement *ir) { - if (this->callback != NULL) - this->callback(ir, this->data); - - return visit_continue; -} - -ir_visitor_status -ir_hierarchical_visitor::visit(ir_emit_vertex *ir) -{ - if (this->callback != NULL) - this->callback(ir, this->data); - - return visit_continue; -} - -ir_visitor_status -ir_hierarchical_visitor::visit(ir_end_primitive *ir) -{ - if (this->callback != NULL) - this->callback(ir, this->data); + if (this->callback_enter != NULL) + this->callback_enter(ir, this->data_enter); return visit_continue; } @@ -107,8 +91,8 @@ ir_hierarchical_visitor::visit(ir_end_primitive *ir) ir_visitor_status ir_hierarchical_visitor::visit(ir_dereference_variable *ir) { - if (this->callback != NULL) - this->callback(ir, this->data); + if (this->callback_enter != NULL) + this->callback_enter(ir, this->data_enter); return visit_continue; } @@ -116,8 +100,8 @@ ir_hierarchical_visitor::visit(ir_dereference_variable *ir) ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_loop *ir) { - if (this->callback != NULL) - this->callback(ir, this->data); + if (this->callback_enter != NULL) + this->callback_enter(ir, this->data_enter); return visit_continue; } @@ -125,15 +109,17 @@ ir_hierarchical_visitor::visit_enter(ir_loop *ir) ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_loop *ir) { - (void) ir; + if (this->callback_leave != NULL) + this->callback_leave(ir, this->data_leave); + return visit_continue; } ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_function_signature *ir) { - if (this->callback != NULL) - this->callback(ir, this->data); + if (this->callback_enter != NULL) + this->callback_enter(ir, this->data_enter); return visit_continue; } @@ -141,15 +127,17 @@ ir_hierarchical_visitor::visit_enter(ir_function_signature *ir) ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_function_signature *ir) { - (void) ir; + if (this->callback_leave != NULL) + this->callback_leave(ir, this->data_leave); + return visit_continue; } ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_function *ir) { - if (this->callback != NULL) - this->callback(ir, this->data); + if (this->callback_enter != NULL) + this->callback_enter(ir, this->data_enter); return visit_continue; } @@ -157,15 +145,17 @@ ir_hierarchical_visitor::visit_enter(ir_function *ir) ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_function *ir) { - (void) ir; + if (this->callback_leave != NULL) + this->callback_leave(ir, this->data_leave); + return visit_continue; } ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_expression *ir) { - if (this->callback != NULL) - this->callback(ir, this->data); + if (this->callback_enter != NULL) + this->callback_enter(ir, this->data_enter); return visit_continue; } @@ -173,15 +163,17 @@ ir_hierarchical_visitor::visit_enter(ir_expression *ir) ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_expression *ir) { - (void) ir; + if (this->callback_leave != NULL) + this->callback_leave(ir, this->data_leave); + return visit_continue; } ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_texture *ir) { - if (this->callback != NULL) - this->callback(ir, this->data); + if (this->callback_enter != NULL) + this->callback_enter(ir, this->data_enter); return visit_continue; } @@ -189,15 +181,17 @@ ir_hierarchical_visitor::visit_enter(ir_texture *ir) ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_texture *ir) { - (void) ir; + if (this->callback_leave != NULL) + this->callback_leave(ir, this->data_leave); + return visit_continue; } ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_swizzle *ir) { - if (this->callback != NULL) - this->callback(ir, this->data); + if (this->callback_enter != NULL) + this->callback_enter(ir, this->data_enter); return visit_continue; } @@ -205,15 +199,17 @@ ir_hierarchical_visitor::visit_enter(ir_swizzle *ir) ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_swizzle *ir) { - (void) ir; + if (this->callback_leave != NULL) + this->callback_leave(ir, this->data_leave); + return visit_continue; } ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_dereference_array *ir) { - if (this->callback != NULL) - this->callback(ir, this->data); + if (this->callback_enter != NULL) + this->callback_enter(ir, this->data_enter); return visit_continue; } @@ -221,15 +217,17 @@ ir_hierarchical_visitor::visit_enter(ir_dereference_array *ir) ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_dereference_array *ir) { - (void) ir; + if (this->callback_leave != NULL) + this->callback_leave(ir, this->data_leave); + return visit_continue; } ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_dereference_record *ir) { - if (this->callback != NULL) - this->callback(ir, this->data); + if (this->callback_enter != NULL) + this->callback_enter(ir, this->data_enter); return visit_continue; } @@ -237,15 +235,17 @@ ir_hierarchical_visitor::visit_enter(ir_dereference_record *ir) ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_dereference_record *ir) { - (void) ir; + if (this->callback_leave != NULL) + this->callback_leave(ir, this->data_leave); + return visit_continue; } ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_assignment *ir) { - if (this->callback != NULL) - this->callback(ir, this->data); + if (this->callback_enter != NULL) + this->callback_enter(ir, this->data_enter); return visit_continue; } @@ -253,15 +253,17 @@ ir_hierarchical_visitor::visit_enter(ir_assignment *ir) ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_assignment *ir) { - (void) ir; + if (this->callback_leave != NULL) + this->callback_leave(ir, this->data_leave); + return visit_continue; } ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_call *ir) { - if (this->callback != NULL) - this->callback(ir, this->data); + if (this->callback_enter != NULL) + this->callback_enter(ir, this->data_enter); return visit_continue; } @@ -269,15 +271,17 @@ ir_hierarchical_visitor::visit_enter(ir_call *ir) ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_call *ir) { - (void) ir; + if (this->callback_leave != NULL) + this->callback_leave(ir, this->data_leave); + return visit_continue; } ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_return *ir) { - if (this->callback != NULL) - this->callback(ir, this->data); + if (this->callback_enter != NULL) + this->callback_enter(ir, this->data_enter); return visit_continue; } @@ -285,15 +289,17 @@ ir_hierarchical_visitor::visit_enter(ir_return *ir) ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_return *ir) { - (void) ir; + if (this->callback_leave != NULL) + this->callback_leave(ir, this->data_leave); + return visit_continue; } ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_discard *ir) { - if (this->callback != NULL) - this->callback(ir, this->data); + if (this->callback_enter != NULL) + this->callback_enter(ir, this->data_enter); return visit_continue; } @@ -301,15 +307,17 @@ ir_hierarchical_visitor::visit_enter(ir_discard *ir) ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_discard *ir) { - (void) ir; + if (this->callback_leave != NULL) + this->callback_leave(ir, this->data_leave); + return visit_continue; } ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_if *ir) { - if (this->callback != NULL) - this->callback(ir, this->data); + if (this->callback_enter != NULL) + this->callback_enter(ir, this->data_enter); return visit_continue; } @@ -317,7 +325,45 @@ ir_hierarchical_visitor::visit_enter(ir_if *ir) ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_if *ir) { - (void) ir; + if (this->callback_leave != NULL) + this->callback_leave(ir, this->data_leave); + + return visit_continue; +} + +ir_visitor_status +ir_hierarchical_visitor::visit_enter(ir_emit_vertex *ir) +{ + if (this->callback_enter != NULL) + this->callback_enter(ir, this->data_enter); + + return visit_continue; +} + +ir_visitor_status +ir_hierarchical_visitor::visit_leave(ir_emit_vertex *ir) +{ + if (this->callback_leave != NULL) + this->callback_leave(ir, this->data_leave); + + return visit_continue; +} + +ir_visitor_status +ir_hierarchical_visitor::visit_enter(ir_end_primitive *ir) +{ + if (this->callback_enter != NULL) + this->callback_enter(ir, this->data_enter); + + return visit_continue; +} + +ir_visitor_status +ir_hierarchical_visitor::visit_leave(ir_end_primitive *ir) +{ + if (this->callback_leave != NULL) + this->callback_leave(ir, this->data_leave); + return visit_continue; } @@ -330,13 +376,17 @@ ir_hierarchical_visitor::run(exec_list *instructions) void visit_tree(ir_instruction *ir, - void (*callback)(class ir_instruction *ir, void *data), - void *data) + void (*callback_enter)(class ir_instruction *ir, void *data), + void *data_enter, + void (*callback_leave)(class ir_instruction *ir, void *data), + void *data_leave) { ir_hierarchical_visitor v; - v.callback = callback; - v.data = data; + v.callback_enter = callback_enter; + v.callback_leave = callback_leave; + v.data_enter = data_enter; + v.data_leave = data_leave; ir->accept(&v); } diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_hierarchical_visitor.h b/3rdparty/glsl-optimizer/src/glsl/ir_hierarchical_visitor.h index ac05fba00..c548336b0 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_hierarchical_visitor.h +++ b/3rdparty/glsl-optimizer/src/glsl/ir_hierarchical_visitor.h @@ -89,8 +89,6 @@ public: virtual ir_visitor_status visit(class ir_loop_jump *); virtual ir_visitor_status visit(class ir_precision_statement *); virtual ir_visitor_status visit(class ir_typedecl_statement *); - virtual ir_visitor_status visit(class ir_emit_vertex *); - virtual ir_visitor_status visit(class ir_end_primitive *); /** * ir_dereference_variable isn't technically a leaf, but it is treated as a @@ -139,6 +137,10 @@ public: virtual ir_visitor_status visit_leave(class ir_discard *); virtual ir_visitor_status visit_enter(class ir_if *); virtual ir_visitor_status visit_leave(class ir_if *); + virtual ir_visitor_status visit_enter(class ir_emit_vertex *); + virtual ir_visitor_status visit_leave(class ir_emit_vertex *); + virtual ir_visitor_status visit_enter(class ir_end_primitive *); + virtual ir_visitor_status visit_leave(class ir_end_primitive *); /*@}*/ @@ -163,14 +165,29 @@ public: * \warning * Visitor classes derived from \c ir_hierarchical_visitor \b may \b not * invoke this function. This can be used, for example, to cause the - * callback to be invoked on every node type execpt one. + * callback to be invoked on every node type except one. */ - void (*callback)(class ir_instruction *ir, void *data); + void (*callback_enter)(class ir_instruction *ir, void *data); /** - * Extra data parameter passed to the per-node callback function + * Callback function that is invoked on exit of each node visited. + * + * \warning + * Visitor classes derived from \c ir_hierarchical_visitor \b may \b not + * invoke this function. This can be used, for example, to cause the + * callback to be invoked on every node type except one. */ - void *data; + void (*callback_leave)(class ir_instruction *ir, void *data); + + /** + * Extra data parameter passed to the per-node callback_enter function + */ + void *data_enter; + + /** + * Extra data parameter passed to the per-node callback_leave function + */ + void *data_leave; /** * Currently in the LHS of an assignment? @@ -181,8 +198,10 @@ public: }; void visit_tree(ir_instruction *ir, - void (*callback)(class ir_instruction *ir, void *data), - void *data); + void (*callback_enter)(class ir_instruction *ir, void *data), + void *data_enter, + void (*callback_leave)(class ir_instruction *ir, void *data) = NULL, + void *data_leave = NULL); ir_visitor_status visit_list_elements(ir_hierarchical_visitor *v, exec_list *l, bool statement_list = true); diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_hv_accept.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_hv_accept.cpp index 9b8cf9a6f..1cdd16786 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_hv_accept.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_hv_accept.cpp @@ -49,8 +49,7 @@ visit_list_elements(ir_hierarchical_visitor *v, exec_list *l, { ir_instruction *prev_base_ir = v->base_ir; - foreach_list_safe(n, l) { - ir_instruction *const ir = (ir_instruction *) n; + foreach_in_list_safe(ir_instruction, ir, l) { if (statement_list) v->base_ir = ir; ir_visitor_status s = ir->accept(v); @@ -393,7 +392,7 @@ ir_if::accept(ir_hierarchical_visitor *v) ir_visitor_status ir_precision_statement::accept(ir_hierarchical_visitor *v) { - return v->visit(this); + return v->visit(this); } ir_visitor_status @@ -405,11 +404,27 @@ ir_typedecl_statement::accept(ir_hierarchical_visitor *v) ir_visitor_status ir_emit_vertex::accept(ir_hierarchical_visitor *v) { - return v->visit(this); + ir_visitor_status s = v->visit_enter(this); + if (s != visit_continue) + return (s == visit_continue_with_parent) ? visit_continue : s; + + s = this->stream->accept(v); + if (s != visit_continue) + return (s == visit_continue_with_parent) ? visit_continue : s; + + return (s == visit_stop) ? s : v->visit_leave(this); } ir_visitor_status ir_end_primitive::accept(ir_hierarchical_visitor *v) { - return v->visit(this); + ir_visitor_status s = v->visit_enter(this); + if (s != visit_continue) + return (s == visit_continue_with_parent) ? visit_continue : s; + + s = this->stream->accept(v); + if (s != visit_continue) + return (s == visit_continue_with_parent) ? visit_continue : s; + + return (s == visit_stop) ? s : v->visit_leave(this); } diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_optimization.h b/3rdparty/glsl-optimizer/src/glsl/ir_optimization.h index e0416dfc9..e1154e9df 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_optimization.h +++ b/3rdparty/glsl-optimizer/src/glsl/ir_optimization.h @@ -36,9 +36,11 @@ #define LOG_TO_LOG2 0x10 #define MOD_TO_FRACT 0x20 #define INT_DIV_TO_MUL_RCP 0x40 -#define LRP_TO_ARITH 0x80 -#define BITFIELD_INSERT_TO_BFM_BFI 0x100 -#define LDEXP_TO_ARITH 0x200 +#define BITFIELD_INSERT_TO_BFM_BFI 0x80 +#define LDEXP_TO_ARITH 0x100 +#define CARRY_TO_ARITH 0x200 +#define BORROW_TO_ARITH 0x400 +#define SAT_TO_CLAMP 0x800 /** * \see class lower_packing_builtins_visitor @@ -67,10 +69,12 @@ enum lower_packing_builtins_op { bool do_common_optimization(exec_list *ir, bool linked, bool uniform_locations_assigned, - unsigned max_unroll_iterations, - const struct gl_shader_compiler_options *options); + const struct gl_shader_compiler_options *options, + bool native_integers); -bool do_algebraic(exec_list *instructions); +bool do_rebalance_tree(exec_list *instructions); +bool do_algebraic(exec_list *instructions, bool native_integers, + const struct gl_shader_compiler_options *options); bool do_constant_folding(exec_list *instructions); bool do_constant_variable(exec_list *instructions); bool do_constant_variable_unlinked(exec_list *instructions); @@ -94,6 +98,7 @@ bool opt_flatten_nested_if_blocks(exec_list *instructions); bool do_discard_simplification(exec_list *instructions); bool lower_if_to_cond_assign(exec_list *instructions, unsigned max_depth = 0); bool do_mat_op_to_vec(exec_list *instructions); +bool do_minmax_prune(exec_list *instructions); bool do_noop_swizzle(exec_list *instructions); bool do_structure_splitting(exec_list *instructions); bool do_swizzle_swizzle(exec_list *instructions); @@ -112,13 +117,27 @@ bool lower_clip_distance(gl_shader *shader); void lower_output_reads(exec_list *instructions); bool lower_packing_builtins(exec_list *instructions, int op_mask); void lower_ubo_reference(struct gl_shader *shader, exec_list *instructions); -void lower_packed_varyings(void *mem_ctx, unsigned location_base, +void lower_packed_varyings(void *mem_ctx, unsigned locations_used, ir_variable_mode mode, unsigned gs_input_vertices, gl_shader *shader); bool lower_vector_insert(exec_list *instructions, bool lower_nonconstant_index); void lower_named_interface_blocks(void *mem_ctx, gl_shader *shader); bool optimize_redundant_jumps(exec_list *instructions); -bool optimize_split_arrays(exec_list *instructions, bool linked); + +typedef enum { + OPT_SPLIT_ONLY_LOOP_INDUCTORS = 0, //< only split vectors that are used as loop inductors (and are not used by any vector operation) + OPT_SPLIT_ONLY_UNUSED = 1, //< only split vectors that have unused components (and are not used by any vector operation) + OPT_SPLIT_ANY_POSSIBLE = 2, //< Split all vectors that are only accessed by their components +} glsl_vector_splitting_mode; + +bool optimize_split_vectors(exec_list *instructions, bool linked, glsl_vector_splitting_mode mode); + +bool optimize_split_arrays(exec_list *instructions, bool linked, bool split_shader_outputs); +bool lower_offset_arrays(exec_list *instructions); +void optimize_dead_builtin_variables(exec_list *instructions, + enum ir_variable_mode other); + +bool lower_vertex_id(gl_shader *shader); ir_rvalue * compare_index_block(exec_list *instructions, ir_variable *index, diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp index f0bf9beeb..27a8791bd 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp @@ -29,63 +29,7 @@ #include "loop_analysis.h" #include "program/hash_table.h" #include - - -class string_buffer -{ -public: - string_buffer(void* mem_ctx) - { - m_Capacity = 512; - m_Ptr = (char*)ralloc_size(mem_ctx, m_Capacity); - m_Size = 0; - m_Ptr[0] = 0; - } - - ~string_buffer() - { - ralloc_free(m_Ptr); - } - - const char* c_str() const { return m_Ptr; } - - void asprintf_append(const char *fmt, ...) PRINTFLIKE(2, 3) - { - va_list args; - va_start(args, fmt); - vasprintf_append(fmt, args); - va_end(args); - } - - void vasprintf_append(const char *fmt, va_list args) - { - assert (m_Ptr != NULL); - vasprintf_rewrite_tail (&m_Size, fmt, args); - } - - void vasprintf_rewrite_tail (size_t *start, const char *fmt, va_list args) - { - assert (m_Ptr != NULL); - - size_t new_length = printf_length(fmt, args); - size_t needed_length = m_Size + new_length + 1; - - if (m_Capacity < needed_length) - { - m_Capacity = MAX2 (m_Capacity + m_Capacity/2, needed_length); - m_Ptr = (char*)reralloc_size(ralloc_parent(m_Ptr), m_Ptr, m_Capacity); - } - - vsnprintf(m_Ptr + m_Size, new_length+1, fmt, args); - m_Size += new_length; - assert (m_Capacity >= m_Size); - } - -private: - char* m_Ptr; - size_t m_Size; - size_t m_Capacity; -}; +#include static void print_type(string_buffer& buffer, const glsl_type *t, bool arraySize); @@ -186,6 +130,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); bool try_print_array_assignment (ir_dereference* lhs, ir_rvalue* rhs); @@ -229,6 +174,13 @@ _mesa_print_ir_glsl(exec_list *instructions, str.asprintf_append ("#extension GL_EXT_shadow_samplers : enable\n"); if (state->EXT_frag_depth_enable) str.asprintf_append ("#extension GL_EXT_frag_depth : enable\n"); + if (state->es_shader && state->language_version < 300) + { + if (state->EXT_draw_buffers_enable) + str.asprintf_append ("#extension GL_EXT_draw_buffers : require\n"); + } + if (state->EXT_shader_framebuffer_fetch_enable) + str.asprintf_append ("#extension GL_EXT_shader_framebuffer_fetch : enable\n"); } // remove unused struct declarations @@ -240,9 +192,8 @@ _mesa_print_ir_glsl(exec_list *instructions, if (ls->loop_found) set_loop_controls(instructions, ls); - foreach_list(node, instructions) + foreach_in_list(ir_instruction, ir, instructions) { - ir_instruction *ir = (ir_instruction *)node; if (ir->ir_type == ir_type_variable) { ir_variable *var = static_cast(ir); if ((strstr(var->name, "gl_") == var->name) @@ -344,13 +295,13 @@ void ir_print_glsl_visitor::print_precision (ir_instruction* ir, const glsl_type // this->state->stage == MESA_SHADER_FRAGMENT && !this->state->had_float_precision) { - prec = glsl_precision_medium; - } - + 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 - // default EXT_shadow_samplers precision) - if (type && type->is_sampler() && !type->sampler_shadow) + // default EXT_shadow_samplers precision) and 3D textures (they always require precision) + if (type && type->is_sampler() && !type->sampler_shadow && !(type->sampler_dimensionality > GLSL_SAMPLER_DIM_2D)) { if (prec == glsl_precision_low || prec == glsl_precision_undefined) return; @@ -394,9 +345,9 @@ void ir_print_glsl_visitor::visit(ir_variable *ir) const char *const inv = (ir->data.invariant) ? "invariant " : ""; const char *const mode[3][ir_var_mode_count] = { - { "", "uniform ", "in ", "out ", "in ", "out ", "inout ", "", "", "" }, - { "", "uniform ", "attribute ", "varying ", "in ", "out ", "inout ", "", "", "" }, - { "", "uniform ", "varying ", "out ", "in ", "out ", "inout ", "", "", "" }, + { "", "uniform ", "in ", "out ", "inout ", "in ", "out ", "inout ", "", "", "" }, + { "", "uniform ", "attribute ", "varying ", "inout ", "in ", "out ", "inout ", "", "", "" }, + { "", "uniform ", "varying ", "out ", "inout ", "in ", "out ", "inout ", "", "", "" }, }; const char *const interp[] = { "", "smooth ", "flat ", "noperspective " }; @@ -431,7 +382,8 @@ void ir_print_glsl_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; @@ -456,6 +408,7 @@ void ir_print_glsl_visitor::visit(ir_variable *ir) if (ir->constant_value && ir->data.mode != ir_var_shader_in && ir->data.mode != ir_var_shader_out && + ir->data.mode != ir_var_shader_inout && ir->data.mode != ir_var_function_in && ir->data.mode != ir_var_function_out && ir->data.mode != ir_var_function_inout) @@ -478,9 +431,7 @@ void ir_print_glsl_visitor::visit(ir_function_signature *ir) indentation++; previous_skipped = false; bool first = true; - foreach_list(node, &ir->parameters) { - ir_variable *const inst = (ir_variable *)node; - + foreach_in_list(ir_variable, inst, &ir->parameters) { if (!first) buffer.asprintf_append (",\n"); indent(); @@ -510,17 +461,15 @@ void ir_print_glsl_visitor::visit(ir_function_signature *ir) { assert (!globals->main_function_done); globals->main_function_done = true; - foreach_list(node, &globals->global_assignements) + foreach_in_list(ga_entry, node, &globals->global_assignements) { - ir_instruction* as = ((ga_entry *)node)->ir; + ir_instruction* as = node->ir; as->accept(this); buffer.asprintf_append(";\n"); } } - foreach_list(node, &ir->body) { - ir_instruction *const inst = (ir_instruction *)node; - + foreach_in_list(ir_instruction, inst, &ir->body) { indent(); inst->accept(this); end_statement_line(); @@ -534,8 +483,7 @@ void ir_print_glsl_visitor::visit(ir_function *ir) { bool found_non_builtin_proto = false; - foreach_list(node, &ir->signatures) { - ir_function_signature *const sig = (ir_function_signature *)node; + foreach_in_list(ir_function_signature, sig, &ir->signatures) { if (!sig->is_builtin()) found_non_builtin_proto = true; } @@ -545,9 +493,7 @@ void ir_print_glsl_visitor::visit(ir_function *ir) PrintGlslMode oldMode = this->mode; this->mode = kPrintGlslNone; - foreach_list(node, &ir->signatures) { - ir_function_signature *const sig = (ir_function_signature *)node; - + foreach_in_list(ir_function_signature, sig, &ir->signatures) { indent(); sig->accept(this); buffer.asprintf_append ("\n"); @@ -598,7 +544,11 @@ static const char *const operator_glsl_strs[] = { "sin", // reduced "cos", // reduced "dFdx", + "dFdxCoarse", + "dFdxFine", "dFdy", + "dFdyCoarse", + "dFdyFine", "packSnorm2x16", "packSnorm4x8", "packUnorm2x16", @@ -615,7 +565,9 @@ static const char *const operator_glsl_strs[] = { "bitCount", "findMSB", "findLSB", + "saturate", "noise", + "interpolateAtCentroid", "+", "-", "*", @@ -649,6 +601,8 @@ static const char *const operator_glsl_strs[] = { "uboloadTODO", "ldexp_TODO", "vectorExtract_TODO", + "interpolateAtOffset", + "interpolateAtSample", "fma", "clamp", "mix", @@ -916,7 +870,7 @@ void ir_print_glsl_visitor::visit(ir_swizzle *ir) ir->mask.w, }; - if (ir->val->type == glsl_type::float_type || ir->val->type == glsl_type::int_type) + if (ir->val->type == glsl_type::float_type || ir->val->type == glsl_type::int_type || ir->val->type == glsl_type::uint_type) { if (ir->mask.num_components != 1) { @@ -927,7 +881,7 @@ void ir_print_glsl_visitor::visit(ir_swizzle *ir) ir->val->accept(this); - if (ir->val->type == glsl_type::float_type || ir->val->type == glsl_type::int_type) + if (ir->val->type == glsl_type::float_type || ir->val->type == glsl_type::int_type || ir->val->type == glsl_type::uint_type) { if (ir->mask.num_components != 1) { @@ -1126,7 +1080,8 @@ void ir_print_glsl_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; @@ -1200,6 +1155,18 @@ static void print_float (string_buffer& buffer, float f) if (!posE) posE = strchr(tmp, 'E'); + // snprintf formats infinity as inf.0 or -inf.0, which isn't useful here. + // GLSL has no infinity constant so print an equivalent expression instead. + if (f == std::numeric_limits::infinity()) + strcpy(tmp, "(1.0/0.0)"); + + if (f == -std::numeric_limits::infinity()) + strcpy(tmp, "(-1.0/0.0)"); + + // Do similar thing for NaN + if (f != f) + strcpy(tmp, "(0.0/0.0)"); + #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 @@ -1241,7 +1208,12 @@ void ir_print_glsl_visitor::visit(ir_constant *ir) } else if (type == glsl_type::uint_type) { - buffer.asprintf_append ("%u", ir->value.u[0]); + // ES 2.0 doesn't support uints, neither does GLSL < 130 + if ((state->es_shader && (state->language_version < 300)) + || (state->language_version < 130)) + buffer.asprintf_append("%u", ir->value.u[0]); + else + buffer.asprintf_append("%uu", ir->value.u[0]); return; } @@ -1259,11 +1231,10 @@ void ir_print_glsl_visitor::visit(ir_constant *ir) } } else if (ir->type->is_record()) { bool first = true; - foreach_list(n, &ir->components) { + foreach_in_list(ir_constant, inst, &ir->components) { if (!first) buffer.asprintf_append (", "); first = false; - ir_constant* inst = (ir_constant*)n; inst->accept(this); } }else { @@ -1273,7 +1244,16 @@ void ir_print_glsl_visitor::visit(ir_constant *ir) buffer.asprintf_append (", "); first = false; switch (base_type->base_type) { - case GLSL_TYPE_UINT: buffer.asprintf_append ("%u", ir->value.u[i]); break; + case GLSL_TYPE_UINT: + { + // ES 2.0 doesn't support uints, neither does GLSL < 130 + if ((state->es_shader && (state->language_version < 300)) + || (state->language_version < 130)) + buffer.asprintf_append("%u", ir->value.u[i]); + else + 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_FLOAT: print_float(buffer, ir->value.f[i]); break; case GLSL_TYPE_BOOL: buffer.asprintf_append ("%d", ir->value.b[i]); break; @@ -1305,8 +1285,7 @@ ir_print_glsl_visitor::visit(ir_call *ir) buffer.asprintf_append ("%s (", ir->callee_name()); bool first = true; - foreach_list(node, &ir->actual_parameters) { - ir_instruction *const inst = (ir_instruction *)node; + foreach_in_list(ir_instruction, inst, &ir->actual_parameters) { if (!first) buffer.asprintf_append (", "); inst->accept(this); @@ -1351,9 +1330,7 @@ ir_print_glsl_visitor::visit(ir_if *ir) indentation++; previous_skipped = false; - foreach_list(n, &ir->then_instructions) { - ir_instruction *const inst = (ir_instruction *)n; - + foreach_in_list(ir_instruction, inst, &ir->then_instructions) { indent(); inst->accept(this); end_statement_line(); @@ -1368,9 +1345,7 @@ ir_print_glsl_visitor::visit(ir_if *ir) buffer.asprintf_append (" else {\n"); indentation++; previous_skipped = false; - foreach_list(n, &ir->else_instructions) { - ir_instruction *const inst = (ir_instruction *)n; - + foreach_in_list(ir_instruction, inst, &ir->else_instructions) { indent(); inst->accept(this); end_statement_line(); @@ -1381,10 +1356,8 @@ ir_print_glsl_visitor::visit(ir_if *ir) } } - -bool ir_print_glsl_visitor::emit_canonical_for (ir_loop* ir) +bool ir_print_glsl_visitor::can_emit_canonical_for (loop_variable_state *ls) { - loop_variable_state* const ls = this->loopstate->get(ir); if (ls == NULL) return false; @@ -1395,12 +1368,19 @@ bool ir_print_glsl_visitor::emit_canonical_for (ir_loop* ir) return false; // only support for loops with one terminator condition - int terminatorCount = 0; - foreach_list(node, &ls->terminators) { - ++terminatorCount; - } + int terminatorCount = ls->terminators.length(); if (terminatorCount != 1) return false; + + return true; +} + +bool ir_print_glsl_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); @@ -1412,9 +1392,8 @@ bool ir_print_glsl_visitor::emit_canonical_for (ir_loop* ir) // only for loops with single induction variable, to avoid cases of different types of them if (ls->private_induction_variable_count == 1) { - foreach_list(node, &ls->induction_variables) + foreach_in_list(loop_variable, indvar, &ls->induction_variables) { - loop_variable* indvar = (loop_variable *) node; if (!this->loopstate->get_for_inductor(indvar->var)) continue; @@ -1434,9 +1413,8 @@ bool ir_print_glsl_visitor::emit_canonical_for (ir_loop* ir) buffer.asprintf_append("; "); // emit loop terminating conditions - foreach_list(node, &ls->terminators) + foreach_in_list(loop_terminator, term, &ls->terminators) { - loop_terminator* term = (loop_terminator *) node; hash_table_insert(terminator_hash, term, term->ir); // IR has conditions in the form of "if (x) break", @@ -1487,9 +1465,8 @@ bool ir_print_glsl_visitor::emit_canonical_for (ir_loop* ir) // emit loop induction variable updates bool first = true; - foreach_list(node, &ls->induction_variables) + foreach_in_list(loop_variable, indvar, &ls->induction_variables) { - loop_variable* indvar = (loop_variable *) node; hash_table_insert(induction_hash, indvar, indvar->first_assignment); if (!first) buffer.asprintf_append(", "); @@ -1502,9 +1479,8 @@ bool ir_print_glsl_visitor::emit_canonical_for (ir_loop* ir) // emit loop body indentation++; previous_skipped = false; - foreach_list(node, &ir->body_instructions) { - ir_instruction *const inst = (ir_instruction *)node; - + foreach_in_list(ir_instruction, inst, &ir->body_instructions) { + // skip termination & induction statements, // they are part of "for" clause if (hash_table_find(terminator_hash, inst)) @@ -1536,8 +1512,7 @@ ir_print_glsl_visitor::visit(ir_loop *ir) buffer.asprintf_append ("while (true) {\n"); indentation++; previous_skipped = false; - foreach_list(n, &ir->body_instructions) { - ir_instruction *const inst = (ir_instruction *)n; + foreach_in_list(ir_instruction, inst, &ir->body_instructions) { indent(); inst->accept(this); end_statement_line(); diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.h b/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.h index 0e6f565f0..409898b4f 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.h +++ b/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.h @@ -38,4 +38,65 @@ extern char* _mesa_print_ir_glsl(exec_list *instructions, struct _mesa_glsl_parse_state *state, char* buf, PrintGlslMode mode); + + +class string_buffer +{ +public: + string_buffer(void* mem_ctx) + { + m_Capacity = 512; + m_Ptr = (char*)ralloc_size(mem_ctx, m_Capacity); + m_Size = 0; + m_Ptr[0] = 0; + } + + ~string_buffer() + { + ralloc_free(m_Ptr); + } + + bool empty() const { return m_Size == 0; } + + const char* c_str() const { return m_Ptr; } + + void asprintf_append(const char *fmt, ...) PRINTFLIKE(2, 3) + { + va_list args; + va_start(args, fmt); + vasprintf_append(fmt, args); + va_end(args); + } + + void vasprintf_append(const char *fmt, va_list args) + { + assert (m_Ptr != NULL); + vasprintf_rewrite_tail (&m_Size, fmt, args); + } + + void vasprintf_rewrite_tail (size_t *start, const char *fmt, va_list args) + { + assert (m_Ptr != NULL); + + size_t new_length = printf_length(fmt, args); + size_t needed_length = m_Size + new_length + 1; + + if (m_Capacity < needed_length) + { + m_Capacity = MAX2 (m_Capacity + m_Capacity/2, needed_length); + m_Ptr = (char*)reralloc_size(ralloc_parent(m_Ptr), m_Ptr, m_Capacity); + } + + vsnprintf(m_Ptr + m_Size, new_length+1, fmt, args); + m_Size += new_length; + assert (m_Capacity >= m_Size); + } + +private: + char* m_Ptr; + size_t m_Size; + size_t m_Capacity; +}; + + #endif /* IR_PRINT_GLSL_VISITOR_H */ diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_print_metal_visitor.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_print_metal_visitor.cpp new file mode 100644 index 000000000..28b3046d6 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/ir_print_metal_visitor.cpp @@ -0,0 +1,1914 @@ +/* + * Copyright © 2014 Unity Technologies + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include "ir_print_metal_visitor.h" +#include "ir_visitor.h" +#include "glsl_types.h" +#include "glsl_parser_extras.h" +#include "ir_unused_structs.h" +#include "loop_analysis.h" +#include "program/hash_table.h" +#include + + +static void print_type(string_buffer& buffer, ir_instruction* ir, const glsl_type *t, bool arraySize); +static void print_type_post(string_buffer& buffer, const glsl_type *t, bool arraySize); + + +struct ga_entry_metal : public exec_node +{ + ga_entry_metal(ir_instruction* ir) + { + assert(ir); + this->ir = ir; + } + ir_instruction* ir; +}; +struct gconst_entry_metal : public exec_node +{ + gconst_entry_metal(ir_constant* ir, unsigned id) + { + assert(ir); + this->ir = ir; + this->id = id; + } + ir_constant* ir; + unsigned id; +}; + + +struct global_print_tracker_metal +{ + global_print_tracker_metal () + { + mem_ctx = ralloc_context(0); + var_counter = 0; + var_hash = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare); + const_counter = 0; + const_hash = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare); + main_function_done = false; + } + + ~global_print_tracker_metal() + { + hash_table_dtor (var_hash); + hash_table_dtor (const_hash); + ralloc_free(mem_ctx); + } + + unsigned var_counter; + hash_table* var_hash; + exec_list global_assignements; + + unsigned const_counter; + hash_table* const_hash; + exec_list global_constants; + + void* mem_ctx; + bool main_function_done; +}; + + +struct metal_print_context +{ + metal_print_context(char* buffer) + : str(buffer) + , prefixStr(ralloc_strdup(buffer, "")) + , inputStr(ralloc_strdup(buffer, "")) + , outputStr(ralloc_strdup(buffer, "")) + , inoutStr(ralloc_strdup(buffer, "")) + , uniformStr(ralloc_strdup(buffer, "")) + , paramsStr(ralloc_strdup(buffer, "")) + , writingParams(false) + , matrixCastsDone(false) + , shadowSamplerDone(false) + , textureCounter(0) + , attributeCounter(0) + , uniformLocationCounter(0) + , colorCounter(0) + { + } + + string_buffer str; + string_buffer prefixStr; + string_buffer inputStr; + string_buffer outputStr; + string_buffer inoutStr; + string_buffer uniformStr; + string_buffer paramsStr; + bool writingParams; + bool matrixCastsDone; + bool shadowSamplerDone; + int textureCounter; + int attributeCounter; + int uniformLocationCounter; + int colorCounter; +}; + + +class ir_print_metal_visitor : public ir_visitor { +public: + ir_print_metal_visitor(metal_print_context& ctx_, string_buffer& buf, global_print_tracker_metal* globals_, PrintGlslMode mode_, const _mesa_glsl_parse_state* state_) + : ctx(ctx_) + , buffer(buf) + , loopstate(NULL) + , inside_loop_body(false) + , inside_lhs(false) + , skipped_this_ir(false) + , previous_skipped(false) + , mode_whole(mode_) + { + indentation = 0; + expression_depth = 0; + globals = globals_; + mode = mode_; + state = state_; + } + + virtual ~ir_print_metal_visitor() + { + } + + + void indent(void); + void newline_indent(); + void end_statement_line(); + void newline_deindent(); + void print_var_name (ir_variable* v); + + virtual void visit(ir_variable *); + virtual void visit(ir_function_signature *); + virtual void visit(ir_function *); + virtual void visit(ir_expression *); + virtual void visit(ir_texture *); + virtual void visit(ir_swizzle *); + virtual void visit(ir_dereference_variable *); + virtual void visit(ir_dereference_array *); + virtual void visit(ir_dereference_record *); + virtual void visit(ir_assignment *); + virtual void visit(ir_constant *); + virtual void visit(ir_call *); + virtual void visit(ir_return *); + virtual void visit(ir_discard *); + virtual void visit(ir_if *); + virtual void visit(ir_loop *); + virtual void visit(ir_loop_jump *); + virtual void visit(ir_precision_statement *); + virtual void visit(ir_typedecl_statement *); + virtual void visit(ir_emit_vertex *); + virtual void visit(ir_end_primitive *); + + void emit_assignment_part (ir_dereference* lhs, ir_rvalue* rhs, unsigned write_mask, ir_rvalue* dstIndex); + bool emit_canonical_for (ir_loop* ir); + + metal_print_context& ctx; + int indentation; + int expression_depth; + string_buffer& buffer; + global_print_tracker_metal* globals; + const _mesa_glsl_parse_state* state; + PrintGlslMode mode; + const PrintGlslMode mode_whole; + loop_state* loopstate; + bool inside_loop_body; + bool inside_lhs; + bool skipped_this_ir; + bool previous_skipped; +}; + + +char* +_mesa_print_ir_metal(exec_list *instructions, + struct _mesa_glsl_parse_state *state, + char* buffer, PrintGlslMode mode, int* outUniformsSize) +{ + metal_print_context ctx(buffer); + + // includes, prefix etc. + ctx.prefixStr.asprintf_append ("#include \n"); + ctx.prefixStr.asprintf_append ("using namespace metal;\n"); + + ctx.inputStr.asprintf_append("struct xlatMtlShaderInput {\n"); + ctx.outputStr.asprintf_append("struct xlatMtlShaderOutput {\n"); + ctx.uniformStr.asprintf_append("struct xlatMtlShaderUniform {\n"); + + // remove unused struct declarations + do_remove_unused_typedecls(instructions); + + global_print_tracker_metal gtracker; + + loop_state* ls = analyze_loop_variables(instructions); + if (ls->loop_found) + set_loop_controls(instructions, ls); + + foreach_in_list(ir_instruction, ir, instructions) + { + string_buffer* strOut = &ctx.str; + ctx.writingParams = false; + if (ir->ir_type == ir_type_variable) + { + ir_variable *var = static_cast(ir); + + // skip gl_ variables if they aren't used/assigned + if (strstr(var->name, "gl_") == var->name) + { + if (!var->data.used && !var->data.assigned) + continue; + } + + // + if (var->data.mode == ir_var_uniform) + { + if (var->type->is_sampler()) + { + strOut = &ctx.paramsStr; + ctx.writingParams = true; + strOut->asprintf_append ("\n , "); + } + else + strOut = &ctx.uniformStr; + } + if (var->data.mode == ir_var_system_value) + { + strOut = &ctx.paramsStr; + ctx.writingParams = true; + strOut->asprintf_append ("\n , "); + } + if (var->data.mode == ir_var_shader_in) + strOut = &ctx.inputStr; + if (var->data.mode == ir_var_shader_out) + strOut = &ctx.outputStr; + if (var->data.mode == ir_var_shader_inout) + strOut = &ctx.inoutStr; + } + + + ir_print_metal_visitor v (ctx, *strOut, >racker, mode, state); + v.loopstate = ls; + + ir->accept(&v); + if (ir->ir_type != ir_type_function && !v.skipped_this_ir) + { + if (!ctx.writingParams) + strOut->asprintf_append (";\n"); + } + } + + delete ls; + + // append inout variables to both input & output structs + if (!ctx.inoutStr.empty()) + { + ctx.inputStr.asprintf_append("%s", ctx.inoutStr.c_str()); + ctx.outputStr.asprintf_append("%s", ctx.inoutStr.c_str()); + } + ctx.inputStr.asprintf_append("};\n"); + ctx.outputStr.asprintf_append("};\n"); + ctx.uniformStr.asprintf_append("};\n"); + + // emit global array/struct constants + foreach_in_list_safe(gconst_entry_metal, node, >racker.global_constants) + { + ir_constant* c = node->ir; + + ir_print_metal_visitor v (ctx, ctx.prefixStr, >racker, mode, state); + + v.buffer.asprintf_append ("constant "); + print_type(v.buffer, c, c->type, false); + v.buffer.asprintf_append (" _xlat_mtl_const%i", (int)((gconst_entry_metal*)node)->id); + print_type_post(v.buffer, c->type, false); + v.buffer.asprintf_append (" = {"); + + if (c->type->is_array()) + { + for (unsigned i = 0; i < c->type->length; i++) + { + if (i != 0) + v.buffer.asprintf_append (", "); + c->get_array_element(i)->accept(&v); + } + } + else + { + assert(c->type->is_record()); + bool first = true; + foreach_in_list(ir_constant, inst, &c->components) + { + if (!first) + v.buffer.asprintf_append (", "); + first = false; + inst->accept(&v); + } + } + v.buffer.asprintf_append ("};\n"); + } + + + ctx.prefixStr.asprintf_append("%s", ctx.inputStr.c_str()); + ctx.prefixStr.asprintf_append("%s", ctx.outputStr.c_str()); + ctx.prefixStr.asprintf_append("%s", ctx.uniformStr.c_str()); + ctx.prefixStr.asprintf_append("%s", ctx.str.c_str()); + + *outUniformsSize = ctx.uniformLocationCounter; + + return ralloc_strdup(buffer, ctx.prefixStr.c_str()); +} + + +void ir_print_metal_visitor::indent(void) +{ + if (previous_skipped) + return; + previous_skipped = false; + for (int i = 0; i < indentation; i++) + buffer.asprintf_append (" "); +} + +void ir_print_metal_visitor::end_statement_line() +{ + if (!skipped_this_ir) + buffer.asprintf_append(";\n"); + previous_skipped = skipped_this_ir; + skipped_this_ir = false; +} + +void ir_print_metal_visitor::newline_indent() +{ + if (expression_depth % 4 == 0) + { + ++indentation; + buffer.asprintf_append ("\n"); + indent(); + } +} +void ir_print_metal_visitor::newline_deindent() +{ + if (expression_depth % 4 == 0) + { + --indentation; + buffer.asprintf_append ("\n"); + indent(); + } +} + + +void ir_print_metal_visitor::print_var_name (ir_variable* v) +{ + long id = (long)hash_table_find (globals->var_hash, v); + if (!id && v->data.mode == ir_var_temporary) + { + id = ++globals->var_counter; + hash_table_insert (globals->var_hash, (void*)id, v); + } + if (id) + { + if (v->data.mode == ir_var_temporary) + buffer.asprintf_append ("tmpvar_%d", (int)id); + else + buffer.asprintf_append ("%s_%d", v->name, (int)id); + } + else + { + buffer.asprintf_append ("%s", v->name); + } +} + + + +static void print_type_precision(string_buffer& buffer, const glsl_type *t, glsl_precision prec, bool arraySize) +{ + const bool halfPrec = (prec == glsl_precision_medium || prec == glsl_precision_low); + + const char* typeName = t->name; + // scalars + if (!strcmp(typeName, "float")) + typeName = halfPrec ? "half" : "float"; + else if (!strcmp(typeName, "int")) + typeName = halfPrec ? "short" : "int"; + // vectors + else if (!strcmp(typeName, "vec2")) + typeName = halfPrec ? "half2" : "float2"; + else if (!strcmp(typeName, "vec3")) + typeName = halfPrec ? "half3" : "float3"; + else if (!strcmp(typeName, "vec4")) + typeName = halfPrec ? "half4" : "float4"; + else if (!strcmp(typeName, "ivec2")) + typeName = halfPrec ? "short2" : "int2"; + else if (!strcmp(typeName, "ivec3")) + typeName = halfPrec ? "short3" : "int3"; + else if (!strcmp(typeName, "ivec4")) + typeName = halfPrec ? "short4" : "int4"; + else if (!strcmp(typeName, "bvec2")) + typeName = "bool2"; + else if (!strcmp(typeName, "bvec3")) + typeName = "bool3"; + else if (!strcmp(typeName, "bvec4")) + typeName = "bool4"; + // matrices + else if (!strcmp(typeName, "mat2")) + typeName = halfPrec ? "half2x2" : "float2x2"; + else if (!strcmp(typeName, "mat3")) + typeName = halfPrec ? "half3x3" : "float3x3"; + else if (!strcmp(typeName, "mat4")) + typeName = halfPrec ? "half4x4" : "float4x4"; + // non-square matrices + else if (!strcmp(typeName, "mat2x2")) + typeName = halfPrec ? "half2x2" : "float2x2"; + else if (!strcmp(typeName, "mat2x3")) + typeName = halfPrec ? "half2x3" : "float2x3"; + else if (!strcmp(typeName, "mat2x4")) + typeName = halfPrec ? "half2x4" : "float2x4"; + else if (!strcmp(typeName, "mat3x2")) + typeName = halfPrec ? "half3x2" : "float3x2"; + else if (!strcmp(typeName, "mat3x3")) + typeName = halfPrec ? "half3x3" : "float3x3"; + else if (!strcmp(typeName, "mat3x4")) + typeName = halfPrec ? "half3x4" : "float3x4"; + else if (!strcmp(typeName, "mat4x2")) + typeName = halfPrec ? "half4x2" : "float4x2"; + else if (!strcmp(typeName, "mat4x3")) + typeName = halfPrec ? "half4x3" : "float4x3"; + else if (!strcmp(typeName, "mat4x4")) + typeName = halfPrec ? "half4x4" : "float4x4"; + // samplers + else if (!strcmp(typeName, "sampler2D")) + typeName = halfPrec ? "texture2d" : "texture2d"; + else if (!strcmp(typeName, "samplerCube")) + typeName = halfPrec ? "texturecube" : "texturecube"; + else if (!strcmp(typeName, "sampler3D")) + typeName = halfPrec ? "texture3d" : "texture3d"; + else if (!strcmp(typeName, "sampler2DShadow")) + typeName = "depth2d"; // depth type must always be float + else if (!strcmp(typeName, "samplerCubeShadow")) + typeName = "depthcube"; // depth type must always be float + + if (t->base_type == GLSL_TYPE_ARRAY) { + print_type_precision(buffer, t->fields.array, prec, true); + if (arraySize) + buffer.asprintf_append ("[%u]", t->length); + } else if ((t->base_type == GLSL_TYPE_STRUCT) + && (strncmp("gl_", typeName, 3) != 0)) { + buffer.asprintf_append ("%s", typeName); + } else { + buffer.asprintf_append ("%s", typeName); + } +} + + +static void print_type(string_buffer& buffer, ir_instruction* ir, const glsl_type *t, bool arraySize) +{ + glsl_precision prec = precision_from_ir(ir); + if (prec == glsl_precision_low) + prec = glsl_precision_medium; // Metal does not have low precision; treat as medium + print_type_precision(buffer, t, prec, arraySize); +} + + +static void print_type_post(string_buffer& buffer, const glsl_type *t, bool arraySize) +{ + if (t->base_type == GLSL_TYPE_ARRAY) { + if (!arraySize) + buffer.asprintf_append ("[%u]", t->length); + } +} + +static void get_metal_type_size(const glsl_type* type, glsl_precision prec, int& size, int& alignment) +{ + if (prec == glsl_precision_undefined) + prec = glsl_precision_high; + if (prec == glsl_precision_low) + prec = glsl_precision_medium; + const bool half = (prec == glsl_precision_medium); + + const int asize = type->is_array() ? type->length : 1; + if (type->is_array()) + type = type->element_type(); + + if (type->base_type == GLSL_TYPE_UINT || type->base_type == GLSL_TYPE_INT || type->base_type == GLSL_TYPE_FLOAT) + { + size = half ? 2 : 4; + } + else if (type->base_type == GLSL_TYPE_BOOL) + { + size = 1; + } + else + { + size = 0; + } + alignment = MAX2(size,1); + + int vsize = type->vector_elements; + // float3 etc in Metal has both sizeof and alignment same as float4 + if (vsize == 3) + vsize = 4; + + size *= vsize; + alignment *= vsize; + + const int msize = type->matrix_columns; + size *= msize; + + size *= asize; +} + +void ir_print_metal_visitor::visit(ir_variable *ir) +{ + const char *const cent = (ir->data.centroid) ? "centroid " : ""; + const char *const inv = (ir->data.invariant) ? "invariant " : ""; + const char *const mode[ir_var_mode_count] = { "", " ", " ", " ", " ", "in ", "out ", "inout ", "", "", "" }; + + const char *const interp[] = { "", "smooth ", "flat ", "noperspective " }; + + // 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)) + { + long id = (long)hash_table_find (globals->var_hash, ir); + if (id == 0) + { + id = ++globals->var_counter; + hash_table_insert (globals->var_hash, (void*)id, ir); + } + } + + // auto/temp variables in global scope are postponed to main function + if (this->mode != kPrintGlslNone && (ir->data.mode == ir_var_auto || ir->data.mode == ir_var_temporary)) + { + assert (!this->globals->main_function_done); + this->globals->global_assignements.push_tail (new(this->globals->mem_ctx) ga_entry_metal(ir)); + skipped_this_ir = true; + return; + } + + // if this is a loop induction variable, do not print it + // (will be printed inside loop body) + if (!inside_loop_body) + { + loop_variable_state* inductor_state = loopstate->get_for_inductor(ir); + if (inductor_state && inductor_state->private_induction_variable_count == 1) + { + skipped_this_ir = true; + return; + } + } + + buffer.asprintf_append ("%s%s%s%s", + cent, inv, interp[ir->data.interpolation], mode[ir->data.mode]); + print_type(buffer, ir, ir->type, false); + buffer.asprintf_append (" "); + print_var_name (ir); + print_type_post(buffer, ir->type, false); + + // special built-in variables + if (!strcmp(ir->name, "gl_FragDepth")) + buffer.asprintf_append (" [[depth(any)]]"); + else if (!strcmp(ir->name, "gl_FragCoord")) + buffer.asprintf_append (" [[position]]"); + else if (!strcmp(ir->name, "gl_FrontFacing")) + buffer.asprintf_append (" [[front_facing]]"); + else if (!strcmp(ir->name, "gl_PointCoord")) + buffer.asprintf_append (" [[point_coord]]"); + else if (!strcmp(ir->name, "gl_PointSize")) + buffer.asprintf_append (" [[point_size]]"); + else if (!strcmp(ir->name, "gl_Position")) + buffer.asprintf_append (" [[position]]"); + else if (!strcmp(ir->name, "gl_VertexID")) + buffer.asprintf_append (" [[vertex_id]]"); + else if (!strcmp(ir->name, "gl_InstanceID")) + buffer.asprintf_append (" [[instance_id]]"); + + // vertex shader input attribute? + if (this->mode_whole == kPrintGlslVertex && ir->data.mode == ir_var_shader_in) + { + buffer.asprintf_append (" [[attribute(%i)]]", ctx.attributeCounter); + ir->data.explicit_location = 1; + ir->data.location = ctx.attributeCounter; + ++ctx.attributeCounter; + } + + // fragment shader output? + if (this->mode_whole == kPrintGlslFragment && (ir->data.mode == ir_var_shader_out || ir->data.mode == ir_var_shader_inout)) + { + if (!ir->data.explicit_location) + { + ir->data.explicit_location = 1; + ir->data.location = FRAG_RESULT_DATA0 + ctx.colorCounter; + ++ctx.colorCounter; + } + + if (ir->data.explicit_location) + { + const int binding_base = (int)FRAG_RESULT_DATA0; + const int location = ir->data.location - binding_base; + if (location >= 0 && !ir->type->is_array()) + buffer.asprintf_append (" [[color(%d)]]", location); + } + } + + // uniform texture? + if (ir->data.mode == ir_var_uniform && ctx.writingParams) + { + buffer.asprintf_append (" [[texture(%i)]]", ctx.textureCounter); + buffer.asprintf_append (", sampler _mtlsmp_%s [[sampler(%i)]]", ir->name, ctx.textureCounter); + ir->data.explicit_location = 1; + ir->data.location = ctx.textureCounter; + ++ctx.textureCounter; + } + // regular uniform? + if (ir->data.mode == ir_var_uniform && !ctx.writingParams) + { + int size, align; + get_metal_type_size(ir->type, (glsl_precision)ir->data.precision, size, align); + + int loc = ctx.uniformLocationCounter; + loc = (loc + align-1) & ~(align-1); // align it + + ir->data.explicit_location = 1; + ir->data.location = loc; + + loc += size; + ctx.uniformLocationCounter = loc; + } + + if (ir->constant_value && + ir->data.mode != ir_var_shader_in && + ir->data.mode != ir_var_shader_out && + ir->data.mode != ir_var_shader_inout && + ir->data.mode != ir_var_function_in && + ir->data.mode != ir_var_function_out && + ir->data.mode != ir_var_function_inout) + { + buffer.asprintf_append (" = "); + visit (ir->constant_value); + } +} + + +void ir_print_metal_visitor::visit(ir_function_signature *ir) +{ + const bool isMain = (strcmp(ir->function()->name, "main") == 0); + + if (!isMain) + { + print_type(buffer, ir, ir->return_type, true); + buffer.asprintf_append (" %s (", ir->function_name()); + + if (!ir->parameters.is_empty()) + { + buffer.asprintf_append ("\n"); + + indentation++; previous_skipped = false; + bool first = true; + foreach_in_list(ir_variable, inst, &ir->parameters) + { + if (!first) + buffer.asprintf_append (",\n"); + indent(); + inst->accept(this); + first = false; + } + indentation--; + + buffer.asprintf_append ("\n"); + indent(); + } + } + else + { + if (this->mode_whole == kPrintGlslFragment) + buffer.asprintf_append ("fragment "); + if (this->mode_whole == kPrintGlslVertex) + buffer.asprintf_append ("vertex "); + buffer.asprintf_append ("xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]"); + if (!ctx.paramsStr.empty()) + { + buffer.asprintf_append ("%s", ctx.paramsStr.c_str()); + } + } + + if (ir->body.is_empty()) + { + buffer.asprintf_append (");\n"); + return; + } + + buffer.asprintf_append (")\n"); + + indent(); + buffer.asprintf_append ("{\n"); + indentation++; previous_skipped = false; + + if (isMain) + { + // output struct + indent(); buffer.asprintf_append ("xlatMtlShaderOutput _mtl_o;\n"); + + // insert postponed global assigments and variable declarations + assert (!globals->main_function_done); + globals->main_function_done = true; + foreach_in_list(ga_entry_metal, node, &globals->global_assignements) + { + ir_instruction* as = node->ir; + as->accept(this); + buffer.asprintf_append(";\n"); + } + } + + foreach_in_list(ir_instruction, inst, &ir->body) { + indent(); + inst->accept(this); + end_statement_line(); + } + + if (isMain) + { + // return stuff + indent(); buffer.asprintf_append ("return _mtl_o;\n"); + } + + indentation--; + indent(); + buffer.asprintf_append ("}\n"); +} + +void ir_print_metal_visitor::visit(ir_function *ir) +{ + bool found_non_builtin_proto = false; + + foreach_in_list(ir_function_signature, sig, &ir->signatures) { + if (!sig->is_builtin()) + found_non_builtin_proto = true; + } + if (!found_non_builtin_proto) + return; + + PrintGlslMode oldMode = this->mode; + this->mode = kPrintGlslNone; + + foreach_in_list(ir_function_signature, sig, &ir->signatures) { + indent(); + sig->accept(this); + buffer.asprintf_append ("\n"); + } + + this->mode = oldMode; + + indent(); +} + + +static const char *const operator_glsl_strs[] = { + "~", + "!", + "-", + "abs", + "sign", + "1.0/", + "rsqrt", + "sqrt", + "normalize", + "exp", + "log", + "exp2", + "log2", + "int", // f2i + "int", // f2u + "float", // i2f + "bool", // f2b + "float", // b2f + "bool", // i2b + "int", // b2i + "float", // u2f + "int", // i2u + "int", // u2i + "float", // bit i2f + "int", // bit f2i + "float", // bit u2f + "int", // bit f2u + "any", + "trunc", + "ceil", + "floor", + "fract", + "rint", + "sin", + "cos", + "fast::sin", // reduced + "fast::cos", // reduced + "dfdx", + "dfdx", // coarse + "dfdx", // fine + "dfdy", + "dfdy", // coarse + "dfdy", // fine + "packSnorm2x16", + "packSnorm4x8", + "packUnorm2x16", + "packUnorm4x8", + "packHalf2x16", + "unpackSnorm2x16", + "unpackSnorm4x8", + "unpackUnorm2x16", + "unpackUnorm4x8", + "unpackHalf2x16", + "unpackHalf2x16_splitX_TODO", + "unpackHalf2x16_splitY_TODO", + "bitfieldReverse", + "bitCount", + "findMSB", + "findLSB", + "saturate", + "noise", + "interpolateAtCentroid_TODO", + "+", + "-", + "*", + "*_imul_high_TODO", + "/", + "carry_TODO", + "borrow_TODO", + "mod", + "<", + ">", + "<=", + ">=", + "==", + "!=", + "==", + "!=", + "<<", + ">>", + "&", + "^", + "|", + "&&", + "^^", + "||", + "dot", + "min", + "max", + "pow", + "packHalf2x16_split_TODO", + "bfm_TODO", + "uboloadTODO", + "ldexp_TODO", + "vectorExtract_TODO", + "interpolateAtOffset_TODO", + "interpolateAtSample_TODO", + "fma", + "clamp", + "mix", + "csel_TODO", + "bfi_TODO", + "bitfield_extract_TODO", + "vector_insert_TODO", + "bitfield_insert_TODO", + "vectorTODO", +}; + + +static bool is_binop_func_like(ir_expression_operation op, const glsl_type* type) +{ + if (op == ir_binop_mod || + (op >= ir_binop_dot && op <= ir_binop_pow)) + return true; + return false; +} + + +static bool is_different_precision(glsl_precision a, glsl_precision b) +{ + // Tread "undefined" as high precision + if (a == glsl_precision_undefined) + a = glsl_precision_high; + if (b == glsl_precision_undefined) + b = glsl_precision_high; + // Metal does not have "low" precision; treat as medium + if (a == glsl_precision_low) + a = glsl_precision_medium; + if (b == glsl_precision_low) + b = glsl_precision_medium; + + return a != b; +} + + +static void print_cast(string_buffer& buffer, glsl_precision prec, ir_rvalue* ir) +{ + buffer.asprintf_append ("("); + print_type_precision(buffer, ir->type, prec, false); + buffer.asprintf_append (")"); +} + + +void ir_print_metal_visitor::visit(ir_expression *ir) +{ + ++this->expression_depth; + newline_indent(); + + glsl_precision arg_prec = glsl_precision_undefined; + if (ir->operands[0]) + arg_prec = higher_precision(arg_prec, ir->operands[0]->get_precision()); + if (ir->operands[1]) + arg_prec = higher_precision(arg_prec, ir->operands[1]->get_precision()); + if (ir->operands[2]) + arg_prec = higher_precision(arg_prec, ir->operands[2]->get_precision()); + glsl_precision res_prec = ir->get_precision(); + + bool op0cast = ir->operands[0] && is_different_precision(arg_prec, ir->operands[0]->get_precision()); + bool op1cast = ir->operands[1] && is_different_precision(arg_prec, ir->operands[1]->get_precision()); + bool op2cast = ir->operands[2] && is_different_precision(arg_prec, ir->operands[2]->get_precision()); + + // Metal does not support matrix precision casts, so when any of the arguments is a matrix, + // take precision from it. This isn't fully robust now, but oh well. + if (op0cast && ir->operands[0]->type->is_matrix() && !op1cast) + { + op0cast = false; + arg_prec = ir->operands[0]->get_precision(); + op1cast = ir->operands[1] && is_different_precision(arg_prec, ir->operands[1]->get_precision()); + } + if (op1cast && ir->operands[1]->type->is_matrix() && !op0cast) + { + op1cast = false; + arg_prec = ir->operands[1]->get_precision(); + op0cast = ir->operands[0] && is_different_precision(arg_prec, ir->operands[0]->get_precision()); + } + + const bool rescast = is_different_precision(arg_prec, res_prec) && !ir->type->is_boolean(); + if (rescast) + { + buffer.asprintf_append ("("); + print_cast (buffer, res_prec, ir); + } + + if (ir->get_num_operands() == 1) + { + if (op0cast) + print_cast (buffer, arg_prec, ir->operands[0]); + if (ir->operation >= ir_unop_f2i && ir->operation < ir_unop_any) { + print_type(buffer, ir, ir->type, true); + buffer.asprintf_append ("("); + } else if (ir->operation == ir_unop_rcp) { + buffer.asprintf_append ("(1.0/("); + } else { + buffer.asprintf_append ("%s(", operator_glsl_strs[ir->operation]); + } + if (ir->operands[0]) + ir->operands[0]->accept(this); + buffer.asprintf_append (")"); + if (ir->operation == ir_unop_rcp) { + buffer.asprintf_append (")"); + } + } + else if (ir->operation == ir_binop_vector_extract) + { + // a[b] + + if (ir->operands[0]) + ir->operands[0]->accept(this); + buffer.asprintf_append ("["); + if (ir->operands[1]) + ir->operands[1]->accept(this); + buffer.asprintf_append ("]"); + } + else if (is_binop_func_like(ir->operation, ir->type)) + { + if (ir->operation == ir_binop_mod) + { + buffer.asprintf_append ("("); + print_type(buffer, ir, ir->type, true); + buffer.asprintf_append ("("); + } + buffer.asprintf_append ("%s (", operator_glsl_strs[ir->operation]); + + if (ir->operands[0]) + { + if (op0cast) + print_cast (buffer, arg_prec, ir->operands[0]); + ir->operands[0]->accept(this); + } + buffer.asprintf_append (", "); + if (ir->operands[1]) + { + if (op1cast) + print_cast (buffer, arg_prec, ir->operands[1]); + ir->operands[1]->accept(this); + } + buffer.asprintf_append (")"); + if (ir->operation == ir_binop_mod) + buffer.asprintf_append ("))"); + } + else if (ir->get_num_operands() == 2) + { + buffer.asprintf_append ("("); + if (ir->operands[0]) + { + if (op0cast) + print_cast (buffer, arg_prec, ir->operands[0]); + ir->operands[0]->accept(this); + } + + buffer.asprintf_append (" %s ", operator_glsl_strs[ir->operation]); + + if (ir->operands[1]) + { + if (op1cast) + print_cast (buffer, arg_prec, ir->operands[1]); + ir->operands[1]->accept(this); + } + buffer.asprintf_append (")"); + } + else + { + // ternary op + buffer.asprintf_append ("%s (", operator_glsl_strs[ir->operation]); + if (ir->operands[0]) + { + if (op0cast) + print_cast (buffer, arg_prec, ir->operands[0]); + ir->operands[0]->accept(this); + } + buffer.asprintf_append (", "); + if (ir->operands[1]) + { + if (op1cast) + print_cast (buffer, arg_prec, ir->operands[1]); + ir->operands[1]->accept(this); + } + buffer.asprintf_append (", "); + if (ir->operands[2]) + { + if (op2cast) + print_cast (buffer, arg_prec, ir->operands[2]); + ir->operands[2]->accept(this); + } + buffer.asprintf_append (")"); + } + + if (rescast) + { + buffer.asprintf_append (")"); + } + + + newline_deindent(); + --this->expression_depth; +} + +static int tex_sampler_dim_size[] = { + 1, 2, 3, 3, 2, 2, 2, +}; + + +static void print_texture_uv (ir_print_metal_visitor* vis, ir_texture* ir, bool is_shadow, bool is_proj, int uv_dim, int sampler_uv_dim) +{ + if (!is_shadow) + { + if (!is_proj) + { + // regular UV + vis->buffer.asprintf_append (sampler_uv_dim == 3 ? "(float3)(" : "(float2)("); + ir->coordinate->accept(vis); + vis->buffer.asprintf_append (")"); + } + else + { + // regular projected + vis->buffer.asprintf_append (sampler_uv_dim == 3 ? "((float3)(" : "((float2)("); + ir->coordinate->accept(vis); + vis->buffer.asprintf_append (sampler_uv_dim == 3 ? ").xyz / (float)(" : ").xy / (float)("); + ir->coordinate->accept(vis); + vis->buffer.asprintf_append (uv_dim == 4 ? ").w)" : ").z)"); + } + } + else if (is_shadow) + { + if (!is_proj) + { + // regular shadow + vis->buffer.asprintf_append (uv_dim == 4 ? "(float3)(" : "(float2)("); + ir->coordinate->accept(vis); + vis->buffer.asprintf_append (uv_dim == 4 ? ").xyz, (" : ").xy, (float)("); + ir->coordinate->accept(vis); + vis->buffer.asprintf_append (uv_dim == 4 ? ").w" : ").z"); + } + else + { + // projected shadow + vis->buffer.asprintf_append ("(float2)("); + ir->coordinate->accept(vis); + vis->buffer.asprintf_append (").xy / (float)("); + ir->coordinate->accept(vis); + vis->buffer.asprintf_append (").w, (float)("); + ir->coordinate->accept(vis); + vis->buffer.asprintf_append (").z / (float)("); + ir->coordinate->accept(vis); + vis->buffer.asprintf_append (").w"); + } + } +} + +void ir_print_metal_visitor::visit(ir_texture *ir) +{ + glsl_sampler_dim sampler_dim = (glsl_sampler_dim)ir->sampler->type->sampler_dimensionality; + const bool is_shadow = ir->sampler->type->sampler_shadow; + const glsl_type* uv_type = ir->coordinate->type; + const int uv_dim = uv_type->vector_elements; + int sampler_uv_dim = tex_sampler_dim_size[sampler_dim]; + if (is_shadow) + sampler_uv_dim += 1; + const bool is_proj = (uv_dim > sampler_uv_dim); + + // texture name & call to sample + ir->sampler->accept(this); + if (is_shadow) + { + // For shadow sampling, Metal right now needs a hardcoded sampler state :| + if (!ctx.shadowSamplerDone) + { + ctx.prefixStr.asprintf_append("constexpr sampler _mtl_xl_shadow_sampler(address::clamp_to_edge, filter::linear, compare_func::less);\n"); + ctx.shadowSamplerDone = true; + } + buffer.asprintf_append (".sample_compare(_mtl_xl_shadow_sampler"); + } + else + { + buffer.asprintf_append (".sample(_mtlsmp_"); + ir->sampler->accept(this); + } + buffer.asprintf_append (", "); + + // texture coordinate + print_texture_uv (this, ir, is_shadow, is_proj, uv_dim, sampler_uv_dim); + + // lod bias + if (ir->op == ir_txb) + { + buffer.asprintf_append (", bias("); + ir->lod_info.bias->accept(this); + buffer.asprintf_append (")"); + } + + // lod + if (ir->op == ir_txl) + { + buffer.asprintf_append (", level("); + ir->lod_info.lod->accept(this); + buffer.asprintf_append (")"); + } + + // grad + if (ir->op == ir_txd) + { + if (sampler_dim == GLSL_SAMPLER_DIM_CUBE) + buffer.asprintf_append (", gradientcube((float3)("); + else + buffer.asprintf_append (", gradient2d((float2)("); + + ir->lod_info.grad.dPdx->accept(this); + + if (sampler_dim == GLSL_SAMPLER_DIM_CUBE) + buffer.asprintf_append ("), (float3)("); + else + buffer.asprintf_append ("), (float2)("); + + ir->lod_info.grad.dPdy->accept(this); + buffer.asprintf_append ("))"); + } + + //@TODO: texelFetch + //@TODO: projected + //@TODO: shadowmaps + //@TODO: pixel offsets + + buffer.asprintf_append (")"); +} + + +void ir_print_metal_visitor::visit(ir_swizzle *ir) +{ + const unsigned swiz[4] = { + ir->mask.x, + ir->mask.y, + ir->mask.z, + ir->mask.w, + }; + + if (ir->val->type == glsl_type::float_type || ir->val->type == glsl_type::int_type) + { + if (ir->mask.num_components != 1) + { + print_type(buffer, ir, ir->type, true); + buffer.asprintf_append ("("); + } + } + + ir->val->accept(this); + + if (ir->val->type == glsl_type::float_type || ir->val->type == glsl_type::int_type) + { + if (ir->mask.num_components != 1) + { + buffer.asprintf_append (")"); + } + return; + } + + buffer.asprintf_append ("."); + for (unsigned i = 0; i < ir->mask.num_components; i++) { + buffer.asprintf_append ("%c", "xyzw"[swiz[i]]); + } +} + +static void print_var_inout (string_buffer& buf, ir_variable* var, bool insideLHS) +{ + if (var->data.mode == ir_var_shader_in) + buf.asprintf_append ("_mtl_i."); + if (var->data.mode == ir_var_shader_out) + buf.asprintf_append ("_mtl_o."); + if (var->data.mode == ir_var_uniform && !var->type->is_sampler()) + buf.asprintf_append ("_mtl_u."); + if (var->data.mode == ir_var_shader_inout) + buf.asprintf_append (insideLHS ? "_mtl_o." : "_mtl_i."); +} + +void ir_print_metal_visitor::visit(ir_dereference_variable *ir) +{ + ir_variable *var = ir->variable_referenced(); + print_var_inout(buffer, var, this->inside_lhs); + print_var_name (var); +} + + +void ir_print_metal_visitor::visit(ir_dereference_array *ir) +{ + ir->array->accept(this); + buffer.asprintf_append ("["); + ir->array_index->accept(this); + buffer.asprintf_append ("]"); +} + + +void ir_print_metal_visitor::visit(ir_dereference_record *ir) +{ + ir->record->accept(this); + buffer.asprintf_append (".%s", ir->field); +} + + + + +void ir_print_metal_visitor::emit_assignment_part (ir_dereference* lhs, ir_rvalue* rhs, unsigned write_mask, ir_rvalue* dstIndex) +{ + const bool prev_lhs_flag = this->inside_lhs; + this->inside_lhs = true; + + lhs->accept(this); + + this->inside_lhs = prev_lhs_flag; + + const glsl_type* lhsType = lhs->type; + if (dstIndex) + { + // if dst index is a constant, then emit a swizzle + ir_constant* dstConst = dstIndex->as_constant(); + if (dstConst) + { + const char* comps = "xyzw"; + char comp = comps[dstConst->get_int_component(0)]; + buffer.asprintf_append (".%c", comp); + } + else + { + buffer.asprintf_append ("["); + dstIndex->accept(this); + buffer.asprintf_append ("]"); + } + + if (lhsType->matrix_columns <= 1 && lhsType->vector_elements > 1) + lhsType = glsl_type::get_instance(lhsType->base_type, 1, 1); + } + + char mask[5]; + unsigned j = 0; + const glsl_type* rhsType = rhs->type; + if (!dstIndex && lhsType->matrix_columns <= 1 && lhsType->vector_elements > 1 && write_mask != (1<vector_elements)-1) + { + for (unsigned i = 0; i < 4; i++) { + if ((write_mask & (1 << i)) != 0) { + mask[j] = "xyzw"[i]; + j++; + } + } + lhsType = glsl_type::get_instance(lhsType->base_type, j, 1); + } + mask[j] = '\0'; + bool hasWriteMask = false; + if (mask[0]) + { + buffer.asprintf_append (".%s", mask); + hasWriteMask = true; + } + + buffer.asprintf_append (" = "); + + const bool typeMismatch = !dstIndex && (lhsType != rhsType); + + const bool precMismatch = is_different_precision (lhs->get_precision(), rhs->get_precision()); + const bool addSwizzle = hasWriteMask && typeMismatch; + if (typeMismatch || precMismatch) + { + if (!addSwizzle) + { + if (lhsType->is_matrix()) + { + // Metal does not have matrix precision casts right now, so emit workaround + // functions that would do that. + if (!ctx.matrixCastsDone) + { + ctx.prefixStr.asprintf_append( + "inline float4x4 _xlcast_float4x4(half4x4 v) { return float4x4(float4(v[0]), float4(v[1]), float4(v[2]), float4(v[3])); }\n" + "inline float3x3 _xlcast_float3x3(half3x3 v) { return float3x3(float3(v[0]), float3(v[1]), float3(v[2])); }\n" + "inline float2x2 _xlcast_float2x2(half2x2 v) { return float2x2(float2(v[0]), float2(v[1])); }\n" + "inline half4x4 _xlcast_half4x4(float4x4 v) { return half4x4(half4(v[0]), half4(v[1]), half4(v[2]), half4(v[3])); }\n" + "inline half3x3 _xlcast_half3x3(float3x3 v) { return half3x3(half3(v[0]), half3(v[1]), half3(v[2])); }\n" + "inline half2x2 _xlcast_half2x2(float2x2 v) { return half2x2(half2(v[0]), half2(v[1])); }\n" + ); + ctx.matrixCastsDone = true; + } + buffer.asprintf_append ("_xlcast_"); + } + print_type(buffer, lhs, lhsType, true); + } + buffer.asprintf_append ("("); + } + + rhs->accept(this); + + if (typeMismatch || precMismatch) + { + buffer.asprintf_append (")"); + if (addSwizzle) + buffer.asprintf_append (".%s", mask); + } +} + + +// Try to print (X = X + const) as (X += const), mostly to satisfy +// OpenGL ES 2.0 loop syntax restrictions. +static bool try_print_increment (ir_print_metal_visitor* vis, ir_assignment* ir) +{ + if (ir->condition) + return false; + + // Needs to be + on rhs + ir_expression* rhsOp = ir->rhs->as_expression(); + if (!rhsOp || rhsOp->operation != ir_binop_add) + return false; + + // Needs to write to whole variable + ir_variable* lhsVar = ir->whole_variable_written(); + if (lhsVar == NULL) + return false; + + // Types must match + if (ir->lhs->type != ir->rhs->type) + return false; + + // Type must be scalar + if (!ir->lhs->type->is_scalar()) + return false; + + // rhs0 must be variable deref, same one as lhs + ir_dereference_variable* rhsDeref = rhsOp->operands[0]->as_dereference_variable(); + if (rhsDeref == NULL) + return false; + if (lhsVar != rhsDeref->var) + return false; + + // rhs1 must be a constant + ir_constant* rhsConst = rhsOp->operands[1]->as_constant(); + if (!rhsConst) + return false; + + // print variable name + const bool prev_lhs_flag = vis->inside_lhs; + vis->inside_lhs = true; + + ir->lhs->accept (vis); + + vis->inside_lhs = prev_lhs_flag; + + + // print ++ or +=const + if (ir->lhs->type->base_type <= GLSL_TYPE_INT && rhsConst->is_one()) + { + vis->buffer.asprintf_append ("++"); + } + else + { + vis->buffer.asprintf_append(" += "); + rhsConst->accept (vis); + } + + return true; +} + + +void ir_print_metal_visitor::visit(ir_assignment *ir) +{ + // if this is a loop induction variable initial assignment, and we aren't inside loop body: + // do not print it (will be printed when inside loop body) + if (!inside_loop_body) + { + ir_variable* whole_var = ir->whole_variable_written(); + 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) + { + skipped_this_ir = true; + return; + } + } + } + + // assignments in global scope are postponed to main function + if (this->mode != kPrintGlslNone) + { + assert (!this->globals->main_function_done); + this->globals->global_assignements.push_tail (new(this->globals->mem_ctx) ga_entry_metal(ir)); + buffer.asprintf_append ("//"); // for the ; that will follow (ugly, I know) + return; + } + + // if RHS is ir_triop_vector_insert, then we have to do some special dance. If source expression is: + // dst = vector_insert (a, b, idx) + // then emit it like: + // dst = a; + // dst.idx = b; + ir_expression* rhsOp = ir->rhs->as_expression(); + if (rhsOp && rhsOp->operation == ir_triop_vector_insert) + { + // skip assignment if lhs and rhs would be the same + bool skip_assign = false; + ir_dereference_variable* lhsDeref = ir->lhs->as_dereference_variable(); + ir_dereference_variable* rhsDeref = rhsOp->operands[0]->as_dereference_variable(); + if (lhsDeref && rhsDeref) + { + if (lhsDeref->var == rhsDeref->var) + skip_assign = true; + } + + if (!skip_assign) + { + emit_assignment_part(ir->lhs, rhsOp->operands[0], ir->write_mask, NULL); + buffer.asprintf_append ("; "); + } + emit_assignment_part(ir->lhs, rhsOp->operands[1], ir->write_mask, rhsOp->operands[2]); + return; + } + + if (try_print_increment (this, ir)) + return; + + if (ir->condition) + { + ir->condition->accept(this); + buffer.asprintf_append (" "); + } + + 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; + + // hoist array & struct constants into global scope + if (type->is_array() || type->is_record()) + { + size_t id = (size_t)hash_table_find(globals->const_hash, ir); + if (id == 0) + { + id = ++globals->const_counter; + hash_table_insert (globals->const_hash, (void*)id, ir); + globals->global_constants.push_tail(new(globals->mem_ctx) gconst_entry_metal(ir,id)); + } + buffer.asprintf_append("_xlat_mtl_const%i", (int)id); + return; + } + + if (type == glsl_type::float_type) + { + print_float (buffer, ir->value.f[0]); + return; + } + else if (type == glsl_type::int_type) + { + buffer.asprintf_append ("%d", ir->value.i[0]); + return; + } + else if (type == glsl_type::uint_type) + { + buffer.asprintf_append ("%u", ir->value.u[0]); + return; + } + + const glsl_type *const base_type = ir->type->get_base_type(); + + print_type(buffer, ir, type, true); + buffer.asprintf_append ("("); + + // should be dealt with above + assert(!ir->type->is_array()); + assert(!ir->type->is_record()); + bool first = true; + + // Metal needs matrices to be constructed from vectors, not from a bunch of scalars. + // So instead of printing mat2(1,2,3,4) like in glsl, we have to print float2x2(float2(1,2), float2(3,4)) + // here. + const bool mtx = ir->type->is_matrix(); + const glsl_type* vec_type = NULL; // matrix column type + if (mtx) + vec_type = glsl_type::get_instance (ir->type->base_type, ir->type->vector_elements, 1); + + for (unsigned i = 0; i < ir->type->components(); i++) + { + if (!first) + { + if (mtx && (i % ir->type->matrix_columns == 0)) + buffer.asprintf_append (")"); + buffer.asprintf_append (", "); + } + first = false; + + if (mtx && (i % ir->type->matrix_columns == 0)) + { + print_type(buffer, ir, vec_type, true); + buffer.asprintf_append ("("); + } + + switch (base_type->base_type) { + case GLSL_TYPE_UINT: buffer.asprintf_append ("%u", ir->value.u[i]); break; + case GLSL_TYPE_INT: 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); + } + } + if (mtx) + buffer.asprintf_append (")"); + buffer.asprintf_append (")"); +} + + +void +ir_print_metal_visitor::visit(ir_call *ir) +{ + // calls in global scope are postponed to main function + if (this->mode != kPrintGlslNone) + { + assert (!this->globals->main_function_done); + this->globals->global_assignements.push_tail (new(this->globals->mem_ctx) ga_entry_metal(ir)); + buffer.asprintf_append ("//"); // for the ; that will follow (ugly, I know) + return; + } + + if (ir->return_deref) + { + visit(ir->return_deref); + buffer.asprintf_append (" = "); + } + + buffer.asprintf_append ("%s (", ir->callee_name()); + bool first = true; + foreach_in_list(ir_instruction, inst, &ir->actual_parameters) { + if (!first) + buffer.asprintf_append (", "); + inst->accept(this); + first = false; + } + buffer.asprintf_append (")"); +} + + +void +ir_print_metal_visitor::visit(ir_return *ir) +{ + buffer.asprintf_append ("return"); + + ir_rvalue *const value = ir->get_value(); + if (value) { + buffer.asprintf_append (" "); + value->accept(this); + } +} + + +void +ir_print_metal_visitor::visit(ir_discard *ir) +{ + buffer.asprintf_append ("discard_fragment()"); + + if (ir->condition != NULL) { + buffer.asprintf_append (" TODO "); + ir->condition->accept(this); + } +} + + +void +ir_print_metal_visitor::visit(ir_if *ir) +{ + buffer.asprintf_append ("if ("); + ir->condition->accept(this); + + buffer.asprintf_append (") {\n"); + indentation++; previous_skipped = false; + + + foreach_in_list(ir_instruction, inst, &ir->then_instructions) { + indent(); + inst->accept(this); + end_statement_line(); + } + + indentation--; + indent(); + buffer.asprintf_append ("}"); + + if (!ir->else_instructions.is_empty()) + { + buffer.asprintf_append (" else {\n"); + indentation++; previous_skipped = false; + + foreach_in_list(ir_instruction, inst, &ir->else_instructions) { + indent(); + inst->accept(this); + end_statement_line(); + } + indentation--; + indent(); + buffer.asprintf_append ("}"); + } +} + + +bool ir_print_metal_visitor::emit_canonical_for (ir_loop* ir) +{ + loop_variable_state* const ls = this->loopstate->get(ir); + if (ls == NULL) + return false; + + if (ls->induction_variables.is_empty()) + return false; + + if (ls->terminators.is_empty()) + return false; + + // only support for loops with one terminator condition + int terminatorCount = ls->terminators.length(); + if (terminatorCount != 1) + 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); + + buffer.asprintf_append("for ("); + inside_loop_body = true; + + // emit loop induction variable declarations. + // only for loops with single induction variable, to avoid cases of different types of them + if (ls->private_induction_variable_count == 1) + { + foreach_in_list(loop_variable, indvar, &ls->induction_variables) + { + if (!this->loopstate->get_for_inductor(indvar->var)) + continue; + + ir_variable* var = indvar->var; + print_type(buffer, var, var->type, false); + buffer.asprintf_append (" "); + print_var_inout(buffer, var, true); + print_var_name (var); + print_type_post(buffer, var->type, false); + if (indvar->initial_value) + { + buffer.asprintf_append (" = "); + indvar->initial_value->accept(this); + } + } + } + buffer.asprintf_append("; "); + + // emit loop terminating conditions + foreach_in_list(loop_terminator, term, &ls->terminators) + { + hash_table_insert(terminator_hash, term, term->ir); + + // IR has conditions in the form of "if (x) break", + // whereas for loop needs them negated, in the form + // if "while (x) continue the loop". + // See if we can print them using syntax that reads nice. + bool handled = false; + ir_expression* term_expr = term->ir->condition->as_expression(); + if (term_expr) + { + // Binary comparison conditions + const char* termOp = NULL; + switch (term_expr->operation) + { + case ir_binop_less: termOp = ">="; break; + case ir_binop_greater: termOp = "<="; break; + case ir_binop_lequal: termOp = ">"; break; + case ir_binop_gequal: termOp = "<"; break; + case ir_binop_equal: termOp = "!="; break; + case ir_binop_nequal: termOp = "=="; break; + default: break; + } + if (termOp != NULL) + { + term_expr->operands[0]->accept(this); + buffer.asprintf_append(" %s ", termOp); + term_expr->operands[1]->accept(this); + handled = true; + } + + // Unary logic not + if (!handled && term_expr->operation == ir_unop_logic_not) + { + term_expr->operands[0]->accept(this); + handled = true; + } + } + + // More complex condition, print as "!(x)" + if (!handled) + { + buffer.asprintf_append("!("); + term->ir->condition->accept(this); + buffer.asprintf_append(")"); + } + } + buffer.asprintf_append("; "); + + // emit loop induction variable updates + bool first = true; + foreach_in_list(loop_variable, indvar, &ls->induction_variables) + { + hash_table_insert(induction_hash, indvar, indvar->first_assignment); + if (!first) + buffer.asprintf_append(", "); + visit(indvar->first_assignment); + first = false; + } + buffer.asprintf_append(") {\n"); + + inside_loop_body = false; + + // emit loop body + indentation++; previous_skipped = false; + foreach_in_list(ir_instruction, inst, &ir->body_instructions) { + // skip termination & induction statements, + // they are part of "for" clause + if (hash_table_find(terminator_hash, inst)) + continue; + if (hash_table_find(induction_hash, inst)) + continue; + + indent(); + inst->accept(this); + end_statement_line(); + } + indentation--; + + indent(); + buffer.asprintf_append("}"); + + hash_table_dtor (terminator_hash); + hash_table_dtor (induction_hash); + + return true; +} + + +void +ir_print_metal_visitor::visit(ir_loop *ir) +{ + if (emit_canonical_for(ir)) + return; + + buffer.asprintf_append ("while (true) {\n"); + indentation++; previous_skipped = false; + foreach_in_list(ir_instruction, inst, &ir->body_instructions) { + indent(); + inst->accept(this); + end_statement_line(); + } + indentation--; + indent(); + buffer.asprintf_append ("}"); +} + + +void +ir_print_metal_visitor::visit(ir_loop_jump *ir) +{ + buffer.asprintf_append ("%s", ir->is_break() ? "break" : "continue"); +} + +void +ir_print_metal_visitor::visit(ir_precision_statement *ir) +{ +} + +void +ir_print_metal_visitor::visit(ir_typedecl_statement *ir) +{ + const glsl_type *const s = ir->type_decl; + buffer.asprintf_append ("struct %s {\n", s->name); + + for (unsigned j = 0; j < s->length; j++) { + buffer.asprintf_append (" "); + //if (state->es_shader) + // buffer.asprintf_append ("%s", get_precision_string(s->fields.structure[j].precision)); //@TODO + print_type(buffer, ir, s->fields.structure[j].type, false); + buffer.asprintf_append (" %s", s->fields.structure[j].name); + print_type_post(buffer, s->fields.structure[j].type, false); + buffer.asprintf_append (";\n"); + } + buffer.asprintf_append ("}"); +} + +void +ir_print_metal_visitor::visit(ir_emit_vertex *ir) +{ + buffer.asprintf_append ("emit-vertex-TODO"); +} + +void +ir_print_metal_visitor::visit(ir_end_primitive *ir) +{ + buffer.asprintf_append ("end-primitive-TODO"); +} diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_print_metal_visitor.h b/3rdparty/glsl-optimizer/src/glsl/ir_print_metal_visitor.h new file mode 100644 index 000000000..032edf36f --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/ir_print_metal_visitor.h @@ -0,0 +1,36 @@ +/* -*- c++ -*- */ +/* + * Copyright © 2014 Unity Technologies + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#pragma once +#ifndef IR_PRINT_METAL_VISITOR_H +#define IR_PRINT_METAL_VISITOR_H + +#include "ir.h" +#include "ir_print_glsl_visitor.h" + +extern char* _mesa_print_ir_metal(exec_list *instructions, + struct _mesa_glsl_parse_state *state, + char* buf, PrintGlslMode mode, int* outUniformsSize); + +#endif /* IR_PRINT_GLSL_VISITOR_H */ diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_print_visitor.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_print_visitor.cpp index cc85db467..22a9c82d1 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_print_visitor.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_print_visitor.cpp @@ -27,52 +27,65 @@ #include "main/macros.h" #include "program/hash_table.h" -static void print_type(const glsl_type *t); +static void print_type(FILE *f, const glsl_type *t); void ir_instruction::print(void) const +{ + this->fprint(stdout); +} + +void +ir_instruction::fprint(FILE *f) const { ir_instruction *deconsted = const_cast(this); - ir_print_visitor v; + ir_print_visitor v(f); deconsted->accept(&v); } extern "C" { void -_mesa_print_ir(exec_list *instructions, +_mesa_print_ir(FILE *f, exec_list *instructions, struct _mesa_glsl_parse_state *state) { if (state) { for (unsigned i = 0; i < state->num_user_structures; i++) { const glsl_type *const s = state->user_structures[i]; - printf("(structure (%s) (%s@%p) (%u) (\n", - s->name, s->name, (void *) s, s->length); + fprintf(f, "(structure (%s) (%s@%p) (%u) (\n", + s->name, s->name, (void *) s, s->length); for (unsigned j = 0; j < s->length; j++) { - printf("\t(("); - print_type(s->fields.structure[j].type); - printf(")(%s))\n", s->fields.structure[j].name); + fprintf(f, "\t(("); + print_type(f, s->fields.structure[j].type); + fprintf(f, ")(%s))\n", s->fields.structure[j].name); } - printf(")\n"); + fprintf(f, ")\n"); } } - printf("(\n"); - foreach_list(n, instructions) { - ir_instruction *ir = (ir_instruction *) n; - ir->print(); + fprintf(f, "(\n"); + foreach_in_list(ir_instruction, ir, instructions) { + ir->fprint(f); if (ir->ir_type != ir_type_function) - printf("\n"); + fprintf(f, "\n"); } - printf("\n)"); + fprintf(f, "\n)"); +} + +void +fprint_ir(FILE *f, const void *instruction) +{ + const ir_instruction *ir = (const ir_instruction *)instruction; + ir->fprint(f); } } /* extern "C" */ -ir_print_visitor::ir_print_visitor() +ir_print_visitor::ir_print_visitor(FILE *f) + : f(f) { indentation = 0; printable_names = @@ -91,7 +104,7 @@ ir_print_visitor::~ir_print_visitor() void ir_print_visitor::indent(void) { for (int i = 0; i < indentation; i++) - printf(" "); + fprintf(f, " "); } const char * @@ -125,87 +138,86 @@ ir_print_visitor::unique_name(ir_variable *var) } static void -print_type(const glsl_type *t) +print_type(FILE *f, const glsl_type *t) { if (t->base_type == GLSL_TYPE_ARRAY) { - printf("(array "); - print_type(t->fields.array); - printf(" %u)", t->length); + fprintf(f, "(array "); + print_type(f, t->fields.array); + fprintf(f, " %u)", t->length); } else if ((t->base_type == GLSL_TYPE_STRUCT) - && (strncmp("gl_", t->name, 3) != 0)) { - printf("%s@%p", t->name, (void *) t); + && !is_gl_identifier(t->name)) { + fprintf(f, "%s@%p", t->name, (void *) t); } else { - printf("%s", t->name); + fprintf(f, "%s", t->name); } } -void ir_print_visitor::visit(ir_rvalue *ir) +void ir_print_visitor::visit(ir_rvalue *) { - printf("error"); + fprintf(f, "error"); } void ir_print_visitor::visit(ir_variable *ir) { - printf("(declare "); + fprintf(f, "(declare "); const char *const cent = (ir->data.centroid) ? "centroid " : ""; const char *const samp = (ir->data.sample) ? "sample " : ""; const char *const inv = (ir->data.invariant) ? "invariant " : ""; - const char *const mode[] = { "", "uniform ", "shader_in ", "shader_out ", + const char *const mode[] = { "", "uniform ", "shader_in ", "shader_out ", "shader_inout ", "in ", "out ", "inout ", "const_in ", "sys ", "temporary " }; STATIC_ASSERT(ARRAY_SIZE(mode) == ir_var_mode_count); + const char *const stream [] = {"", "stream1 ", "stream2 ", "stream3 "}; const char *const interp[] = { "", "smooth", "flat", "noperspective" }; STATIC_ASSERT(ARRAY_SIZE(interp) == INTERP_QUALIFIER_COUNT); - printf("(%s%s%s%s%s) ", - cent, samp, inv, mode[ir->data.mode], interp[ir->data.interpolation]); + fprintf(f, "(%s%s%s%s%s%s) ", + cent, samp, inv, mode[ir->data.mode], + stream[ir->data.stream], + interp[ir->data.interpolation]); - print_type(ir->type); - printf(" %s)", unique_name(ir)); + print_type(f, ir->type); + fprintf(f, " %s)", unique_name(ir)); } void ir_print_visitor::visit(ir_function_signature *ir) { _mesa_symbol_table_push_scope(symbols); - printf("(signature "); + fprintf(f, "(signature "); indentation++; - print_type(ir->return_type); - printf("\n"); + print_type(f, ir->return_type); + fprintf(f, "\n"); indent(); - printf("(parameters\n"); + fprintf(f, "(parameters\n"); indentation++; - foreach_list(n, &ir->parameters) { - ir_variable *const inst = (ir_variable *) n; - + foreach_in_list(ir_variable, inst, &ir->parameters) { indent(); inst->accept(this); - printf("\n"); + fprintf(f, "\n"); } indentation--; indent(); - printf(")\n"); + fprintf(f, ")\n"); indent(); - printf("(\n"); + fprintf(f, "(\n"); indentation++; - foreach_list(n, &ir->body) { - ir_instruction *const inst = (ir_instruction *) n; - + foreach_in_list(ir_instruction, inst, &ir->body) { indent(); inst->accept(this); - printf("\n"); + fprintf(f, "\n"); } indentation--; indent(); - printf("))\n"); + fprintf(f, "))\n"); indentation--; _mesa_symbol_table_pop_scope(symbols); } @@ -213,61 +225,60 @@ void ir_print_visitor::visit(ir_function_signature *ir) void ir_print_visitor::visit(ir_function *ir) { - printf("(function %s\n", ir->name); + fprintf(f, "(function %s\n", ir->name); indentation++; - foreach_list(n, &ir->signatures) { - ir_function_signature *const sig = (ir_function_signature *) n; + foreach_in_list(ir_function_signature, sig, &ir->signatures) { indent(); sig->accept(this); - printf("\n"); + fprintf(f, "\n"); } indentation--; indent(); - printf(")\n\n"); + fprintf(f, ")\n\n"); } void ir_print_visitor::visit(ir_expression *ir) { - printf("(expression "); + fprintf(f, "(expression "); - print_type(ir->type); + print_type(f, ir->type); - printf(" %s ", ir->operator_string()); + fprintf(f, " %s ", ir->operator_string()); for (unsigned i = 0; i < ir->get_num_operands(); i++) { ir->operands[i]->accept(this); } - printf(") "); + fprintf(f, ") "); } void ir_print_visitor::visit(ir_texture *ir) { - printf("(%s ", ir->opcode_string()); + fprintf(f, "(%s ", ir->opcode_string()); - print_type(ir->type); - printf(" "); + print_type(f, ir->type); + fprintf(f, " "); ir->sampler->accept(this); - printf(" "); + fprintf(f, " "); if (ir->op != ir_txs && ir->op != ir_query_levels) { ir->coordinate->accept(this); - printf(" "); + fprintf(f, " "); if (ir->offset != NULL) { ir->offset->accept(this); } else { - printf("0"); + fprintf(f, "0"); } - printf(" "); + fprintf(f, " "); } - printf(" "); + fprintf(f, " "); switch (ir->op) { case ir_tex: @@ -286,17 +297,17 @@ void ir_print_visitor::visit(ir_texture *ir) ir->lod_info.sample_index->accept(this); break; case ir_txd: - printf("("); + fprintf(f, "("); ir->lod_info.grad.dPdx->accept(this); - printf(" "); + fprintf(f, " "); ir->lod_info.grad.dPdy->accept(this); - printf(")"); + fprintf(f, ")"); break; case ir_tg4: ir->lod_info.component->accept(this); break; }; - printf(")"); + fprintf(f, ")"); } @@ -309,43 +320,43 @@ void ir_print_visitor::visit(ir_swizzle *ir) ir->mask.w, }; - printf("(swiz "); + fprintf(f, "(swiz "); for (unsigned i = 0; i < ir->mask.num_components; i++) { - printf("%c", "xyzw"[swiz[i]]); + fprintf(f, "%c", "xyzw"[swiz[i]]); } - printf(" "); + fprintf(f, " "); ir->val->accept(this); - printf(")"); + fprintf(f, ")"); } void ir_print_visitor::visit(ir_dereference_variable *ir) { ir_variable *var = ir->variable_referenced(); - printf("(var_ref %s) ", unique_name(var)); + fprintf(f, "(var_ref %s) ", unique_name(var)); } void ir_print_visitor::visit(ir_dereference_array *ir) { - printf("(array_ref "); + fprintf(f, "(array_ref "); ir->array->accept(this); ir->array_index->accept(this); - printf(") "); + fprintf(f, ") "); } void ir_print_visitor::visit(ir_dereference_record *ir) { - printf("(record_ref "); + fprintf(f, "(record_ref "); ir->record->accept(this); - printf(" %s) ", ir->field); + fprintf(f, " %s) ", ir->field); } void ir_print_visitor::visit(ir_assignment *ir) { - printf("(assign "); + fprintf(f, "(assign "); if (ir->condition) ir->condition->accept(this); @@ -361,22 +372,22 @@ void ir_print_visitor::visit(ir_assignment *ir) } mask[j] = '\0'; - printf(" (%s) ", mask); + fprintf(f, " (%s) ", mask); ir->lhs->accept(this); - printf(" "); + fprintf(f, " "); ir->rhs->accept(this); - printf(") "); + fprintf(f, ") "); } void ir_print_visitor::visit(ir_constant *ir) { - printf("(constant "); - print_type(ir->type); - printf(" ("); + fprintf(f, "(constant "); + print_type(f, ir->type); + fprintf(f, " ("); if (ir->type->is_array()) { for (unsigned i = 0; i < ir->type->length; i++) @@ -384,122 +395,116 @@ void ir_print_visitor::visit(ir_constant *ir) } else if (ir->type->is_record()) { ir_constant *value = (ir_constant *) ir->components.get_head(); for (unsigned i = 0; i < ir->type->length; i++) { - printf("(%s ", ir->type->fields.structure[i].name); + fprintf(f, "(%s ", ir->type->fields.structure[i].name); value->accept(this); - printf(")"); + fprintf(f, ")"); value = (ir_constant *) value->next; } } else { for (unsigned i = 0; i < ir->type->components(); i++) { if (i != 0) - printf(" "); + fprintf(f, " "); switch (ir->type->base_type) { - case GLSL_TYPE_UINT: printf("%u", ir->value.u[i]); break; - case GLSL_TYPE_INT: printf("%d", ir->value.i[i]); break; + case GLSL_TYPE_UINT: fprintf(f, "%u", ir->value.u[i]); break; + case GLSL_TYPE_INT: fprintf(f, "%d", ir->value.i[i]); break; case GLSL_TYPE_FLOAT: if (ir->value.f[i] == 0.0f) /* 0.0 == -0.0, so print with %f to get the proper sign. */ - printf("%.1f", ir->value.f[i]); + fprintf(f, "%f", ir->value.f[i]); else if (fabs(ir->value.f[i]) < 0.000001f) - printf("%a", ir->value.f[i]); + fprintf(f, "%a", ir->value.f[i]); else if (fabs(ir->value.f[i]) > 1000000.0f) - printf("%e", ir->value.f[i]); + fprintf(f, "%e", ir->value.f[i]); else - printf("%f", ir->value.f[i]); + fprintf(f, "%f", ir->value.f[i]); break; - case GLSL_TYPE_BOOL: printf("%d", ir->value.b[i]); break; + case GLSL_TYPE_BOOL: fprintf(f, "%d", ir->value.b[i]); break; default: assert(0); } } } - printf(")) "); + fprintf(f, ")) "); } void ir_print_visitor::visit(ir_call *ir) { - printf("(call %s ", ir->callee_name()); + fprintf(f, "(call %s ", ir->callee_name()); if (ir->return_deref) ir->return_deref->accept(this); - printf(" ("); - foreach_list(n, &ir->actual_parameters) { - ir_rvalue *const param = (ir_rvalue *) n; - + fprintf(f, " ("); + foreach_in_list(ir_rvalue, param, &ir->actual_parameters) { param->accept(this); } - printf("))\n"); + fprintf(f, "))\n"); } void ir_print_visitor::visit(ir_return *ir) { - printf("(return"); + fprintf(f, "(return"); ir_rvalue *const value = ir->get_value(); if (value) { - printf(" "); + fprintf(f, " "); value->accept(this); } - printf(")"); + fprintf(f, ")"); } void ir_print_visitor::visit(ir_discard *ir) { - printf("(discard "); + fprintf(f, "(discard "); if (ir->condition != NULL) { - printf(" "); + fprintf(f, " "); ir->condition->accept(this); } - printf(")"); + fprintf(f, ")"); } void ir_print_visitor::visit(ir_if *ir) { - printf("(if "); + fprintf(f, "(if "); ir->condition->accept(this); - printf("(\n"); + fprintf(f, "(\n"); indentation++; - foreach_list(n, &ir->then_instructions) { - ir_instruction *const inst = (ir_instruction *) n; - + foreach_in_list(ir_instruction, inst, &ir->then_instructions) { indent(); inst->accept(this); - printf("\n"); + fprintf(f, "\n"); } indentation--; indent(); - printf(")\n"); + fprintf(f, ")\n"); indent(); if (!ir->else_instructions.is_empty()) { - printf("(\n"); + fprintf(f, "(\n"); indentation++; - foreach_list(n, &ir->else_instructions) { - ir_instruction *const inst = (ir_instruction *) n; - + foreach_in_list(ir_instruction, inst, &ir->else_instructions) { indent(); inst->accept(this); - printf("\n"); + fprintf(f, "\n"); } indentation--; indent(); - printf("))\n"); + fprintf(f, "))\n"); } else { - printf("())\n"); + fprintf(f, "())\n"); } } @@ -507,26 +512,24 @@ ir_print_visitor::visit(ir_if *ir) void ir_print_visitor::visit(ir_loop *ir) { - printf("(loop (\n"); + fprintf(f, "(loop (\n"); indentation++; - foreach_list(n, &ir->body_instructions) { - ir_instruction *const inst = (ir_instruction *) n; - + foreach_in_list(ir_instruction, inst, &ir->body_instructions) { indent(); inst->accept(this); - printf("\n"); + fprintf(f, "\n"); } indentation--; indent(); - printf("))\n"); + fprintf(f, "))\n"); } void ir_print_visitor::visit(ir_loop_jump *ir) { - printf("%s", ir->is_break() ? "break" : "continue"); + fprintf(f, "%s", ir->is_break() ? "break" : "continue"); } void @@ -543,11 +546,16 @@ ir_print_visitor::visit(ir_typedecl_statement *ir) void ir_print_visitor::visit(ir_emit_vertex *ir) { - printf("(emit-vertex)"); + fprintf(f, "(emit-vertex "); + ir->stream->accept(this); + fprintf(f, ")\n"); } void ir_print_visitor::visit(ir_end_primitive *ir) { - printf("(end-primitive)"); + fprintf(f, "(end-primitive "); + ir->stream->accept(this); + fprintf(f, ")\n"); + } diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_print_visitor.h b/3rdparty/glsl-optimizer/src/glsl/ir_print_visitor.h index 5e4b93b9d..a891d3c92 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_print_visitor.h +++ b/3rdparty/glsl-optimizer/src/glsl/ir_print_visitor.h @@ -38,7 +38,7 @@ extern "C" { */ class ir_print_visitor : public ir_visitor { public: - ir_print_visitor(); + ir_print_visitor(FILE *f); virtual ~ir_print_visitor(); void indent(void); @@ -89,6 +89,7 @@ private: _mesa_symbol_table *symbols; void *mem_ctx; + FILE *f; int indentation; }; diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_rvalue_visitor.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_rvalue_visitor.cpp index 93efa21b1..81cfc8943 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_rvalue_visitor.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_rvalue_visitor.cpp @@ -121,8 +121,7 @@ ir_rvalue_base_visitor::rvalue_visit(ir_assignment *ir) ir_visitor_status ir_rvalue_base_visitor::rvalue_visit(ir_call *ir) { - foreach_list_safe(n, &ir->actual_parameters) { - ir_rvalue *param = (ir_rvalue *) n; + foreach_in_list_safe(ir_rvalue, param, &ir->actual_parameters) { ir_rvalue *new_param = param; handle_rvalue(&new_param); @@ -147,6 +146,19 @@ ir_rvalue_base_visitor::rvalue_visit(ir_if *ir) return visit_continue; } +ir_visitor_status +ir_rvalue_base_visitor::rvalue_visit(ir_emit_vertex *ir) +{ + handle_rvalue(&ir->stream); + return visit_continue; +} + +ir_visitor_status +ir_rvalue_base_visitor::rvalue_visit(ir_end_primitive *ir) +{ + handle_rvalue(&ir->stream); + return visit_continue; +} ir_visitor_status ir_rvalue_visitor::visit_leave(ir_expression *ir) @@ -202,6 +214,18 @@ ir_rvalue_visitor::visit_leave(ir_if *ir) return rvalue_visit(ir); } +ir_visitor_status +ir_rvalue_visitor::visit_leave(ir_emit_vertex *ir) +{ + return rvalue_visit(ir); +} + +ir_visitor_status +ir_rvalue_visitor::visit_leave(ir_end_primitive *ir) +{ + return rvalue_visit(ir); +} + ir_visitor_status ir_rvalue_enter_visitor::visit_enter(ir_expression *ir) { @@ -255,3 +279,15 @@ ir_rvalue_enter_visitor::visit_enter(ir_if *ir) { return rvalue_visit(ir); } + +ir_visitor_status +ir_rvalue_enter_visitor::visit_enter(ir_emit_vertex *ir) +{ + return rvalue_visit(ir); +} + +ir_visitor_status +ir_rvalue_enter_visitor::visit_enter(ir_end_primitive *ir) +{ + return rvalue_visit(ir); +} diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_rvalue_visitor.h b/3rdparty/glsl-optimizer/src/glsl/ir_rvalue_visitor.h index 2179fa5a8..04ec0fa39 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_rvalue_visitor.h +++ b/3rdparty/glsl-optimizer/src/glsl/ir_rvalue_visitor.h @@ -41,6 +41,8 @@ public: ir_visitor_status rvalue_visit(ir_return *); ir_visitor_status rvalue_visit(ir_swizzle *); ir_visitor_status rvalue_visit(ir_texture *); + ir_visitor_status rvalue_visit(ir_emit_vertex *); + ir_visitor_status rvalue_visit(ir_end_primitive *); virtual void handle_rvalue(ir_rvalue **rvalue) = 0; }; @@ -57,6 +59,8 @@ public: virtual ir_visitor_status visit_leave(ir_return *); virtual ir_visitor_status visit_leave(ir_swizzle *); virtual ir_visitor_status visit_leave(ir_texture *); + virtual ir_visitor_status visit_leave(ir_emit_vertex *); + virtual ir_visitor_status visit_leave(ir_end_primitive *); }; class ir_rvalue_enter_visitor : public ir_rvalue_base_visitor { @@ -71,4 +75,6 @@ public: virtual ir_visitor_status visit_enter(ir_return *); virtual ir_visitor_status visit_enter(ir_swizzle *); virtual ir_visitor_status visit_enter(ir_texture *); + virtual ir_visitor_status visit_enter(ir_emit_vertex *); + virtual ir_visitor_status visit_enter(ir_end_primitive *); }; diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_uniform.h b/3rdparty/glsl-optimizer/src/glsl/ir_uniform.h index 7508f795d..2f7352825 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_uniform.h +++ b/3rdparty/glsl-optimizer/src/glsl/ir_uniform.h @@ -32,12 +32,17 @@ #include "program/prog_parameter.h" /* For union gl_constant_value. */ +/** + * Used by GL_ARB_explicit_uniform_location extension code in the linker + * and glUniform* functions to identify inactive explicit uniform locations. + */ +#define INACTIVE_UNIFORM_EXPLICIT_LOCATION ((gl_uniform_storage *) -1) #ifdef __cplusplus extern "C" { #endif -enum gl_uniform_driver_format { +enum PACKED gl_uniform_driver_format { uniform_native = 0, /**< Store data in the native format. */ uniform_int_float, /**< Store integer data as floats. */ uniform_bool_float, /**< Store boolean data as floats. */ @@ -66,11 +71,8 @@ struct gl_uniform_driver_storage { /** * Base format of the stored data. - * - * This field must have a value from \c GLSL_TYPE_UINT through \c - * GLSL_TYPE_SAMPLER. */ - uint8_t format; + enum gl_uniform_driver_format format; /** * Pointer to the base of the data. @@ -178,6 +180,12 @@ struct gl_uniform_storage { * an atomic counter. */ int atomic_buffer_index; + + /** + * The 'base location' for this uniform in the uniform remap table. For + * arrays this is the first element in the array. + */ + unsigned remap_location; }; #ifdef __cplusplus diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_unused_structs.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_unused_structs.cpp index 38deea15f..8f16432a5 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_unused_structs.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_unused_structs.cpp @@ -71,8 +71,7 @@ bool ir_struct_usage_visitor::has_struct_entry(const glsl_type *t) const { assert(t); - foreach_list(node, &this->struct_list) { - struct_entry *entry = (struct_entry *)node; + foreach_in_list(struct_entry, entry, &this->struct_list) { if (entry->type == t) return true; } @@ -119,8 +118,8 @@ ir_struct_usage_visitor::ir_struct_usage_visitor() { this->mem_ctx = ralloc_context(NULL); this->struct_list.make_empty(); - this->callback = visit_variable; - this->data = this; + this->callback_enter = visit_variable; + this->data_enter = this; } ir_struct_usage_visitor::~ir_struct_usage_visitor(void) diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_validate.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_validate.cpp index 743f38708..9c50576f0 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_validate.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_validate.cpp @@ -49,8 +49,8 @@ public: this->current_function = NULL; - this->callback = ir_validate::validate_ir; - this->data = ht; + this->callback_enter = ir_validate::validate_ir; + this->data_enter = ht; } ~ir_validate() @@ -100,7 +100,7 @@ ir_validate::visit(ir_dereference_variable *ir) abort(); } - this->validate_ir(ir, this->data); + this->validate_ir(ir, this->data_enter); return visit_continue; } @@ -167,14 +167,12 @@ ir_validate::visit_enter(ir_function *ir) */ this->current_function = ir; - this->validate_ir(ir, this->data); + this->validate_ir(ir, this->data_enter); /* Verify that all of the things stored in the list of signatures are, * in fact, function signatures. */ - foreach_list(node, &ir->signatures) { - ir_instruction *sig = (ir_instruction *) node; - + foreach_in_list(ir_instruction, sig, &ir->signatures) { if (sig->ir_type != ir_type_function_signature) { printf("Non-signature in signature list of function `%s'\n", ir->name); @@ -213,7 +211,7 @@ ir_validate::visit_enter(ir_function_signature *ir) abort(); } - this->validate_ir(ir, this->data); + this->validate_ir(ir, this->data_enter); return visit_continue; } @@ -246,6 +244,7 @@ ir_validate::visit_leave(ir_expression *ir) case ir_unop_log: case ir_unop_exp2: case ir_unop_log2: + case ir_unop_saturate: assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT); assert(ir->type == ir->operands[0]->type); break; @@ -322,7 +321,11 @@ ir_validate::visit_leave(ir_expression *ir) case ir_unop_sin_reduced: case ir_unop_cos_reduced: case ir_unop_dFdx: + case ir_unop_dFdx_coarse: + case ir_unop_dFdx_fine: case ir_unop_dFdy: + case ir_unop_dFdy_coarse: + case ir_unop_dFdy_fine: assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT); assert(ir->operands[0]->type == ir->type); break; @@ -376,6 +379,11 @@ ir_validate::visit_leave(ir_expression *ir) /* XXX what can we assert here? */ break; + case ir_unop_interpolate_at_centroid: + assert(ir->operands[0]->type == ir->type); + assert(ir->operands[0]->type->is_float()); + break; + case ir_binop_add: case ir_binop_sub: case ir_binop_mul: @@ -384,6 +392,9 @@ ir_validate::visit_leave(ir_expression *ir) case ir_binop_min: case ir_binop_max: case ir_binop_pow: + assert(ir->operands[0]->type->base_type == + ir->operands[1]->type->base_type); + if (ir->operands[0]->type->is_scalar()) assert(ir->operands[1]->type == ir->type); else if (ir->operands[1]->type->is_scalar()) @@ -492,7 +503,6 @@ ir_validate::visit_leave(ir_expression *ir) break; case ir_binop_ubo_load: - assert(ir->operands[0]->as_constant()); assert(ir->operands[0]->type == glsl_type::uint_type); assert(ir->operands[1]->type == glsl_type::uint_type); @@ -512,6 +522,19 @@ ir_validate::visit_leave(ir_expression *ir) && ir->operands[1]->type->is_integer()); break; + case ir_binop_interpolate_at_offset: + assert(ir->operands[0]->type == ir->type); + assert(ir->operands[0]->type->is_float()); + assert(ir->operands[1]->type->components() == 2); + assert(ir->operands[1]->type->is_float()); + break; + + case ir_binop_interpolate_at_sample: + assert(ir->operands[0]->type == ir->type); + assert(ir->operands[0]->type->is_float()); + assert(ir->operands[1]->type == glsl_type::int_type); + break; + case ir_triop_fma: assert(ir->type->base_type == GLSL_TYPE_FLOAT); assert(ir->type == ir->operands[0]->type); @@ -634,7 +657,7 @@ ir_validate::visit(ir_variable *ir) * in the ir_dereference_variable handler to ensure that a variable is * declared before it is dereferenced. */ - if (ir->name) + if (ir->name && ir->is_name_ralloced()) assert(ralloc_parent(ir->name) == ir); hash_table_insert(ht, ir, ir); @@ -662,10 +685,15 @@ ir_validate::visit(ir_variable *ir) ir->get_interface_type()->fields.structure; for (unsigned i = 0; i < ir->get_interface_type()->length; i++) { if (fields[i].type->array_size() > 0) { - if (ir->max_ifc_array_access[i] >= fields[i].type->length) { + const unsigned *const max_ifc_array_access = + ir->get_max_ifc_array_access(); + + assert(max_ifc_array_access != NULL); + + if (max_ifc_array_access[i] >= fields[i].type->length) { printf("ir_variable has maximum access out of bounds for " "field %s (%d vs %d)\n", fields[i].name, - ir->max_ifc_array_access[i], fields[i].type->length); + max_ifc_array_access[i], fields[i].type->length); ir->print(); abort(); } @@ -680,6 +708,14 @@ ir_validate::visit(ir_variable *ir) abort(); } + if (ir->data.mode == ir_var_uniform + && strncmp(ir->name, "gl_", 3) == 0 + && ir->get_state_slots() == NULL) { + printf("built-in uniform has no state\n"); + ir->print(); + abort(); + } + return visit_continue; } @@ -710,7 +746,7 @@ ir_validate::visit_enter(ir_assignment *ir) } } - this->validate_ir(ir, this->data); + this->validate_ir(ir, this->data_enter); return visit_continue; } @@ -795,7 +831,7 @@ check_node_type(ir_instruction *ir, void *data) { (void) data; - if (ir->ir_type <= ir_type_unset || ir->ir_type >= ir_type_max) { + if (ir->ir_type >= ir_type_max) { printf("Instruction node with unset type\n"); ir->print(); printf("\n"); } @@ -816,9 +852,7 @@ validate_ir_tree(exec_list *instructions) v.run(instructions); - foreach_list(n, instructions) { - ir_instruction *ir = (ir_instruction *) n; - + foreach_in_list(ir_instruction, ir, instructions) { visit_tree(ir, check_node_type, NULL); } #endif diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_variable_refcount.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_variable_refcount.cpp index 951682c13..679ddd4fe 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_variable_refcount.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_variable_refcount.cpp @@ -33,12 +33,13 @@ #include "ir_visitor.h" #include "ir_variable_refcount.h" #include "glsl_types.h" -#include "main/hash_table.h" +#include "util/hash_table.h" ir_variable_refcount_visitor::ir_variable_refcount_visitor() { this->mem_ctx = ralloc_context(NULL); this->ht = _mesa_hash_table_create(NULL, _mesa_key_pointer_equal); + this->current_lhs = NULL; } static void @@ -62,6 +63,7 @@ ir_variable_refcount_entry::ir_variable_refcount_entry(ir_variable *var) assigned_count = 0; declaration = false; referenced_count = 0; + referenced_count_noself = 0; } @@ -114,10 +116,11 @@ ir_variable_refcount_visitor::visit(ir_dereference_variable *ir) { ir_variable *const var = ir->variable_referenced(); ir_variable_refcount_entry *entry = this->get_variable_entry(var); - - if (entry) + if (entry) { entry->referenced_count++; - + if (this->in_assignee || var != this->current_lhs) + entry->referenced_count_noself++; + } return visit_continue; } @@ -132,10 +135,19 @@ ir_variable_refcount_visitor::visit_enter(ir_function_signature *ir) return visit_continue_with_parent; } +ir_visitor_status +ir_variable_refcount_visitor::visit_enter(ir_assignment *ir) +{ + assert(this->current_lhs == NULL); + this->current_lhs = ir->lhs->variable_referenced(); + return visit_continue; +} + ir_visitor_status ir_variable_refcount_visitor::visit_leave(ir_assignment *ir) { + this->current_lhs = NULL; ir_variable_refcount_entry *entry; entry = this->get_variable_entry(ir->lhs->variable_referenced()); if (entry) { diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_variable_refcount.h b/3rdparty/glsl-optimizer/src/glsl/ir_variable_refcount.h index fbb776945..56cdbe0dc 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_variable_refcount.h +++ b/3rdparty/glsl-optimizer/src/glsl/ir_variable_refcount.h @@ -44,6 +44,10 @@ public: /** Number of times the variable is referenced, including assignments. */ unsigned referenced_count; + /** Number of times the variable was referenced, excluding cases when it was on RHS + * of assignment of the same variable. */ + unsigned referenced_count_noself; + /** Number of times the variable is assigned. */ unsigned assigned_count; @@ -59,12 +63,14 @@ public: virtual ir_visitor_status visit(ir_dereference_variable *); virtual ir_visitor_status visit_enter(ir_function_signature *); + virtual ir_visitor_status visit_enter(ir_assignment *); virtual ir_visitor_status visit_leave(ir_assignment *); ir_variable_refcount_entry *get_variable_entry(ir_variable *var); ir_variable_refcount_entry *find_variable_entry(ir_variable *var); struct hash_table *ht; + ir_variable* current_lhs; void *mem_ctx; }; diff --git a/3rdparty/glsl-optimizer/src/glsl/link_atomics.cpp b/3rdparty/glsl-optimizer/src/glsl/link_atomics.cpp index d92cdb117..cc0c86c1b 100644 --- a/3rdparty/glsl-optimizer/src/glsl/link_atomics.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/link_atomics.cpp @@ -26,6 +26,7 @@ #include "ir_uniform.h" #include "linker.h" #include "program/hash_table.h" +#include "main/errors.h" #include "main/macros.h" namespace { @@ -54,9 +55,18 @@ namespace { void push_back(unsigned id, ir_variable *var) { - counters = (active_atomic_counter *) - realloc(counters, sizeof(active_atomic_counter) * (num_counters + 1)); + active_atomic_counter *new_counters; + new_counters = (active_atomic_counter *) + realloc(counters, sizeof(active_atomic_counter) * + (num_counters + 1)); + + if (new_counters == NULL) { + _mesa_error_no_memory(__func__); + return; + } + + counters = new_counters; counters[num_counters].id = id; counters[num_counters].var = var; num_counters++; @@ -101,8 +111,8 @@ namespace { if (sh == NULL) continue; - foreach_list(node, sh->ir) { - ir_variable *var = ((ir_instruction *)node)->as_variable(); + foreach_in_list(ir_instruction, node, sh->ir) { + ir_variable *var = node->as_variable(); if (var && var->type->contains_atomic()) { unsigned id = 0; @@ -192,7 +202,9 @@ link_assign_atomic_counter_resources(struct gl_context *ctx, gl_uniform_storage *const storage = &prog->UniformStorage[id]; mab.Uniforms[j] = id; - var->data.atomic.buffer_index = i; + if (!var->data.explicit_binding) + var->data.binding = i; + storage->atomic_buffer_index = i; storage->offset = var->data.atomic.offset; storage->array_stride = (var->type->is_array() ? diff --git a/3rdparty/glsl-optimizer/src/glsl/link_functions.cpp b/3rdparty/glsl-optimizer/src/glsl/link_functions.cpp index b7dfef948..b01709760 100644 --- a/3rdparty/glsl-optimizer/src/glsl/link_functions.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/link_functions.cpp @@ -145,8 +145,7 @@ public: struct hash_table *ht = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare); exec_list formal_parameters; - foreach_list_const(node, &sig->parameters) { - const ir_instruction *const original = (ir_instruction *) node; + foreach_in_list(const ir_instruction, original, &sig->parameters) { assert(const_cast(original)->as_variable()); ir_instruction *copy = original->clone(linked, ht); @@ -155,10 +154,10 @@ public: linked_sig->replace_parameters(&formal_parameters); - if (sig->is_defined) { - foreach_list_const(node, &sig->body) { - const ir_instruction *const original = (ir_instruction *) node; + linked_sig->is_intrinsic = sig->is_intrinsic; + if (sig->is_defined) { + foreach_in_list(const ir_instruction, original, &sig->body) { ir_instruction *copy = original->clone(linked, ht); linked_sig->body.push_tail(copy); } @@ -246,11 +245,19 @@ public: /* Similarly, we need implicit sizes of arrays within interface * blocks to be sized by the maximal access in *any* shader. */ + unsigned *const linked_max_ifc_array_access = + var->get_max_ifc_array_access(); + unsigned *const ir_max_ifc_array_access = + ir->var->get_max_ifc_array_access(); + + assert(linked_max_ifc_array_access != NULL); + assert(ir_max_ifc_array_access != NULL); + for (unsigned i = 0; i < var->get_interface_type()->length; i++) { - var->max_ifc_array_access[i] = - MAX2(var->max_ifc_array_access[i], - ir->var->max_ifc_array_access[i]); + linked_max_ifc_array_access[i] = + MAX2(linked_max_ifc_array_access[i], + ir_max_ifc_array_access[i]); } } } @@ -310,7 +317,7 @@ find_matching_signature(const char *name, const exec_list *actual_parameters, continue; ir_function_signature *sig = - f->matching_signature(NULL, actual_parameters); + f->matching_signature(NULL, actual_parameters, use_builtin); if ((sig == NULL) || (!sig->is_defined && !sig->is_intrinsic)) diff --git a/3rdparty/glsl-optimizer/src/glsl/link_interface_blocks.cpp b/3rdparty/glsl-optimizer/src/glsl/link_interface_blocks.cpp index 52552cc68..0ce502d4f 100644 --- a/3rdparty/glsl-optimizer/src/glsl/link_interface_blocks.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/link_interface_blocks.cpp @@ -259,8 +259,8 @@ validate_intrastage_interface_blocks(struct gl_shader_program *prog, if (shader_list[i] == NULL) continue; - foreach_list(node, shader_list[i]->ir) { - ir_variable *var = ((ir_instruction *) node)->as_variable(); + foreach_in_list(ir_instruction, node, shader_list[i]->ir) { + ir_variable *var = node->as_variable(); if (!var) continue; @@ -316,8 +316,8 @@ validate_interstage_inout_blocks(struct gl_shader_program *prog, const bool extra_array_level = consumer->Stage == MESA_SHADER_GEOMETRY; /* Add input interfaces from the consumer to the symbol table. */ - foreach_list(node, consumer->ir) { - ir_variable *var = ((ir_instruction *) node)->as_variable(); + foreach_in_list(ir_instruction, node, consumer->ir) { + ir_variable *var = node->as_variable(); if (!var || !var->get_interface_type() || var->data.mode != ir_var_shader_in) continue; @@ -325,8 +325,8 @@ validate_interstage_inout_blocks(struct gl_shader_program *prog, } /* Verify that the producer's output interfaces match. */ - foreach_list(node, producer->ir) { - ir_variable *var = ((ir_instruction *) node)->as_variable(); + foreach_in_list(ir_instruction, node, producer->ir) { + ir_variable *var = node->as_variable(); if (!var || !var->get_interface_type() || var->data.mode != ir_var_shader_out) continue; @@ -359,8 +359,8 @@ validate_interstage_uniform_blocks(struct gl_shader_program *prog, continue; const gl_shader *stage = stages[i]; - foreach_list(node, stage->ir) { - ir_variable *var = ((ir_instruction *) node)->as_variable(); + foreach_in_list(ir_instruction, node, stage->ir) { + ir_variable *var = node->as_variable(); if (!var || !var->get_interface_type() || var->data.mode != ir_var_uniform) continue; diff --git a/3rdparty/glsl-optimizer/src/glsl/link_uniform_block_active_visitor.cpp b/3rdparty/glsl-optimizer/src/glsl/link_uniform_block_active_visitor.cpp index f2f46a211..9da6a4bba 100644 --- a/3rdparty/glsl-optimizer/src/glsl/link_uniform_block_active_visitor.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/link_uniform_block_active_visitor.cpp @@ -46,6 +46,14 @@ process_block(void *mem_ctx, struct hash_table *ht, ir_variable *var) b->type = block_type; b->has_instance_name = var->is_interface_instance(); + if (var->data.explicit_binding) { + b->has_binding = true; + b->binding = var->data.binding; + } else { + b->has_binding = false; + b->binding = 0; + } + _mesa_hash_table_insert(ht, h, var->get_interface_type()->name, (void *) b); return b; @@ -64,6 +72,45 @@ process_block(void *mem_ctx, struct hash_table *ht, ir_variable *var) return NULL; } +ir_visitor_status +link_uniform_block_active_visitor::visit(ir_variable *var) +{ + if (!var->is_in_uniform_block()) + return visit_continue; + + const glsl_type *const block_type = var->is_interface_instance() + ? var->type : var->get_interface_type(); + + /* Section 2.11.6 (Uniform Variables) of the OpenGL ES 3.0.3 spec says: + * + * "All members of a named uniform block declared with a shared or + * std140 layout qualifier are considered active, even if they are not + * referenced in any shader in the program. The uniform block itself is + * also considered active, even if no member of the block is + * referenced." + */ + if (block_type->interface_packing == GLSL_INTERFACE_PACKING_PACKED) + return visit_continue; + + /* Process the block. Bail if there was an error. + */ + link_uniform_block_active *const b = + process_block(this->mem_ctx, this->ht, var); + if (b == NULL) { + linker_error(this->prog, + "uniform block `%s' has mismatching definitions", + var->get_interface_type()->name); + this->success = false; + return visit_stop; + } + + assert(b->num_array_elements == 0); + assert(b->array_elements == NULL); + assert(b->type != NULL); + + return visit_continue; +} + ir_visitor_status link_uniform_block_active_visitor::visit_enter(ir_dereference_array *ir) { @@ -101,32 +148,44 @@ link_uniform_block_active_visitor::visit_enter(ir_dereference_array *ir) assert((b->num_array_elements == 0) == (b->array_elements == NULL)); assert(b->type != NULL); - /* Determine whether or not this array index has already been added to the - * list of active array indices. At this point all constant folding must - * have occured, and the array index must be a constant. - */ ir_constant *c = ir->array_index->as_constant(); - assert(c != NULL); - const unsigned idx = c->get_uint_component(0); + if (c) { + /* Index is a constant, so mark just that element used, if not already */ + const unsigned idx = c->get_uint_component(0); - unsigned i; - for (i = 0; i < b->num_array_elements; i++) { - if (b->array_elements[i] == idx) - break; - } + unsigned i; + for (i = 0; i < b->num_array_elements; i++) { + if (b->array_elements[i] == idx) + break; + } - assert(i <= b->num_array_elements); + assert(i <= b->num_array_elements); - if (i == b->num_array_elements) { - b->array_elements = reralloc(this->mem_ctx, - b->array_elements, - unsigned, - b->num_array_elements + 1); + if (i == b->num_array_elements) { + b->array_elements = reralloc(this->mem_ctx, + b->array_elements, + unsigned, + b->num_array_elements + 1); - b->array_elements[b->num_array_elements] = idx; + b->array_elements[b->num_array_elements] = idx; - b->num_array_elements++; + b->num_array_elements++; + } + } else { + /* The array index is not a constant, so mark the entire array used. */ + assert(b->type->is_array()); + if (b->num_array_elements < b->type->length) { + b->num_array_elements = b->type->length; + b->array_elements = reralloc(this->mem_ctx, + b->array_elements, + unsigned, + b->num_array_elements); + + for (unsigned i = 0; i < b->num_array_elements; i++) { + b->array_elements[i] = i; + } + } } return visit_continue_with_parent; diff --git a/3rdparty/glsl-optimizer/src/glsl/link_uniform_block_active_visitor.h b/3rdparty/glsl-optimizer/src/glsl/link_uniform_block_active_visitor.h index fba628a8f..e5ea50155 100644 --- a/3rdparty/glsl-optimizer/src/glsl/link_uniform_block_active_visitor.h +++ b/3rdparty/glsl-optimizer/src/glsl/link_uniform_block_active_visitor.h @@ -26,9 +26,7 @@ #define LINK_UNIFORM_BLOCK_ACTIVE_VISITOR_H #include "ir.h" -#include "ir_visitor.h" -#include "glsl_types.h" -#include "main/hash_table.h" +#include "util/hash_table.h" struct link_uniform_block_active { const glsl_type *type; @@ -36,7 +34,10 @@ struct link_uniform_block_active { unsigned *array_elements; unsigned num_array_elements; + unsigned binding; + bool has_instance_name; + bool has_binding; }; class link_uniform_block_active_visitor : public ir_hierarchical_visitor { @@ -50,6 +51,7 @@ public: virtual ir_visitor_status visit_enter(ir_dereference_array *); virtual ir_visitor_status visit(ir_dereference_variable *); + virtual ir_visitor_status visit(ir_variable *); bool success; diff --git a/3rdparty/glsl-optimizer/src/glsl/link_uniform_blocks.cpp b/3rdparty/glsl-optimizer/src/glsl/link_uniform_blocks.cpp index a922ad5e4..90101a80c 100644 --- a/3rdparty/glsl-optimizer/src/glsl/link_uniform_blocks.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/link_uniform_blocks.cpp @@ -22,11 +22,12 @@ */ #include "main/core.h" +#include "main/errors.h" #include "ir.h" #include "linker.h" #include "ir_uniform.h" #include "link_uniform_block_active_visitor.h" -#include "main/hash_table.h" +#include "util/hash_table.h" #include "program.h" namespace { @@ -68,7 +69,8 @@ private: } virtual void visit_field(const glsl_type *type, const char *name, - bool row_major, const glsl_type *record_type) + bool row_major, const glsl_type *record_type, + bool last_field) { assert(this->index < this->num_variables); @@ -76,7 +78,7 @@ private: v->Name = ralloc_strdup(mem_ctx, name); v->Type = type; - v->RowMajor = row_major; + v->RowMajor = type->without_array()->is_matrix() && row_major; if (this->is_array_instance) { v->IndexName = ralloc_strdup(mem_ctx, name); @@ -92,18 +94,31 @@ private: unsigned len = strlen(close_bracket + 1) + 1; memmove(open_bracket, close_bracket + 1, len); - } else { + } else { v->IndexName = v->Name; } const unsigned alignment = record_type - ? record_type->std140_base_alignment(!!v->RowMajor) - : type->std140_base_alignment(!!v->RowMajor); + ? record_type->std140_base_alignment(!!v->RowMajor) + : type->std140_base_alignment(!!v->RowMajor); unsigned size = type->std140_size(!!v->RowMajor); this->offset = glsl_align(this->offset, alignment); v->Offset = this->offset; + + /* If this is the last field of a structure, apply rule #9. The + * GL_ARB_uniform_buffer_object spec says: + * + * "The structure may have padding at the end; the base offset of + * the member following the sub-structure is rounded up to the next + * multiple of the base alignment of the structure." + * + * last_field won't be set if this is the last field of a UBO that is + * not a named instance. + */ this->offset += size; + if (last_field) + this->offset = glsl_align(this->offset, 16); /* From the GL_ARB_uniform_buffer_object spec: * @@ -170,6 +185,12 @@ link_uniform_blocks(void *mem_ctx, struct hash_table *block_hash = _mesa_hash_table_create(mem_ctx, _mesa_key_string_equal); + if (block_hash == NULL) { + _mesa_error_no_memory(__func__); + linker_error(prog, "out of memory\n"); + return 0; + } + /* Determine which uniform blocks are active. */ link_uniform_block_active_visitor v(mem_ctx, block_hash, prog); @@ -251,7 +272,17 @@ link_uniform_blocks(void *mem_ctx, blocks[i].Name = ralloc_asprintf(blocks, "%s[%u]", name, b->array_elements[j]); blocks[i].Uniforms = &variables[parcel.index]; - blocks[i].Binding = 0; + + /* The GL_ARB_shading_language_420pack spec says: + * + * "If the binding identifier is used with a uniform block + * instanced as an array then the first element of the array + * takes the specified block binding and each subsequent + * element takes the next consecutive uniform block binding + * point." + */ + blocks[i].Binding = (b->has_binding) ? b->binding + j : 0; + blocks[i].UniformBufferSize = 0; blocks[i]._Packing = gl_uniform_block_packing(block_type->interface_packing); @@ -269,7 +300,7 @@ link_uniform_blocks(void *mem_ctx, } else { blocks[i].Name = ralloc_strdup(blocks, block_type->name); blocks[i].Uniforms = &variables[parcel.index]; - blocks[i].Binding = 0; + blocks[i].Binding = (b->has_binding) ? b->binding : 0; blocks[i].UniformBufferSize = 0; blocks[i]._Packing = gl_uniform_block_packing(block_type->interface_packing); diff --git a/3rdparty/glsl-optimizer/src/glsl/link_uniform_initializers.cpp b/3rdparty/glsl-optimizer/src/glsl/link_uniform_initializers.cpp index 9d6977d57..f6a60bce9 100644 --- a/3rdparty/glsl-optimizer/src/glsl/link_uniform_initializers.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/link_uniform_initializers.cpp @@ -25,8 +25,6 @@ #include "ir.h" #include "linker.h" #include "ir_uniform.h" -#include "glsl_symbol_table.h" -#include "program/hash_table.h" /* These functions are put in a "private" namespace instead of being marked * static so that the unit tests can access them. See @@ -46,11 +44,24 @@ get_storage(gl_uniform_storage *storage, unsigned num_storage, return NULL; } +static unsigned +get_uniform_block_index(const gl_shader_program *shProg, + const char *uniformBlockName) +{ + for (unsigned i = 0; i < shProg->NumUniformBlocks; i++) { + if (!strcmp(shProg->UniformBlocks[i].Name, uniformBlockName)) + return i; + } + + return GL_INVALID_INDEX; +} + void copy_constant_to_storage(union gl_constant_value *storage, const ir_constant *val, const enum glsl_base_type base_type, - const unsigned int elements) + const unsigned int elements, + unsigned int boolean_true) { for (unsigned int i = 0; i < elements; i++) { switch (base_type) { @@ -65,7 +76,7 @@ copy_constant_to_storage(union gl_constant_value *storage, storage[i].f = val->value.f[i]; break; case GLSL_TYPE_BOOL: - storage[i].b = int(val->value.b[i]); + storage[i].b = val->value.b[i] ? boolean_true : 0; break; case GLSL_TYPE_ARRAY: case GLSL_TYPE_STRUCT: @@ -84,8 +95,7 @@ copy_constant_to_storage(union gl_constant_value *storage, } void -set_uniform_binding(void *mem_ctx, gl_shader_program *prog, - const char *name, const glsl_type *type, int binding) +set_sampler_binding(gl_shader_program *prog, const char *name, int binding) { struct gl_uniform_storage *const storage = get_storage(prog->UniformStorage, prog->NumUserUniformStorage, name); @@ -95,37 +105,27 @@ set_uniform_binding(void *mem_ctx, gl_shader_program *prog, return; } - if (storage->type->is_sampler()) { - unsigned elements = MAX2(storage->array_elements, 1); + const unsigned elements = MAX2(storage->array_elements, 1); - /* From section 4.4.4 of the GLSL 4.20 specification: - * "If the binding identifier is used with an array, the first element - * of the array takes the specified unit and each subsequent element - * takes the next consecutive unit." - */ - for (unsigned int i = 0; i < elements; i++) { - storage->storage[i].i = binding + i; - } + /* Section 4.4.4 (Opaque-Uniform Layout Qualifiers) of the GLSL 4.20 spec + * says: + * + * "If the binding identifier is used with an array, the first element + * of the array takes the specified unit and each subsequent element + * takes the next consecutive unit." + */ + for (unsigned int i = 0; i < elements; i++) { + storage->storage[i].i = binding + i; + } - for (int sh = 0; sh < MESA_SHADER_STAGES; sh++) { - gl_shader *shader = prog->_LinkedShaders[sh]; + for (int sh = 0; sh < MESA_SHADER_STAGES; sh++) { + gl_shader *shader = prog->_LinkedShaders[sh]; - if (shader && storage->sampler[sh].active) { - for (unsigned i = 0; i < elements; i++) { - unsigned index = storage->sampler[sh].index + i; + if (shader && storage->sampler[sh].active) { + for (unsigned i = 0; i < elements; i++) { + unsigned index = storage->sampler[sh].index + i; - shader->SamplerUnits[index] = storage->storage[i].i; - } - } - } - } else if (storage->block_index != -1) { - /* This is a field of a UBO. val is the binding index. */ - for (int i = 0; i < MESA_SHADER_STAGES; i++) { - int stage_index = prog->UniformBlockStageIndex[i][storage->block_index]; - - if (stage_index != -1) { - struct gl_shader *sh = prog->_LinkedShaders[i]; - sh->UniformBlocks[stage_index].Binding = binding; + shader->SamplerUnits[index] = storage->storage[i].i; } } } @@ -133,10 +133,31 @@ set_uniform_binding(void *mem_ctx, gl_shader_program *prog, storage->initialized = true; } +void +set_block_binding(gl_shader_program *prog, const char *block_name, int binding) +{ + const unsigned block_index = get_uniform_block_index(prog, block_name); + + if (block_index == GL_INVALID_INDEX) { + assert(block_index != GL_INVALID_INDEX); + return; + } + + /* This is a field of a UBO. val is the binding index. */ + for (int i = 0; i < MESA_SHADER_STAGES; i++) { + int stage_index = prog->UniformBlockStageIndex[i][block_index]; + + if (stage_index != -1) { + struct gl_shader *sh = prog->_LinkedShaders[i]; + sh->UniformBlocks[stage_index].Binding = binding; + } + } +} + void set_uniform_initializer(void *mem_ctx, gl_shader_program *prog, const char *name, const glsl_type *type, - ir_constant *val) + ir_constant *val, unsigned int boolean_true) { if (type->is_record()) { ir_constant *field_constant; @@ -148,7 +169,7 @@ set_uniform_initializer(void *mem_ctx, gl_shader_program *prog, const char *field_name = ralloc_asprintf(mem_ctx, "%s.%s", name, type->fields.structure[i].name); set_uniform_initializer(mem_ctx, prog, field_name, - field_type, field_constant); + field_type, field_constant, boolean_true); field_constant = (ir_constant *)field_constant->next; } return; @@ -159,7 +180,8 @@ set_uniform_initializer(void *mem_ctx, gl_shader_program *prog, const char *element_name = ralloc_asprintf(mem_ctx, "%s[%d]", name, i); set_uniform_initializer(mem_ctx, prog, element_name, - element_type, val->array_elements[i]); + element_type, val->array_elements[i], + boolean_true); } return; } @@ -184,7 +206,8 @@ set_uniform_initializer(void *mem_ctx, gl_shader_program *prog, copy_constant_to_storage(& storage->storage[idx], val->array_elements[i], base_type, - elements); + elements, + boolean_true); idx += elements; } @@ -192,7 +215,8 @@ set_uniform_initializer(void *mem_ctx, gl_shader_program *prog, copy_constant_to_storage(storage->storage, val, val->type->base_type, - val->type->components()); + val->type->components(), + boolean_true); if (storage->type->is_sampler()) { for (int sh = 0; sh < MESA_SHADER_STAGES; sh++) { @@ -212,7 +236,8 @@ set_uniform_initializer(void *mem_ctx, gl_shader_program *prog, } void -link_set_uniform_initializers(struct gl_shader_program *prog) +link_set_uniform_initializers(struct gl_shader_program *prog, + unsigned int boolean_true) { void *mem_ctx = NULL; @@ -222,8 +247,8 @@ link_set_uniform_initializers(struct gl_shader_program *prog) if (shader == NULL) continue; - foreach_list(node, shader->ir) { - ir_variable *const var = ((ir_instruction *) node)->as_variable(); + foreach_in_list(ir_instruction, node, shader->ir) { + ir_variable *const var = node->as_variable(); if (!var || var->data.mode != ir_var_uniform) continue; @@ -232,11 +257,56 @@ link_set_uniform_initializers(struct gl_shader_program *prog) mem_ctx = ralloc_context(NULL); if (var->data.explicit_binding) { - linker::set_uniform_binding(mem_ctx, prog, var->name, - var->type, var->data.binding); + const glsl_type *const type = var->type; + + if (type->without_array()->is_sampler()) { + linker::set_sampler_binding(prog, var->name, var->data.binding); + } else if (var->is_in_uniform_block()) { + const glsl_type *const iface_type = var->get_interface_type(); + + /* If the variable is an array and it is an interface instance, + * we need to set the binding for each array element. Just + * checking that the variable is an array is not sufficient. + * The variable could be an array element of a uniform block + * that lacks an instance name. For example: + * + * uniform U { + * float f[4]; + * }; + * + * In this case "f" would pass is_in_uniform_block (above) and + * type->is_array(), but it will fail is_interface_instance(). + */ + if (var->is_interface_instance() && var->type->is_array()) { + for (unsigned i = 0; i < var->type->length; i++) { + const char *name = + ralloc_asprintf(mem_ctx, "%s[%u]", iface_type->name, i); + + /* Section 4.4.3 (Uniform Block Layout Qualifiers) of the + * GLSL 4.20 spec says: + * + * "If the binding identifier is used with a uniform + * block instanced as an array then the first element + * of the array takes the specified block binding and + * each subsequent element takes the next consecutive + * uniform block binding point." + */ + linker::set_block_binding(prog, name, + var->data.binding + i); + } + } else { + linker::set_block_binding(prog, iface_type->name, + var->data.binding); + } + } else if (type->contains_atomic()) { + /* we don't actually need to do anything. */ + } else { + assert(!"Explicit binding not on a sampler, UBO or atomic."); + } } else if (var->constant_value) { linker::set_uniform_initializer(mem_ctx, prog, var->name, - var->type, var->constant_value); + var->type, var->constant_value, + boolean_true); } } } diff --git a/3rdparty/glsl-optimizer/src/glsl/link_uniforms.cpp b/3rdparty/glsl-optimizer/src/glsl/link_uniforms.cpp index 61370cde7..ea2b0aa07 100644 --- a/3rdparty/glsl-optimizer/src/glsl/link_uniforms.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/link_uniforms.cpp @@ -36,6 +36,11 @@ * \author Ian Romanick */ +/** + * Used by linker to indicate uniforms that have no location set. + */ +#define UNMAPPED_UNIFORM_LOC ~0u + /** * Count the backing storage requirements for a type */ @@ -54,13 +59,11 @@ values_for_type(const glsl_type *type) void program_resource_visitor::process(const glsl_type *type, const char *name) { - assert(type->is_record() - || (type->is_array() && type->fields.array->is_record()) - || type->is_interface() - || (type->is_array() && type->fields.array->is_interface())); + assert(type->without_array()->is_record() + || type->without_array()->is_interface()); char *name_copy = ralloc_strdup(NULL, name); - recursion(type, &name_copy, strlen(name), false, NULL); + recursion(type, &name_copy, strlen(name), false, NULL, false); ralloc_free(name_copy); } @@ -68,6 +71,8 @@ void program_resource_visitor::process(ir_variable *var) { const glsl_type *t = var->type; + const bool row_major = + var->data.matrix_layout == GLSL_MATRIX_LAYOUT_ROW_MAJOR; /* false is always passed for the row_major parameter to the other * processing functions because no information is available to do @@ -105,7 +110,7 @@ program_resource_visitor::process(ir_variable *var) * lowering is only applied to non-uniform interface blocks, so we * can safely pass false for row_major. */ - recursion(var->type, &name, new_length, false, NULL); + recursion(var->type, &name, new_length, row_major, NULL, false); } ralloc_free(name); } else if (var->data.from_named_ifc_block_nonarray) { @@ -129,29 +134,30 @@ program_resource_visitor::process(ir_variable *var) * is only applied to non-uniform interface blocks, so we can safely * pass false for row_major. */ - recursion(var->type, &name, strlen(name), false, NULL); + recursion(var->type, &name, strlen(name), row_major, NULL, false); ralloc_free(name); - } else if (t->is_record() || (t->is_array() && t->fields.array->is_record())) { + } else if (t->without_array()->is_record()) { char *name = ralloc_strdup(NULL, var->name); - recursion(var->type, &name, strlen(name), false, NULL); + recursion(var->type, &name, strlen(name), row_major, NULL, false); ralloc_free(name); } else if (t->is_interface()) { char *name = ralloc_strdup(NULL, var->type->name); - recursion(var->type, &name, strlen(name), false, NULL); + recursion(var->type, &name, strlen(name), row_major, NULL, false); ralloc_free(name); } else if (t->is_array() && t->fields.array->is_interface()) { char *name = ralloc_strdup(NULL, var->type->fields.array->name); - recursion(var->type, &name, strlen(name), false, NULL); + recursion(var->type, &name, strlen(name), row_major, NULL, false); ralloc_free(name); } else { - this->visit_field(t, var->name, false, NULL); + this->visit_field(t, var->name, row_major, NULL, false); } } void program_resource_visitor::recursion(const glsl_type *t, char **name, size_t name_length, bool row_major, - const glsl_type *record_type) + const glsl_type *record_type, + bool last_field) { /* Records need to have each field processed individually. * @@ -177,8 +183,25 @@ program_resource_visitor::recursion(const glsl_type *t, char **name, ralloc_asprintf_rewrite_tail(name, &new_length, ".%s", field); } + /* The layout of structures at the top level of the block is set + * during parsing. For matrices contained in multiple levels of + * structures in the block, the inner structures have no layout. + * These cases must potentially inherit the layout from the outer + * levels. + */ + bool field_row_major = row_major; + const enum glsl_matrix_layout matrix_layout = + glsl_matrix_layout(t->fields.structure[i].matrix_layout); + if (matrix_layout == GLSL_MATRIX_LAYOUT_ROW_MAJOR) { + field_row_major = true; + } else if (matrix_layout == GLSL_MATRIX_LAYOUT_COLUMN_MAJOR) { + field_row_major = false; + } + recursion(t->fields.structure[i].type, name, new_length, - t->fields.structure[i].row_major, record_type); + field_row_major, + record_type, + (i + 1) == t->length); /* Only the first leaf-field of the record gets called with the * record type pointer. @@ -197,7 +220,8 @@ program_resource_visitor::recursion(const glsl_type *t, char **name, ralloc_asprintf_rewrite_tail(name, &new_length, "[%u]", i); recursion(t->fields.array, name, new_length, row_major, - record_type); + record_type, + (i + 1) == t->length); /* Only the first leaf-field of the record gets called with the * record type pointer. @@ -205,14 +229,15 @@ program_resource_visitor::recursion(const glsl_type *t, char **name, record_type = NULL; } } else { - this->visit_field(t, *name, row_major, record_type); + this->visit_field(t, *name, row_major, record_type, last_field); } } void program_resource_visitor::visit_field(const glsl_type *type, const char *name, bool row_major, - const glsl_type *record_type) + const glsl_type *, + bool /* last_field */) { visit_field(type, name, row_major); } @@ -294,10 +319,8 @@ private: virtual void visit_field(const glsl_type *type, const char *name, bool row_major) { - assert(!type->is_record()); - assert(!(type->is_array() && type->fields.array->is_record())); - assert(!type->is_interface()); - assert(!(type->is_array() && type->fields.array->is_interface())); + assert(!type->without_array()->is_record()); + assert(!type->without_array()->is_interface()); (void) row_major; @@ -308,8 +331,7 @@ private: */ const unsigned values = values_for_type(type); if (type->contains_sampler()) { - this->num_shader_samplers += - type->is_array() ? type->array_size() : 1; + this->num_shader_samplers += values; } else if (type->contains_image()) { this->num_shader_images += values; @@ -387,6 +409,9 @@ public: void set_and_process(struct gl_shader_program *prog, ir_variable *var) { + current_var = var; + field_counter = 0; + ubo_block_index = -1; if (var->is_in_uniform_block()) { if (var->is_interface_instance() && var->type->is_array()) { @@ -420,7 +445,6 @@ public: */ if (var->is_interface_instance()) { ubo_byte_offset = 0; - ubo_row_major = false; } else { const struct gl_uniform_block *const block = &prog->UniformBlocks[ubo_block_index]; @@ -430,7 +454,6 @@ public: const struct gl_uniform_buffer_variable *const ubo_var = &block->Uniforms[var->data.location]; - ubo_row_major = !!ubo_var->RowMajor; ubo_byte_offset = ubo_var->Offset; } @@ -445,7 +468,6 @@ public: int ubo_block_index; int ubo_byte_offset; - bool ubo_row_major; gl_shader_stage shader_type; private: @@ -505,14 +527,11 @@ private: } virtual void visit_field(const glsl_type *type, const char *name, - bool row_major, const glsl_type *record_type) + bool row_major, const glsl_type *record_type, + bool last_field) { - assert(!type->is_record()); - assert(!(type->is_array() && type->fields.array->is_record())); - assert(!type->is_interface()); - assert(!(type->is_array() && type->fields.array->is_interface())); - - (void) row_major; + assert(!type->without_array()->is_record()); + assert(!type->without_array()->is_interface()); unsigned id; bool found = this->map->get(id, name); @@ -543,6 +562,22 @@ private: return; } + /* Assign explicit locations. */ + if (current_var->data.explicit_location) { + /* Set sequential locations for struct fields. */ + if (record_type != NULL) { + const unsigned entries = MAX2(1, this->uniforms[id].array_elements); + this->uniforms[id].remap_location = + current_var->data.location + field_counter; + field_counter += entries; + } else { + this->uniforms[id].remap_location = current_var->data.location; + } + } else { + /* Initialize to to indicate that no location is set */ + this->uniforms[id].remap_location = UNMAPPED_UNIFORM_LOC; + } + this->uniforms[id].name = ralloc_strdup(this->uniforms, name); this->uniforms[id].type = base_type; this->uniforms[id].initialized = 0; @@ -554,23 +589,25 @@ private: this->uniforms[id].block_index = this->ubo_block_index; const unsigned alignment = record_type - ? record_type->std140_base_alignment(ubo_row_major) - : type->std140_base_alignment(ubo_row_major); + ? record_type->std140_base_alignment(row_major) + : type->std140_base_alignment(row_major); this->ubo_byte_offset = glsl_align(this->ubo_byte_offset, alignment); this->uniforms[id].offset = this->ubo_byte_offset; - this->ubo_byte_offset += type->std140_size(ubo_row_major); + this->ubo_byte_offset += type->std140_size(row_major); + + if (last_field) + this->ubo_byte_offset = glsl_align(this->ubo_byte_offset, 16); if (type->is_array()) { this->uniforms[id].array_stride = - glsl_align(type->fields.array->std140_size(ubo_row_major), 16); + glsl_align(type->fields.array->std140_size(row_major), 16); } else { this->uniforms[id].array_stride = 0; } - if (type->is_matrix() || - (type->is_array() && type->fields.array->is_matrix())) { + if (type->without_array()->is_matrix()) { this->uniforms[id].matrix_stride = 16; - this->uniforms[id].row_major = ubo_row_major; + this->uniforms[id].row_major = row_major; } else { this->uniforms[id].matrix_stride = 0; this->uniforms[id].row_major = false; @@ -597,6 +634,17 @@ public: gl_texture_index targets[MAX_SAMPLERS]; + /** + * Current variable being processed. + */ + ir_variable *current_var; + + /** + * Field counter is used to take care that uniform structures + * with explicit locations get sequential locations. + */ + unsigned field_counter; + /** * Mask of samplers used by the current shader stage. */ @@ -668,8 +716,8 @@ link_cross_validate_uniform_block(void *mem_ctx, static void link_update_uniform_buffer_variables(struct gl_shader *shader) { - foreach_list(node, shader->ir) { - ir_variable *const var = ((ir_instruction *) node)->as_variable(); + foreach_in_list(ir_instruction, node, shader->ir) { + ir_variable *const var = node->as_variable(); if ((var == NULL) || !var->is_in_uniform_block()) continue; @@ -701,7 +749,7 @@ link_update_uniform_buffer_variables(struct gl_shader *shader) if (end == NULL) continue; - if (l != (end - begin)) + if ((ptrdiff_t) l != (end - begin)) continue; if (strncmp(var->name, begin, l) == 0) { @@ -723,39 +771,6 @@ link_update_uniform_buffer_variables(struct gl_shader *shader) } } -void -link_assign_uniform_block_offsets(struct gl_shader *shader) -{ - for (unsigned b = 0; b < shader->NumUniformBlocks; b++) { - struct gl_uniform_block *block = &shader->UniformBlocks[b]; - - unsigned offset = 0; - for (unsigned int i = 0; i < block->NumUniforms; i++) { - struct gl_uniform_buffer_variable *ubo_var = &block->Uniforms[i]; - const struct glsl_type *type = ubo_var->Type; - - unsigned alignment = type->std140_base_alignment(!!ubo_var->RowMajor); - unsigned size = type->std140_size(!!ubo_var->RowMajor); - - offset = glsl_align(offset, alignment); - ubo_var->Offset = offset; - offset += size; - } - - /* From the GL_ARB_uniform_buffer_object spec: - * - * "For uniform blocks laid out according to [std140] rules, - * the minimum buffer object size returned by the - * UNIFORM_BLOCK_DATA_SIZE query is derived by taking the - * offset of the last basic machine unit consumed by the - * last uniform of the uniform block (including any - * end-of-array or end-of-structure padding), adding one, - * and rounding up to the next multiple of the base - * alignment required for a vec4." - */ - block->UniformBufferSize = glsl_align(offset, 16); - } -} /** * Scan the program for image uniforms and store image unit access @@ -770,18 +785,19 @@ link_set_image_access_qualifiers(struct gl_shader_program *prog) if (sh == NULL) continue; - foreach_list(node, sh->ir) { - ir_variable *var = ((ir_instruction *) node)->as_variable(); + foreach_in_list(ir_instruction, node, sh->ir) { + ir_variable *var = node->as_variable(); if (var && var->data.mode == ir_var_uniform && var->type->contains_image()) { - unsigned id; + unsigned id = 0; bool found = prog->UniformHash->get(id, var->name); assert(found); + (void) found; const gl_uniform_storage *storage = &prog->UniformStorage[id]; const unsigned index = storage->image[i].index; - const GLenum access = (var->data.image.read_only ? GL_READ_ONLY : - var->data.image.write_only ? GL_WRITE_ONLY : + const GLenum access = (var->data.image_read_only ? GL_READ_ONLY : + var->data.image_write_only ? GL_WRITE_ONLY : GL_READ_WRITE); for (unsigned j = 0; j < MAX2(1, storage->array_elements); ++j) @@ -792,7 +808,8 @@ link_set_image_access_qualifiers(struct gl_shader_program *prog) } void -link_assign_uniform_locations(struct gl_shader_program *prog) +link_assign_uniform_locations(struct gl_shader_program *prog, + unsigned int boolean_true) { ralloc_free(prog->UniformStorage); prog->UniformStorage = NULL; @@ -836,15 +853,15 @@ link_assign_uniform_locations(struct gl_shader_program *prog) */ uniform_size.start_shader(); - foreach_list(node, sh->ir) { - ir_variable *const var = ((ir_instruction *) node)->as_variable(); + foreach_in_list(ir_instruction, node, sh->ir) { + ir_variable *const var = node->as_variable(); if ((var == NULL) || (var->data.mode != ir_var_uniform)) continue; /* FINISHME: Update code to process built-in uniforms! */ - if (strncmp("gl_", var->name, 3) == 0) { + if (is_gl_identifier(var->name)) { uniform_size.num_shader_uniform_components += var->type->component_slots(); continue; @@ -888,15 +905,15 @@ link_assign_uniform_locations(struct gl_shader_program *prog) parcel.start_shader((gl_shader_stage)i); - foreach_list(node, prog->_LinkedShaders[i]->ir) { - ir_variable *const var = ((ir_instruction *) node)->as_variable(); + foreach_in_list(ir_instruction, node, prog->_LinkedShaders[i]->ir) { + ir_variable *const var = node->as_variable(); if ((var == NULL) || (var->data.mode != ir_var_uniform)) continue; /* FINISHME: Update code to process built-in uniforms! */ - if (strncmp("gl_", var->name, 3) == 0) + if (is_gl_identifier(var->name)) continue; parcel.set_and_process(prog, var); @@ -910,19 +927,48 @@ link_assign_uniform_locations(struct gl_shader_program *prog) sizeof(prog->_LinkedShaders[i]->SamplerTargets)); } - /* Determine the size of the largest uniform array queryable via - * glGetUniformLocation. Using this as the location scale guarantees that - * there is enough "room" for the array index to be stored in the low order - * part of the uniform location. It also makes the locations be more - * tightly packed. - */ - unsigned max_array_size = 1; + /* Reserve all the explicit locations of the active uniforms. */ for (unsigned i = 0; i < num_user_uniforms; i++) { - if (uniforms[i].array_elements > max_array_size) - max_array_size = uniforms[i].array_elements; + if (uniforms[i].remap_location != UNMAPPED_UNIFORM_LOC) { + /* How many new entries for this uniform? */ + const unsigned entries = MAX2(1, uniforms[i].array_elements); + + /* Set remap table entries point to correct gl_uniform_storage. */ + for (unsigned j = 0; j < entries; j++) { + unsigned element_loc = uniforms[i].remap_location + j; + assert(prog->UniformRemapTable[element_loc] == + INACTIVE_UNIFORM_EXPLICIT_LOCATION); + prog->UniformRemapTable[element_loc] = &uniforms[i]; + } + } } - prog->UniformLocationBaseScale = max_array_size; + /* Reserve locations for rest of the uniforms. */ + for (unsigned i = 0; i < num_user_uniforms; i++) { + + /* Explicit ones have been set already. */ + if (uniforms[i].remap_location != UNMAPPED_UNIFORM_LOC) + continue; + + /* how many new entries for this uniform? */ + const unsigned entries = MAX2(1, uniforms[i].array_elements); + + /* resize remap table to fit new entries */ + prog->UniformRemapTable = + reralloc(prog, + prog->UniformRemapTable, + gl_uniform_storage *, + prog->NumUniformRemapTable + entries); + + /* set pointers for this uniform */ + for (unsigned j = 0; j < entries; j++) + prog->UniformRemapTable[prog->NumUniformRemapTable+j] = &uniforms[i]; + + /* set the base location in remap table for the uniform */ + uniforms[i].remap_location = prog->NumUniformRemapTable; + + prog->NumUniformRemapTable += entries; + } #ifndef NDEBUG for (unsigned i = 0; i < num_user_uniforms; i++) { @@ -936,7 +982,7 @@ link_assign_uniform_locations(struct gl_shader_program *prog) prog->UniformStorage = uniforms; link_set_image_access_qualifiers(prog); - link_set_uniform_initializers(prog); + link_set_uniform_initializers(prog, boolean_true); return; } diff --git a/3rdparty/glsl-optimizer/src/glsl/link_varyings.cpp b/3rdparty/glsl-optimizer/src/glsl/link_varyings.cpp index 4f4aa89b4..c2541b099 100644 --- a/3rdparty/glsl-optimizer/src/glsl/link_varyings.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/link_varyings.cpp @@ -29,6 +29,7 @@ */ +#include "main/errors.h" #include "main/mtypes.h" #include "glsl_symbol_table.h" #include "glsl_parser_extras.h" @@ -77,8 +78,7 @@ cross_validate_types_and_qualifiers(struct gl_shader_program *prog, * correspondence between the vertex language and the * fragment language." */ - if (!output->type->is_array() - || (strncmp("gl_", output->name, 3) != 0)) { + if (!output->type->is_array() || !is_gl_identifier(output->name)) { linker_error(prog, "%s shader output `%s' declared as type `%s', " "but %s shader input declared as type `%s'\n", @@ -172,16 +172,36 @@ cross_validate_outputs_to_inputs(struct gl_shader_program *prog, gl_shader *producer, gl_shader *consumer) { glsl_symbol_table parameters; + ir_variable *explicit_locations[MAX_VARYING] = { NULL, }; /* Find all shader outputs in the "producer" stage. */ - foreach_list(node, producer->ir) { - ir_variable *const var = ((ir_instruction *) node)->as_variable(); + foreach_in_list(ir_instruction, node, producer->ir) { + ir_variable *const var = node->as_variable(); if ((var == NULL) || (var->data.mode != ir_var_shader_out)) continue; - parameters.add_variable(var); + if (!var->data.explicit_location + || var->data.location < VARYING_SLOT_VAR0) + parameters.add_variable(var); + else { + /* User-defined varyings with explicit locations are handled + * differently because they do not need to have matching names. + */ + const unsigned idx = var->data.location - VARYING_SLOT_VAR0; + + if (explicit_locations[idx] != NULL) { + linker_error(prog, + "%s shader has multiple outputs explicitly " + "assigned to location %d\n", + _mesa_shader_stage_to_string(producer->Stage), + idx); + return; + } + + explicit_locations[idx] = var; + } } @@ -193,8 +213,8 @@ cross_validate_outputs_to_inputs(struct gl_shader_program *prog, * should be arrays and the type of the array element should match the type * of the corresponding producer output. */ - foreach_list(node, consumer->ir) { - ir_variable *const input = ((ir_instruction *) node)->as_variable(); + foreach_in_list(ir_instruction, node, consumer->ir) { + ir_variable *const input = node->as_variable(); if ((input == NULL) || (input->data.mode != ir_var_shader_in)) continue; @@ -220,7 +240,27 @@ cross_validate_outputs_to_inputs(struct gl_shader_program *prog, front_color, back_color, consumer->Stage, producer->Stage); } else { - ir_variable *const output = parameters.get_variable(input->name); + /* The rules for connecting inputs and outputs change in the presence + * of explicit locations. In this case, we no longer care about the + * names of the variables. Instead, we care only about the + * explicitly assigned location. + */ + ir_variable *output = NULL; + if (input->data.explicit_location + && input->data.location >= VARYING_SLOT_VAR0) { + output = explicit_locations[input->data.location - VARYING_SLOT_VAR0]; + + if (output == NULL) { + linker_error(prog, + "%s shader input `%s' with explicit location " + "has no matching output\n", + _mesa_shader_stage_to_string(consumer->Stage), + input->name); + } + } else { + output = parameters.get_variable(input->name); + } + if (output != NULL) { cross_validate_types_and_qualifiers(prog, input, output, consumer->Stage, producer->Stage); @@ -252,6 +292,7 @@ tfeedback_decl::init(struct gl_context *ctx, const void *mem_ctx, this->skip_components = 0; this->next_buffer_separator = false; this->matched_candidate = NULL; + this->stream_id = 0; if (ctx->Extensions.ARB_transform_feedback3) { /* Parse gl_NextBuffer. */ @@ -278,6 +319,11 @@ tfeedback_decl::init(struct gl_context *ctx, const void *mem_ctx, const char *base_name_end; long subscript = parse_program_resource_name(input, &base_name_end); this->var_name = ralloc_strndup(mem_ctx, input, base_name_end - input); + if (this->var_name == NULL) { + _mesa_error_no_memory(__func__); + return; + } + if (subscript >= 0) { this->array_subscript = subscript; this->is_subscripted = true; @@ -289,7 +335,7 @@ tfeedback_decl::init(struct gl_context *ctx, const void *mem_ctx, * class must behave specially to account for the fact that gl_ClipDistance * is converted from a float[8] to a vec4[2]. */ - if (ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].LowerClipDistance && + if (ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].LowerClipDistance && strcmp(this->var_name, "gl_ClipDistance") == 0) { this->is_clip_distance_mesa = true; } @@ -316,8 +362,8 @@ tfeedback_decl::is_same(const tfeedback_decl &x, const tfeedback_decl &y) /** - * Assign a location for this tfeedback_decl object based on the transform - * feedback candidate found by find_candidate. + * Assign a location and stream ID for this tfeedback_decl object based on the + * transform feedback candidate found by find_candidate. * * If an error occurs, the error is reported through linker_error() and false * is returned. @@ -398,6 +444,11 @@ tfeedback_decl::assign_location(struct gl_context *ctx, return false; } + /* Only transform feedback varyings can be assigned to non-zero streams, + * so assign the stream id here. + */ + this->stream_id = this->matched_candidate->toplevel_var->data.stream; + return true; } @@ -456,6 +507,7 @@ tfeedback_decl::store(struct gl_context *ctx, struct gl_shader_program *prog, info->Outputs[info->NumOutputs].ComponentOffset = location_frac; info->Outputs[info->NumOutputs].OutputRegister = location; info->Outputs[info->NumOutputs].NumComponents = output_size; + info->Outputs[info->NumOutputs].StreamId = stream_id; info->Outputs[info->NumOutputs].OutputBuffer = buffer; info->Outputs[info->NumOutputs].DstOffset = info->BufferStride[buffer]; ++info->NumOutputs; @@ -589,10 +641,27 @@ store_tfeedback_info(struct gl_context *ctx, struct gl_shader_program *prog, } else { /* GL_INVERLEAVED_ATTRIBS */ + int buffer_stream_id = -1; for (unsigned i = 0; i < num_tfeedback_decls; ++i) { if (tfeedback_decls[i].is_next_buffer_separator()) { num_buffers++; + buffer_stream_id = -1; continue; + } else if (buffer_stream_id == -1) { + /* First varying writing to this buffer: remember its stream */ + buffer_stream_id = (int) tfeedback_decls[i].get_stream_id(); + } else if (buffer_stream_id != + (int) tfeedback_decls[i].get_stream_id()) { + /* Varying writes to the same buffer from a different stream */ + linker_error(prog, + "Transform feedback can't capture varyings belonging " + "to different vertex streams in a single buffer. " + "Varying %s writes to buffer from stream %u, other " + "varyings in the same buffer write from stream %u.", + tfeedback_decls[i].name(), + tfeedback_decls[i].get_stream_id(), + buffer_stream_id); + return false; } if (!tfeedback_decls[i].store(ctx, prog, @@ -622,7 +691,7 @@ public: ~varying_matches(); void record(ir_variable *producer_var, ir_variable *consumer_var); unsigned assign_locations(); - void store_locations(unsigned producer_base, unsigned consumer_base) const; + void store_locations() const; private: /** @@ -648,8 +717,8 @@ private: PACKING_ORDER_VEC3, }; - static unsigned compute_packing_class(ir_variable *var); - static packing_order_enum compute_packing_order(ir_variable *var); + static unsigned compute_packing_class(const ir_variable *var); + static packing_order_enum compute_packing_order(const ir_variable *var); static int match_comparator(const void *x_generic, const void *y_generic); /** @@ -746,7 +815,10 @@ varying_matches::~varying_matches() void varying_matches::record(ir_variable *producer_var, ir_variable *consumer_var) { - if (!producer_var->data.is_unmatched_generic_inout) { + assert(producer_var != NULL || consumer_var != NULL); + + if ((producer_var && !producer_var->data.is_unmatched_generic_inout) + || (consumer_var && !consumer_var->data.is_unmatched_generic_inout)) { /* Either a location already exists for this variable (since it is part * of fixed functionality), or it has already been recorded as part of a * previous match. @@ -781,24 +853,28 @@ varying_matches::record(ir_variable *producer_var, ir_variable *consumer_var) realloc(this->matches, sizeof(*this->matches) * this->matches_capacity); } + + const ir_variable *const var = (producer_var != NULL) + ? producer_var : consumer_var; + this->matches[this->num_matches].packing_class - = this->compute_packing_class(producer_var); + = this->compute_packing_class(var); this->matches[this->num_matches].packing_order - = this->compute_packing_order(producer_var); + = this->compute_packing_order(var); if (this->disable_varying_packing) { - unsigned slots = producer_var->type->is_array() - ? (producer_var->type->length - * producer_var->type->fields.array->matrix_columns) - : producer_var->type->matrix_columns; + unsigned slots = var->type->is_array() + ? (var->type->length * var->type->fields.array->matrix_columns) + : var->type->matrix_columns; this->matches[this->num_matches].num_components = 4 * slots; } else { this->matches[this->num_matches].num_components - = producer_var->type->component_slots(); + = var->type->component_slots(); } this->matches[this->num_matches].producer_var = producer_var; this->matches[this->num_matches].consumer_var = consumer_var; this->num_matches++; - producer_var->data.is_unmatched_generic_inout = 0; + if (producer_var) + producer_var->data.is_unmatched_generic_inout = 0; if (consumer_var) consumer_var->data.is_unmatched_generic_inout = 0; } @@ -842,8 +918,7 @@ varying_matches::assign_locations() * assignments that were made by varying_matches::assign_locations(). */ void -varying_matches::store_locations(unsigned producer_base, - unsigned consumer_base) const +varying_matches::store_locations() const { for (unsigned i = 0; i < this->num_matches; i++) { ir_variable *producer_var = this->matches[i].producer_var; @@ -852,11 +927,14 @@ varying_matches::store_locations(unsigned producer_base, unsigned slot = generic_location / 4; unsigned offset = generic_location % 4; - producer_var->data.location = producer_base + slot; - producer_var->data.location_frac = offset; + if (producer_var) { + producer_var->data.location = VARYING_SLOT_VAR0 + slot; + producer_var->data.location_frac = offset; + } + if (consumer_var) { assert(consumer_var->data.location == -1); - consumer_var->data.location = consumer_base + slot; + consumer_var->data.location = VARYING_SLOT_VAR0 + slot; consumer_var->data.location_frac = offset; } } @@ -869,7 +947,7 @@ varying_matches::store_locations(unsigned producer_base, * be safely backed into the same vec4. */ unsigned -varying_matches::compute_packing_class(ir_variable *var) +varying_matches::compute_packing_class(const ir_variable *var) { /* Without help from the back-end, there is no way to pack together * variables with different interpolation types, because @@ -900,7 +978,7 @@ varying_matches::compute_packing_class(ir_variable *var) * other varyings in the same packing class. */ varying_matches::packing_order_enum -varying_matches::compute_packing_order(ir_variable *var) +varying_matches::compute_packing_order(const ir_variable *var) { const glsl_type *element_type = var->type; @@ -943,7 +1021,7 @@ varying_matches::match_comparator(const void *x_generic, const void *y_generic) * varyings, but excludes variables such as gl_FrontFacing and gl_FragCoord. */ static bool -is_varying_var(gl_shader_stage stage, const ir_variable *var) +var_counts_against_varying_limit(gl_shader_stage stage, const ir_variable *var) { /* Only fragment shaders will take a varying variable as an input */ if (stage == MESA_SHADER_FRAGMENT && @@ -996,10 +1074,8 @@ private: virtual void visit_field(const glsl_type *type, const char *name, bool row_major) { - assert(!type->is_record()); - assert(!(type->is_array() && type->fields.array->is_record())); - assert(!type->is_interface()); - assert(!(type->is_array() && type->fields.array->is_interface())); + assert(!type->without_array()->is_record()); + assert(!type->without_array()->is_interface()); (void) row_major; @@ -1037,6 +1113,157 @@ private: }; +namespace linker { + +bool +populate_consumer_input_sets(void *mem_ctx, exec_list *ir, + hash_table *consumer_inputs, + hash_table *consumer_interface_inputs, + ir_variable *consumer_inputs_with_locations[VARYING_SLOT_MAX]) +{ + memset(consumer_inputs_with_locations, + 0, + sizeof(consumer_inputs_with_locations[0]) * VARYING_SLOT_MAX); + + foreach_in_list(ir_instruction, node, ir) { + ir_variable *const input_var = node->as_variable(); + + if ((input_var != NULL) && (input_var->data.mode == ir_var_shader_in)) { + if (input_var->type->is_interface()) + return false; + + if (input_var->data.explicit_location) { + /* assign_varying_locations only cares about finding the + * ir_variable at the start of a contiguous location block. + * + * - For !producer, consumer_inputs_with_locations isn't used. + * + * - For !consumer, consumer_inputs_with_locations is empty. + * + * For consumer && producer, if you were trying to set some + * ir_variable to the middle of a location block on the other side + * of producer/consumer, cross_validate_outputs_to_inputs() should + * be link-erroring due to either type mismatch or location + * overlaps. If the variables do match up, then they've got a + * matching data.location and you only looked at + * consumer_inputs_with_locations[var->data.location], not any + * following entries for the array/structure. + */ + consumer_inputs_with_locations[input_var->data.location] = + input_var; + } else if (input_var->get_interface_type() != NULL) { + char *const iface_field_name = + ralloc_asprintf(mem_ctx, "%s.%s", + input_var->get_interface_type()->name, + input_var->name); + hash_table_insert(consumer_interface_inputs, input_var, + iface_field_name); + } else { + hash_table_insert(consumer_inputs, input_var, + ralloc_strdup(mem_ctx, input_var->name)); + } + } + } + + return true; +} + +/** + * Find a variable from the consumer that "matches" the specified variable + * + * This function only finds inputs with names that match. There is no + * validation (here) that the types, etc. are compatible. + */ +ir_variable * +get_matching_input(void *mem_ctx, + const ir_variable *output_var, + hash_table *consumer_inputs, + hash_table *consumer_interface_inputs, + ir_variable *consumer_inputs_with_locations[VARYING_SLOT_MAX]) +{ + ir_variable *input_var; + + if (output_var->data.explicit_location) { + input_var = consumer_inputs_with_locations[output_var->data.location]; + } else if (output_var->get_interface_type() != NULL) { + char *const iface_field_name = + ralloc_asprintf(mem_ctx, "%s.%s", + output_var->get_interface_type()->name, + output_var->name); + input_var = + (ir_variable *) hash_table_find(consumer_interface_inputs, + iface_field_name); + } else { + input_var = + (ir_variable *) hash_table_find(consumer_inputs, output_var->name); + } + + return (input_var == NULL || input_var->data.mode != ir_var_shader_in) + ? NULL : input_var; +} + +} + +static int +io_variable_cmp(const void *_a, const void *_b) +{ + const ir_variable *const a = *(const ir_variable **) _a; + const ir_variable *const b = *(const ir_variable **) _b; + + if (a->data.explicit_location && b->data.explicit_location) + return b->data.location - a->data.location; + + if (a->data.explicit_location && !b->data.explicit_location) + return 1; + + if (!a->data.explicit_location && b->data.explicit_location) + return -1; + + return -strcmp(a->name, b->name); +} + +/** + * Sort the shader IO variables into canonical order + */ +static void +canonicalize_shader_io(exec_list *ir, enum ir_variable_mode io_mode) +{ + ir_variable *var_table[MAX_PROGRAM_OUTPUTS * 4]; + unsigned num_variables = 0; + + foreach_in_list(ir_instruction, node, ir) { + ir_variable *const var = node->as_variable(); + + if (var == NULL || var->data.mode != io_mode) + continue; + + /* If we have already encountered more I/O variables that could + * successfully link, bail. + */ + if (num_variables == ARRAY_SIZE(var_table)) + return; + + var_table[num_variables++] = var; + } + + if (num_variables == 0) + return; + + /* Sort the list in reverse order (io_variable_cmp handles this). Later + * we're going to push the variables on to the IR list as a stack, so we + * want the last variable (in canonical order) to be first in the list. + */ + qsort(var_table, num_variables, sizeof(var_table[0]), io_variable_cmp); + + /* Remove the variable from it's current location in the IR, and put it at + * the front. + */ + for (unsigned i = 0; i < num_variables; i++) { + var_table[i]->remove(); + ir->push_head(var_table[i]); + } +} + /** * Assign locations for all variables that are produced in one pipeline stage * (the "producer") and consumed in the next stage (the "consumer"). @@ -1069,8 +1296,6 @@ assign_varying_locations(struct gl_context *ctx, tfeedback_decl *tfeedback_decls, unsigned gs_input_vertices) { - const unsigned producer_base = VARYING_SLOT_VAR0; - const unsigned consumer_base = VARYING_SLOT_VAR0; varying_matches matches(!!ctx->Const.DisableVaryingPacking, consumer && consumer->Stage == MESA_SHADER_FRAGMENT); hash_table *tfeedback_candidates @@ -1079,67 +1304,96 @@ assign_varying_locations(struct gl_context *ctx, = hash_table_ctor(0, hash_table_string_hash, hash_table_string_compare); hash_table *consumer_interface_inputs = hash_table_ctor(0, hash_table_string_hash, hash_table_string_compare); + ir_variable *consumer_inputs_with_locations[VARYING_SLOT_MAX] = { + NULL, + }; - /* Operate in a total of three passes. + /* Operate in a total of four passes. * - * 1. Assign locations for any matching inputs and outputs. + * 1. Sort inputs / outputs into a canonical order. This is necessary so + * that inputs / outputs of separable shaders will be assigned + * predictable locations regardless of the order in which declarations + * appeared in the shader source. * - * 2. Mark output variables in the producer that do not have locations as + * 2. Assign locations for any matching inputs and outputs. + * + * 3. Mark output variables in the producer that do not have locations as * not being outputs. This lets the optimizer eliminate them. * - * 3. Mark input variables in the consumer that do not have locations as + * 4. Mark input variables in the consumer that do not have locations as * not being inputs. This lets the optimizer eliminate them. */ + if (consumer) + canonicalize_shader_io(consumer->ir, ir_var_shader_in); - if (consumer) { - foreach_list(node, consumer->ir) { - ir_variable *const input_var = - ((ir_instruction *) node)->as_variable(); + if (producer) + canonicalize_shader_io(producer->ir, ir_var_shader_out); - if ((input_var != NULL) && (input_var->data.mode == ir_var_shader_in)) { - if (input_var->get_interface_type() != NULL) { - char *const iface_field_name = - ralloc_asprintf(mem_ctx, "%s.%s", - input_var->get_interface_type()->name, - input_var->name); - hash_table_insert(consumer_interface_inputs, input_var, - iface_field_name); - } else { - hash_table_insert(consumer_inputs, input_var, - ralloc_strdup(mem_ctx, input_var->name)); - } - } - } + if (consumer + && !linker::populate_consumer_input_sets(mem_ctx, + consumer->ir, + consumer_inputs, + consumer_interface_inputs, + consumer_inputs_with_locations)) { + assert(!"populate_consumer_input_sets failed"); + hash_table_dtor(tfeedback_candidates); + hash_table_dtor(consumer_inputs); + hash_table_dtor(consumer_interface_inputs); + return false; } - foreach_list(node, producer->ir) { - ir_variable *const output_var = ((ir_instruction *) node)->as_variable(); + if (producer) { + foreach_in_list(ir_instruction, node, producer->ir) { + ir_variable *const output_var = node->as_variable(); - if ((output_var == NULL) || (output_var->data.mode != ir_var_shader_out)) - continue; + if ((output_var == NULL) || + (output_var->data.mode != ir_var_shader_out)) + continue; - tfeedback_candidate_generator g(mem_ctx, tfeedback_candidates); - g.process(output_var); + /* Only geometry shaders can use non-zero streams */ + assert(output_var->data.stream == 0 || + (output_var->data.stream < MAX_VERTEX_STREAMS && + producer->Stage == MESA_SHADER_GEOMETRY)); - ir_variable *input_var; - if (output_var->get_interface_type() != NULL) { - char *const iface_field_name = - ralloc_asprintf(mem_ctx, "%s.%s", - output_var->get_interface_type()->name, - output_var->name); - input_var = - (ir_variable *) hash_table_find(consumer_interface_inputs, - iface_field_name); - } else { - input_var = - (ir_variable *) hash_table_find(consumer_inputs, output_var->name); + tfeedback_candidate_generator g(mem_ctx, tfeedback_candidates); + g.process(output_var); + + ir_variable *const input_var = + linker::get_matching_input(mem_ctx, output_var, consumer_inputs, + consumer_interface_inputs, + consumer_inputs_with_locations); + + /* If a matching input variable was found, add this ouptut (and the + * input) to the set. If this is a separable program and there is no + * consumer stage, add the output. + */ + if (input_var || (prog->SeparateShader && consumer == NULL)) { + matches.record(output_var, input_var); + } + + /* Only stream 0 outputs can be consumed in the next stage */ + if (input_var && output_var->data.stream != 0) { + linker_error(prog, "output %s is assigned to stream=%d but " + "is linked to an input, which requires stream=0", + output_var->name, output_var->data.stream); + return false; + } } + } else { + /* If there's no producer stage, then this must be a separable program. + * For example, we may have a program that has just a fragment shader. + * Later this program will be used with some arbitrary vertex (or + * geometry) shader program. This means that locations must be assigned + * for all the inputs. + */ + foreach_in_list(ir_instruction, node, consumer->ir) { + ir_variable *const input_var = node->as_variable(); - if (input_var && input_var->data.mode != ir_var_shader_in) - input_var = NULL; + if ((input_var == NULL) || + (input_var->data.mode != ir_var_shader_in)) + continue; - if (input_var) { - matches.record(output_var, input_var); + matches.record(NULL, input_var); } } @@ -1162,7 +1416,7 @@ assign_varying_locations(struct gl_context *ctx, } const unsigned slots_used = matches.assign_locations(); - matches.store_locations(producer_base, consumer_base); + matches.store_locations(); for (unsigned i = 0; i < num_tfeedback_decls; ++i) { if (!tfeedback_decls[i].is_varying()) @@ -1187,21 +1441,38 @@ assign_varying_locations(struct gl_context *ctx, */ assert(!ctx->Extensions.EXT_transform_feedback); } else { - lower_packed_varyings(mem_ctx, producer_base, slots_used, - ir_var_shader_out, 0, producer); + if (producer) { + lower_packed_varyings(mem_ctx, slots_used, ir_var_shader_out, + 0, producer); + } if (consumer) { - lower_packed_varyings(mem_ctx, consumer_base, slots_used, - ir_var_shader_in, gs_input_vertices, consumer); + lower_packed_varyings(mem_ctx, slots_used, ir_var_shader_in, + gs_input_vertices, consumer); } } - if (consumer) { - foreach_list(node, consumer->ir) { - ir_variable *const var = ((ir_instruction *) node)->as_variable(); + if (consumer && producer) { + foreach_in_list(ir_instruction, node, consumer->ir) { + ir_variable *const var = node->as_variable(); if (var && var->data.mode == ir_var_shader_in && var->data.is_unmatched_generic_inout) { - if (prog->Version <= 120) { + if (prog->IsES) { + /* + * On Page 91 (Page 97 of the PDF) of the GLSL ES 1.0 spec: + * + * If the vertex shader declares but doesn't write to a + * varying and the fragment shader declares and reads it, + * is this an error? + * + * RESOLUTION: No. + */ + linker_warning(prog, "%s shader varying %s not written " + "by %s shader\n.", + _mesa_shader_stage_to_string(consumer->Stage), + var->name, + _mesa_shader_stage_to_string(producer->Stage)); + } else if (prog->Version <= 120) { /* On page 25 (page 31 of the PDF) of the GLSL 1.20 spec: * * Only those varying variables used (i.e. read) in @@ -1214,7 +1485,6 @@ assign_varying_locations(struct gl_context *ctx, * write the variable for the FS to read it. See * "glsl1-varying read but not written" in piglit. */ - linker_error(prog, "%s shader varying %s not written " "by %s shader\n.", _mesa_shader_stage_to_string(consumer->Stage), @@ -1240,11 +1510,11 @@ check_against_output_limit(struct gl_context *ctx, { unsigned output_vectors = 0; - foreach_list(node, producer->ir) { - ir_variable *const var = ((ir_instruction *) node)->as_variable(); + foreach_in_list(ir_instruction, node, producer->ir) { + ir_variable *const var = node->as_variable(); if (var && var->data.mode == ir_var_shader_out && - is_varying_var(producer->Stage, var)) { + var_counts_against_varying_limit(producer->Stage, var)) { output_vectors += var->type->count_attribute_slots(); } } @@ -1279,11 +1549,11 @@ check_against_input_limit(struct gl_context *ctx, { unsigned input_vectors = 0; - foreach_list(node, consumer->ir) { - ir_variable *const var = ((ir_instruction *) node)->as_variable(); + foreach_in_list(ir_instruction, node, consumer->ir) { + ir_variable *const var = node->as_variable(); if (var && var->data.mode == ir_var_shader_in && - is_varying_var(consumer->Stage, var)) { + var_counts_against_varying_limit(consumer->Stage, var)) { input_vectors += var->type->count_attribute_slots(); } } diff --git a/3rdparty/glsl-optimizer/src/glsl/link_varyings.h b/3rdparty/glsl-optimizer/src/glsl/link_varyings.h index 6fa268176..afc16a8ba 100644 --- a/3rdparty/glsl-optimizer/src/glsl/link_varyings.h +++ b/3rdparty/glsl-optimizer/src/glsl/link_varyings.h @@ -112,6 +112,16 @@ public: return !this->next_buffer_separator && !this->skip_components; } + const char *name() const + { + return this->orig_name; + } + + unsigned get_stream_id() const + { + return this->stream_id; + } + /** * The total number of varying components taken up by this variable. Only * valid if assign_location() has been called. @@ -210,6 +220,13 @@ private: * data structure that was found. Otherwise NULL. */ const tfeedback_candidate *matched_candidate; + + /** + * StreamId assigned to this varying (defaults to 0). Can only be set to + * values other than 0 in geometry shaders that use the stream layout + * modifier. Accepted values must be in the range [0, MAX_VERTEX_STREAMS-1]. + */ + unsigned stream_id; }; diff --git a/3rdparty/glsl-optimizer/src/glsl/linker.cpp b/3rdparty/glsl-optimizer/src/glsl/linker.cpp index a82e5c1d7..1069268fb 100644 --- a/3rdparty/glsl-optimizer/src/glsl/linker.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/linker.cpp @@ -65,6 +65,7 @@ */ #include "main/core.h" +#include "main/errors.h" #include "glsl_symbol_table.h" #include "glsl_parser_extras.h" #include "ir.h" @@ -74,6 +75,7 @@ #include "link_varyings.h" #include "ir_optimization.h" #include "ir_rvalue_visitor.h" +#include "ir_uniform.h" extern "C" { #include "standalone_scaffolding.h" @@ -248,31 +250,100 @@ public: } }; - /** - * Visitor that determines whether or not a shader uses ir_end_primitive. + * Visitor that determines the highest stream id to which a (geometry) shader + * emits vertices. It also checks whether End{Stream}Primitive is ever called. */ -class find_end_primitive_visitor : public ir_hierarchical_visitor { +class find_emit_vertex_visitor : public ir_hierarchical_visitor { public: - find_end_primitive_visitor() - : found(false) + find_emit_vertex_visitor(int max_allowed) + : max_stream_allowed(max_allowed), + invalid_stream_id(0), + invalid_stream_id_from_emit_vertex(false), + end_primitive_found(false), + uses_non_zero_stream(false) { /* empty */ } - virtual ir_visitor_status visit(ir_end_primitive *) + virtual ir_visitor_status visit_leave(ir_emit_vertex *ir) { - found = true; - return visit_stop; + int stream_id = ir->stream_id(); + + if (stream_id < 0) { + invalid_stream_id = stream_id; + invalid_stream_id_from_emit_vertex = true; + return visit_stop; + } + + if (stream_id > max_stream_allowed) { + invalid_stream_id = stream_id; + invalid_stream_id_from_emit_vertex = true; + return visit_stop; + } + + if (stream_id != 0) + uses_non_zero_stream = true; + + return visit_continue; } - bool end_primitive_found() + virtual ir_visitor_status visit_leave(ir_end_primitive *ir) { - return found; + end_primitive_found = true; + + int stream_id = ir->stream_id(); + + if (stream_id < 0) { + invalid_stream_id = stream_id; + invalid_stream_id_from_emit_vertex = false; + return visit_stop; + } + + if (stream_id > max_stream_allowed) { + invalid_stream_id = stream_id; + invalid_stream_id_from_emit_vertex = false; + return visit_stop; + } + + if (stream_id != 0) + uses_non_zero_stream = true; + + return visit_continue; + } + + bool error() + { + return invalid_stream_id != 0; + } + + const char *error_func() + { + return invalid_stream_id_from_emit_vertex ? + "EmitStreamVertex" : "EndStreamPrimitive"; + } + + int error_stream() + { + return invalid_stream_id; + } + + bool uses_streams() + { + return uses_non_zero_stream; + } + + bool uses_end_primitive() + { + return end_primitive_found; } private: - bool found; + int max_stream_allowed; + int invalid_stream_id; + bool invalid_stream_id_from_emit_vertex; + bool end_primitive_found; + bool uses_non_zero_stream; }; } /* anonymous namespace */ @@ -296,7 +367,7 @@ linker_warning(gl_shader_program *prog, const char *fmt, ...) { va_list ap; - ralloc_strcat(&prog->InfoLog, "error: "); + ralloc_strcat(&prog->InfoLog, "warning: "); va_start(ap, fmt); ralloc_vasprintf_append(&prog->InfoLog, fmt, ap); va_end(ap); @@ -366,8 +437,8 @@ parse_program_resource_name(const GLchar *name, void link_invalidate_variable_locations(exec_list *ir) { - foreach_list(node, ir) { - ir_variable *const var = ((ir_instruction *) node)->as_variable(); + foreach_in_list(ir_instruction, node, ir) { + ir_variable *const var = node->as_variable(); if (var == NULL) continue; @@ -488,14 +559,21 @@ validate_vertex_shader_executable(struct gl_shader_program *prog, * vertex processing has occurred. Its value is undefined if * the vertex shader executable does not write gl_Position." * - * GLSL ES 3.00 is similar to GLSL 1.40--failing to write to gl_Position is - * not an error. + * All GLSL ES Versions are similar to GLSL 1.40--failing to write to + * gl_Position is not an error. */ if (prog->Version < (prog->IsES ? 300U : 140U)) { find_assignment_visitor find("gl_Position"); find.run(shader->ir); if (!find.variable_found()) { - linker_error(prog, "vertex shader does not write to `gl_Position'\n"); + if (prog->IsES) { + linker_warning(prog, + "vertex shader does not write to `gl_Position'." + "It's value is undefined. \n"); + } else { + linker_error(prog, + "vertex shader does not write to `gl_Position'. \n"); + } return; } } @@ -549,10 +627,58 @@ validate_geometry_shader_executable(struct gl_shader_program *prog, analyze_clip_usage(prog, shader, &prog->Geom.UsesClipDistance, &prog->Geom.ClipDistanceArraySize); +} - find_end_primitive_visitor end_primitive; - end_primitive.run(shader->ir); - prog->Geom.UsesEndPrimitive = end_primitive.end_primitive_found(); +/** + * Check if geometry shaders emit to non-zero streams and do corresponding + * validations. + */ +static void +validate_geometry_shader_emissions(struct gl_context *ctx, + struct gl_shader_program *prog) +{ + if (prog->_LinkedShaders[MESA_SHADER_GEOMETRY] != NULL) { + find_emit_vertex_visitor emit_vertex(ctx->Const.MaxVertexStreams - 1); + emit_vertex.run(prog->_LinkedShaders[MESA_SHADER_GEOMETRY]->ir); + if (emit_vertex.error()) { + linker_error(prog, "Invalid call %s(%d). Accepted values for the " + "stream parameter are in the range [0, %d].", + emit_vertex.error_func(), + emit_vertex.error_stream(), + ctx->Const.MaxVertexStreams - 1); + } + prog->Geom.UsesStreams = emit_vertex.uses_streams(); + prog->Geom.UsesEndPrimitive = emit_vertex.uses_end_primitive(); + + /* From the ARB_gpu_shader5 spec: + * + * "Multiple vertex streams are supported only if the output primitive + * type is declared to be "points". A program will fail to link if it + * contains a geometry shader calling EmitStreamVertex() or + * EndStreamPrimitive() if its output primitive type is not "points". + * + * However, in the same spec: + * + * "The function EmitVertex() is equivalent to calling EmitStreamVertex() + * with set to zero." + * + * And: + * + * "The function EndPrimitive() is equivalent to calling + * EndStreamPrimitive() with set to zero." + * + * Since we can call EmitVertex() and EndPrimitive() when we output + * primitives other than points, calling EmitStreamVertex(0) or + * EmitEndPrimitive(0) should not produce errors. This it also what Nvidia + * does. Currently we only set prog->Geom.UsesStreams to TRUE when + * EmitStreamVertex() or EmitEndPrimitive() are called with a non-zero + * stream. + */ + if (prog->Geom.UsesStreams && prog->Geom.OutputType != GL_POINTS) { + linker_error(prog, "EmitStreamVertex(n) and EndStreamPrimitive(n) " + "with n>0 requires point output"); + } + } } @@ -573,8 +699,8 @@ cross_validate_globals(struct gl_shader_program *prog, if (shader_list[i] == NULL) continue; - foreach_list(node, shader_list[i]->ir) { - ir_variable *const var = ((ir_instruction *) node)->as_variable(); + foreach_in_list(ir_instruction, node, shader_list[i]->ir) { + ir_variable *const var = node->as_variable(); if (var == NULL) continue; @@ -843,15 +969,15 @@ populate_symbol_table(gl_shader *sh) { sh->symbols = new(sh) glsl_symbol_table; - foreach_list(node, sh->ir) { - ir_instruction *const inst = (ir_instruction *) node; + foreach_in_list(ir_instruction, inst, sh->ir) { ir_variable *var; ir_function *func; if ((func = inst->as_function()) != NULL) { sh->symbols->add_function(func); } else if ((var = inst->as_variable()) != NULL) { - sh->symbols->add_variable(var); + if (var->data.mode != ir_var_temporary) + sh->symbols->add_variable(var); } } } @@ -960,9 +1086,7 @@ move_non_declarations(exec_list *instructions, exec_node *last, temps = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare); - foreach_list_safe(node, instructions) { - ir_instruction *inst = (ir_instruction *) node; - + foreach_in_list_safe(ir_instruction, inst, instructions) { if (inst->as_function()) continue; @@ -1004,8 +1128,8 @@ move_non_declarations(exec_list *instructions, exec_node *last, /** * Get the function signature for main from a shader */ -static ir_function_signature * -get_main_function_signature(gl_shader *sh) +ir_function_signature * +link_get_main_function_signature(gl_shader *sh) { ir_function *const f = sh->symbols->get_function("main"); if (f != NULL) { @@ -1018,7 +1142,8 @@ get_main_function_signature(gl_shader *sh) * We don't have to check for multiple definitions of main (in multiple * shaders) because that would have already been caught above. */ - ir_function_signature *sig = f->matching_signature(NULL, &void_parameters); + ir_function_signature *sig = + f->matching_signature(NULL, &void_parameters, false); if ((sig != NULL) && sig->is_defined) { return sig; } @@ -1054,7 +1179,8 @@ public: if (var->type->is_interface()) { if (interface_contains_unsized_arrays(var->type)) { const glsl_type *new_type = - resize_interface_members(var->type, var->max_ifc_array_access); + resize_interface_members(var->type, + var->get_max_ifc_array_access()); var->type = new_type; var->change_interface_type(new_type); } @@ -1063,7 +1189,7 @@ public: if (interface_contains_unsized_arrays(var->type->fields.array)) { const glsl_type *new_type = resize_interface_members(var->type->fields.array, - var->max_ifc_array_access); + var->get_max_ifc_array_access()); var->change_interface_type(new_type); var->type = glsl_type::get_array_instance(new_type, var->type->length); @@ -1198,6 +1324,83 @@ private: hash_table *unnamed_interfaces; }; +/** + * Performs the cross-validation of layout qualifiers specified in + * redeclaration of gl_FragCoord for the attached fragment shaders, + * and propagates them to the linked FS and linked shader program. + */ +static void +link_fs_input_layout_qualifiers(struct gl_shader_program *prog, + struct gl_shader *linked_shader, + struct gl_shader **shader_list, + unsigned num_shaders) +{ + linked_shader->redeclares_gl_fragcoord = false; + linked_shader->uses_gl_fragcoord = false; + linked_shader->origin_upper_left = false; + linked_shader->pixel_center_integer = false; + + if (linked_shader->Stage != MESA_SHADER_FRAGMENT || + (prog->Version < 150 && !prog->ARB_fragment_coord_conventions_enable)) + return; + + for (unsigned i = 0; i < num_shaders; i++) { + struct gl_shader *shader = shader_list[i]; + /* From the GLSL 1.50 spec, page 39: + * + * "If gl_FragCoord is redeclared in any fragment shader in a program, + * it must be redeclared in all the fragment shaders in that program + * that have a static use gl_FragCoord." + * + * Exclude the case when one of the 'linked_shader' or 'shader' redeclares + * gl_FragCoord with no layout qualifiers but the other one doesn't + * redeclare it. If we strictly follow GLSL 1.50 spec's language, it + * should be a link error. But, generating link error for this case will + * be a wrong behaviour which spec didn't intend to do and it could also + * break some applications. + */ + if ((linked_shader->redeclares_gl_fragcoord + && !shader->redeclares_gl_fragcoord + && shader->uses_gl_fragcoord + && (linked_shader->origin_upper_left + || linked_shader->pixel_center_integer)) + || (shader->redeclares_gl_fragcoord + && !linked_shader->redeclares_gl_fragcoord + && linked_shader->uses_gl_fragcoord + && (shader->origin_upper_left + || shader->pixel_center_integer))) { + linker_error(prog, "fragment shader defined with conflicting " + "layout qualifiers for gl_FragCoord\n"); + } + + /* From the GLSL 1.50 spec, page 39: + * + * "All redeclarations of gl_FragCoord in all fragment shaders in a + * single program must have the same set of qualifiers." + */ + if (linked_shader->redeclares_gl_fragcoord && shader->redeclares_gl_fragcoord + && (shader->origin_upper_left != linked_shader->origin_upper_left + || shader->pixel_center_integer != linked_shader->pixel_center_integer)) { + linker_error(prog, "fragment shader defined with conflicting " + "layout qualifiers for gl_FragCoord\n"); + } + + /* Update the linked shader state.  Note that uses_gl_fragcoord should + * accumulate the results.  The other values should replace.  If there + * are multiple redeclarations, all the fields except uses_gl_fragcoord + * are already known to be the same. + */ + if (shader->redeclares_gl_fragcoord || shader->uses_gl_fragcoord) { + linked_shader->redeclares_gl_fragcoord = + shader->redeclares_gl_fragcoord; + linked_shader->uses_gl_fragcoord = linked_shader->uses_gl_fragcoord + || shader->uses_gl_fragcoord; + linked_shader->origin_upper_left = shader->origin_upper_left; + linked_shader->pixel_center_integer = shader->pixel_center_integer; + } + } +} + /** * Performs the cross-validation of geometry shader max_vertices and * primitive type layout qualifiers for the attached geometry shaders, @@ -1210,6 +1413,7 @@ link_gs_inout_layout_qualifiers(struct gl_shader_program *prog, unsigned num_shaders) { linked_shader->Geom.VerticesOut = 0; + linked_shader->Geom.Invocations = 0; linked_shader->Geom.InputType = PRIM_UNKNOWN; linked_shader->Geom.OutputType = PRIM_UNKNOWN; @@ -1263,6 +1467,18 @@ link_gs_inout_layout_qualifiers(struct gl_shader_program *prog, } linked_shader->Geom.VerticesOut = shader->Geom.VerticesOut; } + + if (shader->Geom.Invocations != 0) { + if (linked_shader->Geom.Invocations != 0 && + linked_shader->Geom.Invocations != shader->Geom.Invocations) { + linker_error(prog, "geometry shader defined with conflicting " + "invocation count (%d and %d)\n", + linked_shader->Geom.Invocations, + shader->Geom.Invocations); + return; + } + linked_shader->Geom.Invocations = shader->Geom.Invocations; + } } /* Just do the intrastage -> interstage propagation right now, @@ -1289,6 +1505,11 @@ link_gs_inout_layout_qualifiers(struct gl_shader_program *prog, return; } prog->Geom.VerticesOut = linked_shader->Geom.VerticesOut; + + if (linked_shader->Geom.Invocations == 0) + linked_shader->Geom.Invocations = 1; + + prog->Geom.Invocations = linked_shader->Geom.Invocations; } @@ -1387,13 +1608,15 @@ link_intrastage_shaders(void *mem_ctx, const unsigned num_uniform_blocks = link_uniform_blocks(mem_ctx, prog, shader_list, num_shaders, &uniform_blocks); + if (!prog->LinkStatus) + return NULL; /* Check that there is only a single definition of each function signature * across all shaders. */ for (unsigned i = 0; i < (num_shaders - 1); i++) { - foreach_list(node, shader_list[i]->ir) { - ir_function *const f = ((ir_instruction *) node)->as_function(); + foreach_in_list(ir_instruction, node, shader_list[i]->ir) { + ir_function *const f = node->as_function(); if (f == NULL) continue; @@ -1408,9 +1631,7 @@ link_intrastage_shaders(void *mem_ctx, if (other == NULL) continue; - foreach_list(n, &f->signatures) { - ir_function_signature *sig = (ir_function_signature *) n; - + foreach_in_list(ir_function_signature, sig, &f->signatures) { if (!sig->is_defined || sig->is_builtin()) continue; @@ -1437,7 +1658,7 @@ link_intrastage_shaders(void *mem_ctx, */ gl_shader *main = NULL; for (unsigned i = 0; i < num_shaders; i++) { - if (get_main_function_signature(shader_list[i]) != NULL) { + if (link_get_main_function_signature(shader_list[i]) != NULL) { main = shader_list[i]; break; } @@ -1457,6 +1678,7 @@ link_intrastage_shaders(void *mem_ctx, linked->NumUniformBlocks = num_uniform_blocks; ralloc_steal(linked, linked->UniformBlocks); + link_fs_input_layout_qualifiers(prog, linked, shader_list, num_shaders); link_gs_inout_layout_qualifiers(prog, linked, shader_list, num_shaders); link_cs_input_layout_qualifiers(prog, linked, shader_list, num_shaders); @@ -1465,7 +1687,8 @@ link_intrastage_shaders(void *mem_ctx, /* The a pointer to the main function in the final linked shader (i.e., the * copy of the original shader that contained the main function). */ - ir_function_signature *const main_sig = get_main_function_signature(linked); + ir_function_signature *const main_sig = + link_get_main_function_signature(linked); /* Move any instructions other than variable declarations, function * declarations or precision statements into main. @@ -1498,12 +1721,19 @@ link_intrastage_shaders(void *mem_ctx, */ gl_shader **linking_shaders = (gl_shader **) calloc(num_shaders + 1, sizeof(gl_shader *)); - memcpy(linking_shaders, shader_list, num_shaders * sizeof(gl_shader *)); - linking_shaders[num_shaders] = _mesa_glsl_get_builtin_function_shader(); - ok = link_function_calls(prog, linked, linking_shaders, num_shaders + 1); + ok = linking_shaders != NULL; - free(linking_shaders); + if (ok) { + memcpy(linking_shaders, shader_list, num_shaders * sizeof(gl_shader *)); + linking_shaders[num_shaders] = _mesa_glsl_get_builtin_function_shader(); + + ok = link_function_calls(prog, linked, linking_shaders, num_shaders + 1); + + free(linking_shaders); + } else { + _mesa_error_no_memory(__func__); + } } else { ok = link_function_calls(prog, linked, shader_list, num_shaders); } @@ -1523,12 +1753,14 @@ link_intrastage_shaders(void *mem_ctx, if (linked->Stage == MESA_SHADER_GEOMETRY) { unsigned num_vertices = vertices_per_prim(prog->Geom.InputType); geom_array_resize_visitor input_resize_visitor(num_vertices, prog); - foreach_list(n, linked->ir) { - ir_instruction *ir = (ir_instruction *) n; + foreach_in_list(ir_instruction, ir, linked->ir) { ir->accept(&input_resize_visitor); } } + if (ctx->Const.VertexID_is_zero_based) + lower_vertex_id(linked); + /* Make a pass over all variable declarations to ensure that arrays with * unspecified sizes have a size specified. The size is inferred from the * max_array_access field. @@ -1562,8 +1794,8 @@ update_array_sizes(struct gl_shader_program *prog) if (prog->_LinkedShaders[i] == NULL) continue; - foreach_list(node, prog->_LinkedShaders[i]->ir) { - ir_variable *const var = ((ir_instruction *) node)->as_variable(); + foreach_in_list(ir_instruction, node, prog->_LinkedShaders[i]->ir) { + ir_variable *const var = node->as_variable(); if ((var == NULL) || (var->data.mode != ir_var_uniform) || !var->type->is_array()) @@ -1585,8 +1817,8 @@ update_array_sizes(struct gl_shader_program *prog) if (prog->_LinkedShaders[j] == NULL) continue; - foreach_list(node2, prog->_LinkedShaders[j]->ir) { - ir_variable *other_var = ((ir_instruction *) node2)->as_variable(); + foreach_in_list(ir_instruction, node2, prog->_LinkedShaders[j]->ir) { + ir_variable *other_var = node2->as_variable(); if (!other_var) continue; @@ -1606,9 +1838,10 @@ update_array_sizes(struct gl_shader_program *prog) * Determine the number of slots per array element by dividing by * the old (total) size. */ - if (var->num_state_slots > 0) { - var->num_state_slots = (size + 1) - * (var->num_state_slots / var->type->length); + const unsigned num_slots = var->get_num_state_slots(); + if (num_slots > 0) { + var->set_num_state_slots((size + 1) + * (num_slots / var->type->length)); } var->type = glsl_type::get_array_instance(var->type->fields.array, @@ -1728,8 +1961,8 @@ assign_attribute_or_color_locations(gl_shader_program *prog, unsigned num_attr = 0; - foreach_list(node, sh->ir) { - ir_variable *const var = ((ir_instruction *) node)->as_variable(); + foreach_in_list(ir_instruction, node, sh->ir) { + ir_variable *const var = node->as_variable(); if ((var == NULL) || (var->data.mode != (unsigned) direction)) continue; @@ -1784,10 +2017,12 @@ assign_attribute_or_color_locations(gl_shader_program *prog, * active attribute array, both of which require multiple * contiguous generic attributes." * - * Previous versions of the spec contain similar language but omit - * the bit about attribute arrays. + * I think above text prohibits the aliasing of explicit and + * automatic assignments. But, aliasing is allowed in manual + * assignments of attribute locations. See below comments for + * the details. * - * Page 61 of the OpenGL 4.0 spec also says: + * From OpenGL 4.0 spec, page 61: * * "It is possible for an application to bind more than one * attribute name to the same location. This is referred to as @@ -1800,29 +2035,84 @@ assign_attribute_or_color_locations(gl_shader_program *prog, * but implementations are not required to generate an error * in this case." * - * These two paragraphs are either somewhat contradictory, or I - * don't fully understand one or both of them. - */ - /* FINISHME: The code as currently written does not support - * FINISHME: attribute location aliasing (see comment above). + * From GLSL 4.30 spec, page 54: + * + * "A program will fail to link if any two non-vertex shader + * input variables are assigned to the same location. For + * vertex shaders, multiple input variables may be assigned + * to the same location using either layout qualifiers or via + * the OpenGL API. However, such aliasing is intended only to + * support vertex shaders where each execution path accesses + * at most one input per each location. Implementations are + * permitted, but not required, to generate link-time errors + * if they detect that every path through the vertex shader + * executable accesses multiple inputs assigned to any single + * location. For all shader types, a program will fail to link + * if explicit location assignments leave the linker unable + * to find space for other variables without explicit + * assignments." + * + * From OpenGL ES 3.0 spec, page 56: + * + * "Binding more than one attribute name to the same location + * is referred to as aliasing, and is not permitted in OpenGL + * ES Shading Language 3.00 vertex shaders. LinkProgram will + * fail when this condition exists. However, aliasing is + * possible in OpenGL ES Shading Language 1.00 vertex shaders. + * This will only work if only one of the aliased attributes + * is active in the executable program, or if no path through + * the shader consumes more than one attribute of a set of + * attributes aliased to the same location. A link error can + * occur if the linker determines that every path through the + * shader consumes multiple aliased attributes, but implemen- + * tations are not required to generate an error in this case." + * + * After looking at above references from OpenGL, OpenGL ES and + * GLSL specifications, we allow aliasing of vertex input variables + * in: OpenGL 2.0 (and above) and OpenGL ES 2.0. + * + * NOTE: This is not required by the spec but its worth mentioning + * here that we're not doing anything to make sure that no path + * through the vertex shader executable accesses multiple inputs + * assigned to any single location. */ + /* Mask representing the contiguous slots that will be used by * this attribute. */ const unsigned attr = var->data.location - generic_base; const unsigned use_mask = (1 << slots) - 1; + const char *const string = (target_index == MESA_SHADER_VERTEX) + ? "vertex shader input" : "fragment shader output"; + + /* Generate a link error if the requested locations for this + * attribute exceed the maximum allowed attribute location. + */ + if (attr + slots > max_index) { + linker_error(prog, + "insufficient contiguous locations " + "available for %s `%s' %d %d %d", string, + var->name, used_locations, use_mask, attr); + return false; + } /* Generate a link error if the set of bits requested for this * attribute overlaps any previously allocated bits. */ if ((~(use_mask << attr) & used_locations) != used_locations) { - const char *const string = (target_index == MESA_SHADER_VERTEX) - ? "vertex shader input" : "fragment shader output"; - linker_error(prog, - "insufficient contiguous locations " - "available for %s `%s' %d %d %d", string, - var->name, used_locations, use_mask, attr); - return false; + if (target_index == MESA_SHADER_FRAGMENT || + (prog->IsES && prog->Version >= 300)) { + linker_error(prog, + "overlapping location is assigned " + "to %s `%s' %d %d %d\n", string, + var->name, used_locations, use_mask, attr); + return false; + } else { + linker_warning(prog, + "overlapping location is assigned " + "to %s `%s' %d %d %d\n", string, + var->name, used_locations, use_mask, attr); + } } used_locations |= (use_mask << attr); @@ -1890,8 +2180,8 @@ assign_attribute_or_color_locations(gl_shader_program *prog, void demote_shader_inputs_and_outputs(gl_shader *sh, enum ir_variable_mode mode) { - foreach_list(node, sh->ir) { - ir_variable *const var = ((ir_instruction *) node)->as_variable(); + foreach_in_list(ir_instruction, node, sh->ir) { + ir_variable *const var = node->as_variable(); if ((var == NULL) || (var->data.mode != int(mode))) continue; @@ -1901,6 +2191,7 @@ demote_shader_inputs_and_outputs(gl_shader *sh, enum ir_variable_mode mode) * to have a location assigned. */ if (var->data.is_unmatched_generic_inout) { + assert(var->data.mode != ir_var_temporary); var->data.mode = ir_var_auto; } } @@ -1926,8 +2217,8 @@ store_fragdepth_layout(struct gl_shader_program *prog) * We're only interested in the cases where the variable is NOT removed * from the IR. */ - foreach_list(node, ir) { - ir_variable *const var = ((ir_instruction *) node)->as_variable(); + foreach_in_list(ir_instruction, node, ir) { + ir_variable *const var = node->as_variable(); if (var == NULL || var->data.mode != ir_var_shader_out) { continue; @@ -2058,8 +2349,8 @@ check_image_resources(struct gl_context *ctx, struct gl_shader_program *prog) total_image_units += sh->NumImages; if (i == MESA_SHADER_FRAGMENT) { - foreach_list(node, sh->ir) { - ir_variable *var = ((ir_instruction *)node)->as_variable(); + foreach_in_list(ir_instruction, node, sh->ir) { + ir_variable *var = node->as_variable(); if (var && var->data.mode == ir_var_shader_out) fragment_outputs += var->type->count_attribute_slots(); } @@ -2075,6 +2366,117 @@ check_image_resources(struct gl_context *ctx, struct gl_shader_program *prog) linker_error(prog, "Too many combined image uniforms and fragment outputs"); } + +/** + * Initializes explicit location slots to INACTIVE_UNIFORM_EXPLICIT_LOCATION + * for a variable, checks for overlaps between other uniforms using explicit + * locations. + */ +static bool +reserve_explicit_locations(struct gl_shader_program *prog, + string_to_uint_map *map, ir_variable *var) +{ + unsigned slots = var->type->uniform_locations(); + unsigned max_loc = var->data.location + slots - 1; + + /* Resize remap table if locations do not fit in the current one. */ + if (max_loc + 1 > prog->NumUniformRemapTable) { + prog->UniformRemapTable = + reralloc(prog, prog->UniformRemapTable, + gl_uniform_storage *, + max_loc + 1); + + if (!prog->UniformRemapTable) { + linker_error(prog, "Out of memory during linking."); + return false; + } + + /* Initialize allocated space. */ + for (unsigned i = prog->NumUniformRemapTable; i < max_loc + 1; i++) + prog->UniformRemapTable[i] = NULL; + + prog->NumUniformRemapTable = max_loc + 1; + } + + for (unsigned i = 0; i < slots; i++) { + unsigned loc = var->data.location + i; + + /* Check if location is already used. */ + if (prog->UniformRemapTable[loc] == INACTIVE_UNIFORM_EXPLICIT_LOCATION) { + + /* Possibly same uniform from a different stage, this is ok. */ + unsigned hash_loc; + if (map->get(hash_loc, var->name) && hash_loc == loc - i) + continue; + + /* ARB_explicit_uniform_location specification states: + * + * "No two default-block uniform variables in the program can have + * the same location, even if they are unused, otherwise a compiler + * or linker error will be generated." + */ + linker_error(prog, + "location qualifier for uniform %s overlaps" + "previously used location", + var->name); + return false; + } + + /* Initialize location as inactive before optimization + * rounds and location assignment. + */ + prog->UniformRemapTable[loc] = INACTIVE_UNIFORM_EXPLICIT_LOCATION; + } + + /* Note, base location used for arrays. */ + map->put(var->data.location, var->name); + + return true; +} + +/** + * Check and reserve all explicit uniform locations, called before + * any optimizations happen to handle also inactive uniforms and + * inactive array elements that may get trimmed away. + */ +static void +check_explicit_uniform_locations(struct gl_context *ctx, + struct gl_shader_program *prog) +{ + if (!ctx->Extensions.ARB_explicit_uniform_location) + return; + + /* This map is used to detect if overlapping explicit locations + * occur with the same uniform (from different stage) or a different one. + */ + string_to_uint_map *uniform_map = new string_to_uint_map; + + if (!uniform_map) { + linker_error(prog, "Out of memory during linking."); + return; + } + + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { + struct gl_shader *sh = prog->_LinkedShaders[i]; + + if (!sh) + continue; + + foreach_in_list(ir_instruction, node, sh->ir) { + ir_variable *var = node->as_variable(); + if ((var && var->data.mode == ir_var_uniform) && + var->data.explicit_location) { + if (!reserve_explicit_locations(prog, uniform_map, var)) { + delete uniform_map; + return; + } + } + } + } + + delete uniform_map; +} + void link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) { @@ -2101,6 +2503,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) ralloc_free(prog->AtomicBuffers); prog->AtomicBuffers = NULL; prog->NumAtomicBuffers = 0; + prog->ARB_fragment_coord_conventions_enable = false; /* Separate the shaders into groups based on their type. */ @@ -2127,6 +2530,9 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) goto done; } + prog->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]; num_shaders[shader_type]++; @@ -2147,7 +2553,8 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) /* Geometry shaders have to be linked with vertex shaders. */ if (num_shaders[MESA_SHADER_GEOMETRY] > 0 && - num_shaders[MESA_SHADER_VERTEX] == 0) { + num_shaders[MESA_SHADER_VERTEX] == 0 && + !prog->SeparateShader) { linker_error(prog, "Geometry shader must be linked with " "vertex shader\n"); goto done; @@ -2218,6 +2625,10 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) break; } + check_explicit_uniform_locations(ctx, prog); + if (!prog->LinkStatus) + goto done; + /* Validate the inputs of each stage with the output of the preceding * stage. */ @@ -2278,28 +2689,24 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) if (!prog->LinkStatus) goto done; - if (ctx->ShaderCompilerOptions[i].LowerClipDistance) { + if (ctx->Const.ShaderCompilerOptions[i].LowerClipDistance) { lower_clip_distance(prog->_LinkedShaders[i]); } - unsigned max_unroll = ctx->ShaderCompilerOptions[i].MaxUnrollIterations; - - while (do_common_optimization(prog->_LinkedShaders[i]->ir, true, false, max_unroll, &ctx->ShaderCompilerOptions[i])) + while (do_common_optimization(prog->_LinkedShaders[i]->ir, true, false, + &ctx->Const.ShaderCompilerOptions[i], + ctx->Const.NativeIntegers)) ; } + /* Check and validate stream emissions in geometry shaders */ + validate_geometry_shader_emissions(ctx, prog); + /* Mark all generic shader inputs and outputs as unpaired. */ - if (prog->_LinkedShaders[MESA_SHADER_VERTEX] != NULL) { - link_invalidate_variable_locations( - prog->_LinkedShaders[MESA_SHADER_VERTEX]->ir); - } - if (prog->_LinkedShaders[MESA_SHADER_GEOMETRY] != NULL) { - link_invalidate_variable_locations( - prog->_LinkedShaders[MESA_SHADER_GEOMETRY]->ir); - } - if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] != NULL) { - link_invalidate_variable_locations( - prog->_LinkedShaders[MESA_SHADER_FRAGMENT]->ir); + for (unsigned i = MESA_SHADER_VERTEX; i <= MESA_SHADER_FRAGMENT; i++) { + if (prog->_LinkedShaders[i] != NULL) { + link_invalidate_variable_locations(prog->_LinkedShaders[i]->ir); + } } /* FINISHME: The value of the max_attribute_index parameter is @@ -2356,7 +2763,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) if (last >= 0 && last < MESA_SHADER_FRAGMENT) { gl_shader *const sh = prog->_LinkedShaders[last]; - if (num_tfeedback_decls != 0) { + if (num_tfeedback_decls != 0 || prog->SeparateShader) { /* There was no fragment shader, but we still have to assign varying * locations for use by transform feedback. */ @@ -2370,7 +2777,8 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) do_dead_builtin_varyings(ctx, sh, NULL, num_tfeedback_decls, tfeedback_decls); - demote_shader_inputs_and_outputs(sh, ir_var_shader_out); + if (!prog->SeparateShader) + demote_shader_inputs_and_outputs(sh, ir_var_shader_out); /* Eliminate code that is now dead due to unused outputs being demoted. */ @@ -2385,7 +2793,16 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) do_dead_builtin_varyings(ctx, NULL, sh, num_tfeedback_decls, tfeedback_decls); - demote_shader_inputs_and_outputs(sh, ir_var_shader_in); + if (prog->SeparateShader) { + if (!assign_varying_locations(ctx, mem_ctx, prog, + NULL /* producer */, + sh /* consumer */, + 0 /* num_tfeedback_decls */, + NULL /* tfeedback_decls */, + 0 /* gs_input_vertices */)) + goto done; + } else + demote_shader_inputs_and_outputs(sh, ir_var_shader_in); while (do_dead_code(sh->ir, false)) ; @@ -2433,7 +2850,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) goto done; update_array_sizes(prog); - link_assign_uniform_locations(prog); + link_assign_uniform_locations(prog, ctx->Const.UniformBooleanTrue); link_assign_atomic_counter_resources(ctx, prog); store_fragdepth_layout(prog); @@ -2445,11 +2862,12 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) goto done; /* OpenGL ES requires that a vertex shader and a fragment shader both be - * present in a linked program. By checking prog->IsES, we also - * catch the GL_ARB_ES2_compatibility case. + * present in a linked program. GL_ARB_ES2_compatibility doesn't say + * anything about shader linking when one of the shaders (vertex or + * fragment shader) is absent. So, the extension shouldn't change the + * behavior specified in GLSL specification. */ - if (!prog->InternalSeparateShader && - (ctx->API == API_OPENGLES2 || prog->IsES)) { + if (!prog->SeparateShader && ctx->API == API_OPENGLES2) { if (prog->_LinkedShaders[MESA_SHADER_VERTEX] == NULL) { linker_error(prog, "program lacks a vertex shader\n"); } else if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] == NULL) { diff --git a/3rdparty/glsl-optimizer/src/glsl/linker.h b/3rdparty/glsl-optimizer/src/glsl/linker.h index e9d9c4508..4f8c19316 100644 --- a/3rdparty/glsl-optimizer/src/glsl/linker.h +++ b/3rdparty/glsl-optimizer/src/glsl/linker.h @@ -26,6 +26,9 @@ #ifndef GLSL_LINKER_H #define GLSL_LINKER_H +ir_function_signature * +link_get_main_function_signature(gl_shader *sh); + extern bool link_function_calls(gl_shader_program *prog, gl_shader *main, gl_shader **shader_list, unsigned num_shaders); @@ -34,10 +37,12 @@ extern void link_invalidate_variable_locations(exec_list *ir); extern void -link_assign_uniform_locations(struct gl_shader_program *prog); +link_assign_uniform_locations(struct gl_shader_program *prog, + unsigned int boolean_true); extern void -link_set_uniform_initializers(struct gl_shader_program *prog); +link_set_uniform_initializers(struct gl_shader_program *prog, + unsigned int boolean_true); extern int link_cross_validate_uniform_block(void *mem_ctx, @@ -45,9 +50,6 @@ link_cross_validate_uniform_block(void *mem_ctx, unsigned int *num_linked_blocks, struct gl_uniform_block *new_block); -void -link_assign_uniform_block_offsets(struct gl_shader *shader); - extern bool link_uniform_blocks_are_compatible(const gl_uniform_block *a, const gl_uniform_block *b); @@ -138,11 +140,15 @@ protected: * \param name Fully qualified name of the field. * \param row_major For a matrix type, is it stored row-major. * \param record_type Type of the record containing the field. + * \param last_field Set if \c name is the last field of the structure + * containing it. This will always be false for items + * not contained in a structure or interface block. * * The default implementation just calls the other \c visit_field method. */ virtual void visit_field(const glsl_type *type, const char *name, - bool row_major, const glsl_type *record_type); + bool row_major, const glsl_type *record_type, + bool last_field); /** * Method invoked for each leaf of the variable @@ -168,9 +174,13 @@ private: /** * \param name_length Length of the current name \b not including the * terminating \c NUL character. + * \param last_field Set if \c name is the last field of the structure + * containing it. This will always be false for items + * not contained in a structure or interface block. */ void recursion(const glsl_type *t, char **name, size_t name_length, - bool row_major, const glsl_type *record_type); + bool row_major, const glsl_type *record_type, + bool last_field); }; extern struct gl_shader * diff --git a/3rdparty/glsl-optimizer/src/glsl/list.h b/3rdparty/glsl-optimizer/src/glsl/list.h index 694b686b0..b6c32bccc 100644 --- a/3rdparty/glsl-optimizer/src/glsl/list.h +++ b/3rdparty/glsl-optimizer/src/glsl/list.h @@ -69,7 +69,7 @@ #endif #include -#include "ralloc.h" +#include "util/ralloc.h" struct exec_node { struct exec_node *next; @@ -83,67 +83,29 @@ struct exec_node { /* empty */ } - const exec_node *get_next() const - { - return next; - } + const exec_node *get_next() const; + exec_node *get_next(); - exec_node *get_next() - { - return next; - } + const exec_node *get_prev() const; + exec_node *get_prev(); - const exec_node *get_prev() const - { - return prev; - } - - exec_node *get_prev() - { - return prev; - } - - void remove() - { - next->prev = prev; - prev->next = next; - next = NULL; - prev = NULL; - } + void remove(); /** * Link a node with itself * * This creates a sort of degenerate list that is occasionally useful. */ - void self_link() - { - next = this; - prev = this; - } + void self_link(); /** * Insert a node in the list after the current node */ - void insert_after(exec_node *after) - { - after->next = this->next; - after->prev = this; - - this->next->prev = after; - this->next = after; - } + void insert_after(exec_node *after); /** * Insert a node in the list before the current node */ - void insert_before(exec_node *before) - { - before->next = this; - before->prev = this->prev; - - this->prev->next = before; - this->prev = before; - } + void insert_before(exec_node *before); /** * Insert another list in the list before the current node @@ -153,33 +115,165 @@ struct exec_node { /** * Replace the current node with the given node. */ - void replace_with(exec_node *replacement) - { - replacement->prev = this->prev; - replacement->next = this->next; - - this->prev->next = replacement; - this->next->prev = replacement; - } + void replace_with(exec_node *replacement); /** * Is this the sentinel at the tail of the list? */ - bool is_tail_sentinel() const - { - return this->next == NULL; - } + bool is_tail_sentinel() const; /** * Is this the sentinel at the head of the list? */ - bool is_head_sentinel() const - { - return this->prev == NULL; - } + bool is_head_sentinel() const; #endif }; +static inline void +exec_node_init(struct exec_node *n) +{ + n->next = NULL; + n->prev = NULL; +} + +static inline const struct exec_node * +exec_node_get_next_const(const struct exec_node *n) +{ + return n->next; +} + +static inline struct exec_node * +exec_node_get_next(struct exec_node *n) +{ + return n->next; +} + +static inline const struct exec_node * +exec_node_get_prev_const(const struct exec_node *n) +{ + return n->prev; +} + +static inline struct exec_node * +exec_node_get_prev(struct exec_node *n) +{ + return n->prev; +} + +static inline void +exec_node_remove(struct exec_node *n) +{ + n->next->prev = n->prev; + n->prev->next = n->next; + n->next = NULL; + n->prev = NULL; +} + +static inline void +exec_node_self_link(struct exec_node *n) +{ + n->next = n; + n->prev = n; +} + +static inline void +exec_node_insert_after(struct exec_node *n, struct exec_node *after) +{ + after->next = n->next; + after->prev = n; + + n->next->prev = after; + n->next = after; +} + +static inline void +exec_node_insert_node_before(struct exec_node *n, struct exec_node *before) +{ + before->next = n; + before->prev = n->prev; + + n->prev->next = before; + n->prev = before; +} + +static inline void +exec_node_replace_with(struct exec_node *n, struct exec_node *replacement) +{ + replacement->prev = n->prev; + replacement->next = n->next; + + n->prev->next = replacement; + n->next->prev = replacement; +} + +static inline bool +exec_node_is_tail_sentinel(const struct exec_node *n) +{ + return n->next == NULL; +} + +static inline bool +exec_node_is_head_sentinel(const struct exec_node *n) +{ + return n->prev == NULL; +} + +#ifdef __cplusplus +inline const exec_node *exec_node::get_next() const +{ + return exec_node_get_next_const(this); +} + +inline exec_node *exec_node::get_next() +{ + return exec_node_get_next(this); +} + +inline const exec_node *exec_node::get_prev() const +{ + return exec_node_get_prev_const(this); +} + +inline exec_node *exec_node::get_prev() +{ + return exec_node_get_prev(this); +} + +inline void exec_node::remove() +{ + exec_node_remove(this); +} + +inline void exec_node::self_link() +{ + exec_node_self_link(this); +} + +inline void exec_node::insert_after(exec_node *after) +{ + exec_node_insert_after(this, after); +} + +inline void exec_node::insert_before(exec_node *before) +{ + exec_node_insert_node_before(this, before); +} + +inline void exec_node::replace_with(exec_node *replacement) +{ + exec_node_replace_with(this, replacement); +} + +inline bool exec_node::is_tail_sentinel() const +{ + return exec_node_is_tail_sentinel(this); +} + +inline bool exec_node::is_head_sentinel() const +{ + return exec_node_is_head_sentinel(this); +} +#endif #ifdef __cplusplus /* This macro will not work correctly if `t' uses virtual inheritance. If you @@ -221,75 +315,21 @@ struct exec_list { make_empty(); } - void make_empty() - { - head = (exec_node *) & tail; - tail = NULL; - tail_pred = (exec_node *) & head; - } + void make_empty(); - bool is_empty() const - { - /* There are three ways to test whether a list is empty or not. - * - * - Check to see if the \c head points to the \c tail. - * - Check to see if the \c tail_pred points to the \c head. - * - Check to see if the \c head is the sentinel node by test whether its - * \c next pointer is \c NULL. - * - * The first two methods tend to generate better code on modern systems - * because they save a pointer dereference. - */ - return head == (exec_node *) &tail; - } + bool is_empty() const; - const exec_node *get_head() const - { - return !is_empty() ? head : NULL; - } + const exec_node *get_head() const; + exec_node *get_head(); - exec_node *get_head() - { - return !is_empty() ? head : NULL; - } + const exec_node *get_tail() const; + exec_node *get_tail(); - const exec_node *get_tail() const - { - return !is_empty() ? tail_pred : NULL; - } + unsigned length() const; - exec_node *get_tail() - { - return !is_empty() ? tail_pred : NULL; - } - - void push_head(exec_node *n) - { - n->next = head; - n->prev = (exec_node *) &head; - - n->next->prev = n; - head = n; - } - - void push_tail(exec_node *n) - { - n->next = (exec_node *) &tail; - n->prev = tail_pred; - - n->prev->next = n; - tail_pred = n; - } - - void push_degenerate_list_at_head(exec_node *n) - { - assert(n->prev->next == n); - - n->prev->next = head; - head->prev = n->prev; - n->prev = (exec_node *) &head; - head = n; - } + void push_head(exec_node *n); + void push_tail(exec_node *n); + void push_degenerate_list_at_head(exec_node *n); /** * Remove the first node from a list and return it @@ -299,121 +339,318 @@ struct exec_list { * * \sa exec_list::get_head */ - exec_node *pop_head() - { - exec_node *const n = this->get_head(); - if (n != NULL) - n->remove(); - - return n; - } + exec_node *pop_head(); /** * Move all of the nodes from this list to the target list */ - void move_nodes_to(exec_list *target) - { - if (is_empty()) { - target->make_empty(); - } else { - target->head = head; - target->tail = NULL; - target->tail_pred = tail_pred; - - target->head->prev = (exec_node *) &target->head; - target->tail_pred->next = (exec_node *) &target->tail; - - make_empty(); - } - } + void move_nodes_to(exec_list *target); /** - * Append all nodes from the source list to the target list + * Append all nodes from the source list to the end of the target list */ - void - append_list(exec_list *source) - { - if (source->is_empty()) - return; + void append_list(exec_list *source); - /* Link the first node of the source with the last node of the target list. - */ - this->tail_pred->next = source->head; - source->head->prev = this->tail_pred; - - /* Make the tail of the source list be the tail of the target list. - */ - this->tail_pred = source->tail_pred; - this->tail_pred->next = (exec_node *) &this->tail; - - /* Make the source list empty for good measure. - */ - source->make_empty(); - } + /** + * Prepend all nodes from the source list to the beginning of the target + * list + */ + void prepend_list(exec_list *source); #endif }; - -#ifdef __cplusplus -inline void exec_node::insert_before(exec_list *before) +static inline void +exec_list_make_empty(struct exec_list *list) { - if (before->is_empty()) + list->head = (struct exec_node *) & list->tail; + list->tail = NULL; + list->tail_pred = (struct exec_node *) & list->head; +} + +static inline bool +exec_list_is_empty(const struct exec_list *list) +{ + /* There are three ways to test whether a list is empty or not. + * + * - Check to see if the \c head points to the \c tail. + * - Check to see if the \c tail_pred points to the \c head. + * - Check to see if the \c head is the sentinel node by test whether its + * \c next pointer is \c NULL. + * + * The first two methods tend to generate better code on modern systems + * because they save a pointer dereference. + */ + return list->head == (struct exec_node *) &list->tail; +} + +static inline const struct exec_node * +exec_list_get_head_const(const struct exec_list *list) +{ + return !exec_list_is_empty(list) ? list->head : NULL; +} + +static inline struct exec_node * +exec_list_get_head(struct exec_list *list) +{ + return !exec_list_is_empty(list) ? list->head : NULL; +} + +static inline const struct exec_node * +exec_list_get_tail_const(const struct exec_list *list) +{ + return !exec_list_is_empty(list) ? list->tail_pred : NULL; +} + +static inline struct exec_node * +exec_list_get_tail(struct exec_list *list) +{ + return !exec_list_is_empty(list) ? list->tail_pred : NULL; +} + +static inline unsigned +exec_list_length(const struct exec_list *list) +{ + unsigned size = 0; + struct exec_node *node; + + for (node = list->head; node->next != NULL; node = node->next) { + size++; + } + + return size; +} + +static inline void +exec_list_push_head(struct exec_list *list, struct exec_node *n) +{ + n->next = list->head; + n->prev = (struct exec_node *) &list->head; + + n->next->prev = n; + list->head = n; +} + +static inline void +exec_list_push_tail(struct exec_list *list, struct exec_node *n) +{ + n->next = (struct exec_node *) &list->tail; + n->prev = list->tail_pred; + + n->prev->next = n; + list->tail_pred = n; +} + +static inline void +exec_list_push_degenerate_list_at_head(struct exec_list *list, struct exec_node *n) +{ + assert(n->prev->next == n); + + n->prev->next = list->head; + list->head->prev = n->prev; + n->prev = (struct exec_node *) &list->head; + list->head = n; +} + +static inline struct exec_node * +exec_list_pop_head(struct exec_list *list) +{ + struct exec_node *const n = exec_list_get_head(list); + if (n != NULL) + exec_node_remove(n); + + return n; +} + +static inline void +exec_list_move_nodes_to(struct exec_list *list, struct exec_list *target) +{ + if (exec_list_is_empty(list)) { + exec_list_make_empty(target); + } else { + target->head = list->head; + target->tail = NULL; + target->tail_pred = list->tail_pred; + + target->head->prev = (struct exec_node *) &target->head; + target->tail_pred->next = (struct exec_node *) &target->tail; + + exec_list_make_empty(list); + } +} + +static inline void +exec_list_append(struct exec_list *list, struct exec_list *source) +{ + if (exec_list_is_empty(source)) return; - before->tail_pred->next = this; - before->head->prev = this->prev; + /* Link the first node of the source with the last node of the target list. + */ + list->tail_pred->next = source->head; + source->head->prev = list->tail_pred; - this->prev->next = before->head; - this->prev = before->tail_pred; + /* Make the tail of the source list be the tail of the target list. + */ + list->tail_pred = source->tail_pred; + list->tail_pred->next = (struct exec_node *) &list->tail; - before->make_empty(); + /* Make the source list empty for good measure. + */ + exec_list_make_empty(source); +} + +static inline void +exec_list_prepend(struct exec_list *list, struct exec_list *source) +{ + exec_list_append(source, list); + exec_list_move_nodes_to(source, list); +} + +static inline void +exec_node_insert_list_before(struct exec_node *n, struct exec_list *before) +{ + if (exec_list_is_empty(before)) + return; + + before->tail_pred->next = n; + before->head->prev = n->prev; + + n->prev->next = before->head; + n->prev = before->tail_pred; + + exec_list_make_empty(before); +} + +#ifdef __cplusplus +inline void exec_list::make_empty() +{ + exec_list_make_empty(this); +} + +inline bool exec_list::is_empty() const +{ + return exec_list_is_empty(this); +} + +inline const exec_node *exec_list::get_head() const +{ + return exec_list_get_head_const(this); +} + +inline exec_node *exec_list::get_head() +{ + return exec_list_get_head(this); +} + +inline const exec_node *exec_list::get_tail() const +{ + return exec_list_get_tail_const(this); +} + +inline exec_node *exec_list::get_tail() +{ + return exec_list_get_tail(this); +} + +inline unsigned exec_list::length() const +{ + return exec_list_length(this); +} + +inline void exec_list::push_head(exec_node *n) +{ + exec_list_push_head(this, n); +} + +inline void exec_list::push_tail(exec_node *n) +{ + exec_list_push_tail(this, n); +} + +inline void exec_list::push_degenerate_list_at_head(exec_node *n) +{ + exec_list_push_degenerate_list_at_head(this, n); +} + +inline exec_node *exec_list::pop_head() +{ + return exec_list_pop_head(this); +} + +inline void exec_list::move_nodes_to(exec_list *target) +{ + exec_list_move_nodes_to(this, target); +} + +inline void exec_list::append_list(exec_list *source) +{ + exec_list_append(this, source); +} + +inline void exec_list::prepend_list(exec_list *source) +{ + exec_list_prepend(this, source); +} + +inline void exec_node::insert_before(exec_list *before) +{ + exec_node_insert_list_before(this, before); } #endif +#define foreach_in_list(__type, __inst, __list) \ + for (__type *(__inst) = (__type *)(__list)->head; \ + !(__inst)->is_tail_sentinel(); \ + (__inst) = (__type *)(__inst)->next) + +#define foreach_in_list_reverse(__type, __inst, __list) \ + for (__type *(__inst) = (__type *)(__list)->tail_pred; \ + !(__inst)->is_head_sentinel(); \ + (__inst) = (__type *)(__inst)->prev) + /** * This version is safe even if the current node is removed. */ -#define foreach_list_safe(__node, __list) \ - for (exec_node * __node = (__list)->head, * __next = __node->next \ - ; __next != NULL \ - ; __node = __next, __next = __next->next) - -#define foreach_list(__node, __list) \ - for (exec_node * __node = (__list)->head \ - ; (__node)->next != NULL \ - ; (__node) = (__node)->next) +#define foreach_in_list_safe(__type, __node, __list) \ + for (__type *__node = (__type *)(__list)->head, \ + *__next = (__type *)__node->next; \ + __next != NULL; \ + __node = __next, __next = (__type *)__next->next) +#define foreach_in_list_use_after(__type, __inst, __list) \ + __type *(__inst); \ + for ((__inst) = (__type *)(__list)->head; \ + !(__inst)->is_tail_sentinel(); \ + (__inst) = (__type *)(__inst)->next) /** * Iterate through two lists at once. Stops at the end of the shorter list. * * This is safe against either current node being removed or replaced. */ #define foreach_two_lists(__node1, __list1, __node2, __list2) \ - for (exec_node * __node1 = (__list1)->head, \ - * __node2 = (__list2)->head, \ - * __next1 = __node1->next, \ - * __next2 = __node2->next \ + for (struct exec_node * __node1 = (__list1)->head, \ + * __node2 = (__list2)->head, \ + * __next1 = __node1->next, \ + * __next2 = __node2->next \ ; __next1 != NULL && __next2 != NULL \ ; __node1 = __next1, \ __node2 = __next2, \ __next1 = __next1->next, \ __next2 = __next2->next) -#define foreach_list_const(__node, __list) \ - for (const exec_node * __node = (__list)->head \ - ; (__node)->next != NULL \ - ; (__node) = (__node)->next) - #define foreach_list_typed(__type, __node, __field, __list) \ for (__type * __node = \ exec_node_data(__type, (__list)->head, __field); \ (__node)->__field.next != NULL; \ (__node) = exec_node_data(__type, (__node)->__field.next, __field)) -#define foreach_list_typed_const(__type, __node, __field, __list) \ - for (const __type * __node = \ - exec_node_data(__type, (__list)->head, __field); \ - (__node)->__field.next != NULL; \ - (__node) = exec_node_data(__type, (__node)->__field.next, __field)) +#define foreach_list_typed_safe(__type, __node, __field, __list) \ + for (__type * __node = \ + exec_node_data(__type, (__list)->head, __field), \ + * __next = \ + exec_node_data(__type, (__node)->__field.next, __field); \ + __next != NULL; \ + __node = __next, __next = \ + exec_node_data(__type, (__next)->__field.next, __field)) #endif /* LIST_CONTAINER_H */ diff --git a/3rdparty/glsl-optimizer/src/glsl/loop_analysis.cpp b/3rdparty/glsl-optimizer/src/glsl/loop_analysis.cpp index 7ab3eeca5..734a527b8 100644 --- a/3rdparty/glsl-optimizer/src/glsl/loop_analysis.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/loop_analysis.cpp @@ -264,13 +264,12 @@ loop_analysis::visit(ir_loop_jump *ir) ir_visitor_status -loop_analysis::visit_enter(ir_call *ir) +loop_analysis::visit_enter(ir_call *) { /* Mark every loop that we're currently analyzing as containing an ir_call * (even those at outer nesting levels). */ - foreach_list(node, &this->state) { - loop_variable_state *const ls = (loop_variable_state *) node; + foreach_in_list(loop_variable_state, ls, &this->state) { ls->contains_calls = true; } @@ -288,9 +287,7 @@ loop_analysis::visit(ir_dereference_variable *ir) bool nested = false; - foreach_list(node, &this->state) { - loop_variable_state *const ls = (loop_variable_state *) node; - + foreach_in_list(loop_variable_state, ls, &this->state) { ir_variable *var = ir->variable_referenced(); loop_variable *lv = ls->get_or_insert(var, this->in_assignee); @@ -330,10 +327,10 @@ loop_analysis::visit_leave(ir_loop *ir) if (ls->contains_calls) return visit_continue; - foreach_list(node, &ir->body_instructions) { + foreach_in_list(ir_instruction, node, &ir->body_instructions) { /* Skip over declarations at the start of a loop. */ - if (((ir_instruction *) node)->as_variable()) + if (node->as_variable()) continue; ir_if *if_stmt = ((ir_instruction *) node)->as_if(); @@ -345,9 +342,11 @@ loop_analysis::visit_leave(ir_loop *ir) } - foreach_list_safe(node, &ls->variables) { - loop_variable *lv = (loop_variable *) node; - + 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); + } /* Move variables that are already marked as being loop constant to * a separate list. These trivially don't need to be tested. */ @@ -375,9 +374,7 @@ loop_analysis::visit_leave(ir_loop *ir) do { progress = false; - foreach_list_safe(node, &ls->variables) { - loop_variable *lv = (loop_variable *) node; - + foreach_in_list_safe(loop_variable, lv, &ls->variables) { if (lv->conditional_or_nested_assignment || (lv->num_assignments > 1)) continue; @@ -401,9 +398,7 @@ loop_analysis::visit_leave(ir_loop *ir) /* The remaining variables that are not loop invariant might be loop * induction variables. */ - foreach_list_safe(node, &ls->variables) { - loop_variable *lv = (loop_variable *) node; - + foreach_in_list_safe(loop_variable, lv, &ls->variables) { /* If there is more than one assignment to a variable, it cannot be a * loop induction variable. This isn't strictly true, but this is a * very simple induction variable detector, and it can't handle more @@ -445,8 +440,7 @@ loop_analysis::visit_leave(ir_loop *ir) * Also figure out which terminator (if any) produces the smallest * iteration count--this is the limiting terminator. */ - foreach_list(node, &ls->terminators) { - loop_terminator *t = (loop_terminator *) node; + foreach_in_list(loop_terminator, t, &ls->terminators) { ir_if *if_stmt = t->ir; /* If-statements can be either 'if (expr)' or 'if (deref)'. We only care @@ -487,12 +481,9 @@ loop_analysis::visit_leave(ir_loop *ir) ir_variable *var = counter->variable_referenced(); - ir_rvalue *init = find_initial_value(ir, var); - loop_variable *lv = ls->get(var); if (lv != NULL && lv->is_induction_var()) { - lv->initial_value = init; - t->iterations = calculate_iterations(init, limit, lv->increment, + t->iterations = calculate_iterations(lv->initial_value, limit, lv->increment, cmp); if (t->iterations >= 0 && @@ -633,8 +624,10 @@ get_basic_induction_increment(ir_assignment *ir, hash_table *var_hash) loop_variable *lv = (loop_variable *) hash_table_find(var_hash, inc_var); - if (!lv->is_loop_constant()) - inc = NULL; + if (lv == NULL || !lv->is_loop_constant()) { + assert(lv != NULL); + inc = NULL; + } } else inc = NULL; } diff --git a/3rdparty/glsl-optimizer/src/glsl/loop_analysis.h b/3rdparty/glsl-optimizer/src/glsl/loop_analysis.h index ebd4b220b..e68d579a6 100644 --- a/3rdparty/glsl-optimizer/src/glsl/loop_analysis.h +++ b/3rdparty/glsl-optimizer/src/glsl/loop_analysis.h @@ -27,6 +27,7 @@ #define LOOP_ANALYSIS_H #include "ir.h" +#include "glsl_types.h" #include "program/hash_table.h" /** @@ -53,7 +54,8 @@ set_loop_controls(exec_list *instructions, loop_state *ls); extern bool -unroll_loops(exec_list *instructions, loop_state *ls, unsigned max_iterations); +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); @@ -140,22 +142,7 @@ public: hash_table_dtor(this->var_hash); } - static void* operator new(size_t size, void *ctx) - { - void *lvs = ralloc_size(ctx, size); - assert(lvs != NULL); - - ralloc_set_destructor(lvs, (void (*)(void*)) destructor); - - return lvs; - } - -private: - static void - destructor(loop_variable_state *lvs) - { - lvs->~loop_variable_state(); - } + DECLARE_RALLOC_CXX_OPERATORS(loop_variable_state) }; @@ -208,10 +195,10 @@ public: inline bool is_loop_constant() const { const bool is_const = (this->num_assignments == 0) - || ((this->num_assignments == 1) + || (((this->num_assignments == 1) && !this->conditional_or_nested_assignment && !this->read_before_write - && this->rhs_clean); + && this->rhs_clean) || this->var->data.read_only); /* If the RHS of *the* assignment is clean, then there must be exactly * one assignment of the variable. @@ -219,11 +206,6 @@ public: assert((this->rhs_clean && (this->num_assignments == 1)) || !this->rhs_clean); - /* Variables that are marked read-only *MUST* be loop constant. - */ - assert(!this->var->data.read_only - || (this->var->data.read_only && is_const)); - return is_const; } diff --git a/3rdparty/glsl-optimizer/src/glsl/loop_controls.cpp b/3rdparty/glsl-optimizer/src/glsl/loop_controls.cpp index 87844ea83..5029e103f 100644 --- a/3rdparty/glsl-optimizer/src/glsl/loop_controls.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/loop_controls.cpp @@ -130,9 +130,20 @@ calculate_iterations(ir_rvalue *from, ir_rvalue *to, ir_rvalue *increment, bool valid_loop = false; for (unsigned i = 0; i < Elements(bias); i++) { - iter = (increment->type->is_integer()) - ? new(mem_ctx) ir_constant(iter_value + bias[i]) - : new(mem_ctx) ir_constant(float(iter_value + bias[i])); + /* Increment may be of type int, uint or float. */ + switch (increment->type->base_type) { + case GLSL_TYPE_INT: + iter = new(mem_ctx) ir_constant(iter_value + bias[i]); + break; + case GLSL_TYPE_UINT: + iter = new(mem_ctx) ir_constant(unsigned(iter_value + bias[i])); + break; + case GLSL_TYPE_FLOAT: + iter = new(mem_ctx) ir_constant(float(iter_value + bias[i])); + break; + default: + unreachable(!"Unsupported type for loop iterator."); + } ir_expression *const mul = new(mem_ctx) ir_expression(ir_binop_mul, increment->type, iter, @@ -209,9 +220,7 @@ loop_control_visitor::visit_leave(ir_loop *ir) * bound, then that terminates the loop, so we don't even need the limiting * terminator. */ - foreach_list(node, &ls->terminators) { - loop_terminator *t = (loop_terminator *) node; - + foreach_in_list(loop_terminator, t, &ls->terminators) { if (t->iterations < 0) continue; diff --git a/3rdparty/glsl-optimizer/src/glsl/loop_unroll.cpp b/3rdparty/glsl-optimizer/src/glsl/loop_unroll.cpp index 196066248..526c4d7a9 100644 --- a/3rdparty/glsl-optimizer/src/glsl/loop_unroll.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/loop_unroll.cpp @@ -25,15 +25,18 @@ #include "loop_analysis.h" #include "ir_hierarchical_visitor.h" +#include "main/mtypes.h" + namespace { class loop_unroll_visitor : public ir_hierarchical_visitor { public: - loop_unroll_visitor(loop_state *state, unsigned max_iterations) + loop_unroll_visitor(loop_state *state, + const struct gl_shader_compiler_options *options) { this->state = state; this->progress = false; - this->max_iterations = max_iterations; + this->options = options; } virtual ir_visitor_status visit_leave(ir_loop *ir); @@ -45,7 +48,7 @@ public: loop_state *state; bool progress; - unsigned max_iterations; + const struct gl_shader_compiler_options *options; }; } /* anonymous namespace */ @@ -60,33 +63,86 @@ is_break(ir_instruction *ir) class loop_unroll_count : public ir_hierarchical_visitor { public: int nodes; - bool fail; + bool unsupported_variable_indexing; + /* If there are nested loops, the node count will be inaccurate. */ + bool nested_loop; - loop_unroll_count(exec_list *list) + loop_unroll_count(exec_list *list, loop_variable_state *ls, + const struct gl_shader_compiler_options *options) + : ls(ls), options(options) { nodes = 0; - fail = false; + nested_loop = false; + unsupported_variable_indexing = false; run(list); } - virtual ir_visitor_status visit_enter(ir_assignment *ir) + virtual ir_visitor_status visit_enter(ir_assignment *) { nodes++; return visit_continue; } - virtual ir_visitor_status visit_enter(ir_expression *ir) + virtual ir_visitor_status visit_enter(ir_expression *) { nodes++; return visit_continue; } - virtual ir_visitor_status visit_enter(ir_loop *ir) + virtual ir_visitor_status visit_enter(ir_loop *) { - fail = true; + nested_loop = true; return visit_continue; } + + virtual ir_visitor_status visit_enter(ir_dereference_array *ir) + { + /* Check for arrays variably-indexed by a loop induction variable. + * Unrolling the loop may convert that access into constant-indexing. + * + * Many drivers don't support particular kinds of variable indexing, + * and have to resort to using lower_variable_index_to_cond_assign to + * handle it. This results in huge amounts of horrible code, so we'd + * like to avoid that if possible. Here, we just note that it will + * happen. + */ + if ((ir->array->type->is_array() || ir->array->type->is_matrix()) && + !ir->array_index->as_constant()) { + ir_variable *array = ir->array->variable_referenced(); + loop_variable *lv = ls->get(ir->array_index->variable_referenced()); + if (array && lv && lv->is_induction_var()) { + switch (array->data.mode) { + case ir_var_auto: + case ir_var_temporary: + case ir_var_const_in: + case ir_var_function_in: + case ir_var_function_out: + case ir_var_function_inout: + if (options->EmitNoIndirectTemp) + unsupported_variable_indexing = true; + break; + case ir_var_uniform: + if (options->EmitNoIndirectUniform) + unsupported_variable_indexing = true; + break; + case ir_var_shader_in: + if (options->EmitNoIndirectInput) + unsupported_variable_indexing = true; + break; + case ir_var_shader_out: + if (options->EmitNoIndirectOutput) + unsupported_variable_indexing = true; + break; + } + } + } + return visit_continue; + } + +private: + loop_variable_state *ls; + const struct gl_shader_compiler_options *options; }; @@ -244,16 +300,21 @@ loop_unroll_visitor::visit_leave(ir_loop *ir) iterations = ls->limiting_terminator->iterations; + const int max_iterations = options->MaxUnrollIterations; + /* Don't try to unroll loops that have zillions of iterations either. */ - if (iterations > (int) max_iterations) + if (iterations > max_iterations) return visit_continue; /* Don't try to unroll nested loops and loops with a huge body. */ - loop_unroll_count count(&ir->body_instructions); + loop_unroll_count count(&ir->body_instructions, ls, options); - if (count.fail || count.nodes * iterations > (int)max_iterations * 25) + bool loop_too_large = + count.nested_loop || count.nodes * iterations > (int)max_iterations * 25; + + if (loop_too_large && !count.unsupported_variable_indexing) return visit_continue; /* Note: the limiting terminator contributes 1 to ls->num_loop_jumps. @@ -286,10 +347,8 @@ loop_unroll_visitor::visit_leave(ir_loop *ir) return visit_continue; } - foreach_list(node, &ir->body_instructions) { - /* recognize loops in the form produced by ir_lower_jumps */ - ir_instruction *cur_ir = (ir_instruction *) node; - + /* recognize loops in the form produced by ir_lower_jumps */ + foreach_in_list(ir_instruction, cur_ir, &ir->body_instructions) { /* Skip the limiting terminator, since it will go away when we * unroll. */ @@ -338,9 +397,10 @@ loop_unroll_visitor::visit_leave(ir_loop *ir) bool -unroll_loops(exec_list *instructions, loop_state *ls, unsigned max_iterations) +unroll_loops(exec_list *instructions, loop_state *ls, + const struct gl_shader_compiler_options *options) { - loop_unroll_visitor v(ls, max_iterations); + loop_unroll_visitor v(ls, options); v.run(instructions); diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_discard.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_discard.cpp index 59fe72724..fa08931c6 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_discard.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_discard.cpp @@ -138,8 +138,8 @@ lower_discard(exec_list *instructions) static ir_discard * find_discard(exec_list &instructions) { - foreach_list(n, &instructions) { - ir_discard *ir = ((ir_instruction *) n)->as_discard(); + foreach_in_list(ir_instruction, node, &instructions) { + ir_discard *ir = node->as_discard(); if (ir != NULL) return ir; } diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_if_to_cond_assign.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_if_to_cond_assign.cpp index b374b2328..c174dd01b 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_if_to_cond_assign.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_if_to_cond_assign.cpp @@ -116,9 +116,7 @@ move_block_to_cond_assign(void *mem_ctx, exec_list *instructions, struct hash_table *ht) { - foreach_list_safe(node, instructions) { - ir_instruction *ir = (ir_instruction *) node; - + foreach_in_list_safe(ir_instruction, ir, instructions) { if (ir->ir_type == ir_type_assignment) { ir_assignment *assign = (ir_assignment *)ir; @@ -178,12 +176,10 @@ ir_if_to_cond_assign_visitor::visit_leave(ir_if *ir) ir_assignment *assign; /* Check that both blocks don't contain anything we can't support. */ - foreach_list(n, &ir->then_instructions) { - ir_instruction *then_ir = (ir_instruction *) n; + foreach_in_list(ir_instruction, then_ir, &ir->then_instructions) { visit_tree(then_ir, check_control_flow, &found_control_flow); } - foreach_list(n, &ir->else_instructions) { - ir_instruction *else_ir = (ir_instruction *) n; + foreach_in_list(ir_instruction, else_ir, &ir->else_instructions) { visit_tree(else_ir, check_control_flow, &found_control_flow); } if (found_control_flow) diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_instructions.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_instructions.cpp index 8d8088520..b3e436429 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_instructions.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_instructions.cpp @@ -38,8 +38,10 @@ * - LOG_TO_LOG2 * - MOD_TO_FRACT * - LDEXP_TO_ARITH - * - LRP_TO_ARITH * - BITFIELD_INSERT_TO_BFM_BFI + * - CARRY_TO_ARITH + * - BORROW_TO_ARITH + * - SAT_TO_CLAMP * * SUB_TO_ADD_NEG: * --------------- @@ -87,10 +89,6 @@ * ------------- * Converts ir_binop_ldexp to arithmetic and bit operations. * - * LRP_TO_ARITH: - * ------------- - * Converts ir_triop_lrp to (op0 * (1.0f - op2)) + (op1 * op2). - * * BITFIELD_INSERT_TO_BFM_BFI: * --------------------------- * Breaks ir_quadop_bitfield_insert into ir_binop_bfm (bitfield mask) and @@ -99,6 +97,18 @@ * Many GPUs implement the bitfieldInsert() built-in from ARB_gpu_shader_5 * with a pair of instructions. * + * CARRY_TO_ARITH: + * --------------- + * Converts ir_carry into (x + y) < x. + * + * BORROW_TO_ARITH: + * ---------------- + * Converts ir_borrow into (x < y). + * + * SAT_TO_CLAMP: + * ------------- + * Converts ir_unop_saturate into min(max(x, 0.0), 1.0) + * */ #include "main/core.h" /* for M_LOG2E */ @@ -130,9 +140,11 @@ private: void exp_to_exp2(ir_expression *); void pow_to_exp2(ir_expression *); void log_to_log2(ir_expression *); - void lrp_to_arith(ir_expression *); void bitfield_insert_to_bfm_bfi(ir_expression *); void ldexp_to_arith(ir_expression *); + void carry_to_arith(ir_expression *); + void borrow_to_arith(ir_expression *); + void sat_to_clamp(ir_expression *); }; } /* anonymous namespace */ @@ -298,27 +310,6 @@ lower_instructions_visitor::mod_to_fract(ir_expression *ir) this->progress = true; } -void -lower_instructions_visitor::lrp_to_arith(ir_expression *ir) -{ - /* (lrp x y a) -> x*(1-a) + y*a */ - - /* Save op2 */ - ir_variable *temp = new(ir) ir_variable(ir->operands[2]->type, "lrp_factor", - ir_var_temporary, precision_from_ir(ir->operands[2])); - this->base_ir->insert_before(temp); - this->base_ir->insert_before(assign(temp, ir->operands[2])); - - ir_constant *one = new(ir) ir_constant(1.0f); - - ir->operation = ir_binop_add; - ir->operands[0] = mul(ir->operands[0], sub(one, temp)); - ir->operands[1] = mul(ir->operands[1], temp); - ir->operands[2] = NULL; - - this->progress = true; -} - void lower_instructions_visitor::bitfield_insert_to_bfm_bfi(ir_expression *ir) { @@ -386,8 +377,8 @@ lower_instructions_visitor::ldexp_to_arith(ir_expression *ir) ir_constant *sign_mask = new(ir) ir_constant(0x80000000u, vec_elem); - ir_constant *exp_shift = new(ir) ir_constant(23u, vec_elem); - ir_constant *exp_width = new(ir) ir_constant(8u, vec_elem); + ir_constant *exp_shift = new(ir) ir_constant(23); + ir_constant *exp_width = new(ir) ir_constant(8); /* Temporary variables */ glsl_precision prec = ir->get_precision(); @@ -464,6 +455,60 @@ lower_instructions_visitor::ldexp_to_arith(ir_expression *ir) this->progress = true; } +void +lower_instructions_visitor::carry_to_arith(ir_expression *ir) +{ + /* Translates + * ir_binop_carry x y + * into + * sum = ir_binop_add x y + * bcarry = ir_binop_less sum x + * carry = ir_unop_b2i bcarry + */ + + ir_rvalue *x_clone = ir->operands[0]->clone(ir, NULL); + ir->operation = ir_unop_i2u; + ir->operands[0] = b2i(less(add(ir->operands[0], ir->operands[1]), x_clone)); + ir->operands[1] = NULL; + + this->progress = true; +} + +void +lower_instructions_visitor::borrow_to_arith(ir_expression *ir) +{ + /* Translates + * ir_binop_borrow x y + * into + * bcarry = ir_binop_less x y + * carry = ir_unop_b2i bcarry + */ + + ir->operation = ir_unop_i2u; + ir->operands[0] = b2i(less(ir->operands[0], ir->operands[1])); + ir->operands[1] = NULL; + + this->progress = true; +} + +void +lower_instructions_visitor::sat_to_clamp(ir_expression *ir) +{ + /* Translates + * ir_unop_saturate x + * into + * ir_binop_min (ir_binop_max(x, 0.0), 1.0) + */ + + ir->operation = ir_binop_min; + ir->operands[0] = new(ir) ir_expression(ir_binop_max, ir->operands[0]->type, + ir->operands[0], + new(ir) ir_constant(0.0f)); + ir->operands[1] = new(ir) ir_constant(1.0f); + + this->progress = true; +} + ir_visitor_status lower_instructions_visitor::visit_leave(ir_expression *ir) { @@ -500,11 +545,6 @@ lower_instructions_visitor::visit_leave(ir_expression *ir) pow_to_exp2(ir); break; - case ir_triop_lrp: - if (lowering(LRP_TO_ARITH)) - lrp_to_arith(ir); - break; - case ir_quadop_bitfield_insert: if (lowering(BITFIELD_INSERT_TO_BFM_BFI)) bitfield_insert_to_bfm_bfi(ir); @@ -515,6 +555,21 @@ lower_instructions_visitor::visit_leave(ir_expression *ir) ldexp_to_arith(ir); break; + case ir_binop_carry: + if (lowering(CARRY_TO_ARITH)) + carry_to_arith(ir); + break; + + case ir_binop_borrow: + if (lowering(BORROW_TO_ARITH)) + borrow_to_arith(ir); + break; + + case ir_unop_saturate: + if (lowering(SAT_TO_CLAMP)) + sat_to_clamp(ir); + break; + default: return visit_continue; } diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_jumps.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_jumps.cpp index b871ca0f4..591c6d692 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_jumps.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_jumps.cpp @@ -510,16 +510,16 @@ struct ir_lower_jumps_visitor : public ir_control_flow_visitor { /* Note: since visiting a node may change that node's next * pointer, we can't use visit_exec_list(), because * visit_exec_list() caches the node's next pointer before - * visiting it. So we use foreach_list() instead. + * visiting it. So we use foreach_in_list() instead. * - * foreach_list() isn't safe if the node being visited gets + * foreach_in_list() isn't safe if the node being visited gets * removed, but fortunately this visitor doesn't do that. */ block_record saved_block = this->block; this->block = block_record(); - foreach_list(node, list) { - ((ir_instruction *) node)->accept(this); + foreach_in_list(ir_instruction, node, list) { + node->accept(this); } block_record ret = this->block; this->block = saved_block; diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_named_interface_blocks.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_named_interface_blocks.cpp index 85238c13d..c128d9220 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_named_interface_blocks.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_named_interface_blocks.cpp @@ -99,8 +99,8 @@ flatten_named_interface_blocks_declarations::run(exec_list *instructions) * The interface block variables are stored in the interface_namespace * hash table so they can be used in the second pass. */ - foreach_list_safe(node, instructions) { - ir_variable *var = ((ir_instruction *) node)->as_variable(); + foreach_in_list_safe(ir_instruction, node, instructions) { + ir_variable *var = node->as_variable(); if (!var || !var->is_interface_instance()) continue; @@ -125,8 +125,8 @@ flatten_named_interface_blocks_declarations::run(exec_list *instructions) for (unsigned i = 0; i < iface_t->length; i++) { const char * field_name = iface_t->fields.structure[i].name; char *iface_field_name = - ralloc_asprintf(mem_ctx, "%s.%s", - iface_t->name, field_name); + ralloc_asprintf(mem_ctx, "%s.%s.%s", + iface_t->name, var->name, field_name); ir_variable *found_var = (ir_variable *) hash_table_find(interface_namespace, @@ -219,8 +219,8 @@ flatten_named_interface_blocks_declarations::handle_rvalue(ir_rvalue **rvalue) if (var->get_interface_type() != NULL) { char *iface_field_name = - ralloc_asprintf(mem_ctx, "%s.%s", var->get_interface_type()->name, - ir->field); + ralloc_asprintf(mem_ctx, "%s.%s.%s", var->get_interface_type()->name, + var->name, ir->field); /* Find the variable in the set of flattened interface blocks */ ir_variable *found_var = (ir_variable *) hash_table_find(interface_namespace, diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_offset_array.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_offset_array.cpp new file mode 100644 index 000000000..859e5e788 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/lower_offset_array.cpp @@ -0,0 +1,91 @@ +/* + * Copyright © 2013 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file brw_lower_offset_array.cpp + * + * IR lower pass to decompose ir_texture ir_tg4 with an array of offsets + * into four ir_tg4s with a single ivec2 offset, select the .w component of each, + * and return those four values packed into a gvec4. + * + * \author Chris Forbes + */ + +#include "glsl_types.h" +#include "ir.h" +#include "ir_builder.h" +#include "ir_optimization.h" +#include "ir_rvalue_visitor.h" + +using namespace ir_builder; + +class brw_lower_offset_array_visitor : public ir_rvalue_visitor { +public: + brw_lower_offset_array_visitor() + { + progress = false; + } + + void handle_rvalue(ir_rvalue **rv); + + bool progress; +}; + +void +brw_lower_offset_array_visitor::handle_rvalue(ir_rvalue **rv) +{ + if (*rv == NULL || (*rv)->ir_type != ir_type_texture) + return; + + ir_texture *ir = (ir_texture *) *rv; + if (ir->op != ir_tg4 || !ir->offset || !ir->offset->type->is_array()) + return; + + void *mem_ctx = ralloc_parent(ir); + + ir_variable *var = + new (mem_ctx) ir_variable(ir->type, "result", ir_var_temporary, ir->get_precision()); + base_ir->insert_before(var); + + for (int i = 0; i < 4; i++) { + ir_texture *tex = ir->clone(mem_ctx, NULL); + tex->offset = new (mem_ctx) ir_dereference_array(tex->offset, + new (mem_ctx) ir_constant(i)); + + base_ir->insert_before(assign(var, swizzle_w(tex), 1 << i)); + } + + *rv = new (mem_ctx) ir_dereference_variable(var); + + progress = true; +} + +bool +lower_offset_arrays(exec_list *instructions) +{ + brw_lower_offset_array_visitor v; + + visit_list_elements(&v, instructions); + + return v.progress; +} diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_output_reads.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_output_reads.cpp index 1e39c7282..9d536e6f3 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_output_reads.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_output_reads.cpp @@ -52,7 +52,7 @@ public: output_read_remover(); ~output_read_remover(); virtual ir_visitor_status visit(class ir_dereference_variable *); - virtual ir_visitor_status visit(class ir_emit_vertex *); + virtual ir_visitor_status visit_leave(class ir_emit_vertex *); virtual ir_visitor_status visit_leave(class ir_return *); virtual ir_visitor_status visit_leave(class ir_function_signature *); }; @@ -148,7 +148,7 @@ output_read_remover::visit_leave(ir_return *ir) } ir_visitor_status -output_read_remover::visit(ir_emit_vertex *ir) +output_read_remover::visit_leave(ir_emit_vertex *ir) { hash_table_call_foreach(replacements, emit_return_copy, ir); hash_table_clear(replacements); diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_packed_varyings.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_packed_varyings.cpp index 22c6d9462..ae85a2053 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_packed_varyings.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_packed_varyings.cpp @@ -160,8 +160,7 @@ namespace { class lower_packed_varyings_visitor { public: - lower_packed_varyings_visitor(void *mem_ctx, unsigned location_base, - unsigned locations_used, + lower_packed_varyings_visitor(void *mem_ctx, unsigned locations_used, ir_variable_mode mode, unsigned gs_input_vertices, exec_list *out_instructions); @@ -189,19 +188,11 @@ private: */ void * const mem_ctx; - /** - * Location representing the first generic varying slot for this shader - * stage (e.g. VARYING_SLOT_VAR0 if we are packing vertex shader outputs). - * Varyings whose location is less than this value are assumed to - * correspond to special fixed function hardware, so they are not lowered. - */ - const unsigned location_base; - /** * Number of generic varying slots which are used by this shader. This is - * used to allocate temporary intermediate data structures. If any any - * varying used by this shader has a location greater than or equal to - * location_base + locations_used, an assertion will fire. + * used to allocate temporary intermediate data structures. If any varying + * used by this shader has a location greater than or equal to + * VARYING_SLOT_VAR0 + locations_used, an assertion will fire. */ const unsigned locations_used; @@ -235,11 +226,9 @@ private: } /* anonymous namespace */ lower_packed_varyings_visitor::lower_packed_varyings_visitor( - void *mem_ctx, unsigned location_base, unsigned locations_used, - ir_variable_mode mode, unsigned gs_input_vertices, - exec_list *out_instructions) + void *mem_ctx, unsigned locations_used, ir_variable_mode mode, + unsigned gs_input_vertices, exec_list *out_instructions) : mem_ctx(mem_ctx), - location_base(location_base), locations_used(locations_used), packed_varyings((ir_variable **) rzalloc_array_size(mem_ctx, sizeof(*packed_varyings), @@ -253,13 +242,13 @@ lower_packed_varyings_visitor::lower_packed_varyings_visitor( void lower_packed_varyings_visitor::run(exec_list *instructions) { - foreach_list (node, instructions) { - ir_variable *var = ((ir_instruction *) node)->as_variable(); + foreach_in_list(ir_instruction, node, instructions) { + ir_variable *var = node->as_variable(); if (var == NULL) continue; if (var->data.mode != this->mode || - var->data.location < (int) this->location_base || + var->data.location < VARYING_SLOT_VAR0 || !this->needs_lowering(var)) continue; @@ -272,6 +261,7 @@ lower_packed_varyings_visitor::run(exec_list *instructions) !var->type->contains_integer()); /* Change the old varying into an ordinary global. */ + assert(var->data.mode != ir_var_temporary); var->data.mode = ir_var_auto; /* Create a reference to the old varying. */ @@ -542,7 +532,7 @@ lower_packed_varyings_visitor::get_packed_varying_deref( unsigned location, ir_variable *unpacked_var, const char *name, unsigned vertex_index) { - unsigned slot = location - this->location_base; + unsigned slot = location - VARYING_SLOT_VAR0; assert(slot < locations_used); if (this->packed_varyings[slot] == NULL) { char *packed_name = ralloc_asprintf(this->mem_ctx, "packed:%s", name); @@ -595,7 +585,12 @@ lower_packed_varyings_visitor::get_packed_varying_deref( bool lower_packed_varyings_visitor::needs_lowering(ir_variable *var) { - /* Things composed of vec4's don't need lowering. Everything else does. */ + /* Things composed of vec4's and varyings with explicitly assigned + * locations don't need lowering. Everything else does. + */ + if (var->data.explicit_location) + return false; + const glsl_type *type = var->type; if (this->gs_input_vertices != 0) { assert(type->is_array()); @@ -619,7 +614,7 @@ public: explicit lower_packed_varyings_gs_splicer(void *mem_ctx, const exec_list *instructions); - virtual ir_visitor_status visit(ir_emit_vertex *ev); + virtual ir_visitor_status visit_leave(ir_emit_vertex *ev); private: /** @@ -643,10 +638,9 @@ lower_packed_varyings_gs_splicer::lower_packed_varyings_gs_splicer( ir_visitor_status -lower_packed_varyings_gs_splicer::visit(ir_emit_vertex *ev) +lower_packed_varyings_gs_splicer::visit_leave(ir_emit_vertex *ev) { - foreach_list(node, this->instructions) { - ir_instruction *ir = (ir_instruction *) node; + foreach_in_list(ir_instruction, ir, this->instructions) { ev->insert_before(ir->clone(this->mem_ctx, NULL)); } return visit_continue; @@ -654,18 +648,17 @@ lower_packed_varyings_gs_splicer::visit(ir_emit_vertex *ev) void -lower_packed_varyings(void *mem_ctx, unsigned location_base, - unsigned locations_used, ir_variable_mode mode, - unsigned gs_input_vertices, gl_shader *shader) +lower_packed_varyings(void *mem_ctx, unsigned locations_used, + ir_variable_mode mode, unsigned gs_input_vertices, + gl_shader *shader) { exec_list *instructions = shader->ir; ir_function *main_func = shader->symbols->get_function("main"); exec_list void_parameters; ir_function_signature *main_func_sig - = main_func->matching_signature(NULL, &void_parameters); + = main_func->matching_signature(NULL, &void_parameters, false); exec_list new_instructions; - lower_packed_varyings_visitor visitor(mem_ctx, location_base, - locations_used, mode, + lower_packed_varyings_visitor visitor(mem_ctx, locations_used, mode, gs_input_vertices, &new_instructions); visitor.run(instructions); if (mode == ir_var_shader_out) { diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_ubo_reference.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_ubo_reference.cpp index 0dc6b5711..271629196 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_ubo_reference.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_ubo_reference.cpp @@ -40,6 +40,96 @@ using namespace ir_builder; +/** + * Determine if a thing being dereferenced is row-major + * + * There is some trickery here. + * + * If the thing being dereferenced is a member of uniform block \b without an + * instance name, then the name of the \c ir_variable is the field name of an + * interface type. If this field is row-major, then the thing referenced is + * row-major. + * + * If the thing being dereferenced is a member of uniform block \b with an + * instance name, then the last dereference in the tree will be an + * \c ir_dereference_record. If that record field is row-major, then the + * thing referenced is row-major. + */ +static bool +is_dereferenced_thing_row_major(const ir_dereference *deref) +{ + bool matrix = false; + const ir_rvalue *ir = deref; + + while (true) { + matrix = matrix || ir->type->without_array()->is_matrix(); + + switch (ir->ir_type) { + case ir_type_dereference_array: { + const ir_dereference_array *const array_deref = + (const ir_dereference_array *) ir; + + ir = array_deref->array; + break; + } + + case ir_type_dereference_record: { + const ir_dereference_record *const record_deref = + (const ir_dereference_record *) ir; + + ir = record_deref->record; + + const int idx = ir->type->field_index(record_deref->field); + assert(idx >= 0); + + const enum glsl_matrix_layout matrix_layout = + glsl_matrix_layout(ir->type->fields.structure[idx].matrix_layout); + + switch (matrix_layout) { + case GLSL_MATRIX_LAYOUT_INHERITED: + break; + case GLSL_MATRIX_LAYOUT_COLUMN_MAJOR: + return false; + case GLSL_MATRIX_LAYOUT_ROW_MAJOR: + return matrix || deref->type->without_array()->is_record(); + } + + break; + } + + case ir_type_dereference_variable: { + const ir_dereference_variable *const var_deref = + (const ir_dereference_variable *) ir; + + const enum glsl_matrix_layout matrix_layout = + glsl_matrix_layout(var_deref->var->data.matrix_layout); + + switch (matrix_layout) { + case GLSL_MATRIX_LAYOUT_INHERITED: + assert(!matrix); + return false; + case GLSL_MATRIX_LAYOUT_COLUMN_MAJOR: + return false; + case GLSL_MATRIX_LAYOUT_ROW_MAJOR: + return matrix || deref->type->without_array()->is_record(); + } + + unreachable("invalid matrix layout"); + break; + } + + default: + return false; + } + } + + /* The tree must have ended with a dereference that wasn't an + * ir_dereference_variable. That is invalid, and it should be impossible. + */ + unreachable("invalid dereference tree"); + return false; +} + namespace { class lower_ubo_reference_visitor : public ir_rvalue_enter_visitor { public: @@ -50,14 +140,14 @@ public: void handle_rvalue(ir_rvalue **rvalue); void emit_ubo_loads(ir_dereference *deref, ir_variable *base_offset, - unsigned int deref_offset); + unsigned int deref_offset, bool row_major); ir_expression *ubo_load(const struct glsl_type *type, ir_rvalue *offset); void *mem_ctx; struct gl_shader *shader; struct gl_uniform_buffer_variable *ubo_var; - unsigned uniform_block; + ir_rvalue *uniform_block; bool progress; }; @@ -69,9 +159,11 @@ public: * \c UniformBlocks array. */ static const char * -interface_field_name(void *mem_ctx, char *base_name, ir_dereference *d) +interface_field_name(void *mem_ctx, char *base_name, ir_dereference *d, + ir_rvalue **nonconst_block_index) { - ir_constant *previous_index = NULL; + ir_rvalue *previous_index = NULL; + *nonconst_block_index = NULL; while (d != NULL) { switch (d->ir_type) { @@ -79,13 +171,21 @@ interface_field_name(void *mem_ctx, char *base_name, ir_dereference *d) ir_dereference_variable *v = (ir_dereference_variable *) d; if (previous_index && v->var->is_interface_instance() - && v->var->type->is_array()) - return ralloc_asprintf(mem_ctx, - "%s[%d]", - base_name, - previous_index->get_uint_component(0)); - else + && v->var->type->is_array()) { + + ir_constant *const_index = previous_index->as_constant(); + if (!const_index) { + *nonconst_block_index = previous_index; + return ralloc_asprintf(mem_ctx, "%s[0]", base_name); + } else { + return ralloc_asprintf(mem_ctx, + "%s[%d]", + base_name, + const_index->get_uint_component(0)); + } + } else { return base_name; + } break; } @@ -101,7 +201,8 @@ interface_field_name(void *mem_ctx, char *base_name, ir_dereference *d) ir_dereference_array *a = (ir_dereference_array *) d; d = a->array->as_dereference(); - previous_index = a->array_index->as_constant(); + previous_index = a->array_index; + break; } @@ -131,14 +232,24 @@ lower_ubo_reference_visitor::handle_rvalue(ir_rvalue **rvalue) mem_ctx = ralloc_parent(*rvalue); + ir_rvalue *nonconst_block_index; const char *const field_name = interface_field_name(mem_ctx, (char *) var->get_interface_type()->name, - deref); + deref, &nonconst_block_index); - this->uniform_block = -1; + this->uniform_block = NULL; for (unsigned i = 0; i < shader->NumUniformBlocks; i++) { if (strcmp(field_name, shader->UniformBlocks[i].Name) == 0) { - this->uniform_block = i; + + ir_constant *index = new(mem_ctx) ir_constant(i); + + if (nonconst_block_index) { + if (nonconst_block_index->type != glsl_type::uint_type) + nonconst_block_index = i2u(nonconst_block_index); + this->uniform_block = add(nonconst_block_index, index); + } else { + this->uniform_block = index; + } struct gl_uniform_block *block = &shader->UniformBlocks[i]; @@ -149,11 +260,11 @@ lower_ubo_reference_visitor::handle_rvalue(ir_rvalue **rvalue) } } - assert(this->uniform_block != (unsigned) -1); + assert(this->uniform_block); ir_rvalue *offset = new(mem_ctx) ir_constant(0u); unsigned const_offset = 0; - bool row_major = !!ubo_var->RowMajor; + bool row_major = is_dereferenced_thing_row_major(deref); /* Calculate the offset to the start of the region of the UBO * dereferenced by *rvalue. This may be a variable offset if an @@ -190,16 +301,28 @@ lower_ubo_reference_visitor::handle_rvalue(ir_rvalue **rvalue) deref = deref_array->array->as_dereference(); break; } else { - array_stride = deref_array->type->std140_size(row_major); + /* Whether or not the field is row-major (because it might be a + * bvec2 or something) does not affect the array itself. We need + * to know whether an array element in its entirety is row-major. + */ + const bool array_row_major = + is_dereferenced_thing_row_major(deref_array); + + array_stride = deref_array->type->std140_size(array_row_major); array_stride = glsl_align(array_stride, 16); } - ir_constant *const_index = deref_array->array_index->as_constant(); + ir_rvalue *array_index = deref_array->array_index; + if (array_index->type->base_type == GLSL_TYPE_INT) + array_index = i2u(array_index); + + ir_constant *const_index = + array_index->constant_expression_value(NULL); if (const_index) { - const_offset += array_stride * const_index->value.i[0]; + const_offset += array_stride * const_index->value.u[0]; } else { offset = add(offset, - mul(deref_array->array_index, + mul(array_index, new(mem_ctx) ir_constant(array_stride))); } deref = deref_array->array->as_dereference(); @@ -211,20 +334,49 @@ lower_ubo_reference_visitor::handle_rvalue(ir_rvalue **rvalue) const glsl_type *struct_type = deref_record->record->type; unsigned intra_struct_offset = 0; - unsigned max_field_align = 16; + /* glsl_type::std140_base_alignment doesn't grok interfaces. Use + * 16-bytes for the alignment because that is the general minimum of + * std140. + */ + const unsigned struct_alignment = struct_type->is_interface() + ? 16 + : struct_type->std140_base_alignment(row_major); + + for (unsigned int i = 0; i < struct_type->length; i++) { const glsl_type *type = struct_type->fields.structure[i].type; - unsigned field_align = type->std140_base_alignment(row_major); - max_field_align = MAX2(field_align, max_field_align); + + ir_dereference_record *field_deref = + new(mem_ctx) ir_dereference_record(deref_record->record, + struct_type->fields.structure[i].name); + const bool field_row_major = + is_dereferenced_thing_row_major(field_deref); + + ralloc_free(field_deref); + + unsigned field_align = type->std140_base_alignment(field_row_major); + intra_struct_offset = glsl_align(intra_struct_offset, field_align); if (strcmp(struct_type->fields.structure[i].name, deref_record->field) == 0) break; - intra_struct_offset += type->std140_size(row_major); + intra_struct_offset += type->std140_size(field_row_major); + + /* If the field just examined was itself a structure, apply rule + * #9: + * + * "The structure may have padding at the end; the base offset + * of the member following the sub-structure is rounded up to + * the next multiple of the base alignment of the structure." + */ + if (type->without_array()->is_record()) { + intra_struct_offset = glsl_align(intra_struct_offset, + struct_alignment); + + } } - const_offset = glsl_align(const_offset, max_field_align); const_offset += intra_struct_offset; deref = deref_record->record->as_dereference(); @@ -253,7 +405,7 @@ lower_ubo_reference_visitor::handle_rvalue(ir_rvalue **rvalue) base_ir->insert_before(assign(load_offset, offset)); deref = new(mem_ctx) ir_dereference_variable(load_var); - emit_ubo_loads(deref, load_offset, const_offset); + emit_ubo_loads(deref, load_offset, const_offset, row_major); *rvalue = deref; progress = true; @@ -263,11 +415,12 @@ ir_expression * lower_ubo_reference_visitor::ubo_load(const glsl_type *type, ir_rvalue *offset) { + ir_rvalue *block_ref = this->uniform_block->clone(mem_ctx, NULL); return new(mem_ctx) ir_expression(ir_binop_ubo_load, - type, - new(mem_ctx) ir_constant(this->uniform_block), - offset); + type, + block_ref, + offset); } @@ -282,7 +435,8 @@ lower_ubo_reference_visitor::ubo_load(const glsl_type *type, void lower_ubo_reference_visitor::emit_ubo_loads(ir_dereference *deref, ir_variable *base_offset, - unsigned int deref_offset) + unsigned int deref_offset, + bool row_major) { if (deref->type->is_record()) { unsigned int field_offset = 0; @@ -296,18 +450,19 @@ lower_ubo_reference_visitor::emit_ubo_loads(ir_dereference *deref, field_offset = glsl_align(field_offset, - field->type->std140_base_alignment(!!ubo_var->RowMajor)); + field->type->std140_base_alignment(row_major)); - emit_ubo_loads(field_deref, base_offset, deref_offset + field_offset); + emit_ubo_loads(field_deref, base_offset, deref_offset + field_offset, + row_major); - field_offset += field->type->std140_size(!!ubo_var->RowMajor); + field_offset += field->type->std140_size(row_major); } return; } if (deref->type->is_array()) { unsigned array_stride = - glsl_align(deref->type->fields.array->std140_size(!!ubo_var->RowMajor), + glsl_align(deref->type->fields.array->std140_size(row_major), 16); for (unsigned i = 0; i < deref->type->length; i++) { @@ -316,7 +471,8 @@ lower_ubo_reference_visitor::emit_ubo_loads(ir_dereference *deref, new(mem_ctx) ir_dereference_array(deref->clone(mem_ctx, NULL), element); emit_ubo_loads(element_deref, base_offset, - deref_offset + i * array_stride); + deref_offset + i * array_stride, + row_major); } return; } @@ -328,10 +484,19 @@ lower_ubo_reference_visitor::emit_ubo_loads(ir_dereference *deref, new(mem_ctx) ir_dereference_array(deref->clone(mem_ctx, NULL), col); - /* std140 always rounds the stride of arrays (and matrices) - * to a vec4, so matrices are always 16 between columns/rows. - */ - emit_ubo_loads(col_deref, base_offset, deref_offset + i * 16); + if (row_major) { + /* For a row-major matrix, the next column starts at the next + * element. + */ + emit_ubo_loads(col_deref, base_offset, deref_offset + i * 4, + row_major); + } else { + /* std140 always rounds the stride of arrays (and matrices) to a + * vec4, so matrices are always 16 between columns/rows. + */ + emit_ubo_loads(col_deref, base_offset, deref_offset + i * 16, + row_major); + } } return; } @@ -339,7 +504,7 @@ lower_ubo_reference_visitor::emit_ubo_loads(ir_dereference *deref, assert(deref->type->is_scalar() || deref->type->is_vector()); - if (!ubo_var->RowMajor) { + if (!row_major) { ir_rvalue *offset = add(base_offset, new(mem_ctx) ir_constant(deref_offset)); base_ir->insert_before(assign(deref->clone(mem_ctx, NULL), diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_variable_index_to_cond_assign.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_variable_index_to_cond_assign.cpp index 319a11c3e..b0ab6cb2b 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_variable_index_to_cond_assign.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_variable_index_to_cond_assign.cpp @@ -76,7 +76,7 @@ compare_index_block(exec_list *instructions, ir_variable *index, ir_rvalue *broadcast_index = new(mem_ctx) ir_dereference_variable(index); assert(index->type->is_scalar()); - assert(index->type->base_type == GLSL_TYPE_INT); + assert(index->type->base_type == GLSL_TYPE_INT || index->type->base_type == GLSL_TYPE_UINT); assert(components >= 1 && components <= 4); if (components > 1) { @@ -379,6 +379,7 @@ public: case ir_var_function_out: return this->lower_temps; case ir_var_shader_out: + case ir_var_shader_inout: return this->lower_outputs; case ir_var_function_inout: return this->lower_temps; diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_vec_index_to_cond_assign.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_vec_index_to_cond_assign.cpp index ddd753896..285b0a0f2 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_vec_index_to_cond_assign.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_vec_index_to_cond_assign.cpp @@ -198,8 +198,7 @@ ir_vec_index_to_cond_assign_visitor::visit_leave(ir_assignment *ir) ir_visitor_status ir_vec_index_to_cond_assign_visitor::visit_enter(ir_call *ir) { - foreach_list_safe(n, &ir->actual_parameters) { - ir_rvalue *param = (ir_rvalue *) n; + foreach_in_list_safe(ir_rvalue, param, &ir->actual_parameters) { ir_rvalue *new_param = convert_vector_extract_to_cond_assign(param); if (new_param != param) { diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_vec_index_to_swizzle.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_vec_index_to_swizzle.cpp index b5bb00c30..4d4d2f17e 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_vec_index_to_swizzle.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_vec_index_to_swizzle.cpp @@ -131,8 +131,7 @@ ir_vec_index_to_swizzle_visitor::visit_enter(ir_assignment *ir) ir_visitor_status ir_vec_index_to_swizzle_visitor::visit_enter(ir_call *ir) { - foreach_list_safe(n, &ir->actual_parameters) { - ir_rvalue *param = (ir_rvalue *) n; + foreach_in_list_safe(ir_rvalue, param, &ir->actual_parameters) { ir_rvalue *new_param = convert_vector_extract_to_swizzle(param); if (new_param != param) { diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_vector_insert.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_vector_insert.cpp index 6d7cfa942..bd9c1e209 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_vector_insert.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_vector_insert.cpp @@ -76,7 +76,7 @@ vector_insert_visitor::handle_rvalue(ir_rvalue **rv) * where mask is the component selected by index. */ ir_variable *const temp = - factory.make_temp(expr->operands[0]->type, "vec_tmp"); + factory.make_temp(expr->operands[0]->type, "vec_tmp", expr->operands[0]->get_precision()); const int mask = 1 << idx->value.i[0]; @@ -100,10 +100,10 @@ vector_insert_visitor::handle_rvalue(ir_rvalue **rv) * t.w = scalar */ ir_variable *const temp = - factory.make_temp(expr->operands[0]->type, "vec_tmp"); + factory.make_temp(expr->operands[0]->type, "vec_tmp", expr->operands[0]->get_precision()); ir_variable *const src_temp = - factory.make_temp(expr->operands[1]->type, "src_temp"); + factory.make_temp(expr->operands[1]->type, "src_temp", expr->operands[1]->get_precision()); factory.emit(assign(temp, expr->operands[0])); factory.emit(assign(src_temp, expr->operands[1])); @@ -113,7 +113,7 @@ vector_insert_visitor::handle_rvalue(ir_rvalue **rv) new(factory.mem_ctx) ir_constant(int(i)); ir_variable *const cmp_result = - factory.make_temp(glsl_type::bool_type, "index_condition"); + factory.make_temp(glsl_type::bool_type, "index_condition", glsl_precision_low); factory.emit(assign(cmp_result, equal(expr->operands[2]->clone(factory.mem_ctx, diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_vertex_id.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_vertex_id.cpp new file mode 100644 index 000000000..3725eeeca --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/lower_vertex_id.cpp @@ -0,0 +1,144 @@ +/* + * Copyright © 2014 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file lower_vertex_id.cpp + * + * There exists hardware, such as i965, that does not implement the OpenGL + * semantic for gl_VertexID. Instead, that hardware does not include the + * value of basevertex in the gl_VertexID value. To implement the OpenGL + * semantic, we'll have to convert gl_Vertex_ID to + * gl_VertexIDMESA+gl_BaseVertexMESA. + */ + +#include "glsl_symbol_table.h" +#include "ir_hierarchical_visitor.h" +#include "ir.h" +#include "ir_builder.h" +#include "linker.h" +#include "program/prog_statevars.h" + +namespace { + +class lower_vertex_id_visitor : public ir_hierarchical_visitor { +public: + explicit lower_vertex_id_visitor(ir_function_signature *main_sig, + exec_list *ir_list) + : progress(false), VertexID(NULL), gl_VertexID(NULL), + gl_BaseVertex(NULL), main_sig(main_sig), ir_list(ir_list) + { + foreach_in_list(ir_instruction, ir, ir_list) { + ir_variable *const var = ir->as_variable(); + + if (var != NULL && var->data.mode == ir_var_system_value && + var->data.location == SYSTEM_VALUE_BASE_VERTEX) { + gl_BaseVertex = var; + break; + } + } + } + + virtual ir_visitor_status visit(ir_dereference_variable *); + + bool progress; + +private: + ir_variable *VertexID; + ir_variable *gl_VertexID; + ir_variable *gl_BaseVertex; + + ir_function_signature *main_sig; + exec_list *ir_list; +}; + +} /* anonymous namespace */ + +ir_visitor_status +lower_vertex_id_visitor::visit(ir_dereference_variable *ir) +{ + if (ir->var->data.mode != ir_var_system_value || + ir->var->data.location != SYSTEM_VALUE_VERTEX_ID) + return visit_continue; + + if (VertexID == NULL) { + const glsl_type *const int_t = glsl_type::int_type; + void *const mem_ctx = ralloc_parent(ir); + + VertexID = new(mem_ctx) ir_variable(int_t, "__VertexID", + ir_var_temporary, glsl_precision_high); + ir_list->push_head(VertexID); + + gl_VertexID = new(mem_ctx) ir_variable(int_t, "gl_VertexIDMESA", + ir_var_system_value, glsl_precision_high); + gl_VertexID->data.how_declared = ir_var_declared_implicitly; + gl_VertexID->data.read_only = true; + gl_VertexID->data.location = SYSTEM_VALUE_VERTEX_ID_ZERO_BASE; + gl_VertexID->data.explicit_location = true; + gl_VertexID->data.explicit_index = 0; + ir_list->push_head(gl_VertexID); + + if (gl_BaseVertex == NULL) { + gl_BaseVertex = new(mem_ctx) ir_variable(int_t, "gl_BaseVertex", + ir_var_system_value, glsl_precision_high); + gl_BaseVertex->data.how_declared = ir_var_declared_implicitly; + gl_BaseVertex->data.read_only = true; + gl_BaseVertex->data.location = SYSTEM_VALUE_BASE_VERTEX; + gl_BaseVertex->data.explicit_location = true; + gl_BaseVertex->data.explicit_index = 0; + ir_list->push_head(gl_BaseVertex); + } + + ir_instruction *const inst = + ir_builder::assign(VertexID, + ir_builder::add(gl_VertexID, gl_BaseVertex)); + + main_sig->body.push_head(inst); + } + + ir->var = VertexID; + progress = true; + + return visit_continue; +} + +bool +lower_vertex_id(gl_shader *shader) +{ + /* gl_VertexID only exists in the vertex shader. + */ + if (shader->Stage != MESA_SHADER_VERTEX) + return false; + + ir_function_signature *const main_sig = + link_get_main_function_signature(shader); + if (main_sig == NULL) { + assert(main_sig != NULL); + return false; + } + + lower_vertex_id_visitor v(main_sig, shader->ir); + + v.run(shader->ir); + + return v.progress; +} diff --git a/3rdparty/glsl-optimizer/src/glsl/main.cpp b/3rdparty/glsl-optimizer/src/glsl/main.cpp index 3a0f812f2..feed10082 100644 --- a/3rdparty/glsl-optimizer/src/glsl/main.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/main.cpp @@ -40,6 +40,12 @@ 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); +} + static void initialize_context(struct gl_context *ctx, gl_api api) { @@ -204,6 +210,7 @@ initialize_context(struct gl_context *ctx, gl_api api) break; } + ctx->Const.GenerateTemporaryNames = true; ctx->Driver.NewShader = _mesa_new_shader; } @@ -294,7 +301,7 @@ compile_shader(struct gl_context *ctx, struct gl_shader *shader) /* Print out the resulting IR */ if (!state->error && dump_lir) { - _mesa_print_ir(shader->ir, state); + _mesa_print_ir(stdout, shader->ir, state); } return; diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_algebraic.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_algebraic.cpp index f5ffd597d..ce3cc5c74 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_algebraic.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_algebraic.cpp @@ -45,10 +45,13 @@ namespace { class ir_algebraic_visitor : public ir_rvalue_visitor { public: - ir_algebraic_visitor() + ir_algebraic_visitor(bool native_integers, + const struct gl_shader_compiler_options *options) + : options(options) { this->progress = false; this->mem_ctx = NULL; + this->native_integers = native_integers; } virtual ~ir_algebraic_visitor() @@ -68,8 +71,10 @@ public: ir_rvalue *swizzle_if_required(ir_expression *expr, ir_rvalue *operand); + const struct gl_shader_compiler_options *options; void *mem_ctx; + bool native_integers; bool progress; }; @@ -105,6 +110,48 @@ is_vec_basis(ir_constant *ir) return (ir == NULL) ? false : ir->is_basis(); } +static inline bool +is_valid_vec_const(ir_constant *ir) +{ + if (ir == NULL) + return false; + + if (!ir->type->is_scalar() && !ir->type->is_vector()) + return false; + + return true; +} + +static inline bool +is_less_than_one(ir_constant *ir) +{ + if (!is_valid_vec_const(ir)) + return false; + + unsigned component = 0; + for (int c = 0; c < ir->type->vector_elements; c++) { + if (ir->get_float_component(c) < 1.0f) + component++; + } + + return (component == ir->type->vector_elements); +} + +static inline bool +is_greater_than_zero(ir_constant *ir) +{ + if (!is_valid_vec_const(ir)) + return false; + + unsigned component = 0; + for (int c = 0; c < ir->type->vector_elements; c++) { + if (ir->get_float_component(c) > 0.0f) + component++; + } + + return (component == ir->type->vector_elements); +} + static void update_type(ir_expression *ir) { @@ -120,6 +167,46 @@ update_type(ir_expression *ir) } } +/* Recognize (v.x + v.y) + (v.z + v.w) as dot(v, 1.0) */ +static ir_expression * +try_replace_with_dot(ir_expression *expr0, ir_expression *expr1, void *mem_ctx) +{ + if (expr0 && expr0->operation == ir_binop_add && + expr0->type->is_float() && + expr1 && expr1->operation == ir_binop_add && + expr1->type->is_float()) { + ir_swizzle *x = expr0->operands[0]->as_swizzle(); + ir_swizzle *y = expr0->operands[1]->as_swizzle(); + ir_swizzle *z = expr1->operands[0]->as_swizzle(); + ir_swizzle *w = expr1->operands[1]->as_swizzle(); + + if (!x || x->mask.num_components != 1 || + !y || y->mask.num_components != 1 || + !z || z->mask.num_components != 1 || + !w || w->mask.num_components != 1) { + return NULL; + } + + bool swiz_seen[4] = {false, false, false, false}; + swiz_seen[x->mask.x] = true; + swiz_seen[y->mask.x] = true; + swiz_seen[z->mask.x] = true; + swiz_seen[w->mask.x] = true; + + if (!swiz_seen[0] || !swiz_seen[1] || + !swiz_seen[2] || !swiz_seen[3]) { + return NULL; + } + + if (x->val->equals(y->val) && + x->val->equals(z->val) && + x->val->equals(w->val)) { + return dot(x->val, new(mem_ctx) ir_constant(1.0f, 4)); + } + } + return NULL; +} + void ir_algebraic_visitor::reassociate_operands(ir_expression *ir1, int op1, @@ -284,6 +371,20 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) if (op_expr[0]->operation == ir_unop_log2) { return op_expr[0]->operands[0]; } + + if (!options->EmitNoPow && op_expr[0]->operation == ir_binop_mul) { + for (int log2_pos = 0; log2_pos < 2; log2_pos++) { + ir_expression *log2_expr = + op_expr[0]->operands[log2_pos]->as_expression(); + + if (log2_expr && log2_expr->operation == ir_unop_log2) { + return new(mem_ctx) ir_expression(ir_binop_pow, + ir->type, + log2_expr->operands[0], + op_expr[0]->operands[1 - log2_pos]); + } + } + } break; case ir_unop_log2: @@ -347,6 +448,14 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) return sub(ir->operands[0], op_expr[1]->operands[0]); } + /* Recognize (v.x + v.y) + (v.z + v.w) as dot(v, 1.0) */ + if (options->OptimizeForAOS) { + ir_expression *expr = try_replace_with_dot(op_expr[0], op_expr[1], + mem_ctx); + if (expr) + return expr; + } + /* Replace (-x + y) * a + x and commutative variations with lrp(x, y, a). * * (-x + y) * a + x @@ -398,6 +507,7 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) } } } + break; case ir_binop_sub: @@ -465,6 +575,28 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) } break; + case ir_binop_less: + case ir_binop_lequal: + case ir_binop_greater: + case ir_binop_gequal: + case ir_binop_equal: + case ir_binop_nequal: + for (int add_pos = 0; add_pos < 2; add_pos++) { + ir_expression *add = op_expr[add_pos]; + + if (!add || add->operation != ir_binop_add) + continue; + + ir_constant *zero = op_const[1 - add_pos]; + if (!is_vec_zero(zero)) + continue; + + return new(mem_ctx) ir_expression(ir->operation, + add->operands[0], + neg(add->operands[1])); + } + break; + case ir_binop_rshift: case ir_binop_lshift: /* 0 >> x == 0 */ @@ -548,6 +680,70 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) if (is_vec_two(op_const[0])) return expr(ir_unop_exp2, ir->operands[1]); + if (is_vec_two(op_const[1])) { + ir_variable *x = new(ir) ir_variable(ir->operands[1]->type, "x", + ir_var_temporary, ir->operands[1]->get_precision()); + base_ir->insert_before(x); + base_ir->insert_before(assign(x, ir->operands[0])); + return mul(x, x); + } + + break; + + case ir_binop_min: + case ir_binop_max: + if (ir->type->base_type != GLSL_TYPE_FLOAT) + break; + + /* Replace min(max) operations and its commutative combinations with + * a saturate operation + */ + for (int op = 0; op < 2; op++) { + ir_expression *minmax = op_expr[op]; + ir_constant *outer_const = op_const[1 - op]; + ir_expression_operation op_cond = (ir->operation == ir_binop_max) ? + ir_binop_min : ir_binop_max; + + if (!minmax || !outer_const || (minmax->operation != op_cond)) + continue; + + /* Found a min(max) combination. Now try to see if its operands + * meet our conditions that we can do just a single saturate operation + */ + for (int minmax_op = 0; minmax_op < 2; minmax_op++) { + ir_rvalue *inner_val_a = minmax->operands[minmax_op]; + ir_rvalue *inner_val_b = minmax->operands[1 - minmax_op]; + + if (!inner_val_a || !inner_val_b) + continue; + + /* Found a {min|max} ({max|min} (x, 0.0), 1.0) operation and its variations */ + if ((outer_const->is_one() && inner_val_a->is_zero()) || + (inner_val_a->is_one() && outer_const->is_zero())) + return saturate(inner_val_b); + + /* Found a {min|max} ({max|min} (x, 0.0), b) where b < 1.0 + * and its variations + */ + if (is_less_than_one(outer_const) && inner_val_b->is_zero()) + return expr(ir_binop_min, saturate(inner_val_a), outer_const); + + if (!inner_val_b->as_constant()) + continue; + + if (is_less_than_one(inner_val_b->as_constant()) && outer_const->is_zero()) + return expr(ir_binop_min, saturate(inner_val_a), inner_val_b); + + /* Found a {min|max} ({max|min} (x, b), 1.0), where b > 0.0 + * and its variations + */ + if (outer_const->is_one() && is_greater_than_zero(inner_val_b->as_constant())) + return expr(ir_binop_max, saturate(inner_val_a), inner_val_b); + if (inner_val_b->as_constant()->is_one() && is_greater_than_zero(outer_const)) + return expr(ir_binop_max, saturate(inner_val_a), outer_const); + } + } + break; case ir_unop_rcp: @@ -588,6 +784,12 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) return ir->operands[1]; } else if (ir->operands[0]->equals(ir->operands[1])) { return ir->operands[0]; + } else if (is_vec_zero(op_const[0])) { + return mul(ir->operands[1], ir->operands[2]); + } else if (is_vec_zero(op_const[1])) { + unsigned op2_components = ir->operands[2]->type->vector_elements; + ir_constant *one = new(mem_ctx) ir_constant(1.0f, op2_components); + return mul(ir->operands[0], add(one, neg(ir->operands[2]))); } break; @@ -629,9 +831,10 @@ ir_algebraic_visitor::handle_rvalue(ir_rvalue **rvalue) } bool -do_algebraic(exec_list *instructions) +do_algebraic(exec_list *instructions, bool native_integers, + const struct gl_shader_compiler_options *options) { - ir_algebraic_visitor v; + ir_algebraic_visitor v(native_integers, options); visit_list_elements(&v, instructions); diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_array_splitting.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_array_splitting.cpp index 35d8ae630..cfd1ee32d 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_array_splitting.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_array_splitting.cpp @@ -89,8 +89,9 @@ using namespace opt_array_splitting; */ class ir_array_reference_visitor : public ir_hierarchical_visitor { public: - ir_array_reference_visitor(void) + ir_array_reference_visitor(bool split_shader_outputs) { + this->split_shader_outputs = split_shader_outputs; this->mem_ctx = ralloc_context(NULL); this->variable_list.make_empty(); } @@ -113,6 +114,7 @@ public: exec_list variable_list; void *mem_ctx; + bool split_shader_outputs; }; } /* namespace */ @@ -123,7 +125,9 @@ ir_array_reference_visitor::get_variable_entry(ir_variable *var) assert(var); if (var->data.mode != ir_var_auto && - var->data.mode != ir_var_temporary) + var->data.mode != ir_var_temporary && + (!this->split_shader_outputs || (var->data.mode != ir_var_shader_out && var->data.mode != ir_var_shader_inout)) + ) return NULL; if (!(var->type->is_array() || var->type->is_matrix())) @@ -135,8 +139,7 @@ ir_array_reference_visitor::get_variable_entry(ir_variable *var) if (var->type->is_unsized_array()) return NULL; - foreach_list(n, &this->variable_list) { - variable_entry *entry = (variable_entry *) n; + foreach_in_list(variable_entry, entry, &this->variable_list) { if (entry->var == var) return entry; } @@ -213,8 +216,8 @@ ir_array_reference_visitor::get_split_list(exec_list *instructions, * declarations, which need to be matched by name across shaders. */ if (!linked) { - foreach_list(node, instructions) { - ir_variable *var = ((ir_instruction *)node)->as_variable(); + foreach_in_list(ir_instruction, node, instructions) { + ir_variable *var = node->as_variable(); if (var) { variable_entry *entry = get_variable_entry(var); if (entry) @@ -224,9 +227,7 @@ ir_array_reference_visitor::get_split_list(exec_list *instructions, } /* Trim out variables we found that we can't split. */ - foreach_list_safe(n, &variable_list) { - variable_entry *entry = (variable_entry *) n; - + foreach_in_list_safe(variable_entry, entry, &variable_list) { if (debug) { printf("array %s@%p: decl %d, split %d\n", entry->var->name, (void *) entry->var, entry->declaration, @@ -270,8 +271,7 @@ ir_array_splitting_visitor::get_splitting_entry(ir_variable *var) { assert(var); - foreach_list(n, this->variable_list) { - variable_entry *entry = (variable_entry *) n; + foreach_in_list(variable_entry, entry, this->variable_list) { if (entry->var == var) { return entry; } @@ -357,9 +357,9 @@ ir_array_splitting_visitor::visit_leave(ir_assignment *ir) } bool -optimize_split_arrays(exec_list *instructions, bool linked) +optimize_split_arrays(exec_list *instructions, bool linked, bool split_shader_outputs) { - ir_array_reference_visitor refs; + ir_array_reference_visitor refs(split_shader_outputs); if (!refs.get_split_list(instructions, linked)) return false; @@ -368,8 +368,7 @@ optimize_split_arrays(exec_list *instructions, bool linked) /* Replace the decls of the arrays to be split with their split * components. */ - foreach_list(n, &refs.variable_list) { - variable_entry *entry = (variable_entry *) n; + foreach_in_list(variable_entry, entry, &refs.variable_list) { const struct glsl_type *type = entry->var->type; const struct glsl_type *subtype; glsl_precision subprec = (glsl_precision)entry->var->data.precision; @@ -391,8 +390,13 @@ optimize_split_arrays(exec_list *instructions, bool linked) entry->var->name, i); entry->components[i] = - new(entry->mem_ctx) ir_variable(subtype, name, ir_var_temporary, subprec); + new(entry->mem_ctx) ir_variable(subtype, name, (ir_variable_mode)entry->var->data.mode, subprec); entry->var->insert_before(entry->components[i]); + if (entry->var->data.explicit_location) + { + entry->components[i]->data.explicit_location = true; + entry->components[i]->data.location = entry->var->data.location + i; + } } entry->var->remove(); @@ -402,7 +406,7 @@ optimize_split_arrays(exec_list *instructions, bool linked) visit_list_elements(&split, instructions); if (debug) - _mesa_print_ir(instructions, NULL); + _mesa_print_ir(stdout, instructions, NULL); ralloc_free(mem_ctx); diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_constant_folding.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_constant_folding.cpp index d0e575460..74b855e5e 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_constant_folding.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_constant_folding.cpp @@ -79,6 +79,11 @@ ir_constant_folding_visitor::handle_rvalue(ir_rvalue **rvalue) } } + /* Ditto for swizzles. */ + ir_swizzle *swiz = (*rvalue)->as_swizzle(); + if (swiz && !swiz->val->as_constant()) + return; + ir_constant *constant = (*rvalue)->constant_expression_value(); if (constant) { *rvalue = constant; diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_constant_propagation.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_constant_propagation.cpp index 9865dcbf0..ca3b67e22 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_constant_propagation.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_constant_propagation.cpp @@ -172,8 +172,7 @@ ir_constant_propagation_visitor::handle_rvalue(ir_rvalue **rvalue) channel = i; } - foreach_list(n, this->acp) { - acp_entry *entry = (acp_entry *) n; + foreach_in_list(acp_entry, entry, this->acp) { if (entry->var == deref->var && entry->write_mask & (1 << channel)) { found = entry; break; @@ -320,8 +319,7 @@ ir_constant_propagation_visitor::handle_if_block(exec_list *instructions) this->killed_all = false; /* Populate the initial acp with a constant of the original */ - foreach_list(n, orig_acp) { - acp_entry *a = (acp_entry *) n; + foreach_in_list(acp_entry, a, orig_acp) { this->acp->push_tail(new(this->mem_ctx) acp_entry(a)); } @@ -336,8 +334,7 @@ ir_constant_propagation_visitor::handle_if_block(exec_list *instructions) this->acp = orig_acp; this->killed_all = this->killed_all || orig_killed_all; - foreach_list(n, new_kills) { - kill_entry *k = (kill_entry *) n; + foreach_in_list(kill_entry, k, new_kills) { kill(k->var, k->write_mask); } } @@ -381,8 +378,7 @@ ir_constant_propagation_visitor::visit_enter(ir_loop *ir) this->acp = orig_acp; this->killed_all = this->killed_all || orig_killed_all; - foreach_list(n, new_kills) { - kill_entry *k = (kill_entry *) n; + foreach_in_list(kill_entry, k, new_kills) { kill(k->var, k->write_mask); } @@ -400,9 +396,7 @@ ir_constant_propagation_visitor::kill(ir_variable *var, unsigned write_mask) return; /* Remove any entries currently in the ACP for this kill. */ - foreach_list_safe(n, this->acp) { - acp_entry *entry = (acp_entry *) n; - + foreach_in_list_safe(acp_entry, entry, this->acp) { if (entry->var == var) { entry->write_mask &= ~write_mask; if (entry->write_mask == 0) @@ -413,9 +407,7 @@ ir_constant_propagation_visitor::kill(ir_variable *var, unsigned write_mask) /* Add this writemask of the variable to the list of killed * variables in this block. */ - foreach_list(n, this->kills) { - kill_entry *entry = (kill_entry *) n; - + foreach_in_list(kill_entry, entry, this->kills) { if (entry->var == var) { entry->write_mask |= write_mask; return; diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_constant_variable.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_constant_variable.cpp index 2a5628942..938666518 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_constant_variable.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_constant_variable.cpp @@ -166,8 +166,7 @@ ir_visitor_status ir_constant_variable_visitor::visit_enter(ir_function_signature *ir) { /* Mark any in parameters as assigned to */ - foreach_list(n, &ir->parameters) { - ir_variable *var = (ir_variable *)n; + foreach_in_list(ir_variable, var, &ir->parameters) { if (var->data.mode == ir_var_function_in || var->data.mode == ir_var_const_in || var->data.mode == ir_var_function_inout) { struct assignment_entry *entry; entry = get_assignment_entry(var, &this->list); @@ -211,12 +210,10 @@ do_constant_variable_unlinked(exec_list *instructions) { bool progress = false; - foreach_list(n, instructions) { - ir_instruction *ir = (ir_instruction *) n; + foreach_in_list(ir_instruction, ir, instructions) { ir_function *f = ir->as_function(); if (f) { - foreach_list(signode, &f->signatures) { - ir_function_signature *sig = (ir_function_signature *) signode; + foreach_in_list(ir_function_signature, sig, &f->signatures) { if (do_constant_variable(&sig->body)) progress = true; } diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_copy_propagation.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_copy_propagation.cpp index 2beede4a8..07efd34ab 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_copy_propagation.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_copy_propagation.cpp @@ -167,9 +167,7 @@ ir_copy_propagation_visitor::visit(ir_dereference_variable *ir) ir_variable *var = ir->var; - foreach_list(n, this->acp) { - acp_entry *entry = (acp_entry *) n; - + foreach_in_list(acp_entry, entry, this->acp) { if (var == entry->lhs) { ir->var = entry->rhs; this->progress = true; @@ -219,8 +217,7 @@ ir_copy_propagation_visitor::handle_if_block(exec_list *instructions) this->killed_all = false; /* Populate the initial acp with a copy of the original */ - foreach_list(n, orig_acp) { - acp_entry *a = (acp_entry *) n; + foreach_in_list(acp_entry, a, orig_acp) { this->acp->push_tail(new(this->mem_ctx) acp_entry(a->lhs, a->rhs)); } @@ -235,8 +232,7 @@ ir_copy_propagation_visitor::handle_if_block(exec_list *instructions) this->acp = orig_acp; this->killed_all = this->killed_all || orig_killed_all; - foreach_list(n, new_kills) { - kill_entry *k = (kill_entry *) n; + foreach_in_list(kill_entry, k, new_kills) { kill(k->var); } } @@ -279,8 +275,7 @@ ir_copy_propagation_visitor::visit_enter(ir_loop *ir) this->acp = orig_acp; this->killed_all = this->killed_all || orig_killed_all; - foreach_list(n, new_kills) { - kill_entry *k = (kill_entry *) n; + foreach_in_list(kill_entry, k, new_kills) { kill(k->var); } @@ -294,9 +289,7 @@ ir_copy_propagation_visitor::kill(ir_variable *var) assert(var != NULL); /* Remove any entries currently in the ACP for this kill. */ - foreach_list_safe(n, acp) { - acp_entry *entry = (acp_entry *) n; - + foreach_in_list_safe(acp_entry, entry, acp) { if (entry->lhs == var || entry->rhs == var) { entry->remove(); } @@ -332,7 +325,10 @@ ir_copy_propagation_visitor::add_copy(ir_assignment *ir) ir->condition = new(ralloc_parent(ir)) ir_constant(false); this->progress = true; } else { - if (lhs_var->data.precision == rhs_var->data.precision || lhs_var->data.precision==glsl_precision_undefined || rhs_var->data.precision==glsl_precision_undefined) { + // Note: do not add to candidate list when RHS has undefined precision: + // it might eventually leave our rvalue node with a different precision + // than rhs. Which would trip up platforms that need strict casts (like Metal). + if (lhs_var->data.precision == rhs_var->data.precision || lhs_var->data.precision==glsl_precision_undefined) { entry = new(this->mem_ctx) acp_entry(lhs_var, rhs_var); this->acp->push_tail(entry); } diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_copy_propagation_elements.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_copy_propagation_elements.cpp index 95160de80..2b50925d9 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_copy_propagation_elements.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_copy_propagation_elements.cpp @@ -186,7 +186,7 @@ ir_copy_propagation_elements_visitor::visit_leave(ir_assignment *ir) } ir_visitor_status -ir_copy_propagation_elements_visitor::visit_leave(ir_swizzle *ir) +ir_copy_propagation_elements_visitor::visit_leave(ir_swizzle *) { /* Don't visit the values of swizzles since they are handled while * visiting the swizzle itself. @@ -207,8 +207,9 @@ ir_copy_propagation_elements_visitor::handle_rvalue(ir_rvalue **ir) int swizzle_chan[4]; ir_dereference_variable *deref_var; ir_variable *source[4] = {NULL, NULL, NULL, NULL}; - int source_chan[4]; + int source_chan[4] = {0, 0, 0, 0}; int chans; + bool noop_swizzle = true; if (!*ir) return; @@ -244,14 +245,15 @@ ir_copy_propagation_elements_visitor::handle_rvalue(ir_rvalue **ir) /* Try to find ACP entries covering swizzle_chan[], hoping they're * the same source variable. */ - foreach_list(n, this->acp) { - acp_entry *entry = (acp_entry *) n; - + foreach_in_list(acp_entry, entry, this->acp) { if (var == entry->lhs) { for (int c = 0; c < chans; c++) { if (entry->write_mask & (1 << swizzle_chan[c])) { source[c] = entry->rhs; source_chan[c] = entry->swizzle[swizzle_chan[c]]; + + if (source_chan[c] != swizzle_chan[c]) + noop_swizzle = false; } } } @@ -268,6 +270,12 @@ ir_copy_propagation_elements_visitor::handle_rvalue(ir_rvalue **ir) if (!shader_mem_ctx) shader_mem_ctx = ralloc_parent(deref_var); + /* Don't pointlessly replace the rvalue with itself (or a noop swizzle + * of itself, which would just be deleted by opt_noop_swizzle). + */ + if (source[0] == var && noop_swizzle) + return; + if (debug) { printf("Copy propagation from:\n"); (*ir)->print(); @@ -280,6 +288,7 @@ ir_copy_propagation_elements_visitor::handle_rvalue(ir_rvalue **ir) source_chan[2], source_chan[3], chans); + progress = true; if (debug) { printf("to:\n"); @@ -327,8 +336,7 @@ ir_copy_propagation_elements_visitor::handle_if_block(exec_list *instructions) this->killed_all = false; /* Populate the initial acp with a copy of the original */ - foreach_list(n, orig_acp) { - acp_entry *a = (acp_entry *) n; + foreach_in_list(acp_entry, a, orig_acp) { this->acp->push_tail(new(this->mem_ctx) acp_entry(a)); } @@ -346,8 +354,7 @@ ir_copy_propagation_elements_visitor::handle_if_block(exec_list *instructions) /* Move the new kills into the parent block's list, removing them * from the parent's ACP list in the process. */ - foreach_list_safe(node, new_kills) { - kill_entry *k = (kill_entry *)node; + foreach_in_list_safe(kill_entry, k, new_kills) { kill(k); } } @@ -390,8 +397,7 @@ ir_copy_propagation_elements_visitor::visit_enter(ir_loop *ir) this->acp = orig_acp; this->killed_all = this->killed_all || orig_killed_all; - foreach_list_safe(node, new_kills) { - kill_entry *k = (kill_entry *)node; + foreach_in_list_safe(kill_entry, k, new_kills) { kill(k); } @@ -403,9 +409,7 @@ ir_copy_propagation_elements_visitor::visit_enter(ir_loop *ir) void ir_copy_propagation_elements_visitor::kill(kill_entry *k) { - foreach_list_safe(node, acp) { - acp_entry *entry = (acp_entry *)node; - + foreach_in_list_safe(acp_entry, entry, acp) { if (entry->lhs == k->var) { entry->write_mask = entry->write_mask & ~k->write_mask; if (entry->write_mask == 0) { diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_cse.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_cse.cpp index 284aac2d2..ed4c9c9a0 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_cse.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_cse.cpp @@ -173,9 +173,7 @@ dump_ae(exec_list *ae) int i = 0; printf("CSE: AE contents:\n"); - foreach_list(node, ae) { - ae_entry *entry = (ae_entry *)node; - + foreach_in_list(ae_entry, entry, ae) { printf("CSE: AE %2d (%p): ", i, entry); (*entry->val)->print(); printf("\n"); @@ -255,9 +253,7 @@ is_cse_candidate(ir_rvalue *ir) ir_rvalue * cse_visitor::try_cse(ir_rvalue *rvalue) { - foreach_list(node, ae) { - ae_entry *entry = (ae_entry *)node; - + foreach_in_list(ae_entry, entry, ae) { if (debug) { printf("Comparing to AE %p: ", entry); (*entry->val)->print(); @@ -281,7 +277,7 @@ cse_visitor::try_cse(ir_rvalue *rvalue) ir_variable *var = new(rvalue) ir_variable(rvalue->type, "cse", - ir_var_auto, rvalue->get_precision()); + ir_var_temporary, rvalue->get_precision()); /* Write the previous expression result into a new variable. */ base_ir->insert_before(var); @@ -304,8 +300,7 @@ cse_visitor::try_cse(ir_rvalue *rvalue) * updated so that any further elimination from inside gets its new * assignments put before our new assignment. */ - foreach_list(fixup_node, ae) { - ae_entry *fixup_entry = (ae_entry *)fixup_node; + foreach_in_list(ae_entry, fixup_entry, ae) { if (contains_rvalue(assignment->rhs, *fixup_entry->val)) fixup_entry->base_ir = assignment; } @@ -400,7 +395,7 @@ cse_visitor::visit_enter(ir_loop *ir) } ir_visitor_status -cse_visitor::visit_enter(ir_call *ir) +cse_visitor::visit_enter(ir_call *) { /* Because call is an exec_list of ir_rvalues, handle_rvalue gets passed a * pointer to the (ir_rvalue *) on the stack. Since we save those pointers diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_dead_builtin_variables.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_dead_builtin_variables.cpp new file mode 100644 index 000000000..85c75d6f2 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/opt_dead_builtin_variables.cpp @@ -0,0 +1,81 @@ +/* + * Copyright © 2014 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include "ir.h" +#include "ir_visitor.h" +#include "ir_optimization.h" + +/** + * Pre-linking, optimize unused built-in variables + * + * Uniforms, constants, system values, inputs (vertex shader only), and + * outputs (fragment shader only) that are not used can be removed. + */ +void +optimize_dead_builtin_variables(exec_list *instructions, + enum ir_variable_mode other) +{ + foreach_in_list_safe(ir_variable, var, instructions) { + if (var->ir_type != ir_type_variable || var->data.used) + continue; + + if (var->data.mode != ir_var_uniform + && var->data.mode != ir_var_auto + && var->data.mode != ir_var_system_value + && var->data.mode != other) + continue; + + /* So that linker rules can later be enforced, we cannot elimate + * variables that were redeclared in the shader code. + */ + if ((var->data.mode == other || var->data.mode == ir_var_system_value) + && var->data.how_declared != ir_var_declared_implicitly) + continue; + + if (strncmp(var->name, "gl_", 3) != 0) + continue; + + /* gl_ModelViewProjectionMatrix and gl_Vertex are special because they + * are used by ftransform. No other built-in variable is used by a + * built-in function. The forward declarations of these variables in + * the built-in function shader does not have the "state slot" + * information, so removing these variables from the user shader will + * cause problems later. + * + * Matrix uniforms with "Transpose" are not eliminated because there's + * an optimization pass that can turn references to the regular matrix + * into references to the transpose matrix. Eliminating the transpose + * matrix would cause that pass to generate references to undeclareds + * variables (thank you, ir_validate). + * + * It doesn't seem worth the effort to track when the transpose could be + * eliminated (i.e., when the non-transpose was eliminated). + */ + if (strcmp(var->name, "gl_ModelViewProjectionMatrix") == 0 + || strcmp(var->name, "gl_Vertex") == 0 + || strstr(var->name, "Transpose") != NULL) + continue; + + var->remove(); + } +} diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_dead_builtin_varyings.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_dead_builtin_varyings.cpp index 4ca02737f..d7face480 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_dead_builtin_varyings.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_dead_builtin_varyings.cpp @@ -334,7 +334,7 @@ public: } void prepare_array(exec_list *ir, - class ir_variable **new_var, + ir_variable **new_var, int max_elements, unsigned start_location, const char *var_name, const char *mode_str, unsigned usage, unsigned external_usage) @@ -518,14 +518,9 @@ do_dead_builtin_varyings(struct gl_context *ctx, /* Lowering of built-in varyings has no effect with the core context and * GLES2, because they are not available there. - * - * EXT_separate_shader_objects doesn't allow this optimization, - * because a program object can be bound partially (e.g. only one - * stage of a program object can be bound). */ if (ctx->API == API_OPENGL_CORE || - ctx->API == API_OPENGLES2 || - ctx->Extensions.EXT_separate_shader_objects) { + ctx->API == API_OPENGLES2) { return; } diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_dead_code.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_dead_code.cpp index af53d94fd..74236fc70 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_dead_code.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_dead_code.cpp @@ -31,7 +31,7 @@ #include "ir_visitor.h" #include "ir_variable_refcount.h" #include "glsl_types.h" -#include "main/hash_table.h" +#include "util/hash_table.h" static bool debug = false; @@ -71,7 +71,7 @@ do_dead_code(exec_list *instructions, bool uniform_locations_assigned) entry->declaration ? "" : "not "); } - if ((entry->referenced_count > entry->assigned_count) + if ((entry->referenced_count_noself > entry->assigned_count) || !entry->declaration) continue; @@ -99,10 +99,31 @@ do_dead_code(exec_list *instructions, bool uniform_locations_assigned) * stage. Also, once uniform locations have been assigned, the * declaration cannot be deleted. */ - if (entry->var->data.mode == ir_var_uniform && - (uniform_locations_assigned || - entry->var->constant_value)) - continue; + if (entry->var->data.mode == ir_var_uniform) { + if (uniform_locations_assigned || entry->var->constant_value) + continue; + + /* Section 2.11.6 (Uniform Variables) of the OpenGL ES 3.0.3 spec + * says: + * + * "All members of a named uniform block declared with a + * shared or std140 layout qualifier are considered active, + * even if they are not referenced in any shader in the + * program. The uniform block itself is also considered + * active, even if no member of the block is referenced." + * + * If the variable is in a uniform block with one of those + * layouts, do not eliminate it. + */ + if (entry->var->is_in_uniform_block()) { + const glsl_type *const block_type = + entry->var->is_interface_instance() + ? entry->var->type : entry->var->get_interface_type(); + + if (block_type->interface_packing != GLSL_INTERFACE_PACKING_PACKED) + continue; + } + } entry->var->remove(); progress = true; @@ -129,12 +150,10 @@ do_dead_code_unlinked(exec_list *instructions) { bool progress = false; - foreach_list(n, instructions) { - ir_instruction *ir = (ir_instruction *) n; + foreach_in_list(ir_instruction, ir, instructions) { ir_function *f = ir->as_function(); if (f) { - foreach_list(signode, &f->signatures) { - ir_function_signature *sig = (ir_function_signature *) signode; + foreach_in_list(ir_function_signature, sig, &f->signatures) { /* The setting of the uniform_locations_assigned flag here is * irrelevent. If there is a uniform declaration encountered * inside the body of the function, something has already gone diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_dead_code_local.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_dead_code_local.cpp index e7d46edbe..4770fcff2 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_dead_code_local.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_dead_code_local.cpp @@ -51,14 +51,14 @@ public: assert(ir); this->lhs = lhs; this->ir = ir; - this->available = ir->write_mask; + this->unused = ir->write_mask; } ir_variable *lhs; ir_assignment *ir; /* bitmask of xyzw channels written that haven't been used so far. */ - int available; + int unused; }; class kill_for_derefs_visitor : public ir_hierarchical_visitor { @@ -68,22 +68,20 @@ public: this->assignments = assignments; } - void kill_channels(ir_variable *const var, int used) + void use_channels(ir_variable *const var, int used) { - foreach_list_safe(n, this->assignments) { - assignment_entry *entry = (assignment_entry *) n; - + foreach_in_list_safe(assignment_entry, entry, this->assignments) { if (entry->lhs == var) { if (var->type->is_scalar() || var->type->is_vector()) { if (debug) - printf("kill %s (0x%01x - 0x%01x)\n", entry->lhs->name, - entry->available, used); - entry->available &= ~used; - if (!entry->available) + printf("used %s (0x%01x - 0x%01x)\n", entry->lhs->name, + entry->unused, used & 0xf); + entry->unused &= ~used; + if (!entry->unused) entry->remove(); } else { if (debug) - printf("kill %s\n", entry->lhs->name); + printf("used %s\n", entry->lhs->name); entry->remove(); } } @@ -92,7 +90,7 @@ public: virtual ir_visitor_status visit(ir_dereference_variable *ir) { - kill_channels(ir->var, ~0); + use_channels(ir->var, ~0); return visit_continue; } @@ -109,18 +107,17 @@ public: used |= 1 << ir->mask.z; used |= 1 << ir->mask.w; - kill_channels(deref->var, used); + use_channels(deref->var, used); return visit_continue_with_parent; } - virtual ir_visitor_status visit(ir_emit_vertex *ir) + virtual ir_visitor_status visit_leave(ir_emit_vertex *) { /* For the purpose of dead code elimination, emitting a vertex counts as * "reading" all of the currently assigned output variables. */ - foreach_list_safe(n, this->assignments) { - assignment_entry *entry = (assignment_entry *) n; + foreach_in_list_safe(assignment_entry, entry, this->assignments) { if (entry->lhs->data.mode == ir_var_shader_out) { if (debug) printf("kill %s\n", entry->lhs->name); @@ -196,13 +193,11 @@ process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments) printf("looking for %s.0x%01x to remove\n", var->name, ir->write_mask); - foreach_list_safe(n, assignments) { - assignment_entry *entry = (assignment_entry *) n; - + foreach_in_list_safe(assignment_entry, entry, assignments) { if (entry->lhs != var) continue; - int remove = entry->available & ir->write_mask; + int remove = entry->unused & ir->write_mask; if (debug) { printf("%s 0x%01x - 0x%01x = 0x%01x\n", var->name, @@ -219,7 +214,7 @@ process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments) } entry->ir->write_mask &= ~remove; - entry->available &= ~remove; + entry->unused &= ~remove; if (entry->ir->write_mask == 0) { /* Delete the dead assignment. */ entry->ir->remove(); @@ -258,9 +253,7 @@ process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments) */ if (debug) printf("looking for %s to remove\n", var->name); - foreach_list_safe(n, assignments) { - assignment_entry *entry = (assignment_entry *) n; - + foreach_in_list_safe(assignment_entry, entry, assignments) { if (entry->lhs == var) { if (debug) printf("removing %s\n", var->name); @@ -280,10 +273,8 @@ process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments) printf("add %s\n", var->name); printf("current entries\n"); - foreach_list(n, assignments) { - assignment_entry *entry = (assignment_entry *) n; - - printf(" %s (0x%01x)\n", entry->lhs->name, entry->available); + foreach_in_list(assignment_entry, entry, assignments) { + printf(" %s (0x%01x)\n", entry->lhs->name, entry->unused); } } diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_dead_functions.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_dead_functions.cpp index 8bb278e45..5dff16521 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_dead_functions.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_dead_functions.cpp @@ -74,8 +74,7 @@ public: signature_entry * ir_dead_functions_visitor::get_signature_entry(ir_function_signature *sig) { - foreach_list(n, &this->signature_list) { - signature_entry *entry = (signature_entry *) n; + foreach_in_list(signature_entry, entry, &this->signature_list) { if (entry->signature == sig) return entry; } @@ -123,9 +122,7 @@ do_dead_functions(exec_list *instructions) * the unused ones, and remove function definitions that have no more * signatures. */ - foreach_list_safe(n, &v.signature_list) { - signature_entry *entry = (signature_entry *) n; - + foreach_in_list_safe(signature_entry, entry, &v.signature_list) { if (!entry->used) { entry->signature->remove(); delete entry->signature; @@ -137,8 +134,7 @@ do_dead_functions(exec_list *instructions) /* We don't just do this above when we nuked a signature because of * const pointers. */ - foreach_list_safe(n, instructions) { - ir_instruction *ir = (ir_instruction *) n; + foreach_in_list_safe(ir_instruction, ir, instructions) { ir_function *func = ir->as_function(); if (func && func->signatures.is_empty()) { diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_flip_matrices.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_flip_matrices.cpp index 9044fd680..04c6170b8 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_flip_matrices.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_flip_matrices.cpp @@ -45,8 +45,7 @@ public: mvp_transpose = NULL; texmat_transpose = NULL; - foreach_list(n, instructions) { - ir_instruction *ir = (ir_instruction *) n; + foreach_in_list(ir_instruction, ir, instructions) { ir_variable *var = ir->as_variable(); if (!var) continue; diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_function_inlining.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_function_inlining.cpp index 89aa1bb16..b9c373b2b 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_function_inlining.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_function_inlining.cpp @@ -114,16 +114,13 @@ ir_call::generate_inline(ir_instruction *next_ir) { void *ctx = ralloc_parent(this); ir_variable **parameters; - int num_parameters; + unsigned num_parameters; int i; struct hash_table *ht; ht = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare); - num_parameters = 0; - foreach_list(n, &this->callee->parameters) - num_parameters++; - + num_parameters = this->callee->parameters.length(); parameters = new ir_variable *[num_parameters]; /* Generate the declarations for the parameters to our inlined code, @@ -179,8 +176,7 @@ ir_call::generate_inline(ir_instruction *next_ir) exec_list new_instructions; /* Generate the inlined body of the function to a new list */ - foreach_list(n, &callee->body) { - ir_instruction *ir = (ir_instruction *) n; + foreach_in_list(ir_instruction, ir, &callee->body) { ir_instruction *new_ir = ir->clone(ctx, ht); new_instructions.push_tail(new_ir); @@ -362,8 +358,7 @@ ir_variable_replacement_visitor::visit_leave(ir_dereference_record *ir) ir_visitor_status ir_variable_replacement_visitor::visit_leave(ir_call *ir) { - foreach_list_safe(n, &ir->actual_parameters) { - ir_rvalue *param = (ir_rvalue *) n; + foreach_in_list_safe(ir_rvalue, param, &ir->actual_parameters) { ir_rvalue *new_param = param; replace_rvalue(&new_param); diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_if_simplification.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_if_simplification.cpp index 2bec8252e..e05f03190 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_if_simplification.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_if_simplification.cpp @@ -90,15 +90,9 @@ ir_if_simplification_visitor::visit_leave(ir_if *ir) * that matters out. */ if (condition_constant->value.b[0]) { - foreach_list_safe(n, &ir->then_instructions) { - ir_instruction *then_ir = (ir_instruction *) n; - ir->insert_before(then_ir); - } + ir->insert_before(&ir->then_instructions); } else { - foreach_list_safe(n, &ir->else_instructions) { - ir_instruction *else_ir = (ir_instruction *) n; - ir->insert_before(else_ir); - } + ir->insert_before(&ir->else_instructions); } ir->remove(); this->made_progress = true; diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_minmax.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_minmax.cpp new file mode 100644 index 000000000..32fb2d7ea --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/opt_minmax.cpp @@ -0,0 +1,475 @@ +/* + * Copyright © 2014 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file opt_minmax.cpp + * + * Drop operands from an expression tree of only min/max operations if they + * can be proven to not contribute to the final result. + * + * The algorithm is similar to alpha-beta pruning on a minmax search. + */ + +#include "ir.h" +#include "ir_visitor.h" +#include "ir_rvalue_visitor.h" +#include "ir_optimization.h" +#include "ir_builder.h" +#include "program/prog_instruction.h" +#include "glsl_types.h" +#include "main/macros.h" + +using namespace ir_builder; + +namespace { + +enum compare_components_result { + LESS, + LESS_OR_EQUAL, + EQUAL, + GREATER_OR_EQUAL, + GREATER, + MIXED +}; + +class minmax_range { +public: + minmax_range(ir_constant *low = NULL, ir_constant *high = NULL) + { + this->low = low; + this->high = high; + } + + /* low is the lower limit of the range, high is the higher limit. NULL on + * low means negative infinity (unlimited) and on high positive infinity + * (unlimited). Because of the two interpretations of the value NULL, + * arbitrary comparison between ir_constants is impossible. + */ + ir_constant *low; + ir_constant *high; +}; + +class ir_minmax_visitor : public ir_rvalue_enter_visitor { +public: + ir_minmax_visitor() + : progress(false) + { + } + + ir_rvalue *prune_expression(ir_expression *expr, minmax_range baserange); + + void handle_rvalue(ir_rvalue **rvalue); + + bool progress; +}; + +/* + * Returns LESS if all vector components of `a' are strictly lower than of `b', + * GREATER if all vector components of `a' are strictly greater than of `b', + * MIXED if some vector components of `a' are strictly lower than of `b' while + * others are strictly greater, or EQUAL otherwise. + */ +static enum compare_components_result +compare_components(ir_constant *a, ir_constant *b) +{ + assert(a != NULL); + assert(b != NULL); + + assert(a->type->base_type == b->type->base_type); + + unsigned a_inc = a->type->is_scalar() ? 0 : 1; + unsigned b_inc = b->type->is_scalar() ? 0 : 1; + unsigned components = MAX2(a->type->components(), b->type->components()); + + bool foundless = false; + bool foundgreater = false; + bool foundequal = false; + + for (unsigned i = 0, c0 = 0, c1 = 0; + i < components; + c0 += a_inc, c1 += b_inc, ++i) { + switch (a->type->base_type) { + case GLSL_TYPE_UINT: + if (a->value.u[c0] < b->value.u[c1]) + foundless = true; + else if (a->value.u[c0] > b->value.u[c1]) + foundgreater = true; + else + foundequal = true; + break; + case GLSL_TYPE_INT: + if (a->value.i[c0] < b->value.i[c1]) + foundless = true; + else if (a->value.i[c0] > b->value.i[c1]) + foundgreater = true; + else + foundequal = true; + break; + case GLSL_TYPE_FLOAT: + if (a->value.f[c0] < b->value.f[c1]) + foundless = true; + else if (a->value.f[c0] > b->value.f[c1]) + foundgreater = true; + else + foundequal = true; + break; + default: + unreachable("not reached"); + } + } + + if (foundless && foundgreater) { + /* Some components are strictly lower, others are strictly greater */ + return MIXED; + } + + if (foundequal) { + /* It is not mixed, but it is not strictly lower or greater */ + if (foundless) + return LESS_OR_EQUAL; + if (foundgreater) + return GREATER_OR_EQUAL; + return EQUAL; + } + + /* All components are strictly lower or strictly greater */ + return foundless ? LESS : GREATER; +} + +static ir_constant * +combine_constant(bool ismin, ir_constant *a, ir_constant *b) +{ + void *mem_ctx = ralloc_parent(a); + ir_constant *c = a->clone(mem_ctx, NULL); + for (unsigned i = 0; i < c->type->components(); i++) { + switch (c->type->base_type) { + case GLSL_TYPE_UINT: + if ((ismin && b->value.u[i] < c->value.u[i]) || + (!ismin && b->value.u[i] > c->value.u[i])) + c->value.u[i] = b->value.u[i]; + break; + case GLSL_TYPE_INT: + if ((ismin && b->value.i[i] < c->value.i[i]) || + (!ismin && b->value.i[i] > c->value.i[i])) + c->value.i[i] = b->value.i[i]; + break; + case GLSL_TYPE_FLOAT: + if ((ismin && b->value.f[i] < c->value.f[i]) || + (!ismin && b->value.f[i] > c->value.f[i])) + c->value.f[i] = b->value.f[i]; + break; + default: + assert(!"not reached"); + } + } + return c; +} + +static ir_constant * +smaller_constant(ir_constant *a, ir_constant *b) +{ + assert(a != NULL); + assert(b != NULL); + + enum compare_components_result ret = compare_components(a, b); + if (ret == MIXED) + return combine_constant(true, a, b); + else if (ret < EQUAL) + return a; + else + return b; +} + +static ir_constant * +larger_constant(ir_constant *a, ir_constant *b) +{ + assert(a != NULL); + assert(b != NULL); + + enum compare_components_result ret = compare_components(a, b); + if (ret == MIXED) + return combine_constant(false, a, b); + else if (ret < EQUAL) + return b; + else + return a; +} + +/* Combines two ranges by doing an element-wise min() / max() depending on the + * operation. + */ +static minmax_range +combine_range(minmax_range r0, minmax_range r1, bool ismin) +{ + minmax_range ret; + + if (!r0.low) { + ret.low = ismin ? r0.low : r1.low; + } else if (!r1.low) { + ret.low = ismin ? r1.low : r0.low; + } else { + ret.low = ismin ? smaller_constant(r0.low, r1.low) : + larger_constant(r0.low, r1.low); + } + + if (!r0.high) { + ret.high = ismin ? r1.high : r0.high; + } else if (!r1.high) { + ret.high = ismin ? r0.high : r1.high; + } else { + ret.high = ismin ? smaller_constant(r0.high, r1.high) : + larger_constant(r0.high, r1.high); + } + + return ret; +} + +/* Returns a range so that lower limit is the larger of the two lower limits, + * and higher limit is the smaller of the two higher limits. + */ +static minmax_range +range_intersection(minmax_range r0, minmax_range r1) +{ + minmax_range ret; + + if (!r0.low) + ret.low = r1.low; + else if (!r1.low) + ret.low = r0.low; + else + ret.low = larger_constant(r0.low, r1.low); + + if (!r0.high) + ret.high = r1.high; + else if (!r1.high) + ret.high = r0.high; + else + ret.high = smaller_constant(r0.high, r1.high); + + return ret; +} + +static minmax_range +get_range(ir_rvalue *rval) +{ + ir_expression *expr = rval->as_expression(); + if (expr && (expr->operation == ir_binop_min || + expr->operation == ir_binop_max)) { + minmax_range r0 = get_range(expr->operands[0]); + minmax_range r1 = get_range(expr->operands[1]); + return combine_range(r0, r1, expr->operation == ir_binop_min); + } + + ir_constant *c = rval->as_constant(); + if (c) { + return minmax_range(c, c); + } + + return minmax_range(); +} + +/** + * Prunes a min/max expression considering the base range of the parent + * min/max expression. + * + * @param baserange the range that the parents of this min/max expression + * in the min/max tree will clamp its value to. + */ +ir_rvalue * +ir_minmax_visitor::prune_expression(ir_expression *expr, minmax_range baserange) +{ + assert(expr->operation == ir_binop_min || + expr->operation == ir_binop_max); + + bool ismin = expr->operation == ir_binop_min; + minmax_range limits[2]; + + /* Recurse to get the ranges for each of the subtrees of this + * expression. We need to do this as a separate step because we need to + * know the ranges of each of the subtrees before we prune either one. + * Consider something like this: + * + * max + * / \ + * max max + * / \ / \ + * 3 a b 2 + * + * We would like to prune away the max on the bottom-right, but to do so + * we need to know the range of the expression on the left beforehand, + * and there's no guarantee that we will visit either subtree in a + * particular order. + */ + for (unsigned i = 0; i < 2; ++i) + limits[i] = get_range(expr->operands[i]); + + for (unsigned i = 0; i < 2; ++i) { + bool is_redundant = false; + + enum compare_components_result cr = LESS; + if (ismin) { + /* If this operand will always be greater than the other one, it's + * redundant. + */ + if (limits[i].low && limits[1 - i].high) { + cr = compare_components(limits[i].low, limits[1 - i].high); + if (cr >= EQUAL && cr != MIXED) + is_redundant = true; + } + /* If this operand is always greater than baserange, then even if + * it's smaller than the other one it'll get clamped, so it's + * redundant. + */ + if (!is_redundant && limits[i].low && baserange.high) { + cr = compare_components(limits[i].low, baserange.high); + if (cr >= EQUAL && cr != MIXED) + is_redundant = true; + } + } else { + /* If this operand will always be lower than the other one, it's + * redundant. + */ + if (limits[i].high && limits[1 - i].low) { + cr = compare_components(limits[i].high, limits[1 - i].low); + if (cr <= EQUAL) + is_redundant = true; + } + /* If this operand is always lower than baserange, then even if + * it's greater than the other one it'll get clamped, so it's + * redundant. + */ + if (!is_redundant && limits[i].high && baserange.low) { + cr = compare_components(limits[i].high, baserange.low); + if (cr <= EQUAL) + is_redundant = true; + } + } + + if (is_redundant) { + progress = true; + + /* Recurse if necessary. */ + ir_expression *op_expr = expr->operands[1 - i]->as_expression(); + if (op_expr && (op_expr->operation == ir_binop_min || + op_expr->operation == ir_binop_max)) { + return prune_expression(op_expr, baserange); + } + + return expr->operands[1 - i]; + } else if (cr == MIXED) { + /* If we have mixed vector operands, we can try to resolve the minmax + * expression by doing a component-wise minmax: + * + * min min + * / \ / \ + * min a ===> [1,1] a + * / \ + * [1,3] [3,1] + * + */ + ir_constant *a = expr->operands[0]->as_constant(); + ir_constant *b = expr->operands[1]->as_constant(); + if (a && b) + return combine_constant(ismin, a, b); + } + } + + /* Now recurse to operands giving them the proper baserange. The baserange + * to pass is the intersection of our baserange and the other operand's + * limit with one of the ranges unlimited. If we can't compute a valid + * intersection, we use the current baserange. + */ + for (unsigned i = 0; i < 2; ++i) { + ir_expression *op_expr = expr->operands[i]->as_expression(); + if (op_expr && (op_expr->operation == ir_binop_min || + op_expr->operation == ir_binop_max)) { + /* We can only compute a new baserange for this operand if we managed + * to compute a valid range for the other operand. + */ + if (ismin) + limits[1 - i].low = NULL; + else + limits[1 - i].high = NULL; + minmax_range base = range_intersection(limits[1 - i], baserange); + expr->operands[i] = prune_expression(op_expr, base); + } + } + + /* If we got here we could not discard any of the operands of the minmax + * expression, but we can still try to resolve the expression if both + * operands are constant. We do this after the loop above, to make sure + * that if our operands are minmax expressions we have tried to prune them + * first (hopefully reducing them to constants). + */ + ir_constant *a = expr->operands[0]->as_constant(); + ir_constant *b = expr->operands[1]->as_constant(); + if (a && b) + return combine_constant(ismin, a, b); + + return expr; +} + +static ir_rvalue * +swizzle_if_required(ir_expression *expr, ir_rvalue *rval) +{ + if (expr->type->is_vector() && rval->type->is_scalar()) { + return swizzle(rval, SWIZZLE_XXXX, expr->type->vector_elements); + } else { + return rval; + } +} + +void +ir_minmax_visitor::handle_rvalue(ir_rvalue **rvalue) +{ + if (!*rvalue) + return; + + ir_expression *expr = (*rvalue)->as_expression(); + if (!expr || (expr->operation != ir_binop_min && + expr->operation != ir_binop_max)) + return; + + ir_rvalue *new_rvalue = prune_expression(expr, minmax_range()); + if (new_rvalue == *rvalue) + return; + + /* If the expression type is a vector and the optimization leaves a scalar + * as the result, we need to turn it into a vector. + */ + *rvalue = swizzle_if_required(expr, new_rvalue); + + progress = true; +} + +} + +bool +do_minmax_prune(exec_list *instructions) +{ + ir_minmax_visitor v; + + visit_list_elements(&v, instructions); + + return v.progress; +} diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_rebalance_tree.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_rebalance_tree.cpp new file mode 100644 index 000000000..095f2d7d2 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/opt_rebalance_tree.cpp @@ -0,0 +1,321 @@ +/* + * Copyright © 2014 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file opt_rebalance_tree.cpp + * + * Rebalances a reduction expression tree. + * + * For reduction operations (e.g., x + y + z + w) we generate an expression + * tree like + * + * + + * / \ + * + w + * / \ + * + z + * / \ + * x y + * + * which we can rebalance into + * + * + + * / \ + * / \ + * + + + * / \ / \ + * x y z w + * + * to get a better instruction scheduling. + * + * See "Tree Rebalancing in Optimal Editor Time and Space" by Quentin F. Stout + * and Bette L. Warren. + * + * Also see http://penguin.ewu.edu/~trolfe/DSWpaper/ for a very readable + * explanation of the of the tree_to_vine() (rightward rotation) and + * vine_to_tree() (leftward rotation) algorithms. + */ + +#include "ir.h" +#include "ir_visitor.h" +#include "ir_rvalue_visitor.h" +#include "ir_optimization.h" +#include "main/macros.h" /* for MAX2 */ + +/* The DSW algorithm generates a degenerate tree (really, a linked list) in + * tree_to_vine(). We'd rather not leave a binary expression with only one + * operand, so trivial modifications (the ternary operators below) are needed + * to ensure that we only rotate around the ir_expression nodes of the tree. + */ +static unsigned +tree_to_vine(ir_expression *root) +{ + unsigned size = 0; + ir_rvalue *vine_tail = root; + ir_rvalue *remainder = root->operands[1]; + + while (remainder != NULL) { + ir_expression *remainder_temp = remainder->as_expression(); + ir_expression *remainder_left = remainder_temp ? + remainder_temp->operands[0]->as_expression() : NULL; + + if (remainder_left == NULL) { + /* move vine_tail down one */ + vine_tail = remainder; + remainder = remainder->as_expression() ? + ((ir_expression *)remainder)->operands[1] : NULL; + size++; + } else { + /* rotate */ + ir_expression *tempptr = remainder_left; + ((ir_expression *)remainder)->operands[0] = tempptr->operands[1]; + tempptr->operands[1] = remainder; + remainder = tempptr; + ((ir_expression *)vine_tail)->operands[1] = tempptr; + } + } + + return size; +} + +static void +compression(ir_expression *root, unsigned count) +{ + ir_expression *scanner = root; + + for (unsigned i = 0; i < count; i++) { + ir_expression *child = (ir_expression *)scanner->operands[1]; + scanner->operands[1] = child->operands[1]; + scanner = (ir_expression *)scanner->operands[1]; + child->operands[1] = scanner->operands[0]; + scanner->operands[0] = child; + } +} + +static void +vine_to_tree(ir_expression *root, unsigned size) +{ + int n = size - 1; + for (int m = n / 2; m > 0; m = n / 2) { + compression(root, m); + n -= m + 1; + } +} + +namespace { + +class ir_rebalance_visitor : public ir_rvalue_enter_visitor { +public: + ir_rebalance_visitor() + { + progress = false; + } + + void handle_rvalue(ir_rvalue **rvalue); + + bool progress; +}; + +struct is_reduction_data { + ir_expression_operation operation; + const glsl_type *type; + unsigned num_expr; + bool is_reduction; + bool contains_constant; +}; + +} /* anonymous namespace */ + +static bool +is_reduction_operation(ir_expression_operation operation) +{ + switch (operation) { + case ir_binop_add: + case ir_binop_mul: + case ir_binop_bit_and: + case ir_binop_bit_xor: + case ir_binop_bit_or: + case ir_binop_logic_and: + case ir_binop_logic_xor: + case ir_binop_logic_or: + case ir_binop_min: + case ir_binop_max: + return true; + default: + return false; + } +} + +/* Note that this function does not attempt to recognize that reduction trees + * are already balanced. + * + * We return false from this function for a number of reasons other than an + * expression tree not being a mathematical reduction. Namely, + * + * - if the tree contains multiple constants that we may be able to combine. + * - if the tree contains matrices: + * - they might contain vec4's with many constant components that we can + * simplify after splitting. + * - applying the matrix chain ordering optimization is more than just + * balancing an expression tree. + * - if the tree contains operations on multiple types. + * - if the tree contains ir_dereference_{array,record}, since foo[a+b] + c + * would trick the visiting pass. + */ +static void +is_reduction(ir_instruction *ir, void *data) +{ + struct is_reduction_data *ird = (struct is_reduction_data *)data; + if (!ird->is_reduction) + return; + + /* We don't want to balance a tree that contains multiple constants, since + * we'll be able to constant fold them if they're not in separate subtrees. + */ + if (ir->as_constant()) { + if (ird->contains_constant) { + ird->is_reduction = false; + } + ird->contains_constant = true; + return; + } + + /* Array/record dereferences have subtrees that are not part of the expr + * tree we're balancing. Skip trees containing them. + */ + if (ir->ir_type == ir_type_dereference_array || + ir->ir_type == ir_type_dereference_record) { + ird->is_reduction = false; + return; + } + + ir_expression *expr = ir->as_expression(); + if (!expr) + return; + + /* Non-constant matrices might still contain constant vec4 that we can + * constant fold once split up. Handling matrices will need some more + * work. + */ + if (expr->type->is_matrix() || + expr->operands[0]->type->is_matrix() || + (expr->operands[1] && expr->operands[1]->type->is_matrix())) { + ird->is_reduction = false; + return; + } + + if (ird->type != NULL && ird->type != expr->type) { + ird->is_reduction = false; + return; + } + ird->type = expr->type; + + ird->num_expr++; + if (is_reduction_operation(expr->operation)) { + if (ird->operation != 0 && ird->operation != expr->operation) + ird->is_reduction = false; + ird->operation = expr->operation; + } else { + ird->is_reduction = false; + } +} + +static ir_rvalue * +handle_expression(ir_expression *expr) +{ + struct is_reduction_data ird; + ird.operation = (ir_expression_operation)0; + ird.type = NULL; + ird.num_expr = 0; + ird.is_reduction = true; + ird.contains_constant = false; + + visit_tree(expr, is_reduction, (void *)&ird); + + if (ird.is_reduction && ird.num_expr > 2) { + ir_constant z = ir_constant(0.0f); + ir_expression pseudo_root = ir_expression(ir_binop_add, &z, expr); + + unsigned size = tree_to_vine(&pseudo_root); + vine_to_tree(&pseudo_root, size); + + expr = (ir_expression *)pseudo_root.operands[1]; + } + return expr; +} + +static void +update_types(ir_instruction *ir, void *) +{ + ir_expression *expr = ir->as_expression(); + if (!expr) + return; + + const glsl_type *const new_type = + glsl_type::get_instance(expr->type->base_type, + MAX2(expr->operands[0]->type->vector_elements, + expr->operands[1]->type->vector_elements), + 1); + assert(new_type != glsl_type::error_type); + expr->type = new_type; +} + +void +ir_rebalance_visitor::handle_rvalue(ir_rvalue **rvalue) +{ + if (!*rvalue) + return; + + ir_expression *expr = (*rvalue)->as_expression(); + if (!expr || !is_reduction_operation(expr->operation)) + return; + + ir_rvalue *new_rvalue = handle_expression(expr); + + /* If we failed to rebalance the tree (e.g., because it wasn't a reduction, + * or some other set of cases) new_rvalue will point to the same root as + * before. + * + * Similarly, if the tree rooted at *rvalue was a reduction and was already + * balanced, the algorithm will rearrange the tree but will ultimately + * return an identical tree, so this check will handle that as well and + * will not set progress = true. + */ + if (new_rvalue == *rvalue) + return; + + visit_tree(new_rvalue, NULL, NULL, update_types); + + *rvalue = new_rvalue; + this->progress = true; +} + +bool +do_rebalance_tree(exec_list *instructions) +{ + ir_rebalance_visitor v; + + v.run(instructions); + + return v.progress; +} diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_redundant_jumps.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_redundant_jumps.cpp index 8606dcbb7..ee384d0f2 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_redundant_jumps.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_redundant_jumps.cpp @@ -50,7 +50,7 @@ public: * into expressions. */ ir_visitor_status -redundant_jumps_visitor::visit_enter(ir_assignment *ir) +redundant_jumps_visitor::visit_enter(ir_assignment *) { return visit_continue_with_parent; } diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_structure_splitting.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_structure_splitting.cpp index 0ac16bc07..4d240a661 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_structure_splitting.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_structure_splitting.cpp @@ -107,8 +107,7 @@ ir_structure_reference_visitor::get_variable_entry(ir_variable *var) || var->data.mode == ir_var_shader_in || var->data.mode == ir_var_shader_out) return NULL; - foreach_list(n, &this->variable_list) { - variable_entry *entry = (variable_entry *) n; + foreach_in_list(variable_entry, entry, &this->variable_list) { if (entry->var == var) return entry; } @@ -209,8 +208,7 @@ ir_structure_splitting_visitor::get_splitting_entry(ir_variable *var) if (!var->type->is_record()) return NULL; - foreach_list(n, this->variable_list) { - variable_entry *entry = (variable_entry *) n; + foreach_in_list(variable_entry, entry, this->variable_list) { if (entry->var == var) { return entry; } @@ -315,9 +313,7 @@ do_structure_splitting(exec_list *instructions) visit_list_elements(&refs, instructions); /* Trim out variables we can't split. */ - foreach_list_safe(n, &refs.variable_list) { - variable_entry *entry = (variable_entry *) n; - + foreach_in_list_safe(variable_entry, entry, &refs.variable_list) { if (debug) { printf("structure %s@%p: decl %d, whole_access %d\n", entry->var->name, (void *) entry->var, entry->declaration, @@ -337,8 +333,7 @@ do_structure_splitting(exec_list *instructions) /* Replace the decls of the structures to be split with their split * components. */ - foreach_list_safe(n, &refs.variable_list) { - variable_entry *entry = (variable_entry *) n; + foreach_in_list_safe(variable_entry, entry, &refs.variable_list) { const struct glsl_type *type = entry->var->type; entry->mem_ctx = ralloc_parent(entry->var); diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_tree_grafting.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_tree_grafting.cpp index 775e8fb81..ddaab7609 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_tree_grafting.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_tree_grafting.cpp @@ -133,12 +133,12 @@ ir_tree_grafting_visitor::do_graft(ir_rvalue **rvalue) return false; if (debug) { - printf("GRAFTING:\n"); - this->graft_assign->print(); - printf("\n"); - printf("TO:\n"); - (*rvalue)->print(); - printf("\n"); + fprintf(stderr, "GRAFTING:\n"); + this->graft_assign->fprint(stderr); + fprintf(stderr, "\n"); + fprintf(stderr, "TO:\n"); + (*rvalue)->fprint(stderr); + fprintf(stderr, "\n"); } this->graft_assign->remove(); @@ -170,9 +170,9 @@ ir_tree_grafting_visitor::check_graft(ir_instruction *ir, ir_variable *var) { if (dereferences_variable(this->graft_assign->rhs, var)) { if (debug) { - printf("graft killed by: "); - ir->print(); - printf("\n"); + fprintf(stderr, "graft killed by: "); + ir->fprint(stderr); + fprintf(stderr, "\n"); } return visit_stop; } @@ -329,9 +329,9 @@ try_tree_grafting(ir_assignment *start, ir_tree_grafting_visitor v(start, lhs_var); if (debug) { - printf("trying to graft: "); - lhs_var->print(); - printf("\n"); + fprintf(stderr, "trying to graft: "); + lhs_var->fprint(stderr); + fprintf(stderr, "\n"); } for (ir_instruction *ir = (ir_instruction *)start->next; @@ -339,9 +339,9 @@ try_tree_grafting(ir_assignment *start, ir = (ir_instruction *)ir->next) { if (debug) { - printf("- "); - ir->print(); - printf("\n"); + fprintf(stderr, "- "); + ir->fprint(stderr); + fprintf(stderr, "\n"); } ir_visitor_status s = ir->accept(&v); diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_vector_splitting.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_vector_splitting.cpp new file mode 100644 index 000000000..978d429a5 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/opt_vector_splitting.cpp @@ -0,0 +1,485 @@ +/* + * Based on work Copyright © 2010 Intel Corporation, vector splitting + * implemented by Copyright © 2014 Unity Technologies + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file opt_vector_splitting.cpp + * + * If a vector is always dereferenced only by its xyzw components separately, + * and never accessed as a whole (or with swizzle mask with >1 bits set), then + * split it apart into its elements, making it more amenable to other + * optimization passes. + * + * This skips uniforms/varyings, which would need careful + * handling due to their ir->location fields tying them to the GL API + * and other shader stages. + */ + +#include "ir.h" +#include "ir_visitor.h" +#include "ir_rvalue_visitor.h" +#include "glsl_types.h" +#include "ir_optimization.h" +#include "loop_analysis.h" + +static bool debug = false; + +namespace { + namespace opt_vector_splitting { + + class variable_entry : public exec_node + { + public: + variable_entry(ir_variable *var) + { + this->var = var; + this->split = true; + this->use_mask = 0; + this->declaration = false; + this->components = NULL; + this->mem_ctx = NULL; + } + + ir_variable *var; /* The key: the variable's pointer. */ + + /** Whether this array should be split or not. */ + bool split; + + /** bitmask for the components in the vector that actually get written to. + * If multiple slots are written simultaneously, split gets set to false.*/ + int use_mask; + + /* If the variable had a decl we can work with in the instruction + * stream. We can't do splitting on function arguments, which + * don't get this variable set. + */ + bool declaration; + + ir_variable **components; + + /** ralloc_parent(this->var) -- the shader's talloc context. */ + void *mem_ctx; + }; + + } /* namespace */ + + +using namespace opt_vector_splitting; + +/** + * This class does a walk over the tree, coming up with the set of + * variables that could be split by looking to see if they are arrays + * that are only ever constant-index dereferenced. + */ +class ir_vector_reference_visitor : public ir_hierarchical_visitor { +public: + ir_vector_reference_visitor(void) + { + this->mem_ctx = ralloc_context(NULL); + this->variable_list.make_empty(); + } + + ~ir_vector_reference_visitor(void) + { + ralloc_free(mem_ctx); + } + + bool get_split_list(exec_list *instructions, bool linked, glsl_vector_splitting_mode mode); + + virtual ir_visitor_status visit(ir_variable *); + virtual ir_visitor_status visit(ir_dereference_variable *); + virtual ir_visitor_status visit_enter(ir_swizzle *); + virtual ir_visitor_status visit_enter(ir_assignment *); + virtual ir_visitor_status visit_enter(ir_function_signature *); + + variable_entry *get_variable_entry(ir_variable *var); + + /* List of variable_entry */ + exec_list variable_list; + + /* Current split mode */ + glsl_vector_splitting_mode mode; + + loop_state *loopstate; + + void *mem_ctx; +}; + +} /* namespace */ + +variable_entry * +ir_vector_reference_visitor::get_variable_entry(ir_variable *var) +{ + assert(var); + + if (var->data.mode != ir_var_auto && + var->data.mode != ir_var_temporary) + return NULL; + + if (!var->type->is_vector()) + return NULL; + + // If mode is loop_inductors, allow only loop inductors to be stored. + if (mode == OPT_SPLIT_ONLY_LOOP_INDUCTORS && loopstate) + { + loop_variable_state* inductor_state = loopstate->get_for_inductor(var); + if (!inductor_state) + { + return NULL; + } + } + + foreach_in_list(variable_entry, entry, &this->variable_list) { + if (entry->var == var) + return entry; + } + + + variable_entry *entry = new(mem_ctx) variable_entry(var); + this->variable_list.push_tail(entry); + return entry; +} + + +ir_visitor_status +ir_vector_reference_visitor::visit(ir_variable *ir) +{ + variable_entry *entry = this->get_variable_entry(ir); + + if (entry) + entry->declaration = true; + + return visit_continue; +} + +ir_visitor_status +ir_vector_reference_visitor::visit(ir_dereference_variable *ir) +{ + variable_entry *entry = this->get_variable_entry(ir->var); + + /* If we made it to here without seeing an ir_swizzle, + * then the dereference of this vector didn't have a swizzle in it + * (see the visit_continue_with_parent below), so we can't split + * the variable. + */ + if (entry) + entry->split = false; + + return visit_continue; +} + +ir_visitor_status +ir_vector_reference_visitor::visit_enter(ir_swizzle *ir) +{ + ir_variable *var = ir->variable_referenced(); + if (!var) + return visit_continue; + + variable_entry *entry = this->get_variable_entry(var); + + if (entry) + { + if (ir->mask.num_components > 1) + { + entry->split = false; + } + else + { + // Update the usemask + entry->use_mask |= (1 << ir->mask.x); + } + } + + // Skip the rest of the swizzle IR tree, we're done here. + return visit_continue_with_parent; +} + +ir_visitor_status +ir_vector_reference_visitor::visit_enter(ir_assignment *ir) +{ + ir_dereference_variable *dest = ir->lhs->as_dereference_variable(); + if (dest) + { + variable_entry *entry = this->get_variable_entry(dest->var); + if (entry) + { + // Count how many bits the write mask has + unsigned maskbitval = ir->write_mask; // count the number of bits set + int maskbitcount; // accumulates the total bits set + for ( maskbitcount = 0; maskbitval; maskbitcount++) + { + maskbitval &= maskbitval - 1; // clear the least significant bit set + } + if (maskbitcount > 1) + { + // Writing to more than one slot, cannot split. + entry->split = false; + } + + // Update write mask + entry->use_mask |= ir->write_mask; + } + } + + // Visit only the rhs, there may be swizzles and variable dereferences there as well + ir->rhs->accept(this); + return visit_continue_with_parent; + +} + +ir_visitor_status +ir_vector_reference_visitor::visit_enter(ir_function_signature *ir) +{ + /* We don't have logic for array-splitting function arguments, + * so just look at the body instructions and not the parameter + * declarations. + */ + visit_list_elements(this, &ir->body); + return visit_continue_with_parent; +} + +bool +ir_vector_reference_visitor::get_split_list(exec_list *instructions, + bool linked, + glsl_vector_splitting_mode _mode) +{ + mode = _mode; + + if (linked) + { + loop_state* ls = analyze_loop_variables(instructions); + if (ls->loop_found) + set_loop_controls(instructions, ls); + + loopstate = ls; + } + else + { + loopstate = NULL; + } + + visit_list_elements(this, instructions); + + /* If the shaders aren't linked yet, we can't mess with global + * declarations, which need to be matched by name across shaders. + */ + if (!linked) { + foreach_in_list(ir_variable, var, instructions) { + if (var) { + variable_entry *entry = get_variable_entry(var); + if (entry) + entry->remove(); + } + } + } + + /* Trim out variables we found that we can't split. */ + foreach_in_list_safe(variable_entry, entry, &variable_list) { + + if (debug) { + printf("array %s@%p: decl %d, split %d\n", + entry->var->name, (void *) entry->var, entry->declaration, + entry->split); + } + + if (!(entry->declaration && entry->split)) { + entry->remove(); + } + else if (mode == OPT_SPLIT_ONLY_UNUSED) + { + /* Build mask of fully used vector (vec2 -> 0x3, vec3 -> 0x7, vec4 -> 0xe) */ + unsigned int fullmask = (1 << entry->var->type->vector_elements) - 1; + if (entry->use_mask == fullmask) + { + entry->remove(); + } + } + } + + return !variable_list.is_empty(); +} + +/** + * This class rewrites the dereferences of arrays that have been split + * to use the newly created ir_variables for each component. + */ +class ir_vector_splitting_visitor : public ir_rvalue_visitor { +public: + ir_vector_splitting_visitor(exec_list *vars) + { + this->variable_list = vars; + } + + virtual ~ir_vector_splitting_visitor() + { + } + + virtual ir_visitor_status visit_leave(ir_assignment *); + + void split_rvalue(ir_rvalue **rval); + void handle_rvalue(ir_rvalue **rvalue); + variable_entry *get_splitting_entry(ir_variable *var); + + exec_list *variable_list; +}; + +variable_entry * +ir_vector_splitting_visitor::get_splitting_entry(ir_variable *var) +{ + assert(var); + + foreach_in_list(variable_entry, entry, this->variable_list) { + if (entry->var == var) { + return entry; + } + } + + return NULL; +} + +void +ir_vector_splitting_visitor::split_rvalue(ir_rvalue **rval) +{ + ir_swizzle *swizzle = (*rval)->as_swizzle(); + + if (!swizzle) + return; + + ir_variable *var = swizzle->variable_referenced(); + if (!var) + return; + + variable_entry *entry = get_splitting_entry(var); + if (!entry) + return; + + assert(swizzle->mask.num_components == 1); + + *rval = new(entry->mem_ctx) + ir_dereference_variable(entry->components[swizzle->mask.x]); +} + +void +ir_vector_splitting_visitor::handle_rvalue(ir_rvalue **rvalue) +{ + if (!*rvalue) + return; + + ir_rvalue *v = *rvalue; + split_rvalue(&v); + *rvalue = v; +} + +ir_visitor_status +ir_vector_splitting_visitor::visit_leave(ir_assignment *ir) +{ + /* The normal rvalue visitor skips the LHS of assignments, but we + * need to process those just the same. + */ + ir_rvalue *lhs = ir->lhs; + + ir_dereference_variable *dest = ir->lhs->as_dereference_variable(); + if (dest) + { + variable_entry *entry = get_splitting_entry(dest->var); + if (entry) + { + // Find the only set bit in writemask + int component = 0; + while (((ir->write_mask & (1 << component)) == 0) && (component < 4)) + { + component++; + } + assert(ir->write_mask == (1 << component)); + + ir_dereference_variable *newderef = new(entry->mem_ctx) + ir_dereference_variable(entry->components[component]); + + ir->set_lhs(newderef); + } + } + else + { + ir->lhs = lhs->as_dereference(); + ir->lhs->accept(this); + } + + handle_rvalue(&ir->rhs); + ir->rhs->accept(this); + + if (ir->condition) { + handle_rvalue(&ir->condition); + ir->condition->accept(this); + } + + return visit_continue; +} + +bool +optimize_split_vectors(exec_list *instructions, bool linked, glsl_vector_splitting_mode mode) +{ + ir_vector_reference_visitor refs; + if (!refs.get_split_list(instructions, linked, mode)) + return false; + + void *mem_ctx = ralloc_context(NULL); + + /* Replace the decls of the vectors to be split with their split + * components. + */ + foreach_in_list(variable_entry, entry, &refs.variable_list) { + const struct glsl_type *type = entry->var->type; + const struct glsl_type *subtype; + glsl_precision subprec = (glsl_precision)entry->var->data.precision; + + subtype = type->get_base_type(); + + entry->mem_ctx = ralloc_parent(entry->var); + + entry->components = ralloc_array(mem_ctx, + ir_variable *, + type->vector_elements); + + for (unsigned int i = 0; i < type->vector_elements; i++) { + const char *name = ralloc_asprintf(mem_ctx, "%s_%c", + entry->var->name, "xyzw"[i]); + + entry->components[i] = + new(entry->mem_ctx) ir_variable(subtype, name, ir_var_temporary, subprec); + entry->var->insert_before(entry->components[i]); + } + + entry->var->remove(); + } + + ir_vector_splitting_visitor split(&refs.variable_list); + visit_list_elements(&split, instructions); + + if (debug) + _mesa_print_ir(stdout, instructions, NULL); + + ralloc_free(mem_ctx); + + return true; + +} diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_vectorize.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_vectorize.cpp index 4647d72f4..1973d0725 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_vectorize.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_vectorize.cpp @@ -86,6 +86,7 @@ public: virtual ir_visitor_status visit_enter(ir_expression *); virtual ir_visitor_status visit_enter(ir_if *); virtual ir_visitor_status visit_enter(ir_loop *); + virtual ir_visitor_status visit_enter(ir_texture *); virtual ir_visitor_status visit_leave(ir_assignment *); @@ -226,10 +227,9 @@ write_mask_to_swizzle(unsigned write_mask) case WRITEMASK_X: return SWIZZLE_X; case WRITEMASK_Y: return SWIZZLE_Y; case WRITEMASK_Z: return SWIZZLE_Z; - case WRITEMASK_W: return SWIZZLE_W; + case WRITEMASK_W: break; } - assert(!"not reached"); - unreachable(); + return SWIZZLE_W; } /** @@ -261,6 +261,7 @@ ir_vectorize_visitor::visit_enter(ir_assignment *ir) if (ir->condition || this->channels >= 4 || !single_channel_write_mask(ir->write_mask) || + this->assignment[write_mask_to_swizzle(ir->write_mask)] != NULL || (lhs && !ir->lhs->equals(lhs)) || (rhs && !ir->rhs->equals(rhs, ir_type_swizzle))) { try_vectorize(); @@ -292,20 +293,6 @@ ir_vectorize_visitor::visit_enter(ir_swizzle *ir) return visit_continue; } -/* Upon entering an ir_binop_dot, remove the current assignment from - * further consideration. Dot product is "horizontal" instruction - * that we can't vectorize. - */ -ir_visitor_status -ir_vectorize_visitor::visit_enter(ir_expression *ir) -{ - if (ir->operation == ir_binop_dot) { - this->current_assignment = NULL; - return visit_continue_with_parent; - } - return visit_continue; -} - /* Upon entering an ir_array_dereference, remove the current assignment from * further consideration. Since the index of an array dereference must scalar, * we are not able to vectorize it. @@ -313,12 +300,26 @@ ir_vectorize_visitor::visit_enter(ir_expression *ir) * FINISHME: If all of scalar indices are identical we could vectorize. */ ir_visitor_status -ir_vectorize_visitor::visit_enter(ir_dereference_array *ir) +ir_vectorize_visitor::visit_enter(ir_dereference_array *) { this->current_assignment = NULL; return visit_continue_with_parent; } +/** + * Upon entering an ir_expression, remove the current assignment from further + * consideration if the expression operates horizontally on vectors. + */ +ir_visitor_status +ir_vectorize_visitor::visit_enter(ir_expression *ir) +{ + if (ir->is_horizontal()) { + this->current_assignment = NULL; + return visit_continue_with_parent; + } + return visit_continue; +} + /* Since there is no statement to visit between the "then" and "else" * instructions try to vectorize before, in between, and after them to avoid * combining statements from different basic blocks. @@ -352,6 +353,18 @@ ir_vectorize_visitor::visit_enter(ir_loop *ir) return visit_continue_with_parent; } +/** + * Upon entering an ir_texture, remove the current assignment from + * further consideration. Vectorizing multiple texture lookups into one + * is wrong. + */ +ir_visitor_status +ir_vectorize_visitor::visit_enter(ir_texture *) +{ + this->current_assignment = NULL; + return visit_continue_with_parent; +} + /** * Upon leaving an ir_assignment, save a pointer to it in ::assignment[] if * the swizzle mask(s) found were appropriate. Also save a pointer in diff --git a/3rdparty/glsl-optimizer/src/glsl/s_expression.cpp b/3rdparty/glsl-optimizer/src/glsl/s_expression.cpp index cc4ca6ce8..24d4af298 100644 --- a/3rdparty/glsl-optimizer/src/glsl/s_expression.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/s_expression.cpp @@ -162,8 +162,7 @@ void s_symbol::print() void s_list::print() { printf("("); - foreach_list(n, &this->subexpressions) { - s_expression *expr = (s_expression *) n; + foreach_in_list(s_expression, expr, &this->subexpressions) { expr->print(); if (!expr->next->is_tail_sentinel()) printf(" "); @@ -201,11 +200,10 @@ s_match(s_expression *top, unsigned n, s_pattern *pattern, bool partial) return false; unsigned i = 0; - foreach_list(node, &list->subexpressions) { + foreach_in_list(s_expression, expr, &list->subexpressions) { if (i >= n) return partial; /* More actual items than the pattern expected */ - s_expression *expr = (s_expression *) node; if (expr == NULL || !pattern[i].match(expr)) return false; diff --git a/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.cpp b/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.cpp index 6c25010b7..6e7381193 100644 --- a/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.cpp @@ -31,25 +31,9 @@ #include #include -#include "ralloc.h" +#include +#include "util/ralloc.h" -void -_mesa_warning(struct gl_context *ctx, const char *fmt, ...) -{ - va_list vargs; - (void) ctx; - - va_start(vargs, fmt); - - /* This output is not thread-safe, but that's good enough for the - * standalone compiler. - */ - fprintf(stderr, "Mesa warning: "); - vfprintf(stderr, fmt, vargs); - fprintf(stderr, "\n"); - - va_end(vargs); -} void _mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr, @@ -65,6 +49,12 @@ _mesa_shader_debug(struct gl_context *, GLenum, GLuint *id, { } +extern "C" void +_mesa_error_no_memory(const char *caller) +{ +} + + struct gl_shader * _mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type) { @@ -98,6 +88,7 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api) ctx->Extensions.ARB_ES3_compatibility = true; ctx->Extensions.ARB_explicit_attrib_location = true; ctx->Extensions.ARB_fragment_coord_conventions = true; + ctx->Extensions.ARB_fragment_layer_viewport = true; ctx->Extensions.ARB_gpu_shader5 = true; ctx->Extensions.ARB_sample_shading = true; ctx->Extensions.ARB_shader_bit_encoding = true; @@ -119,6 +110,7 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api) ctx->Extensions.EXT_shader_integer_mix = true; ctx->Extensions.EXT_texture3D = true; ctx->Extensions.EXT_texture_array = true; + ctx->Extensions.EXT_draw_buffers = true; ctx->Extensions.NV_texture_rectangle = true; @@ -156,12 +148,12 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api) /* Set up default shader compiler options. */ struct gl_shader_compiler_options options; memset(&options, 0, sizeof(options)); - options.MaxUnrollIterations = 32; + options.MaxUnrollIterations = 8; options.MaxIfDepth = UINT_MAX; /* Default pragma settings */ options.DefaultPragmas.Optimize = true; for (int sh = 0; sh < MESA_SHADER_STAGES; ++sh) - memcpy(&ctx->ShaderCompilerOptions[sh], &options, sizeof(options)); + memcpy(&ctx->Const.ShaderCompilerOptions[sh], &options, sizeof(options)); } diff --git a/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.h b/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.h index df783afdb..f0f9d872e 100644 --- a/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.h +++ b/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.h @@ -34,9 +34,6 @@ #include #include "main/mtypes.h" -extern "C" void -_mesa_warning(struct gl_context *ctx, const char *fmtString, ... ); - extern "C" void _mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr, struct gl_shader *sh); diff --git a/3rdparty/glsl-optimizer/src/glsl_optimizer_lib.gyp b/3rdparty/glsl-optimizer/src/glsl_optimizer_lib.gyp index 8ac3a416c..bc318c5eb 100644 --- a/3rdparty/glsl-optimizer/src/glsl_optimizer_lib.gyp +++ b/3rdparty/glsl-optimizer/src/glsl_optimizer_lib.gyp @@ -29,7 +29,8 @@ 'glsl/ast_to_hir.cpp', 'glsl/ast_type.cpp', 'glsl/builtin_functions.cpp', - 'glsl/builtin_types.h', + 'glsl/builtin_types.cpp', + 'glsl/builtin_type_macros.h', 'glsl/builtin_variables.cpp', 'glsl/glsl_lexer.cpp', 'glsl/glsl_optimizer.cpp', @@ -45,6 +46,8 @@ 'glsl/hir_field_selection.cpp', 'glsl/ir.cpp', 'glsl/ir.h', + 'glsl/ir_stats.h', + 'glsl/ir_stats.cpp', 'glsl/ir_basic_block.cpp', 'glsl/ir_basic_block.h', 'glsl/ir_builder.cpp', @@ -65,6 +68,8 @@ 'glsl/ir_optimization.h', 'glsl/ir_print_glsl_visitor.cpp', 'glsl/ir_print_glsl_visitor.h', + 'glsl/ir_print_metal_visitor.cpp', + 'glsl/ir_print_metal_visitor.h', 'glsl/ir_print_visitor.cpp', 'glsl/ir_print_visitor.h', 'glsl/ir_rvalue_visitor.cpp', @@ -78,6 +83,7 @@ 'glsl/ir_visitor.h', 'glsl/link_atomics.cpp', 'glsl/link_functions.cpp', + 'glsl/link_interface_blocks.cpp', 'glsl/link_uniform_block_active_visitor.cpp', 'glsl/link_uniform_block_active_visitor.h', 'glsl/link_uniform_blocks.cpp', @@ -106,6 +112,8 @@ 'glsl/lower_vec_index_to_cond_assign.cpp', 'glsl/lower_vec_index_to_swizzle.cpp', 'glsl/lower_vector.cpp', + 'glsl/lower_vector_insert.cpp', + 'glsl/lower_named_interface_blocks.cpp', 'glsl/opt_algebraic.cpp', 'glsl/opt_array_splitting.cpp', 'glsl/opt_constant_folding.cpp', @@ -126,6 +134,9 @@ 'glsl/opt_swizzle_swizzle.cpp', 'glsl/opt_tree_grafting.cpp', 'glsl/opt_vectorize.cpp', + 'glsl/opt_vector_splitting.cpp', + 'glsl/opt_flip_matrices.cpp', + 'glsl/opt_dead_builtin_varyings.cpp', 'glsl/program.h', 'glsl/ralloc.c', 'glsl/ralloc.h', diff --git a/3rdparty/glsl-optimizer/src/mesa/main/.gitignore b/3rdparty/glsl-optimizer/src/mesa/main/.gitignore index 837f49036..fec06291a 100644 --- a/3rdparty/glsl-optimizer/src/mesa/main/.gitignore +++ b/3rdparty/glsl-optimizer/src/mesa/main/.gitignore @@ -8,3 +8,4 @@ git_sha1.h.tmp remap_helper.h get_hash.h get_hash.h.tmp +format_info.c diff --git a/3rdparty/glsl-optimizer/src/mesa/main/compiler.h b/3rdparty/glsl-optimizer/src/mesa/main/compiler.h index 97075f58e..34671dc7e 100644 --- a/3rdparty/glsl-optimizer/src/mesa/main/compiler.h +++ b/3rdparty/glsl-optimizer/src/mesa/main/compiler.h @@ -44,6 +44,8 @@ #include #include +#include "util/macros.h" + #include "c99_compat.h" /* inline, __func__, etc. */ @@ -130,23 +132,6 @@ extern "C" { #endif -/** - * __builtin_expect macros - */ -#if !defined(__GNUC__) -# define __builtin_expect(x, y) (x) -#endif - -#ifndef likely -# ifdef __GNUC__ -# define likely(x) __builtin_expect(!!(x), 1) -# define unlikely(x) __builtin_expect(!!(x), 0) -# else -# define likely(x) (x) -# define unlikely(x) (x) -# endif -#endif - /* XXX: Use standard `__func__` instead */ #ifndef __FUNCTION__ # define __FUNCTION__ __func__ @@ -165,8 +150,8 @@ extern "C" { #elif defined(__APPLE__) #include #define CPU_TO_LE32( x ) CFSwapInt32HostToLittle( x ) -#elif (defined(_AIX) || defined(__blrts)) -static INLINE GLuint CPU_TO_LE32(GLuint x) +#elif (defined(_AIX)) +static inline GLuint CPU_TO_LE32(GLuint x) { return (((x & 0x000000ff) << 24) | ((x & 0x0000ff00) << 8) | @@ -229,60 +214,23 @@ static INLINE GLuint CPU_TO_LE32(GLuint x) /** * ASSERT macro */ -#if !defined(_WIN32_WCE) #if defined(DEBUG) # define ASSERT(X) assert(X) #else # define ASSERT(X) #endif -#endif -/** - * Static (compile-time) assertion. - * Basically, use COND to dimension an array. If COND is false/zero the - * array size will be -1 and we'll get a compilation error. +/* + * A trick to suppress uninitialized variable warning without generating any + * code */ -#define STATIC_ASSERT(COND) \ - do { \ - (void) sizeof(char [1 - 2*!(COND)]); \ - } while (0) - -/** - * Unreachable macro. Useful for suppressing "control reaches end of non-void - * function" warnings. - */ -#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 5 -#define unreachable() __builtin_unreachable() -#elif (defined(__clang__) && defined(__has_builtin)) -# if __has_builtin(__builtin_unreachable) -# define unreachable() __builtin_unreachable() -# endif -#endif - -#ifndef unreachable -#define unreachable() -#endif - -#if (__GNUC__ >= 3) -#define PRINTFLIKE(f, a) __attribute__ ((format(__printf__, f, a))) -#else -#define PRINTFLIKE(f, a) -#endif +#define uninitialized_var(x) x = x #ifndef NULL #define NULL 0 #endif -/* Used to optionally mark structures with misaligned elements or size as - * packed, to trade off performance for space. - */ -#if (__GNUC__ >= 3) -#define PACKED __attribute__((__packed__)) -#else -#define PACKED -#endif - /** * LONGSTRING macro @@ -315,25 +263,7 @@ static INLINE GLuint CPU_TO_LE32(GLuint x) #define FLT_MAX_EXP 128 #endif - -/** - * USE_IEEE: Determine if we're using IEEE floating point - */ -#if defined(__i386__) || defined(__386__) || defined(__sparc__) || \ - defined(__s390__) || defined(__s390x__) || defined(__powerpc__) || \ - defined(__x86_64__) || \ - defined(__m68k__) || \ - defined(ia64) || defined(__ia64__) || \ - defined(__hppa__) || defined(hpux) || \ - defined(__mips) || defined(_MIPS_ARCH) || \ - defined(__arm__) || defined(__aarch64__) || \ - defined(__sh__) || defined(__m32r__) || \ - (defined(__sun) && defined(_IEEE_754)) || \ - defined(__alpha__) -#define USE_IEEE #define IEEE_ONE 0x3f800000 -#endif - /** * START/END_FAST_MATH macros: @@ -418,30 +348,6 @@ do { \ #define Elements(x) (sizeof(x)/sizeof(*(x))) #endif -#ifdef __cplusplus -/** - * Macro function that evaluates to true if T is a trivially - * destructible type -- that is, if its (non-virtual) destructor - * performs no action and all member variables and base classes are - * trivially destructible themselves. - */ -# if defined(__GNUC__) -# if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))) -# define HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T) -# endif -# elif (defined(__clang__) && defined(__has_feature)) -# if __has_feature(has_trivial_destructor) -# define HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T) -# endif -# endif -# ifndef HAS_TRIVIAL_DESTRUCTOR - /* It's always safe (if inefficient) to assume that a - * destructor is non-trivial. - */ -# define HAS_TRIVIAL_DESTRUCTOR(T) (false) -# endif -#endif - #ifdef __cplusplus } #endif diff --git a/3rdparty/glsl-optimizer/src/mesa/main/config.h b/3rdparty/glsl-optimizer/src/mesa/main/config.h index 30da5d422..4ec4b7502 100644 --- a/3rdparty/glsl-optimizer/src/mesa/main/config.h +++ b/3rdparty/glsl-optimizer/src/mesa/main/config.h @@ -281,6 +281,25 @@ #define MAX_VERTEX_STREAMS 4 /*@}*/ +/** For GL_INTEL_performance_query */ +/*@{*/ +#define MAX_PERFQUERY_QUERY_NAME_LENGTH 256 +#define MAX_PERFQUERY_COUNTER_NAME_LENGTH 256 +#define MAX_PERFQUERY_COUNTER_DESC_LENGTH 1024 +#define PERFQUERY_HAVE_GPA_EXTENDED_COUNTERS 0 +/*@}*/ + +/** For GL_ARB_compute_shader */ +/*@{*/ +#define MAX_COMPUTE_UNIFORM_BLOCKS 12 +#define MAX_COMPUTE_TEXTURE_IMAGE_UNITS 16 +#define MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 8 +#define MAX_COMPUTE_ATOMIC_COUNTERS 8 +#define MAX_COMPUTE_SHARED_MEMORY_SIZE 32768 +#define MAX_COMPUTE_UNIFORM_COMPONENTS 512 +#define MAX_COMPUTE_IMAGE_UNIFORMS 8 +/*@}*/ + /* * Color channel component order * diff --git a/3rdparty/glsl-optimizer/src/mesa/main/dd.h b/3rdparty/glsl-optimizer/src/mesa/main/dd.h index ea80e6b1d..3f60b182c 100644 --- a/3rdparty/glsl-optimizer/src/mesa/main/dd.h +++ b/3rdparty/glsl-optimizer/src/mesa/main/dd.h @@ -41,7 +41,6 @@ struct gl_shader; struct dd_function_table { - /** * \name GLSL-related functions (ARB extensions and OpenGL 2.x) diff --git a/3rdparty/glsl-optimizer/src/mesa/main/errors.h b/3rdparty/glsl-optimizer/src/mesa/main/errors.h new file mode 100644 index 000000000..2cb750532 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/mesa/main/errors.h @@ -0,0 +1,53 @@ +/* + * Mesa 3-D graphics library + * + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + +/** + * \file errors.h + * Mesa debugging and error handling functions. + * + * This file provides functions to record errors, warnings, and miscellaneous + * debug information. + */ + + +#ifndef ERRORS_H +#define ERRORS_H + + + +#ifdef __cplusplus +extern "C" { +#endif + +extern void +_mesa_error_no_memory(const char *caller); + + +#ifdef __cplusplus +} +#endif + + +#endif /* ERRORS_H */ diff --git a/3rdparty/glsl-optimizer/src/mesa/main/glminimal.h b/3rdparty/glsl-optimizer/src/mesa/main/glminimal.h index a989b228d..53803e2b1 100644 --- a/3rdparty/glsl-optimizer/src/mesa/main/glminimal.h +++ b/3rdparty/glsl-optimizer/src/mesa/main/glminimal.h @@ -473,5 +473,7 @@ typedef uint64_t GLuint64; #define GL_RGBA16 0x805B +#define GL_INVALID_INDEX 0xFFFFFFFF + #endif /* __gl_h_ */ diff --git a/3rdparty/glsl-optimizer/src/mesa/main/imports.c b/3rdparty/glsl-optimizer/src/mesa/main/imports.c index 53b4af523..300c8f327 100644 --- a/3rdparty/glsl-optimizer/src/mesa/main/imports.c +++ b/3rdparty/glsl-optimizer/src/mesa/main/imports.c @@ -45,8 +45,6 @@ #include "imports.h" -#include "context.h" -#include "mtypes.h" #ifdef _GNU_SOURCE #include @@ -208,20 +206,6 @@ _mesa_align_realloc(void *oldBuffer, size_t oldSize, size_t newSize, #endif } - - -/** Reallocate memory */ -void * -_mesa_realloc(void *oldBuffer, size_t oldSize, size_t newSize) -{ - const size_t copySize = (oldSize < newSize) ? oldSize : newSize; - void *newBuffer = malloc(newSize); - if (newBuffer && oldBuffer && copySize > 0) - memcpy(newBuffer, oldBuffer, copySize); - free(oldBuffer); - return newBuffer; -} - /*@}*/ @@ -230,7 +214,7 @@ _mesa_realloc(void *oldBuffer, size_t oldSize, size_t newSize) /*@{*/ -#ifndef __GNUC__ +#ifndef HAVE___BUILTIN_FFS /** * Find the first bit set in a word. */ @@ -259,8 +243,9 @@ ffs(int i) } return bit; } +#endif - +#ifndef HAVE___BUILTIN_FFSLL /** * Find position of first bit set in given value. * XXX Warning: this function can only be used on 64-bit systems! @@ -284,11 +269,10 @@ ffsll(long long int val) return 0; } -#endif /* __GNUC__ */ +#endif -#if !defined(__GNUC__) ||\ - ((__GNUC__ * 100 + __GNUC_MINOR__) < 304) /* Not gcc 3.4 or later */ +#ifndef HAVE___BUILTIN_POPCOUNT /** * Return number of bits set in given GLuint. */ @@ -301,7 +285,9 @@ _mesa_bitcount(unsigned int n) } return bits; } +#endif +#ifndef HAVE___BUILTIN_POPCOUNTLL /** * Return number of bits set in given 64-bit uint. */ @@ -487,60 +473,6 @@ _mesa_half_to_float(GLhalfARB val) /*@}*/ -/**********************************************************************/ -/** \name Sort & Search */ -/*@{*/ - -/** - * Wrapper for bsearch(). - */ -void * -_mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, - int (*compar)(const void *, const void *) ) -{ -#if defined(_WIN32_WCE) - void *mid; - int cmp; - while (nmemb) { - nmemb >>= 1; - mid = (char *)base + nmemb * size; - cmp = (*compar)(key, mid); - if (cmp == 0) - return mid; - if (cmp > 0) { - base = (char *)mid + size; - --nmemb; - } - } - return NULL; -#else - return bsearch(key, base, nmemb, size, compar); -#endif -} - -/*@}*/ - - -/**********************************************************************/ -/** \name Environment vars */ -/*@{*/ - -/** - * Wrapper for getenv(). - */ -char * -_mesa_getenv( const char *var ) -{ -#if defined(_XBOX) || defined(_WIN32_WCE) - return NULL; -#else - return getenv(var); -#endif -} - -/*@}*/ - - /**********************************************************************/ /** \name String */ /*@{*/ diff --git a/3rdparty/glsl-optimizer/src/mesa/main/imports.h b/3rdparty/glsl-optimizer/src/mesa/main/imports.h index 51b44e5ea..1fbc293d7 100644 --- a/3rdparty/glsl-optimizer/src/mesa/main/imports.h +++ b/3rdparty/glsl-optimizer/src/mesa/main/imports.h @@ -48,16 +48,10 @@ extern "C" { /** Memory macros */ /*@{*/ -/** Allocate \p BYTES bytes */ -#define MALLOC(BYTES) malloc(BYTES) -/** Allocate and zero \p BYTES bytes */ -#define CALLOC(BYTES) calloc(1, BYTES) /** Allocate a structure of type \p T */ #define MALLOC_STRUCT(T) (struct T *) malloc(sizeof(struct T)) /** Allocate and zero a structure of type \p T */ #define CALLOC_STRUCT(T) (struct T *) calloc(1, sizeof(struct T)) -/** Free memory */ -#define FREE(PTR) free(PTR) /*@}*/ @@ -132,6 +126,7 @@ typedef union { GLfloat f; GLint i; GLuint u; } fi_type; #endif #if defined(_MSC_VER) +#if _MSC_VER < 1800 /* Not req'd on VS2013 and above */ static inline float truncf(float x) { return x < 0.0f ? ceilf(x) : floorf(x); } static inline float exp2f(float x) { return powf(2.0f, x); } static inline float log2f(float x) { return logf(x) * 1.442695041f; } @@ -140,6 +135,7 @@ static inline float acoshf(float x) { return logf(x + sqrtf(x * x - 1.0f)); } static inline float atanhf(float x) { return (logf(1.0f + x) - logf(1.0f - x)) / 2.0f; } static inline int isblank(int ch) { return ch == ' ' || ch == '\t'; } #define strtoll(p, e, b) _strtoi64(p, e, b) +#endif /* _MSC_VER < 1800 */ #define strcasecmp(s1, s2) _stricmp(s1, s2) #endif /*@}*/ @@ -167,7 +163,6 @@ INV_SQRTF(float x) ***/ static inline GLfloat LOG2(GLfloat x) { -#ifdef USE_IEEE #if 0 /* This is pretty fast, but not accurate enough (only 2 fractional bits). * Based on code from http://www.stereopsis.com/log2.html @@ -189,13 +184,6 @@ static inline GLfloat LOG2(GLfloat x) num.i += 127 << 23; num.f = ((-1.0f/3) * num.f + 2) * num.f - 2.0f/3; return num.f + log_2; -#else - /* - * NOTE: log_base_2(x) = log(x) / log(2) - * NOTE: 1.442695 = 1/log(2). - */ - return (GLfloat) (log(x) * 1.442695F); -#endif } @@ -203,14 +191,7 @@ static inline GLfloat LOG2(GLfloat x) /*** *** IS_INF_OR_NAN: test if float is infinite or NaN ***/ -#ifdef USE_IEEE -static inline int IS_INF_OR_NAN( float x ) -{ - fi_type tmp; - tmp.f = x; - return !(int)((unsigned int)((tmp.i & 0x7fffffff)-0x7f800000) >> 31); -} -#elif defined(isfinite) +#if defined(isfinite) #define IS_INF_OR_NAN(x) (!isfinite(x)) #elif defined(finite) #define IS_INF_OR_NAN(x) (!finite(x)) @@ -269,10 +250,12 @@ static inline int IROUND_POS(float f) return (int) (f + 0.5F); } +#ifdef __x86_64__ +# include +#endif /** * Convert float to int using a fast method. The rounding mode may vary. - * XXX We could use an x86-64/SSE2 version here. */ static inline int F_TO_I(float f) { @@ -287,6 +270,8 @@ static inline int F_TO_I(float f) fistp r } return r; +#elif defined(__x86_64__) + return _mm_cvt_ss2si(_mm_load_ss(&f)); #else return IROUND(f); #endif @@ -312,7 +297,7 @@ static inline int IFLOOR(float f) __asm__ ("fstps %0" : "=m" (ai) : "t" (af) : "st"); __asm__ ("fstps %0" : "=m" (bi) : "t" (bf) : "st"); return (ai - bi) >> 1; -#elif defined(USE_IEEE) +#else int ai, bi; double af, bf; fi_type u; @@ -321,9 +306,6 @@ static inline int IFLOOR(float f) u.f = (float) af; ai = u.i; u.f = (float) bf; bi = u.i; return (ai - bi) >> 1; -#else - int i = IROUND(f); - return (i > f) ? i - 1 : i; #endif } @@ -347,7 +329,7 @@ static inline int ICEIL(float f) __asm__ ("fstps %0" : "=m" (ai) : "t" (af) : "st"); __asm__ ("fstps %0" : "=m" (bi) : "t" (bf) : "st"); return (ai - bi + 1) >> 1; -#elif defined(USE_IEEE) +#else int ai, bi; double af, bf; fi_type u; @@ -356,9 +338,6 @@ static inline int ICEIL(float f) u.f = (float) af; ai = u.i; u.f = (float) bf; bi = u.i; return (ai - bi + 1) >> 1; -#else - int i = IROUND(f); - return (i < f) ? i + 1 : i; #endif } @@ -389,8 +368,7 @@ _mesa_is_pow_two(int x) static inline int32_t _mesa_next_pow_two_32(uint32_t x) { -#if defined(__GNUC__) && \ - ((__GNUC__ * 100 + __GNUC_MINOR__) >= 304) /* gcc 3.4 or later */ +#ifdef HAVE___BUILTIN_CLZ uint32_t y = (x != 1); return (1 + y) << ((__builtin_clz(x - y) ^ 31) ); #else @@ -408,13 +386,10 @@ _mesa_next_pow_two_32(uint32_t x) static inline int64_t _mesa_next_pow_two_64(uint64_t x) { -#if defined(__GNUC__) && \ - ((__GNUC__ * 100 + __GNUC_MINOR__) >= 304) /* gcc 3.4 or later */ +#ifdef HAVE___BUILTIN_CLZLL uint64_t y = (x != 1); - if (sizeof(x) == sizeof(long)) - return (1 + y) << ((__builtin_clzl(x - y) ^ 63)); - else - return (1 + y) << ((__builtin_clzll(x - y) ^ 63)); + STATIC_ASSERT(sizeof(x) == sizeof(long long)); + return (1 + y) << ((__builtin_clzll(x - y) ^ 63)); #else x--; x |= x >> 1; @@ -435,8 +410,7 @@ _mesa_next_pow_two_64(uint64_t x) static inline GLuint _mesa_logbase2(GLuint n) { -#if defined(__GNUC__) && \ - ((__GNUC__ * 100 + __GNUC_MINOR__) >= 304) /* gcc 3.4 or later */ +#ifdef HAVE___BUILTIN_CLZ return (31 - __builtin_clz(n | 1)); #else GLuint pos = 0; @@ -485,28 +459,33 @@ _mesa_exec_malloc( GLuint size ); extern void _mesa_exec_free( void *addr ); -extern void * -_mesa_realloc( void *oldBuffer, size_t oldSize, size_t newSize ); - #ifndef FFS_DEFINED #define FFS_DEFINED 1 -#ifdef __GNUC__ +#ifdef HAVE___BUILTIN_FFS #define ffs __builtin_ffs -#define ffsll __builtin_ffsll #else extern int ffs(int i); +#endif + +#ifdef HAVE___BUILTIN_FFSLL +#define ffsll __builtin_ffsll +#else extern int ffsll(long long int i); -#endif /*__ GNUC__ */ +#endif #endif /* FFS_DEFINED */ -#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 304) /* gcc 3.4 or later */ +#ifdef HAVE___BUILTIN_POPCOUNT #define _mesa_bitcount(i) __builtin_popcount(i) -#define _mesa_bitcount_64(i) __builtin_popcountll(i) #else extern unsigned int _mesa_bitcount(unsigned int n); +#endif + +#ifdef HAVE___BUILTIN_POPCOUNTLL +#define _mesa_bitcount_64(i) __builtin_popcountll(i) +#else extern unsigned int _mesa_bitcount_64(uint64_t n); #endif @@ -519,7 +498,7 @@ _mesa_bitcount_64(uint64_t n); static inline unsigned int _mesa_fls(unsigned int n) { -#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 304) +#ifdef HAVE___BUILTIN_CLZ return n == 0 ? 0 : 32 - __builtin_clz(n); #else unsigned int v = 1; @@ -543,14 +522,6 @@ _mesa_float_to_half(float f); extern float _mesa_half_to_float(GLhalfARB h); - -extern void * -_mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, - int (*compar)(const void *, const void *) ); - -extern char * -_mesa_getenv( const char *var ); - extern char * _mesa_strdup( const char *s ); diff --git a/3rdparty/glsl-optimizer/src/mesa/main/macros.h b/3rdparty/glsl-optimizer/src/mesa/main/macros.h index c76c3d658..5b7b8aa02 100644 --- a/3rdparty/glsl-optimizer/src/mesa/main/macros.h +++ b/3rdparty/glsl-optimizer/src/mesa/main/macros.h @@ -136,14 +136,14 @@ extern GLfloat _mesa_ubyte_to_float_color_tab[256]; *** UNCLAMPED_FLOAT_TO_UBYTE: clamp float to [0,1] and map to ubyte in [0,255] *** CLAMPED_FLOAT_TO_UBYTE: map float known to be in [0,1] to ubyte in [0,255] ***/ -#if defined(USE_IEEE) && !defined(DEBUG) +#ifndef DEBUG /* This function/macro is sensitive to precision. Test very carefully * if you change it! */ -#define UNCLAMPED_FLOAT_TO_UBYTE(UB, F) \ +#define UNCLAMPED_FLOAT_TO_UBYTE(UB, FLT) \ do { \ fi_type __tmp; \ - __tmp.f = (F); \ + __tmp.f = (FLT); \ if (__tmp.i < 0) \ UB = (GLubyte) 0; \ else if (__tmp.i >= IEEE_ONE) \ @@ -153,10 +153,10 @@ extern GLfloat _mesa_ubyte_to_float_color_tab[256]; UB = (GLubyte) __tmp.i; \ } \ } while (0) -#define CLAMPED_FLOAT_TO_UBYTE(UB, F) \ +#define CLAMPED_FLOAT_TO_UBYTE(UB, FLT) \ do { \ fi_type __tmp; \ - __tmp.f = (F) * (255.0F/256.0F) + 32768.0F; \ + __tmp.f = (FLT) * (255.0F/256.0F) + 32768.0F; \ UB = (GLubyte) __tmp.i; \ } while (0) #else @@ -180,12 +180,19 @@ static inline GLfloat UINT_AS_FLT(GLuint u) return tmp.f; } +static inline unsigned FLT_AS_UINT(float f) +{ + fi_type tmp; + tmp.f = f; + return tmp.u; +} + /** * Convert a floating point value to an unsigned fixed point value. * * \param frac_bits The number of bits used to store the fractional part. */ -static INLINE uint32_t +static inline uint32_t U_FIXED(float value, uint32_t frac_bits) { value *= (1 << frac_bits); @@ -197,7 +204,7 @@ U_FIXED(float value, uint32_t frac_bits) * * \param frac_bits The number of bits used to store the fractional part. */ -static INLINE int32_t +static inline int32_t S_FIXED(float value, uint32_t frac_bits) { return (int32_t) (value * (1 << frac_bits)); @@ -680,6 +687,17 @@ minify(unsigned value, unsigned levels) return MAX2(1, value >> levels); } +/** + * Return true if the given value is a power of two. + * + * Note that this considers 0 a power of two. + */ +static inline bool +is_power_of_two(unsigned value) +{ + return (value & (value - 1)) == 0; +} + /** * Align a value up to an alignment value * @@ -777,13 +795,6 @@ NORMALIZE_3FV(GLfloat v[3]) } -/** Is float value negative? */ -static inline GLboolean -IS_NEGATIVE(float x) -{ - return signbit(x) != 0; -} - /** Test two floats have opposite signs */ static inline GLboolean DIFFERENT_SIGNS(GLfloat x, GLfloat y) @@ -803,7 +814,9 @@ DIFFERENT_SIGNS(GLfloat x, GLfloat y) #define ENUM_TO_BOOLEAN(E) ((E) ? GL_TRUE : GL_FALSE) /* Compute the size of an array */ -#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) +#ifndef ARRAY_SIZE +# define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) +#endif /* Stringify */ #define STRINGIFY(x) #x diff --git a/3rdparty/glsl-optimizer/src/mesa/main/mtypes.h b/3rdparty/glsl-optimizer/src/mesa/main/mtypes.h index c9f9df880..2003632bf 100644 --- a/3rdparty/glsl-optimizer/src/mesa/main/mtypes.h +++ b/3rdparty/glsl-optimizer/src/mesa/main/mtypes.h @@ -53,7 +53,6 @@ extern "C" { struct gl_context; struct gl_uniform_storage; struct prog_instruction; -struct gl_program_parameter_list; struct set; struct set_entry; /*@}*/ @@ -300,6 +299,7 @@ struct gl_transform_feedback_output unsigned OutputRegister; unsigned OutputBuffer; unsigned NumComponents; + unsigned StreamId; /** offset (in DWORDs) of this output within the interleaved structure */ unsigned DstOffset; @@ -376,12 +376,113 @@ typedef enum */ typedef enum { - SYSTEM_VALUE_FRONT_FACE, /**< Fragment shader only (not done yet) */ - SYSTEM_VALUE_VERTEX_ID, /**< Vertex shader only */ - SYSTEM_VALUE_INSTANCE_ID, /**< Vertex shader only */ - SYSTEM_VALUE_SAMPLE_ID, /**< Fragment shader only */ - SYSTEM_VALUE_SAMPLE_POS, /**< Fragment shader only */ - SYSTEM_VALUE_SAMPLE_MASK_IN, /**< Fragment shader only */ + /** + * \name Vertex shader system values + */ + /*@{*/ + /** + * OpenGL-style vertex ID. + * + * Section 2.11.7 (Shader Execution), subsection Shader Inputs, of the + * OpenGL 3.3 core profile spec says: + * + * "gl_VertexID holds the integer index i implicitly passed by + * DrawArrays or one of the other drawing commands defined in section + * 2.8.3." + * + * Section 2.8.3 (Drawing Commands) of the same spec says: + * + * "The commands....are equivalent to the commands with the same base + * name (without the BaseVertex suffix), except that the ith element + * transferred by the corresponding draw call will be taken from + * element indices[i] + basevertex of each enabled array." + * + * Additionally, the overview in the GL_ARB_shader_draw_parameters spec + * says: + * + * "In unextended GL, vertex shaders have inputs named gl_VertexID and + * gl_InstanceID, which contain, respectively the index of the vertex + * and instance. The value of gl_VertexID is the implicitly passed + * index of the vertex being processed, which includes the value of + * baseVertex, for those commands that accept it." + * + * gl_VertexID gets basevertex added in. This differs from DirectX where + * SV_VertexID does \b not get basevertex added in. + * + * \note + * If all system values are available, \c SYSTEM_VALUE_VERTEX_ID will be + * equal to \c SYSTEM_VALUE_VERTEX_ID_ZERO_BASE plus + * \c SYSTEM_VALUE_BASE_VERTEX. + * + * \sa SYSTEM_VALUE_VERTEX_ID_ZERO_BASE, SYSTEM_VALUE_BASE_VERTEX + */ + SYSTEM_VALUE_VERTEX_ID, + + /** + * Instanced ID as supplied to gl_InstanceID + * + * Values assigned to gl_InstanceID always begin with zero, regardless of + * the value of baseinstance. + * + * Section 11.1.3.9 (Shader Inputs) of the OpenGL 4.4 core profile spec + * says: + * + * "gl_InstanceID holds the integer instance number of the current + * primitive in an instanced draw call (see section 10.5)." + * + * Through a big chain of pseudocode, section 10.5 describes that + * baseinstance is not counted by gl_InstanceID. In that section, notice + * + * "If an enabled vertex attribute array is instanced (it has a + * non-zero divisor as specified by VertexAttribDivisor), the element + * index that is transferred to the GL, for all vertices, is given by + * + * floor(instance/divisor) + baseinstance + * + * If an array corresponding to an attribute required by a vertex + * shader is not enabled, then the corresponding element is taken from + * the current attribute state (see section 10.2)." + * + * Note that baseinstance is \b not included in the value of instance. + */ + SYSTEM_VALUE_INSTANCE_ID, + + /** + * DirectX-style vertex ID. + * + * Unlike \c SYSTEM_VALUE_VERTEX_ID, this system value does \b not include + * the value of basevertex. + * + * \sa SYSTEM_VALUE_VERTEX_ID, SYSTEM_VALUE_BASE_VERTEX + */ + SYSTEM_VALUE_VERTEX_ID_ZERO_BASE, + + /** + * Value of \c basevertex passed to \c glDrawElementsBaseVertex and similar + * functions. + * + * \sa SYSTEM_VALUE_VERTEX_ID, SYSTEM_VALUE_VERTEX_ID_ZERO_BASE + */ + SYSTEM_VALUE_BASE_VERTEX, + /*@}*/ + + /** + * \name Geometry shader system values + */ + /*@{*/ + SYSTEM_VALUE_INVOCATION_ID, + /*@}*/ + + /** + * \name Fragment shader system values + */ + /*@{*/ + SYSTEM_VALUE_FRONT_FACE, /**< (not done yet) */ + SYSTEM_VALUE_SAMPLE_ID, + SYSTEM_VALUE_SAMPLE_POS, + SYSTEM_VALUE_SAMPLE_MASK_IN, + /*@}*/ + SYSTEM_VALUE_MAX /**< Number of values */ } gl_system_value; @@ -474,6 +575,7 @@ struct gl_program }; + /** Set by #pragma directives */ struct gl_sl_pragmas { @@ -548,8 +650,7 @@ struct gl_shader /** * This shader's uniform block information. * - * The offsets of the variables are assigned only for shaders in a program's - * _LinkedShaders[]. + * These fields are only set post-linking. */ struct gl_uniform_block *UniformBlocks; unsigned NumUniformBlocks; @@ -557,13 +658,27 @@ struct gl_shader struct exec_list *ir; struct glsl_symbol_table *symbols; - int uses_builtin_functions; + bool uses_builtin_functions; + bool uses_gl_fragcoord; + bool redeclares_gl_fragcoord; + bool ARB_fragment_coord_conventions_enable; + + /** + * Fragment shader state from GLSL 1.50 layout qualifiers. + */ + bool origin_upper_left; + bool pixel_center_integer; /** * Geometry shader state from GLSL 1.50 layout qualifiers. */ struct { GLint VerticesOut; + /** + * 0 - Invocations count not declared in shader, or + * 1 .. MAX_GEOMETRY_SHADER_INVOCATIONS + */ + GLint Invocations; /** * GL_POINTS, GL_LINES, GL_LINES_ADJACENCY, GL_TRIANGLES, or * GL_TRIANGLES_ADJACENCY, or PRIM_UNKNOWN if it's not set in this @@ -663,7 +778,7 @@ struct gl_uniform_block GLuint Binding; /** - * Minimum size of a buffer object to back this uniform buffer + * Minimum size (in bytes) of a buffer object to back this uniform buffer * (GL_UNIFORM_BLOCK_DATA_SIZE). */ GLuint UniformBufferSize; @@ -697,7 +812,6 @@ struct gl_active_atomic_buffer GLboolean StageReferences[MESA_SHADER_STAGES]; }; - /** * A GLSL program object. * Basically a linked collection of vertex and fragment shaders. @@ -716,15 +830,10 @@ struct gl_shader_program GLboolean BinaryRetreivableHint; /** - * Flags that the linker should not reject the program if it lacks - * a vertex or fragment shader. GLES2 doesn't allow separate - * shader objects, and would reject them. However, we internally - * build separate shader objects for fixed function programs, which - * we use for drivers/common/meta.c and for handling - * _mesa_update_state with no program bound (for example in - * glClear()). + * Indicates whether program can be bound for individual pipeline stages + * using UseProgramStages after it is next linked. */ - GLboolean InternalSeparateShader; + GLboolean SeparateShader; GLuint NumShaders; /**< number of attached shaders */ struct gl_shader **Shaders; /**< List of attached the shaders */ @@ -774,6 +883,10 @@ struct gl_shader_program struct { GLint VerticesIn; GLint VerticesOut; + /** + * 1 .. MAX_GEOMETRY_SHADER_INVOCATIONS + */ + GLint Invocations; GLenum InputType; /**< GL_POINTS, GL_LINES, GL_LINES_ADJACENCY_ARB, GL_TRIANGLES, or GL_TRIANGLES_ADJACENCY_ARB */ GLenum OutputType; /**< GL_POINTS, GL_LINE_STRIP or GL_TRIANGLE_STRIP */ @@ -784,7 +897,8 @@ struct gl_shader_program GLboolean UsesClipDistance; GLuint ClipDistanceArraySize; /**< Size of the gl_ClipDistance array, or 0 if not present. */ - GLboolean UsesEndPrimitive; + bool UsesEndPrimitive; + bool UsesStreams; } Geom; /** Vertex shader state */ @@ -814,6 +928,14 @@ struct gl_shader_program unsigned NumUserUniformStorage; struct gl_uniform_storage *UniformStorage; + /** + * Mapping from GL uniform locations returned by \c glUniformLocation to + * UniformStorage entries. Arrays will have multiple contiguous slots + * in the UniformRemapTable, all pointing to the same UniformStorage entry. + */ + unsigned NumUniformRemapTable; + struct gl_uniform_storage **UniformRemapTable; + /** * Size of the gl_ClipDistance array that is output from the last pipeline * stage before the fragment shader. @@ -823,21 +945,6 @@ struct gl_shader_program struct gl_uniform_block *UniformBlocks; unsigned NumUniformBlocks; - /** - * Scale factor for the uniform base location - * - * This is used to generate locations (returned by \c glGetUniformLocation) - * of uniforms. The base location of the uniform is multiplied by this - * value, and the array index is added. - * - * \note - * Must be >= 1. - * - * \sa - * _mesa_uniform_merge_location_offset, _mesa_uniform_split_location_offset - */ - unsigned UniformLocationBaseScale; - /** * Indices into the _LinkedShaders's UniformBlocks[] array for each stage * they're used in, or -1. @@ -876,6 +983,11 @@ struct gl_shader_program * \c NULL. */ struct gl_shader *_LinkedShaders[MESA_SHADER_STAGES]; + + /* True if any of the fragment shaders attached to this program use: + * #extension ARB_fragment_coord_conventions: enable + */ + GLboolean ARB_fragment_coord_conventions_enable; }; @@ -907,15 +1019,15 @@ struct gl_shader_compiler_options GLuint MaxIfDepth; /**< Maximum nested IF blocks */ GLuint MaxUnrollIterations; - - /** - * Optimize code for array of structures backends. - * - * This is a proxy for: - * - preferring DP4 instructions (rather than MUL/MAD) for - * matrix * vector operations, such as position transformation. - */ - GLboolean OptimizeForAOS; + + /** + * Optimize code for array of structures backends. + * + * This is a proxy for: + * - preferring DP4 instructions (rather than MUL/MAD) for + * matrix * vector operations, such as position transformation. + */ + GLboolean OptimizeForAOS; struct gl_sl_pragmas DefaultPragmas; /**< Default #pragma settings */ }; @@ -1046,9 +1158,6 @@ struct gl_constants GLuint PrimitivesWritten; } QueryCounterBits; - /** vertex array / buffer object bounds checking */ - GLboolean CheckArrayBounds; - GLuint MaxDrawBuffers; /**< GL_ARB_draw_buffers */ GLuint MaxColorAttachments; /**< GL_EXT_framebuffer_object */ @@ -1067,11 +1176,16 @@ struct gl_constants GLuint UniformBufferOffsetAlignment; /** @} */ + /** + * GL_ARB_explicit_uniform_location + */ + GLuint MaxUserAssignableUniformLocations; + /** GL_ARB_geometry_shader4 */ GLuint MaxGeometryOutputVertices; GLuint MaxGeometryTotalOutputComponents; - GLuint GLSLVersion; /**< GLSL version supported (ex: 120 = 1.20) */ + GLuint GLSLVersion; /**< Desktop GLSL version supported (ex: 120 = 1.20) */ /** * Changes default GLSL extension behavior from "error" to "warn". It's out @@ -1085,20 +1199,36 @@ struct gl_constants */ GLuint ForceGLSLVersion; + /** + * Allow GLSL #extension directives in the middle of shaders. + */ + GLboolean AllowGLSLExtensionDirectiveMidShader; + /** * Does the driver support real 32-bit integers? (Otherwise, integers are * simulated via floats.) */ GLboolean NativeIntegers; + /** + * Does VertexID count from zero or from base vertex? + * + * \note + * If desktop GLSL 1.30 or GLSL ES 3.00 are not supported, this field is + * ignored and need not be set. + */ + bool VertexID_is_zero_based; + /** * If the driver supports real 32-bit integers, what integer value should be * used for boolean true in uniform uploads? (Usually 1 or ~0.) */ GLuint UniformBooleanTrue; - /** Which texture units support GL_ATI_envmap_bumpmap as targets */ - GLbitfield SupportedBumpUnits; + /** + * Maximum amount of time, measured in nanseconds, that the server can wait. + */ + GLuint64 MaxServerWaitTimeout; /** GL_EXT_provoking_vertex */ GLboolean QuadsFollowProvokingVertexConvention; @@ -1109,6 +1239,9 @@ struct gl_constants /** OpenGL version 3.2 */ GLbitfield ProfileMask; /**< Mask of CONTEXT_x_PROFILE_BIT */ + /** OpenGL version 4.4 */ + GLuint MaxVertexAttribStride; + /** GL_EXT_transform_feedback */ GLuint MaxTransformFeedbackBuffers; GLuint MaxTransformFeedbackSeparateComponents; @@ -1151,11 +1284,6 @@ struct gl_constants */ GLboolean GLSLSkipStrictMaxUniformLimitCheck; - /** - * Force software support for primitive restart in the VBO module. - */ - GLboolean PrimitiveRestartInSoftware; - /** * Always use the GetTransformFeedbackVertexCount() driver hook, rather * than passing the transform feedback object to the drawing function. @@ -1176,6 +1304,19 @@ struct gl_constants */ GLboolean DisableVaryingPacking; + /** + * Should meaningful names be generated for compiler temporary variables? + * + * Generally, it is not useful to have the compiler generate "meaningful" + * names for temporary variables that it creates. This can, however, be a + * useful debugging aid. In Mesa debug builds or release builds when + * MESA_GLSL is set at run-time, meaningful names will be generated. + * Drivers can also force names to be generated by setting this field. + * For example, the i965 driver may set it when INTEL_DEBUG=vs (to dump + * vertex shader assembly) is set at run-time. + */ + bool GenerateTemporaryNames; + /** * Disable interpretation of line continuations (lines ending with a * backslash character ('\') in GLSL source. @@ -1187,6 +1328,38 @@ struct gl_constants GLint MaxDepthTextureSamples; GLint MaxIntegerSamples; + /** + * GL_EXT_texture_multisample_blit_scaled implementation assumes that + * samples are laid out in a rectangular grid roughly corresponding to + * sample locations within a pixel. Below SampleMap{2,4,8}x variables + * are used to map indices of rectangular grid to sample numbers within + * a pixel. This mapping of indices to sample numbers must be initialized + * by the driver for the target hardware. For example, if we have the 8X + * MSAA sample number layout (sample positions) for XYZ hardware: + * + * sample indices layout sample number layout + * --------- --------- + * | 0 | 1 | | a | b | + * --------- --------- + * | 2 | 3 | | c | d | + * --------- --------- + * | 4 | 5 | | e | f | + * --------- --------- + * | 6 | 7 | | g | h | + * --------- --------- + * + * Where a,b,c,d,e,f,g,h are integers between [0-7]. + * + * Then, initialize the SampleMap8x variable for XYZ hardware as shown + * below: + * SampleMap8x = {a, b, c, d, e, f, g, h}; + * + * Follow the logic for other sample counts. + */ + uint8_t SampleMap2x[2]; + uint8_t SampleMap4x[4]; + uint8_t SampleMap8x[8]; + /** GL_ARB_shader_atomic_counters */ GLuint MaxAtomicBufferBindings; GLuint MaxAtomicBufferSize; @@ -1211,6 +1384,10 @@ struct gl_constants /** GL_ARB_gpu_shader5 */ GLfloat MinFragmentInterpolationOffset; GLfloat MaxFragmentInterpolationOffset; + + GLboolean FakeSWMSAA; + + struct gl_shader_compiler_options ShaderCompilerOptions[MESA_SHADER_STAGES]; }; @@ -1229,22 +1406,29 @@ struct gl_extensions GLboolean ARB_arrays_of_arrays; GLboolean ARB_base_instance; GLboolean ARB_blend_func_extended; + GLboolean ARB_buffer_storage; + GLboolean ARB_clear_texture; GLboolean ARB_color_buffer_float; GLboolean ARB_compute_shader; + GLboolean ARB_conditional_render_inverted; GLboolean ARB_conservative_depth; + GLboolean ARB_copy_image; GLboolean ARB_depth_buffer_float; GLboolean ARB_depth_clamp; GLboolean ARB_depth_texture; + GLboolean ARB_derivative_control; GLboolean ARB_draw_buffers_blend; GLboolean ARB_draw_elements_base_vertex; GLboolean ARB_draw_indirect; GLboolean ARB_draw_instanced; GLboolean ARB_fragment_coord_conventions; + GLboolean ARB_fragment_layer_viewport; GLboolean ARB_fragment_program; GLboolean ARB_fragment_program_shadow; GLboolean ARB_fragment_shader; GLboolean ARB_framebuffer_object; GLboolean ARB_explicit_attrib_location; + GLboolean ARB_explicit_uniform_location; GLboolean ARB_geometry_shader4; GLboolean ARB_gpu_shader5; GLboolean ARB_half_float_pixel; @@ -1266,11 +1450,13 @@ struct gl_extensions GLboolean ARB_shading_language_packing; GLboolean ARB_shading_language_420pack; GLboolean ARB_shadow; + GLboolean ARB_stencil_texturing; GLboolean ARB_sync; GLboolean ARB_texture_border_clamp; GLboolean ARB_texture_buffer_object; GLboolean ARB_texture_buffer_object_rgb32; GLboolean ARB_texture_buffer_range; + GLboolean ARB_texture_compression_bptc; GLboolean ARB_texture_compression_rgtc; GLboolean ARB_texture_cube_map; GLboolean ARB_texture_cube_map_array; @@ -1282,6 +1468,7 @@ struct gl_extensions GLboolean ARB_texture_mirror_clamp_to_edge; GLboolean ARB_texture_multisample; GLboolean ARB_texture_non_power_of_two; + GLboolean ARB_texture_stencil8; GLboolean ARB_texture_query_levels; GLboolean ARB_texture_query_lod; GLboolean ARB_texture_rg; @@ -1302,6 +1489,7 @@ struct gl_extensions GLboolean EXT_blend_func_separate; GLboolean EXT_blend_minmax; GLboolean EXT_depth_bounds_test; + GLboolean EXT_draw_buffers; GLboolean EXT_draw_buffers2; GLboolean EXT_framebuffer_blit; GLboolean EXT_framebuffer_multisample; @@ -1313,7 +1501,6 @@ struct gl_extensions GLboolean EXT_pixel_buffer_object; GLboolean EXT_point_parameters; GLboolean EXT_provoking_vertex; - GLboolean EXT_separate_shader_objects; GLboolean EXT_shader_integer_mix; GLboolean EXT_stencil_two_side; GLboolean EXT_texture3D; @@ -1335,18 +1522,20 @@ struct gl_extensions GLboolean OES_standard_derivatives; GLboolean EXT_shadow_samplers; GLboolean EXT_frag_depth; + GLboolean EXT_shader_framebuffer_fetch; /* vendor extensions */ GLboolean AMD_performance_monitor; GLboolean AMD_seamless_cubemap_per_texture; GLboolean AMD_shader_trinary_minmax; GLboolean AMD_vertex_shader_layer; + GLboolean AMD_vertex_shader_viewport_index; GLboolean APPLE_object_purgeable; - GLboolean ATI_envmap_bumpmap; GLboolean ATI_texture_compression_3dc; GLboolean ATI_texture_mirror_once; GLboolean ATI_texture_env_combine3; GLboolean ATI_fragment_shader; GLboolean ATI_separate_stencil; + GLboolean INTEL_performance_query; GLboolean MESA_pack_invert; GLboolean MESA_ycbcr_texture; GLboolean NV_conditional_render; @@ -1445,7 +1634,6 @@ struct gl_context GLuint Version; char *VersionString; - struct gl_shader_compiler_options ShaderCompilerOptions[MESA_SHADER_STAGES]; GLenum ErrorValue; /**< Last error code */ }; diff --git a/3rdparty/glsl-optimizer/src/mesa/program/prog_hash_table.c b/3rdparty/glsl-optimizer/src/mesa/program/prog_hash_table.c index 4139f26fb..3b2152b69 100644 --- a/3rdparty/glsl-optimizer/src/mesa/program/prog_hash_table.c +++ b/3rdparty/glsl-optimizer/src/mesa/program/prog_hash_table.c @@ -28,7 +28,7 @@ * \author Ian Romanick */ -#include "main/imports.h" +#include "main/errors.h" #include "main/simple_list.h" #include "hash_table.h" @@ -142,6 +142,10 @@ hash_table_insert(struct hash_table *ht, void *data, const void *key) struct hash_node *node; node = calloc(1, sizeof(*node)); + if (node == NULL) { + _mesa_error_no_memory(__func__); + return; + } node->data = data; node->key = key; @@ -167,6 +171,10 @@ hash_table_replace(struct hash_table *ht, void *data, const void *key) } hn = calloc(1, sizeof(*hn)); + if (hn == NULL) { + _mesa_error_no_memory(__func__); + return false; + } hn->data = data; hn->key = key; diff --git a/3rdparty/glsl-optimizer/src/mesa/program/prog_statevars.h b/3rdparty/glsl-optimizer/src/mesa/program/prog_statevars.h index 185b26d97..d33b4c76e 100644 --- a/3rdparty/glsl-optimizer/src/mesa/program/prog_statevars.h +++ b/3rdparty/glsl-optimizer/src/mesa/program/prog_statevars.h @@ -124,8 +124,6 @@ typedef enum gl_state_index_ { STATE_PT_BIAS, /**< Pixel transfer RGBA bias */ STATE_FB_SIZE, /**< (width-1, height-1, 0, 0) */ STATE_FB_WPOS_Y_TRANSFORM, /**< (1, 0, -1, height) if a FBO is bound, (-1, height, 1, 0) otherwise */ - STATE_ROT_MATRIX_0, /**< ATI_envmap_bumpmap, rot matrix row 0 */ - STATE_ROT_MATRIX_1, /**< ATI_envmap_bumpmap, rot matrix row 1 */ STATE_INTERNAL_DRIVER /* first available state index for drivers (must be last) */ } gl_state_index; diff --git a/3rdparty/glsl-optimizer/src/mesa/program/symbol_table.c b/3rdparty/glsl-optimizer/src/mesa/program/symbol_table.c index 4f6f31f31..bd0aad2ce 100644 --- a/3rdparty/glsl-optimizer/src/mesa/program/symbol_table.c +++ b/3rdparty/glsl-optimizer/src/mesa/program/symbol_table.c @@ -21,7 +21,7 @@ * DEALINGS IN THE SOFTWARE. */ -#include "main/imports.h" +#include "main/errors.h" #include "symbol_table.h" #include "hash_table.h" @@ -112,28 +112,10 @@ struct _mesa_symbol_table { }; -struct _mesa_symbol_table_iterator { - /** - * Name space of symbols returned by this iterator. - */ - int name_space; - - - /** - * Currently iterated symbol - * - * The next call to \c _mesa_symbol_table_iterator_get will return this - * value. It will also update this value to the value that should be - * returned by the next call. - */ - struct symbol *curr; -}; - - static void check_symbol_table(struct _mesa_symbol_table *table) { -#if 1 +#if !defined(NDEBUG) struct scope_level *scope; for (scope = table->current_scope; scope != NULL; scope = scope->next) { @@ -152,7 +134,9 @@ check_symbol_table(struct _mesa_symbol_table *table) } } } -#endif +#else + (void) table; +#endif /* !defined(NDEBUG) */ } void @@ -188,6 +172,11 @@ _mesa_symbol_table_push_scope(struct _mesa_symbol_table *table) { struct scope_level *const scope = calloc(1, sizeof(*scope)); + if (scope == NULL) { + _mesa_error_no_memory(__func__); + return; + } + scope->next = table->current_scope; table->current_scope = scope; table->depth++; @@ -201,74 +190,6 @@ find_symbol(struct _mesa_symbol_table *table, const char *name) } -struct _mesa_symbol_table_iterator * -_mesa_symbol_table_iterator_ctor(struct _mesa_symbol_table *table, - int name_space, const char *name) -{ - struct _mesa_symbol_table_iterator *iter = calloc(1, sizeof(*iter)); - struct symbol_header *const hdr = find_symbol(table, name); - - iter->name_space = name_space; - - if (hdr != NULL) { - struct symbol *sym; - - for (sym = hdr->symbols; sym != NULL; sym = sym->next_with_same_name) { - assert(sym->hdr == hdr); - - if ((name_space == -1) || (sym->name_space == name_space)) { - iter->curr = sym; - break; - } - } - } - - return iter; -} - - -void -_mesa_symbol_table_iterator_dtor(struct _mesa_symbol_table_iterator *iter) -{ - free(iter); -} - - -void * -_mesa_symbol_table_iterator_get(struct _mesa_symbol_table_iterator *iter) -{ - return (iter->curr == NULL) ? NULL : iter->curr->data; -} - - -int -_mesa_symbol_table_iterator_next(struct _mesa_symbol_table_iterator *iter) -{ - struct symbol_header *hdr; - - if (iter->curr == NULL) { - return 0; - } - - hdr = iter->curr->hdr; - iter->curr = iter->curr->next_with_same_name; - - while (iter->curr != NULL) { - assert(iter->curr->hdr == hdr); - (void)hdr; - - if ((iter->name_space == -1) - || (iter->curr->name_space == iter->name_space)) { - return 1; - } - - iter->curr = iter->curr->next_with_same_name; - } - - return 0; -} - - /** * Determine the scope "distance" of a symbol from the current scope * @@ -338,7 +259,17 @@ _mesa_symbol_table_add_symbol(struct _mesa_symbol_table *table, if (hdr == NULL) { hdr = calloc(1, sizeof(*hdr)); + if (hdr == NULL) { + _mesa_error_no_memory(__func__); + return -1; + } + hdr->name = strdup(name); + if (hdr->name == NULL) { + free(hdr); + _mesa_error_no_memory(__func__); + return -1; + } hash_table_insert(table->ht, hdr, hdr->name); hdr->next = table->hdr; @@ -360,6 +291,11 @@ _mesa_symbol_table_add_symbol(struct _mesa_symbol_table *table, return -1; sym = calloc(1, sizeof(*sym)); + if (sym == NULL) { + _mesa_error_no_memory(__func__); + return -1; + } + sym->next_with_same_name = hdr->symbols; sym->next_with_same_scope = table->current_scope->symbols; sym->hdr = hdr; @@ -395,6 +331,11 @@ _mesa_symbol_table_add_global_symbol(struct _mesa_symbol_table *table, if (hdr == NULL) { hdr = calloc(1, sizeof(*hdr)); + if (hdr == NULL) { + _mesa_error_no_memory(__func__); + return -1; + } + hdr->name = strdup(name); hash_table_insert(table->ht, hdr, hdr->name); @@ -424,6 +365,11 @@ _mesa_symbol_table_add_global_symbol(struct _mesa_symbol_table *table, } sym = calloc(1, sizeof(*sym)); + if (sym == NULL) { + _mesa_error_no_memory(__func__); + return -1; + } + sym->next_with_same_scope = top_scope->symbols; sym->hdr = hdr; sym->name_space = name_space; diff --git a/3rdparty/glsl-optimizer/src/mesa/program/symbol_table.h b/3rdparty/glsl-optimizer/src/mesa/program/symbol_table.h index f9d91649b..1027f4761 100644 --- a/3rdparty/glsl-optimizer/src/mesa/program/symbol_table.h +++ b/3rdparty/glsl-optimizer/src/mesa/program/symbol_table.h @@ -24,7 +24,6 @@ #define MESA_SYMBOL_TABLE_H struct _mesa_symbol_table; -struct _mesa_symbol_table_iterator; extern void _mesa_symbol_table_push_scope(struct _mesa_symbol_table *table); @@ -47,16 +46,4 @@ extern struct _mesa_symbol_table *_mesa_symbol_table_ctor(void); extern void _mesa_symbol_table_dtor(struct _mesa_symbol_table *); -extern struct _mesa_symbol_table_iterator *_mesa_symbol_table_iterator_ctor( - struct _mesa_symbol_table *table, int name_space, const char *name); - -extern void _mesa_symbol_table_iterator_dtor( - struct _mesa_symbol_table_iterator *); - -extern void *_mesa_symbol_table_iterator_get( - struct _mesa_symbol_table_iterator *iter); - -extern int _mesa_symbol_table_iterator_next( - struct _mesa_symbol_table_iterator *iter); - #endif /* MESA_SYMBOL_TABLE_H */ diff --git a/3rdparty/glsl-optimizer/src/node/binding.cpp b/3rdparty/glsl-optimizer/src/node/binding.cpp index 27b9a0dd1..fa7bb946a 100644 --- a/3rdparty/glsl-optimizer/src/node/binding.cpp +++ b/3rdparty/glsl-optimizer/src/node/binding.cpp @@ -1,5 +1,7 @@ #include +#include #include "shader.h" +#include using namespace v8; @@ -8,7 +10,10 @@ void InitAll(Handle exports) // Export constants exports->Set(String::NewSymbol("VERTEX_SHADER"), Int32::New(kGlslOptShaderVertex), ReadOnly); exports->Set(String::NewSymbol("FRAGMENT_SHADER"), Int32::New(kGlslOptShaderFragment), ReadOnly); - + exports->Set(String::NewSymbol("TARGET_OPENGL"), Int32::New(kGlslTargetOpenGL), ReadOnly); + exports->Set(String::NewSymbol("TARGET_OPENGLES20"), Int32::New(kGlslTargetOpenGLES20), ReadOnly); + exports->Set(String::NewSymbol("TARGET_OPENGLES30"), Int32::New(kGlslTargetOpenGLES30), ReadOnly); + // Export classes Compiler::Init(exports); Shader::Init(exports); diff --git a/3rdparty/glsl-optimizer/src/node/compiler.cpp b/3rdparty/glsl-optimizer/src/node/compiler.cpp index ea0e95c4d..af2f49207 100644 --- a/3rdparty/glsl-optimizer/src/node/compiler.cpp +++ b/3rdparty/glsl-optimizer/src/node/compiler.cpp @@ -3,11 +3,14 @@ using namespace v8; using namespace node; + +Persistent Compiler::constructor; + //---------------------------------------------------------------------- -Compiler::Compiler(bool essl) +Compiler::Compiler(glslopt_target target) { - _binding = glslopt_initialize(essl); + _binding = glslopt_initialize(target); } //---------------------------------------------------------------------- @@ -33,42 +36,52 @@ void Compiler::release() void Compiler::Init(Handle exports) { + NanScope(); + // Prepare constructor template - Local tpl = FunctionTemplate::New(New); - tpl->SetClassName(String::NewSymbol("Compiler")); + Local tpl = NanNew(New); + + tpl->SetClassName(NanNew("Compiler")); tpl->InstanceTemplate()->SetInternalFieldCount(1); // Prototype - SetPrototypeMethod(tpl, "dispose", Dispose); + NanSetPrototypeTemplate(tpl, "dispose", NanNew(Dispose)); // Export the class - Persistent constructor = Persistent::New(tpl->GetFunction()); - exports->Set(String::NewSymbol("Compiler"), constructor); + NanAssignPersistent(constructor, tpl->GetFunction()); + exports->Set(NanNew("Compiler"), tpl->GetFunction()); } //---------------------------------------------------------------------- -Handle Compiler::New(const Arguments& args) +NAN_METHOD(Compiler::New) { - HandleScope scope; + NanScope(); - bool essl = args[0]->IsUndefined() ? true : args[0]->BooleanValue(); + if (args.IsConstructCall()) { + glslopt_target target = kGlslTargetOpenGL; + if (args[0]->IsInt32()) + target = (glslopt_target)args[0]->Int32Value(); + else if (args[0]->IsBoolean()) + target = (glslopt_target)( (int)args[0]->BooleanValue() ); - Compiler* obj = new Compiler(essl); - - obj->Wrap(args.This()); - - return args.This(); + Compiler* obj = new Compiler(target); + obj->Wrap(args.This()); + NanReturnValue(args.This()); + } else { + Local cons = NanNew(constructor); + NanReturnValue(cons->NewInstance()); + } } //---------------------------------------------------------------------- -Handle Compiler::Dispose(const Arguments& args) +NAN_METHOD(Compiler::Dispose) { - HandleScope scope; + NanScope(); Compiler* obj = ObjectWrap::Unwrap(args.This()); obj->release(); - return scope.Close(Undefined()); + NanReturnUndefined(); } diff --git a/3rdparty/glsl-optimizer/src/node/compiler.h b/3rdparty/glsl-optimizer/src/node/compiler.h index 4d18e6ff4..46fe8e144 100644 --- a/3rdparty/glsl-optimizer/src/node/compiler.h +++ b/3rdparty/glsl-optimizer/src/node/compiler.h @@ -2,6 +2,7 @@ #define COMPILER_H #include +#include #include class Compiler : public node::ObjectWrap { @@ -13,13 +14,14 @@ public: void release(); private: - Compiler(bool essl); + Compiler(glslopt_target target); ~Compiler(); glslopt_ctx* _binding; - static v8::Handle New(const v8::Arguments& args); - static v8::Handle Dispose(const v8::Arguments& args); + static NAN_METHOD(New); + static NAN_METHOD(Dispose); + static v8::Persistent constructor; }; #endif diff --git a/3rdparty/glsl-optimizer/src/node/shader.cpp b/3rdparty/glsl-optimizer/src/node/shader.cpp index 9d3fefc0d..4370d1a9e 100644 --- a/3rdparty/glsl-optimizer/src/node/shader.cpp +++ b/3rdparty/glsl-optimizer/src/node/shader.cpp @@ -1,8 +1,11 @@ #include "shader.h" +#include using namespace v8; using namespace node; +Persistent Shader::constructor; + //---------------------------------------------------------------------- Shader::Shader(Compiler* compiler, int type, const char* source) @@ -63,28 +66,30 @@ const char* Shader::getLog() const void Shader::Init(Handle exports) { + NanScope(); + // Prepare constructor template - Local tpl = FunctionTemplate::New(New); - tpl->SetClassName(String::NewSymbol("Shader")); + Local tpl = NanNew(New); + tpl->SetClassName(NanNew("Shader")); tpl->InstanceTemplate()->SetInternalFieldCount(1); // Prototype - SetPrototypeMethod(tpl, "dispose", Dispose); - SetPrototypeMethod(tpl, "compiled", Compiled); - SetPrototypeMethod(tpl, "output", Output); - SetPrototypeMethod(tpl, "rawOutput", RawOutput); - SetPrototypeMethod(tpl, "log", Log); + NanSetPrototypeTemplate(tpl, "dispose", NanNew(Dispose)); + NanSetPrototypeTemplate(tpl, "compiled", NanNew(Compiled)); + NanSetPrototypeTemplate(tpl, "output", NanNew(Output)); + NanSetPrototypeTemplate(tpl, "rawOutput", NanNew(RawOutput)); + NanSetPrototypeTemplate(tpl, "log", NanNew(Log)); // Export the class - Persistent constructor = Persistent::New(tpl->GetFunction()); - exports->Set(String::NewSymbol("Shader"), constructor); + NanAssignPersistent(constructor, tpl->GetFunction()); + exports->Set(NanNew("Shader"), tpl->GetFunction()); } //---------------------------------------------------------------------- Handle Shader::New(const Arguments& args) { - HandleScope scope; + NanScope(); if (args.Length() == 3) { @@ -117,61 +122,61 @@ Handle Shader::New(const Arguments& args) } // Couldn't create the Shader - return ThrowException(String::New("Invalid arguments")); + NanThrowError("Invalid arguments"); } //---------------------------------------------------------------------- -Handle Shader::Dispose(const Arguments& args) +NAN_METHOD(Shader::Dispose) { - HandleScope scope; + NanScope(); Shader* obj = ObjectWrap::Unwrap(args.This()); obj->release(); - return scope.Close(Undefined()); + NanReturnUndefined(); } //---------------------------------------------------------------------- -Handle Shader::Compiled(const Arguments& args) +NAN_METHOD(Shader::Compiled) { - HandleScope scope; + NanScope(); Shader* obj = ObjectWrap::Unwrap(args.This()); - return scope.Close(Boolean::New(obj->isCompiled())); + NanReturnValue(NanNew(obj->isCompiled())); } //---------------------------------------------------------------------- -Handle Shader::Output(const Arguments& args) +NAN_METHOD(Shader::Output) { - HandleScope scope; + NanScope(); Shader* obj = ObjectWrap::Unwrap(args.This()); - return scope.Close(String::New(obj->getOutput())); + NanReturnValue(NanNew(obj->getOutput())); } //---------------------------------------------------------------------- -Handle Shader::RawOutput(const Arguments& args) +NAN_METHOD(Shader::RawOutput) { - HandleScope scope; + NanScope(); Shader* obj = ObjectWrap::Unwrap(args.This()); - return scope.Close(String::New(obj->getRawOutput())); + NanReturnValue(NanNew(obj->getRawOutput())); } //---------------------------------------------------------------------- -Handle Shader::Log(const Arguments& args) +NAN_METHOD(Shader::Log) { - HandleScope scope; + NanScope(); Shader* obj = ObjectWrap::Unwrap(args.This()); - return scope.Close(String::New(obj->getLog())); + NanReturnValue(NanNew(obj->getLog())); } diff --git a/3rdparty/glsl-optimizer/src/node/shader.h b/3rdparty/glsl-optimizer/src/node/shader.h index 8bfb1caf7..952cd86d5 100644 --- a/3rdparty/glsl-optimizer/src/node/shader.h +++ b/3rdparty/glsl-optimizer/src/node/shader.h @@ -2,6 +2,9 @@ #define SHADER_H #include "compiler.h" +#include +#include +#include class Shader : public node::ObjectWrap { public: @@ -21,13 +24,14 @@ private: glslopt_shader* _binding; bool _compiled; - static v8::Handle New(const v8::Arguments& args); - static v8::Handle Dispose(const v8::Arguments& args); + static NAN_METHOD(New); + static NAN_METHOD(Dispose); - static v8::Handle Compiled(const v8::Arguments& args); - static v8::Handle Output(const v8::Arguments& args); - static v8::Handle RawOutput(const v8::Arguments& args); - static v8::Handle Log(const v8::Arguments& args); + static NAN_METHOD(Compiled); + static NAN_METHOD(Output); + static NAN_METHOD(RawOutput); + static NAN_METHOD(Log); + static v8::Persistent constructor; }; #endif diff --git a/3rdparty/glsl-optimizer/src/util/.gitignore b/3rdparty/glsl-optimizer/src/util/.gitignore new file mode 100644 index 000000000..e945ecbb5 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/util/.gitignore @@ -0,0 +1 @@ +format_srgb.c diff --git a/3rdparty/glsl-optimizer/src/util/Makefile.sources b/3rdparty/glsl-optimizer/src/util/Makefile.sources new file mode 100644 index 000000000..952b79905 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/util/Makefile.sources @@ -0,0 +1,9 @@ +MESA_UTIL_FILES := \ + hash_table.c \ + ralloc.c \ + register_allocate.c \ + register_allocate.h \ + rgtc.c + +MESA_UTIL_GENERATED_FILES = \ + format_srgb.c diff --git a/3rdparty/glsl-optimizer/src/util/SConscript b/3rdparty/glsl-optimizer/src/util/SConscript new file mode 100644 index 000000000..ade1d6c6c --- /dev/null +++ b/3rdparty/glsl-optimizer/src/util/SConscript @@ -0,0 +1,38 @@ +import common + +Import('*') + +from sys import executable as python_cmd + +env = env.Clone() + +env.Prepend(CPPPATH = [ + '#include', + '#src', + '#src/mapi', + '#src/mesa', + '#src/util', +]) + +env.CodeGenerate( + target = 'format_srgb.c', + script = 'format_srgb.py', + source = [], + command = python_cmd + ' $SCRIPT > $TARGET' +) + +# parse Makefile.sources +source_lists = env.ParseSourceList('Makefile.sources') + +mesautil_sources = ( + source_lists['MESA_UTIL_FILES'] + + source_lists['MESA_UTIL_GENERATED_FILES'] +) + +mesautil = env.ConvenienceLibrary( + target = 'mesautil', + source = mesautil_sources, +) + +env.Alias('mesautil', mesautil) +Export('mesautil') diff --git a/3rdparty/glsl-optimizer/src/mesa/main/hash_table.c b/3rdparty/glsl-optimizer/src/util/hash_table.c similarity index 99% rename from 3rdparty/glsl-optimizer/src/mesa/main/hash_table.c rename to 3rdparty/glsl-optimizer/src/util/hash_table.c index ee4c2e0c4..1b6726c79 100644 --- a/3rdparty/glsl-optimizer/src/mesa/main/hash_table.c +++ b/3rdparty/glsl-optimizer/src/util/hash_table.c @@ -43,9 +43,9 @@ #include #include -#include "main/hash_table.h" -#include "main/macros.h" -#include "../../glsl/ralloc.h" +#include "hash_table.h" +#include "ralloc.h" +#include "macros.h" static const uint32_t deleted_key_value; @@ -119,7 +119,6 @@ _mesa_hash_table_create(void *mem_ctx, if (ht == NULL) return NULL; - ht->mem_ctx = mem_ctx; ht->size_index = 0; ht->size = hash_sizes[ht->size_index].size; ht->rehash = hash_sizes[ht->size_index].rehash; diff --git a/3rdparty/glsl-optimizer/src/mesa/main/hash_table.h b/3rdparty/glsl-optimizer/src/util/hash_table.h similarity index 98% rename from 3rdparty/glsl-optimizer/src/mesa/main/hash_table.h rename to 3rdparty/glsl-optimizer/src/util/hash_table.h index ad1dae478..d6b6ebf40 100644 --- a/3rdparty/glsl-optimizer/src/mesa/main/hash_table.h +++ b/3rdparty/glsl-optimizer/src/util/hash_table.h @@ -28,10 +28,11 @@ #ifndef _HASH_TABLE_H #define _HASH_TABLE_H +#include #include #include - -#include "compiler.h" +#include "c99_compat.h" +#include "macros.h" #ifdef __cplusplus extern "C" { @@ -44,7 +45,6 @@ struct hash_entry { }; struct hash_table { - void *mem_ctx; struct hash_entry *table; bool (*key_equals_function)(const void *a, const void *b); const void *deleted_key; diff --git a/3rdparty/glsl-optimizer/src/util/macros.h b/3rdparty/glsl-optimizer/src/util/macros.h new file mode 100644 index 000000000..40ebf02da --- /dev/null +++ b/3rdparty/glsl-optimizer/src/util/macros.h @@ -0,0 +1,129 @@ +/* + * Copyright © 2014 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifndef UTIL_MACROS_H +#define UTIL_MACROS_H + +/* Compute the size of an array */ +#ifndef ARRAY_SIZE +# define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x))) +#endif + + +/** + * __builtin_expect macros + */ +#if !defined(HAVE___BUILTIN_EXPECT) +# define __builtin_expect(x, y) (x) +#endif + +#ifndef likely +# ifdef HAVE___BUILTIN_EXPECT +# define likely(x) __builtin_expect(!!(x), 1) +# define unlikely(x) __builtin_expect(!!(x), 0) +# else +# define likely(x) (x) +# define unlikely(x) (x) +# endif +#endif + + +/** + * Static (compile-time) assertion. + * Basically, use COND to dimension an array. If COND is false/zero the + * array size will be -1 and we'll get a compilation error. + */ +#define STATIC_ASSERT(COND) \ + do { \ + (void) sizeof(char [1 - 2*!(COND)]); \ + } while (0) + + +/** + * Unreachable macro. Useful for suppressing "control reaches end of non-void + * function" warnings. + */ +#ifdef HAVE___BUILTIN_UNREACHABLE +#define unreachable(str) \ +do { \ + assert(!str); \ + __builtin_unreachable(); \ +} while (0) +#endif + +#ifndef unreachable +#define unreachable(str) +#endif + +#ifdef HAVE_FUNC_ATTRIBUTE_FLATTEN +#define FLATTEN __attribute__((__flatten__)) +#else +#define FLATTEN +#endif + +#ifdef HAVE_FUNC_ATTRIBUTE_FORMAT +#define PRINTFLIKE(f, a) __attribute__ ((format(__printf__, f, a))) +#else +#define PRINTFLIKE(f, a) +#endif + +#ifdef HAVE_FUNC_ATTRIBUTE_MALLOC +#define MALLOCLIKE __attribute__((__malloc__)) +#else +#define MALLOCLIKE +#endif + +/* Used to optionally mark structures with misaligned elements or size as + * packed, to trade off performance for space. + */ +#ifdef HAVE_FUNC_ATTRIBUTE_PACKED +#define PACKED __attribute__((__packed__)) +#else +#define PACKED +#endif + +#ifdef __cplusplus +/** + * Macro function that evaluates to true if T is a trivially + * destructible type -- that is, if its (non-virtual) destructor + * performs no action and all member variables and base classes are + * trivially destructible themselves. + */ +# if defined(__GNUC__) +# if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))) +# define HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T) +# endif +# elif (defined(__clang__) && defined(__has_feature)) +# if __has_feature(has_trivial_destructor) +# define HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T) +# endif +# endif +# ifndef HAS_TRIVIAL_DESTRUCTOR + /* It's always safe (if inefficient) to assume that a + * destructor is non-trivial. + */ +# define HAS_TRIVIAL_DESTRUCTOR(T) (false) +# endif +#endif + +#endif /* UTIL_MACROS_H */ diff --git a/3rdparty/glsl-optimizer/src/glsl/ralloc.c b/3rdparty/glsl-optimizer/src/util/ralloc.c similarity index 100% rename from 3rdparty/glsl-optimizer/src/glsl/ralloc.c rename to 3rdparty/glsl-optimizer/src/util/ralloc.c diff --git a/3rdparty/glsl-optimizer/src/glsl/ralloc.h b/3rdparty/glsl-optimizer/src/util/ralloc.h similarity index 96% rename from 3rdparty/glsl-optimizer/src/glsl/ralloc.h rename to 3rdparty/glsl-optimizer/src/util/ralloc.h index 44dd34392..2d4231085 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ralloc.h +++ b/3rdparty/glsl-optimizer/src/util/ralloc.h @@ -38,10 +38,9 @@ * Tridgell's talloc, but ralloc is an independent implementation * released under the MIT license and tuned for Mesa. * - * The talloc implementation is available under the GNU Lesser - * General Public License (GNU LGPL), version 3 or later. It is - * more sophisticated than ralloc in that it includes reference - * counting and debugging features. See: http://talloc.samba.org/ + * talloc is more sophisticated than ralloc in that it includes reference + * counting and useful debugging features. However, it is released under + * a non-permissive open source license. */ #ifndef RALLOC_H @@ -54,7 +53,8 @@ extern "C" { #include #include #include -#include "main/compiler.h" + +#include "macros.h" /** * \def ralloc(ctx, type) @@ -98,14 +98,14 @@ void *ralloc_context(const void *ctx); * simply allocates storage for \p size bytes and returns the pointer, * similar to \c malloc. */ -void *ralloc_size(const void *ctx, size_t size); +void *ralloc_size(const void *ctx, size_t size) MALLOCLIKE; /** * Allocate zero-initialized memory chained off of the given context. * * This is similar to \c calloc with a size of 1. */ -void *rzalloc_size(const void *ctx, size_t size); +void *rzalloc_size(const void *ctx, size_t size) MALLOCLIKE; /** * Resize a piece of ralloc-managed memory, preserving data. @@ -185,7 +185,7 @@ void *reralloc_size(const void *ctx, void *ptr, size_t size); * More than a convenience function, this also checks for integer overflow when * multiplying \p size and \p count. This is necessary for security. */ -void *ralloc_array_size(const void *ctx, size_t size, size_t count); +void *ralloc_array_size(const void *ctx, size_t size, size_t count) MALLOCLIKE; /** * Allocate a zero-initialized array chained off the given context. @@ -195,7 +195,7 @@ void *ralloc_array_size(const void *ctx, size_t size, size_t count); * More than a convenience function, this also checks for integer overflow when * multiplying \p size and \p count. This is necessary for security. */ -void *rzalloc_array_size(const void *ctx, size_t size, size_t count); +void *rzalloc_array_size(const void *ctx, size_t size, size_t count) MALLOCLIKE; /** * Resize a ralloc-managed array, preserving data. @@ -257,7 +257,7 @@ void ralloc_set_destructor(const void *ptr, void(*destructor)(void *)); /** * Duplicate a string, allocating the memory from the given context. */ -char *ralloc_strdup(const void *ctx, const char *str); +char *ralloc_strdup(const void *ctx, const char *str) MALLOCLIKE; /** * Duplicate a string, allocating the memory from the given context. @@ -265,7 +265,7 @@ char *ralloc_strdup(const void *ctx, const char *str); * Like \c strndup, at most \p n characters are copied. If \p str is longer * than \p n characters, \p n are copied, and a termining \c '\0' byte is added. */ -char *ralloc_strndup(const void *ctx, const char *str, size_t n); +char *ralloc_strndup(const void *ctx, const char *str, size_t n) MALLOCLIKE; /** * Concatenate two strings, allocating the necessary space. @@ -302,7 +302,7 @@ bool ralloc_strncat(char **dest, const char *str, size_t n); * * \return The newly allocated string. */ -char *ralloc_asprintf (const void *ctx, const char *fmt, ...) PRINTFLIKE(2, 3); +char *ralloc_asprintf (const void *ctx, const char *fmt, ...) PRINTFLIKE(2, 3) MALLOCLIKE; /** * Print to a string, given a va_list. @@ -312,7 +312,7 @@ char *ralloc_asprintf (const void *ctx, const char *fmt, ...) PRINTFLIKE(2, 3); * * \return The newly allocated string. */ -char *ralloc_vasprintf(const void *ctx, const char *fmt, va_list args); +char *ralloc_vasprintf(const void *ctx, const char *fmt, va_list args) MALLOCLIKE; /** * Rewrite the tail of an existing string, starting at a given index. diff --git a/3rdparty/glsl-optimizer/tests/fragment/array-const-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/array-const-inES3.txt new file mode 100644 index 000000000..a8339b217 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/array-const-inES3.txt @@ -0,0 +1,24 @@ +#version 300 es +mediump vec4 xlat_main( ) { + highp vec2 poisson[8]; + poisson[0] = vec2( 0.000000, 0.000000); + poisson[1] = vec2( 0.527837, -0.0858680); + poisson[2] = vec2( -0.0400880, 0.536087); + poisson[3] = vec2( -0.670445, -0.179949); + poisson[4] = vec2( -0.419418, -0.616039); + poisson[5] = vec2( 0.440453, -0.639399); + poisson[6] = vec2( -0.757088, 0.349334); + poisson[7] = vec2( 0.574619, 0.685879); + mediump vec4 c; + highp int i = 0; + c = vec4( 0.000000); + for ( ; (i < 8); ( ++i )) { + c.xy += poisson[ i ]; + } + return c; +} +out lowp vec4 _fragData; +void main() { + mediump vec4 xl_retval = xlat_main(); + _fragData = vec4(xl_retval); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/array-const-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/array-const-ir.txt deleted file mode 100644 index c82bf6c9b..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/array-const-ir.txt +++ /dev/null @@ -1,64 +0,0 @@ -vec4 xlat_main () -{ - int i_1; - vec4 c_2; - vec2 poisson_3[8]; - vec2 tmpvar_4; - tmpvar_4 = vec2(0.0, 0.0); - poisson_3[0] = tmpvar_4; - vec2 tmpvar_5; - tmpvar_5 = vec2(0.527837, -0.085868); - poisson_3[1] = tmpvar_5; - vec2 tmpvar_6; - tmpvar_6 = vec2(-0.040088, 0.536087); - poisson_3[2] = tmpvar_6; - vec2 tmpvar_7; - tmpvar_7 = vec2(-0.670445, -0.179949); - poisson_3[3] = tmpvar_7; - vec2 tmpvar_8; - tmpvar_8 = vec2(-0.419418, -0.616039); - poisson_3[4] = tmpvar_8; - vec2 tmpvar_9; - tmpvar_9 = vec2(0.440453, -0.639399); - poisson_3[5] = tmpvar_9; - vec2 tmpvar_10; - tmpvar_10 = vec2(-0.757088, 0.349334); - poisson_3[6] = tmpvar_10; - vec2 tmpvar_11; - tmpvar_11 = vec2(0.574619, 0.685879); - poisson_3[7] = tmpvar_11; - int tmpvar_12; - tmpvar_12 = 0; - i_1 = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13 = vec4(0.0, 0.0, 0.0, 0.0); - c_2 = tmpvar_13; - while (true) { - if (!((i_1 < 8))) { - break; - }; - vec2 tmpvar_14; - tmpvar_14 = (c_2.xy + poisson_3[i_1]); - c_2.xy = tmpvar_14.xy.xy; - int tmpvar_15; - tmpvar_15 = (i_1 + 1); - i_1 = tmpvar_15; - }; - return c_2; -} - -void main () -{ - vec4 xl_retval_16; - vec4 tmpvar_17; - tmpvar_17 = xlat_main (); - vec4 tmpvar_18; - tmpvar_18 = tmpvar_17; - xl_retval_16 = tmpvar_18; - vec4 tmpvar_19; - tmpvar_19 = xl_retval_16.xyzw; - vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - gl_FragData[0] = tmpvar_20; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/array-const-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/array-const-irES.txt deleted file mode 100644 index 2d99b5314..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/array-const-irES.txt +++ /dev/null @@ -1,64 +0,0 @@ -mediump vec4 xlat_main () -{ - int i_1; - mediump vec4 c_2; - highp vec2 poisson_3[8]; - mediump vec2 tmpvar_4; - tmpvar_4 = vec2(0.0, 0.0); - poisson_3[0] = tmpvar_4; - mediump vec2 tmpvar_5; - tmpvar_5 = vec2(0.527837, -0.085868); - poisson_3[1] = tmpvar_5; - mediump vec2 tmpvar_6; - tmpvar_6 = vec2(-0.040088, 0.536087); - poisson_3[2] = tmpvar_6; - mediump vec2 tmpvar_7; - tmpvar_7 = vec2(-0.670445, -0.179949); - poisson_3[3] = tmpvar_7; - mediump vec2 tmpvar_8; - tmpvar_8 = vec2(-0.419418, -0.616039); - poisson_3[4] = tmpvar_8; - mediump vec2 tmpvar_9; - tmpvar_9 = vec2(0.440453, -0.639399); - poisson_3[5] = tmpvar_9; - mediump vec2 tmpvar_10; - tmpvar_10 = vec2(-0.757088, 0.349334); - poisson_3[6] = tmpvar_10; - mediump vec2 tmpvar_11; - tmpvar_11 = vec2(0.574619, 0.685879); - poisson_3[7] = tmpvar_11; - int tmpvar_12; - tmpvar_12 = 0; - i_1 = tmpvar_12; - mediump vec4 tmpvar_13; - tmpvar_13 = vec4(0.0, 0.0, 0.0, 0.0); - c_2 = tmpvar_13; - while (true) { - if (!((i_1 < 8))) { - break; - }; - highp vec2 tmpvar_14; - tmpvar_14 = (c_2.xy + poisson_3[i_1]); - c_2.xy = tmpvar_14.xy.xy; - int tmpvar_15; - tmpvar_15 = (i_1 + 1); - i_1 = tmpvar_15; - }; - return c_2; -} - -void main () -{ - mediump vec4 xl_retval_16; - mediump vec4 tmpvar_17; - tmpvar_17 = xlat_main (); - mediump vec4 tmpvar_18; - tmpvar_18 = tmpvar_17; - xl_retval_16 = tmpvar_18; - mediump vec4 tmpvar_19; - tmpvar_19 = xl_retval_16.xyzw; - mediump vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - gl_FragData[0] = tmpvar_20; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/array-const-out.txt b/3rdparty/glsl-optimizer/tests/fragment/array-const-out.txt index e2fb85363..9d5af7120 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/array-const-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/array-const-out.txt @@ -7,4 +7,4 @@ void main () } -// inputs: 0, stats: 2 alu 0 tex 0 flow +// stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/array-const-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/array-const-outES.txt index cdd5f3a70..d08973d17 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/array-const-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/array-const-outES.txt @@ -7,4 +7,4 @@ void main () } -// inputs: 0, stats: 2 alu 0 tex 0 flow +// stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3.txt new file mode 100644 index 000000000..bad999c25 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3.txt @@ -0,0 +1,12 @@ +#version 300 es +out lowp vec4 _fragData; +void main () +{ + mediump vec4 c_1; + c_1.zw = vec2(0.0, 0.0); + c_1.xy = vec2(-0.34413, 0.050045); + _fragData = c_1; +} + + +// stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3Metal.txt new file mode 100644 index 000000000..06d025394 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3Metal.txt @@ -0,0 +1,21 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { +}; +struct xlatMtlShaderOutput { + half4 _fragData [[color(0)]]; +}; +struct xlatMtlShaderUniform { +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 c_1; + c_1.zw = half2(float2(0.0, 0.0)); + c_1.xy = half2(float2(-0.34413, 0.050045)); + _mtl_o._fragData = c_1; + return _mtl_o; +} + + +// stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/array-constconst-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/array-constconst-inES3.txt new file mode 100644 index 000000000..a9aa31b48 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/array-constconst-inES3.txt @@ -0,0 +1,26 @@ +#version 300 es +out mediump vec4 _fragData; +mediump vec4 xlat_main( ); +mediump vec4 xlat_main( ) { + highp vec2 poisson[8]; + poisson[0] = vec2( 0.000000, 0.000000); + poisson[1] = vec2( 0.527837, -0.0858680); + poisson[2] = vec2( -0.0400880, 0.536087); + poisson[3] = vec2( -0.670445, -0.179949); + poisson[4] = vec2( -0.419418, -0.616039); + poisson[5] = vec2( 0.440453, -0.639399); + poisson[6] = vec2( -0.757088, 0.349334); + poisson[7] = vec2( 0.574619, 0.685879); + mediump vec4 c; + highp int i = 0; + c = vec4( 0.000000); + for ( ; (i < 8); ( ++i )) { + c.xy += poisson[ i ]; + } + return c; +} +void main() { + mediump vec4 xl_retval; + xl_retval = xlat_main( ); + _fragData = vec4( xl_retval); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/array-constconst-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/array-constconst-ir.txt deleted file mode 100644 index c82bf6c9b..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/array-constconst-ir.txt +++ /dev/null @@ -1,64 +0,0 @@ -vec4 xlat_main () -{ - int i_1; - vec4 c_2; - vec2 poisson_3[8]; - vec2 tmpvar_4; - tmpvar_4 = vec2(0.0, 0.0); - poisson_3[0] = tmpvar_4; - vec2 tmpvar_5; - tmpvar_5 = vec2(0.527837, -0.085868); - poisson_3[1] = tmpvar_5; - vec2 tmpvar_6; - tmpvar_6 = vec2(-0.040088, 0.536087); - poisson_3[2] = tmpvar_6; - vec2 tmpvar_7; - tmpvar_7 = vec2(-0.670445, -0.179949); - poisson_3[3] = tmpvar_7; - vec2 tmpvar_8; - tmpvar_8 = vec2(-0.419418, -0.616039); - poisson_3[4] = tmpvar_8; - vec2 tmpvar_9; - tmpvar_9 = vec2(0.440453, -0.639399); - poisson_3[5] = tmpvar_9; - vec2 tmpvar_10; - tmpvar_10 = vec2(-0.757088, 0.349334); - poisson_3[6] = tmpvar_10; - vec2 tmpvar_11; - tmpvar_11 = vec2(0.574619, 0.685879); - poisson_3[7] = tmpvar_11; - int tmpvar_12; - tmpvar_12 = 0; - i_1 = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13 = vec4(0.0, 0.0, 0.0, 0.0); - c_2 = tmpvar_13; - while (true) { - if (!((i_1 < 8))) { - break; - }; - vec2 tmpvar_14; - tmpvar_14 = (c_2.xy + poisson_3[i_1]); - c_2.xy = tmpvar_14.xy.xy; - int tmpvar_15; - tmpvar_15 = (i_1 + 1); - i_1 = tmpvar_15; - }; - return c_2; -} - -void main () -{ - vec4 xl_retval_16; - vec4 tmpvar_17; - tmpvar_17 = xlat_main (); - vec4 tmpvar_18; - tmpvar_18 = tmpvar_17; - xl_retval_16 = tmpvar_18; - vec4 tmpvar_19; - tmpvar_19 = xl_retval_16.xyzw; - vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - gl_FragData[0] = tmpvar_20; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/array-constconst-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/array-constconst-irES.txt deleted file mode 100644 index 2d99b5314..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/array-constconst-irES.txt +++ /dev/null @@ -1,64 +0,0 @@ -mediump vec4 xlat_main () -{ - int i_1; - mediump vec4 c_2; - highp vec2 poisson_3[8]; - mediump vec2 tmpvar_4; - tmpvar_4 = vec2(0.0, 0.0); - poisson_3[0] = tmpvar_4; - mediump vec2 tmpvar_5; - tmpvar_5 = vec2(0.527837, -0.085868); - poisson_3[1] = tmpvar_5; - mediump vec2 tmpvar_6; - tmpvar_6 = vec2(-0.040088, 0.536087); - poisson_3[2] = tmpvar_6; - mediump vec2 tmpvar_7; - tmpvar_7 = vec2(-0.670445, -0.179949); - poisson_3[3] = tmpvar_7; - mediump vec2 tmpvar_8; - tmpvar_8 = vec2(-0.419418, -0.616039); - poisson_3[4] = tmpvar_8; - mediump vec2 tmpvar_9; - tmpvar_9 = vec2(0.440453, -0.639399); - poisson_3[5] = tmpvar_9; - mediump vec2 tmpvar_10; - tmpvar_10 = vec2(-0.757088, 0.349334); - poisson_3[6] = tmpvar_10; - mediump vec2 tmpvar_11; - tmpvar_11 = vec2(0.574619, 0.685879); - poisson_3[7] = tmpvar_11; - int tmpvar_12; - tmpvar_12 = 0; - i_1 = tmpvar_12; - mediump vec4 tmpvar_13; - tmpvar_13 = vec4(0.0, 0.0, 0.0, 0.0); - c_2 = tmpvar_13; - while (true) { - if (!((i_1 < 8))) { - break; - }; - highp vec2 tmpvar_14; - tmpvar_14 = (c_2.xy + poisson_3[i_1]); - c_2.xy = tmpvar_14.xy.xy; - int tmpvar_15; - tmpvar_15 = (i_1 + 1); - i_1 = tmpvar_15; - }; - return c_2; -} - -void main () -{ - mediump vec4 xl_retval_16; - mediump vec4 tmpvar_17; - tmpvar_17 = xlat_main (); - mediump vec4 tmpvar_18; - tmpvar_18 = tmpvar_17; - xl_retval_16 = tmpvar_18; - mediump vec4 tmpvar_19; - tmpvar_19 = xl_retval_16.xyzw; - mediump vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - gl_FragData[0] = tmpvar_20; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/array-constconst-out.txt b/3rdparty/glsl-optimizer/tests/fragment/array-constconst-out.txt index e2fb85363..9d5af7120 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/array-constconst-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/array-constconst-out.txt @@ -7,4 +7,4 @@ void main () } -// inputs: 0, stats: 2 alu 0 tex 0 flow +// stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES.txt index cdd5f3a70..d08973d17 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES.txt @@ -7,4 +7,4 @@ void main () } -// inputs: 0, stats: 2 alu 0 tex 0 flow +// stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3.txt new file mode 100644 index 000000000..ff5dd69e8 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3.txt @@ -0,0 +1,12 @@ +#version 300 es +out mediump vec4 _fragData; +void main () +{ + mediump vec4 c_1; + c_1.zw = vec2(0.0, 0.0); + c_1.xy = vec2(-0.34413, 0.050045); + _fragData = c_1; +} + + +// stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3Metal.txt new file mode 100644 index 000000000..06d025394 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3Metal.txt @@ -0,0 +1,21 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { +}; +struct xlatMtlShaderOutput { + half4 _fragData [[color(0)]]; +}; +struct xlatMtlShaderUniform { +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 c_1; + c_1.zw = half2(float2(0.0, 0.0)); + c_1.xy = half2(float2(-0.34413, 0.050045)); + _mtl_o._fragData = c_1; + return _mtl_o; +} + + +// stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/ast-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/ast-inES3.txt new file mode 100644 index 000000000..20d08a8e1 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/ast-inES3.txt @@ -0,0 +1,26 @@ +#version 300 es +out lowp vec4 _fragData; +void main() +{ + if (gl_FragCoord.x==1.0) + discard; + float a; + if (2==3) + a = 2.0; + if (3==4) + a = 3.0; + else + a = 4.0; + for (int i = 0; i < 10; ++i) + a += 1.0; + do { + a += 2.0; + } while (0==1); + a += 1.0; + a *= a; + a = -a; + --a; + a = sqrt(a); + a = 1.0 / a; + _fragData = vec4(a); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/ast-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/ast-ir.txt deleted file mode 100644 index efc75971d..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/ast-ir.txt +++ /dev/null @@ -1,70 +0,0 @@ -void main () -{ - int i_1; - float a_2; - if ((gl_FragCoord.x == 1.0)) { - discard; - }; - if ((2 == 3)) { - float tmpvar_3; - tmpvar_3 = 2.0; - a_2 = tmpvar_3; - }; - if ((3 == 4)) { - float tmpvar_4; - tmpvar_4 = 3.0; - a_2 = tmpvar_4; - } else { - float tmpvar_5; - tmpvar_5 = 4.0; - a_2 = tmpvar_5; - }; - int tmpvar_6; - tmpvar_6 = 0; - i_1 = tmpvar_6; - while (true) { - if (!((i_1 < 10))) { - break; - }; - float tmpvar_7; - tmpvar_7 = (a_2 + 1.0); - a_2 = tmpvar_7; - int tmpvar_8; - tmpvar_8 = (i_1 + 1); - i_1 = tmpvar_8; - }; - while (true) { - float tmpvar_9; - tmpvar_9 = (a_2 + 2.0); - a_2 = tmpvar_9; - if (!((0 == 1))) { - break; - }; - }; - float tmpvar_10; - tmpvar_10 = (a_2 + 1.0); - a_2 = tmpvar_10; - float tmpvar_11; - tmpvar_11 = (a_2 * a_2); - a_2 = tmpvar_11; - float tmpvar_12; - tmpvar_12 = -(a_2); - a_2 = tmpvar_12; - float tmpvar_13; - tmpvar_13 = (a_2 - 1.0); - a_2 = tmpvar_13; - float tmpvar_14; - tmpvar_14 = sqrt (a_2); - float tmpvar_15; - tmpvar_15 = tmpvar_14; - a_2 = tmpvar_15; - float tmpvar_16; - tmpvar_16 = (1.0 / a_2); - a_2 = tmpvar_16; - vec4 tmpvar_17; - tmpvar_17 = vec4(a_2); - vec4 tmpvar_18; - tmpvar_18 = tmpvar_17; - gl_FragColor = tmpvar_18; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/ast-out.txt b/3rdparty/glsl-optimizer/tests/fragment/ast-out.txt index 5ba2c6eef..fae455fda 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/ast-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/ast-out.txt @@ -11,15 +11,15 @@ void main () a_2 += 2.0; break; }; - float tmpvar_3; - tmpvar_3 = (a_2 + 1.0); - float tmpvar_4; - tmpvar_4 = inversesqrt((-( - (tmpvar_3 * tmpvar_3) - ) - 1.0)); - a_2 = tmpvar_4; - gl_FragColor = vec4(tmpvar_4); + a_2 += 1.0; + a_2 = (a_2 * a_2); + a_2 = -(a_2); + a_2 = (a_2 - 1.0); + a_2 = inversesqrt(a_2); + gl_FragColor = vec4(a_2); } -// inputs: 1, stats: 12 alu 1 tex 4 flow +// stats: 12 alu 1 tex 4 flow +// inputs: 1 +// #0: gl_FragCoord (high float) 4x1 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/fragment/ast-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/ast-outES3.txt new file mode 100644 index 000000000..ccf6706b2 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/ast-outES3.txt @@ -0,0 +1,27 @@ +#version 300 es +out lowp vec4 _fragData; +void main () +{ + highp float a_2; + if ((gl_FragCoord.x == 1.0)) { + discard; + }; + a_2 = 4.0; + for (int i_1 = 0; i_1 < 10; i_1++, a_2 += 1.0) { + }; + while (true) { + a_2 += 2.0; + break; + }; + a_2 += 1.0; + a_2 = (a_2 * a_2); + a_2 = -(a_2); + a_2 = (a_2 - 1.0); + a_2 = inversesqrt(a_2); + _fragData = vec4(a_2); +} + + +// stats: 12 alu 1 tex 4 flow +// inputs: 1 +// #0: gl_FragCoord (high float) 4x1 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/fragment/ast-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/ast-outES3Metal.txt new file mode 100644 index 000000000..3f7ca4fde --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/ast-outES3Metal.txt @@ -0,0 +1,37 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float4 gl_FragCoord [[position]]; +}; +struct xlatMtlShaderOutput { + half4 _fragData [[color(0)]]; +}; +struct xlatMtlShaderUniform { +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + float a_2; + if ((_mtl_i.gl_FragCoord.x == 1.0)) { + discard_fragment(); + }; + a_2 = 4.0; + for (int i_1 = 0; i_1 < 10; i_1++, a_2 += 1.0) { + }; + while (true) { + a_2 += 2.0; + break; + }; + a_2 += 1.0; + a_2 = (a_2 * a_2); + a_2 = -(a_2); + a_2 = (a_2 - 1.0); + a_2 = rsqrt(a_2); + _mtl_o._fragData = half4(float4(a_2)); + return _mtl_o; +} + + +// stats: 12 alu 1 tex 4 flow +// inputs: 1 +// #0: gl_FragCoord (high float) 4x1 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/fragment/basic-in.txt b/3rdparty/glsl-optimizer/tests/fragment/basic-in.txt index c3e52e501..61ea66d78 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/basic-in.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/basic-in.txt @@ -4,4 +4,5 @@ vec4 xlat_main() { void main() { vec4 x = xlat_main(); gl_FragData[0] = x; + gl_FragData[1] = vec4(1.0/0.0, -1.0/0.0, 0.0/0.0, -0.0/0.0); } diff --git a/3rdparty/glsl-optimizer/tests/fragment/basic-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/basic-ir.txt deleted file mode 100644 index 20d47c47c..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/basic-ir.txt +++ /dev/null @@ -1,18 +0,0 @@ -vec4 xlat_main () -{ - return vec4(1.0, 1e+07, 1e-06, 1.5); -} - -void main () -{ - vec4 x_1; - vec4 tmpvar_2; - tmpvar_2 = xlat_main (); - vec4 tmpvar_3; - tmpvar_3 = tmpvar_2; - x_1 = tmpvar_3; - vec4 tmpvar_4; - tmpvar_4 = x_1; - gl_FragData[0] = tmpvar_4; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/basic-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/basic-irES.txt deleted file mode 100644 index 26e1b87e2..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/basic-irES.txt +++ /dev/null @@ -1,20 +0,0 @@ -mediump vec4 xlat_main () -{ - return vec4(1.0, 1.0, 1.0, 1.0); -} - -void main () -{ - mediump vec4 xl_retval_1; - mediump vec4 tmpvar_2; - tmpvar_2 = xlat_main (); - mediump vec4 tmpvar_3; - tmpvar_3 = tmpvar_2; - xl_retval_1 = tmpvar_3; - mediump vec4 tmpvar_4; - tmpvar_4 = xl_retval_1.xyzw; - mediump vec4 tmpvar_5; - tmpvar_5 = tmpvar_4; - gl_FragData[0] = tmpvar_5; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/basic-out.txt b/3rdparty/glsl-optimizer/tests/fragment/basic-out.txt index dca274094..666f8b270 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/basic-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/basic-out.txt @@ -1,7 +1,8 @@ void main () { gl_FragData[0] = vec4(1.0, 1e+07, 1e-06, 1.5); + gl_FragData[1] = vec4((1.0/0.0), (-1.0/0.0), (0.0/0.0), (0.0/0.0)); } -// inputs: 0, stats: 1 alu 0 tex 0 flow +// stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/basic-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/basic-outES.txt index 486073c7c..3c287668c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/basic-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/basic-outES.txt @@ -4,4 +4,4 @@ void main () } -// inputs: 0, stats: 1 alu 0 tex 0 flow +// stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-ir.txt deleted file mode 100644 index 710b95a0b..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-ir.txt +++ /dev/null @@ -1,35 +0,0 @@ -uniform float mode; -float func ( - in float c_1 -) -{ - if ((mode == 2.0)) { - return c_1; - }; - if ((mode == 3.0)) { - discard; - }; - if ((mode == 10.0)) { - float tmpvar_2; - tmpvar_2 = 0.1; - c_1 = tmpvar_2; - }; - return c_1; -} - -void main () -{ - vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = gl_FragCoord; - c_3 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = func (c_3.x); - float tmpvar_6; - tmpvar_6 = tmpvar_5; - c_3.x = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7 = c_3; - gl_FragColor = tmpvar_7; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-out.txt b/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-out.txt index 5fcb9bcc9..23c6e2c19 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-out.txt @@ -22,4 +22,8 @@ void main () } -// inputs: 1, stats: 4 alu 1 tex 3 flow +// stats: 4 alu 1 tex 3 flow +// inputs: 1 +// #0: gl_FragCoord (high float) 4x1 [-1] loc 0 +// uniforms: 1 (total size: 0) +// #0: mode (high float) 1x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-ir.txt deleted file mode 100644 index 2a54ffddd..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-ir.txt +++ /dev/null @@ -1,19 +0,0 @@ -float tmpvar_1; -float tmpvar_2; -uniform float value; -float otherValue; -//; -//; -//; -void main () -{ -tmpvar_2 = log (value); -tmpvar_1 = tmpvar_2; -otherValue = tmpvar_1; - vec4 tmpvar_3; - tmpvar_3 = vec4(otherValue); - vec4 tmpvar_4; - tmpvar_4 = tmpvar_3; - gl_FragColor = tmpvar_4; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-out.txt b/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-out.txt index 769e28614..7046de034 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-out.txt @@ -5,4 +5,6 @@ void main () } -// inputs: 0, stats: 1 alu 0 tex 0 flow +// stats: 1 alu 0 tex 0 flow +// uniforms: 1 (total size: 0) +// #0: value (high float) 1x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/bug-inline-names-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/bug-inline-names-ir.txt deleted file mode 100644 index 507b6fe6a..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/bug-inline-names-ir.txt +++ /dev/null @@ -1,36 +0,0 @@ -varying float vv; -float foo ( - in float v_1 -) -{ - float a_2; - float b_3; - float a_4; - float tmpvar_5; - tmpvar_5 = v_1; - a_4 = tmpvar_5; - float tmpvar_6; - tmpvar_6 = sin (v_1); - float tmpvar_7; - tmpvar_7 = tmpvar_6; - a_2 = tmpvar_7; - float tmpvar_8; - tmpvar_8 = a_2; - b_3 = tmpvar_8; - float tmpvar_9; - tmpvar_9 = (a_4 + b_3); - a_4 = tmpvar_9; - return a_4; -} - -void main () -{ - float tmpvar_10; - tmpvar_10 = foo (vv); - vec4 tmpvar_11; - tmpvar_11 = vec4(tmpvar_10); - vec4 tmpvar_12; - tmpvar_12 = tmpvar_11; - gl_FragColor = tmpvar_12; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/bug-inline-names-out.txt b/3rdparty/glsl-optimizer/tests/fragment/bug-inline-names-out.txt index 254b89118..6863b900e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/bug-inline-names-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/bug-inline-names-out.txt @@ -5,4 +5,6 @@ void main () } -// inputs: 1, stats: 2 alu 0 tex 0 flow +// stats: 2 alu 0 tex 0 flow +// inputs: 1 +// #0: vv (high float) 1x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/bug-loop-null-from-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/bug-loop-null-from-ir.txt deleted file mode 100644 index 25925fff0..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/bug-loop-null-from-ir.txt +++ /dev/null @@ -1,43 +0,0 @@ -void main () -{ - int i_1; - int k_2; - float a_3; - float tmpvar_4; - tmpvar_4 = 0.0; - a_3 = tmpvar_4; - int tmpvar_5; - tmpvar_5 = 0; - k_2 = tmpvar_5; - int tmpvar_6; - tmpvar_6 = 0; - i_1 = tmpvar_6; - while (true) { - if (!((i_1 < 3))) { - break; - }; - float tmpvar_7; - tmpvar_7 = (a_3 + 1.0); - a_3 = tmpvar_7; - int tmpvar_8; - tmpvar_8 = (i_1 + 1); - i_1 = tmpvar_8; - }; - while (true) { - if (!((k_2 < 3))) { - break; - }; - float tmpvar_9; - tmpvar_9 = (a_3 + 3.0); - a_3 = tmpvar_9; - int tmpvar_10; - tmpvar_10 = (k_2 + 1); - k_2 = tmpvar_10; - }; - vec4 tmpvar_11; - tmpvar_11 = vec4(a_3); - vec4 tmpvar_12; - tmpvar_12 = tmpvar_11; - gl_FragColor = tmpvar_12; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/bug-loop-null-from-out.txt b/3rdparty/glsl-optimizer/tests/fragment/bug-loop-null-from-out.txt index 5b8087106..30d22fda5 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/bug-loop-null-from-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/bug-loop-null-from-out.txt @@ -4,4 +4,4 @@ void main () } -// inputs: 0, stats: 1 alu 0 tex 0 flow +// stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-ir.txt deleted file mode 100644 index 2a421ccb2..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-ir.txt +++ /dev/null @@ -1,53 +0,0 @@ -uniform int loopNum; -void main () -{ - vec4 r_1; - int myIdx_2; - vec4 tmpvar_3; - tmpvar_3 = vec4(0.0, 0.0, 0.0, 0.0); - r_1 = tmpvar_3; - int tmpvar_4; - tmpvar_4 = 1; - myIdx_2 = tmpvar_4; - while (true) { - if (!((myIdx_2 < loopNum))) { - break; - }; - float tmpvar_5; - tmpvar_5 = (r_1.x + 1.0); - r_1.x = tmpvar_5; - float tmpvar_6; - tmpvar_6 = (r_1.y + 2.0); - r_1.y = vec2(tmpvar_6).y; - float tmpvar_7; - tmpvar_7 = (r_1.z + 3.0); - r_1.z = vec3(tmpvar_7).z; - int tmpvar_8; - tmpvar_8 = (myIdx_2 + 1); - myIdx_2 = tmpvar_8; - }; - int tmpvar_9; - tmpvar_9 = 2; - myIdx_2 = tmpvar_9; - while (true) { - if (!((myIdx_2 < loopNum))) { - break; - }; - float tmpvar_10; - tmpvar_10 = (r_1.x + 1.0); - r_1.x = tmpvar_10; - float tmpvar_11; - tmpvar_11 = (r_1.y + 2.0); - r_1.y = vec2(tmpvar_11).y; - float tmpvar_12; - tmpvar_12 = (r_1.z + 3.0); - r_1.z = vec3(tmpvar_12).z; - int tmpvar_13; - tmpvar_13 = (myIdx_2 + 1); - myIdx_2 = tmpvar_13; - }; - vec4 tmpvar_14; - tmpvar_14 = r_1; - gl_FragColor = tmpvar_14; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-out.txt b/3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-out.txt index 275d379f0..c934a7645 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-out.txt @@ -20,4 +20,6 @@ void main () } -// inputs: 0, stats: 13 alu 0 tex 4 flow +// stats: 13 alu 0 tex 4 flow +// uniforms: 1 (total size: 0) +// #0: loopNum (high int) 1x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-ir.txt deleted file mode 100644 index 7287d7d68..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-ir.txt +++ /dev/null @@ -1,19 +0,0 @@ -uniform float value; -uniform float otherValue; -void main () -{ - float result_1; - float invValue_2; - float tmpvar_3; - tmpvar_3 = (1.0 / value); - invValue_2 = tmpvar_3; - float tmpvar_4; - tmpvar_4 = (otherValue / invValue_2); - result_1 = tmpvar_4; - vec4 tmpvar_5; - tmpvar_5 = vec4(result_1); - vec4 tmpvar_6; - tmpvar_6 = tmpvar_5; - gl_FragColor = tmpvar_6; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-out.txt b/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-out.txt index 920ca652a..b33dc1761 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-out.txt @@ -6,4 +6,7 @@ void main () } -// inputs: 0, stats: 2 alu 0 tex 0 flow +// stats: 2 alu 0 tex 0 flow +// uniforms: 2 (total size: 0) +// #0: value (high float) 1x1 [-1] +// #1: otherValue (high float) 1x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/bug-vectorize-tex-in.txt b/3rdparty/glsl-optimizer/tests/fragment/bug-vectorize-tex-in.txt new file mode 100644 index 000000000..46bf7ca67 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/bug-vectorize-tex-in.txt @@ -0,0 +1,17 @@ +uniform sampler2D _MainTex; +uniform sampler2D _RampTex; +varying vec2 varUV; +void main() +{ + vec4 orig = texture2D (_MainTex, varUV); + + // There was a bug where these three texture + // samples were "vectorized" in a wrong way, like + // t.xyz = texture2DProj (_RampTex, t.xyz).xyz; + + float rr = texture2D (_RampTex, orig.xx).x; + float gg = texture2D (_RampTex, orig.yy).y; + float bb = texture2D (_RampTex, orig.zz).z; + vec4 color = vec4 (rr, gg, bb, orig.w); + gl_FragData[0] = color; +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/bug-vectorize-tex-out.txt b/3rdparty/glsl-optimizer/tests/fragment/bug-vectorize-tex-out.txt new file mode 100644 index 000000000..c3c58fe3d --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/bug-vectorize-tex-out.txt @@ -0,0 +1,22 @@ +uniform sampler2D _MainTex; +uniform sampler2D _RampTex; +varying vec2 varUV; +void main () +{ + vec4 tmpvar_1; + tmpvar_1 = texture2D (_MainTex, varUV); + vec4 tmpvar_2; + tmpvar_2.x = texture2D (_RampTex, tmpvar_1.xx).x; + tmpvar_2.y = texture2D (_RampTex, tmpvar_1.yy).y; + tmpvar_2.z = texture2D (_RampTex, tmpvar_1.zz).z; + tmpvar_2.w = tmpvar_1.w; + gl_FragData[0] = tmpvar_2; +} + + +// stats: 0 alu 4 tex 0 flow +// inputs: 1 +// #0: varUV (high float) 2x1 [-1] +// textures: 2 +// #0: _MainTex (high 2d) 0x0 [-1] +// #1: _RampTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-inES3.txt new file mode 100644 index 000000000..067343da8 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-inES3.txt @@ -0,0 +1,14 @@ +#version 300 es +out mediump vec4 _fragData; + +in mediump vec4 uv; + +void main() +{ + mediump vec4 c; + c = uv; + c += gl_FragCoord; + c.x += gl_FrontFacing ? 1.0 : 0.0; + c.xy += gl_PointCoord; + _fragData = c; +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-outES3.txt new file mode 100644 index 000000000..8529f8d8f --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-outES3.txt @@ -0,0 +1,25 @@ +#version 300 es +out mediump vec4 _fragData; +in mediump vec4 uv; +void main () +{ + mediump vec4 c_1; + c_1 = (uv + gl_FragCoord); + highp float tmpvar_2; + if (gl_FrontFacing) { + tmpvar_2 = 1.0; + } else { + tmpvar_2 = 0.0; + }; + c_1.x = (c_1.x + tmpvar_2); + c_1.xy = (c_1.xy + gl_PointCoord); + _fragData = c_1; +} + + +// stats: 5 alu 0 tex 1 flow +// inputs: 4 +// #0: gl_PointCoord (medium float) 2x1 [-1] loc 23 +// #1: gl_FrontFacing (low bool) 1x1 [-1] loc 22 +// #2: gl_FragCoord (high float) 4x1 [-1] loc 0 +// #3: uv (medium float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-outES3Metal.txt new file mode 100644 index 000000000..c9a6e7908 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-outES3Metal.txt @@ -0,0 +1,37 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float2 gl_PointCoord [[point_coord]]; + bool gl_FrontFacing [[front_facing]]; + float4 gl_FragCoord [[position]]; + half4 uv; +}; +struct xlatMtlShaderOutput { + half4 _fragData [[color(0)]]; +}; +struct xlatMtlShaderUniform { +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 c_1; + c_1 = half4(((float4)_mtl_i.uv + _mtl_i.gl_FragCoord)); + float tmpvar_2; + if (_mtl_i.gl_FrontFacing) { + tmpvar_2 = 1.0; + } else { + tmpvar_2 = 0.0; + }; + c_1.x = (c_1.x + (half)tmpvar_2); + c_1.xy = half2(((float2)c_1.xy + _mtl_i.gl_PointCoord)); + _mtl_o._fragData = c_1; + return _mtl_o; +} + + +// stats: 5 alu 0 tex 1 flow +// inputs: 4 +// #0: gl_PointCoord (high float) 2x1 [-1] loc 23 +// #1: gl_FrontFacing (low bool) 1x1 [-1] loc 22 +// #2: gl_FragCoord (high float) 4x1 [-1] loc 0 +// #3: uv (medium float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/derivatives-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/derivatives-ir.txt deleted file mode 100644 index 98d0216d0..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/derivatives-ir.txt +++ /dev/null @@ -1,251 +0,0 @@ -varying vec4 xlv_TEXCOORD0; -float xll_dFdx ( - in float f_1 -) -{ - float tmpvar_2; - tmpvar_2 = dFdx (f_1); - return tmpvar_2; -} - -vec2 xll_dFdx ( - in vec2 v_3 -) -{ - vec2 tmpvar_4; - tmpvar_4 = dFdx (v_3); - return tmpvar_4; -} - -vec3 xll_dFdx ( - in vec3 v_5 -) -{ - vec3 tmpvar_6; - tmpvar_6 = dFdx (v_5); - return tmpvar_6; -} - -vec4 xll_dFdx ( - in vec4 v_7 -) -{ - vec4 tmpvar_8; - tmpvar_8 = dFdx (v_7); - return tmpvar_8; -} - -mat2 xll_dFdx ( - in mat2 m_9 -) -{ - vec2 tmpvar_10; - tmpvar_10 = dFdx (m_9[0]); - vec2 tmpvar_11; - tmpvar_11 = dFdx (m_9[1]); - mat2 tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_10; - tmpvar_12[0] = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_12[1] = tmpvar_14; - return tmpvar_12; -} - -mat3 xll_dFdx ( - in mat3 m_15 -) -{ - vec3 tmpvar_16; - tmpvar_16 = dFdx (m_15[0]); - vec3 tmpvar_17; - tmpvar_17 = dFdx (m_15[1]); - vec3 tmpvar_18; - tmpvar_18 = dFdx (m_15[2]); - mat3 tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_16; - tmpvar_19[0] = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_19[1] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_19[2] = tmpvar_22; - return tmpvar_19; -} - -mat4 xll_dFdx ( - in mat4 m_23 -) -{ - vec4 tmpvar_24; - tmpvar_24 = dFdx (m_23[0]); - vec4 tmpvar_25; - tmpvar_25 = dFdx (m_23[1]); - vec4 tmpvar_26; - tmpvar_26 = dFdx (m_23[2]); - vec4 tmpvar_27; - tmpvar_27 = dFdx (m_23[3]); - mat4 tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_24; - tmpvar_28[0] = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_28[1] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_28[2] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_28[3] = tmpvar_32; - return tmpvar_28; -} - -float xll_fwidth ( - in float f_33 -) -{ - float tmpvar_34; - tmpvar_34 = fwidth (f_33); - return tmpvar_34; -} - -vec2 xll_fwidth ( - in vec2 v_35 -) -{ - vec2 tmpvar_36; - tmpvar_36 = fwidth (v_35); - return tmpvar_36; -} - -vec3 xll_fwidth ( - in vec3 v_37 -) -{ - vec3 tmpvar_38; - tmpvar_38 = fwidth (v_37); - return tmpvar_38; -} - -vec4 xll_fwidth ( - in vec4 v_39 -) -{ - vec4 tmpvar_40; - tmpvar_40 = fwidth (v_39); - return tmpvar_40; -} - -mat2 xll_fwidth ( - in mat2 m_41 -) -{ - vec2 tmpvar_42; - tmpvar_42 = fwidth (m_41[0]); - vec2 tmpvar_43; - tmpvar_43 = fwidth (m_41[1]); - mat2 tmpvar_44; - vec2 tmpvar_45; - tmpvar_45 = tmpvar_42; - tmpvar_44[0] = tmpvar_45; - vec2 tmpvar_46; - tmpvar_46 = tmpvar_43; - tmpvar_44[1] = tmpvar_46; - return tmpvar_44; -} - -mat3 xll_fwidth ( - in mat3 m_47 -) -{ - vec3 tmpvar_48; - tmpvar_48 = fwidth (m_47[0]); - vec3 tmpvar_49; - tmpvar_49 = fwidth (m_47[1]); - vec3 tmpvar_50; - tmpvar_50 = fwidth (m_47[2]); - mat3 tmpvar_51; - vec3 tmpvar_52; - tmpvar_52 = tmpvar_48; - tmpvar_51[0] = tmpvar_52; - vec3 tmpvar_53; - tmpvar_53 = tmpvar_49; - tmpvar_51[1] = tmpvar_53; - vec3 tmpvar_54; - tmpvar_54 = tmpvar_50; - tmpvar_51[2] = tmpvar_54; - return tmpvar_51; -} - -mat4 xll_fwidth ( - in mat4 m_55 -) -{ - vec4 tmpvar_56; - tmpvar_56 = fwidth (m_55[0]); - vec4 tmpvar_57; - tmpvar_57 = fwidth (m_55[1]); - vec4 tmpvar_58; - tmpvar_58 = fwidth (m_55[2]); - vec4 tmpvar_59; - tmpvar_59 = fwidth (m_55[3]); - mat4 tmpvar_60; - vec4 tmpvar_61; - tmpvar_61 = tmpvar_56; - tmpvar_60[0] = tmpvar_61; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_57; - tmpvar_60[1] = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63 = tmpvar_58; - tmpvar_60[2] = tmpvar_63; - vec4 tmpvar_64; - tmpvar_64 = tmpvar_59; - tmpvar_60[3] = tmpvar_64; - return tmpvar_60; -} - -vec4 xlat_main ( - in vec4 uv_65 -) -{ - vec4 res_66; - float tmpvar_67; - tmpvar_67 = xll_dFdx (uv_65.x); - float tmpvar_68; - tmpvar_68 = tmpvar_67; - res_66.x = tmpvar_68; - float tmpvar_69; - tmpvar_69 = xll_dFdx (uv_65.y); - float tmpvar_70; - tmpvar_70 = tmpvar_69; - res_66.y = vec2(tmpvar_70).y; - vec2 tmpvar_71; - tmpvar_71 = xll_fwidth (uv_65.xy); - vec2 tmpvar_72; - tmpvar_72 = tmpvar_71; - res_66.zw = tmpvar_72.xxxy.zw; - return res_66; -} - -void main () -{ - vec4 xl_retval_73; - vec4 tmpvar_74; - tmpvar_74 = xlv_TEXCOORD0.xyzw; - vec4 tmpvar_75; - tmpvar_75 = xlat_main (tmpvar_74); - vec4 tmpvar_76; - tmpvar_76 = tmpvar_75; - xl_retval_73 = tmpvar_76; - vec4 tmpvar_77; - tmpvar_77 = xl_retval_73.xyzw; - vec4 tmpvar_78; - tmpvar_78 = tmpvar_77; - gl_FragData[0] = tmpvar_78; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/derivatives-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/derivatives-irES.txt deleted file mode 100644 index 5d0918038..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/derivatives-irES.txt +++ /dev/null @@ -1,255 +0,0 @@ -#extension GL_OES_standard_derivatives : enable -varying highp vec4 xlv_TEXCOORD0; -mediump float xll_dFdx ( - in mediump float f_1 -) -{ - mediump float tmpvar_2; - tmpvar_2 = dFdx (f_1); - return tmpvar_2; -} - -mediump vec2 xll_dFdx ( - in mediump vec2 v_3 -) -{ - mediump vec2 tmpvar_4; - tmpvar_4 = dFdx (v_3); - return tmpvar_4; -} - -mediump vec3 xll_dFdx ( - in mediump vec3 v_5 -) -{ - mediump vec3 tmpvar_6; - tmpvar_6 = dFdx (v_5); - return tmpvar_6; -} - -mediump vec4 xll_dFdx ( - in mediump vec4 v_7 -) -{ - mediump vec4 tmpvar_8; - tmpvar_8 = dFdx (v_7); - return tmpvar_8; -} - -mediump mat2 xll_dFdx ( - in mediump mat2 m_9 -) -{ - mediump vec2 tmpvar_10; - tmpvar_10 = dFdx (m_9[0]); - mediump vec2 tmpvar_11; - tmpvar_11 = dFdx (m_9[1]); - mediump mat2 tmpvar_12; - mediump vec2 tmpvar_13; - tmpvar_13 = tmpvar_10; - tmpvar_12[0] = tmpvar_13; - mediump vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_12[1] = tmpvar_14; - return tmpvar_12; -} - -mediump mat3 xll_dFdx ( - in mediump mat3 m_15 -) -{ - mediump vec3 tmpvar_16; - tmpvar_16 = dFdx (m_15[0]); - mediump vec3 tmpvar_17; - tmpvar_17 = dFdx (m_15[1]); - mediump vec3 tmpvar_18; - tmpvar_18 = dFdx (m_15[2]); - mediump mat3 tmpvar_19; - mediump vec3 tmpvar_20; - tmpvar_20 = tmpvar_16; - tmpvar_19[0] = tmpvar_20; - mediump vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_19[1] = tmpvar_21; - mediump vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_19[2] = tmpvar_22; - return tmpvar_19; -} - -mediump mat4 xll_dFdx ( - in mediump mat4 m_23 -) -{ - mediump vec4 tmpvar_24; - tmpvar_24 = dFdx (m_23[0]); - mediump vec4 tmpvar_25; - tmpvar_25 = dFdx (m_23[1]); - mediump vec4 tmpvar_26; - tmpvar_26 = dFdx (m_23[2]); - mediump vec4 tmpvar_27; - tmpvar_27 = dFdx (m_23[3]); - mediump mat4 tmpvar_28; - mediump vec4 tmpvar_29; - tmpvar_29 = tmpvar_24; - tmpvar_28[0] = tmpvar_29; - mediump vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_28[1] = tmpvar_30; - mediump vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_28[2] = tmpvar_31; - mediump vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_28[3] = tmpvar_32; - return tmpvar_28; -} - -mediump float xll_fwidth ( - in mediump float f_33 -) -{ - mediump float tmpvar_34; - tmpvar_34 = fwidth (f_33); - return tmpvar_34; -} - -mediump vec2 xll_fwidth ( - in mediump vec2 v_35 -) -{ - mediump vec2 tmpvar_36; - tmpvar_36 = fwidth (v_35); - return tmpvar_36; -} - -mediump vec3 xll_fwidth ( - in mediump vec3 v_37 -) -{ - mediump vec3 tmpvar_38; - tmpvar_38 = fwidth (v_37); - return tmpvar_38; -} - -mediump vec4 xll_fwidth ( - in mediump vec4 v_39 -) -{ - mediump vec4 tmpvar_40; - tmpvar_40 = fwidth (v_39); - return tmpvar_40; -} - -mediump mat2 xll_fwidth ( - in mediump mat2 m_41 -) -{ - mediump vec2 tmpvar_42; - tmpvar_42 = fwidth (m_41[0]); - mediump vec2 tmpvar_43; - tmpvar_43 = fwidth (m_41[1]); - mediump mat2 tmpvar_44; - mediump vec2 tmpvar_45; - tmpvar_45 = tmpvar_42; - tmpvar_44[0] = tmpvar_45; - mediump vec2 tmpvar_46; - tmpvar_46 = tmpvar_43; - tmpvar_44[1] = tmpvar_46; - return tmpvar_44; -} - -mediump mat3 xll_fwidth ( - in mediump mat3 m_47 -) -{ - mediump vec3 tmpvar_48; - tmpvar_48 = fwidth (m_47[0]); - mediump vec3 tmpvar_49; - tmpvar_49 = fwidth (m_47[1]); - mediump vec3 tmpvar_50; - tmpvar_50 = fwidth (m_47[2]); - mediump mat3 tmpvar_51; - mediump vec3 tmpvar_52; - tmpvar_52 = tmpvar_48; - tmpvar_51[0] = tmpvar_52; - mediump vec3 tmpvar_53; - tmpvar_53 = tmpvar_49; - tmpvar_51[1] = tmpvar_53; - mediump vec3 tmpvar_54; - tmpvar_54 = tmpvar_50; - tmpvar_51[2] = tmpvar_54; - return tmpvar_51; -} - -mediump mat4 xll_fwidth ( - in mediump mat4 m_55 -) -{ - mediump vec4 tmpvar_56; - tmpvar_56 = fwidth (m_55[0]); - mediump vec4 tmpvar_57; - tmpvar_57 = fwidth (m_55[1]); - mediump vec4 tmpvar_58; - tmpvar_58 = fwidth (m_55[2]); - mediump vec4 tmpvar_59; - tmpvar_59 = fwidth (m_55[3]); - mediump mat4 tmpvar_60; - mediump vec4 tmpvar_61; - tmpvar_61 = tmpvar_56; - tmpvar_60[0] = tmpvar_61; - mediump vec4 tmpvar_62; - tmpvar_62 = tmpvar_57; - tmpvar_60[1] = tmpvar_62; - mediump vec4 tmpvar_63; - tmpvar_63 = tmpvar_58; - tmpvar_60[2] = tmpvar_63; - mediump vec4 tmpvar_64; - tmpvar_64 = tmpvar_59; - tmpvar_60[3] = tmpvar_64; - return tmpvar_60; -} - -mediump vec4 xlat_main ( - in highp vec4 uv_65 -) -{ - lowp vec4 res_66; - mediump float tmpvar_67; - tmpvar_67 = xll_dFdx (uv_65.x); - mediump float tmpvar_68; - tmpvar_68 = tmpvar_67; - res_66.x = tmpvar_68; - mediump float tmpvar_69; - tmpvar_69 = xll_dFdx (uv_65.y); - mediump float tmpvar_70; - tmpvar_70 = tmpvar_69; - res_66.y = vec2(tmpvar_70).y; - mediump float tmpvar_71; - tmpvar_71 = xll_fwidth (uv_65.z); - mediump float tmpvar_72; - tmpvar_72 = tmpvar_71; - res_66.z = vec3(tmpvar_72).z; - mediump float tmpvar_73; - tmpvar_73 = 1.0; - res_66.w = vec4(tmpvar_73).w; - return res_66; -} - -void main () -{ - mediump vec4 xl_retval_74; - highp vec4 tmpvar_75; - tmpvar_75 = xlv_TEXCOORD0.xyzw; - mediump vec4 tmpvar_76; - tmpvar_76 = xlat_main (tmpvar_75); - mediump vec4 tmpvar_77; - tmpvar_77 = tmpvar_76; - xl_retval_74 = tmpvar_77; - mediump vec4 tmpvar_78; - tmpvar_78 = xl_retval_74.xyzw; - mediump vec4 tmpvar_79; - tmpvar_79 = tmpvar_78; - gl_FragData[0] = tmpvar_79; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/derivatives-out.txt b/3rdparty/glsl-optimizer/tests/fragment/derivatives-out.txt index d0dcaf80a..44b439e6a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/derivatives-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/derivatives-out.txt @@ -2,12 +2,14 @@ varying vec4 xlv_TEXCOORD0; void main () { vec4 res_1; - vec2 cse_2; - cse_2 = dFdx(xlv_TEXCOORD0.xy); - res_1.xy = cse_2; - res_1.zw = (abs(cse_2) + abs(dFdy(xlv_TEXCOORD0.xy))); + vec2 tmpvar_2; + tmpvar_2 = dFdx(xlv_TEXCOORD0.xy); + res_1.xy = tmpvar_2; + res_1.zw = (abs(tmpvar_2) + abs(dFdy(xlv_TEXCOORD0.xy))); gl_FragData[0] = res_1; } -// inputs: 1, stats: 5 alu 0 tex 0 flow +// stats: 5 alu 0 tex 0 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/derivatives-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/derivatives-outES.txt index 170e91252..bdb188f4c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/derivatives-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/derivatives-outES.txt @@ -19,4 +19,6 @@ void main () } -// inputs: 1, stats: 8 alu 0 tex 0 flow +// stats: 8 alu 0 tex 0 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/estest1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/estest1-ir.txt deleted file mode 100644 index a3545c602..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/estest1-ir.txt +++ /dev/null @@ -1,54 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv0; - vec2 uv1; -}; -uniform vec4 _Color; -uniform sampler2D _Detail; -uniform sampler2D _MainTex; -varying vec4 xlv_TEXCOORD0; -varying vec4 xlv_TEXCOORD1; -vec4 frag ( - in v2f i_1 -) -{ - vec4 c_2; - vec4 tmpvar_3; - tmpvar_3 = texture2D (_MainTex, i_1.uv0); - vec4 tmpvar_4; - tmpvar_4 = (_Color * tmpvar_3); - c_2 = tmpvar_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_Detail, i_1.uv1); - vec4 tmpvar_6; - tmpvar_6 = ((c_2 * tmpvar_5) * 2.0); - c_2 = tmpvar_6; - return c_2; -} - -void main () -{ - v2f xlt_i_7; - vec4 xl_retval_8; - vec2 tmpvar_9; - tmpvar_9 = xlv_TEXCOORD0.xy; - vec2 tmpvar_10; - tmpvar_10 = tmpvar_9; - xlt_i_7.uv0 = tmpvar_10; - vec2 tmpvar_11; - tmpvar_11 = xlv_TEXCOORD1.xy; - vec2 tmpvar_12; - tmpvar_12 = tmpvar_11; - xlt_i_7.uv1 = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13 = frag (xlt_i_7); - vec4 tmpvar_14; - tmpvar_14 = tmpvar_13; - xl_retval_8 = tmpvar_14; - vec4 tmpvar_15; - tmpvar_15 = xl_retval_8.xyzw; - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - gl_FragData[0] = tmpvar_16; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/estest1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/estest1-out.txt index 23d11bb0b..534e63483 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/estest1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/estest1-out.txt @@ -5,8 +5,19 @@ varying vec4 xlv_TEXCOORD0; varying vec4 xlv_TEXCOORD1; void main () { - gl_FragData[0] = (((_Color * texture2D (_MainTex, xlv_TEXCOORD0.xy)) * texture2D (_Detail, xlv_TEXCOORD1.xy)) * 2.0); + vec4 c_1; + c_1 = (_Color * texture2D (_MainTex, xlv_TEXCOORD0.xy)); + c_1 = ((c_1 * texture2D (_Detail, xlv_TEXCOORD1.xy)) * 2.0); + gl_FragData[0] = c_1; } -// inputs: 2, stats: 3 alu 2 tex 0 flow +// stats: 3 alu 2 tex 0 flow +// inputs: 2 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] +// #1: xlv_TEXCOORD1 (high float) 4x1 [-1] +// uniforms: 1 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// textures: 2 +// #0: _Detail (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/fragdepth-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/fragdepth-inES3.txt new file mode 100644 index 000000000..b4c4f32e2 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/fragdepth-inES3.txt @@ -0,0 +1,13 @@ +#version 300 es +void xlat_main( out lowp vec4 ocol, out mediump float oz ) { + ocol = vec4( 0.5); + oz = 0.9; +} +out lowp vec4 _fragData; +void main() { + lowp vec4 xlt_ocol; + mediump float xlt_oz; + xlat_main( xlt_ocol, xlt_oz); + _fragData = vec4(xlt_ocol); + gl_FragDepth = float(xlt_oz); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/fragdepth-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/fragdepth-ir.txt deleted file mode 100644 index 1b0c26ac9..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/fragdepth-ir.txt +++ /dev/null @@ -1,28 +0,0 @@ -void xlat_main ( - out vec4 ocol_1, - out float oz_2 -) -{ - vec4 tmpvar_3; - tmpvar_3 = vec4(0.5, 0.5, 0.5, 0.5); - ocol_1 = tmpvar_3; - float tmpvar_4; - tmpvar_4 = 0.9; - oz_2 = tmpvar_4; -} - -void main () -{ - float xlt_oz_5; - vec4 xlt_ocol_6; - xlat_main (xlt_ocol_6, xlt_oz_5); - vec4 tmpvar_7; - tmpvar_7 = xlt_ocol_6.xyzw; - vec4 tmpvar_8; - tmpvar_8 = tmpvar_7; - gl_FragData[0] = tmpvar_8; - float tmpvar_9; - tmpvar_9 = xlt_oz_5; - gl_FragDepth = tmpvar_9; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/fragdepth-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/fragdepth-irES.txt deleted file mode 100644 index 8f0b8c220..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/fragdepth-irES.txt +++ /dev/null @@ -1,29 +0,0 @@ -#extension GL_EXT_frag_depth : enable -void xlat_main ( - out lowp vec4 ocol_1, - out mediump float oz_2 -) -{ - mediump vec4 tmpvar_3; - tmpvar_3 = vec4(0.5, 0.5, 0.5, 0.5); - ocol_1 = tmpvar_3; - mediump float tmpvar_4; - tmpvar_4 = 0.9; - oz_2 = tmpvar_4; -} - -void main () -{ - mediump float xlt_oz_5; - lowp vec4 xlt_ocol_6; - xlat_main (xlt_ocol_6, xlt_oz_5); - lowp vec4 tmpvar_7; - tmpvar_7 = xlt_ocol_6.xyzw; - lowp vec4 tmpvar_8; - tmpvar_8 = tmpvar_7; - gl_FragData[0] = tmpvar_8; - mediump float tmpvar_9; - tmpvar_9 = xlt_oz_5; - gl_FragDepthEXT = tmpvar_9; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/fragdepth-out.txt b/3rdparty/glsl-optimizer/tests/fragment/fragdepth-out.txt index 9aaac3e16..d8b2c7a85 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/fragdepth-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/fragdepth-out.txt @@ -5,4 +5,4 @@ void main () } -// inputs: 0, stats: 2 alu 0 tex 0 flow +// stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES.txt index 516fdf733..39939006e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES.txt @@ -6,4 +6,4 @@ void main () } -// inputs: 0, stats: 2 alu 0 tex 0 flow +// stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES3.txt new file mode 100644 index 000000000..77e3099d9 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES3.txt @@ -0,0 +1,10 @@ +#version 300 es +out lowp vec4 _fragData; +void main () +{ + _fragData = vec4(0.5, 0.5, 0.5, 0.5); + gl_FragDepth = 0.9; +} + + +// stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES3Metal.txt new file mode 100644 index 000000000..4e428db75 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES3Metal.txt @@ -0,0 +1,20 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { +}; +struct xlatMtlShaderOutput { + float gl_FragDepth [[depth(any)]]; + half4 _fragData [[color(0)]]; +}; +struct xlatMtlShaderUniform { +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + _mtl_o._fragData = half4(float4(0.5, 0.5, 0.5, 0.5)); + _mtl_o.gl_FragDepth = 0.9; + return _mtl_o; +} + + +// stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-inES.txt b/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-inES.txt new file mode 100644 index 000000000..261a9627a --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-inES.txt @@ -0,0 +1,20 @@ +#extension GL_EXT_shader_framebuffer_fetch : require + +struct v2f { + highp vec4 vertex; + lowp vec4 color; +}; +void frag (in v2f i, inout lowp vec4 ocol) +{ + ocol.xy = i.color.xy; + ocol.z *= 2.0; +} +varying lowp vec4 xlv_TEXCOORD0; +void main() { + v2f xlt_i; + xlt_i.vertex = vec4(0.0); + xlt_i.color = vec4(xlv_TEXCOORD0); + lowp vec4 xlt_ocol = vec4(gl_LastFragData[0]); + frag (xlt_i, xlt_ocol); + gl_FragData[0] = vec4(xlt_ocol); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-inES3.txt new file mode 100644 index 000000000..a61a8252c --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-inES3.txt @@ -0,0 +1,24 @@ +#version 300 es +#extension GL_EXT_shader_framebuffer_fetch : require +#define gl_FragColor _glesFragData[0] +#define gl_FragData _glesFragData +layout(location = 0) inout mediump vec4 _glesFragData[4]; + +struct v2f { + highp vec4 vertex; + lowp vec4 color; +}; +void frag (in v2f i, inout lowp vec4 ocol) +{ + ocol.xy = i.color.xy; + ocol.z *= 2.0; +} +in lowp vec4 xlv_TEXCOORD0; +void main() { + v2f xlt_i; + xlt_i.vertex = vec4(0.0); + xlt_i.color = vec4(xlv_TEXCOORD0); + lowp vec4 xlt_ocol = vec4(gl_FragData[0]); + frag (xlt_i, xlt_ocol); + gl_FragData[0] = vec4(xlt_ocol); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES.txt new file mode 100644 index 000000000..f319502cd --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES.txt @@ -0,0 +1,21 @@ +#extension GL_EXT_shader_framebuffer_fetch : enable +varying lowp vec4 xlv_TEXCOORD0; +void main () +{ + lowp vec4 xlt_ocol_1; + mediump vec4 tmpvar_2; + tmpvar_2 = gl_LastFragData[0]; + xlt_ocol_1 = tmpvar_2; + lowp vec4 ocol_3; + ocol_3.w = xlt_ocol_1.w; + ocol_3.xy = xlv_TEXCOORD0.xy; + ocol_3.z = (xlt_ocol_1.z * 2.0); + xlt_ocol_1 = ocol_3; + gl_FragData[0] = ocol_3; +} + + +// stats: 1 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_LastFragData (medium float) 4x1 [4] loc 24 +// #1: xlv_TEXCOORD0 (low float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES3.txt new file mode 100644 index 000000000..c313db96d --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES3.txt @@ -0,0 +1,22 @@ +#version 300 es +#extension GL_EXT_shader_framebuffer_fetch : enable +layout(location=0) inout mediump vec4 _glesFragData[4]; +in lowp vec4 xlv_TEXCOORD0; +void main () +{ + lowp vec4 xlt_ocol_1; + mediump vec4 tmpvar_2; + tmpvar_2 = _glesFragData[0]; + xlt_ocol_1 = tmpvar_2; + lowp vec4 ocol_3; + ocol_3.w = xlt_ocol_1.w; + ocol_3.xy = xlv_TEXCOORD0.xy; + ocol_3.z = (xlt_ocol_1.z * 2.0); + xlt_ocol_1 = ocol_3; + _glesFragData[0] = ocol_3; +} + + +// stats: 1 alu 0 tex 0 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (low float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES3Metal.txt new file mode 100644 index 000000000..1d924da0d --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES3Metal.txt @@ -0,0 +1,29 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + half4 xlv_TEXCOORD0; + half4 _glesFragData_0 [[color(0)]]; +}; +struct xlatMtlShaderOutput { + half4 _glesFragData_0 [[color(0)]]; +}; +struct xlatMtlShaderUniform { +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 xlt_ocol_1; + xlt_ocol_1 = _mtl_i._glesFragData_0; + half4 ocol_2; + ocol_2.w = xlt_ocol_1.w; + ocol_2.xy = _mtl_i.xlv_TEXCOORD0.xy; + ocol_2.z = (xlt_ocol_1.z * (half)2.0); + xlt_ocol_1 = ocol_2; + _mtl_o._glesFragData_0 = ocol_2; + return _mtl_o; +} + + +// stats: 1 alu 0 tex 0 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (low float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-in.txt b/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-in.txt index 2d055164a..e5a4e771b 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-in.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-in.txt @@ -2,6 +2,7 @@ uniform float inInit = 13.0; // accept uniform initializers uniform mat4x3 nonSqMat; // non square matrices +uniform vec4 uniInit = vec4(1.0,2.0,3.0,4.0); void main() { @@ -18,5 +19,7 @@ void main() v.y += arr[0]; v.z += arr.length(); // array length + v.w += uniInit.w; + gl_FragColor = v; } diff --git a/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-inES3.txt new file mode 100644 index 000000000..f5aeeccae --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-inES3.txt @@ -0,0 +1,23 @@ +#version 300 es +out lowp vec4 _fragData; + +uniform mat4x3 nonSqMat; // non square matrices + + +void main() +{ + const float cosPI = cos(3.1415); // built-in calls in constant initializers + + mediump vec4 v; + v.x = 1.2f; // accepts 'f' suffix + v.y = 5.0f; + v.z = 0.0; + v.w = cosPI; + v.x += nonSqMat[0][0]; + + float arr[4] = float[](1,2,3,4); // array initializer + v.y += arr[0]; + v.z += float(arr.length()); // array length + + _fragData = v; +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-ir.txt deleted file mode 100644 index 563b8040f..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-ir.txt +++ /dev/null @@ -1,40 +0,0 @@ -#version 120 -uniform float inInit = 13.0; -uniform mat4x3 nonSqMat; -void main () -{ - float arr_1[4]; - vec4 v_2; - float cosPI_3 = -1.0; - float tmpvar_4; - tmpvar_4 = -1.0; - cosPI_3 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = 1.2; - v_2.x = tmpvar_5; - float tmpvar_6; - tmpvar_6 = float(5); - v_2.y = vec2(tmpvar_6).y; - float tmpvar_7; - tmpvar_7 = inInit; - v_2.z = vec3(tmpvar_7).z; - float tmpvar_8; - tmpvar_8 = cosPI_3; - v_2.w = vec4(tmpvar_8).w; - float tmpvar_9; - tmpvar_9 = (v_2.x + nonSqMat[0][0]); - v_2.x = tmpvar_9; - float tmpvar_10[4]; - tmpvar_10 = float[4](1.0, 2.0, 3.0, 4.0); - arr_1 = tmpvar_10; - float tmpvar_11; - tmpvar_11 = (v_2.y + arr_1[0]); - v_2.y = vec2(tmpvar_11).y; - float tmpvar_12; - tmpvar_12 = (v_2.z + float(4)); - v_2.z = vec3(tmpvar_12).z; - vec4 tmpvar_13; - tmpvar_13 = v_2; - gl_FragColor = tmpvar_13; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-out.txt b/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-out.txt index 622853356..d3f9ca6c9 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-out.txt @@ -1,15 +1,20 @@ #version 120 uniform float inInit = 13.0; uniform mat4x3 nonSqMat; +uniform vec4 uniInit = vec4(1.0, 2.0, 3.0, 4.0); void main () { vec4 v_1; - v_1.w = -1.0; v_1.x = (1.2 + nonSqMat[0].x); v_1.y = 6.0; v_1.z = (inInit + 4.0); + v_1.w = (-1.0 + uniInit.w); gl_FragColor = v_1; } -// inputs: 0, stats: 4 alu 0 tex 0 flow +// stats: 4 alu 0 tex 0 flow +// uniforms: 3 (total size: 0) +// #0: inInit (high float) 1x1 [-1] +// #1: nonSqMat (high float) 3x4 [-1] +// #2: uniInit (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-outES3.txt new file mode 100644 index 000000000..ec264248e --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-outES3.txt @@ -0,0 +1,17 @@ +#version 300 es +out lowp vec4 _fragData; +uniform highp mat4x3 nonSqMat; +void main () +{ + mediump vec4 v_1; + v_1.w = -1.0; + v_1.x = (1.2 + nonSqMat[0].x); + v_1.y = 6.0; + v_1.z = 4.0; + _fragData = v_1; +} + + +// stats: 4 alu 0 tex 0 flow +// uniforms: 1 (total size: 0) +// #0: nonSqMat (high float) 3x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-outES3Metal.txt new file mode 100644 index 000000000..94760a640 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-outES3Metal.txt @@ -0,0 +1,26 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { +}; +struct xlatMtlShaderOutput { + half4 _fragData [[color(0)]]; +}; +struct xlatMtlShaderUniform { + float4x3 nonSqMat; +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 v_1; + v_1.w = half(-1.0); + v_1.x = ((half)(1.2 + _mtl_u.nonSqMat[0].x)); + v_1.y = half(6.0); + v_1.z = half(4.0); + _mtl_o._fragData = v_1; + return _mtl_o; +} + + +// stats: 4 alu 0 tex 0 flow +// uniforms: 1 (total size: 64) +// #0: nonSqMat (high float) 3x4 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-ir.txt deleted file mode 100644 index 04b1d20ba..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-ir.txt +++ /dev/null @@ -1,10 +0,0 @@ -#version 140 -in vec4 col; -out vec4 fragCol; -void main () -{ - vec4 tmpvar_1; - tmpvar_1 = col; - fragCol = tmpvar_1; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-out.txt b/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-out.txt index dea2ad18e..5ea193bde 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-out.txt @@ -7,4 +7,6 @@ void main () } -// inputs: 1, stats: 0 alu 0 tex 0 flow +// stats: 0 alu 0 tex 0 flow +// inputs: 1 +// #0: col (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-ir.txt deleted file mode 100644 index 10b55932b..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-ir.txt +++ /dev/null @@ -1,48 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; - vec4 color; -}; -vec4 xlat_main ( - in v2f i_1 -) -{ - vec4 c_2; - vec4 tmpvar_3; - tmpvar_3 = i_1.color; - c_2 = tmpvar_3; - vec2 tmpvar_4; - tmpvar_4 = (c_2.xy + i_1.uv); - c_2.xy = tmpvar_4.xy.xy; - return c_2; -} - -void main () -{ - v2f xlt_i_5; - vec4 xl_retval_6; - vec4 tmpvar_7; - tmpvar_7 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_5.pos = tmpvar_7; - vec2 tmpvar_8; - tmpvar_8 = gl_TexCoord[0].xy; - vec2 tmpvar_9; - tmpvar_9 = tmpvar_8; - xlt_i_5.uv = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10 = gl_Color.xyzw; - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - xlt_i_5.color = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12 = xlat_main (xlt_i_5); - vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - xl_retval_6 = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = xl_retval_6.xyzw; - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - gl_FragData[0] = tmpvar_15; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-irES.txt deleted file mode 100644 index a76d10854..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-irES.txt +++ /dev/null @@ -1,50 +0,0 @@ -struct v2f { - highp vec4 pos; - highp vec2 uv; - highp vec4 color; -}; -varying highp vec2 xlv_TEXCOORD0; -varying highp vec4 xlv_COLOR; -mediump vec4 xlat_main ( - in v2f i_1 -) -{ - mediump vec4 c_2; - highp vec4 tmpvar_3; - tmpvar_3 = i_1.color; - c_2 = tmpvar_3; - highp vec2 tmpvar_4; - tmpvar_4 = (c_2.xy + i_1.uv); - c_2.xy = tmpvar_4.xy.xy; - return c_2; -} - -void main () -{ - v2f xlt_i_5; - mediump vec4 xl_retval_6; - mediump vec4 tmpvar_7; - tmpvar_7 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_5.pos = tmpvar_7; - highp vec2 tmpvar_8; - tmpvar_8 = xlv_TEXCOORD0.xy; - highp vec2 tmpvar_9; - tmpvar_9 = tmpvar_8; - xlt_i_5.uv = tmpvar_9; - highp vec4 tmpvar_10; - tmpvar_10 = xlv_COLOR.xyzw; - highp vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - xlt_i_5.color = tmpvar_11; - mediump vec4 tmpvar_12; - tmpvar_12 = xlat_main (xlt_i_5); - mediump vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - xl_retval_6 = tmpvar_13; - mediump vec4 tmpvar_14; - tmpvar_14 = xl_retval_6.xyzw; - mediump vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - gl_FragData[0] = tmpvar_15; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-out.txt b/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-out.txt index 3b3bc07ab..996cffa2b 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-out.txt @@ -7,4 +7,7 @@ void main () } -// inputs: 2, stats: 1 alu 0 tex 0 flow +// stats: 1 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [1] loc 4 diff --git a/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-outES.txt index 0fd194113..e4836bef2 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-outES.txt @@ -4,11 +4,12 @@ void main () { mediump vec4 c_1; c_1 = xlv_COLOR; - highp vec2 tmpvar_2; - tmpvar_2 = (c_1.xy + xlv_TEXCOORD0); - c_1.xy = tmpvar_2; + c_1.xy = (c_1.xy + xlv_TEXCOORD0); gl_FragData[0] = c_1; } -// inputs: 2, stats: 1 alu 0 tex 0 flow +// stats: 1 alu 0 tex 0 flow +// inputs: 2 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// #1: xlv_COLOR (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-irES.txt deleted file mode 100644 index 80247c0ba..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-irES.txt +++ /dev/null @@ -1,36 +0,0 @@ -varying highp vec2 xlv_TEXCOORD0; -varying highp vec4 xlv_COLOR; -mediump vec4 xlat_main ( - in highp vec2 uv_1, - in highp vec4 color_2 -) -{ - mediump vec4 c_3; - highp vec4 tmpvar_4; - tmpvar_4 = color_2; - c_3 = tmpvar_4; - highp vec2 tmpvar_5; - tmpvar_5 = (c_3.xy + uv_1); - c_3.xy = tmpvar_5.xy.xy; - return c_3; -} - -void main () -{ - mediump vec4 xl_retval_6; - highp vec2 tmpvar_7; - tmpvar_7 = xlv_TEXCOORD0.xy; - highp vec4 tmpvar_8; - tmpvar_8 = xlv_COLOR.xyzw; - mediump vec4 tmpvar_9; - tmpvar_9 = xlat_main (tmpvar_7, tmpvar_8); - mediump vec4 tmpvar_10; - tmpvar_10 = tmpvar_9; - xl_retval_6 = tmpvar_10; - mediump vec4 tmpvar_11; - tmpvar_11 = xl_retval_6.xyzw; - mediump vec4 tmpvar_12; - tmpvar_12 = tmpvar_11; - gl_FragData[0] = tmpvar_12; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-outES.txt index 0fd194113..e4836bef2 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-outES.txt @@ -4,11 +4,12 @@ void main () { mediump vec4 c_1; c_1 = xlv_COLOR; - highp vec2 tmpvar_2; - tmpvar_2 = (c_1.xy + xlv_TEXCOORD0); - c_1.xy = tmpvar_2; + c_1.xy = (c_1.xy + xlv_TEXCOORD0); gl_FragData[0] = c_1; } -// inputs: 2, stats: 1 alu 0 tex 0 flow +// stats: 1 alu 0 tex 0 flow +// inputs: 2 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// #1: xlv_COLOR (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/intrinsics-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/intrinsics-inES3.txt new file mode 100644 index 000000000..51f5c886d --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/intrinsics-inES3.txt @@ -0,0 +1,79 @@ +#version 300 es +float xll_mod( float x, float y ) { + float d = x / y; + float f = fract (abs(d)) * y; + return d >= 0.0 ? f : -f; +} +vec2 xll_mod( vec2 x, vec2 y ) { + vec2 d = x / y; + vec2 f = fract (abs(d)) * y; + return vec2 (d.x >= 0.0 ? f.x : -f.x, d.y >= 0.0 ? f.y : -f.y); +} +vec3 xll_mod( vec3 x, vec3 y ) { + vec3 d = x / y; + vec3 f = fract (abs(d)) * y; + return vec3 (d.x >= 0.0 ? f.x : -f.x, d.y >= 0.0 ? f.y : -f.y, d.z >= 0.0 ? f.z : -f.z); +} +vec4 xll_mod( vec4 x, vec4 y ) { + vec4 d = x / y; + vec4 f = fract (abs(d)) * y; + return vec4 (d.x >= 0.0 ? f.x : -f.x, d.y >= 0.0 ? f.y : -f.y, d.z >= 0.0 ? f.z : -f.z, d.w >= 0.0 ? f.w : -f.w); +} +float xll_modf( float x, out int ip) { + ip = int (x); + return x-float(ip); +} +float xll_modf( float x, out float ip) { + int i = int (x); + ip = float(i); + return x-ip; +} +vec2 xll_modf( vec2 x, out ivec2 ip) { + ip = ivec2 (x); + return x-vec2(ip); +} +vec2 xll_modf( vec2 x, out vec2 ip) { + ivec2 i = ivec2 (x); + ip = vec2(i); + return x-ip; +} +vec3 xll_modf( vec3 x, out ivec3 ip) { + ip = ivec3 (x); + return x-vec3(ip); +} +vec3 xll_modf( vec3 x, out vec3 ip) { + ivec3 i = ivec3 (x); + ip = vec3(i); + return x-ip; +} +vec4 xll_modf( vec4 x, out ivec4 ip) { + ip = ivec4 (x); + return x-vec4(ip); +} +vec4 xll_modf( vec4 x, out vec4 ip) { + ivec4 i = ivec4 (x); + ip = vec4(i); + return x-ip; +} +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); + c.x += xll_mod( uv.x , 2.00000); + c.xy += xll_mod( uv.xy , vec2( 2.00000)); + c.xyz += xll_mod( uv.xyz , vec3( 2.00000)); + c.xyzw += xll_mod( uv.xyzw , vec4( 2.00000)); + c.x += xll_modf( uv.x , d.x ); + c.xy += xll_modf( uv.xy , d.xy ); + c.xyz += xll_modf( uv.xyz , d.xyz ); + c.xyzw += xll_modf( uv.xyzw , d.xyzw ); + return c; +} +in highp vec4 xlv_TEXCOORD0; +out mediump vec4 _fragData; +void main() { + mediump vec4 xl_retval; + xl_retval = xlat_main( vec4(xlv_TEXCOORD0)); + _fragData = vec4( xl_retval); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/intrinsics-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/intrinsics-ir.txt deleted file mode 100644 index f07919a52..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/intrinsics-ir.txt +++ /dev/null @@ -1,350 +0,0 @@ -varying vec4 xlv_TEXCOORD0; -float xll_mod ( - in float x_1, - in float y_2 -) -{ - float f_3; - float d_4; - float tmpvar_5; - tmpvar_5 = (x_1 / y_2); - d_4 = tmpvar_5; - float tmpvar_6; - tmpvar_6 = abs (d_4); - float tmpvar_7; - tmpvar_7 = fract (tmpvar_6); - float tmpvar_8; - tmpvar_8 = (tmpvar_7 * y_2); - f_3 = tmpvar_8; - float tmpvar_9; - if ((d_4 >= 0.0)) { - tmpvar_9 = f_3; - } else { - tmpvar_9 = -(f_3); - }; - return tmpvar_9; -} - -vec2 xll_mod ( - in vec2 x_10, - in vec2 y_11 -) -{ - vec2 f_12; - vec2 d_13; - vec2 tmpvar_14; - tmpvar_14 = (x_10 / y_11); - d_13 = tmpvar_14; - vec2 tmpvar_15; - tmpvar_15 = abs (d_13); - vec2 tmpvar_16; - tmpvar_16 = fract (tmpvar_15); - vec2 tmpvar_17; - tmpvar_17 = (tmpvar_16 * y_11); - f_12 = tmpvar_17; - float tmpvar_18; - if ((d_13.x >= 0.0)) { - tmpvar_18 = f_12.x; - } else { - tmpvar_18 = -(f_12.x); - }; - float tmpvar_19; - if ((d_13.y >= 0.0)) { - tmpvar_19 = f_12.y; - } else { - tmpvar_19 = -(f_12.y); - }; - vec2 tmpvar_20; - tmpvar_20.x = tmpvar_18; - tmpvar_20.y = tmpvar_19; - return tmpvar_20; -} - -vec3 xll_mod ( - in vec3 x_21, - in vec3 y_22 -) -{ - vec3 f_23; - vec3 d_24; - vec3 tmpvar_25; - tmpvar_25 = (x_21 / y_22); - d_24 = tmpvar_25; - vec3 tmpvar_26; - tmpvar_26 = abs (d_24); - vec3 tmpvar_27; - tmpvar_27 = fract (tmpvar_26); - vec3 tmpvar_28; - tmpvar_28 = (tmpvar_27 * y_22); - f_23 = tmpvar_28; - float tmpvar_29; - if ((d_24.x >= 0.0)) { - tmpvar_29 = f_23.x; - } else { - tmpvar_29 = -(f_23.x); - }; - float tmpvar_30; - if ((d_24.y >= 0.0)) { - tmpvar_30 = f_23.y; - } else { - tmpvar_30 = -(f_23.y); - }; - float tmpvar_31; - if ((d_24.z >= 0.0)) { - tmpvar_31 = f_23.z; - } else { - tmpvar_31 = -(f_23.z); - }; - vec3 tmpvar_32; - tmpvar_32.x = tmpvar_29; - tmpvar_32.y = tmpvar_30; - tmpvar_32.z = tmpvar_31; - return tmpvar_32; -} - -vec4 xll_mod ( - in vec4 x_33, - in vec4 y_34 -) -{ - vec4 f_35; - vec4 d_36; - vec4 tmpvar_37; - tmpvar_37 = (x_33 / y_34); - d_36 = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = abs (d_36); - vec4 tmpvar_39; - tmpvar_39 = fract (tmpvar_38); - vec4 tmpvar_40; - tmpvar_40 = (tmpvar_39 * y_34); - f_35 = tmpvar_40; - float tmpvar_41; - if ((d_36.x >= 0.0)) { - tmpvar_41 = f_35.x; - } else { - tmpvar_41 = -(f_35.x); - }; - float tmpvar_42; - if ((d_36.y >= 0.0)) { - tmpvar_42 = f_35.y; - } else { - tmpvar_42 = -(f_35.y); - }; - float tmpvar_43; - if ((d_36.z >= 0.0)) { - tmpvar_43 = f_35.z; - } else { - tmpvar_43 = -(f_35.z); - }; - float tmpvar_44; - if ((d_36.w >= 0.0)) { - tmpvar_44 = f_35.w; - } else { - tmpvar_44 = -(f_35.w); - }; - vec4 tmpvar_45; - tmpvar_45.x = tmpvar_41; - tmpvar_45.y = tmpvar_42; - tmpvar_45.z = tmpvar_43; - tmpvar_45.w = tmpvar_44; - return tmpvar_45; -} - -float xll_modf ( - in float x_46, - out int ip_47 -) -{ - int tmpvar_48; - tmpvar_48 = int(x_46); - ip_47 = tmpvar_48; - return (x_46 - float(ip_47)); -} - -float xll_modf ( - in float x_49, - out float ip_50 -) -{ - int i_51; - int tmpvar_52; - tmpvar_52 = int(x_49); - i_51 = tmpvar_52; - float tmpvar_53; - tmpvar_53 = float(i_51); - ip_50 = tmpvar_53; - return (x_49 - ip_50); -} - -vec2 xll_modf ( - in vec2 x_54, - out ivec2 ip_55 -) -{ - ivec2 tmpvar_56; - tmpvar_56 = ivec2(x_54).xy; - ivec2 tmpvar_57; - tmpvar_57 = tmpvar_56; - ip_55 = tmpvar_57; - vec2 tmpvar_58; - tmpvar_58 = vec2(ip_55).xy; - return (x_54 - tmpvar_58); -} - -vec2 xll_modf ( - in vec2 x_59, - out vec2 ip_60 -) -{ - ivec2 i_61; - ivec2 tmpvar_62; - tmpvar_62 = ivec2(x_59).xy; - ivec2 tmpvar_63; - tmpvar_63 = tmpvar_62; - i_61 = tmpvar_63; - vec2 tmpvar_64; - tmpvar_64 = vec2(i_61).xy; - vec2 tmpvar_65; - tmpvar_65 = tmpvar_64; - ip_60 = tmpvar_65; - return (x_59 - ip_60); -} - -vec3 xll_modf ( - in vec3 x_66, - out ivec3 ip_67 -) -{ - ivec3 tmpvar_68; - tmpvar_68 = ivec3(x_66).xyz; - ivec3 tmpvar_69; - tmpvar_69 = tmpvar_68; - ip_67 = tmpvar_69; - vec3 tmpvar_70; - tmpvar_70 = vec3(ip_67).xyz; - return (x_66 - tmpvar_70); -} - -vec3 xll_modf ( - in vec3 x_71, - out vec3 ip_72 -) -{ - ivec3 i_73; - ivec3 tmpvar_74; - tmpvar_74 = ivec3(x_71).xyz; - ivec3 tmpvar_75; - tmpvar_75 = tmpvar_74; - i_73 = tmpvar_75; - vec3 tmpvar_76; - tmpvar_76 = vec3(i_73).xyz; - vec3 tmpvar_77; - tmpvar_77 = tmpvar_76; - ip_72 = tmpvar_77; - return (x_71 - ip_72); -} - -vec4 xll_modf ( - in vec4 x_78, - out ivec4 ip_79 -) -{ - ivec4 tmpvar_80; - tmpvar_80 = ivec4(x_78).xyzw; - ivec4 tmpvar_81; - tmpvar_81 = tmpvar_80; - ip_79 = tmpvar_81; - vec4 tmpvar_82; - tmpvar_82 = vec4(ip_79).xyzw; - return (x_78 - tmpvar_82); -} - -vec4 xll_modf ( - in vec4 x_83, - out vec4 ip_84 -) -{ - ivec4 i_85; - ivec4 tmpvar_86; - tmpvar_86 = ivec4(x_83).xyzw; - ivec4 tmpvar_87; - tmpvar_87 = tmpvar_86; - i_85 = tmpvar_87; - vec4 tmpvar_88; - tmpvar_88 = vec4(i_85).xyzw; - vec4 tmpvar_89; - tmpvar_89 = tmpvar_88; - ip_84 = tmpvar_89; - return (x_83 - ip_84); -} - -vec4 xlat_main ( - in vec4 uv_90 -) -{ - vec4 d_91; - vec4 c_92; - vec4 tmpvar_93; - tmpvar_93 = vec4(0.0, 0.0, 0.0, 0.0); - c_92 = tmpvar_93; - float tmpvar_94; - tmpvar_94 = xll_mod (uv_90.x, 2.0); - float tmpvar_95; - tmpvar_95 = (c_92.x + tmpvar_94); - c_92.x = tmpvar_95; - vec2 tmpvar_96; - tmpvar_96 = xll_mod (uv_90.xy, vec2(2.0, 2.0)); - vec2 tmpvar_97; - tmpvar_97 = (c_92.xy + tmpvar_96); - c_92.xy = tmpvar_97.xy.xy; - vec3 tmpvar_98; - tmpvar_98 = xll_mod (uv_90.xyz, vec3(2.0, 2.0, 2.0)); - vec3 tmpvar_99; - tmpvar_99 = (c_92.xyz + tmpvar_98); - c_92.xyz = tmpvar_99.xyz.xyz; - vec4 tmpvar_100; - tmpvar_100 = xll_mod (uv_90.xyzw, vec4(2.0, 2.0, 2.0, 2.0)); - vec4 tmpvar_101; - tmpvar_101 = (c_92.xyzw + tmpvar_100); - c_92 = tmpvar_101.xyzw.xyzw; - float tmpvar_102; - tmpvar_102 = xll_modf (uv_90.x, d_91.x); - float tmpvar_103; - tmpvar_103 = (c_92.x + tmpvar_102); - c_92.x = tmpvar_103; - vec2 tmpvar_104; - tmpvar_104 = xll_modf (uv_90.xy, d_91.xy); - vec2 tmpvar_105; - tmpvar_105 = (c_92.xy + tmpvar_104); - c_92.xy = tmpvar_105.xy.xy; - vec3 tmpvar_106; - tmpvar_106 = xll_modf (uv_90.xyz, d_91.xyz); - vec3 tmpvar_107; - tmpvar_107 = (c_92.xyz + tmpvar_106); - c_92.xyz = tmpvar_107.xyz.xyz; - vec4 tmpvar_108; - tmpvar_108 = xll_modf (uv_90.xyzw, d_91.xyzw); - vec4 tmpvar_109; - tmpvar_109 = (c_92.xyzw + tmpvar_108); - c_92 = tmpvar_109.xyzw.xyzw; - return c_92; -} - -void main () -{ - vec4 xl_retval_110; - vec4 tmpvar_111; - tmpvar_111 = xlv_TEXCOORD0.xyzw; - vec4 tmpvar_112; - tmpvar_112 = xlat_main (tmpvar_111); - vec4 tmpvar_113; - tmpvar_113 = tmpvar_112; - xl_retval_110 = tmpvar_113; - vec4 tmpvar_114; - tmpvar_114 = xl_retval_110.xyzw; - vec4 tmpvar_115; - tmpvar_115 = tmpvar_114; - gl_FragData[0] = tmpvar_115; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/intrinsics-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/intrinsics-irES.txt deleted file mode 100644 index e741b9b5a..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/intrinsics-irES.txt +++ /dev/null @@ -1,350 +0,0 @@ -varying highp vec4 xlv_TEXCOORD0; -mediump float xll_mod ( - in mediump float x_1, - in mediump float y_2 -) -{ - mediump float f_3; - mediump float d_4; - mediump float tmpvar_5; - tmpvar_5 = (x_1 / y_2); - d_4 = tmpvar_5; - mediump float tmpvar_6; - tmpvar_6 = abs (d_4); - mediump float tmpvar_7; - tmpvar_7 = fract (tmpvar_6); - mediump float tmpvar_8; - tmpvar_8 = (tmpvar_7 * y_2); - f_3 = tmpvar_8; - mediump float tmpvar_9; - if ((d_4 >= 0.0)) { - tmpvar_9 = f_3; - } else { - tmpvar_9 = -(f_3); - }; - return tmpvar_9; -} - -mediump vec2 xll_mod ( - in mediump vec2 x_10, - in mediump vec2 y_11 -) -{ - mediump vec2 f_12; - mediump vec2 d_13; - mediump vec2 tmpvar_14; - tmpvar_14 = (x_10 / y_11); - d_13 = tmpvar_14; - mediump vec2 tmpvar_15; - tmpvar_15 = abs (d_13); - mediump vec2 tmpvar_16; - tmpvar_16 = fract (tmpvar_15); - mediump vec2 tmpvar_17; - tmpvar_17 = (tmpvar_16 * y_11); - f_12 = tmpvar_17; - mediump float tmpvar_18; - if ((d_13.x >= 0.0)) { - tmpvar_18 = f_12.x; - } else { - tmpvar_18 = -(f_12.x); - }; - mediump float tmpvar_19; - if ((d_13.y >= 0.0)) { - tmpvar_19 = f_12.y; - } else { - tmpvar_19 = -(f_12.y); - }; - mediump vec2 tmpvar_20; - tmpvar_20.x = tmpvar_18; - tmpvar_20.y = tmpvar_19; - return tmpvar_20; -} - -mediump vec3 xll_mod ( - in mediump vec3 x_21, - in mediump vec3 y_22 -) -{ - mediump vec3 f_23; - mediump vec3 d_24; - mediump vec3 tmpvar_25; - tmpvar_25 = (x_21 / y_22); - d_24 = tmpvar_25; - mediump vec3 tmpvar_26; - tmpvar_26 = abs (d_24); - mediump vec3 tmpvar_27; - tmpvar_27 = fract (tmpvar_26); - mediump vec3 tmpvar_28; - tmpvar_28 = (tmpvar_27 * y_22); - f_23 = tmpvar_28; - mediump float tmpvar_29; - if ((d_24.x >= 0.0)) { - tmpvar_29 = f_23.x; - } else { - tmpvar_29 = -(f_23.x); - }; - mediump float tmpvar_30; - if ((d_24.y >= 0.0)) { - tmpvar_30 = f_23.y; - } else { - tmpvar_30 = -(f_23.y); - }; - mediump float tmpvar_31; - if ((d_24.z >= 0.0)) { - tmpvar_31 = f_23.z; - } else { - tmpvar_31 = -(f_23.z); - }; - mediump vec3 tmpvar_32; - tmpvar_32.x = tmpvar_29; - tmpvar_32.y = tmpvar_30; - tmpvar_32.z = tmpvar_31; - return tmpvar_32; -} - -mediump vec4 xll_mod ( - in mediump vec4 x_33, - in mediump vec4 y_34 -) -{ - mediump vec4 f_35; - mediump vec4 d_36; - mediump vec4 tmpvar_37; - tmpvar_37 = (x_33 / y_34); - d_36 = tmpvar_37; - mediump vec4 tmpvar_38; - tmpvar_38 = abs (d_36); - mediump vec4 tmpvar_39; - tmpvar_39 = fract (tmpvar_38); - mediump vec4 tmpvar_40; - tmpvar_40 = (tmpvar_39 * y_34); - f_35 = tmpvar_40; - mediump float tmpvar_41; - if ((d_36.x >= 0.0)) { - tmpvar_41 = f_35.x; - } else { - tmpvar_41 = -(f_35.x); - }; - mediump float tmpvar_42; - if ((d_36.y >= 0.0)) { - tmpvar_42 = f_35.y; - } else { - tmpvar_42 = -(f_35.y); - }; - mediump float tmpvar_43; - if ((d_36.z >= 0.0)) { - tmpvar_43 = f_35.z; - } else { - tmpvar_43 = -(f_35.z); - }; - mediump float tmpvar_44; - if ((d_36.w >= 0.0)) { - tmpvar_44 = f_35.w; - } else { - tmpvar_44 = -(f_35.w); - }; - mediump vec4 tmpvar_45; - tmpvar_45.x = tmpvar_41; - tmpvar_45.y = tmpvar_42; - tmpvar_45.z = tmpvar_43; - tmpvar_45.w = tmpvar_44; - return tmpvar_45; -} - -mediump float xll_modf ( - in mediump float x_46, - out int ip_47 -) -{ - int tmpvar_48; - tmpvar_48 = int(x_46); - ip_47 = tmpvar_48; - return (x_46 - float(ip_47)); -} - -mediump float xll_modf ( - in mediump float x_49, - out mediump float ip_50 -) -{ - int i_51; - int tmpvar_52; - tmpvar_52 = int(x_49); - i_51 = tmpvar_52; - mediump float tmpvar_53; - tmpvar_53 = float(i_51); - ip_50 = tmpvar_53; - return (x_49 - ip_50); -} - -mediump vec2 xll_modf ( - in mediump vec2 x_54, - out ivec2 ip_55 -) -{ - ivec2 tmpvar_56; - tmpvar_56 = ivec2(x_54).xy; - ivec2 tmpvar_57; - tmpvar_57 = tmpvar_56; - ip_55 = tmpvar_57; - mediump vec2 tmpvar_58; - tmpvar_58 = vec2(ip_55).xy; - return (x_54 - tmpvar_58); -} - -mediump vec2 xll_modf ( - in mediump vec2 x_59, - out mediump vec2 ip_60 -) -{ - ivec2 i_61; - ivec2 tmpvar_62; - tmpvar_62 = ivec2(x_59).xy; - ivec2 tmpvar_63; - tmpvar_63 = tmpvar_62; - i_61 = tmpvar_63; - mediump vec2 tmpvar_64; - tmpvar_64 = vec2(i_61).xy; - mediump vec2 tmpvar_65; - tmpvar_65 = tmpvar_64; - ip_60 = tmpvar_65; - return (x_59 - ip_60); -} - -mediump vec3 xll_modf ( - in mediump vec3 x_66, - out ivec3 ip_67 -) -{ - ivec3 tmpvar_68; - tmpvar_68 = ivec3(x_66).xyz; - ivec3 tmpvar_69; - tmpvar_69 = tmpvar_68; - ip_67 = tmpvar_69; - mediump vec3 tmpvar_70; - tmpvar_70 = vec3(ip_67).xyz; - return (x_66 - tmpvar_70); -} - -mediump vec3 xll_modf ( - in mediump vec3 x_71, - out mediump vec3 ip_72 -) -{ - ivec3 i_73; - ivec3 tmpvar_74; - tmpvar_74 = ivec3(x_71).xyz; - ivec3 tmpvar_75; - tmpvar_75 = tmpvar_74; - i_73 = tmpvar_75; - mediump vec3 tmpvar_76; - tmpvar_76 = vec3(i_73).xyz; - mediump vec3 tmpvar_77; - tmpvar_77 = tmpvar_76; - ip_72 = tmpvar_77; - return (x_71 - ip_72); -} - -mediump vec4 xll_modf ( - in mediump vec4 x_78, - out ivec4 ip_79 -) -{ - ivec4 tmpvar_80; - tmpvar_80 = ivec4(x_78).xyzw; - ivec4 tmpvar_81; - tmpvar_81 = tmpvar_80; - ip_79 = tmpvar_81; - mediump vec4 tmpvar_82; - tmpvar_82 = vec4(ip_79).xyzw; - return (x_78 - tmpvar_82); -} - -mediump vec4 xll_modf ( - in mediump vec4 x_83, - out mediump vec4 ip_84 -) -{ - ivec4 i_85; - ivec4 tmpvar_86; - tmpvar_86 = ivec4(x_83).xyzw; - ivec4 tmpvar_87; - tmpvar_87 = tmpvar_86; - i_85 = tmpvar_87; - mediump vec4 tmpvar_88; - tmpvar_88 = vec4(i_85).xyzw; - mediump vec4 tmpvar_89; - tmpvar_89 = tmpvar_88; - ip_84 = tmpvar_89; - return (x_83 - ip_84); -} - -mediump vec4 xlat_main ( - in highp vec4 uv_90 -) -{ - mediump vec4 d_91; - mediump vec4 c_92; - mediump vec4 tmpvar_93; - tmpvar_93 = vec4(0.0, 0.0, 0.0, 0.0); - c_92 = tmpvar_93; - mediump float tmpvar_94; - tmpvar_94 = xll_mod (uv_90.x, 2.0); - mediump float tmpvar_95; - tmpvar_95 = (c_92.x + tmpvar_94); - c_92.x = tmpvar_95; - mediump vec2 tmpvar_96; - tmpvar_96 = xll_mod (uv_90.xy, vec2(2.0, 2.0)); - mediump vec2 tmpvar_97; - tmpvar_97 = (c_92.xy + tmpvar_96); - c_92.xy = tmpvar_97.xy.xy; - mediump vec3 tmpvar_98; - tmpvar_98 = xll_mod (uv_90.xyz, vec3(2.0, 2.0, 2.0)); - mediump vec3 tmpvar_99; - tmpvar_99 = (c_92.xyz + tmpvar_98); - c_92.xyz = tmpvar_99.xyz.xyz; - mediump vec4 tmpvar_100; - tmpvar_100 = xll_mod (uv_90.xyzw, vec4(2.0, 2.0, 2.0, 2.0)); - mediump vec4 tmpvar_101; - tmpvar_101 = (c_92.xyzw + tmpvar_100); - c_92 = tmpvar_101.xyzw.xyzw; - mediump float tmpvar_102; - tmpvar_102 = xll_modf (uv_90.x, d_91.x); - mediump float tmpvar_103; - tmpvar_103 = (c_92.x + tmpvar_102); - c_92.x = tmpvar_103; - mediump vec2 tmpvar_104; - tmpvar_104 = xll_modf (uv_90.xy, d_91.xy); - mediump vec2 tmpvar_105; - tmpvar_105 = (c_92.xy + tmpvar_104); - c_92.xy = tmpvar_105.xy.xy; - mediump vec3 tmpvar_106; - tmpvar_106 = xll_modf (uv_90.xyz, d_91.xyz); - mediump vec3 tmpvar_107; - tmpvar_107 = (c_92.xyz + tmpvar_106); - c_92.xyz = tmpvar_107.xyz.xyz; - mediump vec4 tmpvar_108; - tmpvar_108 = xll_modf (uv_90.xyzw, d_91.xyzw); - mediump vec4 tmpvar_109; - tmpvar_109 = (c_92.xyzw + tmpvar_108); - c_92 = tmpvar_109.xyzw.xyzw; - return c_92; -} - -void main () -{ - mediump vec4 xl_retval_110; - highp vec4 tmpvar_111; - tmpvar_111 = xlv_TEXCOORD0.xyzw; - mediump vec4 tmpvar_112; - tmpvar_112 = xlat_main (tmpvar_111); - mediump vec4 tmpvar_113; - tmpvar_113 = tmpvar_112; - xl_retval_110 = tmpvar_113; - mediump vec4 tmpvar_114; - tmpvar_114 = xl_retval_110.xyzw; - mediump vec4 tmpvar_115; - tmpvar_115 = tmpvar_114; - gl_FragData[0] = tmpvar_115; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/intrinsics-out.txt b/3rdparty/glsl-optimizer/tests/fragment/intrinsics-out.txt index f3a0f5ad1..49d36f8df 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/intrinsics-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/intrinsics-out.txt @@ -111,4 +111,6 @@ void main () } -// inputs: 1, stats: 56 alu 0 tex 10 flow +// stats: 56 alu 0 tex 10 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES.txt index 8caecaf75..8e947dbae 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES.txt @@ -97,9 +97,9 @@ void main () c_1 = (c_1 + tmpvar_22); highp float tmpvar_23; mediump float ip_24; - highp float tmpvar_25; - tmpvar_25 = float(int(xlv_TEXCOORD0.x)); - ip_24 = tmpvar_25; + 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; @@ -127,4 +127,6 @@ void main () } -// inputs: 1, stats: 56 alu 0 tex 10 flow +// stats: 56 alu 0 tex 10 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3.txt new file mode 100644 index 000000000..3c4a536a1 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3.txt @@ -0,0 +1,134 @@ +#version 300 es +in highp vec4 xlv_TEXCOORD0; +out mediump vec4 _fragData; +void main () +{ + mediump vec4 c_1; + c_1 = vec4(0.0, 0.0, 0.0, 0.0); + highp float tmpvar_2; + tmpvar_2 = (xlv_TEXCOORD0.x / 2.0); + highp float tmpvar_3; + tmpvar_3 = (fract(abs(tmpvar_2)) * 2.0); + highp float tmpvar_4; + if ((tmpvar_2 >= 0.0)) { + tmpvar_4 = tmpvar_3; + } else { + tmpvar_4 = -(tmpvar_3); + }; + c_1.x = tmpvar_4; + highp vec2 tmpvar_5; + tmpvar_5 = (xlv_TEXCOORD0.xy / vec2(2.0, 2.0)); + highp vec2 tmpvar_6; + tmpvar_6 = (fract(abs(tmpvar_5)) * vec2(2.0, 2.0)); + highp float tmpvar_7; + if ((tmpvar_5.x >= 0.0)) { + tmpvar_7 = tmpvar_6.x; + } else { + tmpvar_7 = -(tmpvar_6.x); + }; + highp float tmpvar_8; + if ((tmpvar_5.y >= 0.0)) { + tmpvar_8 = tmpvar_6.y; + } else { + tmpvar_8 = -(tmpvar_6.y); + }; + highp vec2 tmpvar_9; + tmpvar_9.x = tmpvar_7; + tmpvar_9.y = tmpvar_8; + c_1.xy = (c_1.xy + tmpvar_9); + highp vec3 tmpvar_10; + tmpvar_10 = (xlv_TEXCOORD0.xyz / vec3(2.0, 2.0, 2.0)); + highp vec3 tmpvar_11; + tmpvar_11 = (fract(abs(tmpvar_10)) * vec3(2.0, 2.0, 2.0)); + highp float tmpvar_12; + if ((tmpvar_10.x >= 0.0)) { + tmpvar_12 = tmpvar_11.x; + } else { + tmpvar_12 = -(tmpvar_11.x); + }; + highp float tmpvar_13; + if ((tmpvar_10.y >= 0.0)) { + tmpvar_13 = tmpvar_11.y; + } else { + tmpvar_13 = -(tmpvar_11.y); + }; + highp float tmpvar_14; + if ((tmpvar_10.z >= 0.0)) { + tmpvar_14 = tmpvar_11.z; + } else { + tmpvar_14 = -(tmpvar_11.z); + }; + highp vec3 tmpvar_15; + tmpvar_15.x = tmpvar_12; + tmpvar_15.y = tmpvar_13; + tmpvar_15.z = tmpvar_14; + c_1.xyz = (c_1.xyz + tmpvar_15); + highp vec4 tmpvar_16; + tmpvar_16 = (xlv_TEXCOORD0 / vec4(2.0, 2.0, 2.0, 2.0)); + highp vec4 tmpvar_17; + tmpvar_17 = (fract(abs(tmpvar_16)) * vec4(2.0, 2.0, 2.0, 2.0)); + highp float tmpvar_18; + if ((tmpvar_16.x >= 0.0)) { + tmpvar_18 = tmpvar_17.x; + } else { + tmpvar_18 = -(tmpvar_17.x); + }; + highp float tmpvar_19; + if ((tmpvar_16.y >= 0.0)) { + tmpvar_19 = tmpvar_17.y; + } else { + tmpvar_19 = -(tmpvar_17.y); + }; + highp float tmpvar_20; + if ((tmpvar_16.z >= 0.0)) { + tmpvar_20 = tmpvar_17.z; + } else { + tmpvar_20 = -(tmpvar_17.z); + }; + highp float tmpvar_21; + if ((tmpvar_16.w >= 0.0)) { + tmpvar_21 = tmpvar_17.w; + } else { + tmpvar_21 = -(tmpvar_17.w); + }; + highp vec4 tmpvar_22; + tmpvar_22.x = tmpvar_18; + tmpvar_22.y = tmpvar_19; + tmpvar_22.z = tmpvar_20; + tmpvar_22.w = tmpvar_21; + c_1 = (c_1 + tmpvar_22); + highp float tmpvar_23; + mediump float ip_24; + 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); + 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); + 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); + c_1 = (c_1 + tmpvar_32); + _fragData = c_1; +} + + +// stats: 56 alu 0 tex 10 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3Metal.txt new file mode 100644 index 000000000..cdb4b9249 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3Metal.txt @@ -0,0 +1,143 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float4 xlv_TEXCOORD0; +}; +struct xlatMtlShaderOutput { + half4 _fragData [[color(0)]]; +}; +struct xlatMtlShaderUniform { +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 c_1; + c_1 = half4(float4(0.0, 0.0, 0.0, 0.0)); + float tmpvar_2; + tmpvar_2 = (_mtl_i.xlv_TEXCOORD0.x / 2.0); + float tmpvar_3; + tmpvar_3 = (fract(abs(tmpvar_2)) * 2.0); + float tmpvar_4; + if ((tmpvar_2 >= 0.0)) { + tmpvar_4 = tmpvar_3; + } else { + tmpvar_4 = -(tmpvar_3); + }; + c_1.x = half(tmpvar_4); + float2 tmpvar_5; + tmpvar_5 = (_mtl_i.xlv_TEXCOORD0.xy / float2(2.0, 2.0)); + float2 tmpvar_6; + tmpvar_6 = (fract(abs(tmpvar_5)) * float2(2.0, 2.0)); + float tmpvar_7; + if ((tmpvar_5.x >= 0.0)) { + tmpvar_7 = tmpvar_6.x; + } else { + tmpvar_7 = -(tmpvar_6.x); + }; + float tmpvar_8; + if ((tmpvar_5.y >= 0.0)) { + tmpvar_8 = tmpvar_6.y; + } else { + tmpvar_8 = -(tmpvar_6.y); + }; + float2 tmpvar_9; + tmpvar_9.x = tmpvar_7; + tmpvar_9.y = tmpvar_8; + c_1.xy = ((half2)((float2)c_1.xy + tmpvar_9)); + float3 tmpvar_10; + tmpvar_10 = (_mtl_i.xlv_TEXCOORD0.xyz / float3(2.0, 2.0, 2.0)); + float3 tmpvar_11; + tmpvar_11 = (fract(abs(tmpvar_10)) * float3(2.0, 2.0, 2.0)); + float tmpvar_12; + if ((tmpvar_10.x >= 0.0)) { + tmpvar_12 = tmpvar_11.x; + } else { + tmpvar_12 = -(tmpvar_11.x); + }; + float tmpvar_13; + if ((tmpvar_10.y >= 0.0)) { + tmpvar_13 = tmpvar_11.y; + } else { + tmpvar_13 = -(tmpvar_11.y); + }; + float tmpvar_14; + if ((tmpvar_10.z >= 0.0)) { + tmpvar_14 = tmpvar_11.z; + } else { + tmpvar_14 = -(tmpvar_11.z); + }; + float3 tmpvar_15; + tmpvar_15.x = tmpvar_12; + tmpvar_15.y = tmpvar_13; + tmpvar_15.z = tmpvar_14; + c_1.xyz = ((half3)((float3)c_1.xyz + tmpvar_15)); + float4 tmpvar_16; + tmpvar_16 = (_mtl_i.xlv_TEXCOORD0 / float4(2.0, 2.0, 2.0, 2.0)); + float4 tmpvar_17; + tmpvar_17 = (fract(abs(tmpvar_16)) * float4(2.0, 2.0, 2.0, 2.0)); + float tmpvar_18; + if ((tmpvar_16.x >= 0.0)) { + tmpvar_18 = tmpvar_17.x; + } else { + tmpvar_18 = -(tmpvar_17.x); + }; + float tmpvar_19; + if ((tmpvar_16.y >= 0.0)) { + tmpvar_19 = tmpvar_17.y; + } else { + tmpvar_19 = -(tmpvar_17.y); + }; + float tmpvar_20; + if ((tmpvar_16.z >= 0.0)) { + tmpvar_20 = tmpvar_17.z; + } else { + tmpvar_20 = -(tmpvar_17.z); + }; + float tmpvar_21; + if ((tmpvar_16.w >= 0.0)) { + tmpvar_21 = tmpvar_17.w; + } else { + tmpvar_21 = -(tmpvar_17.w); + }; + float4 tmpvar_22; + tmpvar_22.x = tmpvar_18; + tmpvar_22.y = tmpvar_19; + tmpvar_22.z = tmpvar_20; + tmpvar_22.w = tmpvar_21; + c_1 = ((half4)((float4)c_1 + tmpvar_22)); + float tmpvar_23; + half ip_24; + int tmpvar_25; + tmpvar_25 = int(_mtl_i.xlv_TEXCOORD0.x); + ip_24 = half(float(tmpvar_25)); + 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); + 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); + 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); + c_1 = ((half4)((float4)c_1 + tmpvar_32)); + _mtl_o._fragData = c_1; + return _mtl_o; +} + + +// stats: 56 alu 0 tex 10 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-for-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-for-inES3.txt new file mode 100644 index 000000000..e3b9418b4 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-for-inES3.txt @@ -0,0 +1,25 @@ +#version 300 es +out lowp vec4 _fragData; +struct v2f { + highp vec2 uv; + mediump vec3 nl; +}; +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); + mediump vec3 light = vec3(0.0); + for ( ; (j < 3); (j++)) { + light += col.xyz * i.nl[j] * _TerrainTreeLightColors[j].xyz; + } + return vec4(light, 1.0); +} +in highp vec2 xlv_uv; +in mediump vec3 xlv_nl; +void main() { + v2f i; + i.uv = xlv_uv; + i.nl = xlv_nl; + _fragData = xlat_main(i); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-for-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-for-irES.txt deleted file mode 100644 index c4e8ab929..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/loop-for-irES.txt +++ /dev/null @@ -1,63 +0,0 @@ -struct v2f { - highp vec2 uv; - highp vec3 nl; -}; -uniform sampler2D _MainTex; -uniform highp vec4 _TerrainTreeLightColors[4]; -varying highp vec2 xlv_uv; -varying highp vec3 xlv_nl; -lowp vec4 xlat_main ( - in v2f i_1 -) -{ - mediump vec3 light_2; - lowp vec4 col_3; - int j_4; - int tmpvar_5; - tmpvar_5 = 0; - j_4 = tmpvar_5; - lowp vec4 tmpvar_6; - tmpvar_6 = texture2D (_MainTex, i_1.uv); - lowp vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - col_3 = tmpvar_7; - mediump vec3 tmpvar_8; - tmpvar_8 = vec3(0.0, 0.0, 0.0); - light_2 = tmpvar_8; - while (true) { - if (!((j_4 < 3))) { - break; - }; - highp vec3 tmpvar_9; - tmpvar_9 = (light_2 + ((col_3.xyz * - i_1.nl[j_4] - ) * _TerrainTreeLightColors[j_4].xyz)); - light_2 = tmpvar_9; - int _post_incdec_tmp_10; - _post_incdec_tmp_10 = j_4; - int tmpvar_11; - tmpvar_11 = (j_4 + 1); - j_4 = tmpvar_11; - }; - mediump vec4 tmpvar_12; - tmpvar_12.w = 1.0; - tmpvar_12.xyz = light_2.xyz; - return tmpvar_12; -} - -void main () -{ - v2f i_13; - highp vec2 tmpvar_14; - tmpvar_14 = xlv_uv; - i_13.uv = tmpvar_14; - highp vec3 tmpvar_15; - tmpvar_15 = xlv_nl; - i_13.nl = tmpvar_15; - lowp vec4 tmpvar_16; - tmpvar_16 = xlat_main (i_13); - lowp vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - gl_FragData[0] = tmpvar_17; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES.txt index a787b8f7c..2080060de 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES.txt @@ -8,21 +8,22 @@ void main () mediump vec3 light_2; lowp vec4 col_3; col_3 = texture2D (_MainTex, xlv_uv); - highp vec3 tmpvar_4; - tmpvar_4 = ((col_3.xyz * xlv_nl.x) * _TerrainTreeLightColors[0].xyz); - light_2 = tmpvar_4; - highp vec3 tmpvar_5; - tmpvar_5 = (light_2 + ((col_3.xyz * xlv_nl.y) * _TerrainTreeLightColors[1].xyz)); - light_2 = tmpvar_5; - highp vec3 tmpvar_6; - tmpvar_6 = (light_2 + ((col_3.xyz * xlv_nl.z) * _TerrainTreeLightColors[2].xyz)); - light_2 = tmpvar_6; - mediump vec4 tmpvar_7; - tmpvar_7.w = 1.0; - tmpvar_7.xyz = light_2; - tmpvar_1 = tmpvar_7; + light_2 = ((col_3.xyz * xlv_nl.x) * _TerrainTreeLightColors[0].xyz); + light_2 = (light_2 + ((col_3.xyz * xlv_nl.y) * _TerrainTreeLightColors[1].xyz)); + light_2 = (light_2 + ((col_3.xyz * xlv_nl.z) * _TerrainTreeLightColors[2].xyz)); + mediump vec4 tmpvar_4; + tmpvar_4.w = 1.0; + tmpvar_4.xyz = light_2; + tmpvar_1 = tmpvar_4; gl_FragData[0] = tmpvar_1; } -// inputs: 2, stats: 9 alu 1 tex 0 flow +// stats: 9 alu 1 tex 0 flow +// inputs: 2 +// #0: xlv_uv (high float) 2x1 [-1] +// #1: xlv_nl (high float) 3x1 [-1] +// uniforms: 1 (total size: 0) +// #0: _TerrainTreeLightColors (high float) 4x1 [4] +// textures: 1 +// #0: _MainTex (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES3.txt new file mode 100644 index 000000000..aea0c58d2 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES3.txt @@ -0,0 +1,31 @@ +#version 300 es +out lowp vec4 _fragData; +uniform sampler2D _MainTex; +uniform mediump vec4 _TerrainTreeLightColors[4]; +in highp vec2 xlv_uv; +in mediump vec3 xlv_nl; +void main () +{ + lowp vec4 tmpvar_1; + mediump vec3 light_2; + lowp vec4 col_3; + col_3 = texture (_MainTex, xlv_uv); + light_2 = ((col_3.xyz * xlv_nl.x) * _TerrainTreeLightColors[0].xyz); + light_2 = (light_2 + ((col_3.xyz * xlv_nl.y) * _TerrainTreeLightColors[1].xyz)); + light_2 = (light_2 + ((col_3.xyz * xlv_nl.z) * _TerrainTreeLightColors[2].xyz)); + mediump vec4 tmpvar_4; + tmpvar_4.w = 1.0; + tmpvar_4.xyz = light_2; + tmpvar_1 = tmpvar_4; + _fragData = tmpvar_1; +} + + +// stats: 9 alu 1 tex 0 flow +// inputs: 2 +// #0: xlv_uv (high float) 2x1 [-1] +// #1: xlv_nl (medium float) 3x1 [-1] +// uniforms: 1 (total size: 0) +// #0: _TerrainTreeLightColors (medium float) 4x1 [4] +// textures: 1 +// #0: _MainTex (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES3Metal.txt new file mode 100644 index 000000000..001778599 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES3Metal.txt @@ -0,0 +1,40 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float2 xlv_uv; + half3 xlv_nl; +}; +struct xlatMtlShaderOutput { + half4 _fragData [[color(0)]]; +}; +struct xlatMtlShaderUniform { + half4 _TerrainTreeLightColors[4]; +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , texture2d _MainTex [[texture(0)]], sampler _mtlsmp__MainTex [[sampler(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 tmpvar_1; + half3 light_2; + half4 col_3; + col_3 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_uv)); + light_2 = ((col_3.xyz * _mtl_i.xlv_nl.x) * _mtl_u._TerrainTreeLightColors[0].xyz); + light_2 = (light_2 + ((col_3.xyz * _mtl_i.xlv_nl.y) * _mtl_u._TerrainTreeLightColors[1].xyz)); + light_2 = (light_2 + ((col_3.xyz * _mtl_i.xlv_nl.z) * _mtl_u._TerrainTreeLightColors[2].xyz)); + half4 tmpvar_4; + tmpvar_4.w = half(1.0); + tmpvar_4.xyz = light_2; + tmpvar_1 = tmpvar_4; + _mtl_o._fragData = tmpvar_1; + return _mtl_o; +} + + +// stats: 9 alu 1 tex 0 flow +// inputs: 2 +// #0: xlv_uv (high float) 2x1 [-1] +// #1: xlv_nl (medium float) 3x1 [-1] +// uniforms: 1 (total size: 32) +// #0: _TerrainTreeLightColors (medium float) 4x1 [4] loc 0 +// textures: 1 +// #0: _MainTex (low 2d) 0x0 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-inES3.txt new file mode 100644 index 000000000..8d2d608b7 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-inES3.txt @@ -0,0 +1,26 @@ +#version 300 es +out lowp vec4 _fragData; +struct v2f { + highp vec2 uv; + mediump vec3 nl; +}; +uniform sampler2D _MainTex; +uniform mediump vec4 _TerrainTreeLightColors[4]; +lowp vec4 xlat_main (in v2f i) { + lowp vec4 col = texture2D( _MainTex, i.uv); + if (col.w < 0.5) + discard; + mediump vec3 light = vec3(0.0); + for (int j = 0; j < 3; ++j) { + light += col.xyz * i.nl[j] * _TerrainTreeLightColors[j].xyz; + } + return vec4(light, 1.0); +} +in highp vec2 xlv_uv; +in mediump vec3 xlv_nl; +void main() { + v2f i; + i.uv = xlv_uv; + i.nl = xlv_nl; + _fragData = xlat_main(i); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-irES.txt deleted file mode 100644 index 5cb834066..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-irES.txt +++ /dev/null @@ -1,64 +0,0 @@ -struct v2f { - highp vec2 uv; - highp vec3 nl; -}; -uniform sampler2D _MainTex; -uniform highp vec4 _TerrainTreeLightColors[4]; -varying highp vec2 xlv_uv; -varying highp vec3 xlv_nl; -lowp vec4 xlat_main ( - in v2f i_1 -) -{ - int j_2; - mediump vec3 light_3; - lowp vec4 col_4; - lowp vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, i_1.uv); - lowp vec4 tmpvar_6; - tmpvar_6 = tmpvar_5; - col_4 = tmpvar_6; - if ((col_4.w < 0.5)) { - discard; - }; - mediump vec3 tmpvar_7; - tmpvar_7 = vec3(0.0, 0.0, 0.0); - light_3 = tmpvar_7; - int tmpvar_8; - tmpvar_8 = 0; - j_2 = tmpvar_8; - while (true) { - if (!((j_2 < 3))) { - break; - }; - highp vec3 tmpvar_9; - tmpvar_9 = (light_3 + ((col_4.xyz * - i_1.nl[j_2] - ) * _TerrainTreeLightColors[j_2].xyz)); - light_3 = tmpvar_9; - int tmpvar_10; - tmpvar_10 = (j_2 + 1); - j_2 = tmpvar_10; - }; - mediump vec4 tmpvar_11; - tmpvar_11.w = 1.0; - tmpvar_11.xyz = light_3.xyz; - return tmpvar_11; -} - -void main () -{ - v2f i_12; - highp vec2 tmpvar_13; - tmpvar_13 = xlv_uv; - i_12.uv = tmpvar_13; - highp vec3 tmpvar_14; - tmpvar_14 = xlv_nl; - i_12.nl = tmpvar_14; - lowp vec4 tmpvar_15; - tmpvar_15 = xlat_main (i_12); - lowp vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - gl_FragData[0] = tmpvar_16; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES.txt index 033600352..665d1b89d 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES.txt @@ -11,21 +11,22 @@ void main () if ((tmpvar_3.w < 0.5)) { discard; }; - highp vec3 tmpvar_4; - tmpvar_4 = ((tmpvar_3.xyz * xlv_nl.x) * _TerrainTreeLightColors[0].xyz); - light_2 = tmpvar_4; - highp vec3 tmpvar_5; - tmpvar_5 = (light_2 + ((tmpvar_3.xyz * xlv_nl.y) * _TerrainTreeLightColors[1].xyz)); - light_2 = tmpvar_5; - highp vec3 tmpvar_6; - tmpvar_6 = (light_2 + ((tmpvar_3.xyz * xlv_nl.z) * _TerrainTreeLightColors[2].xyz)); - light_2 = tmpvar_6; - mediump vec4 tmpvar_7; - tmpvar_7.w = 1.0; - tmpvar_7.xyz = light_2; - tmpvar_1 = tmpvar_7; + light_2 = ((tmpvar_3.xyz * xlv_nl.x) * _TerrainTreeLightColors[0].xyz); + light_2 = (light_2 + ((tmpvar_3.xyz * xlv_nl.y) * _TerrainTreeLightColors[1].xyz)); + light_2 = (light_2 + ((tmpvar_3.xyz * xlv_nl.z) * _TerrainTreeLightColors[2].xyz)); + mediump vec4 tmpvar_4; + tmpvar_4.w = 1.0; + tmpvar_4.xyz = light_2; + tmpvar_1 = tmpvar_4; gl_FragData[0] = tmpvar_1; } -// inputs: 2, stats: 10 alu 2 tex 1 flow +// stats: 10 alu 2 tex 1 flow +// inputs: 2 +// #0: xlv_uv (high float) 2x1 [-1] +// #1: xlv_nl (high float) 3x1 [-1] +// uniforms: 1 (total size: 0) +// #0: _TerrainTreeLightColors (high float) 4x1 [4] +// textures: 1 +// #0: _MainTex (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES3.txt new file mode 100644 index 000000000..cb6883e7f --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES3.txt @@ -0,0 +1,34 @@ +#version 300 es +out lowp vec4 _fragData; +uniform sampler2D _MainTex; +uniform mediump vec4 _TerrainTreeLightColors[4]; +in highp vec2 xlv_uv; +in mediump vec3 xlv_nl; +void main () +{ + lowp vec4 tmpvar_1; + mediump vec3 light_2; + lowp vec4 tmpvar_3; + tmpvar_3 = texture (_MainTex, xlv_uv); + if ((tmpvar_3.w < 0.5)) { + discard; + }; + light_2 = ((tmpvar_3.xyz * xlv_nl.x) * _TerrainTreeLightColors[0].xyz); + light_2 = (light_2 + ((tmpvar_3.xyz * xlv_nl.y) * _TerrainTreeLightColors[1].xyz)); + light_2 = (light_2 + ((tmpvar_3.xyz * xlv_nl.z) * _TerrainTreeLightColors[2].xyz)); + mediump vec4 tmpvar_4; + tmpvar_4.w = 1.0; + tmpvar_4.xyz = light_2; + tmpvar_1 = tmpvar_4; + _fragData = tmpvar_1; +} + + +// stats: 10 alu 2 tex 1 flow +// inputs: 2 +// #0: xlv_uv (high float) 2x1 [-1] +// #1: xlv_nl (medium float) 3x1 [-1] +// uniforms: 1 (total size: 0) +// #0: _TerrainTreeLightColors (medium float) 4x1 [4] +// textures: 1 +// #0: _MainTex (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES3Metal.txt new file mode 100644 index 000000000..171650fb8 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES3Metal.txt @@ -0,0 +1,43 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float2 xlv_uv; + half3 xlv_nl; +}; +struct xlatMtlShaderOutput { + half4 _fragData [[color(0)]]; +}; +struct xlatMtlShaderUniform { + half4 _TerrainTreeLightColors[4]; +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , texture2d _MainTex [[texture(0)]], sampler _mtlsmp__MainTex [[sampler(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 tmpvar_1; + half3 light_2; + half4 tmpvar_3; + tmpvar_3 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_uv)); + if ((tmpvar_3.w < (half)0.5)) { + discard_fragment(); + }; + light_2 = ((tmpvar_3.xyz * _mtl_i.xlv_nl.x) * _mtl_u._TerrainTreeLightColors[0].xyz); + light_2 = (light_2 + ((tmpvar_3.xyz * _mtl_i.xlv_nl.y) * _mtl_u._TerrainTreeLightColors[1].xyz)); + light_2 = (light_2 + ((tmpvar_3.xyz * _mtl_i.xlv_nl.z) * _mtl_u._TerrainTreeLightColors[2].xyz)); + half4 tmpvar_4; + tmpvar_4.w = half(1.0); + tmpvar_4.xyz = light_2; + tmpvar_1 = tmpvar_4; + _mtl_o._fragData = tmpvar_1; + return _mtl_o; +} + + +// stats: 10 alu 2 tex 1 flow +// inputs: 2 +// #0: xlv_uv (high float) 2x1 [-1] +// #1: xlv_nl (medium float) 3x1 [-1] +// uniforms: 1 (total size: 32) +// #0: _TerrainTreeLightColors (medium float) 4x1 [4] loc 0 +// textures: 1 +// #0: _MainTex (low 2d) 0x0 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-irES.txt deleted file mode 100644 index 9fea2ccf5..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-irES.txt +++ /dev/null @@ -1,66 +0,0 @@ -struct v2f { - highp vec2 uv; - highp vec3 nl; -}; -uniform sampler2D _MainTex; -uniform highp vec4 _TerrainTreeLightColors[4]; -varying highp vec2 xlv_uv; -varying highp vec3 xlv_nl; -lowp vec4 xlat_main ( - in v2f i_1 -) -{ - mediump vec3 light_2; - lowp vec4 col_3; - int j_4; - int tmpvar_5; - tmpvar_5 = 0; - j_4 = tmpvar_5; - lowp vec4 tmpvar_6; - tmpvar_6 = texture2D (_MainTex, i_1.uv); - lowp vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - col_3 = tmpvar_7; - if ((col_3.w < 0.5)) { - discard; - }; - mediump vec3 tmpvar_8; - tmpvar_8 = vec3(0.0, 0.0, 0.0); - light_2 = tmpvar_8; - while (true) { - if (!((j_4 < 3))) { - break; - }; - highp vec3 tmpvar_9; - tmpvar_9 = (light_2 + ((col_3.xyz * - i_1.nl[j_4] - ) * _TerrainTreeLightColors[j_4].xyz)); - light_2 = tmpvar_9; - int _post_incdec_tmp_10; - _post_incdec_tmp_10 = j_4; - int tmpvar_11; - tmpvar_11 = (j_4 + 1); - j_4 = tmpvar_11; - }; - mediump vec4 tmpvar_12; - tmpvar_12.w = 1.0; - tmpvar_12.xyz = light_2.xyz; - return tmpvar_12; -} - -void main () -{ - v2f i_13; - highp vec2 tmpvar_14; - tmpvar_14 = xlv_uv; - i_13.uv = tmpvar_14; - highp vec3 tmpvar_15; - tmpvar_15 = xlv_nl; - i_13.nl = tmpvar_15; - lowp vec4 tmpvar_16; - tmpvar_16 = xlat_main (i_13); - lowp vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - gl_FragData[0] = tmpvar_17; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-outES.txt index 033600352..665d1b89d 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-outES.txt @@ -11,21 +11,22 @@ void main () if ((tmpvar_3.w < 0.5)) { discard; }; - highp vec3 tmpvar_4; - tmpvar_4 = ((tmpvar_3.xyz * xlv_nl.x) * _TerrainTreeLightColors[0].xyz); - light_2 = tmpvar_4; - highp vec3 tmpvar_5; - tmpvar_5 = (light_2 + ((tmpvar_3.xyz * xlv_nl.y) * _TerrainTreeLightColors[1].xyz)); - light_2 = tmpvar_5; - highp vec3 tmpvar_6; - tmpvar_6 = (light_2 + ((tmpvar_3.xyz * xlv_nl.z) * _TerrainTreeLightColors[2].xyz)); - light_2 = tmpvar_6; - mediump vec4 tmpvar_7; - tmpvar_7.w = 1.0; - tmpvar_7.xyz = light_2; - tmpvar_1 = tmpvar_7; + light_2 = ((tmpvar_3.xyz * xlv_nl.x) * _TerrainTreeLightColors[0].xyz); + light_2 = (light_2 + ((tmpvar_3.xyz * xlv_nl.y) * _TerrainTreeLightColors[1].xyz)); + light_2 = (light_2 + ((tmpvar_3.xyz * xlv_nl.z) * _TerrainTreeLightColors[2].xyz)); + mediump vec4 tmpvar_4; + tmpvar_4.w = 1.0; + tmpvar_4.xyz = light_2; + tmpvar_1 = tmpvar_4; gl_FragData[0] = tmpvar_1; } -// inputs: 2, stats: 10 alu 2 tex 1 flow +// stats: 10 alu 2 tex 1 flow +// inputs: 2 +// #0: xlv_uv (high float) 2x1 [-1] +// #1: xlv_nl (high float) 3x1 [-1] +// uniforms: 1 (total size: 0) +// #0: _TerrainTreeLightColors (high float) 4x1 [4] +// textures: 1 +// #0: _MainTex (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-irES.txt deleted file mode 100644 index 47bc40085..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-irES.txt +++ /dev/null @@ -1,28 +0,0 @@ -void main () -{ - highp float f_1; - int i_2; - int tmpvar_3; - tmpvar_3 = 0; - i_2 = tmpvar_3; - mediump float tmpvar_4; - tmpvar_4 = 0.0; - f_1 = tmpvar_4; - while (true) { - if (!((i_2 < 32))) { - break; - }; - highp float tmpvar_5; - tmpvar_5 = (f_1 + (gl_FragCoord.x * float(i_2))); - f_1 = tmpvar_5; - int tmpvar_6; - tmpvar_6 = (i_2 + 1); - i_2 = tmpvar_6; - }; - highp vec4 tmpvar_7; - tmpvar_7 = vec4(f_1); - highp vec4 tmpvar_8; - tmpvar_8 = tmpvar_7; - gl_FragColor = tmpvar_8; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-outES.txt index 7639e2698..deb13948d 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-outES.txt @@ -11,4 +11,6 @@ void main () } -// inputs: 1, stats: 7 alu 0 tex 2 flow +// stats: 7 alu 0 tex 2 flow +// inputs: 1 +// #0: gl_FragCoord (high float) 4x1 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-irES.txt deleted file mode 100644 index 0eeda47eb..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-irES.txt +++ /dev/null @@ -1,65 +0,0 @@ -struct v2f { - highp vec2 uv; - highp vec3 nl; -}; -uniform sampler2D _MainTex; -uniform highp vec4 _TerrainTreeLightColors[4]; -varying highp vec2 xlv_uv; -varying highp vec3 xlv_nl; -lowp vec4 xlat_main ( - in v2f i_1 -) -{ - int j_2; - int loopCount_3; - mediump vec3 light_4; - lowp vec4 col_5; - lowp vec4 tmpvar_6; - tmpvar_6 = texture2D (_MainTex, i_1.uv); - lowp vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - col_5 = tmpvar_7; - mediump vec3 tmpvar_8; - tmpvar_8 = vec3(0.0, 0.0, 0.0); - light_4 = tmpvar_8; - int tmpvar_9; - tmpvar_9 = int((col_5.w * 10.0)); - loopCount_3 = tmpvar_9; - int tmpvar_10; - tmpvar_10 = 0; - j_2 = tmpvar_10; - while (true) { - if (!((j_2 < loopCount_3))) { - break; - }; - highp vec3 tmpvar_11; - tmpvar_11 = (light_4 + ((col_5.xyz * - i_1.nl[j_2] - ) * _TerrainTreeLightColors[j_2].xyz)); - light_4 = tmpvar_11; - int tmpvar_12; - tmpvar_12 = (j_2 + 1); - j_2 = tmpvar_12; - }; - mediump vec4 tmpvar_13; - tmpvar_13.w = 1.0; - tmpvar_13.xyz = light_4.xyz; - return tmpvar_13; -} - -void main () -{ - v2f i_14; - highp vec2 tmpvar_15; - tmpvar_15 = xlv_uv; - i_14.uv = tmpvar_15; - highp vec3 tmpvar_16; - tmpvar_16 = xlv_nl; - i_14.nl = tmpvar_16; - lowp vec4 tmpvar_17; - tmpvar_17 = xlat_main (i_14); - lowp vec4 tmpvar_18; - tmpvar_18 = tmpvar_17; - gl_FragData[0] = tmpvar_18; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-outES.txt index 2d1b55a5a..e0d32d30e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-outES.txt @@ -15,19 +15,24 @@ 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; j_3 < loopCount_4; j_3++) { - highp vec3 tmpvar_8; - tmpvar_8 = (light_5 + ((col_6.xyz * + for (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)); - light_5 = tmpvar_8; }; - mediump vec4 tmpvar_9; - tmpvar_9.w = 1.0; - tmpvar_9.xyz = light_5; - tmpvar_1 = tmpvar_9; + mediump vec4 tmpvar_8; + tmpvar_8.w = 1.0; + tmpvar_8.xyz = light_5; + tmpvar_1 = tmpvar_8; gl_FragData[0] = tmpvar_1; } -// inputs: 2, stats: 11 alu 1 tex 2 flow +// stats: 11 alu 1 tex 2 flow +// inputs: 2 +// #0: xlv_uv (high float) 2x1 [-1] +// #1: xlv_nl (high float) 3x1 [-1] +// uniforms: 1 (total size: 0) +// #0: _TerrainTreeLightColors (high float) 4x1 [4] +// textures: 1 +// #0: _MainTex (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-ir.txt deleted file mode 100644 index f0c3d5125..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-ir.txt +++ /dev/null @@ -1,124 +0,0 @@ -uniform sampler2D mainTex; -varying vec2 uv; -void main () -{ - int j_1; - int i_2; - int i_3; - int n_4; - int i_5; - int i_6; - int i_7; - vec4 c_8; - vec4 tmpvar_9; - tmpvar_9 = vec4(0.0, 0.0, 0.0, 0.0); - c_8 = tmpvar_9; - int tmpvar_10; - tmpvar_10 = 0; - i_7 = tmpvar_10; - while (true) { - if (!((i_7 < 100))) { - break; - }; - vec2 tmpvar_11; - tmpvar_11.x = float(i_7); - tmpvar_11.y = float(i_7); - vec4 tmpvar_12; - tmpvar_12 = texture2D (mainTex, (uv + tmpvar_11)); - float tmpvar_13; - tmpvar_13 = (c_8.x + tmpvar_12.x); - c_8.x = tmpvar_13; - int tmpvar_14; - tmpvar_14 = (i_7 + 1); - i_7 = tmpvar_14; - }; - int tmpvar_15; - tmpvar_15 = 0; - i_6 = tmpvar_15; - while (true) { - if (!((i_6 <= 100))) { - break; - }; - vec2 tmpvar_16; - tmpvar_16.x = float(i_6); - tmpvar_16.y = float(i_6); - vec4 tmpvar_17; - tmpvar_17 = texture2D (mainTex, (uv + tmpvar_16)); - float tmpvar_18; - tmpvar_18 = (c_8.x + tmpvar_17.x); - c_8.x = tmpvar_18; - int tmpvar_19; - tmpvar_19 = (i_6 + 3); - i_6 = tmpvar_19; - }; - int tmpvar_20; - tmpvar_20 = 100; - i_5 = tmpvar_20; - while (true) { - if (!((i_5 >= 0))) { - break; - }; - vec2 tmpvar_21; - tmpvar_21.x = float(i_5); - tmpvar_21.y = float(i_5); - vec4 tmpvar_22; - tmpvar_22 = texture2D (mainTex, (uv + tmpvar_21)); - float tmpvar_23; - tmpvar_23 = (c_8.x + tmpvar_22.x); - c_8.x = tmpvar_23; - int tmpvar_24; - tmpvar_24 = (i_5 - 1); - i_5 = tmpvar_24; - }; - int tmpvar_25; - tmpvar_25 = int((c_8.x * 10.0)); - n_4 = tmpvar_25; - int tmpvar_26; - tmpvar_26 = 3; - i_3 = tmpvar_26; - while (true) { - if (!((i_3 < n_4))) { - break; - }; - vec2 tmpvar_27; - tmpvar_27.x = float(i_3); - tmpvar_27.y = float(i_3); - vec4 tmpvar_28; - tmpvar_28 = texture2D (mainTex, (uv + tmpvar_27)); - float tmpvar_29; - tmpvar_29 = (c_8.x + tmpvar_28.x); - c_8.x = tmpvar_29; - int tmpvar_30; - tmpvar_30 = (i_3 + 1); - i_3 = tmpvar_30; - }; - int tmpvar_31; - tmpvar_31 = 1; - i_2 = tmpvar_31; - int tmpvar_32; - tmpvar_32 = 2; - j_1 = tmpvar_32; - while (true) { - if (!(((i_2 < 100) && (j_1 < 50)))) { - break; - }; - vec2 tmpvar_33; - tmpvar_33.x = float(i_2); - tmpvar_33.y = float(j_1); - vec4 tmpvar_34; - tmpvar_34 = texture2D (mainTex, (uv + tmpvar_33)); - float tmpvar_35; - tmpvar_35 = (c_8.x + tmpvar_34.x); - c_8.x = tmpvar_35; - int tmpvar_36; - tmpvar_36 = (i_2 + 2); - i_2 = tmpvar_36; - int tmpvar_37; - tmpvar_37 = (j_1 + 3); - j_1 = tmpvar_37; - }; - vec4 tmpvar_38; - tmpvar_38 = c_8; - gl_FragColor = tmpvar_38; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-out.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-out.txt index 98c65ad0e..680d3e92f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-out.txt @@ -26,7 +26,7 @@ void main () c_8.x = (c_8.x + texture2D (mainTex, (uv + tmpvar_11)).x); }; n_4 = int((c_8.x * 10.0)); - for (int i_3; i_3 < n_4; i_3++) { + for (int i_3 = 3; i_3 < n_4; i_3++) { vec2 tmpvar_12; tmpvar_12.x = float(i_3); tmpvar_12.y = float(i_3); @@ -44,4 +44,8 @@ void main () } -// inputs: 1, stats: 43 alu 5 tex 10 flow +// stats: 43 alu 5 tex 10 flow +// inputs: 1 +// #0: uv (high float) 2x1 [-1] +// textures: 1 +// #0: mainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/mrt-inES.txt b/3rdparty/glsl-optimizer/tests/fragment/mrt-inES.txt new file mode 100644 index 000000000..135cc87a4 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/mrt-inES.txt @@ -0,0 +1,9 @@ +#extension GL_EXT_draw_buffers : require + +void main() +{ + gl_FragData[0] = vec4(0.0); + gl_FragData[1] = vec4(0.1); + gl_FragData[2] = vec4(0.2); + gl_FragData[3] = vec4(0.3); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/mrt-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/mrt-ir.txt deleted file mode 100644 index d05607896..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/mrt-ir.txt +++ /dev/null @@ -1,16 +0,0 @@ -void main () -{ - vec4 tmpvar_1; - tmpvar_1 = vec4(0.0, 0.0, 0.0, 0.0); - gl_FragData[0] = tmpvar_1; - vec4 tmpvar_2; - tmpvar_2 = vec4(0.1, 0.1, 0.1, 0.1); - gl_FragData[1] = tmpvar_2; - vec4 tmpvar_3; - tmpvar_3 = vec4(0.2, 0.2, 0.2, 0.2); - gl_FragData[2] = tmpvar_3; - vec4 tmpvar_4; - tmpvar_4 = vec4(0.3, 0.3, 0.3, 0.3); - gl_FragData[3] = tmpvar_4; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/mrt-irES3.txt b/3rdparty/glsl-optimizer/tests/fragment/mrt-irES3.txt deleted file mode 100644 index 5ae19b969..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/mrt-irES3.txt +++ /dev/null @@ -1,18 +0,0 @@ -#version 300 es -out lowp vec4 _fragData[4]; -void main () -{ - mediump vec4 tmpvar_1; - tmpvar_1 = vec4(0.0, 0.0, 0.0, 0.0); - _fragData[0] = tmpvar_1; - mediump vec4 tmpvar_2; - tmpvar_2 = vec4(0.1, 0.1, 0.1, 0.1); - _fragData[1] = tmpvar_2; - mediump vec4 tmpvar_3; - tmpvar_3 = vec4(0.2, 0.2, 0.2, 0.2); - _fragData[2] = tmpvar_3; - mediump vec4 tmpvar_4; - tmpvar_4 = vec4(0.3, 0.3, 0.3, 0.3); - _fragData[3] = tmpvar_4; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-inES3.txt new file mode 100644 index 000000000..d7be49b29 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-inES3.txt @@ -0,0 +1,13 @@ +#version 300 es + +// Defines output as an array (uses only 1st index), +// and two vectors (1st unused). +layout(location = 0) out mediump vec4 _colArr[2]; +layout(location = 2) out mediump vec4 _colVecUnused; +layout(location = 3) out mediump vec4 _colVec; + +void main() +{ + _colArr[0] = vec4(0.0); + _colVec = vec4(1.0); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-outES3.txt new file mode 100644 index 000000000..739ff37a4 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-outES3.txt @@ -0,0 +1,11 @@ +#version 300 es +layout(location=0) out mediump vec4 _colArr[2]; +layout(location=3) out mediump vec4 _colVec; +void main () +{ + _colArr[0] = vec4(0.0, 0.0, 0.0, 0.0); + _colVec = vec4(1.0, 1.0, 1.0, 1.0); +} + + +// stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-outES3Metal.txt new file mode 100644 index 000000000..3e3ab1258 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-outES3Metal.txt @@ -0,0 +1,20 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { +}; +struct xlatMtlShaderOutput { + half4 _colArr_0 [[color(0)]]; + half4 _colVec [[color(3)]]; +}; +struct xlatMtlShaderUniform { +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + _mtl_o._colArr_0 = half4(float4(0.0, 0.0, 0.0, 0.0)); + _mtl_o._colVec = half4(float4(1.0, 1.0, 1.0, 1.0)); + return _mtl_o; +} + + +// stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/mrt-out.txt b/3rdparty/glsl-optimizer/tests/fragment/mrt-out.txt index c04f9794a..57e21aebe 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/mrt-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/mrt-out.txt @@ -7,4 +7,4 @@ void main () } -// inputs: 0, stats: 4 alu 0 tex 0 flow +// stats: 4 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/mrt-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/mrt-outES.txt new file mode 100644 index 000000000..d137db095 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/mrt-outES.txt @@ -0,0 +1,11 @@ +#extension GL_EXT_draw_buffers : require +void main () +{ + gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0); + gl_FragData[1] = vec4(0.1, 0.1, 0.1, 0.1); + gl_FragData[2] = vec4(0.2, 0.2, 0.2, 0.2); + gl_FragData[3] = vec4(0.3, 0.3, 0.3, 0.3); +} + + +// stats: 4 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/mrt-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/mrt-outES3.txt index dad40396f..f6282ea72 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/mrt-outES3.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/mrt-outES3.txt @@ -9,4 +9,4 @@ void main () } -// inputs: 0, stats: 4 alu 0 tex 0 flow +// stats: 4 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/mrt-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/mrt-outES3Metal.txt new file mode 100644 index 000000000..fed2b03d3 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/mrt-outES3Metal.txt @@ -0,0 +1,24 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { +}; +struct xlatMtlShaderOutput { + half4 _fragData_0 [[color(0)]]; + half4 _fragData_1 [[color(1)]]; + half4 _fragData_2 [[color(2)]]; + half4 _fragData_3 [[color(3)]]; +}; +struct xlatMtlShaderUniform { +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + _mtl_o._fragData_0 = half4(float4(0.0, 0.0, 0.0, 0.0)); + _mtl_o._fragData_1 = half4(float4(0.1, 0.1, 0.1, 0.1)); + _mtl_o._fragData_2 = half4(float4(0.2, 0.2, 0.2, 0.2)); + _mtl_o._fragData_3 = half4(float4(0.3, 0.3, 0.3, 0.3)); + return _mtl_o; +} + + +// stats: 4 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/mrt-unused-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/mrt-unused-inES3.txt new file mode 100644 index 000000000..b6da878b1 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/mrt-unused-inES3.txt @@ -0,0 +1,15 @@ +#version 300 es + +// Defines output as an array of 4 colors, +// but writes to only one. +#define gl_FragColor _glesFragData[0] +#define gl_FragData _glesFragData +layout(location = 0) out mediump vec4 _glesFragData[4]; + +uniform highp vec4 _Color; +in lowp vec4 xlv_COLOR0; + +void main() { + lowp vec4 c = xlv_COLOR0 * _Color; + gl_FragData[0] = c; +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/mrt-unused-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/mrt-unused-outES3.txt new file mode 100644 index 000000000..d83e1dc05 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/mrt-unused-outES3.txt @@ -0,0 +1,19 @@ +#version 300 es +layout(location=0) out mediump vec4 _glesFragData[4]; +uniform highp vec4 _Color; +in lowp vec4 xlv_COLOR0; +void main () +{ + lowp vec4 c_1; + highp vec4 tmpvar_2; + tmpvar_2 = (xlv_COLOR0 * _Color); + c_1 = tmpvar_2; + _glesFragData[0] = c_1; +} + + +// stats: 1 alu 0 tex 0 flow +// inputs: 1 +// #0: xlv_COLOR0 (low float) 4x1 [-1] +// uniforms: 1 (total size: 0) +// #0: _Color (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/mrt-unused-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/mrt-unused-outES3Metal.txt new file mode 100644 index 000000000..1f1a28a90 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/mrt-unused-outES3Metal.txt @@ -0,0 +1,28 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + half4 xlv_COLOR0; +}; +struct xlatMtlShaderOutput { + half4 _glesFragData_0 [[color(0)]]; +}; +struct xlatMtlShaderUniform { + float4 _Color; +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 c_1; + float4 tmpvar_2; + tmpvar_2 = ((float4)_mtl_i.xlv_COLOR0 * _mtl_u._Color); + c_1 = half4(tmpvar_2); + _mtl_o._glesFragData_0 = c_1; + return _mtl_o; +} + + +// stats: 1 alu 0 tex 0 flow +// inputs: 1 +// #0: xlv_COLOR0 (low float) 4x1 [-1] +// uniforms: 1 (total size: 16) +// #0: _Color (high float) 4x1 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/fragment/nested-inlining-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/nested-inlining-ir.txt deleted file mode 100644 index 3810829dc..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/nested-inlining-ir.txt +++ /dev/null @@ -1,33 +0,0 @@ -uniform vec3 uniVal; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -void main () -{ - bool useZero_2; - vec2 val_3; - bool tmpvar_4; - tmpvar_4 = (uniVal.x > 1.0); - useZero_2 = tmpvar_4; - if (useZero_2) { - vec4 tmpvar_5; - tmpvar_5 = vec4(0.0, 0.0, 0.0, 0.0); - gl_FragData[0] = tmpvar_5; - } else { - vec2 tmpvar_6; - tmpvar_6 = uniVal.xy; - val_3 = tmpvar_6; - xll_clip ((0.001 - val_3.x)); - xll_clip ((0.001 - val_3.y)); - vec4 tmpvar_7; - tmpvar_7 = vec4(1.0, 1.0, 1.0, 1.0); - gl_FragData[0] = tmpvar_7; - }; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/nested-inlining-out.txt b/3rdparty/glsl-optimizer/tests/fragment/nested-inlining-out.txt index 9f9e134f5..1b9dc6076 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/nested-inlining-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/nested-inlining-out.txt @@ -19,4 +19,6 @@ void main () } -// inputs: 0, stats: 7 alu 2 tex 3 flow +// stats: 7 alu 2 tex 3 flow +// uniforms: 1 (total size: 0) +// #0: uniVal (high float) 3x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-copyprop-struct-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-copyprop-struct-ir.txt deleted file mode 100644 index e5230aaa8..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-copyprop-struct-ir.txt +++ /dev/null @@ -1,23 +0,0 @@ -struct v2f { - float f; -}; -varying float var; -void main () -{ - v2f i2_1; - v2f i_2; - float tmpvar_3; - tmpvar_3 = var; - i_2.f = tmpvar_3; - v2f tmpvar_4; - tmpvar_4 = i_2; - i2_1 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = abs (i2_1.f); - vec4 tmpvar_6; - tmpvar_6 = vec4(tmpvar_5); - vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - gl_FragColor = tmpvar_7; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-copyprop-struct-out.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-copyprop-struct-out.txt index 70f13e362..47ff29d50 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-copyprop-struct-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-copyprop-struct-out.txt @@ -5,4 +5,6 @@ void main () } -// inputs: 1, stats: 1 alu 0 tex 0 flow +// stats: 1 alu 0 tex 0 flow +// inputs: 1 +// #0: var (high float) 1x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-ir.txt deleted file mode 100644 index 51aaecc0d..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-ir.txt +++ /dev/null @@ -1,21 +0,0 @@ -varying vec2 uv; -uniform sampler2D tex; -void main () -{ - vec4 v_1; - vec4 tmpvar_2; - tmpvar_2 = texture2D (tex, uv); - vec4 tmpvar_3; - tmpvar_3 = tmpvar_2; - v_1 = tmpvar_3; - vec2 tmpvar_4; - tmpvar_4 = v_1.yx; - v_1.xy = tmpvar_4.xy.xy; - float tmpvar_5; - tmpvar_5 = -(v_1.x); - v_1.x = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6 = v_1; - gl_FragColor = tmpvar_6; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-out.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-out.txt index bfb04e2ee..1013d7fd4 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-out.txt @@ -12,4 +12,8 @@ void main () } -// inputs: 1, stats: 1 alu 1 tex 0 flow +// stats: 1 alu 1 tex 0 flow +// inputs: 1 +// #0: uv (high float) 2x1 [-1] +// textures: 1 +// #0: tex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloads-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloads-ir.txt deleted file mode 100644 index 578f4be57..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloads-ir.txt +++ /dev/null @@ -1,25 +0,0 @@ -uniform sampler2D _MainTex; -void surf ( - in vec2 uv_1, - inout vec3 oo_2 -) -{ - if ((uv_1.x < 0.0)) { - discard; - }; - vec4 tmpvar_3; - tmpvar_3 = texture2D (_MainTex, uv_1); - vec3 tmpvar_4; - tmpvar_4 = tmpvar_3.xyz; - oo_2 = tmpvar_4; -} - -void main () -{ - vec3 oo_5; - surf (gl_TexCoord[0].xy, oo_5); - vec4 tmpvar_6; - tmpvar_6 = vec4(0.5, 0.5, 0.5, 0.5); - gl_FragData[0] = tmpvar_6; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloads-out.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloads-out.txt index 865ddec57..42ec09646 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloads-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloads-out.txt @@ -9,4 +9,6 @@ void main () } -// inputs: 1, stats: 2 alu 1 tex 1 flow +// stats: 2 alu 1 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-inES3.txt new file mode 100644 index 000000000..d8c3663b5 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-inES3.txt @@ -0,0 +1,85 @@ +#version 300 es + +// Tree Creator Optimized Bark surface shader from Unity 4.x, +// shadow caster pass. Used to not do dead code elimination +// properly, i.e. was leaving normal map sample in the fragment shader. + +#define gl_FragColor _glesFragData[0] +#define gl_FragData _glesFragData + +layout(location = 0) out mediump vec4 _glesFragData[4]; +float xll_saturate_f( float 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 LeafSurfaceOutput { + lowp vec3 Albedo; + lowp vec3 Normal; + lowp vec3 Emission; + lowp float Translucency; + mediump float Specular; + lowp float Gloss; + lowp float Alpha; +}; + +struct Input { + highp vec2 uv_MainTex; + lowp vec4 color; +}; + +struct v2f_surf { + highp vec4 pos; +}; + +uniform lowp vec4 _Color; +uniform lowp vec3 _TranslucencyColor; +uniform lowp float _TranslucencyViewDependency; +uniform mediump float _ShadowStrength; + +uniform sampler2D _MainTex; +uniform sampler2D _BumpSpecMap; +uniform sampler2D _TranslucencyMap; + +lowp vec3 UnpackNormalDXT5nm( in lowp vec4 packednormal ) { + lowp vec3 normal; + normal.xy = ((packednormal.wy * 2.0) - 1.0); + normal.z = sqrt((1.0 - xll_saturate_f(dot( normal.xy, normal.xy)))); + return normal; +} +void surf( in Input IN, inout SurfaceOutput o ) { + lowp vec4 c = texture( _MainTex, IN.uv_MainTex); + o.Albedo = ((c.xyz * _Color.xyz) * IN.color.w); + lowp vec4 trngls = texture( _TranslucencyMap, IN.uv_MainTex); + o.Gloss = (trngls.w * _Color.x); + o.Alpha = c.w; + mediump vec4 norspc = texture( _BumpSpecMap, IN.uv_MainTex); + o.Specular = norspc.x; + o.Normal = UnpackNormalDXT5nm( norspc); +} +lowp vec4 frag_surf( in v2f_surf IN ) { + Input surfIN; + SurfaceOutput o; + o.Albedo = vec3(0.0); + o.Emission = vec3(0.0); + o.Specular = 0.0; + o.Alpha = 0.0; + o.Gloss = 0.0; + surf (surfIN, o); + return vec4(0.0); +} +void main() { + lowp vec4 xl_retval; + v2f_surf xlt_IN; + xlt_IN.pos = vec4(0.0); + xl_retval = frag_surf( xlt_IN); + gl_FragData[0] = vec4(xl_retval); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-outES3.txt new file mode 100644 index 000000000..7dc32ee7a --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-outES3.txt @@ -0,0 +1,9 @@ +#version 300 es +layout(location=0) out mediump vec4 _glesFragData[4]; +void main () +{ + _glesFragData[0] = vec4(0.0, 0.0, 0.0, 0.0); +} + + +// stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-outES3Metal.txt new file mode 100644 index 000000000..31df0dfed --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-outES3Metal.txt @@ -0,0 +1,18 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { +}; +struct xlatMtlShaderOutput { + half4 _glesFragData_0 [[color(0)]]; +}; +struct xlatMtlShaderUniform { +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + _mtl_o._glesFragData_0 = half4(float4(0.0, 0.0, 0.0, 0.0)); + return _mtl_o; +} + + +// stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-deadcode-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-deadcode-ir.txt deleted file mode 100644 index 4be256a56..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-deadcode-ir.txt +++ /dev/null @@ -1,51 +0,0 @@ -struct v2f { - vec4 pos; - float unusedmember; -}; -void main () -{ - float arrunused_1[3]; - float arrused_2[3]; - float funused_3; - float fused_4; - v2f sunused_5; - v2f sused_6; - float f_7; - float tmpvar_8; - tmpvar_8 = gl_FragCoord.x; - f_7 = tmpvar_8; - vec4 tmpvar_9; - tmpvar_9 = vec4(f_7); - vec4 tmpvar_10; - tmpvar_10 = tmpvar_9; - sused_6.pos = tmpvar_10; - float tmpvar_11; - tmpvar_11 = (f_7 * 6.0); - sused_6.unusedmember = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12 = vec4(f_7); - vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - sunused_5.pos = tmpvar_13; - float tmpvar_14; - tmpvar_14 = (f_7 * 7.0); - sunused_5.unusedmember = tmpvar_14; - float tmpvar_15; - tmpvar_15 = (f_7 * 2.0); - fused_4 = tmpvar_15; - float tmpvar_16; - tmpvar_16 = (f_7 * 3.0); - funused_3 = tmpvar_16; - float tmpvar_17; - tmpvar_17 = (f_7 * 4.0); - arrused_2[0] = tmpvar_17; - float tmpvar_18; - tmpvar_18 = (f_7 * 5.0); - arrunused_1[0] = tmpvar_18; - vec4 tmpvar_19; - tmpvar_19 = vec4(((fused_4 + sused_6.pos.x) + arrused_2[0])); - vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - gl_FragColor = tmpvar_20; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-deadcode-out.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-deadcode-out.txt index ab5e3aace..75b022004 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-deadcode-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-deadcode-out.txt @@ -4,4 +4,6 @@ void main () } -// inputs: 1, stats: 4 alu 0 tex 0 flow +// stats: 4 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_FragCoord (high float) 4x1 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-deadcodestruct-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-deadcodestruct-ir.txt deleted file mode 100644 index 9b51cbfb0..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-deadcodestruct-ir.txt +++ /dev/null @@ -1,24 +0,0 @@ -struct foo { - float used; - float unused; -}; -void main () -{ - foo s_1; - float f_2; - float tmpvar_3; - tmpvar_3 = 1.0; - f_2 = tmpvar_3; - float tmpvar_4; - tmpvar_4 = f_2; - s_1.used = tmpvar_4; - float tmpvar_5; - tmpvar_5 = f_2; - s_1.unused = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6 = vec4(s_1.used); - vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - gl_FragColor = tmpvar_7; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-deadcodestruct-out.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-deadcodestruct-out.txt index d53e69fd2..b65fa08e0 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-deadcodestruct-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-deadcodestruct-out.txt @@ -4,4 +4,4 @@ void main () } -// inputs: 0, stats: 1 alu 0 tex 0 flow +// stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-inES3.txt new file mode 100644 index 000000000..9d383f18a --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-inES3.txt @@ -0,0 +1,15 @@ +#version 300 es +out lowp vec4 _fragData; +in lowp vec3 normal; +in lowp vec3 halfDir; +uniform mediump float specPower; + +void main() +{ + lowp float nh = dot (normal, halfDir); + mediump float spec = pow (nh, specPower); + + lowp vec4 c; + c = vec4(spec); + _fragData = c; +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-irES.txt deleted file mode 100644 index 97e3f2b1e..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-irES.txt +++ /dev/null @@ -1,28 +0,0 @@ -varying lowp vec3 normal; -varying lowp vec3 halfDir; -uniform mediump float specPower; -void main () -{ - lowp vec4 c_1; - mediump float spec_2; - lowp float nh_3; - lowp float tmpvar_4; - tmpvar_4 = dot (normal, halfDir); - lowp float tmpvar_5; - tmpvar_5 = tmpvar_4; - nh_3 = tmpvar_5; - mediump float tmpvar_6; - tmpvar_6 = pow (nh_3, specPower); - mediump float tmpvar_7; - tmpvar_7 = tmpvar_6; - spec_2 = tmpvar_7; - mediump vec4 tmpvar_8; - tmpvar_8 = vec4(spec_2); - mediump vec4 tmpvar_9; - tmpvar_9 = tmpvar_8; - c_1 = tmpvar_9; - lowp vec4 tmpvar_10; - tmpvar_10 = c_1; - gl_FragColor = tmpvar_10; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES.txt index 35c09b895..d5a6423ef 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES.txt @@ -13,4 +13,9 @@ void main () } -// inputs: 2, stats: 2 alu 0 tex 0 flow +// stats: 2 alu 0 tex 0 flow +// inputs: 2 +// #0: normal (low float) 3x1 [-1] +// #1: halfDir (low float) 3x1 [-1] +// uniforms: 1 (total size: 0) +// #0: specPower (medium float) 1x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES3.txt new file mode 100644 index 000000000..9869db21f --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES3.txt @@ -0,0 +1,23 @@ +#version 300 es +out lowp vec4 _fragData; +in lowp vec3 normal; +in lowp vec3 halfDir; +uniform mediump float specPower; +void main () +{ + lowp vec4 c_1; + lowp float tmpvar_2; + tmpvar_2 = dot (normal, halfDir); + mediump vec4 tmpvar_3; + tmpvar_3 = vec4(pow (tmpvar_2, specPower)); + c_1 = tmpvar_3; + _fragData = c_1; +} + + +// stats: 2 alu 0 tex 0 flow +// inputs: 2 +// #0: normal (low float) 3x1 [-1] +// #1: halfDir (low float) 3x1 [-1] +// uniforms: 1 (total size: 0) +// #0: specPower (medium float) 1x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES3Metal.txt new file mode 100644 index 000000000..5c809e609 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES3Metal.txt @@ -0,0 +1,32 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + half3 normal; + half3 halfDir; +}; +struct xlatMtlShaderOutput { + half4 _fragData [[color(0)]]; +}; +struct xlatMtlShaderUniform { + half specPower; +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 c_1; + half tmpvar_2; + tmpvar_2 = dot (_mtl_i.normal, _mtl_i.halfDir); + half4 tmpvar_3; + tmpvar_3 = half4(pow (tmpvar_2, _mtl_u.specPower)); + c_1 = tmpvar_3; + _mtl_o._fragData = c_1; + return _mtl_o; +} + + +// stats: 2 alu 0 tex 0 flow +// inputs: 2 +// #0: normal (low float) 3x1 [-1] +// #1: halfDir (low float) 3x1 [-1] +// uniforms: 1 (total size: 2) +// #0: specPower (medium float) 1x1 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-ir.txt deleted file mode 100644 index 274569d79..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-ir.txt +++ /dev/null @@ -1,18 +0,0 @@ -void main () -{ - vec4 c_1; - vec4 tmpvar_2; - tmpvar_2 = vec4(0.0, 0.0, 0.0, 0.0); - c_1 = tmpvar_2; - if ((gl_FragCoord.x > 0.5)) { - if ((gl_FragCoord.y > 0.5)) { - vec4 tmpvar_3; - tmpvar_3 = vec4(0.5, 0.5, 0.5, 0.5); - c_1 = tmpvar_3; - }; - }; - vec4 tmpvar_4; - tmpvar_4 = c_1; - gl_FragColor = tmpvar_4; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-out.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-out.txt index 19cad2477..9ad099bb7 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-out.txt @@ -9,4 +9,6 @@ void main () } -// inputs: 1, stats: 5 alu 0 tex 1 flow +// stats: 5 alu 0 tex 1 flow +// inputs: 1 +// #0: gl_FragCoord (high float) 4x1 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-inline-inoutstruct-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-inline-inoutstruct-ir.txt deleted file mode 100644 index 45c4b1fb1..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-inline-inoutstruct-ir.txt +++ /dev/null @@ -1,21 +0,0 @@ -struct SurfaceOutput { - vec4 color; -}; -void surf ( - inout SurfaceOutput o_1 -) -{ - vec4 tmpvar_2; - tmpvar_2 = vec4(1.0, 1.0, 1.0, 1.0); - o_1.color = tmpvar_2; -} - -void main () -{ - SurfaceOutput o_3; - surf (o_3); - vec4 tmpvar_4; - tmpvar_4 = o_3.color; - gl_FragColor = tmpvar_4; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-inline-inoutstruct-out.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-inline-inoutstruct-out.txt index d53e69fd2..b65fa08e0 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-inline-inoutstruct-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-inline-inoutstruct-out.txt @@ -4,4 +4,4 @@ void main () } -// inputs: 0, stats: 1 alu 0 tex 0 flow +// stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect-irES.txt deleted file mode 100644 index 79f387933..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect-irES.txt +++ /dev/null @@ -1,48 +0,0 @@ -varying lowp float xx; -int func ( - inout mediump float x_1 -) -{ - mediump float tmpvar_2; - tmpvar_2 = (x_1 * 2.0); - x_1 = tmpvar_2; - return 0; -} - -void main () -{ - lowp float c_3; - int i_4; - lowp float x_5; - lowp float tmpvar_6; - tmpvar_6 = xx; - x_5 = tmpvar_6; - int tmpvar_7; - tmpvar_7 = func (x_5); - int tmpvar_8; - tmpvar_8 = tmpvar_7; - i_4 = tmpvar_8; - if ((x_5 < 0.0)) { - discard; - }; - mediump float tmpvar_9; - tmpvar_9 = 0.0; - c_3 = tmpvar_9; - while (true) { - if (!((i_4 < 4))) { - break; - }; - lowp float tmpvar_10; - tmpvar_10 = (c_3 + xx); - c_3 = tmpvar_10; - int tmpvar_11; - tmpvar_11 = (i_4 + 1); - i_4 = tmpvar_11; - }; - lowp vec4 tmpvar_12; - tmpvar_12 = vec4(c_3); - lowp vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - gl_FragColor = tmpvar_13; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect-outES.txt index cf5c2881d..d41b3c072 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect-outES.txt @@ -2,9 +2,9 @@ varying lowp float xx; void main () { lowp float c_1; - lowp float tmpvar_2; - tmpvar_2 = (xx * 2.0); - if ((tmpvar_2 < 0.0)) { + lowp float x_2; + x_2 = (xx * 2.0); + if ((x_2 < 0.0)) { discard; }; c_1 = (xx + xx); @@ -16,4 +16,6 @@ void main () } -// inputs: 1, stats: 5 alu 1 tex 1 flow +// stats: 5 alu 1 tex 1 flow +// inputs: 1 +// #0: xx (low float) 1x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-irES.txt deleted file mode 100644 index 5c4545c06..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-irES.txt +++ /dev/null @@ -1,42 +0,0 @@ -varying lowp float xx; -void main () -{ - lowp float c_1; - int i_2; - int x_3; - int tmpvar_4; - if ((xx > 0.5)) { - tmpvar_4 = 2; - } else { - tmpvar_4 = 4; - }; - int tmpvar_5; - tmpvar_5 = tmpvar_4; - x_3 = tmpvar_5; - int tmpvar_6; - tmpvar_6 = tmpvar_5; - i_2 = tmpvar_6; - if ((x_3 < 2)) { - discard; - }; - mediump float tmpvar_7; - tmpvar_7 = 0.0; - c_1 = tmpvar_7; - while (true) { - if (!((i_2 < 4))) { - break; - }; - lowp float tmpvar_8; - tmpvar_8 = (c_1 + xx); - c_1 = tmpvar_8; - int tmpvar_9; - tmpvar_9 = (i_2 + 1); - i_2 = tmpvar_9; - }; - lowp vec4 tmpvar_10; - tmpvar_10 = vec4(c_1); - lowp vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - gl_FragColor = tmpvar_11; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-outES.txt index 2c896f3d2..19eddd50a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-outES.txt @@ -20,4 +20,6 @@ void main () } -// inputs: 1, stats: 8 alu 1 tex 4 flow +// stats: 8 alu 1 tex 4 flow +// inputs: 1 +// #0: xx (low float) 1x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-simple-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-simple-irES.txt deleted file mode 100644 index 9781bb213..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-simple-irES.txt +++ /dev/null @@ -1,32 +0,0 @@ -varying lowp float xx; -void main () -{ - lowp float c_1; - int i_2; - int tmpvar_3; - tmpvar_3 = 0; - i_2 = tmpvar_3; - if ((xx < 0.0)) { - discard; - }; - mediump float tmpvar_4; - tmpvar_4 = 0.0; - c_1 = tmpvar_4; - while (true) { - if (!((i_2 < 4))) { - break; - }; - lowp float tmpvar_5; - tmpvar_5 = (c_1 + xx); - c_1 = tmpvar_5; - int tmpvar_6; - tmpvar_6 = (i_2 + 1); - i_2 = tmpvar_6; - }; - lowp vec4 tmpvar_7; - tmpvar_7 = vec4(c_1); - lowp vec4 tmpvar_8; - tmpvar_8 = tmpvar_7; - gl_FragColor = tmpvar_8; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-simple-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-simple-outES.txt index e96ff95e6..114c07881 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-simple-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-simple-outES.txt @@ -14,4 +14,6 @@ void main () } -// inputs: 1, stats: 4 alu 1 tex 1 flow +// stats: 4 alu 1 tex 1 flow +// inputs: 1 +// #0: xx (low float) 1x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-vec-var-index-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-vec-var-index-ir.txt deleted file mode 100644 index e830d87d0..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-vec-var-index-ir.txt +++ /dev/null @@ -1,33 +0,0 @@ -void main () -{ - int j_1; - vec2 c_2; - vec2 tmpvar_3; - tmpvar_3 = vec2(0.0, 0.0); - c_2 = tmpvar_3; - int tmpvar_4; - tmpvar_4 = 0; - j_1 = tmpvar_4; - while (true) { - if (!((j_1 < 2))) { - break; - }; - vec2 tmpvar_5; - tmpvar_5 = vec2(vec2(0.0, 0.0)[j_1]); - vec2 tmpvar_6; - tmpvar_6 = abs (tmpvar_5); - vec2 tmpvar_7; - tmpvar_7 = (c_2 + tmpvar_6); - c_2 = tmpvar_7; - int tmpvar_8; - tmpvar_8 = (j_1 + 1); - j_1 = tmpvar_8; - }; - vec4 tmpvar_9; - tmpvar_9.zw = vec2(0.0, 0.0); - tmpvar_9.xy = c_2.xy; - vec4 tmpvar_10; - tmpvar_10 = tmpvar_9; - gl_FragColor = tmpvar_10; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-vec-var-index-out.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-vec-var-index-out.txt index 2cbd19398..5dd288320 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-vec-var-index-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-vec-var-index-out.txt @@ -7,4 +7,4 @@ void main () } -// inputs: 0, stats: 2 alu 0 tex 0 flow +// stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-ir.txt deleted file mode 100644 index fabffa72a..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-ir.txt +++ /dev/null @@ -1,37 +0,0 @@ -uniform sampler2D maintex; -uniform float factor; -varying vec2 uv; -void main () -{ - bool cond_1; - vec2 coord_2; - vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (maintex, uv); - vec4 tmpvar_5; - tmpvar_5 = tmpvar_4; - c_3 = tmpvar_5; - vec2 tmpvar_6; - tmpvar_6 = c_3.xy; - coord_2 = tmpvar_6; - bool tmpvar_7; - tmpvar_7 = (c_3.w >= 0.5); - cond_1 = tmpvar_7; - if (!(cond_1)) { - float tmpvar_8; - tmpvar_8 = (coord_2.x + factor); - coord_2.x = tmpvar_8; - }; - if (cond_1) { - float tmpvar_9; - tmpvar_9 = (coord_2.y + factor); - coord_2.y = vec2(tmpvar_9).y; - }; - vec4 tmpvar_10; - tmpvar_10.zw = vec2(0.0, 0.0); - tmpvar_10.xy = coord_2.xy; - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - gl_FragColor = tmpvar_11; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-out.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-out.txt index b408f934f..e788e97b1 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-out.txt @@ -22,4 +22,10 @@ void main () } -// inputs: 1, stats: 5 alu 1 tex 2 flow +// stats: 5 alu 1 tex 2 flow +// inputs: 1 +// #0: uv (high float) 2x1 [-1] +// uniforms: 1 (total size: 0) +// #0: factor (high float) 1x1 [-1] +// textures: 1 +// #0: maintex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-retval-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-retval-ir.txt deleted file mode 100644 index 901852015..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-retval-ir.txt +++ /dev/null @@ -1,85 +0,0 @@ -uniform float _Fresnel; -uniform float _SpecIntensity; -varying vec3 inN; -varying vec3 inE; -float saturate ( - in float f_1 -) -{ - float tmpvar_2; - tmpvar_2 = min (1.0, f_1); - float tmpvar_3; - tmpvar_3 = max (0.0, tmpvar_2); - return tmpvar_3; -} - -float splineFresnel ( - in vec3 N_4, - in vec3 E_5, - in float specIntensity_6, - in float fresnel_7 -) -{ - vec2 t_8; - vec3 p_9; - float factor3_10; - float factor_11; - float tmpvar_12; - tmpvar_12 = dot (N_4, E_5); - float tmpvar_13; - tmpvar_13 = saturate (tmpvar_12); - float tmpvar_14; - tmpvar_14 = (1.0 - tmpvar_13); - factor_11 = tmpvar_14; - float tmpvar_15; - tmpvar_15 = ((factor_11 * factor_11) * factor_11); - factor3_10 = tmpvar_15; - vec3 tmpvar_16; - tmpvar_16.x = 1.0; - tmpvar_16.y = factor_11; - tmpvar_16.z = factor3_10; - vec3 tmpvar_17; - tmpvar_17 = tmpvar_16; - p_9 = tmpvar_17; - vec2 tmpvar_18; - tmpvar_18.x = (1.0 - fresnel_7); - tmpvar_18.y = fresnel_7; - vec2 tmpvar_19; - tmpvar_19 = tmpvar_18; - t_8 = tmpvar_19; - float tmpvar_20; - tmpvar_20 = dot (p_9.xy, t_8); - float tmpvar_21; - tmpvar_21 = tmpvar_20; - p_9.x = tmpvar_21; - float tmpvar_22; - tmpvar_22 = dot (p_9.yz, t_8); - float tmpvar_23; - tmpvar_23 = tmpvar_22; - p_9.y = vec2(tmpvar_23).y; - float tmpvar_24; - tmpvar_24 = dot (p_9.xy, t_8); - float tmpvar_25; - tmpvar_25 = (0.05 + (0.95 * tmpvar_24)); - factor_11 = tmpvar_25; - float tmpvar_26; - tmpvar_26 = (factor_11 * specIntensity_6); - factor_11 = tmpvar_26; - return factor_11; -} - -void main () -{ - float f_27; - float tmpvar_28; - tmpvar_28 = splineFresnel (inN, inE, _SpecIntensity, _Fresnel); - float tmpvar_29; - tmpvar_29 = tmpvar_28; - f_27 = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = vec4(f_27); - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - gl_FragColor = tmpvar_31; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-retval-out.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-retval-out.txt index 9ec1e886e..21c35befb 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-retval-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-retval-out.txt @@ -5,24 +5,31 @@ varying vec3 inE; void main () { vec3 p_1; - float tmpvar_2; - tmpvar_2 = (1.0 - max (0.0, min (1.0, + float factor_2; + float tmpvar_3; + tmpvar_3 = (1.0 - min (max ( dot (inN, inE) - ))); - vec3 tmpvar_3; - tmpvar_3.x = 1.0; - tmpvar_3.y = tmpvar_2; - tmpvar_3.z = ((tmpvar_2 * tmpvar_2) * tmpvar_2); - p_1.z = tmpvar_3.z; - vec2 tmpvar_4; - tmpvar_4.x = (1.0 - _Fresnel); - tmpvar_4.y = _Fresnel; - p_1.x = dot (tmpvar_3.xy, tmpvar_4); - p_1.y = dot (tmpvar_3.yz, tmpvar_4); - gl_FragColor = vec4(((0.05 + (0.95 * - dot (p_1.xy, tmpvar_4) - )) * _SpecIntensity)); + , 0.0), 1.0)); + vec3 tmpvar_4; + tmpvar_4.x = 1.0; + tmpvar_4.y = tmpvar_3; + tmpvar_4.z = ((tmpvar_3 * tmpvar_3) * tmpvar_3); + p_1.z = tmpvar_4.z; + vec2 tmpvar_5; + tmpvar_5.x = (1.0 - _Fresnel); + tmpvar_5.y = _Fresnel; + p_1.x = dot (tmpvar_4.xy, tmpvar_5); + p_1.y = dot (tmpvar_4.yz, tmpvar_5); + factor_2 = (0.05 + (0.95 * dot (p_1.xy, tmpvar_5))); + factor_2 = (factor_2 * _SpecIntensity); + gl_FragColor = vec4(factor_2); } -// inputs: 2, stats: 14 alu 0 tex 0 flow +// stats: 14 alu 0 tex 0 flow +// inputs: 2 +// #0: inN (high float) 3x1 [-1] +// #1: inE (high float) 3x1 [-1] +// uniforms: 2 (total size: 0) +// #0: _Fresnel (high float) 1x1 [-1] +// #1: _SpecIntensity (high float) 1x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-ir.txt deleted file mode 100644 index 5c6ce1912..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-ir.txt +++ /dev/null @@ -1,37 +0,0 @@ -uniform sampler2D maintex; -uniform float factor; -varying vec2 uv; -void main () -{ - vec4 r_1; - vec4 c_2; - vec4 tmpvar_3; - tmpvar_3 = texture2D (maintex, uv); - vec4 tmpvar_4; - tmpvar_4 = tmpvar_3; - c_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = max (0.123, c_2.x); - float tmpvar_6; - tmpvar_6 = tmpvar_5; - r_1.x = tmpvar_6; - float tmpvar_7; - tmpvar_7 = max (0.123, c_2.y); - float tmpvar_8; - tmpvar_8 = tmpvar_7; - r_1.y = vec2(tmpvar_8).y; - float tmpvar_9; - tmpvar_9 = min (c_2.z, factor); - float tmpvar_10; - tmpvar_10 = tmpvar_9; - r_1.z = vec3(tmpvar_10).z; - float tmpvar_11; - tmpvar_11 = min (c_2.w, factor); - float tmpvar_12; - tmpvar_12 = tmpvar_11; - r_1.w = vec4(tmpvar_12).w; - vec4 tmpvar_13; - tmpvar_13 = r_1; - gl_FragColor = tmpvar_13; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-out.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-out.txt index d898f49f1..08d56ea9b 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-out.txt @@ -12,4 +12,10 @@ void main () } -// inputs: 1, stats: 2 alu 1 tex 0 flow +// stats: 2 alu 1 tex 0 flow +// inputs: 1 +// #0: uv (high float) 2x1 [-1] +// uniforms: 1 (total size: 0) +// #0: factor (high float) 1x1 [-1] +// textures: 1 +// #0: maintex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/pp-basic-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/pp-basic-ir.txt deleted file mode 100644 index 8d5f683f7..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/pp-basic-ir.txt +++ /dev/null @@ -1,20 +0,0 @@ -vec4 xlat_main () -{ - return vec4(1.0, 1.0, 1.0, 1.0); -} - -void main () -{ - vec4 xl_retval_1; - vec4 tmpvar_2; - tmpvar_2 = xlat_main (); - vec4 tmpvar_3; - tmpvar_3 = tmpvar_2; - xl_retval_1 = tmpvar_3; - vec4 tmpvar_4; - tmpvar_4 = xl_retval_1.xyzw; - vec4 tmpvar_5; - tmpvar_5 = tmpvar_4; - gl_FragData[0] = tmpvar_5; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/pp-basic-out.txt b/3rdparty/glsl-optimizer/tests/fragment/pp-basic-out.txt index 486073c7c..3c287668c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/pp-basic-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/pp-basic-out.txt @@ -4,4 +4,4 @@ void main () } -// inputs: 0, stats: 1 alu 0 tex 0 flow +// stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-default-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-default-irES.txt deleted file mode 100644 index fa8d582d6..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-default-irES.txt +++ /dev/null @@ -1,46 +0,0 @@ -precision lowp int; -precision highp float; -struct MyStruct { - float f; - int i; -}; -uniform MyStruct s1; -uniform float fh1; -uniform highp float fh2; -uniform mediump float fm; -uniform int il1; -uniform int il2; -uniform int im; -void main () -{ - float z_1; - int i_2; - lowp float f_3; - highp float tmpvar_4; - tmpvar_4 = (((fh1 + fh2) + fm) + s1.f); - f_3 = tmpvar_4; - int tmpvar_5; - tmpvar_5 = (((il1 + il2) + im) + s1.i); - i_2 = tmpvar_5; - float tmpvar_6; - tmpvar_6 = 0.0; - z_1 = tmpvar_6; - float tmpvar_7; - if ((gl_FragCoord.x > 0.5)) { - tmpvar_7 = 0.9; - } else { - tmpvar_7 = 0.1; - }; - float tmpvar_8; - tmpvar_8 = (z_1 + tmpvar_7); - z_1 = tmpvar_8; - highp vec4 tmpvar_9; - tmpvar_9.w = 0.0; - tmpvar_9.x = f_3; - tmpvar_9.y = float(i_2); - tmpvar_9.z = z_1; - highp vec4 tmpvar_10; - tmpvar_10 = tmpvar_9; - gl_FragColor = tmpvar_10; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-default-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-default-outES.txt index e33e779a1..44b73655f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-default-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/prec-default-outES.txt @@ -36,4 +36,14 @@ void main () } -// inputs: 1, stats: 11 alu 0 tex 1 flow +// stats: 11 alu 0 tex 1 flow +// inputs: 1 +// #0: gl_FragCoord (high float) 4x1 [-1] loc 0 +// uniforms: 7 (total size: 0) +// #0: s1 (high other) 0x0 [-1] +// #1: fh1 (high float) 1x1 [-1] +// #2: fh2 (high float) 1x1 [-1] +// #3: fm (medium float) 1x1 [-1] +// #4: il1 (high int) 1x1 [-1] +// #5: il2 (low int) 1x1 [-1] +// #6: im (medium int) 1x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-expressions-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-expressions-inES3.txt new file mode 100644 index 000000000..bf4d59015 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/prec-expressions-inES3.txt @@ -0,0 +1,17 @@ +#version 300 es +out lowp vec4 _fragData; + +uniform mediump mat4 _LightMatrix; +uniform highp vec3 _WorldPos; + +void main() +{ + // Used to expose bug in Metal output where it was inserting cast in the wrong place, + // i.e. it was doing a v3 = (float4)(mat * vec).xyz + mediump vec3 lightCoord = vec3 ( (_LightMatrix * vec4(_WorldPos, 1.0)) ); + + mediump vec4 r; + r.xyz = lightCoord; + r.w = 1.0; + _fragData = r; +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-expressions-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-expressions-outES3.txt new file mode 100644 index 000000000..b5bb790a7 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/prec-expressions-outES3.txt @@ -0,0 +1,24 @@ +#version 300 es +out lowp vec4 _fragData; +uniform mediump mat4 _LightMatrix; +uniform highp vec3 _WorldPos; +void main () +{ + mediump vec4 r_1; + mediump vec3 lightCoord_2; + highp vec4 tmpvar_3; + tmpvar_3.w = 1.0; + tmpvar_3.xyz = _WorldPos; + highp vec3 tmpvar_4; + tmpvar_4 = (_LightMatrix * tmpvar_3).xyz; + lightCoord_2 = tmpvar_4; + r_1.xyz = lightCoord_2; + r_1.w = 1.0; + _fragData = r_1; +} + + +// stats: 3 alu 0 tex 0 flow +// uniforms: 2 (total size: 0) +// #0: _LightMatrix (medium float) 4x4 [-1] +// #1: _WorldPos (high float) 3x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-expressions-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-expressions-outES3Metal.txt new file mode 100644 index 000000000..ddfda4d46 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/prec-expressions-outES3Metal.txt @@ -0,0 +1,33 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { +}; +struct xlatMtlShaderOutput { + half4 _fragData [[color(0)]]; +}; +struct xlatMtlShaderUniform { + half4x4 _LightMatrix; + float3 _WorldPos; +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 r_1; + half3 lightCoord_2; + float4 tmpvar_3; + tmpvar_3.w = 1.0; + tmpvar_3.xyz = _mtl_u._WorldPos; + float3 tmpvar_4; + tmpvar_4 = ((float4)(_mtl_u._LightMatrix * (half4)tmpvar_3)).xyz; + lightCoord_2 = half3(tmpvar_4); + r_1.xyz = lightCoord_2; + r_1.w = half(1.0); + _mtl_o._fragData = r_1; + return _mtl_o; +} + + +// stats: 3 alu 0 tex 0 flow +// uniforms: 2 (total size: 48) +// #0: _LightMatrix (medium float) 4x4 [-1] loc 0 +// #1: _WorldPos (high float) 3x1 [-1] loc 32 diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-irES.txt deleted file mode 100644 index ed4f9f0be..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-irES.txt +++ /dev/null @@ -1,64 +0,0 @@ -uniform sampler2D _MainTex; -uniform sampler2D _BurntTex; -uniform mediump float _EmberFadeEnd; -uniform mediump float _EmberFadeStart; -varying mediump vec2 xlv_TEXCOORD0; -mediump float xll_saturate ( - in mediump float x_1 -) -{ - mediump float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -mediump vec3 xll_saturate ( - in mediump vec3 x_3 -) -{ - mediump vec3 tmpvar_4; - tmpvar_4 = clamp (x_3, 0.0, 1.0); - return tmpvar_4; -} - -lowp vec4 frag ( - in mediump vec2 uv_5 -) -{ - lowp float t_6; - lowp vec3 burn_7; - lowp vec3 base_8; - lowp vec4 tmpvar_9; - tmpvar_9 = texture2D (_MainTex, uv_5); - lowp vec3 tmpvar_10; - tmpvar_10 = tmpvar_9.xyz; - base_8 = tmpvar_10; - lowp vec4 tmpvar_11; - tmpvar_11 = texture2D (_BurntTex, uv_5); - lowp vec3 tmpvar_12; - tmpvar_12 = tmpvar_11.xyz; - burn_7 = tmpvar_12; - mediump float tmpvar_13; - tmpvar_13 = xll_saturate (((_EmberFadeStart - 0.05) / (_EmberFadeStart - _EmberFadeEnd))); - mediump float tmpvar_14; - tmpvar_14 = tmpvar_13; - t_6 = tmpvar_14; - lowp vec3 tmpvar_15; - tmpvar_15 = vec3(t_6); - lowp vec3 tmpvar_16; - tmpvar_16 = mix (base_8, burn_7, tmpvar_15); - lowp vec4 tmpvar_17; - tmpvar_17.w = 1.0; - tmpvar_17.xyz = tmpvar_16.xyz; - return tmpvar_17; -} - -void main () -{ - lowp vec4 tmpvar_18; - tmpvar_18 = frag (xlv_TEXCOORD0); - lowp vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - gl_FragColor = tmpvar_19; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-outES.txt index 3e98ac2a4..0c8e9f850 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-outES.txt @@ -16,4 +16,12 @@ void main () } -// inputs: 1, stats: 6 alu 2 tex 0 flow +// stats: 6 alu 2 tex 0 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (medium float) 2x1 [-1] +// uniforms: 2 (total size: 0) +// #0: _EmberFadeEnd (medium float) 1x1 [-1] +// #1: _EmberFadeStart (medium float) 1x1 [-1] +// textures: 2 +// #0: _MainTex (low 2d) 0x0 [-1] +// #1: _BurntTex (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-irES.txt deleted file mode 100644 index 77e19d9f6..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-irES.txt +++ /dev/null @@ -1,64 +0,0 @@ -uniform sampler2D _MainTex; -uniform sampler2D _BurntTex; -uniform mediump float _EmberFadeEnd; -uniform mediump float _EmberFadeStart; -varying mediump vec2 xlv_TEXCOORD0; -mediump float xll_saturate ( - in mediump float x_1 -) -{ - mediump float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -mediump vec3 xll_saturate ( - in mediump vec3 x_3 -) -{ - mediump vec3 tmpvar_4; - tmpvar_4 = clamp (x_3, 0.0, 1.0); - return tmpvar_4; -} - -lowp vec4 frag ( - in mediump vec2 uv_5 -) -{ - lowp vec3 t_6; - lowp vec3 burn_7; - lowp vec3 base_8; - lowp vec4 tmpvar_9; - tmpvar_9 = texture2D (_MainTex, uv_5); - lowp vec3 tmpvar_10; - tmpvar_10 = tmpvar_9.xyz; - base_8 = tmpvar_10; - lowp vec4 tmpvar_11; - tmpvar_11 = texture2D (_BurntTex, uv_5); - lowp vec3 tmpvar_12; - tmpvar_12 = tmpvar_11.xyz; - burn_7 = tmpvar_12; - mediump float tmpvar_13; - tmpvar_13 = xll_saturate (((_EmberFadeStart - 0.05) / (_EmberFadeStart - _EmberFadeEnd))); - mediump vec3 tmpvar_14; - tmpvar_14 = vec3(tmpvar_13); - mediump vec3 tmpvar_15; - tmpvar_15 = tmpvar_14; - t_6 = tmpvar_15; - lowp vec3 tmpvar_16; - tmpvar_16 = mix (base_8, burn_7, t_6); - lowp vec4 tmpvar_17; - tmpvar_17.w = 1.0; - tmpvar_17.xyz = tmpvar_16.xyz; - return tmpvar_17; -} - -void main () -{ - lowp vec4 tmpvar_18; - tmpvar_18 = frag (xlv_TEXCOORD0); - lowp vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - gl_FragColor = tmpvar_19; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-outES.txt index f6f0c7679..17ca6d457 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-outES.txt @@ -16,4 +16,12 @@ void main () } -// inputs: 1, stats: 6 alu 2 tex 0 flow +// stats: 6 alu 2 tex 0 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (medium float) 2x1 [-1] +// uniforms: 2 (total size: 0) +// #0: _EmberFadeEnd (medium float) 1x1 [-1] +// #1: _EmberFadeStart (medium float) 1x1 [-1] +// textures: 2 +// #0: _MainTex (low 2d) 0x0 [-1] +// #1: _BurntTex (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-temps-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-temps-irES.txt deleted file mode 100644 index 285a00db3..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-temps-irES.txt +++ /dev/null @@ -1,106 +0,0 @@ -struct v2f_surf { - highp vec4 pos; - lowp vec2 pack0; - lowp vec3 halfDir; - lowp vec3 lightDir; - lowp vec3 vlight; -}; -uniform sampler2D _BumpMap; -uniform lowp vec4 _LightColor0; -uniform sampler2D _MainTex; -uniform lowp float _Shininess; -varying lowp vec2 xlv_TEXCOORD0; -varying lowp vec3 xlv_TEXCOORD1; -varying lowp vec3 xlv_TEXCOORD2; -varying lowp vec3 xlv_TEXCOORD3; -lowp vec4 frag_surf ( - in v2f_surf IN_1 -) -{ - lowp vec4 c_2; - lowp float spec_3; - lowp float nh_4; - lowp float diff_5; - lowp vec3 Normal_6; - lowp vec4 tex_7; - lowp vec4 tmpvar_8; - tmpvar_8 = texture2D (_MainTex, IN_1.pack0); - lowp vec4 tmpvar_9; - tmpvar_9 = tmpvar_8; - tex_7 = tmpvar_9; - lowp vec4 tmpvar_10; - tmpvar_10 = texture2D (_BumpMap, IN_1.pack0); - lowp vec3 tmpvar_11; - tmpvar_11 = ((tmpvar_10.xyz * 2.0) - 1.0); - Normal_6 = tmpvar_11; - lowp float tmpvar_12; - tmpvar_12 = dot (Normal_6, IN_1.lightDir); - lowp float tmpvar_13; - tmpvar_13 = max (0.0, tmpvar_12); - lowp float tmpvar_14; - tmpvar_14 = tmpvar_13; - diff_5 = tmpvar_14; - lowp float tmpvar_15; - tmpvar_15 = dot (Normal_6, IN_1.halfDir); - lowp float tmpvar_16; - tmpvar_16 = max (0.0, tmpvar_15); - lowp float tmpvar_17; - tmpvar_17 = tmpvar_16; - nh_4 = tmpvar_17; - lowp float tmpvar_18; - tmpvar_18 = pow (nh_4, _Shininess); - lowp float tmpvar_19; - tmpvar_19 = (tmpvar_18 * tex_7.w); - spec_3 = tmpvar_19; - lowp vec3 tmpvar_20; - tmpvar_20 = tex_7.xyz; - lowp vec3 tmpvar_21; - tmpvar_21 = ((tmpvar_20 * ( - (_LightColor0.xyz * diff_5) - + IN_1.vlight)) + (_LightColor0.xyz * spec_3)); - c_2.xyz = tmpvar_21.xyz.xyz; - mediump float tmpvar_22; - tmpvar_22 = 0.0; - c_2.w = vec4(tmpvar_22).w; - return c_2; -} - -void main () -{ - v2f_surf xlt_IN_23; - lowp vec4 xl_retval_24; - mediump vec4 tmpvar_25; - tmpvar_25 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_23.pos = tmpvar_25; - lowp vec2 tmpvar_26; - tmpvar_26 = xlv_TEXCOORD0.xy; - lowp vec2 tmpvar_27; - tmpvar_27 = tmpvar_26; - xlt_IN_23.pack0 = tmpvar_27; - lowp vec3 tmpvar_28; - tmpvar_28 = xlv_TEXCOORD1.xyz; - lowp vec3 tmpvar_29; - tmpvar_29 = tmpvar_28; - xlt_IN_23.halfDir = tmpvar_29; - lowp vec3 tmpvar_30; - tmpvar_30 = xlv_TEXCOORD2.xyz; - lowp vec3 tmpvar_31; - tmpvar_31 = tmpvar_30; - xlt_IN_23.lightDir = tmpvar_31; - lowp vec3 tmpvar_32; - tmpvar_32 = xlv_TEXCOORD3.xyz; - lowp vec3 tmpvar_33; - tmpvar_33 = tmpvar_32; - xlt_IN_23.vlight = tmpvar_33; - lowp vec4 tmpvar_34; - tmpvar_34 = frag_surf (xlt_IN_23); - lowp vec4 tmpvar_35; - tmpvar_35 = tmpvar_34; - xl_retval_24 = tmpvar_35; - lowp vec4 tmpvar_36; - tmpvar_36 = xl_retval_24.xyzw; - lowp vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - gl_FragData[0] = tmpvar_37; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-temps-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-temps-outES.txt index c4523b7a4..d1eb06ac3 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-temps-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/prec-temps-outES.txt @@ -9,18 +9,29 @@ varying lowp vec3 xlv_TEXCOORD3; void main () { lowp vec4 c_1; - lowp vec4 tmpvar_2; - tmpvar_2 = texture2D (_MainTex, xlv_TEXCOORD0); - lowp vec3 tmpvar_3; - tmpvar_3 = ((texture2D (_BumpMap, xlv_TEXCOORD0).xyz * 2.0) - 1.0); - c_1.xyz = ((tmpvar_2.xyz * ( - (_LightColor0.xyz * max (0.0, dot (tmpvar_3, xlv_TEXCOORD2))) + lowp vec3 Normal_2; + lowp vec4 tmpvar_3; + tmpvar_3 = texture2D (_MainTex, xlv_TEXCOORD0); + Normal_2 = ((texture2D (_BumpMap, xlv_TEXCOORD0).xyz * 2.0) - 1.0); + c_1.xyz = ((tmpvar_3.xyz * ( + (_LightColor0.xyz * max (0.0, dot (Normal_2, xlv_TEXCOORD2))) + xlv_TEXCOORD3)) + (_LightColor0.xyz * ( - pow (max (0.0, dot (tmpvar_3, xlv_TEXCOORD1)), _Shininess) - * tmpvar_2.w))); + pow (max (0.0, dot (Normal_2, xlv_TEXCOORD1)), _Shininess) + * tmpvar_3.w))); c_1.w = 0.0; gl_FragData[0] = c_1; } -// inputs: 4, stats: 14 alu 2 tex 0 flow +// stats: 14 alu 2 tex 0 flow +// inputs: 4 +// #0: xlv_TEXCOORD0 (low float) 2x1 [-1] +// #1: xlv_TEXCOORD1 (low float) 3x1 [-1] +// #2: xlv_TEXCOORD2 (low float) 3x1 [-1] +// #3: xlv_TEXCOORD3 (low float) 3x1 [-1] +// uniforms: 2 (total size: 0) +// #0: _LightColor0 (low float) 4x1 [-1] +// #1: _Shininess (low float) 1x1 [-1] +// textures: 2 +// #0: _BumpMap (low 2d) 0x0 [-1] +// #1: _MainTex (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-irES.txt deleted file mode 100644 index d0b66a2ac..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-irES.txt +++ /dev/null @@ -1,44 +0,0 @@ -uniform sampler2D tex_def; -uniform sampler2D tex_lowp; -uniform highp sampler2D tex_highp; -varying lowp vec2 var_lowp; -varying mediump vec2 var_mediump; -void main () -{ - lowp vec4 a1_1; - lowp vec4 c4_2; - lowp vec4 c3_3; - lowp vec4 c2_4; - lowp vec4 c1_5; - lowp vec4 tmpvar_6; - tmpvar_6 = texture2D (tex_def, var_lowp); - lowp vec4 tmpvar_7; - tmpvar_7 = (tmpvar_6 * 2.0); - c1_5 = tmpvar_7; - lowp vec4 tmpvar_8; - tmpvar_8 = texture2D (tex_def, var_mediump); - lowp vec4 tmpvar_9; - tmpvar_9 = (tmpvar_8 * 2.0); - c2_4 = tmpvar_9; - highp vec4 tmpvar_10; - tmpvar_10 = texture2D (tex_highp, var_mediump); - highp vec4 tmpvar_11; - tmpvar_11 = (tmpvar_10 * 2.0); - c3_3 = tmpvar_11; - lowp vec4 tmpvar_12; - tmpvar_12 = texture2D (tex_lowp, var_mediump); - lowp vec4 tmpvar_13; - tmpvar_13 = (tmpvar_12 * 2.0); - c4_2 = tmpvar_13; - lowp vec4 tmpvar_14; - tmpvar_14 = abs (var_lowp.xxxx); - lowp vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - a1_1 = tmpvar_15; - lowp vec4 tmpvar_16; - tmpvar_16 = ((( - (c1_5 + c2_4) - + c3_3) + c4_2) + a1_1); - gl_FragColor = tmpvar_16; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-outES.txt index f2da020aa..f0ef5372f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-outES.txt @@ -5,18 +5,27 @@ varying lowp vec2 var_lowp; varying mediump vec2 var_mediump; void main () { - lowp vec4 c3_1; - highp vec4 tmpvar_2; - tmpvar_2 = texture2D (tex_highp, var_mediump); - highp vec4 tmpvar_3; - tmpvar_3 = (tmpvar_2 * 2.0); - c3_1 = tmpvar_3; - lowp vec4 tmpvar_4; - tmpvar_4 = ((( - ((texture2D (tex_def, var_lowp) * 2.0) + (texture2D (tex_def, var_mediump) * 2.0)) - + c3_1) + (texture2D (tex_lowp, var_mediump) * 2.0)) + abs(var_lowp.xxxx)); - gl_FragColor = tmpvar_4; + lowp vec4 c4_1; + lowp vec4 c3_2; + lowp vec4 c2_3; + lowp vec4 c1_4; + c1_4 = (texture2D (tex_def, var_lowp) * 2.0); + c2_3 = (texture2D (tex_def, var_mediump) * 2.0); + highp vec4 tmpvar_5; + tmpvar_5 = texture2D (tex_highp, var_mediump); + c3_2 = (tmpvar_5 * 2.0); + c4_1 = (texture2D (tex_lowp, var_mediump) * 2.0); + lowp vec4 tmpvar_6; + tmpvar_6 = abs(var_lowp.xxxx); + gl_FragColor = ((c1_4 + c2_3) + ((c3_2 + c4_1) + tmpvar_6)); } -// inputs: 2, stats: 9 alu 4 tex 0 flow +// stats: 9 alu 4 tex 0 flow +// inputs: 2 +// #0: var_lowp (low float) 2x1 [-1] +// #1: var_mediump (medium float) 2x1 [-1] +// textures: 3 +// #0: tex_def (low 2d) 0x0 [-1] +// #1: tex_lowp (low 2d) 0x0 [-1] +// #2: tex_highp (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-irES.txt deleted file mode 100644 index c26a04452..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-irES.txt +++ /dev/null @@ -1,22 +0,0 @@ -uniform mediump float med_a; -uniform mediump float med_b; -uniform lowp float low_c; -void main () -{ - lowp vec4 c_1; - lowp float t_2; - mediump float tmpvar_3; - tmpvar_3 = (med_a + (low_c / med_b)); - t_2 = tmpvar_3; - lowp vec4 tmpvar_4; - tmpvar_4 = vec4(t_2); - lowp vec4 tmpvar_5; - tmpvar_5 = clamp (tmpvar_4, 0.0, 1.0); - lowp vec4 tmpvar_6; - tmpvar_6 = tmpvar_5; - c_1 = tmpvar_6; - lowp vec4 tmpvar_7; - tmpvar_7 = c_1; - gl_FragColor = tmpvar_7; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-outES.txt index 6ef22f5f8..7f50273f8 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-outES.txt @@ -13,4 +13,8 @@ void main () } -// inputs: 0, stats: 3 alu 0 tex 0 flow +// stats: 3 alu 0 tex 0 flow +// uniforms: 3 (total size: 0) +// #0: med_a (medium float) 1x1 [-1] +// #1: med_b (medium float) 1x1 [-1] +// #2: low_c (low float) 1x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-irES3.txt b/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-irES3.txt deleted file mode 100644 index 7d84a6f40..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-irES3.txt +++ /dev/null @@ -1,18 +0,0 @@ -#version 300 es -precision mediump float; -layout(location=0) out vec4 final_color0; -layout(location=1) out vec4 final_color1; -layout(location=2) out vec4 final_color2; -void main () -{ - vec4 tmpvar_1; - tmpvar_1 = vec4(1.0, 0.0, 0.0, 1.0); - final_color0 = tmpvar_1; - vec4 tmpvar_2; - tmpvar_2 = vec4(0.0, 1.0, 0.0, 1.0); - final_color1 = tmpvar_2; - vec4 tmpvar_3; - tmpvar_3 = vec4(0.0, 0.0, 1.0, 1.0); - final_color2 = tmpvar_3; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-outES3.txt index 40cf3b32e..a63f3a5e8 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-outES3.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-outES3.txt @@ -11,4 +11,4 @@ void main () } -// inputs: 0, stats: 3 alu 0 tex 0 flow +// stats: 3 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-outES3Metal.txt new file mode 100644 index 000000000..64f92a1ed --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-outES3Metal.txt @@ -0,0 +1,23 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { +}; +struct xlatMtlShaderOutput { + float4 final_color0 [[color(0)]]; + float4 final_color1 [[color(1)]]; + float4 final_color2 [[color(2)]]; +}; +struct xlatMtlShaderUniform { +}; +; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + _mtl_o.final_color0 = float4(1.0, 0.0, 0.0, 1.0); + _mtl_o.final_color1 = float4(0.0, 1.0, 0.0, 1.0); + _mtl_o.final_color2 = float4(0.0, 0.0, 1.0, 1.0); + return _mtl_o; +} + + +// stats: 3 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-inES3.txt new file mode 100644 index 000000000..1e5641c65 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-inES3.txt @@ -0,0 +1,25 @@ +#version 300 es +out lowp vec4 _fragData; +uniform sampler2D texlow; +uniform mediump sampler2D texmed; +uniform highp sampler2D texhigh; +uniform samplerCube cubelow; +uniform mediump samplerCube cubemed; +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); + return c; +} +in highp vec4 varUV; +void main() { + mediump vec4 r; + r = xlat_main(varUV); + _fragData = r; +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-irES.txt deleted file mode 100644 index 0ea51b88c..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-irES.txt +++ /dev/null @@ -1,58 +0,0 @@ -uniform sampler2D texlow; -uniform mediump sampler2D texmed; -uniform highp sampler2D texhigh; -uniform samplerCube cubelow; -uniform mediump samplerCube cubemed; -uniform highp samplerCube cubehigh; -varying highp vec4 varUV; -mediump vec4 xlat_main ( - in highp vec4 uv_1 -) -{ - mediump vec4 c_2; - lowp vec4 tmpvar_3; - tmpvar_3 = texture2D (texlow, uv_1.xy); - lowp vec4 tmpvar_4; - tmpvar_4 = tmpvar_3; - c_2 = tmpvar_4; - mediump vec4 tmpvar_5; - tmpvar_5 = texture2D (texmed, uv_1.xy); - mediump vec4 tmpvar_6; - tmpvar_6 = (c_2 + tmpvar_5); - c_2 = tmpvar_6; - highp vec4 tmpvar_7; - tmpvar_7 = texture2D (texhigh, uv_1.xy); - highp vec4 tmpvar_8; - tmpvar_8 = (c_2 + tmpvar_7); - c_2 = tmpvar_8; - lowp vec4 tmpvar_9; - tmpvar_9 = textureCube (cubelow, uv_1.xyz); - mediump vec4 tmpvar_10; - tmpvar_10 = (c_2 + tmpvar_9); - c_2 = tmpvar_10; - mediump vec4 tmpvar_11; - tmpvar_11 = textureCube (cubemed, uv_1.xyz); - mediump vec4 tmpvar_12; - tmpvar_12 = (c_2 + tmpvar_11); - c_2 = tmpvar_12; - highp vec4 tmpvar_13; - tmpvar_13 = textureCube (cubehigh, uv_1.xyz); - highp vec4 tmpvar_14; - tmpvar_14 = (c_2 + tmpvar_13); - c_2 = tmpvar_14; - return c_2; -} - -void main () -{ - mediump vec4 r_15; - mediump vec4 tmpvar_16; - tmpvar_16 = xlat_main (varUV); - mediump vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - r_15 = tmpvar_17; - mediump vec4 tmpvar_18; - tmpvar_18 = r_15; - gl_FragData[0] = tmpvar_18; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES.txt index 80e341bda..2ba7fa788 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES.txt @@ -1,7 +1,7 @@ uniform sampler2D texlow; uniform mediump sampler2D texmed; uniform highp sampler2D texhigh; -uniform samplerCube cubelow; +uniform lowp samplerCube cubelow; uniform mediump samplerCube cubemed; uniform highp samplerCube cubehigh; varying highp vec4 varUV; @@ -13,26 +13,30 @@ void main () c_1 = tmpvar_2; mediump vec4 tmpvar_3; tmpvar_3 = texture2D (texmed, varUV.xy); - mediump vec4 tmpvar_4; - tmpvar_4 = (c_1 + tmpvar_3); - highp vec4 tmpvar_5; - tmpvar_5 = texture2D (texhigh, varUV.xy); - highp vec4 tmpvar_6; - tmpvar_6 = (tmpvar_4 + tmpvar_5); - c_1 = tmpvar_6; - lowp vec4 tmpvar_7; - tmpvar_7 = textureCube (cubelow, varUV.xyz); - mediump vec4 tmpvar_8; - tmpvar_8 = textureCube (cubemed, varUV.xyz); - mediump vec4 tmpvar_9; - tmpvar_9 = ((c_1 + tmpvar_7) + tmpvar_8); - highp vec4 tmpvar_10; - tmpvar_10 = textureCube (cubehigh, varUV.xyz); - highp vec4 tmpvar_11; - tmpvar_11 = (tmpvar_9 + tmpvar_10); - c_1 = tmpvar_11; + c_1 = (c_1 + tmpvar_3); + highp vec4 tmpvar_4; + tmpvar_4 = texture2D (texhigh, varUV.xy); + c_1 = (c_1 + tmpvar_4); + lowp vec4 tmpvar_5; + tmpvar_5 = textureCube (cubelow, varUV.xyz); + c_1 = (c_1 + tmpvar_5); + mediump vec4 tmpvar_6; + tmpvar_6 = textureCube (cubemed, varUV.xyz); + c_1 = (c_1 + tmpvar_6); + highp vec4 tmpvar_7; + tmpvar_7 = textureCube (cubehigh, varUV.xyz); + c_1 = (c_1 + tmpvar_7); gl_FragData[0] = c_1; } -// inputs: 1, stats: 5 alu 6 tex 0 flow +// stats: 5 alu 6 tex 0 flow +// inputs: 1 +// #0: varUV (high float) 4x1 [-1] +// textures: 6 +// #0: texlow (low 2d) 0x0 [-1] +// #1: texmed (medium 2d) 0x0 [-1] +// #2: texhigh (high 2d) 0x0 [-1] +// #3: cubelow (low cube) 0x0 [-1] +// #4: cubemed (medium cube) 0x0 [-1] +// #5: cubehigh (high cube) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3.txt new file mode 100644 index 000000000..b0fdc1856 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3.txt @@ -0,0 +1,44 @@ +#version 300 es +out lowp vec4 _fragData; +uniform sampler2D texlow; +uniform mediump sampler2D texmed; +uniform highp sampler2D texhigh; +uniform lowp samplerCube cubelow; +uniform mediump samplerCube cubemed; +uniform highp samplerCube cubehigh; +in highp vec4 varUV; +void main () +{ + mediump vec4 c_1; + lowp vec4 tmpvar_2; + tmpvar_2 = texture (texlow, varUV.xy); + c_1 = tmpvar_2; + mediump vec4 tmpvar_3; + tmpvar_3 = texture (texmed, varUV.xy); + c_1 = (c_1 + tmpvar_3); + highp vec4 tmpvar_4; + tmpvar_4 = texture (texhigh, varUV.xy); + c_1 = (c_1 + tmpvar_4); + lowp vec4 tmpvar_5; + tmpvar_5 = texture (cubelow, varUV.xyz); + c_1 = (c_1 + tmpvar_5); + mediump vec4 tmpvar_6; + tmpvar_6 = texture (cubemed, varUV.xyz); + c_1 = (c_1 + tmpvar_6); + highp vec4 tmpvar_7; + tmpvar_7 = texture (cubehigh, varUV.xyz); + c_1 = (c_1 + tmpvar_7); + _fragData = c_1; +} + + +// stats: 5 alu 6 tex 0 flow +// inputs: 1 +// #0: varUV (high float) 4x1 [-1] +// textures: 6 +// #0: texlow (low 2d) 0x0 [-1] +// #1: texmed (medium 2d) 0x0 [-1] +// #2: texhigh (high 2d) 0x0 [-1] +// #3: cubelow (low cube) 0x0 [-1] +// #4: cubemed (medium cube) 0x0 [-1] +// #5: cubehigh (high cube) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3Metal.txt new file mode 100644 index 000000000..f59c19a1c --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3Metal.txt @@ -0,0 +1,53 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float4 varUV; +}; +struct xlatMtlShaderOutput { + half4 _fragData [[color(0)]]; +}; +struct xlatMtlShaderUniform { +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , texture2d texlow [[texture(0)]], sampler _mtlsmp_texlow [[sampler(0)]] + , texture2d texmed [[texture(1)]], sampler _mtlsmp_texmed [[sampler(1)]] + , texture2d texhigh [[texture(2)]], sampler _mtlsmp_texhigh [[sampler(2)]] + , texturecube cubelow [[texture(3)]], sampler _mtlsmp_cubelow [[sampler(3)]] + , texturecube cubemed [[texture(4)]], sampler _mtlsmp_cubemed [[sampler(4)]] + , texturecube cubehigh [[texture(5)]], sampler _mtlsmp_cubehigh [[sampler(5)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 c_1; + half4 tmpvar_2; + tmpvar_2 = texlow.sample(_mtlsmp_texlow, (float2)(_mtl_i.varUV.xy)); + c_1 = tmpvar_2; + half4 tmpvar_3; + tmpvar_3 = texmed.sample(_mtlsmp_texmed, (float2)(_mtl_i.varUV.xy)); + c_1 = (c_1 + tmpvar_3); + float4 tmpvar_4; + tmpvar_4 = float4(texhigh.sample(_mtlsmp_texhigh, (float2)(_mtl_i.varUV.xy))); + c_1 = half4(((float4)c_1 + tmpvar_4)); + half4 tmpvar_5; + tmpvar_5 = cubelow.sample(_mtlsmp_cubelow, (float3)(_mtl_i.varUV.xyz)); + c_1 = (c_1 + tmpvar_5); + half4 tmpvar_6; + tmpvar_6 = cubemed.sample(_mtlsmp_cubemed, (float3)(_mtl_i.varUV.xyz)); + c_1 = (c_1 + tmpvar_6); + float4 tmpvar_7; + tmpvar_7 = float4(cubehigh.sample(_mtlsmp_cubehigh, (float3)(_mtl_i.varUV.xyz))); + c_1 = half4(((float4)c_1 + tmpvar_7)); + _mtl_o._fragData = c_1; + return _mtl_o; +} + + +// stats: 5 alu 6 tex 0 flow +// inputs: 1 +// #0: varUV (high float) 4x1 [-1] +// textures: 6 +// #0: texlow (low 2d) 0x0 [-1] loc 0 +// #1: texmed (medium 2d) 0x0 [-1] loc 1 +// #2: texhigh (high 2d) 0x0 [-1] loc 2 +// #3: cubelow (low cube) 0x0 [-1] loc 3 +// #4: cubemed (medium cube) 0x0 [-1] loc 4 +// #5: cubehigh (high cube) 0x0 [-1] loc 5 diff --git a/3rdparty/glsl-optimizer/tests/fragment/small-float-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/small-float-ir.txt deleted file mode 100644 index 6e2baf6a5..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/small-float-ir.txt +++ /dev/null @@ -1,10 +0,0 @@ -uniform float inFloat; -void main () -{ - vec4 tmpvar_1; - tmpvar_1 = vec4((inFloat * 4.36e-06)); - vec4 tmpvar_2; - tmpvar_2 = tmpvar_1; - gl_FragColor = tmpvar_2; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/small-float-out.txt b/3rdparty/glsl-optimizer/tests/fragment/small-float-out.txt index adae965e8..4e9098e81 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/small-float-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/small-float-out.txt @@ -5,4 +5,6 @@ void main () } -// inputs: 0, stats: 1 alu 0 tex 0 flow +// stats: 1 alu 0 tex 0 flow +// uniforms: 1 (total size: 0) +// #0: inFloat (high float) 1x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/struct-array-var-index-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/struct-array-var-index-ir.txt deleted file mode 100644 index b4ac37ee9..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/struct-array-var-index-ir.txt +++ /dev/null @@ -1,26 +0,0 @@ -struct str { - float params[3]; -}; -void main () -{ - int i_1; - str s_2; - int tmpvar_3; - tmpvar_3 = 0; - i_1 = tmpvar_3; - while (true) { - if (!((i_1 < 3))) { - break; - }; - float tmpvar_4; - tmpvar_4 = 1.0; - s_2.params[i_1] = tmpvar_4; - int tmpvar_5; - tmpvar_5 = (i_1 + 1); - i_1 = tmpvar_5; - }; - vec4 tmpvar_6; - tmpvar_6 = vec4(0.0, 0.0, 0.0, 0.0); - gl_FragColor = tmpvar_6; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/struct-array-var-index-out.txt b/3rdparty/glsl-optimizer/tests/fragment/struct-array-var-index-out.txt index 03b6487fc..a5b251cfb 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/struct-array-var-index-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/struct-array-var-index-out.txt @@ -4,4 +4,4 @@ void main () } -// inputs: 0, stats: 1 alu 0 tex 0 flow +// stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-ir.txt deleted file mode 100644 index efb0a2413..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-ir.txt +++ /dev/null @@ -1,134 +0,0 @@ -struct lightSource { - vec4 position; - vec4 diffuse; - vec4 specular; - float invLinearAttenuation; - float spotCutoff; - float spotExponent; - vec3 spotDirection; -}; -struct material { - vec4 ambient; - vec4 diffuse; - vec4 specular; - float shininess; -}; -material tmpvar_1; -vec4 tmpvar_2; -lightSource tmpvar_3; -varying vec4 position; -varying vec3 varyingNormalDirection; -uniform mat4 m; -uniform mat4 v; -uniform mat4 p; -uniform mat4 v_inv; -lightSource light0; -vec4 scene_ambient; -material frontMaterial; -//; -//; -//; -//; -//; -//; -void main () -{ -tmpvar_3 = lightSource(vec4(0.0, 3.0, 0.0, 1.0), vec4(1.0, 1.0, 1.0, 1.0), vec4(1.0, 1.0, 1.0, 1.0), 2.0, 180.0, 0.0, vec3(0.0, 0.0, 0.0)); -light0 = tmpvar_3; -tmpvar_2 = vec4(0.2, 0.2, 0.2, 1.0); -scene_ambient = tmpvar_2; -tmpvar_1 = material(vec4(0.2, 0.2, 0.2, 1.0), vec4(1.0, 0.8, 0.8, 1.0), vec4(1.0, 1.0, 1.0, 1.0), 5.0); -frontMaterial = tmpvar_1; - vec3 specularReflection_4; - vec3 diffuseReflection_5; - float distanceSqr_6; - vec3 positionToLightSource_7; - vec3 totalLighting_8; - float attenuation_9; - vec3 lightDirection_10; - vec3 viewDirection_11; - vec3 normalDirection_12; - vec3 tmpvar_13; - tmpvar_13 = normalize (varyingNormalDirection); - vec3 tmpvar_14; - tmpvar_14 = tmpvar_13; - normalDirection_12 = tmpvar_14; - vec3 tmpvar_15; - tmpvar_15 = ((v_inv * vec4(0.0, 0.0, 0.0, 1.0)) - position).xyz; - vec3 tmpvar_16; - tmpvar_16 = normalize (tmpvar_15); - vec3 tmpvar_17; - tmpvar_17 = tmpvar_16; - viewDirection_11 = tmpvar_17; - vec3 tmpvar_18; - tmpvar_18 = scene_ambient.xyz; - vec3 tmpvar_19; - tmpvar_19 = frontMaterial.ambient.xyz; - vec3 tmpvar_20; - tmpvar_20 = (tmpvar_18 * tmpvar_19); - totalLighting_8 = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = (light0.position - position).xyz; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_21; - positionToLightSource_7 = tmpvar_22; - float tmpvar_23; - tmpvar_23 = dot (positionToLightSource_7, positionToLightSource_7); - float tmpvar_24; - tmpvar_24 = tmpvar_23; - distanceSqr_6 = tmpvar_24; - float tmpvar_25; - tmpvar_25 = inversesqrt (distanceSqr_6); - vec3 tmpvar_26; - tmpvar_26 = (tmpvar_25 * positionToLightSource_7); - lightDirection_10 = tmpvar_26; - float tmpvar_27; - tmpvar_27 = inversesqrt (distanceSqr_6); - float tmpvar_28; - tmpvar_28 = (light0.invLinearAttenuation * tmpvar_27); - attenuation_9 = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = light0.diffuse.xyz; - vec3 tmpvar_30; - tmpvar_30 = frontMaterial.diffuse.xyz; - float tmpvar_31; - tmpvar_31 = dot (normalDirection_12, lightDirection_10); - float tmpvar_32; - tmpvar_32 = max (0.0, tmpvar_31); - vec3 tmpvar_33; - tmpvar_33 = (((attenuation_9 * tmpvar_29) * tmpvar_30) * tmpvar_32); - diffuseReflection_5 = tmpvar_33; - float tmpvar_34; - tmpvar_34 = dot (normalDirection_12, lightDirection_10); - if ((tmpvar_34 < 0.0)) { - vec3 tmpvar_35; - tmpvar_35 = vec3(0.0, 0.0, 0.0); - specularReflection_4 = tmpvar_35; - } else { - vec3 tmpvar_36; - tmpvar_36 = light0.specular.xyz; - vec3 tmpvar_37; - tmpvar_37 = frontMaterial.specular.xyz; - vec3 tmpvar_38; - tmpvar_38 = reflect (-(lightDirection_10), normalDirection_12); - float tmpvar_39; - tmpvar_39 = dot (tmpvar_38, viewDirection_11); - float tmpvar_40; - tmpvar_40 = max (0.0, tmpvar_39); - float tmpvar_41; - tmpvar_41 = pow (tmpvar_40, frontMaterial.shininess); - vec3 tmpvar_42; - tmpvar_42 = (((attenuation_9 * tmpvar_36) * tmpvar_37) * tmpvar_41); - specularReflection_4 = tmpvar_42; - }; - vec3 tmpvar_43; - tmpvar_43 = ((totalLighting_8 + diffuseReflection_5) + specularReflection_4); - totalLighting_8 = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44.w = 1.0; - tmpvar_44.xyz = totalLighting_8.xyz; - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - gl_FragColor = tmpvar_45; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-out.txt b/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-out.txt index 907fec59b..179c30c2e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-out.txt @@ -4,38 +4,46 @@ uniform mat4 v_inv; void main () { vec3 specularReflection_1; - vec3 tmpvar_2; - tmpvar_2 = normalize(varyingNormalDirection); - vec3 tmpvar_3; - tmpvar_3 = normalize(((v_inv * vec4(0.0, 0.0, 0.0, 1.0)) - position).xyz); - vec3 tmpvar_4; - tmpvar_4 = (vec4(0.0, 3.0, 0.0, 1.0) - position).xyz; - float tmpvar_5; - tmpvar_5 = dot (tmpvar_4, tmpvar_4); + vec3 totalLighting_2; + float attenuation_3; + vec3 lightDirection_4; + vec3 tmpvar_5; + tmpvar_5 = normalize(varyingNormalDirection); vec3 tmpvar_6; - tmpvar_6 = (inversesqrt(tmpvar_5) * tmpvar_4); - float tmpvar_7; - tmpvar_7 = (2.0 * inversesqrt(tmpvar_5)); - vec3 tmpvar_8; - tmpvar_8 = ((vec3(tmpvar_7) * vec3(1.0, 0.8, 0.8)) * max (0.0, dot (tmpvar_2, tmpvar_6))); - float tmpvar_9; - tmpvar_9 = dot (tmpvar_2, tmpvar_6); - if ((tmpvar_9 < 0.0)) { + tmpvar_6 = normalize(((v_inv * vec4(0.0, 0.0, 0.0, 1.0)) - position).xyz); + totalLighting_2 = vec3(0.04, 0.04, 0.04); + vec3 tmpvar_7; + tmpvar_7 = (vec4(0.0, 3.0, 0.0, 1.0) - position).xyz; + float tmpvar_8; + tmpvar_8 = dot (tmpvar_7, tmpvar_7); + lightDirection_4 = (inversesqrt(tmpvar_8) * tmpvar_7); + attenuation_3 = (2.0 * inversesqrt(tmpvar_8)); + vec3 tmpvar_9; + tmpvar_9 = ((vec3(attenuation_3) * vec3(1.0, 0.8, 0.8)) * max (0.0, dot (tmpvar_5, lightDirection_4))); + float tmpvar_10; + tmpvar_10 = dot (tmpvar_5, lightDirection_4); + if ((tmpvar_10 < 0.0)) { specularReflection_1 = vec3(0.0, 0.0, 0.0); } else { - vec3 I_10; - I_10 = -(tmpvar_6); - specularReflection_1 = (vec3(tmpvar_7) * pow (max (0.0, - dot ((I_10 - (2.0 * ( - dot (tmpvar_2, I_10) - * tmpvar_2))), tmpvar_3) + vec3 I_11; + I_11 = -(lightDirection_4); + specularReflection_1 = (vec3(attenuation_3) * pow (max (0.0, + dot ((I_11 - (2.0 * ( + dot (tmpvar_5, I_11) + * tmpvar_5))), tmpvar_6) ), 5.0)); }; - vec4 tmpvar_11; - tmpvar_11.w = 1.0; - tmpvar_11.xyz = ((vec3(0.04, 0.04, 0.04) + tmpvar_8) + specularReflection_1); - gl_FragColor = tmpvar_11; + totalLighting_2 = ((vec3(0.04, 0.04, 0.04) + tmpvar_9) + specularReflection_1); + vec4 tmpvar_12; + tmpvar_12.w = 1.0; + tmpvar_12.xyz = totalLighting_2; + gl_FragColor = tmpvar_12; } -// inputs: 2, stats: 29 alu 0 tex 1 flow +// stats: 30 alu 0 tex 1 flow +// inputs: 2 +// #0: position (high float) 4x1 [-1] +// #1: varyingNormalDirection (high float) 3x1 [-1] +// uniforms: 1 (total size: 0) +// #0: v_inv (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/struct-unused-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/struct-unused-ir.txt deleted file mode 100644 index abf3b74bb..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/struct-unused-ir.txt +++ /dev/null @@ -1,11 +0,0 @@ -struct SurfaceOutput { - vec4 color; -}; -void main () -{ - SurfaceOutput o_1; - vec4 tmpvar_2; - tmpvar_2 = vec4(0.0, 0.0, 0.0, 0.0); - gl_FragColor = tmpvar_2; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/struct-unused-out.txt b/3rdparty/glsl-optimizer/tests/fragment/struct-unused-out.txt index 03b6487fc..a5b251cfb 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/struct-unused-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/struct-unused-out.txt @@ -4,4 +4,4 @@ void main () } -// inputs: 0, stats: 1 alu 0 tex 0 flow +// stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/swizzle-writemask-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/swizzle-writemask-ir.txt deleted file mode 100644 index a28f7cf12..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/swizzle-writemask-ir.txt +++ /dev/null @@ -1,16 +0,0 @@ -void main () -{ - vec4 c_1; - float tmpvar_2; - tmpvar_2 = dot (gl_FragCoord.xyz, vec3(1.0, 2.0, 3.0)); - float tmpvar_3; - tmpvar_3 = tmpvar_2; - c_1.x = tmpvar_3; - vec3 tmpvar_4; - tmpvar_4 = vec3(4.0, 5.0, 6.0); - c_1.yzw = tmpvar_4.xxyz.yzw; - vec4 tmpvar_5; - tmpvar_5 = c_1; - gl_FragColor = tmpvar_5; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/swizzle-writemask-out.txt b/3rdparty/glsl-optimizer/tests/fragment/swizzle-writemask-out.txt index e10c9bf50..c1c8eb71c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/swizzle-writemask-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/swizzle-writemask-out.txt @@ -7,4 +7,6 @@ void main () } -// inputs: 1, stats: 2 alu 0 tex 0 flow +// stats: 2 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_FragCoord (high float) 4x1 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/fragment/syntax-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/syntax-irES.txt deleted file mode 100644 index 08279e7bc..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/syntax-irES.txt +++ /dev/null @@ -1,41 +0,0 @@ -mediump vec4 xlat_main () -{ - highp float foo_1; - mediump float tmpvar_2; - tmpvar_2 = 1.0; - foo_1 = tmpvar_2; - highp float tmpvar_3; - tmpvar_3 = (foo_1 + 1.0); - foo_1 = tmpvar_3; - highp float tmpvar_4; - tmpvar_4 = (foo_1 + 100000.0); - foo_1 = tmpvar_4; - highp float tmpvar_5; - tmpvar_5 = (foo_1 + -(0.001)); - foo_1 = tmpvar_5; - highp float tmpvar_6; - tmpvar_6 = (foo_1 + 2.0); - foo_1 = tmpvar_6; - highp float tmpvar_7; - tmpvar_7 = (foo_1 + 3.0); - foo_1 = tmpvar_7; - highp vec4 tmpvar_8; - tmpvar_8 = vec4(foo_1); - return tmpvar_8; -} - -void main () -{ - mediump vec4 xl_retval_9; - mediump vec4 tmpvar_10; - tmpvar_10 = xlat_main (); - mediump vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - xl_retval_9 = tmpvar_11; - mediump vec4 tmpvar_12; - tmpvar_12 = xl_retval_9.xyzw; - mediump vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - gl_FragData[0] = tmpvar_13; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/syntax-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/syntax-outES.txt index 0abc2593e..f7068ac11 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/syntax-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/syntax-outES.txt @@ -4,4 +4,4 @@ void main () } -// inputs: 0, stats: 1 alu 0 tex 0 flow +// stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/ternary-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/ternary-inES3.txt new file mode 100644 index 000000000..3d86f8901 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/ternary-inES3.txt @@ -0,0 +1,18 @@ +#version 300 es +mediump vec4 xlat_main( in highp vec4 uv ) { + mediump vec4 c; + c = vec4( 0.000000); + c += ( (uv.x > 0.500000) ) ? ( 0.900000 ) : ( 0.100000 ); + c += ( (uv.x > 0.500000) ) ? ( vec4( 0.900000, 0.900000, 0.900000, 0.900000) ) : ( vec4( 0.100000, 0.100000, 0.100000, 0.100000) ); + c.xyz += ( (uv.x > 0.500000) ) ? ( vec3( 0.900000, 0.900000, 0.900000) ) : ( vec3( 0.100000, 0.100000, 0.100000) ); + c.xy += ( (uv.x > 0.500000) ) ? ( vec2( 0.900000, 0.900000) ) : ( vec2( 0.100000, 0.100000) ); + c.x += ( bool( fract( uv.x ) ) ) ? ( 0.900000 ) : ( 0.100000 ); + return c; +} +in highp vec4 xlv_TEXCOORD0; +out mediump vec4 _fragData; +void main() { + mediump vec4 xl_retval; + xl_retval = xlat_main( vec4(xlv_TEXCOORD0)); + _fragData = vec4( xl_retval); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/ternary-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/ternary-ir.txt deleted file mode 100644 index 38f058313..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/ternary-ir.txt +++ /dev/null @@ -1,76 +0,0 @@ -varying vec4 xlv_TEXCOORD0; -vec4 xlat_main ( - in vec4 uv_1 -) -{ - vec4 c_2; - vec4 tmpvar_3; - tmpvar_3 = vec4(0.0, 0.0, 0.0, 0.0); - c_2 = tmpvar_3; - float tmpvar_4; - if ((uv_1.x > 0.5)) { - tmpvar_4 = 0.9; - } else { - tmpvar_4 = 0.1; - }; - vec4 tmpvar_5; - tmpvar_5 = (c_2 + tmpvar_4); - c_2 = tmpvar_5; - vec4 tmpvar_6; - if ((uv_1.x > 0.5)) { - tmpvar_6 = vec4(0.9, 0.9, 0.9, 0.9); - } else { - tmpvar_6 = vec4(0.1, 0.1, 0.1, 0.1); - }; - vec4 tmpvar_7; - tmpvar_7 = (c_2 + tmpvar_6); - c_2 = tmpvar_7; - vec3 tmpvar_8; - if ((uv_1.x > 0.5)) { - tmpvar_8 = vec3(0.9, 0.9, 0.9); - } else { - tmpvar_8 = vec3(0.1, 0.1, 0.1); - }; - vec3 tmpvar_9; - tmpvar_9 = (c_2.xyz + tmpvar_8); - c_2.xyz = tmpvar_9.xyz.xyz; - vec2 tmpvar_10; - if ((uv_1.x > 0.5)) { - tmpvar_10 = vec2(0.9, 0.9); - } else { - tmpvar_10 = vec2(0.1, 0.1); - }; - vec2 tmpvar_11; - tmpvar_11 = (c_2.xy + tmpvar_10); - c_2.xy = tmpvar_11.xy.xy; - float tmpvar_12; - tmpvar_12 = fract (uv_1.x); - float tmpvar_13; - if (bool(tmpvar_12)) { - tmpvar_13 = 0.9; - } else { - tmpvar_13 = 0.1; - }; - float tmpvar_14; - tmpvar_14 = (c_2.x + tmpvar_13); - c_2.x = tmpvar_14; - return c_2; -} - -void main () -{ - vec4 xl_retval_15; - vec4 tmpvar_16; - tmpvar_16 = xlv_TEXCOORD0.xyzw; - vec4 tmpvar_17; - tmpvar_17 = xlat_main (tmpvar_16); - vec4 tmpvar_18; - tmpvar_18 = tmpvar_17; - xl_retval_15 = tmpvar_18; - vec4 tmpvar_19; - tmpvar_19 = xl_retval_15.xyzw; - vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - gl_FragData[0] = tmpvar_20; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/ternary-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/ternary-irES.txt deleted file mode 100644 index c7fb3fb25..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/ternary-irES.txt +++ /dev/null @@ -1,76 +0,0 @@ -varying highp vec4 xlv_TEXCOORD0; -mediump vec4 xlat_main ( - in highp vec4 uv_1 -) -{ - mediump vec4 c_2; - mediump vec4 tmpvar_3; - tmpvar_3 = vec4(0.0, 0.0, 0.0, 0.0); - c_2 = tmpvar_3; - mediump float tmpvar_4; - if ((uv_1.x > 0.5)) { - tmpvar_4 = 0.9; - } else { - tmpvar_4 = 0.1; - }; - mediump vec4 tmpvar_5; - tmpvar_5 = (c_2 + tmpvar_4); - c_2 = tmpvar_5; - mediump vec4 tmpvar_6; - if ((uv_1.x > 0.5)) { - tmpvar_6 = vec4(0.9, 0.9, 0.9, 0.9); - } else { - tmpvar_6 = vec4(0.1, 0.1, 0.1, 0.1); - }; - mediump vec4 tmpvar_7; - tmpvar_7 = (c_2 + tmpvar_6); - c_2 = tmpvar_7; - mediump vec3 tmpvar_8; - if ((uv_1.x > 0.5)) { - tmpvar_8 = vec3(0.9, 0.9, 0.9); - } else { - tmpvar_8 = vec3(0.1, 0.1, 0.1); - }; - mediump vec3 tmpvar_9; - tmpvar_9 = (c_2.xyz + tmpvar_8); - c_2.xyz = tmpvar_9.xyz.xyz; - mediump vec2 tmpvar_10; - if ((uv_1.x > 0.5)) { - tmpvar_10 = vec2(0.9, 0.9); - } else { - tmpvar_10 = vec2(0.1, 0.1); - }; - mediump vec2 tmpvar_11; - tmpvar_11 = (c_2.xy + tmpvar_10); - c_2.xy = tmpvar_11.xy.xy; - highp float tmpvar_12; - tmpvar_12 = fract (uv_1.x); - mediump float tmpvar_13; - if (bool(tmpvar_12)) { - tmpvar_13 = 0.9; - } else { - tmpvar_13 = 0.1; - }; - mediump float tmpvar_14; - tmpvar_14 = (c_2.x + tmpvar_13); - c_2.x = tmpvar_14; - return c_2; -} - -void main () -{ - mediump vec4 xl_retval_15; - highp vec4 tmpvar_16; - tmpvar_16 = xlv_TEXCOORD0.xyzw; - mediump vec4 tmpvar_17; - tmpvar_17 = xlat_main (tmpvar_16); - mediump vec4 tmpvar_18; - tmpvar_18 = tmpvar_17; - xl_retval_15 = tmpvar_18; - mediump vec4 tmpvar_19; - tmpvar_19 = xl_retval_15.xyzw; - mediump vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - gl_FragData[0] = tmpvar_20; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/ternary-out.txt b/3rdparty/glsl-optimizer/tests/fragment/ternary-out.txt index a2518d280..a8f23423d 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/ternary-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/ternary-out.txt @@ -16,34 +16,34 @@ void main () } else { tmpvar_3 = vec4(0.1, 0.1, 0.1, 0.1); }; - vec4 tmpvar_4; - tmpvar_4 = (vec4(tmpvar_2) + tmpvar_3); - c_1 = tmpvar_4; - vec3 tmpvar_5; + c_1 = (vec4(tmpvar_2) + tmpvar_3); + vec3 tmpvar_4; if ((xlv_TEXCOORD0.x > 0.5)) { - tmpvar_5 = vec3(0.9, 0.9, 0.9); + tmpvar_4 = vec3(0.9, 0.9, 0.9); } else { - tmpvar_5 = vec3(0.1, 0.1, 0.1); + tmpvar_4 = vec3(0.1, 0.1, 0.1); }; - c_1.xyz = (tmpvar_4.xyz + tmpvar_5); - vec2 tmpvar_6; + c_1.xyz = (c_1.xyz + tmpvar_4); + vec2 tmpvar_5; if ((xlv_TEXCOORD0.x > 0.5)) { - tmpvar_6 = vec2(0.9, 0.9); + tmpvar_5 = vec2(0.9, 0.9); } else { - tmpvar_6 = vec2(0.1, 0.1); + tmpvar_5 = vec2(0.1, 0.1); }; - c_1.xy = (c_1.xy + tmpvar_6); + c_1.xy = (c_1.xy + tmpvar_5); + float tmpvar_6; + tmpvar_6 = fract(xlv_TEXCOORD0.x); float tmpvar_7; - tmpvar_7 = fract(xlv_TEXCOORD0.x); - float tmpvar_8; - if (bool(tmpvar_7)) { - tmpvar_8 = 0.9; + if (bool(tmpvar_6)) { + tmpvar_7 = 0.9; } else { - tmpvar_8 = 0.1; + tmpvar_7 = 0.1; }; - c_1.x = (c_1.x + tmpvar_8); + c_1.x = (c_1.x + tmpvar_7); gl_FragData[0] = c_1; } -// inputs: 1, stats: 21 alu 0 tex 5 flow +// stats: 21 alu 0 tex 5 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/ternary-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/ternary-outES.txt index 6f94a4300..9f8a3f255 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/ternary-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/ternary-outES.txt @@ -3,47 +3,47 @@ void main () { mediump vec4 c_1; c_1 = vec4(0.0, 0.0, 0.0, 0.0); - mediump float tmpvar_2; + highp float tmpvar_2; if ((xlv_TEXCOORD0.x > 0.5)) { tmpvar_2 = 0.9; } else { tmpvar_2 = 0.1; }; c_1 = vec4(tmpvar_2); - mediump vec4 tmpvar_3; + highp vec4 tmpvar_3; if ((xlv_TEXCOORD0.x > 0.5)) { tmpvar_3 = vec4(0.9, 0.9, 0.9, 0.9); } else { tmpvar_3 = vec4(0.1, 0.1, 0.1, 0.1); }; - mediump vec4 tmpvar_4; - tmpvar_4 = (vec4(tmpvar_2) + tmpvar_3); - c_1 = tmpvar_4; - mediump vec3 tmpvar_5; + c_1 = (vec4(tmpvar_2) + tmpvar_3); + highp vec3 tmpvar_4; if ((xlv_TEXCOORD0.x > 0.5)) { - tmpvar_5 = vec3(0.9, 0.9, 0.9); + tmpvar_4 = vec3(0.9, 0.9, 0.9); } else { - tmpvar_5 = vec3(0.1, 0.1, 0.1); + tmpvar_4 = vec3(0.1, 0.1, 0.1); }; - c_1.xyz = (tmpvar_4.xyz + tmpvar_5); - mediump vec2 tmpvar_6; + c_1.xyz = (c_1.xyz + tmpvar_4); + highp vec2 tmpvar_5; if ((xlv_TEXCOORD0.x > 0.5)) { - tmpvar_6 = vec2(0.9, 0.9); + tmpvar_5 = vec2(0.9, 0.9); } else { - tmpvar_6 = vec2(0.1, 0.1); + tmpvar_5 = vec2(0.1, 0.1); }; - c_1.xy = (c_1.xy + tmpvar_6); + c_1.xy = (c_1.xy + tmpvar_5); + highp float tmpvar_6; + tmpvar_6 = fract(xlv_TEXCOORD0.x); highp float tmpvar_7; - tmpvar_7 = fract(xlv_TEXCOORD0.x); - mediump float tmpvar_8; - if (bool(tmpvar_7)) { - tmpvar_8 = 0.9; + if (bool(tmpvar_6)) { + tmpvar_7 = 0.9; } else { - tmpvar_8 = 0.1; + tmpvar_7 = 0.1; }; - c_1.x = (c_1.x + tmpvar_8); + c_1.x = (c_1.x + tmpvar_7); gl_FragData[0] = c_1; } -// inputs: 1, stats: 21 alu 0 tex 5 flow +// stats: 21 alu 0 tex 5 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/ternary-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/ternary-outES3.txt new file mode 100644 index 000000000..9f56d0f13 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/ternary-outES3.txt @@ -0,0 +1,51 @@ +#version 300 es +in highp vec4 xlv_TEXCOORD0; +out mediump vec4 _fragData; +void main () +{ + mediump vec4 c_1; + c_1 = vec4(0.0, 0.0, 0.0, 0.0); + highp float tmpvar_2; + if ((xlv_TEXCOORD0.x > 0.5)) { + tmpvar_2 = 0.9; + } else { + tmpvar_2 = 0.1; + }; + c_1 = vec4(tmpvar_2); + highp vec4 tmpvar_3; + if ((xlv_TEXCOORD0.x > 0.5)) { + tmpvar_3 = vec4(0.9, 0.9, 0.9, 0.9); + } else { + tmpvar_3 = vec4(0.1, 0.1, 0.1, 0.1); + }; + c_1 = (vec4(tmpvar_2) + tmpvar_3); + highp vec3 tmpvar_4; + if ((xlv_TEXCOORD0.x > 0.5)) { + tmpvar_4 = vec3(0.9, 0.9, 0.9); + } else { + tmpvar_4 = vec3(0.1, 0.1, 0.1); + }; + c_1.xyz = (c_1.xyz + tmpvar_4); + highp vec2 tmpvar_5; + if ((xlv_TEXCOORD0.x > 0.5)) { + tmpvar_5 = vec2(0.9, 0.9); + } else { + tmpvar_5 = vec2(0.1, 0.1); + }; + c_1.xy = (c_1.xy + tmpvar_5); + highp float tmpvar_6; + tmpvar_6 = fract(xlv_TEXCOORD0.x); + highp float tmpvar_7; + if (bool(tmpvar_6)) { + tmpvar_7 = 0.9; + } else { + tmpvar_7 = 0.1; + }; + c_1.x = (c_1.x + tmpvar_7); + _fragData = c_1; +} + + +// stats: 21 alu 0 tex 5 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/ternary-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/ternary-outES3Metal.txt new file mode 100644 index 000000000..aff9cd484 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/ternary-outES3Metal.txt @@ -0,0 +1,60 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float4 xlv_TEXCOORD0; +}; +struct xlatMtlShaderOutput { + half4 _fragData [[color(0)]]; +}; +struct xlatMtlShaderUniform { +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 c_1; + c_1 = half4(float4(0.0, 0.0, 0.0, 0.0)); + float tmpvar_2; + if ((_mtl_i.xlv_TEXCOORD0.x > 0.5)) { + tmpvar_2 = 0.9; + } else { + tmpvar_2 = 0.1; + }; + c_1 = half4(float4(tmpvar_2)); + float4 tmpvar_3; + if ((_mtl_i.xlv_TEXCOORD0.x > 0.5)) { + tmpvar_3 = float4(0.9, 0.9, 0.9, 0.9); + } else { + tmpvar_3 = float4(0.1, 0.1, 0.1, 0.1); + }; + c_1 = ((half4)(float4(tmpvar_2) + tmpvar_3)); + float3 tmpvar_4; + if ((_mtl_i.xlv_TEXCOORD0.x > 0.5)) { + tmpvar_4 = float3(0.9, 0.9, 0.9); + } else { + tmpvar_4 = float3(0.1, 0.1, 0.1); + }; + c_1.xyz = (c_1.xyz + (half3)tmpvar_4); + float2 tmpvar_5; + if ((_mtl_i.xlv_TEXCOORD0.x > 0.5)) { + tmpvar_5 = float2(0.9, 0.9); + } else { + tmpvar_5 = float2(0.1, 0.1); + }; + c_1.xy = (c_1.xy + (half2)tmpvar_5); + float tmpvar_6; + tmpvar_6 = fract(_mtl_i.xlv_TEXCOORD0.x); + float tmpvar_7; + if (bool(tmpvar_6)) { + tmpvar_7 = 0.9; + } else { + tmpvar_7 = 0.1; + }; + c_1.x = (c_1.x + (half)tmpvar_7); + _mtl_o._fragData = c_1; + return _mtl_o; +} + + +// stats: 21 alu 0 tex 5 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-inES3.txt new file mode 100644 index 000000000..7dbd7ebb6 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-inES3.txt @@ -0,0 +1,28 @@ +#version 300 es +out lowp vec4 _fragData; +vec2 xll_vecTSel (bvec2 a, vec2 b, vec2 c) { + return vec2 (a.x ? b.x : c.x, a.y ? b.y : c.y); +} +vec3 xll_vecTSel (bvec3 a, vec3 b, vec3 c) { + return vec3 (a.x ? b.x : c.x, a.y ? b.y : c.y, a.z ? b.z : c.z); +} +vec4 xll_vecTSel (bvec4 a, vec4 b, vec4 c) { + return vec4 (a.x ? b.x : c.x, a.y ? b.y : c.y, a.z ? b.z : c.z, a.w ? b.w : c.w); +} +mediump vec4 xlat_main( in highp vec4 uv ); +mediump vec4 xlat_main( in highp vec4 uv ) { + highp vec4 a; + a = vec4( 0.000000); + a += xll_vecTSel (greaterThan( uv, vec4( 0.500000 )), vec4( 1.00000, 2.00000, 3.00000, 4.00000), vec4( 5.00000, 6.00000, 7.00000, 8.00000)); + a += xll_vecTSel (greaterThan( uv, vec4( 0.500000, 0.500000, 0.500000, 0.500000)), vec4( 1.00000, 2.00000, 3.00000, 4.00000), vec4( 5.00000, 6.00000, 7.00000, 8.00000)); + a += xll_vecTSel (greaterThan( uv, vec4( 0.500000 )), vec4( 1.00000, 1.00000, 1.00000, 1.00000), vec4( 2.00000, 2.00000, 2.00000, 2.00000)); + a += xll_vecTSel (greaterThan( uv, vec4( 0.500000 )), vec4( 1), vec4( 2)); + a += xll_vecTSel (bvec4( fract( uv ) ), vec4( 1.00000, 1.00000, 1.00000, 1.00000), vec4( 2.00000, 2.00000, 2.00000, 2.00000)); + return a; +} +in highp vec4 xlv_TEXCOORD0; +void main() { + mediump vec4 xl_retval; + xl_retval = xlat_main( vec4(xlv_TEXCOORD0)); + _fragData = vec4( xl_retval); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-ir.txt deleted file mode 100644 index b0756084d..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-ir.txt +++ /dev/null @@ -1,159 +0,0 @@ -varying vec4 xlv_TEXCOORD0; -vec2 xll_vecTSel ( - in bvec2 a_1, - in vec2 b_2, - in vec2 c_3 -) -{ - float tmpvar_4; - if (a_1.x) { - tmpvar_4 = b_2.x; - } else { - tmpvar_4 = c_3.x; - }; - float tmpvar_5; - if (a_1.y) { - tmpvar_5 = b_2.y; - } else { - tmpvar_5 = c_3.y; - }; - vec2 tmpvar_6; - tmpvar_6.x = tmpvar_4; - tmpvar_6.y = tmpvar_5; - return tmpvar_6; -} - -vec3 xll_vecTSel ( - in bvec3 a_7, - in vec3 b_8, - in vec3 c_9 -) -{ - float tmpvar_10; - if (a_7.x) { - tmpvar_10 = b_8.x; - } else { - tmpvar_10 = c_9.x; - }; - float tmpvar_11; - if (a_7.y) { - tmpvar_11 = b_8.y; - } else { - tmpvar_11 = c_9.y; - }; - float tmpvar_12; - if (a_7.z) { - tmpvar_12 = b_8.z; - } else { - tmpvar_12 = c_9.z; - }; - vec3 tmpvar_13; - tmpvar_13.x = tmpvar_10; - tmpvar_13.y = tmpvar_11; - tmpvar_13.z = tmpvar_12; - return tmpvar_13; -} - -vec4 xll_vecTSel ( - in bvec4 a_14, - in vec4 b_15, - in vec4 c_16 -) -{ - float tmpvar_17; - if (a_14.x) { - tmpvar_17 = b_15.x; - } else { - tmpvar_17 = c_16.x; - }; - float tmpvar_18; - if (a_14.y) { - tmpvar_18 = b_15.y; - } else { - tmpvar_18 = c_16.y; - }; - float tmpvar_19; - if (a_14.z) { - tmpvar_19 = b_15.z; - } else { - tmpvar_19 = c_16.z; - }; - float tmpvar_20; - if (a_14.w) { - tmpvar_20 = b_15.w; - } else { - tmpvar_20 = c_16.w; - }; - vec4 tmpvar_21; - tmpvar_21.x = tmpvar_17; - tmpvar_21.y = tmpvar_18; - tmpvar_21.z = tmpvar_19; - tmpvar_21.w = tmpvar_20; - return tmpvar_21; -} - -vec4 xlat_main ( - in vec4 uv_22 -) -{ - vec4 a_23; - vec4 tmpvar_24; - tmpvar_24 = vec4(0.0, 0.0, 0.0, 0.0); - a_23 = tmpvar_24; - bvec4 tmpvar_25; - tmpvar_25 = greaterThan (uv_22, vec4(0.5, 0.5, 0.5, 0.5)); - vec4 tmpvar_26; - tmpvar_26 = xll_vecTSel (tmpvar_25, vec4(1.0, 2.0, 3.0, 4.0), vec4(5.0, 6.0, 7.0, 8.0)); - vec4 tmpvar_27; - tmpvar_27 = (a_23 + tmpvar_26); - a_23 = tmpvar_27; - bvec4 tmpvar_28; - tmpvar_28 = greaterThan (uv_22, vec4(0.5, 0.5, 0.5, 0.5)); - vec4 tmpvar_29; - tmpvar_29 = xll_vecTSel (tmpvar_28, vec4(1.0, 2.0, 3.0, 4.0), vec4(5.0, 6.0, 7.0, 8.0)); - vec4 tmpvar_30; - tmpvar_30 = (a_23 + tmpvar_29); - a_23 = tmpvar_30; - bvec4 tmpvar_31; - tmpvar_31 = greaterThan (uv_22, vec4(0.5, 0.5, 0.5, 0.5)); - vec4 tmpvar_32; - tmpvar_32 = xll_vecTSel (tmpvar_31, vec4(1.0, 1.0, 1.0, 1.0), vec4(2.0, 2.0, 2.0, 2.0)); - vec4 tmpvar_33; - tmpvar_33 = (a_23 + tmpvar_32); - a_23 = tmpvar_33; - bvec4 tmpvar_34; - tmpvar_34 = greaterThan (uv_22, vec4(0.5, 0.5, 0.5, 0.5)); - vec4 tmpvar_35; - tmpvar_35 = xll_vecTSel (tmpvar_34, vec4(1.0, 1.0, 1.0, 1.0), vec4(2.0, 2.0, 2.0, 2.0)); - vec4 tmpvar_36; - tmpvar_36 = (a_23 + tmpvar_35); - a_23 = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37 = fract (uv_22); - bvec4 tmpvar_38; - tmpvar_38 = bvec4(tmpvar_37).xyzw; - vec4 tmpvar_39; - tmpvar_39 = xll_vecTSel (tmpvar_38, vec4(1.0, 1.0, 1.0, 1.0), vec4(2.0, 2.0, 2.0, 2.0)); - vec4 tmpvar_40; - tmpvar_40 = (a_23 + tmpvar_39); - a_23 = tmpvar_40; - return a_23; -} - -void main () -{ - vec4 xl_retval_41; - vec4 tmpvar_42; - tmpvar_42 = xlv_TEXCOORD0.xyzw; - vec4 tmpvar_43; - tmpvar_43 = xlat_main (tmpvar_42); - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - xl_retval_41 = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = xl_retval_41.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - gl_FragData[0] = tmpvar_46; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-irES.txt deleted file mode 100644 index db41c3b73..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-irES.txt +++ /dev/null @@ -1,159 +0,0 @@ -varying highp vec4 xlv_TEXCOORD0; -mediump vec2 xll_vecTSel ( - in bvec2 a_1, - in mediump vec2 b_2, - in mediump vec2 c_3 -) -{ - mediump float tmpvar_4; - if (a_1.x) { - tmpvar_4 = b_2.x; - } else { - tmpvar_4 = c_3.x; - }; - mediump float tmpvar_5; - if (a_1.y) { - tmpvar_5 = b_2.y; - } else { - tmpvar_5 = c_3.y; - }; - mediump vec2 tmpvar_6; - tmpvar_6.x = tmpvar_4; - tmpvar_6.y = tmpvar_5; - return tmpvar_6; -} - -mediump vec3 xll_vecTSel ( - in bvec3 a_7, - in mediump vec3 b_8, - in mediump vec3 c_9 -) -{ - mediump float tmpvar_10; - if (a_7.x) { - tmpvar_10 = b_8.x; - } else { - tmpvar_10 = c_9.x; - }; - mediump float tmpvar_11; - if (a_7.y) { - tmpvar_11 = b_8.y; - } else { - tmpvar_11 = c_9.y; - }; - mediump float tmpvar_12; - if (a_7.z) { - tmpvar_12 = b_8.z; - } else { - tmpvar_12 = c_9.z; - }; - mediump vec3 tmpvar_13; - tmpvar_13.x = tmpvar_10; - tmpvar_13.y = tmpvar_11; - tmpvar_13.z = tmpvar_12; - return tmpvar_13; -} - -mediump vec4 xll_vecTSel ( - in bvec4 a_14, - in mediump vec4 b_15, - in mediump vec4 c_16 -) -{ - mediump float tmpvar_17; - if (a_14.x) { - tmpvar_17 = b_15.x; - } else { - tmpvar_17 = c_16.x; - }; - mediump float tmpvar_18; - if (a_14.y) { - tmpvar_18 = b_15.y; - } else { - tmpvar_18 = c_16.y; - }; - mediump float tmpvar_19; - if (a_14.z) { - tmpvar_19 = b_15.z; - } else { - tmpvar_19 = c_16.z; - }; - mediump float tmpvar_20; - if (a_14.w) { - tmpvar_20 = b_15.w; - } else { - tmpvar_20 = c_16.w; - }; - mediump vec4 tmpvar_21; - tmpvar_21.x = tmpvar_17; - tmpvar_21.y = tmpvar_18; - tmpvar_21.z = tmpvar_19; - tmpvar_21.w = tmpvar_20; - return tmpvar_21; -} - -mediump vec4 xlat_main ( - in highp vec4 uv_22 -) -{ - highp vec4 a_23; - mediump vec4 tmpvar_24; - tmpvar_24 = vec4(0.0, 0.0, 0.0, 0.0); - a_23 = tmpvar_24; - bvec4 tmpvar_25; - tmpvar_25 = greaterThan (uv_22, vec4(0.5, 0.5, 0.5, 0.5)); - mediump vec4 tmpvar_26; - tmpvar_26 = xll_vecTSel (tmpvar_25, vec4(1.0, 2.0, 3.0, 4.0), vec4(5.0, 6.0, 7.0, 8.0)); - highp vec4 tmpvar_27; - tmpvar_27 = (a_23 + tmpvar_26); - a_23 = tmpvar_27; - bvec4 tmpvar_28; - tmpvar_28 = greaterThan (uv_22, vec4(0.5, 0.5, 0.5, 0.5)); - mediump vec4 tmpvar_29; - tmpvar_29 = xll_vecTSel (tmpvar_28, vec4(1.0, 2.0, 3.0, 4.0), vec4(5.0, 6.0, 7.0, 8.0)); - highp vec4 tmpvar_30; - tmpvar_30 = (a_23 + tmpvar_29); - a_23 = tmpvar_30; - bvec4 tmpvar_31; - tmpvar_31 = greaterThan (uv_22, vec4(0.5, 0.5, 0.5, 0.5)); - mediump vec4 tmpvar_32; - tmpvar_32 = xll_vecTSel (tmpvar_31, vec4(1.0, 1.0, 1.0, 1.0), vec4(2.0, 2.0, 2.0, 2.0)); - highp vec4 tmpvar_33; - tmpvar_33 = (a_23 + tmpvar_32); - a_23 = tmpvar_33; - bvec4 tmpvar_34; - tmpvar_34 = greaterThan (uv_22, vec4(0.5, 0.5, 0.5, 0.5)); - mediump vec4 tmpvar_35; - tmpvar_35 = xll_vecTSel (tmpvar_34, vec4(1.0, 1.0, 1.0, 1.0), vec4(2.0, 2.0, 2.0, 2.0)); - highp vec4 tmpvar_36; - tmpvar_36 = (a_23 + tmpvar_35); - a_23 = tmpvar_36; - highp vec4 tmpvar_37; - tmpvar_37 = fract (uv_22); - bvec4 tmpvar_38; - tmpvar_38 = bvec4(tmpvar_37).xyzw; - mediump vec4 tmpvar_39; - tmpvar_39 = xll_vecTSel (tmpvar_38, vec4(1.0, 1.0, 1.0, 1.0), vec4(2.0, 2.0, 2.0, 2.0)); - highp vec4 tmpvar_40; - tmpvar_40 = (a_23 + tmpvar_39); - a_23 = tmpvar_40; - return a_23; -} - -void main () -{ - mediump vec4 xl_retval_41; - highp vec4 tmpvar_42; - tmpvar_42 = xlv_TEXCOORD0.xyzw; - mediump vec4 tmpvar_43; - tmpvar_43 = xlat_main (tmpvar_42); - mediump vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - xl_retval_41 = tmpvar_44; - mediump vec4 tmpvar_45; - tmpvar_45 = xl_retval_41.xyzw; - mediump vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - gl_FragData[0] = tmpvar_46; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-out.txt b/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-out.txt index a1888e750..584582e88 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-out.txt @@ -1,70 +1,72 @@ varying vec4 xlv_TEXCOORD0; void main () { - bvec4 tmpvar_1; - tmpvar_1 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5)); - float tmpvar_2; - if (tmpvar_1.x) { - tmpvar_2 = 1.0; - } else { - tmpvar_2 = 5.0; - }; + vec4 a_1; + a_1 = vec4(0.0, 0.0, 0.0, 0.0); + bvec4 tmpvar_2; + tmpvar_2 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5)); float tmpvar_3; - if (tmpvar_1.y) { - tmpvar_3 = 2.0; + if (tmpvar_2.x) { + tmpvar_3 = 1.0; } else { - tmpvar_3 = 6.0; + tmpvar_3 = 5.0; }; float tmpvar_4; - if (tmpvar_1.z) { - tmpvar_4 = 3.0; + if (tmpvar_2.y) { + tmpvar_4 = 2.0; } else { - tmpvar_4 = 7.0; + tmpvar_4 = 6.0; }; float tmpvar_5; - if (tmpvar_1.w) { - tmpvar_5 = 4.0; + if (tmpvar_2.z) { + tmpvar_5 = 3.0; } else { - tmpvar_5 = 8.0; + tmpvar_5 = 7.0; }; - vec4 tmpvar_6; - tmpvar_6.x = tmpvar_2; - tmpvar_6.y = tmpvar_3; - tmpvar_6.z = tmpvar_4; - tmpvar_6.w = tmpvar_5; - bvec4 tmpvar_7; - tmpvar_7 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5)); - float tmpvar_8; - if (tmpvar_7.x) { - tmpvar_8 = 1.0; + float tmpvar_6; + if (tmpvar_2.w) { + tmpvar_6 = 4.0; } else { - tmpvar_8 = 5.0; + tmpvar_6 = 8.0; }; + vec4 tmpvar_7; + tmpvar_7.x = tmpvar_3; + tmpvar_7.y = tmpvar_4; + tmpvar_7.z = tmpvar_5; + tmpvar_7.w = tmpvar_6; + a_1 = tmpvar_7; + bvec4 tmpvar_8; + tmpvar_8 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5)); float tmpvar_9; - if (tmpvar_7.y) { - tmpvar_9 = 2.0; + if (tmpvar_8.x) { + tmpvar_9 = 1.0; } else { - tmpvar_9 = 6.0; + tmpvar_9 = 5.0; }; float tmpvar_10; - if (tmpvar_7.z) { - tmpvar_10 = 3.0; + if (tmpvar_8.y) { + tmpvar_10 = 2.0; } else { - tmpvar_10 = 7.0; + tmpvar_10 = 6.0; }; float tmpvar_11; - if (tmpvar_7.w) { - tmpvar_11 = 4.0; + if (tmpvar_8.z) { + tmpvar_11 = 3.0; } else { - tmpvar_11 = 8.0; + tmpvar_11 = 7.0; + }; + float tmpvar_12; + if (tmpvar_8.w) { + tmpvar_12 = 4.0; + } else { + tmpvar_12 = 8.0; }; - vec4 tmpvar_12; - tmpvar_12.x = tmpvar_8; - tmpvar_12.y = tmpvar_9; - tmpvar_12.z = tmpvar_10; - tmpvar_12.w = tmpvar_11; vec4 tmpvar_13; - tmpvar_13 = (tmpvar_6 + tmpvar_12); + tmpvar_13.x = tmpvar_9; + tmpvar_13.y = tmpvar_10; + tmpvar_13.z = tmpvar_11; + tmpvar_13.w = tmpvar_12; + a_1 = (tmpvar_7 + tmpvar_13); bvec4 tmpvar_14; tmpvar_14 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5)); float tmpvar_15; @@ -96,74 +98,75 @@ void main () tmpvar_19.y = tmpvar_16; tmpvar_19.z = tmpvar_17; tmpvar_19.w = tmpvar_18; - vec4 tmpvar_20; - tmpvar_20 = (tmpvar_13 + tmpvar_19); - bvec4 tmpvar_21; - tmpvar_21 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5)); + a_1 = (a_1 + tmpvar_19); + bvec4 tmpvar_20; + tmpvar_20 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5)); + float tmpvar_21; + if (tmpvar_20.x) { + tmpvar_21 = 1.0; + } else { + tmpvar_21 = 2.0; + }; float tmpvar_22; - if (tmpvar_21.x) { + if (tmpvar_20.y) { tmpvar_22 = 1.0; } else { tmpvar_22 = 2.0; }; float tmpvar_23; - if (tmpvar_21.y) { + if (tmpvar_20.z) { tmpvar_23 = 1.0; } else { tmpvar_23 = 2.0; }; float tmpvar_24; - if (tmpvar_21.z) { + if (tmpvar_20.w) { tmpvar_24 = 1.0; } else { tmpvar_24 = 2.0; }; - float tmpvar_25; - if (tmpvar_21.w) { - tmpvar_25 = 1.0; + vec4 tmpvar_25; + tmpvar_25.x = tmpvar_21; + tmpvar_25.y = tmpvar_22; + tmpvar_25.z = tmpvar_23; + tmpvar_25.w = tmpvar_24; + a_1 = (a_1 + tmpvar_25); + bvec4 tmpvar_26; + tmpvar_26 = bvec4(fract(xlv_TEXCOORD0)); + float tmpvar_27; + if (tmpvar_26.x) { + tmpvar_27 = 1.0; } else { - tmpvar_25 = 2.0; + tmpvar_27 = 2.0; + }; + float tmpvar_28; + if (tmpvar_26.y) { + tmpvar_28 = 1.0; + } else { + tmpvar_28 = 2.0; }; - vec4 tmpvar_26; - tmpvar_26.x = tmpvar_22; - tmpvar_26.y = tmpvar_23; - tmpvar_26.z = tmpvar_24; - tmpvar_26.w = tmpvar_25; - vec4 tmpvar_27; - tmpvar_27 = (tmpvar_20 + tmpvar_26); - bvec4 tmpvar_28; - tmpvar_28 = bvec4(fract(xlv_TEXCOORD0)); float tmpvar_29; - if (tmpvar_28.x) { + if (tmpvar_26.z) { tmpvar_29 = 1.0; } else { tmpvar_29 = 2.0; }; float tmpvar_30; - if (tmpvar_28.y) { + if (tmpvar_26.w) { tmpvar_30 = 1.0; } else { tmpvar_30 = 2.0; }; - float tmpvar_31; - if (tmpvar_28.z) { - tmpvar_31 = 1.0; - } else { - tmpvar_31 = 2.0; - }; - float tmpvar_32; - if (tmpvar_28.w) { - tmpvar_32 = 1.0; - } else { - tmpvar_32 = 2.0; - }; - vec4 tmpvar_33; - tmpvar_33.x = tmpvar_29; - tmpvar_33.y = tmpvar_30; - tmpvar_33.z = tmpvar_31; - tmpvar_33.w = tmpvar_32; - gl_FragData[0] = (tmpvar_27 + tmpvar_33); + vec4 tmpvar_31; + tmpvar_31.x = tmpvar_27; + tmpvar_31.y = tmpvar_28; + tmpvar_31.z = tmpvar_29; + tmpvar_31.w = tmpvar_30; + a_1 = (a_1 + tmpvar_31); + gl_FragData[0] = a_1; } -// inputs: 1, stats: 50 alu 0 tex 20 flow +// stats: 51 alu 0 tex 20 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES.txt index 7d3490141..cd31d85ff 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES.txt @@ -2,172 +2,173 @@ varying highp vec4 xlv_TEXCOORD0; void main () { mediump vec4 tmpvar_1; - bvec4 tmpvar_2; - tmpvar_2 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5)); - mediump float tmpvar_3; - if (tmpvar_2.x) { - tmpvar_3 = 1.0; + highp vec4 a_2; + a_2 = vec4(0.0, 0.0, 0.0, 0.0); + bvec4 tmpvar_3; + tmpvar_3 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5)); + highp float tmpvar_4; + if (tmpvar_3.x) { + tmpvar_4 = 1.0; } else { - tmpvar_3 = 5.0; + tmpvar_4 = 5.0; }; - mediump float tmpvar_4; - if (tmpvar_2.y) { - tmpvar_4 = 2.0; + highp float tmpvar_5; + if (tmpvar_3.y) { + tmpvar_5 = 2.0; } else { - tmpvar_4 = 6.0; + tmpvar_5 = 6.0; }; - mediump float tmpvar_5; - if (tmpvar_2.z) { - tmpvar_5 = 3.0; + highp float tmpvar_6; + if (tmpvar_3.z) { + tmpvar_6 = 3.0; } else { - tmpvar_5 = 7.0; + tmpvar_6 = 7.0; }; - mediump float tmpvar_6; - if (tmpvar_2.w) { - tmpvar_6 = 4.0; + highp float tmpvar_7; + if (tmpvar_3.w) { + tmpvar_7 = 4.0; } else { - tmpvar_6 = 8.0; + tmpvar_7 = 8.0; }; - mediump vec4 tmpvar_7; - tmpvar_7.x = tmpvar_3; - tmpvar_7.y = tmpvar_4; - tmpvar_7.z = tmpvar_5; - tmpvar_7.w = tmpvar_6; - bvec4 tmpvar_8; - tmpvar_8 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5)); - mediump float tmpvar_9; - if (tmpvar_8.x) { - tmpvar_9 = 1.0; + highp vec4 tmpvar_8; + tmpvar_8.x = tmpvar_4; + tmpvar_8.y = tmpvar_5; + tmpvar_8.z = tmpvar_6; + tmpvar_8.w = tmpvar_7; + a_2 = tmpvar_8; + bvec4 tmpvar_9; + tmpvar_9 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5)); + highp float tmpvar_10; + if (tmpvar_9.x) { + tmpvar_10 = 1.0; } else { - tmpvar_9 = 5.0; + tmpvar_10 = 5.0; }; - mediump float tmpvar_10; - if (tmpvar_8.y) { - tmpvar_10 = 2.0; + highp float tmpvar_11; + if (tmpvar_9.y) { + tmpvar_11 = 2.0; } else { - tmpvar_10 = 6.0; + tmpvar_11 = 6.0; }; - mediump float tmpvar_11; - if (tmpvar_8.z) { - tmpvar_11 = 3.0; + highp float tmpvar_12; + if (tmpvar_9.z) { + tmpvar_12 = 3.0; } else { - tmpvar_11 = 7.0; + tmpvar_12 = 7.0; }; - mediump float tmpvar_12; - if (tmpvar_8.w) { - tmpvar_12 = 4.0; + highp float tmpvar_13; + if (tmpvar_9.w) { + tmpvar_13 = 4.0; } else { - tmpvar_12 = 8.0; + tmpvar_13 = 8.0; }; - mediump vec4 tmpvar_13; - tmpvar_13.x = tmpvar_9; - tmpvar_13.y = tmpvar_10; - tmpvar_13.z = tmpvar_11; - tmpvar_13.w = tmpvar_12; highp vec4 tmpvar_14; - tmpvar_14 = (tmpvar_7 + tmpvar_13); + tmpvar_14.x = tmpvar_10; + tmpvar_14.y = tmpvar_11; + tmpvar_14.z = tmpvar_12; + tmpvar_14.w = tmpvar_13; + a_2 = (tmpvar_8 + tmpvar_14); bvec4 tmpvar_15; tmpvar_15 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5)); - mediump float tmpvar_16; + highp float tmpvar_16; if (tmpvar_15.x) { tmpvar_16 = 1.0; } else { tmpvar_16 = 2.0; }; - mediump float tmpvar_17; + highp float tmpvar_17; if (tmpvar_15.y) { tmpvar_17 = 1.0; } else { tmpvar_17 = 2.0; }; - mediump float tmpvar_18; + highp float tmpvar_18; if (tmpvar_15.z) { tmpvar_18 = 1.0; } else { tmpvar_18 = 2.0; }; - mediump float tmpvar_19; + highp float tmpvar_19; if (tmpvar_15.w) { tmpvar_19 = 1.0; } else { tmpvar_19 = 2.0; }; - mediump vec4 tmpvar_20; + highp vec4 tmpvar_20; tmpvar_20.x = tmpvar_16; tmpvar_20.y = tmpvar_17; tmpvar_20.z = tmpvar_18; tmpvar_20.w = tmpvar_19; - highp vec4 tmpvar_21; - tmpvar_21 = (tmpvar_14 + tmpvar_20); - bvec4 tmpvar_22; - tmpvar_22 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5)); - mediump float tmpvar_23; - if (tmpvar_22.x) { + a_2 = (a_2 + tmpvar_20); + bvec4 tmpvar_21; + tmpvar_21 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5)); + highp float tmpvar_22; + if (tmpvar_21.x) { + tmpvar_22 = 1.0; + } else { + tmpvar_22 = 2.0; + }; + highp float tmpvar_23; + if (tmpvar_21.y) { tmpvar_23 = 1.0; } else { tmpvar_23 = 2.0; }; - mediump float tmpvar_24; - if (tmpvar_22.y) { + highp float tmpvar_24; + if (tmpvar_21.z) { tmpvar_24 = 1.0; } else { tmpvar_24 = 2.0; }; - mediump float tmpvar_25; - if (tmpvar_22.z) { + highp float tmpvar_25; + if (tmpvar_21.w) { tmpvar_25 = 1.0; } else { tmpvar_25 = 2.0; }; - mediump float tmpvar_26; - if (tmpvar_22.w) { - tmpvar_26 = 1.0; + highp vec4 tmpvar_26; + tmpvar_26.x = tmpvar_22; + tmpvar_26.y = tmpvar_23; + tmpvar_26.z = tmpvar_24; + tmpvar_26.w = tmpvar_25; + a_2 = (a_2 + tmpvar_26); + bvec4 tmpvar_27; + tmpvar_27 = bvec4(fract(xlv_TEXCOORD0)); + highp float tmpvar_28; + if (tmpvar_27.x) { + tmpvar_28 = 1.0; } else { - tmpvar_26 = 2.0; + tmpvar_28 = 2.0; }; - mediump vec4 tmpvar_27; - tmpvar_27.x = tmpvar_23; - tmpvar_27.y = tmpvar_24; - tmpvar_27.z = tmpvar_25; - tmpvar_27.w = tmpvar_26; - highp vec4 tmpvar_28; - tmpvar_28 = (tmpvar_21 + tmpvar_27); - bvec4 tmpvar_29; - tmpvar_29 = bvec4(fract(xlv_TEXCOORD0)); - mediump float tmpvar_30; - if (tmpvar_29.x) { + highp float tmpvar_29; + if (tmpvar_27.y) { + tmpvar_29 = 1.0; + } else { + tmpvar_29 = 2.0; + }; + highp float tmpvar_30; + if (tmpvar_27.z) { tmpvar_30 = 1.0; } else { tmpvar_30 = 2.0; }; - mediump float tmpvar_31; - if (tmpvar_29.y) { + highp float tmpvar_31; + if (tmpvar_27.w) { tmpvar_31 = 1.0; } else { tmpvar_31 = 2.0; }; - mediump float tmpvar_32; - if (tmpvar_29.z) { - tmpvar_32 = 1.0; - } else { - tmpvar_32 = 2.0; - }; - mediump float tmpvar_33; - if (tmpvar_29.w) { - tmpvar_33 = 1.0; - } else { - tmpvar_33 = 2.0; - }; - mediump vec4 tmpvar_34; - tmpvar_34.x = tmpvar_30; - tmpvar_34.y = tmpvar_31; - tmpvar_34.z = tmpvar_32; - tmpvar_34.w = tmpvar_33; - highp vec4 tmpvar_35; - tmpvar_35 = (tmpvar_28 + tmpvar_34); - tmpvar_1 = tmpvar_35; + highp vec4 tmpvar_32; + tmpvar_32.x = tmpvar_28; + tmpvar_32.y = tmpvar_29; + tmpvar_32.z = tmpvar_30; + tmpvar_32.w = tmpvar_31; + a_2 = (a_2 + tmpvar_32); + tmpvar_1 = a_2; gl_FragData[0] = tmpvar_1; } -// inputs: 1, stats: 50 alu 0 tex 20 flow +// stats: 51 alu 0 tex 20 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES3.txt new file mode 100644 index 000000000..c5439b74f --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES3.txt @@ -0,0 +1,176 @@ +#version 300 es +out lowp vec4 _fragData; +in highp vec4 xlv_TEXCOORD0; +void main () +{ + mediump vec4 tmpvar_1; + highp vec4 a_2; + a_2 = vec4(0.0, 0.0, 0.0, 0.0); + bvec4 tmpvar_3; + tmpvar_3 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5)); + highp float tmpvar_4; + if (tmpvar_3.x) { + tmpvar_4 = 1.0; + } else { + tmpvar_4 = 5.0; + }; + highp float tmpvar_5; + if (tmpvar_3.y) { + tmpvar_5 = 2.0; + } else { + tmpvar_5 = 6.0; + }; + highp float tmpvar_6; + if (tmpvar_3.z) { + tmpvar_6 = 3.0; + } else { + tmpvar_6 = 7.0; + }; + highp float tmpvar_7; + if (tmpvar_3.w) { + tmpvar_7 = 4.0; + } else { + tmpvar_7 = 8.0; + }; + highp vec4 tmpvar_8; + tmpvar_8.x = tmpvar_4; + tmpvar_8.y = tmpvar_5; + tmpvar_8.z = tmpvar_6; + tmpvar_8.w = tmpvar_7; + a_2 = tmpvar_8; + bvec4 tmpvar_9; + tmpvar_9 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5)); + highp float tmpvar_10; + if (tmpvar_9.x) { + tmpvar_10 = 1.0; + } else { + tmpvar_10 = 5.0; + }; + highp float tmpvar_11; + if (tmpvar_9.y) { + tmpvar_11 = 2.0; + } else { + tmpvar_11 = 6.0; + }; + highp float tmpvar_12; + if (tmpvar_9.z) { + tmpvar_12 = 3.0; + } else { + tmpvar_12 = 7.0; + }; + highp float tmpvar_13; + if (tmpvar_9.w) { + tmpvar_13 = 4.0; + } else { + tmpvar_13 = 8.0; + }; + highp vec4 tmpvar_14; + tmpvar_14.x = tmpvar_10; + tmpvar_14.y = tmpvar_11; + tmpvar_14.z = tmpvar_12; + tmpvar_14.w = tmpvar_13; + a_2 = (tmpvar_8 + tmpvar_14); + bvec4 tmpvar_15; + tmpvar_15 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5)); + highp float tmpvar_16; + if (tmpvar_15.x) { + tmpvar_16 = 1.0; + } else { + tmpvar_16 = 2.0; + }; + highp float tmpvar_17; + if (tmpvar_15.y) { + tmpvar_17 = 1.0; + } else { + tmpvar_17 = 2.0; + }; + highp float tmpvar_18; + if (tmpvar_15.z) { + tmpvar_18 = 1.0; + } else { + tmpvar_18 = 2.0; + }; + highp float tmpvar_19; + if (tmpvar_15.w) { + tmpvar_19 = 1.0; + } else { + tmpvar_19 = 2.0; + }; + highp vec4 tmpvar_20; + tmpvar_20.x = tmpvar_16; + tmpvar_20.y = tmpvar_17; + tmpvar_20.z = tmpvar_18; + tmpvar_20.w = tmpvar_19; + a_2 = (a_2 + tmpvar_20); + bvec4 tmpvar_21; + tmpvar_21 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5)); + highp float tmpvar_22; + if (tmpvar_21.x) { + tmpvar_22 = 1.0; + } else { + tmpvar_22 = 2.0; + }; + highp float tmpvar_23; + if (tmpvar_21.y) { + tmpvar_23 = 1.0; + } else { + tmpvar_23 = 2.0; + }; + highp float tmpvar_24; + if (tmpvar_21.z) { + tmpvar_24 = 1.0; + } else { + tmpvar_24 = 2.0; + }; + highp float tmpvar_25; + if (tmpvar_21.w) { + tmpvar_25 = 1.0; + } else { + tmpvar_25 = 2.0; + }; + highp vec4 tmpvar_26; + tmpvar_26.x = tmpvar_22; + tmpvar_26.y = tmpvar_23; + tmpvar_26.z = tmpvar_24; + tmpvar_26.w = tmpvar_25; + a_2 = (a_2 + tmpvar_26); + bvec4 tmpvar_27; + tmpvar_27 = bvec4(fract(xlv_TEXCOORD0)); + highp float tmpvar_28; + if (tmpvar_27.x) { + tmpvar_28 = 1.0; + } else { + tmpvar_28 = 2.0; + }; + highp float tmpvar_29; + if (tmpvar_27.y) { + tmpvar_29 = 1.0; + } else { + tmpvar_29 = 2.0; + }; + highp float tmpvar_30; + if (tmpvar_27.z) { + tmpvar_30 = 1.0; + } else { + tmpvar_30 = 2.0; + }; + highp float tmpvar_31; + if (tmpvar_27.w) { + tmpvar_31 = 1.0; + } else { + tmpvar_31 = 2.0; + }; + highp vec4 tmpvar_32; + tmpvar_32.x = tmpvar_28; + tmpvar_32.y = tmpvar_29; + tmpvar_32.z = tmpvar_30; + tmpvar_32.w = tmpvar_31; + a_2 = (a_2 + tmpvar_32); + tmpvar_1 = a_2; + _fragData = tmpvar_1; +} + + +// stats: 51 alu 0 tex 20 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES3Metal.txt new file mode 100644 index 000000000..314f5f7cb --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES3Metal.txt @@ -0,0 +1,185 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float4 xlv_TEXCOORD0; +}; +struct xlatMtlShaderOutput { + half4 _fragData [[color(0)]]; +}; +struct xlatMtlShaderUniform { +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 tmpvar_1; + float4 a_2; + a_2 = float4(0.0, 0.0, 0.0, 0.0); + bool4 tmpvar_3; + tmpvar_3 = bool4((_mtl_i.xlv_TEXCOORD0 > float4(0.5, 0.5, 0.5, 0.5))); + float tmpvar_4; + if (tmpvar_3.x) { + tmpvar_4 = 1.0; + } else { + tmpvar_4 = 5.0; + }; + float tmpvar_5; + if (tmpvar_3.y) { + tmpvar_5 = 2.0; + } else { + tmpvar_5 = 6.0; + }; + float tmpvar_6; + if (tmpvar_3.z) { + tmpvar_6 = 3.0; + } else { + tmpvar_6 = 7.0; + }; + float tmpvar_7; + if (tmpvar_3.w) { + tmpvar_7 = 4.0; + } else { + tmpvar_7 = 8.0; + }; + float4 tmpvar_8; + tmpvar_8.x = tmpvar_4; + tmpvar_8.y = tmpvar_5; + tmpvar_8.z = tmpvar_6; + tmpvar_8.w = tmpvar_7; + a_2 = tmpvar_8; + bool4 tmpvar_9; + tmpvar_9 = bool4((_mtl_i.xlv_TEXCOORD0 > float4(0.5, 0.5, 0.5, 0.5))); + float tmpvar_10; + if (tmpvar_9.x) { + tmpvar_10 = 1.0; + } else { + tmpvar_10 = 5.0; + }; + float tmpvar_11; + if (tmpvar_9.y) { + tmpvar_11 = 2.0; + } else { + tmpvar_11 = 6.0; + }; + float tmpvar_12; + if (tmpvar_9.z) { + tmpvar_12 = 3.0; + } else { + tmpvar_12 = 7.0; + }; + float tmpvar_13; + if (tmpvar_9.w) { + tmpvar_13 = 4.0; + } else { + tmpvar_13 = 8.0; + }; + float4 tmpvar_14; + tmpvar_14.x = tmpvar_10; + tmpvar_14.y = tmpvar_11; + tmpvar_14.z = tmpvar_12; + tmpvar_14.w = tmpvar_13; + a_2 = (tmpvar_8 + tmpvar_14); + bool4 tmpvar_15; + tmpvar_15 = bool4((_mtl_i.xlv_TEXCOORD0 > float4(0.5, 0.5, 0.5, 0.5))); + float tmpvar_16; + if (tmpvar_15.x) { + tmpvar_16 = 1.0; + } else { + tmpvar_16 = 2.0; + }; + float tmpvar_17; + if (tmpvar_15.y) { + tmpvar_17 = 1.0; + } else { + tmpvar_17 = 2.0; + }; + float tmpvar_18; + if (tmpvar_15.z) { + tmpvar_18 = 1.0; + } else { + tmpvar_18 = 2.0; + }; + float tmpvar_19; + if (tmpvar_15.w) { + tmpvar_19 = 1.0; + } else { + tmpvar_19 = 2.0; + }; + float4 tmpvar_20; + tmpvar_20.x = tmpvar_16; + tmpvar_20.y = tmpvar_17; + tmpvar_20.z = tmpvar_18; + tmpvar_20.w = tmpvar_19; + a_2 = (a_2 + tmpvar_20); + bool4 tmpvar_21; + tmpvar_21 = bool4((_mtl_i.xlv_TEXCOORD0 > float4(0.5, 0.5, 0.5, 0.5))); + float tmpvar_22; + if (tmpvar_21.x) { + tmpvar_22 = 1.0; + } else { + tmpvar_22 = 2.0; + }; + float tmpvar_23; + if (tmpvar_21.y) { + tmpvar_23 = 1.0; + } else { + tmpvar_23 = 2.0; + }; + float tmpvar_24; + if (tmpvar_21.z) { + tmpvar_24 = 1.0; + } else { + tmpvar_24 = 2.0; + }; + float tmpvar_25; + if (tmpvar_21.w) { + tmpvar_25 = 1.0; + } else { + tmpvar_25 = 2.0; + }; + float4 tmpvar_26; + tmpvar_26.x = tmpvar_22; + tmpvar_26.y = tmpvar_23; + tmpvar_26.z = tmpvar_24; + tmpvar_26.w = tmpvar_25; + a_2 = (a_2 + tmpvar_26); + bool4 tmpvar_27; + tmpvar_27 = bool4(fract(_mtl_i.xlv_TEXCOORD0)); + float tmpvar_28; + if (tmpvar_27.x) { + tmpvar_28 = 1.0; + } else { + tmpvar_28 = 2.0; + }; + float tmpvar_29; + if (tmpvar_27.y) { + tmpvar_29 = 1.0; + } else { + tmpvar_29 = 2.0; + }; + float tmpvar_30; + if (tmpvar_27.z) { + tmpvar_30 = 1.0; + } else { + tmpvar_30 = 2.0; + }; + float tmpvar_31; + if (tmpvar_27.w) { + tmpvar_31 = 1.0; + } else { + tmpvar_31 = 2.0; + }; + float4 tmpvar_32; + tmpvar_32.x = tmpvar_28; + tmpvar_32.y = tmpvar_29; + tmpvar_32.z = tmpvar_30; + tmpvar_32.w = tmpvar_31; + a_2 = (a_2 + tmpvar_32); + tmpvar_1 = half4(a_2); + _mtl_o._fragData = tmpvar_1; + return _mtl_o; +} + + +// stats: 51 alu 0 tex 20 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-inES3.txt index cc4f73ec0..83f5a0571 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-inES3.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-inES3.txt @@ -2,8 +2,12 @@ precision mediump float; uniform sampler2D tex; uniform samplerCube cub; -in vec3 uv; +in mediump vec3 uv1; +in highp vec3 uv2; out vec4 _fragColor; void main() { - _fragColor = textureGrad(tex,uv.xy,dFdx(uv.xy),dFdy(uv.xy)) + textureGrad(cub,uv,dFdx(uv),dFdy(uv)); + vec4 g1 = textureGrad(tex,uv1.xy,dFdx(uv1.xy),dFdy(uv1.xy)); // mediump UV + vec4 g2 = textureGrad(tex,uv2.xy,dFdx(uv2.xy),dFdy(uv2.xy)); // highp UV + vec4 g3 = textureGrad(tex,uv2.xy,uv1.xy,uv1.xy); // mediump gradient + _fragColor = g1 + g2 + g3; } diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-ir.txt deleted file mode 100644 index 343f20ea1..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-ir.txt +++ /dev/null @@ -1,23 +0,0 @@ -#extension GL_ARB_shader_texture_lod : enable -uniform sampler2D tex; -uniform samplerCube cub; -varying vec3 uv; -void main () -{ - vec2 tmpvar_1; - tmpvar_1 = dFdx (uv.xy); - vec2 tmpvar_2; - tmpvar_2 = dFdy (uv.xy); - vec4 tmpvar_3; - tmpvar_3 = texture2DGradARB (tex, uv.xy, tmpvar_1, tmpvar_2); - vec3 tmpvar_4; - tmpvar_4 = dFdx (uv); - vec3 tmpvar_5; - tmpvar_5 = dFdy (uv); - vec4 tmpvar_6; - tmpvar_6 = textureCubeGradARB (cub, uv, tmpvar_4, tmpvar_5); - vec4 tmpvar_7; - tmpvar_7 = (tmpvar_3 + tmpvar_6); - gl_FragColor = tmpvar_7; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-irES.txt deleted file mode 100644 index e01199415..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-irES.txt +++ /dev/null @@ -1,24 +0,0 @@ -#extension GL_EXT_shader_texture_lod : enable -#extension GL_OES_standard_derivatives : enable -uniform sampler2D tex; -uniform samplerCube cub; -varying mediump vec3 uv; -void main () -{ - mediump vec2 tmpvar_1; - tmpvar_1 = dFdx (uv.xy); - mediump vec2 tmpvar_2; - tmpvar_2 = dFdy (uv.xy); - lowp vec4 tmpvar_3; - tmpvar_3 = texture2DGradEXT (tex, uv.xy, tmpvar_1, tmpvar_2); - mediump vec3 tmpvar_4; - tmpvar_4 = dFdx (uv); - mediump vec3 tmpvar_5; - tmpvar_5 = dFdy (uv); - lowp vec4 tmpvar_6; - tmpvar_6 = textureCubeGradEXT (cub, uv, tmpvar_4, tmpvar_5); - lowp vec4 tmpvar_7; - tmpvar_7 = (tmpvar_3 + tmpvar_6); - gl_FragColor = tmpvar_7; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-irES3.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-irES3.txt deleted file mode 100644 index 6d4d4436c..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-irES3.txt +++ /dev/null @@ -1,25 +0,0 @@ -#version 300 es -precision mediump float; -uniform sampler2D tex; -uniform samplerCube cub; -in vec3 uv; -out lowp vec4 _fragColor; -void main () -{ - vec2 tmpvar_1; - tmpvar_1 = dFdx (uv.xy); - vec2 tmpvar_2; - tmpvar_2 = dFdy (uv.xy); - lowp vec4 tmpvar_3; - tmpvar_3 = textureGrad (tex, uv.xy, tmpvar_1, tmpvar_2); - vec3 tmpvar_4; - tmpvar_4 = dFdx (uv); - vec3 tmpvar_5; - tmpvar_5 = dFdy (uv); - lowp vec4 tmpvar_6; - tmpvar_6 = textureGrad (cub, uv, tmpvar_4, tmpvar_5); - lowp vec4 tmpvar_7; - tmpvar_7 = (tmpvar_3 + tmpvar_6); - _fragColor = tmpvar_7; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-out.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-out.txt index f30b864fa..8ec32567c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-out.txt @@ -8,4 +8,9 @@ void main () } -// inputs: 1, stats: 5 alu 2 tex 0 flow +// stats: 5 alu 2 tex 0 flow +// inputs: 1 +// #0: uv (high float) 3x1 [-1] +// textures: 2 +// #0: tex (high 2d) 0x0 [-1] +// #1: cub (high cube) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES.txt index 70b9179a9..a3110f802 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES.txt @@ -1,14 +1,21 @@ #extension GL_EXT_shader_texture_lod : enable #extension GL_OES_standard_derivatives : enable uniform sampler2D tex; -uniform samplerCube cub; -varying mediump vec3 uv; +uniform lowp samplerCube cub; +varying highp vec3 uv; void main () { lowp vec4 tmpvar_1; - tmpvar_1 = (texture2DGradEXT (tex, uv.xy, dFdx(uv.xy), dFdy(uv.xy)) + textureCubeGradEXT (cub, uv, dFdx(uv), dFdy(uv))); - gl_FragColor = tmpvar_1; + tmpvar_1 = texture2DGradEXT (tex, uv.xy, dFdx(uv.xy), dFdy(uv.xy)); + lowp vec4 tmpvar_2; + tmpvar_2 = textureCubeGradEXT (cub, uv, dFdx(uv), dFdy(uv)); + gl_FragColor = (tmpvar_1 + tmpvar_2); } -// inputs: 1, stats: 5 alu 2 tex 0 flow +// stats: 5 alu 2 tex 0 flow +// inputs: 1 +// #0: uv (high float) 3x1 [-1] +// textures: 2 +// #0: tex (low 2d) 0x0 [-1] +// #1: cub (low cube) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES3.txt index 343fd29e3..5ddc3454e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES3.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES3.txt @@ -1,13 +1,26 @@ #version 300 es precision mediump float; uniform sampler2D tex; -uniform samplerCube cub; -in vec3 uv; +in mediump vec3 uv1; +in highp vec3 uv2; out lowp vec4 _fragColor; void main () { - _fragColor = (textureGrad (tex, uv.xy, dFdx(uv.xy), dFdy(uv.xy)) + textureGrad (cub, uv, dFdx(uv), dFdy(uv))); + mediump vec2 tmpvar_1; + tmpvar_1 = dFdx(uv1.xy); + mediump vec2 tmpvar_2; + tmpvar_2 = dFdy(uv1.xy); + highp vec2 tmpvar_3; + tmpvar_3 = dFdx(uv2.xy); + highp vec2 tmpvar_4; + tmpvar_4 = dFdy(uv2.xy); + _fragColor = ((textureGrad (tex, uv1.xy, tmpvar_1, tmpvar_2) + textureGrad (tex, uv2.xy, tmpvar_3, tmpvar_4)) + textureGrad (tex, uv2.xy, uv1.xy, uv1.xy)); } -// inputs: 1, stats: 5 alu 2 tex 0 flow +// stats: 6 alu 3 tex 0 flow +// inputs: 2 +// #0: uv1 (medium float) 3x1 [-1] +// #1: uv2 (high float) 3x1 [-1] +// textures: 1 +// #0: tex (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES3Metal.txt new file mode 100644 index 000000000..3c81d626a --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES3Metal.txt @@ -0,0 +1,35 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + half3 uv1; + float3 uv2; +}; +struct xlatMtlShaderOutput { + half4 _fragColor [[color(0)]]; +}; +struct xlatMtlShaderUniform { +}; +; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , texture2d tex [[texture(0)]], sampler _mtlsmp_tex [[sampler(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + half2 tmpvar_1; + tmpvar_1 = dfdx(_mtl_i.uv1.xy); + half2 tmpvar_2; + tmpvar_2 = dfdy(_mtl_i.uv1.xy); + float2 tmpvar_3; + tmpvar_3 = dfdx(_mtl_i.uv2.xy); + float2 tmpvar_4; + tmpvar_4 = dfdy(_mtl_i.uv2.xy); + _mtl_o._fragColor = ((tex.sample(_mtlsmp_tex, (float2)(_mtl_i.uv1.xy), gradient2d((float2)(tmpvar_1), (float2)(tmpvar_2))) + tex.sample(_mtlsmp_tex, (float2)(_mtl_i.uv2.xy), gradient2d((float2)(tmpvar_3), (float2)(tmpvar_4)))) + tex.sample(_mtlsmp_tex, (float2)(_mtl_i.uv2.xy), gradient2d((float2)(_mtl_i.uv1.xy), (float2)(_mtl_i.uv1.xy)))); + return _mtl_o; +} + + +// stats: 6 alu 3 tex 0 flow +// inputs: 2 +// #0: uv1 (medium float) 3x1 [-1] +// #1: uv2 (high float) 3x1 [-1] +// textures: 1 +// #0: tex (low 2d) 0x0 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-inES3.txt index 380d35888..a1ca7f264 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-inES3.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-inES3.txt @@ -2,17 +2,18 @@ precision mediump float; vec4 xll_tex2Dlod(sampler2D s, vec4 coord) { - return textureLod( s, coord.xy, coord.w); + return textureLod (s, coord.xy, coord.w); } uniform sampler2D tex; -mediump vec4 xlat_main( in highp vec4 uv ); -mediump vec4 xlat_main( in highp vec4 uv ) { +mediump vec4 xlat_main (in highp vec4 uv) { return xll_tex2Dlod( tex, vec4( uv.xy , 0.0, 0.0)); } -in highp vec4 xlv_TEXCOORD0; +in highp vec4 uvHi; +in mediump vec4 uvMed; out vec4 _fragColor; void main() { - mediump vec4 xl_retval; - xl_retval = xlat_main(xlv_TEXCOORD0); - _fragColor = xl_retval; + mediump vec4 r; + r = xlat_main(uvHi); + r += textureLod (tex, uvMed.xy, uvMed.z); // mediump arguments + _fragColor = r; } diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-ir.txt deleted file mode 100644 index 4275f6b11..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-ir.txt +++ /dev/null @@ -1,42 +0,0 @@ -#extension GL_ARB_shader_texture_lod : enable -uniform sampler2D tex; -varying vec4 xlv_TEXCOORD0; -vec4 xll_tex2Dlod ( - in sampler2D s_1, - in vec4 coord_2 -) -{ - vec4 tmpvar_3; - tmpvar_3 = texture2DLod (s_1, coord_2.xy, coord_2.w); - return tmpvar_3; -} - -vec4 xlat_main ( - in vec4 uv_4 -) -{ - vec4 tmpvar_5; - tmpvar_5.zw = vec2(0.0, 0.0); - tmpvar_5.xy = uv_4.xy.xy; - vec4 tmpvar_6; - tmpvar_6 = xll_tex2Dlod (tex, tmpvar_5); - return tmpvar_6; -} - -void main () -{ - vec4 xl_retval_7; - vec4 tmpvar_8; - tmpvar_8 = xlv_TEXCOORD0.xyzw; - vec4 tmpvar_9; - tmpvar_9 = xlat_main (tmpvar_8); - vec4 tmpvar_10; - tmpvar_10 = tmpvar_9; - xl_retval_7 = tmpvar_10; - vec4 tmpvar_11; - tmpvar_11 = xl_retval_7.xyzw; - vec4 tmpvar_12; - tmpvar_12 = tmpvar_11; - gl_FragData[0] = tmpvar_12; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-irES.txt deleted file mode 100644 index 7de3bab61..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-irES.txt +++ /dev/null @@ -1,42 +0,0 @@ -#extension GL_EXT_shader_texture_lod : enable -uniform sampler2D tex; -varying highp vec4 xlv_TEXCOORD0; -mediump vec4 xll_tex2Dlod ( - in sampler2D s_1, - in mediump vec4 coord_2 -) -{ - lowp vec4 tmpvar_3; - tmpvar_3 = texture2DLodEXT (s_1, coord_2.xy, coord_2.w); - return tmpvar_3; -} - -mediump vec4 xlat_main ( - in highp vec4 uv_4 -) -{ - highp vec4 tmpvar_5; - tmpvar_5.zw = vec2(0.0, 0.0); - tmpvar_5.xy = uv_4.xy.xy; - mediump vec4 tmpvar_6; - tmpvar_6 = xll_tex2Dlod (tex, tmpvar_5); - return tmpvar_6; -} - -void main () -{ - mediump vec4 xl_retval_7; - highp vec4 tmpvar_8; - tmpvar_8 = xlv_TEXCOORD0.xyzw; - mediump vec4 tmpvar_9; - tmpvar_9 = xlat_main (tmpvar_8); - mediump vec4 tmpvar_10; - tmpvar_10 = tmpvar_9; - xl_retval_7 = tmpvar_10; - mediump vec4 tmpvar_11; - tmpvar_11 = xl_retval_7.xyzw; - mediump vec4 tmpvar_12; - tmpvar_12 = tmpvar_11; - gl_FragData[0] = tmpvar_12; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-irES3.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-irES3.txt deleted file mode 100644 index 33caa817b..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-irES3.txt +++ /dev/null @@ -1,40 +0,0 @@ -#version 300 es -precision mediump float; -uniform sampler2D tex; -in highp vec4 xlv_TEXCOORD0; -out mediump vec4 _fragColor; -vec4 xll_tex2Dlod ( - in sampler2D s_1, - in vec4 coord_2 -) -{ - lowp vec4 tmpvar_3; - tmpvar_3 = textureLod (s_1, coord_2.xy, coord_2.w); - return tmpvar_3; -} - -mediump vec4 xlat_main ( - in highp vec4 uv_4 -) -{ - highp vec4 tmpvar_5; - tmpvar_5.zw = vec2(0.0, 0.0); - tmpvar_5.xy = uv_4.xy.xy; - vec4 tmpvar_6; - tmpvar_6 = xll_tex2Dlod (tex, tmpvar_5); - return tmpvar_6; -} - -void main () -{ - mediump vec4 xl_retval_7; - mediump vec4 tmpvar_8; - tmpvar_8 = xlat_main (xlv_TEXCOORD0); - mediump vec4 tmpvar_9; - tmpvar_9 = tmpvar_8; - xl_retval_7 = tmpvar_9; - mediump vec4 tmpvar_10; - tmpvar_10 = xl_retval_7; - _fragColor = tmpvar_10; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-out.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-out.txt index b29139859..5f049c2fa 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-out.txt @@ -7,4 +7,8 @@ void main () } -// inputs: 1, stats: 0 alu 1 tex 0 flow +// stats: 0 alu 1 tex 0 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] +// textures: 1 +// #0: tex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES.txt index 84661d2f8..7620496f4 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES.txt @@ -11,4 +11,8 @@ void main () } -// inputs: 1, stats: 0 alu 1 tex 0 flow +// stats: 0 alu 1 tex 0 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] +// textures: 1 +// #0: tex (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES3.txt index 4ce72de7f..826630bba 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES3.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES3.txt @@ -1,16 +1,24 @@ #version 300 es precision mediump float; uniform sampler2D tex; -in highp vec4 xlv_TEXCOORD0; +in highp vec4 uvHi; +in mediump vec4 uvMed; out mediump vec4 _fragColor; void main () { mediump vec4 tmpvar_1; lowp vec4 tmpvar_2; - tmpvar_2 = textureLod (tex, xlv_TEXCOORD0.xy, 0.0); + tmpvar_2 = textureLod (tex, uvHi.xy, 0.0); tmpvar_1 = tmpvar_2; - _fragColor = tmpvar_1; + lowp vec4 tmpvar_3; + tmpvar_3 = textureLod (tex, uvMed.xy, uvMed.z); + _fragColor = (tmpvar_1 + tmpvar_3); } -// inputs: 1, stats: 0 alu 1 tex 0 flow +// stats: 1 alu 2 tex 0 flow +// inputs: 2 +// #0: uvHi (high float) 4x1 [-1] +// #1: uvMed (medium float) 4x1 [-1] +// textures: 1 +// #0: tex (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES3Metal.txt new file mode 100644 index 000000000..bbe172398 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES3Metal.txt @@ -0,0 +1,33 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float4 uvHi; + half4 uvMed; +}; +struct xlatMtlShaderOutput { + half4 _fragColor [[color(0)]]; +}; +struct xlatMtlShaderUniform { +}; +; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , texture2d tex [[texture(0)]], sampler _mtlsmp_tex [[sampler(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 tmpvar_1; + half4 tmpvar_2; + tmpvar_2 = tex.sample(_mtlsmp_tex, (float2)(_mtl_i.uvHi.xy), level(0.0)); + tmpvar_1 = tmpvar_2; + half4 tmpvar_3; + tmpvar_3 = tex.sample(_mtlsmp_tex, (float2)(_mtl_i.uvMed.xy), level(_mtl_i.uvMed.z)); + _mtl_o._fragColor = (tmpvar_1 + tmpvar_3); + return _mtl_o; +} + + +// stats: 1 alu 2 tex 0 flow +// inputs: 2 +// #0: uvHi (high float) 4x1 [-1] +// #1: uvMed (medium float) 4x1 [-1] +// textures: 1 +// #0: tex (low 2d) 0x0 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-inES3.txt index 0fdd8e624..922e3b398 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-inES3.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-inES3.txt @@ -4,9 +4,7 @@ precision mediump float; float xll_shadow2D(sampler2DShadow s, vec3 coord) { return texture (s, coord); } float xll_shadow2Dproj(sampler2DShadow s, vec4 coord) { return textureProj (s, coord); } uniform sampler2DShadow shadowmap; -lowp vec4 xlat_main( in highp vec4 uv ); -#line 4 -lowp vec4 xlat_main( in highp vec4 uv ) { +lowp vec4 xlat_main (in highp vec4 uv) { lowp float s1; lowp float s2; s1 = xll_shadow2D( shadowmap, uv.xyz); @@ -14,10 +12,12 @@ lowp vec4 xlat_main( in highp vec4 uv ) { #line 8 return vec4( (s1 + s2)); } -in highp vec4 xlv_TEXCOORD0; +in highp vec4 uvHi; +in mediump vec4 uvMed; out vec4 _fragColor; void main() { - lowp vec4 xl_retval; - xl_retval = xlat_main( vec4(xlv_TEXCOORD0)); - _fragColor = vec4( xl_retval); + lowp vec4 r; + r = xlat_main(uvHi); + r.x += texture (shadowmap, uvMed.xyz); + _fragColor = r; } diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-ir.txt deleted file mode 100644 index b44712614..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-ir.txt +++ /dev/null @@ -1,60 +0,0 @@ -uniform sampler2DShadow shadowmap; -varying vec4 xlv_TEXCOORD0; -float xll_shadow2D ( - in sampler2DShadow s_1, - in vec3 coord_2 -) -{ - vec4 tmpvar_3; - tmpvar_3 = shadow2D (s_1, coord_2); - return tmpvar_3.x; -} - -float xll_shadow2Dproj ( - in sampler2DShadow s_4, - in vec4 coord_5 -) -{ - vec4 tmpvar_6; - tmpvar_6 = shadow2DProj (s_4, coord_5); - return tmpvar_6.x; -} - -vec4 xlat_main ( - in vec4 uv_7 -) -{ - float s2_8; - float s1_9; - float tmpvar_10; - tmpvar_10 = xll_shadow2D (shadowmap, uv_7.xyz); - float tmpvar_11; - tmpvar_11 = tmpvar_10; - s1_9 = tmpvar_11; - float tmpvar_12; - tmpvar_12 = xll_shadow2Dproj (shadowmap, uv_7); - float tmpvar_13; - tmpvar_13 = tmpvar_12; - s2_8 = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = vec4((s1_9 + s2_8)); - return tmpvar_14; -} - -void main () -{ - vec4 xl_retval_15; - vec4 tmpvar_16; - tmpvar_16 = xlv_TEXCOORD0.xyzw; - vec4 tmpvar_17; - tmpvar_17 = xlat_main (tmpvar_16); - vec4 tmpvar_18; - tmpvar_18 = tmpvar_17; - xl_retval_15 = tmpvar_18; - vec4 tmpvar_19; - tmpvar_19 = xl_retval_15.xyzw; - vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - gl_FragData[0] = tmpvar_20; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-irES.txt deleted file mode 100644 index ef5740978..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-irES.txt +++ /dev/null @@ -1,61 +0,0 @@ -#extension GL_EXT_shadow_samplers : enable -uniform lowp sampler2DShadow shadowmap; -varying highp vec4 xlv_TEXCOORD0; -mediump float xll_shadow2D ( - in lowp sampler2DShadow s_1, - in mediump vec3 coord_2 -) -{ - lowp float tmpvar_3; - tmpvar_3 = shadow2DEXT (s_1, coord_2); - return tmpvar_3; -} - -mediump float xll_shadow2Dproj ( - in lowp sampler2DShadow s_4, - in mediump vec4 coord_5 -) -{ - lowp float tmpvar_6; - tmpvar_6 = shadow2DProjEXT (s_4, coord_5); - return tmpvar_6; -} - -lowp vec4 xlat_main ( - in highp vec4 uv_7 -) -{ - lowp float s2_8; - lowp float s1_9; - mediump float tmpvar_10; - tmpvar_10 = xll_shadow2D (shadowmap, uv_7.xyz); - mediump float tmpvar_11; - tmpvar_11 = tmpvar_10; - s1_9 = tmpvar_11; - mediump float tmpvar_12; - tmpvar_12 = xll_shadow2Dproj (shadowmap, uv_7); - mediump float tmpvar_13; - tmpvar_13 = tmpvar_12; - s2_8 = tmpvar_13; - lowp vec4 tmpvar_14; - tmpvar_14 = vec4((s1_9 + s2_8)); - return tmpvar_14; -} - -void main () -{ - lowp vec4 xl_retval_15; - highp vec4 tmpvar_16; - tmpvar_16 = xlv_TEXCOORD0.xyzw; - lowp vec4 tmpvar_17; - tmpvar_17 = xlat_main (tmpvar_16); - lowp vec4 tmpvar_18; - tmpvar_18 = tmpvar_17; - xl_retval_15 = tmpvar_18; - lowp vec4 tmpvar_19; - tmpvar_19 = xl_retval_15.xyzw; - lowp vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - gl_FragData[0] = tmpvar_20; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-irES3.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-irES3.txt deleted file mode 100644 index ff01fc0af..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-irES3.txt +++ /dev/null @@ -1,63 +0,0 @@ -#version 300 es -precision mediump float; -uniform lowp sampler2DShadow shadowmap; -in highp vec4 xlv_TEXCOORD0; -out lowp vec4 _fragColor; -float xll_shadow2D ( - in lowp sampler2DShadow s_1, - in vec3 coord_2 -) -{ - lowp float tmpvar_3; - tmpvar_3 = texture (s_1, coord_2); - return tmpvar_3; -} - -float xll_shadow2Dproj ( - in lowp sampler2DShadow s_4, - in vec4 coord_5 -) -{ - lowp float tmpvar_6; - tmpvar_6 = textureProj (s_4, coord_5); - return tmpvar_6; -} - -lowp vec4 xlat_main ( - in highp vec4 uv_7 -) -{ - lowp float s2_8; - lowp float s1_9; - float tmpvar_10; - tmpvar_10 = xll_shadow2D (shadowmap, uv_7.xyz); - float tmpvar_11; - tmpvar_11 = tmpvar_10; - s1_9 = tmpvar_11; - float tmpvar_12; - tmpvar_12 = xll_shadow2Dproj (shadowmap, uv_7); - float tmpvar_13; - tmpvar_13 = tmpvar_12; - s2_8 = tmpvar_13; - lowp vec4 tmpvar_14; - tmpvar_14 = vec4((s1_9 + s2_8)); - return tmpvar_14; -} - -void main () -{ - lowp vec4 xl_retval_15; - highp vec4 tmpvar_16; - tmpvar_16 = xlv_TEXCOORD0.xyzw; - lowp vec4 tmpvar_17; - tmpvar_17 = xlat_main (tmpvar_16); - lowp vec4 tmpvar_18; - tmpvar_18 = tmpvar_17; - xl_retval_15 = tmpvar_18; - lowp vec4 tmpvar_19; - tmpvar_19 = xl_retval_15.xyzw; - lowp vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - _fragColor = tmpvar_20; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-out.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-out.txt index 1e990a240..a99982e46 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-out.txt @@ -6,4 +6,8 @@ void main () } -// inputs: 1, stats: 1 alu 2 tex 0 flow +// stats: 1 alu 2 tex 0 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] +// textures: 1 +// #0: shadowmap (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES.txt index d72186464..d64af25bf 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES.txt @@ -9,4 +9,8 @@ void main () } -// inputs: 1, stats: 1 alu 2 tex 0 flow +// stats: 1 alu 2 tex 0 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] +// textures: 1 +// #0: shadowmap (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3.txt index cf21d50a2..6523b890f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3.txt @@ -1,12 +1,23 @@ #version 300 es precision mediump float; uniform lowp sampler2DShadow shadowmap; -in highp vec4 xlv_TEXCOORD0; +in highp vec4 uvHi; +in mediump vec4 uvMed; out lowp vec4 _fragColor; void main () { - _fragColor = vec4((texture (shadowmap, xlv_TEXCOORD0.xyz) + textureProj (shadowmap, xlv_TEXCOORD0))); + lowp vec4 r_1; + lowp vec4 tmpvar_2; + tmpvar_2 = vec4((texture (shadowmap, uvHi.xyz) + textureProj (shadowmap, uvHi))); + r_1.yzw = tmpvar_2.yzw; + r_1.x = (tmpvar_2.x + texture (shadowmap, uvMed.xyz)); + _fragColor = r_1; } -// inputs: 1, stats: 1 alu 2 tex 0 flow +// stats: 2 alu 3 tex 0 flow +// inputs: 2 +// #0: uvHi (high float) 4x1 [-1] +// #1: uvMed (medium float) 4x1 [-1] +// textures: 1 +// #0: shadowmap (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3Metal.txt new file mode 100644 index 000000000..6c7de8b15 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3Metal.txt @@ -0,0 +1,33 @@ +#include +using namespace metal; +constexpr sampler _mtl_xl_shadow_sampler(address::clamp_to_edge, filter::linear, compare_func::less); +struct xlatMtlShaderInput { + float4 uvHi; + half4 uvMed; +}; +struct xlatMtlShaderOutput { + half4 _fragColor [[color(0)]]; +}; +struct xlatMtlShaderUniform { +}; +; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , depth2d shadowmap [[texture(0)]], sampler _mtlsmp_shadowmap [[sampler(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 r_1; + half4 tmpvar_2; + tmpvar_2 = half4((shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.uvHi.xyz).xy, (float)(_mtl_i.uvHi.xyz).z) + shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.uvHi).xy / (float)(_mtl_i.uvHi).w, (float)(_mtl_i.uvHi).z / (float)(_mtl_i.uvHi).w))); + r_1.yzw = tmpvar_2.yzw; + r_1.x = (tmpvar_2.x + shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.uvMed.xyz).xy, (float)(_mtl_i.uvMed.xyz).z)); + _mtl_o._fragColor = r_1; + return _mtl_o; +} + + +// stats: 2 alu 3 tex 0 flow +// inputs: 2 +// #0: uvHi (high float) 4x1 [-1] +// #1: uvMed (medium float) 4x1 [-1] +// textures: 1 +// #0: shadowmap (low 2d) 0x0 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex3D-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/tex3D-ir.txt deleted file mode 100644 index f09f3e7c5..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/tex3D-ir.txt +++ /dev/null @@ -1,11 +0,0 @@ -uniform sampler3D tex; -varying vec3 uv; -void main () -{ - vec4 tmpvar_1; - tmpvar_1 = texture3D (tex, uv); - vec4 tmpvar_2; - tmpvar_2 = tmpvar_1; - gl_FragColor = tmpvar_2; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex3D-irES3.txt b/3rdparty/glsl-optimizer/tests/fragment/tex3D-irES3.txt deleted file mode 100644 index 1ae5558ca..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/tex3D-irES3.txt +++ /dev/null @@ -1,14 +0,0 @@ -#version 300 es -precision mediump float; -uniform sampler3D tex; -in vec3 uv; -out lowp vec4 _fragColor; -void main () -{ - lowp vec4 tmpvar_1; - tmpvar_1 = texture (tex, uv); - lowp vec4 tmpvar_2; - tmpvar_2 = tmpvar_1; - _fragColor = tmpvar_2; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex3D-out.txt b/3rdparty/glsl-optimizer/tests/fragment/tex3D-out.txt index 3e807e995..8d5381964 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/tex3D-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/tex3D-out.txt @@ -6,4 +6,8 @@ void main () } -// inputs: 1, stats: 0 alu 1 tex 0 flow +// stats: 0 alu 1 tex 0 flow +// inputs: 1 +// #0: uv (high float) 3x1 [-1] +// textures: 1 +// #0: tex (high 3d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex3D-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/tex3D-outES3.txt index 757de747e..8985475e1 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/tex3D-outES3.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/tex3D-outES3.txt @@ -1,6 +1,6 @@ #version 300 es precision mediump float; -uniform sampler3D tex; +uniform lowp sampler3D tex; in vec3 uv; out lowp vec4 _fragColor; void main () @@ -9,4 +9,8 @@ void main () } -// inputs: 1, stats: 0 alu 1 tex 0 flow +// stats: 0 alu 1 tex 0 flow +// inputs: 1 +// #0: uv (high float) 3x1 [-1] +// textures: 1 +// #0: tex (low 3d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex3D-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/tex3D-outES3Metal.txt new file mode 100644 index 000000000..599994732 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex3D-outES3Metal.txt @@ -0,0 +1,25 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float3 uv; +}; +struct xlatMtlShaderOutput { + half4 _fragColor [[color(0)]]; +}; +struct xlatMtlShaderUniform { +}; +; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , texture3d tex [[texture(0)]], sampler _mtlsmp_tex [[sampler(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + _mtl_o._fragColor = tex.sample(_mtlsmp_tex, (float3)(_mtl_i.uv)); + return _mtl_o; +} + + +// stats: 0 alu 1 tex 0 flow +// inputs: 1 +// #0: uv (high float) 3x1 [-1] +// textures: 1 +// #0: tex (low 3d) 0x0 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-irES3.txt b/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-irES3.txt deleted file mode 100644 index 139158aec..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-irES3.txt +++ /dev/null @@ -1,20 +0,0 @@ -#version 300 es -precision mediump float; -uniform lowp samplerCubeShadow shadowmap; -in mediump vec4 uv; -out mediump vec4 _fragColor; -void main () -{ - lowp float s_1; - lowp float tmpvar_2; - tmpvar_2 = texture (shadowmap, uv); - lowp float tmpvar_3; - tmpvar_3 = tmpvar_2; - s_1 = tmpvar_3; - lowp vec4 tmpvar_4; - tmpvar_4 = vec4(s_1); - lowp vec4 tmpvar_5; - tmpvar_5 = tmpvar_4; - _fragColor = tmpvar_5; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-outES3.txt index 387783a49..2af5a2962 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-outES3.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-outES3.txt @@ -11,4 +11,8 @@ void main () } -// inputs: 1, stats: 0 alu 1 tex 0 flow +// stats: 0 alu 1 tex 0 flow +// inputs: 1 +// #0: uv (medium float) 4x1 [-1] +// textures: 1 +// #0: shadowmap (low cube) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-outES3Metal.txt new file mode 100644 index 000000000..68ec16019 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-outES3Metal.txt @@ -0,0 +1,28 @@ +#include +using namespace metal; +constexpr sampler _mtl_xl_shadow_sampler(address::clamp_to_edge, filter::linear, compare_func::less); +struct xlatMtlShaderInput { + half4 uv; +}; +struct xlatMtlShaderOutput { + half4 _fragColor [[color(0)]]; +}; +struct xlatMtlShaderUniform { +}; +; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , depthcube shadowmap [[texture(0)]], sampler _mtlsmp_shadowmap [[sampler(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 tmpvar_1; + tmpvar_1 = half4(shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float3)(_mtl_i.uv).xyz, (_mtl_i.uv).w)); + _mtl_o._fragColor = tmpvar_1; + return _mtl_o; +} + + +// stats: 0 alu 1 tex 0 flow +// inputs: 1 +// #0: uv (medium float) 4x1 [-1] +// textures: 1 +// #0: shadowmap (low cube) 0x0 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/fragment/texOffset-irES3.txt b/3rdparty/glsl-optimizer/tests/fragment/texOffset-irES3.txt deleted file mode 100644 index dc4246769..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/texOffset-irES3.txt +++ /dev/null @@ -1,53 +0,0 @@ -#version 300 es -in mediump vec3 uv; -out lowp vec4 outColor; -uniform sampler2D tex; -uniform sampler3D vol; -void main () -{ - lowp vec4 c_1; - lowp vec4 tmpvar_2; - tmpvar_2 = textureOffset (tex, uv.xy, ivec2(-2, -3)); - lowp vec4 tmpvar_3; - tmpvar_3 = tmpvar_2; - c_1 = tmpvar_3; - lowp vec4 tmpvar_4; - tmpvar_4 = textureOffset (tex, uv.xy, ivec2(4, 5), 0.5); - lowp vec4 tmpvar_5; - tmpvar_5 = (c_1 + tmpvar_4); - c_1 = tmpvar_5; - lowp vec4 tmpvar_6; - tmpvar_6 = textureOffset (vol, uv.xyz, ivec3(-2, -3, -4)); - lowp vec4 tmpvar_7; - tmpvar_7 = (c_1 + tmpvar_6); - c_1 = tmpvar_7; - lowp vec4 tmpvar_8; - tmpvar_8 = textureOffset (vol, uv.xyz, ivec3(4, 5, 6), -0.5); - lowp vec4 tmpvar_9; - tmpvar_9 = (c_1 + tmpvar_8); - c_1 = tmpvar_9; - lowp vec4 tmpvar_10; - tmpvar_10 = texelFetch (tex, ivec2(1, 2), 1); - lowp vec4 tmpvar_11; - tmpvar_11 = (c_1 + tmpvar_10); - c_1 = tmpvar_11; - lowp vec4 tmpvar_12; - tmpvar_12 = texelFetch (vol, ivec3(1, 2, 3), 2); - lowp vec4 tmpvar_13; - tmpvar_13 = (c_1 + tmpvar_12); - c_1 = tmpvar_13; - lowp vec4 tmpvar_14; - tmpvar_14 = texelFetchOffset (tex, ivec2(1, 2), 3, ivec2(-2, -3)); - lowp vec4 tmpvar_15; - tmpvar_15 = (c_1 + tmpvar_14); - c_1 = tmpvar_15; - lowp vec4 tmpvar_16; - tmpvar_16 = texelFetchOffset (vol, ivec3(1, 2, 3), 0, ivec3(-2, -3, -4)); - lowp vec4 tmpvar_17; - tmpvar_17 = (c_1 + tmpvar_16); - c_1 = tmpvar_17; - lowp vec4 tmpvar_18; - tmpvar_18 = c_1; - outColor = tmpvar_18; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3.txt index 32bc22db5..f10538fd2 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3.txt @@ -2,13 +2,24 @@ in mediump vec3 uv; out lowp vec4 outColor; uniform sampler2D tex; -uniform sampler3D vol; +uniform lowp sampler3D vol; void main () { - outColor = ((( - ((((textureOffset (tex, uv.xy, ivec2(-2, -3)) + textureOffset (tex, uv.xy, 0.5, ivec2(4, 5))) + textureOffset (vol, uv, ivec3(-2, -3, -4))) + textureOffset (vol, uv, -0.5, ivec3(4, 5, 6))) + texelFetch (tex, ivec2(1, 2), 1)) - + texelFetch (vol, ivec3(1, 2, 3), 2)) + texelFetchOffset (tex, ivec2(1, 2), 3, ivec2(-2, -3))) + texelFetchOffset (vol, ivec3(1, 2, 3), 0, ivec3(-2, -3, -4))); + lowp vec4 c_1; + c_1 = (textureOffset (tex, uv.xy, ivec2(-2, -3)) + textureOffset (tex, uv.xy, 0.5, ivec2(4, 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 + 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))); + c_1 = (c_1 + texelFetchOffset (vol, ivec3(1, 2, 3), 0, ivec3(-2, -3, -4))); + outColor = c_1; } -// inputs: 1, stats: 7 alu 8 tex 0 flow +// stats: 7 alu 8 tex 0 flow +// inputs: 1 +// #0: uv (medium float) 3x1 [-1] +// textures: 2 +// #0: tex (low 2d) 0x0 [-1] +// #1: vol (low 3d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3Metal.txt new file mode 100644 index 000000000..2a1b68ce5 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3Metal.txt @@ -0,0 +1,34 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + half3 uv; +}; +struct xlatMtlShaderOutput { + half4 outColor [[color(0)]]; +}; +struct xlatMtlShaderUniform { +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , texture2d tex [[texture(0)]], sampler _mtlsmp_tex [[sampler(0)]] + , texture3d vol [[texture(1)]], sampler _mtlsmp_vol [[sampler(1)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 c_1; + c_1 = (tex.sample(_mtlsmp_tex, (float2)(_mtl_i.uv.xy)) + tex.sample(_mtlsmp_tex, (float2)(_mtl_i.uv.xy), bias(0.5))); + c_1 = (c_1 + vol.sample(_mtlsmp_vol, (float3)(_mtl_i.uv))); + c_1 = (c_1 + vol.sample(_mtlsmp_vol, (float3)(_mtl_i.uv), bias(-0.5))); + c_1 = (c_1 + tex.sample(_mtlsmp_tex, (float2)(int2(1, 2)))); + c_1 = (c_1 + vol.sample(_mtlsmp_vol, (float3)(int3(1, 2, 3)))); + c_1 = (c_1 + tex.sample(_mtlsmp_tex, (float2)(int2(1, 2)))); + c_1 = (c_1 + vol.sample(_mtlsmp_vol, (float3)(int3(1, 2, 3)))); + _mtl_o.outColor = c_1; + return _mtl_o; +} + + +// stats: 7 alu 8 tex 0 flow +// inputs: 1 +// #0: uv (medium float) 3x1 [-1] +// textures: 2 +// #0: tex (low 2d) 0x0 [-1] loc 0 +// #1: vol (low 3d) 0x0 [-1] loc 1 diff --git a/3rdparty/glsl-optimizer/tests/fragment/texProj-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/texProj-inES3.txt new file mode 100644 index 000000000..0bd68597b --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/texProj-inES3.txt @@ -0,0 +1,20 @@ +#version 300 es +out mediump vec4 _fragData; + +uniform sampler2D tex; +uniform sampler2DShadow shadowmap; + +in highp vec4 uv; + +void main() { + lowp vec4 c; + c = textureProj(tex, uv); + c += textureProj(tex, uv.xyz); + c += textureProjLod(tex, uv, 1.0); + c += textureProjLod(tex, uv.xyz, 1.0); + + c += vec4(texture(shadowmap, uv.xyz)); + c += vec4(textureProj(shadowmap, uv)); + + _fragData = c; +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/texProj-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/texProj-irES.txt deleted file mode 100644 index ebb9c3a2d..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/texProj-irES.txt +++ /dev/null @@ -1,47 +0,0 @@ -#extension GL_EXT_shader_texture_lod : enable -#extension GL_EXT_shadow_samplers : enable -uniform sampler2D tex; -uniform lowp sampler2DShadow shadowmap; -varying highp vec4 uv; -void main () -{ - lowp vec4 c_1; - lowp vec4 tmpvar_2; - tmpvar_2 = texture2DProj (tex, uv); - lowp vec4 tmpvar_3; - tmpvar_3 = tmpvar_2; - c_1 = tmpvar_3; - lowp vec4 tmpvar_4; - tmpvar_4 = texture2DProj (tex, uv.xyz); - lowp vec4 tmpvar_5; - tmpvar_5 = (c_1 + tmpvar_4); - c_1 = tmpvar_5; - lowp vec4 tmpvar_6; - tmpvar_6 = texture2DProjLodEXT (tex, uv, 1.0); - lowp vec4 tmpvar_7; - tmpvar_7 = (c_1 + tmpvar_6); - c_1 = tmpvar_7; - lowp vec4 tmpvar_8; - tmpvar_8 = texture2DProjLodEXT (tex, uv.xyz, 1.0); - lowp vec4 tmpvar_9; - tmpvar_9 = (c_1 + tmpvar_8); - c_1 = tmpvar_9; - lowp float tmpvar_10; - tmpvar_10 = shadow2DEXT (shadowmap, uv.xyz); - lowp vec4 tmpvar_11; - tmpvar_11 = vec4(tmpvar_10); - lowp vec4 tmpvar_12; - tmpvar_12 = (c_1 + tmpvar_11); - c_1 = tmpvar_12; - lowp float tmpvar_13; - tmpvar_13 = shadow2DProjEXT (shadowmap, uv); - lowp vec4 tmpvar_14; - tmpvar_14 = vec4(tmpvar_13); - lowp vec4 tmpvar_15; - tmpvar_15 = (c_1 + tmpvar_14); - c_1 = tmpvar_15; - lowp vec4 tmpvar_16; - tmpvar_16 = c_1; - gl_FragColor = tmpvar_16; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/texProj-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/texProj-outES.txt index e29334be7..34d7157e1 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/texProj-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/texProj-outES.txt @@ -5,12 +5,19 @@ uniform lowp sampler2DShadow shadowmap; varying highp vec4 uv; void main () { - lowp vec4 tmpvar_1; - tmpvar_1 = ((( - ((texture2DProj (tex, uv) + texture2DProj (tex, uv.xyz)) + texture2DProjLodEXT (tex, uv, 1.0)) - + texture2DProjLodEXT (tex, uv.xyz, 1.0)) + vec4(shadow2DEXT (shadowmap, uv.xyz))) + vec4(shadow2DProjEXT (shadowmap, uv))); - gl_FragColor = tmpvar_1; + 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 + vec4(shadow2DEXT (shadowmap, uv.xyz))); + c_1 = (c_1 + vec4(shadow2DProjEXT (shadowmap, uv))); + gl_FragColor = c_1; } -// inputs: 1, stats: 5 alu 6 tex 0 flow +// stats: 5 alu 6 tex 0 flow +// inputs: 1 +// #0: uv (high float) 4x1 [-1] +// textures: 2 +// #0: tex (low 2d) 0x0 [-1] +// #1: shadowmap (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3.txt new file mode 100644 index 000000000..5f4cfe4cd --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3.txt @@ -0,0 +1,23 @@ +#version 300 es +out mediump vec4 _fragData; +uniform sampler2D tex; +uniform lowp sampler2DShadow shadowmap; +in highp vec4 uv; +void main () +{ + lowp vec4 c_1; + c_1 = (textureProj (tex, uv) + textureProj (tex, uv.xyz)); + c_1 = (c_1 + textureProjLod (tex, uv, 1.0)); + c_1 = (c_1 + textureProjLod (tex, uv.xyz, 1.0)); + c_1 = (c_1 + vec4(texture (shadowmap, uv.xyz))); + c_1 = (c_1 + vec4(textureProj (shadowmap, uv))); + _fragData = c_1; +} + + +// stats: 5 alu 6 tex 0 flow +// inputs: 1 +// #0: uv (high float) 4x1 [-1] +// textures: 2 +// #0: tex (low 2d) 0x0 [-1] +// #1: shadowmap (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3Metal.txt new file mode 100644 index 000000000..287e243e6 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3Metal.txt @@ -0,0 +1,33 @@ +#include +using namespace metal; +constexpr sampler _mtl_xl_shadow_sampler(address::clamp_to_edge, filter::linear, compare_func::less); +struct xlatMtlShaderInput { + float4 uv; +}; +struct xlatMtlShaderOutput { + half4 _fragData [[color(0)]]; +}; +struct xlatMtlShaderUniform { +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , texture2d tex [[texture(0)]], sampler _mtlsmp_tex [[sampler(0)]] + , depth2d shadowmap [[texture(1)]], sampler _mtlsmp_shadowmap [[sampler(1)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 c_1; + c_1 = (tex.sample(_mtlsmp_tex, ((float2)(_mtl_i.uv).xy / (float)(_mtl_i.uv).w)) + tex.sample(_mtlsmp_tex, ((float2)(_mtl_i.uv.xyz).xy / (float)(_mtl_i.uv.xyz).z))); + c_1 = (c_1 + tex.sample(_mtlsmp_tex, ((float2)(_mtl_i.uv).xy / (float)(_mtl_i.uv).w), level(1.0))); + c_1 = (c_1 + tex.sample(_mtlsmp_tex, ((float2)(_mtl_i.uv.xyz).xy / (float)(_mtl_i.uv.xyz).z), level(1.0))); + c_1 = (c_1 + half4(shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.uv.xyz).xy, (float)(_mtl_i.uv.xyz).z))); + c_1 = (c_1 + half4(shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.uv).xy / (float)(_mtl_i.uv).w, (float)(_mtl_i.uv).z / (float)(_mtl_i.uv).w))); + _mtl_o._fragData = c_1; + return _mtl_o; +} + + +// stats: 5 alu 6 tex 0 flow +// inputs: 1 +// #0: uv (high float) 4x1 [-1] +// textures: 2 +// #0: tex (low 2d) 0x0 [-1] loc 0 +// #1: shadowmap (low 2d) 0x0 [-1] loc 1 diff --git a/3rdparty/glsl-optimizer/tests/fragment/types-writemask-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/types-writemask-ir.txt deleted file mode 100644 index f882fb86b..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/types-writemask-ir.txt +++ /dev/null @@ -1,14 +0,0 @@ -void main () -{ - vec4 c_1; - float tmpvar_2; - tmpvar_2 = gl_FragCoord.y; - c_1.x = tmpvar_2; - vec3 tmpvar_3; - tmpvar_3 = vec3(4.0, 5.0, 6.0); - c_1.yzw = tmpvar_3.xxyz.yzw; - vec4 tmpvar_4; - tmpvar_4 = c_1; - gl_FragColor = tmpvar_4; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/types-writemask-out.txt b/3rdparty/glsl-optimizer/tests/fragment/types-writemask-out.txt index 11d170a3d..1e5d0e6c8 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/types-writemask-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/types-writemask-out.txt @@ -7,4 +7,6 @@ void main () } -// inputs: 1, stats: 1 alu 0 tex 0 flow +// stats: 1 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_FragCoord (high float) 4x1 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/fragment/varyings-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/varyings-ir.txt deleted file mode 100644 index dcf684f00..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/varyings-ir.txt +++ /dev/null @@ -1,33 +0,0 @@ -varying vec4 xlv_TEXCOORD0; -varying vec4 xlv_TEXCOORD1; -vec4 xlat_main ( - in vec4 uv_1, - in vec4 foobar_xlv_foo_2 -) -{ - vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = vec4(0.0, 0.0, 0.0, 0.0); - c_3 = tmpvar_4; - return c_3; -} - -void main () -{ - vec4 xl_retval_5; - vec4 tmpvar_6; - tmpvar_6 = xlv_TEXCOORD0.xyzw; - vec4 tmpvar_7; - tmpvar_7 = xlv_TEXCOORD1.xyzw; - vec4 tmpvar_8; - tmpvar_8 = xlat_main (tmpvar_6, tmpvar_7); - vec4 tmpvar_9; - tmpvar_9 = tmpvar_8; - xl_retval_5 = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10 = xl_retval_5.xyzw; - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - gl_FragData[0] = tmpvar_11; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/varyings-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/varyings-irES.txt deleted file mode 100644 index d7beafb22..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/varyings-irES.txt +++ /dev/null @@ -1,33 +0,0 @@ -varying highp vec4 xlv_TEXCOORD0; -varying highp vec4 xlv_TEXCOORD1; -mediump vec4 xlat_main ( - in highp vec4 uv_1, - in highp vec4 foobar_xlv_foo_2 -) -{ - mediump vec4 c_3; - mediump vec4 tmpvar_4; - tmpvar_4 = vec4(0.0, 0.0, 0.0, 0.0); - c_3 = tmpvar_4; - return c_3; -} - -void main () -{ - mediump vec4 xl_retval_5; - highp vec4 tmpvar_6; - tmpvar_6 = xlv_TEXCOORD0.xyzw; - highp vec4 tmpvar_7; - tmpvar_7 = xlv_TEXCOORD1.xyzw; - mediump vec4 tmpvar_8; - tmpvar_8 = xlat_main (tmpvar_6, tmpvar_7); - mediump vec4 tmpvar_9; - tmpvar_9 = tmpvar_8; - xl_retval_5 = tmpvar_9; - mediump vec4 tmpvar_10; - tmpvar_10 = xl_retval_5.xyzw; - mediump vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - gl_FragData[0] = tmpvar_11; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/varyings-out.txt b/3rdparty/glsl-optimizer/tests/fragment/varyings-out.txt index 0c6e5c40f..b8c9f3c05 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/varyings-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/varyings-out.txt @@ -4,4 +4,4 @@ void main () } -// inputs: 0, stats: 1 alu 0 tex 0 flow +// stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/varyings-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/varyings-outES.txt index 0c6e5c40f..b8c9f3c05 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/varyings-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/varyings-outES.txt @@ -4,4 +4,4 @@ void main () } -// inputs: 0, stats: 1 alu 0 tex 0 flow +// stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/vface-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/vface-ir.txt deleted file mode 100644 index e246b3fbd..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/vface-ir.txt +++ /dev/null @@ -1,25 +0,0 @@ -varying float xlv_VFACE; -vec4 xlat_main ( - in float face_1 -) -{ - vec4 tmpvar_2; - tmpvar_2 = vec4(face_1); - return tmpvar_2; -} - -void main () -{ - vec4 xl_retval_3; - vec4 tmpvar_4; - tmpvar_4 = xlat_main (xlv_VFACE); - vec4 tmpvar_5; - tmpvar_5 = tmpvar_4; - xl_retval_3 = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6 = xl_retval_3.xyzw; - vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - gl_FragData[0] = tmpvar_7; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/vface-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/vface-irES.txt deleted file mode 100644 index 460811842..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/vface-irES.txt +++ /dev/null @@ -1,25 +0,0 @@ -varying highp float xlv_VFACE; -mediump vec4 xlat_main ( - in highp float face_1 -) -{ - highp vec4 tmpvar_2; - tmpvar_2 = vec4(face_1); - return tmpvar_2; -} - -void main () -{ - mediump vec4 xl_retval_3; - mediump vec4 tmpvar_4; - tmpvar_4 = xlat_main (xlv_VFACE); - mediump vec4 tmpvar_5; - tmpvar_5 = tmpvar_4; - xl_retval_3 = tmpvar_5; - mediump vec4 tmpvar_6; - tmpvar_6 = xl_retval_3.xyzw; - mediump vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - gl_FragData[0] = tmpvar_7; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/vface-out.txt b/3rdparty/glsl-optimizer/tests/fragment/vface-out.txt index 22f52bf7f..855a6bb1a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/vface-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/vface-out.txt @@ -5,4 +5,6 @@ void main () } -// inputs: 1, stats: 0 alu 0 tex 0 flow +// stats: 0 alu 0 tex 0 flow +// inputs: 1 +// #0: xlv_VFACE (high float) 1x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/vface-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/vface-outES.txt index 3314343e6..92e338b84 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/vface-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/vface-outES.txt @@ -9,4 +9,6 @@ void main () } -// inputs: 1, stats: 0 alu 0 tex 0 flow +// stats: 0 alu 0 tex 0 flow +// inputs: 1 +// #0: xlv_VFACE (high float) 1x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/vpos-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/vpos-ir.txt deleted file mode 100644 index 50db7b12c..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/vpos-ir.txt +++ /dev/null @@ -1,28 +0,0 @@ -varying vec2 xlv_VPOS; -vec4 xlat_main ( - in vec2 pos_1 -) -{ - vec4 tmpvar_2; - tmpvar_2.zw = vec2(0.0, 0.0); - tmpvar_2.xy = pos_1.xy; - return tmpvar_2; -} - -void main () -{ - vec4 xl_retval_3; - vec2 tmpvar_4; - tmpvar_4 = xlv_VPOS.xy; - vec4 tmpvar_5; - tmpvar_5 = xlat_main (tmpvar_4); - vec4 tmpvar_6; - tmpvar_6 = tmpvar_5; - xl_retval_3 = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7 = xl_retval_3.xyzw; - vec4 tmpvar_8; - tmpvar_8 = tmpvar_7; - gl_FragData[0] = tmpvar_8; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/vpos-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/vpos-irES.txt deleted file mode 100644 index ccaa15269..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/vpos-irES.txt +++ /dev/null @@ -1,28 +0,0 @@ -varying highp vec2 xlv_VPOS; -mediump vec4 xlat_main ( - in highp vec2 pos_1 -) -{ - highp vec4 tmpvar_2; - tmpvar_2.zw = vec2(0.0, 0.0); - tmpvar_2.xy = pos_1.xy; - return tmpvar_2; -} - -void main () -{ - mediump vec4 xl_retval_3; - highp vec2 tmpvar_4; - tmpvar_4 = xlv_VPOS.xy; - mediump vec4 tmpvar_5; - tmpvar_5 = xlat_main (tmpvar_4); - mediump vec4 tmpvar_6; - tmpvar_6 = tmpvar_5; - xl_retval_3 = tmpvar_6; - mediump vec4 tmpvar_7; - tmpvar_7 = xl_retval_3.xyzw; - mediump vec4 tmpvar_8; - tmpvar_8 = tmpvar_7; - gl_FragData[0] = tmpvar_8; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/vpos-out.txt b/3rdparty/glsl-optimizer/tests/fragment/vpos-out.txt index e75eb9c04..0a7bd118f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/vpos-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/vpos-out.txt @@ -8,4 +8,6 @@ void main () } -// inputs: 1, stats: 1 alu 0 tex 0 flow +// stats: 1 alu 0 tex 0 flow +// inputs: 1 +// #0: xlv_VPOS (high float) 2x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/vpos-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/vpos-outES.txt index ba7d29bd6..521238a7e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/vpos-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/vpos-outES.txt @@ -10,4 +10,6 @@ void main () } -// inputs: 1, stats: 1 alu 0 tex 0 flow +// stats: 1 alu 0 tex 0 flow +// inputs: 1 +// #0: xlv_VPOS (high float) 2x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-inES3.txt new file mode 100644 index 000000000..aa545ab1c --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-inES3.txt @@ -0,0 +1,98 @@ +#version 300 es + +// From rcupisz light shafts package, "Coords" shader. +// Is using vector equality, which was translating wrong to Metal +// at some point. + +#define gl_FragColor _glesFragData[0] +#define gl_FragData _glesFragData +layout(location = 0) out mediump vec4 _glesFragData[4]; +float xll_saturate_f( float x) { + return clamp( x, 0.0, 1.0); +} +vec4 xll_matrixindex_mf4x4_i (mat4 m, int i) { vec4 v; v.x=m[0][i]; v.y=m[1][i]; v.z=m[2][i]; v.w=m[3][i]; return v; } +struct posuv { + highp vec4 pos; + highp vec2 uv; +}; +uniform highp vec4 _ZBufferParams; +uniform highp vec4 _LightPos; +uniform highp float _InterpolationStep; +uniform highp mat4 _FrustumRays; +uniform highp vec4 _CameraPosLocal; +uniform highp float _FrustumApex; +uniform highp vec4 _CoordTexDim; +uniform highp vec4 _ScreenTexDim; +uniform sampler2D _CameraDepthTexture; + +highp vec2 GetEpipolarLineEntryPoint( in highp vec2 exit ) { + return _LightPos.xy; +} + +bool Cube( in highp vec3 org, in highp vec3 dir, out highp float tnear, out highp float tfar ) { + highp vec3 invR = (1.0 / dir); + highp vec3 tbot = (invR * (-0.5 - org)); + highp vec3 ttop = (invR * (0.5 - org)); + highp vec3 tmin = min( ttop, tbot); + highp vec3 tmax = max( ttop, tbot); + highp vec2 t0 = max( tmin.xx, tmin.yz); + tnear = max( t0.x, t0.y); + t0 = min( tmax.xx, tmax.yz); + tfar = min( t0.x, t0.y); + return ((tnear < tfar) && (tfar > 0.0)); +} +highp vec3 FrustumRay( in highp vec2 uv, out highp float rayLength ) { + highp vec3 ray0 = mix( xll_matrixindex_mf4x4_i (_FrustumRays, 0).xyz, xll_matrixindex_mf4x4_i (_FrustumRays, 1).xyz, vec3( uv.x)); + highp vec3 ray1 = mix( xll_matrixindex_mf4x4_i (_FrustumRays, 3).xyz, xll_matrixindex_mf4x4_i (_FrustumRays, 2).xyz, vec3( uv.x)); + highp vec3 ray = mix( ray0, ray1, vec3( uv.y)); + rayLength = length(ray); + return (ray / rayLength); +} +bool IntersectVolume( in highp vec2 uv, out highp float near, out highp float far, out highp vec3 rayN, out highp float rayLength ) { + rayN = FrustumRay( uv, rayLength); + return Cube( _CameraPosLocal.xyz, rayN, near, far); +} +highp float Linear01Depth( in highp float z ) { + return (1.0 / ((_ZBufferParams.x * z) + _ZBufferParams.y)); +} +void frag( in posuv i, out highp vec4 coord, out highp vec4 depth ) { + highp vec2 uv = i.uv; + highp float sampleOnEpipolarLine = (uv.x - (0.5 / _CoordTexDim.x)); + highp float epipolarLine = xll_saturate_f((uv.y - (0.5 / _CoordTexDim.y))); + sampleOnEpipolarLine *= (_CoordTexDim.x / (_CoordTexDim.x - 1.0)); + sampleOnEpipolarLine = xll_saturate_f(sampleOnEpipolarLine); + highp int edge = int(clamp( floor((epipolarLine * 4.0)), 0.0, 3.0)); + highp float posOnEdge = fract((epipolarLine * 4.0)); + highp float edgeCoord = (-1.0 + (2.0 * posOnEdge)); + highp vec4 edgeX = vec4( -1.0, edgeCoord, 1.0, (-edgeCoord)); + highp vec4 edgeY = vec4( (-edgeCoord), -1.0, edgeCoord, 1.0); + bvec4 edgeFlags = equal( ivec4( edge), ivec4( 0, 1, 2, 3)); + highp vec2 exit = (-vec2( dot( edgeY, vec4(edgeFlags)), dot( edgeX, vec4(edgeFlags)))); + highp vec2 entry = GetEpipolarLineEntryPoint( exit); + highp vec2 coordTemp = mix( entry, exit, vec2( sampleOnEpipolarLine)); + coordTemp = ((coordTemp * 0.5) + 0.5); + coord = vec4( coordTemp.x, coordTemp.y, 0.0, 0.0); + coordTemp = ((floor((coordTemp * _ScreenTexDim.xy)) + 0.5) * _ScreenTexDim.zw); + depth = vec4( Linear01Depth( texture( _CameraDepthTexture, coordTemp).x)); + highp float near; + highp float far; + highp float rayLength; + highp vec3 rayN; + if (((!IntersectVolume( coord.xy, near, far, rayN, rayLength)) || (depth.x < (near / rayLength)))){ + depth *= -1.0; + } + else{ + depth = min( depth, vec4( (far / rayLength))); + } +} +in highp vec2 xlv_TEXCOORD0; +void main() { + posuv xlt_i; + xlt_i.pos = vec4(0.0); + xlt_i.uv = vec2(xlv_TEXCOORD0); + highp vec4 xlt_coord; + highp vec4 xlt_depth; + frag( xlt_i, xlt_coord, xlt_depth); + gl_FragData[0] = vec4(xlt_coord); + gl_FragData[1] = vec4(xlt_depth); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-outES3.txt new file mode 100644 index 000000000..a30082fbd --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-outES3.txt @@ -0,0 +1,128 @@ +#version 300 es +layout(location=0) out mediump vec4 _glesFragData[4]; +uniform highp vec4 _ZBufferParams; +uniform highp vec4 _LightPos; +uniform highp mat4 _FrustumRays; +uniform highp vec4 _CameraPosLocal; +uniform highp vec4 _CoordTexDim; +uniform highp vec4 _ScreenTexDim; +uniform sampler2D _CameraDepthTexture; +in highp vec2 xlv_TEXCOORD0; +void main () +{ + highp vec4 depth_1; + highp vec2 coordTemp_2; + highp float sampleOnEpipolarLine_3; + highp float tmpvar_4; + tmpvar_4 = clamp ((xlv_TEXCOORD0.y - (0.5 / _CoordTexDim.y)), 0.0, 1.0); + sampleOnEpipolarLine_3 = ((xlv_TEXCOORD0.x - (0.5 / _CoordTexDim.x)) * (_CoordTexDim.x / (_CoordTexDim.x - 1.0))); + highp float tmpvar_5; + tmpvar_5 = clamp (sampleOnEpipolarLine_3, 0.0, 1.0); + sampleOnEpipolarLine_3 = tmpvar_5; + int tmpvar_6; + tmpvar_6 = int(clamp (floor( + (tmpvar_4 * 4.0) + ), 0.0, 3.0)); + highp float tmpvar_7; + tmpvar_7 = (-1.0 + (2.0 * fract( + (tmpvar_4 * 4.0) + ))); + highp vec4 tmpvar_8; + tmpvar_8.xz = vec2(-1.0, 1.0); + tmpvar_8.y = tmpvar_7; + tmpvar_8.w = -(tmpvar_7); + highp vec4 tmpvar_9; + tmpvar_9.yw = vec2(-1.0, 1.0); + tmpvar_9.x = -(tmpvar_7); + tmpvar_9.z = tmpvar_7; + bvec4 tmpvar_10; + tmpvar_10 = equal (ivec4(tmpvar_6), ivec4(0, 1, 2, 3)); + lowp vec4 tmpvar_11; + tmpvar_11 = vec4(tmpvar_10); + lowp vec4 tmpvar_12; + tmpvar_12 = vec4(tmpvar_10); + highp vec2 tmpvar_13; + tmpvar_13.x = dot (tmpvar_9, tmpvar_11); + tmpvar_13.y = dot (tmpvar_8, tmpvar_12); + coordTemp_2 = ((mix (_LightPos.xy, + -(tmpvar_13) + , vec2(tmpvar_5)) * 0.5) + 0.5); + highp vec4 tmpvar_14; + tmpvar_14.zw = vec2(0.0, 0.0); + tmpvar_14.xy = coordTemp_2; + coordTemp_2 = ((floor( + (coordTemp_2 * _ScreenTexDim.xy) + ) + 0.5) * _ScreenTexDim.zw); + lowp vec4 tmpvar_15; + tmpvar_15 = texture (_CameraDepthTexture, coordTemp_2); + highp float tmpvar_16; + highp float z_17; + z_17 = tmpvar_15.x; + tmpvar_16 = (1.0/(((_ZBufferParams.x * z_17) + _ZBufferParams.y))); + depth_1 = vec4(tmpvar_16); + highp vec4 v_18; + v_18.x = _FrustumRays[0].x; + v_18.y = _FrustumRays[1].x; + v_18.z = _FrustumRays[2].x; + v_18.w = _FrustumRays[3].x; + highp vec4 v_19; + v_19.x = _FrustumRays[0].y; + v_19.y = _FrustumRays[1].y; + v_19.z = _FrustumRays[2].y; + v_19.w = _FrustumRays[3].y; + highp vec4 v_20; + v_20.x = _FrustumRays[0].w; + v_20.y = _FrustumRays[1].w; + v_20.z = _FrustumRays[2].w; + v_20.w = _FrustumRays[3].w; + highp vec4 v_21; + v_21.x = _FrustumRays[0].z; + v_21.y = _FrustumRays[1].z; + v_21.z = _FrustumRays[2].z; + v_21.w = _FrustumRays[3].z; + highp vec3 tmpvar_22; + tmpvar_22 = mix (mix (v_18.xyz, v_19.xyz, tmpvar_14.xxx), mix (v_20.xyz, v_21.xyz, tmpvar_14.xxx), tmpvar_14.yyy); + highp float tmpvar_23; + tmpvar_23 = sqrt(dot (tmpvar_22, tmpvar_22)); + bool tmpvar_24; + highp vec3 tmpvar_25; + tmpvar_25 = (1.0/((tmpvar_22 / tmpvar_23))); + highp vec3 tmpvar_26; + tmpvar_26 = (tmpvar_25 * (-0.5 - _CameraPosLocal.xyz)); + highp vec3 tmpvar_27; + tmpvar_27 = (tmpvar_25 * (0.5 - _CameraPosLocal.xyz)); + highp vec3 tmpvar_28; + tmpvar_28 = min (tmpvar_27, tmpvar_26); + highp vec3 tmpvar_29; + tmpvar_29 = max (tmpvar_27, tmpvar_26); + highp vec2 tmpvar_30; + tmpvar_30 = max (tmpvar_28.xx, tmpvar_28.yz); + highp float tmpvar_31; + tmpvar_31 = max (tmpvar_30.x, tmpvar_30.y); + highp vec2 tmpvar_32; + tmpvar_32 = min (tmpvar_29.xx, tmpvar_29.yz); + highp float tmpvar_33; + tmpvar_33 = min (tmpvar_32.x, tmpvar_32.y); + tmpvar_24 = ((tmpvar_31 < tmpvar_33) && (tmpvar_33 > 0.0)); + if ((!(tmpvar_24) || (tmpvar_16 < (tmpvar_31 / tmpvar_23)))) { + depth_1 = -(vec4(tmpvar_16)); + } else { + depth_1 = min (depth_1, vec4((tmpvar_33 / tmpvar_23))); + }; + _glesFragData[0] = tmpvar_14; + _glesFragData[1] = depth_1; +} + + +// stats: 65 alu 1 tex 1 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// uniforms: 6 (total size: 0) +// #0: _ZBufferParams (high float) 4x1 [-1] +// #1: _LightPos (high float) 4x1 [-1] +// #2: _FrustumRays (high float) 4x4 [-1] +// #3: _CameraPosLocal (high float) 4x1 [-1] +// #4: _CoordTexDim (high float) 4x1 [-1] +// #5: _ScreenTexDim (high float) 4x1 [-1] +// textures: 1 +// #0: _CameraDepthTexture (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-outES3Metal.txt new file mode 100644 index 000000000..1ae45cf3f --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-outES3Metal.txt @@ -0,0 +1,138 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float2 xlv_TEXCOORD0; +}; +struct xlatMtlShaderOutput { + half4 _glesFragData_0 [[color(0)]]; + half4 _glesFragData_1 [[color(1)]]; +}; +struct xlatMtlShaderUniform { + float4 _ZBufferParams; + float4 _LightPos; + float4x4 _FrustumRays; + float4 _CameraPosLocal; + float4 _CoordTexDim; + float4 _ScreenTexDim; +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , texture2d _CameraDepthTexture [[texture(0)]], sampler _mtlsmp__CameraDepthTexture [[sampler(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + float4 depth_1; + float2 coordTemp_2; + float sampleOnEpipolarLine_3; + float tmpvar_4; + tmpvar_4 = clamp ((_mtl_i.xlv_TEXCOORD0.y - (0.5 / _mtl_u._CoordTexDim.y)), 0.0, 1.0); + sampleOnEpipolarLine_3 = ((_mtl_i.xlv_TEXCOORD0.x - (0.5 / _mtl_u._CoordTexDim.x)) * (_mtl_u._CoordTexDim.x / (_mtl_u._CoordTexDim.x - 1.0))); + float tmpvar_5; + tmpvar_5 = clamp (sampleOnEpipolarLine_3, 0.0, 1.0); + sampleOnEpipolarLine_3 = tmpvar_5; + int tmpvar_6; + tmpvar_6 = int(clamp (floor( + (tmpvar_4 * 4.0) + ), 0.0, 3.0)); + float tmpvar_7; + tmpvar_7 = (-1.0 + (2.0 * fract( + (tmpvar_4 * 4.0) + ))); + float4 tmpvar_8; + tmpvar_8.xz = float2(-1.0, 1.0); + tmpvar_8.y = tmpvar_7; + tmpvar_8.w = -(tmpvar_7); + float4 tmpvar_9; + tmpvar_9.yw = float2(-1.0, 1.0); + tmpvar_9.x = -(tmpvar_7); + tmpvar_9.z = tmpvar_7; + bool4 tmpvar_10; + tmpvar_10 = bool4((int4(tmpvar_6) == int4(0, 1, 2, 3))); + half4 tmpvar_11; + tmpvar_11 = half4(tmpvar_10); + half4 tmpvar_12; + tmpvar_12 = half4(tmpvar_10); + float2 tmpvar_13; + tmpvar_13.x = dot (tmpvar_9, (float4)tmpvar_11); + tmpvar_13.y = dot (tmpvar_8, (float4)tmpvar_12); + coordTemp_2 = ((mix (_mtl_u._LightPos.xy, + -(tmpvar_13) + , float2(tmpvar_5)) * 0.5) + 0.5); + float4 tmpvar_14; + tmpvar_14.zw = float2(0.0, 0.0); + tmpvar_14.xy = coordTemp_2; + coordTemp_2 = ((floor( + (coordTemp_2 * _mtl_u._ScreenTexDim.xy) + ) + 0.5) * _mtl_u._ScreenTexDim.zw); + half4 tmpvar_15; + tmpvar_15 = _CameraDepthTexture.sample(_mtlsmp__CameraDepthTexture, (float2)(coordTemp_2)); + float tmpvar_16; + float z_17; + z_17 = float(tmpvar_15.x); + tmpvar_16 = (1.0/(((_mtl_u._ZBufferParams.x * z_17) + _mtl_u._ZBufferParams.y))); + depth_1 = float4(tmpvar_16); + float4 v_18; + v_18.x = _mtl_u._FrustumRays[0].x; + v_18.y = _mtl_u._FrustumRays[1].x; + v_18.z = _mtl_u._FrustumRays[2].x; + v_18.w = _mtl_u._FrustumRays[3].x; + float4 v_19; + v_19.x = _mtl_u._FrustumRays[0].y; + v_19.y = _mtl_u._FrustumRays[1].y; + v_19.z = _mtl_u._FrustumRays[2].y; + v_19.w = _mtl_u._FrustumRays[3].y; + float4 v_20; + v_20.x = _mtl_u._FrustumRays[0].w; + v_20.y = _mtl_u._FrustumRays[1].w; + v_20.z = _mtl_u._FrustumRays[2].w; + v_20.w = _mtl_u._FrustumRays[3].w; + float4 v_21; + v_21.x = _mtl_u._FrustumRays[0].z; + v_21.y = _mtl_u._FrustumRays[1].z; + v_21.z = _mtl_u._FrustumRays[2].z; + v_21.w = _mtl_u._FrustumRays[3].z; + float3 tmpvar_22; + tmpvar_22 = mix (mix (v_18.xyz, v_19.xyz, tmpvar_14.xxx), mix (v_20.xyz, v_21.xyz, tmpvar_14.xxx), tmpvar_14.yyy); + float tmpvar_23; + tmpvar_23 = sqrt(dot (tmpvar_22, tmpvar_22)); + bool tmpvar_24; + float3 tmpvar_25; + tmpvar_25 = (1.0/((tmpvar_22 / tmpvar_23))); + float3 tmpvar_26; + tmpvar_26 = (tmpvar_25 * (-0.5 - _mtl_u._CameraPosLocal.xyz)); + float3 tmpvar_27; + tmpvar_27 = (tmpvar_25 * (0.5 - _mtl_u._CameraPosLocal.xyz)); + float3 tmpvar_28; + tmpvar_28 = min (tmpvar_27, tmpvar_26); + float3 tmpvar_29; + tmpvar_29 = max (tmpvar_27, tmpvar_26); + float2 tmpvar_30; + tmpvar_30 = max (tmpvar_28.xx, tmpvar_28.yz); + float tmpvar_31; + tmpvar_31 = max (tmpvar_30.x, tmpvar_30.y); + float2 tmpvar_32; + tmpvar_32 = min (tmpvar_29.xx, tmpvar_29.yz); + float tmpvar_33; + tmpvar_33 = min (tmpvar_32.x, tmpvar_32.y); + tmpvar_24 = bool(((tmpvar_31 < tmpvar_33) && (tmpvar_33 > 0.0))); + if (((bool)!(tmpvar_24) || (tmpvar_16 < (tmpvar_31 / tmpvar_23)))) { + depth_1 = -(float4(tmpvar_16)); + } else { + depth_1 = min (depth_1, float4((tmpvar_33 / tmpvar_23))); + }; + _mtl_o._glesFragData_0 = half4(tmpvar_14); + _mtl_o._glesFragData_1 = half4(depth_1); + return _mtl_o; +} + + +// stats: 65 alu 1 tex 1 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// uniforms: 6 (total size: 144) +// #0: _ZBufferParams (high float) 4x1 [-1] loc 0 +// #1: _LightPos (high float) 4x1 [-1] loc 16 +// #2: _FrustumRays (high float) 4x4 [-1] loc 32 +// #3: _CameraPosLocal (high float) 4x1 [-1] loc 96 +// #4: _CoordTexDim (high float) 4x1 [-1] loc 112 +// #5: _ScreenTexDim (high float) 4x1 [-1] loc 128 +// textures: 1 +// #0: _CameraDepthTexture (low 2d) 0x0 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-inES3.txt new file mode 100644 index 000000000..5af884e0b --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-inES3.txt @@ -0,0 +1,118 @@ +#version 300 es +out lowp vec4 _fragData; +struct v2f_vertex_lit { + vec2 uv; + vec4 diff; + vec4 spec; +}; +struct v2f_img { + vec4 pos; + vec2 uv; +}; +struct appdata_img { + vec4 vertex; + vec2 texcoord; +}; +struct SurfaceOutput { + vec3 Albedo; + vec3 Normal; + vec3 Emission; + float Specular; + float Gloss; + float Alpha; +}; +struct Input { + vec2 uv_MainTex; + vec2 uv_BumpMap; +}; +struct v2f_surf { + vec4 pos; + float fog; + vec4 hip_pack0; + vec3 viewDir; + vec3 lightDir; + vec3 vlight; +}; +struct appdata_full { + vec4 vertex; + vec4 tangent; + vec3 normal; + vec4 texcoord; + vec4 texcoord1; + vec4 color; +}; +uniform sampler2D _BumpMap; +uniform mediump vec4 _Color; +uniform mediump vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform mediump vec4 _SpecColor; + +void surf( in Input IN, inout SurfaceOutput o ); +vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ); +vec4 frag_surf( in v2f_surf IN ); + +mediump vec4 UnpackNormal( in mediump vec4 packednormal ) { + vec4 normal; + normal.xy = ((packednormal.wy * 2.00000) - 1.00000); + normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) ); + return normal; +} +void surf( in Input IN, inout SurfaceOutput o ) { + vec4 tex; + tex = texture2D( _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))); +} +vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) { + vec3 h; + float diff; + float nh; + float spec; + vec4 c; + h = normalize( (lightDir + viewDir) ); + diff = max( 0.000000, dot( s.Normal, lightDir)); + nh = max( 0.000000, dot( s.Normal, h)); + spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss); + c.xyz = ((((s.Albedo * _LightColor0.xyz ) * diff) + ((_LightColor0.xyz * _SpecColor.xyz ) * spec)) * (atten * 2.00000)); + c.w = (s.Alpha + (((_LightColor0.w * _SpecColor.w ) * spec) * atten)); + return c; +} +vec4 frag_surf( in v2f_surf IN ) { + Input surfIN; + SurfaceOutput o; + float atten = 1.00000; + vec4 c; + surfIN.uv_MainTex = IN.hip_pack0.xy ; + surfIN.uv_BumpMap = IN.hip_pack0.zw ; + o.Albedo = vec3( 0.000000); + o.Emission = vec3( 0.000000); + o.Specular = 0.000000; + o.Alpha = 0.000000; + o.Gloss = 0.000000; + surf( surfIN, o); + c = LightingBlinnPhong( o, IN.lightDir, normalize( vec3( IN.viewDir) ), atten); + c.xyz += (o.Albedo * IN.vlight); + c.w = o.Alpha; + return c; +} +in vec4 xlv_FOG; +in highp vec4 _uv0; +in mediump vec3 _uv1; +in mediump vec3 _uv2; +in mediump vec3 _uv3; +void main() { + vec4 xl_retval; + v2f_surf xlt_IN; + xlt_IN.pos = vec4(0.0); + xlt_IN.fog = float( xlv_FOG); + xlt_IN.hip_pack0 = _uv0; + xlt_IN.viewDir = _uv1; + xlt_IN.lightDir = _uv2; + xlt_IN.vlight = _uv3; + xl_retval = frag_surf( xlt_IN); + _fragData = vec4( xl_retval); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-ir.txt deleted file mode 100644 index fcd4853cb..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-ir.txt +++ /dev/null @@ -1,221 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec3 lightDir; - vec3 vlight; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform vec4 _LightColor0; -uniform sampler2D _MainTex; -uniform float _Shininess; -uniform vec4 _SpecColor; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -void surf ( - in Input IN_6, - inout SurfaceOutput o_7 -) -{ - vec4 tex_8; - vec4 tmpvar_9; - tmpvar_9 = texture2D (_MainTex, IN_6.uv_MainTex); - vec4 tmpvar_10; - tmpvar_10 = tmpvar_9; - tex_8 = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = (tex_8.xyz * _Color.xyz); - o_7.Albedo = tmpvar_11; - float tmpvar_12; - tmpvar_12 = tex_8.w; - o_7.Gloss = tmpvar_12; - float tmpvar_13; - tmpvar_13 = (tex_8.w * _Color.w); - o_7.Alpha = tmpvar_13; - float tmpvar_14; - tmpvar_14 = _Shininess; - o_7.Specular = tmpvar_14; - vec4 tmpvar_15; - tmpvar_15 = texture2D (_BumpMap, IN_6.uv_BumpMap); - vec4 tmpvar_16; - tmpvar_16 = UnpackNormal (tmpvar_15); - vec3 tmpvar_17; - tmpvar_17 = tmpvar_16.xyz; - vec3 tmpvar_18; - tmpvar_18 = tmpvar_17; - o_7.Normal = tmpvar_18; -} - -vec4 LightingBlinnPhong ( - in SurfaceOutput s_19, - in vec3 lightDir_20, - in vec3 viewDir_21, - in float atten_22 -) -{ - vec4 c_23; - float spec_24; - float nh_25; - float diff_26; - vec3 h_27; - vec3 tmpvar_28; - tmpvar_28 = normalize ((lightDir_20 + viewDir_21)); - vec3 tmpvar_29; - tmpvar_29 = tmpvar_28; - h_27 = tmpvar_29; - float tmpvar_30; - tmpvar_30 = dot (s_19.Normal, lightDir_20); - float tmpvar_31; - tmpvar_31 = max (0.0, tmpvar_30); - float tmpvar_32; - tmpvar_32 = tmpvar_31; - diff_26 = tmpvar_32; - float tmpvar_33; - tmpvar_33 = dot (s_19.Normal, h_27); - float tmpvar_34; - tmpvar_34 = max (0.0, tmpvar_33); - float tmpvar_35; - tmpvar_35 = tmpvar_34; - nh_25 = tmpvar_35; - float tmpvar_36; - tmpvar_36 = pow (nh_25, (s_19.Specular * 128.0)); - float tmpvar_37; - tmpvar_37 = (tmpvar_36 * s_19.Gloss); - spec_24 = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = ((( - (s_19.Albedo * _LightColor0.xyz) - * diff_26) + ( - (_LightColor0.xyz * _SpecColor.xyz) - * spec_24)) * (atten_22 * 2.0)); - c_23.xyz = tmpvar_38.xyz.xyz; - float tmpvar_39; - tmpvar_39 = (s_19.Alpha + (( - (_LightColor0.w * _SpecColor.w) - * spec_24) * atten_22)); - c_23.w = vec4(tmpvar_39).w; - return c_23; -} - -vec4 frag_surf ( - in v2f_surf IN_40 -) -{ - vec4 c_41; - float atten_42; - SurfaceOutput o_43; - Input surfIN_44; - float tmpvar_45; - tmpvar_45 = 1.0; - atten_42 = tmpvar_45; - vec2 tmpvar_46; - tmpvar_46 = IN_40.hip_pack0.xy; - surfIN_44.uv_MainTex = tmpvar_46; - vec2 tmpvar_47; - tmpvar_47 = IN_40.hip_pack0.zw; - surfIN_44.uv_BumpMap = tmpvar_47; - vec3 tmpvar_48; - tmpvar_48 = vec3(0.0, 0.0, 0.0); - o_43.Albedo = tmpvar_48; - vec3 tmpvar_49; - tmpvar_49 = vec3(0.0, 0.0, 0.0); - o_43.Emission = tmpvar_49; - float tmpvar_50; - tmpvar_50 = 0.0; - o_43.Specular = tmpvar_50; - float tmpvar_51; - tmpvar_51 = 0.0; - o_43.Alpha = tmpvar_51; - float tmpvar_52; - tmpvar_52 = 0.0; - o_43.Gloss = tmpvar_52; - surf (surfIN_44, o_43); - vec3 tmpvar_53; - tmpvar_53 = IN_40.viewDir.xyz; - vec3 tmpvar_54; - tmpvar_54 = normalize (tmpvar_53); - vec4 tmpvar_55; - tmpvar_55 = LightingBlinnPhong (o_43, IN_40.lightDir, tmpvar_54, atten_42); - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - c_41 = tmpvar_56; - vec3 tmpvar_57; - tmpvar_57 = (c_41.xyz + (o_43.Albedo * IN_40.vlight)); - c_41.xyz = tmpvar_57.xyz.xyz; - float tmpvar_58; - tmpvar_58 = o_43.Alpha; - c_41.w = vec4(tmpvar_58).w; - return c_41; -} - -void main () -{ - v2f_surf xlt_IN_59; - vec4 xl_retval_60; - vec4 tmpvar_61; - tmpvar_61 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_59.pos = tmpvar_61; - float tmpvar_62; - tmpvar_62 = xlv_FOG.x; - xlt_IN_59.fog = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63 = gl_TexCoord[0].xyzw; - vec4 tmpvar_64; - tmpvar_64 = tmpvar_63; - xlt_IN_59.hip_pack0 = tmpvar_64; - vec3 tmpvar_65; - tmpvar_65 = gl_TexCoord[1].xyz; - vec3 tmpvar_66; - tmpvar_66 = tmpvar_65; - xlt_IN_59.viewDir = tmpvar_66; - vec3 tmpvar_67; - tmpvar_67 = gl_TexCoord[2].xyz; - vec3 tmpvar_68; - tmpvar_68 = tmpvar_67; - xlt_IN_59.lightDir = tmpvar_68; - vec3 tmpvar_69; - tmpvar_69 = gl_TexCoord[3].xyz; - vec3 tmpvar_70; - tmpvar_70 = tmpvar_69; - xlt_IN_59.vlight = tmpvar_70; - vec4 tmpvar_71; - tmpvar_71 = frag_surf (xlt_IN_59); - vec4 tmpvar_72; - tmpvar_72 = tmpvar_71; - xl_retval_60 = tmpvar_72; - vec4 tmpvar_73; - tmpvar_73 = xl_retval_60.xyzw; - vec4 tmpvar_74; - tmpvar_74 = tmpvar_73; - gl_FragData[0] = tmpvar_74; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-out.txt b/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-out.txt index 5f052ca4a..2c87a23e8 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-out.txt @@ -11,34 +11,44 @@ void main () vec3 tmpvar_2; tmpvar_2 = gl_TexCoord[2].xyz; vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, tmpvar_1.xy); - vec3 tmpvar_5; - tmpvar_5 = (tmpvar_4.xyz * _Color.xyz); - float tmpvar_6; - tmpvar_6 = (tmpvar_4.w * _Color.w); + vec3 tmpvar_4; + float tmpvar_5; + vec4 tmpvar_6; + tmpvar_6 = texture2D (_MainTex, tmpvar_1.xy); + tmpvar_4 = (tmpvar_6.xyz * _Color.xyz); + tmpvar_5 = (tmpvar_6.w * _Color.w); vec4 normal_7; normal_7.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0); normal_7.z = sqrt(((1.0 - (normal_7.x * normal_7.x) ) - (normal_7.y * normal_7.y))); vec4 c_8; - float tmpvar_9; - tmpvar_9 = (pow (max (0.0, + float spec_9; + spec_9 = (pow (max (0.0, dot (normal_7.xyz, normalize((tmpvar_2 + normalize(gl_TexCoord[1].xyz)))) - ), (_Shininess * 128.0)) * tmpvar_4.w); + ), (_Shininess * 128.0)) * tmpvar_6.w); c_8.xyz = ((( - (tmpvar_5 * _LightColor0.xyz) + (tmpvar_4 * _LightColor0.xyz) * max (0.0, dot (normal_7.xyz, tmpvar_2)) ) + ( (_LightColor0.xyz * _SpecColor.xyz) - * tmpvar_9)) * 2.0); - c_8.w = (tmpvar_6 + ((_LightColor0.w * _SpecColor.w) * tmpvar_9)); - c_3.xyz = (c_8.xyz + (tmpvar_5 * gl_TexCoord[3].xyz)); - c_3.w = tmpvar_6; + * spec_9)) * 2.0); + c_8.w = (tmpvar_5 + ((_LightColor0.w * _SpecColor.w) * spec_9)); + c_3.xyz = (c_8.xyz + (tmpvar_4 * gl_TexCoord[3].xyz)); + c_3.w = tmpvar_5; gl_FragData[0] = c_3; } -// inputs: 1, stats: 30 alu 2 tex 0 flow +// stats: 30 alu 2 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 4 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _Shininess (high float) 1x1 [-1] +// #3: _SpecColor (high float) 4x1 [-1] +// textures: 2 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3.txt new file mode 100644 index 000000000..e9f09eeec --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3.txt @@ -0,0 +1,65 @@ +#version 300 es +out lowp vec4 _fragData; +uniform sampler2D _BumpMap; +uniform mediump vec4 _Color; +uniform mediump vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform highp float _Shininess; +uniform mediump vec4 _SpecColor; +in highp vec4 _uv0; +in mediump vec3 _uv1; +in mediump vec3 _uv2; +in mediump vec3 _uv3; +void main () +{ + mediump vec4 c_1; + mediump vec3 tmpvar_2; + mediump float tmpvar_3; + lowp vec4 tmpvar_4; + tmpvar_4 = texture (_MainTex, _uv0.xy); + tmpvar_2 = (tmpvar_4.xyz * _Color.xyz); + tmpvar_3 = (tmpvar_4.w * _Color.w); + lowp vec4 tmpvar_5; + tmpvar_5 = texture (_BumpMap, _uv0.zw); + mediump vec4 packednormal_6; + packednormal_6 = tmpvar_5; + mediump vec4 normal_7; + normal_7.xy = ((packednormal_6.wy * 2.0) - 1.0); + normal_7.z = sqrt(((1.0 - + (normal_7.x * normal_7.x) + ) - (normal_7.y * normal_7.y))); + mediump vec4 c_8; + lowp float spec_9; + mediump float tmpvar_10; + tmpvar_10 = pow (max (0.0, dot (normal_7.xyz, + normalize((_uv2 + normalize(_uv1))) + )), (_Shininess * 128.0)); + spec_9 = (tmpvar_10 * tmpvar_4.w); + c_8.xyz = ((( + (tmpvar_2 * _LightColor0.xyz) + * + max (0.0, dot (normal_7.xyz, _uv2)) + ) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * spec_9)) * 2.0); + 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; +} + + +// stats: 30 alu 2 tex 0 flow +// inputs: 4 +// #0: _uv0 (high float) 4x1 [-1] +// #1: _uv1 (medium float) 3x1 [-1] +// #2: _uv2 (medium float) 3x1 [-1] +// #3: _uv3 (medium float) 3x1 [-1] +// uniforms: 4 (total size: 0) +// #0: _Color (medium float) 4x1 [-1] +// #1: _LightColor0 (medium float) 4x1 [-1] +// #2: _Shininess (high float) 1x1 [-1] +// #3: _SpecColor (medium float) 4x1 [-1] +// textures: 2 +// #0: _BumpMap (low 2d) 0x0 [-1] +// #1: _MainTex (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3Metal.txt new file mode 100644 index 000000000..ccb11717f --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3Metal.txt @@ -0,0 +1,76 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float4 _uv0; + half3 _uv1; + half3 _uv2; + half3 _uv3; +}; +struct xlatMtlShaderOutput { + half4 _fragData [[color(0)]]; +}; +struct xlatMtlShaderUniform { + half4 _Color; + half4 _LightColor0; + float _Shininess; + half4 _SpecColor; +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , texture2d _BumpMap [[texture(0)]], sampler _mtlsmp__BumpMap [[sampler(0)]] + , texture2d _MainTex [[texture(1)]], sampler _mtlsmp__MainTex [[sampler(1)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 c_1; + half3 tmpvar_2; + half tmpvar_3; + half4 tmpvar_4; + tmpvar_4 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i._uv0.xy)); + tmpvar_2 = (tmpvar_4.xyz * _mtl_u._Color.xyz); + tmpvar_3 = (tmpvar_4.w * _mtl_u._Color.w); + half4 tmpvar_5; + tmpvar_5 = _BumpMap.sample(_mtlsmp__BumpMap, (float2)(_mtl_i._uv0.zw)); + half4 packednormal_6; + packednormal_6 = tmpvar_5; + half4 normal_7; + normal_7.xy = ((packednormal_6.wy * (half)2.0) - (half)1.0); + normal_7.z = sqrt((((half)1.0 - + (normal_7.x * normal_7.x) + ) - (normal_7.y * normal_7.y))); + half4 c_8; + half spec_9; + half tmpvar_10; + float y_11; + y_11 = (_mtl_u._Shininess * 128.0); + tmpvar_10 = ((half)pow ((float)max ((half)0.0, dot (normal_7.xyz, + normalize((_mtl_i._uv2 + normalize(_mtl_i._uv1))) + )), y_11)); + spec_9 = (tmpvar_10 * tmpvar_4.w); + c_8.xyz = ((( + (tmpvar_2 * _mtl_u._LightColor0.xyz) + * + max ((half)0.0, dot (normal_7.xyz, _mtl_i._uv2)) + ) + ( + (_mtl_u._LightColor0.xyz * _mtl_u._SpecColor.xyz) + * spec_9)) * (half)2.0); + 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; + return _mtl_o; +} + + +// stats: 30 alu 2 tex 0 flow +// inputs: 4 +// #0: _uv0 (high float) 4x1 [-1] +// #1: _uv1 (medium float) 3x1 [-1] +// #2: _uv2 (medium float) 3x1 [-1] +// #3: _uv3 (medium float) 3x1 [-1] +// uniforms: 4 (total size: 32) +// #0: _Color (medium float) 4x1 [-1] loc 0 +// #1: _LightColor0 (medium float) 4x1 [-1] loc 8 +// #2: _Shininess (high float) 1x1 [-1] loc 16 +// #3: _SpecColor (medium float) 4x1 [-1] loc 24 +// textures: 2 +// #0: _BumpMap (low 2d) 0x0 [-1] loc 0 +// #1: _MainTex (low 2d) 0x0 [-1] loc 1 diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-inES3.txt new file mode 100644 index 000000000..8e5e2f72f --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-inES3.txt @@ -0,0 +1,81 @@ +#version 300 es +struct v2f { + highp vec4 pos; + highp vec2 uv; + highp vec3 ray; +}; +uniform sampler2D _CameraDepthTexture; +uniform highp vec4 _LightShadowData; +uniform highp vec4 _LightSplitsFar; +uniform highp vec4 _LightSplitsNear; +uniform sampler2D _ShadowMapTexture; +uniform highp mat4 _View2Shadow; +uniform highp mat4 _View2Shadow1; +uniform highp mat4 _View2Shadow2; +uniform highp mat4 _View2Shadow3; +uniform highp vec4 _ZBufferParams; +mediump float unitySampleShadow( in highp vec4 eyePos ); +highp float Linear01Depth( in highp float z ); +highp vec2 EncodeFloatRG( in highp float v ); +mediump vec4 xlat_main( in v2f i ); +mediump float unitySampleShadow( in highp vec4 eyePos ) { + highp vec3 sc0; + highp vec3 sc1; + highp vec3 sc2; + highp vec3 sc3; + highp float z; + highp vec4 near; + highp vec4 far; + highp vec4 weights; + highp vec4 coord; + mediump float shadow; + sc0 = ( _View2Shadow * eyePos ).xyz ; + sc1 = ( _View2Shadow1 * eyePos ).xyz ; + sc2 = ( _View2Shadow2 * eyePos ).xyz ; + sc3 = ( _View2Shadow3 * eyePos ).xyz ; + z = eyePos.z ; + near = vec4( greaterThanEqual( vec4( z ), _LightSplitsNear) ); + 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 ); + return shadow; +} +highp float Linear01Depth( in highp float z ) { + return (1.00000 / ((_ZBufferParams.x * z) + _ZBufferParams.y )); +} +highp vec2 EncodeFloatRG( in highp float v ) { + highp vec2 kEncodeMul = vec2( 1.00000, 255.000); + highp float kEncodeBit = 0.00392157; + highp vec2 enc; + enc = (kEncodeMul * v); + enc = fract( enc ); + enc.x -= (enc.y * kEncodeBit); + return enc; +} +mediump vec4 xlat_main( in v2f i ) { + highp float depth; + highp vec4 vpos; + mediump float shadow; + highp vec4 res; + depth = texture2D( _CameraDepthTexture, i.uv).x ; + depth = Linear01Depth( depth); + vpos = vec4( (i.ray * depth), 1.00000); + shadow = unitySampleShadow( vpos); + res.x = shadow; + res.y = 1.00000; + res.zw = EncodeFloatRG( (1.00000 - depth)); + return res; +} +in highp vec2 xlv_TEXCOORD0; +in highp vec3 xlv_TEXCOORD1; +out mediump vec4 _fragData; +void main() { + mediump vec4 xl_retval; + v2f xlt_i; + xlt_i.pos = vec4(0.0); + xlt_i.uv = vec2( xlv_TEXCOORD0); + xlt_i.ray = vec3( xlv_TEXCOORD1); + xl_retval = xlat_main( xlt_i); + _fragData = vec4( xl_retval); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-ir.txt deleted file mode 100644 index d603e78ab..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-ir.txt +++ /dev/null @@ -1,195 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; - vec3 ray; -}; -uniform sampler2D _CameraDepthTexture; -uniform vec4 _LightShadowData; -uniform vec4 _LightSplitsFar; -uniform vec4 _LightSplitsNear; -uniform sampler2D _ShadowMapTexture; -uniform mat4 _View2Shadow; -uniform mat4 _View2Shadow1; -uniform mat4 _View2Shadow2; -uniform mat4 _View2Shadow3; -uniform vec4 _ZBufferParams; -float unitySampleShadow ( - in vec4 eyePos_1 -) -{ - float shadow_2; - vec4 coord_3; - vec4 weights_4; - vec4 far_5; - vec4 near_6; - float z_7; - vec3 sc3_8; - vec3 sc2_9; - vec3 sc1_10; - vec3 sc0_11; - vec3 tmpvar_12; - tmpvar_12 = (_View2Shadow * eyePos_1).xyz; - sc0_11 = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13 = (_View2Shadow1 * eyePos_1).xyz; - sc1_10 = tmpvar_13; - vec3 tmpvar_14; - tmpvar_14 = (_View2Shadow2 * eyePos_1).xyz; - sc2_9 = tmpvar_14; - vec3 tmpvar_15; - tmpvar_15 = (_View2Shadow3 * eyePos_1).xyz; - sc3_8 = tmpvar_15; - float tmpvar_16; - tmpvar_16 = eyePos_1.z; - z_7 = tmpvar_16; - vec4 tmpvar_17; - tmpvar_17 = vec4(z_7); - bvec4 tmpvar_18; - tmpvar_18 = greaterThanEqual (tmpvar_17, _LightSplitsNear); - vec4 tmpvar_19; - tmpvar_19 = vec4(tmpvar_18).xyzw; - vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - near_6 = tmpvar_20; - vec4 tmpvar_21; - tmpvar_21 = vec4(z_7); - bvec4 tmpvar_22; - tmpvar_22 = lessThan (tmpvar_21, _LightSplitsFar); - vec4 tmpvar_23; - tmpvar_23 = vec4(tmpvar_22).xyzw; - vec4 tmpvar_24; - tmpvar_24 = tmpvar_23; - far_5 = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25 = (near_6 * far_5); - weights_4 = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26.w = 1.0; - tmpvar_26.xyz = ((( - (sc0_11 * weights_4.x) - + - (sc1_10 * weights_4.y) - ) + (sc2_9 * weights_4.z)) + (sc3_8 * weights_4.w)).xyz; - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - coord_3 = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = texture2D (_ShadowMapTexture, coord_3.xy); - float tmpvar_29; - if ((tmpvar_28.x < coord_3.z)) { - tmpvar_29 = _LightShadowData.x; - } else { - tmpvar_29 = 1.0; - }; - float tmpvar_30; - tmpvar_30 = tmpvar_29; - shadow_2 = tmpvar_30; - return shadow_2; -} - -float Linear01Depth ( - in float z_31 -) -{ - return (1.0 / ((_ZBufferParams.x * z_31) + _ZBufferParams.y)); -} - -vec2 EncodeFloatRG ( - in float v_32 -) -{ - vec2 enc_33; - float kEncodeBit_34; - vec2 kEncodeMul_35; - vec2 tmpvar_36; - tmpvar_36 = vec2(1.0, 255.0); - kEncodeMul_35 = tmpvar_36; - float tmpvar_37; - tmpvar_37 = 0.00392157; - kEncodeBit_34 = tmpvar_37; - vec2 tmpvar_38; - tmpvar_38 = (kEncodeMul_35 * v_32); - enc_33 = tmpvar_38; - vec2 tmpvar_39; - tmpvar_39 = fract (enc_33); - vec2 tmpvar_40; - tmpvar_40 = tmpvar_39; - enc_33 = tmpvar_40; - float tmpvar_41; - tmpvar_41 = (enc_33.x - (enc_33.y * kEncodeBit_34)); - enc_33.x = tmpvar_41; - return enc_33; -} - -vec4 xlat_main ( - in v2f i_42 -) -{ - vec4 res_43; - float shadow_44; - vec4 vpos_45; - float depth_46; - vec4 tmpvar_47; - tmpvar_47 = texture2D (_CameraDepthTexture, i_42.uv); - float tmpvar_48; - tmpvar_48 = tmpvar_47.x; - depth_46 = tmpvar_48; - float tmpvar_49; - tmpvar_49 = Linear01Depth (depth_46); - float tmpvar_50; - tmpvar_50 = tmpvar_49; - depth_46 = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51.w = 1.0; - tmpvar_51.xyz = (i_42.ray * depth_46).xyz; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - vpos_45 = tmpvar_52; - float tmpvar_53; - tmpvar_53 = unitySampleShadow (vpos_45); - float tmpvar_54; - tmpvar_54 = tmpvar_53; - shadow_44 = tmpvar_54; - float tmpvar_55; - tmpvar_55 = shadow_44; - res_43.x = tmpvar_55; - float tmpvar_56; - tmpvar_56 = 1.0; - res_43.y = vec2(tmpvar_56).y; - vec2 tmpvar_57; - tmpvar_57 = EncodeFloatRG ((1.0 - depth_46)); - vec2 tmpvar_58; - tmpvar_58 = tmpvar_57; - res_43.zw = tmpvar_58.xxxy.zw; - return res_43; -} - -void main () -{ - v2f xlt_i_59; - vec4 xl_retval_60; - vec4 tmpvar_61; - tmpvar_61 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_59.pos = tmpvar_61; - vec2 tmpvar_62; - tmpvar_62 = gl_TexCoord[0].xy; - vec2 tmpvar_63; - tmpvar_63 = tmpvar_62; - xlt_i_59.uv = tmpvar_63; - vec3 tmpvar_64; - tmpvar_64 = gl_TexCoord[1].xyz; - vec3 tmpvar_65; - tmpvar_65 = tmpvar_64; - xlt_i_59.ray = tmpvar_65; - vec4 tmpvar_66; - tmpvar_66 = xlat_main (xlt_i_59); - vec4 tmpvar_67; - tmpvar_67 = tmpvar_66; - xl_retval_60 = tmpvar_67; - vec4 tmpvar_68; - tmpvar_68 = xl_retval_60.xyzw; - vec4 tmpvar_69; - tmpvar_69 = tmpvar_68; - gl_FragData[0] = tmpvar_69; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-irES.txt deleted file mode 100644 index aca530e39..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-irES.txt +++ /dev/null @@ -1,197 +0,0 @@ -struct v2f { - highp vec4 pos; - highp vec2 uv; - highp vec3 ray; -}; -uniform sampler2D _CameraDepthTexture; -uniform highp vec4 _LightShadowData; -uniform highp vec4 _LightSplitsFar; -uniform highp vec4 _LightSplitsNear; -uniform sampler2D _ShadowMapTexture; -uniform highp mat4 _View2Shadow; -uniform highp mat4 _View2Shadow1; -uniform highp mat4 _View2Shadow2; -uniform highp mat4 _View2Shadow3; -uniform highp vec4 _ZBufferParams; -varying highp vec2 xlv_TEXCOORD0; -varying highp vec3 xlv_TEXCOORD1; -mediump float unitySampleShadow ( - in highp vec4 eyePos_1 -) -{ - mediump float shadow_2; - highp vec4 coord_3; - highp vec4 weights_4; - highp vec4 far_5; - highp vec4 near_6; - highp float z_7; - highp vec3 sc3_8; - highp vec3 sc2_9; - highp vec3 sc1_10; - highp vec3 sc0_11; - highp vec3 tmpvar_12; - tmpvar_12 = (_View2Shadow * eyePos_1).xyz; - sc0_11 = tmpvar_12; - highp vec3 tmpvar_13; - tmpvar_13 = (_View2Shadow1 * eyePos_1).xyz; - sc1_10 = tmpvar_13; - highp vec3 tmpvar_14; - tmpvar_14 = (_View2Shadow2 * eyePos_1).xyz; - sc2_9 = tmpvar_14; - highp vec3 tmpvar_15; - tmpvar_15 = (_View2Shadow3 * eyePos_1).xyz; - sc3_8 = tmpvar_15; - highp float tmpvar_16; - tmpvar_16 = eyePos_1.z; - z_7 = tmpvar_16; - highp vec4 tmpvar_17; - tmpvar_17 = vec4(z_7); - bvec4 tmpvar_18; - tmpvar_18 = greaterThanEqual (tmpvar_17, _LightSplitsNear); - lowp vec4 tmpvar_19; - tmpvar_19 = vec4(tmpvar_18).xyzw; - lowp vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - near_6 = tmpvar_20; - highp vec4 tmpvar_21; - tmpvar_21 = vec4(z_7); - bvec4 tmpvar_22; - tmpvar_22 = lessThan (tmpvar_21, _LightSplitsFar); - lowp vec4 tmpvar_23; - tmpvar_23 = vec4(tmpvar_22).xyzw; - lowp vec4 tmpvar_24; - tmpvar_24 = tmpvar_23; - far_5 = tmpvar_24; - highp vec4 tmpvar_25; - tmpvar_25 = (near_6 * far_5); - weights_4 = tmpvar_25; - highp vec4 tmpvar_26; - tmpvar_26.w = 1.0; - tmpvar_26.xyz = ((( - (sc0_11 * weights_4.x) - + - (sc1_10 * weights_4.y) - ) + (sc2_9 * weights_4.z)) + (sc3_8 * weights_4.w)).xyz; - highp vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - coord_3 = tmpvar_27; - lowp vec4 tmpvar_28; - tmpvar_28 = texture2D (_ShadowMapTexture, coord_3.xy); - highp float tmpvar_29; - if ((tmpvar_28.x < coord_3.z)) { - tmpvar_29 = _LightShadowData.x; - } else { - tmpvar_29 = 1.0; - }; - highp float tmpvar_30; - tmpvar_30 = tmpvar_29; - shadow_2 = tmpvar_30; - return shadow_2; -} - -float Linear01Depth ( - in highp float z_31 -) -{ - return (1.0 / ((_ZBufferParams.x * z_31) + _ZBufferParams.y)); -} - -vec2 EncodeFloatRG ( - in highp float v_32 -) -{ - highp vec2 enc_33; - highp float kEncodeBit_34; - highp vec2 kEncodeMul_35; - mediump vec2 tmpvar_36; - tmpvar_36 = vec2(1.0, 255.0); - kEncodeMul_35 = tmpvar_36; - mediump float tmpvar_37; - tmpvar_37 = 0.00392157; - kEncodeBit_34 = tmpvar_37; - highp vec2 tmpvar_38; - tmpvar_38 = (kEncodeMul_35 * v_32); - enc_33 = tmpvar_38; - highp vec2 tmpvar_39; - tmpvar_39 = fract (enc_33); - highp vec2 tmpvar_40; - tmpvar_40 = tmpvar_39; - enc_33 = tmpvar_40; - highp float tmpvar_41; - tmpvar_41 = (enc_33.x - (enc_33.y * kEncodeBit_34)); - enc_33.x = tmpvar_41; - return enc_33; -} - -mediump vec4 xlat_main ( - in v2f i_42 -) -{ - highp vec4 res_43; - mediump float shadow_44; - highp vec4 vpos_45; - highp float depth_46; - lowp vec4 tmpvar_47; - tmpvar_47 = texture2D (_CameraDepthTexture, i_42.uv); - lowp float tmpvar_48; - tmpvar_48 = tmpvar_47.x; - depth_46 = tmpvar_48; - highp float tmpvar_49; - tmpvar_49 = Linear01Depth (depth_46); - highp float tmpvar_50; - tmpvar_50 = tmpvar_49; - depth_46 = tmpvar_50; - highp vec4 tmpvar_51; - tmpvar_51.w = 1.0; - tmpvar_51.xyz = (i_42.ray * depth_46).xyz; - highp vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - vpos_45 = tmpvar_52; - mediump float tmpvar_53; - tmpvar_53 = unitySampleShadow (vpos_45); - mediump float tmpvar_54; - tmpvar_54 = tmpvar_53; - shadow_44 = tmpvar_54; - mediump float tmpvar_55; - tmpvar_55 = shadow_44; - res_43.x = tmpvar_55; - mediump float tmpvar_56; - tmpvar_56 = 1.0; - res_43.y = vec2(tmpvar_56).y; - highp vec2 tmpvar_57; - tmpvar_57 = EncodeFloatRG ((1.0 - depth_46)); - highp vec2 tmpvar_58; - tmpvar_58 = tmpvar_57; - res_43.zw = tmpvar_58.xxxy.zw; - return res_43; -} - -void main () -{ - v2f xlt_i_59; - mediump vec4 xl_retval_60; - mediump vec4 tmpvar_61; - tmpvar_61 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_59.pos = tmpvar_61; - highp vec2 tmpvar_62; - tmpvar_62 = xlv_TEXCOORD0.xy; - highp vec2 tmpvar_63; - tmpvar_63 = tmpvar_62; - xlt_i_59.uv = tmpvar_63; - highp vec3 tmpvar_64; - tmpvar_64 = xlv_TEXCOORD1.xyz; - highp vec3 tmpvar_65; - tmpvar_65 = tmpvar_64; - xlt_i_59.ray = tmpvar_65; - mediump vec4 tmpvar_66; - tmpvar_66 = xlat_main (xlt_i_59); - mediump vec4 tmpvar_67; - tmpvar_67 = tmpvar_66; - xl_retval_60 = tmpvar_67; - mediump vec4 tmpvar_68; - tmpvar_68 = xl_retval_60.xyzw; - mediump vec4 tmpvar_69; - tmpvar_69 = tmpvar_68; - gl_FragData[0] = tmpvar_69; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-out.txt b/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-out.txt index 3aff1f667..4838ce8ff 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-out.txt @@ -16,17 +16,17 @@ void main () vec4 tmpvar_3; tmpvar_3.w = 1.0; tmpvar_3.xyz = (gl_TexCoord[1].xyz * tmpvar_2); - vec4 tmpvar_4; - tmpvar_4 = (vec4(greaterThanEqual (tmpvar_3.zzzz, _LightSplitsNear)) * vec4(lessThan (tmpvar_3.zzzz, _LightSplitsFar))); + vec4 weights_4; + weights_4 = (vec4(greaterThanEqual (tmpvar_3.zzzz, _LightSplitsNear)) * vec4(lessThan (tmpvar_3.zzzz, _LightSplitsFar))); vec4 tmpvar_5; tmpvar_5.w = 1.0; tmpvar_5.xyz = ((( - ((_View2Shadow * tmpvar_3).xyz * tmpvar_4.x) + ((_View2Shadow * tmpvar_3).xyz * weights_4.x) + - ((_View2Shadow1 * tmpvar_3).xyz * tmpvar_4.y) + ((_View2Shadow1 * tmpvar_3).xyz * weights_4.y) ) + ( (_View2Shadow2 * tmpvar_3) - .xyz * tmpvar_4.z)) + ((_View2Shadow3 * tmpvar_3).xyz * tmpvar_4.w)); + .xyz * weights_4.z)) + ((_View2Shadow3 * tmpvar_3).xyz * weights_4.w)); vec4 tmpvar_6; tmpvar_6 = texture2D (_ShadowMapTexture, tmpvar_5.xy); float tmpvar_7; @@ -38,8 +38,9 @@ void main () res_1.x = tmpvar_7; res_1.y = 1.0; vec2 enc_8; + enc_8 = (vec2(1.0, 255.0) * (1.0 - tmpvar_2)); vec2 tmpvar_9; - tmpvar_9 = fract((vec2(1.0, 255.0) * (1.0 - tmpvar_2))); + tmpvar_9 = fract(enc_8); enc_8.y = tmpvar_9.y; enc_8.x = (tmpvar_9.x - (tmpvar_9.y * 0.00392157)); res_1.zw = enc_8; @@ -47,4 +48,18 @@ void main () } -// inputs: 1, stats: 30 alu 2 tex 1 flow +// stats: 30 alu 2 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [2] loc 4 +// uniforms: 8 (total size: 0) +// #0: _LightShadowData (high float) 4x1 [-1] +// #1: _LightSplitsFar (high float) 4x1 [-1] +// #2: _LightSplitsNear (high float) 4x1 [-1] +// #3: _View2Shadow (high float) 4x4 [-1] +// #4: _View2Shadow1 (high float) 4x4 [-1] +// #5: _View2Shadow2 (high float) 4x4 [-1] +// #6: _View2Shadow3 (high float) 4x4 [-1] +// #7: _ZBufferParams (high float) 4x1 [-1] +// textures: 2 +// #0: _CameraDepthTexture (high 2d) 0x0 [-1] +// #1: _ShadowMapTexture (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES.txt index 1d143ff1e..17c994951 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES.txt @@ -15,9 +15,9 @@ void main () mediump vec4 tmpvar_1; highp vec4 res_2; highp float depth_3; - lowp float tmpvar_4; - tmpvar_4 = texture2D (_CameraDepthTexture, xlv_TEXCOORD0).x; - depth_3 = tmpvar_4; + lowp vec4 tmpvar_4; + tmpvar_4 = texture2D (_CameraDepthTexture, xlv_TEXCOORD0); + depth_3 = tmpvar_4.x; highp float tmpvar_5; tmpvar_5 = (1.0/(((_ZBufferParams.x * depth_3) + _ZBufferParams.y))); depth_3 = tmpvar_5; @@ -25,29 +25,29 @@ void main () tmpvar_6.w = 1.0; tmpvar_6.xyz = (xlv_TEXCOORD1 * tmpvar_5); mediump float shadow_7; - highp vec4 far_8; - highp vec4 near_9; - bvec4 tmpvar_10; - tmpvar_10 = greaterThanEqual (tmpvar_6.zzzz, _LightSplitsNear); - lowp vec4 tmpvar_11; - tmpvar_11 = vec4(tmpvar_10); - near_9 = tmpvar_11; - bvec4 tmpvar_12; - tmpvar_12 = lessThan (tmpvar_6.zzzz, _LightSplitsFar); - lowp vec4 tmpvar_13; - tmpvar_13 = vec4(tmpvar_12); - far_8 = tmpvar_13; - highp vec4 tmpvar_14; - tmpvar_14 = (near_9 * far_8); + highp vec4 weights_8; + highp vec4 far_9; + highp vec4 near_10; + bvec4 tmpvar_11; + tmpvar_11 = greaterThanEqual (tmpvar_6.zzzz, _LightSplitsNear); + lowp vec4 tmpvar_12; + tmpvar_12 = vec4(tmpvar_11); + near_10 = tmpvar_12; + bvec4 tmpvar_13; + tmpvar_13 = lessThan (tmpvar_6.zzzz, _LightSplitsFar); + lowp vec4 tmpvar_14; + tmpvar_14 = vec4(tmpvar_13); + far_9 = tmpvar_14; + weights_8 = (near_10 * far_9); highp vec4 tmpvar_15; tmpvar_15.w = 1.0; tmpvar_15.xyz = ((( - ((_View2Shadow * tmpvar_6).xyz * tmpvar_14.x) + ((_View2Shadow * tmpvar_6).xyz * weights_8.x) + - ((_View2Shadow1 * tmpvar_6).xyz * tmpvar_14.y) + ((_View2Shadow1 * tmpvar_6).xyz * weights_8.y) ) + ( (_View2Shadow2 * tmpvar_6) - .xyz * tmpvar_14.z)) + ((_View2Shadow3 * tmpvar_6).xyz * tmpvar_14.w)); + .xyz * weights_8.z)) + ((_View2Shadow3 * tmpvar_6).xyz * weights_8.w)); lowp vec4 tmpvar_16; tmpvar_16 = texture2D (_ShadowMapTexture, tmpvar_15.xy); highp float tmpvar_17; @@ -60,8 +60,9 @@ void main () res_2.x = shadow_7; res_2.y = 1.0; highp vec2 enc_18; + enc_18 = (vec2(1.0, 255.0) * (1.0 - tmpvar_5)); highp vec2 tmpvar_19; - tmpvar_19 = fract((vec2(1.0, 255.0) * (1.0 - tmpvar_5))); + tmpvar_19 = fract(enc_18); enc_18.y = tmpvar_19.y; enc_18.x = (tmpvar_19.x - (tmpvar_19.y * 0.00392157)); res_2.zw = enc_18; @@ -70,4 +71,19 @@ void main () } -// inputs: 2, stats: 30 alu 2 tex 1 flow +// stats: 30 alu 2 tex 1 flow +// inputs: 2 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// #1: xlv_TEXCOORD1 (high float) 3x1 [-1] +// uniforms: 8 (total size: 0) +// #0: _LightShadowData (high float) 4x1 [-1] +// #1: _LightSplitsFar (high float) 4x1 [-1] +// #2: _LightSplitsNear (high float) 4x1 [-1] +// #3: _View2Shadow (high float) 4x4 [-1] +// #4: _View2Shadow1 (high float) 4x4 [-1] +// #5: _View2Shadow2 (high float) 4x4 [-1] +// #6: _View2Shadow3 (high float) 4x4 [-1] +// #7: _ZBufferParams (high float) 4x1 [-1] +// textures: 2 +// #0: _CameraDepthTexture (low 2d) 0x0 [-1] +// #1: _ShadowMapTexture (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES3.txt new file mode 100644 index 000000000..46be5e4c8 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES3.txt @@ -0,0 +1,91 @@ +#version 300 es +uniform sampler2D _CameraDepthTexture; +uniform highp vec4 _LightShadowData; +uniform highp vec4 _LightSplitsFar; +uniform highp vec4 _LightSplitsNear; +uniform sampler2D _ShadowMapTexture; +uniform highp mat4 _View2Shadow; +uniform highp mat4 _View2Shadow1; +uniform highp mat4 _View2Shadow2; +uniform highp mat4 _View2Shadow3; +uniform highp vec4 _ZBufferParams; +in highp vec2 xlv_TEXCOORD0; +in highp vec3 xlv_TEXCOORD1; +out mediump vec4 _fragData; +void main () +{ + mediump vec4 tmpvar_1; + highp vec4 res_2; + highp float depth_3; + lowp vec4 tmpvar_4; + tmpvar_4 = texture (_CameraDepthTexture, xlv_TEXCOORD0); + depth_3 = tmpvar_4.x; + highp float tmpvar_5; + tmpvar_5 = (1.0/(((_ZBufferParams.x * depth_3) + _ZBufferParams.y))); + depth_3 = tmpvar_5; + highp vec4 tmpvar_6; + tmpvar_6.w = 1.0; + tmpvar_6.xyz = (xlv_TEXCOORD1 * tmpvar_5); + mediump float shadow_7; + highp vec4 weights_8; + highp vec4 far_9; + highp vec4 near_10; + bvec4 tmpvar_11; + tmpvar_11 = greaterThanEqual (tmpvar_6.zzzz, _LightSplitsNear); + lowp vec4 tmpvar_12; + tmpvar_12 = vec4(tmpvar_11); + near_10 = tmpvar_12; + bvec4 tmpvar_13; + tmpvar_13 = lessThan (tmpvar_6.zzzz, _LightSplitsFar); + lowp vec4 tmpvar_14; + tmpvar_14 = vec4(tmpvar_13); + far_9 = tmpvar_14; + weights_8 = (near_10 * far_9); + highp vec4 tmpvar_15; + tmpvar_15.w = 1.0; + tmpvar_15.xyz = ((( + ((_View2Shadow * tmpvar_6).xyz * weights_8.x) + + + ((_View2Shadow1 * tmpvar_6).xyz * weights_8.y) + ) + ( + (_View2Shadow2 * tmpvar_6) + .xyz * weights_8.z)) + ((_View2Shadow3 * tmpvar_6).xyz * weights_8.w)); + lowp vec4 tmpvar_16; + tmpvar_16 = texture (_ShadowMapTexture, tmpvar_15.xy); + highp float tmpvar_17; + if ((tmpvar_16.x < tmpvar_15.z)) { + tmpvar_17 = _LightShadowData.x; + } else { + tmpvar_17 = 1.0; + }; + shadow_7 = tmpvar_17; + res_2.x = shadow_7; + res_2.y = 1.0; + highp vec2 enc_18; + enc_18 = (vec2(1.0, 255.0) * (1.0 - tmpvar_5)); + highp vec2 tmpvar_19; + tmpvar_19 = fract(enc_18); + enc_18.y = tmpvar_19.y; + enc_18.x = (tmpvar_19.x - (tmpvar_19.y * 0.00392157)); + res_2.zw = enc_18; + tmpvar_1 = res_2; + _fragData = tmpvar_1; +} + + +// stats: 30 alu 2 tex 1 flow +// inputs: 2 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// #1: xlv_TEXCOORD1 (high float) 3x1 [-1] +// uniforms: 8 (total size: 0) +// #0: _LightShadowData (high float) 4x1 [-1] +// #1: _LightSplitsFar (high float) 4x1 [-1] +// #2: _LightSplitsNear (high float) 4x1 [-1] +// #3: _View2Shadow (high float) 4x4 [-1] +// #4: _View2Shadow1 (high float) 4x4 [-1] +// #5: _View2Shadow2 (high float) 4x4 [-1] +// #6: _View2Shadow3 (high float) 4x4 [-1] +// #7: _ZBufferParams (high float) 4x1 [-1] +// textures: 2 +// #0: _CameraDepthTexture (low 2d) 0x0 [-1] +// #1: _ShadowMapTexture (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES3Metal.txt new file mode 100644 index 000000000..39ecc3691 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES3Metal.txt @@ -0,0 +1,100 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float2 xlv_TEXCOORD0; + float3 xlv_TEXCOORD1; +}; +struct xlatMtlShaderOutput { + half4 _fragData [[color(0)]]; +}; +struct xlatMtlShaderUniform { + float4 _LightShadowData; + float4 _LightSplitsFar; + float4 _LightSplitsNear; + float4x4 _View2Shadow; + float4x4 _View2Shadow1; + float4x4 _View2Shadow2; + float4x4 _View2Shadow3; + float4 _ZBufferParams; +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , texture2d _CameraDepthTexture [[texture(0)]], sampler _mtlsmp__CameraDepthTexture [[sampler(0)]] + , texture2d _ShadowMapTexture [[texture(1)]], sampler _mtlsmp__ShadowMapTexture [[sampler(1)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 tmpvar_1; + float4 res_2; + float depth_3; + half4 tmpvar_4; + tmpvar_4 = _CameraDepthTexture.sample(_mtlsmp__CameraDepthTexture, (float2)(_mtl_i.xlv_TEXCOORD0)); + depth_3 = float(tmpvar_4.x); + float tmpvar_5; + tmpvar_5 = (1.0/(((_mtl_u._ZBufferParams.x * depth_3) + _mtl_u._ZBufferParams.y))); + depth_3 = tmpvar_5; + float4 tmpvar_6; + tmpvar_6.w = 1.0; + tmpvar_6.xyz = (_mtl_i.xlv_TEXCOORD1 * tmpvar_5); + half shadow_7; + float4 weights_8; + float4 far_9; + float4 near_10; + bool4 tmpvar_11; + tmpvar_11 = bool4((tmpvar_6.zzzz >= _mtl_u._LightSplitsNear)); + half4 tmpvar_12; + tmpvar_12 = half4(tmpvar_11); + near_10 = float4(tmpvar_12); + bool4 tmpvar_13; + tmpvar_13 = bool4((tmpvar_6.zzzz < _mtl_u._LightSplitsFar)); + half4 tmpvar_14; + tmpvar_14 = half4(tmpvar_13); + far_9 = float4(tmpvar_14); + weights_8 = (near_10 * far_9); + float4 tmpvar_15; + tmpvar_15.w = 1.0; + tmpvar_15.xyz = ((( + ((_mtl_u._View2Shadow * tmpvar_6).xyz * weights_8.x) + + + ((_mtl_u._View2Shadow1 * tmpvar_6).xyz * weights_8.y) + ) + ( + (_mtl_u._View2Shadow2 * tmpvar_6) + .xyz * weights_8.z)) + ((_mtl_u._View2Shadow3 * tmpvar_6).xyz * weights_8.w)); + half4 tmpvar_16; + tmpvar_16 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float2)(tmpvar_15.xy)); + float tmpvar_17; + if (((float)tmpvar_16.x < tmpvar_15.z)) { + tmpvar_17 = _mtl_u._LightShadowData.x; + } else { + tmpvar_17 = 1.0; + }; + shadow_7 = half(tmpvar_17); + res_2.x = float(shadow_7); + res_2.y = 1.0; + float2 enc_18; + enc_18 = (float2(1.0, 255.0) * (1.0 - tmpvar_5)); + float2 tmpvar_19; + tmpvar_19 = fract(enc_18); + enc_18.y = tmpvar_19.y; + enc_18.x = (tmpvar_19.x - (tmpvar_19.y * 0.00392157)); + res_2.zw = enc_18; + tmpvar_1 = half4(res_2); + _mtl_o._fragData = tmpvar_1; + return _mtl_o; +} + + +// stats: 30 alu 2 tex 1 flow +// inputs: 2 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// #1: xlv_TEXCOORD1 (high float) 3x1 [-1] +// uniforms: 8 (total size: 320) +// #0: _LightShadowData (high float) 4x1 [-1] loc 0 +// #1: _LightSplitsFar (high float) 4x1 [-1] loc 16 +// #2: _LightSplitsNear (high float) 4x1 [-1] loc 32 +// #3: _View2Shadow (high float) 4x4 [-1] loc 48 +// #4: _View2Shadow1 (high float) 4x4 [-1] loc 112 +// #5: _View2Shadow2 (high float) 4x4 [-1] loc 176 +// #6: _View2Shadow3 (high float) 4x4 [-1] loc 240 +// #7: _ZBufferParams (high float) 4x1 [-1] loc 304 +// textures: 2 +// #0: _CameraDepthTexture (low 2d) 0x0 [-1] loc 0 +// #1: _ShadowMapTexture (low 2d) 0x0 [-1] loc 1 diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-flare-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/z-flare-ir.txt deleted file mode 100644 index 7e498cb94..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/z-flare-ir.txt +++ /dev/null @@ -1,30 +0,0 @@ -uniform sampler2D _FlareTexture; -vec4 xlat_main ( - in vec4 color_1, - in vec2 texcoord_2 -) -{ - vec4 tmpvar_3; - tmpvar_3 = texture2D (_FlareTexture, texcoord_2); - return (tmpvar_3 * color_1); -} - -void main () -{ - vec4 xl_retval_4; - vec4 tmpvar_5; - tmpvar_5 = gl_Color.xyzw; - vec2 tmpvar_6; - tmpvar_6 = gl_TexCoord[0].xy; - vec4 tmpvar_7; - tmpvar_7 = xlat_main (tmpvar_5, tmpvar_6); - vec4 tmpvar_8; - tmpvar_8 = tmpvar_7; - xl_retval_4 = tmpvar_8; - vec4 tmpvar_9; - tmpvar_9 = xl_retval_4.xyzw; - vec4 tmpvar_10; - tmpvar_10 = tmpvar_9; - gl_FragData[0] = tmpvar_10; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-flare-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-flare-irES.txt deleted file mode 100644 index 08dba66de..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/z-flare-irES.txt +++ /dev/null @@ -1,32 +0,0 @@ -uniform sampler2D _FlareTexture; -varying lowp vec4 xlv_COLOR; -varying highp vec2 xlv_TEXCOORD0; -lowp vec4 xlat_main ( - in lowp vec4 color_1, - in highp vec2 texcoord_2 -) -{ - lowp vec4 tmpvar_3; - tmpvar_3 = texture2D (_FlareTexture, texcoord_2); - return (tmpvar_3 * color_1); -} - -void main () -{ - lowp vec4 xl_retval_4; - lowp vec4 tmpvar_5; - tmpvar_5 = xlv_COLOR.xyzw; - highp vec2 tmpvar_6; - tmpvar_6 = xlv_TEXCOORD0.xy; - lowp vec4 tmpvar_7; - tmpvar_7 = xlat_main (tmpvar_5, tmpvar_6); - lowp vec4 tmpvar_8; - tmpvar_8 = tmpvar_7; - xl_retval_4 = tmpvar_8; - lowp vec4 tmpvar_9; - tmpvar_9 = xl_retval_4.xyzw; - lowp vec4 tmpvar_10; - tmpvar_10 = tmpvar_9; - gl_FragData[0] = tmpvar_10; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-flare-out.txt b/3rdparty/glsl-optimizer/tests/fragment/z-flare-out.txt index 913b3f085..7e8e2e5f2 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-flare-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-flare-out.txt @@ -5,4 +5,9 @@ void main () } -// inputs: 2, stats: 1 alu 1 tex 0 flow +// stats: 1 alu 1 tex 0 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [1] loc 4 +// textures: 1 +// #0: _FlareTexture (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-flare-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-flare-outES.txt index 2b10bd0c2..c6de169ce 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-flare-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-flare-outES.txt @@ -9,4 +9,9 @@ void main () } -// inputs: 2, stats: 1 alu 1 tex 0 flow +// stats: 1 alu 1 tex 0 flow +// inputs: 2 +// #0: xlv_COLOR (low float) 4x1 [-1] +// #1: xlv_TEXCOORD0 (high float) 2x1 [-1] +// textures: 1 +// #0: _FlareTexture (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-ir.txt deleted file mode 100644 index b0411dcef..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-ir.txt +++ /dev/null @@ -1,623 +0,0 @@ -#extension GL_ARB_shader_texture_lod : enable -uniform sampler2D _MainTex; -uniform vec4 _MainTex_TexelSize; -varying vec2 xlv_TEXCOORD0; -vec4 xll_tex2Dlod ( - in sampler2D s_1, - in vec4 coord_2 -) -{ - vec4 tmpvar_3; - tmpvar_3 = texture2DLod (s_1, coord_2.xy, coord_2.w); - return tmpvar_3; -} - -vec4 xll_tex2Dgrad ( - in sampler2D s_4, - in vec2 coord_5, - in vec2 ddx_6, - in vec2 ddy_7 -) -{ - vec4 tmpvar_8; - tmpvar_8 = texture2DGradARB (s_4, coord_5, ddx_6, ddy_7); - return tmpvar_8; -} - -vec4 FxaaTexOff ( - in sampler2D tex_9, - in vec2 pos_10, - in vec2 off_11, - in vec2 rcpFrame_12 -) -{ - vec4 tmpvar_13; - tmpvar_13.zw = vec2(0.0, 0.0); - tmpvar_13.xy = (pos_10.xy + (off_11 * rcpFrame_12)).xy; - vec4 tmpvar_14; - tmpvar_14 = xll_tex2Dlod (tex_9, tmpvar_13); - return tmpvar_14; -} - -vec4 FxaaTexLod0 ( - in sampler2D tex_15, - in vec2 pos_16 -) -{ - vec4 tmpvar_17; - tmpvar_17.zw = vec2(0.0, 0.0); - tmpvar_17.xy = pos_16.xy.xy; - vec4 tmpvar_18; - tmpvar_18 = xll_tex2Dlod (tex_15, tmpvar_17); - return tmpvar_18; -} - -vec4 FxaaTexGrad ( - in sampler2D tex_19, - in vec2 pos_20, - in vec2 grad_21 -) -{ - vec4 tmpvar_22; - tmpvar_22 = xll_tex2Dgrad (tex_19, pos_20.xy, grad_21, grad_21); - return tmpvar_22; -} - -float FxaaLuma ( - in vec3 rgb_23 -) -{ - return ((rgb_23.y * 1.96321) + rgb_23.x); -} - -vec3 FxaaLerp3 ( - in vec3 a_24, - in vec3 b_25, - in float amountOfA_26 -) -{ - vec3 tmpvar_27; - tmpvar_27.x = -(amountOfA_26); - tmpvar_27.y = -(amountOfA_26); - tmpvar_27.z = -(amountOfA_26); - vec3 tmpvar_28; - tmpvar_28.x = amountOfA_26; - tmpvar_28.y = amountOfA_26; - tmpvar_28.z = amountOfA_26; - return ((tmpvar_27 * b_25) + ((a_24 * tmpvar_28) + b_25)); -} - -vec3 FxaaFilterReturn ( - in vec3 rgb_29 -) -{ - return rgb_29; -} - -vec3 FxaaPixelShader ( - in vec2 pos_30, - in sampler2D tex_31, - in vec2 rcpFrame_32 -) -{ - vec3 rgbF_33; - float subPixelOffset_34; - float spanLength_35; - bool directionN_36; - float dstP_37; - float dstN_38; - int i_39; - bool doneP_40; - bool doneN_41; - float lumaEndP_42; - float lumaEndN_43; - vec2 offNP_44; - vec2 posP_45; - vec2 posN_46; - bool pairN_47; - float gradientS_48; - float gradientN_49; - float lengthSign_50; - bool horzSpan_51; - float edgeHorz_52; - float edgeVert_53; - float lumaSE_54; - float lumaSW_55; - float lumaNE_56; - float lumaNW_57; - vec3 rgbSE_58; - vec3 rgbSW_59; - vec3 rgbNE_60; - vec3 rgbNW_61; - float blendL_62; - float rangeL_63; - float lumaL_64; - vec3 rgbL_65; - float range_66; - float rangeMax_67; - float rangeMin_68; - float lumaS_69; - float lumaE_70; - float lumaM_71; - float lumaW_72; - float lumaN_73; - vec3 rgbS_74; - vec3 rgbE_75; - vec3 rgbM_76; - vec3 rgbW_77; - vec3 rgbN_78; - bool tmpvar_79; - tmpvar_79 = bool(0); - doneN_41 = tmpvar_79; - bool tmpvar_80; - tmpvar_80 = bool(0); - doneP_40 = tmpvar_80; - int tmpvar_81; - tmpvar_81 = 0; - i_39 = tmpvar_81; - vec4 tmpvar_82; - tmpvar_82 = FxaaTexOff (tex_31, pos_30.xy, vec2(0.0, -1.0), rcpFrame_32); - vec3 tmpvar_83; - tmpvar_83 = tmpvar_82.xyz; - rgbN_78 = tmpvar_83; - vec4 tmpvar_84; - tmpvar_84 = FxaaTexOff (tex_31, pos_30.xy, vec2(-1.0, 0.0), rcpFrame_32); - vec3 tmpvar_85; - tmpvar_85 = tmpvar_84.xyz; - rgbW_77 = tmpvar_85; - vec4 tmpvar_86; - tmpvar_86 = FxaaTexOff (tex_31, pos_30.xy, vec2(0.0, 0.0), rcpFrame_32); - vec3 tmpvar_87; - tmpvar_87 = tmpvar_86.xyz; - rgbM_76 = tmpvar_87; - vec4 tmpvar_88; - tmpvar_88 = FxaaTexOff (tex_31, pos_30.xy, vec2(1.0, 0.0), rcpFrame_32); - vec3 tmpvar_89; - tmpvar_89 = tmpvar_88.xyz; - rgbE_75 = tmpvar_89; - vec4 tmpvar_90; - tmpvar_90 = FxaaTexOff (tex_31, pos_30.xy, vec2(0.0, 1.0), rcpFrame_32); - vec3 tmpvar_91; - tmpvar_91 = tmpvar_90.xyz; - rgbS_74 = tmpvar_91; - float tmpvar_92; - tmpvar_92 = FxaaLuma (rgbN_78); - float tmpvar_93; - tmpvar_93 = tmpvar_92; - lumaN_73 = tmpvar_93; - float tmpvar_94; - tmpvar_94 = FxaaLuma (rgbW_77); - float tmpvar_95; - tmpvar_95 = tmpvar_94; - lumaW_72 = tmpvar_95; - float tmpvar_96; - tmpvar_96 = FxaaLuma (rgbM_76); - float tmpvar_97; - tmpvar_97 = tmpvar_96; - lumaM_71 = tmpvar_97; - float tmpvar_98; - tmpvar_98 = FxaaLuma (rgbE_75); - float tmpvar_99; - tmpvar_99 = tmpvar_98; - lumaE_70 = tmpvar_99; - float tmpvar_100; - tmpvar_100 = FxaaLuma (rgbS_74); - float tmpvar_101; - tmpvar_101 = tmpvar_100; - lumaS_69 = tmpvar_101; - float tmpvar_102; - tmpvar_102 = min (lumaN_73, lumaW_72); - float tmpvar_103; - tmpvar_103 = min (lumaS_69, lumaE_70); - float tmpvar_104; - tmpvar_104 = min (tmpvar_102, tmpvar_103); - float tmpvar_105; - tmpvar_105 = min (lumaM_71, tmpvar_104); - float tmpvar_106; - tmpvar_106 = tmpvar_105; - rangeMin_68 = tmpvar_106; - float tmpvar_107; - tmpvar_107 = max (lumaN_73, lumaW_72); - float tmpvar_108; - tmpvar_108 = max (lumaS_69, lumaE_70); - float tmpvar_109; - tmpvar_109 = max (tmpvar_107, tmpvar_108); - float tmpvar_110; - tmpvar_110 = max (lumaM_71, tmpvar_109); - float tmpvar_111; - tmpvar_111 = tmpvar_110; - rangeMax_67 = tmpvar_111; - float tmpvar_112; - tmpvar_112 = (rangeMax_67 - rangeMin_68); - range_66 = tmpvar_112; - float tmpvar_113; - tmpvar_113 = max (0.0625, (rangeMax_67 * 0.125)); - if ((range_66 < tmpvar_113)) { - vec3 tmpvar_114; - tmpvar_114 = FxaaFilterReturn (rgbM_76); - return tmpvar_114; - }; - vec3 tmpvar_115; - tmpvar_115 = ((( - (rgbN_78 + rgbW_77) - + rgbM_76) + rgbE_75) + rgbS_74); - rgbL_65 = tmpvar_115; - float tmpvar_116; - tmpvar_116 = ((( - (lumaN_73 + lumaW_72) - + lumaE_70) + lumaS_69) * 0.25); - lumaL_64 = tmpvar_116; - float tmpvar_117; - tmpvar_117 = abs ((lumaL_64 - lumaM_71)); - float tmpvar_118; - tmpvar_118 = tmpvar_117; - rangeL_63 = tmpvar_118; - float tmpvar_119; - tmpvar_119 = max (0.0, ((rangeL_63 / range_66) - 0.25)); - float tmpvar_120; - tmpvar_120 = (tmpvar_119 * 1.33333); - blendL_62 = tmpvar_120; - float tmpvar_121; - tmpvar_121 = min (0.75, blendL_62); - float tmpvar_122; - tmpvar_122 = tmpvar_121; - blendL_62 = tmpvar_122; - vec4 tmpvar_123; - tmpvar_123 = FxaaTexOff (tex_31, pos_30.xy, vec2(-1.0, -1.0), rcpFrame_32); - vec3 tmpvar_124; - tmpvar_124 = tmpvar_123.xyz; - rgbNW_61 = tmpvar_124; - vec4 tmpvar_125; - tmpvar_125 = FxaaTexOff (tex_31, pos_30.xy, vec2(1.0, -1.0), rcpFrame_32); - vec3 tmpvar_126; - tmpvar_126 = tmpvar_125.xyz; - rgbNE_60 = tmpvar_126; - vec4 tmpvar_127; - tmpvar_127 = FxaaTexOff (tex_31, pos_30.xy, vec2(-1.0, 1.0), rcpFrame_32); - vec3 tmpvar_128; - tmpvar_128 = tmpvar_127.xyz; - rgbSW_59 = tmpvar_128; - vec4 tmpvar_129; - tmpvar_129 = FxaaTexOff (tex_31, pos_30.xy, vec2(1.0, 1.0), rcpFrame_32); - vec3 tmpvar_130; - tmpvar_130 = tmpvar_129.xyz; - rgbSE_58 = tmpvar_130; - vec3 tmpvar_131; - tmpvar_131 = (rgbL_65 + (( - (rgbNW_61 + rgbNE_60) - + rgbSW_59) + rgbSE_58)); - rgbL_65 = tmpvar_131; - vec3 tmpvar_132; - tmpvar_132 = (rgbL_65 * vec3(0.111111, 0.111111, 0.111111)); - rgbL_65 = tmpvar_132; - float tmpvar_133; - tmpvar_133 = FxaaLuma (rgbNW_61); - float tmpvar_134; - tmpvar_134 = tmpvar_133; - lumaNW_57 = tmpvar_134; - float tmpvar_135; - tmpvar_135 = FxaaLuma (rgbNE_60); - float tmpvar_136; - tmpvar_136 = tmpvar_135; - lumaNE_56 = tmpvar_136; - float tmpvar_137; - tmpvar_137 = FxaaLuma (rgbSW_59); - float tmpvar_138; - tmpvar_138 = tmpvar_137; - lumaSW_55 = tmpvar_138; - float tmpvar_139; - tmpvar_139 = FxaaLuma (rgbSE_58); - float tmpvar_140; - tmpvar_140 = tmpvar_139; - lumaSE_54 = tmpvar_140; - float tmpvar_141; - tmpvar_141 = abs ((((0.25 * lumaNW_57) + ( - -(0.5) - * lumaN_73)) + (0.25 * lumaNE_56))); - float tmpvar_142; - tmpvar_142 = abs ((((0.5 * lumaW_72) + ( - -(1.0) - * lumaM_71)) + (0.5 * lumaE_70))); - float tmpvar_143; - tmpvar_143 = abs ((((0.25 * lumaSW_55) + ( - -(0.5) - * lumaS_69)) + (0.25 * lumaSE_54))); - float tmpvar_144; - tmpvar_144 = ((tmpvar_141 + tmpvar_142) + tmpvar_143); - edgeVert_53 = tmpvar_144; - float tmpvar_145; - tmpvar_145 = abs ((((0.25 * lumaNW_57) + ( - -(0.5) - * lumaW_72)) + (0.25 * lumaSW_55))); - float tmpvar_146; - tmpvar_146 = abs ((((0.5 * lumaN_73) + ( - -(1.0) - * lumaM_71)) + (0.5 * lumaS_69))); - float tmpvar_147; - tmpvar_147 = abs ((((0.25 * lumaNE_56) + ( - -(0.5) - * lumaE_70)) + (0.25 * lumaSE_54))); - float tmpvar_148; - tmpvar_148 = ((tmpvar_145 + tmpvar_146) + tmpvar_147); - edgeHorz_52 = tmpvar_148; - bool tmpvar_149; - tmpvar_149 = (edgeHorz_52 >= edgeVert_53); - horzSpan_51 = tmpvar_149; - float tmpvar_150; - if (horzSpan_51) { - tmpvar_150 = -(rcpFrame_32.y); - } else { - tmpvar_150 = -(rcpFrame_32.x); - }; - float tmpvar_151; - tmpvar_151 = tmpvar_150; - lengthSign_50 = tmpvar_151; - if (!(horzSpan_51)) { - float tmpvar_152; - tmpvar_152 = lumaW_72; - lumaN_73 = tmpvar_152; - }; - if (!(horzSpan_51)) { - float tmpvar_153; - tmpvar_153 = lumaE_70; - lumaS_69 = tmpvar_153; - }; - float tmpvar_154; - tmpvar_154 = abs ((lumaN_73 - lumaM_71)); - float tmpvar_155; - tmpvar_155 = tmpvar_154; - gradientN_49 = tmpvar_155; - float tmpvar_156; - tmpvar_156 = abs ((lumaS_69 - lumaM_71)); - float tmpvar_157; - tmpvar_157 = tmpvar_156; - gradientS_48 = tmpvar_157; - float tmpvar_158; - tmpvar_158 = ((lumaN_73 + lumaM_71) * 0.5); - lumaN_73 = tmpvar_158; - float tmpvar_159; - tmpvar_159 = ((lumaS_69 + lumaM_71) * 0.5); - lumaS_69 = tmpvar_159; - bool tmpvar_160; - tmpvar_160 = (gradientN_49 >= gradientS_48); - pairN_47 = tmpvar_160; - if (!(pairN_47)) { - float tmpvar_161; - tmpvar_161 = lumaS_69; - lumaN_73 = tmpvar_161; - }; - if (!(pairN_47)) { - float tmpvar_162; - tmpvar_162 = gradientS_48; - gradientN_49 = tmpvar_162; - }; - if (!(pairN_47)) { - float tmpvar_163; - tmpvar_163 = (lengthSign_50 * -(1.0)); - lengthSign_50 = tmpvar_163; - }; - float tmpvar_164; - if (horzSpan_51) { - tmpvar_164 = 0.0; - } else { - tmpvar_164 = (lengthSign_50 * 0.5); - }; - float tmpvar_165; - tmpvar_165 = (pos_30.x + tmpvar_164); - posN_46.x = tmpvar_165; - float tmpvar_166; - if (horzSpan_51) { - tmpvar_166 = (lengthSign_50 * 0.5); - } else { - tmpvar_166 = 0.0; - }; - float tmpvar_167; - tmpvar_167 = (pos_30.y + tmpvar_166); - posN_46.y = vec2(tmpvar_167).y; - float tmpvar_168; - tmpvar_168 = (gradientN_49 * 0.25); - gradientN_49 = tmpvar_168; - vec2 tmpvar_169; - tmpvar_169 = posN_46; - posP_45 = tmpvar_169; - vec2 tmpvar_170; - if (horzSpan_51) { - vec2 tmpvar_171; - tmpvar_171.y = 0.0; - tmpvar_171.x = rcpFrame_32.x; - tmpvar_170 = tmpvar_171; - } else { - vec2 tmpvar_172; - tmpvar_172.x = 0.0; - tmpvar_172.y = rcpFrame_32.y; - tmpvar_170 = tmpvar_172; - }; - vec2 tmpvar_173; - tmpvar_173 = tmpvar_170; - offNP_44 = tmpvar_173; - float tmpvar_174; - tmpvar_174 = lumaN_73; - lumaEndN_43 = tmpvar_174; - float tmpvar_175; - tmpvar_175 = lumaN_73; - lumaEndP_42 = tmpvar_175; - vec2 tmpvar_176; - tmpvar_176 = (posN_46 + (offNP_44 * vec2(-2.0, -2.0))); - posN_46 = tmpvar_176; - vec2 tmpvar_177; - tmpvar_177 = (posP_45 + (offNP_44 * vec2(2.0, 2.0))); - posP_45 = tmpvar_177; - vec2 tmpvar_178; - tmpvar_178 = (offNP_44 * vec2(3.0, 3.0)); - offNP_44 = tmpvar_178; - while (true) { - if (!((i_39 < 4))) { - break; - }; - if (!(doneN_41)) { - vec4 tmpvar_179; - tmpvar_179 = FxaaTexGrad (tex_31, posN_46.xy, offNP_44); - float tmpvar_180; - tmpvar_180 = FxaaLuma (tmpvar_179.xyz); - float tmpvar_181; - tmpvar_181 = tmpvar_180; - lumaEndN_43 = tmpvar_181; - }; - if (!(doneP_40)) { - vec4 tmpvar_182; - tmpvar_182 = FxaaTexGrad (tex_31, posP_45.xy, offNP_44); - float tmpvar_183; - tmpvar_183 = FxaaLuma (tmpvar_182.xyz); - float tmpvar_184; - tmpvar_184 = tmpvar_183; - lumaEndP_42 = tmpvar_184; - }; - bool tmpvar_185; - if (doneN_41) { - tmpvar_185 = bool(1); - } else { - float tmpvar_186; - tmpvar_186 = abs ((lumaEndN_43 - lumaN_73)); - tmpvar_185 = (tmpvar_186 >= gradientN_49); - }; - bool tmpvar_187; - tmpvar_187 = tmpvar_185; - doneN_41 = tmpvar_187; - bool tmpvar_188; - if (doneP_40) { - tmpvar_188 = bool(1); - } else { - float tmpvar_189; - tmpvar_189 = abs ((lumaEndP_42 - lumaN_73)); - tmpvar_188 = (tmpvar_189 >= gradientN_49); - }; - bool tmpvar_190; - tmpvar_190 = tmpvar_188; - doneP_40 = tmpvar_190; - if ((doneN_41 && doneP_40)) { - break; - }; - if (!(doneN_41)) { - vec2 tmpvar_191; - tmpvar_191 = (posN_46 - offNP_44); - posN_46 = tmpvar_191; - }; - if (!(doneP_40)) { - vec2 tmpvar_192; - tmpvar_192 = (posP_45 + offNP_44); - posP_45 = tmpvar_192; - }; - int _post_incdec_tmp_193; - _post_incdec_tmp_193 = i_39; - int tmpvar_194; - tmpvar_194 = (i_39 + 1); - i_39 = tmpvar_194; - }; - float tmpvar_195; - if (horzSpan_51) { - tmpvar_195 = (pos_30.x - posN_46.x); - } else { - tmpvar_195 = (pos_30.y - posN_46.y); - }; - float tmpvar_196; - tmpvar_196 = tmpvar_195; - dstN_38 = tmpvar_196; - float tmpvar_197; - if (horzSpan_51) { - tmpvar_197 = (posP_45.x - pos_30.x); - } else { - tmpvar_197 = (posP_45.y - pos_30.y); - }; - float tmpvar_198; - tmpvar_198 = tmpvar_197; - dstP_37 = tmpvar_198; - bool tmpvar_199; - tmpvar_199 = (dstN_38 < dstP_37); - directionN_36 = tmpvar_199; - float tmpvar_200; - if (directionN_36) { - tmpvar_200 = lumaEndN_43; - } else { - tmpvar_200 = lumaEndP_42; - }; - float tmpvar_201; - tmpvar_201 = tmpvar_200; - lumaEndN_43 = tmpvar_201; - if ((((lumaM_71 - lumaN_73) < 0.0) == ((lumaEndN_43 - lumaN_73) < 0.0))) { - float tmpvar_202; - tmpvar_202 = 0.0; - lengthSign_50 = tmpvar_202; - }; - float tmpvar_203; - tmpvar_203 = (dstP_37 + dstN_38); - spanLength_35 = tmpvar_203; - float tmpvar_204; - if (directionN_36) { - tmpvar_204 = dstN_38; - } else { - tmpvar_204 = dstP_37; - }; - float tmpvar_205; - tmpvar_205 = tmpvar_204; - dstN_38 = tmpvar_205; - float tmpvar_206; - tmpvar_206 = ((0.5 + (dstN_38 * - (-(1.0) / spanLength_35) - )) * lengthSign_50); - subPixelOffset_34 = tmpvar_206; - float tmpvar_207; - if (horzSpan_51) { - tmpvar_207 = 0.0; - } else { - tmpvar_207 = subPixelOffset_34; - }; - float tmpvar_208; - if (horzSpan_51) { - tmpvar_208 = subPixelOffset_34; - } else { - tmpvar_208 = 0.0; - }; - vec2 tmpvar_209; - tmpvar_209.x = (pos_30.x + tmpvar_207); - tmpvar_209.y = (pos_30.y + tmpvar_208); - vec4 tmpvar_210; - tmpvar_210 = FxaaTexLod0 (tex_31, tmpvar_209); - vec3 tmpvar_211; - tmpvar_211 = tmpvar_210.xyz; - rgbF_33 = tmpvar_211; - vec3 tmpvar_212; - tmpvar_212 = FxaaLerp3 (rgbL_65, rgbF_33, blendL_62); - vec3 tmpvar_213; - tmpvar_213 = FxaaFilterReturn (tmpvar_212); - return tmpvar_213; -} - -vec4 xlat_main ( - in vec2 uv_214 -) -{ - vec3 tmpvar_215; - tmpvar_215 = FxaaPixelShader (uv_214.xy, _MainTex, _MainTex_TexelSize.xy); - vec4 tmpvar_216; - tmpvar_216.w = 0.0; - tmpvar_216.xyz = tmpvar_215.xyz.xyz; - return tmpvar_216; -} - -void main () -{ - vec4 xl_retval_217; - vec2 tmpvar_218; - tmpvar_218 = xlv_TEXCOORD0.xy; - vec4 tmpvar_219; - tmpvar_219 = xlat_main (tmpvar_218); - vec4 tmpvar_220; - tmpvar_220 = tmpvar_219; - xl_retval_217 = tmpvar_220; - vec4 tmpvar_221; - tmpvar_221 = xl_retval_217.xyzw; - vec4 tmpvar_222; - tmpvar_222 = tmpvar_221; - gl_FragData[0] = tmpvar_222; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-out.txt index 9e4ba45da..64f121683 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-out.txt @@ -7,266 +7,263 @@ void main () vec2 rcpFrame_1; rcpFrame_1 = _MainTex_TexelSize.xy; vec3 tmpvar_2; - bool doneP_4; - bool doneN_5; - float lumaEndP_6; - float lumaEndN_7; - vec2 offNP_8; - vec2 posP_9; - vec2 posN_10; - float gradientN_11; - float lengthSign_12; - float lumaS_13; - float lumaN_14; - doneN_5 = bool(0); - doneP_4 = bool(0); - vec4 tmpvar_15; - tmpvar_15.zw = vec2(0.0, 0.0); - tmpvar_15.xy = (xlv_TEXCOORD0 + (vec2(0.0, -1.0) * _MainTex_TexelSize.xy)); - vec4 tmpvar_16; - tmpvar_16 = texture2DLod (_MainTex, tmpvar_15.xy, 0.0); - vec4 tmpvar_17; - tmpvar_17.zw = vec2(0.0, 0.0); - tmpvar_17.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 0.0) * _MainTex_TexelSize.xy)); - vec4 tmpvar_18; - tmpvar_18 = texture2DLod (_MainTex, tmpvar_17.xy, 0.0); - vec4 tmpvar_19; - tmpvar_19 = texture2DLod (_MainTex, xlv_TEXCOORD0, 0.0); - vec4 tmpvar_20; - tmpvar_20.zw = vec2(0.0, 0.0); - tmpvar_20.xy = (xlv_TEXCOORD0 + (vec2(1.0, 0.0) * _MainTex_TexelSize.xy)); - vec4 tmpvar_21; - tmpvar_21 = texture2DLod (_MainTex, tmpvar_20.xy, 0.0); - vec4 tmpvar_22; - tmpvar_22.zw = vec2(0.0, 0.0); - tmpvar_22.xy = (xlv_TEXCOORD0 + (vec2(0.0, 1.0) * _MainTex_TexelSize.xy)); + float subPixelOffset_3; + float spanLength_4; + bool directionN_5; + bool doneP_7; + bool doneN_8; + float lumaEndP_9; + float lumaEndN_10; + vec2 offNP_11; + vec2 posP_12; + vec2 posN_13; + bool pairN_14; + float gradientN_15; + float lengthSign_16; + bool horzSpan_17; + float blendL_18; + vec3 rgbL_19; + float range_20; + float lumaS_21; + float lumaN_22; + doneN_8 = bool(0); + doneP_7 = bool(0); vec4 tmpvar_23; - tmpvar_23 = texture2DLod (_MainTex, tmpvar_22.xy, 0.0); - float tmpvar_24; - tmpvar_24 = ((tmpvar_16.y * 1.96321) + tmpvar_16.x); - lumaN_14 = tmpvar_24; - float tmpvar_25; - tmpvar_25 = ((tmpvar_18.y * 1.96321) + tmpvar_18.x); - float tmpvar_26; - tmpvar_26 = ((tmpvar_19.y * 1.96321) + tmpvar_19.x); - float tmpvar_27; - tmpvar_27 = ((tmpvar_21.y * 1.96321) + tmpvar_21.x); - float tmpvar_28; - tmpvar_28 = ((tmpvar_23.y * 1.96321) + tmpvar_23.x); - lumaS_13 = tmpvar_28; - float tmpvar_29; - tmpvar_29 = max (tmpvar_26, max (max (tmpvar_24, tmpvar_25), max (tmpvar_28, tmpvar_27))); - float tmpvar_30; - tmpvar_30 = (tmpvar_29 - min (tmpvar_26, min ( - min (tmpvar_24, tmpvar_25) - , - min (tmpvar_28, tmpvar_27) - ))); - float tmpvar_31; - tmpvar_31 = max (0.0625, (tmpvar_29 * 0.125)); - if ((tmpvar_30 < tmpvar_31)) { - tmpvar_2 = tmpvar_19.xyz; + tmpvar_23.zw = vec2(0.0, 0.0); + tmpvar_23.xy = (xlv_TEXCOORD0 + (vec2(0.0, -1.0) * _MainTex_TexelSize.xy)); + vec4 tmpvar_24; + tmpvar_24 = texture2DLod (_MainTex, tmpvar_23.xy, 0.0); + vec4 tmpvar_25; + tmpvar_25.zw = vec2(0.0, 0.0); + tmpvar_25.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 0.0) * _MainTex_TexelSize.xy)); + vec4 tmpvar_26; + tmpvar_26 = texture2DLod (_MainTex, tmpvar_25.xy, 0.0); + vec4 tmpvar_27; + tmpvar_27 = texture2DLod (_MainTex, xlv_TEXCOORD0, 0.0); + vec4 tmpvar_28; + tmpvar_28.zw = vec2(0.0, 0.0); + tmpvar_28.xy = (xlv_TEXCOORD0 + (vec2(1.0, 0.0) * _MainTex_TexelSize.xy)); + vec4 tmpvar_29; + tmpvar_29 = texture2DLod (_MainTex, tmpvar_28.xy, 0.0); + vec4 tmpvar_30; + tmpvar_30.zw = vec2(0.0, 0.0); + tmpvar_30.xy = (xlv_TEXCOORD0 + (vec2(0.0, 1.0) * _MainTex_TexelSize.xy)); + vec4 tmpvar_31; + tmpvar_31 = texture2DLod (_MainTex, tmpvar_30.xy, 0.0); + float tmpvar_32; + tmpvar_32 = ((tmpvar_24.y * 1.96321) + tmpvar_24.x); + lumaN_22 = tmpvar_32; + float tmpvar_33; + tmpvar_33 = ((tmpvar_26.y * 1.96321) + tmpvar_26.x); + float tmpvar_34; + tmpvar_34 = ((tmpvar_27.y * 1.96321) + tmpvar_27.x); + float tmpvar_35; + tmpvar_35 = ((tmpvar_29.y * 1.96321) + tmpvar_29.x); + float tmpvar_36; + tmpvar_36 = ((tmpvar_31.y * 1.96321) + tmpvar_31.x); + lumaS_21 = tmpvar_36; + float tmpvar_37; + tmpvar_37 = max (max (tmpvar_34, tmpvar_32), max (max (tmpvar_33, tmpvar_36), tmpvar_35)); + range_20 = (tmpvar_37 - min (min (tmpvar_34, tmpvar_32), min ( + min (tmpvar_33, tmpvar_36) + , tmpvar_35))); + float tmpvar_38; + tmpvar_38 = max (0.0625, (tmpvar_37 * 0.125)); + if ((range_20 < tmpvar_38)) { + tmpvar_2 = tmpvar_27.xyz; } else { - float tmpvar_32; - tmpvar_32 = min (0.75, (max (0.0, - ((abs(( - ((((tmpvar_24 + tmpvar_25) + tmpvar_27) + tmpvar_28) * 0.25) - - tmpvar_26)) / tmpvar_30) - 0.25) - ) * 1.33333)); - vec4 tmpvar_33; - tmpvar_33.zw = vec2(0.0, 0.0); - tmpvar_33.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy); - vec4 tmpvar_34; - tmpvar_34 = texture2DLod (_MainTex, tmpvar_33.xy, 0.0); - vec4 tmpvar_35; - tmpvar_35.zw = vec2(0.0, 0.0); - tmpvar_35.xy = (xlv_TEXCOORD0 + (vec2(1.0, -1.0) * _MainTex_TexelSize.xy)); - vec4 tmpvar_36; - tmpvar_36 = texture2DLod (_MainTex, tmpvar_35.xy, 0.0); - vec4 tmpvar_37; - tmpvar_37.zw = vec2(0.0, 0.0); - tmpvar_37.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 1.0) * _MainTex_TexelSize.xy)); - vec4 tmpvar_38; - tmpvar_38 = texture2DLod (_MainTex, tmpvar_37.xy, 0.0); - vec4 tmpvar_39; - tmpvar_39.zw = vec2(0.0, 0.0); - tmpvar_39.xy = (xlv_TEXCOORD0 + _MainTex_TexelSize.xy); + rgbL_19 = ((tmpvar_24.xyz + tmpvar_26.xyz) + ((tmpvar_27.xyz + tmpvar_29.xyz) + tmpvar_31.xyz)); + blendL_18 = (max (0.0, ( + (abs((( + ((tmpvar_32 + tmpvar_33) + (tmpvar_35 + tmpvar_36)) + * 0.25) - tmpvar_34)) / range_20) + - 0.25)) * 1.33333); + float tmpvar_39; + tmpvar_39 = min (0.75, blendL_18); + blendL_18 = tmpvar_39; vec4 tmpvar_40; - tmpvar_40 = texture2DLod (_MainTex, tmpvar_39.xy, 0.0); - vec3 tmpvar_41; - tmpvar_41 = ((( - (((tmpvar_16.xyz + tmpvar_18.xyz) + tmpvar_19.xyz) + tmpvar_21.xyz) - + tmpvar_23.xyz) + ( - ((tmpvar_34.xyz + tmpvar_36.xyz) + tmpvar_38.xyz) - + tmpvar_40.xyz)) * vec3(0.111111, 0.111111, 0.111111)); - float tmpvar_42; - tmpvar_42 = ((tmpvar_34.y * 1.96321) + tmpvar_34.x); - float tmpvar_43; - tmpvar_43 = ((tmpvar_36.y * 1.96321) + tmpvar_36.x); - float tmpvar_44; - tmpvar_44 = ((tmpvar_38.y * 1.96321) + tmpvar_38.x); - float tmpvar_45; - tmpvar_45 = ((tmpvar_40.y * 1.96321) + tmpvar_40.x); - bool tmpvar_46; - tmpvar_46 = ((( - abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_25)) + (0.25 * tmpvar_44))) - + - abs((((0.5 * tmpvar_24) - tmpvar_26) + (0.5 * tmpvar_28))) - ) + abs( - (((0.25 * tmpvar_43) + (-0.5 * tmpvar_27)) + (0.25 * tmpvar_45)) - )) >= (( - abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_24)) + (0.25 * tmpvar_43))) - + - abs((((0.5 * tmpvar_25) - tmpvar_26) + (0.5 * tmpvar_27))) - ) + abs( - (((0.25 * tmpvar_44) + (-0.5 * tmpvar_28)) + (0.25 * tmpvar_45)) - ))); - float tmpvar_47; - if (tmpvar_46) { - tmpvar_47 = -(_MainTex_TexelSize.y); - } else { - tmpvar_47 = -(_MainTex_TexelSize.x); - }; - lengthSign_12 = tmpvar_47; - if (!(tmpvar_46)) { - lumaN_14 = tmpvar_25; - }; - if (!(tmpvar_46)) { - lumaS_13 = tmpvar_27; - }; + tmpvar_40.zw = vec2(0.0, 0.0); + tmpvar_40.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy); + vec4 tmpvar_41; + tmpvar_41 = texture2DLod (_MainTex, tmpvar_40.xy, 0.0); + vec4 tmpvar_42; + tmpvar_42.zw = vec2(0.0, 0.0); + tmpvar_42.xy = (xlv_TEXCOORD0 + (vec2(1.0, -1.0) * _MainTex_TexelSize.xy)); + vec4 tmpvar_43; + tmpvar_43 = texture2DLod (_MainTex, tmpvar_42.xy, 0.0); + vec4 tmpvar_44; + tmpvar_44.zw = vec2(0.0, 0.0); + tmpvar_44.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 1.0) * _MainTex_TexelSize.xy)); + vec4 tmpvar_45; + tmpvar_45 = texture2DLod (_MainTex, tmpvar_44.xy, 0.0); + vec4 tmpvar_46; + tmpvar_46.zw = vec2(0.0, 0.0); + tmpvar_46.xy = (xlv_TEXCOORD0 + _MainTex_TexelSize.xy); + vec4 tmpvar_47; + tmpvar_47 = texture2DLod (_MainTex, tmpvar_46.xy, 0.0); + rgbL_19 = ((rgbL_19 + tmpvar_41.xyz) + ((tmpvar_43.xyz + tmpvar_45.xyz) + tmpvar_47.xyz)); + rgbL_19 = (rgbL_19 * vec3(0.111111, 0.111111, 0.111111)); float tmpvar_48; - tmpvar_48 = abs((lumaN_14 - tmpvar_26)); - gradientN_11 = tmpvar_48; + tmpvar_48 = ((tmpvar_41.y * 1.96321) + tmpvar_41.x); float tmpvar_49; - tmpvar_49 = abs((lumaS_13 - tmpvar_26)); - lumaN_14 = ((lumaN_14 + tmpvar_26) * 0.5); + tmpvar_49 = ((tmpvar_43.y * 1.96321) + tmpvar_43.x); float tmpvar_50; - tmpvar_50 = ((lumaS_13 + tmpvar_26) * 0.5); - lumaS_13 = tmpvar_50; - bool tmpvar_51; - tmpvar_51 = (tmpvar_48 >= tmpvar_49); - if (!(tmpvar_51)) { - lumaN_14 = tmpvar_50; - }; - if (!(tmpvar_51)) { - gradientN_11 = tmpvar_49; - }; - if (!(tmpvar_51)) { - lengthSign_12 = -(tmpvar_47); - }; + tmpvar_50 = ((tmpvar_45.y * 1.96321) + tmpvar_45.x); + float tmpvar_51; + tmpvar_51 = ((tmpvar_47.y * 1.96321) + tmpvar_47.x); + horzSpan_17 = ((( + abs((((0.25 * tmpvar_48) + (-0.5 * tmpvar_33)) + (0.25 * tmpvar_50))) + + + abs((((0.5 * tmpvar_32) - tmpvar_34) + (0.5 * tmpvar_36))) + ) + abs( + (((0.25 * tmpvar_49) + (-0.5 * tmpvar_35)) + (0.25 * tmpvar_51)) + )) >= (( + abs((((0.25 * tmpvar_48) + (-0.5 * tmpvar_32)) + (0.25 * tmpvar_49))) + + + abs((((0.5 * tmpvar_33) - tmpvar_34) + (0.5 * tmpvar_35))) + ) + abs( + (((0.25 * tmpvar_50) + (-0.5 * tmpvar_36)) + (0.25 * tmpvar_51)) + ))); float tmpvar_52; - if (tmpvar_46) { - tmpvar_52 = 0.0; + if (horzSpan_17) { + tmpvar_52 = -(_MainTex_TexelSize.y); } else { - tmpvar_52 = (lengthSign_12 * 0.5); + tmpvar_52 = -(_MainTex_TexelSize.x); + }; + lengthSign_16 = tmpvar_52; + if (!(horzSpan_17)) { + lumaN_22 = tmpvar_33; + }; + if (!(horzSpan_17)) { + lumaS_21 = tmpvar_35; }; - posN_10.x = (xlv_TEXCOORD0.x + tmpvar_52); float tmpvar_53; - if (tmpvar_46) { - tmpvar_53 = (lengthSign_12 * 0.5); - } else { - tmpvar_53 = 0.0; + tmpvar_53 = abs((lumaN_22 - tmpvar_34)); + gradientN_15 = tmpvar_53; + float tmpvar_54; + tmpvar_54 = abs((lumaS_21 - tmpvar_34)); + lumaN_22 = ((lumaN_22 + tmpvar_34) * 0.5); + lumaS_21 = ((lumaS_21 + tmpvar_34) * 0.5); + pairN_14 = (tmpvar_53 >= tmpvar_54); + if (!(pairN_14)) { + lumaN_22 = lumaS_21; }; - posN_10.y = (xlv_TEXCOORD0.y + tmpvar_53); - gradientN_11 = (gradientN_11 * 0.25); - posP_9 = posN_10; - vec2 tmpvar_54; - if (tmpvar_46) { - vec2 tmpvar_55; - tmpvar_55.y = 0.0; - tmpvar_55.x = rcpFrame_1.x; - tmpvar_54 = tmpvar_55; - } else { - vec2 tmpvar_56; - tmpvar_56.x = 0.0; - tmpvar_56.y = rcpFrame_1.y; - tmpvar_54 = tmpvar_56; + if (!(pairN_14)) { + gradientN_15 = tmpvar_54; }; - lumaEndN_7 = lumaN_14; - lumaEndP_6 = lumaN_14; - posN_10 = (posN_10 + (tmpvar_54 * vec2(-2.0, -2.0))); - posP_9 = (posP_9 + (tmpvar_54 * vec2(2.0, 2.0))); - offNP_8 = (tmpvar_54 * vec2(3.0, 3.0)); - for (int i_3; i_3 < 4; i_3++) { - if (!(doneN_5)) { - vec4 tmpvar_57; - tmpvar_57 = texture2DGradARB (_MainTex, posN_10, offNP_8, offNP_8); - lumaEndN_7 = ((tmpvar_57.y * 1.96321) + tmpvar_57.x); + if (!(pairN_14)) { + lengthSign_16 = -(tmpvar_52); + }; + float tmpvar_55; + if (horzSpan_17) { + tmpvar_55 = 0.0; + } else { + tmpvar_55 = (lengthSign_16 * 0.5); + }; + posN_13.x = (xlv_TEXCOORD0.x + tmpvar_55); + float tmpvar_56; + if (horzSpan_17) { + tmpvar_56 = (lengthSign_16 * 0.5); + } else { + tmpvar_56 = 0.0; + }; + posN_13.y = (xlv_TEXCOORD0.y + tmpvar_56); + gradientN_15 = (gradientN_15 * 0.25); + posP_12 = posN_13; + vec2 tmpvar_57; + if (horzSpan_17) { + vec2 tmpvar_58; + tmpvar_58.y = 0.0; + tmpvar_58.x = rcpFrame_1.x; + tmpvar_57 = tmpvar_58; + } else { + vec2 tmpvar_59; + tmpvar_59.x = 0.0; + tmpvar_59.y = rcpFrame_1.y; + tmpvar_57 = tmpvar_59; + }; + lumaEndN_10 = lumaN_22; + lumaEndP_9 = lumaN_22; + posN_13 = (posN_13 + (tmpvar_57 * vec2(-2.0, -2.0))); + posP_12 = (posP_12 + (tmpvar_57 * vec2(2.0, 2.0))); + offNP_11 = (tmpvar_57 * vec2(3.0, 3.0)); + for (int i_6; i_6 < 4; i_6++) { + if (!(doneN_8)) { + vec4 tmpvar_60; + tmpvar_60 = texture2DGradARB (_MainTex, posN_13, offNP_11, offNP_11); + lumaEndN_10 = ((tmpvar_60.y * 1.96321) + tmpvar_60.x); }; - if (!(doneP_4)) { - vec4 tmpvar_58; - tmpvar_58 = texture2DGradARB (_MainTex, posP_9, offNP_8, offNP_8); - lumaEndP_6 = ((tmpvar_58.y * 1.96321) + tmpvar_58.x); + if (!(doneP_7)) { + vec4 tmpvar_61; + tmpvar_61 = texture2DGradARB (_MainTex, posP_12, offNP_11, offNP_11); + lumaEndP_9 = ((tmpvar_61.y * 1.96321) + tmpvar_61.x); }; - bool tmpvar_59; - if (doneN_5) { - tmpvar_59 = bool(1); + bool tmpvar_62; + if (doneN_8) { + tmpvar_62 = bool(1); } else { - tmpvar_59 = (abs((lumaEndN_7 - lumaN_14)) >= gradientN_11); + tmpvar_62 = (abs((lumaEndN_10 - lumaN_22)) >= gradientN_15); }; - doneN_5 = tmpvar_59; - bool tmpvar_60; - if (doneP_4) { - tmpvar_60 = bool(1); + doneN_8 = tmpvar_62; + bool tmpvar_63; + if (doneP_7) { + tmpvar_63 = bool(1); } else { - tmpvar_60 = (abs((lumaEndP_6 - lumaN_14)) >= gradientN_11); + tmpvar_63 = (abs((lumaEndP_9 - lumaN_22)) >= gradientN_15); }; - doneP_4 = tmpvar_60; - if ((tmpvar_59 && tmpvar_60)) { + doneP_7 = tmpvar_63; + if ((tmpvar_62 && tmpvar_63)) { break; }; - if (!(tmpvar_59)) { - posN_10 = (posN_10 - offNP_8); + if (!(tmpvar_62)) { + posN_13 = (posN_13 - offNP_11); }; - if (!(tmpvar_60)) { - posP_9 = (posP_9 + offNP_8); + if (!(tmpvar_63)) { + posP_12 = (posP_12 + offNP_11); }; }; - float tmpvar_61; - if (tmpvar_46) { - tmpvar_61 = (xlv_TEXCOORD0.x - posN_10.x); - } else { - tmpvar_61 = (xlv_TEXCOORD0.y - posN_10.y); - }; - float tmpvar_62; - if (tmpvar_46) { - tmpvar_62 = (posP_9.x - xlv_TEXCOORD0.x); - } else { - tmpvar_62 = (posP_9.y - xlv_TEXCOORD0.y); - }; - bool tmpvar_63; - tmpvar_63 = (tmpvar_61 < tmpvar_62); float tmpvar_64; - if (tmpvar_63) { - tmpvar_64 = lumaEndN_7; + if (horzSpan_17) { + tmpvar_64 = (xlv_TEXCOORD0.x - posN_13.x); } else { - tmpvar_64 = lumaEndP_6; - }; - lumaEndN_7 = tmpvar_64; - if ((((tmpvar_26 - lumaN_14) < 0.0) == ((tmpvar_64 - lumaN_14) < 0.0))) { - lengthSign_12 = 0.0; + tmpvar_64 = (xlv_TEXCOORD0.y - posN_13.y); }; float tmpvar_65; - tmpvar_65 = (tmpvar_62 + tmpvar_61); - float tmpvar_66; - if (tmpvar_63) { - tmpvar_66 = tmpvar_61; + if (horzSpan_17) { + tmpvar_65 = (posP_12.x - xlv_TEXCOORD0.x); } else { - tmpvar_66 = tmpvar_62; + tmpvar_65 = (posP_12.y - xlv_TEXCOORD0.y); }; + directionN_5 = (tmpvar_64 < tmpvar_65); + float tmpvar_66; + if (directionN_5) { + tmpvar_66 = lumaEndN_10; + } else { + tmpvar_66 = lumaEndP_9; + }; + lumaEndN_10 = tmpvar_66; + if ((((tmpvar_34 - lumaN_22) < 0.0) == ((tmpvar_66 - lumaN_22) < 0.0))) { + lengthSign_16 = 0.0; + }; + spanLength_4 = (tmpvar_65 + tmpvar_64); float tmpvar_67; - tmpvar_67 = ((0.5 + (tmpvar_66 * - (-1.0 / tmpvar_65) - )) * lengthSign_12); + if (directionN_5) { + tmpvar_67 = tmpvar_64; + } else { + tmpvar_67 = tmpvar_65; + }; + subPixelOffset_3 = ((0.5 + (tmpvar_67 * + (-1.0 / spanLength_4) + )) * lengthSign_16); float tmpvar_68; - if (tmpvar_46) { + if (horzSpan_17) { tmpvar_68 = 0.0; } else { - tmpvar_68 = tmpvar_67; + tmpvar_68 = subPixelOffset_3; }; float tmpvar_69; - if (tmpvar_46) { - tmpvar_69 = tmpvar_67; + if (horzSpan_17) { + tmpvar_69 = subPixelOffset_3; } else { tmpvar_69 = 0.0; }; @@ -276,10 +273,10 @@ void main () vec4 tmpvar_71; tmpvar_71 = texture2DLod (_MainTex, tmpvar_70, 0.0); vec3 tmpvar_72; - tmpvar_72.x = -(tmpvar_32); - tmpvar_72.y = -(tmpvar_32); - tmpvar_72.z = -(tmpvar_32); - tmpvar_2 = ((tmpvar_72 * tmpvar_71.xyz) + ((tmpvar_41 * vec3(tmpvar_32)) + tmpvar_71.xyz)); + tmpvar_72.x = -(tmpvar_39); + tmpvar_72.y = -(tmpvar_39); + tmpvar_72.z = -(tmpvar_39); + tmpvar_2 = ((tmpvar_72 * tmpvar_71.xyz) + ((rgbL_19 * vec3(tmpvar_39)) + tmpvar_71.xyz)); }; vec4 tmpvar_73; tmpvar_73.w = 0.0; @@ -288,4 +285,10 @@ void main () } -// inputs: 1, stats: 194 alu 12 tex 26 flow +// stats: 194 alu 12 tex 26 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// uniforms: 1 (total size: 0) +// #0: _MainTex_TexelSize (high float) 4x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-inES3.txt new file mode 100644 index 000000000..7efdbbf3d --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-inES3.txt @@ -0,0 +1,139 @@ +#version 300 es +out lowp vec4 _fragData; +vec4 xll_tex2Dlod(sampler2D s, vec4 coord) { + return texture2DLod( s, coord.xy, coord.w); +} +uniform sampler2D _MainTex; +uniform vec4 _MainTex_TexelSize; +vec4 FxaaTexOff( in sampler2D tex, in vec2 pos, in vec2 off, in vec2 rcpFrame ); +vec4 FxaaTexLod0( in sampler2D tex, in vec2 pos ); +float FxaaLuma( in vec3 rgb ); +vec3 FxaaLerp3( in vec3 a, in vec3 b, in float amountOfA ); +vec3 FxaaFilterReturn( in vec3 rgb ); +vec3 FxaaPixelShader( in vec2 pos, in sampler2D tex, in vec2 rcpFrame ); +vec4 xlat_main( in vec2 uv ); +vec4 FxaaTexOff( in sampler2D tex, in vec2 pos, in vec2 off, in vec2 rcpFrame ) { + return xll_tex2Dlod( tex, vec4( (pos.xy + (off * rcpFrame)), 0.0, 0.0)); +} +vec4 FxaaTexLod0( in sampler2D tex, in vec2 pos ) { + return xll_tex2Dlod( tex, vec4( pos.xy, 0.0, 0.0)); +} +float FxaaLuma( in vec3 rgb ) { + return ((rgb.y * (0.587 / 0.299)) + rgb.x); +} +vec3 FxaaLerp3( in vec3 a, in vec3 b, in float amountOfA ) { + return ((vec3( (-amountOfA), (-amountOfA), (-amountOfA)) * b) + ((a * vec3( amountOfA, amountOfA, amountOfA)) + b)); +} +vec3 FxaaFilterReturn( in vec3 rgb ) { + return rgb; +} +vec3 FxaaPixelShader( in vec2 pos, in sampler2D tex, in vec2 rcpFrame ) { + vec3 rgbN = FxaaTexOff( tex, pos.xy, vec2( 0.0, -1.0), rcpFrame).xyz; + vec3 rgbW = FxaaTexOff( tex, pos.xy, vec2( -1.0, 0.0), rcpFrame).xyz; + vec3 rgbM = FxaaTexOff( tex, pos.xy, vec2( 0.0, 0.0), rcpFrame).xyz; + vec3 rgbE = FxaaTexOff( tex, pos.xy, vec2( 1.0, 0.0), rcpFrame).xyz; + vec3 rgbS = FxaaTexOff( tex, pos.xy, vec2( 0.0, 1.0), rcpFrame).xyz; + float lumaN = FxaaLuma( rgbN); + float lumaW = FxaaLuma( rgbW); + float lumaM = FxaaLuma( rgbM); + float lumaE = FxaaLuma( rgbE); + float lumaS = FxaaLuma( rgbS); + float rangeMin = min( lumaM, min( min( lumaN, lumaW), min( lumaS, lumaE))); + float rangeMax = max( lumaM, max( max( lumaN, lumaW), max( lumaS, lumaE))); + float range = (rangeMax - rangeMin); + if ((range < max( (1.0 / 24.0), (rangeMax * (1.0 / 8.0))))){ + return FxaaFilterReturn( rgbM); + } + vec3 rgbL = ((((rgbN + rgbW) + rgbM) + rgbE) + rgbS); + float lumaL = ((((lumaN + lumaW) + lumaE) + lumaS) * 0.25); + float rangeL = abs((lumaL - lumaM)); + float blendL = (max( 0.0, ((rangeL / range) - (1.0 / 4.0))) * (1.0 / (1.0 - (1.0 / 4.0)))); + blendL = min( (3.0 / 4.0), blendL); + vec3 rgbNW = FxaaTexOff( tex, pos.xy, vec2( -1.0, -1.0), rcpFrame).xyz; + vec3 rgbNE = FxaaTexOff( tex, pos.xy, vec2( 1.0, -1.0), rcpFrame).xyz; + vec3 rgbSW = FxaaTexOff( tex, pos.xy, vec2( -1.0, 1.0), rcpFrame).xyz; + vec3 rgbSE = FxaaTexOff( tex, pos.xy, vec2( 1.0, 1.0), rcpFrame).xyz; + rgbL += (((rgbNW + rgbNE) + rgbSW) + rgbSE); + rgbL *= vec3( (1.0 / 9.0), (1.0 / 9.0), (1.0 / 9.0)); + float lumaNW = FxaaLuma( rgbNW); + float lumaNE = FxaaLuma( rgbNE); + float lumaSW = FxaaLuma( rgbSW); + float lumaSE = FxaaLuma( rgbSE); + float edgeVert = ((abs((((0.25 * lumaNW) + ((-0.5) * lumaN)) + (0.25 * lumaNE))) + abs((((0.5 * lumaW) + ((-1.0) * lumaM)) + (0.5 * lumaE)))) + abs((((0.25 * lumaSW) + ((-0.5) * lumaS)) + (0.25 * lumaSE)))); + float edgeHorz = ((abs((((0.25 * lumaNW) + ((-0.5) * lumaW)) + (0.25 * lumaSW))) + abs((((0.5 * lumaN) + ((-1.0) * lumaM)) + (0.5 * lumaS)))) + abs((((0.25 * lumaNE) + ((-0.5) * lumaE)) + (0.25 * lumaSE)))); + bool horzSpan = (edgeHorz >= edgeVert); + float lengthSign = (( horzSpan ) ? ( (-rcpFrame.y) ) : ( (-rcpFrame.x) )); + if ((!horzSpan)){ + lumaN = lumaW; + } + if ((!horzSpan)){ + lumaS = lumaE; + } + float gradientN = abs((lumaN - lumaM)); + float gradientS = abs((lumaS - lumaM)); + lumaN = ((lumaN + lumaM) * 0.5); + lumaS = ((lumaS + lumaM) * 0.5); + bool pairN = (gradientN >= gradientS); + if ((!pairN)){ + lumaN = lumaS; + } + if ((!pairN)){ + gradientN = gradientS; + } + if ((!pairN)){ + lengthSign *= (-1.0); + } + vec2 posN; + posN.x = (pos.x + (( horzSpan ) ? ( 0.0 ) : ( (lengthSign * 0.5) ))); + posN.y = (pos.y + (( horzSpan ) ? ( (lengthSign * 0.5) ) : ( 0.0 ))); + gradientN *= (1.0 / 4.0); + vec2 posP = posN; + vec2 offNP = (( horzSpan ) ? ( vec2( rcpFrame.x, 0.0) ) : ( vec2( 0.0, rcpFrame.y) )); + float lumaEndN = lumaN; + float lumaEndP = lumaN; + bool doneN = false; + bool doneP = false; + posN += (offNP * vec2( (-1.0), (-1.0))); + posP += (offNP * vec2( 1.0, 1.0)); + int i = 0; + for ( ; (i < 16); (i++)) { + if ((!doneN)){ + lumaEndN = FxaaLuma( FxaaTexLod0( tex, posN.xy).xyz); + } + if ((!doneP)){ + lumaEndP = FxaaLuma( FxaaTexLod0( tex, posP.xy).xyz); + } + doneN = (doneN || (abs((lumaEndN - lumaN)) >= gradientN)); + doneP = (doneP || (abs((lumaEndP - lumaN)) >= gradientN)); + if ((doneN && doneP)){ + break; + } + if ((!doneN)){ + posN -= offNP; + } + if ((!doneP)){ + posP += offNP; + } + } + float dstN = (( horzSpan ) ? ( (pos.x - posN.x) ) : ( (pos.y - posN.y) )); + float dstP = (( horzSpan ) ? ( (posP.x - pos.x) ) : ( (posP.y - pos.y) )); + bool directionN = (dstN < dstP); + lumaEndN = (( directionN ) ? ( lumaEndN ) : ( lumaEndP )); + if ((((lumaM - lumaN) < 0.0) == ((lumaEndN - lumaN) < 0.0))){ + lengthSign = 0.0; + } + float spanLength = (dstP + dstN); + dstN = (( directionN ) ? ( dstN ) : ( dstP )); + float subPixelOffset = ((0.5 + (dstN * ((-1.0) / spanLength))) * lengthSign); + vec3 rgbF = FxaaTexLod0( tex, vec2( (pos.x + (( horzSpan ) ? ( 0.0 ) : ( subPixelOffset ))), (pos.y + (( horzSpan ) ? ( subPixelOffset ) : ( 0.0 ))))).xyz; + return FxaaFilterReturn( FxaaLerp3( rgbL, rgbF, blendL)); +} +vec4 xlat_main( in vec2 uv ) { + return vec4( FxaaPixelShader( uv.xy, _MainTex, _MainTex_TexelSize.xy).xyz, 0.0); +} +in vec2 xlv_TEXCOORD0; +void main() { + vec4 xl_retval; + xl_retval = xlat_main( vec2(xlv_TEXCOORD0)); + _fragData = vec4(xl_retval); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-ir.txt deleted file mode 100644 index a2a9c3b2e..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-ir.txt +++ /dev/null @@ -1,599 +0,0 @@ -#extension GL_ARB_shader_texture_lod : enable -uniform sampler2D _MainTex; -uniform vec4 _MainTex_TexelSize; -varying vec2 xlv_TEXCOORD0; -vec4 xll_tex2Dlod ( - in sampler2D s_1, - in vec4 coord_2 -) -{ - vec4 tmpvar_3; - tmpvar_3 = texture2DLod (s_1, coord_2.xy, coord_2.w); - return tmpvar_3; -} - -vec4 FxaaTexOff ( - in sampler2D tex_4, - in vec2 pos_5, - in vec2 off_6, - in vec2 rcpFrame_7 -) -{ - vec4 tmpvar_8; - tmpvar_8.zw = vec2(0.0, 0.0); - tmpvar_8.xy = (pos_5.xy + (off_6 * rcpFrame_7)).xy; - vec4 tmpvar_9; - tmpvar_9 = xll_tex2Dlod (tex_4, tmpvar_8); - return tmpvar_9; -} - -vec4 FxaaTexLod0 ( - in sampler2D tex_10, - in vec2 pos_11 -) -{ - vec4 tmpvar_12; - tmpvar_12.zw = vec2(0.0, 0.0); - tmpvar_12.xy = pos_11.xy.xy; - vec4 tmpvar_13; - tmpvar_13 = xll_tex2Dlod (tex_10, tmpvar_12); - return tmpvar_13; -} - -float FxaaLuma ( - in vec3 rgb_14 -) -{ - return ((rgb_14.y * (0.587 / 0.299)) + rgb_14.x); -} - -vec3 FxaaLerp3 ( - in vec3 a_15, - in vec3 b_16, - in float amountOfA_17 -) -{ - vec3 tmpvar_18; - tmpvar_18.x = -(amountOfA_17); - tmpvar_18.y = -(amountOfA_17); - tmpvar_18.z = -(amountOfA_17); - vec3 tmpvar_19; - tmpvar_19.x = amountOfA_17; - tmpvar_19.y = amountOfA_17; - tmpvar_19.z = amountOfA_17; - return ((tmpvar_18 * b_16) + ((a_15 * tmpvar_19) + b_16)); -} - -vec3 FxaaFilterReturn ( - in vec3 rgb_20 -) -{ - return rgb_20; -} - -vec3 FxaaPixelShader ( - in vec2 pos_21, - in sampler2D tex_22, - in vec2 rcpFrame_23 -) -{ - vec3 rgbF_24; - float subPixelOffset_25; - float spanLength_26; - bool directionN_27; - float dstP_28; - float dstN_29; - int i_30; - bool doneP_31; - bool doneN_32; - float lumaEndP_33; - float lumaEndN_34; - vec2 offNP_35; - vec2 posP_36; - vec2 posN_37; - bool pairN_38; - float gradientS_39; - float gradientN_40; - float lengthSign_41; - bool horzSpan_42; - float edgeHorz_43; - float edgeVert_44; - float lumaSE_45; - float lumaSW_46; - float lumaNE_47; - float lumaNW_48; - vec3 rgbSE_49; - vec3 rgbSW_50; - vec3 rgbNE_51; - vec3 rgbNW_52; - float blendL_53; - float rangeL_54; - float lumaL_55; - vec3 rgbL_56; - float range_57; - float rangeMax_58; - float rangeMin_59; - float lumaS_60; - float lumaE_61; - float lumaM_62; - float lumaW_63; - float lumaN_64; - vec3 rgbS_65; - vec3 rgbE_66; - vec3 rgbM_67; - vec3 rgbW_68; - vec3 rgbN_69; - vec4 tmpvar_70; - tmpvar_70 = FxaaTexOff (tex_22, pos_21.xy, vec2(0.0, -1.0), rcpFrame_23); - vec3 tmpvar_71; - tmpvar_71 = tmpvar_70.xyz; - rgbN_69 = tmpvar_71; - vec4 tmpvar_72; - tmpvar_72 = FxaaTexOff (tex_22, pos_21.xy, vec2(-1.0, 0.0), rcpFrame_23); - vec3 tmpvar_73; - tmpvar_73 = tmpvar_72.xyz; - rgbW_68 = tmpvar_73; - vec4 tmpvar_74; - tmpvar_74 = FxaaTexOff (tex_22, pos_21.xy, vec2(0.0, 0.0), rcpFrame_23); - vec3 tmpvar_75; - tmpvar_75 = tmpvar_74.xyz; - rgbM_67 = tmpvar_75; - vec4 tmpvar_76; - tmpvar_76 = FxaaTexOff (tex_22, pos_21.xy, vec2(1.0, 0.0), rcpFrame_23); - vec3 tmpvar_77; - tmpvar_77 = tmpvar_76.xyz; - rgbE_66 = tmpvar_77; - vec4 tmpvar_78; - tmpvar_78 = FxaaTexOff (tex_22, pos_21.xy, vec2(0.0, 1.0), rcpFrame_23); - vec3 tmpvar_79; - tmpvar_79 = tmpvar_78.xyz; - rgbS_65 = tmpvar_79; - float tmpvar_80; - tmpvar_80 = FxaaLuma (rgbN_69); - float tmpvar_81; - tmpvar_81 = tmpvar_80; - lumaN_64 = tmpvar_81; - float tmpvar_82; - tmpvar_82 = FxaaLuma (rgbW_68); - float tmpvar_83; - tmpvar_83 = tmpvar_82; - lumaW_63 = tmpvar_83; - float tmpvar_84; - tmpvar_84 = FxaaLuma (rgbM_67); - float tmpvar_85; - tmpvar_85 = tmpvar_84; - lumaM_62 = tmpvar_85; - float tmpvar_86; - tmpvar_86 = FxaaLuma (rgbE_66); - float tmpvar_87; - tmpvar_87 = tmpvar_86; - lumaE_61 = tmpvar_87; - float tmpvar_88; - tmpvar_88 = FxaaLuma (rgbS_65); - float tmpvar_89; - tmpvar_89 = tmpvar_88; - lumaS_60 = tmpvar_89; - float tmpvar_90; - tmpvar_90 = min (lumaN_64, lumaW_63); - float tmpvar_91; - tmpvar_91 = min (lumaS_60, lumaE_61); - float tmpvar_92; - tmpvar_92 = min (tmpvar_90, tmpvar_91); - float tmpvar_93; - tmpvar_93 = min (lumaM_62, tmpvar_92); - float tmpvar_94; - tmpvar_94 = tmpvar_93; - rangeMin_59 = tmpvar_94; - float tmpvar_95; - tmpvar_95 = max (lumaN_64, lumaW_63); - float tmpvar_96; - tmpvar_96 = max (lumaS_60, lumaE_61); - float tmpvar_97; - tmpvar_97 = max (tmpvar_95, tmpvar_96); - float tmpvar_98; - tmpvar_98 = max (lumaM_62, tmpvar_97); - float tmpvar_99; - tmpvar_99 = tmpvar_98; - rangeMax_58 = tmpvar_99; - float tmpvar_100; - tmpvar_100 = (rangeMax_58 - rangeMin_59); - range_57 = tmpvar_100; - float tmpvar_101; - tmpvar_101 = max (0.0416667, (rangeMax_58 * (1.0 / 8.0))); - if ((range_57 < tmpvar_101)) { - vec3 tmpvar_102; - tmpvar_102 = FxaaFilterReturn (rgbM_67); - return tmpvar_102; - }; - vec3 tmpvar_103; - tmpvar_103 = ((( - (rgbN_69 + rgbW_68) - + rgbM_67) + rgbE_66) + rgbS_65); - rgbL_56 = tmpvar_103; - float tmpvar_104; - tmpvar_104 = ((( - (lumaN_64 + lumaW_63) - + lumaE_61) + lumaS_60) * 0.25); - lumaL_55 = tmpvar_104; - float tmpvar_105; - tmpvar_105 = abs ((lumaL_55 - lumaM_62)); - float tmpvar_106; - tmpvar_106 = tmpvar_105; - rangeL_54 = tmpvar_106; - float tmpvar_107; - tmpvar_107 = max (0.0, ((rangeL_54 / range_57) - (1.0 / 4.0))); - float tmpvar_108; - tmpvar_108 = (tmpvar_107 * (1.0 / (1.0 - - (1.0 / 4.0) - ))); - blendL_53 = tmpvar_108; - float tmpvar_109; - tmpvar_109 = min (0.75, blendL_53); - float tmpvar_110; - tmpvar_110 = tmpvar_109; - blendL_53 = tmpvar_110; - vec4 tmpvar_111; - tmpvar_111 = FxaaTexOff (tex_22, pos_21.xy, vec2(-1.0, -1.0), rcpFrame_23); - vec3 tmpvar_112; - tmpvar_112 = tmpvar_111.xyz; - rgbNW_52 = tmpvar_112; - vec4 tmpvar_113; - tmpvar_113 = FxaaTexOff (tex_22, pos_21.xy, vec2(1.0, -1.0), rcpFrame_23); - vec3 tmpvar_114; - tmpvar_114 = tmpvar_113.xyz; - rgbNE_51 = tmpvar_114; - vec4 tmpvar_115; - tmpvar_115 = FxaaTexOff (tex_22, pos_21.xy, vec2(-1.0, 1.0), rcpFrame_23); - vec3 tmpvar_116; - tmpvar_116 = tmpvar_115.xyz; - rgbSW_50 = tmpvar_116; - vec4 tmpvar_117; - tmpvar_117 = FxaaTexOff (tex_22, pos_21.xy, vec2(1.0, 1.0), rcpFrame_23); - vec3 tmpvar_118; - tmpvar_118 = tmpvar_117.xyz; - rgbSE_49 = tmpvar_118; - vec3 tmpvar_119; - tmpvar_119 = (rgbL_56 + (( - (rgbNW_52 + rgbNE_51) - + rgbSW_50) + rgbSE_49)); - rgbL_56 = tmpvar_119; - vec3 tmpvar_120; - tmpvar_120 = (rgbL_56 * vec3(0.111111, 0.111111, 0.111111)); - rgbL_56 = tmpvar_120; - float tmpvar_121; - tmpvar_121 = FxaaLuma (rgbNW_52); - float tmpvar_122; - tmpvar_122 = tmpvar_121; - lumaNW_48 = tmpvar_122; - float tmpvar_123; - tmpvar_123 = FxaaLuma (rgbNE_51); - float tmpvar_124; - tmpvar_124 = tmpvar_123; - lumaNE_47 = tmpvar_124; - float tmpvar_125; - tmpvar_125 = FxaaLuma (rgbSW_50); - float tmpvar_126; - tmpvar_126 = tmpvar_125; - lumaSW_46 = tmpvar_126; - float tmpvar_127; - tmpvar_127 = FxaaLuma (rgbSE_49); - float tmpvar_128; - tmpvar_128 = tmpvar_127; - lumaSE_45 = tmpvar_128; - float tmpvar_129; - tmpvar_129 = abs ((((0.25 * lumaNW_48) + ( - -(0.5) - * lumaN_64)) + (0.25 * lumaNE_47))); - float tmpvar_130; - tmpvar_130 = abs ((((0.5 * lumaW_63) + ( - -(1.0) - * lumaM_62)) + (0.5 * lumaE_61))); - float tmpvar_131; - tmpvar_131 = abs ((((0.25 * lumaSW_46) + ( - -(0.5) - * lumaS_60)) + (0.25 * lumaSE_45))); - float tmpvar_132; - tmpvar_132 = ((tmpvar_129 + tmpvar_130) + tmpvar_131); - edgeVert_44 = tmpvar_132; - float tmpvar_133; - tmpvar_133 = abs ((((0.25 * lumaNW_48) + ( - -(0.5) - * lumaW_63)) + (0.25 * lumaSW_46))); - float tmpvar_134; - tmpvar_134 = abs ((((0.5 * lumaN_64) + ( - -(1.0) - * lumaM_62)) + (0.5 * lumaS_60))); - float tmpvar_135; - tmpvar_135 = abs ((((0.25 * lumaNE_47) + ( - -(0.5) - * lumaE_61)) + (0.25 * lumaSE_45))); - float tmpvar_136; - tmpvar_136 = ((tmpvar_133 + tmpvar_134) + tmpvar_135); - edgeHorz_43 = tmpvar_136; - bool tmpvar_137; - tmpvar_137 = (edgeHorz_43 >= edgeVert_44); - horzSpan_42 = tmpvar_137; - float tmpvar_138; - if (horzSpan_42) { - tmpvar_138 = -(rcpFrame_23.y); - } else { - tmpvar_138 = -(rcpFrame_23.x); - }; - float tmpvar_139; - tmpvar_139 = tmpvar_138; - lengthSign_41 = tmpvar_139; - if (!(horzSpan_42)) { - float tmpvar_140; - tmpvar_140 = lumaW_63; - lumaN_64 = tmpvar_140; - }; - if (!(horzSpan_42)) { - float tmpvar_141; - tmpvar_141 = lumaE_61; - lumaS_60 = tmpvar_141; - }; - float tmpvar_142; - tmpvar_142 = abs ((lumaN_64 - lumaM_62)); - float tmpvar_143; - tmpvar_143 = tmpvar_142; - gradientN_40 = tmpvar_143; - float tmpvar_144; - tmpvar_144 = abs ((lumaS_60 - lumaM_62)); - float tmpvar_145; - tmpvar_145 = tmpvar_144; - gradientS_39 = tmpvar_145; - float tmpvar_146; - tmpvar_146 = ((lumaN_64 + lumaM_62) * 0.5); - lumaN_64 = tmpvar_146; - float tmpvar_147; - tmpvar_147 = ((lumaS_60 + lumaM_62) * 0.5); - lumaS_60 = tmpvar_147; - bool tmpvar_148; - tmpvar_148 = (gradientN_40 >= gradientS_39); - pairN_38 = tmpvar_148; - if (!(pairN_38)) { - float tmpvar_149; - tmpvar_149 = lumaS_60; - lumaN_64 = tmpvar_149; - }; - if (!(pairN_38)) { - float tmpvar_150; - tmpvar_150 = gradientS_39; - gradientN_40 = tmpvar_150; - }; - if (!(pairN_38)) { - float tmpvar_151; - tmpvar_151 = (lengthSign_41 * -(1.0)); - lengthSign_41 = tmpvar_151; - }; - float tmpvar_152; - if (horzSpan_42) { - tmpvar_152 = 0.0; - } else { - tmpvar_152 = (lengthSign_41 * 0.5); - }; - float tmpvar_153; - tmpvar_153 = (pos_21.x + tmpvar_152); - posN_37.x = tmpvar_153; - float tmpvar_154; - if (horzSpan_42) { - tmpvar_154 = (lengthSign_41 * 0.5); - } else { - tmpvar_154 = 0.0; - }; - float tmpvar_155; - tmpvar_155 = (pos_21.y + tmpvar_154); - posN_37.y = vec2(tmpvar_155).y; - float tmpvar_156; - tmpvar_156 = (gradientN_40 * (1.0 / 4.0)); - gradientN_40 = tmpvar_156; - vec2 tmpvar_157; - tmpvar_157 = posN_37; - posP_36 = tmpvar_157; - vec2 tmpvar_158; - if (horzSpan_42) { - vec2 tmpvar_159; - tmpvar_159.y = 0.0; - tmpvar_159.x = rcpFrame_23.x; - tmpvar_158 = tmpvar_159; - } else { - vec2 tmpvar_160; - tmpvar_160.x = 0.0; - tmpvar_160.y = rcpFrame_23.y; - tmpvar_158 = tmpvar_160; - }; - vec2 tmpvar_161; - tmpvar_161 = tmpvar_158; - offNP_35 = tmpvar_161; - float tmpvar_162; - tmpvar_162 = lumaN_64; - lumaEndN_34 = tmpvar_162; - float tmpvar_163; - tmpvar_163 = lumaN_64; - lumaEndP_33 = tmpvar_163; - bool tmpvar_164; - tmpvar_164 = bool(0); - doneN_32 = tmpvar_164; - bool tmpvar_165; - tmpvar_165 = bool(0); - doneP_31 = tmpvar_165; - vec2 tmpvar_166; - tmpvar_166 = (posN_37 + (offNP_35 * vec2(-1.0, -1.0))); - posN_37 = tmpvar_166; - vec2 tmpvar_167; - tmpvar_167 = (posP_36 + (offNP_35 * vec2(1.0, 1.0))); - posP_36 = tmpvar_167; - int tmpvar_168; - tmpvar_168 = 0; - i_30 = tmpvar_168; - while (true) { - if (!((i_30 < 16))) { - break; - }; - if (!(doneN_32)) { - vec4 tmpvar_169; - tmpvar_169 = FxaaTexLod0 (tex_22, posN_37.xy); - float tmpvar_170; - tmpvar_170 = FxaaLuma (tmpvar_169.xyz); - float tmpvar_171; - tmpvar_171 = tmpvar_170; - lumaEndN_34 = tmpvar_171; - }; - if (!(doneP_31)) { - vec4 tmpvar_172; - tmpvar_172 = FxaaTexLod0 (tex_22, posP_36.xy); - float tmpvar_173; - tmpvar_173 = FxaaLuma (tmpvar_172.xyz); - float tmpvar_174; - tmpvar_174 = tmpvar_173; - lumaEndP_33 = tmpvar_174; - }; - bool tmpvar_175; - if (doneN_32) { - tmpvar_175 = bool(1); - } else { - float tmpvar_176; - tmpvar_176 = abs ((lumaEndN_34 - lumaN_64)); - tmpvar_175 = (tmpvar_176 >= gradientN_40); - }; - bool tmpvar_177; - tmpvar_177 = tmpvar_175; - doneN_32 = tmpvar_177; - bool tmpvar_178; - if (doneP_31) { - tmpvar_178 = bool(1); - } else { - float tmpvar_179; - tmpvar_179 = abs ((lumaEndP_33 - lumaN_64)); - tmpvar_178 = (tmpvar_179 >= gradientN_40); - }; - bool tmpvar_180; - tmpvar_180 = tmpvar_178; - doneP_31 = tmpvar_180; - if ((doneN_32 && doneP_31)) { - break; - }; - if (!(doneN_32)) { - vec2 tmpvar_181; - tmpvar_181 = (posN_37 - offNP_35); - posN_37 = tmpvar_181; - }; - if (!(doneP_31)) { - vec2 tmpvar_182; - tmpvar_182 = (posP_36 + offNP_35); - posP_36 = tmpvar_182; - }; - int _post_incdec_tmp_183; - _post_incdec_tmp_183 = i_30; - int tmpvar_184; - tmpvar_184 = (i_30 + 1); - i_30 = tmpvar_184; - }; - float tmpvar_185; - if (horzSpan_42) { - tmpvar_185 = (pos_21.x - posN_37.x); - } else { - tmpvar_185 = (pos_21.y - posN_37.y); - }; - float tmpvar_186; - tmpvar_186 = tmpvar_185; - dstN_29 = tmpvar_186; - float tmpvar_187; - if (horzSpan_42) { - tmpvar_187 = (posP_36.x - pos_21.x); - } else { - tmpvar_187 = (posP_36.y - pos_21.y); - }; - float tmpvar_188; - tmpvar_188 = tmpvar_187; - dstP_28 = tmpvar_188; - bool tmpvar_189; - tmpvar_189 = (dstN_29 < dstP_28); - directionN_27 = tmpvar_189; - float tmpvar_190; - if (directionN_27) { - tmpvar_190 = lumaEndN_34; - } else { - tmpvar_190 = lumaEndP_33; - }; - float tmpvar_191; - tmpvar_191 = tmpvar_190; - lumaEndN_34 = tmpvar_191; - if ((((lumaM_62 - lumaN_64) < 0.0) == ((lumaEndN_34 - lumaN_64) < 0.0))) { - float tmpvar_192; - tmpvar_192 = 0.0; - lengthSign_41 = tmpvar_192; - }; - float tmpvar_193; - tmpvar_193 = (dstP_28 + dstN_29); - spanLength_26 = tmpvar_193; - float tmpvar_194; - if (directionN_27) { - tmpvar_194 = dstN_29; - } else { - tmpvar_194 = dstP_28; - }; - float tmpvar_195; - tmpvar_195 = tmpvar_194; - dstN_29 = tmpvar_195; - float tmpvar_196; - tmpvar_196 = ((0.5 + (dstN_29 * - (-(1.0) / spanLength_26) - )) * lengthSign_41); - subPixelOffset_25 = tmpvar_196; - float tmpvar_197; - if (horzSpan_42) { - tmpvar_197 = 0.0; - } else { - tmpvar_197 = subPixelOffset_25; - }; - float tmpvar_198; - if (horzSpan_42) { - tmpvar_198 = subPixelOffset_25; - } else { - tmpvar_198 = 0.0; - }; - vec2 tmpvar_199; - tmpvar_199.x = (pos_21.x + tmpvar_197); - tmpvar_199.y = (pos_21.y + tmpvar_198); - vec4 tmpvar_200; - tmpvar_200 = FxaaTexLod0 (tex_22, tmpvar_199); - vec3 tmpvar_201; - tmpvar_201 = tmpvar_200.xyz; - rgbF_24 = tmpvar_201; - vec3 tmpvar_202; - tmpvar_202 = FxaaLerp3 (rgbL_56, rgbF_24, blendL_53); - vec3 tmpvar_203; - tmpvar_203 = FxaaFilterReturn (tmpvar_202); - return tmpvar_203; -} - -vec4 xlat_main ( - in vec2 uv_204 -) -{ - vec3 tmpvar_205; - tmpvar_205 = FxaaPixelShader (uv_204.xy, _MainTex, _MainTex_TexelSize.xy); - vec4 tmpvar_206; - tmpvar_206.w = 0.0; - tmpvar_206.xyz = tmpvar_205.xyz.xyz; - return tmpvar_206; -} - -void main () -{ - vec4 xl_retval_207; - vec2 tmpvar_208; - tmpvar_208 = xlv_TEXCOORD0.xy; - vec4 tmpvar_209; - tmpvar_209 = xlat_main (tmpvar_208); - vec4 tmpvar_210; - tmpvar_210 = tmpvar_209; - xl_retval_207 = tmpvar_210; - vec4 tmpvar_211; - tmpvar_211 = xl_retval_207.xyzw; - vec4 tmpvar_212; - tmpvar_212 = tmpvar_211; - gl_FragData[0] = tmpvar_212; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-out.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-out.txt index 5c45413d4..03c51d95b 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-out.txt @@ -16,108 +16,105 @@ void main () vec2 posN_10; float gradientN_11; float lengthSign_12; - float lumaS_13; - float lumaN_14; - vec4 tmpvar_15; - tmpvar_15.zw = vec2(0.0, 0.0); - tmpvar_15.xy = (xlv_TEXCOORD0 + (vec2(0.0, -1.0) * _MainTex_TexelSize.xy)); + vec3 rgbL_13; + float lumaS_14; + float lumaN_15; vec4 tmpvar_16; - tmpvar_16 = texture2DLod (_MainTex, tmpvar_15.xy, 0.0); + tmpvar_16.zw = vec2(0.0, 0.0); + tmpvar_16.xy = (xlv_TEXCOORD0 + (vec2(0.0, -1.0) * _MainTex_TexelSize.xy)); vec4 tmpvar_17; - tmpvar_17.zw = vec2(0.0, 0.0); - tmpvar_17.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 0.0) * _MainTex_TexelSize.xy)); + tmpvar_17 = texture2DLod (_MainTex, tmpvar_16.xy, 0.0); vec4 tmpvar_18; - tmpvar_18 = texture2DLod (_MainTex, tmpvar_17.xy, 0.0); + tmpvar_18.zw = vec2(0.0, 0.0); + tmpvar_18.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 0.0) * _MainTex_TexelSize.xy)); vec4 tmpvar_19; - tmpvar_19 = texture2DLod (_MainTex, xlv_TEXCOORD0, 0.0); + tmpvar_19 = texture2DLod (_MainTex, tmpvar_18.xy, 0.0); vec4 tmpvar_20; - tmpvar_20.zw = vec2(0.0, 0.0); - tmpvar_20.xy = (xlv_TEXCOORD0 + (vec2(1.0, 0.0) * _MainTex_TexelSize.xy)); + tmpvar_20 = texture2DLod (_MainTex, xlv_TEXCOORD0, 0.0); vec4 tmpvar_21; - tmpvar_21 = texture2DLod (_MainTex, tmpvar_20.xy, 0.0); + tmpvar_21.zw = vec2(0.0, 0.0); + tmpvar_21.xy = (xlv_TEXCOORD0 + (vec2(1.0, 0.0) * _MainTex_TexelSize.xy)); vec4 tmpvar_22; - tmpvar_22.zw = vec2(0.0, 0.0); - tmpvar_22.xy = (xlv_TEXCOORD0 + (vec2(0.0, 1.0) * _MainTex_TexelSize.xy)); + tmpvar_22 = texture2DLod (_MainTex, tmpvar_21.xy, 0.0); vec4 tmpvar_23; - tmpvar_23 = texture2DLod (_MainTex, tmpvar_22.xy, 0.0); - float tmpvar_24; - tmpvar_24 = ((tmpvar_16.y * 1.96321) + tmpvar_16.x); - lumaN_14 = tmpvar_24; + tmpvar_23.zw = vec2(0.0, 0.0); + tmpvar_23.xy = (xlv_TEXCOORD0 + (vec2(0.0, 1.0) * _MainTex_TexelSize.xy)); + vec4 tmpvar_24; + tmpvar_24 = texture2DLod (_MainTex, tmpvar_23.xy, 0.0); float tmpvar_25; - tmpvar_25 = ((tmpvar_18.y * 1.96321) + tmpvar_18.x); + tmpvar_25 = ((tmpvar_17.y * 1.96321) + tmpvar_17.x); + lumaN_15 = tmpvar_25; float tmpvar_26; tmpvar_26 = ((tmpvar_19.y * 1.96321) + tmpvar_19.x); float tmpvar_27; - tmpvar_27 = ((tmpvar_21.y * 1.96321) + tmpvar_21.x); + tmpvar_27 = ((tmpvar_20.y * 1.96321) + tmpvar_20.x); float tmpvar_28; - tmpvar_28 = ((tmpvar_23.y * 1.96321) + tmpvar_23.x); - lumaS_13 = tmpvar_28; + tmpvar_28 = ((tmpvar_22.y * 1.96321) + tmpvar_22.x); float tmpvar_29; - tmpvar_29 = max (tmpvar_26, max (max (tmpvar_24, tmpvar_25), max (tmpvar_28, tmpvar_27))); + tmpvar_29 = ((tmpvar_24.y * 1.96321) + tmpvar_24.x); + lumaS_14 = tmpvar_29; float tmpvar_30; - tmpvar_30 = (tmpvar_29 - min (tmpvar_26, min ( - min (tmpvar_24, tmpvar_25) - , - min (tmpvar_28, tmpvar_27) - ))); + tmpvar_30 = max (max (tmpvar_27, tmpvar_25), max (max (tmpvar_26, tmpvar_29), tmpvar_28)); float tmpvar_31; - tmpvar_31 = max (0.0416667, (tmpvar_29 * 0.125)); - if ((tmpvar_30 < tmpvar_31)) { - tmpvar_2 = tmpvar_19.xyz; + tmpvar_31 = (tmpvar_30 - min (min (tmpvar_27, tmpvar_25), min ( + min (tmpvar_26, tmpvar_29) + , tmpvar_28))); + float tmpvar_32; + tmpvar_32 = max (0.0416667, (tmpvar_30 * 0.125)); + if ((tmpvar_31 < tmpvar_32)) { + tmpvar_2 = tmpvar_20.xyz; } else { - float tmpvar_32; - tmpvar_32 = min (0.75, (max (0.0, + float tmpvar_33; + tmpvar_33 = min (0.75, (max (0.0, ((abs(( - ((((tmpvar_24 + tmpvar_25) + tmpvar_27) + tmpvar_28) * 0.25) - - tmpvar_26)) / tmpvar_30) - 0.25) + (((tmpvar_25 + tmpvar_26) + (tmpvar_28 + tmpvar_29)) * 0.25) + - tmpvar_27)) / tmpvar_31) - 0.25) ) * 1.33333)); - vec4 tmpvar_33; - tmpvar_33.zw = vec2(0.0, 0.0); - tmpvar_33.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy); vec4 tmpvar_34; - tmpvar_34 = texture2DLod (_MainTex, tmpvar_33.xy, 0.0); + tmpvar_34.zw = vec2(0.0, 0.0); + tmpvar_34.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy); vec4 tmpvar_35; - tmpvar_35.zw = vec2(0.0, 0.0); - tmpvar_35.xy = (xlv_TEXCOORD0 + (vec2(1.0, -1.0) * _MainTex_TexelSize.xy)); + tmpvar_35 = texture2DLod (_MainTex, tmpvar_34.xy, 0.0); vec4 tmpvar_36; - tmpvar_36 = texture2DLod (_MainTex, tmpvar_35.xy, 0.0); + tmpvar_36.zw = vec2(0.0, 0.0); + tmpvar_36.xy = (xlv_TEXCOORD0 + (vec2(1.0, -1.0) * _MainTex_TexelSize.xy)); vec4 tmpvar_37; - tmpvar_37.zw = vec2(0.0, 0.0); - tmpvar_37.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 1.0) * _MainTex_TexelSize.xy)); + tmpvar_37 = texture2DLod (_MainTex, tmpvar_36.xy, 0.0); vec4 tmpvar_38; - tmpvar_38 = texture2DLod (_MainTex, tmpvar_37.xy, 0.0); + tmpvar_38.zw = vec2(0.0, 0.0); + tmpvar_38.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 1.0) * _MainTex_TexelSize.xy)); vec4 tmpvar_39; - tmpvar_39.zw = vec2(0.0, 0.0); - tmpvar_39.xy = (xlv_TEXCOORD0 + _MainTex_TexelSize.xy); + tmpvar_39 = texture2DLod (_MainTex, tmpvar_38.xy, 0.0); vec4 tmpvar_40; - tmpvar_40 = texture2DLod (_MainTex, tmpvar_39.xy, 0.0); - vec3 tmpvar_41; - tmpvar_41 = ((( - (((tmpvar_16.xyz + tmpvar_18.xyz) + tmpvar_19.xyz) + tmpvar_21.xyz) - + tmpvar_23.xyz) + ( - ((tmpvar_34.xyz + tmpvar_36.xyz) + tmpvar_38.xyz) - + tmpvar_40.xyz)) * vec3(0.111111, 0.111111, 0.111111)); + tmpvar_40.zw = vec2(0.0, 0.0); + tmpvar_40.xy = (xlv_TEXCOORD0 + _MainTex_TexelSize.xy); + vec4 tmpvar_41; + tmpvar_41 = texture2DLod (_MainTex, tmpvar_40.xy, 0.0); + 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)); float tmpvar_42; - tmpvar_42 = ((tmpvar_34.y * 1.96321) + tmpvar_34.x); + tmpvar_42 = ((tmpvar_35.y * 1.96321) + tmpvar_35.x); float tmpvar_43; - tmpvar_43 = ((tmpvar_36.y * 1.96321) + tmpvar_36.x); + tmpvar_43 = ((tmpvar_37.y * 1.96321) + tmpvar_37.x); float tmpvar_44; - tmpvar_44 = ((tmpvar_38.y * 1.96321) + tmpvar_38.x); + tmpvar_44 = ((tmpvar_39.y * 1.96321) + tmpvar_39.x); float tmpvar_45; - tmpvar_45 = ((tmpvar_40.y * 1.96321) + tmpvar_40.x); + tmpvar_45 = ((tmpvar_41.y * 1.96321) + tmpvar_41.x); bool tmpvar_46; tmpvar_46 = ((( - abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_25)) + (0.25 * tmpvar_44))) + abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_26)) + (0.25 * tmpvar_44))) + - abs((((0.5 * tmpvar_24) - tmpvar_26) + (0.5 * tmpvar_28))) + abs((((0.5 * tmpvar_25) - tmpvar_27) + (0.5 * tmpvar_29))) ) + abs( - (((0.25 * tmpvar_43) + (-0.5 * tmpvar_27)) + (0.25 * tmpvar_45)) + (((0.25 * tmpvar_43) + (-0.5 * tmpvar_28)) + (0.25 * tmpvar_45)) )) >= (( - abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_24)) + (0.25 * tmpvar_43))) + abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_25)) + (0.25 * tmpvar_43))) + - abs((((0.5 * tmpvar_25) - tmpvar_26) + (0.5 * tmpvar_27))) + abs((((0.5 * tmpvar_26) - tmpvar_27) + (0.5 * tmpvar_28))) ) + abs( - (((0.25 * tmpvar_44) + (-0.5 * tmpvar_28)) + (0.25 * tmpvar_45)) + (((0.25 * tmpvar_44) + (-0.5 * tmpvar_29)) + (0.25 * tmpvar_45)) ))); float tmpvar_47; if (tmpvar_46) { @@ -127,165 +124,169 @@ void main () }; lengthSign_12 = tmpvar_47; if (!(tmpvar_46)) { - lumaN_14 = tmpvar_25; + lumaN_15 = tmpvar_26; }; if (!(tmpvar_46)) { - lumaS_13 = tmpvar_27; + lumaS_14 = tmpvar_28; }; float tmpvar_48; - tmpvar_48 = abs((lumaN_14 - tmpvar_26)); + tmpvar_48 = abs((lumaN_15 - tmpvar_27)); gradientN_11 = tmpvar_48; float tmpvar_49; - tmpvar_49 = abs((lumaS_13 - tmpvar_26)); - lumaN_14 = ((lumaN_14 + tmpvar_26) * 0.5); - float tmpvar_50; - tmpvar_50 = ((lumaS_13 + tmpvar_26) * 0.5); - lumaS_13 = tmpvar_50; - bool tmpvar_51; - tmpvar_51 = (tmpvar_48 >= tmpvar_49); - if (!(tmpvar_51)) { - lumaN_14 = tmpvar_50; + tmpvar_49 = abs((lumaS_14 - tmpvar_27)); + lumaN_15 = ((lumaN_15 + tmpvar_27) * 0.5); + lumaS_14 = ((lumaS_14 + tmpvar_27) * 0.5); + bool tmpvar_50; + tmpvar_50 = (tmpvar_48 >= tmpvar_49); + if (!(tmpvar_50)) { + lumaN_15 = lumaS_14; }; - if (!(tmpvar_51)) { + if (!(tmpvar_50)) { gradientN_11 = tmpvar_49; }; - if (!(tmpvar_51)) { + if (!(tmpvar_50)) { lengthSign_12 = -(tmpvar_47); }; + float tmpvar_51; + if (tmpvar_46) { + tmpvar_51 = 0.0; + } else { + tmpvar_51 = (lengthSign_12 * 0.5); + }; + posN_10.x = (xlv_TEXCOORD0.x + tmpvar_51); float tmpvar_52; if (tmpvar_46) { - tmpvar_52 = 0.0; - } else { tmpvar_52 = (lengthSign_12 * 0.5); - }; - posN_10.x = (xlv_TEXCOORD0.x + tmpvar_52); - float tmpvar_53; - if (tmpvar_46) { - tmpvar_53 = (lengthSign_12 * 0.5); } else { - tmpvar_53 = 0.0; + tmpvar_52 = 0.0; }; - posN_10.y = (xlv_TEXCOORD0.y + tmpvar_53); + posN_10.y = (xlv_TEXCOORD0.y + tmpvar_52); gradientN_11 = (gradientN_11 * 0.25); posP_9 = posN_10; - vec2 tmpvar_54; + vec2 tmpvar_53; if (tmpvar_46) { - vec2 tmpvar_55; - tmpvar_55.y = 0.0; - tmpvar_55.x = rcpFrame_1.x; - tmpvar_54 = tmpvar_55; + vec2 tmpvar_54; + tmpvar_54.y = 0.0; + tmpvar_54.x = rcpFrame_1.x; + tmpvar_53 = tmpvar_54; } else { - vec2 tmpvar_56; - tmpvar_56.x = 0.0; - tmpvar_56.y = rcpFrame_1.y; - tmpvar_54 = tmpvar_56; + vec2 tmpvar_55; + tmpvar_55.x = 0.0; + tmpvar_55.y = rcpFrame_1.y; + tmpvar_53 = tmpvar_55; }; - offNP_8 = tmpvar_54; - lumaEndN_7 = lumaN_14; - lumaEndP_6 = lumaN_14; + offNP_8 = tmpvar_53; + lumaEndN_7 = lumaN_15; + lumaEndP_6 = lumaN_15; doneN_5 = bool(0); doneP_4 = bool(0); - posN_10 = (posN_10 - tmpvar_54); - posP_9 = (posP_9 + tmpvar_54); + posN_10 = (posN_10 - tmpvar_53); + posP_9 = (posP_9 + tmpvar_53); for (int i_3 = 0; i_3 < 16; i_3++) { if (!(doneN_5)) { - vec4 tmpvar_57; - tmpvar_57 = texture2DLod (_MainTex, posN_10, 0.0); - lumaEndN_7 = ((tmpvar_57.y * 1.96321) + tmpvar_57.x); + vec4 tmpvar_56; + tmpvar_56 = texture2DLod (_MainTex, posN_10, 0.0); + lumaEndN_7 = ((tmpvar_56.y * 1.96321) + tmpvar_56.x); }; if (!(doneP_4)) { - vec4 tmpvar_58; - tmpvar_58 = texture2DLod (_MainTex, posP_9, 0.0); - lumaEndP_6 = ((tmpvar_58.y * 1.96321) + tmpvar_58.x); + vec4 tmpvar_57; + tmpvar_57 = texture2DLod (_MainTex, posP_9, 0.0); + lumaEndP_6 = ((tmpvar_57.y * 1.96321) + tmpvar_57.x); }; - bool tmpvar_59; + bool tmpvar_58; if (doneN_5) { + tmpvar_58 = bool(1); + } else { + tmpvar_58 = (abs((lumaEndN_7 - lumaN_15)) >= gradientN_11); + }; + doneN_5 = tmpvar_58; + bool tmpvar_59; + if (doneP_4) { tmpvar_59 = bool(1); } else { - tmpvar_59 = (abs((lumaEndN_7 - lumaN_14)) >= gradientN_11); + tmpvar_59 = (abs((lumaEndP_6 - lumaN_15)) >= gradientN_11); }; - doneN_5 = tmpvar_59; - bool tmpvar_60; - if (doneP_4) { - tmpvar_60 = bool(1); - } else { - tmpvar_60 = (abs((lumaEndP_6 - lumaN_14)) >= gradientN_11); - }; - doneP_4 = tmpvar_60; - if ((tmpvar_59 && tmpvar_60)) { + doneP_4 = tmpvar_59; + if ((tmpvar_58 && tmpvar_59)) { break; }; - if (!(tmpvar_59)) { + if (!(tmpvar_58)) { posN_10 = (posN_10 - offNP_8); }; - if (!(tmpvar_60)) { + if (!(tmpvar_59)) { posP_9 = (posP_9 + offNP_8); }; }; + float tmpvar_60; + if (tmpvar_46) { + tmpvar_60 = (xlv_TEXCOORD0.x - posN_10.x); + } else { + tmpvar_60 = (xlv_TEXCOORD0.y - posN_10.y); + }; float tmpvar_61; if (tmpvar_46) { - tmpvar_61 = (xlv_TEXCOORD0.x - posN_10.x); + tmpvar_61 = (posP_9.x - xlv_TEXCOORD0.x); } else { - tmpvar_61 = (xlv_TEXCOORD0.y - posN_10.y); + tmpvar_61 = (posP_9.y - xlv_TEXCOORD0.y); }; - float tmpvar_62; - if (tmpvar_46) { - tmpvar_62 = (posP_9.x - xlv_TEXCOORD0.x); + bool tmpvar_62; + tmpvar_62 = (tmpvar_60 < tmpvar_61); + float tmpvar_63; + if (tmpvar_62) { + tmpvar_63 = lumaEndN_7; } else { - tmpvar_62 = (posP_9.y - xlv_TEXCOORD0.y); + tmpvar_63 = lumaEndP_6; }; - bool tmpvar_63; - tmpvar_63 = (tmpvar_61 < tmpvar_62); - float tmpvar_64; - if (tmpvar_63) { - tmpvar_64 = lumaEndN_7; - } else { - tmpvar_64 = lumaEndP_6; - }; - lumaEndN_7 = tmpvar_64; - if ((((tmpvar_26 - lumaN_14) < 0.0) == ((tmpvar_64 - lumaN_14) < 0.0))) { + lumaEndN_7 = tmpvar_63; + if ((((tmpvar_27 - lumaN_15) < 0.0) == ((tmpvar_63 - lumaN_15) < 0.0))) { lengthSign_12 = 0.0; }; + float tmpvar_64; + tmpvar_64 = (tmpvar_61 + tmpvar_60); float tmpvar_65; - tmpvar_65 = (tmpvar_62 + tmpvar_61); - float tmpvar_66; - if (tmpvar_63) { - tmpvar_66 = tmpvar_61; + if (tmpvar_62) { + tmpvar_65 = tmpvar_60; } else { - tmpvar_66 = tmpvar_62; + tmpvar_65 = tmpvar_61; }; - float tmpvar_67; - tmpvar_67 = ((0.5 + (tmpvar_66 * - (-1.0 / tmpvar_65) + float tmpvar_66; + tmpvar_66 = ((0.5 + (tmpvar_65 * + (-1.0 / tmpvar_64) )) * lengthSign_12); + float tmpvar_67; + if (tmpvar_46) { + tmpvar_67 = 0.0; + } else { + tmpvar_67 = tmpvar_66; + }; float tmpvar_68; if (tmpvar_46) { + tmpvar_68 = tmpvar_66; + } else { tmpvar_68 = 0.0; - } else { - tmpvar_68 = tmpvar_67; }; - float tmpvar_69; - if (tmpvar_46) { - tmpvar_69 = tmpvar_67; - } else { - tmpvar_69 = 0.0; - }; - vec2 tmpvar_70; - tmpvar_70.x = (xlv_TEXCOORD0.x + tmpvar_68); - tmpvar_70.y = (xlv_TEXCOORD0.y + tmpvar_69); - vec4 tmpvar_71; - tmpvar_71 = texture2DLod (_MainTex, tmpvar_70, 0.0); - vec3 tmpvar_72; - tmpvar_72.x = -(tmpvar_32); - tmpvar_72.y = -(tmpvar_32); - tmpvar_72.z = -(tmpvar_32); - tmpvar_2 = ((tmpvar_72 * tmpvar_71.xyz) + ((tmpvar_41 * vec3(tmpvar_32)) + tmpvar_71.xyz)); + vec2 tmpvar_69; + tmpvar_69.x = (xlv_TEXCOORD0.x + tmpvar_67); + tmpvar_69.y = (xlv_TEXCOORD0.y + tmpvar_68); + vec4 tmpvar_70; + tmpvar_70 = texture2DLod (_MainTex, tmpvar_69, 0.0); + vec3 tmpvar_71; + tmpvar_71.x = -(tmpvar_33); + tmpvar_71.y = -(tmpvar_33); + tmpvar_71.z = -(tmpvar_33); + tmpvar_2 = ((tmpvar_71 * tmpvar_70.xyz) + ((rgbL_13 * vec3(tmpvar_33)) + tmpvar_70.xyz)); }; - vec4 tmpvar_73; - tmpvar_73.w = 0.0; - tmpvar_73.xyz = tmpvar_2; - gl_FragData[0] = tmpvar_73; + vec4 tmpvar_72; + tmpvar_72.w = 0.0; + tmpvar_72.xyz = tmpvar_2; + gl_FragData[0] = tmpvar_72; } -// inputs: 1, stats: 191 alu 12 tex 26 flow +// stats: 191 alu 12 tex 26 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// uniforms: 1 (total size: 0) +// #0: _MainTex_TexelSize (high float) 4x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3.txt new file mode 100644 index 000000000..f0ee0edc0 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3.txt @@ -0,0 +1,293 @@ +#version 300 es +out lowp vec4 _fragData; +uniform sampler2D _MainTex; +uniform highp vec4 _MainTex_TexelSize; +in highp vec2 xlv_TEXCOORD0; +void main () +{ + highp vec2 rcpFrame_1; + rcpFrame_1 = _MainTex_TexelSize.xy; + lowp vec3 tmpvar_2; + bool doneP_4; + bool doneN_5; + lowp float lumaEndP_6; + lowp float lumaEndN_7; + highp vec2 offNP_8; + highp vec2 posP_9; + highp vec2 posN_10; + lowp float gradientN_11; + highp float lengthSign_12; + lowp vec3 rgbL_13; + lowp float lumaS_14; + lowp float lumaN_15; + highp vec4 tmpvar_16; + tmpvar_16.zw = vec2(0.0, 0.0); + tmpvar_16.xy = (xlv_TEXCOORD0 + (vec2(0.0, -1.0) * _MainTex_TexelSize.xy)); + lowp vec4 tmpvar_17; + tmpvar_17 = textureLod (_MainTex, tmpvar_16.xy, 0.0); + highp vec4 tmpvar_18; + tmpvar_18.zw = vec2(0.0, 0.0); + tmpvar_18.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 0.0) * _MainTex_TexelSize.xy)); + lowp vec4 tmpvar_19; + tmpvar_19 = textureLod (_MainTex, tmpvar_18.xy, 0.0); + lowp vec4 tmpvar_20; + tmpvar_20 = textureLod (_MainTex, xlv_TEXCOORD0, 0.0); + highp vec4 tmpvar_21; + tmpvar_21.zw = vec2(0.0, 0.0); + tmpvar_21.xy = (xlv_TEXCOORD0 + (vec2(1.0, 0.0) * _MainTex_TexelSize.xy)); + lowp vec4 tmpvar_22; + tmpvar_22 = textureLod (_MainTex, tmpvar_21.xy, 0.0); + highp vec4 tmpvar_23; + tmpvar_23.zw = vec2(0.0, 0.0); + tmpvar_23.xy = (xlv_TEXCOORD0 + (vec2(0.0, 1.0) * _MainTex_TexelSize.xy)); + 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); + lumaN_15 = tmpvar_25; + lowp float tmpvar_26; + tmpvar_26 = ((tmpvar_19.y * 1.96321) + tmpvar_19.x); + lowp float tmpvar_27; + tmpvar_27 = ((tmpvar_20.y * 1.96321) + tmpvar_20.x); + lowp float tmpvar_28; + tmpvar_28 = ((tmpvar_22.y * 1.96321) + tmpvar_22.x); + lowp float tmpvar_29; + tmpvar_29 = ((tmpvar_24.y * 1.96321) + 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)); + lowp float tmpvar_31; + tmpvar_31 = (tmpvar_30 - min (min (tmpvar_27, tmpvar_25), min ( + min (tmpvar_26, tmpvar_29) + , tmpvar_28))); + lowp float tmpvar_32; + tmpvar_32 = max (0.0416667, (tmpvar_30 * 0.125)); + if ((tmpvar_31 < tmpvar_32)) { + tmpvar_2 = tmpvar_20.xyz; + } else { + lowp float tmpvar_33; + tmpvar_33 = min (0.75, (max (0.0, + ((abs(( + (((tmpvar_25 + tmpvar_26) + (tmpvar_28 + tmpvar_29)) * 0.25) + - tmpvar_27)) / tmpvar_31) - 0.25) + ) * 1.33333)); + highp vec4 tmpvar_34; + tmpvar_34.zw = vec2(0.0, 0.0); + tmpvar_34.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy); + lowp vec4 tmpvar_35; + tmpvar_35 = textureLod (_MainTex, tmpvar_34.xy, 0.0); + highp vec4 tmpvar_36; + tmpvar_36.zw = vec2(0.0, 0.0); + tmpvar_36.xy = (xlv_TEXCOORD0 + (vec2(1.0, -1.0) * _MainTex_TexelSize.xy)); + lowp vec4 tmpvar_37; + tmpvar_37 = textureLod (_MainTex, tmpvar_36.xy, 0.0); + highp vec4 tmpvar_38; + tmpvar_38.zw = vec2(0.0, 0.0); + tmpvar_38.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 1.0) * _MainTex_TexelSize.xy)); + lowp vec4 tmpvar_39; + tmpvar_39 = textureLod (_MainTex, tmpvar_38.xy, 0.0); + highp vec4 tmpvar_40; + tmpvar_40.zw = vec2(0.0, 0.0); + tmpvar_40.xy = (xlv_TEXCOORD0 + _MainTex_TexelSize.xy); + lowp vec4 tmpvar_41; + tmpvar_41 = textureLod (_MainTex, tmpvar_40.xy, 0.0); + 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)); + lowp float tmpvar_42; + tmpvar_42 = ((tmpvar_35.y * 1.96321) + tmpvar_35.x); + lowp float tmpvar_43; + tmpvar_43 = ((tmpvar_37.y * 1.96321) + tmpvar_37.x); + lowp float tmpvar_44; + tmpvar_44 = ((tmpvar_39.y * 1.96321) + tmpvar_39.x); + lowp float tmpvar_45; + tmpvar_45 = ((tmpvar_41.y * 1.96321) + tmpvar_41.x); + bool tmpvar_46; + tmpvar_46 = ((( + abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_26)) + (0.25 * tmpvar_44))) + + + abs((((0.5 * tmpvar_25) - tmpvar_27) + (0.5 * tmpvar_29))) + ) + abs( + (((0.25 * tmpvar_43) + (-0.5 * tmpvar_28)) + (0.25 * tmpvar_45)) + )) >= (( + abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_25)) + (0.25 * tmpvar_43))) + + + abs((((0.5 * tmpvar_26) - tmpvar_27) + (0.5 * tmpvar_28))) + ) + abs( + (((0.25 * tmpvar_44) + (-0.5 * tmpvar_29)) + (0.25 * tmpvar_45)) + ))); + highp float tmpvar_47; + if (tmpvar_46) { + tmpvar_47 = -(_MainTex_TexelSize.y); + } else { + tmpvar_47 = -(_MainTex_TexelSize.x); + }; + lengthSign_12 = tmpvar_47; + if (!(tmpvar_46)) { + lumaN_15 = tmpvar_26; + }; + if (!(tmpvar_46)) { + lumaS_14 = tmpvar_28; + }; + lowp float tmpvar_48; + tmpvar_48 = abs((lumaN_15 - tmpvar_27)); + gradientN_11 = tmpvar_48; + lowp float tmpvar_49; + tmpvar_49 = abs((lumaS_14 - tmpvar_27)); + lumaN_15 = ((lumaN_15 + tmpvar_27) * 0.5); + lumaS_14 = ((lumaS_14 + tmpvar_27) * 0.5); + bool tmpvar_50; + tmpvar_50 = (tmpvar_48 >= tmpvar_49); + if (!(tmpvar_50)) { + lumaN_15 = lumaS_14; + }; + if (!(tmpvar_50)) { + gradientN_11 = tmpvar_49; + }; + if (!(tmpvar_50)) { + lengthSign_12 = -(tmpvar_47); + }; + highp float tmpvar_51; + if (tmpvar_46) { + tmpvar_51 = 0.0; + } else { + tmpvar_51 = (lengthSign_12 * 0.5); + }; + posN_10.x = (xlv_TEXCOORD0.x + tmpvar_51); + highp float tmpvar_52; + if (tmpvar_46) { + tmpvar_52 = (lengthSign_12 * 0.5); + } else { + tmpvar_52 = 0.0; + }; + posN_10.y = (xlv_TEXCOORD0.y + tmpvar_52); + gradientN_11 = (gradientN_11 * 0.25); + posP_9 = posN_10; + highp vec2 tmpvar_53; + if (tmpvar_46) { + highp vec2 tmpvar_54; + tmpvar_54.y = 0.0; + tmpvar_54.x = rcpFrame_1.x; + tmpvar_53 = tmpvar_54; + } else { + highp vec2 tmpvar_55; + tmpvar_55.x = 0.0; + tmpvar_55.y = rcpFrame_1.y; + tmpvar_53 = tmpvar_55; + }; + offNP_8 = tmpvar_53; + lumaEndN_7 = lumaN_15; + lumaEndP_6 = lumaN_15; + doneN_5 = bool(0); + 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++) { + 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); + }; + 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); + }; + bool tmpvar_58; + if (doneN_5) { + tmpvar_58 = bool(1); + } else { + tmpvar_58 = (abs((lumaEndN_7 - lumaN_15)) >= gradientN_11); + }; + doneN_5 = tmpvar_58; + bool tmpvar_59; + if (doneP_4) { + tmpvar_59 = bool(1); + } else { + tmpvar_59 = (abs((lumaEndP_6 - lumaN_15)) >= gradientN_11); + }; + doneP_4 = tmpvar_59; + if ((tmpvar_58 && tmpvar_59)) { + break; + }; + if (!(tmpvar_58)) { + posN_10 = (posN_10 - offNP_8); + }; + if (!(tmpvar_59)) { + posP_9 = (posP_9 + offNP_8); + }; + }; + highp float tmpvar_60; + if (tmpvar_46) { + tmpvar_60 = (xlv_TEXCOORD0.x - posN_10.x); + } else { + tmpvar_60 = (xlv_TEXCOORD0.y - posN_10.y); + }; + highp float tmpvar_61; + if (tmpvar_46) { + tmpvar_61 = (posP_9.x - xlv_TEXCOORD0.x); + } else { + tmpvar_61 = (posP_9.y - xlv_TEXCOORD0.y); + }; + bool tmpvar_62; + tmpvar_62 = (tmpvar_60 < tmpvar_61); + lowp float tmpvar_63; + if (tmpvar_62) { + tmpvar_63 = lumaEndN_7; + } else { + tmpvar_63 = lumaEndP_6; + }; + lumaEndN_7 = tmpvar_63; + if ((((tmpvar_27 - lumaN_15) < 0.0) == ((tmpvar_63 - lumaN_15) < 0.0))) { + lengthSign_12 = 0.0; + }; + highp float tmpvar_64; + tmpvar_64 = (tmpvar_61 + tmpvar_60); + highp float tmpvar_65; + if (tmpvar_62) { + tmpvar_65 = tmpvar_60; + } else { + tmpvar_65 = tmpvar_61; + }; + highp float tmpvar_66; + tmpvar_66 = ((0.5 + (tmpvar_65 * + (-1.0 / tmpvar_64) + )) * lengthSign_12); + highp float tmpvar_67; + if (tmpvar_46) { + tmpvar_67 = 0.0; + } else { + tmpvar_67 = tmpvar_66; + }; + highp float tmpvar_68; + if (tmpvar_46) { + tmpvar_68 = tmpvar_66; + } else { + tmpvar_68 = 0.0; + }; + highp vec2 tmpvar_69; + tmpvar_69.x = (xlv_TEXCOORD0.x + tmpvar_67); + tmpvar_69.y = (xlv_TEXCOORD0.y + tmpvar_68); + lowp vec4 tmpvar_70; + tmpvar_70 = textureLod (_MainTex, tmpvar_69, 0.0); + lowp vec3 tmpvar_71; + tmpvar_71.x = -(tmpvar_33); + tmpvar_71.y = -(tmpvar_33); + tmpvar_71.z = -(tmpvar_33); + tmpvar_2 = ((tmpvar_71 * tmpvar_70.xyz) + ((rgbL_13 * vec3(tmpvar_33)) + tmpvar_70.xyz)); + }; + lowp vec4 tmpvar_72; + tmpvar_72.w = 0.0; + tmpvar_72.xyz = tmpvar_2; + _fragData = tmpvar_72; +} + + +// stats: 191 alu 12 tex 26 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// uniforms: 1 (total size: 0) +// #0: _MainTex_TexelSize (high float) 4x1 [-1] +// textures: 1 +// #0: _MainTex (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3Metal.txt new file mode 100644 index 000000000..8eb42aa0a --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3Metal.txt @@ -0,0 +1,302 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float2 xlv_TEXCOORD0; +}; +struct xlatMtlShaderOutput { + half4 _fragData [[color(0)]]; +}; +struct xlatMtlShaderUniform { + float4 _MainTex_TexelSize; +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , texture2d _MainTex [[texture(0)]], sampler _mtlsmp__MainTex [[sampler(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + float2 rcpFrame_1; + rcpFrame_1 = _mtl_u._MainTex_TexelSize.xy; + half3 tmpvar_2; + bool doneP_4; + bool doneN_5; + half lumaEndP_6; + half lumaEndN_7; + float2 offNP_8; + float2 posP_9; + float2 posN_10; + half gradientN_11; + float lengthSign_12; + half3 rgbL_13; + half lumaS_14; + half lumaN_15; + float4 tmpvar_16; + tmpvar_16.zw = float2(0.0, 0.0); + tmpvar_16.xy = (_mtl_i.xlv_TEXCOORD0 + (float2(0.0, -1.0) * _mtl_u._MainTex_TexelSize.xy)); + half4 tmpvar_17; + tmpvar_17 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_16.xy), level(0.0)); + float4 tmpvar_18; + tmpvar_18.zw = float2(0.0, 0.0); + tmpvar_18.xy = (_mtl_i.xlv_TEXCOORD0 + (float2(-1.0, 0.0) * _mtl_u._MainTex_TexelSize.xy)); + half4 tmpvar_19; + tmpvar_19 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_18.xy), level(0.0)); + half4 tmpvar_20; + tmpvar_20 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0), level(0.0)); + float4 tmpvar_21; + tmpvar_21.zw = float2(0.0, 0.0); + tmpvar_21.xy = (_mtl_i.xlv_TEXCOORD0 + (float2(1.0, 0.0) * _mtl_u._MainTex_TexelSize.xy)); + half4 tmpvar_22; + tmpvar_22 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_21.xy), level(0.0)); + float4 tmpvar_23; + tmpvar_23.zw = float2(0.0, 0.0); + tmpvar_23.xy = (_mtl_i.xlv_TEXCOORD0 + (float2(0.0, 1.0) * _mtl_u._MainTex_TexelSize.xy)); + 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); + lumaN_15 = tmpvar_25; + half tmpvar_26; + tmpvar_26 = ((tmpvar_19.y * (half)1.96321) + tmpvar_19.x); + half tmpvar_27; + tmpvar_27 = ((tmpvar_20.y * (half)1.96321) + tmpvar_20.x); + half tmpvar_28; + tmpvar_28 = ((tmpvar_22.y * (half)1.96321) + tmpvar_22.x); + half tmpvar_29; + tmpvar_29 = ((tmpvar_24.y * (half)1.96321) + 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)); + half tmpvar_31; + tmpvar_31 = (tmpvar_30 - min (min (tmpvar_27, tmpvar_25), min ( + min (tmpvar_26, tmpvar_29) + , tmpvar_28))); + half tmpvar_32; + tmpvar_32 = max ((half)0.0416667, (tmpvar_30 * (half)0.125)); + if ((tmpvar_31 < tmpvar_32)) { + tmpvar_2 = tmpvar_20.xyz; + } else { + half tmpvar_33; + tmpvar_33 = min ((half)0.75, (max ((half)0.0, + ((abs(( + (((tmpvar_25 + tmpvar_26) + (tmpvar_28 + tmpvar_29)) * (half)0.25) + - tmpvar_27)) / tmpvar_31) - (half)0.25) + ) * (half)1.33333)); + float4 tmpvar_34; + tmpvar_34.zw = float2(0.0, 0.0); + tmpvar_34.xy = (_mtl_i.xlv_TEXCOORD0 - _mtl_u._MainTex_TexelSize.xy); + half4 tmpvar_35; + tmpvar_35 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_34.xy), level(0.0)); + float4 tmpvar_36; + tmpvar_36.zw = float2(0.0, 0.0); + tmpvar_36.xy = (_mtl_i.xlv_TEXCOORD0 + (float2(1.0, -1.0) * _mtl_u._MainTex_TexelSize.xy)); + half4 tmpvar_37; + tmpvar_37 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_36.xy), level(0.0)); + float4 tmpvar_38; + tmpvar_38.zw = float2(0.0, 0.0); + tmpvar_38.xy = (_mtl_i.xlv_TEXCOORD0 + (float2(-1.0, 1.0) * _mtl_u._MainTex_TexelSize.xy)); + half4 tmpvar_39; + tmpvar_39 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_38.xy), level(0.0)); + float4 tmpvar_40; + tmpvar_40.zw = float2(0.0, 0.0); + tmpvar_40.xy = (_mtl_i.xlv_TEXCOORD0 + _mtl_u._MainTex_TexelSize.xy); + half4 tmpvar_41; + tmpvar_41 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_40.xy), level(0.0)); + 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)); + half tmpvar_42; + tmpvar_42 = ((tmpvar_35.y * (half)1.96321) + tmpvar_35.x); + half tmpvar_43; + tmpvar_43 = ((tmpvar_37.y * (half)1.96321) + tmpvar_37.x); + half tmpvar_44; + tmpvar_44 = ((tmpvar_39.y * (half)1.96321) + tmpvar_39.x); + half tmpvar_45; + tmpvar_45 = ((tmpvar_41.y * (half)1.96321) + tmpvar_41.x); + bool tmpvar_46; + tmpvar_46 = ((( + abs(((((half)0.25 * tmpvar_42) + ((half)-0.5 * tmpvar_26)) + ((half)0.25 * tmpvar_44))) + + + abs(((((half)0.5 * tmpvar_25) - tmpvar_27) + ((half)0.5 * tmpvar_29))) + ) + abs( + ((((half)0.25 * tmpvar_43) + ((half)-0.5 * tmpvar_28)) + ((half)0.25 * tmpvar_45)) + )) >= (( + abs(((((half)0.25 * tmpvar_42) + ((half)-0.5 * tmpvar_25)) + ((half)0.25 * tmpvar_43))) + + + abs(((((half)0.5 * tmpvar_26) - tmpvar_27) + ((half)0.5 * tmpvar_28))) + ) + abs( + ((((half)0.25 * tmpvar_44) + ((half)-0.5 * tmpvar_29)) + ((half)0.25 * tmpvar_45)) + ))); + float tmpvar_47; + if (tmpvar_46) { + tmpvar_47 = -(_mtl_u._MainTex_TexelSize.y); + } else { + tmpvar_47 = -(_mtl_u._MainTex_TexelSize.x); + }; + lengthSign_12 = tmpvar_47; + if (!(tmpvar_46)) { + lumaN_15 = tmpvar_26; + }; + if (!(tmpvar_46)) { + lumaS_14 = tmpvar_28; + }; + half tmpvar_48; + tmpvar_48 = abs((lumaN_15 - tmpvar_27)); + gradientN_11 = tmpvar_48; + half tmpvar_49; + tmpvar_49 = abs((lumaS_14 - tmpvar_27)); + lumaN_15 = ((lumaN_15 + tmpvar_27) * (half)0.5); + lumaS_14 = ((lumaS_14 + tmpvar_27) * (half)0.5); + bool tmpvar_50; + tmpvar_50 = (tmpvar_48 >= tmpvar_49); + if (!(tmpvar_50)) { + lumaN_15 = lumaS_14; + }; + if (!(tmpvar_50)) { + gradientN_11 = tmpvar_49; + }; + if (!(tmpvar_50)) { + lengthSign_12 = -(tmpvar_47); + }; + float tmpvar_51; + if (tmpvar_46) { + tmpvar_51 = 0.0; + } else { + tmpvar_51 = (lengthSign_12 * 0.5); + }; + posN_10.x = (_mtl_i.xlv_TEXCOORD0.x + tmpvar_51); + float tmpvar_52; + if (tmpvar_46) { + tmpvar_52 = (lengthSign_12 * 0.5); + } else { + tmpvar_52 = 0.0; + }; + posN_10.y = (_mtl_i.xlv_TEXCOORD0.y + tmpvar_52); + gradientN_11 = (gradientN_11 * (half)0.25); + posP_9 = posN_10; + float2 tmpvar_53; + if (tmpvar_46) { + float2 tmpvar_54; + tmpvar_54.y = 0.0; + tmpvar_54.x = rcpFrame_1.x; + tmpvar_53 = tmpvar_54; + } else { + float2 tmpvar_55; + tmpvar_55.x = 0.0; + tmpvar_55.y = rcpFrame_1.y; + tmpvar_53 = tmpvar_55; + }; + offNP_8 = tmpvar_53; + lumaEndN_7 = lumaN_15; + lumaEndP_6 = lumaN_15; + doneN_5 = bool(bool(0)); + doneP_4 = bool(bool(0)); + posN_10 = (posN_10 - tmpvar_53); + posP_9 = (posP_9 + tmpvar_53); + for (int i_3 = 0; i_3 < 16; i_3++) { + 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); + }; + 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); + }; + bool tmpvar_58; + if (doneN_5) { + tmpvar_58 = bool(bool(1)); + } else { + tmpvar_58 = (abs((lumaEndN_7 - lumaN_15)) >= gradientN_11); + }; + doneN_5 = tmpvar_58; + bool tmpvar_59; + if (doneP_4) { + tmpvar_59 = bool(bool(1)); + } else { + tmpvar_59 = (abs((lumaEndP_6 - lumaN_15)) >= gradientN_11); + }; + doneP_4 = tmpvar_59; + if ((tmpvar_58 && tmpvar_59)) { + break; + }; + if (!(tmpvar_58)) { + posN_10 = (posN_10 - offNP_8); + }; + if (!(tmpvar_59)) { + posP_9 = (posP_9 + offNP_8); + }; + }; + float tmpvar_60; + if (tmpvar_46) { + tmpvar_60 = (_mtl_i.xlv_TEXCOORD0.x - posN_10.x); + } else { + tmpvar_60 = (_mtl_i.xlv_TEXCOORD0.y - posN_10.y); + }; + float tmpvar_61; + if (tmpvar_46) { + tmpvar_61 = (posP_9.x - _mtl_i.xlv_TEXCOORD0.x); + } else { + tmpvar_61 = (posP_9.y - _mtl_i.xlv_TEXCOORD0.y); + }; + bool tmpvar_62; + tmpvar_62 = (tmpvar_60 < tmpvar_61); + half tmpvar_63; + if (tmpvar_62) { + tmpvar_63 = lumaEndN_7; + } else { + tmpvar_63 = lumaEndP_6; + }; + lumaEndN_7 = tmpvar_63; + if ((((tmpvar_27 - lumaN_15) < (half)0.0) == ((tmpvar_63 - lumaN_15) < (half)0.0))) { + lengthSign_12 = 0.0; + }; + float tmpvar_64; + tmpvar_64 = (tmpvar_61 + tmpvar_60); + float tmpvar_65; + if (tmpvar_62) { + tmpvar_65 = tmpvar_60; + } else { + tmpvar_65 = tmpvar_61; + }; + float tmpvar_66; + tmpvar_66 = ((0.5 + (tmpvar_65 * + (-1.0 / tmpvar_64) + )) * lengthSign_12); + float tmpvar_67; + if (tmpvar_46) { + tmpvar_67 = 0.0; + } else { + tmpvar_67 = tmpvar_66; + }; + float tmpvar_68; + if (tmpvar_46) { + tmpvar_68 = tmpvar_66; + } else { + tmpvar_68 = 0.0; + }; + float2 tmpvar_69; + tmpvar_69.x = (_mtl_i.xlv_TEXCOORD0.x + tmpvar_67); + tmpvar_69.y = (_mtl_i.xlv_TEXCOORD0.y + tmpvar_68); + half4 tmpvar_70; + tmpvar_70 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_69), level(0.0)); + half3 tmpvar_71; + tmpvar_71.x = -(tmpvar_33); + tmpvar_71.y = -(tmpvar_33); + tmpvar_71.z = -(tmpvar_33); + tmpvar_2 = ((tmpvar_71 * tmpvar_70.xyz) + ((rgbL_13 * half3(tmpvar_33)) + tmpvar_70.xyz)); + }; + half4 tmpvar_72; + tmpvar_72.w = half(0.0); + tmpvar_72.xyz = tmpvar_2; + _mtl_o._fragData = tmpvar_72; + return _mtl_o; +} + + +// stats: 191 alu 12 tex 26 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// uniforms: 1 (total size: 16) +// #0: _MainTex_TexelSize (high float) 4x1 [-1] loc 0 +// textures: 1 +// #0: _MainTex (low 2d) 0x0 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-ir.txt deleted file mode 100644 index 12d3b3d75..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-ir.txt +++ /dev/null @@ -1,314 +0,0 @@ -#extension GL_ARB_shader_texture_lod : enable -struct v2f { - vec4 pos; - vec2 uv; - vec4 uvPosPos; -}; -uniform sampler2D _MainTex; -uniform vec4 _MainTex_TexelSize; -varying vec4 xlv_SV_POSITION; -varying vec2 xlv_TEXCOORD0; -varying vec4 xlv_TEXCOORD1; -vec4 xll_tex2Dlod ( - in sampler2D s_1, - in vec4 coord_2 -) -{ - vec4 tmpvar_3; - tmpvar_3 = texture2DLod (s_1, coord_2.xy, coord_2.w); - return tmpvar_3; -} - -float FxaaLuma ( - in vec4 rgba_4 -) -{ - return rgba_4.y; -} - -vec4 FxaaPixelShader ( - in vec2 pos_5, - in vec4 fxaaConsolePosPos_6, - in sampler2D tex_7, - in sampler2D fxaaConsole360TexExpBiasNegOne_8, - in sampler2D fxaaConsole360TexExpBiasNegTwo_9, - in vec2 fxaaQualityRcpFrame_10, - in vec4 fxaaConsoleRcpFrameOpt_11, - in vec4 fxaaConsoleRcpFrameOpt2_12, - in vec4 fxaaConsole360RcpFrameOpt2_13, - in float fxaaQualitySubpix_14, - in float fxaaQualityEdgeThreshold_15, - in float fxaaQualityEdgeThresholdMin_16, - in float fxaaConsoleEdgeSharpness_17, - in float fxaaConsoleEdgeThreshold_18, - in float fxaaConsoleEdgeThresholdMin_19, - in vec4 fxaaConsole360ConstDir_20 -) -{ - bool twoTap_21; - vec4 rgbyB_22; - vec4 rgbyA_23; - vec4 rgbyP2_24; - vec4 rgbyN2_25; - vec2 dir2_26; - float dirAbsMinTimesC_27; - vec4 rgbyP1_28; - vec4 rgbyN1_29; - vec2 dir1_30; - vec2 dir_31; - float dirSeMinusNw_32; - float lumaMaxSubMinM_33; - float dirSwMinusNe_34; - float lumaMaxM_35; - float lumaMaxScaledClamped_36; - float lumaMinM_37; - float lumaMaxScaled_38; - float lumaMin_39; - float lumaMax_40; - float lumaMinNeSe_41; - float lumaMaxNeSe_42; - float lumaMinNwSw_43; - float lumaMaxNwSw_44; - float lumaM_45; - vec4 rgbyM_46; - float lumaSe_47; - float lumaNe_48; - float lumaSw_49; - float lumaNw_50; - vec4 tmpvar_51; - tmpvar_51.zw = vec2(0.0, 0.0); - tmpvar_51.xy = fxaaConsolePosPos_6.xy.xy; - vec4 tmpvar_52; - tmpvar_52 = xll_tex2Dlod (tex_7, tmpvar_51); - float tmpvar_53; - tmpvar_53 = FxaaLuma (tmpvar_52); - float tmpvar_54; - tmpvar_54 = tmpvar_53; - lumaNw_50 = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55.zw = vec2(0.0, 0.0); - tmpvar_55.xy = fxaaConsolePosPos_6.xw.xy; - vec4 tmpvar_56; - tmpvar_56 = xll_tex2Dlod (tex_7, tmpvar_55); - float tmpvar_57; - tmpvar_57 = FxaaLuma (tmpvar_56); - float tmpvar_58; - tmpvar_58 = tmpvar_57; - lumaSw_49 = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59.zw = vec2(0.0, 0.0); - tmpvar_59.xy = fxaaConsolePosPos_6.zy.xy; - vec4 tmpvar_60; - tmpvar_60 = xll_tex2Dlod (tex_7, tmpvar_59); - float tmpvar_61; - tmpvar_61 = FxaaLuma (tmpvar_60); - float tmpvar_62; - tmpvar_62 = tmpvar_61; - lumaNe_48 = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63.zw = vec2(0.0, 0.0); - tmpvar_63.xy = fxaaConsolePosPos_6.zw.xy; - vec4 tmpvar_64; - tmpvar_64 = xll_tex2Dlod (tex_7, tmpvar_63); - float tmpvar_65; - tmpvar_65 = FxaaLuma (tmpvar_64); - float tmpvar_66; - tmpvar_66 = tmpvar_65; - lumaSe_47 = tmpvar_66; - vec4 tmpvar_67; - tmpvar_67.zw = vec2(0.0, 0.0); - tmpvar_67.xy = pos_5.xy.xy; - vec4 tmpvar_68; - tmpvar_68 = xll_tex2Dlod (tex_7, tmpvar_67); - vec4 tmpvar_69; - tmpvar_69 = tmpvar_68; - rgbyM_46 = tmpvar_69; - float tmpvar_70; - tmpvar_70 = rgbyM_46.y; - lumaM_45 = tmpvar_70; - float tmpvar_71; - tmpvar_71 = max (lumaNw_50, lumaSw_49); - float tmpvar_72; - tmpvar_72 = tmpvar_71; - lumaMaxNwSw_44 = tmpvar_72; - float tmpvar_73; - tmpvar_73 = (lumaNe_48 + 0.00260417); - lumaNe_48 = tmpvar_73; - float tmpvar_74; - tmpvar_74 = min (lumaNw_50, lumaSw_49); - float tmpvar_75; - tmpvar_75 = tmpvar_74; - lumaMinNwSw_43 = tmpvar_75; - float tmpvar_76; - tmpvar_76 = max (lumaNe_48, lumaSe_47); - float tmpvar_77; - tmpvar_77 = tmpvar_76; - lumaMaxNeSe_42 = tmpvar_77; - float tmpvar_78; - tmpvar_78 = min (lumaNe_48, lumaSe_47); - float tmpvar_79; - tmpvar_79 = tmpvar_78; - lumaMinNeSe_41 = tmpvar_79; - float tmpvar_80; - tmpvar_80 = max (lumaMaxNeSe_42, lumaMaxNwSw_44); - float tmpvar_81; - tmpvar_81 = tmpvar_80; - lumaMax_40 = tmpvar_81; - float tmpvar_82; - tmpvar_82 = min (lumaMinNeSe_41, lumaMinNwSw_43); - float tmpvar_83; - tmpvar_83 = tmpvar_82; - lumaMin_39 = tmpvar_83; - float tmpvar_84; - tmpvar_84 = (lumaMax_40 * fxaaConsoleEdgeThreshold_18); - lumaMaxScaled_38 = tmpvar_84; - float tmpvar_85; - tmpvar_85 = min (lumaMin_39, lumaM_45); - float tmpvar_86; - tmpvar_86 = tmpvar_85; - lumaMinM_37 = tmpvar_86; - float tmpvar_87; - tmpvar_87 = max (fxaaConsoleEdgeThresholdMin_19, lumaMaxScaled_38); - float tmpvar_88; - tmpvar_88 = tmpvar_87; - lumaMaxScaledClamped_36 = tmpvar_88; - float tmpvar_89; - tmpvar_89 = max (lumaMax_40, lumaM_45); - float tmpvar_90; - tmpvar_90 = tmpvar_89; - lumaMaxM_35 = tmpvar_90; - float tmpvar_91; - tmpvar_91 = (lumaSw_49 - lumaNe_48); - dirSwMinusNe_34 = tmpvar_91; - float tmpvar_92; - tmpvar_92 = (lumaMaxM_35 - lumaMinM_37); - lumaMaxSubMinM_33 = tmpvar_92; - float tmpvar_93; - tmpvar_93 = (lumaSe_47 - lumaNw_50); - dirSeMinusNw_32 = tmpvar_93; - if ((lumaMaxSubMinM_33 < lumaMaxScaledClamped_36)) { - return rgbyM_46; - }; - float tmpvar_94; - tmpvar_94 = (dirSwMinusNe_34 + dirSeMinusNw_32); - dir_31.x = tmpvar_94; - float tmpvar_95; - tmpvar_95 = (dirSwMinusNe_34 - dirSeMinusNw_32); - dir_31.y = vec2(tmpvar_95).y; - vec2 tmpvar_96; - tmpvar_96 = normalize (dir_31.xy); - vec2 tmpvar_97; - tmpvar_97 = tmpvar_96; - dir1_30 = tmpvar_97; - vec4 tmpvar_98; - tmpvar_98.zw = vec2(0.0, 0.0); - tmpvar_98.xy = (pos_5.xy - (dir1_30 * fxaaConsoleRcpFrameOpt_11.zw)).xy; - vec4 tmpvar_99; - tmpvar_99 = xll_tex2Dlod (tex_7, tmpvar_98); - vec4 tmpvar_100; - tmpvar_100 = tmpvar_99; - rgbyN1_29 = tmpvar_100; - vec4 tmpvar_101; - tmpvar_101.zw = vec2(0.0, 0.0); - tmpvar_101.xy = (pos_5.xy + (dir1_30 * fxaaConsoleRcpFrameOpt_11.zw)).xy; - vec4 tmpvar_102; - tmpvar_102 = xll_tex2Dlod (tex_7, tmpvar_101); - vec4 tmpvar_103; - tmpvar_103 = tmpvar_102; - rgbyP1_28 = tmpvar_103; - float tmpvar_104; - tmpvar_104 = abs (dir1_30.x); - float tmpvar_105; - tmpvar_105 = abs (dir1_30.y); - float tmpvar_106; - tmpvar_106 = min (tmpvar_104, tmpvar_105); - float tmpvar_107; - tmpvar_107 = (tmpvar_106 * fxaaConsoleEdgeSharpness_17); - dirAbsMinTimesC_27 = tmpvar_107; - vec2 tmpvar_108; - tmpvar_108 = clamp ((dir1_30.xy / dirAbsMinTimesC_27), vec2(-2.0, -2.0), vec2(2.0, 2.0)); - vec2 tmpvar_109; - tmpvar_109 = tmpvar_108; - dir2_26 = tmpvar_109; - vec4 tmpvar_110; - tmpvar_110.zw = vec2(0.0, 0.0); - tmpvar_110.xy = (pos_5.xy - (dir2_26 * fxaaConsoleRcpFrameOpt2_12.zw)).xy; - vec4 tmpvar_111; - tmpvar_111 = xll_tex2Dlod (tex_7, tmpvar_110); - vec4 tmpvar_112; - tmpvar_112 = tmpvar_111; - rgbyN2_25 = tmpvar_112; - vec4 tmpvar_113; - tmpvar_113.zw = vec2(0.0, 0.0); - tmpvar_113.xy = (pos_5.xy + (dir2_26 * fxaaConsoleRcpFrameOpt2_12.zw)).xy; - vec4 tmpvar_114; - tmpvar_114 = xll_tex2Dlod (tex_7, tmpvar_113); - vec4 tmpvar_115; - tmpvar_115 = tmpvar_114; - rgbyP2_24 = tmpvar_115; - vec4 tmpvar_116; - tmpvar_116 = (rgbyN1_29 + rgbyP1_28); - rgbyA_23 = tmpvar_116; - vec4 tmpvar_117; - tmpvar_117 = (((rgbyN2_25 + rgbyP2_24) * 0.25) + (rgbyA_23 * 0.25)); - rgbyB_22 = tmpvar_117; - bool tmpvar_118; - tmpvar_118 = ((rgbyB_22.y < lumaMin_39) || (rgbyB_22.y > lumaMax_40)); - twoTap_21 = tmpvar_118; - if (twoTap_21) { - vec3 tmpvar_119; - tmpvar_119 = (rgbyA_23.xyz * 0.5); - rgbyB_22.xyz = tmpvar_119.xyz.xyz; - }; - return rgbyB_22; -} - -vec4 xlat_main ( - in v2f i_120 -) -{ - float fxaaN_121; - float tmpvar_122; - tmpvar_122 = 0.5; - fxaaN_121 = tmpvar_122; - vec4 tmpvar_123; - tmpvar_123.x = -(fxaaN_121); - tmpvar_123.y = -(fxaaN_121); - tmpvar_123.z = fxaaN_121; - tmpvar_123.w = fxaaN_121; - vec4 tmpvar_124; - tmpvar_124 = FxaaPixelShader (i_120.uv, i_120.uvPosPos, _MainTex, _MainTex, _MainTex, _MainTex_TexelSize.xy, (_MainTex_TexelSize.xyxy * tmpvar_123), (_MainTex_TexelSize.xyxy * vec4(-2.0, -2.0, 2.0, 2.0)), (_MainTex_TexelSize.xyxy * vec4(8.0, 8.0, -4.0, -4.0)), 0.75, 0.166, 0.0833, 8.0, 0.125, 0.05, vec4(1.0, -1.0, 0.25, -0.25)); - return tmpvar_124; -} - -void main () -{ - v2f xlt_i_125; - vec4 xl_retval_126; - vec4 tmpvar_127; - tmpvar_127 = xlv_SV_POSITION.xyzw; - vec4 tmpvar_128; - tmpvar_128 = tmpvar_127; - xlt_i_125.pos = tmpvar_128; - vec2 tmpvar_129; - tmpvar_129 = xlv_TEXCOORD0.xy; - vec2 tmpvar_130; - tmpvar_130 = tmpvar_129; - xlt_i_125.uv = tmpvar_130; - vec4 tmpvar_131; - tmpvar_131 = xlv_TEXCOORD1.xyzw; - vec4 tmpvar_132; - tmpvar_132 = tmpvar_131; - xlt_i_125.uvPosPos = tmpvar_132; - vec4 tmpvar_133; - tmpvar_133 = xlat_main (xlt_i_125); - vec4 tmpvar_134; - tmpvar_134 = tmpvar_133; - xl_retval_126 = tmpvar_134; - vec4 tmpvar_135; - tmpvar_135 = xl_retval_126.xyzw; - vec4 tmpvar_136; - tmpvar_136 = tmpvar_135; - gl_FragData[0] = tmpvar_136; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-irES.txt deleted file mode 100644 index 1b5fe8e4f..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-irES.txt +++ /dev/null @@ -1,311 +0,0 @@ -#extension GL_EXT_shader_texture_lod : enable -struct v2f { - highp vec4 pos; - highp vec2 uv; - highp vec4 uvPosPos; -}; -uniform sampler2D _MainTex; -uniform highp vec4 _MainTex_TexelSize; -varying highp vec2 xlv_TEXCOORD0; -varying highp vec4 xlv_TEXCOORD1; -mediump vec4 xll_tex2Dlod ( - in sampler2D s_1, - in mediump vec4 coord_2 -) -{ - lowp vec4 tmpvar_3; - tmpvar_3 = texture2DLodEXT (s_1, coord_2.xy, coord_2.w); - return tmpvar_3; -} - -float FxaaLuma ( - in lowp vec4 rgba_4 -) -{ - return rgba_4.y; -} - -lowp vec4 FxaaPixelShader ( - in highp vec2 pos_5, - in highp vec4 fxaaConsolePosPos_6, - in sampler2D tex_7, - in sampler2D fxaaConsole360TexExpBiasNegOne_8, - in sampler2D fxaaConsole360TexExpBiasNegTwo_9, - in highp vec2 fxaaQualityRcpFrame_10, - in highp vec4 fxaaConsoleRcpFrameOpt_11, - in highp vec4 fxaaConsoleRcpFrameOpt2_12, - in highp vec4 fxaaConsole360RcpFrameOpt2_13, - in highp float fxaaQualitySubpix_14, - in highp float fxaaQualityEdgeThreshold_15, - in highp float fxaaQualityEdgeThresholdMin_16, - in highp float fxaaConsoleEdgeSharpness_17, - in highp float fxaaConsoleEdgeThreshold_18, - in highp float fxaaConsoleEdgeThresholdMin_19, - in highp vec4 fxaaConsole360ConstDir_20 -) -{ - bool twoTap_21; - lowp vec4 rgbyB_22; - lowp vec4 rgbyA_23; - lowp vec4 rgbyP2_24; - lowp vec4 rgbyN2_25; - highp vec2 dir2_26; - highp float dirAbsMinTimesC_27; - lowp vec4 rgbyP1_28; - lowp vec4 rgbyN1_29; - highp vec2 dir1_30; - highp vec2 dir_31; - highp float dirSeMinusNw_32; - highp float lumaMaxSubMinM_33; - highp float dirSwMinusNe_34; - highp float lumaMaxM_35; - highp float lumaMaxScaledClamped_36; - highp float lumaMinM_37; - highp float lumaMaxScaled_38; - highp float lumaMin_39; - highp float lumaMax_40; - highp float lumaMinNeSe_41; - highp float lumaMaxNeSe_42; - highp float lumaMinNwSw_43; - highp float lumaMaxNwSw_44; - highp float lumaM_45; - lowp vec4 rgbyM_46; - highp float lumaSe_47; - highp float lumaNe_48; - highp float lumaSw_49; - highp float lumaNw_50; - highp vec4 tmpvar_51; - tmpvar_51.zw = vec2(0.0, 0.0); - tmpvar_51.xy = fxaaConsolePosPos_6.xy.xy; - mediump vec4 tmpvar_52; - tmpvar_52 = xll_tex2Dlod (tex_7, tmpvar_51); - highp float tmpvar_53; - tmpvar_53 = FxaaLuma (tmpvar_52); - highp float tmpvar_54; - tmpvar_54 = tmpvar_53; - lumaNw_50 = tmpvar_54; - highp vec4 tmpvar_55; - tmpvar_55.zw = vec2(0.0, 0.0); - tmpvar_55.xy = fxaaConsolePosPos_6.xw.xy; - mediump vec4 tmpvar_56; - tmpvar_56 = xll_tex2Dlod (tex_7, tmpvar_55); - highp float tmpvar_57; - tmpvar_57 = FxaaLuma (tmpvar_56); - highp float tmpvar_58; - tmpvar_58 = tmpvar_57; - lumaSw_49 = tmpvar_58; - highp vec4 tmpvar_59; - tmpvar_59.zw = vec2(0.0, 0.0); - tmpvar_59.xy = fxaaConsolePosPos_6.zy.xy; - mediump vec4 tmpvar_60; - tmpvar_60 = xll_tex2Dlod (tex_7, tmpvar_59); - highp float tmpvar_61; - tmpvar_61 = FxaaLuma (tmpvar_60); - highp float tmpvar_62; - tmpvar_62 = tmpvar_61; - lumaNe_48 = tmpvar_62; - highp vec4 tmpvar_63; - tmpvar_63.zw = vec2(0.0, 0.0); - tmpvar_63.xy = fxaaConsolePosPos_6.zw.xy; - mediump vec4 tmpvar_64; - tmpvar_64 = xll_tex2Dlod (tex_7, tmpvar_63); - highp float tmpvar_65; - tmpvar_65 = FxaaLuma (tmpvar_64); - highp float tmpvar_66; - tmpvar_66 = tmpvar_65; - lumaSe_47 = tmpvar_66; - highp vec4 tmpvar_67; - tmpvar_67.zw = vec2(0.0, 0.0); - tmpvar_67.xy = pos_5.xy.xy; - mediump vec4 tmpvar_68; - tmpvar_68 = xll_tex2Dlod (tex_7, tmpvar_67); - mediump vec4 tmpvar_69; - tmpvar_69 = tmpvar_68; - rgbyM_46 = tmpvar_69; - lowp float tmpvar_70; - tmpvar_70 = rgbyM_46.y; - lumaM_45 = tmpvar_70; - highp float tmpvar_71; - tmpvar_71 = max (lumaNw_50, lumaSw_49); - highp float tmpvar_72; - tmpvar_72 = tmpvar_71; - lumaMaxNwSw_44 = tmpvar_72; - highp float tmpvar_73; - tmpvar_73 = (lumaNe_48 + 0.00260417); - lumaNe_48 = tmpvar_73; - highp float tmpvar_74; - tmpvar_74 = min (lumaNw_50, lumaSw_49); - highp float tmpvar_75; - tmpvar_75 = tmpvar_74; - lumaMinNwSw_43 = tmpvar_75; - highp float tmpvar_76; - tmpvar_76 = max (lumaNe_48, lumaSe_47); - highp float tmpvar_77; - tmpvar_77 = tmpvar_76; - lumaMaxNeSe_42 = tmpvar_77; - highp float tmpvar_78; - tmpvar_78 = min (lumaNe_48, lumaSe_47); - highp float tmpvar_79; - tmpvar_79 = tmpvar_78; - lumaMinNeSe_41 = tmpvar_79; - highp float tmpvar_80; - tmpvar_80 = max (lumaMaxNeSe_42, lumaMaxNwSw_44); - highp float tmpvar_81; - tmpvar_81 = tmpvar_80; - lumaMax_40 = tmpvar_81; - highp float tmpvar_82; - tmpvar_82 = min (lumaMinNeSe_41, lumaMinNwSw_43); - highp float tmpvar_83; - tmpvar_83 = tmpvar_82; - lumaMin_39 = tmpvar_83; - highp float tmpvar_84; - tmpvar_84 = (lumaMax_40 * fxaaConsoleEdgeThreshold_18); - lumaMaxScaled_38 = tmpvar_84; - highp float tmpvar_85; - tmpvar_85 = min (lumaMin_39, lumaM_45); - highp float tmpvar_86; - tmpvar_86 = tmpvar_85; - lumaMinM_37 = tmpvar_86; - highp float tmpvar_87; - tmpvar_87 = max (fxaaConsoleEdgeThresholdMin_19, lumaMaxScaled_38); - highp float tmpvar_88; - tmpvar_88 = tmpvar_87; - lumaMaxScaledClamped_36 = tmpvar_88; - highp float tmpvar_89; - tmpvar_89 = max (lumaMax_40, lumaM_45); - highp float tmpvar_90; - tmpvar_90 = tmpvar_89; - lumaMaxM_35 = tmpvar_90; - highp float tmpvar_91; - tmpvar_91 = (lumaSw_49 - lumaNe_48); - dirSwMinusNe_34 = tmpvar_91; - highp float tmpvar_92; - tmpvar_92 = (lumaMaxM_35 - lumaMinM_37); - lumaMaxSubMinM_33 = tmpvar_92; - highp float tmpvar_93; - tmpvar_93 = (lumaSe_47 - lumaNw_50); - dirSeMinusNw_32 = tmpvar_93; - if ((lumaMaxSubMinM_33 < lumaMaxScaledClamped_36)) { - return rgbyM_46; - }; - highp float tmpvar_94; - tmpvar_94 = (dirSwMinusNe_34 + dirSeMinusNw_32); - dir_31.x = tmpvar_94; - highp float tmpvar_95; - tmpvar_95 = (dirSwMinusNe_34 - dirSeMinusNw_32); - dir_31.y = vec2(tmpvar_95).y; - highp vec2 tmpvar_96; - tmpvar_96 = normalize (dir_31.xy); - highp vec2 tmpvar_97; - tmpvar_97 = tmpvar_96; - dir1_30 = tmpvar_97; - highp vec4 tmpvar_98; - tmpvar_98.zw = vec2(0.0, 0.0); - tmpvar_98.xy = (pos_5.xy - (dir1_30 * fxaaConsoleRcpFrameOpt_11.zw)).xy; - mediump vec4 tmpvar_99; - tmpvar_99 = xll_tex2Dlod (tex_7, tmpvar_98); - mediump vec4 tmpvar_100; - tmpvar_100 = tmpvar_99; - rgbyN1_29 = tmpvar_100; - highp vec4 tmpvar_101; - tmpvar_101.zw = vec2(0.0, 0.0); - tmpvar_101.xy = (pos_5.xy + (dir1_30 * fxaaConsoleRcpFrameOpt_11.zw)).xy; - mediump vec4 tmpvar_102; - tmpvar_102 = xll_tex2Dlod (tex_7, tmpvar_101); - mediump vec4 tmpvar_103; - tmpvar_103 = tmpvar_102; - rgbyP1_28 = tmpvar_103; - highp float tmpvar_104; - tmpvar_104 = abs (dir1_30.x); - highp float tmpvar_105; - tmpvar_105 = abs (dir1_30.y); - highp float tmpvar_106; - tmpvar_106 = min (tmpvar_104, tmpvar_105); - highp float tmpvar_107; - tmpvar_107 = (tmpvar_106 * fxaaConsoleEdgeSharpness_17); - dirAbsMinTimesC_27 = tmpvar_107; - highp vec2 tmpvar_108; - tmpvar_108 = clamp ((dir1_30.xy / dirAbsMinTimesC_27), vec2(-2.0, -2.0), vec2(2.0, 2.0)); - highp vec2 tmpvar_109; - tmpvar_109 = tmpvar_108; - dir2_26 = tmpvar_109; - highp vec4 tmpvar_110; - tmpvar_110.zw = vec2(0.0, 0.0); - tmpvar_110.xy = (pos_5.xy - (dir2_26 * fxaaConsoleRcpFrameOpt2_12.zw)).xy; - mediump vec4 tmpvar_111; - tmpvar_111 = xll_tex2Dlod (tex_7, tmpvar_110); - mediump vec4 tmpvar_112; - tmpvar_112 = tmpvar_111; - rgbyN2_25 = tmpvar_112; - highp vec4 tmpvar_113; - tmpvar_113.zw = vec2(0.0, 0.0); - tmpvar_113.xy = (pos_5.xy + (dir2_26 * fxaaConsoleRcpFrameOpt2_12.zw)).xy; - mediump vec4 tmpvar_114; - tmpvar_114 = xll_tex2Dlod (tex_7, tmpvar_113); - mediump vec4 tmpvar_115; - tmpvar_115 = tmpvar_114; - rgbyP2_24 = tmpvar_115; - lowp vec4 tmpvar_116; - tmpvar_116 = (rgbyN1_29 + rgbyP1_28); - rgbyA_23 = tmpvar_116; - lowp vec4 tmpvar_117; - tmpvar_117 = (((rgbyN2_25 + rgbyP2_24) * 0.25) + (rgbyA_23 * 0.25)); - rgbyB_22 = tmpvar_117; - bool tmpvar_118; - tmpvar_118 = ((rgbyB_22.y < lumaMin_39) || (rgbyB_22.y > lumaMax_40)); - twoTap_21 = tmpvar_118; - if (twoTap_21) { - lowp vec3 tmpvar_119; - tmpvar_119 = (rgbyA_23.xyz * 0.5); - rgbyB_22.xyz = tmpvar_119.xyz.xyz; - }; - return rgbyB_22; -} - -lowp vec4 xlat_main ( - in v2f i_120 -) -{ - highp float fxaaN_121; - mediump float tmpvar_122; - tmpvar_122 = 0.5; - fxaaN_121 = tmpvar_122; - highp vec4 tmpvar_123; - tmpvar_123.x = -(fxaaN_121); - tmpvar_123.y = -(fxaaN_121); - tmpvar_123.z = fxaaN_121; - tmpvar_123.w = fxaaN_121; - lowp vec4 tmpvar_124; - tmpvar_124 = FxaaPixelShader (i_120.uv, i_120.uvPosPos, _MainTex, _MainTex, _MainTex, _MainTex_TexelSize.xy, (_MainTex_TexelSize.xyxy * tmpvar_123), (_MainTex_TexelSize.xyxy * vec4(-2.0, -2.0, 2.0, 2.0)), (_MainTex_TexelSize.xyxy * vec4(8.0, 8.0, -4.0, -4.0)), 0.75, 0.166, 0.0833, 8.0, 0.125, 0.05, vec4(1.0, -1.0, 0.25, -0.25)); - return tmpvar_124; -} - -void main () -{ - v2f xlt_i_125; - lowp vec4 xl_retval_126; - mediump vec4 tmpvar_127; - tmpvar_127 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_125.pos = tmpvar_127; - highp vec2 tmpvar_128; - tmpvar_128 = xlv_TEXCOORD0.xy; - highp vec2 tmpvar_129; - tmpvar_129 = tmpvar_128; - xlt_i_125.uv = tmpvar_129; - highp vec4 tmpvar_130; - tmpvar_130 = xlv_TEXCOORD1.xyzw; - highp vec4 tmpvar_131; - tmpvar_131 = tmpvar_130; - xlt_i_125.uvPosPos = tmpvar_131; - lowp vec4 tmpvar_132; - tmpvar_132 = xlat_main (xlt_i_125); - lowp vec4 tmpvar_133; - tmpvar_133 = tmpvar_132; - xl_retval_126 = tmpvar_133; - lowp vec4 tmpvar_134; - tmpvar_134 = xl_retval_126.xyzw; - lowp vec4 tmpvar_135; - tmpvar_135 = tmpvar_134; - gl_FragData[0] = tmpvar_135; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-out.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-out.txt index ea75909d2..cbb0d2755 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-out.txt @@ -11,59 +11,57 @@ void main () fxaaConsoleRcpFrameOpt2_2 = (_MainTex_TexelSize.xyxy * vec4(-2.0, -2.0, 2.0, 2.0)); vec4 tmpvar_3; vec4 rgbyB_4; - vec2 dir_5; - vec4 tmpvar_6; - tmpvar_6 = texture2DLod (_MainTex, xlv_TEXCOORD1.xy, 0.0); - vec4 tmpvar_7; - tmpvar_7 = texture2DLod (_MainTex, xlv_TEXCOORD1.xw, 0.0); - vec4 tmpvar_8; - tmpvar_8 = texture2DLod (_MainTex, xlv_TEXCOORD1.zw, 0.0); - vec4 tmpvar_9; - tmpvar_9 = texture2DLod (_MainTex, xlv_TEXCOORD0, 0.0); - float tmpvar_10; - tmpvar_10 = (texture2DLod (_MainTex, xlv_TEXCOORD1.zy, 0.0).y + 0.00260417); - float tmpvar_11; - tmpvar_11 = max (max (tmpvar_10, tmpvar_8.y), max (tmpvar_6.y, tmpvar_7.y)); - float tmpvar_12; - tmpvar_12 = min (min (tmpvar_10, tmpvar_8.y), min (tmpvar_6.y, tmpvar_7.y)); - float tmpvar_13; - tmpvar_13 = max (0.05, (tmpvar_11 * 0.125)); - float tmpvar_14; - tmpvar_14 = (tmpvar_7.y - tmpvar_10); + vec4 rgbyA_5; + vec2 dir_6; + float dirSeMinusNw_7; + float lumaMaxSubMinM_8; + float dirSwMinusNe_9; + float lumaNe_10; + vec4 tmpvar_11; + tmpvar_11 = texture2DLod (_MainTex, xlv_TEXCOORD1.xy, 0.0); + vec4 tmpvar_12; + tmpvar_12 = texture2DLod (_MainTex, xlv_TEXCOORD1.xw, 0.0); + vec4 tmpvar_13; + tmpvar_13 = texture2DLod (_MainTex, xlv_TEXCOORD1.zw, 0.0); + vec4 tmpvar_14; + tmpvar_14 = texture2DLod (_MainTex, xlv_TEXCOORD0, 0.0); + lumaNe_10 = (texture2DLod (_MainTex, xlv_TEXCOORD1.zy, 0.0).y + 0.00260417); float tmpvar_15; - tmpvar_15 = (max (tmpvar_11, tmpvar_9.y) - min (tmpvar_12, tmpvar_9.y)); + tmpvar_15 = max (max (lumaNe_10, tmpvar_13.y), max (tmpvar_11.y, tmpvar_12.y)); float tmpvar_16; - tmpvar_16 = (tmpvar_8.y - tmpvar_6.y); - if ((tmpvar_15 < tmpvar_13)) { - tmpvar_3 = tmpvar_9; + tmpvar_16 = min (min (lumaNe_10, tmpvar_13.y), min (tmpvar_11.y, tmpvar_12.y)); + float tmpvar_17; + tmpvar_17 = max (0.05, (tmpvar_15 * 0.125)); + dirSwMinusNe_9 = (tmpvar_12.y - lumaNe_10); + lumaMaxSubMinM_8 = (max (tmpvar_15, tmpvar_14.y) - min (tmpvar_16, tmpvar_14.y)); + dirSeMinusNw_7 = (tmpvar_13.y - tmpvar_11.y); + if ((lumaMaxSubMinM_8 < tmpvar_17)) { + tmpvar_3 = tmpvar_14; } else { - dir_5.x = (tmpvar_14 + tmpvar_16); - dir_5.y = (tmpvar_14 - tmpvar_16); - vec2 tmpvar_17; - tmpvar_17 = normalize(dir_5); - vec4 tmpvar_18; - tmpvar_18.zw = vec2(0.0, 0.0); - tmpvar_18.xy = (xlv_TEXCOORD0 - (tmpvar_17 * fxaaConsoleRcpFrameOpt_1.zw)); + dir_6.x = (dirSwMinusNe_9 + dirSeMinusNw_7); + dir_6.y = (dirSwMinusNe_9 - dirSeMinusNw_7); + vec2 tmpvar_18; + tmpvar_18 = normalize(dir_6); vec4 tmpvar_19; tmpvar_19.zw = vec2(0.0, 0.0); - tmpvar_19.xy = (xlv_TEXCOORD0 + (tmpvar_17 * fxaaConsoleRcpFrameOpt_1.zw)); - vec2 tmpvar_20; - tmpvar_20 = clamp ((tmpvar_17 / ( - min (abs(tmpvar_17.x), abs(tmpvar_17.y)) + tmpvar_19.xy = (xlv_TEXCOORD0 - (tmpvar_18 * fxaaConsoleRcpFrameOpt_1.zw)); + vec4 tmpvar_20; + tmpvar_20.zw = vec2(0.0, 0.0); + tmpvar_20.xy = (xlv_TEXCOORD0 + (tmpvar_18 * fxaaConsoleRcpFrameOpt_1.zw)); + vec2 tmpvar_21; + tmpvar_21 = clamp ((tmpvar_18 / ( + min (abs(tmpvar_18.x), abs(tmpvar_18.y)) * 8.0)), vec2(-2.0, -2.0), vec2(2.0, 2.0)); - vec4 tmpvar_21; - tmpvar_21.zw = vec2(0.0, 0.0); - tmpvar_21.xy = (xlv_TEXCOORD0 - (tmpvar_20 * fxaaConsoleRcpFrameOpt2_2.zw)); vec4 tmpvar_22; tmpvar_22.zw = vec2(0.0, 0.0); - tmpvar_22.xy = (xlv_TEXCOORD0 + (tmpvar_20 * fxaaConsoleRcpFrameOpt2_2.zw)); + tmpvar_22.xy = (xlv_TEXCOORD0 - (tmpvar_21 * fxaaConsoleRcpFrameOpt2_2.zw)); vec4 tmpvar_23; - tmpvar_23 = (texture2DLod (_MainTex, tmpvar_18.xy, 0.0) + texture2DLod (_MainTex, tmpvar_19.xy, 0.0)); - vec4 tmpvar_24; - tmpvar_24 = (((texture2DLod (_MainTex, tmpvar_21.xy, 0.0) + texture2DLod (_MainTex, tmpvar_22.xy, 0.0)) * 0.25) + (tmpvar_23 * 0.25)); - rgbyB_4 = tmpvar_24; - if (((tmpvar_24.y < tmpvar_12) || (tmpvar_24.y > tmpvar_11))) { - rgbyB_4.xyz = (tmpvar_23.xyz * 0.5); + tmpvar_23.zw = vec2(0.0, 0.0); + tmpvar_23.xy = (xlv_TEXCOORD0 + (tmpvar_21 * fxaaConsoleRcpFrameOpt2_2.zw)); + rgbyA_5 = (texture2DLod (_MainTex, tmpvar_19.xy, 0.0) + texture2DLod (_MainTex, tmpvar_20.xy, 0.0)); + rgbyB_4 = (((texture2DLod (_MainTex, tmpvar_22.xy, 0.0) + texture2DLod (_MainTex, tmpvar_23.xy, 0.0)) * 0.25) + (rgbyA_5 * 0.25)); + if (((rgbyB_4.y < tmpvar_16) || (rgbyB_4.y > tmpvar_15))) { + rgbyB_4.xyz = (rgbyA_5.xyz * 0.5); }; tmpvar_3 = rgbyB_4; }; @@ -71,4 +69,11 @@ void main () } -// inputs: 2, stats: 47 alu 9 tex 2 flow +// stats: 47 alu 9 tex 2 flow +// inputs: 2 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// #1: xlv_TEXCOORD1 (high float) 4x1 [-1] +// uniforms: 1 (total size: 0) +// #0: _MainTex_TexelSize (high float) 4x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-outES.txt index 62bdbb272..ad30543e3 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-outES.txt @@ -11,50 +11,49 @@ void main () fxaaConsoleRcpFrameOpt2_2 = (_MainTex_TexelSize.xyxy * vec4(-2.0, -2.0, 2.0, 2.0)); lowp vec4 tmpvar_3; lowp vec4 rgbyB_4; - highp vec2 dir_5; - highp float lumaM_6; - lowp vec4 tmpvar_7; - tmpvar_7 = texture2DLodEXT (_MainTex, xlv_TEXCOORD1.xy, 0.0); - highp float tmpvar_8; - tmpvar_8 = tmpvar_7.y; - lowp vec4 tmpvar_9; - tmpvar_9 = texture2DLodEXT (_MainTex, xlv_TEXCOORD1.xw, 0.0); - highp float tmpvar_10; - tmpvar_10 = tmpvar_9.y; - lowp vec4 tmpvar_11; - tmpvar_11 = texture2DLodEXT (_MainTex, xlv_TEXCOORD1.zy, 0.0); - highp float tmpvar_12; - tmpvar_12 = tmpvar_11.y; - lowp vec4 tmpvar_13; - tmpvar_13 = texture2DLodEXT (_MainTex, xlv_TEXCOORD1.zw, 0.0); - highp float tmpvar_14; - tmpvar_14 = tmpvar_13.y; - lowp vec4 tmpvar_15; - tmpvar_15 = texture2DLodEXT (_MainTex, xlv_TEXCOORD0, 0.0); - lowp float tmpvar_16; - tmpvar_16 = tmpvar_15.y; - lumaM_6 = tmpvar_16; + lowp vec4 rgbyA_5; + highp vec2 dir_6; + highp float dirSeMinusNw_7; + highp float lumaMaxSubMinM_8; + highp float dirSwMinusNe_9; + highp float lumaM_10; + highp float lumaNe_11; + lowp vec4 tmpvar_12; + tmpvar_12 = 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); + highp float tmpvar_15; + tmpvar_15 = tmpvar_14.y; + lowp vec4 tmpvar_16; + tmpvar_16 = texture2DLodEXT (_MainTex, xlv_TEXCOORD1.zy, 0.0); highp float tmpvar_17; - tmpvar_17 = (tmpvar_12 + 0.00260417); - highp float tmpvar_18; - tmpvar_18 = max (max (tmpvar_17, tmpvar_14), max (tmpvar_8, tmpvar_10)); + tmpvar_17 = tmpvar_16.y; + lowp vec4 tmpvar_18; + tmpvar_18 = texture2DLodEXT (_MainTex, xlv_TEXCOORD1.zw, 0.0); highp float tmpvar_19; - tmpvar_19 = min (min (tmpvar_17, tmpvar_14), min (tmpvar_8, tmpvar_10)); - highp float tmpvar_20; - tmpvar_20 = max (0.05, (tmpvar_18 * 0.125)); + tmpvar_19 = tmpvar_18.y; + lowp vec4 tmpvar_20; + tmpvar_20 = texture2DLodEXT (_MainTex, xlv_TEXCOORD0, 0.0); + lumaM_10 = tmpvar_20.y; + lumaNe_11 = (tmpvar_17 + 0.00260417); highp float tmpvar_21; - tmpvar_21 = (tmpvar_10 - tmpvar_17); + tmpvar_21 = max (max (lumaNe_11, tmpvar_19), max (tmpvar_13, tmpvar_15)); highp float tmpvar_22; - tmpvar_22 = (max (tmpvar_18, lumaM_6) - min (tmpvar_19, lumaM_6)); + tmpvar_22 = min (min (lumaNe_11, tmpvar_19), min (tmpvar_13, tmpvar_15)); highp float tmpvar_23; - tmpvar_23 = (tmpvar_14 - tmpvar_8); - if ((tmpvar_22 < tmpvar_20)) { - tmpvar_3 = tmpvar_15; + tmpvar_23 = max (0.05, (tmpvar_21 * 0.125)); + dirSwMinusNe_9 = (tmpvar_15 - lumaNe_11); + lumaMaxSubMinM_8 = (max (tmpvar_21, lumaM_10) - min (tmpvar_22, lumaM_10)); + dirSeMinusNw_7 = (tmpvar_19 - tmpvar_13); + if ((lumaMaxSubMinM_8 < tmpvar_23)) { + tmpvar_3 = tmpvar_20; } else { - dir_5.x = (tmpvar_21 + tmpvar_23); - dir_5.y = (tmpvar_21 - tmpvar_23); + dir_6.x = (dirSwMinusNe_9 + dirSeMinusNw_7); + dir_6.y = (dirSwMinusNe_9 - dirSeMinusNw_7); highp vec2 tmpvar_24; - tmpvar_24 = normalize(dir_5); + tmpvar_24 = normalize(dir_6); highp vec4 tmpvar_25; tmpvar_25.zw = vec2(0.0, 0.0); tmpvar_25.xy = (xlv_TEXCOORD0 - (tmpvar_24 * fxaaConsoleRcpFrameOpt_1.zw)); @@ -71,13 +70,10 @@ void main () highp vec4 tmpvar_29; tmpvar_29.zw = vec2(0.0, 0.0); tmpvar_29.xy = (xlv_TEXCOORD0 + (tmpvar_27 * fxaaConsoleRcpFrameOpt2_2.zw)); - lowp vec4 tmpvar_30; - tmpvar_30 = (texture2DLodEXT (_MainTex, tmpvar_25.xy, 0.0) + texture2DLodEXT (_MainTex, tmpvar_26.xy, 0.0)); - lowp vec4 tmpvar_31; - tmpvar_31 = (((texture2DLodEXT (_MainTex, tmpvar_28.xy, 0.0) + texture2DLodEXT (_MainTex, tmpvar_29.xy, 0.0)) * 0.25) + (tmpvar_30 * 0.25)); - rgbyB_4 = tmpvar_31; - if (((tmpvar_31.y < tmpvar_19) || (tmpvar_31.y > tmpvar_18))) { - rgbyB_4.xyz = (tmpvar_30.xyz * 0.5); + 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)); + if (((rgbyB_4.y < tmpvar_22) || (rgbyB_4.y > tmpvar_21))) { + rgbyB_4.xyz = (rgbyA_5.xyz * 0.5); }; tmpvar_3 = rgbyB_4; }; @@ -85,4 +81,11 @@ void main () } -// inputs: 2, stats: 47 alu 9 tex 2 flow +// stats: 47 alu 9 tex 2 flow +// inputs: 2 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// #1: xlv_TEXCOORD1 (high float) 4x1 [-1] +// uniforms: 1 (total size: 0) +// #0: _MainTex_TexelSize (high float) 4x1 [-1] +// textures: 1 +// #0: _MainTex (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-ir.txt deleted file mode 100644 index d8b022f75..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-ir.txt +++ /dev/null @@ -1,1476 +0,0 @@ -#extension GL_ARB_shader_texture_lod : enable -struct v2f { - vec4 pos; - vec2 uv; - vec4 uvPosPos; -}; -uniform sampler2D _MainTex; -uniform vec4 _MainTex_TexelSize; -varying vec4 xlv_SV_POSITION; -varying vec2 xlv_TEXCOORD0; -varying vec4 xlv_TEXCOORD1; -vec4 xll_tex2Dlod ( - in sampler2D s_1, - in vec4 coord_2 -) -{ - vec4 tmpvar_3; - tmpvar_3 = texture2DLod (s_1, coord_2.xy, coord_2.w); - return tmpvar_3; -} - -float xll_saturate ( - in float x_4 -) -{ - float tmpvar_5; - tmpvar_5 = clamp (x_4, 0.0, 1.0); - return tmpvar_5; -} - -vec2 xll_saturate ( - in vec2 x_6 -) -{ - vec2 tmpvar_7; - tmpvar_7 = clamp (x_6, 0.0, 1.0); - return tmpvar_7; -} - -vec3 xll_saturate ( - in vec3 x_8 -) -{ - vec3 tmpvar_9; - tmpvar_9 = clamp (x_8, 0.0, 1.0); - return tmpvar_9; -} - -vec4 xll_saturate ( - in vec4 x_10 -) -{ - vec4 tmpvar_11; - tmpvar_11 = clamp (x_10, 0.0, 1.0); - return tmpvar_11; -} - -mat2 xll_saturate ( - in mat2 m_12 -) -{ - vec2 tmpvar_13; - tmpvar_13 = clamp (m_12[0], 0.0, 1.0); - vec2 tmpvar_14; - tmpvar_14 = clamp (m_12[1], 0.0, 1.0); - mat2 tmpvar_15; - vec2 tmpvar_16; - tmpvar_16 = tmpvar_13; - tmpvar_15[0] = tmpvar_16; - vec2 tmpvar_17; - tmpvar_17 = tmpvar_14; - tmpvar_15[1] = tmpvar_17; - return tmpvar_15; -} - -mat3 xll_saturate ( - in mat3 m_18 -) -{ - vec3 tmpvar_19; - tmpvar_19 = clamp (m_18[0], 0.0, 1.0); - vec3 tmpvar_20; - tmpvar_20 = clamp (m_18[1], 0.0, 1.0); - vec3 tmpvar_21; - tmpvar_21 = clamp (m_18[2], 0.0, 1.0); - mat3 tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = tmpvar_19; - tmpvar_22[0] = tmpvar_23; - vec3 tmpvar_24; - tmpvar_24 = tmpvar_20; - tmpvar_22[1] = tmpvar_24; - vec3 tmpvar_25; - tmpvar_25 = tmpvar_21; - tmpvar_22[2] = tmpvar_25; - return tmpvar_22; -} - -mat4 xll_saturate ( - in mat4 m_26 -) -{ - vec4 tmpvar_27; - tmpvar_27 = clamp (m_26[0], 0.0, 1.0); - vec4 tmpvar_28; - tmpvar_28 = clamp (m_26[1], 0.0, 1.0); - vec4 tmpvar_29; - tmpvar_29 = clamp (m_26[2], 0.0, 1.0); - vec4 tmpvar_30; - tmpvar_30 = clamp (m_26[3], 0.0, 1.0); - mat4 tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_31[0] = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_28; - tmpvar_31[1] = tmpvar_33; - vec4 tmpvar_34; - tmpvar_34 = tmpvar_29; - tmpvar_31[2] = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35 = tmpvar_30; - tmpvar_31[3] = tmpvar_35; - return tmpvar_31; -} - -float FxaaLuma ( - in vec4 rgba_36 -) -{ - return rgba_36.w; -} - -vec4 FxaaPixelShader ( - in vec2 pos_37, - in vec4 fxaaConsolePosPos_38, - in sampler2D tex_39, - in sampler2D fxaaConsole360TexExpBiasNegOne_40, - in sampler2D fxaaConsole360TexExpBiasNegTwo_41, - in vec2 fxaaQualityRcpFrame_42, - in vec4 fxaaConsoleRcpFrameOpt_43, - in vec4 fxaaConsoleRcpFrameOpt2_44, - in vec4 fxaaConsole360RcpFrameOpt2_45, - in float fxaaQualitySubpix_46, - in float fxaaQualityEdgeThreshold_47, - in float fxaaQualityEdgeThresholdMin_48, - in float fxaaConsoleEdgeSharpness_49, - in float fxaaConsoleEdgeThreshold_50, - in float fxaaConsoleEdgeThresholdMin_51, - in vec4 fxaaConsole360ConstDir_52 -) -{ - float pixelOffsetSubpix_53; - float pixelOffsetGood_54; - float subpixH_55; - float pixelOffset_56; - float subpixG_57; - bool goodSpan_58; - float dst_59; - bool directionN_60; - float spanLengthRcp_61; - bool goodSpanP_62; - float spanLength_63; - bool goodSpanN_64; - float dstP_65; - float dstN_66; - bool doneNP_67; - bool doneP_68; - bool doneN_69; - bool lumaMLTZero_70; - float subpixF_71; - float lumaMM_72; - float gradientScaled_73; - float lumaEndP_74; - float subpixE_75; - float lumaEndN_76; - float subpixD_77; - vec2 posP_78; - vec2 posN_79; - vec2 offNP_80; - vec2 posB_81; - float subpixC_82; - float gradient_83; - bool pairN_84; - float lumaSS_85; - float lumaNN_86; - float gradientS_87; - float gradientN_88; - float subpixB_89; - float subpixA_90; - bool horzSpan_91; - float lengthSign_92; - float subpixNWSWNESE_93; - float edgeVert_94; - float edgeHorz_95; - float edgeVert3_96; - float edgeHorz3_97; - float edgeVert4_98; - float edgeHorz4_99; - float lumaSWSE_100; - float lumaNWSW_101; - float edgeVert2_102; - float edgeHorz2_103; - float lumaNWNE_104; - float lumaNESE_105; - float edgeVert1_106; - float edgeHorz1_107; - float subpixNSWE_108; - float subpixRcpRange_109; - float lumaWE_110; - float lumaNS_111; - float lumaSW_112; - float lumaNE_113; - float lumaSE_114; - float lumaNW_115; - bool earlyExit_116; - float rangeMaxClamped_117; - float range_118; - float rangeMaxScaled_119; - float rangeMin_120; - float rangeMax_121; - float minWN_122; - float maxWN_123; - float minESM_124; - float maxESM_125; - float minSM_126; - float maxSM_127; - float lumaW_128; - float lumaN_129; - float lumaE_130; - float lumaS_131; - vec4 rgbyM_132; - vec2 posM_133; - float tmpvar_134; - tmpvar_134 = pos_37.x; - posM_133.x = tmpvar_134; - float tmpvar_135; - tmpvar_135 = pos_37.y; - posM_133.y = vec2(tmpvar_135).y; - vec4 tmpvar_136; - tmpvar_136.zw = vec2(0.0, 0.0); - tmpvar_136.xy = posM_133.xy; - vec4 tmpvar_137; - tmpvar_137 = xll_tex2Dlod (tex_39, tmpvar_136); - vec4 tmpvar_138; - tmpvar_138 = tmpvar_137; - rgbyM_132 = tmpvar_138; - vec4 tmpvar_139; - tmpvar_139.zw = vec2(0.0, 0.0); - tmpvar_139.xy = (posM_133 + (vec2(0.0, 1.0) * fxaaQualityRcpFrame_42.xy)).xy; - vec4 tmpvar_140; - tmpvar_140 = xll_tex2Dlod (tex_39, tmpvar_139); - float tmpvar_141; - tmpvar_141 = FxaaLuma (tmpvar_140); - float tmpvar_142; - tmpvar_142 = tmpvar_141; - lumaS_131 = tmpvar_142; - vec4 tmpvar_143; - tmpvar_143.zw = vec2(0.0, 0.0); - tmpvar_143.xy = (posM_133 + (vec2(1.0, 0.0) * fxaaQualityRcpFrame_42.xy)).xy; - vec4 tmpvar_144; - tmpvar_144 = xll_tex2Dlod (tex_39, tmpvar_143); - float tmpvar_145; - tmpvar_145 = FxaaLuma (tmpvar_144); - float tmpvar_146; - tmpvar_146 = tmpvar_145; - lumaE_130 = tmpvar_146; - vec4 tmpvar_147; - tmpvar_147.zw = vec2(0.0, 0.0); - tmpvar_147.xy = (posM_133 + (vec2(0.0, -1.0) * fxaaQualityRcpFrame_42.xy)).xy; - vec4 tmpvar_148; - tmpvar_148 = xll_tex2Dlod (tex_39, tmpvar_147); - float tmpvar_149; - tmpvar_149 = FxaaLuma (tmpvar_148); - float tmpvar_150; - tmpvar_150 = tmpvar_149; - lumaN_129 = tmpvar_150; - vec4 tmpvar_151; - tmpvar_151.zw = vec2(0.0, 0.0); - tmpvar_151.xy = (posM_133 + (vec2(-1.0, 0.0) * fxaaQualityRcpFrame_42.xy)).xy; - vec4 tmpvar_152; - tmpvar_152 = xll_tex2Dlod (tex_39, tmpvar_151); - float tmpvar_153; - tmpvar_153 = FxaaLuma (tmpvar_152); - float tmpvar_154; - tmpvar_154 = tmpvar_153; - lumaW_128 = tmpvar_154; - float tmpvar_155; - tmpvar_155 = max (lumaS_131, rgbyM_132.w); - float tmpvar_156; - tmpvar_156 = tmpvar_155; - maxSM_127 = tmpvar_156; - float tmpvar_157; - tmpvar_157 = min (lumaS_131, rgbyM_132.w); - float tmpvar_158; - tmpvar_158 = tmpvar_157; - minSM_126 = tmpvar_158; - float tmpvar_159; - tmpvar_159 = max (lumaE_130, maxSM_127); - float tmpvar_160; - tmpvar_160 = tmpvar_159; - maxESM_125 = tmpvar_160; - float tmpvar_161; - tmpvar_161 = min (lumaE_130, minSM_126); - float tmpvar_162; - tmpvar_162 = tmpvar_161; - minESM_124 = tmpvar_162; - float tmpvar_163; - tmpvar_163 = max (lumaN_129, lumaW_128); - float tmpvar_164; - tmpvar_164 = tmpvar_163; - maxWN_123 = tmpvar_164; - float tmpvar_165; - tmpvar_165 = min (lumaN_129, lumaW_128); - float tmpvar_166; - tmpvar_166 = tmpvar_165; - minWN_122 = tmpvar_166; - float tmpvar_167; - tmpvar_167 = max (maxWN_123, maxESM_125); - float tmpvar_168; - tmpvar_168 = tmpvar_167; - rangeMax_121 = tmpvar_168; - float tmpvar_169; - tmpvar_169 = min (minWN_122, minESM_124); - float tmpvar_170; - tmpvar_170 = tmpvar_169; - rangeMin_120 = tmpvar_170; - float tmpvar_171; - tmpvar_171 = (rangeMax_121 * fxaaQualityEdgeThreshold_47); - rangeMaxScaled_119 = tmpvar_171; - float tmpvar_172; - tmpvar_172 = (rangeMax_121 - rangeMin_120); - range_118 = tmpvar_172; - float tmpvar_173; - tmpvar_173 = max (fxaaQualityEdgeThresholdMin_48, rangeMaxScaled_119); - float tmpvar_174; - tmpvar_174 = tmpvar_173; - rangeMaxClamped_117 = tmpvar_174; - bool tmpvar_175; - tmpvar_175 = (range_118 < rangeMaxClamped_117); - earlyExit_116 = tmpvar_175; - if (earlyExit_116) { - return rgbyM_132; - }; - vec4 tmpvar_176; - tmpvar_176.zw = vec2(0.0, 0.0); - tmpvar_176.xy = (posM_133 + (vec2(-1.0, -1.0) * fxaaQualityRcpFrame_42.xy)).xy; - vec4 tmpvar_177; - tmpvar_177 = xll_tex2Dlod (tex_39, tmpvar_176); - float tmpvar_178; - tmpvar_178 = FxaaLuma (tmpvar_177); - float tmpvar_179; - tmpvar_179 = tmpvar_178; - lumaNW_115 = tmpvar_179; - vec4 tmpvar_180; - tmpvar_180.zw = vec2(0.0, 0.0); - tmpvar_180.xy = (posM_133 + (vec2(1.0, 1.0) * fxaaQualityRcpFrame_42.xy)).xy; - vec4 tmpvar_181; - tmpvar_181 = xll_tex2Dlod (tex_39, tmpvar_180); - float tmpvar_182; - tmpvar_182 = FxaaLuma (tmpvar_181); - float tmpvar_183; - tmpvar_183 = tmpvar_182; - lumaSE_114 = tmpvar_183; - vec4 tmpvar_184; - tmpvar_184.zw = vec2(0.0, 0.0); - tmpvar_184.xy = (posM_133 + (vec2(1.0, -1.0) * fxaaQualityRcpFrame_42.xy)).xy; - vec4 tmpvar_185; - tmpvar_185 = xll_tex2Dlod (tex_39, tmpvar_184); - float tmpvar_186; - tmpvar_186 = FxaaLuma (tmpvar_185); - float tmpvar_187; - tmpvar_187 = tmpvar_186; - lumaNE_113 = tmpvar_187; - vec4 tmpvar_188; - tmpvar_188.zw = vec2(0.0, 0.0); - tmpvar_188.xy = (posM_133 + (vec2(-1.0, 1.0) * fxaaQualityRcpFrame_42.xy)).xy; - vec4 tmpvar_189; - tmpvar_189 = xll_tex2Dlod (tex_39, tmpvar_188); - float tmpvar_190; - tmpvar_190 = FxaaLuma (tmpvar_189); - float tmpvar_191; - tmpvar_191 = tmpvar_190; - lumaSW_112 = tmpvar_191; - float tmpvar_192; - tmpvar_192 = (lumaN_129 + lumaS_131); - lumaNS_111 = tmpvar_192; - float tmpvar_193; - tmpvar_193 = (lumaW_128 + lumaE_130); - lumaWE_110 = tmpvar_193; - float tmpvar_194; - tmpvar_194 = (1.0 / range_118); - subpixRcpRange_109 = tmpvar_194; - float tmpvar_195; - tmpvar_195 = (lumaNS_111 + lumaWE_110); - subpixNSWE_108 = tmpvar_195; - float tmpvar_196; - tmpvar_196 = ((-(2.0) * rgbyM_132.w) + lumaNS_111); - edgeHorz1_107 = tmpvar_196; - float tmpvar_197; - tmpvar_197 = ((-(2.0) * rgbyM_132.w) + lumaWE_110); - edgeVert1_106 = tmpvar_197; - float tmpvar_198; - tmpvar_198 = (lumaNE_113 + lumaSE_114); - lumaNESE_105 = tmpvar_198; - float tmpvar_199; - tmpvar_199 = (lumaNW_115 + lumaNE_113); - lumaNWNE_104 = tmpvar_199; - float tmpvar_200; - tmpvar_200 = ((-(2.0) * lumaE_130) + lumaNESE_105); - edgeHorz2_103 = tmpvar_200; - float tmpvar_201; - tmpvar_201 = ((-(2.0) * lumaN_129) + lumaNWNE_104); - edgeVert2_102 = tmpvar_201; - float tmpvar_202; - tmpvar_202 = (lumaNW_115 + lumaSW_112); - lumaNWSW_101 = tmpvar_202; - float tmpvar_203; - tmpvar_203 = (lumaSW_112 + lumaSE_114); - lumaSWSE_100 = tmpvar_203; - float tmpvar_204; - tmpvar_204 = abs (edgeHorz1_107); - float tmpvar_205; - tmpvar_205 = abs (edgeHorz2_103); - float tmpvar_206; - tmpvar_206 = ((tmpvar_204 * 2.0) + tmpvar_205); - edgeHorz4_99 = tmpvar_206; - float tmpvar_207; - tmpvar_207 = abs (edgeVert1_106); - float tmpvar_208; - tmpvar_208 = abs (edgeVert2_102); - float tmpvar_209; - tmpvar_209 = ((tmpvar_207 * 2.0) + tmpvar_208); - edgeVert4_98 = tmpvar_209; - float tmpvar_210; - tmpvar_210 = ((-(2.0) * lumaW_128) + lumaNWSW_101); - edgeHorz3_97 = tmpvar_210; - float tmpvar_211; - tmpvar_211 = ((-(2.0) * lumaS_131) + lumaSWSE_100); - edgeVert3_96 = tmpvar_211; - float tmpvar_212; - tmpvar_212 = abs (edgeHorz3_97); - float tmpvar_213; - tmpvar_213 = (tmpvar_212 + edgeHorz4_99); - edgeHorz_95 = tmpvar_213; - float tmpvar_214; - tmpvar_214 = abs (edgeVert3_96); - float tmpvar_215; - tmpvar_215 = (tmpvar_214 + edgeVert4_98); - edgeVert_94 = tmpvar_215; - float tmpvar_216; - tmpvar_216 = (lumaNWSW_101 + lumaNESE_105); - subpixNWSWNESE_93 = tmpvar_216; - float tmpvar_217; - tmpvar_217 = fxaaQualityRcpFrame_42.x; - lengthSign_92 = tmpvar_217; - bool tmpvar_218; - tmpvar_218 = (edgeHorz_95 >= edgeVert_94); - horzSpan_91 = tmpvar_218; - float tmpvar_219; - tmpvar_219 = ((subpixNSWE_108 * 2.0) + subpixNWSWNESE_93); - subpixA_90 = tmpvar_219; - if (!(horzSpan_91)) { - float tmpvar_220; - tmpvar_220 = lumaW_128; - lumaN_129 = tmpvar_220; - }; - if (!(horzSpan_91)) { - float tmpvar_221; - tmpvar_221 = lumaE_130; - lumaS_131 = tmpvar_221; - }; - if (horzSpan_91) { - float tmpvar_222; - tmpvar_222 = fxaaQualityRcpFrame_42.y; - lengthSign_92 = tmpvar_222; - }; - float tmpvar_223; - tmpvar_223 = ((subpixA_90 * 0.0833333) - rgbyM_132.w); - subpixB_89 = tmpvar_223; - float tmpvar_224; - tmpvar_224 = (lumaN_129 - rgbyM_132.w); - gradientN_88 = tmpvar_224; - float tmpvar_225; - tmpvar_225 = (lumaS_131 - rgbyM_132.w); - gradientS_87 = tmpvar_225; - float tmpvar_226; - tmpvar_226 = (lumaN_129 + rgbyM_132.w); - lumaNN_86 = tmpvar_226; - float tmpvar_227; - tmpvar_227 = (lumaS_131 + rgbyM_132.w); - lumaSS_85 = tmpvar_227; - float tmpvar_228; - tmpvar_228 = abs (gradientN_88); - float tmpvar_229; - tmpvar_229 = abs (gradientS_87); - bool tmpvar_230; - tmpvar_230 = (tmpvar_228 >= tmpvar_229); - pairN_84 = tmpvar_230; - float tmpvar_231; - tmpvar_231 = abs (gradientN_88); - float tmpvar_232; - tmpvar_232 = abs (gradientS_87); - float tmpvar_233; - tmpvar_233 = max (tmpvar_231, tmpvar_232); - float tmpvar_234; - tmpvar_234 = tmpvar_233; - gradient_83 = tmpvar_234; - if (pairN_84) { - float tmpvar_235; - tmpvar_235 = -(lengthSign_92); - lengthSign_92 = tmpvar_235; - }; - float tmpvar_236; - tmpvar_236 = abs (subpixB_89); - float tmpvar_237; - tmpvar_237 = xll_saturate ((tmpvar_236 * subpixRcpRange_109)); - float tmpvar_238; - tmpvar_238 = tmpvar_237; - subpixC_82 = tmpvar_238; - float tmpvar_239; - tmpvar_239 = posM_133.x; - posB_81.x = tmpvar_239; - float tmpvar_240; - tmpvar_240 = posM_133.y; - posB_81.y = vec2(tmpvar_240).y; - float tmpvar_241; - if (!(horzSpan_91)) { - tmpvar_241 = 0.0; - } else { - tmpvar_241 = fxaaQualityRcpFrame_42.x; - }; - float tmpvar_242; - tmpvar_242 = tmpvar_241; - offNP_80.x = tmpvar_242; - float tmpvar_243; - if (horzSpan_91) { - tmpvar_243 = 0.0; - } else { - tmpvar_243 = fxaaQualityRcpFrame_42.y; - }; - float tmpvar_244; - tmpvar_244 = tmpvar_243; - offNP_80.y = vec2(tmpvar_244).y; - if (!(horzSpan_91)) { - float tmpvar_245; - tmpvar_245 = (posB_81.x + (lengthSign_92 * 0.5)); - posB_81.x = tmpvar_245; - }; - if (horzSpan_91) { - float tmpvar_246; - tmpvar_246 = (posB_81.y + (lengthSign_92 * 0.5)); - posB_81.y = vec2(tmpvar_246).y; - }; - float tmpvar_247; - tmpvar_247 = (posB_81.x - (offNP_80.x * 1.0)); - posN_79.x = tmpvar_247; - float tmpvar_248; - tmpvar_248 = (posB_81.y - (offNP_80.y * 1.0)); - posN_79.y = vec2(tmpvar_248).y; - float tmpvar_249; - tmpvar_249 = (posB_81.x + (offNP_80.x * 1.0)); - posP_78.x = tmpvar_249; - float tmpvar_250; - tmpvar_250 = (posB_81.y + (offNP_80.y * 1.0)); - posP_78.y = vec2(tmpvar_250).y; - float tmpvar_251; - tmpvar_251 = ((-(2.0) * subpixC_82) + 3.0); - subpixD_77 = tmpvar_251; - vec4 tmpvar_252; - tmpvar_252.zw = vec2(0.0, 0.0); - tmpvar_252.xy = posN_79.xy; - vec4 tmpvar_253; - tmpvar_253 = xll_tex2Dlod (tex_39, tmpvar_252); - float tmpvar_254; - tmpvar_254 = FxaaLuma (tmpvar_253); - float tmpvar_255; - tmpvar_255 = tmpvar_254; - lumaEndN_76 = tmpvar_255; - float tmpvar_256; - tmpvar_256 = (subpixC_82 * subpixC_82); - subpixE_75 = tmpvar_256; - vec4 tmpvar_257; - tmpvar_257.zw = vec2(0.0, 0.0); - tmpvar_257.xy = posP_78.xy; - vec4 tmpvar_258; - tmpvar_258 = xll_tex2Dlod (tex_39, tmpvar_257); - float tmpvar_259; - tmpvar_259 = FxaaLuma (tmpvar_258); - float tmpvar_260; - tmpvar_260 = tmpvar_259; - lumaEndP_74 = tmpvar_260; - if (!(pairN_84)) { - float tmpvar_261; - tmpvar_261 = lumaSS_85; - lumaNN_86 = tmpvar_261; - }; - float tmpvar_262; - tmpvar_262 = ((gradient_83 * 1.0) / 4.0); - gradientScaled_73 = tmpvar_262; - float tmpvar_263; - tmpvar_263 = (rgbyM_132.w - (lumaNN_86 * 0.5)); - lumaMM_72 = tmpvar_263; - float tmpvar_264; - tmpvar_264 = (subpixD_77 * subpixE_75); - subpixF_71 = tmpvar_264; - bool tmpvar_265; - tmpvar_265 = (lumaMM_72 < 0.0); - lumaMLTZero_70 = tmpvar_265; - float tmpvar_266; - tmpvar_266 = (lumaEndN_76 - (lumaNN_86 * 0.5)); - lumaEndN_76 = tmpvar_266; - float tmpvar_267; - tmpvar_267 = (lumaEndP_74 - (lumaNN_86 * 0.5)); - lumaEndP_74 = tmpvar_267; - float tmpvar_268; - tmpvar_268 = abs (lumaEndN_76); - bool tmpvar_269; - tmpvar_269 = (tmpvar_268 >= gradientScaled_73); - doneN_69 = tmpvar_269; - float tmpvar_270; - tmpvar_270 = abs (lumaEndP_74); - bool tmpvar_271; - tmpvar_271 = (tmpvar_270 >= gradientScaled_73); - doneP_68 = tmpvar_271; - if (!(doneN_69)) { - float tmpvar_272; - tmpvar_272 = (posN_79.x - (offNP_80.x * 1.0)); - posN_79.x = tmpvar_272; - }; - if (!(doneN_69)) { - float tmpvar_273; - tmpvar_273 = (posN_79.y - (offNP_80.y * 1.0)); - posN_79.y = vec2(tmpvar_273).y; - }; - bool tmpvar_274; - tmpvar_274 = (!(doneN_69) || !(doneP_68)); - doneNP_67 = tmpvar_274; - if (!(doneP_68)) { - float tmpvar_275; - tmpvar_275 = (posP_78.x + (offNP_80.x * 1.0)); - posP_78.x = tmpvar_275; - }; - if (!(doneP_68)) { - float tmpvar_276; - tmpvar_276 = (posP_78.y + (offNP_80.y * 1.0)); - posP_78.y = vec2(tmpvar_276).y; - }; - if (doneNP_67) { - if (!(doneN_69)) { - vec4 tmpvar_277; - tmpvar_277.zw = vec2(0.0, 0.0); - tmpvar_277.xy = posN_79.xy.xy; - vec4 tmpvar_278; - tmpvar_278 = xll_tex2Dlod (tex_39, tmpvar_277); - float tmpvar_279; - tmpvar_279 = FxaaLuma (tmpvar_278); - float tmpvar_280; - tmpvar_280 = tmpvar_279; - lumaEndN_76 = tmpvar_280; - }; - if (!(doneP_68)) { - vec4 tmpvar_281; - tmpvar_281.zw = vec2(0.0, 0.0); - tmpvar_281.xy = posP_78.xy.xy; - vec4 tmpvar_282; - tmpvar_282 = xll_tex2Dlod (tex_39, tmpvar_281); - float tmpvar_283; - tmpvar_283 = FxaaLuma (tmpvar_282); - float tmpvar_284; - tmpvar_284 = tmpvar_283; - lumaEndP_74 = tmpvar_284; - }; - if (!(doneN_69)) { - float tmpvar_285; - tmpvar_285 = (lumaEndN_76 - (lumaNN_86 * 0.5)); - lumaEndN_76 = tmpvar_285; - }; - if (!(doneP_68)) { - float tmpvar_286; - tmpvar_286 = (lumaEndP_74 - (lumaNN_86 * 0.5)); - lumaEndP_74 = tmpvar_286; - }; - float tmpvar_287; - tmpvar_287 = abs (lumaEndN_76); - bool tmpvar_288; - tmpvar_288 = (tmpvar_287 >= gradientScaled_73); - doneN_69 = tmpvar_288; - float tmpvar_289; - tmpvar_289 = abs (lumaEndP_74); - bool tmpvar_290; - tmpvar_290 = (tmpvar_289 >= gradientScaled_73); - doneP_68 = tmpvar_290; - if (!(doneN_69)) { - float tmpvar_291; - tmpvar_291 = (posN_79.x - (offNP_80.x * 1.0)); - posN_79.x = tmpvar_291; - }; - if (!(doneN_69)) { - float tmpvar_292; - tmpvar_292 = (posN_79.y - (offNP_80.y * 1.0)); - posN_79.y = vec2(tmpvar_292).y; - }; - bool tmpvar_293; - tmpvar_293 = (!(doneN_69) || !(doneP_68)); - doneNP_67 = tmpvar_293; - if (!(doneP_68)) { - float tmpvar_294; - tmpvar_294 = (posP_78.x + (offNP_80.x * 1.0)); - posP_78.x = tmpvar_294; - }; - if (!(doneP_68)) { - float tmpvar_295; - tmpvar_295 = (posP_78.y + (offNP_80.y * 1.0)); - posP_78.y = vec2(tmpvar_295).y; - }; - if (doneNP_67) { - if (!(doneN_69)) { - vec4 tmpvar_296; - tmpvar_296.zw = vec2(0.0, 0.0); - tmpvar_296.xy = posN_79.xy.xy; - vec4 tmpvar_297; - tmpvar_297 = xll_tex2Dlod (tex_39, tmpvar_296); - float tmpvar_298; - tmpvar_298 = FxaaLuma (tmpvar_297); - float tmpvar_299; - tmpvar_299 = tmpvar_298; - lumaEndN_76 = tmpvar_299; - }; - if (!(doneP_68)) { - vec4 tmpvar_300; - tmpvar_300.zw = vec2(0.0, 0.0); - tmpvar_300.xy = posP_78.xy.xy; - vec4 tmpvar_301; - tmpvar_301 = xll_tex2Dlod (tex_39, tmpvar_300); - float tmpvar_302; - tmpvar_302 = FxaaLuma (tmpvar_301); - float tmpvar_303; - tmpvar_303 = tmpvar_302; - lumaEndP_74 = tmpvar_303; - }; - if (!(doneN_69)) { - float tmpvar_304; - tmpvar_304 = (lumaEndN_76 - (lumaNN_86 * 0.5)); - lumaEndN_76 = tmpvar_304; - }; - if (!(doneP_68)) { - float tmpvar_305; - tmpvar_305 = (lumaEndP_74 - (lumaNN_86 * 0.5)); - lumaEndP_74 = tmpvar_305; - }; - float tmpvar_306; - tmpvar_306 = abs (lumaEndN_76); - bool tmpvar_307; - tmpvar_307 = (tmpvar_306 >= gradientScaled_73); - doneN_69 = tmpvar_307; - float tmpvar_308; - tmpvar_308 = abs (lumaEndP_74); - bool tmpvar_309; - tmpvar_309 = (tmpvar_308 >= gradientScaled_73); - doneP_68 = tmpvar_309; - if (!(doneN_69)) { - float tmpvar_310; - tmpvar_310 = (posN_79.x - (offNP_80.x * 1.0)); - posN_79.x = tmpvar_310; - }; - if (!(doneN_69)) { - float tmpvar_311; - tmpvar_311 = (posN_79.y - (offNP_80.y * 1.0)); - posN_79.y = vec2(tmpvar_311).y; - }; - bool tmpvar_312; - tmpvar_312 = (!(doneN_69) || !(doneP_68)); - doneNP_67 = tmpvar_312; - if (!(doneP_68)) { - float tmpvar_313; - tmpvar_313 = (posP_78.x + (offNP_80.x * 1.0)); - posP_78.x = tmpvar_313; - }; - if (!(doneP_68)) { - float tmpvar_314; - tmpvar_314 = (posP_78.y + (offNP_80.y * 1.0)); - posP_78.y = vec2(tmpvar_314).y; - }; - if (doneNP_67) { - if (!(doneN_69)) { - vec4 tmpvar_315; - tmpvar_315.zw = vec2(0.0, 0.0); - tmpvar_315.xy = posN_79.xy.xy; - vec4 tmpvar_316; - tmpvar_316 = xll_tex2Dlod (tex_39, tmpvar_315); - float tmpvar_317; - tmpvar_317 = FxaaLuma (tmpvar_316); - float tmpvar_318; - tmpvar_318 = tmpvar_317; - lumaEndN_76 = tmpvar_318; - }; - if (!(doneP_68)) { - vec4 tmpvar_319; - tmpvar_319.zw = vec2(0.0, 0.0); - tmpvar_319.xy = posP_78.xy.xy; - vec4 tmpvar_320; - tmpvar_320 = xll_tex2Dlod (tex_39, tmpvar_319); - float tmpvar_321; - tmpvar_321 = FxaaLuma (tmpvar_320); - float tmpvar_322; - tmpvar_322 = tmpvar_321; - lumaEndP_74 = tmpvar_322; - }; - if (!(doneN_69)) { - float tmpvar_323; - tmpvar_323 = (lumaEndN_76 - (lumaNN_86 * 0.5)); - lumaEndN_76 = tmpvar_323; - }; - if (!(doneP_68)) { - float tmpvar_324; - tmpvar_324 = (lumaEndP_74 - (lumaNN_86 * 0.5)); - lumaEndP_74 = tmpvar_324; - }; - float tmpvar_325; - tmpvar_325 = abs (lumaEndN_76); - bool tmpvar_326; - tmpvar_326 = (tmpvar_325 >= gradientScaled_73); - doneN_69 = tmpvar_326; - float tmpvar_327; - tmpvar_327 = abs (lumaEndP_74); - bool tmpvar_328; - tmpvar_328 = (tmpvar_327 >= gradientScaled_73); - doneP_68 = tmpvar_328; - if (!(doneN_69)) { - float tmpvar_329; - tmpvar_329 = (posN_79.x - (offNP_80.x * 1.0)); - posN_79.x = tmpvar_329; - }; - if (!(doneN_69)) { - float tmpvar_330; - tmpvar_330 = (posN_79.y - (offNP_80.y * 1.0)); - posN_79.y = vec2(tmpvar_330).y; - }; - bool tmpvar_331; - tmpvar_331 = (!(doneN_69) || !(doneP_68)); - doneNP_67 = tmpvar_331; - if (!(doneP_68)) { - float tmpvar_332; - tmpvar_332 = (posP_78.x + (offNP_80.x * 1.0)); - posP_78.x = tmpvar_332; - }; - if (!(doneP_68)) { - float tmpvar_333; - tmpvar_333 = (posP_78.y + (offNP_80.y * 1.0)); - posP_78.y = vec2(tmpvar_333).y; - }; - if (doneNP_67) { - if (!(doneN_69)) { - vec4 tmpvar_334; - tmpvar_334.zw = vec2(0.0, 0.0); - tmpvar_334.xy = posN_79.xy.xy; - vec4 tmpvar_335; - tmpvar_335 = xll_tex2Dlod (tex_39, tmpvar_334); - float tmpvar_336; - tmpvar_336 = FxaaLuma (tmpvar_335); - float tmpvar_337; - tmpvar_337 = tmpvar_336; - lumaEndN_76 = tmpvar_337; - }; - if (!(doneP_68)) { - vec4 tmpvar_338; - tmpvar_338.zw = vec2(0.0, 0.0); - tmpvar_338.xy = posP_78.xy.xy; - vec4 tmpvar_339; - tmpvar_339 = xll_tex2Dlod (tex_39, tmpvar_338); - float tmpvar_340; - tmpvar_340 = FxaaLuma (tmpvar_339); - float tmpvar_341; - tmpvar_341 = tmpvar_340; - lumaEndP_74 = tmpvar_341; - }; - if (!(doneN_69)) { - float tmpvar_342; - tmpvar_342 = (lumaEndN_76 - (lumaNN_86 * 0.5)); - lumaEndN_76 = tmpvar_342; - }; - if (!(doneP_68)) { - float tmpvar_343; - tmpvar_343 = (lumaEndP_74 - (lumaNN_86 * 0.5)); - lumaEndP_74 = tmpvar_343; - }; - float tmpvar_344; - tmpvar_344 = abs (lumaEndN_76); - bool tmpvar_345; - tmpvar_345 = (tmpvar_344 >= gradientScaled_73); - doneN_69 = tmpvar_345; - float tmpvar_346; - tmpvar_346 = abs (lumaEndP_74); - bool tmpvar_347; - tmpvar_347 = (tmpvar_346 >= gradientScaled_73); - doneP_68 = tmpvar_347; - if (!(doneN_69)) { - float tmpvar_348; - tmpvar_348 = (posN_79.x - (offNP_80.x * 1.5)); - posN_79.x = tmpvar_348; - }; - if (!(doneN_69)) { - float tmpvar_349; - tmpvar_349 = (posN_79.y - (offNP_80.y * 1.5)); - posN_79.y = vec2(tmpvar_349).y; - }; - bool tmpvar_350; - tmpvar_350 = (!(doneN_69) || !(doneP_68)); - doneNP_67 = tmpvar_350; - if (!(doneP_68)) { - float tmpvar_351; - tmpvar_351 = (posP_78.x + (offNP_80.x * 1.5)); - posP_78.x = tmpvar_351; - }; - if (!(doneP_68)) { - float tmpvar_352; - tmpvar_352 = (posP_78.y + (offNP_80.y * 1.5)); - posP_78.y = vec2(tmpvar_352).y; - }; - if (doneNP_67) { - if (!(doneN_69)) { - vec4 tmpvar_353; - tmpvar_353.zw = vec2(0.0, 0.0); - tmpvar_353.xy = posN_79.xy.xy; - vec4 tmpvar_354; - tmpvar_354 = xll_tex2Dlod (tex_39, tmpvar_353); - float tmpvar_355; - tmpvar_355 = FxaaLuma (tmpvar_354); - float tmpvar_356; - tmpvar_356 = tmpvar_355; - lumaEndN_76 = tmpvar_356; - }; - if (!(doneP_68)) { - vec4 tmpvar_357; - tmpvar_357.zw = vec2(0.0, 0.0); - tmpvar_357.xy = posP_78.xy.xy; - vec4 tmpvar_358; - tmpvar_358 = xll_tex2Dlod (tex_39, tmpvar_357); - float tmpvar_359; - tmpvar_359 = FxaaLuma (tmpvar_358); - float tmpvar_360; - tmpvar_360 = tmpvar_359; - lumaEndP_74 = tmpvar_360; - }; - if (!(doneN_69)) { - float tmpvar_361; - tmpvar_361 = (lumaEndN_76 - (lumaNN_86 * 0.5)); - lumaEndN_76 = tmpvar_361; - }; - if (!(doneP_68)) { - float tmpvar_362; - tmpvar_362 = (lumaEndP_74 - (lumaNN_86 * 0.5)); - lumaEndP_74 = tmpvar_362; - }; - float tmpvar_363; - tmpvar_363 = abs (lumaEndN_76); - bool tmpvar_364; - tmpvar_364 = (tmpvar_363 >= gradientScaled_73); - doneN_69 = tmpvar_364; - float tmpvar_365; - tmpvar_365 = abs (lumaEndP_74); - bool tmpvar_366; - tmpvar_366 = (tmpvar_365 >= gradientScaled_73); - doneP_68 = tmpvar_366; - if (!(doneN_69)) { - float tmpvar_367; - tmpvar_367 = (posN_79.x - (offNP_80.x * 2.0)); - posN_79.x = tmpvar_367; - }; - if (!(doneN_69)) { - float tmpvar_368; - tmpvar_368 = (posN_79.y - (offNP_80.y * 2.0)); - posN_79.y = vec2(tmpvar_368).y; - }; - bool tmpvar_369; - tmpvar_369 = (!(doneN_69) || !(doneP_68)); - doneNP_67 = tmpvar_369; - if (!(doneP_68)) { - float tmpvar_370; - tmpvar_370 = (posP_78.x + (offNP_80.x * 2.0)); - posP_78.x = tmpvar_370; - }; - if (!(doneP_68)) { - float tmpvar_371; - tmpvar_371 = (posP_78.y + (offNP_80.y * 2.0)); - posP_78.y = vec2(tmpvar_371).y; - }; - if (doneNP_67) { - if (!(doneN_69)) { - vec4 tmpvar_372; - tmpvar_372.zw = vec2(0.0, 0.0); - tmpvar_372.xy = posN_79.xy.xy; - vec4 tmpvar_373; - tmpvar_373 = xll_tex2Dlod (tex_39, tmpvar_372); - float tmpvar_374; - tmpvar_374 = FxaaLuma (tmpvar_373); - float tmpvar_375; - tmpvar_375 = tmpvar_374; - lumaEndN_76 = tmpvar_375; - }; - if (!(doneP_68)) { - vec4 tmpvar_376; - tmpvar_376.zw = vec2(0.0, 0.0); - tmpvar_376.xy = posP_78.xy.xy; - vec4 tmpvar_377; - tmpvar_377 = xll_tex2Dlod (tex_39, tmpvar_376); - float tmpvar_378; - tmpvar_378 = FxaaLuma (tmpvar_377); - float tmpvar_379; - tmpvar_379 = tmpvar_378; - lumaEndP_74 = tmpvar_379; - }; - if (!(doneN_69)) { - float tmpvar_380; - tmpvar_380 = (lumaEndN_76 - (lumaNN_86 * 0.5)); - lumaEndN_76 = tmpvar_380; - }; - if (!(doneP_68)) { - float tmpvar_381; - tmpvar_381 = (lumaEndP_74 - (lumaNN_86 * 0.5)); - lumaEndP_74 = tmpvar_381; - }; - float tmpvar_382; - tmpvar_382 = abs (lumaEndN_76); - bool tmpvar_383; - tmpvar_383 = (tmpvar_382 >= gradientScaled_73); - doneN_69 = tmpvar_383; - float tmpvar_384; - tmpvar_384 = abs (lumaEndP_74); - bool tmpvar_385; - tmpvar_385 = (tmpvar_384 >= gradientScaled_73); - doneP_68 = tmpvar_385; - if (!(doneN_69)) { - float tmpvar_386; - tmpvar_386 = (posN_79.x - (offNP_80.x * 2.0)); - posN_79.x = tmpvar_386; - }; - if (!(doneN_69)) { - float tmpvar_387; - tmpvar_387 = (posN_79.y - (offNP_80.y * 2.0)); - posN_79.y = vec2(tmpvar_387).y; - }; - bool tmpvar_388; - tmpvar_388 = (!(doneN_69) || !(doneP_68)); - doneNP_67 = tmpvar_388; - if (!(doneP_68)) { - float tmpvar_389; - tmpvar_389 = (posP_78.x + (offNP_80.x * 2.0)); - posP_78.x = tmpvar_389; - }; - if (!(doneP_68)) { - float tmpvar_390; - tmpvar_390 = (posP_78.y + (offNP_80.y * 2.0)); - posP_78.y = vec2(tmpvar_390).y; - }; - if (doneNP_67) { - if (!(doneN_69)) { - vec4 tmpvar_391; - tmpvar_391.zw = vec2(0.0, 0.0); - tmpvar_391.xy = posN_79.xy.xy; - vec4 tmpvar_392; - tmpvar_392 = xll_tex2Dlod (tex_39, tmpvar_391); - float tmpvar_393; - tmpvar_393 = FxaaLuma (tmpvar_392); - float tmpvar_394; - tmpvar_394 = tmpvar_393; - lumaEndN_76 = tmpvar_394; - }; - if (!(doneP_68)) { - vec4 tmpvar_395; - tmpvar_395.zw = vec2(0.0, 0.0); - tmpvar_395.xy = posP_78.xy.xy; - vec4 tmpvar_396; - tmpvar_396 = xll_tex2Dlod (tex_39, tmpvar_395); - float tmpvar_397; - tmpvar_397 = FxaaLuma (tmpvar_396); - float tmpvar_398; - tmpvar_398 = tmpvar_397; - lumaEndP_74 = tmpvar_398; - }; - if (!(doneN_69)) { - float tmpvar_399; - tmpvar_399 = (lumaEndN_76 - (lumaNN_86 * 0.5)); - lumaEndN_76 = tmpvar_399; - }; - if (!(doneP_68)) { - float tmpvar_400; - tmpvar_400 = (lumaEndP_74 - (lumaNN_86 * 0.5)); - lumaEndP_74 = tmpvar_400; - }; - float tmpvar_401; - tmpvar_401 = abs (lumaEndN_76); - bool tmpvar_402; - tmpvar_402 = (tmpvar_401 >= gradientScaled_73); - doneN_69 = tmpvar_402; - float tmpvar_403; - tmpvar_403 = abs (lumaEndP_74); - bool tmpvar_404; - tmpvar_404 = (tmpvar_403 >= gradientScaled_73); - doneP_68 = tmpvar_404; - if (!(doneN_69)) { - float tmpvar_405; - tmpvar_405 = (posN_79.x - (offNP_80.x * 2.0)); - posN_79.x = tmpvar_405; - }; - if (!(doneN_69)) { - float tmpvar_406; - tmpvar_406 = (posN_79.y - (offNP_80.y * 2.0)); - posN_79.y = vec2(tmpvar_406).y; - }; - bool tmpvar_407; - tmpvar_407 = (!(doneN_69) || !(doneP_68)); - doneNP_67 = tmpvar_407; - if (!(doneP_68)) { - float tmpvar_408; - tmpvar_408 = (posP_78.x + (offNP_80.x * 2.0)); - posP_78.x = tmpvar_408; - }; - if (!(doneP_68)) { - float tmpvar_409; - tmpvar_409 = (posP_78.y + (offNP_80.y * 2.0)); - posP_78.y = vec2(tmpvar_409).y; - }; - if (doneNP_67) { - if (!(doneN_69)) { - vec4 tmpvar_410; - tmpvar_410.zw = vec2(0.0, 0.0); - tmpvar_410.xy = posN_79.xy.xy; - vec4 tmpvar_411; - tmpvar_411 = xll_tex2Dlod (tex_39, tmpvar_410); - float tmpvar_412; - tmpvar_412 = FxaaLuma (tmpvar_411); - float tmpvar_413; - tmpvar_413 = tmpvar_412; - lumaEndN_76 = tmpvar_413; - }; - if (!(doneP_68)) { - vec4 tmpvar_414; - tmpvar_414.zw = vec2(0.0, 0.0); - tmpvar_414.xy = posP_78.xy.xy; - vec4 tmpvar_415; - tmpvar_415 = xll_tex2Dlod (tex_39, tmpvar_414); - float tmpvar_416; - tmpvar_416 = FxaaLuma (tmpvar_415); - float tmpvar_417; - tmpvar_417 = tmpvar_416; - lumaEndP_74 = tmpvar_417; - }; - if (!(doneN_69)) { - float tmpvar_418; - tmpvar_418 = (lumaEndN_76 - (lumaNN_86 * 0.5)); - lumaEndN_76 = tmpvar_418; - }; - if (!(doneP_68)) { - float tmpvar_419; - tmpvar_419 = (lumaEndP_74 - (lumaNN_86 * 0.5)); - lumaEndP_74 = tmpvar_419; - }; - float tmpvar_420; - tmpvar_420 = abs (lumaEndN_76); - bool tmpvar_421; - tmpvar_421 = (tmpvar_420 >= gradientScaled_73); - doneN_69 = tmpvar_421; - float tmpvar_422; - tmpvar_422 = abs (lumaEndP_74); - bool tmpvar_423; - tmpvar_423 = (tmpvar_422 >= gradientScaled_73); - doneP_68 = tmpvar_423; - if (!(doneN_69)) { - float tmpvar_424; - tmpvar_424 = (posN_79.x - (offNP_80.x * 2.0)); - posN_79.x = tmpvar_424; - }; - if (!(doneN_69)) { - float tmpvar_425; - tmpvar_425 = (posN_79.y - (offNP_80.y * 2.0)); - posN_79.y = vec2(tmpvar_425).y; - }; - bool tmpvar_426; - tmpvar_426 = (!(doneN_69) || !(doneP_68)); - doneNP_67 = tmpvar_426; - if (!(doneP_68)) { - float tmpvar_427; - tmpvar_427 = (posP_78.x + (offNP_80.x * 2.0)); - posP_78.x = tmpvar_427; - }; - if (!(doneP_68)) { - float tmpvar_428; - tmpvar_428 = (posP_78.y + (offNP_80.y * 2.0)); - posP_78.y = vec2(tmpvar_428).y; - }; - if (doneNP_67) { - if (!(doneN_69)) { - vec4 tmpvar_429; - tmpvar_429.zw = vec2(0.0, 0.0); - tmpvar_429.xy = posN_79.xy.xy; - vec4 tmpvar_430; - tmpvar_430 = xll_tex2Dlod (tex_39, tmpvar_429); - float tmpvar_431; - tmpvar_431 = FxaaLuma (tmpvar_430); - float tmpvar_432; - tmpvar_432 = tmpvar_431; - lumaEndN_76 = tmpvar_432; - }; - if (!(doneP_68)) { - vec4 tmpvar_433; - tmpvar_433.zw = vec2(0.0, 0.0); - tmpvar_433.xy = posP_78.xy.xy; - vec4 tmpvar_434; - tmpvar_434 = xll_tex2Dlod (tex_39, tmpvar_433); - float tmpvar_435; - tmpvar_435 = FxaaLuma (tmpvar_434); - float tmpvar_436; - tmpvar_436 = tmpvar_435; - lumaEndP_74 = tmpvar_436; - }; - if (!(doneN_69)) { - float tmpvar_437; - tmpvar_437 = (lumaEndN_76 - (lumaNN_86 * 0.5)); - lumaEndN_76 = tmpvar_437; - }; - if (!(doneP_68)) { - float tmpvar_438; - tmpvar_438 = (lumaEndP_74 - (lumaNN_86 * 0.5)); - lumaEndP_74 = tmpvar_438; - }; - float tmpvar_439; - tmpvar_439 = abs (lumaEndN_76); - bool tmpvar_440; - tmpvar_440 = (tmpvar_439 >= gradientScaled_73); - doneN_69 = tmpvar_440; - float tmpvar_441; - tmpvar_441 = abs (lumaEndP_74); - bool tmpvar_442; - tmpvar_442 = (tmpvar_441 >= gradientScaled_73); - doneP_68 = tmpvar_442; - if (!(doneN_69)) { - float tmpvar_443; - tmpvar_443 = (posN_79.x - (offNP_80.x * 4.0)); - posN_79.x = tmpvar_443; - }; - if (!(doneN_69)) { - float tmpvar_444; - tmpvar_444 = (posN_79.y - (offNP_80.y * 4.0)); - posN_79.y = vec2(tmpvar_444).y; - }; - bool tmpvar_445; - tmpvar_445 = (!(doneN_69) || !(doneP_68)); - doneNP_67 = tmpvar_445; - if (!(doneP_68)) { - float tmpvar_446; - tmpvar_446 = (posP_78.x + (offNP_80.x * 4.0)); - posP_78.x = tmpvar_446; - }; - if (!(doneP_68)) { - float tmpvar_447; - tmpvar_447 = (posP_78.y + (offNP_80.y * 4.0)); - posP_78.y = vec2(tmpvar_447).y; - }; - if (doneNP_67) { - if (!(doneN_69)) { - vec4 tmpvar_448; - tmpvar_448.zw = vec2(0.0, 0.0); - tmpvar_448.xy = posN_79.xy.xy; - vec4 tmpvar_449; - tmpvar_449 = xll_tex2Dlod (tex_39, tmpvar_448); - float tmpvar_450; - tmpvar_450 = FxaaLuma (tmpvar_449); - float tmpvar_451; - tmpvar_451 = tmpvar_450; - lumaEndN_76 = tmpvar_451; - }; - if (!(doneP_68)) { - vec4 tmpvar_452; - tmpvar_452.zw = vec2(0.0, 0.0); - tmpvar_452.xy = posP_78.xy.xy; - vec4 tmpvar_453; - tmpvar_453 = xll_tex2Dlod (tex_39, tmpvar_452); - float tmpvar_454; - tmpvar_454 = FxaaLuma (tmpvar_453); - float tmpvar_455; - tmpvar_455 = tmpvar_454; - lumaEndP_74 = tmpvar_455; - }; - if (!(doneN_69)) { - float tmpvar_456; - tmpvar_456 = (lumaEndN_76 - (lumaNN_86 * 0.5)); - lumaEndN_76 = tmpvar_456; - }; - if (!(doneP_68)) { - float tmpvar_457; - tmpvar_457 = (lumaEndP_74 - (lumaNN_86 * 0.5)); - lumaEndP_74 = tmpvar_457; - }; - float tmpvar_458; - tmpvar_458 = abs (lumaEndN_76); - bool tmpvar_459; - tmpvar_459 = (tmpvar_458 >= gradientScaled_73); - doneN_69 = tmpvar_459; - float tmpvar_460; - tmpvar_460 = abs (lumaEndP_74); - bool tmpvar_461; - tmpvar_461 = (tmpvar_460 >= gradientScaled_73); - doneP_68 = tmpvar_461; - if (!(doneN_69)) { - float tmpvar_462; - tmpvar_462 = (posN_79.x - (offNP_80.x * 8.0)); - posN_79.x = tmpvar_462; - }; - if (!(doneN_69)) { - float tmpvar_463; - tmpvar_463 = (posN_79.y - (offNP_80.y * 8.0)); - posN_79.y = vec2(tmpvar_463).y; - }; - bool tmpvar_464; - tmpvar_464 = (!(doneN_69) || !(doneP_68)); - doneNP_67 = tmpvar_464; - if (!(doneP_68)) { - float tmpvar_465; - tmpvar_465 = (posP_78.x + (offNP_80.x * 8.0)); - posP_78.x = tmpvar_465; - }; - if (!(doneP_68)) { - float tmpvar_466; - tmpvar_466 = (posP_78.y + (offNP_80.y * 8.0)); - posP_78.y = vec2(tmpvar_466).y; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - float tmpvar_467; - tmpvar_467 = (posM_133.x - posN_79.x); - dstN_66 = tmpvar_467; - float tmpvar_468; - tmpvar_468 = (posP_78.x - posM_133.x); - dstP_65 = tmpvar_468; - if (!(horzSpan_91)) { - float tmpvar_469; - tmpvar_469 = (posM_133.y - posN_79.y); - dstN_66 = tmpvar_469; - }; - if (!(horzSpan_91)) { - float tmpvar_470; - tmpvar_470 = (posP_78.y - posM_133.y); - dstP_65 = tmpvar_470; - }; - bool tmpvar_471; - tmpvar_471 = ((lumaEndN_76 < 0.0) != lumaMLTZero_70); - goodSpanN_64 = tmpvar_471; - float tmpvar_472; - tmpvar_472 = (dstP_65 + dstN_66); - spanLength_63 = tmpvar_472; - bool tmpvar_473; - tmpvar_473 = ((lumaEndP_74 < 0.0) != lumaMLTZero_70); - goodSpanP_62 = tmpvar_473; - float tmpvar_474; - tmpvar_474 = (1.0 / spanLength_63); - spanLengthRcp_61 = tmpvar_474; - bool tmpvar_475; - tmpvar_475 = (dstN_66 < dstP_65); - directionN_60 = tmpvar_475; - float tmpvar_476; - tmpvar_476 = min (dstN_66, dstP_65); - float tmpvar_477; - tmpvar_477 = tmpvar_476; - dst_59 = tmpvar_477; - bool tmpvar_478; - if (directionN_60) { - tmpvar_478 = goodSpanN_64; - } else { - tmpvar_478 = goodSpanP_62; - }; - bool tmpvar_479; - tmpvar_479 = tmpvar_478; - goodSpan_58 = tmpvar_479; - float tmpvar_480; - tmpvar_480 = (subpixF_71 * subpixF_71); - subpixG_57 = tmpvar_480; - float tmpvar_481; - tmpvar_481 = ((dst_59 * -(spanLengthRcp_61)) + 0.5); - pixelOffset_56 = tmpvar_481; - float tmpvar_482; - tmpvar_482 = (subpixG_57 * fxaaQualitySubpix_46); - subpixH_55 = tmpvar_482; - float tmpvar_483; - if (goodSpan_58) { - tmpvar_483 = pixelOffset_56; - } else { - tmpvar_483 = 0.0; - }; - float tmpvar_484; - tmpvar_484 = tmpvar_483; - pixelOffsetGood_54 = tmpvar_484; - float tmpvar_485; - tmpvar_485 = max (pixelOffsetGood_54, subpixH_55); - float tmpvar_486; - tmpvar_486 = tmpvar_485; - pixelOffsetSubpix_53 = tmpvar_486; - if (!(horzSpan_91)) { - float tmpvar_487; - tmpvar_487 = (posM_133.x + (pixelOffsetSubpix_53 * lengthSign_92)); - posM_133.x = tmpvar_487; - }; - if (horzSpan_91) { - float tmpvar_488; - tmpvar_488 = (posM_133.y + (pixelOffsetSubpix_53 * lengthSign_92)); - posM_133.y = vec2(tmpvar_488).y; - }; - vec4 tmpvar_489; - tmpvar_489.zw = vec2(0.0, 0.0); - tmpvar_489.xy = posM_133.xy; - vec4 tmpvar_490; - tmpvar_490 = xll_tex2Dlod (tex_39, tmpvar_489); - vec4 tmpvar_491; - tmpvar_491.xyz = tmpvar_490.xyz.xyz; - tmpvar_491.w = rgbyM_132.w; - return tmpvar_491; -} - -vec4 xlat_main ( - in v2f i_492 -) -{ - float fxaaN_493; - float tmpvar_494; - tmpvar_494 = 0.5; - fxaaN_493 = tmpvar_494; - vec4 tmpvar_495; - tmpvar_495.x = -(fxaaN_493); - tmpvar_495.y = -(fxaaN_493); - tmpvar_495.z = fxaaN_493; - tmpvar_495.w = fxaaN_493; - vec4 tmpvar_496; - tmpvar_496 = FxaaPixelShader (i_492.uv, i_492.uvPosPos, _MainTex, _MainTex, _MainTex, _MainTex_TexelSize.xy, (_MainTex_TexelSize.xyxy * tmpvar_495), (_MainTex_TexelSize.xyxy * vec4(-2.0, -2.0, 2.0, 2.0)), (_MainTex_TexelSize.xyxy * vec4(8.0, 8.0, -4.0, -4.0)), 0.75, 0.166, 0.0833, 8.0, 0.125, 0.05, vec4(1.0, -1.0, 0.25, -0.25)); - return tmpvar_496; -} - -void main () -{ - v2f xlt_i_497; - vec4 xl_retval_498; - vec4 tmpvar_499; - tmpvar_499 = xlv_SV_POSITION.xyzw; - vec4 tmpvar_500; - tmpvar_500 = tmpvar_499; - xlt_i_497.pos = tmpvar_500; - vec2 tmpvar_501; - tmpvar_501 = xlv_TEXCOORD0.xy; - vec2 tmpvar_502; - tmpvar_502 = tmpvar_501; - xlt_i_497.uv = tmpvar_502; - vec4 tmpvar_503; - tmpvar_503 = xlv_TEXCOORD1.xyzw; - vec4 tmpvar_504; - tmpvar_504 = tmpvar_503; - xlt_i_497.uvPosPos = tmpvar_504; - vec4 tmpvar_505; - tmpvar_505 = xlat_main (xlt_i_497); - vec4 tmpvar_506; - tmpvar_506 = tmpvar_505; - xl_retval_498 = tmpvar_506; - vec4 tmpvar_507; - tmpvar_507 = xl_retval_498.xyzw; - vec4 tmpvar_508; - tmpvar_508 = tmpvar_507; - gl_FragData[0] = tmpvar_508; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-irES.txt deleted file mode 100644 index 748ce9c29..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-irES.txt +++ /dev/null @@ -1,1476 +0,0 @@ -#extension GL_EXT_shader_texture_lod : enable -struct v2f { - highp vec4 pos; - highp vec2 uv; - highp vec4 uvPosPos; -}; -uniform sampler2D _MainTex; -uniform highp vec4 _MainTex_TexelSize; -varying highp vec4 xlv_SV_POSITION; -varying highp vec2 xlv_TEXCOORD0; -varying highp vec4 xlv_TEXCOORD1; -mediump vec4 xll_tex2Dlod ( - in sampler2D s_1, - in mediump vec4 coord_2 -) -{ - lowp vec4 tmpvar_3; - tmpvar_3 = texture2DLodEXT (s_1, coord_2.xy, coord_2.w); - return tmpvar_3; -} - -mediump float xll_saturate ( - in mediump float x_4 -) -{ - mediump float tmpvar_5; - tmpvar_5 = clamp (x_4, 0.0, 1.0); - return tmpvar_5; -} - -mediump vec2 xll_saturate ( - in mediump vec2 x_6 -) -{ - mediump vec2 tmpvar_7; - tmpvar_7 = clamp (x_6, 0.0, 1.0); - return tmpvar_7; -} - -mediump vec3 xll_saturate ( - in mediump vec3 x_8 -) -{ - mediump vec3 tmpvar_9; - tmpvar_9 = clamp (x_8, 0.0, 1.0); - return tmpvar_9; -} - -mediump vec4 xll_saturate ( - in mediump vec4 x_10 -) -{ - mediump vec4 tmpvar_11; - tmpvar_11 = clamp (x_10, 0.0, 1.0); - return tmpvar_11; -} - -mediump mat2 xll_saturate ( - in mediump mat2 m_12 -) -{ - mediump vec2 tmpvar_13; - tmpvar_13 = clamp (m_12[0], 0.0, 1.0); - mediump vec2 tmpvar_14; - tmpvar_14 = clamp (m_12[1], 0.0, 1.0); - mediump mat2 tmpvar_15; - mediump vec2 tmpvar_16; - tmpvar_16 = tmpvar_13; - tmpvar_15[0] = tmpvar_16; - mediump vec2 tmpvar_17; - tmpvar_17 = tmpvar_14; - tmpvar_15[1] = tmpvar_17; - return tmpvar_15; -} - -mediump mat3 xll_saturate ( - in mediump mat3 m_18 -) -{ - mediump vec3 tmpvar_19; - tmpvar_19 = clamp (m_18[0], 0.0, 1.0); - mediump vec3 tmpvar_20; - tmpvar_20 = clamp (m_18[1], 0.0, 1.0); - mediump vec3 tmpvar_21; - tmpvar_21 = clamp (m_18[2], 0.0, 1.0); - mediump mat3 tmpvar_22; - mediump vec3 tmpvar_23; - tmpvar_23 = tmpvar_19; - tmpvar_22[0] = tmpvar_23; - mediump vec3 tmpvar_24; - tmpvar_24 = tmpvar_20; - tmpvar_22[1] = tmpvar_24; - mediump vec3 tmpvar_25; - tmpvar_25 = tmpvar_21; - tmpvar_22[2] = tmpvar_25; - return tmpvar_22; -} - -mediump mat4 xll_saturate ( - in mediump mat4 m_26 -) -{ - mediump vec4 tmpvar_27; - tmpvar_27 = clamp (m_26[0], 0.0, 1.0); - mediump vec4 tmpvar_28; - tmpvar_28 = clamp (m_26[1], 0.0, 1.0); - mediump vec4 tmpvar_29; - tmpvar_29 = clamp (m_26[2], 0.0, 1.0); - mediump vec4 tmpvar_30; - tmpvar_30 = clamp (m_26[3], 0.0, 1.0); - mediump mat4 tmpvar_31; - mediump vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_31[0] = tmpvar_32; - mediump vec4 tmpvar_33; - tmpvar_33 = tmpvar_28; - tmpvar_31[1] = tmpvar_33; - mediump vec4 tmpvar_34; - tmpvar_34 = tmpvar_29; - tmpvar_31[2] = tmpvar_34; - mediump vec4 tmpvar_35; - tmpvar_35 = tmpvar_30; - tmpvar_31[3] = tmpvar_35; - return tmpvar_31; -} - -float FxaaLuma ( - in highp vec4 rgba_36 -) -{ - return rgba_36.w; -} - -vec4 FxaaPixelShader ( - in highp vec2 pos_37, - in highp vec4 fxaaConsolePosPos_38, - in sampler2D tex_39, - in sampler2D fxaaConsole360TexExpBiasNegOne_40, - in sampler2D fxaaConsole360TexExpBiasNegTwo_41, - in highp vec2 fxaaQualityRcpFrame_42, - in highp vec4 fxaaConsoleRcpFrameOpt_43, - in highp vec4 fxaaConsoleRcpFrameOpt2_44, - in highp vec4 fxaaConsole360RcpFrameOpt2_45, - in highp float fxaaQualitySubpix_46, - in highp float fxaaQualityEdgeThreshold_47, - in highp float fxaaQualityEdgeThresholdMin_48, - in highp float fxaaConsoleEdgeSharpness_49, - in highp float fxaaConsoleEdgeThreshold_50, - in highp float fxaaConsoleEdgeThresholdMin_51, - in highp vec4 fxaaConsole360ConstDir_52 -) -{ - highp float pixelOffsetSubpix_53; - highp float pixelOffsetGood_54; - highp float subpixH_55; - highp float pixelOffset_56; - highp float subpixG_57; - bool goodSpan_58; - highp float dst_59; - bool directionN_60; - highp float spanLengthRcp_61; - bool goodSpanP_62; - highp float spanLength_63; - bool goodSpanN_64; - highp float dstP_65; - highp float dstN_66; - bool doneNP_67; - bool doneP_68; - bool doneN_69; - bool lumaMLTZero_70; - highp float subpixF_71; - highp float lumaMM_72; - highp float gradientScaled_73; - highp float lumaEndP_74; - highp float subpixE_75; - highp float lumaEndN_76; - highp float subpixD_77; - highp vec2 posP_78; - highp vec2 posN_79; - highp vec2 offNP_80; - highp vec2 posB_81; - highp float subpixC_82; - highp float gradient_83; - bool pairN_84; - highp float lumaSS_85; - highp float lumaNN_86; - highp float gradientS_87; - highp float gradientN_88; - highp float subpixB_89; - highp float subpixA_90; - bool horzSpan_91; - highp float lengthSign_92; - highp float subpixNWSWNESE_93; - highp float edgeVert_94; - highp float edgeHorz_95; - highp float edgeVert3_96; - highp float edgeHorz3_97; - highp float edgeVert4_98; - highp float edgeHorz4_99; - highp float lumaSWSE_100; - highp float lumaNWSW_101; - highp float edgeVert2_102; - highp float edgeHorz2_103; - highp float lumaNWNE_104; - highp float lumaNESE_105; - highp float edgeVert1_106; - highp float edgeHorz1_107; - highp float subpixNSWE_108; - highp float subpixRcpRange_109; - highp float lumaWE_110; - highp float lumaNS_111; - highp float lumaSW_112; - highp float lumaNE_113; - highp float lumaSE_114; - highp float lumaNW_115; - bool earlyExit_116; - highp float rangeMaxClamped_117; - highp float range_118; - highp float rangeMaxScaled_119; - highp float rangeMin_120; - highp float rangeMax_121; - highp float minWN_122; - highp float maxWN_123; - highp float minESM_124; - highp float maxESM_125; - highp float minSM_126; - highp float maxSM_127; - highp float lumaW_128; - highp float lumaN_129; - highp float lumaE_130; - highp float lumaS_131; - highp vec4 rgbyM_132; - highp vec2 posM_133; - highp float tmpvar_134; - tmpvar_134 = pos_37.x; - posM_133.x = tmpvar_134; - highp float tmpvar_135; - tmpvar_135 = pos_37.y; - posM_133.y = vec2(tmpvar_135).y; - highp vec4 tmpvar_136; - tmpvar_136.zw = vec2(0.0, 0.0); - tmpvar_136.xy = posM_133.xy; - mediump vec4 tmpvar_137; - tmpvar_137 = xll_tex2Dlod (tex_39, tmpvar_136); - mediump vec4 tmpvar_138; - tmpvar_138 = tmpvar_137; - rgbyM_132 = tmpvar_138; - highp vec4 tmpvar_139; - tmpvar_139.zw = vec2(0.0, 0.0); - tmpvar_139.xy = (posM_133 + (vec2(0.0, 1.0) * fxaaQualityRcpFrame_42.xy)).xy; - mediump vec4 tmpvar_140; - tmpvar_140 = xll_tex2Dlod (tex_39, tmpvar_139); - highp float tmpvar_141; - tmpvar_141 = FxaaLuma (tmpvar_140); - highp float tmpvar_142; - tmpvar_142 = tmpvar_141; - lumaS_131 = tmpvar_142; - highp vec4 tmpvar_143; - tmpvar_143.zw = vec2(0.0, 0.0); - tmpvar_143.xy = (posM_133 + (vec2(1.0, 0.0) * fxaaQualityRcpFrame_42.xy)).xy; - mediump vec4 tmpvar_144; - tmpvar_144 = xll_tex2Dlod (tex_39, tmpvar_143); - highp float tmpvar_145; - tmpvar_145 = FxaaLuma (tmpvar_144); - highp float tmpvar_146; - tmpvar_146 = tmpvar_145; - lumaE_130 = tmpvar_146; - highp vec4 tmpvar_147; - tmpvar_147.zw = vec2(0.0, 0.0); - tmpvar_147.xy = (posM_133 + (vec2(0.0, -1.0) * fxaaQualityRcpFrame_42.xy)).xy; - mediump vec4 tmpvar_148; - tmpvar_148 = xll_tex2Dlod (tex_39, tmpvar_147); - highp float tmpvar_149; - tmpvar_149 = FxaaLuma (tmpvar_148); - highp float tmpvar_150; - tmpvar_150 = tmpvar_149; - lumaN_129 = tmpvar_150; - highp vec4 tmpvar_151; - tmpvar_151.zw = vec2(0.0, 0.0); - tmpvar_151.xy = (posM_133 + (vec2(-1.0, 0.0) * fxaaQualityRcpFrame_42.xy)).xy; - mediump vec4 tmpvar_152; - tmpvar_152 = xll_tex2Dlod (tex_39, tmpvar_151); - highp float tmpvar_153; - tmpvar_153 = FxaaLuma (tmpvar_152); - highp float tmpvar_154; - tmpvar_154 = tmpvar_153; - lumaW_128 = tmpvar_154; - highp float tmpvar_155; - tmpvar_155 = max (lumaS_131, rgbyM_132.w); - highp float tmpvar_156; - tmpvar_156 = tmpvar_155; - maxSM_127 = tmpvar_156; - highp float tmpvar_157; - tmpvar_157 = min (lumaS_131, rgbyM_132.w); - highp float tmpvar_158; - tmpvar_158 = tmpvar_157; - minSM_126 = tmpvar_158; - highp float tmpvar_159; - tmpvar_159 = max (lumaE_130, maxSM_127); - highp float tmpvar_160; - tmpvar_160 = tmpvar_159; - maxESM_125 = tmpvar_160; - highp float tmpvar_161; - tmpvar_161 = min (lumaE_130, minSM_126); - highp float tmpvar_162; - tmpvar_162 = tmpvar_161; - minESM_124 = tmpvar_162; - highp float tmpvar_163; - tmpvar_163 = max (lumaN_129, lumaW_128); - highp float tmpvar_164; - tmpvar_164 = tmpvar_163; - maxWN_123 = tmpvar_164; - highp float tmpvar_165; - tmpvar_165 = min (lumaN_129, lumaW_128); - highp float tmpvar_166; - tmpvar_166 = tmpvar_165; - minWN_122 = tmpvar_166; - highp float tmpvar_167; - tmpvar_167 = max (maxWN_123, maxESM_125); - highp float tmpvar_168; - tmpvar_168 = tmpvar_167; - rangeMax_121 = tmpvar_168; - highp float tmpvar_169; - tmpvar_169 = min (minWN_122, minESM_124); - highp float tmpvar_170; - tmpvar_170 = tmpvar_169; - rangeMin_120 = tmpvar_170; - highp float tmpvar_171; - tmpvar_171 = (rangeMax_121 * fxaaQualityEdgeThreshold_47); - rangeMaxScaled_119 = tmpvar_171; - highp float tmpvar_172; - tmpvar_172 = (rangeMax_121 - rangeMin_120); - range_118 = tmpvar_172; - highp float tmpvar_173; - tmpvar_173 = max (fxaaQualityEdgeThresholdMin_48, rangeMaxScaled_119); - highp float tmpvar_174; - tmpvar_174 = tmpvar_173; - rangeMaxClamped_117 = tmpvar_174; - bool tmpvar_175; - tmpvar_175 = (range_118 < rangeMaxClamped_117); - earlyExit_116 = tmpvar_175; - if (earlyExit_116) { - return rgbyM_132; - }; - highp vec4 tmpvar_176; - tmpvar_176.zw = vec2(0.0, 0.0); - tmpvar_176.xy = (posM_133 + (vec2(-1.0, -1.0) * fxaaQualityRcpFrame_42.xy)).xy; - mediump vec4 tmpvar_177; - tmpvar_177 = xll_tex2Dlod (tex_39, tmpvar_176); - highp float tmpvar_178; - tmpvar_178 = FxaaLuma (tmpvar_177); - highp float tmpvar_179; - tmpvar_179 = tmpvar_178; - lumaNW_115 = tmpvar_179; - highp vec4 tmpvar_180; - tmpvar_180.zw = vec2(0.0, 0.0); - tmpvar_180.xy = (posM_133 + (vec2(1.0, 1.0) * fxaaQualityRcpFrame_42.xy)).xy; - mediump vec4 tmpvar_181; - tmpvar_181 = xll_tex2Dlod (tex_39, tmpvar_180); - highp float tmpvar_182; - tmpvar_182 = FxaaLuma (tmpvar_181); - highp float tmpvar_183; - tmpvar_183 = tmpvar_182; - lumaSE_114 = tmpvar_183; - highp vec4 tmpvar_184; - tmpvar_184.zw = vec2(0.0, 0.0); - tmpvar_184.xy = (posM_133 + (vec2(1.0, -1.0) * fxaaQualityRcpFrame_42.xy)).xy; - mediump vec4 tmpvar_185; - tmpvar_185 = xll_tex2Dlod (tex_39, tmpvar_184); - highp float tmpvar_186; - tmpvar_186 = FxaaLuma (tmpvar_185); - highp float tmpvar_187; - tmpvar_187 = tmpvar_186; - lumaNE_113 = tmpvar_187; - highp vec4 tmpvar_188; - tmpvar_188.zw = vec2(0.0, 0.0); - tmpvar_188.xy = (posM_133 + (vec2(-1.0, 1.0) * fxaaQualityRcpFrame_42.xy)).xy; - mediump vec4 tmpvar_189; - tmpvar_189 = xll_tex2Dlod (tex_39, tmpvar_188); - highp float tmpvar_190; - tmpvar_190 = FxaaLuma (tmpvar_189); - highp float tmpvar_191; - tmpvar_191 = tmpvar_190; - lumaSW_112 = tmpvar_191; - highp float tmpvar_192; - tmpvar_192 = (lumaN_129 + lumaS_131); - lumaNS_111 = tmpvar_192; - highp float tmpvar_193; - tmpvar_193 = (lumaW_128 + lumaE_130); - lumaWE_110 = tmpvar_193; - highp float tmpvar_194; - tmpvar_194 = (1.0 / range_118); - subpixRcpRange_109 = tmpvar_194; - highp float tmpvar_195; - tmpvar_195 = (lumaNS_111 + lumaWE_110); - subpixNSWE_108 = tmpvar_195; - highp float tmpvar_196; - tmpvar_196 = ((-(2.0) * rgbyM_132.w) + lumaNS_111); - edgeHorz1_107 = tmpvar_196; - highp float tmpvar_197; - tmpvar_197 = ((-(2.0) * rgbyM_132.w) + lumaWE_110); - edgeVert1_106 = tmpvar_197; - highp float tmpvar_198; - tmpvar_198 = (lumaNE_113 + lumaSE_114); - lumaNESE_105 = tmpvar_198; - highp float tmpvar_199; - tmpvar_199 = (lumaNW_115 + lumaNE_113); - lumaNWNE_104 = tmpvar_199; - highp float tmpvar_200; - tmpvar_200 = ((-(2.0) * lumaE_130) + lumaNESE_105); - edgeHorz2_103 = tmpvar_200; - highp float tmpvar_201; - tmpvar_201 = ((-(2.0) * lumaN_129) + lumaNWNE_104); - edgeVert2_102 = tmpvar_201; - highp float tmpvar_202; - tmpvar_202 = (lumaNW_115 + lumaSW_112); - lumaNWSW_101 = tmpvar_202; - highp float tmpvar_203; - tmpvar_203 = (lumaSW_112 + lumaSE_114); - lumaSWSE_100 = tmpvar_203; - highp float tmpvar_204; - tmpvar_204 = abs (edgeHorz1_107); - highp float tmpvar_205; - tmpvar_205 = abs (edgeHorz2_103); - highp float tmpvar_206; - tmpvar_206 = ((tmpvar_204 * 2.0) + tmpvar_205); - edgeHorz4_99 = tmpvar_206; - highp float tmpvar_207; - tmpvar_207 = abs (edgeVert1_106); - highp float tmpvar_208; - tmpvar_208 = abs (edgeVert2_102); - highp float tmpvar_209; - tmpvar_209 = ((tmpvar_207 * 2.0) + tmpvar_208); - edgeVert4_98 = tmpvar_209; - highp float tmpvar_210; - tmpvar_210 = ((-(2.0) * lumaW_128) + lumaNWSW_101); - edgeHorz3_97 = tmpvar_210; - highp float tmpvar_211; - tmpvar_211 = ((-(2.0) * lumaS_131) + lumaSWSE_100); - edgeVert3_96 = tmpvar_211; - highp float tmpvar_212; - tmpvar_212 = abs (edgeHorz3_97); - highp float tmpvar_213; - tmpvar_213 = (tmpvar_212 + edgeHorz4_99); - edgeHorz_95 = tmpvar_213; - highp float tmpvar_214; - tmpvar_214 = abs (edgeVert3_96); - highp float tmpvar_215; - tmpvar_215 = (tmpvar_214 + edgeVert4_98); - edgeVert_94 = tmpvar_215; - highp float tmpvar_216; - tmpvar_216 = (lumaNWSW_101 + lumaNESE_105); - subpixNWSWNESE_93 = tmpvar_216; - highp float tmpvar_217; - tmpvar_217 = fxaaQualityRcpFrame_42.x; - lengthSign_92 = tmpvar_217; - bool tmpvar_218; - tmpvar_218 = (edgeHorz_95 >= edgeVert_94); - horzSpan_91 = tmpvar_218; - highp float tmpvar_219; - tmpvar_219 = ((subpixNSWE_108 * 2.0) + subpixNWSWNESE_93); - subpixA_90 = tmpvar_219; - if (!(horzSpan_91)) { - highp float tmpvar_220; - tmpvar_220 = lumaW_128; - lumaN_129 = tmpvar_220; - }; - if (!(horzSpan_91)) { - highp float tmpvar_221; - tmpvar_221 = lumaE_130; - lumaS_131 = tmpvar_221; - }; - if (horzSpan_91) { - highp float tmpvar_222; - tmpvar_222 = fxaaQualityRcpFrame_42.y; - lengthSign_92 = tmpvar_222; - }; - highp float tmpvar_223; - tmpvar_223 = ((subpixA_90 * 0.0833333) - rgbyM_132.w); - subpixB_89 = tmpvar_223; - highp float tmpvar_224; - tmpvar_224 = (lumaN_129 - rgbyM_132.w); - gradientN_88 = tmpvar_224; - highp float tmpvar_225; - tmpvar_225 = (lumaS_131 - rgbyM_132.w); - gradientS_87 = tmpvar_225; - highp float tmpvar_226; - tmpvar_226 = (lumaN_129 + rgbyM_132.w); - lumaNN_86 = tmpvar_226; - highp float tmpvar_227; - tmpvar_227 = (lumaS_131 + rgbyM_132.w); - lumaSS_85 = tmpvar_227; - highp float tmpvar_228; - tmpvar_228 = abs (gradientN_88); - highp float tmpvar_229; - tmpvar_229 = abs (gradientS_87); - bool tmpvar_230; - tmpvar_230 = (tmpvar_228 >= tmpvar_229); - pairN_84 = tmpvar_230; - highp float tmpvar_231; - tmpvar_231 = abs (gradientN_88); - highp float tmpvar_232; - tmpvar_232 = abs (gradientS_87); - highp float tmpvar_233; - tmpvar_233 = max (tmpvar_231, tmpvar_232); - highp float tmpvar_234; - tmpvar_234 = tmpvar_233; - gradient_83 = tmpvar_234; - if (pairN_84) { - highp float tmpvar_235; - tmpvar_235 = -(lengthSign_92); - lengthSign_92 = tmpvar_235; - }; - highp float tmpvar_236; - tmpvar_236 = abs (subpixB_89); - mediump float tmpvar_237; - tmpvar_237 = xll_saturate ((tmpvar_236 * subpixRcpRange_109)); - mediump float tmpvar_238; - tmpvar_238 = tmpvar_237; - subpixC_82 = tmpvar_238; - highp float tmpvar_239; - tmpvar_239 = posM_133.x; - posB_81.x = tmpvar_239; - highp float tmpvar_240; - tmpvar_240 = posM_133.y; - posB_81.y = vec2(tmpvar_240).y; - highp float tmpvar_241; - if (!(horzSpan_91)) { - tmpvar_241 = 0.0; - } else { - tmpvar_241 = fxaaQualityRcpFrame_42.x; - }; - highp float tmpvar_242; - tmpvar_242 = tmpvar_241; - offNP_80.x = tmpvar_242; - highp float tmpvar_243; - if (horzSpan_91) { - tmpvar_243 = 0.0; - } else { - tmpvar_243 = fxaaQualityRcpFrame_42.y; - }; - highp float tmpvar_244; - tmpvar_244 = tmpvar_243; - offNP_80.y = vec2(tmpvar_244).y; - if (!(horzSpan_91)) { - highp float tmpvar_245; - tmpvar_245 = (posB_81.x + (lengthSign_92 * 0.5)); - posB_81.x = tmpvar_245; - }; - if (horzSpan_91) { - highp float tmpvar_246; - tmpvar_246 = (posB_81.y + (lengthSign_92 * 0.5)); - posB_81.y = vec2(tmpvar_246).y; - }; - highp float tmpvar_247; - tmpvar_247 = (posB_81.x - (offNP_80.x * 1.0)); - posN_79.x = tmpvar_247; - highp float tmpvar_248; - tmpvar_248 = (posB_81.y - (offNP_80.y * 1.0)); - posN_79.y = vec2(tmpvar_248).y; - highp float tmpvar_249; - tmpvar_249 = (posB_81.x + (offNP_80.x * 1.0)); - posP_78.x = tmpvar_249; - highp float tmpvar_250; - tmpvar_250 = (posB_81.y + (offNP_80.y * 1.0)); - posP_78.y = vec2(tmpvar_250).y; - highp float tmpvar_251; - tmpvar_251 = ((-(2.0) * subpixC_82) + 3.0); - subpixD_77 = tmpvar_251; - highp vec4 tmpvar_252; - tmpvar_252.zw = vec2(0.0, 0.0); - tmpvar_252.xy = posN_79.xy; - mediump vec4 tmpvar_253; - tmpvar_253 = xll_tex2Dlod (tex_39, tmpvar_252); - highp float tmpvar_254; - tmpvar_254 = FxaaLuma (tmpvar_253); - highp float tmpvar_255; - tmpvar_255 = tmpvar_254; - lumaEndN_76 = tmpvar_255; - highp float tmpvar_256; - tmpvar_256 = (subpixC_82 * subpixC_82); - subpixE_75 = tmpvar_256; - highp vec4 tmpvar_257; - tmpvar_257.zw = vec2(0.0, 0.0); - tmpvar_257.xy = posP_78.xy; - mediump vec4 tmpvar_258; - tmpvar_258 = xll_tex2Dlod (tex_39, tmpvar_257); - highp float tmpvar_259; - tmpvar_259 = FxaaLuma (tmpvar_258); - highp float tmpvar_260; - tmpvar_260 = tmpvar_259; - lumaEndP_74 = tmpvar_260; - if (!(pairN_84)) { - highp float tmpvar_261; - tmpvar_261 = lumaSS_85; - lumaNN_86 = tmpvar_261; - }; - highp float tmpvar_262; - tmpvar_262 = ((gradient_83 * 1.0) / 4.0); - gradientScaled_73 = tmpvar_262; - highp float tmpvar_263; - tmpvar_263 = (rgbyM_132.w - (lumaNN_86 * 0.5)); - lumaMM_72 = tmpvar_263; - highp float tmpvar_264; - tmpvar_264 = (subpixD_77 * subpixE_75); - subpixF_71 = tmpvar_264; - bool tmpvar_265; - tmpvar_265 = (lumaMM_72 < 0.0); - lumaMLTZero_70 = tmpvar_265; - highp float tmpvar_266; - tmpvar_266 = (lumaEndN_76 - (lumaNN_86 * 0.5)); - lumaEndN_76 = tmpvar_266; - highp float tmpvar_267; - tmpvar_267 = (lumaEndP_74 - (lumaNN_86 * 0.5)); - lumaEndP_74 = tmpvar_267; - highp float tmpvar_268; - tmpvar_268 = abs (lumaEndN_76); - bool tmpvar_269; - tmpvar_269 = (tmpvar_268 >= gradientScaled_73); - doneN_69 = tmpvar_269; - highp float tmpvar_270; - tmpvar_270 = abs (lumaEndP_74); - bool tmpvar_271; - tmpvar_271 = (tmpvar_270 >= gradientScaled_73); - doneP_68 = tmpvar_271; - if (!(doneN_69)) { - highp float tmpvar_272; - tmpvar_272 = (posN_79.x - (offNP_80.x * 1.0)); - posN_79.x = tmpvar_272; - }; - if (!(doneN_69)) { - highp float tmpvar_273; - tmpvar_273 = (posN_79.y - (offNP_80.y * 1.0)); - posN_79.y = vec2(tmpvar_273).y; - }; - bool tmpvar_274; - tmpvar_274 = (!(doneN_69) || !(doneP_68)); - doneNP_67 = tmpvar_274; - if (!(doneP_68)) { - highp float tmpvar_275; - tmpvar_275 = (posP_78.x + (offNP_80.x * 1.0)); - posP_78.x = tmpvar_275; - }; - if (!(doneP_68)) { - highp float tmpvar_276; - tmpvar_276 = (posP_78.y + (offNP_80.y * 1.0)); - posP_78.y = vec2(tmpvar_276).y; - }; - if (doneNP_67) { - if (!(doneN_69)) { - highp vec4 tmpvar_277; - tmpvar_277.zw = vec2(0.0, 0.0); - tmpvar_277.xy = posN_79.xy.xy; - mediump vec4 tmpvar_278; - tmpvar_278 = xll_tex2Dlod (tex_39, tmpvar_277); - highp float tmpvar_279; - tmpvar_279 = FxaaLuma (tmpvar_278); - highp float tmpvar_280; - tmpvar_280 = tmpvar_279; - lumaEndN_76 = tmpvar_280; - }; - if (!(doneP_68)) { - highp vec4 tmpvar_281; - tmpvar_281.zw = vec2(0.0, 0.0); - tmpvar_281.xy = posP_78.xy.xy; - mediump vec4 tmpvar_282; - tmpvar_282 = xll_tex2Dlod (tex_39, tmpvar_281); - highp float tmpvar_283; - tmpvar_283 = FxaaLuma (tmpvar_282); - highp float tmpvar_284; - tmpvar_284 = tmpvar_283; - lumaEndP_74 = tmpvar_284; - }; - if (!(doneN_69)) { - highp float tmpvar_285; - tmpvar_285 = (lumaEndN_76 - (lumaNN_86 * 0.5)); - lumaEndN_76 = tmpvar_285; - }; - if (!(doneP_68)) { - highp float tmpvar_286; - tmpvar_286 = (lumaEndP_74 - (lumaNN_86 * 0.5)); - lumaEndP_74 = tmpvar_286; - }; - highp float tmpvar_287; - tmpvar_287 = abs (lumaEndN_76); - bool tmpvar_288; - tmpvar_288 = (tmpvar_287 >= gradientScaled_73); - doneN_69 = tmpvar_288; - highp float tmpvar_289; - tmpvar_289 = abs (lumaEndP_74); - bool tmpvar_290; - tmpvar_290 = (tmpvar_289 >= gradientScaled_73); - doneP_68 = tmpvar_290; - if (!(doneN_69)) { - highp float tmpvar_291; - tmpvar_291 = (posN_79.x - (offNP_80.x * 1.0)); - posN_79.x = tmpvar_291; - }; - if (!(doneN_69)) { - highp float tmpvar_292; - tmpvar_292 = (posN_79.y - (offNP_80.y * 1.0)); - posN_79.y = vec2(tmpvar_292).y; - }; - bool tmpvar_293; - tmpvar_293 = (!(doneN_69) || !(doneP_68)); - doneNP_67 = tmpvar_293; - if (!(doneP_68)) { - highp float tmpvar_294; - tmpvar_294 = (posP_78.x + (offNP_80.x * 1.0)); - posP_78.x = tmpvar_294; - }; - if (!(doneP_68)) { - highp float tmpvar_295; - tmpvar_295 = (posP_78.y + (offNP_80.y * 1.0)); - posP_78.y = vec2(tmpvar_295).y; - }; - if (doneNP_67) { - if (!(doneN_69)) { - highp vec4 tmpvar_296; - tmpvar_296.zw = vec2(0.0, 0.0); - tmpvar_296.xy = posN_79.xy.xy; - mediump vec4 tmpvar_297; - tmpvar_297 = xll_tex2Dlod (tex_39, tmpvar_296); - highp float tmpvar_298; - tmpvar_298 = FxaaLuma (tmpvar_297); - highp float tmpvar_299; - tmpvar_299 = tmpvar_298; - lumaEndN_76 = tmpvar_299; - }; - if (!(doneP_68)) { - highp vec4 tmpvar_300; - tmpvar_300.zw = vec2(0.0, 0.0); - tmpvar_300.xy = posP_78.xy.xy; - mediump vec4 tmpvar_301; - tmpvar_301 = xll_tex2Dlod (tex_39, tmpvar_300); - highp float tmpvar_302; - tmpvar_302 = FxaaLuma (tmpvar_301); - highp float tmpvar_303; - tmpvar_303 = tmpvar_302; - lumaEndP_74 = tmpvar_303; - }; - if (!(doneN_69)) { - highp float tmpvar_304; - tmpvar_304 = (lumaEndN_76 - (lumaNN_86 * 0.5)); - lumaEndN_76 = tmpvar_304; - }; - if (!(doneP_68)) { - highp float tmpvar_305; - tmpvar_305 = (lumaEndP_74 - (lumaNN_86 * 0.5)); - lumaEndP_74 = tmpvar_305; - }; - highp float tmpvar_306; - tmpvar_306 = abs (lumaEndN_76); - bool tmpvar_307; - tmpvar_307 = (tmpvar_306 >= gradientScaled_73); - doneN_69 = tmpvar_307; - highp float tmpvar_308; - tmpvar_308 = abs (lumaEndP_74); - bool tmpvar_309; - tmpvar_309 = (tmpvar_308 >= gradientScaled_73); - doneP_68 = tmpvar_309; - if (!(doneN_69)) { - highp float tmpvar_310; - tmpvar_310 = (posN_79.x - (offNP_80.x * 1.0)); - posN_79.x = tmpvar_310; - }; - if (!(doneN_69)) { - highp float tmpvar_311; - tmpvar_311 = (posN_79.y - (offNP_80.y * 1.0)); - posN_79.y = vec2(tmpvar_311).y; - }; - bool tmpvar_312; - tmpvar_312 = (!(doneN_69) || !(doneP_68)); - doneNP_67 = tmpvar_312; - if (!(doneP_68)) { - highp float tmpvar_313; - tmpvar_313 = (posP_78.x + (offNP_80.x * 1.0)); - posP_78.x = tmpvar_313; - }; - if (!(doneP_68)) { - highp float tmpvar_314; - tmpvar_314 = (posP_78.y + (offNP_80.y * 1.0)); - posP_78.y = vec2(tmpvar_314).y; - }; - if (doneNP_67) { - if (!(doneN_69)) { - highp vec4 tmpvar_315; - tmpvar_315.zw = vec2(0.0, 0.0); - tmpvar_315.xy = posN_79.xy.xy; - mediump vec4 tmpvar_316; - tmpvar_316 = xll_tex2Dlod (tex_39, tmpvar_315); - highp float tmpvar_317; - tmpvar_317 = FxaaLuma (tmpvar_316); - highp float tmpvar_318; - tmpvar_318 = tmpvar_317; - lumaEndN_76 = tmpvar_318; - }; - if (!(doneP_68)) { - highp vec4 tmpvar_319; - tmpvar_319.zw = vec2(0.0, 0.0); - tmpvar_319.xy = posP_78.xy.xy; - mediump vec4 tmpvar_320; - tmpvar_320 = xll_tex2Dlod (tex_39, tmpvar_319); - highp float tmpvar_321; - tmpvar_321 = FxaaLuma (tmpvar_320); - highp float tmpvar_322; - tmpvar_322 = tmpvar_321; - lumaEndP_74 = tmpvar_322; - }; - if (!(doneN_69)) { - highp float tmpvar_323; - tmpvar_323 = (lumaEndN_76 - (lumaNN_86 * 0.5)); - lumaEndN_76 = tmpvar_323; - }; - if (!(doneP_68)) { - highp float tmpvar_324; - tmpvar_324 = (lumaEndP_74 - (lumaNN_86 * 0.5)); - lumaEndP_74 = tmpvar_324; - }; - highp float tmpvar_325; - tmpvar_325 = abs (lumaEndN_76); - bool tmpvar_326; - tmpvar_326 = (tmpvar_325 >= gradientScaled_73); - doneN_69 = tmpvar_326; - highp float tmpvar_327; - tmpvar_327 = abs (lumaEndP_74); - bool tmpvar_328; - tmpvar_328 = (tmpvar_327 >= gradientScaled_73); - doneP_68 = tmpvar_328; - if (!(doneN_69)) { - highp float tmpvar_329; - tmpvar_329 = (posN_79.x - (offNP_80.x * 1.0)); - posN_79.x = tmpvar_329; - }; - if (!(doneN_69)) { - highp float tmpvar_330; - tmpvar_330 = (posN_79.y - (offNP_80.y * 1.0)); - posN_79.y = vec2(tmpvar_330).y; - }; - bool tmpvar_331; - tmpvar_331 = (!(doneN_69) || !(doneP_68)); - doneNP_67 = tmpvar_331; - if (!(doneP_68)) { - highp float tmpvar_332; - tmpvar_332 = (posP_78.x + (offNP_80.x * 1.0)); - posP_78.x = tmpvar_332; - }; - if (!(doneP_68)) { - highp float tmpvar_333; - tmpvar_333 = (posP_78.y + (offNP_80.y * 1.0)); - posP_78.y = vec2(tmpvar_333).y; - }; - if (doneNP_67) { - if (!(doneN_69)) { - highp vec4 tmpvar_334; - tmpvar_334.zw = vec2(0.0, 0.0); - tmpvar_334.xy = posN_79.xy.xy; - mediump vec4 tmpvar_335; - tmpvar_335 = xll_tex2Dlod (tex_39, tmpvar_334); - highp float tmpvar_336; - tmpvar_336 = FxaaLuma (tmpvar_335); - highp float tmpvar_337; - tmpvar_337 = tmpvar_336; - lumaEndN_76 = tmpvar_337; - }; - if (!(doneP_68)) { - highp vec4 tmpvar_338; - tmpvar_338.zw = vec2(0.0, 0.0); - tmpvar_338.xy = posP_78.xy.xy; - mediump vec4 tmpvar_339; - tmpvar_339 = xll_tex2Dlod (tex_39, tmpvar_338); - highp float tmpvar_340; - tmpvar_340 = FxaaLuma (tmpvar_339); - highp float tmpvar_341; - tmpvar_341 = tmpvar_340; - lumaEndP_74 = tmpvar_341; - }; - if (!(doneN_69)) { - highp float tmpvar_342; - tmpvar_342 = (lumaEndN_76 - (lumaNN_86 * 0.5)); - lumaEndN_76 = tmpvar_342; - }; - if (!(doneP_68)) { - highp float tmpvar_343; - tmpvar_343 = (lumaEndP_74 - (lumaNN_86 * 0.5)); - lumaEndP_74 = tmpvar_343; - }; - highp float tmpvar_344; - tmpvar_344 = abs (lumaEndN_76); - bool tmpvar_345; - tmpvar_345 = (tmpvar_344 >= gradientScaled_73); - doneN_69 = tmpvar_345; - highp float tmpvar_346; - tmpvar_346 = abs (lumaEndP_74); - bool tmpvar_347; - tmpvar_347 = (tmpvar_346 >= gradientScaled_73); - doneP_68 = tmpvar_347; - if (!(doneN_69)) { - highp float tmpvar_348; - tmpvar_348 = (posN_79.x - (offNP_80.x * 1.5)); - posN_79.x = tmpvar_348; - }; - if (!(doneN_69)) { - highp float tmpvar_349; - tmpvar_349 = (posN_79.y - (offNP_80.y * 1.5)); - posN_79.y = vec2(tmpvar_349).y; - }; - bool tmpvar_350; - tmpvar_350 = (!(doneN_69) || !(doneP_68)); - doneNP_67 = tmpvar_350; - if (!(doneP_68)) { - highp float tmpvar_351; - tmpvar_351 = (posP_78.x + (offNP_80.x * 1.5)); - posP_78.x = tmpvar_351; - }; - if (!(doneP_68)) { - highp float tmpvar_352; - tmpvar_352 = (posP_78.y + (offNP_80.y * 1.5)); - posP_78.y = vec2(tmpvar_352).y; - }; - if (doneNP_67) { - if (!(doneN_69)) { - highp vec4 tmpvar_353; - tmpvar_353.zw = vec2(0.0, 0.0); - tmpvar_353.xy = posN_79.xy.xy; - mediump vec4 tmpvar_354; - tmpvar_354 = xll_tex2Dlod (tex_39, tmpvar_353); - highp float tmpvar_355; - tmpvar_355 = FxaaLuma (tmpvar_354); - highp float tmpvar_356; - tmpvar_356 = tmpvar_355; - lumaEndN_76 = tmpvar_356; - }; - if (!(doneP_68)) { - highp vec4 tmpvar_357; - tmpvar_357.zw = vec2(0.0, 0.0); - tmpvar_357.xy = posP_78.xy.xy; - mediump vec4 tmpvar_358; - tmpvar_358 = xll_tex2Dlod (tex_39, tmpvar_357); - highp float tmpvar_359; - tmpvar_359 = FxaaLuma (tmpvar_358); - highp float tmpvar_360; - tmpvar_360 = tmpvar_359; - lumaEndP_74 = tmpvar_360; - }; - if (!(doneN_69)) { - highp float tmpvar_361; - tmpvar_361 = (lumaEndN_76 - (lumaNN_86 * 0.5)); - lumaEndN_76 = tmpvar_361; - }; - if (!(doneP_68)) { - highp float tmpvar_362; - tmpvar_362 = (lumaEndP_74 - (lumaNN_86 * 0.5)); - lumaEndP_74 = tmpvar_362; - }; - highp float tmpvar_363; - tmpvar_363 = abs (lumaEndN_76); - bool tmpvar_364; - tmpvar_364 = (tmpvar_363 >= gradientScaled_73); - doneN_69 = tmpvar_364; - highp float tmpvar_365; - tmpvar_365 = abs (lumaEndP_74); - bool tmpvar_366; - tmpvar_366 = (tmpvar_365 >= gradientScaled_73); - doneP_68 = tmpvar_366; - if (!(doneN_69)) { - highp float tmpvar_367; - tmpvar_367 = (posN_79.x - (offNP_80.x * 2.0)); - posN_79.x = tmpvar_367; - }; - if (!(doneN_69)) { - highp float tmpvar_368; - tmpvar_368 = (posN_79.y - (offNP_80.y * 2.0)); - posN_79.y = vec2(tmpvar_368).y; - }; - bool tmpvar_369; - tmpvar_369 = (!(doneN_69) || !(doneP_68)); - doneNP_67 = tmpvar_369; - if (!(doneP_68)) { - highp float tmpvar_370; - tmpvar_370 = (posP_78.x + (offNP_80.x * 2.0)); - posP_78.x = tmpvar_370; - }; - if (!(doneP_68)) { - highp float tmpvar_371; - tmpvar_371 = (posP_78.y + (offNP_80.y * 2.0)); - posP_78.y = vec2(tmpvar_371).y; - }; - if (doneNP_67) { - if (!(doneN_69)) { - highp vec4 tmpvar_372; - tmpvar_372.zw = vec2(0.0, 0.0); - tmpvar_372.xy = posN_79.xy.xy; - mediump vec4 tmpvar_373; - tmpvar_373 = xll_tex2Dlod (tex_39, tmpvar_372); - highp float tmpvar_374; - tmpvar_374 = FxaaLuma (tmpvar_373); - highp float tmpvar_375; - tmpvar_375 = tmpvar_374; - lumaEndN_76 = tmpvar_375; - }; - if (!(doneP_68)) { - highp vec4 tmpvar_376; - tmpvar_376.zw = vec2(0.0, 0.0); - tmpvar_376.xy = posP_78.xy.xy; - mediump vec4 tmpvar_377; - tmpvar_377 = xll_tex2Dlod (tex_39, tmpvar_376); - highp float tmpvar_378; - tmpvar_378 = FxaaLuma (tmpvar_377); - highp float tmpvar_379; - tmpvar_379 = tmpvar_378; - lumaEndP_74 = tmpvar_379; - }; - if (!(doneN_69)) { - highp float tmpvar_380; - tmpvar_380 = (lumaEndN_76 - (lumaNN_86 * 0.5)); - lumaEndN_76 = tmpvar_380; - }; - if (!(doneP_68)) { - highp float tmpvar_381; - tmpvar_381 = (lumaEndP_74 - (lumaNN_86 * 0.5)); - lumaEndP_74 = tmpvar_381; - }; - highp float tmpvar_382; - tmpvar_382 = abs (lumaEndN_76); - bool tmpvar_383; - tmpvar_383 = (tmpvar_382 >= gradientScaled_73); - doneN_69 = tmpvar_383; - highp float tmpvar_384; - tmpvar_384 = abs (lumaEndP_74); - bool tmpvar_385; - tmpvar_385 = (tmpvar_384 >= gradientScaled_73); - doneP_68 = tmpvar_385; - if (!(doneN_69)) { - highp float tmpvar_386; - tmpvar_386 = (posN_79.x - (offNP_80.x * 2.0)); - posN_79.x = tmpvar_386; - }; - if (!(doneN_69)) { - highp float tmpvar_387; - tmpvar_387 = (posN_79.y - (offNP_80.y * 2.0)); - posN_79.y = vec2(tmpvar_387).y; - }; - bool tmpvar_388; - tmpvar_388 = (!(doneN_69) || !(doneP_68)); - doneNP_67 = tmpvar_388; - if (!(doneP_68)) { - highp float tmpvar_389; - tmpvar_389 = (posP_78.x + (offNP_80.x * 2.0)); - posP_78.x = tmpvar_389; - }; - if (!(doneP_68)) { - highp float tmpvar_390; - tmpvar_390 = (posP_78.y + (offNP_80.y * 2.0)); - posP_78.y = vec2(tmpvar_390).y; - }; - if (doneNP_67) { - if (!(doneN_69)) { - highp vec4 tmpvar_391; - tmpvar_391.zw = vec2(0.0, 0.0); - tmpvar_391.xy = posN_79.xy.xy; - mediump vec4 tmpvar_392; - tmpvar_392 = xll_tex2Dlod (tex_39, tmpvar_391); - highp float tmpvar_393; - tmpvar_393 = FxaaLuma (tmpvar_392); - highp float tmpvar_394; - tmpvar_394 = tmpvar_393; - lumaEndN_76 = tmpvar_394; - }; - if (!(doneP_68)) { - highp vec4 tmpvar_395; - tmpvar_395.zw = vec2(0.0, 0.0); - tmpvar_395.xy = posP_78.xy.xy; - mediump vec4 tmpvar_396; - tmpvar_396 = xll_tex2Dlod (tex_39, tmpvar_395); - highp float tmpvar_397; - tmpvar_397 = FxaaLuma (tmpvar_396); - highp float tmpvar_398; - tmpvar_398 = tmpvar_397; - lumaEndP_74 = tmpvar_398; - }; - if (!(doneN_69)) { - highp float tmpvar_399; - tmpvar_399 = (lumaEndN_76 - (lumaNN_86 * 0.5)); - lumaEndN_76 = tmpvar_399; - }; - if (!(doneP_68)) { - highp float tmpvar_400; - tmpvar_400 = (lumaEndP_74 - (lumaNN_86 * 0.5)); - lumaEndP_74 = tmpvar_400; - }; - highp float tmpvar_401; - tmpvar_401 = abs (lumaEndN_76); - bool tmpvar_402; - tmpvar_402 = (tmpvar_401 >= gradientScaled_73); - doneN_69 = tmpvar_402; - highp float tmpvar_403; - tmpvar_403 = abs (lumaEndP_74); - bool tmpvar_404; - tmpvar_404 = (tmpvar_403 >= gradientScaled_73); - doneP_68 = tmpvar_404; - if (!(doneN_69)) { - highp float tmpvar_405; - tmpvar_405 = (posN_79.x - (offNP_80.x * 2.0)); - posN_79.x = tmpvar_405; - }; - if (!(doneN_69)) { - highp float tmpvar_406; - tmpvar_406 = (posN_79.y - (offNP_80.y * 2.0)); - posN_79.y = vec2(tmpvar_406).y; - }; - bool tmpvar_407; - tmpvar_407 = (!(doneN_69) || !(doneP_68)); - doneNP_67 = tmpvar_407; - if (!(doneP_68)) { - highp float tmpvar_408; - tmpvar_408 = (posP_78.x + (offNP_80.x * 2.0)); - posP_78.x = tmpvar_408; - }; - if (!(doneP_68)) { - highp float tmpvar_409; - tmpvar_409 = (posP_78.y + (offNP_80.y * 2.0)); - posP_78.y = vec2(tmpvar_409).y; - }; - if (doneNP_67) { - if (!(doneN_69)) { - highp vec4 tmpvar_410; - tmpvar_410.zw = vec2(0.0, 0.0); - tmpvar_410.xy = posN_79.xy.xy; - mediump vec4 tmpvar_411; - tmpvar_411 = xll_tex2Dlod (tex_39, tmpvar_410); - highp float tmpvar_412; - tmpvar_412 = FxaaLuma (tmpvar_411); - highp float tmpvar_413; - tmpvar_413 = tmpvar_412; - lumaEndN_76 = tmpvar_413; - }; - if (!(doneP_68)) { - highp vec4 tmpvar_414; - tmpvar_414.zw = vec2(0.0, 0.0); - tmpvar_414.xy = posP_78.xy.xy; - mediump vec4 tmpvar_415; - tmpvar_415 = xll_tex2Dlod (tex_39, tmpvar_414); - highp float tmpvar_416; - tmpvar_416 = FxaaLuma (tmpvar_415); - highp float tmpvar_417; - tmpvar_417 = tmpvar_416; - lumaEndP_74 = tmpvar_417; - }; - if (!(doneN_69)) { - highp float tmpvar_418; - tmpvar_418 = (lumaEndN_76 - (lumaNN_86 * 0.5)); - lumaEndN_76 = tmpvar_418; - }; - if (!(doneP_68)) { - highp float tmpvar_419; - tmpvar_419 = (lumaEndP_74 - (lumaNN_86 * 0.5)); - lumaEndP_74 = tmpvar_419; - }; - highp float tmpvar_420; - tmpvar_420 = abs (lumaEndN_76); - bool tmpvar_421; - tmpvar_421 = (tmpvar_420 >= gradientScaled_73); - doneN_69 = tmpvar_421; - highp float tmpvar_422; - tmpvar_422 = abs (lumaEndP_74); - bool tmpvar_423; - tmpvar_423 = (tmpvar_422 >= gradientScaled_73); - doneP_68 = tmpvar_423; - if (!(doneN_69)) { - highp float tmpvar_424; - tmpvar_424 = (posN_79.x - (offNP_80.x * 2.0)); - posN_79.x = tmpvar_424; - }; - if (!(doneN_69)) { - highp float tmpvar_425; - tmpvar_425 = (posN_79.y - (offNP_80.y * 2.0)); - posN_79.y = vec2(tmpvar_425).y; - }; - bool tmpvar_426; - tmpvar_426 = (!(doneN_69) || !(doneP_68)); - doneNP_67 = tmpvar_426; - if (!(doneP_68)) { - highp float tmpvar_427; - tmpvar_427 = (posP_78.x + (offNP_80.x * 2.0)); - posP_78.x = tmpvar_427; - }; - if (!(doneP_68)) { - highp float tmpvar_428; - tmpvar_428 = (posP_78.y + (offNP_80.y * 2.0)); - posP_78.y = vec2(tmpvar_428).y; - }; - if (doneNP_67) { - if (!(doneN_69)) { - highp vec4 tmpvar_429; - tmpvar_429.zw = vec2(0.0, 0.0); - tmpvar_429.xy = posN_79.xy.xy; - mediump vec4 tmpvar_430; - tmpvar_430 = xll_tex2Dlod (tex_39, tmpvar_429); - highp float tmpvar_431; - tmpvar_431 = FxaaLuma (tmpvar_430); - highp float tmpvar_432; - tmpvar_432 = tmpvar_431; - lumaEndN_76 = tmpvar_432; - }; - if (!(doneP_68)) { - highp vec4 tmpvar_433; - tmpvar_433.zw = vec2(0.0, 0.0); - tmpvar_433.xy = posP_78.xy.xy; - mediump vec4 tmpvar_434; - tmpvar_434 = xll_tex2Dlod (tex_39, tmpvar_433); - highp float tmpvar_435; - tmpvar_435 = FxaaLuma (tmpvar_434); - highp float tmpvar_436; - tmpvar_436 = tmpvar_435; - lumaEndP_74 = tmpvar_436; - }; - if (!(doneN_69)) { - highp float tmpvar_437; - tmpvar_437 = (lumaEndN_76 - (lumaNN_86 * 0.5)); - lumaEndN_76 = tmpvar_437; - }; - if (!(doneP_68)) { - highp float tmpvar_438; - tmpvar_438 = (lumaEndP_74 - (lumaNN_86 * 0.5)); - lumaEndP_74 = tmpvar_438; - }; - highp float tmpvar_439; - tmpvar_439 = abs (lumaEndN_76); - bool tmpvar_440; - tmpvar_440 = (tmpvar_439 >= gradientScaled_73); - doneN_69 = tmpvar_440; - highp float tmpvar_441; - tmpvar_441 = abs (lumaEndP_74); - bool tmpvar_442; - tmpvar_442 = (tmpvar_441 >= gradientScaled_73); - doneP_68 = tmpvar_442; - if (!(doneN_69)) { - highp float tmpvar_443; - tmpvar_443 = (posN_79.x - (offNP_80.x * 4.0)); - posN_79.x = tmpvar_443; - }; - if (!(doneN_69)) { - highp float tmpvar_444; - tmpvar_444 = (posN_79.y - (offNP_80.y * 4.0)); - posN_79.y = vec2(tmpvar_444).y; - }; - bool tmpvar_445; - tmpvar_445 = (!(doneN_69) || !(doneP_68)); - doneNP_67 = tmpvar_445; - if (!(doneP_68)) { - highp float tmpvar_446; - tmpvar_446 = (posP_78.x + (offNP_80.x * 4.0)); - posP_78.x = tmpvar_446; - }; - if (!(doneP_68)) { - highp float tmpvar_447; - tmpvar_447 = (posP_78.y + (offNP_80.y * 4.0)); - posP_78.y = vec2(tmpvar_447).y; - }; - if (doneNP_67) { - if (!(doneN_69)) { - highp vec4 tmpvar_448; - tmpvar_448.zw = vec2(0.0, 0.0); - tmpvar_448.xy = posN_79.xy.xy; - mediump vec4 tmpvar_449; - tmpvar_449 = xll_tex2Dlod (tex_39, tmpvar_448); - highp float tmpvar_450; - tmpvar_450 = FxaaLuma (tmpvar_449); - highp float tmpvar_451; - tmpvar_451 = tmpvar_450; - lumaEndN_76 = tmpvar_451; - }; - if (!(doneP_68)) { - highp vec4 tmpvar_452; - tmpvar_452.zw = vec2(0.0, 0.0); - tmpvar_452.xy = posP_78.xy.xy; - mediump vec4 tmpvar_453; - tmpvar_453 = xll_tex2Dlod (tex_39, tmpvar_452); - highp float tmpvar_454; - tmpvar_454 = FxaaLuma (tmpvar_453); - highp float tmpvar_455; - tmpvar_455 = tmpvar_454; - lumaEndP_74 = tmpvar_455; - }; - if (!(doneN_69)) { - highp float tmpvar_456; - tmpvar_456 = (lumaEndN_76 - (lumaNN_86 * 0.5)); - lumaEndN_76 = tmpvar_456; - }; - if (!(doneP_68)) { - highp float tmpvar_457; - tmpvar_457 = (lumaEndP_74 - (lumaNN_86 * 0.5)); - lumaEndP_74 = tmpvar_457; - }; - highp float tmpvar_458; - tmpvar_458 = abs (lumaEndN_76); - bool tmpvar_459; - tmpvar_459 = (tmpvar_458 >= gradientScaled_73); - doneN_69 = tmpvar_459; - highp float tmpvar_460; - tmpvar_460 = abs (lumaEndP_74); - bool tmpvar_461; - tmpvar_461 = (tmpvar_460 >= gradientScaled_73); - doneP_68 = tmpvar_461; - if (!(doneN_69)) { - highp float tmpvar_462; - tmpvar_462 = (posN_79.x - (offNP_80.x * 8.0)); - posN_79.x = tmpvar_462; - }; - if (!(doneN_69)) { - highp float tmpvar_463; - tmpvar_463 = (posN_79.y - (offNP_80.y * 8.0)); - posN_79.y = vec2(tmpvar_463).y; - }; - bool tmpvar_464; - tmpvar_464 = (!(doneN_69) || !(doneP_68)); - doneNP_67 = tmpvar_464; - if (!(doneP_68)) { - highp float tmpvar_465; - tmpvar_465 = (posP_78.x + (offNP_80.x * 8.0)); - posP_78.x = tmpvar_465; - }; - if (!(doneP_68)) { - highp float tmpvar_466; - tmpvar_466 = (posP_78.y + (offNP_80.y * 8.0)); - posP_78.y = vec2(tmpvar_466).y; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - highp float tmpvar_467; - tmpvar_467 = (posM_133.x - posN_79.x); - dstN_66 = tmpvar_467; - highp float tmpvar_468; - tmpvar_468 = (posP_78.x - posM_133.x); - dstP_65 = tmpvar_468; - if (!(horzSpan_91)) { - highp float tmpvar_469; - tmpvar_469 = (posM_133.y - posN_79.y); - dstN_66 = tmpvar_469; - }; - if (!(horzSpan_91)) { - highp float tmpvar_470; - tmpvar_470 = (posP_78.y - posM_133.y); - dstP_65 = tmpvar_470; - }; - bool tmpvar_471; - tmpvar_471 = ((lumaEndN_76 < 0.0) != lumaMLTZero_70); - goodSpanN_64 = tmpvar_471; - highp float tmpvar_472; - tmpvar_472 = (dstP_65 + dstN_66); - spanLength_63 = tmpvar_472; - bool tmpvar_473; - tmpvar_473 = ((lumaEndP_74 < 0.0) != lumaMLTZero_70); - goodSpanP_62 = tmpvar_473; - highp float tmpvar_474; - tmpvar_474 = (1.0 / spanLength_63); - spanLengthRcp_61 = tmpvar_474; - bool tmpvar_475; - tmpvar_475 = (dstN_66 < dstP_65); - directionN_60 = tmpvar_475; - highp float tmpvar_476; - tmpvar_476 = min (dstN_66, dstP_65); - highp float tmpvar_477; - tmpvar_477 = tmpvar_476; - dst_59 = tmpvar_477; - bool tmpvar_478; - if (directionN_60) { - tmpvar_478 = goodSpanN_64; - } else { - tmpvar_478 = goodSpanP_62; - }; - bool tmpvar_479; - tmpvar_479 = tmpvar_478; - goodSpan_58 = tmpvar_479; - highp float tmpvar_480; - tmpvar_480 = (subpixF_71 * subpixF_71); - subpixG_57 = tmpvar_480; - highp float tmpvar_481; - tmpvar_481 = ((dst_59 * -(spanLengthRcp_61)) + 0.5); - pixelOffset_56 = tmpvar_481; - highp float tmpvar_482; - tmpvar_482 = (subpixG_57 * fxaaQualitySubpix_46); - subpixH_55 = tmpvar_482; - highp float tmpvar_483; - if (goodSpan_58) { - tmpvar_483 = pixelOffset_56; - } else { - tmpvar_483 = 0.0; - }; - highp float tmpvar_484; - tmpvar_484 = tmpvar_483; - pixelOffsetGood_54 = tmpvar_484; - highp float tmpvar_485; - tmpvar_485 = max (pixelOffsetGood_54, subpixH_55); - highp float tmpvar_486; - tmpvar_486 = tmpvar_485; - pixelOffsetSubpix_53 = tmpvar_486; - if (!(horzSpan_91)) { - highp float tmpvar_487; - tmpvar_487 = (posM_133.x + (pixelOffsetSubpix_53 * lengthSign_92)); - posM_133.x = tmpvar_487; - }; - if (horzSpan_91) { - highp float tmpvar_488; - tmpvar_488 = (posM_133.y + (pixelOffsetSubpix_53 * lengthSign_92)); - posM_133.y = vec2(tmpvar_488).y; - }; - highp vec4 tmpvar_489; - tmpvar_489.zw = vec2(0.0, 0.0); - tmpvar_489.xy = posM_133.xy; - mediump vec4 tmpvar_490; - tmpvar_490 = xll_tex2Dlod (tex_39, tmpvar_489); - highp vec4 tmpvar_491; - tmpvar_491.xyz = tmpvar_490.xyz.xyz; - tmpvar_491.w = rgbyM_132.w; - return tmpvar_491; -} - -vec4 xlat_main ( - in v2f i_492 -) -{ - highp float fxaaN_493; - mediump float tmpvar_494; - tmpvar_494 = 0.5; - fxaaN_493 = tmpvar_494; - highp vec4 tmpvar_495; - tmpvar_495.x = -(fxaaN_493); - tmpvar_495.y = -(fxaaN_493); - tmpvar_495.z = fxaaN_493; - tmpvar_495.w = fxaaN_493; - highp vec4 tmpvar_496; - tmpvar_496 = FxaaPixelShader (i_492.uv, i_492.uvPosPos, _MainTex, _MainTex, _MainTex, _MainTex_TexelSize.xy, (_MainTex_TexelSize.xyxy * tmpvar_495), (_MainTex_TexelSize.xyxy * vec4(-2.0, -2.0, 2.0, 2.0)), (_MainTex_TexelSize.xyxy * vec4(8.0, 8.0, -4.0, -4.0)), 0.75, 0.166, 0.0833, 8.0, 0.125, 0.05, vec4(1.0, -1.0, 0.25, -0.25)); - return tmpvar_496; -} - -void main () -{ - v2f xlt_i_497; - highp vec4 xl_retval_498; - highp vec4 tmpvar_499; - tmpvar_499 = xlv_SV_POSITION.xyzw; - highp vec4 tmpvar_500; - tmpvar_500 = tmpvar_499; - xlt_i_497.pos = tmpvar_500; - highp vec2 tmpvar_501; - tmpvar_501 = xlv_TEXCOORD0.xy; - highp vec2 tmpvar_502; - tmpvar_502 = tmpvar_501; - xlt_i_497.uv = tmpvar_502; - highp vec4 tmpvar_503; - tmpvar_503 = xlv_TEXCOORD1.xyzw; - highp vec4 tmpvar_504; - tmpvar_504 = tmpvar_503; - xlt_i_497.uvPosPos = tmpvar_504; - highp vec4 tmpvar_505; - tmpvar_505 = xlat_main (xlt_i_497); - highp vec4 tmpvar_506; - tmpvar_506 = tmpvar_505; - xl_retval_498 = tmpvar_506; - highp vec4 tmpvar_507; - tmpvar_507 = xl_retval_498.xyzw; - highp vec4 tmpvar_508; - tmpvar_508 = tmpvar_507; - gl_FragData[0] = tmpvar_508; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-out.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-out.txt index c7156f18a..a962de142 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-out.txt @@ -7,561 +7,535 @@ void main () vec2 fxaaQualityRcpFrame_1; fxaaQualityRcpFrame_1 = _MainTex_TexelSize.xy; vec4 tmpvar_2; - float dstP_3; - float dstN_4; - float lumaEndP_5; - float lumaEndN_6; - vec2 posP_7; - vec2 posN_8; - vec2 posB_9; - float lumaNN_10; - float lengthSign_11; - float lumaN_12; - float lumaS_13; - vec2 posM_14; - posM_14 = xlv_TEXCOORD0; - vec4 tmpvar_15; - tmpvar_15 = texture2DLod (_MainTex, xlv_TEXCOORD0, 0.0); - vec4 tmpvar_16; - tmpvar_16.zw = vec2(0.0, 0.0); - tmpvar_16.xy = (xlv_TEXCOORD0 + (vec2(0.0, 1.0) * _MainTex_TexelSize.xy)); - vec4 tmpvar_17; - tmpvar_17 = texture2DLod (_MainTex, tmpvar_16.xy, 0.0); - lumaS_13 = tmpvar_17.w; - vec4 tmpvar_18; - tmpvar_18.zw = vec2(0.0, 0.0); - tmpvar_18.xy = (xlv_TEXCOORD0 + (vec2(1.0, 0.0) * _MainTex_TexelSize.xy)); - vec4 tmpvar_19; - tmpvar_19 = texture2DLod (_MainTex, tmpvar_18.xy, 0.0); - float tmpvar_20; - tmpvar_20 = tmpvar_19.w; - vec4 tmpvar_21; - tmpvar_21.zw = vec2(0.0, 0.0); - tmpvar_21.xy = (xlv_TEXCOORD0 + (vec2(0.0, -1.0) * _MainTex_TexelSize.xy)); - vec4 tmpvar_22; - tmpvar_22 = texture2DLod (_MainTex, tmpvar_21.xy, 0.0); - lumaN_12 = tmpvar_22.w; - vec4 tmpvar_23; - tmpvar_23.zw = vec2(0.0, 0.0); - tmpvar_23.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 0.0) * _MainTex_TexelSize.xy)); - vec4 tmpvar_24; - tmpvar_24 = texture2DLod (_MainTex, tmpvar_23.xy, 0.0); - float tmpvar_25; - tmpvar_25 = tmpvar_24.w; - float tmpvar_26; - tmpvar_26 = max (max (tmpvar_22.w, tmpvar_24.w), max (tmpvar_19.w, max (tmpvar_17.w, tmpvar_15.w))); - float tmpvar_27; - tmpvar_27 = (tmpvar_26 - min (min (tmpvar_22.w, tmpvar_24.w), min (tmpvar_19.w, - min (tmpvar_17.w, tmpvar_15.w) - ))); - if ((tmpvar_27 < max (0.0833, (tmpvar_26 * 0.166)))) { - tmpvar_2 = tmpvar_15; + float subpixH_3; + float pixelOffset_4; + float spanLengthRcp_5; + bool goodSpanP_6; + bool goodSpanN_7; + float dstP_8; + float dstN_9; + bool doneNP_10; + bool doneP_11; + bool doneN_12; + bool lumaMLTZero_13; + float subpixF_14; + float gradientScaled_15; + float lumaEndP_16; + float subpixE_17; + float lumaEndN_18; + float subpixD_19; + vec2 posP_20; + vec2 posN_21; + vec2 posB_22; + bool pairN_23; + float lumaSS_24; + float lumaNN_25; + float gradientS_26; + float gradientN_27; + float subpixB_28; + float subpixA_29; + bool horzSpan_30; + float lengthSign_31; + float lumaNWSW_32; + float lumaNESE_33; + float subpixRcpRange_34; + float lumaWE_35; + float lumaNS_36; + float range_37; + float lumaN_38; + float lumaS_39; + vec2 posM_40; + posM_40 = xlv_TEXCOORD0; + vec4 tmpvar_41; + tmpvar_41 = texture2DLod (_MainTex, xlv_TEXCOORD0, 0.0); + vec4 tmpvar_42; + tmpvar_42.zw = vec2(0.0, 0.0); + tmpvar_42.xy = (xlv_TEXCOORD0 + (vec2(0.0, 1.0) * _MainTex_TexelSize.xy)); + vec4 tmpvar_43; + tmpvar_43 = texture2DLod (_MainTex, tmpvar_42.xy, 0.0); + lumaS_39 = tmpvar_43.w; + vec4 tmpvar_44; + tmpvar_44.zw = vec2(0.0, 0.0); + tmpvar_44.xy = (xlv_TEXCOORD0 + (vec2(1.0, 0.0) * _MainTex_TexelSize.xy)); + vec4 tmpvar_45; + tmpvar_45 = texture2DLod (_MainTex, tmpvar_44.xy, 0.0); + float tmpvar_46; + tmpvar_46 = tmpvar_45.w; + vec4 tmpvar_47; + tmpvar_47.zw = vec2(0.0, 0.0); + tmpvar_47.xy = (xlv_TEXCOORD0 + (vec2(0.0, -1.0) * _MainTex_TexelSize.xy)); + vec4 tmpvar_48; + tmpvar_48 = texture2DLod (_MainTex, tmpvar_47.xy, 0.0); + lumaN_38 = tmpvar_48.w; + vec4 tmpvar_49; + tmpvar_49.zw = vec2(0.0, 0.0); + tmpvar_49.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 0.0) * _MainTex_TexelSize.xy)); + vec4 tmpvar_50; + tmpvar_50 = texture2DLod (_MainTex, tmpvar_49.xy, 0.0); + float tmpvar_51; + tmpvar_51 = tmpvar_50.w; + float tmpvar_52; + tmpvar_52 = max (max (tmpvar_48.w, tmpvar_50.w), max (max (tmpvar_45.w, tmpvar_43.w), tmpvar_41.w)); + range_37 = (tmpvar_52 - min (min (tmpvar_48.w, tmpvar_50.w), min ( + min (tmpvar_45.w, tmpvar_43.w) + , tmpvar_41.w))); + if ((range_37 < max (0.0833, (tmpvar_52 * 0.166)))) { + tmpvar_2 = tmpvar_41; } else { - vec4 tmpvar_28; - tmpvar_28.zw = vec2(0.0, 0.0); - tmpvar_28.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy); - vec4 tmpvar_29; - tmpvar_29 = texture2DLod (_MainTex, tmpvar_28.xy, 0.0); - vec4 tmpvar_30; - tmpvar_30.zw = vec2(0.0, 0.0); - tmpvar_30.xy = (xlv_TEXCOORD0 + _MainTex_TexelSize.xy); - vec4 tmpvar_31; - tmpvar_31 = texture2DLod (_MainTex, tmpvar_30.xy, 0.0); - vec4 tmpvar_32; - tmpvar_32.zw = vec2(0.0, 0.0); - tmpvar_32.xy = (xlv_TEXCOORD0 + (vec2(1.0, -1.0) * _MainTex_TexelSize.xy)); - vec4 tmpvar_33; - tmpvar_33 = texture2DLod (_MainTex, tmpvar_32.xy, 0.0); - vec4 tmpvar_34; - tmpvar_34.zw = vec2(0.0, 0.0); - tmpvar_34.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 1.0) * _MainTex_TexelSize.xy)); - vec4 tmpvar_35; - tmpvar_35 = texture2DLod (_MainTex, tmpvar_34.xy, 0.0); - float tmpvar_36; - tmpvar_36 = (tmpvar_22.w + tmpvar_17.w); - float tmpvar_37; - tmpvar_37 = (tmpvar_24.w + tmpvar_19.w); - float tmpvar_38; - tmpvar_38 = (1.0/(tmpvar_27)); - float tmpvar_39; - tmpvar_39 = (tmpvar_33.w + tmpvar_31.w); - float tmpvar_40; - tmpvar_40 = (tmpvar_29.w + tmpvar_35.w); - lengthSign_11 = fxaaQualityRcpFrame_1.x; - bool tmpvar_41; - tmpvar_41 = ((abs( - ((-2.0 * tmpvar_24.w) + tmpvar_40) - ) + ( - (abs(((-2.0 * tmpvar_15.w) + tmpvar_36)) * 2.0) - + - abs(((-2.0 * tmpvar_19.w) + tmpvar_39)) - )) >= (abs( - ((-2.0 * tmpvar_17.w) + (tmpvar_35.w + tmpvar_31.w)) - ) + ( - (abs(((-2.0 * tmpvar_15.w) + tmpvar_37)) * 2.0) - + - abs(((-2.0 * tmpvar_22.w) + (tmpvar_29.w + tmpvar_33.w))) - ))); - float tmpvar_42; - tmpvar_42 = (((tmpvar_36 + tmpvar_37) * 2.0) + (tmpvar_40 + tmpvar_39)); - if (!(tmpvar_41)) { - lumaN_12 = tmpvar_25; - }; - if (!(tmpvar_41)) { - lumaS_13 = tmpvar_20; - }; - if (tmpvar_41) { - lengthSign_11 = fxaaQualityRcpFrame_1.y; - }; - float tmpvar_43; - tmpvar_43 = ((tmpvar_42 * 0.0833333) - tmpvar_15.w); - float tmpvar_44; - tmpvar_44 = (lumaN_12 - tmpvar_15.w); - float tmpvar_45; - tmpvar_45 = (lumaS_13 - tmpvar_15.w); - lumaNN_10 = (lumaN_12 + tmpvar_15.w); - float tmpvar_46; - tmpvar_46 = (lumaS_13 + tmpvar_15.w); - bool tmpvar_47; - tmpvar_47 = (abs(tmpvar_44) >= abs(tmpvar_45)); - float tmpvar_48; - tmpvar_48 = max (abs(tmpvar_44), abs(tmpvar_45)); - if (tmpvar_47) { - lengthSign_11 = -(lengthSign_11); - }; - float tmpvar_49; - tmpvar_49 = clamp ((abs(tmpvar_43) * tmpvar_38), 0.0, 1.0); - posB_9 = xlv_TEXCOORD0; - float tmpvar_50; - if (!(tmpvar_41)) { - tmpvar_50 = 0.0; - } else { - tmpvar_50 = fxaaQualityRcpFrame_1.x; - }; - float tmpvar_51; - if (tmpvar_41) { - tmpvar_51 = 0.0; - } else { - tmpvar_51 = fxaaQualityRcpFrame_1.y; - }; - if (!(tmpvar_41)) { - posB_9.x = (xlv_TEXCOORD0.x + (lengthSign_11 * 0.5)); - }; - if (tmpvar_41) { - posB_9.y = (xlv_TEXCOORD0.y + (lengthSign_11 * 0.5)); - }; - posN_8.x = (posB_9.x - tmpvar_50); - posN_8.y = (posB_9.y - tmpvar_51); - posP_7.x = (posB_9.x + tmpvar_50); - posP_7.y = (posB_9.y + tmpvar_51); - float tmpvar_52; - tmpvar_52 = ((-2.0 * tmpvar_49) + 3.0); vec4 tmpvar_53; - tmpvar_53 = texture2DLod (_MainTex, posN_8, 0.0); - lumaEndN_6 = tmpvar_53.w; - float tmpvar_54; - tmpvar_54 = (tmpvar_49 * tmpvar_49); + tmpvar_53.zw = vec2(0.0, 0.0); + tmpvar_53.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy); + vec4 tmpvar_54; + tmpvar_54 = texture2DLod (_MainTex, tmpvar_53.xy, 0.0); vec4 tmpvar_55; - tmpvar_55 = texture2DLod (_MainTex, posP_7, 0.0); - lumaEndP_5 = tmpvar_55.w; - if (!(tmpvar_47)) { - lumaNN_10 = tmpvar_46; + tmpvar_55.zw = vec2(0.0, 0.0); + tmpvar_55.xy = (xlv_TEXCOORD0 + _MainTex_TexelSize.xy); + vec4 tmpvar_56; + tmpvar_56 = texture2DLod (_MainTex, tmpvar_55.xy, 0.0); + vec4 tmpvar_57; + tmpvar_57.zw = vec2(0.0, 0.0); + tmpvar_57.xy = (xlv_TEXCOORD0 + (vec2(1.0, -1.0) * _MainTex_TexelSize.xy)); + vec4 tmpvar_58; + tmpvar_58 = texture2DLod (_MainTex, tmpvar_57.xy, 0.0); + vec4 tmpvar_59; + tmpvar_59.zw = vec2(0.0, 0.0); + tmpvar_59.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 1.0) * _MainTex_TexelSize.xy)); + vec4 tmpvar_60; + tmpvar_60 = texture2DLod (_MainTex, tmpvar_59.xy, 0.0); + lumaNS_36 = (tmpvar_48.w + tmpvar_43.w); + lumaWE_35 = (tmpvar_50.w + tmpvar_45.w); + subpixRcpRange_34 = (1.0/(range_37)); + lumaNESE_33 = (tmpvar_58.w + tmpvar_56.w); + lumaNWSW_32 = (tmpvar_54.w + tmpvar_60.w); + lengthSign_31 = fxaaQualityRcpFrame_1.x; + horzSpan_30 = ((abs( + ((-2.0 * tmpvar_50.w) + lumaNWSW_32) + ) + ( + (abs(((-2.0 * tmpvar_41.w) + lumaNS_36)) * 2.0) + + + abs(((-2.0 * tmpvar_45.w) + lumaNESE_33)) + )) >= (abs( + ((-2.0 * tmpvar_43.w) + (tmpvar_60.w + tmpvar_56.w)) + ) + ( + (abs(((-2.0 * tmpvar_41.w) + lumaWE_35)) * 2.0) + + + abs(((-2.0 * tmpvar_48.w) + (tmpvar_54.w + tmpvar_58.w))) + ))); + subpixA_29 = (((lumaNS_36 + lumaWE_35) * 2.0) + (lumaNWSW_32 + lumaNESE_33)); + if (!(horzSpan_30)) { + lumaN_38 = tmpvar_51; }; - float tmpvar_56; - tmpvar_56 = (tmpvar_48 / 4.0); - float tmpvar_57; - tmpvar_57 = (tmpvar_52 * tmpvar_54); - bool tmpvar_58; - tmpvar_58 = ((tmpvar_15.w - (lumaNN_10 * 0.5)) < 0.0); - float tmpvar_59; - tmpvar_59 = (tmpvar_53.w - (lumaNN_10 * 0.5)); - lumaEndN_6 = tmpvar_59; - float tmpvar_60; - tmpvar_60 = (tmpvar_55.w - (lumaNN_10 * 0.5)); - lumaEndP_5 = tmpvar_60; - bool tmpvar_61; - tmpvar_61 = (abs(tmpvar_59) >= tmpvar_56); - bool tmpvar_62; - tmpvar_62 = (abs(tmpvar_60) >= tmpvar_56); - if (!(tmpvar_61)) { - posN_8.x = (posN_8.x - tmpvar_50); + if (!(horzSpan_30)) { + lumaS_39 = tmpvar_46; }; - if (!(tmpvar_61)) { - posN_8.y = (posN_8.y - tmpvar_51); + if (horzSpan_30) { + lengthSign_31 = fxaaQualityRcpFrame_1.y; }; - bool tmpvar_63; - tmpvar_63 = !((tmpvar_61 && tmpvar_62)); - if (!(tmpvar_62)) { - posP_7.x = (posP_7.x + tmpvar_50); + subpixB_28 = ((subpixA_29 * 0.0833333) - tmpvar_41.w); + gradientN_27 = (lumaN_38 - tmpvar_41.w); + gradientS_26 = (lumaS_39 - tmpvar_41.w); + lumaNN_25 = (lumaN_38 + tmpvar_41.w); + lumaSS_24 = (lumaS_39 + tmpvar_41.w); + pairN_23 = (abs(gradientN_27) >= abs(gradientS_26)); + float tmpvar_61; + tmpvar_61 = max (abs(gradientN_27), abs(gradientS_26)); + if (pairN_23) { + lengthSign_31 = -(lengthSign_31); }; - if (!(tmpvar_62)) { - posP_7.y = (posP_7.y + tmpvar_51); - }; - if (tmpvar_63) { - if (!(tmpvar_61)) { - lumaEndN_6 = texture2DLod (_MainTex, posN_8, 0.0).w; - }; - if (!(tmpvar_62)) { - lumaEndP_5 = texture2DLod (_MainTex, posP_7, 0.0).w; - }; - if (!(tmpvar_61)) { - lumaEndN_6 = (lumaEndN_6 - (lumaNN_10 * 0.5)); - }; - if (!(tmpvar_62)) { - lumaEndP_5 = (lumaEndP_5 - (lumaNN_10 * 0.5)); - }; - bool tmpvar_64; - tmpvar_64 = (abs(lumaEndN_6) >= tmpvar_56); - bool tmpvar_65; - tmpvar_65 = (abs(lumaEndP_5) >= tmpvar_56); - if (!(tmpvar_64)) { - posN_8.x = (posN_8.x - tmpvar_50); - }; - if (!(tmpvar_64)) { - posN_8.y = (posN_8.y - tmpvar_51); - }; - bool tmpvar_66; - tmpvar_66 = !((tmpvar_64 && tmpvar_65)); - if (!(tmpvar_65)) { - posP_7.x = (posP_7.x + tmpvar_50); - }; - if (!(tmpvar_65)) { - posP_7.y = (posP_7.y + tmpvar_51); - }; - if (tmpvar_66) { - if (!(tmpvar_64)) { - lumaEndN_6 = texture2DLod (_MainTex, posN_8, 0.0).w; - }; - if (!(tmpvar_65)) { - lumaEndP_5 = texture2DLod (_MainTex, posP_7, 0.0).w; - }; - if (!(tmpvar_64)) { - lumaEndN_6 = (lumaEndN_6 - (lumaNN_10 * 0.5)); - }; - if (!(tmpvar_65)) { - lumaEndP_5 = (lumaEndP_5 - (lumaNN_10 * 0.5)); - }; - bool tmpvar_67; - tmpvar_67 = (abs(lumaEndN_6) >= tmpvar_56); - bool tmpvar_68; - tmpvar_68 = (abs(lumaEndP_5) >= tmpvar_56); - if (!(tmpvar_67)) { - posN_8.x = (posN_8.x - tmpvar_50); - }; - if (!(tmpvar_67)) { - posN_8.y = (posN_8.y - tmpvar_51); - }; - bool tmpvar_69; - tmpvar_69 = !((tmpvar_67 && tmpvar_68)); - if (!(tmpvar_68)) { - posP_7.x = (posP_7.x + tmpvar_50); - }; - if (!(tmpvar_68)) { - posP_7.y = (posP_7.y + tmpvar_51); - }; - if (tmpvar_69) { - if (!(tmpvar_67)) { - lumaEndN_6 = texture2DLod (_MainTex, posN_8, 0.0).w; - }; - if (!(tmpvar_68)) { - lumaEndP_5 = texture2DLod (_MainTex, posP_7, 0.0).w; - }; - if (!(tmpvar_67)) { - lumaEndN_6 = (lumaEndN_6 - (lumaNN_10 * 0.5)); - }; - if (!(tmpvar_68)) { - lumaEndP_5 = (lumaEndP_5 - (lumaNN_10 * 0.5)); - }; - bool tmpvar_70; - tmpvar_70 = (abs(lumaEndN_6) >= tmpvar_56); - bool tmpvar_71; - tmpvar_71 = (abs(lumaEndP_5) >= tmpvar_56); - if (!(tmpvar_70)) { - posN_8.x = (posN_8.x - tmpvar_50); - }; - if (!(tmpvar_70)) { - posN_8.y = (posN_8.y - tmpvar_51); - }; - bool tmpvar_72; - tmpvar_72 = !((tmpvar_70 && tmpvar_71)); - if (!(tmpvar_71)) { - posP_7.x = (posP_7.x + tmpvar_50); - }; - if (!(tmpvar_71)) { - posP_7.y = (posP_7.y + tmpvar_51); - }; - if (tmpvar_72) { - if (!(tmpvar_70)) { - lumaEndN_6 = texture2DLod (_MainTex, posN_8, 0.0).w; - }; - if (!(tmpvar_71)) { - lumaEndP_5 = texture2DLod (_MainTex, posP_7, 0.0).w; - }; - if (!(tmpvar_70)) { - lumaEndN_6 = (lumaEndN_6 - (lumaNN_10 * 0.5)); - }; - if (!(tmpvar_71)) { - lumaEndP_5 = (lumaEndP_5 - (lumaNN_10 * 0.5)); - }; - bool tmpvar_73; - tmpvar_73 = (abs(lumaEndN_6) >= tmpvar_56); - bool tmpvar_74; - tmpvar_74 = (abs(lumaEndP_5) >= tmpvar_56); - if (!(tmpvar_73)) { - posN_8.x = (posN_8.x - (tmpvar_50 * 1.5)); - }; - if (!(tmpvar_73)) { - posN_8.y = (posN_8.y - (tmpvar_51 * 1.5)); - }; - bool tmpvar_75; - tmpvar_75 = !((tmpvar_73 && tmpvar_74)); - if (!(tmpvar_74)) { - posP_7.x = (posP_7.x + (tmpvar_50 * 1.5)); - }; - if (!(tmpvar_74)) { - posP_7.y = (posP_7.y + (tmpvar_51 * 1.5)); - }; - if (tmpvar_75) { - if (!(tmpvar_73)) { - lumaEndN_6 = texture2DLod (_MainTex, posN_8, 0.0).w; - }; - if (!(tmpvar_74)) { - lumaEndP_5 = texture2DLod (_MainTex, posP_7, 0.0).w; - }; - if (!(tmpvar_73)) { - lumaEndN_6 = (lumaEndN_6 - (lumaNN_10 * 0.5)); - }; - if (!(tmpvar_74)) { - lumaEndP_5 = (lumaEndP_5 - (lumaNN_10 * 0.5)); - }; - bool tmpvar_76; - tmpvar_76 = (abs(lumaEndN_6) >= tmpvar_56); - bool tmpvar_77; - tmpvar_77 = (abs(lumaEndP_5) >= tmpvar_56); - if (!(tmpvar_76)) { - posN_8.x = (posN_8.x - (tmpvar_50 * 2.0)); - }; - if (!(tmpvar_76)) { - posN_8.y = (posN_8.y - (tmpvar_51 * 2.0)); - }; - bool tmpvar_78; - tmpvar_78 = !((tmpvar_76 && tmpvar_77)); - if (!(tmpvar_77)) { - posP_7.x = (posP_7.x + (tmpvar_50 * 2.0)); - }; - if (!(tmpvar_77)) { - posP_7.y = (posP_7.y + (tmpvar_51 * 2.0)); - }; - if (tmpvar_78) { - if (!(tmpvar_76)) { - lumaEndN_6 = texture2DLod (_MainTex, posN_8, 0.0).w; - }; - if (!(tmpvar_77)) { - lumaEndP_5 = texture2DLod (_MainTex, posP_7, 0.0).w; - }; - if (!(tmpvar_76)) { - lumaEndN_6 = (lumaEndN_6 - (lumaNN_10 * 0.5)); - }; - if (!(tmpvar_77)) { - lumaEndP_5 = (lumaEndP_5 - (lumaNN_10 * 0.5)); - }; - bool tmpvar_79; - tmpvar_79 = (abs(lumaEndN_6) >= tmpvar_56); - bool tmpvar_80; - tmpvar_80 = (abs(lumaEndP_5) >= tmpvar_56); - if (!(tmpvar_79)) { - posN_8.x = (posN_8.x - (tmpvar_50 * 2.0)); - }; - if (!(tmpvar_79)) { - posN_8.y = (posN_8.y - (tmpvar_51 * 2.0)); - }; - bool tmpvar_81; - tmpvar_81 = !((tmpvar_79 && tmpvar_80)); - if (!(tmpvar_80)) { - posP_7.x = (posP_7.x + (tmpvar_50 * 2.0)); - }; - if (!(tmpvar_80)) { - posP_7.y = (posP_7.y + (tmpvar_51 * 2.0)); - }; - if (tmpvar_81) { - if (!(tmpvar_79)) { - lumaEndN_6 = texture2DLod (_MainTex, posN_8, 0.0).w; - }; - if (!(tmpvar_80)) { - lumaEndP_5 = texture2DLod (_MainTex, posP_7, 0.0).w; - }; - if (!(tmpvar_79)) { - lumaEndN_6 = (lumaEndN_6 - (lumaNN_10 * 0.5)); - }; - if (!(tmpvar_80)) { - lumaEndP_5 = (lumaEndP_5 - (lumaNN_10 * 0.5)); - }; - bool tmpvar_82; - tmpvar_82 = (abs(lumaEndN_6) >= tmpvar_56); - bool tmpvar_83; - tmpvar_83 = (abs(lumaEndP_5) >= tmpvar_56); - if (!(tmpvar_82)) { - posN_8.x = (posN_8.x - (tmpvar_50 * 2.0)); - }; - if (!(tmpvar_82)) { - posN_8.y = (posN_8.y - (tmpvar_51 * 2.0)); - }; - bool tmpvar_84; - tmpvar_84 = !((tmpvar_82 && tmpvar_83)); - if (!(tmpvar_83)) { - posP_7.x = (posP_7.x + (tmpvar_50 * 2.0)); - }; - if (!(tmpvar_83)) { - posP_7.y = (posP_7.y + (tmpvar_51 * 2.0)); - }; - if (tmpvar_84) { - if (!(tmpvar_82)) { - lumaEndN_6 = texture2DLod (_MainTex, posN_8, 0.0).w; - }; - if (!(tmpvar_83)) { - lumaEndP_5 = texture2DLod (_MainTex, posP_7, 0.0).w; - }; - if (!(tmpvar_82)) { - lumaEndN_6 = (lumaEndN_6 - (lumaNN_10 * 0.5)); - }; - if (!(tmpvar_83)) { - lumaEndP_5 = (lumaEndP_5 - (lumaNN_10 * 0.5)); - }; - bool tmpvar_85; - tmpvar_85 = (abs(lumaEndN_6) >= tmpvar_56); - bool tmpvar_86; - tmpvar_86 = (abs(lumaEndP_5) >= tmpvar_56); - if (!(tmpvar_85)) { - posN_8.x = (posN_8.x - (tmpvar_50 * 2.0)); - }; - if (!(tmpvar_85)) { - posN_8.y = (posN_8.y - (tmpvar_51 * 2.0)); - }; - bool tmpvar_87; - tmpvar_87 = !((tmpvar_85 && tmpvar_86)); - if (!(tmpvar_86)) { - posP_7.x = (posP_7.x + (tmpvar_50 * 2.0)); - }; - if (!(tmpvar_86)) { - posP_7.y = (posP_7.y + (tmpvar_51 * 2.0)); - }; - if (tmpvar_87) { - if (!(tmpvar_85)) { - lumaEndN_6 = texture2DLod (_MainTex, posN_8, 0.0).w; - }; - if (!(tmpvar_86)) { - lumaEndP_5 = texture2DLod (_MainTex, posP_7, 0.0).w; - }; - if (!(tmpvar_85)) { - lumaEndN_6 = (lumaEndN_6 - (lumaNN_10 * 0.5)); - }; - if (!(tmpvar_86)) { - lumaEndP_5 = (lumaEndP_5 - (lumaNN_10 * 0.5)); - }; - bool tmpvar_88; - tmpvar_88 = (abs(lumaEndN_6) >= tmpvar_56); - bool tmpvar_89; - tmpvar_89 = (abs(lumaEndP_5) >= tmpvar_56); - if (!(tmpvar_88)) { - posN_8.x = (posN_8.x - (tmpvar_50 * 4.0)); - }; - if (!(tmpvar_88)) { - posN_8.y = (posN_8.y - (tmpvar_51 * 4.0)); - }; - bool tmpvar_90; - tmpvar_90 = !((tmpvar_88 && tmpvar_89)); - if (!(tmpvar_89)) { - posP_7.x = (posP_7.x + (tmpvar_50 * 4.0)); - }; - if (!(tmpvar_89)) { - posP_7.y = (posP_7.y + (tmpvar_51 * 4.0)); - }; - if (tmpvar_90) { - if (!(tmpvar_88)) { - lumaEndN_6 = texture2DLod (_MainTex, posN_8, 0.0).w; - }; - if (!(tmpvar_89)) { - lumaEndP_5 = texture2DLod (_MainTex, posP_7, 0.0).w; - }; - if (!(tmpvar_88)) { - lumaEndN_6 = (lumaEndN_6 - (lumaNN_10 * 0.5)); - }; - if (!(tmpvar_89)) { - lumaEndP_5 = (lumaEndP_5 - (lumaNN_10 * 0.5)); - }; - bool tmpvar_91; - tmpvar_91 = (abs(lumaEndN_6) >= tmpvar_56); - bool tmpvar_92; - tmpvar_92 = (abs(lumaEndP_5) >= tmpvar_56); - if (!(tmpvar_91)) { - posN_8.x = (posN_8.x - (tmpvar_50 * 8.0)); - }; - if (!(tmpvar_91)) { - posN_8.y = (posN_8.y - (tmpvar_51 * 8.0)); - }; - if (!(tmpvar_92)) { - posP_7.x = (posP_7.x + (tmpvar_50 * 8.0)); - }; - if (!(tmpvar_92)) { - posP_7.y = (posP_7.y + (tmpvar_51 * 8.0)); - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; - dstN_4 = (xlv_TEXCOORD0.x - posN_8.x); - dstP_3 = (posP_7.x - xlv_TEXCOORD0.x); - if (!(tmpvar_41)) { - dstN_4 = (xlv_TEXCOORD0.y - posN_8.y); - }; - if (!(tmpvar_41)) { - dstP_3 = (posP_7.y - xlv_TEXCOORD0.y); - }; - bool tmpvar_93; - tmpvar_93 = ((lumaEndN_6 < 0.0) != tmpvar_58); - bool tmpvar_94; - tmpvar_94 = ((lumaEndP_5 < 0.0) != tmpvar_58); - float tmpvar_95; - tmpvar_95 = (1.0/((dstP_3 + dstN_4))); - float tmpvar_96; - tmpvar_96 = min (dstN_4, dstP_3); - bool tmpvar_97; - if ((dstN_4 < dstP_3)) { - tmpvar_97 = tmpvar_93; + float tmpvar_62; + tmpvar_62 = clamp ((abs(subpixB_28) * subpixRcpRange_34), 0.0, 1.0); + posB_22 = posM_40; + float tmpvar_63; + if (!(horzSpan_30)) { + tmpvar_63 = 0.0; } else { - tmpvar_97 = tmpvar_94; + tmpvar_63 = fxaaQualityRcpFrame_1.x; }; - float tmpvar_98; - tmpvar_98 = ((tmpvar_96 * -(tmpvar_95)) + 0.5); - float tmpvar_99; - tmpvar_99 = ((tmpvar_57 * tmpvar_57) * 0.75); - float tmpvar_100; - if (tmpvar_97) { - tmpvar_100 = tmpvar_98; + float tmpvar_64; + if (horzSpan_30) { + tmpvar_64 = 0.0; } else { - tmpvar_100 = 0.0; + tmpvar_64 = fxaaQualityRcpFrame_1.y; }; - float tmpvar_101; - tmpvar_101 = max (tmpvar_100, tmpvar_99); - if (!(tmpvar_41)) { - posM_14.x = (xlv_TEXCOORD0.x + (tmpvar_101 * lengthSign_11)); + if (!(horzSpan_30)) { + posB_22.x = (xlv_TEXCOORD0.x + (lengthSign_31 * 0.5)); }; - if (tmpvar_41) { - posM_14.y = (xlv_TEXCOORD0.y + (tmpvar_101 * lengthSign_11)); + if (horzSpan_30) { + posB_22.y = (xlv_TEXCOORD0.y + (lengthSign_31 * 0.5)); }; - vec4 tmpvar_102; - tmpvar_102.xyz = texture2DLod (_MainTex, posM_14, 0.0).xyz; - tmpvar_102.w = tmpvar_15.w; - tmpvar_2 = tmpvar_102; + posN_21.x = (posB_22.x - tmpvar_63); + posN_21.y = (posB_22.y - tmpvar_64); + posP_20.x = (posB_22.x + tmpvar_63); + posP_20.y = (posB_22.y + tmpvar_64); + subpixD_19 = ((-2.0 * tmpvar_62) + 3.0); + vec4 tmpvar_65; + tmpvar_65 = texture2DLod (_MainTex, posN_21, 0.0); + lumaEndN_18 = tmpvar_65.w; + subpixE_17 = (tmpvar_62 * tmpvar_62); + vec4 tmpvar_66; + tmpvar_66 = texture2DLod (_MainTex, posP_20, 0.0); + lumaEndP_16 = tmpvar_66.w; + if (!(pairN_23)) { + lumaNN_25 = lumaSS_24; + }; + gradientScaled_15 = (tmpvar_61 / 4.0); + subpixF_14 = (subpixD_19 * subpixE_17); + lumaMLTZero_13 = ((tmpvar_41.w - (lumaNN_25 * 0.5)) < 0.0); + lumaEndN_18 = (tmpvar_65.w - (lumaNN_25 * 0.5)); + lumaEndP_16 = (tmpvar_66.w - (lumaNN_25 * 0.5)); + doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15); + doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15); + if (!(doneN_12)) { + posN_21.x = (posN_21.x - tmpvar_63); + }; + if (!(doneN_12)) { + posN_21.y = (posN_21.y - tmpvar_64); + }; + doneNP_10 = !((doneN_12 && doneP_11)); + if (!(doneP_11)) { + posP_20.x = (posP_20.x + tmpvar_63); + }; + if (!(doneP_11)) { + posP_20.y = (posP_20.y + tmpvar_64); + }; + if (doneNP_10) { + if (!(doneN_12)) { + lumaEndN_18 = texture2DLod (_MainTex, posN_21, 0.0).w; + }; + if (!(doneP_11)) { + lumaEndP_16 = texture2DLod (_MainTex, posP_20, 0.0).w; + }; + if (!(doneN_12)) { + lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5)); + }; + if (!(doneP_11)) { + lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5)); + }; + doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15); + doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15); + if (!(doneN_12)) { + posN_21.x = (posN_21.x - tmpvar_63); + }; + if (!(doneN_12)) { + posN_21.y = (posN_21.y - tmpvar_64); + }; + doneNP_10 = !((doneN_12 && doneP_11)); + if (!(doneP_11)) { + posP_20.x = (posP_20.x + tmpvar_63); + }; + if (!(doneP_11)) { + posP_20.y = (posP_20.y + tmpvar_64); + }; + if (doneNP_10) { + if (!(doneN_12)) { + lumaEndN_18 = texture2DLod (_MainTex, posN_21, 0.0).w; + }; + if (!(doneP_11)) { + lumaEndP_16 = texture2DLod (_MainTex, posP_20, 0.0).w; + }; + if (!(doneN_12)) { + lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5)); + }; + if (!(doneP_11)) { + lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5)); + }; + doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15); + doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15); + if (!(doneN_12)) { + posN_21.x = (posN_21.x - tmpvar_63); + }; + if (!(doneN_12)) { + posN_21.y = (posN_21.y - tmpvar_64); + }; + doneNP_10 = !((doneN_12 && doneP_11)); + if (!(doneP_11)) { + posP_20.x = (posP_20.x + tmpvar_63); + }; + if (!(doneP_11)) { + posP_20.y = (posP_20.y + tmpvar_64); + }; + if (doneNP_10) { + if (!(doneN_12)) { + lumaEndN_18 = texture2DLod (_MainTex, posN_21, 0.0).w; + }; + if (!(doneP_11)) { + lumaEndP_16 = texture2DLod (_MainTex, posP_20, 0.0).w; + }; + if (!(doneN_12)) { + lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5)); + }; + if (!(doneP_11)) { + lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5)); + }; + doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15); + doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15); + if (!(doneN_12)) { + posN_21.x = (posN_21.x - tmpvar_63); + }; + if (!(doneN_12)) { + posN_21.y = (posN_21.y - tmpvar_64); + }; + doneNP_10 = !((doneN_12 && doneP_11)); + if (!(doneP_11)) { + posP_20.x = (posP_20.x + tmpvar_63); + }; + if (!(doneP_11)) { + posP_20.y = (posP_20.y + tmpvar_64); + }; + if (doneNP_10) { + if (!(doneN_12)) { + lumaEndN_18 = texture2DLod (_MainTex, posN_21, 0.0).w; + }; + if (!(doneP_11)) { + lumaEndP_16 = texture2DLod (_MainTex, posP_20, 0.0).w; + }; + if (!(doneN_12)) { + lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5)); + }; + if (!(doneP_11)) { + lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5)); + }; + doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15); + doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15); + if (!(doneN_12)) { + posN_21.x = (posN_21.x - (tmpvar_63 * 1.5)); + }; + if (!(doneN_12)) { + posN_21.y = (posN_21.y - (tmpvar_64 * 1.5)); + }; + doneNP_10 = !((doneN_12 && doneP_11)); + if (!(doneP_11)) { + posP_20.x = (posP_20.x + (tmpvar_63 * 1.5)); + }; + if (!(doneP_11)) { + posP_20.y = (posP_20.y + (tmpvar_64 * 1.5)); + }; + if (doneNP_10) { + if (!(doneN_12)) { + lumaEndN_18 = texture2DLod (_MainTex, posN_21, 0.0).w; + }; + if (!(doneP_11)) { + lumaEndP_16 = texture2DLod (_MainTex, posP_20, 0.0).w; + }; + if (!(doneN_12)) { + lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5)); + }; + if (!(doneP_11)) { + lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5)); + }; + doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15); + doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15); + if (!(doneN_12)) { + posN_21.x = (posN_21.x - (tmpvar_63 * 2.0)); + }; + if (!(doneN_12)) { + posN_21.y = (posN_21.y - (tmpvar_64 * 2.0)); + }; + doneNP_10 = !((doneN_12 && doneP_11)); + if (!(doneP_11)) { + posP_20.x = (posP_20.x + (tmpvar_63 * 2.0)); + }; + if (!(doneP_11)) { + posP_20.y = (posP_20.y + (tmpvar_64 * 2.0)); + }; + if (doneNP_10) { + if (!(doneN_12)) { + lumaEndN_18 = texture2DLod (_MainTex, posN_21, 0.0).w; + }; + if (!(doneP_11)) { + lumaEndP_16 = texture2DLod (_MainTex, posP_20, 0.0).w; + }; + if (!(doneN_12)) { + lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5)); + }; + if (!(doneP_11)) { + lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5)); + }; + doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15); + doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15); + if (!(doneN_12)) { + posN_21.x = (posN_21.x - (tmpvar_63 * 2.0)); + }; + if (!(doneN_12)) { + posN_21.y = (posN_21.y - (tmpvar_64 * 2.0)); + }; + doneNP_10 = !((doneN_12 && doneP_11)); + if (!(doneP_11)) { + posP_20.x = (posP_20.x + (tmpvar_63 * 2.0)); + }; + if (!(doneP_11)) { + posP_20.y = (posP_20.y + (tmpvar_64 * 2.0)); + }; + if (doneNP_10) { + if (!(doneN_12)) { + lumaEndN_18 = texture2DLod (_MainTex, posN_21, 0.0).w; + }; + if (!(doneP_11)) { + lumaEndP_16 = texture2DLod (_MainTex, posP_20, 0.0).w; + }; + if (!(doneN_12)) { + lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5)); + }; + if (!(doneP_11)) { + lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5)); + }; + doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15); + doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15); + if (!(doneN_12)) { + posN_21.x = (posN_21.x - (tmpvar_63 * 2.0)); + }; + if (!(doneN_12)) { + posN_21.y = (posN_21.y - (tmpvar_64 * 2.0)); + }; + doneNP_10 = !((doneN_12 && doneP_11)); + if (!(doneP_11)) { + posP_20.x = (posP_20.x + (tmpvar_63 * 2.0)); + }; + if (!(doneP_11)) { + posP_20.y = (posP_20.y + (tmpvar_64 * 2.0)); + }; + if (doneNP_10) { + if (!(doneN_12)) { + lumaEndN_18 = texture2DLod (_MainTex, posN_21, 0.0).w; + }; + if (!(doneP_11)) { + lumaEndP_16 = texture2DLod (_MainTex, posP_20, 0.0).w; + }; + if (!(doneN_12)) { + lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5)); + }; + if (!(doneP_11)) { + lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5)); + }; + doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15); + doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15); + if (!(doneN_12)) { + posN_21.x = (posN_21.x - (tmpvar_63 * 2.0)); + }; + if (!(doneN_12)) { + posN_21.y = (posN_21.y - (tmpvar_64 * 2.0)); + }; + doneNP_10 = !((doneN_12 && doneP_11)); + if (!(doneP_11)) { + posP_20.x = (posP_20.x + (tmpvar_63 * 2.0)); + }; + if (!(doneP_11)) { + posP_20.y = (posP_20.y + (tmpvar_64 * 2.0)); + }; + if (doneNP_10) { + if (!(doneN_12)) { + lumaEndN_18 = texture2DLod (_MainTex, posN_21, 0.0).w; + }; + if (!(doneP_11)) { + lumaEndP_16 = texture2DLod (_MainTex, posP_20, 0.0).w; + }; + if (!(doneN_12)) { + lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5)); + }; + if (!(doneP_11)) { + lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5)); + }; + doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15); + doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15); + if (!(doneN_12)) { + posN_21.x = (posN_21.x - (tmpvar_63 * 4.0)); + }; + if (!(doneN_12)) { + posN_21.y = (posN_21.y - (tmpvar_64 * 4.0)); + }; + doneNP_10 = !((doneN_12 && doneP_11)); + if (!(doneP_11)) { + posP_20.x = (posP_20.x + (tmpvar_63 * 4.0)); + }; + if (!(doneP_11)) { + posP_20.y = (posP_20.y + (tmpvar_64 * 4.0)); + }; + if (doneNP_10) { + if (!(doneN_12)) { + lumaEndN_18 = texture2DLod (_MainTex, posN_21, 0.0).w; + }; + if (!(doneP_11)) { + lumaEndP_16 = texture2DLod (_MainTex, posP_20, 0.0).w; + }; + if (!(doneN_12)) { + lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5)); + }; + if (!(doneP_11)) { + lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5)); + }; + doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15); + doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15); + if (!(doneN_12)) { + posN_21.x = (posN_21.x - (tmpvar_63 * 8.0)); + }; + if (!(doneN_12)) { + posN_21.y = (posN_21.y - (tmpvar_64 * 8.0)); + }; + doneNP_10 = !((doneN_12 && doneP_11)); + if (!(doneP_11)) { + posP_20.x = (posP_20.x + (tmpvar_63 * 8.0)); + }; + if (!(doneP_11)) { + posP_20.y = (posP_20.y + (tmpvar_64 * 8.0)); + }; + }; + }; + }; + }; + }; + }; + }; + }; + }; + }; + dstN_9 = (xlv_TEXCOORD0.x - posN_21.x); + dstP_8 = (posP_20.x - xlv_TEXCOORD0.x); + if (!(horzSpan_30)) { + dstN_9 = (xlv_TEXCOORD0.y - posN_21.y); + }; + if (!(horzSpan_30)) { + dstP_8 = (posP_20.y - xlv_TEXCOORD0.y); + }; + goodSpanN_7 = ((lumaEndN_18 < 0.0) != lumaMLTZero_13); + goodSpanP_6 = ((lumaEndP_16 < 0.0) != lumaMLTZero_13); + spanLengthRcp_5 = (1.0/((dstP_8 + dstN_9))); + float tmpvar_67; + tmpvar_67 = min (dstN_9, dstP_8); + bool tmpvar_68; + if ((dstN_9 < dstP_8)) { + tmpvar_68 = goodSpanN_7; + } else { + tmpvar_68 = goodSpanP_6; + }; + pixelOffset_4 = ((tmpvar_67 * -(spanLengthRcp_5)) + 0.5); + subpixH_3 = ((subpixF_14 * subpixF_14) * 0.75); + float tmpvar_69; + if (tmpvar_68) { + tmpvar_69 = pixelOffset_4; + } else { + tmpvar_69 = 0.0; + }; + float tmpvar_70; + tmpvar_70 = max (tmpvar_69, subpixH_3); + if (!(horzSpan_30)) { + posM_40.x = (xlv_TEXCOORD0.x + (tmpvar_70 * lengthSign_31)); + }; + if (horzSpan_30) { + posM_40.y = (xlv_TEXCOORD0.y + (tmpvar_70 * lengthSign_31)); + }; + vec4 tmpvar_71; + tmpvar_71.xyz = texture2DLod (_MainTex, posM_40, 0.0).xyz; + tmpvar_71.w = tmpvar_41.w; + tmpvar_2 = tmpvar_71; }; gl_FragData[0] = tmpvar_2; } -// inputs: 1, stats: 399 alu 32 tex 110 flow +// stats: 401 alu 32 tex 110 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// uniforms: 1 (total size: 0) +// #0: _MainTex_TexelSize (high float) 4x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-outES.txt index eb9c323c2..ac6895e73 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-outES.txt @@ -7,605 +7,578 @@ void main () highp vec2 fxaaQualityRcpFrame_1; fxaaQualityRcpFrame_1 = _MainTex_TexelSize.xy; highp vec4 tmpvar_2; - highp float dstP_3; - highp float dstN_4; - highp float lumaEndP_5; - highp float lumaEndN_6; - highp vec2 posP_7; - highp vec2 posN_8; - highp vec2 posB_9; - highp float lumaNN_10; - highp float lengthSign_11; - highp float lumaN_12; - highp float lumaS_13; - highp vec4 rgbyM_14; - highp vec2 posM_15; - posM_15 = xlv_TEXCOORD0; - lowp vec4 tmpvar_16; - tmpvar_16 = texture2DLodEXT (_MainTex, xlv_TEXCOORD0, 0.0); - rgbyM_14 = tmpvar_16; - highp vec4 tmpvar_17; - tmpvar_17.zw = vec2(0.0, 0.0); - tmpvar_17.xy = (xlv_TEXCOORD0 + (vec2(0.0, 1.0) * _MainTex_TexelSize.xy)); - lowp vec4 tmpvar_18; - tmpvar_18 = texture2DLodEXT (_MainTex, tmpvar_17.xy, 0.0); - highp vec4 rgba_19; - rgba_19 = tmpvar_18; - lumaS_13 = rgba_19.w; - highp vec4 tmpvar_20; - tmpvar_20.zw = vec2(0.0, 0.0); - tmpvar_20.xy = (xlv_TEXCOORD0 + (vec2(1.0, 0.0) * _MainTex_TexelSize.xy)); - lowp vec4 tmpvar_21; - tmpvar_21 = texture2DLodEXT (_MainTex, tmpvar_20.xy, 0.0); - highp float tmpvar_22; - highp vec4 rgba_23; - rgba_23 = tmpvar_21; - tmpvar_22 = rgba_23.w; - highp vec4 tmpvar_24; - tmpvar_24.zw = vec2(0.0, 0.0); - tmpvar_24.xy = (xlv_TEXCOORD0 + (vec2(0.0, -1.0) * _MainTex_TexelSize.xy)); - lowp vec4 tmpvar_25; - tmpvar_25 = texture2DLodEXT (_MainTex, tmpvar_24.xy, 0.0); - highp vec4 rgba_26; - rgba_26 = tmpvar_25; - lumaN_12 = rgba_26.w; - highp vec4 tmpvar_27; - tmpvar_27.zw = vec2(0.0, 0.0); - tmpvar_27.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 0.0) * _MainTex_TexelSize.xy)); - lowp vec4 tmpvar_28; - tmpvar_28 = texture2DLodEXT (_MainTex, tmpvar_27.xy, 0.0); - highp float tmpvar_29; - highp vec4 rgba_30; - rgba_30 = tmpvar_28; - tmpvar_29 = rgba_30.w; - highp float tmpvar_31; - tmpvar_31 = max (max (rgba_26.w, rgba_30.w), max (rgba_23.w, max (rgba_19.w, rgbyM_14.w))); - highp float tmpvar_32; - tmpvar_32 = (tmpvar_31 - min (min (rgba_26.w, rgba_30.w), min (rgba_23.w, - min (rgba_19.w, rgbyM_14.w) - ))); - if ((tmpvar_32 < max (0.0833, (tmpvar_31 * 0.166)))) { - tmpvar_2 = rgbyM_14; + highp float subpixH_3; + highp float pixelOffset_4; + highp float spanLengthRcp_5; + bool goodSpanP_6; + bool goodSpanN_7; + highp float dstP_8; + highp float dstN_9; + bool doneNP_10; + bool doneP_11; + bool doneN_12; + bool lumaMLTZero_13; + highp float subpixF_14; + highp float gradientScaled_15; + highp float lumaEndP_16; + highp float subpixE_17; + highp float lumaEndN_18; + highp float subpixD_19; + highp vec2 posP_20; + highp vec2 posN_21; + highp vec2 posB_22; + bool pairN_23; + highp float lumaSS_24; + highp float lumaNN_25; + highp float gradientS_26; + highp float gradientN_27; + highp float subpixB_28; + highp float subpixA_29; + bool horzSpan_30; + highp float lengthSign_31; + highp float lumaNWSW_32; + highp float lumaNESE_33; + highp float subpixRcpRange_34; + highp float lumaWE_35; + highp float lumaNS_36; + highp float range_37; + highp float lumaN_38; + highp float lumaS_39; + highp vec4 rgbyM_40; + highp vec2 posM_41; + posM_41 = xlv_TEXCOORD0; + lowp vec4 tmpvar_42; + tmpvar_42 = 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); + highp vec4 rgba_45; + rgba_45 = tmpvar_44; + lumaS_39 = rgba_45.w; + highp vec4 tmpvar_46; + 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); + highp float tmpvar_48; + highp vec4 rgba_49; + rgba_49 = tmpvar_47; + tmpvar_48 = rgba_49.w; + highp vec4 tmpvar_50; + 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); + highp vec4 rgba_52; + rgba_52 = tmpvar_51; + lumaN_38 = rgba_52.w; + highp vec4 tmpvar_53; + 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); + highp float tmpvar_55; + highp vec4 rgba_56; + rgba_56 = tmpvar_54; + tmpvar_55 = rgba_56.w; + highp float tmpvar_57; + tmpvar_57 = max (max (rgba_52.w, rgba_56.w), max (max (rgba_49.w, rgba_45.w), rgbyM_40.w)); + range_37 = (tmpvar_57 - min (min (rgba_52.w, rgba_56.w), min ( + min (rgba_49.w, rgba_45.w) + , rgbyM_40.w))); + if ((range_37 < max (0.0833, (tmpvar_57 * 0.166)))) { + tmpvar_2 = rgbyM_40; } else { - highp vec4 tmpvar_33; - tmpvar_33.zw = vec2(0.0, 0.0); - tmpvar_33.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy); - lowp vec4 tmpvar_34; - tmpvar_34 = texture2DLodEXT (_MainTex, tmpvar_33.xy, 0.0); - highp vec4 rgba_35; - rgba_35 = tmpvar_34; - highp vec4 tmpvar_36; - tmpvar_36.zw = vec2(0.0, 0.0); - tmpvar_36.xy = (xlv_TEXCOORD0 + _MainTex_TexelSize.xy); - lowp vec4 tmpvar_37; - tmpvar_37 = texture2DLodEXT (_MainTex, tmpvar_36.xy, 0.0); - highp vec4 rgba_38; - rgba_38 = tmpvar_37; - highp vec4 tmpvar_39; - tmpvar_39.zw = vec2(0.0, 0.0); - tmpvar_39.xy = (xlv_TEXCOORD0 + (vec2(1.0, -1.0) * _MainTex_TexelSize.xy)); - lowp vec4 tmpvar_40; - tmpvar_40 = texture2DLodEXT (_MainTex, tmpvar_39.xy, 0.0); - highp vec4 rgba_41; - rgba_41 = tmpvar_40; - highp vec4 tmpvar_42; - tmpvar_42.zw = vec2(0.0, 0.0); - tmpvar_42.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 1.0) * _MainTex_TexelSize.xy)); - lowp vec4 tmpvar_43; - tmpvar_43 = texture2DLodEXT (_MainTex, tmpvar_42.xy, 0.0); - highp vec4 rgba_44; - rgba_44 = tmpvar_43; - highp float tmpvar_45; - tmpvar_45 = (rgba_26.w + rgba_19.w); - highp float tmpvar_46; - tmpvar_46 = (rgba_30.w + rgba_23.w); - highp float tmpvar_47; - tmpvar_47 = (1.0/(tmpvar_32)); - highp float tmpvar_48; - tmpvar_48 = (rgba_41.w + rgba_38.w); - highp float tmpvar_49; - tmpvar_49 = (rgba_35.w + rgba_44.w); - lengthSign_11 = fxaaQualityRcpFrame_1.x; - bool tmpvar_50; - tmpvar_50 = ((abs( - ((-2.0 * rgba_30.w) + tmpvar_49) - ) + ( - (abs(((-2.0 * rgbyM_14.w) + tmpvar_45)) * 2.0) - + - abs(((-2.0 * rgba_23.w) + tmpvar_48)) - )) >= (abs( - ((-2.0 * rgba_19.w) + (rgba_44.w + rgba_38.w)) - ) + ( - (abs(((-2.0 * rgbyM_14.w) + tmpvar_46)) * 2.0) - + - abs(((-2.0 * rgba_26.w) + (rgba_35.w + rgba_41.w))) - ))); - highp float tmpvar_51; - tmpvar_51 = (((tmpvar_45 + tmpvar_46) * 2.0) + (tmpvar_49 + tmpvar_48)); - if (!(tmpvar_50)) { - lumaN_12 = tmpvar_29; - }; - if (!(tmpvar_50)) { - lumaS_13 = tmpvar_22; - }; - if (tmpvar_50) { - lengthSign_11 = fxaaQualityRcpFrame_1.y; - }; - highp float tmpvar_52; - tmpvar_52 = ((tmpvar_51 * 0.0833333) - rgbyM_14.w); - highp float tmpvar_53; - tmpvar_53 = (lumaN_12 - rgbyM_14.w); - highp float tmpvar_54; - tmpvar_54 = (lumaS_13 - rgbyM_14.w); - lumaNN_10 = (lumaN_12 + rgbyM_14.w); - highp float tmpvar_55; - tmpvar_55 = (lumaS_13 + rgbyM_14.w); - bool tmpvar_56; - tmpvar_56 = (abs(tmpvar_53) >= abs(tmpvar_54)); - highp float tmpvar_57; - tmpvar_57 = max (abs(tmpvar_53), abs(tmpvar_54)); - if (tmpvar_56) { - lengthSign_11 = -(lengthSign_11); - }; - highp float tmpvar_58; - tmpvar_58 = clamp ((abs(tmpvar_52) * tmpvar_47), 0.0, 1.0); - posB_9 = xlv_TEXCOORD0; - highp float tmpvar_59; - if (!(tmpvar_50)) { - tmpvar_59 = 0.0; - } else { - tmpvar_59 = fxaaQualityRcpFrame_1.x; - }; - highp float tmpvar_60; - if (tmpvar_50) { - tmpvar_60 = 0.0; - } else { - tmpvar_60 = fxaaQualityRcpFrame_1.y; - }; - if (!(tmpvar_50)) { - posB_9.x = (xlv_TEXCOORD0.x + (lengthSign_11 * 0.5)); - }; - if (tmpvar_50) { - posB_9.y = (xlv_TEXCOORD0.y + (lengthSign_11 * 0.5)); - }; - posN_8.x = (posB_9.x - tmpvar_59); - posN_8.y = (posB_9.y - tmpvar_60); - posP_7.x = (posB_9.x + tmpvar_59); - posP_7.y = (posB_9.y + tmpvar_60); - highp float tmpvar_61; - tmpvar_61 = ((-2.0 * tmpvar_58) + 3.0); + highp vec4 tmpvar_58; + 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); + 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, posN_8, 0.0); + tmpvar_62 = texture2DLodEXT (_MainTex, tmpvar_61.xy, 0.0); highp vec4 rgba_63; rgba_63 = tmpvar_62; - lumaEndN_6 = rgba_63.w; - highp float tmpvar_64; - tmpvar_64 = (tmpvar_58 * tmpvar_58); + 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, posP_7, 0.0); + tmpvar_65 = texture2DLodEXT (_MainTex, tmpvar_64.xy, 0.0); highp vec4 rgba_66; rgba_66 = tmpvar_65; - lumaEndP_5 = rgba_66.w; - if (!(tmpvar_56)) { - lumaNN_10 = tmpvar_55; + 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); + highp vec4 rgba_69; + rgba_69 = tmpvar_68; + lumaNS_36 = (rgba_52.w + rgba_45.w); + lumaWE_35 = (rgba_56.w + rgba_49.w); + subpixRcpRange_34 = (1.0/(range_37)); + lumaNESE_33 = (rgba_66.w + rgba_63.w); + lumaNWSW_32 = (rgba_60.w + rgba_69.w); + lengthSign_31 = fxaaQualityRcpFrame_1.x; + horzSpan_30 = ((abs( + ((-2.0 * rgba_56.w) + lumaNWSW_32) + ) + ( + (abs(((-2.0 * rgbyM_40.w) + lumaNS_36)) * 2.0) + + + abs(((-2.0 * rgba_49.w) + lumaNESE_33)) + )) >= (abs( + ((-2.0 * rgba_45.w) + (rgba_69.w + rgba_63.w)) + ) + ( + (abs(((-2.0 * rgbyM_40.w) + lumaWE_35)) * 2.0) + + + abs(((-2.0 * rgba_52.w) + (rgba_60.w + rgba_66.w))) + ))); + subpixA_29 = (((lumaNS_36 + lumaWE_35) * 2.0) + (lumaNWSW_32 + lumaNESE_33)); + if (!(horzSpan_30)) { + lumaN_38 = tmpvar_55; }; - highp float tmpvar_67; - tmpvar_67 = (tmpvar_57 / 4.0); - highp float tmpvar_68; - tmpvar_68 = (tmpvar_61 * tmpvar_64); - bool tmpvar_69; - tmpvar_69 = ((rgbyM_14.w - (lumaNN_10 * 0.5)) < 0.0); + if (!(horzSpan_30)) { + lumaS_39 = tmpvar_48; + }; + if (horzSpan_30) { + lengthSign_31 = fxaaQualityRcpFrame_1.y; + }; + subpixB_28 = ((subpixA_29 * 0.0833333) - rgbyM_40.w); + gradientN_27 = (lumaN_38 - rgbyM_40.w); + gradientS_26 = (lumaS_39 - rgbyM_40.w); + lumaNN_25 = (lumaN_38 + rgbyM_40.w); + lumaSS_24 = (lumaS_39 + rgbyM_40.w); + pairN_23 = (abs(gradientN_27) >= abs(gradientS_26)); highp float tmpvar_70; - tmpvar_70 = (rgba_63.w - (lumaNN_10 * 0.5)); - lumaEndN_6 = tmpvar_70; + tmpvar_70 = max (abs(gradientN_27), abs(gradientS_26)); + if (pairN_23) { + lengthSign_31 = -(lengthSign_31); + }; highp float tmpvar_71; - tmpvar_71 = (rgba_66.w - (lumaNN_10 * 0.5)); - lumaEndP_5 = tmpvar_71; - bool tmpvar_72; - tmpvar_72 = (abs(tmpvar_70) >= tmpvar_67); - bool tmpvar_73; - tmpvar_73 = (abs(tmpvar_71) >= tmpvar_67); - if (!(tmpvar_72)) { - posN_8.x = (posN_8.x - tmpvar_59); + tmpvar_71 = clamp ((abs(subpixB_28) * subpixRcpRange_34), 0.0, 1.0); + posB_22 = xlv_TEXCOORD0; + highp float tmpvar_72; + if (!(horzSpan_30)) { + tmpvar_72 = 0.0; + } else { + tmpvar_72 = fxaaQualityRcpFrame_1.x; }; - if (!(tmpvar_72)) { - posN_8.y = (posN_8.y - tmpvar_60); + highp float tmpvar_73; + if (horzSpan_30) { + tmpvar_73 = 0.0; + } else { + tmpvar_73 = fxaaQualityRcpFrame_1.y; }; - bool tmpvar_74; - tmpvar_74 = !((tmpvar_72 && tmpvar_73)); - if (!(tmpvar_73)) { - posP_7.x = (posP_7.x + tmpvar_59); + if (!(horzSpan_30)) { + posB_22.x = (xlv_TEXCOORD0.x + (lengthSign_31 * 0.5)); }; - if (!(tmpvar_73)) { - posP_7.y = (posP_7.y + tmpvar_60); + if (horzSpan_30) { + posB_22.y = (xlv_TEXCOORD0.y + (lengthSign_31 * 0.5)); }; - if (tmpvar_74) { - if (!(tmpvar_72)) { - lowp vec4 tmpvar_75; - tmpvar_75 = texture2DLodEXT (_MainTex, posN_8, 0.0); - highp vec4 rgba_76; - rgba_76 = tmpvar_75; - lumaEndN_6 = rgba_76.w; + posN_21.x = (posB_22.x - tmpvar_72); + posN_21.y = (posB_22.y - tmpvar_73); + posP_20.x = (posB_22.x + tmpvar_72); + 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); + 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); + highp vec4 rgba_77; + rgba_77 = tmpvar_76; + lumaEndP_16 = rgba_77.w; + if (!(pairN_23)) { + lumaNN_25 = lumaSS_24; + }; + gradientScaled_15 = (tmpvar_70 / 4.0); + subpixF_14 = (subpixD_19 * subpixE_17); + lumaMLTZero_13 = ((rgbyM_40.w - (lumaNN_25 * 0.5)) < 0.0); + lumaEndN_18 = (rgba_75.w - (lumaNN_25 * 0.5)); + lumaEndP_16 = (rgba_77.w - (lumaNN_25 * 0.5)); + doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15); + doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15); + if (!(doneN_12)) { + posN_21.x = (posN_21.x - tmpvar_72); + }; + if (!(doneN_12)) { + posN_21.y = (posN_21.y - tmpvar_73); + }; + doneNP_10 = !((doneN_12 && doneP_11)); + if (!(doneP_11)) { + posP_20.x = (posP_20.x + tmpvar_72); + }; + if (!(doneP_11)) { + posP_20.y = (posP_20.y + tmpvar_73); + }; + if (doneNP_10) { + if (!(doneN_12)) { + lowp vec4 tmpvar_78; + tmpvar_78 = texture2DLodEXT (_MainTex, posN_21, 0.0); + highp vec4 rgba_79; + rgba_79 = tmpvar_78; + lumaEndN_18 = rgba_79.w; }; - if (!(tmpvar_73)) { - lowp vec4 tmpvar_77; - tmpvar_77 = texture2DLodEXT (_MainTex, posP_7, 0.0); - highp vec4 rgba_78; - rgba_78 = tmpvar_77; - lumaEndP_5 = rgba_78.w; + if (!(doneP_11)) { + lowp vec4 tmpvar_80; + tmpvar_80 = texture2DLodEXT (_MainTex, posP_20, 0.0); + highp vec4 rgba_81; + rgba_81 = tmpvar_80; + lumaEndP_16 = rgba_81.w; }; - if (!(tmpvar_72)) { - lumaEndN_6 = (lumaEndN_6 - (lumaNN_10 * 0.5)); + if (!(doneN_12)) { + lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5)); }; - if (!(tmpvar_73)) { - lumaEndP_5 = (lumaEndP_5 - (lumaNN_10 * 0.5)); + if (!(doneP_11)) { + lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5)); }; - bool tmpvar_79; - tmpvar_79 = (abs(lumaEndN_6) >= tmpvar_67); - bool tmpvar_80; - tmpvar_80 = (abs(lumaEndP_5) >= tmpvar_67); - if (!(tmpvar_79)) { - posN_8.x = (posN_8.x - tmpvar_59); + doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15); + doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15); + if (!(doneN_12)) { + posN_21.x = (posN_21.x - tmpvar_72); }; - if (!(tmpvar_79)) { - posN_8.y = (posN_8.y - tmpvar_60); + if (!(doneN_12)) { + posN_21.y = (posN_21.y - tmpvar_73); }; - bool tmpvar_81; - tmpvar_81 = !((tmpvar_79 && tmpvar_80)); - if (!(tmpvar_80)) { - posP_7.x = (posP_7.x + tmpvar_59); + doneNP_10 = !((doneN_12 && doneP_11)); + if (!(doneP_11)) { + posP_20.x = (posP_20.x + tmpvar_72); }; - if (!(tmpvar_80)) { - posP_7.y = (posP_7.y + tmpvar_60); + if (!(doneP_11)) { + posP_20.y = (posP_20.y + tmpvar_73); }; - if (tmpvar_81) { - if (!(tmpvar_79)) { + if (doneNP_10) { + if (!(doneN_12)) { lowp vec4 tmpvar_82; - tmpvar_82 = texture2DLodEXT (_MainTex, posN_8, 0.0); + tmpvar_82 = texture2DLodEXT (_MainTex, posN_21, 0.0); highp vec4 rgba_83; rgba_83 = tmpvar_82; - lumaEndN_6 = rgba_83.w; + lumaEndN_18 = rgba_83.w; }; - if (!(tmpvar_80)) { + if (!(doneP_11)) { lowp vec4 tmpvar_84; - tmpvar_84 = texture2DLodEXT (_MainTex, posP_7, 0.0); + tmpvar_84 = texture2DLodEXT (_MainTex, posP_20, 0.0); highp vec4 rgba_85; rgba_85 = tmpvar_84; - lumaEndP_5 = rgba_85.w; + lumaEndP_16 = rgba_85.w; }; - if (!(tmpvar_79)) { - lumaEndN_6 = (lumaEndN_6 - (lumaNN_10 * 0.5)); + if (!(doneN_12)) { + lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5)); }; - if (!(tmpvar_80)) { - lumaEndP_5 = (lumaEndP_5 - (lumaNN_10 * 0.5)); + if (!(doneP_11)) { + lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5)); }; - bool tmpvar_86; - tmpvar_86 = (abs(lumaEndN_6) >= tmpvar_67); - bool tmpvar_87; - tmpvar_87 = (abs(lumaEndP_5) >= tmpvar_67); - if (!(tmpvar_86)) { - posN_8.x = (posN_8.x - tmpvar_59); + doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15); + doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15); + if (!(doneN_12)) { + posN_21.x = (posN_21.x - tmpvar_72); }; - if (!(tmpvar_86)) { - posN_8.y = (posN_8.y - tmpvar_60); + if (!(doneN_12)) { + posN_21.y = (posN_21.y - tmpvar_73); }; - bool tmpvar_88; - tmpvar_88 = !((tmpvar_86 && tmpvar_87)); - if (!(tmpvar_87)) { - posP_7.x = (posP_7.x + tmpvar_59); + doneNP_10 = !((doneN_12 && doneP_11)); + if (!(doneP_11)) { + posP_20.x = (posP_20.x + tmpvar_72); }; - if (!(tmpvar_87)) { - posP_7.y = (posP_7.y + tmpvar_60); + if (!(doneP_11)) { + posP_20.y = (posP_20.y + tmpvar_73); }; - if (tmpvar_88) { - if (!(tmpvar_86)) { - lowp vec4 tmpvar_89; - tmpvar_89 = texture2DLodEXT (_MainTex, posN_8, 0.0); - highp vec4 rgba_90; - rgba_90 = tmpvar_89; - lumaEndN_6 = rgba_90.w; + if (doneNP_10) { + if (!(doneN_12)) { + lowp vec4 tmpvar_86; + tmpvar_86 = texture2DLodEXT (_MainTex, posN_21, 0.0); + highp vec4 rgba_87; + rgba_87 = tmpvar_86; + lumaEndN_18 = rgba_87.w; }; - if (!(tmpvar_87)) { - lowp vec4 tmpvar_91; - tmpvar_91 = texture2DLodEXT (_MainTex, posP_7, 0.0); - highp vec4 rgba_92; - rgba_92 = tmpvar_91; - lumaEndP_5 = rgba_92.w; + if (!(doneP_11)) { + lowp vec4 tmpvar_88; + tmpvar_88 = texture2DLodEXT (_MainTex, posP_20, 0.0); + highp vec4 rgba_89; + rgba_89 = tmpvar_88; + lumaEndP_16 = rgba_89.w; }; - if (!(tmpvar_86)) { - lumaEndN_6 = (lumaEndN_6 - (lumaNN_10 * 0.5)); + if (!(doneN_12)) { + lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5)); }; - if (!(tmpvar_87)) { - lumaEndP_5 = (lumaEndP_5 - (lumaNN_10 * 0.5)); + if (!(doneP_11)) { + lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5)); }; - bool tmpvar_93; - tmpvar_93 = (abs(lumaEndN_6) >= tmpvar_67); - bool tmpvar_94; - tmpvar_94 = (abs(lumaEndP_5) >= tmpvar_67); - if (!(tmpvar_93)) { - posN_8.x = (posN_8.x - tmpvar_59); + doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15); + doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15); + if (!(doneN_12)) { + posN_21.x = (posN_21.x - tmpvar_72); }; - if (!(tmpvar_93)) { - posN_8.y = (posN_8.y - tmpvar_60); + if (!(doneN_12)) { + posN_21.y = (posN_21.y - tmpvar_73); }; - bool tmpvar_95; - tmpvar_95 = !((tmpvar_93 && tmpvar_94)); - if (!(tmpvar_94)) { - posP_7.x = (posP_7.x + tmpvar_59); + doneNP_10 = !((doneN_12 && doneP_11)); + if (!(doneP_11)) { + posP_20.x = (posP_20.x + tmpvar_72); }; - if (!(tmpvar_94)) { - posP_7.y = (posP_7.y + tmpvar_60); + if (!(doneP_11)) { + posP_20.y = (posP_20.y + tmpvar_73); }; - if (tmpvar_95) { - if (!(tmpvar_93)) { - lowp vec4 tmpvar_96; - tmpvar_96 = texture2DLodEXT (_MainTex, posN_8, 0.0); - highp vec4 rgba_97; - rgba_97 = tmpvar_96; - lumaEndN_6 = rgba_97.w; + if (doneNP_10) { + if (!(doneN_12)) { + lowp vec4 tmpvar_90; + tmpvar_90 = texture2DLodEXT (_MainTex, posN_21, 0.0); + highp vec4 rgba_91; + rgba_91 = tmpvar_90; + lumaEndN_18 = rgba_91.w; }; - if (!(tmpvar_94)) { - lowp vec4 tmpvar_98; - tmpvar_98 = texture2DLodEXT (_MainTex, posP_7, 0.0); - highp vec4 rgba_99; - rgba_99 = tmpvar_98; - lumaEndP_5 = rgba_99.w; + if (!(doneP_11)) { + lowp vec4 tmpvar_92; + tmpvar_92 = texture2DLodEXT (_MainTex, posP_20, 0.0); + highp vec4 rgba_93; + rgba_93 = tmpvar_92; + lumaEndP_16 = rgba_93.w; }; - if (!(tmpvar_93)) { - lumaEndN_6 = (lumaEndN_6 - (lumaNN_10 * 0.5)); + if (!(doneN_12)) { + lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5)); }; - if (!(tmpvar_94)) { - lumaEndP_5 = (lumaEndP_5 - (lumaNN_10 * 0.5)); + if (!(doneP_11)) { + lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5)); }; - bool tmpvar_100; - tmpvar_100 = (abs(lumaEndN_6) >= tmpvar_67); - bool tmpvar_101; - tmpvar_101 = (abs(lumaEndP_5) >= tmpvar_67); - if (!(tmpvar_100)) { - posN_8.x = (posN_8.x - (tmpvar_59 * 1.5)); + doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15); + doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15); + if (!(doneN_12)) { + posN_21.x = (posN_21.x - (tmpvar_72 * 1.5)); }; - if (!(tmpvar_100)) { - posN_8.y = (posN_8.y - (tmpvar_60 * 1.5)); + if (!(doneN_12)) { + posN_21.y = (posN_21.y - (tmpvar_73 * 1.5)); }; - bool tmpvar_102; - tmpvar_102 = !((tmpvar_100 && tmpvar_101)); - if (!(tmpvar_101)) { - posP_7.x = (posP_7.x + (tmpvar_59 * 1.5)); + doneNP_10 = !((doneN_12 && doneP_11)); + if (!(doneP_11)) { + posP_20.x = (posP_20.x + (tmpvar_72 * 1.5)); }; - if (!(tmpvar_101)) { - posP_7.y = (posP_7.y + (tmpvar_60 * 1.5)); + if (!(doneP_11)) { + posP_20.y = (posP_20.y + (tmpvar_73 * 1.5)); }; - if (tmpvar_102) { - if (!(tmpvar_100)) { - lowp vec4 tmpvar_103; - tmpvar_103 = texture2DLodEXT (_MainTex, posN_8, 0.0); - highp vec4 rgba_104; - rgba_104 = tmpvar_103; - lumaEndN_6 = rgba_104.w; + if (doneNP_10) { + if (!(doneN_12)) { + lowp vec4 tmpvar_94; + tmpvar_94 = texture2DLodEXT (_MainTex, posN_21, 0.0); + highp vec4 rgba_95; + rgba_95 = tmpvar_94; + lumaEndN_18 = rgba_95.w; }; - if (!(tmpvar_101)) { - lowp vec4 tmpvar_105; - tmpvar_105 = texture2DLodEXT (_MainTex, posP_7, 0.0); - highp vec4 rgba_106; - rgba_106 = tmpvar_105; - lumaEndP_5 = rgba_106.w; + if (!(doneP_11)) { + lowp vec4 tmpvar_96; + tmpvar_96 = texture2DLodEXT (_MainTex, posP_20, 0.0); + highp vec4 rgba_97; + rgba_97 = tmpvar_96; + lumaEndP_16 = rgba_97.w; }; - if (!(tmpvar_100)) { - lumaEndN_6 = (lumaEndN_6 - (lumaNN_10 * 0.5)); + if (!(doneN_12)) { + lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5)); }; - if (!(tmpvar_101)) { - lumaEndP_5 = (lumaEndP_5 - (lumaNN_10 * 0.5)); + if (!(doneP_11)) { + lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5)); }; - bool tmpvar_107; - tmpvar_107 = (abs(lumaEndN_6) >= tmpvar_67); - bool tmpvar_108; - tmpvar_108 = (abs(lumaEndP_5) >= tmpvar_67); - if (!(tmpvar_107)) { - posN_8.x = (posN_8.x - (tmpvar_59 * 2.0)); + doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15); + doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15); + if (!(doneN_12)) { + posN_21.x = (posN_21.x - (tmpvar_72 * 2.0)); }; - if (!(tmpvar_107)) { - posN_8.y = (posN_8.y - (tmpvar_60 * 2.0)); + if (!(doneN_12)) { + posN_21.y = (posN_21.y - (tmpvar_73 * 2.0)); }; - bool tmpvar_109; - tmpvar_109 = !((tmpvar_107 && tmpvar_108)); - if (!(tmpvar_108)) { - posP_7.x = (posP_7.x + (tmpvar_59 * 2.0)); + doneNP_10 = !((doneN_12 && doneP_11)); + if (!(doneP_11)) { + posP_20.x = (posP_20.x + (tmpvar_72 * 2.0)); }; - if (!(tmpvar_108)) { - posP_7.y = (posP_7.y + (tmpvar_60 * 2.0)); + if (!(doneP_11)) { + posP_20.y = (posP_20.y + (tmpvar_73 * 2.0)); }; - if (tmpvar_109) { - if (!(tmpvar_107)) { - lowp vec4 tmpvar_110; - tmpvar_110 = texture2DLodEXT (_MainTex, posN_8, 0.0); - highp vec4 rgba_111; - rgba_111 = tmpvar_110; - lumaEndN_6 = rgba_111.w; + if (doneNP_10) { + if (!(doneN_12)) { + lowp vec4 tmpvar_98; + tmpvar_98 = texture2DLodEXT (_MainTex, posN_21, 0.0); + highp vec4 rgba_99; + rgba_99 = tmpvar_98; + lumaEndN_18 = rgba_99.w; }; - if (!(tmpvar_108)) { - lowp vec4 tmpvar_112; - tmpvar_112 = texture2DLodEXT (_MainTex, posP_7, 0.0); - highp vec4 rgba_113; - rgba_113 = tmpvar_112; - lumaEndP_5 = rgba_113.w; + if (!(doneP_11)) { + lowp vec4 tmpvar_100; + tmpvar_100 = texture2DLodEXT (_MainTex, posP_20, 0.0); + highp vec4 rgba_101; + rgba_101 = tmpvar_100; + lumaEndP_16 = rgba_101.w; }; - if (!(tmpvar_107)) { - lumaEndN_6 = (lumaEndN_6 - (lumaNN_10 * 0.5)); + if (!(doneN_12)) { + lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5)); }; - if (!(tmpvar_108)) { - lumaEndP_5 = (lumaEndP_5 - (lumaNN_10 * 0.5)); + if (!(doneP_11)) { + lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5)); }; - bool tmpvar_114; - tmpvar_114 = (abs(lumaEndN_6) >= tmpvar_67); - bool tmpvar_115; - tmpvar_115 = (abs(lumaEndP_5) >= tmpvar_67); - if (!(tmpvar_114)) { - posN_8.x = (posN_8.x - (tmpvar_59 * 2.0)); + doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15); + doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15); + if (!(doneN_12)) { + posN_21.x = (posN_21.x - (tmpvar_72 * 2.0)); }; - if (!(tmpvar_114)) { - posN_8.y = (posN_8.y - (tmpvar_60 * 2.0)); + if (!(doneN_12)) { + posN_21.y = (posN_21.y - (tmpvar_73 * 2.0)); }; - bool tmpvar_116; - tmpvar_116 = !((tmpvar_114 && tmpvar_115)); - if (!(tmpvar_115)) { - posP_7.x = (posP_7.x + (tmpvar_59 * 2.0)); + doneNP_10 = !((doneN_12 && doneP_11)); + if (!(doneP_11)) { + posP_20.x = (posP_20.x + (tmpvar_72 * 2.0)); }; - if (!(tmpvar_115)) { - posP_7.y = (posP_7.y + (tmpvar_60 * 2.0)); + if (!(doneP_11)) { + posP_20.y = (posP_20.y + (tmpvar_73 * 2.0)); }; - if (tmpvar_116) { - if (!(tmpvar_114)) { - lowp vec4 tmpvar_117; - tmpvar_117 = texture2DLodEXT (_MainTex, posN_8, 0.0); - highp vec4 rgba_118; - rgba_118 = tmpvar_117; - lumaEndN_6 = rgba_118.w; + if (doneNP_10) { + if (!(doneN_12)) { + lowp vec4 tmpvar_102; + tmpvar_102 = texture2DLodEXT (_MainTex, posN_21, 0.0); + highp vec4 rgba_103; + rgba_103 = tmpvar_102; + lumaEndN_18 = rgba_103.w; }; - if (!(tmpvar_115)) { - lowp vec4 tmpvar_119; - tmpvar_119 = texture2DLodEXT (_MainTex, posP_7, 0.0); - highp vec4 rgba_120; - rgba_120 = tmpvar_119; - lumaEndP_5 = rgba_120.w; + if (!(doneP_11)) { + lowp vec4 tmpvar_104; + tmpvar_104 = texture2DLodEXT (_MainTex, posP_20, 0.0); + highp vec4 rgba_105; + rgba_105 = tmpvar_104; + lumaEndP_16 = rgba_105.w; }; - if (!(tmpvar_114)) { - lumaEndN_6 = (lumaEndN_6 - (lumaNN_10 * 0.5)); + if (!(doneN_12)) { + lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5)); }; - if (!(tmpvar_115)) { - lumaEndP_5 = (lumaEndP_5 - (lumaNN_10 * 0.5)); + if (!(doneP_11)) { + lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5)); }; - bool tmpvar_121; - tmpvar_121 = (abs(lumaEndN_6) >= tmpvar_67); - bool tmpvar_122; - tmpvar_122 = (abs(lumaEndP_5) >= tmpvar_67); - if (!(tmpvar_121)) { - posN_8.x = (posN_8.x - (tmpvar_59 * 2.0)); + doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15); + doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15); + if (!(doneN_12)) { + posN_21.x = (posN_21.x - (tmpvar_72 * 2.0)); }; - if (!(tmpvar_121)) { - posN_8.y = (posN_8.y - (tmpvar_60 * 2.0)); + if (!(doneN_12)) { + posN_21.y = (posN_21.y - (tmpvar_73 * 2.0)); }; - bool tmpvar_123; - tmpvar_123 = !((tmpvar_121 && tmpvar_122)); - if (!(tmpvar_122)) { - posP_7.x = (posP_7.x + (tmpvar_59 * 2.0)); + doneNP_10 = !((doneN_12 && doneP_11)); + if (!(doneP_11)) { + posP_20.x = (posP_20.x + (tmpvar_72 * 2.0)); }; - if (!(tmpvar_122)) { - posP_7.y = (posP_7.y + (tmpvar_60 * 2.0)); + if (!(doneP_11)) { + posP_20.y = (posP_20.y + (tmpvar_73 * 2.0)); }; - if (tmpvar_123) { - if (!(tmpvar_121)) { - lowp vec4 tmpvar_124; - tmpvar_124 = texture2DLodEXT (_MainTex, posN_8, 0.0); - highp vec4 rgba_125; - rgba_125 = tmpvar_124; - lumaEndN_6 = rgba_125.w; + if (doneNP_10) { + if (!(doneN_12)) { + lowp vec4 tmpvar_106; + tmpvar_106 = texture2DLodEXT (_MainTex, posN_21, 0.0); + highp vec4 rgba_107; + rgba_107 = tmpvar_106; + lumaEndN_18 = rgba_107.w; }; - if (!(tmpvar_122)) { - lowp vec4 tmpvar_126; - tmpvar_126 = texture2DLodEXT (_MainTex, posP_7, 0.0); - highp vec4 rgba_127; - rgba_127 = tmpvar_126; - lumaEndP_5 = rgba_127.w; + if (!(doneP_11)) { + lowp vec4 tmpvar_108; + tmpvar_108 = texture2DLodEXT (_MainTex, posP_20, 0.0); + highp vec4 rgba_109; + rgba_109 = tmpvar_108; + lumaEndP_16 = rgba_109.w; }; - if (!(tmpvar_121)) { - lumaEndN_6 = (lumaEndN_6 - (lumaNN_10 * 0.5)); + if (!(doneN_12)) { + lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5)); }; - if (!(tmpvar_122)) { - lumaEndP_5 = (lumaEndP_5 - (lumaNN_10 * 0.5)); + if (!(doneP_11)) { + lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5)); }; - bool tmpvar_128; - tmpvar_128 = (abs(lumaEndN_6) >= tmpvar_67); - bool tmpvar_129; - tmpvar_129 = (abs(lumaEndP_5) >= tmpvar_67); - if (!(tmpvar_128)) { - posN_8.x = (posN_8.x - (tmpvar_59 * 2.0)); + doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15); + doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15); + if (!(doneN_12)) { + posN_21.x = (posN_21.x - (tmpvar_72 * 2.0)); }; - if (!(tmpvar_128)) { - posN_8.y = (posN_8.y - (tmpvar_60 * 2.0)); + if (!(doneN_12)) { + posN_21.y = (posN_21.y - (tmpvar_73 * 2.0)); }; - bool tmpvar_130; - tmpvar_130 = !((tmpvar_128 && tmpvar_129)); - if (!(tmpvar_129)) { - posP_7.x = (posP_7.x + (tmpvar_59 * 2.0)); + doneNP_10 = !((doneN_12 && doneP_11)); + if (!(doneP_11)) { + posP_20.x = (posP_20.x + (tmpvar_72 * 2.0)); }; - if (!(tmpvar_129)) { - posP_7.y = (posP_7.y + (tmpvar_60 * 2.0)); + if (!(doneP_11)) { + posP_20.y = (posP_20.y + (tmpvar_73 * 2.0)); }; - if (tmpvar_130) { - if (!(tmpvar_128)) { - lowp vec4 tmpvar_131; - tmpvar_131 = texture2DLodEXT (_MainTex, posN_8, 0.0); - highp vec4 rgba_132; - rgba_132 = tmpvar_131; - lumaEndN_6 = rgba_132.w; + if (doneNP_10) { + if (!(doneN_12)) { + lowp vec4 tmpvar_110; + tmpvar_110 = texture2DLodEXT (_MainTex, posN_21, 0.0); + highp vec4 rgba_111; + rgba_111 = tmpvar_110; + lumaEndN_18 = rgba_111.w; }; - if (!(tmpvar_129)) { - lowp vec4 tmpvar_133; - tmpvar_133 = texture2DLodEXT (_MainTex, posP_7, 0.0); - highp vec4 rgba_134; - rgba_134 = tmpvar_133; - lumaEndP_5 = rgba_134.w; + if (!(doneP_11)) { + lowp vec4 tmpvar_112; + tmpvar_112 = texture2DLodEXT (_MainTex, posP_20, 0.0); + highp vec4 rgba_113; + rgba_113 = tmpvar_112; + lumaEndP_16 = rgba_113.w; }; - if (!(tmpvar_128)) { - lumaEndN_6 = (lumaEndN_6 - (lumaNN_10 * 0.5)); + if (!(doneN_12)) { + lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5)); }; - if (!(tmpvar_129)) { - lumaEndP_5 = (lumaEndP_5 - (lumaNN_10 * 0.5)); + if (!(doneP_11)) { + lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5)); }; - bool tmpvar_135; - tmpvar_135 = (abs(lumaEndN_6) >= tmpvar_67); - bool tmpvar_136; - tmpvar_136 = (abs(lumaEndP_5) >= tmpvar_67); - if (!(tmpvar_135)) { - posN_8.x = (posN_8.x - (tmpvar_59 * 4.0)); + doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15); + doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15); + if (!(doneN_12)) { + posN_21.x = (posN_21.x - (tmpvar_72 * 4.0)); }; - if (!(tmpvar_135)) { - posN_8.y = (posN_8.y - (tmpvar_60 * 4.0)); + if (!(doneN_12)) { + posN_21.y = (posN_21.y - (tmpvar_73 * 4.0)); }; - bool tmpvar_137; - tmpvar_137 = !((tmpvar_135 && tmpvar_136)); - if (!(tmpvar_136)) { - posP_7.x = (posP_7.x + (tmpvar_59 * 4.0)); + doneNP_10 = !((doneN_12 && doneP_11)); + if (!(doneP_11)) { + posP_20.x = (posP_20.x + (tmpvar_72 * 4.0)); }; - if (!(tmpvar_136)) { - posP_7.y = (posP_7.y + (tmpvar_60 * 4.0)); + if (!(doneP_11)) { + posP_20.y = (posP_20.y + (tmpvar_73 * 4.0)); }; - if (tmpvar_137) { - if (!(tmpvar_135)) { - lowp vec4 tmpvar_138; - tmpvar_138 = texture2DLodEXT (_MainTex, posN_8, 0.0); - highp vec4 rgba_139; - rgba_139 = tmpvar_138; - lumaEndN_6 = rgba_139.w; + if (doneNP_10) { + if (!(doneN_12)) { + lowp vec4 tmpvar_114; + tmpvar_114 = texture2DLodEXT (_MainTex, posN_21, 0.0); + highp vec4 rgba_115; + rgba_115 = tmpvar_114; + lumaEndN_18 = rgba_115.w; }; - if (!(tmpvar_136)) { - lowp vec4 tmpvar_140; - tmpvar_140 = texture2DLodEXT (_MainTex, posP_7, 0.0); - highp vec4 rgba_141; - rgba_141 = tmpvar_140; - lumaEndP_5 = rgba_141.w; + if (!(doneP_11)) { + lowp vec4 tmpvar_116; + tmpvar_116 = texture2DLodEXT (_MainTex, posP_20, 0.0); + highp vec4 rgba_117; + rgba_117 = tmpvar_116; + lumaEndP_16 = rgba_117.w; }; - if (!(tmpvar_135)) { - lumaEndN_6 = (lumaEndN_6 - (lumaNN_10 * 0.5)); + if (!(doneN_12)) { + lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5)); }; - if (!(tmpvar_136)) { - lumaEndP_5 = (lumaEndP_5 - (lumaNN_10 * 0.5)); + if (!(doneP_11)) { + lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5)); }; - bool tmpvar_142; - tmpvar_142 = (abs(lumaEndN_6) >= tmpvar_67); - bool tmpvar_143; - tmpvar_143 = (abs(lumaEndP_5) >= tmpvar_67); - if (!(tmpvar_142)) { - posN_8.x = (posN_8.x - (tmpvar_59 * 8.0)); + doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15); + doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15); + if (!(doneN_12)) { + posN_21.x = (posN_21.x - (tmpvar_72 * 8.0)); }; - if (!(tmpvar_142)) { - posN_8.y = (posN_8.y - (tmpvar_60 * 8.0)); + if (!(doneN_12)) { + posN_21.y = (posN_21.y - (tmpvar_73 * 8.0)); }; - if (!(tmpvar_143)) { - posP_7.x = (posP_7.x + (tmpvar_59 * 8.0)); + doneNP_10 = !((doneN_12 && doneP_11)); + if (!(doneP_11)) { + posP_20.x = (posP_20.x + (tmpvar_72 * 8.0)); }; - if (!(tmpvar_143)) { - posP_7.y = (posP_7.y + (tmpvar_60 * 8.0)); + if (!(doneP_11)) { + posP_20.y = (posP_20.y + (tmpvar_73 * 8.0)); }; }; }; @@ -617,55 +590,56 @@ void main () }; }; }; - dstN_4 = (xlv_TEXCOORD0.x - posN_8.x); - dstP_3 = (posP_7.x - xlv_TEXCOORD0.x); - if (!(tmpvar_50)) { - dstN_4 = (xlv_TEXCOORD0.y - posN_8.y); + dstN_9 = (xlv_TEXCOORD0.x - posN_21.x); + dstP_8 = (posP_20.x - xlv_TEXCOORD0.x); + if (!(horzSpan_30)) { + dstN_9 = (xlv_TEXCOORD0.y - posN_21.y); }; - if (!(tmpvar_50)) { - dstP_3 = (posP_7.y - xlv_TEXCOORD0.y); + if (!(horzSpan_30)) { + dstP_8 = (posP_20.y - xlv_TEXCOORD0.y); }; - bool tmpvar_144; - tmpvar_144 = ((lumaEndN_6 < 0.0) != tmpvar_69); - bool tmpvar_145; - tmpvar_145 = ((lumaEndP_5 < 0.0) != tmpvar_69); - highp float tmpvar_146; - tmpvar_146 = (1.0/((dstP_3 + dstN_4))); - highp float tmpvar_147; - tmpvar_147 = min (dstN_4, dstP_3); - bool tmpvar_148; - if ((dstN_4 < dstP_3)) { - tmpvar_148 = tmpvar_144; + goodSpanN_7 = ((lumaEndN_18 < 0.0) != lumaMLTZero_13); + goodSpanP_6 = ((lumaEndP_16 < 0.0) != lumaMLTZero_13); + spanLengthRcp_5 = (1.0/((dstP_8 + dstN_9))); + highp float tmpvar_118; + tmpvar_118 = min (dstN_9, dstP_8); + bool tmpvar_119; + if ((dstN_9 < dstP_8)) { + tmpvar_119 = goodSpanN_7; } else { - tmpvar_148 = tmpvar_145; + tmpvar_119 = goodSpanP_6; }; - highp float tmpvar_149; - tmpvar_149 = ((tmpvar_147 * -(tmpvar_146)) + 0.5); - highp float tmpvar_150; - tmpvar_150 = ((tmpvar_68 * tmpvar_68) * 0.75); - highp float tmpvar_151; - if (tmpvar_148) { - tmpvar_151 = tmpvar_149; + pixelOffset_4 = ((tmpvar_118 * -(spanLengthRcp_5)) + 0.5); + subpixH_3 = ((subpixF_14 * subpixF_14) * 0.75); + highp float tmpvar_120; + if (tmpvar_119) { + tmpvar_120 = pixelOffset_4; } else { - tmpvar_151 = 0.0; + tmpvar_120 = 0.0; }; - highp float tmpvar_152; - tmpvar_152 = max (tmpvar_151, tmpvar_150); - if (!(tmpvar_50)) { - posM_15.x = (xlv_TEXCOORD0.x + (tmpvar_152 * lengthSign_11)); + highp float tmpvar_121; + tmpvar_121 = max (tmpvar_120, subpixH_3); + if (!(horzSpan_30)) { + posM_41.x = (xlv_TEXCOORD0.x + (tmpvar_121 * lengthSign_31)); }; - if (tmpvar_50) { - posM_15.y = (xlv_TEXCOORD0.y + (tmpvar_152 * lengthSign_11)); + if (horzSpan_30) { + posM_41.y = (xlv_TEXCOORD0.y + (tmpvar_121 * lengthSign_31)); }; - lowp vec4 tmpvar_153; - tmpvar_153 = texture2DLodEXT (_MainTex, posM_15, 0.0); - highp vec4 tmpvar_154; - tmpvar_154.xyz = tmpvar_153.xyz; - tmpvar_154.w = rgbyM_14.w; - tmpvar_2 = tmpvar_154; + lowp vec4 tmpvar_122; + tmpvar_122 = texture2DLodEXT (_MainTex, posM_41, 0.0); + highp vec4 tmpvar_123; + tmpvar_123.xyz = tmpvar_122.xyz; + tmpvar_123.w = rgbyM_40.w; + tmpvar_2 = tmpvar_123; }; gl_FragData[0] = tmpvar_2; } -// inputs: 1, stats: 399 alu 32 tex 110 flow +// stats: 401 alu 32 tex 110 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// uniforms: 1 (total size: 0) +// #0: _MainTex_TexelSize (high float) 4x1 [-1] +// textures: 1 +// #0: _MainTex (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-particle-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/z-particle-ir.txt deleted file mode 100644 index 3e6360d9d..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/z-particle-ir.txt +++ /dev/null @@ -1,46 +0,0 @@ -struct v2f { - vec4 vertex; - vec4 color; - vec2 texcoord; -}; -uniform sampler2D _MainTex; -varying vec4 xlv_COLOR; -varying vec2 xlv_TEXCOORD0; -vec4 xlat_main ( - in v2f i_1 -) -{ - vec4 tmpvar_2; - tmpvar_2 = texture2D (_MainTex, i_1.texcoord); - return (i_1.color * tmpvar_2); -} - -void main () -{ - v2f xlt_i_3; - vec4 xl_retval_4; - vec4 tmpvar_5; - tmpvar_5 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_3.vertex = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6 = xlv_COLOR.xyzw; - vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - xlt_i_3.color = tmpvar_7; - vec2 tmpvar_8; - tmpvar_8 = xlv_TEXCOORD0.xy; - vec2 tmpvar_9; - tmpvar_9 = tmpvar_8; - xlt_i_3.texcoord = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10 = xlat_main (xlt_i_3); - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - xl_retval_4 = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12 = xl_retval_4.xyzw; - vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - gl_FragData[0] = tmpvar_13; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-particle-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-particle-irES.txt deleted file mode 100644 index bea978475..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/z-particle-irES.txt +++ /dev/null @@ -1,46 +0,0 @@ -struct v2f { - highp vec4 vertex; - lowp vec4 color; - mediump vec2 texcoord; -}; -uniform sampler2D _MainTex; -varying lowp vec4 xlv_COLOR; -varying mediump vec2 xlv_TEXCOORD0; -lowp vec4 xlat_main ( - in v2f i_1 -) -{ - lowp vec4 tmpvar_2; - tmpvar_2 = texture2D (_MainTex, i_1.texcoord); - return (i_1.color * tmpvar_2); -} - -void main () -{ - v2f xlt_i_3; - lowp vec4 xl_retval_4; - mediump vec4 tmpvar_5; - tmpvar_5 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_3.vertex = tmpvar_5; - lowp vec4 tmpvar_6; - tmpvar_6 = xlv_COLOR.xyzw; - lowp vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - xlt_i_3.color = tmpvar_7; - mediump vec2 tmpvar_8; - tmpvar_8 = xlv_TEXCOORD0.xy; - mediump vec2 tmpvar_9; - tmpvar_9 = tmpvar_8; - xlt_i_3.texcoord = tmpvar_9; - lowp vec4 tmpvar_10; - tmpvar_10 = xlat_main (xlt_i_3); - lowp vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - xl_retval_4 = tmpvar_11; - lowp vec4 tmpvar_12; - tmpvar_12 = xl_retval_4.xyzw; - lowp vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - gl_FragData[0] = tmpvar_13; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-particle-out.txt b/3rdparty/glsl-optimizer/tests/fragment/z-particle-out.txt index 0322d1e5f..309a8b5e2 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-particle-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-particle-out.txt @@ -7,4 +7,9 @@ void main () } -// inputs: 2, stats: 1 alu 1 tex 0 flow +// stats: 1 alu 1 tex 0 flow +// inputs: 2 +// #0: xlv_COLOR (high float) 4x1 [-1] +// #1: xlv_TEXCOORD0 (high float) 2x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-particle-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-particle-outES.txt index d717abc92..6cf830a7b 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-particle-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-particle-outES.txt @@ -9,4 +9,9 @@ void main () } -// inputs: 2, stats: 1 alu 1 tex 0 flow +// stats: 1 alu 1 tex 0 flow +// inputs: 2 +// #0: xlv_COLOR (low float) 4x1 [-1] +// #1: xlv_TEXCOORD0 (medium float) 2x1 [-1] +// textures: 1 +// #0: _MainTex (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-inES3.txt new file mode 100644 index 000000000..f5cd5e659 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-inES3.txt @@ -0,0 +1,147 @@ +#version 300 es +out mediump vec4 _fragData; +float xll_saturate( float x) { + return clamp( x, 0.0, 1.0); +} +vec2 xll_saturate( vec2 x) { + return clamp( x, 0.0, 1.0); +} +vec3 xll_saturate( vec3 x) { + return clamp( x, 0.0, 1.0); +} +vec4 xll_saturate( vec4 x) { + return clamp( x, 0.0, 1.0); +} +mat2 xll_saturate(mat2 m) { + return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0)); +} +mat3 xll_saturate(mat3 m) { + return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0)); +} +mat4 xll_saturate(mat4 m) { + return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0)); +} +vec2 xll_vecTSel (bvec2 a, vec2 b, vec2 c) { + return vec2 (a.x ? b.x : c.x, a.y ? b.y : c.y); +} +vec3 xll_vecTSel (bvec3 a, vec3 b, vec3 c) { + return vec3 (a.x ? b.x : c.x, a.y ? b.y : c.y, a.z ? b.z : c.z); +} +vec4 xll_vecTSel (bvec4 a, vec4 b, vec4 c) { + return vec4 (a.x ? b.x : c.x, a.y ? b.y : c.y, a.z ? b.z : c.z, a.w ? b.w : c.w); +} +struct v2f { + highp vec4 pos; + highp vec4 uv; + highp vec3 ray; +}; +uniform sampler2D _CameraDepthTexture; +uniform sampler2D _CameraNormalsTexture; +uniform highp mat4 _CameraToWorld; +uniform highp vec4 _LightColor; +uniform highp mat4 _LightMatrix0; +uniform highp vec4 _LightPos; +uniform highp vec4 _LightPositionRange; +uniform highp vec4 _LightShadowData; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform highp vec4 _ProjectionParams; +uniform samplerCube _ShadowMapTexture; +uniform highp vec3 _WorldSpaceCameraPos; +uniform highp vec4 _ZBufferParams; +uniform highp vec4 unity_LightmapFade; +mediump float Luminance( in mediump vec3 c ); +highp float Linear01Depth( in highp float z ); +highp float DecodeFloatRGBA( in highp vec4 enc ); +highp float SampleCubeDistance( in highp vec3 vec ); +mediump float unitySampleShadow( in highp vec3 vec, in highp float mydist ); +mediump float ComputeShadow( in highp vec3 vec, in highp float z, in highp vec2 uv ); +mediump vec4 xlat_main( in v2f i ); +mediump float Luminance( in mediump vec3 c ) { + return dot( c, vec3( 0.220000, 0.707000, 0.0710000)); +} +highp float Linear01Depth( in highp float z ) { + return (1.00000 / ((_ZBufferParams.x * z) + _ZBufferParams.y )); +} +highp float DecodeFloatRGBA( in highp vec4 enc ) { + highp vec4 kDecodeDot = vec4( 1.00000, 0.00392157, 1.53787e-005, 6.22737e-009); + return dot( enc, kDecodeDot); +} +highp float SampleCubeDistance( in highp vec3 vec ) { + highp vec4 packDist; + packDist = textureCube( _ShadowMapTexture, vec); + return DecodeFloatRGBA( packDist); +} +mediump float unitySampleShadow( in highp vec3 vec, in highp float mydist ) { + highp float z = 0.00781250; + highp vec4 shadowVals; + mediump vec4 shadows; + shadowVals.x = SampleCubeDistance( (vec + vec3( z, z, z))); + shadowVals.y = SampleCubeDistance( (vec + vec3( ( -z ), ( -z ), z))); + shadowVals.z = SampleCubeDistance( (vec + vec3( ( -z ), z, ( -z )))); + shadowVals.w = SampleCubeDistance( (vec + vec3( z, ( -z ), ( -z )))); + shadows = xll_vecTSel (lessThan( shadowVals, vec4( vec4( mydist) )), vec4( _LightShadowData.xxxx ), vec4( 1.00000)); + return dot( shadows, vec4( 0.250000)); +} +mediump float ComputeShadow( in highp vec3 vec, in highp float z, in highp vec2 uv ) { + highp float fade; + highp float mydist; + fade = ((z * _LightShadowData.z ) + _LightShadowData.w ); + fade = xll_saturate( fade ); + mydist = (length( vec ) * _LightPositionRange.w ); + mydist *= 0.970000; + return unitySampleShadow( vec, mydist); + return 1.00000; +} +mediump vec4 xlat_main( in v2f i ) { + highp vec2 uv; + mediump vec4 nspec; + mediump vec3 normal; + highp float depth; + highp vec4 vpos; + highp vec3 wpos; + highp vec3 tolight; + mediump vec3 lightDir; + highp float att; + highp float atten; + mediump float diff; + mediump vec3 h; + highp float spec; + mediump vec4 res; + highp float fade; + i.ray = (i.ray * (_ProjectionParams.z / i.ray.z )); + uv = (i.uv.xy / i.uv.w ); + nspec = texture2D( _CameraNormalsTexture, uv); + normal = ((nspec.xyz * 2.00000) - 1.00000); + normal = normalize( normal ); + depth = texture2D( _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 *= ComputeShadow( tolight, vpos.z , uv); + atten *= textureCube( _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)); + spec *= xll_saturate( atten ); + res.xyz = (_LightColor.xyz * (diff * atten)); + res.w = (spec * Luminance( _LightColor.xyz )); + fade = ((vpos.z * unity_LightmapFade.z ) + unity_LightmapFade.w ); + res *= xll_saturate( (1.00000 - fade) ); + return exp2( ( -res ) ); +} +in highp vec4 xlv_TEXCOORD0; +in highp vec3 xlv_TEXCOORD1; +void main() { + mediump vec4 xl_retval; + v2f xlt_i; + xlt_i.pos = vec4(0.0); + xlt_i.uv = vec4( xlv_TEXCOORD0); + xlt_i.ray = vec3( xlv_TEXCOORD1); + xl_retval = xlat_main( xlt_i); + _fragData = vec4( xl_retval); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-ir.txt deleted file mode 100644 index 309717b6e..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-ir.txt +++ /dev/null @@ -1,529 +0,0 @@ -struct v2f { - vec4 pos; - vec4 uv; - vec3 ray; -}; -uniform sampler2D _CameraDepthTexture; -uniform sampler2D _CameraNormalsTexture; -uniform mat4 _CameraToWorld; -uniform vec4 _LightColor; -uniform mat4 _LightMatrix0; -uniform vec4 _LightPos; -uniform vec4 _LightPositionRange; -uniform vec4 _LightShadowData; -uniform samplerCube _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform vec4 _ProjectionParams; -uniform samplerCube _ShadowMapTexture; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _ZBufferParams; -uniform vec4 unity_LightmapFade; -varying vec4 xlv_TEXCOORD0; -varying vec3 xlv_TEXCOORD1; -float xll_saturate ( - in float x_1 -) -{ - float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -vec2 xll_saturate ( - in vec2 x_3 -) -{ - vec2 tmpvar_4; - tmpvar_4 = clamp (x_3, 0.0, 1.0); - return tmpvar_4; -} - -vec3 xll_saturate ( - in vec3 x_5 -) -{ - vec3 tmpvar_6; - tmpvar_6 = clamp (x_5, 0.0, 1.0); - return tmpvar_6; -} - -vec4 xll_saturate ( - in vec4 x_7 -) -{ - vec4 tmpvar_8; - tmpvar_8 = clamp (x_7, 0.0, 1.0); - return tmpvar_8; -} - -mat2 xll_saturate ( - in mat2 m_9 -) -{ - vec2 tmpvar_10; - tmpvar_10 = clamp (m_9[0], 0.0, 1.0); - vec2 tmpvar_11; - tmpvar_11 = clamp (m_9[1], 0.0, 1.0); - mat2 tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_10; - tmpvar_12[0] = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_12[1] = tmpvar_14; - return tmpvar_12; -} - -mat3 xll_saturate ( - in mat3 m_15 -) -{ - vec3 tmpvar_16; - tmpvar_16 = clamp (m_15[0], 0.0, 1.0); - vec3 tmpvar_17; - tmpvar_17 = clamp (m_15[1], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_15[2], 0.0, 1.0); - mat3 tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_16; - tmpvar_19[0] = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_19[1] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_19[2] = tmpvar_22; - return tmpvar_19; -} - -mat4 xll_saturate ( - in mat4 m_23 -) -{ - vec4 tmpvar_24; - tmpvar_24 = clamp (m_23[0], 0.0, 1.0); - vec4 tmpvar_25; - tmpvar_25 = clamp (m_23[1], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_23[2], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_23[3], 0.0, 1.0); - mat4 tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_24; - tmpvar_28[0] = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_28[1] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_28[2] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_28[3] = tmpvar_32; - return tmpvar_28; -} - -vec2 xll_vecTSel ( - in bvec2 a_33, - in vec2 b_34, - in vec2 c_35 -) -{ - float tmpvar_36; - if (a_33.x) { - tmpvar_36 = b_34.x; - } else { - tmpvar_36 = c_35.x; - }; - float tmpvar_37; - if (a_33.y) { - tmpvar_37 = b_34.y; - } else { - tmpvar_37 = c_35.y; - }; - vec2 tmpvar_38; - tmpvar_38.x = tmpvar_36; - tmpvar_38.y = tmpvar_37; - return tmpvar_38; -} - -vec3 xll_vecTSel ( - in bvec3 a_39, - in vec3 b_40, - in vec3 c_41 -) -{ - float tmpvar_42; - if (a_39.x) { - tmpvar_42 = b_40.x; - } else { - tmpvar_42 = c_41.x; - }; - float tmpvar_43; - if (a_39.y) { - tmpvar_43 = b_40.y; - } else { - tmpvar_43 = c_41.y; - }; - float tmpvar_44; - if (a_39.z) { - tmpvar_44 = b_40.z; - } else { - tmpvar_44 = c_41.z; - }; - vec3 tmpvar_45; - tmpvar_45.x = tmpvar_42; - tmpvar_45.y = tmpvar_43; - tmpvar_45.z = tmpvar_44; - return tmpvar_45; -} - -vec4 xll_vecTSel ( - in bvec4 a_46, - in vec4 b_47, - in vec4 c_48 -) -{ - float tmpvar_49; - if (a_46.x) { - tmpvar_49 = b_47.x; - } else { - tmpvar_49 = c_48.x; - }; - float tmpvar_50; - if (a_46.y) { - tmpvar_50 = b_47.y; - } else { - tmpvar_50 = c_48.y; - }; - float tmpvar_51; - if (a_46.z) { - tmpvar_51 = b_47.z; - } else { - tmpvar_51 = c_48.z; - }; - float tmpvar_52; - if (a_46.w) { - tmpvar_52 = b_47.w; - } else { - tmpvar_52 = c_48.w; - }; - vec4 tmpvar_53; - tmpvar_53.x = tmpvar_49; - tmpvar_53.y = tmpvar_50; - tmpvar_53.z = tmpvar_51; - tmpvar_53.w = tmpvar_52; - return tmpvar_53; -} - -float Luminance ( - in vec3 c_54 -) -{ - float tmpvar_55; - tmpvar_55 = dot (c_54, vec3(0.22, 0.707, 0.071)); - return tmpvar_55; -} - -float Linear01Depth ( - in float z_56 -) -{ - return (1.0 / ((_ZBufferParams.x * z_56) + _ZBufferParams.y)); -} - -float DecodeFloatRGBA ( - in vec4 enc_57 -) -{ - vec4 kDecodeDot_58; - vec4 tmpvar_59; - tmpvar_59 = vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09); - kDecodeDot_58 = tmpvar_59; - float tmpvar_60; - tmpvar_60 = dot (enc_57, kDecodeDot_58); - return tmpvar_60; -} - -float SampleCubeDistance ( - in vec3 vec_61 -) -{ - vec4 packDist_62; - vec4 tmpvar_63; - tmpvar_63 = textureCube (_ShadowMapTexture, vec_61); - vec4 tmpvar_64; - tmpvar_64 = tmpvar_63; - packDist_62 = tmpvar_64; - float tmpvar_65; - tmpvar_65 = DecodeFloatRGBA (packDist_62); - return tmpvar_65; -} - -float unitySampleShadow ( - in vec3 vec_66, - in float mydist_67 -) -{ - vec4 shadows_68; - vec4 shadowVals_69; - float z_70; - float tmpvar_71; - tmpvar_71 = 0.0078125; - z_70 = tmpvar_71; - vec3 tmpvar_72; - tmpvar_72.x = z_70; - tmpvar_72.y = z_70; - tmpvar_72.z = z_70; - float tmpvar_73; - tmpvar_73 = SampleCubeDistance ((vec_66 + tmpvar_72)); - float tmpvar_74; - tmpvar_74 = tmpvar_73; - shadowVals_69.x = tmpvar_74; - vec3 tmpvar_75; - tmpvar_75.x = -(z_70); - tmpvar_75.y = -(z_70); - tmpvar_75.z = z_70; - float tmpvar_76; - tmpvar_76 = SampleCubeDistance ((vec_66 + tmpvar_75)); - float tmpvar_77; - tmpvar_77 = tmpvar_76; - shadowVals_69.y = vec2(tmpvar_77).y; - vec3 tmpvar_78; - tmpvar_78.x = -(z_70); - tmpvar_78.y = z_70; - tmpvar_78.z = -(z_70); - float tmpvar_79; - tmpvar_79 = SampleCubeDistance ((vec_66 + tmpvar_78)); - float tmpvar_80; - tmpvar_80 = tmpvar_79; - shadowVals_69.z = vec3(tmpvar_80).z; - vec3 tmpvar_81; - tmpvar_81.x = z_70; - tmpvar_81.y = -(z_70); - tmpvar_81.z = -(z_70); - float tmpvar_82; - tmpvar_82 = SampleCubeDistance ((vec_66 + tmpvar_81)); - float tmpvar_83; - tmpvar_83 = tmpvar_82; - shadowVals_69.w = vec4(tmpvar_83).w; - vec4 tmpvar_84; - tmpvar_84 = vec4(mydist_67); - vec4 tmpvar_85; - tmpvar_85 = tmpvar_84.xyzw; - bvec4 tmpvar_86; - tmpvar_86 = lessThan (shadowVals_69, tmpvar_85); - vec4 tmpvar_87; - tmpvar_87 = _LightShadowData.xxxx.xyzw; - vec4 tmpvar_88; - tmpvar_88 = xll_vecTSel (tmpvar_86, tmpvar_87, vec4(1.0, 1.0, 1.0, 1.0)); - vec4 tmpvar_89; - tmpvar_89 = tmpvar_88; - shadows_68 = tmpvar_89; - float tmpvar_90; - tmpvar_90 = dot (shadows_68, vec4(0.25, 0.25, 0.25, 0.25)); - return tmpvar_90; -} - -float ComputeShadow ( - in vec3 vec_91, - in float z_92, - in vec2 uv_93 -) -{ - float mydist_94; - float fade_95; - float tmpvar_96; - tmpvar_96 = ((z_92 * _LightShadowData.z) + _LightShadowData.w); - fade_95 = tmpvar_96; - float tmpvar_97; - tmpvar_97 = xll_saturate (fade_95); - float tmpvar_98; - tmpvar_98 = tmpvar_97; - fade_95 = tmpvar_98; - float tmpvar_99; - tmpvar_99 = length (vec_91); - float tmpvar_100; - tmpvar_100 = (tmpvar_99 * _LightPositionRange.w); - mydist_94 = tmpvar_100; - float tmpvar_101; - tmpvar_101 = (mydist_94 * 0.97); - mydist_94 = tmpvar_101; - float tmpvar_102; - tmpvar_102 = unitySampleShadow (vec_91, mydist_94); - return tmpvar_102; - return 1.0; -} - -vec4 xlat_main ( - in v2f i_103 -) -{ - float fade_104; - vec4 res_105; - float spec_106; - vec3 h_107; - float diff_108; - float atten_109; - float att_110; - vec3 lightDir_111; - vec3 tolight_112; - vec3 wpos_113; - vec4 vpos_114; - float depth_115; - vec3 normal_116; - vec4 nspec_117; - vec2 uv_118; - vec3 tmpvar_119; - tmpvar_119 = (i_103.ray * (_ProjectionParams.z / i_103.ray.z)); - i_103.ray = tmpvar_119; - vec2 tmpvar_120; - tmpvar_120 = (i_103.uv.xy / i_103.uv.w); - uv_118 = tmpvar_120; - vec4 tmpvar_121; - tmpvar_121 = texture2D (_CameraNormalsTexture, uv_118); - vec4 tmpvar_122; - tmpvar_122 = tmpvar_121; - nspec_117 = tmpvar_122; - vec3 tmpvar_123; - tmpvar_123 = ((nspec_117.xyz * 2.0) - 1.0); - normal_116 = tmpvar_123; - vec3 tmpvar_124; - tmpvar_124 = normalize (normal_116); - vec3 tmpvar_125; - tmpvar_125 = tmpvar_124; - normal_116 = tmpvar_125; - vec4 tmpvar_126; - tmpvar_126 = texture2D (_CameraDepthTexture, uv_118); - float tmpvar_127; - tmpvar_127 = tmpvar_126.x; - depth_115 = tmpvar_127; - float tmpvar_128; - tmpvar_128 = Linear01Depth (depth_115); - float tmpvar_129; - tmpvar_129 = tmpvar_128; - depth_115 = tmpvar_129; - vec4 tmpvar_130; - tmpvar_130.w = 1.0; - tmpvar_130.xyz = (i_103.ray * depth_115).xyz; - vec4 tmpvar_131; - tmpvar_131 = tmpvar_130; - vpos_114 = tmpvar_131; - vec3 tmpvar_132; - tmpvar_132 = (_CameraToWorld * vpos_114).xyz; - wpos_113 = tmpvar_132; - vec3 tmpvar_133; - tmpvar_133 = (wpos_113 - _LightPos.xyz); - tolight_112 = tmpvar_133; - vec3 tmpvar_134; - tmpvar_134 = normalize (tolight_112); - vec3 tmpvar_135; - tmpvar_135 = -(tmpvar_134); - lightDir_111 = tmpvar_135; - float tmpvar_136; - tmpvar_136 = dot (tolight_112, tolight_112); - float tmpvar_137; - tmpvar_137 = (tmpvar_136 * _LightPos.w); - att_110 = tmpvar_137; - vec2 tmpvar_138; - tmpvar_138 = vec2(att_110); - vec2 tmpvar_139; - tmpvar_139 = tmpvar_138.xy; - vec4 tmpvar_140; - tmpvar_140 = texture2D (_LightTextureB0, tmpvar_139); - float tmpvar_141; - tmpvar_141 = tmpvar_140.w; - atten_109 = tmpvar_141; - float tmpvar_142; - tmpvar_142 = ComputeShadow (tolight_112, vpos_114.z, uv_118); - float tmpvar_143; - tmpvar_143 = (atten_109 * tmpvar_142); - atten_109 = tmpvar_143; - vec4 tmpvar_144; - tmpvar_144.w = 1.0; - tmpvar_144.xyz = wpos_113.xyz; - vec4 tmpvar_145; - tmpvar_145 = textureCube (_LightTexture0, (_LightMatrix0 * tmpvar_144).xyz); - float tmpvar_146; - tmpvar_146 = (atten_109 * tmpvar_145.w); - atten_109 = tmpvar_146; - float tmpvar_147; - tmpvar_147 = dot (lightDir_111, normal_116); - float tmpvar_148; - tmpvar_148 = max (0.0, tmpvar_147); - float tmpvar_149; - tmpvar_149 = tmpvar_148; - diff_108 = tmpvar_149; - vec3 tmpvar_150; - tmpvar_150 = normalize ((wpos_113 - _WorldSpaceCameraPos)); - vec3 tmpvar_151; - tmpvar_151 = normalize ((lightDir_111 - tmpvar_150)); - vec3 tmpvar_152; - tmpvar_152 = tmpvar_151; - h_107 = tmpvar_152; - float tmpvar_153; - tmpvar_153 = dot (h_107, normal_116); - float tmpvar_154; - tmpvar_154 = max (0.0, tmpvar_153); - float tmpvar_155; - tmpvar_155 = pow (tmpvar_154, (nspec_117.w * 128.0)); - float tmpvar_156; - tmpvar_156 = tmpvar_155; - spec_106 = tmpvar_156; - float tmpvar_157; - tmpvar_157 = xll_saturate (atten_109); - float tmpvar_158; - tmpvar_158 = (spec_106 * tmpvar_157); - spec_106 = tmpvar_158; - vec3 tmpvar_159; - tmpvar_159 = (_LightColor.xyz * (diff_108 * atten_109)); - res_105.xyz = tmpvar_159.xyz.xyz; - float tmpvar_160; - tmpvar_160 = Luminance (_LightColor.xyz); - float tmpvar_161; - tmpvar_161 = (spec_106 * tmpvar_160); - res_105.w = vec4(tmpvar_161).w; - float tmpvar_162; - tmpvar_162 = ((vpos_114.z * unity_LightmapFade.z) + unity_LightmapFade.w); - fade_104 = tmpvar_162; - float tmpvar_163; - tmpvar_163 = xll_saturate ((1.0 - fade_104)); - vec4 tmpvar_164; - tmpvar_164 = (res_105 * tmpvar_163); - res_105 = tmpvar_164; - vec4 tmpvar_165; - tmpvar_165 = exp2 (-(res_105)); - return tmpvar_165; -} - -void main () -{ - v2f xlt_i_166; - vec4 xl_retval_167; - vec4 tmpvar_168; - tmpvar_168 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_166.pos = tmpvar_168; - vec4 tmpvar_169; - tmpvar_169 = xlv_TEXCOORD0.xyzw; - vec4 tmpvar_170; - tmpvar_170 = tmpvar_169; - xlt_i_166.uv = tmpvar_170; - vec3 tmpvar_171; - tmpvar_171 = xlv_TEXCOORD1.xyz; - vec3 tmpvar_172; - tmpvar_172 = tmpvar_171; - xlt_i_166.ray = tmpvar_172; - vec4 tmpvar_173; - tmpvar_173 = xlat_main (xlt_i_166); - vec4 tmpvar_174; - tmpvar_174 = tmpvar_173; - xl_retval_167 = tmpvar_174; - vec4 tmpvar_175; - tmpvar_175 = xl_retval_167.xyzw; - vec4 tmpvar_176; - tmpvar_176 = tmpvar_175; - gl_FragData[0] = tmpvar_176; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-irES.txt deleted file mode 100644 index 84a053d3d..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-irES.txt +++ /dev/null @@ -1,529 +0,0 @@ -struct v2f { - highp vec4 pos; - highp vec4 uv; - highp vec3 ray; -}; -uniform sampler2D _CameraDepthTexture; -uniform sampler2D _CameraNormalsTexture; -uniform highp mat4 _CameraToWorld; -uniform highp vec4 _LightColor; -uniform highp mat4 _LightMatrix0; -uniform highp vec4 _LightPos; -uniform highp vec4 _LightPositionRange; -uniform highp vec4 _LightShadowData; -uniform samplerCube _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform highp vec4 _ProjectionParams; -uniform samplerCube _ShadowMapTexture; -uniform highp vec3 _WorldSpaceCameraPos; -uniform highp vec4 _ZBufferParams; -uniform highp vec4 unity_LightmapFade; -varying highp vec4 xlv_TEXCOORD0; -varying highp vec3 xlv_TEXCOORD1; -mediump float xll_saturate ( - in mediump float x_1 -) -{ - mediump float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -mediump vec2 xll_saturate ( - in mediump vec2 x_3 -) -{ - mediump vec2 tmpvar_4; - tmpvar_4 = clamp (x_3, 0.0, 1.0); - return tmpvar_4; -} - -mediump vec3 xll_saturate ( - in mediump vec3 x_5 -) -{ - mediump vec3 tmpvar_6; - tmpvar_6 = clamp (x_5, 0.0, 1.0); - return tmpvar_6; -} - -mediump vec4 xll_saturate ( - in mediump vec4 x_7 -) -{ - mediump vec4 tmpvar_8; - tmpvar_8 = clamp (x_7, 0.0, 1.0); - return tmpvar_8; -} - -mediump mat2 xll_saturate ( - in mediump mat2 m_9 -) -{ - mediump vec2 tmpvar_10; - tmpvar_10 = clamp (m_9[0], 0.0, 1.0); - mediump vec2 tmpvar_11; - tmpvar_11 = clamp (m_9[1], 0.0, 1.0); - mediump mat2 tmpvar_12; - mediump vec2 tmpvar_13; - tmpvar_13 = tmpvar_10; - tmpvar_12[0] = tmpvar_13; - mediump vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_12[1] = tmpvar_14; - return tmpvar_12; -} - -mediump mat3 xll_saturate ( - in mediump mat3 m_15 -) -{ - mediump vec3 tmpvar_16; - tmpvar_16 = clamp (m_15[0], 0.0, 1.0); - mediump vec3 tmpvar_17; - tmpvar_17 = clamp (m_15[1], 0.0, 1.0); - mediump vec3 tmpvar_18; - tmpvar_18 = clamp (m_15[2], 0.0, 1.0); - mediump mat3 tmpvar_19; - mediump vec3 tmpvar_20; - tmpvar_20 = tmpvar_16; - tmpvar_19[0] = tmpvar_20; - mediump vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_19[1] = tmpvar_21; - mediump vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_19[2] = tmpvar_22; - return tmpvar_19; -} - -mediump mat4 xll_saturate ( - in mediump mat4 m_23 -) -{ - mediump vec4 tmpvar_24; - tmpvar_24 = clamp (m_23[0], 0.0, 1.0); - mediump vec4 tmpvar_25; - tmpvar_25 = clamp (m_23[1], 0.0, 1.0); - mediump vec4 tmpvar_26; - tmpvar_26 = clamp (m_23[2], 0.0, 1.0); - mediump vec4 tmpvar_27; - tmpvar_27 = clamp (m_23[3], 0.0, 1.0); - mediump mat4 tmpvar_28; - mediump vec4 tmpvar_29; - tmpvar_29 = tmpvar_24; - tmpvar_28[0] = tmpvar_29; - mediump vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_28[1] = tmpvar_30; - mediump vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_28[2] = tmpvar_31; - mediump vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_28[3] = tmpvar_32; - return tmpvar_28; -} - -mediump vec2 xll_vecTSel ( - in bvec2 a_33, - in mediump vec2 b_34, - in mediump vec2 c_35 -) -{ - mediump float tmpvar_36; - if (a_33.x) { - tmpvar_36 = b_34.x; - } else { - tmpvar_36 = c_35.x; - }; - mediump float tmpvar_37; - if (a_33.y) { - tmpvar_37 = b_34.y; - } else { - tmpvar_37 = c_35.y; - }; - mediump vec2 tmpvar_38; - tmpvar_38.x = tmpvar_36; - tmpvar_38.y = tmpvar_37; - return tmpvar_38; -} - -mediump vec3 xll_vecTSel ( - in bvec3 a_39, - in mediump vec3 b_40, - in mediump vec3 c_41 -) -{ - mediump float tmpvar_42; - if (a_39.x) { - tmpvar_42 = b_40.x; - } else { - tmpvar_42 = c_41.x; - }; - mediump float tmpvar_43; - if (a_39.y) { - tmpvar_43 = b_40.y; - } else { - tmpvar_43 = c_41.y; - }; - mediump float tmpvar_44; - if (a_39.z) { - tmpvar_44 = b_40.z; - } else { - tmpvar_44 = c_41.z; - }; - mediump vec3 tmpvar_45; - tmpvar_45.x = tmpvar_42; - tmpvar_45.y = tmpvar_43; - tmpvar_45.z = tmpvar_44; - return tmpvar_45; -} - -mediump vec4 xll_vecTSel ( - in bvec4 a_46, - in mediump vec4 b_47, - in mediump vec4 c_48 -) -{ - mediump float tmpvar_49; - if (a_46.x) { - tmpvar_49 = b_47.x; - } else { - tmpvar_49 = c_48.x; - }; - mediump float tmpvar_50; - if (a_46.y) { - tmpvar_50 = b_47.y; - } else { - tmpvar_50 = c_48.y; - }; - mediump float tmpvar_51; - if (a_46.z) { - tmpvar_51 = b_47.z; - } else { - tmpvar_51 = c_48.z; - }; - mediump float tmpvar_52; - if (a_46.w) { - tmpvar_52 = b_47.w; - } else { - tmpvar_52 = c_48.w; - }; - mediump vec4 tmpvar_53; - tmpvar_53.x = tmpvar_49; - tmpvar_53.y = tmpvar_50; - tmpvar_53.z = tmpvar_51; - tmpvar_53.w = tmpvar_52; - return tmpvar_53; -} - -mediump float Luminance ( - in mediump vec3 c_54 -) -{ - mediump float tmpvar_55; - tmpvar_55 = dot (c_54, vec3(0.22, 0.707, 0.071)); - return tmpvar_55; -} - -float Linear01Depth ( - in highp float z_56 -) -{ - return (1.0 / ((_ZBufferParams.x * z_56) + _ZBufferParams.y)); -} - -float DecodeFloatRGBA ( - in highp vec4 enc_57 -) -{ - highp vec4 kDecodeDot_58; - mediump vec4 tmpvar_59; - tmpvar_59 = vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09); - kDecodeDot_58 = tmpvar_59; - highp float tmpvar_60; - tmpvar_60 = dot (enc_57, kDecodeDot_58); - return tmpvar_60; -} - -float SampleCubeDistance ( - in highp vec3 vec_61 -) -{ - highp vec4 packDist_62; - lowp vec4 tmpvar_63; - tmpvar_63 = textureCube (_ShadowMapTexture, vec_61); - lowp vec4 tmpvar_64; - tmpvar_64 = tmpvar_63; - packDist_62 = tmpvar_64; - highp float tmpvar_65; - tmpvar_65 = DecodeFloatRGBA (packDist_62); - return tmpvar_65; -} - -mediump float unitySampleShadow ( - in highp vec3 vec_66, - in highp float mydist_67 -) -{ - mediump vec4 shadows_68; - highp vec4 shadowVals_69; - highp float z_70; - mediump float tmpvar_71; - tmpvar_71 = 0.0078125; - z_70 = tmpvar_71; - highp vec3 tmpvar_72; - tmpvar_72.x = z_70; - tmpvar_72.y = z_70; - tmpvar_72.z = z_70; - highp float tmpvar_73; - tmpvar_73 = SampleCubeDistance ((vec_66 + tmpvar_72)); - highp float tmpvar_74; - tmpvar_74 = tmpvar_73; - shadowVals_69.x = tmpvar_74; - highp vec3 tmpvar_75; - tmpvar_75.x = -(z_70); - tmpvar_75.y = -(z_70); - tmpvar_75.z = z_70; - highp float tmpvar_76; - tmpvar_76 = SampleCubeDistance ((vec_66 + tmpvar_75)); - highp float tmpvar_77; - tmpvar_77 = tmpvar_76; - shadowVals_69.y = vec2(tmpvar_77).y; - highp vec3 tmpvar_78; - tmpvar_78.x = -(z_70); - tmpvar_78.y = z_70; - tmpvar_78.z = -(z_70); - highp float tmpvar_79; - tmpvar_79 = SampleCubeDistance ((vec_66 + tmpvar_78)); - highp float tmpvar_80; - tmpvar_80 = tmpvar_79; - shadowVals_69.z = vec3(tmpvar_80).z; - highp vec3 tmpvar_81; - tmpvar_81.x = z_70; - tmpvar_81.y = -(z_70); - tmpvar_81.z = -(z_70); - highp float tmpvar_82; - tmpvar_82 = SampleCubeDistance ((vec_66 + tmpvar_81)); - highp float tmpvar_83; - tmpvar_83 = tmpvar_82; - shadowVals_69.w = vec4(tmpvar_83).w; - highp vec4 tmpvar_84; - tmpvar_84 = vec4(mydist_67); - highp vec4 tmpvar_85; - tmpvar_85 = tmpvar_84.xyzw; - bvec4 tmpvar_86; - tmpvar_86 = lessThan (shadowVals_69, tmpvar_85); - highp vec4 tmpvar_87; - tmpvar_87 = _LightShadowData.xxxx.xyzw; - mediump vec4 tmpvar_88; - tmpvar_88 = xll_vecTSel (tmpvar_86, tmpvar_87, vec4(1.0, 1.0, 1.0, 1.0)); - mediump vec4 tmpvar_89; - tmpvar_89 = tmpvar_88; - shadows_68 = tmpvar_89; - mediump float tmpvar_90; - tmpvar_90 = dot (shadows_68, vec4(0.25, 0.25, 0.25, 0.25)); - return tmpvar_90; -} - -mediump float ComputeShadow ( - in highp vec3 vec_91, - in highp float z_92, - in highp vec2 uv_93 -) -{ - highp float mydist_94; - highp float fade_95; - highp float tmpvar_96; - tmpvar_96 = ((z_92 * _LightShadowData.z) + _LightShadowData.w); - fade_95 = tmpvar_96; - mediump float tmpvar_97; - tmpvar_97 = xll_saturate (fade_95); - mediump float tmpvar_98; - tmpvar_98 = tmpvar_97; - fade_95 = tmpvar_98; - highp float tmpvar_99; - tmpvar_99 = length (vec_91); - highp float tmpvar_100; - tmpvar_100 = (tmpvar_99 * _LightPositionRange.w); - mydist_94 = tmpvar_100; - highp float tmpvar_101; - tmpvar_101 = (mydist_94 * 0.97); - mydist_94 = tmpvar_101; - mediump float tmpvar_102; - tmpvar_102 = unitySampleShadow (vec_91, mydist_94); - return tmpvar_102; - return 1.0; -} - -mediump vec4 xlat_main ( - in v2f i_103 -) -{ - highp float fade_104; - mediump vec4 res_105; - highp float spec_106; - mediump vec3 h_107; - mediump float diff_108; - highp float atten_109; - highp float att_110; - mediump vec3 lightDir_111; - highp vec3 tolight_112; - highp vec3 wpos_113; - highp vec4 vpos_114; - highp float depth_115; - mediump vec3 normal_116; - mediump vec4 nspec_117; - highp vec2 uv_118; - highp vec3 tmpvar_119; - tmpvar_119 = (i_103.ray * (_ProjectionParams.z / i_103.ray.z)); - i_103.ray = tmpvar_119; - highp vec2 tmpvar_120; - tmpvar_120 = (i_103.uv.xy / i_103.uv.w); - uv_118 = tmpvar_120; - lowp vec4 tmpvar_121; - tmpvar_121 = texture2D (_CameraNormalsTexture, uv_118); - lowp vec4 tmpvar_122; - tmpvar_122 = tmpvar_121; - nspec_117 = tmpvar_122; - mediump vec3 tmpvar_123; - tmpvar_123 = ((nspec_117.xyz * 2.0) - 1.0); - normal_116 = tmpvar_123; - mediump vec3 tmpvar_124; - tmpvar_124 = normalize (normal_116); - mediump vec3 tmpvar_125; - tmpvar_125 = tmpvar_124; - normal_116 = tmpvar_125; - lowp vec4 tmpvar_126; - tmpvar_126 = texture2D (_CameraDepthTexture, uv_118); - lowp float tmpvar_127; - tmpvar_127 = tmpvar_126.x; - depth_115 = tmpvar_127; - highp float tmpvar_128; - tmpvar_128 = Linear01Depth (depth_115); - highp float tmpvar_129; - tmpvar_129 = tmpvar_128; - depth_115 = tmpvar_129; - highp vec4 tmpvar_130; - tmpvar_130.w = 1.0; - tmpvar_130.xyz = (i_103.ray * depth_115).xyz; - highp vec4 tmpvar_131; - tmpvar_131 = tmpvar_130; - vpos_114 = tmpvar_131; - highp vec3 tmpvar_132; - tmpvar_132 = (_CameraToWorld * vpos_114).xyz; - wpos_113 = tmpvar_132; - highp vec3 tmpvar_133; - tmpvar_133 = (wpos_113 - _LightPos.xyz); - tolight_112 = tmpvar_133; - highp vec3 tmpvar_134; - tmpvar_134 = normalize (tolight_112); - highp vec3 tmpvar_135; - tmpvar_135 = -(tmpvar_134); - lightDir_111 = tmpvar_135; - highp float tmpvar_136; - tmpvar_136 = dot (tolight_112, tolight_112); - highp float tmpvar_137; - tmpvar_137 = (tmpvar_136 * _LightPos.w); - att_110 = tmpvar_137; - highp vec2 tmpvar_138; - tmpvar_138 = vec2(att_110); - highp vec2 tmpvar_139; - tmpvar_139 = tmpvar_138.xy; - lowp vec4 tmpvar_140; - tmpvar_140 = texture2D (_LightTextureB0, tmpvar_139); - lowp float tmpvar_141; - tmpvar_141 = tmpvar_140.w; - atten_109 = tmpvar_141; - mediump float tmpvar_142; - tmpvar_142 = ComputeShadow (tolight_112, vpos_114.z, uv_118); - highp float tmpvar_143; - tmpvar_143 = (atten_109 * tmpvar_142); - atten_109 = tmpvar_143; - highp vec4 tmpvar_144; - tmpvar_144.w = 1.0; - tmpvar_144.xyz = wpos_113.xyz; - lowp vec4 tmpvar_145; - tmpvar_145 = textureCube (_LightTexture0, (_LightMatrix0 * tmpvar_144).xyz); - highp float tmpvar_146; - tmpvar_146 = (atten_109 * tmpvar_145.w); - atten_109 = tmpvar_146; - mediump float tmpvar_147; - tmpvar_147 = dot (lightDir_111, normal_116); - mediump float tmpvar_148; - tmpvar_148 = max (0.0, tmpvar_147); - mediump float tmpvar_149; - tmpvar_149 = tmpvar_148; - diff_108 = tmpvar_149; - highp vec3 tmpvar_150; - tmpvar_150 = normalize ((wpos_113 - _WorldSpaceCameraPos)); - highp vec3 tmpvar_151; - tmpvar_151 = normalize ((lightDir_111 - tmpvar_150)); - highp vec3 tmpvar_152; - tmpvar_152 = tmpvar_151; - h_107 = tmpvar_152; - mediump float tmpvar_153; - tmpvar_153 = dot (h_107, normal_116); - mediump float tmpvar_154; - tmpvar_154 = max (0.0, tmpvar_153); - mediump float tmpvar_155; - tmpvar_155 = pow (tmpvar_154, (nspec_117.w * 128.0)); - mediump float tmpvar_156; - tmpvar_156 = tmpvar_155; - spec_106 = tmpvar_156; - mediump float tmpvar_157; - tmpvar_157 = xll_saturate (atten_109); - highp float tmpvar_158; - tmpvar_158 = (spec_106 * tmpvar_157); - spec_106 = tmpvar_158; - highp vec3 tmpvar_159; - tmpvar_159 = (_LightColor.xyz * (diff_108 * atten_109)); - res_105.xyz = tmpvar_159.xyz.xyz; - mediump float tmpvar_160; - tmpvar_160 = Luminance (_LightColor.xyz); - highp float tmpvar_161; - tmpvar_161 = (spec_106 * tmpvar_160); - res_105.w = vec4(tmpvar_161).w; - highp float tmpvar_162; - tmpvar_162 = ((vpos_114.z * unity_LightmapFade.z) + unity_LightmapFade.w); - fade_104 = tmpvar_162; - mediump float tmpvar_163; - tmpvar_163 = xll_saturate ((1.0 - fade_104)); - mediump vec4 tmpvar_164; - tmpvar_164 = (res_105 * tmpvar_163); - res_105 = tmpvar_164; - mediump vec4 tmpvar_165; - tmpvar_165 = exp2 (-(res_105)); - return tmpvar_165; -} - -void main () -{ - v2f xlt_i_166; - mediump vec4 xl_retval_167; - mediump vec4 tmpvar_168; - tmpvar_168 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_166.pos = tmpvar_168; - highp vec4 tmpvar_169; - tmpvar_169 = xlv_TEXCOORD0.xyzw; - highp vec4 tmpvar_170; - tmpvar_170 = tmpvar_169; - xlt_i_166.uv = tmpvar_170; - highp vec3 tmpvar_171; - tmpvar_171 = xlv_TEXCOORD1.xyz; - highp vec3 tmpvar_172; - tmpvar_172 = tmpvar_171; - xlt_i_166.ray = tmpvar_172; - mediump vec4 tmpvar_173; - tmpvar_173 = xlat_main (xlt_i_166); - mediump vec4 tmpvar_174; - tmpvar_174 = tmpvar_173; - xl_retval_167 = tmpvar_174; - mediump vec4 tmpvar_175; - tmpvar_175 = xl_retval_167.xyzw; - mediump vec4 tmpvar_176; - tmpvar_176 = tmpvar_175; - gl_FragData[0] = tmpvar_176; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-out.txt b/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-out.txt index 64a308c05..7cc74d878 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-out.txt @@ -20,86 +20,105 @@ void main () vec4 res_1; float atten_2; vec3 lightDir_3; - vec3 normal_4; - vec2 tmpvar_5; - tmpvar_5 = (xlv_TEXCOORD0.xy / xlv_TEXCOORD0.w); - vec4 tmpvar_6; - tmpvar_6 = texture2D (_CameraNormalsTexture, tmpvar_5); - normal_4 = normalize(((tmpvar_6.xyz * 2.0) - 1.0)); - vec4 tmpvar_7; - tmpvar_7.w = 1.0; - tmpvar_7.xyz = ((xlv_TEXCOORD1 * (_ProjectionParams.z / xlv_TEXCOORD1.z)) * (1.0/(( - (_ZBufferParams.x * texture2D (_CameraDepthTexture, tmpvar_5).x) + vec3 tolight_4; + vec3 wpos_5; + vec3 normal_6; + vec2 uv_7; + uv_7 = (xlv_TEXCOORD0.xy / xlv_TEXCOORD0.w); + vec4 tmpvar_8; + tmpvar_8 = texture2D (_CameraNormalsTexture, uv_7); + normal_6 = ((tmpvar_8.xyz * 2.0) - 1.0); + normal_6 = normalize(normal_6); + vec4 tmpvar_9; + tmpvar_9.w = 1.0; + tmpvar_9.xyz = ((xlv_TEXCOORD1 * (_ProjectionParams.z / xlv_TEXCOORD1.z)) * (1.0/(( + (_ZBufferParams.x * texture2D (_CameraDepthTexture, uv_7).x) + _ZBufferParams.y)))); - vec3 tmpvar_8; - tmpvar_8 = (_CameraToWorld * tmpvar_7).xyz; - vec3 tmpvar_9; - tmpvar_9 = (tmpvar_8 - _LightPos.xyz); - lightDir_3 = -(normalize(tmpvar_9)); - atten_2 = texture2D (_LightTextureB0, vec2((dot (tmpvar_9, tmpvar_9) * _LightPos.w))).w; - vec4 shadowVals_10; - shadowVals_10.x = dot (textureCube (_ShadowMapTexture, (tmpvar_9 + vec3(0.0078125, 0.0078125, 0.0078125))), vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); - shadowVals_10.y = dot (textureCube (_ShadowMapTexture, (tmpvar_9 + vec3(-0.0078125, -0.0078125, 0.0078125))), vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); - shadowVals_10.z = dot (textureCube (_ShadowMapTexture, (tmpvar_9 + vec3(-0.0078125, 0.0078125, -0.0078125))), vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); - shadowVals_10.w = dot (textureCube (_ShadowMapTexture, (tmpvar_9 + vec3(0.0078125, -0.0078125, -0.0078125))), vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); - bvec4 tmpvar_11; - tmpvar_11 = lessThan (shadowVals_10, vec4((( - sqrt(dot (tmpvar_9, tmpvar_9)) - * _LightPositionRange.w) * 0.97))); - vec4 tmpvar_12; - tmpvar_12 = _LightShadowData.xxxx; - float tmpvar_13; - if (tmpvar_11.x) { - tmpvar_13 = tmpvar_12.x; - } else { - tmpvar_13 = 1.0; - }; + wpos_5 = (_CameraToWorld * tmpvar_9).xyz; + tolight_4 = (wpos_5 - _LightPos.xyz); + lightDir_3 = -(normalize(tolight_4)); + atten_2 = texture2D (_LightTextureB0, vec2((dot (tolight_4, tolight_4) * _LightPos.w))).w; + float mydist_10; + mydist_10 = (sqrt(dot (tolight_4, tolight_4)) * _LightPositionRange.w); + mydist_10 = (mydist_10 * 0.97); + vec4 shadowVals_11; + shadowVals_11.x = dot (textureCube (_ShadowMapTexture, (tolight_4 + vec3(0.0078125, 0.0078125, 0.0078125))), vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); + shadowVals_11.y = dot (textureCube (_ShadowMapTexture, (tolight_4 + vec3(-0.0078125, -0.0078125, 0.0078125))), vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); + shadowVals_11.z = dot (textureCube (_ShadowMapTexture, (tolight_4 + vec3(-0.0078125, 0.0078125, -0.0078125))), vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); + shadowVals_11.w = dot (textureCube (_ShadowMapTexture, (tolight_4 + vec3(0.0078125, -0.0078125, -0.0078125))), vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); + bvec4 tmpvar_12; + tmpvar_12 = lessThan (shadowVals_11, vec4(mydist_10)); + vec4 tmpvar_13; + tmpvar_13 = _LightShadowData.xxxx; float tmpvar_14; - if (tmpvar_11.y) { - tmpvar_14 = tmpvar_12.y; + if (tmpvar_12.x) { + tmpvar_14 = tmpvar_13.x; } else { tmpvar_14 = 1.0; }; float tmpvar_15; - if (tmpvar_11.z) { - tmpvar_15 = tmpvar_12.z; + if (tmpvar_12.y) { + tmpvar_15 = tmpvar_13.y; } else { tmpvar_15 = 1.0; }; float tmpvar_16; - if (tmpvar_11.w) { - tmpvar_16 = tmpvar_12.w; + if (tmpvar_12.z) { + tmpvar_16 = tmpvar_13.z; } else { tmpvar_16 = 1.0; }; - vec4 tmpvar_17; - tmpvar_17.x = tmpvar_13; - tmpvar_17.y = tmpvar_14; - tmpvar_17.z = tmpvar_15; - tmpvar_17.w = tmpvar_16; + float tmpvar_17; + if (tmpvar_12.w) { + tmpvar_17 = tmpvar_13.w; + } else { + tmpvar_17 = 1.0; + }; vec4 tmpvar_18; - tmpvar_18.w = 1.0; - tmpvar_18.xyz = tmpvar_8; - float tmpvar_19; - tmpvar_19 = ((atten_2 * dot (tmpvar_17, vec4(0.25, 0.25, 0.25, 0.25))) * textureCube (_LightTexture0, (_LightMatrix0 * tmpvar_18).xyz).w); - atten_2 = tmpvar_19; + tmpvar_18.x = tmpvar_14; + tmpvar_18.y = tmpvar_15; + tmpvar_18.z = tmpvar_16; + tmpvar_18.w = tmpvar_17; + atten_2 = (atten_2 * dot (tmpvar_18, vec4(0.25, 0.25, 0.25, 0.25))); + vec4 tmpvar_19; + tmpvar_19.w = 1.0; + tmpvar_19.xyz = wpos_5; + atten_2 = (atten_2 * textureCube (_LightTexture0, (_LightMatrix0 * tmpvar_19).xyz).w); res_1.xyz = (_LightColor.xyz * (max (0.0, - dot (lightDir_3, normal_4) - ) * tmpvar_19)); + dot (lightDir_3, normal_6) + ) * atten_2)); res_1.w = ((pow ( max (0.0, dot (normalize((lightDir_3 - - normalize((tmpvar_8 - _WorldSpaceCameraPos)) - )), normal_4)) + normalize((wpos_5 - _WorldSpaceCameraPos)) + )), normal_6)) , - (tmpvar_6.w * 128.0) - ) * clamp (tmpvar_19, 0.0, 1.0)) * dot (_LightColor.xyz, vec3(0.22, 0.707, 0.071))); - vec4 tmpvar_20; - tmpvar_20 = (res_1 * clamp ((1.0 - - ((tmpvar_7.z * unity_LightmapFade.z) + unity_LightmapFade.w) + (tmpvar_8.w * 128.0) + ) * clamp (atten_2, 0.0, 1.0)) * dot (_LightColor.xyz, vec3(0.22, 0.707, 0.071))); + res_1 = (res_1 * clamp ((1.0 - + ((tmpvar_9.z * unity_LightmapFade.z) + unity_LightmapFade.w) ), 0.0, 1.0)); - res_1 = tmpvar_20; - gl_FragData[0] = exp2(-(tmpvar_20)); + gl_FragData[0] = exp2(-(res_1)); } -// inputs: 2, stats: 62 alu 8 tex 4 flow +// stats: 62 alu 8 tex 4 flow +// inputs: 2 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] +// #1: xlv_TEXCOORD1 (high float) 3x1 [-1] +// uniforms: 10 (total size: 0) +// #0: _CameraToWorld (high float) 4x4 [-1] +// #1: _LightColor (high float) 4x1 [-1] +// #2: _LightMatrix0 (high float) 4x4 [-1] +// #3: _LightPos (high float) 4x1 [-1] +// #4: _LightPositionRange (high float) 4x1 [-1] +// #5: _LightShadowData (high float) 4x1 [-1] +// #6: _ProjectionParams (high float) 4x1 [-1] +// #7: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #8: _ZBufferParams (high float) 4x1 [-1] +// #9: unity_LightmapFade (high float) 4x1 [-1] +// textures: 5 +// #0: _CameraDepthTexture (high 2d) 0x0 [-1] +// #1: _CameraNormalsTexture (high 2d) 0x0 [-1] +// #2: _LightTexture0 (high cube) 0x0 [-1] +// #3: _LightTextureB0 (high 2d) 0x0 [-1] +// #4: _ShadowMapTexture (high cube) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES.txt index e31d453dd..62a4dc74e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES.txt @@ -6,10 +6,10 @@ uniform highp mat4 _LightMatrix0; uniform highp vec4 _LightPos; uniform highp vec4 _LightPositionRange; uniform highp vec4 _LightShadowData; -uniform samplerCube _LightTexture0; +uniform lowp samplerCube _LightTexture0; uniform sampler2D _LightTextureB0; uniform highp vec4 _ProjectionParams; -uniform samplerCube _ShadowMapTexture; +uniform lowp samplerCube _ShadowMapTexture; uniform highp vec3 _WorldSpaceCameraPos; uniform highp vec4 _ZBufferParams; uniform highp vec4 unity_LightmapFade; @@ -22,72 +22,72 @@ void main () mediump vec3 h_3; highp float atten_4; mediump vec3 lightDir_5; - highp float depth_6; - mediump vec3 normal_7; - mediump vec4 nspec_8; - highp vec2 tmpvar_9; - tmpvar_9 = (xlv_TEXCOORD0.xy / xlv_TEXCOORD0.w); - lowp vec4 tmpvar_10; - tmpvar_10 = texture2D (_CameraNormalsTexture, tmpvar_9); - nspec_8 = tmpvar_10; - normal_7 = normalize(((nspec_8.xyz * 2.0) - 1.0)); - lowp float tmpvar_11; - tmpvar_11 = texture2D (_CameraDepthTexture, tmpvar_9).x; - depth_6 = tmpvar_11; - highp float tmpvar_12; - tmpvar_12 = (1.0/(((_ZBufferParams.x * depth_6) + _ZBufferParams.y))); - depth_6 = tmpvar_12; - highp vec4 tmpvar_13; - tmpvar_13.w = 1.0; - tmpvar_13.xyz = ((xlv_TEXCOORD1 * (_ProjectionParams.z / xlv_TEXCOORD1.z)) * tmpvar_12); - highp vec3 tmpvar_14; - tmpvar_14 = (_CameraToWorld * tmpvar_13).xyz; - highp vec3 tmpvar_15; - tmpvar_15 = (tmpvar_14 - _LightPos.xyz); + highp vec3 tolight_6; + highp vec3 wpos_7; + highp float depth_8; + mediump vec3 normal_9; + mediump vec4 nspec_10; + highp vec2 uv_11; + uv_11 = (xlv_TEXCOORD0.xy / xlv_TEXCOORD0.w); + lowp vec4 tmpvar_12; + tmpvar_12 = texture2D (_CameraNormalsTexture, uv_11); + nspec_10 = tmpvar_12; + normal_9 = ((nspec_10.xyz * 2.0) - 1.0); + normal_9 = normalize(normal_9); + lowp vec4 tmpvar_13; + tmpvar_13 = texture2D (_CameraDepthTexture, uv_11); + depth_8 = tmpvar_13.x; + highp float tmpvar_14; + tmpvar_14 = (1.0/(((_ZBufferParams.x * depth_8) + _ZBufferParams.y))); + depth_8 = tmpvar_14; + highp vec4 tmpvar_15; + tmpvar_15.w = 1.0; + tmpvar_15.xyz = ((xlv_TEXCOORD1 * (_ProjectionParams.z / xlv_TEXCOORD1.z)) * tmpvar_14); + wpos_7 = (_CameraToWorld * tmpvar_15).xyz; + tolight_6 = (wpos_7 - _LightPos.xyz); highp vec3 tmpvar_16; - tmpvar_16 = -(normalize(tmpvar_15)); - lightDir_5 = tmpvar_16; + tmpvar_16 = normalize(tolight_6); + lightDir_5 = -(tmpvar_16); highp vec2 tmpvar_17; - tmpvar_17 = vec2((dot (tmpvar_15, tmpvar_15) * _LightPos.w)); - lowp float tmpvar_18; - tmpvar_18 = texture2D (_LightTextureB0, tmpvar_17).w; - atten_4 = tmpvar_18; - highp float tmpvar_19; - tmpvar_19 = ((sqrt( - dot (tmpvar_15, tmpvar_15) - ) * _LightPositionRange.w) * 0.97); + tmpvar_17 = vec2((dot (tolight_6, tolight_6) * _LightPos.w)); + lowp vec4 tmpvar_18; + tmpvar_18 = texture2D (_LightTextureB0, tmpvar_17); + atten_4 = tmpvar_18.w; + 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 = (tmpvar_15 + vec3(0.0078125, 0.0078125, 0.0078125)); + 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 = (tmpvar_15 + vec3(-0.0078125, -0.0078125, 0.0078125)); + 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 = (tmpvar_15 + vec3(-0.0078125, 0.0078125, -0.0078125)); + 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 = (tmpvar_15 + vec3(0.0078125, -0.0078125, -0.0078125)); + 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(tmpvar_19)); + tmpvar_34 = lessThan (shadowVals_21, vec4(mydist_19)); highp vec4 tmpvar_35; tmpvar_35 = _LightShadowData.xxxx; highp float tmpvar_36; @@ -122,48 +122,57 @@ void main () 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 = tmpvar_14; + 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); - highp float tmpvar_45; - tmpvar_45 = ((atten_4 * tmpvar_41) * tmpvar_43.w); - atten_4 = tmpvar_45; - mediump float tmpvar_46; - tmpvar_46 = max (0.0, dot (lightDir_5, normal_7)); - highp vec3 tmpvar_47; - tmpvar_47 = normalize((lightDir_5 - normalize( - (tmpvar_14 - _WorldSpaceCameraPos) + atten_4 = (atten_4 * tmpvar_43.w); + highp vec3 tmpvar_45; + tmpvar_45 = normalize((lightDir_5 - normalize( + (wpos_7 - _WorldSpaceCameraPos) ))); - h_3 = tmpvar_47; - mediump float tmpvar_48; - tmpvar_48 = pow (max (0.0, dot (h_3, normal_7)), (nspec_8.w * 128.0)); - spec_2 = tmpvar_48; - highp float tmpvar_49; - tmpvar_49 = (spec_2 * clamp (tmpvar_45, 0.0, 1.0)); - spec_2 = tmpvar_49; - highp vec3 tmpvar_50; - tmpvar_50 = (_LightColor.xyz * (tmpvar_46 * tmpvar_45)); - res_1.xyz = tmpvar_50; - mediump vec3 c_51; - c_51 = _LightColor.xyz; - mediump float tmpvar_52; - tmpvar_52 = dot (c_51, vec3(0.22, 0.707, 0.071)); - highp float tmpvar_53; - tmpvar_53 = (tmpvar_49 * tmpvar_52); - res_1.w = tmpvar_53; - highp float tmpvar_54; - tmpvar_54 = clamp ((1.0 - ( - (tmpvar_13.z * unity_LightmapFade.z) + 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; + 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 - ( + (tmpvar_15.z * unity_LightmapFade.z) + unity_LightmapFade.w)), 0.0, 1.0); - mediump vec4 tmpvar_55; - tmpvar_55 = (res_1 * tmpvar_54); - res_1 = tmpvar_55; - gl_FragData[0] = exp2(-(tmpvar_55)); + res_1 = (res_1 * tmpvar_48); + gl_FragData[0] = exp2(-(res_1)); } -// inputs: 2, stats: 62 alu 8 tex 4 flow +// stats: 62 alu 8 tex 4 flow +// inputs: 2 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] +// #1: xlv_TEXCOORD1 (high float) 3x1 [-1] +// uniforms: 10 (total size: 0) +// #0: _CameraToWorld (high float) 4x4 [-1] +// #1: _LightColor (high float) 4x1 [-1] +// #2: _LightMatrix0 (high float) 4x4 [-1] +// #3: _LightPos (high float) 4x1 [-1] +// #4: _LightPositionRange (high float) 4x1 [-1] +// #5: _LightShadowData (high float) 4x1 [-1] +// #6: _ProjectionParams (high float) 4x1 [-1] +// #7: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #8: _ZBufferParams (high float) 4x1 [-1] +// #9: unity_LightmapFade (high float) 4x1 [-1] +// textures: 5 +// #0: _CameraDepthTexture (low 2d) 0x0 [-1] +// #1: _CameraNormalsTexture (low 2d) 0x0 [-1] +// #2: _LightTexture0 (low cube) 0x0 [-1] +// #3: _LightTextureB0 (low 2d) 0x0 [-1] +// #4: _ShadowMapTexture (low cube) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3.txt new file mode 100644 index 000000000..2efec3708 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3.txt @@ -0,0 +1,180 @@ +#version 300 es +out mediump vec4 _fragData; +uniform sampler2D _CameraDepthTexture; +uniform sampler2D _CameraNormalsTexture; +uniform highp mat4 _CameraToWorld; +uniform highp vec4 _LightColor; +uniform highp mat4 _LightMatrix0; +uniform highp vec4 _LightPos; +uniform highp vec4 _LightPositionRange; +uniform highp vec4 _LightShadowData; +uniform lowp samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform highp vec4 _ProjectionParams; +uniform lowp samplerCube _ShadowMapTexture; +uniform highp vec3 _WorldSpaceCameraPos; +uniform highp vec4 _ZBufferParams; +uniform highp vec4 unity_LightmapFade; +in highp vec4 xlv_TEXCOORD0; +in highp vec3 xlv_TEXCOORD1; +void main () +{ + mediump vec4 res_1; + highp float spec_2; + mediump vec3 h_3; + highp float atten_4; + mediump vec3 lightDir_5; + highp vec3 tolight_6; + highp vec3 wpos_7; + highp float depth_8; + mediump vec3 normal_9; + mediump vec4 nspec_10; + highp vec2 uv_11; + uv_11 = (xlv_TEXCOORD0.xy / xlv_TEXCOORD0.w); + lowp vec4 tmpvar_12; + tmpvar_12 = texture (_CameraNormalsTexture, uv_11); + nspec_10 = tmpvar_12; + normal_9 = ((nspec_10.xyz * 2.0) - 1.0); + normal_9 = normalize(normal_9); + lowp vec4 tmpvar_13; + tmpvar_13 = texture (_CameraDepthTexture, uv_11); + depth_8 = tmpvar_13.x; + highp float tmpvar_14; + tmpvar_14 = (1.0/(((_ZBufferParams.x * depth_8) + _ZBufferParams.y))); + depth_8 = tmpvar_14; + highp vec4 tmpvar_15; + tmpvar_15.w = 1.0; + tmpvar_15.xyz = ((xlv_TEXCOORD1 * (_ProjectionParams.z / xlv_TEXCOORD1.z)) * tmpvar_14); + wpos_7 = (_CameraToWorld * tmpvar_15).xyz; + tolight_6 = (wpos_7 - _LightPos.xyz); + highp vec3 tmpvar_16; + tmpvar_16 = normalize(tolight_6); + lightDir_5 = -(tmpvar_16); + highp vec2 tmpvar_17; + tmpvar_17 = vec2((dot (tolight_6, tolight_6) * _LightPos.w)); + lowp vec4 tmpvar_18; + tmpvar_18 = texture (_LightTextureB0, tmpvar_17); + atten_4 = tmpvar_18.w; + 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 float tmpvar_36; + if (tmpvar_34.x) { + tmpvar_36 = tmpvar_35.x; + } else { + tmpvar_36 = 1.0; + }; + highp float tmpvar_37; + if (tmpvar_34.y) { + tmpvar_37 = tmpvar_35.y; + } else { + tmpvar_37 = 1.0; + }; + highp float tmpvar_38; + if (tmpvar_34.z) { + tmpvar_38 = tmpvar_35.z; + } 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( + (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; + 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 - ( + (tmpvar_15.z * unity_LightmapFade.z) + + unity_LightmapFade.w)), 0.0, 1.0); + res_1 = (res_1 * tmpvar_48); + _fragData = exp2(-(res_1)); +} + + +// stats: 62 alu 8 tex 4 flow +// inputs: 2 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] +// #1: xlv_TEXCOORD1 (high float) 3x1 [-1] +// uniforms: 10 (total size: 0) +// #0: _CameraToWorld (high float) 4x4 [-1] +// #1: _LightColor (high float) 4x1 [-1] +// #2: _LightMatrix0 (high float) 4x4 [-1] +// #3: _LightPos (high float) 4x1 [-1] +// #4: _LightPositionRange (high float) 4x1 [-1] +// #5: _LightShadowData (high float) 4x1 [-1] +// #6: _ProjectionParams (high float) 4x1 [-1] +// #7: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #8: _ZBufferParams (high float) 4x1 [-1] +// #9: unity_LightmapFade (high float) 4x1 [-1] +// textures: 5 +// #0: _CameraDepthTexture (low 2d) 0x0 [-1] +// #1: _CameraNormalsTexture (low 2d) 0x0 [-1] +// #2: _LightTexture0 (low cube) 0x0 [-1] +// #3: _LightTextureB0 (low 2d) 0x0 [-1] +// #4: _ShadowMapTexture (low cube) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3Metal.txt new file mode 100644 index 000000000..3617f59d4 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3Metal.txt @@ -0,0 +1,189 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float4 xlv_TEXCOORD0; + float3 xlv_TEXCOORD1; +}; +struct xlatMtlShaderOutput { + half4 _fragData [[color(0)]]; +}; +struct xlatMtlShaderUniform { + float4x4 _CameraToWorld; + float4 _LightColor; + float4x4 _LightMatrix0; + float4 _LightPos; + float4 _LightPositionRange; + float4 _LightShadowData; + float4 _ProjectionParams; + float3 _WorldSpaceCameraPos; + float4 _ZBufferParams; + float4 unity_LightmapFade; +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , texture2d _CameraDepthTexture [[texture(0)]], sampler _mtlsmp__CameraDepthTexture [[sampler(0)]] + , texture2d _CameraNormalsTexture [[texture(1)]], sampler _mtlsmp__CameraNormalsTexture [[sampler(1)]] + , texturecube _LightTexture0 [[texture(2)]], sampler _mtlsmp__LightTexture0 [[sampler(2)]] + , texture2d _LightTextureB0 [[texture(3)]], sampler _mtlsmp__LightTextureB0 [[sampler(3)]] + , texturecube _ShadowMapTexture [[texture(4)]], sampler _mtlsmp__ShadowMapTexture [[sampler(4)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 res_1; + float spec_2; + half3 h_3; + float atten_4; + half3 lightDir_5; + float3 tolight_6; + float3 wpos_7; + float depth_8; + half3 normal_9; + half4 nspec_10; + float2 uv_11; + uv_11 = (_mtl_i.xlv_TEXCOORD0.xy / _mtl_i.xlv_TEXCOORD0.w); + half4 tmpvar_12; + tmpvar_12 = _CameraNormalsTexture.sample(_mtlsmp__CameraNormalsTexture, (float2)(uv_11)); + nspec_10 = tmpvar_12; + normal_9 = ((nspec_10.xyz * (half)2.0) - (half)1.0); + normal_9 = normalize(normal_9); + half4 tmpvar_13; + tmpvar_13 = _CameraDepthTexture.sample(_mtlsmp__CameraDepthTexture, (float2)(uv_11)); + depth_8 = float(tmpvar_13.x); + float tmpvar_14; + tmpvar_14 = (1.0/(((_mtl_u._ZBufferParams.x * depth_8) + _mtl_u._ZBufferParams.y))); + depth_8 = tmpvar_14; + float4 tmpvar_15; + tmpvar_15.w = 1.0; + tmpvar_15.xyz = ((_mtl_i.xlv_TEXCOORD1 * (_mtl_u._ProjectionParams.z / _mtl_i.xlv_TEXCOORD1.z)) * tmpvar_14); + wpos_7 = (_mtl_u._CameraToWorld * tmpvar_15).xyz; + tolight_6 = (wpos_7 - _mtl_u._LightPos.xyz); + float3 tmpvar_16; + tmpvar_16 = normalize(tolight_6); + lightDir_5 = half3(-(tmpvar_16)); + float2 tmpvar_17; + tmpvar_17 = float2((dot (tolight_6, tolight_6) * _mtl_u._LightPos.w)); + half4 tmpvar_18; + tmpvar_18 = _LightTextureB0.sample(_mtlsmp__LightTextureB0, (float2)(tmpvar_17)); + atten_4 = float(tmpvar_18.w); + 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; + float tmpvar_36; + if (tmpvar_34.x) { + tmpvar_36 = tmpvar_35.x; + } else { + tmpvar_36 = 1.0; + }; + float tmpvar_37; + if (tmpvar_34.y) { + tmpvar_37 = tmpvar_35.y; + } else { + tmpvar_37 = 1.0; + }; + float tmpvar_38; + if (tmpvar_34.z) { + tmpvar_38 = tmpvar_35.z; + } 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( + (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); + 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 - ( + (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)); + _mtl_o._fragData = exp2(-(res_1)); + return _mtl_o; +} + + +// stats: 62 alu 8 tex 4 flow +// inputs: 2 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] +// #1: xlv_TEXCOORD1 (high float) 3x1 [-1] +// uniforms: 10 (total size: 256) +// #0: _CameraToWorld (high float) 4x4 [-1] loc 0 +// #1: _LightColor (high float) 4x1 [-1] loc 64 +// #2: _LightMatrix0 (high float) 4x4 [-1] loc 80 +// #3: _LightPos (high float) 4x1 [-1] loc 144 +// #4: _LightPositionRange (high float) 4x1 [-1] loc 160 +// #5: _LightShadowData (high float) 4x1 [-1] loc 176 +// #6: _ProjectionParams (high float) 4x1 [-1] loc 192 +// #7: _WorldSpaceCameraPos (high float) 3x1 [-1] loc 208 +// #8: _ZBufferParams (high float) 4x1 [-1] loc 224 +// #9: unity_LightmapFade (high float) 4x1 [-1] loc 240 +// textures: 5 +// #0: _CameraDepthTexture (low 2d) 0x0 [-1] loc 0 +// #1: _CameraNormalsTexture (low 2d) 0x0 [-1] loc 1 +// #2: _LightTexture0 (low cube) 0x0 [-1] loc 2 +// #3: _LightTextureB0 (low 2d) 0x0 [-1] loc 3 +// #4: _ShadowMapTexture (low cube) 0x0 [-1] loc 4 diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-inES3.txt new file mode 100644 index 000000000..55c6787ce --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-inES3.txt @@ -0,0 +1,49 @@ +#version 300 es + +#define gl_FragColor _glesFragData[0] +#define gl_FragData _glesFragData +layout(location = 0) out mediump vec4 _glesFragData[4]; + +struct v2f { + highp vec4 pos; + highp vec2 uv; +}; + +uniform sampler2D _MainTex; +uniform sampler2D _Curve; +uniform highp float _RangeScale; + +highp vec3 FromCIE( in highp vec3 Yxy ) { + highp vec3 XYZ; + XYZ.x = ((Yxy.x * Yxy.y) / Yxy.z); + XYZ.y = Yxy.x; + XYZ.z = ((Yxy.x * ((1.0 - Yxy.y) - Yxy.z)) / Yxy.z); + highp mat3 XYZ2RGB = mat3(2.5651, -1.0217, 0.0753, -1.1665, 1.9777, -0.2543, -0.3986, 0.0439, 1.1892); + return (XYZ2RGB * XYZ); +} +highp vec3 ToCIE( in highp vec3 FullScreenImage ) { + highp mat3 RGB2XYZ = mat3(0.514136, 0.265068, 0.0241188, 0.323879, 0.670234, 0.122818, 0.160364, 0.0640916, 0.844427); + highp vec3 XYZ = (RGB2XYZ * FullScreenImage.xyz); + highp vec3 Yxy; + Yxy.x = XYZ.y; + highp float temp = dot( vec3( 1.0, 1.0, 1.0), XYZ.xyz); + Yxy.yz = (XYZ.xy / temp); + return Yxy; +} +highp vec4 fragCurve( in v2f i ) { + highp vec4 color = texture( _MainTex, i.uv); + highp vec3 cie = ToCIE( color.xyz); + highp float newLum = texture( _Curve, vec2( (cie.x * _RangeScale), 0.5)).x; + cie.x = newLum; + color.xyz = FromCIE( cie); + return color; +} +in highp vec2 xlv_TEXCOORD0; +void main() { + highp vec4 xl_retval; + v2f xlt_i; + xlt_i.pos = vec4(0.0); + xlt_i.uv = vec2(xlv_TEXCOORD0); + xl_retval = fragCurve(xlt_i); + gl_FragData[0] = vec4(xl_retval); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-outES3.txt new file mode 100644 index 000000000..5b0a7e259 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-outES3.txt @@ -0,0 +1,46 @@ +#version 300 es +layout(location=0) out mediump vec4 _glesFragData[4]; +uniform sampler2D _MainTex; +uniform sampler2D _Curve; +uniform highp float _RangeScale; +in highp vec2 xlv_TEXCOORD0; +void main () +{ + highp float newLum_1; + highp vec3 cie_2; + highp vec4 color_3; + lowp vec4 tmpvar_4; + tmpvar_4 = texture (_MainTex, xlv_TEXCOORD0); + color_3 = tmpvar_4; + highp vec3 Yxy_5; + highp vec3 tmpvar_6; + tmpvar_6 = (mat3(0.514136, 0.265068, 0.0241188, 0.323879, 0.670234, 0.122818, 0.160364, 0.0640916, 0.844427) * color_3.xyz); + Yxy_5.x = tmpvar_6.y; + Yxy_5.yz = (tmpvar_6.xy / dot (vec3(1.0, 1.0, 1.0), tmpvar_6)); + cie_2.yz = Yxy_5.yz; + highp vec2 tmpvar_7; + tmpvar_7.y = 0.5; + tmpvar_7.x = (tmpvar_6.y * _RangeScale); + lowp float tmpvar_8; + tmpvar_8 = texture (_Curve, tmpvar_7).x; + newLum_1 = tmpvar_8; + cie_2.x = newLum_1; + highp vec3 XYZ_9; + XYZ_9.x = ((newLum_1 * Yxy_5.y) / Yxy_5.z); + XYZ_9.y = cie_2.x; + XYZ_9.z = ((newLum_1 * ( + (1.0 - Yxy_5.y) + - Yxy_5.z)) / Yxy_5.z); + color_3.xyz = (mat3(2.5651, -1.0217, 0.0753, -1.1665, 1.9777, -0.2543, -0.3986, 0.0439, 1.1892) * XYZ_9); + _glesFragData[0] = color_3; +} + + +// stats: 12 alu 2 tex 0 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// uniforms: 1 (total size: 0) +// #0: _RangeScale (high float) 1x1 [-1] +// textures: 2 +// #0: _MainTex (low 2d) 0x0 [-1] +// #1: _Curve (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-outES3Metal.txt new file mode 100644 index 000000000..ccff9b035 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-outES3Metal.txt @@ -0,0 +1,55 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float2 xlv_TEXCOORD0; +}; +struct xlatMtlShaderOutput { + half4 _glesFragData_0 [[color(0)]]; +}; +struct xlatMtlShaderUniform { + float _RangeScale; +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , texture2d _MainTex [[texture(0)]], sampler _mtlsmp__MainTex [[sampler(0)]] + , texture2d _Curve [[texture(1)]], sampler _mtlsmp__Curve [[sampler(1)]]) +{ + xlatMtlShaderOutput _mtl_o; + float newLum_1; + float3 cie_2; + float4 color_3; + half4 tmpvar_4; + tmpvar_4 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0)); + color_3 = float4(tmpvar_4); + float3 Yxy_5; + float3 tmpvar_6; + tmpvar_6 = (float3x3(float3(0.514136, 0.265068, 0.0241188), float3(0.323879, 0.670234, 0.122818), float3(0.160364, 0.0640916, 0.844427)) * color_3.xyz); + Yxy_5.x = tmpvar_6.y; + Yxy_5.yz = (tmpvar_6.xy / dot (float3(1.0, 1.0, 1.0), tmpvar_6)); + cie_2.yz = Yxy_5.yz; + float2 tmpvar_7; + tmpvar_7.y = 0.5; + tmpvar_7.x = (tmpvar_6.y * _mtl_u._RangeScale); + half tmpvar_8; + tmpvar_8 = _Curve.sample(_mtlsmp__Curve, (float2)(tmpvar_7)).x; + newLum_1 = float(tmpvar_8); + cie_2.x = newLum_1; + float3 XYZ_9; + XYZ_9.x = ((newLum_1 * Yxy_5.y) / Yxy_5.z); + XYZ_9.y = cie_2.x; + XYZ_9.z = ((newLum_1 * ( + (1.0 - Yxy_5.y) + - Yxy_5.z)) / Yxy_5.z); + color_3.xyz = (float3x3(float3(2.5651, -1.0217, 0.0753), float3(-1.1665, 1.9777, -0.2543), float3(-0.3986, 0.0439, 1.1892)) * XYZ_9); + _mtl_o._glesFragData_0 = half4(color_3); + return _mtl_o; +} + + +// stats: 12 alu 2 tex 0 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// uniforms: 1 (total size: 4) +// #0: _RangeScale (high float) 1x1 [-1] loc 0 +// textures: 2 +// #0: _MainTex (low 2d) 0x0 [-1] loc 0 +// #1: _Curve (low 2d) 0x0 [-1] loc 1 diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-ir.txt deleted file mode 100644 index 9c2477b9a..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-ir.txt +++ /dev/null @@ -1,381 +0,0 @@ -struct LeafSurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Translucency; - float ShadowOffset; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - vec2 hip_pack0; - vec4 lop_color; - vec3 lightDir; - vec3 viewDir; - vec2 _LightCoord; -}; -uniform sampler2D _BumpSpecMap; -uniform vec4 _Color; -uniform float _Cutoff; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _MainTex; -uniform float _ShadowStrength; -uniform vec3 _TranslucencyColor; -uniform sampler2D _TranslucencyMap; -uniform float _TranslucencyViewDependency; -varying vec2 xlv_TEXCOORD0; -varying vec4 xlv_COLOR0; -varying vec3 xlv_TEXCOORD1; -varying vec3 xlv_TEXCOORD2; -varying vec2 xlv_TEXCOORD3; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -float xll_saturate ( - in float x_2 -) -{ - float tmpvar_3; - tmpvar_3 = clamp (x_2, 0.0, 1.0); - return tmpvar_3; -} - -vec2 xll_saturate ( - in vec2 x_4 -) -{ - vec2 tmpvar_5; - tmpvar_5 = clamp (x_4, 0.0, 1.0); - return tmpvar_5; -} - -vec3 xll_saturate ( - in vec3 x_6 -) -{ - vec3 tmpvar_7; - tmpvar_7 = clamp (x_6, 0.0, 1.0); - return tmpvar_7; -} - -vec4 xll_saturate ( - in vec4 x_8 -) -{ - vec4 tmpvar_9; - tmpvar_9 = clamp (x_8, 0.0, 1.0); - return tmpvar_9; -} - -mat2 xll_saturate ( - in mat2 m_10 -) -{ - vec2 tmpvar_11; - tmpvar_11 = clamp (m_10[0], 0.0, 1.0); - vec2 tmpvar_12; - tmpvar_12 = clamp (m_10[1], 0.0, 1.0); - mat2 tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_13[0] = tmpvar_14; - vec2 tmpvar_15; - tmpvar_15 = tmpvar_12; - tmpvar_13[1] = tmpvar_15; - return tmpvar_13; -} - -mat3 xll_saturate ( - in mat3 m_16 -) -{ - vec3 tmpvar_17; - tmpvar_17 = clamp (m_16[0], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_16[1], 0.0, 1.0); - vec3 tmpvar_19; - tmpvar_19 = clamp (m_16[2], 0.0, 1.0); - mat3 tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_20[0] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_20[1] = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = tmpvar_19; - tmpvar_20[2] = tmpvar_23; - return tmpvar_20; -} - -mat4 xll_saturate ( - in mat4 m_24 -) -{ - vec4 tmpvar_25; - tmpvar_25 = clamp (m_24[0], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_24[1], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_24[2], 0.0, 1.0); - vec4 tmpvar_28; - tmpvar_28 = clamp (m_24[3], 0.0, 1.0); - mat4 tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_29[0] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_29[1] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_29[2] = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_28; - tmpvar_29[3] = tmpvar_33; - return tmpvar_29; -} - -vec4 UnpackNormal ( - in vec4 packednormal_34 -) -{ - vec4 normal_35; - vec2 tmpvar_36; - tmpvar_36 = ((packednormal_34.wy * 2.0) - 1.0); - normal_35.xy = tmpvar_36.xy.xy; - float tmpvar_37; - tmpvar_37 = sqrt (((1.0 - (normal_35.x * normal_35.x)) - (normal_35.y * normal_35.y))); - float tmpvar_38; - tmpvar_38 = tmpvar_37; - normal_35.z = vec3(tmpvar_38).z; - return normal_35; -} - -void surf ( - in Input IN_39, - inout LeafSurfaceOutput o_40 -) -{ - vec4 norspc_41; - vec4 trngls_42; - vec4 c_43; - vec4 tmpvar_44; - tmpvar_44 = texture2D (_MainTex, IN_39.uv_MainTex); - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - c_43 = tmpvar_45; - vec3 tmpvar_46; - tmpvar_46 = ((c_43.xyz * _Color.xyz) * IN_39.color.w); - o_40.Albedo = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = texture2D (_TranslucencyMap, IN_39.uv_MainTex); - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - trngls_42 = tmpvar_48; - float tmpvar_49; - tmpvar_49 = trngls_42.z; - o_40.Translucency = tmpvar_49; - float tmpvar_50; - tmpvar_50 = (trngls_42.w * _Color.x); - o_40.Gloss = tmpvar_50; - float tmpvar_51; - tmpvar_51 = c_43.w; - o_40.Alpha = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = texture2D (_BumpSpecMap, IN_39.uv_MainTex); - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - norspc_41 = tmpvar_53; - float tmpvar_54; - tmpvar_54 = norspc_41.x; - o_40.Specular = tmpvar_54; - float tmpvar_55; - tmpvar_55 = norspc_41.z; - o_40.ShadowOffset = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = UnpackNormal (norspc_41); - vec3 tmpvar_57; - tmpvar_57 = tmpvar_56.xyz; - vec3 tmpvar_58; - tmpvar_58 = tmpvar_57; - o_40.Normal = tmpvar_58; -} - -vec4 LightingTreeLeaf ( - in LeafSurfaceOutput s_59, - in vec3 lightDir_60, - in vec3 viewDir_61, - in float atten_62 -) -{ - vec4 c_63; - vec3 translucencyColor_64; - float backContrib_65; - float spec_66; - float nh_67; - float nl_68; - vec3 h_69; - vec3 tmpvar_70; - tmpvar_70 = normalize ((lightDir_60 + viewDir_61)); - vec3 tmpvar_71; - tmpvar_71 = tmpvar_70; - h_69 = tmpvar_71; - float tmpvar_72; - tmpvar_72 = dot (s_59.Normal, lightDir_60); - float tmpvar_73; - tmpvar_73 = tmpvar_72; - nl_68 = tmpvar_73; - float tmpvar_74; - tmpvar_74 = dot (s_59.Normal, h_69); - float tmpvar_75; - tmpvar_75 = max (0.0, tmpvar_74); - float tmpvar_76; - tmpvar_76 = tmpvar_75; - nh_67 = tmpvar_76; - float tmpvar_77; - tmpvar_77 = pow (nh_67, (s_59.Specular * 128.0)); - float tmpvar_78; - tmpvar_78 = (tmpvar_77 * s_59.Gloss); - spec_66 = tmpvar_78; - float tmpvar_79; - tmpvar_79 = dot (viewDir_61, -(lightDir_60)); - float tmpvar_80; - tmpvar_80 = xll_saturate (tmpvar_79); - float tmpvar_81; - tmpvar_81 = tmpvar_80; - backContrib_65 = tmpvar_81; - float tmpvar_82; - tmpvar_82 = xll_saturate (-(nl_68)); - float tmpvar_83; - tmpvar_83 = mix (tmpvar_82, backContrib_65, _TranslucencyViewDependency); - float tmpvar_84; - tmpvar_84 = tmpvar_83; - backContrib_65 = tmpvar_84; - vec3 tmpvar_85; - tmpvar_85 = ((backContrib_65 * s_59.Translucency) * _TranslucencyColor); - translucencyColor_64 = tmpvar_85; - float tmpvar_86; - tmpvar_86 = max (0.0, ((nl_68 * 0.6) + 0.4)); - float tmpvar_87; - tmpvar_87 = tmpvar_86; - nl_68 = tmpvar_87; - vec3 tmpvar_88; - tmpvar_88 = (s_59.Albedo * ((translucencyColor_64 * 2.0) + nl_68)); - c_63.xyz = tmpvar_88.xyz.xyz; - vec3 tmpvar_89; - tmpvar_89 = ((c_63.xyz * _LightColor0.xyz) + spec_66); - c_63.xyz = tmpvar_89.xyz.xyz; - float tmpvar_90; - tmpvar_90 = mix (2.0, (atten_62 * 2.0), _ShadowStrength); - vec3 tmpvar_91; - tmpvar_91 = (c_63.xyz * tmpvar_90); - c_63.xyz = tmpvar_91.xyz.xyz; - return c_63; -} - -vec4 xlat_main ( - in v2f_surf IN_92 -) -{ - vec4 c_93; - vec3 lightDir_94; - LeafSurfaceOutput o_95; - Input surfIN_96; - vec2 tmpvar_97; - tmpvar_97 = IN_92.hip_pack0.xy; - surfIN_96.uv_MainTex = tmpvar_97; - vec4 tmpvar_98; - tmpvar_98 = IN_92.lop_color; - surfIN_96.color = tmpvar_98; - vec3 tmpvar_99; - tmpvar_99 = vec3(0.0, 0.0, 0.0); - o_95.Albedo = tmpvar_99; - vec3 tmpvar_100; - tmpvar_100 = vec3(0.0, 0.0, 0.0); - o_95.Emission = tmpvar_100; - float tmpvar_101; - tmpvar_101 = 0.0; - o_95.Specular = tmpvar_101; - float tmpvar_102; - tmpvar_102 = 0.0; - o_95.Alpha = tmpvar_102; - surf (surfIN_96, o_95); - xll_clip ((o_95.Alpha - _Cutoff)); - vec3 tmpvar_103; - tmpvar_103 = IN_92.lightDir; - lightDir_94 = tmpvar_103; - vec3 tmpvar_104; - tmpvar_104 = IN_92.viewDir.xyz; - vec3 tmpvar_105; - tmpvar_105 = normalize (tmpvar_104); - vec4 tmpvar_106; - tmpvar_106 = texture2D (_LightTexture0, IN_92._LightCoord); - vec4 tmpvar_107; - tmpvar_107 = LightingTreeLeaf (o_95, lightDir_94, tmpvar_105, (tmpvar_106.w * 1.0)); - vec4 tmpvar_108; - tmpvar_108 = tmpvar_107; - c_93 = tmpvar_108; - float tmpvar_109; - tmpvar_109 = o_95.Alpha; - c_93.w = vec4(tmpvar_109).w; - return c_93; -} - -void main () -{ - v2f_surf xlt_IN_110; - vec4 xl_retval_111; - vec4 tmpvar_112; - tmpvar_112 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_110.pos = tmpvar_112; - vec2 tmpvar_113; - tmpvar_113 = xlv_TEXCOORD0.xy; - vec2 tmpvar_114; - tmpvar_114 = tmpvar_113; - xlt_IN_110.hip_pack0 = tmpvar_114; - vec4 tmpvar_115; - tmpvar_115 = xlv_COLOR0.xyzw; - vec4 tmpvar_116; - tmpvar_116 = tmpvar_115; - xlt_IN_110.lop_color = tmpvar_116; - vec3 tmpvar_117; - tmpvar_117 = xlv_TEXCOORD1.xyz; - vec3 tmpvar_118; - tmpvar_118 = tmpvar_117; - xlt_IN_110.lightDir = tmpvar_118; - vec3 tmpvar_119; - tmpvar_119 = xlv_TEXCOORD2.xyz; - vec3 tmpvar_120; - tmpvar_120 = tmpvar_119; - xlt_IN_110.viewDir = tmpvar_120; - vec2 tmpvar_121; - tmpvar_121 = xlv_TEXCOORD3.xy; - vec2 tmpvar_122; - tmpvar_122 = tmpvar_121; - xlt_IN_110._LightCoord = tmpvar_122; - vec4 tmpvar_123; - tmpvar_123 = xlat_main (xlt_IN_110); - vec4 tmpvar_124; - tmpvar_124 = tmpvar_123; - xl_retval_111 = tmpvar_124; - vec4 tmpvar_125; - tmpvar_125 = xl_retval_111.xyzw; - vec4 tmpvar_126; - tmpvar_126 = tmpvar_125; - gl_FragData[0] = tmpvar_126; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-irES.txt deleted file mode 100644 index 6f32169a5..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-irES.txt +++ /dev/null @@ -1,381 +0,0 @@ -struct LeafSurfaceOutput { - mediump vec3 Albedo; - mediump vec3 Normal; - mediump vec3 Emission; - mediump float Translucency; - mediump float ShadowOffset; - mediump float Specular; - mediump float Gloss; - mediump float Alpha; -}; -struct Input { - highp vec2 uv_MainTex; - highp vec4 color; -}; -struct v2f_surf { - highp vec4 pos; - highp vec2 hip_pack0; - highp vec4 lop_color; - highp vec3 lightDir; - highp vec3 viewDir; - highp vec2 _LightCoord; -}; -uniform sampler2D _BumpSpecMap; -uniform highp vec4 _Color; -uniform highp float _Cutoff; -uniform highp vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _MainTex; -uniform mediump float _ShadowStrength; -uniform mediump vec3 _TranslucencyColor; -uniform sampler2D _TranslucencyMap; -uniform mediump float _TranslucencyViewDependency; -varying highp vec2 xlv_TEXCOORD0; -varying highp vec4 xlv_COLOR0; -varying highp vec3 xlv_TEXCOORD1; -varying highp vec3 xlv_TEXCOORD2; -varying highp vec2 xlv_TEXCOORD3; -void xll_clip ( - in mediump float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -mediump float xll_saturate ( - in mediump float x_2 -) -{ - mediump float tmpvar_3; - tmpvar_3 = clamp (x_2, 0.0, 1.0); - return tmpvar_3; -} - -mediump vec2 xll_saturate ( - in mediump vec2 x_4 -) -{ - mediump vec2 tmpvar_5; - tmpvar_5 = clamp (x_4, 0.0, 1.0); - return tmpvar_5; -} - -mediump vec3 xll_saturate ( - in mediump vec3 x_6 -) -{ - mediump vec3 tmpvar_7; - tmpvar_7 = clamp (x_6, 0.0, 1.0); - return tmpvar_7; -} - -mediump vec4 xll_saturate ( - in mediump vec4 x_8 -) -{ - mediump vec4 tmpvar_9; - tmpvar_9 = clamp (x_8, 0.0, 1.0); - return tmpvar_9; -} - -mediump mat2 xll_saturate ( - in mediump mat2 m_10 -) -{ - mediump vec2 tmpvar_11; - tmpvar_11 = clamp (m_10[0], 0.0, 1.0); - mediump vec2 tmpvar_12; - tmpvar_12 = clamp (m_10[1], 0.0, 1.0); - mediump mat2 tmpvar_13; - mediump vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_13[0] = tmpvar_14; - mediump vec2 tmpvar_15; - tmpvar_15 = tmpvar_12; - tmpvar_13[1] = tmpvar_15; - return tmpvar_13; -} - -mediump mat3 xll_saturate ( - in mediump mat3 m_16 -) -{ - mediump vec3 tmpvar_17; - tmpvar_17 = clamp (m_16[0], 0.0, 1.0); - mediump vec3 tmpvar_18; - tmpvar_18 = clamp (m_16[1], 0.0, 1.0); - mediump vec3 tmpvar_19; - tmpvar_19 = clamp (m_16[2], 0.0, 1.0); - mediump mat3 tmpvar_20; - mediump vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_20[0] = tmpvar_21; - mediump vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_20[1] = tmpvar_22; - mediump vec3 tmpvar_23; - tmpvar_23 = tmpvar_19; - tmpvar_20[2] = tmpvar_23; - return tmpvar_20; -} - -mediump mat4 xll_saturate ( - in mediump mat4 m_24 -) -{ - mediump vec4 tmpvar_25; - tmpvar_25 = clamp (m_24[0], 0.0, 1.0); - mediump vec4 tmpvar_26; - tmpvar_26 = clamp (m_24[1], 0.0, 1.0); - mediump vec4 tmpvar_27; - tmpvar_27 = clamp (m_24[2], 0.0, 1.0); - mediump vec4 tmpvar_28; - tmpvar_28 = clamp (m_24[3], 0.0, 1.0); - mediump mat4 tmpvar_29; - mediump vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_29[0] = tmpvar_30; - mediump vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_29[1] = tmpvar_31; - mediump vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_29[2] = tmpvar_32; - mediump vec4 tmpvar_33; - tmpvar_33 = tmpvar_28; - tmpvar_29[3] = tmpvar_33; - return tmpvar_29; -} - -mediump vec4 UnpackNormal ( - in mediump vec4 packednormal_34 -) -{ - mediump vec4 normal_35; - mediump vec2 tmpvar_36; - tmpvar_36 = ((packednormal_34.wy * 2.0) - 1.0); - normal_35.xy = tmpvar_36.xy.xy; - mediump float tmpvar_37; - tmpvar_37 = sqrt (((1.0 - (normal_35.x * normal_35.x)) - (normal_35.y * normal_35.y))); - mediump float tmpvar_38; - tmpvar_38 = tmpvar_37; - normal_35.z = vec3(tmpvar_38).z; - return normal_35; -} - -void surf ( - in Input IN_39, - inout LeafSurfaceOutput o_40 -) -{ - mediump vec4 norspc_41; - mediump vec4 trngls_42; - mediump vec4 c_43; - lowp vec4 tmpvar_44; - tmpvar_44 = texture2D (_MainTex, IN_39.uv_MainTex); - lowp vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - c_43 = tmpvar_45; - highp vec3 tmpvar_46; - tmpvar_46 = ((c_43.xyz * _Color.xyz) * IN_39.color.w); - o_40.Albedo = tmpvar_46; - lowp vec4 tmpvar_47; - tmpvar_47 = texture2D (_TranslucencyMap, IN_39.uv_MainTex); - lowp vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - trngls_42 = tmpvar_48; - mediump float tmpvar_49; - tmpvar_49 = trngls_42.z; - o_40.Translucency = tmpvar_49; - highp float tmpvar_50; - tmpvar_50 = (trngls_42.w * _Color.x); - o_40.Gloss = tmpvar_50; - mediump float tmpvar_51; - tmpvar_51 = c_43.w; - o_40.Alpha = tmpvar_51; - lowp vec4 tmpvar_52; - tmpvar_52 = texture2D (_BumpSpecMap, IN_39.uv_MainTex); - lowp vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - norspc_41 = tmpvar_53; - mediump float tmpvar_54; - tmpvar_54 = norspc_41.x; - o_40.Specular = tmpvar_54; - mediump float tmpvar_55; - tmpvar_55 = norspc_41.z; - o_40.ShadowOffset = tmpvar_55; - mediump vec4 tmpvar_56; - tmpvar_56 = UnpackNormal (norspc_41); - mediump vec3 tmpvar_57; - tmpvar_57 = tmpvar_56.xyz; - mediump vec3 tmpvar_58; - tmpvar_58 = tmpvar_57; - o_40.Normal = tmpvar_58; -} - -mediump vec4 LightingTreeLeaf ( - in LeafSurfaceOutput s_59, - in mediump vec3 lightDir_60, - in mediump vec3 viewDir_61, - in mediump float atten_62 -) -{ - mediump vec4 c_63; - mediump vec3 translucencyColor_64; - mediump float backContrib_65; - mediump float spec_66; - mediump float nh_67; - mediump float nl_68; - mediump vec3 h_69; - mediump vec3 tmpvar_70; - tmpvar_70 = normalize ((lightDir_60 + viewDir_61)); - mediump vec3 tmpvar_71; - tmpvar_71 = tmpvar_70; - h_69 = tmpvar_71; - mediump float tmpvar_72; - tmpvar_72 = dot (s_59.Normal, lightDir_60); - mediump float tmpvar_73; - tmpvar_73 = tmpvar_72; - nl_68 = tmpvar_73; - mediump float tmpvar_74; - tmpvar_74 = dot (s_59.Normal, h_69); - mediump float tmpvar_75; - tmpvar_75 = max (0.0, tmpvar_74); - mediump float tmpvar_76; - tmpvar_76 = tmpvar_75; - nh_67 = tmpvar_76; - mediump float tmpvar_77; - tmpvar_77 = pow (nh_67, (s_59.Specular * 128.0)); - mediump float tmpvar_78; - tmpvar_78 = (tmpvar_77 * s_59.Gloss); - spec_66 = tmpvar_78; - mediump float tmpvar_79; - tmpvar_79 = dot (viewDir_61, -(lightDir_60)); - mediump float tmpvar_80; - tmpvar_80 = xll_saturate (tmpvar_79); - mediump float tmpvar_81; - tmpvar_81 = tmpvar_80; - backContrib_65 = tmpvar_81; - mediump float tmpvar_82; - tmpvar_82 = xll_saturate (-(nl_68)); - mediump float tmpvar_83; - tmpvar_83 = mix (tmpvar_82, backContrib_65, _TranslucencyViewDependency); - mediump float tmpvar_84; - tmpvar_84 = tmpvar_83; - backContrib_65 = tmpvar_84; - mediump vec3 tmpvar_85; - tmpvar_85 = ((backContrib_65 * s_59.Translucency) * _TranslucencyColor); - translucencyColor_64 = tmpvar_85; - mediump float tmpvar_86; - tmpvar_86 = max (0.0, ((nl_68 * 0.6) + 0.4)); - mediump float tmpvar_87; - tmpvar_87 = tmpvar_86; - nl_68 = tmpvar_87; - mediump vec3 tmpvar_88; - tmpvar_88 = (s_59.Albedo * ((translucencyColor_64 * 2.0) + nl_68)); - c_63.xyz = tmpvar_88.xyz.xyz; - highp vec3 tmpvar_89; - tmpvar_89 = ((c_63.xyz * _LightColor0.xyz) + spec_66); - c_63.xyz = tmpvar_89.xyz.xyz; - mediump float tmpvar_90; - tmpvar_90 = mix (2.0, (atten_62 * 2.0), _ShadowStrength); - mediump vec3 tmpvar_91; - tmpvar_91 = (c_63.xyz * tmpvar_90); - c_63.xyz = tmpvar_91.xyz.xyz; - return c_63; -} - -mediump vec4 xlat_main ( - in v2f_surf IN_92 -) -{ - mediump vec4 c_93; - mediump vec3 lightDir_94; - LeafSurfaceOutput o_95; - Input surfIN_96; - highp vec2 tmpvar_97; - tmpvar_97 = IN_92.hip_pack0.xy; - surfIN_96.uv_MainTex = tmpvar_97; - highp vec4 tmpvar_98; - tmpvar_98 = IN_92.lop_color; - surfIN_96.color = tmpvar_98; - mediump vec3 tmpvar_99; - tmpvar_99 = vec3(0.0, 0.0, 0.0); - o_95.Albedo = tmpvar_99; - mediump vec3 tmpvar_100; - tmpvar_100 = vec3(0.0, 0.0, 0.0); - o_95.Emission = tmpvar_100; - mediump float tmpvar_101; - tmpvar_101 = 0.0; - o_95.Specular = tmpvar_101; - mediump float tmpvar_102; - tmpvar_102 = 0.0; - o_95.Alpha = tmpvar_102; - surf (surfIN_96, o_95); - xll_clip ((o_95.Alpha - _Cutoff)); - highp vec3 tmpvar_103; - tmpvar_103 = IN_92.lightDir; - lightDir_94 = tmpvar_103; - highp vec3 tmpvar_104; - tmpvar_104 = IN_92.viewDir.xyz; - highp vec3 tmpvar_105; - tmpvar_105 = normalize (tmpvar_104); - lowp vec4 tmpvar_106; - tmpvar_106 = texture2D (_LightTexture0, IN_92._LightCoord); - mediump vec4 tmpvar_107; - tmpvar_107 = LightingTreeLeaf (o_95, lightDir_94, tmpvar_105, (tmpvar_106.w * 1.0)); - mediump vec4 tmpvar_108; - tmpvar_108 = tmpvar_107; - c_93 = tmpvar_108; - mediump float tmpvar_109; - tmpvar_109 = o_95.Alpha; - c_93.w = vec4(tmpvar_109).w; - return c_93; -} - -void main () -{ - v2f_surf xlt_IN_110; - mediump vec4 xl_retval_111; - mediump vec4 tmpvar_112; - tmpvar_112 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_110.pos = tmpvar_112; - highp vec2 tmpvar_113; - tmpvar_113 = xlv_TEXCOORD0.xy; - highp vec2 tmpvar_114; - tmpvar_114 = tmpvar_113; - xlt_IN_110.hip_pack0 = tmpvar_114; - highp vec4 tmpvar_115; - tmpvar_115 = xlv_COLOR0.xyzw; - highp vec4 tmpvar_116; - tmpvar_116 = tmpvar_115; - xlt_IN_110.lop_color = tmpvar_116; - highp vec3 tmpvar_117; - tmpvar_117 = xlv_TEXCOORD1.xyz; - highp vec3 tmpvar_118; - tmpvar_118 = tmpvar_117; - xlt_IN_110.lightDir = tmpvar_118; - highp vec3 tmpvar_119; - tmpvar_119 = xlv_TEXCOORD2.xyz; - highp vec3 tmpvar_120; - tmpvar_120 = tmpvar_119; - xlt_IN_110.viewDir = tmpvar_120; - highp vec2 tmpvar_121; - tmpvar_121 = xlv_TEXCOORD3.xy; - highp vec2 tmpvar_122; - tmpvar_122 = tmpvar_121; - xlt_IN_110._LightCoord = tmpvar_122; - mediump vec4 tmpvar_123; - tmpvar_123 = xlat_main (xlt_IN_110); - mediump vec4 tmpvar_124; - tmpvar_124 = tmpvar_123; - xl_retval_111 = tmpvar_124; - mediump vec4 tmpvar_125; - tmpvar_125 = xl_retval_111.xyzw; - mediump vec4 tmpvar_126; - tmpvar_126 = tmpvar_125; - gl_FragData[0] = tmpvar_126; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-out.txt b/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-out.txt index c615751d1..3ae3c668a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-out.txt @@ -58,4 +58,22 @@ void main () } -// inputs: 5, stats: 40 alu 5 tex 1 flow +// stats: 40 alu 5 tex 1 flow +// inputs: 5 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// #1: xlv_COLOR0 (high float) 4x1 [-1] +// #2: xlv_TEXCOORD1 (high float) 3x1 [-1] +// #3: xlv_TEXCOORD2 (high float) 3x1 [-1] +// #4: xlv_TEXCOORD3 (high float) 2x1 [-1] +// uniforms: 6 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _Cutoff (high float) 1x1 [-1] +// #2: _LightColor0 (high float) 4x1 [-1] +// #3: _ShadowStrength (high float) 1x1 [-1] +// #4: _TranslucencyColor (high float) 3x1 [-1] +// #5: _TranslucencyViewDependency (high float) 1x1 [-1] +// textures: 4 +// #0: _BumpSpecMap (high 2d) 0x0 [-1] +// #1: _LightTexture0 (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] +// #3: _TranslucencyMap (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-outES.txt index 951831c2e..e9a7ce8db 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-outES.txt @@ -25,61 +25,73 @@ void main () lowp vec4 tmpvar_8; tmpvar_8 = texture2D (_MainTex, xlv_TEXCOORD0); c_7 = tmpvar_8; - highp vec3 tmpvar_9; - tmpvar_9 = ((c_7.xyz * _Color.xyz) * xlv_COLOR0.w); - tmpvar_3 = tmpvar_9; + tmpvar_3 = ((c_7.xyz * _Color.xyz) * xlv_COLOR0.w); + lowp vec4 tmpvar_9; + tmpvar_9 = texture2D (_TranslucencyMap, xlv_TEXCOORD0); + trngls_6 = tmpvar_9; + tmpvar_4 = (trngls_6.w * _Color.x); lowp vec4 tmpvar_10; - tmpvar_10 = texture2D (_TranslucencyMap, xlv_TEXCOORD0); - trngls_6 = tmpvar_10; - highp float tmpvar_11; - tmpvar_11 = (trngls_6.w * _Color.x); - tmpvar_4 = tmpvar_11; - lowp vec4 tmpvar_12; - tmpvar_12 = texture2D (_BumpSpecMap, xlv_TEXCOORD0); - norspc_5 = tmpvar_12; - mediump vec4 normal_13; - normal_13.xy = ((norspc_5.wy * 2.0) - 1.0); - normal_13.z = sqrt(((1.0 - - (normal_13.x * normal_13.x) - ) - (normal_13.y * normal_13.y))); - highp float x_14; - x_14 = (c_7.w - _Cutoff); - if ((x_14 < 0.0)) { + tmpvar_10 = texture2D (_BumpSpecMap, xlv_TEXCOORD0); + norspc_5 = tmpvar_10; + mediump vec4 normal_11; + normal_11.xy = ((norspc_5.wy * 2.0) - 1.0); + normal_11.z = sqrt(((1.0 - + (normal_11.x * normal_11.x) + ) - (normal_11.y * normal_11.y))); + highp float x_12; + x_12 = (c_7.w - _Cutoff); + if ((x_12 < 0.0)) { discard; }; lightDir_2 = xlv_TEXCOORD1; - highp vec3 tmpvar_15; - tmpvar_15 = normalize(xlv_TEXCOORD2); - lowp vec4 tmpvar_16; - tmpvar_16 = texture2D (_LightTexture0, xlv_TEXCOORD3); - mediump vec3 viewDir_17; - viewDir_17 = tmpvar_15; - mediump float atten_18; - atten_18 = tmpvar_16.w; - mediump vec4 c_19; - mediump float tmpvar_20; - tmpvar_20 = dot (normal_13.xyz, lightDir_2); - mediump float tmpvar_21; - tmpvar_21 = (pow (max (0.0, - dot (normal_13.xyz, normalize((lightDir_2 + viewDir_17))) - ), (norspc_5.x * 128.0)) * tmpvar_4); - c_19.xyz = (tmpvar_3 * (( + highp vec3 tmpvar_13; + tmpvar_13 = normalize(xlv_TEXCOORD2); + lowp vec4 tmpvar_14; + tmpvar_14 = texture2D (_LightTexture0, xlv_TEXCOORD3); + mediump vec3 viewDir_15; + viewDir_15 = tmpvar_13; + mediump float atten_16; + atten_16 = tmpvar_14.w; + mediump vec4 c_17; + mediump float tmpvar_18; + tmpvar_18 = dot (normal_11.xyz, lightDir_2); + c_17.xyz = (tmpvar_3 * (( ((mix (clamp ( - -(tmpvar_20) + -(tmpvar_18) , 0.0, 1.0), clamp ( - dot (viewDir_17, -(lightDir_2)) + dot (viewDir_15, -(lightDir_2)) , 0.0, 1.0), _TranslucencyViewDependency) * trngls_6.z) * _TranslucencyColor) * 2.0) + max (0.0, - ((tmpvar_20 * 0.6) + 0.4) + ((tmpvar_18 * 0.6) + 0.4) ))); - highp vec3 tmpvar_22; - tmpvar_22 = ((c_19.xyz * _LightColor0.xyz) + tmpvar_21); - c_19.xyz = tmpvar_22; - c_19.xyz = (c_19.xyz * mix (2.0, (atten_18 * 2.0), _ShadowStrength)); - c_1.xyz = c_19.xyz; + c_17.xyz = ((c_17.xyz * _LightColor0.xyz) + (pow ( + max (0.0, dot (normal_11.xyz, normalize((lightDir_2 + viewDir_15)))) + , + (norspc_5.x * 128.0) + ) * tmpvar_4)); + c_17.xyz = (c_17.xyz * mix (2.0, (atten_16 * 2.0), _ShadowStrength)); + c_1.xyz = c_17.xyz; c_1.w = c_7.w; gl_FragData[0] = c_1; } -// inputs: 5, stats: 40 alu 5 tex 1 flow +// stats: 40 alu 5 tex 1 flow +// inputs: 5 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// #1: xlv_COLOR0 (high float) 4x1 [-1] +// #2: xlv_TEXCOORD1 (high float) 3x1 [-1] +// #3: xlv_TEXCOORD2 (high float) 3x1 [-1] +// #4: xlv_TEXCOORD3 (high float) 2x1 [-1] +// uniforms: 6 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _Cutoff (high float) 1x1 [-1] +// #2: _LightColor0 (high float) 4x1 [-1] +// #3: _ShadowStrength (medium float) 1x1 [-1] +// #4: _TranslucencyColor (medium float) 3x1 [-1] +// #5: _TranslucencyViewDependency (medium float) 1x1 [-1] +// textures: 4 +// #0: _BumpSpecMap (low 2d) 0x0 [-1] +// #1: _LightTexture0 (low 2d) 0x0 [-1] +// #2: _MainTex (low 2d) 0x0 [-1] +// #3: _TranslucencyMap (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-inES3.txt new file mode 100644 index 000000000..1d4e0e6a8 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-inES3.txt @@ -0,0 +1,81 @@ +#version 300 es +out mediump vec4 _fragData; +void xll_clip(float x) { + if ( x<0.0 ) discard; +} +struct v2f { + highp vec4 pos; + highp vec2 uv; + highp vec3 color; + highp vec3 backContrib; + highp vec3 nl; + highp vec3 nh; +}; +uniform lowp vec4 UNITY_LIGHTMODEL_AMBIENT; +uniform sampler2D _BumpSpecMap; +uniform lowp float _Cutoff; +uniform sampler2D _MainTex; +uniform lowp vec4 _SpecColor; +uniform highp vec4 _TerrainTreeLightColors[4]; +uniform lowp vec3 _TranslucencyColor; +uniform sampler2D _TranslucencyMap; +lowp vec4 xlat_main( in v2f i ); +lowp vec4 xlat_main( in v2f i ) { + lowp vec4 col; + lowp vec3 albedo; + mediump float specular; + lowp vec4 trngls; + mediump float gloss; + mediump vec3 light; + mediump vec3 backContribs; + highp int j = 0; + mediump vec3 lightColor; + mediump vec3 translucencyColor; + mediump float nl; + mediump float nh; + mediump float spec; + lowp vec4 c; + col = texture2D( _MainTex, i.uv); + xll_clip((col.w - _Cutoff)); + #line 35 + albedo = (col.xyz * i.color); + specular = (texture2D( _BumpSpecMap, i.uv).x * 128.000); + #line 39 + trngls = texture2D( _TranslucencyMap, i.uv); + gloss = trngls.w; + light = (vec3( UNITY_LIGHTMODEL_AMBIENT) * albedo); + #line 44 + backContribs = (i.backContrib * trngls.z); + for ( ; (j < 3); (j++)) { + #line 48 + lightColor = _TerrainTreeLightColors[j].xyz; + translucencyColor = (backContribs[j] * _TranslucencyColor); + nl = i.nl[j]; + #line 52 + nh = i.nh[j]; + spec = (pow( nh, specular) * gloss); + light += (((albedo * (translucencyColor + nl)) + (_SpecColor.xyz * spec)) * lightColor); + } + #line 58 + c.xyz = (light * 2.00000); + c.w = 1.00000; + return c; +} +in highp vec4 xlv_SV_POSITION; +in highp vec2 xlv_TEXCOORD0; +in highp vec3 xlv_TEXCOORD1; +in highp vec3 xlv_TEXCOORD2; +in highp vec3 xlv_TEXCOORD3; +in highp vec3 xlv_TEXCOORD4; +void main() { + lowp vec4 xl_retval; + v2f xlt_i; + xlt_i.pos = vec4( xlv_SV_POSITION); + xlt_i.uv = vec2( xlv_TEXCOORD0); + xlt_i.color = vec3( xlv_TEXCOORD1); + xlt_i.backContrib = vec3( xlv_TEXCOORD2); + xlt_i.nl = vec3( xlv_TEXCOORD3); + xlt_i.nh = vec3( xlv_TEXCOORD4); + xl_retval = xlat_main( xlt_i); + _fragData = vec4( xl_retval); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-irES.txt deleted file mode 100644 index c29d6caad..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-irES.txt +++ /dev/null @@ -1,171 +0,0 @@ -struct v2f { - highp vec4 pos; - highp vec2 uv; - highp vec3 color; - highp vec3 backContrib; - highp vec3 nl; - highp vec3 nh; -}; -uniform lowp vec4 UNITY_LIGHTMODEL_AMBIENT; -uniform sampler2D _BumpSpecMap; -uniform lowp float _Cutoff; -uniform sampler2D _MainTex; -uniform lowp vec4 _SpecColor; -uniform highp vec4 _TerrainTreeLightColors[4]; -uniform lowp vec3 _TranslucencyColor; -uniform sampler2D _TranslucencyMap; -varying highp vec4 xlv_SV_POSITION; -varying highp vec2 xlv_TEXCOORD0; -varying highp vec3 xlv_TEXCOORD1; -varying highp vec3 xlv_TEXCOORD2; -varying highp vec3 xlv_TEXCOORD3; -varying highp vec3 xlv_TEXCOORD4; -void xll_clip ( - in mediump float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -lowp vec4 xlat_main ( - in v2f i_2 -) -{ - lowp vec4 c_3; - mediump float spec_4; - mediump float nh_5; - mediump float nl_6; - mediump vec3 translucencyColor_7; - mediump vec3 lightColor_8; - int j_9; - mediump vec3 backContribs_10; - mediump vec3 light_11; - mediump float gloss_12; - lowp vec4 trngls_13; - mediump float specular_14; - lowp vec3 albedo_15; - lowp vec4 col_16; - int tmpvar_17; - tmpvar_17 = 0; - j_9 = tmpvar_17; - lowp vec4 tmpvar_18; - tmpvar_18 = texture2D (_MainTex, i_2.uv); - lowp vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - col_16 = tmpvar_19; - xll_clip ((col_16.w - _Cutoff)); - highp vec3 tmpvar_20; - tmpvar_20 = (col_16.xyz * i_2.color); - albedo_15 = tmpvar_20; - lowp vec4 tmpvar_21; - tmpvar_21 = texture2D (_BumpSpecMap, i_2.uv); - lowp float tmpvar_22; - tmpvar_22 = (tmpvar_21.x * 128.0); - specular_14 = tmpvar_22; - lowp vec4 tmpvar_23; - tmpvar_23 = texture2D (_TranslucencyMap, i_2.uv); - lowp vec4 tmpvar_24; - tmpvar_24 = tmpvar_23; - trngls_13 = tmpvar_24; - lowp float tmpvar_25; - tmpvar_25 = trngls_13.w; - gloss_12 = tmpvar_25; - lowp vec3 tmpvar_26; - tmpvar_26 = UNITY_LIGHTMODEL_AMBIENT.xyz; - lowp vec3 tmpvar_27; - tmpvar_27 = (tmpvar_26 * albedo_15); - light_11 = tmpvar_27; - highp vec3 tmpvar_28; - tmpvar_28 = (i_2.backContrib * trngls_13.z); - backContribs_10 = tmpvar_28; - while (true) { - if (!((j_9 < 3))) { - break; - }; - highp vec3 tmpvar_29; - tmpvar_29 = _TerrainTreeLightColors[j_9].xyz; - lightColor_8 = tmpvar_29; - mediump vec3 tmpvar_30; - tmpvar_30 = (backContribs_10[j_9] * _TranslucencyColor); - translucencyColor_7 = tmpvar_30; - highp float tmpvar_31; - tmpvar_31 = i_2.nl[j_9]; - nl_6 = tmpvar_31; - highp float tmpvar_32; - tmpvar_32 = i_2.nh[j_9]; - nh_5 = tmpvar_32; - mediump float tmpvar_33; - tmpvar_33 = pow (nh_5, specular_14); - mediump float tmpvar_34; - tmpvar_34 = (tmpvar_33 * gloss_12); - spec_4 = tmpvar_34; - mediump vec3 tmpvar_35; - tmpvar_35 = (light_11 + (( - (albedo_15 * (translucencyColor_7 + nl_6)) - + - (_SpecColor.xyz * spec_4) - ) * lightColor_8)); - light_11 = tmpvar_35; - int _post_incdec_tmp_36; - _post_incdec_tmp_36 = j_9; - int tmpvar_37; - tmpvar_37 = (j_9 + 1); - j_9 = tmpvar_37; - }; - mediump vec3 tmpvar_38; - tmpvar_38 = (light_11 * 2.0); - c_3.xyz = tmpvar_38.xyz.xyz; - mediump float tmpvar_39; - tmpvar_39 = 1.0; - c_3.w = vec4(tmpvar_39).w; - return c_3; -} - -void main () -{ - v2f xlt_i_40; - lowp vec4 xl_retval_41; - highp vec4 tmpvar_42; - tmpvar_42 = xlv_SV_POSITION.xyzw; - highp vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - xlt_i_40.pos = tmpvar_43; - highp vec2 tmpvar_44; - tmpvar_44 = xlv_TEXCOORD0.xy; - highp vec2 tmpvar_45; - tmpvar_45 = tmpvar_44; - xlt_i_40.uv = tmpvar_45; - highp vec3 tmpvar_46; - tmpvar_46 = xlv_TEXCOORD1.xyz; - highp vec3 tmpvar_47; - tmpvar_47 = tmpvar_46; - xlt_i_40.color = tmpvar_47; - highp vec3 tmpvar_48; - tmpvar_48 = xlv_TEXCOORD2.xyz; - highp vec3 tmpvar_49; - tmpvar_49 = tmpvar_48; - xlt_i_40.backContrib = tmpvar_49; - highp vec3 tmpvar_50; - tmpvar_50 = xlv_TEXCOORD3.xyz; - highp vec3 tmpvar_51; - tmpvar_51 = tmpvar_50; - xlt_i_40.nl = tmpvar_51; - highp vec3 tmpvar_52; - tmpvar_52 = xlv_TEXCOORD4.xyz; - highp vec3 tmpvar_53; - tmpvar_53 = tmpvar_52; - xlt_i_40.nh = tmpvar_53; - lowp vec4 tmpvar_54; - tmpvar_54 = xlat_main (xlt_i_40); - lowp vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - xl_retval_41 = tmpvar_55; - lowp vec4 tmpvar_56; - tmpvar_56 = xl_retval_41.xyzw; - lowp vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - gl_FragData[0] = tmpvar_57; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES.txt index a98e6af87..32a5b73d4 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES.txt @@ -29,71 +29,59 @@ void main () if ((x_11 < 0.0)) { discard; }; - highp vec3 tmpvar_12; - tmpvar_12 = (tmpvar_10.xyz * xlv_TEXCOORD1); - albedo_9 = tmpvar_12; - lowp float tmpvar_13; - tmpvar_13 = (texture2D (_BumpSpecMap, xlv_TEXCOORD0).x * 128.0); - specular_8 = tmpvar_13; - lowp vec4 tmpvar_14; - tmpvar_14 = texture2D (_TranslucencyMap, xlv_TEXCOORD0); - lowp float tmpvar_15; - tmpvar_15 = tmpvar_14.w; - gloss_7 = tmpvar_15; - lowp vec3 tmpvar_16; - tmpvar_16 = (UNITY_LIGHTMODEL_AMBIENT.xyz * albedo_9); - light_6 = tmpvar_16; - highp vec3 tmpvar_17; - tmpvar_17 = (xlv_TEXCOORD2 * tmpvar_14.z); - backContribs_5 = tmpvar_17; - highp vec3 tmpvar_18; - tmpvar_18 = _TerrainTreeLightColors[0].xyz; - lightColor_4 = tmpvar_18; - highp float tmpvar_19; - tmpvar_19 = xlv_TEXCOORD3.x; - nl_3 = tmpvar_19; - highp float tmpvar_20; - tmpvar_20 = xlv_TEXCOORD4.x; - nh_2 = tmpvar_20; + albedo_9 = (tmpvar_10.xyz * xlv_TEXCOORD1); + lowp vec4 tmpvar_12; + tmpvar_12 = texture2D (_BumpSpecMap, xlv_TEXCOORD0); + specular_8 = (tmpvar_12.x * 128.0); + lowp vec4 tmpvar_13; + tmpvar_13 = texture2D (_TranslucencyMap, xlv_TEXCOORD0); + gloss_7 = tmpvar_13.w; + light_6 = (UNITY_LIGHTMODEL_AMBIENT.xyz * albedo_9); + backContribs_5 = (xlv_TEXCOORD2 * tmpvar_13.z); + lightColor_4 = _TerrainTreeLightColors[0].xyz; + nl_3 = xlv_TEXCOORD3.x; + nh_2 = xlv_TEXCOORD4.x; light_6 = (light_6 + (( (albedo_9 * ((backContribs_5.x * _TranslucencyColor) + nl_3)) + (_SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7)) ) * lightColor_4)); - highp vec3 tmpvar_21; - tmpvar_21 = _TerrainTreeLightColors[1].xyz; - lightColor_4 = tmpvar_21; - highp float tmpvar_22; - tmpvar_22 = xlv_TEXCOORD3.y; - nl_3 = tmpvar_22; - highp float tmpvar_23; - tmpvar_23 = xlv_TEXCOORD4.y; - nh_2 = tmpvar_23; + lightColor_4 = _TerrainTreeLightColors[1].xyz; + nl_3 = xlv_TEXCOORD3.y; + nh_2 = xlv_TEXCOORD4.y; light_6 = (light_6 + (( (albedo_9 * ((backContribs_5.y * _TranslucencyColor) + nl_3)) + (_SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7)) ) * lightColor_4)); - highp vec3 tmpvar_24; - tmpvar_24 = _TerrainTreeLightColors[2].xyz; - lightColor_4 = tmpvar_24; - highp float tmpvar_25; - tmpvar_25 = xlv_TEXCOORD3.z; - nl_3 = tmpvar_25; - highp float tmpvar_26; - tmpvar_26 = xlv_TEXCOORD4.z; - nh_2 = tmpvar_26; + lightColor_4 = _TerrainTreeLightColors[2].xyz; + nl_3 = xlv_TEXCOORD3.z; + nh_2 = xlv_TEXCOORD4.z; light_6 = (light_6 + (( (albedo_9 * ((backContribs_5.z * _TranslucencyColor) + nl_3)) + (_SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7)) ) * lightColor_4)); - mediump vec3 tmpvar_27; - tmpvar_27 = (light_6 * 2.0); - c_1.xyz = tmpvar_27; + c_1.xyz = (light_6 * 2.0); c_1.w = 1.0; gl_FragData[0] = c_1; } -// inputs: 5, stats: 35 alu 4 tex 1 flow +// stats: 35 alu 4 tex 1 flow +// inputs: 5 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// #1: xlv_TEXCOORD1 (high float) 3x1 [-1] +// #2: xlv_TEXCOORD2 (high float) 3x1 [-1] +// #3: xlv_TEXCOORD3 (high float) 3x1 [-1] +// #4: xlv_TEXCOORD4 (high float) 3x1 [-1] +// uniforms: 5 (total size: 0) +// #0: UNITY_LIGHTMODEL_AMBIENT (low float) 4x1 [-1] +// #1: _Cutoff (low float) 1x1 [-1] +// #2: _SpecColor (low float) 4x1 [-1] +// #3: _TerrainTreeLightColors (high float) 4x1 [4] +// #4: _TranslucencyColor (low float) 3x1 [-1] +// textures: 3 +// #0: _BumpSpecMap (low 2d) 0x0 [-1] +// #1: _MainTex (low 2d) 0x0 [-1] +// #2: _TranslucencyMap (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES3.txt new file mode 100644 index 000000000..f7a25f427 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES3.txt @@ -0,0 +1,89 @@ +#version 300 es +out mediump vec4 _fragData; +uniform lowp vec4 UNITY_LIGHTMODEL_AMBIENT; +uniform sampler2D _BumpSpecMap; +uniform lowp float _Cutoff; +uniform sampler2D _MainTex; +uniform lowp vec4 _SpecColor; +uniform highp vec4 _TerrainTreeLightColors[4]; +uniform lowp vec3 _TranslucencyColor; +uniform sampler2D _TranslucencyMap; +in highp vec2 xlv_TEXCOORD0; +in highp vec3 xlv_TEXCOORD1; +in highp vec3 xlv_TEXCOORD2; +in highp vec3 xlv_TEXCOORD3; +in highp vec3 xlv_TEXCOORD4; +void main () +{ + lowp vec4 c_1; + mediump float nh_2; + mediump float nl_3; + mediump vec3 lightColor_4; + mediump vec3 backContribs_5; + mediump vec3 light_6; + mediump float gloss_7; + mediump float specular_8; + lowp vec3 albedo_9; + lowp vec4 tmpvar_10; + tmpvar_10 = texture (_MainTex, xlv_TEXCOORD0); + lowp float x_11; + x_11 = (tmpvar_10.w - _Cutoff); + if ((x_11 < 0.0)) { + discard; + }; + albedo_9 = (tmpvar_10.xyz * xlv_TEXCOORD1); + lowp vec4 tmpvar_12; + tmpvar_12 = texture (_BumpSpecMap, xlv_TEXCOORD0); + specular_8 = (tmpvar_12.x * 128.0); + lowp vec4 tmpvar_13; + tmpvar_13 = texture (_TranslucencyMap, xlv_TEXCOORD0); + gloss_7 = tmpvar_13.w; + light_6 = (UNITY_LIGHTMODEL_AMBIENT.xyz * albedo_9); + backContribs_5 = (xlv_TEXCOORD2 * tmpvar_13.z); + lightColor_4 = _TerrainTreeLightColors[0].xyz; + nl_3 = xlv_TEXCOORD3.x; + nh_2 = xlv_TEXCOORD4.x; + light_6 = (light_6 + (( + (albedo_9 * ((backContribs_5.x * _TranslucencyColor) + nl_3)) + + + (_SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7)) + ) * lightColor_4)); + lightColor_4 = _TerrainTreeLightColors[1].xyz; + nl_3 = xlv_TEXCOORD3.y; + nh_2 = xlv_TEXCOORD4.y; + light_6 = (light_6 + (( + (albedo_9 * ((backContribs_5.y * _TranslucencyColor) + nl_3)) + + + (_SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7)) + ) * lightColor_4)); + lightColor_4 = _TerrainTreeLightColors[2].xyz; + nl_3 = xlv_TEXCOORD3.z; + nh_2 = xlv_TEXCOORD4.z; + light_6 = (light_6 + (( + (albedo_9 * ((backContribs_5.z * _TranslucencyColor) + nl_3)) + + + (_SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7)) + ) * lightColor_4)); + c_1.xyz = (light_6 * 2.0); + c_1.w = 1.0; + _fragData = c_1; +} + + +// stats: 35 alu 4 tex 1 flow +// inputs: 5 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// #1: xlv_TEXCOORD1 (high float) 3x1 [-1] +// #2: xlv_TEXCOORD2 (high float) 3x1 [-1] +// #3: xlv_TEXCOORD3 (high float) 3x1 [-1] +// #4: xlv_TEXCOORD4 (high float) 3x1 [-1] +// uniforms: 5 (total size: 0) +// #0: UNITY_LIGHTMODEL_AMBIENT (low float) 4x1 [-1] +// #1: _Cutoff (low float) 1x1 [-1] +// #2: _SpecColor (low float) 4x1 [-1] +// #3: _TerrainTreeLightColors (high float) 4x1 [4] +// #4: _TranslucencyColor (low float) 3x1 [-1] +// textures: 3 +// #0: _BumpSpecMap (low 2d) 0x0 [-1] +// #1: _MainTex (low 2d) 0x0 [-1] +// #2: _TranslucencyMap (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES3Metal.txt new file mode 100644 index 000000000..bbec809e1 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES3Metal.txt @@ -0,0 +1,98 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float2 xlv_TEXCOORD0; + float3 xlv_TEXCOORD1; + float3 xlv_TEXCOORD2; + float3 xlv_TEXCOORD3; + float3 xlv_TEXCOORD4; +}; +struct xlatMtlShaderOutput { + half4 _fragData [[color(0)]]; +}; +struct xlatMtlShaderUniform { + half4 UNITY_LIGHTMODEL_AMBIENT; + half _Cutoff; + half4 _SpecColor; + float4 _TerrainTreeLightColors[4]; + half3 _TranslucencyColor; +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , texture2d _BumpSpecMap [[texture(0)]], sampler _mtlsmp__BumpSpecMap [[sampler(0)]] + , texture2d _MainTex [[texture(1)]], sampler _mtlsmp__MainTex [[sampler(1)]] + , texture2d _TranslucencyMap [[texture(2)]], sampler _mtlsmp__TranslucencyMap [[sampler(2)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 c_1; + half nh_2; + half nl_3; + half3 lightColor_4; + half3 backContribs_5; + half3 light_6; + half gloss_7; + half specular_8; + half3 albedo_9; + half4 tmpvar_10; + tmpvar_10 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0)); + half x_11; + x_11 = (tmpvar_10.w - _mtl_u._Cutoff); + if ((x_11 < (half)0.0)) { + discard_fragment(); + }; + albedo_9 = half3(((float3)tmpvar_10.xyz * _mtl_i.xlv_TEXCOORD1)); + half4 tmpvar_12; + tmpvar_12 = _BumpSpecMap.sample(_mtlsmp__BumpSpecMap, (float2)(_mtl_i.xlv_TEXCOORD0)); + specular_8 = (tmpvar_12.x * (half)128.0); + half4 tmpvar_13; + tmpvar_13 = _TranslucencyMap.sample(_mtlsmp__TranslucencyMap, (float2)(_mtl_i.xlv_TEXCOORD0)); + gloss_7 = tmpvar_13.w; + light_6 = (_mtl_u.UNITY_LIGHTMODEL_AMBIENT.xyz * albedo_9); + backContribs_5 = half3((_mtl_i.xlv_TEXCOORD2 * (float)tmpvar_13.z)); + lightColor_4 = half3(_mtl_u._TerrainTreeLightColors[0].xyz); + nl_3 = half(_mtl_i.xlv_TEXCOORD3.x); + nh_2 = half(_mtl_i.xlv_TEXCOORD4.x); + light_6 = (light_6 + (( + (albedo_9 * ((backContribs_5.x * _mtl_u._TranslucencyColor) + nl_3)) + + + (_mtl_u._SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7)) + ) * lightColor_4)); + lightColor_4 = half3(_mtl_u._TerrainTreeLightColors[1].xyz); + nl_3 = half(_mtl_i.xlv_TEXCOORD3.y); + nh_2 = half(_mtl_i.xlv_TEXCOORD4.y); + light_6 = (light_6 + (( + (albedo_9 * ((backContribs_5.y * _mtl_u._TranslucencyColor) + nl_3)) + + + (_mtl_u._SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7)) + ) * lightColor_4)); + lightColor_4 = half3(_mtl_u._TerrainTreeLightColors[2].xyz); + nl_3 = half(_mtl_i.xlv_TEXCOORD3.z); + nh_2 = half(_mtl_i.xlv_TEXCOORD4.z); + light_6 = (light_6 + (( + (albedo_9 * ((backContribs_5.z * _mtl_u._TranslucencyColor) + nl_3)) + + + (_mtl_u._SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7)) + ) * lightColor_4)); + c_1.xyz = (light_6 * (half)2.0); + c_1.w = half(1.0); + _mtl_o._fragData = c_1; + return _mtl_o; +} + + +// stats: 35 alu 4 tex 1 flow +// inputs: 5 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// #1: xlv_TEXCOORD1 (high float) 3x1 [-1] +// #2: xlv_TEXCOORD2 (high float) 3x1 [-1] +// #3: xlv_TEXCOORD3 (high float) 3x1 [-1] +// #4: xlv_TEXCOORD4 (high float) 3x1 [-1] +// uniforms: 5 (total size: 104) +// #0: UNITY_LIGHTMODEL_AMBIENT (low float) 4x1 [-1] loc 0 +// #1: _Cutoff (low float) 1x1 [-1] loc 8 +// #2: _SpecColor (low float) 4x1 [-1] loc 16 +// #3: _TerrainTreeLightColors (high float) 4x1 [4] loc 32 +// #4: _TranslucencyColor (low float) 3x1 [-1] loc 96 +// textures: 3 +// #0: _BumpSpecMap (low 2d) 0x0 [-1] loc 0 +// #1: _MainTex (low 2d) 0x0 [-1] loc 1 +// #2: _TranslucencyMap (low 2d) 0x0 [-1] loc 2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-inES3.txt new file mode 100644 index 000000000..11741cf3b --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-inES3.txt @@ -0,0 +1,259 @@ +#version 300 es +out mediump vec4 _fragData; + +vec4 xll_texCUBElod(samplerCube s, vec4 coord) { + return textureLod( s, coord.xyz, coord.w); +} +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]); +} +float xll_saturate_f( float x) { + return clamp( x, 0.0, 1.0); +} +vec3 xll_saturate_vf3( vec3 x) { + return clamp( x, 0.0, 1.0); +} +vec3 xll_matrixindex_mf3x3_i (mat3 m, int i) { vec3 v; v.x=m[0][i]; v.y=m[1][i]; v.z=m[2][i]; return v; } +struct VertexOutput { + vec4 pos; + vec4 tex; + vec4 posWorld; + vec3 normalWorld; + vec4 tangentWorld; + vec3 extra; + vec4 _ShadowCoord; + vec3 lightDir; +}; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _ProjectionParams; +uniform vec4 _ScreenParams; +uniform vec4 _ZBufferParams; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_SHAr; +uniform vec4 unity_SHAg; +uniform vec4 unity_SHAb; +uniform vec4 unity_SHBr; +uniform vec4 unity_SHBg; +uniform vec4 unity_SHBb; +uniform vec4 unity_SHC; +uniform vec4 _LightShadowData; + + +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec4 unity_Scale; +uniform mat4 glstate_matrix_transpose_modelview0; + + + + +uniform mat4 unity_MatrixV; +uniform mat4 unity_MatrixVP; +uniform samplerCube _Cube; +uniform sampler2D _MainTex; +uniform vec4 _MainTex_ST; +uniform sampler2D _DetailAlbedoMap; +uniform vec4 _DetailAlbedoMap_ST; +uniform sampler2D _AlphaMap; +uniform sampler2D _Occlusion; +uniform sampler2D _DetailNormalMap; +uniform vec4 _DetailNormalMap_ST; +uniform float _DetailNormalMapScale; +uniform sampler2D _BumpMap; +uniform float _BumpScale; +uniform float _Exposure; +uniform float _DetailBumpScale; +uniform float _AlphaTestRef; +uniform float _DetailBumpTiling; +uniform vec4 _Color; +uniform vec4 _SpecularColor; +uniform sampler2D _SpecGlossMap; +uniform float _Glossiness; + +uniform vec4 unity_ColorSpaceGrey; + +uniform sampler2D _ShadowMapTexture; +uniform vec4 _LightColor0; + +uniform samplerCube _SpecCube; +uniform vec4 unity_LightmapST; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; +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); + return albedo; +} +float Alpha( in vec2 uv ) { + return (texture2D( _AlphaMap, uv).w * _Color.w); +} +float BlinnPhongTerm( in float roughness, in float NdotH ) { + float m = (pow( roughness, 4.0) + 1e-05); + float n = ((1.0 / m) - 2.0); + float normTerm = ((n + 1.0) / 6.28318); + float specTerm = pow( NdotH, n); + return (specTerm * normTerm); +} +float BlinnTerm( in vec3 normal, in vec3 halfDir ) { + return max( 0.0, dot( normal, halfDir)); +} +float FresnelTerm( in float F0, in float cosA ) { + float _Falloff = 5.0; + float t = pow( abs((1.0 - cosA)), _Falloff); + return (F0 + ((1.0 - F0) * t)); +} +float CTGeometricTerm( in float NdotL, in float NdotH, in float NdotV, in float VdotH ) { + VdotH += 1e-05; + return min( 1.0, min( (((2.0 * NdotH) * NdotV) / VdotH), (((2.0 * NdotH) * NdotL) / VdotH))); +} +float GeometricTerm( in float NdotL, in float NdotH, in float NdotV, in float VdotH, in float LdotV ) { + return CTGeometricTerm( NdotL, NdotH, NdotV, VdotH); +} +float LambertTerm( in vec3 normal, in vec3 lightDir ) { + return max( 0.0, dot( normal, lightDir)); +} +float RGBToLuminance( in vec3 color ) { + vec3 lumSensitivity = vec3( 0.299, 0.587, 0.114); + float luminance = dot( color, lumSensitivity); + return luminance; +} +vec3 BRDF_Disney_PBS( in vec3 baseColor, in vec3 lightColor, in vec3 specColor, in float specular, in float roughness, in vec3 normal, in vec3 lightDir, in vec3 viewDir, in vec3 ambient, in vec3 env ) { + vec3 halfDir = normalize((lightDir + viewDir)); + float nl = LambertTerm( normal, lightDir); + float nh = BlinnTerm( normal, halfDir); + float nv = max( 0.0, dot( normal, viewDir)); + float vh = max( 0.0, dot( viewDir, halfDir)); + float lv = max( 0.0, dot( lightDir, viewDir)); + float lh = max( 0.0, dot( lightDir, halfDir)); + float F = FresnelTerm( specular, vh); + float G = GeometricTerm( nl, nh, nv, vh, lv); + float R = BlinnPhongTerm( roughness, nh); + R = max( 0.0, R); + float Fd90 = (0.5 + ((2.0 * pow( lh, 2.0)) * roughness)); + float nlPow = pow( (1.00001 - nl), 5.0); + float nvPow = pow( (1.00001 - nv), 5.0); + float disneyDiffuse = ((1.0 + ((Fd90 - 1.0) * nlPow)) * (1.0 + ((Fd90 - 1.0) * nvPow))); + float specularTerm = max( 0.0, (((F * G) * R) / ((4.0 * nv) + 1e-05))); + float diffuseTerm = (disneyDiffuse * nl); + vec3 diffuseColor = baseColor; + vec3 color = (((diffuseColor * (ambient + (diffuseTerm * lightColor))) + (specColor * (env + (lightColor * specularTerm)))) + ((((1.0 - RGBToLuminance( specColor)) * (1.0 - roughness)) * FresnelTerm( 0.0, nv)) * env)); + return color; +} +vec3 DecodeLightmap( in vec4 color ) { + return ((8.0 * color.w) * color.xyz); +} +vec3 DirLightmapDiffuse( in mat3 dirBasis, in vec4 color, in vec4 scale, in vec3 normal, in bool surfFuncWritesNormal, out vec3 scalePerBasisVector ) { + vec3 lm = DecodeLightmap( color); + scalePerBasisVector = DecodeLightmap( scale); + if (surfFuncWritesNormal){ + vec3 normalInRnmBasis = xll_saturate_vf3((dirBasis * normal)); + lm *= dot( normalInRnmBasis, scalePerBasisVector); + } + return lm; +} +void DecodeDirLightmap( in vec3 normal, in vec4 colorLM, in vec4 scaleLM, out vec3 lightColor, out vec3 lightDir ) { + mat3 unity_DirBasis = xll_transpose_mf3x3(mat3( vec3( 0.816497, 0.0, 0.57735), vec3( -0.408248, 0.707107, 0.57735), vec3( -0.408248, -0.707107, 0.57735))); + vec3 scalePerBasisVector; + lightColor = DirLightmapDiffuse( unity_DirBasis, colorLM, scaleLM, normal, true, scalePerBasisVector); + lightDir = normalize((((scalePerBasisVector.x * xll_matrixindex_mf3x3_i (unity_DirBasis, 0)) + (scalePerBasisVector.y * xll_matrixindex_mf3x3_i (unity_DirBasis, 1))) + (scalePerBasisVector.z * xll_matrixindex_mf3x3_i (unity_DirBasis, 2)))); +} +vec3 EnergyCalculator( in vec3 specColor, in float specular, in vec3 baseColor ) { + return min( baseColor, (vec3( 1.0, 1.0, 1.0) - specular)); +} +float toLinearFast1( in float c ) { + float c2 = (c * c); + return dot( vec2( 0.7532, 0.2468), vec2( c2, (c * c2))); +} +vec3 fromRGBM( in vec4 c ) { + return ((c.xyz * toLinearFast1( c.w)) * _Exposure); +} +vec3 EnvMap( in vec4 worldNormal ) { + vec4 envTexel = xll_texCUBElod( _SpecCube, vec4( worldNormal.xyz, worldNormal.w)); + return fromRGBM( envTexel); +} +float Occlusion( in vec2 uv ) { + return texture2D( _Occlusion, uv).x; +} +vec4 SpecularGloss( in vec2 uv ) { + vec4 specGloss = texture2D( _SpecGlossMap, uv); + return vec4( specGloss.xyz, specGloss.w); +} +vec3 BlendNormals( in vec3 n1, in vec3 n2 ) { + return normalize(vec3( (n1.xy + n2.xy), (n1.z * n2.z))); +} +vec3 UnpackScaleNormal( in vec4 packednormal, in float bumpScale ) { + vec3 normal; + normal.xy = ((packednormal.wy * 2.0) - 1.0); + normal.xy *= bumpScale; + normal.z = sqrt((1.0 - xll_saturate_f(dot( normal.xy, normal.xy)))); + return normal; +} +vec3 TangentNormal( in vec4 texcoords ) { + vec3 normalTangent = UnpackScaleNormal( texture2D( _BumpMap, texcoords.xy), _BumpScale); + vec3 detailNormalTangent = UnpackScaleNormal( texture2D( _DetailNormalMap, texcoords.zw), _DetailNormalMapScale); + normalTangent = BlendNormals( normalTangent, detailNormalTangent); + return normalTangent; +} +mat3 TangentToWorld( in vec3 normal, in vec3 tangent, in vec3 flip ) { + vec3 binormal = (cross( normal, tangent) * flip); + return xll_transpose_mf3x3(mat3( tangent, binormal, normal)); +} +float unitySampleShadow( in vec4 shadowCoord ) { + float shadow = texture2DProj( _ShadowMapTexture, shadowCoord).x; + return shadow; +} +vec4 frag( in VertexOutput i ) { + float atten = unitySampleShadow( i._ShadowCoord); + mat3 tanToWorld = TangentToWorld( i.normalWorld, i.tangentWorld.xyz, vec3( i.tangentWorld.w)); + i.normalWorld = normalize(i.normalWorld); + vec3 normalTangent = TangentNormal( i.tex); + vec3 normalWorld = (normalTangent * tanToWorld); + vec3 eyeVec = normalize((i.posWorld.xyz - _WorldSpaceCameraPos)); + vec4 specGloss = SpecularGloss( i.tex.xy); + vec3 specColor = specGloss.xyz; + float specular = RGBToLuminance( specGloss.xyz); + float roughness = (1.0 - specGloss.w); + vec3 env = vec3( 0.0); + env = (EnvMap( vec4( reflect( eyeVec, normalWorld), (roughness * 5.0))) * Occlusion( i.tex.xy)); + vec3 lightColor = (_LightColor0.xyz * 2.0); + 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); + 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); + float alpha = Alpha( i.tex.xy); + return vec4( color, alpha); +} +in vec4 xlv_TEXCOORD0; +in vec4 xlv_TEXCOORD1; +in vec3 xlv_TEXCOORD2; +in vec4 xlv_TEXCOORD3; +in vec3 xlv_TEXCOORD4; +in vec4 xlv_TEXCOORD5; +in vec3 xlv_TEXCOORD7; +void main() { + vec4 xl_retval; + VertexOutput xlt_i; + xlt_i.pos = vec4(0.0); + xlt_i.tex = vec4(xlv_TEXCOORD0); + xlt_i.posWorld = vec4(xlv_TEXCOORD1); + xlt_i.normalWorld = vec3(xlv_TEXCOORD2); + xlt_i.tangentWorld = vec4(xlv_TEXCOORD3); + xlt_i.extra = vec3(xlv_TEXCOORD4); + xlt_i._ShadowCoord = vec4(xlv_TEXCOORD5); + xlt_i.lightDir = vec3(xlv_TEXCOORD7); + xl_retval = frag( xlt_i); + _fragData = vec4(xl_retval); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-ir.txt deleted file mode 100644 index 72e73936a..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-ir.txt +++ /dev/null @@ -1,894 +0,0 @@ -#extension GL_ARB_shader_texture_lod : enable -struct VertexOutput { - vec4 pos; - vec4 tex; - vec4 posWorld; - vec3 normalWorld; - vec4 tangentWorld; - vec3 extra; - vec4 _ShadowCoord; - vec3 lightDir; -}; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _ProjectionParams; -uniform vec4 _ScreenParams; -uniform vec4 _ZBufferParams; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_SHAr; -uniform vec4 unity_SHAg; -uniform vec4 unity_SHAb; -uniform vec4 unity_SHBr; -uniform vec4 unity_SHBg; -uniform vec4 unity_SHBb; -uniform vec4 unity_SHC; -uniform vec4 _LightShadowData; -uniform mat4 _Object2World; -uniform mat4 _World2Object; -uniform vec4 unity_Scale; -uniform mat4 glstate_matrix_transpose_modelview0; -uniform mat4 unity_MatrixV; -uniform mat4 unity_MatrixVP; -uniform samplerCube _Cube; -uniform sampler2D _MainTex; -uniform vec4 _MainTex_ST; -uniform sampler2D _DetailAlbedoMap; -uniform vec4 _DetailAlbedoMap_ST; -uniform sampler2D _AlphaMap; -uniform sampler2D _Occlusion; -uniform sampler2D _DetailNormalMap; -uniform vec4 _DetailNormalMap_ST; -uniform float _DetailNormalMapScale; -uniform sampler2D _BumpMap; -uniform float _BumpScale; -uniform float _Exposure; -uniform float _DetailBumpScale; -uniform float _AlphaTestRef; -uniform float _DetailBumpTiling; -uniform vec4 _Color; -uniform vec4 _SpecularColor; -uniform sampler2D _SpecGlossMap; -uniform float _Glossiness; -uniform vec4 unity_ColorSpaceGrey; -uniform sampler2D _ShadowMapTexture; -uniform vec4 _LightColor0; -uniform samplerCube _SpecCube; -uniform vec4 unity_LightmapST; -uniform sampler2D unity_Lightmap; -uniform sampler2D unity_LightmapInd; -uniform float _SelfIllumScale; -uniform sampler2D _SelfIllum; -varying vec4 xlv_TEXCOORD0; -varying vec4 xlv_TEXCOORD1; -varying vec3 xlv_TEXCOORD2; -varying vec4 xlv_TEXCOORD3; -varying vec3 xlv_TEXCOORD4; -varying vec4 xlv_TEXCOORD5; -varying vec3 xlv_TEXCOORD7; -vec4 xll_texCUBElod ( - in samplerCube s_1, - in vec4 coord_2 -) -{ - vec4 tmpvar_3; - tmpvar_3 = textureCubeLod (s_1, coord_2.xyz, coord_2.w); - return tmpvar_3; -} - -mat3 xll_transpose_mf3x3 ( - in mat3 m_4 -) -{ - mat3 tmpvar_5; - float tmpvar_6; - tmpvar_6 = m_4[0][0]; - tmpvar_5[0].x = tmpvar_6; - float tmpvar_7; - tmpvar_7 = m_4[1][0]; - tmpvar_5[0].y = tmpvar_7; - float tmpvar_8; - tmpvar_8 = m_4[2][0]; - tmpvar_5[0].z = tmpvar_8; - float tmpvar_9; - tmpvar_9 = m_4[0][1]; - tmpvar_5[1].x = tmpvar_9; - float tmpvar_10; - tmpvar_10 = m_4[1][1]; - tmpvar_5[1].y = tmpvar_10; - float tmpvar_11; - tmpvar_11 = m_4[2][1]; - tmpvar_5[1].z = tmpvar_11; - float tmpvar_12; - tmpvar_12 = m_4[0][2]; - tmpvar_5[2].x = tmpvar_12; - float tmpvar_13; - tmpvar_13 = m_4[1][2]; - tmpvar_5[2].y = tmpvar_13; - float tmpvar_14; - tmpvar_14 = m_4[2][2]; - tmpvar_5[2].z = tmpvar_14; - return tmpvar_5; -} - -float xll_saturate_f ( - in float x_15 -) -{ - float tmpvar_16; - tmpvar_16 = clamp (x_15, 0.0, 1.0); - return tmpvar_16; -} - -vec3 xll_saturate_vf3 ( - in vec3 x_17 -) -{ - vec3 tmpvar_18; - tmpvar_18 = clamp (x_17, 0.0, 1.0); - return tmpvar_18; -} - -vec3 xll_matrixindex_mf3x3_i ( - in mat3 m_19, - in int i_20 -) -{ - vec3 v_21; - float tmpvar_22; - tmpvar_22 = m_19[0][i_20]; - v_21.x = tmpvar_22; - float tmpvar_23; - tmpvar_23 = m_19[1][i_20]; - v_21.y = vec2(tmpvar_23).y; - float tmpvar_24; - tmpvar_24 = m_19[2][i_20]; - v_21.z = vec3(tmpvar_24).z; - return v_21; -} - -vec3 Albedo ( - in vec4 texcoords_25 -) -{ - vec3 albedo_26; - vec4 tmpvar_27; - tmpvar_27 = texture2D (_MainTex, texcoords_25.xy); - vec3 tmpvar_28; - tmpvar_28 = (_Color.xyz * tmpvar_27.xyz); - albedo_26 = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = texture2D (_DetailAlbedoMap, texcoords_25.zw); - vec3 tmpvar_30; - tmpvar_30 = (albedo_26 * (2.0 * tmpvar_29.xyz)); - albedo_26 = tmpvar_30; - return albedo_26; -} - -float Alpha ( - in vec2 uv_31 -) -{ - vec4 tmpvar_32; - tmpvar_32 = texture2D (_AlphaMap, uv_31); - return (tmpvar_32.w * _Color.w); -} - -float BlinnPhongTerm ( - in float roughness_33, - in float NdotH_34 -) -{ - float specTerm_35; - float normTerm_36; - float n_37; - float m_38; - float tmpvar_39; - tmpvar_39 = pow (roughness_33, 4.0); - float tmpvar_40; - tmpvar_40 = (tmpvar_39 + 1e-05); - m_38 = tmpvar_40; - float tmpvar_41; - tmpvar_41 = ((1.0 / m_38) - 2.0); - n_37 = tmpvar_41; - float tmpvar_42; - tmpvar_42 = ((n_37 + 1.0) / 6.28318); - normTerm_36 = tmpvar_42; - float tmpvar_43; - tmpvar_43 = pow (NdotH_34, n_37); - float tmpvar_44; - tmpvar_44 = tmpvar_43; - specTerm_35 = tmpvar_44; - return (specTerm_35 * normTerm_36); -} - -float BlinnTerm ( - in vec3 normal_45, - in vec3 halfDir_46 -) -{ - float tmpvar_47; - tmpvar_47 = dot (normal_45, halfDir_46); - float tmpvar_48; - tmpvar_48 = max (0.0, tmpvar_47); - return tmpvar_48; -} - -float FresnelTerm ( - in float F0_49, - in float cosA_50 -) -{ - float t_51; - float _Falloff_52; - float tmpvar_53; - tmpvar_53 = 5.0; - _Falloff_52 = tmpvar_53; - float tmpvar_54; - tmpvar_54 = abs ((1.0 - cosA_50)); - float tmpvar_55; - tmpvar_55 = pow (tmpvar_54, _Falloff_52); - float tmpvar_56; - tmpvar_56 = tmpvar_55; - t_51 = tmpvar_56; - return (F0_49 + ((1.0 - F0_49) * t_51)); -} - -float CTGeometricTerm ( - in float NdotL_57, - in float NdotH_58, - in float NdotV_59, - in float VdotH_60 -) -{ - float tmpvar_61; - tmpvar_61 = (VdotH_60 + 1e-05); - VdotH_60 = tmpvar_61; - float tmpvar_62; - tmpvar_62 = min ((((2.0 * NdotH_58) * NdotV_59) / VdotH_60), (((2.0 * NdotH_58) * NdotL_57) / VdotH_60)); - float tmpvar_63; - tmpvar_63 = min (1.0, tmpvar_62); - return tmpvar_63; -} - -float GeometricTerm ( - in float NdotL_64, - in float NdotH_65, - in float NdotV_66, - in float VdotH_67, - in float LdotV_68 -) -{ - float tmpvar_69; - tmpvar_69 = CTGeometricTerm (NdotL_64, NdotH_65, NdotV_66, VdotH_67); - return tmpvar_69; -} - -float LambertTerm ( - in vec3 normal_70, - in vec3 lightDir_71 -) -{ - float tmpvar_72; - tmpvar_72 = dot (normal_70, lightDir_71); - float tmpvar_73; - tmpvar_73 = max (0.0, tmpvar_72); - return tmpvar_73; -} - -float RGBToLuminance ( - in vec3 color_74 -) -{ - float luminance_75; - vec3 lumSensitivity_76; - vec3 tmpvar_77; - tmpvar_77 = vec3(0.299, 0.587, 0.114); - lumSensitivity_76 = tmpvar_77; - float tmpvar_78; - tmpvar_78 = dot (color_74, lumSensitivity_76); - float tmpvar_79; - tmpvar_79 = tmpvar_78; - luminance_75 = tmpvar_79; - return luminance_75; -} - -vec3 BRDF_Disney_PBS ( - in vec3 baseColor_80, - in vec3 lightColor_81, - in vec3 specColor_82, - in float specular_83, - in float roughness_84, - in vec3 normal_85, - in vec3 lightDir_86, - in vec3 viewDir_87, - in vec3 ambient_88, - in vec3 env_89 -) -{ - vec3 color_90; - vec3 diffuseColor_91; - float diffuseTerm_92; - float specularTerm_93; - float disneyDiffuse_94; - float nvPow_95; - float nlPow_96; - float Fd90_97; - float R_98; - float G_99; - float F_100; - float lh_101; - float lv_102; - float vh_103; - float nv_104; - float nh_105; - float nl_106; - vec3 halfDir_107; - vec3 tmpvar_108; - tmpvar_108 = normalize ((lightDir_86 + viewDir_87)); - vec3 tmpvar_109; - tmpvar_109 = tmpvar_108; - halfDir_107 = tmpvar_109; - float tmpvar_110; - tmpvar_110 = LambertTerm (normal_85, lightDir_86); - float tmpvar_111; - tmpvar_111 = tmpvar_110; - nl_106 = tmpvar_111; - float tmpvar_112; - tmpvar_112 = BlinnTerm (normal_85, halfDir_107); - float tmpvar_113; - tmpvar_113 = tmpvar_112; - nh_105 = tmpvar_113; - float tmpvar_114; - tmpvar_114 = dot (normal_85, viewDir_87); - float tmpvar_115; - tmpvar_115 = max (0.0, tmpvar_114); - float tmpvar_116; - tmpvar_116 = tmpvar_115; - nv_104 = tmpvar_116; - float tmpvar_117; - tmpvar_117 = dot (viewDir_87, halfDir_107); - float tmpvar_118; - tmpvar_118 = max (0.0, tmpvar_117); - float tmpvar_119; - tmpvar_119 = tmpvar_118; - vh_103 = tmpvar_119; - float tmpvar_120; - tmpvar_120 = dot (lightDir_86, viewDir_87); - float tmpvar_121; - tmpvar_121 = max (0.0, tmpvar_120); - float tmpvar_122; - tmpvar_122 = tmpvar_121; - lv_102 = tmpvar_122; - float tmpvar_123; - tmpvar_123 = dot (lightDir_86, halfDir_107); - float tmpvar_124; - tmpvar_124 = max (0.0, tmpvar_123); - float tmpvar_125; - tmpvar_125 = tmpvar_124; - lh_101 = tmpvar_125; - float tmpvar_126; - tmpvar_126 = FresnelTerm (specular_83, vh_103); - float tmpvar_127; - tmpvar_127 = tmpvar_126; - F_100 = tmpvar_127; - float tmpvar_128; - tmpvar_128 = GeometricTerm (nl_106, nh_105, nv_104, vh_103, lv_102); - float tmpvar_129; - tmpvar_129 = tmpvar_128; - G_99 = tmpvar_129; - float tmpvar_130; - tmpvar_130 = BlinnPhongTerm (roughness_84, nh_105); - float tmpvar_131; - tmpvar_131 = tmpvar_130; - R_98 = tmpvar_131; - float tmpvar_132; - tmpvar_132 = max (0.0, R_98); - float tmpvar_133; - tmpvar_133 = tmpvar_132; - R_98 = tmpvar_133; - float tmpvar_134; - tmpvar_134 = pow (lh_101, 2.0); - float tmpvar_135; - tmpvar_135 = (0.5 + ((2.0 * tmpvar_134) * roughness_84)); - Fd90_97 = tmpvar_135; - float tmpvar_136; - tmpvar_136 = pow ((1.00001 - nl_106), 5.0); - float tmpvar_137; - tmpvar_137 = tmpvar_136; - nlPow_96 = tmpvar_137; - float tmpvar_138; - tmpvar_138 = pow ((1.00001 - nv_104), 5.0); - float tmpvar_139; - tmpvar_139 = tmpvar_138; - nvPow_95 = tmpvar_139; - float tmpvar_140; - tmpvar_140 = ((1.0 + ( - (Fd90_97 - 1.0) - * nlPow_96)) * (1.0 + ( - (Fd90_97 - 1.0) - * nvPow_95))); - disneyDiffuse_94 = tmpvar_140; - float tmpvar_141; - tmpvar_141 = max (0.0, (((F_100 * G_99) * R_98) / ((4.0 * nv_104) + 1e-05))); - float tmpvar_142; - tmpvar_142 = tmpvar_141; - specularTerm_93 = tmpvar_142; - float tmpvar_143; - tmpvar_143 = (disneyDiffuse_94 * nl_106); - diffuseTerm_92 = tmpvar_143; - vec3 tmpvar_144; - tmpvar_144 = baseColor_80; - diffuseColor_91 = tmpvar_144; - float tmpvar_145; - tmpvar_145 = RGBToLuminance (specColor_82); - float tmpvar_146; - tmpvar_146 = FresnelTerm (0.0, nv_104); - vec3 tmpvar_147; - tmpvar_147 = (((diffuseColor_91 * - (ambient_88 + (diffuseTerm_92 * lightColor_81)) - ) + (specColor_82 * - (env_89 + (lightColor_81 * specularTerm_93)) - )) + (( - ((1.0 - tmpvar_145) * (1.0 - roughness_84)) - * tmpvar_146) * env_89)); - color_90 = tmpvar_147; - return color_90; -} - -vec3 DecodeLightmap ( - in vec4 color_148 -) -{ - return ((8.0 * color_148.w) * color_148.xyz); -} - -vec3 DirLightmapDiffuse ( - in mat3 dirBasis_149, - in vec4 color_150, - in vec4 scale_151, - in vec3 normal_152, - in bool surfFuncWritesNormal_153, - out vec3 scalePerBasisVector_154 -) -{ - vec3 lm_155; - vec3 tmpvar_156; - tmpvar_156 = DecodeLightmap (color_150); - vec3 tmpvar_157; - tmpvar_157 = tmpvar_156; - lm_155 = tmpvar_157; - vec3 tmpvar_158; - tmpvar_158 = DecodeLightmap (scale_151); - vec3 tmpvar_159; - tmpvar_159 = tmpvar_158; - scalePerBasisVector_154 = tmpvar_159; - if (surfFuncWritesNormal_153) { - vec3 normalInRnmBasis_160; - vec3 tmpvar_161; - tmpvar_161 = xll_saturate_vf3 ((dirBasis_149 * normal_152)); - vec3 tmpvar_162; - tmpvar_162 = tmpvar_161; - normalInRnmBasis_160 = tmpvar_162; - float tmpvar_163; - tmpvar_163 = dot (normalInRnmBasis_160, scalePerBasisVector_154); - vec3 tmpvar_164; - tmpvar_164 = (lm_155 * tmpvar_163); - lm_155 = tmpvar_164; - }; - return lm_155; -} - -void DecodeDirLightmap ( - in vec3 normal_165, - in vec4 colorLM_166, - in vec4 scaleLM_167, - out vec3 lightColor_168, - out vec3 lightDir_169 -) -{ - vec3 scalePerBasisVector_170; - mat3 unity_DirBasis_171; - mat3 tmpvar_172; - tmpvar_172 = xll_transpose_mf3x3 (mat3(0.816497, 0.0, 0.57735, -0.408248, 0.707107, 0.57735, -0.408248, -0.707107, 0.57735)); - mat3 tmpvar_173; - tmpvar_173 = tmpvar_172; - unity_DirBasis_171 = tmpvar_173; - vec3 tmpvar_174; - tmpvar_174 = DirLightmapDiffuse (unity_DirBasis_171, colorLM_166, scaleLM_167, normal_165, bool(1), scalePerBasisVector_170); - vec3 tmpvar_175; - tmpvar_175 = tmpvar_174; - lightColor_168 = tmpvar_175; - vec3 tmpvar_176; - tmpvar_176 = xll_matrixindex_mf3x3_i (unity_DirBasis_171, 0); - vec3 tmpvar_177; - tmpvar_177 = xll_matrixindex_mf3x3_i (unity_DirBasis_171, 1); - vec3 tmpvar_178; - tmpvar_178 = xll_matrixindex_mf3x3_i (unity_DirBasis_171, 2); - vec3 tmpvar_179; - tmpvar_179 = normalize ((((scalePerBasisVector_170.x * tmpvar_176) + (scalePerBasisVector_170.y * tmpvar_177)) + (scalePerBasisVector_170.z * tmpvar_178))); - vec3 tmpvar_180; - tmpvar_180 = tmpvar_179; - lightDir_169 = tmpvar_180; -} - -vec3 EnergyCalculator ( - in vec3 specColor_181, - in float specular_182, - in vec3 baseColor_183 -) -{ - vec3 tmpvar_184; - tmpvar_184 = min (baseColor_183, (vec3(1.0, 1.0, 1.0) - specular_182)); - return tmpvar_184; -} - -float toLinearFast1 ( - in float c_185 -) -{ - float c2_186; - float tmpvar_187; - tmpvar_187 = (c_185 * c_185); - c2_186 = tmpvar_187; - vec2 tmpvar_188; - tmpvar_188.x = c2_186; - tmpvar_188.y = (c_185 * c2_186); - float tmpvar_189; - tmpvar_189 = dot (vec2(0.7532, 0.2468), tmpvar_188); - return tmpvar_189; -} - -vec3 fromRGBM ( - in vec4 c_190 -) -{ - float tmpvar_191; - tmpvar_191 = toLinearFast1 (c_190.w); - return ((c_190.xyz * tmpvar_191) * _Exposure); -} - -vec3 EnvMap ( - in vec4 worldNormal_192 -) -{ - vec4 envTexel_193; - vec4 tmpvar_194; - tmpvar_194.xyz = worldNormal_192.xyz.xyz; - tmpvar_194.w = worldNormal_192.w; - vec4 tmpvar_195; - tmpvar_195 = xll_texCUBElod (_SpecCube, tmpvar_194); - vec4 tmpvar_196; - tmpvar_196 = tmpvar_195; - envTexel_193 = tmpvar_196; - vec3 tmpvar_197; - tmpvar_197 = fromRGBM (envTexel_193); - return tmpvar_197; -} - -float Occlusion ( - in vec2 uv_198 -) -{ - vec4 tmpvar_199; - tmpvar_199 = texture2D (_Occlusion, uv_198); - return tmpvar_199.x; -} - -vec4 SpecularGloss ( - in vec2 uv_200 -) -{ - vec4 specGloss_201; - vec4 tmpvar_202; - tmpvar_202 = texture2D (_SpecGlossMap, uv_200); - vec4 tmpvar_203; - tmpvar_203 = tmpvar_202; - specGloss_201 = tmpvar_203; - vec4 tmpvar_204; - tmpvar_204.xyz = specGloss_201.xyz.xyz; - tmpvar_204.w = specGloss_201.w; - return tmpvar_204; -} - -vec3 BlendNormals ( - in vec3 n1_205, - in vec3 n2_206 -) -{ - vec3 tmpvar_207; - tmpvar_207.xy = (n1_205.xy + n2_206.xy).xy; - tmpvar_207.z = (n1_205.z * n2_206.z); - vec3 tmpvar_208; - tmpvar_208 = normalize (tmpvar_207); - return tmpvar_208; -} - -vec3 UnpackScaleNormal ( - in vec4 packednormal_209, - in float bumpScale_210 -) -{ - vec3 normal_211; - vec2 tmpvar_212; - tmpvar_212 = ((packednormal_209.wy * 2.0) - 1.0); - normal_211.xy = tmpvar_212.xy.xy; - vec2 tmpvar_213; - tmpvar_213 = (normal_211.xy * bumpScale_210); - normal_211.xy = tmpvar_213.xy.xy; - float tmpvar_214; - tmpvar_214 = dot (normal_211.xy, normal_211.xy); - float tmpvar_215; - tmpvar_215 = xll_saturate_f (tmpvar_214); - float tmpvar_216; - tmpvar_216 = sqrt ((1.0 - tmpvar_215)); - float tmpvar_217; - tmpvar_217 = tmpvar_216; - normal_211.z = vec3(tmpvar_217).z; - return normal_211; -} - -vec3 TangentNormal ( - in vec4 texcoords_218 -) -{ - vec3 detailNormalTangent_219; - vec3 normalTangent_220; - vec4 tmpvar_221; - tmpvar_221 = texture2D (_BumpMap, texcoords_218.xy); - vec3 tmpvar_222; - tmpvar_222 = UnpackScaleNormal (tmpvar_221, _BumpScale); - vec3 tmpvar_223; - tmpvar_223 = tmpvar_222; - normalTangent_220 = tmpvar_223; - vec4 tmpvar_224; - tmpvar_224 = texture2D (_DetailNormalMap, texcoords_218.zw); - vec3 tmpvar_225; - tmpvar_225 = UnpackScaleNormal (tmpvar_224, _DetailNormalMapScale); - vec3 tmpvar_226; - tmpvar_226 = tmpvar_225; - detailNormalTangent_219 = tmpvar_226; - vec3 tmpvar_227; - tmpvar_227 = BlendNormals (normalTangent_220, detailNormalTangent_219); - vec3 tmpvar_228; - tmpvar_228 = tmpvar_227; - normalTangent_220 = tmpvar_228; - return normalTangent_220; -} - -mat3 TangentToWorld ( - in vec3 normal_229, - in vec3 tangent_230, - in vec3 flip_231 -) -{ - vec3 binormal_232; - vec3 tmpvar_233; - tmpvar_233 = cross (normal_229, tangent_230); - vec3 tmpvar_234; - tmpvar_234 = (tmpvar_233 * flip_231); - binormal_232 = tmpvar_234; - mat3 tmpvar_235; - vec3 tmpvar_236; - tmpvar_236 = tangent_230; - tmpvar_235[0] = tmpvar_236; - vec3 tmpvar_237; - tmpvar_237 = binormal_232; - tmpvar_235[1] = tmpvar_237; - vec3 tmpvar_238; - tmpvar_238 = normal_229; - tmpvar_235[2] = tmpvar_238; - mat3 tmpvar_239; - tmpvar_239 = xll_transpose_mf3x3 (tmpvar_235); - return tmpvar_239; -} - -float unitySampleShadow ( - in vec4 shadowCoord_240 -) -{ - float shadow_241; - vec4 tmpvar_242; - tmpvar_242 = texture2DProj (_ShadowMapTexture, shadowCoord_240); - float tmpvar_243; - tmpvar_243 = tmpvar_242.x; - shadow_241 = tmpvar_243; - return shadow_241; -} - -vec4 frag ( - in VertexOutput i_244 -) -{ - float alpha_245; - vec3 color_246; - vec3 baseColor_247; - vec3 lightDirTangent_248; - vec4 lmIndTex_249; - vec4 lmtex_250; - vec3 ambient_251; - float subsurface_252; - vec3 lightDir_253; - vec3 lightColor_254; - vec3 env_255; - float roughness_256; - float specular_257; - vec3 specColor_258; - vec4 specGloss_259; - vec3 eyeVec_260; - vec3 normalWorld_261; - vec3 normalTangent_262; - mat3 tanToWorld_263; - float atten_264; - float tmpvar_265; - tmpvar_265 = unitySampleShadow (i_244._ShadowCoord); - float tmpvar_266; - tmpvar_266 = tmpvar_265; - atten_264 = tmpvar_266; - vec3 tmpvar_267; - tmpvar_267 = vec3(i_244.tangentWorld.w); - mat3 tmpvar_268; - tmpvar_268 = TangentToWorld (i_244.normalWorld, i_244.tangentWorld.xyz, tmpvar_267); - mat3 tmpvar_269; - tmpvar_269 = tmpvar_268; - tanToWorld_263 = tmpvar_269; - vec3 tmpvar_270; - tmpvar_270 = normalize (i_244.normalWorld); - vec3 tmpvar_271; - tmpvar_271 = tmpvar_270; - i_244.normalWorld = tmpvar_271; - vec3 tmpvar_272; - tmpvar_272 = TangentNormal (i_244.tex); - vec3 tmpvar_273; - tmpvar_273 = tmpvar_272; - normalTangent_262 = tmpvar_273; - vec3 tmpvar_274; - tmpvar_274 = (normalTangent_262 * tanToWorld_263); - normalWorld_261 = tmpvar_274; - vec3 tmpvar_275; - tmpvar_275 = normalize ((i_244.posWorld.xyz - _WorldSpaceCameraPos)); - vec3 tmpvar_276; - tmpvar_276 = tmpvar_275; - eyeVec_260 = tmpvar_276; - vec4 tmpvar_277; - tmpvar_277 = SpecularGloss (i_244.tex.xy); - vec4 tmpvar_278; - tmpvar_278 = tmpvar_277; - specGloss_259 = tmpvar_278; - vec3 tmpvar_279; - tmpvar_279 = specGloss_259.xyz; - specColor_258 = tmpvar_279; - float tmpvar_280; - tmpvar_280 = RGBToLuminance (specGloss_259.xyz); - float tmpvar_281; - tmpvar_281 = tmpvar_280; - specular_257 = tmpvar_281; - float tmpvar_282; - tmpvar_282 = (1.0 - specGloss_259.w); - roughness_256 = tmpvar_282; - vec3 tmpvar_283; - tmpvar_283 = vec3(0.0, 0.0, 0.0); - env_255 = tmpvar_283; - vec3 tmpvar_284; - tmpvar_284 = reflect (eyeVec_260, normalWorld_261); - vec4 tmpvar_285; - tmpvar_285.xyz = tmpvar_284.xyz; - tmpvar_285.w = (roughness_256 * 5.0); - vec3 tmpvar_286; - tmpvar_286 = EnvMap (tmpvar_285); - float tmpvar_287; - tmpvar_287 = Occlusion (i_244.tex.xy); - vec3 tmpvar_288; - tmpvar_288 = (tmpvar_286 * tmpvar_287); - env_255 = tmpvar_288; - vec3 tmpvar_289; - tmpvar_289 = (_LightColor0.xyz * 2.0); - lightColor_254 = tmpvar_289; - vec3 tmpvar_290; - tmpvar_290 = _WorldSpaceLightPos0.xyz; - lightDir_253 = tmpvar_290; - float tmpvar_291; - tmpvar_291 = 1.0; - subsurface_252 = tmpvar_291; - vec3 tmpvar_292; - tmpvar_292 = vec3(0.0, 0.0, 0.0); - ambient_251 = tmpvar_292; - vec4 tmpvar_293; - tmpvar_293 = texture2D (unity_Lightmap, i_244.extra.xy); - vec4 tmpvar_294; - tmpvar_294 = tmpvar_293; - lmtex_250 = tmpvar_294; - vec4 tmpvar_295; - tmpvar_295 = texture2D (unity_LightmapInd, i_244.extra.xy); - vec4 tmpvar_296; - tmpvar_296 = tmpvar_295; - lmIndTex_249 = tmpvar_296; - DecodeDirLightmap (normalTangent_262, lmtex_250, lmIndTex_249, lightColor_254, lightDirTangent_248); - vec3 tmpvar_297; - tmpvar_297 = (lightDirTangent_248 * tanToWorld_263); - lightDir_253 = tmpvar_297; - vec3 tmpvar_298; - tmpvar_298 = normalize (lightDir_253); - vec3 tmpvar_299; - tmpvar_299 = tmpvar_298; - lightDir_253 = tmpvar_299; - vec3 tmpvar_300; - tmpvar_300 = Albedo (i_244.tex); - vec3 tmpvar_301; - tmpvar_301 = EnergyCalculator (specColor_258, specular_257, tmpvar_300); - vec3 tmpvar_302; - tmpvar_302 = tmpvar_301; - baseColor_247 = tmpvar_302; - vec3 tmpvar_303; - tmpvar_303 = BRDF_Disney_PBS (baseColor_247, (atten_264 * lightColor_254), specColor_258, specular_257, roughness_256, normalWorld_261, lightDir_253, -(eyeVec_260), ambient_251, env_255); - vec3 tmpvar_304; - tmpvar_304 = tmpvar_303; - color_246 = tmpvar_304; - vec4 tmpvar_305; - tmpvar_305 = texture2D (_SelfIllum, i_244.tex.xy); - vec3 tmpvar_306; - tmpvar_306 = (color_246 + (tmpvar_305.xyz * _SelfIllumScale)); - color_246 = tmpvar_306; - float tmpvar_307; - tmpvar_307 = Alpha (i_244.tex.xy); - float tmpvar_308; - tmpvar_308 = tmpvar_307; - alpha_245 = tmpvar_308; - vec4 tmpvar_309; - tmpvar_309.xyz = color_246.xyz; - tmpvar_309.w = alpha_245; - return tmpvar_309; -} - -void main () -{ - VertexOutput xlt_i_310; - vec4 xl_retval_311; - vec4 tmpvar_312; - tmpvar_312 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_310.pos = tmpvar_312; - vec4 tmpvar_313; - tmpvar_313 = xlv_TEXCOORD0.xyzw; - vec4 tmpvar_314; - tmpvar_314 = tmpvar_313; - xlt_i_310.tex = tmpvar_314; - vec4 tmpvar_315; - tmpvar_315 = xlv_TEXCOORD1.xyzw; - vec4 tmpvar_316; - tmpvar_316 = tmpvar_315; - xlt_i_310.posWorld = tmpvar_316; - vec3 tmpvar_317; - tmpvar_317 = xlv_TEXCOORD2.xyz; - vec3 tmpvar_318; - tmpvar_318 = tmpvar_317; - xlt_i_310.normalWorld = tmpvar_318; - vec4 tmpvar_319; - tmpvar_319 = xlv_TEXCOORD3.xyzw; - vec4 tmpvar_320; - tmpvar_320 = tmpvar_319; - xlt_i_310.tangentWorld = tmpvar_320; - vec3 tmpvar_321; - tmpvar_321 = xlv_TEXCOORD4.xyz; - vec3 tmpvar_322; - tmpvar_322 = tmpvar_321; - xlt_i_310.extra = tmpvar_322; - vec4 tmpvar_323; - tmpvar_323 = xlv_TEXCOORD5.xyzw; - vec4 tmpvar_324; - tmpvar_324 = tmpvar_323; - xlt_i_310._ShadowCoord = tmpvar_324; - vec3 tmpvar_325; - tmpvar_325 = xlv_TEXCOORD7.xyz; - vec3 tmpvar_326; - tmpvar_326 = tmpvar_325; - xlt_i_310.lightDir = tmpvar_326; - vec4 tmpvar_327; - tmpvar_327 = frag (xlt_i_310); - vec4 tmpvar_328; - tmpvar_328 = tmpvar_327; - xl_retval_311 = tmpvar_328; - vec4 tmpvar_329; - tmpvar_329 = xl_retval_311.xyzw; - vec4 tmpvar_330; - tmpvar_330 = tmpvar_329; - gl_FragData[0] = tmpvar_330; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-out.txt b/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-out.txt index 089668de6..5ed774868 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-out.txt @@ -25,148 +25,180 @@ varying vec3 xlv_TEXCOORD4; varying vec4 xlv_TEXCOORD5; void main () { - vec3 tmpvar_1; - vec3 tmpvar_2; - tmpvar_1 = xlv_TEXCOORD3.xyz; - tmpvar_2 = (((xlv_TEXCOORD2.yzx * xlv_TEXCOORD3.zxy) - (xlv_TEXCOORD2.zxy * xlv_TEXCOORD3.yzx)) * xlv_TEXCOORD3.www); - mat3 tmpvar_3; - tmpvar_3[0].x = tmpvar_1.x; - tmpvar_3[0].y = tmpvar_2.x; - tmpvar_3[0].z = xlv_TEXCOORD2.x; - tmpvar_3[1].x = tmpvar_1.y; - tmpvar_3[1].y = tmpvar_2.y; - tmpvar_3[1].z = xlv_TEXCOORD2.y; - tmpvar_3[2].x = tmpvar_1.z; - tmpvar_3[2].y = tmpvar_2.z; - tmpvar_3[2].z = xlv_TEXCOORD2.z; - vec3 normal_4; - normal_4.xy = ((texture2D (_BumpMap, xlv_TEXCOORD0.xy).wy * 2.0) - 1.0); - normal_4.xy = (normal_4.xy * _BumpScale); - normal_4.z = sqrt((1.0 - clamp ( - dot (normal_4.xy, normal_4.xy) + vec3 lightDir_1; + vec3 env_2; + vec3 tmpvar_3; + vec3 tmpvar_4; + tmpvar_3 = xlv_TEXCOORD3.xyz; + tmpvar_4 = (((xlv_TEXCOORD2.yzx * xlv_TEXCOORD3.zxy) - (xlv_TEXCOORD2.zxy * xlv_TEXCOORD3.yzx)) * xlv_TEXCOORD3.www); + mat3 tmpvar_5; + tmpvar_5[0].x = tmpvar_3.x; + tmpvar_5[0].y = tmpvar_4.x; + tmpvar_5[0].z = xlv_TEXCOORD2.x; + tmpvar_5[1].x = tmpvar_3.y; + tmpvar_5[1].y = tmpvar_4.y; + tmpvar_5[1].z = xlv_TEXCOORD2.y; + tmpvar_5[2].x = tmpvar_3.z; + tmpvar_5[2].y = tmpvar_4.z; + tmpvar_5[2].z = xlv_TEXCOORD2.z; + vec3 normal_6; + normal_6.xy = ((texture2D (_BumpMap, xlv_TEXCOORD0.xy).wy * 2.0) - 1.0); + normal_6.xy = (normal_6.xy * _BumpScale); + normal_6.z = sqrt((1.0 - clamp ( + dot (normal_6.xy, normal_6.xy) , 0.0, 1.0))); - vec3 normal_5; - normal_5.xy = ((texture2D (_DetailNormalMap, xlv_TEXCOORD0.zw).wy * 2.0) - 1.0); - normal_5.xy = (normal_5.xy * _DetailNormalMapScale); - normal_5.z = sqrt((1.0 - clamp ( - dot (normal_5.xy, normal_5.xy) + vec3 normal_7; + normal_7.xy = ((texture2D (_DetailNormalMap, xlv_TEXCOORD0.zw).wy * 2.0) - 1.0); + normal_7.xy = (normal_7.xy * _DetailNormalMapScale); + normal_7.z = sqrt((1.0 - clamp ( + dot (normal_7.xy, normal_7.xy) , 0.0, 1.0))); - vec3 tmpvar_6; - tmpvar_6.xy = (normal_4.xy + normal_5.xy); - tmpvar_6.z = (normal_4.z * normal_5.z); - vec3 tmpvar_7; - tmpvar_7 = normalize(tmpvar_6); vec3 tmpvar_8; - tmpvar_8 = (tmpvar_7 * tmpvar_3); + tmpvar_8.xy = (normal_6.xy + normal_7.xy); + tmpvar_8.z = (normal_6.z * normal_7.z); vec3 tmpvar_9; - tmpvar_9 = normalize((xlv_TEXCOORD1.xyz - _WorldSpaceCameraPos)); - vec4 tmpvar_10; - tmpvar_10 = texture2D (_SpecGlossMap, xlv_TEXCOORD0.xy); - float tmpvar_11; - tmpvar_11 = dot (tmpvar_10.xyz, vec3(0.299, 0.587, 0.114)); - float tmpvar_12; - tmpvar_12 = (1.0 - tmpvar_10.w); - vec4 tmpvar_13; - tmpvar_13.xyz = (tmpvar_9 - (2.0 * ( - dot (tmpvar_8, tmpvar_9) - * tmpvar_8))); - tmpvar_13.w = (tmpvar_12 * 5.0); - vec4 tmpvar_14; - tmpvar_14 = textureCubeLod (_SpecCube, tmpvar_13.xyz, tmpvar_13.w); - float tmpvar_15; - tmpvar_15 = (tmpvar_14.w * tmpvar_14.w); - vec2 tmpvar_16; - tmpvar_16.x = tmpvar_15; - tmpvar_16.y = (tmpvar_14.w * tmpvar_15); - vec3 tmpvar_17; - tmpvar_17 = (((tmpvar_14.xyz * - dot (vec2(0.7532, 0.2468), tmpvar_16) + tmpvar_9 = normalize(tmpvar_8); + vec3 tmpvar_10; + tmpvar_10 = (tmpvar_9 * tmpvar_5); + vec3 tmpvar_11; + tmpvar_11 = normalize((xlv_TEXCOORD1.xyz - _WorldSpaceCameraPos)); + vec4 tmpvar_12; + tmpvar_12 = texture2D (_SpecGlossMap, xlv_TEXCOORD0.xy); + float tmpvar_13; + tmpvar_13 = dot (tmpvar_12.xyz, vec3(0.299, 0.587, 0.114)); + float tmpvar_14; + tmpvar_14 = (1.0 - tmpvar_12.w); + vec4 tmpvar_15; + tmpvar_15.xyz = (tmpvar_11 - (2.0 * ( + dot (tmpvar_10, tmpvar_11) + * tmpvar_10))); + tmpvar_15.w = (tmpvar_14 * 5.0); + vec4 tmpvar_16; + tmpvar_16 = textureCubeLod (_SpecCube, tmpvar_15.xyz, tmpvar_15.w); + float tmpvar_17; + tmpvar_17 = (tmpvar_16.w * tmpvar_16.w); + vec2 tmpvar_18; + tmpvar_18.x = tmpvar_17; + tmpvar_18.y = (tmpvar_16.w * tmpvar_17); + env_2 = (((tmpvar_16.xyz * + dot (vec2(0.7532, 0.2468), tmpvar_18) ) * _Exposure) * texture2D (_Occlusion, xlv_TEXCOORD0.xy).x); - vec4 tmpvar_18; - tmpvar_18 = texture2D (unity_Lightmap, xlv_TEXCOORD4.xy); vec4 tmpvar_19; - tmpvar_19 = texture2D (unity_LightmapInd, xlv_TEXCOORD4.xy); - mat3 tmpvar_20; - tmpvar_20[0].x = 0.816497; - tmpvar_20[0].y = -0.408248; - tmpvar_20[0].z = -0.408248; - tmpvar_20[1].x = 0.0; - tmpvar_20[1].y = 0.707107; - tmpvar_20[1].z = -0.707107; - tmpvar_20[2].x = 0.57735; - tmpvar_20[2].y = 0.57735; - tmpvar_20[2].z = 0.57735; - vec3 tmpvar_21; - tmpvar_21 = ((8.0 * tmpvar_19.w) * tmpvar_19.xyz); - vec3 v_22; - v_22.x = tmpvar_20[0].x; - v_22.y = tmpvar_20[1].x; - v_22.z = tmpvar_20[2].x; + tmpvar_19 = texture2D (unity_Lightmap, xlv_TEXCOORD4.xy); + vec4 tmpvar_20; + tmpvar_20 = texture2D (unity_LightmapInd, xlv_TEXCOORD4.xy); + mat3 tmpvar_21; + tmpvar_21[0].x = 0.816497; + tmpvar_21[0].y = -0.408248; + tmpvar_21[0].z = -0.408248; + tmpvar_21[1].x = 0.0; + tmpvar_21[1].y = 0.707107; + tmpvar_21[1].z = -0.707107; + tmpvar_21[2].x = 0.57735; + tmpvar_21[2].y = 0.57735; + tmpvar_21[2].z = 0.57735; + vec3 tmpvar_22; + tmpvar_22 = ((8.0 * tmpvar_20.w) * tmpvar_20.xyz); vec3 v_23; - v_23.x = tmpvar_20[0].y; - v_23.y = tmpvar_20[1].y; - v_23.z = tmpvar_20[2].y; + v_23.x = tmpvar_21[0].x; + v_23.y = tmpvar_21[1].x; + v_23.z = tmpvar_21[2].x; vec3 v_24; - v_24.x = tmpvar_20[0].z; - v_24.y = tmpvar_20[1].z; - v_24.z = tmpvar_20[2].z; - vec3 tmpvar_25; - tmpvar_25 = normalize((normalize( - (((tmpvar_21.x * v_22) + (tmpvar_21.y * v_23)) + (tmpvar_21.z * v_24)) - ) * tmpvar_3)); - vec3 lightColor_26; - lightColor_26 = (texture2DProj (_ShadowMapTexture, xlv_TEXCOORD5).x * (( - (8.0 * tmpvar_18.w) - * tmpvar_18.xyz) * dot ( - clamp ((tmpvar_20 * tmpvar_7), 0.0, 1.0) - , tmpvar_21))); - vec3 viewDir_27; - viewDir_27 = -(tmpvar_9); - vec3 tmpvar_28; - tmpvar_28 = normalize((tmpvar_25 + viewDir_27)); - float tmpvar_29; - tmpvar_29 = max (0.0, dot (tmpvar_8, tmpvar_25)); - float tmpvar_30; - tmpvar_30 = max (0.0, dot (tmpvar_8, tmpvar_28)); - float tmpvar_31; - tmpvar_31 = max (0.0, dot (tmpvar_8, viewDir_27)); - float tmpvar_32; - tmpvar_32 = max (0.0, dot (viewDir_27, tmpvar_28)); - float tmpvar_33; - tmpvar_33 = (tmpvar_32 + 1e-05); - float tmpvar_34; - tmpvar_34 = ((1.0/(( - pow (tmpvar_12, 4.0) - + 1e-05))) - 2.0); - float tmpvar_35; - tmpvar_35 = (0.5 + ((2.0 * - pow (max (0.0, dot (tmpvar_25, tmpvar_28)), 2.0) - ) * tmpvar_12)); - vec4 tmpvar_36; - tmpvar_36.xyz = ((( - (min (((_Color.xyz * texture2D (_MainTex, xlv_TEXCOORD0.xy).xyz) * (2.0 * texture2D (_DetailAlbedoMap, xlv_TEXCOORD0.zw).xyz)), (vec3(1.0, 1.0, 1.0) - tmpvar_11)) * ((( - (1.0 + ((tmpvar_35 - 1.0) * pow ((1.00001 - tmpvar_29), 5.0))) - * - (1.0 + ((tmpvar_35 - 1.0) * pow ((1.00001 - tmpvar_31), 5.0))) - ) * tmpvar_29) * lightColor_26)) + v_24.x = tmpvar_21[0].y; + v_24.y = tmpvar_21[1].y; + v_24.z = tmpvar_21[2].y; + vec3 v_25; + v_25.x = tmpvar_21[0].z; + v_25.y = tmpvar_21[1].z; + v_25.z = tmpvar_21[2].z; + lightDir_1 = (normalize(( + ((tmpvar_22.x * v_23) + (tmpvar_22.y * v_24)) + - (tmpvar_10.xyz * (tmpvar_17 + (lightColor_26 * max (0.0, - ((((tmpvar_11 + - ((1.0 - tmpvar_11) * pow (abs((1.0 - tmpvar_32)), 5.0)) + (tmpvar_22.z * v_25) + )) * tmpvar_5); + vec3 tmpvar_26; + tmpvar_26 = normalize(lightDir_1); + lightDir_1 = tmpvar_26; + vec3 lightColor_27; + lightColor_27 = (texture2DProj (_ShadowMapTexture, xlv_TEXCOORD5).x * (( + (8.0 * tmpvar_19.w) + * tmpvar_19.xyz) * dot ( + clamp ((tmpvar_21 * tmpvar_9), 0.0, 1.0) + , tmpvar_22))); + vec3 viewDir_28; + viewDir_28 = -(tmpvar_11); + vec3 tmpvar_29; + tmpvar_29 = normalize((tmpvar_26 + viewDir_28)); + float tmpvar_30; + tmpvar_30 = max (0.0, dot (tmpvar_10, tmpvar_26)); + float tmpvar_31; + tmpvar_31 = max (0.0, dot (tmpvar_10, tmpvar_29)); + float tmpvar_32; + tmpvar_32 = max (0.0, dot (tmpvar_10, viewDir_28)); + float tmpvar_33; + tmpvar_33 = max (0.0, dot (viewDir_28, tmpvar_29)); + float VdotH_34; + VdotH_34 = (tmpvar_33 + 1e-05); + float tmpvar_35; + tmpvar_35 = ((1.0/(( + pow (tmpvar_14, 4.0) + + 1e-05))) - 2.0); + float tmpvar_36; + float tmpvar_37; + tmpvar_37 = max (0.0, dot (tmpvar_26, tmpvar_29)); + tmpvar_36 = (0.5 + ((2.0 * tmpvar_37) * (tmpvar_37 * tmpvar_14))); + vec4 tmpvar_38; + tmpvar_38.xyz = ((( + (min (((_Color.xyz * texture2D (_MainTex, xlv_TEXCOORD0.xy).xyz) * (2.0 * texture2D (_DetailAlbedoMap, xlv_TEXCOORD0.zw).xyz)), (vec3(1.0, 1.0, 1.0) - tmpvar_13)) * ((( + (1.0 + ((tmpvar_36 - 1.0) * pow ((1.00001 - tmpvar_30), 5.0))) + * + (1.0 + ((tmpvar_36 - 1.0) * pow ((1.00001 - tmpvar_32), 5.0))) + ) * tmpvar_30) * lightColor_27)) + + + (tmpvar_12.xyz * (env_2 + (lightColor_27 * max (0.0, + ((((tmpvar_13 + + ((1.0 - tmpvar_13) * pow (abs((1.0 - tmpvar_33)), 5.0)) ) * min (1.0, - min ((((2.0 * tmpvar_30) * tmpvar_31) / tmpvar_33), (((2.0 * tmpvar_30) * tmpvar_29) / tmpvar_33)) + min ((((2.0 * tmpvar_31) * tmpvar_32) / VdotH_34), (((2.0 * tmpvar_31) * tmpvar_30) / VdotH_34)) )) * max (0.0, ( - pow (tmpvar_30, tmpvar_34) + pow (tmpvar_31, tmpvar_35) * - ((tmpvar_34 + 1.0) / 6.28318) - ))) / ((4.0 * tmpvar_31) + 1e-05)) + ((tmpvar_35 + 1.0) / 6.28318) + ))) / ((4.0 * tmpvar_32) + 1e-05)) )))) ) + ( - (((1.0 - dot (tmpvar_10.xyz, vec3(0.299, 0.587, 0.114))) * (1.0 - tmpvar_12)) * pow (abs((1.0 - tmpvar_31)), 5.0)) - * tmpvar_17)) + (texture2D (_SelfIllum, xlv_TEXCOORD0.xy).xyz * _SelfIllumScale)); - tmpvar_36.w = (texture2D (_AlphaMap, xlv_TEXCOORD0.xy).w * _Color.w); - gl_FragData[0] = tmpvar_36; + (((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)) + (texture2D (_SelfIllum, xlv_TEXCOORD0.xy).xyz * _SelfIllumScale)); + tmpvar_38.w = (texture2D (_AlphaMap, xlv_TEXCOORD0.xy).w * _Color.w); + gl_FragData[0] = tmpvar_38; } -// inputs: 6, stats: 146 alu 12 tex 0 flow +// stats: 146 alu 12 tex 0 flow +// inputs: 6 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] +// #1: xlv_TEXCOORD1 (high float) 4x1 [-1] +// #2: xlv_TEXCOORD2 (high float) 3x1 [-1] +// #3: xlv_TEXCOORD3 (high float) 4x1 [-1] +// #4: xlv_TEXCOORD4 (high float) 3x1 [-1] +// #5: xlv_TEXCOORD5 (high float) 4x1 [-1] +// uniforms: 6 (total size: 0) +// #0: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #1: _DetailNormalMapScale (high float) 1x1 [-1] +// #2: _BumpScale (high float) 1x1 [-1] +// #3: _Exposure (high float) 1x1 [-1] +// #4: _Color (high float) 4x1 [-1] +// #5: _SelfIllumScale (high float) 1x1 [-1] +// textures: 12 +// #0: _MainTex (high 2d) 0x0 [-1] +// #1: _DetailAlbedoMap (high 2d) 0x0 [-1] +// #2: _AlphaMap (high 2d) 0x0 [-1] +// #3: _Occlusion (high 2d) 0x0 [-1] +// #4: _DetailNormalMap (high 2d) 0x0 [-1] +// #5: _BumpMap (high 2d) 0x0 [-1] +// #6: _SpecGlossMap (high 2d) 0x0 [-1] +// #7: _ShadowMapTexture (high 2d) 0x0 [-1] +// #8: _SpecCube (high cube) 0x0 [-1] +// #9: unity_Lightmap (high 2d) 0x0 [-1] +// #10: unity_LightmapInd (high 2d) 0x0 [-1] +// #11: _SelfIllum (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3.txt new file mode 100644 index 000000000..2268ad0a8 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3.txt @@ -0,0 +1,205 @@ +#version 300 es +out mediump vec4 _fragData; +uniform highp vec3 _WorldSpaceCameraPos; +uniform sampler2D _MainTex; +uniform sampler2D _DetailAlbedoMap; +uniform sampler2D _AlphaMap; +uniform sampler2D _Occlusion; +uniform sampler2D _DetailNormalMap; +uniform highp float _DetailNormalMapScale; +uniform sampler2D _BumpMap; +uniform highp float _BumpScale; +uniform highp float _Exposure; +uniform highp vec4 _Color; +uniform sampler2D _SpecGlossMap; +uniform sampler2D _ShadowMapTexture; +uniform lowp samplerCube _SpecCube; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; +uniform highp float _SelfIllumScale; +uniform sampler2D _SelfIllum; +in highp vec4 xlv_TEXCOORD0; +in highp vec4 xlv_TEXCOORD1; +in highp vec3 xlv_TEXCOORD2; +in highp vec4 xlv_TEXCOORD3; +in highp vec3 xlv_TEXCOORD4; +in highp vec4 xlv_TEXCOORD5; +void main () +{ + lowp vec3 lightDir_1; + lowp vec3 env_2; + highp vec3 tmpvar_3; + highp vec3 tmpvar_4; + 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[1u].x = tmpvar_3.y; + tmpvar_5[1u].y = tmpvar_4.y; + tmpvar_5[1u].z = xlv_TEXCOORD2.y; + tmpvar_5[2u].x = tmpvar_3.z; + tmpvar_5[2u].y = tmpvar_4.z; + tmpvar_5[2u].z = xlv_TEXCOORD2.z; + lowp vec3 normal_6; + normal_6.xy = ((texture (_BumpMap, xlv_TEXCOORD0.xy).wy * 2.0) - 1.0); + normal_6.xy = (normal_6.xy * _BumpScale); + normal_6.z = sqrt((1.0 - clamp ( + dot (normal_6.xy, normal_6.xy) + , 0.0, 1.0))); + lowp vec3 normal_7; + normal_7.xy = ((texture (_DetailNormalMap, xlv_TEXCOORD0.zw).wy * 2.0) - 1.0); + normal_7.xy = (normal_7.xy * _DetailNormalMapScale); + normal_7.z = sqrt((1.0 - clamp ( + dot (normal_7.xy, normal_7.xy) + , 0.0, 1.0))); + lowp vec3 tmpvar_8; + tmpvar_8.xy = (normal_6.xy + normal_7.xy); + tmpvar_8.z = (normal_6.z * normal_7.z); + lowp vec3 tmpvar_9; + tmpvar_9 = normalize(tmpvar_8); + lowp vec3 tmpvar_10; + tmpvar_10 = (tmpvar_9 * tmpvar_5); + highp vec3 tmpvar_11; + tmpvar_11 = normalize((xlv_TEXCOORD1.xyz - _WorldSpaceCameraPos)); + lowp vec4 tmpvar_12; + tmpvar_12 = texture (_SpecGlossMap, xlv_TEXCOORD0.xy); + lowp float tmpvar_13; + tmpvar_13 = dot (tmpvar_12.xyz, vec3(0.299, 0.587, 0.114)); + lowp float tmpvar_14; + tmpvar_14 = (1.0 - tmpvar_12.w); + lowp vec4 tmpvar_15; + tmpvar_15.xyz = (tmpvar_11 - (2.0 * ( + dot (tmpvar_10, tmpvar_11) + * tmpvar_10))); + tmpvar_15.w = (tmpvar_14 * 5.0); + lowp vec4 tmpvar_16; + tmpvar_16 = textureLod (_SpecCube, tmpvar_15.xyz, tmpvar_15.w); + lowp float tmpvar_17; + tmpvar_17 = (tmpvar_16.w * tmpvar_16.w); + lowp vec2 tmpvar_18; + tmpvar_18.x = tmpvar_17; + tmpvar_18.y = (tmpvar_16.w * tmpvar_17); + env_2 = (((tmpvar_16.xyz * + dot (vec2(0.7532, 0.2468), tmpvar_18) + ) * _Exposure) * texture (_Occlusion, xlv_TEXCOORD0.xy).x); + lowp vec4 tmpvar_19; + tmpvar_19 = texture (unity_Lightmap, xlv_TEXCOORD4.xy); + 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[1u].x = 0.0; + tmpvar_21[1u].y = 0.707107; + tmpvar_21[1u].z = -0.707107; + tmpvar_21[2u].x = 0.57735; + tmpvar_21[2u].y = 0.57735; + tmpvar_21[2u].z = 0.57735; + lowp vec3 tmpvar_22; + tmpvar_22 = ((8.0 * tmpvar_20.w) * tmpvar_20.xyz); + highp vec3 v_23; + v_23.x = tmpvar_21[0].x; + v_23.y = tmpvar_21[1].x; + v_23.z = tmpvar_21[2].x; + highp vec3 v_24; + v_24.x = tmpvar_21[0].y; + v_24.y = tmpvar_21[1].y; + v_24.z = tmpvar_21[2].y; + highp vec3 v_25; + v_25.x = tmpvar_21[0].z; + v_25.y = tmpvar_21[1].z; + v_25.z = tmpvar_21[2].z; + lightDir_1 = (normalize(( + ((tmpvar_22.x * v_23) + (tmpvar_22.y * v_24)) + + + (tmpvar_22.z * v_25) + )) * tmpvar_5); + lowp vec3 tmpvar_26; + tmpvar_26 = normalize(lightDir_1); + lightDir_1 = tmpvar_26; + lowp vec3 lightColor_27; + lightColor_27 = (textureProj (_ShadowMapTexture, xlv_TEXCOORD5).x * (( + (8.0 * tmpvar_19.w) + * tmpvar_19.xyz) * dot ( + clamp ((tmpvar_21 * tmpvar_9), 0.0, 1.0) + , tmpvar_22))); + highp vec3 viewDir_28; + viewDir_28 = -(tmpvar_11); + lowp vec3 tmpvar_29; + tmpvar_29 = normalize((tmpvar_26 + viewDir_28)); + lowp float tmpvar_30; + tmpvar_30 = max (0.0, dot (tmpvar_10, tmpvar_26)); + lowp float tmpvar_31; + tmpvar_31 = max (0.0, dot (tmpvar_10, tmpvar_29)); + lowp float tmpvar_32; + tmpvar_32 = max (0.0, dot (tmpvar_10, viewDir_28)); + lowp float tmpvar_33; + tmpvar_33 = max (0.0, dot (viewDir_28, tmpvar_29)); + lowp float VdotH_34; + VdotH_34 = (tmpvar_33 + 1e-05); + lowp float tmpvar_35; + tmpvar_35 = ((1.0/(( + pow (tmpvar_14, 4.0) + + 1e-05))) - 2.0); + lowp float tmpvar_36; + lowp float tmpvar_37; + tmpvar_37 = max (0.0, dot (tmpvar_26, tmpvar_29)); + tmpvar_36 = (0.5 + ((2.0 * tmpvar_37) * (tmpvar_37 * tmpvar_14))); + lowp vec4 tmpvar_38; + tmpvar_38.xyz = ((( + (min (((_Color.xyz * texture (_MainTex, xlv_TEXCOORD0.xy).xyz) * (2.0 * texture (_DetailAlbedoMap, xlv_TEXCOORD0.zw).xyz)), (vec3(1.0, 1.0, 1.0) - tmpvar_13)) * ((( + (1.0 + ((tmpvar_36 - 1.0) * pow ((1.00001 - tmpvar_30), 5.0))) + * + (1.0 + ((tmpvar_36 - 1.0) * pow ((1.00001 - tmpvar_32), 5.0))) + ) * tmpvar_30) * lightColor_27)) + + + (tmpvar_12.xyz * (env_2 + (lightColor_27 * max (0.0, + ((((tmpvar_13 + + ((1.0 - tmpvar_13) * pow (abs((1.0 - tmpvar_33)), 5.0)) + ) * min (1.0, + min ((((2.0 * tmpvar_31) * tmpvar_32) / VdotH_34), (((2.0 * tmpvar_31) * tmpvar_30) / VdotH_34)) + )) * max (0.0, ( + pow (tmpvar_31, tmpvar_35) + * + ((tmpvar_35 + 1.0) / 6.28318) + ))) / ((4.0 * tmpvar_32) + 1e-05)) + )))) + ) + ( + (((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; +} + + +// stats: 146 alu 12 tex 0 flow +// inputs: 6 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] +// #1: xlv_TEXCOORD1 (high float) 4x1 [-1] +// #2: xlv_TEXCOORD2 (high float) 3x1 [-1] +// #3: xlv_TEXCOORD3 (high float) 4x1 [-1] +// #4: xlv_TEXCOORD4 (high float) 3x1 [-1] +// #5: xlv_TEXCOORD5 (high float) 4x1 [-1] +// uniforms: 6 (total size: 0) +// #0: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #1: _DetailNormalMapScale (high float) 1x1 [-1] +// #2: _BumpScale (high float) 1x1 [-1] +// #3: _Exposure (high float) 1x1 [-1] +// #4: _Color (high float) 4x1 [-1] +// #5: _SelfIllumScale (high float) 1x1 [-1] +// textures: 12 +// #0: _MainTex (low 2d) 0x0 [-1] +// #1: _DetailAlbedoMap (low 2d) 0x0 [-1] +// #2: _AlphaMap (low 2d) 0x0 [-1] +// #3: _Occlusion (low 2d) 0x0 [-1] +// #4: _DetailNormalMap (low 2d) 0x0 [-1] +// #5: _BumpMap (low 2d) 0x0 [-1] +// #6: _SpecGlossMap (low 2d) 0x0 [-1] +// #7: _ShadowMapTexture (low 2d) 0x0 [-1] +// #8: _SpecCube (low cube) 0x0 [-1] +// #9: unity_Lightmap (low 2d) 0x0 [-1] +// #10: unity_LightmapInd (low 2d) 0x0 [-1] +// #11: _SelfIllum (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3Metal.txt new file mode 100644 index 000000000..c9268c7b1 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3Metal.txt @@ -0,0 +1,214 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float4 xlv_TEXCOORD0; + float4 xlv_TEXCOORD1; + float3 xlv_TEXCOORD2; + float4 xlv_TEXCOORD3; + float3 xlv_TEXCOORD4; + float4 xlv_TEXCOORD5; +}; +struct xlatMtlShaderOutput { + half4 _fragData [[color(0)]]; +}; +struct xlatMtlShaderUniform { + float3 _WorldSpaceCameraPos; + float _DetailNormalMapScale; + float _BumpScale; + float _Exposure; + float4 _Color; + float _SelfIllumScale; +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , texture2d _MainTex [[texture(0)]], sampler _mtlsmp__MainTex [[sampler(0)]] + , texture2d _DetailAlbedoMap [[texture(1)]], sampler _mtlsmp__DetailAlbedoMap [[sampler(1)]] + , texture2d _AlphaMap [[texture(2)]], sampler _mtlsmp__AlphaMap [[sampler(2)]] + , texture2d _Occlusion [[texture(3)]], sampler _mtlsmp__Occlusion [[sampler(3)]] + , texture2d _DetailNormalMap [[texture(4)]], sampler _mtlsmp__DetailNormalMap [[sampler(4)]] + , texture2d _BumpMap [[texture(5)]], sampler _mtlsmp__BumpMap [[sampler(5)]] + , texture2d _SpecGlossMap [[texture(6)]], sampler _mtlsmp__SpecGlossMap [[sampler(6)]] + , texture2d _ShadowMapTexture [[texture(7)]], sampler _mtlsmp__ShadowMapTexture [[sampler(7)]] + , texturecube _SpecCube [[texture(8)]], sampler _mtlsmp__SpecCube [[sampler(8)]] + , texture2d unity_Lightmap [[texture(9)]], sampler _mtlsmp_unity_Lightmap [[sampler(9)]] + , texture2d unity_LightmapInd [[texture(10)]], sampler _mtlsmp_unity_LightmapInd [[sampler(10)]] + , texture2d _SelfIllum [[texture(11)]], sampler _mtlsmp__SelfIllum [[sampler(11)]]) +{ + xlatMtlShaderOutput _mtl_o; + half3 lightDir_1; + half3 env_2; + float3 tmpvar_3; + float3 tmpvar_4; + tmpvar_3 = _mtl_i.xlv_TEXCOORD3.xyz; + tmpvar_4 = (((_mtl_i.xlv_TEXCOORD2.yzx * _mtl_i.xlv_TEXCOORD3.zxy) - (_mtl_i.xlv_TEXCOORD2.zxy * _mtl_i.xlv_TEXCOORD3.yzx)) * _mtl_i.xlv_TEXCOORD3.www); + float3x3 tmpvar_5; + tmpvar_5[0].x = tmpvar_3.x; + tmpvar_5[0].y = tmpvar_4.x; + tmpvar_5[0].z = _mtl_i.xlv_TEXCOORD2.x; + tmpvar_5[1].x = tmpvar_3.y; + tmpvar_5[1].y = tmpvar_4.y; + tmpvar_5[1].z = _mtl_i.xlv_TEXCOORD2.y; + tmpvar_5[2].x = tmpvar_3.z; + tmpvar_5[2].y = tmpvar_4.z; + tmpvar_5[2].z = _mtl_i.xlv_TEXCOORD2.z; + half3 normal_6; + normal_6.xy = ((_BumpMap.sample(_mtlsmp__BumpMap, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).wy * (half)2.0) - (half)1.0); + normal_6.xy = ((half2)((float2)normal_6.xy * _mtl_u._BumpScale)); + normal_6.z = sqrt(((half)1.0 - clamp ( + dot (normal_6.xy, normal_6.xy) + , (half)0.0, (half)1.0))); + half3 normal_7; + normal_7.xy = ((_DetailNormalMap.sample(_mtlsmp__DetailNormalMap, (float2)(_mtl_i.xlv_TEXCOORD0.zw)).wy * (half)2.0) - (half)1.0); + normal_7.xy = ((half2)((float2)normal_7.xy * _mtl_u._DetailNormalMapScale)); + normal_7.z = sqrt(((half)1.0 - clamp ( + dot (normal_7.xy, normal_7.xy) + , (half)0.0, (half)1.0))); + half3 tmpvar_8; + tmpvar_8.xy = (normal_6.xy + normal_7.xy); + tmpvar_8.z = (normal_6.z * normal_7.z); + half3 tmpvar_9; + tmpvar_9 = normalize(tmpvar_8); + half3 tmpvar_10; + tmpvar_10 = ((half3)((float3)tmpvar_9 * tmpvar_5)); + float3 tmpvar_11; + tmpvar_11 = normalize((_mtl_i.xlv_TEXCOORD1.xyz - _mtl_u._WorldSpaceCameraPos)); + half4 tmpvar_12; + tmpvar_12 = _SpecGlossMap.sample(_mtlsmp__SpecGlossMap, (float2)(_mtl_i.xlv_TEXCOORD0.xy)); + half tmpvar_13; + tmpvar_13 = dot (tmpvar_12.xyz, (half3)float3(0.299, 0.587, 0.114)); + half tmpvar_14; + tmpvar_14 = ((half)1.0 - tmpvar_12.w); + half4 tmpvar_15; + tmpvar_15.xyz = ((half3)(tmpvar_11 - (float3)((half)2.0 * ( + ((half)dot ((float3)tmpvar_10, tmpvar_11)) + * tmpvar_10)))); + tmpvar_15.w = (tmpvar_14 * (half)5.0); + half4 tmpvar_16; + tmpvar_16 = _SpecCube.sample(_mtlsmp__SpecCube, (float3)(tmpvar_15.xyz), level(tmpvar_15.w)); + half tmpvar_17; + tmpvar_17 = (tmpvar_16.w * tmpvar_16.w); + half2 tmpvar_18; + tmpvar_18.x = tmpvar_17; + tmpvar_18.y = (tmpvar_16.w * tmpvar_17); + env_2 = (((half3)((float3)(tmpvar_16.xyz * + dot ((half2)float2(0.7532, 0.2468), tmpvar_18) + ) * _mtl_u._Exposure)) * _Occlusion.sample(_mtlsmp__Occlusion, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).x); + half4 tmpvar_19; + tmpvar_19 = unity_Lightmap.sample(_mtlsmp_unity_Lightmap, (float2)(_mtl_i.xlv_TEXCOORD4.xy)); + half4 tmpvar_20; + tmpvar_20 = unity_LightmapInd.sample(_mtlsmp_unity_LightmapInd, (float2)(_mtl_i.xlv_TEXCOORD4.xy)); + float3x3 tmpvar_21; + tmpvar_21[0].x = 0.816497; + tmpvar_21[0].y = -0.408248; + tmpvar_21[0].z = -0.408248; + tmpvar_21[1].x = 0.0; + tmpvar_21[1].y = 0.707107; + tmpvar_21[1].z = -0.707107; + tmpvar_21[2].x = 0.57735; + tmpvar_21[2].y = 0.57735; + tmpvar_21[2].z = 0.57735; + half3 tmpvar_22; + tmpvar_22 = (((half)8.0 * tmpvar_20.w) * tmpvar_20.xyz); + float3 v_23; + v_23.x = tmpvar_21[0].x; + v_23.y = tmpvar_21[1].x; + v_23.z = tmpvar_21[2].x; + float3 v_24; + v_24.x = tmpvar_21[0].y; + v_24.y = tmpvar_21[1].y; + v_24.z = tmpvar_21[2].y; + float3 v_25; + v_25.x = tmpvar_21[0].z; + v_25.y = tmpvar_21[1].z; + v_25.z = tmpvar_21[2].z; + lightDir_1 = ((half3)((float3)normalize(( + ((tmpvar_22.x * (half3)v_23) + (tmpvar_22.y * (half3)v_24)) + + + (tmpvar_22.z * (half3)v_25) + )) * tmpvar_5)); + half3 tmpvar_26; + tmpvar_26 = normalize(lightDir_1); + lightDir_1 = tmpvar_26; + half3 lightColor_27; + lightColor_27 = (_ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, ((float2)(_mtl_i.xlv_TEXCOORD5).xy / (float)(_mtl_i.xlv_TEXCOORD5).w)).x * (( + ((half)8.0 * tmpvar_19.w) + * tmpvar_19.xyz) * dot ( + clamp (((half3)(tmpvar_21 * (float3)tmpvar_9)), (half)0.0, (half)1.0) + , tmpvar_22))); + float3 viewDir_28; + viewDir_28 = -(tmpvar_11); + half3 tmpvar_29; + tmpvar_29 = normalize(((half3)((float3)tmpvar_26 + viewDir_28))); + half tmpvar_30; + tmpvar_30 = max ((half)0.0, dot (tmpvar_10, tmpvar_26)); + half tmpvar_31; + tmpvar_31 = max ((half)0.0, dot (tmpvar_10, tmpvar_29)); + half tmpvar_32; + tmpvar_32 = max ((half)0.0, ((half)dot ((float3)tmpvar_10, viewDir_28))); + half tmpvar_33; + tmpvar_33 = max ((half)0.0, ((half)dot (viewDir_28, (float3)tmpvar_29))); + half VdotH_34; + VdotH_34 = (tmpvar_33 + (half)1e-05); + half tmpvar_35; + tmpvar_35 = ((1.0/(( + pow (tmpvar_14, (half)4.0) + + (half)1e-05))) - (half)2.0); + half tmpvar_36; + half tmpvar_37; + tmpvar_37 = max ((half)0.0, dot (tmpvar_26, tmpvar_29)); + tmpvar_36 = ((half)0.5 + (((half)2.0 * tmpvar_37) * (tmpvar_37 * tmpvar_14))); + half4 tmpvar_38; + tmpvar_38.xyz = ((( + (min ((((half3)(_mtl_u._Color.xyz * (float3)_MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).xyz)) * ((half)2.0 * _DetailAlbedoMap.sample(_mtlsmp__DetailAlbedoMap, (float2)(_mtl_i.xlv_TEXCOORD0.zw)).xyz)), ((half3)float3(1.0, 1.0, 1.0) - tmpvar_13)) * ((( + ((half)1.0 + ((tmpvar_36 - (half)1.0) * pow (((half)1.00001 - tmpvar_30), (half)5.0))) + * + ((half)1.0 + ((tmpvar_36 - (half)1.0) * pow (((half)1.00001 - tmpvar_32), (half)5.0))) + ) * tmpvar_30) * lightColor_27)) + + + (tmpvar_12.xyz * (env_2 + (lightColor_27 * max ((half)0.0, + ((((tmpvar_13 + + (((half)1.0 - tmpvar_13) * pow (abs(((half)1.0 - tmpvar_33)), (half)5.0)) + ) * min ((half)1.0, + min (((((half)2.0 * tmpvar_31) * tmpvar_32) / VdotH_34), ((((half)2.0 * tmpvar_31) * tmpvar_30) / VdotH_34)) + )) * max ((half)0.0, ( + pow (tmpvar_31, tmpvar_35) + * + ((tmpvar_35 + (half)1.0) / (half)6.28318) + ))) / (((half)4.0 * tmpvar_32) + (half)1e-05)) + )))) + ) + ( + ((((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; + return _mtl_o; +} + + +// stats: 146 alu 12 tex 0 flow +// inputs: 6 +// #0: xlv_TEXCOORD0 (high float) 4x1 [-1] +// #1: xlv_TEXCOORD1 (high float) 4x1 [-1] +// #2: xlv_TEXCOORD2 (high float) 3x1 [-1] +// #3: xlv_TEXCOORD3 (high float) 4x1 [-1] +// #4: xlv_TEXCOORD4 (high float) 3x1 [-1] +// #5: xlv_TEXCOORD5 (high float) 4x1 [-1] +// uniforms: 6 (total size: 52) +// #0: _WorldSpaceCameraPos (high float) 3x1 [-1] loc 0 +// #1: _DetailNormalMapScale (high float) 1x1 [-1] loc 16 +// #2: _BumpScale (high float) 1x1 [-1] loc 20 +// #3: _Exposure (high float) 1x1 [-1] loc 24 +// #4: _Color (high float) 4x1 [-1] loc 32 +// #5: _SelfIllumScale (high float) 1x1 [-1] loc 48 +// textures: 12 +// #0: _MainTex (low 2d) 0x0 [-1] loc 0 +// #1: _DetailAlbedoMap (low 2d) 0x0 [-1] loc 1 +// #2: _AlphaMap (low 2d) 0x0 [-1] loc 2 +// #3: _Occlusion (low 2d) 0x0 [-1] loc 3 +// #4: _DetailNormalMap (low 2d) 0x0 [-1] loc 4 +// #5: _BumpMap (low 2d) 0x0 [-1] loc 5 +// #6: _SpecGlossMap (low 2d) 0x0 [-1] loc 6 +// #7: _ShadowMapTexture (low 2d) 0x0 [-1] loc 7 +// #8: _SpecCube (low cube) 0x0 [-1] loc 8 +// #9: unity_Lightmap (low 2d) 0x0 [-1] loc 9 +// #10: unity_LightmapInd (low 2d) 0x0 [-1] loc 10 +// #11: _SelfIllum (low 2d) 0x0 [-1] loc 11 diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-inES3.txt new file mode 100644 index 000000000..b409584d0 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-inES3.txt @@ -0,0 +1,101 @@ +#version 300 es + +#define gl_FragColor _glesFragData[0] +#define gl_FragData _glesFragData +layout(location = 0) out mediump vec4 _glesFragData[4]; + +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 worldNormal; + highp vec3 worldPos; +}; +struct appdata_full { + highp vec4 vertex; + highp vec4 tangent; + highp vec3 normal; + highp vec4 texcoord; + highp vec4 texcoord1; + highp vec4 texcoord2; + highp vec4 texcoord3; + lowp vec4 color; +}; +uniform highp vec4 _WorldSpaceLightPos0; +uniform lowp vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform mediump mat4 _LightMatrix0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform highp vec4 _MainTex_ST; + +lowp vec4 LightingLambert( in SurfaceOutput s, in lowp vec3 lightDir, in lowp float atten ) +{ + lowp float diff = max( 0.0, dot( s.Normal, lightDir)); + lowp vec4 c; + c.xyz = ((s.Albedo * _LightColor0.xyz) * ((diff * atten) * 2.0)); + c.w = s.Alpha; + return c; +} +lowp float UnitySpotAttenuate( in mediump vec3 LightCoord ) +{ + return texture( _LightTextureB0, vec2( dot( LightCoord, LightCoord))).w; +} +lowp float UnitySpotCookie( in mediump vec4 LightCoord ) +{ + return texture( _LightTexture0, ((LightCoord.xy / LightCoord.w) + 0.5)).w; +} +highp vec3 UnityWorldSpaceLightDir( in highp vec3 worldPos ) +{ + return (_WorldSpaceLightPos0.xyz - worldPos); +} +void surf( in Input IN, inout SurfaceOutput o ) +{ + mediump vec4 c = texture( _MainTex, IN.uv_MainTex); + o.Albedo = c.xyz; + o.Alpha = c.w; +} +lowp vec4 frag_surf( in v2f_surf IN ) +{ + Input surfIN; + surfIN.uv_MainTex = IN.pack0.xy; + highp vec3 worldPos = IN.worldPos; + highp vec3 lightDir = normalize(UnityWorldSpaceLightDir( worldPos)); + SurfaceOutput o; + o.Albedo = vec3( 0.0); + o.Emission = vec3( 0.0); + o.Specular = 0.0; + o.Alpha = 0.0; + o.Gloss = 0.0; + o.Normal = IN.worldNormal; + surf( surfIN, o); + mediump vec4 lightCoord = (_LightMatrix0 * vec4( worldPos, 1.0)); + lowp float atten = (((float((lightCoord.z > 0.0)) * UnitySpotCookie( lightCoord)) * UnitySpotAttenuate( lightCoord.xyz)) * 1.0); + lowp vec4 c = vec4( 0.0); + c += LightingLambert( o, lightDir, atten); + c.w = 0.0; + return c; +} +in highp vec2 xlv_TEXCOORD0; +in lowp vec3 xlv_TEXCOORD1; +in highp vec3 xlv_TEXCOORD2; +void main() { + lowp vec4 xl_retval; + v2f_surf xlt_IN; + xlt_IN.pos = vec4(0.0); + xlt_IN.pack0 = vec2(xlv_TEXCOORD0); + xlt_IN.worldNormal = vec3(xlv_TEXCOORD1); + xlt_IN.worldPos = vec3(xlv_TEXCOORD2); + xl_retval = frag_surf( xlt_IN); + gl_FragData[0] = vec4(xl_retval); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-outES3.txt new file mode 100644 index 000000000..e061c46fc --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-outES3.txt @@ -0,0 +1,71 @@ +#version 300 es +layout(location=0) out mediump vec4 _glesFragData[4]; +uniform highp vec4 _WorldSpaceLightPos0; +uniform lowp vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform mediump mat4 _LightMatrix0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +in highp vec2 xlv_TEXCOORD0; +in lowp vec3 xlv_TEXCOORD1; +in highp vec3 xlv_TEXCOORD2; +void main () +{ + lowp vec4 c_1; + lowp float atten_2; + mediump vec4 lightCoord_3; + highp vec3 tmpvar_4; + tmpvar_4 = normalize((_WorldSpaceLightPos0.xyz - xlv_TEXCOORD2)); + lowp vec3 tmpvar_5; + lowp float tmpvar_6; + mediump vec4 c_7; + lowp vec4 tmpvar_8; + tmpvar_8 = texture (_MainTex, xlv_TEXCOORD0); + c_7 = tmpvar_8; + tmpvar_5 = c_7.xyz; + tmpvar_6 = c_7.w; + highp vec4 tmpvar_9; + tmpvar_9.w = 1.0; + tmpvar_9.xyz = xlv_TEXCOORD2; + highp vec4 tmpvar_10; + tmpvar_10 = (_LightMatrix0 * tmpvar_9); + lightCoord_3 = tmpvar_10; + lowp vec4 tmpvar_11; + mediump vec2 P_12; + P_12 = ((lightCoord_3.xy / lightCoord_3.w) + 0.5); + tmpvar_11 = texture (_LightTexture0, P_12); + mediump float tmpvar_13; + tmpvar_13 = dot (lightCoord_3.xyz, lightCoord_3.xyz); + lowp vec4 tmpvar_14; + tmpvar_14 = texture (_LightTextureB0, vec2(tmpvar_13)); + mediump float tmpvar_15; + tmpvar_15 = ((float( + (lightCoord_3.z > 0.0) + ) * tmpvar_11.w) * tmpvar_14.w); + atten_2 = tmpvar_15; + lowp vec3 lightDir_16; + lightDir_16 = tmpvar_4; + lowp vec4 c_17; + c_17.xyz = ((tmpvar_5 * _LightColor0.xyz) * (( + max (0.0, dot (xlv_TEXCOORD1, lightDir_16)) + * atten_2) * 2.0)); + c_17.w = tmpvar_6; + c_1.xyz = c_17.xyz; + c_1.w = 0.0; + _glesFragData[0] = c_1; +} + + +// stats: 18 alu 3 tex 0 flow +// inputs: 3 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// #1: xlv_TEXCOORD1 (low float) 3x1 [-1] +// #2: xlv_TEXCOORD2 (high float) 3x1 [-1] +// uniforms: 3 (total size: 0) +// #0: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #1: _LightColor0 (low float) 4x1 [-1] +// #2: _LightMatrix0 (medium float) 4x4 [-1] +// textures: 3 +// #0: _LightTexture0 (low 2d) 0x0 [-1] +// #1: _LightTextureB0 (low 2d) 0x0 [-1] +// #2: _MainTex (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-outES3Metal.txt new file mode 100644 index 000000000..a488e9fec --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-outES3Metal.txt @@ -0,0 +1,80 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float2 xlv_TEXCOORD0; + half3 xlv_TEXCOORD1; + float3 xlv_TEXCOORD2; +}; +struct xlatMtlShaderOutput { + half4 _glesFragData_0 [[color(0)]]; +}; +struct xlatMtlShaderUniform { + float4 _WorldSpaceLightPos0; + half4 _LightColor0; + half4x4 _LightMatrix0; +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , texture2d _LightTexture0 [[texture(0)]], sampler _mtlsmp__LightTexture0 [[sampler(0)]] + , texture2d _LightTextureB0 [[texture(1)]], sampler _mtlsmp__LightTextureB0 [[sampler(1)]] + , texture2d _MainTex [[texture(2)]], sampler _mtlsmp__MainTex [[sampler(2)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 c_1; + half atten_2; + half4 lightCoord_3; + float3 tmpvar_4; + tmpvar_4 = normalize((_mtl_u._WorldSpaceLightPos0.xyz - _mtl_i.xlv_TEXCOORD2)); + half3 tmpvar_5; + half tmpvar_6; + half4 c_7; + half4 tmpvar_8; + tmpvar_8 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0)); + c_7 = tmpvar_8; + tmpvar_5 = c_7.xyz; + tmpvar_6 = c_7.w; + float4 tmpvar_9; + tmpvar_9.w = 1.0; + tmpvar_9.xyz = _mtl_i.xlv_TEXCOORD2; + float4 tmpvar_10; + tmpvar_10 = ((float4)(_mtl_u._LightMatrix0 * (half4)tmpvar_9)); + lightCoord_3 = half4(tmpvar_10); + half4 tmpvar_11; + half2 P_12; + P_12 = ((lightCoord_3.xy / lightCoord_3.w) + (half)0.5); + tmpvar_11 = _LightTexture0.sample(_mtlsmp__LightTexture0, (float2)(P_12)); + half tmpvar_13; + tmpvar_13 = dot (lightCoord_3.xyz, lightCoord_3.xyz); + half4 tmpvar_14; + tmpvar_14 = _LightTextureB0.sample(_mtlsmp__LightTextureB0, (float2)(half2(tmpvar_13))); + half tmpvar_15; + tmpvar_15 = ((half( + (lightCoord_3.z > (half)0.0) + ) * tmpvar_11.w) * tmpvar_14.w); + atten_2 = tmpvar_15; + half3 lightDir_16; + lightDir_16 = half3(tmpvar_4); + half4 c_17; + c_17.xyz = ((tmpvar_5 * _mtl_u._LightColor0.xyz) * (( + max ((half)0.0, dot (_mtl_i.xlv_TEXCOORD1, lightDir_16)) + * atten_2) * (half)2.0)); + c_17.w = tmpvar_6; + c_1.xyz = c_17.xyz; + c_1.w = half(0.0); + _mtl_o._glesFragData_0 = c_1; + return _mtl_o; +} + + +// stats: 18 alu 3 tex 0 flow +// inputs: 3 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// #1: xlv_TEXCOORD1 (low float) 3x1 [-1] +// #2: xlv_TEXCOORD2 (high float) 3x1 [-1] +// uniforms: 3 (total size: 56) +// #0: _WorldSpaceLightPos0 (high float) 4x1 [-1] loc 0 +// #1: _LightColor0 (low float) 4x1 [-1] loc 16 +// #2: _LightMatrix0 (medium float) 4x4 [-1] loc 24 +// textures: 3 +// #0: _LightTexture0 (low 2d) 0x0 [-1] loc 0 +// #1: _LightTextureB0 (low 2d) 0x0 [-1] loc 1 +// #2: _MainTex (low 2d) 0x0 [-1] loc 2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-ir.txt deleted file mode 100644 index c38972047..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-ir.txt +++ /dev/null @@ -1,159 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; -}; -struct v2f_surf { - vec4 pos; - vec2 hip_pack0; - vec3 TtoV0; - vec3 TtoV1; - vec3 TtoV2; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform sampler2D _MainTex; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -void surf ( - in Input IN_6, - inout SurfaceOutput o_7 -) -{ - vec4 c_8; - vec4 tmpvar_9; - tmpvar_9 = texture2D (_MainTex, IN_6.uv_MainTex); - vec4 tmpvar_10; - tmpvar_10 = (tmpvar_9 * _Color); - c_8 = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = c_8.xyz; - o_7.Albedo = tmpvar_11; - float tmpvar_12; - tmpvar_12 = c_8.w; - o_7.Alpha = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13 = texture2D (_BumpMap, IN_6.uv_BumpMap); - vec4 tmpvar_14; - tmpvar_14 = UnpackNormal (tmpvar_13); - vec3 tmpvar_15; - tmpvar_15 = tmpvar_14.xyz; - vec3 tmpvar_16; - tmpvar_16 = tmpvar_15; - o_7.Normal = tmpvar_16; -} - -vec4 frag_surf ( - in v2f_surf IN_17 -) -{ - vec4 res_18; - vec3 viewN_19; - SurfaceOutput o_20; - Input surfIN_21; - vec2 tmpvar_22; - tmpvar_22 = IN_17.hip_pack0.xy; - surfIN_21.uv_BumpMap = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = vec3(0.0, 0.0, 0.0); - o_20.Albedo = tmpvar_23; - vec3 tmpvar_24; - tmpvar_24 = vec3(0.0, 0.0, 0.0); - o_20.Emission = tmpvar_24; - float tmpvar_25; - tmpvar_25 = 0.0; - o_20.Specular = tmpvar_25; - float tmpvar_26; - tmpvar_26 = 0.0; - o_20.Alpha = tmpvar_26; - float tmpvar_27; - tmpvar_27 = 0.0; - o_20.Gloss = tmpvar_27; - surf (surfIN_21, o_20); - float tmpvar_28; - tmpvar_28 = dot (IN_17.TtoV0, o_20.Normal); - float tmpvar_29; - tmpvar_29 = tmpvar_28; - viewN_19.x = tmpvar_29; - float tmpvar_30; - tmpvar_30 = dot (IN_17.TtoV1, o_20.Normal); - float tmpvar_31; - tmpvar_31 = tmpvar_30; - viewN_19.y = vec2(tmpvar_31).y; - float tmpvar_32; - tmpvar_32 = dot (IN_17.TtoV2, o_20.Normal); - float tmpvar_33; - tmpvar_33 = tmpvar_32; - viewN_19.z = vec3(tmpvar_33).z; - vec3 tmpvar_34; - tmpvar_34 = viewN_19; - o_20.Normal = tmpvar_34; - vec3 tmpvar_35; - tmpvar_35 = ((o_20.Normal * vec3(0.5, 0.5, -0.5)) + 0.5); - res_18.xyz = tmpvar_35.xyz.xyz; - float tmpvar_36; - tmpvar_36 = o_20.Specular; - res_18.w = vec4(tmpvar_36).w; - return res_18; -} - -void main () -{ - v2f_surf xlt_IN_37; - vec4 xl_retval_38; - vec4 tmpvar_39; - tmpvar_39 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_37.pos = tmpvar_39; - vec2 tmpvar_40; - tmpvar_40 = gl_TexCoord[0].xy; - vec2 tmpvar_41; - tmpvar_41 = tmpvar_40; - xlt_IN_37.hip_pack0 = tmpvar_41; - vec3 tmpvar_42; - tmpvar_42 = gl_TexCoord[1].xyz; - vec3 tmpvar_43; - tmpvar_43 = tmpvar_42; - xlt_IN_37.TtoV0 = tmpvar_43; - vec3 tmpvar_44; - tmpvar_44 = gl_TexCoord[2].xyz; - vec3 tmpvar_45; - tmpvar_45 = tmpvar_44; - xlt_IN_37.TtoV1 = tmpvar_45; - vec3 tmpvar_46; - tmpvar_46 = gl_TexCoord[3].xyz; - vec3 tmpvar_47; - tmpvar_47 = tmpvar_46; - xlt_IN_37.TtoV2 = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48 = frag_surf (xlt_IN_37); - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - xl_retval_38 = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50 = xl_retval_38.xyzw; - vec4 tmpvar_51; - tmpvar_51 = tmpvar_50; - gl_FragData[0] = tmpvar_51; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-out.txt index 0632599f9..bf03f0203 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-out.txt @@ -17,4 +17,8 @@ void main () } -// inputs: 1, stats: 13 alu 1 tex 0 flow +// stats: 13 alu 1 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// textures: 1 +// #0: _BumpMap (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-ir.txt deleted file mode 100644 index 8aee560c2..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-ir.txt +++ /dev/null @@ -1,163 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 hip_screen; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform vec4 unity_Ambient; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -void surf ( - in Input IN_6, - inout SurfaceOutput o_7 -) -{ - vec4 c_8; - vec4 tmpvar_9; - tmpvar_9 = texture2D (_MainTex, IN_6.uv_MainTex); - vec4 tmpvar_10; - tmpvar_10 = (tmpvar_9 * _Color); - c_8 = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = c_8.xyz; - o_7.Albedo = tmpvar_11; - float tmpvar_12; - tmpvar_12 = c_8.w; - o_7.Alpha = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13 = texture2D (_BumpMap, IN_6.uv_BumpMap); - vec4 tmpvar_14; - tmpvar_14 = UnpackNormal (tmpvar_13); - vec3 tmpvar_15; - tmpvar_15 = tmpvar_14.xyz; - vec3 tmpvar_16; - tmpvar_16 = tmpvar_15; - o_7.Normal = tmpvar_16; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_17, - in vec4 light_18 -) -{ - vec4 c_19; - vec3 tmpvar_20; - tmpvar_20 = (s_17.Albedo * light_18.xyz); - c_19.xyz = tmpvar_20.xyz.xyz; - float tmpvar_21; - tmpvar_21 = s_17.Alpha; - c_19.w = vec4(tmpvar_21).w; - return c_19; -} - -vec4 frag_surf ( - in v2f_surf IN_22 -) -{ - vec4 col_23; - vec4 light_24; - SurfaceOutput o_25; - Input surfIN_26; - vec2 tmpvar_27; - tmpvar_27 = IN_22.hip_pack0.xy; - surfIN_26.uv_MainTex = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = vec3(0.0, 0.0, 0.0); - o_25.Albedo = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = vec3(0.0, 0.0, 0.0); - o_25.Emission = tmpvar_29; - float tmpvar_30; - tmpvar_30 = 0.0; - o_25.Specular = tmpvar_30; - float tmpvar_31; - tmpvar_31 = 0.0; - o_25.Alpha = tmpvar_31; - float tmpvar_32; - tmpvar_32 = 0.0; - o_25.Gloss = tmpvar_32; - surf (surfIN_26, o_25); - vec4 tmpvar_33; - tmpvar_33 = texture2DProj (_LightBuffer, IN_22.hip_screen); - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - light_24 = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35 = log2 (light_24); - vec4 tmpvar_36; - tmpvar_36 = -(tmpvar_35); - light_24 = tmpvar_36; - vec3 tmpvar_37; - tmpvar_37 = (light_24.xyz + unity_Ambient.xyz); - light_24.xyz = tmpvar_37.xyz.xyz; - vec4 tmpvar_38; - tmpvar_38 = LightingLambert_PrePass (o_25, light_24); - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - col_23 = tmpvar_39; - return col_23; -} - -void main () -{ - v2f_surf xlt_IN_40; - vec4 xl_retval_41; - vec4 tmpvar_42; - tmpvar_42 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_40.pos = tmpvar_42; - float tmpvar_43; - tmpvar_43 = xlv_FOG.x; - xlt_IN_40.fog = tmpvar_43; - vec2 tmpvar_44; - tmpvar_44 = gl_TexCoord[0].xy; - vec2 tmpvar_45; - tmpvar_45 = tmpvar_44; - xlt_IN_40.hip_pack0 = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46 = gl_TexCoord[1].xyzw; - vec4 tmpvar_47; - tmpvar_47 = tmpvar_46; - xlt_IN_40.hip_screen = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48 = frag_surf (xlt_IN_40); - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - xl_retval_41 = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50 = xl_retval_41.xyzw; - vec4 tmpvar_51; - tmpvar_51 = tmpvar_50; - gl_FragData[0] = tmpvar_51; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-out.txt index f4e6c20e7..931d1e419 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-out.txt @@ -1,4 +1,3 @@ -uniform sampler2D _BumpMap; uniform vec4 _Color; uniform sampler2D _LightBuffer; uniform sampler2D _MainTex; @@ -6,23 +5,23 @@ uniform vec4 unity_Ambient; void main () { vec4 light_1; - vec2 tmpvar_2; - vec4 tmpvar_3; - tmpvar_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); - vec4 normal_4; - normal_4.xy = ((texture2D (_BumpMap, tmpvar_2).wy * 2.0) - 1.0); - normal_4.z = sqrt(((1.0 - - (normal_4.x * normal_4.x) - ) - (normal_4.y * normal_4.y))); - vec4 tmpvar_5; - tmpvar_5 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); - light_1.w = tmpvar_5.w; - light_1.xyz = (tmpvar_5.xyz + unity_Ambient.xyz); - vec4 c_6; - c_6.xyz = (tmpvar_3.xyz * light_1.xyz); - c_6.w = tmpvar_3.w; - gl_FragData[0] = c_6; + vec4 c_2; + c_2 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); + light_1 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); + light_1.xyz = (light_1.xyz + unity_Ambient.xyz); + vec4 c_3; + c_3.xyz = (c_2.xyz * light_1.xyz); + c_3.w = c_2.w; + gl_FragData[0] = c_3; } -// inputs: 1, stats: 12 alu 3 tex 0 flow +// stats: 5 alu 2 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [2] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: unity_Ambient (high float) 4x1 [-1] +// textures: 2 +// #0: _LightBuffer (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-ir.txt deleted file mode 100644 index 9aaf1127a..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-ir.txt +++ /dev/null @@ -1,240 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec3 lightDir; - vec3 vlight; - vec4 _ShadowCoord; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform vec4 _LightColor0; -uniform sampler2D _MainTex; -uniform sampler2D _ShadowMapTexture; -uniform float _Shininess; -uniform vec4 _SpecColor; -varying vec4 xlv_FOG; -float unitySampleShadow ( - in vec4 shadowCoord_1 -) -{ - float shadow_2; - vec4 tmpvar_3; - tmpvar_3 = texture2DProj (_ShadowMapTexture, shadowCoord_1); - float tmpvar_4; - tmpvar_4 = tmpvar_3.x; - shadow_2 = tmpvar_4; - return shadow_2; -} - -vec4 UnpackNormal ( - in vec4 packednormal_5 -) -{ - vec4 normal_6; - vec2 tmpvar_7; - tmpvar_7 = ((packednormal_5.wy * 2.0) - 1.0); - normal_6.xy = tmpvar_7.xy.xy; - float tmpvar_8; - tmpvar_8 = sqrt (((1.0 - (normal_6.x * normal_6.x)) - (normal_6.y * normal_6.y))); - float tmpvar_9; - tmpvar_9 = tmpvar_8; - normal_6.z = vec3(tmpvar_9).z; - return normal_6; -} - -void surf ( - in Input IN_10, - inout SurfaceOutput o_11 -) -{ - vec4 tex_12; - vec4 tmpvar_13; - tmpvar_13 = texture2D (_MainTex, IN_10.uv_MainTex); - vec4 tmpvar_14; - tmpvar_14 = tmpvar_13; - tex_12 = tmpvar_14; - vec3 tmpvar_15; - tmpvar_15 = (tex_12.xyz * _Color.xyz); - o_11.Albedo = tmpvar_15; - float tmpvar_16; - tmpvar_16 = tex_12.w; - o_11.Gloss = tmpvar_16; - float tmpvar_17; - tmpvar_17 = (tex_12.w * _Color.w); - o_11.Alpha = tmpvar_17; - float tmpvar_18; - tmpvar_18 = _Shininess; - o_11.Specular = tmpvar_18; - vec4 tmpvar_19; - tmpvar_19 = texture2D (_BumpMap, IN_10.uv_BumpMap); - vec4 tmpvar_20; - tmpvar_20 = UnpackNormal (tmpvar_19); - vec3 tmpvar_21; - tmpvar_21 = tmpvar_20.xyz; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_21; - o_11.Normal = tmpvar_22; -} - -vec4 LightingBlinnPhong ( - in SurfaceOutput s_23, - in vec3 lightDir_24, - in vec3 viewDir_25, - in float atten_26 -) -{ - vec4 c_27; - float spec_28; - float nh_29; - float diff_30; - vec3 h_31; - vec3 tmpvar_32; - tmpvar_32 = normalize ((lightDir_24 + viewDir_25)); - vec3 tmpvar_33; - tmpvar_33 = tmpvar_32; - h_31 = tmpvar_33; - float tmpvar_34; - tmpvar_34 = dot (s_23.Normal, lightDir_24); - float tmpvar_35; - tmpvar_35 = max (0.0, tmpvar_34); - float tmpvar_36; - tmpvar_36 = tmpvar_35; - diff_30 = tmpvar_36; - float tmpvar_37; - tmpvar_37 = dot (s_23.Normal, h_31); - float tmpvar_38; - tmpvar_38 = max (0.0, tmpvar_37); - float tmpvar_39; - tmpvar_39 = tmpvar_38; - nh_29 = tmpvar_39; - float tmpvar_40; - tmpvar_40 = pow (nh_29, (s_23.Specular * 128.0)); - float tmpvar_41; - tmpvar_41 = (tmpvar_40 * s_23.Gloss); - spec_28 = tmpvar_41; - vec3 tmpvar_42; - tmpvar_42 = ((( - (s_23.Albedo * _LightColor0.xyz) - * diff_30) + ( - (_LightColor0.xyz * _SpecColor.xyz) - * spec_28)) * (atten_26 * 2.0)); - c_27.xyz = tmpvar_42.xyz.xyz; - float tmpvar_43; - tmpvar_43 = (s_23.Alpha + (( - (_LightColor0.w * _SpecColor.w) - * spec_28) * atten_26)); - c_27.w = vec4(tmpvar_43).w; - return c_27; -} - -vec4 frag_surf ( - in v2f_surf IN_44 -) -{ - vec4 c_45; - float atten_46; - SurfaceOutput o_47; - Input surfIN_48; - vec2 tmpvar_49; - tmpvar_49 = IN_44.hip_pack0.xy; - surfIN_48.uv_MainTex = tmpvar_49; - vec2 tmpvar_50; - tmpvar_50 = IN_44.hip_pack0.zw; - surfIN_48.uv_BumpMap = tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = vec3(0.0, 0.0, 0.0); - o_47.Albedo = tmpvar_51; - vec3 tmpvar_52; - tmpvar_52 = vec3(0.0, 0.0, 0.0); - o_47.Emission = tmpvar_52; - float tmpvar_53; - tmpvar_53 = 0.0; - o_47.Specular = tmpvar_53; - float tmpvar_54; - tmpvar_54 = 0.0; - o_47.Alpha = tmpvar_54; - float tmpvar_55; - tmpvar_55 = 0.0; - o_47.Gloss = tmpvar_55; - surf (surfIN_48, o_47); - float tmpvar_56; - tmpvar_56 = unitySampleShadow (IN_44._ShadowCoord); - float tmpvar_57; - tmpvar_57 = tmpvar_56; - atten_46 = tmpvar_57; - vec3 tmpvar_58; - tmpvar_58 = IN_44.viewDir.xyz; - vec3 tmpvar_59; - tmpvar_59 = normalize (tmpvar_58); - vec4 tmpvar_60; - tmpvar_60 = LightingBlinnPhong (o_47, IN_44.lightDir, tmpvar_59, atten_46); - vec4 tmpvar_61; - tmpvar_61 = tmpvar_60; - c_45 = tmpvar_61; - vec3 tmpvar_62; - tmpvar_62 = (c_45.xyz + (o_47.Albedo * IN_44.vlight)); - c_45.xyz = tmpvar_62.xyz.xyz; - return c_45; -} - -void main () -{ - v2f_surf xlt_IN_63; - vec4 xl_retval_64; - vec4 tmpvar_65; - tmpvar_65 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_63.pos = tmpvar_65; - float tmpvar_66; - tmpvar_66 = xlv_FOG.x; - xlt_IN_63.fog = tmpvar_66; - vec4 tmpvar_67; - tmpvar_67 = gl_TexCoord[0].xyzw; - vec4 tmpvar_68; - tmpvar_68 = tmpvar_67; - xlt_IN_63.hip_pack0 = tmpvar_68; - vec3 tmpvar_69; - tmpvar_69 = gl_TexCoord[1].xyz; - vec3 tmpvar_70; - tmpvar_70 = tmpvar_69; - xlt_IN_63.viewDir = tmpvar_70; - vec3 tmpvar_71; - tmpvar_71 = gl_TexCoord[2].xyz; - vec3 tmpvar_72; - tmpvar_72 = tmpvar_71; - xlt_IN_63.lightDir = tmpvar_72; - vec3 tmpvar_73; - tmpvar_73 = gl_TexCoord[3].xyz; - vec3 tmpvar_74; - tmpvar_74 = tmpvar_73; - xlt_IN_63.vlight = tmpvar_74; - vec4 tmpvar_75; - tmpvar_75 = gl_TexCoord[4].xyzw; - vec4 tmpvar_76; - tmpvar_76 = tmpvar_75; - xlt_IN_63._ShadowCoord = tmpvar_76; - vec4 tmpvar_77; - tmpvar_77 = frag_surf (xlt_IN_63); - vec4 tmpvar_78; - tmpvar_78 = tmpvar_77; - xl_retval_64 = tmpvar_78; - vec4 tmpvar_79; - tmpvar_79 = xl_retval_64.xyzw; - vec4 tmpvar_80; - tmpvar_80 = tmpvar_79; - gl_FragData[0] = tmpvar_80; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-out.txt index 536d1545e..d04f12cf0 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-out.txt @@ -12,10 +12,10 @@ void main () vec3 tmpvar_2; tmpvar_2 = gl_TexCoord[2].xyz; vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, tmpvar_1.xy); - vec3 tmpvar_5; - tmpvar_5 = (tmpvar_4.xyz * _Color.xyz); + vec3 tmpvar_4; + vec4 tmpvar_5; + tmpvar_5 = texture2D (_MainTex, tmpvar_1.xy); + tmpvar_4 = (tmpvar_5.xyz * _Color.xyz); vec4 normal_6; normal_6.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0); normal_6.z = sqrt(((1.0 - @@ -24,24 +24,33 @@ void main () vec4 tmpvar_7; tmpvar_7 = texture2DProj (_ShadowMapTexture, gl_TexCoord[4]); vec4 c_8; - float tmpvar_9; - tmpvar_9 = (pow (max (0.0, + float spec_9; + spec_9 = (pow (max (0.0, dot (normal_6.xyz, normalize((tmpvar_2 + normalize(gl_TexCoord[1].xyz)))) - ), (_Shininess * 128.0)) * tmpvar_4.w); + ), (_Shininess * 128.0)) * tmpvar_5.w); c_8.xyz = ((( - (tmpvar_5 * _LightColor0.xyz) + (tmpvar_4 * _LightColor0.xyz) * max (0.0, dot (normal_6.xyz, tmpvar_2)) ) + ( (_LightColor0.xyz * _SpecColor.xyz) - * tmpvar_9)) * (tmpvar_7.x * 2.0)); - c_8.w = ((tmpvar_4.w * _Color.w) + (( - (_LightColor0.w * _SpecColor.w) - * tmpvar_9) * tmpvar_7.x)); + * spec_9)) * (tmpvar_7.x * 2.0)); + c_8.w = ((tmpvar_5.w * _Color.w) + ((_LightColor0.w * _SpecColor.w) * (spec_9 * tmpvar_7.x))); c_3.w = c_8.w; - c_3.xyz = (c_8.xyz + (tmpvar_5 * gl_TexCoord[3].xyz)); + c_3.xyz = (c_8.xyz + (tmpvar_4 * gl_TexCoord[3].xyz)); gl_FragData[0] = c_3; } -// inputs: 1, stats: 32 alu 3 tex 0 flow +// stats: 32 alu 3 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [5] loc 4 +// uniforms: 4 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _Shininess (high float) 1x1 [-1] +// #3: _SpecColor (high float) 4x1 [-1] +// textures: 3 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] +// #2: _ShadowMapTexture (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-ir.txt deleted file mode 100644 index b573869f7..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-ir.txt +++ /dev/null @@ -1,221 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 lightDir; - vec3 viewDir; - vec2 _LightCoord; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _MainTex; -uniform float _Shininess; -uniform vec4 _SpecColor; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -void surf ( - in Input IN_6, - inout SurfaceOutput o_7 -) -{ - vec4 tex_8; - vec4 tmpvar_9; - tmpvar_9 = texture2D (_MainTex, IN_6.uv_MainTex); - vec4 tmpvar_10; - tmpvar_10 = tmpvar_9; - tex_8 = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = (tex_8.xyz * _Color.xyz); - o_7.Albedo = tmpvar_11; - float tmpvar_12; - tmpvar_12 = tex_8.w; - o_7.Gloss = tmpvar_12; - float tmpvar_13; - tmpvar_13 = (tex_8.w * _Color.w); - o_7.Alpha = tmpvar_13; - float tmpvar_14; - tmpvar_14 = _Shininess; - o_7.Specular = tmpvar_14; - vec4 tmpvar_15; - tmpvar_15 = texture2D (_BumpMap, IN_6.uv_BumpMap); - vec4 tmpvar_16; - tmpvar_16 = UnpackNormal (tmpvar_15); - vec3 tmpvar_17; - tmpvar_17 = tmpvar_16.xyz; - vec3 tmpvar_18; - tmpvar_18 = tmpvar_17; - o_7.Normal = tmpvar_18; -} - -vec4 LightingBlinnPhong ( - in SurfaceOutput s_19, - in vec3 lightDir_20, - in vec3 viewDir_21, - in float atten_22 -) -{ - vec4 c_23; - float spec_24; - float nh_25; - float diff_26; - vec3 h_27; - vec3 tmpvar_28; - tmpvar_28 = normalize ((lightDir_20 + viewDir_21)); - vec3 tmpvar_29; - tmpvar_29 = tmpvar_28; - h_27 = tmpvar_29; - float tmpvar_30; - tmpvar_30 = dot (s_19.Normal, lightDir_20); - float tmpvar_31; - tmpvar_31 = max (0.0, tmpvar_30); - float tmpvar_32; - tmpvar_32 = tmpvar_31; - diff_26 = tmpvar_32; - float tmpvar_33; - tmpvar_33 = dot (s_19.Normal, h_27); - float tmpvar_34; - tmpvar_34 = max (0.0, tmpvar_33); - float tmpvar_35; - tmpvar_35 = tmpvar_34; - nh_25 = tmpvar_35; - float tmpvar_36; - tmpvar_36 = pow (nh_25, (s_19.Specular * 128.0)); - float tmpvar_37; - tmpvar_37 = (tmpvar_36 * s_19.Gloss); - spec_24 = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = ((( - (s_19.Albedo * _LightColor0.xyz) - * diff_26) + ( - (_LightColor0.xyz * _SpecColor.xyz) - * spec_24)) * (atten_22 * 2.0)); - c_23.xyz = tmpvar_38.xyz.xyz; - float tmpvar_39; - tmpvar_39 = (s_19.Alpha + (( - (_LightColor0.w * _SpecColor.w) - * spec_24) * atten_22)); - c_23.w = vec4(tmpvar_39).w; - return c_23; -} - -vec4 frag_surf ( - in v2f_surf IN_40 -) -{ - vec4 c_41; - vec3 lightDir_42; - SurfaceOutput o_43; - Input surfIN_44; - vec2 tmpvar_45; - tmpvar_45 = IN_40.hip_pack0.xy; - surfIN_44.uv_MainTex = tmpvar_45; - vec2 tmpvar_46; - tmpvar_46 = IN_40.hip_pack0.zw; - surfIN_44.uv_BumpMap = tmpvar_46; - vec3 tmpvar_47; - tmpvar_47 = vec3(0.0, 0.0, 0.0); - o_43.Albedo = tmpvar_47; - vec3 tmpvar_48; - tmpvar_48 = vec3(0.0, 0.0, 0.0); - o_43.Emission = tmpvar_48; - float tmpvar_49; - tmpvar_49 = 0.0; - o_43.Specular = tmpvar_49; - float tmpvar_50; - tmpvar_50 = 0.0; - o_43.Alpha = tmpvar_50; - float tmpvar_51; - tmpvar_51 = 0.0; - o_43.Gloss = tmpvar_51; - surf (surfIN_44, o_43); - vec3 tmpvar_52; - tmpvar_52 = IN_40.lightDir; - lightDir_42 = tmpvar_52; - vec3 tmpvar_53; - tmpvar_53 = IN_40.viewDir.xyz; - vec3 tmpvar_54; - tmpvar_54 = normalize (tmpvar_53); - vec4 tmpvar_55; - tmpvar_55 = texture2D (_LightTexture0, IN_40._LightCoord); - vec4 tmpvar_56; - tmpvar_56 = LightingBlinnPhong (o_43, lightDir_42, tmpvar_54, (tmpvar_55.w * 1.0)); - vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - c_41 = tmpvar_57; - float tmpvar_58; - tmpvar_58 = 0.0; - c_41.w = vec4(tmpvar_58).w; - return c_41; -} - -void main () -{ - v2f_surf xlt_IN_59; - vec4 xl_retval_60; - vec4 tmpvar_61; - tmpvar_61 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_59.pos = tmpvar_61; - float tmpvar_62; - tmpvar_62 = xlv_FOG.x; - xlt_IN_59.fog = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63 = gl_TexCoord[0].xyzw; - vec4 tmpvar_64; - tmpvar_64 = tmpvar_63; - xlt_IN_59.hip_pack0 = tmpvar_64; - vec3 tmpvar_65; - tmpvar_65 = gl_TexCoord[1].xyz; - vec3 tmpvar_66; - tmpvar_66 = tmpvar_65; - xlt_IN_59.lightDir = tmpvar_66; - vec3 tmpvar_67; - tmpvar_67 = gl_TexCoord[2].xyz; - vec3 tmpvar_68; - tmpvar_68 = tmpvar_67; - xlt_IN_59.viewDir = tmpvar_68; - vec2 tmpvar_69; - tmpvar_69 = gl_TexCoord[3].xy; - vec2 tmpvar_70; - tmpvar_70 = tmpvar_69; - xlt_IN_59._LightCoord = tmpvar_70; - vec4 tmpvar_71; - tmpvar_71 = frag_surf (xlt_IN_59); - vec4 tmpvar_72; - tmpvar_72 = tmpvar_71; - xl_retval_60 = tmpvar_72; - vec4 tmpvar_73; - tmpvar_73 = xl_retval_60.xyzw; - vec4 tmpvar_74; - tmpvar_74 = tmpvar_73; - gl_FragData[0] = tmpvar_74; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-out.txt index ca5246f34..4b8357194 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-out.txt @@ -22,8 +22,8 @@ void main () float atten_6; atten_6 = texture2D (_LightTexture0, gl_TexCoord[3].xy).w; vec4 c_7; - float tmpvar_8; - tmpvar_8 = (pow (max (0.0, + float spec_8; + spec_8 = (pow (max (0.0, dot (normal_5.xyz, normalize((tmpvar_2 + normalize(gl_TexCoord[2].xyz)))) ), (_Shininess * 128.0)) * tmpvar_4.w); c_7.xyz = ((( @@ -32,14 +32,23 @@ void main () max (0.0, dot (normal_5.xyz, tmpvar_2)) ) + ( (_LightColor0.xyz * _SpecColor.xyz) - * tmpvar_8)) * (atten_6 * 2.0)); - c_7.w = ((tmpvar_4.w * _Color.w) + (( - (_LightColor0.w * _SpecColor.w) - * tmpvar_8) * atten_6)); + * spec_8)) * (atten_6 * 2.0)); + c_7.w = ((tmpvar_4.w * _Color.w) + ((_LightColor0.w * _SpecColor.w) * (spec_8 * atten_6))); c_3.xyz = c_7.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } -// inputs: 1, stats: 31 alu 3 tex 0 flow +// stats: 31 alu 3 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 4 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _Shininess (high float) 1x1 [-1] +// #3: _SpecColor (high float) 4x1 [-1] +// textures: 3 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _LightTexture0 (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-ir.txt deleted file mode 100644 index bbddfca69..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-ir.txt +++ /dev/null @@ -1,320 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 hip_screen; - vec3 hip_lmapFade; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform float _Shininess; -uniform vec4 _SpecColor; -uniform sampler2D unity_Lightmap; -uniform sampler2D unity_LightmapInd; -varying vec4 xlv_FOG; -float xll_saturate ( - in float x_1 -) -{ - float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -vec2 xll_saturate ( - in vec2 x_3 -) -{ - vec2 tmpvar_4; - tmpvar_4 = clamp (x_3, 0.0, 1.0); - return tmpvar_4; -} - -vec3 xll_saturate ( - in vec3 x_5 -) -{ - vec3 tmpvar_6; - tmpvar_6 = clamp (x_5, 0.0, 1.0); - return tmpvar_6; -} - -vec4 xll_saturate ( - in vec4 x_7 -) -{ - vec4 tmpvar_8; - tmpvar_8 = clamp (x_7, 0.0, 1.0); - return tmpvar_8; -} - -mat2 xll_saturate ( - in mat2 m_9 -) -{ - vec2 tmpvar_10; - tmpvar_10 = clamp (m_9[0], 0.0, 1.0); - vec2 tmpvar_11; - tmpvar_11 = clamp (m_9[1], 0.0, 1.0); - mat2 tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_10; - tmpvar_12[0] = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_12[1] = tmpvar_14; - return tmpvar_12; -} - -mat3 xll_saturate ( - in mat3 m_15 -) -{ - vec3 tmpvar_16; - tmpvar_16 = clamp (m_15[0], 0.0, 1.0); - vec3 tmpvar_17; - tmpvar_17 = clamp (m_15[1], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_15[2], 0.0, 1.0); - mat3 tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_16; - tmpvar_19[0] = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_19[1] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_19[2] = tmpvar_22; - return tmpvar_19; -} - -mat4 xll_saturate ( - in mat4 m_23 -) -{ - vec4 tmpvar_24; - tmpvar_24 = clamp (m_23[0], 0.0, 1.0); - vec4 tmpvar_25; - tmpvar_25 = clamp (m_23[1], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_23[2], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_23[3], 0.0, 1.0); - mat4 tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_24; - tmpvar_28[0] = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_28[1] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_28[2] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_28[3] = tmpvar_32; - return tmpvar_28; -} - -vec4 UnpackNormal ( - in vec4 packednormal_33 -) -{ - vec4 normal_34; - vec2 tmpvar_35; - tmpvar_35 = ((packednormal_33.wy * 2.0) - 1.0); - normal_34.xy = tmpvar_35.xy.xy; - float tmpvar_36; - tmpvar_36 = sqrt (((1.0 - (normal_34.x * normal_34.x)) - (normal_34.y * normal_34.y))); - float tmpvar_37; - tmpvar_37 = tmpvar_36; - normal_34.z = vec3(tmpvar_37).z; - return normal_34; -} - -void surf ( - in Input IN_38, - inout SurfaceOutput o_39 -) -{ - vec4 tex_40; - vec4 tmpvar_41; - tmpvar_41 = texture2D (_MainTex, IN_38.uv_MainTex); - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - tex_40 = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = (tex_40.xyz * _Color.xyz); - o_39.Albedo = tmpvar_43; - float tmpvar_44; - tmpvar_44 = tex_40.w; - o_39.Gloss = tmpvar_44; - float tmpvar_45; - tmpvar_45 = (tex_40.w * _Color.w); - o_39.Alpha = tmpvar_45; - float tmpvar_46; - tmpvar_46 = _Shininess; - o_39.Specular = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = texture2D (_BumpMap, IN_38.uv_BumpMap); - vec4 tmpvar_48; - tmpvar_48 = UnpackNormal (tmpvar_47); - vec3 tmpvar_49; - tmpvar_49 = tmpvar_48.xyz; - vec3 tmpvar_50; - tmpvar_50 = tmpvar_49; - o_39.Normal = tmpvar_50; -} - -vec4 LightingBlinnPhong_PrePass ( - in SurfaceOutput s_51, - in vec4 light_52 -) -{ - vec4 c_53; - float spec_54; - float tmpvar_55; - tmpvar_55 = (light_52.w * s_51.Gloss); - spec_54 = tmpvar_55; - vec3 tmpvar_56; - tmpvar_56 = ((s_51.Albedo * light_52.xyz) + ((light_52.xyz * _SpecColor.xyz) * spec_54)); - c_53.xyz = tmpvar_56.xyz.xyz; - float tmpvar_57; - tmpvar_57 = (s_51.Alpha + (spec_54 * _SpecColor.w)); - c_53.w = vec4(tmpvar_57).w; - return c_53; -} - -vec3 DecodeLightmap ( - in vec4 color_58 -) -{ - return (2.0 * color_58.xyz); -} - -vec4 frag_surf ( - in v2f_surf IN_59 -) -{ - vec4 col_60; - vec3 lm_61; - vec3 lmIndirect_62; - vec3 lmFull_63; - vec4 light_64; - SurfaceOutput o_65; - Input surfIN_66; - vec2 tmpvar_67; - tmpvar_67 = IN_59.hip_pack0.xy; - surfIN_66.uv_MainTex = tmpvar_67; - vec3 tmpvar_68; - tmpvar_68 = vec3(0.0, 0.0, 0.0); - o_65.Albedo = tmpvar_68; - vec3 tmpvar_69; - tmpvar_69 = vec3(0.0, 0.0, 0.0); - o_65.Emission = tmpvar_69; - float tmpvar_70; - tmpvar_70 = 0.0; - o_65.Specular = tmpvar_70; - float tmpvar_71; - tmpvar_71 = 0.0; - o_65.Alpha = tmpvar_71; - float tmpvar_72; - tmpvar_72 = 0.0; - o_65.Gloss = tmpvar_72; - surf (surfIN_66, o_65); - vec4 tmpvar_73; - tmpvar_73 = texture2DProj (_LightBuffer, IN_59.hip_screen); - vec4 tmpvar_74; - tmpvar_74 = tmpvar_73; - light_64 = tmpvar_74; - vec4 tmpvar_75; - tmpvar_75 = log2 (light_64); - vec4 tmpvar_76; - tmpvar_76 = -(tmpvar_75); - light_64 = tmpvar_76; - vec4 tmpvar_77; - tmpvar_77 = texture2D (unity_Lightmap, IN_59.hip_lmapFade.xy); - vec3 tmpvar_78; - tmpvar_78 = DecodeLightmap (tmpvar_77); - vec3 tmpvar_79; - tmpvar_79 = tmpvar_78; - lmFull_63 = tmpvar_79; - vec4 tmpvar_80; - tmpvar_80 = texture2D (unity_LightmapInd, IN_59.hip_lmapFade.xy); - vec3 tmpvar_81; - tmpvar_81 = DecodeLightmap (tmpvar_80); - vec3 tmpvar_82; - tmpvar_82 = tmpvar_81; - lmIndirect_62 = tmpvar_82; - float tmpvar_83; - tmpvar_83 = xll_saturate (IN_59.hip_lmapFade.z); - vec3 tmpvar_84; - tmpvar_84 = vec3(tmpvar_83); - vec3 tmpvar_85; - tmpvar_85 = mix (lmIndirect_62, lmFull_63, tmpvar_84); - vec3 tmpvar_86; - tmpvar_86 = tmpvar_85; - lm_61 = tmpvar_86; - vec3 tmpvar_87; - tmpvar_87 = (light_64.xyz + lm_61); - light_64.xyz = tmpvar_87.xyz.xyz; - vec4 tmpvar_88; - tmpvar_88 = LightingBlinnPhong_PrePass (o_65, light_64); - vec4 tmpvar_89; - tmpvar_89 = tmpvar_88; - col_60 = tmpvar_89; - return col_60; -} - -void main () -{ - v2f_surf xlt_IN_90; - vec4 xl_retval_91; - vec4 tmpvar_92; - tmpvar_92 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_90.pos = tmpvar_92; - float tmpvar_93; - tmpvar_93 = xlv_FOG.x; - xlt_IN_90.fog = tmpvar_93; - vec2 tmpvar_94; - tmpvar_94 = gl_TexCoord[0].xy; - vec2 tmpvar_95; - tmpvar_95 = tmpvar_94; - xlt_IN_90.hip_pack0 = tmpvar_95; - vec4 tmpvar_96; - tmpvar_96 = gl_TexCoord[1].xyzw; - vec4 tmpvar_97; - tmpvar_97 = tmpvar_96; - xlt_IN_90.hip_screen = tmpvar_97; - vec3 tmpvar_98; - tmpvar_98 = gl_TexCoord[2].xyz; - vec3 tmpvar_99; - tmpvar_99 = tmpvar_98; - xlt_IN_90.hip_lmapFade = tmpvar_99; - vec4 tmpvar_100; - tmpvar_100 = frag_surf (xlt_IN_90); - vec4 tmpvar_101; - tmpvar_101 = tmpvar_100; - xl_retval_91 = tmpvar_101; - vec4 tmpvar_102; - tmpvar_102 = xl_retval_91.xyzw; - vec4 tmpvar_103; - tmpvar_103 = tmpvar_102; - gl_FragData[0] = tmpvar_103; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-out.txt index b8fb26fbe..9884f4fbf 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-out.txt @@ -1,4 +1,3 @@ -uniform sampler2D _BumpMap; uniform vec4 _Color; uniform sampler2D _LightBuffer; uniform sampler2D _MainTex; @@ -10,25 +9,27 @@ void main () vec3 tmpvar_1; tmpvar_1 = gl_TexCoord[2].xyz; vec4 light_2; - vec2 tmpvar_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, gl_TexCoord[0].xy); - vec4 normal_5; - normal_5.xy = ((texture2D (_BumpMap, tmpvar_3).wy * 2.0) - 1.0); - normal_5.z = sqrt(((1.0 - - (normal_5.x * normal_5.x) - ) - (normal_5.y * normal_5.y))); - vec4 tmpvar_6; - tmpvar_6 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); - light_2.w = tmpvar_6.w; - light_2.xyz = (tmpvar_6.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_1.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_1.xy).xyz), vec3(clamp (tmpvar_1.z, 0.0, 1.0)))); - vec4 c_7; - float tmpvar_8; - tmpvar_8 = (tmpvar_6.w * tmpvar_4.w); - c_7.xyz = (((tmpvar_4.xyz * _Color.xyz) * light_2.xyz) + ((light_2.xyz * _SpecColor.xyz) * tmpvar_8)); - c_7.w = ((tmpvar_4.w * _Color.w) + (tmpvar_8 * _SpecColor.w)); - gl_FragData[0] = c_7; + vec4 tmpvar_3; + tmpvar_3 = texture2D (_MainTex, gl_TexCoord[0].xy); + light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); + light_2.xyz = (light_2.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_1.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_1.xy).xyz), vec3(clamp (tmpvar_1.z, 0.0, 1.0)))); + vec4 c_4; + float spec_5; + spec_5 = (light_2.w * tmpvar_3.w); + c_4.xyz = (((tmpvar_3.xyz * _Color.xyz) * light_2.xyz) + ((light_2.xyz * _SpecColor.xyz) * spec_5)); + c_4.w = ((tmpvar_3.w * _Color.w) + (spec_5 * _SpecColor.w)); + gl_FragData[0] = c_4; } -// inputs: 1, stats: 23 alu 5 tex 0 flow +// stats: 16 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _SpecColor (high float) 4x1 [-1] +// textures: 4 +// #0: _LightBuffer (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] +// #2: unity_Lightmap (high 2d) 0x0 [-1] +// #3: unity_LightmapInd (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-ir.txt deleted file mode 100644 index ddbefb603..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-ir.txt +++ /dev/null @@ -1,167 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_DecalTex; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 normal; - vec3 lightDir; -}; -uniform vec4 _Color; -uniform sampler2D _DecalTex; -uniform vec4 _LightColor0; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 decal_3; - vec4 c_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_6; - tmpvar_6 = tmpvar_5; - c_4 = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7 = texture2D (_DecalTex, IN_1.uv_DecalTex); - vec4 tmpvar_8; - tmpvar_8 = tmpvar_7; - decal_3 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = vec3(decal_3.w); - vec3 tmpvar_10; - tmpvar_10 = mix (c_4.xyz, decal_3.xyz, tmpvar_9); - vec3 tmpvar_11; - tmpvar_11 = tmpvar_10; - c_4.xyz = tmpvar_11.xyz.xyz; - vec4 tmpvar_12; - tmpvar_12 = (c_4 * _Color); - c_4 = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13 = c_4.xyz; - o_2.Albedo = tmpvar_13; - float tmpvar_14; - tmpvar_14 = c_4.w; - o_2.Alpha = tmpvar_14; -} - -vec4 LightingLambert ( - in SurfaceOutput s_15, - in vec3 lightDir_16, - in float atten_17 -) -{ - vec4 c_18; - float diff_19; - float tmpvar_20; - tmpvar_20 = dot (s_15.Normal, lightDir_16); - float tmpvar_21; - tmpvar_21 = max (0.0, tmpvar_20); - float tmpvar_22; - tmpvar_22 = tmpvar_21; - diff_19 = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = ((s_15.Albedo * _LightColor0.xyz) * ((diff_19 * atten_17) * 2.0)); - c_18.xyz = tmpvar_23.xyz.xyz; - float tmpvar_24; - tmpvar_24 = s_15.Alpha; - c_18.w = vec4(tmpvar_24).w; - return c_18; -} - -vec4 frag_surf ( - in v2f_surf IN_25 -) -{ - vec4 c_26; - vec3 lightDir_27; - SurfaceOutput o_28; - Input surfIN_29; - vec2 tmpvar_30; - tmpvar_30 = IN_25.hip_pack0.xy; - surfIN_29.uv_MainTex = tmpvar_30; - vec2 tmpvar_31; - tmpvar_31 = IN_25.hip_pack0.zw; - surfIN_29.uv_DecalTex = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = vec3(0.0, 0.0, 0.0); - o_28.Albedo = tmpvar_32; - vec3 tmpvar_33; - tmpvar_33 = vec3(0.0, 0.0, 0.0); - o_28.Emission = tmpvar_33; - float tmpvar_34; - tmpvar_34 = 0.0; - o_28.Specular = tmpvar_34; - float tmpvar_35; - tmpvar_35 = 0.0; - o_28.Alpha = tmpvar_35; - float tmpvar_36; - tmpvar_36 = 0.0; - o_28.Gloss = tmpvar_36; - vec3 tmpvar_37; - tmpvar_37 = IN_25.normal; - o_28.Normal = tmpvar_37; - surf (surfIN_29, o_28); - vec3 tmpvar_38; - tmpvar_38 = IN_25.lightDir; - lightDir_27 = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = LightingLambert (o_28, lightDir_27, 1.0); - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - c_26 = tmpvar_40; - float tmpvar_41; - tmpvar_41 = 0.0; - c_26.w = vec4(tmpvar_41).w; - return c_26; -} - -void main () -{ - v2f_surf xlt_IN_42; - vec4 xl_retval_43; - vec4 tmpvar_44; - tmpvar_44 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_42.pos = tmpvar_44; - float tmpvar_45; - tmpvar_45 = xlv_FOG.x; - xlt_IN_42.fog = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46 = gl_TexCoord[0].xyzw; - vec4 tmpvar_47; - tmpvar_47 = tmpvar_46; - xlt_IN_42.hip_pack0 = tmpvar_47; - vec3 tmpvar_48; - tmpvar_48 = gl_TexCoord[1].xyz; - vec3 tmpvar_49; - tmpvar_49 = tmpvar_48; - xlt_IN_42.normal = tmpvar_49; - vec3 tmpvar_50; - tmpvar_50 = gl_TexCoord[2].xyz; - vec3 tmpvar_51; - tmpvar_51 = tmpvar_50; - xlt_IN_42.lightDir = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = frag_surf (xlt_IN_42); - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - xl_retval_43 = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54 = xl_retval_43.xyzw; - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - gl_FragData[0] = tmpvar_55; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-out.txt index 12ee52057..d0e0f6fe4 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-out.txt @@ -14,18 +14,24 @@ void main () vec4 tmpvar_5; tmpvar_5 = texture2D (_DecalTex, tmpvar_1.zw); c_3.xyz = mix (tmpvar_4.xyz, tmpvar_5.xyz, tmpvar_5.www); - vec4 tmpvar_6; - tmpvar_6 = (c_3 * _Color); - c_3 = tmpvar_6; - vec4 c_7; - c_7.xyz = ((tmpvar_6.xyz * _LightColor0.xyz) * (max (0.0, + c_3 = (c_3 * _Color); + vec4 c_6; + c_6.xyz = ((c_3.xyz * _LightColor0.xyz) * (max (0.0, dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz) ) * 2.0)); - c_7.w = tmpvar_6.w; - c_2.xyz = c_7.xyz; + c_6.w = c_3.w; + c_2.xyz = c_6.xyz; c_2.w = 0.0; gl_FragData[0] = c_2; } -// inputs: 1, stats: 8 alu 2 tex 0 flow +// stats: 8 alu 2 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// textures: 2 +// #0: _DecalTex (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-ir.txt deleted file mode 100644 index accc55705..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-ir.txt +++ /dev/null @@ -1,176 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_DecalTex; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 normal; - vec3 lightDir; - vec2 _LightCoord; -}; -uniform vec4 _Color; -uniform sampler2D _DecalTex; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 decal_3; - vec4 c_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_6; - tmpvar_6 = tmpvar_5; - c_4 = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7 = texture2D (_DecalTex, IN_1.uv_DecalTex); - vec4 tmpvar_8; - tmpvar_8 = tmpvar_7; - decal_3 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = vec3(decal_3.w); - vec3 tmpvar_10; - tmpvar_10 = mix (c_4.xyz, decal_3.xyz, tmpvar_9); - vec3 tmpvar_11; - tmpvar_11 = tmpvar_10; - c_4.xyz = tmpvar_11.xyz.xyz; - vec4 tmpvar_12; - tmpvar_12 = (c_4 * _Color); - c_4 = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13 = c_4.xyz; - o_2.Albedo = tmpvar_13; - float tmpvar_14; - tmpvar_14 = c_4.w; - o_2.Alpha = tmpvar_14; -} - -vec4 LightingLambert ( - in SurfaceOutput s_15, - in vec3 lightDir_16, - in float atten_17 -) -{ - vec4 c_18; - float diff_19; - float tmpvar_20; - tmpvar_20 = dot (s_15.Normal, lightDir_16); - float tmpvar_21; - tmpvar_21 = max (0.0, tmpvar_20); - float tmpvar_22; - tmpvar_22 = tmpvar_21; - diff_19 = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = ((s_15.Albedo * _LightColor0.xyz) * ((diff_19 * atten_17) * 2.0)); - c_18.xyz = tmpvar_23.xyz.xyz; - float tmpvar_24; - tmpvar_24 = s_15.Alpha; - c_18.w = vec4(tmpvar_24).w; - return c_18; -} - -vec4 frag_surf ( - in v2f_surf IN_25 -) -{ - vec4 c_26; - vec3 lightDir_27; - SurfaceOutput o_28; - Input surfIN_29; - vec2 tmpvar_30; - tmpvar_30 = IN_25.hip_pack0.xy; - surfIN_29.uv_MainTex = tmpvar_30; - vec2 tmpvar_31; - tmpvar_31 = IN_25.hip_pack0.zw; - surfIN_29.uv_DecalTex = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = vec3(0.0, 0.0, 0.0); - o_28.Albedo = tmpvar_32; - vec3 tmpvar_33; - tmpvar_33 = vec3(0.0, 0.0, 0.0); - o_28.Emission = tmpvar_33; - float tmpvar_34; - tmpvar_34 = 0.0; - o_28.Specular = tmpvar_34; - float tmpvar_35; - tmpvar_35 = 0.0; - o_28.Alpha = tmpvar_35; - float tmpvar_36; - tmpvar_36 = 0.0; - o_28.Gloss = tmpvar_36; - vec3 tmpvar_37; - tmpvar_37 = IN_25.normal; - o_28.Normal = tmpvar_37; - surf (surfIN_29, o_28); - vec3 tmpvar_38; - tmpvar_38 = IN_25.lightDir; - lightDir_27 = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = texture2D (_LightTexture0, IN_25._LightCoord); - vec4 tmpvar_40; - tmpvar_40 = LightingLambert (o_28, lightDir_27, (tmpvar_39.w * 1.0)); - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - c_26 = tmpvar_41; - float tmpvar_42; - tmpvar_42 = 0.0; - c_26.w = vec4(tmpvar_42).w; - return c_26; -} - -void main () -{ - v2f_surf xlt_IN_43; - vec4 xl_retval_44; - vec4 tmpvar_45; - tmpvar_45 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_43.pos = tmpvar_45; - float tmpvar_46; - tmpvar_46 = xlv_FOG.x; - xlt_IN_43.fog = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = gl_TexCoord[0].xyzw; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_IN_43.hip_pack0 = tmpvar_48; - vec3 tmpvar_49; - tmpvar_49 = gl_TexCoord[1].xyz; - vec3 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_IN_43.normal = tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = gl_TexCoord[2].xyz; - vec3 tmpvar_52; - tmpvar_52 = tmpvar_51; - xlt_IN_43.lightDir = tmpvar_52; - vec2 tmpvar_53; - tmpvar_53 = gl_TexCoord[3].xy; - vec2 tmpvar_54; - tmpvar_54 = tmpvar_53; - xlt_IN_43._LightCoord = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = frag_surf (xlt_IN_43); - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - xl_retval_44 = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = xl_retval_44.xyzw; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - gl_FragData[0] = tmpvar_58; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-out.txt index ac45166fd..6a7396059 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-out.txt @@ -15,18 +15,25 @@ void main () vec4 tmpvar_5; tmpvar_5 = texture2D (_DecalTex, tmpvar_1.zw); c_3.xyz = mix (tmpvar_4.xyz, tmpvar_5.xyz, tmpvar_5.www); - vec4 tmpvar_6; - tmpvar_6 = (c_3 * _Color); - c_3 = tmpvar_6; - vec4 c_7; - c_7.xyz = ((tmpvar_6.xyz * _LightColor0.xyz) * (( + c_3 = (c_3 * _Color); + vec4 c_6; + c_6.xyz = ((c_3.xyz * _LightColor0.xyz) * (( max (0.0, dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz)) * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0)); - c_7.w = tmpvar_6.w; - c_2.xyz = c_7.xyz; + c_6.w = c_3.w; + c_2.xyz = c_6.xyz; c_2.w = 0.0; gl_FragData[0] = c_2; } -// inputs: 1, stats: 9 alu 3 tex 0 flow +// stats: 9 alu 3 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// textures: 3 +// #0: _DecalTex (high 2d) 0x0 [-1] +// #1: _LightTexture0 (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-ir.txt deleted file mode 100644 index b9771ed57..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-ir.txt +++ /dev/null @@ -1,157 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_DecalTex; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec4 hip_screen; -}; -uniform vec4 _Color; -uniform sampler2D _DecalTex; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform vec4 unity_Ambient; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 decal_3; - vec4 c_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_6; - tmpvar_6 = tmpvar_5; - c_4 = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7 = texture2D (_DecalTex, IN_1.uv_DecalTex); - vec4 tmpvar_8; - tmpvar_8 = tmpvar_7; - decal_3 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = vec3(decal_3.w); - vec3 tmpvar_10; - tmpvar_10 = mix (c_4.xyz, decal_3.xyz, tmpvar_9); - vec3 tmpvar_11; - tmpvar_11 = tmpvar_10; - c_4.xyz = tmpvar_11.xyz.xyz; - vec4 tmpvar_12; - tmpvar_12 = (c_4 * _Color); - c_4 = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13 = c_4.xyz; - o_2.Albedo = tmpvar_13; - float tmpvar_14; - tmpvar_14 = c_4.w; - o_2.Alpha = tmpvar_14; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_15, - in vec4 light_16 -) -{ - vec4 c_17; - vec3 tmpvar_18; - tmpvar_18 = (s_15.Albedo * light_16.xyz); - c_17.xyz = tmpvar_18.xyz.xyz; - float tmpvar_19; - tmpvar_19 = s_15.Alpha; - c_17.w = vec4(tmpvar_19).w; - return c_17; -} - -vec4 frag_surf ( - in v2f_surf IN_20 -) -{ - vec4 col_21; - vec4 light_22; - SurfaceOutput o_23; - Input surfIN_24; - vec2 tmpvar_25; - tmpvar_25 = IN_20.hip_pack0.xy; - surfIN_24.uv_MainTex = tmpvar_25; - vec2 tmpvar_26; - tmpvar_26 = IN_20.hip_pack0.zw; - surfIN_24.uv_DecalTex = tmpvar_26; - vec3 tmpvar_27; - tmpvar_27 = vec3(0.0, 0.0, 0.0); - o_23.Albedo = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = vec3(0.0, 0.0, 0.0); - o_23.Emission = tmpvar_28; - float tmpvar_29; - tmpvar_29 = 0.0; - o_23.Specular = tmpvar_29; - float tmpvar_30; - tmpvar_30 = 0.0; - o_23.Alpha = tmpvar_30; - float tmpvar_31; - tmpvar_31 = 0.0; - o_23.Gloss = tmpvar_31; - surf (surfIN_24, o_23); - vec4 tmpvar_32; - tmpvar_32 = texture2DProj (_LightBuffer, IN_20.hip_screen); - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - light_22 = tmpvar_33; - vec4 tmpvar_34; - tmpvar_34 = log2 (light_22); - vec4 tmpvar_35; - tmpvar_35 = -(tmpvar_34); - light_22 = tmpvar_35; - vec3 tmpvar_36; - tmpvar_36 = (light_22.xyz + unity_Ambient.xyz); - light_22.xyz = tmpvar_36.xyz.xyz; - vec4 tmpvar_37; - tmpvar_37 = LightingLambert_PrePass (o_23, light_22); - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - col_21 = tmpvar_38; - return col_21; -} - -void main () -{ - v2f_surf xlt_IN_39; - vec4 xl_retval_40; - vec4 tmpvar_41; - tmpvar_41 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_39.pos = tmpvar_41; - float tmpvar_42; - tmpvar_42 = xlv_FOG.x; - xlt_IN_39.fog = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43 = gl_TexCoord[0].xyzw; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_IN_39.hip_pack0 = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = gl_TexCoord[1].xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_IN_39.hip_screen = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = frag_surf (xlt_IN_39); - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - xl_retval_40 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = xl_retval_40.xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - gl_FragData[0] = tmpvar_50; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-out.txt index 99e176816..813b8f1e9 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-out.txt @@ -15,18 +15,23 @@ void main () vec4 tmpvar_5; tmpvar_5 = texture2D (_DecalTex, tmpvar_1.zw); c_3.xyz = mix (tmpvar_4.xyz, tmpvar_5.xyz, tmpvar_5.www); - vec4 tmpvar_6; - tmpvar_6 = (c_3 * _Color); - c_3 = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); - light_2.w = tmpvar_7.w; - light_2.xyz = (tmpvar_7.xyz + unity_Ambient.xyz); - vec4 c_8; - c_8.xyz = (tmpvar_6.xyz * light_2.xyz); - c_8.w = tmpvar_6.w; - gl_FragData[0] = c_8; + c_3 = (c_3 * _Color); + light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); + light_2.xyz = (light_2.xyz + unity_Ambient.xyz); + vec4 c_6; + c_6.xyz = (c_3.xyz * light_2.xyz); + c_6.w = c_3.w; + gl_FragData[0] = c_6; } -// inputs: 1, stats: 6 alu 3 tex 0 flow +// stats: 6 alu 3 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [2] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: unity_Ambient (high float) 4x1 [-1] +// textures: 3 +// #0: _DecalTex (high 2d) 0x0 [-1] +// #1: _LightBuffer (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-ir.txt deleted file mode 100644 index 236014434..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-ir.txt +++ /dev/null @@ -1,166 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec3 _LightCoord; -}; -uniform vec4 _Color; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_5; - tmpvar_5 = (tmpvar_4 * _Color); - c_3 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = c_3.xyz; - o_2.Albedo = tmpvar_6; - float tmpvar_7; - tmpvar_7 = c_3.w; - o_2.Alpha = tmpvar_7; -} - -vec4 LightingLambert ( - in SurfaceOutput s_8, - in vec3 lightDir_9, - in float atten_10 -) -{ - vec4 c_11; - float diff_12; - float tmpvar_13; - tmpvar_13 = dot (s_8.Normal, lightDir_9); - float tmpvar_14; - tmpvar_14 = max (0.0, tmpvar_13); - float tmpvar_15; - tmpvar_15 = tmpvar_14; - diff_12 = tmpvar_15; - vec3 tmpvar_16; - tmpvar_16 = ((s_8.Albedo * _LightColor0.xyz) * ((diff_12 * atten_10) * 2.0)); - c_11.xyz = tmpvar_16.xyz.xyz; - float tmpvar_17; - tmpvar_17 = s_8.Alpha; - c_11.w = vec4(tmpvar_17).w; - return c_11; -} - -vec4 frag_surf ( - in v2f_surf IN_18 -) -{ - vec4 c_19; - vec3 lightDir_20; - SurfaceOutput o_21; - Input surfIN_22; - vec2 tmpvar_23; - tmpvar_23 = IN_18.hip_pack0.xy; - surfIN_22.uv_MainTex = tmpvar_23; - vec3 tmpvar_24; - tmpvar_24 = vec3(0.0, 0.0, 0.0); - o_21.Albedo = tmpvar_24; - vec3 tmpvar_25; - tmpvar_25 = vec3(0.0, 0.0, 0.0); - o_21.Emission = tmpvar_25; - float tmpvar_26; - tmpvar_26 = 0.0; - o_21.Specular = tmpvar_26; - float tmpvar_27; - tmpvar_27 = 0.0; - o_21.Alpha = tmpvar_27; - float tmpvar_28; - tmpvar_28 = 0.0; - o_21.Gloss = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = IN_18.normal; - o_21.Normal = tmpvar_29; - surf (surfIN_22, o_21); - vec3 tmpvar_30; - tmpvar_30 = IN_18.lightDir; - lightDir_20 = tmpvar_30; - vec3 tmpvar_31; - tmpvar_31 = normalize (lightDir_20); - vec3 tmpvar_32; - tmpvar_32 = tmpvar_31; - lightDir_20 = tmpvar_32; - float tmpvar_33; - tmpvar_33 = dot (IN_18._LightCoord, IN_18._LightCoord); - vec2 tmpvar_34; - tmpvar_34 = vec2(tmpvar_33); - vec2 tmpvar_35; - tmpvar_35 = tmpvar_34.xy; - vec4 tmpvar_36; - tmpvar_36 = texture2D (_LightTexture0, tmpvar_35); - vec4 tmpvar_37; - tmpvar_37 = LightingLambert (o_21, lightDir_20, tmpvar_36.w); - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - c_19 = tmpvar_38; - float tmpvar_39; - tmpvar_39 = 0.0; - c_19.w = vec4(tmpvar_39).w; - return c_19; -} - -void main () -{ - v2f_surf xlt_IN_40; - vec4 xl_retval_41; - vec4 tmpvar_42; - tmpvar_42 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_40.pos = tmpvar_42; - float tmpvar_43; - tmpvar_43 = xlv_FOG.x; - xlt_IN_40.fog = tmpvar_43; - vec2 tmpvar_44; - tmpvar_44 = gl_TexCoord[0].xy; - vec2 tmpvar_45; - tmpvar_45 = tmpvar_44; - xlt_IN_40.hip_pack0 = tmpvar_45; - vec3 tmpvar_46; - tmpvar_46 = gl_TexCoord[1].xyz; - vec3 tmpvar_47; - tmpvar_47 = tmpvar_46; - xlt_IN_40.normal = tmpvar_47; - vec3 tmpvar_48; - tmpvar_48 = gl_TexCoord[2].xyz; - vec3 tmpvar_49; - tmpvar_49 = tmpvar_48; - xlt_IN_40.lightDir = tmpvar_49; - vec3 tmpvar_50; - tmpvar_50 = gl_TexCoord[3].xyz; - vec3 tmpvar_51; - tmpvar_51 = tmpvar_50; - xlt_IN_40._LightCoord = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = frag_surf (xlt_IN_40); - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - xl_retval_41 = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54 = xl_retval_41.xyzw; - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - gl_FragData[0] = tmpvar_55; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-out.txt index 6f4aa9c58..2fbdf5287 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-out.txt @@ -7,19 +7,27 @@ void main () vec3 tmpvar_1; tmpvar_1 = gl_TexCoord[3].xyz; vec4 c_2; - vec4 tmpvar_3; - tmpvar_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); + vec4 c_3; + c_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); vec4 c_4; - c_4.xyz = ((tmpvar_3.xyz * _LightColor0.xyz) * (( + c_4.xyz = ((c_3.xyz * _LightColor0.xyz) * (( max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) * texture2D (_LightTexture0, vec2( dot (tmpvar_1, tmpvar_1) )).w) * 2.0)); - c_4.w = tmpvar_3.w; + c_4.w = c_3.w; c_2.xyz = c_4.xyz; c_2.w = 0.0; gl_FragData[0] = c_2; } -// inputs: 1, stats: 10 alu 2 tex 0 flow +// stats: 10 alu 2 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// textures: 2 +// #0: _LightTexture0 (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-ir.txt deleted file mode 100644 index f6081b646..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-ir.txt +++ /dev/null @@ -1,95 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - vec3 normal; -}; -uniform vec4 _Color; -uniform sampler2D _MainTex; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_5; - tmpvar_5 = (tmpvar_4 * _Color); - c_3 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = c_3.xyz; - o_2.Albedo = tmpvar_6; - float tmpvar_7; - tmpvar_7 = c_3.w; - o_2.Alpha = tmpvar_7; -} - -vec4 frag_surf ( - in v2f_surf IN_8 -) -{ - vec4 res_9; - Input surfIN_10; - SurfaceOutput o_11; - vec3 tmpvar_12; - tmpvar_12 = vec3(0.0, 0.0, 0.0); - o_11.Albedo = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13 = vec3(0.0, 0.0, 0.0); - o_11.Emission = tmpvar_13; - float tmpvar_14; - tmpvar_14 = 0.0; - o_11.Specular = tmpvar_14; - float tmpvar_15; - tmpvar_15 = 0.0; - o_11.Alpha = tmpvar_15; - float tmpvar_16; - tmpvar_16 = 0.0; - o_11.Gloss = tmpvar_16; - vec3 tmpvar_17; - tmpvar_17 = IN_8.normal; - o_11.Normal = tmpvar_17; - surf (surfIN_10, o_11); - vec3 tmpvar_18; - tmpvar_18 = ((o_11.Normal * vec3(0.5, 0.5, -0.5)) + 0.5); - res_9.xyz = tmpvar_18.xyz.xyz; - float tmpvar_19; - tmpvar_19 = o_11.Specular; - res_9.w = vec4(tmpvar_19).w; - return res_9; -} - -void main () -{ - v2f_surf xlt_IN_20; - vec4 xl_retval_21; - vec4 tmpvar_22; - tmpvar_22 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_20.pos = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = gl_TexCoord[0].xyz; - vec3 tmpvar_24; - tmpvar_24 = tmpvar_23; - xlt_IN_20.normal = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25 = frag_surf (xlt_IN_20); - vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; - xl_retval_21 = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = xl_retval_21.xyzw; - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - gl_FragData[0] = tmpvar_28; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-out.txt index a366de427..811a56224 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-out.txt @@ -7,4 +7,6 @@ void main () } -// inputs: 1, stats: 3 alu 0 tex 0 flow +// stats: 3 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-ir.txt deleted file mode 100644 index e8dda9816..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-ir.txt +++ /dev/null @@ -1,281 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 hip_screen; - vec3 hip_lmapFade; -}; -uniform vec4 _Color; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform sampler2D unity_Lightmap; -uniform sampler2D unity_LightmapInd; -varying vec4 xlv_FOG; -float xll_saturate ( - in float x_1 -) -{ - float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -vec2 xll_saturate ( - in vec2 x_3 -) -{ - vec2 tmpvar_4; - tmpvar_4 = clamp (x_3, 0.0, 1.0); - return tmpvar_4; -} - -vec3 xll_saturate ( - in vec3 x_5 -) -{ - vec3 tmpvar_6; - tmpvar_6 = clamp (x_5, 0.0, 1.0); - return tmpvar_6; -} - -vec4 xll_saturate ( - in vec4 x_7 -) -{ - vec4 tmpvar_8; - tmpvar_8 = clamp (x_7, 0.0, 1.0); - return tmpvar_8; -} - -mat2 xll_saturate ( - in mat2 m_9 -) -{ - vec2 tmpvar_10; - tmpvar_10 = clamp (m_9[0], 0.0, 1.0); - vec2 tmpvar_11; - tmpvar_11 = clamp (m_9[1], 0.0, 1.0); - mat2 tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_10; - tmpvar_12[0] = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_12[1] = tmpvar_14; - return tmpvar_12; -} - -mat3 xll_saturate ( - in mat3 m_15 -) -{ - vec3 tmpvar_16; - tmpvar_16 = clamp (m_15[0], 0.0, 1.0); - vec3 tmpvar_17; - tmpvar_17 = clamp (m_15[1], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_15[2], 0.0, 1.0); - mat3 tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_16; - tmpvar_19[0] = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_19[1] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_19[2] = tmpvar_22; - return tmpvar_19; -} - -mat4 xll_saturate ( - in mat4 m_23 -) -{ - vec4 tmpvar_24; - tmpvar_24 = clamp (m_23[0], 0.0, 1.0); - vec4 tmpvar_25; - tmpvar_25 = clamp (m_23[1], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_23[2], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_23[3], 0.0, 1.0); - mat4 tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_24; - tmpvar_28[0] = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_28[1] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_28[2] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_28[3] = tmpvar_32; - return tmpvar_28; -} - -void surf ( - in Input IN_33, - inout SurfaceOutput o_34 -) -{ - vec4 c_35; - vec4 tmpvar_36; - tmpvar_36 = texture2D (_MainTex, IN_33.uv_MainTex); - vec4 tmpvar_37; - tmpvar_37 = (tmpvar_36 * _Color); - c_35 = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = c_35.xyz; - o_34.Albedo = tmpvar_38; - float tmpvar_39; - tmpvar_39 = c_35.w; - o_34.Alpha = tmpvar_39; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_40, - in vec4 light_41 -) -{ - vec4 c_42; - vec3 tmpvar_43; - tmpvar_43 = (s_40.Albedo * light_41.xyz); - c_42.xyz = tmpvar_43.xyz.xyz; - float tmpvar_44; - tmpvar_44 = s_40.Alpha; - c_42.w = vec4(tmpvar_44).w; - return c_42; -} - -vec3 DecodeLightmap ( - in vec4 color_45 -) -{ - return (2.0 * color_45.xyz); -} - -vec4 frag_surf ( - in v2f_surf IN_46 -) -{ - vec4 col_47; - vec3 lm_48; - vec3 lmIndirect_49; - vec3 lmFull_50; - vec4 light_51; - SurfaceOutput o_52; - Input surfIN_53; - vec2 tmpvar_54; - tmpvar_54 = IN_46.hip_pack0.xy; - surfIN_53.uv_MainTex = tmpvar_54; - vec3 tmpvar_55; - tmpvar_55 = vec3(0.0, 0.0, 0.0); - o_52.Albedo = tmpvar_55; - vec3 tmpvar_56; - tmpvar_56 = vec3(0.0, 0.0, 0.0); - o_52.Emission = tmpvar_56; - float tmpvar_57; - tmpvar_57 = 0.0; - o_52.Specular = tmpvar_57; - float tmpvar_58; - tmpvar_58 = 0.0; - o_52.Alpha = tmpvar_58; - float tmpvar_59; - tmpvar_59 = 0.0; - o_52.Gloss = tmpvar_59; - surf (surfIN_53, o_52); - vec4 tmpvar_60; - tmpvar_60 = texture2DProj (_LightBuffer, IN_46.hip_screen); - vec4 tmpvar_61; - tmpvar_61 = tmpvar_60; - light_51 = tmpvar_61; - vec4 tmpvar_62; - tmpvar_62 = log2 (light_51); - vec4 tmpvar_63; - tmpvar_63 = -(tmpvar_62); - light_51 = tmpvar_63; - vec4 tmpvar_64; - tmpvar_64 = texture2D (unity_Lightmap, IN_46.hip_lmapFade.xy); - vec3 tmpvar_65; - tmpvar_65 = DecodeLightmap (tmpvar_64); - vec3 tmpvar_66; - tmpvar_66 = tmpvar_65; - lmFull_50 = tmpvar_66; - vec4 tmpvar_67; - tmpvar_67 = texture2D (unity_LightmapInd, IN_46.hip_lmapFade.xy); - vec3 tmpvar_68; - tmpvar_68 = DecodeLightmap (tmpvar_67); - vec3 tmpvar_69; - tmpvar_69 = tmpvar_68; - lmIndirect_49 = tmpvar_69; - float tmpvar_70; - tmpvar_70 = xll_saturate (IN_46.hip_lmapFade.z); - vec3 tmpvar_71; - tmpvar_71 = vec3(tmpvar_70); - vec3 tmpvar_72; - tmpvar_72 = mix (lmIndirect_49, lmFull_50, tmpvar_71); - vec3 tmpvar_73; - tmpvar_73 = tmpvar_72; - lm_48 = tmpvar_73; - vec3 tmpvar_74; - tmpvar_74 = (light_51.xyz + lm_48); - light_51.xyz = tmpvar_74.xyz.xyz; - vec4 tmpvar_75; - tmpvar_75 = LightingLambert_PrePass (o_52, light_51); - vec4 tmpvar_76; - tmpvar_76 = tmpvar_75; - col_47 = tmpvar_76; - return col_47; -} - -void main () -{ - v2f_surf xlt_IN_77; - vec4 xl_retval_78; - vec4 tmpvar_79; - tmpvar_79 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_77.pos = tmpvar_79; - float tmpvar_80; - tmpvar_80 = xlv_FOG.x; - xlt_IN_77.fog = tmpvar_80; - vec2 tmpvar_81; - tmpvar_81 = gl_TexCoord[0].xy; - vec2 tmpvar_82; - tmpvar_82 = tmpvar_81; - xlt_IN_77.hip_pack0 = tmpvar_82; - vec4 tmpvar_83; - tmpvar_83 = gl_TexCoord[1].xyzw; - vec4 tmpvar_84; - tmpvar_84 = tmpvar_83; - xlt_IN_77.hip_screen = tmpvar_84; - vec3 tmpvar_85; - tmpvar_85 = gl_TexCoord[2].xyz; - vec3 tmpvar_86; - tmpvar_86 = tmpvar_85; - xlt_IN_77.hip_lmapFade = tmpvar_86; - vec4 tmpvar_87; - tmpvar_87 = frag_surf (xlt_IN_77); - vec4 tmpvar_88; - tmpvar_88 = tmpvar_87; - xl_retval_78 = tmpvar_88; - vec4 tmpvar_89; - tmpvar_89 = xl_retval_78.xyzw; - vec4 tmpvar_90; - tmpvar_90 = tmpvar_89; - gl_FragData[0] = tmpvar_90; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-out.txt index e4c7bac32..058c32f25 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-out.txt @@ -8,17 +8,24 @@ void main () vec3 tmpvar_1; tmpvar_1 = gl_TexCoord[2].xyz; vec4 light_2; - vec4 tmpvar_3; - tmpvar_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); - vec4 tmpvar_4; - tmpvar_4 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); - light_2.w = tmpvar_4.w; - light_2.xyz = (tmpvar_4.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_1.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_1.xy).xyz), vec3(clamp (tmpvar_1.z, 0.0, 1.0)))); - vec4 c_5; - c_5.xyz = (tmpvar_3.xyz * light_2.xyz); - c_5.w = tmpvar_3.w; - gl_FragData[0] = c_5; + vec4 c_3; + c_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); + light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); + light_2.xyz = (light_2.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_1.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_1.xy).xyz), vec3(clamp (tmpvar_1.z, 0.0, 1.0)))); + vec4 c_4; + c_4.xyz = (c_3.xyz * light_2.xyz); + c_4.w = c_3.w; + gl_FragData[0] = c_4; } -// inputs: 1, stats: 9 alu 4 tex 0 flow +// stats: 9 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 1 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// textures: 4 +// #0: _LightBuffer (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] +// #2: unity_Lightmap (high 2d) 0x0 [-1] +// #3: unity_LightmapInd (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-ir.txt deleted file mode 100644 index d9aef597a..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-ir.txt +++ /dev/null @@ -1,150 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 vlight; -}; -uniform vec4 _Color; -uniform vec4 _LightColor0; -uniform sampler2D _MainTex; -uniform vec4 _WorldSpaceLightPos0; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_5; - tmpvar_5 = (tmpvar_4 * _Color); - c_3 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = c_3.xyz; - o_2.Albedo = tmpvar_6; - float tmpvar_7; - tmpvar_7 = c_3.w; - o_2.Alpha = tmpvar_7; -} - -vec4 LightingLambert ( - in SurfaceOutput s_8, - in vec3 lightDir_9, - in float atten_10 -) -{ - vec4 c_11; - float diff_12; - float tmpvar_13; - tmpvar_13 = dot (s_8.Normal, lightDir_9); - float tmpvar_14; - tmpvar_14 = max (0.0, tmpvar_13); - float tmpvar_15; - tmpvar_15 = tmpvar_14; - diff_12 = tmpvar_15; - vec3 tmpvar_16; - tmpvar_16 = ((s_8.Albedo * _LightColor0.xyz) * ((diff_12 * atten_10) * 2.0)); - c_11.xyz = tmpvar_16.xyz.xyz; - float tmpvar_17; - tmpvar_17 = s_8.Alpha; - c_11.w = vec4(tmpvar_17).w; - return c_11; -} - -vec4 frag_surf ( - in v2f_surf IN_18 -) -{ - vec4 c_19; - float atten_20; - SurfaceOutput o_21; - Input surfIN_22; - float tmpvar_23; - tmpvar_23 = 1.0; - atten_20 = tmpvar_23; - vec2 tmpvar_24; - tmpvar_24 = IN_18.hip_pack0.xy; - surfIN_22.uv_MainTex = tmpvar_24; - vec3 tmpvar_25; - tmpvar_25 = vec3(0.0, 0.0, 0.0); - o_21.Albedo = tmpvar_25; - vec3 tmpvar_26; - tmpvar_26 = vec3(0.0, 0.0, 0.0); - o_21.Emission = tmpvar_26; - float tmpvar_27; - tmpvar_27 = 0.0; - o_21.Specular = tmpvar_27; - float tmpvar_28; - tmpvar_28 = 0.0; - o_21.Alpha = tmpvar_28; - float tmpvar_29; - tmpvar_29 = 0.0; - o_21.Gloss = tmpvar_29; - vec3 tmpvar_30; - tmpvar_30 = IN_18.normal; - o_21.Normal = tmpvar_30; - surf (surfIN_22, o_21); - vec4 tmpvar_31; - tmpvar_31 = LightingLambert (o_21, _WorldSpaceLightPos0.xyz, atten_20); - vec4 tmpvar_32; - tmpvar_32 = tmpvar_31; - c_19 = tmpvar_32; - vec3 tmpvar_33; - tmpvar_33 = (c_19.xyz + (o_21.Albedo * IN_18.vlight)); - c_19.xyz = tmpvar_33.xyz.xyz; - float tmpvar_34; - tmpvar_34 = o_21.Alpha; - c_19.w = vec4(tmpvar_34).w; - return c_19; -} - -void main () -{ - v2f_surf xlt_IN_35; - vec4 xl_retval_36; - vec4 tmpvar_37; - tmpvar_37 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_35.pos = tmpvar_37; - float tmpvar_38; - tmpvar_38 = xlv_FOG.x; - xlt_IN_35.fog = tmpvar_38; - vec2 tmpvar_39; - tmpvar_39 = gl_TexCoord[0].xy; - vec2 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_IN_35.hip_pack0 = tmpvar_40; - vec3 tmpvar_41; - tmpvar_41 = gl_TexCoord[1].xyz; - vec3 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_IN_35.normal = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = gl_TexCoord[2].xyz; - vec3 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_IN_35.vlight = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = frag_surf (xlt_IN_35); - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - xl_retval_36 = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = xl_retval_36.xyzw; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - gl_FragData[0] = tmpvar_48; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt index dda9cc1dc..805339e9c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt @@ -5,19 +5,27 @@ uniform vec4 _WorldSpaceLightPos0; void main () { vec4 c_1; - vec4 tmpvar_2; - tmpvar_2 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); - float tmpvar_3; - tmpvar_3 = tmpvar_2.w; + float tmpvar_2; + vec4 c_3; + c_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); + tmpvar_2 = c_3.w; vec4 c_4; - c_4.xyz = ((tmpvar_2.xyz * _LightColor0.xyz) * (max (0.0, + c_4.xyz = ((c_3.xyz * _LightColor0.xyz) * (max (0.0, dot (gl_TexCoord[1].xyz, _WorldSpaceLightPos0.xyz) ) * 2.0)); - c_4.w = tmpvar_3; - c_1.xyz = (c_4.xyz + (tmpvar_2.xyz * gl_TexCoord[2].xyz)); - c_1.w = tmpvar_3; + c_4.w = tmpvar_2; + c_1.xyz = (c_4.xyz + (c_3.xyz * gl_TexCoord[2].xyz)); + c_1.w = tmpvar_2; gl_FragData[0] = c_1; } -// inputs: 1, stats: 8 alu 1 tex 0 flow +// stats: 8 alu 1 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 3 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-ir.txt deleted file mode 100644 index f054a4322..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-ir.txt +++ /dev/null @@ -1,199 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_Detail; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 normal; - vec3 lightDir; - vec4 _LightCoord; -}; -uniform vec4 _Color; -uniform sampler2D _Detail; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_5; - tmpvar_5 = (tmpvar_4 * _Color); - c_3 = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6 = texture2D (_Detail, IN_1.uv_Detail); - vec3 tmpvar_7; - tmpvar_7 = (c_3.xyz * (tmpvar_6.xyz * 2.0)); - c_3.xyz = tmpvar_7.xyz.xyz; - vec3 tmpvar_8; - tmpvar_8 = c_3.xyz; - o_2.Albedo = tmpvar_8; - float tmpvar_9; - tmpvar_9 = c_3.w; - o_2.Alpha = tmpvar_9; -} - -float UnitySpotCookie ( - in vec4 LightCoord_10 -) -{ - vec4 tmpvar_11; - tmpvar_11 = texture2D (_LightTexture0, ((LightCoord_10.xy / LightCoord_10.w) + 0.5)); - return tmpvar_11.w; -} - -float UnitySpotAttenuate ( - in vec3 LightCoord_12 -) -{ - float tmpvar_13; - tmpvar_13 = dot (LightCoord_12, LightCoord_12); - vec2 tmpvar_14; - tmpvar_14 = vec2(tmpvar_13); - vec2 tmpvar_15; - tmpvar_15 = tmpvar_14.xy; - vec4 tmpvar_16; - tmpvar_16 = texture2D (_LightTextureB0, tmpvar_15); - return tmpvar_16.w; -} - -vec4 LightingLambert ( - in SurfaceOutput s_17, - in vec3 lightDir_18, - in float atten_19 -) -{ - vec4 c_20; - float diff_21; - float tmpvar_22; - tmpvar_22 = dot (s_17.Normal, lightDir_18); - float tmpvar_23; - tmpvar_23 = max (0.0, tmpvar_22); - float tmpvar_24; - tmpvar_24 = tmpvar_23; - diff_21 = tmpvar_24; - vec3 tmpvar_25; - tmpvar_25 = ((s_17.Albedo * _LightColor0.xyz) * ((diff_21 * atten_19) * 2.0)); - c_20.xyz = tmpvar_25.xyz.xyz; - float tmpvar_26; - tmpvar_26 = s_17.Alpha; - c_20.w = vec4(tmpvar_26).w; - return c_20; -} - -vec4 frag_surf ( - in v2f_surf IN_27 -) -{ - vec4 c_28; - vec3 lightDir_29; - SurfaceOutput o_30; - Input surfIN_31; - vec2 tmpvar_32; - tmpvar_32 = IN_27.hip_pack0.xy; - surfIN_31.uv_MainTex = tmpvar_32; - vec2 tmpvar_33; - tmpvar_33 = IN_27.hip_pack0.zw; - surfIN_31.uv_Detail = tmpvar_33; - vec3 tmpvar_34; - tmpvar_34 = vec3(0.0, 0.0, 0.0); - o_30.Albedo = tmpvar_34; - vec3 tmpvar_35; - tmpvar_35 = vec3(0.0, 0.0, 0.0); - o_30.Emission = tmpvar_35; - float tmpvar_36; - tmpvar_36 = 0.0; - o_30.Specular = tmpvar_36; - float tmpvar_37; - tmpvar_37 = 0.0; - o_30.Alpha = tmpvar_37; - float tmpvar_38; - tmpvar_38 = 0.0; - o_30.Gloss = tmpvar_38; - vec3 tmpvar_39; - tmpvar_39 = IN_27.normal; - o_30.Normal = tmpvar_39; - surf (surfIN_31, o_30); - vec3 tmpvar_40; - tmpvar_40 = IN_27.lightDir; - lightDir_29 = tmpvar_40; - vec3 tmpvar_41; - tmpvar_41 = normalize (lightDir_29); - vec3 tmpvar_42; - tmpvar_42 = tmpvar_41; - lightDir_29 = tmpvar_42; - float tmpvar_43; - tmpvar_43 = UnitySpotCookie (IN_27._LightCoord); - float tmpvar_44; - tmpvar_44 = UnitySpotAttenuate (IN_27._LightCoord.xyz); - vec4 tmpvar_45; - tmpvar_45 = LightingLambert (o_30, lightDir_29, ((float( - (IN_27._LightCoord.z > 0.0) - ) * tmpvar_43) * tmpvar_44)); - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - c_28 = tmpvar_46; - float tmpvar_47; - tmpvar_47 = 0.0; - c_28.w = vec4(tmpvar_47).w; - return c_28; -} - -void main () -{ - v2f_surf xlt_IN_48; - vec4 xl_retval_49; - vec4 tmpvar_50; - tmpvar_50 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_48.pos = tmpvar_50; - float tmpvar_51; - tmpvar_51 = xlv_FOG.x; - xlt_IN_48.fog = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = gl_TexCoord[0].xyzw; - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - xlt_IN_48.hip_pack0 = tmpvar_53; - vec3 tmpvar_54; - tmpvar_54 = gl_TexCoord[1].xyz; - vec3 tmpvar_55; - tmpvar_55 = tmpvar_54; - xlt_IN_48.normal = tmpvar_55; - vec3 tmpvar_56; - tmpvar_56 = gl_TexCoord[2].xyz; - vec3 tmpvar_57; - tmpvar_57 = tmpvar_56; - xlt_IN_48.lightDir = tmpvar_57; - vec4 tmpvar_58; - tmpvar_58 = gl_TexCoord[3].xyzw; - vec4 tmpvar_59; - tmpvar_59 = tmpvar_58; - xlt_IN_48._LightCoord = tmpvar_59; - vec4 tmpvar_60; - tmpvar_60 = frag_surf (xlt_IN_48); - vec4 tmpvar_61; - tmpvar_61 = tmpvar_60; - xl_retval_49 = tmpvar_61; - vec4 tmpvar_62; - tmpvar_62 = xl_retval_49.xyzw; - vec4 tmpvar_63; - tmpvar_63 = tmpvar_62; - gl_FragData[0] = tmpvar_63; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-out.txt index a22a84b58..8eb0b0ad9 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-out.txt @@ -12,21 +12,29 @@ void main () tmpvar_2 = gl_TexCoord[3]; vec4 c_3; vec4 c_4; - vec4 tmpvar_5; - tmpvar_5 = (texture2D (_MainTex, tmpvar_1.xy) * _Color); - c_4.w = tmpvar_5.w; - c_4.xyz = (tmpvar_5.xyz * (texture2D (_Detail, tmpvar_1.zw).xyz * 2.0)); - vec4 c_6; - c_6.xyz = ((c_4.xyz * _LightColor0.xyz) * (( + c_4 = (texture2D (_MainTex, tmpvar_1.xy) * _Color); + c_4.xyz = (c_4.xyz * (texture2D (_Detail, tmpvar_1.zw).xyz * 2.0)); + vec4 c_5; + c_5.xyz = ((c_4.xyz * _LightColor0.xyz) * (( max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) * ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w) ) * 2.0)); - c_6.w = c_4.w; - c_3.xyz = c_6.xyz; + c_5.w = c_4.w; + c_3.xyz = c_5.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } -// inputs: 1, stats: 18 alu 4 tex 0 flow +// stats: 18 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// textures: 4 +// #0: _Detail (high 2d) 0x0 [-1] +// #1: _LightTexture0 (high 2d) 0x0 [-1] +// #2: _LightTextureB0 (high 2d) 0x0 [-1] +// #3: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-ir.txt deleted file mode 100644 index 2fc6a0d59..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-ir.txt +++ /dev/null @@ -1,102 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_Detail; -}; -struct v2f_surf { - vec4 pos; - vec3 normal; -}; -uniform vec4 _Color; -uniform sampler2D _Detail; -uniform sampler2D _MainTex; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_5; - tmpvar_5 = (tmpvar_4 * _Color); - c_3 = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6 = texture2D (_Detail, IN_1.uv_Detail); - vec3 tmpvar_7; - tmpvar_7 = (c_3.xyz * (tmpvar_6.xyz * 2.0)); - c_3.xyz = tmpvar_7.xyz.xyz; - vec3 tmpvar_8; - tmpvar_8 = c_3.xyz; - o_2.Albedo = tmpvar_8; - float tmpvar_9; - tmpvar_9 = c_3.w; - o_2.Alpha = tmpvar_9; -} - -vec4 frag_surf ( - in v2f_surf IN_10 -) -{ - vec4 res_11; - Input surfIN_12; - SurfaceOutput o_13; - vec3 tmpvar_14; - tmpvar_14 = vec3(0.0, 0.0, 0.0); - o_13.Albedo = tmpvar_14; - vec3 tmpvar_15; - tmpvar_15 = vec3(0.0, 0.0, 0.0); - o_13.Emission = tmpvar_15; - float tmpvar_16; - tmpvar_16 = 0.0; - o_13.Specular = tmpvar_16; - float tmpvar_17; - tmpvar_17 = 0.0; - o_13.Alpha = tmpvar_17; - float tmpvar_18; - tmpvar_18 = 0.0; - o_13.Gloss = tmpvar_18; - vec3 tmpvar_19; - tmpvar_19 = IN_10.normal; - o_13.Normal = tmpvar_19; - surf (surfIN_12, o_13); - vec3 tmpvar_20; - tmpvar_20 = ((o_13.Normal * vec3(0.5, 0.5, -0.5)) + 0.5); - res_11.xyz = tmpvar_20.xyz.xyz; - float tmpvar_21; - tmpvar_21 = o_13.Specular; - res_11.w = vec4(tmpvar_21).w; - return res_11; -} - -void main () -{ - v2f_surf xlt_IN_22; - vec4 xl_retval_23; - vec4 tmpvar_24; - tmpvar_24 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_22.pos = tmpvar_24; - vec3 tmpvar_25; - tmpvar_25 = gl_TexCoord[0].xyz; - vec3 tmpvar_26; - tmpvar_26 = tmpvar_25; - xlt_IN_22.normal = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = frag_surf (xlt_IN_22); - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - xl_retval_23 = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = xl_retval_23.xyzw; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - gl_FragData[0] = tmpvar_30; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-out.txt index a366de427..811a56224 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-out.txt @@ -7,4 +7,6 @@ void main () } -// inputs: 1, stats: 3 alu 0 tex 0 flow +// stats: 3 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-ir.txt deleted file mode 100644 index ce9ab432e..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-ir.txt +++ /dev/null @@ -1,95 +0,0 @@ -struct v2f { - vec4 vertex; - vec4 uvgrab; - vec2 uvbump; - vec2 uvmain; -}; -uniform float _BumpAmt; -uniform sampler2D _BumpMap; -uniform sampler2D _GrabTexture; -uniform vec4 _GrabTexture_TexelSize; -uniform sampler2D _MainTex; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -vec4 frag ( - in v2f i_6 -) -{ - vec4 tint_7; - vec4 col_8; - vec2 offset_9; - vec2 bump_10; - vec4 tmpvar_11; - tmpvar_11 = texture2D (_BumpMap, i_6.uvbump); - vec4 tmpvar_12; - tmpvar_12 = UnpackNormal (tmpvar_11); - vec2 tmpvar_13; - tmpvar_13 = tmpvar_12.xy; - bump_10 = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = ((bump_10 * _BumpAmt) * _GrabTexture_TexelSize.xy); - offset_9 = tmpvar_14; - vec2 tmpvar_15; - tmpvar_15 = ((offset_9 * i_6.uvgrab.z) + i_6.uvgrab.xy); - i_6.uvgrab.xy = tmpvar_15.xy.xy; - vec4 tmpvar_16; - tmpvar_16 = texture2DProj (_GrabTexture, i_6.uvgrab); - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - col_8 = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = texture2D (_MainTex, i_6.uvmain); - vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - tint_7 = tmpvar_19; - return (col_8 * tint_7); -} - -void main () -{ - v2f xlt_i_20; - vec4 xl_retval_21; - vec4 tmpvar_22; - tmpvar_22 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_20.vertex = tmpvar_22; - vec4 tmpvar_23; - tmpvar_23 = gl_TexCoord[0].xyzw; - vec4 tmpvar_24; - tmpvar_24 = tmpvar_23; - xlt_i_20.uvgrab = tmpvar_24; - vec2 tmpvar_25; - tmpvar_25 = gl_TexCoord[1].xy; - vec2 tmpvar_26; - tmpvar_26 = tmpvar_25; - xlt_i_20.uvbump = tmpvar_26; - vec2 tmpvar_27; - tmpvar_27 = gl_TexCoord[2].xy; - vec2 tmpvar_28; - tmpvar_28 = tmpvar_27; - xlt_i_20.uvmain = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = frag (xlt_i_20); - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - xl_retval_21 = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = xl_retval_21.xyzw; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_31; - gl_FragData[0] = tmpvar_32; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-out.txt index 1240ceb86..2e9a89bdb 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-out.txt @@ -14,11 +14,18 @@ void main () normal_3.z = sqrt(((1.0 - (normal_3.x * normal_3.x) ) - (normal_3.y * normal_3.y))); - tmpvar_2.xy = ((( - (normal_3.xy * _BumpAmt) - * _GrabTexture_TexelSize.xy) * tmpvar_1.z) + tmpvar_1.xy); + tmpvar_2.xy = (((normal_3.xy * _BumpAmt) * (_GrabTexture_TexelSize.xy * tmpvar_1.z)) + tmpvar_1.xy); gl_FragData[0] = (texture2DProj (_GrabTexture, tmpvar_2) * texture2D (_MainTex, gl_TexCoord[2].xy)); } -// inputs: 1, stats: 12 alu 3 tex 0 flow +// stats: 12 alu 3 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 2 (total size: 0) +// #0: _BumpAmt (high float) 1x1 [-1] +// #1: _GrabTexture_TexelSize (high float) 4x1 [-1] +// textures: 3 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _GrabTexture (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-ir.txt deleted file mode 100644 index 63c0b2f89..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-ir.txt +++ /dev/null @@ -1,116 +0,0 @@ -struct v2f { - vec4 pos; - float fog; - vec2 bumpuv[2]; - vec3 viewDir; -}; -uniform sampler2D _BumpMap; -uniform sampler2D _ColorControl; -uniform vec4 _horizonColor; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -vec4 frag ( - in v2f i_6 -) -{ - vec4 col_7; - vec4 water_8; - float fresnel_9; - vec3 bump_10; - vec3 bump2_11; - vec3 bump1_12; - vec4 tmpvar_13; - tmpvar_13 = texture2D (_BumpMap, i_6.bumpuv[0]); - vec4 tmpvar_14; - tmpvar_14 = UnpackNormal (tmpvar_13); - vec3 tmpvar_15; - tmpvar_15 = tmpvar_14.xyz; - bump1_12 = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = texture2D (_BumpMap, i_6.bumpuv[1]); - vec4 tmpvar_17; - tmpvar_17 = UnpackNormal (tmpvar_16); - vec3 tmpvar_18; - tmpvar_18 = tmpvar_17.xyz; - bump2_11 = tmpvar_18; - vec3 tmpvar_19; - tmpvar_19 = ((bump1_12 + bump2_11) * 0.5); - bump_10 = tmpvar_19; - float tmpvar_20; - tmpvar_20 = dot (i_6.viewDir, bump_10); - float tmpvar_21; - tmpvar_21 = tmpvar_20; - fresnel_9 = tmpvar_21; - vec2 tmpvar_22; - tmpvar_22.x = fresnel_9; - tmpvar_22.y = fresnel_9; - vec4 tmpvar_23; - tmpvar_23 = texture2D (_ColorControl, tmpvar_22); - vec4 tmpvar_24; - tmpvar_24 = tmpvar_23; - water_8 = tmpvar_24; - vec3 tmpvar_25; - tmpvar_25 = vec3(water_8.w); - vec3 tmpvar_26; - tmpvar_26 = mix (water_8.xyz, _horizonColor.xyz, tmpvar_25); - vec3 tmpvar_27; - tmpvar_27 = tmpvar_26; - col_7.xyz = tmpvar_27.xyz.xyz; - float tmpvar_28; - tmpvar_28 = _horizonColor.w; - col_7.w = vec4(tmpvar_28).w; - return col_7; -} - -void main () -{ - v2f xlt_i_29; - vec4 xl_retval_30; - vec4 tmpvar_31; - tmpvar_31 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_29.pos = tmpvar_31; - float tmpvar_32; - tmpvar_32 = xlv_FOG.x; - xlt_i_29.fog = tmpvar_32; - vec2 tmpvar_33; - tmpvar_33 = gl_TexCoord[0].xy; - vec2 tmpvar_34; - tmpvar_34 = tmpvar_33; - xlt_i_29.bumpuv[0] = tmpvar_34; - vec2 tmpvar_35; - tmpvar_35 = gl_TexCoord[1].xy; - vec2 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlt_i_29.bumpuv[1] = tmpvar_36; - vec3 tmpvar_37; - tmpvar_37 = gl_TexCoord[2].xyz; - vec3 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlt_i_29.viewDir = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = frag (xlt_i_29); - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - xl_retval_30 = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = xl_retval_30.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - gl_FragData[0] = tmpvar_42; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-out.txt index ce1756df6..29fa21c86 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-out.txt @@ -22,4 +22,11 @@ void main () } -// inputs: 1, stats: 18 alu 3 tex 0 flow +// stats: 18 alu 3 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 1 (total size: 0) +// #0: _horizonColor (high float) 4x1 [-1] +// textures: 2 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _ColorControl (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Grab_Invert-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Grab_Invert-ir.txt deleted file mode 100644 index 9c8a90fd9..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Grab_Invert-ir.txt +++ /dev/null @@ -1,38 +0,0 @@ -struct v2f { - vec4 vertex; - vec4 uv; -}; -uniform sampler2D _GrabTexture; -vec4 frag ( - in v2f i_1 -) -{ - vec4 tmpvar_2; - tmpvar_2 = texture2DProj (_GrabTexture, i_1.uv); - return (1.0 - tmpvar_2); -} - -void main () -{ - v2f xlt_i_3; - vec4 xl_retval_4; - vec4 tmpvar_5; - tmpvar_5 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_3.vertex = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6 = gl_TexCoord[0].xyzw; - vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - xlt_i_3.uv = tmpvar_7; - vec4 tmpvar_8; - tmpvar_8 = frag (xlt_i_3); - vec4 tmpvar_9; - tmpvar_9 = tmpvar_8; - xl_retval_4 = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10 = xl_retval_4.xyzw; - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - gl_FragData[0] = tmpvar_11; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Grab_Invert-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Grab_Invert-out.txt index dab414b98..270ca8561 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Grab_Invert-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Grab_Invert-out.txt @@ -5,4 +5,8 @@ void main () } -// inputs: 1, stats: 1 alu 1 tex 0 flow +// stats: 1 alu 1 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// textures: 1 +// #0: _GrabTexture (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-ir.txt deleted file mode 100644 index 642479bdd..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-ir.txt +++ /dev/null @@ -1,128 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; - vec4 nz; -}; -uniform float _Cutoff; -uniform sampler2D _MainTex; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -vec2 EncodeViewNormalStereo ( - in vec3 n_2 -) -{ - vec2 enc_3; - float kScale_4; - float tmpvar_5; - tmpvar_5 = 1.7777; - kScale_4 = tmpvar_5; - vec2 tmpvar_6; - tmpvar_6 = (n_2.xy / (n_2.z + 1.0)); - enc_3 = tmpvar_6; - vec2 tmpvar_7; - tmpvar_7 = (enc_3 / kScale_4); - enc_3 = tmpvar_7; - vec2 tmpvar_8; - tmpvar_8 = ((enc_3 * 0.5) + 0.5); - enc_3 = tmpvar_8; - return enc_3; -} - -vec2 EncodeFloatRG ( - in float v_9 -) -{ - vec2 enc_10; - float kEncodeBit_11; - vec2 kEncodeMul_12; - vec2 tmpvar_13; - tmpvar_13 = vec2(1.0, 255.0); - kEncodeMul_12 = tmpvar_13; - float tmpvar_14; - tmpvar_14 = 0.00392157; - kEncodeBit_11 = tmpvar_14; - vec2 tmpvar_15; - tmpvar_15 = (kEncodeMul_12 * v_9); - enc_10 = tmpvar_15; - vec2 tmpvar_16; - tmpvar_16 = fract (enc_10); - vec2 tmpvar_17; - tmpvar_17 = tmpvar_16; - enc_10 = tmpvar_17; - float tmpvar_18; - tmpvar_18 = (enc_10.x - (enc_10.y * kEncodeBit_11)); - enc_10.x = tmpvar_18; - return enc_10; -} - -vec4 EncodeDepthNormal ( - in float depth_19, - in vec3 normal_20 -) -{ - vec4 enc_21; - vec2 tmpvar_22; - tmpvar_22 = EncodeViewNormalStereo (normal_20); - vec2 tmpvar_23; - tmpvar_23 = tmpvar_22; - enc_21.xy = tmpvar_23.xy.xy; - vec2 tmpvar_24; - tmpvar_24 = EncodeFloatRG (depth_19); - vec2 tmpvar_25; - tmpvar_25 = tmpvar_24; - enc_21.zw = tmpvar_25.xxxy.zw; - return enc_21; -} - -vec4 frag ( - in v2f i_26 -) -{ - vec4 texcol_27; - vec4 tmpvar_28; - tmpvar_28 = texture2D (_MainTex, i_26.uv); - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - texcol_27 = tmpvar_29; - xll_clip ((texcol_27.w - _Cutoff)); - vec4 tmpvar_30; - tmpvar_30 = EncodeDepthNormal (i_26.nz.w, i_26.nz.xyz); - return tmpvar_30; -} - -void main () -{ - v2f xlt_i_31; - vec4 xl_retval_32; - vec4 tmpvar_33; - tmpvar_33 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_31.pos = tmpvar_33; - vec2 tmpvar_34; - tmpvar_34 = gl_TexCoord[0].xy; - vec2 tmpvar_35; - tmpvar_35 = tmpvar_34; - xlt_i_31.uv = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36 = gl_TexCoord[1].xyzw; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlt_i_31.nz = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = frag (xlt_i_31); - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - xl_retval_32 = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = xl_retval_32.xyzw; - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - gl_FragData[0] = tmpvar_41; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-out.txt index 03941296f..79dbd07d0 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-out.txt @@ -10,17 +10,26 @@ void main () discard; }; vec4 enc_3; - enc_3.xy = ((( - (tmpvar_1.xy / (tmpvar_1.z + 1.0)) - / 1.7777) * 0.5) + 0.5); vec2 enc_4; - vec2 tmpvar_5; - tmpvar_5 = fract((vec2(1.0, 255.0) * tmpvar_1.w)); - enc_4.y = tmpvar_5.y; - enc_4.x = (tmpvar_5.x - (tmpvar_5.y * 0.00392157)); - enc_3.zw = enc_4; + enc_4 = (tmpvar_1.xy / (tmpvar_1.z + 1.0)); + enc_4 = (enc_4 / 1.7777); + enc_4 = ((enc_4 * 0.5) + 0.5); + enc_3.xy = enc_4; + vec2 enc_5; + enc_5 = (vec2(1.0, 255.0) * tmpvar_1.w); + vec2 tmpvar_6; + tmpvar_6 = fract(enc_5); + enc_5.y = tmpvar_6.y; + enc_5.x = (tmpvar_6.x - (tmpvar_6.y * 0.00392157)); + enc_3.zw = enc_5; gl_FragData[0] = enc_3; } -// inputs: 1, stats: 11 alu 2 tex 1 flow +// stats: 11 alu 2 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [2] loc 4 +// uniforms: 1 (total size: 0) +// #0: _Cutoff (high float) 1x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-ir.txt deleted file mode 100644 index 642479bdd..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-ir.txt +++ /dev/null @@ -1,128 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; - vec4 nz; -}; -uniform float _Cutoff; -uniform sampler2D _MainTex; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -vec2 EncodeViewNormalStereo ( - in vec3 n_2 -) -{ - vec2 enc_3; - float kScale_4; - float tmpvar_5; - tmpvar_5 = 1.7777; - kScale_4 = tmpvar_5; - vec2 tmpvar_6; - tmpvar_6 = (n_2.xy / (n_2.z + 1.0)); - enc_3 = tmpvar_6; - vec2 tmpvar_7; - tmpvar_7 = (enc_3 / kScale_4); - enc_3 = tmpvar_7; - vec2 tmpvar_8; - tmpvar_8 = ((enc_3 * 0.5) + 0.5); - enc_3 = tmpvar_8; - return enc_3; -} - -vec2 EncodeFloatRG ( - in float v_9 -) -{ - vec2 enc_10; - float kEncodeBit_11; - vec2 kEncodeMul_12; - vec2 tmpvar_13; - tmpvar_13 = vec2(1.0, 255.0); - kEncodeMul_12 = tmpvar_13; - float tmpvar_14; - tmpvar_14 = 0.00392157; - kEncodeBit_11 = tmpvar_14; - vec2 tmpvar_15; - tmpvar_15 = (kEncodeMul_12 * v_9); - enc_10 = tmpvar_15; - vec2 tmpvar_16; - tmpvar_16 = fract (enc_10); - vec2 tmpvar_17; - tmpvar_17 = tmpvar_16; - enc_10 = tmpvar_17; - float tmpvar_18; - tmpvar_18 = (enc_10.x - (enc_10.y * kEncodeBit_11)); - enc_10.x = tmpvar_18; - return enc_10; -} - -vec4 EncodeDepthNormal ( - in float depth_19, - in vec3 normal_20 -) -{ - vec4 enc_21; - vec2 tmpvar_22; - tmpvar_22 = EncodeViewNormalStereo (normal_20); - vec2 tmpvar_23; - tmpvar_23 = tmpvar_22; - enc_21.xy = tmpvar_23.xy.xy; - vec2 tmpvar_24; - tmpvar_24 = EncodeFloatRG (depth_19); - vec2 tmpvar_25; - tmpvar_25 = tmpvar_24; - enc_21.zw = tmpvar_25.xxxy.zw; - return enc_21; -} - -vec4 frag ( - in v2f i_26 -) -{ - vec4 texcol_27; - vec4 tmpvar_28; - tmpvar_28 = texture2D (_MainTex, i_26.uv); - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - texcol_27 = tmpvar_29; - xll_clip ((texcol_27.w - _Cutoff)); - vec4 tmpvar_30; - tmpvar_30 = EncodeDepthNormal (i_26.nz.w, i_26.nz.xyz); - return tmpvar_30; -} - -void main () -{ - v2f xlt_i_31; - vec4 xl_retval_32; - vec4 tmpvar_33; - tmpvar_33 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_31.pos = tmpvar_33; - vec2 tmpvar_34; - tmpvar_34 = gl_TexCoord[0].xy; - vec2 tmpvar_35; - tmpvar_35 = tmpvar_34; - xlt_i_31.uv = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36 = gl_TexCoord[1].xyzw; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlt_i_31.nz = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = frag (xlt_i_31); - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - xl_retval_32 = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = xl_retval_32.xyzw; - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - gl_FragData[0] = tmpvar_41; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-out.txt index 03941296f..79dbd07d0 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-out.txt @@ -10,17 +10,26 @@ void main () discard; }; vec4 enc_3; - enc_3.xy = ((( - (tmpvar_1.xy / (tmpvar_1.z + 1.0)) - / 1.7777) * 0.5) + 0.5); vec2 enc_4; - vec2 tmpvar_5; - tmpvar_5 = fract((vec2(1.0, 255.0) * tmpvar_1.w)); - enc_4.y = tmpvar_5.y; - enc_4.x = (tmpvar_5.x - (tmpvar_5.y * 0.00392157)); - enc_3.zw = enc_4; + enc_4 = (tmpvar_1.xy / (tmpvar_1.z + 1.0)); + enc_4 = (enc_4 / 1.7777); + enc_4 = ((enc_4 * 0.5) + 0.5); + enc_3.xy = enc_4; + vec2 enc_5; + enc_5 = (vec2(1.0, 255.0) * tmpvar_1.w); + vec2 tmpvar_6; + tmpvar_6 = fract(enc_5); + enc_5.y = tmpvar_6.y; + enc_5.x = (tmpvar_6.x - (tmpvar_6.y * 0.00392157)); + enc_3.zw = enc_5; gl_FragData[0] = enc_3; } -// inputs: 1, stats: 11 alu 2 tex 1 flow +// stats: 11 alu 2 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [2] loc 4 +// uniforms: 1 (total size: 0) +// #0: _Cutoff (high float) 1x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthTexture-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthTexture-ir.txt deleted file mode 100644 index 6ebd3de0e..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthTexture-ir.txt +++ /dev/null @@ -1,52 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; -}; -uniform sampler2D _MainTex; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -vec4 frag ( - in v2f i_2 -) -{ - vec4 texcol_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, i_2.uv); - vec4 tmpvar_5; - tmpvar_5 = tmpvar_4; - texcol_3 = tmpvar_5; - xll_clip ((texcol_3.w - 0.001)); - return vec4(0.0, 0.0, 0.0, 0.0); -} - -void main () -{ - v2f xlt_i_6; - vec4 xl_retval_7; - vec4 tmpvar_8; - tmpvar_8 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_6.pos = tmpvar_8; - vec2 tmpvar_9; - tmpvar_9 = gl_TexCoord[0].xy; - vec2 tmpvar_10; - tmpvar_10 = tmpvar_9; - xlt_i_6.uv = tmpvar_10; - vec4 tmpvar_11; - tmpvar_11 = frag (xlt_i_6); - vec4 tmpvar_12; - tmpvar_12 = tmpvar_11; - xl_retval_7 = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13 = xl_retval_7.xyzw; - vec4 tmpvar_14; - tmpvar_14 = tmpvar_13; - gl_FragData[0] = tmpvar_14; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthTexture-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthTexture-out.txt index ae0f7e096..6042b7a62 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthTexture-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthTexture-out.txt @@ -10,4 +10,8 @@ void main () } -// inputs: 1, stats: 3 alu 2 tex 1 flow +// stats: 3 alu 2 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-ir.txt deleted file mode 100644 index 80a8dde38..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-ir.txt +++ /dev/null @@ -1,70 +0,0 @@ -struct v2f_img { - vec4 pos; - vec2 uv; -}; -uniform sampler2D _MainTex; -uniform sampler2D _RampTex; -vec4 frag ( - in v2f_img i_1 -) -{ - vec4 color_2; - float bb_3; - float gg_4; - float rr_5; - vec4 orig_6; - vec4 tmpvar_7; - tmpvar_7 = texture2D (_MainTex, i_1.uv); - vec4 tmpvar_8; - tmpvar_8 = tmpvar_7; - orig_6 = tmpvar_8; - vec4 tmpvar_9; - tmpvar_9 = texture2D (_RampTex, orig_6.xx); - float tmpvar_10; - tmpvar_10 = (tmpvar_9.x + 1e-05); - rr_5 = tmpvar_10; - vec4 tmpvar_11; - tmpvar_11 = texture2D (_RampTex, orig_6.yy); - float tmpvar_12; - tmpvar_12 = (tmpvar_11.y + 2e-05); - gg_4 = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13 = texture2D (_RampTex, orig_6.zz); - float tmpvar_14; - tmpvar_14 = (tmpvar_13.z + 3e-05); - bb_3 = tmpvar_14; - vec4 tmpvar_15; - tmpvar_15.x = rr_5; - tmpvar_15.y = gg_4; - tmpvar_15.z = bb_3; - tmpvar_15.w = orig_6.w; - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - color_2 = tmpvar_16; - return color_2; -} - -void main () -{ - v2f_img xlt_i_17; - vec4 xl_retval_18; - vec4 tmpvar_19; - tmpvar_19 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_17.pos = tmpvar_19; - vec2 tmpvar_20; - tmpvar_20 = gl_TexCoord[0].xy; - vec2 tmpvar_21; - tmpvar_21 = tmpvar_20; - xlt_i_17.uv = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22 = frag (xlt_i_17); - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - xl_retval_18 = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = xl_retval_18.xyzw; - vec4 tmpvar_25; - tmpvar_25 = tmpvar_24; - gl_FragData[0] = tmpvar_25; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-out.txt index 35e6a896e..2def90001 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-out.txt @@ -13,4 +13,9 @@ void main () } -// inputs: 1, stats: 3 alu 4 tex 0 flow +// stats: 3 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// textures: 2 +// #0: _MainTex (high 2d) 0x0 [-1] +// #1: _RampTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-ir.txt deleted file mode 100644 index a69cee14a..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-ir.txt +++ /dev/null @@ -1,84 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv[3]; -}; -uniform sampler2D _MainTex; -uniform float _Treshold; -vec4 frag ( - in v2f i_1 -) -{ - float len_2; - vec3 diff_3; - vec3 p3_4; - vec3 p2_5; - vec3 p1_6; - vec4 original_7; - vec4 tmpvar_8; - tmpvar_8 = texture2D (_MainTex, i_1.uv[0]); - vec4 tmpvar_9; - tmpvar_9 = tmpvar_8; - original_7 = tmpvar_9; - vec3 tmpvar_10; - tmpvar_10 = original_7.xyz; - p1_6 = tmpvar_10; - vec4 tmpvar_11; - tmpvar_11 = texture2D (_MainTex, i_1.uv[1]); - vec3 tmpvar_12; - tmpvar_12 = tmpvar_11.xyz; - p2_5 = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13 = texture2D (_MainTex, i_1.uv[2]); - vec3 tmpvar_14; - tmpvar_14 = tmpvar_13.xyz; - p3_4 = tmpvar_14; - vec3 tmpvar_15; - tmpvar_15 = (((p1_6 * 2.0) - p2_5) - p3_4); - diff_3 = tmpvar_15; - float tmpvar_16; - tmpvar_16 = dot (diff_3, diff_3); - float tmpvar_17; - tmpvar_17 = tmpvar_16; - len_2 = tmpvar_17; - if ((len_2 >= _Treshold)) { - vec3 tmpvar_18; - tmpvar_18 = vec3(0.0, 0.0, 0.0); - original_7.xyz = tmpvar_18.xyz.xyz; - }; - return original_7; -} - -void main () -{ - v2f xlt_i_19; - vec4 xl_retval_20; - vec4 tmpvar_21; - tmpvar_21 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_19.pos = tmpvar_21; - vec2 tmpvar_22; - tmpvar_22 = gl_TexCoord[0].xy; - vec2 tmpvar_23; - tmpvar_23 = tmpvar_22; - xlt_i_19.uv[0] = tmpvar_23; - vec2 tmpvar_24; - tmpvar_24 = gl_TexCoord[1].xy; - vec2 tmpvar_25; - tmpvar_25 = tmpvar_24; - xlt_i_19.uv[1] = tmpvar_25; - vec2 tmpvar_26; - tmpvar_26 = gl_TexCoord[2].xy; - vec2 tmpvar_27; - tmpvar_27 = tmpvar_26; - xlt_i_19.uv[2] = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = frag (xlt_i_19); - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - xl_retval_20 = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = xl_retval_20.xyzw; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - gl_FragData[0] = tmpvar_31; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-out.txt index a1b8ac3e1..f36dbb15d 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-out.txt @@ -2,19 +2,25 @@ uniform sampler2D _MainTex; uniform float _Treshold; void main () { - vec4 original_1; - vec4 tmpvar_2; - tmpvar_2 = texture2D (_MainTex, gl_TexCoord[0].xy); - original_1 = tmpvar_2; - vec3 tmpvar_3; - tmpvar_3 = (((tmpvar_2.xyz * 2.0) - texture2D (_MainTex, gl_TexCoord[1].xy).xyz) - texture2D (_MainTex, gl_TexCoord[2].xy).xyz); + vec3 diff_1; + vec4 original_2; + vec4 tmpvar_3; + tmpvar_3 = texture2D (_MainTex, gl_TexCoord[0].xy); + original_2 = tmpvar_3; + diff_1 = (((tmpvar_3.xyz * 2.0) - texture2D (_MainTex, gl_TexCoord[1].xy).xyz) - texture2D (_MainTex, gl_TexCoord[2].xy).xyz); float tmpvar_4; - tmpvar_4 = dot (tmpvar_3, tmpvar_3); + tmpvar_4 = dot (diff_1, diff_1); if ((tmpvar_4 >= _Treshold)) { - original_1.xyz = vec3(0.0, 0.0, 0.0); + original_2.xyz = vec3(0.0, 0.0, 0.0); }; - gl_FragData[0] = original_1; + gl_FragData[0] = original_2; } -// inputs: 1, stats: 6 alu 3 tex 1 flow +// stats: 6 alu 3 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 1 (total size: 0) +// #0: _Treshold (high float) 1x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-ir.txt deleted file mode 100644 index 24b2e437f..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-ir.txt +++ /dev/null @@ -1,66 +0,0 @@ -struct v2f { - vec4 pos; - vec4 uv[2]; -}; -uniform vec4 _Color; -uniform sampler2D _MainTex; -vec4 frag ( - in v2f i_1 -) -{ - vec4 c_2; - vec4 tmpvar_3; - tmpvar_3 = texture2D (_MainTex, i_1.uv[0].xy); - vec4 tmpvar_4; - tmpvar_4 = tmpvar_3; - c_2 = tmpvar_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, i_1.uv[0].zw); - vec4 tmpvar_6; - tmpvar_6 = (c_2 + tmpvar_5); - c_2 = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7 = texture2D (_MainTex, i_1.uv[1].xy); - vec4 tmpvar_8; - tmpvar_8 = (c_2 + tmpvar_7); - c_2 = tmpvar_8; - vec4 tmpvar_9; - tmpvar_9 = texture2D (_MainTex, i_1.uv[1].zw); - vec4 tmpvar_10; - tmpvar_10 = (c_2 + tmpvar_9); - c_2 = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = (c_2.xyz * _Color.xyz); - c_2.xyz = tmpvar_11.xyz.xyz; - return (c_2 * _Color.w); -} - -void main () -{ - v2f xlt_i_12; - vec4 xl_retval_13; - vec4 tmpvar_14; - tmpvar_14 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_12.pos = tmpvar_14; - vec4 tmpvar_15; - tmpvar_15 = gl_TexCoord[0].xyzw; - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - xlt_i_12.uv[0] = tmpvar_16; - vec4 tmpvar_17; - tmpvar_17 = gl_TexCoord[1].xyzw; - vec4 tmpvar_18; - tmpvar_18 = tmpvar_17; - xlt_i_12.uv[1] = tmpvar_18; - vec4 tmpvar_19; - tmpvar_19 = frag (xlt_i_12); - vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - xl_retval_13 = tmpvar_20; - vec4 tmpvar_21; - tmpvar_21 = xl_retval_13.xyzw; - vec4 tmpvar_22; - tmpvar_22 = tmpvar_21; - gl_FragData[0] = tmpvar_22; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-out.txt index 88ab8e6a9..062159cda 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-out.txt @@ -7,12 +7,18 @@ void main () tmpvar_1 = gl_TexCoord[0]; tmpvar_2 = gl_TexCoord[1]; vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = (((texture2D (_MainTex, tmpvar_1.xy) + texture2D (_MainTex, tmpvar_1.zw)) + texture2D (_MainTex, tmpvar_2.xy)) + texture2D (_MainTex, tmpvar_2.zw)); - c_3.w = tmpvar_4.w; - c_3.xyz = (tmpvar_4.xyz * _Color.xyz); + c_3 = (texture2D (_MainTex, tmpvar_1.xy) + texture2D (_MainTex, tmpvar_1.zw)); + c_3 = (c_3 + texture2D (_MainTex, tmpvar_2.xy)); + c_3 = (c_3 + texture2D (_MainTex, tmpvar_2.zw)); + c_3.xyz = (c_3.xyz * _Color.xyz); gl_FragData[0] = (c_3 * _Color.w); } -// inputs: 1, stats: 5 alu 4 tex 0 flow +// stats: 5 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [2] loc 4 +// uniforms: 1 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-ir.txt deleted file mode 100644 index a31a60d5c..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-ir.txt +++ /dev/null @@ -1,85 +0,0 @@ -struct v2f { - vec4 pos; - vec4 uv[4]; -}; -uniform vec4 _Color; -uniform sampler2D _MainTex; -vec4 frag ( - in v2f i_1 -) -{ - vec4 c_2; - vec4 tmpvar_3; - tmpvar_3 = texture2D (_MainTex, i_1.uv[0].xy); - vec4 tmpvar_4; - tmpvar_4 = tmpvar_3; - c_2 = tmpvar_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, i_1.uv[1].xy); - vec4 tmpvar_6; - tmpvar_6 = (c_2 + tmpvar_5); - c_2 = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7 = texture2D (_MainTex, i_1.uv[2].xy); - vec4 tmpvar_8; - tmpvar_8 = (c_2 + tmpvar_7); - c_2 = tmpvar_8; - vec4 tmpvar_9; - tmpvar_9 = texture2D (_MainTex, i_1.uv[3].xy); - vec4 tmpvar_10; - tmpvar_10 = (c_2 + tmpvar_9); - c_2 = tmpvar_10; - vec4 tmpvar_11; - tmpvar_11 = (c_2 / 4.0); - c_2 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = (c_2.xyz * _Color.xyz); - c_2.xyz = tmpvar_12.xyz.xyz; - vec3 tmpvar_13; - tmpvar_13 = (c_2.xyz * (c_2.w + _Color.w)); - c_2.xyz = tmpvar_13.xyz.xyz; - float tmpvar_14; - tmpvar_14 = 0.0; - c_2.w = vec4(tmpvar_14).w; - return c_2; -} - -void main () -{ - v2f xlt_i_15; - vec4 xl_retval_16; - vec4 tmpvar_17; - tmpvar_17 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_15.pos = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = gl_TexCoord[0].xyzw; - vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - xlt_i_15.uv[0] = tmpvar_19; - vec4 tmpvar_20; - tmpvar_20 = gl_TexCoord[1].xyzw; - vec4 tmpvar_21; - tmpvar_21 = tmpvar_20; - xlt_i_15.uv[1] = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22 = gl_TexCoord[2].xyzw; - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - xlt_i_15.uv[2] = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = gl_TexCoord[3].xyzw; - vec4 tmpvar_25; - tmpvar_25 = tmpvar_24; - xlt_i_15.uv[3] = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = frag (xlt_i_15); - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - xl_retval_16 = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = xl_retval_16.xyzw; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - gl_FragData[0] = tmpvar_29; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-out.txt index acad309e4..9c46022d3 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-out.txt @@ -3,16 +3,21 @@ uniform sampler2D _MainTex; void main () { vec4 c_1; - vec4 tmpvar_2; - tmpvar_2 = ((( - (texture2D (_MainTex, gl_TexCoord[0].xy) + texture2D (_MainTex, gl_TexCoord[1].xy)) - + texture2D (_MainTex, gl_TexCoord[2].xy)) + texture2D (_MainTex, gl_TexCoord[3].xy)) / 4.0); - c_1.w = tmpvar_2.w; - c_1.xyz = (tmpvar_2.xyz * _Color.xyz); - c_1.xyz = (c_1.xyz * (tmpvar_2.w + _Color.w)); + c_1 = (texture2D (_MainTex, gl_TexCoord[0].xy) + texture2D (_MainTex, gl_TexCoord[1].xy)); + c_1 = (c_1 + texture2D (_MainTex, gl_TexCoord[2].xy)); + c_1 = (c_1 + texture2D (_MainTex, gl_TexCoord[3].xy)); + c_1 = (c_1 / 4.0); + c_1.xyz = (c_1.xyz * _Color.xyz); + c_1.xyz = (c_1.xyz * (c_1.w + _Color.w)); c_1.w = 0.0; gl_FragData[0] = c_1; } -// inputs: 1, stats: 8 alu 4 tex 0 flow +// stats: 8 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 1 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-ir.txt deleted file mode 100644 index d3443d5b2..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-ir.txt +++ /dev/null @@ -1,75 +0,0 @@ -struct v2f_img { - vec4 pos; - vec2 uv; -}; -uniform sampler2D _MainTex; -uniform float _RampOffset; -uniform sampler2D _RampTex; -float Luminance ( - in vec3 c_1 -) -{ - float tmpvar_2; - tmpvar_2 = dot (c_1, vec3(0.22, 0.707, 0.071)); - return tmpvar_2; -} - -vec4 frag ( - in v2f_img i_3 -) -{ - vec4 xlat_var_output_4; - vec2 remap_5; - float grayscale_6; - vec4 original_7; - vec4 tmpvar_8; - tmpvar_8 = texture2D (_MainTex, i_3.uv); - vec4 tmpvar_9; - tmpvar_9 = tmpvar_8; - original_7 = tmpvar_9; - float tmpvar_10; - tmpvar_10 = Luminance (original_7.xyz); - float tmpvar_11; - tmpvar_11 = tmpvar_10; - grayscale_6 = tmpvar_11; - vec2 tmpvar_12; - tmpvar_12.y = 0.5; - tmpvar_12.x = (grayscale_6 + _RampOffset); - vec2 tmpvar_13; - tmpvar_13 = tmpvar_12; - remap_5 = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = texture2D (_RampTex, remap_5); - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - xlat_var_output_4 = tmpvar_15; - float tmpvar_16; - tmpvar_16 = original_7.w; - xlat_var_output_4.w = vec4(tmpvar_16).w; - return xlat_var_output_4; -} - -void main () -{ - v2f_img xlt_i_17; - vec4 xl_retval_18; - vec4 tmpvar_19; - tmpvar_19 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_17.pos = tmpvar_19; - vec2 tmpvar_20; - tmpvar_20 = gl_TexCoord[0].xy; - vec2 tmpvar_21; - tmpvar_21 = tmpvar_20; - xlt_i_17.uv = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22 = frag (xlt_i_17); - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - xl_retval_18 = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = xl_retval_18.xyzw; - vec4 tmpvar_25; - tmpvar_25 = tmpvar_24; - gl_FragData[0] = tmpvar_25; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-out.txt index 203cd64b1..d2b1a2002 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-out.txt @@ -15,4 +15,11 @@ void main () } -// inputs: 1, stats: 3 alu 2 tex 0 flow +// stats: 3 alu 2 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// uniforms: 1 (total size: 0) +// #0: _RampOffset (high float) 1x1 [-1] +// textures: 2 +// #0: _MainTex (high 2d) 0x0 [-1] +// #1: _RampTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-ir.txt deleted file mode 100644 index 6c18448e2..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-ir.txt +++ /dev/null @@ -1,143 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; -}; -uniform sampler2D _CameraDepthTexture; -uniform sampler2D _CameraNormalsTexture; -uniform vec4 _ZBufferParams; -float Linear01Depth ( - in float z_1 -) -{ - return (1.0 / ((_ZBufferParams.x * z_1) + _ZBufferParams.y)); -} - -vec2 EncodeViewNormalStereo ( - in vec3 n_2 -) -{ - vec2 enc_3; - float kScale_4; - float tmpvar_5; - tmpvar_5 = 1.7777; - kScale_4 = tmpvar_5; - vec2 tmpvar_6; - tmpvar_6 = (n_2.xy / (n_2.z + 1.0)); - enc_3 = tmpvar_6; - vec2 tmpvar_7; - tmpvar_7 = (enc_3 / kScale_4); - enc_3 = tmpvar_7; - vec2 tmpvar_8; - tmpvar_8 = ((enc_3 * 0.5) + 0.5); - enc_3 = tmpvar_8; - return enc_3; -} - -vec2 EncodeFloatRG ( - in float v_9 -) -{ - vec2 enc_10; - float kEncodeBit_11; - vec2 kEncodeMul_12; - vec2 tmpvar_13; - tmpvar_13 = vec2(1.0, 255.0); - kEncodeMul_12 = tmpvar_13; - float tmpvar_14; - tmpvar_14 = 0.00392157; - kEncodeBit_11 = tmpvar_14; - vec2 tmpvar_15; - tmpvar_15 = (kEncodeMul_12 * v_9); - enc_10 = tmpvar_15; - vec2 tmpvar_16; - tmpvar_16 = fract (enc_10); - vec2 tmpvar_17; - tmpvar_17 = tmpvar_16; - enc_10 = tmpvar_17; - float tmpvar_18; - tmpvar_18 = (enc_10.x - (enc_10.y * kEncodeBit_11)); - enc_10.x = tmpvar_18; - return enc_10; -} - -vec4 EncodeDepthNormal ( - in float depth_19, - in vec3 normal_20 -) -{ - vec4 enc_21; - vec2 tmpvar_22; - tmpvar_22 = EncodeViewNormalStereo (normal_20); - vec2 tmpvar_23; - tmpvar_23 = tmpvar_22; - enc_21.xy = tmpvar_23.xy.xy; - vec2 tmpvar_24; - tmpvar_24 = EncodeFloatRG (depth_19); - vec2 tmpvar_25; - tmpvar_25 = tmpvar_24; - enc_21.zw = tmpvar_25.xxxy.zw; - return enc_21; -} - -vec4 frag ( - in v2f i_26 -) -{ - vec4 n_27; - float d_28; - vec4 tmpvar_29; - tmpvar_29 = texture2D (_CameraDepthTexture, i_26.uv); - float tmpvar_30; - tmpvar_30 = tmpvar_29.x; - d_28 = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = texture2D (_CameraNormalsTexture, i_26.uv); - vec4 tmpvar_32; - tmpvar_32 = tmpvar_31; - n_27 = tmpvar_32; - float tmpvar_33; - tmpvar_33 = Linear01Depth (d_28); - float tmpvar_34; - tmpvar_34 = tmpvar_33; - d_28 = tmpvar_34; - vec3 tmpvar_35; - tmpvar_35 = ((n_27.xyz * 2.0) - 1.0); - n_27.xyz = tmpvar_35.xyz.xyz; - float tmpvar_36; - tmpvar_36 = -(n_27.z); - n_27.z = vec3(tmpvar_36).z; - vec4 tmpvar_37; - if ((d_28 < 0.999985)) { - vec4 tmpvar_38; - tmpvar_38 = EncodeDepthNormal (d_28, n_27.xyz); - tmpvar_37 = tmpvar_38; - } else { - tmpvar_37 = vec4(0.5, 0.5, 1.0, 1.0); - }; - return tmpvar_37; -} - -void main () -{ - v2f xlt_i_39; - vec4 xl_retval_40; - vec4 tmpvar_41; - tmpvar_41 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_39.pos = tmpvar_41; - vec2 tmpvar_42; - tmpvar_42 = gl_TexCoord[0].xy; - vec2 tmpvar_43; - tmpvar_43 = tmpvar_42; - xlt_i_39.uv = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44 = frag (xlt_i_39); - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - xl_retval_40 = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46 = xl_retval_40.xyzw; - vec4 tmpvar_47; - tmpvar_47 = tmpvar_46; - gl_FragData[0] = tmpvar_47; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-out.txt index bc5fc0219..04c2e8dcf 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-out.txt @@ -16,15 +16,18 @@ void main () vec4 tmpvar_5; if ((tmpvar_4 < 0.999985)) { vec4 enc_6; - enc_6.xy = ((( - (n_2.xy / (n_2.z + 1.0)) - / 1.7777) * 0.5) + 0.5); vec2 enc_7; - vec2 tmpvar_8; - tmpvar_8 = fract((vec2(1.0, 255.0) * tmpvar_4)); - enc_7.y = tmpvar_8.y; - enc_7.x = (tmpvar_8.x - (tmpvar_8.y * 0.00392157)); - enc_6.zw = enc_7; + enc_7 = (n_2.xy / (n_2.z + 1.0)); + enc_7 = (enc_7 / 1.7777); + enc_7 = ((enc_7 * 0.5) + 0.5); + enc_6.xy = enc_7; + vec2 enc_8; + enc_8 = (vec2(1.0, 255.0) * tmpvar_4); + vec2 tmpvar_9; + tmpvar_9 = fract(enc_8); + enc_8.y = tmpvar_9.y; + enc_8.x = (tmpvar_9.x - (tmpvar_9.y * 0.00392157)); + enc_6.zw = enc_8; tmpvar_5 = enc_6; } else { tmpvar_5 = vec4(0.5, 0.5, 1.0, 1.0); @@ -33,4 +36,11 @@ void main () } -// inputs: 1, stats: 17 alu 2 tex 1 flow +// stats: 17 alu 2 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// uniforms: 1 (total size: 0) +// #0: _ZBufferParams (high float) 4x1 [-1] +// textures: 2 +// #0: _CameraDepthTexture (high 2d) 0x0 [-1] +// #1: _CameraNormalsTexture (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-ir.txt deleted file mode 100644 index 63e06f7ab..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-ir.txt +++ /dev/null @@ -1,60 +0,0 @@ -struct v2f { - vec4 vertex; - vec4 color; - vec2 texcoord; - vec2 texgencoord; -}; -uniform sampler2D _GUIClipTexture; -uniform sampler2D _MainTex; -vec4 frag ( - in v2f i_1 -) -{ - vec4 col_2; - vec4 tmpvar_3; - tmpvar_3 = texture2D (_MainTex, i_1.texcoord); - vec3 tmpvar_4; - tmpvar_4 = (tmpvar_3.xyz * i_1.color.xyz); - col_2.xyz = tmpvar_4.xyz.xyz; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_GUIClipTexture, i_1.texgencoord); - float tmpvar_6; - tmpvar_6 = (i_1.color.w * tmpvar_5.w); - col_2.w = vec4(tmpvar_6).w; - return col_2; -} - -void main () -{ - v2f xlt_i_7; - vec4 xl_retval_8; - vec4 tmpvar_9; - tmpvar_9 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_7.vertex = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10 = gl_Color.xyzw; - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - xlt_i_7.color = tmpvar_11; - vec2 tmpvar_12; - tmpvar_12 = gl_TexCoord[0].xy; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_12; - xlt_i_7.texcoord = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = gl_TexCoord[1].xy; - vec2 tmpvar_15; - tmpvar_15 = tmpvar_14; - xlt_i_7.texgencoord = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = frag (xlt_i_7); - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - xl_retval_8 = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = xl_retval_8.xyzw; - vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - gl_FragData[0] = tmpvar_19; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-out.txt index 611354331..1de1ebc14 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-out.txt @@ -9,4 +9,10 @@ void main () } -// inputs: 2, stats: 2 alu 2 tex 0 flow +// stats: 2 alu 2 tex 0 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [2] loc 4 +// textures: 2 +// #0: _GUIClipTexture (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-ir.txt deleted file mode 100644 index 20df87619..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-ir.txt +++ /dev/null @@ -1,60 +0,0 @@ -struct v2f { - vec4 vertex; - vec4 color; - vec2 texcoord; - vec2 texgencoord; -}; -uniform sampler2D _GUIClipTexture; -uniform sampler2D _MainTex; -vec4 frag ( - in v2f i_1 -) -{ - vec4 col_2; - vec4 tmpvar_3; - tmpvar_3 = texture2D (_MainTex, i_1.texcoord); - vec4 tmpvar_4; - tmpvar_4 = (tmpvar_3 * i_1.color); - col_2 = tmpvar_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_GUIClipTexture, i_1.texgencoord); - float tmpvar_6; - tmpvar_6 = (col_2.w * tmpvar_5.w); - col_2.w = vec4(tmpvar_6).w; - return col_2; -} - -void main () -{ - v2f xlt_i_7; - vec4 xl_retval_8; - vec4 tmpvar_9; - tmpvar_9 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_7.vertex = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10 = gl_Color.xyzw; - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - xlt_i_7.color = tmpvar_11; - vec2 tmpvar_12; - tmpvar_12 = gl_TexCoord[0].xy; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_12; - xlt_i_7.texcoord = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = gl_TexCoord[1].xy; - vec2 tmpvar_15; - tmpvar_15 = tmpvar_14; - xlt_i_7.texgencoord = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = frag (xlt_i_7); - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - xl_retval_8 = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = xl_retval_8.xyzw; - vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - gl_FragData[0] = tmpvar_19; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-out.txt index 806304a48..fee6e24ae 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-out.txt @@ -3,12 +3,16 @@ uniform sampler2D _MainTex; void main () { vec4 col_1; - vec4 tmpvar_2; - tmpvar_2 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color); - col_1.xyz = tmpvar_2.xyz; - col_1.w = (tmpvar_2.w * texture2D (_GUIClipTexture, gl_TexCoord[1].xy).w); + col_1 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color); + col_1.w = (col_1.w * texture2D (_GUIClipTexture, gl_TexCoord[1].xy).w); gl_FragData[0] = col_1; } -// inputs: 2, stats: 2 alu 2 tex 0 flow +// stats: 2 alu 2 tex 0 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [2] loc 4 +// textures: 2 +// #0: _GUIClipTexture (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-Halo-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-Halo-ir.txt deleted file mode 100644 index 10f039d5c..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-Halo-ir.txt +++ /dev/null @@ -1,51 +0,0 @@ -struct v2f { - vec4 vertex; - vec4 color; - vec2 texcoord; -}; -uniform sampler2D _HaloFalloff; -vec4 frag ( - in v2f i_1 -) -{ - float a_2; - vec4 tmpvar_3; - tmpvar_3 = texture2D (_HaloFalloff, i_1.texcoord); - float tmpvar_4; - tmpvar_4 = tmpvar_3.w; - a_2 = tmpvar_4; - vec4 tmpvar_5; - tmpvar_5.xyz = (i_1.color.xyz * a_2).xyz; - tmpvar_5.w = a_2; - return tmpvar_5; -} - -void main () -{ - v2f xlt_i_6; - vec4 xl_retval_7; - vec4 tmpvar_8; - tmpvar_8 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_6.vertex = tmpvar_8; - vec4 tmpvar_9; - tmpvar_9 = gl_Color.xyzw; - vec4 tmpvar_10; - tmpvar_10 = tmpvar_9; - xlt_i_6.color = tmpvar_10; - vec2 tmpvar_11; - tmpvar_11 = gl_TexCoord[0].xy; - vec2 tmpvar_12; - tmpvar_12 = tmpvar_11; - xlt_i_6.texcoord = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13 = frag (xlt_i_6); - vec4 tmpvar_14; - tmpvar_14 = tmpvar_13; - xl_retval_7 = tmpvar_14; - vec4 tmpvar_15; - tmpvar_15 = xl_retval_7.xyzw; - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - gl_FragData[0] = tmpvar_16; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-Halo-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-Halo-out.txt index 3ecae8fb9..6559f0e0c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-Halo-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-Halo-out.txt @@ -10,4 +10,9 @@ void main () } -// inputs: 2, stats: 1 alu 1 tex 0 flow +// stats: 1 alu 1 tex 0 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [1] loc 4 +// textures: 1 +// #0: _HaloFalloff (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-ir.txt deleted file mode 100644 index 2b955aeef..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-ir.txt +++ /dev/null @@ -1,195 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; - vec3 ray; -}; -uniform sampler2D _CameraDepthTexture; -uniform vec4 _LightShadowData; -uniform vec4 _LightSplitsFar; -uniform vec4 _LightSplitsNear; -uniform sampler2D _ShadowMapTexture; -uniform mat4 _View2Shadow; -uniform mat4 _View2Shadow1; -uniform mat4 _View2Shadow2; -uniform mat4 _View2Shadow3; -uniform vec4 _ZBufferParams; -float unitySampleShadow ( - in vec4 eyePos_1 -) -{ - float shadow_2; - vec4 coord_3; - vec4 weights_4; - vec4 far_5; - vec4 near_6; - float z_7; - vec3 sc3_8; - vec3 sc2_9; - vec3 sc1_10; - vec3 sc0_11; - vec3 tmpvar_12; - tmpvar_12 = (_View2Shadow * eyePos_1).xyz; - sc0_11 = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13 = (_View2Shadow1 * eyePos_1).xyz; - sc1_10 = tmpvar_13; - vec3 tmpvar_14; - tmpvar_14 = (_View2Shadow2 * eyePos_1).xyz; - sc2_9 = tmpvar_14; - vec3 tmpvar_15; - tmpvar_15 = (_View2Shadow3 * eyePos_1).xyz; - sc3_8 = tmpvar_15; - float tmpvar_16; - tmpvar_16 = eyePos_1.z; - z_7 = tmpvar_16; - vec4 tmpvar_17; - tmpvar_17 = vec4(z_7); - bvec4 tmpvar_18; - tmpvar_18 = greaterThanEqual (tmpvar_17, _LightSplitsNear); - vec4 tmpvar_19; - tmpvar_19 = vec4(tmpvar_18).xyzw; - vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - near_6 = tmpvar_20; - vec4 tmpvar_21; - tmpvar_21 = vec4(z_7); - bvec4 tmpvar_22; - tmpvar_22 = lessThan (tmpvar_21, _LightSplitsFar); - vec4 tmpvar_23; - tmpvar_23 = vec4(tmpvar_22).xyzw; - vec4 tmpvar_24; - tmpvar_24 = tmpvar_23; - far_5 = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25 = (near_6 * far_5); - weights_4 = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26.w = 1.0; - tmpvar_26.xyz = ((( - (sc0_11 * weights_4.x) - + - (sc1_10 * weights_4.y) - ) + (sc2_9 * weights_4.z)) + (sc3_8 * weights_4.w)).xyz; - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - coord_3 = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = texture2D (_ShadowMapTexture, coord_3.xy); - float tmpvar_29; - if ((tmpvar_28.x < coord_3.z)) { - tmpvar_29 = _LightShadowData.x; - } else { - tmpvar_29 = 1.0; - }; - float tmpvar_30; - tmpvar_30 = tmpvar_29; - shadow_2 = tmpvar_30; - return shadow_2; -} - -float Linear01Depth ( - in float z_31 -) -{ - return (1.0 / ((_ZBufferParams.x * z_31) + _ZBufferParams.y)); -} - -vec2 EncodeFloatRG ( - in float v_32 -) -{ - vec2 enc_33; - float kEncodeBit_34; - vec2 kEncodeMul_35; - vec2 tmpvar_36; - tmpvar_36 = vec2(1.0, 255.0); - kEncodeMul_35 = tmpvar_36; - float tmpvar_37; - tmpvar_37 = 0.00392157; - kEncodeBit_34 = tmpvar_37; - vec2 tmpvar_38; - tmpvar_38 = (kEncodeMul_35 * v_32); - enc_33 = tmpvar_38; - vec2 tmpvar_39; - tmpvar_39 = fract (enc_33); - vec2 tmpvar_40; - tmpvar_40 = tmpvar_39; - enc_33 = tmpvar_40; - float tmpvar_41; - tmpvar_41 = (enc_33.x - (enc_33.y * kEncodeBit_34)); - enc_33.x = tmpvar_41; - return enc_33; -} - -vec4 frag ( - in v2f i_42 -) -{ - vec4 res_43; - float shadow_44; - vec4 vpos_45; - float depth_46; - vec4 tmpvar_47; - tmpvar_47 = texture2D (_CameraDepthTexture, i_42.uv); - float tmpvar_48; - tmpvar_48 = tmpvar_47.x; - depth_46 = tmpvar_48; - float tmpvar_49; - tmpvar_49 = Linear01Depth (depth_46); - float tmpvar_50; - tmpvar_50 = tmpvar_49; - depth_46 = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51.w = 1.0; - tmpvar_51.xyz = (i_42.ray * depth_46).xyz; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - vpos_45 = tmpvar_52; - float tmpvar_53; - tmpvar_53 = unitySampleShadow (vpos_45); - float tmpvar_54; - tmpvar_54 = tmpvar_53; - shadow_44 = tmpvar_54; - float tmpvar_55; - tmpvar_55 = shadow_44; - res_43.x = tmpvar_55; - float tmpvar_56; - tmpvar_56 = 1.0; - res_43.y = vec2(tmpvar_56).y; - vec2 tmpvar_57; - tmpvar_57 = EncodeFloatRG ((1.0 - depth_46)); - vec2 tmpvar_58; - tmpvar_58 = tmpvar_57; - res_43.zw = tmpvar_58.xxxy.zw; - return res_43; -} - -void main () -{ - v2f xlt_i_59; - vec4 xl_retval_60; - vec4 tmpvar_61; - tmpvar_61 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_59.pos = tmpvar_61; - vec2 tmpvar_62; - tmpvar_62 = gl_TexCoord[0].xy; - vec2 tmpvar_63; - tmpvar_63 = tmpvar_62; - xlt_i_59.uv = tmpvar_63; - vec3 tmpvar_64; - tmpvar_64 = gl_TexCoord[1].xyz; - vec3 tmpvar_65; - tmpvar_65 = tmpvar_64; - xlt_i_59.ray = tmpvar_65; - vec4 tmpvar_66; - tmpvar_66 = frag (xlt_i_59); - vec4 tmpvar_67; - tmpvar_67 = tmpvar_66; - xl_retval_60 = tmpvar_67; - vec4 tmpvar_68; - tmpvar_68 = xl_retval_60.xyzw; - vec4 tmpvar_69; - tmpvar_69 = tmpvar_68; - gl_FragData[0] = tmpvar_69; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-out.txt index 3aff1f667..4838ce8ff 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-out.txt @@ -16,17 +16,17 @@ void main () vec4 tmpvar_3; tmpvar_3.w = 1.0; tmpvar_3.xyz = (gl_TexCoord[1].xyz * tmpvar_2); - vec4 tmpvar_4; - tmpvar_4 = (vec4(greaterThanEqual (tmpvar_3.zzzz, _LightSplitsNear)) * vec4(lessThan (tmpvar_3.zzzz, _LightSplitsFar))); + vec4 weights_4; + weights_4 = (vec4(greaterThanEqual (tmpvar_3.zzzz, _LightSplitsNear)) * vec4(lessThan (tmpvar_3.zzzz, _LightSplitsFar))); vec4 tmpvar_5; tmpvar_5.w = 1.0; tmpvar_5.xyz = ((( - ((_View2Shadow * tmpvar_3).xyz * tmpvar_4.x) + ((_View2Shadow * tmpvar_3).xyz * weights_4.x) + - ((_View2Shadow1 * tmpvar_3).xyz * tmpvar_4.y) + ((_View2Shadow1 * tmpvar_3).xyz * weights_4.y) ) + ( (_View2Shadow2 * tmpvar_3) - .xyz * tmpvar_4.z)) + ((_View2Shadow3 * tmpvar_3).xyz * tmpvar_4.w)); + .xyz * weights_4.z)) + ((_View2Shadow3 * tmpvar_3).xyz * weights_4.w)); vec4 tmpvar_6; tmpvar_6 = texture2D (_ShadowMapTexture, tmpvar_5.xy); float tmpvar_7; @@ -38,8 +38,9 @@ void main () res_1.x = tmpvar_7; res_1.y = 1.0; vec2 enc_8; + enc_8 = (vec2(1.0, 255.0) * (1.0 - tmpvar_2)); vec2 tmpvar_9; - tmpvar_9 = fract((vec2(1.0, 255.0) * (1.0 - tmpvar_2))); + tmpvar_9 = fract(enc_8); enc_8.y = tmpvar_9.y; enc_8.x = (tmpvar_9.x - (tmpvar_9.y * 0.00392157)); res_1.zw = enc_8; @@ -47,4 +48,18 @@ void main () } -// inputs: 1, stats: 30 alu 2 tex 1 flow +// stats: 30 alu 2 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [2] loc 4 +// uniforms: 8 (total size: 0) +// #0: _LightShadowData (high float) 4x1 [-1] +// #1: _LightSplitsFar (high float) 4x1 [-1] +// #2: _LightSplitsNear (high float) 4x1 [-1] +// #3: _View2Shadow (high float) 4x4 [-1] +// #4: _View2Shadow1 (high float) 4x4 [-1] +// #5: _View2Shadow2 (high float) 4x4 [-1] +// #6: _View2Shadow3 (high float) 4x4 [-1] +// #7: _ZBufferParams (high float) 4x1 [-1] +// textures: 2 +// #0: _CameraDepthTexture (high 2d) 0x0 [-1] +// #1: _ShadowMapTexture (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-ir.txt deleted file mode 100644 index 8621f8409..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-ir.txt +++ /dev/null @@ -1,408 +0,0 @@ -struct v2f { - vec4 pos; - vec4 uv; - vec3 ray; -}; -uniform sampler2D _CameraDepthTexture; -uniform sampler2D _CameraNormalsTexture; -uniform vec4 _LightColor; -uniform vec4 _LightPos; -uniform vec4 _LightPositionRange; -uniform vec4 _LightShadowData; -uniform samplerCube _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform vec4 _ProjectionParams; -uniform samplerCube _ShadowMapTexture; -uniform mat4 _View2Shadow; -uniform mat4 _ViewToCookie; -uniform vec4 _ZBufferParams; -uniform vec4 unity_LightmapFade; -float xll_saturate ( - in float x_1 -) -{ - float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -vec2 xll_saturate ( - in vec2 x_3 -) -{ - vec2 tmpvar_4; - tmpvar_4 = clamp (x_3, 0.0, 1.0); - return tmpvar_4; -} - -vec3 xll_saturate ( - in vec3 x_5 -) -{ - vec3 tmpvar_6; - tmpvar_6 = clamp (x_5, 0.0, 1.0); - return tmpvar_6; -} - -vec4 xll_saturate ( - in vec4 x_7 -) -{ - vec4 tmpvar_8; - tmpvar_8 = clamp (x_7, 0.0, 1.0); - return tmpvar_8; -} - -mat2 xll_saturate ( - in mat2 m_9 -) -{ - vec2 tmpvar_10; - tmpvar_10 = clamp (m_9[0], 0.0, 1.0); - vec2 tmpvar_11; - tmpvar_11 = clamp (m_9[1], 0.0, 1.0); - mat2 tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_10; - tmpvar_12[0] = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_12[1] = tmpvar_14; - return tmpvar_12; -} - -mat3 xll_saturate ( - in mat3 m_15 -) -{ - vec3 tmpvar_16; - tmpvar_16 = clamp (m_15[0], 0.0, 1.0); - vec3 tmpvar_17; - tmpvar_17 = clamp (m_15[1], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_15[2], 0.0, 1.0); - mat3 tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_16; - tmpvar_19[0] = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_19[1] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_19[2] = tmpvar_22; - return tmpvar_19; -} - -mat4 xll_saturate ( - in mat4 m_23 -) -{ - vec4 tmpvar_24; - tmpvar_24 = clamp (m_23[0], 0.0, 1.0); - vec4 tmpvar_25; - tmpvar_25 = clamp (m_23[1], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_23[2], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_23[3], 0.0, 1.0); - mat4 tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_24; - tmpvar_28[0] = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_28[1] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_28[2] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_28[3] = tmpvar_32; - return tmpvar_28; -} - -mat3 xll_constructMat3 ( - in mat4 m_33 -) -{ - vec3 tmpvar_34; - tmpvar_34 = m_33[0].xyz; - vec3 tmpvar_35; - tmpvar_35 = m_33[1].xyz; - vec3 tmpvar_36; - tmpvar_36 = m_33[2].xyz; - mat3 tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = tmpvar_34; - tmpvar_37[0] = tmpvar_38; - vec3 tmpvar_39; - tmpvar_39 = tmpvar_35; - tmpvar_37[1] = tmpvar_39; - vec3 tmpvar_40; - tmpvar_40 = tmpvar_36; - tmpvar_37[2] = tmpvar_40; - return tmpvar_37; -} - -float Luminance ( - in vec3 c_41 -) -{ - float tmpvar_42; - tmpvar_42 = dot (c_41, vec3(0.22, 0.707, 0.071)); - return tmpvar_42; -} - -float Linear01Depth ( - in float z_43 -) -{ - return (1.0 / ((_ZBufferParams.x * z_43) + _ZBufferParams.y)); -} - -float DecodeFloatRGBA ( - in vec4 enc_44 -) -{ - vec4 kDecodeDot_45; - vec4 tmpvar_46; - tmpvar_46 = vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09); - kDecodeDot_45 = tmpvar_46; - float tmpvar_47; - tmpvar_47 = dot (enc_44, kDecodeDot_45); - return tmpvar_47; -} - -float SampleCubeDistance ( - in vec3 vec_48 -) -{ - vec4 packDist_49; - vec4 tmpvar_50; - tmpvar_50 = textureCube (_ShadowMapTexture, vec_48); - vec4 tmpvar_51; - tmpvar_51 = tmpvar_50; - packDist_49 = tmpvar_51; - float tmpvar_52; - tmpvar_52 = DecodeFloatRGBA (packDist_49); - return tmpvar_52; -} - -float unitySampleShadow ( - in vec3 vec_53, - in float mydist_54 -) -{ - float dist_55; - float tmpvar_56; - tmpvar_56 = SampleCubeDistance (vec_53); - float tmpvar_57; - tmpvar_57 = tmpvar_56; - dist_55 = tmpvar_57; - float tmpvar_58; - if ((dist_55 < mydist_54)) { - tmpvar_58 = _LightShadowData.x; - } else { - tmpvar_58 = 1.0; - }; - return tmpvar_58; -} - -float ComputeShadow ( - in vec3 vec_59, - in vec2 uv_60 -) -{ - float mydist_61; - float fade_62; - float tmpvar_63; - tmpvar_63 = ((vec_59.z * _LightShadowData.z) + _LightShadowData.w); - fade_62 = tmpvar_63; - float tmpvar_64; - tmpvar_64 = xll_saturate (fade_62); - float tmpvar_65; - tmpvar_65 = tmpvar_64; - fade_62 = tmpvar_65; - mat3 tmpvar_66; - tmpvar_66 = xll_constructMat3 (_View2Shadow); - vec3 tmpvar_67; - tmpvar_67 = (tmpvar_66 * vec_59); - vec_59 = tmpvar_67; - float tmpvar_68; - tmpvar_68 = length (vec_59); - float tmpvar_69; - tmpvar_69 = (tmpvar_68 * _LightPositionRange.w); - mydist_61 = tmpvar_69; - float tmpvar_70; - tmpvar_70 = (mydist_61 * 0.97); - mydist_61 = tmpvar_70; - float tmpvar_71; - tmpvar_71 = unitySampleShadow (vec_59, mydist_61); - return tmpvar_71; - return 1.0; -} - -vec4 frag ( - in v2f i_72 -) -{ - float fade_73; - vec4 res_74; - float spec_75; - vec3 h_76; - float diff_77; - float atten_78; - float att_79; - vec3 lightDir_80; - vec3 tolight_81; - vec3 vpos_82; - float depth_83; - vec3 normal_84; - vec4 nspec_85; - vec2 uv_86; - vec3 tmpvar_87; - tmpvar_87 = (i_72.ray * (_ProjectionParams.z / i_72.ray.z)); - i_72.ray = tmpvar_87; - vec2 tmpvar_88; - tmpvar_88 = (i_72.uv.xy / i_72.uv.w); - uv_86 = tmpvar_88; - vec4 tmpvar_89; - tmpvar_89 = texture2D (_CameraNormalsTexture, uv_86); - vec4 tmpvar_90; - tmpvar_90 = tmpvar_89; - nspec_85 = tmpvar_90; - vec3 tmpvar_91; - tmpvar_91 = ((nspec_85.xyz * 2.0) - 1.0); - normal_84 = tmpvar_91; - vec3 tmpvar_92; - tmpvar_92 = normalize (normal_84); - vec3 tmpvar_93; - tmpvar_93 = tmpvar_92; - normal_84 = tmpvar_93; - vec4 tmpvar_94; - tmpvar_94 = texture2D (_CameraDepthTexture, uv_86); - float tmpvar_95; - tmpvar_95 = tmpvar_94.x; - depth_83 = tmpvar_95; - float tmpvar_96; - tmpvar_96 = Linear01Depth (depth_83); - float tmpvar_97; - tmpvar_97 = tmpvar_96; - depth_83 = tmpvar_97; - vec3 tmpvar_98; - tmpvar_98 = (i_72.ray * depth_83); - vpos_82 = tmpvar_98; - vec3 tmpvar_99; - tmpvar_99 = (_LightPos.xyz - vpos_82); - tolight_81 = tmpvar_99; - vec3 tmpvar_100; - tmpvar_100 = normalize (tolight_81); - vec3 tmpvar_101; - tmpvar_101 = tmpvar_100; - lightDir_80 = tmpvar_101; - float tmpvar_102; - tmpvar_102 = dot (tolight_81, tolight_81); - float tmpvar_103; - tmpvar_103 = (tmpvar_102 * _LightPos.w); - att_79 = tmpvar_103; - vec2 tmpvar_104; - tmpvar_104 = vec2(att_79); - vec2 tmpvar_105; - tmpvar_105 = tmpvar_104.xy; - vec4 tmpvar_106; - tmpvar_106 = texture2D (_LightTextureB0, tmpvar_105); - float tmpvar_107; - tmpvar_107 = tmpvar_106.w; - atten_78 = tmpvar_107; - float tmpvar_108; - tmpvar_108 = ComputeShadow (-(tolight_81), uv_86); - float tmpvar_109; - tmpvar_109 = (atten_78 * tmpvar_108); - atten_78 = tmpvar_109; - vec4 tmpvar_110; - tmpvar_110.w = 1.0; - tmpvar_110.xyz = vpos_82.xyz; - vec4 tmpvar_111; - tmpvar_111 = textureCube (_LightTexture0, (_ViewToCookie * tmpvar_110).xyz); - float tmpvar_112; - tmpvar_112 = (atten_78 * tmpvar_111.w); - atten_78 = tmpvar_112; - float tmpvar_113; - tmpvar_113 = dot (lightDir_80, normal_84); - float tmpvar_114; - tmpvar_114 = max (0.0, tmpvar_113); - float tmpvar_115; - tmpvar_115 = tmpvar_114; - diff_77 = tmpvar_115; - vec3 tmpvar_116; - tmpvar_116 = normalize (vpos_82); - vec3 tmpvar_117; - tmpvar_117 = normalize ((lightDir_80 - tmpvar_116)); - vec3 tmpvar_118; - tmpvar_118 = tmpvar_117; - h_76 = tmpvar_118; - float tmpvar_119; - tmpvar_119 = dot (h_76, normal_84); - float tmpvar_120; - tmpvar_120 = max (0.0, tmpvar_119); - float tmpvar_121; - tmpvar_121 = pow (tmpvar_120, (nspec_85.w * 128.0)); - float tmpvar_122; - tmpvar_122 = tmpvar_121; - spec_75 = tmpvar_122; - float tmpvar_123; - tmpvar_123 = xll_saturate (atten_78); - float tmpvar_124; - tmpvar_124 = (spec_75 * tmpvar_123); - spec_75 = tmpvar_124; - vec3 tmpvar_125; - tmpvar_125 = (_LightColor.xyz * (diff_77 * atten_78)); - res_74.xyz = tmpvar_125.xyz.xyz; - float tmpvar_126; - tmpvar_126 = Luminance (_LightColor.xyz); - float tmpvar_127; - tmpvar_127 = (spec_75 * tmpvar_126); - res_74.w = vec4(tmpvar_127).w; - float tmpvar_128; - tmpvar_128 = ((vpos_82.z * unity_LightmapFade.z) + unity_LightmapFade.w); - fade_73 = tmpvar_128; - float tmpvar_129; - tmpvar_129 = xll_saturate ((1.0 - fade_73)); - vec4 tmpvar_130; - tmpvar_130 = (res_74 * tmpvar_129); - res_74 = tmpvar_130; - vec4 tmpvar_131; - tmpvar_131 = exp2 (-(res_74)); - return tmpvar_131; -} - -void main () -{ - v2f xlt_i_132; - vec4 xl_retval_133; - vec4 tmpvar_134; - tmpvar_134 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_132.pos = tmpvar_134; - vec4 tmpvar_135; - tmpvar_135 = gl_TexCoord[0].xyzw; - vec4 tmpvar_136; - tmpvar_136 = tmpvar_135; - xlt_i_132.uv = tmpvar_136; - vec3 tmpvar_137; - tmpvar_137 = gl_TexCoord[1].xyz; - vec3 tmpvar_138; - tmpvar_138 = tmpvar_137; - xlt_i_132.ray = tmpvar_138; - vec4 tmpvar_139; - tmpvar_139 = frag (xlt_i_132); - vec4 tmpvar_140; - tmpvar_140 = tmpvar_139; - xl_retval_133 = tmpvar_140; - vec4 tmpvar_141; - tmpvar_141 = xl_retval_133.xyzw; - vec4 tmpvar_142; - tmpvar_142 = tmpvar_141; - gl_FragData[0] = tmpvar_142; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-out.txt index b62383c3c..44f685c80 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-out.txt @@ -21,64 +21,77 @@ void main () vec4 res_3; float atten_4; vec3 lightDir_5; - vec3 normal_6; - vec2 tmpvar_7; - tmpvar_7 = (tmpvar_1.xy / tmpvar_1.w); - vec4 tmpvar_8; - tmpvar_8 = texture2D (_CameraNormalsTexture, tmpvar_7); - normal_6 = normalize(((tmpvar_8.xyz * 2.0) - 1.0)); - vec3 tmpvar_9; - tmpvar_9 = ((tmpvar_2 * (_ProjectionParams.z / tmpvar_2.z)) * (1.0/(( - (_ZBufferParams.x * texture2D (_CameraDepthTexture, tmpvar_7).x) + vec3 tolight_6; + vec3 vpos_7; + vec3 normal_8; + vec2 uv_9; + uv_9 = (tmpvar_1.xy / tmpvar_1.w); + vec4 tmpvar_10; + tmpvar_10 = texture2D (_CameraNormalsTexture, uv_9); + normal_8 = ((tmpvar_10.xyz * 2.0) - 1.0); + normal_8 = normalize(normal_8); + vpos_7 = ((tmpvar_2 * (_ProjectionParams.z / tmpvar_2.z)) * (1.0/(( + (_ZBufferParams.x * texture2D (_CameraDepthTexture, uv_9).x) + _ZBufferParams.y)))); - vec3 tmpvar_10; - tmpvar_10 = (_LightPos.xyz - tmpvar_9); - lightDir_5 = normalize(tmpvar_10); - atten_4 = texture2D (_LightTextureB0, vec2((dot (tmpvar_10, tmpvar_10) * _LightPos.w))).w; + tolight_6 = (_LightPos.xyz - vpos_7); + lightDir_5 = normalize(tolight_6); + atten_4 = texture2D (_LightTextureB0, vec2((dot (tolight_6, tolight_6) * _LightPos.w))).w; vec3 vec_11; - vec_11 = -(tmpvar_10); - mat3 tmpvar_12; - tmpvar_12[0] = _View2Shadow[0].xyz; - tmpvar_12[1] = _View2Shadow[1].xyz; - tmpvar_12[2] = _View2Shadow[2].xyz; - vec3 tmpvar_13; - tmpvar_13 = (tmpvar_12 * vec_11); - vec_11 = tmpvar_13; + vec_11 = -(tolight_6); + float mydist_12; + mat3 tmpvar_13; + tmpvar_13[0] = _View2Shadow[0].xyz; + tmpvar_13[1] = _View2Shadow[1].xyz; + tmpvar_13[2] = _View2Shadow[2].xyz; + vec_11 = (tmpvar_13 * vec_11); + mydist_12 = (sqrt(dot (vec_11, vec_11)) * _LightPositionRange.w); + mydist_12 = (mydist_12 * 0.97); float tmpvar_14; - tmpvar_14 = ((sqrt( - dot (tmpvar_13, tmpvar_13) - ) * _LightPositionRange.w) * 0.97); + tmpvar_14 = dot (textureCube (_ShadowMapTexture, vec_11), vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); float tmpvar_15; - tmpvar_15 = dot (textureCube (_ShadowMapTexture, tmpvar_13), vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); - float tmpvar_16; - if ((tmpvar_15 < tmpvar_14)) { - tmpvar_16 = _LightShadowData.x; + if ((tmpvar_14 < mydist_12)) { + tmpvar_15 = _LightShadowData.x; } else { - tmpvar_16 = 1.0; + tmpvar_15 = 1.0; }; - vec4 tmpvar_17; - tmpvar_17.w = 1.0; - tmpvar_17.xyz = tmpvar_9; - float tmpvar_18; - tmpvar_18 = ((atten_4 * tmpvar_16) * textureCube (_LightTexture0, (_ViewToCookie * tmpvar_17).xyz).w); - atten_4 = tmpvar_18; + atten_4 = (atten_4 * tmpvar_15); + vec4 tmpvar_16; + tmpvar_16.w = 1.0; + tmpvar_16.xyz = vpos_7; + atten_4 = (atten_4 * textureCube (_LightTexture0, (_ViewToCookie * tmpvar_16).xyz).w); res_3.xyz = (_LightColor.xyz * (max (0.0, - dot (lightDir_5, normal_6) - ) * tmpvar_18)); + dot (lightDir_5, normal_8) + ) * atten_4)); res_3.w = ((pow ( max (0.0, dot (normalize((lightDir_5 - - normalize(tmpvar_9) - )), normal_6)) + normalize(vpos_7) + )), normal_8)) , - (tmpvar_8.w * 128.0) - ) * clamp (tmpvar_18, 0.0, 1.0)) * dot (_LightColor.xyz, vec3(0.22, 0.707, 0.071))); - vec4 tmpvar_19; - tmpvar_19 = (res_3 * clamp ((1.0 - - ((tmpvar_9.z * unity_LightmapFade.z) + unity_LightmapFade.w) + (tmpvar_10.w * 128.0) + ) * clamp (atten_4, 0.0, 1.0)) * dot (_LightColor.xyz, vec3(0.22, 0.707, 0.071))); + res_3 = (res_3 * clamp ((1.0 - + ((vpos_7.z * unity_LightmapFade.z) + unity_LightmapFade.w) ), 0.0, 1.0)); - res_3 = tmpvar_19; - gl_FragData[0] = exp2(-(tmpvar_19)); + gl_FragData[0] = exp2(-(res_3)); } -// inputs: 1, stats: 49 alu 5 tex 1 flow +// stats: 49 alu 5 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [2] loc 4 +// uniforms: 9 (total size: 0) +// #0: _LightColor (high float) 4x1 [-1] +// #1: _LightPos (high float) 4x1 [-1] +// #2: _LightPositionRange (high float) 4x1 [-1] +// #3: _LightShadowData (high float) 4x1 [-1] +// #4: _ProjectionParams (high float) 4x1 [-1] +// #5: _View2Shadow (high float) 4x4 [-1] +// #6: _ViewToCookie (high float) 4x4 [-1] +// #7: _ZBufferParams (high float) 4x1 [-1] +// #8: unity_LightmapFade (high float) 4x1 [-1] +// textures: 5 +// #0: _CameraDepthTexture (high 2d) 0x0 [-1] +// #1: _CameraNormalsTexture (high 2d) 0x0 [-1] +// #2: _LightTexture0 (high cube) 0x0 [-1] +// #3: _LightTextureB0 (high 2d) 0x0 [-1] +// #4: _ShadowMapTexture (high cube) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-ir.txt deleted file mode 100644 index c217c02a7..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-ir.txt +++ /dev/null @@ -1,75 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; - vec2 uvg; - vec2 uvs; -}; -uniform sampler2D _GrainTex; -uniform vec4 _Intensity; -uniform sampler2D _MainTex; -uniform sampler2D _ScratchTex; -vec4 frag ( - in v2f i_1 -) -{ - vec3 scratch_2; - vec3 grain_3; - vec4 col_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, i_1.uv); - vec4 tmpvar_6; - tmpvar_6 = tmpvar_5; - col_4 = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7 = texture2D (_GrainTex, i_1.uvg); - vec3 tmpvar_8; - tmpvar_8 = ((tmpvar_7.xyz * 2.0) - 1.0); - grain_3 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = (col_4.xyz + (grain_3 * _Intensity.x)); - col_4.xyz = tmpvar_9.xyz.xyz; - vec4 tmpvar_10; - tmpvar_10 = texture2D (_ScratchTex, i_1.uvs); - vec3 tmpvar_11; - tmpvar_11 = ((tmpvar_10.xyz * 2.0) - 1.0); - scratch_2 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = (col_4.xyz + (scratch_2 * _Intensity.y)); - col_4.xyz = tmpvar_12.xyz.xyz; - return col_4; -} - -void main () -{ - v2f xlt_i_13; - vec4 xl_retval_14; - vec4 tmpvar_15; - tmpvar_15 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_13.pos = tmpvar_15; - vec2 tmpvar_16; - tmpvar_16 = gl_TexCoord[0].xy; - vec2 tmpvar_17; - tmpvar_17 = tmpvar_16; - xlt_i_13.uv = tmpvar_17; - vec2 tmpvar_18; - tmpvar_18 = gl_TexCoord[1].xy; - vec2 tmpvar_19; - tmpvar_19 = tmpvar_18; - xlt_i_13.uvg = tmpvar_19; - vec2 tmpvar_20; - tmpvar_20 = gl_TexCoord[2].xy; - vec2 tmpvar_21; - tmpvar_21 = tmpvar_20; - xlt_i_13.uvs = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22 = frag (xlt_i_13); - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - xl_retval_14 = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = xl_retval_14.xyzw; - vec4 tmpvar_25; - tmpvar_25 = tmpvar_24; - gl_FragData[0] = tmpvar_25; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-out.txt index ca51394ab..c1b7db077 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-out.txt @@ -18,4 +18,12 @@ void main () } -// inputs: 1, stats: 8 alu 3 tex 0 flow +// stats: 8 alu 3 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 1 (total size: 0) +// #0: _Intensity (high float) 4x1 [-1] +// textures: 3 +// #0: _GrainTex (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] +// #2: _ScratchTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-ir.txt deleted file mode 100644 index 15d6b1ab3..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-ir.txt +++ /dev/null @@ -1,100 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; - vec2 uvg; - vec2 uvs; -}; -uniform sampler2D _GrainTex; -uniform vec4 _Intensity; -uniform sampler2D _MainTex; -uniform sampler2D _ScratchTex; -vec4 frag ( - in v2f i_1 -) -{ - vec3 scratch_2; - vec3 grain_3; - vec3 yuv_4; - vec4 col_5; - vec4 tmpvar_6; - tmpvar_6 = texture2D (_MainTex, i_1.uv); - vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - col_5 = tmpvar_7; - float tmpvar_8; - tmpvar_8 = dot (col_5.xyz, vec3(0.299, 0.587, 0.114)); - float tmpvar_9; - tmpvar_9 = tmpvar_8; - yuv_4.x = tmpvar_9; - float tmpvar_10; - tmpvar_10 = ((col_5.z - yuv_4.x) * 0.492); - yuv_4.y = vec2(tmpvar_10).y; - float tmpvar_11; - tmpvar_11 = ((col_5.x - yuv_4.x) * 0.877); - yuv_4.z = vec3(tmpvar_11).z; - vec4 tmpvar_12; - tmpvar_12 = texture2D (_GrainTex, i_1.uvg); - vec3 tmpvar_13; - tmpvar_13 = ((tmpvar_12.xyz * 2.0) - 1.0); - grain_3 = tmpvar_13; - vec3 tmpvar_14; - tmpvar_14 = (yuv_4.xyz + (grain_3 * _Intensity.x)); - yuv_4 = tmpvar_14.xyz.xyz; - float tmpvar_15; - tmpvar_15 = ((yuv_4.z * 1.14) + yuv_4.x); - col_5.x = tmpvar_15; - float tmpvar_16; - tmpvar_16 = (((yuv_4.z * - -(0.581) - ) + (yuv_4.y * - -(0.395) - )) + yuv_4.x); - col_5.y = vec2(tmpvar_16).y; - float tmpvar_17; - tmpvar_17 = ((yuv_4.y * 2.032) + yuv_4.x); - col_5.z = vec3(tmpvar_17).z; - vec4 tmpvar_18; - tmpvar_18 = texture2D (_ScratchTex, i_1.uvs); - vec3 tmpvar_19; - tmpvar_19 = ((tmpvar_18.xyz * 2.0) - 1.0); - scratch_2 = tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = (col_5.xyz + (scratch_2 * _Intensity.y)); - col_5.xyz = tmpvar_20.xyz.xyz; - return col_5; -} - -void main () -{ - v2f xlt_i_21; - vec4 xl_retval_22; - vec4 tmpvar_23; - tmpvar_23 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_21.pos = tmpvar_23; - vec2 tmpvar_24; - tmpvar_24 = gl_TexCoord[0].xy; - vec2 tmpvar_25; - tmpvar_25 = tmpvar_24; - xlt_i_21.uv = tmpvar_25; - vec2 tmpvar_26; - tmpvar_26 = gl_TexCoord[1].xy; - vec2 tmpvar_27; - tmpvar_27 = tmpvar_26; - xlt_i_21.uvg = tmpvar_27; - vec2 tmpvar_28; - tmpvar_28 = gl_TexCoord[2].xy; - vec2 tmpvar_29; - tmpvar_29 = tmpvar_28; - xlt_i_21.uvs = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = frag (xlt_i_21); - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - xl_retval_22 = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = xl_retval_22.xyzw; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - gl_FragData[0] = tmpvar_33; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-out.txt index adb3c03cb..409dac97e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-out.txt @@ -25,4 +25,12 @@ void main () } -// inputs: 1, stats: 21 alu 3 tex 0 flow +// stats: 21 alu 3 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 1 (total size: 0) +// #0: _Intensity (high float) 4x1 [-1] +// textures: 3 +// #0: _GrainTex (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] +// #2: _ScratchTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Sepiatone_Effect-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Sepiatone_Effect-ir.txt deleted file mode 100644 index 272fffcf2..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Sepiatone_Effect-ir.txt +++ /dev/null @@ -1,59 +0,0 @@ -struct v2f_img { - vec4 pos; - vec2 uv; -}; -uniform sampler2D _MainTex; -vec4 frag ( - in v2f_img i_1 -) -{ - vec4 xlat_var_output_2; - vec4 sepiaConvert_3; - float Y_4; - vec4 original_5; - vec4 tmpvar_6; - tmpvar_6 = vec4(0.191, -0.054, -0.221, 0.0); - sepiaConvert_3 = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7 = texture2D (_MainTex, i_1.uv); - vec4 tmpvar_8; - tmpvar_8 = tmpvar_7; - original_5 = tmpvar_8; - float tmpvar_9; - tmpvar_9 = dot (vec3(0.299, 0.587, 0.114), original_5.xyz); - float tmpvar_10; - tmpvar_10 = tmpvar_9; - Y_4 = tmpvar_10; - vec4 tmpvar_11; - tmpvar_11 = (sepiaConvert_3 + Y_4); - xlat_var_output_2 = tmpvar_11; - float tmpvar_12; - tmpvar_12 = original_5.w; - xlat_var_output_2.w = vec4(tmpvar_12).w; - return xlat_var_output_2; -} - -void main () -{ - v2f_img xlt_i_13; - vec4 xl_retval_14; - vec4 tmpvar_15; - tmpvar_15 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_13.pos = tmpvar_15; - vec2 tmpvar_16; - tmpvar_16 = gl_TexCoord[0].xy; - vec2 tmpvar_17; - tmpvar_17 = tmpvar_16; - xlt_i_13.uv = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = frag (xlt_i_13); - vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - xl_retval_14 = tmpvar_19; - vec4 tmpvar_20; - tmpvar_20 = xl_retval_14.xyzw; - vec4 tmpvar_21; - tmpvar_21 = tmpvar_20; - gl_FragData[0] = tmpvar_21; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Sepiatone_Effect-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Sepiatone_Effect-out.txt index de268818f..79f2064e7 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Sepiatone_Effect-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Sepiatone_Effect-out.txt @@ -10,4 +10,8 @@ void main () } -// inputs: 1, stats: 2 alu 1 tex 0 flow +// stats: 2 alu 1 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-ir.txt deleted file mode 100644 index d3477054e..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-ir.txt +++ /dev/null @@ -1,217 +0,0 @@ -struct v2f_img { - vec4 pos; - vec2 uv; -}; -uniform vec4 _BlurOffsets[8]; -uniform sampler2D _MainTex; -uniform vec4 unity_ShadowBlurParams; -float xll_saturate ( - in float x_1 -) -{ - float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -vec2 xll_saturate ( - in vec2 x_3 -) -{ - vec2 tmpvar_4; - tmpvar_4 = clamp (x_3, 0.0, 1.0); - return tmpvar_4; -} - -vec3 xll_saturate ( - in vec3 x_5 -) -{ - vec3 tmpvar_6; - tmpvar_6 = clamp (x_5, 0.0, 1.0); - return tmpvar_6; -} - -vec4 xll_saturate ( - in vec4 x_7 -) -{ - vec4 tmpvar_8; - tmpvar_8 = clamp (x_7, 0.0, 1.0); - return tmpvar_8; -} - -mat2 xll_saturate ( - in mat2 m_9 -) -{ - vec2 tmpvar_10; - tmpvar_10 = clamp (m_9[0], 0.0, 1.0); - vec2 tmpvar_11; - tmpvar_11 = clamp (m_9[1], 0.0, 1.0); - mat2 tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_10; - tmpvar_12[0] = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_12[1] = tmpvar_14; - return tmpvar_12; -} - -mat3 xll_saturate ( - in mat3 m_15 -) -{ - vec3 tmpvar_16; - tmpvar_16 = clamp (m_15[0], 0.0, 1.0); - vec3 tmpvar_17; - tmpvar_17 = clamp (m_15[1], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_15[2], 0.0, 1.0); - mat3 tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_16; - tmpvar_19[0] = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_19[1] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_19[2] = tmpvar_22; - return tmpvar_19; -} - -mat4 xll_saturate ( - in mat4 m_23 -) -{ - vec4 tmpvar_24; - tmpvar_24 = clamp (m_23[0], 0.0, 1.0); - vec4 tmpvar_25; - tmpvar_25 = clamp (m_23[1], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_23[2], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_23[3], 0.0, 1.0); - mat4 tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_24; - tmpvar_28[0] = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_28[1] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_28[2] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_28[3] = tmpvar_32; - return tmpvar_28; -} - -vec4 frag ( - in v2f_img i_33 -) -{ - float shadow_34; - float diff_35; - float sampleDist_36; - vec4 sample_37; - int i_1_38; - float diffTolerance_39; - float radius_40; - float dist_41; - vec4 mask_42; - vec4 coord_43; - int tmpvar_44; - tmpvar_44 = 0; - i_1_38 = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45.zw = vec2(0.0, 0.0); - tmpvar_45.xy = i_33.uv.xy; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - coord_43 = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = texture2D (_MainTex, coord_43.xy); - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - mask_42 = tmpvar_48; - float tmpvar_49; - tmpvar_49 = (mask_42.z + (mask_42.w / 255.0)); - dist_41 = tmpvar_49; - float tmpvar_50; - tmpvar_50 = xll_saturate ((unity_ShadowBlurParams.y / (1.0 - dist_41))); - float tmpvar_51; - tmpvar_51 = tmpvar_50; - radius_40 = tmpvar_51; - float tmpvar_52; - tmpvar_52 = unity_ShadowBlurParams.x; - diffTolerance_39 = tmpvar_52; - vec2 tmpvar_53; - tmpvar_53 = (mask_42.xy * diffTolerance_39); - mask_42.xy = tmpvar_53.xy.xy; - while (true) { - if (!((i_1_38 < 8))) { - break; - }; - vec4 tmpvar_54; - tmpvar_54 = texture2D (_MainTex, (coord_43 + (radius_40 * _BlurOffsets[i_1_38])).xy); - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - sample_37 = tmpvar_55; - float tmpvar_56; - tmpvar_56 = (sample_37.z + (sample_37.w / 255.0)); - sampleDist_36 = tmpvar_56; - float tmpvar_57; - tmpvar_57 = (dist_41 - sampleDist_36); - diff_35 = tmpvar_57; - float tmpvar_58; - tmpvar_58 = abs (diff_35); - float tmpvar_59; - tmpvar_59 = xll_saturate ((diffTolerance_39 - tmpvar_58)); - float tmpvar_60; - tmpvar_60 = tmpvar_59; - diff_35 = tmpvar_60; - vec2 tmpvar_61; - tmpvar_61 = (mask_42.xy + (diff_35 * sample_37.xy)); - mask_42.xy = tmpvar_61.xy.xy; - int _post_incdec_tmp_62; - _post_incdec_tmp_62 = i_1_38; - int tmpvar_63; - tmpvar_63 = (i_1_38 + 1); - i_1_38 = tmpvar_63; - }; - float tmpvar_64; - tmpvar_64 = (mask_42.x / mask_42.y); - shadow_34 = tmpvar_64; - vec4 tmpvar_65; - tmpvar_65 = vec4(shadow_34); - return tmpvar_65; -} - -void main () -{ - v2f_img xlt_i_66; - vec4 xl_retval_67; - vec4 tmpvar_68; - tmpvar_68 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_66.pos = tmpvar_68; - vec2 tmpvar_69; - tmpvar_69 = gl_TexCoord[0].xy; - vec2 tmpvar_70; - tmpvar_70 = tmpvar_69; - xlt_i_66.uv = tmpvar_70; - vec4 tmpvar_71; - tmpvar_71 = frag (xlt_i_66); - vec4 tmpvar_72; - tmpvar_72 = tmpvar_71; - xl_retval_67 = tmpvar_72; - vec4 tmpvar_73; - tmpvar_73 = xl_retval_67.xyzw; - vec4 tmpvar_74; - tmpvar_74 = tmpvar_73; - gl_FragData[0] = tmpvar_74; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-out.txt index 93384e27f..dd66db84c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-out.txt @@ -3,76 +3,77 @@ uniform sampler2D _MainTex; uniform vec4 unity_ShadowBlurParams; void main () { - float radius_1; - vec4 mask_2; - vec4 tmpvar_3; - tmpvar_3.zw = vec2(0.0, 0.0); - tmpvar_3.xy = gl_TexCoord[0].xy; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, tmpvar_3.xy); - mask_2.zw = tmpvar_4.zw; - float tmpvar_5; - tmpvar_5 = (tmpvar_4.z + (tmpvar_4.w / 255.0)); - radius_1 = clamp ((unity_ShadowBlurParams.y / (1.0 - tmpvar_5)), 0.0, 1.0); - mask_2.xy = (tmpvar_4.xy * unity_ShadowBlurParams.x); + float diff_1; + float radius_2; + float dist_3; + vec4 mask_4; + vec4 tmpvar_5; + tmpvar_5.zw = vec2(0.0, 0.0); + tmpvar_5.xy = gl_TexCoord[0].xy; vec4 tmpvar_6; - tmpvar_6 = texture2D (_MainTex, (tmpvar_3 + (radius_1 * _BlurOffsets[0])).xy); - mask_2.xy = (mask_2.xy + (clamp ( - (unity_ShadowBlurParams.x - abs((tmpvar_5 - (tmpvar_6.z + - (tmpvar_6.w / 255.0) - )))) - , 0.0, 1.0) * tmpvar_6.xy)); + tmpvar_6 = texture2D (_MainTex, tmpvar_5.xy); + mask_4.zw = tmpvar_6.zw; + dist_3 = (tmpvar_6.z + (tmpvar_6.w / 255.0)); + radius_2 = clamp ((unity_ShadowBlurParams.y / (1.0 - dist_3)), 0.0, 1.0); + mask_4.xy = (tmpvar_6.xy * unity_ShadowBlurParams.x); vec4 tmpvar_7; - tmpvar_7 = texture2D (_MainTex, (tmpvar_3 + (radius_1 * _BlurOffsets[1])).xy); - mask_2.xy = (mask_2.xy + (clamp ( - (unity_ShadowBlurParams.x - abs((tmpvar_5 - (tmpvar_7.z + - (tmpvar_7.w / 255.0) - )))) + tmpvar_7 = texture2D (_MainTex, (tmpvar_5 + (radius_2 * _BlurOffsets[0])).xy); + diff_1 = (dist_3 - (tmpvar_7.z + (tmpvar_7.w / 255.0))); + mask_4.xy = (mask_4.xy + (clamp ( + (unity_ShadowBlurParams.x - abs(diff_1)) , 0.0, 1.0) * tmpvar_7.xy)); vec4 tmpvar_8; - tmpvar_8 = texture2D (_MainTex, (tmpvar_3 + (radius_1 * _BlurOffsets[2])).xy); - mask_2.xy = (mask_2.xy + (clamp ( - (unity_ShadowBlurParams.x - abs((tmpvar_5 - (tmpvar_8.z + - (tmpvar_8.w / 255.0) - )))) + tmpvar_8 = texture2D (_MainTex, (tmpvar_5 + (radius_2 * _BlurOffsets[1])).xy); + diff_1 = (dist_3 - (tmpvar_8.z + (tmpvar_8.w / 255.0))); + mask_4.xy = (mask_4.xy + (clamp ( + (unity_ShadowBlurParams.x - abs(diff_1)) , 0.0, 1.0) * tmpvar_8.xy)); vec4 tmpvar_9; - tmpvar_9 = texture2D (_MainTex, (tmpvar_3 + (radius_1 * _BlurOffsets[3])).xy); - mask_2.xy = (mask_2.xy + (clamp ( - (unity_ShadowBlurParams.x - abs((tmpvar_5 - (tmpvar_9.z + - (tmpvar_9.w / 255.0) - )))) + tmpvar_9 = texture2D (_MainTex, (tmpvar_5 + (radius_2 * _BlurOffsets[2])).xy); + diff_1 = (dist_3 - (tmpvar_9.z + (tmpvar_9.w / 255.0))); + mask_4.xy = (mask_4.xy + (clamp ( + (unity_ShadowBlurParams.x - abs(diff_1)) , 0.0, 1.0) * tmpvar_9.xy)); vec4 tmpvar_10; - tmpvar_10 = texture2D (_MainTex, (tmpvar_3 + (radius_1 * _BlurOffsets[4])).xy); - mask_2.xy = (mask_2.xy + (clamp ( - (unity_ShadowBlurParams.x - abs((tmpvar_5 - (tmpvar_10.z + - (tmpvar_10.w / 255.0) - )))) + tmpvar_10 = texture2D (_MainTex, (tmpvar_5 + (radius_2 * _BlurOffsets[3])).xy); + diff_1 = (dist_3 - (tmpvar_10.z + (tmpvar_10.w / 255.0))); + mask_4.xy = (mask_4.xy + (clamp ( + (unity_ShadowBlurParams.x - abs(diff_1)) , 0.0, 1.0) * tmpvar_10.xy)); vec4 tmpvar_11; - tmpvar_11 = texture2D (_MainTex, (tmpvar_3 + (radius_1 * _BlurOffsets[5])).xy); - mask_2.xy = (mask_2.xy + (clamp ( - (unity_ShadowBlurParams.x - abs((tmpvar_5 - (tmpvar_11.z + - (tmpvar_11.w / 255.0) - )))) + tmpvar_11 = texture2D (_MainTex, (tmpvar_5 + (radius_2 * _BlurOffsets[4])).xy); + diff_1 = (dist_3 - (tmpvar_11.z + (tmpvar_11.w / 255.0))); + mask_4.xy = (mask_4.xy + (clamp ( + (unity_ShadowBlurParams.x - abs(diff_1)) , 0.0, 1.0) * tmpvar_11.xy)); vec4 tmpvar_12; - tmpvar_12 = texture2D (_MainTex, (tmpvar_3 + (radius_1 * _BlurOffsets[6])).xy); - mask_2.xy = (mask_2.xy + (clamp ( - (unity_ShadowBlurParams.x - abs((tmpvar_5 - (tmpvar_12.z + - (tmpvar_12.w / 255.0) - )))) + tmpvar_12 = texture2D (_MainTex, (tmpvar_5 + (radius_2 * _BlurOffsets[5])).xy); + diff_1 = (dist_3 - (tmpvar_12.z + (tmpvar_12.w / 255.0))); + mask_4.xy = (mask_4.xy + (clamp ( + (unity_ShadowBlurParams.x - abs(diff_1)) , 0.0, 1.0) * tmpvar_12.xy)); vec4 tmpvar_13; - tmpvar_13 = texture2D (_MainTex, (tmpvar_3 + (radius_1 * _BlurOffsets[7])).xy); - mask_2.xy = (mask_2.xy + (clamp ( - (unity_ShadowBlurParams.x - abs((tmpvar_5 - (tmpvar_13.z + - (tmpvar_13.w / 255.0) - )))) + tmpvar_13 = texture2D (_MainTex, (tmpvar_5 + (radius_2 * _BlurOffsets[6])).xy); + diff_1 = (dist_3 - (tmpvar_13.z + (tmpvar_13.w / 255.0))); + mask_4.xy = (mask_4.xy + (clamp ( + (unity_ShadowBlurParams.x - abs(diff_1)) , 0.0, 1.0) * tmpvar_13.xy)); - gl_FragData[0] = vec4((mask_2.x / mask_2.y)); + vec4 tmpvar_14; + tmpvar_14 = texture2D (_MainTex, (tmpvar_5 + (radius_2 * _BlurOffsets[7])).xy); + diff_1 = (dist_3 - (tmpvar_14.z + (tmpvar_14.w / 255.0))); + float tmpvar_15; + tmpvar_15 = clamp ((unity_ShadowBlurParams.x - abs(diff_1)), 0.0, 1.0); + diff_1 = tmpvar_15; + mask_4.xy = (mask_4.xy + (tmpvar_15 * tmpvar_14.xy)); + gl_FragData[0] = vec4((mask_4.x / mask_4.y)); } -// inputs: 1, stats: 88 alu 9 tex 0 flow +// stats: 88 alu 9 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// uniforms: 2 (total size: 0) +// #0: _BlurOffsets (high float) 4x1 [8] +// #1: unity_ShadowBlurParams (high float) 4x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-ir.txt deleted file mode 100644 index 1df8f1328..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-ir.txt +++ /dev/null @@ -1,132 +0,0 @@ -struct v2f_img { - vec4 pos; - vec2 uv; -}; -uniform sampler2D _CameraDepthNormalsTexture; -uniform sampler2D _MainTex; -vec3 DecodeViewNormalStereo ( - in vec4 enc4_1 -) -{ - vec3 n_2; - float g_3; - vec3 nn_4; - float kScale_5; - float tmpvar_6; - tmpvar_6 = 1.7777; - kScale_5 = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7.z = 0.0; - tmpvar_7.x = (2.0 * kScale_5); - tmpvar_7.y = (2.0 * kScale_5); - vec3 tmpvar_8; - tmpvar_8.z = 1.0; - tmpvar_8.x = -(kScale_5); - tmpvar_8.y = -(kScale_5); - vec3 tmpvar_9; - tmpvar_9 = ((enc4_1.xyz * tmpvar_7) + tmpvar_8); - nn_4 = tmpvar_9; - float tmpvar_10; - tmpvar_10 = dot (nn_4.xyz, nn_4.xyz); - float tmpvar_11; - tmpvar_11 = (2.0 / tmpvar_10); - g_3 = tmpvar_11; - vec2 tmpvar_12; - tmpvar_12 = (g_3 * nn_4.xy); - n_2.xy = tmpvar_12.xy.xy; - float tmpvar_13; - tmpvar_13 = (g_3 - 1.0); - n_2.z = vec3(tmpvar_13).z; - return n_2; -} - -float DecodeFloatRG ( - in vec2 enc_14 -) -{ - vec2 kDecodeDot_15; - vec2 tmpvar_16; - tmpvar_16 = vec2(1.0, 0.00392157); - kDecodeDot_15 = tmpvar_16; - float tmpvar_17; - tmpvar_17 = dot (enc_14, kDecodeDot_15); - return tmpvar_17; -} - -void DecodeDepthNormal ( - in vec4 enc_18, - out float depth_19, - out vec3 normal_20 -) -{ - float tmpvar_21; - tmpvar_21 = DecodeFloatRG (enc_18.zw); - float tmpvar_22; - tmpvar_22 = tmpvar_21; - depth_19 = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = DecodeViewNormalStereo (enc_18); - vec3 tmpvar_24; - tmpvar_24 = tmpvar_23; - normal_20 = tmpvar_24; -} - -vec4 frag ( - in v2f_img i_25 -) -{ - vec4 col_26; - vec3 n_27; - float z_28; - vec4 depth_29; - vec4 tex_30; - vec4 tmpvar_31; - tmpvar_31 = texture2D (_MainTex, i_25.uv); - vec4 tmpvar_32; - tmpvar_32 = tmpvar_31; - tex_30 = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = texture2D (_CameraDepthNormalsTexture, i_25.uv); - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - depth_29 = tmpvar_34; - DecodeDepthNormal (depth_29, z_28, n_27); - float tmpvar_35; - tmpvar_35 = z_28; - col_26.x = tmpvar_35; - float tmpvar_36; - tmpvar_36 = ((n_27.x * 0.5) + 0.5); - col_26.y = vec2(tmpvar_36).y; - float tmpvar_37; - tmpvar_37 = ((n_27.y * 0.5) + 0.5); - col_26.z = vec3(tmpvar_37).z; - float tmpvar_38; - tmpvar_38 = tex_30.w; - col_26.w = vec4(tmpvar_38).w; - return col_26; -} - -void main () -{ - v2f_img xlt_i_39; - vec4 xl_retval_40; - vec4 tmpvar_41; - tmpvar_41 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_39.pos = tmpvar_41; - vec2 tmpvar_42; - tmpvar_42 = gl_TexCoord[0].xy; - vec2 tmpvar_43; - tmpvar_43 = tmpvar_42; - xlt_i_39.uv = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44 = frag (xlt_i_39); - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - xl_retval_40 = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46 = xl_retval_40.xyzw; - vec4 tmpvar_47; - tmpvar_47 = tmpvar_46; - gl_FragData[0] = tmpvar_47; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-out.txt index a73ccc327..10449605a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-out.txt @@ -8,12 +8,12 @@ void main () vec4 tmpvar_3; tmpvar_3 = texture2D (_CameraDepthNormalsTexture, tmpvar_1); vec3 n_4; - vec3 tmpvar_5; - tmpvar_5 = ((tmpvar_3.xyz * vec3(3.5554, 3.5554, 0.0)) + vec3(-1.7777, -1.7777, 1.0)); - float tmpvar_6; - tmpvar_6 = (2.0 / dot (tmpvar_5, tmpvar_5)); - n_4.xy = (tmpvar_6 * tmpvar_5.xy); - n_4.z = (tmpvar_6 - 1.0); + float g_5; + vec3 nn_6; + nn_6 = ((tmpvar_3.xyz * vec3(3.5554, 3.5554, 0.0)) + vec3(-1.7777, -1.7777, 1.0)); + g_5 = (2.0 / dot (nn_6, nn_6)); + n_4.xy = (g_5 * nn_6.xy); + n_4.z = (g_5 - 1.0); col_2.x = dot (tmpvar_3.zw, vec2(1.0, 0.00392157)); col_2.y = ((n_4.x * 0.5) + 0.5); col_2.z = ((n_4.y * 0.5) + 0.5); @@ -22,4 +22,9 @@ void main () } -// inputs: 1, stats: 11 alu 2 tex 0 flow +// stats: 11 alu 2 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// textures: 2 +// #0: _CameraDepthNormalsTexture (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-ir.txt deleted file mode 100644 index 3fb607477..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-ir.txt +++ /dev/null @@ -1,72 +0,0 @@ -struct v2f_img { - vec4 pos; - vec2 uv; -}; -uniform sampler2D _CameraDepthTexture; -uniform sampler2D _MainTex; -uniform vec4 _ZBufferParams; -float LinearEyeDepth ( - in float z_1 -) -{ - return (1.0 / ((_ZBufferParams.z * z_1) + _ZBufferParams.w)); -} - -vec4 frag ( - in v2f_img i_2 -) -{ - vec4 col_3; - float z_4; - vec4 depth_5; - vec4 tex_6; - vec4 tmpvar_7; - tmpvar_7 = texture2D (_MainTex, i_2.uv); - vec4 tmpvar_8; - tmpvar_8 = tmpvar_7; - tex_6 = tmpvar_8; - vec4 tmpvar_9; - tmpvar_9 = texture2D (_CameraDepthTexture, i_2.uv); - vec4 tmpvar_10; - tmpvar_10 = tmpvar_9; - depth_5 = tmpvar_10; - float tmpvar_11; - tmpvar_11 = LinearEyeDepth (depth_5.x); - float tmpvar_12; - tmpvar_12 = (tmpvar_11 * 0.01); - z_4 = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13 = tex_6; - col_3 = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = vec2(z_4); - vec2 tmpvar_15; - tmpvar_15 = tmpvar_14; - col_3.xy = tmpvar_15.xy.xy; - return col_3; -} - -void main () -{ - v2f_img xlt_i_16; - vec4 xl_retval_17; - vec4 tmpvar_18; - tmpvar_18 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_16.pos = tmpvar_18; - vec2 tmpvar_19; - tmpvar_19 = gl_TexCoord[0].xy; - vec2 tmpvar_20; - tmpvar_20 = tmpvar_19; - xlt_i_16.uv = tmpvar_20; - vec4 tmpvar_21; - tmpvar_21 = frag (xlt_i_16); - vec4 tmpvar_22; - tmpvar_22 = tmpvar_21; - xl_retval_17 = tmpvar_22; - vec4 tmpvar_23; - tmpvar_23 = xl_retval_17.xyzw; - vec4 tmpvar_24; - tmpvar_24 = tmpvar_23; - gl_FragData[0] = tmpvar_24; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-out.txt index 4f4da1da4..bb3cf6a68 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-out.txt @@ -14,4 +14,11 @@ void main () } -// inputs: 1, stats: 4 alu 2 tex 0 flow +// stats: 4 alu 2 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// uniforms: 1 (total size: 0) +// #0: _ZBufferParams (high float) 4x1 [-1] +// textures: 2 +// #0: _CameraDepthTexture (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-ir.txt deleted file mode 100644 index 59d49f2f5..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-ir.txt +++ /dev/null @@ -1,66 +0,0 @@ -struct v2f { - vec4 pos; - float fog; - vec4 color; - vec2 uv; -}; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -vec4 frag ( - in v2f xlat_var_input_2 -) -{ - vec4 col_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, xlat_var_input_2.uv); - vec4 tmpvar_5; - tmpvar_5 = tmpvar_4; - col_3 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = (col_3.xyz * xlat_var_input_2.color.xyz); - col_3.xyz = tmpvar_6.xyz.xyz; - xll_clip (col_3.w); - return col_3; -} - -void main () -{ - v2f xlt_xlat_var_input_7; - vec4 xl_retval_8; - vec4 tmpvar_9; - tmpvar_9 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_xlat_var_input_7.pos = tmpvar_9; - float tmpvar_10; - tmpvar_10 = xlv_FOG.x; - xlt_xlat_var_input_7.fog = tmpvar_10; - vec4 tmpvar_11; - tmpvar_11 = gl_Color.xyzw; - vec4 tmpvar_12; - tmpvar_12 = tmpvar_11; - xlt_xlat_var_input_7.color = tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = gl_TexCoord[0].xy; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_13; - xlt_xlat_var_input_7.uv = tmpvar_14; - vec4 tmpvar_15; - tmpvar_15 = frag (xlt_xlat_var_input_7); - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - xl_retval_8 = tmpvar_16; - vec4 tmpvar_17; - tmpvar_17 = xl_retval_8.xyzw; - vec4 tmpvar_18; - tmpvar_18 = tmpvar_17; - gl_FragData[0] = tmpvar_18; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-out.txt index 1ab28bd21..09b0db192 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-out.txt @@ -13,4 +13,9 @@ void main () } -// inputs: 2, stats: 2 alu 2 tex 1 flow +// stats: 2 alu 2 tex 1 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [1] loc 4 +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-ir.txt deleted file mode 100644 index 8b40ad19e..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-ir.txt +++ /dev/null @@ -1,170 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 lop_color; - vec3 normal; - vec3 vlight; -}; -uniform float _Cutoff; -uniform vec4 _LightColor0; -uniform sampler2D _MainTex; -uniform vec4 _WorldSpaceLightPos0; -varying vec4 xlv_FOG; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -void surf ( - in Input IN_2, - inout SurfaceOutput o_3 -) -{ - vec4 c_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, IN_2.uv_MainTex); - vec4 tmpvar_6; - tmpvar_6 = (tmpvar_5 * IN_2.color); - c_4 = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = c_4.xyz; - o_3.Albedo = tmpvar_7; - float tmpvar_8; - tmpvar_8 = c_4.w; - o_3.Alpha = tmpvar_8; -} - -vec4 LightingLambert ( - in SurfaceOutput s_9, - in vec3 lightDir_10, - in float atten_11 -) -{ - vec4 c_12; - float diff_13; - float tmpvar_14; - tmpvar_14 = dot (s_9.Normal, lightDir_10); - float tmpvar_15; - tmpvar_15 = max (0.0, tmpvar_14); - float tmpvar_16; - tmpvar_16 = tmpvar_15; - diff_13 = tmpvar_16; - vec3 tmpvar_17; - tmpvar_17 = ((s_9.Albedo * _LightColor0.xyz) * ((diff_13 * atten_11) * 2.0)); - c_12.xyz = tmpvar_17.xyz.xyz; - float tmpvar_18; - tmpvar_18 = s_9.Alpha; - c_12.w = vec4(tmpvar_18).w; - return c_12; -} - -vec4 frag_surf ( - in v2f_surf IN_19 -) -{ - vec4 c_20; - float atten_21; - SurfaceOutput o_22; - Input surfIN_23; - float tmpvar_24; - tmpvar_24 = 1.0; - atten_21 = tmpvar_24; - vec2 tmpvar_25; - tmpvar_25 = IN_19.hip_pack0.xy; - surfIN_23.uv_MainTex = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = IN_19.lop_color; - surfIN_23.color = tmpvar_26; - vec3 tmpvar_27; - tmpvar_27 = vec3(0.0, 0.0, 0.0); - o_22.Albedo = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = vec3(0.0, 0.0, 0.0); - o_22.Emission = tmpvar_28; - float tmpvar_29; - tmpvar_29 = 0.0; - o_22.Specular = tmpvar_29; - float tmpvar_30; - tmpvar_30 = 0.0; - o_22.Alpha = tmpvar_30; - float tmpvar_31; - tmpvar_31 = 0.0; - o_22.Gloss = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = IN_19.normal; - o_22.Normal = tmpvar_32; - surf (surfIN_23, o_22); - xll_clip ((o_22.Alpha - _Cutoff)); - vec4 tmpvar_33; - tmpvar_33 = LightingLambert (o_22, _WorldSpaceLightPos0.xyz, atten_21); - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - c_20 = tmpvar_34; - vec3 tmpvar_35; - tmpvar_35 = (c_20.xyz + (o_22.Albedo * IN_19.vlight)); - c_20.xyz = tmpvar_35.xyz.xyz; - float tmpvar_36; - tmpvar_36 = o_22.Alpha; - c_20.w = vec4(tmpvar_36).w; - return c_20; -} - -void main () -{ - v2f_surf xlt_IN_37; - vec4 xl_retval_38; - vec4 tmpvar_39; - tmpvar_39 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_37.pos = tmpvar_39; - float tmpvar_40; - tmpvar_40 = xlv_FOG.x; - xlt_IN_37.fog = tmpvar_40; - vec2 tmpvar_41; - tmpvar_41 = gl_TexCoord[0].xy; - vec2 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_IN_37.hip_pack0 = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43 = gl_Color.xyzw; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_IN_37.lop_color = tmpvar_44; - vec3 tmpvar_45; - tmpvar_45 = gl_TexCoord[1].xyz; - vec3 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_IN_37.normal = tmpvar_46; - vec3 tmpvar_47; - tmpvar_47 = gl_TexCoord[2].xyz; - vec3 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_IN_37.vlight = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = frag_surf (xlt_IN_37); - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xl_retval_38 = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = xl_retval_38.xyzw; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - gl_FragData[0] = tmpvar_52; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt index 703c370f3..bd9dac0ab 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt @@ -5,24 +5,33 @@ uniform vec4 _WorldSpaceLightPos0; void main () { vec4 c_1; - vec4 tmpvar_2; - tmpvar_2 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color); - float tmpvar_3; - tmpvar_3 = tmpvar_2.w; + float tmpvar_2; + vec4 c_3; + c_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color); + tmpvar_2 = c_3.w; float x_4; - x_4 = (tmpvar_2.w - _Cutoff); + x_4 = (c_3.w - _Cutoff); if ((x_4 < 0.0)) { discard; }; vec4 c_5; - c_5.xyz = ((tmpvar_2.xyz * _LightColor0.xyz) * (max (0.0, + c_5.xyz = ((c_3.xyz * _LightColor0.xyz) * (max (0.0, dot (gl_TexCoord[1].xyz, _WorldSpaceLightPos0.xyz) ) * 2.0)); - c_5.w = tmpvar_3; - c_1.xyz = (c_5.xyz + (tmpvar_2.xyz * gl_TexCoord[2].xyz)); - c_1.w = tmpvar_3; + c_5.w = tmpvar_2; + c_1.xyz = (c_5.xyz + (c_3.xyz * gl_TexCoord[2].xyz)); + c_1.w = tmpvar_2; gl_FragData[0] = c_1; } -// inputs: 2, stats: 10 alu 2 tex 1 flow +// stats: 10 alu 2 tex 1 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 3 (total size: 0) +// #0: _Cutoff (high float) 1x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-ir.txt deleted file mode 100644 index 6262968b9..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-ir.txt +++ /dev/null @@ -1,189 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 lop_color; - vec3 normal; - vec3 lightDir; - vec3 _LightCoord; -}; -uniform float _Cutoff; -uniform vec4 _LightColor0; -uniform samplerCube _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -void surf ( - in Input IN_2, - inout SurfaceOutput o_3 -) -{ - vec4 c_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, IN_2.uv_MainTex); - vec4 tmpvar_6; - tmpvar_6 = (tmpvar_5 * IN_2.color); - c_4 = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = c_4.xyz; - o_3.Albedo = tmpvar_7; - float tmpvar_8; - tmpvar_8 = c_4.w; - o_3.Alpha = tmpvar_8; -} - -vec4 LightingLambert ( - in SurfaceOutput s_9, - in vec3 lightDir_10, - in float atten_11 -) -{ - vec4 c_12; - float diff_13; - float tmpvar_14; - tmpvar_14 = dot (s_9.Normal, lightDir_10); - float tmpvar_15; - tmpvar_15 = max (0.0, tmpvar_14); - float tmpvar_16; - tmpvar_16 = tmpvar_15; - diff_13 = tmpvar_16; - vec3 tmpvar_17; - tmpvar_17 = ((s_9.Albedo * _LightColor0.xyz) * ((diff_13 * atten_11) * 2.0)); - c_12.xyz = tmpvar_17.xyz.xyz; - float tmpvar_18; - tmpvar_18 = s_9.Alpha; - c_12.w = vec4(tmpvar_18).w; - return c_12; -} - -vec4 frag_surf ( - in v2f_surf IN_19 -) -{ - vec4 c_20; - vec3 lightDir_21; - SurfaceOutput o_22; - Input surfIN_23; - vec2 tmpvar_24; - tmpvar_24 = IN_19.hip_pack0.xy; - surfIN_23.uv_MainTex = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25 = IN_19.lop_color; - surfIN_23.color = tmpvar_25; - vec3 tmpvar_26; - tmpvar_26 = vec3(0.0, 0.0, 0.0); - o_22.Albedo = tmpvar_26; - vec3 tmpvar_27; - tmpvar_27 = vec3(0.0, 0.0, 0.0); - o_22.Emission = tmpvar_27; - float tmpvar_28; - tmpvar_28 = 0.0; - o_22.Specular = tmpvar_28; - float tmpvar_29; - tmpvar_29 = 0.0; - o_22.Alpha = tmpvar_29; - float tmpvar_30; - tmpvar_30 = 0.0; - o_22.Gloss = tmpvar_30; - vec3 tmpvar_31; - tmpvar_31 = IN_19.normal; - o_22.Normal = tmpvar_31; - surf (surfIN_23, o_22); - xll_clip ((o_22.Alpha - _Cutoff)); - vec3 tmpvar_32; - tmpvar_32 = IN_19.lightDir; - lightDir_21 = tmpvar_32; - vec3 tmpvar_33; - tmpvar_33 = normalize (lightDir_21); - vec3 tmpvar_34; - tmpvar_34 = tmpvar_33; - lightDir_21 = tmpvar_34; - float tmpvar_35; - tmpvar_35 = dot (IN_19._LightCoord, IN_19._LightCoord); - vec2 tmpvar_36; - tmpvar_36 = vec2(tmpvar_35); - vec2 tmpvar_37; - tmpvar_37 = tmpvar_36.xy; - vec4 tmpvar_38; - tmpvar_38 = texture2D (_LightTextureB0, tmpvar_37); - vec4 tmpvar_39; - tmpvar_39 = textureCube (_LightTexture0, IN_19._LightCoord); - vec4 tmpvar_40; - tmpvar_40 = LightingLambert (o_22, lightDir_21, (tmpvar_38.w * tmpvar_39.w)); - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - c_20 = tmpvar_41; - float tmpvar_42; - tmpvar_42 = o_22.Alpha; - c_20.w = vec4(tmpvar_42).w; - return c_20; -} - -void main () -{ - v2f_surf xlt_IN_43; - vec4 xl_retval_44; - vec4 tmpvar_45; - tmpvar_45 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_43.pos = tmpvar_45; - float tmpvar_46; - tmpvar_46 = xlv_FOG.x; - xlt_IN_43.fog = tmpvar_46; - vec2 tmpvar_47; - tmpvar_47 = gl_TexCoord[0].xy; - vec2 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_IN_43.hip_pack0 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = gl_Color.xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_IN_43.lop_color = tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = gl_TexCoord[1].xyz; - vec3 tmpvar_52; - tmpvar_52 = tmpvar_51; - xlt_IN_43.normal = tmpvar_52; - vec3 tmpvar_53; - tmpvar_53 = gl_TexCoord[2].xyz; - vec3 tmpvar_54; - tmpvar_54 = tmpvar_53; - xlt_IN_43.lightDir = tmpvar_54; - vec3 tmpvar_55; - tmpvar_55 = gl_TexCoord[3].xyz; - vec3 tmpvar_56; - tmpvar_56 = tmpvar_55; - xlt_IN_43._LightCoord = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = frag_surf (xlt_IN_43); - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - xl_retval_44 = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59 = xl_retval_44.xyzw; - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - gl_FragData[0] = tmpvar_60; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt index 45c70c9d5..22e4227d8 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt @@ -8,26 +8,36 @@ void main () vec3 tmpvar_1; tmpvar_1 = gl_TexCoord[3].xyz; vec4 c_2; - vec4 tmpvar_3; - tmpvar_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color); - float tmpvar_4; - tmpvar_4 = tmpvar_3.w; + float tmpvar_3; + vec4 c_4; + c_4 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color); + tmpvar_3 = c_4.w; float x_5; - x_5 = (tmpvar_3.w - _Cutoff); + x_5 = (c_4.w - _Cutoff); if ((x_5 < 0.0)) { discard; }; vec4 c_6; - c_6.xyz = ((tmpvar_3.xyz * _LightColor0.xyz) * (( + c_6.xyz = ((c_4.xyz * _LightColor0.xyz) * (( max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) * (texture2D (_LightTextureB0, vec2(dot (tmpvar_1, tmpvar_1))).w * textureCube (_LightTexture0, tmpvar_1).w) ) * 2.0)); - c_6.w = tmpvar_4; + c_6.w = tmpvar_3; c_2.xyz = c_6.xyz; - c_2.w = tmpvar_4; + c_2.w = tmpvar_3; gl_FragData[0] = c_2; } -// inputs: 2, stats: 12 alu 4 tex 1 flow +// stats: 12 alu 4 tex 1 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Cutoff (high float) 1x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// textures: 3 +// #0: _LightTexture0 (high cube) 0x0 [-1] +// #1: _LightTextureB0 (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-ir.txt deleted file mode 100644 index 7ec658b09..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-ir.txt +++ /dev/null @@ -1,108 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - vec2 hip_pack0; - vec4 lop_color; -}; -uniform float _Cutoff; -uniform sampler2D _MainTex; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -void surf ( - in Input IN_2, - inout SurfaceOutput o_3 -) -{ - vec4 c_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, IN_2.uv_MainTex); - vec4 tmpvar_6; - tmpvar_6 = (tmpvar_5 * IN_2.color); - c_4 = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = c_4.xyz; - o_3.Albedo = tmpvar_7; - float tmpvar_8; - tmpvar_8 = c_4.w; - o_3.Alpha = tmpvar_8; -} - -vec4 frag_surf ( - in v2f_surf IN_9 -) -{ - SurfaceOutput o_10; - Input surfIN_11; - vec2 tmpvar_12; - tmpvar_12 = IN_9.hip_pack0.xy; - surfIN_11.uv_MainTex = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13 = IN_9.lop_color; - surfIN_11.color = tmpvar_13; - vec3 tmpvar_14; - tmpvar_14 = vec3(0.0, 0.0, 0.0); - o_10.Albedo = tmpvar_14; - vec3 tmpvar_15; - tmpvar_15 = vec3(0.0, 0.0, 0.0); - o_10.Emission = tmpvar_15; - float tmpvar_16; - tmpvar_16 = 0.0; - o_10.Specular = tmpvar_16; - float tmpvar_17; - tmpvar_17 = 0.0; - o_10.Alpha = tmpvar_17; - float tmpvar_18; - tmpvar_18 = 0.0; - o_10.Gloss = tmpvar_18; - surf (surfIN_11, o_10); - xll_clip ((o_10.Alpha - _Cutoff)); - return vec4(0.0, 0.0, 0.0, 0.0); -} - -void main () -{ - v2f_surf xlt_IN_19; - vec4 xl_retval_20; - vec4 tmpvar_21; - tmpvar_21 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_19.pos = tmpvar_21; - vec2 tmpvar_22; - tmpvar_22 = gl_TexCoord[1].xy; - vec2 tmpvar_23; - tmpvar_23 = tmpvar_22; - xlt_IN_19.hip_pack0 = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = gl_Color.xyzw; - vec4 tmpvar_25; - tmpvar_25 = tmpvar_24; - xlt_IN_19.lop_color = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = frag_surf (xlt_IN_19); - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - xl_retval_20 = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = xl_retval_20.xyzw; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - gl_FragData[0] = tmpvar_29; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt index ff80a6956..0e7d24071 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt @@ -11,4 +11,11 @@ void main () } -// inputs: 2, stats: 4 alu 2 tex 1 flow +// stats: 4 alu 2 tex 1 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [2] loc 4 +// uniforms: 1 (total size: 0) +// #0: _Cutoff (high float) 1x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-ir.txt deleted file mode 100644 index 06b1f13f5..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-ir.txt +++ /dev/null @@ -1,175 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 lop_color; - vec3 normal; - vec3 lightDir; - vec3 _LightCoord; -}; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_5; - tmpvar_5 = (tmpvar_4 * IN_1.color); - c_3 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = c_3.xyz; - o_2.Albedo = tmpvar_6; - float tmpvar_7; - tmpvar_7 = c_3.w; - o_2.Alpha = tmpvar_7; -} - -vec4 LightingLambert ( - in SurfaceOutput s_8, - in vec3 lightDir_9, - in float atten_10 -) -{ - vec4 c_11; - float diff_12; - float tmpvar_13; - tmpvar_13 = dot (s_8.Normal, lightDir_9); - float tmpvar_14; - tmpvar_14 = max (0.0, tmpvar_13); - float tmpvar_15; - tmpvar_15 = tmpvar_14; - diff_12 = tmpvar_15; - vec3 tmpvar_16; - tmpvar_16 = ((s_8.Albedo * _LightColor0.xyz) * ((diff_12 * atten_10) * 2.0)); - c_11.xyz = tmpvar_16.xyz.xyz; - float tmpvar_17; - tmpvar_17 = s_8.Alpha; - c_11.w = vec4(tmpvar_17).w; - return c_11; -} - -vec4 frag_surf ( - in v2f_surf IN_18 -) -{ - vec4 c_19; - vec3 lightDir_20; - SurfaceOutput o_21; - Input surfIN_22; - vec2 tmpvar_23; - tmpvar_23 = IN_18.hip_pack0.xy; - surfIN_22.uv_MainTex = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = IN_18.lop_color; - surfIN_22.color = tmpvar_24; - vec3 tmpvar_25; - tmpvar_25 = vec3(0.0, 0.0, 0.0); - o_21.Albedo = tmpvar_25; - vec3 tmpvar_26; - tmpvar_26 = vec3(0.0, 0.0, 0.0); - o_21.Emission = tmpvar_26; - float tmpvar_27; - tmpvar_27 = 0.0; - o_21.Specular = tmpvar_27; - float tmpvar_28; - tmpvar_28 = 0.0; - o_21.Alpha = tmpvar_28; - float tmpvar_29; - tmpvar_29 = 0.0; - o_21.Gloss = tmpvar_29; - vec3 tmpvar_30; - tmpvar_30 = IN_18.normal; - o_21.Normal = tmpvar_30; - surf (surfIN_22, o_21); - vec3 tmpvar_31; - tmpvar_31 = IN_18.lightDir; - lightDir_20 = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = normalize (lightDir_20); - vec3 tmpvar_33; - tmpvar_33 = tmpvar_32; - lightDir_20 = tmpvar_33; - float tmpvar_34; - tmpvar_34 = dot (IN_18._LightCoord, IN_18._LightCoord); - vec2 tmpvar_35; - tmpvar_35 = vec2(tmpvar_34); - vec2 tmpvar_36; - tmpvar_36 = tmpvar_35.xy; - vec4 tmpvar_37; - tmpvar_37 = texture2D (_LightTexture0, tmpvar_36); - vec4 tmpvar_38; - tmpvar_38 = LightingLambert (o_21, lightDir_20, tmpvar_37.w); - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - c_19 = tmpvar_39; - float tmpvar_40; - tmpvar_40 = 0.0; - c_19.w = vec4(tmpvar_40).w; - return c_19; -} - -void main () -{ - v2f_surf xlt_IN_41; - vec4 xl_retval_42; - vec4 tmpvar_43; - tmpvar_43 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_41.pos = tmpvar_43; - float tmpvar_44; - tmpvar_44 = xlv_FOG.x; - xlt_IN_41.fog = tmpvar_44; - vec2 tmpvar_45; - tmpvar_45 = gl_TexCoord[0].xy; - vec2 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_IN_41.hip_pack0 = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = gl_Color.xyzw; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_IN_41.lop_color = tmpvar_48; - vec3 tmpvar_49; - tmpvar_49 = gl_TexCoord[1].xyz; - vec3 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_IN_41.normal = tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = gl_TexCoord[2].xyz; - vec3 tmpvar_52; - tmpvar_52 = tmpvar_51; - xlt_IN_41.lightDir = tmpvar_52; - vec3 tmpvar_53; - tmpvar_53 = gl_TexCoord[3].xyz; - vec3 tmpvar_54; - tmpvar_54 = tmpvar_53; - xlt_IN_41._LightCoord = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = frag_surf (xlt_IN_41); - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - xl_retval_42 = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = xl_retval_42.xyzw; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - gl_FragData[0] = tmpvar_58; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-out.txt index 9554b5a81..89ed021fd 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-out.txt @@ -6,19 +6,27 @@ void main () vec3 tmpvar_1; tmpvar_1 = gl_TexCoord[3].xyz; vec4 c_2; - vec4 tmpvar_3; - tmpvar_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color); + vec4 c_3; + c_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color); vec4 c_4; - c_4.xyz = ((tmpvar_3.xyz * _LightColor0.xyz) * (( + c_4.xyz = ((c_3.xyz * _LightColor0.xyz) * (( max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) * texture2D (_LightTexture0, vec2( dot (tmpvar_1, tmpvar_1) )).w) * 2.0)); - c_4.w = tmpvar_3.w; + c_4.w = c_3.w; c_2.xyz = c_4.xyz; c_2.w = 0.0; gl_FragData[0] = c_2; } -// inputs: 2, stats: 10 alu 2 tex 0 flow +// stats: 10 alu 2 tex 0 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 1 (total size: 0) +// #0: _LightColor0 (high float) 4x1 [-1] +// textures: 2 +// #0: _LightTexture0 (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-ir.txt deleted file mode 100644 index 182fd6f9e..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-ir.txt +++ /dev/null @@ -1,290 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 lop_color; - vec4 hip_screen; - vec3 hip_lmapFade; -}; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform sampler2D unity_Lightmap; -uniform sampler2D unity_LightmapInd; -varying vec4 xlv_FOG; -float xll_saturate ( - in float x_1 -) -{ - float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -vec2 xll_saturate ( - in vec2 x_3 -) -{ - vec2 tmpvar_4; - tmpvar_4 = clamp (x_3, 0.0, 1.0); - return tmpvar_4; -} - -vec3 xll_saturate ( - in vec3 x_5 -) -{ - vec3 tmpvar_6; - tmpvar_6 = clamp (x_5, 0.0, 1.0); - return tmpvar_6; -} - -vec4 xll_saturate ( - in vec4 x_7 -) -{ - vec4 tmpvar_8; - tmpvar_8 = clamp (x_7, 0.0, 1.0); - return tmpvar_8; -} - -mat2 xll_saturate ( - in mat2 m_9 -) -{ - vec2 tmpvar_10; - tmpvar_10 = clamp (m_9[0], 0.0, 1.0); - vec2 tmpvar_11; - tmpvar_11 = clamp (m_9[1], 0.0, 1.0); - mat2 tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_10; - tmpvar_12[0] = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_12[1] = tmpvar_14; - return tmpvar_12; -} - -mat3 xll_saturate ( - in mat3 m_15 -) -{ - vec3 tmpvar_16; - tmpvar_16 = clamp (m_15[0], 0.0, 1.0); - vec3 tmpvar_17; - tmpvar_17 = clamp (m_15[1], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_15[2], 0.0, 1.0); - mat3 tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_16; - tmpvar_19[0] = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_19[1] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_19[2] = tmpvar_22; - return tmpvar_19; -} - -mat4 xll_saturate ( - in mat4 m_23 -) -{ - vec4 tmpvar_24; - tmpvar_24 = clamp (m_23[0], 0.0, 1.0); - vec4 tmpvar_25; - tmpvar_25 = clamp (m_23[1], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_23[2], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_23[3], 0.0, 1.0); - mat4 tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_24; - tmpvar_28[0] = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_28[1] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_28[2] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_28[3] = tmpvar_32; - return tmpvar_28; -} - -void surf ( - in Input IN_33, - inout SurfaceOutput o_34 -) -{ - vec4 c_35; - vec4 tmpvar_36; - tmpvar_36 = texture2D (_MainTex, IN_33.uv_MainTex); - vec4 tmpvar_37; - tmpvar_37 = (tmpvar_36 * IN_33.color); - c_35 = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = c_35.xyz; - o_34.Albedo = tmpvar_38; - float tmpvar_39; - tmpvar_39 = c_35.w; - o_34.Alpha = tmpvar_39; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_40, - in vec4 light_41 -) -{ - vec4 c_42; - vec3 tmpvar_43; - tmpvar_43 = (s_40.Albedo * light_41.xyz); - c_42.xyz = tmpvar_43.xyz.xyz; - float tmpvar_44; - tmpvar_44 = s_40.Alpha; - c_42.w = vec4(tmpvar_44).w; - return c_42; -} - -vec3 DecodeLightmap ( - in vec4 color_45 -) -{ - return (2.0 * color_45.xyz); -} - -vec4 frag_surf ( - in v2f_surf IN_46 -) -{ - vec4 col_47; - vec3 lm_48; - vec3 lmIndirect_49; - vec3 lmFull_50; - vec4 light_51; - SurfaceOutput o_52; - Input surfIN_53; - vec2 tmpvar_54; - tmpvar_54 = IN_46.hip_pack0.xy; - surfIN_53.uv_MainTex = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = IN_46.lop_color; - surfIN_53.color = tmpvar_55; - vec3 tmpvar_56; - tmpvar_56 = vec3(0.0, 0.0, 0.0); - o_52.Albedo = tmpvar_56; - vec3 tmpvar_57; - tmpvar_57 = vec3(0.0, 0.0, 0.0); - o_52.Emission = tmpvar_57; - float tmpvar_58; - tmpvar_58 = 0.0; - o_52.Specular = tmpvar_58; - float tmpvar_59; - tmpvar_59 = 0.0; - o_52.Alpha = tmpvar_59; - float tmpvar_60; - tmpvar_60 = 0.0; - o_52.Gloss = tmpvar_60; - surf (surfIN_53, o_52); - vec4 tmpvar_61; - tmpvar_61 = texture2DProj (_LightBuffer, IN_46.hip_screen); - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - light_51 = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63 = log2 (light_51); - vec4 tmpvar_64; - tmpvar_64 = -(tmpvar_63); - light_51 = tmpvar_64; - vec4 tmpvar_65; - tmpvar_65 = texture2D (unity_Lightmap, IN_46.hip_lmapFade.xy); - vec3 tmpvar_66; - tmpvar_66 = DecodeLightmap (tmpvar_65); - vec3 tmpvar_67; - tmpvar_67 = tmpvar_66; - lmFull_50 = tmpvar_67; - vec4 tmpvar_68; - tmpvar_68 = texture2D (unity_LightmapInd, IN_46.hip_lmapFade.xy); - vec3 tmpvar_69; - tmpvar_69 = DecodeLightmap (tmpvar_68); - vec3 tmpvar_70; - tmpvar_70 = tmpvar_69; - lmIndirect_49 = tmpvar_70; - float tmpvar_71; - tmpvar_71 = xll_saturate (IN_46.hip_lmapFade.z); - vec3 tmpvar_72; - tmpvar_72 = vec3(tmpvar_71); - vec3 tmpvar_73; - tmpvar_73 = mix (lmIndirect_49, lmFull_50, tmpvar_72); - vec3 tmpvar_74; - tmpvar_74 = tmpvar_73; - lm_48 = tmpvar_74; - vec3 tmpvar_75; - tmpvar_75 = (light_51.xyz + lm_48); - light_51.xyz = tmpvar_75.xyz.xyz; - vec4 tmpvar_76; - tmpvar_76 = LightingLambert_PrePass (o_52, light_51); - vec4 tmpvar_77; - tmpvar_77 = tmpvar_76; - col_47 = tmpvar_77; - return col_47; -} - -void main () -{ - v2f_surf xlt_IN_78; - vec4 xl_retval_79; - vec4 tmpvar_80; - tmpvar_80 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_78.pos = tmpvar_80; - float tmpvar_81; - tmpvar_81 = xlv_FOG.x; - xlt_IN_78.fog = tmpvar_81; - vec2 tmpvar_82; - tmpvar_82 = gl_TexCoord[0].xy; - vec2 tmpvar_83; - tmpvar_83 = tmpvar_82; - xlt_IN_78.hip_pack0 = tmpvar_83; - vec4 tmpvar_84; - tmpvar_84 = gl_Color.xyzw; - vec4 tmpvar_85; - tmpvar_85 = tmpvar_84; - xlt_IN_78.lop_color = tmpvar_85; - vec4 tmpvar_86; - tmpvar_86 = gl_TexCoord[1].xyzw; - vec4 tmpvar_87; - tmpvar_87 = tmpvar_86; - xlt_IN_78.hip_screen = tmpvar_87; - vec3 tmpvar_88; - tmpvar_88 = gl_TexCoord[2].xyz; - vec3 tmpvar_89; - tmpvar_89 = tmpvar_88; - xlt_IN_78.hip_lmapFade = tmpvar_89; - vec4 tmpvar_90; - tmpvar_90 = frag_surf (xlt_IN_78); - vec4 tmpvar_91; - tmpvar_91 = tmpvar_90; - xl_retval_79 = tmpvar_91; - vec4 tmpvar_92; - tmpvar_92 = xl_retval_79.xyzw; - vec4 tmpvar_93; - tmpvar_93 = tmpvar_92; - gl_FragData[0] = tmpvar_93; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-out.txt index a36c3503e..45cb22453 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-out.txt @@ -7,17 +7,23 @@ void main () vec3 tmpvar_1; tmpvar_1 = gl_TexCoord[2].xyz; vec4 light_2; - vec4 tmpvar_3; - tmpvar_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color); - vec4 tmpvar_4; - tmpvar_4 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); - light_2.w = tmpvar_4.w; - light_2.xyz = (tmpvar_4.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_1.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_1.xy).xyz), vec3(clamp (tmpvar_1.z, 0.0, 1.0)))); - vec4 c_5; - c_5.xyz = (tmpvar_3.xyz * light_2.xyz); - c_5.w = tmpvar_3.w; - gl_FragData[0] = c_5; + vec4 c_3; + c_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color); + light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); + light_2.xyz = (light_2.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_1.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_1.xy).xyz), vec3(clamp (tmpvar_1.z, 0.0, 1.0)))); + vec4 c_4; + c_4.xyz = (c_3.xyz * light_2.xyz); + c_4.w = c_3.w; + gl_FragData[0] = c_4; } -// inputs: 2, stats: 9 alu 4 tex 0 flow +// stats: 9 alu 4 tex 0 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [3] loc 4 +// textures: 4 +// #0: _LightBuffer (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] +// #2: unity_Lightmap (high 2d) 0x0 [-1] +// #3: unity_LightmapInd (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-ir.txt deleted file mode 100644 index a80e9d92a..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-ir.txt +++ /dev/null @@ -1,192 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 lop_color; - vec3 normal; - vec3 vlight; - vec4 _ShadowCoord; -}; -uniform float _Cutoff; -uniform vec4 _LightColor0; -uniform sampler2D _MainTex; -uniform sampler2D _ShadowMapTexture; -uniform vec4 _WorldSpaceLightPos0; -varying vec4 xlv_FOG; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -float unitySampleShadow ( - in vec4 shadowCoord_2 -) -{ - float shadow_3; - vec4 tmpvar_4; - tmpvar_4 = texture2DProj (_ShadowMapTexture, shadowCoord_2); - float tmpvar_5; - tmpvar_5 = tmpvar_4.x; - shadow_3 = tmpvar_5; - return shadow_3; -} - -void surf ( - in Input IN_6, - inout SurfaceOutput o_7 -) -{ - vec4 c_8; - vec4 tmpvar_9; - tmpvar_9 = texture2D (_MainTex, IN_6.uv_MainTex); - vec4 tmpvar_10; - tmpvar_10 = (tmpvar_9 * IN_6.color); - c_8 = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = c_8.xyz; - o_7.Albedo = tmpvar_11; - float tmpvar_12; - tmpvar_12 = c_8.w; - o_7.Alpha = tmpvar_12; -} - -vec4 LightingLambert ( - in SurfaceOutput s_13, - in vec3 lightDir_14, - in float atten_15 -) -{ - vec4 c_16; - float diff_17; - float tmpvar_18; - tmpvar_18 = dot (s_13.Normal, lightDir_14); - float tmpvar_19; - tmpvar_19 = max (0.0, tmpvar_18); - float tmpvar_20; - tmpvar_20 = tmpvar_19; - diff_17 = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = ((s_13.Albedo * _LightColor0.xyz) * ((diff_17 * atten_15) * 2.0)); - c_16.xyz = tmpvar_21.xyz.xyz; - float tmpvar_22; - tmpvar_22 = s_13.Alpha; - c_16.w = vec4(tmpvar_22).w; - return c_16; -} - -vec4 frag_surf ( - in v2f_surf IN_23 -) -{ - vec4 c_24; - float atten_25; - SurfaceOutput o_26; - Input surfIN_27; - vec2 tmpvar_28; - tmpvar_28 = IN_23.hip_pack0.xy; - surfIN_27.uv_MainTex = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = IN_23.lop_color; - surfIN_27.color = tmpvar_29; - vec3 tmpvar_30; - tmpvar_30 = vec3(0.0, 0.0, 0.0); - o_26.Albedo = tmpvar_30; - vec3 tmpvar_31; - tmpvar_31 = vec3(0.0, 0.0, 0.0); - o_26.Emission = tmpvar_31; - float tmpvar_32; - tmpvar_32 = 0.0; - o_26.Specular = tmpvar_32; - float tmpvar_33; - tmpvar_33 = 0.0; - o_26.Alpha = tmpvar_33; - float tmpvar_34; - tmpvar_34 = 0.0; - o_26.Gloss = tmpvar_34; - vec3 tmpvar_35; - tmpvar_35 = IN_23.normal; - o_26.Normal = tmpvar_35; - surf (surfIN_27, o_26); - xll_clip ((o_26.Alpha - _Cutoff)); - float tmpvar_36; - tmpvar_36 = unitySampleShadow (IN_23._ShadowCoord); - float tmpvar_37; - tmpvar_37 = tmpvar_36; - atten_25 = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = LightingLambert (o_26, _WorldSpaceLightPos0.xyz, atten_25); - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - c_24 = tmpvar_39; - vec3 tmpvar_40; - tmpvar_40 = (c_24.xyz + (o_26.Albedo * IN_23.vlight)); - c_24.xyz = tmpvar_40.xyz.xyz; - float tmpvar_41; - tmpvar_41 = o_26.Alpha; - c_24.w = vec4(tmpvar_41).w; - return c_24; -} - -void main () -{ - v2f_surf xlt_IN_42; - vec4 xl_retval_43; - vec4 tmpvar_44; - tmpvar_44 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_42.pos = tmpvar_44; - float tmpvar_45; - tmpvar_45 = xlv_FOG.x; - xlt_IN_42.fog = tmpvar_45; - vec2 tmpvar_46; - tmpvar_46 = gl_TexCoord[0].xy; - vec2 tmpvar_47; - tmpvar_47 = tmpvar_46; - xlt_IN_42.hip_pack0 = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48 = gl_Color.xyzw; - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - xlt_IN_42.lop_color = tmpvar_49; - vec3 tmpvar_50; - tmpvar_50 = gl_TexCoord[1].xyz; - vec3 tmpvar_51; - tmpvar_51 = tmpvar_50; - xlt_IN_42.normal = tmpvar_51; - vec3 tmpvar_52; - tmpvar_52 = gl_TexCoord[2].xyz; - vec3 tmpvar_53; - tmpvar_53 = tmpvar_52; - xlt_IN_42.vlight = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54 = gl_TexCoord[3].xyzw; - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - xlt_IN_42._ShadowCoord = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = frag_surf (xlt_IN_42); - vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - xl_retval_43 = tmpvar_57; - vec4 tmpvar_58; - tmpvar_58 = xl_retval_43.xyzw; - vec4 tmpvar_59; - tmpvar_59 = tmpvar_58; - gl_FragData[0] = tmpvar_59; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-out.txt index 266b4eb02..6efed9d79 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-out.txt @@ -6,24 +6,34 @@ uniform vec4 _WorldSpaceLightPos0; void main () { vec4 c_1; - vec4 tmpvar_2; - tmpvar_2 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color); - float tmpvar_3; - tmpvar_3 = tmpvar_2.w; + float tmpvar_2; + vec4 c_3; + c_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color); + tmpvar_2 = c_3.w; float x_4; - x_4 = (tmpvar_2.w - _Cutoff); + x_4 = (c_3.w - _Cutoff); if ((x_4 < 0.0)) { discard; }; vec4 c_5; - c_5.xyz = ((tmpvar_2.xyz * _LightColor0.xyz) * (( + c_5.xyz = ((c_3.xyz * _LightColor0.xyz) * (( max (0.0, dot (gl_TexCoord[1].xyz, _WorldSpaceLightPos0.xyz)) * texture2DProj (_ShadowMapTexture, gl_TexCoord[3]).x) * 2.0)); - c_5.w = tmpvar_3; - c_1.xyz = (c_5.xyz + (tmpvar_2.xyz * gl_TexCoord[2].xyz)); - c_1.w = tmpvar_3; + c_5.w = tmpvar_2; + c_1.xyz = (c_5.xyz + (c_3.xyz * gl_TexCoord[2].xyz)); + c_1.w = tmpvar_2; gl_FragData[0] = c_1; } -// inputs: 2, stats: 11 alu 3 tex 1 flow +// stats: 11 alu 3 tex 1 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 3 (total size: 0) +// #0: _Cutoff (high float) 1x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// textures: 2 +// #0: _MainTex (high 2d) 0x0 [-1] +// #1: _ShadowMapTexture (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-ir.txt deleted file mode 100644 index cb8f9d2d6..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-ir.txt +++ /dev/null @@ -1,209 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 lop_color; - vec3 normal; - vec3 lightDir; - vec4 _LightCoord; -}; -uniform float _Cutoff; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -void surf ( - in Input IN_2, - inout SurfaceOutput o_3 -) -{ - vec4 c_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, IN_2.uv_MainTex); - vec4 tmpvar_6; - tmpvar_6 = (tmpvar_5 * IN_2.color); - c_4 = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = c_4.xyz; - o_3.Albedo = tmpvar_7; - float tmpvar_8; - tmpvar_8 = c_4.w; - o_3.Alpha = tmpvar_8; -} - -float UnitySpotCookie ( - in vec4 LightCoord_9 -) -{ - vec4 tmpvar_10; - tmpvar_10 = texture2D (_LightTexture0, ((LightCoord_9.xy / LightCoord_9.w) + 0.5)); - return tmpvar_10.w; -} - -float UnitySpotAttenuate ( - in vec3 LightCoord_11 -) -{ - float tmpvar_12; - tmpvar_12 = dot (LightCoord_11, LightCoord_11); - vec2 tmpvar_13; - tmpvar_13 = vec2(tmpvar_12); - vec2 tmpvar_14; - tmpvar_14 = tmpvar_13.xy; - vec4 tmpvar_15; - tmpvar_15 = texture2D (_LightTextureB0, tmpvar_14); - return tmpvar_15.w; -} - -vec4 LightingLambert ( - in SurfaceOutput s_16, - in vec3 lightDir_17, - in float atten_18 -) -{ - vec4 c_19; - float diff_20; - float tmpvar_21; - tmpvar_21 = dot (s_16.Normal, lightDir_17); - float tmpvar_22; - tmpvar_22 = max (0.0, tmpvar_21); - float tmpvar_23; - tmpvar_23 = tmpvar_22; - diff_20 = tmpvar_23; - vec3 tmpvar_24; - tmpvar_24 = ((s_16.Albedo * _LightColor0.xyz) * ((diff_20 * atten_18) * 2.0)); - c_19.xyz = tmpvar_24.xyz.xyz; - float tmpvar_25; - tmpvar_25 = s_16.Alpha; - c_19.w = vec4(tmpvar_25).w; - return c_19; -} - -vec4 frag_surf ( - in v2f_surf IN_26 -) -{ - vec4 c_27; - vec3 lightDir_28; - SurfaceOutput o_29; - Input surfIN_30; - vec2 tmpvar_31; - tmpvar_31 = IN_26.hip_pack0.xy; - surfIN_30.uv_MainTex = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = IN_26.lop_color; - surfIN_30.color = tmpvar_32; - vec3 tmpvar_33; - tmpvar_33 = vec3(0.0, 0.0, 0.0); - o_29.Albedo = tmpvar_33; - vec3 tmpvar_34; - tmpvar_34 = vec3(0.0, 0.0, 0.0); - o_29.Emission = tmpvar_34; - float tmpvar_35; - tmpvar_35 = 0.0; - o_29.Specular = tmpvar_35; - float tmpvar_36; - tmpvar_36 = 0.0; - o_29.Alpha = tmpvar_36; - float tmpvar_37; - tmpvar_37 = 0.0; - o_29.Gloss = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = IN_26.normal; - o_29.Normal = tmpvar_38; - surf (surfIN_30, o_29); - xll_clip ((o_29.Alpha - _Cutoff)); - vec3 tmpvar_39; - tmpvar_39 = IN_26.lightDir; - lightDir_28 = tmpvar_39; - vec3 tmpvar_40; - tmpvar_40 = normalize (lightDir_28); - vec3 tmpvar_41; - tmpvar_41 = tmpvar_40; - lightDir_28 = tmpvar_41; - float tmpvar_42; - tmpvar_42 = UnitySpotCookie (IN_26._LightCoord); - float tmpvar_43; - tmpvar_43 = UnitySpotAttenuate (IN_26._LightCoord.xyz); - vec4 tmpvar_44; - tmpvar_44 = LightingLambert (o_29, lightDir_28, ((float( - (IN_26._LightCoord.z > 0.0) - ) * tmpvar_42) * tmpvar_43)); - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - c_27 = tmpvar_45; - float tmpvar_46; - tmpvar_46 = o_29.Alpha; - c_27.w = vec4(tmpvar_46).w; - return c_27; -} - -void main () -{ - v2f_surf xlt_IN_47; - vec4 xl_retval_48; - vec4 tmpvar_49; - tmpvar_49 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_47.pos = tmpvar_49; - float tmpvar_50; - tmpvar_50 = xlv_FOG.x; - xlt_IN_47.fog = tmpvar_50; - vec2 tmpvar_51; - tmpvar_51 = gl_TexCoord[0].xy; - vec2 tmpvar_52; - tmpvar_52 = tmpvar_51; - xlt_IN_47.hip_pack0 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = gl_Color.xyzw; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - xlt_IN_47.lop_color = tmpvar_54; - vec3 tmpvar_55; - tmpvar_55 = gl_TexCoord[1].xyz; - vec3 tmpvar_56; - tmpvar_56 = tmpvar_55; - xlt_IN_47.normal = tmpvar_56; - vec3 tmpvar_57; - tmpvar_57 = gl_TexCoord[2].xyz; - vec3 tmpvar_58; - tmpvar_58 = tmpvar_57; - xlt_IN_47.lightDir = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59 = gl_TexCoord[3].xyzw; - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - xlt_IN_47._LightCoord = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61 = frag_surf (xlt_IN_47); - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - xl_retval_48 = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63 = xl_retval_48.xyzw; - vec4 tmpvar_64; - tmpvar_64 = tmpvar_63; - gl_FragData[0] = tmpvar_64; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt index c0402c6e0..dcf1571bd 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt @@ -8,26 +8,36 @@ void main () vec4 tmpvar_1; tmpvar_1 = gl_TexCoord[3]; vec4 c_2; - vec4 tmpvar_3; - tmpvar_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color); - float tmpvar_4; - tmpvar_4 = tmpvar_3.w; + float tmpvar_3; + vec4 c_4; + c_4 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color); + tmpvar_3 = c_4.w; float x_5; - x_5 = (tmpvar_3.w - _Cutoff); + x_5 = (c_4.w - _Cutoff); if ((x_5 < 0.0)) { discard; }; vec4 c_6; - c_6.xyz = ((tmpvar_3.xyz * _LightColor0.xyz) * (( + c_6.xyz = ((c_4.xyz * _LightColor0.xyz) * (( max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) * ((float((tmpvar_1.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_1.xy / tmpvar_1.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_1.xyz, tmpvar_1.xyz))).w) ) * 2.0)); - c_6.w = tmpvar_4; + c_6.w = tmpvar_3; c_2.xyz = c_6.xyz; - c_2.w = tmpvar_4; + c_2.w = tmpvar_3; gl_FragData[0] = c_2; } -// inputs: 2, stats: 17 alu 4 tex 1 flow +// stats: 17 alu 4 tex 1 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Cutoff (high float) 1x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// textures: 3 +// #0: _LightTexture0 (high 2d) 0x0 [-1] +// #1: _LightTextureB0 (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-ir.txt deleted file mode 100644 index 36ffe0d87..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-ir.txt +++ /dev/null @@ -1,156 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 lop_color; - vec4 hip_screen; -}; -uniform float _Cutoff; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform vec4 unity_Ambient; -varying vec4 xlv_FOG; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -void surf ( - in Input IN_2, - inout SurfaceOutput o_3 -) -{ - vec4 c_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, IN_2.uv_MainTex); - vec4 tmpvar_6; - tmpvar_6 = (tmpvar_5 * IN_2.color); - c_4 = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = c_4.xyz; - o_3.Albedo = tmpvar_7; - float tmpvar_8; - tmpvar_8 = c_4.w; - o_3.Alpha = tmpvar_8; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_9, - in vec4 light_10 -) -{ - vec4 c_11; - vec3 tmpvar_12; - tmpvar_12 = (s_9.Albedo * light_10.xyz); - c_11.xyz = tmpvar_12.xyz.xyz; - float tmpvar_13; - tmpvar_13 = s_9.Alpha; - c_11.w = vec4(tmpvar_13).w; - return c_11; -} - -vec4 frag_surf ( - in v2f_surf IN_14 -) -{ - vec4 col_15; - vec4 light_16; - SurfaceOutput o_17; - Input surfIN_18; - vec2 tmpvar_19; - tmpvar_19 = IN_14.hip_pack0.xy; - surfIN_18.uv_MainTex = tmpvar_19; - vec4 tmpvar_20; - tmpvar_20 = IN_14.lop_color; - surfIN_18.color = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = vec3(0.0, 0.0, 0.0); - o_17.Albedo = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = vec3(0.0, 0.0, 0.0); - o_17.Emission = tmpvar_22; - float tmpvar_23; - tmpvar_23 = 0.0; - o_17.Specular = tmpvar_23; - float tmpvar_24; - tmpvar_24 = 0.0; - o_17.Alpha = tmpvar_24; - float tmpvar_25; - tmpvar_25 = 0.0; - o_17.Gloss = tmpvar_25; - surf (surfIN_18, o_17); - xll_clip ((o_17.Alpha - _Cutoff)); - vec4 tmpvar_26; - tmpvar_26 = texture2DProj (_LightBuffer, IN_14.hip_screen); - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - light_16 = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = log2 (light_16); - vec4 tmpvar_29; - tmpvar_29 = -(tmpvar_28); - light_16 = tmpvar_29; - vec3 tmpvar_30; - tmpvar_30 = (light_16.xyz + unity_Ambient.xyz); - light_16.xyz = tmpvar_30.xyz.xyz; - vec4 tmpvar_31; - tmpvar_31 = LightingLambert_PrePass (o_17, light_16); - vec4 tmpvar_32; - tmpvar_32 = tmpvar_31; - col_15 = tmpvar_32; - return col_15; -} - -void main () -{ - v2f_surf xlt_IN_33; - vec4 xl_retval_34; - vec4 tmpvar_35; - tmpvar_35 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_33.pos = tmpvar_35; - float tmpvar_36; - tmpvar_36 = xlv_FOG.x; - xlt_IN_33.fog = tmpvar_36; - vec2 tmpvar_37; - tmpvar_37 = gl_TexCoord[0].xy; - vec2 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlt_IN_33.hip_pack0 = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = gl_Color.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_IN_33.lop_color = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = gl_TexCoord[1].xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_IN_33.hip_screen = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43 = frag_surf (xlt_IN_33); - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - xl_retval_34 = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = xl_retval_34.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - gl_FragData[0] = tmpvar_46; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-out.txt index 314d722d8..61ec5cf28 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-out.txt @@ -5,22 +5,29 @@ uniform vec4 unity_Ambient; void main () { vec4 light_1; - vec4 tmpvar_2; - tmpvar_2 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color); + vec4 c_2; + c_2 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color); float x_3; - x_3 = (tmpvar_2.w - _Cutoff); + x_3 = (c_2.w - _Cutoff); if ((x_3 < 0.0)) { discard; }; - vec4 tmpvar_4; - tmpvar_4 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); - light_1.w = tmpvar_4.w; - light_1.xyz = (tmpvar_4.xyz + unity_Ambient.xyz); - vec4 c_5; - c_5.xyz = (tmpvar_2.xyz * light_1.xyz); - c_5.w = tmpvar_2.w; - gl_FragData[0] = c_5; + light_1 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); + light_1.xyz = (light_1.xyz + unity_Ambient.xyz); + vec4 c_4; + c_4.xyz = (c_2.xyz * light_1.xyz); + c_4.w = c_2.w; + gl_FragData[0] = c_4; } -// inputs: 2, stats: 7 alu 3 tex 1 flow +// stats: 7 alu 3 tex 1 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [2] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Cutoff (high float) 1x1 [-1] +// #1: unity_Ambient (high float) 4x1 [-1] +// textures: 2 +// #0: _LightBuffer (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-ir.txt deleted file mode 100644 index e65c20d5b..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-ir.txt +++ /dev/null @@ -1,44 +0,0 @@ -struct v2f { - vec4 vertex; - vec4 color; - vec2 texcoord; -}; -uniform sampler2D _MainTex; -vec4 frag ( - in v2f i_1 -) -{ - vec4 tmpvar_2; - tmpvar_2 = texture2D (_MainTex, i_1.texcoord); - return (tmpvar_2 * vec4(1.0, 0.0, 0.0, 1.0)); -} - -void main () -{ - v2f xlt_i_3; - vec4 xl_retval_4; - vec4 tmpvar_5; - tmpvar_5 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_3.vertex = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6 = gl_Color.xyzw; - vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - xlt_i_3.color = tmpvar_7; - vec2 tmpvar_8; - tmpvar_8 = gl_TexCoord[0].xy; - vec2 tmpvar_9; - tmpvar_9 = tmpvar_8; - xlt_i_3.texcoord = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10 = frag (xlt_i_3); - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - xl_retval_4 = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12 = xl_retval_4.xyzw; - vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - gl_FragData[0] = tmpvar_13; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-out.txt index 15dcb5100..53684bfe7 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-out.txt @@ -5,4 +5,8 @@ void main () } -// inputs: 1, stats: 1 alu 1 tex 0 flow +// stats: 1 alu 1 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-ir.txt deleted file mode 100644 index 32e58a0af..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-ir.txt +++ /dev/null @@ -1,56 +0,0 @@ -struct v2f { - vec4 pos; - float fog; - vec4 uv; - vec4 color; -}; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -vec4 frag ( - in v2f xlat_var_input_1 -) -{ - vec4 col_2; - vec4 tmpvar_3; - tmpvar_3 = xlat_var_input_1.color; - col_2 = tmpvar_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, xlat_var_input_1.uv.xy); - vec3 tmpvar_5; - tmpvar_5 = (col_2.xyz * (2.0 * tmpvar_4.xyz)); - col_2.xyz = tmpvar_5.xyz.xyz; - return col_2; -} - -void main () -{ - v2f xlt_xlat_var_input_6; - vec4 xl_retval_7; - vec4 tmpvar_8; - tmpvar_8 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_xlat_var_input_6.pos = tmpvar_8; - float tmpvar_9; - tmpvar_9 = xlv_FOG.x; - xlt_xlat_var_input_6.fog = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10 = gl_TexCoord[0].xyzw; - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - xlt_xlat_var_input_6.uv = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12 = gl_Color.xyzw; - vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - xlt_xlat_var_input_6.color = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = frag (xlt_xlat_var_input_6); - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - xl_retval_7 = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = xl_retval_7.xyzw; - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - gl_FragData[0] = tmpvar_17; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt index 616a8aee7..5645eeb51 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt @@ -8,4 +8,9 @@ void main () } -// inputs: 2, stats: 2 alu 1 tex 0 flow +// stats: 2 alu 1 tex 0 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [1] loc 4 +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-ir.txt deleted file mode 100644 index 361e01a58..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-ir.txt +++ /dev/null @@ -1,70 +0,0 @@ -struct v2f { - vec4 pos; - float fog; - vec4 uv; - vec4 color; -}; -uniform float _HalfOverCutoff; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -vec4 frag ( - in v2f xlat_var_input_2 -) -{ - vec4 col_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, xlat_var_input_2.uv.xy); - vec4 tmpvar_5; - tmpvar_5 = tmpvar_4; - col_3 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = (col_3.xyz * (2.0 * xlat_var_input_2.color.xyz)); - col_3.xyz = tmpvar_6.xyz.xyz; - float tmpvar_7; - tmpvar_7 = (col_3.w * (2.0 * _HalfOverCutoff)); - col_3.w = vec4(tmpvar_7).w; - xll_clip ((col_3.w - 1.0)); - return col_3; -} - -void main () -{ - v2f xlt_xlat_var_input_8; - vec4 xl_retval_9; - vec4 tmpvar_10; - tmpvar_10 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_xlat_var_input_8.pos = tmpvar_10; - float tmpvar_11; - tmpvar_11 = xlv_FOG.x; - xlt_xlat_var_input_8.fog = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12 = gl_TexCoord[0].xyzw; - vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - xlt_xlat_var_input_8.uv = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = gl_Color.xyzw; - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - xlt_xlat_var_input_8.color = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = frag (xlt_xlat_var_input_8); - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - xl_retval_9 = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = xl_retval_9.xyzw; - vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - gl_FragData[0] = tmpvar_19; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt index ccab03524..94fde0e13 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt @@ -16,4 +16,11 @@ void main () } -// inputs: 2, stats: 6 alu 2 tex 1 flow +// stats: 6 alu 2 tex 1 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [1] loc 4 +// uniforms: 1 (total size: 0) +// #0: _HalfOverCutoff (high float) 1x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-ir.txt deleted file mode 100644 index 86fbacc28..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-ir.txt +++ /dev/null @@ -1,221 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_Control; - vec2 uv_Splat0; - vec2 uv_Splat1; - vec2 uv_Splat2; - vec2 uv_Splat3; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec4 hip_pack1; - vec2 hip_pack2; - vec3 normal; - vec3 vlight; - vec4 _ShadowCoord; -}; -uniform sampler2D _Control; -uniform vec4 _LightColor0; -uniform sampler2D _ShadowMapTexture; -uniform sampler2D _Splat0; -uniform sampler2D _Splat1; -uniform sampler2D _Splat2; -uniform sampler2D _Splat3; -uniform vec4 _WorldSpaceLightPos0; -varying vec4 xlv_FOG; -float unitySampleShadow ( - in vec4 shadowCoord_1 -) -{ - float shadow_2; - vec4 tmpvar_3; - tmpvar_3 = texture2DProj (_ShadowMapTexture, shadowCoord_1); - float tmpvar_4; - tmpvar_4 = tmpvar_3.x; - shadow_2 = tmpvar_4; - return shadow_2; -} - -void surf ( - in Input IN_5, - inout SurfaceOutput o_6 -) -{ - vec3 col_7; - vec4 splat_control_8; - vec4 tmpvar_9; - tmpvar_9 = texture2D (_Control, IN_5.uv_Control); - vec4 tmpvar_10; - tmpvar_10 = tmpvar_9; - splat_control_8 = tmpvar_10; - vec4 tmpvar_11; - tmpvar_11 = texture2D (_Splat0, IN_5.uv_Splat0); - vec3 tmpvar_12; - tmpvar_12 = (splat_control_8.x * tmpvar_11.xyz); - col_7 = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13 = texture2D (_Splat1, IN_5.uv_Splat1); - vec3 tmpvar_14; - tmpvar_14 = (col_7 + (splat_control_8.y * tmpvar_13.xyz)); - col_7 = tmpvar_14; - vec4 tmpvar_15; - tmpvar_15 = texture2D (_Splat2, IN_5.uv_Splat2); - vec3 tmpvar_16; - tmpvar_16 = (col_7 + (splat_control_8.z * tmpvar_15.xyz)); - col_7 = tmpvar_16; - vec4 tmpvar_17; - tmpvar_17 = texture2D (_Splat3, IN_5.uv_Splat3); - vec3 tmpvar_18; - tmpvar_18 = (col_7 + (splat_control_8.w * tmpvar_17.xyz)); - col_7 = tmpvar_18; - vec3 tmpvar_19; - tmpvar_19 = col_7; - o_6.Albedo = tmpvar_19; - float tmpvar_20; - tmpvar_20 = 0.0; - o_6.Alpha = tmpvar_20; -} - -vec4 LightingLambert ( - in SurfaceOutput s_21, - in vec3 lightDir_22, - in float atten_23 -) -{ - vec4 c_24; - float diff_25; - float tmpvar_26; - tmpvar_26 = dot (s_21.Normal, lightDir_22); - float tmpvar_27; - tmpvar_27 = max (0.0, tmpvar_26); - float tmpvar_28; - tmpvar_28 = tmpvar_27; - diff_25 = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = ((s_21.Albedo * _LightColor0.xyz) * ((diff_25 * atten_23) * 2.0)); - c_24.xyz = tmpvar_29.xyz.xyz; - float tmpvar_30; - tmpvar_30 = s_21.Alpha; - c_24.w = vec4(tmpvar_30).w; - return c_24; -} - -vec4 frag_surf ( - in v2f_surf IN_31 -) -{ - vec4 c_32; - float atten_33; - SurfaceOutput o_34; - Input surfIN_35; - vec2 tmpvar_36; - tmpvar_36 = IN_31.hip_pack0.xy; - surfIN_35.uv_Control = tmpvar_36; - vec2 tmpvar_37; - tmpvar_37 = IN_31.hip_pack0.zw; - surfIN_35.uv_Splat0 = tmpvar_37; - vec2 tmpvar_38; - tmpvar_38 = IN_31.hip_pack1.xy; - surfIN_35.uv_Splat1 = tmpvar_38; - vec2 tmpvar_39; - tmpvar_39 = IN_31.hip_pack1.zw; - surfIN_35.uv_Splat2 = tmpvar_39; - vec2 tmpvar_40; - tmpvar_40 = IN_31.hip_pack2.xy; - surfIN_35.uv_Splat3 = tmpvar_40; - vec3 tmpvar_41; - tmpvar_41 = vec3(0.0, 0.0, 0.0); - o_34.Albedo = tmpvar_41; - vec3 tmpvar_42; - tmpvar_42 = vec3(0.0, 0.0, 0.0); - o_34.Emission = tmpvar_42; - float tmpvar_43; - tmpvar_43 = 0.0; - o_34.Specular = tmpvar_43; - float tmpvar_44; - tmpvar_44 = 0.0; - o_34.Alpha = tmpvar_44; - float tmpvar_45; - tmpvar_45 = 0.0; - o_34.Gloss = tmpvar_45; - vec3 tmpvar_46; - tmpvar_46 = IN_31.normal; - o_34.Normal = tmpvar_46; - surf (surfIN_35, o_34); - float tmpvar_47; - tmpvar_47 = unitySampleShadow (IN_31._ShadowCoord); - float tmpvar_48; - tmpvar_48 = tmpvar_47; - atten_33 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = LightingLambert (o_34, _WorldSpaceLightPos0.xyz, atten_33); - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - c_32 = tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = (c_32.xyz + (o_34.Albedo * IN_31.vlight)); - c_32.xyz = tmpvar_51.xyz.xyz; - return c_32; -} - -void main () -{ - v2f_surf xlt_IN_52; - vec4 xl_retval_53; - vec4 tmpvar_54; - tmpvar_54 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_52.pos = tmpvar_54; - float tmpvar_55; - tmpvar_55 = xlv_FOG.x; - xlt_IN_52.fog = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = gl_TexCoord[0].xyzw; - vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - xlt_IN_52.hip_pack0 = tmpvar_57; - vec4 tmpvar_58; - tmpvar_58 = gl_TexCoord[1].xyzw; - vec4 tmpvar_59; - tmpvar_59 = tmpvar_58; - xlt_IN_52.hip_pack1 = tmpvar_59; - vec2 tmpvar_60; - tmpvar_60 = gl_TexCoord[2].xy; - vec2 tmpvar_61; - tmpvar_61 = tmpvar_60; - xlt_IN_52.hip_pack2 = tmpvar_61; - vec3 tmpvar_62; - tmpvar_62 = gl_TexCoord[3].xyz; - vec3 tmpvar_63; - tmpvar_63 = tmpvar_62; - xlt_IN_52.normal = tmpvar_63; - vec3 tmpvar_64; - tmpvar_64 = gl_TexCoord[4].xyz; - vec3 tmpvar_65; - tmpvar_65 = tmpvar_64; - xlt_IN_52.vlight = tmpvar_65; - vec4 tmpvar_66; - tmpvar_66 = gl_TexCoord[5].xyzw; - vec4 tmpvar_67; - tmpvar_67 = tmpvar_66; - xlt_IN_52._ShadowCoord = tmpvar_67; - vec4 tmpvar_68; - tmpvar_68 = frag_surf (xlt_IN_52); - vec4 tmpvar_69; - tmpvar_69 = tmpvar_68; - xl_retval_53 = tmpvar_69; - vec4 tmpvar_70; - tmpvar_70 = xl_retval_53.xyzw; - vec4 tmpvar_71; - tmpvar_71 = tmpvar_70; - gl_FragData[0] = tmpvar_71; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt index e2d7abab5..5a3af77ef 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt @@ -13,23 +13,34 @@ void main () vec4 tmpvar_2; tmpvar_2 = gl_TexCoord[1]; vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_Control, tmpvar_1.xy); - vec3 tmpvar_5; - tmpvar_5 = ((( - (tmpvar_4.x * texture2D (_Splat0, tmpvar_1.zw).xyz) - + - (tmpvar_4.y * texture2D (_Splat1, tmpvar_2.xy).xyz) - ) + (tmpvar_4.z * texture2D (_Splat2, tmpvar_2.zw).xyz)) + (tmpvar_4.w * texture2D (_Splat3, gl_TexCoord[2].xy).xyz)); + vec3 col_4; + vec4 tmpvar_5; + tmpvar_5 = texture2D (_Control, tmpvar_1.xy); + col_4 = (tmpvar_5.x * texture2D (_Splat0, tmpvar_1.zw).xyz); + col_4 = (col_4 + (tmpvar_5.y * texture2D (_Splat1, tmpvar_2.xy).xyz)); + col_4 = (col_4 + (tmpvar_5.z * texture2D (_Splat2, tmpvar_2.zw).xyz)); + col_4 = (col_4 + (tmpvar_5.w * texture2D (_Splat3, gl_TexCoord[2].xy).xyz)); vec4 c_6; - c_6.xyz = ((tmpvar_5 * _LightColor0.xyz) * (( + c_6.xyz = ((col_4 * _LightColor0.xyz) * (( max (0.0, dot (gl_TexCoord[3].xyz, _WorldSpaceLightPos0.xyz)) * texture2DProj (_ShadowMapTexture, gl_TexCoord[5]).x) * 2.0)); c_6.w = 0.0; c_3.w = c_6.w; - c_3.xyz = (c_6.xyz + (tmpvar_5 * gl_TexCoord[4].xyz)); + c_3.xyz = (c_6.xyz + (col_4 * gl_TexCoord[4].xyz)); gl_FragData[0] = c_3; } -// inputs: 1, stats: 16 alu 6 tex 0 flow +// stats: 16 alu 6 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [6] loc 4 +// uniforms: 2 (total size: 0) +// #0: _LightColor0 (high float) 4x1 [-1] +// #1: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// textures: 6 +// #0: _Control (high 2d) 0x0 [-1] +// #1: _ShadowMapTexture (high 2d) 0x0 [-1] +// #2: _Splat0 (high 2d) 0x0 [-1] +// #3: _Splat1 (high 2d) 0x0 [-1] +// #4: _Splat2 (high 2d) 0x0 [-1] +// #5: _Splat3 (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-ir.txt deleted file mode 100644 index 4d0a5db3e..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-ir.txt +++ /dev/null @@ -1,188 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_Control; - vec2 uv_Splat0; - vec2 uv_Splat1; - vec2 uv_Splat2; - vec2 uv_Splat3; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec4 hip_pack1; - vec2 hip_pack2; - vec4 hip_screen; -}; -uniform sampler2D _Control; -uniform sampler2D _LightBuffer; -uniform sampler2D _Splat0; -uniform sampler2D _Splat1; -uniform sampler2D _Splat2; -uniform sampler2D _Splat3; -uniform vec4 unity_Ambient; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec3 col_3; - vec4 splat_control_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_Control, IN_1.uv_Control); - vec4 tmpvar_6; - tmpvar_6 = tmpvar_5; - splat_control_4 = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7 = texture2D (_Splat0, IN_1.uv_Splat0); - vec3 tmpvar_8; - tmpvar_8 = (splat_control_4.x * tmpvar_7.xyz); - col_3 = tmpvar_8; - vec4 tmpvar_9; - tmpvar_9 = texture2D (_Splat1, IN_1.uv_Splat1); - vec3 tmpvar_10; - tmpvar_10 = (col_3 + (splat_control_4.y * tmpvar_9.xyz)); - col_3 = tmpvar_10; - vec4 tmpvar_11; - tmpvar_11 = texture2D (_Splat2, IN_1.uv_Splat2); - vec3 tmpvar_12; - tmpvar_12 = (col_3 + (splat_control_4.z * tmpvar_11.xyz)); - col_3 = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13 = texture2D (_Splat3, IN_1.uv_Splat3); - vec3 tmpvar_14; - tmpvar_14 = (col_3 + (splat_control_4.w * tmpvar_13.xyz)); - col_3 = tmpvar_14; - vec3 tmpvar_15; - tmpvar_15 = col_3; - o_2.Albedo = tmpvar_15; - float tmpvar_16; - tmpvar_16 = 0.0; - o_2.Alpha = tmpvar_16; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_17, - in vec4 light_18 -) -{ - vec4 c_19; - vec3 tmpvar_20; - tmpvar_20 = (s_17.Albedo * light_18.xyz); - c_19.xyz = tmpvar_20.xyz.xyz; - float tmpvar_21; - tmpvar_21 = s_17.Alpha; - c_19.w = vec4(tmpvar_21).w; - return c_19; -} - -vec4 frag_surf ( - in v2f_surf IN_22 -) -{ - vec4 col_23; - vec4 light_24; - SurfaceOutput o_25; - Input surfIN_26; - vec2 tmpvar_27; - tmpvar_27 = IN_22.hip_pack0.xy; - surfIN_26.uv_Control = tmpvar_27; - vec2 tmpvar_28; - tmpvar_28 = IN_22.hip_pack0.zw; - surfIN_26.uv_Splat0 = tmpvar_28; - vec2 tmpvar_29; - tmpvar_29 = IN_22.hip_pack1.xy; - surfIN_26.uv_Splat1 = tmpvar_29; - vec2 tmpvar_30; - tmpvar_30 = IN_22.hip_pack1.zw; - surfIN_26.uv_Splat2 = tmpvar_30; - vec2 tmpvar_31; - tmpvar_31 = IN_22.hip_pack2.xy; - surfIN_26.uv_Splat3 = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = vec3(0.0, 0.0, 0.0); - o_25.Albedo = tmpvar_32; - vec3 tmpvar_33; - tmpvar_33 = vec3(0.0, 0.0, 0.0); - o_25.Emission = tmpvar_33; - float tmpvar_34; - tmpvar_34 = 0.0; - o_25.Specular = tmpvar_34; - float tmpvar_35; - tmpvar_35 = 0.0; - o_25.Alpha = tmpvar_35; - float tmpvar_36; - tmpvar_36 = 0.0; - o_25.Gloss = tmpvar_36; - surf (surfIN_26, o_25); - vec4 tmpvar_37; - tmpvar_37 = texture2DProj (_LightBuffer, IN_22.hip_screen); - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - light_24 = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = log2 (light_24); - vec4 tmpvar_40; - tmpvar_40 = -(tmpvar_39); - light_24 = tmpvar_40; - vec3 tmpvar_41; - tmpvar_41 = (light_24.xyz + unity_Ambient.xyz); - light_24.xyz = tmpvar_41.xyz.xyz; - vec4 tmpvar_42; - tmpvar_42 = LightingLambert_PrePass (o_25, light_24); - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - col_23 = tmpvar_43; - return col_23; -} - -void main () -{ - v2f_surf xlt_IN_44; - vec4 xl_retval_45; - vec4 tmpvar_46; - tmpvar_46 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_44.pos = tmpvar_46; - float tmpvar_47; - tmpvar_47 = xlv_FOG.x; - xlt_IN_44.fog = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48 = gl_TexCoord[0].xyzw; - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - xlt_IN_44.hip_pack0 = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50 = gl_TexCoord[1].xyzw; - vec4 tmpvar_51; - tmpvar_51 = tmpvar_50; - xlt_IN_44.hip_pack1 = tmpvar_51; - vec2 tmpvar_52; - tmpvar_52 = gl_TexCoord[2].xy; - vec2 tmpvar_53; - tmpvar_53 = tmpvar_52; - xlt_IN_44.hip_pack2 = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54 = gl_TexCoord[3].xyzw; - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - xlt_IN_44.hip_screen = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = frag_surf (xlt_IN_44); - vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - xl_retval_45 = tmpvar_57; - vec4 tmpvar_58; - tmpvar_58 = xl_retval_45.xyzw; - vec4 tmpvar_59; - tmpvar_59 = tmpvar_58; - gl_FragData[0] = tmpvar_59; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-out.txt index 49dce375d..d10280424 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-out.txt @@ -12,21 +12,31 @@ void main () vec4 tmpvar_2; tmpvar_2 = gl_TexCoord[1]; vec4 light_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_Control, tmpvar_1.xy); + vec3 col_4; vec4 tmpvar_5; - tmpvar_5 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[3]))); - light_3.w = tmpvar_5.w; - light_3.xyz = (tmpvar_5.xyz + unity_Ambient.xyz); + tmpvar_5 = texture2D (_Control, tmpvar_1.xy); + col_4 = (tmpvar_5.x * texture2D (_Splat0, tmpvar_1.zw).xyz); + col_4 = (col_4 + (tmpvar_5.y * texture2D (_Splat1, tmpvar_2.xy).xyz)); + col_4 = (col_4 + (tmpvar_5.z * texture2D (_Splat2, tmpvar_2.zw).xyz)); + col_4 = (col_4 + (tmpvar_5.w * texture2D (_Splat3, gl_TexCoord[2].xy).xyz)); + light_3 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[3]))); + light_3.xyz = (light_3.xyz + unity_Ambient.xyz); vec4 c_6; - c_6.xyz = ((( - ((tmpvar_4.x * texture2D (_Splat0, tmpvar_1.zw).xyz) + (tmpvar_4.y * texture2D (_Splat1, tmpvar_2.xy).xyz)) - + - (tmpvar_4.z * texture2D (_Splat2, tmpvar_2.zw).xyz) - ) + (tmpvar_4.w * texture2D (_Splat3, gl_TexCoord[2].xy).xyz)) * light_3.xyz); + c_6.xyz = (col_4 * light_3.xyz); c_6.w = 0.0; gl_FragData[0] = c_6; } -// inputs: 1, stats: 12 alu 6 tex 0 flow +// stats: 12 alu 6 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 1 (total size: 0) +// #0: unity_Ambient (high float) 4x1 [-1] +// textures: 6 +// #0: _Control (high 2d) 0x0 [-1] +// #1: _LightBuffer (high 2d) 0x0 [-1] +// #2: _Splat0 (high 2d) 0x0 [-1] +// #3: _Splat1 (high 2d) 0x0 [-1] +// #4: _Splat2 (high 2d) 0x0 [-1] +// #5: _Splat3 (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-ir.txt deleted file mode 100644 index 4d0a5db3e..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-ir.txt +++ /dev/null @@ -1,188 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_Control; - vec2 uv_Splat0; - vec2 uv_Splat1; - vec2 uv_Splat2; - vec2 uv_Splat3; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec4 hip_pack1; - vec2 hip_pack2; - vec4 hip_screen; -}; -uniform sampler2D _Control; -uniform sampler2D _LightBuffer; -uniform sampler2D _Splat0; -uniform sampler2D _Splat1; -uniform sampler2D _Splat2; -uniform sampler2D _Splat3; -uniform vec4 unity_Ambient; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec3 col_3; - vec4 splat_control_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_Control, IN_1.uv_Control); - vec4 tmpvar_6; - tmpvar_6 = tmpvar_5; - splat_control_4 = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7 = texture2D (_Splat0, IN_1.uv_Splat0); - vec3 tmpvar_8; - tmpvar_8 = (splat_control_4.x * tmpvar_7.xyz); - col_3 = tmpvar_8; - vec4 tmpvar_9; - tmpvar_9 = texture2D (_Splat1, IN_1.uv_Splat1); - vec3 tmpvar_10; - tmpvar_10 = (col_3 + (splat_control_4.y * tmpvar_9.xyz)); - col_3 = tmpvar_10; - vec4 tmpvar_11; - tmpvar_11 = texture2D (_Splat2, IN_1.uv_Splat2); - vec3 tmpvar_12; - tmpvar_12 = (col_3 + (splat_control_4.z * tmpvar_11.xyz)); - col_3 = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13 = texture2D (_Splat3, IN_1.uv_Splat3); - vec3 tmpvar_14; - tmpvar_14 = (col_3 + (splat_control_4.w * tmpvar_13.xyz)); - col_3 = tmpvar_14; - vec3 tmpvar_15; - tmpvar_15 = col_3; - o_2.Albedo = tmpvar_15; - float tmpvar_16; - tmpvar_16 = 0.0; - o_2.Alpha = tmpvar_16; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_17, - in vec4 light_18 -) -{ - vec4 c_19; - vec3 tmpvar_20; - tmpvar_20 = (s_17.Albedo * light_18.xyz); - c_19.xyz = tmpvar_20.xyz.xyz; - float tmpvar_21; - tmpvar_21 = s_17.Alpha; - c_19.w = vec4(tmpvar_21).w; - return c_19; -} - -vec4 frag_surf ( - in v2f_surf IN_22 -) -{ - vec4 col_23; - vec4 light_24; - SurfaceOutput o_25; - Input surfIN_26; - vec2 tmpvar_27; - tmpvar_27 = IN_22.hip_pack0.xy; - surfIN_26.uv_Control = tmpvar_27; - vec2 tmpvar_28; - tmpvar_28 = IN_22.hip_pack0.zw; - surfIN_26.uv_Splat0 = tmpvar_28; - vec2 tmpvar_29; - tmpvar_29 = IN_22.hip_pack1.xy; - surfIN_26.uv_Splat1 = tmpvar_29; - vec2 tmpvar_30; - tmpvar_30 = IN_22.hip_pack1.zw; - surfIN_26.uv_Splat2 = tmpvar_30; - vec2 tmpvar_31; - tmpvar_31 = IN_22.hip_pack2.xy; - surfIN_26.uv_Splat3 = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = vec3(0.0, 0.0, 0.0); - o_25.Albedo = tmpvar_32; - vec3 tmpvar_33; - tmpvar_33 = vec3(0.0, 0.0, 0.0); - o_25.Emission = tmpvar_33; - float tmpvar_34; - tmpvar_34 = 0.0; - o_25.Specular = tmpvar_34; - float tmpvar_35; - tmpvar_35 = 0.0; - o_25.Alpha = tmpvar_35; - float tmpvar_36; - tmpvar_36 = 0.0; - o_25.Gloss = tmpvar_36; - surf (surfIN_26, o_25); - vec4 tmpvar_37; - tmpvar_37 = texture2DProj (_LightBuffer, IN_22.hip_screen); - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - light_24 = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = log2 (light_24); - vec4 tmpvar_40; - tmpvar_40 = -(tmpvar_39); - light_24 = tmpvar_40; - vec3 tmpvar_41; - tmpvar_41 = (light_24.xyz + unity_Ambient.xyz); - light_24.xyz = tmpvar_41.xyz.xyz; - vec4 tmpvar_42; - tmpvar_42 = LightingLambert_PrePass (o_25, light_24); - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - col_23 = tmpvar_43; - return col_23; -} - -void main () -{ - v2f_surf xlt_IN_44; - vec4 xl_retval_45; - vec4 tmpvar_46; - tmpvar_46 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_44.pos = tmpvar_46; - float tmpvar_47; - tmpvar_47 = xlv_FOG.x; - xlt_IN_44.fog = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48 = gl_TexCoord[0].xyzw; - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - xlt_IN_44.hip_pack0 = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50 = gl_TexCoord[1].xyzw; - vec4 tmpvar_51; - tmpvar_51 = tmpvar_50; - xlt_IN_44.hip_pack1 = tmpvar_51; - vec2 tmpvar_52; - tmpvar_52 = gl_TexCoord[2].xy; - vec2 tmpvar_53; - tmpvar_53 = tmpvar_52; - xlt_IN_44.hip_pack2 = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54 = gl_TexCoord[3].xyzw; - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - xlt_IN_44.hip_screen = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = frag_surf (xlt_IN_44); - vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - xl_retval_45 = tmpvar_57; - vec4 tmpvar_58; - tmpvar_58 = xl_retval_45.xyzw; - vec4 tmpvar_59; - tmpvar_59 = tmpvar_58; - gl_FragData[0] = tmpvar_59; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-out.txt index 49dce375d..d10280424 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-out.txt @@ -12,21 +12,31 @@ void main () vec4 tmpvar_2; tmpvar_2 = gl_TexCoord[1]; vec4 light_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_Control, tmpvar_1.xy); + vec3 col_4; vec4 tmpvar_5; - tmpvar_5 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[3]))); - light_3.w = tmpvar_5.w; - light_3.xyz = (tmpvar_5.xyz + unity_Ambient.xyz); + tmpvar_5 = texture2D (_Control, tmpvar_1.xy); + col_4 = (tmpvar_5.x * texture2D (_Splat0, tmpvar_1.zw).xyz); + col_4 = (col_4 + (tmpvar_5.y * texture2D (_Splat1, tmpvar_2.xy).xyz)); + col_4 = (col_4 + (tmpvar_5.z * texture2D (_Splat2, tmpvar_2.zw).xyz)); + col_4 = (col_4 + (tmpvar_5.w * texture2D (_Splat3, gl_TexCoord[2].xy).xyz)); + light_3 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[3]))); + light_3.xyz = (light_3.xyz + unity_Ambient.xyz); vec4 c_6; - c_6.xyz = ((( - ((tmpvar_4.x * texture2D (_Splat0, tmpvar_1.zw).xyz) + (tmpvar_4.y * texture2D (_Splat1, tmpvar_2.xy).xyz)) - + - (tmpvar_4.z * texture2D (_Splat2, tmpvar_2.zw).xyz) - ) + (tmpvar_4.w * texture2D (_Splat3, gl_TexCoord[2].xy).xyz)) * light_3.xyz); + c_6.xyz = (col_4 * light_3.xyz); c_6.w = 0.0; gl_FragData[0] = c_6; } -// inputs: 1, stats: 12 alu 6 tex 0 flow +// stats: 12 alu 6 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 1 (total size: 0) +// #0: unity_Ambient (high float) 4x1 [-1] +// textures: 6 +// #0: _Control (high 2d) 0x0 [-1] +// #1: _LightBuffer (high 2d) 0x0 [-1] +// #2: _Splat0 (high 2d) 0x0 [-1] +// #3: _Splat1 (high 2d) 0x0 [-1] +// #4: _Splat2 (high 2d) 0x0 [-1] +// #5: _Splat3 (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-ir.txt deleted file mode 100644 index 192ae411a..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-ir.txt +++ /dev/null @@ -1,333 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_Control; - vec2 uv_Splat0; - vec2 uv_Splat1; - vec2 uv_Splat2; - vec2 uv_Splat3; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec4 hip_pack1; - vec2 hip_pack2; - vec4 hip_screen; - vec3 hip_lmapFade; -}; -uniform sampler2D _Control; -uniform sampler2D _LightBuffer; -uniform sampler2D _Splat0; -uniform sampler2D _Splat1; -uniform sampler2D _Splat2; -uniform sampler2D _Splat3; -uniform sampler2D unity_Lightmap; -uniform sampler2D unity_LightmapInd; -varying vec4 xlv_FOG; -float xll_saturate ( - in float x_1 -) -{ - float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -vec2 xll_saturate ( - in vec2 x_3 -) -{ - vec2 tmpvar_4; - tmpvar_4 = clamp (x_3, 0.0, 1.0); - return tmpvar_4; -} - -vec3 xll_saturate ( - in vec3 x_5 -) -{ - vec3 tmpvar_6; - tmpvar_6 = clamp (x_5, 0.0, 1.0); - return tmpvar_6; -} - -vec4 xll_saturate ( - in vec4 x_7 -) -{ - vec4 tmpvar_8; - tmpvar_8 = clamp (x_7, 0.0, 1.0); - return tmpvar_8; -} - -mat2 xll_saturate ( - in mat2 m_9 -) -{ - vec2 tmpvar_10; - tmpvar_10 = clamp (m_9[0], 0.0, 1.0); - vec2 tmpvar_11; - tmpvar_11 = clamp (m_9[1], 0.0, 1.0); - mat2 tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_10; - tmpvar_12[0] = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_12[1] = tmpvar_14; - return tmpvar_12; -} - -mat3 xll_saturate ( - in mat3 m_15 -) -{ - vec3 tmpvar_16; - tmpvar_16 = clamp (m_15[0], 0.0, 1.0); - vec3 tmpvar_17; - tmpvar_17 = clamp (m_15[1], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_15[2], 0.0, 1.0); - mat3 tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_16; - tmpvar_19[0] = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_19[1] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_19[2] = tmpvar_22; - return tmpvar_19; -} - -mat4 xll_saturate ( - in mat4 m_23 -) -{ - vec4 tmpvar_24; - tmpvar_24 = clamp (m_23[0], 0.0, 1.0); - vec4 tmpvar_25; - tmpvar_25 = clamp (m_23[1], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_23[2], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_23[3], 0.0, 1.0); - mat4 tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_24; - tmpvar_28[0] = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_28[1] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_28[2] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_28[3] = tmpvar_32; - return tmpvar_28; -} - -void surf ( - in Input IN_33, - inout SurfaceOutput o_34 -) -{ - vec3 col_35; - vec4 splat_control_36; - vec4 tmpvar_37; - tmpvar_37 = texture2D (_Control, IN_33.uv_Control); - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - splat_control_36 = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = texture2D (_Splat0, IN_33.uv_Splat0); - vec3 tmpvar_40; - tmpvar_40 = (splat_control_36.x * tmpvar_39.xyz); - col_35 = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = texture2D (_Splat1, IN_33.uv_Splat1); - vec3 tmpvar_42; - tmpvar_42 = (col_35 + (splat_control_36.y * tmpvar_41.xyz)); - col_35 = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43 = texture2D (_Splat2, IN_33.uv_Splat2); - vec3 tmpvar_44; - tmpvar_44 = (col_35 + (splat_control_36.z * tmpvar_43.xyz)); - col_35 = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = texture2D (_Splat3, IN_33.uv_Splat3); - vec3 tmpvar_46; - tmpvar_46 = (col_35 + (splat_control_36.w * tmpvar_45.xyz)); - col_35 = tmpvar_46; - vec3 tmpvar_47; - tmpvar_47 = col_35; - o_34.Albedo = tmpvar_47; - float tmpvar_48; - tmpvar_48 = 0.0; - o_34.Alpha = tmpvar_48; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_49, - in vec4 light_50 -) -{ - vec4 c_51; - vec3 tmpvar_52; - tmpvar_52 = (s_49.Albedo * light_50.xyz); - c_51.xyz = tmpvar_52.xyz.xyz; - float tmpvar_53; - tmpvar_53 = s_49.Alpha; - c_51.w = vec4(tmpvar_53).w; - return c_51; -} - -vec3 DecodeLightmap ( - in vec4 color_54 -) -{ - return (2.0 * color_54.xyz); -} - -vec4 frag_surf ( - in v2f_surf IN_55 -) -{ - vec4 col_56; - vec3 lm_57; - vec3 lmIndirect_58; - vec3 lmFull_59; - vec4 light_60; - SurfaceOutput o_61; - Input surfIN_62; - vec2 tmpvar_63; - tmpvar_63 = IN_55.hip_pack0.xy; - surfIN_62.uv_Control = tmpvar_63; - vec2 tmpvar_64; - tmpvar_64 = IN_55.hip_pack0.zw; - surfIN_62.uv_Splat0 = tmpvar_64; - vec2 tmpvar_65; - tmpvar_65 = IN_55.hip_pack1.xy; - surfIN_62.uv_Splat1 = tmpvar_65; - vec2 tmpvar_66; - tmpvar_66 = IN_55.hip_pack1.zw; - surfIN_62.uv_Splat2 = tmpvar_66; - vec2 tmpvar_67; - tmpvar_67 = IN_55.hip_pack2.xy; - surfIN_62.uv_Splat3 = tmpvar_67; - vec3 tmpvar_68; - tmpvar_68 = vec3(0.0, 0.0, 0.0); - o_61.Albedo = tmpvar_68; - vec3 tmpvar_69; - tmpvar_69 = vec3(0.0, 0.0, 0.0); - o_61.Emission = tmpvar_69; - float tmpvar_70; - tmpvar_70 = 0.0; - o_61.Specular = tmpvar_70; - float tmpvar_71; - tmpvar_71 = 0.0; - o_61.Alpha = tmpvar_71; - float tmpvar_72; - tmpvar_72 = 0.0; - o_61.Gloss = tmpvar_72; - surf (surfIN_62, o_61); - vec4 tmpvar_73; - tmpvar_73 = texture2DProj (_LightBuffer, IN_55.hip_screen); - vec4 tmpvar_74; - tmpvar_74 = tmpvar_73; - light_60 = tmpvar_74; - vec4 tmpvar_75; - tmpvar_75 = log2 (light_60); - vec4 tmpvar_76; - tmpvar_76 = -(tmpvar_75); - light_60 = tmpvar_76; - vec4 tmpvar_77; - tmpvar_77 = texture2D (unity_Lightmap, IN_55.hip_lmapFade.xy); - vec3 tmpvar_78; - tmpvar_78 = DecodeLightmap (tmpvar_77); - vec3 tmpvar_79; - tmpvar_79 = tmpvar_78; - lmFull_59 = tmpvar_79; - vec4 tmpvar_80; - tmpvar_80 = texture2D (unity_LightmapInd, IN_55.hip_lmapFade.xy); - vec3 tmpvar_81; - tmpvar_81 = DecodeLightmap (tmpvar_80); - vec3 tmpvar_82; - tmpvar_82 = tmpvar_81; - lmIndirect_58 = tmpvar_82; - float tmpvar_83; - tmpvar_83 = xll_saturate (IN_55.hip_lmapFade.z); - vec3 tmpvar_84; - tmpvar_84 = vec3(tmpvar_83); - vec3 tmpvar_85; - tmpvar_85 = mix (lmIndirect_58, lmFull_59, tmpvar_84); - vec3 tmpvar_86; - tmpvar_86 = tmpvar_85; - lm_57 = tmpvar_86; - vec3 tmpvar_87; - tmpvar_87 = (light_60.xyz + lm_57); - light_60.xyz = tmpvar_87.xyz.xyz; - vec4 tmpvar_88; - tmpvar_88 = LightingLambert_PrePass (o_61, light_60); - vec4 tmpvar_89; - tmpvar_89 = tmpvar_88; - col_56 = tmpvar_89; - return col_56; -} - -void main () -{ - v2f_surf xlt_IN_90; - vec4 xl_retval_91; - vec4 tmpvar_92; - tmpvar_92 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_90.pos = tmpvar_92; - float tmpvar_93; - tmpvar_93 = xlv_FOG.x; - xlt_IN_90.fog = tmpvar_93; - vec4 tmpvar_94; - tmpvar_94 = gl_TexCoord[0].xyzw; - vec4 tmpvar_95; - tmpvar_95 = tmpvar_94; - xlt_IN_90.hip_pack0 = tmpvar_95; - vec4 tmpvar_96; - tmpvar_96 = gl_TexCoord[1].xyzw; - vec4 tmpvar_97; - tmpvar_97 = tmpvar_96; - xlt_IN_90.hip_pack1 = tmpvar_97; - vec2 tmpvar_98; - tmpvar_98 = gl_TexCoord[2].xy; - vec2 tmpvar_99; - tmpvar_99 = tmpvar_98; - xlt_IN_90.hip_pack2 = tmpvar_99; - vec4 tmpvar_100; - tmpvar_100 = gl_TexCoord[3].xyzw; - vec4 tmpvar_101; - tmpvar_101 = tmpvar_100; - xlt_IN_90.hip_screen = tmpvar_101; - vec3 tmpvar_102; - tmpvar_102 = gl_TexCoord[4].xyz; - vec3 tmpvar_103; - tmpvar_103 = tmpvar_102; - xlt_IN_90.hip_lmapFade = tmpvar_103; - vec4 tmpvar_104; - tmpvar_104 = frag_surf (xlt_IN_90); - vec4 tmpvar_105; - tmpvar_105 = tmpvar_104; - xl_retval_91 = tmpvar_105; - vec4 tmpvar_106; - tmpvar_106 = xl_retval_91.xyzw; - vec4 tmpvar_107; - tmpvar_107 = tmpvar_106; - gl_FragData[0] = tmpvar_107; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt index 58d383722..627c01951 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt @@ -15,21 +15,31 @@ void main () vec3 tmpvar_3; tmpvar_3 = gl_TexCoord[4].xyz; vec4 light_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_Control, tmpvar_1.xy); + vec3 col_5; vec4 tmpvar_6; - tmpvar_6 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[3]))); - light_4.w = tmpvar_6.w; - light_4.xyz = (tmpvar_6.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_3.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_3.xy).xyz), vec3(clamp (tmpvar_3.z, 0.0, 1.0)))); + tmpvar_6 = texture2D (_Control, tmpvar_1.xy); + col_5 = (tmpvar_6.x * texture2D (_Splat0, tmpvar_1.zw).xyz); + col_5 = (col_5 + (tmpvar_6.y * texture2D (_Splat1, tmpvar_2.xy).xyz)); + col_5 = (col_5 + (tmpvar_6.z * texture2D (_Splat2, tmpvar_2.zw).xyz)); + col_5 = (col_5 + (tmpvar_6.w * texture2D (_Splat3, gl_TexCoord[2].xy).xyz)); + light_4 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[3]))); + light_4.xyz = (light_4.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_3.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_3.xy).xyz), vec3(clamp (tmpvar_3.z, 0.0, 1.0)))); vec4 c_7; - c_7.xyz = ((( - ((tmpvar_5.x * texture2D (_Splat0, tmpvar_1.zw).xyz) + (tmpvar_5.y * texture2D (_Splat1, tmpvar_2.xy).xyz)) - + - (tmpvar_5.z * texture2D (_Splat2, tmpvar_2.zw).xyz) - ) + (tmpvar_5.w * texture2D (_Splat3, gl_TexCoord[2].xy).xyz)) * light_4.xyz); + c_7.xyz = (col_5 * light_4.xyz); c_7.w = 0.0; gl_FragData[0] = c_7; } -// inputs: 1, stats: 16 alu 8 tex 0 flow +// stats: 16 alu 8 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [5] loc 4 +// textures: 8 +// #0: _Control (high 2d) 0x0 [-1] +// #1: _LightBuffer (high 2d) 0x0 [-1] +// #2: _Splat0 (high 2d) 0x0 [-1] +// #3: _Splat1 (high 2d) 0x0 [-1] +// #4: _Splat2 (high 2d) 0x0 [-1] +// #5: _Splat3 (high 2d) 0x0 [-1] +// #6: unity_Lightmap (high 2d) 0x0 [-1] +// #7: unity_LightmapInd (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Bark_Shader_Rendertex-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Bark_Shader_Rendertex-ir.txt deleted file mode 100644 index 39a305193..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Bark_Shader_Rendertex-ir.txt +++ /dev/null @@ -1,54 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; - vec3 color; -}; -uniform sampler2D _MainTex; -vec4 frag ( - in v2f i_1 -) -{ - vec4 col_2; - vec4 tmpvar_3; - tmpvar_3 = texture2D (_MainTex, i_1.uv); - vec4 tmpvar_4; - tmpvar_4 = tmpvar_3; - col_2 = tmpvar_4; - vec3 tmpvar_5; - tmpvar_5 = (col_2.xyz * (i_1.color * 2.0)); - col_2.xyz = tmpvar_5.xyz.xyz; - float tmpvar_6; - tmpvar_6 = 1.0; - col_2.w = vec4(tmpvar_6).w; - return col_2; -} - -void main () -{ - v2f xlt_i_7; - vec4 xl_retval_8; - vec4 tmpvar_9; - tmpvar_9 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_7.pos = tmpvar_9; - vec2 tmpvar_10; - tmpvar_10 = gl_TexCoord[0].xy; - vec2 tmpvar_11; - tmpvar_11 = tmpvar_10; - xlt_i_7.uv = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = gl_TexCoord[1].xyz; - vec3 tmpvar_13; - tmpvar_13 = tmpvar_12; - xlt_i_7.color = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = frag (xlt_i_7); - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - xl_retval_8 = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = xl_retval_8.xyzw; - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - gl_FragData[0] = tmpvar_17; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt index 1f0afebe1..8598d0b45 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt @@ -8,4 +8,8 @@ void main () } -// inputs: 1, stats: 3 alu 1 tex 0 flow +// stats: 3 alu 1 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [2] loc 4 +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-ir.txt deleted file mode 100644 index ebcb56318..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-ir.txt +++ /dev/null @@ -1,65 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; - vec3 color; -}; -uniform float _HalfOverCutoff; -uniform sampler2D _MainTex; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -vec4 frag ( - in v2f i_2 -) -{ - vec4 col_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, i_2.uv); - vec4 tmpvar_5; - tmpvar_5 = tmpvar_4; - col_3 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = (col_3.xyz * (i_2.color * 2.0)); - col_3.xyz = tmpvar_6.xyz.xyz; - float tmpvar_7; - tmpvar_7 = (col_3.w * (2.0 * _HalfOverCutoff)); - col_3.w = vec4(tmpvar_7).w; - xll_clip ((col_3.w - 1.0)); - return col_3; -} - -void main () -{ - v2f xlt_i_8; - vec4 xl_retval_9; - vec4 tmpvar_10; - tmpvar_10 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_8.pos = tmpvar_10; - vec2 tmpvar_11; - tmpvar_11 = gl_TexCoord[0].xy; - vec2 tmpvar_12; - tmpvar_12 = tmpvar_11; - xlt_i_8.uv = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13 = gl_TexCoord[1].xyz; - vec3 tmpvar_14; - tmpvar_14 = tmpvar_13; - xlt_i_8.color = tmpvar_14; - vec4 tmpvar_15; - tmpvar_15 = frag (xlt_i_8); - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - xl_retval_9 = tmpvar_16; - vec4 tmpvar_17; - tmpvar_17 = xl_retval_9.xyzw; - vec4 tmpvar_18; - tmpvar_18 = tmpvar_17; - gl_FragData[0] = tmpvar_18; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt index ec1cc5cd9..9d32287d6 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt @@ -16,4 +16,10 @@ void main () } -// inputs: 1, stats: 6 alu 2 tex 1 flow +// stats: 6 alu 2 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [2] loc 4 +// uniforms: 1 (total size: 0) +// #0: _HalfOverCutoff (high float) 1x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-ir.txt deleted file mode 100644 index 33a9ff973..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-ir.txt +++ /dev/null @@ -1,245 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 lop_color; - vec3 lightDir; - vec3 viewDir; - vec3 _LightCoord; -}; -uniform sampler2D _BumpSpecMap; -uniform vec4 _LightColor0; -uniform samplerCube _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -uniform sampler2D _TranslucencyMap; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -void surf ( - in Input IN_6, - inout SurfaceOutput o_7 -) -{ - vec4 norspc_8; - vec4 trngls_9; - vec4 c_10; - vec4 tmpvar_11; - tmpvar_11 = texture2D (_MainTex, IN_6.uv_MainTex); - vec4 tmpvar_12; - tmpvar_12 = tmpvar_11; - c_10 = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13 = (c_10.xyz * IN_6.color.xyz); - o_7.Albedo = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = texture2D (_TranslucencyMap, IN_6.uv_MainTex); - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - trngls_9 = tmpvar_15; - float tmpvar_16; - tmpvar_16 = trngls_9.w; - o_7.Gloss = tmpvar_16; - float tmpvar_17; - tmpvar_17 = IN_6.color.w; - o_7.Alpha = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = texture2D (_BumpSpecMap, IN_6.uv_MainTex); - vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - norspc_8 = tmpvar_19; - float tmpvar_20; - tmpvar_20 = norspc_8.x; - o_7.Specular = tmpvar_20; - vec4 tmpvar_21; - tmpvar_21 = UnpackNormal (norspc_8); - vec3 tmpvar_22; - tmpvar_22 = tmpvar_21.xyz; - vec3 tmpvar_23; - tmpvar_23 = tmpvar_22; - o_7.Normal = tmpvar_23; -} - -vec4 LightingTreeBark ( - in SurfaceOutput s_24, - in vec3 lightDir_25, - in vec3 viewDir_26, - in float atten_27 -) -{ - vec4 c_28; - float spec_29; - float nh_30; - float diff_31; - vec3 h_32; - vec3 tmpvar_33; - tmpvar_33 = normalize ((lightDir_25 + viewDir_26)); - vec3 tmpvar_34; - tmpvar_34 = tmpvar_33; - h_32 = tmpvar_34; - float tmpvar_35; - tmpvar_35 = dot (s_24.Normal, lightDir_25); - float tmpvar_36; - tmpvar_36 = max (0.0, tmpvar_35); - float tmpvar_37; - tmpvar_37 = tmpvar_36; - diff_31 = tmpvar_37; - float tmpvar_38; - tmpvar_38 = dot (s_24.Normal, h_32); - float tmpvar_39; - tmpvar_39 = max (0.0, tmpvar_38); - float tmpvar_40; - tmpvar_40 = tmpvar_39; - nh_30 = tmpvar_40; - float tmpvar_41; - tmpvar_41 = pow (nh_30, (s_24.Specular * 128.0)); - float tmpvar_42; - tmpvar_42 = (tmpvar_41 * s_24.Gloss); - spec_29 = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = ((( - (s_24.Albedo * _LightColor0.xyz) - * diff_31) + (_LightColor0.xyz * spec_29)) * (atten_27 * 2.0)); - c_28.xyz = tmpvar_43.xyz.xyz; - float tmpvar_44; - tmpvar_44 = (((_LightColor0.w * spec_29) * atten_27) * s_24.Alpha); - c_28.w = vec4(tmpvar_44).w; - return c_28; -} - -vec4 frag_surf ( - in v2f_surf IN_45 -) -{ - vec4 c_46; - vec3 lightDir_47; - SurfaceOutput o_48; - Input surfIN_49; - vec2 tmpvar_50; - tmpvar_50 = IN_45.hip_pack0.xy; - surfIN_49.uv_MainTex = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = IN_45.lop_color; - surfIN_49.color = tmpvar_51; - vec3 tmpvar_52; - tmpvar_52 = vec3(0.0, 0.0, 0.0); - o_48.Albedo = tmpvar_52; - vec3 tmpvar_53; - tmpvar_53 = vec3(0.0, 0.0, 0.0); - o_48.Emission = tmpvar_53; - float tmpvar_54; - tmpvar_54 = 0.0; - o_48.Specular = tmpvar_54; - float tmpvar_55; - tmpvar_55 = 0.0; - o_48.Alpha = tmpvar_55; - float tmpvar_56; - tmpvar_56 = 0.0; - o_48.Gloss = tmpvar_56; - surf (surfIN_49, o_48); - vec3 tmpvar_57; - tmpvar_57 = IN_45.lightDir; - lightDir_47 = tmpvar_57; - vec3 tmpvar_58; - tmpvar_58 = normalize (lightDir_47); - vec3 tmpvar_59; - tmpvar_59 = tmpvar_58; - lightDir_47 = tmpvar_59; - vec3 tmpvar_60; - tmpvar_60 = IN_45.viewDir.xyz; - vec3 tmpvar_61; - tmpvar_61 = normalize (tmpvar_60); - float tmpvar_62; - tmpvar_62 = dot (IN_45._LightCoord, IN_45._LightCoord); - vec2 tmpvar_63; - tmpvar_63 = vec2(tmpvar_62); - vec2 tmpvar_64; - tmpvar_64 = tmpvar_63.xy; - vec4 tmpvar_65; - tmpvar_65 = texture2D (_LightTextureB0, tmpvar_64); - vec4 tmpvar_66; - tmpvar_66 = textureCube (_LightTexture0, IN_45._LightCoord); - vec4 tmpvar_67; - tmpvar_67 = LightingTreeBark (o_48, lightDir_47, tmpvar_61, (tmpvar_65.w * tmpvar_66.w)); - vec4 tmpvar_68; - tmpvar_68 = tmpvar_67; - c_46 = tmpvar_68; - float tmpvar_69; - tmpvar_69 = 0.0; - c_46.w = vec4(tmpvar_69).w; - return c_46; -} - -void main () -{ - v2f_surf xlt_IN_70; - vec4 xl_retval_71; - vec4 tmpvar_72; - tmpvar_72 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_70.pos = tmpvar_72; - float tmpvar_73; - tmpvar_73 = xlv_FOG.x; - xlt_IN_70.fog = tmpvar_73; - vec2 tmpvar_74; - tmpvar_74 = gl_TexCoord[0].xy; - vec2 tmpvar_75; - tmpvar_75 = tmpvar_74; - xlt_IN_70.hip_pack0 = tmpvar_75; - vec4 tmpvar_76; - tmpvar_76 = gl_Color.xyzw; - vec4 tmpvar_77; - tmpvar_77 = tmpvar_76; - xlt_IN_70.lop_color = tmpvar_77; - vec3 tmpvar_78; - tmpvar_78 = gl_TexCoord[1].xyz; - vec3 tmpvar_79; - tmpvar_79 = tmpvar_78; - xlt_IN_70.lightDir = tmpvar_79; - vec3 tmpvar_80; - tmpvar_80 = gl_TexCoord[2].xyz; - vec3 tmpvar_81; - tmpvar_81 = tmpvar_80; - xlt_IN_70.viewDir = tmpvar_81; - vec3 tmpvar_82; - tmpvar_82 = gl_TexCoord[3].xyz; - vec3 tmpvar_83; - tmpvar_83 = tmpvar_82; - xlt_IN_70._LightCoord = tmpvar_83; - vec4 tmpvar_84; - tmpvar_84 = frag_surf (xlt_IN_70); - vec4 tmpvar_85; - tmpvar_85 = tmpvar_84; - xl_retval_71 = tmpvar_85; - vec4 tmpvar_86; - tmpvar_86 = xl_retval_71.xyzw; - vec4 tmpvar_87; - tmpvar_87 = tmpvar_86; - gl_FragData[0] = tmpvar_87; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt index 5771505be..ed5882a82 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt @@ -23,20 +23,31 @@ void main () float atten_7; atten_7 = (texture2D (_LightTextureB0, vec2(dot (tmpvar_2, tmpvar_2))).w * textureCube (_LightTexture0, tmpvar_2).w); vec4 c_8; - float tmpvar_9; - tmpvar_9 = (pow (max (0.0, + float spec_9; + spec_9 = (pow (max (0.0, dot (normal_5.xyz, normalize((tmpvar_6 + normalize(gl_TexCoord[2].xyz)))) ), (tmpvar_4.x * 128.0)) * texture2D (_TranslucencyMap, tmpvar_1).w); c_8.xyz = ((( ((texture2D (_MainTex, tmpvar_1).xyz * gl_Color.xyz) * _LightColor0.xyz) * max (0.0, dot (normal_5.xyz, tmpvar_6)) - ) + (_LightColor0.xyz * tmpvar_9)) * (atten_7 * 2.0)); - c_8.w = (((_LightColor0.w * tmpvar_9) * atten_7) * gl_Color.w); + ) + (_LightColor0.xyz * spec_9)) * (atten_7 * 2.0)); + c_8.w = ((_LightColor0.w * spec_9) * (atten_7 * gl_Color.w)); c_3.xyz = c_8.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } -// inputs: 2, stats: 31 alu 5 tex 0 flow +// stats: 31 alu 5 tex 0 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 1 (total size: 0) +// #0: _LightColor0 (high float) 4x1 [-1] +// textures: 5 +// #0: _BumpSpecMap (high 2d) 0x0 [-1] +// #1: _LightTexture0 (high cube) 0x0 [-1] +// #2: _LightTextureB0 (high 2d) 0x0 [-1] +// #3: _MainTex (high 2d) 0x0 [-1] +// #4: _TranslucencyMap (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-ir.txt deleted file mode 100644 index f05c9bbb1..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-ir.txt +++ /dev/null @@ -1,122 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec4 color; -}; -struct v2f_surf { - vec4 pos; -}; -uniform sampler2D _BumpSpecMap; -uniform sampler2D _MainTex; -uniform sampler2D _TranslucencyMap; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -void surf ( - in Input IN_6, - inout SurfaceOutput o_7 -) -{ - vec4 norspc_8; - vec4 trngls_9; - vec4 c_10; - vec4 tmpvar_11; - tmpvar_11 = texture2D (_MainTex, IN_6.uv_MainTex); - vec4 tmpvar_12; - tmpvar_12 = tmpvar_11; - c_10 = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13 = (c_10.xyz * IN_6.color.xyz); - o_7.Albedo = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = texture2D (_TranslucencyMap, IN_6.uv_MainTex); - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - trngls_9 = tmpvar_15; - float tmpvar_16; - tmpvar_16 = trngls_9.w; - o_7.Gloss = tmpvar_16; - float tmpvar_17; - tmpvar_17 = IN_6.color.w; - o_7.Alpha = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = texture2D (_BumpSpecMap, IN_6.uv_MainTex); - vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - norspc_8 = tmpvar_19; - float tmpvar_20; - tmpvar_20 = norspc_8.x; - o_7.Specular = tmpvar_20; - vec4 tmpvar_21; - tmpvar_21 = UnpackNormal (norspc_8); - vec3 tmpvar_22; - tmpvar_22 = tmpvar_21.xyz; - vec3 tmpvar_23; - tmpvar_23 = tmpvar_22; - o_7.Normal = tmpvar_23; -} - -vec4 frag_surf ( - in v2f_surf IN_24 -) -{ - Input surfIN_25; - SurfaceOutput o_26; - vec3 tmpvar_27; - tmpvar_27 = vec3(0.0, 0.0, 0.0); - o_26.Albedo = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = vec3(0.0, 0.0, 0.0); - o_26.Emission = tmpvar_28; - float tmpvar_29; - tmpvar_29 = 0.0; - o_26.Specular = tmpvar_29; - float tmpvar_30; - tmpvar_30 = 0.0; - o_26.Alpha = tmpvar_30; - float tmpvar_31; - tmpvar_31 = 0.0; - o_26.Gloss = tmpvar_31; - surf (surfIN_25, o_26); - return vec4(0.0, 0.0, 0.0, 0.0); -} - -void main () -{ - v2f_surf xlt_IN_32; - vec4 xl_retval_33; - vec4 tmpvar_34; - tmpvar_34 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_32.pos = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35 = frag_surf (xlt_IN_32); - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - xl_retval_33 = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37 = xl_retval_33.xyzw; - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - gl_FragData[0] = tmpvar_38; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt index 79c959c26..b8c9f3c05 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt @@ -1,14 +1,7 @@ -uniform sampler2D _BumpSpecMap; void main () { - vec2 tmpvar_1; - vec4 normal_2; - normal_2.xy = ((texture2D (_BumpSpecMap, tmpvar_1).wy * 2.0) - 1.0); - normal_2.z = sqrt(((1.0 - - (normal_2.x * normal_2.x) - ) - (normal_2.y * normal_2.y))); gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0); } -// inputs: 0, stats: 8 alu 1 tex 0 flow +// stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-ir.txt deleted file mode 100644 index 8308c57d5..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-ir.txt +++ /dev/null @@ -1,361 +0,0 @@ -struct LeafSurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - vec3 Translucency; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 lop_color; - vec3 lightDir; - vec3 viewDir; -}; -uniform sampler2D _BumpSpecMap; -uniform float _Cutoff; -uniform vec4 _LightColor0; -uniform sampler2D _MainTex; -uniform sampler2D _TranslucencyMap; -varying vec4 xlv_FOG; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -float xll_saturate ( - in float x_2 -) -{ - float tmpvar_3; - tmpvar_3 = clamp (x_2, 0.0, 1.0); - return tmpvar_3; -} - -vec2 xll_saturate ( - in vec2 x_4 -) -{ - vec2 tmpvar_5; - tmpvar_5 = clamp (x_4, 0.0, 1.0); - return tmpvar_5; -} - -vec3 xll_saturate ( - in vec3 x_6 -) -{ - vec3 tmpvar_7; - tmpvar_7 = clamp (x_6, 0.0, 1.0); - return tmpvar_7; -} - -vec4 xll_saturate ( - in vec4 x_8 -) -{ - vec4 tmpvar_9; - tmpvar_9 = clamp (x_8, 0.0, 1.0); - return tmpvar_9; -} - -mat2 xll_saturate ( - in mat2 m_10 -) -{ - vec2 tmpvar_11; - tmpvar_11 = clamp (m_10[0], 0.0, 1.0); - vec2 tmpvar_12; - tmpvar_12 = clamp (m_10[1], 0.0, 1.0); - mat2 tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_13[0] = tmpvar_14; - vec2 tmpvar_15; - tmpvar_15 = tmpvar_12; - tmpvar_13[1] = tmpvar_15; - return tmpvar_13; -} - -mat3 xll_saturate ( - in mat3 m_16 -) -{ - vec3 tmpvar_17; - tmpvar_17 = clamp (m_16[0], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_16[1], 0.0, 1.0); - vec3 tmpvar_19; - tmpvar_19 = clamp (m_16[2], 0.0, 1.0); - mat3 tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_20[0] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_20[1] = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = tmpvar_19; - tmpvar_20[2] = tmpvar_23; - return tmpvar_20; -} - -mat4 xll_saturate ( - in mat4 m_24 -) -{ - vec4 tmpvar_25; - tmpvar_25 = clamp (m_24[0], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_24[1], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_24[2], 0.0, 1.0); - vec4 tmpvar_28; - tmpvar_28 = clamp (m_24[3], 0.0, 1.0); - mat4 tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_29[0] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_29[1] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_29[2] = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_28; - tmpvar_29[3] = tmpvar_33; - return tmpvar_29; -} - -vec4 UnpackNormal ( - in vec4 packednormal_34 -) -{ - vec4 normal_35; - vec2 tmpvar_36; - tmpvar_36 = ((packednormal_34.wy * 2.0) - 1.0); - normal_35.xy = tmpvar_36.xy.xy; - float tmpvar_37; - tmpvar_37 = sqrt (((1.0 - (normal_35.x * normal_35.x)) - (normal_35.y * normal_35.y))); - float tmpvar_38; - tmpvar_38 = tmpvar_37; - normal_35.z = vec3(tmpvar_38).z; - return normal_35; -} - -void surf ( - in Input IN_39, - inout LeafSurfaceOutput o_40 -) -{ - vec4 norspc_41; - vec4 trngls_42; - vec4 c_43; - vec4 tmpvar_44; - tmpvar_44 = texture2D (_MainTex, IN_39.uv_MainTex); - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - c_43 = tmpvar_45; - vec3 tmpvar_46; - tmpvar_46 = (c_43.xyz * IN_39.color.xyz); - o_40.Albedo = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = texture2D (_TranslucencyMap, IN_39.uv_MainTex); - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - trngls_42 = tmpvar_48; - vec3 tmpvar_49; - tmpvar_49 = trngls_42.xyz; - o_40.Translucency = tmpvar_49; - float tmpvar_50; - tmpvar_50 = trngls_42.w; - o_40.Gloss = tmpvar_50; - float tmpvar_51; - tmpvar_51 = (c_43.w * IN_39.color.w); - o_40.Alpha = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = texture2D (_BumpSpecMap, IN_39.uv_MainTex); - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - norspc_41 = tmpvar_53; - float tmpvar_54; - tmpvar_54 = norspc_41.x; - o_40.Specular = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = UnpackNormal (norspc_41); - vec3 tmpvar_56; - tmpvar_56 = tmpvar_55.xyz; - vec3 tmpvar_57; - tmpvar_57 = tmpvar_56; - o_40.Normal = tmpvar_57; -} - -vec4 LightingTreeLeaf ( - in LeafSurfaceOutput s_58, - in vec3 lightDir_59, - in vec3 viewDir_60, - in float atten_61 -) -{ - vec4 c_62; - vec3 col_63; - vec3 translucencyColor_64; - float trans_65; - float spec_66; - float nh_67; - float diff_68; - vec3 h_69; - vec3 tmpvar_70; - tmpvar_70 = normalize ((lightDir_59 + viewDir_60)); - vec3 tmpvar_71; - tmpvar_71 = tmpvar_70; - h_69 = tmpvar_71; - float tmpvar_72; - tmpvar_72 = dot (s_58.Normal, lightDir_59); - float tmpvar_73; - tmpvar_73 = tmpvar_72; - diff_68 = tmpvar_73; - float tmpvar_74; - tmpvar_74 = dot (s_58.Normal, h_69); - float tmpvar_75; - tmpvar_75 = max (0.0, tmpvar_74); - float tmpvar_76; - tmpvar_76 = tmpvar_75; - nh_67 = tmpvar_76; - float tmpvar_77; - tmpvar_77 = pow (nh_67, (s_58.Specular * 128.0)); - float tmpvar_78; - tmpvar_78 = (tmpvar_77 * s_58.Gloss); - spec_66 = tmpvar_78; - float tmpvar_79; - tmpvar_79 = max (0.0, -(diff_68)); - float tmpvar_80; - tmpvar_80 = tmpvar_79; - trans_65 = tmpvar_80; - vec3 tmpvar_81; - tmpvar_81 = ((s_58.Translucency * trans_65) * 2.0); - translucencyColor_64 = tmpvar_81; - float tmpvar_82; - tmpvar_82 = max (0.0, ((diff_68 * 0.5) + 0.5)); - float tmpvar_83; - tmpvar_83 = tmpvar_82; - diff_68 = tmpvar_83; - vec3 tmpvar_84; - tmpvar_84 = (s_58.Albedo * (diff_68 + translucencyColor_64)); - col_63 = tmpvar_84; - float tmpvar_85; - tmpvar_85 = ceil (trans_65); - float tmpvar_86; - tmpvar_86 = xll_saturate (tmpvar_85); - vec3 tmpvar_87; - tmpvar_87 = (col_63 + (spec_66 * (1.0 - tmpvar_86))); - col_63 = tmpvar_87; - vec3 tmpvar_88; - tmpvar_88 = (col_63 * _LightColor0.xyz); - col_63 = tmpvar_88; - vec3 tmpvar_89; - tmpvar_89 = (col_63 * (atten_61 * 2.0)); - c_62.xyz = tmpvar_89.xyz.xyz; - return c_62; -} - -vec4 frag_surf ( - in v2f_surf IN_90 -) -{ - vec4 c_91; - vec3 lightDir_92; - LeafSurfaceOutput o_93; - Input surfIN_94; - vec2 tmpvar_95; - tmpvar_95 = IN_90.hip_pack0.xy; - surfIN_94.uv_MainTex = tmpvar_95; - vec4 tmpvar_96; - tmpvar_96 = IN_90.lop_color; - surfIN_94.color = tmpvar_96; - vec3 tmpvar_97; - tmpvar_97 = vec3(0.0, 0.0, 0.0); - o_93.Albedo = tmpvar_97; - vec3 tmpvar_98; - tmpvar_98 = vec3(0.0, 0.0, 0.0); - o_93.Emission = tmpvar_98; - float tmpvar_99; - tmpvar_99 = 0.0; - o_93.Specular = tmpvar_99; - float tmpvar_100; - tmpvar_100 = 0.0; - o_93.Alpha = tmpvar_100; - surf (surfIN_94, o_93); - xll_clip ((o_93.Alpha - _Cutoff)); - vec3 tmpvar_101; - tmpvar_101 = IN_90.lightDir; - lightDir_92 = tmpvar_101; - vec3 tmpvar_102; - tmpvar_102 = IN_90.viewDir.xyz; - vec3 tmpvar_103; - tmpvar_103 = normalize (tmpvar_102); - vec4 tmpvar_104; - tmpvar_104 = LightingTreeLeaf (o_93, lightDir_92, tmpvar_103, 1.0); - vec4 tmpvar_105; - tmpvar_105 = tmpvar_104; - c_91 = tmpvar_105; - float tmpvar_106; - tmpvar_106 = o_93.Alpha; - c_91.w = vec4(tmpvar_106).w; - return c_91; -} - -void main () -{ - v2f_surf xlt_IN_107; - vec4 xl_retval_108; - vec4 tmpvar_109; - tmpvar_109 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_107.pos = tmpvar_109; - float tmpvar_110; - tmpvar_110 = xlv_FOG.x; - xlt_IN_107.fog = tmpvar_110; - vec2 tmpvar_111; - tmpvar_111 = gl_TexCoord[0].xy; - vec2 tmpvar_112; - tmpvar_112 = tmpvar_111; - xlt_IN_107.hip_pack0 = tmpvar_112; - vec4 tmpvar_113; - tmpvar_113 = gl_Color.xyzw; - vec4 tmpvar_114; - tmpvar_114 = tmpvar_113; - xlt_IN_107.lop_color = tmpvar_114; - vec3 tmpvar_115; - tmpvar_115 = gl_TexCoord[1].xyz; - vec3 tmpvar_116; - tmpvar_116 = tmpvar_115; - xlt_IN_107.lightDir = tmpvar_116; - vec3 tmpvar_117; - tmpvar_117 = gl_TexCoord[2].xyz; - vec3 tmpvar_118; - tmpvar_118 = tmpvar_117; - xlt_IN_107.viewDir = tmpvar_118; - vec4 tmpvar_119; - tmpvar_119 = frag_surf (xlt_IN_107); - vec4 tmpvar_120; - tmpvar_120 = tmpvar_119; - xl_retval_108 = tmpvar_120; - vec4 tmpvar_121; - tmpvar_121 = xl_retval_108.xyzw; - vec4 tmpvar_122; - tmpvar_122 = tmpvar_121; - gl_FragData[0] = tmpvar_122; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt index 0f76fecfc..86d31e24f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt @@ -10,12 +10,12 @@ void main () vec3 tmpvar_2; tmpvar_2 = gl_TexCoord[1].xyz; vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, tmpvar_1); + float tmpvar_4; vec4 tmpvar_5; - tmpvar_5 = texture2D (_TranslucencyMap, tmpvar_1); - float tmpvar_6; - tmpvar_6 = (tmpvar_4.w * gl_Color.w); + tmpvar_5 = texture2D (_MainTex, tmpvar_1); + vec4 tmpvar_6; + tmpvar_6 = texture2D (_TranslucencyMap, tmpvar_1); + tmpvar_4 = (tmpvar_5.w * gl_Color.w); vec4 tmpvar_7; tmpvar_7 = texture2D (_BumpSpecMap, tmpvar_1); vec4 normal_8; @@ -24,28 +24,44 @@ void main () (normal_8.x * normal_8.x) ) - (normal_8.y * normal_8.y))); float x_9; - x_9 = (tmpvar_6 - _Cutoff); + x_9 = (tmpvar_4 - _Cutoff); if ((x_9 < 0.0)) { discard; }; vec4 c_10; - float tmpvar_11; - tmpvar_11 = dot (normal_8.xyz, tmpvar_2); + vec3 col_11; float tmpvar_12; - tmpvar_12 = max (0.0, -(tmpvar_11)); - c_10.xyz = ((( - ((tmpvar_4.xyz * gl_Color.xyz) * (max (0.0, ( - (tmpvar_11 * 0.5) - + 0.5)) + ((tmpvar_5.xyz * tmpvar_12) * 2.0))) - + - ((pow (max (0.0, - dot (normal_8.xyz, normalize((tmpvar_2 + normalize(gl_TexCoord[2].xyz)))) - ), (tmpvar_7.x * 128.0)) * tmpvar_5.w) * (1.0 - clamp (ceil(tmpvar_12), 0.0, 1.0))) - ) * _LightColor0.xyz) * 2.0); + tmpvar_12 = dot (normal_8.xyz, tmpvar_2); + float tmpvar_13; + tmpvar_13 = max (0.0, -(tmpvar_12)); + col_11 = ((tmpvar_5.xyz * gl_Color.xyz) * (max (0.0, + ((tmpvar_12 * 0.5) + 0.5) + ) + ( + (tmpvar_6.xyz * tmpvar_13) + * 2.0))); + col_11 = (col_11 + (( + pow (max (0.0, dot (normal_8.xyz, normalize( + (tmpvar_2 + normalize(gl_TexCoord[2].xyz)) + ))), (tmpvar_7.x * 128.0)) + * tmpvar_6.w) * (1.0 - + clamp (ceil(tmpvar_13), 0.0, 1.0) + ))); + col_11 = (col_11 * _LightColor0.xyz); + c_10.xyz = (col_11 * 2.0); c_3.xyz = c_10.xyz; - c_3.w = tmpvar_6; + c_3.w = tmpvar_4; gl_FragData[0] = c_3; } -// inputs: 2, stats: 36 alu 4 tex 1 flow +// stats: 36 alu 4 tex 1 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Cutoff (high float) 1x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// textures: 3 +// #0: _BumpSpecMap (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] +// #2: _TranslucencyMap (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-ir.txt deleted file mode 100644 index 1801333b4..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-ir.txt +++ /dev/null @@ -1,384 +0,0 @@ -struct LeafSurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - vec3 Translucency; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 lop_color; - vec3 lightDir; - vec3 viewDir; - vec3 _LightCoord; -}; -uniform sampler2D _BumpSpecMap; -uniform float _Cutoff; -uniform vec4 _LightColor0; -uniform samplerCube _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -uniform sampler2D _TranslucencyMap; -varying vec4 xlv_FOG; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -float xll_saturate ( - in float x_2 -) -{ - float tmpvar_3; - tmpvar_3 = clamp (x_2, 0.0, 1.0); - return tmpvar_3; -} - -vec2 xll_saturate ( - in vec2 x_4 -) -{ - vec2 tmpvar_5; - tmpvar_5 = clamp (x_4, 0.0, 1.0); - return tmpvar_5; -} - -vec3 xll_saturate ( - in vec3 x_6 -) -{ - vec3 tmpvar_7; - tmpvar_7 = clamp (x_6, 0.0, 1.0); - return tmpvar_7; -} - -vec4 xll_saturate ( - in vec4 x_8 -) -{ - vec4 tmpvar_9; - tmpvar_9 = clamp (x_8, 0.0, 1.0); - return tmpvar_9; -} - -mat2 xll_saturate ( - in mat2 m_10 -) -{ - vec2 tmpvar_11; - tmpvar_11 = clamp (m_10[0], 0.0, 1.0); - vec2 tmpvar_12; - tmpvar_12 = clamp (m_10[1], 0.0, 1.0); - mat2 tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_13[0] = tmpvar_14; - vec2 tmpvar_15; - tmpvar_15 = tmpvar_12; - tmpvar_13[1] = tmpvar_15; - return tmpvar_13; -} - -mat3 xll_saturate ( - in mat3 m_16 -) -{ - vec3 tmpvar_17; - tmpvar_17 = clamp (m_16[0], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_16[1], 0.0, 1.0); - vec3 tmpvar_19; - tmpvar_19 = clamp (m_16[2], 0.0, 1.0); - mat3 tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_20[0] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_20[1] = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = tmpvar_19; - tmpvar_20[2] = tmpvar_23; - return tmpvar_20; -} - -mat4 xll_saturate ( - in mat4 m_24 -) -{ - vec4 tmpvar_25; - tmpvar_25 = clamp (m_24[0], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_24[1], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_24[2], 0.0, 1.0); - vec4 tmpvar_28; - tmpvar_28 = clamp (m_24[3], 0.0, 1.0); - mat4 tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_29[0] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_29[1] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_29[2] = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_28; - tmpvar_29[3] = tmpvar_33; - return tmpvar_29; -} - -vec4 UnpackNormal ( - in vec4 packednormal_34 -) -{ - vec4 normal_35; - vec2 tmpvar_36; - tmpvar_36 = ((packednormal_34.wy * 2.0) - 1.0); - normal_35.xy = tmpvar_36.xy.xy; - float tmpvar_37; - tmpvar_37 = sqrt (((1.0 - (normal_35.x * normal_35.x)) - (normal_35.y * normal_35.y))); - float tmpvar_38; - tmpvar_38 = tmpvar_37; - normal_35.z = vec3(tmpvar_38).z; - return normal_35; -} - -void surf ( - in Input IN_39, - inout LeafSurfaceOutput o_40 -) -{ - vec4 norspc_41; - vec4 trngls_42; - vec4 c_43; - vec4 tmpvar_44; - tmpvar_44 = texture2D (_MainTex, IN_39.uv_MainTex); - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - c_43 = tmpvar_45; - vec3 tmpvar_46; - tmpvar_46 = (c_43.xyz * IN_39.color.xyz); - o_40.Albedo = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = texture2D (_TranslucencyMap, IN_39.uv_MainTex); - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - trngls_42 = tmpvar_48; - vec3 tmpvar_49; - tmpvar_49 = trngls_42.xyz; - o_40.Translucency = tmpvar_49; - float tmpvar_50; - tmpvar_50 = trngls_42.w; - o_40.Gloss = tmpvar_50; - float tmpvar_51; - tmpvar_51 = (c_43.w * IN_39.color.w); - o_40.Alpha = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = texture2D (_BumpSpecMap, IN_39.uv_MainTex); - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - norspc_41 = tmpvar_53; - float tmpvar_54; - tmpvar_54 = norspc_41.x; - o_40.Specular = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = UnpackNormal (norspc_41); - vec3 tmpvar_56; - tmpvar_56 = tmpvar_55.xyz; - vec3 tmpvar_57; - tmpvar_57 = tmpvar_56; - o_40.Normal = tmpvar_57; -} - -vec4 LightingTreeLeaf ( - in LeafSurfaceOutput s_58, - in vec3 lightDir_59, - in vec3 viewDir_60, - in float atten_61 -) -{ - vec4 c_62; - vec3 col_63; - vec3 translucencyColor_64; - float trans_65; - float spec_66; - float nh_67; - float diff_68; - vec3 h_69; - vec3 tmpvar_70; - tmpvar_70 = normalize ((lightDir_59 + viewDir_60)); - vec3 tmpvar_71; - tmpvar_71 = tmpvar_70; - h_69 = tmpvar_71; - float tmpvar_72; - tmpvar_72 = dot (s_58.Normal, lightDir_59); - float tmpvar_73; - tmpvar_73 = tmpvar_72; - diff_68 = tmpvar_73; - float tmpvar_74; - tmpvar_74 = dot (s_58.Normal, h_69); - float tmpvar_75; - tmpvar_75 = max (0.0, tmpvar_74); - float tmpvar_76; - tmpvar_76 = tmpvar_75; - nh_67 = tmpvar_76; - float tmpvar_77; - tmpvar_77 = pow (nh_67, (s_58.Specular * 128.0)); - float tmpvar_78; - tmpvar_78 = (tmpvar_77 * s_58.Gloss); - spec_66 = tmpvar_78; - float tmpvar_79; - tmpvar_79 = max (0.0, -(diff_68)); - float tmpvar_80; - tmpvar_80 = tmpvar_79; - trans_65 = tmpvar_80; - vec3 tmpvar_81; - tmpvar_81 = ((s_58.Translucency * trans_65) * 2.0); - translucencyColor_64 = tmpvar_81; - float tmpvar_82; - tmpvar_82 = max (0.0, ((diff_68 * 0.5) + 0.5)); - float tmpvar_83; - tmpvar_83 = tmpvar_82; - diff_68 = tmpvar_83; - vec3 tmpvar_84; - tmpvar_84 = (s_58.Albedo * (diff_68 + translucencyColor_64)); - col_63 = tmpvar_84; - float tmpvar_85; - tmpvar_85 = ceil (trans_65); - float tmpvar_86; - tmpvar_86 = xll_saturate (tmpvar_85); - vec3 tmpvar_87; - tmpvar_87 = (col_63 + (spec_66 * (1.0 - tmpvar_86))); - col_63 = tmpvar_87; - vec3 tmpvar_88; - tmpvar_88 = (col_63 * _LightColor0.xyz); - col_63 = tmpvar_88; - vec3 tmpvar_89; - tmpvar_89 = (col_63 * (atten_61 * 2.0)); - c_62.xyz = tmpvar_89.xyz.xyz; - return c_62; -} - -vec4 frag_surf ( - in v2f_surf IN_90 -) -{ - vec4 c_91; - vec3 lightDir_92; - LeafSurfaceOutput o_93; - Input surfIN_94; - vec2 tmpvar_95; - tmpvar_95 = IN_90.hip_pack0.xy; - surfIN_94.uv_MainTex = tmpvar_95; - vec4 tmpvar_96; - tmpvar_96 = IN_90.lop_color; - surfIN_94.color = tmpvar_96; - vec3 tmpvar_97; - tmpvar_97 = vec3(0.0, 0.0, 0.0); - o_93.Albedo = tmpvar_97; - vec3 tmpvar_98; - tmpvar_98 = vec3(0.0, 0.0, 0.0); - o_93.Emission = tmpvar_98; - float tmpvar_99; - tmpvar_99 = 0.0; - o_93.Specular = tmpvar_99; - float tmpvar_100; - tmpvar_100 = 0.0; - o_93.Alpha = tmpvar_100; - surf (surfIN_94, o_93); - xll_clip ((o_93.Alpha - _Cutoff)); - vec3 tmpvar_101; - tmpvar_101 = IN_90.lightDir; - lightDir_92 = tmpvar_101; - vec3 tmpvar_102; - tmpvar_102 = normalize (lightDir_92); - vec3 tmpvar_103; - tmpvar_103 = tmpvar_102; - lightDir_92 = tmpvar_103; - vec3 tmpvar_104; - tmpvar_104 = IN_90.viewDir.xyz; - vec3 tmpvar_105; - tmpvar_105 = normalize (tmpvar_104); - float tmpvar_106; - tmpvar_106 = dot (IN_90._LightCoord, IN_90._LightCoord); - vec2 tmpvar_107; - tmpvar_107 = vec2(tmpvar_106); - vec2 tmpvar_108; - tmpvar_108 = tmpvar_107.xy; - vec4 tmpvar_109; - tmpvar_109 = texture2D (_LightTextureB0, tmpvar_108); - vec4 tmpvar_110; - tmpvar_110 = textureCube (_LightTexture0, IN_90._LightCoord); - vec4 tmpvar_111; - tmpvar_111 = LightingTreeLeaf (o_93, lightDir_92, tmpvar_105, (tmpvar_109.w * tmpvar_110.w)); - vec4 tmpvar_112; - tmpvar_112 = tmpvar_111; - c_91 = tmpvar_112; - float tmpvar_113; - tmpvar_113 = o_93.Alpha; - c_91.w = vec4(tmpvar_113).w; - return c_91; -} - -void main () -{ - v2f_surf xlt_IN_114; - vec4 xl_retval_115; - vec4 tmpvar_116; - tmpvar_116 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_114.pos = tmpvar_116; - float tmpvar_117; - tmpvar_117 = xlv_FOG.x; - xlt_IN_114.fog = tmpvar_117; - vec2 tmpvar_118; - tmpvar_118 = gl_TexCoord[0].xy; - vec2 tmpvar_119; - tmpvar_119 = tmpvar_118; - xlt_IN_114.hip_pack0 = tmpvar_119; - vec4 tmpvar_120; - tmpvar_120 = gl_Color.xyzw; - vec4 tmpvar_121; - tmpvar_121 = tmpvar_120; - xlt_IN_114.lop_color = tmpvar_121; - vec3 tmpvar_122; - tmpvar_122 = gl_TexCoord[1].xyz; - vec3 tmpvar_123; - tmpvar_123 = tmpvar_122; - xlt_IN_114.lightDir = tmpvar_123; - vec3 tmpvar_124; - tmpvar_124 = gl_TexCoord[2].xyz; - vec3 tmpvar_125; - tmpvar_125 = tmpvar_124; - xlt_IN_114.viewDir = tmpvar_125; - vec3 tmpvar_126; - tmpvar_126 = gl_TexCoord[3].xyz; - vec3 tmpvar_127; - tmpvar_127 = tmpvar_126; - xlt_IN_114._LightCoord = tmpvar_127; - vec4 tmpvar_128; - tmpvar_128 = frag_surf (xlt_IN_114); - vec4 tmpvar_129; - tmpvar_129 = tmpvar_128; - xl_retval_115 = tmpvar_129; - vec4 tmpvar_130; - tmpvar_130 = xl_retval_115.xyzw; - vec4 tmpvar_131; - tmpvar_131 = tmpvar_130; - gl_FragData[0] = tmpvar_131; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt index a0fb410cc..e4ae19d88 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt @@ -12,12 +12,12 @@ void main () vec3 tmpvar_2; tmpvar_2 = gl_TexCoord[3].xyz; vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, tmpvar_1); + float tmpvar_4; vec4 tmpvar_5; - tmpvar_5 = texture2D (_TranslucencyMap, tmpvar_1); - float tmpvar_6; - tmpvar_6 = (tmpvar_4.w * gl_Color.w); + tmpvar_5 = texture2D (_MainTex, tmpvar_1); + vec4 tmpvar_6; + tmpvar_6 = texture2D (_TranslucencyMap, tmpvar_1); + tmpvar_4 = (tmpvar_5.w * gl_Color.w); vec4 tmpvar_7; tmpvar_7 = texture2D (_BumpSpecMap, tmpvar_1); vec4 normal_8; @@ -26,32 +26,50 @@ void main () (normal_8.x * normal_8.x) ) - (normal_8.y * normal_8.y))); float x_9; - x_9 = (tmpvar_6 - _Cutoff); + x_9 = (tmpvar_4 - _Cutoff); if ((x_9 < 0.0)) { discard; }; vec3 tmpvar_10; tmpvar_10 = normalize(gl_TexCoord[1].xyz); vec4 c_11; - float tmpvar_12; - tmpvar_12 = dot (normal_8.xyz, tmpvar_10); + vec3 col_12; float tmpvar_13; - tmpvar_13 = max (0.0, -(tmpvar_12)); - c_11.xyz = ((( - ((tmpvar_4.xyz * gl_Color.xyz) * (max (0.0, ( - (tmpvar_12 * 0.5) - + 0.5)) + ((tmpvar_5.xyz * tmpvar_13) * 2.0))) - + - ((pow (max (0.0, - dot (normal_8.xyz, normalize((tmpvar_10 + normalize(gl_TexCoord[2].xyz)))) - ), (tmpvar_7.x * 128.0)) * tmpvar_5.w) * (1.0 - clamp (ceil(tmpvar_13), 0.0, 1.0))) - ) * _LightColor0.xyz) * ((texture2D (_LightTextureB0, vec2( + tmpvar_13 = dot (normal_8.xyz, tmpvar_10); + float tmpvar_14; + tmpvar_14 = max (0.0, -(tmpvar_13)); + col_12 = ((tmpvar_5.xyz * gl_Color.xyz) * (max (0.0, + ((tmpvar_13 * 0.5) + 0.5) + ) + ( + (tmpvar_6.xyz * tmpvar_14) + * 2.0))); + col_12 = (col_12 + (( + pow (max (0.0, dot (normal_8.xyz, normalize( + (tmpvar_10 + normalize(gl_TexCoord[2].xyz)) + ))), (tmpvar_7.x * 128.0)) + * tmpvar_6.w) * (1.0 - + clamp (ceil(tmpvar_14), 0.0, 1.0) + ))); + col_12 = (col_12 * _LightColor0.xyz); + c_11.xyz = (col_12 * ((texture2D (_LightTextureB0, vec2( dot (tmpvar_2, tmpvar_2) )).w * textureCube (_LightTexture0, tmpvar_2).w) * 2.0)); c_3.xyz = c_11.xyz; - c_3.w = tmpvar_6; + c_3.w = tmpvar_4; gl_FragData[0] = c_3; } -// inputs: 2, stats: 40 alu 6 tex 1 flow +// stats: 40 alu 6 tex 1 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Cutoff (high float) 1x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// textures: 5 +// #0: _BumpSpecMap (high 2d) 0x0 [-1] +// #1: _LightTexture0 (high cube) 0x0 [-1] +// #2: _LightTextureB0 (high 2d) 0x0 [-1] +// #3: _MainTex (high 2d) 0x0 [-1] +// #4: _TranslucencyMap (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-ir.txt deleted file mode 100644 index c56def237..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-ir.txt +++ /dev/null @@ -1,91 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; -}; -uniform vec4 _CenterRadius; -uniform sampler2D _MainTex; -uniform mat4 _RotationMatrix; -vec2 MultiplyUV ( - in mat4 mat_1, - in vec2 inUV_2 -) -{ - vec4 temp_3; - vec4 tmpvar_4; - tmpvar_4.zw = vec2(0.0, 0.0); - tmpvar_4.x = inUV_2.x; - tmpvar_4.y = inUV_2.y; - vec4 tmpvar_5; - tmpvar_5 = tmpvar_4; - temp_3 = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6 = (mat_1 * temp_3); - temp_3 = tmpvar_6; - return temp_3.xy; -} - -vec4 frag ( - in v2f i_7 -) -{ - float t_8; - vec2 tmp_9; - vec2 distortedOffset_10; - vec2 offset_11; - vec2 tmpvar_12; - tmpvar_12 = i_7.uv; - offset_11 = tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = MultiplyUV (_RotationMatrix, offset_11.xy); - vec2 tmpvar_14; - tmpvar_14 = tmpvar_13; - distortedOffset_10 = tmpvar_14; - vec2 tmpvar_15; - tmpvar_15 = (offset_11 / _CenterRadius.zw); - tmp_9 = tmpvar_15; - float tmpvar_16; - tmpvar_16 = length (tmp_9); - float tmpvar_17; - tmpvar_17 = min (1.0, tmpvar_16); - float tmpvar_18; - tmpvar_18 = tmpvar_17; - t_8 = tmpvar_18; - vec2 tmpvar_19; - tmpvar_19 = vec2(t_8); - vec2 tmpvar_20; - tmpvar_20 = mix (distortedOffset_10, offset_11, tmpvar_19); - vec2 tmpvar_21; - tmpvar_21 = tmpvar_20; - offset_11 = tmpvar_21; - vec2 tmpvar_22; - tmpvar_22 = (offset_11 + _CenterRadius.xy); - offset_11 = tmpvar_22; - vec4 tmpvar_23; - tmpvar_23 = texture2D (_MainTex, offset_11); - return tmpvar_23; -} - -void main () -{ - v2f xlt_i_24; - vec4 xl_retval_25; - vec4 tmpvar_26; - tmpvar_26 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_24.pos = tmpvar_26; - vec2 tmpvar_27; - tmpvar_27 = gl_TexCoord[0].xy; - vec2 tmpvar_28; - tmpvar_28 = tmpvar_27; - xlt_i_24.uv = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = frag (xlt_i_24); - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - xl_retval_25 = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = xl_retval_25.xyzw; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_31; - gl_FragData[0] = tmpvar_32; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-out.txt index 9d9f6b39a..0fef47659 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-out.txt @@ -5,15 +5,22 @@ void main () { vec2 tmpvar_1; tmpvar_1 = gl_TexCoord[0].xy; - vec4 tmpvar_2; - tmpvar_2.zw = vec2(0.0, 0.0); - tmpvar_2.xy = tmpvar_1; - vec2 tmpvar_3; - tmpvar_3 = (tmpvar_1 / _CenterRadius.zw); - gl_FragData[0] = texture2D (_MainTex, (mix ((_RotationMatrix * tmpvar_2).xy, tmpvar_1, vec2(min (1.0, - sqrt(dot (tmpvar_3, tmpvar_3)) + vec2 tmp_2; + vec4 tmpvar_3; + tmpvar_3.zw = vec2(0.0, 0.0); + tmpvar_3.xy = tmpvar_1; + tmp_2 = (tmpvar_1 / _CenterRadius.zw); + gl_FragData[0] = texture2D (_MainTex, (mix ((_RotationMatrix * tmpvar_3).xy, tmpvar_1, vec2(min (1.0, + sqrt(dot (tmp_2, tmp_2)) ))) + _CenterRadius.xy)); } -// inputs: 1, stats: 8 alu 1 tex 0 flow +// stats: 8 alu 1 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// uniforms: 2 (total size: 0) +// #0: _CenterRadius (high float) 4x1 [-1] +// #1: _RotationMatrix (high float) 4x4 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-ir.txt deleted file mode 100644 index 0c9aadafe..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-ir.txt +++ /dev/null @@ -1,287 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; - vec2 uvOrig; -}; -uniform float _Angle; -uniform vec4 _CenterRadius; -uniform sampler2D _MainTex; -void xll_sincos ( - in float x_1, - out float s_2, - out float c_3 -) -{ - float tmpvar_4; - tmpvar_4 = sin (x_1); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - s_2 = tmpvar_5; - float tmpvar_6; - tmpvar_6 = cos (x_1); - float tmpvar_7; - tmpvar_7 = tmpvar_6; - c_3 = tmpvar_7; -} - -void xll_sincos ( - in vec2 x_8, - out vec2 s_9, - out vec2 c_10 -) -{ - vec2 tmpvar_11; - tmpvar_11 = sin (x_8); - vec2 tmpvar_12; - tmpvar_12 = tmpvar_11; - s_9 = tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = cos (x_8); - vec2 tmpvar_14; - tmpvar_14 = tmpvar_13; - c_10 = tmpvar_14; -} - -void xll_sincos ( - in vec3 x_15, - out vec3 s_16, - out vec3 c_17 -) -{ - vec3 tmpvar_18; - tmpvar_18 = sin (x_15); - vec3 tmpvar_19; - tmpvar_19 = tmpvar_18; - s_16 = tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = cos (x_15); - vec3 tmpvar_21; - tmpvar_21 = tmpvar_20; - c_17 = tmpvar_21; -} - -void xll_sincos ( - in vec4 x_22, - out vec4 s_23, - out vec4 c_24 -) -{ - vec4 tmpvar_25; - tmpvar_25 = sin (x_22); - vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; - s_23 = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = cos (x_22); - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - c_24 = tmpvar_28; -} - -void xll_sincos ( - in mat2 x_29, - out mat2 s_30, - out mat2 c_31 -) -{ - vec2 tmpvar_32; - tmpvar_32 = sin (x_29[0]); - vec2 tmpvar_33; - tmpvar_33 = sin (x_29[1]); - mat2 tmpvar_34; - vec2 tmpvar_35; - tmpvar_35 = tmpvar_32; - tmpvar_34[0] = tmpvar_35; - vec2 tmpvar_36; - tmpvar_36 = tmpvar_33; - tmpvar_34[1] = tmpvar_36; - mat2 tmpvar_37; - tmpvar_37 = tmpvar_34; - s_30 = tmpvar_37; - vec2 tmpvar_38; - tmpvar_38 = cos (x_29[0]); - vec2 tmpvar_39; - tmpvar_39 = cos (x_29[1]); - mat2 tmpvar_40; - vec2 tmpvar_41; - tmpvar_41 = tmpvar_38; - tmpvar_40[0] = tmpvar_41; - vec2 tmpvar_42; - tmpvar_42 = tmpvar_39; - tmpvar_40[1] = tmpvar_42; - mat2 tmpvar_43; - tmpvar_43 = tmpvar_40; - c_31 = tmpvar_43; -} - -void xll_sincos ( - in mat3 x_44, - out mat3 s_45, - out mat3 c_46 -) -{ - vec3 tmpvar_47; - tmpvar_47 = sin (x_44[0]); - vec3 tmpvar_48; - tmpvar_48 = sin (x_44[1]); - vec3 tmpvar_49; - tmpvar_49 = sin (x_44[2]); - mat3 tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = tmpvar_47; - tmpvar_50[0] = tmpvar_51; - vec3 tmpvar_52; - tmpvar_52 = tmpvar_48; - tmpvar_50[1] = tmpvar_52; - vec3 tmpvar_53; - tmpvar_53 = tmpvar_49; - tmpvar_50[2] = tmpvar_53; - mat3 tmpvar_54; - tmpvar_54 = tmpvar_50; - s_45 = tmpvar_54; - vec3 tmpvar_55; - tmpvar_55 = cos (x_44[0]); - vec3 tmpvar_56; - tmpvar_56 = cos (x_44[1]); - vec3 tmpvar_57; - tmpvar_57 = cos (x_44[2]); - mat3 tmpvar_58; - vec3 tmpvar_59; - tmpvar_59 = tmpvar_55; - tmpvar_58[0] = tmpvar_59; - vec3 tmpvar_60; - tmpvar_60 = tmpvar_56; - tmpvar_58[1] = tmpvar_60; - vec3 tmpvar_61; - tmpvar_61 = tmpvar_57; - tmpvar_58[2] = tmpvar_61; - mat3 tmpvar_62; - tmpvar_62 = tmpvar_58; - c_46 = tmpvar_62; -} - -void xll_sincos ( - in mat4 x_63, - out mat4 s_64, - out mat4 c_65 -) -{ - vec4 tmpvar_66; - tmpvar_66 = sin (x_63[0]); - vec4 tmpvar_67; - tmpvar_67 = sin (x_63[1]); - vec4 tmpvar_68; - tmpvar_68 = sin (x_63[2]); - vec4 tmpvar_69; - tmpvar_69 = sin (x_63[3]); - mat4 tmpvar_70; - vec4 tmpvar_71; - tmpvar_71 = tmpvar_66; - tmpvar_70[0] = tmpvar_71; - vec4 tmpvar_72; - tmpvar_72 = tmpvar_67; - tmpvar_70[1] = tmpvar_72; - vec4 tmpvar_73; - tmpvar_73 = tmpvar_68; - tmpvar_70[2] = tmpvar_73; - vec4 tmpvar_74; - tmpvar_74 = tmpvar_69; - tmpvar_70[3] = tmpvar_74; - mat4 tmpvar_75; - tmpvar_75 = tmpvar_70; - s_64 = tmpvar_75; - vec4 tmpvar_76; - tmpvar_76 = cos (x_63[0]); - vec4 tmpvar_77; - tmpvar_77 = cos (x_63[1]); - vec4 tmpvar_78; - tmpvar_78 = cos (x_63[2]); - vec4 tmpvar_79; - tmpvar_79 = cos (x_63[3]); - mat4 tmpvar_80; - vec4 tmpvar_81; - tmpvar_81 = tmpvar_76; - tmpvar_80[0] = tmpvar_81; - vec4 tmpvar_82; - tmpvar_82 = tmpvar_77; - tmpvar_80[1] = tmpvar_82; - vec4 tmpvar_83; - tmpvar_83 = tmpvar_78; - tmpvar_80[2] = tmpvar_83; - vec4 tmpvar_84; - tmpvar_84 = tmpvar_79; - tmpvar_80[3] = tmpvar_84; - mat4 tmpvar_85; - tmpvar_85 = tmpvar_80; - c_65 = tmpvar_85; -} - -vec4 frag ( - in v2f i_86 -) -{ - vec2 uv_87; - float cosLength_88; - float sinLength_89; - float angle_90; - vec2 offset_91; - vec2 tmpvar_92; - tmpvar_92 = i_86.uvOrig; - offset_91 = tmpvar_92; - float tmpvar_93; - tmpvar_93 = length ((offset_91 / _CenterRadius.zw)); - float tmpvar_94; - tmpvar_94 = (1.0 - tmpvar_93); - angle_90 = tmpvar_94; - float tmpvar_95; - tmpvar_95 = max (0.0, angle_90); - float tmpvar_96; - tmpvar_96 = tmpvar_95; - angle_90 = tmpvar_96; - float tmpvar_97; - tmpvar_97 = ((angle_90 * angle_90) * _Angle); - angle_90 = tmpvar_97; - xll_sincos (angle_90, sinLength_89, cosLength_88); - float tmpvar_98; - tmpvar_98 = ((cosLength_88 * offset_91.x) - (sinLength_89 * offset_91.y)); - uv_87.x = tmpvar_98; - float tmpvar_99; - tmpvar_99 = ((sinLength_89 * offset_91.x) + (cosLength_88 * offset_91.y)); - uv_87.y = vec2(tmpvar_99).y; - vec2 tmpvar_100; - tmpvar_100 = (uv_87 + _CenterRadius.xy); - uv_87 = tmpvar_100; - vec4 tmpvar_101; - tmpvar_101 = texture2D (_MainTex, uv_87); - return tmpvar_101; -} - -void main () -{ - v2f xlt_i_102; - vec4 xl_retval_103; - vec4 tmpvar_104; - tmpvar_104 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_102.pos = tmpvar_104; - vec2 tmpvar_105; - tmpvar_105 = gl_TexCoord[0].xy; - vec2 tmpvar_106; - tmpvar_106 = tmpvar_105; - xlt_i_102.uv = tmpvar_106; - vec2 tmpvar_107; - tmpvar_107 = gl_TexCoord[1].xy; - vec2 tmpvar_108; - tmpvar_108 = tmpvar_107; - xlt_i_102.uvOrig = tmpvar_108; - vec4 tmpvar_109; - tmpvar_109 = frag (xlt_i_102); - vec4 tmpvar_110; - tmpvar_110 = tmpvar_109; - xl_retval_103 = tmpvar_110; - vec4 tmpvar_111; - tmpvar_111 = xl_retval_103.xyzw; - vec4 tmpvar_112; - tmpvar_112 = tmpvar_111; - gl_FragData[0] = tmpvar_112; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-out.txt index 456781266..1b197287f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-out.txt @@ -6,25 +6,29 @@ void main () vec2 tmpvar_1; tmpvar_1 = gl_TexCoord[1].xy; vec2 uv_2; - vec2 x_3; - x_3 = (tmpvar_1 / _CenterRadius.zw); - float tmpvar_4; - tmpvar_4 = max (0.0, (1.0 - sqrt( - dot (x_3, x_3) - ))); + float angle_3; + vec2 x_4; + x_4 = (tmpvar_1 / _CenterRadius.zw); + angle_3 = (1.0 - sqrt(dot (x_4, x_4))); float tmpvar_5; - tmpvar_5 = ((tmpvar_4 * tmpvar_4) * _Angle); + tmpvar_5 = max (0.0, angle_3); + angle_3 = ((tmpvar_5 * tmpvar_5) * _Angle); float tmpvar_6; - tmpvar_6 = sin(tmpvar_5); + tmpvar_6 = sin(angle_3); float tmpvar_7; - tmpvar_7 = cos(tmpvar_5); + tmpvar_7 = cos(angle_3); uv_2.x = ((tmpvar_7 * tmpvar_1.x) - (tmpvar_6 * tmpvar_1.y)); uv_2.y = ((tmpvar_6 * tmpvar_1.x) + (tmpvar_7 * tmpvar_1.y)); - vec2 tmpvar_8; - tmpvar_8 = (uv_2 + _CenterRadius.xy); - uv_2 = tmpvar_8; - gl_FragData[0] = texture2D (_MainTex, tmpvar_8); + uv_2 = (uv_2 + _CenterRadius.xy); + gl_FragData[0] = texture2D (_MainTex, uv_2); } -// inputs: 1, stats: 16 alu 1 tex 0 flow +// stats: 16 alu 1 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [2] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Angle (high float) 1x1 [-1] +// #1: _CenterRadius (high float) 4x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-ir.txt deleted file mode 100644 index 103d0f072..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-ir.txt +++ /dev/null @@ -1,185 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; - vec2 uv2_LightMap; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 lightDir; - vec2 _LightCoord; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform vec4 _LightColor0; -uniform sampler2D _LightMap; -uniform sampler2D _LightTexture0; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -void surf ( - in Input IN_6, - inout SurfaceOutput o_7 -) -{ - vec4 lm_8; - vec4 tmpvar_9; - tmpvar_9 = texture2D (_MainTex, IN_6.uv_MainTex); - vec3 tmpvar_10; - tmpvar_10 = _Color.xyz; - vec3 tmpvar_11; - tmpvar_11 = (tmpvar_9.xyz * tmpvar_10); - o_7.Albedo = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12 = texture2D (_LightMap, IN_6.uv2_LightMap); - vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - lm_8 = tmpvar_13; - vec3 tmpvar_14; - tmpvar_14 = (lm_8.xyz * o_7.Albedo.xyz); - o_7.Emission = tmpvar_14; - float tmpvar_15; - tmpvar_15 = (lm_8.w * _Color.w); - o_7.Alpha = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = texture2D (_BumpMap, IN_6.uv_BumpMap); - vec4 tmpvar_17; - tmpvar_17 = UnpackNormal (tmpvar_16); - vec3 tmpvar_18; - tmpvar_18 = tmpvar_17.xyz; - vec3 tmpvar_19; - tmpvar_19 = tmpvar_18; - o_7.Normal = tmpvar_19; -} - -vec4 LightingLambert ( - in SurfaceOutput s_20, - in vec3 lightDir_21, - in float atten_22 -) -{ - vec4 c_23; - float diff_24; - float tmpvar_25; - tmpvar_25 = dot (s_20.Normal, lightDir_21); - float tmpvar_26; - tmpvar_26 = max (0.0, tmpvar_25); - float tmpvar_27; - tmpvar_27 = tmpvar_26; - diff_24 = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = ((s_20.Albedo * _LightColor0.xyz) * ((diff_24 * atten_22) * 2.0)); - c_23.xyz = tmpvar_28.xyz.xyz; - float tmpvar_29; - tmpvar_29 = s_20.Alpha; - c_23.w = vec4(tmpvar_29).w; - return c_23; -} - -vec4 frag_surf ( - in v2f_surf IN_30 -) -{ - vec4 c_31; - vec3 lightDir_32; - SurfaceOutput o_33; - Input surfIN_34; - vec2 tmpvar_35; - tmpvar_35 = IN_30.hip_pack0.xy; - surfIN_34.uv_MainTex = tmpvar_35; - vec2 tmpvar_36; - tmpvar_36 = IN_30.hip_pack0.zw; - surfIN_34.uv_BumpMap = tmpvar_36; - vec3 tmpvar_37; - tmpvar_37 = vec3(0.0, 0.0, 0.0); - o_33.Albedo = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = vec3(0.0, 0.0, 0.0); - o_33.Emission = tmpvar_38; - float tmpvar_39; - tmpvar_39 = 0.0; - o_33.Specular = tmpvar_39; - float tmpvar_40; - tmpvar_40 = 0.0; - o_33.Alpha = tmpvar_40; - float tmpvar_41; - tmpvar_41 = 0.0; - o_33.Gloss = tmpvar_41; - surf (surfIN_34, o_33); - vec3 tmpvar_42; - tmpvar_42 = IN_30.lightDir; - lightDir_32 = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43 = texture2D (_LightTexture0, IN_30._LightCoord); - vec4 tmpvar_44; - tmpvar_44 = LightingLambert (o_33, lightDir_32, (tmpvar_43.w * 1.0)); - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - c_31 = tmpvar_45; - float tmpvar_46; - tmpvar_46 = 0.0; - c_31.w = vec4(tmpvar_46).w; - return c_31; -} - -void main () -{ - v2f_surf xlt_IN_47; - vec4 xl_retval_48; - vec4 tmpvar_49; - tmpvar_49 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_47.pos = tmpvar_49; - float tmpvar_50; - tmpvar_50 = xlv_FOG.x; - xlt_IN_47.fog = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = gl_TexCoord[0].xyzw; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - xlt_IN_47.hip_pack0 = tmpvar_52; - vec3 tmpvar_53; - tmpvar_53 = gl_TexCoord[1].xyz; - vec3 tmpvar_54; - tmpvar_54 = tmpvar_53; - xlt_IN_47.lightDir = tmpvar_54; - vec2 tmpvar_55; - tmpvar_55 = gl_TexCoord[2].xy; - vec2 tmpvar_56; - tmpvar_56 = tmpvar_55; - xlt_IN_47._LightCoord = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = frag_surf (xlt_IN_47); - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - xl_retval_48 = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59 = xl_retval_48.xyzw; - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - gl_FragData[0] = tmpvar_60; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt index 376cd7e5f..c944addf6 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt @@ -26,4 +26,14 @@ void main () } -// inputs: 1, stats: 16 alu 4 tex 0 flow +// stats: 16 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// textures: 4 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _LightMap (high 2d) 0x0 [-1] +// #2: _LightTexture0 (high 2d) 0x0 [-1] +// #3: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-ir.txt deleted file mode 100644 index 4ea542106..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-ir.txt +++ /dev/null @@ -1,178 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; - vec2 uv2_LightMap; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec4 hip_screen; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform sampler2D _LightBuffer; -uniform sampler2D _LightMap; -uniform sampler2D _MainTex; -uniform vec4 unity_Ambient; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -void surf ( - in Input IN_6, - inout SurfaceOutput o_7 -) -{ - vec4 lm_8; - vec4 tmpvar_9; - tmpvar_9 = texture2D (_MainTex, IN_6.uv_MainTex); - vec3 tmpvar_10; - tmpvar_10 = _Color.xyz; - vec3 tmpvar_11; - tmpvar_11 = (tmpvar_9.xyz * tmpvar_10); - o_7.Albedo = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12 = texture2D (_LightMap, IN_6.uv2_LightMap); - vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - lm_8 = tmpvar_13; - vec3 tmpvar_14; - tmpvar_14 = (lm_8.xyz * o_7.Albedo.xyz); - o_7.Emission = tmpvar_14; - float tmpvar_15; - tmpvar_15 = (lm_8.w * _Color.w); - o_7.Alpha = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = texture2D (_BumpMap, IN_6.uv_BumpMap); - vec4 tmpvar_17; - tmpvar_17 = UnpackNormal (tmpvar_16); - vec3 tmpvar_18; - tmpvar_18 = tmpvar_17.xyz; - vec3 tmpvar_19; - tmpvar_19 = tmpvar_18; - o_7.Normal = tmpvar_19; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_20, - in vec4 light_21 -) -{ - vec4 c_22; - vec3 tmpvar_23; - tmpvar_23 = (s_20.Albedo * light_21.xyz); - c_22.xyz = tmpvar_23.xyz.xyz; - float tmpvar_24; - tmpvar_24 = s_20.Alpha; - c_22.w = vec4(tmpvar_24).w; - return c_22; -} - -vec4 frag_surf ( - in v2f_surf IN_25 -) -{ - vec4 col_26; - vec4 light_27; - SurfaceOutput o_28; - Input surfIN_29; - vec2 tmpvar_30; - tmpvar_30 = IN_25.hip_pack0.xy; - surfIN_29.uv_MainTex = tmpvar_30; - vec2 tmpvar_31; - tmpvar_31 = IN_25.hip_pack0.zw; - surfIN_29.uv2_LightMap = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = vec3(0.0, 0.0, 0.0); - o_28.Albedo = tmpvar_32; - vec3 tmpvar_33; - tmpvar_33 = vec3(0.0, 0.0, 0.0); - o_28.Emission = tmpvar_33; - float tmpvar_34; - tmpvar_34 = 0.0; - o_28.Specular = tmpvar_34; - float tmpvar_35; - tmpvar_35 = 0.0; - o_28.Alpha = tmpvar_35; - float tmpvar_36; - tmpvar_36 = 0.0; - o_28.Gloss = tmpvar_36; - surf (surfIN_29, o_28); - vec4 tmpvar_37; - tmpvar_37 = texture2DProj (_LightBuffer, IN_25.hip_screen); - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - light_27 = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = log2 (light_27); - vec4 tmpvar_40; - tmpvar_40 = -(tmpvar_39); - light_27 = tmpvar_40; - vec3 tmpvar_41; - tmpvar_41 = (light_27.xyz + unity_Ambient.xyz); - light_27.xyz = tmpvar_41.xyz.xyz; - vec4 tmpvar_42; - tmpvar_42 = LightingLambert_PrePass (o_28, light_27); - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - col_26 = tmpvar_43; - vec3 tmpvar_44; - tmpvar_44 = (col_26.xyz + o_28.Emission); - col_26.xyz = tmpvar_44.xyz.xyz; - return col_26; -} - -void main () -{ - v2f_surf xlt_IN_45; - vec4 xl_retval_46; - vec4 tmpvar_47; - tmpvar_47 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_45.pos = tmpvar_47; - float tmpvar_48; - tmpvar_48 = xlv_FOG.x; - xlt_IN_45.fog = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = gl_TexCoord[0].xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_IN_45.hip_pack0 = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = gl_TexCoord[1].xyzw; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - xlt_IN_45.hip_screen = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = frag_surf (xlt_IN_45); - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - xl_retval_46 = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = xl_retval_46.xyzw; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - gl_FragData[0] = tmpvar_56; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-out.txt index 57de1d2e6..cd0ec4f73 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-out.txt @@ -1,4 +1,3 @@ -uniform sampler2D _BumpMap; uniform vec4 _Color; uniform sampler2D _LightBuffer; uniform sampler2D _LightMap; @@ -10,27 +9,28 @@ void main () tmpvar_1 = gl_TexCoord[0]; vec4 col_2; vec4 light_3; - vec2 tmpvar_4; - vec3 tmpvar_5; - tmpvar_5 = (texture2D (_MainTex, tmpvar_1.xy).xyz * _Color.xyz); - vec4 tmpvar_6; - tmpvar_6 = texture2D (_LightMap, tmpvar_1.zw); - vec4 normal_7; - normal_7.xy = ((texture2D (_BumpMap, tmpvar_4).wy * 2.0) - 1.0); - normal_7.z = sqrt(((1.0 - - (normal_7.x * normal_7.x) - ) - (normal_7.y * normal_7.y))); - vec4 tmpvar_8; - tmpvar_8 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); - light_3.w = tmpvar_8.w; - light_3.xyz = (tmpvar_8.xyz + unity_Ambient.xyz); - vec4 c_9; - c_9.xyz = (tmpvar_5 * light_3.xyz); - c_9.w = (tmpvar_6.w * _Color.w); - col_2.w = c_9.w; - col_2.xyz = (c_9.xyz + (tmpvar_6.xyz * tmpvar_5)); + vec3 tmpvar_4; + tmpvar_4 = (texture2D (_MainTex, tmpvar_1.xy).xyz * _Color.xyz); + vec4 tmpvar_5; + tmpvar_5 = texture2D (_LightMap, tmpvar_1.zw); + light_3 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); + light_3.xyz = (light_3.xyz + unity_Ambient.xyz); + vec4 c_6; + c_6.xyz = (tmpvar_4 * light_3.xyz); + c_6.w = (tmpvar_5.w * _Color.w); + col_2.w = c_6.w; + col_2.xyz = (c_6.xyz + (tmpvar_5.xyz * tmpvar_4)); gl_FragData[0] = col_2; } -// inputs: 1, stats: 15 alu 4 tex 0 flow +// stats: 8 alu 3 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [2] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: unity_Ambient (high float) 4x1 [-1] +// textures: 3 +// #0: _LightBuffer (high 2d) 0x0 [-1] +// #1: _LightMap (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-ir.txt deleted file mode 100644 index 1ad3ec9b5..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-ir.txt +++ /dev/null @@ -1,198 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv2_LightMap; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec4 _LightCoord; -}; -uniform vec4 _Color; -uniform vec4 _LightColor0; -uniform sampler2D _LightMap; -uniform sampler2D _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 lm_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, IN_1.uv_MainTex); - vec3 tmpvar_5; - tmpvar_5 = _Color.xyz; - vec3 tmpvar_6; - tmpvar_6 = (tmpvar_4.xyz * tmpvar_5); - o_2.Albedo = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7 = texture2D (_LightMap, IN_1.uv2_LightMap); - vec4 tmpvar_8; - tmpvar_8 = tmpvar_7; - lm_3 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = (lm_3.xyz * o_2.Albedo.xyz); - o_2.Emission = tmpvar_9; - float tmpvar_10; - tmpvar_10 = (lm_3.w * _Color.w); - o_2.Alpha = tmpvar_10; -} - -float UnitySpotCookie ( - in vec4 LightCoord_11 -) -{ - vec4 tmpvar_12; - tmpvar_12 = texture2D (_LightTexture0, ((LightCoord_11.xy / LightCoord_11.w) + 0.5)); - return tmpvar_12.w; -} - -float UnitySpotAttenuate ( - in vec3 LightCoord_13 -) -{ - float tmpvar_14; - tmpvar_14 = dot (LightCoord_13, LightCoord_13); - vec2 tmpvar_15; - tmpvar_15 = vec2(tmpvar_14); - vec2 tmpvar_16; - tmpvar_16 = tmpvar_15.xy; - vec4 tmpvar_17; - tmpvar_17 = texture2D (_LightTextureB0, tmpvar_16); - return tmpvar_17.w; -} - -vec4 LightingLambert ( - in SurfaceOutput s_18, - in vec3 lightDir_19, - in float atten_20 -) -{ - vec4 c_21; - float diff_22; - float tmpvar_23; - tmpvar_23 = dot (s_18.Normal, lightDir_19); - float tmpvar_24; - tmpvar_24 = max (0.0, tmpvar_23); - float tmpvar_25; - tmpvar_25 = tmpvar_24; - diff_22 = tmpvar_25; - vec3 tmpvar_26; - tmpvar_26 = ((s_18.Albedo * _LightColor0.xyz) * ((diff_22 * atten_20) * 2.0)); - c_21.xyz = tmpvar_26.xyz.xyz; - float tmpvar_27; - tmpvar_27 = s_18.Alpha; - c_21.w = vec4(tmpvar_27).w; - return c_21; -} - -vec4 frag_surf ( - in v2f_surf IN_28 -) -{ - vec4 c_29; - vec3 lightDir_30; - SurfaceOutput o_31; - Input surfIN_32; - vec2 tmpvar_33; - tmpvar_33 = IN_28.hip_pack0.xy; - surfIN_32.uv_MainTex = tmpvar_33; - vec3 tmpvar_34; - tmpvar_34 = vec3(0.0, 0.0, 0.0); - o_31.Albedo = tmpvar_34; - vec3 tmpvar_35; - tmpvar_35 = vec3(0.0, 0.0, 0.0); - o_31.Emission = tmpvar_35; - float tmpvar_36; - tmpvar_36 = 0.0; - o_31.Specular = tmpvar_36; - float tmpvar_37; - tmpvar_37 = 0.0; - o_31.Alpha = tmpvar_37; - float tmpvar_38; - tmpvar_38 = 0.0; - o_31.Gloss = tmpvar_38; - vec3 tmpvar_39; - tmpvar_39 = IN_28.normal; - o_31.Normal = tmpvar_39; - surf (surfIN_32, o_31); - vec3 tmpvar_40; - tmpvar_40 = IN_28.lightDir; - lightDir_30 = tmpvar_40; - vec3 tmpvar_41; - tmpvar_41 = normalize (lightDir_30); - vec3 tmpvar_42; - tmpvar_42 = tmpvar_41; - lightDir_30 = tmpvar_42; - float tmpvar_43; - tmpvar_43 = UnitySpotCookie (IN_28._LightCoord); - float tmpvar_44; - tmpvar_44 = UnitySpotAttenuate (IN_28._LightCoord.xyz); - vec4 tmpvar_45; - tmpvar_45 = LightingLambert (o_31, lightDir_30, ((float( - (IN_28._LightCoord.z > 0.0) - ) * tmpvar_43) * tmpvar_44)); - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - c_29 = tmpvar_46; - float tmpvar_47; - tmpvar_47 = 0.0; - c_29.w = vec4(tmpvar_47).w; - return c_29; -} - -void main () -{ - v2f_surf xlt_IN_48; - vec4 xl_retval_49; - vec4 tmpvar_50; - tmpvar_50 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_48.pos = tmpvar_50; - float tmpvar_51; - tmpvar_51 = xlv_FOG.x; - xlt_IN_48.fog = tmpvar_51; - vec2 tmpvar_52; - tmpvar_52 = gl_TexCoord[0].xy; - vec2 tmpvar_53; - tmpvar_53 = tmpvar_52; - xlt_IN_48.hip_pack0 = tmpvar_53; - vec3 tmpvar_54; - tmpvar_54 = gl_TexCoord[1].xyz; - vec3 tmpvar_55; - tmpvar_55 = tmpvar_54; - xlt_IN_48.normal = tmpvar_55; - vec3 tmpvar_56; - tmpvar_56 = gl_TexCoord[2].xyz; - vec3 tmpvar_57; - tmpvar_57 = tmpvar_56; - xlt_IN_48.lightDir = tmpvar_57; - vec4 tmpvar_58; - tmpvar_58 = gl_TexCoord[3].xyzw; - vec4 tmpvar_59; - tmpvar_59 = tmpvar_58; - xlt_IN_48._LightCoord = tmpvar_59; - vec4 tmpvar_60; - tmpvar_60 = frag_surf (xlt_IN_48); - vec4 tmpvar_61; - tmpvar_61 = tmpvar_60; - xl_retval_49 = tmpvar_61; - vec4 tmpvar_62; - tmpvar_62 = xl_retval_49.xyzw; - vec4 tmpvar_63; - tmpvar_63 = tmpvar_62; - gl_FragData[0] = tmpvar_63; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-out.txt index ea2c26c56..6b5c2e18c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-out.txt @@ -23,4 +23,14 @@ void main () } -// inputs: 1, stats: 17 alu 4 tex 0 flow +// stats: 17 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// textures: 4 +// #0: _LightMap (high 2d) 0x0 [-1] +// #1: _LightTexture0 (high 2d) 0x0 [-1] +// #2: _LightTextureB0 (high 2d) 0x0 [-1] +// #3: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-inES3.txt new file mode 100644 index 000000000..58c99f661 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-inES3.txt @@ -0,0 +1,86 @@ +#version 300 es +out mediump vec4 _fragData; + +struct SurfaceOutput { + lowp vec3 Albedo; + lowp vec3 Normal; + lowp vec3 Emission; + mediump float Specular; + lowp float Gloss; + lowp float Alpha; +}; +struct Input { + mediump vec2 uv_MainTex; +}; +struct v2f_surf { + highp vec4 pos; + mediump vec2 pack0; + mediump vec3 viewDir; + lowp vec3 lightDir; + lowp vec3 vlight; +}; +uniform sampler2D _BumpMap; +uniform lowp vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform mediump float _Shininess; +lowp vec3 UnpackNormal( in lowp vec4 packednormal ); +void surf( in Input IN, inout SurfaceOutput o ); +lowp vec4 LightingMobileBlinnPhong( in SurfaceOutput s, in lowp vec3 lightDir, in lowp vec3 halfDir, in lowp float atten ); +lowp vec4 frag_surf( in v2f_surf IN ); +lowp vec3 UnpackNormal( in lowp vec4 packednormal ) { + return ((packednormal.xyz * 2.0) - 1.0); +} +void surf( in Input IN, inout SurfaceOutput o ) { + lowp vec4 tex; + tex = texture2D( _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)); +} +lowp vec4 LightingMobileBlinnPhong( in SurfaceOutput s, in lowp vec3 lightDir, in lowp vec3 halfDir, in lowp float atten ) { + lowp float diff; + lowp float nh; + lowp float spec; + lowp vec4 c; + diff = max( 0.0, dot( s.Normal, lightDir)); + nh = max( 0.0, dot( s.Normal, halfDir)); + spec = (pow( nh, (s.Specular * 128.0)) * s.Gloss); + c.xyz = ((((s.Albedo * diff) + spec) * _LightColor0.xyz ) * (atten * 2.0)); + c.w = 0.0; + return c; +} +lowp vec4 frag_surf( in v2f_surf IN ) { + Input surfIN; + SurfaceOutput o; + lowp float atten; + lowp vec4 c; + surfIN.uv_MainTex = IN.pack0.xy ; + o.Albedo = vec3( 0.0); + o.Emission = vec3( 0.0); + o.Specular = 0.0; + o.Alpha = 0.0; + o.Gloss = 0.0; + surf( surfIN, o); + atten = 1.0; + c = vec4( 0.0); + c = LightingMobileBlinnPhong( o, IN.lightDir, IN.viewDir, atten); + c.xyz += (o.Albedo * IN.vlight); + return c; +} +in mediump vec2 xlv_TEXCOORD0; +in mediump vec3 xlv_TEXCOORD1; +in lowp vec3 xlv_TEXCOORD2; +in lowp vec3 xlv_TEXCOORD3; +void main() { + lowp vec4 xl_retval; + v2f_surf xlt_IN; + xlt_IN.pos = vec4(0.0); + xlt_IN.pack0 = vec2( xlv_TEXCOORD0); + xlt_IN.viewDir = vec3( xlv_TEXCOORD1); + xlt_IN.lightDir = vec3( xlv_TEXCOORD2); + xlt_IN.vlight = vec3( xlv_TEXCOORD3); + xl_retval = frag_surf( xlt_IN); + _fragData = vec4( xl_retval); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-irES.txt deleted file mode 100644 index 83b381b94..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-irES.txt +++ /dev/null @@ -1,189 +0,0 @@ -struct SurfaceOutput { - lowp vec3 Albedo; - lowp vec3 Normal; - lowp vec3 Emission; - mediump float Specular; - lowp float Gloss; - lowp float Alpha; -}; -struct Input { - mediump vec2 uv_MainTex; -}; -struct v2f_surf { - highp vec4 pos; - mediump vec2 pack0; - mediump vec3 viewDir; - lowp vec3 lightDir; - lowp vec3 vlight; -}; -uniform sampler2D _BumpMap; -uniform lowp vec4 _LightColor0; -uniform sampler2D _MainTex; -uniform mediump float _Shininess; -varying mediump vec2 xlv_TEXCOORD0; -varying mediump vec3 xlv_TEXCOORD1; -varying lowp vec3 xlv_TEXCOORD2; -varying lowp vec3 xlv_TEXCOORD3; -lowp vec3 UnpackNormal ( - in lowp vec4 packednormal_1 -) -{ - return ((packednormal_1.xyz * 2.0) - 1.0); -} - -void surf ( - in Input IN_2, - inout SurfaceOutput o_3 -) -{ - lowp vec4 tex_4; - lowp vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, IN_2.uv_MainTex); - lowp vec4 tmpvar_6; - tmpvar_6 = tmpvar_5; - tex_4 = tmpvar_6; - lowp vec3 tmpvar_7; - tmpvar_7 = tex_4.xyz; - o_3.Albedo = tmpvar_7; - lowp float tmpvar_8; - tmpvar_8 = tex_4.w; - o_3.Gloss = tmpvar_8; - lowp float tmpvar_9; - tmpvar_9 = tex_4.w; - o_3.Alpha = tmpvar_9; - mediump float tmpvar_10; - tmpvar_10 = _Shininess; - o_3.Specular = tmpvar_10; - lowp vec4 tmpvar_11; - tmpvar_11 = texture2D (_BumpMap, IN_2.uv_MainTex); - lowp vec3 tmpvar_12; - tmpvar_12 = UnpackNormal (tmpvar_11); - lowp vec3 tmpvar_13; - tmpvar_13 = tmpvar_12; - o_3.Normal = tmpvar_13; -} - -lowp vec4 LightingMobileBlinnPhong ( - in SurfaceOutput s_14, - in lowp vec3 lightDir_15, - in lowp vec3 halfDir_16, - in lowp float atten_17 -) -{ - lowp vec4 c_18; - lowp float spec_19; - lowp float nh_20; - lowp float diff_21; - lowp float tmpvar_22; - tmpvar_22 = dot (s_14.Normal, lightDir_15); - lowp float tmpvar_23; - tmpvar_23 = max (0.0, tmpvar_22); - lowp float tmpvar_24; - tmpvar_24 = tmpvar_23; - diff_21 = tmpvar_24; - lowp float tmpvar_25; - tmpvar_25 = dot (s_14.Normal, halfDir_16); - lowp float tmpvar_26; - tmpvar_26 = max (0.0, tmpvar_25); - lowp float tmpvar_27; - tmpvar_27 = tmpvar_26; - nh_20 = tmpvar_27; - mediump float tmpvar_28; - tmpvar_28 = pow (nh_20, (s_14.Specular * 128.0)); - mediump float tmpvar_29; - tmpvar_29 = (tmpvar_28 * s_14.Gloss); - spec_19 = tmpvar_29; - lowp vec3 tmpvar_30; - tmpvar_30 = ((( - (s_14.Albedo * diff_21) - + spec_19) * _LightColor0.xyz) * (atten_17 * 2.0)); - c_18.xyz = tmpvar_30.xyz.xyz; - mediump float tmpvar_31; - tmpvar_31 = 0.0; - c_18.w = vec4(tmpvar_31).w; - return c_18; -} - -lowp vec4 frag_surf ( - in v2f_surf IN_32 -) -{ - lowp vec4 c_33; - lowp float atten_34; - SurfaceOutput o_35; - Input surfIN_36; - mediump vec2 tmpvar_37; - tmpvar_37 = IN_32.pack0.xy; - surfIN_36.uv_MainTex = tmpvar_37; - mediump vec3 tmpvar_38; - tmpvar_38 = vec3(0.0, 0.0, 0.0); - o_35.Albedo = tmpvar_38; - mediump vec3 tmpvar_39; - tmpvar_39 = vec3(0.0, 0.0, 0.0); - o_35.Emission = tmpvar_39; - mediump float tmpvar_40; - tmpvar_40 = 0.0; - o_35.Specular = tmpvar_40; - mediump float tmpvar_41; - tmpvar_41 = 0.0; - o_35.Alpha = tmpvar_41; - mediump float tmpvar_42; - tmpvar_42 = 0.0; - o_35.Gloss = tmpvar_42; - surf (surfIN_36, o_35); - mediump float tmpvar_43; - tmpvar_43 = 1.0; - atten_34 = tmpvar_43; - mediump vec4 tmpvar_44; - tmpvar_44 = vec4(0.0, 0.0, 0.0, 0.0); - c_33 = tmpvar_44; - lowp vec4 tmpvar_45; - tmpvar_45 = LightingMobileBlinnPhong (o_35, IN_32.lightDir, IN_32.viewDir, atten_34); - lowp vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - c_33 = tmpvar_46; - lowp vec3 tmpvar_47; - tmpvar_47 = (c_33.xyz + (o_35.Albedo * IN_32.vlight)); - c_33.xyz = tmpvar_47.xyz.xyz; - return c_33; -} - -void main () -{ - v2f_surf xlt_IN_48; - lowp vec4 xl_retval_49; - mediump vec4 tmpvar_50; - tmpvar_50 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_48.pos = tmpvar_50; - mediump vec2 tmpvar_51; - tmpvar_51 = xlv_TEXCOORD0.xy; - mediump vec2 tmpvar_52; - tmpvar_52 = tmpvar_51; - xlt_IN_48.pack0 = tmpvar_52; - mediump vec3 tmpvar_53; - tmpvar_53 = xlv_TEXCOORD1.xyz; - mediump vec3 tmpvar_54; - tmpvar_54 = tmpvar_53; - xlt_IN_48.viewDir = tmpvar_54; - lowp vec3 tmpvar_55; - tmpvar_55 = xlv_TEXCOORD2.xyz; - lowp vec3 tmpvar_56; - tmpvar_56 = tmpvar_55; - xlt_IN_48.lightDir = tmpvar_56; - lowp vec3 tmpvar_57; - tmpvar_57 = xlv_TEXCOORD3.xyz; - lowp vec3 tmpvar_58; - tmpvar_58 = tmpvar_57; - xlt_IN_48.vlight = tmpvar_58; - lowp vec4 tmpvar_59; - tmpvar_59 = frag_surf (xlt_IN_48); - lowp vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - xl_retval_49 = tmpvar_60; - lowp vec4 tmpvar_61; - tmpvar_61 = xl_retval_49.xyzw; - lowp vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - gl_FragData[0] = tmpvar_62; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES.txt index 551da9b57..706418806 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES.txt @@ -20,8 +20,8 @@ void main () lowp float tmpvar_7; tmpvar_7 = max (0.0, dot (tmpvar_3, halfDir_4)); mediump float tmpvar_8; - tmpvar_8 = (pow (tmpvar_7, (_Shininess * 128.0)) * tmpvar_2.w); - spec_6 = tmpvar_8; + tmpvar_8 = pow (tmpvar_7, (_Shininess * 128.0)); + spec_6 = (tmpvar_8 * tmpvar_2.w); c_5.xyz = ((( (tmpvar_2.xyz * max (0.0, dot (tmpvar_3, xlv_TEXCOORD2))) + spec_6) * _LightColor0.xyz) * 2.0); @@ -32,4 +32,15 @@ void main () } -// inputs: 4, stats: 16 alu 2 tex 0 flow +// stats: 16 alu 2 tex 0 flow +// inputs: 4 +// #0: xlv_TEXCOORD0 (medium float) 2x1 [-1] +// #1: xlv_TEXCOORD1 (medium float) 3x1 [-1] +// #2: xlv_TEXCOORD2 (low float) 3x1 [-1] +// #3: xlv_TEXCOORD3 (low float) 3x1 [-1] +// uniforms: 2 (total size: 0) +// #0: _LightColor0 (low float) 4x1 [-1] +// #1: _Shininess (medium float) 1x1 [-1] +// textures: 2 +// #0: _BumpMap (low 2d) 0x0 [-1] +// #1: _MainTex (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES3.txt new file mode 100644 index 000000000..f46b1884f --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES3.txt @@ -0,0 +1,48 @@ +#version 300 es +out mediump vec4 _fragData; +uniform sampler2D _BumpMap; +uniform lowp vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform mediump float _Shininess; +in mediump vec2 xlv_TEXCOORD0; +in mediump vec3 xlv_TEXCOORD1; +in lowp vec3 xlv_TEXCOORD2; +in lowp vec3 xlv_TEXCOORD3; +void main () +{ + lowp vec4 c_1; + lowp vec4 tmpvar_2; + tmpvar_2 = texture (_MainTex, xlv_TEXCOORD0); + lowp vec3 tmpvar_3; + tmpvar_3 = ((texture (_BumpMap, xlv_TEXCOORD0).xyz * 2.0) - 1.0); + lowp vec3 halfDir_4; + halfDir_4 = xlv_TEXCOORD1; + lowp vec4 c_5; + lowp float spec_6; + lowp float tmpvar_7; + tmpvar_7 = max (0.0, dot (tmpvar_3, halfDir_4)); + mediump float tmpvar_8; + tmpvar_8 = pow (tmpvar_7, (_Shininess * 128.0)); + spec_6 = (tmpvar_8 * tmpvar_2.w); + c_5.xyz = ((( + (tmpvar_2.xyz * max (0.0, dot (tmpvar_3, xlv_TEXCOORD2))) + + spec_6) * _LightColor0.xyz) * 2.0); + c_5.w = 0.0; + c_1.w = c_5.w; + c_1.xyz = (c_5.xyz + (tmpvar_2.xyz * xlv_TEXCOORD3)); + _fragData = c_1; +} + + +// stats: 16 alu 2 tex 0 flow +// inputs: 4 +// #0: xlv_TEXCOORD0 (medium float) 2x1 [-1] +// #1: xlv_TEXCOORD1 (medium float) 3x1 [-1] +// #2: xlv_TEXCOORD2 (low float) 3x1 [-1] +// #3: xlv_TEXCOORD3 (low float) 3x1 [-1] +// uniforms: 2 (total size: 0) +// #0: _LightColor0 (low float) 4x1 [-1] +// #1: _Shininess (medium float) 1x1 [-1] +// textures: 2 +// #0: _BumpMap (low 2d) 0x0 [-1] +// #1: _MainTex (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES3Metal.txt new file mode 100644 index 000000000..469afd23c --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES3Metal.txt @@ -0,0 +1,57 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + half2 xlv_TEXCOORD0; + half3 xlv_TEXCOORD1; + half3 xlv_TEXCOORD2; + half3 xlv_TEXCOORD3; +}; +struct xlatMtlShaderOutput { + half4 _fragData [[color(0)]]; +}; +struct xlatMtlShaderUniform { + half4 _LightColor0; + half _Shininess; +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , texture2d _BumpMap [[texture(0)]], sampler _mtlsmp__BumpMap [[sampler(0)]] + , texture2d _MainTex [[texture(1)]], sampler _mtlsmp__MainTex [[sampler(1)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 c_1; + half4 tmpvar_2; + tmpvar_2 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0)); + half3 tmpvar_3; + tmpvar_3 = ((_BumpMap.sample(_mtlsmp__BumpMap, (float2)(_mtl_i.xlv_TEXCOORD0)).xyz * (half)2.0) - (half)1.0); + half3 halfDir_4; + halfDir_4 = _mtl_i.xlv_TEXCOORD1; + half4 c_5; + half spec_6; + half tmpvar_7; + tmpvar_7 = max ((half)0.0, dot (tmpvar_3, halfDir_4)); + half tmpvar_8; + tmpvar_8 = pow (tmpvar_7, (_mtl_u._Shininess * (half)128.0)); + spec_6 = (tmpvar_8 * tmpvar_2.w); + c_5.xyz = ((( + (tmpvar_2.xyz * max ((half)0.0, dot (tmpvar_3, _mtl_i.xlv_TEXCOORD2))) + + spec_6) * _mtl_u._LightColor0.xyz) * (half)2.0); + c_5.w = half(0.0); + c_1.w = c_5.w; + c_1.xyz = (c_5.xyz + (tmpvar_2.xyz * _mtl_i.xlv_TEXCOORD3)); + _mtl_o._fragData = c_1; + return _mtl_o; +} + + +// stats: 16 alu 2 tex 0 flow +// inputs: 4 +// #0: xlv_TEXCOORD0 (medium float) 2x1 [-1] +// #1: xlv_TEXCOORD1 (medium float) 3x1 [-1] +// #2: xlv_TEXCOORD2 (low float) 3x1 [-1] +// #3: xlv_TEXCOORD3 (low float) 3x1 [-1] +// uniforms: 2 (total size: 10) +// #0: _LightColor0 (low float) 4x1 [-1] loc 0 +// #1: _Shininess (medium float) 1x1 [-1] loc 8 +// textures: 2 +// #0: _BumpMap (low 2d) 0x0 [-1] loc 0 +// #1: _MainTex (low 2d) 0x0 [-1] loc 1 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_My_Soft_Occlusion_Leaves-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_My_Soft_Occlusion_Leaves-ir.txt deleted file mode 100644 index e65c20d5b..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_My_Soft_Occlusion_Leaves-ir.txt +++ /dev/null @@ -1,44 +0,0 @@ -struct v2f { - vec4 vertex; - vec4 color; - vec2 texcoord; -}; -uniform sampler2D _MainTex; -vec4 frag ( - in v2f i_1 -) -{ - vec4 tmpvar_2; - tmpvar_2 = texture2D (_MainTex, i_1.texcoord); - return (tmpvar_2 * vec4(1.0, 0.0, 0.0, 1.0)); -} - -void main () -{ - v2f xlt_i_3; - vec4 xl_retval_4; - vec4 tmpvar_5; - tmpvar_5 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_3.vertex = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6 = gl_Color.xyzw; - vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - xlt_i_3.color = tmpvar_7; - vec2 tmpvar_8; - tmpvar_8 = gl_TexCoord[0].xy; - vec2 tmpvar_9; - tmpvar_9 = tmpvar_8; - xlt_i_3.texcoord = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10 = frag (xlt_i_3); - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - xl_retval_4 = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12 = xl_retval_4.xyzw; - vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - gl_FragData[0] = tmpvar_13; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_My_Soft_Occlusion_Leaves-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_My_Soft_Occlusion_Leaves-out.txt index 15dcb5100..53684bfe7 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_My_Soft_Occlusion_Leaves-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_My_Soft_Occlusion_Leaves-out.txt @@ -5,4 +5,8 @@ void main () } -// inputs: 1, stats: 1 alu 1 tex 0 flow +// stats: 1 alu 1 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-ir.txt deleted file mode 100644 index 5f5cff675..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-ir.txt +++ /dev/null @@ -1,189 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec4 _LightCoord; -}; -uniform vec4 _Color; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_5; - tmpvar_5 = (tmpvar_4 * _Color); - c_3 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = c_3.xyz; - o_2.Albedo = tmpvar_6; - float tmpvar_7; - tmpvar_7 = c_3.w; - o_2.Alpha = tmpvar_7; -} - -float UnitySpotCookie ( - in vec4 LightCoord_8 -) -{ - vec4 tmpvar_9; - tmpvar_9 = texture2D (_LightTexture0, ((LightCoord_8.xy / LightCoord_8.w) + 0.5)); - return tmpvar_9.w; -} - -float UnitySpotAttenuate ( - in vec3 LightCoord_10 -) -{ - float tmpvar_11; - tmpvar_11 = dot (LightCoord_10, LightCoord_10); - vec2 tmpvar_12; - tmpvar_12 = vec2(tmpvar_11); - vec2 tmpvar_13; - tmpvar_13 = tmpvar_12.xy; - vec4 tmpvar_14; - tmpvar_14 = texture2D (_LightTextureB0, tmpvar_13); - return tmpvar_14.w; -} - -vec4 LightingLambert ( - in SurfaceOutput s_15, - in vec3 lightDir_16, - in float atten_17 -) -{ - vec4 c_18; - float diff_19; - float tmpvar_20; - tmpvar_20 = dot (s_15.Normal, lightDir_16); - float tmpvar_21; - tmpvar_21 = max (0.0, tmpvar_20); - float tmpvar_22; - tmpvar_22 = tmpvar_21; - diff_19 = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = ((s_15.Albedo * _LightColor0.xyz) * ((diff_19 * atten_17) * 2.0)); - c_18.xyz = tmpvar_23.xyz.xyz; - float tmpvar_24; - tmpvar_24 = s_15.Alpha; - c_18.w = vec4(tmpvar_24).w; - return c_18; -} - -vec4 frag_surf ( - in v2f_surf IN_25 -) -{ - vec4 c_26; - vec3 lightDir_27; - SurfaceOutput o_28; - Input surfIN_29; - vec2 tmpvar_30; - tmpvar_30 = IN_25.hip_pack0.xy; - surfIN_29.uv_MainTex = tmpvar_30; - vec3 tmpvar_31; - tmpvar_31 = vec3(0.0, 0.0, 0.0); - o_28.Albedo = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = vec3(0.0, 0.0, 0.0); - o_28.Emission = tmpvar_32; - float tmpvar_33; - tmpvar_33 = 0.0; - o_28.Specular = tmpvar_33; - float tmpvar_34; - tmpvar_34 = 0.0; - o_28.Alpha = tmpvar_34; - float tmpvar_35; - tmpvar_35 = 0.0; - o_28.Gloss = tmpvar_35; - vec3 tmpvar_36; - tmpvar_36 = IN_25.normal; - o_28.Normal = tmpvar_36; - surf (surfIN_29, o_28); - vec3 tmpvar_37; - tmpvar_37 = IN_25.lightDir; - lightDir_27 = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = normalize (lightDir_27); - vec3 tmpvar_39; - tmpvar_39 = tmpvar_38; - lightDir_27 = tmpvar_39; - float tmpvar_40; - tmpvar_40 = UnitySpotCookie (IN_25._LightCoord); - float tmpvar_41; - tmpvar_41 = UnitySpotAttenuate (IN_25._LightCoord.xyz); - vec4 tmpvar_42; - tmpvar_42 = LightingLambert (o_28, lightDir_27, ((float( - (IN_25._LightCoord.z > 0.0) - ) * tmpvar_40) * tmpvar_41)); - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - c_26 = tmpvar_43; - float tmpvar_44; - tmpvar_44 = 0.0; - c_26.w = vec4(tmpvar_44).w; - return c_26; -} - -void main () -{ - v2f_surf xlt_IN_45; - vec4 xl_retval_46; - vec4 tmpvar_47; - tmpvar_47 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_45.pos = tmpvar_47; - float tmpvar_48; - tmpvar_48 = xlv_FOG.x; - xlt_IN_45.fog = tmpvar_48; - vec2 tmpvar_49; - tmpvar_49 = gl_TexCoord[0].xy; - vec2 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_IN_45.hip_pack0 = tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = gl_TexCoord[1].xyz; - vec3 tmpvar_52; - tmpvar_52 = tmpvar_51; - xlt_IN_45.normal = tmpvar_52; - vec3 tmpvar_53; - tmpvar_53 = gl_TexCoord[2].xyz; - vec3 tmpvar_54; - tmpvar_54 = tmpvar_53; - xlt_IN_45.lightDir = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = gl_TexCoord[3].xyzw; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - xlt_IN_45._LightCoord = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = frag_surf (xlt_IN_45); - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - xl_retval_46 = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59 = xl_retval_46.xyzw; - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - gl_FragData[0] = tmpvar_60; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-out.txt index aae3545a9..2ca19c2dc 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-out.txt @@ -8,19 +8,28 @@ void main () vec4 tmpvar_1; tmpvar_1 = gl_TexCoord[3]; vec4 c_2; - vec4 tmpvar_3; - tmpvar_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); + vec4 c_3; + c_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); vec4 c_4; - c_4.xyz = ((tmpvar_3.xyz * _LightColor0.xyz) * (( + c_4.xyz = ((c_3.xyz * _LightColor0.xyz) * (( max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) * ((float((tmpvar_1.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_1.xy / tmpvar_1.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_1.xyz, tmpvar_1.xyz))).w) ) * 2.0)); - c_4.w = tmpvar_3.w; + c_4.w = c_3.w; c_2.xyz = c_4.xyz; c_2.w = 0.0; gl_FragData[0] = c_2; } -// inputs: 1, stats: 16 alu 3 tex 0 flow +// stats: 16 alu 3 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// textures: 3 +// #0: _LightTexture0 (high 2d) 0x0 [-1] +// #1: _LightTextureB0 (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-ir.txt deleted file mode 100644 index 22bb6e1dc..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-ir.txt +++ /dev/null @@ -1,155 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec2 _LightCoord; -}; -uniform vec4 _Color; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_5; - tmpvar_5 = (tmpvar_4 * _Color); - c_3 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = c_3.xyz; - o_2.Albedo = tmpvar_6; - float tmpvar_7; - tmpvar_7 = c_3.w; - o_2.Alpha = tmpvar_7; -} - -vec4 LightingLambert ( - in SurfaceOutput s_8, - in vec3 lightDir_9, - in float atten_10 -) -{ - vec4 c_11; - float diff_12; - float tmpvar_13; - tmpvar_13 = dot (s_8.Normal, lightDir_9); - float tmpvar_14; - tmpvar_14 = max (0.0, tmpvar_13); - float tmpvar_15; - tmpvar_15 = tmpvar_14; - diff_12 = tmpvar_15; - vec3 tmpvar_16; - tmpvar_16 = ((s_8.Albedo * _LightColor0.xyz) * ((diff_12 * atten_10) * 2.0)); - c_11.xyz = tmpvar_16.xyz.xyz; - float tmpvar_17; - tmpvar_17 = s_8.Alpha; - c_11.w = vec4(tmpvar_17).w; - return c_11; -} - -vec4 frag_surf ( - in v2f_surf IN_18 -) -{ - vec4 c_19; - vec3 lightDir_20; - SurfaceOutput o_21; - Input surfIN_22; - vec2 tmpvar_23; - tmpvar_23 = IN_18.hip_pack0.xy; - surfIN_22.uv_MainTex = tmpvar_23; - vec3 tmpvar_24; - tmpvar_24 = vec3(0.0, 0.0, 0.0); - o_21.Albedo = tmpvar_24; - vec3 tmpvar_25; - tmpvar_25 = vec3(0.0, 0.0, 0.0); - o_21.Emission = tmpvar_25; - float tmpvar_26; - tmpvar_26 = 0.0; - o_21.Specular = tmpvar_26; - float tmpvar_27; - tmpvar_27 = 0.0; - o_21.Alpha = tmpvar_27; - float tmpvar_28; - tmpvar_28 = 0.0; - o_21.Gloss = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = IN_18.normal; - o_21.Normal = tmpvar_29; - surf (surfIN_22, o_21); - vec3 tmpvar_30; - tmpvar_30 = IN_18.lightDir; - lightDir_20 = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = texture2D (_LightTexture0, IN_18._LightCoord); - vec4 tmpvar_32; - tmpvar_32 = LightingLambert (o_21, lightDir_20, (tmpvar_31.w * 1.0)); - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - c_19 = tmpvar_33; - float tmpvar_34; - tmpvar_34 = 0.0; - c_19.w = vec4(tmpvar_34).w; - return c_19; -} - -void main () -{ - v2f_surf xlt_IN_35; - vec4 xl_retval_36; - vec4 tmpvar_37; - tmpvar_37 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_35.pos = tmpvar_37; - float tmpvar_38; - tmpvar_38 = xlv_FOG.x; - xlt_IN_35.fog = tmpvar_38; - vec2 tmpvar_39; - tmpvar_39 = gl_TexCoord[0].xy; - vec2 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_IN_35.hip_pack0 = tmpvar_40; - vec3 tmpvar_41; - tmpvar_41 = gl_TexCoord[1].xyz; - vec3 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_IN_35.normal = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = gl_TexCoord[2].xyz; - vec3 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_IN_35.lightDir = tmpvar_44; - vec2 tmpvar_45; - tmpvar_45 = gl_TexCoord[3].xy; - vec2 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_IN_35._LightCoord = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = frag_surf (xlt_IN_35); - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - xl_retval_36 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = xl_retval_36.xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - gl_FragData[0] = tmpvar_50; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-out.txt index b701346f5..5f001ce83 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-out.txt @@ -5,17 +5,25 @@ uniform sampler2D _MainTex; void main () { vec4 c_1; - vec4 tmpvar_2; - tmpvar_2 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); + vec4 c_2; + c_2 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); vec4 c_3; - c_3.xyz = ((tmpvar_2.xyz * _LightColor0.xyz) * (( + c_3.xyz = ((c_2.xyz * _LightColor0.xyz) * (( max (0.0, dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz)) * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0)); - c_3.w = tmpvar_2.w; + c_3.w = c_2.w; c_1.xyz = c_3.xyz; c_1.w = 0.0; gl_FragData[0] = c_1; } -// inputs: 1, stats: 8 alu 2 tex 0 flow +// stats: 8 alu 2 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// textures: 2 +// #0: _LightTexture0 (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-ir.txt deleted file mode 100644 index d0dd49134..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-ir.txt +++ /dev/null @@ -1,117 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - vec3 vec; -}; -uniform vec4 _Color; -uniform vec4 _LightPositionRange; -uniform sampler2D _MainTex; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_5; - tmpvar_5 = (tmpvar_4 * _Color); - c_3 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = c_3.xyz; - o_2.Albedo = tmpvar_6; - float tmpvar_7; - tmpvar_7 = c_3.w; - o_2.Alpha = tmpvar_7; -} - -vec4 EncodeFloatRGBA ( - in float v_8 -) -{ - vec4 enc_9; - float kEncodeBit_10; - vec4 kEncodeMul_11; - vec4 tmpvar_12; - tmpvar_12 = vec4(1.0, 255.0, 65025.0, 1.60581e+08); - kEncodeMul_11 = tmpvar_12; - float tmpvar_13; - tmpvar_13 = 0.00392157; - kEncodeBit_10 = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = (kEncodeMul_11 * v_8); - enc_9 = tmpvar_14; - vec4 tmpvar_15; - tmpvar_15 = fract (enc_9); - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - enc_9 = tmpvar_16; - vec4 tmpvar_17; - tmpvar_17 = (enc_9 - (enc_9.yzww * kEncodeBit_10)); - enc_9 = tmpvar_17; - return enc_9; -} - -vec4 frag_surf ( - in v2f_surf IN_18 -) -{ - Input surfIN_19; - SurfaceOutput o_20; - vec3 tmpvar_21; - tmpvar_21 = vec3(0.0, 0.0, 0.0); - o_20.Albedo = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = vec3(0.0, 0.0, 0.0); - o_20.Emission = tmpvar_22; - float tmpvar_23; - tmpvar_23 = 0.0; - o_20.Specular = tmpvar_23; - float tmpvar_24; - tmpvar_24 = 0.0; - o_20.Alpha = tmpvar_24; - float tmpvar_25; - tmpvar_25 = 0.0; - o_20.Gloss = tmpvar_25; - surf (surfIN_19, o_20); - float tmpvar_26; - tmpvar_26 = length (IN_18.vec); - vec4 tmpvar_27; - tmpvar_27 = EncodeFloatRGBA ((tmpvar_26 * _LightPositionRange.w)); - return tmpvar_27; -} - -void main () -{ - v2f_surf xlt_IN_28; - vec4 xl_retval_29; - vec4 tmpvar_30; - tmpvar_30 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_28.pos = tmpvar_30; - vec3 tmpvar_31; - tmpvar_31 = gl_TexCoord[0].xyz; - vec3 tmpvar_32; - tmpvar_32 = tmpvar_31; - xlt_IN_28.vec = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = frag_surf (xlt_IN_28); - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - xl_retval_29 = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35 = xl_retval_29.xyzw; - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - gl_FragData[0] = tmpvar_36; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-out.txt index 58c7cf154..cb620ef48 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-out.txt @@ -3,12 +3,19 @@ void main () { vec3 tmpvar_1; tmpvar_1 = gl_TexCoord[0].xyz; - vec4 tmpvar_2; - tmpvar_2 = fract((vec4(1.0, 255.0, 65025.0, 1.60581e+08) * ( - sqrt(dot (tmpvar_1, tmpvar_1)) - * _LightPositionRange.w))); - gl_FragData[0] = (tmpvar_2 - (tmpvar_2.yzww * 0.00392157)); + vec4 enc_2; + enc_2 = (vec4(1.0, 255.0, 65025.0, 1.60581e+08) * (sqrt( + dot (tmpvar_1, tmpvar_1) + ) * _LightPositionRange.w)); + vec4 tmpvar_3; + tmpvar_3 = fract(enc_2); + enc_2 = (tmpvar_3 - (tmpvar_3.yzww * 0.00392157)); + gl_FragData[0] = enc_2; } -// inputs: 1, stats: 7 alu 0 tex 0 flow +// stats: 7 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// uniforms: 1 (total size: 0) +// #0: _LightPositionRange (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-ir.txt deleted file mode 100644 index c7b716586..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-ir.txt +++ /dev/null @@ -1,315 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - vec3 _ShadowCoord0; - vec3 _ShadowCoord1; - vec3 _ShadowCoord2; - vec3 _ShadowCoord3; - vec2 _ShadowZFade; -}; -uniform vec4 _Color; -uniform vec4 _LightShadowData; -uniform vec4 _LightSplitsFar; -uniform vec4 _LightSplitsNear; -uniform sampler2D _MainTex; -uniform vec4 _ProjectionParams; -uniform sampler2D _ShadowMapTexture; -float xll_saturate ( - in float x_1 -) -{ - float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -vec2 xll_saturate ( - in vec2 x_3 -) -{ - vec2 tmpvar_4; - tmpvar_4 = clamp (x_3, 0.0, 1.0); - return tmpvar_4; -} - -vec3 xll_saturate ( - in vec3 x_5 -) -{ - vec3 tmpvar_6; - tmpvar_6 = clamp (x_5, 0.0, 1.0); - return tmpvar_6; -} - -vec4 xll_saturate ( - in vec4 x_7 -) -{ - vec4 tmpvar_8; - tmpvar_8 = clamp (x_7, 0.0, 1.0); - return tmpvar_8; -} - -mat2 xll_saturate ( - in mat2 m_9 -) -{ - vec2 tmpvar_10; - tmpvar_10 = clamp (m_9[0], 0.0, 1.0); - vec2 tmpvar_11; - tmpvar_11 = clamp (m_9[1], 0.0, 1.0); - mat2 tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_10; - tmpvar_12[0] = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_12[1] = tmpvar_14; - return tmpvar_12; -} - -mat3 xll_saturate ( - in mat3 m_15 -) -{ - vec3 tmpvar_16; - tmpvar_16 = clamp (m_15[0], 0.0, 1.0); - vec3 tmpvar_17; - tmpvar_17 = clamp (m_15[1], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_15[2], 0.0, 1.0); - mat3 tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_16; - tmpvar_19[0] = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_19[1] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_19[2] = tmpvar_22; - return tmpvar_19; -} - -mat4 xll_saturate ( - in mat4 m_23 -) -{ - vec4 tmpvar_24; - tmpvar_24 = clamp (m_23[0], 0.0, 1.0); - vec4 tmpvar_25; - tmpvar_25 = clamp (m_23[1], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_23[2], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_23[3], 0.0, 1.0); - mat4 tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_24; - tmpvar_28[0] = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_28[1] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_28[2] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_28[3] = tmpvar_32; - return tmpvar_28; -} - -void surf ( - in Input IN_33, - inout SurfaceOutput o_34 -) -{ - vec4 c_35; - vec4 tmpvar_36; - tmpvar_36 = texture2D (_MainTex, IN_33.uv_MainTex); - vec4 tmpvar_37; - tmpvar_37 = (tmpvar_36 * _Color); - c_35 = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = c_35.xyz; - o_34.Albedo = tmpvar_38; - float tmpvar_39; - tmpvar_39 = c_35.w; - o_34.Alpha = tmpvar_39; -} - -vec2 EncodeFloatRG ( - in float v_40 -) -{ - vec2 enc_41; - float kEncodeBit_42; - vec2 kEncodeMul_43; - vec2 tmpvar_44; - tmpvar_44 = vec2(1.0, 255.0); - kEncodeMul_43 = tmpvar_44; - float tmpvar_45; - tmpvar_45 = 0.00392157; - kEncodeBit_42 = tmpvar_45; - vec2 tmpvar_46; - tmpvar_46 = (kEncodeMul_43 * v_40); - enc_41 = tmpvar_46; - vec2 tmpvar_47; - tmpvar_47 = fract (enc_41); - vec2 tmpvar_48; - tmpvar_48 = tmpvar_47; - enc_41 = tmpvar_48; - float tmpvar_49; - tmpvar_49 = (enc_41.x - (enc_41.y * kEncodeBit_42)); - enc_41.x = tmpvar_49; - return enc_41; -} - -vec4 frag_surf ( - in v2f_surf IN_50 -) -{ - vec4 res_51; - float faded_52; - float shadow_53; - vec4 coord_54; - vec4 weights_55; - vec4 far_56; - vec4 near_57; - vec4 z_58; - Input surfIN_59; - SurfaceOutput o_60; - vec3 tmpvar_61; - tmpvar_61 = vec3(0.0, 0.0, 0.0); - o_60.Albedo = tmpvar_61; - vec3 tmpvar_62; - tmpvar_62 = vec3(0.0, 0.0, 0.0); - o_60.Emission = tmpvar_62; - float tmpvar_63; - tmpvar_63 = 0.0; - o_60.Specular = tmpvar_63; - float tmpvar_64; - tmpvar_64 = 0.0; - o_60.Alpha = tmpvar_64; - float tmpvar_65; - tmpvar_65 = 0.0; - o_60.Gloss = tmpvar_65; - surf (surfIN_59, o_60); - vec4 tmpvar_66; - tmpvar_66 = vec4(IN_50._ShadowZFade.x); - vec4 tmpvar_67; - tmpvar_67 = tmpvar_66; - z_58 = tmpvar_67; - bvec4 tmpvar_68; - tmpvar_68 = greaterThanEqual (z_58, _LightSplitsNear); - vec4 tmpvar_69; - tmpvar_69 = vec4(tmpvar_68).xyzw; - vec4 tmpvar_70; - tmpvar_70 = tmpvar_69; - near_57 = tmpvar_70; - bvec4 tmpvar_71; - tmpvar_71 = lessThan (z_58, _LightSplitsFar); - vec4 tmpvar_72; - tmpvar_72 = vec4(tmpvar_71).xyzw; - vec4 tmpvar_73; - tmpvar_73 = tmpvar_72; - far_56 = tmpvar_73; - vec4 tmpvar_74; - tmpvar_74 = (near_57 * far_56); - weights_55 = tmpvar_74; - vec4 tmpvar_75; - tmpvar_75.w = 1.0; - tmpvar_75.xyz = ((( - (IN_50._ShadowCoord0 * weights_55.x) - + - (IN_50._ShadowCoord1 * weights_55.y) - ) + (IN_50._ShadowCoord2 * weights_55.z)) + (IN_50._ShadowCoord3 * weights_55.w)).xyz; - vec4 tmpvar_76; - tmpvar_76 = tmpvar_75; - coord_54 = tmpvar_76; - vec4 tmpvar_77; - tmpvar_77 = texture2D (_ShadowMapTexture, coord_54.xy); - float tmpvar_78; - if ((tmpvar_77.x < coord_54.z)) { - tmpvar_78 = _LightShadowData.x; - } else { - tmpvar_78 = 1.0; - }; - float tmpvar_79; - tmpvar_79 = tmpvar_78; - shadow_53 = tmpvar_79; - float tmpvar_80; - tmpvar_80 = xll_saturate (IN_50._ShadowZFade.y); - float tmpvar_81; - tmpvar_81 = xll_saturate ((shadow_53 + tmpvar_80)); - float tmpvar_82; - tmpvar_82 = tmpvar_81; - faded_52 = tmpvar_82; - float tmpvar_83; - tmpvar_83 = faded_52; - res_51.x = tmpvar_83; - float tmpvar_84; - tmpvar_84 = 1.0; - res_51.y = vec2(tmpvar_84).y; - vec2 tmpvar_85; - tmpvar_85 = EncodeFloatRG ((1.0 - (z_58 * _ProjectionParams.w)).x); - vec2 tmpvar_86; - tmpvar_86 = tmpvar_85; - res_51.zw = tmpvar_86.xxxy.zw; - return res_51; -} - -void main () -{ - v2f_surf xlt_IN_87; - vec4 xl_retval_88; - vec4 tmpvar_89; - tmpvar_89 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_87.pos = tmpvar_89; - vec3 tmpvar_90; - tmpvar_90 = gl_TexCoord[0].xyz; - vec3 tmpvar_91; - tmpvar_91 = tmpvar_90; - xlt_IN_87._ShadowCoord0 = tmpvar_91; - vec3 tmpvar_92; - tmpvar_92 = gl_TexCoord[1].xyz; - vec3 tmpvar_93; - tmpvar_93 = tmpvar_92; - xlt_IN_87._ShadowCoord1 = tmpvar_93; - vec3 tmpvar_94; - tmpvar_94 = gl_TexCoord[2].xyz; - vec3 tmpvar_95; - tmpvar_95 = tmpvar_94; - xlt_IN_87._ShadowCoord2 = tmpvar_95; - vec3 tmpvar_96; - tmpvar_96 = gl_TexCoord[3].xyz; - vec3 tmpvar_97; - tmpvar_97 = tmpvar_96; - xlt_IN_87._ShadowCoord3 = tmpvar_97; - vec2 tmpvar_98; - tmpvar_98 = gl_TexCoord[4].xy; - vec2 tmpvar_99; - tmpvar_99 = tmpvar_98; - xlt_IN_87._ShadowZFade = tmpvar_99; - vec4 tmpvar_100; - tmpvar_100 = frag_surf (xlt_IN_87); - vec4 tmpvar_101; - tmpvar_101 = tmpvar_100; - xl_retval_88 = tmpvar_101; - vec4 tmpvar_102; - tmpvar_102 = xl_retval_88.xyzw; - vec4 tmpvar_103; - tmpvar_103 = tmpvar_102; - gl_FragData[0] = tmpvar_103; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-out.txt index 88a35c392..b820441d5 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-out.txt @@ -8,15 +8,15 @@ void main () vec2 tmpvar_1; tmpvar_1 = gl_TexCoord[4].xy; vec4 res_2; - vec4 tmpvar_3; - tmpvar_3 = (vec4(greaterThanEqual (tmpvar_1.xxxx, _LightSplitsNear)) * vec4(lessThan (tmpvar_1.xxxx, _LightSplitsFar))); + vec4 weights_3; + weights_3 = (vec4(greaterThanEqual (tmpvar_1.xxxx, _LightSplitsNear)) * vec4(lessThan (tmpvar_1.xxxx, _LightSplitsFar))); vec4 tmpvar_4; tmpvar_4.w = 1.0; tmpvar_4.xyz = ((( - (gl_TexCoord[0].xyz * tmpvar_3.x) + (gl_TexCoord[0].xyz * weights_3.x) + - (gl_TexCoord[1].xyz * tmpvar_3.y) - ) + (gl_TexCoord[2].xyz * tmpvar_3.z)) + (gl_TexCoord[3].xyz * tmpvar_3.w)); + (gl_TexCoord[1].xyz * weights_3.y) + ) + (gl_TexCoord[2].xyz * weights_3.z)) + (gl_TexCoord[3].xyz * weights_3.w)); vec4 tmpvar_5; tmpvar_5 = texture2D (_ShadowMapTexture, tmpvar_4.xy); float tmpvar_6; @@ -28,10 +28,9 @@ void main () res_2.x = clamp ((tmpvar_6 + clamp (tmpvar_1.y, 0.0, 1.0)), 0.0, 1.0); res_2.y = 1.0; vec2 enc_7; + enc_7 = (vec2(1.0, 255.0) * (1.0 - (tmpvar_1.xxxx * _ProjectionParams.w)).x); vec2 tmpvar_8; - tmpvar_8 = fract((vec2(1.0, 255.0) * (1.0 - - (tmpvar_1.xxxx * _ProjectionParams.w) - ).x)); + tmpvar_8 = fract(enc_7); enc_7.y = tmpvar_8.y; enc_7.x = (tmpvar_8.x - (tmpvar_8.y * 0.00392157)); res_2.zw = enc_7; @@ -39,4 +38,13 @@ void main () } -// inputs: 1, stats: 25 alu 1 tex 1 flow +// stats: 25 alu 1 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [5] loc 4 +// uniforms: 4 (total size: 0) +// #0: _LightShadowData (high float) 4x1 [-1] +// #1: _LightSplitsFar (high float) 4x1 [-1] +// #2: _LightSplitsNear (high float) 4x1 [-1] +// #3: _ProjectionParams (high float) 4x1 [-1] +// textures: 1 +// #0: _ShadowMapTexture (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-ir.txt deleted file mode 100644 index 6580bc8dd..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-ir.txt +++ /dev/null @@ -1,183 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 vlight; - vec4 _ShadowCoord; -}; -uniform vec4 _Color; -uniform float _Cutoff; -uniform vec4 _LightColor0; -uniform sampler2D _MainTex; -uniform sampler2D _ShadowMapTexture; -uniform vec4 _WorldSpaceLightPos0; -varying vec4 xlv_FOG; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -float unitySampleShadow ( - in vec4 shadowCoord_2 -) -{ - float shadow_3; - vec4 tmpvar_4; - tmpvar_4 = texture2DProj (_ShadowMapTexture, shadowCoord_2); - float tmpvar_5; - tmpvar_5 = tmpvar_4.x; - shadow_3 = tmpvar_5; - return shadow_3; -} - -void surf ( - in Input IN_6, - inout SurfaceOutput o_7 -) -{ - vec4 c_8; - vec4 tmpvar_9; - tmpvar_9 = texture2D (_MainTex, IN_6.uv_MainTex); - vec4 tmpvar_10; - tmpvar_10 = (tmpvar_9 * _Color); - c_8 = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = c_8.xyz; - o_7.Albedo = tmpvar_11; - float tmpvar_12; - tmpvar_12 = c_8.w; - o_7.Alpha = tmpvar_12; -} - -vec4 LightingLambert ( - in SurfaceOutput s_13, - in vec3 lightDir_14, - in float atten_15 -) -{ - vec4 c_16; - float diff_17; - float tmpvar_18; - tmpvar_18 = dot (s_13.Normal, lightDir_14); - float tmpvar_19; - tmpvar_19 = max (0.0, tmpvar_18); - float tmpvar_20; - tmpvar_20 = tmpvar_19; - diff_17 = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = ((s_13.Albedo * _LightColor0.xyz) * ((diff_17 * atten_15) * 2.0)); - c_16.xyz = tmpvar_21.xyz.xyz; - float tmpvar_22; - tmpvar_22 = s_13.Alpha; - c_16.w = vec4(tmpvar_22).w; - return c_16; -} - -vec4 frag_surf ( - in v2f_surf IN_23 -) -{ - vec4 c_24; - float atten_25; - SurfaceOutput o_26; - Input surfIN_27; - vec2 tmpvar_28; - tmpvar_28 = IN_23.hip_pack0.xy; - surfIN_27.uv_MainTex = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = vec3(0.0, 0.0, 0.0); - o_26.Albedo = tmpvar_29; - vec3 tmpvar_30; - tmpvar_30 = vec3(0.0, 0.0, 0.0); - o_26.Emission = tmpvar_30; - float tmpvar_31; - tmpvar_31 = 0.0; - o_26.Specular = tmpvar_31; - float tmpvar_32; - tmpvar_32 = 0.0; - o_26.Alpha = tmpvar_32; - float tmpvar_33; - tmpvar_33 = 0.0; - o_26.Gloss = tmpvar_33; - vec3 tmpvar_34; - tmpvar_34 = IN_23.normal; - o_26.Normal = tmpvar_34; - surf (surfIN_27, o_26); - xll_clip ((o_26.Alpha - _Cutoff)); - float tmpvar_35; - tmpvar_35 = unitySampleShadow (IN_23._ShadowCoord); - float tmpvar_36; - tmpvar_36 = tmpvar_35; - atten_25 = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37 = LightingLambert (o_26, _WorldSpaceLightPos0.xyz, atten_25); - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - c_24 = tmpvar_38; - vec3 tmpvar_39; - tmpvar_39 = (c_24.xyz + (o_26.Albedo * IN_23.vlight)); - c_24.xyz = tmpvar_39.xyz.xyz; - float tmpvar_40; - tmpvar_40 = o_26.Alpha; - c_24.w = vec4(tmpvar_40).w; - return c_24; -} - -void main () -{ - v2f_surf xlt_IN_41; - vec4 xl_retval_42; - vec4 tmpvar_43; - tmpvar_43 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_41.pos = tmpvar_43; - float tmpvar_44; - tmpvar_44 = xlv_FOG.x; - xlt_IN_41.fog = tmpvar_44; - vec2 tmpvar_45; - tmpvar_45 = gl_TexCoord[0].xy; - vec2 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_IN_41.hip_pack0 = tmpvar_46; - vec3 tmpvar_47; - tmpvar_47 = gl_TexCoord[1].xyz; - vec3 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_IN_41.normal = tmpvar_48; - vec3 tmpvar_49; - tmpvar_49 = gl_TexCoord[2].xyz; - vec3 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_IN_41.vlight = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = gl_TexCoord[3].xyzw; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - xlt_IN_41._ShadowCoord = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = frag_surf (xlt_IN_41); - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - xl_retval_42 = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = xl_retval_42.xyzw; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - gl_FragData[0] = tmpvar_56; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-out.txt index adf045171..44506be17 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-out.txt @@ -7,24 +7,34 @@ uniform vec4 _WorldSpaceLightPos0; void main () { vec4 c_1; - vec4 tmpvar_2; - tmpvar_2 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); - float tmpvar_3; - tmpvar_3 = tmpvar_2.w; + float tmpvar_2; + vec4 c_3; + c_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); + tmpvar_2 = c_3.w; float x_4; - x_4 = (tmpvar_2.w - _Cutoff); + x_4 = (c_3.w - _Cutoff); if ((x_4 < 0.0)) { discard; }; vec4 c_5; - c_5.xyz = ((tmpvar_2.xyz * _LightColor0.xyz) * (( + c_5.xyz = ((c_3.xyz * _LightColor0.xyz) * (( max (0.0, dot (gl_TexCoord[1].xyz, _WorldSpaceLightPos0.xyz)) * texture2DProj (_ShadowMapTexture, gl_TexCoord[3]).x) * 2.0)); - c_5.w = tmpvar_3; - c_1.xyz = (c_5.xyz + (tmpvar_2.xyz * gl_TexCoord[2].xyz)); - c_1.w = tmpvar_3; + c_5.w = tmpvar_2; + c_1.xyz = (c_5.xyz + (c_3.xyz * gl_TexCoord[2].xyz)); + c_1.w = tmpvar_2; gl_FragData[0] = c_1; } -// inputs: 1, stats: 11 alu 3 tex 1 flow +// stats: 11 alu 3 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 4 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _Cutoff (high float) 1x1 [-1] +// #2: _LightColor0 (high float) 4x1 [-1] +// #3: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// textures: 2 +// #0: _MainTex (high 2d) 0x0 [-1] +// #1: _ShadowMapTexture (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-ir.txt deleted file mode 100644 index b1496bc1e..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-ir.txt +++ /dev/null @@ -1,147 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 hip_screen; -}; -uniform vec4 _Color; -uniform float _Cutoff; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform vec4 unity_Ambient; -varying vec4 xlv_FOG; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -void surf ( - in Input IN_2, - inout SurfaceOutput o_3 -) -{ - vec4 c_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, IN_2.uv_MainTex); - vec4 tmpvar_6; - tmpvar_6 = (tmpvar_5 * _Color); - c_4 = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = c_4.xyz; - o_3.Albedo = tmpvar_7; - float tmpvar_8; - tmpvar_8 = c_4.w; - o_3.Alpha = tmpvar_8; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_9, - in vec4 light_10 -) -{ - vec4 c_11; - vec3 tmpvar_12; - tmpvar_12 = (s_9.Albedo * light_10.xyz); - c_11.xyz = tmpvar_12.xyz.xyz; - float tmpvar_13; - tmpvar_13 = s_9.Alpha; - c_11.w = vec4(tmpvar_13).w; - return c_11; -} - -vec4 frag_surf ( - in v2f_surf IN_14 -) -{ - vec4 col_15; - vec4 light_16; - SurfaceOutput o_17; - Input surfIN_18; - vec2 tmpvar_19; - tmpvar_19 = IN_14.hip_pack0.xy; - surfIN_18.uv_MainTex = tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = vec3(0.0, 0.0, 0.0); - o_17.Albedo = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = vec3(0.0, 0.0, 0.0); - o_17.Emission = tmpvar_21; - float tmpvar_22; - tmpvar_22 = 0.0; - o_17.Specular = tmpvar_22; - float tmpvar_23; - tmpvar_23 = 0.0; - o_17.Alpha = tmpvar_23; - float tmpvar_24; - tmpvar_24 = 0.0; - o_17.Gloss = tmpvar_24; - surf (surfIN_18, o_17); - xll_clip ((o_17.Alpha - _Cutoff)); - vec4 tmpvar_25; - tmpvar_25 = texture2DProj (_LightBuffer, IN_14.hip_screen); - vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; - light_16 = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = log2 (light_16); - vec4 tmpvar_28; - tmpvar_28 = -(tmpvar_27); - light_16 = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = (light_16.xyz + unity_Ambient.xyz); - light_16.xyz = tmpvar_29.xyz.xyz; - vec4 tmpvar_30; - tmpvar_30 = LightingLambert_PrePass (o_17, light_16); - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - col_15 = tmpvar_31; - return col_15; -} - -void main () -{ - v2f_surf xlt_IN_32; - vec4 xl_retval_33; - vec4 tmpvar_34; - tmpvar_34 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_32.pos = tmpvar_34; - float tmpvar_35; - tmpvar_35 = xlv_FOG.x; - xlt_IN_32.fog = tmpvar_35; - vec2 tmpvar_36; - tmpvar_36 = gl_TexCoord[0].xy; - vec2 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlt_IN_32.hip_pack0 = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = gl_TexCoord[1].xyzw; - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - xlt_IN_32.hip_screen = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = frag_surf (xlt_IN_32); - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - xl_retval_33 = tmpvar_41; - vec4 tmpvar_42; - tmpvar_42 = xl_retval_33.xyzw; - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - gl_FragData[0] = tmpvar_43; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-out.txt index df218baa0..8e834b2b1 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-out.txt @@ -6,22 +6,29 @@ uniform vec4 unity_Ambient; void main () { vec4 light_1; - vec4 tmpvar_2; - tmpvar_2 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); + vec4 c_2; + c_2 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); float x_3; - x_3 = (tmpvar_2.w - _Cutoff); + x_3 = (c_2.w - _Cutoff); if ((x_3 < 0.0)) { discard; }; - vec4 tmpvar_4; - tmpvar_4 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); - light_1.w = tmpvar_4.w; - light_1.xyz = (tmpvar_4.xyz + unity_Ambient.xyz); - vec4 c_5; - c_5.xyz = (tmpvar_2.xyz * light_1.xyz); - c_5.w = tmpvar_2.w; - gl_FragData[0] = c_5; + light_1 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); + light_1.xyz = (light_1.xyz + unity_Ambient.xyz); + vec4 c_4; + c_4.xyz = (c_2.xyz * light_1.xyz); + c_4.w = c_2.w; + gl_FragData[0] = c_4; } -// inputs: 1, stats: 7 alu 3 tex 1 flow +// stats: 7 alu 3 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [2] loc 4 +// uniforms: 3 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _Cutoff (high float) 1x1 [-1] +// #2: unity_Ambient (high float) 4x1 [-1] +// textures: 2 +// #0: _LightBuffer (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-ir.txt deleted file mode 100644 index 83eeb8455..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-ir.txt +++ /dev/null @@ -1,292 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 hip_screen; - vec3 hip_lmapFade; -}; -uniform vec4 _Color; -uniform float _Cutoff; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform sampler2D unity_Lightmap; -uniform sampler2D unity_LightmapInd; -varying vec4 xlv_FOG; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -float xll_saturate ( - in float x_2 -) -{ - float tmpvar_3; - tmpvar_3 = clamp (x_2, 0.0, 1.0); - return tmpvar_3; -} - -vec2 xll_saturate ( - in vec2 x_4 -) -{ - vec2 tmpvar_5; - tmpvar_5 = clamp (x_4, 0.0, 1.0); - return tmpvar_5; -} - -vec3 xll_saturate ( - in vec3 x_6 -) -{ - vec3 tmpvar_7; - tmpvar_7 = clamp (x_6, 0.0, 1.0); - return tmpvar_7; -} - -vec4 xll_saturate ( - in vec4 x_8 -) -{ - vec4 tmpvar_9; - tmpvar_9 = clamp (x_8, 0.0, 1.0); - return tmpvar_9; -} - -mat2 xll_saturate ( - in mat2 m_10 -) -{ - vec2 tmpvar_11; - tmpvar_11 = clamp (m_10[0], 0.0, 1.0); - vec2 tmpvar_12; - tmpvar_12 = clamp (m_10[1], 0.0, 1.0); - mat2 tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_13[0] = tmpvar_14; - vec2 tmpvar_15; - tmpvar_15 = tmpvar_12; - tmpvar_13[1] = tmpvar_15; - return tmpvar_13; -} - -mat3 xll_saturate ( - in mat3 m_16 -) -{ - vec3 tmpvar_17; - tmpvar_17 = clamp (m_16[0], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_16[1], 0.0, 1.0); - vec3 tmpvar_19; - tmpvar_19 = clamp (m_16[2], 0.0, 1.0); - mat3 tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_20[0] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_20[1] = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = tmpvar_19; - tmpvar_20[2] = tmpvar_23; - return tmpvar_20; -} - -mat4 xll_saturate ( - in mat4 m_24 -) -{ - vec4 tmpvar_25; - tmpvar_25 = clamp (m_24[0], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_24[1], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_24[2], 0.0, 1.0); - vec4 tmpvar_28; - tmpvar_28 = clamp (m_24[3], 0.0, 1.0); - mat4 tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_29[0] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_29[1] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_29[2] = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_28; - tmpvar_29[3] = tmpvar_33; - return tmpvar_29; -} - -void surf ( - in Input IN_34, - inout SurfaceOutput o_35 -) -{ - vec4 c_36; - vec4 tmpvar_37; - tmpvar_37 = texture2D (_MainTex, IN_34.uv_MainTex); - vec4 tmpvar_38; - tmpvar_38 = (tmpvar_37 * _Color); - c_36 = tmpvar_38; - vec3 tmpvar_39; - tmpvar_39 = c_36.xyz; - o_35.Albedo = tmpvar_39; - float tmpvar_40; - tmpvar_40 = c_36.w; - o_35.Alpha = tmpvar_40; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_41, - in vec4 light_42 -) -{ - vec4 c_43; - vec3 tmpvar_44; - tmpvar_44 = (s_41.Albedo * light_42.xyz); - c_43.xyz = tmpvar_44.xyz.xyz; - float tmpvar_45; - tmpvar_45 = s_41.Alpha; - c_43.w = vec4(tmpvar_45).w; - return c_43; -} - -vec3 DecodeLightmap ( - in vec4 color_46 -) -{ - return (2.0 * color_46.xyz); -} - -vec4 frag_surf ( - in v2f_surf IN_47 -) -{ - vec4 col_48; - vec3 lm_49; - vec3 lmIndirect_50; - vec3 lmFull_51; - vec4 light_52; - SurfaceOutput o_53; - Input surfIN_54; - vec2 tmpvar_55; - tmpvar_55 = IN_47.hip_pack0.xy; - surfIN_54.uv_MainTex = tmpvar_55; - vec3 tmpvar_56; - tmpvar_56 = vec3(0.0, 0.0, 0.0); - o_53.Albedo = tmpvar_56; - vec3 tmpvar_57; - tmpvar_57 = vec3(0.0, 0.0, 0.0); - o_53.Emission = tmpvar_57; - float tmpvar_58; - tmpvar_58 = 0.0; - o_53.Specular = tmpvar_58; - float tmpvar_59; - tmpvar_59 = 0.0; - o_53.Alpha = tmpvar_59; - float tmpvar_60; - tmpvar_60 = 0.0; - o_53.Gloss = tmpvar_60; - surf (surfIN_54, o_53); - xll_clip ((o_53.Alpha - _Cutoff)); - vec4 tmpvar_61; - tmpvar_61 = texture2DProj (_LightBuffer, IN_47.hip_screen); - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - light_52 = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63 = log2 (light_52); - vec4 tmpvar_64; - tmpvar_64 = -(tmpvar_63); - light_52 = tmpvar_64; - vec4 tmpvar_65; - tmpvar_65 = texture2D (unity_Lightmap, IN_47.hip_lmapFade.xy); - vec3 tmpvar_66; - tmpvar_66 = DecodeLightmap (tmpvar_65); - vec3 tmpvar_67; - tmpvar_67 = tmpvar_66; - lmFull_51 = tmpvar_67; - vec4 tmpvar_68; - tmpvar_68 = texture2D (unity_LightmapInd, IN_47.hip_lmapFade.xy); - vec3 tmpvar_69; - tmpvar_69 = DecodeLightmap (tmpvar_68); - vec3 tmpvar_70; - tmpvar_70 = tmpvar_69; - lmIndirect_50 = tmpvar_70; - float tmpvar_71; - tmpvar_71 = xll_saturate (IN_47.hip_lmapFade.z); - vec3 tmpvar_72; - tmpvar_72 = vec3(tmpvar_71); - vec3 tmpvar_73; - tmpvar_73 = mix (lmIndirect_50, lmFull_51, tmpvar_72); - vec3 tmpvar_74; - tmpvar_74 = tmpvar_73; - lm_49 = tmpvar_74; - vec3 tmpvar_75; - tmpvar_75 = (light_52.xyz + lm_49); - light_52.xyz = tmpvar_75.xyz.xyz; - vec4 tmpvar_76; - tmpvar_76 = LightingLambert_PrePass (o_53, light_52); - vec4 tmpvar_77; - tmpvar_77 = tmpvar_76; - col_48 = tmpvar_77; - return col_48; -} - -void main () -{ - v2f_surf xlt_IN_78; - vec4 xl_retval_79; - vec4 tmpvar_80; - tmpvar_80 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_78.pos = tmpvar_80; - float tmpvar_81; - tmpvar_81 = xlv_FOG.x; - xlt_IN_78.fog = tmpvar_81; - vec2 tmpvar_82; - tmpvar_82 = gl_TexCoord[0].xy; - vec2 tmpvar_83; - tmpvar_83 = tmpvar_82; - xlt_IN_78.hip_pack0 = tmpvar_83; - vec4 tmpvar_84; - tmpvar_84 = gl_TexCoord[1].xyzw; - vec4 tmpvar_85; - tmpvar_85 = tmpvar_84; - xlt_IN_78.hip_screen = tmpvar_85; - vec3 tmpvar_86; - tmpvar_86 = gl_TexCoord[2].xyz; - vec3 tmpvar_87; - tmpvar_87 = tmpvar_86; - xlt_IN_78.hip_lmapFade = tmpvar_87; - vec4 tmpvar_88; - tmpvar_88 = frag_surf (xlt_IN_78); - vec4 tmpvar_89; - tmpvar_89 = tmpvar_88; - xl_retval_79 = tmpvar_89; - vec4 tmpvar_90; - tmpvar_90 = xl_retval_79.xyzw; - vec4 tmpvar_91; - tmpvar_91 = tmpvar_90; - gl_FragData[0] = tmpvar_91; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-out.txt index adcaf05df..4b8f8bf7c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-out.txt @@ -9,22 +9,30 @@ void main () vec3 tmpvar_1; tmpvar_1 = gl_TexCoord[2].xyz; vec4 light_2; - vec4 tmpvar_3; - tmpvar_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); + vec4 c_3; + c_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); float x_4; - x_4 = (tmpvar_3.w - _Cutoff); + x_4 = (c_3.w - _Cutoff); if ((x_4 < 0.0)) { discard; }; - vec4 tmpvar_5; - tmpvar_5 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); - light_2.w = tmpvar_5.w; - light_2.xyz = (tmpvar_5.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_1.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_1.xy).xyz), vec3(clamp (tmpvar_1.z, 0.0, 1.0)))); - vec4 c_6; - c_6.xyz = (tmpvar_3.xyz * light_2.xyz); - c_6.w = tmpvar_3.w; - gl_FragData[0] = c_6; + light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); + light_2.xyz = (light_2.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_1.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_1.xy).xyz), vec3(clamp (tmpvar_1.z, 0.0, 1.0)))); + vec4 c_5; + c_5.xyz = (c_3.xyz * light_2.xyz); + c_5.w = c_3.w; + gl_FragData[0] = c_5; } -// inputs: 1, stats: 11 alu 5 tex 1 flow +// stats: 11 alu 5 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _Cutoff (high float) 1x1 [-1] +// textures: 4 +// #0: _LightBuffer (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] +// #2: unity_Lightmap (high 2d) 0x0 [-1] +// #3: unity_LightmapInd (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-ir.txt deleted file mode 100644 index 07f99befb..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-ir.txt +++ /dev/null @@ -1,137 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - vec3 vec; - vec2 hip_pack0; -}; -uniform vec4 _Color; -uniform float _Cutoff; -uniform vec4 _LightPositionRange; -uniform sampler2D _MainTex; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -void surf ( - in Input IN_2, - inout SurfaceOutput o_3 -) -{ - vec4 c_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, IN_2.uv_MainTex); - vec4 tmpvar_6; - tmpvar_6 = (tmpvar_5 * _Color); - c_4 = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = c_4.xyz; - o_3.Albedo = tmpvar_7; - float tmpvar_8; - tmpvar_8 = c_4.w; - o_3.Alpha = tmpvar_8; -} - -vec4 EncodeFloatRGBA ( - in float v_9 -) -{ - vec4 enc_10; - float kEncodeBit_11; - vec4 kEncodeMul_12; - vec4 tmpvar_13; - tmpvar_13 = vec4(1.0, 255.0, 65025.0, 1.60581e+08); - kEncodeMul_12 = tmpvar_13; - float tmpvar_14; - tmpvar_14 = 0.00392157; - kEncodeBit_11 = tmpvar_14; - vec4 tmpvar_15; - tmpvar_15 = (kEncodeMul_12 * v_9); - enc_10 = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = fract (enc_10); - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - enc_10 = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = (enc_10 - (enc_10.yzww * kEncodeBit_11)); - enc_10 = tmpvar_18; - return enc_10; -} - -vec4 frag_surf ( - in v2f_surf IN_19 -) -{ - SurfaceOutput o_20; - Input surfIN_21; - vec2 tmpvar_22; - tmpvar_22 = IN_19.hip_pack0.xy; - surfIN_21.uv_MainTex = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = vec3(0.0, 0.0, 0.0); - o_20.Albedo = tmpvar_23; - vec3 tmpvar_24; - tmpvar_24 = vec3(0.0, 0.0, 0.0); - o_20.Emission = tmpvar_24; - float tmpvar_25; - tmpvar_25 = 0.0; - o_20.Specular = tmpvar_25; - float tmpvar_26; - tmpvar_26 = 0.0; - o_20.Alpha = tmpvar_26; - float tmpvar_27; - tmpvar_27 = 0.0; - o_20.Gloss = tmpvar_27; - surf (surfIN_21, o_20); - xll_clip ((o_20.Alpha - _Cutoff)); - float tmpvar_28; - tmpvar_28 = length (IN_19.vec); - vec4 tmpvar_29; - tmpvar_29 = EncodeFloatRGBA ((tmpvar_28 * _LightPositionRange.w)); - return tmpvar_29; -} - -void main () -{ - v2f_surf xlt_IN_30; - vec4 xl_retval_31; - vec4 tmpvar_32; - tmpvar_32 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_30.pos = tmpvar_32; - vec3 tmpvar_33; - tmpvar_33 = gl_TexCoord[0].xyz; - vec3 tmpvar_34; - tmpvar_34 = tmpvar_33; - xlt_IN_30.vec = tmpvar_34; - vec2 tmpvar_35; - tmpvar_35 = gl_TexCoord[1].xy; - vec2 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlt_IN_30.hip_pack0 = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37 = frag_surf (xlt_IN_30); - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - xl_retval_31 = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = xl_retval_31.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - gl_FragData[0] = tmpvar_40; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-out.txt index c06591080..948eb839b 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-out.txt @@ -11,12 +11,23 @@ void main () if ((x_2 < 0.0)) { discard; }; - vec4 tmpvar_3; - tmpvar_3 = fract((vec4(1.0, 255.0, 65025.0, 1.60581e+08) * ( - sqrt(dot (tmpvar_1, tmpvar_1)) - * _LightPositionRange.w))); - gl_FragData[0] = (tmpvar_3 - (tmpvar_3.yzww * 0.00392157)); + vec4 enc_3; + enc_3 = (vec4(1.0, 255.0, 65025.0, 1.60581e+08) * (sqrt( + dot (tmpvar_1, tmpvar_1) + ) * _LightPositionRange.w)); + vec4 tmpvar_4; + tmpvar_4 = fract(enc_3); + enc_3 = (tmpvar_4 - (tmpvar_4.yzww * 0.00392157)); + gl_FragData[0] = enc_3; } -// inputs: 1, stats: 10 alu 2 tex 1 flow +// stats: 10 alu 2 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [2] loc 4 +// uniforms: 3 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _Cutoff (high float) 1x1 [-1] +// #2: _LightPositionRange (high float) 4x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-ir.txt deleted file mode 100644 index 148c61d6f..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-ir.txt +++ /dev/null @@ -1,60 +0,0 @@ -struct v2f { - vec4 vertex; - vec4 color; - vec2 texcoord; -}; -uniform vec4 _Color; -uniform float _Cutoff; -uniform sampler2D _MainTex; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -vec4 frag ( - in v2f i_2 -) -{ - vec4 col_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, i_2.texcoord); - vec4 tmpvar_5; - tmpvar_5 = (_Color * tmpvar_4); - col_3 = tmpvar_5; - xll_clip ((col_3.w - _Cutoff)); - return col_3; -} - -void main () -{ - v2f xlt_i_6; - vec4 xl_retval_7; - vec4 tmpvar_8; - tmpvar_8 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_6.vertex = tmpvar_8; - vec4 tmpvar_9; - tmpvar_9 = gl_Color.xyzw; - vec4 tmpvar_10; - tmpvar_10 = tmpvar_9; - xlt_i_6.color = tmpvar_10; - vec2 tmpvar_11; - tmpvar_11 = gl_TexCoord[0].xy; - vec2 tmpvar_12; - tmpvar_12 = tmpvar_11; - xlt_i_6.texcoord = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13 = frag (xlt_i_6); - vec4 tmpvar_14; - tmpvar_14 = tmpvar_13; - xl_retval_7 = tmpvar_14; - vec4 tmpvar_15; - tmpvar_15 = xl_retval_7.xyzw; - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - gl_FragData[0] = tmpvar_16; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-out.txt index 63b179661..f9926efe6 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-out.txt @@ -3,15 +3,22 @@ uniform float _Cutoff; uniform sampler2D _MainTex; void main () { - vec4 tmpvar_1; - tmpvar_1 = (_Color * texture2D (_MainTex, gl_TexCoord[0].xy)); + vec4 col_1; + col_1 = (_Color * texture2D (_MainTex, gl_TexCoord[0].xy)); float x_2; - x_2 = (tmpvar_1.w - _Cutoff); + x_2 = (col_1.w - _Cutoff); if ((x_2 < 0.0)) { discard; }; - gl_FragData[0] = tmpvar_1; + gl_FragData[0] = col_1; } -// inputs: 1, stats: 3 alu 2 tex 1 flow +// stats: 3 alu 2 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _Cutoff (high float) 1x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-ir.txt deleted file mode 100644 index b6997bedb..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-ir.txt +++ /dev/null @@ -1,246 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; - vec3 viewDir; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec3 lightDir; - vec3 vlight; - vec4 _ShadowCoord; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform vec4 _LightColor0; -uniform sampler2D _MainTex; -uniform float _Parallax; -uniform sampler2D _ParallaxMap; -uniform sampler2D _ShadowMapTexture; -varying vec4 xlv_FOG; -float unitySampleShadow ( - in vec4 shadowCoord_1 -) -{ - float shadow_2; - vec4 tmpvar_3; - tmpvar_3 = texture2DProj (_ShadowMapTexture, shadowCoord_1); - float tmpvar_4; - tmpvar_4 = tmpvar_3.x; - shadow_2 = tmpvar_4; - return shadow_2; -} - -vec4 UnpackNormal ( - in vec4 packednormal_5 -) -{ - vec4 normal_6; - vec2 tmpvar_7; - tmpvar_7 = ((packednormal_5.wy * 2.0) - 1.0); - normal_6.xy = tmpvar_7.xy.xy; - float tmpvar_8; - tmpvar_8 = sqrt (((1.0 - (normal_6.x * normal_6.x)) - (normal_6.y * normal_6.y))); - float tmpvar_9; - tmpvar_9 = tmpvar_8; - normal_6.z = vec3(tmpvar_9).z; - return normal_6; -} - -vec2 ParallaxOffset ( - in float h_10, - in float height_11, - in vec3 viewDir_12 -) -{ - vec3 v_13; - float tmpvar_14; - tmpvar_14 = ((h_10 * height_11) - (height_11 / 2.0)); - h_10 = tmpvar_14; - vec3 tmpvar_15; - tmpvar_15 = normalize (viewDir_12); - vec3 tmpvar_16; - tmpvar_16 = tmpvar_15; - v_13 = tmpvar_16; - float tmpvar_17; - tmpvar_17 = (v_13.z + 0.42); - v_13.z = vec3(tmpvar_17).z; - return (h_10 * (v_13.xy / v_13.z)); -} - -void surf ( - in Input IN_18, - inout SurfaceOutput o_19 -) -{ - vec4 c_20; - vec2 offset_21; - float h_22; - vec4 tmpvar_23; - tmpvar_23 = texture2D (_ParallaxMap, IN_18.uv_BumpMap); - float tmpvar_24; - tmpvar_24 = tmpvar_23.w; - h_22 = tmpvar_24; - vec2 tmpvar_25; - tmpvar_25 = ParallaxOffset (h_22, _Parallax, IN_18.viewDir); - vec2 tmpvar_26; - tmpvar_26 = tmpvar_25; - offset_21 = tmpvar_26; - vec2 tmpvar_27; - tmpvar_27 = (IN_18.uv_MainTex + offset_21); - IN_18.uv_MainTex = tmpvar_27; - vec2 tmpvar_28; - tmpvar_28 = (IN_18.uv_BumpMap + offset_21); - IN_18.uv_BumpMap = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = texture2D (_MainTex, IN_18.uv_MainTex); - vec4 tmpvar_30; - tmpvar_30 = (tmpvar_29 * _Color); - c_20 = tmpvar_30; - vec3 tmpvar_31; - tmpvar_31 = c_20.xyz; - o_19.Albedo = tmpvar_31; - float tmpvar_32; - tmpvar_32 = c_20.w; - o_19.Alpha = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = texture2D (_BumpMap, IN_18.uv_BumpMap); - vec4 tmpvar_34; - tmpvar_34 = UnpackNormal (tmpvar_33); - vec3 tmpvar_35; - tmpvar_35 = tmpvar_34.xyz; - vec3 tmpvar_36; - tmpvar_36 = tmpvar_35; - o_19.Normal = tmpvar_36; -} - -vec4 LightingLambert ( - in SurfaceOutput s_37, - in vec3 lightDir_38, - in float atten_39 -) -{ - vec4 c_40; - float diff_41; - float tmpvar_42; - tmpvar_42 = dot (s_37.Normal, lightDir_38); - float tmpvar_43; - tmpvar_43 = max (0.0, tmpvar_42); - float tmpvar_44; - tmpvar_44 = tmpvar_43; - diff_41 = tmpvar_44; - vec3 tmpvar_45; - tmpvar_45 = ((s_37.Albedo * _LightColor0.xyz) * ((diff_41 * atten_39) * 2.0)); - c_40.xyz = tmpvar_45.xyz.xyz; - float tmpvar_46; - tmpvar_46 = s_37.Alpha; - c_40.w = vec4(tmpvar_46).w; - return c_40; -} - -vec4 frag_surf ( - in v2f_surf IN_47 -) -{ - vec4 c_48; - float atten_49; - SurfaceOutput o_50; - Input surfIN_51; - vec2 tmpvar_52; - tmpvar_52 = IN_47.hip_pack0.xy; - surfIN_51.uv_MainTex = tmpvar_52; - vec2 tmpvar_53; - tmpvar_53 = IN_47.hip_pack0.zw; - surfIN_51.uv_BumpMap = tmpvar_53; - vec3 tmpvar_54; - tmpvar_54 = IN_47.viewDir; - surfIN_51.viewDir = tmpvar_54; - vec3 tmpvar_55; - tmpvar_55 = vec3(0.0, 0.0, 0.0); - o_50.Albedo = tmpvar_55; - vec3 tmpvar_56; - tmpvar_56 = vec3(0.0, 0.0, 0.0); - o_50.Emission = tmpvar_56; - float tmpvar_57; - tmpvar_57 = 0.0; - o_50.Specular = tmpvar_57; - float tmpvar_58; - tmpvar_58 = 0.0; - o_50.Alpha = tmpvar_58; - float tmpvar_59; - tmpvar_59 = 0.0; - o_50.Gloss = tmpvar_59; - surf (surfIN_51, o_50); - float tmpvar_60; - tmpvar_60 = unitySampleShadow (IN_47._ShadowCoord); - float tmpvar_61; - tmpvar_61 = tmpvar_60; - atten_49 = tmpvar_61; - vec4 tmpvar_62; - tmpvar_62 = LightingLambert (o_50, IN_47.lightDir, atten_49); - vec4 tmpvar_63; - tmpvar_63 = tmpvar_62; - c_48 = tmpvar_63; - vec3 tmpvar_64; - tmpvar_64 = (c_48.xyz + (o_50.Albedo * IN_47.vlight)); - c_48.xyz = tmpvar_64.xyz.xyz; - return c_48; -} - -void main () -{ - v2f_surf xlt_IN_65; - vec4 xl_retval_66; - vec4 tmpvar_67; - tmpvar_67 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_65.pos = tmpvar_67; - float tmpvar_68; - tmpvar_68 = xlv_FOG.x; - xlt_IN_65.fog = tmpvar_68; - vec4 tmpvar_69; - tmpvar_69 = gl_TexCoord[0].xyzw; - vec4 tmpvar_70; - tmpvar_70 = tmpvar_69; - xlt_IN_65.hip_pack0 = tmpvar_70; - vec3 tmpvar_71; - tmpvar_71 = gl_TexCoord[1].xyz; - vec3 tmpvar_72; - tmpvar_72 = tmpvar_71; - xlt_IN_65.viewDir = tmpvar_72; - vec3 tmpvar_73; - tmpvar_73 = gl_TexCoord[2].xyz; - vec3 tmpvar_74; - tmpvar_74 = tmpvar_73; - xlt_IN_65.lightDir = tmpvar_74; - vec3 tmpvar_75; - tmpvar_75 = gl_TexCoord[3].xyz; - vec3 tmpvar_76; - tmpvar_76 = tmpvar_75; - xlt_IN_65.vlight = tmpvar_76; - vec4 tmpvar_77; - tmpvar_77 = gl_TexCoord[4].xyzw; - vec4 tmpvar_78; - tmpvar_78 = tmpvar_77; - xlt_IN_65._ShadowCoord = tmpvar_78; - vec4 tmpvar_79; - tmpvar_79 = frag_surf (xlt_IN_65); - vec4 tmpvar_80; - tmpvar_80 = tmpvar_79; - xl_retval_66 = tmpvar_80; - vec4 tmpvar_81; - tmpvar_81 = xl_retval_66.xyzw; - vec4 tmpvar_82; - tmpvar_82 = tmpvar_81; - gl_FragData[0] = tmpvar_82; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-out.txt index 8b605758c..c9689ca9e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-out.txt @@ -10,29 +10,40 @@ void main () vec4 tmpvar_1; tmpvar_1 = gl_TexCoord[0]; vec4 c_2; - vec2 tmpvar_3; - vec3 v_4; - vec3 tmpvar_5; - tmpvar_5 = normalize(gl_TexCoord[1].xyz); - v_4.xy = tmpvar_5.xy; - v_4.z = (tmpvar_5.z + 0.42); - tmpvar_3 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_5.xy / v_4.z)); - vec4 tmpvar_6; - tmpvar_6 = (texture2D (_MainTex, (tmpvar_1.xy + tmpvar_3)) * _Color); + vec4 c_3; + vec2 tmpvar_4; + vec3 v_5; + vec3 tmpvar_6; + tmpvar_6 = normalize(gl_TexCoord[1].xyz); + v_5.xy = tmpvar_6.xy; + v_5.z = (tmpvar_6.z + 0.42); + tmpvar_4 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_6.xy / v_5.z)); + c_3 = (texture2D (_MainTex, (tmpvar_1.xy + tmpvar_4)) * _Color); vec4 normal_7; - normal_7.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_3)).wy * 2.0) - 1.0); + normal_7.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_4)).wy * 2.0) - 1.0); normal_7.z = sqrt(((1.0 - (normal_7.x * normal_7.x) ) - (normal_7.y * normal_7.y))); vec4 c_8; - c_8.xyz = ((tmpvar_6.xyz * _LightColor0.xyz) * (( + c_8.xyz = ((c_3.xyz * _LightColor0.xyz) * (( max (0.0, dot (normal_7.xyz, gl_TexCoord[2].xyz)) * texture2DProj (_ShadowMapTexture, gl_TexCoord[4]).x) * 2.0)); - c_8.w = tmpvar_6.w; + c_8.w = c_3.w; c_2.w = c_8.w; - c_2.xyz = (c_8.xyz + (tmpvar_6.xyz * gl_TexCoord[3].xyz)); + c_2.xyz = (c_8.xyz + (c_3.xyz * gl_TexCoord[3].xyz)); gl_FragData[0] = c_2; } -// inputs: 1, stats: 25 alu 4 tex 0 flow +// stats: 25 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [5] loc 4 +// uniforms: 3 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _Parallax (high float) 1x1 [-1] +// textures: 4 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] +// #2: _ParallaxMap (high 2d) 0x0 [-1] +// #3: _ShadowMapTexture (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-ir.txt deleted file mode 100644 index a0411dad4..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-ir.txt +++ /dev/null @@ -1,217 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; - vec3 viewDir; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec4 hip_screen; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform float _Parallax; -uniform sampler2D _ParallaxMap; -uniform vec4 unity_Ambient; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -vec2 ParallaxOffset ( - in float h_6, - in float height_7, - in vec3 viewDir_8 -) -{ - vec3 v_9; - float tmpvar_10; - tmpvar_10 = ((h_6 * height_7) - (height_7 / 2.0)); - h_6 = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = normalize (viewDir_8); - vec3 tmpvar_12; - tmpvar_12 = tmpvar_11; - v_9 = tmpvar_12; - float tmpvar_13; - tmpvar_13 = (v_9.z + 0.42); - v_9.z = vec3(tmpvar_13).z; - return (h_6 * (v_9.xy / v_9.z)); -} - -void surf ( - in Input IN_14, - inout SurfaceOutput o_15 -) -{ - vec4 c_16; - vec2 offset_17; - float h_18; - vec4 tmpvar_19; - tmpvar_19 = texture2D (_ParallaxMap, IN_14.uv_BumpMap); - float tmpvar_20; - tmpvar_20 = tmpvar_19.w; - h_18 = tmpvar_20; - vec2 tmpvar_21; - tmpvar_21 = ParallaxOffset (h_18, _Parallax, IN_14.viewDir); - vec2 tmpvar_22; - tmpvar_22 = tmpvar_21; - offset_17 = tmpvar_22; - vec2 tmpvar_23; - tmpvar_23 = (IN_14.uv_MainTex + offset_17); - IN_14.uv_MainTex = tmpvar_23; - vec2 tmpvar_24; - tmpvar_24 = (IN_14.uv_BumpMap + offset_17); - IN_14.uv_BumpMap = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25 = texture2D (_MainTex, IN_14.uv_MainTex); - vec4 tmpvar_26; - tmpvar_26 = (tmpvar_25 * _Color); - c_16 = tmpvar_26; - vec3 tmpvar_27; - tmpvar_27 = c_16.xyz; - o_15.Albedo = tmpvar_27; - float tmpvar_28; - tmpvar_28 = c_16.w; - o_15.Alpha = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = texture2D (_BumpMap, IN_14.uv_BumpMap); - vec4 tmpvar_30; - tmpvar_30 = UnpackNormal (tmpvar_29); - vec3 tmpvar_31; - tmpvar_31 = tmpvar_30.xyz; - vec3 tmpvar_32; - tmpvar_32 = tmpvar_31; - o_15.Normal = tmpvar_32; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_33, - in vec4 light_34 -) -{ - vec4 c_35; - vec3 tmpvar_36; - tmpvar_36 = (s_33.Albedo * light_34.xyz); - c_35.xyz = tmpvar_36.xyz.xyz; - float tmpvar_37; - tmpvar_37 = s_33.Alpha; - c_35.w = vec4(tmpvar_37).w; - return c_35; -} - -vec4 frag_surf ( - in v2f_surf IN_38 -) -{ - vec4 col_39; - vec4 light_40; - SurfaceOutput o_41; - Input surfIN_42; - vec2 tmpvar_43; - tmpvar_43 = IN_38.hip_pack0.xy; - surfIN_42.uv_MainTex = tmpvar_43; - vec2 tmpvar_44; - tmpvar_44 = IN_38.hip_pack0.zw; - surfIN_42.uv_BumpMap = tmpvar_44; - vec3 tmpvar_45; - tmpvar_45 = IN_38.viewDir; - surfIN_42.viewDir = tmpvar_45; - vec3 tmpvar_46; - tmpvar_46 = vec3(0.0, 0.0, 0.0); - o_41.Albedo = tmpvar_46; - vec3 tmpvar_47; - tmpvar_47 = vec3(0.0, 0.0, 0.0); - o_41.Emission = tmpvar_47; - float tmpvar_48; - tmpvar_48 = 0.0; - o_41.Specular = tmpvar_48; - float tmpvar_49; - tmpvar_49 = 0.0; - o_41.Alpha = tmpvar_49; - float tmpvar_50; - tmpvar_50 = 0.0; - o_41.Gloss = tmpvar_50; - surf (surfIN_42, o_41); - vec4 tmpvar_51; - tmpvar_51 = texture2DProj (_LightBuffer, IN_38.hip_screen); - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - light_40 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = log2 (light_40); - vec4 tmpvar_54; - tmpvar_54 = -(tmpvar_53); - light_40 = tmpvar_54; - vec3 tmpvar_55; - tmpvar_55 = (light_40.xyz + unity_Ambient.xyz); - light_40.xyz = tmpvar_55.xyz.xyz; - vec4 tmpvar_56; - tmpvar_56 = LightingLambert_PrePass (o_41, light_40); - vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - col_39 = tmpvar_57; - return col_39; -} - -void main () -{ - v2f_surf xlt_IN_58; - vec4 xl_retval_59; - vec4 tmpvar_60; - tmpvar_60 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_58.pos = tmpvar_60; - float tmpvar_61; - tmpvar_61 = xlv_FOG.x; - xlt_IN_58.fog = tmpvar_61; - vec4 tmpvar_62; - tmpvar_62 = gl_TexCoord[0].xyzw; - vec4 tmpvar_63; - tmpvar_63 = tmpvar_62; - xlt_IN_58.hip_pack0 = tmpvar_63; - vec3 tmpvar_64; - tmpvar_64 = gl_TexCoord[1].xyz; - vec3 tmpvar_65; - tmpvar_65 = tmpvar_64; - xlt_IN_58.viewDir = tmpvar_65; - vec4 tmpvar_66; - tmpvar_66 = gl_TexCoord[2].xyzw; - vec4 tmpvar_67; - tmpvar_67 = tmpvar_66; - xlt_IN_58.hip_screen = tmpvar_67; - vec4 tmpvar_68; - tmpvar_68 = frag_surf (xlt_IN_58); - vec4 tmpvar_69; - tmpvar_69 = tmpvar_68; - xl_retval_59 = tmpvar_69; - vec4 tmpvar_70; - tmpvar_70 = xl_retval_59.xyzw; - vec4 tmpvar_71; - tmpvar_71 = tmpvar_70; - gl_FragData[0] = tmpvar_71; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-out.txt index 52d16e489..471b4cc0c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-out.txt @@ -1,4 +1,3 @@ -uniform sampler2D _BumpMap; uniform vec4 _Color; uniform sampler2D _LightBuffer; uniform sampler2D _MainTex; @@ -10,29 +9,34 @@ void main () vec4 tmpvar_1; tmpvar_1 = gl_TexCoord[0]; vec4 light_2; - vec2 tmpvar_3; + vec4 c_3; vec3 v_4; vec3 tmpvar_5; tmpvar_5 = normalize(gl_TexCoord[1].xyz); v_4.xy = tmpvar_5.xy; v_4.z = (tmpvar_5.z + 0.42); - tmpvar_3 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_5.xy / v_4.z)); - vec4 tmpvar_6; - tmpvar_6 = (texture2D (_MainTex, (tmpvar_1.xy + tmpvar_3)) * _Color); - vec4 normal_7; - normal_7.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_3)).wy * 2.0) - 1.0); - normal_7.z = sqrt(((1.0 - - (normal_7.x * normal_7.x) - ) - (normal_7.y * normal_7.y))); - vec4 tmpvar_8; - tmpvar_8 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2]))); - light_2.w = tmpvar_8.w; - light_2.xyz = (tmpvar_8.xyz + unity_Ambient.xyz); - vec4 c_9; - c_9.xyz = (tmpvar_6.xyz * light_2.xyz); - c_9.w = tmpvar_6.w; - gl_FragData[0] = c_9; + c_3 = (texture2D (_MainTex, (tmpvar_1.xy + ( + ((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) + * + (tmpvar_5.xy / v_4.z) + ))) * _Color); + light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2]))); + light_2.xyz = (light_2.xyz + unity_Ambient.xyz); + vec4 c_6; + c_6.xyz = (c_3.xyz * light_2.xyz); + c_6.w = c_3.w; + gl_FragData[0] = c_6; } -// inputs: 1, stats: 21 alu 4 tex 0 flow +// stats: 13 alu 3 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 3 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _Parallax (high float) 1x1 [-1] +// #2: unity_Ambient (high float) 4x1 [-1] +// textures: 3 +// #0: _LightBuffer (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] +// #2: _ParallaxMap (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-ir.txt deleted file mode 100644 index bfbf7d801..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-ir.txt +++ /dev/null @@ -1,362 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; - vec3 viewDir; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec4 hip_screen; - vec3 hip_lmapFade; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform float _Parallax; -uniform sampler2D _ParallaxMap; -uniform sampler2D unity_Lightmap; -uniform sampler2D unity_LightmapInd; -varying vec4 xlv_FOG; -float xll_saturate ( - in float x_1 -) -{ - float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -vec2 xll_saturate ( - in vec2 x_3 -) -{ - vec2 tmpvar_4; - tmpvar_4 = clamp (x_3, 0.0, 1.0); - return tmpvar_4; -} - -vec3 xll_saturate ( - in vec3 x_5 -) -{ - vec3 tmpvar_6; - tmpvar_6 = clamp (x_5, 0.0, 1.0); - return tmpvar_6; -} - -vec4 xll_saturate ( - in vec4 x_7 -) -{ - vec4 tmpvar_8; - tmpvar_8 = clamp (x_7, 0.0, 1.0); - return tmpvar_8; -} - -mat2 xll_saturate ( - in mat2 m_9 -) -{ - vec2 tmpvar_10; - tmpvar_10 = clamp (m_9[0], 0.0, 1.0); - vec2 tmpvar_11; - tmpvar_11 = clamp (m_9[1], 0.0, 1.0); - mat2 tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_10; - tmpvar_12[0] = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_12[1] = tmpvar_14; - return tmpvar_12; -} - -mat3 xll_saturate ( - in mat3 m_15 -) -{ - vec3 tmpvar_16; - tmpvar_16 = clamp (m_15[0], 0.0, 1.0); - vec3 tmpvar_17; - tmpvar_17 = clamp (m_15[1], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_15[2], 0.0, 1.0); - mat3 tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_16; - tmpvar_19[0] = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_19[1] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_19[2] = tmpvar_22; - return tmpvar_19; -} - -mat4 xll_saturate ( - in mat4 m_23 -) -{ - vec4 tmpvar_24; - tmpvar_24 = clamp (m_23[0], 0.0, 1.0); - vec4 tmpvar_25; - tmpvar_25 = clamp (m_23[1], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_23[2], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_23[3], 0.0, 1.0); - mat4 tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_24; - tmpvar_28[0] = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_28[1] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_28[2] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_28[3] = tmpvar_32; - return tmpvar_28; -} - -vec4 UnpackNormal ( - in vec4 packednormal_33 -) -{ - vec4 normal_34; - vec2 tmpvar_35; - tmpvar_35 = ((packednormal_33.wy * 2.0) - 1.0); - normal_34.xy = tmpvar_35.xy.xy; - float tmpvar_36; - tmpvar_36 = sqrt (((1.0 - (normal_34.x * normal_34.x)) - (normal_34.y * normal_34.y))); - float tmpvar_37; - tmpvar_37 = tmpvar_36; - normal_34.z = vec3(tmpvar_37).z; - return normal_34; -} - -vec2 ParallaxOffset ( - in float h_38, - in float height_39, - in vec3 viewDir_40 -) -{ - vec3 v_41; - float tmpvar_42; - tmpvar_42 = ((h_38 * height_39) - (height_39 / 2.0)); - h_38 = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = normalize (viewDir_40); - vec3 tmpvar_44; - tmpvar_44 = tmpvar_43; - v_41 = tmpvar_44; - float tmpvar_45; - tmpvar_45 = (v_41.z + 0.42); - v_41.z = vec3(tmpvar_45).z; - return (h_38 * (v_41.xy / v_41.z)); -} - -void surf ( - in Input IN_46, - inout SurfaceOutput o_47 -) -{ - vec4 c_48; - vec2 offset_49; - float h_50; - vec4 tmpvar_51; - tmpvar_51 = texture2D (_ParallaxMap, IN_46.uv_BumpMap); - float tmpvar_52; - tmpvar_52 = tmpvar_51.w; - h_50 = tmpvar_52; - vec2 tmpvar_53; - tmpvar_53 = ParallaxOffset (h_50, _Parallax, IN_46.viewDir); - vec2 tmpvar_54; - tmpvar_54 = tmpvar_53; - offset_49 = tmpvar_54; - vec2 tmpvar_55; - tmpvar_55 = (IN_46.uv_MainTex + offset_49); - IN_46.uv_MainTex = tmpvar_55; - vec2 tmpvar_56; - tmpvar_56 = (IN_46.uv_BumpMap + offset_49); - IN_46.uv_BumpMap = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = texture2D (_MainTex, IN_46.uv_MainTex); - vec4 tmpvar_58; - tmpvar_58 = (tmpvar_57 * _Color); - c_48 = tmpvar_58; - vec3 tmpvar_59; - tmpvar_59 = c_48.xyz; - o_47.Albedo = tmpvar_59; - float tmpvar_60; - tmpvar_60 = c_48.w; - o_47.Alpha = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61 = texture2D (_BumpMap, IN_46.uv_BumpMap); - vec4 tmpvar_62; - tmpvar_62 = UnpackNormal (tmpvar_61); - vec3 tmpvar_63; - tmpvar_63 = tmpvar_62.xyz; - vec3 tmpvar_64; - tmpvar_64 = tmpvar_63; - o_47.Normal = tmpvar_64; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_65, - in vec4 light_66 -) -{ - vec4 c_67; - vec3 tmpvar_68; - tmpvar_68 = (s_65.Albedo * light_66.xyz); - c_67.xyz = tmpvar_68.xyz.xyz; - float tmpvar_69; - tmpvar_69 = s_65.Alpha; - c_67.w = vec4(tmpvar_69).w; - return c_67; -} - -vec3 DecodeLightmap ( - in vec4 color_70 -) -{ - return (2.0 * color_70.xyz); -} - -vec4 frag_surf ( - in v2f_surf IN_71 -) -{ - vec4 col_72; - vec3 lm_73; - vec3 lmIndirect_74; - vec3 lmFull_75; - vec4 light_76; - SurfaceOutput o_77; - Input surfIN_78; - vec2 tmpvar_79; - tmpvar_79 = IN_71.hip_pack0.xy; - surfIN_78.uv_MainTex = tmpvar_79; - vec2 tmpvar_80; - tmpvar_80 = IN_71.hip_pack0.zw; - surfIN_78.uv_BumpMap = tmpvar_80; - vec3 tmpvar_81; - tmpvar_81 = IN_71.viewDir; - surfIN_78.viewDir = tmpvar_81; - vec3 tmpvar_82; - tmpvar_82 = vec3(0.0, 0.0, 0.0); - o_77.Albedo = tmpvar_82; - vec3 tmpvar_83; - tmpvar_83 = vec3(0.0, 0.0, 0.0); - o_77.Emission = tmpvar_83; - float tmpvar_84; - tmpvar_84 = 0.0; - o_77.Specular = tmpvar_84; - float tmpvar_85; - tmpvar_85 = 0.0; - o_77.Alpha = tmpvar_85; - float tmpvar_86; - tmpvar_86 = 0.0; - o_77.Gloss = tmpvar_86; - surf (surfIN_78, o_77); - vec4 tmpvar_87; - tmpvar_87 = texture2DProj (_LightBuffer, IN_71.hip_screen); - vec4 tmpvar_88; - tmpvar_88 = tmpvar_87; - light_76 = tmpvar_88; - vec4 tmpvar_89; - tmpvar_89 = log2 (light_76); - vec4 tmpvar_90; - tmpvar_90 = -(tmpvar_89); - light_76 = tmpvar_90; - vec4 tmpvar_91; - tmpvar_91 = texture2D (unity_Lightmap, IN_71.hip_lmapFade.xy); - vec3 tmpvar_92; - tmpvar_92 = DecodeLightmap (tmpvar_91); - vec3 tmpvar_93; - tmpvar_93 = tmpvar_92; - lmFull_75 = tmpvar_93; - vec4 tmpvar_94; - tmpvar_94 = texture2D (unity_LightmapInd, IN_71.hip_lmapFade.xy); - vec3 tmpvar_95; - tmpvar_95 = DecodeLightmap (tmpvar_94); - vec3 tmpvar_96; - tmpvar_96 = tmpvar_95; - lmIndirect_74 = tmpvar_96; - float tmpvar_97; - tmpvar_97 = xll_saturate (IN_71.hip_lmapFade.z); - vec3 tmpvar_98; - tmpvar_98 = vec3(tmpvar_97); - vec3 tmpvar_99; - tmpvar_99 = mix (lmIndirect_74, lmFull_75, tmpvar_98); - vec3 tmpvar_100; - tmpvar_100 = tmpvar_99; - lm_73 = tmpvar_100; - vec3 tmpvar_101; - tmpvar_101 = (light_76.xyz + lm_73); - light_76.xyz = tmpvar_101.xyz.xyz; - vec4 tmpvar_102; - tmpvar_102 = LightingLambert_PrePass (o_77, light_76); - vec4 tmpvar_103; - tmpvar_103 = tmpvar_102; - col_72 = tmpvar_103; - return col_72; -} - -void main () -{ - v2f_surf xlt_IN_104; - vec4 xl_retval_105; - vec4 tmpvar_106; - tmpvar_106 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_104.pos = tmpvar_106; - float tmpvar_107; - tmpvar_107 = xlv_FOG.x; - xlt_IN_104.fog = tmpvar_107; - vec4 tmpvar_108; - tmpvar_108 = gl_TexCoord[0].xyzw; - vec4 tmpvar_109; - tmpvar_109 = tmpvar_108; - xlt_IN_104.hip_pack0 = tmpvar_109; - vec3 tmpvar_110; - tmpvar_110 = gl_TexCoord[1].xyz; - vec3 tmpvar_111; - tmpvar_111 = tmpvar_110; - xlt_IN_104.viewDir = tmpvar_111; - vec4 tmpvar_112; - tmpvar_112 = gl_TexCoord[2].xyzw; - vec4 tmpvar_113; - tmpvar_113 = tmpvar_112; - xlt_IN_104.hip_screen = tmpvar_113; - vec3 tmpvar_114; - tmpvar_114 = gl_TexCoord[3].xyz; - vec3 tmpvar_115; - tmpvar_115 = tmpvar_114; - xlt_IN_104.hip_lmapFade = tmpvar_115; - vec4 tmpvar_116; - tmpvar_116 = frag_surf (xlt_IN_104); - vec4 tmpvar_117; - tmpvar_117 = tmpvar_116; - xl_retval_105 = tmpvar_117; - vec4 tmpvar_118; - tmpvar_118 = xl_retval_105.xyzw; - vec4 tmpvar_119; - tmpvar_119 = tmpvar_118; - gl_FragData[0] = tmpvar_119; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-out.txt index 23d402cd9..47d3eabf2 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-out.txt @@ -1,4 +1,3 @@ -uniform sampler2D _BumpMap; uniform vec4 _Color; uniform sampler2D _LightBuffer; uniform sampler2D _MainTex; @@ -13,29 +12,35 @@ void main () vec3 tmpvar_2; tmpvar_2 = gl_TexCoord[3].xyz; vec4 light_3; - vec2 tmpvar_4; + vec4 c_4; vec3 v_5; vec3 tmpvar_6; tmpvar_6 = normalize(gl_TexCoord[1].xyz); v_5.xy = tmpvar_6.xy; v_5.z = (tmpvar_6.z + 0.42); - tmpvar_4 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_6.xy / v_5.z)); - vec4 tmpvar_7; - tmpvar_7 = (texture2D (_MainTex, (tmpvar_1.xy + tmpvar_4)) * _Color); - vec4 normal_8; - normal_8.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_4)).wy * 2.0) - 1.0); - normal_8.z = sqrt(((1.0 - - (normal_8.x * normal_8.x) - ) - (normal_8.y * normal_8.y))); - vec4 tmpvar_9; - tmpvar_9 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2]))); - light_3.w = tmpvar_9.w; - light_3.xyz = (tmpvar_9.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_2.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_2.xy).xyz), vec3(clamp (tmpvar_2.z, 0.0, 1.0)))); - vec4 c_10; - c_10.xyz = (tmpvar_7.xyz * light_3.xyz); - c_10.w = tmpvar_7.w; - gl_FragData[0] = c_10; + c_4 = (texture2D (_MainTex, (tmpvar_1.xy + ( + ((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) + * + (tmpvar_6.xy / v_5.z) + ))) * _Color); + light_3 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2]))); + light_3.xyz = (light_3.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_2.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_2.xy).xyz), vec3(clamp (tmpvar_2.z, 0.0, 1.0)))); + vec4 c_7; + c_7.xyz = (c_4.xyz * light_3.xyz); + c_7.w = c_4.w; + gl_FragData[0] = c_7; } -// inputs: 1, stats: 25 alu 6 tex 0 flow +// stats: 17 alu 5 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _Parallax (high float) 1x1 [-1] +// textures: 5 +// #0: _LightBuffer (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] +// #2: _ParallaxMap (high 2d) 0x0 [-1] +// #3: unity_Lightmap (high 2d) 0x0 [-1] +// #4: unity_LightmapInd (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-ir.txt deleted file mode 100644 index 4bedcd983..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-ir.txt +++ /dev/null @@ -1,300 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; - vec3 viewDir; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec3 lightDir; - vec4 _LightCoord; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -uniform float _Parallax; -uniform sampler2D _ParallaxMap; -uniform float _Shininess; -uniform vec4 _SpecColor; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -vec2 ParallaxOffset ( - in float h_6, - in float height_7, - in vec3 viewDir_8 -) -{ - vec3 v_9; - float tmpvar_10; - tmpvar_10 = ((h_6 * height_7) - (height_7 / 2.0)); - h_6 = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = normalize (viewDir_8); - vec3 tmpvar_12; - tmpvar_12 = tmpvar_11; - v_9 = tmpvar_12; - float tmpvar_13; - tmpvar_13 = (v_9.z + 0.42); - v_9.z = vec3(tmpvar_13).z; - return (h_6 * (v_9.xy / v_9.z)); -} - -void surf ( - in Input IN_14, - inout SurfaceOutput o_15 -) -{ - vec4 tex_16; - vec2 offset_17; - float h_18; - vec4 tmpvar_19; - tmpvar_19 = texture2D (_ParallaxMap, IN_14.uv_BumpMap); - float tmpvar_20; - tmpvar_20 = tmpvar_19.w; - h_18 = tmpvar_20; - vec2 tmpvar_21; - tmpvar_21 = ParallaxOffset (h_18, _Parallax, IN_14.viewDir); - vec2 tmpvar_22; - tmpvar_22 = tmpvar_21; - offset_17 = tmpvar_22; - vec2 tmpvar_23; - tmpvar_23 = (IN_14.uv_MainTex + offset_17); - IN_14.uv_MainTex = tmpvar_23; - vec2 tmpvar_24; - tmpvar_24 = (IN_14.uv_BumpMap + offset_17); - IN_14.uv_BumpMap = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25 = texture2D (_MainTex, IN_14.uv_MainTex); - vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; - tex_16 = tmpvar_26; - vec3 tmpvar_27; - tmpvar_27 = (tex_16.xyz * _Color.xyz); - o_15.Albedo = tmpvar_27; - float tmpvar_28; - tmpvar_28 = tex_16.w; - o_15.Gloss = tmpvar_28; - float tmpvar_29; - tmpvar_29 = (tex_16.w * _Color.w); - o_15.Alpha = tmpvar_29; - float tmpvar_30; - tmpvar_30 = _Shininess; - o_15.Specular = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = texture2D (_BumpMap, IN_14.uv_BumpMap); - vec4 tmpvar_32; - tmpvar_32 = UnpackNormal (tmpvar_31); - vec3 tmpvar_33; - tmpvar_33 = tmpvar_32.xyz; - vec3 tmpvar_34; - tmpvar_34 = tmpvar_33; - o_15.Normal = tmpvar_34; -} - -float UnitySpotCookie ( - in vec4 LightCoord_35 -) -{ - vec4 tmpvar_36; - tmpvar_36 = texture2D (_LightTexture0, ((LightCoord_35.xy / LightCoord_35.w) + 0.5)); - return tmpvar_36.w; -} - -float UnitySpotAttenuate ( - in vec3 LightCoord_37 -) -{ - float tmpvar_38; - tmpvar_38 = dot (LightCoord_37, LightCoord_37); - vec2 tmpvar_39; - tmpvar_39 = vec2(tmpvar_38); - vec2 tmpvar_40; - tmpvar_40 = tmpvar_39.xy; - vec4 tmpvar_41; - tmpvar_41 = texture2D (_LightTextureB0, tmpvar_40); - return tmpvar_41.w; -} - -vec4 LightingBlinnPhong ( - in SurfaceOutput s_42, - in vec3 lightDir_43, - in vec3 viewDir_44, - in float atten_45 -) -{ - vec4 c_46; - float spec_47; - float nh_48; - float diff_49; - vec3 h_50; - vec3 tmpvar_51; - tmpvar_51 = normalize ((lightDir_43 + viewDir_44)); - vec3 tmpvar_52; - tmpvar_52 = tmpvar_51; - h_50 = tmpvar_52; - float tmpvar_53; - tmpvar_53 = dot (s_42.Normal, lightDir_43); - float tmpvar_54; - tmpvar_54 = max (0.0, tmpvar_53); - float tmpvar_55; - tmpvar_55 = tmpvar_54; - diff_49 = tmpvar_55; - float tmpvar_56; - tmpvar_56 = dot (s_42.Normal, h_50); - float tmpvar_57; - tmpvar_57 = max (0.0, tmpvar_56); - float tmpvar_58; - tmpvar_58 = tmpvar_57; - nh_48 = tmpvar_58; - float tmpvar_59; - tmpvar_59 = pow (nh_48, (s_42.Specular * 128.0)); - float tmpvar_60; - tmpvar_60 = (tmpvar_59 * s_42.Gloss); - spec_47 = tmpvar_60; - vec3 tmpvar_61; - tmpvar_61 = ((( - (s_42.Albedo * _LightColor0.xyz) - * diff_49) + ( - (_LightColor0.xyz * _SpecColor.xyz) - * spec_47)) * (atten_45 * 2.0)); - c_46.xyz = tmpvar_61.xyz.xyz; - float tmpvar_62; - tmpvar_62 = (s_42.Alpha + (( - (_LightColor0.w * _SpecColor.w) - * spec_47) * atten_45)); - c_46.w = vec4(tmpvar_62).w; - return c_46; -} - -vec4 frag_surf ( - in v2f_surf IN_63 -) -{ - vec4 c_64; - vec3 lightDir_65; - SurfaceOutput o_66; - Input surfIN_67; - vec2 tmpvar_68; - tmpvar_68 = IN_63.hip_pack0.xy; - surfIN_67.uv_MainTex = tmpvar_68; - vec2 tmpvar_69; - tmpvar_69 = IN_63.hip_pack0.zw; - surfIN_67.uv_BumpMap = tmpvar_69; - vec3 tmpvar_70; - tmpvar_70 = IN_63.viewDir; - surfIN_67.viewDir = tmpvar_70; - vec3 tmpvar_71; - tmpvar_71 = vec3(0.0, 0.0, 0.0); - o_66.Albedo = tmpvar_71; - vec3 tmpvar_72; - tmpvar_72 = vec3(0.0, 0.0, 0.0); - o_66.Emission = tmpvar_72; - float tmpvar_73; - tmpvar_73 = 0.0; - o_66.Specular = tmpvar_73; - float tmpvar_74; - tmpvar_74 = 0.0; - o_66.Alpha = tmpvar_74; - float tmpvar_75; - tmpvar_75 = 0.0; - o_66.Gloss = tmpvar_75; - surf (surfIN_67, o_66); - vec3 tmpvar_76; - tmpvar_76 = IN_63.lightDir; - lightDir_65 = tmpvar_76; - vec3 tmpvar_77; - tmpvar_77 = normalize (lightDir_65); - vec3 tmpvar_78; - tmpvar_78 = tmpvar_77; - lightDir_65 = tmpvar_78; - vec3 tmpvar_79; - tmpvar_79 = IN_63.viewDir.xyz; - vec3 tmpvar_80; - tmpvar_80 = normalize (tmpvar_79); - float tmpvar_81; - tmpvar_81 = UnitySpotCookie (IN_63._LightCoord); - float tmpvar_82; - tmpvar_82 = UnitySpotAttenuate (IN_63._LightCoord.xyz); - vec4 tmpvar_83; - tmpvar_83 = LightingBlinnPhong (o_66, lightDir_65, tmpvar_80, ((float( - (IN_63._LightCoord.z > 0.0) - ) * tmpvar_81) * tmpvar_82)); - vec4 tmpvar_84; - tmpvar_84 = tmpvar_83; - c_64 = tmpvar_84; - float tmpvar_85; - tmpvar_85 = 0.0; - c_64.w = vec4(tmpvar_85).w; - return c_64; -} - -void main () -{ - v2f_surf xlt_IN_86; - vec4 xl_retval_87; - vec4 tmpvar_88; - tmpvar_88 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_86.pos = tmpvar_88; - float tmpvar_89; - tmpvar_89 = xlv_FOG.x; - xlt_IN_86.fog = tmpvar_89; - vec4 tmpvar_90; - tmpvar_90 = gl_TexCoord[0].xyzw; - vec4 tmpvar_91; - tmpvar_91 = tmpvar_90; - xlt_IN_86.hip_pack0 = tmpvar_91; - vec3 tmpvar_92; - tmpvar_92 = gl_TexCoord[1].xyz; - vec3 tmpvar_93; - tmpvar_93 = tmpvar_92; - xlt_IN_86.viewDir = tmpvar_93; - vec3 tmpvar_94; - tmpvar_94 = gl_TexCoord[2].xyz; - vec3 tmpvar_95; - tmpvar_95 = tmpvar_94; - xlt_IN_86.lightDir = tmpvar_95; - vec4 tmpvar_96; - tmpvar_96 = gl_TexCoord[3].xyzw; - vec4 tmpvar_97; - tmpvar_97 = tmpvar_96; - xlt_IN_86._LightCoord = tmpvar_97; - vec4 tmpvar_98; - tmpvar_98 = frag_surf (xlt_IN_86); - vec4 tmpvar_99; - tmpvar_99 = tmpvar_98; - xl_retval_87 = tmpvar_99; - vec4 tmpvar_100; - tmpvar_100 = xl_retval_87.xyzw; - vec4 tmpvar_101; - tmpvar_101 = tmpvar_100; - gl_FragData[0] = tmpvar_101; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-out.txt index 6cda5cf4e..73ef2117e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-out.txt @@ -40,8 +40,8 @@ void main () (tmpvar_3.xy / tmpvar_3.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_3.xyz, tmpvar_3.xyz))).w); vec4 c_12; - float tmpvar_13; - tmpvar_13 = (pow (max (0.0, + float spec_13; + spec_13 = (pow (max (0.0, dot (normal_9.xyz, normalize((tmpvar_10 + normalize(tmpvar_2)))) ), (_Shininess * 128.0)) * tmpvar_8.w); c_12.xyz = ((( @@ -50,14 +50,26 @@ void main () max (0.0, dot (normal_9.xyz, tmpvar_10)) ) + ( (_LightColor0.xyz * _SpecColor.xyz) - * tmpvar_13)) * (atten_11 * 2.0)); - c_12.w = ((tmpvar_8.w * _Color.w) + (( - (_LightColor0.w * _SpecColor.w) - * tmpvar_13) * atten_11)); + * spec_13)) * (atten_11 * 2.0)); + c_12.w = ((tmpvar_8.w * _Color.w) + ((_LightColor0.w * _SpecColor.w) * (spec_13 * atten_11))); c_4.xyz = c_12.xyz; c_4.w = 0.0; gl_FragData[0] = c_4; } -// inputs: 1, stats: 48 alu 5 tex 0 flow +// stats: 48 alu 5 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 5 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _Parallax (high float) 1x1 [-1] +// #3: _Shininess (high float) 1x1 [-1] +// #4: _SpecColor (high float) 4x1 [-1] +// textures: 5 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _LightTexture0 (high 2d) 0x0 [-1] +// #2: _LightTextureB0 (high 2d) 0x0 [-1] +// #3: _MainTex (high 2d) 0x0 [-1] +// #4: _ParallaxMap (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-ir.txt deleted file mode 100644 index 44dc0543c..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-ir.txt +++ /dev/null @@ -1,45 +0,0 @@ -struct v2f { - vec4 vertex; - vec4 color; - vec2 texcoord; -}; -uniform sampler2D _MainTex; -uniform vec4 _TintColor; -vec4 frag ( - in v2f i_1 -) -{ - vec4 tmpvar_2; - tmpvar_2 = texture2D (_MainTex, i_1.texcoord); - return (((2.0 * i_1.color) * _TintColor) * tmpvar_2); -} - -void main () -{ - v2f xlt_i_3; - vec4 xl_retval_4; - vec4 tmpvar_5; - tmpvar_5 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_3.vertex = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6 = gl_Color.xyzw; - vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - xlt_i_3.color = tmpvar_7; - vec2 tmpvar_8; - tmpvar_8 = gl_TexCoord[0].xy; - vec2 tmpvar_9; - tmpvar_9 = tmpvar_8; - xlt_i_3.texcoord = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10 = frag (xlt_i_3); - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - xl_retval_4 = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12 = xl_retval_4.xyzw; - vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - gl_FragData[0] = tmpvar_13; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-out.txt index 6a78bf152..58decf60a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-out.txt @@ -6,4 +6,11 @@ void main () } -// inputs: 2, stats: 3 alu 1 tex 0 flow +// stats: 3 alu 1 tex 0 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [1] loc 4 +// uniforms: 1 (total size: 0) +// #0: _TintColor (high float) 4x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive_(Soft)-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive_(Soft)-ir.txt deleted file mode 100644 index ee0d0c2f3..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive_(Soft)-ir.txt +++ /dev/null @@ -1,51 +0,0 @@ -struct v2f { - vec4 vertex; - vec4 color; - vec2 texcoord; -}; -uniform sampler2D _MainTex; -vec4 frag ( - in v2f i_1 -) -{ - vec4 prev_2; - vec4 tmpvar_3; - tmpvar_3 = texture2D (_MainTex, i_1.texcoord); - vec4 tmpvar_4; - tmpvar_4 = (i_1.color * tmpvar_3); - prev_2 = tmpvar_4; - vec3 tmpvar_5; - tmpvar_5 = (prev_2.xyz * prev_2.w); - prev_2.xyz = tmpvar_5.xyz.xyz; - return prev_2; -} - -void main () -{ - v2f xlt_i_6; - vec4 xl_retval_7; - vec4 tmpvar_8; - tmpvar_8 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_6.vertex = tmpvar_8; - vec4 tmpvar_9; - tmpvar_9 = gl_Color.xyzw; - vec4 tmpvar_10; - tmpvar_10 = tmpvar_9; - xlt_i_6.color = tmpvar_10; - vec2 tmpvar_11; - tmpvar_11 = gl_TexCoord[0].xy; - vec2 tmpvar_12; - tmpvar_12 = tmpvar_11; - xlt_i_6.texcoord = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13 = frag (xlt_i_6); - vec4 tmpvar_14; - tmpvar_14 = tmpvar_13; - xl_retval_7 = tmpvar_14; - vec4 tmpvar_15; - tmpvar_15 = xl_retval_7.xyzw; - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - gl_FragData[0] = tmpvar_16; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive_(Soft)-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive_(Soft)-out.txt index 40ba2fc7e..2ecf0af3a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive_(Soft)-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive_(Soft)-out.txt @@ -2,12 +2,15 @@ uniform sampler2D _MainTex; void main () { vec4 prev_1; - vec4 tmpvar_2; - tmpvar_2 = (gl_Color * texture2D (_MainTex, gl_TexCoord[0].xy)); - prev_1.w = tmpvar_2.w; - prev_1.xyz = (tmpvar_2.xyz * tmpvar_2.w); + prev_1 = (gl_Color * texture2D (_MainTex, gl_TexCoord[0].xy)); + prev_1.xyz = (prev_1.xyz * prev_1.w); gl_FragData[0] = prev_1; } -// inputs: 2, stats: 2 alu 1 tex 0 flow +// stats: 2 alu 1 tex 0 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [1] loc 4 +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Alpha_Blended_Premultiply-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Alpha_Blended_Premultiply-ir.txt deleted file mode 100644 index a6ae06861..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Alpha_Blended_Premultiply-ir.txt +++ /dev/null @@ -1,44 +0,0 @@ -struct v2f { - vec4 vertex; - vec4 color; - vec2 texcoord; -}; -uniform sampler2D _MainTex; -vec4 frag ( - in v2f i_1 -) -{ - vec4 tmpvar_2; - tmpvar_2 = texture2D (_MainTex, i_1.texcoord); - return ((i_1.color * tmpvar_2) * i_1.color.w); -} - -void main () -{ - v2f xlt_i_3; - vec4 xl_retval_4; - vec4 tmpvar_5; - tmpvar_5 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_3.vertex = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6 = gl_Color.xyzw; - vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - xlt_i_3.color = tmpvar_7; - vec2 tmpvar_8; - tmpvar_8 = gl_TexCoord[0].xy; - vec2 tmpvar_9; - tmpvar_9 = tmpvar_8; - xlt_i_3.texcoord = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10 = frag (xlt_i_3); - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - xl_retval_4 = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12 = xl_retval_4.xyzw; - vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - gl_FragData[0] = tmpvar_13; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Alpha_Blended_Premultiply-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Alpha_Blended_Premultiply-out.txt index d43bdda5d..62ff87d18 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Alpha_Blended_Premultiply-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Alpha_Blended_Premultiply-out.txt @@ -5,4 +5,9 @@ void main () } -// inputs: 2, stats: 2 alu 1 tex 0 flow +// stats: 2 alu 1 tex 0 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [1] loc 4 +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply-ir.txt deleted file mode 100644 index d6a7b54a4..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply-ir.txt +++ /dev/null @@ -1,52 +0,0 @@ -struct v2f { - vec4 vertex; - vec4 color; - vec2 texcoord; -}; -uniform sampler2D _MainTex; -vec4 frag ( - in v2f i_1 -) -{ - vec4 prev_2; - vec4 tmpvar_3; - tmpvar_3 = texture2D (_MainTex, i_1.texcoord); - vec4 tmpvar_4; - tmpvar_4 = (i_1.color * tmpvar_3); - prev_2 = tmpvar_4; - vec4 tmpvar_5; - tmpvar_5 = vec4(prev_2.w); - vec4 tmpvar_6; - tmpvar_6 = mix (vec4(1.0, 1.0, 1.0, 1.0), prev_2, tmpvar_5); - return tmpvar_6; -} - -void main () -{ - v2f xlt_i_7; - vec4 xl_retval_8; - vec4 tmpvar_9; - tmpvar_9 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_7.vertex = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10 = gl_Color.xyzw; - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - xlt_i_7.color = tmpvar_11; - vec2 tmpvar_12; - tmpvar_12 = gl_TexCoord[0].xy; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_12; - xlt_i_7.texcoord = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = frag (xlt_i_7); - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - xl_retval_8 = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = xl_retval_8.xyzw; - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - gl_FragData[0] = tmpvar_17; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply-out.txt index 8ffc071ef..e8752575e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply-out.txt @@ -1,10 +1,15 @@ uniform sampler2D _MainTex; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_Color * texture2D (_MainTex, gl_TexCoord[0].xy)); - gl_FragData[0] = mix (vec4(1.0, 1.0, 1.0, 1.0), tmpvar_1, tmpvar_1.wwww); + vec4 prev_1; + prev_1 = (gl_Color * texture2D (_MainTex, gl_TexCoord[0].xy)); + gl_FragData[0] = mix (vec4(1.0, 1.0, 1.0, 1.0), prev_1, prev_1.wwww); } -// inputs: 2, stats: 2 alu 1 tex 0 flow +// stats: 2 alu 1 tex 0 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [1] loc 4 +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply_(Double)-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply_(Double)-ir.txt deleted file mode 100644 index 076989c31..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply_(Double)-ir.txt +++ /dev/null @@ -1,59 +0,0 @@ -struct v2f { - vec4 vertex; - vec4 color; - vec2 texcoord; -}; -uniform sampler2D _MainTex; -vec4 frag ( - in v2f i_1 -) -{ - vec4 col_2; - vec4 tex_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, i_1.texcoord); - vec4 tmpvar_5; - tmpvar_5 = tmpvar_4; - tex_3 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = ((tex_3.xyz * i_1.color.xyz) * 2.0); - col_2.xyz = tmpvar_6.xyz.xyz; - float tmpvar_7; - tmpvar_7 = (i_1.color.w * tex_3.w); - col_2.w = vec4(tmpvar_7).w; - vec4 tmpvar_8; - tmpvar_8 = vec4(col_2.w); - vec4 tmpvar_9; - tmpvar_9 = mix (vec4(0.5, 0.5, 0.5, 0.5), col_2, tmpvar_8); - return tmpvar_9; -} - -void main () -{ - v2f xlt_i_10; - vec4 xl_retval_11; - vec4 tmpvar_12; - tmpvar_12 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_10.vertex = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13 = gl_Color.xyzw; - vec4 tmpvar_14; - tmpvar_14 = tmpvar_13; - xlt_i_10.color = tmpvar_14; - vec2 tmpvar_15; - tmpvar_15 = gl_TexCoord[0].xy; - vec2 tmpvar_16; - tmpvar_16 = tmpvar_15; - xlt_i_10.texcoord = tmpvar_16; - vec4 tmpvar_17; - tmpvar_17 = frag (xlt_i_10); - vec4 tmpvar_18; - tmpvar_18 = tmpvar_17; - xl_retval_11 = tmpvar_18; - vec4 tmpvar_19; - tmpvar_19 = xl_retval_11.xyzw; - vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - gl_FragData[0] = tmpvar_20; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply_(Double)-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply_(Double)-out.txt index b18306340..8887c38d2 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply_(Double)-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply_(Double)-out.txt @@ -10,4 +10,9 @@ void main () } -// inputs: 2, stats: 4 alu 1 tex 0 flow +// stats: 4 alu 1 tex 0 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [1] loc 4 +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-ir.txt deleted file mode 100644 index 359a10120..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-ir.txt +++ /dev/null @@ -1,56 +0,0 @@ -struct v2f { - vec4 vertex; - vec4 color; - vec2 texcoord; -}; -uniform sampler2D _MainTex; -uniform vec4 _TintColor; -vec4 frag ( - in v2f i_1 -) -{ - vec4 col_2; - vec4 tex_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, i_1.texcoord); - vec4 tmpvar_5; - tmpvar_5 = tmpvar_4; - tex_3 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = (((_TintColor.xyz * tex_3.xyz) * i_1.color.xyz) * 2.0); - col_2.xyz = tmpvar_6.xyz.xyz; - float tmpvar_7; - tmpvar_7 = ((1.0 - tex_3.w) * ((_TintColor.w * i_1.color.w) * 2.0)); - col_2.w = vec4(tmpvar_7).w; - return col_2; -} - -void main () -{ - v2f xlt_i_8; - vec4 xl_retval_9; - vec4 tmpvar_10; - tmpvar_10 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_8.vertex = tmpvar_10; - vec4 tmpvar_11; - tmpvar_11 = gl_Color.xyzw; - vec4 tmpvar_12; - tmpvar_12 = tmpvar_11; - xlt_i_8.color = tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = gl_TexCoord[0].xy; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_13; - xlt_i_8.texcoord = tmpvar_14; - vec4 tmpvar_15; - tmpvar_15 = frag (xlt_i_8); - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - xl_retval_9 = tmpvar_16; - vec4 tmpvar_17; - tmpvar_17 = xl_retval_9.xyzw; - vec4 tmpvar_18; - tmpvar_18 = tmpvar_17; - gl_FragData[0] = tmpvar_18; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-out.txt index f76520690..be250651c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-out.txt @@ -5,10 +5,17 @@ void main () vec4 col_1; vec4 tmpvar_2; tmpvar_2 = texture2D (_MainTex, gl_TexCoord[0].xy); - col_1.xyz = (((_TintColor.xyz * tmpvar_2.xyz) * gl_Color.xyz) * 2.0); + col_1.xyz = ((_TintColor.xyz * tmpvar_2.xyz) * (gl_Color.xyz * 2.0)); col_1.w = ((1.0 - tmpvar_2.w) * ((_TintColor.w * gl_Color.w) * 2.0)); gl_FragData[0] = col_1; } -// inputs: 2, stats: 7 alu 1 tex 0 flow +// stats: 7 alu 1 tex 0 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [1] loc 4 +// uniforms: 1 (total size: 0) +// #0: _TintColor (high float) 4x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-ir.txt deleted file mode 100644 index 44c698d47..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-ir.txt +++ /dev/null @@ -1,199 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; - vec3 worldRefl; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 lightDir; - vec2 _LightCoord; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform samplerCube _Cube; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _MainTex; -uniform vec4 _ReflectColor; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -void surf ( - in Input IN_6, - inout SurfaceOutput o_7 -) -{ - vec4 reflcol_8; - vec3 worldRefl_9; - vec4 c_10; - vec4 tex_11; - vec4 tmpvar_12; - tmpvar_12 = texture2D (_MainTex, IN_6.uv_MainTex); - vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - tex_11 = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = (tex_11 * _Color); - c_10 = tmpvar_14; - vec3 tmpvar_15; - tmpvar_15 = c_10.xyz; - o_7.Albedo = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = texture2D (_BumpMap, IN_6.uv_BumpMap); - vec4 tmpvar_17; - tmpvar_17 = UnpackNormal (tmpvar_16); - vec3 tmpvar_18; - tmpvar_18 = tmpvar_17.xyz; - vec3 tmpvar_19; - tmpvar_19 = tmpvar_18; - o_7.Normal = tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = IN_6.worldRefl; - worldRefl_9 = tmpvar_20; - vec4 tmpvar_21; - tmpvar_21 = textureCube (_Cube, worldRefl_9); - vec4 tmpvar_22; - tmpvar_22 = tmpvar_21; - reflcol_8 = tmpvar_22; - vec4 tmpvar_23; - tmpvar_23 = (reflcol_8 * tex_11.w); - reflcol_8 = tmpvar_23; - vec3 tmpvar_24; - tmpvar_24 = (reflcol_8.xyz * _ReflectColor.xyz); - o_7.Emission = tmpvar_24; - float tmpvar_25; - tmpvar_25 = (reflcol_8.w * _ReflectColor.w); - o_7.Alpha = tmpvar_25; -} - -vec4 LightingLambert ( - in SurfaceOutput s_26, - in vec3 lightDir_27, - in float atten_28 -) -{ - vec4 c_29; - float diff_30; - float tmpvar_31; - tmpvar_31 = dot (s_26.Normal, lightDir_27); - float tmpvar_32; - tmpvar_32 = max (0.0, tmpvar_31); - float tmpvar_33; - tmpvar_33 = tmpvar_32; - diff_30 = tmpvar_33; - vec3 tmpvar_34; - tmpvar_34 = ((s_26.Albedo * _LightColor0.xyz) * ((diff_30 * atten_28) * 2.0)); - c_29.xyz = tmpvar_34.xyz.xyz; - float tmpvar_35; - tmpvar_35 = s_26.Alpha; - c_29.w = vec4(tmpvar_35).w; - return c_29; -} - -vec4 frag_surf ( - in v2f_surf IN_36 -) -{ - vec4 c_37; - vec3 lightDir_38; - SurfaceOutput o_39; - Input surfIN_40; - vec2 tmpvar_41; - tmpvar_41 = IN_36.hip_pack0.xy; - surfIN_40.uv_MainTex = tmpvar_41; - vec2 tmpvar_42; - tmpvar_42 = IN_36.hip_pack0.zw; - surfIN_40.uv_BumpMap = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = vec3(0.0, 0.0, 0.0); - o_39.Albedo = tmpvar_43; - vec3 tmpvar_44; - tmpvar_44 = vec3(0.0, 0.0, 0.0); - o_39.Emission = tmpvar_44; - float tmpvar_45; - tmpvar_45 = 0.0; - o_39.Specular = tmpvar_45; - float tmpvar_46; - tmpvar_46 = 0.0; - o_39.Alpha = tmpvar_46; - float tmpvar_47; - tmpvar_47 = 0.0; - o_39.Gloss = tmpvar_47; - surf (surfIN_40, o_39); - vec3 tmpvar_48; - tmpvar_48 = IN_36.lightDir; - lightDir_38 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = texture2D (_LightTexture0, IN_36._LightCoord); - vec4 tmpvar_50; - tmpvar_50 = LightingLambert (o_39, lightDir_38, (tmpvar_49.w * 1.0)); - vec4 tmpvar_51; - tmpvar_51 = tmpvar_50; - c_37 = tmpvar_51; - float tmpvar_52; - tmpvar_52 = 0.0; - c_37.w = vec4(tmpvar_52).w; - return c_37; -} - -void main () -{ - v2f_surf xlt_IN_53; - vec4 xl_retval_54; - vec4 tmpvar_55; - tmpvar_55 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_53.pos = tmpvar_55; - float tmpvar_56; - tmpvar_56 = xlv_FOG.x; - xlt_IN_53.fog = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = gl_TexCoord[0].xyzw; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - xlt_IN_53.hip_pack0 = tmpvar_58; - vec3 tmpvar_59; - tmpvar_59 = gl_TexCoord[1].xyz; - vec3 tmpvar_60; - tmpvar_60 = tmpvar_59; - xlt_IN_53.lightDir = tmpvar_60; - vec2 tmpvar_61; - tmpvar_61 = gl_TexCoord[2].xy; - vec2 tmpvar_62; - tmpvar_62 = tmpvar_61; - xlt_IN_53._LightCoord = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63 = frag_surf (xlt_IN_53); - vec4 tmpvar_64; - tmpvar_64 = tmpvar_63; - xl_retval_54 = tmpvar_64; - vec4 tmpvar_65; - tmpvar_65 = xl_retval_54.xyzw; - vec4 tmpvar_66; - tmpvar_66 = tmpvar_65; - gl_FragData[0] = tmpvar_66; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-out.txt index e97b46ebc..e14892f14 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-out.txt @@ -29,4 +29,15 @@ void main () } -// inputs: 1, stats: 17 alu 4 tex 0 flow +// stats: 17 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 3 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _ReflectColor (high float) 4x1 [-1] +// textures: 4 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _Cube (high cube) 0x0 [-1] +// #2: _LightTexture0 (high 2d) 0x0 [-1] +// #3: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-ir.txt deleted file mode 100644 index a6d4818e8..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-ir.txt +++ /dev/null @@ -1,386 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; - vec3 worldRefl; - vec3 TtoW0; - vec3 TtoW1; - vec3 TtoW2; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec4 hip_screen; - vec4 TtoW0; - vec4 TtoW1; - vec4 TtoW2; - vec3 hip_lmapFade; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform samplerCube _Cube; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform vec4 _ReflectColor; -uniform sampler2D unity_Lightmap; -uniform sampler2D unity_LightmapInd; -varying vec4 xlv_FOG; -float xll_saturate ( - in float x_1 -) -{ - float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -vec2 xll_saturate ( - in vec2 x_3 -) -{ - vec2 tmpvar_4; - tmpvar_4 = clamp (x_3, 0.0, 1.0); - return tmpvar_4; -} - -vec3 xll_saturate ( - in vec3 x_5 -) -{ - vec3 tmpvar_6; - tmpvar_6 = clamp (x_5, 0.0, 1.0); - return tmpvar_6; -} - -vec4 xll_saturate ( - in vec4 x_7 -) -{ - vec4 tmpvar_8; - tmpvar_8 = clamp (x_7, 0.0, 1.0); - return tmpvar_8; -} - -mat2 xll_saturate ( - in mat2 m_9 -) -{ - vec2 tmpvar_10; - tmpvar_10 = clamp (m_9[0], 0.0, 1.0); - vec2 tmpvar_11; - tmpvar_11 = clamp (m_9[1], 0.0, 1.0); - mat2 tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_10; - tmpvar_12[0] = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_12[1] = tmpvar_14; - return tmpvar_12; -} - -mat3 xll_saturate ( - in mat3 m_15 -) -{ - vec3 tmpvar_16; - tmpvar_16 = clamp (m_15[0], 0.0, 1.0); - vec3 tmpvar_17; - tmpvar_17 = clamp (m_15[1], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_15[2], 0.0, 1.0); - mat3 tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_16; - tmpvar_19[0] = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_19[1] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_19[2] = tmpvar_22; - return tmpvar_19; -} - -mat4 xll_saturate ( - in mat4 m_23 -) -{ - vec4 tmpvar_24; - tmpvar_24 = clamp (m_23[0], 0.0, 1.0); - vec4 tmpvar_25; - tmpvar_25 = clamp (m_23[1], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_23[2], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_23[3], 0.0, 1.0); - mat4 tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_24; - tmpvar_28[0] = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_28[1] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_28[2] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_28[3] = tmpvar_32; - return tmpvar_28; -} - -vec4 UnpackNormal ( - in vec4 packednormal_33 -) -{ - vec4 normal_34; - vec2 tmpvar_35; - tmpvar_35 = ((packednormal_33.wy * 2.0) - 1.0); - normal_34.xy = tmpvar_35.xy.xy; - float tmpvar_36; - tmpvar_36 = sqrt (((1.0 - (normal_34.x * normal_34.x)) - (normal_34.y * normal_34.y))); - float tmpvar_37; - tmpvar_37 = tmpvar_36; - normal_34.z = vec3(tmpvar_37).z; - return normal_34; -} - -void surf ( - in Input IN_38, - inout SurfaceOutput o_39 -) -{ - vec4 reflcol_40; - vec3 worldRefl_41; - vec4 c_42; - vec4 tex_43; - vec4 tmpvar_44; - tmpvar_44 = texture2D (_MainTex, IN_38.uv_MainTex); - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - tex_43 = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46 = (tex_43 * _Color); - c_42 = tmpvar_46; - vec3 tmpvar_47; - tmpvar_47 = c_42.xyz; - o_39.Albedo = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48 = texture2D (_BumpMap, IN_38.uv_BumpMap); - vec4 tmpvar_49; - tmpvar_49 = UnpackNormal (tmpvar_48); - vec3 tmpvar_50; - tmpvar_50 = tmpvar_49.xyz; - vec3 tmpvar_51; - tmpvar_51 = tmpvar_50; - o_39.Normal = tmpvar_51; - float tmpvar_52; - tmpvar_52 = dot (IN_38.TtoW0, o_39.Normal); - float tmpvar_53; - tmpvar_53 = dot (IN_38.TtoW1, o_39.Normal); - float tmpvar_54; - tmpvar_54 = dot (IN_38.TtoW2, o_39.Normal); - vec3 tmpvar_55; - tmpvar_55.x = tmpvar_52; - tmpvar_55.y = tmpvar_53; - tmpvar_55.z = tmpvar_54; - vec3 tmpvar_56; - tmpvar_56 = reflect (IN_38.worldRefl, tmpvar_55); - vec3 tmpvar_57; - tmpvar_57 = tmpvar_56; - worldRefl_41 = tmpvar_57; - vec4 tmpvar_58; - tmpvar_58 = textureCube (_Cube, worldRefl_41); - vec4 tmpvar_59; - tmpvar_59 = tmpvar_58; - reflcol_40 = tmpvar_59; - vec4 tmpvar_60; - tmpvar_60 = (reflcol_40 * tex_43.w); - reflcol_40 = tmpvar_60; - vec3 tmpvar_61; - tmpvar_61 = (reflcol_40.xyz * _ReflectColor.xyz); - o_39.Emission = tmpvar_61; - float tmpvar_62; - tmpvar_62 = (reflcol_40.w * _ReflectColor.w); - o_39.Alpha = tmpvar_62; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_63, - in vec4 light_64 -) -{ - vec4 c_65; - vec3 tmpvar_66; - tmpvar_66 = (s_63.Albedo * light_64.xyz); - c_65.xyz = tmpvar_66.xyz.xyz; - float tmpvar_67; - tmpvar_67 = s_63.Alpha; - c_65.w = vec4(tmpvar_67).w; - return c_65; -} - -vec3 DecodeLightmap ( - in vec4 color_68 -) -{ - return (2.0 * color_68.xyz); -} - -vec4 frag_surf ( - in v2f_surf IN_69 -) -{ - vec4 col_70; - vec3 lm_71; - vec3 lmIndirect_72; - vec3 lmFull_73; - vec4 light_74; - SurfaceOutput o_75; - Input surfIN_76; - vec2 tmpvar_77; - tmpvar_77 = IN_69.hip_pack0.xy; - surfIN_76.uv_MainTex = tmpvar_77; - vec2 tmpvar_78; - tmpvar_78 = IN_69.hip_pack0.zw; - surfIN_76.uv_BumpMap = tmpvar_78; - vec3 tmpvar_79; - tmpvar_79.x = IN_69.TtoW0.w; - tmpvar_79.y = IN_69.TtoW1.w; - tmpvar_79.z = IN_69.TtoW2.w; - vec3 tmpvar_80; - tmpvar_80 = tmpvar_79; - surfIN_76.worldRefl = tmpvar_80; - vec3 tmpvar_81; - tmpvar_81 = IN_69.TtoW0.xyz; - surfIN_76.TtoW0 = tmpvar_81; - vec3 tmpvar_82; - tmpvar_82 = IN_69.TtoW1.xyz; - surfIN_76.TtoW1 = tmpvar_82; - vec3 tmpvar_83; - tmpvar_83 = IN_69.TtoW2.xyz; - surfIN_76.TtoW2 = tmpvar_83; - vec3 tmpvar_84; - tmpvar_84 = vec3(0.0, 0.0, 0.0); - o_75.Albedo = tmpvar_84; - vec3 tmpvar_85; - tmpvar_85 = vec3(0.0, 0.0, 0.0); - o_75.Emission = tmpvar_85; - float tmpvar_86; - tmpvar_86 = 0.0; - o_75.Specular = tmpvar_86; - float tmpvar_87; - tmpvar_87 = 0.0; - o_75.Alpha = tmpvar_87; - float tmpvar_88; - tmpvar_88 = 0.0; - o_75.Gloss = tmpvar_88; - surf (surfIN_76, o_75); - vec4 tmpvar_89; - tmpvar_89 = texture2DProj (_LightBuffer, IN_69.hip_screen); - vec4 tmpvar_90; - tmpvar_90 = tmpvar_89; - light_74 = tmpvar_90; - vec4 tmpvar_91; - tmpvar_91 = log2 (light_74); - vec4 tmpvar_92; - tmpvar_92 = -(tmpvar_91); - light_74 = tmpvar_92; - vec4 tmpvar_93; - tmpvar_93 = texture2D (unity_Lightmap, IN_69.hip_lmapFade.xy); - vec3 tmpvar_94; - tmpvar_94 = DecodeLightmap (tmpvar_93); - vec3 tmpvar_95; - tmpvar_95 = tmpvar_94; - lmFull_73 = tmpvar_95; - vec4 tmpvar_96; - tmpvar_96 = texture2D (unity_LightmapInd, IN_69.hip_lmapFade.xy); - vec3 tmpvar_97; - tmpvar_97 = DecodeLightmap (tmpvar_96); - vec3 tmpvar_98; - tmpvar_98 = tmpvar_97; - lmIndirect_72 = tmpvar_98; - float tmpvar_99; - tmpvar_99 = xll_saturate (IN_69.hip_lmapFade.z); - vec3 tmpvar_100; - tmpvar_100 = vec3(tmpvar_99); - vec3 tmpvar_101; - tmpvar_101 = mix (lmIndirect_72, lmFull_73, tmpvar_100); - vec3 tmpvar_102; - tmpvar_102 = tmpvar_101; - lm_71 = tmpvar_102; - vec3 tmpvar_103; - tmpvar_103 = (light_74.xyz + lm_71); - light_74.xyz = tmpvar_103.xyz.xyz; - vec4 tmpvar_104; - tmpvar_104 = LightingLambert_PrePass (o_75, light_74); - vec4 tmpvar_105; - tmpvar_105 = tmpvar_104; - col_70 = tmpvar_105; - vec3 tmpvar_106; - tmpvar_106 = (col_70.xyz + o_75.Emission); - col_70.xyz = tmpvar_106.xyz.xyz; - return col_70; -} - -void main () -{ - v2f_surf xlt_IN_107; - vec4 xl_retval_108; - vec4 tmpvar_109; - tmpvar_109 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_107.pos = tmpvar_109; - float tmpvar_110; - tmpvar_110 = xlv_FOG.x; - xlt_IN_107.fog = tmpvar_110; - vec4 tmpvar_111; - tmpvar_111 = gl_TexCoord[0].xyzw; - vec4 tmpvar_112; - tmpvar_112 = tmpvar_111; - xlt_IN_107.hip_pack0 = tmpvar_112; - vec4 tmpvar_113; - tmpvar_113 = gl_TexCoord[1].xyzw; - vec4 tmpvar_114; - tmpvar_114 = tmpvar_113; - xlt_IN_107.hip_screen = tmpvar_114; - vec4 tmpvar_115; - tmpvar_115 = gl_TexCoord[2].xyzw; - vec4 tmpvar_116; - tmpvar_116 = tmpvar_115; - xlt_IN_107.TtoW0 = tmpvar_116; - vec4 tmpvar_117; - tmpvar_117 = gl_TexCoord[3].xyzw; - vec4 tmpvar_118; - tmpvar_118 = tmpvar_117; - xlt_IN_107.TtoW1 = tmpvar_118; - vec4 tmpvar_119; - tmpvar_119 = gl_TexCoord[4].xyzw; - vec4 tmpvar_120; - tmpvar_120 = tmpvar_119; - xlt_IN_107.TtoW2 = tmpvar_120; - vec3 tmpvar_121; - tmpvar_121 = gl_TexCoord[5].xyz; - vec3 tmpvar_122; - tmpvar_122 = tmpvar_121; - xlt_IN_107.hip_lmapFade = tmpvar_122; - vec4 tmpvar_123; - tmpvar_123 = frag_surf (xlt_IN_107); - vec4 tmpvar_124; - tmpvar_124 = tmpvar_123; - xl_retval_108 = tmpvar_124; - vec4 tmpvar_125; - tmpvar_125 = xl_retval_108.xyzw; - vec4 tmpvar_126; - tmpvar_126 = tmpvar_125; - gl_FragData[0] = tmpvar_126; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-out.txt index 842494edb..b61b2abd1 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-out.txt @@ -24,32 +24,42 @@ void main () tmpvar_8.x = tmpvar_2.w; tmpvar_8.y = tmpvar_3.w; tmpvar_8.z = tmpvar_4.w; - vec4 tmpvar_9; - tmpvar_9 = texture2D (_MainTex, tmpvar_1.xy); - vec4 normal_10; - normal_10.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0); - normal_10.z = sqrt(((1.0 - - (normal_10.x * normal_10.x) - ) - (normal_10.y * normal_10.y))); - vec3 tmpvar_11; - tmpvar_11.x = dot (tmpvar_2.xyz, normal_10.xyz); - tmpvar_11.y = dot (tmpvar_3.xyz, normal_10.xyz); - tmpvar_11.z = dot (tmpvar_4.xyz, normal_10.xyz); - vec4 tmpvar_12; - tmpvar_12 = (textureCube (_Cube, (tmpvar_8 - (2.0 * - (dot (tmpvar_11, tmpvar_8) * tmpvar_11) - ))) * tmpvar_9.w); - vec4 tmpvar_13; - tmpvar_13 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); - light_7.w = tmpvar_13.w; - light_7.xyz = (tmpvar_13.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_5.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_5.xy).xyz), vec3(clamp (tmpvar_5.z, 0.0, 1.0)))); - vec4 c_14; - c_14.xyz = ((tmpvar_9 * _Color).xyz * light_7.xyz); - c_14.w = (tmpvar_12.w * _ReflectColor.w); - col_6.w = c_14.w; - col_6.xyz = (c_14.xyz + (tmpvar_12.xyz * _ReflectColor.xyz)); + vec4 reflcol_9; + vec4 tmpvar_10; + tmpvar_10 = texture2D (_MainTex, tmpvar_1.xy); + vec4 normal_11; + normal_11.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0); + normal_11.z = sqrt(((1.0 - + (normal_11.x * normal_11.x) + ) - (normal_11.y * normal_11.y))); + vec3 tmpvar_12; + tmpvar_12.x = dot (tmpvar_2.xyz, normal_11.xyz); + tmpvar_12.y = dot (tmpvar_3.xyz, normal_11.xyz); + tmpvar_12.z = dot (tmpvar_4.xyz, normal_11.xyz); + reflcol_9 = (textureCube (_Cube, (tmpvar_8 - (2.0 * + (dot (tmpvar_12, tmpvar_8) * tmpvar_12) + ))) * tmpvar_10.w); + light_7 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); + light_7.xyz = (light_7.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_5.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_5.xy).xyz), vec3(clamp (tmpvar_5.z, 0.0, 1.0)))); + vec4 c_13; + c_13.xyz = ((tmpvar_10 * _Color).xyz * light_7.xyz); + c_13.w = (reflcol_9.w * _ReflectColor.w); + col_6.w = c_13.w; + col_6.xyz = (c_13.xyz + (reflcol_9.xyz * _ReflectColor.xyz)); gl_FragData[0] = col_6; } -// inputs: 1, stats: 27 alu 6 tex 0 flow +// stats: 27 alu 6 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [6] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _ReflectColor (high float) 4x1 [-1] +// textures: 6 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _Cube (high cube) 0x0 [-1] +// #2: _LightBuffer (high 2d) 0x0 [-1] +// #3: _MainTex (high 2d) 0x0 [-1] +// #4: unity_Lightmap (high 2d) 0x0 [-1] +// #5: unity_LightmapInd (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-ir.txt deleted file mode 100644 index ed92d3016..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-ir.txt +++ /dev/null @@ -1,255 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; - vec3 worldRefl; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 lightDir; - vec3 viewDir; - vec3 _LightCoord; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform samplerCube _Cube; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _MainTex; -uniform vec4 _ReflectColor; -uniform float _Shininess; -uniform vec4 _SpecColor; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -void surf ( - in Input IN_6, - inout SurfaceOutput o_7 -) -{ - vec4 reflcol_8; - vec3 worldRefl_9; - vec4 c_10; - vec4 tex_11; - vec4 tmpvar_12; - tmpvar_12 = texture2D (_MainTex, IN_6.uv_MainTex); - vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - tex_11 = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = (tex_11 * _Color); - c_10 = tmpvar_14; - vec3 tmpvar_15; - tmpvar_15 = c_10.xyz; - o_7.Albedo = tmpvar_15; - float tmpvar_16; - tmpvar_16 = tex_11.w; - o_7.Gloss = tmpvar_16; - float tmpvar_17; - tmpvar_17 = _Shininess; - o_7.Specular = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = texture2D (_BumpMap, IN_6.uv_BumpMap); - vec4 tmpvar_19; - tmpvar_19 = UnpackNormal (tmpvar_18); - vec3 tmpvar_20; - tmpvar_20 = tmpvar_19.xyz; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_20; - o_7.Normal = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = IN_6.worldRefl; - worldRefl_9 = tmpvar_22; - vec4 tmpvar_23; - tmpvar_23 = textureCube (_Cube, worldRefl_9); - vec4 tmpvar_24; - tmpvar_24 = tmpvar_23; - reflcol_8 = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25 = (reflcol_8 * tex_11.w); - reflcol_8 = tmpvar_25; - vec3 tmpvar_26; - tmpvar_26 = (reflcol_8.xyz * _ReflectColor.xyz); - o_7.Emission = tmpvar_26; - float tmpvar_27; - tmpvar_27 = (reflcol_8.w * _ReflectColor.w); - o_7.Alpha = tmpvar_27; -} - -vec4 LightingBlinnPhong ( - in SurfaceOutput s_28, - in vec3 lightDir_29, - in vec3 viewDir_30, - in float atten_31 -) -{ - vec4 c_32; - float spec_33; - float nh_34; - float diff_35; - vec3 h_36; - vec3 tmpvar_37; - tmpvar_37 = normalize ((lightDir_29 + viewDir_30)); - vec3 tmpvar_38; - tmpvar_38 = tmpvar_37; - h_36 = tmpvar_38; - float tmpvar_39; - tmpvar_39 = dot (s_28.Normal, lightDir_29); - float tmpvar_40; - tmpvar_40 = max (0.0, tmpvar_39); - float tmpvar_41; - tmpvar_41 = tmpvar_40; - diff_35 = tmpvar_41; - float tmpvar_42; - tmpvar_42 = dot (s_28.Normal, h_36); - float tmpvar_43; - tmpvar_43 = max (0.0, tmpvar_42); - float tmpvar_44; - tmpvar_44 = tmpvar_43; - nh_34 = tmpvar_44; - float tmpvar_45; - tmpvar_45 = pow (nh_34, (s_28.Specular * 128.0)); - float tmpvar_46; - tmpvar_46 = (tmpvar_45 * s_28.Gloss); - spec_33 = tmpvar_46; - vec3 tmpvar_47; - tmpvar_47 = ((( - (s_28.Albedo * _LightColor0.xyz) - * diff_35) + ( - (_LightColor0.xyz * _SpecColor.xyz) - * spec_33)) * (atten_31 * 2.0)); - c_32.xyz = tmpvar_47.xyz.xyz; - float tmpvar_48; - tmpvar_48 = (s_28.Alpha + (( - (_LightColor0.w * _SpecColor.w) - * spec_33) * atten_31)); - c_32.w = vec4(tmpvar_48).w; - return c_32; -} - -vec4 frag_surf ( - in v2f_surf IN_49 -) -{ - vec4 c_50; - vec3 lightDir_51; - SurfaceOutput o_52; - Input surfIN_53; - vec2 tmpvar_54; - tmpvar_54 = IN_49.hip_pack0.xy; - surfIN_53.uv_MainTex = tmpvar_54; - vec2 tmpvar_55; - tmpvar_55 = IN_49.hip_pack0.zw; - surfIN_53.uv_BumpMap = tmpvar_55; - vec3 tmpvar_56; - tmpvar_56 = vec3(0.0, 0.0, 0.0); - o_52.Albedo = tmpvar_56; - vec3 tmpvar_57; - tmpvar_57 = vec3(0.0, 0.0, 0.0); - o_52.Emission = tmpvar_57; - float tmpvar_58; - tmpvar_58 = 0.0; - o_52.Specular = tmpvar_58; - float tmpvar_59; - tmpvar_59 = 0.0; - o_52.Alpha = tmpvar_59; - float tmpvar_60; - tmpvar_60 = 0.0; - o_52.Gloss = tmpvar_60; - surf (surfIN_53, o_52); - vec3 tmpvar_61; - tmpvar_61 = IN_49.lightDir; - lightDir_51 = tmpvar_61; - vec3 tmpvar_62; - tmpvar_62 = normalize (lightDir_51); - vec3 tmpvar_63; - tmpvar_63 = tmpvar_62; - lightDir_51 = tmpvar_63; - vec3 tmpvar_64; - tmpvar_64 = IN_49.viewDir.xyz; - vec3 tmpvar_65; - tmpvar_65 = normalize (tmpvar_64); - float tmpvar_66; - tmpvar_66 = dot (IN_49._LightCoord, IN_49._LightCoord); - vec2 tmpvar_67; - tmpvar_67 = vec2(tmpvar_66); - vec2 tmpvar_68; - tmpvar_68 = tmpvar_67.xy; - vec4 tmpvar_69; - tmpvar_69 = texture2D (_LightTexture0, tmpvar_68); - vec4 tmpvar_70; - tmpvar_70 = LightingBlinnPhong (o_52, lightDir_51, tmpvar_65, tmpvar_69.w); - vec4 tmpvar_71; - tmpvar_71 = tmpvar_70; - c_50 = tmpvar_71; - float tmpvar_72; - tmpvar_72 = 0.0; - c_50.w = vec4(tmpvar_72).w; - return c_50; -} - -void main () -{ - v2f_surf xlt_IN_73; - vec4 xl_retval_74; - vec4 tmpvar_75; - tmpvar_75 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_73.pos = tmpvar_75; - float tmpvar_76; - tmpvar_76 = xlv_FOG.x; - xlt_IN_73.fog = tmpvar_76; - vec4 tmpvar_77; - tmpvar_77 = gl_TexCoord[0].xyzw; - vec4 tmpvar_78; - tmpvar_78 = tmpvar_77; - xlt_IN_73.hip_pack0 = tmpvar_78; - vec3 tmpvar_79; - tmpvar_79 = gl_TexCoord[1].xyz; - vec3 tmpvar_80; - tmpvar_80 = tmpvar_79; - xlt_IN_73.lightDir = tmpvar_80; - vec3 tmpvar_81; - tmpvar_81 = gl_TexCoord[2].xyz; - vec3 tmpvar_82; - tmpvar_82 = tmpvar_81; - xlt_IN_73.viewDir = tmpvar_82; - vec3 tmpvar_83; - tmpvar_83 = gl_TexCoord[3].xyz; - vec3 tmpvar_84; - tmpvar_84 = tmpvar_83; - xlt_IN_73._LightCoord = tmpvar_84; - vec4 tmpvar_85; - tmpvar_85 = frag_surf (xlt_IN_73); - vec4 tmpvar_86; - tmpvar_86 = tmpvar_85; - xl_retval_74 = tmpvar_86; - vec4 tmpvar_87; - tmpvar_87 = xl_retval_74.xyzw; - vec4 tmpvar_88; - tmpvar_88 = tmpvar_87; - gl_FragData[0] = tmpvar_88; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-out.txt index 41f842389..09234376a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-out.txt @@ -27,8 +27,8 @@ void main () vec4 tmpvar_8; tmpvar_8 = texture2D (_LightTexture0, vec2(dot (tmpvar_2, tmpvar_2))); vec4 c_9; - float tmpvar_10; - tmpvar_10 = (pow (max (0.0, + float spec_10; + spec_10 = (pow (max (0.0, dot (normal_6.xyz, normalize((tmpvar_7 + normalize(gl_TexCoord[2].xyz)))) ), (_Shininess * 128.0)) * tmpvar_5.w); c_9.xyz = ((( @@ -37,14 +37,25 @@ void main () max (0.0, dot (normal_6.xyz, tmpvar_7)) ) + ( (_LightColor0.xyz * _SpecColor.xyz) - * tmpvar_10)) * (tmpvar_8.w * 2.0)); - c_9.w = (((textureCube (_Cube, tmpvar_4) * tmpvar_5.w).w * _ReflectColor.w) + (( - (_LightColor0.w * _SpecColor.w) - * tmpvar_10) * tmpvar_8.w)); + * spec_10)) * (tmpvar_8.w * 2.0)); + c_9.w = (((textureCube (_Cube, tmpvar_4) * tmpvar_5.w).w * _ReflectColor.w) + ((_LightColor0.w * _SpecColor.w) * (spec_10 * tmpvar_8.w))); c_3.xyz = c_9.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } -// inputs: 1, stats: 34 alu 4 tex 0 flow +// stats: 34 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 5 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _ReflectColor (high float) 4x1 [-1] +// #3: _Shininess (high float) 1x1 [-1] +// #4: _SpecColor (high float) 4x1 [-1] +// textures: 4 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _Cube (high cube) 0x0 [-1] +// #2: _LightTexture0 (high 2d) 0x0 [-1] +// #3: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-ir.txt deleted file mode 100644 index 3f4c5e0d0..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-ir.txt +++ /dev/null @@ -1,189 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; - vec3 worldRefl; -}; -struct v2f_surf { - vec4 pos; - vec2 hip_pack0; - vec3 TtoV0; - vec3 TtoV1; - vec3 TtoV2; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform samplerCube _Cube; -uniform sampler2D _MainTex; -uniform vec4 _ReflectColor; -uniform float _Shininess; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -void surf ( - in Input IN_6, - inout SurfaceOutput o_7 -) -{ - vec4 reflcol_8; - vec3 worldRefl_9; - vec4 c_10; - vec4 tex_11; - vec4 tmpvar_12; - tmpvar_12 = texture2D (_MainTex, IN_6.uv_MainTex); - vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - tex_11 = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = (tex_11 * _Color); - c_10 = tmpvar_14; - vec3 tmpvar_15; - tmpvar_15 = c_10.xyz; - o_7.Albedo = tmpvar_15; - float tmpvar_16; - tmpvar_16 = tex_11.w; - o_7.Gloss = tmpvar_16; - float tmpvar_17; - tmpvar_17 = _Shininess; - o_7.Specular = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = texture2D (_BumpMap, IN_6.uv_BumpMap); - vec4 tmpvar_19; - tmpvar_19 = UnpackNormal (tmpvar_18); - vec3 tmpvar_20; - tmpvar_20 = tmpvar_19.xyz; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_20; - o_7.Normal = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = IN_6.worldRefl; - worldRefl_9 = tmpvar_22; - vec4 tmpvar_23; - tmpvar_23 = textureCube (_Cube, worldRefl_9); - vec4 tmpvar_24; - tmpvar_24 = tmpvar_23; - reflcol_8 = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25 = (reflcol_8 * tex_11.w); - reflcol_8 = tmpvar_25; - vec3 tmpvar_26; - tmpvar_26 = (reflcol_8.xyz * _ReflectColor.xyz); - o_7.Emission = tmpvar_26; - float tmpvar_27; - tmpvar_27 = (reflcol_8.w * _ReflectColor.w); - o_7.Alpha = tmpvar_27; -} - -vec4 frag_surf ( - in v2f_surf IN_28 -) -{ - vec4 res_29; - vec3 viewN_30; - SurfaceOutput o_31; - Input surfIN_32; - vec2 tmpvar_33; - tmpvar_33 = IN_28.hip_pack0.xy; - surfIN_32.uv_BumpMap = tmpvar_33; - vec3 tmpvar_34; - tmpvar_34 = vec3(0.0, 0.0, 0.0); - o_31.Albedo = tmpvar_34; - vec3 tmpvar_35; - tmpvar_35 = vec3(0.0, 0.0, 0.0); - o_31.Emission = tmpvar_35; - float tmpvar_36; - tmpvar_36 = 0.0; - o_31.Specular = tmpvar_36; - float tmpvar_37; - tmpvar_37 = 0.0; - o_31.Alpha = tmpvar_37; - float tmpvar_38; - tmpvar_38 = 0.0; - o_31.Gloss = tmpvar_38; - surf (surfIN_32, o_31); - float tmpvar_39; - tmpvar_39 = dot (IN_28.TtoV0, o_31.Normal); - float tmpvar_40; - tmpvar_40 = tmpvar_39; - viewN_30.x = tmpvar_40; - float tmpvar_41; - tmpvar_41 = dot (IN_28.TtoV1, o_31.Normal); - float tmpvar_42; - tmpvar_42 = tmpvar_41; - viewN_30.y = vec2(tmpvar_42).y; - float tmpvar_43; - tmpvar_43 = dot (IN_28.TtoV2, o_31.Normal); - float tmpvar_44; - tmpvar_44 = tmpvar_43; - viewN_30.z = vec3(tmpvar_44).z; - vec3 tmpvar_45; - tmpvar_45 = viewN_30; - o_31.Normal = tmpvar_45; - vec3 tmpvar_46; - tmpvar_46 = ((o_31.Normal * vec3(0.5, 0.5, -0.5)) + 0.5); - res_29.xyz = tmpvar_46.xyz.xyz; - float tmpvar_47; - tmpvar_47 = o_31.Specular; - res_29.w = vec4(tmpvar_47).w; - return res_29; -} - -void main () -{ - v2f_surf xlt_IN_48; - vec4 xl_retval_49; - vec4 tmpvar_50; - tmpvar_50 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_48.pos = tmpvar_50; - vec2 tmpvar_51; - tmpvar_51 = gl_TexCoord[0].xy; - vec2 tmpvar_52; - tmpvar_52 = tmpvar_51; - xlt_IN_48.hip_pack0 = tmpvar_52; - vec3 tmpvar_53; - tmpvar_53 = gl_TexCoord[1].xyz; - vec3 tmpvar_54; - tmpvar_54 = tmpvar_53; - xlt_IN_48.TtoV0 = tmpvar_54; - vec3 tmpvar_55; - tmpvar_55 = gl_TexCoord[2].xyz; - vec3 tmpvar_56; - tmpvar_56 = tmpvar_55; - xlt_IN_48.TtoV1 = tmpvar_56; - vec3 tmpvar_57; - tmpvar_57 = gl_TexCoord[3].xyz; - vec3 tmpvar_58; - tmpvar_58 = tmpvar_57; - xlt_IN_48.TtoV2 = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59 = frag_surf (xlt_IN_48); - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - xl_retval_49 = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61 = xl_retval_49.xyzw; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - gl_FragData[0] = tmpvar_62; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-out.txt index eabd6df20..0d855bd46 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-out.txt @@ -18,4 +18,10 @@ void main () } -// inputs: 1, stats: 12 alu 1 tex 0 flow +// stats: 12 alu 1 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 1 (total size: 0) +// #0: _Shininess (high float) 1x1 [-1] +// textures: 1 +// #0: _BumpMap (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-ir.txt deleted file mode 100644 index cf0d31ff2..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-ir.txt +++ /dev/null @@ -1,253 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; - vec3 worldRefl; - vec3 TtoW0; - vec3 TtoW1; - vec3 TtoW2; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec4 hip_screen; - vec4 TtoW0; - vec4 TtoW1; - vec4 TtoW2; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform samplerCube _Cube; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform vec4 _ReflectColor; -uniform float _Shininess; -uniform vec4 _SpecColor; -uniform vec4 unity_Ambient; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -void surf ( - in Input IN_6, - inout SurfaceOutput o_7 -) -{ - vec4 reflcol_8; - vec3 worldRefl_9; - vec4 c_10; - vec4 tex_11; - vec4 tmpvar_12; - tmpvar_12 = texture2D (_MainTex, IN_6.uv_MainTex); - vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - tex_11 = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = (tex_11 * _Color); - c_10 = tmpvar_14; - vec3 tmpvar_15; - tmpvar_15 = c_10.xyz; - o_7.Albedo = tmpvar_15; - float tmpvar_16; - tmpvar_16 = tex_11.w; - o_7.Gloss = tmpvar_16; - float tmpvar_17; - tmpvar_17 = _Shininess; - o_7.Specular = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = texture2D (_BumpMap, IN_6.uv_BumpMap); - vec4 tmpvar_19; - tmpvar_19 = UnpackNormal (tmpvar_18); - vec3 tmpvar_20; - tmpvar_20 = tmpvar_19.xyz; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_20; - o_7.Normal = tmpvar_21; - float tmpvar_22; - tmpvar_22 = dot (IN_6.TtoW0, o_7.Normal); - float tmpvar_23; - tmpvar_23 = dot (IN_6.TtoW1, o_7.Normal); - float tmpvar_24; - tmpvar_24 = dot (IN_6.TtoW2, o_7.Normal); - vec3 tmpvar_25; - tmpvar_25.x = tmpvar_22; - tmpvar_25.y = tmpvar_23; - tmpvar_25.z = tmpvar_24; - vec3 tmpvar_26; - tmpvar_26 = reflect (IN_6.worldRefl, tmpvar_25); - vec3 tmpvar_27; - tmpvar_27 = tmpvar_26; - worldRefl_9 = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = textureCube (_Cube, worldRefl_9); - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - reflcol_8 = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = (reflcol_8 * tex_11.w); - reflcol_8 = tmpvar_30; - vec3 tmpvar_31; - tmpvar_31 = (reflcol_8.xyz * _ReflectColor.xyz); - o_7.Emission = tmpvar_31; - float tmpvar_32; - tmpvar_32 = (reflcol_8.w * _ReflectColor.w); - o_7.Alpha = tmpvar_32; -} - -vec4 LightingBlinnPhong_PrePass ( - in SurfaceOutput s_33, - in vec4 light_34 -) -{ - vec4 c_35; - float spec_36; - float tmpvar_37; - tmpvar_37 = (light_34.w * s_33.Gloss); - spec_36 = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = ((s_33.Albedo * light_34.xyz) + ((light_34.xyz * _SpecColor.xyz) * spec_36)); - c_35.xyz = tmpvar_38.xyz.xyz; - float tmpvar_39; - tmpvar_39 = (s_33.Alpha + (spec_36 * _SpecColor.w)); - c_35.w = vec4(tmpvar_39).w; - return c_35; -} - -vec4 frag_surf ( - in v2f_surf IN_40 -) -{ - vec4 col_41; - vec4 light_42; - SurfaceOutput o_43; - Input surfIN_44; - vec2 tmpvar_45; - tmpvar_45 = IN_40.hip_pack0.xy; - surfIN_44.uv_MainTex = tmpvar_45; - vec2 tmpvar_46; - tmpvar_46 = IN_40.hip_pack0.zw; - surfIN_44.uv_BumpMap = tmpvar_46; - vec3 tmpvar_47; - tmpvar_47.x = IN_40.TtoW0.w; - tmpvar_47.y = IN_40.TtoW1.w; - tmpvar_47.z = IN_40.TtoW2.w; - vec3 tmpvar_48; - tmpvar_48 = tmpvar_47; - surfIN_44.worldRefl = tmpvar_48; - vec3 tmpvar_49; - tmpvar_49 = IN_40.TtoW0.xyz; - surfIN_44.TtoW0 = tmpvar_49; - vec3 tmpvar_50; - tmpvar_50 = IN_40.TtoW1.xyz; - surfIN_44.TtoW1 = tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = IN_40.TtoW2.xyz; - surfIN_44.TtoW2 = tmpvar_51; - vec3 tmpvar_52; - tmpvar_52 = vec3(0.0, 0.0, 0.0); - o_43.Albedo = tmpvar_52; - vec3 tmpvar_53; - tmpvar_53 = vec3(0.0, 0.0, 0.0); - o_43.Emission = tmpvar_53; - float tmpvar_54; - tmpvar_54 = 0.0; - o_43.Specular = tmpvar_54; - float tmpvar_55; - tmpvar_55 = 0.0; - o_43.Alpha = tmpvar_55; - float tmpvar_56; - tmpvar_56 = 0.0; - o_43.Gloss = tmpvar_56; - surf (surfIN_44, o_43); - vec4 tmpvar_57; - tmpvar_57 = texture2DProj (_LightBuffer, IN_40.hip_screen); - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - light_42 = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59 = log2 (light_42); - vec4 tmpvar_60; - tmpvar_60 = -(tmpvar_59); - light_42 = tmpvar_60; - vec3 tmpvar_61; - tmpvar_61 = (light_42.xyz + unity_Ambient.xyz); - light_42.xyz = tmpvar_61.xyz.xyz; - vec4 tmpvar_62; - tmpvar_62 = LightingBlinnPhong_PrePass (o_43, light_42); - vec4 tmpvar_63; - tmpvar_63 = tmpvar_62; - col_41 = tmpvar_63; - vec3 tmpvar_64; - tmpvar_64 = (col_41.xyz + o_43.Emission); - col_41.xyz = tmpvar_64.xyz.xyz; - return col_41; -} - -void main () -{ - v2f_surf xlt_IN_65; - vec4 xl_retval_66; - vec4 tmpvar_67; - tmpvar_67 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_65.pos = tmpvar_67; - float tmpvar_68; - tmpvar_68 = xlv_FOG.x; - xlt_IN_65.fog = tmpvar_68; - vec4 tmpvar_69; - tmpvar_69 = gl_TexCoord[0].xyzw; - vec4 tmpvar_70; - tmpvar_70 = tmpvar_69; - xlt_IN_65.hip_pack0 = tmpvar_70; - vec4 tmpvar_71; - tmpvar_71 = gl_TexCoord[1].xyzw; - vec4 tmpvar_72; - tmpvar_72 = tmpvar_71; - xlt_IN_65.hip_screen = tmpvar_72; - vec4 tmpvar_73; - tmpvar_73 = gl_TexCoord[2].xyzw; - vec4 tmpvar_74; - tmpvar_74 = tmpvar_73; - xlt_IN_65.TtoW0 = tmpvar_74; - vec4 tmpvar_75; - tmpvar_75 = gl_TexCoord[3].xyzw; - vec4 tmpvar_76; - tmpvar_76 = tmpvar_75; - xlt_IN_65.TtoW1 = tmpvar_76; - vec4 tmpvar_77; - tmpvar_77 = gl_TexCoord[4].xyzw; - vec4 tmpvar_78; - tmpvar_78 = tmpvar_77; - xlt_IN_65.TtoW2 = tmpvar_78; - vec4 tmpvar_79; - tmpvar_79 = frag_surf (xlt_IN_65); - vec4 tmpvar_80; - tmpvar_80 = tmpvar_79; - xl_retval_66 = tmpvar_80; - vec4 tmpvar_81; - tmpvar_81 = xl_retval_66.xyzw; - vec4 tmpvar_82; - tmpvar_82 = tmpvar_81; - gl_FragData[0] = tmpvar_82; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-out.txt index 2e874586c..db6a67a3c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-out.txt @@ -22,34 +22,44 @@ void main () tmpvar_7.x = tmpvar_2.w; tmpvar_7.y = tmpvar_3.w; tmpvar_7.z = tmpvar_4.w; - vec4 tmpvar_8; - tmpvar_8 = texture2D (_MainTex, tmpvar_1.xy); - vec4 normal_9; - normal_9.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0); - normal_9.z = sqrt(((1.0 - - (normal_9.x * normal_9.x) - ) - (normal_9.y * normal_9.y))); - vec3 tmpvar_10; - tmpvar_10.x = dot (tmpvar_2.xyz, normal_9.xyz); - tmpvar_10.y = dot (tmpvar_3.xyz, normal_9.xyz); - tmpvar_10.z = dot (tmpvar_4.xyz, normal_9.xyz); - vec4 tmpvar_11; - tmpvar_11 = (textureCube (_Cube, (tmpvar_7 - (2.0 * - (dot (tmpvar_10, tmpvar_7) * tmpvar_10) - ))) * tmpvar_8.w); - vec4 tmpvar_12; - tmpvar_12 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); - light_6.w = tmpvar_12.w; - light_6.xyz = (tmpvar_12.xyz + unity_Ambient.xyz); - vec4 c_13; - float tmpvar_14; - tmpvar_14 = (tmpvar_12.w * tmpvar_8.w); - c_13.xyz = (((tmpvar_8 * _Color).xyz * light_6.xyz) + ((light_6.xyz * _SpecColor.xyz) * tmpvar_14)); - c_13.w = ((tmpvar_11.w * _ReflectColor.w) + (tmpvar_14 * _SpecColor.w)); - col_5.w = c_13.w; - col_5.xyz = (c_13.xyz + (tmpvar_11.xyz * _ReflectColor.xyz)); + vec4 reflcol_8; + vec4 tmpvar_9; + tmpvar_9 = texture2D (_MainTex, tmpvar_1.xy); + vec4 normal_10; + normal_10.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0); + normal_10.z = sqrt(((1.0 - + (normal_10.x * normal_10.x) + ) - (normal_10.y * normal_10.y))); + vec3 tmpvar_11; + tmpvar_11.x = dot (tmpvar_2.xyz, normal_10.xyz); + tmpvar_11.y = dot (tmpvar_3.xyz, normal_10.xyz); + tmpvar_11.z = dot (tmpvar_4.xyz, normal_10.xyz); + reflcol_8 = (textureCube (_Cube, (tmpvar_7 - (2.0 * + (dot (tmpvar_11, tmpvar_7) * tmpvar_11) + ))) * tmpvar_9.w); + light_6 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); + light_6.xyz = (light_6.xyz + unity_Ambient.xyz); + vec4 c_12; + float spec_13; + spec_13 = (light_6.w * tmpvar_9.w); + c_12.xyz = (((tmpvar_9 * _Color).xyz * light_6.xyz) + ((light_6.xyz * _SpecColor.xyz) * spec_13)); + c_12.w = ((reflcol_8.w * _ReflectColor.w) + (spec_13 * _SpecColor.w)); + col_5.w = c_12.w; + col_5.xyz = (c_12.xyz + (reflcol_8.xyz * _ReflectColor.xyz)); gl_FragData[0] = col_5; } -// inputs: 1, stats: 29 alu 4 tex 0 flow +// stats: 29 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [5] loc 4 +// uniforms: 4 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _ReflectColor (high float) 4x1 [-1] +// #2: _SpecColor (high float) 4x1 [-1] +// #3: unity_Ambient (high float) 4x1 [-1] +// textures: 4 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _Cube (high cube) 0x0 [-1] +// #2: _LightBuffer (high 2d) 0x0 [-1] +// #3: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-ir.txt deleted file mode 100644 index 7701c7690..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-ir.txt +++ /dev/null @@ -1,139 +0,0 @@ -struct v2f { - vec4 pos; - float fog; - vec2 uv; - vec2 uv2; - vec3 I; - vec3 TtoW0; - vec3 TtoW1; - vec3 TtoW2; -}; -uniform sampler2D _BumpMap; -uniform samplerCube _Cube; -uniform sampler2D _MainTex; -uniform vec4 _ReflectColor; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -vec4 frag ( - in v2f i_6 -) -{ - vec4 reflcolor_7; - vec4 c_8; - vec3 r_9; - vec3 wn_10; - vec4 texcol_11; - vec4 normal_12; - vec4 tmpvar_13; - tmpvar_13 = texture2D (_BumpMap, i_6.uv2); - vec4 tmpvar_14; - tmpvar_14 = UnpackNormal (tmpvar_13); - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - normal_12 = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = texture2D (_MainTex, i_6.uv); - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - texcol_11 = tmpvar_17; - float tmpvar_18; - tmpvar_18 = dot (i_6.TtoW0, normal_12.xyz); - float tmpvar_19; - tmpvar_19 = tmpvar_18; - wn_10.x = tmpvar_19; - float tmpvar_20; - tmpvar_20 = dot (i_6.TtoW1, normal_12.xyz); - float tmpvar_21; - tmpvar_21 = tmpvar_20; - wn_10.y = vec2(tmpvar_21).y; - float tmpvar_22; - tmpvar_22 = dot (i_6.TtoW2, normal_12.xyz); - float tmpvar_23; - tmpvar_23 = tmpvar_22; - wn_10.z = vec3(tmpvar_23).z; - vec3 tmpvar_24; - tmpvar_24 = reflect (i_6.I, wn_10); - vec3 tmpvar_25; - tmpvar_25 = tmpvar_24; - r_9 = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = (gl_LightModel.ambient * texcol_11); - c_8 = tmpvar_26; - vec3 tmpvar_27; - tmpvar_27 = (c_8.xyz * 2.0); - c_8.xyz = tmpvar_27.xyz.xyz; - vec4 tmpvar_28; - tmpvar_28 = textureCube (_Cube, r_9); - vec4 tmpvar_29; - tmpvar_29 = ((tmpvar_28 * _ReflectColor) * texcol_11.w); - reflcolor_7 = tmpvar_29; - return (c_8 + reflcolor_7); -} - -void main () -{ - v2f xlt_i_30; - vec4 xl_retval_31; - vec4 tmpvar_32; - tmpvar_32 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_30.pos = tmpvar_32; - float tmpvar_33; - tmpvar_33 = xlv_FOG.x; - xlt_i_30.fog = tmpvar_33; - vec2 tmpvar_34; - tmpvar_34 = gl_TexCoord[0].xy; - vec2 tmpvar_35; - tmpvar_35 = tmpvar_34; - xlt_i_30.uv = tmpvar_35; - vec2 tmpvar_36; - tmpvar_36 = gl_TexCoord[1].xy; - vec2 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlt_i_30.uv2 = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = gl_TexCoord[2].xyz; - vec3 tmpvar_39; - tmpvar_39 = tmpvar_38; - xlt_i_30.I = tmpvar_39; - vec3 tmpvar_40; - tmpvar_40 = gl_TexCoord[3].xyz; - vec3 tmpvar_41; - tmpvar_41 = tmpvar_40; - xlt_i_30.TtoW0 = tmpvar_41; - vec3 tmpvar_42; - tmpvar_42 = gl_TexCoord[4].xyz; - vec3 tmpvar_43; - tmpvar_43 = tmpvar_42; - xlt_i_30.TtoW1 = tmpvar_43; - vec3 tmpvar_44; - tmpvar_44 = gl_TexCoord[5].xyz; - vec3 tmpvar_45; - tmpvar_45 = tmpvar_44; - xlt_i_30.TtoW2 = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46 = frag (xlt_i_30); - vec4 tmpvar_47; - tmpvar_47 = tmpvar_46; - xl_retval_31 = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48 = xl_retval_31.xyzw; - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - gl_FragData[0] = tmpvar_49; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-out.txt index a4f2b3d37..1aadd153d 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-out.txt @@ -18,14 +18,21 @@ void main () wn_3.x = dot (gl_TexCoord[3].xyz, normal_4.xyz); wn_3.y = dot (gl_TexCoord[4].xyz, normal_4.xyz); wn_3.z = dot (gl_TexCoord[5].xyz, normal_4.xyz); - vec4 tmpvar_6; - tmpvar_6 = (gl_LightModel.ambient * tmpvar_5); - c_2.w = tmpvar_6.w; - c_2.xyz = (tmpvar_6.xyz * 2.0); + c_2 = (gl_LightModel.ambient * tmpvar_5); + c_2.xyz = (c_2.xyz * 2.0); gl_FragData[0] = (c_2 + ((textureCube (_Cube, (tmpvar_1 - (2.0 * (dot (wn_3, tmpvar_1) * wn_3))) ) * _ReflectColor) * tmpvar_5.w)); } -// inputs: 1, stats: 19 alu 3 tex 0 flow +// stats: 19 alu 3 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [6] loc 4 +// uniforms: 2 (total size: 0) +// #0: gl_LightModel (high other) 0x0 [-1] +// #1: _ReflectColor (high float) 4x1 [-1] +// textures: 3 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _Cube (high cube) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-ir.txt deleted file mode 100644 index f8aa39ecc..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-ir.txt +++ /dev/null @@ -1,208 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec3 worldRefl; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec4 _LightCoord; -}; -uniform vec4 _Color; -uniform samplerCube _Cube; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -uniform vec4 _ReflectColor; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 reflcol_3; - vec4 c_4; - vec4 tex_5; - vec4 tmpvar_6; - tmpvar_6 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - tex_5 = tmpvar_7; - vec4 tmpvar_8; - tmpvar_8 = (tex_5 * _Color); - c_4 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = c_4.xyz; - o_2.Albedo = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10 = textureCube (_Cube, IN_1.worldRefl); - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - reflcol_3 = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12 = (reflcol_3 * tex_5.w); - reflcol_3 = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13 = (reflcol_3.xyz * _ReflectColor.xyz); - o_2.Emission = tmpvar_13; - float tmpvar_14; - tmpvar_14 = (reflcol_3.w * _ReflectColor.w); - o_2.Alpha = tmpvar_14; -} - -float UnitySpotCookie ( - in vec4 LightCoord_15 -) -{ - vec4 tmpvar_16; - tmpvar_16 = texture2D (_LightTexture0, ((LightCoord_15.xy / LightCoord_15.w) + 0.5)); - return tmpvar_16.w; -} - -float UnitySpotAttenuate ( - in vec3 LightCoord_17 -) -{ - float tmpvar_18; - tmpvar_18 = dot (LightCoord_17, LightCoord_17); - vec2 tmpvar_19; - tmpvar_19 = vec2(tmpvar_18); - vec2 tmpvar_20; - tmpvar_20 = tmpvar_19.xy; - vec4 tmpvar_21; - tmpvar_21 = texture2D (_LightTextureB0, tmpvar_20); - return tmpvar_21.w; -} - -vec4 LightingLambert ( - in SurfaceOutput s_22, - in vec3 lightDir_23, - in float atten_24 -) -{ - vec4 c_25; - float diff_26; - float tmpvar_27; - tmpvar_27 = dot (s_22.Normal, lightDir_23); - float tmpvar_28; - tmpvar_28 = max (0.0, tmpvar_27); - float tmpvar_29; - tmpvar_29 = tmpvar_28; - diff_26 = tmpvar_29; - vec3 tmpvar_30; - tmpvar_30 = ((s_22.Albedo * _LightColor0.xyz) * ((diff_26 * atten_24) * 2.0)); - c_25.xyz = tmpvar_30.xyz.xyz; - float tmpvar_31; - tmpvar_31 = s_22.Alpha; - c_25.w = vec4(tmpvar_31).w; - return c_25; -} - -vec4 frag_surf ( - in v2f_surf IN_32 -) -{ - vec4 c_33; - vec3 lightDir_34; - SurfaceOutput o_35; - Input surfIN_36; - vec2 tmpvar_37; - tmpvar_37 = IN_32.hip_pack0.xy; - surfIN_36.uv_MainTex = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = vec3(0.0, 0.0, 0.0); - o_35.Albedo = tmpvar_38; - vec3 tmpvar_39; - tmpvar_39 = vec3(0.0, 0.0, 0.0); - o_35.Emission = tmpvar_39; - float tmpvar_40; - tmpvar_40 = 0.0; - o_35.Specular = tmpvar_40; - float tmpvar_41; - tmpvar_41 = 0.0; - o_35.Alpha = tmpvar_41; - float tmpvar_42; - tmpvar_42 = 0.0; - o_35.Gloss = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = IN_32.normal; - o_35.Normal = tmpvar_43; - surf (surfIN_36, o_35); - vec3 tmpvar_44; - tmpvar_44 = IN_32.lightDir; - lightDir_34 = tmpvar_44; - vec3 tmpvar_45; - tmpvar_45 = normalize (lightDir_34); - vec3 tmpvar_46; - tmpvar_46 = tmpvar_45; - lightDir_34 = tmpvar_46; - float tmpvar_47; - tmpvar_47 = UnitySpotCookie (IN_32._LightCoord); - float tmpvar_48; - tmpvar_48 = UnitySpotAttenuate (IN_32._LightCoord.xyz); - vec4 tmpvar_49; - tmpvar_49 = LightingLambert (o_35, lightDir_34, ((float( - (IN_32._LightCoord.z > 0.0) - ) * tmpvar_47) * tmpvar_48)); - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - c_33 = tmpvar_50; - float tmpvar_51; - tmpvar_51 = 0.0; - c_33.w = vec4(tmpvar_51).w; - return c_33; -} - -void main () -{ - v2f_surf xlt_IN_52; - vec4 xl_retval_53; - vec4 tmpvar_54; - tmpvar_54 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_52.pos = tmpvar_54; - float tmpvar_55; - tmpvar_55 = xlv_FOG.x; - xlt_IN_52.fog = tmpvar_55; - vec2 tmpvar_56; - tmpvar_56 = gl_TexCoord[0].xy; - vec2 tmpvar_57; - tmpvar_57 = tmpvar_56; - xlt_IN_52.hip_pack0 = tmpvar_57; - vec3 tmpvar_58; - tmpvar_58 = gl_TexCoord[1].xyz; - vec3 tmpvar_59; - tmpvar_59 = tmpvar_58; - xlt_IN_52.normal = tmpvar_59; - vec3 tmpvar_60; - tmpvar_60 = gl_TexCoord[2].xyz; - vec3 tmpvar_61; - tmpvar_61 = tmpvar_60; - xlt_IN_52.lightDir = tmpvar_61; - vec4 tmpvar_62; - tmpvar_62 = gl_TexCoord[3].xyzw; - vec4 tmpvar_63; - tmpvar_63 = tmpvar_62; - xlt_IN_52._LightCoord = tmpvar_63; - vec4 tmpvar_64; - tmpvar_64 = frag_surf (xlt_IN_52); - vec4 tmpvar_65; - tmpvar_65 = tmpvar_64; - xl_retval_53 = tmpvar_65; - vec4 tmpvar_66; - tmpvar_66 = xl_retval_53.xyzw; - vec4 tmpvar_67; - tmpvar_67 = tmpvar_66; - gl_FragData[0] = tmpvar_67; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-out.txt index df9c84aa6..bb3b16efb 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-out.txt @@ -26,4 +26,15 @@ void main () } -// inputs: 1, stats: 18 alu 4 tex 0 flow +// stats: 18 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 3 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _ReflectColor (high float) 4x1 [-1] +// textures: 4 +// #0: _Cube (high cube) 0x0 [-1] +// #1: _LightTexture0 (high 2d) 0x0 [-1] +// #2: _LightTextureB0 (high 2d) 0x0 [-1] +// #3: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-ir.txt deleted file mode 100644 index 09c5a6efe..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-ir.txt +++ /dev/null @@ -1,167 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec3 worldRefl; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 worldRefl; - vec4 hip_screen; -}; -uniform vec4 _Color; -uniform samplerCube _Cube; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform vec4 _ReflectColor; -uniform vec4 unity_Ambient; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 reflcol_3; - vec4 c_4; - vec4 tex_5; - vec4 tmpvar_6; - tmpvar_6 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - tex_5 = tmpvar_7; - vec4 tmpvar_8; - tmpvar_8 = (tex_5 * _Color); - c_4 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = c_4.xyz; - o_2.Albedo = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10 = textureCube (_Cube, IN_1.worldRefl); - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - reflcol_3 = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12 = (reflcol_3 * tex_5.w); - reflcol_3 = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13 = (reflcol_3.xyz * _ReflectColor.xyz); - o_2.Emission = tmpvar_13; - float tmpvar_14; - tmpvar_14 = (reflcol_3.w * _ReflectColor.w); - o_2.Alpha = tmpvar_14; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_15, - in vec4 light_16 -) -{ - vec4 c_17; - vec3 tmpvar_18; - tmpvar_18 = (s_15.Albedo * light_16.xyz); - c_17.xyz = tmpvar_18.xyz.xyz; - float tmpvar_19; - tmpvar_19 = s_15.Alpha; - c_17.w = vec4(tmpvar_19).w; - return c_17; -} - -vec4 frag_surf ( - in v2f_surf IN_20 -) -{ - vec4 col_21; - vec4 light_22; - SurfaceOutput o_23; - Input surfIN_24; - vec2 tmpvar_25; - tmpvar_25 = IN_20.hip_pack0.xy; - surfIN_24.uv_MainTex = tmpvar_25; - vec3 tmpvar_26; - tmpvar_26 = IN_20.worldRefl; - surfIN_24.worldRefl = tmpvar_26; - vec3 tmpvar_27; - tmpvar_27 = vec3(0.0, 0.0, 0.0); - o_23.Albedo = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = vec3(0.0, 0.0, 0.0); - o_23.Emission = tmpvar_28; - float tmpvar_29; - tmpvar_29 = 0.0; - o_23.Specular = tmpvar_29; - float tmpvar_30; - tmpvar_30 = 0.0; - o_23.Alpha = tmpvar_30; - float tmpvar_31; - tmpvar_31 = 0.0; - o_23.Gloss = tmpvar_31; - surf (surfIN_24, o_23); - vec4 tmpvar_32; - tmpvar_32 = texture2DProj (_LightBuffer, IN_20.hip_screen); - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - light_22 = tmpvar_33; - vec4 tmpvar_34; - tmpvar_34 = log2 (light_22); - vec4 tmpvar_35; - tmpvar_35 = -(tmpvar_34); - light_22 = tmpvar_35; - vec3 tmpvar_36; - tmpvar_36 = (light_22.xyz + unity_Ambient.xyz); - light_22.xyz = tmpvar_36.xyz.xyz; - vec4 tmpvar_37; - tmpvar_37 = LightingLambert_PrePass (o_23, light_22); - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - col_21 = tmpvar_38; - vec3 tmpvar_39; - tmpvar_39 = (col_21.xyz + o_23.Emission); - col_21.xyz = tmpvar_39.xyz.xyz; - return col_21; -} - -void main () -{ - v2f_surf xlt_IN_40; - vec4 xl_retval_41; - vec4 tmpvar_42; - tmpvar_42 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_40.pos = tmpvar_42; - float tmpvar_43; - tmpvar_43 = xlv_FOG.x; - xlt_IN_40.fog = tmpvar_43; - vec2 tmpvar_44; - tmpvar_44 = gl_TexCoord[0].xy; - vec2 tmpvar_45; - tmpvar_45 = tmpvar_44; - xlt_IN_40.hip_pack0 = tmpvar_45; - vec3 tmpvar_46; - tmpvar_46 = gl_TexCoord[1].xyz; - vec3 tmpvar_47; - tmpvar_47 = tmpvar_46; - xlt_IN_40.worldRefl = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48 = gl_TexCoord[2].xyzw; - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - xlt_IN_40.hip_screen = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50 = frag_surf (xlt_IN_40); - vec4 tmpvar_51; - tmpvar_51 = tmpvar_50; - xl_retval_41 = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = xl_retval_41.xyzw; - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - gl_FragData[0] = tmpvar_53; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-out.txt index 1e5a91d8a..b83c76fd5 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-out.txt @@ -8,21 +8,29 @@ void main () { vec4 col_1; vec4 light_2; - vec4 tmpvar_3; - tmpvar_3 = texture2D (_MainTex, gl_TexCoord[0].xy); + vec4 reflcol_3; vec4 tmpvar_4; - tmpvar_4 = (textureCube (_Cube, gl_TexCoord[1].xyz) * tmpvar_3.w); - vec4 tmpvar_5; - tmpvar_5 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2]))); - light_2.w = tmpvar_5.w; - light_2.xyz = (tmpvar_5.xyz + unity_Ambient.xyz); - vec4 c_6; - c_6.xyz = ((tmpvar_3 * _Color).xyz * light_2.xyz); - c_6.w = (tmpvar_4.w * _ReflectColor.w); - col_1.w = c_6.w; - col_1.xyz = (c_6.xyz + (tmpvar_4.xyz * _ReflectColor.xyz)); + tmpvar_4 = texture2D (_MainTex, gl_TexCoord[0].xy); + reflcol_3 = (textureCube (_Cube, gl_TexCoord[1].xyz) * tmpvar_4.w); + light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2]))); + light_2.xyz = (light_2.xyz + unity_Ambient.xyz); + vec4 c_5; + c_5.xyz = ((tmpvar_4 * _Color).xyz * light_2.xyz); + c_5.w = (reflcol_3.w * _ReflectColor.w); + col_1.w = c_5.w; + col_1.xyz = (c_5.xyz + (reflcol_3.xyz * _ReflectColor.xyz)); gl_FragData[0] = col_1; } -// inputs: 1, stats: 9 alu 3 tex 0 flow +// stats: 9 alu 3 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 3 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _ReflectColor (high float) 4x1 [-1] +// #2: unity_Ambient (high float) 4x1 [-1] +// textures: 3 +// #0: _Cube (high cube) 0x0 [-1] +// #1: _LightBuffer (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-ir.txt deleted file mode 100644 index 4c743aeb7..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-ir.txt +++ /dev/null @@ -1,284 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; - vec3 worldRefl; - vec3 viewDir; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec3 lightDir; - vec4 _LightCoord; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform samplerCube _Cube; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -uniform float _Parallax; -uniform sampler2D _ParallaxMap; -uniform vec4 _ReflectColor; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -vec2 ParallaxOffset ( - in float h_6, - in float height_7, - in vec3 viewDir_8 -) -{ - vec3 v_9; - float tmpvar_10; - tmpvar_10 = ((h_6 * height_7) - (height_7 / 2.0)); - h_6 = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = normalize (viewDir_8); - vec3 tmpvar_12; - tmpvar_12 = tmpvar_11; - v_9 = tmpvar_12; - float tmpvar_13; - tmpvar_13 = (v_9.z + 0.42); - v_9.z = vec3(tmpvar_13).z; - return (h_6 * (v_9.xy / v_9.z)); -} - -void surf ( - in Input IN_14, - inout SurfaceOutput o_15 -) -{ - vec4 reflcol_16; - vec3 worldRefl_17; - vec4 c_18; - vec4 tex_19; - vec2 offset_20; - float h_21; - vec4 tmpvar_22; - tmpvar_22 = texture2D (_ParallaxMap, IN_14.uv_BumpMap); - float tmpvar_23; - tmpvar_23 = tmpvar_22.w; - h_21 = tmpvar_23; - vec2 tmpvar_24; - tmpvar_24 = ParallaxOffset (h_21, _Parallax, IN_14.viewDir); - vec2 tmpvar_25; - tmpvar_25 = tmpvar_24; - offset_20 = tmpvar_25; - vec2 tmpvar_26; - tmpvar_26 = (IN_14.uv_MainTex + offset_20); - IN_14.uv_MainTex = tmpvar_26; - vec2 tmpvar_27; - tmpvar_27 = (IN_14.uv_BumpMap + offset_20); - IN_14.uv_BumpMap = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = texture2D (_MainTex, IN_14.uv_MainTex); - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - tex_19 = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = (tex_19 * _Color); - c_18 = tmpvar_30; - vec3 tmpvar_31; - tmpvar_31 = c_18.xyz; - o_15.Albedo = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = texture2D (_BumpMap, IN_14.uv_BumpMap); - vec4 tmpvar_33; - tmpvar_33 = UnpackNormal (tmpvar_32); - vec3 tmpvar_34; - tmpvar_34 = tmpvar_33.xyz; - vec3 tmpvar_35; - tmpvar_35 = tmpvar_34; - o_15.Normal = tmpvar_35; - vec3 tmpvar_36; - tmpvar_36 = IN_14.worldRefl; - worldRefl_17 = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37 = textureCube (_Cube, worldRefl_17); - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - reflcol_16 = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = (reflcol_16 * tex_19.w); - reflcol_16 = tmpvar_39; - vec3 tmpvar_40; - tmpvar_40 = (reflcol_16.xyz * _ReflectColor.xyz); - o_15.Emission = tmpvar_40; - float tmpvar_41; - tmpvar_41 = (reflcol_16.w * _ReflectColor.w); - o_15.Alpha = tmpvar_41; -} - -float UnitySpotCookie ( - in vec4 LightCoord_42 -) -{ - vec4 tmpvar_43; - tmpvar_43 = texture2D (_LightTexture0, ((LightCoord_42.xy / LightCoord_42.w) + 0.5)); - return tmpvar_43.w; -} - -float UnitySpotAttenuate ( - in vec3 LightCoord_44 -) -{ - float tmpvar_45; - tmpvar_45 = dot (LightCoord_44, LightCoord_44); - vec2 tmpvar_46; - tmpvar_46 = vec2(tmpvar_45); - vec2 tmpvar_47; - tmpvar_47 = tmpvar_46.xy; - vec4 tmpvar_48; - tmpvar_48 = texture2D (_LightTextureB0, tmpvar_47); - return tmpvar_48.w; -} - -vec4 LightingLambert ( - in SurfaceOutput s_49, - in vec3 lightDir_50, - in float atten_51 -) -{ - vec4 c_52; - float diff_53; - float tmpvar_54; - tmpvar_54 = dot (s_49.Normal, lightDir_50); - float tmpvar_55; - tmpvar_55 = max (0.0, tmpvar_54); - float tmpvar_56; - tmpvar_56 = tmpvar_55; - diff_53 = tmpvar_56; - vec3 tmpvar_57; - tmpvar_57 = ((s_49.Albedo * _LightColor0.xyz) * ((diff_53 * atten_51) * 2.0)); - c_52.xyz = tmpvar_57.xyz.xyz; - float tmpvar_58; - tmpvar_58 = s_49.Alpha; - c_52.w = vec4(tmpvar_58).w; - return c_52; -} - -vec4 frag_surf ( - in v2f_surf IN_59 -) -{ - vec4 c_60; - vec3 lightDir_61; - SurfaceOutput o_62; - Input surfIN_63; - vec2 tmpvar_64; - tmpvar_64 = IN_59.hip_pack0.xy; - surfIN_63.uv_MainTex = tmpvar_64; - vec2 tmpvar_65; - tmpvar_65 = IN_59.hip_pack0.zw; - surfIN_63.uv_BumpMap = tmpvar_65; - vec3 tmpvar_66; - tmpvar_66 = IN_59.viewDir; - surfIN_63.viewDir = tmpvar_66; - vec3 tmpvar_67; - tmpvar_67 = vec3(0.0, 0.0, 0.0); - o_62.Albedo = tmpvar_67; - vec3 tmpvar_68; - tmpvar_68 = vec3(0.0, 0.0, 0.0); - o_62.Emission = tmpvar_68; - float tmpvar_69; - tmpvar_69 = 0.0; - o_62.Specular = tmpvar_69; - float tmpvar_70; - tmpvar_70 = 0.0; - o_62.Alpha = tmpvar_70; - float tmpvar_71; - tmpvar_71 = 0.0; - o_62.Gloss = tmpvar_71; - surf (surfIN_63, o_62); - vec3 tmpvar_72; - tmpvar_72 = IN_59.lightDir; - lightDir_61 = tmpvar_72; - vec3 tmpvar_73; - tmpvar_73 = normalize (lightDir_61); - vec3 tmpvar_74; - tmpvar_74 = tmpvar_73; - lightDir_61 = tmpvar_74; - float tmpvar_75; - tmpvar_75 = UnitySpotCookie (IN_59._LightCoord); - float tmpvar_76; - tmpvar_76 = UnitySpotAttenuate (IN_59._LightCoord.xyz); - vec4 tmpvar_77; - tmpvar_77 = LightingLambert (o_62, lightDir_61, ((float( - (IN_59._LightCoord.z > 0.0) - ) * tmpvar_75) * tmpvar_76)); - vec4 tmpvar_78; - tmpvar_78 = tmpvar_77; - c_60 = tmpvar_78; - float tmpvar_79; - tmpvar_79 = 0.0; - c_60.w = vec4(tmpvar_79).w; - return c_60; -} - -void main () -{ - v2f_surf xlt_IN_80; - vec4 xl_retval_81; - vec4 tmpvar_82; - tmpvar_82 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_80.pos = tmpvar_82; - float tmpvar_83; - tmpvar_83 = xlv_FOG.x; - xlt_IN_80.fog = tmpvar_83; - vec4 tmpvar_84; - tmpvar_84 = gl_TexCoord[0].xyzw; - vec4 tmpvar_85; - tmpvar_85 = tmpvar_84; - xlt_IN_80.hip_pack0 = tmpvar_85; - vec3 tmpvar_86; - tmpvar_86 = gl_TexCoord[1].xyz; - vec3 tmpvar_87; - tmpvar_87 = tmpvar_86; - xlt_IN_80.viewDir = tmpvar_87; - vec3 tmpvar_88; - tmpvar_88 = gl_TexCoord[2].xyz; - vec3 tmpvar_89; - tmpvar_89 = tmpvar_88; - xlt_IN_80.lightDir = tmpvar_89; - vec4 tmpvar_90; - tmpvar_90 = gl_TexCoord[3].xyzw; - vec4 tmpvar_91; - tmpvar_91 = tmpvar_90; - xlt_IN_80._LightCoord = tmpvar_91; - vec4 tmpvar_92; - tmpvar_92 = frag_surf (xlt_IN_80); - vec4 tmpvar_93; - tmpvar_93 = tmpvar_92; - xl_retval_81 = tmpvar_93; - vec4 tmpvar_94; - tmpvar_94 = xl_retval_81.xyzw; - vec4 tmpvar_95; - tmpvar_95 = tmpvar_94; - gl_FragData[0] = tmpvar_95; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-out.txt index 802b4a8a0..3cc611e3a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-out.txt @@ -43,4 +43,18 @@ void main () } -// inputs: 1, stats: 34 alu 6 tex 0 flow +// stats: 34 alu 6 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 4 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _Parallax (high float) 1x1 [-1] +// #3: _ReflectColor (high float) 4x1 [-1] +// textures: 6 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _Cube (high cube) 0x0 [-1] +// #2: _LightTexture0 (high 2d) 0x0 [-1] +// #3: _LightTextureB0 (high 2d) 0x0 [-1] +// #4: _MainTex (high 2d) 0x0 [-1] +// #5: _ParallaxMap (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-ir.txt deleted file mode 100644 index 4f7be93ce..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-ir.txt +++ /dev/null @@ -1,292 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; - vec3 worldRefl; - vec3 viewDir; - vec3 TtoW0; - vec3 TtoW1; - vec3 TtoW2; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec4 hip_screen; - vec4 TtoW0; - vec4 TtoW1; - vec4 TtoW2; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform samplerCube _Cube; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform float _Parallax; -uniform sampler2D _ParallaxMap; -uniform vec4 _ReflectColor; -uniform vec4 unity_Ambient; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -vec2 ParallaxOffset ( - in float h_6, - in float height_7, - in vec3 viewDir_8 -) -{ - vec3 v_9; - float tmpvar_10; - tmpvar_10 = ((h_6 * height_7) - (height_7 / 2.0)); - h_6 = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = normalize (viewDir_8); - vec3 tmpvar_12; - tmpvar_12 = tmpvar_11; - v_9 = tmpvar_12; - float tmpvar_13; - tmpvar_13 = (v_9.z + 0.42); - v_9.z = vec3(tmpvar_13).z; - return (h_6 * (v_9.xy / v_9.z)); -} - -void surf ( - in Input IN_14, - inout SurfaceOutput o_15 -) -{ - vec4 reflcol_16; - vec3 worldRefl_17; - vec4 c_18; - vec4 tex_19; - vec2 offset_20; - float h_21; - vec4 tmpvar_22; - tmpvar_22 = texture2D (_ParallaxMap, IN_14.uv_BumpMap); - float tmpvar_23; - tmpvar_23 = tmpvar_22.w; - h_21 = tmpvar_23; - vec2 tmpvar_24; - tmpvar_24 = ParallaxOffset (h_21, _Parallax, IN_14.viewDir); - vec2 tmpvar_25; - tmpvar_25 = tmpvar_24; - offset_20 = tmpvar_25; - vec2 tmpvar_26; - tmpvar_26 = (IN_14.uv_MainTex + offset_20); - IN_14.uv_MainTex = tmpvar_26; - vec2 tmpvar_27; - tmpvar_27 = (IN_14.uv_BumpMap + offset_20); - IN_14.uv_BumpMap = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = texture2D (_MainTex, IN_14.uv_MainTex); - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - tex_19 = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = (tex_19 * _Color); - c_18 = tmpvar_30; - vec3 tmpvar_31; - tmpvar_31 = c_18.xyz; - o_15.Albedo = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = texture2D (_BumpMap, IN_14.uv_BumpMap); - vec4 tmpvar_33; - tmpvar_33 = UnpackNormal (tmpvar_32); - vec3 tmpvar_34; - tmpvar_34 = tmpvar_33.xyz; - vec3 tmpvar_35; - tmpvar_35 = tmpvar_34; - o_15.Normal = tmpvar_35; - float tmpvar_36; - tmpvar_36 = dot (IN_14.TtoW0, o_15.Normal); - float tmpvar_37; - tmpvar_37 = dot (IN_14.TtoW1, o_15.Normal); - float tmpvar_38; - tmpvar_38 = dot (IN_14.TtoW2, o_15.Normal); - vec3 tmpvar_39; - tmpvar_39.x = tmpvar_36; - tmpvar_39.y = tmpvar_37; - tmpvar_39.z = tmpvar_38; - vec3 tmpvar_40; - tmpvar_40 = reflect (IN_14.worldRefl, tmpvar_39); - vec3 tmpvar_41; - tmpvar_41 = tmpvar_40; - worldRefl_17 = tmpvar_41; - vec4 tmpvar_42; - tmpvar_42 = textureCube (_Cube, worldRefl_17); - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - reflcol_16 = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44 = (reflcol_16 * tex_19.w); - reflcol_16 = tmpvar_44; - vec3 tmpvar_45; - tmpvar_45 = (reflcol_16.xyz * _ReflectColor.xyz); - o_15.Emission = tmpvar_45; - float tmpvar_46; - tmpvar_46 = (reflcol_16.w * _ReflectColor.w); - o_15.Alpha = tmpvar_46; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_47, - in vec4 light_48 -) -{ - vec4 c_49; - vec3 tmpvar_50; - tmpvar_50 = (s_47.Albedo * light_48.xyz); - c_49.xyz = tmpvar_50.xyz.xyz; - float tmpvar_51; - tmpvar_51 = s_47.Alpha; - c_49.w = vec4(tmpvar_51).w; - return c_49; -} - -vec4 frag_surf ( - in v2f_surf IN_52 -) -{ - vec4 col_53; - vec4 light_54; - SurfaceOutput o_55; - Input surfIN_56; - vec2 tmpvar_57; - tmpvar_57 = IN_52.hip_pack0.xy; - surfIN_56.uv_MainTex = tmpvar_57; - vec2 tmpvar_58; - tmpvar_58 = IN_52.hip_pack0.zw; - surfIN_56.uv_BumpMap = tmpvar_58; - vec3 tmpvar_59; - tmpvar_59.x = IN_52.TtoW0.w; - tmpvar_59.y = IN_52.TtoW1.w; - tmpvar_59.z = IN_52.TtoW2.w; - vec3 tmpvar_60; - tmpvar_60 = tmpvar_59; - surfIN_56.worldRefl = tmpvar_60; - vec3 tmpvar_61; - tmpvar_61 = IN_52.TtoW0.xyz; - surfIN_56.TtoW0 = tmpvar_61; - vec3 tmpvar_62; - tmpvar_62 = IN_52.TtoW1.xyz; - surfIN_56.TtoW1 = tmpvar_62; - vec3 tmpvar_63; - tmpvar_63 = IN_52.TtoW2.xyz; - surfIN_56.TtoW2 = tmpvar_63; - vec3 tmpvar_64; - tmpvar_64 = IN_52.viewDir; - surfIN_56.viewDir = tmpvar_64; - vec3 tmpvar_65; - tmpvar_65 = vec3(0.0, 0.0, 0.0); - o_55.Albedo = tmpvar_65; - vec3 tmpvar_66; - tmpvar_66 = vec3(0.0, 0.0, 0.0); - o_55.Emission = tmpvar_66; - float tmpvar_67; - tmpvar_67 = 0.0; - o_55.Specular = tmpvar_67; - float tmpvar_68; - tmpvar_68 = 0.0; - o_55.Alpha = tmpvar_68; - float tmpvar_69; - tmpvar_69 = 0.0; - o_55.Gloss = tmpvar_69; - surf (surfIN_56, o_55); - vec4 tmpvar_70; - tmpvar_70 = texture2DProj (_LightBuffer, IN_52.hip_screen); - vec4 tmpvar_71; - tmpvar_71 = tmpvar_70; - light_54 = tmpvar_71; - vec4 tmpvar_72; - tmpvar_72 = log2 (light_54); - vec4 tmpvar_73; - tmpvar_73 = -(tmpvar_72); - light_54 = tmpvar_73; - vec3 tmpvar_74; - tmpvar_74 = (light_54.xyz + unity_Ambient.xyz); - light_54.xyz = tmpvar_74.xyz.xyz; - vec4 tmpvar_75; - tmpvar_75 = LightingLambert_PrePass (o_55, light_54); - vec4 tmpvar_76; - tmpvar_76 = tmpvar_75; - col_53 = tmpvar_76; - vec3 tmpvar_77; - tmpvar_77 = (col_53.xyz + o_55.Emission); - col_53.xyz = tmpvar_77.xyz.xyz; - return col_53; -} - -void main () -{ - v2f_surf xlt_IN_78; - vec4 xl_retval_79; - vec4 tmpvar_80; - tmpvar_80 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_78.pos = tmpvar_80; - float tmpvar_81; - tmpvar_81 = xlv_FOG.x; - xlt_IN_78.fog = tmpvar_81; - vec4 tmpvar_82; - tmpvar_82 = gl_TexCoord[0].xyzw; - vec4 tmpvar_83; - tmpvar_83 = tmpvar_82; - xlt_IN_78.hip_pack0 = tmpvar_83; - vec3 tmpvar_84; - tmpvar_84 = gl_TexCoord[1].xyz; - vec3 tmpvar_85; - tmpvar_85 = tmpvar_84; - xlt_IN_78.viewDir = tmpvar_85; - vec4 tmpvar_86; - tmpvar_86 = gl_TexCoord[2].xyzw; - vec4 tmpvar_87; - tmpvar_87 = tmpvar_86; - xlt_IN_78.hip_screen = tmpvar_87; - vec4 tmpvar_88; - tmpvar_88 = gl_TexCoord[3].xyzw; - vec4 tmpvar_89; - tmpvar_89 = tmpvar_88; - xlt_IN_78.TtoW0 = tmpvar_89; - vec4 tmpvar_90; - tmpvar_90 = gl_TexCoord[4].xyzw; - vec4 tmpvar_91; - tmpvar_91 = tmpvar_90; - xlt_IN_78.TtoW1 = tmpvar_91; - vec4 tmpvar_92; - tmpvar_92 = gl_TexCoord[5].xyzw; - vec4 tmpvar_93; - tmpvar_93 = tmpvar_92; - xlt_IN_78.TtoW2 = tmpvar_93; - vec4 tmpvar_94; - tmpvar_94 = frag_surf (xlt_IN_78); - vec4 tmpvar_95; - tmpvar_95 = tmpvar_94; - xl_retval_79 = tmpvar_95; - vec4 tmpvar_96; - tmpvar_96 = xl_retval_79.xyzw; - vec4 tmpvar_97; - tmpvar_97 = tmpvar_96; - gl_FragData[0] = tmpvar_97; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-out.txt index c5e5bfb9a..12f0e7fb1 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-out.txt @@ -23,39 +23,50 @@ void main () tmpvar_7.x = tmpvar_2.w; tmpvar_7.y = tmpvar_3.w; tmpvar_7.z = tmpvar_4.w; - vec2 tmpvar_8; - vec3 v_9; - vec3 tmpvar_10; - tmpvar_10 = normalize(gl_TexCoord[1].xyz); - v_9.xy = tmpvar_10.xy; - v_9.z = (tmpvar_10.z + 0.42); - tmpvar_8 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_10.xy / v_9.z)); - vec4 tmpvar_11; - tmpvar_11 = texture2D (_MainTex, (tmpvar_1.xy + tmpvar_8)); - vec4 normal_12; - normal_12.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_8)).wy * 2.0) - 1.0); - normal_12.z = sqrt(((1.0 - - (normal_12.x * normal_12.x) - ) - (normal_12.y * normal_12.y))); - vec3 tmpvar_13; - tmpvar_13.x = dot (tmpvar_2.xyz, normal_12.xyz); - tmpvar_13.y = dot (tmpvar_3.xyz, normal_12.xyz); - tmpvar_13.z = dot (tmpvar_4.xyz, normal_12.xyz); - vec4 tmpvar_14; - tmpvar_14 = (textureCube (_Cube, (tmpvar_7 - (2.0 * - (dot (tmpvar_13, tmpvar_7) * tmpvar_13) - ))) * tmpvar_11.w); - vec4 tmpvar_15; - tmpvar_15 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2]))); - light_6.w = tmpvar_15.w; - light_6.xyz = (tmpvar_15.xyz + unity_Ambient.xyz); - vec4 c_16; - c_16.xyz = ((tmpvar_11 * _Color).xyz * light_6.xyz); - c_16.w = (tmpvar_14.w * _ReflectColor.w); - col_5.w = c_16.w; - col_5.xyz = (c_16.xyz + (tmpvar_14.xyz * _ReflectColor.xyz)); + vec4 reflcol_8; + vec2 tmpvar_9; + vec3 v_10; + vec3 tmpvar_11; + tmpvar_11 = normalize(gl_TexCoord[1].xyz); + v_10.xy = tmpvar_11.xy; + v_10.z = (tmpvar_11.z + 0.42); + tmpvar_9 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_11.xy / v_10.z)); + vec4 tmpvar_12; + tmpvar_12 = texture2D (_MainTex, (tmpvar_1.xy + tmpvar_9)); + vec4 normal_13; + normal_13.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_9)).wy * 2.0) - 1.0); + normal_13.z = sqrt(((1.0 - + (normal_13.x * normal_13.x) + ) - (normal_13.y * normal_13.y))); + vec3 tmpvar_14; + tmpvar_14.x = dot (tmpvar_2.xyz, normal_13.xyz); + tmpvar_14.y = dot (tmpvar_3.xyz, normal_13.xyz); + tmpvar_14.z = dot (tmpvar_4.xyz, normal_13.xyz); + reflcol_8 = (textureCube (_Cube, (tmpvar_7 - (2.0 * + (dot (tmpvar_14, tmpvar_7) * tmpvar_14) + ))) * tmpvar_12.w); + light_6 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2]))); + light_6.xyz = (light_6.xyz + unity_Ambient.xyz); + vec4 c_15; + c_15.xyz = ((tmpvar_12 * _Color).xyz * light_6.xyz); + c_15.w = (reflcol_8.w * _ReflectColor.w); + col_5.w = c_15.w; + col_5.xyz = (c_15.xyz + (reflcol_8.xyz * _ReflectColor.xyz)); gl_FragData[0] = col_5; } -// inputs: 1, stats: 32 alu 5 tex 0 flow +// stats: 32 alu 5 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [6] loc 4 +// uniforms: 4 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _Parallax (high float) 1x1 [-1] +// #2: _ReflectColor (high float) 4x1 [-1] +// #3: unity_Ambient (high float) 4x1 [-1] +// textures: 5 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _Cube (high cube) 0x0 [-1] +// #2: _LightBuffer (high 2d) 0x0 [-1] +// #3: _MainTex (high 2d) 0x0 [-1] +// #4: _ParallaxMap (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-ir.txt deleted file mode 100644 index b61dbffb1..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-ir.txt +++ /dev/null @@ -1,296 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; - vec3 worldRefl; - vec3 viewDir; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec3 lightDir; - vec3 _LightCoord; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform samplerCube _Cube; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _MainTex; -uniform float _Parallax; -uniform sampler2D _ParallaxMap; -uniform vec4 _ReflectColor; -uniform float _Shininess; -uniform vec4 _SpecColor; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -vec2 ParallaxOffset ( - in float h_6, - in float height_7, - in vec3 viewDir_8 -) -{ - vec3 v_9; - float tmpvar_10; - tmpvar_10 = ((h_6 * height_7) - (height_7 / 2.0)); - h_6 = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = normalize (viewDir_8); - vec3 tmpvar_12; - tmpvar_12 = tmpvar_11; - v_9 = tmpvar_12; - float tmpvar_13; - tmpvar_13 = (v_9.z + 0.42); - v_9.z = vec3(tmpvar_13).z; - return (h_6 * (v_9.xy / v_9.z)); -} - -void surf ( - in Input IN_14, - inout SurfaceOutput o_15 -) -{ - vec4 reflcol_16; - vec3 worldRefl_17; - vec4 tex_18; - vec2 offset_19; - float h_20; - vec4 tmpvar_21; - tmpvar_21 = texture2D (_ParallaxMap, IN_14.uv_BumpMap); - float tmpvar_22; - tmpvar_22 = tmpvar_21.w; - h_20 = tmpvar_22; - vec2 tmpvar_23; - tmpvar_23 = ParallaxOffset (h_20, _Parallax, IN_14.viewDir); - vec2 tmpvar_24; - tmpvar_24 = tmpvar_23; - offset_19 = tmpvar_24; - vec2 tmpvar_25; - tmpvar_25 = (IN_14.uv_MainTex + offset_19); - IN_14.uv_MainTex = tmpvar_25; - vec2 tmpvar_26; - tmpvar_26 = (IN_14.uv_BumpMap + offset_19); - IN_14.uv_BumpMap = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = texture2D (_MainTex, IN_14.uv_MainTex); - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - tex_18 = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = (tex_18.xyz * _Color.xyz); - o_15.Albedo = tmpvar_29; - float tmpvar_30; - tmpvar_30 = tex_18.w; - o_15.Gloss = tmpvar_30; - float tmpvar_31; - tmpvar_31 = _Shininess; - o_15.Specular = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = texture2D (_BumpMap, IN_14.uv_BumpMap); - vec4 tmpvar_33; - tmpvar_33 = UnpackNormal (tmpvar_32); - vec3 tmpvar_34; - tmpvar_34 = tmpvar_33.xyz; - vec3 tmpvar_35; - tmpvar_35 = tmpvar_34; - o_15.Normal = tmpvar_35; - vec3 tmpvar_36; - tmpvar_36 = IN_14.worldRefl; - worldRefl_17 = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37 = textureCube (_Cube, worldRefl_17); - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - reflcol_16 = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = (reflcol_16 * tex_18.w); - reflcol_16 = tmpvar_39; - vec3 tmpvar_40; - tmpvar_40 = (reflcol_16.xyz * _ReflectColor.xyz); - o_15.Emission = tmpvar_40; - float tmpvar_41; - tmpvar_41 = (reflcol_16.w * _ReflectColor.w); - o_15.Alpha = tmpvar_41; -} - -vec4 LightingBlinnPhong ( - in SurfaceOutput s_42, - in vec3 lightDir_43, - in vec3 viewDir_44, - in float atten_45 -) -{ - vec4 c_46; - float spec_47; - float nh_48; - float diff_49; - vec3 h_50; - vec3 tmpvar_51; - tmpvar_51 = normalize ((lightDir_43 + viewDir_44)); - vec3 tmpvar_52; - tmpvar_52 = tmpvar_51; - h_50 = tmpvar_52; - float tmpvar_53; - tmpvar_53 = dot (s_42.Normal, lightDir_43); - float tmpvar_54; - tmpvar_54 = max (0.0, tmpvar_53); - float tmpvar_55; - tmpvar_55 = tmpvar_54; - diff_49 = tmpvar_55; - float tmpvar_56; - tmpvar_56 = dot (s_42.Normal, h_50); - float tmpvar_57; - tmpvar_57 = max (0.0, tmpvar_56); - float tmpvar_58; - tmpvar_58 = tmpvar_57; - nh_48 = tmpvar_58; - float tmpvar_59; - tmpvar_59 = pow (nh_48, (s_42.Specular * 128.0)); - float tmpvar_60; - tmpvar_60 = (tmpvar_59 * s_42.Gloss); - spec_47 = tmpvar_60; - vec3 tmpvar_61; - tmpvar_61 = ((( - (s_42.Albedo * _LightColor0.xyz) - * diff_49) + ( - (_LightColor0.xyz * _SpecColor.xyz) - * spec_47)) * (atten_45 * 2.0)); - c_46.xyz = tmpvar_61.xyz.xyz; - float tmpvar_62; - tmpvar_62 = (s_42.Alpha + (( - (_LightColor0.w * _SpecColor.w) - * spec_47) * atten_45)); - c_46.w = vec4(tmpvar_62).w; - return c_46; -} - -vec4 frag_surf ( - in v2f_surf IN_63 -) -{ - vec4 c_64; - vec3 lightDir_65; - SurfaceOutput o_66; - Input surfIN_67; - vec2 tmpvar_68; - tmpvar_68 = IN_63.hip_pack0.xy; - surfIN_67.uv_MainTex = tmpvar_68; - vec2 tmpvar_69; - tmpvar_69 = IN_63.hip_pack0.zw; - surfIN_67.uv_BumpMap = tmpvar_69; - vec3 tmpvar_70; - tmpvar_70 = IN_63.viewDir; - surfIN_67.viewDir = tmpvar_70; - vec3 tmpvar_71; - tmpvar_71 = vec3(0.0, 0.0, 0.0); - o_66.Albedo = tmpvar_71; - vec3 tmpvar_72; - tmpvar_72 = vec3(0.0, 0.0, 0.0); - o_66.Emission = tmpvar_72; - float tmpvar_73; - tmpvar_73 = 0.0; - o_66.Specular = tmpvar_73; - float tmpvar_74; - tmpvar_74 = 0.0; - o_66.Alpha = tmpvar_74; - float tmpvar_75; - tmpvar_75 = 0.0; - o_66.Gloss = tmpvar_75; - surf (surfIN_67, o_66); - vec3 tmpvar_76; - tmpvar_76 = IN_63.lightDir; - lightDir_65 = tmpvar_76; - vec3 tmpvar_77; - tmpvar_77 = normalize (lightDir_65); - vec3 tmpvar_78; - tmpvar_78 = tmpvar_77; - lightDir_65 = tmpvar_78; - vec3 tmpvar_79; - tmpvar_79 = IN_63.viewDir.xyz; - vec3 tmpvar_80; - tmpvar_80 = normalize (tmpvar_79); - float tmpvar_81; - tmpvar_81 = dot (IN_63._LightCoord, IN_63._LightCoord); - vec2 tmpvar_82; - tmpvar_82 = vec2(tmpvar_81); - vec2 tmpvar_83; - tmpvar_83 = tmpvar_82.xy; - vec4 tmpvar_84; - tmpvar_84 = texture2D (_LightTexture0, tmpvar_83); - vec4 tmpvar_85; - tmpvar_85 = LightingBlinnPhong (o_66, lightDir_65, tmpvar_80, tmpvar_84.w); - vec4 tmpvar_86; - tmpvar_86 = tmpvar_85; - c_64 = tmpvar_86; - float tmpvar_87; - tmpvar_87 = 0.0; - c_64.w = vec4(tmpvar_87).w; - return c_64; -} - -void main () -{ - v2f_surf xlt_IN_88; - vec4 xl_retval_89; - vec4 tmpvar_90; - tmpvar_90 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_88.pos = tmpvar_90; - float tmpvar_91; - tmpvar_91 = xlv_FOG.x; - xlt_IN_88.fog = tmpvar_91; - vec4 tmpvar_92; - tmpvar_92 = gl_TexCoord[0].xyzw; - vec4 tmpvar_93; - tmpvar_93 = tmpvar_92; - xlt_IN_88.hip_pack0 = tmpvar_93; - vec3 tmpvar_94; - tmpvar_94 = gl_TexCoord[1].xyz; - vec3 tmpvar_95; - tmpvar_95 = tmpvar_94; - xlt_IN_88.viewDir = tmpvar_95; - vec3 tmpvar_96; - tmpvar_96 = gl_TexCoord[2].xyz; - vec3 tmpvar_97; - tmpvar_97 = tmpvar_96; - xlt_IN_88.lightDir = tmpvar_97; - vec3 tmpvar_98; - tmpvar_98 = gl_TexCoord[3].xyz; - vec3 tmpvar_99; - tmpvar_99 = tmpvar_98; - xlt_IN_88._LightCoord = tmpvar_99; - vec4 tmpvar_100; - tmpvar_100 = frag_surf (xlt_IN_88); - vec4 tmpvar_101; - tmpvar_101 = tmpvar_100; - xl_retval_89 = tmpvar_101; - vec4 tmpvar_102; - tmpvar_102 = xl_retval_89.xyzw; - vec4 tmpvar_103; - tmpvar_103 = tmpvar_102; - gl_FragData[0] = tmpvar_103; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-out.txt index 2ec649929..21e84c6ca 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-out.txt @@ -38,8 +38,8 @@ void main () vec4 tmpvar_12; tmpvar_12 = texture2D (_LightTexture0, vec2(dot (tmpvar_3, tmpvar_3))); vec4 c_13; - float tmpvar_14; - tmpvar_14 = (pow (max (0.0, + float spec_14; + spec_14 = (pow (max (0.0, dot (normal_10.xyz, normalize((tmpvar_11 + normalize(tmpvar_2)))) ), (_Shininess * 128.0)) * tmpvar_9.w); c_13.xyz = ((( @@ -48,14 +48,27 @@ void main () max (0.0, dot (normal_10.xyz, tmpvar_11)) ) + ( (_LightColor0.xyz * _SpecColor.xyz) - * tmpvar_14)) * (tmpvar_12.w * 2.0)); - c_13.w = (((textureCube (_Cube, tmpvar_5) * tmpvar_9.w).w * _ReflectColor.w) + (( - (_LightColor0.w * _SpecColor.w) - * tmpvar_14) * tmpvar_12.w)); + * spec_14)) * (tmpvar_12.w * 2.0)); + c_13.w = (((textureCube (_Cube, tmpvar_5) * tmpvar_9.w).w * _ReflectColor.w) + ((_LightColor0.w * _SpecColor.w) * (spec_14 * tmpvar_12.w))); c_4.xyz = c_13.xyz; c_4.w = 0.0; gl_FragData[0] = c_4; } -// inputs: 1, stats: 43 alu 5 tex 0 flow +// stats: 43 alu 5 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 6 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _Parallax (high float) 1x1 [-1] +// #3: _ReflectColor (high float) 4x1 [-1] +// #4: _Shininess (high float) 1x1 [-1] +// #5: _SpecColor (high float) 4x1 [-1] +// textures: 5 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _Cube (high cube) 0x0 [-1] +// #2: _LightTexture0 (high 2d) 0x0 [-1] +// #3: _MainTex (high 2d) 0x0 [-1] +// #4: _ParallaxMap (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-ir.txt deleted file mode 100644 index 4538e5f48..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-ir.txt +++ /dev/null @@ -1,285 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; - vec3 worldRefl; - vec3 viewDir; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec3 lightDir; - vec2 _LightCoord; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform samplerCube _Cube; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _MainTex; -uniform float _Parallax; -uniform sampler2D _ParallaxMap; -uniform vec4 _ReflectColor; -uniform float _Shininess; -uniform vec4 _SpecColor; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -vec2 ParallaxOffset ( - in float h_6, - in float height_7, - in vec3 viewDir_8 -) -{ - vec3 v_9; - float tmpvar_10; - tmpvar_10 = ((h_6 * height_7) - (height_7 / 2.0)); - h_6 = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = normalize (viewDir_8); - vec3 tmpvar_12; - tmpvar_12 = tmpvar_11; - v_9 = tmpvar_12; - float tmpvar_13; - tmpvar_13 = (v_9.z + 0.42); - v_9.z = vec3(tmpvar_13).z; - return (h_6 * (v_9.xy / v_9.z)); -} - -void surf ( - in Input IN_14, - inout SurfaceOutput o_15 -) -{ - vec4 reflcol_16; - vec3 worldRefl_17; - vec4 tex_18; - vec2 offset_19; - float h_20; - vec4 tmpvar_21; - tmpvar_21 = texture2D (_ParallaxMap, IN_14.uv_BumpMap); - float tmpvar_22; - tmpvar_22 = tmpvar_21.w; - h_20 = tmpvar_22; - vec2 tmpvar_23; - tmpvar_23 = ParallaxOffset (h_20, _Parallax, IN_14.viewDir); - vec2 tmpvar_24; - tmpvar_24 = tmpvar_23; - offset_19 = tmpvar_24; - vec2 tmpvar_25; - tmpvar_25 = (IN_14.uv_MainTex + offset_19); - IN_14.uv_MainTex = tmpvar_25; - vec2 tmpvar_26; - tmpvar_26 = (IN_14.uv_BumpMap + offset_19); - IN_14.uv_BumpMap = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = texture2D (_MainTex, IN_14.uv_MainTex); - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - tex_18 = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = (tex_18.xyz * _Color.xyz); - o_15.Albedo = tmpvar_29; - float tmpvar_30; - tmpvar_30 = tex_18.w; - o_15.Gloss = tmpvar_30; - float tmpvar_31; - tmpvar_31 = _Shininess; - o_15.Specular = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = texture2D (_BumpMap, IN_14.uv_BumpMap); - vec4 tmpvar_33; - tmpvar_33 = UnpackNormal (tmpvar_32); - vec3 tmpvar_34; - tmpvar_34 = tmpvar_33.xyz; - vec3 tmpvar_35; - tmpvar_35 = tmpvar_34; - o_15.Normal = tmpvar_35; - vec3 tmpvar_36; - tmpvar_36 = IN_14.worldRefl; - worldRefl_17 = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37 = textureCube (_Cube, worldRefl_17); - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - reflcol_16 = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = (reflcol_16 * tex_18.w); - reflcol_16 = tmpvar_39; - vec3 tmpvar_40; - tmpvar_40 = (reflcol_16.xyz * _ReflectColor.xyz); - o_15.Emission = tmpvar_40; - float tmpvar_41; - tmpvar_41 = (reflcol_16.w * _ReflectColor.w); - o_15.Alpha = tmpvar_41; -} - -vec4 LightingBlinnPhong ( - in SurfaceOutput s_42, - in vec3 lightDir_43, - in vec3 viewDir_44, - in float atten_45 -) -{ - vec4 c_46; - float spec_47; - float nh_48; - float diff_49; - vec3 h_50; - vec3 tmpvar_51; - tmpvar_51 = normalize ((lightDir_43 + viewDir_44)); - vec3 tmpvar_52; - tmpvar_52 = tmpvar_51; - h_50 = tmpvar_52; - float tmpvar_53; - tmpvar_53 = dot (s_42.Normal, lightDir_43); - float tmpvar_54; - tmpvar_54 = max (0.0, tmpvar_53); - float tmpvar_55; - tmpvar_55 = tmpvar_54; - diff_49 = tmpvar_55; - float tmpvar_56; - tmpvar_56 = dot (s_42.Normal, h_50); - float tmpvar_57; - tmpvar_57 = max (0.0, tmpvar_56); - float tmpvar_58; - tmpvar_58 = tmpvar_57; - nh_48 = tmpvar_58; - float tmpvar_59; - tmpvar_59 = pow (nh_48, (s_42.Specular * 128.0)); - float tmpvar_60; - tmpvar_60 = (tmpvar_59 * s_42.Gloss); - spec_47 = tmpvar_60; - vec3 tmpvar_61; - tmpvar_61 = ((( - (s_42.Albedo * _LightColor0.xyz) - * diff_49) + ( - (_LightColor0.xyz * _SpecColor.xyz) - * spec_47)) * (atten_45 * 2.0)); - c_46.xyz = tmpvar_61.xyz.xyz; - float tmpvar_62; - tmpvar_62 = (s_42.Alpha + (( - (_LightColor0.w * _SpecColor.w) - * spec_47) * atten_45)); - c_46.w = vec4(tmpvar_62).w; - return c_46; -} - -vec4 frag_surf ( - in v2f_surf IN_63 -) -{ - vec4 c_64; - vec3 lightDir_65; - SurfaceOutput o_66; - Input surfIN_67; - vec2 tmpvar_68; - tmpvar_68 = IN_63.hip_pack0.xy; - surfIN_67.uv_MainTex = tmpvar_68; - vec2 tmpvar_69; - tmpvar_69 = IN_63.hip_pack0.zw; - surfIN_67.uv_BumpMap = tmpvar_69; - vec3 tmpvar_70; - tmpvar_70 = IN_63.viewDir; - surfIN_67.viewDir = tmpvar_70; - vec3 tmpvar_71; - tmpvar_71 = vec3(0.0, 0.0, 0.0); - o_66.Albedo = tmpvar_71; - vec3 tmpvar_72; - tmpvar_72 = vec3(0.0, 0.0, 0.0); - o_66.Emission = tmpvar_72; - float tmpvar_73; - tmpvar_73 = 0.0; - o_66.Specular = tmpvar_73; - float tmpvar_74; - tmpvar_74 = 0.0; - o_66.Alpha = tmpvar_74; - float tmpvar_75; - tmpvar_75 = 0.0; - o_66.Gloss = tmpvar_75; - surf (surfIN_67, o_66); - vec3 tmpvar_76; - tmpvar_76 = IN_63.lightDir; - lightDir_65 = tmpvar_76; - vec3 tmpvar_77; - tmpvar_77 = IN_63.viewDir.xyz; - vec3 tmpvar_78; - tmpvar_78 = normalize (tmpvar_77); - vec4 tmpvar_79; - tmpvar_79 = texture2D (_LightTexture0, IN_63._LightCoord); - vec4 tmpvar_80; - tmpvar_80 = LightingBlinnPhong (o_66, lightDir_65, tmpvar_78, (tmpvar_79.w * 1.0)); - vec4 tmpvar_81; - tmpvar_81 = tmpvar_80; - c_64 = tmpvar_81; - float tmpvar_82; - tmpvar_82 = 0.0; - c_64.w = vec4(tmpvar_82).w; - return c_64; -} - -void main () -{ - v2f_surf xlt_IN_83; - vec4 xl_retval_84; - vec4 tmpvar_85; - tmpvar_85 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_83.pos = tmpvar_85; - float tmpvar_86; - tmpvar_86 = xlv_FOG.x; - xlt_IN_83.fog = tmpvar_86; - vec4 tmpvar_87; - tmpvar_87 = gl_TexCoord[0].xyzw; - vec4 tmpvar_88; - tmpvar_88 = tmpvar_87; - xlt_IN_83.hip_pack0 = tmpvar_88; - vec3 tmpvar_89; - tmpvar_89 = gl_TexCoord[1].xyz; - vec3 tmpvar_90; - tmpvar_90 = tmpvar_89; - xlt_IN_83.viewDir = tmpvar_90; - vec3 tmpvar_91; - tmpvar_91 = gl_TexCoord[2].xyz; - vec3 tmpvar_92; - tmpvar_92 = tmpvar_91; - xlt_IN_83.lightDir = tmpvar_92; - vec2 tmpvar_93; - tmpvar_93 = gl_TexCoord[3].xy; - vec2 tmpvar_94; - tmpvar_94 = tmpvar_93; - xlt_IN_83._LightCoord = tmpvar_94; - vec4 tmpvar_95; - tmpvar_95 = frag_surf (xlt_IN_83); - vec4 tmpvar_96; - tmpvar_96 = tmpvar_95; - xl_retval_84 = tmpvar_96; - vec4 tmpvar_97; - tmpvar_97 = xl_retval_84.xyzw; - vec4 tmpvar_98; - tmpvar_98 = tmpvar_97; - gl_FragData[0] = tmpvar_98; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-out.txt index 59c2edf52..6bc222678 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-out.txt @@ -36,8 +36,8 @@ void main () float atten_11; atten_11 = texture2D (_LightTexture0, gl_TexCoord[3].xy).w; vec4 c_12; - float tmpvar_13; - tmpvar_13 = (pow (max (0.0, + float spec_13; + spec_13 = (pow (max (0.0, dot (normal_10.xyz, normalize((tmpvar_3 + normalize(tmpvar_2)))) ), (_Shininess * 128.0)) * tmpvar_9.w); c_12.xyz = ((( @@ -46,14 +46,27 @@ void main () max (0.0, dot (normal_10.xyz, tmpvar_3)) ) + ( (_LightColor0.xyz * _SpecColor.xyz) - * tmpvar_13)) * (atten_11 * 2.0)); - c_12.w = (((textureCube (_Cube, tmpvar_5) * tmpvar_9.w).w * _ReflectColor.w) + (( - (_LightColor0.w * _SpecColor.w) - * tmpvar_13) * atten_11)); + * spec_13)) * (atten_11 * 2.0)); + c_12.w = (((textureCube (_Cube, tmpvar_5) * tmpvar_9.w).w * _ReflectColor.w) + ((_LightColor0.w * _SpecColor.w) * (spec_13 * atten_11))); c_4.xyz = c_12.xyz; c_4.w = 0.0; gl_FragData[0] = c_4; } -// inputs: 1, stats: 41 alu 5 tex 0 flow +// stats: 41 alu 5 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 6 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _Parallax (high float) 1x1 [-1] +// #3: _ReflectColor (high float) 4x1 [-1] +// #4: _Shininess (high float) 1x1 [-1] +// #5: _SpecColor (high float) 4x1 [-1] +// textures: 5 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _Cube (high cube) 0x0 [-1] +// #2: _LightTexture0 (high 2d) 0x0 [-1] +// #3: _MainTex (high 2d) 0x0 [-1] +// #4: _ParallaxMap (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-ir.txt deleted file mode 100644 index 32820727d..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-ir.txt +++ /dev/null @@ -1,253 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec3 worldRefl; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec3 viewDir; - vec4 _LightCoord; -}; -uniform vec4 _Color; -uniform samplerCube _Cube; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -uniform vec4 _ReflectColor; -uniform float _Shininess; -uniform vec4 _SpecColor; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 reflcol_3; - vec4 c_4; - vec4 tex_5; - vec4 tmpvar_6; - tmpvar_6 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - tex_5 = tmpvar_7; - vec4 tmpvar_8; - tmpvar_8 = (tex_5 * _Color); - c_4 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = c_4.xyz; - o_2.Albedo = tmpvar_9; - float tmpvar_10; - tmpvar_10 = tex_5.w; - o_2.Gloss = tmpvar_10; - float tmpvar_11; - tmpvar_11 = _Shininess; - o_2.Specular = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12 = textureCube (_Cube, IN_1.worldRefl); - vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - reflcol_3 = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = (reflcol_3 * tex_5.w); - reflcol_3 = tmpvar_14; - vec3 tmpvar_15; - tmpvar_15 = (reflcol_3.xyz * _ReflectColor.xyz); - o_2.Emission = tmpvar_15; - float tmpvar_16; - tmpvar_16 = (reflcol_3.w * _ReflectColor.w); - o_2.Alpha = tmpvar_16; -} - -float UnitySpotCookie ( - in vec4 LightCoord_17 -) -{ - vec4 tmpvar_18; - tmpvar_18 = texture2D (_LightTexture0, ((LightCoord_17.xy / LightCoord_17.w) + 0.5)); - return tmpvar_18.w; -} - -float UnitySpotAttenuate ( - in vec3 LightCoord_19 -) -{ - float tmpvar_20; - tmpvar_20 = dot (LightCoord_19, LightCoord_19); - vec2 tmpvar_21; - tmpvar_21 = vec2(tmpvar_20); - vec2 tmpvar_22; - tmpvar_22 = tmpvar_21.xy; - vec4 tmpvar_23; - tmpvar_23 = texture2D (_LightTextureB0, tmpvar_22); - return tmpvar_23.w; -} - -vec4 LightingBlinnPhong ( - in SurfaceOutput s_24, - in vec3 lightDir_25, - in vec3 viewDir_26, - in float atten_27 -) -{ - vec4 c_28; - float spec_29; - float nh_30; - float diff_31; - vec3 h_32; - vec3 tmpvar_33; - tmpvar_33 = normalize ((lightDir_25 + viewDir_26)); - vec3 tmpvar_34; - tmpvar_34 = tmpvar_33; - h_32 = tmpvar_34; - float tmpvar_35; - tmpvar_35 = dot (s_24.Normal, lightDir_25); - float tmpvar_36; - tmpvar_36 = max (0.0, tmpvar_35); - float tmpvar_37; - tmpvar_37 = tmpvar_36; - diff_31 = tmpvar_37; - float tmpvar_38; - tmpvar_38 = dot (s_24.Normal, h_32); - float tmpvar_39; - tmpvar_39 = max (0.0, tmpvar_38); - float tmpvar_40; - tmpvar_40 = tmpvar_39; - nh_30 = tmpvar_40; - float tmpvar_41; - tmpvar_41 = pow (nh_30, (s_24.Specular * 128.0)); - float tmpvar_42; - tmpvar_42 = (tmpvar_41 * s_24.Gloss); - spec_29 = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = ((( - (s_24.Albedo * _LightColor0.xyz) - * diff_31) + ( - (_LightColor0.xyz * _SpecColor.xyz) - * spec_29)) * (atten_27 * 2.0)); - c_28.xyz = tmpvar_43.xyz.xyz; - float tmpvar_44; - tmpvar_44 = (s_24.Alpha + (( - (_LightColor0.w * _SpecColor.w) - * spec_29) * atten_27)); - c_28.w = vec4(tmpvar_44).w; - return c_28; -} - -vec4 frag_surf ( - in v2f_surf IN_45 -) -{ - vec4 c_46; - vec3 lightDir_47; - SurfaceOutput o_48; - Input surfIN_49; - vec2 tmpvar_50; - tmpvar_50 = IN_45.hip_pack0.xy; - surfIN_49.uv_MainTex = tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = vec3(0.0, 0.0, 0.0); - o_48.Albedo = tmpvar_51; - vec3 tmpvar_52; - tmpvar_52 = vec3(0.0, 0.0, 0.0); - o_48.Emission = tmpvar_52; - float tmpvar_53; - tmpvar_53 = 0.0; - o_48.Specular = tmpvar_53; - float tmpvar_54; - tmpvar_54 = 0.0; - o_48.Alpha = tmpvar_54; - float tmpvar_55; - tmpvar_55 = 0.0; - o_48.Gloss = tmpvar_55; - vec3 tmpvar_56; - tmpvar_56 = IN_45.normal; - o_48.Normal = tmpvar_56; - surf (surfIN_49, o_48); - vec3 tmpvar_57; - tmpvar_57 = IN_45.lightDir; - lightDir_47 = tmpvar_57; - vec3 tmpvar_58; - tmpvar_58 = normalize (lightDir_47); - vec3 tmpvar_59; - tmpvar_59 = tmpvar_58; - lightDir_47 = tmpvar_59; - vec3 tmpvar_60; - tmpvar_60 = IN_45.viewDir.xyz; - vec3 tmpvar_61; - tmpvar_61 = normalize (tmpvar_60); - float tmpvar_62; - tmpvar_62 = UnitySpotCookie (IN_45._LightCoord); - float tmpvar_63; - tmpvar_63 = UnitySpotAttenuate (IN_45._LightCoord.xyz); - vec4 tmpvar_64; - tmpvar_64 = LightingBlinnPhong (o_48, lightDir_47, tmpvar_61, ((float( - (IN_45._LightCoord.z > 0.0) - ) * tmpvar_62) * tmpvar_63)); - vec4 tmpvar_65; - tmpvar_65 = tmpvar_64; - c_46 = tmpvar_65; - float tmpvar_66; - tmpvar_66 = 0.0; - c_46.w = vec4(tmpvar_66).w; - return c_46; -} - -void main () -{ - v2f_surf xlt_IN_67; - vec4 xl_retval_68; - vec4 tmpvar_69; - tmpvar_69 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_67.pos = tmpvar_69; - float tmpvar_70; - tmpvar_70 = xlv_FOG.x; - xlt_IN_67.fog = tmpvar_70; - vec2 tmpvar_71; - tmpvar_71 = gl_TexCoord[0].xy; - vec2 tmpvar_72; - tmpvar_72 = tmpvar_71; - xlt_IN_67.hip_pack0 = tmpvar_72; - vec3 tmpvar_73; - tmpvar_73 = gl_TexCoord[1].xyz; - vec3 tmpvar_74; - tmpvar_74 = tmpvar_73; - xlt_IN_67.normal = tmpvar_74; - vec3 tmpvar_75; - tmpvar_75 = gl_TexCoord[2].xyz; - vec3 tmpvar_76; - tmpvar_76 = tmpvar_75; - xlt_IN_67.lightDir = tmpvar_76; - vec3 tmpvar_77; - tmpvar_77 = gl_TexCoord[3].xyz; - vec3 tmpvar_78; - tmpvar_78 = tmpvar_77; - xlt_IN_67.viewDir = tmpvar_78; - vec4 tmpvar_79; - tmpvar_79 = gl_TexCoord[4].xyzw; - vec4 tmpvar_80; - tmpvar_80 = tmpvar_79; - xlt_IN_67._LightCoord = tmpvar_80; - vec4 tmpvar_81; - tmpvar_81 = frag_surf (xlt_IN_67); - vec4 tmpvar_82; - tmpvar_82 = tmpvar_81; - xl_retval_68 = tmpvar_82; - vec4 tmpvar_83; - tmpvar_83 = xl_retval_68.xyzw; - vec4 tmpvar_84; - tmpvar_84 = tmpvar_83; - gl_FragData[0] = tmpvar_84; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-out.txt index 20a10efc5..8379eb4f8 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-out.txt @@ -26,8 +26,8 @@ void main () (tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w); vec4 c_8; - float tmpvar_9; - tmpvar_9 = (pow (max (0.0, + float spec_9; + spec_9 = (pow (max (0.0, dot (tmpvar_1, normalize((tmpvar_6 + normalize(gl_TexCoord[3].xyz)))) ), (_Shininess * 128.0)) * tmpvar_5.w); c_8.xyz = ((( @@ -36,14 +36,25 @@ void main () max (0.0, dot (tmpvar_1, tmpvar_6)) ) + ( (_LightColor0.xyz * _SpecColor.xyz) - * tmpvar_9)) * (atten_7 * 2.0)); - c_8.w = (((textureCube (_Cube, tmpvar_4) * tmpvar_5.w).w * _ReflectColor.w) + (( - (_LightColor0.w * _SpecColor.w) - * tmpvar_9) * atten_7)); + * spec_9)) * (atten_7 * 2.0)); + c_8.w = (((textureCube (_Cube, tmpvar_4) * tmpvar_5.w).w * _ReflectColor.w) + ((_LightColor0.w * _SpecColor.w) * (spec_9 * atten_7))); c_3.xyz = c_8.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } -// inputs: 1, stats: 33 alu 4 tex 0 flow +// stats: 33 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [5] loc 4 +// uniforms: 5 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _ReflectColor (high float) 4x1 [-1] +// #3: _Shininess (high float) 1x1 [-1] +// #4: _SpecColor (high float) 4x1 [-1] +// textures: 4 +// #0: _Cube (high cube) 0x0 [-1] +// #1: _LightTexture0 (high 2d) 0x0 [-1] +// #2: _LightTextureB0 (high 2d) 0x0 [-1] +// #3: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-ir.txt deleted file mode 100644 index 04d120aa5..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-ir.txt +++ /dev/null @@ -1,121 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec3 worldRefl; -}; -struct v2f_surf { - vec4 pos; - vec3 normal; -}; -uniform vec4 _Color; -uniform samplerCube _Cube; -uniform sampler2D _MainTex; -uniform vec4 _ReflectColor; -uniform float _Shininess; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 reflcol_3; - vec4 c_4; - vec4 tex_5; - vec4 tmpvar_6; - tmpvar_6 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - tex_5 = tmpvar_7; - vec4 tmpvar_8; - tmpvar_8 = (tex_5 * _Color); - c_4 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = c_4.xyz; - o_2.Albedo = tmpvar_9; - float tmpvar_10; - tmpvar_10 = tex_5.w; - o_2.Gloss = tmpvar_10; - float tmpvar_11; - tmpvar_11 = _Shininess; - o_2.Specular = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12 = textureCube (_Cube, IN_1.worldRefl); - vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - reflcol_3 = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = (reflcol_3 * tex_5.w); - reflcol_3 = tmpvar_14; - vec3 tmpvar_15; - tmpvar_15 = (reflcol_3.xyz * _ReflectColor.xyz); - o_2.Emission = tmpvar_15; - float tmpvar_16; - tmpvar_16 = (reflcol_3.w * _ReflectColor.w); - o_2.Alpha = tmpvar_16; -} - -vec4 frag_surf ( - in v2f_surf IN_17 -) -{ - vec4 res_18; - Input surfIN_19; - SurfaceOutput o_20; - vec3 tmpvar_21; - tmpvar_21 = vec3(0.0, 0.0, 0.0); - o_20.Albedo = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = vec3(0.0, 0.0, 0.0); - o_20.Emission = tmpvar_22; - float tmpvar_23; - tmpvar_23 = 0.0; - o_20.Specular = tmpvar_23; - float tmpvar_24; - tmpvar_24 = 0.0; - o_20.Alpha = tmpvar_24; - float tmpvar_25; - tmpvar_25 = 0.0; - o_20.Gloss = tmpvar_25; - vec3 tmpvar_26; - tmpvar_26 = IN_17.normal; - o_20.Normal = tmpvar_26; - surf (surfIN_19, o_20); - vec3 tmpvar_27; - tmpvar_27 = ((o_20.Normal * vec3(0.5, 0.5, -0.5)) + 0.5); - res_18.xyz = tmpvar_27.xyz.xyz; - float tmpvar_28; - tmpvar_28 = o_20.Specular; - res_18.w = vec4(tmpvar_28).w; - return res_18; -} - -void main () -{ - v2f_surf xlt_IN_29; - vec4 xl_retval_30; - vec4 tmpvar_31; - tmpvar_31 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_29.pos = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = gl_TexCoord[0].xyz; - vec3 tmpvar_33; - tmpvar_33 = tmpvar_32; - xlt_IN_29.normal = tmpvar_33; - vec4 tmpvar_34; - tmpvar_34 = frag_surf (xlt_IN_29); - vec4 tmpvar_35; - tmpvar_35 = tmpvar_34; - xl_retval_30 = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36 = xl_retval_30.xyzw; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - gl_FragData[0] = tmpvar_37; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-out.txt index c5e34474e..63f2c940a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-out.txt @@ -8,4 +8,8 @@ void main () } -// inputs: 1, stats: 2 alu 0 tex 0 flow +// stats: 2 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// uniforms: 1 (total size: 0) +// #0: _Shininess (high float) 1x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-ir.txt deleted file mode 100644 index 246c1ffd3..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-ir.txt +++ /dev/null @@ -1,179 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec3 worldRefl; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 worldRefl; - vec4 hip_screen; -}; -uniform vec4 _Color; -uniform samplerCube _Cube; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform vec4 _ReflectColor; -uniform float _Shininess; -uniform vec4 _SpecColor; -uniform vec4 unity_Ambient; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 reflcol_3; - vec4 c_4; - vec4 tex_5; - vec4 tmpvar_6; - tmpvar_6 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - tex_5 = tmpvar_7; - vec4 tmpvar_8; - tmpvar_8 = (tex_5 * _Color); - c_4 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = c_4.xyz; - o_2.Albedo = tmpvar_9; - float tmpvar_10; - tmpvar_10 = tex_5.w; - o_2.Gloss = tmpvar_10; - float tmpvar_11; - tmpvar_11 = _Shininess; - o_2.Specular = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12 = textureCube (_Cube, IN_1.worldRefl); - vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - reflcol_3 = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = (reflcol_3 * tex_5.w); - reflcol_3 = tmpvar_14; - vec3 tmpvar_15; - tmpvar_15 = (reflcol_3.xyz * _ReflectColor.xyz); - o_2.Emission = tmpvar_15; - float tmpvar_16; - tmpvar_16 = (reflcol_3.w * _ReflectColor.w); - o_2.Alpha = tmpvar_16; -} - -vec4 LightingBlinnPhong_PrePass ( - in SurfaceOutput s_17, - in vec4 light_18 -) -{ - vec4 c_19; - float spec_20; - float tmpvar_21; - tmpvar_21 = (light_18.w * s_17.Gloss); - spec_20 = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = ((s_17.Albedo * light_18.xyz) + ((light_18.xyz * _SpecColor.xyz) * spec_20)); - c_19.xyz = tmpvar_22.xyz.xyz; - float tmpvar_23; - tmpvar_23 = (s_17.Alpha + (spec_20 * _SpecColor.w)); - c_19.w = vec4(tmpvar_23).w; - return c_19; -} - -vec4 frag_surf ( - in v2f_surf IN_24 -) -{ - vec4 col_25; - vec4 light_26; - SurfaceOutput o_27; - Input surfIN_28; - vec2 tmpvar_29; - tmpvar_29 = IN_24.hip_pack0.xy; - surfIN_28.uv_MainTex = tmpvar_29; - vec3 tmpvar_30; - tmpvar_30 = IN_24.worldRefl; - surfIN_28.worldRefl = tmpvar_30; - vec3 tmpvar_31; - tmpvar_31 = vec3(0.0, 0.0, 0.0); - o_27.Albedo = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = vec3(0.0, 0.0, 0.0); - o_27.Emission = tmpvar_32; - float tmpvar_33; - tmpvar_33 = 0.0; - o_27.Specular = tmpvar_33; - float tmpvar_34; - tmpvar_34 = 0.0; - o_27.Alpha = tmpvar_34; - float tmpvar_35; - tmpvar_35 = 0.0; - o_27.Gloss = tmpvar_35; - surf (surfIN_28, o_27); - vec4 tmpvar_36; - tmpvar_36 = texture2DProj (_LightBuffer, IN_24.hip_screen); - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - light_26 = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = log2 (light_26); - vec4 tmpvar_39; - tmpvar_39 = -(tmpvar_38); - light_26 = tmpvar_39; - vec3 tmpvar_40; - tmpvar_40 = (light_26.xyz + unity_Ambient.xyz); - light_26.xyz = tmpvar_40.xyz.xyz; - vec4 tmpvar_41; - tmpvar_41 = LightingBlinnPhong_PrePass (o_27, light_26); - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - col_25 = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = (col_25.xyz + o_27.Emission); - col_25.xyz = tmpvar_43.xyz.xyz; - return col_25; -} - -void main () -{ - v2f_surf xlt_IN_44; - vec4 xl_retval_45; - vec4 tmpvar_46; - tmpvar_46 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_44.pos = tmpvar_46; - float tmpvar_47; - tmpvar_47 = xlv_FOG.x; - xlt_IN_44.fog = tmpvar_47; - vec2 tmpvar_48; - tmpvar_48 = gl_TexCoord[0].xy; - vec2 tmpvar_49; - tmpvar_49 = tmpvar_48; - xlt_IN_44.hip_pack0 = tmpvar_49; - vec3 tmpvar_50; - tmpvar_50 = gl_TexCoord[1].xyz; - vec3 tmpvar_51; - tmpvar_51 = tmpvar_50; - xlt_IN_44.worldRefl = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = gl_TexCoord[2].xyzw; - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - xlt_IN_44.hip_screen = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54 = frag_surf (xlt_IN_44); - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - xl_retval_45 = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = xl_retval_45.xyzw; - vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - gl_FragData[0] = tmpvar_57; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-out.txt index b7a6a1aef..e0f894486 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-out.txt @@ -9,23 +9,32 @@ void main () { vec4 col_1; vec4 light_2; - vec4 tmpvar_3; - tmpvar_3 = texture2D (_MainTex, gl_TexCoord[0].xy); + vec4 reflcol_3; vec4 tmpvar_4; - tmpvar_4 = (textureCube (_Cube, gl_TexCoord[1].xyz) * tmpvar_3.w); - vec4 tmpvar_5; - tmpvar_5 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2]))); - light_2.w = tmpvar_5.w; - light_2.xyz = (tmpvar_5.xyz + unity_Ambient.xyz); - vec4 c_6; - float tmpvar_7; - tmpvar_7 = (tmpvar_5.w * tmpvar_3.w); - c_6.xyz = (((tmpvar_3 * _Color).xyz * light_2.xyz) + ((light_2.xyz * _SpecColor.xyz) * tmpvar_7)); - c_6.w = ((tmpvar_4.w * _ReflectColor.w) + (tmpvar_7 * _SpecColor.w)); - col_1.w = c_6.w; - col_1.xyz = (c_6.xyz + (tmpvar_4.xyz * _ReflectColor.xyz)); + tmpvar_4 = texture2D (_MainTex, gl_TexCoord[0].xy); + reflcol_3 = (textureCube (_Cube, gl_TexCoord[1].xyz) * tmpvar_4.w); + light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2]))); + light_2.xyz = (light_2.xyz + unity_Ambient.xyz); + vec4 c_5; + float spec_6; + spec_6 = (light_2.w * tmpvar_4.w); + c_5.xyz = (((tmpvar_4 * _Color).xyz * light_2.xyz) + ((light_2.xyz * _SpecColor.xyz) * spec_6)); + c_5.w = ((reflcol_3.w * _ReflectColor.w) + (spec_6 * _SpecColor.w)); + col_1.w = c_5.w; + col_1.xyz = (c_5.xyz + (reflcol_3.xyz * _ReflectColor.xyz)); gl_FragData[0] = col_1; } -// inputs: 1, stats: 15 alu 3 tex 0 flow +// stats: 15 alu 3 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 4 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _ReflectColor (high float) 4x1 [-1] +// #2: _SpecColor (high float) 4x1 [-1] +// #3: unity_Ambient (high float) 4x1 [-1] +// textures: 3 +// #0: _Cube (high cube) 0x0 [-1] +// #1: _LightBuffer (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-ir.txt deleted file mode 100644 index 49b0244ad..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-ir.txt +++ /dev/null @@ -1,60 +0,0 @@ -struct v2f { - vec4 vertex; - vec2 texcoord; -}; -uniform vec4 _Tint; -uniform sampler2D _UpTex; -vec4 skybox_frag ( - in v2f i_1, - in sampler2D smp_2 -) -{ - vec4 col_3; - vec4 tex_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (smp_2, i_1.texcoord); - vec4 tmpvar_6; - tmpvar_6 = tmpvar_5; - tex_4 = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = ((tex_4.xyz + _Tint.xyz) - 0.5); - col_3.xyz = tmpvar_7.xyz.xyz; - float tmpvar_8; - tmpvar_8 = (tex_4.w * _Tint.w); - col_3.w = vec4(tmpvar_8).w; - return col_3; -} - -vec4 frag ( - in v2f i_9 -) -{ - vec4 tmpvar_10; - tmpvar_10 = skybox_frag (i_9, _UpTex); - return tmpvar_10; -} - -void main () -{ - v2f xlt_i_11; - vec4 xl_retval_12; - vec4 tmpvar_13; - tmpvar_13 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_11.vertex = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = gl_TexCoord[0].xy; - vec2 tmpvar_15; - tmpvar_15 = tmpvar_14; - xlt_i_11.texcoord = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = frag (xlt_i_11); - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - xl_retval_12 = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = xl_retval_12.xyzw; - vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - gl_FragData[0] = tmpvar_19; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-out.txt index 1793291d5..6e773429c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-out.txt @@ -11,4 +11,10 @@ void main () } -// inputs: 1, stats: 3 alu 1 tex 0 flow +// stats: 3 alu 1 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// uniforms: 1 (total size: 0) +// #0: _Tint (high float) 4x1 [-1] +// textures: 1 +// #0: _UpTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-ir.txt deleted file mode 100644 index e7e6e8851..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-ir.txt +++ /dev/null @@ -1,50 +0,0 @@ -struct v2f { - vec4 vertex; - vec3 texcoord; -}; -uniform samplerCube _Tex; -uniform vec4 _Tint; -vec4 frag ( - in v2f i_1 -) -{ - vec4 col_2; - vec4 tex_3; - vec4 tmpvar_4; - tmpvar_4 = textureCube (_Tex, i_1.texcoord); - vec4 tmpvar_5; - tmpvar_5 = tmpvar_4; - tex_3 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = ((tex_3.xyz + _Tint.xyz) - 0.5); - col_2.xyz = tmpvar_6.xyz.xyz; - float tmpvar_7; - tmpvar_7 = (tex_3.w * _Tint.w); - col_2.w = vec4(tmpvar_7).w; - return col_2; -} - -void main () -{ - v2f xlt_i_8; - vec4 xl_retval_9; - vec4 tmpvar_10; - tmpvar_10 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_8.vertex = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = gl_TexCoord[0].xyz; - vec3 tmpvar_12; - tmpvar_12 = tmpvar_11; - xlt_i_8.texcoord = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13 = frag (xlt_i_8); - vec4 tmpvar_14; - tmpvar_14 = tmpvar_13; - xl_retval_9 = tmpvar_14; - vec4 tmpvar_15; - tmpvar_15 = xl_retval_9.xyzw; - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - gl_FragData[0] = tmpvar_16; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-out.txt index de7c4ea4e..de340c37b 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-out.txt @@ -11,4 +11,10 @@ void main () } -// inputs: 1, stats: 3 alu 1 tex 0 flow +// stats: 3 alu 1 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// uniforms: 1 (total size: 0) +// #0: _Tint (high float) 4x1 [-1] +// textures: 1 +// #0: _Tex (high cube) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-inES3.txt index 184a625e4..ba5c35740 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-inES3.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-inES3.txt @@ -1,7 +1,7 @@ #version 300 es #define gl_FragData _glesFragData layout(location = 0) out mediump vec4 _glesFragData[4]; -float xll_saturate_f( float x) { +highp float xll_saturate_f( highp float x) { return clamp( x, 0.0, 1.0); } struct v2f_ao { @@ -12,7 +12,7 @@ struct v2f_ao { uniform highp vec4 _ProjectionParams; uniform highp vec2 _NoiseScale; uniform highp vec4 _CameraDepthNormalsTexture_ST; -uniform sampler2D _CameraDepthNormalsTexture; +uniform highp sampler2D _CameraDepthNormalsTexture; uniform sampler2D _RandomTexture; uniform highp vec4 _Params; highp float DecodeFloatRG( in highp vec2 enc ) { diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-ir.txt deleted file mode 100644 index ec9eebddc..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-ir.txt +++ /dev/null @@ -1,309 +0,0 @@ -struct v2f_ao { - vec4 pos; - vec2 uv; - vec2 uvr; -}; -uniform vec4 _ProjectionParams; -uniform vec2 _NoiseScale; -uniform vec4 _CameraDepthNormalsTexture_ST; -uniform sampler2D _CameraDepthNormalsTexture; -uniform sampler2D _RandomTexture; -uniform vec4 _Params; -varying vec2 xlv_TEXCOORD0; -varying vec2 xlv_TEXCOORD1; -float xll_saturate_f ( - in float x_1 -) -{ - float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -float DecodeFloatRG ( - in vec2 enc_3 -) -{ - vec2 kDecodeDot_4; - vec2 tmpvar_5; - tmpvar_5 = vec2(1.0, 0.00392157); - kDecodeDot_4 = tmpvar_5; - float tmpvar_6; - tmpvar_6 = dot (enc_3, kDecodeDot_4); - return tmpvar_6; -} - -vec3 DecodeViewNormalStereo ( - in vec4 enc4_7 -) -{ - vec3 n_8; - float g_9; - vec3 nn_10; - float kScale_11; - float tmpvar_12; - tmpvar_12 = 1.7777; - kScale_11 = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13.z = 0.0; - tmpvar_13.x = (2.0 * kScale_11); - tmpvar_13.y = (2.0 * kScale_11); - vec3 tmpvar_14; - tmpvar_14.z = 1.0; - tmpvar_14.x = -(kScale_11); - tmpvar_14.y = -(kScale_11); - vec3 tmpvar_15; - tmpvar_15 = ((enc4_7.xyz * tmpvar_13) + tmpvar_14); - nn_10 = tmpvar_15; - float tmpvar_16; - tmpvar_16 = dot (nn_10.xyz, nn_10.xyz); - float tmpvar_17; - tmpvar_17 = (2.0 / tmpvar_16); - g_9 = tmpvar_17; - vec2 tmpvar_18; - tmpvar_18 = (g_9 * nn_10.xy); - n_8.xy = tmpvar_18.xy.xy; - float tmpvar_19; - tmpvar_19 = (g_9 - 1.0); - n_8.z = vec3(tmpvar_19).z; - return n_8; -} - -void DecodeDepthNormal ( - in vec4 enc_20, - out float depth_21, - out vec3 normal_22 -) -{ - float tmpvar_23; - tmpvar_23 = DecodeFloatRG (enc_20.zw); - float tmpvar_24; - tmpvar_24 = tmpvar_23; - depth_21 = tmpvar_24; - vec3 tmpvar_25; - tmpvar_25 = DecodeViewNormalStereo (enc_20); - vec3 tmpvar_26; - tmpvar_26 = tmpvar_25; - normal_22 = tmpvar_26; -} - -float frag_ao ( - in v2f_ao i_27, - in int sampleCount_28, - in vec3 samples_29[24] -) -{ - int s_30; - float occ_31; - float scale_32; - float depth_33; - vec3 viewNorm_34; - vec4 depthnormal_35; - vec3 randN_36; - vec4 tmpvar_37; - tmpvar_37 = texture2D (_RandomTexture, i_27.uvr); - vec3 tmpvar_38; - tmpvar_38 = ((tmpvar_37.xyz * 2.0) - 1.0); - randN_36 = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = texture2D (_CameraDepthNormalsTexture, i_27.uv); - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - depthnormal_35 = tmpvar_40; - DecodeDepthNormal (depthnormal_35, depth_33, viewNorm_34); - float tmpvar_41; - tmpvar_41 = (depth_33 * _ProjectionParams.z); - depth_33 = tmpvar_41; - float tmpvar_42; - tmpvar_42 = (_Params.x / depth_33); - scale_32 = tmpvar_42; - float tmpvar_43; - tmpvar_43 = 0.0; - occ_31 = tmpvar_43; - int tmpvar_44; - tmpvar_44 = 0; - s_30 = tmpvar_44; - while (true) { - float zd_45; - vec3 sampleN_46; - float sampleD_47; - vec4 sampleND_48; - float sD_49; - vec2 offset_50; - float flip_51; - vec3 randomDir_52; - if (!((s_30 < sampleCount_28))) { - break; - }; - vec3 tmpvar_53; - tmpvar_53 = reflect (samples_29[s_30], randN_36); - vec3 tmpvar_54; - tmpvar_54 = tmpvar_53; - randomDir_52 = tmpvar_54; - float tmpvar_55; - tmpvar_55 = dot (viewNorm_34, randomDir_52); - float tmpvar_56; - if ((tmpvar_55 < 0.0)) { - tmpvar_56 = 1.0; - } else { - tmpvar_56 = -(1.0); - }; - float tmpvar_57; - tmpvar_57 = tmpvar_56; - flip_51 = tmpvar_57; - vec3 tmpvar_58; - tmpvar_58 = (randomDir_52 * -(flip_51)); - randomDir_52 = tmpvar_58; - vec3 tmpvar_59; - tmpvar_59 = (randomDir_52 + (viewNorm_34 * 0.3)); - randomDir_52 = tmpvar_59; - vec2 tmpvar_60; - tmpvar_60 = (randomDir_52.xy * scale_32); - offset_50 = tmpvar_60; - float tmpvar_61; - tmpvar_61 = (depth_33 - (randomDir_52.z * _Params.x)); - sD_49 = tmpvar_61; - vec4 tmpvar_62; - tmpvar_62 = texture2D (_CameraDepthNormalsTexture, (i_27.uv + offset_50)); - vec4 tmpvar_63; - tmpvar_63 = tmpvar_62; - sampleND_48 = tmpvar_63; - DecodeDepthNormal (sampleND_48, sampleD_47, sampleN_46); - float tmpvar_64; - tmpvar_64 = (sampleD_47 * _ProjectionParams.z); - sampleD_47 = tmpvar_64; - float tmpvar_65; - tmpvar_65 = xll_saturate_f ((sD_49 - sampleD_47)); - float tmpvar_66; - tmpvar_66 = tmpvar_65; - zd_45 = tmpvar_66; - if ((zd_45 > _Params.y)) { - float tmpvar_67; - tmpvar_67 = pow ((1.0 - zd_45), _Params.z); - float tmpvar_68; - tmpvar_68 = (occ_31 + tmpvar_67); - occ_31 = tmpvar_68; - }; - int tmpvar_69; - tmpvar_69 = (s_30 + 1); - s_30 = tmpvar_69; - }; - float tmpvar_70; - tmpvar_70 = (occ_31 / float(sampleCount_28)); - occ_31 = tmpvar_70; - return (1.0 - occ_31); -} - -vec4 frag ( - in v2f_ao i_71 -) -{ - vec3 RAND_SAMPLES_72[24]; - vec3 tmpvar_73; - tmpvar_73 = vec3(0.0130572, 0.587232, -0.119337); - RAND_SAMPLES_72[0] = tmpvar_73; - vec3 tmpvar_74; - tmpvar_74 = vec3(0.323078, 0.0220727, -0.418873); - RAND_SAMPLES_72[1] = tmpvar_74; - vec3 tmpvar_75; - tmpvar_75 = vec3(-0.310725, -0.191367, 0.0561369); - RAND_SAMPLES_72[2] = tmpvar_75; - vec3 tmpvar_76; - tmpvar_76 = vec3(-0.479646, 0.0939877, -0.580265); - RAND_SAMPLES_72[3] = tmpvar_76; - vec3 tmpvar_77; - tmpvar_77 = vec3(0.139999, -0.33577, 0.559679); - RAND_SAMPLES_72[4] = tmpvar_77; - vec3 tmpvar_78; - tmpvar_78 = vec3(-0.248458, 0.255532, 0.348944); - RAND_SAMPLES_72[5] = tmpvar_78; - vec3 tmpvar_79; - tmpvar_79 = vec3(0.18719, -0.702764, -0.231748); - RAND_SAMPLES_72[6] = tmpvar_79; - vec3 tmpvar_80; - tmpvar_80 = vec3(0.884915, 0.284208, 0.368524); - RAND_SAMPLES_72[7] = tmpvar_80; - vec3 tmpvar_81; - tmpvar_81 = vec3(0.0130572, 0.587232, -0.119337); - RAND_SAMPLES_72[8] = tmpvar_81; - vec3 tmpvar_82; - tmpvar_82 = vec3(0.323078, 0.0220727, -0.418873); - RAND_SAMPLES_72[9] = tmpvar_82; - vec3 tmpvar_83; - tmpvar_83 = vec3(-0.310725, -0.191367, 0.0561369); - RAND_SAMPLES_72[10] = tmpvar_83; - vec3 tmpvar_84; - tmpvar_84 = vec3(-0.479646, 0.0939877, -0.580265); - RAND_SAMPLES_72[11] = tmpvar_84; - vec3 tmpvar_85; - tmpvar_85 = vec3(0.139999, -0.33577, 0.559679); - RAND_SAMPLES_72[12] = tmpvar_85; - vec3 tmpvar_86; - tmpvar_86 = vec3(-0.248458, 0.255532, 0.348944); - RAND_SAMPLES_72[13] = tmpvar_86; - vec3 tmpvar_87; - tmpvar_87 = vec3(0.18719, -0.702764, -0.231748); - RAND_SAMPLES_72[14] = tmpvar_87; - vec3 tmpvar_88; - tmpvar_88 = vec3(0.884915, 0.284208, 0.368524); - RAND_SAMPLES_72[15] = tmpvar_88; - vec3 tmpvar_89; - tmpvar_89 = vec3(0.0130572, 0.587232, -0.119337); - RAND_SAMPLES_72[16] = tmpvar_89; - vec3 tmpvar_90; - tmpvar_90 = vec3(0.323078, 0.0220727, -0.418873); - RAND_SAMPLES_72[17] = tmpvar_90; - vec3 tmpvar_91; - tmpvar_91 = vec3(-0.310725, -0.191367, 0.0561369); - RAND_SAMPLES_72[18] = tmpvar_91; - vec3 tmpvar_92; - tmpvar_92 = vec3(-0.479646, 0.0939877, -0.580265); - RAND_SAMPLES_72[19] = tmpvar_92; - vec3 tmpvar_93; - tmpvar_93 = vec3(0.139999, -0.33577, 0.559679); - RAND_SAMPLES_72[20] = tmpvar_93; - vec3 tmpvar_94; - tmpvar_94 = vec3(-0.248458, 0.255532, 0.348944); - RAND_SAMPLES_72[21] = tmpvar_94; - vec3 tmpvar_95; - tmpvar_95 = vec3(0.18719, -0.702764, -0.231748); - RAND_SAMPLES_72[22] = tmpvar_95; - vec3 tmpvar_96; - tmpvar_96 = vec3(0.884915, 0.284208, 0.368524); - RAND_SAMPLES_72[23] = tmpvar_96; - float tmpvar_97; - tmpvar_97 = frag_ao (i_71, 24, RAND_SAMPLES_72); - vec4 tmpvar_98; - tmpvar_98 = vec4(tmpvar_97); - return tmpvar_98; -} - -void main () -{ - v2f_ao xlt_i_99; - vec4 xl_retval_100; - vec4 tmpvar_101; - tmpvar_101 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_99.pos = tmpvar_101; - vec2 tmpvar_102; - tmpvar_102 = xlv_TEXCOORD0.xy; - vec2 tmpvar_103; - tmpvar_103 = tmpvar_102; - xlt_i_99.uv = tmpvar_103; - vec2 tmpvar_104; - tmpvar_104 = xlv_TEXCOORD1.xy; - vec2 tmpvar_105; - tmpvar_105 = tmpvar_104; - xlt_i_99.uvr = tmpvar_105; - vec4 tmpvar_106; - tmpvar_106 = frag (xlt_i_99); - vec4 tmpvar_107; - tmpvar_107 = tmpvar_106; - xl_retval_100 = tmpvar_107; - vec4 tmpvar_108; - tmpvar_108 = xl_retval_100.xyzw; - vec4 tmpvar_109; - tmpvar_109 = tmpvar_108; - gl_FragData[0] = tmpvar_109; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-irES3.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-irES3.txt deleted file mode 100644 index 04b0d18af..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-irES3.txt +++ /dev/null @@ -1,242 +0,0 @@ -#version 300 es -struct v2f_ao { - highp vec4 pos; - highp vec2 uv; - highp vec2 uvr; -}; -layout(location=0) out mediump vec4 _glesFragData[4]; -uniform highp vec4 _ProjectionParams; -uniform highp vec2 _NoiseScale; -uniform highp vec4 _CameraDepthNormalsTexture_ST; -uniform sampler2D _CameraDepthNormalsTexture; -uniform sampler2D _RandomTexture; -uniform highp vec4 _Params; -in highp vec2 xlv_TEXCOORD0; -in highp vec2 xlv_TEXCOORD1; -mediump float xll_saturate_f ( - in mediump float x_1 -) -{ - mediump float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -float DecodeFloatRG ( - in highp vec2 enc_3 -) -{ - highp vec2 kDecodeDot_4; - mediump vec2 tmpvar_5; - tmpvar_5 = vec2(1.0, 0.00392157); - kDecodeDot_4 = tmpvar_5; - highp float tmpvar_6; - tmpvar_6 = dot (enc_3, kDecodeDot_4); - return tmpvar_6; -} - -vec3 DecodeViewNormalStereo ( - in highp vec4 enc4_7 -) -{ - highp vec3 n_8; - highp float g_9; - highp vec3 nn_10; - highp float kScale_11; - mediump float tmpvar_12; - tmpvar_12 = 1.7777; - kScale_11 = tmpvar_12; - highp vec3 tmpvar_13; - tmpvar_13.z = 0.0; - tmpvar_13.x = (2.0 * kScale_11); - tmpvar_13.y = (2.0 * kScale_11); - highp vec3 tmpvar_14; - tmpvar_14.z = 1.0; - tmpvar_14.x = -(kScale_11); - tmpvar_14.y = -(kScale_11); - highp vec3 tmpvar_15; - tmpvar_15 = ((enc4_7.xyz * tmpvar_13) + tmpvar_14); - nn_10 = tmpvar_15; - highp float tmpvar_16; - tmpvar_16 = dot (nn_10.xyz, nn_10.xyz); - highp float tmpvar_17; - tmpvar_17 = (2.0 / tmpvar_16); - g_9 = tmpvar_17; - highp vec2 tmpvar_18; - tmpvar_18 = (g_9 * nn_10.xy); - n_8.xy = tmpvar_18.xy.xy; - highp float tmpvar_19; - tmpvar_19 = (g_9 - 1.0); - n_8.z = vec3(tmpvar_19).z; - return n_8; -} - -void DecodeDepthNormal ( - in highp vec4 enc_20, - out highp float depth_21, - out highp vec3 normal_22 -) -{ - highp float tmpvar_23; - tmpvar_23 = DecodeFloatRG (enc_20.zw); - highp float tmpvar_24; - tmpvar_24 = tmpvar_23; - depth_21 = tmpvar_24; - highp vec3 tmpvar_25; - tmpvar_25 = DecodeViewNormalStereo (enc_20); - highp vec3 tmpvar_26; - tmpvar_26 = tmpvar_25; - normal_22 = tmpvar_26; -} - -mediump float frag_ao ( - in v2f_ao i_27, - in int sampleCount_28, - in highp vec3 samples_29[8] -) -{ - int s_30; - highp float occ_31; - highp float scale_32; - highp float depth_33; - highp vec3 viewNorm_34; - highp vec4 depthnormal_35; - mediump vec3 randN_36; - lowp vec4 tmpvar_37; - tmpvar_37 = texture (_RandomTexture, i_27.uvr); - lowp vec3 tmpvar_38; - tmpvar_38 = ((tmpvar_37.xyz * 2.0) - 1.0); - randN_36 = tmpvar_38; - lowp vec4 tmpvar_39; - tmpvar_39 = texture (_CameraDepthNormalsTexture, i_27.uv); - lowp vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - depthnormal_35 = tmpvar_40; - DecodeDepthNormal (depthnormal_35, depth_33, viewNorm_34); - highp float tmpvar_41; - tmpvar_41 = (depth_33 * _ProjectionParams.z); - depth_33 = tmpvar_41; - highp float tmpvar_42; - tmpvar_42 = (_Params.x / depth_33); - scale_32 = tmpvar_42; - mediump float tmpvar_43; - tmpvar_43 = 0.0; - occ_31 = tmpvar_43; - int tmpvar_44; - tmpvar_44 = 0; - s_30 = tmpvar_44; - while (true) { - highp float zd_45; - highp vec3 sampleN_46; - highp float sampleD_47; - highp vec4 sampleND_48; - highp float sD_49; - highp vec2 offset_50; - mediump float flip_51; - mediump vec3 randomDir_52; - if (!((s_30 < sampleCount_28))) { - break; - }; - highp vec3 tmpvar_53; - tmpvar_53 = reflect (samples_29[s_30], randN_36); - highp vec3 tmpvar_54; - tmpvar_54 = tmpvar_53; - randomDir_52 = tmpvar_54; - highp float tmpvar_55; - tmpvar_55 = dot (viewNorm_34, randomDir_52); - mediump float tmpvar_56; - if ((tmpvar_55 < 0.0)) { - tmpvar_56 = 1.0; - } else { - tmpvar_56 = -(1.0); - }; - mediump float tmpvar_57; - tmpvar_57 = tmpvar_56; - flip_51 = tmpvar_57; - mediump vec3 tmpvar_58; - tmpvar_58 = (randomDir_52 * -(flip_51)); - randomDir_52 = tmpvar_58; - highp vec3 tmpvar_59; - tmpvar_59 = (randomDir_52 + (viewNorm_34 * 0.3)); - randomDir_52 = tmpvar_59; - highp vec2 tmpvar_60; - tmpvar_60 = (randomDir_52.xy * scale_32); - offset_50 = tmpvar_60; - highp float tmpvar_61; - tmpvar_61 = (depth_33 - (randomDir_52.z * _Params.x)); - sD_49 = tmpvar_61; - lowp vec4 tmpvar_62; - tmpvar_62 = texture (_CameraDepthNormalsTexture, (i_27.uv + offset_50)); - lowp vec4 tmpvar_63; - tmpvar_63 = tmpvar_62; - sampleND_48 = tmpvar_63; - DecodeDepthNormal (sampleND_48, sampleD_47, sampleN_46); - highp float tmpvar_64; - tmpvar_64 = (sampleD_47 * _ProjectionParams.z); - sampleD_47 = tmpvar_64; - mediump float tmpvar_65; - tmpvar_65 = xll_saturate_f ((sD_49 - sampleD_47)); - mediump float tmpvar_66; - tmpvar_66 = tmpvar_65; - zd_45 = tmpvar_66; - if ((zd_45 > _Params.y)) { - highp float tmpvar_67; - tmpvar_67 = pow ((1.0 - zd_45), _Params.z); - highp float tmpvar_68; - tmpvar_68 = (occ_31 + tmpvar_67); - occ_31 = tmpvar_68; - }; - int tmpvar_69; - tmpvar_69 = (s_30 + 1); - s_30 = tmpvar_69; - }; - highp float tmpvar_70; - tmpvar_70 = (occ_31 / float(sampleCount_28)); - occ_31 = tmpvar_70; - return (1.0 - occ_31); -} - -mediump vec4 frag ( - in v2f_ao i_71 -) -{ - highp vec3 RAND_SAMPLES_72[8] = vec3[8](vec3(0.0130572, 0.587232, -0.119337), vec3(0.323078, 0.0220727, -0.418873), vec3(-0.310725, -0.191367, 0.0561369), vec3(-0.479646, 0.0939877, -0.580265), vec3(0.139999, -0.33577, 0.559679), vec3(-0.248458, 0.255532, 0.348944), vec3(0.18719, -0.702764, -0.231748), vec3(0.884915, 0.284208, 0.368524)); - vec3 tmpvar_73[8]; - tmpvar_73 = vec3[8](vec3(0.0130572, 0.587232, -0.119337), vec3(0.323078, 0.0220727, -0.418873), vec3(-0.310725, -0.191367, 0.0561369), vec3(-0.479646, 0.0939877, -0.580265), vec3(0.139999, -0.33577, 0.559679), vec3(-0.248458, 0.255532, 0.348944), vec3(0.18719, -0.702764, -0.231748), vec3(0.884915, 0.284208, 0.368524)); - RAND_SAMPLES_72 = tmpvar_73; - mediump float tmpvar_74; - tmpvar_74 = frag_ao (i_71, 8, vec3[8](vec3(0.0130572, 0.587232, -0.119337), vec3(0.323078, 0.0220727, -0.418873), vec3(-0.310725, -0.191367, 0.0561369), vec3(-0.479646, 0.0939877, -0.580265), vec3(0.139999, -0.33577, 0.559679), vec3(-0.248458, 0.255532, 0.348944), vec3(0.18719, -0.702764, -0.231748), vec3(0.884915, 0.284208, 0.368524))); - mediump vec4 tmpvar_75; - tmpvar_75 = vec4(tmpvar_74); - return tmpvar_75; -} - -void main () -{ - v2f_ao xlt_i_76; - mediump vec4 xl_retval_77; - mediump vec4 tmpvar_78; - tmpvar_78 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_76.pos = tmpvar_78; - highp vec2 tmpvar_79; - tmpvar_79 = xlv_TEXCOORD0.xy; - highp vec2 tmpvar_80; - tmpvar_80 = tmpvar_79; - xlt_i_76.uv = tmpvar_80; - highp vec2 tmpvar_81; - tmpvar_81 = xlv_TEXCOORD1.xy; - highp vec2 tmpvar_82; - tmpvar_82 = tmpvar_81; - xlt_i_76.uvr = tmpvar_82; - mediump vec4 tmpvar_83; - tmpvar_83 = frag (xlt_i_76); - mediump vec4 tmpvar_84; - tmpvar_84 = tmpvar_83; - xl_retval_77 = tmpvar_84; - mediump vec4 tmpvar_85; - tmpvar_85 = xl_retval_77.xyzw; - mediump vec4 tmpvar_86; - tmpvar_86 = tmpvar_85; - _glesFragData[0] = tmpvar_86; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-out.txt index 098a5155f..0bff3c660 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-out.txt @@ -51,18 +51,18 @@ void main () n_11.xy = (tmpvar_13 * tmpvar_12.xy); n_11.z = (tmpvar_13 - 1.0); viewNorm_8 = n_11; - float tmpvar_14; - tmpvar_14 = (dot (tmpvar_10.zw, vec2(1.0, 0.00392157)) * _ProjectionParams.z); - depth_7 = tmpvar_14; - scale_6 = (_Params.x / tmpvar_14); + depth_7 = (dot (tmpvar_10.zw, vec2(1.0, 0.00392157)) * _ProjectionParams.z); + scale_6 = (_Params.x / depth_7); occ_5 = 0.0; for (int s_4 = 0; s_4 < 24; s_4++) { + vec3 randomDir_14; vec3 tmpvar_15; vec3 I_16; I_16 = samples_3[s_4]; tmpvar_15 = (I_16 - (2.0 * ( dot (randN_9, I_16) * randN_9))); + randomDir_14 = tmpvar_15; float tmpvar_17; tmpvar_17 = dot (viewNorm_8, tmpvar_15); float tmpvar_18; @@ -71,23 +71,30 @@ void main () } else { tmpvar_18 = -1.0; }; - vec3 tmpvar_19; - tmpvar_19 = ((tmpvar_15 * -(tmpvar_18)) + (viewNorm_8 * 0.3)); - float tmpvar_20; - tmpvar_20 = clamp (((depth_7 - - (tmpvar_19.z * _Params.x) + randomDir_14 = (tmpvar_15 * -(tmpvar_18)); + randomDir_14 = (randomDir_14 + (viewNorm_8 * 0.3)); + float tmpvar_19; + tmpvar_19 = clamp (((depth_7 - + (randomDir_14.z * _Params.x) ) - ( - dot (texture2D (_CameraDepthNormalsTexture, (tmpvar_2 + (tmpvar_19.xy * scale_6))).zw, vec2(1.0, 0.00392157)) + dot (texture2D (_CameraDepthNormalsTexture, (tmpvar_2 + (randomDir_14.xy * scale_6))).zw, vec2(1.0, 0.00392157)) * _ProjectionParams.z)), 0.0, 1.0); - if ((tmpvar_20 > _Params.y)) { - occ_5 = (occ_5 + pow ((1.0 - tmpvar_20), _Params.z)); + if ((tmpvar_19 > _Params.y)) { + occ_5 = (occ_5 + pow ((1.0 - tmpvar_19), _Params.z)); }; }; - float tmpvar_21; - tmpvar_21 = (occ_5 / 24.0); - occ_5 = tmpvar_21; - gl_FragData[0] = vec4((1.0 - tmpvar_21)); + occ_5 = (occ_5 / 24.0); + gl_FragData[0] = vec4((1.0 - occ_5)); } -// inputs: 2, stats: 65 alu 3 tex 4 flow +// stats: 65 alu 3 tex 4 flow +// inputs: 2 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// #1: xlv_TEXCOORD1 (high float) 2x1 [-1] +// uniforms: 2 (total size: 0) +// #0: _ProjectionParams (high float) 4x1 [-1] +// #1: _Params (high float) 4x1 [-1] +// textures: 2 +// #0: _CameraDepthNormalsTexture (high 2d) 0x0 [-1] +// #1: _RandomTexture (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3.txt index 45e4d65bb..a7b70f673 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3.txt @@ -1,7 +1,7 @@ #version 300 es layout(location=0) out mediump vec4 _glesFragData[4]; uniform highp vec4 _ProjectionParams; -uniform sampler2D _CameraDepthNormalsTexture; +uniform highp sampler2D _CameraDepthNormalsTexture; uniform sampler2D _RandomTexture; uniform highp vec4 _Params; in highp vec2 xlv_TEXCOORD0; @@ -15,71 +15,67 @@ void main () highp float scale_5; highp float depth_6; highp vec3 viewNorm_7; - highp vec4 depthnormal_8; - mediump vec3 randN_9; - lowp vec3 tmpvar_10; - tmpvar_10 = ((texture (_RandomTexture, xlv_TEXCOORD1).xyz * 2.0) - 1.0); - randN_9 = tmpvar_10; - lowp vec4 tmpvar_11; - tmpvar_11 = texture (_CameraDepthNormalsTexture, xlv_TEXCOORD0); - depthnormal_8 = tmpvar_11; - highp vec3 n_12; - highp vec3 tmpvar_13; - tmpvar_13 = ((depthnormal_8.xyz * vec3(3.5554, 3.5554, 0.0)) + vec3(-1.7777, -1.7777, 1.0)); - highp float tmpvar_14; - tmpvar_14 = (2.0 / dot (tmpvar_13, tmpvar_13)); - n_12.xy = (tmpvar_14 * tmpvar_13.xy); - n_12.z = (tmpvar_14 - 1.0); - viewNorm_7 = n_12; - highp float tmpvar_15; - tmpvar_15 = (dot (depthnormal_8.zw, vec2(1.0, 0.00392157)) * _ProjectionParams.z); - depth_6 = tmpvar_15; - scale_5 = (_Params.x / tmpvar_15); + mediump vec3 randN_8; + lowp vec3 tmpvar_9; + tmpvar_9 = ((texture (_RandomTexture, xlv_TEXCOORD1).xyz * 2.0) - 1.0); + randN_8 = tmpvar_9; + highp vec4 tmpvar_10; + tmpvar_10 = texture (_CameraDepthNormalsTexture, xlv_TEXCOORD0); + highp vec3 n_11; + highp vec3 tmpvar_12; + tmpvar_12 = ((tmpvar_10.xyz * vec3(3.5554, 3.5554, 0.0)) + vec3(-1.7777, -1.7777, 1.0)); + highp float tmpvar_13; + tmpvar_13 = (2.0 / dot (tmpvar_12, tmpvar_12)); + n_11.xy = (tmpvar_13 * tmpvar_12.xy); + n_11.z = (tmpvar_13 - 1.0); + viewNorm_7 = n_11; + 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++) { - highp vec4 sampleND_16; - mediump vec3 randomDir_17; - highp vec3 tmpvar_18; - highp vec3 I_19; - I_19 = vec3[8](vec3(0.0130572, 0.587232, -0.119337), vec3(0.323078, 0.0220727, -0.418873), vec3(-0.310725, -0.191367, 0.0561369), vec3(-0.479646, 0.0939877, -0.580265), vec3(0.139999, -0.33577, 0.559679), vec3(-0.248458, 0.255532, 0.348944), vec3(0.18719, -0.702764, -0.231748), vec3(0.884915, 0.284208, 0.368524))[s_3]; - tmpvar_18 = (I_19 - (2.0 * ( - dot (randN_9, I_19) - * randN_9))); - randomDir_17 = tmpvar_18; - highp float tmpvar_20; - tmpvar_20 = dot (viewNorm_7, randomDir_17); - mediump float tmpvar_21; - if ((tmpvar_20 < 0.0)) { - tmpvar_21 = 1.0; + mediump vec3 randomDir_14; + highp vec3 tmpvar_15; + highp vec3 I_16; + I_16 = vec3[8](vec3(0.0130572, 0.587232, -0.119337), vec3(0.323078, 0.0220727, -0.418873), vec3(-0.310725, -0.191367, 0.0561369), vec3(-0.479646, 0.0939877, -0.580265), vec3(0.139999, -0.33577, 0.559679), vec3(-0.248458, 0.255532, 0.348944), vec3(0.18719, -0.702764, -0.231748), vec3(0.884915, 0.284208, 0.368524))[s_3]; + tmpvar_15 = (I_16 - (2.0 * ( + dot (randN_8, I_16) + * randN_8))); + randomDir_14 = tmpvar_15; + highp float tmpvar_17; + tmpvar_17 = dot (viewNorm_7, randomDir_14); + highp float tmpvar_18; + if ((tmpvar_17 < 0.0)) { + tmpvar_18 = 1.0; } else { - tmpvar_21 = -1.0; + tmpvar_18 = -1.0; }; - mediump vec3 tmpvar_22; - tmpvar_22 = (randomDir_17 * -(tmpvar_21)); - highp vec3 tmpvar_23; - tmpvar_23 = (tmpvar_22 + (viewNorm_7 * 0.3)); - randomDir_17 = tmpvar_23; - lowp vec4 tmpvar_24; - highp vec2 P_25; - P_25 = (tmpvar_2 + (randomDir_17.xy * scale_5)); - tmpvar_24 = texture (_CameraDepthNormalsTexture, P_25); - sampleND_16 = tmpvar_24; - highp float tmpvar_26; - tmpvar_26 = clamp (((depth_6 - - (randomDir_17.z * _Params.x) + randomDir_14 = (randomDir_14 * -(tmpvar_18)); + randomDir_14 = (randomDir_14 + (viewNorm_7 * 0.3)); + highp vec4 tmpvar_19; + tmpvar_19 = texture (_CameraDepthNormalsTexture, (tmpvar_2 + (randomDir_14.xy * scale_5))); + highp float tmpvar_20; + tmpvar_20 = clamp (((depth_6 - + (randomDir_14.z * _Params.x) ) - ( - dot (sampleND_16.zw, vec2(1.0, 0.00392157)) + dot (tmpvar_19.zw, vec2(1.0, 0.00392157)) * _ProjectionParams.z)), 0.0, 1.0); - if ((tmpvar_26 > _Params.y)) { - occ_4 = (occ_4 + pow ((1.0 - tmpvar_26), _Params.z)); + if ((tmpvar_20 > _Params.y)) { + occ_4 = (occ_4 + pow ((1.0 - tmpvar_20), _Params.z)); }; }; - highp float tmpvar_27; - tmpvar_27 = (occ_4 / 8.0); - occ_4 = tmpvar_27; - tmpvar_1 = (1.0 - tmpvar_27); + occ_4 = (occ_4 / 8.0); + tmpvar_1 = (1.0 - occ_4); _glesFragData[0] = vec4(tmpvar_1); } -// inputs: 2, stats: 41 alu 3 tex 4 flow +// stats: 41 alu 3 tex 4 flow +// inputs: 2 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// #1: xlv_TEXCOORD1 (high float) 2x1 [-1] +// uniforms: 2 (total size: 0) +// #0: _ProjectionParams (high float) 4x1 [-1] +// #1: _Params (high float) 4x1 [-1] +// textures: 2 +// #0: _CameraDepthNormalsTexture (high 2d) 0x0 [-1] +// #1: _RandomTexture (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3Metal.txt new file mode 100644 index 000000000..e4b5aacfc --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3Metal.txt @@ -0,0 +1,91 @@ +#include +using namespace metal; +constant float3 _xlat_mtl_const1[8] = {float3(0.0130572, 0.587232, -0.119337), float3(0.323078, 0.0220727, -0.418873), float3(-0.310725, -0.191367, 0.0561369), float3(-0.479646, 0.0939877, -0.580265), float3(0.139999, -0.33577, 0.559679), float3(-0.248458, 0.255532, 0.348944), float3(0.18719, -0.702764, -0.231748), float3(0.884915, 0.284208, 0.368524)}; +struct xlatMtlShaderInput { + float2 xlv_TEXCOORD0; + float2 xlv_TEXCOORD1; +}; +struct xlatMtlShaderOutput { + half4 _glesFragData_0 [[color(0)]]; +}; +struct xlatMtlShaderUniform { + float4 _ProjectionParams; + float4 _Params; +}; +fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , texture2d _CameraDepthNormalsTexture [[texture(0)]], sampler _mtlsmp__CameraDepthNormalsTexture [[sampler(0)]] + , texture2d _RandomTexture [[texture(1)]], sampler _mtlsmp__RandomTexture [[sampler(1)]]) +{ + xlatMtlShaderOutput _mtl_o; + half tmpvar_1; + float2 tmpvar_2; + tmpvar_2 = _mtl_i.xlv_TEXCOORD0; + float occ_4; + float scale_5; + float depth_6; + float3 viewNorm_7; + half3 randN_8; + half3 tmpvar_9; + tmpvar_9 = ((_RandomTexture.sample(_mtlsmp__RandomTexture, (float2)(_mtl_i.xlv_TEXCOORD1)).xyz * (half)2.0) - (half)1.0); + randN_8 = tmpvar_9; + float4 tmpvar_10; + tmpvar_10 = float4(_CameraDepthNormalsTexture.sample(_mtlsmp__CameraDepthNormalsTexture, (float2)(_mtl_i.xlv_TEXCOORD0))); + float3 n_11; + float3 tmpvar_12; + tmpvar_12 = ((tmpvar_10.xyz * float3(3.5554, 3.5554, 0.0)) + float3(-1.7777, -1.7777, 1.0)); + float tmpvar_13; + tmpvar_13 = (2.0 / dot (tmpvar_12, tmpvar_12)); + n_11.xy = (tmpvar_13 * tmpvar_12.xy); + n_11.z = (tmpvar_13 - 1.0); + viewNorm_7 = n_11; + depth_6 = (dot (tmpvar_10.zw, float2(1.0, 0.00392157)) * _mtl_u._ProjectionParams.z); + scale_5 = (_mtl_u._Params.x / depth_6); + occ_4 = 0.0; + for (int s_3 = 0; s_3 < 8; s_3++) { + half3 randomDir_14; + float3 tmpvar_15; + float3 I_16; + I_16 = _xlat_mtl_const1[s_3]; + tmpvar_15 = (I_16 - (float3)((half)2.0 * ((half3)( + dot ((float3)randN_8, I_16) + * (float3)randN_8)))); + randomDir_14 = half3(tmpvar_15); + float tmpvar_17; + tmpvar_17 = dot (viewNorm_7, (float3)randomDir_14); + float tmpvar_18; + if ((tmpvar_17 < 0.0)) { + tmpvar_18 = 1.0; + } else { + tmpvar_18 = -1.0; + }; + randomDir_14 = (randomDir_14 * ((half)-(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))))); + float tmpvar_20; + tmpvar_20 = clamp (((depth_6 - + ((float)randomDir_14.z * _mtl_u._Params.x) + ) - ( + dot (tmpvar_19.zw, float2(1.0, 0.00392157)) + * _mtl_u._ProjectionParams.z)), 0.0, 1.0); + if ((tmpvar_20 > _mtl_u._Params.y)) { + occ_4 = (occ_4 + pow ((1.0 - tmpvar_20), _mtl_u._Params.z)); + }; + }; + occ_4 = (occ_4 / 8.0); + tmpvar_1 = half((1.0 - occ_4)); + _mtl_o._glesFragData_0 = half4(tmpvar_1); + return _mtl_o; +} + + +// stats: 41 alu 3 tex 4 flow +// inputs: 2 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// #1: xlv_TEXCOORD1 (high float) 2x1 [-1] +// uniforms: 2 (total size: 32) +// #0: _ProjectionParams (high float) 4x1 [-1] loc 0 +// #1: _Params (high float) 4x1 [-1] loc 16 +// textures: 2 +// #0: _CameraDepthNormalsTexture (high 2d) 0x0 [-1] loc 0 +// #1: _RandomTexture (low 2d) 0x0 [-1] loc 1 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO8-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO8-irES.txt deleted file mode 100644 index 8be54d020..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO8-irES.txt +++ /dev/null @@ -1,355 +0,0 @@ -struct v2f_ao { - highp vec4 pos; - highp vec2 uv; - highp vec2 uvr; -}; -uniform sampler2D _CameraDepthNormalsTexture; -uniform sampler2D _RandomTexture; -uniform highp vec4 _Params; -uniform highp vec4 _ProjectionParams; -varying highp vec2 xlv_TEXCOORD0; -varying highp vec2 xlv_TEXCOORD1; -mediump float xll_saturate_f ( - in mediump float x_1 -) -{ - mediump float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -mediump vec2 xll_saturate_vf2 ( - in mediump vec2 x_3 -) -{ - mediump vec2 tmpvar_4; - tmpvar_4 = clamp (x_3, 0.0, 1.0); - return tmpvar_4; -} - -mediump vec3 xll_saturate_vf3 ( - in mediump vec3 x_5 -) -{ - mediump vec3 tmpvar_6; - tmpvar_6 = clamp (x_5, 0.0, 1.0); - return tmpvar_6; -} - -mediump vec4 xll_saturate_vf4 ( - in mediump vec4 x_7 -) -{ - mediump vec4 tmpvar_8; - tmpvar_8 = clamp (x_7, 0.0, 1.0); - return tmpvar_8; -} - -mediump mat2 xll_saturate_mf2x2 ( - in mediump mat2 m_9 -) -{ - mediump vec2 tmpvar_10; - tmpvar_10 = clamp (m_9[0], 0.0, 1.0); - mediump vec2 tmpvar_11; - tmpvar_11 = clamp (m_9[1], 0.0, 1.0); - mediump mat2 tmpvar_12; - mediump vec2 tmpvar_13; - tmpvar_13 = tmpvar_10; - tmpvar_12[0] = tmpvar_13; - mediump vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_12[1] = tmpvar_14; - return tmpvar_12; -} - -mediump mat3 xll_saturate_mf3x3 ( - in mediump mat3 m_15 -) -{ - mediump vec3 tmpvar_16; - tmpvar_16 = clamp (m_15[0], 0.0, 1.0); - mediump vec3 tmpvar_17; - tmpvar_17 = clamp (m_15[1], 0.0, 1.0); - mediump vec3 tmpvar_18; - tmpvar_18 = clamp (m_15[2], 0.0, 1.0); - mediump mat3 tmpvar_19; - mediump vec3 tmpvar_20; - tmpvar_20 = tmpvar_16; - tmpvar_19[0] = tmpvar_20; - mediump vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_19[1] = tmpvar_21; - mediump vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_19[2] = tmpvar_22; - return tmpvar_19; -} - -mediump mat4 xll_saturate_mf4x4 ( - in mediump mat4 m_23 -) -{ - mediump vec4 tmpvar_24; - tmpvar_24 = clamp (m_23[0], 0.0, 1.0); - mediump vec4 tmpvar_25; - tmpvar_25 = clamp (m_23[1], 0.0, 1.0); - mediump vec4 tmpvar_26; - tmpvar_26 = clamp (m_23[2], 0.0, 1.0); - mediump vec4 tmpvar_27; - tmpvar_27 = clamp (m_23[3], 0.0, 1.0); - mediump mat4 tmpvar_28; - mediump vec4 tmpvar_29; - tmpvar_29 = tmpvar_24; - tmpvar_28[0] = tmpvar_29; - mediump vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_28[1] = tmpvar_30; - mediump vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_28[2] = tmpvar_31; - mediump vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_28[3] = tmpvar_32; - return tmpvar_28; -} - -float DecodeFloatRG ( - in highp vec2 enc_33 -) -{ - highp vec2 kDecodeDot_34; - mediump vec2 tmpvar_35; - tmpvar_35 = vec2(1.0, 0.00392157); - kDecodeDot_34 = tmpvar_35; - highp float tmpvar_36; - tmpvar_36 = dot (enc_33, kDecodeDot_34); - return tmpvar_36; -} - -vec3 DecodeViewNormalStereo ( - in highp vec4 enc4_37 -) -{ - highp vec3 n_38; - highp float g_39; - highp vec3 nn_40; - highp float kScale_41; - mediump float tmpvar_42; - tmpvar_42 = 1.7777; - kScale_41 = tmpvar_42; - highp vec3 tmpvar_43; - tmpvar_43.z = 0.0; - tmpvar_43.x = (2.0 * kScale_41); - tmpvar_43.y = (2.0 * kScale_41); - highp vec3 tmpvar_44; - tmpvar_44.z = 1.0; - tmpvar_44.x = -(kScale_41); - tmpvar_44.y = -(kScale_41); - highp vec3 tmpvar_45; - tmpvar_45 = ((enc4_37.xyz * tmpvar_43) + tmpvar_44); - nn_40 = tmpvar_45; - highp float tmpvar_46; - tmpvar_46 = dot (nn_40.xyz, nn_40.xyz); - highp float tmpvar_47; - tmpvar_47 = (2.0 / tmpvar_46); - g_39 = tmpvar_47; - highp vec2 tmpvar_48; - tmpvar_48 = (g_39 * nn_40.xy); - n_38.xy = tmpvar_48.xy.xy; - highp float tmpvar_49; - tmpvar_49 = (g_39 - 1.0); - n_38.z = vec3(tmpvar_49).z; - return n_38; -} - -void DecodeDepthNormal ( - in highp vec4 enc_50, - out highp float depth_51, - out highp vec3 normal_52 -) -{ - highp float tmpvar_53; - tmpvar_53 = DecodeFloatRG (enc_50.zw); - highp float tmpvar_54; - tmpvar_54 = tmpvar_53; - depth_51 = tmpvar_54; - highp vec3 tmpvar_55; - tmpvar_55 = DecodeViewNormalStereo (enc_50); - highp vec3 tmpvar_56; - tmpvar_56 = tmpvar_55; - normal_52 = tmpvar_56; -} - -mediump float frag_ao ( - in v2f_ao i_57, - in int sampleCount_58, - in highp vec3 samples_59[8] -) -{ - int s_60; - highp float occ_61; - highp float scale_62; - highp float depth_63; - highp vec3 viewNorm_64; - highp vec4 depthnormal_65; - mediump vec3 randN_66; - lowp vec4 tmpvar_67; - tmpvar_67 = texture2D (_RandomTexture, i_57.uvr); - lowp vec3 tmpvar_68; - tmpvar_68 = ((tmpvar_67.xyz * 2.0) - 1.0); - randN_66 = tmpvar_68; - lowp vec4 tmpvar_69; - tmpvar_69 = texture2D (_CameraDepthNormalsTexture, i_57.uv); - lowp vec4 tmpvar_70; - tmpvar_70 = tmpvar_69; - depthnormal_65 = tmpvar_70; - DecodeDepthNormal (depthnormal_65, depth_63, viewNorm_64); - highp float tmpvar_71; - tmpvar_71 = (depth_63 * _ProjectionParams.z); - depth_63 = tmpvar_71; - highp float tmpvar_72; - tmpvar_72 = (_Params.x / depth_63); - scale_62 = tmpvar_72; - mediump float tmpvar_73; - tmpvar_73 = 0.0; - occ_61 = tmpvar_73; - int tmpvar_74; - tmpvar_74 = 0; - s_60 = tmpvar_74; - while (true) { - highp float zd_75; - highp vec3 sampleN_76; - highp float sampleD_77; - highp vec4 sampleND_78; - highp float sD_79; - highp vec2 offset_80; - mediump float flip_81; - mediump vec3 randomDir_82; - if (!((s_60 < sampleCount_58))) { - break; - }; - highp vec3 tmpvar_83; - tmpvar_83 = reflect (samples_59[s_60], randN_66); - highp vec3 tmpvar_84; - tmpvar_84 = tmpvar_83; - randomDir_82 = tmpvar_84; - highp float tmpvar_85; - tmpvar_85 = dot (viewNorm_64, randomDir_82); - mediump float tmpvar_86; - if ((tmpvar_85 < 0.0)) { - tmpvar_86 = 1.0; - } else { - tmpvar_86 = -(1.0); - }; - mediump float tmpvar_87; - tmpvar_87 = tmpvar_86; - flip_81 = tmpvar_87; - mediump vec3 tmpvar_88; - tmpvar_88 = (randomDir_82 * -(flip_81)); - randomDir_82 = tmpvar_88; - highp vec3 tmpvar_89; - tmpvar_89 = (randomDir_82 + (viewNorm_64 * 0.3)); - randomDir_82 = tmpvar_89; - highp vec2 tmpvar_90; - tmpvar_90 = (randomDir_82.xy * scale_62); - offset_80 = tmpvar_90; - highp float tmpvar_91; - tmpvar_91 = (depth_63 - (randomDir_82.z * _Params.x)); - sD_79 = tmpvar_91; - lowp vec4 tmpvar_92; - tmpvar_92 = texture2D (_CameraDepthNormalsTexture, (i_57.uv + offset_80)); - lowp vec4 tmpvar_93; - tmpvar_93 = tmpvar_92; - sampleND_78 = tmpvar_93; - DecodeDepthNormal (sampleND_78, sampleD_77, sampleN_76); - highp float tmpvar_94; - tmpvar_94 = (sampleD_77 * _ProjectionParams.z); - sampleD_77 = tmpvar_94; - mediump float tmpvar_95; - tmpvar_95 = xll_saturate_f ((sD_79 - sampleD_77)); - mediump float tmpvar_96; - tmpvar_96 = tmpvar_95; - zd_75 = tmpvar_96; - if ((zd_75 > _Params.y)) { - highp float tmpvar_97; - tmpvar_97 = pow ((1.0 - zd_75), _Params.z); - highp float tmpvar_98; - tmpvar_98 = (occ_61 + tmpvar_97); - occ_61 = tmpvar_98; - }; - int tmpvar_99; - tmpvar_99 = (s_60 + 1); - s_60 = tmpvar_99; - }; - highp float tmpvar_100; - tmpvar_100 = (occ_61 / float(sampleCount_58)); - occ_61 = tmpvar_100; - return (1.0 - occ_61); -} - -mediump vec4 xlat_main ( - in v2f_ao i_101 -) -{ - highp vec3 RAND_SAMPLES_102[8]; - mediump vec3 tmpvar_103; - tmpvar_103 = vec3(0.0130572, 0.587232, -0.119337); - RAND_SAMPLES_102[0] = tmpvar_103; - mediump vec3 tmpvar_104; - tmpvar_104 = vec3(0.323078, 0.0220727, -0.418873); - RAND_SAMPLES_102[1] = tmpvar_104; - mediump vec3 tmpvar_105; - tmpvar_105 = vec3(-0.310725, -0.191367, 0.0561369); - RAND_SAMPLES_102[2] = tmpvar_105; - mediump vec3 tmpvar_106; - tmpvar_106 = vec3(-0.479646, 0.0939877, -0.580265); - RAND_SAMPLES_102[3] = tmpvar_106; - mediump vec3 tmpvar_107; - tmpvar_107 = vec3(0.139999, -0.33577, 0.559679); - RAND_SAMPLES_102[4] = tmpvar_107; - mediump vec3 tmpvar_108; - tmpvar_108 = vec3(-0.248458, 0.255532, 0.348944); - RAND_SAMPLES_102[5] = tmpvar_108; - mediump vec3 tmpvar_109; - tmpvar_109 = vec3(0.18719, -0.702764, -0.231748); - RAND_SAMPLES_102[6] = tmpvar_109; - mediump vec3 tmpvar_110; - tmpvar_110 = vec3(0.884915, 0.284208, 0.368524); - RAND_SAMPLES_102[7] = tmpvar_110; - mediump float tmpvar_111; - tmpvar_111 = frag_ao (i_101, 8, RAND_SAMPLES_102); - mediump vec4 tmpvar_112; - tmpvar_112 = vec4(tmpvar_111); - return tmpvar_112; -} - -void main () -{ - v2f_ao xlt_i_113; - mediump vec4 xl_retval_114; - mediump vec4 tmpvar_115; - tmpvar_115 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_113.pos = tmpvar_115; - highp vec2 tmpvar_116; - tmpvar_116 = xlv_TEXCOORD0.xy; - highp vec2 tmpvar_117; - tmpvar_117 = tmpvar_116; - xlt_i_113.uv = tmpvar_117; - highp vec2 tmpvar_118; - tmpvar_118 = xlv_TEXCOORD1.xy; - highp vec2 tmpvar_119; - tmpvar_119 = tmpvar_118; - xlt_i_113.uvr = tmpvar_119; - mediump vec4 tmpvar_120; - tmpvar_120 = xlat_main (xlt_i_113); - mediump vec4 tmpvar_121; - tmpvar_121 = tmpvar_120; - xl_retval_114 = tmpvar_121; - mediump vec4 tmpvar_122; - tmpvar_122 = xl_retval_114.xyzw; - mediump vec4 tmpvar_123; - tmpvar_123 = tmpvar_122; - gl_FragData[0] = tmpvar_123; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO8-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO8-outES.txt index 82d6281ee..8f2a999d4 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO8-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO8-outES.txt @@ -40,55 +40,57 @@ void main () n_14.xy = (tmpvar_16 * tmpvar_15.xy); n_14.z = (tmpvar_16 - 1.0); viewNorm_9 = n_14; - highp float tmpvar_17; - tmpvar_17 = (dot (depthnormal_10.zw, vec2(1.0, 0.00392157)) * _ProjectionParams.z); - depth_8 = tmpvar_17; - scale_7 = (_Params.x / tmpvar_17); + 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++) { - highp vec4 sampleND_18; - mediump vec3 randomDir_19; - highp vec3 tmpvar_20; - highp vec3 I_21; - I_21 = samples_4[s_5]; - tmpvar_20 = (I_21 - (2.0 * ( - dot (randN_11, I_21) + highp vec4 sampleND_17; + mediump vec3 randomDir_18; + highp vec3 tmpvar_19; + highp vec3 I_20; + I_20 = samples_4[s_5]; + tmpvar_19 = (I_20 - (2.0 * ( + dot (randN_11, I_20) * randN_11))); - randomDir_19 = tmpvar_20; + randomDir_18 = tmpvar_19; + highp float tmpvar_21; + tmpvar_21 = dot (viewNorm_9, randomDir_18); highp float tmpvar_22; - tmpvar_22 = dot (viewNorm_9, randomDir_19); - mediump float tmpvar_23; - if ((tmpvar_22 < 0.0)) { - tmpvar_23 = 1.0; + if ((tmpvar_21 < 0.0)) { + tmpvar_22 = 1.0; } else { - tmpvar_23 = -1.0; + tmpvar_22 = -1.0; }; - mediump vec3 tmpvar_24; - tmpvar_24 = (randomDir_19 * -(tmpvar_23)); - highp vec3 tmpvar_25; - tmpvar_25 = (tmpvar_24 + (viewNorm_9 * 0.3)); - randomDir_19 = tmpvar_25; - lowp vec4 tmpvar_26; - highp vec2 P_27; - P_27 = (tmpvar_3 + (randomDir_19.xy * scale_7)); - tmpvar_26 = texture2D (_CameraDepthNormalsTexture, P_27); - sampleND_18 = tmpvar_26; - highp float tmpvar_28; - tmpvar_28 = clamp (((depth_8 - - (randomDir_19.z * _Params.x) + randomDir_18 = (randomDir_18 * -(tmpvar_22)); + randomDir_18 = (randomDir_18 + (viewNorm_9 * 0.3)); + lowp vec4 tmpvar_23; + highp vec2 P_24; + P_24 = (tmpvar_3 + (randomDir_18.xy * scale_7)); + tmpvar_23 = texture2D (_CameraDepthNormalsTexture, P_24); + sampleND_17 = tmpvar_23; + highp float tmpvar_25; + tmpvar_25 = clamp (((depth_8 - + (randomDir_18.z * _Params.x) ) - ( - dot (sampleND_18.zw, vec2(1.0, 0.00392157)) + dot (sampleND_17.zw, vec2(1.0, 0.00392157)) * _ProjectionParams.z)), 0.0, 1.0); - if ((tmpvar_28 > _Params.y)) { - occ_6 = (occ_6 + pow ((1.0 - tmpvar_28), _Params.z)); + if ((tmpvar_25 > _Params.y)) { + occ_6 = (occ_6 + pow ((1.0 - tmpvar_25), _Params.z)); }; }; - highp float tmpvar_29; - tmpvar_29 = (occ_6 / 8.0); - occ_6 = tmpvar_29; - tmpvar_2 = (1.0 - tmpvar_29); + occ_6 = (occ_6 / 8.0); + tmpvar_2 = (1.0 - occ_6); gl_FragData[0] = vec4(tmpvar_2); } -// inputs: 2, stats: 49 alu 3 tex 4 flow +// stats: 49 alu 3 tex 4 flow +// inputs: 2 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// #1: xlv_TEXCOORD1 (high float) 2x1 [-1] +// uniforms: 2 (total size: 0) +// #0: _Params (high float) 4x1 [-1] +// #1: _ProjectionParams (high float) 4x1 [-1] +// textures: 2 +// #0: _CameraDepthNormalsTexture (low 2d) 0x0 [-1] +// #1: _RandomTexture (low 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-ir.txt deleted file mode 100644 index 3546f8dd2..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-ir.txt +++ /dev/null @@ -1,221 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_Illum; - vec2 uv_BumpMap; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 lightDir; - vec4 _LightCoord; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform sampler2D _Illum; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -void surf ( - in Input IN_6, - inout SurfaceOutput o_7 -) -{ - vec4 c_8; - vec4 tex_9; - vec4 tmpvar_10; - tmpvar_10 = texture2D (_MainTex, IN_6.uv_MainTex); - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - tex_9 = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12 = (tex_9 * _Color); - c_8 = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13 = c_8.xyz; - o_7.Albedo = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = texture2D (_Illum, IN_6.uv_Illum); - vec3 tmpvar_15; - tmpvar_15 = (c_8.xyz * tmpvar_14.w); - o_7.Emission = tmpvar_15; - float tmpvar_16; - tmpvar_16 = c_8.w; - o_7.Alpha = tmpvar_16; - vec4 tmpvar_17; - tmpvar_17 = texture2D (_BumpMap, IN_6.uv_BumpMap); - vec4 tmpvar_18; - tmpvar_18 = UnpackNormal (tmpvar_17); - vec3 tmpvar_19; - tmpvar_19 = tmpvar_18.xyz; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_19; - o_7.Normal = tmpvar_20; -} - -float UnitySpotCookie ( - in vec4 LightCoord_21 -) -{ - vec4 tmpvar_22; - tmpvar_22 = texture2D (_LightTexture0, ((LightCoord_21.xy / LightCoord_21.w) + 0.5)); - return tmpvar_22.w; -} - -float UnitySpotAttenuate ( - in vec3 LightCoord_23 -) -{ - float tmpvar_24; - tmpvar_24 = dot (LightCoord_23, LightCoord_23); - vec2 tmpvar_25; - tmpvar_25 = vec2(tmpvar_24); - vec2 tmpvar_26; - tmpvar_26 = tmpvar_25.xy; - vec4 tmpvar_27; - tmpvar_27 = texture2D (_LightTextureB0, tmpvar_26); - return tmpvar_27.w; -} - -vec4 LightingLambert ( - in SurfaceOutput s_28, - in vec3 lightDir_29, - in float atten_30 -) -{ - vec4 c_31; - float diff_32; - float tmpvar_33; - tmpvar_33 = dot (s_28.Normal, lightDir_29); - float tmpvar_34; - tmpvar_34 = max (0.0, tmpvar_33); - float tmpvar_35; - tmpvar_35 = tmpvar_34; - diff_32 = tmpvar_35; - vec3 tmpvar_36; - tmpvar_36 = ((s_28.Albedo * _LightColor0.xyz) * ((diff_32 * atten_30) * 2.0)); - c_31.xyz = tmpvar_36.xyz.xyz; - float tmpvar_37; - tmpvar_37 = s_28.Alpha; - c_31.w = vec4(tmpvar_37).w; - return c_31; -} - -vec4 frag_surf ( - in v2f_surf IN_38 -) -{ - vec4 c_39; - vec3 lightDir_40; - SurfaceOutput o_41; - Input surfIN_42; - vec2 tmpvar_43; - tmpvar_43 = IN_38.hip_pack0.xy; - surfIN_42.uv_MainTex = tmpvar_43; - vec2 tmpvar_44; - tmpvar_44 = IN_38.hip_pack0.zw; - surfIN_42.uv_BumpMap = tmpvar_44; - vec3 tmpvar_45; - tmpvar_45 = vec3(0.0, 0.0, 0.0); - o_41.Albedo = tmpvar_45; - vec3 tmpvar_46; - tmpvar_46 = vec3(0.0, 0.0, 0.0); - o_41.Emission = tmpvar_46; - float tmpvar_47; - tmpvar_47 = 0.0; - o_41.Specular = tmpvar_47; - float tmpvar_48; - tmpvar_48 = 0.0; - o_41.Alpha = tmpvar_48; - float tmpvar_49; - tmpvar_49 = 0.0; - o_41.Gloss = tmpvar_49; - surf (surfIN_42, o_41); - vec3 tmpvar_50; - tmpvar_50 = IN_38.lightDir; - lightDir_40 = tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = normalize (lightDir_40); - vec3 tmpvar_52; - tmpvar_52 = tmpvar_51; - lightDir_40 = tmpvar_52; - float tmpvar_53; - tmpvar_53 = UnitySpotCookie (IN_38._LightCoord); - float tmpvar_54; - tmpvar_54 = UnitySpotAttenuate (IN_38._LightCoord.xyz); - vec4 tmpvar_55; - tmpvar_55 = LightingLambert (o_41, lightDir_40, ((float( - (IN_38._LightCoord.z > 0.0) - ) * tmpvar_53) * tmpvar_54)); - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - c_39 = tmpvar_56; - float tmpvar_57; - tmpvar_57 = 0.0; - c_39.w = vec4(tmpvar_57).w; - return c_39; -} - -void main () -{ - v2f_surf xlt_IN_58; - vec4 xl_retval_59; - vec4 tmpvar_60; - tmpvar_60 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_58.pos = tmpvar_60; - float tmpvar_61; - tmpvar_61 = xlv_FOG.x; - xlt_IN_58.fog = tmpvar_61; - vec4 tmpvar_62; - tmpvar_62 = gl_TexCoord[0].xyzw; - vec4 tmpvar_63; - tmpvar_63 = tmpvar_62; - xlt_IN_58.hip_pack0 = tmpvar_63; - vec3 tmpvar_64; - tmpvar_64 = gl_TexCoord[1].xyz; - vec3 tmpvar_65; - tmpvar_65 = tmpvar_64; - xlt_IN_58.lightDir = tmpvar_65; - vec4 tmpvar_66; - tmpvar_66 = gl_TexCoord[2].xyzw; - vec4 tmpvar_67; - tmpvar_67 = tmpvar_66; - xlt_IN_58._LightCoord = tmpvar_67; - vec4 tmpvar_68; - tmpvar_68 = frag_surf (xlt_IN_58); - vec4 tmpvar_69; - tmpvar_69 = tmpvar_68; - xl_retval_59 = tmpvar_69; - vec4 tmpvar_70; - tmpvar_70 = xl_retval_59.xyzw; - vec4 tmpvar_71; - tmpvar_71 = tmpvar_70; - gl_FragData[0] = tmpvar_71; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-out.txt index a24e6143f..1a8b2f847 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-out.txt @@ -11,24 +11,34 @@ void main () vec4 tmpvar_2; tmpvar_2 = gl_TexCoord[2]; vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = (texture2D (_MainTex, tmpvar_1.xy) * _Color); + vec4 c_4; + c_4 = (texture2D (_MainTex, tmpvar_1.xy) * _Color); vec4 normal_5; normal_5.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0); normal_5.z = sqrt(((1.0 - (normal_5.x * normal_5.x) ) - (normal_5.y * normal_5.y))); vec4 c_6; - c_6.xyz = ((tmpvar_4.xyz * _LightColor0.xyz) * (( + c_6.xyz = ((c_4.xyz * _LightColor0.xyz) * (( max (0.0, dot (normal_5.xyz, normalize(gl_TexCoord[1].xyz))) * ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w) ) * 2.0)); - c_6.w = tmpvar_4.w; + c_6.w = c_4.w; c_3.xyz = c_6.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } -// inputs: 1, stats: 23 alu 4 tex 0 flow +// stats: 23 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// textures: 4 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _LightTexture0 (high 2d) 0x0 [-1] +// #2: _LightTextureB0 (high 2d) 0x0 [-1] +// #3: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-ir.txt deleted file mode 100644 index c5955e859..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-ir.txt +++ /dev/null @@ -1,170 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_Illum; - vec2 uv_BumpMap; -}; -struct v2f_surf { - vec4 pos; - vec2 hip_pack0; - vec3 TtoV0; - vec3 TtoV1; - vec3 TtoV2; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform sampler2D _Illum; -uniform sampler2D _MainTex; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -void surf ( - in Input IN_6, - inout SurfaceOutput o_7 -) -{ - vec4 c_8; - vec4 tex_9; - vec4 tmpvar_10; - tmpvar_10 = texture2D (_MainTex, IN_6.uv_MainTex); - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - tex_9 = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12 = (tex_9 * _Color); - c_8 = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13 = c_8.xyz; - o_7.Albedo = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = texture2D (_Illum, IN_6.uv_Illum); - vec3 tmpvar_15; - tmpvar_15 = (c_8.xyz * tmpvar_14.w); - o_7.Emission = tmpvar_15; - float tmpvar_16; - tmpvar_16 = c_8.w; - o_7.Alpha = tmpvar_16; - vec4 tmpvar_17; - tmpvar_17 = texture2D (_BumpMap, IN_6.uv_BumpMap); - vec4 tmpvar_18; - tmpvar_18 = UnpackNormal (tmpvar_17); - vec3 tmpvar_19; - tmpvar_19 = tmpvar_18.xyz; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_19; - o_7.Normal = tmpvar_20; -} - -vec4 frag_surf ( - in v2f_surf IN_21 -) -{ - vec4 res_22; - vec3 viewN_23; - SurfaceOutput o_24; - Input surfIN_25; - vec2 tmpvar_26; - tmpvar_26 = IN_21.hip_pack0.xy; - surfIN_25.uv_BumpMap = tmpvar_26; - vec3 tmpvar_27; - tmpvar_27 = vec3(0.0, 0.0, 0.0); - o_24.Albedo = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = vec3(0.0, 0.0, 0.0); - o_24.Emission = tmpvar_28; - float tmpvar_29; - tmpvar_29 = 0.0; - o_24.Specular = tmpvar_29; - float tmpvar_30; - tmpvar_30 = 0.0; - o_24.Alpha = tmpvar_30; - float tmpvar_31; - tmpvar_31 = 0.0; - o_24.Gloss = tmpvar_31; - surf (surfIN_25, o_24); - float tmpvar_32; - tmpvar_32 = dot (IN_21.TtoV0, o_24.Normal); - float tmpvar_33; - tmpvar_33 = tmpvar_32; - viewN_23.x = tmpvar_33; - float tmpvar_34; - tmpvar_34 = dot (IN_21.TtoV1, o_24.Normal); - float tmpvar_35; - tmpvar_35 = tmpvar_34; - viewN_23.y = vec2(tmpvar_35).y; - float tmpvar_36; - tmpvar_36 = dot (IN_21.TtoV2, o_24.Normal); - float tmpvar_37; - tmpvar_37 = tmpvar_36; - viewN_23.z = vec3(tmpvar_37).z; - vec3 tmpvar_38; - tmpvar_38 = viewN_23; - o_24.Normal = tmpvar_38; - vec3 tmpvar_39; - tmpvar_39 = ((o_24.Normal * vec3(0.5, 0.5, -0.5)) + 0.5); - res_22.xyz = tmpvar_39.xyz.xyz; - float tmpvar_40; - tmpvar_40 = o_24.Specular; - res_22.w = vec4(tmpvar_40).w; - return res_22; -} - -void main () -{ - v2f_surf xlt_IN_41; - vec4 xl_retval_42; - vec4 tmpvar_43; - tmpvar_43 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_41.pos = tmpvar_43; - vec2 tmpvar_44; - tmpvar_44 = gl_TexCoord[0].xy; - vec2 tmpvar_45; - tmpvar_45 = tmpvar_44; - xlt_IN_41.hip_pack0 = tmpvar_45; - vec3 tmpvar_46; - tmpvar_46 = gl_TexCoord[1].xyz; - vec3 tmpvar_47; - tmpvar_47 = tmpvar_46; - xlt_IN_41.TtoV0 = tmpvar_47; - vec3 tmpvar_48; - tmpvar_48 = gl_TexCoord[2].xyz; - vec3 tmpvar_49; - tmpvar_49 = tmpvar_48; - xlt_IN_41.TtoV1 = tmpvar_49; - vec3 tmpvar_50; - tmpvar_50 = gl_TexCoord[3].xyz; - vec3 tmpvar_51; - tmpvar_51 = tmpvar_50; - xlt_IN_41.TtoV2 = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = frag_surf (xlt_IN_41); - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - xl_retval_42 = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54 = xl_retval_42.xyzw; - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - gl_FragData[0] = tmpvar_55; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-out.txt index 0632599f9..bf03f0203 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-out.txt @@ -17,4 +17,8 @@ void main () } -// inputs: 1, stats: 13 alu 1 tex 0 flow +// stats: 13 alu 1 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// textures: 1 +// #0: _BumpMap (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-ir.txt deleted file mode 100644 index 3033cc4ae..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-ir.txt +++ /dev/null @@ -1,180 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_Illum; - vec2 uv_BumpMap; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec4 hip_screen; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform sampler2D _Illum; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform vec4 unity_Ambient; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -void surf ( - in Input IN_6, - inout SurfaceOutput o_7 -) -{ - vec4 c_8; - vec4 tex_9; - vec4 tmpvar_10; - tmpvar_10 = texture2D (_MainTex, IN_6.uv_MainTex); - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - tex_9 = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12 = (tex_9 * _Color); - c_8 = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13 = c_8.xyz; - o_7.Albedo = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = texture2D (_Illum, IN_6.uv_Illum); - vec3 tmpvar_15; - tmpvar_15 = (c_8.xyz * tmpvar_14.w); - o_7.Emission = tmpvar_15; - float tmpvar_16; - tmpvar_16 = c_8.w; - o_7.Alpha = tmpvar_16; - vec4 tmpvar_17; - tmpvar_17 = texture2D (_BumpMap, IN_6.uv_BumpMap); - vec4 tmpvar_18; - tmpvar_18 = UnpackNormal (tmpvar_17); - vec3 tmpvar_19; - tmpvar_19 = tmpvar_18.xyz; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_19; - o_7.Normal = tmpvar_20; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_21, - in vec4 light_22 -) -{ - vec4 c_23; - vec3 tmpvar_24; - tmpvar_24 = (s_21.Albedo * light_22.xyz); - c_23.xyz = tmpvar_24.xyz.xyz; - float tmpvar_25; - tmpvar_25 = s_21.Alpha; - c_23.w = vec4(tmpvar_25).w; - return c_23; -} - -vec4 frag_surf ( - in v2f_surf IN_26 -) -{ - vec4 col_27; - vec4 light_28; - SurfaceOutput o_29; - Input surfIN_30; - vec2 tmpvar_31; - tmpvar_31 = IN_26.hip_pack0.xy; - surfIN_30.uv_MainTex = tmpvar_31; - vec2 tmpvar_32; - tmpvar_32 = IN_26.hip_pack0.zw; - surfIN_30.uv_Illum = tmpvar_32; - vec3 tmpvar_33; - tmpvar_33 = vec3(0.0, 0.0, 0.0); - o_29.Albedo = tmpvar_33; - vec3 tmpvar_34; - tmpvar_34 = vec3(0.0, 0.0, 0.0); - o_29.Emission = tmpvar_34; - float tmpvar_35; - tmpvar_35 = 0.0; - o_29.Specular = tmpvar_35; - float tmpvar_36; - tmpvar_36 = 0.0; - o_29.Alpha = tmpvar_36; - float tmpvar_37; - tmpvar_37 = 0.0; - o_29.Gloss = tmpvar_37; - surf (surfIN_30, o_29); - vec4 tmpvar_38; - tmpvar_38 = texture2DProj (_LightBuffer, IN_26.hip_screen); - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - light_28 = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = log2 (light_28); - vec4 tmpvar_41; - tmpvar_41 = -(tmpvar_40); - light_28 = tmpvar_41; - vec3 tmpvar_42; - tmpvar_42 = (light_28.xyz + unity_Ambient.xyz); - light_28.xyz = tmpvar_42.xyz.xyz; - vec4 tmpvar_43; - tmpvar_43 = LightingLambert_PrePass (o_29, light_28); - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - col_27 = tmpvar_44; - vec3 tmpvar_45; - tmpvar_45 = (col_27.xyz + o_29.Emission); - col_27.xyz = tmpvar_45.xyz.xyz; - return col_27; -} - -void main () -{ - v2f_surf xlt_IN_46; - vec4 xl_retval_47; - vec4 tmpvar_48; - tmpvar_48 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_46.pos = tmpvar_48; - float tmpvar_49; - tmpvar_49 = xlv_FOG.x; - xlt_IN_46.fog = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50 = gl_TexCoord[0].xyzw; - vec4 tmpvar_51; - tmpvar_51 = tmpvar_50; - xlt_IN_46.hip_pack0 = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = gl_TexCoord[1].xyzw; - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - xlt_IN_46.hip_screen = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54 = frag_surf (xlt_IN_46); - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - xl_retval_47 = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = xl_retval_47.xyzw; - vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - gl_FragData[0] = tmpvar_57; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-out.txt index 298da8e6c..6561ac56a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-out.txt @@ -1,4 +1,3 @@ -uniform sampler2D _BumpMap; uniform vec4 _Color; uniform sampler2D _Illum; uniform sampler2D _LightBuffer; @@ -10,25 +9,26 @@ void main () tmpvar_1 = gl_TexCoord[0]; vec4 col_2; vec4 light_3; - vec2 tmpvar_4; - vec4 tmpvar_5; - tmpvar_5 = (texture2D (_MainTex, tmpvar_1.xy) * _Color); - vec4 normal_6; - normal_6.xy = ((texture2D (_BumpMap, tmpvar_4).wy * 2.0) - 1.0); - normal_6.z = sqrt(((1.0 - - (normal_6.x * normal_6.x) - ) - (normal_6.y * normal_6.y))); - vec4 tmpvar_7; - tmpvar_7 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); - light_3.w = tmpvar_7.w; - light_3.xyz = (tmpvar_7.xyz + unity_Ambient.xyz); - vec4 c_8; - c_8.xyz = (tmpvar_5.xyz * light_3.xyz); - c_8.w = tmpvar_5.w; - col_2.w = c_8.w; - col_2.xyz = (c_8.xyz + (tmpvar_5.xyz * texture2D (_Illum, tmpvar_1.zw).w)); + vec4 c_4; + c_4 = (texture2D (_MainTex, tmpvar_1.xy) * _Color); + light_3 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); + light_3.xyz = (light_3.xyz + unity_Ambient.xyz); + vec4 c_5; + c_5.xyz = (c_4.xyz * light_3.xyz); + c_5.w = c_4.w; + col_2.w = c_5.w; + col_2.xyz = (c_5.xyz + (c_4.xyz * texture2D (_Illum, tmpvar_1.zw).w)); gl_FragData[0] = col_2; } -// inputs: 1, stats: 14 alu 4 tex 0 flow +// stats: 7 alu 3 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [2] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: unity_Ambient (high float) 4x1 [-1] +// textures: 3 +// #0: _Illum (high 2d) 0x0 [-1] +// #1: _LightBuffer (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-ir.txt deleted file mode 100644 index 36892b164..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-ir.txt +++ /dev/null @@ -1,177 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_Illum; - vec2 uv_BumpMap; -}; -struct v2f_surf { - vec4 pos; - vec2 hip_pack0; - vec3 TtoV0; - vec3 TtoV1; - vec3 TtoV2; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform sampler2D _Illum; -uniform sampler2D _MainTex; -uniform float _Shininess; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -void surf ( - in Input IN_6, - inout SurfaceOutput o_7 -) -{ - vec4 c_8; - vec4 tex_9; - vec4 tmpvar_10; - tmpvar_10 = texture2D (_MainTex, IN_6.uv_MainTex); - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - tex_9 = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12 = (tex_9 * _Color); - c_8 = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13 = c_8.xyz; - o_7.Albedo = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = texture2D (_Illum, IN_6.uv_Illum); - vec3 tmpvar_15; - tmpvar_15 = (c_8.xyz * tmpvar_14.w); - o_7.Emission = tmpvar_15; - float tmpvar_16; - tmpvar_16 = tex_9.w; - o_7.Gloss = tmpvar_16; - float tmpvar_17; - tmpvar_17 = c_8.w; - o_7.Alpha = tmpvar_17; - float tmpvar_18; - tmpvar_18 = _Shininess; - o_7.Specular = tmpvar_18; - vec4 tmpvar_19; - tmpvar_19 = texture2D (_BumpMap, IN_6.uv_BumpMap); - vec4 tmpvar_20; - tmpvar_20 = UnpackNormal (tmpvar_19); - vec3 tmpvar_21; - tmpvar_21 = tmpvar_20.xyz; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_21; - o_7.Normal = tmpvar_22; -} - -vec4 frag_surf ( - in v2f_surf IN_23 -) -{ - vec4 res_24; - vec3 viewN_25; - SurfaceOutput o_26; - Input surfIN_27; - vec2 tmpvar_28; - tmpvar_28 = IN_23.hip_pack0.xy; - surfIN_27.uv_BumpMap = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = vec3(0.0, 0.0, 0.0); - o_26.Albedo = tmpvar_29; - vec3 tmpvar_30; - tmpvar_30 = vec3(0.0, 0.0, 0.0); - o_26.Emission = tmpvar_30; - float tmpvar_31; - tmpvar_31 = 0.0; - o_26.Specular = tmpvar_31; - float tmpvar_32; - tmpvar_32 = 0.0; - o_26.Alpha = tmpvar_32; - float tmpvar_33; - tmpvar_33 = 0.0; - o_26.Gloss = tmpvar_33; - surf (surfIN_27, o_26); - float tmpvar_34; - tmpvar_34 = dot (IN_23.TtoV0, o_26.Normal); - float tmpvar_35; - tmpvar_35 = tmpvar_34; - viewN_25.x = tmpvar_35; - float tmpvar_36; - tmpvar_36 = dot (IN_23.TtoV1, o_26.Normal); - float tmpvar_37; - tmpvar_37 = tmpvar_36; - viewN_25.y = vec2(tmpvar_37).y; - float tmpvar_38; - tmpvar_38 = dot (IN_23.TtoV2, o_26.Normal); - float tmpvar_39; - tmpvar_39 = tmpvar_38; - viewN_25.z = vec3(tmpvar_39).z; - vec3 tmpvar_40; - tmpvar_40 = viewN_25; - o_26.Normal = tmpvar_40; - vec3 tmpvar_41; - tmpvar_41 = ((o_26.Normal * vec3(0.5, 0.5, -0.5)) + 0.5); - res_24.xyz = tmpvar_41.xyz.xyz; - float tmpvar_42; - tmpvar_42 = o_26.Specular; - res_24.w = vec4(tmpvar_42).w; - return res_24; -} - -void main () -{ - v2f_surf xlt_IN_43; - vec4 xl_retval_44; - vec4 tmpvar_45; - tmpvar_45 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_43.pos = tmpvar_45; - vec2 tmpvar_46; - tmpvar_46 = gl_TexCoord[0].xy; - vec2 tmpvar_47; - tmpvar_47 = tmpvar_46; - xlt_IN_43.hip_pack0 = tmpvar_47; - vec3 tmpvar_48; - tmpvar_48 = gl_TexCoord[1].xyz; - vec3 tmpvar_49; - tmpvar_49 = tmpvar_48; - xlt_IN_43.TtoV0 = tmpvar_49; - vec3 tmpvar_50; - tmpvar_50 = gl_TexCoord[2].xyz; - vec3 tmpvar_51; - tmpvar_51 = tmpvar_50; - xlt_IN_43.TtoV1 = tmpvar_51; - vec3 tmpvar_52; - tmpvar_52 = gl_TexCoord[3].xyz; - vec3 tmpvar_53; - tmpvar_53 = tmpvar_52; - xlt_IN_43.TtoV2 = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54 = frag_surf (xlt_IN_43); - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - xl_retval_44 = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = xl_retval_44.xyzw; - vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - gl_FragData[0] = tmpvar_57; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-out.txt index eabd6df20..0d855bd46 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-out.txt @@ -18,4 +18,10 @@ void main () } -// inputs: 1, stats: 12 alu 1 tex 0 flow +// stats: 12 alu 1 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 1 (total size: 0) +// #0: _Shininess (high float) 1x1 [-1] +// textures: 1 +// #0: _BumpMap (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-ir.txt deleted file mode 100644 index 030e02afb..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-ir.txt +++ /dev/null @@ -1,192 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_Illum; - vec2 uv_BumpMap; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec4 hip_screen; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform sampler2D _Illum; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform float _Shininess; -uniform vec4 _SpecColor; -uniform vec4 unity_Ambient; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -void surf ( - in Input IN_6, - inout SurfaceOutput o_7 -) -{ - vec4 c_8; - vec4 tex_9; - vec4 tmpvar_10; - tmpvar_10 = texture2D (_MainTex, IN_6.uv_MainTex); - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - tex_9 = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12 = (tex_9 * _Color); - c_8 = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13 = c_8.xyz; - o_7.Albedo = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = texture2D (_Illum, IN_6.uv_Illum); - vec3 tmpvar_15; - tmpvar_15 = (c_8.xyz * tmpvar_14.w); - o_7.Emission = tmpvar_15; - float tmpvar_16; - tmpvar_16 = tex_9.w; - o_7.Gloss = tmpvar_16; - float tmpvar_17; - tmpvar_17 = c_8.w; - o_7.Alpha = tmpvar_17; - float tmpvar_18; - tmpvar_18 = _Shininess; - o_7.Specular = tmpvar_18; - vec4 tmpvar_19; - tmpvar_19 = texture2D (_BumpMap, IN_6.uv_BumpMap); - vec4 tmpvar_20; - tmpvar_20 = UnpackNormal (tmpvar_19); - vec3 tmpvar_21; - tmpvar_21 = tmpvar_20.xyz; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_21; - o_7.Normal = tmpvar_22; -} - -vec4 LightingBlinnPhong_PrePass ( - in SurfaceOutput s_23, - in vec4 light_24 -) -{ - vec4 c_25; - float spec_26; - float tmpvar_27; - tmpvar_27 = (light_24.w * s_23.Gloss); - spec_26 = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = ((s_23.Albedo * light_24.xyz) + ((light_24.xyz * _SpecColor.xyz) * spec_26)); - c_25.xyz = tmpvar_28.xyz.xyz; - float tmpvar_29; - tmpvar_29 = (s_23.Alpha + (spec_26 * _SpecColor.w)); - c_25.w = vec4(tmpvar_29).w; - return c_25; -} - -vec4 frag_surf ( - in v2f_surf IN_30 -) -{ - vec4 col_31; - vec4 light_32; - SurfaceOutput o_33; - Input surfIN_34; - vec2 tmpvar_35; - tmpvar_35 = IN_30.hip_pack0.xy; - surfIN_34.uv_MainTex = tmpvar_35; - vec2 tmpvar_36; - tmpvar_36 = IN_30.hip_pack0.zw; - surfIN_34.uv_Illum = tmpvar_36; - vec3 tmpvar_37; - tmpvar_37 = vec3(0.0, 0.0, 0.0); - o_33.Albedo = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = vec3(0.0, 0.0, 0.0); - o_33.Emission = tmpvar_38; - float tmpvar_39; - tmpvar_39 = 0.0; - o_33.Specular = tmpvar_39; - float tmpvar_40; - tmpvar_40 = 0.0; - o_33.Alpha = tmpvar_40; - float tmpvar_41; - tmpvar_41 = 0.0; - o_33.Gloss = tmpvar_41; - surf (surfIN_34, o_33); - vec4 tmpvar_42; - tmpvar_42 = texture2DProj (_LightBuffer, IN_30.hip_screen); - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - light_32 = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44 = log2 (light_32); - vec4 tmpvar_45; - tmpvar_45 = -(tmpvar_44); - light_32 = tmpvar_45; - vec3 tmpvar_46; - tmpvar_46 = (light_32.xyz + unity_Ambient.xyz); - light_32.xyz = tmpvar_46.xyz.xyz; - vec4 tmpvar_47; - tmpvar_47 = LightingBlinnPhong_PrePass (o_33, light_32); - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - col_31 = tmpvar_48; - vec3 tmpvar_49; - tmpvar_49 = (col_31.xyz + o_33.Emission); - col_31.xyz = tmpvar_49.xyz.xyz; - return col_31; -} - -void main () -{ - v2f_surf xlt_IN_50; - vec4 xl_retval_51; - vec4 tmpvar_52; - tmpvar_52 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_50.pos = tmpvar_52; - float tmpvar_53; - tmpvar_53 = xlv_FOG.x; - xlt_IN_50.fog = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54 = gl_TexCoord[0].xyzw; - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - xlt_IN_50.hip_pack0 = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = gl_TexCoord[1].xyzw; - vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - xlt_IN_50.hip_screen = tmpvar_57; - vec4 tmpvar_58; - tmpvar_58 = frag_surf (xlt_IN_50); - vec4 tmpvar_59; - tmpvar_59 = tmpvar_58; - xl_retval_51 = tmpvar_59; - vec4 tmpvar_60; - tmpvar_60 = xl_retval_51.xyzw; - vec4 tmpvar_61; - tmpvar_61 = tmpvar_60; - gl_FragData[0] = tmpvar_61; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-out.txt index 818660f68..6a2670957 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-out.txt @@ -1,4 +1,3 @@ -uniform sampler2D _BumpMap; uniform vec4 _Color; uniform sampler2D _Illum; uniform sampler2D _LightBuffer; @@ -11,29 +10,31 @@ void main () tmpvar_1 = gl_TexCoord[0]; vec4 col_2; vec4 light_3; - vec2 tmpvar_4; + vec4 c_4; vec4 tmpvar_5; tmpvar_5 = texture2D (_MainTex, tmpvar_1.xy); - vec4 tmpvar_6; - tmpvar_6 = (tmpvar_5 * _Color); - vec4 normal_7; - normal_7.xy = ((texture2D (_BumpMap, tmpvar_4).wy * 2.0) - 1.0); - normal_7.z = sqrt(((1.0 - - (normal_7.x * normal_7.x) - ) - (normal_7.y * normal_7.y))); - vec4 tmpvar_8; - tmpvar_8 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); - light_3.w = tmpvar_8.w; - light_3.xyz = (tmpvar_8.xyz + unity_Ambient.xyz); - vec4 c_9; - float tmpvar_10; - tmpvar_10 = (tmpvar_8.w * tmpvar_5.w); - c_9.xyz = ((tmpvar_6.xyz * light_3.xyz) + ((light_3.xyz * _SpecColor.xyz) * tmpvar_10)); - c_9.w = (tmpvar_6.w + (tmpvar_10 * _SpecColor.w)); - col_2.w = c_9.w; - col_2.xyz = (c_9.xyz + (tmpvar_6.xyz * texture2D (_Illum, tmpvar_1.zw).w)); + c_4 = (tmpvar_5 * _Color); + light_3 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); + light_3.xyz = (light_3.xyz + unity_Ambient.xyz); + vec4 c_6; + float spec_7; + spec_7 = (light_3.w * tmpvar_5.w); + c_6.xyz = ((c_4.xyz * light_3.xyz) + ((light_3.xyz * _SpecColor.xyz) * spec_7)); + c_6.w = (c_4.w + (spec_7 * _SpecColor.w)); + col_2.w = c_6.w; + col_2.xyz = (c_6.xyz + (c_4.xyz * texture2D (_Illum, tmpvar_1.zw).w)); gl_FragData[0] = col_2; } -// inputs: 1, stats: 20 alu 4 tex 0 flow +// stats: 13 alu 3 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [2] loc 4 +// uniforms: 3 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _SpecColor (high float) 4x1 [-1] +// #2: unity_Ambient (high float) 4x1 [-1] +// textures: 3 +// #0: _Illum (high 2d) 0x0 [-1] +// #1: _LightBuffer (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-ir.txt deleted file mode 100644 index 2efc15475..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-ir.txt +++ /dev/null @@ -1,166 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_Illum; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec2 _LightCoord; -}; -uniform vec4 _Color; -uniform sampler2D _Illum; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 c_3; - vec4 tex_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_6; - tmpvar_6 = tmpvar_5; - tex_4 = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7 = (tex_4 * _Color); - c_3 = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = c_3.xyz; - o_2.Albedo = tmpvar_8; - vec4 tmpvar_9; - tmpvar_9 = texture2D (_Illum, IN_1.uv_Illum); - vec3 tmpvar_10; - tmpvar_10 = (c_3.xyz * tmpvar_9.w); - o_2.Emission = tmpvar_10; - float tmpvar_11; - tmpvar_11 = c_3.w; - o_2.Alpha = tmpvar_11; -} - -vec4 LightingLambert ( - in SurfaceOutput s_12, - in vec3 lightDir_13, - in float atten_14 -) -{ - vec4 c_15; - float diff_16; - float tmpvar_17; - tmpvar_17 = dot (s_12.Normal, lightDir_13); - float tmpvar_18; - tmpvar_18 = max (0.0, tmpvar_17); - float tmpvar_19; - tmpvar_19 = tmpvar_18; - diff_16 = tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = ((s_12.Albedo * _LightColor0.xyz) * ((diff_16 * atten_14) * 2.0)); - c_15.xyz = tmpvar_20.xyz.xyz; - float tmpvar_21; - tmpvar_21 = s_12.Alpha; - c_15.w = vec4(tmpvar_21).w; - return c_15; -} - -vec4 frag_surf ( - in v2f_surf IN_22 -) -{ - vec4 c_23; - vec3 lightDir_24; - SurfaceOutput o_25; - Input surfIN_26; - vec2 tmpvar_27; - tmpvar_27 = IN_22.hip_pack0.xy; - surfIN_26.uv_MainTex = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = vec3(0.0, 0.0, 0.0); - o_25.Albedo = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = vec3(0.0, 0.0, 0.0); - o_25.Emission = tmpvar_29; - float tmpvar_30; - tmpvar_30 = 0.0; - o_25.Specular = tmpvar_30; - float tmpvar_31; - tmpvar_31 = 0.0; - o_25.Alpha = tmpvar_31; - float tmpvar_32; - tmpvar_32 = 0.0; - o_25.Gloss = tmpvar_32; - vec3 tmpvar_33; - tmpvar_33 = IN_22.normal; - o_25.Normal = tmpvar_33; - surf (surfIN_26, o_25); - vec3 tmpvar_34; - tmpvar_34 = IN_22.lightDir; - lightDir_24 = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35 = texture2D (_LightTexture0, IN_22._LightCoord); - vec4 tmpvar_36; - tmpvar_36 = LightingLambert (o_25, lightDir_24, (tmpvar_35.w * 1.0)); - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - c_23 = tmpvar_37; - float tmpvar_38; - tmpvar_38 = 0.0; - c_23.w = vec4(tmpvar_38).w; - return c_23; -} - -void main () -{ - v2f_surf xlt_IN_39; - vec4 xl_retval_40; - vec4 tmpvar_41; - tmpvar_41 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_39.pos = tmpvar_41; - float tmpvar_42; - tmpvar_42 = xlv_FOG.x; - xlt_IN_39.fog = tmpvar_42; - vec2 tmpvar_43; - tmpvar_43 = gl_TexCoord[0].xy; - vec2 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_IN_39.hip_pack0 = tmpvar_44; - vec3 tmpvar_45; - tmpvar_45 = gl_TexCoord[1].xyz; - vec3 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_IN_39.normal = tmpvar_46; - vec3 tmpvar_47; - tmpvar_47 = gl_TexCoord[2].xyz; - vec3 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_IN_39.lightDir = tmpvar_48; - vec2 tmpvar_49; - tmpvar_49 = gl_TexCoord[3].xy; - vec2 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_IN_39._LightCoord = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = frag_surf (xlt_IN_39); - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - xl_retval_40 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = xl_retval_40.xyzw; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - gl_FragData[0] = tmpvar_54; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-out.txt index b701346f5..5f001ce83 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-out.txt @@ -5,17 +5,25 @@ uniform sampler2D _MainTex; void main () { vec4 c_1; - vec4 tmpvar_2; - tmpvar_2 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); + vec4 c_2; + c_2 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); vec4 c_3; - c_3.xyz = ((tmpvar_2.xyz * _LightColor0.xyz) * (( + c_3.xyz = ((c_2.xyz * _LightColor0.xyz) * (( max (0.0, dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz)) * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0)); - c_3.w = tmpvar_2.w; + c_3.w = c_2.w; c_1.xyz = c_3.xyz; c_1.w = 0.0; gl_FragData[0] = c_1; } -// inputs: 1, stats: 8 alu 2 tex 0 flow +// stats: 8 alu 2 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// textures: 2 +// #0: _LightTexture0 (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-ir.txt deleted file mode 100644 index 9e5778b1e..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-ir.txt +++ /dev/null @@ -1,298 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_Illum; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec4 hip_screen; - vec3 hip_lmapFade; -}; -uniform vec4 _Color; -uniform sampler2D _Illum; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform sampler2D unity_Lightmap; -uniform sampler2D unity_LightmapInd; -varying vec4 xlv_FOG; -float xll_saturate ( - in float x_1 -) -{ - float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -vec2 xll_saturate ( - in vec2 x_3 -) -{ - vec2 tmpvar_4; - tmpvar_4 = clamp (x_3, 0.0, 1.0); - return tmpvar_4; -} - -vec3 xll_saturate ( - in vec3 x_5 -) -{ - vec3 tmpvar_6; - tmpvar_6 = clamp (x_5, 0.0, 1.0); - return tmpvar_6; -} - -vec4 xll_saturate ( - in vec4 x_7 -) -{ - vec4 tmpvar_8; - tmpvar_8 = clamp (x_7, 0.0, 1.0); - return tmpvar_8; -} - -mat2 xll_saturate ( - in mat2 m_9 -) -{ - vec2 tmpvar_10; - tmpvar_10 = clamp (m_9[0], 0.0, 1.0); - vec2 tmpvar_11; - tmpvar_11 = clamp (m_9[1], 0.0, 1.0); - mat2 tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_10; - tmpvar_12[0] = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_12[1] = tmpvar_14; - return tmpvar_12; -} - -mat3 xll_saturate ( - in mat3 m_15 -) -{ - vec3 tmpvar_16; - tmpvar_16 = clamp (m_15[0], 0.0, 1.0); - vec3 tmpvar_17; - tmpvar_17 = clamp (m_15[1], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_15[2], 0.0, 1.0); - mat3 tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_16; - tmpvar_19[0] = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_19[1] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_19[2] = tmpvar_22; - return tmpvar_19; -} - -mat4 xll_saturate ( - in mat4 m_23 -) -{ - vec4 tmpvar_24; - tmpvar_24 = clamp (m_23[0], 0.0, 1.0); - vec4 tmpvar_25; - tmpvar_25 = clamp (m_23[1], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_23[2], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_23[3], 0.0, 1.0); - mat4 tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_24; - tmpvar_28[0] = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_28[1] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_28[2] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_28[3] = tmpvar_32; - return tmpvar_28; -} - -void surf ( - in Input IN_33, - inout SurfaceOutput o_34 -) -{ - vec4 c_35; - vec4 tex_36; - vec4 tmpvar_37; - tmpvar_37 = texture2D (_MainTex, IN_33.uv_MainTex); - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - tex_36 = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = (tex_36 * _Color); - c_35 = tmpvar_39; - vec3 tmpvar_40; - tmpvar_40 = c_35.xyz; - o_34.Albedo = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = texture2D (_Illum, IN_33.uv_Illum); - vec3 tmpvar_42; - tmpvar_42 = (c_35.xyz * tmpvar_41.w); - o_34.Emission = tmpvar_42; - float tmpvar_43; - tmpvar_43 = c_35.w; - o_34.Alpha = tmpvar_43; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_44, - in vec4 light_45 -) -{ - vec4 c_46; - vec3 tmpvar_47; - tmpvar_47 = (s_44.Albedo * light_45.xyz); - c_46.xyz = tmpvar_47.xyz.xyz; - float tmpvar_48; - tmpvar_48 = s_44.Alpha; - c_46.w = vec4(tmpvar_48).w; - return c_46; -} - -vec3 DecodeLightmap ( - in vec4 color_49 -) -{ - return (2.0 * color_49.xyz); -} - -vec4 frag_surf ( - in v2f_surf IN_50 -) -{ - vec4 col_51; - vec3 lm_52; - vec3 lmIndirect_53; - vec3 lmFull_54; - vec4 light_55; - SurfaceOutput o_56; - Input surfIN_57; - vec2 tmpvar_58; - tmpvar_58 = IN_50.hip_pack0.xy; - surfIN_57.uv_MainTex = tmpvar_58; - vec2 tmpvar_59; - tmpvar_59 = IN_50.hip_pack0.zw; - surfIN_57.uv_Illum = tmpvar_59; - vec3 tmpvar_60; - tmpvar_60 = vec3(0.0, 0.0, 0.0); - o_56.Albedo = tmpvar_60; - vec3 tmpvar_61; - tmpvar_61 = vec3(0.0, 0.0, 0.0); - o_56.Emission = tmpvar_61; - float tmpvar_62; - tmpvar_62 = 0.0; - o_56.Specular = tmpvar_62; - float tmpvar_63; - tmpvar_63 = 0.0; - o_56.Alpha = tmpvar_63; - float tmpvar_64; - tmpvar_64 = 0.0; - o_56.Gloss = tmpvar_64; - surf (surfIN_57, o_56); - vec4 tmpvar_65; - tmpvar_65 = texture2DProj (_LightBuffer, IN_50.hip_screen); - vec4 tmpvar_66; - tmpvar_66 = tmpvar_65; - light_55 = tmpvar_66; - vec4 tmpvar_67; - tmpvar_67 = log2 (light_55); - vec4 tmpvar_68; - tmpvar_68 = -(tmpvar_67); - light_55 = tmpvar_68; - vec4 tmpvar_69; - tmpvar_69 = texture2D (unity_Lightmap, IN_50.hip_lmapFade.xy); - vec3 tmpvar_70; - tmpvar_70 = DecodeLightmap (tmpvar_69); - vec3 tmpvar_71; - tmpvar_71 = tmpvar_70; - lmFull_54 = tmpvar_71; - vec4 tmpvar_72; - tmpvar_72 = texture2D (unity_LightmapInd, IN_50.hip_lmapFade.xy); - vec3 tmpvar_73; - tmpvar_73 = DecodeLightmap (tmpvar_72); - vec3 tmpvar_74; - tmpvar_74 = tmpvar_73; - lmIndirect_53 = tmpvar_74; - float tmpvar_75; - tmpvar_75 = xll_saturate (IN_50.hip_lmapFade.z); - vec3 tmpvar_76; - tmpvar_76 = vec3(tmpvar_75); - vec3 tmpvar_77; - tmpvar_77 = mix (lmIndirect_53, lmFull_54, tmpvar_76); - vec3 tmpvar_78; - tmpvar_78 = tmpvar_77; - lm_52 = tmpvar_78; - vec3 tmpvar_79; - tmpvar_79 = (light_55.xyz + lm_52); - light_55.xyz = tmpvar_79.xyz.xyz; - vec4 tmpvar_80; - tmpvar_80 = LightingLambert_PrePass (o_56, light_55); - vec4 tmpvar_81; - tmpvar_81 = tmpvar_80; - col_51 = tmpvar_81; - vec3 tmpvar_82; - tmpvar_82 = (col_51.xyz + o_56.Emission); - col_51.xyz = tmpvar_82.xyz.xyz; - return col_51; -} - -void main () -{ - v2f_surf xlt_IN_83; - vec4 xl_retval_84; - vec4 tmpvar_85; - tmpvar_85 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_83.pos = tmpvar_85; - float tmpvar_86; - tmpvar_86 = xlv_FOG.x; - xlt_IN_83.fog = tmpvar_86; - vec4 tmpvar_87; - tmpvar_87 = gl_TexCoord[0].xyzw; - vec4 tmpvar_88; - tmpvar_88 = tmpvar_87; - xlt_IN_83.hip_pack0 = tmpvar_88; - vec4 tmpvar_89; - tmpvar_89 = gl_TexCoord[1].xyzw; - vec4 tmpvar_90; - tmpvar_90 = tmpvar_89; - xlt_IN_83.hip_screen = tmpvar_90; - vec3 tmpvar_91; - tmpvar_91 = gl_TexCoord[2].xyz; - vec3 tmpvar_92; - tmpvar_92 = tmpvar_91; - xlt_IN_83.hip_lmapFade = tmpvar_92; - vec4 tmpvar_93; - tmpvar_93 = frag_surf (xlt_IN_83); - vec4 tmpvar_94; - tmpvar_94 = tmpvar_93; - xl_retval_84 = tmpvar_94; - vec4 tmpvar_95; - tmpvar_95 = xl_retval_84.xyzw; - vec4 tmpvar_96; - tmpvar_96 = tmpvar_95; - gl_FragData[0] = tmpvar_96; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-out.txt index b597fa4fd..7193ecbcc 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-out.txt @@ -12,19 +12,27 @@ void main () tmpvar_2 = gl_TexCoord[2].xyz; vec4 col_3; vec4 light_4; - vec4 tmpvar_5; - tmpvar_5 = (texture2D (_MainTex, tmpvar_1.xy) * _Color); - vec4 tmpvar_6; - tmpvar_6 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); - light_4.w = tmpvar_6.w; - light_4.xyz = (tmpvar_6.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_2.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_2.xy).xyz), vec3(clamp (tmpvar_2.z, 0.0, 1.0)))); - vec4 c_7; - c_7.xyz = (tmpvar_5.xyz * light_4.xyz); - c_7.w = tmpvar_5.w; - col_3.w = c_7.w; - col_3.xyz = (c_7.xyz + (tmpvar_5.xyz * texture2D (_Illum, tmpvar_1.zw).w)); + vec4 c_5; + c_5 = (texture2D (_MainTex, tmpvar_1.xy) * _Color); + light_4 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); + light_4.xyz = (light_4.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_2.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_2.xy).xyz), vec3(clamp (tmpvar_2.z, 0.0, 1.0)))); + vec4 c_6; + c_6.xyz = (c_5.xyz * light_4.xyz); + c_6.w = c_5.w; + col_3.w = c_6.w; + col_3.xyz = (c_6.xyz + (c_5.xyz * texture2D (_Illum, tmpvar_1.zw).w)); gl_FragData[0] = col_3; } -// inputs: 1, stats: 11 alu 5 tex 0 flow +// stats: 11 alu 5 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 1 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// textures: 5 +// #0: _Illum (high 2d) 0x0 [-1] +// #1: _LightBuffer (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] +// #3: unity_Lightmap (high 2d) 0x0 [-1] +// #4: unity_LightmapInd (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-ir.txt deleted file mode 100644 index 5480965dc..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-ir.txt +++ /dev/null @@ -1,271 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; - vec2 uv_Illum; - vec3 viewDir; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec3 lightDir; - vec4 _LightCoord; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform sampler2D _Illum; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -uniform float _Parallax; -uniform sampler2D _ParallaxMap; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -vec2 ParallaxOffset ( - in float h_6, - in float height_7, - in vec3 viewDir_8 -) -{ - vec3 v_9; - float tmpvar_10; - tmpvar_10 = ((h_6 * height_7) - (height_7 / 2.0)); - h_6 = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = normalize (viewDir_8); - vec3 tmpvar_12; - tmpvar_12 = tmpvar_11; - v_9 = tmpvar_12; - float tmpvar_13; - tmpvar_13 = (v_9.z + 0.42); - v_9.z = vec3(tmpvar_13).z; - return (h_6 * (v_9.xy / v_9.z)); -} - -void surf ( - in Input IN_14, - inout SurfaceOutput o_15 -) -{ - vec4 c_16; - vec2 offset_17; - float h_18; - vec4 tmpvar_19; - tmpvar_19 = texture2D (_ParallaxMap, IN_14.uv_BumpMap); - float tmpvar_20; - tmpvar_20 = tmpvar_19.w; - h_18 = tmpvar_20; - vec2 tmpvar_21; - tmpvar_21 = ParallaxOffset (h_18, _Parallax, IN_14.viewDir); - vec2 tmpvar_22; - tmpvar_22 = tmpvar_21; - offset_17 = tmpvar_22; - vec2 tmpvar_23; - tmpvar_23 = (IN_14.uv_MainTex + offset_17); - IN_14.uv_MainTex = tmpvar_23; - vec2 tmpvar_24; - tmpvar_24 = (IN_14.uv_BumpMap + offset_17); - IN_14.uv_BumpMap = tmpvar_24; - vec2 tmpvar_25; - tmpvar_25 = (IN_14.uv_Illum + offset_17); - IN_14.uv_Illum = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = texture2D (_MainTex, IN_14.uv_MainTex); - vec4 tmpvar_27; - tmpvar_27 = (tmpvar_26 * _Color); - c_16 = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = c_16.xyz; - o_15.Albedo = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = texture2D (_Illum, IN_14.uv_Illum); - vec3 tmpvar_30; - tmpvar_30 = (c_16.xyz * tmpvar_29.w); - o_15.Emission = tmpvar_30; - float tmpvar_31; - tmpvar_31 = c_16.w; - o_15.Alpha = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = texture2D (_BumpMap, IN_14.uv_BumpMap); - vec4 tmpvar_33; - tmpvar_33 = UnpackNormal (tmpvar_32); - vec3 tmpvar_34; - tmpvar_34 = tmpvar_33.xyz; - vec3 tmpvar_35; - tmpvar_35 = tmpvar_34; - o_15.Normal = tmpvar_35; -} - -float UnitySpotCookie ( - in vec4 LightCoord_36 -) -{ - vec4 tmpvar_37; - tmpvar_37 = texture2D (_LightTexture0, ((LightCoord_36.xy / LightCoord_36.w) + 0.5)); - return tmpvar_37.w; -} - -float UnitySpotAttenuate ( - in vec3 LightCoord_38 -) -{ - float tmpvar_39; - tmpvar_39 = dot (LightCoord_38, LightCoord_38); - vec2 tmpvar_40; - tmpvar_40 = vec2(tmpvar_39); - vec2 tmpvar_41; - tmpvar_41 = tmpvar_40.xy; - vec4 tmpvar_42; - tmpvar_42 = texture2D (_LightTextureB0, tmpvar_41); - return tmpvar_42.w; -} - -vec4 LightingLambert ( - in SurfaceOutput s_43, - in vec3 lightDir_44, - in float atten_45 -) -{ - vec4 c_46; - float diff_47; - float tmpvar_48; - tmpvar_48 = dot (s_43.Normal, lightDir_44); - float tmpvar_49; - tmpvar_49 = max (0.0, tmpvar_48); - float tmpvar_50; - tmpvar_50 = tmpvar_49; - diff_47 = tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = ((s_43.Albedo * _LightColor0.xyz) * ((diff_47 * atten_45) * 2.0)); - c_46.xyz = tmpvar_51.xyz.xyz; - float tmpvar_52; - tmpvar_52 = s_43.Alpha; - c_46.w = vec4(tmpvar_52).w; - return c_46; -} - -vec4 frag_surf ( - in v2f_surf IN_53 -) -{ - vec4 c_54; - vec3 lightDir_55; - SurfaceOutput o_56; - Input surfIN_57; - vec2 tmpvar_58; - tmpvar_58 = IN_53.hip_pack0.xy; - surfIN_57.uv_MainTex = tmpvar_58; - vec2 tmpvar_59; - tmpvar_59 = IN_53.hip_pack0.zw; - surfIN_57.uv_BumpMap = tmpvar_59; - vec3 tmpvar_60; - tmpvar_60 = IN_53.viewDir; - surfIN_57.viewDir = tmpvar_60; - vec3 tmpvar_61; - tmpvar_61 = vec3(0.0, 0.0, 0.0); - o_56.Albedo = tmpvar_61; - vec3 tmpvar_62; - tmpvar_62 = vec3(0.0, 0.0, 0.0); - o_56.Emission = tmpvar_62; - float tmpvar_63; - tmpvar_63 = 0.0; - o_56.Specular = tmpvar_63; - float tmpvar_64; - tmpvar_64 = 0.0; - o_56.Alpha = tmpvar_64; - float tmpvar_65; - tmpvar_65 = 0.0; - o_56.Gloss = tmpvar_65; - surf (surfIN_57, o_56); - vec3 tmpvar_66; - tmpvar_66 = IN_53.lightDir; - lightDir_55 = tmpvar_66; - vec3 tmpvar_67; - tmpvar_67 = normalize (lightDir_55); - vec3 tmpvar_68; - tmpvar_68 = tmpvar_67; - lightDir_55 = tmpvar_68; - float tmpvar_69; - tmpvar_69 = UnitySpotCookie (IN_53._LightCoord); - float tmpvar_70; - tmpvar_70 = UnitySpotAttenuate (IN_53._LightCoord.xyz); - vec4 tmpvar_71; - tmpvar_71 = LightingLambert (o_56, lightDir_55, ((float( - (IN_53._LightCoord.z > 0.0) - ) * tmpvar_69) * tmpvar_70)); - vec4 tmpvar_72; - tmpvar_72 = tmpvar_71; - c_54 = tmpvar_72; - float tmpvar_73; - tmpvar_73 = 0.0; - c_54.w = vec4(tmpvar_73).w; - return c_54; -} - -void main () -{ - v2f_surf xlt_IN_74; - vec4 xl_retval_75; - vec4 tmpvar_76; - tmpvar_76 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_74.pos = tmpvar_76; - float tmpvar_77; - tmpvar_77 = xlv_FOG.x; - xlt_IN_74.fog = tmpvar_77; - vec4 tmpvar_78; - tmpvar_78 = gl_TexCoord[0].xyzw; - vec4 tmpvar_79; - tmpvar_79 = tmpvar_78; - xlt_IN_74.hip_pack0 = tmpvar_79; - vec3 tmpvar_80; - tmpvar_80 = gl_TexCoord[1].xyz; - vec3 tmpvar_81; - tmpvar_81 = tmpvar_80; - xlt_IN_74.viewDir = tmpvar_81; - vec3 tmpvar_82; - tmpvar_82 = gl_TexCoord[2].xyz; - vec3 tmpvar_83; - tmpvar_83 = tmpvar_82; - xlt_IN_74.lightDir = tmpvar_83; - vec4 tmpvar_84; - tmpvar_84 = gl_TexCoord[3].xyzw; - vec4 tmpvar_85; - tmpvar_85 = tmpvar_84; - xlt_IN_74._LightCoord = tmpvar_85; - vec4 tmpvar_86; - tmpvar_86 = frag_surf (xlt_IN_74); - vec4 tmpvar_87; - tmpvar_87 = tmpvar_86; - xl_retval_75 = tmpvar_87; - vec4 tmpvar_88; - tmpvar_88 = xl_retval_75.xyzw; - vec4 tmpvar_89; - tmpvar_89 = tmpvar_88; - gl_FragData[0] = tmpvar_89; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-out.txt index 469eaf426..13a1b2272 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-out.txt @@ -13,31 +13,43 @@ void main () vec4 tmpvar_2; tmpvar_2 = gl_TexCoord[3]; vec4 c_3; - vec2 tmpvar_4; - vec3 v_5; - vec3 tmpvar_6; - tmpvar_6 = normalize(gl_TexCoord[1].xyz); - v_5.xy = tmpvar_6.xy; - v_5.z = (tmpvar_6.z + 0.42); - tmpvar_4 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_6.xy / v_5.z)); - vec4 tmpvar_7; - tmpvar_7 = (texture2D (_MainTex, (tmpvar_1.xy + tmpvar_4)) * _Color); + vec4 c_4; + vec2 tmpvar_5; + vec3 v_6; + vec3 tmpvar_7; + tmpvar_7 = normalize(gl_TexCoord[1].xyz); + v_6.xy = tmpvar_7.xy; + v_6.z = (tmpvar_7.z + 0.42); + tmpvar_5 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_7.xy / v_6.z)); + c_4 = (texture2D (_MainTex, (tmpvar_1.xy + tmpvar_5)) * _Color); vec4 normal_8; - normal_8.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_4)).wy * 2.0) - 1.0); + normal_8.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_5)).wy * 2.0) - 1.0); normal_8.z = sqrt(((1.0 - (normal_8.x * normal_8.x) ) - (normal_8.y * normal_8.y))); vec4 c_9; - c_9.xyz = ((tmpvar_7.xyz * _LightColor0.xyz) * (( + c_9.xyz = ((c_4.xyz * _LightColor0.xyz) * (( max (0.0, dot (normal_8.xyz, normalize(gl_TexCoord[2].xyz))) * ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w) ) * 2.0)); - c_9.w = tmpvar_7.w; + c_9.w = c_4.w; c_3.xyz = c_9.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } -// inputs: 1, stats: 32 alu 5 tex 0 flow +// stats: 32 alu 5 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 3 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _Parallax (high float) 1x1 [-1] +// textures: 5 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _LightTexture0 (high 2d) 0x0 [-1] +// #2: _LightTextureB0 (high 2d) 0x0 [-1] +// #3: _MainTex (high 2d) 0x0 [-1] +// #4: _ParallaxMap (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-ir.txt deleted file mode 100644 index 407afa9fc..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-ir.txt +++ /dev/null @@ -1,237 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; - vec2 uv_Illum; - vec3 viewDir; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec3 lightDir; - vec2 _LightCoord; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform sampler2D _Illum; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _MainTex; -uniform float _Parallax; -uniform sampler2D _ParallaxMap; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -vec2 ParallaxOffset ( - in float h_6, - in float height_7, - in vec3 viewDir_8 -) -{ - vec3 v_9; - float tmpvar_10; - tmpvar_10 = ((h_6 * height_7) - (height_7 / 2.0)); - h_6 = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = normalize (viewDir_8); - vec3 tmpvar_12; - tmpvar_12 = tmpvar_11; - v_9 = tmpvar_12; - float tmpvar_13; - tmpvar_13 = (v_9.z + 0.42); - v_9.z = vec3(tmpvar_13).z; - return (h_6 * (v_9.xy / v_9.z)); -} - -void surf ( - in Input IN_14, - inout SurfaceOutput o_15 -) -{ - vec4 c_16; - vec2 offset_17; - float h_18; - vec4 tmpvar_19; - tmpvar_19 = texture2D (_ParallaxMap, IN_14.uv_BumpMap); - float tmpvar_20; - tmpvar_20 = tmpvar_19.w; - h_18 = tmpvar_20; - vec2 tmpvar_21; - tmpvar_21 = ParallaxOffset (h_18, _Parallax, IN_14.viewDir); - vec2 tmpvar_22; - tmpvar_22 = tmpvar_21; - offset_17 = tmpvar_22; - vec2 tmpvar_23; - tmpvar_23 = (IN_14.uv_MainTex + offset_17); - IN_14.uv_MainTex = tmpvar_23; - vec2 tmpvar_24; - tmpvar_24 = (IN_14.uv_BumpMap + offset_17); - IN_14.uv_BumpMap = tmpvar_24; - vec2 tmpvar_25; - tmpvar_25 = (IN_14.uv_Illum + offset_17); - IN_14.uv_Illum = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = texture2D (_MainTex, IN_14.uv_MainTex); - vec4 tmpvar_27; - tmpvar_27 = (tmpvar_26 * _Color); - c_16 = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = c_16.xyz; - o_15.Albedo = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = texture2D (_Illum, IN_14.uv_Illum); - vec3 tmpvar_30; - tmpvar_30 = (c_16.xyz * tmpvar_29.w); - o_15.Emission = tmpvar_30; - float tmpvar_31; - tmpvar_31 = c_16.w; - o_15.Alpha = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = texture2D (_BumpMap, IN_14.uv_BumpMap); - vec4 tmpvar_33; - tmpvar_33 = UnpackNormal (tmpvar_32); - vec3 tmpvar_34; - tmpvar_34 = tmpvar_33.xyz; - vec3 tmpvar_35; - tmpvar_35 = tmpvar_34; - o_15.Normal = tmpvar_35; -} - -vec4 LightingLambert ( - in SurfaceOutput s_36, - in vec3 lightDir_37, - in float atten_38 -) -{ - vec4 c_39; - float diff_40; - float tmpvar_41; - tmpvar_41 = dot (s_36.Normal, lightDir_37); - float tmpvar_42; - tmpvar_42 = max (0.0, tmpvar_41); - float tmpvar_43; - tmpvar_43 = tmpvar_42; - diff_40 = tmpvar_43; - vec3 tmpvar_44; - tmpvar_44 = ((s_36.Albedo * _LightColor0.xyz) * ((diff_40 * atten_38) * 2.0)); - c_39.xyz = tmpvar_44.xyz.xyz; - float tmpvar_45; - tmpvar_45 = s_36.Alpha; - c_39.w = vec4(tmpvar_45).w; - return c_39; -} - -vec4 frag_surf ( - in v2f_surf IN_46 -) -{ - vec4 c_47; - vec3 lightDir_48; - SurfaceOutput o_49; - Input surfIN_50; - vec2 tmpvar_51; - tmpvar_51 = IN_46.hip_pack0.xy; - surfIN_50.uv_MainTex = tmpvar_51; - vec2 tmpvar_52; - tmpvar_52 = IN_46.hip_pack0.zw; - surfIN_50.uv_BumpMap = tmpvar_52; - vec3 tmpvar_53; - tmpvar_53 = IN_46.viewDir; - surfIN_50.viewDir = tmpvar_53; - vec3 tmpvar_54; - tmpvar_54 = vec3(0.0, 0.0, 0.0); - o_49.Albedo = tmpvar_54; - vec3 tmpvar_55; - tmpvar_55 = vec3(0.0, 0.0, 0.0); - o_49.Emission = tmpvar_55; - float tmpvar_56; - tmpvar_56 = 0.0; - o_49.Specular = tmpvar_56; - float tmpvar_57; - tmpvar_57 = 0.0; - o_49.Alpha = tmpvar_57; - float tmpvar_58; - tmpvar_58 = 0.0; - o_49.Gloss = tmpvar_58; - surf (surfIN_50, o_49); - vec3 tmpvar_59; - tmpvar_59 = IN_46.lightDir; - lightDir_48 = tmpvar_59; - vec4 tmpvar_60; - tmpvar_60 = texture2D (_LightTexture0, IN_46._LightCoord); - vec4 tmpvar_61; - tmpvar_61 = LightingLambert (o_49, lightDir_48, (tmpvar_60.w * 1.0)); - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - c_47 = tmpvar_62; - float tmpvar_63; - tmpvar_63 = 0.0; - c_47.w = vec4(tmpvar_63).w; - return c_47; -} - -void main () -{ - v2f_surf xlt_IN_64; - vec4 xl_retval_65; - vec4 tmpvar_66; - tmpvar_66 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_64.pos = tmpvar_66; - float tmpvar_67; - tmpvar_67 = xlv_FOG.x; - xlt_IN_64.fog = tmpvar_67; - vec4 tmpvar_68; - tmpvar_68 = gl_TexCoord[0].xyzw; - vec4 tmpvar_69; - tmpvar_69 = tmpvar_68; - xlt_IN_64.hip_pack0 = tmpvar_69; - vec3 tmpvar_70; - tmpvar_70 = gl_TexCoord[1].xyz; - vec3 tmpvar_71; - tmpvar_71 = tmpvar_70; - xlt_IN_64.viewDir = tmpvar_71; - vec3 tmpvar_72; - tmpvar_72 = gl_TexCoord[2].xyz; - vec3 tmpvar_73; - tmpvar_73 = tmpvar_72; - xlt_IN_64.lightDir = tmpvar_73; - vec2 tmpvar_74; - tmpvar_74 = gl_TexCoord[3].xy; - vec2 tmpvar_75; - tmpvar_75 = tmpvar_74; - xlt_IN_64._LightCoord = tmpvar_75; - vec4 tmpvar_76; - tmpvar_76 = frag_surf (xlt_IN_64); - vec4 tmpvar_77; - tmpvar_77 = tmpvar_76; - xl_retval_65 = tmpvar_77; - vec4 tmpvar_78; - tmpvar_78 = xl_retval_65.xyzw; - vec4 tmpvar_79; - tmpvar_79 = tmpvar_78; - gl_FragData[0] = tmpvar_79; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-out.txt index e84b28208..c8fa7f188 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-out.txt @@ -10,29 +10,40 @@ void main () vec4 tmpvar_1; tmpvar_1 = gl_TexCoord[0]; vec4 c_2; - vec2 tmpvar_3; - vec3 v_4; - vec3 tmpvar_5; - tmpvar_5 = normalize(gl_TexCoord[1].xyz); - v_4.xy = tmpvar_5.xy; - v_4.z = (tmpvar_5.z + 0.42); - tmpvar_3 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_5.xy / v_4.z)); - vec4 tmpvar_6; - tmpvar_6 = (texture2D (_MainTex, (tmpvar_1.xy + tmpvar_3)) * _Color); + vec4 c_3; + vec2 tmpvar_4; + vec3 v_5; + vec3 tmpvar_6; + tmpvar_6 = normalize(gl_TexCoord[1].xyz); + v_5.xy = tmpvar_6.xy; + v_5.z = (tmpvar_6.z + 0.42); + tmpvar_4 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_6.xy / v_5.z)); + c_3 = (texture2D (_MainTex, (tmpvar_1.xy + tmpvar_4)) * _Color); vec4 normal_7; - normal_7.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_3)).wy * 2.0) - 1.0); + normal_7.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_4)).wy * 2.0) - 1.0); normal_7.z = sqrt(((1.0 - (normal_7.x * normal_7.x) ) - (normal_7.y * normal_7.y))); vec4 c_8; - c_8.xyz = ((tmpvar_6.xyz * _LightColor0.xyz) * (( + c_8.xyz = ((c_3.xyz * _LightColor0.xyz) * (( max (0.0, dot (normal_7.xyz, gl_TexCoord[2].xyz)) * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0)); - c_8.w = tmpvar_6.w; + c_8.w = c_3.w; c_2.xyz = c_8.xyz; c_2.w = 0.0; gl_FragData[0] = c_2; } -// inputs: 1, stats: 24 alu 4 tex 0 flow +// stats: 24 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 3 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _Parallax (high float) 1x1 [-1] +// textures: 4 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _LightTexture0 (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] +// #3: _ParallaxMap (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-ir.txt deleted file mode 100644 index 3948d5e8c..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-ir.txt +++ /dev/null @@ -1,239 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; - vec2 uv_Illum; - vec3 viewDir; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec2 hip_pack1; - vec3 viewDir; - vec4 hip_screen; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform sampler2D _Illum; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform float _Parallax; -uniform sampler2D _ParallaxMap; -uniform vec4 unity_Ambient; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -vec2 ParallaxOffset ( - in float h_6, - in float height_7, - in vec3 viewDir_8 -) -{ - vec3 v_9; - float tmpvar_10; - tmpvar_10 = ((h_6 * height_7) - (height_7 / 2.0)); - h_6 = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = normalize (viewDir_8); - vec3 tmpvar_12; - tmpvar_12 = tmpvar_11; - v_9 = tmpvar_12; - float tmpvar_13; - tmpvar_13 = (v_9.z + 0.42); - v_9.z = vec3(tmpvar_13).z; - return (h_6 * (v_9.xy / v_9.z)); -} - -void surf ( - in Input IN_14, - inout SurfaceOutput o_15 -) -{ - vec4 c_16; - vec2 offset_17; - float h_18; - vec4 tmpvar_19; - tmpvar_19 = texture2D (_ParallaxMap, IN_14.uv_BumpMap); - float tmpvar_20; - tmpvar_20 = tmpvar_19.w; - h_18 = tmpvar_20; - vec2 tmpvar_21; - tmpvar_21 = ParallaxOffset (h_18, _Parallax, IN_14.viewDir); - vec2 tmpvar_22; - tmpvar_22 = tmpvar_21; - offset_17 = tmpvar_22; - vec2 tmpvar_23; - tmpvar_23 = (IN_14.uv_MainTex + offset_17); - IN_14.uv_MainTex = tmpvar_23; - vec2 tmpvar_24; - tmpvar_24 = (IN_14.uv_BumpMap + offset_17); - IN_14.uv_BumpMap = tmpvar_24; - vec2 tmpvar_25; - tmpvar_25 = (IN_14.uv_Illum + offset_17); - IN_14.uv_Illum = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = texture2D (_MainTex, IN_14.uv_MainTex); - vec4 tmpvar_27; - tmpvar_27 = (tmpvar_26 * _Color); - c_16 = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = c_16.xyz; - o_15.Albedo = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = texture2D (_Illum, IN_14.uv_Illum); - vec3 tmpvar_30; - tmpvar_30 = (c_16.xyz * tmpvar_29.w); - o_15.Emission = tmpvar_30; - float tmpvar_31; - tmpvar_31 = c_16.w; - o_15.Alpha = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = texture2D (_BumpMap, IN_14.uv_BumpMap); - vec4 tmpvar_33; - tmpvar_33 = UnpackNormal (tmpvar_32); - vec3 tmpvar_34; - tmpvar_34 = tmpvar_33.xyz; - vec3 tmpvar_35; - tmpvar_35 = tmpvar_34; - o_15.Normal = tmpvar_35; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_36, - in vec4 light_37 -) -{ - vec4 c_38; - vec3 tmpvar_39; - tmpvar_39 = (s_36.Albedo * light_37.xyz); - c_38.xyz = tmpvar_39.xyz.xyz; - float tmpvar_40; - tmpvar_40 = s_36.Alpha; - c_38.w = vec4(tmpvar_40).w; - return c_38; -} - -vec4 frag_surf ( - in v2f_surf IN_41 -) -{ - vec4 col_42; - vec4 light_43; - SurfaceOutput o_44; - Input surfIN_45; - vec2 tmpvar_46; - tmpvar_46 = IN_41.hip_pack0.xy; - surfIN_45.uv_MainTex = tmpvar_46; - vec2 tmpvar_47; - tmpvar_47 = IN_41.hip_pack0.zw; - surfIN_45.uv_BumpMap = tmpvar_47; - vec2 tmpvar_48; - tmpvar_48 = IN_41.hip_pack1.xy; - surfIN_45.uv_Illum = tmpvar_48; - vec3 tmpvar_49; - tmpvar_49 = IN_41.viewDir; - surfIN_45.viewDir = tmpvar_49; - vec3 tmpvar_50; - tmpvar_50 = vec3(0.0, 0.0, 0.0); - o_44.Albedo = tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = vec3(0.0, 0.0, 0.0); - o_44.Emission = tmpvar_51; - float tmpvar_52; - tmpvar_52 = 0.0; - o_44.Specular = tmpvar_52; - float tmpvar_53; - tmpvar_53 = 0.0; - o_44.Alpha = tmpvar_53; - float tmpvar_54; - tmpvar_54 = 0.0; - o_44.Gloss = tmpvar_54; - surf (surfIN_45, o_44); - vec4 tmpvar_55; - tmpvar_55 = texture2DProj (_LightBuffer, IN_41.hip_screen); - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - light_43 = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = log2 (light_43); - vec4 tmpvar_58; - tmpvar_58 = -(tmpvar_57); - light_43 = tmpvar_58; - vec3 tmpvar_59; - tmpvar_59 = (light_43.xyz + unity_Ambient.xyz); - light_43.xyz = tmpvar_59.xyz.xyz; - vec4 tmpvar_60; - tmpvar_60 = LightingLambert_PrePass (o_44, light_43); - vec4 tmpvar_61; - tmpvar_61 = tmpvar_60; - col_42 = tmpvar_61; - vec3 tmpvar_62; - tmpvar_62 = (col_42.xyz + o_44.Emission); - col_42.xyz = tmpvar_62.xyz.xyz; - return col_42; -} - -void main () -{ - v2f_surf xlt_IN_63; - vec4 xl_retval_64; - vec4 tmpvar_65; - tmpvar_65 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_63.pos = tmpvar_65; - float tmpvar_66; - tmpvar_66 = xlv_FOG.x; - xlt_IN_63.fog = tmpvar_66; - vec4 tmpvar_67; - tmpvar_67 = gl_TexCoord[0].xyzw; - vec4 tmpvar_68; - tmpvar_68 = tmpvar_67; - xlt_IN_63.hip_pack0 = tmpvar_68; - vec2 tmpvar_69; - tmpvar_69 = gl_TexCoord[1].xy; - vec2 tmpvar_70; - tmpvar_70 = tmpvar_69; - xlt_IN_63.hip_pack1 = tmpvar_70; - vec3 tmpvar_71; - tmpvar_71 = gl_TexCoord[2].xyz; - vec3 tmpvar_72; - tmpvar_72 = tmpvar_71; - xlt_IN_63.viewDir = tmpvar_72; - vec4 tmpvar_73; - tmpvar_73 = gl_TexCoord[3].xyzw; - vec4 tmpvar_74; - tmpvar_74 = tmpvar_73; - xlt_IN_63.hip_screen = tmpvar_74; - vec4 tmpvar_75; - tmpvar_75 = frag_surf (xlt_IN_63); - vec4 tmpvar_76; - tmpvar_76 = tmpvar_75; - xl_retval_64 = tmpvar_76; - vec4 tmpvar_77; - tmpvar_77 = xl_retval_64.xyzw; - vec4 tmpvar_78; - tmpvar_78 = tmpvar_77; - gl_FragData[0] = tmpvar_78; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-out.txt index b03a3ed45..31ad181a4 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-out.txt @@ -1,4 +1,3 @@ -uniform sampler2D _BumpMap; uniform vec4 _Color; uniform sampler2D _Illum; uniform sampler2D _LightBuffer; @@ -12,31 +11,35 @@ void main () tmpvar_1 = gl_TexCoord[0]; vec4 col_2; vec4 light_3; - vec2 tmpvar_4; - vec3 v_5; - vec3 tmpvar_6; - tmpvar_6 = normalize(gl_TexCoord[2].xyz); - v_5.xy = tmpvar_6.xy; - v_5.z = (tmpvar_6.z + 0.42); - tmpvar_4 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_6.xy / v_5.z)); - vec4 tmpvar_7; - tmpvar_7 = (texture2D (_MainTex, (tmpvar_1.xy + tmpvar_4)) * _Color); - vec4 normal_8; - normal_8.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_4)).wy * 2.0) - 1.0); - normal_8.z = sqrt(((1.0 - - (normal_8.x * normal_8.x) - ) - (normal_8.y * normal_8.y))); - vec4 tmpvar_9; - tmpvar_9 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[3]))); - light_3.w = tmpvar_9.w; - light_3.xyz = (tmpvar_9.xyz + unity_Ambient.xyz); - vec4 c_10; - c_10.xyz = (tmpvar_7.xyz * light_3.xyz); - c_10.w = tmpvar_7.w; - col_2.w = c_10.w; - col_2.xyz = (c_10.xyz + (tmpvar_7.xyz * texture2D (_Illum, (gl_TexCoord[1].xy + tmpvar_4)).w)); + vec4 c_4; + vec2 tmpvar_5; + vec3 v_6; + vec3 tmpvar_7; + tmpvar_7 = normalize(gl_TexCoord[2].xyz); + v_6.xy = tmpvar_7.xy; + v_6.z = (tmpvar_7.z + 0.42); + tmpvar_5 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_7.xy / v_6.z)); + c_4 = (texture2D (_MainTex, (tmpvar_1.xy + tmpvar_5)) * _Color); + light_3 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[3]))); + light_3.xyz = (light_3.xyz + unity_Ambient.xyz); + vec4 c_8; + c_8.xyz = (c_4.xyz * light_3.xyz); + c_8.w = c_4.w; + col_2.w = c_8.w; + col_2.xyz = (c_8.xyz + (c_4.xyz * texture2D (_Illum, (gl_TexCoord[1].xy + tmpvar_5)).w)); gl_FragData[0] = col_2; } -// inputs: 1, stats: 24 alu 5 tex 0 flow +// stats: 16 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 3 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _Parallax (high float) 1x1 [-1] +// #2: unity_Ambient (high float) 4x1 [-1] +// textures: 4 +// #0: _Illum (high 2d) 0x0 [-1] +// #1: _LightBuffer (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] +// #3: _ParallaxMap (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-ir.txt deleted file mode 100644 index bed74d6ee..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-ir.txt +++ /dev/null @@ -1,291 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; - vec2 uv_Illum; - vec3 viewDir; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec3 lightDir; - vec3 _LightCoord; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform sampler2D _Illum; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _MainTex; -uniform float _Parallax; -uniform sampler2D _ParallaxMap; -uniform float _Shininess; -uniform vec4 _SpecColor; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -vec2 ParallaxOffset ( - in float h_6, - in float height_7, - in vec3 viewDir_8 -) -{ - vec3 v_9; - float tmpvar_10; - tmpvar_10 = ((h_6 * height_7) - (height_7 / 2.0)); - h_6 = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = normalize (viewDir_8); - vec3 tmpvar_12; - tmpvar_12 = tmpvar_11; - v_9 = tmpvar_12; - float tmpvar_13; - tmpvar_13 = (v_9.z + 0.42); - v_9.z = vec3(tmpvar_13).z; - return (h_6 * (v_9.xy / v_9.z)); -} - -void surf ( - in Input IN_14, - inout SurfaceOutput o_15 -) -{ - vec4 c_16; - vec4 tex_17; - vec2 offset_18; - float h_19; - vec4 tmpvar_20; - tmpvar_20 = texture2D (_ParallaxMap, IN_14.uv_BumpMap); - float tmpvar_21; - tmpvar_21 = tmpvar_20.w; - h_19 = tmpvar_21; - vec2 tmpvar_22; - tmpvar_22 = ParallaxOffset (h_19, _Parallax, IN_14.viewDir); - vec2 tmpvar_23; - tmpvar_23 = tmpvar_22; - offset_18 = tmpvar_23; - vec2 tmpvar_24; - tmpvar_24 = (IN_14.uv_MainTex + offset_18); - IN_14.uv_MainTex = tmpvar_24; - vec2 tmpvar_25; - tmpvar_25 = (IN_14.uv_BumpMap + offset_18); - IN_14.uv_BumpMap = tmpvar_25; - vec2 tmpvar_26; - tmpvar_26 = (IN_14.uv_Illum + offset_18); - IN_14.uv_Illum = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = texture2D (_MainTex, IN_14.uv_MainTex); - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - tex_17 = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = (tex_17 * _Color); - c_16 = tmpvar_29; - vec3 tmpvar_30; - tmpvar_30 = c_16.xyz; - o_15.Albedo = tmpvar_30; - float tmpvar_31; - tmpvar_31 = tex_17.w; - o_15.Gloss = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = texture2D (_Illum, IN_14.uv_Illum); - vec3 tmpvar_33; - tmpvar_33 = (c_16.xyz * tmpvar_32.w); - o_15.Emission = tmpvar_33; - float tmpvar_34; - tmpvar_34 = _Shininess; - o_15.Specular = tmpvar_34; - float tmpvar_35; - tmpvar_35 = c_16.w; - o_15.Alpha = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36 = texture2D (_BumpMap, IN_14.uv_BumpMap); - vec4 tmpvar_37; - tmpvar_37 = UnpackNormal (tmpvar_36); - vec3 tmpvar_38; - tmpvar_38 = tmpvar_37.xyz; - vec3 tmpvar_39; - tmpvar_39 = tmpvar_38; - o_15.Normal = tmpvar_39; -} - -vec4 LightingBlinnPhong ( - in SurfaceOutput s_40, - in vec3 lightDir_41, - in vec3 viewDir_42, - in float atten_43 -) -{ - vec4 c_44; - float spec_45; - float nh_46; - float diff_47; - vec3 h_48; - vec3 tmpvar_49; - tmpvar_49 = normalize ((lightDir_41 + viewDir_42)); - vec3 tmpvar_50; - tmpvar_50 = tmpvar_49; - h_48 = tmpvar_50; - float tmpvar_51; - tmpvar_51 = dot (s_40.Normal, lightDir_41); - float tmpvar_52; - tmpvar_52 = max (0.0, tmpvar_51); - float tmpvar_53; - tmpvar_53 = tmpvar_52; - diff_47 = tmpvar_53; - float tmpvar_54; - tmpvar_54 = dot (s_40.Normal, h_48); - float tmpvar_55; - tmpvar_55 = max (0.0, tmpvar_54); - float tmpvar_56; - tmpvar_56 = tmpvar_55; - nh_46 = tmpvar_56; - float tmpvar_57; - tmpvar_57 = pow (nh_46, (s_40.Specular * 128.0)); - float tmpvar_58; - tmpvar_58 = (tmpvar_57 * s_40.Gloss); - spec_45 = tmpvar_58; - vec3 tmpvar_59; - tmpvar_59 = ((( - (s_40.Albedo * _LightColor0.xyz) - * diff_47) + ( - (_LightColor0.xyz * _SpecColor.xyz) - * spec_45)) * (atten_43 * 2.0)); - c_44.xyz = tmpvar_59.xyz.xyz; - float tmpvar_60; - tmpvar_60 = (s_40.Alpha + (( - (_LightColor0.w * _SpecColor.w) - * spec_45) * atten_43)); - c_44.w = vec4(tmpvar_60).w; - return c_44; -} - -vec4 frag_surf ( - in v2f_surf IN_61 -) -{ - vec4 c_62; - vec3 lightDir_63; - SurfaceOutput o_64; - Input surfIN_65; - vec2 tmpvar_66; - tmpvar_66 = IN_61.hip_pack0.xy; - surfIN_65.uv_MainTex = tmpvar_66; - vec2 tmpvar_67; - tmpvar_67 = IN_61.hip_pack0.zw; - surfIN_65.uv_BumpMap = tmpvar_67; - vec3 tmpvar_68; - tmpvar_68 = IN_61.viewDir; - surfIN_65.viewDir = tmpvar_68; - vec3 tmpvar_69; - tmpvar_69 = vec3(0.0, 0.0, 0.0); - o_64.Albedo = tmpvar_69; - vec3 tmpvar_70; - tmpvar_70 = vec3(0.0, 0.0, 0.0); - o_64.Emission = tmpvar_70; - float tmpvar_71; - tmpvar_71 = 0.0; - o_64.Specular = tmpvar_71; - float tmpvar_72; - tmpvar_72 = 0.0; - o_64.Alpha = tmpvar_72; - float tmpvar_73; - tmpvar_73 = 0.0; - o_64.Gloss = tmpvar_73; - surf (surfIN_65, o_64); - vec3 tmpvar_74; - tmpvar_74 = IN_61.lightDir; - lightDir_63 = tmpvar_74; - vec3 tmpvar_75; - tmpvar_75 = normalize (lightDir_63); - vec3 tmpvar_76; - tmpvar_76 = tmpvar_75; - lightDir_63 = tmpvar_76; - vec3 tmpvar_77; - tmpvar_77 = IN_61.viewDir.xyz; - vec3 tmpvar_78; - tmpvar_78 = normalize (tmpvar_77); - float tmpvar_79; - tmpvar_79 = dot (IN_61._LightCoord, IN_61._LightCoord); - vec2 tmpvar_80; - tmpvar_80 = vec2(tmpvar_79); - vec2 tmpvar_81; - tmpvar_81 = tmpvar_80.xy; - vec4 tmpvar_82; - tmpvar_82 = texture2D (_LightTexture0, tmpvar_81); - vec4 tmpvar_83; - tmpvar_83 = LightingBlinnPhong (o_64, lightDir_63, tmpvar_78, tmpvar_82.w); - vec4 tmpvar_84; - tmpvar_84 = tmpvar_83; - c_62 = tmpvar_84; - float tmpvar_85; - tmpvar_85 = 0.0; - c_62.w = vec4(tmpvar_85).w; - return c_62; -} - -void main () -{ - v2f_surf xlt_IN_86; - vec4 xl_retval_87; - vec4 tmpvar_88; - tmpvar_88 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_86.pos = tmpvar_88; - float tmpvar_89; - tmpvar_89 = xlv_FOG.x; - xlt_IN_86.fog = tmpvar_89; - vec4 tmpvar_90; - tmpvar_90 = gl_TexCoord[0].xyzw; - vec4 tmpvar_91; - tmpvar_91 = tmpvar_90; - xlt_IN_86.hip_pack0 = tmpvar_91; - vec3 tmpvar_92; - tmpvar_92 = gl_TexCoord[1].xyz; - vec3 tmpvar_93; - tmpvar_93 = tmpvar_92; - xlt_IN_86.viewDir = tmpvar_93; - vec3 tmpvar_94; - tmpvar_94 = gl_TexCoord[2].xyz; - vec3 tmpvar_95; - tmpvar_95 = tmpvar_94; - xlt_IN_86.lightDir = tmpvar_95; - vec3 tmpvar_96; - tmpvar_96 = gl_TexCoord[3].xyz; - vec3 tmpvar_97; - tmpvar_97 = tmpvar_96; - xlt_IN_86._LightCoord = tmpvar_97; - vec4 tmpvar_98; - tmpvar_98 = frag_surf (xlt_IN_86); - vec4 tmpvar_99; - tmpvar_99 = tmpvar_98; - xl_retval_87 = tmpvar_99; - vec4 tmpvar_100; - tmpvar_100 = xl_retval_87.xyzw; - vec4 tmpvar_101; - tmpvar_101 = tmpvar_100; - gl_FragData[0] = tmpvar_101; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-out.txt index 14f871752..267ff62bf 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-out.txt @@ -16,19 +16,19 @@ void main () vec3 tmpvar_3; tmpvar_3 = gl_TexCoord[3].xyz; vec4 c_4; - vec2 tmpvar_5; - vec3 v_6; - vec3 tmpvar_7; - tmpvar_7 = normalize(tmpvar_2); - v_6.xy = tmpvar_7.xy; - v_6.z = (tmpvar_7.z + 0.42); - tmpvar_5 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_7.xy / v_6.z)); - vec4 tmpvar_8; - tmpvar_8 = texture2D (_MainTex, (tmpvar_1.xy + tmpvar_5)); + vec4 c_5; + vec2 tmpvar_6; + vec3 v_7; + vec3 tmpvar_8; + tmpvar_8 = normalize(tmpvar_2); + v_7.xy = tmpvar_8.xy; + v_7.z = (tmpvar_8.z + 0.42); + tmpvar_6 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_8.xy / v_7.z)); vec4 tmpvar_9; - tmpvar_9 = (tmpvar_8 * _Color); + tmpvar_9 = texture2D (_MainTex, (tmpvar_1.xy + tmpvar_6)); + c_5 = (tmpvar_9 * _Color); vec4 normal_10; - normal_10.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_5)).wy * 2.0) - 1.0); + normal_10.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_6)).wy * 2.0) - 1.0); normal_10.z = sqrt(((1.0 - (normal_10.x * normal_10.x) ) - (normal_10.y * normal_10.y))); @@ -37,24 +37,35 @@ void main () vec4 tmpvar_12; tmpvar_12 = texture2D (_LightTexture0, vec2(dot (tmpvar_3, tmpvar_3))); vec4 c_13; - float tmpvar_14; - tmpvar_14 = (pow (max (0.0, + float spec_14; + spec_14 = (pow (max (0.0, dot (normal_10.xyz, normalize((tmpvar_11 + normalize(tmpvar_2)))) - ), (_Shininess * 128.0)) * tmpvar_8.w); + ), (_Shininess * 128.0)) * tmpvar_9.w); c_13.xyz = ((( - (tmpvar_9.xyz * _LightColor0.xyz) + (c_5.xyz * _LightColor0.xyz) * max (0.0, dot (normal_10.xyz, tmpvar_11)) ) + ( (_LightColor0.xyz * _SpecColor.xyz) - * tmpvar_14)) * (tmpvar_12.w * 2.0)); - c_13.w = (tmpvar_9.w + (( - (_LightColor0.w * _SpecColor.w) - * tmpvar_14) * tmpvar_12.w)); + * spec_14)) * (tmpvar_12.w * 2.0)); + c_13.w = (c_5.w + ((_LightColor0.w * _SpecColor.w) * (spec_14 * tmpvar_12.w))); c_4.xyz = c_13.xyz; c_4.w = 0.0; gl_FragData[0] = c_4; } -// inputs: 1, stats: 41 alu 4 tex 0 flow +// stats: 41 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 5 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _Parallax (high float) 1x1 [-1] +// #3: _Shininess (high float) 1x1 [-1] +// #4: _SpecColor (high float) 4x1 [-1] +// textures: 4 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _LightTexture0 (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] +// #3: _ParallaxMap (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-ir.txt deleted file mode 100644 index 87f36083a..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-ir.txt +++ /dev/null @@ -1,294 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; - vec2 uv_Illum; - vec3 viewDir; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec3 lightDir; - vec3 _LightCoord; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform sampler2D _Illum; -uniform vec4 _LightColor0; -uniform samplerCube _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -uniform float _Parallax; -uniform sampler2D _ParallaxMap; -uniform float _Shininess; -uniform vec4 _SpecColor; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -vec2 ParallaxOffset ( - in float h_6, - in float height_7, - in vec3 viewDir_8 -) -{ - vec3 v_9; - float tmpvar_10; - tmpvar_10 = ((h_6 * height_7) - (height_7 / 2.0)); - h_6 = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = normalize (viewDir_8); - vec3 tmpvar_12; - tmpvar_12 = tmpvar_11; - v_9 = tmpvar_12; - float tmpvar_13; - tmpvar_13 = (v_9.z + 0.42); - v_9.z = vec3(tmpvar_13).z; - return (h_6 * (v_9.xy / v_9.z)); -} - -void surf ( - in Input IN_14, - inout SurfaceOutput o_15 -) -{ - vec4 c_16; - vec4 tex_17; - vec2 offset_18; - float h_19; - vec4 tmpvar_20; - tmpvar_20 = texture2D (_ParallaxMap, IN_14.uv_BumpMap); - float tmpvar_21; - tmpvar_21 = tmpvar_20.w; - h_19 = tmpvar_21; - vec2 tmpvar_22; - tmpvar_22 = ParallaxOffset (h_19, _Parallax, IN_14.viewDir); - vec2 tmpvar_23; - tmpvar_23 = tmpvar_22; - offset_18 = tmpvar_23; - vec2 tmpvar_24; - tmpvar_24 = (IN_14.uv_MainTex + offset_18); - IN_14.uv_MainTex = tmpvar_24; - vec2 tmpvar_25; - tmpvar_25 = (IN_14.uv_BumpMap + offset_18); - IN_14.uv_BumpMap = tmpvar_25; - vec2 tmpvar_26; - tmpvar_26 = (IN_14.uv_Illum + offset_18); - IN_14.uv_Illum = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = texture2D (_MainTex, IN_14.uv_MainTex); - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - tex_17 = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = (tex_17 * _Color); - c_16 = tmpvar_29; - vec3 tmpvar_30; - tmpvar_30 = c_16.xyz; - o_15.Albedo = tmpvar_30; - float tmpvar_31; - tmpvar_31 = tex_17.w; - o_15.Gloss = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = texture2D (_Illum, IN_14.uv_Illum); - vec3 tmpvar_33; - tmpvar_33 = (c_16.xyz * tmpvar_32.w); - o_15.Emission = tmpvar_33; - float tmpvar_34; - tmpvar_34 = _Shininess; - o_15.Specular = tmpvar_34; - float tmpvar_35; - tmpvar_35 = c_16.w; - o_15.Alpha = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36 = texture2D (_BumpMap, IN_14.uv_BumpMap); - vec4 tmpvar_37; - tmpvar_37 = UnpackNormal (tmpvar_36); - vec3 tmpvar_38; - tmpvar_38 = tmpvar_37.xyz; - vec3 tmpvar_39; - tmpvar_39 = tmpvar_38; - o_15.Normal = tmpvar_39; -} - -vec4 LightingBlinnPhong ( - in SurfaceOutput s_40, - in vec3 lightDir_41, - in vec3 viewDir_42, - in float atten_43 -) -{ - vec4 c_44; - float spec_45; - float nh_46; - float diff_47; - vec3 h_48; - vec3 tmpvar_49; - tmpvar_49 = normalize ((lightDir_41 + viewDir_42)); - vec3 tmpvar_50; - tmpvar_50 = tmpvar_49; - h_48 = tmpvar_50; - float tmpvar_51; - tmpvar_51 = dot (s_40.Normal, lightDir_41); - float tmpvar_52; - tmpvar_52 = max (0.0, tmpvar_51); - float tmpvar_53; - tmpvar_53 = tmpvar_52; - diff_47 = tmpvar_53; - float tmpvar_54; - tmpvar_54 = dot (s_40.Normal, h_48); - float tmpvar_55; - tmpvar_55 = max (0.0, tmpvar_54); - float tmpvar_56; - tmpvar_56 = tmpvar_55; - nh_46 = tmpvar_56; - float tmpvar_57; - tmpvar_57 = pow (nh_46, (s_40.Specular * 128.0)); - float tmpvar_58; - tmpvar_58 = (tmpvar_57 * s_40.Gloss); - spec_45 = tmpvar_58; - vec3 tmpvar_59; - tmpvar_59 = ((( - (s_40.Albedo * _LightColor0.xyz) - * diff_47) + ( - (_LightColor0.xyz * _SpecColor.xyz) - * spec_45)) * (atten_43 * 2.0)); - c_44.xyz = tmpvar_59.xyz.xyz; - float tmpvar_60; - tmpvar_60 = (s_40.Alpha + (( - (_LightColor0.w * _SpecColor.w) - * spec_45) * atten_43)); - c_44.w = vec4(tmpvar_60).w; - return c_44; -} - -vec4 frag_surf ( - in v2f_surf IN_61 -) -{ - vec4 c_62; - vec3 lightDir_63; - SurfaceOutput o_64; - Input surfIN_65; - vec2 tmpvar_66; - tmpvar_66 = IN_61.hip_pack0.xy; - surfIN_65.uv_MainTex = tmpvar_66; - vec2 tmpvar_67; - tmpvar_67 = IN_61.hip_pack0.zw; - surfIN_65.uv_BumpMap = tmpvar_67; - vec3 tmpvar_68; - tmpvar_68 = IN_61.viewDir; - surfIN_65.viewDir = tmpvar_68; - vec3 tmpvar_69; - tmpvar_69 = vec3(0.0, 0.0, 0.0); - o_64.Albedo = tmpvar_69; - vec3 tmpvar_70; - tmpvar_70 = vec3(0.0, 0.0, 0.0); - o_64.Emission = tmpvar_70; - float tmpvar_71; - tmpvar_71 = 0.0; - o_64.Specular = tmpvar_71; - float tmpvar_72; - tmpvar_72 = 0.0; - o_64.Alpha = tmpvar_72; - float tmpvar_73; - tmpvar_73 = 0.0; - o_64.Gloss = tmpvar_73; - surf (surfIN_65, o_64); - vec3 tmpvar_74; - tmpvar_74 = IN_61.lightDir; - lightDir_63 = tmpvar_74; - vec3 tmpvar_75; - tmpvar_75 = normalize (lightDir_63); - vec3 tmpvar_76; - tmpvar_76 = tmpvar_75; - lightDir_63 = tmpvar_76; - vec3 tmpvar_77; - tmpvar_77 = IN_61.viewDir.xyz; - vec3 tmpvar_78; - tmpvar_78 = normalize (tmpvar_77); - float tmpvar_79; - tmpvar_79 = dot (IN_61._LightCoord, IN_61._LightCoord); - vec2 tmpvar_80; - tmpvar_80 = vec2(tmpvar_79); - vec2 tmpvar_81; - tmpvar_81 = tmpvar_80.xy; - vec4 tmpvar_82; - tmpvar_82 = texture2D (_LightTextureB0, tmpvar_81); - vec4 tmpvar_83; - tmpvar_83 = textureCube (_LightTexture0, IN_61._LightCoord); - vec4 tmpvar_84; - tmpvar_84 = LightingBlinnPhong (o_64, lightDir_63, tmpvar_78, (tmpvar_82.w * tmpvar_83.w)); - vec4 tmpvar_85; - tmpvar_85 = tmpvar_84; - c_62 = tmpvar_85; - float tmpvar_86; - tmpvar_86 = 0.0; - c_62.w = vec4(tmpvar_86).w; - return c_62; -} - -void main () -{ - v2f_surf xlt_IN_87; - vec4 xl_retval_88; - vec4 tmpvar_89; - tmpvar_89 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_87.pos = tmpvar_89; - float tmpvar_90; - tmpvar_90 = xlv_FOG.x; - xlt_IN_87.fog = tmpvar_90; - vec4 tmpvar_91; - tmpvar_91 = gl_TexCoord[0].xyzw; - vec4 tmpvar_92; - tmpvar_92 = tmpvar_91; - xlt_IN_87.hip_pack0 = tmpvar_92; - vec3 tmpvar_93; - tmpvar_93 = gl_TexCoord[1].xyz; - vec3 tmpvar_94; - tmpvar_94 = tmpvar_93; - xlt_IN_87.viewDir = tmpvar_94; - vec3 tmpvar_95; - tmpvar_95 = gl_TexCoord[2].xyz; - vec3 tmpvar_96; - tmpvar_96 = tmpvar_95; - xlt_IN_87.lightDir = tmpvar_96; - vec3 tmpvar_97; - tmpvar_97 = gl_TexCoord[3].xyz; - vec3 tmpvar_98; - tmpvar_98 = tmpvar_97; - xlt_IN_87._LightCoord = tmpvar_98; - vec4 tmpvar_99; - tmpvar_99 = frag_surf (xlt_IN_87); - vec4 tmpvar_100; - tmpvar_100 = tmpvar_99; - xl_retval_88 = tmpvar_100; - vec4 tmpvar_101; - tmpvar_101 = xl_retval_88.xyzw; - vec4 tmpvar_102; - tmpvar_102 = tmpvar_101; - gl_FragData[0] = tmpvar_102; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-out.txt index e1654262a..f8f17c336 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-out.txt @@ -17,19 +17,19 @@ void main () vec3 tmpvar_3; tmpvar_3 = gl_TexCoord[3].xyz; vec4 c_4; - vec2 tmpvar_5; - vec3 v_6; - vec3 tmpvar_7; - tmpvar_7 = normalize(tmpvar_2); - v_6.xy = tmpvar_7.xy; - v_6.z = (tmpvar_7.z + 0.42); - tmpvar_5 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_7.xy / v_6.z)); - vec4 tmpvar_8; - tmpvar_8 = texture2D (_MainTex, (tmpvar_1.xy + tmpvar_5)); + vec4 c_5; + vec2 tmpvar_6; + vec3 v_7; + vec3 tmpvar_8; + tmpvar_8 = normalize(tmpvar_2); + v_7.xy = tmpvar_8.xy; + v_7.z = (tmpvar_8.z + 0.42); + tmpvar_6 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_8.xy / v_7.z)); vec4 tmpvar_9; - tmpvar_9 = (tmpvar_8 * _Color); + tmpvar_9 = texture2D (_MainTex, (tmpvar_1.xy + tmpvar_6)); + c_5 = (tmpvar_9 * _Color); vec4 normal_10; - normal_10.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_5)).wy * 2.0) - 1.0); + normal_10.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_6)).wy * 2.0) - 1.0); normal_10.z = sqrt(((1.0 - (normal_10.x * normal_10.x) ) - (normal_10.y * normal_10.y))); @@ -38,24 +38,36 @@ void main () float atten_12; atten_12 = (texture2D (_LightTextureB0, vec2(dot (tmpvar_3, tmpvar_3))).w * textureCube (_LightTexture0, tmpvar_3).w); vec4 c_13; - float tmpvar_14; - tmpvar_14 = (pow (max (0.0, + float spec_14; + spec_14 = (pow (max (0.0, dot (normal_10.xyz, normalize((tmpvar_11 + normalize(tmpvar_2)))) - ), (_Shininess * 128.0)) * tmpvar_8.w); + ), (_Shininess * 128.0)) * tmpvar_9.w); c_13.xyz = ((( - (tmpvar_9.xyz * _LightColor0.xyz) + (c_5.xyz * _LightColor0.xyz) * max (0.0, dot (normal_10.xyz, tmpvar_11)) ) + ( (_LightColor0.xyz * _SpecColor.xyz) - * tmpvar_14)) * (atten_12 * 2.0)); - c_13.w = (tmpvar_9.w + (( - (_LightColor0.w * _SpecColor.w) - * tmpvar_14) * atten_12)); + * spec_14)) * (atten_12 * 2.0)); + c_13.w = (c_5.w + ((_LightColor0.w * _SpecColor.w) * (spec_14 * atten_12))); c_4.xyz = c_13.xyz; c_4.w = 0.0; gl_FragData[0] = c_4; } -// inputs: 1, stats: 42 alu 5 tex 0 flow +// stats: 42 alu 5 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 5 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _Parallax (high float) 1x1 [-1] +// #3: _Shininess (high float) 1x1 [-1] +// #4: _SpecColor (high float) 4x1 [-1] +// textures: 5 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _LightTexture0 (high cube) 0x0 [-1] +// #2: _LightTextureB0 (high 2d) 0x0 [-1] +// #3: _MainTex (high 2d) 0x0 [-1] +// #4: _ParallaxMap (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-ir.txt deleted file mode 100644 index 287f5ce47..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-ir.txt +++ /dev/null @@ -1,245 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_Illum; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec3 viewDir; - vec4 _LightCoord; -}; -uniform vec4 _Color; -uniform sampler2D _Illum; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -uniform float _Shininess; -uniform vec4 _SpecColor; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 c_3; - vec4 tex_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_6; - tmpvar_6 = tmpvar_5; - tex_4 = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7 = (tex_4 * _Color); - c_3 = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = c_3.xyz; - o_2.Albedo = tmpvar_8; - vec4 tmpvar_9; - tmpvar_9 = texture2D (_Illum, IN_1.uv_Illum); - vec3 tmpvar_10; - tmpvar_10 = (c_3.xyz * tmpvar_9.w); - o_2.Emission = tmpvar_10; - float tmpvar_11; - tmpvar_11 = tex_4.w; - o_2.Gloss = tmpvar_11; - float tmpvar_12; - tmpvar_12 = c_3.w; - o_2.Alpha = tmpvar_12; - float tmpvar_13; - tmpvar_13 = _Shininess; - o_2.Specular = tmpvar_13; -} - -float UnitySpotCookie ( - in vec4 LightCoord_14 -) -{ - vec4 tmpvar_15; - tmpvar_15 = texture2D (_LightTexture0, ((LightCoord_14.xy / LightCoord_14.w) + 0.5)); - return tmpvar_15.w; -} - -float UnitySpotAttenuate ( - in vec3 LightCoord_16 -) -{ - float tmpvar_17; - tmpvar_17 = dot (LightCoord_16, LightCoord_16); - vec2 tmpvar_18; - tmpvar_18 = vec2(tmpvar_17); - vec2 tmpvar_19; - tmpvar_19 = tmpvar_18.xy; - vec4 tmpvar_20; - tmpvar_20 = texture2D (_LightTextureB0, tmpvar_19); - return tmpvar_20.w; -} - -vec4 LightingBlinnPhong ( - in SurfaceOutput s_21, - in vec3 lightDir_22, - in vec3 viewDir_23, - in float atten_24 -) -{ - vec4 c_25; - float spec_26; - float nh_27; - float diff_28; - vec3 h_29; - vec3 tmpvar_30; - tmpvar_30 = normalize ((lightDir_22 + viewDir_23)); - vec3 tmpvar_31; - tmpvar_31 = tmpvar_30; - h_29 = tmpvar_31; - float tmpvar_32; - tmpvar_32 = dot (s_21.Normal, lightDir_22); - float tmpvar_33; - tmpvar_33 = max (0.0, tmpvar_32); - float tmpvar_34; - tmpvar_34 = tmpvar_33; - diff_28 = tmpvar_34; - float tmpvar_35; - tmpvar_35 = dot (s_21.Normal, h_29); - float tmpvar_36; - tmpvar_36 = max (0.0, tmpvar_35); - float tmpvar_37; - tmpvar_37 = tmpvar_36; - nh_27 = tmpvar_37; - float tmpvar_38; - tmpvar_38 = pow (nh_27, (s_21.Specular * 128.0)); - float tmpvar_39; - tmpvar_39 = (tmpvar_38 * s_21.Gloss); - spec_26 = tmpvar_39; - vec3 tmpvar_40; - tmpvar_40 = ((( - (s_21.Albedo * _LightColor0.xyz) - * diff_28) + ( - (_LightColor0.xyz * _SpecColor.xyz) - * spec_26)) * (atten_24 * 2.0)); - c_25.xyz = tmpvar_40.xyz.xyz; - float tmpvar_41; - tmpvar_41 = (s_21.Alpha + (( - (_LightColor0.w * _SpecColor.w) - * spec_26) * atten_24)); - c_25.w = vec4(tmpvar_41).w; - return c_25; -} - -vec4 frag_surf ( - in v2f_surf IN_42 -) -{ - vec4 c_43; - vec3 lightDir_44; - SurfaceOutput o_45; - Input surfIN_46; - vec2 tmpvar_47; - tmpvar_47 = IN_42.hip_pack0.xy; - surfIN_46.uv_MainTex = tmpvar_47; - vec3 tmpvar_48; - tmpvar_48 = vec3(0.0, 0.0, 0.0); - o_45.Albedo = tmpvar_48; - vec3 tmpvar_49; - tmpvar_49 = vec3(0.0, 0.0, 0.0); - o_45.Emission = tmpvar_49; - float tmpvar_50; - tmpvar_50 = 0.0; - o_45.Specular = tmpvar_50; - float tmpvar_51; - tmpvar_51 = 0.0; - o_45.Alpha = tmpvar_51; - float tmpvar_52; - tmpvar_52 = 0.0; - o_45.Gloss = tmpvar_52; - vec3 tmpvar_53; - tmpvar_53 = IN_42.normal; - o_45.Normal = tmpvar_53; - surf (surfIN_46, o_45); - vec3 tmpvar_54; - tmpvar_54 = IN_42.lightDir; - lightDir_44 = tmpvar_54; - vec3 tmpvar_55; - tmpvar_55 = normalize (lightDir_44); - vec3 tmpvar_56; - tmpvar_56 = tmpvar_55; - lightDir_44 = tmpvar_56; - vec3 tmpvar_57; - tmpvar_57 = IN_42.viewDir.xyz; - vec3 tmpvar_58; - tmpvar_58 = normalize (tmpvar_57); - float tmpvar_59; - tmpvar_59 = UnitySpotCookie (IN_42._LightCoord); - float tmpvar_60; - tmpvar_60 = UnitySpotAttenuate (IN_42._LightCoord.xyz); - vec4 tmpvar_61; - tmpvar_61 = LightingBlinnPhong (o_45, lightDir_44, tmpvar_58, ((float( - (IN_42._LightCoord.z > 0.0) - ) * tmpvar_59) * tmpvar_60)); - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - c_43 = tmpvar_62; - float tmpvar_63; - tmpvar_63 = 0.0; - c_43.w = vec4(tmpvar_63).w; - return c_43; -} - -void main () -{ - v2f_surf xlt_IN_64; - vec4 xl_retval_65; - vec4 tmpvar_66; - tmpvar_66 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_64.pos = tmpvar_66; - float tmpvar_67; - tmpvar_67 = xlv_FOG.x; - xlt_IN_64.fog = tmpvar_67; - vec2 tmpvar_68; - tmpvar_68 = gl_TexCoord[0].xy; - vec2 tmpvar_69; - tmpvar_69 = tmpvar_68; - xlt_IN_64.hip_pack0 = tmpvar_69; - vec3 tmpvar_70; - tmpvar_70 = gl_TexCoord[1].xyz; - vec3 tmpvar_71; - tmpvar_71 = tmpvar_70; - xlt_IN_64.normal = tmpvar_71; - vec3 tmpvar_72; - tmpvar_72 = gl_TexCoord[2].xyz; - vec3 tmpvar_73; - tmpvar_73 = tmpvar_72; - xlt_IN_64.lightDir = tmpvar_73; - vec3 tmpvar_74; - tmpvar_74 = gl_TexCoord[3].xyz; - vec3 tmpvar_75; - tmpvar_75 = tmpvar_74; - xlt_IN_64.viewDir = tmpvar_75; - vec4 tmpvar_76; - tmpvar_76 = gl_TexCoord[4].xyzw; - vec4 tmpvar_77; - tmpvar_77 = tmpvar_76; - xlt_IN_64._LightCoord = tmpvar_77; - vec4 tmpvar_78; - tmpvar_78 = frag_surf (xlt_IN_64); - vec4 tmpvar_79; - tmpvar_79 = tmpvar_78; - xl_retval_65 = tmpvar_79; - vec4 tmpvar_80; - tmpvar_80 = xl_retval_65.xyzw; - vec4 tmpvar_81; - tmpvar_81 = tmpvar_80; - gl_FragData[0] = tmpvar_81; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-out.txt index 665bc8a1e..77fcc8082 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-out.txt @@ -12,10 +12,10 @@ void main () vec4 tmpvar_2; tmpvar_2 = gl_TexCoord[4]; vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, gl_TexCoord[0].xy); + vec4 c_4; vec4 tmpvar_5; - tmpvar_5 = (tmpvar_4 * _Color); + tmpvar_5 = texture2D (_MainTex, gl_TexCoord[0].xy); + c_4 = (tmpvar_5 * _Color); vec3 tmpvar_6; tmpvar_6 = normalize(gl_TexCoord[2].xyz); float atten_7; @@ -25,24 +25,33 @@ void main () (tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w); vec4 c_8; - float tmpvar_9; - tmpvar_9 = (pow (max (0.0, + float spec_9; + spec_9 = (pow (max (0.0, dot (tmpvar_1, normalize((tmpvar_6 + normalize(gl_TexCoord[3].xyz)))) - ), (_Shininess * 128.0)) * tmpvar_4.w); + ), (_Shininess * 128.0)) * tmpvar_5.w); c_8.xyz = ((( - (tmpvar_5.xyz * _LightColor0.xyz) + (c_4.xyz * _LightColor0.xyz) * max (0.0, dot (tmpvar_1, tmpvar_6)) ) + ( (_LightColor0.xyz * _SpecColor.xyz) - * tmpvar_9)) * (atten_7 * 2.0)); - c_8.w = (tmpvar_5.w + (( - (_LightColor0.w * _SpecColor.w) - * tmpvar_9) * atten_7)); + * spec_9)) * (atten_7 * 2.0)); + c_8.w = (c_4.w + ((_LightColor0.w * _SpecColor.w) * (spec_9 * atten_7))); c_3.xyz = c_8.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } -// inputs: 1, stats: 31 alu 3 tex 0 flow +// stats: 31 alu 3 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [5] loc 4 +// uniforms: 4 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _Shininess (high float) 1x1 [-1] +// #3: _SpecColor (high float) 4x1 [-1] +// textures: 3 +// #0: _LightTexture0 (high 2d) 0x0 [-1] +// #1: _LightTextureB0 (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-ir.txt deleted file mode 100644 index 58e0d53c4..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-ir.txt +++ /dev/null @@ -1,113 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_Illum; -}; -struct v2f_surf { - vec4 pos; - vec3 normal; -}; -uniform vec4 _Color; -uniform sampler2D _Illum; -uniform sampler2D _MainTex; -uniform float _Shininess; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 c_3; - vec4 tex_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_6; - tmpvar_6 = tmpvar_5; - tex_4 = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7 = (tex_4 * _Color); - c_3 = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = c_3.xyz; - o_2.Albedo = tmpvar_8; - vec4 tmpvar_9; - tmpvar_9 = texture2D (_Illum, IN_1.uv_Illum); - vec3 tmpvar_10; - tmpvar_10 = (c_3.xyz * tmpvar_9.w); - o_2.Emission = tmpvar_10; - float tmpvar_11; - tmpvar_11 = tex_4.w; - o_2.Gloss = tmpvar_11; - float tmpvar_12; - tmpvar_12 = c_3.w; - o_2.Alpha = tmpvar_12; - float tmpvar_13; - tmpvar_13 = _Shininess; - o_2.Specular = tmpvar_13; -} - -vec4 frag_surf ( - in v2f_surf IN_14 -) -{ - vec4 res_15; - Input surfIN_16; - SurfaceOutput o_17; - vec3 tmpvar_18; - tmpvar_18 = vec3(0.0, 0.0, 0.0); - o_17.Albedo = tmpvar_18; - vec3 tmpvar_19; - tmpvar_19 = vec3(0.0, 0.0, 0.0); - o_17.Emission = tmpvar_19; - float tmpvar_20; - tmpvar_20 = 0.0; - o_17.Specular = tmpvar_20; - float tmpvar_21; - tmpvar_21 = 0.0; - o_17.Alpha = tmpvar_21; - float tmpvar_22; - tmpvar_22 = 0.0; - o_17.Gloss = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = IN_14.normal; - o_17.Normal = tmpvar_23; - surf (surfIN_16, o_17); - vec3 tmpvar_24; - tmpvar_24 = ((o_17.Normal * vec3(0.5, 0.5, -0.5)) + 0.5); - res_15.xyz = tmpvar_24.xyz.xyz; - float tmpvar_25; - tmpvar_25 = o_17.Specular; - res_15.w = vec4(tmpvar_25).w; - return res_15; -} - -void main () -{ - v2f_surf xlt_IN_26; - vec4 xl_retval_27; - vec4 tmpvar_28; - tmpvar_28 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_26.pos = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = gl_TexCoord[0].xyz; - vec3 tmpvar_30; - tmpvar_30 = tmpvar_29; - xlt_IN_26.normal = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = frag_surf (xlt_IN_26); - vec4 tmpvar_32; - tmpvar_32 = tmpvar_31; - xl_retval_27 = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = xl_retval_27.xyzw; - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - gl_FragData[0] = tmpvar_34; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-out.txt index c5e34474e..63f2c940a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-out.txt @@ -8,4 +8,8 @@ void main () } -// inputs: 1, stats: 2 alu 0 tex 0 flow +// stats: 2 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// uniforms: 1 (total size: 0) +// #0: _Shininess (high float) 1x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-ir.txt deleted file mode 100644 index 168712658..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-ir.txt +++ /dev/null @@ -1,310 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_Illum; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec4 hip_screen; - vec3 hip_lmapFade; -}; -uniform vec4 _Color; -uniform sampler2D _Illum; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform float _Shininess; -uniform vec4 _SpecColor; -uniform sampler2D unity_Lightmap; -uniform sampler2D unity_LightmapInd; -varying vec4 xlv_FOG; -float xll_saturate ( - in float x_1 -) -{ - float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -vec2 xll_saturate ( - in vec2 x_3 -) -{ - vec2 tmpvar_4; - tmpvar_4 = clamp (x_3, 0.0, 1.0); - return tmpvar_4; -} - -vec3 xll_saturate ( - in vec3 x_5 -) -{ - vec3 tmpvar_6; - tmpvar_6 = clamp (x_5, 0.0, 1.0); - return tmpvar_6; -} - -vec4 xll_saturate ( - in vec4 x_7 -) -{ - vec4 tmpvar_8; - tmpvar_8 = clamp (x_7, 0.0, 1.0); - return tmpvar_8; -} - -mat2 xll_saturate ( - in mat2 m_9 -) -{ - vec2 tmpvar_10; - tmpvar_10 = clamp (m_9[0], 0.0, 1.0); - vec2 tmpvar_11; - tmpvar_11 = clamp (m_9[1], 0.0, 1.0); - mat2 tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_10; - tmpvar_12[0] = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_12[1] = tmpvar_14; - return tmpvar_12; -} - -mat3 xll_saturate ( - in mat3 m_15 -) -{ - vec3 tmpvar_16; - tmpvar_16 = clamp (m_15[0], 0.0, 1.0); - vec3 tmpvar_17; - tmpvar_17 = clamp (m_15[1], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_15[2], 0.0, 1.0); - mat3 tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_16; - tmpvar_19[0] = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_19[1] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_19[2] = tmpvar_22; - return tmpvar_19; -} - -mat4 xll_saturate ( - in mat4 m_23 -) -{ - vec4 tmpvar_24; - tmpvar_24 = clamp (m_23[0], 0.0, 1.0); - vec4 tmpvar_25; - tmpvar_25 = clamp (m_23[1], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_23[2], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_23[3], 0.0, 1.0); - mat4 tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_24; - tmpvar_28[0] = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_28[1] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_28[2] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_28[3] = tmpvar_32; - return tmpvar_28; -} - -void surf ( - in Input IN_33, - inout SurfaceOutput o_34 -) -{ - vec4 c_35; - vec4 tex_36; - vec4 tmpvar_37; - tmpvar_37 = texture2D (_MainTex, IN_33.uv_MainTex); - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - tex_36 = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = (tex_36 * _Color); - c_35 = tmpvar_39; - vec3 tmpvar_40; - tmpvar_40 = c_35.xyz; - o_34.Albedo = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = texture2D (_Illum, IN_33.uv_Illum); - vec3 tmpvar_42; - tmpvar_42 = (c_35.xyz * tmpvar_41.w); - o_34.Emission = tmpvar_42; - float tmpvar_43; - tmpvar_43 = tex_36.w; - o_34.Gloss = tmpvar_43; - float tmpvar_44; - tmpvar_44 = c_35.w; - o_34.Alpha = tmpvar_44; - float tmpvar_45; - tmpvar_45 = _Shininess; - o_34.Specular = tmpvar_45; -} - -vec4 LightingBlinnPhong_PrePass ( - in SurfaceOutput s_46, - in vec4 light_47 -) -{ - vec4 c_48; - float spec_49; - float tmpvar_50; - tmpvar_50 = (light_47.w * s_46.Gloss); - spec_49 = tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = ((s_46.Albedo * light_47.xyz) + ((light_47.xyz * _SpecColor.xyz) * spec_49)); - c_48.xyz = tmpvar_51.xyz.xyz; - float tmpvar_52; - tmpvar_52 = (s_46.Alpha + (spec_49 * _SpecColor.w)); - c_48.w = vec4(tmpvar_52).w; - return c_48; -} - -vec3 DecodeLightmap ( - in vec4 color_53 -) -{ - return (2.0 * color_53.xyz); -} - -vec4 frag_surf ( - in v2f_surf IN_54 -) -{ - vec4 col_55; - vec3 lm_56; - vec3 lmIndirect_57; - vec3 lmFull_58; - vec4 light_59; - SurfaceOutput o_60; - Input surfIN_61; - vec2 tmpvar_62; - tmpvar_62 = IN_54.hip_pack0.xy; - surfIN_61.uv_MainTex = tmpvar_62; - vec2 tmpvar_63; - tmpvar_63 = IN_54.hip_pack0.zw; - surfIN_61.uv_Illum = tmpvar_63; - vec3 tmpvar_64; - tmpvar_64 = vec3(0.0, 0.0, 0.0); - o_60.Albedo = tmpvar_64; - vec3 tmpvar_65; - tmpvar_65 = vec3(0.0, 0.0, 0.0); - o_60.Emission = tmpvar_65; - float tmpvar_66; - tmpvar_66 = 0.0; - o_60.Specular = tmpvar_66; - float tmpvar_67; - tmpvar_67 = 0.0; - o_60.Alpha = tmpvar_67; - float tmpvar_68; - tmpvar_68 = 0.0; - o_60.Gloss = tmpvar_68; - surf (surfIN_61, o_60); - vec4 tmpvar_69; - tmpvar_69 = texture2DProj (_LightBuffer, IN_54.hip_screen); - vec4 tmpvar_70; - tmpvar_70 = tmpvar_69; - light_59 = tmpvar_70; - vec4 tmpvar_71; - tmpvar_71 = log2 (light_59); - vec4 tmpvar_72; - tmpvar_72 = -(tmpvar_71); - light_59 = tmpvar_72; - vec4 tmpvar_73; - tmpvar_73 = texture2D (unity_Lightmap, IN_54.hip_lmapFade.xy); - vec3 tmpvar_74; - tmpvar_74 = DecodeLightmap (tmpvar_73); - vec3 tmpvar_75; - tmpvar_75 = tmpvar_74; - lmFull_58 = tmpvar_75; - vec4 tmpvar_76; - tmpvar_76 = texture2D (unity_LightmapInd, IN_54.hip_lmapFade.xy); - vec3 tmpvar_77; - tmpvar_77 = DecodeLightmap (tmpvar_76); - vec3 tmpvar_78; - tmpvar_78 = tmpvar_77; - lmIndirect_57 = tmpvar_78; - float tmpvar_79; - tmpvar_79 = xll_saturate (IN_54.hip_lmapFade.z); - vec3 tmpvar_80; - tmpvar_80 = vec3(tmpvar_79); - vec3 tmpvar_81; - tmpvar_81 = mix (lmIndirect_57, lmFull_58, tmpvar_80); - vec3 tmpvar_82; - tmpvar_82 = tmpvar_81; - lm_56 = tmpvar_82; - vec3 tmpvar_83; - tmpvar_83 = (light_59.xyz + lm_56); - light_59.xyz = tmpvar_83.xyz.xyz; - vec4 tmpvar_84; - tmpvar_84 = LightingBlinnPhong_PrePass (o_60, light_59); - vec4 tmpvar_85; - tmpvar_85 = tmpvar_84; - col_55 = tmpvar_85; - vec3 tmpvar_86; - tmpvar_86 = (col_55.xyz + o_60.Emission); - col_55.xyz = tmpvar_86.xyz.xyz; - return col_55; -} - -void main () -{ - v2f_surf xlt_IN_87; - vec4 xl_retval_88; - vec4 tmpvar_89; - tmpvar_89 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_87.pos = tmpvar_89; - float tmpvar_90; - tmpvar_90 = xlv_FOG.x; - xlt_IN_87.fog = tmpvar_90; - vec4 tmpvar_91; - tmpvar_91 = gl_TexCoord[0].xyzw; - vec4 tmpvar_92; - tmpvar_92 = tmpvar_91; - xlt_IN_87.hip_pack0 = tmpvar_92; - vec4 tmpvar_93; - tmpvar_93 = gl_TexCoord[1].xyzw; - vec4 tmpvar_94; - tmpvar_94 = tmpvar_93; - xlt_IN_87.hip_screen = tmpvar_94; - vec3 tmpvar_95; - tmpvar_95 = gl_TexCoord[2].xyz; - vec3 tmpvar_96; - tmpvar_96 = tmpvar_95; - xlt_IN_87.hip_lmapFade = tmpvar_96; - vec4 tmpvar_97; - tmpvar_97 = frag_surf (xlt_IN_87); - vec4 tmpvar_98; - tmpvar_98 = tmpvar_97; - xl_retval_88 = tmpvar_98; - vec4 tmpvar_99; - tmpvar_99 = xl_retval_88.xyzw; - vec4 tmpvar_100; - tmpvar_100 = tmpvar_99; - gl_FragData[0] = tmpvar_100; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-out.txt index 99c40689a..b63e8a94f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-out.txt @@ -13,23 +13,32 @@ void main () tmpvar_2 = gl_TexCoord[2].xyz; vec4 col_3; vec4 light_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, tmpvar_1.xy); + vec4 c_5; vec4 tmpvar_6; - tmpvar_6 = (tmpvar_5 * _Color); - vec4 tmpvar_7; - tmpvar_7 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); - light_4.w = tmpvar_7.w; - light_4.xyz = (tmpvar_7.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_2.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_2.xy).xyz), vec3(clamp (tmpvar_2.z, 0.0, 1.0)))); - vec4 c_8; - float tmpvar_9; - tmpvar_9 = (tmpvar_7.w * tmpvar_5.w); - c_8.xyz = ((tmpvar_6.xyz * light_4.xyz) + ((light_4.xyz * _SpecColor.xyz) * tmpvar_9)); - c_8.w = (tmpvar_6.w + (tmpvar_9 * _SpecColor.w)); - col_3.w = c_8.w; - col_3.xyz = (c_8.xyz + (tmpvar_6.xyz * texture2D (_Illum, tmpvar_1.zw).w)); + tmpvar_6 = texture2D (_MainTex, tmpvar_1.xy); + c_5 = (tmpvar_6 * _Color); + light_4 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); + light_4.xyz = (light_4.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_2.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_2.xy).xyz), vec3(clamp (tmpvar_2.z, 0.0, 1.0)))); + vec4 c_7; + float spec_8; + spec_8 = (light_4.w * tmpvar_6.w); + c_7.xyz = ((c_5.xyz * light_4.xyz) + ((light_4.xyz * _SpecColor.xyz) * spec_8)); + c_7.w = (c_5.w + (spec_8 * _SpecColor.w)); + col_3.w = c_7.w; + col_3.xyz = (c_7.xyz + (c_5.xyz * texture2D (_Illum, tmpvar_1.zw).w)); gl_FragData[0] = col_3; } -// inputs: 1, stats: 17 alu 5 tex 0 flow +// stats: 17 alu 5 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _SpecColor (high float) 4x1 [-1] +// textures: 5 +// #0: _Illum (high 2d) 0x0 [-1] +// #1: _LightBuffer (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] +// #3: unity_Lightmap (high 2d) 0x0 [-1] +// #4: unity_LightmapInd (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-ir.txt deleted file mode 100644 index 62a43a5f4..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-ir.txt +++ /dev/null @@ -1,234 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec3 viewDir; - vec4 _LightCoord; -}; -uniform vec4 _Color; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -uniform float _Shininess; -uniform vec4 _SpecColor; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 tex_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_5; - tmpvar_5 = tmpvar_4; - tex_3 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = (tex_3.xyz * _Color.xyz); - o_2.Albedo = tmpvar_6; - float tmpvar_7; - tmpvar_7 = tex_3.w; - o_2.Gloss = tmpvar_7; - float tmpvar_8; - tmpvar_8 = (tex_3.w * _Color.w); - o_2.Alpha = tmpvar_8; - float tmpvar_9; - tmpvar_9 = _Shininess; - o_2.Specular = tmpvar_9; -} - -float UnitySpotCookie ( - in vec4 LightCoord_10 -) -{ - vec4 tmpvar_11; - tmpvar_11 = texture2D (_LightTexture0, ((LightCoord_10.xy / LightCoord_10.w) + 0.5)); - return tmpvar_11.w; -} - -float UnitySpotAttenuate ( - in vec3 LightCoord_12 -) -{ - float tmpvar_13; - tmpvar_13 = dot (LightCoord_12, LightCoord_12); - vec2 tmpvar_14; - tmpvar_14 = vec2(tmpvar_13); - vec2 tmpvar_15; - tmpvar_15 = tmpvar_14.xy; - vec4 tmpvar_16; - tmpvar_16 = texture2D (_LightTextureB0, tmpvar_15); - return tmpvar_16.w; -} - -vec4 LightingBlinnPhong ( - in SurfaceOutput s_17, - in vec3 lightDir_18, - in vec3 viewDir_19, - in float atten_20 -) -{ - vec4 c_21; - float spec_22; - float nh_23; - float diff_24; - vec3 h_25; - vec3 tmpvar_26; - tmpvar_26 = normalize ((lightDir_18 + viewDir_19)); - vec3 tmpvar_27; - tmpvar_27 = tmpvar_26; - h_25 = tmpvar_27; - float tmpvar_28; - tmpvar_28 = dot (s_17.Normal, lightDir_18); - float tmpvar_29; - tmpvar_29 = max (0.0, tmpvar_28); - float tmpvar_30; - tmpvar_30 = tmpvar_29; - diff_24 = tmpvar_30; - float tmpvar_31; - tmpvar_31 = dot (s_17.Normal, h_25); - float tmpvar_32; - tmpvar_32 = max (0.0, tmpvar_31); - float tmpvar_33; - tmpvar_33 = tmpvar_32; - nh_23 = tmpvar_33; - float tmpvar_34; - tmpvar_34 = pow (nh_23, (s_17.Specular * 128.0)); - float tmpvar_35; - tmpvar_35 = (tmpvar_34 * s_17.Gloss); - spec_22 = tmpvar_35; - vec3 tmpvar_36; - tmpvar_36 = ((( - (s_17.Albedo * _LightColor0.xyz) - * diff_24) + ( - (_LightColor0.xyz * _SpecColor.xyz) - * spec_22)) * (atten_20 * 2.0)); - c_21.xyz = tmpvar_36.xyz.xyz; - float tmpvar_37; - tmpvar_37 = (s_17.Alpha + (( - (_LightColor0.w * _SpecColor.w) - * spec_22) * atten_20)); - c_21.w = vec4(tmpvar_37).w; - return c_21; -} - -vec4 frag_surf ( - in v2f_surf IN_38 -) -{ - vec4 c_39; - vec3 lightDir_40; - SurfaceOutput o_41; - Input surfIN_42; - vec2 tmpvar_43; - tmpvar_43 = IN_38.hip_pack0.xy; - surfIN_42.uv_MainTex = tmpvar_43; - vec3 tmpvar_44; - tmpvar_44 = vec3(0.0, 0.0, 0.0); - o_41.Albedo = tmpvar_44; - vec3 tmpvar_45; - tmpvar_45 = vec3(0.0, 0.0, 0.0); - o_41.Emission = tmpvar_45; - float tmpvar_46; - tmpvar_46 = 0.0; - o_41.Specular = tmpvar_46; - float tmpvar_47; - tmpvar_47 = 0.0; - o_41.Alpha = tmpvar_47; - float tmpvar_48; - tmpvar_48 = 0.0; - o_41.Gloss = tmpvar_48; - vec3 tmpvar_49; - tmpvar_49 = IN_38.normal; - o_41.Normal = tmpvar_49; - surf (surfIN_42, o_41); - vec3 tmpvar_50; - tmpvar_50 = IN_38.lightDir; - lightDir_40 = tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = normalize (lightDir_40); - vec3 tmpvar_52; - tmpvar_52 = tmpvar_51; - lightDir_40 = tmpvar_52; - vec3 tmpvar_53; - tmpvar_53 = IN_38.viewDir.xyz; - vec3 tmpvar_54; - tmpvar_54 = normalize (tmpvar_53); - float tmpvar_55; - tmpvar_55 = UnitySpotCookie (IN_38._LightCoord); - float tmpvar_56; - tmpvar_56 = UnitySpotAttenuate (IN_38._LightCoord.xyz); - vec4 tmpvar_57; - tmpvar_57 = LightingBlinnPhong (o_41, lightDir_40, tmpvar_54, ((float( - (IN_38._LightCoord.z > 0.0) - ) * tmpvar_55) * tmpvar_56)); - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - c_39 = tmpvar_58; - float tmpvar_59; - tmpvar_59 = 0.0; - c_39.w = vec4(tmpvar_59).w; - return c_39; -} - -void main () -{ - v2f_surf xlt_IN_60; - vec4 xl_retval_61; - vec4 tmpvar_62; - tmpvar_62 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_60.pos = tmpvar_62; - float tmpvar_63; - tmpvar_63 = xlv_FOG.x; - xlt_IN_60.fog = tmpvar_63; - vec2 tmpvar_64; - tmpvar_64 = gl_TexCoord[0].xy; - vec2 tmpvar_65; - tmpvar_65 = tmpvar_64; - xlt_IN_60.hip_pack0 = tmpvar_65; - vec3 tmpvar_66; - tmpvar_66 = gl_TexCoord[1].xyz; - vec3 tmpvar_67; - tmpvar_67 = tmpvar_66; - xlt_IN_60.normal = tmpvar_67; - vec3 tmpvar_68; - tmpvar_68 = gl_TexCoord[2].xyz; - vec3 tmpvar_69; - tmpvar_69 = tmpvar_68; - xlt_IN_60.lightDir = tmpvar_69; - vec3 tmpvar_70; - tmpvar_70 = gl_TexCoord[3].xyz; - vec3 tmpvar_71; - tmpvar_71 = tmpvar_70; - xlt_IN_60.viewDir = tmpvar_71; - vec4 tmpvar_72; - tmpvar_72 = gl_TexCoord[4].xyzw; - vec4 tmpvar_73; - tmpvar_73 = tmpvar_72; - xlt_IN_60._LightCoord = tmpvar_73; - vec4 tmpvar_74; - tmpvar_74 = frag_surf (xlt_IN_60); - vec4 tmpvar_75; - tmpvar_75 = tmpvar_74; - xl_retval_61 = tmpvar_75; - vec4 tmpvar_76; - tmpvar_76 = xl_retval_61.xyzw; - vec4 tmpvar_77; - tmpvar_77 = tmpvar_76; - gl_FragData[0] = tmpvar_77; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-out.txt index 2df68886f..645d430b8 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-out.txt @@ -23,8 +23,8 @@ void main () (tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w); vec4 c_7; - float tmpvar_8; - tmpvar_8 = (pow (max (0.0, + float spec_8; + spec_8 = (pow (max (0.0, dot (tmpvar_1, normalize((tmpvar_5 + normalize(gl_TexCoord[3].xyz)))) ), (_Shininess * 128.0)) * tmpvar_4.w); c_7.xyz = ((( @@ -33,14 +33,23 @@ void main () max (0.0, dot (tmpvar_1, tmpvar_5)) ) + ( (_LightColor0.xyz * _SpecColor.xyz) - * tmpvar_8)) * (atten_6 * 2.0)); - c_7.w = ((tmpvar_4.w * _Color.w) + (( - (_LightColor0.w * _SpecColor.w) - * tmpvar_8) * atten_6)); + * spec_8)) * (atten_6 * 2.0)); + c_7.w = ((tmpvar_4.w * _Color.w) + ((_LightColor0.w * _SpecColor.w) * (spec_8 * atten_6))); c_3.xyz = c_7.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } -// inputs: 1, stats: 32 alu 3 tex 0 flow +// stats: 32 alu 3 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [5] loc 4 +// uniforms: 4 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _Shininess (high float) 1x1 [-1] +// #3: _SpecColor (high float) 4x1 [-1] +// textures: 3 +// #0: _LightTexture0 (high 2d) 0x0 [-1] +// #1: _LightTextureB0 (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-ir.txt deleted file mode 100644 index 341fbce85..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-ir.txt +++ /dev/null @@ -1,102 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - vec3 normal; -}; -uniform vec4 _Color; -uniform sampler2D _MainTex; -uniform float _Shininess; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 tex_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_5; - tmpvar_5 = tmpvar_4; - tex_3 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = (tex_3.xyz * _Color.xyz); - o_2.Albedo = tmpvar_6; - float tmpvar_7; - tmpvar_7 = tex_3.w; - o_2.Gloss = tmpvar_7; - float tmpvar_8; - tmpvar_8 = (tex_3.w * _Color.w); - o_2.Alpha = tmpvar_8; - float tmpvar_9; - tmpvar_9 = _Shininess; - o_2.Specular = tmpvar_9; -} - -vec4 frag_surf ( - in v2f_surf IN_10 -) -{ - vec4 res_11; - Input surfIN_12; - SurfaceOutput o_13; - vec3 tmpvar_14; - tmpvar_14 = vec3(0.0, 0.0, 0.0); - o_13.Albedo = tmpvar_14; - vec3 tmpvar_15; - tmpvar_15 = vec3(0.0, 0.0, 0.0); - o_13.Emission = tmpvar_15; - float tmpvar_16; - tmpvar_16 = 0.0; - o_13.Specular = tmpvar_16; - float tmpvar_17; - tmpvar_17 = 0.0; - o_13.Alpha = tmpvar_17; - float tmpvar_18; - tmpvar_18 = 0.0; - o_13.Gloss = tmpvar_18; - vec3 tmpvar_19; - tmpvar_19 = IN_10.normal; - o_13.Normal = tmpvar_19; - surf (surfIN_12, o_13); - vec3 tmpvar_20; - tmpvar_20 = ((o_13.Normal * vec3(0.5, 0.5, -0.5)) + 0.5); - res_11.xyz = tmpvar_20.xyz.xyz; - float tmpvar_21; - tmpvar_21 = o_13.Specular; - res_11.w = vec4(tmpvar_21).w; - return res_11; -} - -void main () -{ - v2f_surf xlt_IN_22; - vec4 xl_retval_23; - vec4 tmpvar_24; - tmpvar_24 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_22.pos = tmpvar_24; - vec3 tmpvar_25; - tmpvar_25 = gl_TexCoord[0].xyz; - vec3 tmpvar_26; - tmpvar_26 = tmpvar_25; - xlt_IN_22.normal = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = frag_surf (xlt_IN_22); - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - xl_retval_23 = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = xl_retval_23.xyzw; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - gl_FragData[0] = tmpvar_30; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-out.txt index c5e34474e..63f2c940a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-out.txt @@ -8,4 +8,8 @@ void main () } -// inputs: 1, stats: 2 alu 0 tex 0 flow +// stats: 2 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// uniforms: 1 (total size: 0) +// #0: _Shininess (high float) 1x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-ir.txt deleted file mode 100644 index ef081f681..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-ir.txt +++ /dev/null @@ -1,293 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 hip_screen; - vec3 hip_lmapFade; -}; -uniform vec4 _Color; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform float _Shininess; -uniform vec4 _SpecColor; -uniform sampler2D unity_Lightmap; -uniform sampler2D unity_LightmapInd; -varying vec4 xlv_FOG; -float xll_saturate ( - in float x_1 -) -{ - float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -vec2 xll_saturate ( - in vec2 x_3 -) -{ - vec2 tmpvar_4; - tmpvar_4 = clamp (x_3, 0.0, 1.0); - return tmpvar_4; -} - -vec3 xll_saturate ( - in vec3 x_5 -) -{ - vec3 tmpvar_6; - tmpvar_6 = clamp (x_5, 0.0, 1.0); - return tmpvar_6; -} - -vec4 xll_saturate ( - in vec4 x_7 -) -{ - vec4 tmpvar_8; - tmpvar_8 = clamp (x_7, 0.0, 1.0); - return tmpvar_8; -} - -mat2 xll_saturate ( - in mat2 m_9 -) -{ - vec2 tmpvar_10; - tmpvar_10 = clamp (m_9[0], 0.0, 1.0); - vec2 tmpvar_11; - tmpvar_11 = clamp (m_9[1], 0.0, 1.0); - mat2 tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_10; - tmpvar_12[0] = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_12[1] = tmpvar_14; - return tmpvar_12; -} - -mat3 xll_saturate ( - in mat3 m_15 -) -{ - vec3 tmpvar_16; - tmpvar_16 = clamp (m_15[0], 0.0, 1.0); - vec3 tmpvar_17; - tmpvar_17 = clamp (m_15[1], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_15[2], 0.0, 1.0); - mat3 tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_16; - tmpvar_19[0] = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_19[1] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_19[2] = tmpvar_22; - return tmpvar_19; -} - -mat4 xll_saturate ( - in mat4 m_23 -) -{ - vec4 tmpvar_24; - tmpvar_24 = clamp (m_23[0], 0.0, 1.0); - vec4 tmpvar_25; - tmpvar_25 = clamp (m_23[1], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_23[2], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_23[3], 0.0, 1.0); - mat4 tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_24; - tmpvar_28[0] = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_28[1] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_28[2] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_28[3] = tmpvar_32; - return tmpvar_28; -} - -void surf ( - in Input IN_33, - inout SurfaceOutput o_34 -) -{ - vec4 tex_35; - vec4 tmpvar_36; - tmpvar_36 = texture2D (_MainTex, IN_33.uv_MainTex); - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - tex_35 = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = (tex_35.xyz * _Color.xyz); - o_34.Albedo = tmpvar_38; - float tmpvar_39; - tmpvar_39 = tex_35.w; - o_34.Gloss = tmpvar_39; - float tmpvar_40; - tmpvar_40 = (tex_35.w * _Color.w); - o_34.Alpha = tmpvar_40; - float tmpvar_41; - tmpvar_41 = _Shininess; - o_34.Specular = tmpvar_41; -} - -vec4 LightingBlinnPhong_PrePass ( - in SurfaceOutput s_42, - in vec4 light_43 -) -{ - vec4 c_44; - float spec_45; - float tmpvar_46; - tmpvar_46 = (light_43.w * s_42.Gloss); - spec_45 = tmpvar_46; - vec3 tmpvar_47; - tmpvar_47 = ((s_42.Albedo * light_43.xyz) + ((light_43.xyz * _SpecColor.xyz) * spec_45)); - c_44.xyz = tmpvar_47.xyz.xyz; - float tmpvar_48; - tmpvar_48 = (s_42.Alpha + (spec_45 * _SpecColor.w)); - c_44.w = vec4(tmpvar_48).w; - return c_44; -} - -vec3 DecodeLightmap ( - in vec4 color_49 -) -{ - return (2.0 * color_49.xyz); -} - -vec4 frag_surf ( - in v2f_surf IN_50 -) -{ - vec4 col_51; - vec3 lm_52; - vec3 lmIndirect_53; - vec3 lmFull_54; - vec4 light_55; - SurfaceOutput o_56; - Input surfIN_57; - vec2 tmpvar_58; - tmpvar_58 = IN_50.hip_pack0.xy; - surfIN_57.uv_MainTex = tmpvar_58; - vec3 tmpvar_59; - tmpvar_59 = vec3(0.0, 0.0, 0.0); - o_56.Albedo = tmpvar_59; - vec3 tmpvar_60; - tmpvar_60 = vec3(0.0, 0.0, 0.0); - o_56.Emission = tmpvar_60; - float tmpvar_61; - tmpvar_61 = 0.0; - o_56.Specular = tmpvar_61; - float tmpvar_62; - tmpvar_62 = 0.0; - o_56.Alpha = tmpvar_62; - float tmpvar_63; - tmpvar_63 = 0.0; - o_56.Gloss = tmpvar_63; - surf (surfIN_57, o_56); - vec4 tmpvar_64; - tmpvar_64 = texture2DProj (_LightBuffer, IN_50.hip_screen); - vec4 tmpvar_65; - tmpvar_65 = tmpvar_64; - light_55 = tmpvar_65; - vec4 tmpvar_66; - tmpvar_66 = log2 (light_55); - vec4 tmpvar_67; - tmpvar_67 = -(tmpvar_66); - light_55 = tmpvar_67; - vec4 tmpvar_68; - tmpvar_68 = texture2D (unity_Lightmap, IN_50.hip_lmapFade.xy); - vec3 tmpvar_69; - tmpvar_69 = DecodeLightmap (tmpvar_68); - vec3 tmpvar_70; - tmpvar_70 = tmpvar_69; - lmFull_54 = tmpvar_70; - vec4 tmpvar_71; - tmpvar_71 = texture2D (unity_LightmapInd, IN_50.hip_lmapFade.xy); - vec3 tmpvar_72; - tmpvar_72 = DecodeLightmap (tmpvar_71); - vec3 tmpvar_73; - tmpvar_73 = tmpvar_72; - lmIndirect_53 = tmpvar_73; - float tmpvar_74; - tmpvar_74 = xll_saturate (IN_50.hip_lmapFade.z); - vec3 tmpvar_75; - tmpvar_75 = vec3(tmpvar_74); - vec3 tmpvar_76; - tmpvar_76 = mix (lmIndirect_53, lmFull_54, tmpvar_75); - vec3 tmpvar_77; - tmpvar_77 = tmpvar_76; - lm_52 = tmpvar_77; - vec3 tmpvar_78; - tmpvar_78 = (light_55.xyz + lm_52); - light_55.xyz = tmpvar_78.xyz.xyz; - vec4 tmpvar_79; - tmpvar_79 = LightingBlinnPhong_PrePass (o_56, light_55); - vec4 tmpvar_80; - tmpvar_80 = tmpvar_79; - col_51 = tmpvar_80; - return col_51; -} - -void main () -{ - v2f_surf xlt_IN_81; - vec4 xl_retval_82; - vec4 tmpvar_83; - tmpvar_83 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_81.pos = tmpvar_83; - float tmpvar_84; - tmpvar_84 = xlv_FOG.x; - xlt_IN_81.fog = tmpvar_84; - vec2 tmpvar_85; - tmpvar_85 = gl_TexCoord[0].xy; - vec2 tmpvar_86; - tmpvar_86 = tmpvar_85; - xlt_IN_81.hip_pack0 = tmpvar_86; - vec4 tmpvar_87; - tmpvar_87 = gl_TexCoord[1].xyzw; - vec4 tmpvar_88; - tmpvar_88 = tmpvar_87; - xlt_IN_81.hip_screen = tmpvar_88; - vec3 tmpvar_89; - tmpvar_89 = gl_TexCoord[2].xyz; - vec3 tmpvar_90; - tmpvar_90 = tmpvar_89; - xlt_IN_81.hip_lmapFade = tmpvar_90; - vec4 tmpvar_91; - tmpvar_91 = frag_surf (xlt_IN_81); - vec4 tmpvar_92; - tmpvar_92 = tmpvar_91; - xl_retval_82 = tmpvar_92; - vec4 tmpvar_93; - tmpvar_93 = xl_retval_82.xyzw; - vec4 tmpvar_94; - tmpvar_94 = tmpvar_93; - gl_FragData[0] = tmpvar_94; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-out.txt index 847912d4d..9884f4fbf 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-out.txt @@ -11,17 +11,25 @@ void main () vec4 light_2; vec4 tmpvar_3; tmpvar_3 = texture2D (_MainTex, gl_TexCoord[0].xy); - vec4 tmpvar_4; - tmpvar_4 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); - light_2.w = tmpvar_4.w; - light_2.xyz = (tmpvar_4.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_1.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_1.xy).xyz), vec3(clamp (tmpvar_1.z, 0.0, 1.0)))); - vec4 c_5; - float tmpvar_6; - tmpvar_6 = (tmpvar_4.w * tmpvar_3.w); - c_5.xyz = (((tmpvar_3.xyz * _Color.xyz) * light_2.xyz) + ((light_2.xyz * _SpecColor.xyz) * tmpvar_6)); - c_5.w = ((tmpvar_3.w * _Color.w) + (tmpvar_6 * _SpecColor.w)); - gl_FragData[0] = c_5; + light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); + light_2.xyz = (light_2.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_1.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_1.xy).xyz), vec3(clamp (tmpvar_1.z, 0.0, 1.0)))); + vec4 c_4; + float spec_5; + spec_5 = (light_2.w * tmpvar_3.w); + c_4.xyz = (((tmpvar_3.xyz * _Color.xyz) * light_2.xyz) + ((light_2.xyz * _SpecColor.xyz) * spec_5)); + c_4.w = ((tmpvar_3.w * _Color.w) + (spec_5 * _SpecColor.w)); + gl_FragData[0] = c_4; } -// inputs: 1, stats: 16 alu 4 tex 0 flow +// stats: 16 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _SpecColor (high float) 4x1 [-1] +// textures: 4 +// #0: _LightBuffer (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] +// #2: unity_Lightmap (high 2d) 0x0 [-1] +// #3: unity_LightmapInd (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-ir.txt deleted file mode 100644 index b0c53b910..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-ir.txt +++ /dev/null @@ -1,188 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv2_Detail; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 normal; - vec3 lightDir; - vec4 _LightCoord; -}; -uniform sampler2D _Detail; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 tmpvar_3; - tmpvar_3 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_4; - tmpvar_4 = texture2D (_Detail, IN_1.uv2_Detail); - vec3 tmpvar_5; - tmpvar_5 = ((tmpvar_3.xyz * tmpvar_4.xyz) * 2.0); - o_2.Albedo = tmpvar_5; -} - -float UnitySpotCookie ( - in vec4 LightCoord_6 -) -{ - vec4 tmpvar_7; - tmpvar_7 = texture2D (_LightTexture0, ((LightCoord_6.xy / LightCoord_6.w) + 0.5)); - return tmpvar_7.w; -} - -float UnitySpotAttenuate ( - in vec3 LightCoord_8 -) -{ - float tmpvar_9; - tmpvar_9 = dot (LightCoord_8, LightCoord_8); - vec2 tmpvar_10; - tmpvar_10 = vec2(tmpvar_9); - vec2 tmpvar_11; - tmpvar_11 = tmpvar_10.xy; - vec4 tmpvar_12; - tmpvar_12 = texture2D (_LightTextureB0, tmpvar_11); - return tmpvar_12.w; -} - -vec4 LightingLambert ( - in SurfaceOutput s_13, - in vec3 lightDir_14, - in float atten_15 -) -{ - vec4 c_16; - float diff_17; - float tmpvar_18; - tmpvar_18 = dot (s_13.Normal, lightDir_14); - float tmpvar_19; - tmpvar_19 = max (0.0, tmpvar_18); - float tmpvar_20; - tmpvar_20 = tmpvar_19; - diff_17 = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = ((s_13.Albedo * _LightColor0.xyz) * ((diff_17 * atten_15) * 2.0)); - c_16.xyz = tmpvar_21.xyz.xyz; - float tmpvar_22; - tmpvar_22 = s_13.Alpha; - c_16.w = vec4(tmpvar_22).w; - return c_16; -} - -vec4 frag_surf ( - in v2f_surf IN_23 -) -{ - vec4 c_24; - vec3 lightDir_25; - SurfaceOutput o_26; - Input surfIN_27; - vec2 tmpvar_28; - tmpvar_28 = IN_23.hip_pack0.xy; - surfIN_27.uv_MainTex = tmpvar_28; - vec2 tmpvar_29; - tmpvar_29 = IN_23.hip_pack0.zw; - surfIN_27.uv2_Detail = tmpvar_29; - vec3 tmpvar_30; - tmpvar_30 = vec3(0.0, 0.0, 0.0); - o_26.Albedo = tmpvar_30; - vec3 tmpvar_31; - tmpvar_31 = vec3(0.0, 0.0, 0.0); - o_26.Emission = tmpvar_31; - float tmpvar_32; - tmpvar_32 = 0.0; - o_26.Specular = tmpvar_32; - float tmpvar_33; - tmpvar_33 = 0.0; - o_26.Alpha = tmpvar_33; - float tmpvar_34; - tmpvar_34 = 0.0; - o_26.Gloss = tmpvar_34; - vec3 tmpvar_35; - tmpvar_35 = IN_23.normal; - o_26.Normal = tmpvar_35; - surf (surfIN_27, o_26); - vec3 tmpvar_36; - tmpvar_36 = IN_23.lightDir; - lightDir_25 = tmpvar_36; - vec3 tmpvar_37; - tmpvar_37 = normalize (lightDir_25); - vec3 tmpvar_38; - tmpvar_38 = tmpvar_37; - lightDir_25 = tmpvar_38; - float tmpvar_39; - tmpvar_39 = UnitySpotCookie (IN_23._LightCoord); - float tmpvar_40; - tmpvar_40 = UnitySpotAttenuate (IN_23._LightCoord.xyz); - vec4 tmpvar_41; - tmpvar_41 = LightingLambert (o_26, lightDir_25, ((float( - (IN_23._LightCoord.z > 0.0) - ) * tmpvar_39) * tmpvar_40)); - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - c_24 = tmpvar_42; - float tmpvar_43; - tmpvar_43 = 0.0; - c_24.w = vec4(tmpvar_43).w; - return c_24; -} - -void main () -{ - v2f_surf xlt_IN_44; - vec4 xl_retval_45; - vec4 tmpvar_46; - tmpvar_46 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_44.pos = tmpvar_46; - float tmpvar_47; - tmpvar_47 = xlv_FOG.x; - xlt_IN_44.fog = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48 = gl_TexCoord[0].xyzw; - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - xlt_IN_44.hip_pack0 = tmpvar_49; - vec3 tmpvar_50; - tmpvar_50 = gl_TexCoord[1].xyz; - vec3 tmpvar_51; - tmpvar_51 = tmpvar_50; - xlt_IN_44.normal = tmpvar_51; - vec3 tmpvar_52; - tmpvar_52 = gl_TexCoord[2].xyz; - vec3 tmpvar_53; - tmpvar_53 = tmpvar_52; - xlt_IN_44.lightDir = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54 = gl_TexCoord[3].xyzw; - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - xlt_IN_44._LightCoord = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = frag_surf (xlt_IN_44); - vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - xl_retval_45 = tmpvar_57; - vec4 tmpvar_58; - tmpvar_58 = xl_retval_45.xyzw; - vec4 tmpvar_59; - tmpvar_59 = tmpvar_58; - gl_FragData[0] = tmpvar_59; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-out.txt index 8fb3d7ab3..e9a980a29 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-out.txt @@ -11,9 +11,7 @@ void main () tmpvar_2 = gl_TexCoord[3]; vec4 c_3; vec4 c_4; - c_4.xyz = ((( - (texture2D (_MainTex, tmpvar_1.xy).xyz * texture2D (_Detail, tmpvar_1.zw).xyz) - * 2.0) * _LightColor0.xyz) * (( + c_4.xyz = (((texture2D (_MainTex, tmpvar_1.xy).xyz * texture2D (_Detail, tmpvar_1.zw).xyz) * (2.0 * _LightColor0.xyz)) * (( max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) * ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w) @@ -25,4 +23,13 @@ void main () } -// inputs: 1, stats: 18 alu 4 tex 0 flow +// stats: 18 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 1 (total size: 0) +// #0: _LightColor0 (high float) 4x1 [-1] +// textures: 4 +// #0: _Detail (high 2d) 0x0 [-1] +// #1: _LightTexture0 (high 2d) 0x0 [-1] +// #2: _LightTextureB0 (high 2d) 0x0 [-1] +// #3: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-ir.txt deleted file mode 100644 index 8b702e79f..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-ir.txt +++ /dev/null @@ -1,135 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv2_Detail; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec4 hip_screen; -}; -uniform sampler2D _Detail; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform vec4 unity_Ambient; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 tmpvar_3; - tmpvar_3 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_4; - tmpvar_4 = texture2D (_Detail, IN_1.uv2_Detail); - vec3 tmpvar_5; - tmpvar_5 = ((tmpvar_3.xyz * tmpvar_4.xyz) * 2.0); - o_2.Albedo = tmpvar_5; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_6, - in vec4 light_7 -) -{ - vec4 c_8; - vec3 tmpvar_9; - tmpvar_9 = (s_6.Albedo * light_7.xyz); - c_8.xyz = tmpvar_9.xyz.xyz; - float tmpvar_10; - tmpvar_10 = s_6.Alpha; - c_8.w = vec4(tmpvar_10).w; - return c_8; -} - -vec4 frag_surf ( - in v2f_surf IN_11 -) -{ - vec4 col_12; - vec4 light_13; - SurfaceOutput o_14; - Input surfIN_15; - vec2 tmpvar_16; - tmpvar_16 = IN_11.hip_pack0.xy; - surfIN_15.uv_MainTex = tmpvar_16; - vec2 tmpvar_17; - tmpvar_17 = IN_11.hip_pack0.zw; - surfIN_15.uv2_Detail = tmpvar_17; - vec3 tmpvar_18; - tmpvar_18 = vec3(0.0, 0.0, 0.0); - o_14.Albedo = tmpvar_18; - vec3 tmpvar_19; - tmpvar_19 = vec3(0.0, 0.0, 0.0); - o_14.Emission = tmpvar_19; - float tmpvar_20; - tmpvar_20 = 0.0; - o_14.Specular = tmpvar_20; - float tmpvar_21; - tmpvar_21 = 0.0; - o_14.Alpha = tmpvar_21; - float tmpvar_22; - tmpvar_22 = 0.0; - o_14.Gloss = tmpvar_22; - surf (surfIN_15, o_14); - vec4 tmpvar_23; - tmpvar_23 = texture2DProj (_LightBuffer, IN_11.hip_screen); - vec4 tmpvar_24; - tmpvar_24 = tmpvar_23; - light_13 = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25 = log2 (light_13); - vec4 tmpvar_26; - tmpvar_26 = -(tmpvar_25); - light_13 = tmpvar_26; - vec3 tmpvar_27; - tmpvar_27 = (light_13.xyz + unity_Ambient.xyz); - light_13.xyz = tmpvar_27.xyz.xyz; - vec4 tmpvar_28; - tmpvar_28 = LightingLambert_PrePass (o_14, light_13); - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - col_12 = tmpvar_29; - return col_12; -} - -void main () -{ - v2f_surf xlt_IN_30; - vec4 xl_retval_31; - vec4 tmpvar_32; - tmpvar_32 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_30.pos = tmpvar_32; - float tmpvar_33; - tmpvar_33 = xlv_FOG.x; - xlt_IN_30.fog = tmpvar_33; - vec4 tmpvar_34; - tmpvar_34 = gl_TexCoord[0].xyzw; - vec4 tmpvar_35; - tmpvar_35 = tmpvar_34; - xlt_IN_30.hip_pack0 = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36 = gl_TexCoord[1].xyzw; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlt_IN_30.hip_screen = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = frag_surf (xlt_IN_30); - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - xl_retval_31 = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = xl_retval_31.xyzw; - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - gl_FragData[0] = tmpvar_41; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-out.txt index 62b6bf995..7980016e4 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-out.txt @@ -7,15 +7,21 @@ void main () vec4 tmpvar_1; tmpvar_1 = gl_TexCoord[0]; vec4 light_2; - vec4 tmpvar_3; - tmpvar_3 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); - light_2.w = tmpvar_3.w; - light_2.xyz = (tmpvar_3.xyz + unity_Ambient.xyz); - vec4 c_4; - c_4.xyz = (((texture2D (_MainTex, tmpvar_1.xy).xyz * texture2D (_Detail, tmpvar_1.zw).xyz) * 2.0) * light_2.xyz); - c_4.w = 0.0; - gl_FragData[0] = c_4; + light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); + light_2.xyz = (light_2.xyz + unity_Ambient.xyz); + vec4 c_3; + c_3.xyz = ((texture2D (_MainTex, tmpvar_1.xy).xyz * texture2D (_Detail, tmpvar_1.zw).xyz) * (2.0 * light_2.xyz)); + c_3.w = 0.0; + gl_FragData[0] = c_3; } -// inputs: 1, stats: 7 alu 3 tex 0 flow +// stats: 7 alu 3 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [2] loc 4 +// uniforms: 1 (total size: 0) +// #0: unity_Ambient (high float) 4x1 [-1] +// textures: 3 +// #0: _Detail (high 2d) 0x0 [-1] +// #1: _LightBuffer (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-ir.txt deleted file mode 100644 index 28b8e5ee9..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-ir.txt +++ /dev/null @@ -1,232 +0,0 @@ -struct MySurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - vec3 GlossColor; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_SpecMap; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 normal; - vec3 lightDir; - vec3 viewDir; - vec4 _LightCoord; -}; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -uniform sampler2D _SpecMap; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout MySurfaceOutput o_2 -) -{ - vec4 spec_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, IN_1.uv_MainTex); - vec3 tmpvar_5; - tmpvar_5 = (tmpvar_4.xyz * 0.3); - o_2.Albedo = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6 = texture2D (_SpecMap, IN_1.uv_SpecMap); - vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - spec_3 = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = spec_3.xyz; - o_2.GlossColor = tmpvar_8; - float tmpvar_9; - tmpvar_9 = 0.25; - o_2.Specular = tmpvar_9; -} - -float UnitySpotCookie ( - in vec4 LightCoord_10 -) -{ - vec4 tmpvar_11; - tmpvar_11 = texture2D (_LightTexture0, ((LightCoord_10.xy / LightCoord_10.w) + 0.5)); - return tmpvar_11.w; -} - -float UnitySpotAttenuate ( - in vec3 LightCoord_12 -) -{ - float tmpvar_13; - tmpvar_13 = dot (LightCoord_12, LightCoord_12); - vec2 tmpvar_14; - tmpvar_14 = vec2(tmpvar_13); - vec2 tmpvar_15; - tmpvar_15 = tmpvar_14.xy; - vec4 tmpvar_16; - tmpvar_16 = texture2D (_LightTextureB0, tmpvar_15); - return tmpvar_16.w; -} - -vec4 LightingColoredSpecular ( - in MySurfaceOutput s_17, - in vec3 lightDir_18, - in vec3 viewDir_19, - in float atten_20 -) -{ - vec4 c_21; - vec3 specCol_22; - float spec_23; - float nh_24; - float diff_25; - vec3 h_26; - vec3 tmpvar_27; - tmpvar_27 = normalize ((lightDir_18 + viewDir_19)); - vec3 tmpvar_28; - tmpvar_28 = tmpvar_27; - h_26 = tmpvar_28; - float tmpvar_29; - tmpvar_29 = dot (s_17.Normal, lightDir_18); - float tmpvar_30; - tmpvar_30 = max (0.0, tmpvar_29); - float tmpvar_31; - tmpvar_31 = tmpvar_30; - diff_25 = tmpvar_31; - float tmpvar_32; - tmpvar_32 = dot (s_17.Normal, h_26); - float tmpvar_33; - tmpvar_33 = max (0.0, tmpvar_32); - float tmpvar_34; - tmpvar_34 = tmpvar_33; - nh_24 = tmpvar_34; - float tmpvar_35; - tmpvar_35 = pow (nh_24, 32.0); - float tmpvar_36; - tmpvar_36 = tmpvar_35; - spec_23 = tmpvar_36; - vec3 tmpvar_37; - tmpvar_37 = (spec_23 * s_17.GlossColor); - specCol_22 = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = ((( - (s_17.Albedo * _LightColor0.xyz) - * diff_25) + (_LightColor0.xyz * specCol_22)) * (atten_20 * 2.0)); - c_21.xyz = tmpvar_38.xyz.xyz; - float tmpvar_39; - tmpvar_39 = s_17.Alpha; - c_21.w = vec4(tmpvar_39).w; - return c_21; -} - -vec4 frag_surf ( - in v2f_surf IN_40 -) -{ - vec4 c_41; - vec3 lightDir_42; - MySurfaceOutput o_43; - Input surfIN_44; - vec2 tmpvar_45; - tmpvar_45 = IN_40.hip_pack0.xy; - surfIN_44.uv_MainTex = tmpvar_45; - vec2 tmpvar_46; - tmpvar_46 = IN_40.hip_pack0.zw; - surfIN_44.uv_SpecMap = tmpvar_46; - vec3 tmpvar_47; - tmpvar_47 = vec3(0.0, 0.0, 0.0); - o_43.Albedo = tmpvar_47; - vec3 tmpvar_48; - tmpvar_48 = vec3(0.0, 0.0, 0.0); - o_43.Emission = tmpvar_48; - float tmpvar_49; - tmpvar_49 = 0.0; - o_43.Specular = tmpvar_49; - float tmpvar_50; - tmpvar_50 = 0.0; - o_43.Alpha = tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = IN_40.normal; - o_43.Normal = tmpvar_51; - surf (surfIN_44, o_43); - vec3 tmpvar_52; - tmpvar_52 = IN_40.lightDir; - lightDir_42 = tmpvar_52; - vec3 tmpvar_53; - tmpvar_53 = normalize (lightDir_42); - vec3 tmpvar_54; - tmpvar_54 = tmpvar_53; - lightDir_42 = tmpvar_54; - vec3 tmpvar_55; - tmpvar_55 = IN_40.viewDir.xyz; - vec3 tmpvar_56; - tmpvar_56 = normalize (tmpvar_55); - float tmpvar_57; - tmpvar_57 = UnitySpotCookie (IN_40._LightCoord); - float tmpvar_58; - tmpvar_58 = UnitySpotAttenuate (IN_40._LightCoord.xyz); - vec4 tmpvar_59; - tmpvar_59 = LightingColoredSpecular (o_43, lightDir_42, tmpvar_56, ((float( - (IN_40._LightCoord.z > 0.0) - ) * tmpvar_57) * tmpvar_58)); - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - c_41 = tmpvar_60; - float tmpvar_61; - tmpvar_61 = 0.0; - c_41.w = vec4(tmpvar_61).w; - return c_41; -} - -void main () -{ - v2f_surf xlt_IN_62; - vec4 xl_retval_63; - vec4 tmpvar_64; - tmpvar_64 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_62.pos = tmpvar_64; - float tmpvar_65; - tmpvar_65 = xlv_FOG.x; - xlt_IN_62.fog = tmpvar_65; - vec4 tmpvar_66; - tmpvar_66 = gl_TexCoord[0].xyzw; - vec4 tmpvar_67; - tmpvar_67 = tmpvar_66; - xlt_IN_62.hip_pack0 = tmpvar_67; - vec3 tmpvar_68; - tmpvar_68 = gl_TexCoord[1].xyz; - vec3 tmpvar_69; - tmpvar_69 = tmpvar_68; - xlt_IN_62.normal = tmpvar_69; - vec3 tmpvar_70; - tmpvar_70 = gl_TexCoord[2].xyz; - vec3 tmpvar_71; - tmpvar_71 = tmpvar_70; - xlt_IN_62.lightDir = tmpvar_71; - vec3 tmpvar_72; - tmpvar_72 = gl_TexCoord[3].xyz; - vec3 tmpvar_73; - tmpvar_73 = tmpvar_72; - xlt_IN_62.viewDir = tmpvar_73; - vec4 tmpvar_74; - tmpvar_74 = gl_TexCoord[4].xyzw; - vec4 tmpvar_75; - tmpvar_75 = tmpvar_74; - xlt_IN_62._LightCoord = tmpvar_75; - vec4 tmpvar_76; - tmpvar_76 = frag_surf (xlt_IN_62); - vec4 tmpvar_77; - tmpvar_77 = tmpvar_76; - xl_retval_63 = tmpvar_77; - vec4 tmpvar_78; - tmpvar_78 = xl_retval_63.xyzw; - vec4 tmpvar_79; - tmpvar_79 = tmpvar_78; - gl_FragData[0] = tmpvar_79; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-out.txt index 75e705d2d..e3c2584e9 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-out.txt @@ -35,4 +35,13 @@ void main () } -// inputs: 1, stats: 26 alu 4 tex 0 flow +// stats: 26 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [5] loc 4 +// uniforms: 1 (total size: 0) +// #0: _LightColor0 (high float) 4x1 [-1] +// textures: 4 +// #0: _LightTexture0 (high 2d) 0x0 [-1] +// #1: _LightTextureB0 (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] +// #3: _SpecMap (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-ir.txt deleted file mode 100644 index 778d5d166..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-ir.txt +++ /dev/null @@ -1,98 +0,0 @@ -struct MySurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - vec3 GlossColor; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_SpecMap; -}; -struct v2f_surf { - vec4 pos; - vec3 normal; -}; -uniform sampler2D _MainTex; -uniform sampler2D _SpecMap; -void surf ( - in Input IN_1, - inout MySurfaceOutput o_2 -) -{ - vec4 spec_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, IN_1.uv_MainTex); - vec3 tmpvar_5; - tmpvar_5 = (tmpvar_4.xyz * 0.3); - o_2.Albedo = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6 = texture2D (_SpecMap, IN_1.uv_SpecMap); - vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - spec_3 = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = spec_3.xyz; - o_2.GlossColor = tmpvar_8; - float tmpvar_9; - tmpvar_9 = 0.25; - o_2.Specular = tmpvar_9; -} - -vec4 frag_surf ( - in v2f_surf IN_10 -) -{ - vec4 res_11; - Input surfIN_12; - MySurfaceOutput o_13; - vec3 tmpvar_14; - tmpvar_14 = vec3(0.0, 0.0, 0.0); - o_13.Albedo = tmpvar_14; - vec3 tmpvar_15; - tmpvar_15 = vec3(0.0, 0.0, 0.0); - o_13.Emission = tmpvar_15; - float tmpvar_16; - tmpvar_16 = 0.0; - o_13.Specular = tmpvar_16; - float tmpvar_17; - tmpvar_17 = 0.0; - o_13.Alpha = tmpvar_17; - vec3 tmpvar_18; - tmpvar_18 = IN_10.normal; - o_13.Normal = tmpvar_18; - surf (surfIN_12, o_13); - vec3 tmpvar_19; - tmpvar_19 = ((o_13.Normal * vec3(0.5, 0.5, -0.5)) + 0.5); - res_11.xyz = tmpvar_19.xyz.xyz; - float tmpvar_20; - tmpvar_20 = o_13.Specular; - res_11.w = vec4(tmpvar_20).w; - return res_11; -} - -void main () -{ - v2f_surf xlt_IN_21; - vec4 xl_retval_22; - vec4 tmpvar_23; - tmpvar_23 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_21.pos = tmpvar_23; - vec3 tmpvar_24; - tmpvar_24 = gl_TexCoord[0].xyz; - vec3 tmpvar_25; - tmpvar_25 = tmpvar_24; - xlt_IN_21.normal = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = frag_surf (xlt_IN_21); - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - xl_retval_22 = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = xl_retval_22.xyzw; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - gl_FragData[0] = tmpvar_29; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-out.txt index 095032d26..af5ca30dd 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-out.txt @@ -7,4 +7,6 @@ void main () } -// inputs: 1, stats: 3 alu 0 tex 0 flow +// stats: 3 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-ir.txt deleted file mode 100644 index a511692e1..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-ir.txt +++ /dev/null @@ -1,158 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec3 foo; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec3 cust_foo; - vec3 normal; - vec3 lightDir; - vec3 _LightCoord; -}; -uniform vec4 _LightColor0; -uniform samplerCube _LightTexture0; -uniform sampler2D _LightTextureB0; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec3 tmpvar_3; - tmpvar_3 = IN_1.foo; - o_2.Albedo = tmpvar_3; -} - -vec4 LightingLambert ( - in SurfaceOutput s_4, - in vec3 lightDir_5, - in float atten_6 -) -{ - vec4 c_7; - float diff_8; - float tmpvar_9; - tmpvar_9 = dot (s_4.Normal, lightDir_5); - float tmpvar_10; - tmpvar_10 = max (0.0, tmpvar_9); - float tmpvar_11; - tmpvar_11 = tmpvar_10; - diff_8 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = ((s_4.Albedo * _LightColor0.xyz) * ((diff_8 * atten_6) * 2.0)); - c_7.xyz = tmpvar_12.xyz.xyz; - float tmpvar_13; - tmpvar_13 = s_4.Alpha; - c_7.w = vec4(tmpvar_13).w; - return c_7; -} - -vec4 frag_surf ( - in v2f_surf IN_14 -) -{ - vec4 c_15; - vec3 lightDir_16; - SurfaceOutput o_17; - Input surfIN_18; - vec3 tmpvar_19; - tmpvar_19 = IN_14.cust_foo; - surfIN_18.foo = tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = vec3(0.0, 0.0, 0.0); - o_17.Albedo = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = vec3(0.0, 0.0, 0.0); - o_17.Emission = tmpvar_21; - float tmpvar_22; - tmpvar_22 = 0.0; - o_17.Specular = tmpvar_22; - float tmpvar_23; - tmpvar_23 = 0.0; - o_17.Alpha = tmpvar_23; - float tmpvar_24; - tmpvar_24 = 0.0; - o_17.Gloss = tmpvar_24; - vec3 tmpvar_25; - tmpvar_25 = IN_14.normal; - o_17.Normal = tmpvar_25; - surf (surfIN_18, o_17); - vec3 tmpvar_26; - tmpvar_26 = IN_14.lightDir; - lightDir_16 = tmpvar_26; - vec3 tmpvar_27; - tmpvar_27 = normalize (lightDir_16); - vec3 tmpvar_28; - tmpvar_28 = tmpvar_27; - lightDir_16 = tmpvar_28; - float tmpvar_29; - tmpvar_29 = dot (IN_14._LightCoord, IN_14._LightCoord); - vec2 tmpvar_30; - tmpvar_30 = vec2(tmpvar_29); - vec2 tmpvar_31; - tmpvar_31 = tmpvar_30.xy; - vec4 tmpvar_32; - tmpvar_32 = texture2D (_LightTextureB0, tmpvar_31); - vec4 tmpvar_33; - tmpvar_33 = textureCube (_LightTexture0, IN_14._LightCoord); - vec4 tmpvar_34; - tmpvar_34 = LightingLambert (o_17, lightDir_16, (tmpvar_32.w * tmpvar_33.w)); - vec4 tmpvar_35; - tmpvar_35 = tmpvar_34; - c_15 = tmpvar_35; - float tmpvar_36; - tmpvar_36 = 0.0; - c_15.w = vec4(tmpvar_36).w; - return c_15; -} - -void main () -{ - v2f_surf xlt_IN_37; - vec4 xl_retval_38; - vec4 tmpvar_39; - tmpvar_39 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_37.pos = tmpvar_39; - float tmpvar_40; - tmpvar_40 = xlv_FOG.x; - xlt_IN_37.fog = tmpvar_40; - vec3 tmpvar_41; - tmpvar_41 = gl_TexCoord[0].xyz; - vec3 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_IN_37.cust_foo = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = gl_TexCoord[1].xyz; - vec3 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_IN_37.normal = tmpvar_44; - vec3 tmpvar_45; - tmpvar_45 = gl_TexCoord[2].xyz; - vec3 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_IN_37.lightDir = tmpvar_46; - vec3 tmpvar_47; - tmpvar_47 = gl_TexCoord[3].xyz; - vec3 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_IN_37._LightCoord = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = frag_surf (xlt_IN_37); - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xl_retval_38 = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = xl_retval_38.xyzw; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - gl_FragData[0] = tmpvar_52; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-out.txt index ceb57a55e..082a301be 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-out.txt @@ -19,4 +19,11 @@ void main () } -// inputs: 1, stats: 11 alu 2 tex 0 flow +// stats: 11 alu 2 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 1 (total size: 0) +// #0: _LightColor0 (high float) 4x1 [-1] +// textures: 2 +// #0: _LightTexture0 (high cube) 0x0 [-1] +// #1: _LightTextureB0 (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-ir.txt deleted file mode 100644 index 9866eae89..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-ir.txt +++ /dev/null @@ -1,144 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec3 foo; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec3 cust_foo; - vec3 normal; - vec3 lightDir; - vec2 _LightCoord; -}; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec3 tmpvar_3; - tmpvar_3 = IN_1.foo; - o_2.Albedo = tmpvar_3; -} - -vec4 LightingLambert ( - in SurfaceOutput s_4, - in vec3 lightDir_5, - in float atten_6 -) -{ - vec4 c_7; - float diff_8; - float tmpvar_9; - tmpvar_9 = dot (s_4.Normal, lightDir_5); - float tmpvar_10; - tmpvar_10 = max (0.0, tmpvar_9); - float tmpvar_11; - tmpvar_11 = tmpvar_10; - diff_8 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = ((s_4.Albedo * _LightColor0.xyz) * ((diff_8 * atten_6) * 2.0)); - c_7.xyz = tmpvar_12.xyz.xyz; - float tmpvar_13; - tmpvar_13 = s_4.Alpha; - c_7.w = vec4(tmpvar_13).w; - return c_7; -} - -vec4 frag_surf ( - in v2f_surf IN_14 -) -{ - vec4 c_15; - vec3 lightDir_16; - SurfaceOutput o_17; - Input surfIN_18; - vec3 tmpvar_19; - tmpvar_19 = IN_14.cust_foo; - surfIN_18.foo = tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = vec3(0.0, 0.0, 0.0); - o_17.Albedo = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = vec3(0.0, 0.0, 0.0); - o_17.Emission = tmpvar_21; - float tmpvar_22; - tmpvar_22 = 0.0; - o_17.Specular = tmpvar_22; - float tmpvar_23; - tmpvar_23 = 0.0; - o_17.Alpha = tmpvar_23; - float tmpvar_24; - tmpvar_24 = 0.0; - o_17.Gloss = tmpvar_24; - vec3 tmpvar_25; - tmpvar_25 = IN_14.normal; - o_17.Normal = tmpvar_25; - surf (surfIN_18, o_17); - vec3 tmpvar_26; - tmpvar_26 = IN_14.lightDir; - lightDir_16 = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = texture2D (_LightTexture0, IN_14._LightCoord); - vec4 tmpvar_28; - tmpvar_28 = LightingLambert (o_17, lightDir_16, (tmpvar_27.w * 1.0)); - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - c_15 = tmpvar_29; - float tmpvar_30; - tmpvar_30 = 0.0; - c_15.w = vec4(tmpvar_30).w; - return c_15; -} - -void main () -{ - v2f_surf xlt_IN_31; - vec4 xl_retval_32; - vec4 tmpvar_33; - tmpvar_33 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_31.pos = tmpvar_33; - float tmpvar_34; - tmpvar_34 = xlv_FOG.x; - xlt_IN_31.fog = tmpvar_34; - vec3 tmpvar_35; - tmpvar_35 = gl_TexCoord[0].xyz; - vec3 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlt_IN_31.cust_foo = tmpvar_36; - vec3 tmpvar_37; - tmpvar_37 = gl_TexCoord[1].xyz; - vec3 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlt_IN_31.normal = tmpvar_38; - vec3 tmpvar_39; - tmpvar_39 = gl_TexCoord[2].xyz; - vec3 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_IN_31.lightDir = tmpvar_40; - vec2 tmpvar_41; - tmpvar_41 = gl_TexCoord[3].xy; - vec2 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_IN_31._LightCoord = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43 = frag_surf (xlt_IN_31); - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - xl_retval_32 = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = xl_retval_32.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - gl_FragData[0] = tmpvar_46; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-out.txt index 4e9383b5f..cc2a0a87a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-out.txt @@ -14,4 +14,10 @@ void main () } -// inputs: 1, stats: 8 alu 1 tex 0 flow +// stats: 8 alu 1 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 1 (total size: 0) +// #0: _LightColor0 (high float) 4x1 [-1] +// textures: 1 +// #0: _LightTexture0 (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-ir.txt deleted file mode 100644 index 5928acbe8..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-ir.txt +++ /dev/null @@ -1,270 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec3 foo; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec3 cust_foo; - vec4 hip_screen; - vec3 hip_lmapFade; -}; -uniform sampler2D _LightBuffer; -uniform sampler2D unity_Lightmap; -uniform sampler2D unity_LightmapInd; -varying vec4 xlv_FOG; -float xll_saturate ( - in float x_1 -) -{ - float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -vec2 xll_saturate ( - in vec2 x_3 -) -{ - vec2 tmpvar_4; - tmpvar_4 = clamp (x_3, 0.0, 1.0); - return tmpvar_4; -} - -vec3 xll_saturate ( - in vec3 x_5 -) -{ - vec3 tmpvar_6; - tmpvar_6 = clamp (x_5, 0.0, 1.0); - return tmpvar_6; -} - -vec4 xll_saturate ( - in vec4 x_7 -) -{ - vec4 tmpvar_8; - tmpvar_8 = clamp (x_7, 0.0, 1.0); - return tmpvar_8; -} - -mat2 xll_saturate ( - in mat2 m_9 -) -{ - vec2 tmpvar_10; - tmpvar_10 = clamp (m_9[0], 0.0, 1.0); - vec2 tmpvar_11; - tmpvar_11 = clamp (m_9[1], 0.0, 1.0); - mat2 tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_10; - tmpvar_12[0] = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_12[1] = tmpvar_14; - return tmpvar_12; -} - -mat3 xll_saturate ( - in mat3 m_15 -) -{ - vec3 tmpvar_16; - tmpvar_16 = clamp (m_15[0], 0.0, 1.0); - vec3 tmpvar_17; - tmpvar_17 = clamp (m_15[1], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_15[2], 0.0, 1.0); - mat3 tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_16; - tmpvar_19[0] = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_19[1] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_19[2] = tmpvar_22; - return tmpvar_19; -} - -mat4 xll_saturate ( - in mat4 m_23 -) -{ - vec4 tmpvar_24; - tmpvar_24 = clamp (m_23[0], 0.0, 1.0); - vec4 tmpvar_25; - tmpvar_25 = clamp (m_23[1], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_23[2], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_23[3], 0.0, 1.0); - mat4 tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_24; - tmpvar_28[0] = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_28[1] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_28[2] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_28[3] = tmpvar_32; - return tmpvar_28; -} - -void surf ( - in Input IN_33, - inout SurfaceOutput o_34 -) -{ - vec3 tmpvar_35; - tmpvar_35 = IN_33.foo; - o_34.Albedo = tmpvar_35; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_36, - in vec4 light_37 -) -{ - vec4 c_38; - vec3 tmpvar_39; - tmpvar_39 = (s_36.Albedo * light_37.xyz); - c_38.xyz = tmpvar_39.xyz.xyz; - float tmpvar_40; - tmpvar_40 = s_36.Alpha; - c_38.w = vec4(tmpvar_40).w; - return c_38; -} - -vec3 DecodeLightmap ( - in vec4 color_41 -) -{ - return (2.0 * color_41.xyz); -} - -vec4 frag_surf ( - in v2f_surf IN_42 -) -{ - vec4 col_43; - vec3 lm_44; - vec3 lmIndirect_45; - vec3 lmFull_46; - vec4 light_47; - SurfaceOutput o_48; - Input surfIN_49; - vec3 tmpvar_50; - tmpvar_50 = IN_42.cust_foo; - surfIN_49.foo = tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = vec3(0.0, 0.0, 0.0); - o_48.Albedo = tmpvar_51; - vec3 tmpvar_52; - tmpvar_52 = vec3(0.0, 0.0, 0.0); - o_48.Emission = tmpvar_52; - float tmpvar_53; - tmpvar_53 = 0.0; - o_48.Specular = tmpvar_53; - float tmpvar_54; - tmpvar_54 = 0.0; - o_48.Alpha = tmpvar_54; - float tmpvar_55; - tmpvar_55 = 0.0; - o_48.Gloss = tmpvar_55; - surf (surfIN_49, o_48); - vec4 tmpvar_56; - tmpvar_56 = texture2DProj (_LightBuffer, IN_42.hip_screen); - vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - light_47 = tmpvar_57; - vec4 tmpvar_58; - tmpvar_58 = log2 (light_47); - vec4 tmpvar_59; - tmpvar_59 = -(tmpvar_58); - light_47 = tmpvar_59; - vec4 tmpvar_60; - tmpvar_60 = texture2D (unity_Lightmap, IN_42.hip_lmapFade.xy); - vec3 tmpvar_61; - tmpvar_61 = DecodeLightmap (tmpvar_60); - vec3 tmpvar_62; - tmpvar_62 = tmpvar_61; - lmFull_46 = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63 = texture2D (unity_LightmapInd, IN_42.hip_lmapFade.xy); - vec3 tmpvar_64; - tmpvar_64 = DecodeLightmap (tmpvar_63); - vec3 tmpvar_65; - tmpvar_65 = tmpvar_64; - lmIndirect_45 = tmpvar_65; - float tmpvar_66; - tmpvar_66 = xll_saturate (IN_42.hip_lmapFade.z); - vec3 tmpvar_67; - tmpvar_67 = vec3(tmpvar_66); - vec3 tmpvar_68; - tmpvar_68 = mix (lmIndirect_45, lmFull_46, tmpvar_67); - vec3 tmpvar_69; - tmpvar_69 = tmpvar_68; - lm_44 = tmpvar_69; - vec3 tmpvar_70; - tmpvar_70 = (light_47.xyz + lm_44); - light_47.xyz = tmpvar_70.xyz.xyz; - vec4 tmpvar_71; - tmpvar_71 = LightingLambert_PrePass (o_48, light_47); - vec4 tmpvar_72; - tmpvar_72 = tmpvar_71; - col_43 = tmpvar_72; - return col_43; -} - -void main () -{ - v2f_surf xlt_IN_73; - vec4 xl_retval_74; - vec4 tmpvar_75; - tmpvar_75 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_73.pos = tmpvar_75; - float tmpvar_76; - tmpvar_76 = xlv_FOG.x; - xlt_IN_73.fog = tmpvar_76; - vec3 tmpvar_77; - tmpvar_77 = gl_TexCoord[0].xyz; - vec3 tmpvar_78; - tmpvar_78 = tmpvar_77; - xlt_IN_73.cust_foo = tmpvar_78; - vec4 tmpvar_79; - tmpvar_79 = gl_TexCoord[1].xyzw; - vec4 tmpvar_80; - tmpvar_80 = tmpvar_79; - xlt_IN_73.hip_screen = tmpvar_80; - vec3 tmpvar_81; - tmpvar_81 = gl_TexCoord[2].xyz; - vec3 tmpvar_82; - tmpvar_82 = tmpvar_81; - xlt_IN_73.hip_lmapFade = tmpvar_82; - vec4 tmpvar_83; - tmpvar_83 = frag_surf (xlt_IN_73); - vec4 tmpvar_84; - tmpvar_84 = tmpvar_83; - xl_retval_74 = tmpvar_84; - vec4 tmpvar_85; - tmpvar_85 = xl_retval_74.xyzw; - vec4 tmpvar_86; - tmpvar_86 = tmpvar_85; - gl_FragData[0] = tmpvar_86; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-out.txt index 71aea3660..68a1d1e06 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-out.txt @@ -6,15 +6,19 @@ void main () vec3 tmpvar_1; tmpvar_1 = gl_TexCoord[2].xyz; vec4 light_2; - vec4 tmpvar_3; - tmpvar_3 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); - light_2.w = tmpvar_3.w; - light_2.xyz = (tmpvar_3.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_1.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_1.xy).xyz), vec3(clamp (tmpvar_1.z, 0.0, 1.0)))); - vec4 c_4; - c_4.xyz = (gl_TexCoord[0].xyz * light_2.xyz); - c_4.w = 0.0; - gl_FragData[0] = c_4; + light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); + light_2.xyz = (light_2.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_1.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_1.xy).xyz), vec3(clamp (tmpvar_1.z, 0.0, 1.0)))); + vec4 c_3; + c_3.xyz = (gl_TexCoord[0].xyz * light_2.xyz); + c_3.w = 0.0; + gl_FragData[0] = c_3; } -// inputs: 1, stats: 9 alu 3 tex 0 flow +// stats: 9 alu 3 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// textures: 3 +// #0: _LightBuffer (high 2d) 0x0 [-1] +// #1: unity_Lightmap (high 2d) 0x0 [-1] +// #2: unity_LightmapInd (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-ir.txt deleted file mode 100644 index 52c363003..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-ir.txt +++ /dev/null @@ -1,147 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec2 _LightCoord; -}; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 tmpvar_3; - tmpvar_3 = texture2D (_MainTex, IN_1.uv_MainTex); - vec3 tmpvar_4; - tmpvar_4 = (tmpvar_3.xyz * 0.5); - o_2.Albedo = tmpvar_4; -} - -vec4 LightingLambert ( - in SurfaceOutput s_5, - in vec3 lightDir_6, - in float atten_7 -) -{ - vec4 c_8; - float diff_9; - float tmpvar_10; - tmpvar_10 = dot (s_5.Normal, lightDir_6); - float tmpvar_11; - tmpvar_11 = max (0.0, tmpvar_10); - float tmpvar_12; - tmpvar_12 = tmpvar_11; - diff_9 = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13 = ((s_5.Albedo * _LightColor0.xyz) * ((diff_9 * atten_7) * 2.0)); - c_8.xyz = tmpvar_13.xyz.xyz; - float tmpvar_14; - tmpvar_14 = s_5.Alpha; - c_8.w = vec4(tmpvar_14).w; - return c_8; -} - -vec4 frag_surf ( - in v2f_surf IN_15 -) -{ - vec4 c_16; - vec3 lightDir_17; - SurfaceOutput o_18; - Input surfIN_19; - vec2 tmpvar_20; - tmpvar_20 = IN_15.hip_pack0.xy; - surfIN_19.uv_MainTex = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = vec3(0.0, 0.0, 0.0); - o_18.Albedo = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = vec3(0.0, 0.0, 0.0); - o_18.Emission = tmpvar_22; - float tmpvar_23; - tmpvar_23 = 0.0; - o_18.Specular = tmpvar_23; - float tmpvar_24; - tmpvar_24 = 0.0; - o_18.Alpha = tmpvar_24; - float tmpvar_25; - tmpvar_25 = 0.0; - o_18.Gloss = tmpvar_25; - vec3 tmpvar_26; - tmpvar_26 = IN_15.normal; - o_18.Normal = tmpvar_26; - surf (surfIN_19, o_18); - vec3 tmpvar_27; - tmpvar_27 = IN_15.lightDir; - lightDir_17 = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = texture2D (_LightTexture0, IN_15._LightCoord); - vec4 tmpvar_29; - tmpvar_29 = LightingLambert (o_18, lightDir_17, (tmpvar_28.w * 1.0)); - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - c_16 = tmpvar_30; - float tmpvar_31; - tmpvar_31 = 0.0; - c_16.w = vec4(tmpvar_31).w; - return c_16; -} - -void main () -{ - v2f_surf xlt_IN_32; - vec4 xl_retval_33; - vec4 tmpvar_34; - tmpvar_34 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_32.pos = tmpvar_34; - float tmpvar_35; - tmpvar_35 = xlv_FOG.x; - xlt_IN_32.fog = tmpvar_35; - vec2 tmpvar_36; - tmpvar_36 = gl_TexCoord[0].xy; - vec2 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlt_IN_32.hip_pack0 = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = gl_TexCoord[1].xyz; - vec3 tmpvar_39; - tmpvar_39 = tmpvar_38; - xlt_IN_32.normal = tmpvar_39; - vec3 tmpvar_40; - tmpvar_40 = gl_TexCoord[2].xyz; - vec3 tmpvar_41; - tmpvar_41 = tmpvar_40; - xlt_IN_32.lightDir = tmpvar_41; - vec2 tmpvar_42; - tmpvar_42 = gl_TexCoord[3].xy; - vec2 tmpvar_43; - tmpvar_43 = tmpvar_42; - xlt_IN_32._LightCoord = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44 = frag_surf (xlt_IN_32); - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - xl_retval_33 = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46 = xl_retval_33.xyzw; - vec4 tmpvar_47; - tmpvar_47 = tmpvar_46; - gl_FragData[0] = tmpvar_47; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-out.txt index c2b5ef940..a70ba2a20 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-out.txt @@ -15,4 +15,11 @@ void main () } -// inputs: 1, stats: 9 alu 2 tex 0 flow +// stats: 9 alu 2 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 1 (total size: 0) +// #0: _LightColor0 (high float) 4x1 [-1] +// textures: 2 +// #0: _LightTexture0 (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-ir.txt deleted file mode 100644 index e1b74e817..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-ir.txt +++ /dev/null @@ -1,187 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_Decal; - vec2 uv_DecalBump; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 lightDir; - vec3 vlight; - vec4 _ShadowCoord; -}; -uniform sampler2D _Decal; -uniform sampler2D _DecalBump; -uniform vec4 _LightColor0; -uniform sampler2D _ShadowMapTexture; -varying vec4 xlv_FOG; -float unitySampleShadow ( - in vec4 shadowCoord_1 -) -{ - float shadow_2; - vec4 tmpvar_3; - tmpvar_3 = texture2DProj (_ShadowMapTexture, shadowCoord_1); - float tmpvar_4; - tmpvar_4 = tmpvar_3.x; - shadow_2 = tmpvar_4; - return shadow_2; -} - -vec4 UnpackNormal ( - in vec4 packednormal_5 -) -{ - vec4 normal_6; - vec2 tmpvar_7; - tmpvar_7 = ((packednormal_5.wy * 2.0) - 1.0); - normal_6.xy = tmpvar_7.xy.xy; - float tmpvar_8; - tmpvar_8 = sqrt (((1.0 - (normal_6.x * normal_6.x)) - (normal_6.y * normal_6.y))); - float tmpvar_9; - tmpvar_9 = tmpvar_8; - normal_6.z = vec3(tmpvar_9).z; - return normal_6; -} - -void surf ( - in Input IN_10, - inout SurfaceOutput o_11 -) -{ - vec4 tmpvar_12; - tmpvar_12 = texture2D (_Decal, IN_10.uv_Decal); - vec3 tmpvar_13; - tmpvar_13 = (tmpvar_12.xyz * 0.5); - o_11.Albedo = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = texture2D (_DecalBump, IN_10.uv_DecalBump); - vec4 tmpvar_15; - tmpvar_15 = UnpackNormal (tmpvar_14); - vec3 tmpvar_16; - tmpvar_16 = tmpvar_15.xyz; - vec3 tmpvar_17; - tmpvar_17 = tmpvar_16; - o_11.Normal = tmpvar_17; -} - -vec4 LightingLambert ( - in SurfaceOutput s_18, - in vec3 lightDir_19, - in float atten_20 -) -{ - vec4 c_21; - float diff_22; - float tmpvar_23; - tmpvar_23 = dot (s_18.Normal, lightDir_19); - float tmpvar_24; - tmpvar_24 = max (0.0, tmpvar_23); - float tmpvar_25; - tmpvar_25 = tmpvar_24; - diff_22 = tmpvar_25; - vec3 tmpvar_26; - tmpvar_26 = ((s_18.Albedo * _LightColor0.xyz) * ((diff_22 * atten_20) * 2.0)); - c_21.xyz = tmpvar_26.xyz.xyz; - float tmpvar_27; - tmpvar_27 = s_18.Alpha; - c_21.w = vec4(tmpvar_27).w; - return c_21; -} - -vec4 frag_surf ( - in v2f_surf IN_28 -) -{ - vec4 c_29; - float atten_30; - SurfaceOutput o_31; - Input surfIN_32; - vec2 tmpvar_33; - tmpvar_33 = IN_28.hip_pack0.xy; - surfIN_32.uv_Decal = tmpvar_33; - vec2 tmpvar_34; - tmpvar_34 = IN_28.hip_pack0.zw; - surfIN_32.uv_DecalBump = tmpvar_34; - vec3 tmpvar_35; - tmpvar_35 = vec3(0.0, 0.0, 0.0); - o_31.Albedo = tmpvar_35; - vec3 tmpvar_36; - tmpvar_36 = vec3(0.0, 0.0, 0.0); - o_31.Emission = tmpvar_36; - float tmpvar_37; - tmpvar_37 = 0.0; - o_31.Specular = tmpvar_37; - float tmpvar_38; - tmpvar_38 = 0.0; - o_31.Alpha = tmpvar_38; - float tmpvar_39; - tmpvar_39 = 0.0; - o_31.Gloss = tmpvar_39; - surf (surfIN_32, o_31); - float tmpvar_40; - tmpvar_40 = unitySampleShadow (IN_28._ShadowCoord); - float tmpvar_41; - tmpvar_41 = tmpvar_40; - atten_30 = tmpvar_41; - vec4 tmpvar_42; - tmpvar_42 = LightingLambert (o_31, IN_28.lightDir, atten_30); - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - c_29 = tmpvar_43; - vec3 tmpvar_44; - tmpvar_44 = (c_29.xyz + (o_31.Albedo * IN_28.vlight)); - c_29.xyz = tmpvar_44.xyz.xyz; - return c_29; -} - -void main () -{ - v2f_surf xlt_IN_45; - vec4 xl_retval_46; - vec4 tmpvar_47; - tmpvar_47 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_45.pos = tmpvar_47; - float tmpvar_48; - tmpvar_48 = xlv_FOG.x; - xlt_IN_45.fog = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = gl_TexCoord[0].xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_IN_45.hip_pack0 = tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = gl_TexCoord[1].xyz; - vec3 tmpvar_52; - tmpvar_52 = tmpvar_51; - xlt_IN_45.lightDir = tmpvar_52; - vec3 tmpvar_53; - tmpvar_53 = gl_TexCoord[2].xyz; - vec3 tmpvar_54; - tmpvar_54 = tmpvar_53; - xlt_IN_45.vlight = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = gl_TexCoord[3].xyzw; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - xlt_IN_45._ShadowCoord = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = frag_surf (xlt_IN_45); - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - xl_retval_46 = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59 = xl_retval_46.xyzw; - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - gl_FragData[0] = tmpvar_60; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-out.txt index 6d8c921b9..5601603c6 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-out.txt @@ -25,4 +25,12 @@ void main () } -// inputs: 1, stats: 17 alu 3 tex 0 flow +// stats: 17 alu 3 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 1 (total size: 0) +// #0: _LightColor0 (high float) 4x1 [-1] +// textures: 3 +// #0: _Decal (high 2d) 0x0 [-1] +// #1: _DecalBump (high 2d) 0x0 [-1] +// #2: _ShadowMapTexture (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-ir.txt deleted file mode 100644 index bcf426eb6..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-ir.txt +++ /dev/null @@ -1,179 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_Decal; - vec2 uv_DecalBump; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 lightDir; - vec3 _LightCoord; -}; -uniform sampler2D _Decal; -uniform sampler2D _DecalBump; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -void surf ( - in Input IN_6, - inout SurfaceOutput o_7 -) -{ - vec4 tmpvar_8; - tmpvar_8 = texture2D (_Decal, IN_6.uv_Decal); - vec3 tmpvar_9; - tmpvar_9 = (tmpvar_8.xyz * 0.5); - o_7.Albedo = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10 = texture2D (_DecalBump, IN_6.uv_DecalBump); - vec4 tmpvar_11; - tmpvar_11 = UnpackNormal (tmpvar_10); - vec3 tmpvar_12; - tmpvar_12 = tmpvar_11.xyz; - vec3 tmpvar_13; - tmpvar_13 = tmpvar_12; - o_7.Normal = tmpvar_13; -} - -vec4 LightingLambert ( - in SurfaceOutput s_14, - in vec3 lightDir_15, - in float atten_16 -) -{ - vec4 c_17; - float diff_18; - float tmpvar_19; - tmpvar_19 = dot (s_14.Normal, lightDir_15); - float tmpvar_20; - tmpvar_20 = max (0.0, tmpvar_19); - float tmpvar_21; - tmpvar_21 = tmpvar_20; - diff_18 = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = ((s_14.Albedo * _LightColor0.xyz) * ((diff_18 * atten_16) * 2.0)); - c_17.xyz = tmpvar_22.xyz.xyz; - float tmpvar_23; - tmpvar_23 = s_14.Alpha; - c_17.w = vec4(tmpvar_23).w; - return c_17; -} - -vec4 frag_surf ( - in v2f_surf IN_24 -) -{ - vec4 c_25; - vec3 lightDir_26; - SurfaceOutput o_27; - Input surfIN_28; - vec2 tmpvar_29; - tmpvar_29 = IN_24.hip_pack0.xy; - surfIN_28.uv_Decal = tmpvar_29; - vec2 tmpvar_30; - tmpvar_30 = IN_24.hip_pack0.zw; - surfIN_28.uv_DecalBump = tmpvar_30; - vec3 tmpvar_31; - tmpvar_31 = vec3(0.0, 0.0, 0.0); - o_27.Albedo = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = vec3(0.0, 0.0, 0.0); - o_27.Emission = tmpvar_32; - float tmpvar_33; - tmpvar_33 = 0.0; - o_27.Specular = tmpvar_33; - float tmpvar_34; - tmpvar_34 = 0.0; - o_27.Alpha = tmpvar_34; - float tmpvar_35; - tmpvar_35 = 0.0; - o_27.Gloss = tmpvar_35; - surf (surfIN_28, o_27); - vec3 tmpvar_36; - tmpvar_36 = IN_24.lightDir; - lightDir_26 = tmpvar_36; - vec3 tmpvar_37; - tmpvar_37 = normalize (lightDir_26); - vec3 tmpvar_38; - tmpvar_38 = tmpvar_37; - lightDir_26 = tmpvar_38; - float tmpvar_39; - tmpvar_39 = dot (IN_24._LightCoord, IN_24._LightCoord); - vec2 tmpvar_40; - tmpvar_40 = vec2(tmpvar_39); - vec2 tmpvar_41; - tmpvar_41 = tmpvar_40.xy; - vec4 tmpvar_42; - tmpvar_42 = texture2D (_LightTexture0, tmpvar_41); - vec4 tmpvar_43; - tmpvar_43 = LightingLambert (o_27, lightDir_26, tmpvar_42.w); - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - c_25 = tmpvar_44; - float tmpvar_45; - tmpvar_45 = 0.0; - c_25.w = vec4(tmpvar_45).w; - return c_25; -} - -void main () -{ - v2f_surf xlt_IN_46; - vec4 xl_retval_47; - vec4 tmpvar_48; - tmpvar_48 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_46.pos = tmpvar_48; - float tmpvar_49; - tmpvar_49 = xlv_FOG.x; - xlt_IN_46.fog = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50 = gl_TexCoord[0].xyzw; - vec4 tmpvar_51; - tmpvar_51 = tmpvar_50; - xlt_IN_46.hip_pack0 = tmpvar_51; - vec3 tmpvar_52; - tmpvar_52 = gl_TexCoord[1].xyz; - vec3 tmpvar_53; - tmpvar_53 = tmpvar_52; - xlt_IN_46.lightDir = tmpvar_53; - vec3 tmpvar_54; - tmpvar_54 = gl_TexCoord[2].xyz; - vec3 tmpvar_55; - tmpvar_55 = tmpvar_54; - xlt_IN_46._LightCoord = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = frag_surf (xlt_IN_46); - vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - xl_retval_47 = tmpvar_57; - vec4 tmpvar_58; - tmpvar_58 = xl_retval_47.xyzw; - vec4 tmpvar_59; - tmpvar_59 = tmpvar_58; - gl_FragData[0] = tmpvar_59; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-out.txt index 190c552fd..0eaef42e5 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-out.txt @@ -27,4 +27,12 @@ void main () } -// inputs: 1, stats: 18 alu 3 tex 0 flow +// stats: 18 alu 3 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 1 (total size: 0) +// #0: _LightColor0 (high float) 4x1 [-1] +// textures: 3 +// #0: _Decal (high 2d) 0x0 [-1] +// #1: _DecalBump (high 2d) 0x0 [-1] +// #2: _LightTexture0 (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-ir.txt deleted file mode 100644 index d26884e12..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-ir.txt +++ /dev/null @@ -1,149 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec2 _LightCoord; -}; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 tmpvar_3; - tmpvar_3 = texture2D (_MainTex, IN_1.uv_MainTex); - vec3 tmpvar_4; - tmpvar_4 = tmpvar_3.xyz; - o_2.Albedo = tmpvar_4; -} - -vec4 LightingWrapLambert ( - in SurfaceOutput s_5, - in vec3 lightDir_6, - in float atten_7 -) -{ - vec4 c_8; - float diff_9; - float NdotL_10; - float tmpvar_11; - tmpvar_11 = dot (s_5.Normal, lightDir_6); - float tmpvar_12; - tmpvar_12 = tmpvar_11; - NdotL_10 = tmpvar_12; - float tmpvar_13; - tmpvar_13 = ((NdotL_10 * 0.5) + 0.5); - diff_9 = tmpvar_13; - vec3 tmpvar_14; - tmpvar_14 = ((s_5.Albedo * _LightColor0.xyz) * ((diff_9 * atten_7) * 2.0)); - c_8.xyz = tmpvar_14.xyz.xyz; - float tmpvar_15; - tmpvar_15 = s_5.Alpha; - c_8.w = vec4(tmpvar_15).w; - return c_8; -} - -vec4 frag_surf ( - in v2f_surf IN_16 -) -{ - vec4 c_17; - vec3 lightDir_18; - SurfaceOutput o_19; - Input surfIN_20; - vec2 tmpvar_21; - tmpvar_21 = IN_16.hip_pack0.xy; - surfIN_20.uv_MainTex = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = vec3(0.0, 0.0, 0.0); - o_19.Albedo = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = vec3(0.0, 0.0, 0.0); - o_19.Emission = tmpvar_23; - float tmpvar_24; - tmpvar_24 = 0.0; - o_19.Specular = tmpvar_24; - float tmpvar_25; - tmpvar_25 = 0.0; - o_19.Alpha = tmpvar_25; - float tmpvar_26; - tmpvar_26 = 0.0; - o_19.Gloss = tmpvar_26; - vec3 tmpvar_27; - tmpvar_27 = IN_16.normal; - o_19.Normal = tmpvar_27; - surf (surfIN_20, o_19); - vec3 tmpvar_28; - tmpvar_28 = IN_16.lightDir; - lightDir_18 = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = texture2D (_LightTexture0, IN_16._LightCoord); - vec4 tmpvar_30; - tmpvar_30 = LightingWrapLambert (o_19, lightDir_18, (tmpvar_29.w * 1.0)); - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - c_17 = tmpvar_31; - float tmpvar_32; - tmpvar_32 = 0.0; - c_17.w = vec4(tmpvar_32).w; - return c_17; -} - -void main () -{ - v2f_surf xlt_IN_33; - vec4 xl_retval_34; - vec4 tmpvar_35; - tmpvar_35 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_33.pos = tmpvar_35; - float tmpvar_36; - tmpvar_36 = xlv_FOG.x; - xlt_IN_33.fog = tmpvar_36; - vec2 tmpvar_37; - tmpvar_37 = gl_TexCoord[0].xy; - vec2 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlt_IN_33.hip_pack0 = tmpvar_38; - vec3 tmpvar_39; - tmpvar_39 = gl_TexCoord[1].xyz; - vec3 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_IN_33.normal = tmpvar_40; - vec3 tmpvar_41; - tmpvar_41 = gl_TexCoord[2].xyz; - vec3 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_IN_33.lightDir = tmpvar_42; - vec2 tmpvar_43; - tmpvar_43 = gl_TexCoord[3].xy; - vec2 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_IN_33._LightCoord = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = frag_surf (xlt_IN_33); - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - xl_retval_34 = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = xl_retval_34.xyzw; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - gl_FragData[0] = tmpvar_48; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-out.txt index 8cf3c87fb..811a428cb 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-out.txt @@ -15,4 +15,11 @@ void main () } -// inputs: 1, stats: 9 alu 2 tex 0 flow +// stats: 9 alu 2 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 1 (total size: 0) +// #0: _LightColor0 (high float) 4x1 [-1] +// textures: 2 +// #0: _LightTexture0 (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-ir.txt deleted file mode 100644 index 26f21d2d8..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-ir.txt +++ /dev/null @@ -1,261 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec3 viewDir; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; -}; -uniform vec4 _LightColor0; -uniform sampler2D _MainTex; -uniform vec4 _RimColor; -uniform float _RimPower; -varying vec4 xlv_FOG; -float xll_saturate ( - in float x_1 -) -{ - float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -vec2 xll_saturate ( - in vec2 x_3 -) -{ - vec2 tmpvar_4; - tmpvar_4 = clamp (x_3, 0.0, 1.0); - return tmpvar_4; -} - -vec3 xll_saturate ( - in vec3 x_5 -) -{ - vec3 tmpvar_6; - tmpvar_6 = clamp (x_5, 0.0, 1.0); - return tmpvar_6; -} - -vec4 xll_saturate ( - in vec4 x_7 -) -{ - vec4 tmpvar_8; - tmpvar_8 = clamp (x_7, 0.0, 1.0); - return tmpvar_8; -} - -mat2 xll_saturate ( - in mat2 m_9 -) -{ - vec2 tmpvar_10; - tmpvar_10 = clamp (m_9[0], 0.0, 1.0); - vec2 tmpvar_11; - tmpvar_11 = clamp (m_9[1], 0.0, 1.0); - mat2 tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_10; - tmpvar_12[0] = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_12[1] = tmpvar_14; - return tmpvar_12; -} - -mat3 xll_saturate ( - in mat3 m_15 -) -{ - vec3 tmpvar_16; - tmpvar_16 = clamp (m_15[0], 0.0, 1.0); - vec3 tmpvar_17; - tmpvar_17 = clamp (m_15[1], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_15[2], 0.0, 1.0); - mat3 tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_16; - tmpvar_19[0] = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_19[1] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_19[2] = tmpvar_22; - return tmpvar_19; -} - -mat4 xll_saturate ( - in mat4 m_23 -) -{ - vec4 tmpvar_24; - tmpvar_24 = clamp (m_23[0], 0.0, 1.0); - vec4 tmpvar_25; - tmpvar_25 = clamp (m_23[1], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_23[2], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_23[3], 0.0, 1.0); - mat4 tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_24; - tmpvar_28[0] = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_28[1] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_28[2] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_28[3] = tmpvar_32; - return tmpvar_28; -} - -void surf ( - in Input IN_33, - inout SurfaceOutput o_34 -) -{ - float rim_35; - vec4 tmpvar_36; - tmpvar_36 = texture2D (_MainTex, IN_33.uv_MainTex); - vec3 tmpvar_37; - tmpvar_37 = tmpvar_36.xyz; - o_34.Albedo = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = normalize (IN_33.viewDir); - float tmpvar_39; - tmpvar_39 = dot (tmpvar_38, o_34.Normal); - float tmpvar_40; - tmpvar_40 = xll_saturate (tmpvar_39); - float tmpvar_41; - tmpvar_41 = (1.0 - tmpvar_40); - rim_35 = tmpvar_41; - float tmpvar_42; - tmpvar_42 = pow (rim_35, _RimPower); - vec3 tmpvar_43; - tmpvar_43 = (_RimColor.xyz * tmpvar_42); - o_34.Emission = tmpvar_43; -} - -vec4 LightingLambert ( - in SurfaceOutput s_44, - in vec3 lightDir_45, - in float atten_46 -) -{ - vec4 c_47; - float diff_48; - float tmpvar_49; - tmpvar_49 = dot (s_44.Normal, lightDir_45); - float tmpvar_50; - tmpvar_50 = max (0.0, tmpvar_49); - float tmpvar_51; - tmpvar_51 = tmpvar_50; - diff_48 = tmpvar_51; - vec3 tmpvar_52; - tmpvar_52 = ((s_44.Albedo * _LightColor0.xyz) * ((diff_48 * atten_46) * 2.0)); - c_47.xyz = tmpvar_52.xyz.xyz; - float tmpvar_53; - tmpvar_53 = s_44.Alpha; - c_47.w = vec4(tmpvar_53).w; - return c_47; -} - -vec4 frag_surf ( - in v2f_surf IN_54 -) -{ - vec4 c_55; - vec3 lightDir_56; - SurfaceOutput o_57; - Input surfIN_58; - vec2 tmpvar_59; - tmpvar_59 = IN_54.hip_pack0.xy; - surfIN_58.uv_MainTex = tmpvar_59; - vec3 tmpvar_60; - tmpvar_60 = vec3(0.0, 0.0, 0.0); - o_57.Albedo = tmpvar_60; - vec3 tmpvar_61; - tmpvar_61 = vec3(0.0, 0.0, 0.0); - o_57.Emission = tmpvar_61; - float tmpvar_62; - tmpvar_62 = 0.0; - o_57.Specular = tmpvar_62; - float tmpvar_63; - tmpvar_63 = 0.0; - o_57.Alpha = tmpvar_63; - float tmpvar_64; - tmpvar_64 = 0.0; - o_57.Gloss = tmpvar_64; - vec3 tmpvar_65; - tmpvar_65 = IN_54.normal; - o_57.Normal = tmpvar_65; - surf (surfIN_58, o_57); - vec3 tmpvar_66; - tmpvar_66 = IN_54.lightDir; - lightDir_56 = tmpvar_66; - vec4 tmpvar_67; - tmpvar_67 = LightingLambert (o_57, lightDir_56, 1.0); - vec4 tmpvar_68; - tmpvar_68 = tmpvar_67; - c_55 = tmpvar_68; - float tmpvar_69; - tmpvar_69 = 0.0; - c_55.w = vec4(tmpvar_69).w; - return c_55; -} - -void main () -{ - v2f_surf xlt_IN_70; - vec4 xl_retval_71; - vec4 tmpvar_72; - tmpvar_72 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_70.pos = tmpvar_72; - float tmpvar_73; - tmpvar_73 = xlv_FOG.x; - xlt_IN_70.fog = tmpvar_73; - vec2 tmpvar_74; - tmpvar_74 = gl_TexCoord[0].xy; - vec2 tmpvar_75; - tmpvar_75 = tmpvar_74; - xlt_IN_70.hip_pack0 = tmpvar_75; - vec3 tmpvar_76; - tmpvar_76 = gl_TexCoord[1].xyz; - vec3 tmpvar_77; - tmpvar_77 = tmpvar_76; - xlt_IN_70.normal = tmpvar_77; - vec3 tmpvar_78; - tmpvar_78 = gl_TexCoord[2].xyz; - vec3 tmpvar_79; - tmpvar_79 = tmpvar_78; - xlt_IN_70.lightDir = tmpvar_79; - vec4 tmpvar_80; - tmpvar_80 = frag_surf (xlt_IN_70); - vec4 tmpvar_81; - tmpvar_81 = tmpvar_80; - xl_retval_71 = tmpvar_81; - vec4 tmpvar_82; - tmpvar_82 = xl_retval_71.xyzw; - vec4 tmpvar_83; - tmpvar_83 = tmpvar_82; - gl_FragData[0] = tmpvar_83; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-out.txt index e7d9100b8..a0016305d 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-out.txt @@ -14,4 +14,10 @@ void main () } -// inputs: 1, stats: 7 alu 1 tex 0 flow +// stats: 7 alu 1 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 1 (total size: 0) +// #0: _LightColor0 (high float) 4x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-ir.txt deleted file mode 100644 index 6c86c7ae1..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-ir.txt +++ /dev/null @@ -1,272 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec3 viewDir; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 viewDir; - vec4 hip_screen; - vec3 normal; -}; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform vec4 _RimColor; -uniform float _RimPower; -uniform vec4 unity_Ambient; -varying vec4 xlv_FOG; -float xll_saturate ( - in float x_1 -) -{ - float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -vec2 xll_saturate ( - in vec2 x_3 -) -{ - vec2 tmpvar_4; - tmpvar_4 = clamp (x_3, 0.0, 1.0); - return tmpvar_4; -} - -vec3 xll_saturate ( - in vec3 x_5 -) -{ - vec3 tmpvar_6; - tmpvar_6 = clamp (x_5, 0.0, 1.0); - return tmpvar_6; -} - -vec4 xll_saturate ( - in vec4 x_7 -) -{ - vec4 tmpvar_8; - tmpvar_8 = clamp (x_7, 0.0, 1.0); - return tmpvar_8; -} - -mat2 xll_saturate ( - in mat2 m_9 -) -{ - vec2 tmpvar_10; - tmpvar_10 = clamp (m_9[0], 0.0, 1.0); - vec2 tmpvar_11; - tmpvar_11 = clamp (m_9[1], 0.0, 1.0); - mat2 tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_10; - tmpvar_12[0] = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_12[1] = tmpvar_14; - return tmpvar_12; -} - -mat3 xll_saturate ( - in mat3 m_15 -) -{ - vec3 tmpvar_16; - tmpvar_16 = clamp (m_15[0], 0.0, 1.0); - vec3 tmpvar_17; - tmpvar_17 = clamp (m_15[1], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_15[2], 0.0, 1.0); - mat3 tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_16; - tmpvar_19[0] = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_19[1] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_19[2] = tmpvar_22; - return tmpvar_19; -} - -mat4 xll_saturate ( - in mat4 m_23 -) -{ - vec4 tmpvar_24; - tmpvar_24 = clamp (m_23[0], 0.0, 1.0); - vec4 tmpvar_25; - tmpvar_25 = clamp (m_23[1], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_23[2], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_23[3], 0.0, 1.0); - mat4 tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_24; - tmpvar_28[0] = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_28[1] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_28[2] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_28[3] = tmpvar_32; - return tmpvar_28; -} - -void surf ( - in Input IN_33, - inout SurfaceOutput o_34 -) -{ - float rim_35; - vec4 tmpvar_36; - tmpvar_36 = texture2D (_MainTex, IN_33.uv_MainTex); - vec3 tmpvar_37; - tmpvar_37 = tmpvar_36.xyz; - o_34.Albedo = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = normalize (IN_33.viewDir); - float tmpvar_39; - tmpvar_39 = dot (tmpvar_38, o_34.Normal); - float tmpvar_40; - tmpvar_40 = xll_saturate (tmpvar_39); - float tmpvar_41; - tmpvar_41 = (1.0 - tmpvar_40); - rim_35 = tmpvar_41; - float tmpvar_42; - tmpvar_42 = pow (rim_35, _RimPower); - vec3 tmpvar_43; - tmpvar_43 = (_RimColor.xyz * tmpvar_42); - o_34.Emission = tmpvar_43; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_44, - in vec4 light_45 -) -{ - vec4 c_46; - vec3 tmpvar_47; - tmpvar_47 = (s_44.Albedo * light_45.xyz); - c_46.xyz = tmpvar_47.xyz.xyz; - float tmpvar_48; - tmpvar_48 = s_44.Alpha; - c_46.w = vec4(tmpvar_48).w; - return c_46; -} - -vec4 frag_surf ( - in v2f_surf IN_49 -) -{ - vec4 col_50; - vec4 light_51; - SurfaceOutput o_52; - Input surfIN_53; - vec2 tmpvar_54; - tmpvar_54 = IN_49.hip_pack0.xy; - surfIN_53.uv_MainTex = tmpvar_54; - vec3 tmpvar_55; - tmpvar_55 = IN_49.viewDir; - surfIN_53.viewDir = tmpvar_55; - vec3 tmpvar_56; - tmpvar_56 = vec3(0.0, 0.0, 0.0); - o_52.Albedo = tmpvar_56; - vec3 tmpvar_57; - tmpvar_57 = vec3(0.0, 0.0, 0.0); - o_52.Emission = tmpvar_57; - float tmpvar_58; - tmpvar_58 = 0.0; - o_52.Specular = tmpvar_58; - float tmpvar_59; - tmpvar_59 = 0.0; - o_52.Alpha = tmpvar_59; - float tmpvar_60; - tmpvar_60 = 0.0; - o_52.Gloss = tmpvar_60; - vec3 tmpvar_61; - tmpvar_61 = IN_49.normal; - o_52.Normal = tmpvar_61; - surf (surfIN_53, o_52); - vec4 tmpvar_62; - tmpvar_62 = texture2DProj (_LightBuffer, IN_49.hip_screen); - vec4 tmpvar_63; - tmpvar_63 = tmpvar_62; - light_51 = tmpvar_63; - vec4 tmpvar_64; - tmpvar_64 = log2 (light_51); - vec4 tmpvar_65; - tmpvar_65 = -(tmpvar_64); - light_51 = tmpvar_65; - vec3 tmpvar_66; - tmpvar_66 = (light_51.xyz + unity_Ambient.xyz); - light_51.xyz = tmpvar_66.xyz.xyz; - vec4 tmpvar_67; - tmpvar_67 = LightingLambert_PrePass (o_52, light_51); - vec4 tmpvar_68; - tmpvar_68 = tmpvar_67; - col_50 = tmpvar_68; - vec3 tmpvar_69; - tmpvar_69 = (col_50.xyz + o_52.Emission); - col_50.xyz = tmpvar_69.xyz.xyz; - return col_50; -} - -void main () -{ - v2f_surf xlt_IN_70; - vec4 xl_retval_71; - vec4 tmpvar_72; - tmpvar_72 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_70.pos = tmpvar_72; - float tmpvar_73; - tmpvar_73 = xlv_FOG.x; - xlt_IN_70.fog = tmpvar_73; - vec2 tmpvar_74; - tmpvar_74 = gl_TexCoord[0].xy; - vec2 tmpvar_75; - tmpvar_75 = tmpvar_74; - xlt_IN_70.hip_pack0 = tmpvar_75; - vec3 tmpvar_76; - tmpvar_76 = gl_TexCoord[1].xyz; - vec3 tmpvar_77; - tmpvar_77 = tmpvar_76; - xlt_IN_70.viewDir = tmpvar_77; - vec4 tmpvar_78; - tmpvar_78 = gl_TexCoord[2].xyzw; - vec4 tmpvar_79; - tmpvar_79 = tmpvar_78; - xlt_IN_70.hip_screen = tmpvar_79; - vec3 tmpvar_80; - tmpvar_80 = gl_TexCoord[3].xyz; - vec3 tmpvar_81; - tmpvar_81 = tmpvar_80; - xlt_IN_70.normal = tmpvar_81; - vec4 tmpvar_82; - tmpvar_82 = frag_surf (xlt_IN_70); - vec4 tmpvar_83; - tmpvar_83 = tmpvar_82; - xl_retval_71 = tmpvar_83; - vec4 tmpvar_84; - tmpvar_84 = xl_retval_71.xyzw; - vec4 tmpvar_85; - tmpvar_85 = tmpvar_84; - gl_FragData[0] = tmpvar_85; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-out.txt index 344715111..6ba22d2b0 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-out.txt @@ -7,19 +7,26 @@ void main () { vec4 col_1; vec4 light_2; - vec4 tmpvar_3; - tmpvar_3 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2]))); - light_2.w = tmpvar_3.w; - light_2.xyz = (tmpvar_3.xyz + unity_Ambient.xyz); - vec4 c_4; - c_4.xyz = (texture2D (_MainTex, gl_TexCoord[0].xy).xyz * light_2.xyz); - c_4.w = 0.0; - col_1.w = c_4.w; - col_1.xyz = (c_4.xyz + (_RimColor.xyz * pow ( + light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2]))); + light_2.xyz = (light_2.xyz + unity_Ambient.xyz); + vec4 c_3; + c_3.xyz = (texture2D (_MainTex, gl_TexCoord[0].xy).xyz * light_2.xyz); + c_3.w = 0.0; + col_1.w = c_3.w; + col_1.xyz = (c_3.xyz + (_RimColor.xyz * pow ( (1.0 - clamp (dot (normalize(gl_TexCoord[1].xyz), gl_TexCoord[3].xyz), 0.0, 1.0)) , _RimPower))); gl_FragData[0] = col_1; } -// inputs: 1, stats: 12 alu 2 tex 0 flow +// stats: 12 alu 2 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 3 (total size: 0) +// #0: _RimColor (high float) 4x1 [-1] +// #1: _RimPower (high float) 1x1 [-1] +// #2: unity_Ambient (high float) 4x1 [-1] +// textures: 2 +// #0: _LightBuffer (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-ir.txt deleted file mode 100644 index 59140bc5b..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-ir.txt +++ /dev/null @@ -1,312 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec3 viewDir; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 viewDir; - vec4 hip_screen; - vec3 normal; - vec3 hip_lmapFade; -}; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform vec4 _RimColor; -uniform float _RimPower; -uniform sampler2D unity_Lightmap; -uniform sampler2D unity_LightmapInd; -varying vec4 xlv_FOG; -float xll_saturate ( - in float x_1 -) -{ - float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -vec2 xll_saturate ( - in vec2 x_3 -) -{ - vec2 tmpvar_4; - tmpvar_4 = clamp (x_3, 0.0, 1.0); - return tmpvar_4; -} - -vec3 xll_saturate ( - in vec3 x_5 -) -{ - vec3 tmpvar_6; - tmpvar_6 = clamp (x_5, 0.0, 1.0); - return tmpvar_6; -} - -vec4 xll_saturate ( - in vec4 x_7 -) -{ - vec4 tmpvar_8; - tmpvar_8 = clamp (x_7, 0.0, 1.0); - return tmpvar_8; -} - -mat2 xll_saturate ( - in mat2 m_9 -) -{ - vec2 tmpvar_10; - tmpvar_10 = clamp (m_9[0], 0.0, 1.0); - vec2 tmpvar_11; - tmpvar_11 = clamp (m_9[1], 0.0, 1.0); - mat2 tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_10; - tmpvar_12[0] = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_12[1] = tmpvar_14; - return tmpvar_12; -} - -mat3 xll_saturate ( - in mat3 m_15 -) -{ - vec3 tmpvar_16; - tmpvar_16 = clamp (m_15[0], 0.0, 1.0); - vec3 tmpvar_17; - tmpvar_17 = clamp (m_15[1], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_15[2], 0.0, 1.0); - mat3 tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_16; - tmpvar_19[0] = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_19[1] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_19[2] = tmpvar_22; - return tmpvar_19; -} - -mat4 xll_saturate ( - in mat4 m_23 -) -{ - vec4 tmpvar_24; - tmpvar_24 = clamp (m_23[0], 0.0, 1.0); - vec4 tmpvar_25; - tmpvar_25 = clamp (m_23[1], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_23[2], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_23[3], 0.0, 1.0); - mat4 tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_24; - tmpvar_28[0] = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_28[1] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_28[2] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_28[3] = tmpvar_32; - return tmpvar_28; -} - -void surf ( - in Input IN_33, - inout SurfaceOutput o_34 -) -{ - float rim_35; - vec4 tmpvar_36; - tmpvar_36 = texture2D (_MainTex, IN_33.uv_MainTex); - vec3 tmpvar_37; - tmpvar_37 = tmpvar_36.xyz; - o_34.Albedo = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = normalize (IN_33.viewDir); - float tmpvar_39; - tmpvar_39 = dot (tmpvar_38, o_34.Normal); - float tmpvar_40; - tmpvar_40 = xll_saturate (tmpvar_39); - float tmpvar_41; - tmpvar_41 = (1.0 - tmpvar_40); - rim_35 = tmpvar_41; - float tmpvar_42; - tmpvar_42 = pow (rim_35, _RimPower); - vec3 tmpvar_43; - tmpvar_43 = (_RimColor.xyz * tmpvar_42); - o_34.Emission = tmpvar_43; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_44, - in vec4 light_45 -) -{ - vec4 c_46; - vec3 tmpvar_47; - tmpvar_47 = (s_44.Albedo * light_45.xyz); - c_46.xyz = tmpvar_47.xyz.xyz; - float tmpvar_48; - tmpvar_48 = s_44.Alpha; - c_46.w = vec4(tmpvar_48).w; - return c_46; -} - -vec3 DecodeLightmap ( - in vec4 color_49 -) -{ - return (2.0 * color_49.xyz); -} - -vec4 frag_surf ( - in v2f_surf IN_50 -) -{ - vec4 col_51; - vec3 lm_52; - vec3 lmIndirect_53; - vec3 lmFull_54; - vec4 light_55; - SurfaceOutput o_56; - Input surfIN_57; - vec2 tmpvar_58; - tmpvar_58 = IN_50.hip_pack0.xy; - surfIN_57.uv_MainTex = tmpvar_58; - vec3 tmpvar_59; - tmpvar_59 = IN_50.viewDir; - surfIN_57.viewDir = tmpvar_59; - vec3 tmpvar_60; - tmpvar_60 = vec3(0.0, 0.0, 0.0); - o_56.Albedo = tmpvar_60; - vec3 tmpvar_61; - tmpvar_61 = vec3(0.0, 0.0, 0.0); - o_56.Emission = tmpvar_61; - float tmpvar_62; - tmpvar_62 = 0.0; - o_56.Specular = tmpvar_62; - float tmpvar_63; - tmpvar_63 = 0.0; - o_56.Alpha = tmpvar_63; - float tmpvar_64; - tmpvar_64 = 0.0; - o_56.Gloss = tmpvar_64; - vec3 tmpvar_65; - tmpvar_65 = IN_50.normal; - o_56.Normal = tmpvar_65; - surf (surfIN_57, o_56); - vec4 tmpvar_66; - tmpvar_66 = texture2DProj (_LightBuffer, IN_50.hip_screen); - vec4 tmpvar_67; - tmpvar_67 = tmpvar_66; - light_55 = tmpvar_67; - vec4 tmpvar_68; - tmpvar_68 = log2 (light_55); - vec4 tmpvar_69; - tmpvar_69 = -(tmpvar_68); - light_55 = tmpvar_69; - vec4 tmpvar_70; - tmpvar_70 = texture2D (unity_Lightmap, IN_50.hip_lmapFade.xy); - vec3 tmpvar_71; - tmpvar_71 = DecodeLightmap (tmpvar_70); - vec3 tmpvar_72; - tmpvar_72 = tmpvar_71; - lmFull_54 = tmpvar_72; - vec4 tmpvar_73; - tmpvar_73 = texture2D (unity_LightmapInd, IN_50.hip_lmapFade.xy); - vec3 tmpvar_74; - tmpvar_74 = DecodeLightmap (tmpvar_73); - vec3 tmpvar_75; - tmpvar_75 = tmpvar_74; - lmIndirect_53 = tmpvar_75; - float tmpvar_76; - tmpvar_76 = xll_saturate (IN_50.hip_lmapFade.z); - vec3 tmpvar_77; - tmpvar_77 = vec3(tmpvar_76); - vec3 tmpvar_78; - tmpvar_78 = mix (lmIndirect_53, lmFull_54, tmpvar_77); - vec3 tmpvar_79; - tmpvar_79 = tmpvar_78; - lm_52 = tmpvar_79; - vec3 tmpvar_80; - tmpvar_80 = (light_55.xyz + lm_52); - light_55.xyz = tmpvar_80.xyz.xyz; - vec4 tmpvar_81; - tmpvar_81 = LightingLambert_PrePass (o_56, light_55); - vec4 tmpvar_82; - tmpvar_82 = tmpvar_81; - col_51 = tmpvar_82; - vec3 tmpvar_83; - tmpvar_83 = (col_51.xyz + o_56.Emission); - col_51.xyz = tmpvar_83.xyz.xyz; - return col_51; -} - -void main () -{ - v2f_surf xlt_IN_84; - vec4 xl_retval_85; - vec4 tmpvar_86; - tmpvar_86 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_84.pos = tmpvar_86; - float tmpvar_87; - tmpvar_87 = xlv_FOG.x; - xlt_IN_84.fog = tmpvar_87; - vec2 tmpvar_88; - tmpvar_88 = gl_TexCoord[0].xy; - vec2 tmpvar_89; - tmpvar_89 = tmpvar_88; - xlt_IN_84.hip_pack0 = tmpvar_89; - vec3 tmpvar_90; - tmpvar_90 = gl_TexCoord[1].xyz; - vec3 tmpvar_91; - tmpvar_91 = tmpvar_90; - xlt_IN_84.viewDir = tmpvar_91; - vec4 tmpvar_92; - tmpvar_92 = gl_TexCoord[2].xyzw; - vec4 tmpvar_93; - tmpvar_93 = tmpvar_92; - xlt_IN_84.hip_screen = tmpvar_93; - vec3 tmpvar_94; - tmpvar_94 = gl_TexCoord[3].xyz; - vec3 tmpvar_95; - tmpvar_95 = tmpvar_94; - xlt_IN_84.normal = tmpvar_95; - vec3 tmpvar_96; - tmpvar_96 = gl_TexCoord[4].xyz; - vec3 tmpvar_97; - tmpvar_97 = tmpvar_96; - xlt_IN_84.hip_lmapFade = tmpvar_97; - vec4 tmpvar_98; - tmpvar_98 = frag_surf (xlt_IN_84); - vec4 tmpvar_99; - tmpvar_99 = tmpvar_98; - xl_retval_85 = tmpvar_99; - vec4 tmpvar_100; - tmpvar_100 = xl_retval_85.xyzw; - vec4 tmpvar_101; - tmpvar_101 = tmpvar_100; - gl_FragData[0] = tmpvar_101; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-out.txt index e3fe8ce78..1a05758ad 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-out.txt @@ -10,19 +10,27 @@ void main () tmpvar_1 = gl_TexCoord[4].xyz; vec4 col_2; vec4 light_3; - vec4 tmpvar_4; - tmpvar_4 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2]))); - light_3.w = tmpvar_4.w; - light_3.xyz = (tmpvar_4.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_1.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_1.xy).xyz), vec3(clamp (tmpvar_1.z, 0.0, 1.0)))); - vec4 c_5; - c_5.xyz = (texture2D (_MainTex, gl_TexCoord[0].xy).xyz * light_3.xyz); - c_5.w = 0.0; - col_2.w = c_5.w; - col_2.xyz = (c_5.xyz + (_RimColor.xyz * pow ( + light_3 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2]))); + light_3.xyz = (light_3.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_1.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_1.xy).xyz), vec3(clamp (tmpvar_1.z, 0.0, 1.0)))); + vec4 c_4; + c_4.xyz = (texture2D (_MainTex, gl_TexCoord[0].xy).xyz * light_3.xyz); + c_4.w = 0.0; + col_2.w = c_4.w; + col_2.xyz = (c_4.xyz + (_RimColor.xyz * pow ( (1.0 - clamp (dot (normalize(gl_TexCoord[1].xyz), gl_TexCoord[3].xyz), 0.0, 1.0)) , _RimPower))); gl_FragData[0] = col_2; } -// inputs: 1, stats: 16 alu 4 tex 0 flow +// stats: 16 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [5] loc 4 +// uniforms: 2 (total size: 0) +// #0: _RimColor (high float) 4x1 [-1] +// #1: _RimPower (high float) 1x1 [-1] +// textures: 4 +// #0: _LightBuffer (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] +// #2: unity_Lightmap (high 2d) 0x0 [-1] +// #3: unity_LightmapInd (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-ir.txt deleted file mode 100644 index 10f07d48b..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-ir.txt +++ /dev/null @@ -1,321 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_BumpMap; - vec3 viewDir; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 lightDir; - vec4 _LightCoord; -}; -uniform sampler2D _BumpMap; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -uniform vec4 _RimColor; -uniform float _RimPower; -varying vec4 xlv_FOG; -float xll_saturate ( - in float x_1 -) -{ - float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -vec2 xll_saturate ( - in vec2 x_3 -) -{ - vec2 tmpvar_4; - tmpvar_4 = clamp (x_3, 0.0, 1.0); - return tmpvar_4; -} - -vec3 xll_saturate ( - in vec3 x_5 -) -{ - vec3 tmpvar_6; - tmpvar_6 = clamp (x_5, 0.0, 1.0); - return tmpvar_6; -} - -vec4 xll_saturate ( - in vec4 x_7 -) -{ - vec4 tmpvar_8; - tmpvar_8 = clamp (x_7, 0.0, 1.0); - return tmpvar_8; -} - -mat2 xll_saturate ( - in mat2 m_9 -) -{ - vec2 tmpvar_10; - tmpvar_10 = clamp (m_9[0], 0.0, 1.0); - vec2 tmpvar_11; - tmpvar_11 = clamp (m_9[1], 0.0, 1.0); - mat2 tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_10; - tmpvar_12[0] = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_12[1] = tmpvar_14; - return tmpvar_12; -} - -mat3 xll_saturate ( - in mat3 m_15 -) -{ - vec3 tmpvar_16; - tmpvar_16 = clamp (m_15[0], 0.0, 1.0); - vec3 tmpvar_17; - tmpvar_17 = clamp (m_15[1], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_15[2], 0.0, 1.0); - mat3 tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_16; - tmpvar_19[0] = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_19[1] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_19[2] = tmpvar_22; - return tmpvar_19; -} - -mat4 xll_saturate ( - in mat4 m_23 -) -{ - vec4 tmpvar_24; - tmpvar_24 = clamp (m_23[0], 0.0, 1.0); - vec4 tmpvar_25; - tmpvar_25 = clamp (m_23[1], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_23[2], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_23[3], 0.0, 1.0); - mat4 tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_24; - tmpvar_28[0] = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_28[1] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_28[2] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_28[3] = tmpvar_32; - return tmpvar_28; -} - -vec4 UnpackNormal ( - in vec4 packednormal_33 -) -{ - vec4 normal_34; - vec2 tmpvar_35; - tmpvar_35 = ((packednormal_33.wy * 2.0) - 1.0); - normal_34.xy = tmpvar_35.xy.xy; - float tmpvar_36; - tmpvar_36 = sqrt (((1.0 - (normal_34.x * normal_34.x)) - (normal_34.y * normal_34.y))); - float tmpvar_37; - tmpvar_37 = tmpvar_36; - normal_34.z = vec3(tmpvar_37).z; - return normal_34; -} - -void surf ( - in Input IN_38, - inout SurfaceOutput o_39 -) -{ - float rim_40; - vec4 tmpvar_41; - tmpvar_41 = texture2D (_MainTex, IN_38.uv_BumpMap); - vec3 tmpvar_42; - tmpvar_42 = tmpvar_41.xyz; - o_39.Albedo = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43 = texture2D (_BumpMap, IN_38.uv_BumpMap); - vec4 tmpvar_44; - tmpvar_44 = UnpackNormal (tmpvar_43); - vec3 tmpvar_45; - tmpvar_45 = tmpvar_44.xyz; - vec3 tmpvar_46; - tmpvar_46 = tmpvar_45; - o_39.Normal = tmpvar_46; - vec3 tmpvar_47; - tmpvar_47 = normalize (IN_38.viewDir); - float tmpvar_48; - tmpvar_48 = dot (tmpvar_47, o_39.Normal); - float tmpvar_49; - tmpvar_49 = xll_saturate (tmpvar_48); - float tmpvar_50; - tmpvar_50 = (1.0 - tmpvar_49); - rim_40 = tmpvar_50; - float tmpvar_51; - tmpvar_51 = pow (rim_40, _RimPower); - vec3 tmpvar_52; - tmpvar_52 = (_RimColor.xyz * tmpvar_51); - o_39.Emission = tmpvar_52; -} - -float UnitySpotCookie ( - in vec4 LightCoord_53 -) -{ - vec4 tmpvar_54; - tmpvar_54 = texture2D (_LightTexture0, ((LightCoord_53.xy / LightCoord_53.w) + 0.5)); - return tmpvar_54.w; -} - -float UnitySpotAttenuate ( - in vec3 LightCoord_55 -) -{ - float tmpvar_56; - tmpvar_56 = dot (LightCoord_55, LightCoord_55); - vec2 tmpvar_57; - tmpvar_57 = vec2(tmpvar_56); - vec2 tmpvar_58; - tmpvar_58 = tmpvar_57.xy; - vec4 tmpvar_59; - tmpvar_59 = texture2D (_LightTextureB0, tmpvar_58); - return tmpvar_59.w; -} - -vec4 LightingLambert ( - in SurfaceOutput s_60, - in vec3 lightDir_61, - in float atten_62 -) -{ - vec4 c_63; - float diff_64; - float tmpvar_65; - tmpvar_65 = dot (s_60.Normal, lightDir_61); - float tmpvar_66; - tmpvar_66 = max (0.0, tmpvar_65); - float tmpvar_67; - tmpvar_67 = tmpvar_66; - diff_64 = tmpvar_67; - vec3 tmpvar_68; - tmpvar_68 = ((s_60.Albedo * _LightColor0.xyz) * ((diff_64 * atten_62) * 2.0)); - c_63.xyz = tmpvar_68.xyz.xyz; - float tmpvar_69; - tmpvar_69 = s_60.Alpha; - c_63.w = vec4(tmpvar_69).w; - return c_63; -} - -vec4 frag_surf ( - in v2f_surf IN_70 -) -{ - vec4 c_71; - vec3 lightDir_72; - SurfaceOutput o_73; - Input surfIN_74; - vec2 tmpvar_75; - tmpvar_75 = IN_70.hip_pack0.xy; - surfIN_74.uv_BumpMap = tmpvar_75; - vec3 tmpvar_76; - tmpvar_76 = vec3(0.0, 0.0, 0.0); - o_73.Albedo = tmpvar_76; - vec3 tmpvar_77; - tmpvar_77 = vec3(0.0, 0.0, 0.0); - o_73.Emission = tmpvar_77; - float tmpvar_78; - tmpvar_78 = 0.0; - o_73.Specular = tmpvar_78; - float tmpvar_79; - tmpvar_79 = 0.0; - o_73.Alpha = tmpvar_79; - float tmpvar_80; - tmpvar_80 = 0.0; - o_73.Gloss = tmpvar_80; - surf (surfIN_74, o_73); - vec3 tmpvar_81; - tmpvar_81 = IN_70.lightDir; - lightDir_72 = tmpvar_81; - vec3 tmpvar_82; - tmpvar_82 = normalize (lightDir_72); - vec3 tmpvar_83; - tmpvar_83 = tmpvar_82; - lightDir_72 = tmpvar_83; - float tmpvar_84; - tmpvar_84 = UnitySpotCookie (IN_70._LightCoord); - float tmpvar_85; - tmpvar_85 = UnitySpotAttenuate (IN_70._LightCoord.xyz); - vec4 tmpvar_86; - tmpvar_86 = LightingLambert (o_73, lightDir_72, ((float( - (IN_70._LightCoord.z > 0.0) - ) * tmpvar_84) * tmpvar_85)); - vec4 tmpvar_87; - tmpvar_87 = tmpvar_86; - c_71 = tmpvar_87; - float tmpvar_88; - tmpvar_88 = 0.0; - c_71.w = vec4(tmpvar_88).w; - return c_71; -} - -void main () -{ - v2f_surf xlt_IN_89; - vec4 xl_retval_90; - vec4 tmpvar_91; - tmpvar_91 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_89.pos = tmpvar_91; - float tmpvar_92; - tmpvar_92 = xlv_FOG.x; - xlt_IN_89.fog = tmpvar_92; - vec2 tmpvar_93; - tmpvar_93 = gl_TexCoord[0].xy; - vec2 tmpvar_94; - tmpvar_94 = tmpvar_93; - xlt_IN_89.hip_pack0 = tmpvar_94; - vec3 tmpvar_95; - tmpvar_95 = gl_TexCoord[1].xyz; - vec3 tmpvar_96; - tmpvar_96 = tmpvar_95; - xlt_IN_89.lightDir = tmpvar_96; - vec4 tmpvar_97; - tmpvar_97 = gl_TexCoord[2].xyzw; - vec4 tmpvar_98; - tmpvar_98 = tmpvar_97; - xlt_IN_89._LightCoord = tmpvar_98; - vec4 tmpvar_99; - tmpvar_99 = frag_surf (xlt_IN_89); - vec4 tmpvar_100; - tmpvar_100 = tmpvar_99; - xl_retval_90 = tmpvar_100; - vec4 tmpvar_101; - tmpvar_101 = xl_retval_90.xyzw; - vec4 tmpvar_102; - tmpvar_102 = tmpvar_101; - gl_FragData[0] = tmpvar_102; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-out.txt index 4c4b7550a..40923ff01 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-out.txt @@ -28,4 +28,13 @@ void main () } -// inputs: 1, stats: 23 alu 4 tex 0 flow +// stats: 23 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 1 (total size: 0) +// #0: _LightColor0 (high float) 4x1 [-1] +// textures: 4 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _LightTexture0 (high 2d) 0x0 [-1] +// #2: _LightTextureB0 (high 2d) 0x0 [-1] +// #3: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-ir.txt deleted file mode 100644 index 7192c56d4..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-ir.txt +++ /dev/null @@ -1,301 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_BumpMap; - vec3 viewDir; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 lightDir; - vec3 _LightCoord; -}; -uniform sampler2D _BumpMap; -uniform vec4 _LightColor0; -uniform samplerCube _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -uniform vec4 _RimColor; -uniform float _RimPower; -varying vec4 xlv_FOG; -float xll_saturate ( - in float x_1 -) -{ - float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -vec2 xll_saturate ( - in vec2 x_3 -) -{ - vec2 tmpvar_4; - tmpvar_4 = clamp (x_3, 0.0, 1.0); - return tmpvar_4; -} - -vec3 xll_saturate ( - in vec3 x_5 -) -{ - vec3 tmpvar_6; - tmpvar_6 = clamp (x_5, 0.0, 1.0); - return tmpvar_6; -} - -vec4 xll_saturate ( - in vec4 x_7 -) -{ - vec4 tmpvar_8; - tmpvar_8 = clamp (x_7, 0.0, 1.0); - return tmpvar_8; -} - -mat2 xll_saturate ( - in mat2 m_9 -) -{ - vec2 tmpvar_10; - tmpvar_10 = clamp (m_9[0], 0.0, 1.0); - vec2 tmpvar_11; - tmpvar_11 = clamp (m_9[1], 0.0, 1.0); - mat2 tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_10; - tmpvar_12[0] = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_12[1] = tmpvar_14; - return tmpvar_12; -} - -mat3 xll_saturate ( - in mat3 m_15 -) -{ - vec3 tmpvar_16; - tmpvar_16 = clamp (m_15[0], 0.0, 1.0); - vec3 tmpvar_17; - tmpvar_17 = clamp (m_15[1], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_15[2], 0.0, 1.0); - mat3 tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_16; - tmpvar_19[0] = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_19[1] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_19[2] = tmpvar_22; - return tmpvar_19; -} - -mat4 xll_saturate ( - in mat4 m_23 -) -{ - vec4 tmpvar_24; - tmpvar_24 = clamp (m_23[0], 0.0, 1.0); - vec4 tmpvar_25; - tmpvar_25 = clamp (m_23[1], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_23[2], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_23[3], 0.0, 1.0); - mat4 tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_24; - tmpvar_28[0] = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_28[1] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_28[2] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_28[3] = tmpvar_32; - return tmpvar_28; -} - -vec4 UnpackNormal ( - in vec4 packednormal_33 -) -{ - vec4 normal_34; - vec2 tmpvar_35; - tmpvar_35 = ((packednormal_33.wy * 2.0) - 1.0); - normal_34.xy = tmpvar_35.xy.xy; - float tmpvar_36; - tmpvar_36 = sqrt (((1.0 - (normal_34.x * normal_34.x)) - (normal_34.y * normal_34.y))); - float tmpvar_37; - tmpvar_37 = tmpvar_36; - normal_34.z = vec3(tmpvar_37).z; - return normal_34; -} - -void surf ( - in Input IN_38, - inout SurfaceOutput o_39 -) -{ - float rim_40; - vec4 tmpvar_41; - tmpvar_41 = texture2D (_MainTex, IN_38.uv_BumpMap); - vec3 tmpvar_42; - tmpvar_42 = tmpvar_41.xyz; - o_39.Albedo = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43 = texture2D (_BumpMap, IN_38.uv_BumpMap); - vec4 tmpvar_44; - tmpvar_44 = UnpackNormal (tmpvar_43); - vec3 tmpvar_45; - tmpvar_45 = tmpvar_44.xyz; - vec3 tmpvar_46; - tmpvar_46 = tmpvar_45; - o_39.Normal = tmpvar_46; - vec3 tmpvar_47; - tmpvar_47 = normalize (IN_38.viewDir); - float tmpvar_48; - tmpvar_48 = dot (tmpvar_47, o_39.Normal); - float tmpvar_49; - tmpvar_49 = xll_saturate (tmpvar_48); - float tmpvar_50; - tmpvar_50 = (1.0 - tmpvar_49); - rim_40 = tmpvar_50; - float tmpvar_51; - tmpvar_51 = pow (rim_40, _RimPower); - vec3 tmpvar_52; - tmpvar_52 = (_RimColor.xyz * tmpvar_51); - o_39.Emission = tmpvar_52; -} - -vec4 LightingLambert ( - in SurfaceOutput s_53, - in vec3 lightDir_54, - in float atten_55 -) -{ - vec4 c_56; - float diff_57; - float tmpvar_58; - tmpvar_58 = dot (s_53.Normal, lightDir_54); - float tmpvar_59; - tmpvar_59 = max (0.0, tmpvar_58); - float tmpvar_60; - tmpvar_60 = tmpvar_59; - diff_57 = tmpvar_60; - vec3 tmpvar_61; - tmpvar_61 = ((s_53.Albedo * _LightColor0.xyz) * ((diff_57 * atten_55) * 2.0)); - c_56.xyz = tmpvar_61.xyz.xyz; - float tmpvar_62; - tmpvar_62 = s_53.Alpha; - c_56.w = vec4(tmpvar_62).w; - return c_56; -} - -vec4 frag_surf ( - in v2f_surf IN_63 -) -{ - vec4 c_64; - vec3 lightDir_65; - SurfaceOutput o_66; - Input surfIN_67; - vec2 tmpvar_68; - tmpvar_68 = IN_63.hip_pack0.xy; - surfIN_67.uv_BumpMap = tmpvar_68; - vec3 tmpvar_69; - tmpvar_69 = vec3(0.0, 0.0, 0.0); - o_66.Albedo = tmpvar_69; - vec3 tmpvar_70; - tmpvar_70 = vec3(0.0, 0.0, 0.0); - o_66.Emission = tmpvar_70; - float tmpvar_71; - tmpvar_71 = 0.0; - o_66.Specular = tmpvar_71; - float tmpvar_72; - tmpvar_72 = 0.0; - o_66.Alpha = tmpvar_72; - float tmpvar_73; - tmpvar_73 = 0.0; - o_66.Gloss = tmpvar_73; - surf (surfIN_67, o_66); - vec3 tmpvar_74; - tmpvar_74 = IN_63.lightDir; - lightDir_65 = tmpvar_74; - vec3 tmpvar_75; - tmpvar_75 = normalize (lightDir_65); - vec3 tmpvar_76; - tmpvar_76 = tmpvar_75; - lightDir_65 = tmpvar_76; - float tmpvar_77; - tmpvar_77 = dot (IN_63._LightCoord, IN_63._LightCoord); - vec2 tmpvar_78; - tmpvar_78 = vec2(tmpvar_77); - vec2 tmpvar_79; - tmpvar_79 = tmpvar_78.xy; - vec4 tmpvar_80; - tmpvar_80 = texture2D (_LightTextureB0, tmpvar_79); - vec4 tmpvar_81; - tmpvar_81 = textureCube (_LightTexture0, IN_63._LightCoord); - vec4 tmpvar_82; - tmpvar_82 = LightingLambert (o_66, lightDir_65, (tmpvar_80.w * tmpvar_81.w)); - vec4 tmpvar_83; - tmpvar_83 = tmpvar_82; - c_64 = tmpvar_83; - float tmpvar_84; - tmpvar_84 = 0.0; - c_64.w = vec4(tmpvar_84).w; - return c_64; -} - -void main () -{ - v2f_surf xlt_IN_85; - vec4 xl_retval_86; - vec4 tmpvar_87; - tmpvar_87 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_85.pos = tmpvar_87; - float tmpvar_88; - tmpvar_88 = xlv_FOG.x; - xlt_IN_85.fog = tmpvar_88; - vec2 tmpvar_89; - tmpvar_89 = gl_TexCoord[0].xy; - vec2 tmpvar_90; - tmpvar_90 = tmpvar_89; - xlt_IN_85.hip_pack0 = tmpvar_90; - vec3 tmpvar_91; - tmpvar_91 = gl_TexCoord[1].xyz; - vec3 tmpvar_92; - tmpvar_92 = tmpvar_91; - xlt_IN_85.lightDir = tmpvar_92; - vec3 tmpvar_93; - tmpvar_93 = gl_TexCoord[2].xyz; - vec3 tmpvar_94; - tmpvar_94 = tmpvar_93; - xlt_IN_85._LightCoord = tmpvar_94; - vec4 tmpvar_95; - tmpvar_95 = frag_surf (xlt_IN_85); - vec4 tmpvar_96; - tmpvar_96 = tmpvar_95; - xl_retval_86 = tmpvar_96; - vec4 tmpvar_97; - tmpvar_97 = xl_retval_86.xyzw; - vec4 tmpvar_98; - tmpvar_98 = tmpvar_97; - gl_FragData[0] = tmpvar_98; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-out.txt index 3378c5b66..6dbcc1a12 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-out.txt @@ -28,4 +28,13 @@ void main () } -// inputs: 1, stats: 18 alu 4 tex 0 flow +// stats: 18 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 1 (total size: 0) +// #0: _LightColor0 (high float) 4x1 [-1] +// textures: 4 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _LightTexture0 (high cube) 0x0 [-1] +// #2: _LightTextureB0 (high 2d) 0x0 [-1] +// #3: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-ir.txt deleted file mode 100644 index 260aac60a..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-ir.txt +++ /dev/null @@ -1,182 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec4 screenPos; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec3 normal; - vec3 lightDir; - vec4 _LightCoord; -}; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec2 uv_3; - vec2 tmpvar_4; - tmpvar_4 = (IN_1.screenPos.xy / IN_1.screenPos.w); - uv_3 = tmpvar_4; - vec2 tmpvar_5; - tmpvar_5 = (uv_3 * vec2(2.0, 1.0)); - uv_3 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = vec3(0.5, 0.5, 0.5); - o_2.Albedo = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7 = texture2D (_MainTex, uv_3); - vec3 tmpvar_8; - tmpvar_8 = (tmpvar_7.xyz * 0.5); - o_2.Emission = tmpvar_8; -} - -float UnitySpotCookie ( - in vec4 LightCoord_9 -) -{ - vec4 tmpvar_10; - tmpvar_10 = texture2D (_LightTexture0, ((LightCoord_9.xy / LightCoord_9.w) + 0.5)); - return tmpvar_10.w; -} - -float UnitySpotAttenuate ( - in vec3 LightCoord_11 -) -{ - float tmpvar_12; - tmpvar_12 = dot (LightCoord_11, LightCoord_11); - vec2 tmpvar_13; - tmpvar_13 = vec2(tmpvar_12); - vec2 tmpvar_14; - tmpvar_14 = tmpvar_13.xy; - vec4 tmpvar_15; - tmpvar_15 = texture2D (_LightTextureB0, tmpvar_14); - return tmpvar_15.w; -} - -vec4 LightingLambert ( - in SurfaceOutput s_16, - in vec3 lightDir_17, - in float atten_18 -) -{ - vec4 c_19; - float diff_20; - float tmpvar_21; - tmpvar_21 = dot (s_16.Normal, lightDir_17); - float tmpvar_22; - tmpvar_22 = max (0.0, tmpvar_21); - float tmpvar_23; - tmpvar_23 = tmpvar_22; - diff_20 = tmpvar_23; - vec3 tmpvar_24; - tmpvar_24 = ((s_16.Albedo * _LightColor0.xyz) * ((diff_20 * atten_18) * 2.0)); - c_19.xyz = tmpvar_24.xyz.xyz; - float tmpvar_25; - tmpvar_25 = s_16.Alpha; - c_19.w = vec4(tmpvar_25).w; - return c_19; -} - -vec4 frag_surf ( - in v2f_surf IN_26 -) -{ - vec4 c_27; - vec3 lightDir_28; - Input surfIN_29; - SurfaceOutput o_30; - vec3 tmpvar_31; - tmpvar_31 = vec3(0.0, 0.0, 0.0); - o_30.Albedo = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = vec3(0.0, 0.0, 0.0); - o_30.Emission = tmpvar_32; - float tmpvar_33; - tmpvar_33 = 0.0; - o_30.Specular = tmpvar_33; - float tmpvar_34; - tmpvar_34 = 0.0; - o_30.Alpha = tmpvar_34; - float tmpvar_35; - tmpvar_35 = 0.0; - o_30.Gloss = tmpvar_35; - vec3 tmpvar_36; - tmpvar_36 = IN_26.normal; - o_30.Normal = tmpvar_36; - surf (surfIN_29, o_30); - vec3 tmpvar_37; - tmpvar_37 = IN_26.lightDir; - lightDir_28 = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = normalize (lightDir_28); - vec3 tmpvar_39; - tmpvar_39 = tmpvar_38; - lightDir_28 = tmpvar_39; - float tmpvar_40; - tmpvar_40 = UnitySpotCookie (IN_26._LightCoord); - float tmpvar_41; - tmpvar_41 = UnitySpotAttenuate (IN_26._LightCoord.xyz); - vec4 tmpvar_42; - tmpvar_42 = LightingLambert (o_30, lightDir_28, ((float( - (IN_26._LightCoord.z > 0.0) - ) * tmpvar_40) * tmpvar_41)); - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - c_27 = tmpvar_43; - float tmpvar_44; - tmpvar_44 = 0.0; - c_27.w = vec4(tmpvar_44).w; - return c_27; -} - -void main () -{ - v2f_surf xlt_IN_45; - vec4 xl_retval_46; - vec4 tmpvar_47; - tmpvar_47 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_45.pos = tmpvar_47; - float tmpvar_48; - tmpvar_48 = xlv_FOG.x; - xlt_IN_45.fog = tmpvar_48; - vec3 tmpvar_49; - tmpvar_49 = gl_TexCoord[0].xyz; - vec3 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_IN_45.normal = tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = gl_TexCoord[1].xyz; - vec3 tmpvar_52; - tmpvar_52 = tmpvar_51; - xlt_IN_45.lightDir = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = gl_TexCoord[2].xyzw; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - xlt_IN_45._LightCoord = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = frag_surf (xlt_IN_45); - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - xl_retval_46 = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = xl_retval_46.xyzw; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - gl_FragData[0] = tmpvar_58; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-out.txt index aa462556a..0992b515a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-out.txt @@ -19,4 +19,11 @@ void main () } -// inputs: 1, stats: 16 alu 2 tex 0 flow +// stats: 16 alu 2 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 1 (total size: 0) +// #0: _LightColor0 (high float) 4x1 [-1] +// textures: 2 +// #0: _LightTexture0 (high 2d) 0x0 [-1] +// #1: _LightTextureB0 (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-ir.txt deleted file mode 100644 index d83bbbb76..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-ir.txt +++ /dev/null @@ -1,162 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec4 screenPos; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec3 normal; - vec3 lightDir; - vec3 _LightCoord; -}; -uniform vec4 _LightColor0; -uniform samplerCube _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec2 uv_3; - vec2 tmpvar_4; - tmpvar_4 = (IN_1.screenPos.xy / IN_1.screenPos.w); - uv_3 = tmpvar_4; - vec2 tmpvar_5; - tmpvar_5 = (uv_3 * vec2(2.0, 1.0)); - uv_3 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = vec3(0.5, 0.5, 0.5); - o_2.Albedo = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7 = texture2D (_MainTex, uv_3); - vec3 tmpvar_8; - tmpvar_8 = (tmpvar_7.xyz * 0.5); - o_2.Emission = tmpvar_8; -} - -vec4 LightingLambert ( - in SurfaceOutput s_9, - in vec3 lightDir_10, - in float atten_11 -) -{ - vec4 c_12; - float diff_13; - float tmpvar_14; - tmpvar_14 = dot (s_9.Normal, lightDir_10); - float tmpvar_15; - tmpvar_15 = max (0.0, tmpvar_14); - float tmpvar_16; - tmpvar_16 = tmpvar_15; - diff_13 = tmpvar_16; - vec3 tmpvar_17; - tmpvar_17 = ((s_9.Albedo * _LightColor0.xyz) * ((diff_13 * atten_11) * 2.0)); - c_12.xyz = tmpvar_17.xyz.xyz; - float tmpvar_18; - tmpvar_18 = s_9.Alpha; - c_12.w = vec4(tmpvar_18).w; - return c_12; -} - -vec4 frag_surf ( - in v2f_surf IN_19 -) -{ - vec4 c_20; - vec3 lightDir_21; - Input surfIN_22; - SurfaceOutput o_23; - vec3 tmpvar_24; - tmpvar_24 = vec3(0.0, 0.0, 0.0); - o_23.Albedo = tmpvar_24; - vec3 tmpvar_25; - tmpvar_25 = vec3(0.0, 0.0, 0.0); - o_23.Emission = tmpvar_25; - float tmpvar_26; - tmpvar_26 = 0.0; - o_23.Specular = tmpvar_26; - float tmpvar_27; - tmpvar_27 = 0.0; - o_23.Alpha = tmpvar_27; - float tmpvar_28; - tmpvar_28 = 0.0; - o_23.Gloss = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = IN_19.normal; - o_23.Normal = tmpvar_29; - surf (surfIN_22, o_23); - vec3 tmpvar_30; - tmpvar_30 = IN_19.lightDir; - lightDir_21 = tmpvar_30; - vec3 tmpvar_31; - tmpvar_31 = normalize (lightDir_21); - vec3 tmpvar_32; - tmpvar_32 = tmpvar_31; - lightDir_21 = tmpvar_32; - float tmpvar_33; - tmpvar_33 = dot (IN_19._LightCoord, IN_19._LightCoord); - vec2 tmpvar_34; - tmpvar_34 = vec2(tmpvar_33); - vec2 tmpvar_35; - tmpvar_35 = tmpvar_34.xy; - vec4 tmpvar_36; - tmpvar_36 = texture2D (_LightTextureB0, tmpvar_35); - vec4 tmpvar_37; - tmpvar_37 = textureCube (_LightTexture0, IN_19._LightCoord); - vec4 tmpvar_38; - tmpvar_38 = LightingLambert (o_23, lightDir_21, (tmpvar_36.w * tmpvar_37.w)); - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - c_20 = tmpvar_39; - float tmpvar_40; - tmpvar_40 = 0.0; - c_20.w = vec4(tmpvar_40).w; - return c_20; -} - -void main () -{ - v2f_surf xlt_IN_41; - vec4 xl_retval_42; - vec4 tmpvar_43; - tmpvar_43 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_41.pos = tmpvar_43; - float tmpvar_44; - tmpvar_44 = xlv_FOG.x; - xlt_IN_41.fog = tmpvar_44; - vec3 tmpvar_45; - tmpvar_45 = gl_TexCoord[0].xyz; - vec3 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_IN_41.normal = tmpvar_46; - vec3 tmpvar_47; - tmpvar_47 = gl_TexCoord[1].xyz; - vec3 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_IN_41.lightDir = tmpvar_48; - vec3 tmpvar_49; - tmpvar_49 = gl_TexCoord[2].xyz; - vec3 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_IN_41._LightCoord = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = frag_surf (xlt_IN_41); - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - xl_retval_42 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = xl_retval_42.xyzw; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - gl_FragData[0] = tmpvar_54; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-out.txt index 89a2d1fc2..d868a8bc4 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-out.txt @@ -19,4 +19,11 @@ void main () } -// inputs: 1, stats: 11 alu 2 tex 0 flow +// stats: 11 alu 2 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 1 (total size: 0) +// #0: _LightColor0 (high float) 4x1 [-1] +// textures: 2 +// #0: _LightTexture0 (high cube) 0x0 [-1] +// #1: _LightTextureB0 (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos2-ir.txt deleted file mode 100644 index c85a4d70c..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos2-ir.txt +++ /dev/null @@ -1,97 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec4 screenPos; -}; -struct v2f_surf { - vec4 pos; - vec3 normal; -}; -uniform sampler2D _MainTex; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec2 uv_3; - vec2 tmpvar_4; - tmpvar_4 = (IN_1.screenPos.xy / IN_1.screenPos.w); - uv_3 = tmpvar_4; - vec2 tmpvar_5; - tmpvar_5 = (uv_3 * vec2(2.0, 1.0)); - uv_3 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = vec3(0.5, 0.5, 0.5); - o_2.Albedo = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7 = texture2D (_MainTex, uv_3); - vec3 tmpvar_8; - tmpvar_8 = (tmpvar_7.xyz * 0.5); - o_2.Emission = tmpvar_8; -} - -vec4 frag_surf ( - in v2f_surf IN_9 -) -{ - vec4 res_10; - Input surfIN_11; - SurfaceOutput o_12; - vec3 tmpvar_13; - tmpvar_13 = vec3(0.0, 0.0, 0.0); - o_12.Albedo = tmpvar_13; - vec3 tmpvar_14; - tmpvar_14 = vec3(0.0, 0.0, 0.0); - o_12.Emission = tmpvar_14; - float tmpvar_15; - tmpvar_15 = 0.0; - o_12.Specular = tmpvar_15; - float tmpvar_16; - tmpvar_16 = 0.0; - o_12.Alpha = tmpvar_16; - float tmpvar_17; - tmpvar_17 = 0.0; - o_12.Gloss = tmpvar_17; - vec3 tmpvar_18; - tmpvar_18 = IN_9.normal; - o_12.Normal = tmpvar_18; - surf (surfIN_11, o_12); - vec3 tmpvar_19; - tmpvar_19 = ((o_12.Normal * vec3(0.5, 0.5, -0.5)) + 0.5); - res_10.xyz = tmpvar_19.xyz.xyz; - float tmpvar_20; - tmpvar_20 = o_12.Specular; - res_10.w = vec4(tmpvar_20).w; - return res_10; -} - -void main () -{ - v2f_surf xlt_IN_21; - vec4 xl_retval_22; - vec4 tmpvar_23; - tmpvar_23 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_21.pos = tmpvar_23; - vec3 tmpvar_24; - tmpvar_24 = gl_TexCoord[0].xyz; - vec3 tmpvar_25; - tmpvar_25 = tmpvar_24; - xlt_IN_21.normal = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = frag_surf (xlt_IN_21); - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - xl_retval_22 = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = xl_retval_22.xyzw; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - gl_FragData[0] = tmpvar_29; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos2-out.txt index a366de427..811a56224 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos2-out.txt @@ -7,4 +7,6 @@ void main () } -// inputs: 1, stats: 3 alu 0 tex 0 flow +// stats: 3 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo-ir.txt deleted file mode 100644 index 2c1199e9e..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo-ir.txt +++ /dev/null @@ -1,94 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec4 screenPos; -}; -struct v2f_surf { - vec4 pos; - vec3 normal; -}; -uniform sampler2D _MainTex; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec2 uv_3; - vec2 tmpvar_4; - tmpvar_4 = (IN_1.screenPos.xy / IN_1.screenPos.w); - uv_3 = tmpvar_4; - vec2 tmpvar_5; - tmpvar_5 = (uv_3 * vec2(2.0, 1.0)); - uv_3 = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6 = texture2D (_MainTex, uv_3); - vec3 tmpvar_7; - tmpvar_7 = tmpvar_6.xyz; - o_2.Albedo = tmpvar_7; -} - -vec4 frag_surf ( - in v2f_surf IN_8 -) -{ - vec4 res_9; - Input surfIN_10; - SurfaceOutput o_11; - vec3 tmpvar_12; - tmpvar_12 = vec3(0.0, 0.0, 0.0); - o_11.Albedo = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13 = vec3(0.0, 0.0, 0.0); - o_11.Emission = tmpvar_13; - float tmpvar_14; - tmpvar_14 = 0.0; - o_11.Specular = tmpvar_14; - float tmpvar_15; - tmpvar_15 = 0.0; - o_11.Alpha = tmpvar_15; - float tmpvar_16; - tmpvar_16 = 0.0; - o_11.Gloss = tmpvar_16; - vec3 tmpvar_17; - tmpvar_17 = IN_8.normal; - o_11.Normal = tmpvar_17; - surf (surfIN_10, o_11); - vec3 tmpvar_18; - tmpvar_18 = ((o_11.Normal * vec3(0.5, 0.5, -0.5)) + 0.5); - res_9.xyz = tmpvar_18.xyz.xyz; - float tmpvar_19; - tmpvar_19 = o_11.Specular; - res_9.w = vec4(tmpvar_19).w; - return res_9; -} - -void main () -{ - v2f_surf xlt_IN_20; - vec4 xl_retval_21; - vec4 tmpvar_22; - tmpvar_22 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_20.pos = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = gl_TexCoord[0].xyz; - vec3 tmpvar_24; - tmpvar_24 = tmpvar_23; - xlt_IN_20.normal = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25 = frag_surf (xlt_IN_20); - vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; - xl_retval_21 = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = xl_retval_21.xyzw; - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - gl_FragData[0] = tmpvar_28; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo-out.txt index a366de427..811a56224 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo-out.txt @@ -7,4 +7,6 @@ void main () } -// inputs: 1, stats: 3 alu 0 tex 0 flow +// stats: 3 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-ir.txt deleted file mode 100644 index 6496da7ed..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-ir.txt +++ /dev/null @@ -1,135 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec4 screenPos; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_screenPos; - vec4 hip_screen; -}; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform vec4 unity_Ambient; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec2 uv_3; - vec2 tmpvar_4; - tmpvar_4 = (IN_1.screenPos.xy / IN_1.screenPos.w); - uv_3 = tmpvar_4; - vec2 tmpvar_5; - tmpvar_5 = (uv_3 * vec2(2.0, 1.0)); - uv_3 = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6 = texture2D (_MainTex, uv_3); - vec3 tmpvar_7; - tmpvar_7 = tmpvar_6.xyz; - o_2.Albedo = tmpvar_7; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_8, - in vec4 light_9 -) -{ - vec4 c_10; - vec3 tmpvar_11; - tmpvar_11 = (s_8.Albedo * light_9.xyz); - c_10.xyz = tmpvar_11.xyz.xyz; - float tmpvar_12; - tmpvar_12 = s_8.Alpha; - c_10.w = vec4(tmpvar_12).w; - return c_10; -} - -vec4 frag_surf ( - in v2f_surf IN_13 -) -{ - vec4 col_14; - vec4 light_15; - SurfaceOutput o_16; - Input surfIN_17; - vec4 tmpvar_18; - tmpvar_18 = IN_13.hip_screenPos; - surfIN_17.screenPos = tmpvar_18; - vec3 tmpvar_19; - tmpvar_19 = vec3(0.0, 0.0, 0.0); - o_16.Albedo = tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = vec3(0.0, 0.0, 0.0); - o_16.Emission = tmpvar_20; - float tmpvar_21; - tmpvar_21 = 0.0; - o_16.Specular = tmpvar_21; - float tmpvar_22; - tmpvar_22 = 0.0; - o_16.Alpha = tmpvar_22; - float tmpvar_23; - tmpvar_23 = 0.0; - o_16.Gloss = tmpvar_23; - surf (surfIN_17, o_16); - vec4 tmpvar_24; - tmpvar_24 = texture2DProj (_LightBuffer, IN_13.hip_screen); - vec4 tmpvar_25; - tmpvar_25 = tmpvar_24; - light_15 = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = log2 (light_15); - vec4 tmpvar_27; - tmpvar_27 = -(tmpvar_26); - light_15 = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = (light_15.xyz + unity_Ambient.xyz); - light_15.xyz = tmpvar_28.xyz.xyz; - vec4 tmpvar_29; - tmpvar_29 = LightingLambert_PrePass (o_16, light_15); - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - col_14 = tmpvar_30; - return col_14; -} - -void main () -{ - v2f_surf xlt_IN_31; - vec4 xl_retval_32; - vec4 tmpvar_33; - tmpvar_33 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_31.pos = tmpvar_33; - float tmpvar_34; - tmpvar_34 = xlv_FOG.x; - xlt_IN_31.fog = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35 = gl_TexCoord[0].xyzw; - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlt_IN_31.hip_screenPos = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37 = gl_TexCoord[1].xyzw; - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlt_IN_31.hip_screen = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = frag_surf (xlt_IN_31); - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - xl_retval_32 = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = xl_retval_32.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - gl_FragData[0] = tmpvar_42; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-out.txt index e9d2592f0..3c0b1ce16 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-out.txt @@ -6,15 +6,23 @@ void main () vec4 tmpvar_1; tmpvar_1 = gl_TexCoord[0]; vec4 light_2; - vec4 tmpvar_3; - tmpvar_3 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); - light_2.w = tmpvar_3.w; - light_2.xyz = (tmpvar_3.xyz + unity_Ambient.xyz); + vec2 uv_3; + uv_3 = (tmpvar_1.xy / tmpvar_1.w); + uv_3 = (uv_3 * vec2(2.0, 1.0)); + light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); + light_2.xyz = (light_2.xyz + unity_Ambient.xyz); vec4 c_4; - c_4.xyz = (texture2D (_MainTex, ((tmpvar_1.xy / tmpvar_1.w) * vec2(2.0, 1.0))).xyz * light_2.xyz); + c_4.xyz = (texture2D (_MainTex, uv_3).xyz * light_2.xyz); c_4.w = 0.0; gl_FragData[0] = c_4; } -// inputs: 1, stats: 7 alu 2 tex 0 flow +// stats: 7 alu 2 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [2] loc 4 +// uniforms: 1 (total size: 0) +// #0: unity_Ambient (high float) 4x1 [-1] +// textures: 2 +// #0: _LightBuffer (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-ir.txt deleted file mode 100644 index 9cc042424..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-ir.txt +++ /dev/null @@ -1,203 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec3 worldPos; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 worldPos; - vec3 normal; - vec3 lightDir; - vec4 _LightCoord; -}; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -void surf ( - in Input IN_2, - inout SurfaceOutput o_3 -) -{ - float tmpvar_4; - tmpvar_4 = fract (((IN_2.worldPos.y + (IN_2.worldPos.z * 0.1)) * 5.0)); - xll_clip ((tmpvar_4 - 0.5)); - vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, IN_2.uv_MainTex); - vec3 tmpvar_6; - tmpvar_6 = tmpvar_5.xyz; - o_3.Albedo = tmpvar_6; -} - -float UnitySpotCookie ( - in vec4 LightCoord_7 -) -{ - vec4 tmpvar_8; - tmpvar_8 = texture2D (_LightTexture0, ((LightCoord_7.xy / LightCoord_7.w) + 0.5)); - return tmpvar_8.w; -} - -float UnitySpotAttenuate ( - in vec3 LightCoord_9 -) -{ - float tmpvar_10; - tmpvar_10 = dot (LightCoord_9, LightCoord_9); - vec2 tmpvar_11; - tmpvar_11 = vec2(tmpvar_10); - vec2 tmpvar_12; - tmpvar_12 = tmpvar_11.xy; - vec4 tmpvar_13; - tmpvar_13 = texture2D (_LightTextureB0, tmpvar_12); - return tmpvar_13.w; -} - -vec4 LightingLambert ( - in SurfaceOutput s_14, - in vec3 lightDir_15, - in float atten_16 -) -{ - vec4 c_17; - float diff_18; - float tmpvar_19; - tmpvar_19 = dot (s_14.Normal, lightDir_15); - float tmpvar_20; - tmpvar_20 = max (0.0, tmpvar_19); - float tmpvar_21; - tmpvar_21 = tmpvar_20; - diff_18 = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = ((s_14.Albedo * _LightColor0.xyz) * ((diff_18 * atten_16) * 2.0)); - c_17.xyz = tmpvar_22.xyz.xyz; - float tmpvar_23; - tmpvar_23 = s_14.Alpha; - c_17.w = vec4(tmpvar_23).w; - return c_17; -} - -vec4 frag_surf ( - in v2f_surf IN_24 -) -{ - vec4 c_25; - vec3 lightDir_26; - SurfaceOutput o_27; - Input surfIN_28; - vec2 tmpvar_29; - tmpvar_29 = IN_24.hip_pack0.xy; - surfIN_28.uv_MainTex = tmpvar_29; - vec3 tmpvar_30; - tmpvar_30 = IN_24.worldPos; - surfIN_28.worldPos = tmpvar_30; - vec3 tmpvar_31; - tmpvar_31 = vec3(0.0, 0.0, 0.0); - o_27.Albedo = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = vec3(0.0, 0.0, 0.0); - o_27.Emission = tmpvar_32; - float tmpvar_33; - tmpvar_33 = 0.0; - o_27.Specular = tmpvar_33; - float tmpvar_34; - tmpvar_34 = 0.0; - o_27.Alpha = tmpvar_34; - float tmpvar_35; - tmpvar_35 = 0.0; - o_27.Gloss = tmpvar_35; - vec3 tmpvar_36; - tmpvar_36 = IN_24.normal; - o_27.Normal = tmpvar_36; - surf (surfIN_28, o_27); - vec3 tmpvar_37; - tmpvar_37 = IN_24.lightDir; - lightDir_26 = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = normalize (lightDir_26); - vec3 tmpvar_39; - tmpvar_39 = tmpvar_38; - lightDir_26 = tmpvar_39; - float tmpvar_40; - tmpvar_40 = UnitySpotCookie (IN_24._LightCoord); - float tmpvar_41; - tmpvar_41 = UnitySpotAttenuate (IN_24._LightCoord.xyz); - vec4 tmpvar_42; - tmpvar_42 = LightingLambert (o_27, lightDir_26, ((float( - (IN_24._LightCoord.z > 0.0) - ) * tmpvar_40) * tmpvar_41)); - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - c_25 = tmpvar_43; - float tmpvar_44; - tmpvar_44 = 0.0; - c_25.w = vec4(tmpvar_44).w; - return c_25; -} - -void main () -{ - v2f_surf xlt_IN_45; - vec4 xl_retval_46; - vec4 tmpvar_47; - tmpvar_47 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_45.pos = tmpvar_47; - float tmpvar_48; - tmpvar_48 = xlv_FOG.x; - xlt_IN_45.fog = tmpvar_48; - vec2 tmpvar_49; - tmpvar_49 = gl_TexCoord[0].xy; - vec2 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_IN_45.hip_pack0 = tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = gl_TexCoord[1].xyz; - vec3 tmpvar_52; - tmpvar_52 = tmpvar_51; - xlt_IN_45.worldPos = tmpvar_52; - vec3 tmpvar_53; - tmpvar_53 = gl_TexCoord[2].xyz; - vec3 tmpvar_54; - tmpvar_54 = tmpvar_53; - xlt_IN_45.normal = tmpvar_54; - vec3 tmpvar_55; - tmpvar_55 = gl_TexCoord[3].xyz; - vec3 tmpvar_56; - tmpvar_56 = tmpvar_55; - xlt_IN_45.lightDir = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = gl_TexCoord[4].xyzw; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - xlt_IN_45._LightCoord = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59 = frag_surf (xlt_IN_45); - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - xl_retval_46 = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61 = xl_retval_46.xyzw; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - gl_FragData[0] = tmpvar_62; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-out.txt index 90781031e..91ee4e3bf 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-out.txt @@ -29,4 +29,12 @@ void main () } -// inputs: 1, stats: 22 alu 4 tex 1 flow +// stats: 22 alu 4 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [5] loc 4 +// uniforms: 1 (total size: 0) +// #0: _LightColor0 (high float) 4x1 [-1] +// textures: 3 +// #0: _LightTexture0 (high 2d) 0x0 [-1] +// #1: _LightTextureB0 (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-ir.txt deleted file mode 100644 index a1394ac8b..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-ir.txt +++ /dev/null @@ -1,150 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec3 worldPos; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 worldPos; - vec4 hip_screen; -}; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform vec4 unity_Ambient; -varying vec4 xlv_FOG; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -void surf ( - in Input IN_2, - inout SurfaceOutput o_3 -) -{ - float tmpvar_4; - tmpvar_4 = fract (((IN_2.worldPos.y + (IN_2.worldPos.z * 0.1)) * 5.0)); - xll_clip ((tmpvar_4 - 0.5)); - vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, IN_2.uv_MainTex); - vec3 tmpvar_6; - tmpvar_6 = tmpvar_5.xyz; - o_3.Albedo = tmpvar_6; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_7, - in vec4 light_8 -) -{ - vec4 c_9; - vec3 tmpvar_10; - tmpvar_10 = (s_7.Albedo * light_8.xyz); - c_9.xyz = tmpvar_10.xyz.xyz; - float tmpvar_11; - tmpvar_11 = s_7.Alpha; - c_9.w = vec4(tmpvar_11).w; - return c_9; -} - -vec4 frag_surf ( - in v2f_surf IN_12 -) -{ - vec4 col_13; - vec4 light_14; - SurfaceOutput o_15; - Input surfIN_16; - vec2 tmpvar_17; - tmpvar_17 = IN_12.hip_pack0.xy; - surfIN_16.uv_MainTex = tmpvar_17; - vec3 tmpvar_18; - tmpvar_18 = IN_12.worldPos; - surfIN_16.worldPos = tmpvar_18; - vec3 tmpvar_19; - tmpvar_19 = vec3(0.0, 0.0, 0.0); - o_15.Albedo = tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = vec3(0.0, 0.0, 0.0); - o_15.Emission = tmpvar_20; - float tmpvar_21; - tmpvar_21 = 0.0; - o_15.Specular = tmpvar_21; - float tmpvar_22; - tmpvar_22 = 0.0; - o_15.Alpha = tmpvar_22; - float tmpvar_23; - tmpvar_23 = 0.0; - o_15.Gloss = tmpvar_23; - surf (surfIN_16, o_15); - vec4 tmpvar_24; - tmpvar_24 = texture2DProj (_LightBuffer, IN_12.hip_screen); - vec4 tmpvar_25; - tmpvar_25 = tmpvar_24; - light_14 = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = log2 (light_14); - vec4 tmpvar_27; - tmpvar_27 = -(tmpvar_26); - light_14 = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = (light_14.xyz + unity_Ambient.xyz); - light_14.xyz = tmpvar_28.xyz.xyz; - vec4 tmpvar_29; - tmpvar_29 = LightingLambert_PrePass (o_15, light_14); - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - col_13 = tmpvar_30; - return col_13; -} - -void main () -{ - v2f_surf xlt_IN_31; - vec4 xl_retval_32; - vec4 tmpvar_33; - tmpvar_33 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_31.pos = tmpvar_33; - float tmpvar_34; - tmpvar_34 = xlv_FOG.x; - xlt_IN_31.fog = tmpvar_34; - vec2 tmpvar_35; - tmpvar_35 = gl_TexCoord[0].xy; - vec2 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlt_IN_31.hip_pack0 = tmpvar_36; - vec3 tmpvar_37; - tmpvar_37 = gl_TexCoord[1].xyz; - vec3 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlt_IN_31.worldPos = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = gl_TexCoord[2].xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_IN_31.hip_screen = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = frag_surf (xlt_IN_31); - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - xl_retval_32 = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43 = xl_retval_32.xyzw; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - gl_FragData[0] = tmpvar_44; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-out.txt index ea6cffca8..b292305fb 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-out.txt @@ -13,15 +13,20 @@ void main () if ((x_3 < 0.0)) { discard; }; - vec4 tmpvar_4; - tmpvar_4 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2]))); - light_2.w = tmpvar_4.w; - light_2.xyz = (tmpvar_4.xyz + unity_Ambient.xyz); - vec4 c_5; - c_5.xyz = (texture2D (_MainTex, gl_TexCoord[0].xy).xyz * light_2.xyz); - c_5.w = 0.0; - gl_FragData[0] = c_5; + light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2]))); + light_2.xyz = (light_2.xyz + unity_Ambient.xyz); + vec4 c_4; + c_4.xyz = (texture2D (_MainTex, gl_TexCoord[0].xy).xyz * light_2.xyz); + c_4.w = 0.0; + gl_FragData[0] = c_4; } -// inputs: 1, stats: 11 alu 3 tex 1 flow +// stats: 11 alu 3 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 1 (total size: 0) +// #0: unity_Ambient (high float) 4x1 [-1] +// textures: 2 +// #0: _LightBuffer (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-ir.txt deleted file mode 100644 index 7bd1bfdf6..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-ir.txt +++ /dev/null @@ -1,295 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec3 worldPos; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 worldPos; - vec4 hip_screen; - vec3 hip_lmapFade; -}; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform sampler2D unity_Lightmap; -uniform sampler2D unity_LightmapInd; -varying vec4 xlv_FOG; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -float xll_saturate ( - in float x_2 -) -{ - float tmpvar_3; - tmpvar_3 = clamp (x_2, 0.0, 1.0); - return tmpvar_3; -} - -vec2 xll_saturate ( - in vec2 x_4 -) -{ - vec2 tmpvar_5; - tmpvar_5 = clamp (x_4, 0.0, 1.0); - return tmpvar_5; -} - -vec3 xll_saturate ( - in vec3 x_6 -) -{ - vec3 tmpvar_7; - tmpvar_7 = clamp (x_6, 0.0, 1.0); - return tmpvar_7; -} - -vec4 xll_saturate ( - in vec4 x_8 -) -{ - vec4 tmpvar_9; - tmpvar_9 = clamp (x_8, 0.0, 1.0); - return tmpvar_9; -} - -mat2 xll_saturate ( - in mat2 m_10 -) -{ - vec2 tmpvar_11; - tmpvar_11 = clamp (m_10[0], 0.0, 1.0); - vec2 tmpvar_12; - tmpvar_12 = clamp (m_10[1], 0.0, 1.0); - mat2 tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_13[0] = tmpvar_14; - vec2 tmpvar_15; - tmpvar_15 = tmpvar_12; - tmpvar_13[1] = tmpvar_15; - return tmpvar_13; -} - -mat3 xll_saturate ( - in mat3 m_16 -) -{ - vec3 tmpvar_17; - tmpvar_17 = clamp (m_16[0], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_16[1], 0.0, 1.0); - vec3 tmpvar_19; - tmpvar_19 = clamp (m_16[2], 0.0, 1.0); - mat3 tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_20[0] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_20[1] = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = tmpvar_19; - tmpvar_20[2] = tmpvar_23; - return tmpvar_20; -} - -mat4 xll_saturate ( - in mat4 m_24 -) -{ - vec4 tmpvar_25; - tmpvar_25 = clamp (m_24[0], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_24[1], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_24[2], 0.0, 1.0); - vec4 tmpvar_28; - tmpvar_28 = clamp (m_24[3], 0.0, 1.0); - mat4 tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_29[0] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_29[1] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_29[2] = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_28; - tmpvar_29[3] = tmpvar_33; - return tmpvar_29; -} - -void surf ( - in Input IN_34, - inout SurfaceOutput o_35 -) -{ - float tmpvar_36; - tmpvar_36 = fract (((IN_34.worldPos.y + (IN_34.worldPos.z * 0.1)) * 5.0)); - xll_clip ((tmpvar_36 - 0.5)); - vec4 tmpvar_37; - tmpvar_37 = texture2D (_MainTex, IN_34.uv_MainTex); - vec3 tmpvar_38; - tmpvar_38 = tmpvar_37.xyz; - o_35.Albedo = tmpvar_38; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_39, - in vec4 light_40 -) -{ - vec4 c_41; - vec3 tmpvar_42; - tmpvar_42 = (s_39.Albedo * light_40.xyz); - c_41.xyz = tmpvar_42.xyz.xyz; - float tmpvar_43; - tmpvar_43 = s_39.Alpha; - c_41.w = vec4(tmpvar_43).w; - return c_41; -} - -vec3 DecodeLightmap ( - in vec4 color_44 -) -{ - return (2.0 * color_44.xyz); -} - -vec4 frag_surf ( - in v2f_surf IN_45 -) -{ - vec4 col_46; - vec3 lm_47; - vec3 lmIndirect_48; - vec3 lmFull_49; - vec4 light_50; - SurfaceOutput o_51; - Input surfIN_52; - vec2 tmpvar_53; - tmpvar_53 = IN_45.hip_pack0.xy; - surfIN_52.uv_MainTex = tmpvar_53; - vec3 tmpvar_54; - tmpvar_54 = IN_45.worldPos; - surfIN_52.worldPos = tmpvar_54; - vec3 tmpvar_55; - tmpvar_55 = vec3(0.0, 0.0, 0.0); - o_51.Albedo = tmpvar_55; - vec3 tmpvar_56; - tmpvar_56 = vec3(0.0, 0.0, 0.0); - o_51.Emission = tmpvar_56; - float tmpvar_57; - tmpvar_57 = 0.0; - o_51.Specular = tmpvar_57; - float tmpvar_58; - tmpvar_58 = 0.0; - o_51.Alpha = tmpvar_58; - float tmpvar_59; - tmpvar_59 = 0.0; - o_51.Gloss = tmpvar_59; - surf (surfIN_52, o_51); - vec4 tmpvar_60; - tmpvar_60 = texture2DProj (_LightBuffer, IN_45.hip_screen); - vec4 tmpvar_61; - tmpvar_61 = tmpvar_60; - light_50 = tmpvar_61; - vec4 tmpvar_62; - tmpvar_62 = log2 (light_50); - vec4 tmpvar_63; - tmpvar_63 = -(tmpvar_62); - light_50 = tmpvar_63; - vec4 tmpvar_64; - tmpvar_64 = texture2D (unity_Lightmap, IN_45.hip_lmapFade.xy); - vec3 tmpvar_65; - tmpvar_65 = DecodeLightmap (tmpvar_64); - vec3 tmpvar_66; - tmpvar_66 = tmpvar_65; - lmFull_49 = tmpvar_66; - vec4 tmpvar_67; - tmpvar_67 = texture2D (unity_LightmapInd, IN_45.hip_lmapFade.xy); - vec3 tmpvar_68; - tmpvar_68 = DecodeLightmap (tmpvar_67); - vec3 tmpvar_69; - tmpvar_69 = tmpvar_68; - lmIndirect_48 = tmpvar_69; - float tmpvar_70; - tmpvar_70 = xll_saturate (IN_45.hip_lmapFade.z); - vec3 tmpvar_71; - tmpvar_71 = vec3(tmpvar_70); - vec3 tmpvar_72; - tmpvar_72 = mix (lmIndirect_48, lmFull_49, tmpvar_71); - vec3 tmpvar_73; - tmpvar_73 = tmpvar_72; - lm_47 = tmpvar_73; - vec3 tmpvar_74; - tmpvar_74 = (light_50.xyz + lm_47); - light_50.xyz = tmpvar_74.xyz.xyz; - vec4 tmpvar_75; - tmpvar_75 = LightingLambert_PrePass (o_51, light_50); - vec4 tmpvar_76; - tmpvar_76 = tmpvar_75; - col_46 = tmpvar_76; - return col_46; -} - -void main () -{ - v2f_surf xlt_IN_77; - vec4 xl_retval_78; - vec4 tmpvar_79; - tmpvar_79 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_77.pos = tmpvar_79; - float tmpvar_80; - tmpvar_80 = xlv_FOG.x; - xlt_IN_77.fog = tmpvar_80; - vec2 tmpvar_81; - tmpvar_81 = gl_TexCoord[0].xy; - vec2 tmpvar_82; - tmpvar_82 = tmpvar_81; - xlt_IN_77.hip_pack0 = tmpvar_82; - vec3 tmpvar_83; - tmpvar_83 = gl_TexCoord[1].xyz; - vec3 tmpvar_84; - tmpvar_84 = tmpvar_83; - xlt_IN_77.worldPos = tmpvar_84; - vec4 tmpvar_85; - tmpvar_85 = gl_TexCoord[2].xyzw; - vec4 tmpvar_86; - tmpvar_86 = tmpvar_85; - xlt_IN_77.hip_screen = tmpvar_86; - vec3 tmpvar_87; - tmpvar_87 = gl_TexCoord[3].xyz; - vec3 tmpvar_88; - tmpvar_88 = tmpvar_87; - xlt_IN_77.hip_lmapFade = tmpvar_88; - vec4 tmpvar_89; - tmpvar_89 = frag_surf (xlt_IN_77); - vec4 tmpvar_90; - tmpvar_90 = tmpvar_89; - xl_retval_78 = tmpvar_90; - vec4 tmpvar_91; - tmpvar_91 = xl_retval_78.xyzw; - vec4 tmpvar_92; - tmpvar_92 = tmpvar_91; - gl_FragData[0] = tmpvar_92; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-out.txt index e404f3f57..b1e0b1db1 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-out.txt @@ -16,15 +16,20 @@ void main () if ((x_4 < 0.0)) { discard; }; - vec4 tmpvar_5; - tmpvar_5 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2]))); - light_3.w = tmpvar_5.w; - light_3.xyz = (tmpvar_5.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_2.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_2.xy).xyz), vec3(clamp (tmpvar_2.z, 0.0, 1.0)))); - vec4 c_6; - c_6.xyz = (texture2D (_MainTex, gl_TexCoord[0].xy).xyz * light_3.xyz); - c_6.w = 0.0; - gl_FragData[0] = c_6; + light_3 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2]))); + light_3.xyz = (light_3.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_2.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_2.xy).xyz), vec3(clamp (tmpvar_2.z, 0.0, 1.0)))); + vec4 c_5; + c_5.xyz = (texture2D (_MainTex, gl_TexCoord[0].xy).xyz * light_3.xyz); + c_5.w = 0.0; + gl_FragData[0] = c_5; } -// inputs: 1, stats: 15 alu 5 tex 1 flow +// stats: 15 alu 5 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// textures: 4 +// #0: _LightBuffer (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] +// #2: unity_Lightmap (high 2d) 0x0 [-1] +// #3: unity_LightmapInd (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-ir.txt deleted file mode 100644 index c78e4c77e..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-ir.txt +++ /dev/null @@ -1,329 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec3 worldPos; -}; -struct v2f_surf { - vec4 pos; - vec3 _ShadowCoord0; - vec3 _ShadowCoord1; - vec3 _ShadowCoord2; - vec3 _ShadowCoord3; - vec2 _ShadowZFade; - vec3 worldPos; -}; -uniform vec4 _LightShadowData; -uniform vec4 _LightSplitsFar; -uniform vec4 _LightSplitsNear; -uniform sampler2D _MainTex; -uniform vec4 _ProjectionParams; -uniform sampler2D _ShadowMapTexture; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -float xll_saturate ( - in float x_2 -) -{ - float tmpvar_3; - tmpvar_3 = clamp (x_2, 0.0, 1.0); - return tmpvar_3; -} - -vec2 xll_saturate ( - in vec2 x_4 -) -{ - vec2 tmpvar_5; - tmpvar_5 = clamp (x_4, 0.0, 1.0); - return tmpvar_5; -} - -vec3 xll_saturate ( - in vec3 x_6 -) -{ - vec3 tmpvar_7; - tmpvar_7 = clamp (x_6, 0.0, 1.0); - return tmpvar_7; -} - -vec4 xll_saturate ( - in vec4 x_8 -) -{ - vec4 tmpvar_9; - tmpvar_9 = clamp (x_8, 0.0, 1.0); - return tmpvar_9; -} - -mat2 xll_saturate ( - in mat2 m_10 -) -{ - vec2 tmpvar_11; - tmpvar_11 = clamp (m_10[0], 0.0, 1.0); - vec2 tmpvar_12; - tmpvar_12 = clamp (m_10[1], 0.0, 1.0); - mat2 tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_13[0] = tmpvar_14; - vec2 tmpvar_15; - tmpvar_15 = tmpvar_12; - tmpvar_13[1] = tmpvar_15; - return tmpvar_13; -} - -mat3 xll_saturate ( - in mat3 m_16 -) -{ - vec3 tmpvar_17; - tmpvar_17 = clamp (m_16[0], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_16[1], 0.0, 1.0); - vec3 tmpvar_19; - tmpvar_19 = clamp (m_16[2], 0.0, 1.0); - mat3 tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_20[0] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_20[1] = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = tmpvar_19; - tmpvar_20[2] = tmpvar_23; - return tmpvar_20; -} - -mat4 xll_saturate ( - in mat4 m_24 -) -{ - vec4 tmpvar_25; - tmpvar_25 = clamp (m_24[0], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_24[1], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_24[2], 0.0, 1.0); - vec4 tmpvar_28; - tmpvar_28 = clamp (m_24[3], 0.0, 1.0); - mat4 tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_29[0] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_29[1] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_29[2] = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_28; - tmpvar_29[3] = tmpvar_33; - return tmpvar_29; -} - -void surf ( - in Input IN_34, - inout SurfaceOutput o_35 -) -{ - float tmpvar_36; - tmpvar_36 = fract (((IN_34.worldPos.y + (IN_34.worldPos.z * 0.1)) * 5.0)); - xll_clip ((tmpvar_36 - 0.5)); - vec4 tmpvar_37; - tmpvar_37 = texture2D (_MainTex, IN_34.uv_MainTex); - vec3 tmpvar_38; - tmpvar_38 = tmpvar_37.xyz; - o_35.Albedo = tmpvar_38; -} - -vec2 EncodeFloatRG ( - in float v_39 -) -{ - vec2 enc_40; - float kEncodeBit_41; - vec2 kEncodeMul_42; - vec2 tmpvar_43; - tmpvar_43 = vec2(1.0, 255.0); - kEncodeMul_42 = tmpvar_43; - float tmpvar_44; - tmpvar_44 = 0.00392157; - kEncodeBit_41 = tmpvar_44; - vec2 tmpvar_45; - tmpvar_45 = (kEncodeMul_42 * v_39); - enc_40 = tmpvar_45; - vec2 tmpvar_46; - tmpvar_46 = fract (enc_40); - vec2 tmpvar_47; - tmpvar_47 = tmpvar_46; - enc_40 = tmpvar_47; - float tmpvar_48; - tmpvar_48 = (enc_40.x - (enc_40.y * kEncodeBit_41)); - enc_40.x = tmpvar_48; - return enc_40; -} - -vec4 frag_surf ( - in v2f_surf IN_49 -) -{ - vec4 res_50; - float faded_51; - float shadow_52; - vec4 coord_53; - vec4 weights_54; - vec4 far_55; - vec4 near_56; - vec4 z_57; - SurfaceOutput o_58; - Input surfIN_59; - vec3 tmpvar_60; - tmpvar_60 = IN_49.worldPos; - surfIN_59.worldPos = tmpvar_60; - vec3 tmpvar_61; - tmpvar_61 = vec3(0.0, 0.0, 0.0); - o_58.Albedo = tmpvar_61; - vec3 tmpvar_62; - tmpvar_62 = vec3(0.0, 0.0, 0.0); - o_58.Emission = tmpvar_62; - float tmpvar_63; - tmpvar_63 = 0.0; - o_58.Specular = tmpvar_63; - float tmpvar_64; - tmpvar_64 = 0.0; - o_58.Alpha = tmpvar_64; - float tmpvar_65; - tmpvar_65 = 0.0; - o_58.Gloss = tmpvar_65; - surf (surfIN_59, o_58); - vec4 tmpvar_66; - tmpvar_66 = vec4(IN_49._ShadowZFade.x); - vec4 tmpvar_67; - tmpvar_67 = tmpvar_66; - z_57 = tmpvar_67; - bvec4 tmpvar_68; - tmpvar_68 = greaterThanEqual (z_57, _LightSplitsNear); - vec4 tmpvar_69; - tmpvar_69 = vec4(tmpvar_68).xyzw; - vec4 tmpvar_70; - tmpvar_70 = tmpvar_69; - near_56 = tmpvar_70; - bvec4 tmpvar_71; - tmpvar_71 = lessThan (z_57, _LightSplitsFar); - vec4 tmpvar_72; - tmpvar_72 = vec4(tmpvar_71).xyzw; - vec4 tmpvar_73; - tmpvar_73 = tmpvar_72; - far_55 = tmpvar_73; - vec4 tmpvar_74; - tmpvar_74 = (near_56 * far_55); - weights_54 = tmpvar_74; - vec4 tmpvar_75; - tmpvar_75.w = 1.0; - tmpvar_75.xyz = ((( - (IN_49._ShadowCoord0 * weights_54.x) - + - (IN_49._ShadowCoord1 * weights_54.y) - ) + (IN_49._ShadowCoord2 * weights_54.z)) + (IN_49._ShadowCoord3 * weights_54.w)).xyz; - vec4 tmpvar_76; - tmpvar_76 = tmpvar_75; - coord_53 = tmpvar_76; - vec4 tmpvar_77; - tmpvar_77 = texture2D (_ShadowMapTexture, coord_53.xy); - float tmpvar_78; - if ((tmpvar_77.x < coord_53.z)) { - tmpvar_78 = _LightShadowData.x; - } else { - tmpvar_78 = 1.0; - }; - float tmpvar_79; - tmpvar_79 = tmpvar_78; - shadow_52 = tmpvar_79; - float tmpvar_80; - tmpvar_80 = xll_saturate (IN_49._ShadowZFade.y); - float tmpvar_81; - tmpvar_81 = xll_saturate ((shadow_52 + tmpvar_80)); - float tmpvar_82; - tmpvar_82 = tmpvar_81; - faded_51 = tmpvar_82; - float tmpvar_83; - tmpvar_83 = faded_51; - res_50.x = tmpvar_83; - float tmpvar_84; - tmpvar_84 = 1.0; - res_50.y = vec2(tmpvar_84).y; - vec2 tmpvar_85; - tmpvar_85 = EncodeFloatRG ((1.0 - (z_57 * _ProjectionParams.w)).x); - vec2 tmpvar_86; - tmpvar_86 = tmpvar_85; - res_50.zw = tmpvar_86.xxxy.zw; - return res_50; -} - -void main () -{ - v2f_surf xlt_IN_87; - vec4 xl_retval_88; - vec4 tmpvar_89; - tmpvar_89 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_87.pos = tmpvar_89; - vec3 tmpvar_90; - tmpvar_90 = gl_TexCoord[0].xyz; - vec3 tmpvar_91; - tmpvar_91 = tmpvar_90; - xlt_IN_87._ShadowCoord0 = tmpvar_91; - vec3 tmpvar_92; - tmpvar_92 = gl_TexCoord[1].xyz; - vec3 tmpvar_93; - tmpvar_93 = tmpvar_92; - xlt_IN_87._ShadowCoord1 = tmpvar_93; - vec3 tmpvar_94; - tmpvar_94 = gl_TexCoord[2].xyz; - vec3 tmpvar_95; - tmpvar_95 = tmpvar_94; - xlt_IN_87._ShadowCoord2 = tmpvar_95; - vec3 tmpvar_96; - tmpvar_96 = gl_TexCoord[3].xyz; - vec3 tmpvar_97; - tmpvar_97 = tmpvar_96; - xlt_IN_87._ShadowCoord3 = tmpvar_97; - vec2 tmpvar_98; - tmpvar_98 = gl_TexCoord[4].xy; - vec2 tmpvar_99; - tmpvar_99 = tmpvar_98; - xlt_IN_87._ShadowZFade = tmpvar_99; - vec3 tmpvar_100; - tmpvar_100 = gl_TexCoord[5].xyz; - vec3 tmpvar_101; - tmpvar_101 = tmpvar_100; - xlt_IN_87.worldPos = tmpvar_101; - vec4 tmpvar_102; - tmpvar_102 = frag_surf (xlt_IN_87); - vec4 tmpvar_103; - tmpvar_103 = tmpvar_102; - xl_retval_88 = tmpvar_103; - vec4 tmpvar_104; - tmpvar_104 = xl_retval_88.xyzw; - vec4 tmpvar_105; - tmpvar_105 = tmpvar_104; - gl_FragData[0] = tmpvar_105; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-out.txt index c4b1181a4..8708621f1 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-out.txt @@ -10,22 +10,22 @@ void main () vec3 tmpvar_2; tmpvar_2 = gl_TexCoord[5].xyz; vec4 res_3; - float x_4; - x_4 = (fract(( + vec4 weights_4; + float x_5; + x_5 = (fract(( (tmpvar_2.y + (tmpvar_2.z * 0.1)) * 5.0)) - 0.5); - if ((x_4 < 0.0)) { + if ((x_5 < 0.0)) { discard; }; - vec4 tmpvar_5; - tmpvar_5 = (vec4(greaterThanEqual (tmpvar_1.xxxx, _LightSplitsNear)) * vec4(lessThan (tmpvar_1.xxxx, _LightSplitsFar))); + weights_4 = (vec4(greaterThanEqual (tmpvar_1.xxxx, _LightSplitsNear)) * vec4(lessThan (tmpvar_1.xxxx, _LightSplitsFar))); vec4 tmpvar_6; tmpvar_6.w = 1.0; tmpvar_6.xyz = ((( - (gl_TexCoord[0].xyz * tmpvar_5.x) + (gl_TexCoord[0].xyz * weights_4.x) + - (gl_TexCoord[1].xyz * tmpvar_5.y) - ) + (gl_TexCoord[2].xyz * tmpvar_5.z)) + (gl_TexCoord[3].xyz * tmpvar_5.w)); + (gl_TexCoord[1].xyz * weights_4.y) + ) + (gl_TexCoord[2].xyz * weights_4.z)) + (gl_TexCoord[3].xyz * weights_4.w)); vec4 tmpvar_7; tmpvar_7 = texture2D (_ShadowMapTexture, tmpvar_6.xy); float tmpvar_8; @@ -37,10 +37,9 @@ void main () res_3.x = clamp ((tmpvar_8 + clamp (tmpvar_1.y, 0.0, 1.0)), 0.0, 1.0); res_3.y = 1.0; vec2 enc_9; + enc_9 = (vec2(1.0, 255.0) * (1.0 - (tmpvar_1.xxxx * _ProjectionParams.w)).x); vec2 tmpvar_10; - tmpvar_10 = fract((vec2(1.0, 255.0) * (1.0 - - (tmpvar_1.xxxx * _ProjectionParams.w) - ).x)); + tmpvar_10 = fract(enc_9); enc_9.y = tmpvar_10.y; enc_9.x = (tmpvar_10.x - (tmpvar_10.y * 0.00392157)); res_3.zw = enc_9; @@ -48,4 +47,13 @@ void main () } -// inputs: 1, stats: 31 alu 2 tex 2 flow +// stats: 31 alu 2 tex 2 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [6] loc 4 +// uniforms: 4 (total size: 0) +// #0: _LightShadowData (high float) 4x1 [-1] +// #1: _LightSplitsFar (high float) 4x1 [-1] +// #2: _LightSplitsNear (high float) 4x1 [-1] +// #3: _ProjectionParams (high float) 4x1 [-1] +// textures: 1 +// #0: _ShadowMapTexture (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-ir.txt deleted file mode 100644 index 86dbf5fd0..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-ir.txt +++ /dev/null @@ -1,138 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec3 worldRefl; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec3 worldRefl; - vec3 normal; - vec3 lightDir; -}; -uniform samplerCube _Cube; -uniform vec4 _LightColor0; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 tmpvar_3; - tmpvar_3 = textureCube (_Cube, IN_1.worldRefl); - vec3 tmpvar_4; - tmpvar_4 = tmpvar_3.xyz; - o_2.Albedo = tmpvar_4; -} - -vec4 LightingLambert ( - in SurfaceOutput s_5, - in vec3 lightDir_6, - in float atten_7 -) -{ - vec4 c_8; - float diff_9; - float tmpvar_10; - tmpvar_10 = dot (s_5.Normal, lightDir_6); - float tmpvar_11; - tmpvar_11 = max (0.0, tmpvar_10); - float tmpvar_12; - tmpvar_12 = tmpvar_11; - diff_9 = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13 = ((s_5.Albedo * _LightColor0.xyz) * ((diff_9 * atten_7) * 2.0)); - c_8.xyz = tmpvar_13.xyz.xyz; - float tmpvar_14; - tmpvar_14 = s_5.Alpha; - c_8.w = vec4(tmpvar_14).w; - return c_8; -} - -vec4 frag_surf ( - in v2f_surf IN_15 -) -{ - vec4 c_16; - vec3 lightDir_17; - SurfaceOutput o_18; - Input surfIN_19; - vec3 tmpvar_20; - tmpvar_20 = IN_15.worldRefl; - surfIN_19.worldRefl = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = vec3(0.0, 0.0, 0.0); - o_18.Albedo = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = vec3(0.0, 0.0, 0.0); - o_18.Emission = tmpvar_22; - float tmpvar_23; - tmpvar_23 = 0.0; - o_18.Specular = tmpvar_23; - float tmpvar_24; - tmpvar_24 = 0.0; - o_18.Alpha = tmpvar_24; - float tmpvar_25; - tmpvar_25 = 0.0; - o_18.Gloss = tmpvar_25; - vec3 tmpvar_26; - tmpvar_26 = IN_15.normal; - o_18.Normal = tmpvar_26; - surf (surfIN_19, o_18); - vec3 tmpvar_27; - tmpvar_27 = IN_15.lightDir; - lightDir_17 = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = LightingLambert (o_18, lightDir_17, 1.0); - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - c_16 = tmpvar_29; - float tmpvar_30; - tmpvar_30 = 0.0; - c_16.w = vec4(tmpvar_30).w; - return c_16; -} - -void main () -{ - v2f_surf xlt_IN_31; - vec4 xl_retval_32; - vec4 tmpvar_33; - tmpvar_33 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_31.pos = tmpvar_33; - float tmpvar_34; - tmpvar_34 = xlv_FOG.x; - xlt_IN_31.fog = tmpvar_34; - vec3 tmpvar_35; - tmpvar_35 = gl_TexCoord[0].xyz; - vec3 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlt_IN_31.worldRefl = tmpvar_36; - vec3 tmpvar_37; - tmpvar_37 = gl_TexCoord[1].xyz; - vec3 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlt_IN_31.normal = tmpvar_38; - vec3 tmpvar_39; - tmpvar_39 = gl_TexCoord[2].xyz; - vec3 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_IN_31.lightDir = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = frag_surf (xlt_IN_31); - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - xl_retval_32 = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43 = xl_retval_32.xyzw; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - gl_FragData[0] = tmpvar_44; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-out.txt index 54baf6f59..cf24a024e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-out.txt @@ -14,4 +14,10 @@ void main () } -// inputs: 1, stats: 7 alu 1 tex 0 flow +// stats: 7 alu 1 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 1 (total size: 0) +// #0: _LightColor0 (high float) 4x1 [-1] +// textures: 1 +// #0: _Cube (high cube) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl1-ir.txt deleted file mode 100644 index 7e4f7db97..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl1-ir.txt +++ /dev/null @@ -1,87 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec3 worldRefl; -}; -struct v2f_surf { - vec4 pos; - vec3 normal; -}; -uniform samplerCube _Cube; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 tmpvar_3; - tmpvar_3 = textureCube (_Cube, IN_1.worldRefl); - vec3 tmpvar_4; - tmpvar_4 = tmpvar_3.xyz; - o_2.Albedo = tmpvar_4; -} - -vec4 frag_surf ( - in v2f_surf IN_5 -) -{ - vec4 res_6; - Input surfIN_7; - SurfaceOutput o_8; - vec3 tmpvar_9; - tmpvar_9 = vec3(0.0, 0.0, 0.0); - o_8.Albedo = tmpvar_9; - vec3 tmpvar_10; - tmpvar_10 = vec3(0.0, 0.0, 0.0); - o_8.Emission = tmpvar_10; - float tmpvar_11; - tmpvar_11 = 0.0; - o_8.Specular = tmpvar_11; - float tmpvar_12; - tmpvar_12 = 0.0; - o_8.Alpha = tmpvar_12; - float tmpvar_13; - tmpvar_13 = 0.0; - o_8.Gloss = tmpvar_13; - vec3 tmpvar_14; - tmpvar_14 = IN_5.normal; - o_8.Normal = tmpvar_14; - surf (surfIN_7, o_8); - vec3 tmpvar_15; - tmpvar_15 = ((o_8.Normal * vec3(0.5, 0.5, -0.5)) + 0.5); - res_6.xyz = tmpvar_15.xyz.xyz; - float tmpvar_16; - tmpvar_16 = o_8.Specular; - res_6.w = vec4(tmpvar_16).w; - return res_6; -} - -void main () -{ - v2f_surf xlt_IN_17; - vec4 xl_retval_18; - vec4 tmpvar_19; - tmpvar_19 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_17.pos = tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = gl_TexCoord[0].xyz; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_20; - xlt_IN_17.normal = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22 = frag_surf (xlt_IN_17); - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - xl_retval_18 = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = xl_retval_18.xyzw; - vec4 tmpvar_25; - tmpvar_25 = tmpvar_24; - gl_FragData[0] = tmpvar_25; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl1-out.txt index a366de427..811a56224 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl1-out.txt @@ -7,4 +7,6 @@ void main () } -// inputs: 1, stats: 3 alu 0 tex 0 flow +// stats: 3 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_CgNormals-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Test_CgNormals-ir.txt deleted file mode 100644 index 8698637db..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_CgNormals-ir.txt +++ /dev/null @@ -1,35 +0,0 @@ -struct v2f { - vec4 pos; - vec4 color; -}; -vec4 frag ( - in v2f i_1 -) -{ - return i_1.color; -} - -void main () -{ - v2f xlt_i_2; - vec4 xl_retval_3; - vec4 tmpvar_4; - tmpvar_4 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_2.pos = tmpvar_4; - vec4 tmpvar_5; - tmpvar_5 = gl_Color.xyzw; - vec4 tmpvar_6; - tmpvar_6 = tmpvar_5; - xlt_i_2.color = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7 = frag (xlt_i_2); - vec4 tmpvar_8; - tmpvar_8 = tmpvar_7; - xl_retval_3 = tmpvar_8; - vec4 tmpvar_9; - tmpvar_9 = xl_retval_3.xyzw; - vec4 tmpvar_10; - tmpvar_10 = tmpvar_9; - gl_FragData[0] = tmpvar_10; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_CgNormals-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Test_CgNormals-out.txt index 6f9f2b170..a15e4e8a8 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_CgNormals-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Test_CgNormals-out.txt @@ -4,4 +4,6 @@ void main () } -// inputs: 1, stats: 0 alu 0 tex 0 flow +// stats: 0 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_Color (high float) 4x1 [-1] loc 1 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-ir.txt deleted file mode 100644 index e81fcd63d..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-ir.txt +++ /dev/null @@ -1,39 +0,0 @@ -struct v2f { - vec4 vertex; - vec2 texcoord; -}; -uniform vec4 _Color; -uniform sampler2D _MainTex; -vec4 frag ( - in v2f i_1 -) -{ - vec4 tmpvar_2; - tmpvar_2 = texture2D (_MainTex, i_1.texcoord); - return (tmpvar_2 * _Color); -} - -void main () -{ - v2f xlt_i_3; - vec4 xl_retval_4; - vec4 tmpvar_5; - tmpvar_5 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_3.vertex = tmpvar_5; - vec2 tmpvar_6; - tmpvar_6 = gl_TexCoord[0].xy; - vec2 tmpvar_7; - tmpvar_7 = tmpvar_6; - xlt_i_3.texcoord = tmpvar_7; - vec4 tmpvar_8; - tmpvar_8 = frag (xlt_i_3); - vec4 tmpvar_9; - tmpvar_9 = tmpvar_8; - xl_retval_4 = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10 = xl_retval_4.xyzw; - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - gl_FragData[0] = tmpvar_11; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-out.txt index 9bc8363a0..e7901256c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-out.txt @@ -6,4 +6,10 @@ void main () } -// inputs: 1, stats: 1 alu 1 tex 0 flow +// stats: 1 alu 1 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// uniforms: 1 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-ir.txt deleted file mode 100644 index e2e692a6e..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-ir.txt +++ /dev/null @@ -1,50 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; -}; -uniform sampler2D _CameraDepthTexture; -uniform vec4 _ZBufferParams; -float Linear01Depth ( - in float z_1 -) -{ - return (1.0 / ((_ZBufferParams.x * z_1) + _ZBufferParams.y)); -} - -vec4 frag ( - in v2f i_2 -) -{ - vec4 tmpvar_3; - tmpvar_3 = texture2D (_CameraDepthTexture, i_2.uv); - float tmpvar_4; - tmpvar_4 = Linear01Depth (tmpvar_3.x); - vec4 tmpvar_5; - tmpvar_5 = vec4((1.0 - tmpvar_4)); - return tmpvar_5; -} - -void main () -{ - v2f xlt_i_6; - vec4 xl_retval_7; - vec4 tmpvar_8; - tmpvar_8 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_6.pos = tmpvar_8; - vec2 tmpvar_9; - tmpvar_9 = gl_TexCoord[0].xy; - vec2 tmpvar_10; - tmpvar_10 = tmpvar_9; - xlt_i_6.uv = tmpvar_10; - vec4 tmpvar_11; - tmpvar_11 = frag (xlt_i_6); - vec4 tmpvar_12; - tmpvar_12 = tmpvar_11; - xl_retval_7 = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13 = xl_retval_7.xyzw; - vec4 tmpvar_14; - tmpvar_14 = tmpvar_13; - gl_FragData[0] = tmpvar_14; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-out.txt index 51badb6b3..e225eda47 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-out.txt @@ -8,4 +8,10 @@ void main () } -// inputs: 1, stats: 4 alu 1 tex 0 flow +// stats: 4 alu 1 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// uniforms: 1 (total size: 0) +// #0: _ZBufferParams (high float) 4x1 [-1] +// textures: 1 +// #0: _CameraDepthTexture (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderTexture-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderTexture-ir.txt deleted file mode 100644 index 3b31f8651..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderTexture-ir.txt +++ /dev/null @@ -1,38 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; -}; -uniform sampler2D _MainTex; -vec4 frag ( - in v2f i_1 -) -{ - vec4 tmpvar_2; - tmpvar_2 = texture2D (_MainTex, i_1.uv); - return tmpvar_2; -} - -void main () -{ - v2f xlt_i_3; - vec4 xl_retval_4; - vec4 tmpvar_5; - tmpvar_5 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_3.pos = tmpvar_5; - vec2 tmpvar_6; - tmpvar_6 = gl_TexCoord[0].xy; - vec2 tmpvar_7; - tmpvar_7 = tmpvar_6; - xlt_i_3.uv = tmpvar_7; - vec4 tmpvar_8; - tmpvar_8 = frag (xlt_i_3); - vec4 tmpvar_9; - tmpvar_9 = tmpvar_8; - xl_retval_4 = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10 = xl_retval_4.xyzw; - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - gl_FragData[0] = tmpvar_11; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderTexture-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderTexture-out.txt index 4cd820c96..6290eb987 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderTexture-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderTexture-out.txt @@ -5,4 +5,8 @@ void main () } -// inputs: 1, stats: 0 alu 1 tex 0 flow +// stats: 0 alu 1 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-ir.txt deleted file mode 100644 index 7a97d97ee..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-ir.txt +++ /dev/null @@ -1,132 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; -}; -uniform sampler2D _MainTex0; -uniform sampler2D _MainTex1; -uniform sampler2D _MainTex10; -uniform sampler2D _MainTex11; -uniform sampler2D _MainTex12; -uniform sampler2D _MainTex13; -uniform sampler2D _MainTex14; -uniform sampler2D _MainTex15; -uniform sampler2D _MainTex2; -uniform sampler2D _MainTex3; -uniform sampler2D _MainTex4; -uniform sampler2D _MainTex5; -uniform sampler2D _MainTex6; -uniform sampler2D _MainTex7; -uniform sampler2D _MainTex8; -uniform sampler2D _MainTex9; -vec4 frag ( - in v2f i_1 -) -{ - vec4 col_2; - vec4 tmpvar_3; - tmpvar_3 = texture2D (_MainTex0, i_1.uv); - vec4 tmpvar_4; - tmpvar_4 = tmpvar_3; - col_2 = tmpvar_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex1, i_1.uv); - vec4 tmpvar_6; - tmpvar_6 = (col_2 + tmpvar_5); - col_2 = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7 = texture2D (_MainTex2, i_1.uv); - vec4 tmpvar_8; - tmpvar_8 = (col_2 + tmpvar_7); - col_2 = tmpvar_8; - vec4 tmpvar_9; - tmpvar_9 = texture2D (_MainTex3, i_1.uv); - vec4 tmpvar_10; - tmpvar_10 = (col_2 + tmpvar_9); - col_2 = tmpvar_10; - vec4 tmpvar_11; - tmpvar_11 = texture2D (_MainTex4, i_1.uv); - vec4 tmpvar_12; - tmpvar_12 = (col_2 + tmpvar_11); - col_2 = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13 = texture2D (_MainTex5, i_1.uv); - vec4 tmpvar_14; - tmpvar_14 = (col_2 + tmpvar_13); - col_2 = tmpvar_14; - vec4 tmpvar_15; - tmpvar_15 = texture2D (_MainTex6, i_1.uv); - vec4 tmpvar_16; - tmpvar_16 = (col_2 + tmpvar_15); - col_2 = tmpvar_16; - vec4 tmpvar_17; - tmpvar_17 = texture2D (_MainTex7, i_1.uv); - vec4 tmpvar_18; - tmpvar_18 = (col_2 + tmpvar_17); - col_2 = tmpvar_18; - vec4 tmpvar_19; - tmpvar_19 = texture2D (_MainTex8, i_1.uv); - vec4 tmpvar_20; - tmpvar_20 = (col_2 + tmpvar_19); - col_2 = tmpvar_20; - vec4 tmpvar_21; - tmpvar_21 = texture2D (_MainTex9, i_1.uv); - vec4 tmpvar_22; - tmpvar_22 = (col_2 + tmpvar_21); - col_2 = tmpvar_22; - vec4 tmpvar_23; - tmpvar_23 = texture2D (_MainTex10, i_1.uv); - vec4 tmpvar_24; - tmpvar_24 = (col_2 + tmpvar_23); - col_2 = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25 = texture2D (_MainTex11, i_1.uv); - vec4 tmpvar_26; - tmpvar_26 = (col_2 + tmpvar_25); - col_2 = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = texture2D (_MainTex12, i_1.uv); - vec4 tmpvar_28; - tmpvar_28 = (col_2 + tmpvar_27); - col_2 = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = texture2D (_MainTex13, i_1.uv); - vec4 tmpvar_30; - tmpvar_30 = (col_2 + tmpvar_29); - col_2 = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = texture2D (_MainTex14, i_1.uv); - vec4 tmpvar_32; - tmpvar_32 = (col_2 + tmpvar_31); - col_2 = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = texture2D (_MainTex15, i_1.uv); - vec4 tmpvar_34; - tmpvar_34 = (col_2 + tmpvar_33); - col_2 = tmpvar_34; - return col_2; -} - -void main () -{ - v2f xlt_i_35; - vec4 xl_retval_36; - vec4 tmpvar_37; - tmpvar_37 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_35.pos = tmpvar_37; - vec2 tmpvar_38; - tmpvar_38 = gl_TexCoord[0].xy; - vec2 tmpvar_39; - tmpvar_39 = tmpvar_38; - xlt_i_35.uv = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = frag (xlt_i_35); - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - xl_retval_36 = tmpvar_41; - vec4 tmpvar_42; - tmpvar_42 = xl_retval_36.xyzw; - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - gl_FragData[0] = tmpvar_43; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-out.txt index 4d8828b8c..20d8abba8 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-out.txt @@ -18,14 +18,43 @@ void main () { vec2 tmpvar_1; tmpvar_1 = gl_TexCoord[0].xy; - gl_FragData[0] = ((( - (((( - (((( - ((((texture2D (_MainTex0, tmpvar_1) + texture2D (_MainTex1, tmpvar_1)) + texture2D (_MainTex2, tmpvar_1)) + texture2D (_MainTex3, tmpvar_1)) + texture2D (_MainTex4, tmpvar_1)) - + texture2D (_MainTex5, tmpvar_1)) + texture2D (_MainTex6, tmpvar_1)) + texture2D (_MainTex7, tmpvar_1)) + texture2D (_MainTex8, tmpvar_1)) - + texture2D (_MainTex9, tmpvar_1)) + texture2D (_MainTex10, tmpvar_1)) + texture2D (_MainTex11, tmpvar_1)) + texture2D (_MainTex12, tmpvar_1)) - + texture2D (_MainTex13, tmpvar_1)) + texture2D (_MainTex14, tmpvar_1)) + texture2D (_MainTex15, tmpvar_1)); + vec4 col_2; + col_2 = (texture2D (_MainTex0, tmpvar_1) + texture2D (_MainTex1, tmpvar_1)); + col_2 = (col_2 + texture2D (_MainTex2, tmpvar_1)); + col_2 = (col_2 + texture2D (_MainTex3, tmpvar_1)); + col_2 = (col_2 + texture2D (_MainTex4, tmpvar_1)); + col_2 = (col_2 + texture2D (_MainTex5, tmpvar_1)); + col_2 = (col_2 + texture2D (_MainTex6, tmpvar_1)); + col_2 = (col_2 + texture2D (_MainTex7, tmpvar_1)); + col_2 = (col_2 + texture2D (_MainTex8, tmpvar_1)); + col_2 = (col_2 + texture2D (_MainTex9, tmpvar_1)); + col_2 = (col_2 + texture2D (_MainTex10, tmpvar_1)); + col_2 = (col_2 + texture2D (_MainTex11, tmpvar_1)); + col_2 = (col_2 + texture2D (_MainTex12, tmpvar_1)); + col_2 = (col_2 + texture2D (_MainTex13, tmpvar_1)); + col_2 = (col_2 + texture2D (_MainTex14, tmpvar_1)); + col_2 = (col_2 + texture2D (_MainTex15, tmpvar_1)); + gl_FragData[0] = col_2; } -// inputs: 1, stats: 15 alu 16 tex 0 flow +// stats: 15 alu 16 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// textures: 16 +// #0: _MainTex0 (high 2d) 0x0 [-1] +// #1: _MainTex1 (high 2d) 0x0 [-1] +// #2: _MainTex10 (high 2d) 0x0 [-1] +// #3: _MainTex11 (high 2d) 0x0 [-1] +// #4: _MainTex12 (high 2d) 0x0 [-1] +// #5: _MainTex13 (high 2d) 0x0 [-1] +// #6: _MainTex14 (high 2d) 0x0 [-1] +// #7: _MainTex15 (high 2d) 0x0 [-1] +// #8: _MainTex2 (high 2d) 0x0 [-1] +// #9: _MainTex3 (high 2d) 0x0 [-1] +// #10: _MainTex4 (high 2d) 0x0 [-1] +// #11: _MainTex5 (high 2d) 0x0 [-1] +// #12: _MainTex6 (high 2d) 0x0 [-1] +// #13: _MainTex7 (high 2d) 0x0 [-1] +// #14: _MainTex8 (high 2d) 0x0 [-1] +// #15: _MainTex9 (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-ir.txt deleted file mode 100644 index 1999eb35e..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-ir.txt +++ /dev/null @@ -1,146 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec3 normal; - vec3 lightDir; - vec3 _LightCoord; -}; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec3 tmpvar_3; - tmpvar_3 = vec3(0.0, 1.0, 0.0); - o_2.Emission = tmpvar_3; -} - -vec4 LightingLambert ( - in SurfaceOutput s_4, - in vec3 lightDir_5, - in float atten_6 -) -{ - vec4 c_7; - float diff_8; - float tmpvar_9; - tmpvar_9 = dot (s_4.Normal, lightDir_5); - float tmpvar_10; - tmpvar_10 = max (0.0, tmpvar_9); - float tmpvar_11; - tmpvar_11 = tmpvar_10; - diff_8 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = ((s_4.Albedo * _LightColor0.xyz) * ((diff_8 * atten_6) * 2.0)); - c_7.xyz = tmpvar_12.xyz.xyz; - float tmpvar_13; - tmpvar_13 = s_4.Alpha; - c_7.w = vec4(tmpvar_13).w; - return c_7; -} - -vec4 frag_surf ( - in v2f_surf IN_14 -) -{ - vec4 c_15; - vec3 lightDir_16; - Input surfIN_17; - SurfaceOutput o_18; - vec3 tmpvar_19; - tmpvar_19 = vec3(0.0, 0.0, 0.0); - o_18.Albedo = tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = vec3(0.0, 0.0, 0.0); - o_18.Emission = tmpvar_20; - float tmpvar_21; - tmpvar_21 = 0.0; - o_18.Specular = tmpvar_21; - float tmpvar_22; - tmpvar_22 = 0.0; - o_18.Alpha = tmpvar_22; - float tmpvar_23; - tmpvar_23 = 0.0; - o_18.Gloss = tmpvar_23; - vec3 tmpvar_24; - tmpvar_24 = IN_14.normal; - o_18.Normal = tmpvar_24; - surf (surfIN_17, o_18); - vec3 tmpvar_25; - tmpvar_25 = IN_14.lightDir; - lightDir_16 = tmpvar_25; - vec3 tmpvar_26; - tmpvar_26 = normalize (lightDir_16); - vec3 tmpvar_27; - tmpvar_27 = tmpvar_26; - lightDir_16 = tmpvar_27; - float tmpvar_28; - tmpvar_28 = dot (IN_14._LightCoord, IN_14._LightCoord); - vec2 tmpvar_29; - tmpvar_29 = vec2(tmpvar_28); - vec2 tmpvar_30; - tmpvar_30 = tmpvar_29.xy; - vec4 tmpvar_31; - tmpvar_31 = texture2D (_LightTexture0, tmpvar_30); - vec4 tmpvar_32; - tmpvar_32 = LightingLambert (o_18, lightDir_16, tmpvar_31.w); - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - c_15 = tmpvar_33; - float tmpvar_34; - tmpvar_34 = 0.0; - c_15.w = vec4(tmpvar_34).w; - return c_15; -} - -void main () -{ - v2f_surf xlt_IN_35; - vec4 xl_retval_36; - vec4 tmpvar_37; - tmpvar_37 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_35.pos = tmpvar_37; - float tmpvar_38; - tmpvar_38 = xlv_FOG.x; - xlt_IN_35.fog = tmpvar_38; - vec3 tmpvar_39; - tmpvar_39 = gl_TexCoord[0].xyz; - vec3 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_IN_35.normal = tmpvar_40; - vec3 tmpvar_41; - tmpvar_41 = gl_TexCoord[1].xyz; - vec3 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_IN_35.lightDir = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = gl_TexCoord[2].xyz; - vec3 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_IN_35._LightCoord = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = frag_surf (xlt_IN_35); - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - xl_retval_36 = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = xl_retval_36.xyzw; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - gl_FragData[0] = tmpvar_48; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-out.txt index 484d6e050..da60f62d0 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-out.txt @@ -7,4 +7,4 @@ void main () } -// inputs: 0, stats: 2 alu 0 tex 0 flow +// stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert1-ir.txt deleted file mode 100644 index cca120304..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert1-ir.txt +++ /dev/null @@ -1,84 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - vec3 normal; -}; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec3 tmpvar_3; - tmpvar_3 = vec3(1.0, 0.0, 0.0); - o_2.Emission = tmpvar_3; -} - -vec4 frag_surf ( - in v2f_surf IN_4 -) -{ - vec4 res_5; - Input surfIN_6; - SurfaceOutput o_7; - vec3 tmpvar_8; - tmpvar_8 = vec3(0.0, 0.0, 0.0); - o_7.Albedo = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = vec3(0.0, 0.0, 0.0); - o_7.Emission = tmpvar_9; - float tmpvar_10; - tmpvar_10 = 0.0; - o_7.Specular = tmpvar_10; - float tmpvar_11; - tmpvar_11 = 0.0; - o_7.Alpha = tmpvar_11; - float tmpvar_12; - tmpvar_12 = 0.0; - o_7.Gloss = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13 = IN_4.normal; - o_7.Normal = tmpvar_13; - surf (surfIN_6, o_7); - vec3 tmpvar_14; - tmpvar_14 = ((o_7.Normal * vec3(0.5, 0.5, -0.5)) + 0.5); - res_5.xyz = tmpvar_14.xyz.xyz; - float tmpvar_15; - tmpvar_15 = o_7.Specular; - res_5.w = vec4(tmpvar_15).w; - return res_5; -} - -void main () -{ - v2f_surf xlt_IN_16; - vec4 xl_retval_17; - vec4 tmpvar_18; - tmpvar_18 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_16.pos = tmpvar_18; - vec3 tmpvar_19; - tmpvar_19 = gl_TexCoord[0].xyz; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_19; - xlt_IN_16.normal = tmpvar_20; - vec4 tmpvar_21; - tmpvar_21 = frag_surf (xlt_IN_16); - vec4 tmpvar_22; - tmpvar_22 = tmpvar_21; - xl_retval_17 = tmpvar_22; - vec4 tmpvar_23; - tmpvar_23 = xl_retval_17.xyzw; - vec4 tmpvar_24; - tmpvar_24 = tmpvar_23; - gl_FragData[0] = tmpvar_24; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert1-out.txt index a366de427..811a56224 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert1-out.txt @@ -7,4 +7,6 @@ void main () } -// inputs: 1, stats: 3 alu 0 tex 0 flow +// stats: 3 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-TexGen_Cube_Refl-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-TexGen_Cube_Refl-ir.txt deleted file mode 100644 index db4436cd1..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-TexGen_Cube_Refl-ir.txt +++ /dev/null @@ -1,44 +0,0 @@ -struct v2f { - vec4 vertex; - vec4 color; - vec3 texcoord; -}; -uniform samplerCube _MainTex; -vec4 frag ( - in v2f i_1 -) -{ - vec4 tmpvar_2; - tmpvar_2 = textureCube (_MainTex, i_1.texcoord); - return tmpvar_2; -} - -void main () -{ - v2f xlt_i_3; - vec4 xl_retval_4; - vec4 tmpvar_5; - tmpvar_5 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_3.vertex = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6 = gl_Color.xyzw; - vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - xlt_i_3.color = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = gl_TexCoord[0].xyz; - vec3 tmpvar_9; - tmpvar_9 = tmpvar_8; - xlt_i_3.texcoord = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10 = frag (xlt_i_3); - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - xl_retval_4 = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12 = xl_retval_4.xyzw; - vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - gl_FragData[0] = tmpvar_13; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-TexGen_Cube_Refl-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-TexGen_Cube_Refl-out.txt index 391a87da8..5d1e7ccff 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-TexGen_Cube_Refl-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-TexGen_Cube_Refl-out.txt @@ -5,4 +5,8 @@ void main () } -// inputs: 1, stats: 0 alu 1 tex 0 flow +// stats: 0 alu 1 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// textures: 1 +// #0: _MainTex (high cube) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-ir.txt deleted file mode 100644 index 480e8f972..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-ir.txt +++ /dev/null @@ -1,59 +0,0 @@ -struct v2f { - vec4 pos; - vec2 texcoord; - vec3 cubenormal; -}; -uniform vec4 _Color; -uniform sampler2D _MainTex; -uniform samplerCube _ToonShade; -vec4 frag ( - in v2f i_1 -) -{ - vec4 cube_2; - vec4 col_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, i_1.texcoord); - vec4 tmpvar_5; - tmpvar_5 = (_Color * tmpvar_4); - col_3 = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6 = textureCube (_ToonShade, i_1.cubenormal); - vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - cube_2 = tmpvar_7; - vec4 tmpvar_8; - tmpvar_8.xyz = ((2.0 * cube_2.xyz) * col_3.xyz).xyz; - tmpvar_8.w = col_3.w; - return tmpvar_8; -} - -void main () -{ - v2f xlt_i_9; - vec4 xl_retval_10; - vec4 tmpvar_11; - tmpvar_11 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_9.pos = tmpvar_11; - vec2 tmpvar_12; - tmpvar_12 = gl_TexCoord[0].xy; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_12; - xlt_i_9.texcoord = tmpvar_13; - vec3 tmpvar_14; - tmpvar_14 = gl_TexCoord[1].xyz; - vec3 tmpvar_15; - tmpvar_15 = tmpvar_14; - xlt_i_9.cubenormal = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = frag (xlt_i_9); - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - xl_retval_10 = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = xl_retval_10.xyzw; - vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - gl_FragData[0] = tmpvar_19; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-out.txt index 57c487749..efc242636 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-out.txt @@ -3,13 +3,20 @@ uniform sampler2D _MainTex; uniform samplerCube _ToonShade; void main () { - vec4 tmpvar_1; - tmpvar_1 = (_Color * texture2D (_MainTex, gl_TexCoord[0].xy)); + vec4 col_1; + col_1 = (_Color * texture2D (_MainTex, gl_TexCoord[0].xy)); vec4 tmpvar_2; - tmpvar_2.xyz = ((2.0 * textureCube (_ToonShade, gl_TexCoord[1].xyz).xyz) * tmpvar_1.xyz); - tmpvar_2.w = tmpvar_1.w; + tmpvar_2.xyz = ((2.0 * textureCube (_ToonShade, gl_TexCoord[1].xyz).xyz) * col_1.xyz); + tmpvar_2.w = col_1.w; gl_FragData[0] = tmpvar_2; } -// inputs: 1, stats: 3 alu 2 tex 0 flow +// stats: 3 alu 2 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [2] loc 4 +// uniforms: 1 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// textures: 2 +// #0: _MainTex (high 2d) 0x0 [-1] +// #1: _ToonShade (high cube) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-ir.txt deleted file mode 100644 index 1a094fc2c..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-ir.txt +++ /dev/null @@ -1,163 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec2 _LightCoord; -}; -uniform vec4 _Color; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _MainTex; -uniform sampler2D _Ramp; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_5; - tmpvar_5 = (tmpvar_4 * _Color); - c_3 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = c_3.xyz; - o_2.Albedo = tmpvar_6; - float tmpvar_7; - tmpvar_7 = c_3.w; - o_2.Alpha = tmpvar_7; -} - -vec4 LightingToonRamp ( - in SurfaceOutput s_8, - in vec3 lightDir_9, - in float atten_10 -) -{ - vec4 c_11; - vec3 ramp_12; - float d_13; - float tmpvar_14; - tmpvar_14 = dot (s_8.Normal, lightDir_9); - float tmpvar_15; - tmpvar_15 = ((tmpvar_14 * 0.5) + 0.5); - d_13 = tmpvar_15; - vec2 tmpvar_16; - tmpvar_16.x = d_13; - tmpvar_16.y = d_13; - vec4 tmpvar_17; - tmpvar_17 = texture2D (_Ramp, tmpvar_16); - vec3 tmpvar_18; - tmpvar_18 = tmpvar_17.xyz; - ramp_12 = tmpvar_18; - vec3 tmpvar_19; - tmpvar_19 = (((s_8.Albedo * _LightColor0.xyz) * ramp_12) * (atten_10 * 2.0)); - c_11.xyz = tmpvar_19.xyz.xyz; - float tmpvar_20; - tmpvar_20 = 0.0; - c_11.w = vec4(tmpvar_20).w; - return c_11; -} - -vec4 frag_surf ( - in v2f_surf IN_21 -) -{ - vec4 c_22; - vec3 lightDir_23; - SurfaceOutput o_24; - Input surfIN_25; - vec2 tmpvar_26; - tmpvar_26 = IN_21.hip_pack0.xy; - surfIN_25.uv_MainTex = tmpvar_26; - vec3 tmpvar_27; - tmpvar_27 = vec3(0.0, 0.0, 0.0); - o_24.Albedo = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = vec3(0.0, 0.0, 0.0); - o_24.Emission = tmpvar_28; - float tmpvar_29; - tmpvar_29 = 0.0; - o_24.Specular = tmpvar_29; - float tmpvar_30; - tmpvar_30 = 0.0; - o_24.Alpha = tmpvar_30; - float tmpvar_31; - tmpvar_31 = 0.0; - o_24.Gloss = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = IN_21.normal; - o_24.Normal = tmpvar_32; - surf (surfIN_25, o_24); - vec3 tmpvar_33; - tmpvar_33 = IN_21.lightDir; - lightDir_23 = tmpvar_33; - vec4 tmpvar_34; - tmpvar_34 = texture2D (_LightTexture0, IN_21._LightCoord); - vec4 tmpvar_35; - tmpvar_35 = LightingToonRamp (o_24, lightDir_23, (tmpvar_34.w * 1.0)); - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - c_22 = tmpvar_36; - float tmpvar_37; - tmpvar_37 = 0.0; - c_22.w = vec4(tmpvar_37).w; - return c_22; -} - -void main () -{ - v2f_surf xlt_IN_38; - vec4 xl_retval_39; - vec4 tmpvar_40; - tmpvar_40 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_38.pos = tmpvar_40; - float tmpvar_41; - tmpvar_41 = xlv_FOG.x; - xlt_IN_38.fog = tmpvar_41; - vec2 tmpvar_42; - tmpvar_42 = gl_TexCoord[0].xy; - vec2 tmpvar_43; - tmpvar_43 = tmpvar_42; - xlt_IN_38.hip_pack0 = tmpvar_43; - vec3 tmpvar_44; - tmpvar_44 = gl_TexCoord[1].xyz; - vec3 tmpvar_45; - tmpvar_45 = tmpvar_44; - xlt_IN_38.normal = tmpvar_45; - vec3 tmpvar_46; - tmpvar_46 = gl_TexCoord[2].xyz; - vec3 tmpvar_47; - tmpvar_47 = tmpvar_46; - xlt_IN_38.lightDir = tmpvar_47; - vec2 tmpvar_48; - tmpvar_48 = gl_TexCoord[3].xy; - vec2 tmpvar_49; - tmpvar_49 = tmpvar_48; - xlt_IN_38._LightCoord = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50 = frag_surf (xlt_IN_38); - vec4 tmpvar_51; - tmpvar_51 = tmpvar_50; - xl_retval_39 = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = xl_retval_39.xyzw; - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - gl_FragData[0] = tmpvar_53; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-out.txt index f2ec42ee1..cd69c769d 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-out.txt @@ -19,4 +19,13 @@ void main () } -// inputs: 1, stats: 10 alu 3 tex 0 flow +// stats: 10 alu 3 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// textures: 3 +// #0: _LightTexture0 (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] +// #2: _Ramp (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-ir.txt deleted file mode 100644 index d01d1df51..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-ir.txt +++ /dev/null @@ -1,235 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 lightDir; - vec3 viewDir; - vec3 _LightCoord; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform vec4 _LightColor0; -uniform samplerCube _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -uniform float _Shininess; -uniform vec4 _SpecColor; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -void surf ( - in Input IN_6, - inout SurfaceOutput o_7 -) -{ - vec4 tex_8; - vec4 tmpvar_9; - tmpvar_9 = texture2D (_MainTex, IN_6.uv_MainTex); - vec4 tmpvar_10; - tmpvar_10 = tmpvar_9; - tex_8 = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = (tex_8.xyz * _Color.xyz); - o_7.Albedo = tmpvar_11; - float tmpvar_12; - tmpvar_12 = tex_8.w; - o_7.Gloss = tmpvar_12; - float tmpvar_13; - tmpvar_13 = (tex_8.w * _Color.w); - o_7.Alpha = tmpvar_13; - float tmpvar_14; - tmpvar_14 = _Shininess; - o_7.Specular = tmpvar_14; - vec4 tmpvar_15; - tmpvar_15 = texture2D (_BumpMap, IN_6.uv_BumpMap); - vec4 tmpvar_16; - tmpvar_16 = UnpackNormal (tmpvar_15); - vec3 tmpvar_17; - tmpvar_17 = tmpvar_16.xyz; - vec3 tmpvar_18; - tmpvar_18 = tmpvar_17; - o_7.Normal = tmpvar_18; -} - -vec4 LightingBlinnPhong ( - in SurfaceOutput s_19, - in vec3 lightDir_20, - in vec3 viewDir_21, - in float atten_22 -) -{ - vec4 c_23; - float spec_24; - float nh_25; - float diff_26; - vec3 h_27; - vec3 tmpvar_28; - tmpvar_28 = normalize ((lightDir_20 + viewDir_21)); - vec3 tmpvar_29; - tmpvar_29 = tmpvar_28; - h_27 = tmpvar_29; - float tmpvar_30; - tmpvar_30 = dot (s_19.Normal, lightDir_20); - float tmpvar_31; - tmpvar_31 = max (0.0, tmpvar_30); - float tmpvar_32; - tmpvar_32 = tmpvar_31; - diff_26 = tmpvar_32; - float tmpvar_33; - tmpvar_33 = dot (s_19.Normal, h_27); - float tmpvar_34; - tmpvar_34 = max (0.0, tmpvar_33); - float tmpvar_35; - tmpvar_35 = tmpvar_34; - nh_25 = tmpvar_35; - float tmpvar_36; - tmpvar_36 = pow (nh_25, (s_19.Specular * 128.0)); - float tmpvar_37; - tmpvar_37 = (tmpvar_36 * s_19.Gloss); - spec_24 = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = ((( - (s_19.Albedo * _LightColor0.xyz) - * diff_26) + ( - (_LightColor0.xyz * _SpecColor.xyz) - * spec_24)) * (atten_22 * 2.0)); - c_23.xyz = tmpvar_38.xyz.xyz; - float tmpvar_39; - tmpvar_39 = (s_19.Alpha + (( - (_LightColor0.w * _SpecColor.w) - * spec_24) * atten_22)); - c_23.w = vec4(tmpvar_39).w; - return c_23; -} - -vec4 frag_surf ( - in v2f_surf IN_40 -) -{ - vec4 c_41; - vec3 lightDir_42; - SurfaceOutput o_43; - Input surfIN_44; - vec2 tmpvar_45; - tmpvar_45 = IN_40.hip_pack0.xy; - surfIN_44.uv_MainTex = tmpvar_45; - vec2 tmpvar_46; - tmpvar_46 = IN_40.hip_pack0.zw; - surfIN_44.uv_BumpMap = tmpvar_46; - vec3 tmpvar_47; - tmpvar_47 = vec3(0.0, 0.0, 0.0); - o_43.Albedo = tmpvar_47; - vec3 tmpvar_48; - tmpvar_48 = vec3(0.0, 0.0, 0.0); - o_43.Emission = tmpvar_48; - float tmpvar_49; - tmpvar_49 = 0.0; - o_43.Specular = tmpvar_49; - float tmpvar_50; - tmpvar_50 = 0.0; - o_43.Alpha = tmpvar_50; - float tmpvar_51; - tmpvar_51 = 0.0; - o_43.Gloss = tmpvar_51; - surf (surfIN_44, o_43); - vec3 tmpvar_52; - tmpvar_52 = IN_40.lightDir; - lightDir_42 = tmpvar_52; - vec3 tmpvar_53; - tmpvar_53 = normalize (lightDir_42); - vec3 tmpvar_54; - tmpvar_54 = tmpvar_53; - lightDir_42 = tmpvar_54; - vec3 tmpvar_55; - tmpvar_55 = IN_40.viewDir.xyz; - vec3 tmpvar_56; - tmpvar_56 = normalize (tmpvar_55); - float tmpvar_57; - tmpvar_57 = dot (IN_40._LightCoord, IN_40._LightCoord); - vec2 tmpvar_58; - tmpvar_58 = vec2(tmpvar_57); - vec2 tmpvar_59; - tmpvar_59 = tmpvar_58.xy; - vec4 tmpvar_60; - tmpvar_60 = texture2D (_LightTextureB0, tmpvar_59); - vec4 tmpvar_61; - tmpvar_61 = textureCube (_LightTexture0, IN_40._LightCoord); - vec4 tmpvar_62; - tmpvar_62 = LightingBlinnPhong (o_43, lightDir_42, tmpvar_56, (tmpvar_60.w * tmpvar_61.w)); - vec4 tmpvar_63; - tmpvar_63 = tmpvar_62; - c_41 = tmpvar_63; - float tmpvar_64; - tmpvar_64 = o_43.Alpha; - c_41.w = vec4(tmpvar_64).w; - return c_41; -} - -void main () -{ - v2f_surf xlt_IN_65; - vec4 xl_retval_66; - vec4 tmpvar_67; - tmpvar_67 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_65.pos = tmpvar_67; - float tmpvar_68; - tmpvar_68 = xlv_FOG.x; - xlt_IN_65.fog = tmpvar_68; - vec4 tmpvar_69; - tmpvar_69 = gl_TexCoord[0].xyzw; - vec4 tmpvar_70; - tmpvar_70 = tmpvar_69; - xlt_IN_65.hip_pack0 = tmpvar_70; - vec3 tmpvar_71; - tmpvar_71 = gl_TexCoord[1].xyz; - vec3 tmpvar_72; - tmpvar_72 = tmpvar_71; - xlt_IN_65.lightDir = tmpvar_72; - vec3 tmpvar_73; - tmpvar_73 = gl_TexCoord[2].xyz; - vec3 tmpvar_74; - tmpvar_74 = tmpvar_73; - xlt_IN_65.viewDir = tmpvar_74; - vec3 tmpvar_75; - tmpvar_75 = gl_TexCoord[3].xyz; - vec3 tmpvar_76; - tmpvar_76 = tmpvar_75; - xlt_IN_65._LightCoord = tmpvar_76; - vec4 tmpvar_77; - tmpvar_77 = frag_surf (xlt_IN_65); - vec4 tmpvar_78; - tmpvar_78 = tmpvar_77; - xl_retval_66 = tmpvar_78; - vec4 tmpvar_79; - tmpvar_79 = xl_retval_66.xyzw; - vec4 tmpvar_80; - tmpvar_80 = tmpvar_79; - gl_FragData[0] = tmpvar_80; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-out.txt index fc1baa3c2..16756df44 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-out.txt @@ -13,10 +13,10 @@ void main () vec3 tmpvar_2; tmpvar_2 = gl_TexCoord[3].xyz; vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, tmpvar_1.xy); - float tmpvar_5; - tmpvar_5 = (tmpvar_4.w * _Color.w); + float tmpvar_4; + vec4 tmpvar_5; + tmpvar_5 = texture2D (_MainTex, tmpvar_1.xy); + tmpvar_4 = (tmpvar_5.w * _Color.w); vec4 normal_6; normal_6.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0); normal_6.z = sqrt(((1.0 - @@ -27,24 +27,34 @@ void main () float atten_8; atten_8 = (texture2D (_LightTextureB0, vec2(dot (tmpvar_2, tmpvar_2))).w * textureCube (_LightTexture0, tmpvar_2).w); vec4 c_9; - float tmpvar_10; - tmpvar_10 = (pow (max (0.0, + float spec_10; + spec_10 = (pow (max (0.0, dot (normal_6.xyz, normalize((tmpvar_7 + normalize(gl_TexCoord[2].xyz)))) - ), (_Shininess * 128.0)) * tmpvar_4.w); + ), (_Shininess * 128.0)) * tmpvar_5.w); c_9.xyz = ((( - ((tmpvar_4.xyz * _Color.xyz) * _LightColor0.xyz) + ((tmpvar_5.xyz * _Color.xyz) * _LightColor0.xyz) * max (0.0, dot (normal_6.xyz, tmpvar_7)) ) + ( (_LightColor0.xyz * _SpecColor.xyz) - * tmpvar_10)) * (atten_8 * 2.0)); - c_9.w = (tmpvar_5 + (( - (_LightColor0.w * _SpecColor.w) - * tmpvar_10) * atten_8)); + * spec_10)) * (atten_8 * 2.0)); + c_9.w = (tmpvar_4 + ((_LightColor0.w * _SpecColor.w) * (spec_10 * atten_8))); c_3.xyz = c_9.xyz; - c_3.w = tmpvar_5; + c_3.w = tmpvar_4; gl_FragData[0] = c_3; } -// inputs: 1, stats: 33 alu 4 tex 0 flow +// stats: 33 alu 4 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 4 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _Shininess (high float) 1x1 [-1] +// #3: _SpecColor (high float) 4x1 [-1] +// textures: 4 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _LightTexture0 (high cube) 0x0 [-1] +// #2: _LightTextureB0 (high 2d) 0x0 [-1] +// #3: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-ir.txt deleted file mode 100644 index 1c9ba060a..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-ir.txt +++ /dev/null @@ -1,178 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 lightDir; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform float _Cutoff; -uniform vec4 _LightColor0; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -vec4 UnpackNormal ( - in vec4 packednormal_2 -) -{ - vec4 normal_3; - vec2 tmpvar_4; - tmpvar_4 = ((packednormal_2.wy * 2.0) - 1.0); - normal_3.xy = tmpvar_4.xy.xy; - float tmpvar_5; - tmpvar_5 = sqrt (((1.0 - (normal_3.x * normal_3.x)) - (normal_3.y * normal_3.y))); - float tmpvar_6; - tmpvar_6 = tmpvar_5; - normal_3.z = vec3(tmpvar_6).z; - return normal_3; -} - -void surf ( - in Input IN_7, - inout SurfaceOutput o_8 -) -{ - vec4 c_9; - vec4 tmpvar_10; - tmpvar_10 = texture2D (_MainTex, IN_7.uv_MainTex); - vec4 tmpvar_11; - tmpvar_11 = (tmpvar_10 * _Color); - c_9 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = c_9.xyz; - o_8.Albedo = tmpvar_12; - float tmpvar_13; - tmpvar_13 = c_9.w; - o_8.Alpha = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = texture2D (_BumpMap, IN_7.uv_BumpMap); - vec4 tmpvar_15; - tmpvar_15 = UnpackNormal (tmpvar_14); - vec3 tmpvar_16; - tmpvar_16 = tmpvar_15.xyz; - vec3 tmpvar_17; - tmpvar_17 = tmpvar_16; - o_8.Normal = tmpvar_17; -} - -vec4 LightingLambert ( - in SurfaceOutput s_18, - in vec3 lightDir_19, - in float atten_20 -) -{ - vec4 c_21; - float diff_22; - float tmpvar_23; - tmpvar_23 = dot (s_18.Normal, lightDir_19); - float tmpvar_24; - tmpvar_24 = max (0.0, tmpvar_23); - float tmpvar_25; - tmpvar_25 = tmpvar_24; - diff_22 = tmpvar_25; - vec3 tmpvar_26; - tmpvar_26 = ((s_18.Albedo * _LightColor0.xyz) * ((diff_22 * atten_20) * 2.0)); - c_21.xyz = tmpvar_26.xyz.xyz; - float tmpvar_27; - tmpvar_27 = s_18.Alpha; - c_21.w = vec4(tmpvar_27).w; - return c_21; -} - -vec4 frag_surf ( - in v2f_surf IN_28 -) -{ - vec4 c_29; - vec3 lightDir_30; - SurfaceOutput o_31; - Input surfIN_32; - vec2 tmpvar_33; - tmpvar_33 = IN_28.hip_pack0.xy; - surfIN_32.uv_MainTex = tmpvar_33; - vec2 tmpvar_34; - tmpvar_34 = IN_28.hip_pack0.zw; - surfIN_32.uv_BumpMap = tmpvar_34; - vec3 tmpvar_35; - tmpvar_35 = vec3(0.0, 0.0, 0.0); - o_31.Albedo = tmpvar_35; - vec3 tmpvar_36; - tmpvar_36 = vec3(0.0, 0.0, 0.0); - o_31.Emission = tmpvar_36; - float tmpvar_37; - tmpvar_37 = 0.0; - o_31.Specular = tmpvar_37; - float tmpvar_38; - tmpvar_38 = 0.0; - o_31.Alpha = tmpvar_38; - float tmpvar_39; - tmpvar_39 = 0.0; - o_31.Gloss = tmpvar_39; - surf (surfIN_32, o_31); - xll_clip ((o_31.Alpha - _Cutoff)); - vec3 tmpvar_40; - tmpvar_40 = IN_28.lightDir; - lightDir_30 = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = LightingLambert (o_31, lightDir_30, 1.0); - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - c_29 = tmpvar_42; - float tmpvar_43; - tmpvar_43 = o_31.Alpha; - c_29.w = vec4(tmpvar_43).w; - return c_29; -} - -void main () -{ - v2f_surf xlt_IN_44; - vec4 xl_retval_45; - vec4 tmpvar_46; - tmpvar_46 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_44.pos = tmpvar_46; - float tmpvar_47; - tmpvar_47 = xlv_FOG.x; - xlt_IN_44.fog = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48 = gl_TexCoord[0].xyzw; - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - xlt_IN_44.hip_pack0 = tmpvar_49; - vec3 tmpvar_50; - tmpvar_50 = gl_TexCoord[1].xyz; - vec3 tmpvar_51; - tmpvar_51 = tmpvar_50; - xlt_IN_44.lightDir = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = frag_surf (xlt_IN_44); - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - xl_retval_45 = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54 = xl_retval_45.xyzw; - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - gl_FragData[0] = tmpvar_55; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-out.txt index 4fee2e8d6..7c36831db 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-out.txt @@ -8,29 +8,38 @@ void main () vec4 tmpvar_1; tmpvar_1 = gl_TexCoord[0]; vec4 c_2; - vec4 tmpvar_3; - tmpvar_3 = (texture2D (_MainTex, tmpvar_1.xy) * _Color); - float tmpvar_4; - tmpvar_4 = tmpvar_3.w; + float tmpvar_3; + vec4 c_4; + c_4 = (texture2D (_MainTex, tmpvar_1.xy) * _Color); + tmpvar_3 = c_4.w; vec4 normal_5; normal_5.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0); normal_5.z = sqrt(((1.0 - (normal_5.x * normal_5.x) ) - (normal_5.y * normal_5.y))); float x_6; - x_6 = (tmpvar_3.w - _Cutoff); + x_6 = (c_4.w - _Cutoff); if ((x_6 < 0.0)) { discard; }; vec4 c_7; - c_7.xyz = ((tmpvar_3.xyz * _LightColor0.xyz) * (max (0.0, + c_7.xyz = ((c_4.xyz * _LightColor0.xyz) * (max (0.0, dot (normal_5.xyz, gl_TexCoord[1].xyz) ) * 2.0)); - c_7.w = tmpvar_4; + c_7.w = tmpvar_3; c_2.xyz = c_7.xyz; - c_2.w = tmpvar_4; + c_2.w = tmpvar_3; gl_FragData[0] = c_2; } -// inputs: 1, stats: 15 alu 3 tex 1 flow +// stats: 15 alu 3 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [2] loc 4 +// uniforms: 3 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _Cutoff (high float) 1x1 [-1] +// #2: _LightColor0 (high float) 4x1 [-1] +// textures: 2 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-ir.txt deleted file mode 100644 index 941c43f1e..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-ir.txt +++ /dev/null @@ -1,174 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 hip_screen; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform float _Cutoff; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform vec4 unity_Ambient; -varying vec4 xlv_FOG; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -vec4 UnpackNormal ( - in vec4 packednormal_2 -) -{ - vec4 normal_3; - vec2 tmpvar_4; - tmpvar_4 = ((packednormal_2.wy * 2.0) - 1.0); - normal_3.xy = tmpvar_4.xy.xy; - float tmpvar_5; - tmpvar_5 = sqrt (((1.0 - (normal_3.x * normal_3.x)) - (normal_3.y * normal_3.y))); - float tmpvar_6; - tmpvar_6 = tmpvar_5; - normal_3.z = vec3(tmpvar_6).z; - return normal_3; -} - -void surf ( - in Input IN_7, - inout SurfaceOutput o_8 -) -{ - vec4 c_9; - vec4 tmpvar_10; - tmpvar_10 = texture2D (_MainTex, IN_7.uv_MainTex); - vec4 tmpvar_11; - tmpvar_11 = (tmpvar_10 * _Color); - c_9 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = c_9.xyz; - o_8.Albedo = tmpvar_12; - float tmpvar_13; - tmpvar_13 = c_9.w; - o_8.Alpha = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = texture2D (_BumpMap, IN_7.uv_BumpMap); - vec4 tmpvar_15; - tmpvar_15 = UnpackNormal (tmpvar_14); - vec3 tmpvar_16; - tmpvar_16 = tmpvar_15.xyz; - vec3 tmpvar_17; - tmpvar_17 = tmpvar_16; - o_8.Normal = tmpvar_17; -} - -vec4 LightingLambert_PrePass ( - in SurfaceOutput s_18, - in vec4 light_19 -) -{ - vec4 c_20; - vec3 tmpvar_21; - tmpvar_21 = (s_18.Albedo * light_19.xyz); - c_20.xyz = tmpvar_21.xyz.xyz; - float tmpvar_22; - tmpvar_22 = s_18.Alpha; - c_20.w = vec4(tmpvar_22).w; - return c_20; -} - -vec4 frag_surf ( - in v2f_surf IN_23 -) -{ - vec4 col_24; - vec4 light_25; - SurfaceOutput o_26; - Input surfIN_27; - vec2 tmpvar_28; - tmpvar_28 = IN_23.hip_pack0.xy; - surfIN_27.uv_MainTex = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = vec3(0.0, 0.0, 0.0); - o_26.Albedo = tmpvar_29; - vec3 tmpvar_30; - tmpvar_30 = vec3(0.0, 0.0, 0.0); - o_26.Emission = tmpvar_30; - float tmpvar_31; - tmpvar_31 = 0.0; - o_26.Specular = tmpvar_31; - float tmpvar_32; - tmpvar_32 = 0.0; - o_26.Alpha = tmpvar_32; - float tmpvar_33; - tmpvar_33 = 0.0; - o_26.Gloss = tmpvar_33; - surf (surfIN_27, o_26); - xll_clip ((o_26.Alpha - _Cutoff)); - vec4 tmpvar_34; - tmpvar_34 = texture2DProj (_LightBuffer, IN_23.hip_screen); - vec4 tmpvar_35; - tmpvar_35 = tmpvar_34; - light_25 = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36 = log2 (light_25); - vec4 tmpvar_37; - tmpvar_37 = -(tmpvar_36); - light_25 = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = (light_25.xyz + unity_Ambient.xyz); - light_25.xyz = tmpvar_38.xyz.xyz; - vec4 tmpvar_39; - tmpvar_39 = LightingLambert_PrePass (o_26, light_25); - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - col_24 = tmpvar_40; - return col_24; -} - -void main () -{ - v2f_surf xlt_IN_41; - vec4 xl_retval_42; - vec4 tmpvar_43; - tmpvar_43 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_41.pos = tmpvar_43; - float tmpvar_44; - tmpvar_44 = xlv_FOG.x; - xlt_IN_41.fog = tmpvar_44; - vec2 tmpvar_45; - tmpvar_45 = gl_TexCoord[0].xy; - vec2 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_IN_41.hip_pack0 = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = gl_TexCoord[1].xyzw; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_IN_41.hip_screen = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = frag_surf (xlt_IN_41); - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xl_retval_42 = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = xl_retval_42.xyzw; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - gl_FragData[0] = tmpvar_52; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt index a84d23cb1..8e834b2b1 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt @@ -1,4 +1,3 @@ -uniform sampler2D _BumpMap; uniform vec4 _Color; uniform float _Cutoff; uniform sampler2D _LightBuffer; @@ -7,28 +6,29 @@ uniform vec4 unity_Ambient; void main () { vec4 light_1; - vec2 tmpvar_2; - vec4 tmpvar_3; - tmpvar_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); - vec4 normal_4; - normal_4.xy = ((texture2D (_BumpMap, tmpvar_2).wy * 2.0) - 1.0); - normal_4.z = sqrt(((1.0 - - (normal_4.x * normal_4.x) - ) - (normal_4.y * normal_4.y))); - float x_5; - x_5 = (tmpvar_3.w - _Cutoff); - if ((x_5 < 0.0)) { + vec4 c_2; + c_2 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); + float x_3; + x_3 = (c_2.w - _Cutoff); + if ((x_3 < 0.0)) { discard; }; - vec4 tmpvar_6; - tmpvar_6 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); - light_1.w = tmpvar_6.w; - light_1.xyz = (tmpvar_6.xyz + unity_Ambient.xyz); - vec4 c_7; - c_7.xyz = (tmpvar_3.xyz * light_1.xyz); - c_7.w = tmpvar_3.w; - gl_FragData[0] = c_7; + light_1 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); + light_1.xyz = (light_1.xyz + unity_Ambient.xyz); + vec4 c_4; + c_4.xyz = (c_2.xyz * light_1.xyz); + c_4.w = c_2.w; + gl_FragData[0] = c_4; } -// inputs: 1, stats: 14 alu 4 tex 1 flow +// stats: 7 alu 3 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [2] loc 4 +// uniforms: 3 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _Cutoff (high float) 1x1 [-1] +// #2: unity_Ambient (high float) 4x1 [-1] +// textures: 2 +// #0: _LightBuffer (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-ir.txt deleted file mode 100644 index d2a333323..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-ir.txt +++ /dev/null @@ -1,180 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; -}; -struct v2f_surf { - vec4 pos; - vec4 hip_pack0; - vec3 TtoV0; - vec3 TtoV1; - vec3 TtoV2; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform float _Cutoff; -uniform sampler2D _MainTex; -uniform float _Shininess; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -vec4 UnpackNormal ( - in vec4 packednormal_2 -) -{ - vec4 normal_3; - vec2 tmpvar_4; - tmpvar_4 = ((packednormal_2.wy * 2.0) - 1.0); - normal_3.xy = tmpvar_4.xy.xy; - float tmpvar_5; - tmpvar_5 = sqrt (((1.0 - (normal_3.x * normal_3.x)) - (normal_3.y * normal_3.y))); - float tmpvar_6; - tmpvar_6 = tmpvar_5; - normal_3.z = vec3(tmpvar_6).z; - return normal_3; -} - -void surf ( - in Input IN_7, - inout SurfaceOutput o_8 -) -{ - vec4 tex_9; - vec4 tmpvar_10; - tmpvar_10 = texture2D (_MainTex, IN_7.uv_MainTex); - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - tex_9 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = (tex_9.xyz * _Color.xyz); - o_8.Albedo = tmpvar_12; - float tmpvar_13; - tmpvar_13 = tex_9.w; - o_8.Gloss = tmpvar_13; - float tmpvar_14; - tmpvar_14 = (tex_9.w * _Color.w); - o_8.Alpha = tmpvar_14; - float tmpvar_15; - tmpvar_15 = _Shininess; - o_8.Specular = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = texture2D (_BumpMap, IN_7.uv_BumpMap); - vec4 tmpvar_17; - tmpvar_17 = UnpackNormal (tmpvar_16); - vec3 tmpvar_18; - tmpvar_18 = tmpvar_17.xyz; - vec3 tmpvar_19; - tmpvar_19 = tmpvar_18; - o_8.Normal = tmpvar_19; -} - -vec4 frag_surf ( - in v2f_surf IN_20 -) -{ - vec4 res_21; - vec3 viewN_22; - SurfaceOutput o_23; - Input surfIN_24; - vec2 tmpvar_25; - tmpvar_25 = IN_20.hip_pack0.xy; - surfIN_24.uv_MainTex = tmpvar_25; - vec2 tmpvar_26; - tmpvar_26 = IN_20.hip_pack0.zw; - surfIN_24.uv_BumpMap = tmpvar_26; - vec3 tmpvar_27; - tmpvar_27 = vec3(0.0, 0.0, 0.0); - o_23.Albedo = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = vec3(0.0, 0.0, 0.0); - o_23.Emission = tmpvar_28; - float tmpvar_29; - tmpvar_29 = 0.0; - o_23.Specular = tmpvar_29; - float tmpvar_30; - tmpvar_30 = 0.0; - o_23.Alpha = tmpvar_30; - float tmpvar_31; - tmpvar_31 = 0.0; - o_23.Gloss = tmpvar_31; - surf (surfIN_24, o_23); - xll_clip ((o_23.Alpha - _Cutoff)); - float tmpvar_32; - tmpvar_32 = dot (IN_20.TtoV0, o_23.Normal); - float tmpvar_33; - tmpvar_33 = tmpvar_32; - viewN_22.x = tmpvar_33; - float tmpvar_34; - tmpvar_34 = dot (IN_20.TtoV1, o_23.Normal); - float tmpvar_35; - tmpvar_35 = tmpvar_34; - viewN_22.y = vec2(tmpvar_35).y; - float tmpvar_36; - tmpvar_36 = dot (IN_20.TtoV2, o_23.Normal); - float tmpvar_37; - tmpvar_37 = tmpvar_36; - viewN_22.z = vec3(tmpvar_37).z; - vec3 tmpvar_38; - tmpvar_38 = viewN_22; - o_23.Normal = tmpvar_38; - vec3 tmpvar_39; - tmpvar_39 = ((o_23.Normal * vec3(0.5, 0.5, -0.5)) + 0.5); - res_21.xyz = tmpvar_39.xyz.xyz; - float tmpvar_40; - tmpvar_40 = o_23.Specular; - res_21.w = vec4(tmpvar_40).w; - return res_21; -} - -void main () -{ - v2f_surf xlt_IN_41; - vec4 xl_retval_42; - vec4 tmpvar_43; - tmpvar_43 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_41.pos = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44 = gl_TexCoord[0].xyzw; - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - xlt_IN_41.hip_pack0 = tmpvar_45; - vec3 tmpvar_46; - tmpvar_46 = gl_TexCoord[1].xyz; - vec3 tmpvar_47; - tmpvar_47 = tmpvar_46; - xlt_IN_41.TtoV0 = tmpvar_47; - vec3 tmpvar_48; - tmpvar_48 = gl_TexCoord[2].xyz; - vec3 tmpvar_49; - tmpvar_49 = tmpvar_48; - xlt_IN_41.TtoV1 = tmpvar_49; - vec3 tmpvar_50; - tmpvar_50 = gl_TexCoord[3].xyz; - vec3 tmpvar_51; - tmpvar_51 = tmpvar_50; - xlt_IN_41.TtoV2 = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = frag_surf (xlt_IN_41); - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - xl_retval_42 = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54 = xl_retval_42.xyzw; - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - gl_FragData[0] = tmpvar_55; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-out.txt index 4cdc432e1..f4d18d8b1 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-out.txt @@ -28,4 +28,13 @@ void main () } -// inputs: 1, stats: 15 alu 3 tex 1 flow +// stats: 15 alu 3 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 3 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _Cutoff (high float) 1x1 [-1] +// #2: _Shininess (high float) 1x1 [-1] +// textures: 2 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-ir.txt deleted file mode 100644 index 2fe9ed4a7..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-ir.txt +++ /dev/null @@ -1,186 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec2 uv_BumpMap; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 hip_screen; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform float _Cutoff; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform float _Shininess; -uniform vec4 _SpecColor; -uniform vec4 unity_Ambient; -varying vec4 xlv_FOG; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -vec4 UnpackNormal ( - in vec4 packednormal_2 -) -{ - vec4 normal_3; - vec2 tmpvar_4; - tmpvar_4 = ((packednormal_2.wy * 2.0) - 1.0); - normal_3.xy = tmpvar_4.xy.xy; - float tmpvar_5; - tmpvar_5 = sqrt (((1.0 - (normal_3.x * normal_3.x)) - (normal_3.y * normal_3.y))); - float tmpvar_6; - tmpvar_6 = tmpvar_5; - normal_3.z = vec3(tmpvar_6).z; - return normal_3; -} - -void surf ( - in Input IN_7, - inout SurfaceOutput o_8 -) -{ - vec4 tex_9; - vec4 tmpvar_10; - tmpvar_10 = texture2D (_MainTex, IN_7.uv_MainTex); - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - tex_9 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = (tex_9.xyz * _Color.xyz); - o_8.Albedo = tmpvar_12; - float tmpvar_13; - tmpvar_13 = tex_9.w; - o_8.Gloss = tmpvar_13; - float tmpvar_14; - tmpvar_14 = (tex_9.w * _Color.w); - o_8.Alpha = tmpvar_14; - float tmpvar_15; - tmpvar_15 = _Shininess; - o_8.Specular = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = texture2D (_BumpMap, IN_7.uv_BumpMap); - vec4 tmpvar_17; - tmpvar_17 = UnpackNormal (tmpvar_16); - vec3 tmpvar_18; - tmpvar_18 = tmpvar_17.xyz; - vec3 tmpvar_19; - tmpvar_19 = tmpvar_18; - o_8.Normal = tmpvar_19; -} - -vec4 LightingBlinnPhong_PrePass ( - in SurfaceOutput s_20, - in vec4 light_21 -) -{ - vec4 c_22; - float spec_23; - float tmpvar_24; - tmpvar_24 = (light_21.w * s_20.Gloss); - spec_23 = tmpvar_24; - vec3 tmpvar_25; - tmpvar_25 = ((s_20.Albedo * light_21.xyz) + ((light_21.xyz * _SpecColor.xyz) * spec_23)); - c_22.xyz = tmpvar_25.xyz.xyz; - float tmpvar_26; - tmpvar_26 = (s_20.Alpha + (spec_23 * _SpecColor.w)); - c_22.w = vec4(tmpvar_26).w; - return c_22; -} - -vec4 frag_surf ( - in v2f_surf IN_27 -) -{ - vec4 col_28; - vec4 light_29; - SurfaceOutput o_30; - Input surfIN_31; - vec2 tmpvar_32; - tmpvar_32 = IN_27.hip_pack0.xy; - surfIN_31.uv_MainTex = tmpvar_32; - vec3 tmpvar_33; - tmpvar_33 = vec3(0.0, 0.0, 0.0); - o_30.Albedo = tmpvar_33; - vec3 tmpvar_34; - tmpvar_34 = vec3(0.0, 0.0, 0.0); - o_30.Emission = tmpvar_34; - float tmpvar_35; - tmpvar_35 = 0.0; - o_30.Specular = tmpvar_35; - float tmpvar_36; - tmpvar_36 = 0.0; - o_30.Alpha = tmpvar_36; - float tmpvar_37; - tmpvar_37 = 0.0; - o_30.Gloss = tmpvar_37; - surf (surfIN_31, o_30); - xll_clip ((o_30.Alpha - _Cutoff)); - vec4 tmpvar_38; - tmpvar_38 = texture2DProj (_LightBuffer, IN_27.hip_screen); - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - light_29 = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = log2 (light_29); - vec4 tmpvar_41; - tmpvar_41 = -(tmpvar_40); - light_29 = tmpvar_41; - vec3 tmpvar_42; - tmpvar_42 = (light_29.xyz + unity_Ambient.xyz); - light_29.xyz = tmpvar_42.xyz.xyz; - vec4 tmpvar_43; - tmpvar_43 = LightingBlinnPhong_PrePass (o_30, light_29); - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - col_28 = tmpvar_44; - return col_28; -} - -void main () -{ - v2f_surf xlt_IN_45; - vec4 xl_retval_46; - vec4 tmpvar_47; - tmpvar_47 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_45.pos = tmpvar_47; - float tmpvar_48; - tmpvar_48 = xlv_FOG.x; - xlt_IN_45.fog = tmpvar_48; - vec2 tmpvar_49; - tmpvar_49 = gl_TexCoord[0].xy; - vec2 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_IN_45.hip_pack0 = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = gl_TexCoord[1].xyzw; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - xlt_IN_45.hip_screen = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = frag_surf (xlt_IN_45); - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - xl_retval_46 = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = xl_retval_46.xyzw; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - gl_FragData[0] = tmpvar_56; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-out.txt index 77e5bc48f..b7d4f8142 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-out.txt @@ -1,4 +1,3 @@ -uniform sampler2D _BumpMap; uniform vec4 _Color; uniform float _Cutoff; uniform sampler2D _LightBuffer; @@ -8,32 +7,34 @@ uniform vec4 unity_Ambient; void main () { vec4 light_1; - vec2 tmpvar_2; + float tmpvar_2; vec4 tmpvar_3; tmpvar_3 = texture2D (_MainTex, gl_TexCoord[0].xy); - float tmpvar_4; - tmpvar_4 = (tmpvar_3.w * _Color.w); - vec4 normal_5; - normal_5.xy = ((texture2D (_BumpMap, tmpvar_2).wy * 2.0) - 1.0); - normal_5.z = sqrt(((1.0 - - (normal_5.x * normal_5.x) - ) - (normal_5.y * normal_5.y))); - float x_6; - x_6 = (tmpvar_4 - _Cutoff); - if ((x_6 < 0.0)) { + tmpvar_2 = (tmpvar_3.w * _Color.w); + float x_4; + x_4 = (tmpvar_2 - _Cutoff); + if ((x_4 < 0.0)) { discard; }; - vec4 tmpvar_7; - tmpvar_7 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); - light_1.w = tmpvar_7.w; - light_1.xyz = (tmpvar_7.xyz + unity_Ambient.xyz); - vec4 c_8; - float tmpvar_9; - tmpvar_9 = (tmpvar_7.w * tmpvar_3.w); - c_8.xyz = (((tmpvar_3.xyz * _Color.xyz) * light_1.xyz) + ((light_1.xyz * _SpecColor.xyz) * tmpvar_9)); - c_8.w = (tmpvar_4 + (tmpvar_9 * _SpecColor.w)); - gl_FragData[0] = c_8; + light_1 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); + light_1.xyz = (light_1.xyz + unity_Ambient.xyz); + vec4 c_5; + float spec_6; + spec_6 = (light_1.w * tmpvar_3.w); + c_5.xyz = (((tmpvar_3.xyz * _Color.xyz) * light_1.xyz) + ((light_1.xyz * _SpecColor.xyz) * spec_6)); + c_5.w = (tmpvar_2 + (spec_6 * _SpecColor.w)); + gl_FragData[0] = c_5; } -// inputs: 1, stats: 21 alu 4 tex 1 flow +// stats: 14 alu 3 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [2] loc 4 +// uniforms: 4 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _Cutoff (high float) 1x1 [-1] +// #2: _SpecColor (high float) 4x1 [-1] +// #3: unity_Ambient (high float) 4x1 [-1] +// textures: 2 +// #0: _LightBuffer (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-ir.txt deleted file mode 100644 index 89aa05cb0..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-ir.txt +++ /dev/null @@ -1,200 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec4 _LightCoord; -}; -uniform vec4 _Color; -uniform float _Cutoff; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -void surf ( - in Input IN_2, - inout SurfaceOutput o_3 -) -{ - vec4 c_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, IN_2.uv_MainTex); - vec4 tmpvar_6; - tmpvar_6 = (tmpvar_5 * _Color); - c_4 = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = c_4.xyz; - o_3.Albedo = tmpvar_7; - float tmpvar_8; - tmpvar_8 = c_4.w; - o_3.Alpha = tmpvar_8; -} - -float UnitySpotCookie ( - in vec4 LightCoord_9 -) -{ - vec4 tmpvar_10; - tmpvar_10 = texture2D (_LightTexture0, ((LightCoord_9.xy / LightCoord_9.w) + 0.5)); - return tmpvar_10.w; -} - -float UnitySpotAttenuate ( - in vec3 LightCoord_11 -) -{ - float tmpvar_12; - tmpvar_12 = dot (LightCoord_11, LightCoord_11); - vec2 tmpvar_13; - tmpvar_13 = vec2(tmpvar_12); - vec2 tmpvar_14; - tmpvar_14 = tmpvar_13.xy; - vec4 tmpvar_15; - tmpvar_15 = texture2D (_LightTextureB0, tmpvar_14); - return tmpvar_15.w; -} - -vec4 LightingLambert ( - in SurfaceOutput s_16, - in vec3 lightDir_17, - in float atten_18 -) -{ - vec4 c_19; - float diff_20; - float tmpvar_21; - tmpvar_21 = dot (s_16.Normal, lightDir_17); - float tmpvar_22; - tmpvar_22 = max (0.0, tmpvar_21); - float tmpvar_23; - tmpvar_23 = tmpvar_22; - diff_20 = tmpvar_23; - vec3 tmpvar_24; - tmpvar_24 = ((s_16.Albedo * _LightColor0.xyz) * ((diff_20 * atten_18) * 2.0)); - c_19.xyz = tmpvar_24.xyz.xyz; - float tmpvar_25; - tmpvar_25 = s_16.Alpha; - c_19.w = vec4(tmpvar_25).w; - return c_19; -} - -vec4 frag_surf ( - in v2f_surf IN_26 -) -{ - vec4 c_27; - vec3 lightDir_28; - SurfaceOutput o_29; - Input surfIN_30; - vec2 tmpvar_31; - tmpvar_31 = IN_26.hip_pack0.xy; - surfIN_30.uv_MainTex = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = vec3(0.0, 0.0, 0.0); - o_29.Albedo = tmpvar_32; - vec3 tmpvar_33; - tmpvar_33 = vec3(0.0, 0.0, 0.0); - o_29.Emission = tmpvar_33; - float tmpvar_34; - tmpvar_34 = 0.0; - o_29.Specular = tmpvar_34; - float tmpvar_35; - tmpvar_35 = 0.0; - o_29.Alpha = tmpvar_35; - float tmpvar_36; - tmpvar_36 = 0.0; - o_29.Gloss = tmpvar_36; - vec3 tmpvar_37; - tmpvar_37 = IN_26.normal; - o_29.Normal = tmpvar_37; - surf (surfIN_30, o_29); - xll_clip ((o_29.Alpha - _Cutoff)); - vec3 tmpvar_38; - tmpvar_38 = IN_26.lightDir; - lightDir_28 = tmpvar_38; - vec3 tmpvar_39; - tmpvar_39 = normalize (lightDir_28); - vec3 tmpvar_40; - tmpvar_40 = tmpvar_39; - lightDir_28 = tmpvar_40; - float tmpvar_41; - tmpvar_41 = UnitySpotCookie (IN_26._LightCoord); - float tmpvar_42; - tmpvar_42 = UnitySpotAttenuate (IN_26._LightCoord.xyz); - vec4 tmpvar_43; - tmpvar_43 = LightingLambert (o_29, lightDir_28, ((float( - (IN_26._LightCoord.z > 0.0) - ) * tmpvar_41) * tmpvar_42)); - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - c_27 = tmpvar_44; - float tmpvar_45; - tmpvar_45 = o_29.Alpha; - c_27.w = vec4(tmpvar_45).w; - return c_27; -} - -void main () -{ - v2f_surf xlt_IN_46; - vec4 xl_retval_47; - vec4 tmpvar_48; - tmpvar_48 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_46.pos = tmpvar_48; - float tmpvar_49; - tmpvar_49 = xlv_FOG.x; - xlt_IN_46.fog = tmpvar_49; - vec2 tmpvar_50; - tmpvar_50 = gl_TexCoord[0].xy; - vec2 tmpvar_51; - tmpvar_51 = tmpvar_50; - xlt_IN_46.hip_pack0 = tmpvar_51; - vec3 tmpvar_52; - tmpvar_52 = gl_TexCoord[1].xyz; - vec3 tmpvar_53; - tmpvar_53 = tmpvar_52; - xlt_IN_46.normal = tmpvar_53; - vec3 tmpvar_54; - tmpvar_54 = gl_TexCoord[2].xyz; - vec3 tmpvar_55; - tmpvar_55 = tmpvar_54; - xlt_IN_46.lightDir = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = gl_TexCoord[3].xyzw; - vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - xlt_IN_46._LightCoord = tmpvar_57; - vec4 tmpvar_58; - tmpvar_58 = frag_surf (xlt_IN_46); - vec4 tmpvar_59; - tmpvar_59 = tmpvar_58; - xl_retval_47 = tmpvar_59; - vec4 tmpvar_60; - tmpvar_60 = xl_retval_47.xyzw; - vec4 tmpvar_61; - tmpvar_61 = tmpvar_60; - gl_FragData[0] = tmpvar_61; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-out.txt index 3894f7fb8..d8a3d4d56 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-out.txt @@ -9,26 +9,36 @@ void main () vec4 tmpvar_1; tmpvar_1 = gl_TexCoord[3]; vec4 c_2; - vec4 tmpvar_3; - tmpvar_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); - float tmpvar_4; - tmpvar_4 = tmpvar_3.w; + float tmpvar_3; + vec4 c_4; + c_4 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); + tmpvar_3 = c_4.w; float x_5; - x_5 = (tmpvar_3.w - _Cutoff); + x_5 = (c_4.w - _Cutoff); if ((x_5 < 0.0)) { discard; }; vec4 c_6; - c_6.xyz = ((tmpvar_3.xyz * _LightColor0.xyz) * (( + c_6.xyz = ((c_4.xyz * _LightColor0.xyz) * (( max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) * ((float((tmpvar_1.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_1.xy / tmpvar_1.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_1.xyz, tmpvar_1.xyz))).w) ) * 2.0)); - c_6.w = tmpvar_4; + c_6.w = tmpvar_3; c_2.xyz = c_6.xyz; - c_2.w = tmpvar_4; + c_2.w = tmpvar_3; gl_FragData[0] = c_2; } -// inputs: 1, stats: 17 alu 4 tex 1 flow +// stats: 17 alu 4 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 3 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _Cutoff (high float) 1x1 [-1] +// #2: _LightColor0 (high float) 4x1 [-1] +// textures: 3 +// #0: _LightTexture0 (high 2d) 0x0 [-1] +// #1: _LightTextureB0 (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-ir.txt deleted file mode 100644 index cbe62c1e4..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-ir.txt +++ /dev/null @@ -1,202 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec3 viewDir; -}; -uniform vec4 _Color; -uniform float _Cutoff; -uniform vec4 _LightColor0; -uniform sampler2D _MainTex; -uniform float _Shininess; -uniform vec4 _SpecColor; -varying vec4 xlv_FOG; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -void surf ( - in Input IN_2, - inout SurfaceOutput o_3 -) -{ - vec4 tex_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, IN_2.uv_MainTex); - vec4 tmpvar_6; - tmpvar_6 = tmpvar_5; - tex_4 = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = (tex_4.xyz * _Color.xyz); - o_3.Albedo = tmpvar_7; - float tmpvar_8; - tmpvar_8 = tex_4.w; - o_3.Gloss = tmpvar_8; - float tmpvar_9; - tmpvar_9 = (tex_4.w * _Color.w); - o_3.Alpha = tmpvar_9; - float tmpvar_10; - tmpvar_10 = _Shininess; - o_3.Specular = tmpvar_10; -} - -vec4 LightingBlinnPhong ( - in SurfaceOutput s_11, - in vec3 lightDir_12, - in vec3 viewDir_13, - in float atten_14 -) -{ - vec4 c_15; - float spec_16; - float nh_17; - float diff_18; - vec3 h_19; - vec3 tmpvar_20; - tmpvar_20 = normalize ((lightDir_12 + viewDir_13)); - vec3 tmpvar_21; - tmpvar_21 = tmpvar_20; - h_19 = tmpvar_21; - float tmpvar_22; - tmpvar_22 = dot (s_11.Normal, lightDir_12); - float tmpvar_23; - tmpvar_23 = max (0.0, tmpvar_22); - float tmpvar_24; - tmpvar_24 = tmpvar_23; - diff_18 = tmpvar_24; - float tmpvar_25; - tmpvar_25 = dot (s_11.Normal, h_19); - float tmpvar_26; - tmpvar_26 = max (0.0, tmpvar_25); - float tmpvar_27; - tmpvar_27 = tmpvar_26; - nh_17 = tmpvar_27; - float tmpvar_28; - tmpvar_28 = pow (nh_17, (s_11.Specular * 128.0)); - float tmpvar_29; - tmpvar_29 = (tmpvar_28 * s_11.Gloss); - spec_16 = tmpvar_29; - vec3 tmpvar_30; - tmpvar_30 = ((( - (s_11.Albedo * _LightColor0.xyz) - * diff_18) + ( - (_LightColor0.xyz * _SpecColor.xyz) - * spec_16)) * (atten_14 * 2.0)); - c_15.xyz = tmpvar_30.xyz.xyz; - float tmpvar_31; - tmpvar_31 = (s_11.Alpha + (( - (_LightColor0.w * _SpecColor.w) - * spec_16) * atten_14)); - c_15.w = vec4(tmpvar_31).w; - return c_15; -} - -vec4 frag_surf ( - in v2f_surf IN_32 -) -{ - vec4 c_33; - vec3 lightDir_34; - SurfaceOutput o_35; - Input surfIN_36; - vec2 tmpvar_37; - tmpvar_37 = IN_32.hip_pack0.xy; - surfIN_36.uv_MainTex = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = vec3(0.0, 0.0, 0.0); - o_35.Albedo = tmpvar_38; - vec3 tmpvar_39; - tmpvar_39 = vec3(0.0, 0.0, 0.0); - o_35.Emission = tmpvar_39; - float tmpvar_40; - tmpvar_40 = 0.0; - o_35.Specular = tmpvar_40; - float tmpvar_41; - tmpvar_41 = 0.0; - o_35.Alpha = tmpvar_41; - float tmpvar_42; - tmpvar_42 = 0.0; - o_35.Gloss = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = IN_32.normal; - o_35.Normal = tmpvar_43; - surf (surfIN_36, o_35); - xll_clip ((o_35.Alpha - _Cutoff)); - vec3 tmpvar_44; - tmpvar_44 = IN_32.lightDir; - lightDir_34 = tmpvar_44; - vec3 tmpvar_45; - tmpvar_45 = IN_32.viewDir.xyz; - vec3 tmpvar_46; - tmpvar_46 = normalize (tmpvar_45); - vec4 tmpvar_47; - tmpvar_47 = LightingBlinnPhong (o_35, lightDir_34, tmpvar_46, 1.0); - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - c_33 = tmpvar_48; - float tmpvar_49; - tmpvar_49 = o_35.Alpha; - c_33.w = vec4(tmpvar_49).w; - return c_33; -} - -void main () -{ - v2f_surf xlt_IN_50; - vec4 xl_retval_51; - vec4 tmpvar_52; - tmpvar_52 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_50.pos = tmpvar_52; - float tmpvar_53; - tmpvar_53 = xlv_FOG.x; - xlt_IN_50.fog = tmpvar_53; - vec2 tmpvar_54; - tmpvar_54 = gl_TexCoord[0].xy; - vec2 tmpvar_55; - tmpvar_55 = tmpvar_54; - xlt_IN_50.hip_pack0 = tmpvar_55; - vec3 tmpvar_56; - tmpvar_56 = gl_TexCoord[1].xyz; - vec3 tmpvar_57; - tmpvar_57 = tmpvar_56; - xlt_IN_50.normal = tmpvar_57; - vec3 tmpvar_58; - tmpvar_58 = gl_TexCoord[2].xyz; - vec3 tmpvar_59; - tmpvar_59 = tmpvar_58; - xlt_IN_50.lightDir = tmpvar_59; - vec3 tmpvar_60; - tmpvar_60 = gl_TexCoord[3].xyz; - vec3 tmpvar_61; - tmpvar_61 = tmpvar_60; - xlt_IN_50.viewDir = tmpvar_61; - vec4 tmpvar_62; - tmpvar_62 = frag_surf (xlt_IN_50); - vec4 tmpvar_63; - tmpvar_63 = tmpvar_62; - xl_retval_51 = tmpvar_63; - vec4 tmpvar_64; - tmpvar_64 = xl_retval_51.xyzw; - vec4 tmpvar_65; - tmpvar_65 = tmpvar_64; - gl_FragData[0] = tmpvar_65; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-out.txt index cabc40043..10445ee97 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-out.txt @@ -11,32 +11,42 @@ void main () vec3 tmpvar_2; tmpvar_2 = gl_TexCoord[2].xyz; vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, gl_TexCoord[0].xy); - float tmpvar_5; - tmpvar_5 = (tmpvar_4.w * _Color.w); + float tmpvar_4; + vec4 tmpvar_5; + tmpvar_5 = texture2D (_MainTex, gl_TexCoord[0].xy); + tmpvar_4 = (tmpvar_5.w * _Color.w); float x_6; - x_6 = (tmpvar_5 - _Cutoff); + x_6 = (tmpvar_4 - _Cutoff); if ((x_6 < 0.0)) { discard; }; vec4 c_7; - float tmpvar_8; - tmpvar_8 = (pow (max (0.0, + float spec_8; + spec_8 = (pow (max (0.0, dot (tmpvar_1, normalize((tmpvar_2 + normalize(gl_TexCoord[3].xyz)))) - ), (_Shininess * 128.0)) * tmpvar_4.w); + ), (_Shininess * 128.0)) * tmpvar_5.w); c_7.xyz = ((( - ((tmpvar_4.xyz * _Color.xyz) * _LightColor0.xyz) + ((tmpvar_5.xyz * _Color.xyz) * _LightColor0.xyz) * max (0.0, dot (tmpvar_1, tmpvar_2)) ) + ( (_LightColor0.xyz * _SpecColor.xyz) - * tmpvar_8)) * 2.0); - c_7.w = (tmpvar_5 + ((_LightColor0.w * _SpecColor.w) * tmpvar_8)); + * spec_8)) * 2.0); + c_7.w = (tmpvar_4 + ((_LightColor0.w * _SpecColor.w) * spec_8)); c_3.xyz = c_7.xyz; - c_3.w = tmpvar_5; + c_3.w = tmpvar_4; gl_FragData[0] = c_3; } -// inputs: 1, stats: 23 alu 2 tex 1 flow +// stats: 23 alu 2 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 5 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _Cutoff (high float) 1x1 [-1] +// #2: _LightColor0 (high float) 4x1 [-1] +// #3: _Shininess (high float) 1x1 [-1] +// #4: _SpecColor (high float) 4x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-ir.txt deleted file mode 100644 index 27e0f51f0..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-ir.txt +++ /dev/null @@ -1,225 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec3 viewDir; - vec3 _LightCoord; -}; -uniform vec4 _Color; -uniform float _Cutoff; -uniform vec4 _LightColor0; -uniform samplerCube _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -uniform float _Shininess; -uniform vec4 _SpecColor; -varying vec4 xlv_FOG; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -void surf ( - in Input IN_2, - inout SurfaceOutput o_3 -) -{ - vec4 tex_4; - vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, IN_2.uv_MainTex); - vec4 tmpvar_6; - tmpvar_6 = tmpvar_5; - tex_4 = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = (tex_4.xyz * _Color.xyz); - o_3.Albedo = tmpvar_7; - float tmpvar_8; - tmpvar_8 = tex_4.w; - o_3.Gloss = tmpvar_8; - float tmpvar_9; - tmpvar_9 = (tex_4.w * _Color.w); - o_3.Alpha = tmpvar_9; - float tmpvar_10; - tmpvar_10 = _Shininess; - o_3.Specular = tmpvar_10; -} - -vec4 LightingBlinnPhong ( - in SurfaceOutput s_11, - in vec3 lightDir_12, - in vec3 viewDir_13, - in float atten_14 -) -{ - vec4 c_15; - float spec_16; - float nh_17; - float diff_18; - vec3 h_19; - vec3 tmpvar_20; - tmpvar_20 = normalize ((lightDir_12 + viewDir_13)); - vec3 tmpvar_21; - tmpvar_21 = tmpvar_20; - h_19 = tmpvar_21; - float tmpvar_22; - tmpvar_22 = dot (s_11.Normal, lightDir_12); - float tmpvar_23; - tmpvar_23 = max (0.0, tmpvar_22); - float tmpvar_24; - tmpvar_24 = tmpvar_23; - diff_18 = tmpvar_24; - float tmpvar_25; - tmpvar_25 = dot (s_11.Normal, h_19); - float tmpvar_26; - tmpvar_26 = max (0.0, tmpvar_25); - float tmpvar_27; - tmpvar_27 = tmpvar_26; - nh_17 = tmpvar_27; - float tmpvar_28; - tmpvar_28 = pow (nh_17, (s_11.Specular * 128.0)); - float tmpvar_29; - tmpvar_29 = (tmpvar_28 * s_11.Gloss); - spec_16 = tmpvar_29; - vec3 tmpvar_30; - tmpvar_30 = ((( - (s_11.Albedo * _LightColor0.xyz) - * diff_18) + ( - (_LightColor0.xyz * _SpecColor.xyz) - * spec_16)) * (atten_14 * 2.0)); - c_15.xyz = tmpvar_30.xyz.xyz; - float tmpvar_31; - tmpvar_31 = (s_11.Alpha + (( - (_LightColor0.w * _SpecColor.w) - * spec_16) * atten_14)); - c_15.w = vec4(tmpvar_31).w; - return c_15; -} - -vec4 frag_surf ( - in v2f_surf IN_32 -) -{ - vec4 c_33; - vec3 lightDir_34; - SurfaceOutput o_35; - Input surfIN_36; - vec2 tmpvar_37; - tmpvar_37 = IN_32.hip_pack0.xy; - surfIN_36.uv_MainTex = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = vec3(0.0, 0.0, 0.0); - o_35.Albedo = tmpvar_38; - vec3 tmpvar_39; - tmpvar_39 = vec3(0.0, 0.0, 0.0); - o_35.Emission = tmpvar_39; - float tmpvar_40; - tmpvar_40 = 0.0; - o_35.Specular = tmpvar_40; - float tmpvar_41; - tmpvar_41 = 0.0; - o_35.Alpha = tmpvar_41; - float tmpvar_42; - tmpvar_42 = 0.0; - o_35.Gloss = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = IN_32.normal; - o_35.Normal = tmpvar_43; - surf (surfIN_36, o_35); - xll_clip ((o_35.Alpha - _Cutoff)); - vec3 tmpvar_44; - tmpvar_44 = IN_32.lightDir; - lightDir_34 = tmpvar_44; - vec3 tmpvar_45; - tmpvar_45 = normalize (lightDir_34); - vec3 tmpvar_46; - tmpvar_46 = tmpvar_45; - lightDir_34 = tmpvar_46; - vec3 tmpvar_47; - tmpvar_47 = IN_32.viewDir.xyz; - vec3 tmpvar_48; - tmpvar_48 = normalize (tmpvar_47); - float tmpvar_49; - tmpvar_49 = dot (IN_32._LightCoord, IN_32._LightCoord); - vec2 tmpvar_50; - tmpvar_50 = vec2(tmpvar_49); - vec2 tmpvar_51; - tmpvar_51 = tmpvar_50.xy; - vec4 tmpvar_52; - tmpvar_52 = texture2D (_LightTextureB0, tmpvar_51); - vec4 tmpvar_53; - tmpvar_53 = textureCube (_LightTexture0, IN_32._LightCoord); - vec4 tmpvar_54; - tmpvar_54 = LightingBlinnPhong (o_35, lightDir_34, tmpvar_48, (tmpvar_52.w * tmpvar_53.w)); - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - c_33 = tmpvar_55; - float tmpvar_56; - tmpvar_56 = o_35.Alpha; - c_33.w = vec4(tmpvar_56).w; - return c_33; -} - -void main () -{ - v2f_surf xlt_IN_57; - vec4 xl_retval_58; - vec4 tmpvar_59; - tmpvar_59 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_57.pos = tmpvar_59; - float tmpvar_60; - tmpvar_60 = xlv_FOG.x; - xlt_IN_57.fog = tmpvar_60; - vec2 tmpvar_61; - tmpvar_61 = gl_TexCoord[0].xy; - vec2 tmpvar_62; - tmpvar_62 = tmpvar_61; - xlt_IN_57.hip_pack0 = tmpvar_62; - vec3 tmpvar_63; - tmpvar_63 = gl_TexCoord[1].xyz; - vec3 tmpvar_64; - tmpvar_64 = tmpvar_63; - xlt_IN_57.normal = tmpvar_64; - vec3 tmpvar_65; - tmpvar_65 = gl_TexCoord[2].xyz; - vec3 tmpvar_66; - tmpvar_66 = tmpvar_65; - xlt_IN_57.lightDir = tmpvar_66; - vec3 tmpvar_67; - tmpvar_67 = gl_TexCoord[3].xyz; - vec3 tmpvar_68; - tmpvar_68 = tmpvar_67; - xlt_IN_57.viewDir = tmpvar_68; - vec3 tmpvar_69; - tmpvar_69 = gl_TexCoord[4].xyz; - vec3 tmpvar_70; - tmpvar_70 = tmpvar_69; - xlt_IN_57._LightCoord = tmpvar_70; - vec4 tmpvar_71; - tmpvar_71 = frag_surf (xlt_IN_57); - vec4 tmpvar_72; - tmpvar_72 = tmpvar_71; - xl_retval_58 = tmpvar_72; - vec4 tmpvar_73; - tmpvar_73 = xl_retval_58.xyzw; - vec4 tmpvar_74; - tmpvar_74 = tmpvar_73; - gl_FragData[0] = tmpvar_74; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-out.txt index ec1a1e4e0..57cea66fc 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-out.txt @@ -13,12 +13,12 @@ void main () vec3 tmpvar_2; tmpvar_2 = gl_TexCoord[4].xyz; vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, gl_TexCoord[0].xy); - float tmpvar_5; - tmpvar_5 = (tmpvar_4.w * _Color.w); + float tmpvar_4; + vec4 tmpvar_5; + tmpvar_5 = texture2D (_MainTex, gl_TexCoord[0].xy); + tmpvar_4 = (tmpvar_5.w * _Color.w); float x_6; - x_6 = (tmpvar_5 - _Cutoff); + x_6 = (tmpvar_4 - _Cutoff); if ((x_6 < 0.0)) { discard; }; @@ -27,24 +27,34 @@ void main () float atten_8; atten_8 = (texture2D (_LightTextureB0, vec2(dot (tmpvar_2, tmpvar_2))).w * textureCube (_LightTexture0, tmpvar_2).w); vec4 c_9; - float tmpvar_10; - tmpvar_10 = (pow (max (0.0, + float spec_10; + spec_10 = (pow (max (0.0, dot (tmpvar_1, normalize((tmpvar_7 + normalize(gl_TexCoord[3].xyz)))) - ), (_Shininess * 128.0)) * tmpvar_4.w); + ), (_Shininess * 128.0)) * tmpvar_5.w); c_9.xyz = ((( - ((tmpvar_4.xyz * _Color.xyz) * _LightColor0.xyz) + ((tmpvar_5.xyz * _Color.xyz) * _LightColor0.xyz) * max (0.0, dot (tmpvar_1, tmpvar_7)) ) + ( (_LightColor0.xyz * _SpecColor.xyz) - * tmpvar_10)) * (atten_8 * 2.0)); - c_9.w = (tmpvar_5 + (( - (_LightColor0.w * _SpecColor.w) - * tmpvar_10) * atten_8)); + * spec_10)) * (atten_8 * 2.0)); + c_9.w = (tmpvar_4 + ((_LightColor0.w * _SpecColor.w) * (spec_10 * atten_8))); c_3.xyz = c_9.xyz; - c_3.w = tmpvar_5; + c_3.w = tmpvar_4; gl_FragData[0] = c_3; } -// inputs: 1, stats: 28 alu 4 tex 1 flow +// stats: 28 alu 4 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [5] loc 4 +// uniforms: 5 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _Cutoff (high float) 1x1 [-1] +// #2: _LightColor0 (high float) 4x1 [-1] +// #3: _Shininess (high float) 1x1 [-1] +// #4: _SpecColor (high float) 4x1 [-1] +// textures: 3 +// #0: _LightTexture0 (high cube) 0x0 [-1] +// #1: _LightTextureB0 (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-ir.txt deleted file mode 100644 index b8e7d9a77..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-ir.txt +++ /dev/null @@ -1,304 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 hip_screen; - vec3 hip_lmapFade; -}; -uniform vec4 _Color; -uniform float _Cutoff; -uniform sampler2D _LightBuffer; -uniform sampler2D _MainTex; -uniform float _Shininess; -uniform vec4 _SpecColor; -uniform sampler2D unity_Lightmap; -uniform sampler2D unity_LightmapInd; -varying vec4 xlv_FOG; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -float xll_saturate ( - in float x_2 -) -{ - float tmpvar_3; - tmpvar_3 = clamp (x_2, 0.0, 1.0); - return tmpvar_3; -} - -vec2 xll_saturate ( - in vec2 x_4 -) -{ - vec2 tmpvar_5; - tmpvar_5 = clamp (x_4, 0.0, 1.0); - return tmpvar_5; -} - -vec3 xll_saturate ( - in vec3 x_6 -) -{ - vec3 tmpvar_7; - tmpvar_7 = clamp (x_6, 0.0, 1.0); - return tmpvar_7; -} - -vec4 xll_saturate ( - in vec4 x_8 -) -{ - vec4 tmpvar_9; - tmpvar_9 = clamp (x_8, 0.0, 1.0); - return tmpvar_9; -} - -mat2 xll_saturate ( - in mat2 m_10 -) -{ - vec2 tmpvar_11; - tmpvar_11 = clamp (m_10[0], 0.0, 1.0); - vec2 tmpvar_12; - tmpvar_12 = clamp (m_10[1], 0.0, 1.0); - mat2 tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_13[0] = tmpvar_14; - vec2 tmpvar_15; - tmpvar_15 = tmpvar_12; - tmpvar_13[1] = tmpvar_15; - return tmpvar_13; -} - -mat3 xll_saturate ( - in mat3 m_16 -) -{ - vec3 tmpvar_17; - tmpvar_17 = clamp (m_16[0], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_16[1], 0.0, 1.0); - vec3 tmpvar_19; - tmpvar_19 = clamp (m_16[2], 0.0, 1.0); - mat3 tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_20[0] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_20[1] = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = tmpvar_19; - tmpvar_20[2] = tmpvar_23; - return tmpvar_20; -} - -mat4 xll_saturate ( - in mat4 m_24 -) -{ - vec4 tmpvar_25; - tmpvar_25 = clamp (m_24[0], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_24[1], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_24[2], 0.0, 1.0); - vec4 tmpvar_28; - tmpvar_28 = clamp (m_24[3], 0.0, 1.0); - mat4 tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_29[0] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_29[1] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_29[2] = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_28; - tmpvar_29[3] = tmpvar_33; - return tmpvar_29; -} - -void surf ( - in Input IN_34, - inout SurfaceOutput o_35 -) -{ - vec4 tex_36; - vec4 tmpvar_37; - tmpvar_37 = texture2D (_MainTex, IN_34.uv_MainTex); - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - tex_36 = tmpvar_38; - vec3 tmpvar_39; - tmpvar_39 = (tex_36.xyz * _Color.xyz); - o_35.Albedo = tmpvar_39; - float tmpvar_40; - tmpvar_40 = tex_36.w; - o_35.Gloss = tmpvar_40; - float tmpvar_41; - tmpvar_41 = (tex_36.w * _Color.w); - o_35.Alpha = tmpvar_41; - float tmpvar_42; - tmpvar_42 = _Shininess; - o_35.Specular = tmpvar_42; -} - -vec4 LightingBlinnPhong_PrePass ( - in SurfaceOutput s_43, - in vec4 light_44 -) -{ - vec4 c_45; - float spec_46; - float tmpvar_47; - tmpvar_47 = (light_44.w * s_43.Gloss); - spec_46 = tmpvar_47; - vec3 tmpvar_48; - tmpvar_48 = ((s_43.Albedo * light_44.xyz) + ((light_44.xyz * _SpecColor.xyz) * spec_46)); - c_45.xyz = tmpvar_48.xyz.xyz; - float tmpvar_49; - tmpvar_49 = (s_43.Alpha + (spec_46 * _SpecColor.w)); - c_45.w = vec4(tmpvar_49).w; - return c_45; -} - -vec3 DecodeLightmap ( - in vec4 color_50 -) -{ - return (2.0 * color_50.xyz); -} - -vec4 frag_surf ( - in v2f_surf IN_51 -) -{ - vec4 col_52; - vec3 lm_53; - vec3 lmIndirect_54; - vec3 lmFull_55; - vec4 light_56; - SurfaceOutput o_57; - Input surfIN_58; - vec2 tmpvar_59; - tmpvar_59 = IN_51.hip_pack0.xy; - surfIN_58.uv_MainTex = tmpvar_59; - vec3 tmpvar_60; - tmpvar_60 = vec3(0.0, 0.0, 0.0); - o_57.Albedo = tmpvar_60; - vec3 tmpvar_61; - tmpvar_61 = vec3(0.0, 0.0, 0.0); - o_57.Emission = tmpvar_61; - float tmpvar_62; - tmpvar_62 = 0.0; - o_57.Specular = tmpvar_62; - float tmpvar_63; - tmpvar_63 = 0.0; - o_57.Alpha = tmpvar_63; - float tmpvar_64; - tmpvar_64 = 0.0; - o_57.Gloss = tmpvar_64; - surf (surfIN_58, o_57); - xll_clip ((o_57.Alpha - _Cutoff)); - vec4 tmpvar_65; - tmpvar_65 = texture2DProj (_LightBuffer, IN_51.hip_screen); - vec4 tmpvar_66; - tmpvar_66 = tmpvar_65; - light_56 = tmpvar_66; - vec4 tmpvar_67; - tmpvar_67 = log2 (light_56); - vec4 tmpvar_68; - tmpvar_68 = -(tmpvar_67); - light_56 = tmpvar_68; - vec4 tmpvar_69; - tmpvar_69 = texture2D (unity_Lightmap, IN_51.hip_lmapFade.xy); - vec3 tmpvar_70; - tmpvar_70 = DecodeLightmap (tmpvar_69); - vec3 tmpvar_71; - tmpvar_71 = tmpvar_70; - lmFull_55 = tmpvar_71; - vec4 tmpvar_72; - tmpvar_72 = texture2D (unity_LightmapInd, IN_51.hip_lmapFade.xy); - vec3 tmpvar_73; - tmpvar_73 = DecodeLightmap (tmpvar_72); - vec3 tmpvar_74; - tmpvar_74 = tmpvar_73; - lmIndirect_54 = tmpvar_74; - float tmpvar_75; - tmpvar_75 = xll_saturate (IN_51.hip_lmapFade.z); - vec3 tmpvar_76; - tmpvar_76 = vec3(tmpvar_75); - vec3 tmpvar_77; - tmpvar_77 = mix (lmIndirect_54, lmFull_55, tmpvar_76); - vec3 tmpvar_78; - tmpvar_78 = tmpvar_77; - lm_53 = tmpvar_78; - vec3 tmpvar_79; - tmpvar_79 = (light_56.xyz + lm_53); - light_56.xyz = tmpvar_79.xyz.xyz; - vec4 tmpvar_80; - tmpvar_80 = LightingBlinnPhong_PrePass (o_57, light_56); - vec4 tmpvar_81; - tmpvar_81 = tmpvar_80; - col_52 = tmpvar_81; - return col_52; -} - -void main () -{ - v2f_surf xlt_IN_82; - vec4 xl_retval_83; - vec4 tmpvar_84; - tmpvar_84 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_82.pos = tmpvar_84; - float tmpvar_85; - tmpvar_85 = xlv_FOG.x; - xlt_IN_82.fog = tmpvar_85; - vec2 tmpvar_86; - tmpvar_86 = gl_TexCoord[0].xy; - vec2 tmpvar_87; - tmpvar_87 = tmpvar_86; - xlt_IN_82.hip_pack0 = tmpvar_87; - vec4 tmpvar_88; - tmpvar_88 = gl_TexCoord[1].xyzw; - vec4 tmpvar_89; - tmpvar_89 = tmpvar_88; - xlt_IN_82.hip_screen = tmpvar_89; - vec3 tmpvar_90; - tmpvar_90 = gl_TexCoord[2].xyz; - vec3 tmpvar_91; - tmpvar_91 = tmpvar_90; - xlt_IN_82.hip_lmapFade = tmpvar_91; - vec4 tmpvar_92; - tmpvar_92 = frag_surf (xlt_IN_82); - vec4 tmpvar_93; - tmpvar_93 = tmpvar_92; - xl_retval_83 = tmpvar_93; - vec4 tmpvar_94; - tmpvar_94 = xl_retval_83.xyzw; - vec4 tmpvar_95; - tmpvar_95 = tmpvar_94; - gl_FragData[0] = tmpvar_95; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-out.txt index 60fea62d7..1ec0d4a0f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-out.txt @@ -10,26 +10,35 @@ void main () vec3 tmpvar_1; tmpvar_1 = gl_TexCoord[2].xyz; vec4 light_2; - vec4 tmpvar_3; - tmpvar_3 = texture2D (_MainTex, gl_TexCoord[0].xy); - float tmpvar_4; - tmpvar_4 = (tmpvar_3.w * _Color.w); + float tmpvar_3; + vec4 tmpvar_4; + tmpvar_4 = texture2D (_MainTex, gl_TexCoord[0].xy); + tmpvar_3 = (tmpvar_4.w * _Color.w); float x_5; - x_5 = (tmpvar_4 - _Cutoff); + x_5 = (tmpvar_3 - _Cutoff); if ((x_5 < 0.0)) { discard; }; - vec4 tmpvar_6; - tmpvar_6 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); - light_2.w = tmpvar_6.w; - light_2.xyz = (tmpvar_6.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_1.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_1.xy).xyz), vec3(clamp (tmpvar_1.z, 0.0, 1.0)))); - vec4 c_7; - float tmpvar_8; - tmpvar_8 = (tmpvar_6.w * tmpvar_3.w); - c_7.xyz = (((tmpvar_3.xyz * _Color.xyz) * light_2.xyz) + ((light_2.xyz * _SpecColor.xyz) * tmpvar_8)); - c_7.w = (tmpvar_4 + (tmpvar_8 * _SpecColor.w)); - gl_FragData[0] = c_7; + light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); + light_2.xyz = (light_2.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_1.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_1.xy).xyz), vec3(clamp (tmpvar_1.z, 0.0, 1.0)))); + vec4 c_6; + float spec_7; + spec_7 = (light_2.w * tmpvar_4.w); + c_6.xyz = (((tmpvar_4.xyz * _Color.xyz) * light_2.xyz) + ((light_2.xyz * _SpecColor.xyz) * spec_7)); + c_6.w = (tmpvar_3 + (spec_7 * _SpecColor.w)); + gl_FragData[0] = c_6; } -// inputs: 1, stats: 18 alu 5 tex 1 flow +// stats: 18 alu 5 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 3 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _Cutoff (high float) 1x1 [-1] +// #2: _SpecColor (high float) 4x1 [-1] +// textures: 4 +// #0: _LightBuffer (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] +// #2: unity_Lightmap (high 2d) 0x0 [-1] +// #3: unity_LightmapInd (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-ir.txt deleted file mode 100644 index 562e47169..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-ir.txt +++ /dev/null @@ -1,169 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec3 _LightCoord; -}; -uniform vec4 _Color; -uniform vec4 _LightColor0; -uniform samplerCube _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_5; - tmpvar_5 = (tmpvar_4 * _Color); - c_3 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = c_3.xyz; - o_2.Albedo = tmpvar_6; - float tmpvar_7; - tmpvar_7 = c_3.w; - o_2.Alpha = tmpvar_7; -} - -vec4 LightingLambert ( - in SurfaceOutput s_8, - in vec3 lightDir_9, - in float atten_10 -) -{ - vec4 c_11; - float diff_12; - float tmpvar_13; - tmpvar_13 = dot (s_8.Normal, lightDir_9); - float tmpvar_14; - tmpvar_14 = max (0.0, tmpvar_13); - float tmpvar_15; - tmpvar_15 = tmpvar_14; - diff_12 = tmpvar_15; - vec3 tmpvar_16; - tmpvar_16 = ((s_8.Albedo * _LightColor0.xyz) * ((diff_12 * atten_10) * 2.0)); - c_11.xyz = tmpvar_16.xyz.xyz; - float tmpvar_17; - tmpvar_17 = s_8.Alpha; - c_11.w = vec4(tmpvar_17).w; - return c_11; -} - -vec4 frag_surf ( - in v2f_surf IN_18 -) -{ - vec4 c_19; - vec3 lightDir_20; - SurfaceOutput o_21; - Input surfIN_22; - vec2 tmpvar_23; - tmpvar_23 = IN_18.hip_pack0.xy; - surfIN_22.uv_MainTex = tmpvar_23; - vec3 tmpvar_24; - tmpvar_24 = vec3(0.0, 0.0, 0.0); - o_21.Albedo = tmpvar_24; - vec3 tmpvar_25; - tmpvar_25 = vec3(0.0, 0.0, 0.0); - o_21.Emission = tmpvar_25; - float tmpvar_26; - tmpvar_26 = 0.0; - o_21.Specular = tmpvar_26; - float tmpvar_27; - tmpvar_27 = 0.0; - o_21.Alpha = tmpvar_27; - float tmpvar_28; - tmpvar_28 = 0.0; - o_21.Gloss = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = IN_18.normal; - o_21.Normal = tmpvar_29; - surf (surfIN_22, o_21); - vec3 tmpvar_30; - tmpvar_30 = IN_18.lightDir; - lightDir_20 = tmpvar_30; - vec3 tmpvar_31; - tmpvar_31 = normalize (lightDir_20); - vec3 tmpvar_32; - tmpvar_32 = tmpvar_31; - lightDir_20 = tmpvar_32; - float tmpvar_33; - tmpvar_33 = dot (IN_18._LightCoord, IN_18._LightCoord); - vec2 tmpvar_34; - tmpvar_34 = vec2(tmpvar_33); - vec2 tmpvar_35; - tmpvar_35 = tmpvar_34.xy; - vec4 tmpvar_36; - tmpvar_36 = texture2D (_LightTextureB0, tmpvar_35); - vec4 tmpvar_37; - tmpvar_37 = textureCube (_LightTexture0, IN_18._LightCoord); - vec4 tmpvar_38; - tmpvar_38 = LightingLambert (o_21, lightDir_20, (tmpvar_36.w * tmpvar_37.w)); - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - c_19 = tmpvar_39; - float tmpvar_40; - tmpvar_40 = o_21.Alpha; - c_19.w = vec4(tmpvar_40).w; - return c_19; -} - -void main () -{ - v2f_surf xlt_IN_41; - vec4 xl_retval_42; - vec4 tmpvar_43; - tmpvar_43 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_41.pos = tmpvar_43; - float tmpvar_44; - tmpvar_44 = xlv_FOG.x; - xlt_IN_41.fog = tmpvar_44; - vec2 tmpvar_45; - tmpvar_45 = gl_TexCoord[0].xy; - vec2 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_IN_41.hip_pack0 = tmpvar_46; - vec3 tmpvar_47; - tmpvar_47 = gl_TexCoord[1].xyz; - vec3 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_IN_41.normal = tmpvar_48; - vec3 tmpvar_49; - tmpvar_49 = gl_TexCoord[2].xyz; - vec3 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_IN_41.lightDir = tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = gl_TexCoord[3].xyz; - vec3 tmpvar_52; - tmpvar_52 = tmpvar_51; - xlt_IN_41._LightCoord = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = frag_surf (xlt_IN_41); - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - xl_retval_42 = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = xl_retval_42.xyzw; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - gl_FragData[0] = tmpvar_56; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-out.txt index 256f8fed3..7d9a98d5a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-out.txt @@ -8,21 +8,30 @@ void main () vec3 tmpvar_1; tmpvar_1 = gl_TexCoord[3].xyz; vec4 c_2; - vec4 tmpvar_3; - tmpvar_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); - float tmpvar_4; - tmpvar_4 = tmpvar_3.w; + float tmpvar_3; + vec4 c_4; + c_4 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); + tmpvar_3 = c_4.w; vec4 c_5; - c_5.xyz = ((tmpvar_3.xyz * _LightColor0.xyz) * (( + c_5.xyz = ((c_4.xyz * _LightColor0.xyz) * (( max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) * (texture2D (_LightTextureB0, vec2(dot (tmpvar_1, tmpvar_1))).w * textureCube (_LightTexture0, tmpvar_1).w) ) * 2.0)); - c_5.w = tmpvar_4; + c_5.w = tmpvar_3; c_2.xyz = c_5.xyz; - c_2.w = tmpvar_4; + c_2.w = tmpvar_3; gl_FragData[0] = c_2; } -// inputs: 1, stats: 10 alu 3 tex 0 flow +// stats: 10 alu 3 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 2 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// textures: 3 +// #0: _LightTexture0 (high cube) 0x0 [-1] +// #1: _LightTextureB0 (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-ir.txt deleted file mode 100644 index c92b30743..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-ir.txt +++ /dev/null @@ -1,200 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec3 viewDir; - vec2 _LightCoord; -}; -uniform vec4 _Color; -uniform vec4 _LightColor0; -uniform sampler2D _LightTexture0; -uniform sampler2D _MainTex; -uniform float _Shininess; -uniform vec4 _SpecColor; -varying vec4 xlv_FOG; -void surf ( - in Input IN_1, - inout SurfaceOutput o_2 -) -{ - vec4 tex_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, IN_1.uv_MainTex); - vec4 tmpvar_5; - tmpvar_5 = tmpvar_4; - tex_3 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = (tex_3.xyz * _Color.xyz); - o_2.Albedo = tmpvar_6; - float tmpvar_7; - tmpvar_7 = tex_3.w; - o_2.Gloss = tmpvar_7; - float tmpvar_8; - tmpvar_8 = (tex_3.w * _Color.w); - o_2.Alpha = tmpvar_8; - float tmpvar_9; - tmpvar_9 = _Shininess; - o_2.Specular = tmpvar_9; -} - -vec4 LightingBlinnPhong ( - in SurfaceOutput s_10, - in vec3 lightDir_11, - in vec3 viewDir_12, - in float atten_13 -) -{ - vec4 c_14; - float spec_15; - float nh_16; - float diff_17; - vec3 h_18; - vec3 tmpvar_19; - tmpvar_19 = normalize ((lightDir_11 + viewDir_12)); - vec3 tmpvar_20; - tmpvar_20 = tmpvar_19; - h_18 = tmpvar_20; - float tmpvar_21; - tmpvar_21 = dot (s_10.Normal, lightDir_11); - float tmpvar_22; - tmpvar_22 = max (0.0, tmpvar_21); - float tmpvar_23; - tmpvar_23 = tmpvar_22; - diff_17 = tmpvar_23; - float tmpvar_24; - tmpvar_24 = dot (s_10.Normal, h_18); - float tmpvar_25; - tmpvar_25 = max (0.0, tmpvar_24); - float tmpvar_26; - tmpvar_26 = tmpvar_25; - nh_16 = tmpvar_26; - float tmpvar_27; - tmpvar_27 = pow (nh_16, (s_10.Specular * 128.0)); - float tmpvar_28; - tmpvar_28 = (tmpvar_27 * s_10.Gloss); - spec_15 = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = ((( - (s_10.Albedo * _LightColor0.xyz) - * diff_17) + ( - (_LightColor0.xyz * _SpecColor.xyz) - * spec_15)) * (atten_13 * 2.0)); - c_14.xyz = tmpvar_29.xyz.xyz; - float tmpvar_30; - tmpvar_30 = (s_10.Alpha + (( - (_LightColor0.w * _SpecColor.w) - * spec_15) * atten_13)); - c_14.w = vec4(tmpvar_30).w; - return c_14; -} - -vec4 frag_surf ( - in v2f_surf IN_31 -) -{ - vec4 c_32; - vec3 lightDir_33; - SurfaceOutput o_34; - Input surfIN_35; - vec2 tmpvar_36; - tmpvar_36 = IN_31.hip_pack0.xy; - surfIN_35.uv_MainTex = tmpvar_36; - vec3 tmpvar_37; - tmpvar_37 = vec3(0.0, 0.0, 0.0); - o_34.Albedo = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = vec3(0.0, 0.0, 0.0); - o_34.Emission = tmpvar_38; - float tmpvar_39; - tmpvar_39 = 0.0; - o_34.Specular = tmpvar_39; - float tmpvar_40; - tmpvar_40 = 0.0; - o_34.Alpha = tmpvar_40; - float tmpvar_41; - tmpvar_41 = 0.0; - o_34.Gloss = tmpvar_41; - vec3 tmpvar_42; - tmpvar_42 = IN_31.normal; - o_34.Normal = tmpvar_42; - surf (surfIN_35, o_34); - vec3 tmpvar_43; - tmpvar_43 = IN_31.lightDir; - lightDir_33 = tmpvar_43; - vec3 tmpvar_44; - tmpvar_44 = IN_31.viewDir.xyz; - vec3 tmpvar_45; - tmpvar_45 = normalize (tmpvar_44); - vec4 tmpvar_46; - tmpvar_46 = texture2D (_LightTexture0, IN_31._LightCoord); - vec4 tmpvar_47; - tmpvar_47 = LightingBlinnPhong (o_34, lightDir_33, tmpvar_45, (tmpvar_46.w * 1.0)); - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - c_32 = tmpvar_48; - float tmpvar_49; - tmpvar_49 = o_34.Alpha; - c_32.w = vec4(tmpvar_49).w; - return c_32; -} - -void main () -{ - v2f_surf xlt_IN_50; - vec4 xl_retval_51; - vec4 tmpvar_52; - tmpvar_52 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_50.pos = tmpvar_52; - float tmpvar_53; - tmpvar_53 = xlv_FOG.x; - xlt_IN_50.fog = tmpvar_53; - vec2 tmpvar_54; - tmpvar_54 = gl_TexCoord[0].xy; - vec2 tmpvar_55; - tmpvar_55 = tmpvar_54; - xlt_IN_50.hip_pack0 = tmpvar_55; - vec3 tmpvar_56; - tmpvar_56 = gl_TexCoord[1].xyz; - vec3 tmpvar_57; - tmpvar_57 = tmpvar_56; - xlt_IN_50.normal = tmpvar_57; - vec3 tmpvar_58; - tmpvar_58 = gl_TexCoord[2].xyz; - vec3 tmpvar_59; - tmpvar_59 = tmpvar_58; - xlt_IN_50.lightDir = tmpvar_59; - vec3 tmpvar_60; - tmpvar_60 = gl_TexCoord[3].xyz; - vec3 tmpvar_61; - tmpvar_61 = tmpvar_60; - xlt_IN_50.viewDir = tmpvar_61; - vec2 tmpvar_62; - tmpvar_62 = gl_TexCoord[4].xy; - vec2 tmpvar_63; - tmpvar_63 = tmpvar_62; - xlt_IN_50._LightCoord = tmpvar_63; - vec4 tmpvar_64; - tmpvar_64 = frag_surf (xlt_IN_50); - vec4 tmpvar_65; - tmpvar_65 = tmpvar_64; - xl_retval_51 = tmpvar_65; - vec4 tmpvar_66; - tmpvar_66 = xl_retval_51.xyzw; - vec4 tmpvar_67; - tmpvar_67 = tmpvar_66; - gl_FragData[0] = tmpvar_67; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-out.txt index 5cd633137..aef012342 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-out.txt @@ -11,31 +11,39 @@ void main () vec3 tmpvar_2; tmpvar_2 = gl_TexCoord[2].xyz; vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, gl_TexCoord[0].xy); - float tmpvar_5; - tmpvar_5 = (tmpvar_4.w * _Color.w); + float tmpvar_4; + vec4 tmpvar_5; + tmpvar_5 = texture2D (_MainTex, gl_TexCoord[0].xy); + tmpvar_4 = (tmpvar_5.w * _Color.w); float atten_6; atten_6 = texture2D (_LightTexture0, gl_TexCoord[4].xy).w; vec4 c_7; - float tmpvar_8; - tmpvar_8 = (pow (max (0.0, + float spec_8; + spec_8 = (pow (max (0.0, dot (tmpvar_1, normalize((tmpvar_2 + normalize(gl_TexCoord[3].xyz)))) - ), (_Shininess * 128.0)) * tmpvar_4.w); + ), (_Shininess * 128.0)) * tmpvar_5.w); c_7.xyz = ((( - ((tmpvar_4.xyz * _Color.xyz) * _LightColor0.xyz) + ((tmpvar_5.xyz * _Color.xyz) * _LightColor0.xyz) * max (0.0, dot (tmpvar_1, tmpvar_2)) ) + ( (_LightColor0.xyz * _SpecColor.xyz) - * tmpvar_8)) * (atten_6 * 2.0)); - c_7.w = (tmpvar_5 + (( - (_LightColor0.w * _SpecColor.w) - * tmpvar_8) * atten_6)); + * spec_8)) * (atten_6 * 2.0)); + c_7.w = (tmpvar_4 + ((_LightColor0.w * _SpecColor.w) * (spec_8 * atten_6))); c_3.xyz = c_7.xyz; - c_3.w = tmpvar_5; + c_3.w = tmpvar_4; gl_FragData[0] = c_3; } -// inputs: 1, stats: 23 alu 2 tex 0 flow +// stats: 23 alu 2 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [5] loc 4 +// uniforms: 4 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _Shininess (high float) 1x1 [-1] +// #3: _SpecColor (high float) 4x1 [-1] +// textures: 2 +// #0: _LightTexture0 (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-ir.txt deleted file mode 100644 index 2af2fd621..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-ir.txt +++ /dev/null @@ -1,162 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; - vec3 color; - vec3 backContrib; - vec3 nl; - vec3 nh; -}; -uniform sampler2D _BumpSpecMap; -uniform float _Cutoff; -uniform sampler2D _MainTex; -uniform vec4 _SpecColor; -uniform vec4 _TerrainTreeLightColors[4]; -uniform vec3 _TranslucencyColor; -uniform sampler2D _TranslucencyMap; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -vec4 frag ( - in v2f i_2 -) -{ - vec4 c_3; - float spec_4; - float nh_5; - float nl_6; - vec3 translucencyColor_7; - vec3 lightColor_8; - int j_9; - vec3 backContribs_10; - vec3 light_11; - float gloss_12; - vec4 trngls_13; - float specular_14; - vec3 albedo_15; - vec4 col_16; - int tmpvar_17; - tmpvar_17 = 0; - j_9 = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = texture2D (_MainTex, i_2.uv); - vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - col_16 = tmpvar_19; - xll_clip ((col_16.w - _Cutoff)); - vec3 tmpvar_20; - tmpvar_20 = (col_16.xyz * i_2.color); - albedo_15 = tmpvar_20; - vec4 tmpvar_21; - tmpvar_21 = texture2D (_BumpSpecMap, i_2.uv); - float tmpvar_22; - tmpvar_22 = (tmpvar_21.x * 128.0); - specular_14 = tmpvar_22; - vec4 tmpvar_23; - tmpvar_23 = texture2D (_TranslucencyMap, i_2.uv); - vec4 tmpvar_24; - tmpvar_24 = tmpvar_23; - trngls_13 = tmpvar_24; - float tmpvar_25; - tmpvar_25 = trngls_13.w; - gloss_12 = tmpvar_25; - vec3 tmpvar_26; - tmpvar_26 = gl_LightModel.ambient.xyz; - vec3 tmpvar_27; - tmpvar_27 = (tmpvar_26 * albedo_15); - light_11 = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = (i_2.backContrib * trngls_13.z); - backContribs_10 = tmpvar_28; - while (true) { - if (!((j_9 < 3))) { - break; - }; - vec3 tmpvar_29; - tmpvar_29 = _TerrainTreeLightColors[j_9].xyz; - lightColor_8 = tmpvar_29; - vec3 tmpvar_30; - tmpvar_30 = (backContribs_10[j_9] * _TranslucencyColor); - translucencyColor_7 = tmpvar_30; - float tmpvar_31; - tmpvar_31 = i_2.nl[j_9]; - nl_6 = tmpvar_31; - float tmpvar_32; - tmpvar_32 = i_2.nh[j_9]; - nh_5 = tmpvar_32; - float tmpvar_33; - tmpvar_33 = pow (nh_5, specular_14); - float tmpvar_34; - tmpvar_34 = (tmpvar_33 * gloss_12); - spec_4 = tmpvar_34; - vec3 tmpvar_35; - tmpvar_35 = (light_11 + (( - (albedo_15 * (translucencyColor_7 + nl_6)) - + - (_SpecColor.xyz * spec_4) - ) * lightColor_8)); - light_11 = tmpvar_35; - int _post_incdec_tmp_36; - _post_incdec_tmp_36 = j_9; - int tmpvar_37; - tmpvar_37 = (j_9 + 1); - j_9 = tmpvar_37; - }; - vec3 tmpvar_38; - tmpvar_38 = (light_11 * 2.0); - c_3.xyz = tmpvar_38.xyz.xyz; - float tmpvar_39; - tmpvar_39 = 1.0; - c_3.w = vec4(tmpvar_39).w; - return c_3; -} - -void main () -{ - v2f xlt_i_40; - vec4 xl_retval_41; - vec4 tmpvar_42; - tmpvar_42 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_40.pos = tmpvar_42; - vec2 tmpvar_43; - tmpvar_43 = gl_TexCoord[0].xy; - vec2 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_i_40.uv = tmpvar_44; - vec3 tmpvar_45; - tmpvar_45 = gl_TexCoord[1].xyz; - vec3 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_i_40.color = tmpvar_46; - vec3 tmpvar_47; - tmpvar_47 = gl_TexCoord[2].xyz; - vec3 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_i_40.backContrib = tmpvar_48; - vec3 tmpvar_49; - tmpvar_49 = gl_TexCoord[3].xyz; - vec3 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_i_40.nl = tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = gl_TexCoord[4].xyz; - vec3 tmpvar_52; - tmpvar_52 = tmpvar_51; - xlt_i_40.nh = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = frag (xlt_i_40); - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - xl_retval_41 = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = xl_retval_41.xyzw; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - gl_FragData[0] = tmpvar_56; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-out.txt index a5f5a229a..5e6420a9a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-out.txt @@ -17,32 +17,32 @@ void main () vec3 backContribs_5; vec3 light_6; float specular_7; - vec4 tmpvar_8; - tmpvar_8 = texture2D (_MainTex, tmpvar_1); - float x_9; - x_9 = (tmpvar_8.w - _Cutoff); - if ((x_9 < 0.0)) { + vec3 albedo_8; + vec4 tmpvar_9; + tmpvar_9 = texture2D (_MainTex, tmpvar_1); + float x_10; + x_10 = (tmpvar_9.w - _Cutoff); + if ((x_10 < 0.0)) { discard; }; - vec3 tmpvar_10; - tmpvar_10 = (tmpvar_8.xyz * gl_TexCoord[1].xyz); + albedo_8 = (tmpvar_9.xyz * gl_TexCoord[1].xyz); specular_7 = (texture2D (_BumpSpecMap, tmpvar_1).x * 128.0); vec4 tmpvar_11; tmpvar_11 = texture2D (_TranslucencyMap, tmpvar_1); - light_6 = (gl_LightModel.ambient.xyz * tmpvar_10); + light_6 = (gl_LightModel.ambient.xyz * albedo_8); backContribs_5 = (gl_TexCoord[2].xyz * tmpvar_11.z); light_6 = (light_6 + (( - (tmpvar_10 * ((backContribs_5.x * _TranslucencyColor) + tmpvar_2.x)) + (albedo_8 * ((backContribs_5.x * _TranslucencyColor) + tmpvar_2.x)) + (_SpecColor.xyz * (pow (tmpvar_3.x, specular_7) * tmpvar_11.w)) ) * _TerrainTreeLightColors[0].xyz)); light_6 = (light_6 + (( - (tmpvar_10 * ((backContribs_5.y * _TranslucencyColor) + tmpvar_2.y)) + (albedo_8 * ((backContribs_5.y * _TranslucencyColor) + tmpvar_2.y)) + (_SpecColor.xyz * (pow (tmpvar_3.y, specular_7) * tmpvar_11.w)) ) * _TerrainTreeLightColors[1].xyz)); light_6 = (light_6 + (( - (tmpvar_10 * ((backContribs_5.z * _TranslucencyColor) + tmpvar_2.z)) + (albedo_8 * ((backContribs_5.z * _TranslucencyColor) + tmpvar_2.z)) + (_SpecColor.xyz * (pow (tmpvar_3.z, specular_7) * tmpvar_11.w)) ) * _TerrainTreeLightColors[2].xyz)); @@ -52,4 +52,16 @@ void main () } -// inputs: 1, stats: 35 alu 4 tex 1 flow +// stats: 35 alu 4 tex 1 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [5] loc 4 +// uniforms: 5 (total size: 0) +// #0: gl_LightModel (high other) 0x0 [-1] +// #1: _Cutoff (high float) 1x1 [-1] +// #2: _SpecColor (high float) 4x1 [-1] +// #3: _TerrainTreeLightColors (high float) 4x1 [4] +// #4: _TranslucencyColor (high float) 3x1 [-1] +// textures: 3 +// #0: _BumpSpecMap (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] +// #2: _TranslucencyMap (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-ir.txt deleted file mode 100644 index 91f28e873..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-ir.txt +++ /dev/null @@ -1,216 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 lop_color; - vec3 lightDir; - vec3 viewDir; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform sampler2D _GlossMap; -uniform vec4 _LightColor0; -uniform sampler2D _MainTex; -uniform float _Shininess; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -void surf ( - in Input IN_6, - inout SurfaceOutput o_7 -) -{ - vec4 c_8; - vec4 tmpvar_9; - tmpvar_9 = texture2D (_MainTex, IN_6.uv_MainTex); - vec4 tmpvar_10; - tmpvar_10 = tmpvar_9; - c_8 = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = (c_8.xyz * IN_6.color.xyz); - o_7.Albedo = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12 = texture2D (_GlossMap, IN_6.uv_MainTex); - float tmpvar_13; - tmpvar_13 = tmpvar_12.w; - o_7.Gloss = tmpvar_13; - float tmpvar_14; - tmpvar_14 = _Color.w; - o_7.Alpha = tmpvar_14; - float tmpvar_15; - tmpvar_15 = _Shininess; - o_7.Specular = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = texture2D (_BumpMap, IN_6.uv_MainTex); - vec4 tmpvar_17; - tmpvar_17 = UnpackNormal (tmpvar_16); - vec3 tmpvar_18; - tmpvar_18 = tmpvar_17.xyz; - vec3 tmpvar_19; - tmpvar_19 = tmpvar_18; - o_7.Normal = tmpvar_19; -} - -vec4 LightingTreeBark ( - in SurfaceOutput s_20, - in vec3 lightDir_21, - in vec3 viewDir_22, - in float atten_23 -) -{ - vec4 c_24; - float spec_25; - float nh_26; - float diff_27; - vec3 h_28; - vec3 tmpvar_29; - tmpvar_29 = normalize ((lightDir_21 + viewDir_22)); - vec3 tmpvar_30; - tmpvar_30 = tmpvar_29; - h_28 = tmpvar_30; - float tmpvar_31; - tmpvar_31 = dot (s_20.Normal, lightDir_21); - float tmpvar_32; - tmpvar_32 = max (0.0, tmpvar_31); - float tmpvar_33; - tmpvar_33 = tmpvar_32; - diff_27 = tmpvar_33; - float tmpvar_34; - tmpvar_34 = dot (s_20.Normal, h_28); - float tmpvar_35; - tmpvar_35 = max (0.0, tmpvar_34); - float tmpvar_36; - tmpvar_36 = tmpvar_35; - nh_26 = tmpvar_36; - float tmpvar_37; - tmpvar_37 = pow (nh_26, (s_20.Specular * 128.0)); - float tmpvar_38; - tmpvar_38 = (tmpvar_37 * s_20.Gloss); - spec_25 = tmpvar_38; - vec3 tmpvar_39; - tmpvar_39 = ((( - (s_20.Albedo * _LightColor0.xyz) - * diff_27) + (_LightColor0.xyz * spec_25)) * (atten_23 * 2.0)); - c_24.xyz = tmpvar_39.xyz.xyz; - float tmpvar_40; - tmpvar_40 = (((_LightColor0.w * spec_25) * atten_23) * s_20.Alpha); - c_24.w = vec4(tmpvar_40).w; - return c_24; -} - -vec4 frag_surf ( - in v2f_surf IN_41 -) -{ - vec4 c_42; - vec3 lightDir_43; - SurfaceOutput o_44; - Input surfIN_45; - vec2 tmpvar_46; - tmpvar_46 = IN_41.hip_pack0.xy; - surfIN_45.uv_MainTex = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = IN_41.lop_color; - surfIN_45.color = tmpvar_47; - vec3 tmpvar_48; - tmpvar_48 = vec3(0.0, 0.0, 0.0); - o_44.Albedo = tmpvar_48; - vec3 tmpvar_49; - tmpvar_49 = vec3(0.0, 0.0, 0.0); - o_44.Emission = tmpvar_49; - float tmpvar_50; - tmpvar_50 = 0.0; - o_44.Specular = tmpvar_50; - float tmpvar_51; - tmpvar_51 = 0.0; - o_44.Alpha = tmpvar_51; - float tmpvar_52; - tmpvar_52 = 0.0; - o_44.Gloss = tmpvar_52; - surf (surfIN_45, o_44); - vec3 tmpvar_53; - tmpvar_53 = IN_41.lightDir; - lightDir_43 = tmpvar_53; - vec3 tmpvar_54; - tmpvar_54 = IN_41.viewDir.xyz; - vec3 tmpvar_55; - tmpvar_55 = normalize (tmpvar_54); - vec4 tmpvar_56; - tmpvar_56 = LightingTreeBark (o_44, lightDir_43, tmpvar_55, 1.0); - vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - c_42 = tmpvar_57; - float tmpvar_58; - tmpvar_58 = 0.0; - c_42.w = vec4(tmpvar_58).w; - return c_42; -} - -void main () -{ - v2f_surf xlt_IN_59; - vec4 xl_retval_60; - vec4 tmpvar_61; - tmpvar_61 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_59.pos = tmpvar_61; - float tmpvar_62; - tmpvar_62 = xlv_FOG.x; - xlt_IN_59.fog = tmpvar_62; - vec2 tmpvar_63; - tmpvar_63 = gl_TexCoord[0].xy; - vec2 tmpvar_64; - tmpvar_64 = tmpvar_63; - xlt_IN_59.hip_pack0 = tmpvar_64; - vec4 tmpvar_65; - tmpvar_65 = gl_Color.xyzw; - vec4 tmpvar_66; - tmpvar_66 = tmpvar_65; - xlt_IN_59.lop_color = tmpvar_66; - vec3 tmpvar_67; - tmpvar_67 = gl_TexCoord[1].xyz; - vec3 tmpvar_68; - tmpvar_68 = tmpvar_67; - xlt_IN_59.lightDir = tmpvar_68; - vec3 tmpvar_69; - tmpvar_69 = gl_TexCoord[2].xyz; - vec3 tmpvar_70; - tmpvar_70 = tmpvar_69; - xlt_IN_59.viewDir = tmpvar_70; - vec4 tmpvar_71; - tmpvar_71 = frag_surf (xlt_IN_59); - vec4 tmpvar_72; - tmpvar_72 = tmpvar_71; - xl_retval_60 = tmpvar_72; - vec4 tmpvar_73; - tmpvar_73 = xl_retval_60.xyzw; - vec4 tmpvar_74; - tmpvar_74 = tmpvar_73; - gl_FragData[0] = tmpvar_74; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-out.txt index 692b27e27..198989055 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-out.txt @@ -17,20 +17,31 @@ void main () (normal_4.x * normal_4.x) ) - (normal_4.y * normal_4.y))); vec4 c_5; - float tmpvar_6; - tmpvar_6 = (pow (max (0.0, + float spec_6; + spec_6 = (pow (max (0.0, dot (normal_4.xyz, normalize((tmpvar_2 + normalize(gl_TexCoord[2].xyz)))) ), (_Shininess * 128.0)) * texture2D (_GlossMap, tmpvar_1).w); c_5.xyz = ((( ((texture2D (_MainTex, tmpvar_1).xyz * gl_Color.xyz) * _LightColor0.xyz) * max (0.0, dot (normal_4.xyz, tmpvar_2)) - ) + (_LightColor0.xyz * tmpvar_6)) * 2.0); - c_5.w = ((_LightColor0.w * tmpvar_6) * _Color.w); + ) + (_LightColor0.xyz * spec_6)) * 2.0); + c_5.w = ((_LightColor0.w * spec_6) * _Color.w); c_3.xyz = c_5.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } -// inputs: 2, stats: 26 alu 3 tex 0 flow +// stats: 26 alu 3 tex 0 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [3] loc 4 +// uniforms: 3 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _Shininess (high float) 1x1 [-1] +// textures: 3 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _GlossMap (high 2d) 0x0 [-1] +// #2: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-ir.txt deleted file mode 100644 index 53fd1ae95..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-ir.txt +++ /dev/null @@ -1,239 +0,0 @@ -struct SurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 lop_color; - vec3 lightDir; - vec3 viewDir; - vec3 _LightCoord; -}; -uniform sampler2D _BumpMap; -uniform vec4 _Color; -uniform sampler2D _GlossMap; -uniform vec4 _LightColor0; -uniform samplerCube _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -uniform float _Shininess; -varying vec4 xlv_FOG; -vec4 UnpackNormal ( - in vec4 packednormal_1 -) -{ - vec4 normal_2; - vec2 tmpvar_3; - tmpvar_3 = ((packednormal_1.wy * 2.0) - 1.0); - normal_2.xy = tmpvar_3.xy.xy; - float tmpvar_4; - tmpvar_4 = sqrt (((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); - float tmpvar_5; - tmpvar_5 = tmpvar_4; - normal_2.z = vec3(tmpvar_5).z; - return normal_2; -} - -void surf ( - in Input IN_6, - inout SurfaceOutput o_7 -) -{ - vec4 c_8; - vec4 tmpvar_9; - tmpvar_9 = texture2D (_MainTex, IN_6.uv_MainTex); - vec4 tmpvar_10; - tmpvar_10 = tmpvar_9; - c_8 = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = (c_8.xyz * IN_6.color.xyz); - o_7.Albedo = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12 = texture2D (_GlossMap, IN_6.uv_MainTex); - float tmpvar_13; - tmpvar_13 = tmpvar_12.w; - o_7.Gloss = tmpvar_13; - float tmpvar_14; - tmpvar_14 = _Color.w; - o_7.Alpha = tmpvar_14; - float tmpvar_15; - tmpvar_15 = _Shininess; - o_7.Specular = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = texture2D (_BumpMap, IN_6.uv_MainTex); - vec4 tmpvar_17; - tmpvar_17 = UnpackNormal (tmpvar_16); - vec3 tmpvar_18; - tmpvar_18 = tmpvar_17.xyz; - vec3 tmpvar_19; - tmpvar_19 = tmpvar_18; - o_7.Normal = tmpvar_19; -} - -vec4 LightingTreeBark ( - in SurfaceOutput s_20, - in vec3 lightDir_21, - in vec3 viewDir_22, - in float atten_23 -) -{ - vec4 c_24; - float spec_25; - float nh_26; - float diff_27; - vec3 h_28; - vec3 tmpvar_29; - tmpvar_29 = normalize ((lightDir_21 + viewDir_22)); - vec3 tmpvar_30; - tmpvar_30 = tmpvar_29; - h_28 = tmpvar_30; - float tmpvar_31; - tmpvar_31 = dot (s_20.Normal, lightDir_21); - float tmpvar_32; - tmpvar_32 = max (0.0, tmpvar_31); - float tmpvar_33; - tmpvar_33 = tmpvar_32; - diff_27 = tmpvar_33; - float tmpvar_34; - tmpvar_34 = dot (s_20.Normal, h_28); - float tmpvar_35; - tmpvar_35 = max (0.0, tmpvar_34); - float tmpvar_36; - tmpvar_36 = tmpvar_35; - nh_26 = tmpvar_36; - float tmpvar_37; - tmpvar_37 = pow (nh_26, (s_20.Specular * 128.0)); - float tmpvar_38; - tmpvar_38 = (tmpvar_37 * s_20.Gloss); - spec_25 = tmpvar_38; - vec3 tmpvar_39; - tmpvar_39 = ((( - (s_20.Albedo * _LightColor0.xyz) - * diff_27) + (_LightColor0.xyz * spec_25)) * (atten_23 * 2.0)); - c_24.xyz = tmpvar_39.xyz.xyz; - float tmpvar_40; - tmpvar_40 = (((_LightColor0.w * spec_25) * atten_23) * s_20.Alpha); - c_24.w = vec4(tmpvar_40).w; - return c_24; -} - -vec4 frag_surf ( - in v2f_surf IN_41 -) -{ - vec4 c_42; - vec3 lightDir_43; - SurfaceOutput o_44; - Input surfIN_45; - vec2 tmpvar_46; - tmpvar_46 = IN_41.hip_pack0.xy; - surfIN_45.uv_MainTex = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = IN_41.lop_color; - surfIN_45.color = tmpvar_47; - vec3 tmpvar_48; - tmpvar_48 = vec3(0.0, 0.0, 0.0); - o_44.Albedo = tmpvar_48; - vec3 tmpvar_49; - tmpvar_49 = vec3(0.0, 0.0, 0.0); - o_44.Emission = tmpvar_49; - float tmpvar_50; - tmpvar_50 = 0.0; - o_44.Specular = tmpvar_50; - float tmpvar_51; - tmpvar_51 = 0.0; - o_44.Alpha = tmpvar_51; - float tmpvar_52; - tmpvar_52 = 0.0; - o_44.Gloss = tmpvar_52; - surf (surfIN_45, o_44); - vec3 tmpvar_53; - tmpvar_53 = IN_41.lightDir; - lightDir_43 = tmpvar_53; - vec3 tmpvar_54; - tmpvar_54 = normalize (lightDir_43); - vec3 tmpvar_55; - tmpvar_55 = tmpvar_54; - lightDir_43 = tmpvar_55; - vec3 tmpvar_56; - tmpvar_56 = IN_41.viewDir.xyz; - vec3 tmpvar_57; - tmpvar_57 = normalize (tmpvar_56); - float tmpvar_58; - tmpvar_58 = dot (IN_41._LightCoord, IN_41._LightCoord); - vec2 tmpvar_59; - tmpvar_59 = vec2(tmpvar_58); - vec2 tmpvar_60; - tmpvar_60 = tmpvar_59.xy; - vec4 tmpvar_61; - tmpvar_61 = texture2D (_LightTextureB0, tmpvar_60); - vec4 tmpvar_62; - tmpvar_62 = textureCube (_LightTexture0, IN_41._LightCoord); - vec4 tmpvar_63; - tmpvar_63 = LightingTreeBark (o_44, lightDir_43, tmpvar_57, (tmpvar_61.w * tmpvar_62.w)); - vec4 tmpvar_64; - tmpvar_64 = tmpvar_63; - c_42 = tmpvar_64; - float tmpvar_65; - tmpvar_65 = 0.0; - c_42.w = vec4(tmpvar_65).w; - return c_42; -} - -void main () -{ - v2f_surf xlt_IN_66; - vec4 xl_retval_67; - vec4 tmpvar_68; - tmpvar_68 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_66.pos = tmpvar_68; - float tmpvar_69; - tmpvar_69 = xlv_FOG.x; - xlt_IN_66.fog = tmpvar_69; - vec2 tmpvar_70; - tmpvar_70 = gl_TexCoord[0].xy; - vec2 tmpvar_71; - tmpvar_71 = tmpvar_70; - xlt_IN_66.hip_pack0 = tmpvar_71; - vec4 tmpvar_72; - tmpvar_72 = gl_Color.xyzw; - vec4 tmpvar_73; - tmpvar_73 = tmpvar_72; - xlt_IN_66.lop_color = tmpvar_73; - vec3 tmpvar_74; - tmpvar_74 = gl_TexCoord[1].xyz; - vec3 tmpvar_75; - tmpvar_75 = tmpvar_74; - xlt_IN_66.lightDir = tmpvar_75; - vec3 tmpvar_76; - tmpvar_76 = gl_TexCoord[2].xyz; - vec3 tmpvar_77; - tmpvar_77 = tmpvar_76; - xlt_IN_66.viewDir = tmpvar_77; - vec3 tmpvar_78; - tmpvar_78 = gl_TexCoord[3].xyz; - vec3 tmpvar_79; - tmpvar_79 = tmpvar_78; - xlt_IN_66._LightCoord = tmpvar_79; - vec4 tmpvar_80; - tmpvar_80 = frag_surf (xlt_IN_66); - vec4 tmpvar_81; - tmpvar_81 = tmpvar_80; - xl_retval_67 = tmpvar_81; - vec4 tmpvar_82; - tmpvar_82 = xl_retval_67.xyzw; - vec4 tmpvar_83; - tmpvar_83 = tmpvar_82; - gl_FragData[0] = tmpvar_83; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-out.txt index e5bad3d49..7564e8782 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-out.txt @@ -23,20 +23,33 @@ void main () float atten_6; atten_6 = (texture2D (_LightTextureB0, vec2(dot (tmpvar_2, tmpvar_2))).w * textureCube (_LightTexture0, tmpvar_2).w); vec4 c_7; - float tmpvar_8; - tmpvar_8 = (pow (max (0.0, + float spec_8; + spec_8 = (pow (max (0.0, dot (normal_4.xyz, normalize((tmpvar_5 + normalize(gl_TexCoord[2].xyz)))) ), (_Shininess * 128.0)) * texture2D (_GlossMap, tmpvar_1).w); c_7.xyz = ((( ((texture2D (_MainTex, tmpvar_1).xyz * gl_Color.xyz) * _LightColor0.xyz) * max (0.0, dot (normal_4.xyz, tmpvar_5)) - ) + (_LightColor0.xyz * tmpvar_8)) * (atten_6 * 2.0)); - c_7.w = (((_LightColor0.w * tmpvar_8) * atten_6) * _Color.w); + ) + (_LightColor0.xyz * spec_8)) * (atten_6 * 2.0)); + c_7.w = ((_LightColor0.w * spec_8) * (atten_6 * _Color.w)); c_3.xyz = c_7.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } -// inputs: 2, stats: 31 alu 5 tex 0 flow +// stats: 31 alu 5 tex 0 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 3 (total size: 0) +// #0: _Color (high float) 4x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _Shininess (high float) 1x1 [-1] +// textures: 5 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _GlossMap (high 2d) 0x0 [-1] +// #2: _LightTexture0 (high cube) 0x0 [-1] +// #3: _LightTextureB0 (high 2d) 0x0 [-1] +// #4: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-ir.txt deleted file mode 100644 index 2af0965e7..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-ir.txt +++ /dev/null @@ -1,383 +0,0 @@ -struct LeafSurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - vec3 Translucency; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 lop_color; - vec3 lightDir; - vec3 viewDir; - vec3 _LightCoord; -}; -uniform sampler2D _BumpMap; -uniform float _Cutoff; -uniform sampler2D _GlossMap; -uniform vec4 _LightColor0; -uniform samplerCube _LightTexture0; -uniform sampler2D _LightTextureB0; -uniform sampler2D _MainTex; -uniform float _Shininess; -uniform vec4 _TranslucencyColor; -uniform sampler2D _TranslucencyMap; -varying vec4 xlv_FOG; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -float xll_saturate ( - in float x_2 -) -{ - float tmpvar_3; - tmpvar_3 = clamp (x_2, 0.0, 1.0); - return tmpvar_3; -} - -vec2 xll_saturate ( - in vec2 x_4 -) -{ - vec2 tmpvar_5; - tmpvar_5 = clamp (x_4, 0.0, 1.0); - return tmpvar_5; -} - -vec3 xll_saturate ( - in vec3 x_6 -) -{ - vec3 tmpvar_7; - tmpvar_7 = clamp (x_6, 0.0, 1.0); - return tmpvar_7; -} - -vec4 xll_saturate ( - in vec4 x_8 -) -{ - vec4 tmpvar_9; - tmpvar_9 = clamp (x_8, 0.0, 1.0); - return tmpvar_9; -} - -mat2 xll_saturate ( - in mat2 m_10 -) -{ - vec2 tmpvar_11; - tmpvar_11 = clamp (m_10[0], 0.0, 1.0); - vec2 tmpvar_12; - tmpvar_12 = clamp (m_10[1], 0.0, 1.0); - mat2 tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_13[0] = tmpvar_14; - vec2 tmpvar_15; - tmpvar_15 = tmpvar_12; - tmpvar_13[1] = tmpvar_15; - return tmpvar_13; -} - -mat3 xll_saturate ( - in mat3 m_16 -) -{ - vec3 tmpvar_17; - tmpvar_17 = clamp (m_16[0], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_16[1], 0.0, 1.0); - vec3 tmpvar_19; - tmpvar_19 = clamp (m_16[2], 0.0, 1.0); - mat3 tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_20[0] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_20[1] = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = tmpvar_19; - tmpvar_20[2] = tmpvar_23; - return tmpvar_20; -} - -mat4 xll_saturate ( - in mat4 m_24 -) -{ - vec4 tmpvar_25; - tmpvar_25 = clamp (m_24[0], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_24[1], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_24[2], 0.0, 1.0); - vec4 tmpvar_28; - tmpvar_28 = clamp (m_24[3], 0.0, 1.0); - mat4 tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_29[0] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_29[1] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_29[2] = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_28; - tmpvar_29[3] = tmpvar_33; - return tmpvar_29; -} - -vec4 UnpackNormal ( - in vec4 packednormal_34 -) -{ - vec4 normal_35; - vec2 tmpvar_36; - tmpvar_36 = ((packednormal_34.wy * 2.0) - 1.0); - normal_35.xy = tmpvar_36.xy.xy; - float tmpvar_37; - tmpvar_37 = sqrt (((1.0 - (normal_35.x * normal_35.x)) - (normal_35.y * normal_35.y))); - float tmpvar_38; - tmpvar_38 = tmpvar_37; - normal_35.z = vec3(tmpvar_38).z; - return normal_35; -} - -void surf ( - in Input IN_39, - inout LeafSurfaceOutput o_40 -) -{ - vec4 c_41; - vec4 tmpvar_42; - tmpvar_42 = texture2D (_MainTex, IN_39.uv_MainTex); - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - c_41 = tmpvar_43; - vec3 tmpvar_44; - tmpvar_44 = (c_41.xyz * IN_39.color.xyz); - o_40.Albedo = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = texture2D (_TranslucencyMap, IN_39.uv_MainTex); - vec3 tmpvar_46; - tmpvar_46 = _TranslucencyColor.xyz; - vec3 tmpvar_47; - tmpvar_47 = (tmpvar_45.xyz * tmpvar_46); - o_40.Translucency = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48 = texture2D (_GlossMap, IN_39.uv_MainTex); - float tmpvar_49; - tmpvar_49 = tmpvar_48.w; - o_40.Gloss = tmpvar_49; - float tmpvar_50; - tmpvar_50 = (c_41.w * IN_39.color.w); - o_40.Alpha = tmpvar_50; - float tmpvar_51; - tmpvar_51 = _Shininess; - o_40.Specular = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = texture2D (_BumpMap, IN_39.uv_MainTex); - vec4 tmpvar_53; - tmpvar_53 = UnpackNormal (tmpvar_52); - vec3 tmpvar_54; - tmpvar_54 = tmpvar_53.xyz; - vec3 tmpvar_55; - tmpvar_55 = tmpvar_54; - o_40.Normal = tmpvar_55; -} - -vec4 LightingTreeLeaf ( - in LeafSurfaceOutput s_56, - in vec3 lightDir_57, - in vec3 viewDir_58, - in float atten_59 -) -{ - vec4 c_60; - vec3 col_61; - vec3 translucencyColor_62; - float trans_63; - float spec_64; - float nh_65; - float diff_66; - vec3 h_67; - vec3 tmpvar_68; - tmpvar_68 = normalize ((lightDir_57 + viewDir_58)); - vec3 tmpvar_69; - tmpvar_69 = tmpvar_68; - h_67 = tmpvar_69; - float tmpvar_70; - tmpvar_70 = dot (s_56.Normal, lightDir_57); - float tmpvar_71; - tmpvar_71 = tmpvar_70; - diff_66 = tmpvar_71; - float tmpvar_72; - tmpvar_72 = dot (s_56.Normal, h_67); - float tmpvar_73; - tmpvar_73 = max (0.0, tmpvar_72); - float tmpvar_74; - tmpvar_74 = tmpvar_73; - nh_65 = tmpvar_74; - float tmpvar_75; - tmpvar_75 = pow (nh_65, (s_56.Specular * 128.0)); - float tmpvar_76; - tmpvar_76 = (tmpvar_75 * s_56.Gloss); - spec_64 = tmpvar_76; - float tmpvar_77; - tmpvar_77 = max (0.0, -(diff_66)); - float tmpvar_78; - tmpvar_78 = tmpvar_77; - trans_63 = tmpvar_78; - vec3 tmpvar_79; - tmpvar_79 = ((s_56.Translucency * trans_63) * 2.0); - translucencyColor_62 = tmpvar_79; - float tmpvar_80; - tmpvar_80 = max (0.0, ((diff_66 * 0.5) + 0.5)); - float tmpvar_81; - tmpvar_81 = tmpvar_80; - diff_66 = tmpvar_81; - vec3 tmpvar_82; - tmpvar_82 = (s_56.Albedo * (diff_66 + translucencyColor_62)); - col_61 = tmpvar_82; - float tmpvar_83; - tmpvar_83 = ceil (trans_63); - float tmpvar_84; - tmpvar_84 = xll_saturate (tmpvar_83); - vec3 tmpvar_85; - tmpvar_85 = (col_61 + (spec_64 * (1.0 - tmpvar_84))); - col_61 = tmpvar_85; - vec3 tmpvar_86; - tmpvar_86 = (col_61 * _LightColor0.xyz); - col_61 = tmpvar_86; - vec3 tmpvar_87; - tmpvar_87 = (col_61 * (atten_59 * 2.0)); - c_60.xyz = tmpvar_87.xyz.xyz; - return c_60; -} - -vec4 frag_surf ( - in v2f_surf IN_88 -) -{ - vec4 c_89; - vec3 lightDir_90; - LeafSurfaceOutput o_91; - Input surfIN_92; - vec2 tmpvar_93; - tmpvar_93 = IN_88.hip_pack0.xy; - surfIN_92.uv_MainTex = tmpvar_93; - vec4 tmpvar_94; - tmpvar_94 = IN_88.lop_color; - surfIN_92.color = tmpvar_94; - vec3 tmpvar_95; - tmpvar_95 = vec3(0.0, 0.0, 0.0); - o_91.Albedo = tmpvar_95; - vec3 tmpvar_96; - tmpvar_96 = vec3(0.0, 0.0, 0.0); - o_91.Emission = tmpvar_96; - float tmpvar_97; - tmpvar_97 = 0.0; - o_91.Specular = tmpvar_97; - float tmpvar_98; - tmpvar_98 = 0.0; - o_91.Alpha = tmpvar_98; - surf (surfIN_92, o_91); - xll_clip ((o_91.Alpha - _Cutoff)); - vec3 tmpvar_99; - tmpvar_99 = IN_88.lightDir; - lightDir_90 = tmpvar_99; - vec3 tmpvar_100; - tmpvar_100 = normalize (lightDir_90); - vec3 tmpvar_101; - tmpvar_101 = tmpvar_100; - lightDir_90 = tmpvar_101; - vec3 tmpvar_102; - tmpvar_102 = IN_88.viewDir.xyz; - vec3 tmpvar_103; - tmpvar_103 = normalize (tmpvar_102); - float tmpvar_104; - tmpvar_104 = dot (IN_88._LightCoord, IN_88._LightCoord); - vec2 tmpvar_105; - tmpvar_105 = vec2(tmpvar_104); - vec2 tmpvar_106; - tmpvar_106 = tmpvar_105.xy; - vec4 tmpvar_107; - tmpvar_107 = texture2D (_LightTextureB0, tmpvar_106); - vec4 tmpvar_108; - tmpvar_108 = textureCube (_LightTexture0, IN_88._LightCoord); - vec4 tmpvar_109; - tmpvar_109 = LightingTreeLeaf (o_91, lightDir_90, tmpvar_103, (tmpvar_107.w * tmpvar_108.w)); - vec4 tmpvar_110; - tmpvar_110 = tmpvar_109; - c_89 = tmpvar_110; - float tmpvar_111; - tmpvar_111 = o_91.Alpha; - c_89.w = vec4(tmpvar_111).w; - return c_89; -} - -void main () -{ - v2f_surf xlt_IN_112; - vec4 xl_retval_113; - vec4 tmpvar_114; - tmpvar_114 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_112.pos = tmpvar_114; - float tmpvar_115; - tmpvar_115 = xlv_FOG.x; - xlt_IN_112.fog = tmpvar_115; - vec2 tmpvar_116; - tmpvar_116 = gl_TexCoord[0].xy; - vec2 tmpvar_117; - tmpvar_117 = tmpvar_116; - xlt_IN_112.hip_pack0 = tmpvar_117; - vec4 tmpvar_118; - tmpvar_118 = gl_Color.xyzw; - vec4 tmpvar_119; - tmpvar_119 = tmpvar_118; - xlt_IN_112.lop_color = tmpvar_119; - vec3 tmpvar_120; - tmpvar_120 = gl_TexCoord[1].xyz; - vec3 tmpvar_121; - tmpvar_121 = tmpvar_120; - xlt_IN_112.lightDir = tmpvar_121; - vec3 tmpvar_122; - tmpvar_122 = gl_TexCoord[2].xyz; - vec3 tmpvar_123; - tmpvar_123 = tmpvar_122; - xlt_IN_112.viewDir = tmpvar_123; - vec3 tmpvar_124; - tmpvar_124 = gl_TexCoord[3].xyz; - vec3 tmpvar_125; - tmpvar_125 = tmpvar_124; - xlt_IN_112._LightCoord = tmpvar_125; - vec4 tmpvar_126; - tmpvar_126 = frag_surf (xlt_IN_112); - vec4 tmpvar_127; - tmpvar_127 = tmpvar_126; - xl_retval_113 = tmpvar_127; - vec4 tmpvar_128; - tmpvar_128 = xl_retval_113.xyzw; - vec4 tmpvar_129; - tmpvar_129 = tmpvar_128; - gl_FragData[0] = tmpvar_129; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-out.txt index 5de1ff08b..ca33c04cc 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-out.txt @@ -15,44 +15,65 @@ void main () vec3 tmpvar_2; tmpvar_2 = gl_TexCoord[3].xyz; vec4 c_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, tmpvar_1); - float tmpvar_5; - tmpvar_5 = (tmpvar_4.w * gl_Color.w); + float tmpvar_4; + vec4 tmpvar_5; + tmpvar_5 = texture2D (_MainTex, tmpvar_1); + tmpvar_4 = (tmpvar_5.w * gl_Color.w); vec4 normal_6; normal_6.xy = ((texture2D (_BumpMap, tmpvar_1).wy * 2.0) - 1.0); normal_6.z = sqrt(((1.0 - (normal_6.x * normal_6.x) ) - (normal_6.y * normal_6.y))); float x_7; - x_7 = (tmpvar_5 - _Cutoff); + x_7 = (tmpvar_4 - _Cutoff); if ((x_7 < 0.0)) { discard; }; vec3 tmpvar_8; tmpvar_8 = normalize(gl_TexCoord[1].xyz); vec4 c_9; - float tmpvar_10; - tmpvar_10 = dot (normal_6.xyz, tmpvar_8); + vec3 col_10; float tmpvar_11; - tmpvar_11 = max (0.0, -(tmpvar_10)); - c_9.xyz = ((( - ((tmpvar_4.xyz * gl_Color.xyz) * (max (0.0, ( - (tmpvar_10 * 0.5) - + 0.5)) + (( - (texture2D (_TranslucencyMap, tmpvar_1).xyz * _TranslucencyColor.xyz) - * tmpvar_11) * 2.0))) - + - ((pow (max (0.0, - dot (normal_6.xyz, normalize((tmpvar_8 + normalize(gl_TexCoord[2].xyz)))) - ), (_Shininess * 128.0)) * texture2D (_GlossMap, tmpvar_1).w) * (1.0 - clamp (ceil(tmpvar_11), 0.0, 1.0))) - ) * _LightColor0.xyz) * ((texture2D (_LightTextureB0, vec2( + tmpvar_11 = dot (normal_6.xyz, tmpvar_8); + float tmpvar_12; + tmpvar_12 = max (0.0, -(tmpvar_11)); + col_10 = ((tmpvar_5.xyz * gl_Color.xyz) * (max (0.0, + ((tmpvar_11 * 0.5) + 0.5) + ) + ( + (texture2D (_TranslucencyMap, tmpvar_1).xyz * _TranslucencyColor.xyz) + * + (tmpvar_12 * 2.0) + ))); + col_10 = (col_10 + (( + pow (max (0.0, dot (normal_6.xyz, normalize( + (tmpvar_8 + normalize(gl_TexCoord[2].xyz)) + ))), (_Shininess * 128.0)) + * texture2D (_GlossMap, tmpvar_1).w) * (1.0 - + clamp (ceil(tmpvar_12), 0.0, 1.0) + ))); + col_10 = (col_10 * _LightColor0.xyz); + c_9.xyz = (col_10 * ((texture2D (_LightTextureB0, vec2( dot (tmpvar_2, tmpvar_2) )).w * textureCube (_LightTexture0, tmpvar_2).w) * 2.0)); c_3.xyz = c_9.xyz; - c_3.w = tmpvar_5; + c_3.w = tmpvar_4; gl_FragData[0] = c_3; } -// inputs: 2, stats: 41 alu 7 tex 1 flow +// stats: 41 alu 7 tex 1 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [4] loc 4 +// uniforms: 4 (total size: 0) +// #0: _Cutoff (high float) 1x1 [-1] +// #1: _LightColor0 (high float) 4x1 [-1] +// #2: _Shininess (high float) 1x1 [-1] +// #3: _TranslucencyColor (high float) 4x1 [-1] +// textures: 6 +// #0: _BumpMap (high 2d) 0x0 [-1] +// #1: _GlossMap (high 2d) 0x0 [-1] +// #2: _LightTexture0 (high cube) 0x0 [-1] +// #3: _LightTextureB0 (high 2d) 0x0 [-1] +// #4: _MainTex (high 2d) 0x0 [-1] +// #5: _TranslucencyMap (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-ir.txt deleted file mode 100644 index 84e650a6a..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-ir.txt +++ /dev/null @@ -1,387 +0,0 @@ -struct LeafSurfaceOutput { - vec3 Albedo; - vec3 Normal; - vec3 Emission; - vec3 Translucency; - float Specular; - float Gloss; - float Alpha; -}; -struct Input { - vec2 uv_MainTex; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - vec3 _ShadowCoord0; - vec3 _ShadowCoord1; - vec3 _ShadowCoord2; - vec3 _ShadowCoord3; - vec2 _ShadowZFade; - vec2 hip_pack0; - vec4 lop_color; -}; -uniform sampler2D _BumpMap; -uniform float _Cutoff; -uniform sampler2D _GlossMap; -uniform vec4 _LightShadowData; -uniform vec4 _LightSplitsFar; -uniform vec4 _LightSplitsNear; -uniform sampler2D _MainTex; -uniform vec4 _ProjectionParams; -uniform sampler2D _ShadowMapTexture; -uniform float _Shininess; -uniform vec4 _TranslucencyColor; -uniform sampler2D _TranslucencyMap; -void xll_clip ( - in float x_1 -) -{ - if ((x_1 < 0.0)) { - discard; - }; -} - -float xll_saturate ( - in float x_2 -) -{ - float tmpvar_3; - tmpvar_3 = clamp (x_2, 0.0, 1.0); - return tmpvar_3; -} - -vec2 xll_saturate ( - in vec2 x_4 -) -{ - vec2 tmpvar_5; - tmpvar_5 = clamp (x_4, 0.0, 1.0); - return tmpvar_5; -} - -vec3 xll_saturate ( - in vec3 x_6 -) -{ - vec3 tmpvar_7; - tmpvar_7 = clamp (x_6, 0.0, 1.0); - return tmpvar_7; -} - -vec4 xll_saturate ( - in vec4 x_8 -) -{ - vec4 tmpvar_9; - tmpvar_9 = clamp (x_8, 0.0, 1.0); - return tmpvar_9; -} - -mat2 xll_saturate ( - in mat2 m_10 -) -{ - vec2 tmpvar_11; - tmpvar_11 = clamp (m_10[0], 0.0, 1.0); - vec2 tmpvar_12; - tmpvar_12 = clamp (m_10[1], 0.0, 1.0); - mat2 tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = tmpvar_11; - tmpvar_13[0] = tmpvar_14; - vec2 tmpvar_15; - tmpvar_15 = tmpvar_12; - tmpvar_13[1] = tmpvar_15; - return tmpvar_13; -} - -mat3 xll_saturate ( - in mat3 m_16 -) -{ - vec3 tmpvar_17; - tmpvar_17 = clamp (m_16[0], 0.0, 1.0); - vec3 tmpvar_18; - tmpvar_18 = clamp (m_16[1], 0.0, 1.0); - vec3 tmpvar_19; - tmpvar_19 = clamp (m_16[2], 0.0, 1.0); - mat3 tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_20[0] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_20[1] = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = tmpvar_19; - tmpvar_20[2] = tmpvar_23; - return tmpvar_20; -} - -mat4 xll_saturate ( - in mat4 m_24 -) -{ - vec4 tmpvar_25; - tmpvar_25 = clamp (m_24[0], 0.0, 1.0); - vec4 tmpvar_26; - tmpvar_26 = clamp (m_24[1], 0.0, 1.0); - vec4 tmpvar_27; - tmpvar_27 = clamp (m_24[2], 0.0, 1.0); - vec4 tmpvar_28; - tmpvar_28 = clamp (m_24[3], 0.0, 1.0); - mat4 tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_25; - tmpvar_29[0] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; - tmpvar_29[1] = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_27; - tmpvar_29[2] = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_28; - tmpvar_29[3] = tmpvar_33; - return tmpvar_29; -} - -vec4 UnpackNormal ( - in vec4 packednormal_34 -) -{ - vec4 normal_35; - vec2 tmpvar_36; - tmpvar_36 = ((packednormal_34.wy * 2.0) - 1.0); - normal_35.xy = tmpvar_36.xy.xy; - float tmpvar_37; - tmpvar_37 = sqrt (((1.0 - (normal_35.x * normal_35.x)) - (normal_35.y * normal_35.y))); - float tmpvar_38; - tmpvar_38 = tmpvar_37; - normal_35.z = vec3(tmpvar_38).z; - return normal_35; -} - -void surf ( - in Input IN_39, - inout LeafSurfaceOutput o_40 -) -{ - vec4 c_41; - vec4 tmpvar_42; - tmpvar_42 = texture2D (_MainTex, IN_39.uv_MainTex); - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - c_41 = tmpvar_43; - vec3 tmpvar_44; - tmpvar_44 = (c_41.xyz * IN_39.color.xyz); - o_40.Albedo = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = texture2D (_TranslucencyMap, IN_39.uv_MainTex); - vec3 tmpvar_46; - tmpvar_46 = _TranslucencyColor.xyz; - vec3 tmpvar_47; - tmpvar_47 = (tmpvar_45.xyz * tmpvar_46); - o_40.Translucency = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48 = texture2D (_GlossMap, IN_39.uv_MainTex); - float tmpvar_49; - tmpvar_49 = tmpvar_48.w; - o_40.Gloss = tmpvar_49; - float tmpvar_50; - tmpvar_50 = (c_41.w * IN_39.color.w); - o_40.Alpha = tmpvar_50; - float tmpvar_51; - tmpvar_51 = _Shininess; - o_40.Specular = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = texture2D (_BumpMap, IN_39.uv_MainTex); - vec4 tmpvar_53; - tmpvar_53 = UnpackNormal (tmpvar_52); - vec3 tmpvar_54; - tmpvar_54 = tmpvar_53.xyz; - vec3 tmpvar_55; - tmpvar_55 = tmpvar_54; - o_40.Normal = tmpvar_55; -} - -vec2 EncodeFloatRG ( - in float v_56 -) -{ - vec2 enc_57; - float kEncodeBit_58; - vec2 kEncodeMul_59; - vec2 tmpvar_60; - tmpvar_60 = vec2(1.0, 255.0); - kEncodeMul_59 = tmpvar_60; - float tmpvar_61; - tmpvar_61 = 0.00392157; - kEncodeBit_58 = tmpvar_61; - vec2 tmpvar_62; - tmpvar_62 = (kEncodeMul_59 * v_56); - enc_57 = tmpvar_62; - vec2 tmpvar_63; - tmpvar_63 = fract (enc_57); - vec2 tmpvar_64; - tmpvar_64 = tmpvar_63; - enc_57 = tmpvar_64; - float tmpvar_65; - tmpvar_65 = (enc_57.x - (enc_57.y * kEncodeBit_58)); - enc_57.x = tmpvar_65; - return enc_57; -} - -vec4 frag_surf ( - in v2f_surf IN_66 -) -{ - vec4 res_67; - float faded_68; - float shadow_69; - vec4 coord_70; - vec4 weights_71; - vec4 far_72; - vec4 near_73; - vec4 z_74; - LeafSurfaceOutput o_75; - Input surfIN_76; - vec2 tmpvar_77; - tmpvar_77 = IN_66.hip_pack0.xy; - surfIN_76.uv_MainTex = tmpvar_77; - vec4 tmpvar_78; - tmpvar_78 = IN_66.lop_color; - surfIN_76.color = tmpvar_78; - vec3 tmpvar_79; - tmpvar_79 = vec3(0.0, 0.0, 0.0); - o_75.Albedo = tmpvar_79; - vec3 tmpvar_80; - tmpvar_80 = vec3(0.0, 0.0, 0.0); - o_75.Emission = tmpvar_80; - float tmpvar_81; - tmpvar_81 = 0.0; - o_75.Specular = tmpvar_81; - float tmpvar_82; - tmpvar_82 = 0.0; - o_75.Alpha = tmpvar_82; - surf (surfIN_76, o_75); - xll_clip ((o_75.Alpha - _Cutoff)); - vec4 tmpvar_83; - tmpvar_83 = vec4(IN_66._ShadowZFade.x); - vec4 tmpvar_84; - tmpvar_84 = tmpvar_83; - z_74 = tmpvar_84; - bvec4 tmpvar_85; - tmpvar_85 = greaterThanEqual (z_74, _LightSplitsNear); - vec4 tmpvar_86; - tmpvar_86 = vec4(tmpvar_85).xyzw; - vec4 tmpvar_87; - tmpvar_87 = tmpvar_86; - near_73 = tmpvar_87; - bvec4 tmpvar_88; - tmpvar_88 = lessThan (z_74, _LightSplitsFar); - vec4 tmpvar_89; - tmpvar_89 = vec4(tmpvar_88).xyzw; - vec4 tmpvar_90; - tmpvar_90 = tmpvar_89; - far_72 = tmpvar_90; - vec4 tmpvar_91; - tmpvar_91 = (near_73 * far_72); - weights_71 = tmpvar_91; - vec4 tmpvar_92; - tmpvar_92.w = 1.0; - tmpvar_92.xyz = ((( - (IN_66._ShadowCoord0 * weights_71.x) - + - (IN_66._ShadowCoord1 * weights_71.y) - ) + (IN_66._ShadowCoord2 * weights_71.z)) + (IN_66._ShadowCoord3 * weights_71.w)).xyz; - vec4 tmpvar_93; - tmpvar_93 = tmpvar_92; - coord_70 = tmpvar_93; - vec4 tmpvar_94; - tmpvar_94 = texture2D (_ShadowMapTexture, coord_70.xy); - float tmpvar_95; - if ((tmpvar_94.x < coord_70.z)) { - tmpvar_95 = _LightShadowData.x; - } else { - tmpvar_95 = 1.0; - }; - float tmpvar_96; - tmpvar_96 = tmpvar_95; - shadow_69 = tmpvar_96; - float tmpvar_97; - tmpvar_97 = xll_saturate (IN_66._ShadowZFade.y); - float tmpvar_98; - tmpvar_98 = xll_saturate ((shadow_69 + tmpvar_97)); - float tmpvar_99; - tmpvar_99 = tmpvar_98; - faded_68 = tmpvar_99; - float tmpvar_100; - tmpvar_100 = faded_68; - res_67.x = tmpvar_100; - float tmpvar_101; - tmpvar_101 = 1.0; - res_67.y = vec2(tmpvar_101).y; - vec2 tmpvar_102; - tmpvar_102 = EncodeFloatRG ((1.0 - (z_74 * _ProjectionParams.w)).x); - vec2 tmpvar_103; - tmpvar_103 = tmpvar_102; - res_67.zw = tmpvar_103.xxxy.zw; - return res_67; -} - -void main () -{ - v2f_surf xlt_IN_104; - vec4 xl_retval_105; - vec4 tmpvar_106; - tmpvar_106 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_IN_104.pos = tmpvar_106; - vec3 tmpvar_107; - tmpvar_107 = gl_TexCoord[0].xyz; - vec3 tmpvar_108; - tmpvar_108 = tmpvar_107; - xlt_IN_104._ShadowCoord0 = tmpvar_108; - vec3 tmpvar_109; - tmpvar_109 = gl_TexCoord[1].xyz; - vec3 tmpvar_110; - tmpvar_110 = tmpvar_109; - xlt_IN_104._ShadowCoord1 = tmpvar_110; - vec3 tmpvar_111; - tmpvar_111 = gl_TexCoord[2].xyz; - vec3 tmpvar_112; - tmpvar_112 = tmpvar_111; - xlt_IN_104._ShadowCoord2 = tmpvar_112; - vec3 tmpvar_113; - tmpvar_113 = gl_TexCoord[3].xyz; - vec3 tmpvar_114; - tmpvar_114 = tmpvar_113; - xlt_IN_104._ShadowCoord3 = tmpvar_114; - vec2 tmpvar_115; - tmpvar_115 = gl_TexCoord[4].xy; - vec2 tmpvar_116; - tmpvar_116 = tmpvar_115; - xlt_IN_104._ShadowZFade = tmpvar_116; - vec2 tmpvar_117; - tmpvar_117 = gl_TexCoord[5].xy; - vec2 tmpvar_118; - tmpvar_118 = tmpvar_117; - xlt_IN_104.hip_pack0 = tmpvar_118; - vec4 tmpvar_119; - tmpvar_119 = gl_Color.xyzw; - vec4 tmpvar_120; - tmpvar_120 = tmpvar_119; - xlt_IN_104.lop_color = tmpvar_120; - vec4 tmpvar_121; - tmpvar_121 = frag_surf (xlt_IN_104); - vec4 tmpvar_122; - tmpvar_122 = tmpvar_121; - xl_retval_105 = tmpvar_122; - vec4 tmpvar_123; - tmpvar_123 = xl_retval_105.xyzw; - vec4 tmpvar_124; - tmpvar_124 = tmpvar_123; - gl_FragData[0] = tmpvar_124; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-out.txt index 81d50eeba..1adf41cc9 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-out.txt @@ -1,4 +1,3 @@ -uniform sampler2D _BumpMap; uniform float _Cutoff; uniform vec4 _LightShadowData; uniform vec4 _LightSplitsFar; @@ -10,48 +9,52 @@ void main () { vec2 tmpvar_1; tmpvar_1 = gl_TexCoord[4].xy; - vec2 tmpvar_2; - tmpvar_2 = gl_TexCoord[5].xy; - vec4 res_3; - vec4 normal_4; - normal_4.xy = ((texture2D (_BumpMap, tmpvar_2).wy * 2.0) - 1.0); - normal_4.z = sqrt(((1.0 - - (normal_4.x * normal_4.x) - ) - (normal_4.y * normal_4.y))); - float x_5; - x_5 = ((texture2D (_MainTex, tmpvar_2).w * gl_Color.w) - _Cutoff); - if ((x_5 < 0.0)) { + vec4 res_2; + vec4 weights_3; + float x_4; + x_4 = ((texture2D (_MainTex, gl_TexCoord[5].xy).w * gl_Color.w) - _Cutoff); + if ((x_4 < 0.0)) { discard; }; - vec4 tmpvar_6; - tmpvar_6 = (vec4(greaterThanEqual (tmpvar_1.xxxx, _LightSplitsNear)) * vec4(lessThan (tmpvar_1.xxxx, _LightSplitsFar))); - vec4 tmpvar_7; - tmpvar_7.w = 1.0; - tmpvar_7.xyz = ((( - (gl_TexCoord[0].xyz * tmpvar_6.x) + weights_3 = (vec4(greaterThanEqual (tmpvar_1.xxxx, _LightSplitsNear)) * vec4(lessThan (tmpvar_1.xxxx, _LightSplitsFar))); + vec4 tmpvar_5; + tmpvar_5.w = 1.0; + tmpvar_5.xyz = ((( + (gl_TexCoord[0].xyz * weights_3.x) + - (gl_TexCoord[1].xyz * tmpvar_6.y) - ) + (gl_TexCoord[2].xyz * tmpvar_6.z)) + (gl_TexCoord[3].xyz * tmpvar_6.w)); - vec4 tmpvar_8; - tmpvar_8 = texture2D (_ShadowMapTexture, tmpvar_7.xy); - float tmpvar_9; - if ((tmpvar_8.x < tmpvar_7.z)) { - tmpvar_9 = _LightShadowData.x; + (gl_TexCoord[1].xyz * weights_3.y) + ) + (gl_TexCoord[2].xyz * weights_3.z)) + (gl_TexCoord[3].xyz * weights_3.w)); + vec4 tmpvar_6; + tmpvar_6 = texture2D (_ShadowMapTexture, tmpvar_5.xy); + float tmpvar_7; + if ((tmpvar_6.x < tmpvar_5.z)) { + tmpvar_7 = _LightShadowData.x; } else { - tmpvar_9 = 1.0; + tmpvar_7 = 1.0; }; - res_3.x = clamp ((tmpvar_9 + clamp (tmpvar_1.y, 0.0, 1.0)), 0.0, 1.0); - res_3.y = 1.0; - vec2 enc_10; - vec2 tmpvar_11; - tmpvar_11 = fract((vec2(1.0, 255.0) * (1.0 - - (tmpvar_1.xxxx * _ProjectionParams.w) - ).x)); - enc_10.y = tmpvar_11.y; - enc_10.x = (tmpvar_11.x - (tmpvar_11.y * 0.00392157)); - res_3.zw = enc_10; - gl_FragData[0] = res_3; + res_2.x = clamp ((tmpvar_7 + clamp (tmpvar_1.y, 0.0, 1.0)), 0.0, 1.0); + res_2.y = 1.0; + vec2 enc_8; + enc_8 = (vec2(1.0, 255.0) * (1.0 - (tmpvar_1.xxxx * _ProjectionParams.w)).x); + vec2 tmpvar_9; + tmpvar_9 = fract(enc_8); + enc_8.y = tmpvar_9.y; + enc_8.x = (tmpvar_9.x - (tmpvar_9.y * 0.00392157)); + res_2.zw = enc_8; + gl_FragData[0] = res_2; } -// inputs: 2, stats: 35 alu 4 tex 2 flow +// stats: 28 alu 3 tex 2 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [6] loc 4 +// uniforms: 5 (total size: 0) +// #0: _Cutoff (high float) 1x1 [-1] +// #1: _LightShadowData (high float) 4x1 [-1] +// #2: _LightSplitsFar (high float) 4x1 [-1] +// #3: _LightSplitsNear (high float) 4x1 [-1] +// #4: _ProjectionParams (high float) 4x1 [-1] +// textures: 2 +// #0: _MainTex (high 2d) 0x0 [-1] +// #1: _ShadowMapTexture (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-ir.txt deleted file mode 100644 index 4f7de8fc0..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-ir.txt +++ /dev/null @@ -1,55 +0,0 @@ -struct v2f { - vec4 pos; - float fog; - vec4 color; - vec2 texcoord; - vec3 normal; -}; -uniform sampler2D _MainTex; -varying vec4 xlv_FOG; -vec4 frag ( - in v2f i_1 -) -{ - vec4 tmpvar_2; - tmpvar_2 = texture2D (_MainTex, i_1.texcoord); - return (i_1.color * tmpvar_2); -} - -void main () -{ - v2f xlt_i_3; - vec4 xl_retval_4; - vec4 tmpvar_5; - tmpvar_5 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_3.pos = tmpvar_5; - float tmpvar_6; - tmpvar_6 = xlv_FOG.x; - xlt_i_3.fog = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7 = gl_Color.xyzw; - vec4 tmpvar_8; - tmpvar_8 = tmpvar_7; - xlt_i_3.color = tmpvar_8; - vec2 tmpvar_9; - tmpvar_9 = gl_TexCoord[0].xy; - vec2 tmpvar_10; - tmpvar_10 = tmpvar_9; - xlt_i_3.texcoord = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = gl_TexCoord[1].xyz; - vec3 tmpvar_12; - tmpvar_12 = tmpvar_11; - xlt_i_3.normal = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13 = frag (xlt_i_3); - vec4 tmpvar_14; - tmpvar_14 = tmpvar_13; - xl_retval_4 = tmpvar_14; - vec4 tmpvar_15; - tmpvar_15 = xl_retval_4.xyzw; - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - gl_FragData[0] = tmpvar_16; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-out.txt index b968c4b48..37bcecb76 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-out.txt @@ -5,4 +5,9 @@ void main () } -// inputs: 2, stats: 1 alu 1 tex 0 flow +// stats: 1 alu 1 tex 0 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 1 +// #1: gl_TexCoord (high float) 4x1 [2] loc 4 +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-ir.txt deleted file mode 100644 index 26eb19b78..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-ir.txt +++ /dev/null @@ -1,92 +0,0 @@ -struct v2f_img { - vec4 pos; - vec2 uv; -}; -uniform vec4 _AdaptParams; -uniform sampler2D _CurTex; -uniform sampler2D _MainTex; -vec4 frag ( - in v2f_img i_1 -) -{ - vec4 valNew_2; - vec2 delta_3; - vec2 valCur_4; - vec2 valAdapted_5; - vec4 tmpvar_6; - tmpvar_6 = texture2D (_MainTex, i_1.uv); - vec2 tmpvar_7; - tmpvar_7 = tmpvar_6.xy; - valAdapted_5 = tmpvar_7; - vec4 tmpvar_8; - tmpvar_8 = texture2D (_CurTex, i_1.uv); - vec2 tmpvar_9; - tmpvar_9 = tmpvar_8.xy; - valCur_4 = tmpvar_9; - vec2 tmpvar_10; - tmpvar_10 = ((valCur_4 - valAdapted_5) * _AdaptParams.x); - delta_3 = tmpvar_10; - float tmpvar_11; - tmpvar_11 = sign (delta_3.x); - float tmpvar_12; - tmpvar_12 = abs (delta_3.x); - float tmpvar_13; - tmpvar_13 = max (0.00392157, tmpvar_12); - float tmpvar_14; - tmpvar_14 = (tmpvar_11 * tmpvar_13); - delta_3.x = tmpvar_14; - float tmpvar_15; - tmpvar_15 = sign (delta_3.y); - float tmpvar_16; - tmpvar_16 = abs (delta_3.y); - float tmpvar_17; - tmpvar_17 = max (0.00392157, tmpvar_16); - float tmpvar_18; - tmpvar_18 = (tmpvar_15 * tmpvar_17); - delta_3.y = vec2(tmpvar_18).y; - vec2 tmpvar_19; - tmpvar_19 = (valAdapted_5 + delta_3); - valNew_2.xy = tmpvar_19.xy.xy; - float tmpvar_20; - tmpvar_20 = max (valNew_2.x, _AdaptParams.z); - float tmpvar_21; - tmpvar_21 = tmpvar_20; - valNew_2.x = tmpvar_21; - float tmpvar_22; - tmpvar_22 = min (valNew_2.y, _AdaptParams.y); - float tmpvar_23; - tmpvar_23 = tmpvar_22; - valNew_2.y = vec2(tmpvar_23).y; - float tmpvar_24; - tmpvar_24 = ((valNew_2.x - valNew_2.y) + 0.01); - valNew_2.z = vec3(tmpvar_24).z; - float tmpvar_25; - tmpvar_25 = (valNew_2.y / valNew_2.z); - valNew_2.w = vec4(tmpvar_25).w; - return valNew_2; -} - -void main () -{ - v2f_img xlt_i_26; - vec4 xl_retval_27; - vec4 tmpvar_28; - tmpvar_28 = vec4(0.0, 0.0, 0.0, 0.0); - xlt_i_26.pos = tmpvar_28; - vec2 tmpvar_29; - tmpvar_29 = gl_TexCoord[0].xy; - vec2 tmpvar_30; - tmpvar_30 = tmpvar_29; - xlt_i_26.uv = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = frag (xlt_i_26); - vec4 tmpvar_32; - tmpvar_32 = tmpvar_31; - xl_retval_27 = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = xl_retval_27.xyzw; - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - gl_FragData[0] = tmpvar_34; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-out.txt index 97e57d5c4..094bce528 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-out.txt @@ -6,13 +6,12 @@ void main () vec2 tmpvar_1; tmpvar_1 = gl_TexCoord[0].xy; vec4 valNew_2; - vec4 tmpvar_3; - tmpvar_3 = texture2D (_MainTex, tmpvar_1); - vec2 tmpvar_4; - tmpvar_4 = ((texture2D (_CurTex, tmpvar_1).xy - tmpvar_3.xy) * _AdaptParams.x); - valNew_2.xy = (tmpvar_3.xy + (sign(tmpvar_4) * max (vec2(0.00392157, 0.00392157), - abs(tmpvar_4) - ))); + vec2 delta_3; + vec4 tmpvar_4; + tmpvar_4 = texture2D (_MainTex, tmpvar_1); + delta_3 = ((texture2D (_CurTex, tmpvar_1).xy - tmpvar_4.xy) * _AdaptParams.x); + delta_3 = (sign(delta_3) * max (vec2(0.00392157, 0.00392157), abs(delta_3))); + valNew_2.xy = (tmpvar_4.xy + delta_3); valNew_2.x = max (valNew_2.x, _AdaptParams.z); valNew_2.y = min (valNew_2.y, _AdaptParams.y); valNew_2.z = ((valNew_2.x - valNew_2.y) + 0.01); @@ -21,4 +20,11 @@ void main () } -// inputs: 1, stats: 12 alu 2 tex 0 flow +// stats: 12 alu 2 tex 0 flow +// inputs: 1 +// #0: gl_TexCoord (high float) 4x1 [1] loc 4 +// uniforms: 1 (total size: 0) +// #0: _AdaptParams (high float) 4x1 [-1] +// textures: 2 +// #0: _CurTex (high 2d) 0x0 [-1] +// #1: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-ir.txt deleted file mode 100644 index c32cf55aa..000000000 --- a/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-ir.txt +++ /dev/null @@ -1,117 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; -}; -uniform sampler2D _MainTex; -uniform vec4 _MainTex_TexelSize; -varying vec2 xlv_TEXCOORD0; -vec2 maxMag ( - in vec2 a_1, - in vec2 b_2 -) -{ - float mb_3; - float ma_4; - float tmpvar_5; - tmpvar_5 = dot (a_1, a_1); - float tmpvar_6; - tmpvar_6 = tmpvar_5; - ma_4 = tmpvar_6; - float tmpvar_7; - tmpvar_7 = dot (b_2, b_2); - float tmpvar_8; - tmpvar_8 = tmpvar_7; - mb_3 = tmpvar_8; - float tmpvar_9; - tmpvar_9 = step (ma_4, mb_3); - vec2 tmpvar_10; - tmpvar_10 = vec2(tmpvar_9); - vec2 tmpvar_11; - tmpvar_11 = mix (a_1, b_2, tmpvar_10); - return tmpvar_11; -} - -vec4 TileMax ( - in v2f i_12 -) -{ - int j_13; - vec2 v_14; - vec2 mx_15; - vec2 uvCorner_16; - vec2 tmpvar_17; - tmpvar_17 = i_12.uv; - uvCorner_16 = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = texture2D (_MainTex, uvCorner_16); - vec2 tmpvar_19; - tmpvar_19 = tmpvar_18.xy; - vec2 tmpvar_20; - tmpvar_20 = tmpvar_19; - mx_15 = tmpvar_20; - int tmpvar_21; - tmpvar_21 = 0; - j_13 = tmpvar_21; - while (true) { - int l_22; - if (!((j_13 < 8))) { - break; - }; - int tmpvar_23; - tmpvar_23 = 0; - l_22 = tmpvar_23; - while (true) { - if (!((l_22 < 8))) { - break; - }; - vec2 tmpvar_24; - tmpvar_24.x = float(l_22); - tmpvar_24.y = float(j_13); - vec4 tmpvar_25; - tmpvar_25 = texture2D (_MainTex, (uvCorner_16 + (tmpvar_24 * _MainTex_TexelSize.xy))); - vec2 tmpvar_26; - tmpvar_26 = tmpvar_25.xy; - v_14 = tmpvar_26; - vec2 tmpvar_27; - tmpvar_27 = maxMag (mx_15, v_14); - vec2 tmpvar_28; - tmpvar_28 = tmpvar_27; - mx_15 = tmpvar_28; - int _post_incdec_tmp_29; - _post_incdec_tmp_29 = l_22; - int tmpvar_30; - tmpvar_30 = (l_22 + 1); - l_22 = tmpvar_30; - }; - int _post_incdec_tmp_31; - _post_incdec_tmp_31 = j_13; - int tmpvar_32; - tmpvar_32 = (j_13 + 1); - j_13 = tmpvar_32; - }; - vec4 tmpvar_33; - tmpvar_33.zw = vec2(0.0, 0.0); - tmpvar_33.xy = mx_15.xy; - return tmpvar_33; -} - -void main () -{ - v2f ii_34; - vec4 c_35; - vec4 tmpvar_36; - tmpvar_36 = vec4(0.0, 0.0, 0.0, 0.0); - ii_34.pos = tmpvar_36; - vec2 tmpvar_37; - tmpvar_37 = xlv_TEXCOORD0; - ii_34.uv = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = TileMax (ii_34); - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - c_35 = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = c_35; - gl_FragData[0] = tmpvar_40; -} - diff --git a/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-out.txt index 9bab30b01..983d12771 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-out.txt @@ -96,4 +96,10 @@ void main () } -// inputs: 1, stats: 76 alu 9 tex 2 flow +// stats: 76 alu 9 tex 2 flow +// inputs: 1 +// #0: xlv_TEXCOORD0 (high float) 2x1 [-1] +// uniforms: 1 (total size: 0) +// #0: _MainTex_TexelSize (high float) 4x1 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp b/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp index abdce65ba..7d2596924 100644 --- a/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp +++ b/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp @@ -180,6 +180,20 @@ static void CleanupGL() #endif // #if GOT_GFX } + +static bool InitializeMetal () +{ + bool hasMetal = false; + +#if defined(__APPLE__) + + hasMetal = true; //@TODO: detect metal compiler presence + +#endif + + return hasMetal; +} + static void replace_string (std::string& target, const std::string& search, const std::string& replace, size_t startPos) { if (search.empty()) @@ -203,13 +217,14 @@ static bool CheckGLSL (bool vertex, bool gles, const std::string& testName, cons if (source.find("#version 140") != std::string::npos) return true; #endif + + const bool need3 = + (source.find("#version 150") != std::string::npos) || + (source.find("#version 300") != std::string::npos); # ifdef __APPLE__ // Mac core context does not accept any older shader versions, so need to switch to // either legacy context or core one. - const bool need3 = - (source.find("#version 150") != std::string::npos) || - (source.find("#version 300") != std::string::npos); if (need3) { if (!s_GL3Active) @@ -236,6 +251,11 @@ static bool CheckGLSL (bool vertex, bool gles, const std::string& testName, cons src += "#define texture2DGradEXT texture2DGradARB\n"; src += "#define textureCubeGradEXT textureCubeGradARB\n"; src += "#define gl_FragDepthEXT gl_FragDepth\n"; + if (!need3) + { + 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"; } @@ -249,8 +269,16 @@ static bool CheckGLSL (bool vertex, bool gles, const std::string& testName, cons replace_string (src, "#extension GL_OES_standard_derivatives : enable", "", 0); replace_string (src, "#extension GL_EXT_shadow_samplers : enable", "", 0); replace_string (src, "#extension GL_EXT_frag_depth : enable", "", 0); + replace_string (src, "#extension GL_EXT_draw_buffers : enable", "", 0); + replace_string (src, "#extension GL_EXT_draw_buffers : require", "", 0); replace_string (src, "precision ", "// precision ", 0); - replace_string (src, "#version 300 es", "#version 330", 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); + if (gles && need3) + { + src = "#version 330\n" + src; } const char* sourcePtr = src.c_str(); @@ -263,7 +291,8 @@ static bool CheckGLSL (bool vertex, bool gles, const std::string& testName, cons bool res = true; if (status == 0) { - char log[4096]; + char log[20000]; + log[0] = 0; GLsizei logLength; glGetInfoLogARB (shader, sizeof(log), &logLength, log); printf ("\n %s: real glsl compiler error on %s:\n%s\n", testName.c_str(), prefix, log); @@ -274,6 +303,26 @@ static bool CheckGLSL (bool vertex, bool gles, const std::string& testName, cons } +static bool CheckMetal (bool vertex, bool gles, const std::string& testName, const char* prefix, const std::string& source) +{ +#if !GOT_GFX + return true; // just assume it's ok +#endif + + FILE* f = fopen ("metalTemp.metal", "wb"); + fwrite (source.c_str(), source.size(), 1, f); + fclose (f); + + 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; + } + return true; +} + + static bool ReadStringFromFile (const char* pathName, std::string& output) { FILE* file = fopen( pathName, "rb" ); @@ -358,13 +407,31 @@ static void DeleteFile (const std::string& path) static void MassageVertexForGLES (std::string& s) { + if (s.find ("_glesVertex") != std::string::npos) + return; std::string pre; - pre += "#define gl_Vertex _glesVertex\nattribute highp vec4 _glesVertex;\n"; - pre += "#define gl_Normal _glesNormal\nattribute mediump vec3 _glesNormal;\n"; - pre += "#define gl_MultiTexCoord0 _glesMultiTexCoord0\nattribute highp vec4 _glesMultiTexCoord0;\n"; - pre += "#define gl_MultiTexCoord1 _glesMultiTexCoord1\nattribute highp vec4 _glesMultiTexCoord1;\n"; - pre += "#define gl_Color _glesColor\nattribute lowp vec4 _glesColor;\n"; - s = pre + s; + std::string version = "#version 300 es\n"; + size_t insertPoint = s.find(version); + if (insertPoint != std::string::npos) + { + insertPoint += version.size(); + pre += "#define gl_Vertex _glesVertex\nin highp vec4 _glesVertex;\n"; + pre += "#define gl_Normal _glesNormal\nin mediump vec3 _glesNormal;\n"; + pre += "#define gl_MultiTexCoord0 _glesMultiTexCoord0\nin highp vec4 _glesMultiTexCoord0;\n"; + pre += "#define gl_MultiTexCoord1 _glesMultiTexCoord1\nin highp vec4 _glesMultiTexCoord1;\n"; + pre += "#define gl_Color _glesColor\nin lowp vec4 _glesColor;\n"; + } + else + { + insertPoint = 0; + pre += "#define gl_Vertex _glesVertex\nattribute highp vec4 _glesVertex;\n"; + pre += "#define gl_Normal _glesNormal\nattribute mediump vec3 _glesNormal;\n"; + pre += "#define gl_MultiTexCoord0 _glesMultiTexCoord0\nattribute highp vec4 _glesMultiTexCoord0;\n"; + pre += "#define gl_MultiTexCoord1 _glesMultiTexCoord1\nattribute highp vec4 _glesMultiTexCoord1;\n"; + pre += "#define gl_Color _glesColor\nattribute lowp vec4 _glesColor;\n"; + } + + s.insert (insertPoint, pre); } static void MassageFragmentForGLES (std::string& s) @@ -373,13 +440,29 @@ static void MassageFragmentForGLES (std::string& s) s = pre + s; } +static const char* kGlslTypeNames[kGlslTypeCount] = { + "float", + "int", + "bool", + "2d", + "3d", + "cube", + "other", +}; +static const char* kGlslPrecNames[kGlslPrecCount] = { + "high", + "medium", + "low", +}; + + static bool TestFile (glslopt_ctx* ctx, bool vertex, const std::string& testName, const std::string& inputPath, - const std::string& hirPath, const std::string& outputPath, bool gles, - bool doCheckGLSL) + bool doCheckGLSL, + bool doCheckMetal) { std::string input; if (!ReadStringFromFile (inputPath.c_str(), input)) @@ -412,35 +495,81 @@ static bool TestFile (glslopt_ctx* ctx, bool vertex, std::string textHir = glslopt_get_raw_output (shader); std::string textOpt = glslopt_get_output (shader); - char buffer[200]; + // append stats + char buffer[1000]; int statsAlu, statsTex, statsFlow; glslopt_shader_get_stats (shader, &statsAlu, &statsTex, &statsFlow); - int inputCount = glslopt_shader_get_input_count (shader); - sprintf(buffer, "\n// inputs: %i, stats: %i alu %i tex %i flow\n", inputCount, statsAlu, statsTex, statsFlow); + sprintf(buffer, "\n// stats: %i alu %i tex %i flow\n", statsAlu, statsTex, statsFlow); textOpt += buffer; + + // append inputs + const int inputCount = glslopt_shader_get_input_count (shader); + if (inputCount > 0) + { + sprintf(buffer, "// inputs: %i\n", inputCount); + textOpt += buffer; + } + for (int i = 0; i < inputCount; ++i) + { + const char* parName; + glslopt_basic_type parType; + glslopt_precision parPrec; + int parVecSize, parMatSize, parArrSize, location; + glslopt_shader_get_input_desc(shader, i, &parName, &parType, &parPrec, &parVecSize, &parMatSize, &parArrSize, &location); + if (location >= 0) + sprintf(buffer, "// #%i: %s (%s %s) %ix%i [%i] loc %i\n", i, parName, kGlslPrecNames[parPrec], kGlslTypeNames[parType], parVecSize, parMatSize, parArrSize, location); + else + sprintf(buffer, "// #%i: %s (%s %s) %ix%i [%i]\n", i, parName, kGlslPrecNames[parPrec], kGlslTypeNames[parType], parVecSize, parMatSize, parArrSize); + textOpt += buffer; + } + // append uniforms + const int uniformCount = glslopt_shader_get_uniform_count (shader); + const int uniformSize = glslopt_shader_get_uniform_total_size (shader); + if (uniformCount > 0) + { + sprintf(buffer, "// uniforms: %i (total size: %i)\n", uniformCount, uniformSize); + textOpt += buffer; + } + for (int i = 0; i < uniformCount; ++i) + { + const char* parName; + glslopt_basic_type parType; + glslopt_precision parPrec; + int parVecSize, parMatSize, parArrSize, location; + glslopt_shader_get_uniform_desc(shader, i, &parName, &parType, &parPrec, &parVecSize, &parMatSize, &parArrSize, &location); + if (location >= 0) + sprintf(buffer, "// #%i: %s (%s %s) %ix%i [%i] loc %i\n", i, parName, kGlslPrecNames[parPrec], kGlslTypeNames[parType], parVecSize, parMatSize, parArrSize, location); + else + sprintf(buffer, "// #%i: %s (%s %s) %ix%i [%i]\n", i, parName, kGlslPrecNames[parPrec], kGlslTypeNames[parType], parVecSize, parMatSize, parArrSize); + textOpt += buffer; + } + // append textures + const int textureCount = glslopt_shader_get_texture_count (shader); + if (textureCount > 0) + { + sprintf(buffer, "// textures: %i\n", textureCount); + textOpt += buffer; + } + for (int i = 0; i < textureCount; ++i) + { + const char* parName; + glslopt_basic_type parType; + glslopt_precision parPrec; + int parVecSize, parMatSize, parArrSize, location; + glslopt_shader_get_texture_desc(shader, i, &parName, &parType, &parPrec, &parVecSize, &parMatSize, &parArrSize, &location); + if (location >= 0) + sprintf(buffer, "// #%i: %s (%s %s) %ix%i [%i] loc %i\n", i, parName, kGlslPrecNames[parPrec], kGlslTypeNames[parType], parVecSize, parMatSize, parArrSize, location); + else + sprintf(buffer, "// #%i: %s (%s %s) %ix%i [%i]\n", i, parName, kGlslPrecNames[parPrec], kGlslTypeNames[parType], parVecSize, parMatSize, parArrSize); + textOpt += buffer; + } - std::string outputHir; - ReadStringFromFile (hirPath.c_str(), outputHir); std::string outputOpt; ReadStringFromFile (outputPath.c_str(), outputOpt); - if (textHir != outputHir) - { - // write output - FILE* f = fopen (hirPath.c_str(), "wb"); - if (!f) - { - printf ("\n %s: can't write to IR file!\n", testName.c_str()); - } - else - { - fwrite (textHir.c_str(), 1, textHir.size(), f); - fclose (f); - } - printf ("\n %s: does not match raw output\n", testName.c_str()); + if (res && doCheckMetal && !CheckMetal (vertex, gles, testName, "metal", textOpt.c_str())) res = false; - } - + if (textOpt != outputOpt) { // write output @@ -483,11 +612,13 @@ int main (int argc, const char** argv) } bool hasOpenGL = InitializeOpenGL (); + bool hasMetal = InitializeMetal (); glslopt_ctx* ctx[3] = { glslopt_initialize(kGlslTargetOpenGLES20), glslopt_initialize(kGlslTargetOpenGLES30), glslopt_initialize(kGlslTargetOpenGL), }; + glslopt_ctx* ctxMetal = glslopt_initialize(kGlslTargetMetal); std::string baseFolder = argv[1]; @@ -505,8 +636,8 @@ int main (int argc, const char** argv) static const char* kAPIName[3] = { "OpenGL ES 2.0", "OpenGL ES 3.0", "OpenGL" }; static const char* kApiIn [3] = {"-inES.txt", "-inES3.txt", "-in.txt"}; - static const char* kApiIR [3] = {"-irES.txt", "-irES3.txt", "-ir.txt"}; static const char* kApiOut[3] = {"-outES.txt", "-outES3.txt", "-out.txt"}; + static const char* kApiOutMetal[3] = {"-outESMetal.txt", "-outES3Metal.txt", "-outMetal.txt"}; for (int api = 0; api < 3; ++api) { printf ("\n** running %s tests for %s...\n", kTypeName[type], kAPIName[api]); @@ -518,13 +649,22 @@ int main (int argc, const char** argv) std::string inname = inputFiles[i]; //if (inname != "ast-in.txt") // continue; - std::string hirname = inname.substr (0,inname.size()-strlen(kApiIn[api])) + kApiIR[api]; std::string outname = inname.substr (0,inname.size()-strlen(kApiIn[api])) + kApiOut[api]; - bool ok = TestFile (ctx[api], type==0, inname, testFolder + "/" + inname, testFolder + "/" + hirname, testFolder + "/" + outname, api==0, hasOpenGL); + std::string outnameMetal = inname.substr (0,inname.size()-strlen(kApiIn[api])) + kApiOutMetal[api]; + const bool useMetal = (api == 1); + bool ok = TestFile (ctx[api], type==0, inname, testFolder + "/" + inname, testFolder + "/" + outname, api<=1, hasOpenGL, false); if (!ok) { ++errors; } + if (useMetal) + { + ok = TestFile (ctxMetal, type==0, inname, testFolder + "/" + inname, testFolder + "/" + outnameMetal, api==0, false, hasMetal); + if (!ok) + { + ++errors; + } + } ++tests; } } @@ -542,6 +682,7 @@ int main (int argc, const char** argv) for (int i = 0; i < 2; ++i) glslopt_cleanup (ctx[i]); + glslopt_cleanup (ctxMetal); CleanupGL(); return errors ? 1 : 0; diff --git a/3rdparty/glsl-optimizer/tests/tests.js b/3rdparty/glsl-optimizer/tests/tests.js new file mode 100644 index 000000000..1aa9a64e3 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/tests.js @@ -0,0 +1,40 @@ +var glslOptimizer = require('../'); +var assert = require('assert'); + +var fs = require('fs'); +var path = require('path'); +var frag = fs.readFileSync( path.join( __dirname, 'fragment', 'glsl140-basic-in.txt' ), 'utf8' ); + +assert.equal(glslOptimizer.TARGET_OPENGL, 0, 'exports TARGET_OPENGL'); +assert.equal(glslOptimizer.TARGET_OPENGLES20, 1, 'exports TARGET_OPENGLES20'); +assert.equal(glslOptimizer.TARGET_OPENGLES30, 2, 'exports TARGET_OPENGLES30'); +assert.equal(glslOptimizer.VERTEX_SHADER, 0, 'exports VERTEX_SHADER'); +assert.equal(glslOptimizer.FRAGMENT_SHADER, 1, 'exports FRAGMENT_SHADER'); +assert.equal(typeof glslOptimizer.Compiler, 'function', 'exports Compiler constructor'); + +var ESSL = false; + +//First we need to create a new compiler +var compiler = new glslOptimizer.Compiler(2); + +assert.equal(typeof compiler.dispose, 'function', 'exports Compiler#dispose()'); + +var shader = new glslOptimizer.Shader(compiler, glslOptimizer.FRAGMENT_SHADER, frag); + +var didCompile = shader.compiled(); +var raw = shader.rawOutput(); +var output = shader.output(); +var log = shader.log(); + +assert.equal(typeof didCompile, 'boolean', 'exports compiled()'); +assert.equal(typeof raw, 'string', 'exports rawOutput()'); +assert.equal(typeof output, 'string', 'exports output()'); +assert.equal(typeof log, 'string', 'exports log()'); + +console.log(output, didCompile); + +//Clean up shader... +shader.dispose(); + +//Clean up after we've created our compiler +compiler.dispose(); \ No newline at end of file diff --git a/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-inES3.txt b/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-inES3.txt new file mode 100644 index 000000000..08a16977e --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-inES3.txt @@ -0,0 +1,162 @@ +#version 300 es + +float xll_mod( float x, float y ) { + float d = x / y; + float f = fract (abs(d)) * y; + return d >= 0.0 ? f : -f; +} +vec2 xll_mod( vec2 x, vec2 y ) { + vec2 d = x / y; + vec2 f = fract (abs(d)) * y; + return vec2 (d.x >= 0.0 ? f.x : -f.x, d.y >= 0.0 ? f.y : -f.y); +} +vec3 xll_mod( vec3 x, vec3 y ) { + vec3 d = x / y; + vec3 f = fract (abs(d)) * y; + return vec3 (d.x >= 0.0 ? f.x : -f.x, d.y >= 0.0 ? f.y : -f.y, d.z >= 0.0 ? f.z : -f.z); +} +vec4 xll_mod( vec4 x, vec4 y ) { + vec4 d = x / y; + vec4 f = fract (abs(d)) * y; + return vec4 (d.x >= 0.0 ? f.x : -f.x, d.y >= 0.0 ? f.y : -f.y, d.z >= 0.0 ? f.z : -f.z, d.w >= 0.0 ? f.w : -f.w); +} +float xll_saturate( float x) { + return clamp( x, 0.0, 1.0); +} +vec2 xll_saturate( vec2 x) { + return clamp( x, 0.0, 1.0); +} +vec3 xll_saturate( vec3 x) { + return clamp( x, 0.0, 1.0); +} +vec4 xll_saturate( vec4 x) { + return clamp( x, 0.0, 1.0); +} +mat2 xll_saturate(mat2 m) { + return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0)); +} +mat3 xll_saturate(mat3 m) { + return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0)); +} +mat4 xll_saturate(mat4 m) { + return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0)); +} +struct v2f { + highp vec4 pos; + highp vec2 uv; + lowp vec4 color; +}; +struct appdata_full { + highp vec4 vertex; + highp vec4 tangent; + highp vec3 normal; + highp vec4 texcoord; + highp vec4 texcoord1; + highp vec4 color; +}; +uniform highp float _Bias; +uniform highp float _BlinkingTimeOffsScale; +uniform highp vec4 _Color; +uniform highp float _FadeOutDistFar; +uniform highp float _FadeOutDistNear; +uniform highp float _MaxGrowSize; +uniform highp float _Multiplier; +uniform highp float _NoiseAmount; +uniform highp float _SizeGrowEndDist; +uniform highp float _SizeGrowStartDist; +uniform highp vec4 _Time; +uniform highp float _TimeOffDuration; +uniform highp float _TimeOnDuration; +uniform highp float _VerticalBillboarding; +uniform highp mat4 _World2Object; +uniform highp vec3 _WorldSpaceCameraPos; +uniform highp mat4 glstate_matrix_mvp; +void CalcOrthonormalBasis( in highp vec3 dir, out highp vec3 right, out highp vec3 up ); +highp float CalcFadeOutFactor( in highp float dist ); +highp float CalcDistScale( in highp float dist ); +v2f xlat_main( in appdata_full v ); +void CalcOrthonormalBasis( in highp vec3 dir, out highp vec3 right, out highp vec3 up ) { + up = (( (abs( dir.y ) > 0.999000) ) ? ( vec3( 0.0, 0.0, 1.0) ) : ( vec3( 0.0, 1.0, 0.0) )); + right = normalize( cross( up, dir) ); + up = cross( dir, right); +} +highp float CalcFadeOutFactor( in highp float dist ) { + highp float nfadeout; + highp float ffadeout; + nfadeout = xll_saturate( (dist / _FadeOutDistNear) ); + ffadeout = (1.00000 - xll_saturate( (max( (dist - _FadeOutDistFar), 0.00000) * 0.200000) )); + ffadeout *= ffadeout; + nfadeout *= nfadeout; + nfadeout *= nfadeout; + nfadeout *= ffadeout; + return nfadeout; +} +highp float CalcDistScale( in highp float dist ) { + highp float distScale; + distScale = min( (max( (dist - _SizeGrowStartDist), 0.00000) / _SizeGrowEndDist), 1.00000); + return ((distScale * distScale) * _MaxGrowSize); +} +v2f xlat_main( in appdata_full v ) { + highp vec3 centerOffs; + highp vec3 centerLocal; + highp vec3 viewerLocal; + highp vec3 localDir; + highp float localDirLength; + highp vec3 rightLocal; + highp vec3 upLocal; + highp float distScale; + highp vec3 BBNormal; + highp vec3 BBLocalPos; + highp float time; + highp float fracTime; + highp float wave; + highp float noiseTime; + highp float noise; + highp float noiseWave; + v2f o; + centerOffs = (vec3( (vec2( 0.500000) - v.color.xy ), 0.00000) * v.texcoord1.xyy ); + centerLocal = (v.vertex.xyz + centerOffs.xyz ); + viewerLocal = vec3( ( _World2Object * vec4( _WorldSpaceCameraPos, 1.00000) )); + localDir = (viewerLocal - centerLocal); + localDir.y = mix( 0.00000, localDir.y , _VerticalBillboarding); + localDirLength = length( localDir ); + CalcOrthonormalBasis( (localDir / localDirLength), rightLocal, upLocal); + distScale = (CalcDistScale( localDirLength) * v.color.w ); + BBNormal = ((rightLocal * v.normal.x ) + (upLocal * v.normal.y )); + BBLocalPos = ((centerLocal - ((rightLocal * centerOffs.x ) + (upLocal * centerOffs.y ))) + (BBNormal * distScale)); + time = (_Time.y + (_BlinkingTimeOffsScale * v.color.z )); + fracTime = xll_mod( time, (_TimeOnDuration + _TimeOffDuration)); + wave = (smoothstep( 0.00000, (_TimeOnDuration * 0.250000), fracTime) * (1.00000 - smoothstep( (_TimeOnDuration * 0.750000), _TimeOnDuration, fracTime))); + noiseTime = (time * (6.28319 / _TimeOnDuration)); + noise = (sin( noiseTime ) * ((0.500000 * cos( ((noiseTime * 0.636600) + 56.7272) )) + 0.500000)); + noiseWave = ((_NoiseAmount * noise) + (1.00000 - _NoiseAmount)); + wave = (( (_NoiseAmount < 0.0100000) ) ? ( wave ) : ( noiseWave )); + wave += _Bias; + o.uv = v.texcoord.xy ; + o.pos = ( glstate_matrix_mvp * vec4( BBLocalPos, 1.00000) ); + o.color = (((CalcFadeOutFactor( localDirLength) * _Color) * _Multiplier) * wave); + return o; +} +in highp vec4 _inVertex; +in mediump vec3 _inNormal; +in highp vec4 _uv0; +in highp vec4 _uv1; +in lowp vec4 _color; +in vec4 TANGENT; +out highp vec4 xlv_SV_POSITION; +out highp vec2 xlv_TEXCOORD0; +out lowp vec4 xlv_TEXCOORD1; +void main() { + v2f xl_retval; + appdata_full xlt_v; + xlt_v.vertex = _inVertex; + xlt_v.tangent = TANGENT; + xlt_v.normal = _inNormal; + xlt_v.texcoord = _uv0; + xlt_v.texcoord1 = _uv1; + xlt_v.color = _color; + xl_retval = xlat_main( xlt_v); + xlv_SV_POSITION = vec4( xl_retval.pos); + xlv_TEXCOORD0 = vec2( xl_retval.uv); + xlv_TEXCOORD1 = vec4( xl_retval.color); +} diff --git a/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-irES.txt b/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-irES.txt deleted file mode 100644 index 3bf5c3295..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-irES.txt +++ /dev/null @@ -1,555 +0,0 @@ -struct v2f { - highp vec4 pos; - highp vec2 uv; - lowp vec4 color; -}; -struct appdata_full { - highp vec4 vertex; - highp vec4 tangent; - highp vec3 normal; - highp vec4 texcoord; - highp vec4 texcoord1; - highp vec4 color; -}; -attribute highp vec4 _glesVertex; -attribute mediump vec3 _glesNormal; -attribute highp vec4 _glesMultiTexCoord0; -attribute highp vec4 _glesMultiTexCoord1; -attribute lowp vec4 _glesColor; -uniform highp float _Bias; -uniform highp float _BlinkingTimeOffsScale; -uniform highp vec4 _Color; -uniform highp float _FadeOutDistFar; -uniform highp float _FadeOutDistNear; -uniform highp float _MaxGrowSize; -uniform highp float _Multiplier; -uniform highp float _NoiseAmount; -uniform highp float _SizeGrowEndDist; -uniform highp float _SizeGrowStartDist; -uniform highp vec4 _Time; -uniform highp float _TimeOffDuration; -uniform highp float _TimeOnDuration; -uniform highp float _VerticalBillboarding; -uniform highp mat4 _World2Object; -uniform highp vec3 _WorldSpaceCameraPos; -uniform highp mat4 glstate_matrix_mvp; -attribute vec4 TANGENT; -varying highp vec4 xlv_SV_POSITION; -varying highp vec2 xlv_TEXCOORD0; -varying lowp vec4 xlv_TEXCOORD1; -float xll_mod ( - in float x_1, - in float y_2 -) -{ - float f_3; - float d_4; - float tmpvar_5; - tmpvar_5 = (x_1 / y_2); - d_4 = tmpvar_5; - float tmpvar_6; - tmpvar_6 = abs (d_4); - float tmpvar_7; - tmpvar_7 = fract (tmpvar_6); - float tmpvar_8; - tmpvar_8 = (tmpvar_7 * y_2); - f_3 = tmpvar_8; - float tmpvar_9; - if ((d_4 >= 0.0)) { - tmpvar_9 = f_3; - } else { - tmpvar_9 = -(f_3); - }; - return tmpvar_9; -} - -vec2 xll_mod ( - in vec2 x_10, - in vec2 y_11 -) -{ - vec2 f_12; - vec2 d_13; - vec2 tmpvar_14; - tmpvar_14 = (x_10 / y_11); - d_13 = tmpvar_14; - vec2 tmpvar_15; - tmpvar_15 = abs (d_13); - vec2 tmpvar_16; - tmpvar_16 = fract (tmpvar_15); - vec2 tmpvar_17; - tmpvar_17 = (tmpvar_16 * y_11); - f_12 = tmpvar_17; - float tmpvar_18; - if ((d_13.x >= 0.0)) { - tmpvar_18 = f_12.x; - } else { - tmpvar_18 = -(f_12.x); - }; - float tmpvar_19; - if ((d_13.y >= 0.0)) { - tmpvar_19 = f_12.y; - } else { - tmpvar_19 = -(f_12.y); - }; - vec2 tmpvar_20; - tmpvar_20.x = tmpvar_18; - tmpvar_20.y = tmpvar_19; - return tmpvar_20; -} - -vec3 xll_mod ( - in vec3 x_21, - in vec3 y_22 -) -{ - vec3 f_23; - vec3 d_24; - vec3 tmpvar_25; - tmpvar_25 = (x_21 / y_22); - d_24 = tmpvar_25; - vec3 tmpvar_26; - tmpvar_26 = abs (d_24); - vec3 tmpvar_27; - tmpvar_27 = fract (tmpvar_26); - vec3 tmpvar_28; - tmpvar_28 = (tmpvar_27 * y_22); - f_23 = tmpvar_28; - float tmpvar_29; - if ((d_24.x >= 0.0)) { - tmpvar_29 = f_23.x; - } else { - tmpvar_29 = -(f_23.x); - }; - float tmpvar_30; - if ((d_24.y >= 0.0)) { - tmpvar_30 = f_23.y; - } else { - tmpvar_30 = -(f_23.y); - }; - float tmpvar_31; - if ((d_24.z >= 0.0)) { - tmpvar_31 = f_23.z; - } else { - tmpvar_31 = -(f_23.z); - }; - vec3 tmpvar_32; - tmpvar_32.x = tmpvar_29; - tmpvar_32.y = tmpvar_30; - tmpvar_32.z = tmpvar_31; - return tmpvar_32; -} - -vec4 xll_mod ( - in vec4 x_33, - in vec4 y_34 -) -{ - vec4 f_35; - vec4 d_36; - vec4 tmpvar_37; - tmpvar_37 = (x_33 / y_34); - d_36 = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = abs (d_36); - vec4 tmpvar_39; - tmpvar_39 = fract (tmpvar_38); - vec4 tmpvar_40; - tmpvar_40 = (tmpvar_39 * y_34); - f_35 = tmpvar_40; - float tmpvar_41; - if ((d_36.x >= 0.0)) { - tmpvar_41 = f_35.x; - } else { - tmpvar_41 = -(f_35.x); - }; - float tmpvar_42; - if ((d_36.y >= 0.0)) { - tmpvar_42 = f_35.y; - } else { - tmpvar_42 = -(f_35.y); - }; - float tmpvar_43; - if ((d_36.z >= 0.0)) { - tmpvar_43 = f_35.z; - } else { - tmpvar_43 = -(f_35.z); - }; - float tmpvar_44; - if ((d_36.w >= 0.0)) { - tmpvar_44 = f_35.w; - } else { - tmpvar_44 = -(f_35.w); - }; - vec4 tmpvar_45; - tmpvar_45.x = tmpvar_41; - tmpvar_45.y = tmpvar_42; - tmpvar_45.z = tmpvar_43; - tmpvar_45.w = tmpvar_44; - return tmpvar_45; -} - -float xll_saturate ( - in float x_46 -) -{ - float tmpvar_47; - tmpvar_47 = clamp (x_46, 0.0, 1.0); - return tmpvar_47; -} - -vec2 xll_saturate ( - in vec2 x_48 -) -{ - vec2 tmpvar_49; - tmpvar_49 = clamp (x_48, 0.0, 1.0); - return tmpvar_49; -} - -vec3 xll_saturate ( - in vec3 x_50 -) -{ - vec3 tmpvar_51; - tmpvar_51 = clamp (x_50, 0.0, 1.0); - return tmpvar_51; -} - -vec4 xll_saturate ( - in vec4 x_52 -) -{ - vec4 tmpvar_53; - tmpvar_53 = clamp (x_52, 0.0, 1.0); - return tmpvar_53; -} - -mat2 xll_saturate ( - in mat2 m_54 -) -{ - vec2 tmpvar_55; - tmpvar_55 = clamp (m_54[0], 0.0, 1.0); - vec2 tmpvar_56; - tmpvar_56 = clamp (m_54[1], 0.0, 1.0); - mat2 tmpvar_57; - vec2 tmpvar_58; - tmpvar_58 = tmpvar_55; - tmpvar_57[0] = tmpvar_58; - vec2 tmpvar_59; - tmpvar_59 = tmpvar_56; - tmpvar_57[1] = tmpvar_59; - return tmpvar_57; -} - -mat3 xll_saturate ( - in mat3 m_60 -) -{ - vec3 tmpvar_61; - tmpvar_61 = clamp (m_60[0], 0.0, 1.0); - vec3 tmpvar_62; - tmpvar_62 = clamp (m_60[1], 0.0, 1.0); - vec3 tmpvar_63; - tmpvar_63 = clamp (m_60[2], 0.0, 1.0); - mat3 tmpvar_64; - vec3 tmpvar_65; - tmpvar_65 = tmpvar_61; - tmpvar_64[0] = tmpvar_65; - vec3 tmpvar_66; - tmpvar_66 = tmpvar_62; - tmpvar_64[1] = tmpvar_66; - vec3 tmpvar_67; - tmpvar_67 = tmpvar_63; - tmpvar_64[2] = tmpvar_67; - return tmpvar_64; -} - -mat4 xll_saturate ( - in mat4 m_68 -) -{ - vec4 tmpvar_69; - tmpvar_69 = clamp (m_68[0], 0.0, 1.0); - vec4 tmpvar_70; - tmpvar_70 = clamp (m_68[1], 0.0, 1.0); - vec4 tmpvar_71; - tmpvar_71 = clamp (m_68[2], 0.0, 1.0); - vec4 tmpvar_72; - tmpvar_72 = clamp (m_68[3], 0.0, 1.0); - mat4 tmpvar_73; - vec4 tmpvar_74; - tmpvar_74 = tmpvar_69; - tmpvar_73[0] = tmpvar_74; - vec4 tmpvar_75; - tmpvar_75 = tmpvar_70; - tmpvar_73[1] = tmpvar_75; - vec4 tmpvar_76; - tmpvar_76 = tmpvar_71; - tmpvar_73[2] = tmpvar_76; - vec4 tmpvar_77; - tmpvar_77 = tmpvar_72; - tmpvar_73[3] = tmpvar_77; - return tmpvar_73; -} - -void CalcOrthonormalBasis ( - in highp vec3 dir_78, - out highp vec3 right_79, - out highp vec3 up_80 -) -{ - highp float tmpvar_81; - tmpvar_81 = abs (dir_78.y); - vec3 tmpvar_82; - if ((tmpvar_81 > 0.999)) { - tmpvar_82 = vec3(0.0, 0.0, 1.0); - } else { - tmpvar_82 = vec3(0.0, 1.0, 0.0); - }; - vec3 tmpvar_83; - tmpvar_83 = tmpvar_82; - up_80 = tmpvar_83; - highp vec3 tmpvar_84; - tmpvar_84 = cross (up_80, dir_78); - highp vec3 tmpvar_85; - tmpvar_85 = normalize (tmpvar_84); - highp vec3 tmpvar_86; - tmpvar_86 = tmpvar_85; - right_79 = tmpvar_86; - highp vec3 tmpvar_87; - tmpvar_87 = cross (dir_78, right_79); - highp vec3 tmpvar_88; - tmpvar_88 = tmpvar_87; - up_80 = tmpvar_88; -} - -float CalcFadeOutFactor ( - in highp float dist_89 -) -{ - highp float ffadeout_90; - highp float nfadeout_91; - float tmpvar_92; - tmpvar_92 = xll_saturate ((dist_89 / _FadeOutDistNear)); - float tmpvar_93; - tmpvar_93 = tmpvar_92; - nfadeout_91 = tmpvar_93; - highp float tmpvar_94; - tmpvar_94 = max ((dist_89 - _FadeOutDistFar), 0.0); - float tmpvar_95; - tmpvar_95 = xll_saturate ((tmpvar_94 * 0.2)); - float tmpvar_96; - tmpvar_96 = (1.0 - tmpvar_95); - ffadeout_90 = tmpvar_96; - highp float tmpvar_97; - tmpvar_97 = (ffadeout_90 * ffadeout_90); - ffadeout_90 = tmpvar_97; - highp float tmpvar_98; - tmpvar_98 = (nfadeout_91 * nfadeout_91); - nfadeout_91 = tmpvar_98; - highp float tmpvar_99; - tmpvar_99 = (nfadeout_91 * nfadeout_91); - nfadeout_91 = tmpvar_99; - highp float tmpvar_100; - tmpvar_100 = (nfadeout_91 * ffadeout_90); - nfadeout_91 = tmpvar_100; - return nfadeout_91; -} - -float CalcDistScale ( - in highp float dist_101 -) -{ - highp float distScale_102; - highp float tmpvar_103; - tmpvar_103 = max ((dist_101 - _SizeGrowStartDist), 0.0); - highp float tmpvar_104; - tmpvar_104 = min ((tmpvar_103 / _SizeGrowEndDist), 1.0); - highp float tmpvar_105; - tmpvar_105 = tmpvar_104; - distScale_102 = tmpvar_105; - return ((distScale_102 * distScale_102) * _MaxGrowSize); -} - -v2f xlat_main ( - in appdata_full v_106 -) -{ - v2f o_107; - highp float noiseWave_108; - highp float noise_109; - highp float noiseTime_110; - highp float wave_111; - highp float fracTime_112; - highp float time_113; - highp vec3 BBLocalPos_114; - highp vec3 BBNormal_115; - highp float distScale_116; - highp vec3 upLocal_117; - highp vec3 rightLocal_118; - highp float localDirLength_119; - highp vec3 localDir_120; - highp vec3 viewerLocal_121; - highp vec3 centerLocal_122; - highp vec3 centerOffs_123; - highp vec3 tmpvar_124; - tmpvar_124.z = 0.0; - tmpvar_124.xy = (vec2(0.5, 0.5) - v_106.color.xy).xy; - highp vec3 tmpvar_125; - tmpvar_125 = (tmpvar_124 * v_106.texcoord1.xyy); - centerOffs_123 = tmpvar_125; - highp vec3 tmpvar_126; - tmpvar_126 = (v_106.vertex.xyz + centerOffs_123.xyz); - centerLocal_122 = tmpvar_126; - highp vec4 tmpvar_127; - tmpvar_127.w = 1.0; - tmpvar_127.xyz = _WorldSpaceCameraPos.xyz; - highp vec3 tmpvar_128; - tmpvar_128 = (_World2Object * tmpvar_127).xyz; - highp vec3 tmpvar_129; - tmpvar_129 = tmpvar_128; - viewerLocal_121 = tmpvar_129; - highp vec3 tmpvar_130; - tmpvar_130 = (viewerLocal_121 - centerLocal_122); - localDir_120 = tmpvar_130; - highp float tmpvar_131; - tmpvar_131 = mix (0.0, localDir_120.y, _VerticalBillboarding); - highp float tmpvar_132; - tmpvar_132 = tmpvar_131; - localDir_120.y = vec2(tmpvar_132).y; - highp float tmpvar_133; - tmpvar_133 = length (localDir_120); - highp float tmpvar_134; - tmpvar_134 = tmpvar_133; - localDirLength_119 = tmpvar_134; - CalcOrthonormalBasis ((localDir_120 / localDirLength_119), rightLocal_118, upLocal_117); - highp float tmpvar_135; - tmpvar_135 = CalcDistScale (localDirLength_119); - highp float tmpvar_136; - tmpvar_136 = (tmpvar_135 * v_106.color.w); - distScale_116 = tmpvar_136; - highp vec3 tmpvar_137; - tmpvar_137 = ((rightLocal_118 * v_106.normal.x) + (upLocal_117 * v_106.normal.y)); - BBNormal_115 = tmpvar_137; - highp vec3 tmpvar_138; - tmpvar_138 = ((centerLocal_122 - ( - (rightLocal_118 * centerOffs_123.x) - + - (upLocal_117 * centerOffs_123.y) - )) + (BBNormal_115 * distScale_116)); - BBLocalPos_114 = tmpvar_138; - highp float tmpvar_139; - tmpvar_139 = (_Time.y + (_BlinkingTimeOffsScale * v_106.color.z)); - time_113 = tmpvar_139; - float tmpvar_140; - tmpvar_140 = xll_mod (time_113, (_TimeOnDuration + _TimeOffDuration)); - float tmpvar_141; - tmpvar_141 = tmpvar_140; - fracTime_112 = tmpvar_141; - highp float tmpvar_142; - tmpvar_142 = smoothstep (0.0, (_TimeOnDuration * 0.25), fracTime_112); - highp float tmpvar_143; - tmpvar_143 = smoothstep ((_TimeOnDuration * 0.75), _TimeOnDuration, fracTime_112); - highp float tmpvar_144; - tmpvar_144 = (tmpvar_142 * (1.0 - tmpvar_143)); - wave_111 = tmpvar_144; - highp float tmpvar_145; - tmpvar_145 = (time_113 * (6.28319 / _TimeOnDuration)); - noiseTime_110 = tmpvar_145; - highp float tmpvar_146; - tmpvar_146 = sin (noiseTime_110); - highp float tmpvar_147; - tmpvar_147 = cos (((noiseTime_110 * 0.6366) + 56.7272)); - highp float tmpvar_148; - tmpvar_148 = (tmpvar_146 * ((0.5 * tmpvar_147) + 0.5)); - noise_109 = tmpvar_148; - highp float tmpvar_149; - tmpvar_149 = ((_NoiseAmount * noise_109) + (1.0 - _NoiseAmount)); - noiseWave_108 = tmpvar_149; - highp float tmpvar_150; - if ((_NoiseAmount < 0.01)) { - tmpvar_150 = wave_111; - } else { - tmpvar_150 = noiseWave_108; - }; - highp float tmpvar_151; - tmpvar_151 = tmpvar_150; - wave_111 = tmpvar_151; - highp float tmpvar_152; - tmpvar_152 = (wave_111 + _Bias); - wave_111 = tmpvar_152; - highp vec2 tmpvar_153; - tmpvar_153 = v_106.texcoord.xy; - o_107.uv = tmpvar_153; - highp vec4 tmpvar_154; - tmpvar_154.w = 1.0; - tmpvar_154.xyz = BBLocalPos_114.xyz; - highp vec4 tmpvar_155; - tmpvar_155 = (glstate_matrix_mvp * tmpvar_154); - o_107.pos = tmpvar_155; - highp float tmpvar_156; - tmpvar_156 = CalcFadeOutFactor (localDirLength_119); - highp vec4 tmpvar_157; - tmpvar_157 = (((tmpvar_156 * _Color) * _Multiplier) * wave_111); - o_107.color = tmpvar_157; - return o_107; -} - -void main () -{ - appdata_full xlt_v_158; - v2f xl_retval_159; - highp vec4 tmpvar_160; - tmpvar_160 = _glesVertex.xyzw; - highp vec4 tmpvar_161; - tmpvar_161 = tmpvar_160; - xlt_v_158.vertex = tmpvar_161; - vec4 tmpvar_162; - tmpvar_162 = TANGENT.xyzw; - vec4 tmpvar_163; - tmpvar_163 = tmpvar_162; - xlt_v_158.tangent = tmpvar_163; - mediump vec3 tmpvar_164; - tmpvar_164 = _glesNormal.xyz; - mediump vec3 tmpvar_165; - tmpvar_165 = tmpvar_164; - xlt_v_158.normal = tmpvar_165; - highp vec4 tmpvar_166; - tmpvar_166 = _glesMultiTexCoord0.xyzw; - highp vec4 tmpvar_167; - tmpvar_167 = tmpvar_166; - xlt_v_158.texcoord = tmpvar_167; - highp vec4 tmpvar_168; - tmpvar_168 = _glesMultiTexCoord1.xyzw; - highp vec4 tmpvar_169; - tmpvar_169 = tmpvar_168; - xlt_v_158.texcoord1 = tmpvar_169; - lowp vec4 tmpvar_170; - tmpvar_170 = _glesColor.xyzw; - lowp vec4 tmpvar_171; - tmpvar_171 = tmpvar_170; - xlt_v_158.color = tmpvar_171; - v2f tmpvar_172; - tmpvar_172 = xlat_main (xlt_v_158); - v2f tmpvar_173; - tmpvar_173 = tmpvar_172; - xl_retval_159 = tmpvar_173; - highp vec4 tmpvar_174; - tmpvar_174 = xl_retval_159.pos.xyzw; - highp vec4 tmpvar_175; - tmpvar_175 = tmpvar_174; - xlv_SV_POSITION = tmpvar_175; - highp vec2 tmpvar_176; - tmpvar_176 = xl_retval_159.uv.xy; - highp vec2 tmpvar_177; - tmpvar_177 = tmpvar_176; - xlv_TEXCOORD0 = tmpvar_177; - lowp vec4 tmpvar_178; - tmpvar_178 = xl_retval_159.color.xyzw; - lowp vec4 tmpvar_179; - tmpvar_179 = tmpvar_178; - xlv_TEXCOORD1 = tmpvar_179; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES.txt b/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES.txt index 9545d98ac..98c2d6470 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES.txt @@ -30,115 +30,139 @@ void main () tmpvar_1 = _glesNormal; tmpvar_2 = _glesColor; lowp vec4 tmpvar_3; - highp vec3 localDir_4; - highp vec3 tmpvar_5; - tmpvar_5.z = 0.0; - tmpvar_5.xy = (vec2(0.5, 0.5) - tmpvar_2.xy); - highp vec3 tmpvar_6; - tmpvar_6 = (tmpvar_5 * _glesMultiTexCoord1.xyy); - highp vec3 tmpvar_7; - tmpvar_7 = (_glesVertex.xyz + tmpvar_6); - highp vec4 tmpvar_8; - tmpvar_8.w = 1.0; - tmpvar_8.xyz = _WorldSpaceCameraPos; - highp vec3 tmpvar_9; - tmpvar_9 = ((_World2Object * tmpvar_8).xyz - tmpvar_7); - localDir_4.xz = tmpvar_9.xz; - localDir_4.y = mix (0.0, tmpvar_9.y, _VerticalBillboarding); - highp float tmpvar_10; - tmpvar_10 = sqrt(dot (localDir_4, localDir_4)); - highp vec3 dir_11; - dir_11 = (localDir_4 / tmpvar_10); - highp float tmpvar_12; - tmpvar_12 = abs(dir_11.y); - vec3 tmpvar_13; - if ((tmpvar_12 > 0.999)) { - tmpvar_13 = vec3(0.0, 0.0, 1.0); - } else { - tmpvar_13 = vec3(0.0, 1.0, 0.0); - }; - highp vec3 tmpvar_14; - tmpvar_14 = normalize(((tmpvar_13.yzx * dir_11.zxy) - (tmpvar_13.zxy * dir_11.yzx))); - highp vec3 tmpvar_15; - tmpvar_15 = ((dir_11.yzx * tmpvar_14.zxy) - (dir_11.zxy * tmpvar_14.yzx)); + highp float noiseWave_4; + highp float noiseTime_5; + highp float wave_6; + highp float time_7; + highp vec3 BBLocalPos_8; + highp vec3 localDir_9; + highp vec3 centerLocal_10; + highp vec3 centerOffs_11; + highp vec3 tmpvar_12; + tmpvar_12.z = 0.0; + tmpvar_12.xy = (vec2(0.5, 0.5) - tmpvar_2.xy); + centerOffs_11 = (tmpvar_12 * _glesMultiTexCoord1.xyy); + centerLocal_10 = (_glesVertex.xyz + centerOffs_11); + highp vec4 tmpvar_13; + tmpvar_13.w = 1.0; + tmpvar_13.xyz = _WorldSpaceCameraPos; + localDir_9 = ((_World2Object * tmpvar_13).xyz - centerLocal_10); + localDir_9.y = (localDir_9.y * _VerticalBillboarding); + highp float tmpvar_14; + tmpvar_14 = sqrt(dot (localDir_9, localDir_9)); + highp vec3 dir_15; + dir_15 = (localDir_9 / tmpvar_14); highp float tmpvar_16; - tmpvar_16 = min ((max ( - (tmpvar_10 - _SizeGrowStartDist) - , 0.0) / _SizeGrowEndDist), 1.0); - highp vec3 tmpvar_17; - tmpvar_17 = ((tmpvar_7 - ( - (tmpvar_14 * tmpvar_6.x) - + - (tmpvar_15 * tmpvar_6.y) - )) + (( - (tmpvar_14 * tmpvar_1.x) - + - (tmpvar_15 * tmpvar_1.y) - ) * ( - ((tmpvar_16 * tmpvar_16) * _MaxGrowSize) - * tmpvar_2.w))); - highp float tmpvar_18; - tmpvar_18 = (_Time.y + (_BlinkingTimeOffsScale * tmpvar_2.z)); - highp float y_19; - y_19 = (_TimeOnDuration + _TimeOffDuration); - highp float tmpvar_20; - tmpvar_20 = (tmpvar_18 / y_19); - highp float tmpvar_21; - tmpvar_21 = (fract(abs(tmpvar_20)) * y_19); - highp float tmpvar_22; - if ((tmpvar_20 >= 0.0)) { - tmpvar_22 = tmpvar_21; + tmpvar_16 = abs(dir_15.y); + vec3 tmpvar_17; + if ((tmpvar_16 > 0.999)) { + tmpvar_17 = vec3(0.0, 0.0, 1.0); } else { - tmpvar_22 = -(tmpvar_21); + tmpvar_17 = vec3(0.0, 1.0, 0.0); }; - highp float tmpvar_23; - tmpvar_23 = clamp ((tmpvar_22 / (_TimeOnDuration * 0.25)), 0.0, 1.0); - highp float edge0_24; - edge0_24 = (_TimeOnDuration * 0.75); - highp float tmpvar_25; - tmpvar_25 = clamp (((tmpvar_22 - edge0_24) / (_TimeOnDuration - edge0_24)), 0.0, 1.0); - highp float tmpvar_26; - tmpvar_26 = ((tmpvar_23 * (tmpvar_23 * - (3.0 - (2.0 * tmpvar_23)) - )) * (1.0 - (tmpvar_25 * - (tmpvar_25 * (3.0 - (2.0 * tmpvar_25))) + highp vec3 tmpvar_18; + tmpvar_18 = normalize(((tmpvar_17.yzx * dir_15.zxy) - (tmpvar_17.zxy * dir_15.yzx))); + highp vec3 tmpvar_19; + tmpvar_19 = ((dir_15.yzx * tmpvar_18.zxy) - (dir_15.zxy * tmpvar_18.yzx)); + highp float tmpvar_20; + tmpvar_20 = min ((max ( + (tmpvar_14 - _SizeGrowStartDist) + , 0.0) / _SizeGrowEndDist), 1.0); + BBLocalPos_8 = ((centerLocal_10 - ( + (tmpvar_18 * centerOffs_11.x) + + + (tmpvar_19 * centerOffs_11.y) + )) + (( + (tmpvar_18 * tmpvar_1.x) + + + (tmpvar_19 * tmpvar_1.y) + ) * ( + (tmpvar_20 * tmpvar_20) + * + (_MaxGrowSize * tmpvar_2.w) ))); + time_7 = (_Time.y + (_BlinkingTimeOffsScale * tmpvar_2.z)); + highp float y_21; + y_21 = (_TimeOnDuration + _TimeOffDuration); + highp float tmpvar_22; + tmpvar_22 = (time_7 / y_21); + highp float tmpvar_23; + tmpvar_23 = (fract(abs(tmpvar_22)) * y_21); + highp float tmpvar_24; + if ((tmpvar_22 >= 0.0)) { + tmpvar_24 = tmpvar_23; + } else { + tmpvar_24 = -(tmpvar_23); + }; + highp float tmpvar_25; + tmpvar_25 = clamp ((tmpvar_24 / (_TimeOnDuration * 0.25)), 0.0, 1.0); + highp float edge0_26; + edge0_26 = (_TimeOnDuration * 0.75); highp float tmpvar_27; - tmpvar_27 = (tmpvar_18 * (6.28319 / _TimeOnDuration)); - highp float tmpvar_28; - tmpvar_28 = ((_NoiseAmount * ( - sin(tmpvar_27) + tmpvar_27 = clamp (((tmpvar_24 - edge0_26) / (_TimeOnDuration - edge0_26)), 0.0, 1.0); + wave_6 = ((tmpvar_25 * (tmpvar_25 * + (3.0 - (2.0 * tmpvar_25)) + )) * (1.0 - (tmpvar_27 * + (tmpvar_27 * (3.0 - (2.0 * tmpvar_27))) + ))); + noiseTime_5 = (time_7 * (6.28319 / _TimeOnDuration)); + noiseWave_4 = ((_NoiseAmount * ( + sin(noiseTime_5) * ((0.5 * cos(( - (tmpvar_27 * 0.6366) + (noiseTime_5 * 0.6366) + 56.7272))) + 0.5) )) + (1.0 - _NoiseAmount)); - highp float tmpvar_29; + highp float tmpvar_28; if ((_NoiseAmount < 0.01)) { - tmpvar_29 = tmpvar_26; + tmpvar_28 = wave_6; } else { - tmpvar_29 = tmpvar_28; + tmpvar_28 = noiseWave_4; }; - highp vec4 tmpvar_30; - tmpvar_30.w = 1.0; - tmpvar_30.xyz = tmpvar_17; - highp float tmpvar_31; - tmpvar_31 = clamp ((tmpvar_10 / _FadeOutDistNear), 0.0, 1.0); + wave_6 = (tmpvar_28 + _Bias); + highp vec4 tmpvar_29; + tmpvar_29.w = 1.0; + tmpvar_29.xyz = BBLocalPos_8; + highp float ffadeout_30; + highp float nfadeout_31; highp float tmpvar_32; - tmpvar_32 = (1.0 - clamp (( - max ((tmpvar_10 - _FadeOutDistFar), 0.0) + tmpvar_32 = clamp ((tmpvar_14 / _FadeOutDistNear), 0.0, 1.0); + ffadeout_30 = (1.0 - clamp (( + max ((tmpvar_14 - _FadeOutDistFar), 0.0) * 0.2), 0.0, 1.0)); - highp float tmpvar_33; - tmpvar_33 = (tmpvar_31 * tmpvar_31); - highp vec4 tmpvar_34; - tmpvar_34 = ((( - ((tmpvar_33 * tmpvar_33) * (tmpvar_32 * tmpvar_32)) - * _Color) * _Multiplier) * (tmpvar_29 + _Bias)); - tmpvar_3 = tmpvar_34; - xlv_SV_POSITION = (glstate_matrix_mvp * tmpvar_30); + ffadeout_30 = (ffadeout_30 * ffadeout_30); + nfadeout_31 = (tmpvar_32 * tmpvar_32); + nfadeout_31 = (nfadeout_31 * nfadeout_31); + nfadeout_31 = (nfadeout_31 * ffadeout_30); + tmpvar_3 = ((nfadeout_31 * _Color) * (_Multiplier * wave_6)); + xlv_SV_POSITION = (glstate_matrix_mvp * tmpvar_29); xlv_TEXCOORD0 = _glesMultiTexCoord0.xy; xlv_TEXCOORD1 = tmpvar_3; } -// inputs: 5, stats: 95 alu 0 tex 3 flow +// stats: 95 alu 0 tex 3 flow +// inputs: 5 +// #0: _glesVertex (high float) 4x1 [-1] +// #1: _glesNormal (medium float) 3x1 [-1] +// #2: _glesMultiTexCoord0 (high float) 4x1 [-1] +// #3: _glesMultiTexCoord1 (high float) 4x1 [-1] +// #4: _glesColor (low float) 4x1 [-1] +// uniforms: 17 (total size: 0) +// #0: _Bias (high float) 1x1 [-1] +// #1: _BlinkingTimeOffsScale (high float) 1x1 [-1] +// #2: _Color (high float) 4x1 [-1] +// #3: _FadeOutDistFar (high float) 1x1 [-1] +// #4: _FadeOutDistNear (high float) 1x1 [-1] +// #5: _MaxGrowSize (high float) 1x1 [-1] +// #6: _Multiplier (high float) 1x1 [-1] +// #7: _NoiseAmount (high float) 1x1 [-1] +// #8: _SizeGrowEndDist (high float) 1x1 [-1] +// #9: _SizeGrowStartDist (high float) 1x1 [-1] +// #10: _Time (high float) 4x1 [-1] +// #11: _TimeOffDuration (high float) 1x1 [-1] +// #12: _TimeOnDuration (high float) 1x1 [-1] +// #13: _VerticalBillboarding (high float) 1x1 [-1] +// #14: _World2Object (high float) 4x4 [-1] +// #15: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #16: glstate_matrix_mvp (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES3.txt b/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES3.txt new file mode 100644 index 000000000..570f34f4d --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES3.txt @@ -0,0 +1,169 @@ +#version 300 es +uniform highp float _Bias; +uniform highp float _BlinkingTimeOffsScale; +uniform highp vec4 _Color; +uniform highp float _FadeOutDistFar; +uniform highp float _FadeOutDistNear; +uniform highp float _MaxGrowSize; +uniform highp float _Multiplier; +uniform highp float _NoiseAmount; +uniform highp float _SizeGrowEndDist; +uniform highp float _SizeGrowStartDist; +uniform highp vec4 _Time; +uniform highp float _TimeOffDuration; +uniform highp float _TimeOnDuration; +uniform highp float _VerticalBillboarding; +uniform highp mat4 _World2Object; +uniform highp vec3 _WorldSpaceCameraPos; +uniform highp mat4 glstate_matrix_mvp; +in highp vec4 _inVertex; +in mediump vec3 _inNormal; +in highp vec4 _uv0; +in highp vec4 _uv1; +in lowp vec4 _color; +out highp vec4 xlv_SV_POSITION; +out highp vec2 xlv_TEXCOORD0; +out lowp vec4 xlv_TEXCOORD1; +void main () +{ + highp vec3 tmpvar_1; + highp vec4 tmpvar_2; + tmpvar_1 = _inNormal; + tmpvar_2 = _color; + lowp vec4 tmpvar_3; + highp float noiseWave_4; + highp float noiseTime_5; + highp float wave_6; + highp float time_7; + highp vec3 BBLocalPos_8; + highp vec3 localDir_9; + highp vec3 centerLocal_10; + highp vec3 centerOffs_11; + highp vec3 tmpvar_12; + tmpvar_12.z = 0.0; + tmpvar_12.xy = (vec2(0.5, 0.5) - tmpvar_2.xy); + centerOffs_11 = (tmpvar_12 * _uv1.xyy); + centerLocal_10 = (_inVertex.xyz + centerOffs_11); + highp vec4 tmpvar_13; + tmpvar_13.w = 1.0; + tmpvar_13.xyz = _WorldSpaceCameraPos; + localDir_9 = ((_World2Object * tmpvar_13).xyz - centerLocal_10); + localDir_9.y = (localDir_9.y * _VerticalBillboarding); + highp float tmpvar_14; + tmpvar_14 = sqrt(dot (localDir_9, localDir_9)); + highp vec3 dir_15; + dir_15 = (localDir_9 / tmpvar_14); + highp float tmpvar_16; + tmpvar_16 = abs(dir_15.y); + vec3 tmpvar_17; + if ((tmpvar_16 > 0.999)) { + tmpvar_17 = vec3(0.0, 0.0, 1.0); + } else { + tmpvar_17 = vec3(0.0, 1.0, 0.0); + }; + highp vec3 tmpvar_18; + tmpvar_18 = normalize(((tmpvar_17.yzx * dir_15.zxy) - (tmpvar_17.zxy * dir_15.yzx))); + highp vec3 tmpvar_19; + tmpvar_19 = ((dir_15.yzx * tmpvar_18.zxy) - (dir_15.zxy * tmpvar_18.yzx)); + highp float tmpvar_20; + tmpvar_20 = min ((max ( + (tmpvar_14 - _SizeGrowStartDist) + , 0.0) / _SizeGrowEndDist), 1.0); + BBLocalPos_8 = ((centerLocal_10 - ( + (tmpvar_18 * centerOffs_11.x) + + + (tmpvar_19 * centerOffs_11.y) + )) + (( + (tmpvar_18 * tmpvar_1.x) + + + (tmpvar_19 * tmpvar_1.y) + ) * ( + (tmpvar_20 * tmpvar_20) + * + (_MaxGrowSize * tmpvar_2.w) + ))); + time_7 = (_Time.y + (_BlinkingTimeOffsScale * tmpvar_2.z)); + highp float y_21; + y_21 = (_TimeOnDuration + _TimeOffDuration); + highp float tmpvar_22; + tmpvar_22 = (time_7 / y_21); + highp float tmpvar_23; + tmpvar_23 = (fract(abs(tmpvar_22)) * y_21); + highp float tmpvar_24; + if ((tmpvar_22 >= 0.0)) { + tmpvar_24 = tmpvar_23; + } else { + tmpvar_24 = -(tmpvar_23); + }; + highp float tmpvar_25; + tmpvar_25 = clamp ((tmpvar_24 / (_TimeOnDuration * 0.25)), 0.0, 1.0); + highp float edge0_26; + edge0_26 = (_TimeOnDuration * 0.75); + highp float tmpvar_27; + tmpvar_27 = clamp (((tmpvar_24 - edge0_26) / (_TimeOnDuration - edge0_26)), 0.0, 1.0); + wave_6 = ((tmpvar_25 * (tmpvar_25 * + (3.0 - (2.0 * tmpvar_25)) + )) * (1.0 - (tmpvar_27 * + (tmpvar_27 * (3.0 - (2.0 * tmpvar_27))) + ))); + noiseTime_5 = (time_7 * (6.28319 / _TimeOnDuration)); + noiseWave_4 = ((_NoiseAmount * ( + sin(noiseTime_5) + * + ((0.5 * cos(( + (noiseTime_5 * 0.6366) + + 56.7272))) + 0.5) + )) + (1.0 - _NoiseAmount)); + highp float tmpvar_28; + if ((_NoiseAmount < 0.01)) { + tmpvar_28 = wave_6; + } else { + tmpvar_28 = noiseWave_4; + }; + wave_6 = (tmpvar_28 + _Bias); + highp vec4 tmpvar_29; + tmpvar_29.w = 1.0; + tmpvar_29.xyz = BBLocalPos_8; + highp float ffadeout_30; + highp float nfadeout_31; + highp float tmpvar_32; + tmpvar_32 = clamp ((tmpvar_14 / _FadeOutDistNear), 0.0, 1.0); + ffadeout_30 = (1.0 - clamp (( + max ((tmpvar_14 - _FadeOutDistFar), 0.0) + * 0.2), 0.0, 1.0)); + ffadeout_30 = (ffadeout_30 * ffadeout_30); + nfadeout_31 = (tmpvar_32 * tmpvar_32); + nfadeout_31 = (nfadeout_31 * nfadeout_31); + nfadeout_31 = (nfadeout_31 * ffadeout_30); + tmpvar_3 = ((nfadeout_31 * _Color) * (_Multiplier * wave_6)); + xlv_SV_POSITION = (glstate_matrix_mvp * tmpvar_29); + xlv_TEXCOORD0 = _uv0.xy; + xlv_TEXCOORD1 = tmpvar_3; +} + + +// stats: 95 alu 0 tex 3 flow +// inputs: 5 +// #0: _inVertex (high float) 4x1 [-1] +// #1: _inNormal (medium float) 3x1 [-1] +// #2: _uv0 (high float) 4x1 [-1] +// #3: _uv1 (high float) 4x1 [-1] +// #4: _color (low float) 4x1 [-1] +// uniforms: 17 (total size: 0) +// #0: _Bias (high float) 1x1 [-1] +// #1: _BlinkingTimeOffsScale (high float) 1x1 [-1] +// #2: _Color (high float) 4x1 [-1] +// #3: _FadeOutDistFar (high float) 1x1 [-1] +// #4: _FadeOutDistNear (high float) 1x1 [-1] +// #5: _MaxGrowSize (high float) 1x1 [-1] +// #6: _Multiplier (high float) 1x1 [-1] +// #7: _NoiseAmount (high float) 1x1 [-1] +// #8: _SizeGrowEndDist (high float) 1x1 [-1] +// #9: _SizeGrowStartDist (high float) 1x1 [-1] +// #10: _Time (high float) 4x1 [-1] +// #11: _TimeOffDuration (high float) 1x1 [-1] +// #12: _TimeOnDuration (high float) 1x1 [-1] +// #13: _VerticalBillboarding (high float) 1x1 [-1] +// #14: _World2Object (high float) 4x4 [-1] +// #15: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #16: glstate_matrix_mvp (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES3Metal.txt new file mode 100644 index 000000000..36efe5b06 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES3Metal.txt @@ -0,0 +1,178 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float4 _inVertex [[attribute(0)]]; + half3 _inNormal [[attribute(1)]]; + float4 _uv0 [[attribute(2)]]; + float4 _uv1 [[attribute(3)]]; + half4 _color [[attribute(4)]]; +}; +struct xlatMtlShaderOutput { + float4 xlv_SV_POSITION; + float2 xlv_TEXCOORD0; + half4 xlv_TEXCOORD1; +}; +struct xlatMtlShaderUniform { + float _Bias; + float _BlinkingTimeOffsScale; + float4 _Color; + float _FadeOutDistFar; + float _FadeOutDistNear; + float _MaxGrowSize; + float _Multiplier; + float _NoiseAmount; + float _SizeGrowEndDist; + float _SizeGrowStartDist; + float4 _Time; + float _TimeOffDuration; + float _TimeOnDuration; + float _VerticalBillboarding; + float4x4 _World2Object; + float3 _WorldSpaceCameraPos; + float4x4 glstate_matrix_mvp; +}; +vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + float3 tmpvar_1; + float4 tmpvar_2; + tmpvar_1 = float3(_mtl_i._inNormal); + tmpvar_2 = float4(_mtl_i._color); + half4 tmpvar_3; + float noiseWave_4; + float noiseTime_5; + float wave_6; + float time_7; + float3 BBLocalPos_8; + float3 localDir_9; + float3 centerLocal_10; + float3 centerOffs_11; + float3 tmpvar_12; + tmpvar_12.z = 0.0; + tmpvar_12.xy = (float2(0.5, 0.5) - tmpvar_2.xy); + centerOffs_11 = (tmpvar_12 * _mtl_i._uv1.xyy); + centerLocal_10 = (_mtl_i._inVertex.xyz + centerOffs_11); + float4 tmpvar_13; + tmpvar_13.w = 1.0; + tmpvar_13.xyz = _mtl_u._WorldSpaceCameraPos; + localDir_9 = ((_mtl_u._World2Object * tmpvar_13).xyz - centerLocal_10); + localDir_9.y = (localDir_9.y * _mtl_u._VerticalBillboarding); + float tmpvar_14; + tmpvar_14 = sqrt(dot (localDir_9, localDir_9)); + float3 dir_15; + dir_15 = (localDir_9 / tmpvar_14); + float tmpvar_16; + tmpvar_16 = abs(dir_15.y); + float3 tmpvar_17; + if ((tmpvar_16 > 0.999)) { + tmpvar_17 = float3(0.0, 0.0, 1.0); + } else { + tmpvar_17 = float3(0.0, 1.0, 0.0); + }; + float3 tmpvar_18; + tmpvar_18 = normalize(((tmpvar_17.yzx * dir_15.zxy) - (tmpvar_17.zxy * dir_15.yzx))); + float3 tmpvar_19; + tmpvar_19 = ((dir_15.yzx * tmpvar_18.zxy) - (dir_15.zxy * tmpvar_18.yzx)); + float tmpvar_20; + tmpvar_20 = min ((max ( + (tmpvar_14 - _mtl_u._SizeGrowStartDist) + , 0.0) / _mtl_u._SizeGrowEndDist), 1.0); + BBLocalPos_8 = ((centerLocal_10 - ( + (tmpvar_18 * centerOffs_11.x) + + + (tmpvar_19 * centerOffs_11.y) + )) + (( + (tmpvar_18 * tmpvar_1.x) + + + (tmpvar_19 * tmpvar_1.y) + ) * ( + (tmpvar_20 * tmpvar_20) + * + (_mtl_u._MaxGrowSize * tmpvar_2.w) + ))); + time_7 = (_mtl_u._Time.y + (_mtl_u._BlinkingTimeOffsScale * tmpvar_2.z)); + float y_21; + y_21 = (_mtl_u._TimeOnDuration + _mtl_u._TimeOffDuration); + float tmpvar_22; + tmpvar_22 = (time_7 / y_21); + float tmpvar_23; + tmpvar_23 = (fract(abs(tmpvar_22)) * y_21); + float tmpvar_24; + if ((tmpvar_22 >= 0.0)) { + tmpvar_24 = tmpvar_23; + } else { + tmpvar_24 = -(tmpvar_23); + }; + float tmpvar_25; + tmpvar_25 = clamp ((tmpvar_24 / (_mtl_u._TimeOnDuration * 0.25)), 0.0, 1.0); + float edge0_26; + edge0_26 = (_mtl_u._TimeOnDuration * 0.75); + float tmpvar_27; + tmpvar_27 = clamp (((tmpvar_24 - edge0_26) / (_mtl_u._TimeOnDuration - edge0_26)), 0.0, 1.0); + wave_6 = ((tmpvar_25 * (tmpvar_25 * + (3.0 - (2.0 * tmpvar_25)) + )) * (1.0 - (tmpvar_27 * + (tmpvar_27 * (3.0 - (2.0 * tmpvar_27))) + ))); + noiseTime_5 = (time_7 * (6.28319 / _mtl_u._TimeOnDuration)); + noiseWave_4 = ((_mtl_u._NoiseAmount * ( + sin(noiseTime_5) + * + ((0.5 * cos(( + (noiseTime_5 * 0.6366) + + 56.7272))) + 0.5) + )) + (1.0 - _mtl_u._NoiseAmount)); + float tmpvar_28; + if ((_mtl_u._NoiseAmount < 0.01)) { + tmpvar_28 = wave_6; + } else { + tmpvar_28 = noiseWave_4; + }; + wave_6 = (tmpvar_28 + _mtl_u._Bias); + float4 tmpvar_29; + tmpvar_29.w = 1.0; + tmpvar_29.xyz = BBLocalPos_8; + float ffadeout_30; + float nfadeout_31; + float tmpvar_32; + tmpvar_32 = clamp ((tmpvar_14 / _mtl_u._FadeOutDistNear), 0.0, 1.0); + ffadeout_30 = (1.0 - clamp (( + max ((tmpvar_14 - _mtl_u._FadeOutDistFar), 0.0) + * 0.2), 0.0, 1.0)); + ffadeout_30 = (ffadeout_30 * ffadeout_30); + nfadeout_31 = (tmpvar_32 * tmpvar_32); + nfadeout_31 = (nfadeout_31 * nfadeout_31); + nfadeout_31 = (nfadeout_31 * ffadeout_30); + tmpvar_3 = half4(((nfadeout_31 * _mtl_u._Color) * (_mtl_u._Multiplier * wave_6))); + _mtl_o.xlv_SV_POSITION = (_mtl_u.glstate_matrix_mvp * tmpvar_29); + _mtl_o.xlv_TEXCOORD0 = _mtl_i._uv0.xy; + _mtl_o.xlv_TEXCOORD1 = tmpvar_3; + return _mtl_o; +} + + +// stats: 95 alu 0 tex 3 flow +// inputs: 5 +// #0: _inVertex (high float) 4x1 [-1] loc 0 +// #1: _inNormal (medium float) 3x1 [-1] loc 1 +// #2: _uv0 (high float) 4x1 [-1] loc 2 +// #3: _uv1 (high float) 4x1 [-1] loc 3 +// #4: _color (low float) 4x1 [-1] loc 4 +// uniforms: 17 (total size: 240) +// #0: _Bias (high float) 1x1 [-1] loc 0 +// #1: _BlinkingTimeOffsScale (high float) 1x1 [-1] loc 4 +// #2: _Color (high float) 4x1 [-1] loc 16 +// #3: _FadeOutDistFar (high float) 1x1 [-1] loc 32 +// #4: _FadeOutDistNear (high float) 1x1 [-1] loc 36 +// #5: _MaxGrowSize (high float) 1x1 [-1] loc 40 +// #6: _Multiplier (high float) 1x1 [-1] loc 44 +// #7: _NoiseAmount (high float) 1x1 [-1] loc 48 +// #8: _SizeGrowEndDist (high float) 1x1 [-1] loc 52 +// #9: _SizeGrowStartDist (high float) 1x1 [-1] loc 56 +// #10: _Time (high float) 4x1 [-1] loc 64 +// #11: _TimeOffDuration (high float) 1x1 [-1] loc 80 +// #12: _TimeOnDuration (high float) 1x1 [-1] loc 84 +// #13: _VerticalBillboarding (high float) 1x1 [-1] loc 88 +// #14: _World2Object (high float) 4x4 [-1] loc 96 +// #15: _WorldSpaceCameraPos (high float) 3x1 [-1] loc 160 +// #16: glstate_matrix_mvp (high float) 4x4 [-1] loc 176 diff --git a/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-ir.txt deleted file mode 100644 index 808398706..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-ir.txt +++ /dev/null @@ -1,25 +0,0 @@ -attribute vec3 _in_position; -uniform mat4 mtx; -void main () -{ - mat4 m_1; - mat4 tmpvar_2; - tmpvar_2 = mtx; - m_1 = tmpvar_2; - vec4 tmpvar_3; - tmpvar_3 = m_1[0]; tmpvar_3.w = 0.0; - m_1[0] = tmpvar_3; - vec4 tmpvar_4; - tmpvar_4 = m_1[0]; tmpvar_4.z = tmpvar_3[3]; - m_1[0] = tmpvar_4; - vec4 tmpvar_5; - tmpvar_5 = m_1[0]; tmpvar_5.y = tmpvar_4[2]; - m_1[0] = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6.w = 1.0; - tmpvar_6.xyz = _in_position.xyz; - vec4 tmpvar_7; - tmpvar_7 = (m_1 * tmpvar_6); - gl_Position = tmpvar_7; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-out.txt b/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-out.txt index d247fc3db..c8c69cd8f 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-out.txt @@ -5,17 +5,26 @@ void main () mat4 m_1; m_1 = mtx; vec4 tmpvar_2; - tmpvar_2 = mtx[0]; tmpvar_2.w = 0.0; + tmpvar_2.xyz = mtx[0].xyz; + tmpvar_2.w = 0.0; m_1[0] = tmpvar_2; vec4 tmpvar_3; - tmpvar_3 = m_1[0]; tmpvar_3.z = tmpvar_2.w; + tmpvar_3.xyw = m_1[0].xyw; + tmpvar_3.z = tmpvar_2.w; m_1[0] = tmpvar_3; - m_1[0] = m_1[0]; m_1[0].y = tmpvar_3.z; vec4 tmpvar_4; - tmpvar_4.w = 1.0; - tmpvar_4.xyz = _in_position; - gl_Position = (m_1 * tmpvar_4); + tmpvar_4.xzw = m_1[0].xzw; + tmpvar_4.y = tmpvar_3.z; + m_1[0] = tmpvar_4; + vec4 tmpvar_5; + tmpvar_5.w = 1.0; + tmpvar_5.xyz = _in_position; + gl_Position = (m_1 * tmpvar_5); } -// inputs: 1, stats: 5 alu 0 tex 0 flow +// stats: 3 alu 0 tex 0 flow +// inputs: 1 +// #0: _in_position (high float) 3x1 [-1] +// uniforms: 1 (total size: 0) +// #0: mtx (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/bug-loops-for-while-in.txt b/3rdparty/glsl-optimizer/tests/vertex/bug-loops-for-while-in.txt new file mode 100644 index 000000000..20037291a --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/bug-loops-for-while-in.txt @@ -0,0 +1,21 @@ +#define MAX_ITER 5 + +attribute vec4 a_position; + +uniform int u_iter; +uniform vec4 u_deltas[MAX_ITER]; + +int my_min(int a, int b) { + if (a < b) { + return a; + } else { + return b; + } +} + +void main() { + gl_Position = a_position; + for (int i = 0; i < my_min(u_iter, MAX_ITER); i++) { + gl_Position += u_deltas[i]; + } +} diff --git a/3rdparty/glsl-optimizer/tests/vertex/bug-loops-for-while-out.txt b/3rdparty/glsl-optimizer/tests/vertex/bug-loops-for-while-out.txt new file mode 100644 index 000000000..466dd2750 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/bug-loops-for-while-out.txt @@ -0,0 +1,30 @@ +attribute vec4 a_position; +uniform int u_iter; +uniform vec4 u_deltas[5]; +void main () +{ + int i_1; + gl_Position = a_position; + i_1 = 0; + while (true) { + int tmpvar_2; + if ((u_iter < 5)) { + tmpvar_2 = u_iter; + } else { + tmpvar_2 = 5; + }; + if ((i_1 >= tmpvar_2)) { + break; + }; + gl_Position = (gl_Position + u_deltas[i_1]); + i_1++; + }; +} + + +// stats: 6 alu 0 tex 3 flow +// inputs: 1 +// #0: a_position (high float) 4x1 [-1] +// uniforms: 2 (total size: 0) +// #0: u_iter (high int) 1x1 [-1] +// #1: u_deltas (high float) 4x1 [5] diff --git a/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-ir.txt deleted file mode 100644 index b52a892c8..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-ir.txt +++ /dev/null @@ -1,15 +0,0 @@ -struct shadow_map_t { - mat4 transform; -}; -uniform shadow_map_t ShadowMaps[1]; -attribute vec3 _in_position; -void main () -{ - vec4 tmpvar_1; - tmpvar_1.w = 1.0; - tmpvar_1.xyz = _in_position.xyz; - vec4 tmpvar_2; - tmpvar_2 = (ShadowMaps[0].transform * tmpvar_1); - gl_Position = tmpvar_2; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-out.txt b/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-out.txt index d16bc45bc..b2cdc2fd2 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-out.txt @@ -12,4 +12,8 @@ void main () } -// inputs: 1, stats: 2 alu 0 tex 0 flow +// stats: 2 alu 0 tex 0 flow +// inputs: 1 +// #0: _in_position (high float) 3x1 [-1] +// uniforms: 1 (total size: 0) +// #0: ShadowMaps (high other) 0x0 [1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-inES3.txt b/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-inES3.txt new file mode 100644 index 000000000..32fa17da0 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-inES3.txt @@ -0,0 +1,53 @@ +#version 300 es + +// Metal translation was producing a wrong typecast +// on o.backContrib[j] = (backContrib * 2.0) expression; +// was thinking LHS is a float3 + +#define gl_Vertex _glesVertex +in vec4 _glesVertex; +#define gl_Normal _glesNormal +in vec3 _glesNormal; +float xll_saturate_f( float x) { + return clamp( x, 0.0, 1.0); +} +struct appdata_full { + highp vec4 vertex; + highp vec3 normal; +}; +struct v2f { + highp vec4 pos; + highp vec3 backContrib; +}; +uniform highp vec3 _WorldSpaceCameraPos; +uniform highp mat4 glstate_matrix_mvp; +uniform highp mat4 _World2Object; +uniform highp vec3 _TerrainTreeLightDirections[4]; +highp vec3 ObjSpaceViewDir( in highp vec4 v ) { + highp vec3 objSpaceCameraPos = (_World2Object * vec4( _WorldSpaceCameraPos.xyz, 1.0)).xyz; + return (objSpaceCameraPos - v.xyz); +} +v2f vert( in appdata_full v ) { + v2f o; + o.pos = (glstate_matrix_mvp * v.vertex); + highp vec3 viewDir = normalize(ObjSpaceViewDir( v.vertex)); + highp int j = 0; + for ( ; (j < 3); (j++)) { + highp vec3 lightDir = _TerrainTreeLightDirections[j]; + mediump float nl = dot( v.normal, lightDir); + mediump float backContrib = xll_saturate_f(dot( viewDir, (-lightDir))); + o.backContrib[j] = (backContrib * 2.0); + } + return o; +} + +out highp vec3 xlv_TEXCOORD2; +void main() { + v2f xl_retval; + appdata_full xlt_v; + xlt_v.vertex = vec4(gl_Vertex); + xlt_v.normal = vec3(gl_Normal); + xl_retval = vert( xlt_v); + gl_Position = vec4(xl_retval.pos); + xlv_TEXCOORD2 = vec3(xl_retval.backContrib); +} diff --git a/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3.txt b/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3.txt new file mode 100644 index 000000000..f30ecafb9 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3.txt @@ -0,0 +1,50 @@ +#version 300 es +in vec4 _glesVertex; +uniform highp vec3 _WorldSpaceCameraPos; +uniform highp mat4 glstate_matrix_mvp; +uniform highp mat4 _World2Object; +uniform highp vec3 _TerrainTreeLightDirections[4]; +out highp vec3 xlv_TEXCOORD2; +void main () +{ + highp vec3 viewDir_1; + highp vec3 tmpvar_2; + highp vec4 tmpvar_3; + tmpvar_3.w = 1.0; + tmpvar_3.xyz = _WorldSpaceCameraPos; + viewDir_1 = normalize(((_World2Object * tmpvar_3).xyz - _glesVertex.xyz)); + mediump float backContrib_4; + highp float tmpvar_5; + tmpvar_5 = clamp (dot (viewDir_1, -(_TerrainTreeLightDirections[0])), 0.0, 1.0); + backContrib_4 = tmpvar_5; + highp vec3 tmpvar_6; + tmpvar_6.yz = tmpvar_2.yz; + tmpvar_6.x = (backContrib_4 * 2.0); + mediump float backContrib_7; + highp float tmpvar_8; + tmpvar_8 = clamp (dot (viewDir_1, -(_TerrainTreeLightDirections[1])), 0.0, 1.0); + backContrib_7 = tmpvar_8; + highp vec3 tmpvar_9; + tmpvar_9.xz = tmpvar_6.xz; + tmpvar_9.y = (backContrib_7 * 2.0); + mediump float backContrib_10; + highp float tmpvar_11; + tmpvar_11 = clamp (dot (viewDir_1, -(_TerrainTreeLightDirections[2])), 0.0, 1.0); + backContrib_10 = tmpvar_11; + highp vec3 tmpvar_12; + tmpvar_12.xy = tmpvar_9.xy; + tmpvar_12.z = (backContrib_10 * 2.0); + tmpvar_2 = tmpvar_12; + gl_Position = (glstate_matrix_mvp * _glesVertex); + xlv_TEXCOORD2 = tmpvar_12; +} + + +// stats: 17 alu 0 tex 0 flow +// inputs: 1 +// #0: _glesVertex (high float) 4x1 [-1] +// uniforms: 4 (total size: 0) +// #0: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #1: glstate_matrix_mvp (high float) 4x4 [-1] +// #2: _World2Object (high float) 4x4 [-1] +// #3: _TerrainTreeLightDirections (high float) 3x1 [4] diff --git a/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3Metal.txt new file mode 100644 index 000000000..ba480af8e --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3Metal.txt @@ -0,0 +1,60 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float4 _glesVertex [[attribute(0)]]; +}; +struct xlatMtlShaderOutput { + float4 gl_Position [[position]]; + float3 xlv_TEXCOORD2; +}; +struct xlatMtlShaderUniform { + float3 _WorldSpaceCameraPos; + float4x4 glstate_matrix_mvp; + float4x4 _World2Object; + float3 _TerrainTreeLightDirections[4]; +}; +vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + float3 viewDir_1; + float3 tmpvar_2; + float4 tmpvar_3; + 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; + float tmpvar_5; + tmpvar_5 = clamp (dot (viewDir_1, -(_mtl_u._TerrainTreeLightDirections[0])), 0.0, 1.0); + backContrib_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; + float tmpvar_8; + tmpvar_8 = clamp (dot (viewDir_1, -(_mtl_u._TerrainTreeLightDirections[1])), 0.0, 1.0); + backContrib_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; + float tmpvar_11; + tmpvar_11 = clamp (dot (viewDir_1, -(_mtl_u._TerrainTreeLightDirections[2])), 0.0, 1.0); + backContrib_10 = half(tmpvar_11); + float3 tmpvar_12; + tmpvar_12.xy = tmpvar_9.xy; + tmpvar_12.z = float((backContrib_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; + return _mtl_o; +} + + +// stats: 17 alu 0 tex 0 flow +// inputs: 1 +// #0: _glesVertex (high float) 4x1 [-1] loc 0 +// uniforms: 4 (total size: 208) +// #0: _WorldSpaceCameraPos (high float) 3x1 [-1] loc 0 +// #1: glstate_matrix_mvp (high float) 4x4 [-1] loc 16 +// #2: _World2Object (high float) 4x4 [-1] loc 80 +// #3: _TerrainTreeLightDirections (high float) 3x1 [4] loc 144 diff --git a/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-ir.txt deleted file mode 100644 index 6d6071e9c..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-ir.txt +++ /dev/null @@ -1,16 +0,0 @@ -varying vec4 var4; -varying float var1; -varying vec4 var4ok; -void main () -{ - vec4 tmpvar_1; - tmpvar_1 = vec4(0.0, 0.0, 0.0, 0.0); - var4 = tmpvar_1; - float tmpvar_2; - tmpvar_2 = 0.5; - var1 = tmpvar_2; - vec4 tmpvar_3; - tmpvar_3 = gl_Vertex; - var4ok = tmpvar_3; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-out.txt b/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-out.txt index 1daf4b589..435e2991d 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-out.txt @@ -9,4 +9,6 @@ void main () } -// inputs: 1, stats: 2 alu 0 tex 0 flow +// stats: 2 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_Vertex (high float) 4x1 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-inES3.txt b/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-inES3.txt new file mode 100644 index 000000000..ef26b6c5a --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-inES3.txt @@ -0,0 +1,15 @@ +#version 300 es + +in highp vec3 _inPos; +in highp vec3 _inNor; + +void main() +{ + highp vec3 p; + p = _inPos; + p.x += float(gl_VertexID); + p.y += float(gl_InstanceID); + p += _inNor; + gl_Position = vec4(p,1.0); + gl_PointSize = p.x; +} diff --git a/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES3.txt b/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES3.txt new file mode 100644 index 000000000..75320d4a3 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES3.txt @@ -0,0 +1,22 @@ +#version 300 es +in highp vec3 _inPos; +in highp vec3 _inNor; +void main () +{ + highp vec3 p_1; + p_1.z = _inPos.z; + p_1.x = (_inPos.x + float(gl_VertexID)); + p_1.y = (_inPos.y + float(gl_InstanceID)); + p_1 = (p_1 + _inNor); + highp vec4 tmpvar_2; + tmpvar_2.w = 1.0; + tmpvar_2.xyz = p_1; + gl_Position = tmpvar_2; + gl_PointSize = p_1.x; +} + + +// stats: 6 alu 0 tex 0 flow +// inputs: 2 +// #0: _inPos (high float) 3x1 [-1] +// #1: _inNor (high float) 3x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES3Metal.txt new file mode 100644 index 000000000..3c5b6e33b --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES3Metal.txt @@ -0,0 +1,35 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float3 _inPos [[attribute(0)]]; + float3 _inNor [[attribute(1)]]; +}; +struct xlatMtlShaderOutput { + float gl_PointSize [[point_size]]; + float4 gl_Position [[position]]; +}; +struct xlatMtlShaderUniform { +}; +vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] + , uint gl_InstanceID [[instance_id]] + , uint gl_VertexID [[vertex_id]]) +{ + xlatMtlShaderOutput _mtl_o; + float3 p_1; + p_1.z = _mtl_i._inPos.z; + p_1.x = (_mtl_i._inPos.x + float(gl_VertexID)); + p_1.y = (_mtl_i._inPos.y + float(gl_InstanceID)); + p_1 = (p_1 + _mtl_i._inNor); + float4 tmpvar_2; + tmpvar_2.w = 1.0; + tmpvar_2.xyz = p_1; + _mtl_o.gl_Position = tmpvar_2; + _mtl_o.gl_PointSize = p_1.x; + return _mtl_o; +} + + +// stats: 6 alu 0 tex 0 flow +// inputs: 2 +// #0: _inPos (high float) 3x1 [-1] loc 0 +// #1: _inNor (high float) 3x1 [-1] loc 1 diff --git a/3rdparty/glsl-optimizer/tests/vertex/estest1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/estest1-ir.txt deleted file mode 100644 index 27154eefb..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/estest1-ir.txt +++ /dev/null @@ -1,23 +0,0 @@ -attribute vec4 position; -uniform mat4 modelViewProjectionMatrix; -varying vec4 xlv_TEXCOORD0; -varying vec4 xlv_TEXCOORD1; -void main () -{ - vec4 tmpvar_1; - tmpvar_1 = (modelViewProjectionMatrix * position); - gl_Position = tmpvar_1; - vec4 tmpvar_2; - tmpvar_2.zw = vec2(0.0, 0.0); - tmpvar_2.xy = (position.xy * vec2(4.0, 4.0)).xy; - vec4 tmpvar_3; - tmpvar_3 = tmpvar_2; - xlv_TEXCOORD0 = tmpvar_3; - vec4 tmpvar_4; - tmpvar_4.zw = vec2(0.0, 0.0); - tmpvar_4.xy = position.xy.xy; - vec4 tmpvar_5; - tmpvar_5 = tmpvar_4; - xlv_TEXCOORD1 = tmpvar_5; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/estest1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/estest1-out.txt index e4f69b7fa..175aaf44e 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/estest1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/estest1-out.txt @@ -16,4 +16,8 @@ void main () } -// inputs: 1, stats: 4 alu 0 tex 0 flow +// stats: 4 alu 0 tex 0 flow +// inputs: 1 +// #0: position (high float) 4x1 [-1] +// uniforms: 1 (total size: 0) +// #0: modelViewProjectionMatrix (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-ir.txt deleted file mode 100644 index 237c56880..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-ir.txt +++ /dev/null @@ -1,18 +0,0 @@ -#version 140 -uniform vec2 p; -in vec4 position; -in vec4 icol; -out vec4 col; -void main () -{ - vec4 tmpvar_1; - tmpvar_1 = icol; - col = tmpvar_1; - vec4 tmpvar_2; - tmpvar_2.zw = vec2(0.0, 0.0); - tmpvar_2.xy = p.xy; - vec4 tmpvar_3; - tmpvar_3 = (tmpvar_2 + position); - gl_Position = tmpvar_3; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-out.txt b/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-out.txt index 9de971476..48759e59a 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-out.txt @@ -13,4 +13,9 @@ void main () } -// inputs: 2, stats: 2 alu 0 tex 0 flow +// stats: 2 alu 0 tex 0 flow +// inputs: 2 +// #0: position (high float) 4x1 [-1] +// #1: icol (high float) 4x1 [-1] +// uniforms: 1 (total size: 0) +// #0: p (high float) 2x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-ir.txt deleted file mode 100644 index b8fdde133..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-ir.txt +++ /dev/null @@ -1,48 +0,0 @@ -#version 140 -uniform vec2 p; -in vec4 position; -in vec4 icol; -out vec4 col; -flat out ivec4 colint; -void main () -{ - vec4 tmpvar_1; - tmpvar_1.zw = vec2(0.0, 0.0); - tmpvar_1.xy = p.xy; - vec4 tmpvar_2; - tmpvar_2 = (tmpvar_1 + position); - gl_Position = tmpvar_2; - int tmpvar_3; - tmpvar_3 = gl_VertexID; - colint.x = tmpvar_3; - int tmpvar_4; - tmpvar_4 = (gl_InstanceID ^ gl_InstanceID); - colint.y = ivec2(tmpvar_4).y; - int tmpvar_5; - tmpvar_5 = (gl_InstanceID << 2); - colint.z = ivec3(tmpvar_5).z; - int tmpvar_6; - tmpvar_6 = (colint.x + colint.y); - colint.w = ivec4(tmpvar_6).w; - float tmpvar_7; - tmpvar_7 = trunc (position.x); - float tmpvar_8; - tmpvar_8 = tmpvar_7; - col.x = tmpvar_8; - float tmpvar_9; - tmpvar_9 = round (position.y); - float tmpvar_10; - tmpvar_10 = tmpvar_9; - col.y = vec2(tmpvar_10).y; - float tmpvar_11; - tmpvar_11 = roundEven (position.y); - float tmpvar_12; - tmpvar_12 = tmpvar_11; - col.z = vec3(tmpvar_12).z; - float tmpvar_13; - tmpvar_13 = cosh (position.w); - float tmpvar_14; - tmpvar_14 = tmpvar_13; - col.w = vec4(tmpvar_14).w; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-out.txt b/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-out.txt index 45e81e3a2..93bbe01fc 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-out.txt @@ -14,14 +14,18 @@ void main () colint.z = (gl_InstanceID << 2); colint.w = (gl_VertexID + colint.y); col.x = trunc(position.x); - float cse_2; - cse_2 = roundEven(position.y); - col.y = cse_2; - col.z = cse_2; + float tmpvar_2; + tmpvar_2 = roundEven(position.y); + col.y = tmpvar_2; + col.z = tmpvar_2; col.w = (0.5 * (exp(position.w) + exp( -(position.w) ))); } -// inputs: 1, stats: 12 alu 0 tex 0 flow +// stats: 12 alu 0 tex 0 flow +// inputs: 1 +// #0: position (high float) 4x1 [-1] +// uniforms: 1 (total size: 0) +// #0: p (high float) 2x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/inputs-inES3.txt b/3rdparty/glsl-optimizer/tests/vertex/inputs-inES3.txt new file mode 100644 index 000000000..d8afdf4bc --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/inputs-inES3.txt @@ -0,0 +1,36 @@ +#version 300 es + +#define gl_Vertex _glesVertex +in vec4 _glesVertex; +#define gl_MultiTexCoord0 _glesMultiTexCoord0 +in vec4 _glesMultiTexCoord0; +#define TANGENT vec4(normalize(_glesTANGENT.xyz), _glesTANGENT.w) +in vec4 _glesTANGENT; + +struct v2f { + highp vec4 pos; + mediump vec2 uv; + lowp vec4 color; +}; + +uniform highp mat4 glstate_matrix_mvp; + +v2f vert( in highp vec4 pos, in mediump vec2 uv, in highp vec4 tangent ) { + v2f o; + o.pos = (glstate_matrix_mvp * pos); + o.color.xy = (uv * 0.3); + o.color.xyz += ((tangent.xyz * 0.5) + 0.5); + o.color.w = 0.0; + o.uv = uv; + return o; +} + +out mediump vec2 xlv_TEXCOORD0; +out lowp vec4 xlv_TEXCOORD1; +void main() { + v2f xl_retval; + xl_retval = vert( vec4(gl_Vertex), vec2(gl_MultiTexCoord0), vec4(TANGENT)); + gl_Position = vec4(xl_retval.pos); + xlv_TEXCOORD0 = vec2(xl_retval.uv); + xlv_TEXCOORD1 = vec4(xl_retval.color); +} diff --git a/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3.txt b/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3.txt new file mode 100644 index 000000000..cb0deb8a8 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3.txt @@ -0,0 +1,29 @@ +#version 300 es +in vec4 _glesVertex; +in vec4 _glesMultiTexCoord0; +in vec4 _glesTANGENT; +uniform highp mat4 glstate_matrix_mvp; +out mediump vec2 xlv_TEXCOORD0; +out lowp vec4 xlv_TEXCOORD1; +void main () +{ + vec4 tmpvar_1; + tmpvar_1.xyz = normalize(_glesTANGENT.xyz); + tmpvar_1.w = _glesTANGENT.w; + lowp vec4 tmpvar_2; + tmpvar_2.xy = (_glesMultiTexCoord0.xy * 0.3); + tmpvar_2.xyz = (tmpvar_2.xyz + ((tmpvar_1.xyz * 0.5) + 0.5)); + tmpvar_2.w = 0.0; + gl_Position = (glstate_matrix_mvp * _glesVertex); + xlv_TEXCOORD0 = _glesMultiTexCoord0.xy; + xlv_TEXCOORD1 = tmpvar_2; +} + + +// stats: 7 alu 0 tex 0 flow +// inputs: 3 +// #0: _glesVertex (high float) 4x1 [-1] +// #1: _glesMultiTexCoord0 (high float) 4x1 [-1] +// #2: _glesTANGENT (high float) 4x1 [-1] +// uniforms: 1 (total size: 0) +// #0: glstate_matrix_mvp (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3Metal.txt new file mode 100644 index 000000000..1513d416a --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3Metal.txt @@ -0,0 +1,43 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float4 _glesVertex [[attribute(0)]]; + float4 _glesMultiTexCoord0 [[attribute(1)]]; + float4 _glesTANGENT [[attribute(2)]]; +}; +struct xlatMtlShaderOutput { + float4 gl_Position [[position]]; + half2 xlv_TEXCOORD0; + half4 xlv_TEXCOORD1; +}; +struct xlatMtlShaderUniform { + float4x4 glstate_matrix_mvp; +}; +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; + 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); + _mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * _mtl_i._glesVertex); + _mtl_o.xlv_TEXCOORD0 = uv_3; + _mtl_o.xlv_TEXCOORD1 = tmpvar_4; + return _mtl_o; +} + + +// stats: 7 alu 0 tex 0 flow +// inputs: 3 +// #0: _glesVertex (high float) 4x1 [-1] loc 0 +// #1: _glesMultiTexCoord0 (high float) 4x1 [-1] loc 1 +// #2: _glesTANGENT (high float) 4x1 [-1] loc 2 +// uniforms: 1 (total size: 64) +// #0: glstate_matrix_mvp (high float) 4x4 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/vertex/loops-for-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/loops-for-ir.txt deleted file mode 100644 index e4066b2ea..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/loops-for-ir.txt +++ /dev/null @@ -1,151 +0,0 @@ -struct v2f { - vec4 pos; - vec4 color; -}; -struct appdata { - vec4 vertex; - vec3 normal; -}; -uniform mat4 UNITY_MATRIX_IT_MV; -uniform mat4 UNITY_MATRIX_MV; -uniform mat4 UNITY_MATRIX_MVP; -uniform vec4 unity_LightAtten[4]; -uniform vec4 unity_LightColor[4]; -uniform vec4 unity_LightPosition[4]; -varying vec4 xlv_TEXCOORD0; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec3 ShadeMyVertexLights ( - in vec4 vertex_9, - in vec3 normal_10 -) -{ - float diff_11; - float atten_12; - float lengthSq_13; - vec3 toLight_14; - int i_15; - vec3 lightColor_16; - vec3 viewN_17; - vec3 viewpos_18; - vec3 tmpvar_19; - tmpvar_19 = vec3(0.0, 0.0, 0.0); - lightColor_16 = tmpvar_19; - int tmpvar_20; - tmpvar_20 = 0; - i_15 = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = (UNITY_MATRIX_MV * vertex_9).xyz; - viewpos_18 = tmpvar_21; - mat3 tmpvar_22; - tmpvar_22 = xll_constructMat3 (UNITY_MATRIX_IT_MV); - vec3 tmpvar_23; - tmpvar_23 = (tmpvar_22 * normal_10); - viewN_17 = tmpvar_23; - while (true) { - if (!((i_15 < 2))) { - break; - }; - vec3 tmpvar_24; - tmpvar_24 = (unity_LightPosition[i_15].xyz - viewpos_18.xyz); - toLight_14 = tmpvar_24; - float tmpvar_25; - tmpvar_25 = dot (toLight_14, toLight_14); - float tmpvar_26; - tmpvar_26 = tmpvar_25; - lengthSq_13 = tmpvar_26; - float tmpvar_27; - tmpvar_27 = (1.0 / (1.0 + (lengthSq_13 * unity_LightAtten[i_15].z))); - atten_12 = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = normalize (toLight_14); - float tmpvar_29; - tmpvar_29 = dot (viewN_17, tmpvar_28); - float tmpvar_30; - tmpvar_30 = max (0.0, tmpvar_29); - float tmpvar_31; - tmpvar_31 = tmpvar_30; - diff_11 = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = (lightColor_16 + (unity_LightColor[i_15].xyz * (diff_11 * atten_12))); - lightColor_16 = tmpvar_32; - int _post_incdec_tmp_33; - _post_incdec_tmp_33 = i_15; - int tmpvar_34; - tmpvar_34 = (i_15 + 1); - i_15 = tmpvar_34; - }; - return (lightColor_16 * 2.0); -} - -v2f xlat_main ( - in appdata v_35 -) -{ - v2f o_36; - vec4 tmpvar_37; - tmpvar_37 = (UNITY_MATRIX_MVP * v_35.vertex); - o_36.pos = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = ShadeMyVertexLights (v_35.vertex, v_35.normal); - vec4 tmpvar_39; - tmpvar_39.w = 1.0; - tmpvar_39.xyz = tmpvar_38.xyz; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - o_36.color = tmpvar_40; - return o_36; -} - -void main () -{ - appdata xlt_v_41; - v2f xl_retval_42; - vec4 tmpvar_43; - tmpvar_43 = gl_Vertex.xyzw; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_v_41.vertex = tmpvar_44; - vec3 tmpvar_45; - tmpvar_45 = gl_Normal.xyz; - vec3 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_v_41.normal = tmpvar_46; - v2f tmpvar_47; - tmpvar_47 = xlat_main (xlt_v_41); - v2f tmpvar_48; - tmpvar_48 = tmpvar_47; - xl_retval_42 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = xl_retval_42.pos.xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - gl_Position = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = xl_retval_42.color.xyzw; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - xlv_TEXCOORD0 = tmpvar_52; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/loops-for-out.txt b/3rdparty/glsl-optimizer/tests/vertex/loops-for-out.txt index ff49769a6..e198de207 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/loops-for-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/loops-for-out.txt @@ -7,35 +7,44 @@ uniform vec4 unity_LightPosition[4]; varying vec4 xlv_TEXCOORD0; void main () { - vec3 lightColor_1; - vec3 viewN_2; - vec3 viewpos_3; - viewpos_3 = (UNITY_MATRIX_MV * gl_Vertex).xyz; - mat3 tmpvar_4; - tmpvar_4[0] = UNITY_MATRIX_IT_MV[0].xyz; - tmpvar_4[1] = UNITY_MATRIX_IT_MV[1].xyz; - tmpvar_4[2] = UNITY_MATRIX_IT_MV[2].xyz; - viewN_2 = (tmpvar_4 * gl_Normal); - vec3 tmpvar_5; - tmpvar_5 = (unity_LightPosition[0].xyz - viewpos_3); - lightColor_1 = (unity_LightColor[0].xyz * (max (0.0, - dot (viewN_2, normalize(tmpvar_5)) + vec3 toLight_1; + vec3 lightColor_2; + vec3 viewN_3; + vec3 viewpos_4; + viewpos_4 = (UNITY_MATRIX_MV * gl_Vertex).xyz; + mat3 tmpvar_5; + tmpvar_5[0] = UNITY_MATRIX_IT_MV[0].xyz; + tmpvar_5[1] = UNITY_MATRIX_IT_MV[1].xyz; + tmpvar_5[2] = UNITY_MATRIX_IT_MV[2].xyz; + viewN_3 = (tmpvar_5 * gl_Normal); + toLight_1 = (unity_LightPosition[0].xyz - viewpos_4); + lightColor_2 = (unity_LightColor[0].xyz * (max (0.0, + dot (viewN_3, normalize(toLight_1)) ) * (1.0/( - (1.0 + (dot (tmpvar_5, tmpvar_5) * unity_LightAtten[0].z)) + (1.0 + (dot (toLight_1, toLight_1) * unity_LightAtten[0].z)) )))); - vec3 tmpvar_6; - tmpvar_6 = (unity_LightPosition[1].xyz - viewpos_3); - lightColor_1 = (lightColor_1 + (unity_LightColor[1].xyz * ( - max (0.0, dot (viewN_2, normalize(tmpvar_6))) + toLight_1 = (unity_LightPosition[1].xyz - viewpos_4); + lightColor_2 = (lightColor_2 + (unity_LightColor[1].xyz * ( + max (0.0, dot (viewN_3, normalize(toLight_1))) * - (1.0/((1.0 + (dot (tmpvar_6, tmpvar_6) * unity_LightAtten[1].z)))) + (1.0/((1.0 + (dot (toLight_1, toLight_1) * unity_LightAtten[1].z)))) ))); - vec4 tmpvar_7; - tmpvar_7.w = 1.0; - tmpvar_7.xyz = (lightColor_1 * 2.0); + vec4 tmpvar_6; + tmpvar_6.w = 1.0; + tmpvar_6.xyz = (lightColor_2 * 2.0); gl_Position = (UNITY_MATRIX_MVP * gl_Vertex); - xlv_TEXCOORD0 = tmpvar_7; + xlv_TEXCOORD0 = tmpvar_6; } -// inputs: 2, stats: 26 alu 0 tex 0 flow +// stats: 26 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_Normal (high float) 3x1 [-1] loc 2 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 6 (total size: 0) +// #0: UNITY_MATRIX_IT_MV (high float) 4x4 [-1] +// #1: UNITY_MATRIX_MV (high float) 4x4 [-1] +// #2: UNITY_MATRIX_MVP (high float) 4x4 [-1] +// #3: unity_LightAtten (high float) 4x1 [4] +// #4: unity_LightColor (high float) 4x1 [4] +// #5: unity_LightPosition (high float) 4x1 [4] diff --git a/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-in.txt b/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-in.txt new file mode 100644 index 000000000..287bc8d51 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-in.txt @@ -0,0 +1,188 @@ +#version 140 +#ifndef SHADER_API_D3D11 + #define SHADER_API_D3D11 1 +#endif +#ifndef SHADER_API_D3D11 + #define SHADER_API_D3D11 1 +#endif +struct vec1 { + float x; +}; +struct uvec1 { + uint x; +}; +struct ivec1 { + int x; +}; +uniform Globals { + vec4 unity_ColorSpaceGrey; + vec4 _MainTex_ST; +}; +uniform UnityLighting { + vec4 _WorldSpaceLightPos0; + vec4 _LightPositionRange; + vec4 unity_4LightPosX0; + vec4 unity_4LightPosY0; + vec4 unity_4LightPosZ0; + vec4 unity_4LightAtten0; + vec4 unity_LightColor[8]; + vec4 unity_LightPosition[8]; + vec4 unity_LightAtten[8]; + vec4 unity_SpotDirection[8]; + vec4 unity_SHAr; + vec4 unity_SHAg; + vec4 unity_SHAb; + vec4 unity_SHBr; + vec4 unity_SHBg; + vec4 unity_SHBb; + vec4 unity_SHC; +}; +uniform UnityPerDraw { + vec4 glstate_matrix_mvp[4]; + vec4 glstate_matrix_modelview0[4]; + vec4 glstate_matrix_invtrans_modelview0[4]; + vec4 _Object2World[4]; + vec4 _World2Object[4]; + vec4 unity_Scale; + vec4 unity_LODFade; +}; +uniform UnityPerFrame { + vec4 glstate_matrix_projection[4]; + vec4 glstate_lightmodel_ambient; + vec4 unity_MatrixV[4]; + vec4 unity_MatrixVP[4]; + vec4 unity_AmbientSky; + vec4 unity_AmbientGround; +}; +in vec4 dcl_Input0_POSITION0; +vec4 Input0; +in vec4 dcl_Input1_NORMAL0; +vec4 Input1; +in vec4 dcl_Input2_TEXCOORD0; +vec4 Input2; +#undef Output0 +#define Output0 phase0_Output0 +vec4 phase0_Output0; + out vec4 VtxGeoOutput1_TEXCOORD0; +#define Output1 VtxGeoOutput1_TEXCOORD0 + out vec4 VtxGeoOutput2_COLOR0; +#define Output2 VtxGeoOutput2_COLOR0 +vec4 Temp[4]; +ivec4 Temp_int[4]; +uvec4 Temp_uint[4]; +void main() +{ + //--- Start Early Main --- + Input0 = dcl_Input0_POSITION0; + Input1 = dcl_Input1_NORMAL0; + Input2 = dcl_Input2_TEXCOORD0; + //--- End Early Main --- + //Instruction 0 + //MUL + Temp[0] = vec4(Input0.yyyy * glstate_matrix_mvp[1]); + //Instruction 1 + //MAD + Temp[0] = vec4(glstate_matrix_mvp[0] * Input0.xxxx + Temp[0]); + //Instruction 2 + //MAD + Temp[0] = vec4(glstate_matrix_mvp[2] * Input0.zzzz + Temp[0]); + //Instruction 3 + //MAD + Output0 = vec4(glstate_matrix_mvp[3] * Input0.wwww + Temp[0]); + //Instruction 4 + //MAD + Output1.xy = vec4(Input2.xyxx * _MainTex_ST.xyxx + _MainTex_ST.zwzz).xy; + //Instruction 5 + //MUL + Temp[0].xyz = vec4(Input0.yyyy * glstate_matrix_modelview0[1].xyzx).xyz; + //Instruction 6 + //MAD + Temp[0].xyz = vec4(glstate_matrix_modelview0[0].xyzx * Input0.xxxx + Temp[0].xyzx).xyz; + //Instruction 7 + //MAD + Temp[0].xyz = vec4(glstate_matrix_modelview0[2].xyzx * Input0.zzzz + Temp[0].xyzx).xyz; + //Instruction 8 + //MAD + Temp[0].xyz = vec4(glstate_matrix_modelview0[3].xyzx * Input0.wwww + Temp[0].xyzx).xyz; + //Instruction 9 + //MUL + Temp[1].xyz = vec4(Input1.yyyy * glstate_matrix_invtrans_modelview0[1].xyzx).xyz; + //Instruction 10 + //MAD + Temp[1].xyz = vec4(glstate_matrix_invtrans_modelview0[0].xyzx * Input1.xxxx + Temp[1].xyzx).xyz; + //Instruction 11 + //MAD + Temp[1].xyz = vec4(glstate_matrix_invtrans_modelview0[2].xyzx * Input1.zzzz + Temp[1].xyzx).xyz; + //Instruction 12 + //DP3 + Temp[0].w = vec4(dot((Temp[1].xyzx).xyz, (Temp[1].xyzx).xyz)).w; + //Instruction 13 + //RSQ + Temp[0].w = vec4(inversesqrt(Temp[0].w)).w; + //Instruction 14 + //MUL + Temp[1].xyz = vec4(Temp[0].wwww * Temp[1].xyzx).xyz; + //Instruction 15 + //MOV + Temp[2].xyz = vec4(glstate_lightmodel_ambient.xyzx).xyz; + //Instruction 16 + //MOV + Temp_int[0].w = ivec4(0).w; + //Instruction 17 + //LOOP + while(true){ + //Instruction 18 + //IGE + // IGE+BREAKC opt + if (((Temp_int[0].w)>= (4))) { break; } + Temp_uint[1].w = ((Temp_int[0].w)>= (4)) ? 0xFFFFFFFFu : uint(0); + //Instruction 19 + //Instruction 20 + //MAD + Temp[3].xyz = vec4(-Temp[0].xyzx * unity_LightPosition[Temp_int[0].w + 0].wwww + unity_LightPosition[Temp_int[0].w + 0].xyzx).xyz; + //Instruction 21 + //DP3 + Temp[1].w = vec4(dot((Temp[3].xyzx).xyz, (Temp[3].xyzx).xyz)).w; + //Instruction 22 + //MAD + Temp[2].w = Temp[1].w * unity_LightAtten[Temp_int[0].w + 0].z + 1.000000; + //Instruction 23 + //DIV + Temp[2].w = vec4(vec4(1.000000, 1.000000, 1.000000, 1.000000) / Temp[2].w).w; + //Instruction 24 + //RSQ + Temp[1].w = vec4(inversesqrt(Temp[1].w)).w; + //Instruction 25 + //MUL + Temp[3].xyz = vec4(Temp[1].wwww * Temp[3].xyzx).xyz; + //Instruction 26 + //DP3 + Temp[1].w = vec4(dot((Temp[1].xyzx).xyz, (Temp[3].xyzx).xyz)).w; + //Instruction 27 + //MAX + Temp[1].w = vec4(max(Temp[1].w, 0.000000)).w; + //Instruction 28 + //MUL + Temp[1].w *= Temp[2].w; + //Instruction 29 + //MAD + Temp[2].xyz = vec4(unity_LightColor[Temp_int[0].w + 0].xyzx * Temp[1].wwww + Temp[2].xyzx).xyz; + //Instruction 30 + //IADD + Temp_int[0].w += 1; + //Instruction 31 + //ENDLOOP + } + //Instruction 32 + //ADD + Output2.xyz = vec4(Temp[2].xyzx + Temp[2].xyzx).xyz; + //Instruction 33 + //MOV + Output2.w = vec4(1.000000).w; + //Instruction 34 + //RET + //--- Post shader code --- + gl_Position = vec4(phase0_Output0); + //--- End post shader code --- + return; +} \ No newline at end of file diff --git a/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-inES3.txt b/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-inES3.txt new file mode 100644 index 000000000..d4239e41a --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-inES3.txt @@ -0,0 +1,188 @@ +#version 300 es +#ifndef SHADER_API_D3D11 + #define SHADER_API_D3D11 1 +#endif +#ifndef SHADER_API_D3D11 + #define SHADER_API_D3D11 1 +#endif +struct vec1 { + float x; +}; +struct uvec1 { + uint x; +}; +struct ivec1 { + int x; +}; +uniform Globals { + vec4 unity_ColorSpaceGrey; + vec4 _MainTex_ST; +}; +uniform UnityLighting { + vec4 _WorldSpaceLightPos0; + vec4 _LightPositionRange; + vec4 unity_4LightPosX0; + vec4 unity_4LightPosY0; + vec4 unity_4LightPosZ0; + vec4 unity_4LightAtten0; + vec4 unity_LightColor[8]; + vec4 unity_LightPosition[8]; + vec4 unity_LightAtten[8]; + vec4 unity_SpotDirection[8]; + vec4 unity_SHAr; + vec4 unity_SHAg; + vec4 unity_SHAb; + vec4 unity_SHBr; + vec4 unity_SHBg; + vec4 unity_SHBb; + vec4 unity_SHC; +}; +uniform UnityPerDraw { + vec4 glstate_matrix_mvp[4]; + vec4 glstate_matrix_modelview0[4]; + vec4 glstate_matrix_invtrans_modelview0[4]; + vec4 _Object2World[4]; + vec4 _World2Object[4]; + vec4 unity_Scale; + vec4 unity_LODFade; +}; +uniform UnityPerFrame { + vec4 glstate_matrix_projection[4]; + vec4 glstate_lightmodel_ambient; + vec4 unity_MatrixV[4]; + vec4 unity_MatrixVP[4]; + vec4 unity_AmbientSky; + vec4 unity_AmbientGround; +}; +in vec4 dcl_Input0_POSITION0; +vec4 Input0; +in vec4 dcl_Input1_NORMAL0; +vec4 Input1; +in vec4 dcl_Input2_TEXCOORD0; +vec4 Input2; +#undef Output0 +#define Output0 phase0_Output0 +vec4 phase0_Output0; + out vec4 VtxGeoOutput1_TEXCOORD0; +#define Output1 VtxGeoOutput1_TEXCOORD0 + out vec4 VtxGeoOutput2_COLOR0; +#define Output2 VtxGeoOutput2_COLOR0 +vec4 Temp[4]; +ivec4 Temp_int[4]; +uvec4 Temp_uint[4]; +void main() +{ + //--- Start Early Main --- + Input0 = dcl_Input0_POSITION0; + Input1 = dcl_Input1_NORMAL0; + Input2 = dcl_Input2_TEXCOORD0; + //--- End Early Main --- + //Instruction 0 + //MUL + Temp[0] = vec4(Input0.yyyy * glstate_matrix_mvp[1]); + //Instruction 1 + //MAD + Temp[0] = vec4(glstate_matrix_mvp[0] * Input0.xxxx + Temp[0]); + //Instruction 2 + //MAD + Temp[0] = vec4(glstate_matrix_mvp[2] * Input0.zzzz + Temp[0]); + //Instruction 3 + //MAD + Output0 = vec4(glstate_matrix_mvp[3] * Input0.wwww + Temp[0]); + //Instruction 4 + //MAD + Output1.xy = vec4(Input2.xyxx * _MainTex_ST.xyxx + _MainTex_ST.zwzz).xy; + //Instruction 5 + //MUL + Temp[0].xyz = vec4(Input0.yyyy * glstate_matrix_modelview0[1].xyzx).xyz; + //Instruction 6 + //MAD + Temp[0].xyz = vec4(glstate_matrix_modelview0[0].xyzx * Input0.xxxx + Temp[0].xyzx).xyz; + //Instruction 7 + //MAD + Temp[0].xyz = vec4(glstate_matrix_modelview0[2].xyzx * Input0.zzzz + Temp[0].xyzx).xyz; + //Instruction 8 + //MAD + Temp[0].xyz = vec4(glstate_matrix_modelview0[3].xyzx * Input0.wwww + Temp[0].xyzx).xyz; + //Instruction 9 + //MUL + Temp[1].xyz = vec4(Input1.yyyy * glstate_matrix_invtrans_modelview0[1].xyzx).xyz; + //Instruction 10 + //MAD + Temp[1].xyz = vec4(glstate_matrix_invtrans_modelview0[0].xyzx * Input1.xxxx + Temp[1].xyzx).xyz; + //Instruction 11 + //MAD + Temp[1].xyz = vec4(glstate_matrix_invtrans_modelview0[2].xyzx * Input1.zzzz + Temp[1].xyzx).xyz; + //Instruction 12 + //DP3 + Temp[0].w = vec4(dot((Temp[1].xyzx).xyz, (Temp[1].xyzx).xyz)).w; + //Instruction 13 + //RSQ + Temp[0].w = vec4(inversesqrt(Temp[0].w)).w; + //Instruction 14 + //MUL + Temp[1].xyz = vec4(Temp[0].wwww * Temp[1].xyzx).xyz; + //Instruction 15 + //MOV + Temp[2].xyz = vec4(glstate_lightmodel_ambient.xyzx).xyz; + //Instruction 16 + //MOV + Temp_int[0].w = ivec4(0).w; + //Instruction 17 + //LOOP + while(true){ + //Instruction 18 + //IGE + // IGE+BREAKC opt + if (((Temp_int[0].w)>= (4))) { break; } + Temp_uint[1].w = ((Temp_int[0].w)>= (4)) ? 0xFFFFFFFFu : uint(0); + //Instruction 19 + //Instruction 20 + //MAD + Temp[3].xyz = vec4(-Temp[0].xyzx * unity_LightPosition[Temp_int[0].w + 0].wwww + unity_LightPosition[Temp_int[0].w + 0].xyzx).xyz; + //Instruction 21 + //DP3 + Temp[1].w = vec4(dot((Temp[3].xyzx).xyz, (Temp[3].xyzx).xyz)).w; + //Instruction 22 + //MAD + Temp[2].w = Temp[1].w * unity_LightAtten[Temp_int[0].w + 0].z + 1.000000; + //Instruction 23 + //DIV + Temp[2].w = vec4(vec4(1.000000, 1.000000, 1.000000, 1.000000) / Temp[2].w).w; + //Instruction 24 + //RSQ + Temp[1].w = vec4(inversesqrt(Temp[1].w)).w; + //Instruction 25 + //MUL + Temp[3].xyz = vec4(Temp[1].wwww * Temp[3].xyzx).xyz; + //Instruction 26 + //DP3 + Temp[1].w = vec4(dot((Temp[1].xyzx).xyz, (Temp[3].xyzx).xyz)).w; + //Instruction 27 + //MAX + Temp[1].w = vec4(max(Temp[1].w, 0.000000)).w; + //Instruction 28 + //MUL + Temp[1].w *= Temp[2].w; + //Instruction 29 + //MAD + Temp[2].xyz = vec4(unity_LightColor[Temp_int[0].w + 0].xyzx * Temp[1].wwww + Temp[2].xyzx).xyz; + //Instruction 30 + //IADD + Temp_int[0].w += 1; + //Instruction 31 + //ENDLOOP + } + //Instruction 32 + //ADD + Output2.xyz = vec4(Temp[2].xyzx + Temp[2].xyzx).xyz; + //Instruction 33 + //MOV + Output2.w = vec4(1.000000).w; + //Instruction 34 + //RET + //--- Post shader code --- + gl_Position = vec4(phase0_Output0); + //--- End post shader code --- + return; +} \ No newline at end of file diff --git a/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-out.txt b/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-out.txt new file mode 100644 index 000000000..d851b3948 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-out.txt @@ -0,0 +1,151 @@ +#version 140 +uniform vec4 unity_AmbientGround; +uniform vec4 unity_AmbientSky; +uniform vec4 unity_MatrixVP[4]; +uniform vec4 unity_MatrixV[4]; +uniform vec4 glstate_lightmodel_ambient; +uniform vec4 glstate_matrix_projection[4]; +uniform vec4 unity_LODFade; +uniform vec4 unity_Scale; +uniform vec4 _World2Object[4]; +uniform vec4 _Object2World[4]; +uniform vec4 glstate_matrix_invtrans_modelview0[4]; +uniform vec4 glstate_matrix_modelview0[4]; +uniform vec4 glstate_matrix_mvp[4]; +uniform vec4 unity_SHC; +uniform vec4 unity_SHBb; +uniform vec4 unity_SHBg; +uniform vec4 unity_SHBr; +uniform vec4 unity_SHAb; +uniform vec4 unity_SHAg; +uniform vec4 unity_SHAr; +uniform vec4 unity_SpotDirection[8]; +uniform vec4 unity_LightAtten[8]; +uniform vec4 unity_LightPosition[8]; +uniform vec4 unity_LightColor[8]; +uniform vec4 unity_4LightAtten0; +uniform vec4 unity_4LightPosZ0; +uniform vec4 unity_4LightPosY0; +uniform vec4 unity_4LightPosX0; +uniform vec4 _LightPositionRange; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 _MainTex_ST; +uniform vec4 unity_ColorSpaceGrey; +in vec4 dcl_Input0_POSITION0; +in vec4 dcl_Input1_NORMAL0; +in vec4 dcl_Input2_TEXCOORD0; +out vec4 VtxGeoOutput1_TEXCOORD0; +out vec4 VtxGeoOutput2_COLOR0; +vec4 Temp_0; +vec4 Temp_1; +vec4 Temp_2; +vec4 Temp_3; +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; + 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; + Temp_0.xyz = ((glstate_matrix_modelview0[0].xyzx * dcl_Input0_POSITION0.xxxx) + Temp_0.xyzx).xyz; + Temp_0.xyz = ((glstate_matrix_modelview0[2].xyzx * dcl_Input0_POSITION0.zzzz) + Temp_0.xyzx).xyz; + Temp_0.xyz = ((glstate_matrix_modelview0[3].xyzx * dcl_Input0_POSITION0.wwww) + Temp_0.xyzx).xyz; + Temp_1.xyz = (dcl_Input1_NORMAL0.yyyy * glstate_matrix_invtrans_modelview0[1].xyzx).xyz; + Temp_1.xyz = ((glstate_matrix_invtrans_modelview0[0].xyzx * dcl_Input1_NORMAL0.xxxx) + Temp_1.xyzx).xyz; + Temp_1.xyz = ((glstate_matrix_invtrans_modelview0[2].xyzx * dcl_Input1_NORMAL0.zzzz) + Temp_1.xyzx).xyz; + Temp_0.w = dot (Temp_1.xyz, Temp_1.xyz); + Temp_0.w = inversesqrt(Temp_0.w); + Temp_1.xyz = (Temp_0.wwww * Temp_1.xyzx).xyz; + Temp_2.xyz = glstate_lightmodel_ambient.xyz; + tmpvar_1 = 0; + Temp_3.xyz = ((-(Temp_0.xyzx) * unity_LightPosition[tmpvar_1].wwww) + unity_LightPosition[tmpvar_1].xyzx).xyz; + Temp_1.w = dot (Temp_3.xyz, Temp_3.xyz); + Temp_2.w = ((Temp_1.w * unity_LightAtten[tmpvar_1].z) + 1.0); + Temp_2.w = (1.0/(Temp_2.w)); + Temp_1.w = inversesqrt(Temp_1.w); + Temp_3.xyz = (Temp_1.wwww * Temp_3.xyzx).xyz; + Temp_1.w = dot (Temp_1.xyz, Temp_3.xyz); + Temp_1.w = max (Temp_1.w, 0.0); + Temp_1.w = (Temp_1.w * Temp_2.w); + Temp_2.xyz = ((unity_LightColor[tmpvar_1].xyzx * Temp_1.wwww) + glstate_lightmodel_ambient.xyzx).xyz; + tmpvar_1++; + Temp_3.xyz = ((-(Temp_0.xyzx) * unity_LightPosition[tmpvar_1].wwww) + unity_LightPosition[tmpvar_1].xyzx).xyz; + Temp_1.w = dot (Temp_3.xyz, Temp_3.xyz); + Temp_2.w = ((Temp_1.w * unity_LightAtten[tmpvar_1].z) + 1.0); + Temp_2.w = (1.0/(Temp_2.w)); + Temp_1.w = inversesqrt(Temp_1.w); + Temp_3.xyz = (Temp_1.wwww * Temp_3.xyzx).xyz; + Temp_1.w = dot (Temp_1.xyz, Temp_3.xyz); + Temp_1.w = max (Temp_1.w, 0.0); + Temp_1.w = (Temp_1.w * Temp_2.w); + Temp_2.xyz = ((unity_LightColor[tmpvar_1].xyzx * Temp_1.wwww) + Temp_2.xyzx).xyz; + tmpvar_1++; + Temp_3.xyz = ((-(Temp_0.xyzx) * unity_LightPosition[tmpvar_1].wwww) + unity_LightPosition[tmpvar_1].xyzx).xyz; + Temp_1.w = dot (Temp_3.xyz, Temp_3.xyz); + Temp_2.w = ((Temp_1.w * unity_LightAtten[tmpvar_1].z) + 1.0); + Temp_2.w = (1.0/(Temp_2.w)); + Temp_1.w = inversesqrt(Temp_1.w); + Temp_3.xyz = (Temp_1.wwww * Temp_3.xyzx).xyz; + Temp_1.w = dot (Temp_1.xyz, Temp_3.xyz); + Temp_1.w = max (Temp_1.w, 0.0); + Temp_1.w = (Temp_1.w * Temp_2.w); + Temp_2.xyz = ((unity_LightColor[tmpvar_1].xyzx * Temp_1.wwww) + Temp_2.xyzx).xyz; + tmpvar_1++; + Temp_3.xyz = ((-(Temp_0.xyzx) * unity_LightPosition[tmpvar_1].wwww) + unity_LightPosition[tmpvar_1].xyzx).xyz; + Temp_1.w = dot (Temp_3.xyz, Temp_3.xyz); + Temp_2.w = ((Temp_1.w * unity_LightAtten[tmpvar_1].z) + 1.0); + Temp_2.w = (1.0/(Temp_2.w)); + Temp_1.w = inversesqrt(Temp_1.w); + Temp_3.xyz = (Temp_1.wwww * Temp_3.xyzx).xyz; + Temp_1.w = dot (Temp_1.xyz, Temp_3.xyz); + Temp_1.w = max (Temp_1.w, 0.0); + Temp_1.w = (Temp_1.w * Temp_2.w); + Temp_2.xyz = ((unity_LightColor[tmpvar_1].xyzx * Temp_1.wwww) + Temp_2.xyzx).xyz; + tmpvar_1++; + VtxGeoOutput2_COLOR0.xyz = (Temp_2.xyzx + Temp_2.xyzx).xyz; + VtxGeoOutput2_COLOR0.w = 1.0; + gl_Position = tmpvar_2; +} + + +// stats: 87 alu 0 tex 0 flow +// inputs: 3 +// #0: dcl_Input0_POSITION0 (high float) 4x1 [-1] +// #1: dcl_Input1_NORMAL0 (high float) 4x1 [-1] +// #2: dcl_Input2_TEXCOORD0 (high float) 4x1 [-1] +// uniforms: 32 (total size: 0) +// #0: unity_AmbientGround (high float) 4x1 [-1] +// #1: unity_AmbientSky (high float) 4x1 [-1] +// #2: unity_MatrixVP (high float) 4x1 [4] +// #3: unity_MatrixV (high float) 4x1 [4] +// #4: glstate_lightmodel_ambient (high float) 4x1 [-1] +// #5: glstate_matrix_projection (high float) 4x1 [4] +// #6: unity_LODFade (high float) 4x1 [-1] +// #7: unity_Scale (high float) 4x1 [-1] +// #8: _World2Object (high float) 4x1 [4] +// #9: _Object2World (high float) 4x1 [4] +// #10: glstate_matrix_invtrans_modelview0 (high float) 4x1 [4] +// #11: glstate_matrix_modelview0 (high float) 4x1 [4] +// #12: glstate_matrix_mvp (high float) 4x1 [4] +// #13: unity_SHC (high float) 4x1 [-1] +// #14: unity_SHBb (high float) 4x1 [-1] +// #15: unity_SHBg (high float) 4x1 [-1] +// #16: unity_SHBr (high float) 4x1 [-1] +// #17: unity_SHAb (high float) 4x1 [-1] +// #18: unity_SHAg (high float) 4x1 [-1] +// #19: unity_SHAr (high float) 4x1 [-1] +// #20: unity_SpotDirection (high float) 4x1 [8] +// #21: unity_LightAtten (high float) 4x1 [8] +// #22: unity_LightPosition (high float) 4x1 [8] +// #23: unity_LightColor (high float) 4x1 [8] +// #24: unity_4LightAtten0 (high float) 4x1 [-1] +// #25: unity_4LightPosZ0 (high float) 4x1 [-1] +// #26: unity_4LightPosY0 (high float) 4x1 [-1] +// #27: unity_4LightPosX0 (high float) 4x1 [-1] +// #28: _LightPositionRange (high float) 4x1 [-1] +// #29: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #30: _MainTex_ST (high float) 4x1 [-1] +// #31: unity_ColorSpaceGrey (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3.txt b/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3.txt new file mode 100644 index 000000000..2e23a7616 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3.txt @@ -0,0 +1,151 @@ +#version 300 es +uniform vec4 unity_AmbientGround; +uniform vec4 unity_AmbientSky; +uniform vec4 unity_MatrixVP[4]; +uniform vec4 unity_MatrixV[4]; +uniform vec4 glstate_lightmodel_ambient; +uniform vec4 glstate_matrix_projection[4]; +uniform vec4 unity_LODFade; +uniform vec4 unity_Scale; +uniform vec4 _World2Object[4]; +uniform vec4 _Object2World[4]; +uniform vec4 glstate_matrix_invtrans_modelview0[4]; +uniform vec4 glstate_matrix_modelview0[4]; +uniform vec4 glstate_matrix_mvp[4]; +uniform vec4 unity_SHC; +uniform vec4 unity_SHBb; +uniform vec4 unity_SHBg; +uniform vec4 unity_SHBr; +uniform vec4 unity_SHAb; +uniform vec4 unity_SHAg; +uniform vec4 unity_SHAr; +uniform vec4 unity_SpotDirection[8]; +uniform vec4 unity_LightAtten[8]; +uniform vec4 unity_LightPosition[8]; +uniform vec4 unity_LightColor[8]; +uniform vec4 unity_4LightAtten0; +uniform vec4 unity_4LightPosZ0; +uniform vec4 unity_4LightPosY0; +uniform vec4 unity_4LightPosX0; +uniform vec4 _LightPositionRange; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 _MainTex_ST; +uniform vec4 unity_ColorSpaceGrey; +in vec4 dcl_Input0_POSITION0; +in vec4 dcl_Input1_NORMAL0; +in vec4 dcl_Input2_TEXCOORD0; +out vec4 VtxGeoOutput1_TEXCOORD0; +out vec4 VtxGeoOutput2_COLOR0; +vec4 Temp_0; +vec4 Temp_1; +vec4 Temp_2; +vec4 Temp_3; +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; + 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; + Temp_0.xyz = ((glstate_matrix_modelview0[0].xyzx * dcl_Input0_POSITION0.xxxx) + Temp_0.xyzx).xyz; + Temp_0.xyz = ((glstate_matrix_modelview0[2].xyzx * dcl_Input0_POSITION0.zzzz) + Temp_0.xyzx).xyz; + Temp_0.xyz = ((glstate_matrix_modelview0[3].xyzx * dcl_Input0_POSITION0.wwww) + Temp_0.xyzx).xyz; + Temp_1.xyz = (dcl_Input1_NORMAL0.yyyy * glstate_matrix_invtrans_modelview0[1].xyzx).xyz; + Temp_1.xyz = ((glstate_matrix_invtrans_modelview0[0].xyzx * dcl_Input1_NORMAL0.xxxx) + Temp_1.xyzx).xyz; + Temp_1.xyz = ((glstate_matrix_invtrans_modelview0[2].xyzx * dcl_Input1_NORMAL0.zzzz) + Temp_1.xyzx).xyz; + Temp_0.w = dot (Temp_1.xyz, Temp_1.xyz); + Temp_0.w = inversesqrt(Temp_0.w); + Temp_1.xyz = (Temp_0.wwww * Temp_1.xyzx).xyz; + Temp_2.xyz = glstate_lightmodel_ambient.xyz; + tmpvar_1 = 0; + Temp_3.xyz = ((-(Temp_0.xyzx) * unity_LightPosition[tmpvar_1].wwww) + unity_LightPosition[tmpvar_1].xyzx).xyz; + Temp_1.w = dot (Temp_3.xyz, Temp_3.xyz); + Temp_2.w = ((Temp_1.w * unity_LightAtten[tmpvar_1].z) + 1.0); + Temp_2.w = (1.0/(Temp_2.w)); + Temp_1.w = inversesqrt(Temp_1.w); + Temp_3.xyz = (Temp_1.wwww * Temp_3.xyzx).xyz; + Temp_1.w = dot (Temp_1.xyz, Temp_3.xyz); + Temp_1.w = max (Temp_1.w, 0.0); + Temp_1.w = (Temp_1.w * Temp_2.w); + Temp_2.xyz = ((unity_LightColor[tmpvar_1].xyzx * Temp_1.wwww) + glstate_lightmodel_ambient.xyzx).xyz; + tmpvar_1++; + Temp_3.xyz = ((-(Temp_0.xyzx) * unity_LightPosition[tmpvar_1].wwww) + unity_LightPosition[tmpvar_1].xyzx).xyz; + Temp_1.w = dot (Temp_3.xyz, Temp_3.xyz); + Temp_2.w = ((Temp_1.w * unity_LightAtten[tmpvar_1].z) + 1.0); + Temp_2.w = (1.0/(Temp_2.w)); + Temp_1.w = inversesqrt(Temp_1.w); + Temp_3.xyz = (Temp_1.wwww * Temp_3.xyzx).xyz; + Temp_1.w = dot (Temp_1.xyz, Temp_3.xyz); + Temp_1.w = max (Temp_1.w, 0.0); + Temp_1.w = (Temp_1.w * Temp_2.w); + Temp_2.xyz = ((unity_LightColor[tmpvar_1].xyzx * Temp_1.wwww) + Temp_2.xyzx).xyz; + tmpvar_1++; + Temp_3.xyz = ((-(Temp_0.xyzx) * unity_LightPosition[tmpvar_1].wwww) + unity_LightPosition[tmpvar_1].xyzx).xyz; + Temp_1.w = dot (Temp_3.xyz, Temp_3.xyz); + Temp_2.w = ((Temp_1.w * unity_LightAtten[tmpvar_1].z) + 1.0); + Temp_2.w = (1.0/(Temp_2.w)); + Temp_1.w = inversesqrt(Temp_1.w); + Temp_3.xyz = (Temp_1.wwww * Temp_3.xyzx).xyz; + Temp_1.w = dot (Temp_1.xyz, Temp_3.xyz); + Temp_1.w = max (Temp_1.w, 0.0); + Temp_1.w = (Temp_1.w * Temp_2.w); + Temp_2.xyz = ((unity_LightColor[tmpvar_1].xyzx * Temp_1.wwww) + Temp_2.xyzx).xyz; + tmpvar_1++; + Temp_3.xyz = ((-(Temp_0.xyzx) * unity_LightPosition[tmpvar_1].wwww) + unity_LightPosition[tmpvar_1].xyzx).xyz; + Temp_1.w = dot (Temp_3.xyz, Temp_3.xyz); + Temp_2.w = ((Temp_1.w * unity_LightAtten[tmpvar_1].z) + 1.0); + Temp_2.w = (1.0/(Temp_2.w)); + Temp_1.w = inversesqrt(Temp_1.w); + Temp_3.xyz = (Temp_1.wwww * Temp_3.xyzx).xyz; + Temp_1.w = dot (Temp_1.xyz, Temp_3.xyz); + Temp_1.w = max (Temp_1.w, 0.0); + Temp_1.w = (Temp_1.w * Temp_2.w); + Temp_2.xyz = ((unity_LightColor[tmpvar_1].xyzx * Temp_1.wwww) + Temp_2.xyzx).xyz; + tmpvar_1++; + VtxGeoOutput2_COLOR0.xyz = (Temp_2.xyzx + Temp_2.xyzx).xyz; + VtxGeoOutput2_COLOR0.w = 1.0; + gl_Position = tmpvar_2; +} + + +// stats: 87 alu 0 tex 0 flow +// inputs: 3 +// #0: dcl_Input0_POSITION0 (high float) 4x1 [-1] +// #1: dcl_Input1_NORMAL0 (high float) 4x1 [-1] +// #2: dcl_Input2_TEXCOORD0 (high float) 4x1 [-1] +// uniforms: 32 (total size: 0) +// #0: unity_AmbientGround (high float) 4x1 [-1] +// #1: unity_AmbientSky (high float) 4x1 [-1] +// #2: unity_MatrixVP (high float) 4x1 [4] +// #3: unity_MatrixV (high float) 4x1 [4] +// #4: glstate_lightmodel_ambient (high float) 4x1 [-1] +// #5: glstate_matrix_projection (high float) 4x1 [4] +// #6: unity_LODFade (high float) 4x1 [-1] +// #7: unity_Scale (high float) 4x1 [-1] +// #8: _World2Object (high float) 4x1 [4] +// #9: _Object2World (high float) 4x1 [4] +// #10: glstate_matrix_invtrans_modelview0 (high float) 4x1 [4] +// #11: glstate_matrix_modelview0 (high float) 4x1 [4] +// #12: glstate_matrix_mvp (high float) 4x1 [4] +// #13: unity_SHC (high float) 4x1 [-1] +// #14: unity_SHBb (high float) 4x1 [-1] +// #15: unity_SHBg (high float) 4x1 [-1] +// #16: unity_SHBr (high float) 4x1 [-1] +// #17: unity_SHAb (high float) 4x1 [-1] +// #18: unity_SHAg (high float) 4x1 [-1] +// #19: unity_SHAr (high float) 4x1 [-1] +// #20: unity_SpotDirection (high float) 4x1 [8] +// #21: unity_LightAtten (high float) 4x1 [8] +// #22: unity_LightPosition (high float) 4x1 [8] +// #23: unity_LightColor (high float) 4x1 [8] +// #24: unity_4LightAtten0 (high float) 4x1 [-1] +// #25: unity_4LightPosZ0 (high float) 4x1 [-1] +// #26: unity_4LightPosY0 (high float) 4x1 [-1] +// #27: unity_4LightPosX0 (high float) 4x1 [-1] +// #28: _LightPositionRange (high float) 4x1 [-1] +// #29: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #30: _MainTex_ST (high float) 4x1 [-1] +// #31: unity_ColorSpaceGrey (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3Metal.txt new file mode 100644 index 000000000..748e6b5e6 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3Metal.txt @@ -0,0 +1,161 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float4 dcl_Input0_POSITION0 [[attribute(0)]]; + float4 dcl_Input1_NORMAL0 [[attribute(1)]]; + float4 dcl_Input2_TEXCOORD0 [[attribute(2)]]; +}; +struct xlatMtlShaderOutput { + float4 gl_Position [[position]]; + float4 VtxGeoOutput1_TEXCOORD0; + float4 VtxGeoOutput2_COLOR0; +}; +struct xlatMtlShaderUniform { + float4 unity_AmbientGround; + float4 unity_AmbientSky; + float4 unity_MatrixVP[4]; + float4 unity_MatrixV[4]; + float4 glstate_lightmodel_ambient; + float4 glstate_matrix_projection[4]; + float4 unity_LODFade; + float4 unity_Scale; + float4 _World2Object[4]; + float4 _Object2World[4]; + float4 glstate_matrix_invtrans_modelview0[4]; + float4 glstate_matrix_modelview0[4]; + float4 glstate_matrix_mvp[4]; + float4 unity_SHC; + float4 unity_SHBb; + float4 unity_SHBg; + float4 unity_SHBr; + float4 unity_SHAb; + float4 unity_SHAg; + float4 unity_SHAr; + float4 unity_SpotDirection[8]; + float4 unity_LightAtten[8]; + float4 unity_LightPosition[8]; + float4 unity_LightColor[8]; + float4 unity_4LightAtten0; + float4 unity_4LightPosZ0; + float4 unity_4LightPosY0; + float4 unity_4LightPosX0; + float4 _LightPositionRange; + float4 _WorldSpaceLightPos0; + float4 _MainTex_ST; + float4 unity_ColorSpaceGrey; +}; +vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; +float4 phase0_Output0_1; +float4 Temp_0_2; +float4 Temp_1_3; +float4 Temp_2_4; +float4 Temp_3_5; +int tmpvar_6; + Temp_0_2 = (_mtl_i.dcl_Input0_POSITION0.yyyy * _mtl_u.glstate_matrix_mvp[1]); + Temp_0_2 = ((_mtl_u.glstate_matrix_mvp[0] * _mtl_i.dcl_Input0_POSITION0.xxxx) + Temp_0_2); + Temp_0_2 = ((_mtl_u.glstate_matrix_mvp[2] * _mtl_i.dcl_Input0_POSITION0.zzzz) + Temp_0_2); + phase0_Output0_1 = ((_mtl_u.glstate_matrix_mvp[3] * _mtl_i.dcl_Input0_POSITION0.wwww) + Temp_0_2); + _mtl_o.VtxGeoOutput1_TEXCOORD0.xy = ((_mtl_i.dcl_Input2_TEXCOORD0.xyxx * _mtl_u._MainTex_ST.xyxx) + _mtl_u._MainTex_ST.zwzz).xy; + Temp_0_2.xyz = (_mtl_i.dcl_Input0_POSITION0.yyyy * _mtl_u.glstate_matrix_modelview0[1].xyzx).xyz; + Temp_0_2.xyz = ((_mtl_u.glstate_matrix_modelview0[0].xyzx * _mtl_i.dcl_Input0_POSITION0.xxxx) + Temp_0_2.xyzx).xyz; + Temp_0_2.xyz = ((_mtl_u.glstate_matrix_modelview0[2].xyzx * _mtl_i.dcl_Input0_POSITION0.zzzz) + Temp_0_2.xyzx).xyz; + Temp_0_2.xyz = ((_mtl_u.glstate_matrix_modelview0[3].xyzx * _mtl_i.dcl_Input0_POSITION0.wwww) + Temp_0_2.xyzx).xyz; + Temp_1_3.xyz = (_mtl_i.dcl_Input1_NORMAL0.yyyy * _mtl_u.glstate_matrix_invtrans_modelview0[1].xyzx).xyz; + Temp_1_3.xyz = ((_mtl_u.glstate_matrix_invtrans_modelview0[0].xyzx * _mtl_i.dcl_Input1_NORMAL0.xxxx) + Temp_1_3.xyzx).xyz; + Temp_1_3.xyz = ((_mtl_u.glstate_matrix_invtrans_modelview0[2].xyzx * _mtl_i.dcl_Input1_NORMAL0.zzzz) + Temp_1_3.xyzx).xyz; + Temp_0_2.w = dot (Temp_1_3.xyz, Temp_1_3.xyz); + Temp_0_2.w = rsqrt(Temp_0_2.w); + Temp_1_3.xyz = (Temp_0_2.wwww * Temp_1_3.xyzx).xyz; + Temp_2_4.xyz = _mtl_u.glstate_lightmodel_ambient.xyz; + tmpvar_6 = 0; + Temp_3_5.xyz = ((-(Temp_0_2.xyzx) * _mtl_u.unity_LightPosition[tmpvar_6].wwww) + _mtl_u.unity_LightPosition[tmpvar_6].xyzx).xyz; + Temp_1_3.w = dot (Temp_3_5.xyz, Temp_3_5.xyz); + Temp_2_4.w = ((Temp_1_3.w * _mtl_u.unity_LightAtten[tmpvar_6].z) + 1.0); + Temp_2_4.w = (1.0/(Temp_2_4.w)); + Temp_1_3.w = rsqrt(Temp_1_3.w); + Temp_3_5.xyz = (Temp_1_3.wwww * Temp_3_5.xyzx).xyz; + Temp_1_3.w = dot (Temp_1_3.xyz, Temp_3_5.xyz); + Temp_1_3.w = max (Temp_1_3.w, 0.0); + Temp_1_3.w = (Temp_1_3.w * Temp_2_4.w); + Temp_2_4.xyz = ((_mtl_u.unity_LightColor[tmpvar_6].xyzx * Temp_1_3.wwww) + _mtl_u.glstate_lightmodel_ambient.xyzx).xyz; + tmpvar_6++; + Temp_3_5.xyz = ((-(Temp_0_2.xyzx) * _mtl_u.unity_LightPosition[tmpvar_6].wwww) + _mtl_u.unity_LightPosition[tmpvar_6].xyzx).xyz; + Temp_1_3.w = dot (Temp_3_5.xyz, Temp_3_5.xyz); + Temp_2_4.w = ((Temp_1_3.w * _mtl_u.unity_LightAtten[tmpvar_6].z) + 1.0); + Temp_2_4.w = (1.0/(Temp_2_4.w)); + Temp_1_3.w = rsqrt(Temp_1_3.w); + Temp_3_5.xyz = (Temp_1_3.wwww * Temp_3_5.xyzx).xyz; + Temp_1_3.w = dot (Temp_1_3.xyz, Temp_3_5.xyz); + Temp_1_3.w = max (Temp_1_3.w, 0.0); + Temp_1_3.w = (Temp_1_3.w * Temp_2_4.w); + Temp_2_4.xyz = ((_mtl_u.unity_LightColor[tmpvar_6].xyzx * Temp_1_3.wwww) + Temp_2_4.xyzx).xyz; + tmpvar_6++; + Temp_3_5.xyz = ((-(Temp_0_2.xyzx) * _mtl_u.unity_LightPosition[tmpvar_6].wwww) + _mtl_u.unity_LightPosition[tmpvar_6].xyzx).xyz; + Temp_1_3.w = dot (Temp_3_5.xyz, Temp_3_5.xyz); + Temp_2_4.w = ((Temp_1_3.w * _mtl_u.unity_LightAtten[tmpvar_6].z) + 1.0); + Temp_2_4.w = (1.0/(Temp_2_4.w)); + Temp_1_3.w = rsqrt(Temp_1_3.w); + Temp_3_5.xyz = (Temp_1_3.wwww * Temp_3_5.xyzx).xyz; + Temp_1_3.w = dot (Temp_1_3.xyz, Temp_3_5.xyz); + Temp_1_3.w = max (Temp_1_3.w, 0.0); + Temp_1_3.w = (Temp_1_3.w * Temp_2_4.w); + Temp_2_4.xyz = ((_mtl_u.unity_LightColor[tmpvar_6].xyzx * Temp_1_3.wwww) + Temp_2_4.xyzx).xyz; + tmpvar_6++; + Temp_3_5.xyz = ((-(Temp_0_2.xyzx) * _mtl_u.unity_LightPosition[tmpvar_6].wwww) + _mtl_u.unity_LightPosition[tmpvar_6].xyzx).xyz; + Temp_1_3.w = dot (Temp_3_5.xyz, Temp_3_5.xyz); + Temp_2_4.w = ((Temp_1_3.w * _mtl_u.unity_LightAtten[tmpvar_6].z) + 1.0); + Temp_2_4.w = (1.0/(Temp_2_4.w)); + Temp_1_3.w = rsqrt(Temp_1_3.w); + Temp_3_5.xyz = (Temp_1_3.wwww * Temp_3_5.xyzx).xyz; + Temp_1_3.w = dot (Temp_1_3.xyz, Temp_3_5.xyz); + Temp_1_3.w = max (Temp_1_3.w, 0.0); + Temp_1_3.w = (Temp_1_3.w * Temp_2_4.w); + Temp_2_4.xyz = ((_mtl_u.unity_LightColor[tmpvar_6].xyzx * Temp_1_3.wwww) + Temp_2_4.xyzx).xyz; + tmpvar_6++; + _mtl_o.VtxGeoOutput2_COLOR0.xyz = (Temp_2_4.xyzx + Temp_2_4.xyzx).xyz; + _mtl_o.VtxGeoOutput2_COLOR0.w = 1.0; + _mtl_o.gl_Position = phase0_Output0_1; + return _mtl_o; +} + + +// stats: 87 alu 0 tex 0 flow +// inputs: 3 +// #0: dcl_Input0_POSITION0 (high float) 4x1 [-1] loc 0 +// #1: dcl_Input1_NORMAL0 (high float) 4x1 [-1] loc 1 +// #2: dcl_Input2_TEXCOORD0 (high float) 4x1 [-1] loc 2 +// uniforms: 32 (total size: 1344) +// #0: unity_AmbientGround (high float) 4x1 [-1] loc 0 +// #1: unity_AmbientSky (high float) 4x1 [-1] loc 16 +// #2: unity_MatrixVP (high float) 4x1 [4] loc 32 +// #3: unity_MatrixV (high float) 4x1 [4] loc 96 +// #4: glstate_lightmodel_ambient (high float) 4x1 [-1] loc 160 +// #5: glstate_matrix_projection (high float) 4x1 [4] loc 176 +// #6: unity_LODFade (high float) 4x1 [-1] loc 240 +// #7: unity_Scale (high float) 4x1 [-1] loc 256 +// #8: _World2Object (high float) 4x1 [4] loc 272 +// #9: _Object2World (high float) 4x1 [4] loc 336 +// #10: glstate_matrix_invtrans_modelview0 (high float) 4x1 [4] loc 400 +// #11: glstate_matrix_modelview0 (high float) 4x1 [4] loc 464 +// #12: glstate_matrix_mvp (high float) 4x1 [4] loc 528 +// #13: unity_SHC (high float) 4x1 [-1] loc 592 +// #14: unity_SHBb (high float) 4x1 [-1] loc 608 +// #15: unity_SHBg (high float) 4x1 [-1] loc 624 +// #16: unity_SHBr (high float) 4x1 [-1] loc 640 +// #17: unity_SHAb (high float) 4x1 [-1] loc 656 +// #18: unity_SHAg (high float) 4x1 [-1] loc 672 +// #19: unity_SHAr (high float) 4x1 [-1] loc 688 +// #20: unity_SpotDirection (high float) 4x1 [8] loc 704 +// #21: unity_LightAtten (high float) 4x1 [8] loc 832 +// #22: unity_LightPosition (high float) 4x1 [8] loc 960 +// #23: unity_LightColor (high float) 4x1 [8] loc 1088 +// #24: unity_4LightAtten0 (high float) 4x1 [-1] loc 1216 +// #25: unity_4LightPosZ0 (high float) 4x1 [-1] loc 1232 +// #26: unity_4LightPosY0 (high float) 4x1 [-1] loc 1248 +// #27: unity_4LightPosX0 (high float) 4x1 [-1] loc 1264 +// #28: _LightPositionRange (high float) 4x1 [-1] loc 1280 +// #29: _WorldSpaceLightPos0 (high float) 4x1 [-1] loc 1296 +// #30: _MainTex_ST (high float) 4x1 [-1] loc 1312 +// #31: unity_ColorSpaceGrey (high float) 4x1 [-1] loc 1328 diff --git a/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-ir.txt deleted file mode 100644 index 96f05b68b..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-ir.txt +++ /dev/null @@ -1,31 +0,0 @@ -uniform vec4 uniColors[4]; -varying vec4 varColor; -void main () -{ - int i_1; - vec4 col_2; - vec4 tmpvar_3; - tmpvar_3 = gl_Vertex; - gl_Position = tmpvar_3; - vec4 tmpvar_4; - tmpvar_4 = vec4(0.0, 0.0, 0.0, 0.0); - col_2 = tmpvar_4; - int tmpvar_5; - tmpvar_5 = 0; - i_1 = tmpvar_5; - while (true) { - if (!((i_1 < 4))) { - break; - }; - vec4 tmpvar_6; - tmpvar_6 = (col_2 + uniColors[i_1]); - col_2 = tmpvar_6; - int tmpvar_7; - tmpvar_7 = (i_1 + 1); - i_1 = tmpvar_7; - }; - vec4 tmpvar_8; - tmpvar_8 = col_2; - varColor = tmpvar_8; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-out.txt b/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-out.txt index 4ffab2942..454265781 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-out.txt @@ -12,4 +12,8 @@ void main () } -// inputs: 1, stats: 3 alu 0 tex 0 flow +// stats: 3 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 1 (total size: 0) +// #0: uniColors (high float) 4x1 [4] diff --git a/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-inES3.txt b/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-inES3.txt new file mode 100644 index 000000000..ed4f383c6 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-inES3.txt @@ -0,0 +1,74 @@ +#version 300 es + +#line 14 +struct v2f { + mediump vec4 pos; + mediump vec4 color; +}; +#line 9 +struct appdata { + highp vec4 vertex; + highp vec3 normal; +}; +uniform highp mat4 UNITY_MATRIX_MVP; +uniform highp vec4 unity_LightAtten[4]; +uniform highp vec4 unity_LightColor[4]; +v2f xlat_main( in appdata v ); +#line 35 +v2f xlat_main( in appdata v ) { + v2f o; + highp int i = 0; + highp int i_1 = 0; + highp int j = 3; + highp int i_2 = 0; + highp vec4 l; + highp int i_3 = 0; + highp vec4 l_1; + highp int k = 1; + highp int z; + #line 38 + o.pos = (UNITY_MATRIX_MVP * v.vertex); + o.color = vec4( 0.00000); + for ( ; (i < 2); (++i)) { + o.color += unity_LightColor[i]; + } + #line 45 + for ( ; (i_1 < 4); (++i_1)) { + o.color += unity_LightColor[i_1]; + } + #line 49 + for ( ; (j >= 0); j = (j - 1)) { + o.color += unity_LightColor[j]; + } + #line 53 + for ( ; (i_2 < 2); (++i_2)) { + l = (unity_LightColor[i_2] * unity_LightAtten[i_2].x); + o.color += l; + } + #line 59 + for ( ; (i_3 < 2); (++i_3)) { + l_1 = (unity_LightColor[i_3] * unity_LightAtten[i_3].z); + o.color += l_1; + } + #line 65 + while ( (k < 3) ) { + o.color += unity_LightColor[k].x; + #line 69 + z = (k + 1); + k = z; + } + #line 73 + return o; +} +in highp vec4 _inVertex; +in mediump vec3 _inNormal; +out mediump vec4 xlv_TEXCOORD0; +void main() { + v2f xl_retval; + appdata xlt_v; + xlt_v.vertex = vec4(_inVertex); + xlt_v.normal = vec3(_inNormal); + xl_retval = xlat_main( xlt_v); + gl_Position = vec4( xl_retval.pos); + xlv_TEXCOORD0 = vec4( xl_retval.color); +} diff --git a/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-irES.txt b/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-irES.txt deleted file mode 100644 index 997faa55d..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-irES.txt +++ /dev/null @@ -1,164 +0,0 @@ -struct v2f { - mediump vec4 pos; - mediump vec4 color; -}; -struct appdata { - highp vec4 vertex; - highp vec3 normal; -}; -attribute highp vec4 _glesVertex; -attribute mediump vec3 _glesNormal; -attribute highp vec4 _glesMultiTexCoord0; -attribute highp vec4 _glesMultiTexCoord1; -attribute lowp vec4 _glesColor; -uniform highp mat4 UNITY_MATRIX_MVP; -uniform highp vec4 unity_LightAtten[4]; -uniform highp vec4 unity_LightColor[4]; -varying mediump vec4 xlv_TEXCOORD0; -v2f xlat_main ( - in appdata v_1 -) -{ - int z_2; - int k_3; - highp vec4 l_1_4; - int i_3_5; - highp vec4 l_6; - int i_2_7; - int j_8; - int i_1_9; - int i_10; - v2f o_11; - int tmpvar_12; - tmpvar_12 = 0; - i_10 = tmpvar_12; - int tmpvar_13; - tmpvar_13 = 0; - i_1_9 = tmpvar_13; - int tmpvar_14; - tmpvar_14 = 3; - j_8 = tmpvar_14; - int tmpvar_15; - tmpvar_15 = 0; - i_2_7 = tmpvar_15; - int tmpvar_16; - tmpvar_16 = 0; - i_3_5 = tmpvar_16; - int tmpvar_17; - tmpvar_17 = 1; - k_3 = tmpvar_17; - highp vec4 tmpvar_18; - tmpvar_18 = (UNITY_MATRIX_MVP * v_1.vertex); - o_11.pos = tmpvar_18; - vec4 tmpvar_19; - tmpvar_19 = vec4(0.0, 0.0, 0.0, 0.0); - o_11.color = tmpvar_19; - while (true) { - if (!((i_10 < 2))) { - break; - }; - highp vec4 tmpvar_20; - tmpvar_20 = (o_11.color + unity_LightColor[i_10]); - o_11.color = tmpvar_20; - int tmpvar_21; - tmpvar_21 = (i_10 + 1); - i_10 = tmpvar_21; - }; - while (true) { - if (!((i_1_9 < 4))) { - break; - }; - highp vec4 tmpvar_22; - tmpvar_22 = (o_11.color + unity_LightColor[i_1_9]); - o_11.color = tmpvar_22; - int tmpvar_23; - tmpvar_23 = (i_1_9 + 1); - i_1_9 = tmpvar_23; - }; - while (true) { - if (!((j_8 >= 0))) { - break; - }; - highp vec4 tmpvar_24; - tmpvar_24 = (o_11.color + unity_LightColor[j_8]); - o_11.color = tmpvar_24; - int tmpvar_25; - tmpvar_25 = (j_8 - 1); - j_8 = tmpvar_25; - }; - while (true) { - if (!((i_2_7 < 2))) { - break; - }; - highp vec4 tmpvar_26; - tmpvar_26 = (unity_LightColor[i_2_7] * unity_LightAtten[i_2_7].x); - l_6 = tmpvar_26; - highp vec4 tmpvar_27; - tmpvar_27 = (o_11.color + l_6); - o_11.color = tmpvar_27; - int tmpvar_28; - tmpvar_28 = (i_2_7 + 1); - i_2_7 = tmpvar_28; - }; - while (true) { - if (!((i_3_5 < 2))) { - break; - }; - highp vec4 tmpvar_29; - tmpvar_29 = (unity_LightColor[i_3_5] * unity_LightAtten[i_3_5].z); - l_1_4 = tmpvar_29; - highp vec4 tmpvar_30; - tmpvar_30 = (o_11.color + l_1_4); - o_11.color = tmpvar_30; - int tmpvar_31; - tmpvar_31 = (i_3_5 + 1); - i_3_5 = tmpvar_31; - }; - while (true) { - if (!((k_3 < 3))) { - break; - }; - highp vec4 tmpvar_32; - tmpvar_32 = (o_11.color + unity_LightColor[k_3].x); - o_11.color = tmpvar_32; - int tmpvar_33; - tmpvar_33 = (k_3 + 1); - z_2 = tmpvar_33; - int tmpvar_34; - tmpvar_34 = z_2; - k_3 = tmpvar_34; - }; - return o_11; -} - -void main () -{ - appdata xlt_v_35; - v2f xl_retval_36; - highp vec4 tmpvar_37; - tmpvar_37 = _glesVertex.xyzw; - highp vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlt_v_35.vertex = tmpvar_38; - mediump vec3 tmpvar_39; - tmpvar_39 = _glesNormal.xyz; - mediump vec3 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_v_35.normal = tmpvar_40; - v2f tmpvar_41; - tmpvar_41 = xlat_main (xlt_v_35); - v2f tmpvar_42; - tmpvar_42 = tmpvar_41; - xl_retval_36 = tmpvar_42; - mediump vec4 tmpvar_43; - tmpvar_43 = xl_retval_36.pos.xyzw; - mediump vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - gl_Position = tmpvar_44; - mediump vec4 tmpvar_45; - tmpvar_45 = xl_retval_36.color.xyzw; - mediump vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlv_TEXCOORD0 = tmpvar_46; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES.txt b/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES.txt index 5a6f8f776..b30ed4728 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES.txt @@ -5,62 +5,40 @@ uniform highp vec4 unity_LightColor[4]; varying mediump vec4 xlv_TEXCOORD0; void main () { - mediump vec4 tmpvar_1; - mediump vec4 tmpvar_2; - highp vec4 tmpvar_3; + highp vec4 l_1_1; + highp vec4 l_2; + mediump vec4 tmpvar_3; + mediump vec4 tmpvar_4; tmpvar_3 = (UNITY_MATRIX_MVP * _glesVertex); - tmpvar_1 = tmpvar_3; - highp vec4 tmpvar_4; tmpvar_4 = unity_LightColor[0]; - tmpvar_2 = tmpvar_4; - highp vec4 tmpvar_5; - tmpvar_5 = (tmpvar_2 + unity_LightColor[1]); - tmpvar_2 = tmpvar_5; - highp vec4 tmpvar_6; - tmpvar_6 = (tmpvar_2 + unity_LightColor[0]); - tmpvar_2 = tmpvar_6; - highp vec4 tmpvar_7; - tmpvar_7 = (tmpvar_2 + unity_LightColor[1]); - tmpvar_2 = tmpvar_7; - highp vec4 tmpvar_8; - tmpvar_8 = (tmpvar_2 + unity_LightColor[2]); - tmpvar_2 = tmpvar_8; - highp vec4 tmpvar_9; - tmpvar_9 = (tmpvar_2 + unity_LightColor[3]); - tmpvar_2 = tmpvar_9; - highp vec4 tmpvar_10; - tmpvar_10 = (tmpvar_2 + unity_LightColor[3]); - tmpvar_2 = tmpvar_10; - highp vec4 tmpvar_11; - tmpvar_11 = (tmpvar_2 + unity_LightColor[2]); - tmpvar_2 = tmpvar_11; - highp vec4 tmpvar_12; - tmpvar_12 = (tmpvar_2 + unity_LightColor[1]); - tmpvar_2 = tmpvar_12; - highp vec4 tmpvar_13; - tmpvar_13 = (tmpvar_2 + unity_LightColor[0]); - tmpvar_2 = tmpvar_13; - highp vec4 tmpvar_14; - tmpvar_14 = (tmpvar_2 + (unity_LightColor[0] * unity_LightAtten[0].x)); - tmpvar_2 = tmpvar_14; - highp vec4 tmpvar_15; - tmpvar_15 = (tmpvar_2 + (unity_LightColor[1] * unity_LightAtten[1].x)); - tmpvar_2 = tmpvar_15; - highp vec4 tmpvar_16; - tmpvar_16 = (tmpvar_2 + (unity_LightColor[0] * unity_LightAtten[0].z)); - tmpvar_2 = tmpvar_16; - highp vec4 tmpvar_17; - tmpvar_17 = (tmpvar_2 + (unity_LightColor[1] * unity_LightAtten[1].z)); - tmpvar_2 = tmpvar_17; - highp vec4 tmpvar_18; - tmpvar_18 = (tmpvar_2 + unity_LightColor[1].x); - tmpvar_2 = tmpvar_18; - highp vec4 tmpvar_19; - tmpvar_19 = (tmpvar_2 + unity_LightColor[2].x); - tmpvar_2 = tmpvar_19; - gl_Position = tmpvar_1; - xlv_TEXCOORD0 = tmpvar_2; + tmpvar_4 = (tmpvar_4 + unity_LightColor[1]); + tmpvar_4 = (tmpvar_4 + unity_LightColor[0]); + tmpvar_4 = (tmpvar_4 + unity_LightColor[1]); + tmpvar_4 = (tmpvar_4 + unity_LightColor[2]); + tmpvar_4 = (tmpvar_4 + unity_LightColor[3]); + tmpvar_4 = (tmpvar_4 + unity_LightColor[3]); + tmpvar_4 = (tmpvar_4 + unity_LightColor[2]); + tmpvar_4 = (tmpvar_4 + unity_LightColor[1]); + tmpvar_4 = (tmpvar_4 + unity_LightColor[0]); + l_2 = (unity_LightColor[0] * unity_LightAtten[0].x); + tmpvar_4 = (tmpvar_4 + l_2); + l_2 = (unity_LightColor[1] * unity_LightAtten[1].x); + tmpvar_4 = (tmpvar_4 + l_2); + l_1_1 = (unity_LightColor[0] * unity_LightAtten[0].z); + tmpvar_4 = (tmpvar_4 + l_1_1); + l_1_1 = (unity_LightColor[1] * unity_LightAtten[1].z); + tmpvar_4 = (tmpvar_4 + l_1_1); + tmpvar_4 = (tmpvar_4 + unity_LightColor[1].x); + tmpvar_4 = (tmpvar_4 + unity_LightColor[2].x); + gl_Position = tmpvar_3; + xlv_TEXCOORD0 = tmpvar_4; } -// inputs: 1, stats: 20 alu 0 tex 0 flow +// stats: 20 alu 0 tex 0 flow +// inputs: 1 +// #0: _glesVertex (high float) 4x1 [-1] +// uniforms: 3 (total size: 0) +// #0: UNITY_MATRIX_MVP (high float) 4x4 [-1] +// #1: unity_LightAtten (high float) 4x1 [4] +// #2: unity_LightColor (high float) 4x1 [4] diff --git a/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES3.txt b/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES3.txt new file mode 100644 index 000000000..e24e976c3 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES3.txt @@ -0,0 +1,45 @@ +#version 300 es +uniform highp mat4 UNITY_MATRIX_MVP; +uniform highp vec4 unity_LightAtten[4]; +uniform highp vec4 unity_LightColor[4]; +in highp vec4 _inVertex; +out mediump vec4 xlv_TEXCOORD0; +void main () +{ + highp vec4 l_1_1; + highp vec4 l_2; + mediump vec4 tmpvar_3; + mediump vec4 tmpvar_4; + tmpvar_3 = (UNITY_MATRIX_MVP * _inVertex); + tmpvar_4 = unity_LightColor[0]; + tmpvar_4 = (tmpvar_4 + unity_LightColor[1]); + tmpvar_4 = (tmpvar_4 + unity_LightColor[0]); + tmpvar_4 = (tmpvar_4 + unity_LightColor[1]); + tmpvar_4 = (tmpvar_4 + unity_LightColor[2]); + tmpvar_4 = (tmpvar_4 + unity_LightColor[3]); + tmpvar_4 = (tmpvar_4 + unity_LightColor[3]); + tmpvar_4 = (tmpvar_4 + unity_LightColor[2]); + tmpvar_4 = (tmpvar_4 + unity_LightColor[1]); + tmpvar_4 = (tmpvar_4 + unity_LightColor[0]); + l_2 = (unity_LightColor[0] * unity_LightAtten[0].x); + tmpvar_4 = (tmpvar_4 + l_2); + l_2 = (unity_LightColor[1] * unity_LightAtten[1].x); + tmpvar_4 = (tmpvar_4 + l_2); + l_1_1 = (unity_LightColor[0] * unity_LightAtten[0].z); + tmpvar_4 = (tmpvar_4 + l_1_1); + l_1_1 = (unity_LightColor[1] * unity_LightAtten[1].z); + tmpvar_4 = (tmpvar_4 + l_1_1); + tmpvar_4 = (tmpvar_4 + unity_LightColor[1].x); + tmpvar_4 = (tmpvar_4 + unity_LightColor[2].x); + gl_Position = tmpvar_3; + xlv_TEXCOORD0 = tmpvar_4; +} + + +// stats: 20 alu 0 tex 0 flow +// inputs: 1 +// #0: _inVertex (high float) 4x1 [-1] +// uniforms: 3 (total size: 0) +// #0: UNITY_MATRIX_MVP (high float) 4x4 [-1] +// #1: unity_LightAtten (high float) 4x1 [4] +// #2: unity_LightColor (high float) 4x1 [4] diff --git a/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES3Metal.txt new file mode 100644 index 000000000..6e94ee11d --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES3Metal.txt @@ -0,0 +1,55 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float4 _inVertex [[attribute(0)]]; +}; +struct xlatMtlShaderOutput { + float4 gl_Position [[position]]; + half4 xlv_TEXCOORD0; +}; +struct xlatMtlShaderUniform { + float4x4 UNITY_MATRIX_MVP; + float4 unity_LightAtten[4]; + float4 unity_LightColor[4]; +}; +vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + float4 l_1_1; + float4 l_2; + half4 tmpvar_3; + half4 tmpvar_4; + tmpvar_3 = half4((_mtl_u.UNITY_MATRIX_MVP * _mtl_i._inVertex)); + tmpvar_4 = half4(_mtl_u.unity_LightColor[0]); + tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[1])); + tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[0])); + tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[1])); + tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[2])); + tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[3])); + tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[3])); + tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[2])); + tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[1])); + tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[0])); + l_2 = (_mtl_u.unity_LightColor[0] * _mtl_u.unity_LightAtten[0].x); + tmpvar_4 = half4(((float4)tmpvar_4 + l_2)); + l_2 = (_mtl_u.unity_LightColor[1] * _mtl_u.unity_LightAtten[1].x); + tmpvar_4 = half4(((float4)tmpvar_4 + l_2)); + l_1_1 = (_mtl_u.unity_LightColor[0] * _mtl_u.unity_LightAtten[0].z); + tmpvar_4 = half4(((float4)tmpvar_4 + l_1_1)); + l_1_1 = (_mtl_u.unity_LightColor[1] * _mtl_u.unity_LightAtten[1].z); + tmpvar_4 = half4(((float4)tmpvar_4 + l_1_1)); + tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[1].x)); + tmpvar_4 = half4(((float4)tmpvar_4 + _mtl_u.unity_LightColor[2].x)); + _mtl_o.gl_Position = float4(tmpvar_3); + _mtl_o.xlv_TEXCOORD0 = tmpvar_4; + return _mtl_o; +} + + +// stats: 20 alu 0 tex 0 flow +// inputs: 1 +// #0: _inVertex (high float) 4x1 [-1] loc 0 +// uniforms: 3 (total size: 192) +// #0: UNITY_MATRIX_MVP (high float) 4x4 [-1] loc 0 +// #1: unity_LightAtten (high float) 4x1 [4] loc 64 +// #2: unity_LightColor (high float) 4x1 [4] loc 128 diff --git a/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-ir.txt deleted file mode 100644 index 5d1ac310b..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-ir.txt +++ /dev/null @@ -1,33 +0,0 @@ -uniform vec4 uniColors[4]; -varying vec4 varColor; -void main () -{ - int i_1; - vec4 col_2; - vec4 tmpvar_3; - tmpvar_3 = gl_Vertex; - gl_Position = tmpvar_3; - vec4 tmpvar_4; - tmpvar_4 = vec4(0.0, 0.0, 0.0, 0.0); - col_2 = tmpvar_4; - int tmpvar_5; - tmpvar_5 = 0; - i_1 = tmpvar_5; - while (true) { - if (!((i_1 < 4))) { - break; - }; - vec4 tmpvar_6; - tmpvar_6 = max (vec4(0.0, 0.0, 0.0, 0.0), uniColors[i_1]); - vec4 tmpvar_7; - tmpvar_7 = (col_2 + tmpvar_6); - col_2 = tmpvar_7; - int tmpvar_8; - tmpvar_8 = (i_1 + 1); - i_1 = tmpvar_8; - }; - vec4 tmpvar_9; - tmpvar_9 = col_2; - varColor = tmpvar_9; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-out.txt b/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-out.txt index 9d851c1a1..d1f5779b2 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-out.txt @@ -12,4 +12,8 @@ void main () } -// inputs: 1, stats: 7 alu 0 tex 0 flow +// stats: 7 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 1 (total size: 0) +// #0: uniColors (high float) 4x1 [4] diff --git a/3rdparty/glsl-optimizer/tests/vertex/matrix-casts-inES3.txt b/3rdparty/glsl-optimizer/tests/vertex/matrix-casts-inES3.txt new file mode 100644 index 000000000..36132a10a --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/matrix-casts-inES3.txt @@ -0,0 +1,32 @@ +#version 300 es + +uniform highp mat4 uniMat4F; +uniform mediump mat4 uniMat4H; +uniform highp mat3 uniMat3F; +uniform mediump mat3 uniMat3H; +uniform highp mat2 uniMat2F; +uniform mediump mat2 uniMat2H; + +in highp vec4 inf; +in mediump vec4 inh; + +void main() +{ + highp vec4 r = vec4(0.0); + + mediump mat4 ftoh4 = uniMat4F; + r.x += ftoh4[0][0]; + mediump mat3 ftoh3 = uniMat3F; + r.x += ftoh4[0][0]; + mediump mat2 ftoh2 = uniMat2F; + r.x += ftoh2[0][0]; + + highp mat4 htof4 = uniMat4H; + r.x += htof4[0][0]; + highp mat3 htof3 = uniMat3H; + r.x += htof3[0][0]; + highp mat2 htof2 = uniMat2H; + r.x += htof2[0][0]; + + gl_Position = r; +} diff --git a/3rdparty/glsl-optimizer/tests/vertex/matrix-casts-outES3.txt b/3rdparty/glsl-optimizer/tests/vertex/matrix-casts-outES3.txt new file mode 100644 index 000000000..5172170a5 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/matrix-casts-outES3.txt @@ -0,0 +1,37 @@ +#version 300 es +uniform highp mat4 uniMat4F; +uniform mediump mat4 uniMat4H; +uniform mediump mat3 uniMat3H; +uniform highp mat2 uniMat2F; +uniform mediump mat2 uniMat2H; +void main () +{ + highp mat2 htof2_1; + highp mat3 htof3_2; + highp mat4 htof4_3; + mediump mat2 ftoh2_4; + mediump mat4 ftoh4_5; + highp vec4 r_6; + r_6.yzw = vec3(0.0, 0.0, 0.0); + ftoh4_5 = uniMat4F; + r_6.x = ftoh4_5[0].x; + r_6.x = (r_6.x + ftoh4_5[0].x); + ftoh2_4 = uniMat2F; + r_6.x = (r_6.x + ftoh2_4[0].x); + htof4_3 = uniMat4H; + r_6.x = (r_6.x + htof4_3[0].x); + htof3_2 = uniMat3H; + r_6.x = (r_6.x + htof3_2[0].x); + htof2_1 = uniMat2H; + r_6.x = (r_6.x + htof2_1[0].x); + gl_Position = r_6; +} + + +// stats: 6 alu 0 tex 0 flow +// uniforms: 5 (total size: 0) +// #0: uniMat4F (high float) 4x4 [-1] +// #1: uniMat4H (medium float) 4x4 [-1] +// #2: uniMat3H (medium float) 3x3 [-1] +// #3: uniMat2F (high float) 2x2 [-1] +// #4: uniMat2H (medium float) 2x2 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/matrix-casts-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/vertex/matrix-casts-outES3Metal.txt new file mode 100644 index 000000000..8e8bf3508 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/matrix-casts-outES3Metal.txt @@ -0,0 +1,53 @@ +#include +using namespace metal; +inline float4x4 _xlcast_float4x4(half4x4 v) { return float4x4(float4(v[0]), float4(v[1]), float4(v[2]), float4(v[3])); } +inline float3x3 _xlcast_float3x3(half3x3 v) { return float3x3(float3(v[0]), float3(v[1]), float3(v[2])); } +inline float2x2 _xlcast_float2x2(half2x2 v) { return float2x2(float2(v[0]), float2(v[1])); } +inline half4x4 _xlcast_half4x4(float4x4 v) { return half4x4(half4(v[0]), half4(v[1]), half4(v[2]), half4(v[3])); } +inline half3x3 _xlcast_half3x3(float3x3 v) { return half3x3(half3(v[0]), half3(v[1]), half3(v[2])); } +inline half2x2 _xlcast_half2x2(float2x2 v) { return half2x2(half2(v[0]), half2(v[1])); } +struct xlatMtlShaderInput { +}; +struct xlatMtlShaderOutput { + float4 gl_Position [[position]]; +}; +struct xlatMtlShaderUniform { + float4x4 uniMat4F; + half4x4 uniMat4H; + half3x3 uniMat3H; + float2x2 uniMat2F; + half2x2 uniMat2H; +}; +vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + float2x2 htof2_1; + float3x3 htof3_2; + float4x4 htof4_3; + half2x2 ftoh2_4; + half4x4 ftoh4_5; + float4 r_6; + r_6.yzw = float3(0.0, 0.0, 0.0); + ftoh4_5 = _xlcast_half4x4(_mtl_u.uniMat4F); + r_6.x = float(ftoh4_5[0].x); + r_6.x = (r_6.x + (float)ftoh4_5[0].x); + ftoh2_4 = _xlcast_half2x2(_mtl_u.uniMat2F); + r_6.x = (r_6.x + (float)ftoh2_4[0].x); + htof4_3 = _xlcast_float4x4(_mtl_u.uniMat4H); + r_6.x = (r_6.x + htof4_3[0].x); + htof3_2 = _xlcast_float3x3(_mtl_u.uniMat3H); + r_6.x = (r_6.x + htof3_2[0].x); + htof2_1 = _xlcast_float2x2(_mtl_u.uniMat2H); + r_6.x = (r_6.x + htof2_1[0].x); + _mtl_o.gl_Position = r_6; + return _mtl_o; +} + + +// stats: 6 alu 0 tex 0 flow +// uniforms: 5 (total size: 144) +// #0: uniMat4F (high float) 4x4 [-1] loc 0 +// #1: uniMat4H (medium float) 4x4 [-1] loc 64 +// #2: uniMat3H (medium float) 3x3 [-1] loc 96 +// #3: uniMat2F (high float) 2x2 [-1] loc 120 +// #4: uniMat2H (medium float) 2x2 [-1] loc 136 diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-inline-varnames-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-inline-varnames-ir.txt deleted file mode 100644 index 4badf65ed..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-inline-varnames-ir.txt +++ /dev/null @@ -1,55 +0,0 @@ -float foo ( - in float a_1, - in float b_2, - in float c_3 -) -{ - return ((a_1 + b_2) + c_3); -} - -float bar ( - in float a_4, - in float b_5 -) -{ - float c_6; - float tmpvar_7; - tmpvar_7 = (a_4 * b_5); - c_6 = tmpvar_7; - float tmpvar_8; - tmpvar_8 = foo (a_4, b_5, c_6); - return tmpvar_8; -} - -float har ( - in float a_9 -) -{ - float c_10; - float b_11; - float tmpvar_12; - tmpvar_12 = sqrt (a_9); - float tmpvar_13; - tmpvar_13 = tmpvar_12; - b_11 = tmpvar_13; - float tmpvar_14; - tmpvar_14 = sqrt (b_11); - float tmpvar_15; - tmpvar_15 = tmpvar_14; - c_10 = tmpvar_15; - float tmpvar_16; - tmpvar_16 = bar (a_9, b_11); - return (tmpvar_16 + c_10); -} - -void main () -{ - float tmpvar_17; - tmpvar_17 = har (gl_Vertex.x); - vec4 tmpvar_18; - tmpvar_18 = vec4(tmpvar_17); - vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - gl_Position = tmpvar_19; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-inline-varnames-out.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-inline-varnames-out.txt index f5294ef94..3b5f0e754 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-inline-varnames-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/opt-inline-varnames-out.txt @@ -6,4 +6,6 @@ void main () } -// inputs: 1, stats: 6 alu 0 tex 0 flow +// stats: 6 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_Vertex (high float) 4x1 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-ir.txt deleted file mode 100644 index d5eff77ed..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-ir.txt +++ /dev/null @@ -1,21 +0,0 @@ -void main () -{ - vec3 n_1; - mat3 m_2; - vec4 tmpvar_3; - tmpvar_3 = (gl_ModelViewProjectionMatrix * gl_Vertex); - gl_Position = tmpvar_3; - mat3 tmpvar_4; - tmpvar_4 = mat3(0.1, 0.8, 0.1, 0.3, 0.3, 0.5, 0.9, 0.0, 0.1); - m_2 = tmpvar_4; - vec3 tmpvar_5; - tmpvar_5 = (m_2 * gl_Normal); - n_1 = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6.w = 1.0; - tmpvar_6.xyz = ((n_1 * 0.5) + 0.5).xyz; - vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - gl_FrontColor = tmpvar_7; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-out.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-out.txt index 5a85534a1..57ef4edd2 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-out.txt @@ -8,4 +8,9 @@ void main () } -// inputs: 2, stats: 5 alu 0 tex 0 flow +// stats: 5 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_Normal (high float) 3x1 [-1] loc 2 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 1 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-inES3.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-inES3.txt new file mode 100644 index 000000000..363216dab --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-inES3.txt @@ -0,0 +1,83 @@ +#version 300 es + +uniform mat4 glstate_matrix_mvp; + +in highp vec4 attrVertex; +in mediump vec3 attrNormal; +in mediump vec4 attrTangent; + +mat3 xll_transpose(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]); +} + +mat3 xll_constructMat3(mat4 m) { + return mat3(vec3(m[0]), vec3(m[1]), vec3(m[2])); +} + +struct v2f_surf { + highp vec4 pos; + lowp vec3 lightDir; + lowp vec3 viewDir; + lowp vec3 worldN; +}; + +struct appdata { + highp vec4 vertex; + mediump vec4 tangent; + mediump vec3 normal; +}; + +uniform highp mat4 _Object2World; +uniform highp mat4 _World2Object; +uniform highp vec3 _WorldSpaceCameraPos; +uniform lowp vec4 _WorldSpaceLightPos0; + +uniform highp vec4 unity_Scale; + +highp vec3 ObjSpaceViewDir( in highp vec4 v ) { + highp vec3 objSpaceCameraPos = (_World2Object * vec4(_WorldSpaceCameraPos.xyz, 1.0)).xyz * unity_Scale.w; + return objSpaceCameraPos - v.xyz; +} + +highp vec3 ObjSpaceLightDir( in highp vec4 v ) { + highp vec3 objSpaceLightPos = (_World2Object * _WorldSpaceLightPos0).xyz; + return objSpaceLightPos.xyz; +} + +v2f_surf vert_surf (in appdata v) { + v2f_surf o; + o.pos = glstate_matrix_mvp * v.vertex; + + highp vec3 worldN = xll_constructMat3(_Object2World) * v.normal; + o.worldN = worldN; + + mediump vec3 binormal = cross(v.normal, v.tangent.xyz) * v.tangent.w; + mediump mat3 rotation = xll_transpose (mat3(v.tangent.xyz, binormal, v.normal)); + + mediump vec3 lightDir = rotation * ObjSpaceLightDir(v.vertex); + o.lightDir = lightDir; + + highp vec3 viewDirForLight = rotation * ObjSpaceViewDir(v.vertex); + o.viewDir = normalize( (lightDir + normalize( viewDirForLight )) ); + return o; +} + +out lowp vec3 varWorldN; +out lowp vec3 varLightDir; +out lowp vec3 varViewDir; + +void main() { + appdata v; + v.vertex = attrVertex; + v.tangent = attrTangent; + v.normal = attrNormal; + + v2f_surf rv = vert_surf(v); + + gl_Position = rv.pos; + varWorldN = rv.worldN; + varLightDir = rv.lightDir; + varViewDir = rv.viewDir; +} diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-irES.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-irES.txt deleted file mode 100644 index f1fa14d19..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-irES.txt +++ /dev/null @@ -1,207 +0,0 @@ -struct v2f_surf { - highp vec4 pos; - lowp vec3 lightDir; - lowp vec3 viewDir; - lowp vec3 worldN; -}; -struct appdata { - highp vec4 vertex; - highp vec4 tangent; - highp vec3 normal; -}; -attribute highp vec4 _glesVertex; -attribute mediump vec3 _glesNormal; -attribute highp vec4 _glesMultiTexCoord0; -attribute highp vec4 _glesMultiTexCoord1; -attribute lowp vec4 _glesColor; -uniform mat4 glstate_matrix_mvp; -attribute vec4 attrVertex; -attribute vec3 attrNormal; -attribute vec4 attrTangent; -uniform highp mat4 _Object2World; -uniform highp mat4 _World2Object; -uniform highp vec3 _WorldSpaceCameraPos; -uniform lowp vec4 _WorldSpaceLightPos0; -uniform highp vec4 unity_Scale; -varying lowp vec3 varWorldN; -varying lowp vec3 varLightDir; -varying lowp vec3 varViewDir; -mat3 xll_transpose ( - in mat3 m_1 -) -{ - mat3 tmpvar_2; - float tmpvar_3; - tmpvar_3 = m_1[0][0]; - tmpvar_2[0].x = tmpvar_3; - float tmpvar_4; - tmpvar_4 = m_1[1][0]; - tmpvar_2[0].y = tmpvar_4; - float tmpvar_5; - tmpvar_5 = m_1[2][0]; - tmpvar_2[0].z = tmpvar_5; - float tmpvar_6; - tmpvar_6 = m_1[0][1]; - tmpvar_2[1].x = tmpvar_6; - float tmpvar_7; - tmpvar_7 = m_1[1][1]; - tmpvar_2[1].y = tmpvar_7; - float tmpvar_8; - tmpvar_8 = m_1[2][1]; - tmpvar_2[1].z = tmpvar_8; - float tmpvar_9; - tmpvar_9 = m_1[0][2]; - tmpvar_2[2].x = tmpvar_9; - float tmpvar_10; - tmpvar_10 = m_1[1][2]; - tmpvar_2[2].y = tmpvar_10; - float tmpvar_11; - tmpvar_11 = m_1[2][2]; - tmpvar_2[2].z = tmpvar_11; - return tmpvar_2; -} - -mat3 xll_constructMat3 ( - in mat4 m_12 -) -{ - vec3 tmpvar_13; - tmpvar_13 = m_12[0].xyz; - vec3 tmpvar_14; - tmpvar_14 = m_12[1].xyz; - vec3 tmpvar_15; - tmpvar_15 = m_12[2].xyz; - mat3 tmpvar_16; - vec3 tmpvar_17; - tmpvar_17 = tmpvar_13; - tmpvar_16[0] = tmpvar_17; - vec3 tmpvar_18; - tmpvar_18 = tmpvar_14; - tmpvar_16[1] = tmpvar_18; - vec3 tmpvar_19; - tmpvar_19 = tmpvar_15; - tmpvar_16[2] = tmpvar_19; - return tmpvar_16; -} - -vec3 ObjSpaceViewDir ( - in highp vec4 v_20 -) -{ - highp vec3 objSpaceCameraPos_21; - highp vec4 tmpvar_22; - tmpvar_22.w = 1.0; - tmpvar_22.xyz = _WorldSpaceCameraPos.xyz.xyz; - highp vec3 tmpvar_23; - tmpvar_23 = ((_World2Object * tmpvar_22).xyz * unity_Scale.w); - objSpaceCameraPos_21 = tmpvar_23; - return (objSpaceCameraPos_21 - v_20.xyz); -} - -vec3 ObjSpaceLightDir ( - in highp vec4 v_24 -) -{ - highp vec3 objSpaceLightPos_25; - highp vec3 tmpvar_26; - tmpvar_26 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_25 = tmpvar_26; - return objSpaceLightPos_25.xyz; -} - -v2f_surf vert_surf ( - in appdata v_27 -) -{ - highp vec3 viewDirForLight_28; - highp vec3 lightDir_29; - highp mat3 rotation_30; - highp vec3 binormal_31; - highp vec3 worldN_32; - v2f_surf o_33; - highp vec4 tmpvar_34; - tmpvar_34 = (glstate_matrix_mvp * v_27.vertex); - o_33.pos = tmpvar_34; - mat3 tmpvar_35; - tmpvar_35 = xll_constructMat3 (_Object2World); - highp vec3 tmpvar_36; - tmpvar_36 = (tmpvar_35 * v_27.normal); - worldN_32 = tmpvar_36; - highp vec3 tmpvar_37; - tmpvar_37 = worldN_32; - o_33.worldN = tmpvar_37; - highp vec3 tmpvar_38; - tmpvar_38 = cross (v_27.normal, v_27.tangent.xyz); - highp vec3 tmpvar_39; - tmpvar_39 = (tmpvar_38 * v_27.tangent.w); - binormal_31 = tmpvar_39; - mat3 tmpvar_40; - vec3 tmpvar_41; - tmpvar_41 = v_27.tangent.xyz; - tmpvar_40[0] = tmpvar_41; - vec3 tmpvar_42; - tmpvar_42 = binormal_31; - tmpvar_40[1] = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = v_27.normal; - tmpvar_40[2] = tmpvar_43; - mat3 tmpvar_44; - tmpvar_44 = xll_transpose (tmpvar_40); - mat3 tmpvar_45; - tmpvar_45 = tmpvar_44; - rotation_30 = tmpvar_45; - highp vec3 tmpvar_46; - tmpvar_46 = ObjSpaceLightDir (v_27.vertex); - highp vec3 tmpvar_47; - tmpvar_47 = (rotation_30 * tmpvar_46); - lightDir_29 = tmpvar_47; - highp vec3 tmpvar_48; - tmpvar_48 = lightDir_29; - o_33.lightDir = tmpvar_48; - highp vec3 tmpvar_49; - tmpvar_49 = ObjSpaceViewDir (v_27.vertex); - highp vec3 tmpvar_50; - tmpvar_50 = (rotation_30 * tmpvar_49); - viewDirForLight_28 = tmpvar_50; - highp vec3 tmpvar_51; - tmpvar_51 = normalize (viewDirForLight_28); - highp vec3 tmpvar_52; - tmpvar_52 = normalize ((lightDir_29 + tmpvar_51)); - highp vec3 tmpvar_53; - tmpvar_53 = tmpvar_52; - o_33.viewDir = tmpvar_53; - return o_33; -} - -void main () -{ - v2f_surf rv_54; - appdata v_55; - vec4 tmpvar_56; - tmpvar_56 = attrVertex; - v_55.vertex = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = attrTangent; - v_55.tangent = tmpvar_57; - vec3 tmpvar_58; - tmpvar_58 = attrNormal; - v_55.normal = tmpvar_58; - v2f_surf tmpvar_59; - tmpvar_59 = vert_surf (v_55); - v2f_surf tmpvar_60; - tmpvar_60 = tmpvar_59; - rv_54 = tmpvar_60; - highp vec4 tmpvar_61; - tmpvar_61 = rv_54.pos; - gl_Position = tmpvar_61; - lowp vec3 tmpvar_62; - tmpvar_62 = rv_54.worldN; - varWorldN = tmpvar_62; - lowp vec3 tmpvar_63; - tmpvar_63 = rv_54.lightDir; - varLightDir = tmpvar_63; - lowp vec3 tmpvar_64; - tmpvar_64 = rv_54.viewDir; - varViewDir = tmpvar_64; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES.txt index 9255730b9..4c0021814 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES.txt @@ -15,7 +15,7 @@ void main () lowp vec3 tmpvar_1; lowp vec3 tmpvar_2; lowp vec3 tmpvar_3; - mat3 tmpvar_4; + highp mat3 tmpvar_4; tmpvar_4[0] = _Object2World[0].xyz; tmpvar_4[1] = _Object2World[1].xyz; tmpvar_4[2] = _Object2World[2].xyz; @@ -24,29 +24,31 @@ void main () tmpvar_3 = tmpvar_5; highp vec3 tmpvar_6; highp vec3 tmpvar_7; + highp vec3 tmpvar_8; tmpvar_6 = attrTangent.xyz; tmpvar_7 = (((attrNormal.yzx * attrTangent.zxy) - (attrNormal.zxy * attrTangent.yzx)) * attrTangent.w); - highp mat3 tmpvar_8; - tmpvar_8[0].x = tmpvar_6.x; - tmpvar_8[0].y = tmpvar_7.x; - tmpvar_8[0].z = attrNormal.x; - tmpvar_8[1].x = tmpvar_6.y; - tmpvar_8[1].y = tmpvar_7.y; - tmpvar_8[1].z = attrNormal.y; - tmpvar_8[2].x = tmpvar_6.z; - tmpvar_8[2].y = tmpvar_7.z; - tmpvar_8[2].z = attrNormal.z; - highp vec3 tmpvar_9; - tmpvar_9 = (tmpvar_8 * (_World2Object * _WorldSpaceLightPos0).xyz); - tmpvar_1 = tmpvar_9; - highp vec4 tmpvar_10; - tmpvar_10.w = 1.0; - tmpvar_10.xyz = _WorldSpaceCameraPos; - highp vec3 tmpvar_11; - tmpvar_11 = normalize((tmpvar_9 + normalize( - (tmpvar_8 * (((_World2Object * tmpvar_10).xyz * unity_Scale.w) - attrVertex.xyz)) + tmpvar_8 = attrNormal; + highp mat3 tmpvar_9; + tmpvar_9[0].x = tmpvar_6.x; + tmpvar_9[0].y = tmpvar_7.x; + tmpvar_9[0].z = tmpvar_8.x; + tmpvar_9[1].x = tmpvar_6.y; + tmpvar_9[1].y = tmpvar_7.y; + tmpvar_9[1].z = tmpvar_8.y; + tmpvar_9[2].x = tmpvar_6.z; + tmpvar_9[2].y = tmpvar_7.z; + tmpvar_9[2].z = tmpvar_8.z; + highp vec3 tmpvar_10; + tmpvar_10 = (tmpvar_9 * (_World2Object * _WorldSpaceLightPos0).xyz); + tmpvar_1 = tmpvar_10; + highp vec4 tmpvar_11; + tmpvar_11.w = 1.0; + tmpvar_11.xyz = _WorldSpaceCameraPos; + highp vec3 tmpvar_12; + tmpvar_12 = normalize((tmpvar_10 + normalize( + (tmpvar_9 * (((_World2Object * tmpvar_11).xyz * unity_Scale.w) - attrVertex.xyz)) ))); - tmpvar_2 = tmpvar_11; + tmpvar_2 = tmpvar_12; gl_Position = (glstate_matrix_mvp * attrVertex); varWorldN = tmpvar_3; varLightDir = tmpvar_1; @@ -54,4 +56,15 @@ void main () } -// inputs: 3, stats: 16 alu 0 tex 0 flow +// stats: 16 alu 0 tex 0 flow +// inputs: 3 +// #0: attrVertex (high float) 4x1 [-1] +// #1: attrNormal (high float) 3x1 [-1] +// #2: attrTangent (high float) 4x1 [-1] +// uniforms: 6 (total size: 0) +// #0: glstate_matrix_mvp (high float) 4x4 [-1] +// #1: _Object2World (high float) 4x4 [-1] +// #2: _World2Object (high float) 4x4 [-1] +// #3: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #4: _WorldSpaceLightPos0 (low float) 4x1 [-1] +// #5: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES3.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES3.txt new file mode 100644 index 000000000..e503189b7 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES3.txt @@ -0,0 +1,73 @@ +#version 300 es +uniform mat4 glstate_matrix_mvp; +in highp vec4 attrVertex; +in mediump vec3 attrNormal; +in mediump vec4 attrTangent; +uniform highp mat4 _Object2World; +uniform highp mat4 _World2Object; +uniform highp vec3 _WorldSpaceCameraPos; +uniform lowp vec4 _WorldSpaceLightPos0; +uniform highp vec4 unity_Scale; +out lowp vec3 varWorldN; +out lowp vec3 varLightDir; +out lowp vec3 varViewDir; +void main () +{ + mediump vec3 lightDir_1; + highp vec3 worldN_2; + lowp vec3 tmpvar_3; + lowp vec3 tmpvar_4; + lowp vec3 tmpvar_5; + highp mat3 tmpvar_6; + tmpvar_6[0u] = _Object2World[0].xyz; + tmpvar_6[1u] = _Object2World[1].xyz; + tmpvar_6[2u] = _Object2World[2].xyz; + mediump vec3 tmpvar_7; + tmpvar_7 = (tmpvar_6 * attrNormal); + worldN_2 = tmpvar_7; + tmpvar_5 = worldN_2; + mediump vec3 tmpvar_8; + mediump vec3 tmpvar_9; + 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[1u].x = tmpvar_8.y; + tmpvar_10[1u].y = tmpvar_9.y; + tmpvar_10[1u].z = attrNormal.y; + tmpvar_10[2u].x = tmpvar_8.z; + tmpvar_10[2u].y = tmpvar_9.z; + tmpvar_10[2u].z = attrNormal.z; + highp vec3 tmpvar_11; + tmpvar_11 = (tmpvar_10 * (_World2Object * _WorldSpaceLightPos0).xyz); + lightDir_1 = tmpvar_11; + tmpvar_3 = lightDir_1; + highp vec4 tmpvar_12; + tmpvar_12.w = 1.0; + tmpvar_12.xyz = _WorldSpaceCameraPos; + highp vec3 tmpvar_13; + tmpvar_13 = normalize((lightDir_1 + normalize( + (tmpvar_10 * (((_World2Object * tmpvar_12).xyz * unity_Scale.w) - attrVertex.xyz)) + ))); + tmpvar_4 = tmpvar_13; + gl_Position = (glstate_matrix_mvp * attrVertex); + varWorldN = tmpvar_5; + varLightDir = tmpvar_3; + varViewDir = tmpvar_4; +} + + +// stats: 16 alu 0 tex 0 flow +// inputs: 3 +// #0: attrVertex (high float) 4x1 [-1] +// #1: attrNormal (medium float) 3x1 [-1] +// #2: attrTangent (medium float) 4x1 [-1] +// uniforms: 6 (total size: 0) +// #0: glstate_matrix_mvp (high float) 4x4 [-1] +// #1: _Object2World (high float) 4x4 [-1] +// #2: _World2Object (high float) 4x4 [-1] +// #3: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #4: _WorldSpaceLightPos0 (low float) 4x1 [-1] +// #5: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES3Metal.txt new file mode 100644 index 000000000..98b2075bd --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES3Metal.txt @@ -0,0 +1,83 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float4 attrVertex [[attribute(0)]]; + half3 attrNormal [[attribute(1)]]; + half4 attrTangent [[attribute(2)]]; +}; +struct xlatMtlShaderOutput { + float4 gl_Position [[position]]; + half3 varWorldN; + half3 varLightDir; + half3 varViewDir; +}; +struct xlatMtlShaderUniform { + float4x4 glstate_matrix_mvp; + float4x4 _Object2World; + float4x4 _World2Object; + float3 _WorldSpaceCameraPos; + half4 _WorldSpaceLightPos0; + float4 unity_Scale; +}; +vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + half3 lightDir_1; + float3 worldN_2; + half3 tmpvar_3; + half3 tmpvar_4; + half3 tmpvar_5; + float3x3 tmpvar_6; + tmpvar_6[0] = _mtl_u._Object2World[0].xyz; + tmpvar_6[1] = _mtl_u._Object2World[1].xyz; + tmpvar_6[2] = _mtl_u._Object2World[2].xyz; + half3 tmpvar_7; + tmpvar_7 = ((half3)(tmpvar_6 * (float3)_mtl_i.attrNormal)); + worldN_2 = float3(tmpvar_7); + tmpvar_5 = half3(worldN_2); + half3 tmpvar_8; + half3 tmpvar_9; + tmpvar_8 = _mtl_i.attrTangent.xyz; + tmpvar_9 = (((_mtl_i.attrNormal.yzx * _mtl_i.attrTangent.zxy) - (_mtl_i.attrNormal.zxy * _mtl_i.attrTangent.yzx)) * _mtl_i.attrTangent.w); + half3x3 tmpvar_10; + tmpvar_10[0].x = tmpvar_8.x; + tmpvar_10[0].y = tmpvar_9.x; + tmpvar_10[0].z = _mtl_i.attrNormal.x; + tmpvar_10[1].x = tmpvar_8.y; + tmpvar_10[1].y = tmpvar_9.y; + tmpvar_10[1].z = _mtl_i.attrNormal.y; + tmpvar_10[2].x = tmpvar_8.z; + tmpvar_10[2].y = tmpvar_9.z; + tmpvar_10[2].z = _mtl_i.attrNormal.z; + float3 tmpvar_11; + tmpvar_11 = ((float3)(tmpvar_10 * (half3)(_mtl_u._World2Object * (float4)_mtl_u._WorldSpaceLightPos0).xyz)); + lightDir_1 = half3(tmpvar_11); + tmpvar_3 = lightDir_1; + float4 tmpvar_12; + tmpvar_12.w = 1.0; + tmpvar_12.xyz = _mtl_u._WorldSpaceCameraPos; + float3 tmpvar_13; + tmpvar_13 = normalize(((float3)lightDir_1 + normalize( + ((float3)(tmpvar_10 * (half3)(((_mtl_u._World2Object * tmpvar_12).xyz * _mtl_u.unity_Scale.w) - _mtl_i.attrVertex.xyz))) + ))); + tmpvar_4 = half3(tmpvar_13); + _mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * _mtl_i.attrVertex); + _mtl_o.varWorldN = tmpvar_5; + _mtl_o.varLightDir = tmpvar_3; + _mtl_o.varViewDir = tmpvar_4; + return _mtl_o; +} + + +// stats: 16 alu 0 tex 0 flow +// inputs: 3 +// #0: attrVertex (high float) 4x1 [-1] loc 0 +// #1: attrNormal (medium float) 3x1 [-1] loc 1 +// #2: attrTangent (medium float) 4x1 [-1] loc 2 +// uniforms: 6 (total size: 240) +// #0: glstate_matrix_mvp (high float) 4x4 [-1] loc 0 +// #1: _Object2World (high float) 4x4 [-1] loc 64 +// #2: _World2Object (high float) 4x4 [-1] loc 128 +// #3: _WorldSpaceCameraPos (high float) 3x1 [-1] loc 192 +// #4: _WorldSpaceLightPos0 (low float) 4x1 [-1] loc 208 +// #5: unity_Scale (high float) 4x1 [-1] loc 224 diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-ir.txt deleted file mode 100644 index b3496af6d..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-ir.txt +++ /dev/null @@ -1,40 +0,0 @@ -uniform mat4 mvp; -uniform mat3 m3a; -uniform mat3 m3b; -uniform mat3 m3c; -uniform vec4 v3a; -uniform vec4 v3b; -uniform vec4 v3c; -void main () -{ - vec3 rc_1; - vec3 rb_2; - vec3 tb_3; - vec3 ra_4; - vec3 ta_5; - vec4 tmpvar_6; - tmpvar_6 = (mvp * gl_Vertex); - gl_Position = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = -((v3a.xyz - gl_Vertex.xyz)); - ta_5 = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = (m3a * ta_5); - ra_4 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = -(((mvp * v3b).xyz - gl_Vertex.xyz)); - tb_3 = tmpvar_9; - vec3 tmpvar_10; - tmpvar_10 = (m3b * tb_3); - rb_2 = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = (m3c * -((v3c.xyz - gl_Vertex.xyz))); - rc_1 = tmpvar_11; - vec4 tmpvar_12; - tmpvar_12.w = 1.0; - tmpvar_12.xyz = ((ra_4 + rb_2) + rc_1).xyz; - vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - gl_FrontColor = tmpvar_13; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-out.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-out.txt index 99ef221bb..8217deafa 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-out.txt @@ -19,4 +19,14 @@ void main () } -// inputs: 1, stats: 11 alu 0 tex 0 flow +// stats: 11 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 7 (total size: 0) +// #0: mvp (high float) 4x4 [-1] +// #1: m3a (high float) 3x3 [-1] +// #2: m3b (high float) 3x3 [-1] +// #3: m3c (high float) 3x3 [-1] +// #4: v3a (high float) 4x1 [-1] +// #5: v3b (high float) 4x1 [-1] +// #6: v3c (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-ir.txt deleted file mode 100644 index 219745786..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-ir.txt +++ /dev/null @@ -1,15 +0,0 @@ -varying vec3 var_a; -void main () -{ - vec4 tmpvar_1; - tmpvar_1 = normalize (vec4(1.0, 2.0, 3.0, 4.0)); - vec4 tmpvar_2; - tmpvar_2 = (gl_Vertex * tmpvar_1); - gl_Position = tmpvar_2; - vec3 tmpvar_3; - tmpvar_3 = normalize (vec3(0.0, 0.0, 0.0)); - vec3 tmpvar_4; - tmpvar_4 = (gl_Vertex.xyz * tmpvar_3); - var_a = tmpvar_4; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-out.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-out.txt index 7e3642aee..924b1a0f6 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-out.txt @@ -6,4 +6,6 @@ void main () } -// inputs: 1, stats: 3 alu 0 tex 0 flow +// stats: 3 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_Vertex (high float) 4x1 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-ir.txt deleted file mode 100644 index a89eee3ae..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-ir.txt +++ /dev/null @@ -1,98 +0,0 @@ -struct appdata_full { - vec4 vertex; - vec3 normal; -}; -struct v2f { - vec4 pos; - vec3 backContrib; - vec3 nl; -}; -uniform vec3 _TerrainTreeLightDirections[4]; -uniform float _TranslucencyViewDependency; -v2f vert ( - in appdata_full v_1 -) -{ - int j_2; - vec3 viewDir_3; - v2f o_4; - vec4 tmpvar_5; - tmpvar_5 = v_1.vertex; - o_4.pos = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = v_1.vertex.xyz; - viewDir_3 = tmpvar_6; - int tmpvar_7; - tmpvar_7 = 0; - j_2 = tmpvar_7; - while (true) { - float backContrib_8; - float nl_9; - vec3 lightDir_10; - if (!((j_2 < 3))) { - break; - }; - vec3 tmpvar_11; - tmpvar_11 = _TerrainTreeLightDirections[j_2]; - lightDir_10 = tmpvar_11; - float tmpvar_12; - tmpvar_12 = dot (v_1.normal, lightDir_10); - float tmpvar_13; - tmpvar_13 = tmpvar_12; - nl_9 = tmpvar_13; - float tmpvar_14; - tmpvar_14 = dot (viewDir_3, -(lightDir_10)); - float tmpvar_15; - tmpvar_15 = tmpvar_14; - backContrib_8 = tmpvar_15; - float tmpvar_16; - tmpvar_16 = mix (-(nl_9), backContrib_8, _TranslucencyViewDependency); - vec3 tmpvar_17; - tmpvar_17 = o_4.backContrib; tmpvar_17[j_2] = tmpvar_16; - o_4.backContrib = tmpvar_17; - float tmpvar_18; - tmpvar_18 = max (0.0, ((nl_9 * 0.6) + 0.4)); - vec3 tmpvar_19; - tmpvar_19 = o_4.nl; tmpvar_19[j_2] = tmpvar_18; - o_4.nl = tmpvar_19; - int _post_incdec_tmp_20; - _post_incdec_tmp_20 = j_2; - int tmpvar_21; - tmpvar_21 = (j_2 + 1); - j_2 = tmpvar_21; - }; - return o_4; -} - -void main () -{ - appdata_full xlt_v_22; - v2f xl_retval_23; - vec4 tmpvar_24; - tmpvar_24 = gl_Vertex; - xlt_v_22.vertex = tmpvar_24; - vec3 tmpvar_25; - tmpvar_25 = gl_Normal; - xlt_v_22.normal = tmpvar_25; - v2f tmpvar_26; - tmpvar_26 = vert (xlt_v_22); - v2f tmpvar_27; - tmpvar_27 = tmpvar_26; - xl_retval_23 = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = xl_retval_23.pos; - gl_Position = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29.w = 0.0; - tmpvar_29.xyz = xl_retval_23.backContrib.xyz; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - gl_TexCoord[2] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31.w = 0.0; - tmpvar_31.xyz = xl_retval_23.nl.xyz; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_31; - gl_TexCoord[3] = tmpvar_32; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-out.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-out.txt index 9a7a91390..9112d3fde 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-out.txt @@ -8,30 +8,50 @@ void main () tmpvar_3 = _TerrainTreeLightDirections[0]; float tmpvar_4; tmpvar_4 = dot (gl_Normal, tmpvar_3); - tmpvar_1.x = mix (-(tmpvar_4), dot (gl_Vertex.xyz, -(tmpvar_3)), _TranslucencyViewDependency); - tmpvar_2.x = max (0.0, ((tmpvar_4 * 0.6) + 0.4)); vec3 tmpvar_5; - tmpvar_5 = _TerrainTreeLightDirections[1]; - float tmpvar_6; - tmpvar_6 = dot (gl_Normal, tmpvar_5); - tmpvar_1.y = mix (-(tmpvar_6), dot (gl_Vertex.xyz, -(tmpvar_5)), _TranslucencyViewDependency); - tmpvar_2.y = max (0.0, ((tmpvar_6 * 0.6) + 0.4)); + tmpvar_5.yz = tmpvar_1.yz; + tmpvar_5.x = mix (-(tmpvar_4), dot (gl_Vertex.xyz, -(tmpvar_3)), _TranslucencyViewDependency); + vec3 tmpvar_6; + tmpvar_6.yz = tmpvar_2.yz; + tmpvar_6.x = max (0.0, ((tmpvar_4 * 0.6) + 0.4)); vec3 tmpvar_7; - tmpvar_7 = _TerrainTreeLightDirections[2]; + tmpvar_7 = _TerrainTreeLightDirections[1]; float tmpvar_8; tmpvar_8 = dot (gl_Normal, tmpvar_7); - tmpvar_1.z = mix (-(tmpvar_8), dot (gl_Vertex.xyz, -(tmpvar_7)), _TranslucencyViewDependency); - tmpvar_2.z = max (0.0, ((tmpvar_8 * 0.6) + 0.4)); + vec3 tmpvar_9; + tmpvar_9.xz = tmpvar_5.xz; + tmpvar_9.y = mix (-(tmpvar_8), dot (gl_Vertex.xyz, -(tmpvar_7)), _TranslucencyViewDependency); + vec3 tmpvar_10; + tmpvar_10.xz = tmpvar_6.xz; + tmpvar_10.y = max (0.0, ((tmpvar_8 * 0.6) + 0.4)); + vec3 tmpvar_11; + tmpvar_11 = _TerrainTreeLightDirections[2]; + float tmpvar_12; + tmpvar_12 = dot (gl_Normal, tmpvar_11); + vec3 tmpvar_13; + tmpvar_13.xy = tmpvar_9.xy; + tmpvar_13.z = mix (-(tmpvar_12), dot (gl_Vertex.xyz, -(tmpvar_11)), _TranslucencyViewDependency); + tmpvar_1 = tmpvar_13; + vec3 tmpvar_14; + tmpvar_14.xy = tmpvar_10.xy; + tmpvar_14.z = max (0.0, ((tmpvar_12 * 0.6) + 0.4)); + tmpvar_2 = tmpvar_14; gl_Position = gl_Vertex; - vec4 tmpvar_9; - tmpvar_9.w = 0.0; - tmpvar_9.xyz = tmpvar_1; - gl_TexCoord[2] = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10.w = 0.0; - tmpvar_10.xyz = tmpvar_2; - gl_TexCoord[3] = tmpvar_10; + vec4 tmpvar_15; + tmpvar_15.w = 0.0; + tmpvar_15.xyz = tmpvar_13; + gl_TexCoord[2] = tmpvar_15; + vec4 tmpvar_16; + tmpvar_16.w = 0.0; + tmpvar_16.xyz = tmpvar_14; + gl_TexCoord[3] = tmpvar_16; } -// inputs: 2, stats: 32 alu 0 tex 0 flow +// stats: 26 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_Normal (high float) 3x1 [-1] loc 2 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 2 (total size: 0) +// #0: _TerrainTreeLightDirections (high float) 3x1 [4] +// #1: _TranslucencyViewDependency (high float) 1x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-ir.txt deleted file mode 100644 index 6790386aa..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-ir.txt +++ /dev/null @@ -1,15 +0,0 @@ -uniform mat4 mvp; -uniform mat4 unusedMatrix; -uniform float unusedFloat; -attribute vec4 myColor; -attribute vec3 myUnused; -void main () -{ - vec4 tmpvar_1; - tmpvar_1 = (mvp * gl_Vertex); - gl_Position = tmpvar_1; - vec4 tmpvar_2; - tmpvar_2 = myColor; - gl_FrontColor = tmpvar_2; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-out.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-out.txt index 3a8d8b449..c03f98555 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-out.txt @@ -7,4 +7,9 @@ void main () } -// inputs: 2, stats: 1 alu 0 tex 0 flow +// stats: 1 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_Vertex (high float) 4x1 [-1] loc 0 +// #1: myColor (high float) 4x1 [-1] +// uniforms: 1 (total size: 0) +// #0: mvp (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-inES3.txt b/3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-inES3.txt new file mode 100644 index 000000000..081edec0f --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-inES3.txt @@ -0,0 +1,40 @@ +#version 300 es + +#define gl_Vertex _glesVertex +in vec4 _glesVertex; +#define gl_MultiTexCoord0 _glesMultiTexCoord0 +in vec4 _glesMultiTexCoord0; +float xll_saturate_f( float x) { + return clamp( x, 0.0, 1.0); +} +struct VertexOutputShadowCaster { + highp vec4 pos; + mediump vec2 tex; +}; +struct VertexInput { + highp vec4 vertex; + mediump vec4 uv0; +}; +uniform highp vec4 unity_LightShadowBias; +uniform highp mat4 glstate_matrix_mvp; +VertexOutputShadowCaster vertShadowCaster( in VertexInput v ) { + VertexOutputShadowCaster o; + o.pos = (glstate_matrix_mvp * v.vertex); + o.pos.z += xll_saturate_f((unity_LightShadowBias.x / o.pos.w)); + highp float clamped = max( o.pos.z, (o.pos.w * -1.0)); + o.pos.z = mix( o.pos.z, clamped, unity_LightShadowBias.y); + o.tex.xy = v.uv0.xy; + return o; +} +out mediump vec2 xlv_TEXCOORD1; +void main() { + VertexOutputShadowCaster xl_retval; + VertexInput xlt_v; + xlt_v.vertex = vec4(gl_Vertex); + xlt_v.uv0 = vec4(gl_MultiTexCoord0); + xl_retval = vertShadowCaster( xlt_v); + gl_Position = vec4(xl_retval.pos); + + // Was producing missing precision cast on Metal, _bl_o.xlv_TEXCOORD1 = _bl_i._glesMultiTexCoord0.xy + xlv_TEXCOORD1 = vec2(xl_retval.tex); +} diff --git a/3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-outES3.txt b/3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-outES3.txt new file mode 100644 index 000000000..5c7bf78fc --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-outES3.txt @@ -0,0 +1,24 @@ +#version 300 es +in vec4 _glesVertex; +in vec4 _glesMultiTexCoord0; +uniform highp vec4 unity_LightShadowBias; +uniform highp mat4 glstate_matrix_mvp; +out mediump vec2 xlv_TEXCOORD1; +void main () +{ + highp vec4 tmpvar_1; + tmpvar_1 = (glstate_matrix_mvp * _glesVertex); + tmpvar_1.z = (tmpvar_1.z + clamp ((unity_LightShadowBias.x / tmpvar_1.w), 0.0, 1.0)); + tmpvar_1.z = mix (tmpvar_1.z, max (tmpvar_1.z, -(tmpvar_1.w)), unity_LightShadowBias.y); + gl_Position = tmpvar_1; + xlv_TEXCOORD1 = _glesMultiTexCoord0.xy; +} + + +// stats: 7 alu 0 tex 0 flow +// inputs: 2 +// #0: _glesVertex (high float) 4x1 [-1] +// #1: _glesMultiTexCoord0 (high float) 4x1 [-1] +// uniforms: 2 (total size: 0) +// #0: unity_LightShadowBias (high float) 4x1 [-1] +// #1: glstate_matrix_mvp (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-outES3Metal.txt new file mode 100644 index 000000000..b657adeb7 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-outES3Metal.txt @@ -0,0 +1,36 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float4 _glesVertex [[attribute(0)]]; + float4 _glesMultiTexCoord0 [[attribute(1)]]; +}; +struct xlatMtlShaderOutput { + float4 gl_Position [[position]]; + half2 xlv_TEXCOORD1; +}; +struct xlatMtlShaderUniform { + float4 unity_LightShadowBias; + float4x4 glstate_matrix_mvp; +}; +vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + half4 tmpvar_1; + tmpvar_1 = half4(_mtl_i._glesMultiTexCoord0); + float4 tmpvar_2; + tmpvar_2 = (_mtl_u.glstate_matrix_mvp * _mtl_i._glesVertex); + tmpvar_2.z = (tmpvar_2.z + clamp ((_mtl_u.unity_LightShadowBias.x / tmpvar_2.w), 0.0, 1.0)); + tmpvar_2.z = mix (tmpvar_2.z, max (tmpvar_2.z, -(tmpvar_2.w)), _mtl_u.unity_LightShadowBias.y); + _mtl_o.gl_Position = tmpvar_2; + _mtl_o.xlv_TEXCOORD1 = tmpvar_1.xy; + return _mtl_o; +} + + +// stats: 7 alu 0 tex 0 flow +// inputs: 2 +// #0: _glesVertex (high float) 4x1 [-1] loc 0 +// #1: _glesMultiTexCoord0 (high float) 4x1 [-1] loc 1 +// uniforms: 2 (total size: 80) +// #0: unity_LightShadowBias (high float) 4x1 [-1] loc 0 +// #1: glstate_matrix_mvp (high float) 4x4 [-1] loc 16 diff --git a/3rdparty/glsl-optimizer/tests/vertex/swizzlemask-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/swizzlemask-ir.txt deleted file mode 100644 index 356c602ad..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/swizzlemask-ir.txt +++ /dev/null @@ -1,20 +0,0 @@ -varying vec4 texcoord; -void main () -{ - vec2 tmpvar_1; - tmpvar_1 = (gl_Vertex.xy * 2.0); - gl_Position.zw = tmpvar_1.xxxy.zw; - vec2 tmpvar_2; - tmpvar_2 = gl_Vertex.xy; - gl_Position.xy = tmpvar_2.xy.xy; - float tmpvar_3; - tmpvar_3 = gl_Vertex.z; - texcoord.x = tmpvar_3; - vec2 tmpvar_4; - tmpvar_4 = gl_Vertex.zw; - texcoord.yz = tmpvar_4.xxy.yz; - float tmpvar_5; - tmpvar_5 = gl_Vertex.x; - texcoord.w = vec4(tmpvar_5).w; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/swizzlemask-out.txt b/3rdparty/glsl-optimizer/tests/vertex/swizzlemask-out.txt index 1d7689a47..9db80eb98 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/swizzlemask-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/swizzlemask-out.txt @@ -9,4 +9,6 @@ void main () } -// inputs: 1, stats: 1 alu 0 tex 0 flow +// stats: 1 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_Vertex (high float) 4x1 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/vertex/types-inES3.txt b/3rdparty/glsl-optimizer/tests/vertex/types-inES3.txt new file mode 100644 index 000000000..92db801d0 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/types-inES3.txt @@ -0,0 +1,47 @@ +#version 300 es + +struct v2f { + highp vec4 pos; + mediump vec2 uv; + lowp vec4 color; +}; +struct a2v { + highp vec4 pos; + highp vec2 uv; + mediump vec3 normal; + lowp vec4 color; +}; +uniform highp mat4 mvp; +v2f xlat_main( in a2v v ); +v2f xlat_main( in a2v v ) { + v2f o; + highp float dx; + mediump float dy; + lowp float dz; + o.pos = ( mvp * v.pos ); + o.color = v.color; + o.color.xyz += v.normal; + o.uv = v.uv; + dx = v.pos.x ; + dy = v.pos.y ; + dz = v.pos.z ; + return o; +} +in highp vec4 _inVertex; +in mediump vec3 _inNormal; +in highp vec2 _uv0; +in lowp vec4 _color; +out mediump vec2 xlv_TEXCOORD0; +out lowp vec4 xlv_COLOR; +void main() { + v2f xl_retval; + a2v xlt_v; + xlt_v.pos = _inVertex; + xlt_v.uv = _uv0; + xlt_v.normal = _inNormal; + xlt_v.color = _color; + xl_retval = xlat_main( xlt_v); + gl_Position = vec4( xl_retval.pos); + xlv_TEXCOORD0 = vec2( xl_retval.uv); + xlv_COLOR = vec4( xl_retval.color); +} diff --git a/3rdparty/glsl-optimizer/tests/vertex/types-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/types-ir.txt deleted file mode 100644 index f82c1f3f4..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/types-ir.txt +++ /dev/null @@ -1,92 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; - vec4 color; -}; -struct a2v { - vec4 pos; - vec2 uv; - vec3 normal; - vec4 color; -}; -uniform mat4 mvp; -varying vec2 xlv_TEXCOORD0; -varying vec4 xlv_COLOR; -v2f xlat_main ( - in a2v v_1 -) -{ - float dz_2; - float dy_3; - float dx_4; - v2f o_5; - vec4 tmpvar_6; - tmpvar_6 = (mvp * v_1.pos); - o_5.pos = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7 = v_1.color; - o_5.color = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = (o_5.color.xyz + v_1.normal); - o_5.color.xyz = tmpvar_8.xyz.xyz; - vec2 tmpvar_9; - tmpvar_9 = v_1.uv; - o_5.uv = tmpvar_9; - float tmpvar_10; - tmpvar_10 = v_1.pos.x; - dx_4 = tmpvar_10; - float tmpvar_11; - tmpvar_11 = v_1.pos.y; - dy_3 = tmpvar_11; - float tmpvar_12; - tmpvar_12 = v_1.pos.z; - dz_2 = tmpvar_12; - return o_5; -} - -void main () -{ - a2v xlt_v_13; - v2f xl_retval_14; - vec4 tmpvar_15; - tmpvar_15 = gl_Vertex.xyzw; - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - xlt_v_13.pos = tmpvar_16; - vec2 tmpvar_17; - tmpvar_17 = gl_MultiTexCoord0.xy; - vec2 tmpvar_18; - tmpvar_18 = tmpvar_17; - xlt_v_13.uv = tmpvar_18; - vec3 tmpvar_19; - tmpvar_19 = gl_Normal.xyz; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_19; - xlt_v_13.normal = tmpvar_20; - vec4 tmpvar_21; - tmpvar_21 = gl_Color.xyzw; - vec4 tmpvar_22; - tmpvar_22 = tmpvar_21; - xlt_v_13.color = tmpvar_22; - v2f tmpvar_23; - tmpvar_23 = xlat_main (xlt_v_13); - v2f tmpvar_24; - tmpvar_24 = tmpvar_23; - xl_retval_14 = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25 = xl_retval_14.pos.xyzw; - vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; - gl_Position = tmpvar_26; - vec2 tmpvar_27; - tmpvar_27 = xl_retval_14.uv.xy; - vec2 tmpvar_28; - tmpvar_28 = tmpvar_27; - xlv_TEXCOORD0 = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = xl_retval_14.color.xyzw; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - xlv_COLOR = tmpvar_30; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/types-irES.txt b/3rdparty/glsl-optimizer/tests/vertex/types-irES.txt deleted file mode 100644 index 54bc70a03..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/types-irES.txt +++ /dev/null @@ -1,97 +0,0 @@ -struct v2f { - highp vec4 pos; - mediump vec2 uv; - lowp vec4 color; -}; -struct a2v { - highp vec4 pos; - highp vec2 uv; - mediump vec3 normal; - lowp vec4 color; -}; -attribute highp vec4 _glesVertex; -attribute mediump vec3 _glesNormal; -attribute highp vec4 _glesMultiTexCoord0; -attribute highp vec4 _glesMultiTexCoord1; -attribute lowp vec4 _glesColor; -uniform highp mat4 mvp; -varying mediump vec2 xlv_TEXCOORD0; -varying lowp vec4 xlv_COLOR; -v2f xlat_main ( - in a2v v_1 -) -{ - lowp float dz_2; - mediump float dy_3; - highp float dx_4; - v2f o_5; - highp vec4 tmpvar_6; - tmpvar_6 = (mvp * v_1.pos); - o_5.pos = tmpvar_6; - lowp vec4 tmpvar_7; - tmpvar_7 = v_1.color; - o_5.color = tmpvar_7; - mediump vec3 tmpvar_8; - tmpvar_8 = (o_5.color.xyz + v_1.normal); - o_5.color.xyz = tmpvar_8.xyz.xyz; - highp vec2 tmpvar_9; - tmpvar_9 = v_1.uv; - o_5.uv = tmpvar_9; - highp float tmpvar_10; - tmpvar_10 = v_1.pos.x; - dx_4 = tmpvar_10; - highp float tmpvar_11; - tmpvar_11 = v_1.pos.y; - dy_3 = tmpvar_11; - highp float tmpvar_12; - tmpvar_12 = v_1.pos.z; - dz_2 = tmpvar_12; - return o_5; -} - -void main () -{ - a2v xlt_v_13; - v2f xl_retval_14; - highp vec4 tmpvar_15; - tmpvar_15 = _glesVertex.xyzw; - highp vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - xlt_v_13.pos = tmpvar_16; - highp vec2 tmpvar_17; - tmpvar_17 = _glesMultiTexCoord0.xy; - highp vec2 tmpvar_18; - tmpvar_18 = tmpvar_17; - xlt_v_13.uv = tmpvar_18; - mediump vec3 tmpvar_19; - tmpvar_19 = _glesNormal.xyz; - mediump vec3 tmpvar_20; - tmpvar_20 = tmpvar_19; - xlt_v_13.normal = tmpvar_20; - lowp vec4 tmpvar_21; - tmpvar_21 = _glesColor.xyzw; - lowp vec4 tmpvar_22; - tmpvar_22 = tmpvar_21; - xlt_v_13.color = tmpvar_22; - v2f tmpvar_23; - tmpvar_23 = xlat_main (xlt_v_13); - v2f tmpvar_24; - tmpvar_24 = tmpvar_23; - xl_retval_14 = tmpvar_24; - highp vec4 tmpvar_25; - tmpvar_25 = xl_retval_14.pos.xyzw; - highp vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; - gl_Position = tmpvar_26; - mediump vec2 tmpvar_27; - tmpvar_27 = xl_retval_14.uv.xy; - mediump vec2 tmpvar_28; - tmpvar_28 = tmpvar_27; - xlv_TEXCOORD0 = tmpvar_28; - lowp vec4 tmpvar_29; - tmpvar_29 = xl_retval_14.color.xyzw; - lowp vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - xlv_COLOR = tmpvar_30; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/types-out.txt b/3rdparty/glsl-optimizer/tests/vertex/types-out.txt index 14a6ccbf9..780f0740b 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/types-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/types-out.txt @@ -12,4 +12,11 @@ void main () } -// inputs: 4, stats: 2 alu 0 tex 0 flow +// stats: 2 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Color (high float) 4x1 [-1] loc 3 +// #2: gl_Normal (high float) 3x1 [-1] loc 2 +// #3: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 1 (total size: 0) +// #0: mvp (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/types-outES.txt b/3rdparty/glsl-optimizer/tests/vertex/types-outES.txt index fffde4d82..8420a2b4d 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/types-outES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/types-outES.txt @@ -12,9 +12,7 @@ void main () mediump vec2 tmpvar_2; lowp vec4 tmpvar_3; tmpvar_3.w = _glesColor.w; - mediump vec3 tmpvar_4; - tmpvar_4 = (_glesColor.xyz + _glesNormal); - tmpvar_3.xyz = tmpvar_4; + tmpvar_3.xyz = (_glesColor.xyz + _glesNormal); tmpvar_2 = tmpvar_1; gl_Position = (mvp * _glesVertex); xlv_TEXCOORD0 = tmpvar_2; @@ -22,4 +20,11 @@ void main () } -// inputs: 4, stats: 2 alu 0 tex 0 flow +// stats: 2 alu 0 tex 0 flow +// inputs: 4 +// #0: _glesVertex (high float) 4x1 [-1] +// #1: _glesNormal (medium float) 3x1 [-1] +// #2: _glesMultiTexCoord0 (high float) 4x1 [-1] +// #3: _glesColor (low float) 4x1 [-1] +// uniforms: 1 (total size: 0) +// #0: mvp (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/types-outES3.txt b/3rdparty/glsl-optimizer/tests/vertex/types-outES3.txt new file mode 100644 index 000000000..17942a682 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/types-outES3.txt @@ -0,0 +1,29 @@ +#version 300 es +uniform highp mat4 mvp; +in highp vec4 _inVertex; +in mediump vec3 _inNormal; +in highp vec2 _uv0; +in lowp vec4 _color; +out mediump vec2 xlv_TEXCOORD0; +out lowp vec4 xlv_COLOR; +void main () +{ + mediump vec2 tmpvar_1; + lowp vec4 tmpvar_2; + tmpvar_2.w = _color.w; + tmpvar_2.xyz = (_color.xyz + _inNormal); + tmpvar_1 = _uv0; + gl_Position = (mvp * _inVertex); + xlv_TEXCOORD0 = tmpvar_1; + xlv_COLOR = tmpvar_2; +} + + +// stats: 2 alu 0 tex 0 flow +// inputs: 4 +// #0: _inVertex (high float) 4x1 [-1] +// #1: _inNormal (medium float) 3x1 [-1] +// #2: _uv0 (high float) 2x1 [-1] +// #3: _color (low float) 4x1 [-1] +// uniforms: 1 (total size: 0) +// #0: mvp (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/types-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/vertex/types-outES3Metal.txt new file mode 100644 index 000000000..40a4d863b --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/types-outES3Metal.txt @@ -0,0 +1,39 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float4 _inVertex [[attribute(0)]]; + half3 _inNormal [[attribute(1)]]; + float2 _uv0 [[attribute(2)]]; + half4 _color [[attribute(3)]]; +}; +struct xlatMtlShaderOutput { + float4 gl_Position [[position]]; + half2 xlv_TEXCOORD0; + half4 xlv_COLOR; +}; +struct xlatMtlShaderUniform { + float4x4 mvp; +}; +vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + half2 tmpvar_1; + half4 tmpvar_2; + tmpvar_2.w = _mtl_i._color.w; + tmpvar_2.xyz = (_mtl_i._color.xyz + _mtl_i._inNormal); + tmpvar_1 = half2(_mtl_i._uv0); + _mtl_o.gl_Position = (_mtl_u.mvp * _mtl_i._inVertex); + _mtl_o.xlv_TEXCOORD0 = tmpvar_1; + _mtl_o.xlv_COLOR = tmpvar_2; + return _mtl_o; +} + + +// stats: 2 alu 0 tex 0 flow +// inputs: 4 +// #0: _inVertex (high float) 4x1 [-1] loc 0 +// #1: _inNormal (medium float) 3x1 [-1] loc 1 +// #2: _uv0 (high float) 2x1 [-1] loc 2 +// #3: _color (low float) 4x1 [-1] loc 3 +// uniforms: 1 (total size: 64) +// #0: mvp (high float) 4x4 [-1] loc 0 diff --git a/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-inES3.txt b/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-inES3.txt new file mode 100644 index 000000000..8d518be88 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-inES3.txt @@ -0,0 +1,54 @@ +#version 300 es + +#define gl_Vertex _glesVertex +in highp vec4 _glesVertex; +#define gl_Normal _glesNormal +in mediump vec3 _glesNormal; +#define gl_MultiTexCoord0 _glesMultiTexCoord0 +in highp vec4 _glesMultiTexCoord0; + +struct v2f { + highp vec4 pos; + lowp vec4 color; + highp vec2 uv; +}; +uniform mediump vec4 unity_LightColor[8]; +uniform highp vec4 unity_LightPosition[8]; +uniform mediump vec4 unity_LightAtten[8]; +uniform highp mat4 glstate_matrix_mvp; +uniform highp mat4 glstate_matrix_modelview0; +uniform highp mat4 glstate_matrix_invtrans_modelview0; +uniform highp vec4 glstate_lightmodel_ambient; +uniform mediump vec4 _Color; + +highp vec3 ShadeLights( in highp vec3 vertex, in highp vec3 normal ) { + highp vec3 viewpos = (glstate_matrix_modelview0 * vec4( vertex, 1.0)).xyz; + highp vec3 viewN = (mat3( glstate_matrix_invtrans_modelview0) * normal); + highp vec3 lightColor = glstate_lightmodel_ambient.xyz; + highp int i = 0; + for ( ; (i < 4); (i++)) + { + highp vec3 toLight = (unity_LightPosition[i].xyz - (viewpos.xyz * unity_LightPosition[i].w)); + highp float lengthSq = dot( toLight, toLight); + highp float atten = (1.0 / (1.0 + (lengthSq * unity_LightAtten[i].z))); + highp float diff = max( 0.0, dot( viewN, normalize(toLight))); + lightColor += (unity_LightColor[i].xyz * (diff * atten)); + } + return (lightColor * vec3( _Color)); +} +v2f vert( in highp vec3 v, in highp vec3 n, in highp vec2 uv ) { + v2f o; + o.pos = (glstate_matrix_mvp * vec4(v, 1.0)); + o.color = vec4( (ShadeLights(v, n) * 2.0), 1.0); + o.uv = uv; + return o; +} +out lowp vec4 xlv_COLOR0; +out highp vec2 xlv_TEXCOORD0; +void main() { + v2f xl_retval; + xl_retval = vert( vec3(gl_Vertex), vec3(gl_Normal), vec2(gl_MultiTexCoord0)); + gl_Position = vec4(xl_retval.pos); + xlv_COLOR0 = vec4(xl_retval.color); + xlv_TEXCOORD0 = vec2(xl_retval.uv); +} diff --git a/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-outES3.txt b/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-outES3.txt new file mode 100644 index 000000000..6f463fcd7 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-outES3.txt @@ -0,0 +1,88 @@ +#version 300 es +in highp vec4 _glesVertex; +in mediump vec3 _glesNormal; +in highp vec4 _glesMultiTexCoord0; +uniform mediump vec4 unity_LightColor[8]; +uniform highp vec4 unity_LightPosition[8]; +uniform mediump vec4 unity_LightAtten[8]; +uniform highp mat4 glstate_matrix_mvp; +uniform highp mat4 glstate_matrix_modelview0; +uniform highp mat4 glstate_matrix_invtrans_modelview0; +uniform highp vec4 glstate_lightmodel_ambient; +uniform mediump vec4 _Color; +out lowp vec4 xlv_COLOR0; +out highp vec2 xlv_TEXCOORD0; +void main () +{ + highp vec3 tmpvar_1; + tmpvar_1 = _glesVertex.xyz; + highp vec3 n_2; + n_2 = _glesNormal; + lowp vec4 tmpvar_3; + highp vec4 tmpvar_4; + tmpvar_4.w = 1.0; + tmpvar_4.xyz = tmpvar_1; + highp vec3 lightColor_5; + highp vec3 viewN_6; + highp vec3 viewpos_7; + highp vec4 tmpvar_8; + tmpvar_8.w = 1.0; + 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[1u] = glstate_matrix_invtrans_modelview0[1u].xyz; + tmpvar_9[2u] = glstate_matrix_invtrans_modelview0[2u].xyz; + viewN_6 = (tmpvar_9 * n_2); + highp vec3 tmpvar_10; + tmpvar_10 = (unity_LightPosition[0].xyz - (viewpos_7 * unity_LightPosition[0].w)); + lightColor_5 = (glstate_lightmodel_ambient.xyz + (unity_LightColor[0].xyz * ( + max (0.0, dot (viewN_6, normalize(tmpvar_10))) + * + (1.0/((1.0 + (dot (tmpvar_10, tmpvar_10) * unity_LightAtten[0].z)))) + ))); + highp vec3 tmpvar_11; + tmpvar_11 = (unity_LightPosition[1].xyz - (viewpos_7 * unity_LightPosition[1].w)); + lightColor_5 = (lightColor_5 + (unity_LightColor[1].xyz * ( + max (0.0, dot (viewN_6, normalize(tmpvar_11))) + * + (1.0/((1.0 + (dot (tmpvar_11, tmpvar_11) * unity_LightAtten[1].z)))) + ))); + highp vec3 tmpvar_12; + tmpvar_12 = (unity_LightPosition[2].xyz - (viewpos_7 * unity_LightPosition[2].w)); + lightColor_5 = (lightColor_5 + (unity_LightColor[2].xyz * ( + max (0.0, dot (viewN_6, normalize(tmpvar_12))) + * + (1.0/((1.0 + (dot (tmpvar_12, tmpvar_12) * unity_LightAtten[2].z)))) + ))); + highp vec3 tmpvar_13; + tmpvar_13 = (unity_LightPosition[3].xyz - (viewpos_7 * unity_LightPosition[3].w)); + lightColor_5 = (lightColor_5 + (unity_LightColor[3].xyz * ( + max (0.0, dot (viewN_6, normalize(tmpvar_13))) + * + (1.0/((1.0 + (dot (tmpvar_13, tmpvar_13) * unity_LightAtten[3].z)))) + ))); + highp vec4 tmpvar_14; + tmpvar_14.w = 1.0; + tmpvar_14.xyz = ((lightColor_5 * _Color.xyz) * 2.0); + tmpvar_3 = tmpvar_14; + gl_Position = (glstate_matrix_mvp * tmpvar_4); + xlv_COLOR0 = tmpvar_3; + xlv_TEXCOORD0 = _glesMultiTexCoord0.xy; +} + + +// stats: 56 alu 0 tex 0 flow +// inputs: 3 +// #0: _glesVertex (high float) 4x1 [-1] +// #1: _glesNormal (medium float) 3x1 [-1] +// #2: _glesMultiTexCoord0 (high float) 4x1 [-1] +// uniforms: 8 (total size: 0) +// #0: unity_LightColor (medium float) 4x1 [8] +// #1: unity_LightPosition (high float) 4x1 [8] +// #2: unity_LightAtten (medium float) 4x1 [8] +// #3: glstate_matrix_mvp (high float) 4x4 [-1] +// #4: glstate_matrix_modelview0 (high float) 4x4 [-1] +// #5: glstate_matrix_invtrans_modelview0 (high float) 4x4 [-1] +// #6: glstate_lightmodel_ambient (high float) 4x1 [-1] +// #7: _Color (medium float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-outES3Metal.txt new file mode 100644 index 000000000..979ea5616 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-outES3Metal.txt @@ -0,0 +1,98 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float4 _glesVertex [[attribute(0)]]; + half3 _glesNormal [[attribute(1)]]; + float4 _glesMultiTexCoord0 [[attribute(2)]]; +}; +struct xlatMtlShaderOutput { + float4 gl_Position [[position]]; + half4 xlv_COLOR0; + float2 xlv_TEXCOORD0; +}; +struct xlatMtlShaderUniform { + half4 unity_LightColor[8]; + float4 unity_LightPosition[8]; + half4 unity_LightAtten[8]; + float4x4 glstate_matrix_mvp; + float4x4 glstate_matrix_modelview0; + float4x4 glstate_matrix_invtrans_modelview0; + float4 glstate_lightmodel_ambient; + half4 _Color; +}; +vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + float3 tmpvar_1; + tmpvar_1 = _mtl_i._glesVertex.xyz; + float3 n_2; + n_2 = float3(_mtl_i._glesNormal); + half4 tmpvar_3; + float4 tmpvar_4; + tmpvar_4.w = 1.0; + tmpvar_4.xyz = tmpvar_1; + float3 lightColor_5; + float3 viewN_6; + float3 viewpos_7; + float4 tmpvar_8; + tmpvar_8.w = 1.0; + tmpvar_8.xyz = tmpvar_1; + viewpos_7 = (_mtl_u.glstate_matrix_modelview0 * tmpvar_8).xyz; + float3x3 tmpvar_9; + tmpvar_9[0] = _mtl_u.glstate_matrix_invtrans_modelview0[0].xyz; + tmpvar_9[1] = _mtl_u.glstate_matrix_invtrans_modelview0[1].xyz; + tmpvar_9[2] = _mtl_u.glstate_matrix_invtrans_modelview0[2].xyz; + viewN_6 = (tmpvar_9 * n_2); + float3 tmpvar_10; + tmpvar_10 = (_mtl_u.unity_LightPosition[0].xyz - (viewpos_7 * _mtl_u.unity_LightPosition[0].w)); + lightColor_5 = (_mtl_u.glstate_lightmodel_ambient.xyz + ((float3)_mtl_u.unity_LightColor[0].xyz * ( + max (0.0, dot (viewN_6, normalize(tmpvar_10))) + * + (1.0/((1.0 + (dot (tmpvar_10, tmpvar_10) * (float)_mtl_u.unity_LightAtten[0].z)))) + ))); + float3 tmpvar_11; + tmpvar_11 = (_mtl_u.unity_LightPosition[1].xyz - (viewpos_7 * _mtl_u.unity_LightPosition[1].w)); + lightColor_5 = (lightColor_5 + ((float3)_mtl_u.unity_LightColor[1].xyz * ( + max (0.0, dot (viewN_6, normalize(tmpvar_11))) + * + (1.0/((1.0 + (dot (tmpvar_11, tmpvar_11) * (float)_mtl_u.unity_LightAtten[1].z)))) + ))); + float3 tmpvar_12; + tmpvar_12 = (_mtl_u.unity_LightPosition[2].xyz - (viewpos_7 * _mtl_u.unity_LightPosition[2].w)); + lightColor_5 = (lightColor_5 + ((float3)_mtl_u.unity_LightColor[2].xyz * ( + max (0.0, dot (viewN_6, normalize(tmpvar_12))) + * + (1.0/((1.0 + (dot (tmpvar_12, tmpvar_12) * (float)_mtl_u.unity_LightAtten[2].z)))) + ))); + float3 tmpvar_13; + tmpvar_13 = (_mtl_u.unity_LightPosition[3].xyz - (viewpos_7 * _mtl_u.unity_LightPosition[3].w)); + lightColor_5 = (lightColor_5 + ((float3)_mtl_u.unity_LightColor[3].xyz * ( + max (0.0, dot (viewN_6, normalize(tmpvar_13))) + * + (1.0/((1.0 + (dot (tmpvar_13, tmpvar_13) * (float)_mtl_u.unity_LightAtten[3].z)))) + ))); + float4 tmpvar_14; + tmpvar_14.w = 1.0; + tmpvar_14.xyz = ((lightColor_5 * (float3)_mtl_u._Color.xyz) * 2.0); + tmpvar_3 = half4(tmpvar_14); + _mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * tmpvar_4); + _mtl_o.xlv_COLOR0 = tmpvar_3; + _mtl_o.xlv_TEXCOORD0 = _mtl_i._glesMultiTexCoord0.xy; + return _mtl_o; +} + + +// stats: 56 alu 0 tex 0 flow +// inputs: 3 +// #0: _glesVertex (high float) 4x1 [-1] loc 0 +// #1: _glesNormal (medium float) 3x1 [-1] loc 1 +// #2: _glesMultiTexCoord0 (high float) 4x1 [-1] loc 2 +// uniforms: 8 (total size: 472) +// #0: unity_LightColor (medium float) 4x1 [8] loc 0 +// #1: unity_LightPosition (high float) 4x1 [8] loc 64 +// #2: unity_LightAtten (medium float) 4x1 [8] loc 192 +// #3: glstate_matrix_mvp (high float) 4x4 [-1] loc 256 +// #4: glstate_matrix_modelview0 (high float) 4x4 [-1] loc 320 +// #5: glstate_matrix_invtrans_modelview0 (high float) 4x4 [-1] loc 384 +// #6: glstate_lightmodel_ambient (high float) 4x1 [-1] loc 448 +// #7: _Color (medium float) 4x1 [-1] loc 464 diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLight-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLight-ir.txt deleted file mode 100644 index 318bcdc9d..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLight-ir.txt +++ /dev/null @@ -1,587 +0,0 @@ -struct Lamp { - vec4 posRange; - vec4 colorImp; - vec4 spotParam; -}; -struct v2f { - vec4 pos; - vec3 hybridDir; - vec3 hybridCol; - vec3 ambient; - vec2 uv; -}; -struct HybridAppData { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 bakedCol; - vec2 bakedDir; -}; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _Object2World; -uniform mat4 _World2Object; -uniform vec3 _Tonemap_blackLevel; -uniform vec3 _Tonemap_toeLength; -uniform vec3 _Tonemap_heel; -uniform vec3 _Tonemap_shoulder; -uniform vec3 _Tonemap_colorScale1; -uniform vec3 _Tonemap_colorScale2; -uniform vec3 _HybridSunDir; -uniform vec4 _HybridSunCol; -uniform vec3 GridLightTextureStartCell; -uniform vec3 GridLightTextureCellSize; -uniform sampler2D GridLightTexture; -uniform vec4 IngameGridLimit; -uniform vec4 LightPos[30]; -uniform vec4 LightCol[30]; -uniform vec4 _MainTex_ST; -attribute vec4 TANGENT; -varying vec3 xlv_TEXCOORD0; -varying vec3 xlv_TEXCOORD1; -varying vec3 xlv_COLOR; -varying vec2 xlv_TEXCOORD2; -vec4 xll_tex2Dlod ( - in sampler2D s_1, - in vec4 coord_2 -) -{ - vec4 tmpvar_3; - tmpvar_3 = texture2DLod (s_1, coord_2.xy, coord_2.w); - return tmpvar_3; -} - -mat3 xll_transpose_mf3x3 ( - in mat3 m_4 -) -{ - mat3 tmpvar_5; - float tmpvar_6; - tmpvar_6 = m_4[0][0]; - tmpvar_5[0].x = tmpvar_6; - float tmpvar_7; - tmpvar_7 = m_4[1][0]; - tmpvar_5[0].y = tmpvar_7; - float tmpvar_8; - tmpvar_8 = m_4[2][0]; - tmpvar_5[0].z = tmpvar_8; - float tmpvar_9; - tmpvar_9 = m_4[0][1]; - tmpvar_5[1].x = tmpvar_9; - float tmpvar_10; - tmpvar_10 = m_4[1][1]; - tmpvar_5[1].y = tmpvar_10; - float tmpvar_11; - tmpvar_11 = m_4[2][1]; - tmpvar_5[1].z = tmpvar_11; - float tmpvar_12; - tmpvar_12 = m_4[0][2]; - tmpvar_5[2].x = tmpvar_12; - float tmpvar_13; - tmpvar_13 = m_4[1][2]; - tmpvar_5[2].y = tmpvar_13; - float tmpvar_14; - tmpvar_14 = m_4[2][2]; - tmpvar_5[2].z = tmpvar_14; - return tmpvar_5; -} - -mat3 xll_constructMat3_mf4x4 ( - in mat4 m_15 -) -{ - vec3 tmpvar_16; - tmpvar_16 = m_15[0].xyz; - vec3 tmpvar_17; - tmpvar_17 = m_15[1].xyz; - vec3 tmpvar_18; - tmpvar_18 = m_15[2].xyz; - mat3 tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = tmpvar_16; - tmpvar_19[0] = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_17; - tmpvar_19[1] = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_18; - tmpvar_19[2] = tmpvar_22; - return tmpvar_19; -} - -float Luma ( - in vec3 c_23 -) -{ - float tmpvar_24; - tmpvar_24 = dot (c_23, vec3(0.22, 0.707, 0.071)); - return tmpvar_24; -} - -void CalcDynamicLight ( - in vec3 worldVert_25, - in vec3 worldNorm_26, - in Lamp lamp_27[4], - inout vec3 hybridDir_28, - inout vec3 hybridCol_29 -) -{ - int j_30; - float w_31; - int i_32; - vec4 atten_33; - float wAgg_34; - vec3 lAgg_35; - vec3 tmpvar_36; - tmpvar_36 = vec3(0.0, 0.0, 0.0); - lAgg_35 = tmpvar_36; - float tmpvar_37; - tmpvar_37 = 0.001; - wAgg_34 = tmpvar_37; - int tmpvar_38; - tmpvar_38 = 0; - i_32 = tmpvar_38; - while (true) { - float weight_39; - float nDotL_40; - vec3 lightToVertNorm_41; - float lengthSq_42; - vec3 lightToVert_43; - if (!((i_32 < 4))) { - break; - }; - vec3 tmpvar_44; - tmpvar_44 = (lamp_27[i_32].posRange.xyz - worldVert_25); - lightToVert_43 = tmpvar_44; - float tmpvar_45; - tmpvar_45 = dot (lightToVert_43, lightToVert_43); - float tmpvar_46; - tmpvar_46 = tmpvar_45; - lengthSq_42 = tmpvar_46; - float tmpvar_47; - tmpvar_47 = inversesqrt (lengthSq_42); - vec3 tmpvar_48; - tmpvar_48 = (lightToVert_43 * tmpvar_47); - lightToVertNorm_41 = tmpvar_48; - float tmpvar_49; - tmpvar_49 = max ((1.0 - ((lengthSq_42 * lamp_27[i_32].posRange.w) * 0.8)), 0.0); - vec4 tmpvar_50; - tmpvar_50 = atten_33; tmpvar_50[i_32] = tmpvar_49; - atten_33 = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = atten_33; tmpvar_51[i_32] = (atten_33[i_32] * atten_33[i_32]); - atten_33 = tmpvar_51; - float tmpvar_52; - tmpvar_52 = dot (lightToVertNorm_41, worldNorm_26); - float tmpvar_53; - tmpvar_53 = max (tmpvar_52, 0.05); - float tmpvar_54; - tmpvar_54 = tmpvar_53; - nDotL_40 = tmpvar_54; - float tmpvar_55; - tmpvar_55 = ((atten_33[i_32] * lamp_27[i_32].colorImp.w) * nDotL_40); - weight_39 = tmpvar_55; - vec3 tmpvar_56; - tmpvar_56 = (lAgg_35 + (weight_39 * lightToVertNorm_41)); - lAgg_35 = tmpvar_56; - float tmpvar_57; - tmpvar_57 = (wAgg_34 + weight_39); - wAgg_34 = tmpvar_57; - int _post_incdec_tmp_58; - _post_incdec_tmp_58 = i_32; - int tmpvar_59; - tmpvar_59 = (i_32 + 1); - i_32 = tmpvar_59; - }; - float tmpvar_60; - tmpvar_60 = Luma (hybridCol_29); - float tmpvar_61; - tmpvar_61 = (tmpvar_60 * 2.0); - w_31 = tmpvar_61; - vec3 tmpvar_62; - tmpvar_62 = (lAgg_35 + (hybridDir_28 * w_31)); - lAgg_35 = tmpvar_62; - float tmpvar_63; - tmpvar_63 = (wAgg_34 + w_31); - wAgg_34 = tmpvar_63; - vec3 tmpvar_64; - tmpvar_64 = (lAgg_35 / wAgg_34); - hybridDir_28 = tmpvar_64; - int tmpvar_65; - tmpvar_65 = 0; - j_30 = tmpvar_65; - while (true) { - vec3 lightToVertNorm_1_66; - if (!((j_30 < 4))) { - break; - }; - vec3 tmpvar_67; - tmpvar_67 = normalize ((lamp_27[j_30].posRange.xyz - worldVert_25)); - vec3 tmpvar_68; - tmpvar_68 = tmpvar_67; - lightToVertNorm_1_66 = tmpvar_68; - vec3 tmpvar_69; - tmpvar_69 = (hybridCol_29 + (lamp_27[j_30].colorImp.xyz * atten_33[j_30])); - hybridCol_29 = tmpvar_69; - int _post_incdec_tmp_70; - _post_incdec_tmp_70 = j_30; - int tmpvar_71; - tmpvar_71 = (j_30 + 1); - j_30 = tmpvar_71; - }; -} - -ivec4 GetLightIdxFromGrid ( - in vec3 worldVert_72 -) -{ - vec2 pos_73; - vec2 tmpvar_74; - tmpvar_74 = ((worldVert_72 - GridLightTextureStartCell) * GridLightTextureCellSize).xz; - pos_73 = tmpvar_74; - vec2 tmpvar_75; - tmpvar_75 = clamp (pos_73, IngameGridLimit.xy, IngameGridLimit.zw); - vec2 tmpvar_76; - tmpvar_76 = tmpvar_75; - pos_73 = tmpvar_76; - vec4 tmpvar_77; - tmpvar_77.zw = vec2(0.0, 0.0); - tmpvar_77.x = pos_73.x; - tmpvar_77.y = pos_73.y; - vec4 tmpvar_78; - tmpvar_78 = xll_tex2Dlod (GridLightTexture, tmpvar_77); - ivec4 tmpvar_79; - tmpvar_79 = ivec4((tmpvar_78 * 255.0)).xyzw; - return tmpvar_79; -} - -vec3 DecodeBakedCol ( - in vec3 bakedCol_80 -) -{ - vec3 c_81; - vec3 tmpvar_82; - tmpvar_82 = (bakedCol_80 * 3.0); - c_81 = tmpvar_82; - return (c_81 * c_81); -} - -vec3 DecodeNormal ( - in vec2 enc_83 -) -{ - float l_84; - vec4 nn_85; - vec4 tmpvar_86; - tmpvar_86 = ((enc_83.xyxy * vec4(2.0, 2.0, 0.0, 0.0)) + vec4(-1.0, -1.0, 1.01, -1.0)); - nn_85 = tmpvar_86; - float tmpvar_87; - tmpvar_87 = dot (nn_85.xyz, -(nn_85.xyw)); - float tmpvar_88; - tmpvar_88 = tmpvar_87; - l_84 = tmpvar_88; - float tmpvar_89; - tmpvar_89 = l_84; - nn_85.z = vec3(tmpvar_89).z; - float tmpvar_90; - tmpvar_90 = sqrt (l_84); - vec2 tmpvar_91; - tmpvar_91 = (nn_85.xy * tmpvar_90); - nn_85.xy = tmpvar_91.xy.xy; - return ((nn_85.xyz * 2.0) + vec3(0.0, 0.0, -1.0)); -} - -void DecodeBaking ( - in vec4 bakedColor_92, - in vec2 bakedDir_93, - out vec3 hybridCol_94, - out vec3 hybridDir_95 -) -{ - vec3 tmpvar_96; - tmpvar_96 = DecodeNormal (bakedDir_93); - vec3 tmpvar_97; - tmpvar_97 = (tmpvar_96 * (bakedColor_92.w * 2.0)); - hybridDir_95 = tmpvar_97; - vec3 tmpvar_98; - tmpvar_98 = DecodeBakedCol (bakedColor_92.xyz); - vec3 tmpvar_99; - tmpvar_99 = tmpvar_98; - hybridCol_94 = tmpvar_99; -} - -void LoadBakedLight ( - in vec3 worldVert_100, - in vec3 worldNorm_101, - in vec4 bakedColor_102, - in vec2 bakedDir_103, - out vec3 hybridCol_104, - out vec3 hybridDir_105 -) -{ - DecodeBaking (bakedColor_102, bakedDir_103, hybridCol_104, hybridDir_105); -} - -void ReadLightArray3 ( - in ivec4 lightIdx_106, - out Lamp l0_107, - out Lamp l1_108, - out Lamp l2_109, - out Lamp l3_110 -) -{ - vec4 tmpvar_111; - tmpvar_111 = LightPos[lightIdx_106.x]; - l0_107.posRange = tmpvar_111; - vec4 tmpvar_112; - tmpvar_112 = LightCol[lightIdx_106.x]; - l0_107.colorImp = tmpvar_112; - vec4 tmpvar_113; - tmpvar_113 = vec4(0.0, 0.0, 0.0, 1.0); - l0_107.spotParam = tmpvar_113; - vec4 tmpvar_114; - tmpvar_114 = LightPos[lightIdx_106.y]; - l1_108.posRange = tmpvar_114; - vec4 tmpvar_115; - tmpvar_115 = LightCol[lightIdx_106.y]; - l1_108.colorImp = tmpvar_115; - vec4 tmpvar_116; - tmpvar_116 = vec4(0.0, 0.0, 0.0, 1.0); - l1_108.spotParam = tmpvar_116; - vec4 tmpvar_117; - tmpvar_117 = LightPos[lightIdx_106.z]; - l2_109.posRange = tmpvar_117; - vec4 tmpvar_118; - tmpvar_118 = LightCol[lightIdx_106.z]; - l2_109.colorImp = tmpvar_118; - vec4 tmpvar_119; - tmpvar_119 = vec4(0.0, 0.0, 0.0, 1.0); - l2_109.spotParam = tmpvar_119; - vec4 tmpvar_120; - tmpvar_120 = LightPos[lightIdx_106.w]; - l3_110.posRange = tmpvar_120; - vec4 tmpvar_121; - tmpvar_121 = LightCol[lightIdx_106.w]; - l3_110.colorImp = tmpvar_121; - vec4 tmpvar_122; - tmpvar_122 = vec4(0.0, 0.0, 0.0, 1.0); - l3_110.spotParam = tmpvar_122; -} - -vec3 JimTonemapping ( - in vec3 x_123 -) -{ - vec3 tmpvar_124; - tmpvar_124 = max ((x_123 - (_Tonemap_blackLevel * 0.25)), vec3(0.0, 0.0, 0.0)); - vec3 tmpvar_125; - tmpvar_125 = tmpvar_124; - x_123 = tmpvar_125; - vec3 tmpvar_126; - tmpvar_126 = ((x_123 * ( - (_Tonemap_colorScale1 * x_123) - + _Tonemap_heel)) / ((x_123 * - ((_Tonemap_colorScale2 * x_123) + _Tonemap_shoulder) - ) + _Tonemap_toeLength)); - x_123 = tmpvar_126; - return x_123; -} - -vec3 NichTonemap ( - in vec3 x_127 -) -{ - float tonemapped_128; - vec3 norm_129; - float total_130; - vec3 tmpvar_131; - tmpvar_131 = JimTonemapping ((x_127 * 0.25)); - return (tmpvar_131 * 4.0); - float tmpvar_132; - tmpvar_132 = length (x_127); - float tmpvar_133; - tmpvar_133 = (tmpvar_132 + 0.0001); - total_130 = tmpvar_133; - vec3 tmpvar_134; - tmpvar_134 = (x_127 / total_130); - norm_129 = tmpvar_134; - vec3 tmpvar_135; - tmpvar_135.xz = vec2(0.0, 0.0); - tmpvar_135.y = (total_130 * 0.25); - vec3 tmpvar_136; - tmpvar_136 = JimTonemapping (tmpvar_135); - float tmpvar_137; - tmpvar_137 = (tmpvar_136.y * 4.0); - tonemapped_128 = tmpvar_137; - return (norm_129 * tonemapped_128); -} - -vec3 VertexTonemap ( - in vec3 x_138 -) -{ - vec3 tmpvar_139; - tmpvar_139 = NichTonemap (x_138); - return tmpvar_139; -} - -void DoCalcHybridLight2 ( - in vec3 worldVert_140, - in vec3 worldNorm_141, - out vec3 hybridDir_142, - out vec3 hybridCol_143, - out vec3 ambient_144, - in vec4 bakedColor_145, - in vec2 bakedDir_146 -) -{ - Lamp l_147[4]; - ivec4 lightIdx_148; - LoadBakedLight (worldVert_140, worldNorm_141, bakedColor_145, bakedDir_146, hybridCol_143, hybridDir_142); - ivec4 tmpvar_149; - tmpvar_149 = GetLightIdxFromGrid (worldVert_140); - ivec4 tmpvar_150; - tmpvar_150 = tmpvar_149; - lightIdx_148 = tmpvar_150; - ReadLightArray3 (lightIdx_148, l_147[0], l_147[1], l_147[2], l_147[3]); - CalcDynamicLight (worldVert_140, worldNorm_141, l_147, hybridDir_142, hybridCol_143); - vec3 tmpvar_151; - tmpvar_151 = VertexTonemap (hybridCol_143); - vec3 tmpvar_152; - tmpvar_152 = tmpvar_151; - hybridCol_143 = tmpvar_152; - float tmpvar_153; - tmpvar_153 = dot (worldNorm_141, _HybridSunDir); - vec3 tmpvar_154; - tmpvar_154 = VertexTonemap ((_HybridSunCol.xyz * tmpvar_153)); - vec3 tmpvar_155; - tmpvar_155 = tmpvar_154; - ambient_144 = tmpvar_155; -} - -v2f vert ( - in HybridAppData v_156 -) -{ - mat3 rotation_157; - vec3 binormal_158; - vec3 eyeToVert_159; - vec3 worldNorm_160; - vec3 worldVert_161; - v2f o_162; - vec4 tmpvar_163; - tmpvar_163 = (gl_ModelViewProjectionMatrix * v_156.vertex); - o_162.pos = tmpvar_163; - vec2 tmpvar_164; - tmpvar_164 = ((v_156.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_162.uv = tmpvar_164; - vec3 tmpvar_165; - tmpvar_165 = (_Object2World * v_156.vertex).xyz; - worldVert_161 = tmpvar_165; - mat3 tmpvar_166; - tmpvar_166 = xll_constructMat3_mf4x4 (_Object2World); - vec3 tmpvar_167; - tmpvar_167 = normalize ((tmpvar_166 * v_156.normal.xyz)); - vec3 tmpvar_168; - tmpvar_168 = tmpvar_167; - worldNorm_160 = tmpvar_168; - DoCalcHybridLight2 (worldVert_161, worldNorm_160, o_162.hybridDir, o_162.hybridCol, o_162.ambient, v_156.bakedCol, v_156.bakedDir); - vec3 tmpvar_169; - tmpvar_169 = normalize ((_WorldSpaceCameraPos.xyz - worldVert_161)); - vec3 tmpvar_170; - tmpvar_170 = tmpvar_169; - eyeToVert_159 = tmpvar_170; - vec3 tmpvar_171; - tmpvar_171 = cross (v_156.normal, v_156.tangent.xyz); - vec3 tmpvar_172; - tmpvar_172 = (tmpvar_171 * v_156.tangent.w); - binormal_158 = tmpvar_172; - mat3 tmpvar_173; - vec3 tmpvar_174; - tmpvar_174 = v_156.tangent.xyz; - tmpvar_173[0] = tmpvar_174; - vec3 tmpvar_175; - tmpvar_175 = binormal_158; - tmpvar_173[1] = tmpvar_175; - vec3 tmpvar_176; - tmpvar_176 = v_156.normal; - tmpvar_173[2] = tmpvar_176; - mat3 tmpvar_177; - tmpvar_177 = xll_transpose_mf3x3 (tmpvar_173); - mat3 tmpvar_178; - tmpvar_178 = tmpvar_177; - rotation_157 = tmpvar_178; - mat3 tmpvar_179; - tmpvar_179 = xll_constructMat3_mf4x4 (_World2Object); - vec3 tmpvar_180; - tmpvar_180 = (rotation_157 * (tmpvar_179 * o_162.hybridDir)); - o_162.hybridDir = tmpvar_180; - return o_162; -} - -void main () -{ - HybridAppData xlt_v_181; - v2f xl_retval_182; - vec4 tmpvar_183; - tmpvar_183 = gl_Vertex.xyzw; - vec4 tmpvar_184; - tmpvar_184 = tmpvar_183; - xlt_v_181.vertex = tmpvar_184; - vec4 tmpvar_185; - tmpvar_185 = TANGENT.xyzw; - vec4 tmpvar_186; - tmpvar_186 = tmpvar_185; - xlt_v_181.tangent = tmpvar_186; - vec3 tmpvar_187; - tmpvar_187 = gl_Normal.xyz; - vec3 tmpvar_188; - tmpvar_188 = tmpvar_187; - xlt_v_181.normal = tmpvar_188; - vec4 tmpvar_189; - tmpvar_189 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_190; - tmpvar_190 = tmpvar_189; - xlt_v_181.texcoord = tmpvar_190; - vec4 tmpvar_191; - tmpvar_191 = gl_Color.xyzw; - vec4 tmpvar_192; - tmpvar_192 = tmpvar_191; - xlt_v_181.bakedCol = tmpvar_192; - vec2 tmpvar_193; - tmpvar_193 = gl_MultiTexCoord1.xy; - vec2 tmpvar_194; - tmpvar_194 = tmpvar_193; - xlt_v_181.bakedDir = tmpvar_194; - v2f tmpvar_195; - tmpvar_195 = vert (xlt_v_181); - v2f tmpvar_196; - tmpvar_196 = tmpvar_195; - xl_retval_182 = tmpvar_196; - vec4 tmpvar_197; - tmpvar_197 = xl_retval_182.pos.xyzw; - vec4 tmpvar_198; - tmpvar_198 = tmpvar_197; - gl_Position = tmpvar_198; - vec3 tmpvar_199; - tmpvar_199 = xl_retval_182.hybridDir.xyz; - vec3 tmpvar_200; - tmpvar_200 = tmpvar_199; - xlv_TEXCOORD0 = tmpvar_200; - vec3 tmpvar_201; - tmpvar_201 = xl_retval_182.hybridCol.xyz; - vec3 tmpvar_202; - tmpvar_202 = tmpvar_201; - xlv_TEXCOORD1 = tmpvar_202; - vec3 tmpvar_203; - tmpvar_203 = xl_retval_182.ambient.xyz; - vec3 tmpvar_204; - tmpvar_204 = tmpvar_203; - xlv_COLOR = tmpvar_204; - vec2 tmpvar_205; - tmpvar_205 = xl_retval_182.uv.xy; - vec2 tmpvar_206; - tmpvar_206 = tmpvar_205; - xlv_TEXCOORD2 = tmpvar_206; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLight-out.txt b/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLight-out.txt index 3743b7dea..d8342846f 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLight-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLight-out.txt @@ -73,11 +73,13 @@ void main () vec3 tmpvar_24; tmpvar_24 = (tmpvar_22 * inversesqrt(tmpvar_23)); vec4 tmpvar_25; - tmpvar_25 = atten_19; tmpvar_25.x = max ((1.0 - ( + tmpvar_25.yzw = atten_19.yzw; + tmpvar_25.x = max ((1.0 - ( (tmpvar_23 * tmpvar_10.w) * 0.8)), 0.0); vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; tmpvar_26.x = (tmpvar_25.x * tmpvar_25.x); + tmpvar_26.yzw = tmpvar_25.yzw; + tmpvar_26.x = (tmpvar_25.x * tmpvar_25.x); float tmpvar_27; tmpvar_27 = ((tmpvar_26.x * tmpvar_11.w) * max (dot (tmpvar_24, tmpvar_3), 0.05)); lAgg_21 = (tmpvar_27 * tmpvar_24); @@ -89,11 +91,13 @@ void main () vec3 tmpvar_30; tmpvar_30 = (tmpvar_28 * inversesqrt(tmpvar_29)); vec4 tmpvar_31; - tmpvar_31 = tmpvar_26; tmpvar_31.y = max ((1.0 - ( + tmpvar_31.xzw = tmpvar_26.xzw; + tmpvar_31.y = max ((1.0 - ( (tmpvar_29 * tmpvar_12.w) * 0.8)), 0.0); vec4 tmpvar_32; - tmpvar_32 = tmpvar_31; tmpvar_32.y = (tmpvar_31.y * tmpvar_31.y); + tmpvar_32.xzw = tmpvar_31.xzw; + tmpvar_32.y = (tmpvar_31.y * tmpvar_31.y); float tmpvar_33; tmpvar_33 = ((tmpvar_32.y * tmpvar_13.w) * max (dot (tmpvar_30, tmpvar_3), 0.05)); lAgg_21 = (lAgg_21 + (tmpvar_33 * tmpvar_30)); @@ -105,11 +109,13 @@ void main () vec3 tmpvar_36; tmpvar_36 = (tmpvar_34 * inversesqrt(tmpvar_35)); vec4 tmpvar_37; - tmpvar_37 = tmpvar_32; tmpvar_37.z = max ((1.0 - ( + tmpvar_37.xyw = tmpvar_32.xyw; + tmpvar_37.z = max ((1.0 - ( (tmpvar_35 * tmpvar_14.w) * 0.8)), 0.0); vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; tmpvar_38.z = (tmpvar_37.z * tmpvar_37.z); + tmpvar_38.xyw = tmpvar_37.xyw; + tmpvar_38.z = (tmpvar_37.z * tmpvar_37.z); float tmpvar_39; tmpvar_39 = ((tmpvar_38.z * tmpvar_15.w) * max (dot (tmpvar_36, tmpvar_3), 0.05)); lAgg_21 = (lAgg_21 + (tmpvar_39 * tmpvar_36)); @@ -121,11 +127,13 @@ void main () vec3 tmpvar_42; tmpvar_42 = (tmpvar_40 * inversesqrt(tmpvar_41)); vec4 tmpvar_43; - tmpvar_43 = tmpvar_38; tmpvar_43.w = max ((1.0 - ( + tmpvar_43.xyz = tmpvar_38.xyz; + tmpvar_43.w = max ((1.0 - ( (tmpvar_41 * tmpvar_16.w) * 0.8)), 0.0); vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; tmpvar_44.w = (tmpvar_43.w * tmpvar_43.w); + tmpvar_44.xyz = tmpvar_43.xyz; + tmpvar_44.w = (tmpvar_43.w * tmpvar_43.w); atten_19 = tmpvar_44; float tmpvar_45; tmpvar_45 = ((tmpvar_44.w * tmpvar_17.w) * max (dot (tmpvar_42, tmpvar_3), 0.05)); @@ -133,68 +141,87 @@ void main () wAgg_20 = (wAgg_20 + tmpvar_45); float tmpvar_46; tmpvar_46 = (dot (tmpvar_7, vec3(0.22, 0.707, 0.071)) * 2.0); - vec3 tmpvar_47; - tmpvar_47 = (lAgg_21 + (( + lAgg_21 = (lAgg_21 + (( ((nn_4.xyz * 2.0) + vec3(0.0, 0.0, -1.0)) * (gl_Color.w * 2.0) ) * tmpvar_46)); - lAgg_21 = tmpvar_47; - float tmpvar_48; - tmpvar_48 = (wAgg_20 + tmpvar_46); - wAgg_20 = tmpvar_48; - hybridCol_18 = (tmpvar_7 + (tmpvar_11.xyz * tmpvar_44.x)); - hybridCol_18 = (hybridCol_18 + (tmpvar_13.xyz * tmpvar_44.y)); - hybridCol_18 = (hybridCol_18 + (tmpvar_15.xyz * tmpvar_44.z)); + wAgg_20 = (wAgg_20 + tmpvar_46); + hybridCol_18 = (tmpvar_7 + (tmpvar_11.xyz * tmpvar_26.x)); + hybridCol_18 = (hybridCol_18 + (tmpvar_13.xyz * tmpvar_32.y)); + hybridCol_18 = (hybridCol_18 + (tmpvar_15.xyz * tmpvar_38.z)); hybridCol_18 = (hybridCol_18 + (tmpvar_17.xyz * tmpvar_44.w)); - vec3 x_49; - x_49 = (hybridCol_18 * 0.25); - vec3 tmpvar_50; - vec3 cse_51; - cse_51 = (_Tonemap_blackLevel * 0.25); - tmpvar_50 = max ((x_49 - cse_51), vec3(0.0, 0.0, 0.0)); + vec3 x_47; + x_47 = (hybridCol_18 * 0.25); + vec3 tmpvar_48; + vec3 tmpvar_49; + tmpvar_49 = (_Tonemap_blackLevel * 0.25); + tmpvar_48 = max ((x_47 - tmpvar_49), vec3(0.0, 0.0, 0.0)); + x_47 = ((tmpvar_48 * ( + (_Tonemap_colorScale1 * tmpvar_48) + + _Tonemap_heel)) / ((tmpvar_48 * + ((_Tonemap_colorScale2 * tmpvar_48) + _Tonemap_shoulder) + ) + _Tonemap_toeLength)); + vec3 x_50; + x_50 = ((_HybridSunCol.xyz * dot (tmpvar_3, _HybridSunDir)) * 0.25); + vec3 tmpvar_51; + tmpvar_51 = max ((x_50 - tmpvar_49), vec3(0.0, 0.0, 0.0)); + x_50 = ((tmpvar_51 * ( + (_Tonemap_colorScale1 * tmpvar_51) + + _Tonemap_heel)) / ((tmpvar_51 * + ((_Tonemap_colorScale2 * tmpvar_51) + _Tonemap_shoulder) + ) + _Tonemap_toeLength)); vec3 tmpvar_52; - tmpvar_52 = ((tmpvar_50 * ( - (_Tonemap_colorScale1 * tmpvar_50) - + _Tonemap_heel)) / ((tmpvar_50 * - ((_Tonemap_colorScale2 * tmpvar_50) + _Tonemap_shoulder) - ) + _Tonemap_toeLength)); - x_49 = tmpvar_52; - vec3 x_53; - x_53 = ((_HybridSunCol.xyz * dot (tmpvar_3, _HybridSunDir)) * 0.25); - vec3 tmpvar_54; - tmpvar_54 = max ((x_53 - cse_51), vec3(0.0, 0.0, 0.0)); - vec3 tmpvar_55; - tmpvar_55 = ((tmpvar_54 * ( - (_Tonemap_colorScale1 * tmpvar_54) - + _Tonemap_heel)) / ((tmpvar_54 * - ((_Tonemap_colorScale2 * tmpvar_54) + _Tonemap_shoulder) - ) + _Tonemap_toeLength)); - x_53 = tmpvar_55; - vec3 tmpvar_56; - vec3 tmpvar_57; - tmpvar_56 = TANGENT.xyz; - tmpvar_57 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); - mat3 tmpvar_58; - tmpvar_58[0].x = tmpvar_56.x; - tmpvar_58[0].y = tmpvar_57.x; - tmpvar_58[0].z = gl_Normal.x; - tmpvar_58[1].x = tmpvar_56.y; - tmpvar_58[1].y = tmpvar_57.y; - tmpvar_58[1].z = gl_Normal.y; - tmpvar_58[2].x = tmpvar_56.z; - tmpvar_58[2].y = tmpvar_57.z; - tmpvar_58[2].z = gl_Normal.z; - mat3 tmpvar_59; - tmpvar_59[0] = _World2Object[0].xyz; - tmpvar_59[1] = _World2Object[1].xyz; - tmpvar_59[2] = _World2Object[2].xyz; + vec3 tmpvar_53; + tmpvar_52 = TANGENT.xyz; + tmpvar_53 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + mat3 tmpvar_54; + tmpvar_54[0].x = tmpvar_52.x; + tmpvar_54[0].y = tmpvar_53.x; + tmpvar_54[0].z = gl_Normal.x; + tmpvar_54[1].x = tmpvar_52.y; + tmpvar_54[1].y = tmpvar_53.y; + tmpvar_54[1].z = gl_Normal.y; + tmpvar_54[2].x = tmpvar_52.z; + tmpvar_54[2].y = tmpvar_53.z; + tmpvar_54[2].z = gl_Normal.z; + mat3 tmpvar_55; + tmpvar_55[0] = _World2Object[0].xyz; + tmpvar_55[1] = _World2Object[1].xyz; + tmpvar_55[2] = _World2Object[2].xyz; gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); - xlv_TEXCOORD0 = (tmpvar_58 * (tmpvar_59 * (tmpvar_47 / tmpvar_48))); - xlv_TEXCOORD1 = (tmpvar_52 * 4.0); - xlv_COLOR = (tmpvar_55 * 4.0); + xlv_TEXCOORD0 = (tmpvar_54 * (tmpvar_55 * (lAgg_21 / wAgg_20))); + xlv_TEXCOORD1 = (x_47 * 4.0); + xlv_COLOR = (x_50 * 4.0); xlv_TEXCOORD2 = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); } -// inputs: 6, stats: 141 alu 1 tex 0 flow +// stats: 133 alu 1 tex 0 flow +// inputs: 6 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #2: gl_Color (high float) 4x1 [-1] loc 3 +// #3: gl_Normal (high float) 3x1 [-1] loc 2 +// #4: gl_Vertex (high float) 4x1 [-1] loc 0 +// #5: TANGENT (high float) 4x1 [-1] +// uniforms: 17 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _Object2World (high float) 4x4 [-1] +// #2: _World2Object (high float) 4x4 [-1] +// #3: _Tonemap_blackLevel (high float) 3x1 [-1] +// #4: _Tonemap_toeLength (high float) 3x1 [-1] +// #5: _Tonemap_heel (high float) 3x1 [-1] +// #6: _Tonemap_shoulder (high float) 3x1 [-1] +// #7: _Tonemap_colorScale1 (high float) 3x1 [-1] +// #8: _Tonemap_colorScale2 (high float) 3x1 [-1] +// #9: _HybridSunDir (high float) 3x1 [-1] +// #10: _HybridSunCol (high float) 4x1 [-1] +// #11: GridLightTextureStartCell (high float) 3x1 [-1] +// #12: GridLightTextureCellSize (high float) 3x1 [-1] +// #13: IngameGridLimit (high float) 4x1 [-1] +// #14: LightPos (high float) 4x1 [30] +// #15: LightCol (high float) 4x1 [30] +// #16: _MainTex_ST (high float) 4x1 [-1] +// textures: 1 +// #0: GridLightTexture (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-ir.txt deleted file mode 100644 index 5294bc97f..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-ir.txt +++ /dev/null @@ -1,301 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec3 lightDir; - vec3 vlight; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _BumpMap_ST; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_SHAb; -uniform vec4 unity_SHAg; -uniform vec4 unity_SHAr; -uniform vec4 unity_SHBb; -uniform vec4 unity_SHBg; -uniform vec4 unity_SHBr; -uniform vec4 unity_SHC; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec3 ShadeSH9 ( - in vec4 normal_9 -) -{ - vec3 x3_10; - float vC_11; - vec3 x2_12; - vec4 vB_13; - vec3 x1_14; - float tmpvar_15; - tmpvar_15 = dot (unity_SHAr, normal_9); - float tmpvar_16; - tmpvar_16 = tmpvar_15; - x1_14.x = tmpvar_16; - float tmpvar_17; - tmpvar_17 = dot (unity_SHAg, normal_9); - float tmpvar_18; - tmpvar_18 = tmpvar_17; - x1_14.y = vec2(tmpvar_18).y; - float tmpvar_19; - tmpvar_19 = dot (unity_SHAb, normal_9); - float tmpvar_20; - tmpvar_20 = tmpvar_19; - x1_14.z = vec3(tmpvar_20).z; - vec4 tmpvar_21; - tmpvar_21 = (normal_9.xyzz * normal_9.yzzx); - vB_13 = tmpvar_21; - float tmpvar_22; - tmpvar_22 = dot (unity_SHBr, vB_13); - float tmpvar_23; - tmpvar_23 = tmpvar_22; - x2_12.x = tmpvar_23; - float tmpvar_24; - tmpvar_24 = dot (unity_SHBg, vB_13); - float tmpvar_25; - tmpvar_25 = tmpvar_24; - x2_12.y = vec2(tmpvar_25).y; - float tmpvar_26; - tmpvar_26 = dot (unity_SHBb, vB_13); - float tmpvar_27; - tmpvar_27 = tmpvar_26; - x2_12.z = vec3(tmpvar_27).z; - float tmpvar_28; - tmpvar_28 = ((normal_9.x * normal_9.x) - (normal_9.y * normal_9.y)); - vC_11 = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = (unity_SHC.xyz * vC_11); - x3_10 = tmpvar_29; - return ((x1_14 + x2_12) + x3_10); -} - -void PositionFog ( - in vec4 v_30, - out vec4 pos_31, - out float fog_32 -) -{ - vec4 tmpvar_33; - tmpvar_33 = (gl_ModelViewProjectionMatrix * v_30); - pos_31 = tmpvar_33; - float tmpvar_34; - tmpvar_34 = pos_31.z; - fog_32 = tmpvar_34; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_35 -) -{ - vec3 objSpaceCameraPos_36; - vec4 tmpvar_37; - tmpvar_37.w = 1.0; - tmpvar_37.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_38; - tmpvar_38 = ((_World2Object * tmpvar_37).xyz * unity_Scale.w); - objSpaceCameraPos_36 = tmpvar_38; - return (objSpaceCameraPos_36 - v_35.xyz); -} - -vec3 ObjSpaceLightDir ( - in vec4 v_39 -) -{ - vec3 objSpaceLightPos_40; - vec3 tmpvar_41; - tmpvar_41 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_40 = tmpvar_41; - return objSpaceLightPos_40.xyz; -} - -v2f_surf vert_surf ( - in appdata_full v_42 -) -{ - vec3 shlight_43; - mat3 rotation_44; - vec3 binormal_45; - vec3 worldN_46; - v2f_surf o_47; - PositionFog (v_42.vertex, o_47.pos, o_47.fog); - vec2 tmpvar_48; - tmpvar_48 = ((v_42.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_47.hip_pack0.xy = tmpvar_48.xy.xy; - vec2 tmpvar_49; - tmpvar_49 = ((v_42.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_47.hip_pack0.zw = tmpvar_49.xxxy.zw; - mat3 tmpvar_50; - tmpvar_50 = xll_constructMat3 (_Object2World); - vec3 tmpvar_51; - tmpvar_51 = (tmpvar_50 * (v_42.normal * unity_Scale.w)); - worldN_46 = tmpvar_51; - vec3 tmpvar_52; - tmpvar_52 = cross (v_42.normal, v_42.tangent.xyz); - vec3 tmpvar_53; - tmpvar_53 = (tmpvar_52 * v_42.tangent.w); - binormal_45 = tmpvar_53; - mat3 tmpvar_54; - float tmpvar_55; - tmpvar_55 = v_42.tangent.x; - tmpvar_54[0].x = tmpvar_55; - float tmpvar_56; - tmpvar_56 = binormal_45.x; - tmpvar_54[0].y = tmpvar_56; - float tmpvar_57; - tmpvar_57 = v_42.normal.x; - tmpvar_54[0].z = tmpvar_57; - float tmpvar_58; - tmpvar_58 = v_42.tangent.y; - tmpvar_54[1].x = tmpvar_58; - float tmpvar_59; - tmpvar_59 = binormal_45.y; - tmpvar_54[1].y = tmpvar_59; - float tmpvar_60; - tmpvar_60 = v_42.normal.y; - tmpvar_54[1].z = tmpvar_60; - float tmpvar_61; - tmpvar_61 = v_42.tangent.z; - tmpvar_54[2].x = tmpvar_61; - float tmpvar_62; - tmpvar_62 = binormal_45.z; - tmpvar_54[2].y = tmpvar_62; - float tmpvar_63; - tmpvar_63 = v_42.normal.z; - tmpvar_54[2].z = tmpvar_63; - mat3 tmpvar_64; - tmpvar_64 = tmpvar_54; - rotation_44 = tmpvar_64; - vec3 tmpvar_65; - tmpvar_65 = ObjSpaceLightDir (v_42.vertex); - vec3 tmpvar_66; - tmpvar_66 = (rotation_44 * tmpvar_65); - o_47.lightDir = tmpvar_66; - vec3 tmpvar_67; - tmpvar_67 = ObjSpaceViewDir (v_42.vertex); - vec3 tmpvar_68; - tmpvar_68 = (rotation_44 * tmpvar_67); - o_47.viewDir = tmpvar_68; - vec4 tmpvar_69; - tmpvar_69.w = 1.0; - tmpvar_69.xyz = worldN_46.xyz; - vec3 tmpvar_70; - tmpvar_70 = ShadeSH9 (tmpvar_69); - vec3 tmpvar_71; - tmpvar_71 = tmpvar_70; - shlight_43 = tmpvar_71; - vec3 tmpvar_72; - tmpvar_72 = shlight_43; - o_47.vlight = tmpvar_72; - return o_47; -} - -void main () -{ - appdata_full xlt_v_73; - v2f_surf xl_retval_74; - vec4 tmpvar_75; - tmpvar_75 = gl_Vertex.xyzw; - vec4 tmpvar_76; - tmpvar_76 = tmpvar_75; - xlt_v_73.vertex = tmpvar_76; - vec4 tmpvar_77; - tmpvar_77 = TANGENT.xyzw; - vec4 tmpvar_78; - tmpvar_78 = tmpvar_77; - xlt_v_73.tangent = tmpvar_78; - vec3 tmpvar_79; - tmpvar_79 = gl_Normal.xyz; - vec3 tmpvar_80; - tmpvar_80 = tmpvar_79; - xlt_v_73.normal = tmpvar_80; - vec4 tmpvar_81; - tmpvar_81 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_82; - tmpvar_82 = tmpvar_81; - xlt_v_73.texcoord = tmpvar_82; - vec4 tmpvar_83; - tmpvar_83 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_84; - tmpvar_84 = tmpvar_83; - xlt_v_73.texcoord1 = tmpvar_84; - vec4 tmpvar_85; - tmpvar_85 = gl_Color.xyzw; - vec4 tmpvar_86; - tmpvar_86 = tmpvar_85; - xlt_v_73.color = tmpvar_86; - v2f_surf tmpvar_87; - tmpvar_87 = vert_surf (xlt_v_73); - v2f_surf tmpvar_88; - tmpvar_88 = tmpvar_87; - xl_retval_74 = tmpvar_88; - vec4 tmpvar_89; - tmpvar_89 = xl_retval_74.pos.xyzw; - vec4 tmpvar_90; - tmpvar_90 = tmpvar_89; - gl_Position = tmpvar_90; - vec4 tmpvar_91; - tmpvar_91.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_91.x = xl_retval_74.fog; - vec4 tmpvar_92; - tmpvar_92 = tmpvar_91; - xlv_FOG = tmpvar_92; - vec4 tmpvar_93; - tmpvar_93 = xl_retval_74.hip_pack0.xyzw; - vec4 tmpvar_94; - tmpvar_94 = tmpvar_93; - gl_TexCoord[0] = tmpvar_94; - vec4 tmpvar_95; - tmpvar_95.w = 0.0; - tmpvar_95.xyz = xl_retval_74.viewDir.xyz; - vec4 tmpvar_96; - tmpvar_96 = tmpvar_95; - gl_TexCoord[1] = tmpvar_96; - vec4 tmpvar_97; - tmpvar_97.w = 0.0; - tmpvar_97.xyz = xl_retval_74.lightDir.xyz; - vec4 tmpvar_98; - tmpvar_98 = tmpvar_97; - gl_TexCoord[2] = tmpvar_98; - vec4 tmpvar_99; - tmpvar_99.w = 0.0; - tmpvar_99.xyz = xl_retval_74.vlight.xyz; - vec4 tmpvar_100; - tmpvar_100 = tmpvar_99; - gl_TexCoord[3] = tmpvar_100; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-out.txt b/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-out.txt index 5034292ac..63a175367 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-out.txt @@ -16,51 +16,51 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); - tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - mat3 tmpvar_3; - tmpvar_3[0] = _Object2World[0].xyz; - tmpvar_3[1] = _Object2World[1].xyz; - tmpvar_3[2] = _Object2World[2].xyz; - vec3 tmpvar_4; - tmpvar_4 = (tmpvar_3 * (gl_Normal * unity_Scale.w)); - vec3 tmpvar_5; - tmpvar_5 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + vec3 binormal_1; + vec3 worldN_2; + vec4 tmpvar_3; + vec4 pos_4; + pos_4 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_3.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + tmpvar_3.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); + mat3 tmpvar_5; + tmpvar_5[0] = _Object2World[0].xyz; + tmpvar_5[1] = _Object2World[1].xyz; + tmpvar_5[2] = _Object2World[2].xyz; + worldN_2 = (tmpvar_5 * (gl_Normal * unity_Scale.w)); + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_6; tmpvar_6[0].x = TANGENT.x; - tmpvar_6[0].y = tmpvar_5.x; + tmpvar_6[0].y = binormal_1.x; tmpvar_6[0].z = gl_Normal.x; tmpvar_6[1].x = TANGENT.y; - tmpvar_6[1].y = tmpvar_5.y; + tmpvar_6[1].y = binormal_1.y; tmpvar_6[1].z = gl_Normal.y; tmpvar_6[2].x = TANGENT.z; - tmpvar_6[2].y = tmpvar_5.z; + tmpvar_6[2].y = binormal_1.z; tmpvar_6[2].z = gl_Normal.z; vec4 tmpvar_7; tmpvar_7.w = 1.0; tmpvar_7.xyz = _WorldSpaceCameraPos; vec4 tmpvar_8; tmpvar_8.w = 1.0; - tmpvar_8.xyz = tmpvar_4; + tmpvar_8.xyz = worldN_2; vec3 x2_9; - vec3 x1_10; - x1_10.x = dot (unity_SHAr, tmpvar_8); - x1_10.y = dot (unity_SHAg, tmpvar_8); - x1_10.z = dot (unity_SHAb, tmpvar_8); - vec4 tmpvar_11; - tmpvar_11 = (tmpvar_4.xyzz * tmpvar_4.yzzx); - x2_9.x = dot (unity_SHBr, tmpvar_11); - x2_9.y = dot (unity_SHBg, tmpvar_11); - x2_9.z = dot (unity_SHBb, tmpvar_11); - gl_Position = tmpvar_2; + vec4 vB_10; + vec3 x1_11; + x1_11.x = dot (unity_SHAr, tmpvar_8); + x1_11.y = dot (unity_SHAg, tmpvar_8); + x1_11.z = dot (unity_SHAb, tmpvar_8); + vB_10 = (worldN_2.xyzz * worldN_2.yzzx); + x2_9.x = dot (unity_SHBr, vB_10); + x2_9.y = dot (unity_SHBg, vB_10); + x2_9.z = dot (unity_SHBb, vB_10); + gl_Position = pos_4; vec4 tmpvar_12; tmpvar_12.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_12.x = tmpvar_2.z; + tmpvar_12.x = pos_4.z; xlv_FOG = tmpvar_12; - gl_TexCoord[0] = tmpvar_1; + gl_TexCoord[0] = tmpvar_3; vec4 tmpvar_13; tmpvar_13.w = 0.0; tmpvar_13.xyz = (tmpvar_6 * (( @@ -73,13 +73,34 @@ void main () gl_TexCoord[2] = tmpvar_14; vec4 tmpvar_15; tmpvar_15.w = 0.0; - tmpvar_15.xyz = ((x1_10 + x2_9) + (unity_SHC.xyz * ( - (tmpvar_4.x * tmpvar_4.x) + tmpvar_15.xyz = ((x1_11 + x2_9) + (unity_SHC.xyz * ( + (worldN_2.x * worldN_2.x) - - (tmpvar_4.y * tmpvar_4.y) + (worldN_2.y * worldN_2.y) ))); gl_TexCoord[3] = tmpvar_15; } -// inputs: 4, stats: 36 alu 0 tex 0 flow +// stats: 36 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 15 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _BumpMap_ST (high float) 4x1 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _World2Object (high float) 4x4 [-1] +// #5: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #6: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #7: unity_SHAb (high float) 4x1 [-1] +// #8: unity_SHAg (high float) 4x1 [-1] +// #9: unity_SHAr (high float) 4x1 [-1] +// #10: unity_SHBb (high float) 4x1 [-1] +// #11: unity_SHBg (high float) 4x1 [-1] +// #12: unity_SHBr (high float) 4x1 [-1] +// #13: unity_SHC (high float) 4x1 [-1] +// #14: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-particle-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/z-particle-ir.txt deleted file mode 100644 index 13401b9e7..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/z-particle-ir.txt +++ /dev/null @@ -1,72 +0,0 @@ -struct v2f { - vec4 vertex; - vec4 color; - vec2 texcoord; -}; -struct appdata_t { - vec4 vertex; - vec4 color; - vec2 texcoord; -}; -uniform vec4 _MainTex_ST; -uniform mat4 glstate_matrix_mvp; -varying vec4 xlv_COLOR; -varying vec2 xlv_TEXCOORD0; -v2f xlat_main ( - in appdata_t v_1 -) -{ - v2f o_2; - vec4 tmpvar_3; - tmpvar_3 = (glstate_matrix_mvp * v_1.vertex); - o_2.vertex = tmpvar_3; - vec4 tmpvar_4; - tmpvar_4 = v_1.color; - o_2.color = tmpvar_4; - vec2 tmpvar_5; - tmpvar_5 = ((v_1.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_2.texcoord = tmpvar_5; - return o_2; -} - -void main () -{ - appdata_t xlt_v_6; - v2f xl_retval_7; - vec4 tmpvar_8; - tmpvar_8 = gl_Vertex.xyzw; - vec4 tmpvar_9; - tmpvar_9 = tmpvar_8; - xlt_v_6.vertex = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10 = gl_Color.xyzw; - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - xlt_v_6.color = tmpvar_11; - vec2 tmpvar_12; - tmpvar_12 = gl_MultiTexCoord0.xy; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_12; - xlt_v_6.texcoord = tmpvar_13; - v2f tmpvar_14; - tmpvar_14 = xlat_main (xlt_v_6); - v2f tmpvar_15; - tmpvar_15 = tmpvar_14; - xl_retval_7 = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = xl_retval_7.vertex.xyzw; - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - gl_Position = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = xl_retval_7.color.xyzw; - vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - xlv_COLOR = tmpvar_19; - vec2 tmpvar_20; - tmpvar_20 = xl_retval_7.texcoord.xy; - vec2 tmpvar_21; - tmpvar_21 = tmpvar_20; - xlv_TEXCOORD0 = tmpvar_21; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-particle-irES.txt b/3rdparty/glsl-optimizer/tests/vertex/z-particle-irES.txt deleted file mode 100644 index 2c67efa4c..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/z-particle-irES.txt +++ /dev/null @@ -1,77 +0,0 @@ -struct v2f { - highp vec4 vertex; - lowp vec4 color; - mediump vec2 texcoord; -}; -struct appdata_t { - highp vec4 vertex; - lowp vec4 color; - highp vec2 texcoord; -}; -attribute highp vec4 _glesVertex; -attribute mediump vec3 _glesNormal; -attribute highp vec4 _glesMultiTexCoord0; -attribute highp vec4 _glesMultiTexCoord1; -attribute lowp vec4 _glesColor; -uniform highp vec4 _MainTex_ST; -uniform highp mat4 glstate_matrix_mvp; -varying lowp vec4 xlv_COLOR; -varying mediump vec2 xlv_TEXCOORD0; -v2f xlat_main ( - in appdata_t v_1 -) -{ - v2f o_2; - highp vec4 tmpvar_3; - tmpvar_3 = (glstate_matrix_mvp * v_1.vertex); - o_2.vertex = tmpvar_3; - lowp vec4 tmpvar_4; - tmpvar_4 = v_1.color; - o_2.color = tmpvar_4; - highp vec2 tmpvar_5; - tmpvar_5 = ((v_1.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_2.texcoord = tmpvar_5; - return o_2; -} - -void main () -{ - appdata_t xlt_v_6; - v2f xl_retval_7; - highp vec4 tmpvar_8; - tmpvar_8 = _glesVertex.xyzw; - highp vec4 tmpvar_9; - tmpvar_9 = tmpvar_8; - xlt_v_6.vertex = tmpvar_9; - lowp vec4 tmpvar_10; - tmpvar_10 = _glesColor.xyzw; - lowp vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - xlt_v_6.color = tmpvar_11; - highp vec2 tmpvar_12; - tmpvar_12 = _glesMultiTexCoord0.xy; - highp vec2 tmpvar_13; - tmpvar_13 = tmpvar_12; - xlt_v_6.texcoord = tmpvar_13; - v2f tmpvar_14; - tmpvar_14 = xlat_main (xlt_v_6); - v2f tmpvar_15; - tmpvar_15 = tmpvar_14; - xl_retval_7 = tmpvar_15; - highp vec4 tmpvar_16; - tmpvar_16 = xl_retval_7.vertex.xyzw; - highp vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - gl_Position = tmpvar_17; - lowp vec4 tmpvar_18; - tmpvar_18 = xl_retval_7.color.xyzw; - lowp vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - xlv_COLOR = tmpvar_19; - mediump vec2 tmpvar_20; - tmpvar_20 = xl_retval_7.texcoord.xy; - mediump vec2 tmpvar_21; - tmpvar_21 = tmpvar_20; - xlv_TEXCOORD0 = tmpvar_21; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-particle-out.txt b/3rdparty/glsl-optimizer/tests/vertex/z-particle-out.txt index 0c5be6fba..a79d92cec 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-particle-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-particle-out.txt @@ -10,4 +10,11 @@ void main () } -// inputs: 3, stats: 3 alu 0 tex 0 flow +// stats: 3 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Color (high float) 4x1 [-1] loc 3 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 2 (total size: 0) +// #0: _MainTex_ST (high float) 4x1 [-1] +// #1: glstate_matrix_mvp (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-particle-outES.txt b/3rdparty/glsl-optimizer/tests/vertex/z-particle-outES.txt index 07b82d61a..ce910f39c 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-particle-outES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-particle-outES.txt @@ -8,13 +8,18 @@ varying mediump vec2 xlv_TEXCOORD0; void main () { mediump vec2 tmpvar_1; - highp vec2 tmpvar_2; - tmpvar_2 = ((_glesMultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - tmpvar_1 = tmpvar_2; + tmpvar_1 = ((_glesMultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); gl_Position = (glstate_matrix_mvp * _glesVertex); xlv_COLOR = _glesColor; xlv_TEXCOORD0 = tmpvar_1; } -// inputs: 3, stats: 3 alu 0 tex 0 flow +// stats: 3 alu 0 tex 0 flow +// inputs: 3 +// #0: _glesVertex (high float) 4x1 [-1] +// #1: _glesMultiTexCoord0 (high float) 4x1 [-1] +// #2: _glesColor (low float) 4x1 [-1] +// uniforms: 2 (total size: 0) +// #0: _MainTex_ST (high float) 4x1 [-1] +// #1: glstate_matrix_mvp (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-inES3.txt b/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-inES3.txt new file mode 100644 index 000000000..26fc73118 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-inES3.txt @@ -0,0 +1,45 @@ +#version 300 es + +struct v2f { + highp vec4 pos; + highp vec4 uv; + highp vec3 ray; +}; +struct appdata { + highp vec4 vertex; + highp vec3 normal; +}; +uniform highp vec4 _ProjectionParams; +uniform highp mat4 glstate_matrix_modelview0; +uniform highp mat4 glstate_matrix_mvp; +highp vec4 ComputeScreenPos( in highp vec4 pos ); +v2f xlat_main( in appdata v ); +highp vec4 ComputeScreenPos( in highp vec4 pos ) { + highp vec4 o; + o = (pos * 0.500000); + o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w ); + o.zw = pos.zw ; + return o; +} +v2f xlat_main( in appdata v ) { + v2f o; + o.pos = ( glstate_matrix_mvp * v.vertex ); + o.uv = ComputeScreenPos( o.pos); + o.ray = (( glstate_matrix_modelview0 * v.vertex ).xyz * vec3( -1.00000, -1.00000, 1.00000)); + o.ray = mix( o.ray, v.normal, vec3( float( (v.normal.z != 0.000000) ))); + return o; +} +in highp vec4 _vertex; +in highp vec3 _normal; +out highp vec4 xlv_TEXCOORD0; +out highp vec3 xlv_TEXCOORD1; +void main() { + v2f xl_retval; + appdata xlt_v; + xlt_v.vertex = _vertex; + xlt_v.normal = _normal; + xl_retval = xlat_main( xlt_v); + gl_Position = vec4( xl_retval.pos); + xlv_TEXCOORD0 = vec4( xl_retval.uv); + xlv_TEXCOORD1 = vec3( xl_retval.ray); +} diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-ir.txt deleted file mode 100644 index a39de35fe..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-ir.txt +++ /dev/null @@ -1,96 +0,0 @@ -struct v2f { - vec4 pos; - vec4 uv; - vec3 ray; -}; -struct appdata { - vec4 vertex; - vec3 normal; -}; -uniform vec4 _ProjectionParams; -uniform mat4 glstate_matrix_modelview0; -uniform mat4 glstate_matrix_mvp; -varying vec4 xlv_TEXCOORD0; -varying vec3 xlv_TEXCOORD1; -vec4 ComputeScreenPos ( - in vec4 pos_1 -) -{ - vec4 o_2; - vec4 tmpvar_3; - tmpvar_3 = (pos_1 * 0.5); - o_2 = tmpvar_3; - vec2 tmpvar_4; - tmpvar_4.x = o_2.x; - tmpvar_4.y = (o_2.y * _ProjectionParams.x); - vec2 tmpvar_5; - tmpvar_5 = (tmpvar_4 + o_2.w); - o_2.xy = tmpvar_5.xy.xy; - vec2 tmpvar_6; - tmpvar_6 = pos_1.zw; - o_2.zw = tmpvar_6.xxxy.zw; - return o_2; -} - -v2f xlat_main ( - in appdata v_7 -) -{ - v2f o_8; - vec4 tmpvar_9; - tmpvar_9 = (glstate_matrix_mvp * v_7.vertex); - o_8.pos = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10 = ComputeScreenPos (o_8.pos); - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - o_8.uv = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = ((glstate_matrix_modelview0 * v_7.vertex).xyz * vec3(-1.0, -1.0, 1.0)); - o_8.ray = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13 = vec3(float((v_7.normal.z != 0.0))); - vec3 tmpvar_14; - tmpvar_14 = mix (o_8.ray, v_7.normal, tmpvar_13); - vec3 tmpvar_15; - tmpvar_15 = tmpvar_14; - o_8.ray = tmpvar_15; - return o_8; -} - -void main () -{ - appdata xlt_v_16; - v2f xl_retval_17; - vec4 tmpvar_18; - tmpvar_18 = gl_Vertex.xyzw; - vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - xlt_v_16.vertex = tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = gl_Normal.xyz; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_20; - xlt_v_16.normal = tmpvar_21; - v2f tmpvar_22; - tmpvar_22 = xlat_main (xlt_v_16); - v2f tmpvar_23; - tmpvar_23 = tmpvar_22; - xl_retval_17 = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = xl_retval_17.pos.xyzw; - vec4 tmpvar_25; - tmpvar_25 = tmpvar_24; - gl_Position = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = xl_retval_17.uv.xyzw; - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - xlv_TEXCOORD0 = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = xl_retval_17.ray.xyz; - vec3 tmpvar_29; - tmpvar_29 = tmpvar_28; - xlv_TEXCOORD1 = tmpvar_29; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-irES.txt b/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-irES.txt deleted file mode 100644 index 2a564f28b..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-irES.txt +++ /dev/null @@ -1,101 +0,0 @@ -struct v2f { - highp vec4 pos; - highp vec4 uv; - highp vec3 ray; -}; -struct appdata { - highp vec4 vertex; - highp vec3 normal; -}; -attribute highp vec4 _glesVertex; -attribute mediump vec3 _glesNormal; -attribute highp vec4 _glesMultiTexCoord0; -attribute highp vec4 _glesMultiTexCoord1; -attribute lowp vec4 _glesColor; -uniform highp vec4 _ProjectionParams; -uniform highp mat4 glstate_matrix_modelview0; -uniform highp mat4 glstate_matrix_mvp; -varying highp vec4 xlv_TEXCOORD0; -varying highp vec3 xlv_TEXCOORD1; -vec4 ComputeScreenPos ( - in highp vec4 pos_1 -) -{ - highp vec4 o_2; - highp vec4 tmpvar_3; - tmpvar_3 = (pos_1 * 0.5); - o_2 = tmpvar_3; - highp vec2 tmpvar_4; - tmpvar_4.x = o_2.x; - tmpvar_4.y = (o_2.y * _ProjectionParams.x); - highp vec2 tmpvar_5; - tmpvar_5 = (tmpvar_4 + o_2.w); - o_2.xy = tmpvar_5.xy.xy; - highp vec2 tmpvar_6; - tmpvar_6 = pos_1.zw; - o_2.zw = tmpvar_6.xxxy.zw; - return o_2; -} - -v2f xlat_main ( - in appdata v_7 -) -{ - v2f o_8; - highp vec4 tmpvar_9; - tmpvar_9 = (glstate_matrix_mvp * v_7.vertex); - o_8.pos = tmpvar_9; - highp vec4 tmpvar_10; - tmpvar_10 = ComputeScreenPos (o_8.pos); - highp vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - o_8.uv = tmpvar_11; - highp vec3 tmpvar_12; - tmpvar_12 = ((glstate_matrix_modelview0 * v_7.vertex).xyz * vec3(-1.0, -1.0, 1.0)); - o_8.ray = tmpvar_12; - highp vec3 tmpvar_13; - tmpvar_13 = vec3(float((v_7.normal.z != 0.0))); - highp vec3 tmpvar_14; - tmpvar_14 = mix (o_8.ray, v_7.normal, tmpvar_13); - highp vec3 tmpvar_15; - tmpvar_15 = tmpvar_14; - o_8.ray = tmpvar_15; - return o_8; -} - -void main () -{ - appdata xlt_v_16; - v2f xl_retval_17; - highp vec4 tmpvar_18; - tmpvar_18 = _glesVertex.xyzw; - highp vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - xlt_v_16.vertex = tmpvar_19; - mediump vec3 tmpvar_20; - tmpvar_20 = _glesNormal.xyz; - mediump vec3 tmpvar_21; - tmpvar_21 = tmpvar_20; - xlt_v_16.normal = tmpvar_21; - v2f tmpvar_22; - tmpvar_22 = xlat_main (xlt_v_16); - v2f tmpvar_23; - tmpvar_23 = tmpvar_22; - xl_retval_17 = tmpvar_23; - highp vec4 tmpvar_24; - tmpvar_24 = xl_retval_17.pos.xyzw; - highp vec4 tmpvar_25; - tmpvar_25 = tmpvar_24; - gl_Position = tmpvar_25; - highp vec4 tmpvar_26; - tmpvar_26 = xl_retval_17.uv.xyzw; - highp vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - xlv_TEXCOORD0 = tmpvar_27; - highp vec3 tmpvar_28; - tmpvar_28 = xl_retval_17.ray.xyz; - highp vec3 tmpvar_29; - tmpvar_29 = tmpvar_28; - xlv_TEXCOORD1 = tmpvar_29; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-out.txt b/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-out.txt index e9a275f18..28d6a1074 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-out.txt @@ -6,19 +6,30 @@ varying vec3 xlv_TEXCOORD1; void main () { vec4 tmpvar_1; + vec3 tmpvar_2; tmpvar_1 = (glstate_matrix_mvp * gl_Vertex); - vec4 o_2; - vec4 tmpvar_3; - tmpvar_3 = (tmpvar_1 * 0.5); + vec4 o_3; + o_3 = (tmpvar_1 * 0.5); vec2 tmpvar_4; - tmpvar_4.x = tmpvar_3.x; - tmpvar_4.y = (tmpvar_3.y * _ProjectionParams.x); - o_2.xy = (tmpvar_4 + tmpvar_3.w); - o_2.zw = tmpvar_1.zw; + tmpvar_4.x = o_3.x; + tmpvar_4.y = (o_3.y * _ProjectionParams.x); + o_3.xy = (tmpvar_4 + o_3.w); + o_3.zw = tmpvar_1.zw; + tmpvar_2 = ((glstate_matrix_modelview0 * gl_Vertex).xyz * vec3(-1.0, -1.0, 1.0)); + vec3 tmpvar_5; + tmpvar_5 = mix (tmpvar_2, gl_Normal, vec3(float((gl_Normal.z != 0.0)))); + tmpvar_2 = tmpvar_5; gl_Position = tmpvar_1; - xlv_TEXCOORD0 = o_2; - xlv_TEXCOORD1 = mix (((glstate_matrix_modelview0 * gl_Vertex).xyz * vec3(-1.0, -1.0, 1.0)), gl_Normal, vec3(float((gl_Normal.z != 0.0)))); + xlv_TEXCOORD0 = o_3; + xlv_TEXCOORD1 = tmpvar_5; } -// inputs: 2, stats: 9 alu 0 tex 0 flow +// stats: 9 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_Normal (high float) 3x1 [-1] loc 2 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 3 (total size: 0) +// #0: _ProjectionParams (high float) 4x1 [-1] +// #1: glstate_matrix_modelview0 (high float) 4x4 [-1] +// #2: glstate_matrix_mvp (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES.txt b/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES.txt index 53930262c..10e772db2 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES.txt @@ -10,19 +10,30 @@ void main () highp vec3 tmpvar_1; tmpvar_1 = _glesNormal; highp vec4 tmpvar_2; + highp vec3 tmpvar_3; tmpvar_2 = (glstate_matrix_mvp * _glesVertex); - highp vec4 o_3; - highp vec4 tmpvar_4; - tmpvar_4 = (tmpvar_2 * 0.5); + highp vec4 o_4; + o_4 = (tmpvar_2 * 0.5); highp vec2 tmpvar_5; - tmpvar_5.x = tmpvar_4.x; - tmpvar_5.y = (tmpvar_4.y * _ProjectionParams.x); - o_3.xy = (tmpvar_5 + tmpvar_4.w); - o_3.zw = tmpvar_2.zw; + tmpvar_5.x = o_4.x; + tmpvar_5.y = (o_4.y * _ProjectionParams.x); + o_4.xy = (tmpvar_5 + o_4.w); + o_4.zw = tmpvar_2.zw; + tmpvar_3 = ((glstate_matrix_modelview0 * _glesVertex).xyz * vec3(-1.0, -1.0, 1.0)); + highp vec3 tmpvar_6; + tmpvar_6 = mix (tmpvar_3, tmpvar_1, vec3(float((tmpvar_1.z != 0.0)))); + tmpvar_3 = tmpvar_6; gl_Position = tmpvar_2; - xlv_TEXCOORD0 = o_3; - xlv_TEXCOORD1 = mix (((glstate_matrix_modelview0 * _glesVertex).xyz * vec3(-1.0, -1.0, 1.0)), tmpvar_1, vec3(float((tmpvar_1.z != 0.0)))); + xlv_TEXCOORD0 = o_4; + xlv_TEXCOORD1 = tmpvar_6; } -// inputs: 2, stats: 9 alu 0 tex 0 flow +// stats: 9 alu 0 tex 0 flow +// inputs: 2 +// #0: _glesVertex (high float) 4x1 [-1] +// #1: _glesNormal (medium float) 3x1 [-1] +// uniforms: 3 (total size: 0) +// #0: _ProjectionParams (high float) 4x1 [-1] +// #1: glstate_matrix_modelview0 (high float) 4x4 [-1] +// #2: glstate_matrix_mvp (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES3.txt b/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES3.txt new file mode 100644 index 000000000..78f4982f8 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES3.txt @@ -0,0 +1,38 @@ +#version 300 es +uniform highp vec4 _ProjectionParams; +uniform highp mat4 glstate_matrix_modelview0; +uniform highp mat4 glstate_matrix_mvp; +in highp vec4 _vertex; +in highp vec3 _normal; +out highp vec4 xlv_TEXCOORD0; +out highp vec3 xlv_TEXCOORD1; +void main () +{ + highp vec4 tmpvar_1; + highp vec3 tmpvar_2; + tmpvar_1 = (glstate_matrix_mvp * _vertex); + highp vec4 o_3; + o_3 = (tmpvar_1 * 0.5); + highp vec2 tmpvar_4; + tmpvar_4.x = o_3.x; + tmpvar_4.y = (o_3.y * _ProjectionParams.x); + o_3.xy = (tmpvar_4 + o_3.w); + o_3.zw = tmpvar_1.zw; + tmpvar_2 = ((glstate_matrix_modelview0 * _vertex).xyz * vec3(-1.0, -1.0, 1.0)); + highp vec3 tmpvar_5; + tmpvar_5 = mix (tmpvar_2, _normal, vec3(float((_normal.z != 0.0)))); + tmpvar_2 = tmpvar_5; + gl_Position = tmpvar_1; + xlv_TEXCOORD0 = o_3; + xlv_TEXCOORD1 = tmpvar_5; +} + + +// stats: 9 alu 0 tex 0 flow +// inputs: 2 +// #0: _vertex (high float) 4x1 [-1] +// #1: _normal (high float) 3x1 [-1] +// uniforms: 3 (total size: 0) +// #0: _ProjectionParams (high float) 4x1 [-1] +// #1: glstate_matrix_modelview0 (high float) 4x4 [-1] +// #2: glstate_matrix_mvp (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES3Metal.txt new file mode 100644 index 000000000..a6f6f5c03 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES3Metal.txt @@ -0,0 +1,48 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float4 _vertex [[attribute(0)]]; + float3 _normal [[attribute(1)]]; +}; +struct xlatMtlShaderOutput { + float4 gl_Position [[position]]; + float4 xlv_TEXCOORD0; + float3 xlv_TEXCOORD1; +}; +struct xlatMtlShaderUniform { + float4 _ProjectionParams; + float4x4 glstate_matrix_modelview0; + float4x4 glstate_matrix_mvp; +}; +vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + float4 tmpvar_1; + float3 tmpvar_2; + tmpvar_1 = (_mtl_u.glstate_matrix_mvp * _mtl_i._vertex); + float4 o_3; + o_3 = (tmpvar_1 * 0.5); + float2 tmpvar_4; + tmpvar_4.x = o_3.x; + tmpvar_4.y = (o_3.y * _mtl_u._ProjectionParams.x); + o_3.xy = (tmpvar_4 + o_3.w); + o_3.zw = tmpvar_1.zw; + tmpvar_2 = ((_mtl_u.glstate_matrix_modelview0 * _mtl_i._vertex).xyz * float3(-1.0, -1.0, 1.0)); + float3 tmpvar_5; + tmpvar_5 = mix (tmpvar_2, _mtl_i._normal, float3(float((_mtl_i._normal.z != 0.0)))); + tmpvar_2 = tmpvar_5; + _mtl_o.gl_Position = tmpvar_1; + _mtl_o.xlv_TEXCOORD0 = o_3; + _mtl_o.xlv_TEXCOORD1 = tmpvar_5; + return _mtl_o; +} + + +// stats: 9 alu 0 tex 0 flow +// inputs: 2 +// #0: _vertex (high float) 4x1 [-1] loc 0 +// #1: _normal (high float) 3x1 [-1] loc 1 +// uniforms: 3 (total size: 144) +// #0: _ProjectionParams (high float) 4x1 [-1] loc 0 +// #1: glstate_matrix_modelview0 (high float) 4x4 [-1] loc 16 +// #2: glstate_matrix_mvp (high float) 4x4 [-1] loc 80 diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-inES3.txt b/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-inES3.txt new file mode 100644 index 000000000..93eef9f96 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-inES3.txt @@ -0,0 +1,155 @@ +#version 300 es + +struct appdata_full { + highp vec4 vertex; + highp vec4 tangent; + highp vec3 normal; + highp vec4 texcoord; + highp vec4 texcoord1; + highp vec4 color; +}; +struct v2f_surf { + highp vec4 pos; + highp vec2 hip_pack0; + highp vec4 lop_color; + highp vec3 lightDir; + highp vec3 viewDir; + highp vec2 _LightCoord; +}; +uniform highp mat4 _LightMatrix0; +uniform highp vec4 _MainTex_ST; +uniform highp mat4 _Object2World; +uniform highp vec4 _Scale; +uniform highp float _SquashAmount; +uniform highp vec4 _SquashPlaneNormal; +uniform highp vec4 _Time; +uniform highp vec4 _Wind; +uniform highp mat4 _World2Object; +uniform highp vec3 _WorldSpaceCameraPos; +uniform highp vec4 _WorldSpaceLightPos0; +uniform highp mat4 glstate_matrix_invtrans_modelview0; +uniform highp mat4 glstate_matrix_mvp; +uniform highp vec4 unity_Scale; +highp vec4 Squash( in highp vec4 pos ); +void ExpandBillboard( in highp mat4 mat, inout highp vec4 pos, inout highp vec3 normal, inout highp vec4 tangent ); +highp vec4 TriangleWave( in highp vec4 x ); +highp vec4 SmoothCurve( in highp vec4 x ); +highp vec4 SmoothTriangleWave( in highp vec4 x ); +highp vec4 AnimateVertex( in highp vec4 pos, in highp vec3 normal, in highp vec4 animParams ); +void TreeVertLeaf( inout appdata_full v ); +highp vec3 ObjSpaceViewDir( in highp vec4 v ); +highp vec3 ObjSpaceLightDir( in highp vec4 v ); +v2f_surf xlat_main( in appdata_full v ); +highp vec4 Squash( in highp vec4 pos ) { + highp vec3 planeNormal; + highp vec3 projectedVertex; + planeNormal = _SquashPlaneNormal.xyz ; + projectedVertex = (pos.xyz - ((dot( planeNormal, vec3( pos)) + _SquashPlaneNormal.w ) * planeNormal)); + pos = vec4( mix( projectedVertex, pos.xyz , vec3( _SquashAmount)), 1.00000); + return pos; +} +void ExpandBillboard( in highp mat4 mat, inout highp vec4 pos, inout highp vec3 normal, inout highp vec4 tangent ) { + highp float isBillboard; + highp vec3 norb; + highp vec3 tanb; + isBillboard = (1.00000 - abs( tangent.w )); + norb = vec3( normalize( ( vec4( normal, 0.000000) * mat ) )); + tanb = vec3( normalize( ( vec4( tangent.xyz , 0.000000) * mat ) )); + pos += (( vec4( normal.xy , 0.000000, 0.000000) * mat ) * isBillboard); + normal = mix( normal, norb, vec3( isBillboard)); + tangent = mix( tangent, vec4( tanb, -1.00000), vec4( isBillboard)); +} +highp vec4 TriangleWave( in highp vec4 x ) { + return abs( ((fract( (x + 0.500000) ) * 2.00000) - 1.00000) ); +} +highp vec4 SmoothCurve( in highp vec4 x ) { + return ((x * x) * (3.00000 - (2.00000 * x))); +} +highp vec4 SmoothTriangleWave( in highp vec4 x ) { + return SmoothCurve( TriangleWave( x)); +} +highp vec4 AnimateVertex( in highp vec4 pos, in highp vec3 normal, in highp vec4 animParams ) { + highp float fDetailAmp = 0.100000; + highp float fBranchAmp = 0.300000; + highp float fObjPhase; + highp float fBranchPhase; + highp float fVtxPhase; + highp vec2 vWavesIn; + highp vec4 vWaves; + highp vec2 vWavesSum; + highp vec3 bend; + fObjPhase = dot( _Object2World[ 3 ].xyz , vec3( 1.00000)); + fBranchPhase = (fObjPhase + animParams.x ); + fVtxPhase = dot( pos.xyz , vec3( (animParams.y + fBranchPhase))); + vWavesIn = (_Time.yy + vec2( fVtxPhase, fBranchPhase)); + vWaves = ((fract( (vWavesIn.xxyy * vec4( 1.97500, 0.793000, 0.375000, 0.193000)) ) * 2.00000) - 1.00000); + vWaves = SmoothTriangleWave( vWaves); + vWavesSum = (vWaves.xz + vWaves.yw ); + bend = ((animParams.y * fDetailAmp) * normal.xyz ); + bend.y = (animParams.w * fBranchAmp); + pos.xyz += (((vWavesSum.xyx * bend) + ((_Wind.xyz * vWavesSum.y ) * animParams.w )) * _Wind.w ); + pos.xyz += (animParams.z * _Wind.xyz ); + return pos; +} +void TreeVertLeaf( inout appdata_full v ) { + ExpandBillboard( glstate_matrix_invtrans_modelview0, v.vertex, v.normal, v.tangent); + v.vertex.xyz *= _Scale.xyz ; + v.vertex = AnimateVertex( v.vertex, v.normal, vec4( v.color.xy , v.texcoord1.xy )); + v.vertex = Squash( v.vertex); + v.color = vec4( 1.00000, 1.00000, 1.00000, v.color.w ); + v.normal = normalize( v.normal ); + v.tangent.xyz = normalize( v.tangent.xyz ); +} +highp vec3 ObjSpaceViewDir( in highp vec4 v ) { + highp vec3 objSpaceCameraPos; + objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w ); + return (objSpaceCameraPos - v.xyz ); +} +highp vec3 ObjSpaceLightDir( in highp vec4 v ) { + highp vec3 objSpaceLightPos; + objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ; + return objSpaceLightPos.xyz ; +} +v2f_surf xlat_main( in appdata_full v ) { + v2f_surf o; + highp vec3 binormal; + highp mat3 rotation; + TreeVertLeaf( v); + o.pos = ( glstate_matrix_mvp * v.vertex ); + o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw ); + o.lop_color = v.color; + binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w ); + rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z ); + o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) ); + o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) ); + o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) ).xy ; + return o; +} +in highp vec4 _inVertex; +in mediump vec3 _inNormal; +in highp vec4 _uv0; +in highp vec4 _uv1; +in lowp vec4 _color; +in mediump vec4 TANGENT; +out highp vec2 xlv_TEXCOORD0; +out lowp vec4 xlv_COLOR0; +out mediump vec3 xlv_TEXCOORD1; +out mediump vec3 xlv_TEXCOORD2; +out mediump vec2 xlv_TEXCOORD3; +void main() { + v2f_surf xl_retval; + appdata_full xlt_v; + xlt_v.vertex = _inVertex; + xlt_v.tangent = vec4( TANGENT); + xlt_v.normal = _inNormal; + xlt_v.texcoord = _uv0; + xlt_v.texcoord1 = _uv1; + xlt_v.color = _color; + xl_retval = xlat_main( xlt_v); + gl_Position = vec4( xl_retval.pos); + xlv_TEXCOORD0 = vec2( xl_retval.hip_pack0); + xlv_COLOR0 = vec4( xl_retval.lop_color); + xlv_TEXCOORD1 = vec3( xl_retval.lightDir); + xlv_TEXCOORD2 = vec3( xl_retval.viewDir); + xlv_TEXCOORD3 = vec2( xl_retval._LightCoord); +} diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-ir.txt deleted file mode 100644 index 6dc063e52..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-ir.txt +++ /dev/null @@ -1,432 +0,0 @@ -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - vec2 hip_pack0; - vec4 lop_color; - vec3 lightDir; - vec3 viewDir; - vec2 _LightCoord; -}; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _Scale; -uniform float _SquashAmount; -uniform vec4 _SquashPlaneNormal; -uniform vec4 _Time; -uniform vec4 _Wind; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 glstate_matrix_invtrans_modelview0; -uniform mat4 glstate_matrix_mvp; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec2 xlv_TEXCOORD0; -varying vec4 xlv_COLOR0; -varying vec3 xlv_TEXCOORD1; -varying vec3 xlv_TEXCOORD2; -varying vec2 xlv_TEXCOORD3; -vec4 Squash ( - in vec4 pos_1 -) -{ - vec3 projectedVertex_2; - vec3 planeNormal_3; - vec3 tmpvar_4; - tmpvar_4 = _SquashPlaneNormal.xyz; - planeNormal_3 = tmpvar_4; - vec3 tmpvar_5; - tmpvar_5 = pos_1.xyz; - float tmpvar_6; - tmpvar_6 = dot (planeNormal_3, tmpvar_5); - vec3 tmpvar_7; - tmpvar_7 = (pos_1.xyz - ((tmpvar_6 + _SquashPlaneNormal.w) * planeNormal_3)); - projectedVertex_2 = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = vec3(_SquashAmount); - vec3 tmpvar_9; - tmpvar_9 = mix (projectedVertex_2, pos_1.xyz, tmpvar_8); - vec4 tmpvar_10; - tmpvar_10.w = 1.0; - tmpvar_10.xyz = tmpvar_9.xyz; - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - pos_1 = tmpvar_11; - return pos_1; -} - -void ExpandBillboard ( - in mat4 mat_12, - inout vec4 pos_13, - inout vec3 normal_14, - inout vec4 tangent_15 -) -{ - vec3 tanb_16; - vec3 norb_17; - float isBillboard_18; - float tmpvar_19; - tmpvar_19 = abs (tangent_15.w); - float tmpvar_20; - tmpvar_20 = (1.0 - tmpvar_19); - isBillboard_18 = tmpvar_20; - vec4 tmpvar_21; - tmpvar_21.w = 0.0; - tmpvar_21.xyz = normal_14.xyz; - vec4 tmpvar_22; - tmpvar_22 = normalize ((tmpvar_21 * mat_12)); - vec3 tmpvar_23; - tmpvar_23 = tmpvar_22.xyz; - vec3 tmpvar_24; - tmpvar_24 = tmpvar_23; - norb_17 = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25.w = 0.0; - tmpvar_25.xyz = tangent_15.xyz.xyz; - vec4 tmpvar_26; - tmpvar_26 = normalize ((tmpvar_25 * mat_12)); - vec3 tmpvar_27; - tmpvar_27 = tmpvar_26.xyz; - vec3 tmpvar_28; - tmpvar_28 = tmpvar_27; - tanb_16 = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29.zw = vec2(0.0, 0.0); - tmpvar_29.xy = normal_14.xy.xy; - vec4 tmpvar_30; - tmpvar_30 = (pos_13 + ((tmpvar_29 * mat_12) * isBillboard_18)); - pos_13 = tmpvar_30; - vec3 tmpvar_31; - tmpvar_31 = vec3(isBillboard_18); - vec3 tmpvar_32; - tmpvar_32 = mix (normal_14, norb_17, tmpvar_31); - vec3 tmpvar_33; - tmpvar_33 = tmpvar_32; - normal_14 = tmpvar_33; - vec4 tmpvar_34; - tmpvar_34.w = -1.0; - tmpvar_34.xyz = tanb_16.xyz; - vec4 tmpvar_35; - tmpvar_35 = vec4(isBillboard_18); - vec4 tmpvar_36; - tmpvar_36 = mix (tangent_15, tmpvar_34, tmpvar_35); - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - tangent_15 = tmpvar_37; -} - -vec4 TriangleWave ( - in vec4 x_38 -) -{ - vec4 tmpvar_39; - tmpvar_39 = fract ((x_38 + 0.5)); - vec4 tmpvar_40; - tmpvar_40 = abs (((tmpvar_39 * 2.0) - 1.0)); - return tmpvar_40; -} - -vec4 SmoothCurve ( - in vec4 x_41 -) -{ - return ((x_41 * x_41) * (3.0 - (2.0 * x_41))); -} - -vec4 SmoothTriangleWave ( - in vec4 x_42 -) -{ - vec4 tmpvar_43; - tmpvar_43 = TriangleWave (x_42); - vec4 tmpvar_44; - tmpvar_44 = SmoothCurve (tmpvar_43); - return tmpvar_44; -} - -vec4 AnimateVertex ( - in vec4 pos_45, - in vec3 normal_46, - in vec4 animParams_47 -) -{ - vec3 bend_48; - vec2 vWavesSum_49; - vec4 vWaves_50; - vec2 vWavesIn_51; - float fVtxPhase_52; - float fBranchPhase_53; - float fObjPhase_54; - float fBranchAmp_55; - float fDetailAmp_56; - float tmpvar_57; - tmpvar_57 = 0.1; - fDetailAmp_56 = tmpvar_57; - float tmpvar_58; - tmpvar_58 = 0.3; - fBranchAmp_55 = tmpvar_58; - float tmpvar_59; - tmpvar_59 = dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)); - float tmpvar_60; - tmpvar_60 = tmpvar_59; - fObjPhase_54 = tmpvar_60; - float tmpvar_61; - tmpvar_61 = (fObjPhase_54 + animParams_47.x); - fBranchPhase_53 = tmpvar_61; - vec3 tmpvar_62; - tmpvar_62 = vec3((animParams_47.y + fBranchPhase_53)); - float tmpvar_63; - tmpvar_63 = dot (pos_45.xyz, tmpvar_62); - float tmpvar_64; - tmpvar_64 = tmpvar_63; - fVtxPhase_52 = tmpvar_64; - vec2 tmpvar_65; - tmpvar_65.x = fVtxPhase_52; - tmpvar_65.y = fBranchPhase_53; - vec2 tmpvar_66; - tmpvar_66 = (_Time.yy + tmpvar_65); - vWavesIn_51 = tmpvar_66; - vec4 tmpvar_67; - tmpvar_67 = fract ((vWavesIn_51.xxyy * vec4(1.975, 0.793, 0.375, 0.193))); - vec4 tmpvar_68; - tmpvar_68 = ((tmpvar_67 * 2.0) - 1.0); - vWaves_50 = tmpvar_68; - vec4 tmpvar_69; - tmpvar_69 = SmoothTriangleWave (vWaves_50); - vec4 tmpvar_70; - tmpvar_70 = tmpvar_69; - vWaves_50 = tmpvar_70; - vec2 tmpvar_71; - tmpvar_71 = (vWaves_50.xz + vWaves_50.yw); - vWavesSum_49 = tmpvar_71; - vec3 tmpvar_72; - tmpvar_72 = ((animParams_47.y * fDetailAmp_56) * normal_46.xyz); - bend_48 = tmpvar_72; - float tmpvar_73; - tmpvar_73 = (animParams_47.w * fBranchAmp_55); - bend_48.y = vec2(tmpvar_73).y; - vec3 tmpvar_74; - tmpvar_74 = (pos_45.xyz + (( - (vWavesSum_49.xyx * bend_48) - + - ((_Wind.xyz * vWavesSum_49.y) * animParams_47.w) - ) * _Wind.w)); - pos_45.xyz = tmpvar_74.xyz.xyz; - vec3 tmpvar_75; - tmpvar_75 = (pos_45.xyz + (animParams_47.z * _Wind.xyz)); - pos_45.xyz = tmpvar_75.xyz.xyz; - return pos_45; -} - -void TreeVertLeaf ( - inout appdata_full v_76 -) -{ - ExpandBillboard (glstate_matrix_invtrans_modelview0, v_76.vertex, v_76.normal, v_76.tangent); - vec3 tmpvar_77; - tmpvar_77 = (v_76.vertex.xyz * _Scale.xyz); - v_76.vertex.xyz = tmpvar_77.xyz.xyz; - vec4 tmpvar_78; - tmpvar_78.xy = v_76.color.xy.xy; - tmpvar_78.zw = v_76.texcoord1.xy.xy; - vec4 tmpvar_79; - tmpvar_79 = AnimateVertex (v_76.vertex, v_76.normal, tmpvar_78); - vec4 tmpvar_80; - tmpvar_80 = tmpvar_79; - v_76.vertex = tmpvar_80; - vec4 tmpvar_81; - tmpvar_81 = Squash (v_76.vertex); - vec4 tmpvar_82; - tmpvar_82 = tmpvar_81; - v_76.vertex = tmpvar_82; - vec4 tmpvar_83; - tmpvar_83.xyz = vec3(1.0, 1.0, 1.0); - tmpvar_83.w = v_76.color.w; - vec4 tmpvar_84; - tmpvar_84 = tmpvar_83; - v_76.color = tmpvar_84; - vec3 tmpvar_85; - tmpvar_85 = normalize (v_76.normal); - vec3 tmpvar_86; - tmpvar_86 = tmpvar_85; - v_76.normal = tmpvar_86; - vec3 tmpvar_87; - tmpvar_87 = normalize (v_76.tangent.xyz); - vec3 tmpvar_88; - tmpvar_88 = tmpvar_87; - v_76.tangent.xyz = tmpvar_88.xyz.xyz; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_89 -) -{ - vec3 objSpaceCameraPos_90; - vec4 tmpvar_91; - tmpvar_91.w = 1.0; - tmpvar_91.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_92; - tmpvar_92 = ((_World2Object * tmpvar_91).xyz * unity_Scale.w); - objSpaceCameraPos_90 = tmpvar_92; - return (objSpaceCameraPos_90 - v_89.xyz); -} - -vec3 ObjSpaceLightDir ( - in vec4 v_93 -) -{ - vec3 objSpaceLightPos_94; - vec3 tmpvar_95; - tmpvar_95 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_94 = tmpvar_95; - return objSpaceLightPos_94.xyz; -} - -v2f_surf xlat_main ( - in appdata_full v_96 -) -{ - mat3 rotation_97; - vec3 binormal_98; - v2f_surf o_99; - TreeVertLeaf (v_96); - vec4 tmpvar_100; - tmpvar_100 = (glstate_matrix_mvp * v_96.vertex); - o_99.pos = tmpvar_100; - vec2 tmpvar_101; - tmpvar_101 = ((v_96.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_99.hip_pack0 = tmpvar_101.xy.xy; - vec4 tmpvar_102; - tmpvar_102 = v_96.color; - o_99.lop_color = tmpvar_102; - vec3 tmpvar_103; - tmpvar_103 = cross (v_96.normal, v_96.tangent.xyz); - vec3 tmpvar_104; - tmpvar_104 = (tmpvar_103 * v_96.tangent.w); - binormal_98 = tmpvar_104; - mat3 tmpvar_105; - float tmpvar_106; - tmpvar_106 = v_96.tangent.x; - tmpvar_105[0].x = tmpvar_106; - float tmpvar_107; - tmpvar_107 = binormal_98.x; - tmpvar_105[0].y = tmpvar_107; - float tmpvar_108; - tmpvar_108 = v_96.normal.x; - tmpvar_105[0].z = tmpvar_108; - float tmpvar_109; - tmpvar_109 = v_96.tangent.y; - tmpvar_105[1].x = tmpvar_109; - float tmpvar_110; - tmpvar_110 = binormal_98.y; - tmpvar_105[1].y = tmpvar_110; - float tmpvar_111; - tmpvar_111 = v_96.normal.y; - tmpvar_105[1].z = tmpvar_111; - float tmpvar_112; - tmpvar_112 = v_96.tangent.z; - tmpvar_105[2].x = tmpvar_112; - float tmpvar_113; - tmpvar_113 = binormal_98.z; - tmpvar_105[2].y = tmpvar_113; - float tmpvar_114; - tmpvar_114 = v_96.normal.z; - tmpvar_105[2].z = tmpvar_114; - mat3 tmpvar_115; - tmpvar_115 = tmpvar_105; - rotation_97 = tmpvar_115; - vec3 tmpvar_116; - tmpvar_116 = ObjSpaceLightDir (v_96.vertex); - vec3 tmpvar_117; - tmpvar_117 = (rotation_97 * tmpvar_116); - o_99.lightDir = tmpvar_117; - vec3 tmpvar_118; - tmpvar_118 = ObjSpaceViewDir (v_96.vertex); - vec3 tmpvar_119; - tmpvar_119 = (rotation_97 * tmpvar_118); - o_99.viewDir = tmpvar_119; - vec2 tmpvar_120; - tmpvar_120 = (_LightMatrix0 * (_Object2World * v_96.vertex)).xy; - o_99._LightCoord = tmpvar_120; - return o_99; -} - -void main () -{ - appdata_full xlt_v_121; - v2f_surf xl_retval_122; - vec4 tmpvar_123; - tmpvar_123 = gl_Vertex.xyzw; - vec4 tmpvar_124; - tmpvar_124 = tmpvar_123; - xlt_v_121.vertex = tmpvar_124; - vec4 tmpvar_125; - tmpvar_125 = TANGENT.xyzw; - vec4 tmpvar_126; - tmpvar_126 = tmpvar_125; - xlt_v_121.tangent = tmpvar_126; - vec3 tmpvar_127; - tmpvar_127 = gl_Normal.xyz; - vec3 tmpvar_128; - tmpvar_128 = tmpvar_127; - xlt_v_121.normal = tmpvar_128; - vec4 tmpvar_129; - tmpvar_129 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_130; - tmpvar_130 = tmpvar_129; - xlt_v_121.texcoord = tmpvar_130; - vec4 tmpvar_131; - tmpvar_131 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_132; - tmpvar_132 = tmpvar_131; - xlt_v_121.texcoord1 = tmpvar_132; - vec4 tmpvar_133; - tmpvar_133 = gl_Color.xyzw; - vec4 tmpvar_134; - tmpvar_134 = tmpvar_133; - xlt_v_121.color = tmpvar_134; - v2f_surf tmpvar_135; - tmpvar_135 = xlat_main (xlt_v_121); - v2f_surf tmpvar_136; - tmpvar_136 = tmpvar_135; - xl_retval_122 = tmpvar_136; - vec4 tmpvar_137; - tmpvar_137 = xl_retval_122.pos.xyzw; - vec4 tmpvar_138; - tmpvar_138 = tmpvar_137; - gl_Position = tmpvar_138; - vec2 tmpvar_139; - tmpvar_139 = xl_retval_122.hip_pack0.xy; - vec2 tmpvar_140; - tmpvar_140 = tmpvar_139; - xlv_TEXCOORD0 = tmpvar_140; - vec4 tmpvar_141; - tmpvar_141 = xl_retval_122.lop_color.xyzw; - vec4 tmpvar_142; - tmpvar_142 = tmpvar_141; - xlv_COLOR0 = tmpvar_142; - vec3 tmpvar_143; - tmpvar_143 = xl_retval_122.lightDir.xyz; - vec3 tmpvar_144; - tmpvar_144 = tmpvar_143; - xlv_TEXCOORD1 = tmpvar_144; - vec3 tmpvar_145; - tmpvar_145 = xl_retval_122.viewDir.xyz; - vec3 tmpvar_146; - tmpvar_146 = tmpvar_145; - xlv_TEXCOORD2 = tmpvar_146; - vec2 tmpvar_147; - tmpvar_147 = xl_retval_122._LightCoord.xy; - vec2 tmpvar_148; - tmpvar_148 = tmpvar_147; - xlv_TEXCOORD3 = tmpvar_148; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-irES.txt b/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-irES.txt deleted file mode 100644 index de058326e..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-irES.txt +++ /dev/null @@ -1,437 +0,0 @@ -struct appdata_full { - highp vec4 vertex; - highp vec4 tangent; - highp vec3 normal; - highp vec4 texcoord; - highp vec4 texcoord1; - highp vec4 color; -}; -struct v2f_surf { - highp vec4 pos; - highp vec2 hip_pack0; - highp vec4 lop_color; - highp vec3 lightDir; - highp vec3 viewDir; - highp vec2 _LightCoord; -}; -attribute highp vec4 _glesVertex; -attribute mediump vec3 _glesNormal; -attribute highp vec4 _glesMultiTexCoord0; -attribute highp vec4 _glesMultiTexCoord1; -attribute lowp vec4 _glesColor; -uniform highp mat4 _LightMatrix0; -uniform highp vec4 _MainTex_ST; -uniform highp mat4 _Object2World; -uniform highp vec4 _Scale; -uniform highp float _SquashAmount; -uniform highp vec4 _SquashPlaneNormal; -uniform highp vec4 _Time; -uniform highp vec4 _Wind; -uniform highp mat4 _World2Object; -uniform highp vec3 _WorldSpaceCameraPos; -uniform highp vec4 _WorldSpaceLightPos0; -uniform highp mat4 glstate_matrix_invtrans_modelview0; -uniform highp mat4 glstate_matrix_mvp; -uniform highp vec4 unity_Scale; -attribute vec4 TANGENT; -varying highp vec2 xlv_TEXCOORD0; -varying highp vec4 xlv_COLOR0; -varying highp vec3 xlv_TEXCOORD1; -varying highp vec3 xlv_TEXCOORD2; -varying highp vec2 xlv_TEXCOORD3; -vec4 Squash ( - in highp vec4 pos_1 -) -{ - highp vec3 projectedVertex_2; - highp vec3 planeNormal_3; - highp vec3 tmpvar_4; - tmpvar_4 = _SquashPlaneNormal.xyz; - planeNormal_3 = tmpvar_4; - highp vec3 tmpvar_5; - tmpvar_5 = pos_1.xyz; - highp float tmpvar_6; - tmpvar_6 = dot (planeNormal_3, tmpvar_5); - highp vec3 tmpvar_7; - tmpvar_7 = (pos_1.xyz - ((tmpvar_6 + _SquashPlaneNormal.w) * planeNormal_3)); - projectedVertex_2 = tmpvar_7; - highp vec3 tmpvar_8; - tmpvar_8 = vec3(_SquashAmount); - highp vec3 tmpvar_9; - tmpvar_9 = mix (projectedVertex_2, pos_1.xyz, tmpvar_8); - highp vec4 tmpvar_10; - tmpvar_10.w = 1.0; - tmpvar_10.xyz = tmpvar_9.xyz; - highp vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - pos_1 = tmpvar_11; - return pos_1; -} - -void ExpandBillboard ( - in highp mat4 mat_12, - inout highp vec4 pos_13, - inout highp vec3 normal_14, - inout highp vec4 tangent_15 -) -{ - highp vec3 tanb_16; - highp vec3 norb_17; - highp float isBillboard_18; - highp float tmpvar_19; - tmpvar_19 = abs (tangent_15.w); - highp float tmpvar_20; - tmpvar_20 = (1.0 - tmpvar_19); - isBillboard_18 = tmpvar_20; - highp vec4 tmpvar_21; - tmpvar_21.w = 0.0; - tmpvar_21.xyz = normal_14.xyz; - highp vec4 tmpvar_22; - tmpvar_22 = normalize ((tmpvar_21 * mat_12)); - highp vec3 tmpvar_23; - tmpvar_23 = tmpvar_22.xyz; - highp vec3 tmpvar_24; - tmpvar_24 = tmpvar_23; - norb_17 = tmpvar_24; - highp vec4 tmpvar_25; - tmpvar_25.w = 0.0; - tmpvar_25.xyz = tangent_15.xyz.xyz; - highp vec4 tmpvar_26; - tmpvar_26 = normalize ((tmpvar_25 * mat_12)); - highp vec3 tmpvar_27; - tmpvar_27 = tmpvar_26.xyz; - highp vec3 tmpvar_28; - tmpvar_28 = tmpvar_27; - tanb_16 = tmpvar_28; - highp vec4 tmpvar_29; - tmpvar_29.zw = vec2(0.0, 0.0); - tmpvar_29.xy = normal_14.xy.xy; - highp vec4 tmpvar_30; - tmpvar_30 = (pos_13 + ((tmpvar_29 * mat_12) * isBillboard_18)); - pos_13 = tmpvar_30; - highp vec3 tmpvar_31; - tmpvar_31 = vec3(isBillboard_18); - highp vec3 tmpvar_32; - tmpvar_32 = mix (normal_14, norb_17, tmpvar_31); - highp vec3 tmpvar_33; - tmpvar_33 = tmpvar_32; - normal_14 = tmpvar_33; - highp vec4 tmpvar_34; - tmpvar_34.w = -1.0; - tmpvar_34.xyz = tanb_16.xyz; - highp vec4 tmpvar_35; - tmpvar_35 = vec4(isBillboard_18); - highp vec4 tmpvar_36; - tmpvar_36 = mix (tangent_15, tmpvar_34, tmpvar_35); - highp vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - tangent_15 = tmpvar_37; -} - -vec4 TriangleWave ( - in highp vec4 x_38 -) -{ - highp vec4 tmpvar_39; - tmpvar_39 = fract ((x_38 + 0.5)); - highp vec4 tmpvar_40; - tmpvar_40 = abs (((tmpvar_39 * 2.0) - 1.0)); - return tmpvar_40; -} - -vec4 SmoothCurve ( - in highp vec4 x_41 -) -{ - return ((x_41 * x_41) * (3.0 - (2.0 * x_41))); -} - -vec4 SmoothTriangleWave ( - in highp vec4 x_42 -) -{ - highp vec4 tmpvar_43; - tmpvar_43 = TriangleWave (x_42); - highp vec4 tmpvar_44; - tmpvar_44 = SmoothCurve (tmpvar_43); - return tmpvar_44; -} - -vec4 AnimateVertex ( - in highp vec4 pos_45, - in highp vec3 normal_46, - in highp vec4 animParams_47 -) -{ - highp vec3 bend_48; - highp vec2 vWavesSum_49; - highp vec4 vWaves_50; - highp vec2 vWavesIn_51; - highp float fVtxPhase_52; - highp float fBranchPhase_53; - highp float fObjPhase_54; - highp float fBranchAmp_55; - highp float fDetailAmp_56; - float tmpvar_57; - tmpvar_57 = 0.1; - fDetailAmp_56 = tmpvar_57; - float tmpvar_58; - tmpvar_58 = 0.3; - fBranchAmp_55 = tmpvar_58; - highp float tmpvar_59; - tmpvar_59 = dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)); - highp float tmpvar_60; - tmpvar_60 = tmpvar_59; - fObjPhase_54 = tmpvar_60; - highp float tmpvar_61; - tmpvar_61 = (fObjPhase_54 + animParams_47.x); - fBranchPhase_53 = tmpvar_61; - highp vec3 tmpvar_62; - tmpvar_62 = vec3((animParams_47.y + fBranchPhase_53)); - highp float tmpvar_63; - tmpvar_63 = dot (pos_45.xyz, tmpvar_62); - highp float tmpvar_64; - tmpvar_64 = tmpvar_63; - fVtxPhase_52 = tmpvar_64; - highp vec2 tmpvar_65; - tmpvar_65.x = fVtxPhase_52; - tmpvar_65.y = fBranchPhase_53; - highp vec2 tmpvar_66; - tmpvar_66 = (_Time.yy + tmpvar_65); - vWavesIn_51 = tmpvar_66; - highp vec4 tmpvar_67; - tmpvar_67 = fract ((vWavesIn_51.xxyy * vec4(1.975, 0.793, 0.375, 0.193))); - highp vec4 tmpvar_68; - tmpvar_68 = ((tmpvar_67 * 2.0) - 1.0); - vWaves_50 = tmpvar_68; - highp vec4 tmpvar_69; - tmpvar_69 = SmoothTriangleWave (vWaves_50); - highp vec4 tmpvar_70; - tmpvar_70 = tmpvar_69; - vWaves_50 = tmpvar_70; - highp vec2 tmpvar_71; - tmpvar_71 = (vWaves_50.xz + vWaves_50.yw); - vWavesSum_49 = tmpvar_71; - highp vec3 tmpvar_72; - tmpvar_72 = ((animParams_47.y * fDetailAmp_56) * normal_46.xyz); - bend_48 = tmpvar_72; - highp float tmpvar_73; - tmpvar_73 = (animParams_47.w * fBranchAmp_55); - bend_48.y = vec2(tmpvar_73).y; - highp vec3 tmpvar_74; - tmpvar_74 = (pos_45.xyz + (( - (vWavesSum_49.xyx * bend_48) - + - ((_Wind.xyz * vWavesSum_49.y) * animParams_47.w) - ) * _Wind.w)); - pos_45.xyz = tmpvar_74.xyz.xyz; - highp vec3 tmpvar_75; - tmpvar_75 = (pos_45.xyz + (animParams_47.z * _Wind.xyz)); - pos_45.xyz = tmpvar_75.xyz.xyz; - return pos_45; -} - -void TreeVertLeaf ( - inout appdata_full v_76 -) -{ - ExpandBillboard (glstate_matrix_invtrans_modelview0, v_76.vertex, v_76.normal, v_76.tangent); - highp vec3 tmpvar_77; - tmpvar_77 = (v_76.vertex.xyz * _Scale.xyz); - v_76.vertex.xyz = tmpvar_77.xyz.xyz; - highp vec4 tmpvar_78; - tmpvar_78.xy = v_76.color.xy.xy; - tmpvar_78.zw = v_76.texcoord1.xy.xy; - highp vec4 tmpvar_79; - tmpvar_79 = AnimateVertex (v_76.vertex, v_76.normal, tmpvar_78); - highp vec4 tmpvar_80; - tmpvar_80 = tmpvar_79; - v_76.vertex = tmpvar_80; - highp vec4 tmpvar_81; - tmpvar_81 = Squash (v_76.vertex); - highp vec4 tmpvar_82; - tmpvar_82 = tmpvar_81; - v_76.vertex = tmpvar_82; - highp vec4 tmpvar_83; - tmpvar_83.xyz = vec3(1.0, 1.0, 1.0); - tmpvar_83.w = v_76.color.w; - highp vec4 tmpvar_84; - tmpvar_84 = tmpvar_83; - v_76.color = tmpvar_84; - highp vec3 tmpvar_85; - tmpvar_85 = normalize (v_76.normal); - highp vec3 tmpvar_86; - tmpvar_86 = tmpvar_85; - v_76.normal = tmpvar_86; - highp vec3 tmpvar_87; - tmpvar_87 = normalize (v_76.tangent.xyz); - highp vec3 tmpvar_88; - tmpvar_88 = tmpvar_87; - v_76.tangent.xyz = tmpvar_88.xyz.xyz; -} - -vec3 ObjSpaceViewDir ( - in highp vec4 v_89 -) -{ - highp vec3 objSpaceCameraPos_90; - highp vec4 tmpvar_91; - tmpvar_91.w = 1.0; - tmpvar_91.xyz = _WorldSpaceCameraPos.xyz.xyz; - highp vec3 tmpvar_92; - tmpvar_92 = ((_World2Object * tmpvar_91).xyz * unity_Scale.w); - objSpaceCameraPos_90 = tmpvar_92; - return (objSpaceCameraPos_90 - v_89.xyz); -} - -vec3 ObjSpaceLightDir ( - in highp vec4 v_93 -) -{ - highp vec3 objSpaceLightPos_94; - highp vec3 tmpvar_95; - tmpvar_95 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_94 = tmpvar_95; - return objSpaceLightPos_94.xyz; -} - -v2f_surf xlat_main ( - in appdata_full v_96 -) -{ - highp mat3 rotation_97; - highp vec3 binormal_98; - v2f_surf o_99; - TreeVertLeaf (v_96); - highp vec4 tmpvar_100; - tmpvar_100 = (glstate_matrix_mvp * v_96.vertex); - o_99.pos = tmpvar_100; - highp vec2 tmpvar_101; - tmpvar_101 = ((v_96.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_99.hip_pack0 = tmpvar_101.xy.xy; - highp vec4 tmpvar_102; - tmpvar_102 = v_96.color; - o_99.lop_color = tmpvar_102; - highp vec3 tmpvar_103; - tmpvar_103 = cross (v_96.normal, v_96.tangent.xyz); - highp vec3 tmpvar_104; - tmpvar_104 = (tmpvar_103 * v_96.tangent.w); - binormal_98 = tmpvar_104; - mat3 tmpvar_105; - float tmpvar_106; - tmpvar_106 = v_96.tangent.x; - tmpvar_105[0].x = tmpvar_106; - float tmpvar_107; - tmpvar_107 = binormal_98.x; - tmpvar_105[0].y = tmpvar_107; - float tmpvar_108; - tmpvar_108 = v_96.normal.x; - tmpvar_105[0].z = tmpvar_108; - float tmpvar_109; - tmpvar_109 = v_96.tangent.y; - tmpvar_105[1].x = tmpvar_109; - float tmpvar_110; - tmpvar_110 = binormal_98.y; - tmpvar_105[1].y = tmpvar_110; - float tmpvar_111; - tmpvar_111 = v_96.normal.y; - tmpvar_105[1].z = tmpvar_111; - float tmpvar_112; - tmpvar_112 = v_96.tangent.z; - tmpvar_105[2].x = tmpvar_112; - float tmpvar_113; - tmpvar_113 = binormal_98.z; - tmpvar_105[2].y = tmpvar_113; - float tmpvar_114; - tmpvar_114 = v_96.normal.z; - tmpvar_105[2].z = tmpvar_114; - mat3 tmpvar_115; - tmpvar_115 = tmpvar_105; - rotation_97 = tmpvar_115; - highp vec3 tmpvar_116; - tmpvar_116 = ObjSpaceLightDir (v_96.vertex); - highp vec3 tmpvar_117; - tmpvar_117 = (rotation_97 * tmpvar_116); - o_99.lightDir = tmpvar_117; - highp vec3 tmpvar_118; - tmpvar_118 = ObjSpaceViewDir (v_96.vertex); - highp vec3 tmpvar_119; - tmpvar_119 = (rotation_97 * tmpvar_118); - o_99.viewDir = tmpvar_119; - highp vec2 tmpvar_120; - tmpvar_120 = (_LightMatrix0 * (_Object2World * v_96.vertex)).xy; - o_99._LightCoord = tmpvar_120; - return o_99; -} - -void main () -{ - appdata_full xlt_v_121; - v2f_surf xl_retval_122; - highp vec4 tmpvar_123; - tmpvar_123 = _glesVertex.xyzw; - highp vec4 tmpvar_124; - tmpvar_124 = tmpvar_123; - xlt_v_121.vertex = tmpvar_124; - vec4 tmpvar_125; - tmpvar_125 = TANGENT.xyzw; - vec4 tmpvar_126; - tmpvar_126 = tmpvar_125; - xlt_v_121.tangent = tmpvar_126; - mediump vec3 tmpvar_127; - tmpvar_127 = _glesNormal.xyz; - mediump vec3 tmpvar_128; - tmpvar_128 = tmpvar_127; - xlt_v_121.normal = tmpvar_128; - highp vec4 tmpvar_129; - tmpvar_129 = _glesMultiTexCoord0.xyzw; - highp vec4 tmpvar_130; - tmpvar_130 = tmpvar_129; - xlt_v_121.texcoord = tmpvar_130; - highp vec4 tmpvar_131; - tmpvar_131 = _glesMultiTexCoord1.xyzw; - highp vec4 tmpvar_132; - tmpvar_132 = tmpvar_131; - xlt_v_121.texcoord1 = tmpvar_132; - lowp vec4 tmpvar_133; - tmpvar_133 = _glesColor.xyzw; - lowp vec4 tmpvar_134; - tmpvar_134 = tmpvar_133; - xlt_v_121.color = tmpvar_134; - v2f_surf tmpvar_135; - tmpvar_135 = xlat_main (xlt_v_121); - v2f_surf tmpvar_136; - tmpvar_136 = tmpvar_135; - xl_retval_122 = tmpvar_136; - highp vec4 tmpvar_137; - tmpvar_137 = xl_retval_122.pos.xyzw; - highp vec4 tmpvar_138; - tmpvar_138 = tmpvar_137; - gl_Position = tmpvar_138; - highp vec2 tmpvar_139; - tmpvar_139 = xl_retval_122.hip_pack0.xy; - highp vec2 tmpvar_140; - tmpvar_140 = tmpvar_139; - xlv_TEXCOORD0 = tmpvar_140; - highp vec4 tmpvar_141; - tmpvar_141 = xl_retval_122.lop_color.xyzw; - highp vec4 tmpvar_142; - tmpvar_142 = tmpvar_141; - xlv_COLOR0 = tmpvar_142; - highp vec3 tmpvar_143; - tmpvar_143 = xl_retval_122.lightDir.xyz; - highp vec3 tmpvar_144; - tmpvar_144 = tmpvar_143; - xlv_TEXCOORD1 = tmpvar_144; - highp vec3 tmpvar_145; - tmpvar_145 = xl_retval_122.viewDir.xyz; - highp vec3 tmpvar_146; - tmpvar_146 = tmpvar_145; - xlv_TEXCOORD2 = tmpvar_146; - highp vec2 tmpvar_147; - tmpvar_147 = xl_retval_122._LightCoord.xy; - highp vec2 tmpvar_148; - tmpvar_148 = tmpvar_147; - xlv_TEXCOORD3 = tmpvar_148; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-out.txt b/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-out.txt index 38f99b958..1587d0253 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-out.txt @@ -20,95 +20,120 @@ varying vec3 xlv_TEXCOORD2; varying vec2 xlv_TEXCOORD3; void main () { - vec4 tmpvar_1; + vec3 binormal_1; vec4 tmpvar_2; - float tmpvar_3; - tmpvar_3 = (1.0 - abs(TANGENT.w)); - vec4 tmpvar_4; - tmpvar_4.w = 0.0; - tmpvar_4.xyz = gl_Normal; - vec4 tmpvar_5; - tmpvar_5.w = 0.0; - tmpvar_5.xyz = TANGENT.xyz; + vec4 tmpvar_3; + vec4 pos_4; + float isBillboard_5; + isBillboard_5 = (1.0 - abs(TANGENT.w)); vec4 tmpvar_6; - tmpvar_6.zw = vec2(0.0, 0.0); - tmpvar_6.xy = gl_Normal.xy; + tmpvar_6.w = 0.0; + tmpvar_6.xyz = gl_Normal; vec4 tmpvar_7; - tmpvar_7 = (gl_Vertex + ((tmpvar_6 * glstate_matrix_invtrans_modelview0) * tmpvar_3)); - vec3 tmpvar_8; - tmpvar_8 = mix (gl_Normal, normalize((tmpvar_4 * glstate_matrix_invtrans_modelview0)).xyz, vec3(tmpvar_3)); - vec4 tmpvar_9; - tmpvar_9.w = -1.0; - tmpvar_9.xyz = normalize((tmpvar_5 * glstate_matrix_invtrans_modelview0)).xyz; + tmpvar_7.w = 0.0; + tmpvar_7.xyz = TANGENT.xyz; + vec4 tmpvar_8; + tmpvar_8.zw = vec2(0.0, 0.0); + tmpvar_8.xy = gl_Normal.xy; + pos_4 = (gl_Vertex + ((tmpvar_8 * glstate_matrix_invtrans_modelview0) * isBillboard_5)); + vec3 tmpvar_9; + tmpvar_9 = mix (gl_Normal, normalize((tmpvar_6 * glstate_matrix_invtrans_modelview0)).xyz, vec3(isBillboard_5)); vec4 tmpvar_10; - tmpvar_10 = mix (TANGENT, tmpvar_9, vec4(tmpvar_3)); - tmpvar_1.w = tmpvar_7.w; - tmpvar_2.w = tmpvar_10.w; - tmpvar_1.xyz = (tmpvar_7.xyz * _Scale.xyz); - vec4 pos_11; - pos_11.w = tmpvar_1.w; - vec3 bend_12; - float tmpvar_13; - tmpvar_13 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x); - vec2 tmpvar_14; - tmpvar_14.x = dot (tmpvar_1.xyz, vec3((gl_Color.y + tmpvar_13))); - tmpvar_14.y = tmpvar_13; - vec4 tmpvar_15; - tmpvar_15 = abs((( - fract(((( - fract(((_Time.yy + tmpvar_14).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) - * 2.0) - 1.0) + 0.5)) - * 2.0) - 1.0)); - vec4 tmpvar_16; - tmpvar_16 = ((tmpvar_15 * tmpvar_15) * (3.0 - (2.0 * tmpvar_15))); + tmpvar_10.w = -1.0; + tmpvar_10.xyz = normalize((tmpvar_7 * glstate_matrix_invtrans_modelview0)).xyz; + vec4 tmpvar_11; + tmpvar_11 = mix (TANGENT, tmpvar_10, vec4(isBillboard_5)); + tmpvar_2.w = pos_4.w; + tmpvar_3.w = tmpvar_11.w; + tmpvar_2.xyz = (pos_4.xyz * _Scale.xyz); + vec4 pos_12; + pos_12.w = tmpvar_2.w; + vec3 bend_13; + vec2 vWavesSum_14; + vec4 vWaves_15; + float fBranchPhase_16; + fBranchPhase_16 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x); vec2 tmpvar_17; - tmpvar_17 = (tmpvar_16.xz + tmpvar_16.yw); - bend_12.xz = ((gl_Color.y * 0.1) * tmpvar_8).xz; - bend_12.y = (gl_MultiTexCoord1.y * 0.3); - pos_11.xyz = (tmpvar_1.xyz + (( - (tmpvar_17.xyx * bend_12) - + - ((_Wind.xyz * tmpvar_17.y) * gl_MultiTexCoord1.y) - ) * _Wind.w)); - pos_11.xyz = (pos_11.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); - vec3 tmpvar_18; - tmpvar_18 = mix ((pos_11.xyz - ( - (dot (_SquashPlaneNormal.xyz, pos_11.xyz) + _SquashPlaneNormal.w) - * _SquashPlaneNormal.xyz)), pos_11.xyz, vec3(_SquashAmount)); + tmpvar_17.x = dot (tmpvar_2.xyz, vec3((gl_Color.y + fBranchPhase_16))); + tmpvar_17.y = fBranchPhase_16; + vWaves_15 = ((fract( + ((_Time.yy + tmpvar_17).xxyy * vec4(1.975, 0.793, 0.375, 0.193)) + ) * 2.0) - 1.0); + vec4 tmpvar_18; + tmpvar_18 = abs((( + fract((vWaves_15 + 0.5)) + * 2.0) - 1.0)); vec4 tmpvar_19; - tmpvar_19.w = 1.0; - tmpvar_19.xyz = tmpvar_18; - tmpvar_1 = tmpvar_19; - vec4 tmpvar_20; - tmpvar_20.xyz = vec3(1.0, 1.0, 1.0); - tmpvar_20.w = gl_Color.w; - vec3 tmpvar_21; - tmpvar_21 = normalize(tmpvar_8); - tmpvar_2.xyz = normalize(tmpvar_10.xyz); - vec3 tmpvar_22; - tmpvar_22 = (((tmpvar_21.yzx * tmpvar_2.zxy) - (tmpvar_21.zxy * tmpvar_2.yzx)) * tmpvar_10.w); - mat3 tmpvar_23; - tmpvar_23[0].x = tmpvar_2.x; - tmpvar_23[0].y = tmpvar_22.x; - tmpvar_23[0].z = tmpvar_21.x; - tmpvar_23[1].x = tmpvar_2.y; - tmpvar_23[1].y = tmpvar_22.y; - tmpvar_23[1].z = tmpvar_21.y; - tmpvar_23[2].x = tmpvar_2.z; - tmpvar_23[2].y = tmpvar_22.z; - tmpvar_23[2].z = tmpvar_21.z; - vec4 tmpvar_24; - tmpvar_24.w = 1.0; - tmpvar_24.xyz = _WorldSpaceCameraPos; - gl_Position = (glstate_matrix_mvp * tmpvar_19); + tmpvar_19 = ((tmpvar_18 * tmpvar_18) * (3.0 - (2.0 * tmpvar_18))); + vWaves_15 = tmpvar_19; + vWavesSum_14 = (tmpvar_19.xz + tmpvar_19.yw); + bend_13.xz = ((gl_Color.y * 0.1) * tmpvar_9).xz; + bend_13.y = (gl_MultiTexCoord1.y * 0.3); + pos_12.xyz = (tmpvar_2.xyz + (( + (vWavesSum_14.xyx * bend_13) + + + ((_Wind.xyz * vWavesSum_14.y) * gl_MultiTexCoord1.y) + ) * _Wind.w)); + pos_12.xyz = (pos_12.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); + vec3 tmpvar_20; + tmpvar_20 = mix ((pos_12.xyz - ( + (dot (_SquashPlaneNormal.xyz, pos_12.xyz) + _SquashPlaneNormal.w) + * _SquashPlaneNormal.xyz)), pos_12.xyz, vec3(_SquashAmount)); + vec4 tmpvar_21; + tmpvar_21.w = 1.0; + tmpvar_21.xyz = tmpvar_20; + tmpvar_2 = tmpvar_21; + vec4 tmpvar_22; + tmpvar_22.xyz = vec3(1.0, 1.0, 1.0); + tmpvar_22.w = gl_Color.w; + vec3 tmpvar_23; + tmpvar_23 = normalize(tmpvar_9); + tmpvar_3.xyz = normalize(tmpvar_11.xyz); + binormal_1 = (((tmpvar_23.yzx * tmpvar_3.zxy) - (tmpvar_23.zxy * tmpvar_3.yzx)) * tmpvar_11.w); + mat3 tmpvar_24; + tmpvar_24[0].x = tmpvar_3.x; + tmpvar_24[0].y = binormal_1.x; + tmpvar_24[0].z = tmpvar_23.x; + tmpvar_24[1].x = tmpvar_3.y; + tmpvar_24[1].y = binormal_1.y; + tmpvar_24[1].z = tmpvar_23.y; + tmpvar_24[2].x = tmpvar_3.z; + tmpvar_24[2].y = binormal_1.z; + tmpvar_24[2].z = tmpvar_23.z; + vec4 tmpvar_25; + tmpvar_25.w = 1.0; + tmpvar_25.xyz = _WorldSpaceCameraPos; + gl_Position = (glstate_matrix_mvp * tmpvar_21); xlv_TEXCOORD0 = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - xlv_COLOR0 = tmpvar_20; - xlv_TEXCOORD1 = (tmpvar_23 * (_World2Object * _WorldSpaceLightPos0).xyz); - xlv_TEXCOORD2 = (tmpvar_23 * (( - (_World2Object * tmpvar_24) - .xyz * unity_Scale.w) - tmpvar_18)); - xlv_TEXCOORD3 = (_LightMatrix0 * (_Object2World * tmpvar_19)).xy; + xlv_COLOR0 = tmpvar_22; + xlv_TEXCOORD1 = (tmpvar_24 * (_World2Object * _WorldSpaceLightPos0).xyz); + xlv_TEXCOORD2 = (tmpvar_24 * (( + (_World2Object * tmpvar_25) + .xyz * unity_Scale.w) - tmpvar_20)); + xlv_TEXCOORD3 = (_LightMatrix0 * (_Object2World * tmpvar_21)).xy; } -// inputs: 6, stats: 71 alu 0 tex 0 flow +// stats: 71 alu 0 tex 0 flow +// inputs: 6 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #2: gl_Color (high float) 4x1 [-1] loc 3 +// #3: gl_Normal (high float) 3x1 [-1] loc 2 +// #4: gl_Vertex (high float) 4x1 [-1] loc 0 +// #5: TANGENT (high float) 4x1 [-1] +// uniforms: 14 (total size: 0) +// #0: _LightMatrix0 (high float) 4x4 [-1] +// #1: _MainTex_ST (high float) 4x1 [-1] +// #2: _Object2World (high float) 4x4 [-1] +// #3: _Scale (high float) 4x1 [-1] +// #4: _SquashAmount (high float) 1x1 [-1] +// #5: _SquashPlaneNormal (high float) 4x1 [-1] +// #6: _Time (high float) 4x1 [-1] +// #7: _Wind (high float) 4x1 [-1] +// #8: _World2Object (high float) 4x4 [-1] +// #9: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #10: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #11: glstate_matrix_invtrans_modelview0 (high float) 4x4 [-1] +// #12: glstate_matrix_mvp (high float) 4x4 [-1] +// #13: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES.txt b/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES.txt index f08c22028..02444d449 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES.txt @@ -29,95 +29,120 @@ void main () highp vec4 tmpvar_2; tmpvar_1 = _glesNormal; tmpvar_2 = _glesColor; - highp vec4 tmpvar_3; + highp vec3 binormal_3; highp vec4 tmpvar_4; - highp float tmpvar_5; - tmpvar_5 = (1.0 - abs(TANGENT.w)); - highp vec4 tmpvar_6; - tmpvar_6.w = 0.0; - tmpvar_6.xyz = tmpvar_1; - highp vec4 tmpvar_7; - tmpvar_7.w = 0.0; - tmpvar_7.xyz = TANGENT.xyz; + highp vec4 tmpvar_5; + highp vec4 pos_6; + highp float isBillboard_7; + isBillboard_7 = (1.0 - abs(TANGENT.w)); highp vec4 tmpvar_8; - tmpvar_8.zw = vec2(0.0, 0.0); - tmpvar_8.xy = tmpvar_1.xy; + tmpvar_8.w = 0.0; + tmpvar_8.xyz = tmpvar_1; highp vec4 tmpvar_9; - tmpvar_9 = (_glesVertex + ((tmpvar_8 * glstate_matrix_invtrans_modelview0) * tmpvar_5)); - highp vec3 tmpvar_10; - tmpvar_10 = mix (tmpvar_1, normalize((tmpvar_6 * glstate_matrix_invtrans_modelview0)).xyz, vec3(tmpvar_5)); - highp vec4 tmpvar_11; - tmpvar_11.w = -1.0; - tmpvar_11.xyz = normalize((tmpvar_7 * glstate_matrix_invtrans_modelview0)).xyz; + tmpvar_9.w = 0.0; + tmpvar_9.xyz = TANGENT.xyz; + highp vec4 tmpvar_10; + tmpvar_10.zw = vec2(0.0, 0.0); + tmpvar_10.xy = tmpvar_1.xy; + pos_6 = (_glesVertex + ((tmpvar_10 * glstate_matrix_invtrans_modelview0) * isBillboard_7)); + highp vec3 tmpvar_11; + tmpvar_11 = mix (tmpvar_1, normalize((tmpvar_8 * glstate_matrix_invtrans_modelview0)).xyz, vec3(isBillboard_7)); highp vec4 tmpvar_12; - tmpvar_12 = mix (TANGENT, tmpvar_11, vec4(tmpvar_5)); - tmpvar_3.w = tmpvar_9.w; - tmpvar_4.w = tmpvar_12.w; - tmpvar_3.xyz = (tmpvar_9.xyz * _Scale.xyz); - highp vec4 pos_13; - pos_13.w = tmpvar_3.w; - highp vec3 bend_14; - highp float tmpvar_15; - tmpvar_15 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + tmpvar_2.x); - highp vec2 tmpvar_16; - tmpvar_16.x = dot (tmpvar_3.xyz, vec3((tmpvar_2.y + tmpvar_15))); - tmpvar_16.y = tmpvar_15; - highp vec4 tmpvar_17; - tmpvar_17 = abs((( - fract(((( - fract(((_Time.yy + tmpvar_16).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) - * 2.0) - 1.0) + 0.5)) - * 2.0) - 1.0)); - highp vec4 tmpvar_18; - tmpvar_18 = ((tmpvar_17 * tmpvar_17) * (3.0 - (2.0 * tmpvar_17))); + tmpvar_12.w = -1.0; + tmpvar_12.xyz = normalize((tmpvar_9 * glstate_matrix_invtrans_modelview0)).xyz; + highp vec4 tmpvar_13; + tmpvar_13 = mix (TANGENT, tmpvar_12, vec4(isBillboard_7)); + tmpvar_4.w = pos_6.w; + tmpvar_5.w = tmpvar_13.w; + tmpvar_4.xyz = (pos_6.xyz * _Scale.xyz); + highp vec4 pos_14; + pos_14.w = tmpvar_4.w; + highp vec3 bend_15; + highp vec2 vWavesSum_16; + highp vec4 vWaves_17; + highp float fBranchPhase_18; + fBranchPhase_18 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + tmpvar_2.x); highp vec2 tmpvar_19; - tmpvar_19 = (tmpvar_18.xz + tmpvar_18.yw); - bend_14.xz = ((tmpvar_2.y * 0.1) * tmpvar_10).xz; - bend_14.y = (_glesMultiTexCoord1.y * 0.3); - pos_13.xyz = (tmpvar_3.xyz + (( - (tmpvar_19.xyx * bend_14) - + - ((_Wind.xyz * tmpvar_19.y) * _glesMultiTexCoord1.y) - ) * _Wind.w)); - pos_13.xyz = (pos_13.xyz + (_glesMultiTexCoord1.x * _Wind.xyz)); - highp vec3 tmpvar_20; - tmpvar_20 = mix ((pos_13.xyz - ( - (dot (_SquashPlaneNormal.xyz, pos_13.xyz) + _SquashPlaneNormal.w) - * _SquashPlaneNormal.xyz)), pos_13.xyz, vec3(_SquashAmount)); + tmpvar_19.x = dot (tmpvar_4.xyz, vec3((tmpvar_2.y + fBranchPhase_18))); + tmpvar_19.y = fBranchPhase_18; + vWaves_17 = ((fract( + ((_Time.yy + tmpvar_19).xxyy * vec4(1.975, 0.793, 0.375, 0.193)) + ) * 2.0) - 1.0); + highp vec4 tmpvar_20; + tmpvar_20 = abs((( + fract((vWaves_17 + 0.5)) + * 2.0) - 1.0)); highp vec4 tmpvar_21; - tmpvar_21.w = 1.0; - tmpvar_21.xyz = tmpvar_20; - tmpvar_3 = tmpvar_21; - highp vec4 tmpvar_22; - tmpvar_22.xyz = vec3(1.0, 1.0, 1.0); - tmpvar_22.w = tmpvar_2.w; - highp vec3 tmpvar_23; - tmpvar_23 = normalize(tmpvar_10); - tmpvar_4.xyz = normalize(tmpvar_12.xyz); - highp vec3 tmpvar_24; - tmpvar_24 = (((tmpvar_23.yzx * tmpvar_4.zxy) - (tmpvar_23.zxy * tmpvar_4.yzx)) * tmpvar_12.w); - highp mat3 tmpvar_25; - tmpvar_25[0].x = tmpvar_4.x; - tmpvar_25[0].y = tmpvar_24.x; - tmpvar_25[0].z = tmpvar_23.x; - tmpvar_25[1].x = tmpvar_4.y; - tmpvar_25[1].y = tmpvar_24.y; - tmpvar_25[1].z = tmpvar_23.y; - tmpvar_25[2].x = tmpvar_4.z; - tmpvar_25[2].y = tmpvar_24.z; - tmpvar_25[2].z = tmpvar_23.z; - highp vec4 tmpvar_26; - tmpvar_26.w = 1.0; - tmpvar_26.xyz = _WorldSpaceCameraPos; - gl_Position = (glstate_matrix_mvp * tmpvar_21); + tmpvar_21 = ((tmpvar_20 * tmpvar_20) * (3.0 - (2.0 * tmpvar_20))); + vWaves_17 = tmpvar_21; + vWavesSum_16 = (tmpvar_21.xz + tmpvar_21.yw); + bend_15.xz = ((tmpvar_2.y * 0.1) * tmpvar_11).xz; + bend_15.y = (_glesMultiTexCoord1.y * 0.3); + pos_14.xyz = (tmpvar_4.xyz + (( + (vWavesSum_16.xyx * bend_15) + + + ((_Wind.xyz * vWavesSum_16.y) * _glesMultiTexCoord1.y) + ) * _Wind.w)); + pos_14.xyz = (pos_14.xyz + (_glesMultiTexCoord1.x * _Wind.xyz)); + highp vec3 tmpvar_22; + tmpvar_22 = mix ((pos_14.xyz - ( + (dot (_SquashPlaneNormal.xyz, pos_14.xyz) + _SquashPlaneNormal.w) + * _SquashPlaneNormal.xyz)), pos_14.xyz, vec3(_SquashAmount)); + highp vec4 tmpvar_23; + tmpvar_23.w = 1.0; + tmpvar_23.xyz = tmpvar_22; + tmpvar_4 = tmpvar_23; + highp vec4 tmpvar_24; + tmpvar_24.xyz = vec3(1.0, 1.0, 1.0); + tmpvar_24.w = tmpvar_2.w; + highp vec3 tmpvar_25; + tmpvar_25 = normalize(tmpvar_11); + tmpvar_5.xyz = normalize(tmpvar_13.xyz); + binormal_3 = (((tmpvar_25.yzx * tmpvar_5.zxy) - (tmpvar_25.zxy * tmpvar_5.yzx)) * tmpvar_13.w); + highp mat3 tmpvar_26; + tmpvar_26[0].x = tmpvar_5.x; + tmpvar_26[0].y = binormal_3.x; + tmpvar_26[0].z = tmpvar_25.x; + tmpvar_26[1].x = tmpvar_5.y; + tmpvar_26[1].y = binormal_3.y; + tmpvar_26[1].z = tmpvar_25.y; + tmpvar_26[2].x = tmpvar_5.z; + tmpvar_26[2].y = binormal_3.z; + tmpvar_26[2].z = tmpvar_25.z; + highp vec4 tmpvar_27; + tmpvar_27.w = 1.0; + tmpvar_27.xyz = _WorldSpaceCameraPos; + gl_Position = (glstate_matrix_mvp * tmpvar_23); xlv_TEXCOORD0 = ((_glesMultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - xlv_COLOR0 = tmpvar_22; - xlv_TEXCOORD1 = (tmpvar_25 * (_World2Object * _WorldSpaceLightPos0).xyz); - xlv_TEXCOORD2 = (tmpvar_25 * (( - (_World2Object * tmpvar_26) - .xyz * unity_Scale.w) - tmpvar_20)); - xlv_TEXCOORD3 = (_LightMatrix0 * (_Object2World * tmpvar_21)).xy; + xlv_COLOR0 = tmpvar_24; + xlv_TEXCOORD1 = (tmpvar_26 * (_World2Object * _WorldSpaceLightPos0).xyz); + xlv_TEXCOORD2 = (tmpvar_26 * (( + (_World2Object * tmpvar_27) + .xyz * unity_Scale.w) - tmpvar_22)); + xlv_TEXCOORD3 = (_LightMatrix0 * (_Object2World * tmpvar_23)).xy; } -// inputs: 6, stats: 71 alu 0 tex 0 flow +// stats: 71 alu 0 tex 0 flow +// inputs: 6 +// #0: _glesVertex (high float) 4x1 [-1] +// #1: _glesNormal (medium float) 3x1 [-1] +// #2: _glesMultiTexCoord0 (high float) 4x1 [-1] +// #3: _glesMultiTexCoord1 (high float) 4x1 [-1] +// #4: _glesColor (low float) 4x1 [-1] +// #5: TANGENT (high float) 4x1 [-1] +// uniforms: 14 (total size: 0) +// #0: _LightMatrix0 (high float) 4x4 [-1] +// #1: _MainTex_ST (high float) 4x1 [-1] +// #2: _Object2World (high float) 4x4 [-1] +// #3: _Scale (high float) 4x1 [-1] +// #4: _SquashAmount (high float) 1x1 [-1] +// #5: _SquashPlaneNormal (high float) 4x1 [-1] +// #6: _Time (high float) 4x1 [-1] +// #7: _Wind (high float) 4x1 [-1] +// #8: _World2Object (high float) 4x4 [-1] +// #9: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #10: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #11: glstate_matrix_invtrans_modelview0 (high float) 4x4 [-1] +// #12: glstate_matrix_mvp (high float) 4x4 [-1] +// #13: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES3.txt b/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES3.txt new file mode 100644 index 000000000..3e7a98c58 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES3.txt @@ -0,0 +1,157 @@ +#version 300 es +uniform highp mat4 _LightMatrix0; +uniform highp vec4 _MainTex_ST; +uniform highp mat4 _Object2World; +uniform highp vec4 _Scale; +uniform highp float _SquashAmount; +uniform highp vec4 _SquashPlaneNormal; +uniform highp vec4 _Time; +uniform highp vec4 _Wind; +uniform highp mat4 _World2Object; +uniform highp vec3 _WorldSpaceCameraPos; +uniform highp vec4 _WorldSpaceLightPos0; +uniform highp mat4 glstate_matrix_invtrans_modelview0; +uniform highp mat4 glstate_matrix_mvp; +uniform highp vec4 unity_Scale; +in highp vec4 _inVertex; +in mediump vec3 _inNormal; +in highp vec4 _uv0; +in highp vec4 _uv1; +in lowp vec4 _color; +in mediump vec4 TANGENT; +out highp vec2 xlv_TEXCOORD0; +out lowp vec4 xlv_COLOR0; +out mediump vec3 xlv_TEXCOORD1; +out mediump vec3 xlv_TEXCOORD2; +out mediump vec2 xlv_TEXCOORD3; +void main () +{ + highp vec4 tmpvar_1; + highp vec3 tmpvar_2; + highp vec4 tmpvar_3; + tmpvar_1 = TANGENT; + tmpvar_2 = _inNormal; + tmpvar_3 = _color; + highp vec3 binormal_4; + highp vec4 tmpvar_5; + highp vec4 tmpvar_6; + highp vec4 pos_7; + highp float isBillboard_8; + isBillboard_8 = (1.0 - abs(tmpvar_1.w)); + highp vec4 tmpvar_9; + tmpvar_9.w = 0.0; + tmpvar_9.xyz = tmpvar_2; + highp vec4 tmpvar_10; + tmpvar_10.w = 0.0; + tmpvar_10.xyz = tmpvar_1.xyz; + highp vec4 tmpvar_11; + tmpvar_11.zw = vec2(0.0, 0.0); + tmpvar_11.xy = tmpvar_2.xy; + pos_7 = (_inVertex + ((tmpvar_11 * glstate_matrix_invtrans_modelview0) * isBillboard_8)); + highp vec3 tmpvar_12; + tmpvar_12 = mix (tmpvar_2, normalize((tmpvar_9 * glstate_matrix_invtrans_modelview0)).xyz, vec3(isBillboard_8)); + highp vec4 tmpvar_13; + tmpvar_13.w = -1.0; + tmpvar_13.xyz = normalize((tmpvar_10 * glstate_matrix_invtrans_modelview0)).xyz; + highp vec4 tmpvar_14; + tmpvar_14 = mix (tmpvar_1, tmpvar_13, vec4(isBillboard_8)); + tmpvar_5.w = pos_7.w; + tmpvar_6.w = tmpvar_14.w; + tmpvar_5.xyz = (pos_7.xyz * _Scale.xyz); + highp vec4 pos_15; + pos_15.w = tmpvar_5.w; + highp vec3 bend_16; + highp vec2 vWavesSum_17; + highp vec4 vWaves_18; + highp float fBranchPhase_19; + fBranchPhase_19 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + tmpvar_3.x); + highp vec2 tmpvar_20; + tmpvar_20.x = dot (tmpvar_5.xyz, vec3((tmpvar_3.y + fBranchPhase_19))); + tmpvar_20.y = fBranchPhase_19; + vWaves_18 = ((fract( + ((_Time.yy + tmpvar_20).xxyy * vec4(1.975, 0.793, 0.375, 0.193)) + ) * 2.0) - 1.0); + highp vec4 tmpvar_21; + tmpvar_21 = abs((( + fract((vWaves_18 + 0.5)) + * 2.0) - 1.0)); + highp vec4 tmpvar_22; + tmpvar_22 = ((tmpvar_21 * tmpvar_21) * (3.0 - (2.0 * tmpvar_21))); + vWaves_18 = tmpvar_22; + vWavesSum_17 = (tmpvar_22.xz + tmpvar_22.yw); + bend_16.xz = ((tmpvar_3.y * 0.1) * tmpvar_12).xz; + bend_16.y = (_uv1.y * 0.3); + pos_15.xyz = (tmpvar_5.xyz + (( + (vWavesSum_17.xyx * bend_16) + + + ((_Wind.xyz * vWavesSum_17.y) * _uv1.y) + ) * _Wind.w)); + pos_15.xyz = (pos_15.xyz + (_uv1.x * _Wind.xyz)); + highp vec3 tmpvar_23; + tmpvar_23 = mix ((pos_15.xyz - ( + (dot (_SquashPlaneNormal.xyz, pos_15.xyz) + _SquashPlaneNormal.w) + * _SquashPlaneNormal.xyz)), pos_15.xyz, vec3(_SquashAmount)); + highp vec4 tmpvar_24; + tmpvar_24.w = 1.0; + tmpvar_24.xyz = tmpvar_23; + tmpvar_5 = tmpvar_24; + highp vec4 tmpvar_25; + tmpvar_25.xyz = vec3(1.0, 1.0, 1.0); + tmpvar_25.w = tmpvar_3.w; + highp vec3 tmpvar_26; + tmpvar_26 = normalize(tmpvar_12); + 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[1u].x = tmpvar_6.y; + tmpvar_27[1u].y = binormal_4.y; + tmpvar_27[1u].z = tmpvar_26.y; + tmpvar_27[2u].x = tmpvar_6.z; + tmpvar_27[2u].y = binormal_4.z; + tmpvar_27[2u].z = tmpvar_26.z; + highp vec4 tmpvar_28; + tmpvar_28.w = 1.0; + tmpvar_28.xyz = _WorldSpaceCameraPos; + gl_Position = (glstate_matrix_mvp * tmpvar_24); + xlv_TEXCOORD0 = ((_uv0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + xlv_COLOR0 = tmpvar_25; + highp vec3 tmpvar_29; + tmpvar_29 = (tmpvar_27 * (_World2Object * _WorldSpaceLightPos0).xyz); + xlv_TEXCOORD1 = tmpvar_29; + highp vec3 tmpvar_30; + tmpvar_30 = (tmpvar_27 * (( + (_World2Object * tmpvar_28) + .xyz * unity_Scale.w) - tmpvar_23)); + xlv_TEXCOORD2 = tmpvar_30; + highp vec2 tmpvar_31; + tmpvar_31 = (_LightMatrix0 * (_Object2World * tmpvar_24)).xy; + xlv_TEXCOORD3 = tmpvar_31; +} + + +// stats: 71 alu 0 tex 0 flow +// inputs: 6 +// #0: _inVertex (high float) 4x1 [-1] +// #1: _inNormal (medium float) 3x1 [-1] +// #2: _uv0 (high float) 4x1 [-1] +// #3: _uv1 (high float) 4x1 [-1] +// #4: _color (low float) 4x1 [-1] +// #5: TANGENT (medium float) 4x1 [-1] +// uniforms: 14 (total size: 0) +// #0: _LightMatrix0 (high float) 4x4 [-1] +// #1: _MainTex_ST (high float) 4x1 [-1] +// #2: _Object2World (high float) 4x4 [-1] +// #3: _Scale (high float) 4x1 [-1] +// #4: _SquashAmount (high float) 1x1 [-1] +// #5: _SquashPlaneNormal (high float) 4x1 [-1] +// #6: _Time (high float) 4x1 [-1] +// #7: _Wind (high float) 4x1 [-1] +// #8: _World2Object (high float) 4x4 [-1] +// #9: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #10: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #11: glstate_matrix_invtrans_modelview0 (high float) 4x4 [-1] +// #12: glstate_matrix_mvp (high float) 4x4 [-1] +// #13: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES3Metal.txt b/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES3Metal.txt new file mode 100644 index 000000000..f825c2f87 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES3Metal.txt @@ -0,0 +1,167 @@ +#include +using namespace metal; +struct xlatMtlShaderInput { + float4 _inVertex [[attribute(0)]]; + half3 _inNormal [[attribute(1)]]; + float4 _uv0 [[attribute(2)]]; + float4 _uv1 [[attribute(3)]]; + half4 _color [[attribute(4)]]; + half4 TANGENT [[attribute(5)]]; +}; +struct xlatMtlShaderOutput { + float4 gl_Position [[position]]; + float2 xlv_TEXCOORD0; + half4 xlv_COLOR0; + half3 xlv_TEXCOORD1; + half3 xlv_TEXCOORD2; + half2 xlv_TEXCOORD3; +}; +struct xlatMtlShaderUniform { + float4x4 _LightMatrix0; + float4 _MainTex_ST; + float4x4 _Object2World; + float4 _Scale; + float _SquashAmount; + float4 _SquashPlaneNormal; + float4 _Time; + float4 _Wind; + float4x4 _World2Object; + float3 _WorldSpaceCameraPos; + float4 _WorldSpaceLightPos0; + float4x4 glstate_matrix_invtrans_modelview0; + float4x4 glstate_matrix_mvp; + float4 unity_Scale; +}; +vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) +{ + xlatMtlShaderOutput _mtl_o; + float4 tmpvar_1; + float3 tmpvar_2; + float4 tmpvar_3; + tmpvar_1 = float4(_mtl_i.TANGENT); + tmpvar_2 = float3(_mtl_i._inNormal); + tmpvar_3 = float4(_mtl_i._color); + float3 binormal_4; + float4 tmpvar_5; + float4 tmpvar_6; + float4 pos_7; + float isBillboard_8; + isBillboard_8 = (1.0 - abs(tmpvar_1.w)); + float4 tmpvar_9; + tmpvar_9.w = 0.0; + tmpvar_9.xyz = tmpvar_2; + float4 tmpvar_10; + tmpvar_10.w = 0.0; + tmpvar_10.xyz = tmpvar_1.xyz; + float4 tmpvar_11; + tmpvar_11.zw = float2(0.0, 0.0); + tmpvar_11.xy = tmpvar_2.xy; + pos_7 = (_mtl_i._inVertex + ((tmpvar_11 * _mtl_u.glstate_matrix_invtrans_modelview0) * isBillboard_8)); + float3 tmpvar_12; + tmpvar_12 = mix (tmpvar_2, normalize((tmpvar_9 * _mtl_u.glstate_matrix_invtrans_modelview0)).xyz, float3(isBillboard_8)); + float4 tmpvar_13; + tmpvar_13.w = -1.0; + tmpvar_13.xyz = normalize((tmpvar_10 * _mtl_u.glstate_matrix_invtrans_modelview0)).xyz; + float4 tmpvar_14; + tmpvar_14 = mix (tmpvar_1, tmpvar_13, float4(isBillboard_8)); + tmpvar_5.w = pos_7.w; + tmpvar_6.w = tmpvar_14.w; + tmpvar_5.xyz = (pos_7.xyz * _mtl_u._Scale.xyz); + float4 pos_15; + pos_15.w = tmpvar_5.w; + float3 bend_16; + float2 vWavesSum_17; + float4 vWaves_18; + float fBranchPhase_19; + fBranchPhase_19 = (dot (_mtl_u._Object2World[3].xyz, float3(1.0, 1.0, 1.0)) + tmpvar_3.x); + float2 tmpvar_20; + tmpvar_20.x = dot (tmpvar_5.xyz, float3((tmpvar_3.y + fBranchPhase_19))); + tmpvar_20.y = fBranchPhase_19; + vWaves_18 = ((fract( + ((_mtl_u._Time.yy + tmpvar_20).xxyy * float4(1.975, 0.793, 0.375, 0.193)) + ) * 2.0) - 1.0); + float4 tmpvar_21; + tmpvar_21 = abs((( + fract((vWaves_18 + 0.5)) + * 2.0) - 1.0)); + float4 tmpvar_22; + tmpvar_22 = ((tmpvar_21 * tmpvar_21) * (3.0 - (2.0 * tmpvar_21))); + vWaves_18 = tmpvar_22; + vWavesSum_17 = (tmpvar_22.xz + tmpvar_22.yw); + bend_16.xz = ((tmpvar_3.y * 0.1) * tmpvar_12).xz; + bend_16.y = (_mtl_i._uv1.y * 0.3); + pos_15.xyz = (tmpvar_5.xyz + (( + (vWavesSum_17.xyx * bend_16) + + + ((_mtl_u._Wind.xyz * vWavesSum_17.y) * _mtl_i._uv1.y) + ) * _mtl_u._Wind.w)); + pos_15.xyz = (pos_15.xyz + (_mtl_i._uv1.x * _mtl_u._Wind.xyz)); + float3 tmpvar_23; + tmpvar_23 = mix ((pos_15.xyz - ( + (dot (_mtl_u._SquashPlaneNormal.xyz, pos_15.xyz) + _mtl_u._SquashPlaneNormal.w) + * _mtl_u._SquashPlaneNormal.xyz)), pos_15.xyz, float3(_mtl_u._SquashAmount)); + float4 tmpvar_24; + tmpvar_24.w = 1.0; + tmpvar_24.xyz = tmpvar_23; + tmpvar_5 = tmpvar_24; + float4 tmpvar_25; + tmpvar_25.xyz = float3(1.0, 1.0, 1.0); + tmpvar_25.w = tmpvar_3.w; + float3 tmpvar_26; + tmpvar_26 = normalize(tmpvar_12); + tmpvar_6.xyz = normalize(tmpvar_14.xyz); + binormal_4 = (((tmpvar_26.yzx * tmpvar_6.zxy) - (tmpvar_26.zxy * tmpvar_6.yzx)) * tmpvar_14.w); + float3x3 tmpvar_27; + tmpvar_27[0].x = tmpvar_6.x; + tmpvar_27[0].y = binormal_4.x; + tmpvar_27[0].z = tmpvar_26.x; + tmpvar_27[1].x = tmpvar_6.y; + tmpvar_27[1].y = binormal_4.y; + tmpvar_27[1].z = tmpvar_26.y; + tmpvar_27[2].x = tmpvar_6.z; + tmpvar_27[2].y = binormal_4.z; + tmpvar_27[2].z = tmpvar_26.z; + float4 tmpvar_28; + tmpvar_28.w = 1.0; + tmpvar_28.xyz = _mtl_u._WorldSpaceCameraPos; + _mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * tmpvar_24); + _mtl_o.xlv_TEXCOORD0 = ((_mtl_i._uv0.xy * _mtl_u._MainTex_ST.xy) + _mtl_u._MainTex_ST.zw); + _mtl_o.xlv_COLOR0 = half4(tmpvar_25); + float3 tmpvar_29; + tmpvar_29 = (tmpvar_27 * (_mtl_u._World2Object * _mtl_u._WorldSpaceLightPos0).xyz); + _mtl_o.xlv_TEXCOORD1 = half3(tmpvar_29); + float3 tmpvar_30; + tmpvar_30 = (tmpvar_27 * (( + (_mtl_u._World2Object * tmpvar_28) + .xyz * _mtl_u.unity_Scale.w) - tmpvar_23)); + _mtl_o.xlv_TEXCOORD2 = half3(tmpvar_30); + float2 tmpvar_31; + tmpvar_31 = (_mtl_u._LightMatrix0 * (_mtl_u._Object2World * tmpvar_24)).xy; + _mtl_o.xlv_TEXCOORD3 = half2(tmpvar_31); + return _mtl_o; +} + + +// stats: 71 alu 0 tex 0 flow +// inputs: 6 +// #0: _inVertex (high float) 4x1 [-1] loc 0 +// #1: _inNormal (medium float) 3x1 [-1] loc 1 +// #2: _uv0 (high float) 4x1 [-1] loc 2 +// #3: _uv1 (high float) 4x1 [-1] loc 3 +// #4: _color (low float) 4x1 [-1] loc 4 +// #5: TANGENT (medium float) 4x1 [-1] loc 5 +// uniforms: 14 (total size: 464) +// #0: _LightMatrix0 (high float) 4x4 [-1] loc 0 +// #1: _MainTex_ST (high float) 4x1 [-1] loc 64 +// #2: _Object2World (high float) 4x4 [-1] loc 80 +// #3: _Scale (high float) 4x1 [-1] loc 144 +// #4: _SquashAmount (high float) 1x1 [-1] loc 160 +// #5: _SquashPlaneNormal (high float) 4x1 [-1] loc 176 +// #6: _Time (high float) 4x1 [-1] loc 192 +// #7: _Wind (high float) 4x1 [-1] loc 208 +// #8: _World2Object (high float) 4x4 [-1] loc 224 +// #9: _WorldSpaceCameraPos (high float) 3x1 [-1] loc 288 +// #10: _WorldSpaceLightPos0 (high float) 4x1 [-1] loc 304 +// #11: glstate_matrix_invtrans_modelview0 (high float) 4x4 [-1] loc 320 +// #12: glstate_matrix_mvp (high float) 4x4 [-1] loc 384 +// #13: unity_Scale (high float) 4x1 [-1] loc 448 diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-ir.txt deleted file mode 100644 index 6dc21bc7d..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-ir.txt +++ /dev/null @@ -1,233 +0,0 @@ -struct VertexOutput { - vec4 pos; - vec4 tex; - vec4 posWorld; - vec3 normalWorld; - vec4 tangentWorld; - vec3 extra; - vec4 _ShadowCoord; - vec3 lightDir; -}; -struct VertexInput { - vec4 vertex; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 tangent; -}; -uniform vec4 _ProjectionParams; -uniform vec4 _ScreenParams; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; -uniform mat4 _World2Object; -uniform vec4 unity_Scale; -uniform mat4 glstate_matrix_transpose_modelview0; -uniform samplerCube _Cube; -uniform sampler2D _MainTex; -uniform vec4 _MainTex_ST; -uniform sampler2D _DetailAlbedoMap; -uniform vec4 _DetailAlbedoMap_ST; -uniform sampler2D _AlphaMap; -uniform sampler2D _Occlusion; -uniform sampler2D _DetailNormalMap; -uniform vec4 _DetailNormalMap_ST; -uniform float _DetailNormalMapScale; -uniform sampler2D _BumpMap; -uniform float _BumpScale; -uniform float _Exposure; -uniform float _DetailBumpScale; -uniform float _AlphaTestRef; -uniform float _DetailBumpTiling; -uniform vec4 _Color; -uniform vec4 _SpecularColor; -uniform sampler2D _SpecGlossMap; -uniform float _Glossiness; -uniform vec4 unity_ColorSpaceGrey; -uniform vec4 _LightColor0; -uniform samplerCube _SpecCube; -uniform vec4 unity_LightmapST; -uniform sampler2D unity_Lightmap; -uniform sampler2D unity_LightmapInd; -uniform float _SelfIllumScale; -uniform sampler2D _SelfIllum; -attribute vec4 TANGENT; -varying vec4 xlv_TEXCOORD0; -varying vec4 xlv_TEXCOORD1; -varying vec3 xlv_TEXCOORD2; -varying vec4 xlv_TEXCOORD3; -varying vec3 xlv_TEXCOORD4; -varying vec4 xlv_TEXCOORD5; -varying vec3 xlv_TEXCOORD7; -mat3 xll_constructMat3_mf4x4 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec4 ComputeScreenPos ( - in vec4 pos_9 -) -{ - vec4 o_10; - vec4 tmpvar_11; - tmpvar_11 = (pos_9 * 0.5); - o_10 = tmpvar_11; - vec2 tmpvar_12; - tmpvar_12.x = o_10.x; - tmpvar_12.y = (o_10.y * _ProjectionParams.x); - vec2 tmpvar_13; - tmpvar_13 = (tmpvar_12 + o_10.w); - o_10.xy = tmpvar_13.xy.xy; - vec2 tmpvar_14; - tmpvar_14 = pos_9.zw; - o_10.zw = tmpvar_14.xxxy.zw; - return o_10; -} - -VertexOutput vert ( - in VertexInput v_15 -) -{ - VertexOutput o_16; - vec4 tmpvar_17; - tmpvar_17 = (_Object2World * v_15.vertex); - o_16.posWorld = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = (gl_ModelViewProjectionMatrix * v_15.vertex); - o_16.pos = tmpvar_18; - vec4 tmpvar_19; - tmpvar_19 = v_15.texcoord; - o_16.tex = tmpvar_19; - vec2 tmpvar_20; - tmpvar_20 = ((v_15.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_16.tex.xy = tmpvar_20.xy.xy; - vec2 tmpvar_21; - tmpvar_21 = ((v_15.texcoord.xy * _DetailAlbedoMap_ST.xy) + _DetailAlbedoMap_ST.zw); - o_16.tex.zw = tmpvar_21.xxxy.zw; - mat3 tmpvar_22; - tmpvar_22 = xll_constructMat3_mf4x4 (_Object2World); - vec3 tmpvar_23; - tmpvar_23 = normalize ((tmpvar_22 * v_15.normal)); - vec3 tmpvar_24; - tmpvar_24 = tmpvar_23; - o_16.normalWorld = tmpvar_24; - mat3 tmpvar_25; - tmpvar_25 = xll_constructMat3_mf4x4 (_Object2World); - vec4 tmpvar_26; - tmpvar_26.xyz = (tmpvar_25 * v_15.tangent.xyz).xyz; - tmpvar_26.w = v_15.tangent.w; - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - o_16.tangentWorld = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = normalize (o_16.tangentWorld.xyz); - vec3 tmpvar_29; - tmpvar_29 = tmpvar_28; - o_16.tangentWorld.xyz = tmpvar_29.xyz.xyz; - vec4 tmpvar_30; - tmpvar_30 = ComputeScreenPos (o_16.pos); - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - o_16._ShadowCoord = tmpvar_31; - vec2 tmpvar_32; - tmpvar_32 = ((v_15.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - o_16.extra.xy = tmpvar_32.xy.xy; - float tmpvar_33; - tmpvar_33 = 0.0; - o_16.extra.z = vec3(tmpvar_33).z; - return o_16; -} - -void main () -{ - VertexInput xlt_v_34; - VertexOutput xl_retval_35; - vec4 tmpvar_36; - tmpvar_36 = gl_Vertex.xyzw; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlt_v_34.vertex = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = gl_Normal.xyz; - vec3 tmpvar_39; - tmpvar_39 = tmpvar_38; - xlt_v_34.normal = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - xlt_v_34.texcoord = tmpvar_41; - vec4 tmpvar_42; - tmpvar_42 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - xlt_v_34.texcoord1 = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44 = TANGENT.xyzw; - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - xlt_v_34.tangent = tmpvar_45; - VertexOutput tmpvar_46; - tmpvar_46 = vert (xlt_v_34); - VertexOutput tmpvar_47; - tmpvar_47 = tmpvar_46; - xl_retval_35 = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48 = xl_retval_35.pos.xyzw; - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - gl_Position = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50 = xl_retval_35.tex.xyzw; - vec4 tmpvar_51; - tmpvar_51 = tmpvar_50; - xlv_TEXCOORD0 = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = xl_retval_35.posWorld.xyzw; - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - xlv_TEXCOORD1 = tmpvar_53; - vec3 tmpvar_54; - tmpvar_54 = xl_retval_35.normalWorld.xyz; - vec3 tmpvar_55; - tmpvar_55 = tmpvar_54; - xlv_TEXCOORD2 = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = xl_retval_35.tangentWorld.xyzw; - vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - xlv_TEXCOORD3 = tmpvar_57; - vec3 tmpvar_58; - tmpvar_58 = xl_retval_35.extra.xyz; - vec3 tmpvar_59; - tmpvar_59 = tmpvar_58; - xlv_TEXCOORD4 = tmpvar_59; - vec4 tmpvar_60; - tmpvar_60 = xl_retval_35._ShadowCoord.xyzw; - vec4 tmpvar_61; - tmpvar_61 = tmpvar_60; - xlv_TEXCOORD5 = tmpvar_61; - vec3 tmpvar_62; - tmpvar_62 = xl_retval_35.lightDir.xyz; - vec3 tmpvar_63; - tmpvar_63 = tmpvar_62; - xlv_TEXCOORD7 = tmpvar_63; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-out.txt b/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-out.txt index dea8b7ffa..4b59ad6c2 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-out.txt @@ -15,12 +15,12 @@ void main () { vec4 tmpvar_1; vec4 tmpvar_2; - vec3 tmpvar_3; + vec4 tmpvar_3; vec3 tmpvar_4; - vec4 tmpvar_5; - tmpvar_5 = (gl_ModelViewProjectionMatrix * gl_Vertex); - tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _DetailAlbedoMap_ST.xy) + _DetailAlbedoMap_ST.zw); + vec3 tmpvar_5; + tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _DetailAlbedoMap_ST.xy) + _DetailAlbedoMap_ST.zw); mat3 tmpvar_6; tmpvar_6[0] = _Object2World[0].xyz; tmpvar_6[1] = _Object2World[1].xyz; @@ -32,27 +32,40 @@ void main () vec4 tmpvar_8; tmpvar_8.xyz = (tmpvar_7 * TANGENT.xyz); tmpvar_8.w = TANGENT.w; - tmpvar_2.w = tmpvar_8.w; - tmpvar_2.xyz = normalize(tmpvar_8.xyz); + tmpvar_3.w = tmpvar_8.w; + tmpvar_3.xyz = normalize(tmpvar_8.xyz); vec4 o_9; vec4 tmpvar_10; - tmpvar_10 = (tmpvar_5 * 0.5); + tmpvar_10 = (tmpvar_1 * 0.5); vec2 tmpvar_11; tmpvar_11.x = tmpvar_10.x; tmpvar_11.y = (tmpvar_10.y * _ProjectionParams.x); o_9.xy = (tmpvar_11 + tmpvar_10.w); - o_9.zw = tmpvar_5.zw; - tmpvar_3.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - tmpvar_3.z = 0.0; - gl_Position = tmpvar_5; - xlv_TEXCOORD0 = tmpvar_1; + o_9.zw = tmpvar_1.zw; + tmpvar_4.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); + tmpvar_4.z = 0.0; + gl_Position = tmpvar_1; + xlv_TEXCOORD0 = tmpvar_2; xlv_TEXCOORD1 = (_Object2World * gl_Vertex); xlv_TEXCOORD2 = normalize((tmpvar_6 * gl_Normal)); - xlv_TEXCOORD3 = tmpvar_2; - xlv_TEXCOORD4 = tmpvar_3; + xlv_TEXCOORD3 = tmpvar_3; + xlv_TEXCOORD4 = tmpvar_4; xlv_TEXCOORD5 = o_9; - xlv_TEXCOORD7 = tmpvar_4; + xlv_TEXCOORD7 = tmpvar_5; } -// inputs: 5, stats: 16 alu 0 tex 0 flow +// stats: 16 alu 0 tex 0 flow +// inputs: 5 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #2: gl_Normal (high float) 3x1 [-1] loc 2 +// #3: gl_Vertex (high float) 4x1 [-1] loc 0 +// #4: TANGENT (high float) 4x1 [-1] +// uniforms: 6 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _ProjectionParams (high float) 4x1 [-1] +// #2: _Object2World (high float) 4x4 [-1] +// #3: _MainTex_ST (high float) 4x1 [-1] +// #4: _DetailAlbedoMap_ST (high float) 4x1 [-1] +// #5: unity_LightmapST (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-ir.txt deleted file mode 100644 index 978cd6068..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-ir.txt +++ /dev/null @@ -1,177 +0,0 @@ -struct v2f_surf { - vec4 pos; - vec2 hip_pack0; - vec3 TtoV0; - vec3 TtoV1; - vec3 TtoV2; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _BumpMap_ST; -attribute vec4 TANGENT; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -v2f_surf vert_surf ( - in appdata_full v_9 -) -{ - mat3 rotation_10; - vec3 binormal_11; - v2f_surf o_12; - vec4 tmpvar_13; - tmpvar_13 = (gl_ModelViewProjectionMatrix * v_9.vertex); - o_12.pos = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = ((v_9.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_12.hip_pack0 = tmpvar_14.xy.xy; - vec3 tmpvar_15; - tmpvar_15 = cross (v_9.normal, v_9.tangent.xyz); - vec3 tmpvar_16; - tmpvar_16 = (tmpvar_15 * v_9.tangent.w); - binormal_11 = tmpvar_16; - mat3 tmpvar_17; - float tmpvar_18; - tmpvar_18 = v_9.tangent.x; - tmpvar_17[0].x = tmpvar_18; - float tmpvar_19; - tmpvar_19 = binormal_11.x; - tmpvar_17[0].y = tmpvar_19; - float tmpvar_20; - tmpvar_20 = v_9.normal.x; - tmpvar_17[0].z = tmpvar_20; - float tmpvar_21; - tmpvar_21 = v_9.tangent.y; - tmpvar_17[1].x = tmpvar_21; - float tmpvar_22; - tmpvar_22 = binormal_11.y; - tmpvar_17[1].y = tmpvar_22; - float tmpvar_23; - tmpvar_23 = v_9.normal.y; - tmpvar_17[1].z = tmpvar_23; - float tmpvar_24; - tmpvar_24 = v_9.tangent.z; - tmpvar_17[2].x = tmpvar_24; - float tmpvar_25; - tmpvar_25 = binormal_11.z; - tmpvar_17[2].y = tmpvar_25; - float tmpvar_26; - tmpvar_26 = v_9.normal.z; - tmpvar_17[2].z = tmpvar_26; - mat3 tmpvar_27; - tmpvar_27 = tmpvar_17; - rotation_10 = tmpvar_27; - mat3 tmpvar_28; - tmpvar_28 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose); - vec3 tmpvar_29; - tmpvar_29 = (rotation_10 * tmpvar_28[0].xyz); - o_12.TtoV0 = tmpvar_29; - mat3 tmpvar_30; - tmpvar_30 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose); - vec3 tmpvar_31; - tmpvar_31 = (rotation_10 * tmpvar_30[1].xyz); - o_12.TtoV1 = tmpvar_31; - mat3 tmpvar_32; - tmpvar_32 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose); - vec3 tmpvar_33; - tmpvar_33 = (rotation_10 * tmpvar_32[2].xyz); - o_12.TtoV2 = tmpvar_33; - return o_12; -} - -void main () -{ - appdata_full xlt_v_34; - v2f_surf xl_retval_35; - vec4 tmpvar_36; - tmpvar_36 = gl_Vertex.xyzw; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlt_v_34.vertex = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = TANGENT.xyzw; - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - xlt_v_34.tangent = tmpvar_39; - vec3 tmpvar_40; - tmpvar_40 = gl_Normal.xyz; - vec3 tmpvar_41; - tmpvar_41 = tmpvar_40; - xlt_v_34.normal = tmpvar_41; - vec4 tmpvar_42; - tmpvar_42 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - xlt_v_34.texcoord = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - xlt_v_34.texcoord1 = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46 = gl_Color.xyzw; - vec4 tmpvar_47; - tmpvar_47 = tmpvar_46; - xlt_v_34.color = tmpvar_47; - v2f_surf tmpvar_48; - tmpvar_48 = vert_surf (xlt_v_34); - v2f_surf tmpvar_49; - tmpvar_49 = tmpvar_48; - xl_retval_35 = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50 = xl_retval_35.pos.xyzw; - vec4 tmpvar_51; - tmpvar_51 = tmpvar_50; - gl_Position = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52.zw = vec2(0.0, 0.0); - tmpvar_52.xy = xl_retval_35.hip_pack0.xy; - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - gl_TexCoord[0] = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54.w = 0.0; - tmpvar_54.xyz = xl_retval_35.TtoV0.xyz; - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - gl_TexCoord[1] = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56.w = 0.0; - tmpvar_56.xyz = xl_retval_35.TtoV1.xyz; - vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - gl_TexCoord[2] = tmpvar_57; - vec4 tmpvar_58; - tmpvar_58.w = 0.0; - tmpvar_58.xyz = xl_retval_35.TtoV2.xyz; - vec4 tmpvar_59; - tmpvar_59 = tmpvar_58; - gl_TexCoord[3] = tmpvar_59; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-out.txt index d5d4cef51..d1e731e77 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-out.txt @@ -2,17 +2,17 @@ uniform vec4 _BumpMap_ST; attribute vec4 TANGENT; void main () { - vec3 tmpvar_1; - tmpvar_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + vec3 binormal_1; + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_2; tmpvar_2[0].x = TANGENT.x; - tmpvar_2[0].y = tmpvar_1.x; + tmpvar_2[0].y = binormal_1.x; tmpvar_2[0].z = gl_Normal.x; tmpvar_2[1].x = TANGENT.y; - tmpvar_2[1].y = tmpvar_1.y; + tmpvar_2[1].y = binormal_1.y; tmpvar_2[1].z = gl_Normal.y; tmpvar_2[2].x = TANGENT.z; - tmpvar_2[2].y = tmpvar_1.z; + tmpvar_2[2].y = binormal_1.z; tmpvar_2[2].z = gl_Normal.z; gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); vec4 tmpvar_3; @@ -34,4 +34,13 @@ void main () } -// inputs: 4, stats: 14 alu 0 tex 0 flow +// stats: 14 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 3 (total size: 0) +// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] +// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #2: _BumpMap_ST (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-ir.txt deleted file mode 100644 index 9afae106c..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-ir.txt +++ /dev/null @@ -1,132 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 hip_screen; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _MainTex_ST; -uniform vec4 _ProjectionParams; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec4 ComputeScreenPos ( - in vec4 pos_6 -) -{ - vec4 o_7; - vec4 tmpvar_8; - tmpvar_8 = (pos_6 * 0.5); - o_7 = tmpvar_8; - vec2 tmpvar_9; - tmpvar_9.x = o_7.x; - tmpvar_9.y = (o_7.y * _ProjectionParams.x); - vec2 tmpvar_10; - tmpvar_10 = (tmpvar_9 + o_7.w); - o_7.xy = tmpvar_10.xy.xy; - vec2 tmpvar_11; - tmpvar_11 = pos_6.zw; - o_7.zw = tmpvar_11.xxxy.zw; - return o_7; -} - -v2f_surf vert_surf ( - in appdata_full v_12 -) -{ - v2f_surf o_13; - PositionFog (v_12.vertex, o_13.pos, o_13.fog); - vec2 tmpvar_14; - tmpvar_14 = ((v_12.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_13.hip_pack0 = tmpvar_14.xy.xy; - vec4 tmpvar_15; - tmpvar_15 = ComputeScreenPos (o_13.pos); - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - o_13.hip_screen = tmpvar_16; - return o_13; -} - -void main () -{ - appdata_full xlt_v_17; - v2f_surf xl_retval_18; - vec4 tmpvar_19; - tmpvar_19 = gl_Vertex.xyzw; - vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - xlt_v_17.vertex = tmpvar_20; - vec4 tmpvar_21; - tmpvar_21 = TANGENT.xyzw; - vec4 tmpvar_22; - tmpvar_22 = tmpvar_21; - xlt_v_17.tangent = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = gl_Normal.xyz; - vec3 tmpvar_24; - tmpvar_24 = tmpvar_23; - xlt_v_17.normal = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; - xlt_v_17.texcoord = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - xlt_v_17.texcoord1 = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = gl_Color.xyzw; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - xlt_v_17.color = tmpvar_30; - v2f_surf tmpvar_31; - tmpvar_31 = vert_surf (xlt_v_17); - v2f_surf tmpvar_32; - tmpvar_32 = tmpvar_31; - xl_retval_18 = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = xl_retval_18.pos.xyzw; - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - gl_Position = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_35.x = xl_retval_18.fog; - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlv_FOG = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37.zw = vec2(0.0, 0.0); - tmpvar_37.xy = xl_retval_18.hip_pack0.xy; - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - gl_TexCoord[0] = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = xl_retval_18.hip_screen.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - gl_TexCoord[1] = tmpvar_40; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-out.txt index 5f8bfc54f..d66048d59 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-out.txt @@ -3,27 +3,33 @@ uniform vec4 _ProjectionParams; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_1; + pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); vec4 o_2; - vec4 tmpvar_3; - tmpvar_3 = (tmpvar_1 * 0.5); - vec2 tmpvar_4; - tmpvar_4.x = tmpvar_3.x; - tmpvar_4.y = (tmpvar_3.y * _ProjectionParams.x); - o_2.xy = (tmpvar_4 + tmpvar_3.w); - o_2.zw = tmpvar_1.zw; - gl_Position = tmpvar_1; + o_2 = (pos_1 * 0.5); + vec2 tmpvar_3; + tmpvar_3.x = o_2.x; + tmpvar_3.y = (o_2.y * _ProjectionParams.x); + o_2.xy = (tmpvar_3 + o_2.w); + o_2.zw = pos_1.zw; + gl_Position = pos_1; + vec4 tmpvar_4; + tmpvar_4.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_4.x = pos_1.z; + xlv_FOG = tmpvar_4; vec4 tmpvar_5; - tmpvar_5.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_5.x = tmpvar_1.z; - xlv_FOG = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6.zw = vec2(0.0, 0.0); - tmpvar_6.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_6; + tmpvar_5.zw = vec2(0.0, 0.0); + tmpvar_5.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_5; gl_TexCoord[1] = o_2; } -// inputs: 2, stats: 8 alu 0 tex 0 flow +// stats: 8 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 3 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _MainTex_ST (high float) 4x1 [-1] +// #2: _ProjectionParams (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-ir.txt deleted file mode 100644 index 20ca719ca..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-ir.txt +++ /dev/null @@ -1,439 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec3 lightDir; - vec3 vlight; - vec4 _ShadowCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _BumpMap_ST; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _ProjectionParams; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_4LightAtten0; -uniform vec4 unity_4LightPosX0; -uniform vec4 unity_4LightPosY0; -uniform vec4 unity_4LightPosZ0; -uniform vec3 unity_LightColor0; -uniform vec3 unity_LightColor1; -uniform vec3 unity_LightColor2; -uniform vec3 unity_LightColor3; -uniform vec4 unity_SHAb; -uniform vec4 unity_SHAg; -uniform vec4 unity_SHAr; -uniform vec4 unity_SHBb; -uniform vec4 unity_SHBg; -uniform vec4 unity_SHBr; -uniform vec4 unity_SHC; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec3 ShadeSH9 ( - in vec4 normal_9 -) -{ - vec3 x3_10; - float vC_11; - vec3 x2_12; - vec4 vB_13; - vec3 x1_14; - float tmpvar_15; - tmpvar_15 = dot (unity_SHAr, normal_9); - float tmpvar_16; - tmpvar_16 = tmpvar_15; - x1_14.x = tmpvar_16; - float tmpvar_17; - tmpvar_17 = dot (unity_SHAg, normal_9); - float tmpvar_18; - tmpvar_18 = tmpvar_17; - x1_14.y = vec2(tmpvar_18).y; - float tmpvar_19; - tmpvar_19 = dot (unity_SHAb, normal_9); - float tmpvar_20; - tmpvar_20 = tmpvar_19; - x1_14.z = vec3(tmpvar_20).z; - vec4 tmpvar_21; - tmpvar_21 = (normal_9.xyzz * normal_9.yzzx); - vB_13 = tmpvar_21; - float tmpvar_22; - tmpvar_22 = dot (unity_SHBr, vB_13); - float tmpvar_23; - tmpvar_23 = tmpvar_22; - x2_12.x = tmpvar_23; - float tmpvar_24; - tmpvar_24 = dot (unity_SHBg, vB_13); - float tmpvar_25; - tmpvar_25 = tmpvar_24; - x2_12.y = vec2(tmpvar_25).y; - float tmpvar_26; - tmpvar_26 = dot (unity_SHBb, vB_13); - float tmpvar_27; - tmpvar_27 = tmpvar_26; - x2_12.z = vec3(tmpvar_27).z; - float tmpvar_28; - tmpvar_28 = ((normal_9.x * normal_9.x) - (normal_9.y * normal_9.y)); - vC_11 = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = (unity_SHC.xyz * vC_11); - x3_10 = tmpvar_29; - return ((x1_14 + x2_12) + x3_10); -} - -vec3 Shade4PointLights ( - in vec4 lightPosX_30, - in vec4 lightPosY_31, - in vec4 lightPosZ_32, - in vec3 lightColor0_33, - in vec3 lightColor1_34, - in vec3 lightColor2_35, - in vec3 lightColor3_36, - in vec4 lightAttenSq_37, - in vec3 pos_38, - in vec3 normal_39 -) -{ - vec3 col_40; - vec4 diff_41; - vec4 atten_42; - vec4 corr_43; - vec4 ndotl_44; - vec4 lengthSq_45; - vec4 toLightZ_46; - vec4 toLightY_47; - vec4 toLightX_48; - vec4 tmpvar_49; - tmpvar_49 = (lightPosX_30 - pos_38.x); - toLightX_48 = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50 = (lightPosY_31 - pos_38.y); - toLightY_47 = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = (lightPosZ_32 - pos_38.z); - toLightZ_46 = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = vec4(0.0, 0.0, 0.0, 0.0); - lengthSq_45 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = (lengthSq_45 + (toLightX_48 * toLightX_48)); - lengthSq_45 = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54 = (lengthSq_45 + (toLightY_47 * toLightY_47)); - lengthSq_45 = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = (lengthSq_45 + (toLightZ_46 * toLightZ_46)); - lengthSq_45 = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = vec4(0.0, 0.0, 0.0, 0.0); - ndotl_44 = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = (ndotl_44 + (toLightX_48 * normal_39.x)); - ndotl_44 = tmpvar_57; - vec4 tmpvar_58; - tmpvar_58 = (ndotl_44 + (toLightY_47 * normal_39.y)); - ndotl_44 = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59 = (ndotl_44 + (toLightZ_46 * normal_39.z)); - ndotl_44 = tmpvar_59; - vec4 tmpvar_60; - tmpvar_60 = inversesqrt (lengthSq_45); - vec4 tmpvar_61; - tmpvar_61 = tmpvar_60; - corr_43 = tmpvar_61; - vec4 tmpvar_62; - tmpvar_62 = max (vec4(0.0, 0.0, 0.0, 0.0), (ndotl_44 * corr_43)); - vec4 tmpvar_63; - tmpvar_63 = tmpvar_62; - ndotl_44 = tmpvar_63; - vec4 tmpvar_64; - tmpvar_64 = (1.0 / (1.0 + (lengthSq_45 * lightAttenSq_37))); - atten_42 = tmpvar_64; - vec4 tmpvar_65; - tmpvar_65 = (ndotl_44 * atten_42); - diff_41 = tmpvar_65; - vec3 tmpvar_66; - tmpvar_66 = vec3(0.0, 0.0, 0.0); - col_40 = tmpvar_66; - vec3 tmpvar_67; - tmpvar_67 = (col_40 + (lightColor0_33 * diff_41.x)); - col_40 = tmpvar_67; - vec3 tmpvar_68; - tmpvar_68 = (col_40 + (lightColor1_34 * diff_41.y)); - col_40 = tmpvar_68; - vec3 tmpvar_69; - tmpvar_69 = (col_40 + (lightColor2_35 * diff_41.z)); - col_40 = tmpvar_69; - vec3 tmpvar_70; - tmpvar_70 = (col_40 + (lightColor3_36 * diff_41.w)); - col_40 = tmpvar_70; - return col_40; -} - -void PositionFog ( - in vec4 v_71, - out vec4 pos_72, - out float fog_73 -) -{ - vec4 tmpvar_74; - tmpvar_74 = (gl_ModelViewProjectionMatrix * v_71); - pos_72 = tmpvar_74; - float tmpvar_75; - tmpvar_75 = pos_72.z; - fog_73 = tmpvar_75; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_76 -) -{ - vec3 objSpaceCameraPos_77; - vec4 tmpvar_78; - tmpvar_78.w = 1.0; - tmpvar_78.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_79; - tmpvar_79 = ((_World2Object * tmpvar_78).xyz * unity_Scale.w); - objSpaceCameraPos_77 = tmpvar_79; - return (objSpaceCameraPos_77 - v_76.xyz); -} - -vec3 ObjSpaceLightDir ( - in vec4 v_80 -) -{ - vec3 objSpaceLightPos_81; - vec3 tmpvar_82; - tmpvar_82 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_81 = tmpvar_82; - return objSpaceLightPos_81.xyz; -} - -vec4 ComputeScreenPos ( - in vec4 pos_83 -) -{ - vec4 o_84; - vec4 tmpvar_85; - tmpvar_85 = (pos_83 * 0.5); - o_84 = tmpvar_85; - vec2 tmpvar_86; - tmpvar_86.x = o_84.x; - tmpvar_86.y = (o_84.y * _ProjectionParams.x); - vec2 tmpvar_87; - tmpvar_87 = (tmpvar_86 + o_84.w); - o_84.xy = tmpvar_87.xy.xy; - vec2 tmpvar_88; - tmpvar_88 = pos_83.zw; - o_84.zw = tmpvar_88.xxxy.zw; - return o_84; -} - -v2f_surf vert_surf ( - in appdata_full v_89 -) -{ - vec3 worldPos_90; - vec3 shlight_91; - mat3 rotation_92; - vec3 binormal_93; - vec3 worldN_94; - v2f_surf o_95; - PositionFog (v_89.vertex, o_95.pos, o_95.fog); - vec2 tmpvar_96; - tmpvar_96 = ((v_89.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_95.hip_pack0.xy = tmpvar_96.xy.xy; - vec2 tmpvar_97; - tmpvar_97 = ((v_89.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_95.hip_pack0.zw = tmpvar_97.xxxy.zw; - mat3 tmpvar_98; - tmpvar_98 = xll_constructMat3 (_Object2World); - vec3 tmpvar_99; - tmpvar_99 = (tmpvar_98 * (v_89.normal * unity_Scale.w)); - worldN_94 = tmpvar_99; - vec3 tmpvar_100; - tmpvar_100 = cross (v_89.normal, v_89.tangent.xyz); - vec3 tmpvar_101; - tmpvar_101 = (tmpvar_100 * v_89.tangent.w); - binormal_93 = tmpvar_101; - mat3 tmpvar_102; - float tmpvar_103; - tmpvar_103 = v_89.tangent.x; - tmpvar_102[0].x = tmpvar_103; - float tmpvar_104; - tmpvar_104 = binormal_93.x; - tmpvar_102[0].y = tmpvar_104; - float tmpvar_105; - tmpvar_105 = v_89.normal.x; - tmpvar_102[0].z = tmpvar_105; - float tmpvar_106; - tmpvar_106 = v_89.tangent.y; - tmpvar_102[1].x = tmpvar_106; - float tmpvar_107; - tmpvar_107 = binormal_93.y; - tmpvar_102[1].y = tmpvar_107; - float tmpvar_108; - tmpvar_108 = v_89.normal.y; - tmpvar_102[1].z = tmpvar_108; - float tmpvar_109; - tmpvar_109 = v_89.tangent.z; - tmpvar_102[2].x = tmpvar_109; - float tmpvar_110; - tmpvar_110 = binormal_93.z; - tmpvar_102[2].y = tmpvar_110; - float tmpvar_111; - tmpvar_111 = v_89.normal.z; - tmpvar_102[2].z = tmpvar_111; - mat3 tmpvar_112; - tmpvar_112 = tmpvar_102; - rotation_92 = tmpvar_112; - vec3 tmpvar_113; - tmpvar_113 = ObjSpaceLightDir (v_89.vertex); - vec3 tmpvar_114; - tmpvar_114 = (rotation_92 * tmpvar_113); - o_95.lightDir = tmpvar_114; - vec3 tmpvar_115; - tmpvar_115 = ObjSpaceViewDir (v_89.vertex); - vec3 tmpvar_116; - tmpvar_116 = (rotation_92 * tmpvar_115); - o_95.viewDir = tmpvar_116; - vec4 tmpvar_117; - tmpvar_117.w = 1.0; - tmpvar_117.xyz = worldN_94.xyz; - vec3 tmpvar_118; - tmpvar_118 = ShadeSH9 (tmpvar_117); - vec3 tmpvar_119; - tmpvar_119 = tmpvar_118; - shlight_91 = tmpvar_119; - vec3 tmpvar_120; - tmpvar_120 = shlight_91; - o_95.vlight = tmpvar_120; - vec3 tmpvar_121; - tmpvar_121 = (_Object2World * v_89.vertex).xyz; - worldPos_90 = tmpvar_121; - vec3 tmpvar_122; - tmpvar_122 = Shade4PointLights (unity_4LightPosX0, unity_4LightPosY0, unity_4LightPosZ0, unity_LightColor0, unity_LightColor1, unity_LightColor2, unity_LightColor3, unity_4LightAtten0, worldPos_90, worldN_94); - vec3 tmpvar_123; - tmpvar_123 = (o_95.vlight + tmpvar_122); - o_95.vlight = tmpvar_123; - vec4 tmpvar_124; - tmpvar_124 = ComputeScreenPos (o_95.pos); - vec4 tmpvar_125; - tmpvar_125 = tmpvar_124; - o_95._ShadowCoord = tmpvar_125; - return o_95; -} - -void main () -{ - appdata_full xlt_v_126; - v2f_surf xl_retval_127; - vec4 tmpvar_128; - tmpvar_128 = gl_Vertex.xyzw; - vec4 tmpvar_129; - tmpvar_129 = tmpvar_128; - xlt_v_126.vertex = tmpvar_129; - vec4 tmpvar_130; - tmpvar_130 = TANGENT.xyzw; - vec4 tmpvar_131; - tmpvar_131 = tmpvar_130; - xlt_v_126.tangent = tmpvar_131; - vec3 tmpvar_132; - tmpvar_132 = gl_Normal.xyz; - vec3 tmpvar_133; - tmpvar_133 = tmpvar_132; - xlt_v_126.normal = tmpvar_133; - vec4 tmpvar_134; - tmpvar_134 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_135; - tmpvar_135 = tmpvar_134; - xlt_v_126.texcoord = tmpvar_135; - vec4 tmpvar_136; - tmpvar_136 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_137; - tmpvar_137 = tmpvar_136; - xlt_v_126.texcoord1 = tmpvar_137; - vec4 tmpvar_138; - tmpvar_138 = gl_Color.xyzw; - vec4 tmpvar_139; - tmpvar_139 = tmpvar_138; - xlt_v_126.color = tmpvar_139; - v2f_surf tmpvar_140; - tmpvar_140 = vert_surf (xlt_v_126); - v2f_surf tmpvar_141; - tmpvar_141 = tmpvar_140; - xl_retval_127 = tmpvar_141; - vec4 tmpvar_142; - tmpvar_142 = xl_retval_127.pos.xyzw; - vec4 tmpvar_143; - tmpvar_143 = tmpvar_142; - gl_Position = tmpvar_143; - vec4 tmpvar_144; - tmpvar_144.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_144.x = xl_retval_127.fog; - vec4 tmpvar_145; - tmpvar_145 = tmpvar_144; - xlv_FOG = tmpvar_145; - vec4 tmpvar_146; - tmpvar_146 = xl_retval_127.hip_pack0.xyzw; - vec4 tmpvar_147; - tmpvar_147 = tmpvar_146; - gl_TexCoord[0] = tmpvar_147; - vec4 tmpvar_148; - tmpvar_148.w = 0.0; - tmpvar_148.xyz = xl_retval_127.viewDir.xyz; - vec4 tmpvar_149; - tmpvar_149 = tmpvar_148; - gl_TexCoord[1] = tmpvar_149; - vec4 tmpvar_150; - tmpvar_150.w = 0.0; - tmpvar_150.xyz = xl_retval_127.lightDir.xyz; - vec4 tmpvar_151; - tmpvar_151 = tmpvar_150; - gl_TexCoord[2] = tmpvar_151; - vec4 tmpvar_152; - tmpvar_152.w = 0.0; - tmpvar_152.xyz = xl_retval_127.vlight.xyz; - vec4 tmpvar_153; - tmpvar_153 = tmpvar_152; - gl_TexCoord[3] = tmpvar_153; - vec4 tmpvar_154; - tmpvar_154 = xl_retval_127._ShadowCoord.xyzw; - vec4 tmpvar_155; - tmpvar_155 = tmpvar_154; - gl_TexCoord[4] = tmpvar_155; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-out.txt index 1ced1167a..c32d58fed 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-out.txt @@ -25,99 +25,134 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); - tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - mat3 tmpvar_3; - tmpvar_3[0] = _Object2World[0].xyz; - tmpvar_3[1] = _Object2World[1].xyz; - tmpvar_3[2] = _Object2World[2].xyz; - vec3 tmpvar_4; - tmpvar_4 = (tmpvar_3 * (gl_Normal * unity_Scale.w)); - vec3 tmpvar_5; - tmpvar_5 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + vec3 worldPos_1; + vec3 binormal_2; + vec3 worldN_3; + vec4 tmpvar_4; + vec4 pos_5; + pos_5 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_4.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + tmpvar_4.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); mat3 tmpvar_6; - tmpvar_6[0].x = TANGENT.x; - tmpvar_6[0].y = tmpvar_5.x; - tmpvar_6[0].z = gl_Normal.x; - tmpvar_6[1].x = TANGENT.y; - tmpvar_6[1].y = tmpvar_5.y; - tmpvar_6[1].z = gl_Normal.y; - tmpvar_6[2].x = TANGENT.z; - tmpvar_6[2].y = tmpvar_5.z; - tmpvar_6[2].z = gl_Normal.z; - vec4 tmpvar_7; - tmpvar_7.w = 1.0; - tmpvar_7.xyz = _WorldSpaceCameraPos; + tmpvar_6[0] = _Object2World[0].xyz; + tmpvar_6[1] = _Object2World[1].xyz; + tmpvar_6[2] = _Object2World[2].xyz; + worldN_3 = (tmpvar_6 * (gl_Normal * unity_Scale.w)); + binormal_2 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + mat3 tmpvar_7; + tmpvar_7[0].x = TANGENT.x; + tmpvar_7[0].y = binormal_2.x; + tmpvar_7[0].z = gl_Normal.x; + tmpvar_7[1].x = TANGENT.y; + tmpvar_7[1].y = binormal_2.y; + tmpvar_7[1].z = gl_Normal.y; + tmpvar_7[2].x = TANGENT.z; + tmpvar_7[2].y = binormal_2.z; + tmpvar_7[2].z = gl_Normal.z; vec4 tmpvar_8; tmpvar_8.w = 1.0; - tmpvar_8.xyz = tmpvar_4; - vec3 x2_9; - vec3 x1_10; - x1_10.x = dot (unity_SHAr, tmpvar_8); - x1_10.y = dot (unity_SHAg, tmpvar_8); - x1_10.z = dot (unity_SHAb, tmpvar_8); - vec4 tmpvar_11; - tmpvar_11 = (tmpvar_4.xyzz * tmpvar_4.yzzx); - x2_9.x = dot (unity_SHBr, tmpvar_11); - x2_9.y = dot (unity_SHBg, tmpvar_11); - x2_9.z = dot (unity_SHBb, tmpvar_11); - vec3 tmpvar_12; - tmpvar_12 = (_Object2World * gl_Vertex).xyz; - vec4 tmpvar_13; - tmpvar_13 = (unity_4LightPosX0 - tmpvar_12.x); - vec4 tmpvar_14; - tmpvar_14 = (unity_4LightPosY0 - tmpvar_12.y); - vec4 tmpvar_15; - tmpvar_15 = (unity_4LightPosZ0 - tmpvar_12.z); - vec4 tmpvar_16; - tmpvar_16 = (((tmpvar_13 * tmpvar_13) + (tmpvar_14 * tmpvar_14)) + (tmpvar_15 * tmpvar_15)); - vec4 tmpvar_17; - tmpvar_17 = (max (vec4(0.0, 0.0, 0.0, 0.0), ( - (((tmpvar_13 * tmpvar_4.x) + (tmpvar_14 * tmpvar_4.y)) + (tmpvar_15 * tmpvar_4.z)) - * - inversesqrt(tmpvar_16) - )) * (1.0/((1.0 + - (tmpvar_16 * unity_4LightAtten0) + tmpvar_8.xyz = _WorldSpaceCameraPos; + vec4 tmpvar_9; + tmpvar_9.w = 1.0; + tmpvar_9.xyz = worldN_3; + vec3 x2_10; + vec4 vB_11; + vec3 x1_12; + x1_12.x = dot (unity_SHAr, tmpvar_9); + x1_12.y = dot (unity_SHAg, tmpvar_9); + x1_12.z = dot (unity_SHAb, tmpvar_9); + vB_11 = (worldN_3.xyzz * worldN_3.yzzx); + x2_10.x = dot (unity_SHBr, vB_11); + x2_10.y = dot (unity_SHBg, vB_11); + x2_10.z = dot (unity_SHBb, vB_11); + worldPos_1 = (_Object2World * gl_Vertex).xyz; + vec3 col_13; + vec4 diff_14; + vec4 ndotl_15; + vec4 lengthSq_16; + vec4 toLightZ_17; + vec4 toLightY_18; + vec4 toLightX_19; + toLightX_19 = (unity_4LightPosX0 - worldPos_1.x); + toLightY_18 = (unity_4LightPosY0 - worldPos_1.y); + toLightZ_17 = (unity_4LightPosZ0 - worldPos_1.z); + lengthSq_16 = (toLightX_19 * toLightX_19); + lengthSq_16 = (lengthSq_16 + (toLightY_18 * toLightY_18)); + lengthSq_16 = (lengthSq_16 + (toLightZ_17 * toLightZ_17)); + ndotl_15 = (toLightX_19 * worldN_3.x); + ndotl_15 = (ndotl_15 + (toLightY_18 * worldN_3.y)); + ndotl_15 = (ndotl_15 + (toLightZ_17 * worldN_3.z)); + vec4 tmpvar_20; + tmpvar_20 = max (vec4(0.0, 0.0, 0.0, 0.0), (ndotl_15 * inversesqrt(lengthSq_16))); + ndotl_15 = tmpvar_20; + diff_14 = (tmpvar_20 * (1.0/((1.0 + + (lengthSq_16 * unity_4LightAtten0) )))); - vec4 o_18; - vec4 tmpvar_19; - tmpvar_19 = (tmpvar_2 * 0.5); - vec2 tmpvar_20; - tmpvar_20.x = tmpvar_19.x; - tmpvar_20.y = (tmpvar_19.y * _ProjectionParams.x); - o_18.xy = (tmpvar_20 + tmpvar_19.w); - o_18.zw = tmpvar_2.zw; - gl_Position = tmpvar_2; - vec4 tmpvar_21; - tmpvar_21.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_21.x = tmpvar_2.z; - xlv_FOG = tmpvar_21; - gl_TexCoord[0] = tmpvar_1; - vec4 tmpvar_22; - tmpvar_22.w = 0.0; - tmpvar_22.xyz = (tmpvar_6 * (( - (_World2Object * tmpvar_7) - .xyz * unity_Scale.w) - gl_Vertex.xyz)); - gl_TexCoord[1] = tmpvar_22; + col_13 = (unity_LightColor0 * diff_14.x); + col_13 = (col_13 + (unity_LightColor1 * diff_14.y)); + col_13 = (col_13 + (unity_LightColor2 * diff_14.z)); + col_13 = (col_13 + (unity_LightColor3 * diff_14.w)); + vec4 o_21; + o_21 = (pos_5 * 0.5); + vec2 tmpvar_22; + tmpvar_22.x = o_21.x; + tmpvar_22.y = (o_21.y * _ProjectionParams.x); + o_21.xy = (tmpvar_22 + o_21.w); + o_21.zw = pos_5.zw; + gl_Position = pos_5; vec4 tmpvar_23; - tmpvar_23.w = 0.0; - tmpvar_23.xyz = (tmpvar_6 * (_World2Object * _WorldSpaceLightPos0).xyz); - gl_TexCoord[2] = tmpvar_23; + tmpvar_23.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_23.x = pos_5.z; + xlv_FOG = tmpvar_23; + gl_TexCoord[0] = tmpvar_4; vec4 tmpvar_24; tmpvar_24.w = 0.0; - tmpvar_24.xyz = (((x1_10 + x2_9) + (unity_SHC.xyz * - ((tmpvar_4.x * tmpvar_4.x) - (tmpvar_4.y * tmpvar_4.y)) - )) + (( - ((unity_LightColor0 * tmpvar_17.x) + (unity_LightColor1 * tmpvar_17.y)) - + - (unity_LightColor2 * tmpvar_17.z) - ) + (unity_LightColor3 * tmpvar_17.w))); - gl_TexCoord[3] = tmpvar_24; - gl_TexCoord[4] = o_18; + tmpvar_24.xyz = (tmpvar_7 * (( + (_World2Object * tmpvar_8) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); + gl_TexCoord[1] = tmpvar_24; + vec4 tmpvar_25; + tmpvar_25.w = 0.0; + tmpvar_25.xyz = (tmpvar_7 * (_World2Object * _WorldSpaceLightPos0).xyz); + gl_TexCoord[2] = tmpvar_25; + vec4 tmpvar_26; + tmpvar_26.w = 0.0; + tmpvar_26.xyz = (((x1_12 + x2_10) + (unity_SHC.xyz * + ((worldN_3.x * worldN_3.x) - (worldN_3.y * worldN_3.y)) + )) + col_13); + gl_TexCoord[3] = tmpvar_26; + gl_TexCoord[4] = o_21; } -// inputs: 4, stats: 68 alu 0 tex 0 flow +// stats: 68 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 24 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _BumpMap_ST (high float) 4x1 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _ProjectionParams (high float) 4x1 [-1] +// #5: _World2Object (high float) 4x4 [-1] +// #6: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #7: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #8: unity_4LightAtten0 (high float) 4x1 [-1] +// #9: unity_4LightPosX0 (high float) 4x1 [-1] +// #10: unity_4LightPosY0 (high float) 4x1 [-1] +// #11: unity_4LightPosZ0 (high float) 4x1 [-1] +// #12: unity_LightColor0 (high float) 3x1 [-1] +// #13: unity_LightColor1 (high float) 3x1 [-1] +// #14: unity_LightColor2 (high float) 3x1 [-1] +// #15: unity_LightColor3 (high float) 3x1 [-1] +// #16: unity_SHAb (high float) 4x1 [-1] +// #17: unity_SHAg (high float) 4x1 [-1] +// #18: unity_SHAr (high float) 4x1 [-1] +// #19: unity_SHBb (high float) 4x1 [-1] +// #20: unity_SHBg (high float) 4x1 [-1] +// #21: unity_SHBr (high float) 4x1 [-1] +// #22: unity_SHC (high float) 4x1 [-1] +// #23: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-ir.txt deleted file mode 100644 index ec3cdf973..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-ir.txt +++ /dev/null @@ -1,149 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 hip_screen; - vec3 hip_lmapFade; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _MainTex_ST; -uniform vec4 _ProjectionParams; -uniform vec4 unity_LightmapFade; -uniform vec4 unity_LightmapST; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec4 ComputeScreenPos ( - in vec4 pos_6 -) -{ - vec4 o_7; - vec4 tmpvar_8; - tmpvar_8 = (pos_6 * 0.5); - o_7 = tmpvar_8; - vec2 tmpvar_9; - tmpvar_9.x = o_7.x; - tmpvar_9.y = (o_7.y * _ProjectionParams.x); - vec2 tmpvar_10; - tmpvar_10 = (tmpvar_9 + o_7.w); - o_7.xy = tmpvar_10.xy.xy; - vec2 tmpvar_11; - tmpvar_11 = pos_6.zw; - o_7.zw = tmpvar_11.xxxy.zw; - return o_7; -} - -v2f_surf vert_surf ( - in appdata_full v_12 -) -{ - v2f_surf o_13; - PositionFog (v_12.vertex, o_13.pos, o_13.fog); - vec2 tmpvar_14; - tmpvar_14 = ((v_12.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_13.hip_pack0 = tmpvar_14.xy.xy; - vec4 tmpvar_15; - tmpvar_15 = ComputeScreenPos (o_13.pos); - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - o_13.hip_screen = tmpvar_16; - vec2 tmpvar_17; - tmpvar_17 = ((v_12.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - o_13.hip_lmapFade.xy = tmpvar_17.xy.xy; - float tmpvar_18; - tmpvar_18 = ((-( - (gl_ModelViewMatrix * v_12.vertex) - .z) * unity_LightmapFade.z) + unity_LightmapFade.w); - o_13.hip_lmapFade.z = vec3(tmpvar_18).z; - return o_13; -} - -void main () -{ - appdata_full xlt_v_19; - v2f_surf xl_retval_20; - vec4 tmpvar_21; - tmpvar_21 = gl_Vertex.xyzw; - vec4 tmpvar_22; - tmpvar_22 = tmpvar_21; - xlt_v_19.vertex = tmpvar_22; - vec4 tmpvar_23; - tmpvar_23 = TANGENT.xyzw; - vec4 tmpvar_24; - tmpvar_24 = tmpvar_23; - xlt_v_19.tangent = tmpvar_24; - vec3 tmpvar_25; - tmpvar_25 = gl_Normal.xyz; - vec3 tmpvar_26; - tmpvar_26 = tmpvar_25; - xlt_v_19.normal = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - xlt_v_19.texcoord = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - xlt_v_19.texcoord1 = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = gl_Color.xyzw; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_31; - xlt_v_19.color = tmpvar_32; - v2f_surf tmpvar_33; - tmpvar_33 = vert_surf (xlt_v_19); - v2f_surf tmpvar_34; - tmpvar_34 = tmpvar_33; - xl_retval_20 = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35 = xl_retval_20.pos.xyzw; - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - gl_Position = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_37.x = xl_retval_20.fog; - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlv_FOG = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39.zw = vec2(0.0, 0.0); - tmpvar_39.xy = xl_retval_20.hip_pack0.xy; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - gl_TexCoord[0] = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = xl_retval_20.hip_screen.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - gl_TexCoord[1] = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43.w = 0.0; - tmpvar_43.xyz = xl_retval_20.hip_lmapFade.xyz; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - gl_TexCoord[2] = tmpvar_44; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-out.txt index e8a9b9657..1ddacd635 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-out.txt @@ -6,35 +6,45 @@ varying vec4 xlv_FOG; void main () { vec3 tmpvar_1; - vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_2; + pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); vec4 o_3; - vec4 tmpvar_4; - tmpvar_4 = (tmpvar_2 * 0.5); - vec2 tmpvar_5; - tmpvar_5.x = tmpvar_4.x; - tmpvar_5.y = (tmpvar_4.y * _ProjectionParams.x); - o_3.xy = (tmpvar_5 + tmpvar_4.w); - o_3.zw = tmpvar_2.zw; + o_3 = (pos_2 * 0.5); + vec2 tmpvar_4; + tmpvar_4.x = o_3.x; + tmpvar_4.y = (o_3.y * _ProjectionParams.x); + o_3.xy = (tmpvar_4 + o_3.w); + o_3.zw = pos_2.zw; tmpvar_1.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); tmpvar_1.z = ((-( (gl_ModelViewMatrix * gl_Vertex) .z) * unity_LightmapFade.z) + unity_LightmapFade.w); - gl_Position = tmpvar_2; + gl_Position = pos_2; + vec4 tmpvar_5; + tmpvar_5.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_5.x = pos_2.z; + xlv_FOG = tmpvar_5; vec4 tmpvar_6; - tmpvar_6.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_6.x = tmpvar_2.z; - xlv_FOG = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7.zw = vec2(0.0, 0.0); - tmpvar_7.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_7; + tmpvar_6.zw = vec2(0.0, 0.0); + tmpvar_6.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_6; gl_TexCoord[1] = o_3; - vec4 tmpvar_8; - tmpvar_8.w = 0.0; - tmpvar_8.xyz = tmpvar_1; - gl_TexCoord[2] = tmpvar_8; + vec4 tmpvar_7; + tmpvar_7.w = 0.0; + tmpvar_7.xyz = tmpvar_1; + gl_TexCoord[2] = tmpvar_7; } -// inputs: 3, stats: 15 alu 0 tex 0 flow +// stats: 15 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 6 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: gl_ModelViewMatrix (high float) 4x4 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _ProjectionParams (high float) 4x1 [-1] +// #4: unity_LightmapFade (high float) 4x1 [-1] +// #5: unity_LightmapST (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-ir.txt deleted file mode 100644 index 351a53179..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-ir.txt +++ /dev/null @@ -1,164 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 normal; - vec3 lightDir; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _DecalTex_ST; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec3 WorldSpaceLightDir ( - in vec4 v_9 -) -{ - vec3 worldPos_10; - vec3 tmpvar_11; - tmpvar_11 = (_Object2World * v_9).xyz; - worldPos_10 = tmpvar_11; - return _WorldSpaceLightPos0.xyz; -} - -void PositionFog ( - in vec4 v_12, - out vec4 pos_13, - out float fog_14 -) -{ - vec4 tmpvar_15; - tmpvar_15 = (gl_ModelViewProjectionMatrix * v_12); - pos_13 = tmpvar_15; - float tmpvar_16; - tmpvar_16 = pos_13.z; - fog_14 = tmpvar_16; -} - -v2f_surf vert_surf ( - in appdata_full v_17 -) -{ - v2f_surf o_18; - PositionFog (v_17.vertex, o_18.pos, o_18.fog); - vec2 tmpvar_19; - tmpvar_19 = ((v_17.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_18.hip_pack0.xy = tmpvar_19.xy.xy; - vec2 tmpvar_20; - tmpvar_20 = ((v_17.texcoord.xy * _DecalTex_ST.xy) + _DecalTex_ST.zw); - o_18.hip_pack0.zw = tmpvar_20.xxxy.zw; - mat3 tmpvar_21; - tmpvar_21 = xll_constructMat3 (_Object2World); - vec3 tmpvar_22; - tmpvar_22 = (tmpvar_21 * (v_17.normal * unity_Scale.w)); - o_18.normal = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = WorldSpaceLightDir (v_17.vertex); - vec3 tmpvar_24; - tmpvar_24 = tmpvar_23; - o_18.lightDir = tmpvar_24; - return o_18; -} - -void main () -{ - appdata_full xlt_v_25; - v2f_surf xl_retval_26; - vec4 tmpvar_27; - tmpvar_27 = gl_Vertex.xyzw; - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - xlt_v_25.vertex = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = TANGENT.xyzw; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - xlt_v_25.tangent = tmpvar_30; - vec3 tmpvar_31; - tmpvar_31 = gl_Normal.xyz; - vec3 tmpvar_32; - tmpvar_32 = tmpvar_31; - xlt_v_25.normal = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - xlt_v_25.texcoord = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlt_v_25.texcoord1 = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37 = gl_Color.xyzw; - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlt_v_25.color = tmpvar_38; - v2f_surf tmpvar_39; - tmpvar_39 = vert_surf (xlt_v_25); - v2f_surf tmpvar_40; - tmpvar_40 = tmpvar_39; - xl_retval_26 = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = xl_retval_26.pos.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - gl_Position = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_43.x = xl_retval_26.fog; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlv_FOG = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = xl_retval_26.hip_pack0.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - gl_TexCoord[0] = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47.w = 0.0; - tmpvar_47.xyz = xl_retval_26.normal.xyz; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - gl_TexCoord[1] = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49.w = 0.0; - tmpvar_49.xyz = xl_retval_26.lightDir.xyz; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - gl_TexCoord[2] = tmpvar_50; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-out.txt index ff5c2a512..5dadf0873 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-out.txt @@ -7,18 +7,18 @@ varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; - vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_2; + pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _DecalTex_ST.xy) + _DecalTex_ST.zw); mat3 tmpvar_3; tmpvar_3[0] = _Object2World[0].xyz; tmpvar_3[1] = _Object2World[1].xyz; tmpvar_3[2] = _Object2World[2].xyz; - gl_Position = tmpvar_2; + gl_Position = pos_2; vec4 tmpvar_4; tmpvar_4.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_4.x = tmpvar_2.z; + tmpvar_4.x = pos_2.z; xlv_FOG = tmpvar_4; gl_TexCoord[0] = tmpvar_1; vec4 tmpvar_5; @@ -32,4 +32,15 @@ void main () } -// inputs: 3, stats: 10 alu 0 tex 0 flow +// stats: 10 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 6 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _DecalTex_ST (high float) 4x1 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #5: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-ir.txt deleted file mode 100644 index 0363cfe2f..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-ir.txt +++ /dev/null @@ -1,172 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec3 _LightCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec3 WorldSpaceLightDir ( - in vec4 v_9 -) -{ - vec3 worldPos_10; - vec3 tmpvar_11; - tmpvar_11 = (_Object2World * v_9).xyz; - worldPos_10 = tmpvar_11; - return (_WorldSpaceLightPos0.xyz - worldPos_10); -} - -void PositionFog ( - in vec4 v_12, - out vec4 pos_13, - out float fog_14 -) -{ - vec4 tmpvar_15; - tmpvar_15 = (gl_ModelViewProjectionMatrix * v_12); - pos_13 = tmpvar_15; - float tmpvar_16; - tmpvar_16 = pos_13.z; - fog_14 = tmpvar_16; -} - -v2f_surf vert_surf ( - in appdata_full v_17 -) -{ - v2f_surf o_18; - PositionFog (v_17.vertex, o_18.pos, o_18.fog); - vec2 tmpvar_19; - tmpvar_19 = ((v_17.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_18.hip_pack0 = tmpvar_19.xy.xy; - mat3 tmpvar_20; - tmpvar_20 = xll_constructMat3 (_Object2World); - vec3 tmpvar_21; - tmpvar_21 = (tmpvar_20 * (v_17.normal * unity_Scale.w)); - o_18.normal = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = WorldSpaceLightDir (v_17.vertex); - vec3 tmpvar_23; - tmpvar_23 = tmpvar_22; - o_18.lightDir = tmpvar_23; - vec3 tmpvar_24; - tmpvar_24 = (_LightMatrix0 * (_Object2World * v_17.vertex)).xyz; - o_18._LightCoord = tmpvar_24; - return o_18; -} - -void main () -{ - appdata_full xlt_v_25; - v2f_surf xl_retval_26; - vec4 tmpvar_27; - tmpvar_27 = gl_Vertex.xyzw; - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - xlt_v_25.vertex = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = TANGENT.xyzw; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - xlt_v_25.tangent = tmpvar_30; - vec3 tmpvar_31; - tmpvar_31 = gl_Normal.xyz; - vec3 tmpvar_32; - tmpvar_32 = tmpvar_31; - xlt_v_25.normal = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - xlt_v_25.texcoord = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlt_v_25.texcoord1 = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37 = gl_Color.xyzw; - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlt_v_25.color = tmpvar_38; - v2f_surf tmpvar_39; - tmpvar_39 = vert_surf (xlt_v_25); - v2f_surf tmpvar_40; - tmpvar_40 = tmpvar_39; - xl_retval_26 = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = xl_retval_26.pos.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - gl_Position = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_43.x = xl_retval_26.fog; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlv_FOG = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45.zw = vec2(0.0, 0.0); - tmpvar_45.xy = xl_retval_26.hip_pack0.xy; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - gl_TexCoord[0] = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47.w = 0.0; - tmpvar_47.xyz = xl_retval_26.normal.xyz; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - gl_TexCoord[1] = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49.w = 0.0; - tmpvar_49.xyz = xl_retval_26.lightDir.xyz; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - gl_TexCoord[2] = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51.w = 0.0; - tmpvar_51.xyz = xl_retval_26._LightCoord.xyz; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - gl_TexCoord[3] = tmpvar_52; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-out.txt index 158ff2b44..37a13a0d8 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-out.txt @@ -6,16 +6,16 @@ uniform vec4 unity_Scale; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_1; + pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); mat3 tmpvar_2; tmpvar_2[0] = _Object2World[0].xyz; tmpvar_2[1] = _Object2World[1].xyz; tmpvar_2[2] = _Object2World[2].xyz; - gl_Position = tmpvar_1; + gl_Position = pos_1; vec4 tmpvar_3; tmpvar_3.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_3.x = tmpvar_1.z; + tmpvar_3.x = pos_1.z; xlv_FOG = tmpvar_3; vec4 tmpvar_4; tmpvar_4.zw = vec2(0.0, 0.0); @@ -27,15 +27,26 @@ void main () gl_TexCoord[1] = tmpvar_5; vec4 tmpvar_6; tmpvar_6.w = 0.0; - vec4 cse_7; - cse_7 = (_Object2World * gl_Vertex); - tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - cse_7.xyz); + vec4 tmpvar_7; + tmpvar_7 = (_Object2World * gl_Vertex); + tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - tmpvar_7.xyz); gl_TexCoord[2] = tmpvar_6; vec4 tmpvar_8; tmpvar_8.w = 0.0; - tmpvar_8.xyz = (_LightMatrix0 * cse_7).xyz; + tmpvar_8.xyz = (_LightMatrix0 * tmpvar_7).xyz; gl_TexCoord[3] = tmpvar_8; } -// inputs: 3, stats: 13 alu 0 tex 0 flow +// stats: 13 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 6 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _LightMatrix0 (high float) 4x4 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #5: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-ir.txt deleted file mode 100644 index ec3cdf973..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-ir.txt +++ /dev/null @@ -1,149 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 hip_screen; - vec3 hip_lmapFade; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _MainTex_ST; -uniform vec4 _ProjectionParams; -uniform vec4 unity_LightmapFade; -uniform vec4 unity_LightmapST; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec4 ComputeScreenPos ( - in vec4 pos_6 -) -{ - vec4 o_7; - vec4 tmpvar_8; - tmpvar_8 = (pos_6 * 0.5); - o_7 = tmpvar_8; - vec2 tmpvar_9; - tmpvar_9.x = o_7.x; - tmpvar_9.y = (o_7.y * _ProjectionParams.x); - vec2 tmpvar_10; - tmpvar_10 = (tmpvar_9 + o_7.w); - o_7.xy = tmpvar_10.xy.xy; - vec2 tmpvar_11; - tmpvar_11 = pos_6.zw; - o_7.zw = tmpvar_11.xxxy.zw; - return o_7; -} - -v2f_surf vert_surf ( - in appdata_full v_12 -) -{ - v2f_surf o_13; - PositionFog (v_12.vertex, o_13.pos, o_13.fog); - vec2 tmpvar_14; - tmpvar_14 = ((v_12.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_13.hip_pack0 = tmpvar_14.xy.xy; - vec4 tmpvar_15; - tmpvar_15 = ComputeScreenPos (o_13.pos); - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - o_13.hip_screen = tmpvar_16; - vec2 tmpvar_17; - tmpvar_17 = ((v_12.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - o_13.hip_lmapFade.xy = tmpvar_17.xy.xy; - float tmpvar_18; - tmpvar_18 = ((-( - (gl_ModelViewMatrix * v_12.vertex) - .z) * unity_LightmapFade.z) + unity_LightmapFade.w); - o_13.hip_lmapFade.z = vec3(tmpvar_18).z; - return o_13; -} - -void main () -{ - appdata_full xlt_v_19; - v2f_surf xl_retval_20; - vec4 tmpvar_21; - tmpvar_21 = gl_Vertex.xyzw; - vec4 tmpvar_22; - tmpvar_22 = tmpvar_21; - xlt_v_19.vertex = tmpvar_22; - vec4 tmpvar_23; - tmpvar_23 = TANGENT.xyzw; - vec4 tmpvar_24; - tmpvar_24 = tmpvar_23; - xlt_v_19.tangent = tmpvar_24; - vec3 tmpvar_25; - tmpvar_25 = gl_Normal.xyz; - vec3 tmpvar_26; - tmpvar_26 = tmpvar_25; - xlt_v_19.normal = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - xlt_v_19.texcoord = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - xlt_v_19.texcoord1 = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = gl_Color.xyzw; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_31; - xlt_v_19.color = tmpvar_32; - v2f_surf tmpvar_33; - tmpvar_33 = vert_surf (xlt_v_19); - v2f_surf tmpvar_34; - tmpvar_34 = tmpvar_33; - xl_retval_20 = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35 = xl_retval_20.pos.xyzw; - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - gl_Position = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_37.x = xl_retval_20.fog; - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlv_FOG = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39.zw = vec2(0.0, 0.0); - tmpvar_39.xy = xl_retval_20.hip_pack0.xy; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - gl_TexCoord[0] = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = xl_retval_20.hip_screen.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - gl_TexCoord[1] = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43.w = 0.0; - tmpvar_43.xyz = xl_retval_20.hip_lmapFade.xyz; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - gl_TexCoord[2] = tmpvar_44; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-out.txt index e8a9b9657..1ddacd635 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-out.txt @@ -6,35 +6,45 @@ varying vec4 xlv_FOG; void main () { vec3 tmpvar_1; - vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_2; + pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); vec4 o_3; - vec4 tmpvar_4; - tmpvar_4 = (tmpvar_2 * 0.5); - vec2 tmpvar_5; - tmpvar_5.x = tmpvar_4.x; - tmpvar_5.y = (tmpvar_4.y * _ProjectionParams.x); - o_3.xy = (tmpvar_5 + tmpvar_4.w); - o_3.zw = tmpvar_2.zw; + o_3 = (pos_2 * 0.5); + vec2 tmpvar_4; + tmpvar_4.x = o_3.x; + tmpvar_4.y = (o_3.y * _ProjectionParams.x); + o_3.xy = (tmpvar_4 + o_3.w); + o_3.zw = pos_2.zw; tmpvar_1.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); tmpvar_1.z = ((-( (gl_ModelViewMatrix * gl_Vertex) .z) * unity_LightmapFade.z) + unity_LightmapFade.w); - gl_Position = tmpvar_2; + gl_Position = pos_2; + vec4 tmpvar_5; + tmpvar_5.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_5.x = pos_2.z; + xlv_FOG = tmpvar_5; vec4 tmpvar_6; - tmpvar_6.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_6.x = tmpvar_2.z; - xlv_FOG = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7.zw = vec2(0.0, 0.0); - tmpvar_7.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_7; + tmpvar_6.zw = vec2(0.0, 0.0); + tmpvar_6.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_6; gl_TexCoord[1] = o_3; - vec4 tmpvar_8; - tmpvar_8.w = 0.0; - tmpvar_8.xyz = tmpvar_1; - gl_TexCoord[2] = tmpvar_8; + vec4 tmpvar_7; + tmpvar_7.w = 0.0; + tmpvar_7.xyz = tmpvar_1; + gl_TexCoord[2] = tmpvar_7; } -// inputs: 3, stats: 15 alu 0 tex 0 flow +// stats: 15 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 6 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: gl_ModelViewMatrix (high float) 4x4 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _ProjectionParams (high float) 4x1 [-1] +// #4: unity_LightmapFade (high float) 4x1 [-1] +// #5: unity_LightmapST (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-ir.txt deleted file mode 100644 index cb972f835..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-ir.txt +++ /dev/null @@ -1,218 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 vlight; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 unity_SHAb; -uniform vec4 unity_SHAg; -uniform vec4 unity_SHAr; -uniform vec4 unity_SHBb; -uniform vec4 unity_SHBg; -uniform vec4 unity_SHBr; -uniform vec4 unity_SHC; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec3 ShadeSH9 ( - in vec4 normal_9 -) -{ - vec3 x3_10; - float vC_11; - vec3 x2_12; - vec4 vB_13; - vec3 x1_14; - float tmpvar_15; - tmpvar_15 = dot (unity_SHAr, normal_9); - float tmpvar_16; - tmpvar_16 = tmpvar_15; - x1_14.x = tmpvar_16; - float tmpvar_17; - tmpvar_17 = dot (unity_SHAg, normal_9); - float tmpvar_18; - tmpvar_18 = tmpvar_17; - x1_14.y = vec2(tmpvar_18).y; - float tmpvar_19; - tmpvar_19 = dot (unity_SHAb, normal_9); - float tmpvar_20; - tmpvar_20 = tmpvar_19; - x1_14.z = vec3(tmpvar_20).z; - vec4 tmpvar_21; - tmpvar_21 = (normal_9.xyzz * normal_9.yzzx); - vB_13 = tmpvar_21; - float tmpvar_22; - tmpvar_22 = dot (unity_SHBr, vB_13); - float tmpvar_23; - tmpvar_23 = tmpvar_22; - x2_12.x = tmpvar_23; - float tmpvar_24; - tmpvar_24 = dot (unity_SHBg, vB_13); - float tmpvar_25; - tmpvar_25 = tmpvar_24; - x2_12.y = vec2(tmpvar_25).y; - float tmpvar_26; - tmpvar_26 = dot (unity_SHBb, vB_13); - float tmpvar_27; - tmpvar_27 = tmpvar_26; - x2_12.z = vec3(tmpvar_27).z; - float tmpvar_28; - tmpvar_28 = ((normal_9.x * normal_9.x) - (normal_9.y * normal_9.y)); - vC_11 = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = (unity_SHC.xyz * vC_11); - x3_10 = tmpvar_29; - return ((x1_14 + x2_12) + x3_10); -} - -void PositionFog ( - in vec4 v_30, - out vec4 pos_31, - out float fog_32 -) -{ - vec4 tmpvar_33; - tmpvar_33 = (gl_ModelViewProjectionMatrix * v_30); - pos_31 = tmpvar_33; - float tmpvar_34; - tmpvar_34 = pos_31.z; - fog_32 = tmpvar_34; -} - -v2f_surf vert_surf ( - in appdata_full v_35 -) -{ - vec3 shlight_36; - vec3 worldN_37; - v2f_surf o_38; - PositionFog (v_35.vertex, o_38.pos, o_38.fog); - vec2 tmpvar_39; - tmpvar_39 = ((v_35.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_38.hip_pack0 = tmpvar_39.xy.xy; - mat3 tmpvar_40; - tmpvar_40 = xll_constructMat3 (_Object2World); - vec3 tmpvar_41; - tmpvar_41 = (tmpvar_40 * (v_35.normal * unity_Scale.w)); - worldN_37 = tmpvar_41; - vec3 tmpvar_42; - tmpvar_42 = worldN_37; - o_38.normal = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43.w = 1.0; - tmpvar_43.xyz = worldN_37.xyz; - vec3 tmpvar_44; - tmpvar_44 = ShadeSH9 (tmpvar_43); - vec3 tmpvar_45; - tmpvar_45 = tmpvar_44; - shlight_36 = tmpvar_45; - vec3 tmpvar_46; - tmpvar_46 = shlight_36; - o_38.vlight = tmpvar_46; - return o_38; -} - -void main () -{ - appdata_full xlt_v_47; - v2f_surf xl_retval_48; - vec4 tmpvar_49; - tmpvar_49 = gl_Vertex.xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_v_47.vertex = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = TANGENT.xyzw; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - xlt_v_47.tangent = tmpvar_52; - vec3 tmpvar_53; - tmpvar_53 = gl_Normal.xyz; - vec3 tmpvar_54; - tmpvar_54 = tmpvar_53; - xlt_v_47.normal = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - xlt_v_47.texcoord = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - xlt_v_47.texcoord1 = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59 = gl_Color.xyzw; - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - xlt_v_47.color = tmpvar_60; - v2f_surf tmpvar_61; - tmpvar_61 = vert_surf (xlt_v_47); - v2f_surf tmpvar_62; - tmpvar_62 = tmpvar_61; - xl_retval_48 = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63 = xl_retval_48.pos.xyzw; - vec4 tmpvar_64; - tmpvar_64 = tmpvar_63; - gl_Position = tmpvar_64; - vec4 tmpvar_65; - tmpvar_65.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_65.x = xl_retval_48.fog; - vec4 tmpvar_66; - tmpvar_66 = tmpvar_65; - xlv_FOG = tmpvar_66; - vec4 tmpvar_67; - tmpvar_67.zw = vec2(0.0, 0.0); - tmpvar_67.xy = xl_retval_48.hip_pack0.xy; - vec4 tmpvar_68; - tmpvar_68 = tmpvar_67; - gl_TexCoord[0] = tmpvar_68; - vec4 tmpvar_69; - tmpvar_69.w = 0.0; - tmpvar_69.xyz = xl_retval_48.normal.xyz; - vec4 tmpvar_70; - tmpvar_70 = tmpvar_69; - gl_TexCoord[1] = tmpvar_70; - vec4 tmpvar_71; - tmpvar_71.w = 0.0; - tmpvar_71.xyz = xl_retval_48.vlight.xyz; - vec4 tmpvar_72; - tmpvar_72 = tmpvar_71; - gl_TexCoord[2] = tmpvar_72; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt index 56d2c48da..a9a64b266 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt @@ -11,31 +11,31 @@ uniform vec4 unity_Scale; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); - mat3 tmpvar_2; - tmpvar_2[0] = _Object2World[0].xyz; - tmpvar_2[1] = _Object2World[1].xyz; - tmpvar_2[2] = _Object2World[2].xyz; - vec3 tmpvar_3; - tmpvar_3 = (tmpvar_2 * (gl_Normal * unity_Scale.w)); + vec3 worldN_1; + vec4 pos_2; + pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); + mat3 tmpvar_3; + tmpvar_3[0] = _Object2World[0].xyz; + tmpvar_3[1] = _Object2World[1].xyz; + tmpvar_3[2] = _Object2World[2].xyz; + worldN_1 = (tmpvar_3 * (gl_Normal * unity_Scale.w)); vec4 tmpvar_4; tmpvar_4.w = 1.0; - tmpvar_4.xyz = tmpvar_3; + tmpvar_4.xyz = worldN_1; vec3 x2_5; - vec3 x1_6; - x1_6.x = dot (unity_SHAr, tmpvar_4); - x1_6.y = dot (unity_SHAg, tmpvar_4); - x1_6.z = dot (unity_SHAb, tmpvar_4); - vec4 tmpvar_7; - tmpvar_7 = (tmpvar_3.xyzz * tmpvar_3.yzzx); - x2_5.x = dot (unity_SHBr, tmpvar_7); - x2_5.y = dot (unity_SHBg, tmpvar_7); - x2_5.z = dot (unity_SHBb, tmpvar_7); - gl_Position = tmpvar_1; + vec4 vB_6; + vec3 x1_7; + x1_7.x = dot (unity_SHAr, tmpvar_4); + x1_7.y = dot (unity_SHAg, tmpvar_4); + x1_7.z = dot (unity_SHAb, tmpvar_4); + vB_6 = (worldN_1.xyzz * worldN_1.yzzx); + x2_5.x = dot (unity_SHBr, vB_6); + x2_5.y = dot (unity_SHBg, vB_6); + x2_5.z = dot (unity_SHBb, vB_6); + gl_Position = pos_2; vec4 tmpvar_8; tmpvar_8.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_8.x = tmpvar_1.z; + tmpvar_8.x = pos_2.z; xlv_FOG = tmpvar_8; vec4 tmpvar_9; tmpvar_9.zw = vec2(0.0, 0.0); @@ -43,17 +43,33 @@ void main () gl_TexCoord[0] = tmpvar_9; vec4 tmpvar_10; tmpvar_10.w = 0.0; - tmpvar_10.xyz = tmpvar_3; + tmpvar_10.xyz = worldN_1; gl_TexCoord[1] = tmpvar_10; vec4 tmpvar_11; tmpvar_11.w = 0.0; - tmpvar_11.xyz = ((x1_6 + x2_5) + (unity_SHC.xyz * ( - (tmpvar_3.x * tmpvar_3.x) + tmpvar_11.xyz = ((x1_7 + x2_5) + (unity_SHC.xyz * ( + (worldN_1.x * worldN_1.x) - - (tmpvar_3.y * tmpvar_3.y) + (worldN_1.y * worldN_1.y) ))); gl_TexCoord[2] = tmpvar_11; } -// inputs: 3, stats: 23 alu 0 tex 0 flow +// stats: 23 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 11 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _MainTex_ST (high float) 4x1 [-1] +// #2: _Object2World (high float) 4x4 [-1] +// #3: unity_SHAb (high float) 4x1 [-1] +// #4: unity_SHAg (high float) 4x1 [-1] +// #5: unity_SHAr (high float) 4x1 [-1] +// #6: unity_SHBb (high float) 4x1 [-1] +// #7: unity_SHBg (high float) 4x1 [-1] +// #8: unity_SHBr (high float) 4x1 [-1] +// #9: unity_SHC (high float) 4x1 [-1] +// #10: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Glass_Stained_BumpDistort-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Glass_Stained_BumpDistort-ir.txt deleted file mode 100644 index 41e4108c2..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Glass_Stained_BumpDistort-ir.txt +++ /dev/null @@ -1,106 +0,0 @@ -struct v2f { - vec4 vertex; - vec4 uvgrab; - vec2 uvbump; - vec2 uvmain; -}; -struct appdata_t { - vec4 vertex; - vec2 texcoord; -}; -vec2 MultiplyUV ( - in mat4 mat_1, - in vec2 inUV_2 -) -{ - vec4 temp_3; - vec4 tmpvar_4; - tmpvar_4.zw = vec2(0.0, 0.0); - tmpvar_4.x = inUV_2.x; - tmpvar_4.y = inUV_2.y; - vec4 tmpvar_5; - tmpvar_5 = tmpvar_4; - temp_3 = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6 = (mat_1 * temp_3); - temp_3 = tmpvar_6; - return temp_3.xy; -} - -v2f vert ( - in appdata_t v_7 -) -{ - float scale_8; - v2f o_9; - float tmpvar_10; - tmpvar_10 = 1.0; - scale_8 = tmpvar_10; - vec4 tmpvar_11; - tmpvar_11 = (gl_ModelViewProjectionMatrix * v_7.vertex); - o_9.vertex = tmpvar_11; - vec2 tmpvar_12; - tmpvar_12.x = o_9.vertex.x; - tmpvar_12.y = (o_9.vertex.y * scale_8); - vec2 tmpvar_13; - tmpvar_13 = ((tmpvar_12 + o_9.vertex.w) * 0.5); - o_9.uvgrab.xy = tmpvar_13.xy.xy; - vec2 tmpvar_14; - tmpvar_14 = o_9.vertex.zw; - o_9.uvgrab.zw = tmpvar_14.xxxy.zw; - vec2 tmpvar_15; - tmpvar_15 = MultiplyUV (gl_TextureMatrix[1], v_7.texcoord); - vec2 tmpvar_16; - tmpvar_16 = tmpvar_15; - o_9.uvbump = tmpvar_16; - vec2 tmpvar_17; - tmpvar_17 = MultiplyUV (gl_TextureMatrix[2], v_7.texcoord); - vec2 tmpvar_18; - tmpvar_18 = tmpvar_17; - o_9.uvmain = tmpvar_18; - return o_9; -} - -void main () -{ - appdata_t xlt_v_19; - v2f xl_retval_20; - vec4 tmpvar_21; - tmpvar_21 = gl_Vertex.xyzw; - vec4 tmpvar_22; - tmpvar_22 = tmpvar_21; - xlt_v_19.vertex = tmpvar_22; - vec2 tmpvar_23; - tmpvar_23 = gl_MultiTexCoord0.xy; - vec2 tmpvar_24; - tmpvar_24 = tmpvar_23; - xlt_v_19.texcoord = tmpvar_24; - v2f tmpvar_25; - tmpvar_25 = vert (xlt_v_19); - v2f tmpvar_26; - tmpvar_26 = tmpvar_25; - xl_retval_20 = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = xl_retval_20.vertex.xyzw; - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - gl_Position = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = xl_retval_20.uvgrab.xyzw; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - gl_TexCoord[0] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31.zw = vec2(0.0, 0.0); - tmpvar_31.xy = xl_retval_20.uvbump.xy; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_31; - gl_TexCoord[1] = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33.zw = vec2(0.0, 0.0); - tmpvar_33.xy = xl_retval_20.uvmain.xy; - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - gl_TexCoord[2] = tmpvar_34; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Glass_Stained_BumpDistort-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Glass_Stained_BumpDistort-out.txt index 107d69455..8e0ddac91 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Glass_Stained_BumpDistort-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Glass_Stained_BumpDistort-out.txt @@ -4,17 +4,17 @@ void main () tmpvar_1 = gl_MultiTexCoord0.xy; vec4 tmpvar_2; vec4 tmpvar_3; - tmpvar_3 = (gl_ModelViewProjectionMatrix * gl_Vertex); - tmpvar_2.xy = ((tmpvar_3.xy + tmpvar_3.w) * 0.5); - tmpvar_2.zw = tmpvar_3.zw; + tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_3.xy = ((tmpvar_2.xy + tmpvar_2.w) * 0.5); + tmpvar_3.zw = tmpvar_2.zw; vec4 tmpvar_4; tmpvar_4.zw = vec2(0.0, 0.0); tmpvar_4.xy = tmpvar_1; vec4 tmpvar_5; tmpvar_5.zw = vec2(0.0, 0.0); tmpvar_5.xy = tmpvar_1; - gl_Position = tmpvar_3; - gl_TexCoord[0] = tmpvar_2; + gl_Position = tmpvar_2; + gl_TexCoord[0] = tmpvar_3; vec4 tmpvar_6; tmpvar_6.zw = vec2(0.0, 0.0); tmpvar_6.xy = (gl_TextureMatrix[1] * tmpvar_4).xy; @@ -26,4 +26,10 @@ void main () } -// inputs: 2, stats: 9 alu 0 tex 0 flow +// stats: 9 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 2 (total size: 0) +// #0: gl_TextureMatrix (high float) 4x4 [16] +// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-ir.txt deleted file mode 100644 index a6fe917da..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-ir.txt +++ /dev/null @@ -1,120 +0,0 @@ -struct v2f { - vec4 pos; - float fog; - vec2 bumpuv[2]; - vec3 viewDir; -}; -struct appdata { - vec4 vertex; - vec3 normal; -}; -uniform vec4 _WaveOffset; -uniform float _WaveScale; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 unity_Scale; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_6 -) -{ - vec3 objSpaceCameraPos_7; - vec4 tmpvar_8; - tmpvar_8.w = 1.0; - tmpvar_8.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_9; - tmpvar_9 = ((_World2Object * tmpvar_8).xyz * unity_Scale.w); - objSpaceCameraPos_7 = tmpvar_9; - return (objSpaceCameraPos_7 - v_6.xyz); -} - -v2f vert ( - in appdata v_10 -) -{ - vec4 temp_11; - v2f o_12; - PositionFog (v_10.vertex, o_12.pos, o_12.fog); - vec4 tmpvar_13; - tmpvar_13 = ((v_10.vertex.xzxz * _WaveScale) + _WaveOffset); - temp_11 = tmpvar_13.xyzw.xyzw; - vec2 tmpvar_14; - tmpvar_14 = (temp_11.xy * vec2(0.4, 0.45)); - o_12.bumpuv[0] = tmpvar_14; - vec2 tmpvar_15; - tmpvar_15 = temp_11.wz; - o_12.bumpuv[1] = tmpvar_15; - vec3 tmpvar_16; - tmpvar_16 = ObjSpaceViewDir (v_10.vertex); - vec3 tmpvar_17; - tmpvar_17 = normalize (tmpvar_16); - vec3 tmpvar_18; - tmpvar_18 = tmpvar_17; - o_12.viewDir = tmpvar_18.xzy.xyz; - return o_12; -} - -void main () -{ - appdata xlt_v_19; - v2f xl_retval_20; - vec4 tmpvar_21; - tmpvar_21 = gl_Vertex.xyzw; - vec4 tmpvar_22; - tmpvar_22 = tmpvar_21; - xlt_v_19.vertex = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = gl_Normal.xyz; - vec3 tmpvar_24; - tmpvar_24 = tmpvar_23; - xlt_v_19.normal = tmpvar_24; - v2f tmpvar_25; - tmpvar_25 = vert (xlt_v_19); - v2f tmpvar_26; - tmpvar_26 = tmpvar_25; - xl_retval_20 = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = xl_retval_20.pos.xyzw; - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - gl_Position = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_29.x = xl_retval_20.fog; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - xlv_FOG = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31.zw = vec2(0.0, 0.0); - tmpvar_31.xy = xl_retval_20.bumpuv[0].xy; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_31; - gl_TexCoord[0] = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33.zw = vec2(0.0, 0.0); - tmpvar_33.xy = xl_retval_20.bumpuv[1].xy; - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - gl_TexCoord[1] = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35.w = 0.0; - tmpvar_35.xyz = xl_retval_20.viewDir.xyz; - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - gl_TexCoord[2] = tmpvar_36; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-out.txt index 10b5ab644..489b359e6 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-out.txt @@ -7,16 +7,16 @@ varying vec4 xlv_FOG; void main () { vec4 temp_1; - vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_2; + pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); temp_1 = ((gl_Vertex.xzxz * _WaveScale) + _WaveOffset); vec4 tmpvar_3; tmpvar_3.w = 1.0; tmpvar_3.xyz = _WorldSpaceCameraPos; - gl_Position = tmpvar_2; + gl_Position = pos_2; vec4 tmpvar_4; tmpvar_4.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_4.x = tmpvar_2.z; + tmpvar_4.x = pos_2.z; xlv_FOG = tmpvar_4; vec4 tmpvar_5; tmpvar_5.zw = vec2(0.0, 0.0); @@ -35,4 +35,13 @@ void main () } -// inputs: 1, stats: 13 alu 0 tex 0 flow +// stats: 13 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 6 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _WaveOffset (high float) 4x1 [-1] +// #2: _WaveScale (high float) 1x1 [-1] +// #3: _World2Object (high float) 4x4 [-1] +// #4: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #5: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Grab_Invert-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Grab_Invert-ir.txt deleted file mode 100644 index 724a50c3e..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Grab_Invert-ir.txt +++ /dev/null @@ -1,53 +0,0 @@ -struct v2f { - vec4 vertex; - vec4 uv; -}; -v2f vert ( - in vec4 vertex_1, - in vec2 uv_2 -) -{ - float scale_3; - v2f o_4; - float tmpvar_5; - tmpvar_5 = 1.0; - scale_3 = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6 = (gl_ModelViewProjectionMatrix * vertex_1); - o_4.vertex = tmpvar_6; - vec2 tmpvar_7; - tmpvar_7.x = o_4.vertex.x; - tmpvar_7.y = (o_4.vertex.y * scale_3); - vec2 tmpvar_8; - tmpvar_8 = ((tmpvar_7 + o_4.vertex.w) * 0.5); - o_4.uv.xy = tmpvar_8.xy.xy; - vec2 tmpvar_9; - tmpvar_9 = o_4.vertex.zw; - o_4.uv.zw = tmpvar_9.xxxy.zw; - return o_4; -} - -void main () -{ - v2f xl_retval_10; - vec4 tmpvar_11; - tmpvar_11 = gl_Vertex.xyzw; - vec2 tmpvar_12; - tmpvar_12 = gl_MultiTexCoord0.xy; - v2f tmpvar_13; - tmpvar_13 = vert (tmpvar_11, tmpvar_12); - v2f tmpvar_14; - tmpvar_14 = tmpvar_13; - xl_retval_10 = tmpvar_14; - vec4 tmpvar_15; - tmpvar_15 = xl_retval_10.vertex.xyzw; - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - gl_Position = tmpvar_16; - vec4 tmpvar_17; - tmpvar_17 = xl_retval_10.uv.xyzw; - vec4 tmpvar_18; - tmpvar_18 = tmpvar_17; - gl_TexCoord[0] = tmpvar_18; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Grab_Invert-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Grab_Invert-out.txt index 06a4d669f..7e3a01ecb 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Grab_Invert-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Grab_Invert-out.txt @@ -2,12 +2,16 @@ void main () { vec4 tmpvar_1; vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); - tmpvar_1.xy = ((tmpvar_2.xy + tmpvar_2.w) * 0.5); - tmpvar_1.zw = tmpvar_2.zw; - gl_Position = tmpvar_2; - gl_TexCoord[0] = tmpvar_1; + tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_2.xy = ((tmpvar_1.xy + tmpvar_1.w) * 0.5); + tmpvar_2.zw = tmpvar_1.zw; + gl_Position = tmpvar_1; + gl_TexCoord[0] = tmpvar_2; } -// inputs: 1, stats: 3 alu 0 tex 0 flow +// stats: 3 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 1 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-ir.txt deleted file mode 100644 index 268f5b805..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-ir.txt +++ /dev/null @@ -1,177 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; - vec4 nz; -}; -struct appdata { - vec4 vertex; - vec3 normal; - vec4 color; - vec4 texcoord; -}; -uniform vec4 _ProjectionParams; -uniform vec4 _Scale; -uniform float _SquashAmount; -uniform vec4 _SquashPlaneNormal; -uniform mat4 _TerrainEngineBendTree; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec4 Squash ( - in vec4 pos_9 -) -{ - vec3 planeNormal_10; - vec3 planePoint_11; - vec3 projectedVertex_12; - vec3 tmpvar_13; - tmpvar_13 = pos_9.xyz; - projectedVertex_12 = tmpvar_13; - vec3 tmpvar_14; - tmpvar_14.xz = vec2(0.0, 0.0); - tmpvar_14.y = _SquashPlaneNormal.w; - vec3 tmpvar_15; - tmpvar_15 = tmpvar_14; - planePoint_11 = tmpvar_15; - vec3 tmpvar_16; - tmpvar_16 = _SquashPlaneNormal.xyz; - planeNormal_10 = tmpvar_16; - vec3 tmpvar_17; - tmpvar_17 = pos_9.xyz; - float tmpvar_18; - tmpvar_18 = dot (planeNormal_10, (planePoint_11 - tmpvar_17)); - vec3 tmpvar_19; - tmpvar_19 = (projectedVertex_12 + (tmpvar_18 * planeNormal_10)); - projectedVertex_12 = tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = vec3(_SquashAmount); - vec3 tmpvar_21; - tmpvar_21 = mix (projectedVertex_12, pos_9.xyz, tmpvar_20); - vec4 tmpvar_22; - tmpvar_22.w = 1.0; - tmpvar_22.xyz = tmpvar_21.xyz; - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - pos_9 = tmpvar_23; - return pos_9; -} - -void TerrainAnimateTree ( - inout vec4 pos_24, - in float alpha_25 -) -{ - vec3 bent_26; - vec3 tmpvar_27; - tmpvar_27 = (pos_24.xyz * _Scale.xyz); - pos_24.xyz = tmpvar_27.xyz.xyz; - vec4 tmpvar_28; - tmpvar_28.w = 0.0; - tmpvar_28.xyz = pos_24.xyz.xyz; - vec3 tmpvar_29; - tmpvar_29 = (_TerrainEngineBendTree * tmpvar_28).xyz; - bent_26 = tmpvar_29; - vec3 tmpvar_30; - tmpvar_30 = vec3(alpha_25); - vec3 tmpvar_31; - tmpvar_31 = mix (pos_24.xyz, bent_26, tmpvar_30); - vec3 tmpvar_32; - tmpvar_32 = tmpvar_31; - pos_24.xyz = tmpvar_32.xyz.xyz; - vec4 tmpvar_33; - tmpvar_33 = Squash (pos_24); - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - pos_24 = tmpvar_34; -} - -v2f vert ( - in appdata v_35 -) -{ - v2f o_36; - TerrainAnimateTree (v_35.vertex, v_35.color.w); - vec4 tmpvar_37; - tmpvar_37 = (gl_ModelViewProjectionMatrix * v_35.vertex); - o_36.pos = tmpvar_37; - vec2 tmpvar_38; - tmpvar_38 = v_35.texcoord.xy; - o_36.uv = tmpvar_38; - mat3 tmpvar_39; - tmpvar_39 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose); - vec3 tmpvar_40; - tmpvar_40 = (tmpvar_39 * v_35.normal); - o_36.nz.xyz = tmpvar_40.xyz.xyz; - float tmpvar_41; - tmpvar_41 = -(((gl_ModelViewMatrix * v_35.vertex).z * _ProjectionParams.w)); - o_36.nz.w = vec4(tmpvar_41).w; - return o_36; -} - -void main () -{ - appdata xlt_v_42; - v2f xl_retval_43; - vec4 tmpvar_44; - tmpvar_44 = gl_Vertex.xyzw; - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - xlt_v_42.vertex = tmpvar_45; - vec3 tmpvar_46; - tmpvar_46 = gl_Normal.xyz; - vec3 tmpvar_47; - tmpvar_47 = tmpvar_46; - xlt_v_42.normal = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48 = gl_Color.xyzw; - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - xlt_v_42.color = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_51; - tmpvar_51 = tmpvar_50; - xlt_v_42.texcoord = tmpvar_51; - v2f tmpvar_52; - tmpvar_52 = vert (xlt_v_42); - v2f tmpvar_53; - tmpvar_53 = tmpvar_52; - xl_retval_43 = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54 = xl_retval_43.pos.xyzw; - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - gl_Position = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56.zw = vec2(0.0, 0.0); - tmpvar_56.xy = xl_retval_43.uv.xy; - vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - gl_TexCoord[0] = tmpvar_57; - vec4 tmpvar_58; - tmpvar_58 = xl_retval_43.nz.xyzw; - vec4 tmpvar_59; - tmpvar_59 = tmpvar_58; - gl_TexCoord[1] = tmpvar_59; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-out.txt index d3dc3caa6..fad74687f 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-out.txt @@ -37,4 +37,18 @@ void main () } -// inputs: 4, stats: 17 alu 0 tex 0 flow +// stats: 17 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Color (high float) 4x1 [-1] loc 3 +// #2: gl_Normal (high float) 3x1 [-1] loc 2 +// #3: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 8 (total size: 0) +// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] +// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #2: gl_ModelViewMatrix (high float) 4x4 [-1] +// #3: _ProjectionParams (high float) 4x1 [-1] +// #4: _Scale (high float) 4x1 [-1] +// #5: _SquashAmount (high float) 1x1 [-1] +// #6: _SquashPlaneNormal (high float) 4x1 [-1] +// #7: _TerrainEngineBendTree (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-ir.txt deleted file mode 100644 index 4e161fec1..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-ir.txt +++ /dev/null @@ -1,255 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; - vec4 nz; -}; -struct appdata_grass { - vec4 vertex; - vec4 tangent; - vec4 color; - vec4 texcoord; - vec4 texcoord1; -}; -uniform vec4 _ProjectionParams; -uniform vec4 _WaveAndDistance; -uniform vec4 _WavingTint; -attribute vec4 TANGENT; -void FastSinCos ( - in vec4 val_1, - out vec4 s_2, - out vec4 c_3 -) -{ - vec4 cos8_4; - vec4 sin7_5; - vec4 r3_6; - vec4 r2_7; - vec4 r1_8; - vec4 r8_9; - vec4 r7_10; - vec4 r6_11; - vec4 r5_12; - vec4 tmpvar_13; - tmpvar_13 = vec4(1.0, -0.161616, 0.0083333, -0.00019841); - sin7_5 = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = vec4(-0.5, 0.0416667, -0.00138889, 2.48016e-05); - cos8_4 = tmpvar_14; - vec4 tmpvar_15; - tmpvar_15 = ((val_1 * 6.40885) - 3.14159); - val_1 = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = (val_1 * val_1); - r5_12 = tmpvar_16; - vec4 tmpvar_17; - tmpvar_17 = (r5_12 * r5_12); - r6_11 = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = (r6_11 * r5_12); - r7_10 = tmpvar_18; - vec4 tmpvar_19; - tmpvar_19 = (r6_11 * r5_12); - r8_9 = tmpvar_19; - vec4 tmpvar_20; - tmpvar_20 = (r5_12 * val_1); - r1_8 = tmpvar_20; - vec4 tmpvar_21; - tmpvar_21 = (r1_8 * r5_12); - r2_7 = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22 = (r2_7 * r5_12); - r3_6 = tmpvar_22; - vec4 tmpvar_23; - tmpvar_23 = (((val_1 + - (r1_8 * sin7_5.y) - ) + (r2_7 * sin7_5.z)) + (r3_6 * sin7_5.w)); - s_2 = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = ((( - (1.0 + (r5_12 * cos8_4.x)) - + - (r6_11 * cos8_4.y) - ) + (r7_10 * cos8_4.z)) + (r8_9 * cos8_4.w)); - c_3 = tmpvar_24; -} - -void TerrainWaveGrass ( - inout vec4 vertex_25, - in float waveAmount_26, - in vec3 color_27, - out vec4 outColor_28 -) -{ - vec3 waveColor_29; - vec3 waveMove_30; - float lighting_31; - vec4 c_32; - vec4 s_33; - vec4 waves_34; - vec4 _waveZmove_35; - vec4 _waveXmove_36; - vec4 waveSpeed_37; - vec4 _waveZSize_38; - vec4 _waveXSize_39; - vec4 tmpvar_40; - tmpvar_40 = vec4(1.2, 2.0, 1.6, 4.8); - waveSpeed_37 = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = vec4(0.024, 0.04, -0.12, 0.096); - _waveXmove_36 = tmpvar_41; - vec4 tmpvar_42; - tmpvar_42 = vec4(0.006, 0.02, -0.02, 0.1); - _waveZmove_35 = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = vec3(0.0, 0.0, 0.0); - waveMove_30 = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44 = (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y); - _waveXSize_39 = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y); - _waveZSize_38 = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46 = (vertex_25.x * _waveXSize_39); - waves_34 = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = (waves_34 + (vertex_25.z * _waveZSize_38)); - waves_34 = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48 = (waves_34 + (_WaveAndDistance.x * waveSpeed_37)); - waves_34 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = fract (waves_34); - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - waves_34 = tmpvar_50; - FastSinCos (waves_34, s_33, c_32); - vec4 tmpvar_51; - tmpvar_51 = (s_33 * s_33); - s_33 = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = (s_33 * s_33); - s_33 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = normalize (vec4(1.0, 1.0, 0.4, 0.2)); - float tmpvar_54; - tmpvar_54 = dot (s_33, tmpvar_53); - float tmpvar_55; - tmpvar_55 = (tmpvar_54 * 0.7); - lighting_31 = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = (s_33 * waveAmount_26); - s_33 = tmpvar_56; - float tmpvar_57; - tmpvar_57 = dot (s_33, _waveXmove_36); - float tmpvar_58; - tmpvar_58 = tmpvar_57; - waveMove_30.x = tmpvar_58; - float tmpvar_59; - tmpvar_59 = dot (s_33, _waveZmove_35); - float tmpvar_60; - tmpvar_60 = tmpvar_59; - waveMove_30.z = vec3(tmpvar_60).z; - vec2 tmpvar_61; - tmpvar_61 = (vertex_25.xz - (waveMove_30.xz * _WaveAndDistance.z)); - vertex_25.xz = tmpvar_61.xxy.xz; - vec3 tmpvar_62; - tmpvar_62 = vec3(lighting_31); - vec3 tmpvar_63; - tmpvar_63 = mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, tmpvar_62); - vec3 tmpvar_64; - tmpvar_64 = tmpvar_63; - waveColor_29 = tmpvar_64; - vec3 tmpvar_65; - tmpvar_65 = ((color_27 * waveColor_29) * 2.0); - outColor_28.xyz = tmpvar_65.xyz.xyz; - float tmpvar_66; - tmpvar_66 = 1.0; - outColor_28.w = vec4(tmpvar_66).w; -} - -v2f vert ( - in appdata_grass v_67 -) -{ - v2f o_68; - vec4 dummyColor_69; - float waveAmount_70; - float tmpvar_71; - tmpvar_71 = (v_67.color.w * _WaveAndDistance.z); - waveAmount_70 = tmpvar_71; - vec4 tmpvar_72; - tmpvar_72 = vec4(0.0, 0.0, 0.0, 0.0); - dummyColor_69 = tmpvar_72; - vec3 tmpvar_73; - tmpvar_73 = dummyColor_69.xyz; - TerrainWaveGrass (v_67.vertex, waveAmount_70, tmpvar_73, dummyColor_69); - vec4 tmpvar_74; - tmpvar_74 = (gl_ModelViewProjectionMatrix * v_67.vertex); - o_68.pos = tmpvar_74; - vec2 tmpvar_75; - tmpvar_75 = v_67.texcoord.xy; - vec2 tmpvar_76; - tmpvar_76 = tmpvar_75; - o_68.uv = tmpvar_76; - vec3 tmpvar_77; - tmpvar_77 = vec3(0.0, 0.0, 1.0); - o_68.nz.xyz = tmpvar_77.xyz.xyz; - float tmpvar_78; - tmpvar_78 = -(((gl_ModelViewMatrix * v_67.vertex).z * _ProjectionParams.w)); - o_68.nz.w = vec4(tmpvar_78).w; - return o_68; -} - -void main () -{ - appdata_grass xlt_v_79; - v2f xl_retval_80; - vec4 tmpvar_81; - tmpvar_81 = gl_Vertex.xyzw; - vec4 tmpvar_82; - tmpvar_82 = tmpvar_81; - xlt_v_79.vertex = tmpvar_82; - vec4 tmpvar_83; - tmpvar_83 = TANGENT.xyzw; - vec4 tmpvar_84; - tmpvar_84 = tmpvar_83; - xlt_v_79.tangent = tmpvar_84; - vec4 tmpvar_85; - tmpvar_85 = gl_Color.xyzw; - vec4 tmpvar_86; - tmpvar_86 = tmpvar_85; - xlt_v_79.color = tmpvar_86; - vec4 tmpvar_87; - tmpvar_87 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_88; - tmpvar_88 = tmpvar_87; - xlt_v_79.texcoord = tmpvar_88; - vec4 tmpvar_89; - tmpvar_89 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_90; - tmpvar_90 = tmpvar_89; - xlt_v_79.texcoord1 = tmpvar_90; - v2f tmpvar_91; - tmpvar_91 = vert (xlt_v_79); - v2f tmpvar_92; - tmpvar_92 = tmpvar_91; - xl_retval_80 = tmpvar_92; - vec4 tmpvar_93; - tmpvar_93 = xl_retval_80.pos.xyzw; - vec4 tmpvar_94; - tmpvar_94 = tmpvar_93; - gl_Position = tmpvar_94; - vec4 tmpvar_95; - tmpvar_95.zw = vec2(0.0, 0.0); - tmpvar_95.xy = xl_retval_80.uv.xy; - vec4 tmpvar_96; - tmpvar_96 = tmpvar_95; - gl_TexCoord[0] = tmpvar_96; - vec4 tmpvar_97; - tmpvar_97 = xl_retval_80.nz.xyzw; - vec4 tmpvar_98; - tmpvar_98 = tmpvar_97; - gl_TexCoord[1] = tmpvar_98; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-out.txt index 405f959ca..e88774e46 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-out.txt @@ -6,37 +6,51 @@ void main () vec4 vertex_2; vertex_2.yw = gl_Vertex.yw; vec3 waveMove_3; + vec4 s_4; + vec4 waves_5; waveMove_3.y = 0.0; - vec4 tmpvar_4; - tmpvar_4 = ((fract( - (((gl_Vertex.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y)) + (gl_Vertex.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y))) + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8))) - ) * 6.40885) - 3.14159); - vec4 tmpvar_5; - tmpvar_5 = (tmpvar_4 * tmpvar_4); + waves_5 = (gl_Vertex.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y)); + waves_5 = (waves_5 + (gl_Vertex.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y))); + waves_5 = (waves_5 + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8))); vec4 tmpvar_6; - tmpvar_6 = (tmpvar_5 * tmpvar_4); - vec4 tmpvar_7; - tmpvar_7 = (tmpvar_6 * tmpvar_5); - vec4 tmpvar_8; - tmpvar_8 = (((tmpvar_4 + - (tmpvar_6 * -0.161616) - ) + (tmpvar_7 * 0.0083333)) + ((tmpvar_7 * tmpvar_5) * -0.00019841)); - vec4 tmpvar_9; - tmpvar_9 = (tmpvar_8 * tmpvar_8); - vec4 tmpvar_10; - tmpvar_10 = ((tmpvar_9 * tmpvar_9) * (gl_Color.w * _WaveAndDistance.z)); - waveMove_3.x = dot (tmpvar_10, vec4(0.024, 0.04, -0.12, 0.096)); - waveMove_3.z = dot (tmpvar_10, vec4(0.006, 0.02, -0.02, 0.1)); + tmpvar_6 = fract(waves_5); + waves_5 = tmpvar_6; + vec4 val_7; + vec4 s_8; + vec4 r2_9; + vec4 r1_10; + vec4 r5_11; + val_7 = ((tmpvar_6 * 6.40885) - 3.14159); + r5_11 = (val_7 * val_7); + r1_10 = (r5_11 * val_7); + r2_9 = (r1_10 * r5_11); + s_8 = (((val_7 + + (r1_10 * -0.161616) + ) + (r2_9 * 0.0083333)) + ((r2_9 * r5_11) * -0.00019841)); + s_4 = (s_8 * s_8); + s_4 = (s_4 * s_4); + s_4 = (s_4 * (gl_Color.w * _WaveAndDistance.z)); + waveMove_3.x = dot (s_4, vec4(0.024, 0.04, -0.12, 0.096)); + waveMove_3.z = dot (s_4, vec4(0.006, 0.02, -0.02, 0.1)); vertex_2.xz = (gl_Vertex.xz - (waveMove_3.xz * _WaveAndDistance.z)); tmpvar_1.xyz = vec3(0.0, 0.0, 1.0); tmpvar_1.w = -(((gl_ModelViewMatrix * vertex_2).z * _ProjectionParams.w)); gl_Position = (gl_ModelViewProjectionMatrix * vertex_2); - vec4 tmpvar_11; - tmpvar_11.zw = vec2(0.0, 0.0); - tmpvar_11.xy = gl_MultiTexCoord0.xy; - gl_TexCoord[0] = tmpvar_11; + vec4 tmpvar_12; + tmpvar_12.zw = vec2(0.0, 0.0); + tmpvar_12.xy = gl_MultiTexCoord0.xy; + gl_TexCoord[0] = tmpvar_12; gl_TexCoord[1] = tmpvar_1; } -// inputs: 3, stats: 35 alu 0 tex 0 flow +// stats: 35 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Color (high float) 4x1 [-1] loc 3 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 4 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: gl_ModelViewMatrix (high float) 4x4 [-1] +// #2: _ProjectionParams (high float) 4x1 [-1] +// #3: _WaveAndDistance (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-ir.txt deleted file mode 100644 index ab9b92792..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-ir.txt +++ /dev/null @@ -1,136 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; -}; -struct appdata_tree_billboard { - vec4 vertex; - vec4 color; - vec4 texcoord; - vec2 texcoord1; -}; -uniform vec4 _TreeBillboardCameraFront; -uniform vec4 _TreeBillboardCameraPos; -uniform vec3 _TreeBillboardCameraRight; -uniform vec4 _TreeBillboardCameraUp; -uniform vec4 _TreeBillboardDistances; -void TerrainBillboardTree ( - inout vec4 pos_1, - in vec2 offset_2, - in float offsetz_3 -) -{ - float absRadius_4; - float billboardRootOffsetFactor_5; - float billboardModeFactor_6; - float radius_7; - float billboardAngleFactor_8; - float treeDistanceSqr_9; - vec3 treePos_10; - vec3 tmpvar_11; - tmpvar_11 = (pos_1.xyz - _TreeBillboardCameraPos.xyz); - treePos_10 = tmpvar_11; - float tmpvar_12; - tmpvar_12 = dot (treePos_10, treePos_10); - float tmpvar_13; - tmpvar_13 = tmpvar_12; - treeDistanceSqr_9 = tmpvar_13; - if ((treeDistanceSqr_9 > _TreeBillboardDistances.x)) { - vec2 tmpvar_14; - tmpvar_14 = vec2(0.0, 0.0); - offset_2 = tmpvar_14.xy.xy; - }; - vec3 tmpvar_15; - tmpvar_15 = (pos_1.xyz + (_TreeBillboardCameraRight.xyz * offset_2.x)); - pos_1.xyz = tmpvar_15.xyz.xyz; - float tmpvar_16; - tmpvar_16 = _TreeBillboardCameraPos.w; - billboardAngleFactor_8 = tmpvar_16; - float tmpvar_17; - tmpvar_17 = mix (offset_2.y, offsetz_3, billboardAngleFactor_8); - float tmpvar_18; - tmpvar_18 = tmpvar_17; - radius_7 = tmpvar_18; - float tmpvar_19; - tmpvar_19 = _TreeBillboardCameraUp.w; - billboardModeFactor_6 = tmpvar_19; - float tmpvar_20; - tmpvar_20 = _TreeBillboardCameraFront.w; - billboardRootOffsetFactor_5 = tmpvar_20; - float tmpvar_21; - tmpvar_21 = abs (radius_7); - float tmpvar_22; - tmpvar_22 = tmpvar_21; - absRadius_4 = tmpvar_22; - float tmpvar_23; - tmpvar_23 = max (0.0, radius_7); - vec3 tmpvar_24; - tmpvar_24 = vec3(billboardModeFactor_6); - vec3 tmpvar_25; - tmpvar_25 = mix (((( - (_TreeBillboardCameraUp.xyz * tmpvar_23) - * 2.0) - (vec3(0.0, 1.0, 0.0) * absRadius_4)) - ((_TreeBillboardCameraUp.xyz * absRadius_4) * billboardRootOffsetFactor_5)), (_TreeBillboardCameraUp.xyz * radius_7), tmpvar_24); - vec3 tmpvar_26; - tmpvar_26 = (pos_1.xyz + tmpvar_25); - pos_1.xyz = tmpvar_26.xyz.xyz; -} - -v2f vert ( - in appdata_tree_billboard v_27 -) -{ - v2f o_28; - TerrainBillboardTree (v_27.vertex, v_27.texcoord1.xy, v_27.texcoord.y); - vec4 tmpvar_29; - tmpvar_29 = (gl_ModelViewProjectionMatrix * v_27.vertex); - o_28.pos = tmpvar_29; - float tmpvar_30; - tmpvar_30 = v_27.texcoord.x; - o_28.uv.x = tmpvar_30; - float tmpvar_31; - tmpvar_31 = float((v_27.texcoord.y > 0.0)); - o_28.uv.y = vec2(tmpvar_31).y; - return o_28; -} - -void main () -{ - appdata_tree_billboard xlt_v_32; - v2f xl_retval_33; - vec4 tmpvar_34; - tmpvar_34 = gl_Vertex.xyzw; - vec4 tmpvar_35; - tmpvar_35 = tmpvar_34; - xlt_v_32.vertex = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36 = gl_Color.xyzw; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlt_v_32.color = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - xlt_v_32.texcoord = tmpvar_39; - vec2 tmpvar_40; - tmpvar_40 = gl_MultiTexCoord1.xy; - vec2 tmpvar_41; - tmpvar_41 = tmpvar_40; - xlt_v_32.texcoord1 = tmpvar_41; - v2f tmpvar_42; - tmpvar_42 = vert (xlt_v_32); - v2f tmpvar_43; - tmpvar_43 = tmpvar_42; - xl_retval_33 = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44 = xl_retval_33.pos.xyzw; - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - gl_Position = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46.zw = vec2(0.0, 0.0); - tmpvar_46.xy = xl_retval_33.uv.xy; - vec4 tmpvar_47; - tmpvar_47 = tmpvar_46; - gl_TexCoord[0] = tmpvar_47; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-out.txt index c0532e933..3a045f601 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-out.txt @@ -10,10 +10,10 @@ void main () pos_2 = gl_Vertex; vec2 offset_3; offset_3 = gl_MultiTexCoord1.xy; - vec3 tmpvar_4; - tmpvar_4 = (gl_Vertex.xyz - _TreeBillboardCameraPos.xyz); + vec3 treePos_4; + treePos_4 = (gl_Vertex.xyz - _TreeBillboardCameraPos.xyz); float tmpvar_5; - tmpvar_5 = dot (tmpvar_4, tmpvar_4); + tmpvar_5 = dot (treePos_4, treePos_4); if ((tmpvar_5 > _TreeBillboardDistances.x)) { offset_3 = vec2(0.0, 0.0); }; @@ -37,4 +37,15 @@ void main () } -// inputs: 3, stats: 23 alu 0 tex 1 flow +// stats: 23 alu 0 tex 1 flow +// inputs: 3 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 6 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _TreeBillboardCameraFront (high float) 4x1 [-1] +// #2: _TreeBillboardCameraPos (high float) 4x1 [-1] +// #3: _TreeBillboardCameraRight (high float) 3x1 [-1] +// #4: _TreeBillboardCameraUp (high float) 4x1 [-1] +// #5: _TreeBillboardDistances (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Glow_Downsample-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Glow_Downsample-ir.txt deleted file mode 100644 index db70dab59..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Glow_Downsample-ir.txt +++ /dev/null @@ -1,130 +0,0 @@ -struct appdata_img { - vec4 vertex; - vec2 texcoord; -}; -struct v2f { - vec4 pos; - vec4 uv[4]; -}; -uniform vec4 _MainTex_TexelSize; -vec2 MultiplyUV ( - in mat4 mat_1, - in vec2 inUV_2 -) -{ - vec4 temp_3; - vec4 tmpvar_4; - tmpvar_4.zw = vec2(0.0, 0.0); - tmpvar_4.x = inUV_2.x; - tmpvar_4.y = inUV_2.y; - vec4 tmpvar_5; - tmpvar_5 = tmpvar_4; - temp_3 = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6 = (mat_1 * temp_3); - temp_3 = tmpvar_6; - return temp_3.xy; -} - -v2f vert ( - in appdata_img v_7 -) -{ - float offY_8; - float offX_9; - vec4 uv_10; - v2f o_11; - vec4 tmpvar_12; - tmpvar_12 = (gl_ModelViewProjectionMatrix * v_7.vertex); - o_11.pos = tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = MultiplyUV (gl_TextureMatrix[0], v_7.texcoord); - vec2 tmpvar_14; - tmpvar_14 = tmpvar_13; - uv_10.xy = tmpvar_14.xy.xy; - vec2 tmpvar_15; - tmpvar_15 = vec2(0.0, 0.0); - uv_10.zw = tmpvar_15.xxxy.zw; - float tmpvar_16; - tmpvar_16 = _MainTex_TexelSize.x; - offX_9 = tmpvar_16; - float tmpvar_17; - tmpvar_17 = _MainTex_TexelSize.y; - offY_8 = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18.zw = vec2(0.0, 1.0); - tmpvar_18.x = -(offX_9); - tmpvar_18.y = -(offY_8); - vec4 tmpvar_19; - tmpvar_19 = (uv_10 + tmpvar_18); - o_11.uv[0] = tmpvar_19; - vec4 tmpvar_20; - tmpvar_20.zw = vec2(0.0, 1.0); - tmpvar_20.x = offX_9; - tmpvar_20.y = -(offY_8); - vec4 tmpvar_21; - tmpvar_21 = (uv_10 + tmpvar_20); - o_11.uv[1] = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22.zw = vec2(0.0, 1.0); - tmpvar_22.x = offX_9; - tmpvar_22.y = offY_8; - vec4 tmpvar_23; - tmpvar_23 = (uv_10 + tmpvar_22); - o_11.uv[2] = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24.zw = vec2(0.0, 1.0); - tmpvar_24.x = -(offX_9); - tmpvar_24.y = offY_8; - vec4 tmpvar_25; - tmpvar_25 = (uv_10 + tmpvar_24); - o_11.uv[3] = tmpvar_25; - return o_11; -} - -void main () -{ - appdata_img xlt_v_26; - v2f xl_retval_27; - vec4 tmpvar_28; - tmpvar_28 = gl_Vertex.xyzw; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - xlt_v_26.vertex = tmpvar_29; - vec2 tmpvar_30; - tmpvar_30 = gl_MultiTexCoord0.xy; - vec2 tmpvar_31; - tmpvar_31 = tmpvar_30; - xlt_v_26.texcoord = tmpvar_31; - v2f tmpvar_32; - tmpvar_32 = vert (xlt_v_26); - v2f tmpvar_33; - tmpvar_33 = tmpvar_32; - xl_retval_27 = tmpvar_33; - vec4 tmpvar_34; - tmpvar_34 = xl_retval_27.pos.xyzw; - vec4 tmpvar_35; - tmpvar_35 = tmpvar_34; - gl_Position = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36 = xl_retval_27.uv[0].xyzw; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - gl_TexCoord[0] = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = xl_retval_27.uv[1].xyzw; - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - gl_TexCoord[1] = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = xl_retval_27.uv[2].xyzw; - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - gl_TexCoord[2] = tmpvar_41; - vec4 tmpvar_42; - tmpvar_42 = xl_retval_27.uv[3].xyzw; - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - gl_TexCoord[3] = tmpvar_43; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Glow_Downsample-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Glow_Downsample-out.txt index 8c22c2351..d148d450f 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Glow_Downsample-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Glow_Downsample-out.txt @@ -1,42 +1,49 @@ uniform vec4 _MainTex_TexelSize; void main () { - vec4 uv_1; - vec4 tmpvar_2; - tmpvar_2.zw = vec2(0.0, 0.0); - tmpvar_2.xy = gl_MultiTexCoord0.xy; - uv_1.xy = (gl_TextureMatrix[0] * tmpvar_2).xy; - uv_1.zw = vec2(0.0, 0.0); - float tmpvar_3; - tmpvar_3 = _MainTex_TexelSize.x; - float tmpvar_4; - tmpvar_4 = _MainTex_TexelSize.y; + float offY_1; + float offX_2; + vec4 uv_3; + vec4 tmpvar_4; + tmpvar_4.zw = vec2(0.0, 0.0); + tmpvar_4.xy = gl_MultiTexCoord0.xy; + uv_3.xy = (gl_TextureMatrix[0] * tmpvar_4).xy; + uv_3.zw = vec2(0.0, 0.0); + offX_2 = _MainTex_TexelSize.x; + offY_1 = _MainTex_TexelSize.y; vec4 tmpvar_5; tmpvar_5.zw = vec2(0.0, 1.0); - float cse_6; - cse_6 = -(_MainTex_TexelSize.x); - tmpvar_5.x = cse_6; - float cse_7; - cse_7 = -(_MainTex_TexelSize.y); - tmpvar_5.y = cse_7; + float tmpvar_6; + tmpvar_6 = -(_MainTex_TexelSize.x); + tmpvar_5.x = tmpvar_6; + float tmpvar_7; + tmpvar_7 = -(_MainTex_TexelSize.y); + tmpvar_5.y = tmpvar_7; vec4 tmpvar_8; tmpvar_8.zw = vec2(0.0, 1.0); - tmpvar_8.x = tmpvar_3; - tmpvar_8.y = cse_7; + tmpvar_8.x = offX_2; + tmpvar_8.y = tmpvar_7; vec4 tmpvar_9; tmpvar_9.zw = vec2(0.0, 1.0); - tmpvar_9.x = tmpvar_3; - tmpvar_9.y = tmpvar_4; + tmpvar_9.x = offX_2; + tmpvar_9.y = offY_1; vec4 tmpvar_10; tmpvar_10.zw = vec2(0.0, 1.0); - tmpvar_10.x = cse_6; - tmpvar_10.y = tmpvar_4; + tmpvar_10.x = tmpvar_6; + tmpvar_10.y = offY_1; gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); - gl_TexCoord[0] = (uv_1 + tmpvar_5); - gl_TexCoord[1] = (uv_1 + tmpvar_8); - gl_TexCoord[2] = (uv_1 + tmpvar_9); - gl_TexCoord[3] = (uv_1 + tmpvar_10); + gl_TexCoord[0] = (uv_3 + tmpvar_5); + gl_TexCoord[1] = (uv_3 + tmpvar_8); + gl_TexCoord[2] = (uv_3 + tmpvar_9); + gl_TexCoord[3] = (uv_3 + tmpvar_10); } -// inputs: 2, stats: 14 alu 0 tex 0 flow +// stats: 14 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 3 (total size: 0) +// #0: gl_TextureMatrix (high float) 4x4 [16] +// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #2: _MainTex_TexelSize (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-ir.txt deleted file mode 100644 index cb799b50d..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-ir.txt +++ /dev/null @@ -1,87 +0,0 @@ -struct v2f { - vec4 vertex; - vec4 color; - vec2 texcoord; - vec2 texgencoord; -}; -struct appdata_t { - vec4 vertex; - vec4 color; - vec2 texcoord; -}; -uniform mat4 _GUIClipTextureMatrix; -uniform vec4 _MainTex_ST; -v2f vert ( - in appdata_t v_1 -) -{ - vec4 texgen_2; - v2f o_3; - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1.vertex); - o_3.vertex = tmpvar_4; - vec4 tmpvar_5; - tmpvar_5 = (gl_ModelViewMatrix * v_1.vertex); - texgen_2 = tmpvar_5; - vec2 tmpvar_6; - tmpvar_6 = (_GUIClipTextureMatrix * texgen_2).xy; - vec2 tmpvar_7; - tmpvar_7 = tmpvar_6; - o_3.texgencoord = tmpvar_7; - vec4 tmpvar_8; - tmpvar_8 = v_1.color; - o_3.color = tmpvar_8; - vec2 tmpvar_9; - tmpvar_9 = ((v_1.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_3.texcoord = tmpvar_9; - return o_3; -} - -void main () -{ - appdata_t xlt_v_10; - v2f xl_retval_11; - vec4 tmpvar_12; - tmpvar_12 = gl_Vertex.xyzw; - vec4 tmpvar_13; - tmpvar_13 = tmpvar_12; - xlt_v_10.vertex = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = gl_Color.xyzw; - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - xlt_v_10.color = tmpvar_15; - vec2 tmpvar_16; - tmpvar_16 = gl_MultiTexCoord0.xy; - vec2 tmpvar_17; - tmpvar_17 = tmpvar_16; - xlt_v_10.texcoord = tmpvar_17; - v2f tmpvar_18; - tmpvar_18 = vert (xlt_v_10); - v2f tmpvar_19; - tmpvar_19 = tmpvar_18; - xl_retval_11 = tmpvar_19; - vec4 tmpvar_20; - tmpvar_20 = xl_retval_11.vertex.xyzw; - vec4 tmpvar_21; - tmpvar_21 = tmpvar_20; - gl_Position = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22 = xl_retval_11.color.xyzw; - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - gl_FrontColor = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24.zw = vec2(0.0, 0.0); - tmpvar_24.xy = xl_retval_11.texcoord.xy; - vec4 tmpvar_25; - tmpvar_25 = tmpvar_24; - gl_TexCoord[0] = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26.zw = vec2(0.0, 0.0); - tmpvar_26.xy = xl_retval_11.texgencoord.xy; - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - gl_TexCoord[1] = tmpvar_27; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-out.txt index 295771f57..77f91ac97 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-out.txt @@ -15,4 +15,13 @@ void main () } -// inputs: 3, stats: 7 alu 0 tex 0 flow +// stats: 7 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Color (high float) 4x1 [-1] loc 3 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 4 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: gl_ModelViewMatrix (high float) 4x4 [-1] +// #2: _GUIClipTextureMatrix (high float) 4x4 [-1] +// #3: _MainTex_ST (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-PrePassLighting-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-PrePassLighting-ir.txt deleted file mode 100644 index e8b9e883f..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-PrePassLighting-ir.txt +++ /dev/null @@ -1,93 +0,0 @@ -struct v2f { - vec4 pos; - vec4 uv; - vec3 ray; -}; -struct appdata { - vec4 vertex; - vec3 texcoord; -}; -uniform vec4 _ProjectionParams; -vec4 ComputeScreenPos ( - in vec4 pos_1 -) -{ - vec4 o_2; - vec4 tmpvar_3; - tmpvar_3 = (pos_1 * 0.5); - o_2 = tmpvar_3; - vec2 tmpvar_4; - tmpvar_4.x = o_2.x; - tmpvar_4.y = (o_2.y * _ProjectionParams.x); - vec2 tmpvar_5; - tmpvar_5 = (tmpvar_4 + o_2.w); - o_2.xy = tmpvar_5.xy.xy; - vec2 tmpvar_6; - tmpvar_6 = pos_1.zw; - o_2.zw = tmpvar_6.xxxy.zw; - return o_2; -} - -v2f vert ( - in appdata v_7 -) -{ - v2f o_8; - vec4 tmpvar_9; - tmpvar_9 = (gl_ModelViewProjectionMatrix * v_7.vertex); - o_8.pos = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10 = ComputeScreenPos (o_8.pos); - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - o_8.uv = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = ((gl_ModelViewMatrix * v_7.vertex).xyz * vec3(-1.0, -1.0, 1.0)); - o_8.ray = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13 = vec3(float((v_7.texcoord.z != 0.0))); - vec3 tmpvar_14; - tmpvar_14 = mix (o_8.ray, v_7.texcoord, tmpvar_13); - vec3 tmpvar_15; - tmpvar_15 = tmpvar_14; - o_8.ray = tmpvar_15; - return o_8; -} - -void main () -{ - appdata xlt_v_16; - v2f xl_retval_17; - vec4 tmpvar_18; - tmpvar_18 = gl_Vertex.xyzw; - vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - xlt_v_16.vertex = tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = gl_MultiTexCoord0.xyz; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_20; - xlt_v_16.texcoord = tmpvar_21; - v2f tmpvar_22; - tmpvar_22 = vert (xlt_v_16); - v2f tmpvar_23; - tmpvar_23 = tmpvar_22; - xl_retval_17 = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = xl_retval_17.pos.xyzw; - vec4 tmpvar_25; - tmpvar_25 = tmpvar_24; - gl_Position = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = xl_retval_17.uv.xyzw; - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - gl_TexCoord[0] = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28.w = 0.0; - tmpvar_28.xyz = xl_retval_17.ray.xyz; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - gl_TexCoord[1] = tmpvar_29; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-PrePassLighting-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-PrePassLighting-out.txt index 1e10c3c5f..8c347241a 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-PrePassLighting-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-PrePassLighting-out.txt @@ -2,22 +2,33 @@ uniform vec4 _ProjectionParams; void main () { vec4 tmpvar_1; + vec3 tmpvar_2; tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); - vec4 o_2; - vec4 tmpvar_3; - tmpvar_3 = (tmpvar_1 * 0.5); + vec4 o_3; + o_3 = (tmpvar_1 * 0.5); vec2 tmpvar_4; - tmpvar_4.x = tmpvar_3.x; - tmpvar_4.y = (tmpvar_3.y * _ProjectionParams.x); - o_2.xy = (tmpvar_4 + tmpvar_3.w); - o_2.zw = tmpvar_1.zw; + tmpvar_4.x = o_3.x; + tmpvar_4.y = (o_3.y * _ProjectionParams.x); + o_3.xy = (tmpvar_4 + o_3.w); + o_3.zw = tmpvar_1.zw; + tmpvar_2 = ((gl_ModelViewMatrix * gl_Vertex).xyz * vec3(-1.0, -1.0, 1.0)); + vec3 tmpvar_5; + tmpvar_5 = mix (tmpvar_2, gl_MultiTexCoord0.xyz, vec3(float((gl_MultiTexCoord0.z != 0.0)))); + tmpvar_2 = tmpvar_5; gl_Position = tmpvar_1; - gl_TexCoord[0] = o_2; - vec4 tmpvar_5; - tmpvar_5.w = 0.0; - tmpvar_5.xyz = mix (((gl_ModelViewMatrix * gl_Vertex).xyz * vec3(-1.0, -1.0, 1.0)), gl_MultiTexCoord0.xyz, vec3(float((gl_MultiTexCoord0.z != 0.0)))); - gl_TexCoord[1] = tmpvar_5; + gl_TexCoord[0] = o_3; + vec4 tmpvar_6; + tmpvar_6.w = 0.0; + tmpvar_6.xyz = tmpvar_5; + gl_TexCoord[1] = tmpvar_6; } -// inputs: 2, stats: 10 alu 0 tex 0 flow +// stats: 10 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 3 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: gl_ModelViewMatrix (high float) 4x4 [-1] +// #2: _ProjectionParams (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-ir.txt deleted file mode 100644 index b6b12f5b4..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-ir.txt +++ /dev/null @@ -1,97 +0,0 @@ -struct appdata_img { - vec4 vertex; - vec2 texcoord; -}; -struct v2f { - vec4 pos; - vec2 uv; - vec2 uvg; - vec2 uvs; -}; -uniform vec4 _GrainOffsetScale; -uniform vec4 _ScratchOffsetScale; -vec2 MultiplyUV ( - in mat4 mat_1, - in vec2 inUV_2 -) -{ - vec4 temp_3; - vec4 tmpvar_4; - tmpvar_4.zw = vec2(0.0, 0.0); - tmpvar_4.x = inUV_2.x; - tmpvar_4.y = inUV_2.y; - vec4 tmpvar_5; - tmpvar_5 = tmpvar_4; - temp_3 = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6 = (mat_1 * temp_3); - temp_3 = tmpvar_6; - return temp_3.xy; -} - -v2f vert ( - in appdata_img v_7 -) -{ - v2f o_8; - vec4 tmpvar_9; - tmpvar_9 = (gl_ModelViewProjectionMatrix * v_7.vertex); - o_8.pos = tmpvar_9; - vec2 tmpvar_10; - tmpvar_10 = MultiplyUV (gl_TextureMatrix[0], v_7.texcoord); - vec2 tmpvar_11; - tmpvar_11 = tmpvar_10; - o_8.uv = tmpvar_11; - vec2 tmpvar_12; - tmpvar_12 = ((v_7.texcoord.xy * _GrainOffsetScale.zw) + _GrainOffsetScale.xy); - o_8.uvg = tmpvar_12; - vec2 tmpvar_13; - tmpvar_13 = ((v_7.texcoord.xy * _ScratchOffsetScale.zw) + _ScratchOffsetScale.xy); - o_8.uvs = tmpvar_13; - return o_8; -} - -void main () -{ - appdata_img xlt_v_14; - v2f xl_retval_15; - vec4 tmpvar_16; - tmpvar_16 = gl_Vertex.xyzw; - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - xlt_v_14.vertex = tmpvar_17; - vec2 tmpvar_18; - tmpvar_18 = gl_MultiTexCoord0.xy; - vec2 tmpvar_19; - tmpvar_19 = tmpvar_18; - xlt_v_14.texcoord = tmpvar_19; - v2f tmpvar_20; - tmpvar_20 = vert (xlt_v_14); - v2f tmpvar_21; - tmpvar_21 = tmpvar_20; - xl_retval_15 = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22 = xl_retval_15.pos.xyzw; - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - gl_Position = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24.zw = vec2(0.0, 0.0); - tmpvar_24.xy = xl_retval_15.uv.xy; - vec4 tmpvar_25; - tmpvar_25 = tmpvar_24; - gl_TexCoord[0] = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26.zw = vec2(0.0, 0.0); - tmpvar_26.xy = xl_retval_15.uvg.xy; - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - gl_TexCoord[1] = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28.zw = vec2(0.0, 0.0); - tmpvar_28.xy = xl_retval_15.uvs.xy; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - gl_TexCoord[2] = tmpvar_29; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-out.txt index 4ea96facf..486cefab1 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-out.txt @@ -21,4 +21,12 @@ void main () } -// inputs: 2, stats: 10 alu 0 tex 0 flow +// stats: 10 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 4 (total size: 0) +// #0: gl_TextureMatrix (high float) 4x4 [16] +// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #2: _GrainOffsetScale (high float) 4x1 [-1] +// #3: _ScratchOffsetScale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-ir.txt deleted file mode 100644 index ffb816482..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-ir.txt +++ /dev/null @@ -1,156 +0,0 @@ -struct v2f { - vec4 pos; - float fog; - vec4 color; - vec2 uv; -}; -struct appdata_tree_billboard { - vec4 vertex; - vec4 color; - vec4 texcoord; - vec2 texcoord1; -}; -uniform vec4 _TreeBillboardCameraFront; -uniform vec4 _TreeBillboardCameraPos; -uniform vec3 _TreeBillboardCameraRight; -uniform vec4 _TreeBillboardCameraUp; -uniform vec4 _TreeBillboardDistances; -varying vec4 xlv_FOG; -void TerrainBillboardTree ( - inout vec4 pos_1, - in vec2 offset_2, - in float offsetz_3 -) -{ - float absRadius_4; - float billboardRootOffsetFactor_5; - float billboardModeFactor_6; - float radius_7; - float billboardAngleFactor_8; - float treeDistanceSqr_9; - vec3 treePos_10; - vec3 tmpvar_11; - tmpvar_11 = (pos_1.xyz - _TreeBillboardCameraPos.xyz); - treePos_10 = tmpvar_11; - float tmpvar_12; - tmpvar_12 = dot (treePos_10, treePos_10); - float tmpvar_13; - tmpvar_13 = tmpvar_12; - treeDistanceSqr_9 = tmpvar_13; - if ((treeDistanceSqr_9 > _TreeBillboardDistances.x)) { - vec2 tmpvar_14; - tmpvar_14 = vec2(0.0, 0.0); - offset_2 = tmpvar_14.xy.xy; - }; - vec3 tmpvar_15; - tmpvar_15 = (pos_1.xyz + (_TreeBillboardCameraRight.xyz * offset_2.x)); - pos_1.xyz = tmpvar_15.xyz.xyz; - float tmpvar_16; - tmpvar_16 = _TreeBillboardCameraPos.w; - billboardAngleFactor_8 = tmpvar_16; - float tmpvar_17; - tmpvar_17 = mix (offset_2.y, offsetz_3, billboardAngleFactor_8); - float tmpvar_18; - tmpvar_18 = tmpvar_17; - radius_7 = tmpvar_18; - float tmpvar_19; - tmpvar_19 = _TreeBillboardCameraUp.w; - billboardModeFactor_6 = tmpvar_19; - float tmpvar_20; - tmpvar_20 = _TreeBillboardCameraFront.w; - billboardRootOffsetFactor_5 = tmpvar_20; - float tmpvar_21; - tmpvar_21 = abs (radius_7); - float tmpvar_22; - tmpvar_22 = tmpvar_21; - absRadius_4 = tmpvar_22; - float tmpvar_23; - tmpvar_23 = max (0.0, radius_7); - vec3 tmpvar_24; - tmpvar_24 = vec3(billboardModeFactor_6); - vec3 tmpvar_25; - tmpvar_25 = mix (((( - (_TreeBillboardCameraUp.xyz * tmpvar_23) - * 2.0) - (vec3(0.0, 1.0, 0.0) * absRadius_4)) - ((_TreeBillboardCameraUp.xyz * absRadius_4) * billboardRootOffsetFactor_5)), (_TreeBillboardCameraUp.xyz * radius_7), tmpvar_24); - vec3 tmpvar_26; - tmpvar_26 = (pos_1.xyz + tmpvar_25); - pos_1.xyz = tmpvar_26.xyz.xyz; -} - -v2f vert ( - in appdata_tree_billboard v_27 -) -{ - v2f o_28; - TerrainBillboardTree (v_27.vertex, v_27.texcoord1.xy, v_27.texcoord.y); - vec4 tmpvar_29; - tmpvar_29 = (gl_ModelViewProjectionMatrix * v_27.vertex); - o_28.pos = tmpvar_29; - float tmpvar_30; - tmpvar_30 = o_28.pos.z; - o_28.fog = tmpvar_30; - float tmpvar_31; - tmpvar_31 = v_27.texcoord.x; - o_28.uv.x = tmpvar_31; - float tmpvar_32; - tmpvar_32 = float((v_27.texcoord.y > 0.0)); - o_28.uv.y = vec2(tmpvar_32).y; - vec4 tmpvar_33; - tmpvar_33 = v_27.color; - o_28.color = tmpvar_33; - return o_28; -} - -void main () -{ - appdata_tree_billboard xlt_v_34; - v2f xl_retval_35; - vec4 tmpvar_36; - tmpvar_36 = gl_Vertex.xyzw; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlt_v_34.vertex = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = gl_Color.xyzw; - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - xlt_v_34.color = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - xlt_v_34.texcoord = tmpvar_41; - vec2 tmpvar_42; - tmpvar_42 = gl_MultiTexCoord1.xy; - vec2 tmpvar_43; - tmpvar_43 = tmpvar_42; - xlt_v_34.texcoord1 = tmpvar_43; - v2f tmpvar_44; - tmpvar_44 = vert (xlt_v_34); - v2f tmpvar_45; - tmpvar_45 = tmpvar_44; - xl_retval_35 = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46 = xl_retval_35.pos.xyzw; - vec4 tmpvar_47; - tmpvar_47 = tmpvar_46; - gl_Position = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_48.x = xl_retval_35.fog; - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - xlv_FOG = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50 = xl_retval_35.color.xyzw; - vec4 tmpvar_51; - tmpvar_51 = tmpvar_50; - gl_FrontColor = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52.zw = vec2(0.0, 0.0); - tmpvar_52.xy = xl_retval_35.uv.xy; - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - gl_TexCoord[0] = tmpvar_53; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-out.txt index dcc03f0e0..fa3b6ebec 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-out.txt @@ -6,43 +6,55 @@ uniform vec4 _TreeBillboardDistances; varying vec4 xlv_FOG; void main () { - vec2 tmpvar_1; - vec4 pos_2; - pos_2 = gl_Vertex; - vec2 offset_3; - offset_3 = gl_MultiTexCoord1.xy; - vec3 tmpvar_4; - tmpvar_4 = (gl_Vertex.xyz - _TreeBillboardCameraPos.xyz); - float tmpvar_5; - tmpvar_5 = dot (tmpvar_4, tmpvar_4); - if ((tmpvar_5 > _TreeBillboardDistances.x)) { - offset_3 = vec2(0.0, 0.0); - }; - pos_2.xyz = (gl_Vertex.xyz + (_TreeBillboardCameraRight * offset_3.x)); + vec4 tmpvar_1; + vec2 tmpvar_2; + vec4 pos_3; + pos_3 = gl_Vertex; + vec2 offset_4; + offset_4 = gl_MultiTexCoord1.xy; + vec3 treePos_5; + treePos_5 = (gl_Vertex.xyz - _TreeBillboardCameraPos.xyz); float tmpvar_6; - tmpvar_6 = mix (offset_3.y, gl_MultiTexCoord0.y, _TreeBillboardCameraPos.w); + tmpvar_6 = dot (treePos_5, treePos_5); + if ((tmpvar_6 > _TreeBillboardDistances.x)) { + offset_4 = vec2(0.0, 0.0); + }; + pos_3.xyz = (gl_Vertex.xyz + (_TreeBillboardCameraRight * offset_4.x)); float tmpvar_7; - tmpvar_7 = abs(tmpvar_6); - pos_2.xyz = (pos_2.xyz + mix (( - (((_TreeBillboardCameraUp.xyz * max (0.0, tmpvar_6)) * 2.0) - (vec3(0.0, 1.0, 0.0) * tmpvar_7)) + tmpvar_7 = mix (offset_4.y, gl_MultiTexCoord0.y, _TreeBillboardCameraPos.w); + float tmpvar_8; + tmpvar_8 = abs(tmpvar_7); + pos_3.xyz = (pos_3.xyz + mix (( + (((_TreeBillboardCameraUp.xyz * max (0.0, tmpvar_7)) * 2.0) - (vec3(0.0, 1.0, 0.0) * tmpvar_8)) - - ((_TreeBillboardCameraUp.xyz * tmpvar_7) * _TreeBillboardCameraFront.w) - ), (_TreeBillboardCameraUp.xyz * tmpvar_6), _TreeBillboardCameraUp.www)); - vec4 tmpvar_8; - tmpvar_8 = (gl_ModelViewProjectionMatrix * pos_2); - tmpvar_1.x = gl_MultiTexCoord0.x; - tmpvar_1.y = float((gl_MultiTexCoord0.y > 0.0)); - gl_Position = tmpvar_8; + ((_TreeBillboardCameraUp.xyz * tmpvar_8) * _TreeBillboardCameraFront.w) + ), (_TreeBillboardCameraUp.xyz * tmpvar_7), _TreeBillboardCameraUp.www)); + tmpvar_1 = (gl_ModelViewProjectionMatrix * pos_3); + tmpvar_2.x = gl_MultiTexCoord0.x; + tmpvar_2.y = float((gl_MultiTexCoord0.y > 0.0)); + gl_Position = tmpvar_1; vec4 tmpvar_9; tmpvar_9.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_9.x = tmpvar_8.z; + tmpvar_9.x = tmpvar_1.z; xlv_FOG = tmpvar_9; gl_FrontColor = gl_Color; vec4 tmpvar_10; tmpvar_10.zw = vec2(0.0, 0.0); - tmpvar_10.xy = tmpvar_1; + tmpvar_10.xy = tmpvar_2; gl_TexCoord[0] = tmpvar_10; } -// inputs: 4, stats: 24 alu 0 tex 1 flow +// stats: 24 alu 0 tex 1 flow +// inputs: 4 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #2: gl_Color (high float) 4x1 [-1] loc 3 +// #3: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 6 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _TreeBillboardCameraFront (high float) 4x1 [-1] +// #2: _TreeBillboardCameraPos (high float) 4x1 [-1] +// #3: _TreeBillboardCameraRight (high float) 3x1 [-1] +// #4: _TreeBillboardCameraUp (high float) 4x1 [-1] +// #5: _TreeBillboardDistances (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-ir.txt deleted file mode 100644 index 16670f477..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-ir.txt +++ /dev/null @@ -1,533 +0,0 @@ -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 lop_color; - vec3 normal; - vec3 vlight; -}; -uniform vec4 _CameraPosition; -uniform vec3 _CameraRight; -uniform vec3 _CameraUp; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _WaveAndDistance; -uniform vec4 _WavingTint; -uniform vec4 unity_4LightAtten0; -uniform vec4 unity_4LightPosX0; -uniform vec4 unity_4LightPosY0; -uniform vec4 unity_4LightPosZ0; -uniform vec3 unity_LightColor0; -uniform vec3 unity_LightColor1; -uniform vec3 unity_LightColor2; -uniform vec3 unity_LightColor3; -uniform vec4 unity_SHAb; -uniform vec4 unity_SHAg; -uniform vec4 unity_SHAr; -uniform vec4 unity_SHBb; -uniform vec4 unity_SHBg; -uniform vec4 unity_SHBr; -uniform vec4 unity_SHC; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -void FastSinCos ( - in vec4 val_9, - out vec4 s_10, - out vec4 c_11 -) -{ - vec4 cos8_12; - vec4 sin7_13; - vec4 r3_14; - vec4 r2_15; - vec4 r1_16; - vec4 r8_17; - vec4 r7_18; - vec4 r6_19; - vec4 r5_20; - vec4 tmpvar_21; - tmpvar_21 = vec4(1.0, -0.161616, 0.0083333, -0.00019841); - sin7_13 = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22 = vec4(-0.5, 0.0416667, -0.00138889, 2.48016e-05); - cos8_12 = tmpvar_22; - vec4 tmpvar_23; - tmpvar_23 = ((val_9 * 6.40885) - 3.14159); - val_9 = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = (val_9 * val_9); - r5_20 = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25 = (r5_20 * r5_20); - r6_19 = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = (r6_19 * r5_20); - r7_18 = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = (r6_19 * r5_20); - r8_17 = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = (r5_20 * val_9); - r1_16 = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = (r1_16 * r5_20); - r2_15 = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = (r2_15 * r5_20); - r3_14 = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = (((val_9 + - (r1_16 * sin7_13.y) - ) + (r2_15 * sin7_13.z)) + (r3_14 * sin7_13.w)); - s_10 = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = ((( - (1.0 + (r5_20 * cos8_12.x)) - + - (r6_19 * cos8_12.y) - ) + (r7_18 * cos8_12.z)) + (r8_17 * cos8_12.w)); - c_11 = tmpvar_32; -} - -void TerrainWaveGrass ( - inout vec4 vertex_33, - in float waveAmount_34, - in vec3 color_35, - out vec4 outColor_36 -) -{ - vec3 waveColor_37; - vec3 waveMove_38; - float lighting_39; - vec4 c_40; - vec4 s_41; - vec4 waves_42; - vec4 _waveZmove_43; - vec4 _waveXmove_44; - vec4 waveSpeed_45; - vec4 _waveZSize_46; - vec4 _waveXSize_47; - vec4 tmpvar_48; - tmpvar_48 = vec4(1.2, 2.0, 1.6, 4.8); - waveSpeed_45 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = vec4(0.024, 0.04, -0.12, 0.096); - _waveXmove_44 = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50 = vec4(0.006, 0.02, -0.02, 0.1); - _waveZmove_43 = tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = vec3(0.0, 0.0, 0.0); - waveMove_38 = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y); - _waveXSize_47 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y); - _waveZSize_46 = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54 = (vertex_33.x * _waveXSize_47); - waves_42 = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = (waves_42 + (vertex_33.z * _waveZSize_46)); - waves_42 = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = (waves_42 + (_WaveAndDistance.x * waveSpeed_45)); - waves_42 = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = fract (waves_42); - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - waves_42 = tmpvar_58; - FastSinCos (waves_42, s_41, c_40); - vec4 tmpvar_59; - tmpvar_59 = (s_41 * s_41); - s_41 = tmpvar_59; - vec4 tmpvar_60; - tmpvar_60 = (s_41 * s_41); - s_41 = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61 = normalize (vec4(1.0, 1.0, 0.4, 0.2)); - float tmpvar_62; - tmpvar_62 = dot (s_41, tmpvar_61); - float tmpvar_63; - tmpvar_63 = (tmpvar_62 * 0.7); - lighting_39 = tmpvar_63; - vec4 tmpvar_64; - tmpvar_64 = (s_41 * waveAmount_34); - s_41 = tmpvar_64; - float tmpvar_65; - tmpvar_65 = dot (s_41, _waveXmove_44); - float tmpvar_66; - tmpvar_66 = tmpvar_65; - waveMove_38.x = tmpvar_66; - float tmpvar_67; - tmpvar_67 = dot (s_41, _waveZmove_43); - float tmpvar_68; - tmpvar_68 = tmpvar_67; - waveMove_38.z = vec3(tmpvar_68).z; - vec2 tmpvar_69; - tmpvar_69 = (vertex_33.xz - (waveMove_38.xz * _WaveAndDistance.z)); - vertex_33.xz = tmpvar_69.xxy.xz; - vec3 tmpvar_70; - tmpvar_70 = vec3(lighting_39); - vec3 tmpvar_71; - tmpvar_71 = mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, tmpvar_70); - vec3 tmpvar_72; - tmpvar_72 = tmpvar_71; - waveColor_37 = tmpvar_72; - vec3 tmpvar_73; - tmpvar_73 = ((color_35 * waveColor_37) * 2.0); - outColor_36.xyz = tmpvar_73.xyz.xyz; - float tmpvar_74; - tmpvar_74 = 1.0; - outColor_36.w = vec4(tmpvar_74).w; -} - -void TerrainBillboardGrass ( - inout vec4 pos_75, - in vec2 offset_76 -) -{ - vec3 grasspos_77; - vec3 tmpvar_78; - tmpvar_78 = (pos_75.xyz - _CameraPosition.xyz); - grasspos_77 = tmpvar_78; - float tmpvar_79; - tmpvar_79 = dot (grasspos_77, grasspos_77); - if ((tmpvar_79 > _WaveAndDistance.w)) { - vec2 tmpvar_80; - tmpvar_80 = vec2(0.0, 0.0); - offset_76 = tmpvar_80; - }; - vec3 tmpvar_81; - tmpvar_81 = (pos_75.xyz + (offset_76.x * _CameraRight.xyz)); - pos_75.xyz = tmpvar_81.xyz.xyz; - vec3 tmpvar_82; - tmpvar_82 = (pos_75.xyz + (offset_76.y * _CameraUp.xyz)); - pos_75.xyz = tmpvar_82.xyz.xyz; -} - -void vert ( - inout appdata_full v_83 -) -{ - vec4 color_84; - float waveAmount_85; - TerrainBillboardGrass (v_83.vertex, v_83.tangent.xy); - float tmpvar_86; - tmpvar_86 = v_83.tangent.y; - waveAmount_85 = tmpvar_86; - TerrainWaveGrass (v_83.vertex, waveAmount_85, v_83.color.xyz, color_84); - vec4 tmpvar_87; - tmpvar_87 = color_84; - v_83.color = tmpvar_87; -} - -vec3 ShadeSH9 ( - in vec4 normal_88 -) -{ - vec3 x3_89; - float vC_90; - vec3 x2_91; - vec4 vB_92; - vec3 x1_93; - float tmpvar_94; - tmpvar_94 = dot (unity_SHAr, normal_88); - float tmpvar_95; - tmpvar_95 = tmpvar_94; - x1_93.x = tmpvar_95; - float tmpvar_96; - tmpvar_96 = dot (unity_SHAg, normal_88); - float tmpvar_97; - tmpvar_97 = tmpvar_96; - x1_93.y = vec2(tmpvar_97).y; - float tmpvar_98; - tmpvar_98 = dot (unity_SHAb, normal_88); - float tmpvar_99; - tmpvar_99 = tmpvar_98; - x1_93.z = vec3(tmpvar_99).z; - vec4 tmpvar_100; - tmpvar_100 = (normal_88.xyzz * normal_88.yzzx); - vB_92 = tmpvar_100; - float tmpvar_101; - tmpvar_101 = dot (unity_SHBr, vB_92); - float tmpvar_102; - tmpvar_102 = tmpvar_101; - x2_91.x = tmpvar_102; - float tmpvar_103; - tmpvar_103 = dot (unity_SHBg, vB_92); - float tmpvar_104; - tmpvar_104 = tmpvar_103; - x2_91.y = vec2(tmpvar_104).y; - float tmpvar_105; - tmpvar_105 = dot (unity_SHBb, vB_92); - float tmpvar_106; - tmpvar_106 = tmpvar_105; - x2_91.z = vec3(tmpvar_106).z; - float tmpvar_107; - tmpvar_107 = ((normal_88.x * normal_88.x) - (normal_88.y * normal_88.y)); - vC_90 = tmpvar_107; - vec3 tmpvar_108; - tmpvar_108 = (unity_SHC.xyz * vC_90); - x3_89 = tmpvar_108; - return ((x1_93 + x2_91) + x3_89); -} - -vec3 Shade4PointLights ( - in vec4 lightPosX_109, - in vec4 lightPosY_110, - in vec4 lightPosZ_111, - in vec3 lightColor0_112, - in vec3 lightColor1_113, - in vec3 lightColor2_114, - in vec3 lightColor3_115, - in vec4 lightAttenSq_116, - in vec3 pos_117, - in vec3 normal_118 -) -{ - vec3 col_119; - vec4 diff_120; - vec4 atten_121; - vec4 corr_122; - vec4 ndotl_123; - vec4 lengthSq_124; - vec4 toLightZ_125; - vec4 toLightY_126; - vec4 toLightX_127; - vec4 tmpvar_128; - tmpvar_128 = (lightPosX_109 - pos_117.x); - toLightX_127 = tmpvar_128; - vec4 tmpvar_129; - tmpvar_129 = (lightPosY_110 - pos_117.y); - toLightY_126 = tmpvar_129; - vec4 tmpvar_130; - tmpvar_130 = (lightPosZ_111 - pos_117.z); - toLightZ_125 = tmpvar_130; - vec4 tmpvar_131; - tmpvar_131 = vec4(0.0, 0.0, 0.0, 0.0); - lengthSq_124 = tmpvar_131; - vec4 tmpvar_132; - tmpvar_132 = (lengthSq_124 + (toLightX_127 * toLightX_127)); - lengthSq_124 = tmpvar_132; - vec4 tmpvar_133; - tmpvar_133 = (lengthSq_124 + (toLightY_126 * toLightY_126)); - lengthSq_124 = tmpvar_133; - vec4 tmpvar_134; - tmpvar_134 = (lengthSq_124 + (toLightZ_125 * toLightZ_125)); - lengthSq_124 = tmpvar_134; - vec4 tmpvar_135; - tmpvar_135 = vec4(0.0, 0.0, 0.0, 0.0); - ndotl_123 = tmpvar_135; - vec4 tmpvar_136; - tmpvar_136 = (ndotl_123 + (toLightX_127 * normal_118.x)); - ndotl_123 = tmpvar_136; - vec4 tmpvar_137; - tmpvar_137 = (ndotl_123 + (toLightY_126 * normal_118.y)); - ndotl_123 = tmpvar_137; - vec4 tmpvar_138; - tmpvar_138 = (ndotl_123 + (toLightZ_125 * normal_118.z)); - ndotl_123 = tmpvar_138; - vec4 tmpvar_139; - tmpvar_139 = inversesqrt (lengthSq_124); - vec4 tmpvar_140; - tmpvar_140 = tmpvar_139; - corr_122 = tmpvar_140; - vec4 tmpvar_141; - tmpvar_141 = max (vec4(0.0, 0.0, 0.0, 0.0), (ndotl_123 * corr_122)); - vec4 tmpvar_142; - tmpvar_142 = tmpvar_141; - ndotl_123 = tmpvar_142; - vec4 tmpvar_143; - tmpvar_143 = (1.0 / (1.0 + (lengthSq_124 * lightAttenSq_116))); - atten_121 = tmpvar_143; - vec4 tmpvar_144; - tmpvar_144 = (ndotl_123 * atten_121); - diff_120 = tmpvar_144; - vec3 tmpvar_145; - tmpvar_145 = vec3(0.0, 0.0, 0.0); - col_119 = tmpvar_145; - vec3 tmpvar_146; - tmpvar_146 = (col_119 + (lightColor0_112 * diff_120.x)); - col_119 = tmpvar_146; - vec3 tmpvar_147; - tmpvar_147 = (col_119 + (lightColor1_113 * diff_120.y)); - col_119 = tmpvar_147; - vec3 tmpvar_148; - tmpvar_148 = (col_119 + (lightColor2_114 * diff_120.z)); - col_119 = tmpvar_148; - vec3 tmpvar_149; - tmpvar_149 = (col_119 + (lightColor3_115 * diff_120.w)); - col_119 = tmpvar_149; - return col_119; -} - -void PositionFog ( - in vec4 v_150, - out vec4 pos_151, - out float fog_152 -) -{ - vec4 tmpvar_153; - tmpvar_153 = (gl_ModelViewProjectionMatrix * v_150); - pos_151 = tmpvar_153; - float tmpvar_154; - tmpvar_154 = pos_151.z; - fog_152 = tmpvar_154; -} - -v2f_surf vert_surf ( - in appdata_full v_155 -) -{ - vec3 worldPos_156; - vec3 shlight_157; - vec3 worldN_158; - v2f_surf o_159; - vert (v_155); - PositionFog (v_155.vertex, o_159.pos, o_159.fog); - vec2 tmpvar_160; - tmpvar_160 = ((v_155.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_159.hip_pack0 = tmpvar_160.xy.xy; - vec4 tmpvar_161; - tmpvar_161 = v_155.color; - o_159.lop_color = tmpvar_161; - mat3 tmpvar_162; - tmpvar_162 = xll_constructMat3 (_Object2World); - vec3 tmpvar_163; - tmpvar_163 = (tmpvar_162 * (v_155.normal * unity_Scale.w)); - worldN_158 = tmpvar_163; - vec3 tmpvar_164; - tmpvar_164 = worldN_158; - o_159.normal = tmpvar_164; - vec4 tmpvar_165; - tmpvar_165.w = 1.0; - tmpvar_165.xyz = worldN_158.xyz; - vec3 tmpvar_166; - tmpvar_166 = ShadeSH9 (tmpvar_165); - vec3 tmpvar_167; - tmpvar_167 = tmpvar_166; - shlight_157 = tmpvar_167; - vec3 tmpvar_168; - tmpvar_168 = shlight_157; - o_159.vlight = tmpvar_168; - vec3 tmpvar_169; - tmpvar_169 = (_Object2World * v_155.vertex).xyz; - worldPos_156 = tmpvar_169; - vec3 tmpvar_170; - tmpvar_170 = Shade4PointLights (unity_4LightPosX0, unity_4LightPosY0, unity_4LightPosZ0, unity_LightColor0, unity_LightColor1, unity_LightColor2, unity_LightColor3, unity_4LightAtten0, worldPos_156, worldN_158); - vec3 tmpvar_171; - tmpvar_171 = (o_159.vlight + tmpvar_170); - o_159.vlight = tmpvar_171; - return o_159; -} - -void main () -{ - appdata_full xlt_v_172; - v2f_surf xl_retval_173; - vec4 tmpvar_174; - tmpvar_174 = gl_Vertex.xyzw; - vec4 tmpvar_175; - tmpvar_175 = tmpvar_174; - xlt_v_172.vertex = tmpvar_175; - vec4 tmpvar_176; - tmpvar_176 = TANGENT.xyzw; - vec4 tmpvar_177; - tmpvar_177 = tmpvar_176; - xlt_v_172.tangent = tmpvar_177; - vec3 tmpvar_178; - tmpvar_178 = gl_Normal.xyz; - vec3 tmpvar_179; - tmpvar_179 = tmpvar_178; - xlt_v_172.normal = tmpvar_179; - vec4 tmpvar_180; - tmpvar_180 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_181; - tmpvar_181 = tmpvar_180; - xlt_v_172.texcoord = tmpvar_181; - vec4 tmpvar_182; - tmpvar_182 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_183; - tmpvar_183 = tmpvar_182; - xlt_v_172.texcoord1 = tmpvar_183; - vec4 tmpvar_184; - tmpvar_184 = gl_Color.xyzw; - vec4 tmpvar_185; - tmpvar_185 = tmpvar_184; - xlt_v_172.color = tmpvar_185; - v2f_surf tmpvar_186; - tmpvar_186 = vert_surf (xlt_v_172); - v2f_surf tmpvar_187; - tmpvar_187 = tmpvar_186; - xl_retval_173 = tmpvar_187; - vec4 tmpvar_188; - tmpvar_188 = xl_retval_173.pos.xyzw; - vec4 tmpvar_189; - tmpvar_189 = tmpvar_188; - gl_Position = tmpvar_189; - vec4 tmpvar_190; - tmpvar_190.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_190.x = xl_retval_173.fog; - vec4 tmpvar_191; - tmpvar_191 = tmpvar_190; - xlv_FOG = tmpvar_191; - vec4 tmpvar_192; - tmpvar_192.zw = vec2(0.0, 0.0); - tmpvar_192.xy = xl_retval_173.hip_pack0.xy; - vec4 tmpvar_193; - tmpvar_193 = tmpvar_192; - gl_TexCoord[0] = tmpvar_193; - vec4 tmpvar_194; - tmpvar_194 = xl_retval_173.lop_color.xyzw; - vec4 tmpvar_195; - tmpvar_195 = tmpvar_194; - gl_FrontColor = tmpvar_195; - vec4 tmpvar_196; - tmpvar_196.w = 0.0; - tmpvar_196.xyz = xl_retval_173.normal.xyz; - vec4 tmpvar_197; - tmpvar_197 = tmpvar_196; - gl_TexCoord[1] = tmpvar_197; - vec4 tmpvar_198; - tmpvar_198.w = 0.0; - tmpvar_198.xyz = xl_retval_173.vlight.xyz; - vec4 tmpvar_199; - tmpvar_199 = tmpvar_198; - gl_TexCoord[2] = tmpvar_199; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt index 3d3839925..d56ff7840 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt @@ -25,115 +25,155 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 pos_1; - pos_1 = gl_Vertex; - vec2 offset_2; - offset_2 = TANGENT.xy; - vec3 tmpvar_3; - tmpvar_3 = (gl_Vertex.xyz - _CameraPosition.xyz); - float tmpvar_4; - tmpvar_4 = dot (tmpvar_3, tmpvar_3); - if ((tmpvar_4 > _WaveAndDistance.w)) { - offset_2 = vec2(0.0, 0.0); + vec3 worldPos_1; + vec3 worldN_2; + vec4 pos_3; + pos_3 = gl_Vertex; + vec2 offset_4; + offset_4 = TANGENT.xy; + vec3 grasspos_5; + grasspos_5 = (gl_Vertex.xyz - _CameraPosition.xyz); + float tmpvar_6; + tmpvar_6 = dot (grasspos_5, grasspos_5); + if ((tmpvar_6 > _WaveAndDistance.w)) { + offset_4 = vec2(0.0, 0.0); }; - pos_1.xyz = (gl_Vertex.xyz + (offset_2.x * _CameraRight)); - pos_1.xyz = (pos_1.xyz + (offset_2.y * _CameraUp)); - vec4 vertex_5; - vertex_5.yw = pos_1.yw; - vec4 outColor_6; - vec3 waveMove_7; - waveMove_7.y = 0.0; - vec4 tmpvar_8; - tmpvar_8 = ((fract( - (((pos_1.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y)) + (pos_1.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y))) + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8))) - ) * 6.40885) - 3.14159); - vec4 tmpvar_9; - tmpvar_9 = (tmpvar_8 * tmpvar_8); - vec4 tmpvar_10; - tmpvar_10 = (tmpvar_9 * tmpvar_8); - vec4 tmpvar_11; - tmpvar_11 = (tmpvar_10 * tmpvar_9); - vec4 tmpvar_12; - tmpvar_12 = (((tmpvar_8 + - (tmpvar_10 * -0.161616) - ) + (tmpvar_11 * 0.0083333)) + ((tmpvar_11 * tmpvar_9) * -0.00019841)); + pos_3.xyz = (gl_Vertex.xyz + (offset_4.x * _CameraRight)); + pos_3.xyz = (pos_3.xyz + (offset_4.y * _CameraUp)); + vec4 vertex_7; + vertex_7.yw = pos_3.yw; + vec4 outColor_8; + vec3 waveMove_9; + float lighting_10; + vec4 s_11; + vec4 waves_12; + waveMove_9.y = 0.0; + waves_12 = (pos_3.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y)); + waves_12 = (waves_12 + (pos_3.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y))); + waves_12 = (waves_12 + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8))); vec4 tmpvar_13; - tmpvar_13 = (tmpvar_12 * tmpvar_12); - vec4 tmpvar_14; - tmpvar_14 = (tmpvar_13 * tmpvar_13); - vec4 tmpvar_15; - tmpvar_15 = (tmpvar_14 * TANGENT.y); - waveMove_7.x = dot (tmpvar_15, vec4(0.024, 0.04, -0.12, 0.096)); - waveMove_7.z = dot (tmpvar_15, vec4(0.006, 0.02, -0.02, 0.1)); - vertex_5.xz = (pos_1.xz - (waveMove_7.xz * _WaveAndDistance.z)); - outColor_6.xyz = ((gl_Color.xyz * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3( - (dot (tmpvar_14, vec4(0.6742, 0.6742, 0.26968, 0.13484)) * 0.7) - ))) * 2.0); - outColor_6.w = 1.0; - vec4 tmpvar_16; - tmpvar_16 = (gl_ModelViewProjectionMatrix * vertex_5); - mat3 tmpvar_17; - tmpvar_17[0] = _Object2World[0].xyz; - tmpvar_17[1] = _Object2World[1].xyz; - tmpvar_17[2] = _Object2World[2].xyz; - vec3 tmpvar_18; - tmpvar_18 = (tmpvar_17 * (gl_Normal * unity_Scale.w)); - vec4 tmpvar_19; - tmpvar_19.w = 1.0; - tmpvar_19.xyz = tmpvar_18; - vec3 x2_20; - vec3 x1_21; - x1_21.x = dot (unity_SHAr, tmpvar_19); - x1_21.y = dot (unity_SHAg, tmpvar_19); - x1_21.z = dot (unity_SHAb, tmpvar_19); - vec4 tmpvar_22; - tmpvar_22 = (tmpvar_18.xyzz * tmpvar_18.yzzx); - x2_20.x = dot (unity_SHBr, tmpvar_22); - x2_20.y = dot (unity_SHBg, tmpvar_22); - x2_20.z = dot (unity_SHBb, tmpvar_22); - vec3 tmpvar_23; - tmpvar_23 = (_Object2World * vertex_5).xyz; - vec4 tmpvar_24; - tmpvar_24 = (unity_4LightPosX0 - tmpvar_23.x); - vec4 tmpvar_25; - tmpvar_25 = (unity_4LightPosY0 - tmpvar_23.y); - vec4 tmpvar_26; - tmpvar_26 = (unity_4LightPosZ0 - tmpvar_23.z); - vec4 tmpvar_27; - tmpvar_27 = (((tmpvar_24 * tmpvar_24) + (tmpvar_25 * tmpvar_25)) + (tmpvar_26 * tmpvar_26)); - vec4 tmpvar_28; - tmpvar_28 = (max (vec4(0.0, 0.0, 0.0, 0.0), ( - (((tmpvar_24 * tmpvar_18.x) + (tmpvar_25 * tmpvar_18.y)) + (tmpvar_26 * tmpvar_18.z)) - * - inversesqrt(tmpvar_27) - )) * (1.0/((1.0 + - (tmpvar_27 * unity_4LightAtten0) - )))); - gl_Position = tmpvar_16; - vec4 tmpvar_29; - tmpvar_29.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_29.x = tmpvar_16.z; - xlv_FOG = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30.zw = vec2(0.0, 0.0); - tmpvar_30.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_30; - gl_FrontColor = outColor_6; - vec4 tmpvar_31; - tmpvar_31.w = 0.0; - tmpvar_31.xyz = tmpvar_18; - gl_TexCoord[1] = tmpvar_31; + tmpvar_13 = fract(waves_12); + waves_12 = tmpvar_13; + vec4 val_14; + vec4 s_15; + vec4 r2_16; + vec4 r1_17; + vec4 r5_18; + val_14 = ((tmpvar_13 * 6.40885) - 3.14159); + r5_18 = (val_14 * val_14); + r1_17 = (r5_18 * val_14); + r2_16 = (r1_17 * r5_18); + s_15 = (((val_14 + + (r1_17 * -0.161616) + ) + (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); + 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)); + vertex_7.xz = (pos_3.xz - (waveMove_9.xz * _WaveAndDistance.z)); + outColor_8.xyz = ((gl_Color.xyz * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3(lighting_10))) * 2.0); + outColor_8.w = 1.0; + vec4 pos_19; + pos_19 = (gl_ModelViewProjectionMatrix * vertex_7); + mat3 tmpvar_20; + tmpvar_20[0] = _Object2World[0].xyz; + tmpvar_20[1] = _Object2World[1].xyz; + tmpvar_20[2] = _Object2World[2].xyz; + worldN_2 = (tmpvar_20 * (gl_Normal * unity_Scale.w)); + vec4 tmpvar_21; + tmpvar_21.w = 1.0; + tmpvar_21.xyz = worldN_2; + vec3 x2_22; + vec4 vB_23; + vec3 x1_24; + x1_24.x = dot (unity_SHAr, tmpvar_21); + x1_24.y = dot (unity_SHAg, tmpvar_21); + x1_24.z = dot (unity_SHAb, tmpvar_21); + vB_23 = (worldN_2.xyzz * worldN_2.yzzx); + x2_22.x = dot (unity_SHBr, vB_23); + x2_22.y = dot (unity_SHBg, vB_23); + x2_22.z = dot (unity_SHBb, vB_23); + worldPos_1 = (_Object2World * vertex_7).xyz; + vec3 col_25; + vec4 diff_26; + vec4 ndotl_27; + vec4 lengthSq_28; + vec4 toLightZ_29; + vec4 toLightY_30; + vec4 toLightX_31; + toLightX_31 = (unity_4LightPosX0 - worldPos_1.x); + toLightY_30 = (unity_4LightPosY0 - worldPos_1.y); + toLightZ_29 = (unity_4LightPosZ0 - worldPos_1.z); + lengthSq_28 = (toLightX_31 * toLightX_31); + lengthSq_28 = (lengthSq_28 + (toLightY_30 * toLightY_30)); + lengthSq_28 = (lengthSq_28 + (toLightZ_29 * toLightZ_29)); + ndotl_27 = (toLightX_31 * worldN_2.x); + ndotl_27 = (ndotl_27 + (toLightY_30 * worldN_2.y)); + ndotl_27 = (ndotl_27 + (toLightZ_29 * worldN_2.z)); vec4 tmpvar_32; - tmpvar_32.w = 0.0; - tmpvar_32.xyz = (((x1_21 + x2_20) + (unity_SHC.xyz * - ((tmpvar_18.x * tmpvar_18.x) - (tmpvar_18.y * tmpvar_18.y)) - )) + (( - ((unity_LightColor0 * tmpvar_28.x) + (unity_LightColor1 * tmpvar_28.y)) - + - (unity_LightColor2 * tmpvar_28.z) - ) + (unity_LightColor3 * tmpvar_28.w))); - gl_TexCoord[2] = tmpvar_32; + tmpvar_32 = max (vec4(0.0, 0.0, 0.0, 0.0), (ndotl_27 * inversesqrt(lengthSq_28))); + ndotl_27 = tmpvar_32; + diff_26 = (tmpvar_32 * (1.0/((1.0 + + (lengthSq_28 * unity_4LightAtten0) + )))); + col_25 = (unity_LightColor0 * diff_26.x); + col_25 = (col_25 + (unity_LightColor1 * diff_26.y)); + col_25 = (col_25 + (unity_LightColor2 * diff_26.z)); + col_25 = (col_25 + (unity_LightColor3 * diff_26.w)); + gl_Position = pos_19; + vec4 tmpvar_33; + tmpvar_33.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_33.x = pos_19.z; + xlv_FOG = tmpvar_33; + vec4 tmpvar_34; + tmpvar_34.zw = vec2(0.0, 0.0); + tmpvar_34.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_34; + gl_FrontColor = outColor_8; + vec4 tmpvar_35; + tmpvar_35.w = 0.0; + tmpvar_35.xyz = worldN_2; + gl_TexCoord[1] = tmpvar_35; + vec4 tmpvar_36; + tmpvar_36.w = 0.0; + tmpvar_36.xyz = (((x1_24 + x2_22) + (unity_SHC.xyz * + ((worldN_2.x * worldN_2.x) - (worldN_2.y * worldN_2.y)) + )) + col_25); + gl_TexCoord[2] = tmpvar_36; } -// inputs: 5, stats: 94 alu 0 tex 1 flow +// stats: 94 alu 0 tex 1 flow +// inputs: 5 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Color (high float) 4x1 [-1] loc 3 +// #2: gl_Normal (high float) 3x1 [-1] loc 2 +// #3: gl_Vertex (high float) 4x1 [-1] loc 0 +// #4: TANGENT (high float) 4x1 [-1] +// uniforms: 24 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _CameraPosition (high float) 4x1 [-1] +// #2: _CameraRight (high float) 3x1 [-1] +// #3: _CameraUp (high float) 3x1 [-1] +// #4: _MainTex_ST (high float) 4x1 [-1] +// #5: _Object2World (high float) 4x4 [-1] +// #6: _WaveAndDistance (high float) 4x1 [-1] +// #7: _WavingTint (high float) 4x1 [-1] +// #8: unity_4LightAtten0 (high float) 4x1 [-1] +// #9: unity_4LightPosX0 (high float) 4x1 [-1] +// #10: unity_4LightPosY0 (high float) 4x1 [-1] +// #11: unity_4LightPosZ0 (high float) 4x1 [-1] +// #12: unity_LightColor0 (high float) 3x1 [-1] +// #13: unity_LightColor1 (high float) 3x1 [-1] +// #14: unity_LightColor2 (high float) 3x1 [-1] +// #15: unity_LightColor3 (high float) 3x1 [-1] +// #16: unity_SHAb (high float) 4x1 [-1] +// #17: unity_SHAg (high float) 4x1 [-1] +// #18: unity_SHAr (high float) 4x1 [-1] +// #19: unity_SHBb (high float) 4x1 [-1] +// #20: unity_SHBg (high float) 4x1 [-1] +// #21: unity_SHBr (high float) 4x1 [-1] +// #22: unity_SHC (high float) 4x1 [-1] +// #23: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-ir.txt deleted file mode 100644 index bd6fa8388..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-ir.txt +++ /dev/null @@ -1,381 +0,0 @@ -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 lop_color; - vec3 normal; - vec3 lightDir; - vec3 _LightCoord; -}; -uniform vec4 _CameraPosition; -uniform vec3 _CameraRight; -uniform vec3 _CameraUp; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _WaveAndDistance; -uniform vec4 _WavingTint; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -void FastSinCos ( - in vec4 val_9, - out vec4 s_10, - out vec4 c_11 -) -{ - vec4 cos8_12; - vec4 sin7_13; - vec4 r3_14; - vec4 r2_15; - vec4 r1_16; - vec4 r8_17; - vec4 r7_18; - vec4 r6_19; - vec4 r5_20; - vec4 tmpvar_21; - tmpvar_21 = vec4(1.0, -0.161616, 0.0083333, -0.00019841); - sin7_13 = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22 = vec4(-0.5, 0.0416667, -0.00138889, 2.48016e-05); - cos8_12 = tmpvar_22; - vec4 tmpvar_23; - tmpvar_23 = ((val_9 * 6.40885) - 3.14159); - val_9 = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = (val_9 * val_9); - r5_20 = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25 = (r5_20 * r5_20); - r6_19 = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = (r6_19 * r5_20); - r7_18 = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = (r6_19 * r5_20); - r8_17 = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = (r5_20 * val_9); - r1_16 = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = (r1_16 * r5_20); - r2_15 = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = (r2_15 * r5_20); - r3_14 = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = (((val_9 + - (r1_16 * sin7_13.y) - ) + (r2_15 * sin7_13.z)) + (r3_14 * sin7_13.w)); - s_10 = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = ((( - (1.0 + (r5_20 * cos8_12.x)) - + - (r6_19 * cos8_12.y) - ) + (r7_18 * cos8_12.z)) + (r8_17 * cos8_12.w)); - c_11 = tmpvar_32; -} - -void TerrainWaveGrass ( - inout vec4 vertex_33, - in float waveAmount_34, - in vec3 color_35, - out vec4 outColor_36 -) -{ - vec3 waveColor_37; - vec3 waveMove_38; - float lighting_39; - vec4 c_40; - vec4 s_41; - vec4 waves_42; - vec4 _waveZmove_43; - vec4 _waveXmove_44; - vec4 waveSpeed_45; - vec4 _waveZSize_46; - vec4 _waveXSize_47; - vec4 tmpvar_48; - tmpvar_48 = vec4(1.2, 2.0, 1.6, 4.8); - waveSpeed_45 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = vec4(0.024, 0.04, -0.12, 0.096); - _waveXmove_44 = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50 = vec4(0.006, 0.02, -0.02, 0.1); - _waveZmove_43 = tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = vec3(0.0, 0.0, 0.0); - waveMove_38 = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y); - _waveXSize_47 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y); - _waveZSize_46 = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54 = (vertex_33.x * _waveXSize_47); - waves_42 = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = (waves_42 + (vertex_33.z * _waveZSize_46)); - waves_42 = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = (waves_42 + (_WaveAndDistance.x * waveSpeed_45)); - waves_42 = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = fract (waves_42); - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - waves_42 = tmpvar_58; - FastSinCos (waves_42, s_41, c_40); - vec4 tmpvar_59; - tmpvar_59 = (s_41 * s_41); - s_41 = tmpvar_59; - vec4 tmpvar_60; - tmpvar_60 = (s_41 * s_41); - s_41 = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61 = normalize (vec4(1.0, 1.0, 0.4, 0.2)); - float tmpvar_62; - tmpvar_62 = dot (s_41, tmpvar_61); - float tmpvar_63; - tmpvar_63 = (tmpvar_62 * 0.7); - lighting_39 = tmpvar_63; - vec4 tmpvar_64; - tmpvar_64 = (s_41 * waveAmount_34); - s_41 = tmpvar_64; - float tmpvar_65; - tmpvar_65 = dot (s_41, _waveXmove_44); - float tmpvar_66; - tmpvar_66 = tmpvar_65; - waveMove_38.x = tmpvar_66; - float tmpvar_67; - tmpvar_67 = dot (s_41, _waveZmove_43); - float tmpvar_68; - tmpvar_68 = tmpvar_67; - waveMove_38.z = vec3(tmpvar_68).z; - vec2 tmpvar_69; - tmpvar_69 = (vertex_33.xz - (waveMove_38.xz * _WaveAndDistance.z)); - vertex_33.xz = tmpvar_69.xxy.xz; - vec3 tmpvar_70; - tmpvar_70 = vec3(lighting_39); - vec3 tmpvar_71; - tmpvar_71 = mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, tmpvar_70); - vec3 tmpvar_72; - tmpvar_72 = tmpvar_71; - waveColor_37 = tmpvar_72; - vec3 tmpvar_73; - tmpvar_73 = ((color_35 * waveColor_37) * 2.0); - outColor_36.xyz = tmpvar_73.xyz.xyz; - float tmpvar_74; - tmpvar_74 = 1.0; - outColor_36.w = vec4(tmpvar_74).w; -} - -void TerrainBillboardGrass ( - inout vec4 pos_75, - in vec2 offset_76 -) -{ - vec3 grasspos_77; - vec3 tmpvar_78; - tmpvar_78 = (pos_75.xyz - _CameraPosition.xyz); - grasspos_77 = tmpvar_78; - float tmpvar_79; - tmpvar_79 = dot (grasspos_77, grasspos_77); - if ((tmpvar_79 > _WaveAndDistance.w)) { - vec2 tmpvar_80; - tmpvar_80 = vec2(0.0, 0.0); - offset_76 = tmpvar_80; - }; - vec3 tmpvar_81; - tmpvar_81 = (pos_75.xyz + (offset_76.x * _CameraRight.xyz)); - pos_75.xyz = tmpvar_81.xyz.xyz; - vec3 tmpvar_82; - tmpvar_82 = (pos_75.xyz + (offset_76.y * _CameraUp.xyz)); - pos_75.xyz = tmpvar_82.xyz.xyz; -} - -void vert ( - inout appdata_full v_83 -) -{ - vec4 color_84; - float waveAmount_85; - TerrainBillboardGrass (v_83.vertex, v_83.tangent.xy); - float tmpvar_86; - tmpvar_86 = v_83.tangent.y; - waveAmount_85 = tmpvar_86; - TerrainWaveGrass (v_83.vertex, waveAmount_85, v_83.color.xyz, color_84); - vec4 tmpvar_87; - tmpvar_87 = color_84; - v_83.color = tmpvar_87; -} - -vec3 WorldSpaceLightDir ( - in vec4 v_88 -) -{ - vec3 worldPos_89; - vec3 tmpvar_90; - tmpvar_90 = (_Object2World * v_88).xyz; - worldPos_89 = tmpvar_90; - return (_WorldSpaceLightPos0.xyz - worldPos_89); -} - -void PositionFog ( - in vec4 v_91, - out vec4 pos_92, - out float fog_93 -) -{ - vec4 tmpvar_94; - tmpvar_94 = (gl_ModelViewProjectionMatrix * v_91); - pos_92 = tmpvar_94; - float tmpvar_95; - tmpvar_95 = pos_92.z; - fog_93 = tmpvar_95; -} - -v2f_surf vert_surf ( - in appdata_full v_96 -) -{ - v2f_surf o_97; - vert (v_96); - PositionFog (v_96.vertex, o_97.pos, o_97.fog); - vec2 tmpvar_98; - tmpvar_98 = ((v_96.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_97.hip_pack0 = tmpvar_98.xy.xy; - vec4 tmpvar_99; - tmpvar_99 = v_96.color; - o_97.lop_color = tmpvar_99; - mat3 tmpvar_100; - tmpvar_100 = xll_constructMat3 (_Object2World); - vec3 tmpvar_101; - tmpvar_101 = (tmpvar_100 * (v_96.normal * unity_Scale.w)); - o_97.normal = tmpvar_101; - vec3 tmpvar_102; - tmpvar_102 = WorldSpaceLightDir (v_96.vertex); - vec3 tmpvar_103; - tmpvar_103 = tmpvar_102; - o_97.lightDir = tmpvar_103; - vec3 tmpvar_104; - tmpvar_104 = (_LightMatrix0 * (_Object2World * v_96.vertex)).xyz; - o_97._LightCoord = tmpvar_104; - return o_97; -} - -void main () -{ - appdata_full xlt_v_105; - v2f_surf xl_retval_106; - vec4 tmpvar_107; - tmpvar_107 = gl_Vertex.xyzw; - vec4 tmpvar_108; - tmpvar_108 = tmpvar_107; - xlt_v_105.vertex = tmpvar_108; - vec4 tmpvar_109; - tmpvar_109 = TANGENT.xyzw; - vec4 tmpvar_110; - tmpvar_110 = tmpvar_109; - xlt_v_105.tangent = tmpvar_110; - vec3 tmpvar_111; - tmpvar_111 = gl_Normal.xyz; - vec3 tmpvar_112; - tmpvar_112 = tmpvar_111; - xlt_v_105.normal = tmpvar_112; - vec4 tmpvar_113; - tmpvar_113 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_114; - tmpvar_114 = tmpvar_113; - xlt_v_105.texcoord = tmpvar_114; - vec4 tmpvar_115; - tmpvar_115 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_116; - tmpvar_116 = tmpvar_115; - xlt_v_105.texcoord1 = tmpvar_116; - vec4 tmpvar_117; - tmpvar_117 = gl_Color.xyzw; - vec4 tmpvar_118; - tmpvar_118 = tmpvar_117; - xlt_v_105.color = tmpvar_118; - v2f_surf tmpvar_119; - tmpvar_119 = vert_surf (xlt_v_105); - v2f_surf tmpvar_120; - tmpvar_120 = tmpvar_119; - xl_retval_106 = tmpvar_120; - vec4 tmpvar_121; - tmpvar_121 = xl_retval_106.pos.xyzw; - vec4 tmpvar_122; - tmpvar_122 = tmpvar_121; - gl_Position = tmpvar_122; - vec4 tmpvar_123; - tmpvar_123.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_123.x = xl_retval_106.fog; - vec4 tmpvar_124; - tmpvar_124 = tmpvar_123; - xlv_FOG = tmpvar_124; - vec4 tmpvar_125; - tmpvar_125.zw = vec2(0.0, 0.0); - tmpvar_125.xy = xl_retval_106.hip_pack0.xy; - vec4 tmpvar_126; - tmpvar_126 = tmpvar_125; - gl_TexCoord[0] = tmpvar_126; - vec4 tmpvar_127; - tmpvar_127 = xl_retval_106.lop_color.xyzw; - vec4 tmpvar_128; - tmpvar_128 = tmpvar_127; - gl_FrontColor = tmpvar_128; - vec4 tmpvar_129; - tmpvar_129.w = 0.0; - tmpvar_129.xyz = xl_retval_106.normal.xyz; - vec4 tmpvar_130; - tmpvar_130 = tmpvar_129; - gl_TexCoord[1] = tmpvar_130; - vec4 tmpvar_131; - tmpvar_131.w = 0.0; - tmpvar_131.xyz = xl_retval_106.lightDir.xyz; - vec4 tmpvar_132; - tmpvar_132 = tmpvar_131; - gl_TexCoord[2] = tmpvar_132; - vec4 tmpvar_133; - tmpvar_133.w = 0.0; - tmpvar_133.xyz = xl_retval_106._LightCoord.xyz; - vec4 tmpvar_134; - tmpvar_134 = tmpvar_133; - gl_TexCoord[3] = tmpvar_134; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt index e661e09fa..0da783fb5 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt @@ -16,10 +16,10 @@ void main () pos_1 = gl_Vertex; vec2 offset_2; offset_2 = TANGENT.xy; - vec3 tmpvar_3; - tmpvar_3 = (gl_Vertex.xyz - _CameraPosition.xyz); + vec3 grasspos_3; + grasspos_3 = (gl_Vertex.xyz - _CameraPosition.xyz); float tmpvar_4; - tmpvar_4 = dot (tmpvar_3, tmpvar_3); + tmpvar_4 = dot (grasspos_3, grasspos_3); if ((tmpvar_4 > _WaveAndDistance.w)) { offset_2 = vec2(0.0, 0.0); }; @@ -29,63 +29,84 @@ void main () vertex_5.yw = pos_1.yw; vec4 outColor_6; vec3 waveMove_7; + float lighting_8; + vec4 s_9; + vec4 waves_10; waveMove_7.y = 0.0; - vec4 tmpvar_8; - tmpvar_8 = ((fract( - (((pos_1.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y)) + (pos_1.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y))) + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8))) - ) * 6.40885) - 3.14159); - vec4 tmpvar_9; - tmpvar_9 = (tmpvar_8 * tmpvar_8); - vec4 tmpvar_10; - tmpvar_10 = (tmpvar_9 * tmpvar_8); + waves_10 = (pos_1.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y)); + waves_10 = (waves_10 + (pos_1.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y))); + waves_10 = (waves_10 + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8))); vec4 tmpvar_11; - tmpvar_11 = (tmpvar_10 * tmpvar_9); - vec4 tmpvar_12; - tmpvar_12 = (((tmpvar_8 + - (tmpvar_10 * -0.161616) - ) + (tmpvar_11 * 0.0083333)) + ((tmpvar_11 * tmpvar_9) * -0.00019841)); - vec4 tmpvar_13; - tmpvar_13 = (tmpvar_12 * tmpvar_12); - vec4 tmpvar_14; - tmpvar_14 = (tmpvar_13 * tmpvar_13); - vec4 tmpvar_15; - tmpvar_15 = (tmpvar_14 * TANGENT.y); - waveMove_7.x = dot (tmpvar_15, vec4(0.024, 0.04, -0.12, 0.096)); - waveMove_7.z = dot (tmpvar_15, vec4(0.006, 0.02, -0.02, 0.1)); + tmpvar_11 = fract(waves_10); + waves_10 = tmpvar_11; + vec4 val_12; + vec4 s_13; + vec4 r2_14; + vec4 r1_15; + vec4 r5_16; + val_12 = ((tmpvar_11 * 6.40885) - 3.14159); + r5_16 = (val_12 * val_12); + r1_15 = (r5_16 * val_12); + r2_14 = (r1_15 * r5_16); + s_13 = (((val_12 + + (r1_15 * -0.161616) + ) + (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); + 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)); vertex_5.xz = (pos_1.xz - (waveMove_7.xz * _WaveAndDistance.z)); - outColor_6.xyz = ((gl_Color.xyz * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3( - (dot (tmpvar_14, vec4(0.6742, 0.6742, 0.26968, 0.13484)) * 0.7) - ))) * 2.0); + outColor_6.xyz = ((gl_Color.xyz * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3(lighting_8))) * 2.0); outColor_6.w = 1.0; - vec4 tmpvar_16; - tmpvar_16 = (gl_ModelViewProjectionMatrix * vertex_5); - mat3 tmpvar_17; - tmpvar_17[0] = _Object2World[0].xyz; - tmpvar_17[1] = _Object2World[1].xyz; - tmpvar_17[2] = _Object2World[2].xyz; - gl_Position = tmpvar_16; - vec4 tmpvar_18; - tmpvar_18.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_18.x = tmpvar_16.z; - xlv_FOG = tmpvar_18; + vec4 pos_17; + pos_17 = (gl_ModelViewProjectionMatrix * vertex_5); + mat3 tmpvar_18; + tmpvar_18[0] = _Object2World[0].xyz; + tmpvar_18[1] = _Object2World[1].xyz; + tmpvar_18[2] = _Object2World[2].xyz; + gl_Position = pos_17; vec4 tmpvar_19; - tmpvar_19.zw = vec2(0.0, 0.0); - tmpvar_19.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_19; - gl_FrontColor = outColor_6; + tmpvar_19.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_19.x = pos_17.z; + xlv_FOG = tmpvar_19; vec4 tmpvar_20; - tmpvar_20.w = 0.0; - tmpvar_20.xyz = (tmpvar_17 * (gl_Normal * unity_Scale.w)); - gl_TexCoord[1] = tmpvar_20; + tmpvar_20.zw = vec2(0.0, 0.0); + tmpvar_20.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_20; + gl_FrontColor = outColor_6; vec4 tmpvar_21; tmpvar_21.w = 0.0; - tmpvar_21.xyz = (_WorldSpaceLightPos0.xyz - (_Object2World * vertex_5).xyz); - gl_TexCoord[2] = tmpvar_21; + tmpvar_21.xyz = (tmpvar_18 * (gl_Normal * unity_Scale.w)); + gl_TexCoord[1] = tmpvar_21; vec4 tmpvar_22; tmpvar_22.w = 0.0; - tmpvar_22.xyz = (_LightMatrix0 * (_Object2World * vertex_5)).xyz; - gl_TexCoord[3] = tmpvar_22; + tmpvar_22.xyz = (_WorldSpaceLightPos0.xyz - (_Object2World * vertex_5).xyz); + gl_TexCoord[2] = tmpvar_22; + vec4 tmpvar_23; + tmpvar_23.w = 0.0; + tmpvar_23.xyz = (_LightMatrix0 * (_Object2World * vertex_5)).xyz; + gl_TexCoord[3] = tmpvar_23; } -// inputs: 5, stats: 56 alu 0 tex 1 flow +// stats: 56 alu 0 tex 1 flow +// inputs: 5 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Color (high float) 4x1 [-1] loc 3 +// #2: gl_Normal (high float) 3x1 [-1] loc 2 +// #3: gl_Vertex (high float) 4x1 [-1] loc 0 +// #4: TANGENT (high float) 4x1 [-1] +// uniforms: 11 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _CameraPosition (high float) 4x1 [-1] +// #2: _CameraRight (high float) 3x1 [-1] +// #3: _CameraUp (high float) 3x1 [-1] +// #4: _LightMatrix0 (high float) 4x4 [-1] +// #5: _MainTex_ST (high float) 4x1 [-1] +// #6: _Object2World (high float) 4x4 [-1] +// #7: _WaveAndDistance (high float) 4x1 [-1] +// #8: _WavingTint (high float) 4x1 [-1] +// #9: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #10: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-ir.txt deleted file mode 100644 index fb22450e7..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-ir.txt +++ /dev/null @@ -1,298 +0,0 @@ -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - vec2 hip_pack0; - vec4 lop_color; -}; -uniform vec4 _CameraPosition; -uniform vec3 _CameraRight; -uniform vec3 _CameraUp; -uniform vec4 _MainTex_ST; -uniform vec4 _WaveAndDistance; -uniform vec4 _WavingTint; -uniform vec4 unity_LightShadowBias; -attribute vec4 TANGENT; -void FastSinCos ( - in vec4 val_1, - out vec4 s_2, - out vec4 c_3 -) -{ - vec4 cos8_4; - vec4 sin7_5; - vec4 r3_6; - vec4 r2_7; - vec4 r1_8; - vec4 r8_9; - vec4 r7_10; - vec4 r6_11; - vec4 r5_12; - vec4 tmpvar_13; - tmpvar_13 = vec4(1.0, -0.161616, 0.0083333, -0.00019841); - sin7_5 = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14 = vec4(-0.5, 0.0416667, -0.00138889, 2.48016e-05); - cos8_4 = tmpvar_14; - vec4 tmpvar_15; - tmpvar_15 = ((val_1 * 6.40885) - 3.14159); - val_1 = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = (val_1 * val_1); - r5_12 = tmpvar_16; - vec4 tmpvar_17; - tmpvar_17 = (r5_12 * r5_12); - r6_11 = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = (r6_11 * r5_12); - r7_10 = tmpvar_18; - vec4 tmpvar_19; - tmpvar_19 = (r6_11 * r5_12); - r8_9 = tmpvar_19; - vec4 tmpvar_20; - tmpvar_20 = (r5_12 * val_1); - r1_8 = tmpvar_20; - vec4 tmpvar_21; - tmpvar_21 = (r1_8 * r5_12); - r2_7 = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22 = (r2_7 * r5_12); - r3_6 = tmpvar_22; - vec4 tmpvar_23; - tmpvar_23 = (((val_1 + - (r1_8 * sin7_5.y) - ) + (r2_7 * sin7_5.z)) + (r3_6 * sin7_5.w)); - s_2 = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = ((( - (1.0 + (r5_12 * cos8_4.x)) - + - (r6_11 * cos8_4.y) - ) + (r7_10 * cos8_4.z)) + (r8_9 * cos8_4.w)); - c_3 = tmpvar_24; -} - -void TerrainWaveGrass ( - inout vec4 vertex_25, - in float waveAmount_26, - in vec3 color_27, - out vec4 outColor_28 -) -{ - vec3 waveColor_29; - vec3 waveMove_30; - float lighting_31; - vec4 c_32; - vec4 s_33; - vec4 waves_34; - vec4 _waveZmove_35; - vec4 _waveXmove_36; - vec4 waveSpeed_37; - vec4 _waveZSize_38; - vec4 _waveXSize_39; - vec4 tmpvar_40; - tmpvar_40 = vec4(1.2, 2.0, 1.6, 4.8); - waveSpeed_37 = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = vec4(0.024, 0.04, -0.12, 0.096); - _waveXmove_36 = tmpvar_41; - vec4 tmpvar_42; - tmpvar_42 = vec4(0.006, 0.02, -0.02, 0.1); - _waveZmove_35 = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = vec3(0.0, 0.0, 0.0); - waveMove_30 = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44 = (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y); - _waveXSize_39 = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y); - _waveZSize_38 = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46 = (vertex_25.x * _waveXSize_39); - waves_34 = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = (waves_34 + (vertex_25.z * _waveZSize_38)); - waves_34 = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48 = (waves_34 + (_WaveAndDistance.x * waveSpeed_37)); - waves_34 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = fract (waves_34); - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - waves_34 = tmpvar_50; - FastSinCos (waves_34, s_33, c_32); - vec4 tmpvar_51; - tmpvar_51 = (s_33 * s_33); - s_33 = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = (s_33 * s_33); - s_33 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = normalize (vec4(1.0, 1.0, 0.4, 0.2)); - float tmpvar_54; - tmpvar_54 = dot (s_33, tmpvar_53); - float tmpvar_55; - tmpvar_55 = (tmpvar_54 * 0.7); - lighting_31 = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = (s_33 * waveAmount_26); - s_33 = tmpvar_56; - float tmpvar_57; - tmpvar_57 = dot (s_33, _waveXmove_36); - float tmpvar_58; - tmpvar_58 = tmpvar_57; - waveMove_30.x = tmpvar_58; - float tmpvar_59; - tmpvar_59 = dot (s_33, _waveZmove_35); - float tmpvar_60; - tmpvar_60 = tmpvar_59; - waveMove_30.z = vec3(tmpvar_60).z; - vec2 tmpvar_61; - tmpvar_61 = (vertex_25.xz - (waveMove_30.xz * _WaveAndDistance.z)); - vertex_25.xz = tmpvar_61.xxy.xz; - vec3 tmpvar_62; - tmpvar_62 = vec3(lighting_31); - vec3 tmpvar_63; - tmpvar_63 = mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, tmpvar_62); - vec3 tmpvar_64; - tmpvar_64 = tmpvar_63; - waveColor_29 = tmpvar_64; - vec3 tmpvar_65; - tmpvar_65 = ((color_27 * waveColor_29) * 2.0); - outColor_28.xyz = tmpvar_65.xyz.xyz; - float tmpvar_66; - tmpvar_66 = 1.0; - outColor_28.w = vec4(tmpvar_66).w; -} - -void TerrainBillboardGrass ( - inout vec4 pos_67, - in vec2 offset_68 -) -{ - vec3 grasspos_69; - vec3 tmpvar_70; - tmpvar_70 = (pos_67.xyz - _CameraPosition.xyz); - grasspos_69 = tmpvar_70; - float tmpvar_71; - tmpvar_71 = dot (grasspos_69, grasspos_69); - if ((tmpvar_71 > _WaveAndDistance.w)) { - vec2 tmpvar_72; - tmpvar_72 = vec2(0.0, 0.0); - offset_68 = tmpvar_72; - }; - vec3 tmpvar_73; - tmpvar_73 = (pos_67.xyz + (offset_68.x * _CameraRight.xyz)); - pos_67.xyz = tmpvar_73.xyz.xyz; - vec3 tmpvar_74; - tmpvar_74 = (pos_67.xyz + (offset_68.y * _CameraUp.xyz)); - pos_67.xyz = tmpvar_74.xyz.xyz; -} - -void vert ( - inout appdata_full v_75 -) -{ - vec4 color_76; - float waveAmount_77; - TerrainBillboardGrass (v_75.vertex, v_75.tangent.xy); - float tmpvar_78; - tmpvar_78 = v_75.tangent.y; - waveAmount_77 = tmpvar_78; - TerrainWaveGrass (v_75.vertex, waveAmount_77, v_75.color.xyz, color_76); - vec4 tmpvar_79; - tmpvar_79 = color_76; - v_75.color = tmpvar_79; -} - -v2f_surf vert_surf ( - in appdata_full v_80 -) -{ - v2f_surf o_81; - vert (v_80); - vec2 tmpvar_82; - tmpvar_82 = ((v_80.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_81.hip_pack0 = tmpvar_82.xy.xy; - vec4 tmpvar_83; - tmpvar_83 = v_80.color; - o_81.lop_color = tmpvar_83; - vec4 tmpvar_84; - tmpvar_84 = (gl_ModelViewProjectionMatrix * v_80.vertex); - o_81.pos = tmpvar_84; - float tmpvar_85; - tmpvar_85 = (o_81.pos.z + unity_LightShadowBias.x); - o_81.pos.z = vec3(tmpvar_85).z; - if ((o_81.pos.z < -(o_81.pos.w))) { - float tmpvar_86; - tmpvar_86 = -(o_81.pos.w); - o_81.pos.z = vec3(tmpvar_86).z; - }; - return o_81; -} - -void main () -{ - appdata_full xlt_v_87; - v2f_surf xl_retval_88; - vec4 tmpvar_89; - tmpvar_89 = gl_Vertex.xyzw; - vec4 tmpvar_90; - tmpvar_90 = tmpvar_89; - xlt_v_87.vertex = tmpvar_90; - vec4 tmpvar_91; - tmpvar_91 = TANGENT.xyzw; - vec4 tmpvar_92; - tmpvar_92 = tmpvar_91; - xlt_v_87.tangent = tmpvar_92; - vec3 tmpvar_93; - tmpvar_93 = gl_Normal.xyz; - vec3 tmpvar_94; - tmpvar_94 = tmpvar_93; - xlt_v_87.normal = tmpvar_94; - vec4 tmpvar_95; - tmpvar_95 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_96; - tmpvar_96 = tmpvar_95; - xlt_v_87.texcoord = tmpvar_96; - vec4 tmpvar_97; - tmpvar_97 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_98; - tmpvar_98 = tmpvar_97; - xlt_v_87.texcoord1 = tmpvar_98; - vec4 tmpvar_99; - tmpvar_99 = gl_Color.xyzw; - vec4 tmpvar_100; - tmpvar_100 = tmpvar_99; - xlt_v_87.color = tmpvar_100; - v2f_surf tmpvar_101; - tmpvar_101 = vert_surf (xlt_v_87); - v2f_surf tmpvar_102; - tmpvar_102 = tmpvar_101; - xl_retval_88 = tmpvar_102; - vec4 tmpvar_103; - tmpvar_103 = xl_retval_88.pos.xyzw; - vec4 tmpvar_104; - tmpvar_104 = tmpvar_103; - gl_Position = tmpvar_104; - vec4 tmpvar_105; - tmpvar_105.zw = vec2(0.0, 0.0); - tmpvar_105.xy = xl_retval_88.hip_pack0.xy; - vec4 tmpvar_106; - tmpvar_106 = tmpvar_105; - gl_TexCoord[1] = tmpvar_106; - vec4 tmpvar_107; - tmpvar_107 = xl_retval_88.lop_color.xyzw; - vec4 tmpvar_108; - tmpvar_108 = tmpvar_107; - gl_FrontColor = tmpvar_108; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt index a8a6f8832..8c36a5e2f 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt @@ -14,10 +14,10 @@ void main () pos_3 = gl_Vertex; vec2 offset_4; offset_4 = TANGENT.xy; - vec3 tmpvar_5; - tmpvar_5 = (gl_Vertex.xyz - _CameraPosition.xyz); + vec3 grasspos_5; + grasspos_5 = (gl_Vertex.xyz - _CameraPosition.xyz); float tmpvar_6; - tmpvar_6 = dot (tmpvar_5, tmpvar_5); + tmpvar_6 = dot (grasspos_5, grasspos_5); if ((tmpvar_6 > _WaveAndDistance.w)) { offset_4 = vec2(0.0, 0.0); }; @@ -27,41 +27,42 @@ void main () vertex_7.yw = pos_3.yw; vec4 outColor_8; vec3 waveMove_9; + float lighting_10; + vec4 s_11; + vec4 waves_12; waveMove_9.y = 0.0; - vec4 tmpvar_10; - tmpvar_10 = ((fract( - (((pos_3.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y)) + (pos_3.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y))) + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8))) - ) * 6.40885) - 3.14159); - vec4 tmpvar_11; - tmpvar_11 = (tmpvar_10 * tmpvar_10); - vec4 tmpvar_12; - tmpvar_12 = (tmpvar_11 * tmpvar_10); + waves_12 = (pos_3.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y)); + waves_12 = (waves_12 + (pos_3.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y))); + waves_12 = (waves_12 + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8))); vec4 tmpvar_13; - tmpvar_13 = (tmpvar_12 * tmpvar_11); - vec4 tmpvar_14; - tmpvar_14 = (((tmpvar_10 + - (tmpvar_12 * -0.161616) - ) + (tmpvar_13 * 0.0083333)) + ((tmpvar_13 * tmpvar_11) * -0.00019841)); - vec4 tmpvar_15; - tmpvar_15 = (tmpvar_14 * tmpvar_14); - vec4 tmpvar_16; - tmpvar_16 = (tmpvar_15 * tmpvar_15); - vec4 tmpvar_17; - tmpvar_17 = (tmpvar_16 * TANGENT.y); - waveMove_9.x = dot (tmpvar_17, vec4(0.024, 0.04, -0.12, 0.096)); - waveMove_9.z = dot (tmpvar_17, vec4(0.006, 0.02, -0.02, 0.1)); + tmpvar_13 = fract(waves_12); + waves_12 = tmpvar_13; + vec4 val_14; + vec4 s_15; + vec4 r2_16; + vec4 r1_17; + vec4 r5_18; + val_14 = ((tmpvar_13 * 6.40885) - 3.14159); + r5_18 = (val_14 * val_14); + r1_17 = (r5_18 * val_14); + r2_16 = (r1_17 * r5_18); + s_15 = (((val_14 + + (r1_17 * -0.161616) + ) + (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); + 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)); vertex_7.xz = (pos_3.xz - (waveMove_9.xz * _WaveAndDistance.z)); - outColor_8.xyz = ((gl_Color.xyz * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3( - (dot (tmpvar_16, vec4(0.6742, 0.6742, 0.26968, 0.13484)) * 0.7) - ))) * 2.0); + outColor_8.xyz = ((gl_Color.xyz * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3(lighting_10))) * 2.0); outColor_8.w = 1.0; tmpvar_2 = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - vec4 tmpvar_18; - tmpvar_18 = (gl_ModelViewProjectionMatrix * vertex_7); - tmpvar_1.xyw = tmpvar_18.xyw; - tmpvar_1.z = (tmpvar_18.z + unity_LightShadowBias.x); - if ((tmpvar_1.z < -(tmpvar_18.w))) { - tmpvar_1.z = -(tmpvar_18.w); + tmpvar_1 = (gl_ModelViewProjectionMatrix * vertex_7); + tmpvar_1.z = (tmpvar_1.z + unity_LightShadowBias.x); + if ((tmpvar_1.z < -(tmpvar_1.w))) { + tmpvar_1.z = -(tmpvar_1.w); }; gl_Position = tmpvar_1; vec4 tmpvar_19; @@ -72,4 +73,18 @@ void main () } -// inputs: 4, stats: 50 alu 0 tex 2 flow +// stats: 50 alu 0 tex 2 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Color (high float) 4x1 [-1] loc 3 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 8 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _CameraPosition (high float) 4x1 [-1] +// #2: _CameraRight (high float) 3x1 [-1] +// #3: _CameraUp (high float) 3x1 [-1] +// #4: _MainTex_ST (high float) 4x1 [-1] +// #5: _WaveAndDistance (high float) 4x1 [-1] +// #6: _WavingTint (high float) 4x1 [-1] +// #7: unity_LightShadowBias (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-ir.txt deleted file mode 100644 index 5faab96d0..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-ir.txt +++ /dev/null @@ -1,352 +0,0 @@ -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 lop_color; - vec3 normal; - vec3 lightDir; - vec4 _LightCoord; -}; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _WaveAndDistance; -uniform vec4 _WavingTint; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -void FastSinCos ( - in vec4 val_9, - out vec4 s_10, - out vec4 c_11 -) -{ - vec4 cos8_12; - vec4 sin7_13; - vec4 r3_14; - vec4 r2_15; - vec4 r1_16; - vec4 r8_17; - vec4 r7_18; - vec4 r6_19; - vec4 r5_20; - vec4 tmpvar_21; - tmpvar_21 = vec4(1.0, -0.161616, 0.0083333, -0.00019841); - sin7_13 = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22 = vec4(-0.5, 0.0416667, -0.00138889, 2.48016e-05); - cos8_12 = tmpvar_22; - vec4 tmpvar_23; - tmpvar_23 = ((val_9 * 6.40885) - 3.14159); - val_9 = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = (val_9 * val_9); - r5_20 = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25 = (r5_20 * r5_20); - r6_19 = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = (r6_19 * r5_20); - r7_18 = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = (r6_19 * r5_20); - r8_17 = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = (r5_20 * val_9); - r1_16 = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = (r1_16 * r5_20); - r2_15 = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = (r2_15 * r5_20); - r3_14 = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = (((val_9 + - (r1_16 * sin7_13.y) - ) + (r2_15 * sin7_13.z)) + (r3_14 * sin7_13.w)); - s_10 = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = ((( - (1.0 + (r5_20 * cos8_12.x)) - + - (r6_19 * cos8_12.y) - ) + (r7_18 * cos8_12.z)) + (r8_17 * cos8_12.w)); - c_11 = tmpvar_32; -} - -void TerrainWaveGrass ( - inout vec4 vertex_33, - in float waveAmount_34, - in vec3 color_35, - out vec4 outColor_36 -) -{ - vec3 waveColor_37; - vec3 waveMove_38; - float lighting_39; - vec4 c_40; - vec4 s_41; - vec4 waves_42; - vec4 _waveZmove_43; - vec4 _waveXmove_44; - vec4 waveSpeed_45; - vec4 _waveZSize_46; - vec4 _waveXSize_47; - vec4 tmpvar_48; - tmpvar_48 = vec4(1.2, 2.0, 1.6, 4.8); - waveSpeed_45 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = vec4(0.024, 0.04, -0.12, 0.096); - _waveXmove_44 = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50 = vec4(0.006, 0.02, -0.02, 0.1); - _waveZmove_43 = tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = vec3(0.0, 0.0, 0.0); - waveMove_38 = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y); - _waveXSize_47 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y); - _waveZSize_46 = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54 = (vertex_33.x * _waveXSize_47); - waves_42 = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = (waves_42 + (vertex_33.z * _waveZSize_46)); - waves_42 = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = (waves_42 + (_WaveAndDistance.x * waveSpeed_45)); - waves_42 = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = fract (waves_42); - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - waves_42 = tmpvar_58; - FastSinCos (waves_42, s_41, c_40); - vec4 tmpvar_59; - tmpvar_59 = (s_41 * s_41); - s_41 = tmpvar_59; - vec4 tmpvar_60; - tmpvar_60 = (s_41 * s_41); - s_41 = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61 = normalize (vec4(1.0, 1.0, 0.4, 0.2)); - float tmpvar_62; - tmpvar_62 = dot (s_41, tmpvar_61); - float tmpvar_63; - tmpvar_63 = (tmpvar_62 * 0.7); - lighting_39 = tmpvar_63; - vec4 tmpvar_64; - tmpvar_64 = (s_41 * waveAmount_34); - s_41 = tmpvar_64; - float tmpvar_65; - tmpvar_65 = dot (s_41, _waveXmove_44); - float tmpvar_66; - tmpvar_66 = tmpvar_65; - waveMove_38.x = tmpvar_66; - float tmpvar_67; - tmpvar_67 = dot (s_41, _waveZmove_43); - float tmpvar_68; - tmpvar_68 = tmpvar_67; - waveMove_38.z = vec3(tmpvar_68).z; - vec2 tmpvar_69; - tmpvar_69 = (vertex_33.xz - (waveMove_38.xz * _WaveAndDistance.z)); - vertex_33.xz = tmpvar_69.xxy.xz; - vec3 tmpvar_70; - tmpvar_70 = vec3(lighting_39); - vec3 tmpvar_71; - tmpvar_71 = mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, tmpvar_70); - vec3 tmpvar_72; - tmpvar_72 = tmpvar_71; - waveColor_37 = tmpvar_72; - vec3 tmpvar_73; - tmpvar_73 = ((color_35 * waveColor_37) * 2.0); - outColor_36.xyz = tmpvar_73.xyz.xyz; - float tmpvar_74; - tmpvar_74 = 1.0; - outColor_36.w = vec4(tmpvar_74).w; -} - -void vert ( - inout appdata_full v_75 -) -{ - vec4 color_76; - float waveAmount_77; - float tmpvar_78; - tmpvar_78 = (v_75.color.w * _WaveAndDistance.z); - waveAmount_77 = tmpvar_78; - TerrainWaveGrass (v_75.vertex, waveAmount_77, v_75.color.xyz, color_76); - vec4 tmpvar_79; - tmpvar_79 = color_76; - v_75.color = tmpvar_79; -} - -vec3 WorldSpaceLightDir ( - in vec4 v_80 -) -{ - vec3 worldPos_81; - vec3 tmpvar_82; - tmpvar_82 = (_Object2World * v_80).xyz; - worldPos_81 = tmpvar_82; - return (_WorldSpaceLightPos0.xyz - worldPos_81); -} - -void PositionFog ( - in vec4 v_83, - out vec4 pos_84, - out float fog_85 -) -{ - vec4 tmpvar_86; - tmpvar_86 = (gl_ModelViewProjectionMatrix * v_83); - pos_84 = tmpvar_86; - float tmpvar_87; - tmpvar_87 = pos_84.z; - fog_85 = tmpvar_87; -} - -v2f_surf vert_surf ( - in appdata_full v_88 -) -{ - v2f_surf o_89; - vert (v_88); - PositionFog (v_88.vertex, o_89.pos, o_89.fog); - vec2 tmpvar_90; - tmpvar_90 = ((v_88.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_89.hip_pack0 = tmpvar_90.xy.xy; - vec4 tmpvar_91; - tmpvar_91 = v_88.color; - o_89.lop_color = tmpvar_91; - mat3 tmpvar_92; - tmpvar_92 = xll_constructMat3 (_Object2World); - vec3 tmpvar_93; - tmpvar_93 = (tmpvar_92 * (v_88.normal * unity_Scale.w)); - o_89.normal = tmpvar_93; - vec3 tmpvar_94; - tmpvar_94 = WorldSpaceLightDir (v_88.vertex); - vec3 tmpvar_95; - tmpvar_95 = tmpvar_94; - o_89.lightDir = tmpvar_95; - vec4 tmpvar_96; - tmpvar_96 = (_LightMatrix0 * (_Object2World * v_88.vertex)); - o_89._LightCoord = tmpvar_96; - return o_89; -} - -void main () -{ - appdata_full xlt_v_97; - v2f_surf xl_retval_98; - vec4 tmpvar_99; - tmpvar_99 = gl_Vertex.xyzw; - vec4 tmpvar_100; - tmpvar_100 = tmpvar_99; - xlt_v_97.vertex = tmpvar_100; - vec4 tmpvar_101; - tmpvar_101 = TANGENT.xyzw; - vec4 tmpvar_102; - tmpvar_102 = tmpvar_101; - xlt_v_97.tangent = tmpvar_102; - vec3 tmpvar_103; - tmpvar_103 = gl_Normal.xyz; - vec3 tmpvar_104; - tmpvar_104 = tmpvar_103; - xlt_v_97.normal = tmpvar_104; - vec4 tmpvar_105; - tmpvar_105 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_106; - tmpvar_106 = tmpvar_105; - xlt_v_97.texcoord = tmpvar_106; - vec4 tmpvar_107; - tmpvar_107 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_108; - tmpvar_108 = tmpvar_107; - xlt_v_97.texcoord1 = tmpvar_108; - vec4 tmpvar_109; - tmpvar_109 = gl_Color.xyzw; - vec4 tmpvar_110; - tmpvar_110 = tmpvar_109; - xlt_v_97.color = tmpvar_110; - v2f_surf tmpvar_111; - tmpvar_111 = vert_surf (xlt_v_97); - v2f_surf tmpvar_112; - tmpvar_112 = tmpvar_111; - xl_retval_98 = tmpvar_112; - vec4 tmpvar_113; - tmpvar_113 = xl_retval_98.pos.xyzw; - vec4 tmpvar_114; - tmpvar_114 = tmpvar_113; - gl_Position = tmpvar_114; - vec4 tmpvar_115; - tmpvar_115.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_115.x = xl_retval_98.fog; - vec4 tmpvar_116; - tmpvar_116 = tmpvar_115; - xlv_FOG = tmpvar_116; - vec4 tmpvar_117; - tmpvar_117.zw = vec2(0.0, 0.0); - tmpvar_117.xy = xl_retval_98.hip_pack0.xy; - vec4 tmpvar_118; - tmpvar_118 = tmpvar_117; - gl_TexCoord[0] = tmpvar_118; - vec4 tmpvar_119; - tmpvar_119 = xl_retval_98.lop_color.xyzw; - vec4 tmpvar_120; - tmpvar_120 = tmpvar_119; - gl_FrontColor = tmpvar_120; - vec4 tmpvar_121; - tmpvar_121.w = 0.0; - tmpvar_121.xyz = xl_retval_98.normal.xyz; - vec4 tmpvar_122; - tmpvar_122 = tmpvar_121; - gl_TexCoord[1] = tmpvar_122; - vec4 tmpvar_123; - tmpvar_123.w = 0.0; - tmpvar_123.xyz = xl_retval_98.lightDir.xyz; - vec4 tmpvar_124; - tmpvar_124 = tmpvar_123; - gl_TexCoord[2] = tmpvar_124; - vec4 tmpvar_125; - tmpvar_125 = xl_retval_98._LightCoord.xyzw; - vec4 tmpvar_126; - tmpvar_126 = tmpvar_125; - gl_TexCoord[3] = tmpvar_126; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt index a56694e45..5054e1f23 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt @@ -12,60 +12,77 @@ void main () vertex_1.yw = gl_Vertex.yw; vec4 outColor_2; vec3 waveMove_3; + float lighting_4; + vec4 s_5; + vec4 waves_6; waveMove_3.y = 0.0; - vec4 tmpvar_4; - tmpvar_4 = ((fract( - (((gl_Vertex.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y)) + (gl_Vertex.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y))) + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8))) - ) * 6.40885) - 3.14159); - vec4 tmpvar_5; - tmpvar_5 = (tmpvar_4 * tmpvar_4); - vec4 tmpvar_6; - tmpvar_6 = (tmpvar_5 * tmpvar_4); + waves_6 = (gl_Vertex.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y)); + waves_6 = (waves_6 + (gl_Vertex.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y))); + waves_6 = (waves_6 + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8))); vec4 tmpvar_7; - tmpvar_7 = (tmpvar_6 * tmpvar_5); - vec4 tmpvar_8; - tmpvar_8 = (((tmpvar_4 + - (tmpvar_6 * -0.161616) - ) + (tmpvar_7 * 0.0083333)) + ((tmpvar_7 * tmpvar_5) * -0.00019841)); - vec4 tmpvar_9; - tmpvar_9 = (tmpvar_8 * tmpvar_8); - vec4 tmpvar_10; - tmpvar_10 = (tmpvar_9 * tmpvar_9); - vec4 tmpvar_11; - tmpvar_11 = (tmpvar_10 * (gl_Color.w * _WaveAndDistance.z)); - waveMove_3.x = dot (tmpvar_11, vec4(0.024, 0.04, -0.12, 0.096)); - waveMove_3.z = dot (tmpvar_11, vec4(0.006, 0.02, -0.02, 0.1)); + tmpvar_7 = fract(waves_6); + waves_6 = tmpvar_7; + vec4 val_8; + vec4 s_9; + vec4 r2_10; + vec4 r1_11; + vec4 r5_12; + val_8 = ((tmpvar_7 * 6.40885) - 3.14159); + r5_12 = (val_8 * val_8); + r1_11 = (r5_12 * val_8); + r2_10 = (r1_11 * r5_12); + s_9 = (((val_8 + + (r1_11 * -0.161616) + ) + (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); + 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)); vertex_1.xz = (gl_Vertex.xz - (waveMove_3.xz * _WaveAndDistance.z)); - outColor_2.xyz = ((gl_Color.xyz * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3( - (dot (tmpvar_10, vec4(0.6742, 0.6742, 0.26968, 0.13484)) * 0.7) - ))) * 2.0); + outColor_2.xyz = ((gl_Color.xyz * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3(lighting_4))) * 2.0); outColor_2.w = 1.0; - vec4 tmpvar_12; - tmpvar_12 = (gl_ModelViewProjectionMatrix * vertex_1); - mat3 tmpvar_13; - tmpvar_13[0] = _Object2World[0].xyz; - tmpvar_13[1] = _Object2World[1].xyz; - tmpvar_13[2] = _Object2World[2].xyz; - gl_Position = tmpvar_12; - vec4 tmpvar_14; - tmpvar_14.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_14.x = tmpvar_12.z; - xlv_FOG = tmpvar_14; + vec4 pos_13; + pos_13 = (gl_ModelViewProjectionMatrix * vertex_1); + mat3 tmpvar_14; + tmpvar_14[0] = _Object2World[0].xyz; + tmpvar_14[1] = _Object2World[1].xyz; + tmpvar_14[2] = _Object2World[2].xyz; + gl_Position = pos_13; vec4 tmpvar_15; - tmpvar_15.zw = vec2(0.0, 0.0); - tmpvar_15.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_15; - gl_FrontColor = outColor_2; + tmpvar_15.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_15.x = pos_13.z; + xlv_FOG = tmpvar_15; vec4 tmpvar_16; - tmpvar_16.w = 0.0; - tmpvar_16.xyz = (tmpvar_13 * (gl_Normal * unity_Scale.w)); - gl_TexCoord[1] = tmpvar_16; + tmpvar_16.zw = vec2(0.0, 0.0); + tmpvar_16.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_16; + gl_FrontColor = outColor_2; vec4 tmpvar_17; tmpvar_17.w = 0.0; - tmpvar_17.xyz = (_WorldSpaceLightPos0.xyz - (_Object2World * vertex_1).xyz); - gl_TexCoord[2] = tmpvar_17; + tmpvar_17.xyz = (tmpvar_14 * (gl_Normal * unity_Scale.w)); + gl_TexCoord[1] = tmpvar_17; + vec4 tmpvar_18; + tmpvar_18.w = 0.0; + tmpvar_18.xyz = (_WorldSpaceLightPos0.xyz - (_Object2World * vertex_1).xyz); + gl_TexCoord[2] = tmpvar_18; gl_TexCoord[3] = (_LightMatrix0 * (_Object2World * vertex_1)); } -// inputs: 4, stats: 48 alu 0 tex 0 flow +// stats: 48 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Color (high float) 4x1 [-1] loc 3 +// #2: gl_Normal (high float) 3x1 [-1] loc 2 +// #3: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 8 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _LightMatrix0 (high float) 4x4 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _WaveAndDistance (high float) 4x1 [-1] +// #5: _WavingTint (high float) 4x1 [-1] +// #6: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #7: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-ir.txt deleted file mode 100644 index 6eabfe2a7..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-ir.txt +++ /dev/null @@ -1,227 +0,0 @@ -struct v2f { - vec4 pos; - float fog; - vec4 uv; - vec4 color; -}; -struct appdata_tree { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 color; - vec4 texcoord; -}; -uniform float _AO; -uniform vec4 _Color; -uniform vec4 _Scale; -uniform float _SquashAmount; -uniform vec4 _SquashPlaneNormal; -uniform mat4 _TerrainEngineBendTree; -uniform vec4 _TerrainTreeLightColors[4]; -uniform vec3 _TerrainTreeLightDirections[4]; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -vec4 Squash ( - in vec4 pos_1 -) -{ - vec3 planeNormal_2; - vec3 planePoint_3; - vec3 projectedVertex_4; - vec3 tmpvar_5; - tmpvar_5 = pos_1.xyz; - projectedVertex_4 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6.xz = vec2(0.0, 0.0); - tmpvar_6.y = _SquashPlaneNormal.w; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_6; - planePoint_3 = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = _SquashPlaneNormal.xyz; - planeNormal_2 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = pos_1.xyz; - float tmpvar_10; - tmpvar_10 = dot (planeNormal_2, (planePoint_3 - tmpvar_9)); - vec3 tmpvar_11; - tmpvar_11 = (projectedVertex_4 + (tmpvar_10 * planeNormal_2)); - projectedVertex_4 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = vec3(_SquashAmount); - vec3 tmpvar_13; - tmpvar_13 = mix (projectedVertex_4, pos_1.xyz, tmpvar_12); - vec4 tmpvar_14; - tmpvar_14.w = 1.0; - tmpvar_14.xyz = tmpvar_13.xyz; - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - pos_1 = tmpvar_15; - return pos_1; -} - -void TerrainAnimateTree ( - inout vec4 pos_16, - in float alpha_17 -) -{ - vec3 bent_18; - vec3 tmpvar_19; - tmpvar_19 = (pos_16.xyz * _Scale.xyz); - pos_16.xyz = tmpvar_19.xyz.xyz; - vec4 tmpvar_20; - tmpvar_20.w = 0.0; - tmpvar_20.xyz = pos_16.xyz.xyz; - vec3 tmpvar_21; - tmpvar_21 = (_TerrainEngineBendTree * tmpvar_20).xyz; - bent_18 = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = vec3(alpha_17); - vec3 tmpvar_23; - tmpvar_23 = mix (pos_16.xyz, bent_18, tmpvar_22); - vec3 tmpvar_24; - tmpvar_24 = tmpvar_23; - pos_16.xyz = tmpvar_24.xyz.xyz; - vec4 tmpvar_25; - tmpvar_25 = Squash (pos_16); - vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; - pos_16 = tmpvar_26; -} - -v2f vert ( - in appdata_tree v_27 -) -{ - float occ_28; - float atten_29; - int i_30; - vec4 lightColor_31; - vec4 lightDir_32; - v2f o_33; - vec3 viewpos_34; - int tmpvar_35; - tmpvar_35 = 0; - i_30 = tmpvar_35; - float tmpvar_36; - tmpvar_36 = 1.0; - atten_29 = tmpvar_36; - TerrainAnimateTree (v_27.vertex, v_27.color.w); - vec3 tmpvar_37; - tmpvar_37 = (gl_ModelViewMatrix * v_27.vertex).xyz; - vec3 tmpvar_38; - tmpvar_38 = tmpvar_37; - viewpos_34 = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = (gl_ModelViewProjectionMatrix * v_27.vertex); - o_33.pos = tmpvar_39; - float tmpvar_40; - tmpvar_40 = o_33.pos.z; - o_33.fog = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = v_27.texcoord; - o_33.uv = tmpvar_41; - float tmpvar_42; - tmpvar_42 = _AO; - lightDir_32.w = vec4(tmpvar_42).w; - vec4 tmpvar_43; - tmpvar_43 = gl_LightModel.ambient; - lightColor_31 = tmpvar_43; - while (true) { - if (!((i_30 < 4))) { - break; - }; - vec3 tmpvar_44; - tmpvar_44 = _TerrainTreeLightDirections[i_30]; - lightDir_32.xyz = tmpvar_44.xyz.xyz; - float tmpvar_45; - tmpvar_45 = dot (lightDir_32.xyz, v_27.normal); - float tmpvar_46; - tmpvar_46 = tmpvar_45; - occ_28 = tmpvar_46; - float tmpvar_47; - tmpvar_47 = max (0.0, occ_28); - float tmpvar_48; - tmpvar_48 = tmpvar_47; - occ_28 = tmpvar_48; - float tmpvar_49; - tmpvar_49 = (occ_28 * atten_29); - occ_28 = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50 = (lightColor_31 + (_TerrainTreeLightColors[i_30] * occ_28)); - lightColor_31 = tmpvar_50; - int _post_incdec_tmp_51; - _post_incdec_tmp_51 = i_30; - int tmpvar_52; - tmpvar_52 = (i_30 + 1); - i_30 = tmpvar_52; - }; - float tmpvar_53; - tmpvar_53 = 1.0; - lightColor_31.w = vec4(tmpvar_53).w; - vec4 tmpvar_54; - tmpvar_54 = (lightColor_31 * _Color); - o_33.color = tmpvar_54; - float tmpvar_55; - tmpvar_55 = 1.0; - o_33.color.w = vec4(tmpvar_55).w; - return o_33; -} - -void main () -{ - appdata_tree xlt_v_56; - v2f xl_retval_57; - vec4 tmpvar_58; - tmpvar_58 = gl_Vertex.xyzw; - vec4 tmpvar_59; - tmpvar_59 = tmpvar_58; - xlt_v_56.vertex = tmpvar_59; - vec4 tmpvar_60; - tmpvar_60 = TANGENT.xyzw; - vec4 tmpvar_61; - tmpvar_61 = tmpvar_60; - xlt_v_56.tangent = tmpvar_61; - vec3 tmpvar_62; - tmpvar_62 = gl_Normal.xyz; - vec3 tmpvar_63; - tmpvar_63 = tmpvar_62; - xlt_v_56.normal = tmpvar_63; - vec4 tmpvar_64; - tmpvar_64 = gl_Color.xyzw; - vec4 tmpvar_65; - tmpvar_65 = tmpvar_64; - xlt_v_56.color = tmpvar_65; - vec4 tmpvar_66; - tmpvar_66 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_67; - tmpvar_67 = tmpvar_66; - xlt_v_56.texcoord = tmpvar_67; - v2f tmpvar_68; - tmpvar_68 = vert (xlt_v_56); - v2f tmpvar_69; - tmpvar_69 = tmpvar_68; - xl_retval_57 = tmpvar_69; - vec4 tmpvar_70; - tmpvar_70 = xl_retval_57.pos.xyzw; - vec4 tmpvar_71; - tmpvar_71 = tmpvar_70; - gl_Position = tmpvar_71; - vec4 tmpvar_72; - tmpvar_72.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_72.x = xl_retval_57.fog; - vec4 tmpvar_73; - tmpvar_73 = tmpvar_72; - xlv_FOG = tmpvar_73; - vec4 tmpvar_74; - tmpvar_74 = xl_retval_57.uv.xyzw; - vec4 tmpvar_75; - tmpvar_75 = tmpvar_74; - gl_TexCoord[0] = tmpvar_75; - vec4 tmpvar_76; - tmpvar_76 = xl_retval_57.color.xyzw; - vec4 tmpvar_77; - tmpvar_77 = tmpvar_76; - gl_FrontColor = tmpvar_77; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt index 7d53d07ab..b9f328318 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt @@ -12,24 +12,24 @@ void main () vec4 lightColor_1; vec4 lightDir_2; vec4 tmpvar_3; - vec4 pos_4; - pos_4.w = gl_Vertex.w; - pos_4.xyz = (gl_Vertex.xyz * _Scale.xyz); - vec4 tmpvar_5; - tmpvar_5.w = 0.0; - tmpvar_5.xyz = pos_4.xyz; - pos_4.xyz = mix (pos_4.xyz, (_TerrainEngineBendTree * tmpvar_5).xyz, gl_Color.www); - vec3 tmpvar_6; - tmpvar_6.xz = vec2(0.0, 0.0); - tmpvar_6.y = _SquashPlaneNormal.w; - vec4 tmpvar_7; - tmpvar_7.w = 1.0; - tmpvar_7.xyz = mix ((pos_4.xyz + ( - dot (_SquashPlaneNormal.xyz, (tmpvar_6 - pos_4.xyz)) - * _SquashPlaneNormal.xyz)), pos_4.xyz, vec3(_SquashAmount)); - pos_4 = tmpvar_7; + vec4 tmpvar_4; + vec4 pos_5; + pos_5.w = gl_Vertex.w; + pos_5.xyz = (gl_Vertex.xyz * _Scale.xyz); + vec4 tmpvar_6; + tmpvar_6.w = 0.0; + tmpvar_6.xyz = pos_5.xyz; + pos_5.xyz = mix (pos_5.xyz, (_TerrainEngineBendTree * tmpvar_6).xyz, gl_Color.www); + vec3 tmpvar_7; + tmpvar_7.xz = vec2(0.0, 0.0); + tmpvar_7.y = _SquashPlaneNormal.w; vec4 tmpvar_8; - tmpvar_8 = (gl_ModelViewProjectionMatrix * tmpvar_7); + tmpvar_8.w = 1.0; + tmpvar_8.xyz = mix ((pos_5.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_7 - pos_5.xyz)) + * _SquashPlaneNormal.xyz)), pos_5.xyz, vec3(_SquashAmount)); + pos_5 = tmpvar_8; + tmpvar_3 = (gl_ModelViewProjectionMatrix * tmpvar_8); lightDir_2.w = _AO; lightColor_1 = gl_LightModel.ambient; lightDir_2.xyz = _TerrainTreeLightDirections[0]; @@ -49,16 +49,32 @@ void main () dot (lightDir_2.xyz, gl_Normal) ))).xyz; lightColor_1.w = 1.0; - tmpvar_3.xyz = (lightColor_1 * _Color).xyz; - tmpvar_3.w = 1.0; - gl_Position = tmpvar_8; + tmpvar_4.xyz = (lightColor_1 * _Color).xyz; + tmpvar_4.w = 1.0; + gl_Position = tmpvar_3; vec4 tmpvar_9; tmpvar_9.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_9.x = tmpvar_8.z; + tmpvar_9.x = tmpvar_3.z; xlv_FOG = tmpvar_9; gl_TexCoord[0] = gl_MultiTexCoord0; - gl_FrontColor = tmpvar_3; + gl_FrontColor = tmpvar_4; } -// inputs: 4, stats: 32 alu 0 tex 0 flow +// stats: 32 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Color (high float) 4x1 [-1] loc 3 +// #2: gl_Normal (high float) 3x1 [-1] loc 2 +// #3: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 10 (total size: 0) +// #0: gl_LightModel (high other) 0x0 [-1] +// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #2: _AO (high float) 1x1 [-1] +// #3: _Color (high float) 4x1 [-1] +// #4: _Scale (high float) 4x1 [-1] +// #5: _SquashAmount (high float) 1x1 [-1] +// #6: _SquashPlaneNormal (high float) 4x1 [-1] +// #7: _TerrainEngineBendTree (high float) 4x4 [-1] +// #8: _TerrainTreeLightColors (high float) 4x1 [4] +// #9: _TerrainTreeLightDirections (high float) 3x1 [4] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-ir.txt deleted file mode 100644 index 6eabfe2a7..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-ir.txt +++ /dev/null @@ -1,227 +0,0 @@ -struct v2f { - vec4 pos; - float fog; - vec4 uv; - vec4 color; -}; -struct appdata_tree { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 color; - vec4 texcoord; -}; -uniform float _AO; -uniform vec4 _Color; -uniform vec4 _Scale; -uniform float _SquashAmount; -uniform vec4 _SquashPlaneNormal; -uniform mat4 _TerrainEngineBendTree; -uniform vec4 _TerrainTreeLightColors[4]; -uniform vec3 _TerrainTreeLightDirections[4]; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -vec4 Squash ( - in vec4 pos_1 -) -{ - vec3 planeNormal_2; - vec3 planePoint_3; - vec3 projectedVertex_4; - vec3 tmpvar_5; - tmpvar_5 = pos_1.xyz; - projectedVertex_4 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6.xz = vec2(0.0, 0.0); - tmpvar_6.y = _SquashPlaneNormal.w; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_6; - planePoint_3 = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = _SquashPlaneNormal.xyz; - planeNormal_2 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = pos_1.xyz; - float tmpvar_10; - tmpvar_10 = dot (planeNormal_2, (planePoint_3 - tmpvar_9)); - vec3 tmpvar_11; - tmpvar_11 = (projectedVertex_4 + (tmpvar_10 * planeNormal_2)); - projectedVertex_4 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = vec3(_SquashAmount); - vec3 tmpvar_13; - tmpvar_13 = mix (projectedVertex_4, pos_1.xyz, tmpvar_12); - vec4 tmpvar_14; - tmpvar_14.w = 1.0; - tmpvar_14.xyz = tmpvar_13.xyz; - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - pos_1 = tmpvar_15; - return pos_1; -} - -void TerrainAnimateTree ( - inout vec4 pos_16, - in float alpha_17 -) -{ - vec3 bent_18; - vec3 tmpvar_19; - tmpvar_19 = (pos_16.xyz * _Scale.xyz); - pos_16.xyz = tmpvar_19.xyz.xyz; - vec4 tmpvar_20; - tmpvar_20.w = 0.0; - tmpvar_20.xyz = pos_16.xyz.xyz; - vec3 tmpvar_21; - tmpvar_21 = (_TerrainEngineBendTree * tmpvar_20).xyz; - bent_18 = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = vec3(alpha_17); - vec3 tmpvar_23; - tmpvar_23 = mix (pos_16.xyz, bent_18, tmpvar_22); - vec3 tmpvar_24; - tmpvar_24 = tmpvar_23; - pos_16.xyz = tmpvar_24.xyz.xyz; - vec4 tmpvar_25; - tmpvar_25 = Squash (pos_16); - vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; - pos_16 = tmpvar_26; -} - -v2f vert ( - in appdata_tree v_27 -) -{ - float occ_28; - float atten_29; - int i_30; - vec4 lightColor_31; - vec4 lightDir_32; - v2f o_33; - vec3 viewpos_34; - int tmpvar_35; - tmpvar_35 = 0; - i_30 = tmpvar_35; - float tmpvar_36; - tmpvar_36 = 1.0; - atten_29 = tmpvar_36; - TerrainAnimateTree (v_27.vertex, v_27.color.w); - vec3 tmpvar_37; - tmpvar_37 = (gl_ModelViewMatrix * v_27.vertex).xyz; - vec3 tmpvar_38; - tmpvar_38 = tmpvar_37; - viewpos_34 = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = (gl_ModelViewProjectionMatrix * v_27.vertex); - o_33.pos = tmpvar_39; - float tmpvar_40; - tmpvar_40 = o_33.pos.z; - o_33.fog = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = v_27.texcoord; - o_33.uv = tmpvar_41; - float tmpvar_42; - tmpvar_42 = _AO; - lightDir_32.w = vec4(tmpvar_42).w; - vec4 tmpvar_43; - tmpvar_43 = gl_LightModel.ambient; - lightColor_31 = tmpvar_43; - while (true) { - if (!((i_30 < 4))) { - break; - }; - vec3 tmpvar_44; - tmpvar_44 = _TerrainTreeLightDirections[i_30]; - lightDir_32.xyz = tmpvar_44.xyz.xyz; - float tmpvar_45; - tmpvar_45 = dot (lightDir_32.xyz, v_27.normal); - float tmpvar_46; - tmpvar_46 = tmpvar_45; - occ_28 = tmpvar_46; - float tmpvar_47; - tmpvar_47 = max (0.0, occ_28); - float tmpvar_48; - tmpvar_48 = tmpvar_47; - occ_28 = tmpvar_48; - float tmpvar_49; - tmpvar_49 = (occ_28 * atten_29); - occ_28 = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50 = (lightColor_31 + (_TerrainTreeLightColors[i_30] * occ_28)); - lightColor_31 = tmpvar_50; - int _post_incdec_tmp_51; - _post_incdec_tmp_51 = i_30; - int tmpvar_52; - tmpvar_52 = (i_30 + 1); - i_30 = tmpvar_52; - }; - float tmpvar_53; - tmpvar_53 = 1.0; - lightColor_31.w = vec4(tmpvar_53).w; - vec4 tmpvar_54; - tmpvar_54 = (lightColor_31 * _Color); - o_33.color = tmpvar_54; - float tmpvar_55; - tmpvar_55 = 1.0; - o_33.color.w = vec4(tmpvar_55).w; - return o_33; -} - -void main () -{ - appdata_tree xlt_v_56; - v2f xl_retval_57; - vec4 tmpvar_58; - tmpvar_58 = gl_Vertex.xyzw; - vec4 tmpvar_59; - tmpvar_59 = tmpvar_58; - xlt_v_56.vertex = tmpvar_59; - vec4 tmpvar_60; - tmpvar_60 = TANGENT.xyzw; - vec4 tmpvar_61; - tmpvar_61 = tmpvar_60; - xlt_v_56.tangent = tmpvar_61; - vec3 tmpvar_62; - tmpvar_62 = gl_Normal.xyz; - vec3 tmpvar_63; - tmpvar_63 = tmpvar_62; - xlt_v_56.normal = tmpvar_63; - vec4 tmpvar_64; - tmpvar_64 = gl_Color.xyzw; - vec4 tmpvar_65; - tmpvar_65 = tmpvar_64; - xlt_v_56.color = tmpvar_65; - vec4 tmpvar_66; - tmpvar_66 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_67; - tmpvar_67 = tmpvar_66; - xlt_v_56.texcoord = tmpvar_67; - v2f tmpvar_68; - tmpvar_68 = vert (xlt_v_56); - v2f tmpvar_69; - tmpvar_69 = tmpvar_68; - xl_retval_57 = tmpvar_69; - vec4 tmpvar_70; - tmpvar_70 = xl_retval_57.pos.xyzw; - vec4 tmpvar_71; - tmpvar_71 = tmpvar_70; - gl_Position = tmpvar_71; - vec4 tmpvar_72; - tmpvar_72.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_72.x = xl_retval_57.fog; - vec4 tmpvar_73; - tmpvar_73 = tmpvar_72; - xlv_FOG = tmpvar_73; - vec4 tmpvar_74; - tmpvar_74 = xl_retval_57.uv.xyzw; - vec4 tmpvar_75; - tmpvar_75 = tmpvar_74; - gl_TexCoord[0] = tmpvar_75; - vec4 tmpvar_76; - tmpvar_76 = xl_retval_57.color.xyzw; - vec4 tmpvar_77; - tmpvar_77 = tmpvar_76; - gl_FrontColor = tmpvar_77; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt index 7d53d07ab..b9f328318 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt @@ -12,24 +12,24 @@ void main () vec4 lightColor_1; vec4 lightDir_2; vec4 tmpvar_3; - vec4 pos_4; - pos_4.w = gl_Vertex.w; - pos_4.xyz = (gl_Vertex.xyz * _Scale.xyz); - vec4 tmpvar_5; - tmpvar_5.w = 0.0; - tmpvar_5.xyz = pos_4.xyz; - pos_4.xyz = mix (pos_4.xyz, (_TerrainEngineBendTree * tmpvar_5).xyz, gl_Color.www); - vec3 tmpvar_6; - tmpvar_6.xz = vec2(0.0, 0.0); - tmpvar_6.y = _SquashPlaneNormal.w; - vec4 tmpvar_7; - tmpvar_7.w = 1.0; - tmpvar_7.xyz = mix ((pos_4.xyz + ( - dot (_SquashPlaneNormal.xyz, (tmpvar_6 - pos_4.xyz)) - * _SquashPlaneNormal.xyz)), pos_4.xyz, vec3(_SquashAmount)); - pos_4 = tmpvar_7; + vec4 tmpvar_4; + vec4 pos_5; + pos_5.w = gl_Vertex.w; + pos_5.xyz = (gl_Vertex.xyz * _Scale.xyz); + vec4 tmpvar_6; + tmpvar_6.w = 0.0; + tmpvar_6.xyz = pos_5.xyz; + pos_5.xyz = mix (pos_5.xyz, (_TerrainEngineBendTree * tmpvar_6).xyz, gl_Color.www); + vec3 tmpvar_7; + tmpvar_7.xz = vec2(0.0, 0.0); + tmpvar_7.y = _SquashPlaneNormal.w; vec4 tmpvar_8; - tmpvar_8 = (gl_ModelViewProjectionMatrix * tmpvar_7); + tmpvar_8.w = 1.0; + tmpvar_8.xyz = mix ((pos_5.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_7 - pos_5.xyz)) + * _SquashPlaneNormal.xyz)), pos_5.xyz, vec3(_SquashAmount)); + pos_5 = tmpvar_8; + tmpvar_3 = (gl_ModelViewProjectionMatrix * tmpvar_8); lightDir_2.w = _AO; lightColor_1 = gl_LightModel.ambient; lightDir_2.xyz = _TerrainTreeLightDirections[0]; @@ -49,16 +49,32 @@ void main () dot (lightDir_2.xyz, gl_Normal) ))).xyz; lightColor_1.w = 1.0; - tmpvar_3.xyz = (lightColor_1 * _Color).xyz; - tmpvar_3.w = 1.0; - gl_Position = tmpvar_8; + tmpvar_4.xyz = (lightColor_1 * _Color).xyz; + tmpvar_4.w = 1.0; + gl_Position = tmpvar_3; vec4 tmpvar_9; tmpvar_9.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_9.x = tmpvar_8.z; + tmpvar_9.x = tmpvar_3.z; xlv_FOG = tmpvar_9; gl_TexCoord[0] = gl_MultiTexCoord0; - gl_FrontColor = tmpvar_3; + gl_FrontColor = tmpvar_4; } -// inputs: 4, stats: 32 alu 0 tex 0 flow +// stats: 32 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Color (high float) 4x1 [-1] loc 3 +// #2: gl_Normal (high float) 3x1 [-1] loc 2 +// #3: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 10 (total size: 0) +// #0: gl_LightModel (high other) 0x0 [-1] +// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #2: _AO (high float) 1x1 [-1] +// #3: _Color (high float) 4x1 [-1] +// #4: _Scale (high float) 4x1 [-1] +// #5: _SquashAmount (high float) 1x1 [-1] +// #6: _SquashPlaneNormal (high float) 4x1 [-1] +// #7: _TerrainEngineBendTree (high float) 4x4 [-1] +// #8: _TerrainTreeLightColors (high float) 4x1 [4] +// #9: _TerrainTreeLightDirections (high float) 3x1 [4] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-ir.txt deleted file mode 100644 index 9c9f2bbe8..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-ir.txt +++ /dev/null @@ -1,384 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec4 hip_pack1; - vec2 hip_pack2; - vec3 normal; - vec3 vlight; - vec4 _ShadowCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _Control_ST; -uniform mat4 _Object2World; -uniform vec4 _ProjectionParams; -uniform vec4 _Splat0_ST; -uniform vec4 _Splat1_ST; -uniform vec4 _Splat2_ST; -uniform vec4 _Splat3_ST; -uniform vec4 unity_4LightAtten0; -uniform vec4 unity_4LightPosX0; -uniform vec4 unity_4LightPosY0; -uniform vec4 unity_4LightPosZ0; -uniform vec3 unity_LightColor0; -uniform vec3 unity_LightColor1; -uniform vec3 unity_LightColor2; -uniform vec3 unity_LightColor3; -uniform vec4 unity_SHAb; -uniform vec4 unity_SHAg; -uniform vec4 unity_SHAr; -uniform vec4 unity_SHBb; -uniform vec4 unity_SHBg; -uniform vec4 unity_SHBr; -uniform vec4 unity_SHC; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec3 ShadeSH9 ( - in vec4 normal_9 -) -{ - vec3 x3_10; - float vC_11; - vec3 x2_12; - vec4 vB_13; - vec3 x1_14; - float tmpvar_15; - tmpvar_15 = dot (unity_SHAr, normal_9); - float tmpvar_16; - tmpvar_16 = tmpvar_15; - x1_14.x = tmpvar_16; - float tmpvar_17; - tmpvar_17 = dot (unity_SHAg, normal_9); - float tmpvar_18; - tmpvar_18 = tmpvar_17; - x1_14.y = vec2(tmpvar_18).y; - float tmpvar_19; - tmpvar_19 = dot (unity_SHAb, normal_9); - float tmpvar_20; - tmpvar_20 = tmpvar_19; - x1_14.z = vec3(tmpvar_20).z; - vec4 tmpvar_21; - tmpvar_21 = (normal_9.xyzz * normal_9.yzzx); - vB_13 = tmpvar_21; - float tmpvar_22; - tmpvar_22 = dot (unity_SHBr, vB_13); - float tmpvar_23; - tmpvar_23 = tmpvar_22; - x2_12.x = tmpvar_23; - float tmpvar_24; - tmpvar_24 = dot (unity_SHBg, vB_13); - float tmpvar_25; - tmpvar_25 = tmpvar_24; - x2_12.y = vec2(tmpvar_25).y; - float tmpvar_26; - tmpvar_26 = dot (unity_SHBb, vB_13); - float tmpvar_27; - tmpvar_27 = tmpvar_26; - x2_12.z = vec3(tmpvar_27).z; - float tmpvar_28; - tmpvar_28 = ((normal_9.x * normal_9.x) - (normal_9.y * normal_9.y)); - vC_11 = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = (unity_SHC.xyz * vC_11); - x3_10 = tmpvar_29; - return ((x1_14 + x2_12) + x3_10); -} - -vec3 Shade4PointLights ( - in vec4 lightPosX_30, - in vec4 lightPosY_31, - in vec4 lightPosZ_32, - in vec3 lightColor0_33, - in vec3 lightColor1_34, - in vec3 lightColor2_35, - in vec3 lightColor3_36, - in vec4 lightAttenSq_37, - in vec3 pos_38, - in vec3 normal_39 -) -{ - vec3 col_40; - vec4 diff_41; - vec4 atten_42; - vec4 corr_43; - vec4 ndotl_44; - vec4 lengthSq_45; - vec4 toLightZ_46; - vec4 toLightY_47; - vec4 toLightX_48; - vec4 tmpvar_49; - tmpvar_49 = (lightPosX_30 - pos_38.x); - toLightX_48 = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50 = (lightPosY_31 - pos_38.y); - toLightY_47 = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = (lightPosZ_32 - pos_38.z); - toLightZ_46 = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = vec4(0.0, 0.0, 0.0, 0.0); - lengthSq_45 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = (lengthSq_45 + (toLightX_48 * toLightX_48)); - lengthSq_45 = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54 = (lengthSq_45 + (toLightY_47 * toLightY_47)); - lengthSq_45 = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = (lengthSq_45 + (toLightZ_46 * toLightZ_46)); - lengthSq_45 = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = vec4(0.0, 0.0, 0.0, 0.0); - ndotl_44 = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = (ndotl_44 + (toLightX_48 * normal_39.x)); - ndotl_44 = tmpvar_57; - vec4 tmpvar_58; - tmpvar_58 = (ndotl_44 + (toLightY_47 * normal_39.y)); - ndotl_44 = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59 = (ndotl_44 + (toLightZ_46 * normal_39.z)); - ndotl_44 = tmpvar_59; - vec4 tmpvar_60; - tmpvar_60 = inversesqrt (lengthSq_45); - vec4 tmpvar_61; - tmpvar_61 = tmpvar_60; - corr_43 = tmpvar_61; - vec4 tmpvar_62; - tmpvar_62 = max (vec4(0.0, 0.0, 0.0, 0.0), (ndotl_44 * corr_43)); - vec4 tmpvar_63; - tmpvar_63 = tmpvar_62; - ndotl_44 = tmpvar_63; - vec4 tmpvar_64; - tmpvar_64 = (1.0 / (1.0 + (lengthSq_45 * lightAttenSq_37))); - atten_42 = tmpvar_64; - vec4 tmpvar_65; - tmpvar_65 = (ndotl_44 * atten_42); - diff_41 = tmpvar_65; - vec3 tmpvar_66; - tmpvar_66 = vec3(0.0, 0.0, 0.0); - col_40 = tmpvar_66; - vec3 tmpvar_67; - tmpvar_67 = (col_40 + (lightColor0_33 * diff_41.x)); - col_40 = tmpvar_67; - vec3 tmpvar_68; - tmpvar_68 = (col_40 + (lightColor1_34 * diff_41.y)); - col_40 = tmpvar_68; - vec3 tmpvar_69; - tmpvar_69 = (col_40 + (lightColor2_35 * diff_41.z)); - col_40 = tmpvar_69; - vec3 tmpvar_70; - tmpvar_70 = (col_40 + (lightColor3_36 * diff_41.w)); - col_40 = tmpvar_70; - return col_40; -} - -void PositionFog ( - in vec4 v_71, - out vec4 pos_72, - out float fog_73 -) -{ - vec4 tmpvar_74; - tmpvar_74 = (gl_ModelViewProjectionMatrix * v_71); - pos_72 = tmpvar_74; - float tmpvar_75; - tmpvar_75 = pos_72.z; - fog_73 = tmpvar_75; -} - -vec4 ComputeScreenPos ( - in vec4 pos_76 -) -{ - vec4 o_77; - vec4 tmpvar_78; - tmpvar_78 = (pos_76 * 0.5); - o_77 = tmpvar_78; - vec2 tmpvar_79; - tmpvar_79.x = o_77.x; - tmpvar_79.y = (o_77.y * _ProjectionParams.x); - vec2 tmpvar_80; - tmpvar_80 = (tmpvar_79 + o_77.w); - o_77.xy = tmpvar_80.xy.xy; - vec2 tmpvar_81; - tmpvar_81 = pos_76.zw; - o_77.zw = tmpvar_81.xxxy.zw; - return o_77; -} - -v2f_surf vert_surf ( - in appdata_full v_82 -) -{ - vec3 worldPos_83; - vec3 shlight_84; - vec3 worldN_85; - v2f_surf o_86; - PositionFog (v_82.vertex, o_86.pos, o_86.fog); - vec2 tmpvar_87; - tmpvar_87 = ((v_82.texcoord.xy * _Control_ST.xy) + _Control_ST.zw); - o_86.hip_pack0.xy = tmpvar_87.xy.xy; - vec2 tmpvar_88; - tmpvar_88 = ((v_82.texcoord.xy * _Splat0_ST.xy) + _Splat0_ST.zw); - o_86.hip_pack0.zw = tmpvar_88.xxxy.zw; - vec2 tmpvar_89; - tmpvar_89 = ((v_82.texcoord.xy * _Splat1_ST.xy) + _Splat1_ST.zw); - o_86.hip_pack1.xy = tmpvar_89.xy.xy; - vec2 tmpvar_90; - tmpvar_90 = ((v_82.texcoord.xy * _Splat2_ST.xy) + _Splat2_ST.zw); - o_86.hip_pack1.zw = tmpvar_90.xxxy.zw; - vec2 tmpvar_91; - tmpvar_91 = ((v_82.texcoord.xy * _Splat3_ST.xy) + _Splat3_ST.zw); - o_86.hip_pack2 = tmpvar_91.xy.xy; - mat3 tmpvar_92; - tmpvar_92 = xll_constructMat3 (_Object2World); - vec3 tmpvar_93; - tmpvar_93 = (tmpvar_92 * (v_82.normal * unity_Scale.w)); - worldN_85 = tmpvar_93; - vec3 tmpvar_94; - tmpvar_94 = worldN_85; - o_86.normal = tmpvar_94; - vec4 tmpvar_95; - tmpvar_95.w = 1.0; - tmpvar_95.xyz = worldN_85.xyz; - vec3 tmpvar_96; - tmpvar_96 = ShadeSH9 (tmpvar_95); - vec3 tmpvar_97; - tmpvar_97 = tmpvar_96; - shlight_84 = tmpvar_97; - vec3 tmpvar_98; - tmpvar_98 = shlight_84; - o_86.vlight = tmpvar_98; - vec3 tmpvar_99; - tmpvar_99 = (_Object2World * v_82.vertex).xyz; - worldPos_83 = tmpvar_99; - vec3 tmpvar_100; - tmpvar_100 = Shade4PointLights (unity_4LightPosX0, unity_4LightPosY0, unity_4LightPosZ0, unity_LightColor0, unity_LightColor1, unity_LightColor2, unity_LightColor3, unity_4LightAtten0, worldPos_83, worldN_85); - vec3 tmpvar_101; - tmpvar_101 = (o_86.vlight + tmpvar_100); - o_86.vlight = tmpvar_101; - vec4 tmpvar_102; - tmpvar_102 = ComputeScreenPos (o_86.pos); - vec4 tmpvar_103; - tmpvar_103 = tmpvar_102; - o_86._ShadowCoord = tmpvar_103; - return o_86; -} - -void main () -{ - appdata_full xlt_v_104; - v2f_surf xl_retval_105; - vec4 tmpvar_106; - tmpvar_106 = gl_Vertex.xyzw; - vec4 tmpvar_107; - tmpvar_107 = tmpvar_106; - xlt_v_104.vertex = tmpvar_107; - vec4 tmpvar_108; - tmpvar_108 = TANGENT.xyzw; - vec4 tmpvar_109; - tmpvar_109 = tmpvar_108; - xlt_v_104.tangent = tmpvar_109; - vec3 tmpvar_110; - tmpvar_110 = gl_Normal.xyz; - vec3 tmpvar_111; - tmpvar_111 = tmpvar_110; - xlt_v_104.normal = tmpvar_111; - vec4 tmpvar_112; - tmpvar_112 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_113; - tmpvar_113 = tmpvar_112; - xlt_v_104.texcoord = tmpvar_113; - vec4 tmpvar_114; - tmpvar_114 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_115; - tmpvar_115 = tmpvar_114; - xlt_v_104.texcoord1 = tmpvar_115; - vec4 tmpvar_116; - tmpvar_116 = gl_Color.xyzw; - vec4 tmpvar_117; - tmpvar_117 = tmpvar_116; - xlt_v_104.color = tmpvar_117; - v2f_surf tmpvar_118; - tmpvar_118 = vert_surf (xlt_v_104); - v2f_surf tmpvar_119; - tmpvar_119 = tmpvar_118; - xl_retval_105 = tmpvar_119; - vec4 tmpvar_120; - tmpvar_120 = xl_retval_105.pos.xyzw; - vec4 tmpvar_121; - tmpvar_121 = tmpvar_120; - gl_Position = tmpvar_121; - vec4 tmpvar_122; - tmpvar_122.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_122.x = xl_retval_105.fog; - vec4 tmpvar_123; - tmpvar_123 = tmpvar_122; - xlv_FOG = tmpvar_123; - vec4 tmpvar_124; - tmpvar_124 = xl_retval_105.hip_pack0.xyzw; - vec4 tmpvar_125; - tmpvar_125 = tmpvar_124; - gl_TexCoord[0] = tmpvar_125; - vec4 tmpvar_126; - tmpvar_126 = xl_retval_105.hip_pack1.xyzw; - vec4 tmpvar_127; - tmpvar_127 = tmpvar_126; - gl_TexCoord[1] = tmpvar_127; - vec4 tmpvar_128; - tmpvar_128.zw = vec2(0.0, 0.0); - tmpvar_128.xy = xl_retval_105.hip_pack2.xy; - vec4 tmpvar_129; - tmpvar_129 = tmpvar_128; - gl_TexCoord[2] = tmpvar_129; - vec4 tmpvar_130; - tmpvar_130.w = 0.0; - tmpvar_130.xyz = xl_retval_105.normal.xyz; - vec4 tmpvar_131; - tmpvar_131 = tmpvar_130; - gl_TexCoord[3] = tmpvar_131; - vec4 tmpvar_132; - tmpvar_132.w = 0.0; - tmpvar_132.xyz = xl_retval_105.vlight.xyz; - vec4 tmpvar_133; - tmpvar_133 = tmpvar_132; - gl_TexCoord[4] = tmpvar_133; - vec4 tmpvar_134; - tmpvar_134 = xl_retval_105._ShadowCoord.xyzw; - vec4 tmpvar_135; - tmpvar_135 = tmpvar_134; - gl_TexCoord[5] = tmpvar_135; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt index d39356df8..f7caa98ee 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt @@ -24,86 +24,120 @@ uniform vec4 unity_Scale; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - vec4 tmpvar_2; + vec3 worldPos_1; + vec3 worldN_2; vec4 tmpvar_3; - tmpvar_3 = (gl_ModelViewProjectionMatrix * gl_Vertex); - tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _Control_ST.xy) + _Control_ST.zw); - tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _Splat0_ST.xy) + _Splat0_ST.zw); - tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _Splat1_ST.xy) + _Splat1_ST.zw); - tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _Splat2_ST.xy) + _Splat2_ST.zw); - mat3 tmpvar_4; - tmpvar_4[0] = _Object2World[0].xyz; - tmpvar_4[1] = _Object2World[1].xyz; - tmpvar_4[2] = _Object2World[2].xyz; - vec3 tmpvar_5; - tmpvar_5 = (tmpvar_4 * (gl_Normal * unity_Scale.w)); - vec4 tmpvar_6; - tmpvar_6.w = 1.0; - tmpvar_6.xyz = tmpvar_5; - vec3 x2_7; - vec3 x1_8; - x1_8.x = dot (unity_SHAr, tmpvar_6); - x1_8.y = dot (unity_SHAg, tmpvar_6); - x1_8.z = dot (unity_SHAb, tmpvar_6); - vec4 tmpvar_9; - tmpvar_9 = (tmpvar_5.xyzz * tmpvar_5.yzzx); - x2_7.x = dot (unity_SHBr, tmpvar_9); - x2_7.y = dot (unity_SHBg, tmpvar_9); - x2_7.z = dot (unity_SHBb, tmpvar_9); - vec3 tmpvar_10; - tmpvar_10 = (_Object2World * gl_Vertex).xyz; - vec4 tmpvar_11; - tmpvar_11 = (unity_4LightPosX0 - tmpvar_10.x); - vec4 tmpvar_12; - tmpvar_12 = (unity_4LightPosY0 - tmpvar_10.y); - vec4 tmpvar_13; - tmpvar_13 = (unity_4LightPosZ0 - tmpvar_10.z); - vec4 tmpvar_14; - tmpvar_14 = (((tmpvar_11 * tmpvar_11) + (tmpvar_12 * tmpvar_12)) + (tmpvar_13 * tmpvar_13)); - vec4 tmpvar_15; - tmpvar_15 = (max (vec4(0.0, 0.0, 0.0, 0.0), ( - (((tmpvar_11 * tmpvar_5.x) + (tmpvar_12 * tmpvar_5.y)) + (tmpvar_13 * tmpvar_5.z)) - * - inversesqrt(tmpvar_14) - )) * (1.0/((1.0 + - (tmpvar_14 * unity_4LightAtten0) + vec4 tmpvar_4; + vec4 pos_5; + pos_5 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_3.xy = ((gl_MultiTexCoord0.xy * _Control_ST.xy) + _Control_ST.zw); + tmpvar_3.zw = ((gl_MultiTexCoord0.xy * _Splat0_ST.xy) + _Splat0_ST.zw); + tmpvar_4.xy = ((gl_MultiTexCoord0.xy * _Splat1_ST.xy) + _Splat1_ST.zw); + tmpvar_4.zw = ((gl_MultiTexCoord0.xy * _Splat2_ST.xy) + _Splat2_ST.zw); + mat3 tmpvar_6; + tmpvar_6[0] = _Object2World[0].xyz; + tmpvar_6[1] = _Object2World[1].xyz; + tmpvar_6[2] = _Object2World[2].xyz; + worldN_2 = (tmpvar_6 * (gl_Normal * unity_Scale.w)); + vec4 tmpvar_7; + tmpvar_7.w = 1.0; + tmpvar_7.xyz = worldN_2; + vec3 x2_8; + vec4 vB_9; + vec3 x1_10; + x1_10.x = dot (unity_SHAr, tmpvar_7); + x1_10.y = dot (unity_SHAg, tmpvar_7); + x1_10.z = dot (unity_SHAb, tmpvar_7); + vB_9 = (worldN_2.xyzz * worldN_2.yzzx); + x2_8.x = dot (unity_SHBr, vB_9); + x2_8.y = dot (unity_SHBg, vB_9); + x2_8.z = dot (unity_SHBb, vB_9); + worldPos_1 = (_Object2World * gl_Vertex).xyz; + vec3 col_11; + vec4 diff_12; + vec4 ndotl_13; + vec4 lengthSq_14; + vec4 toLightZ_15; + vec4 toLightY_16; + vec4 toLightX_17; + toLightX_17 = (unity_4LightPosX0 - worldPos_1.x); + toLightY_16 = (unity_4LightPosY0 - worldPos_1.y); + toLightZ_15 = (unity_4LightPosZ0 - worldPos_1.z); + lengthSq_14 = (toLightX_17 * toLightX_17); + lengthSq_14 = (lengthSq_14 + (toLightY_16 * toLightY_16)); + lengthSq_14 = (lengthSq_14 + (toLightZ_15 * toLightZ_15)); + ndotl_13 = (toLightX_17 * worldN_2.x); + ndotl_13 = (ndotl_13 + (toLightY_16 * worldN_2.y)); + ndotl_13 = (ndotl_13 + (toLightZ_15 * worldN_2.z)); + vec4 tmpvar_18; + tmpvar_18 = max (vec4(0.0, 0.0, 0.0, 0.0), (ndotl_13 * inversesqrt(lengthSq_14))); + ndotl_13 = tmpvar_18; + diff_12 = (tmpvar_18 * (1.0/((1.0 + + (lengthSq_14 * unity_4LightAtten0) )))); - vec4 o_16; - vec4 tmpvar_17; - tmpvar_17 = (tmpvar_3 * 0.5); - vec2 tmpvar_18; - tmpvar_18.x = tmpvar_17.x; - tmpvar_18.y = (tmpvar_17.y * _ProjectionParams.x); - o_16.xy = (tmpvar_18 + tmpvar_17.w); - o_16.zw = tmpvar_3.zw; - gl_Position = tmpvar_3; - vec4 tmpvar_19; - tmpvar_19.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_19.x = tmpvar_3.z; - xlv_FOG = tmpvar_19; - gl_TexCoord[0] = tmpvar_1; - gl_TexCoord[1] = tmpvar_2; - vec4 tmpvar_20; - tmpvar_20.zw = vec2(0.0, 0.0); - tmpvar_20.xy = ((gl_MultiTexCoord0.xy * _Splat3_ST.xy) + _Splat3_ST.zw); - gl_TexCoord[2] = tmpvar_20; + col_11 = (unity_LightColor0 * diff_12.x); + col_11 = (col_11 + (unity_LightColor1 * diff_12.y)); + col_11 = (col_11 + (unity_LightColor2 * diff_12.z)); + col_11 = (col_11 + (unity_LightColor3 * diff_12.w)); + vec4 o_19; + o_19 = (pos_5 * 0.5); + vec2 tmpvar_20; + tmpvar_20.x = o_19.x; + tmpvar_20.y = (o_19.y * _ProjectionParams.x); + o_19.xy = (tmpvar_20 + o_19.w); + o_19.zw = pos_5.zw; + gl_Position = pos_5; vec4 tmpvar_21; - tmpvar_21.w = 0.0; - tmpvar_21.xyz = tmpvar_5; - gl_TexCoord[3] = tmpvar_21; + tmpvar_21.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_21.x = pos_5.z; + xlv_FOG = tmpvar_21; + gl_TexCoord[0] = tmpvar_3; + gl_TexCoord[1] = tmpvar_4; vec4 tmpvar_22; - tmpvar_22.w = 0.0; - tmpvar_22.xyz = (((x1_8 + x2_7) + (unity_SHC.xyz * - ((tmpvar_5.x * tmpvar_5.x) - (tmpvar_5.y * tmpvar_5.y)) - )) + (( - ((unity_LightColor0 * tmpvar_15.x) + (unity_LightColor1 * tmpvar_15.y)) - + - (unity_LightColor2 * tmpvar_15.z) - ) + (unity_LightColor3 * tmpvar_15.w))); - gl_TexCoord[4] = tmpvar_22; - gl_TexCoord[5] = o_16; + tmpvar_22.zw = vec2(0.0, 0.0); + tmpvar_22.xy = ((gl_MultiTexCoord0.xy * _Splat3_ST.xy) + _Splat3_ST.zw); + gl_TexCoord[2] = tmpvar_22; + vec4 tmpvar_23; + tmpvar_23.w = 0.0; + tmpvar_23.xyz = worldN_2; + gl_TexCoord[3] = tmpvar_23; + vec4 tmpvar_24; + tmpvar_24.w = 0.0; + tmpvar_24.xyz = (((x1_10 + x2_8) + (unity_SHC.xyz * + ((worldN_2.x * worldN_2.x) - (worldN_2.y * worldN_2.y)) + )) + col_11); + gl_TexCoord[4] = tmpvar_24; + gl_TexCoord[5] = o_19; } -// inputs: 3, stats: 63 alu 0 tex 0 flow +// stats: 63 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 24 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _Control_ST (high float) 4x1 [-1] +// #2: _Object2World (high float) 4x4 [-1] +// #3: _ProjectionParams (high float) 4x1 [-1] +// #4: _Splat0_ST (high float) 4x1 [-1] +// #5: _Splat1_ST (high float) 4x1 [-1] +// #6: _Splat2_ST (high float) 4x1 [-1] +// #7: _Splat3_ST (high float) 4x1 [-1] +// #8: unity_4LightAtten0 (high float) 4x1 [-1] +// #9: unity_4LightPosX0 (high float) 4x1 [-1] +// #10: unity_4LightPosY0 (high float) 4x1 [-1] +// #11: unity_4LightPosZ0 (high float) 4x1 [-1] +// #12: unity_LightColor0 (high float) 3x1 [-1] +// #13: unity_LightColor1 (high float) 3x1 [-1] +// #14: unity_LightColor2 (high float) 3x1 [-1] +// #15: unity_LightColor3 (high float) 3x1 [-1] +// #16: unity_SHAb (high float) 4x1 [-1] +// #17: unity_SHAg (high float) 4x1 [-1] +// #18: unity_SHAr (high float) 4x1 [-1] +// #19: unity_SHBb (high float) 4x1 [-1] +// #20: unity_SHBg (high float) 4x1 [-1] +// #21: unity_SHBr (high float) 4x1 [-1] +// #22: unity_SHC (high float) 4x1 [-1] +// #23: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-ir.txt deleted file mode 100644 index 749d8b22b..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-ir.txt +++ /dev/null @@ -1,177 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec4 hip_pack1; - vec2 hip_pack2; - vec4 hip_screen; - vec3 hip_lmapFade; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _Control_ST; -uniform vec4 _ProjectionParams; -uniform vec4 _Splat0_ST; -uniform vec4 _Splat1_ST; -uniform vec4 _Splat2_ST; -uniform vec4 _Splat3_ST; -uniform vec4 unity_LightmapFade; -uniform vec4 unity_LightmapST; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec4 ComputeScreenPos ( - in vec4 pos_6 -) -{ - vec4 o_7; - vec4 tmpvar_8; - tmpvar_8 = (pos_6 * 0.5); - o_7 = tmpvar_8; - vec2 tmpvar_9; - tmpvar_9.x = o_7.x; - tmpvar_9.y = (o_7.y * _ProjectionParams.x); - vec2 tmpvar_10; - tmpvar_10 = (tmpvar_9 + o_7.w); - o_7.xy = tmpvar_10.xy.xy; - vec2 tmpvar_11; - tmpvar_11 = pos_6.zw; - o_7.zw = tmpvar_11.xxxy.zw; - return o_7; -} - -v2f_surf vert_surf ( - in appdata_full v_12 -) -{ - v2f_surf o_13; - PositionFog (v_12.vertex, o_13.pos, o_13.fog); - vec2 tmpvar_14; - tmpvar_14 = ((v_12.texcoord.xy * _Control_ST.xy) + _Control_ST.zw); - o_13.hip_pack0.xy = tmpvar_14.xy.xy; - vec2 tmpvar_15; - tmpvar_15 = ((v_12.texcoord.xy * _Splat0_ST.xy) + _Splat0_ST.zw); - o_13.hip_pack0.zw = tmpvar_15.xxxy.zw; - vec2 tmpvar_16; - tmpvar_16 = ((v_12.texcoord.xy * _Splat1_ST.xy) + _Splat1_ST.zw); - o_13.hip_pack1.xy = tmpvar_16.xy.xy; - vec2 tmpvar_17; - tmpvar_17 = ((v_12.texcoord.xy * _Splat2_ST.xy) + _Splat2_ST.zw); - o_13.hip_pack1.zw = tmpvar_17.xxxy.zw; - vec2 tmpvar_18; - tmpvar_18 = ((v_12.texcoord.xy * _Splat3_ST.xy) + _Splat3_ST.zw); - o_13.hip_pack2 = tmpvar_18.xy.xy; - vec4 tmpvar_19; - tmpvar_19 = ComputeScreenPos (o_13.pos); - vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - o_13.hip_screen = tmpvar_20; - vec2 tmpvar_21; - tmpvar_21 = ((v_12.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - o_13.hip_lmapFade.xy = tmpvar_21.xy.xy; - float tmpvar_22; - tmpvar_22 = ((-( - (gl_ModelViewMatrix * v_12.vertex) - .z) * unity_LightmapFade.z) + unity_LightmapFade.w); - o_13.hip_lmapFade.z = vec3(tmpvar_22).z; - return o_13; -} - -void main () -{ - appdata_full xlt_v_23; - v2f_surf xl_retval_24; - vec4 tmpvar_25; - tmpvar_25 = gl_Vertex.xyzw; - vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; - xlt_v_23.vertex = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = TANGENT.xyzw; - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - xlt_v_23.tangent = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = gl_Normal.xyz; - vec3 tmpvar_30; - tmpvar_30 = tmpvar_29; - xlt_v_23.normal = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_31; - xlt_v_23.texcoord = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - xlt_v_23.texcoord1 = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35 = gl_Color.xyzw; - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlt_v_23.color = tmpvar_36; - v2f_surf tmpvar_37; - tmpvar_37 = vert_surf (xlt_v_23); - v2f_surf tmpvar_38; - tmpvar_38 = tmpvar_37; - xl_retval_24 = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = xl_retval_24.pos.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - gl_Position = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_41.x = xl_retval_24.fog; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlv_FOG = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43 = xl_retval_24.hip_pack0.xyzw; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - gl_TexCoord[0] = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = xl_retval_24.hip_pack1.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - gl_TexCoord[1] = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47.zw = vec2(0.0, 0.0); - tmpvar_47.xy = xl_retval_24.hip_pack2.xy; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - gl_TexCoord[2] = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = xl_retval_24.hip_screen.xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - gl_TexCoord[3] = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51.w = 0.0; - tmpvar_51.xyz = xl_retval_24.hip_lmapFade.xyz; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - gl_TexCoord[4] = tmpvar_52; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt index 92ac6c4c2..56d239fc2 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt @@ -12,41 +12,55 @@ void main () vec4 tmpvar_1; vec4 tmpvar_2; vec3 tmpvar_3; - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_4; + pos_4 = (gl_ModelViewProjectionMatrix * gl_Vertex); tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _Control_ST.xy) + _Control_ST.zw); tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _Splat0_ST.xy) + _Splat0_ST.zw); tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _Splat1_ST.xy) + _Splat1_ST.zw); tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _Splat2_ST.xy) + _Splat2_ST.zw); vec4 o_5; - vec4 tmpvar_6; - tmpvar_6 = (tmpvar_4 * 0.5); - vec2 tmpvar_7; - tmpvar_7.x = tmpvar_6.x; - tmpvar_7.y = (tmpvar_6.y * _ProjectionParams.x); - o_5.xy = (tmpvar_7 + tmpvar_6.w); - o_5.zw = tmpvar_4.zw; + o_5 = (pos_4 * 0.5); + vec2 tmpvar_6; + tmpvar_6.x = o_5.x; + tmpvar_6.y = (o_5.y * _ProjectionParams.x); + o_5.xy = (tmpvar_6 + o_5.w); + o_5.zw = pos_4.zw; tmpvar_3.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); tmpvar_3.z = ((-( (gl_ModelViewMatrix * gl_Vertex) .z) * unity_LightmapFade.z) + unity_LightmapFade.w); - gl_Position = tmpvar_4; - vec4 tmpvar_8; - tmpvar_8.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_8.x = tmpvar_4.z; - xlv_FOG = tmpvar_8; + gl_Position = pos_4; + vec4 tmpvar_7; + tmpvar_7.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_7.x = pos_4.z; + xlv_FOG = tmpvar_7; gl_TexCoord[0] = tmpvar_1; gl_TexCoord[1] = tmpvar_2; - vec4 tmpvar_9; - tmpvar_9.zw = vec2(0.0, 0.0); - tmpvar_9.xy = ((gl_MultiTexCoord0.xy * _Splat3_ST.xy) + _Splat3_ST.zw); - gl_TexCoord[2] = tmpvar_9; + vec4 tmpvar_8; + tmpvar_8.zw = vec2(0.0, 0.0); + tmpvar_8.xy = ((gl_MultiTexCoord0.xy * _Splat3_ST.xy) + _Splat3_ST.zw); + gl_TexCoord[2] = tmpvar_8; gl_TexCoord[3] = o_5; - vec4 tmpvar_10; - tmpvar_10.w = 0.0; - tmpvar_10.xyz = tmpvar_3; - gl_TexCoord[4] = tmpvar_10; + vec4 tmpvar_9; + tmpvar_9.w = 0.0; + tmpvar_9.xyz = tmpvar_3; + gl_TexCoord[4] = tmpvar_9; } -// inputs: 3, stats: 23 alu 0 tex 0 flow +// stats: 23 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 10 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: gl_ModelViewMatrix (high float) 4x4 [-1] +// #2: _Control_ST (high float) 4x1 [-1] +// #3: _ProjectionParams (high float) 4x1 [-1] +// #4: _Splat0_ST (high float) 4x1 [-1] +// #5: _Splat1_ST (high float) 4x1 [-1] +// #6: _Splat2_ST (high float) 4x1 [-1] +// #7: _Splat3_ST (high float) 4x1 [-1] +// #8: unity_LightmapFade (high float) 4x1 [-1] +// #9: unity_LightmapST (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-ir.txt deleted file mode 100644 index c6ee35549..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-ir.txt +++ /dev/null @@ -1,126 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; - vec3 color; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _TerrainTreeLightColors[4]; -uniform vec3 _TerrainTreeLightDirections[4]; -attribute vec4 TANGENT; -v2f vert ( - in appdata_full v_1 -) -{ - float diff_2; - vec3 lightDir_3; - int i_4; - vec3 lightColor_5; - v2f o_6; - int tmpvar_7; - tmpvar_7 = 0; - i_4 = tmpvar_7; - vec4 tmpvar_8; - tmpvar_8 = (gl_ModelViewProjectionMatrix * v_1.vertex); - o_6.pos = tmpvar_8; - vec2 tmpvar_9; - tmpvar_9 = v_1.texcoord.xy; - o_6.uv = tmpvar_9; - vec3 tmpvar_10; - tmpvar_10 = gl_LightModel.ambient.xyz; - lightColor_5 = tmpvar_10; - while (true) { - if (!((i_4 < 4))) { - break; - }; - vec3 tmpvar_11; - tmpvar_11 = _TerrainTreeLightDirections[i_4]; - lightDir_3 = tmpvar_11.xyz.xyz; - float tmpvar_12; - tmpvar_12 = dot (lightDir_3.xyz, v_1.normal); - float tmpvar_13; - tmpvar_13 = max (0.0, tmpvar_12); - float tmpvar_14; - tmpvar_14 = tmpvar_13; - diff_2 = tmpvar_14; - vec3 tmpvar_15; - tmpvar_15 = (_TerrainTreeLightColors[i_4] * diff_2).xyz; - vec3 tmpvar_16; - tmpvar_16 = (lightColor_5 + tmpvar_15); - lightColor_5 = tmpvar_16; - int _post_incdec_tmp_17; - _post_incdec_tmp_17 = i_4; - int tmpvar_18; - tmpvar_18 = (i_4 + 1); - i_4 = tmpvar_18; - }; - vec3 tmpvar_19; - tmpvar_19 = (lightColor_5 * v_1.color.w); - o_6.color = tmpvar_19; - return o_6; -} - -void main () -{ - appdata_full xlt_v_20; - v2f xl_retval_21; - vec4 tmpvar_22; - tmpvar_22 = gl_Vertex.xyzw; - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - xlt_v_20.vertex = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = TANGENT.xyzw; - vec4 tmpvar_25; - tmpvar_25 = tmpvar_24; - xlt_v_20.tangent = tmpvar_25; - vec3 tmpvar_26; - tmpvar_26 = gl_Normal.xyz; - vec3 tmpvar_27; - tmpvar_27 = tmpvar_26; - xlt_v_20.normal = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - xlt_v_20.texcoord = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - xlt_v_20.texcoord1 = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = gl_Color.xyzw; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - xlt_v_20.color = tmpvar_33; - v2f tmpvar_34; - tmpvar_34 = vert (xlt_v_20); - v2f tmpvar_35; - tmpvar_35 = tmpvar_34; - xl_retval_21 = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36 = xl_retval_21.pos.xyzw; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - gl_Position = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38.zw = vec2(0.0, 0.0); - tmpvar_38.xy = xl_retval_21.uv.xy; - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - gl_TexCoord[0] = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40.w = 0.0; - tmpvar_40.xyz = xl_retval_21.color.xyz; - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - gl_TexCoord[1] = tmpvar_41; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt index 3aacb15f6..67ca3b368 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt @@ -28,4 +28,14 @@ void main () } -// inputs: 4, stats: 20 alu 0 tex 0 flow +// stats: 20 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Color (high float) 4x1 [-1] loc 3 +// #2: gl_Normal (high float) 3x1 [-1] loc 2 +// #3: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 4 (total size: 0) +// #0: gl_LightModel (high other) 0x0 [-1] +// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #2: _TerrainTreeLightColors (high float) 4x1 [4] +// #3: _TerrainTreeLightDirections (high float) 3x1 [4] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-ir.txt deleted file mode 100644 index aa15374ee..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-ir.txt +++ /dev/null @@ -1,185 +0,0 @@ -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -struct v2f { - vec4 pos; - vec2 uv; - vec3 color; -}; -uniform vec4 _TerrainTreeLightColors[4]; -uniform vec3 _TerrainTreeLightDirections[4]; -attribute vec4 TANGENT; -void ExpandBillboard ( - in mat4 mat_1, - inout vec4 pos_2, - inout vec3 normal_3, - inout vec4 tangent_4 -) -{ - vec3 tanb_5; - vec3 norb_6; - float isBillboard_7; - float tmpvar_8; - tmpvar_8 = abs (tangent_4.w); - float tmpvar_9; - tmpvar_9 = (1.0 - tmpvar_8); - isBillboard_7 = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10.w = 0.0; - tmpvar_10.xyz = normal_3.xyz; - vec4 tmpvar_11; - tmpvar_11 = normalize ((tmpvar_10 * mat_1)); - vec3 tmpvar_12; - tmpvar_12 = tmpvar_11.xyz; - vec3 tmpvar_13; - tmpvar_13 = tmpvar_12; - norb_6 = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14.yw = vec2(0.0, 0.0); - tmpvar_14.x = normal_3.z; - tmpvar_14.z = -(normal_3.x); - vec4 tmpvar_15; - tmpvar_15 = normalize ((tmpvar_14 * mat_1)); - vec3 tmpvar_16; - tmpvar_16 = tmpvar_15.xyz; - vec3 tmpvar_17; - tmpvar_17 = tmpvar_16; - tanb_5 = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = (pos_2 + ((tangent_4 * mat_1) * isBillboard_7)); - pos_2 = tmpvar_18; - vec3 tmpvar_19; - tmpvar_19 = vec3(isBillboard_7); - vec3 tmpvar_20; - tmpvar_20 = mix (normal_3, norb_6, tmpvar_19); - vec3 tmpvar_21; - tmpvar_21 = tmpvar_20; - normal_3 = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22.w = -1.0; - tmpvar_22.xyz = tanb_5.xyz; - vec4 tmpvar_23; - tmpvar_23 = vec4(isBillboard_7); - vec4 tmpvar_24; - tmpvar_24 = mix (tangent_4, tmpvar_22, tmpvar_23); - vec4 tmpvar_25; - tmpvar_25 = tmpvar_24; - tangent_4 = tmpvar_25; -} - -v2f vert ( - in appdata_full v_26 -) -{ - float diff_27; - vec3 lightDir_28; - int i_29; - vec3 lightColor_30; - v2f o_31; - int tmpvar_32; - tmpvar_32 = 0; - i_29 = tmpvar_32; - ExpandBillboard (gl_ModelViewMatrixInverseTranspose, v_26.vertex, v_26.normal, v_26.tangent); - vec4 tmpvar_33; - tmpvar_33 = (gl_ModelViewProjectionMatrix * v_26.vertex); - o_31.pos = tmpvar_33; - vec2 tmpvar_34; - tmpvar_34 = v_26.texcoord.xy; - o_31.uv = tmpvar_34; - vec3 tmpvar_35; - tmpvar_35 = gl_LightModel.ambient.xyz; - lightColor_30 = tmpvar_35; - while (true) { - if (!((i_29 < 4))) { - break; - }; - vec3 tmpvar_36; - tmpvar_36 = _TerrainTreeLightDirections[i_29]; - lightDir_28 = tmpvar_36.xyz.xyz; - float tmpvar_37; - tmpvar_37 = dot (lightDir_28.xyz, v_26.normal); - float tmpvar_38; - tmpvar_38 = max (0.0, ((tmpvar_37 * 0.5) + 0.5)); - float tmpvar_39; - tmpvar_39 = tmpvar_38; - diff_27 = tmpvar_39; - vec3 tmpvar_40; - tmpvar_40 = (_TerrainTreeLightColors[i_29] * diff_27).xyz; - vec3 tmpvar_41; - tmpvar_41 = (lightColor_30 + tmpvar_40); - lightColor_30 = tmpvar_41; - int _post_incdec_tmp_42; - _post_incdec_tmp_42 = i_29; - int tmpvar_43; - tmpvar_43 = (i_29 + 1); - i_29 = tmpvar_43; - }; - vec3 tmpvar_44; - tmpvar_44 = (lightColor_30 * v_26.color.w); - o_31.color = tmpvar_44; - return o_31; -} - -void main () -{ - appdata_full xlt_v_45; - v2f xl_retval_46; - vec4 tmpvar_47; - tmpvar_47 = gl_Vertex.xyzw; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_v_45.vertex = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = TANGENT.xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_v_45.tangent = tmpvar_50; - vec3 tmpvar_51; - tmpvar_51 = gl_Normal.xyz; - vec3 tmpvar_52; - tmpvar_52 = tmpvar_51; - xlt_v_45.normal = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - xlt_v_45.texcoord = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - xlt_v_45.texcoord1 = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = gl_Color.xyzw; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - xlt_v_45.color = tmpvar_58; - v2f tmpvar_59; - tmpvar_59 = vert (xlt_v_45); - v2f tmpvar_60; - tmpvar_60 = tmpvar_59; - xl_retval_46 = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61 = xl_retval_46.pos.xyzw; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - gl_Position = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63.zw = vec2(0.0, 0.0); - tmpvar_63.xy = xl_retval_46.uv.xy; - vec4 tmpvar_64; - tmpvar_64 = tmpvar_63; - gl_TexCoord[0] = tmpvar_64; - vec4 tmpvar_65; - tmpvar_65.w = 0.0; - tmpvar_65.xyz = xl_retval_46.color.xyz; - vec4 tmpvar_66; - tmpvar_66 = tmpvar_65; - gl_TexCoord[1] = tmpvar_66; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt index 5c0c0eeef..3b432b624 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt @@ -4,13 +4,13 @@ attribute vec4 TANGENT; void main () { vec3 lightColor_1; - float tmpvar_2; - tmpvar_2 = (1.0 - abs(TANGENT.w)); + float isBillboard_2; + isBillboard_2 = (1.0 - abs(TANGENT.w)); vec4 tmpvar_3; tmpvar_3.w = 0.0; tmpvar_3.xyz = gl_Normal; vec3 tmpvar_4; - tmpvar_4 = mix (gl_Normal, normalize((tmpvar_3 * gl_ModelViewMatrixInverseTranspose)).xyz, vec3(tmpvar_2)); + tmpvar_4 = mix (gl_Normal, normalize((tmpvar_3 * gl_ModelViewMatrixInverseTranspose)).xyz, vec3(isBillboard_2)); lightColor_1 = gl_LightModel.ambient.xyz; lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[0] * max (0.0, ((dot (_TerrainTreeLightDirections[0], tmpvar_4) * 0.5) + 0.5) @@ -26,7 +26,7 @@ void main () )).xyz); gl_Position = (gl_ModelViewProjectionMatrix * (gl_Vertex + ( (TANGENT * gl_ModelViewMatrixInverseTranspose) - * tmpvar_2))); + * isBillboard_2))); vec4 tmpvar_5; tmpvar_5.zw = vec2(0.0, 0.0); tmpvar_5.xy = gl_MultiTexCoord0.xy; @@ -38,4 +38,16 @@ void main () } -// inputs: 5, stats: 37 alu 0 tex 0 flow +// stats: 37 alu 0 tex 0 flow +// inputs: 5 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Color (high float) 4x1 [-1] loc 3 +// #2: gl_Normal (high float) 3x1 [-1] loc 2 +// #3: gl_Vertex (high float) 4x1 [-1] loc 0 +// #4: TANGENT (high float) 4x1 [-1] +// uniforms: 5 (total size: 0) +// #0: gl_LightModel (high other) 0x0 [-1] +// #1: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] +// #2: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #3: _TerrainTreeLightColors (high float) 4x1 [4] +// #4: _TerrainTreeLightDirections (high float) 3x1 [4] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-ir.txt deleted file mode 100644 index 4acacc687..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-ir.txt +++ /dev/null @@ -1,399 +0,0 @@ -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 lop_color; - vec3 lightDir; - vec3 viewDir; - vec3 _LightCoord; -}; -uniform vec4 _Color; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _Scale; -uniform float _SquashAmount; -uniform vec4 _SquashPlaneNormal; -uniform float _TimeX; -uniform vec4 _Wind; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -vec4 Squash ( - in vec4 pos_1 -) -{ - vec3 planeNormal_2; - vec3 planePoint_3; - vec3 projectedVertex_4; - vec3 tmpvar_5; - tmpvar_5 = pos_1.xyz; - projectedVertex_4 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6.xz = vec2(0.0, 0.0); - tmpvar_6.y = _SquashPlaneNormal.w; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_6; - planePoint_3 = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = _SquashPlaneNormal.xyz; - planeNormal_2 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = pos_1.xyz; - float tmpvar_10; - tmpvar_10 = dot (planeNormal_2, (planePoint_3 - tmpvar_9)); - vec3 tmpvar_11; - tmpvar_11 = (projectedVertex_4 + (tmpvar_10 * planeNormal_2)); - projectedVertex_4 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = vec3(_SquashAmount); - vec3 tmpvar_13; - tmpvar_13 = mix (projectedVertex_4, pos_1.xyz, tmpvar_12); - vec4 tmpvar_14; - tmpvar_14.w = 1.0; - tmpvar_14.xyz = tmpvar_13.xyz; - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - pos_1 = tmpvar_15; - return pos_1; -} - -vec4 TriangleWave ( - in vec4 x_16 -) -{ - vec4 tmpvar_17; - tmpvar_17 = fract ((x_16 + 0.5)); - vec4 tmpvar_18; - tmpvar_18 = abs (((tmpvar_17 * 2.0) - 1.0)); - return tmpvar_18; -} - -vec4 SmoothCurve ( - in vec4 x_19 -) -{ - return ((x_19 * x_19) * (3.0 - (2.0 * x_19))); -} - -vec4 SmoothTriangleWave ( - in vec4 x_20 -) -{ - vec4 tmpvar_21; - tmpvar_21 = TriangleWave (x_20); - vec4 tmpvar_22; - tmpvar_22 = SmoothCurve (tmpvar_21); - return tmpvar_22; -} - -vec4 AnimateVertex ( - in vec4 pos_23, - in vec3 normal_24, - in vec4 animParams_25 -) -{ - vec3 bend_26; - vec2 vWavesSum_27; - vec4 vWaves_28; - vec2 vWavesIn_29; - float fVtxPhase_30; - float fBranchPhase_31; - float fObjPhase_32; - float fBranchAmp_33; - float fDetailAmp_34; - float tmpvar_35; - tmpvar_35 = 0.1; - fDetailAmp_34 = tmpvar_35; - float tmpvar_36; - tmpvar_36 = 0.3; - fBranchAmp_33 = tmpvar_36; - float tmpvar_37; - tmpvar_37 = dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)); - float tmpvar_38; - tmpvar_38 = tmpvar_37; - fObjPhase_32 = tmpvar_38; - float tmpvar_39; - tmpvar_39 = (fObjPhase_32 + animParams_25.x); - fBranchPhase_31 = tmpvar_39; - vec3 tmpvar_40; - tmpvar_40 = vec3((animParams_25.y + fBranchPhase_31)); - float tmpvar_41; - tmpvar_41 = dot (pos_23.xyz, tmpvar_40); - float tmpvar_42; - tmpvar_42 = tmpvar_41; - fVtxPhase_30 = tmpvar_42; - vec2 tmpvar_43; - tmpvar_43.x = fVtxPhase_30; - tmpvar_43.y = fBranchPhase_31; - vec2 tmpvar_44; - tmpvar_44 = (_TimeX + tmpvar_43); - vWavesIn_29 = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = fract ((vWavesIn_29.xxyy * vec4(1.975, 0.793, 0.375, 0.193))); - vec4 tmpvar_46; - tmpvar_46 = ((tmpvar_45 * 2.0) - 1.0); - vWaves_28 = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = SmoothTriangleWave (vWaves_28); - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - vWaves_28 = tmpvar_48; - vec2 tmpvar_49; - tmpvar_49 = (vWaves_28.xz + vWaves_28.yw); - vWavesSum_27 = tmpvar_49; - vec3 tmpvar_50; - tmpvar_50 = ((animParams_25.y * fDetailAmp_34) * normal_24.xyz); - bend_26 = tmpvar_50; - float tmpvar_51; - tmpvar_51 = (animParams_25.w * fBranchAmp_33); - bend_26.y = vec2(tmpvar_51).y; - vec3 tmpvar_52; - tmpvar_52 = (pos_23.xyz + (( - (vWavesSum_27.xyx * bend_26) - + - ((_Wind.xyz * vWavesSum_27.y) * animParams_25.w) - ) * _Wind.w)); - pos_23.xyz = tmpvar_52.xyz.xyz; - vec3 tmpvar_53; - tmpvar_53 = (pos_23.xyz + (animParams_25.z * _Wind.xyz)); - pos_23.xyz = tmpvar_53.xyz.xyz; - return pos_23; -} - -void TreeVertBark ( - inout appdata_full v_54 -) -{ - vec3 tmpvar_55; - tmpvar_55 = (v_54.vertex.xyz * _Scale.xyz); - v_54.vertex.xyz = tmpvar_55.xyz.xyz; - vec4 tmpvar_56; - tmpvar_56.xy = v_54.color.xy.xy; - tmpvar_56.zw = v_54.texcoord1.xy.xy; - vec4 tmpvar_57; - tmpvar_57 = AnimateVertex (v_54.vertex, v_54.normal, tmpvar_56); - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - v_54.vertex = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59 = Squash (v_54.vertex); - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - v_54.vertex = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61.xyz = (v_54.color.w * _Color.xyz).xyz; - tmpvar_61.w = _Color.w; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - v_54.color = tmpvar_62; - vec3 tmpvar_63; - tmpvar_63 = normalize (v_54.normal); - vec3 tmpvar_64; - tmpvar_64 = tmpvar_63; - v_54.normal = tmpvar_64; - vec3 tmpvar_65; - tmpvar_65 = normalize (v_54.tangent.xyz); - vec3 tmpvar_66; - tmpvar_66 = tmpvar_65; - v_54.tangent.xyz = tmpvar_66.xyz.xyz; -} - -void PositionFog ( - in vec4 v_67, - out vec4 pos_68, - out float fog_69 -) -{ - vec4 tmpvar_70; - tmpvar_70 = (gl_ModelViewProjectionMatrix * v_67); - pos_68 = tmpvar_70; - float tmpvar_71; - tmpvar_71 = pos_68.z; - fog_69 = tmpvar_71; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_72 -) -{ - vec3 objSpaceCameraPos_73; - vec4 tmpvar_74; - tmpvar_74.w = 1.0; - tmpvar_74.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_75; - tmpvar_75 = ((_World2Object * tmpvar_74).xyz * unity_Scale.w); - objSpaceCameraPos_73 = tmpvar_75; - return (objSpaceCameraPos_73 - v_72.xyz); -} - -vec3 ObjSpaceLightDir ( - in vec4 v_76 -) -{ - vec3 objSpaceLightPos_77; - vec3 tmpvar_78; - tmpvar_78 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_77 = tmpvar_78; - return ((objSpaceLightPos_77.xyz * unity_Scale.w) - v_76.xyz); -} - -v2f_surf vert_surf ( - in appdata_full v_79 -) -{ - mat3 rotation_80; - vec3 binormal_81; - v2f_surf o_82; - TreeVertBark (v_79); - PositionFog (v_79.vertex, o_82.pos, o_82.fog); - vec2 tmpvar_83; - tmpvar_83 = ((v_79.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_82.hip_pack0 = tmpvar_83.xy.xy; - vec4 tmpvar_84; - tmpvar_84 = v_79.color; - o_82.lop_color = tmpvar_84; - vec3 tmpvar_85; - tmpvar_85 = cross (v_79.normal, v_79.tangent.xyz); - vec3 tmpvar_86; - tmpvar_86 = (tmpvar_85 * v_79.tangent.w); - binormal_81 = tmpvar_86; - mat3 tmpvar_87; - float tmpvar_88; - tmpvar_88 = v_79.tangent.x; - tmpvar_87[0].x = tmpvar_88; - float tmpvar_89; - tmpvar_89 = binormal_81.x; - tmpvar_87[0].y = tmpvar_89; - float tmpvar_90; - tmpvar_90 = v_79.normal.x; - tmpvar_87[0].z = tmpvar_90; - float tmpvar_91; - tmpvar_91 = v_79.tangent.y; - tmpvar_87[1].x = tmpvar_91; - float tmpvar_92; - tmpvar_92 = binormal_81.y; - tmpvar_87[1].y = tmpvar_92; - float tmpvar_93; - tmpvar_93 = v_79.normal.y; - tmpvar_87[1].z = tmpvar_93; - float tmpvar_94; - tmpvar_94 = v_79.tangent.z; - tmpvar_87[2].x = tmpvar_94; - float tmpvar_95; - tmpvar_95 = binormal_81.z; - tmpvar_87[2].y = tmpvar_95; - float tmpvar_96; - tmpvar_96 = v_79.normal.z; - tmpvar_87[2].z = tmpvar_96; - mat3 tmpvar_97; - tmpvar_97 = tmpvar_87; - rotation_80 = tmpvar_97; - vec3 tmpvar_98; - tmpvar_98 = ObjSpaceLightDir (v_79.vertex); - vec3 tmpvar_99; - tmpvar_99 = (rotation_80 * tmpvar_98); - o_82.lightDir = tmpvar_99; - vec3 tmpvar_100; - tmpvar_100 = ObjSpaceViewDir (v_79.vertex); - vec3 tmpvar_101; - tmpvar_101 = (rotation_80 * tmpvar_100); - o_82.viewDir = tmpvar_101; - vec3 tmpvar_102; - tmpvar_102 = (_LightMatrix0 * (_Object2World * v_79.vertex)).xyz; - o_82._LightCoord = tmpvar_102; - return o_82; -} - -void main () -{ - appdata_full xlt_v_103; - v2f_surf xl_retval_104; - vec4 tmpvar_105; - tmpvar_105 = gl_Vertex.xyzw; - vec4 tmpvar_106; - tmpvar_106 = tmpvar_105; - xlt_v_103.vertex = tmpvar_106; - vec4 tmpvar_107; - tmpvar_107 = TANGENT.xyzw; - vec4 tmpvar_108; - tmpvar_108 = tmpvar_107; - xlt_v_103.tangent = tmpvar_108; - vec3 tmpvar_109; - tmpvar_109 = gl_Normal.xyz; - vec3 tmpvar_110; - tmpvar_110 = tmpvar_109; - xlt_v_103.normal = tmpvar_110; - vec4 tmpvar_111; - tmpvar_111 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_112; - tmpvar_112 = tmpvar_111; - xlt_v_103.texcoord = tmpvar_112; - vec4 tmpvar_113; - tmpvar_113 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_114; - tmpvar_114 = tmpvar_113; - xlt_v_103.texcoord1 = tmpvar_114; - vec4 tmpvar_115; - tmpvar_115 = gl_Color.xyzw; - vec4 tmpvar_116; - tmpvar_116 = tmpvar_115; - xlt_v_103.color = tmpvar_116; - v2f_surf tmpvar_117; - tmpvar_117 = vert_surf (xlt_v_103); - v2f_surf tmpvar_118; - tmpvar_118 = tmpvar_117; - xl_retval_104 = tmpvar_118; - vec4 tmpvar_119; - tmpvar_119 = xl_retval_104.pos.xyzw; - vec4 tmpvar_120; - tmpvar_120 = tmpvar_119; - gl_Position = tmpvar_120; - vec4 tmpvar_121; - tmpvar_121.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_121.x = xl_retval_104.fog; - vec4 tmpvar_122; - tmpvar_122 = tmpvar_121; - xlv_FOG = tmpvar_122; - vec4 tmpvar_123; - tmpvar_123.zw = vec2(0.0, 0.0); - tmpvar_123.xy = xl_retval_104.hip_pack0.xy; - vec4 tmpvar_124; - tmpvar_124 = tmpvar_123; - gl_TexCoord[0] = tmpvar_124; - vec4 tmpvar_125; - tmpvar_125 = xl_retval_104.lop_color.xyzw; - vec4 tmpvar_126; - tmpvar_126 = tmpvar_125; - gl_FrontColor = tmpvar_126; - vec4 tmpvar_127; - tmpvar_127.w = 0.0; - tmpvar_127.xyz = xl_retval_104.lightDir.xyz; - vec4 tmpvar_128; - tmpvar_128 = tmpvar_127; - gl_TexCoord[1] = tmpvar_128; - vec4 tmpvar_129; - tmpvar_129.w = 0.0; - tmpvar_129.xyz = xl_retval_104.viewDir.xyz; - vec4 tmpvar_130; - tmpvar_130 = tmpvar_129; - gl_TexCoord[2] = tmpvar_130; - vec4 tmpvar_131; - tmpvar_131.w = 0.0; - tmpvar_131.xyz = xl_retval_104._LightCoord.xyz; - vec4 tmpvar_132; - tmpvar_132 = tmpvar_131; - gl_TexCoord[3] = tmpvar_132; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt index 6019b9c9d..a11d06d2f 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt @@ -15,98 +15,123 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; + vec3 binormal_1; vec4 tmpvar_2; - tmpvar_1.w = gl_Vertex.w; - tmpvar_2.w = TANGENT.w; - tmpvar_1.xyz = (gl_Vertex.xyz * _Scale.xyz); - vec4 pos_3; - pos_3.w = tmpvar_1.w; - vec3 bend_4; - float tmpvar_5; - tmpvar_5 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x); - vec2 tmpvar_6; - tmpvar_6.x = dot (tmpvar_1.xyz, vec3((gl_Color.y + tmpvar_5))); - tmpvar_6.y = tmpvar_5; - vec4 tmpvar_7; - tmpvar_7 = abs((( - fract(((( - fract(((_TimeX + tmpvar_6).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) - * 2.0) - 1.0) + 0.5)) - * 2.0) - 1.0)); - vec4 tmpvar_8; - tmpvar_8 = ((tmpvar_7 * tmpvar_7) * (3.0 - (2.0 * tmpvar_7))); + vec4 tmpvar_3; + tmpvar_2.w = gl_Vertex.w; + tmpvar_3.w = TANGENT.w; + tmpvar_2.xyz = (gl_Vertex.xyz * _Scale.xyz); + vec4 pos_4; + pos_4.w = tmpvar_2.w; + vec3 bend_5; + vec2 vWavesSum_6; + vec4 vWaves_7; + float fBranchPhase_8; + fBranchPhase_8 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x); vec2 tmpvar_9; - tmpvar_9 = (tmpvar_8.xz + tmpvar_8.yw); - bend_4.xz = ((gl_Color.y * 0.1) * gl_Normal).xz; - bend_4.y = (gl_MultiTexCoord1.y * 0.3); - pos_3.xyz = (tmpvar_1.xyz + (( - (tmpvar_9.xyx * bend_4) + tmpvar_9.x = dot (tmpvar_2.xyz, vec3((gl_Color.y + fBranchPhase_8))); + tmpvar_9.y = fBranchPhase_8; + vWaves_7 = ((fract( + ((_TimeX + tmpvar_9).xxyy * vec4(1.975, 0.793, 0.375, 0.193)) + ) * 2.0) - 1.0); + vec4 tmpvar_10; + tmpvar_10 = abs((( + fract((vWaves_7 + 0.5)) + * 2.0) - 1.0)); + vec4 tmpvar_11; + tmpvar_11 = ((tmpvar_10 * tmpvar_10) * (3.0 - (2.0 * tmpvar_10))); + vWaves_7 = tmpvar_11; + vWavesSum_6 = (tmpvar_11.xz + tmpvar_11.yw); + bend_5.xz = ((gl_Color.y * 0.1) * gl_Normal).xz; + bend_5.y = (gl_MultiTexCoord1.y * 0.3); + pos_4.xyz = (tmpvar_2.xyz + (( + (vWavesSum_6.xyx * bend_5) + - ((_Wind.xyz * tmpvar_9.y) * gl_MultiTexCoord1.y) + ((_Wind.xyz * vWavesSum_6.y) * gl_MultiTexCoord1.y) ) * _Wind.w)); - pos_3.xyz = (pos_3.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); - vec3 tmpvar_10; - tmpvar_10.xz = vec2(0.0, 0.0); - tmpvar_10.y = _SquashPlaneNormal.w; - vec3 tmpvar_11; - tmpvar_11 = mix ((pos_3.xyz + ( - dot (_SquashPlaneNormal.xyz, (tmpvar_10 - pos_3.xyz)) - * _SquashPlaneNormal.xyz)), pos_3.xyz, vec3(_SquashAmount)); - vec4 tmpvar_12; - tmpvar_12.w = 1.0; - tmpvar_12.xyz = tmpvar_11; - tmpvar_1 = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13.xyz = (gl_Color.w * _Color.xyz); - tmpvar_13.w = _Color.w; - vec3 tmpvar_14; - tmpvar_14 = normalize(gl_Normal); - tmpvar_2.xyz = normalize(TANGENT.xyz); + pos_4.xyz = (pos_4.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); + vec3 tmpvar_12; + tmpvar_12.xz = vec2(0.0, 0.0); + tmpvar_12.y = _SquashPlaneNormal.w; + vec3 tmpvar_13; + tmpvar_13 = mix ((pos_4.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_12 - pos_4.xyz)) + * _SquashPlaneNormal.xyz)), pos_4.xyz, vec3(_SquashAmount)); + vec4 tmpvar_14; + tmpvar_14.w = 1.0; + tmpvar_14.xyz = tmpvar_13; + tmpvar_2 = tmpvar_14; vec4 tmpvar_15; - tmpvar_15 = (gl_ModelViewProjectionMatrix * tmpvar_12); + tmpvar_15.xyz = (gl_Color.w * _Color.xyz); + tmpvar_15.w = _Color.w; vec3 tmpvar_16; - tmpvar_16 = (((tmpvar_14.yzx * tmpvar_2.zxy) - (tmpvar_14.zxy * tmpvar_2.yzx)) * TANGENT.w); - mat3 tmpvar_17; - tmpvar_17[0].x = tmpvar_2.x; - tmpvar_17[0].y = tmpvar_16.x; - tmpvar_17[0].z = tmpvar_14.x; - tmpvar_17[1].x = tmpvar_2.y; - tmpvar_17[1].y = tmpvar_16.y; - tmpvar_17[1].z = tmpvar_14.y; - tmpvar_17[2].x = tmpvar_2.z; - tmpvar_17[2].y = tmpvar_16.z; - tmpvar_17[2].z = tmpvar_14.z; - vec4 tmpvar_18; - tmpvar_18.w = 1.0; - tmpvar_18.xyz = _WorldSpaceCameraPos; - gl_Position = tmpvar_15; + tmpvar_16 = normalize(gl_Normal); + tmpvar_3.xyz = normalize(TANGENT.xyz); + vec4 pos_17; + pos_17 = (gl_ModelViewProjectionMatrix * tmpvar_14); + binormal_1 = (((tmpvar_16.yzx * tmpvar_3.zxy) - (tmpvar_16.zxy * tmpvar_3.yzx)) * TANGENT.w); + mat3 tmpvar_18; + tmpvar_18[0].x = tmpvar_3.x; + tmpvar_18[0].y = binormal_1.x; + tmpvar_18[0].z = tmpvar_16.x; + tmpvar_18[1].x = tmpvar_3.y; + tmpvar_18[1].y = binormal_1.y; + tmpvar_18[1].z = tmpvar_16.y; + tmpvar_18[2].x = tmpvar_3.z; + tmpvar_18[2].y = binormal_1.z; + tmpvar_18[2].z = tmpvar_16.z; vec4 tmpvar_19; - tmpvar_19.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_19.x = tmpvar_15.z; - xlv_FOG = tmpvar_19; + tmpvar_19.w = 1.0; + tmpvar_19.xyz = _WorldSpaceCameraPos; + gl_Position = pos_17; vec4 tmpvar_20; - tmpvar_20.zw = vec2(0.0, 0.0); - tmpvar_20.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_20; - gl_FrontColor = tmpvar_13; + tmpvar_20.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_20.x = pos_17.z; + xlv_FOG = tmpvar_20; vec4 tmpvar_21; - tmpvar_21.w = 0.0; - tmpvar_21.xyz = (tmpvar_17 * (( - (_World2Object * _WorldSpaceLightPos0) - .xyz * unity_Scale.w) - tmpvar_11)); - gl_TexCoord[1] = tmpvar_21; + tmpvar_21.zw = vec2(0.0, 0.0); + tmpvar_21.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_21; + gl_FrontColor = tmpvar_15; vec4 tmpvar_22; tmpvar_22.w = 0.0; - tmpvar_22.xyz = (tmpvar_17 * (( - (_World2Object * tmpvar_18) - .xyz * unity_Scale.w) - tmpvar_11)); - gl_TexCoord[2] = tmpvar_22; + tmpvar_22.xyz = (tmpvar_18 * (( + (_World2Object * _WorldSpaceLightPos0) + .xyz * unity_Scale.w) - tmpvar_13)); + gl_TexCoord[1] = tmpvar_22; vec4 tmpvar_23; tmpvar_23.w = 0.0; - tmpvar_23.xyz = (_LightMatrix0 * (_Object2World * tmpvar_12)).xyz; - gl_TexCoord[3] = tmpvar_23; + tmpvar_23.xyz = (tmpvar_18 * (( + (_World2Object * tmpvar_19) + .xyz * unity_Scale.w) - tmpvar_13)); + gl_TexCoord[2] = tmpvar_23; + vec4 tmpvar_24; + tmpvar_24.w = 0.0; + tmpvar_24.xyz = (_LightMatrix0 * (_Object2World * tmpvar_14)).xyz; + gl_TexCoord[3] = tmpvar_24; } -// inputs: 6, stats: 64 alu 0 tex 0 flow +// stats: 64 alu 0 tex 0 flow +// inputs: 6 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #2: gl_Color (high float) 4x1 [-1] loc 3 +// #3: gl_Normal (high float) 3x1 [-1] loc 2 +// #4: gl_Vertex (high float) 4x1 [-1] loc 0 +// #5: TANGENT (high float) 4x1 [-1] +// uniforms: 14 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _Color (high float) 4x1 [-1] +// #2: _LightMatrix0 (high float) 4x4 [-1] +// #3: _MainTex_ST (high float) 4x1 [-1] +// #4: _Object2World (high float) 4x4 [-1] +// #5: _Scale (high float) 4x1 [-1] +// #6: _SquashAmount (high float) 1x1 [-1] +// #7: _SquashPlaneNormal (high float) 4x1 [-1] +// #8: _TimeX (high float) 1x1 [-1] +// #9: _Wind (high float) 4x1 [-1] +// #10: _World2Object (high float) 4x4 [-1] +// #11: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #12: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #13: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-ir.txt deleted file mode 100644 index 53dbf7a51..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-ir.txt +++ /dev/null @@ -1,266 +0,0 @@ -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -struct v2f_surf { - vec4 pos; -}; -uniform vec4 _Color; -uniform mat4 _Object2World; -uniform vec4 _Scale; -uniform float _SquashAmount; -uniform vec4 _SquashPlaneNormal; -uniform float _TimeX; -uniform vec4 _Wind; -uniform vec4 unity_LightShadowBias; -attribute vec4 TANGENT; -vec4 Squash ( - in vec4 pos_1 -) -{ - vec3 planeNormal_2; - vec3 planePoint_3; - vec3 projectedVertex_4; - vec3 tmpvar_5; - tmpvar_5 = pos_1.xyz; - projectedVertex_4 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6.xz = vec2(0.0, 0.0); - tmpvar_6.y = _SquashPlaneNormal.w; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_6; - planePoint_3 = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = _SquashPlaneNormal.xyz; - planeNormal_2 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = pos_1.xyz; - float tmpvar_10; - tmpvar_10 = dot (planeNormal_2, (planePoint_3 - tmpvar_9)); - vec3 tmpvar_11; - tmpvar_11 = (projectedVertex_4 + (tmpvar_10 * planeNormal_2)); - projectedVertex_4 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = vec3(_SquashAmount); - vec3 tmpvar_13; - tmpvar_13 = mix (projectedVertex_4, pos_1.xyz, tmpvar_12); - vec4 tmpvar_14; - tmpvar_14.w = 1.0; - tmpvar_14.xyz = tmpvar_13.xyz; - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - pos_1 = tmpvar_15; - return pos_1; -} - -vec4 TriangleWave ( - in vec4 x_16 -) -{ - vec4 tmpvar_17; - tmpvar_17 = fract ((x_16 + 0.5)); - vec4 tmpvar_18; - tmpvar_18 = abs (((tmpvar_17 * 2.0) - 1.0)); - return tmpvar_18; -} - -vec4 SmoothCurve ( - in vec4 x_19 -) -{ - return ((x_19 * x_19) * (3.0 - (2.0 * x_19))); -} - -vec4 SmoothTriangleWave ( - in vec4 x_20 -) -{ - vec4 tmpvar_21; - tmpvar_21 = TriangleWave (x_20); - vec4 tmpvar_22; - tmpvar_22 = SmoothCurve (tmpvar_21); - return tmpvar_22; -} - -vec4 AnimateVertex ( - in vec4 pos_23, - in vec3 normal_24, - in vec4 animParams_25 -) -{ - vec3 bend_26; - vec2 vWavesSum_27; - vec4 vWaves_28; - vec2 vWavesIn_29; - float fVtxPhase_30; - float fBranchPhase_31; - float fObjPhase_32; - float fBranchAmp_33; - float fDetailAmp_34; - float tmpvar_35; - tmpvar_35 = 0.1; - fDetailAmp_34 = tmpvar_35; - float tmpvar_36; - tmpvar_36 = 0.3; - fBranchAmp_33 = tmpvar_36; - float tmpvar_37; - tmpvar_37 = dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)); - float tmpvar_38; - tmpvar_38 = tmpvar_37; - fObjPhase_32 = tmpvar_38; - float tmpvar_39; - tmpvar_39 = (fObjPhase_32 + animParams_25.x); - fBranchPhase_31 = tmpvar_39; - vec3 tmpvar_40; - tmpvar_40 = vec3((animParams_25.y + fBranchPhase_31)); - float tmpvar_41; - tmpvar_41 = dot (pos_23.xyz, tmpvar_40); - float tmpvar_42; - tmpvar_42 = tmpvar_41; - fVtxPhase_30 = tmpvar_42; - vec2 tmpvar_43; - tmpvar_43.x = fVtxPhase_30; - tmpvar_43.y = fBranchPhase_31; - vec2 tmpvar_44; - tmpvar_44 = (_TimeX + tmpvar_43); - vWavesIn_29 = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = fract ((vWavesIn_29.xxyy * vec4(1.975, 0.793, 0.375, 0.193))); - vec4 tmpvar_46; - tmpvar_46 = ((tmpvar_45 * 2.0) - 1.0); - vWaves_28 = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = SmoothTriangleWave (vWaves_28); - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - vWaves_28 = tmpvar_48; - vec2 tmpvar_49; - tmpvar_49 = (vWaves_28.xz + vWaves_28.yw); - vWavesSum_27 = tmpvar_49; - vec3 tmpvar_50; - tmpvar_50 = ((animParams_25.y * fDetailAmp_34) * normal_24.xyz); - bend_26 = tmpvar_50; - float tmpvar_51; - tmpvar_51 = (animParams_25.w * fBranchAmp_33); - bend_26.y = vec2(tmpvar_51).y; - vec3 tmpvar_52; - tmpvar_52 = (pos_23.xyz + (( - (vWavesSum_27.xyx * bend_26) - + - ((_Wind.xyz * vWavesSum_27.y) * animParams_25.w) - ) * _Wind.w)); - pos_23.xyz = tmpvar_52.xyz.xyz; - vec3 tmpvar_53; - tmpvar_53 = (pos_23.xyz + (animParams_25.z * _Wind.xyz)); - pos_23.xyz = tmpvar_53.xyz.xyz; - return pos_23; -} - -void TreeVertBark ( - inout appdata_full v_54 -) -{ - vec3 tmpvar_55; - tmpvar_55 = (v_54.vertex.xyz * _Scale.xyz); - v_54.vertex.xyz = tmpvar_55.xyz.xyz; - vec4 tmpvar_56; - tmpvar_56.xy = v_54.color.xy.xy; - tmpvar_56.zw = v_54.texcoord1.xy.xy; - vec4 tmpvar_57; - tmpvar_57 = AnimateVertex (v_54.vertex, v_54.normal, tmpvar_56); - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - v_54.vertex = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59 = Squash (v_54.vertex); - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - v_54.vertex = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61.xyz = (v_54.color.w * _Color.xyz).xyz; - tmpvar_61.w = _Color.w; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - v_54.color = tmpvar_62; - vec3 tmpvar_63; - tmpvar_63 = normalize (v_54.normal); - vec3 tmpvar_64; - tmpvar_64 = tmpvar_63; - v_54.normal = tmpvar_64; - vec3 tmpvar_65; - tmpvar_65 = normalize (v_54.tangent.xyz); - vec3 tmpvar_66; - tmpvar_66 = tmpvar_65; - v_54.tangent.xyz = tmpvar_66.xyz.xyz; -} - -v2f_surf vert_surf ( - in appdata_full v_67 -) -{ - v2f_surf o_68; - TreeVertBark (v_67); - vec4 tmpvar_69; - tmpvar_69 = (gl_ModelViewProjectionMatrix * v_67.vertex); - o_68.pos = tmpvar_69; - float tmpvar_70; - tmpvar_70 = (o_68.pos.z + unity_LightShadowBias.x); - o_68.pos.z = vec3(tmpvar_70).z; - if ((o_68.pos.z < -(o_68.pos.w))) { - float tmpvar_71; - tmpvar_71 = -(o_68.pos.w); - o_68.pos.z = vec3(tmpvar_71).z; - }; - return o_68; -} - -void main () -{ - appdata_full xlt_v_72; - v2f_surf xl_retval_73; - vec4 tmpvar_74; - tmpvar_74 = gl_Vertex.xyzw; - vec4 tmpvar_75; - tmpvar_75 = tmpvar_74; - xlt_v_72.vertex = tmpvar_75; - vec4 tmpvar_76; - tmpvar_76 = TANGENT.xyzw; - vec4 tmpvar_77; - tmpvar_77 = tmpvar_76; - xlt_v_72.tangent = tmpvar_77; - vec3 tmpvar_78; - tmpvar_78 = gl_Normal.xyz; - vec3 tmpvar_79; - tmpvar_79 = tmpvar_78; - xlt_v_72.normal = tmpvar_79; - vec4 tmpvar_80; - tmpvar_80 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_81; - tmpvar_81 = tmpvar_80; - xlt_v_72.texcoord = tmpvar_81; - vec4 tmpvar_82; - tmpvar_82 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_83; - tmpvar_83 = tmpvar_82; - xlt_v_72.texcoord1 = tmpvar_83; - vec4 tmpvar_84; - tmpvar_84 = gl_Color.xyzw; - vec4 tmpvar_85; - tmpvar_85 = tmpvar_84; - xlt_v_72.color = tmpvar_85; - v2f_surf tmpvar_86; - tmpvar_86 = vert_surf (xlt_v_72); - v2f_surf tmpvar_87; - tmpvar_87 = tmpvar_86; - xl_retval_73 = tmpvar_87; - vec4 tmpvar_88; - tmpvar_88 = xl_retval_73.pos.xyzw; - vec4 tmpvar_89; - tmpvar_89 = tmpvar_88; - gl_Position = tmpvar_89; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt index 1c13a8ec5..01d1b2266 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt @@ -14,47 +14,62 @@ void main () vec4 pos_3; pos_3.w = tmpvar_2.w; vec3 bend_4; - float tmpvar_5; - tmpvar_5 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x); - vec2 tmpvar_6; - tmpvar_6.x = dot (tmpvar_2.xyz, vec3((gl_Color.y + tmpvar_5))); - tmpvar_6.y = tmpvar_5; - vec4 tmpvar_7; - tmpvar_7 = abs((( - fract(((( - fract(((_TimeX + tmpvar_6).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) - * 2.0) - 1.0) + 0.5)) + vec2 vWavesSum_5; + vec4 vWaves_6; + float fBranchPhase_7; + fBranchPhase_7 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x); + vec2 tmpvar_8; + tmpvar_8.x = dot (tmpvar_2.xyz, vec3((gl_Color.y + fBranchPhase_7))); + tmpvar_8.y = fBranchPhase_7; + vWaves_6 = ((fract( + ((_TimeX + tmpvar_8).xxyy * vec4(1.975, 0.793, 0.375, 0.193)) + ) * 2.0) - 1.0); + vec4 tmpvar_9; + tmpvar_9 = abs((( + fract((vWaves_6 + 0.5)) * 2.0) - 1.0)); - vec4 tmpvar_8; - tmpvar_8 = ((tmpvar_7 * tmpvar_7) * (3.0 - (2.0 * tmpvar_7))); - vec2 tmpvar_9; - tmpvar_9 = (tmpvar_8.xz + tmpvar_8.yw); + vec4 tmpvar_10; + tmpvar_10 = ((tmpvar_9 * tmpvar_9) * (3.0 - (2.0 * tmpvar_9))); + vWaves_6 = tmpvar_10; + vWavesSum_5 = (tmpvar_10.xz + tmpvar_10.yw); bend_4.xz = ((gl_Color.y * 0.1) * gl_Normal).xz; bend_4.y = (gl_MultiTexCoord1.y * 0.3); pos_3.xyz = (tmpvar_2.xyz + (( - (tmpvar_9.xyx * bend_4) + (vWavesSum_5.xyx * bend_4) + - ((_Wind.xyz * tmpvar_9.y) * gl_MultiTexCoord1.y) + ((_Wind.xyz * vWavesSum_5.y) * gl_MultiTexCoord1.y) ) * _Wind.w)); pos_3.xyz = (pos_3.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); - vec3 tmpvar_10; - tmpvar_10.xz = vec2(0.0, 0.0); - tmpvar_10.y = _SquashPlaneNormal.w; - vec4 tmpvar_11; - tmpvar_11.w = 1.0; - tmpvar_11.xyz = mix ((pos_3.xyz + ( - dot (_SquashPlaneNormal.xyz, (tmpvar_10 - pos_3.xyz)) - * _SquashPlaneNormal.xyz)), pos_3.xyz, vec3(_SquashAmount)); - tmpvar_2 = tmpvar_11; + vec3 tmpvar_11; + tmpvar_11.xz = vec2(0.0, 0.0); + tmpvar_11.y = _SquashPlaneNormal.w; vec4 tmpvar_12; - tmpvar_12 = (gl_ModelViewProjectionMatrix * tmpvar_11); - tmpvar_1.xyw = tmpvar_12.xyw; - tmpvar_1.z = (tmpvar_12.z + unity_LightShadowBias.x); - if ((tmpvar_1.z < -(tmpvar_12.w))) { - tmpvar_1.z = -(tmpvar_12.w); + tmpvar_12.w = 1.0; + tmpvar_12.xyz = mix ((pos_3.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_11 - pos_3.xyz)) + * _SquashPlaneNormal.xyz)), pos_3.xyz, vec3(_SquashAmount)); + tmpvar_2 = tmpvar_12; + tmpvar_1 = (gl_ModelViewProjectionMatrix * tmpvar_12); + tmpvar_1.z = (tmpvar_1.z + unity_LightShadowBias.x); + if ((tmpvar_1.z < -(tmpvar_1.w))) { + tmpvar_1.z = -(tmpvar_1.w); }; gl_Position = tmpvar_1; } -// inputs: 4, stats: 43 alu 0 tex 1 flow +// stats: 43 alu 0 tex 1 flow +// inputs: 4 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_Color (high float) 4x1 [-1] loc 3 +// #2: gl_Normal (high float) 3x1 [-1] loc 2 +// #3: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 8 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _Object2World (high float) 4x4 [-1] +// #2: _Scale (high float) 4x1 [-1] +// #3: _SquashAmount (high float) 1x1 [-1] +// #4: _SquashPlaneNormal (high float) 4x1 [-1] +// #5: _TimeX (high float) 1x1 [-1] +// #6: _Wind (high float) 4x1 [-1] +// #7: unity_LightShadowBias (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-ir.txt deleted file mode 100644 index 8d5739c41..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-ir.txt +++ /dev/null @@ -1,447 +0,0 @@ -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 lop_color; - vec3 lightDir; - vec3 viewDir; -}; -uniform vec4 _Color; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _Scale; -uniform float _SquashAmount; -uniform vec4 _SquashPlaneNormal; -uniform float _TimeX; -uniform vec4 _Wind; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -vec4 Squash ( - in vec4 pos_1 -) -{ - vec3 planeNormal_2; - vec3 planePoint_3; - vec3 projectedVertex_4; - vec3 tmpvar_5; - tmpvar_5 = pos_1.xyz; - projectedVertex_4 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6.xz = vec2(0.0, 0.0); - tmpvar_6.y = _SquashPlaneNormal.w; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_6; - planePoint_3 = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = _SquashPlaneNormal.xyz; - planeNormal_2 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = pos_1.xyz; - float tmpvar_10; - tmpvar_10 = dot (planeNormal_2, (planePoint_3 - tmpvar_9)); - vec3 tmpvar_11; - tmpvar_11 = (projectedVertex_4 + (tmpvar_10 * planeNormal_2)); - projectedVertex_4 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = vec3(_SquashAmount); - vec3 tmpvar_13; - tmpvar_13 = mix (projectedVertex_4, pos_1.xyz, tmpvar_12); - vec4 tmpvar_14; - tmpvar_14.w = 1.0; - tmpvar_14.xyz = tmpvar_13.xyz; - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - pos_1 = tmpvar_15; - return pos_1; -} - -void ExpandBillboard ( - in mat4 mat_16, - inout vec4 pos_17, - inout vec3 normal_18, - inout vec4 tangent_19 -) -{ - vec3 tanb_20; - vec3 norb_21; - float isBillboard_22; - float tmpvar_23; - tmpvar_23 = abs (tangent_19.w); - float tmpvar_24; - tmpvar_24 = (1.0 - tmpvar_23); - isBillboard_22 = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25.w = 0.0; - tmpvar_25.xyz = normal_18.xyz; - vec4 tmpvar_26; - tmpvar_26 = normalize ((tmpvar_25 * mat_16)); - vec3 tmpvar_27; - tmpvar_27 = tmpvar_26.xyz; - vec3 tmpvar_28; - tmpvar_28 = tmpvar_27; - norb_21 = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29.yw = vec2(0.0, 0.0); - tmpvar_29.x = normal_18.z; - tmpvar_29.z = -(normal_18.x); - vec4 tmpvar_30; - tmpvar_30 = normalize ((tmpvar_29 * mat_16)); - vec3 tmpvar_31; - tmpvar_31 = tmpvar_30.xyz; - vec3 tmpvar_32; - tmpvar_32 = tmpvar_31; - tanb_20 = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = (pos_17 + ((tangent_19 * mat_16) * isBillboard_22)); - pos_17 = tmpvar_33; - vec3 tmpvar_34; - tmpvar_34 = vec3(isBillboard_22); - vec3 tmpvar_35; - tmpvar_35 = mix (normal_18, norb_21, tmpvar_34); - vec3 tmpvar_36; - tmpvar_36 = tmpvar_35; - normal_18 = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37.w = -1.0; - tmpvar_37.xyz = tanb_20.xyz; - vec4 tmpvar_38; - tmpvar_38 = vec4(isBillboard_22); - vec4 tmpvar_39; - tmpvar_39 = mix (tangent_19, tmpvar_37, tmpvar_38); - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - tangent_19 = tmpvar_40; -} - -vec4 TriangleWave ( - in vec4 x_41 -) -{ - vec4 tmpvar_42; - tmpvar_42 = fract ((x_41 + 0.5)); - vec4 tmpvar_43; - tmpvar_43 = abs (((tmpvar_42 * 2.0) - 1.0)); - return tmpvar_43; -} - -vec4 SmoothCurve ( - in vec4 x_44 -) -{ - return ((x_44 * x_44) * (3.0 - (2.0 * x_44))); -} - -vec4 SmoothTriangleWave ( - in vec4 x_45 -) -{ - vec4 tmpvar_46; - tmpvar_46 = TriangleWave (x_45); - vec4 tmpvar_47; - tmpvar_47 = SmoothCurve (tmpvar_46); - return tmpvar_47; -} - -vec4 AnimateVertex ( - in vec4 pos_48, - in vec3 normal_49, - in vec4 animParams_50 -) -{ - vec3 bend_51; - vec2 vWavesSum_52; - vec4 vWaves_53; - vec2 vWavesIn_54; - float fVtxPhase_55; - float fBranchPhase_56; - float fObjPhase_57; - float fBranchAmp_58; - float fDetailAmp_59; - float tmpvar_60; - tmpvar_60 = 0.1; - fDetailAmp_59 = tmpvar_60; - float tmpvar_61; - tmpvar_61 = 0.3; - fBranchAmp_58 = tmpvar_61; - float tmpvar_62; - tmpvar_62 = dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)); - float tmpvar_63; - tmpvar_63 = tmpvar_62; - fObjPhase_57 = tmpvar_63; - float tmpvar_64; - tmpvar_64 = (fObjPhase_57 + animParams_50.x); - fBranchPhase_56 = tmpvar_64; - vec3 tmpvar_65; - tmpvar_65 = vec3((animParams_50.y + fBranchPhase_56)); - float tmpvar_66; - tmpvar_66 = dot (pos_48.xyz, tmpvar_65); - float tmpvar_67; - tmpvar_67 = tmpvar_66; - fVtxPhase_55 = tmpvar_67; - vec2 tmpvar_68; - tmpvar_68.x = fVtxPhase_55; - tmpvar_68.y = fBranchPhase_56; - vec2 tmpvar_69; - tmpvar_69 = (_TimeX + tmpvar_68); - vWavesIn_54 = tmpvar_69; - vec4 tmpvar_70; - tmpvar_70 = fract ((vWavesIn_54.xxyy * vec4(1.975, 0.793, 0.375, 0.193))); - vec4 tmpvar_71; - tmpvar_71 = ((tmpvar_70 * 2.0) - 1.0); - vWaves_53 = tmpvar_71; - vec4 tmpvar_72; - tmpvar_72 = SmoothTriangleWave (vWaves_53); - vec4 tmpvar_73; - tmpvar_73 = tmpvar_72; - vWaves_53 = tmpvar_73; - vec2 tmpvar_74; - tmpvar_74 = (vWaves_53.xz + vWaves_53.yw); - vWavesSum_52 = tmpvar_74; - vec3 tmpvar_75; - tmpvar_75 = ((animParams_50.y * fDetailAmp_59) * normal_49.xyz); - bend_51 = tmpvar_75; - float tmpvar_76; - tmpvar_76 = (animParams_50.w * fBranchAmp_58); - bend_51.y = vec2(tmpvar_76).y; - vec3 tmpvar_77; - tmpvar_77 = (pos_48.xyz + (( - (vWavesSum_52.xyx * bend_51) - + - ((_Wind.xyz * vWavesSum_52.y) * animParams_50.w) - ) * _Wind.w)); - pos_48.xyz = tmpvar_77.xyz.xyz; - vec3 tmpvar_78; - tmpvar_78 = (pos_48.xyz + (animParams_50.z * _Wind.xyz)); - pos_48.xyz = tmpvar_78.xyz.xyz; - return pos_48; -} - -void TreeVertLeaf ( - inout appdata_full v_79 -) -{ - ExpandBillboard (gl_ModelViewMatrixInverseTranspose, v_79.vertex, v_79.normal, v_79.tangent); - vec3 tmpvar_80; - tmpvar_80 = (v_79.vertex.xyz * _Scale.xyz); - v_79.vertex.xyz = tmpvar_80.xyz.xyz; - vec4 tmpvar_81; - tmpvar_81.xy = v_79.color.xy.xy; - tmpvar_81.zw = v_79.texcoord1.xy.xy; - vec4 tmpvar_82; - tmpvar_82 = AnimateVertex (v_79.vertex, v_79.normal, tmpvar_81); - vec4 tmpvar_83; - tmpvar_83 = tmpvar_82; - v_79.vertex = tmpvar_83; - vec4 tmpvar_84; - tmpvar_84 = Squash (v_79.vertex); - vec4 tmpvar_85; - tmpvar_85 = tmpvar_84; - v_79.vertex = tmpvar_85; - vec4 tmpvar_86; - tmpvar_86.xyz = (v_79.color.w * _Color.xyz).xyz; - tmpvar_86.w = _Color.w; - vec4 tmpvar_87; - tmpvar_87 = tmpvar_86; - v_79.color = tmpvar_87; - vec3 tmpvar_88; - tmpvar_88 = normalize (v_79.normal); - vec3 tmpvar_89; - tmpvar_89 = tmpvar_88; - v_79.normal = tmpvar_89; - vec3 tmpvar_90; - tmpvar_90 = normalize (v_79.tangent.xyz); - vec3 tmpvar_91; - tmpvar_91 = tmpvar_90; - v_79.tangent.xyz = tmpvar_91.xyz.xyz; -} - -void PositionFog ( - in vec4 v_92, - out vec4 pos_93, - out float fog_94 -) -{ - vec4 tmpvar_95; - tmpvar_95 = (gl_ModelViewProjectionMatrix * v_92); - pos_93 = tmpvar_95; - float tmpvar_96; - tmpvar_96 = pos_93.z; - fog_94 = tmpvar_96; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_97 -) -{ - vec3 objSpaceCameraPos_98; - vec4 tmpvar_99; - tmpvar_99.w = 1.0; - tmpvar_99.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_100; - tmpvar_100 = ((_World2Object * tmpvar_99).xyz * unity_Scale.w); - objSpaceCameraPos_98 = tmpvar_100; - return (objSpaceCameraPos_98 - v_97.xyz); -} - -vec3 ObjSpaceLightDir ( - in vec4 v_101 -) -{ - vec3 objSpaceLightPos_102; - vec3 tmpvar_103; - tmpvar_103 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_102 = tmpvar_103; - return objSpaceLightPos_102.xyz; -} - -v2f_surf vert_surf ( - in appdata_full v_104 -) -{ - mat3 rotation_105; - vec3 binormal_106; - v2f_surf o_107; - TreeVertLeaf (v_104); - PositionFog (v_104.vertex, o_107.pos, o_107.fog); - vec2 tmpvar_108; - tmpvar_108 = ((v_104.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_107.hip_pack0 = tmpvar_108.xy.xy; - vec4 tmpvar_109; - tmpvar_109 = v_104.color; - o_107.lop_color = tmpvar_109; - vec3 tmpvar_110; - tmpvar_110 = cross (v_104.normal, v_104.tangent.xyz); - vec3 tmpvar_111; - tmpvar_111 = (tmpvar_110 * v_104.tangent.w); - binormal_106 = tmpvar_111; - mat3 tmpvar_112; - float tmpvar_113; - tmpvar_113 = v_104.tangent.x; - tmpvar_112[0].x = tmpvar_113; - float tmpvar_114; - tmpvar_114 = binormal_106.x; - tmpvar_112[0].y = tmpvar_114; - float tmpvar_115; - tmpvar_115 = v_104.normal.x; - tmpvar_112[0].z = tmpvar_115; - float tmpvar_116; - tmpvar_116 = v_104.tangent.y; - tmpvar_112[1].x = tmpvar_116; - float tmpvar_117; - tmpvar_117 = binormal_106.y; - tmpvar_112[1].y = tmpvar_117; - float tmpvar_118; - tmpvar_118 = v_104.normal.y; - tmpvar_112[1].z = tmpvar_118; - float tmpvar_119; - tmpvar_119 = v_104.tangent.z; - tmpvar_112[2].x = tmpvar_119; - float tmpvar_120; - tmpvar_120 = binormal_106.z; - tmpvar_112[2].y = tmpvar_120; - float tmpvar_121; - tmpvar_121 = v_104.normal.z; - tmpvar_112[2].z = tmpvar_121; - mat3 tmpvar_122; - tmpvar_122 = tmpvar_112; - rotation_105 = tmpvar_122; - vec3 tmpvar_123; - tmpvar_123 = ObjSpaceLightDir (v_104.vertex); - vec3 tmpvar_124; - tmpvar_124 = (rotation_105 * tmpvar_123); - o_107.lightDir = tmpvar_124; - vec3 tmpvar_125; - tmpvar_125 = ObjSpaceViewDir (v_104.vertex); - vec3 tmpvar_126; - tmpvar_126 = (rotation_105 * tmpvar_125); - o_107.viewDir = tmpvar_126; - return o_107; -} - -void main () -{ - appdata_full xlt_v_127; - v2f_surf xl_retval_128; - vec4 tmpvar_129; - tmpvar_129 = gl_Vertex.xyzw; - vec4 tmpvar_130; - tmpvar_130 = tmpvar_129; - xlt_v_127.vertex = tmpvar_130; - vec4 tmpvar_131; - tmpvar_131 = TANGENT.xyzw; - vec4 tmpvar_132; - tmpvar_132 = tmpvar_131; - xlt_v_127.tangent = tmpvar_132; - vec3 tmpvar_133; - tmpvar_133 = gl_Normal.xyz; - vec3 tmpvar_134; - tmpvar_134 = tmpvar_133; - xlt_v_127.normal = tmpvar_134; - vec4 tmpvar_135; - tmpvar_135 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_136; - tmpvar_136 = tmpvar_135; - xlt_v_127.texcoord = tmpvar_136; - vec4 tmpvar_137; - tmpvar_137 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_138; - tmpvar_138 = tmpvar_137; - xlt_v_127.texcoord1 = tmpvar_138; - vec4 tmpvar_139; - tmpvar_139 = gl_Color.xyzw; - vec4 tmpvar_140; - tmpvar_140 = tmpvar_139; - xlt_v_127.color = tmpvar_140; - v2f_surf tmpvar_141; - tmpvar_141 = vert_surf (xlt_v_127); - v2f_surf tmpvar_142; - tmpvar_142 = tmpvar_141; - xl_retval_128 = tmpvar_142; - vec4 tmpvar_143; - tmpvar_143 = xl_retval_128.pos.xyzw; - vec4 tmpvar_144; - tmpvar_144 = tmpvar_143; - gl_Position = tmpvar_144; - vec4 tmpvar_145; - tmpvar_145.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_145.x = xl_retval_128.fog; - vec4 tmpvar_146; - tmpvar_146 = tmpvar_145; - xlv_FOG = tmpvar_146; - vec4 tmpvar_147; - tmpvar_147.zw = vec2(0.0, 0.0); - tmpvar_147.xy = xl_retval_128.hip_pack0.xy; - vec4 tmpvar_148; - tmpvar_148 = tmpvar_147; - gl_TexCoord[0] = tmpvar_148; - vec4 tmpvar_149; - tmpvar_149 = xl_retval_128.lop_color.xyzw; - vec4 tmpvar_150; - tmpvar_150 = tmpvar_149; - gl_FrontColor = tmpvar_150; - vec4 tmpvar_151; - tmpvar_151.w = 0.0; - tmpvar_151.xyz = xl_retval_128.lightDir.xyz; - vec4 tmpvar_152; - tmpvar_152 = tmpvar_151; - gl_TexCoord[1] = tmpvar_152; - vec4 tmpvar_153; - tmpvar_153.w = 0.0; - tmpvar_153.xyz = xl_retval_128.viewDir.xyz; - vec4 tmpvar_154; - tmpvar_154 = tmpvar_153; - gl_TexCoord[2] = tmpvar_154; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt index 25cbe1895..1289993f1 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt @@ -14,110 +14,135 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; + vec3 binormal_1; vec4 tmpvar_2; - float tmpvar_3; - tmpvar_3 = (1.0 - abs(TANGENT.w)); - vec4 tmpvar_4; - tmpvar_4.w = 0.0; - tmpvar_4.xyz = gl_Normal; - vec4 tmpvar_5; - tmpvar_5.yw = vec2(0.0, 0.0); - tmpvar_5.x = gl_Normal.z; - tmpvar_5.z = -(gl_Normal.x); + vec4 tmpvar_3; + vec4 pos_4; + float isBillboard_5; + isBillboard_5 = (1.0 - abs(TANGENT.w)); vec4 tmpvar_6; - tmpvar_6 = (gl_Vertex + ((TANGENT * gl_ModelViewMatrixInverseTranspose) * tmpvar_3)); - vec3 tmpvar_7; - tmpvar_7 = mix (gl_Normal, normalize((tmpvar_4 * gl_ModelViewMatrixInverseTranspose)).xyz, vec3(tmpvar_3)); - vec4 tmpvar_8; - tmpvar_8.w = -1.0; - tmpvar_8.xyz = normalize((tmpvar_5 * gl_ModelViewMatrixInverseTranspose)).xyz; + tmpvar_6.w = 0.0; + tmpvar_6.xyz = gl_Normal; + vec4 tmpvar_7; + tmpvar_7.yw = vec2(0.0, 0.0); + tmpvar_7.x = gl_Normal.z; + tmpvar_7.z = -(gl_Normal.x); + pos_4 = (gl_Vertex + ((TANGENT * gl_ModelViewMatrixInverseTranspose) * isBillboard_5)); + vec3 tmpvar_8; + tmpvar_8 = mix (gl_Normal, normalize((tmpvar_6 * gl_ModelViewMatrixInverseTranspose)).xyz, vec3(isBillboard_5)); vec4 tmpvar_9; - tmpvar_9 = mix (TANGENT, tmpvar_8, vec4(tmpvar_3)); - tmpvar_1.w = tmpvar_6.w; - tmpvar_2.w = tmpvar_9.w; - tmpvar_1.xyz = (tmpvar_6.xyz * _Scale.xyz); - vec4 pos_10; - pos_10.w = tmpvar_1.w; - vec3 bend_11; - float tmpvar_12; - tmpvar_12 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x); - vec2 tmpvar_13; - tmpvar_13.x = dot (tmpvar_1.xyz, vec3((gl_Color.y + tmpvar_12))); - tmpvar_13.y = tmpvar_12; - vec4 tmpvar_14; - tmpvar_14 = abs((( - fract(((( - fract(((_TimeX + tmpvar_13).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) - * 2.0) - 1.0) + 0.5)) - * 2.0) - 1.0)); - vec4 tmpvar_15; - tmpvar_15 = ((tmpvar_14 * tmpvar_14) * (3.0 - (2.0 * tmpvar_14))); + tmpvar_9.w = -1.0; + tmpvar_9.xyz = normalize((tmpvar_7 * gl_ModelViewMatrixInverseTranspose)).xyz; + vec4 tmpvar_10; + tmpvar_10 = mix (TANGENT, tmpvar_9, vec4(isBillboard_5)); + tmpvar_2.w = pos_4.w; + tmpvar_3.w = tmpvar_10.w; + tmpvar_2.xyz = (pos_4.xyz * _Scale.xyz); + vec4 pos_11; + pos_11.w = tmpvar_2.w; + vec3 bend_12; + vec2 vWavesSum_13; + vec4 vWaves_14; + float fBranchPhase_15; + fBranchPhase_15 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x); vec2 tmpvar_16; - tmpvar_16 = (tmpvar_15.xz + tmpvar_15.yw); - bend_11.xz = ((gl_Color.y * 0.1) * tmpvar_7).xz; - bend_11.y = (gl_MultiTexCoord1.y * 0.3); - pos_10.xyz = (tmpvar_1.xyz + (( - (tmpvar_16.xyx * bend_11) + tmpvar_16.x = dot (tmpvar_2.xyz, vec3((gl_Color.y + fBranchPhase_15))); + tmpvar_16.y = fBranchPhase_15; + vWaves_14 = ((fract( + ((_TimeX + tmpvar_16).xxyy * vec4(1.975, 0.793, 0.375, 0.193)) + ) * 2.0) - 1.0); + vec4 tmpvar_17; + tmpvar_17 = abs((( + fract((vWaves_14 + 0.5)) + * 2.0) - 1.0)); + vec4 tmpvar_18; + tmpvar_18 = ((tmpvar_17 * tmpvar_17) * (3.0 - (2.0 * tmpvar_17))); + vWaves_14 = tmpvar_18; + vWavesSum_13 = (tmpvar_18.xz + tmpvar_18.yw); + bend_12.xz = ((gl_Color.y * 0.1) * tmpvar_8).xz; + bend_12.y = (gl_MultiTexCoord1.y * 0.3); + pos_11.xyz = (tmpvar_2.xyz + (( + (vWavesSum_13.xyx * bend_12) + - ((_Wind.xyz * tmpvar_16.y) * gl_MultiTexCoord1.y) + ((_Wind.xyz * vWavesSum_13.y) * gl_MultiTexCoord1.y) ) * _Wind.w)); - pos_10.xyz = (pos_10.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); - vec3 tmpvar_17; - tmpvar_17.xz = vec2(0.0, 0.0); - tmpvar_17.y = _SquashPlaneNormal.w; - vec3 tmpvar_18; - tmpvar_18 = mix ((pos_10.xyz + ( - dot (_SquashPlaneNormal.xyz, (tmpvar_17 - pos_10.xyz)) - * _SquashPlaneNormal.xyz)), pos_10.xyz, vec3(_SquashAmount)); - vec4 tmpvar_19; - tmpvar_19.w = 1.0; - tmpvar_19.xyz = tmpvar_18; - tmpvar_1 = tmpvar_19; - vec4 tmpvar_20; - tmpvar_20.xyz = (gl_Color.w * _Color.xyz); - tmpvar_20.w = _Color.w; - vec3 tmpvar_21; - tmpvar_21 = normalize(tmpvar_7); - tmpvar_2.xyz = normalize(tmpvar_9.xyz); + pos_11.xyz = (pos_11.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); + vec3 tmpvar_19; + tmpvar_19.xz = vec2(0.0, 0.0); + tmpvar_19.y = _SquashPlaneNormal.w; + vec3 tmpvar_20; + tmpvar_20 = mix ((pos_11.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_19 - pos_11.xyz)) + * _SquashPlaneNormal.xyz)), pos_11.xyz, vec3(_SquashAmount)); + vec4 tmpvar_21; + tmpvar_21.w = 1.0; + tmpvar_21.xyz = tmpvar_20; + tmpvar_2 = tmpvar_21; vec4 tmpvar_22; - tmpvar_22 = (gl_ModelViewProjectionMatrix * tmpvar_19); + tmpvar_22.xyz = (gl_Color.w * _Color.xyz); + tmpvar_22.w = _Color.w; vec3 tmpvar_23; - tmpvar_23 = (((tmpvar_21.yzx * tmpvar_2.zxy) - (tmpvar_21.zxy * tmpvar_2.yzx)) * tmpvar_9.w); - mat3 tmpvar_24; - tmpvar_24[0].x = tmpvar_2.x; - tmpvar_24[0].y = tmpvar_23.x; - tmpvar_24[0].z = tmpvar_21.x; - tmpvar_24[1].x = tmpvar_2.y; - tmpvar_24[1].y = tmpvar_23.y; - tmpvar_24[1].z = tmpvar_21.y; - tmpvar_24[2].x = tmpvar_2.z; - tmpvar_24[2].y = tmpvar_23.z; - tmpvar_24[2].z = tmpvar_21.z; - vec4 tmpvar_25; - tmpvar_25.w = 1.0; - tmpvar_25.xyz = _WorldSpaceCameraPos; - gl_Position = tmpvar_22; + tmpvar_23 = normalize(tmpvar_8); + tmpvar_3.xyz = normalize(tmpvar_10.xyz); + vec4 pos_24; + pos_24 = (gl_ModelViewProjectionMatrix * tmpvar_21); + binormal_1 = (((tmpvar_23.yzx * tmpvar_3.zxy) - (tmpvar_23.zxy * tmpvar_3.yzx)) * tmpvar_10.w); + mat3 tmpvar_25; + tmpvar_25[0].x = tmpvar_3.x; + tmpvar_25[0].y = binormal_1.x; + tmpvar_25[0].z = tmpvar_23.x; + tmpvar_25[1].x = tmpvar_3.y; + tmpvar_25[1].y = binormal_1.y; + tmpvar_25[1].z = tmpvar_23.y; + tmpvar_25[2].x = tmpvar_3.z; + tmpvar_25[2].y = binormal_1.z; + tmpvar_25[2].z = tmpvar_23.z; vec4 tmpvar_26; - tmpvar_26.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_26.x = tmpvar_22.z; - xlv_FOG = tmpvar_26; + tmpvar_26.w = 1.0; + tmpvar_26.xyz = _WorldSpaceCameraPos; + gl_Position = pos_24; vec4 tmpvar_27; - tmpvar_27.zw = vec2(0.0, 0.0); - tmpvar_27.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_27; - gl_FrontColor = tmpvar_20; + tmpvar_27.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_27.x = pos_24.z; + xlv_FOG = tmpvar_27; vec4 tmpvar_28; - tmpvar_28.w = 0.0; - tmpvar_28.xyz = (tmpvar_24 * (_World2Object * _WorldSpaceLightPos0).xyz); - gl_TexCoord[1] = tmpvar_28; + tmpvar_28.zw = vec2(0.0, 0.0); + tmpvar_28.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_28; + gl_FrontColor = tmpvar_22; vec4 tmpvar_29; tmpvar_29.w = 0.0; - tmpvar_29.xyz = (tmpvar_24 * (( - (_World2Object * tmpvar_25) - .xyz * unity_Scale.w) - tmpvar_18)); - gl_TexCoord[2] = tmpvar_29; + tmpvar_29.xyz = (tmpvar_25 * (_World2Object * _WorldSpaceLightPos0).xyz); + gl_TexCoord[1] = tmpvar_29; + vec4 tmpvar_30; + tmpvar_30.w = 0.0; + tmpvar_30.xyz = (tmpvar_25 * (( + (_World2Object * tmpvar_26) + .xyz * unity_Scale.w) - tmpvar_20)); + gl_TexCoord[2] = tmpvar_30; } -// inputs: 6, stats: 74 alu 0 tex 0 flow +// stats: 74 alu 0 tex 0 flow +// inputs: 6 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #2: gl_Color (high float) 4x1 [-1] loc 3 +// #3: gl_Normal (high float) 3x1 [-1] loc 2 +// #4: gl_Vertex (high float) 4x1 [-1] loc 0 +// #5: TANGENT (high float) 4x1 [-1] +// uniforms: 14 (total size: 0) +// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] +// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #2: _Color (high float) 4x1 [-1] +// #3: _MainTex_ST (high float) 4x1 [-1] +// #4: _Object2World (high float) 4x4 [-1] +// #5: _Scale (high float) 4x1 [-1] +// #6: _SquashAmount (high float) 1x1 [-1] +// #7: _SquashPlaneNormal (high float) 4x1 [-1] +// #8: _TimeX (high float) 1x1 [-1] +// #9: _Wind (high float) 4x1 [-1] +// #10: _World2Object (high float) 4x4 [-1] +// #11: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #12: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #13: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-ir.txt deleted file mode 100644 index 916639786..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-ir.txt +++ /dev/null @@ -1,458 +0,0 @@ -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 lop_color; - vec3 lightDir; - vec3 viewDir; - vec3 _LightCoord; -}; -uniform vec4 _Color; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _Scale; -uniform float _SquashAmount; -uniform vec4 _SquashPlaneNormal; -uniform float _TimeX; -uniform vec4 _Wind; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -vec4 Squash ( - in vec4 pos_1 -) -{ - vec3 planeNormal_2; - vec3 planePoint_3; - vec3 projectedVertex_4; - vec3 tmpvar_5; - tmpvar_5 = pos_1.xyz; - projectedVertex_4 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6.xz = vec2(0.0, 0.0); - tmpvar_6.y = _SquashPlaneNormal.w; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_6; - planePoint_3 = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = _SquashPlaneNormal.xyz; - planeNormal_2 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = pos_1.xyz; - float tmpvar_10; - tmpvar_10 = dot (planeNormal_2, (planePoint_3 - tmpvar_9)); - vec3 tmpvar_11; - tmpvar_11 = (projectedVertex_4 + (tmpvar_10 * planeNormal_2)); - projectedVertex_4 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = vec3(_SquashAmount); - vec3 tmpvar_13; - tmpvar_13 = mix (projectedVertex_4, pos_1.xyz, tmpvar_12); - vec4 tmpvar_14; - tmpvar_14.w = 1.0; - tmpvar_14.xyz = tmpvar_13.xyz; - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - pos_1 = tmpvar_15; - return pos_1; -} - -void ExpandBillboard ( - in mat4 mat_16, - inout vec4 pos_17, - inout vec3 normal_18, - inout vec4 tangent_19 -) -{ - vec3 tanb_20; - vec3 norb_21; - float isBillboard_22; - float tmpvar_23; - tmpvar_23 = abs (tangent_19.w); - float tmpvar_24; - tmpvar_24 = (1.0 - tmpvar_23); - isBillboard_22 = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25.w = 0.0; - tmpvar_25.xyz = normal_18.xyz; - vec4 tmpvar_26; - tmpvar_26 = normalize ((tmpvar_25 * mat_16)); - vec3 tmpvar_27; - tmpvar_27 = tmpvar_26.xyz; - vec3 tmpvar_28; - tmpvar_28 = tmpvar_27; - norb_21 = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29.yw = vec2(0.0, 0.0); - tmpvar_29.x = normal_18.z; - tmpvar_29.z = -(normal_18.x); - vec4 tmpvar_30; - tmpvar_30 = normalize ((tmpvar_29 * mat_16)); - vec3 tmpvar_31; - tmpvar_31 = tmpvar_30.xyz; - vec3 tmpvar_32; - tmpvar_32 = tmpvar_31; - tanb_20 = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = (pos_17 + ((tangent_19 * mat_16) * isBillboard_22)); - pos_17 = tmpvar_33; - vec3 tmpvar_34; - tmpvar_34 = vec3(isBillboard_22); - vec3 tmpvar_35; - tmpvar_35 = mix (normal_18, norb_21, tmpvar_34); - vec3 tmpvar_36; - tmpvar_36 = tmpvar_35; - normal_18 = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37.w = -1.0; - tmpvar_37.xyz = tanb_20.xyz; - vec4 tmpvar_38; - tmpvar_38 = vec4(isBillboard_22); - vec4 tmpvar_39; - tmpvar_39 = mix (tangent_19, tmpvar_37, tmpvar_38); - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - tangent_19 = tmpvar_40; -} - -vec4 TriangleWave ( - in vec4 x_41 -) -{ - vec4 tmpvar_42; - tmpvar_42 = fract ((x_41 + 0.5)); - vec4 tmpvar_43; - tmpvar_43 = abs (((tmpvar_42 * 2.0) - 1.0)); - return tmpvar_43; -} - -vec4 SmoothCurve ( - in vec4 x_44 -) -{ - return ((x_44 * x_44) * (3.0 - (2.0 * x_44))); -} - -vec4 SmoothTriangleWave ( - in vec4 x_45 -) -{ - vec4 tmpvar_46; - tmpvar_46 = TriangleWave (x_45); - vec4 tmpvar_47; - tmpvar_47 = SmoothCurve (tmpvar_46); - return tmpvar_47; -} - -vec4 AnimateVertex ( - in vec4 pos_48, - in vec3 normal_49, - in vec4 animParams_50 -) -{ - vec3 bend_51; - vec2 vWavesSum_52; - vec4 vWaves_53; - vec2 vWavesIn_54; - float fVtxPhase_55; - float fBranchPhase_56; - float fObjPhase_57; - float fBranchAmp_58; - float fDetailAmp_59; - float tmpvar_60; - tmpvar_60 = 0.1; - fDetailAmp_59 = tmpvar_60; - float tmpvar_61; - tmpvar_61 = 0.3; - fBranchAmp_58 = tmpvar_61; - float tmpvar_62; - tmpvar_62 = dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)); - float tmpvar_63; - tmpvar_63 = tmpvar_62; - fObjPhase_57 = tmpvar_63; - float tmpvar_64; - tmpvar_64 = (fObjPhase_57 + animParams_50.x); - fBranchPhase_56 = tmpvar_64; - vec3 tmpvar_65; - tmpvar_65 = vec3((animParams_50.y + fBranchPhase_56)); - float tmpvar_66; - tmpvar_66 = dot (pos_48.xyz, tmpvar_65); - float tmpvar_67; - tmpvar_67 = tmpvar_66; - fVtxPhase_55 = tmpvar_67; - vec2 tmpvar_68; - tmpvar_68.x = fVtxPhase_55; - tmpvar_68.y = fBranchPhase_56; - vec2 tmpvar_69; - tmpvar_69 = (_TimeX + tmpvar_68); - vWavesIn_54 = tmpvar_69; - vec4 tmpvar_70; - tmpvar_70 = fract ((vWavesIn_54.xxyy * vec4(1.975, 0.793, 0.375, 0.193))); - vec4 tmpvar_71; - tmpvar_71 = ((tmpvar_70 * 2.0) - 1.0); - vWaves_53 = tmpvar_71; - vec4 tmpvar_72; - tmpvar_72 = SmoothTriangleWave (vWaves_53); - vec4 tmpvar_73; - tmpvar_73 = tmpvar_72; - vWaves_53 = tmpvar_73; - vec2 tmpvar_74; - tmpvar_74 = (vWaves_53.xz + vWaves_53.yw); - vWavesSum_52 = tmpvar_74; - vec3 tmpvar_75; - tmpvar_75 = ((animParams_50.y * fDetailAmp_59) * normal_49.xyz); - bend_51 = tmpvar_75; - float tmpvar_76; - tmpvar_76 = (animParams_50.w * fBranchAmp_58); - bend_51.y = vec2(tmpvar_76).y; - vec3 tmpvar_77; - tmpvar_77 = (pos_48.xyz + (( - (vWavesSum_52.xyx * bend_51) - + - ((_Wind.xyz * vWavesSum_52.y) * animParams_50.w) - ) * _Wind.w)); - pos_48.xyz = tmpvar_77.xyz.xyz; - vec3 tmpvar_78; - tmpvar_78 = (pos_48.xyz + (animParams_50.z * _Wind.xyz)); - pos_48.xyz = tmpvar_78.xyz.xyz; - return pos_48; -} - -void TreeVertLeaf ( - inout appdata_full v_79 -) -{ - ExpandBillboard (gl_ModelViewMatrixInverseTranspose, v_79.vertex, v_79.normal, v_79.tangent); - vec3 tmpvar_80; - tmpvar_80 = (v_79.vertex.xyz * _Scale.xyz); - v_79.vertex.xyz = tmpvar_80.xyz.xyz; - vec4 tmpvar_81; - tmpvar_81.xy = v_79.color.xy.xy; - tmpvar_81.zw = v_79.texcoord1.xy.xy; - vec4 tmpvar_82; - tmpvar_82 = AnimateVertex (v_79.vertex, v_79.normal, tmpvar_81); - vec4 tmpvar_83; - tmpvar_83 = tmpvar_82; - v_79.vertex = tmpvar_83; - vec4 tmpvar_84; - tmpvar_84 = Squash (v_79.vertex); - vec4 tmpvar_85; - tmpvar_85 = tmpvar_84; - v_79.vertex = tmpvar_85; - vec4 tmpvar_86; - tmpvar_86.xyz = (v_79.color.w * _Color.xyz).xyz; - tmpvar_86.w = _Color.w; - vec4 tmpvar_87; - tmpvar_87 = tmpvar_86; - v_79.color = tmpvar_87; - vec3 tmpvar_88; - tmpvar_88 = normalize (v_79.normal); - vec3 tmpvar_89; - tmpvar_89 = tmpvar_88; - v_79.normal = tmpvar_89; - vec3 tmpvar_90; - tmpvar_90 = normalize (v_79.tangent.xyz); - vec3 tmpvar_91; - tmpvar_91 = tmpvar_90; - v_79.tangent.xyz = tmpvar_91.xyz.xyz; -} - -void PositionFog ( - in vec4 v_92, - out vec4 pos_93, - out float fog_94 -) -{ - vec4 tmpvar_95; - tmpvar_95 = (gl_ModelViewProjectionMatrix * v_92); - pos_93 = tmpvar_95; - float tmpvar_96; - tmpvar_96 = pos_93.z; - fog_94 = tmpvar_96; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_97 -) -{ - vec3 objSpaceCameraPos_98; - vec4 tmpvar_99; - tmpvar_99.w = 1.0; - tmpvar_99.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_100; - tmpvar_100 = ((_World2Object * tmpvar_99).xyz * unity_Scale.w); - objSpaceCameraPos_98 = tmpvar_100; - return (objSpaceCameraPos_98 - v_97.xyz); -} - -vec3 ObjSpaceLightDir ( - in vec4 v_101 -) -{ - vec3 objSpaceLightPos_102; - vec3 tmpvar_103; - tmpvar_103 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_102 = tmpvar_103; - return ((objSpaceLightPos_102.xyz * unity_Scale.w) - v_101.xyz); -} - -v2f_surf vert_surf ( - in appdata_full v_104 -) -{ - mat3 rotation_105; - vec3 binormal_106; - v2f_surf o_107; - TreeVertLeaf (v_104); - PositionFog (v_104.vertex, o_107.pos, o_107.fog); - vec2 tmpvar_108; - tmpvar_108 = ((v_104.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_107.hip_pack0 = tmpvar_108.xy.xy; - vec4 tmpvar_109; - tmpvar_109 = v_104.color; - o_107.lop_color = tmpvar_109; - vec3 tmpvar_110; - tmpvar_110 = cross (v_104.normal, v_104.tangent.xyz); - vec3 tmpvar_111; - tmpvar_111 = (tmpvar_110 * v_104.tangent.w); - binormal_106 = tmpvar_111; - mat3 tmpvar_112; - float tmpvar_113; - tmpvar_113 = v_104.tangent.x; - tmpvar_112[0].x = tmpvar_113; - float tmpvar_114; - tmpvar_114 = binormal_106.x; - tmpvar_112[0].y = tmpvar_114; - float tmpvar_115; - tmpvar_115 = v_104.normal.x; - tmpvar_112[0].z = tmpvar_115; - float tmpvar_116; - tmpvar_116 = v_104.tangent.y; - tmpvar_112[1].x = tmpvar_116; - float tmpvar_117; - tmpvar_117 = binormal_106.y; - tmpvar_112[1].y = tmpvar_117; - float tmpvar_118; - tmpvar_118 = v_104.normal.y; - tmpvar_112[1].z = tmpvar_118; - float tmpvar_119; - tmpvar_119 = v_104.tangent.z; - tmpvar_112[2].x = tmpvar_119; - float tmpvar_120; - tmpvar_120 = binormal_106.z; - tmpvar_112[2].y = tmpvar_120; - float tmpvar_121; - tmpvar_121 = v_104.normal.z; - tmpvar_112[2].z = tmpvar_121; - mat3 tmpvar_122; - tmpvar_122 = tmpvar_112; - rotation_105 = tmpvar_122; - vec3 tmpvar_123; - tmpvar_123 = ObjSpaceLightDir (v_104.vertex); - vec3 tmpvar_124; - tmpvar_124 = (rotation_105 * tmpvar_123); - o_107.lightDir = tmpvar_124; - vec3 tmpvar_125; - tmpvar_125 = ObjSpaceViewDir (v_104.vertex); - vec3 tmpvar_126; - tmpvar_126 = (rotation_105 * tmpvar_125); - o_107.viewDir = tmpvar_126; - vec3 tmpvar_127; - tmpvar_127 = (_LightMatrix0 * (_Object2World * v_104.vertex)).xyz; - o_107._LightCoord = tmpvar_127; - return o_107; -} - -void main () -{ - appdata_full xlt_v_128; - v2f_surf xl_retval_129; - vec4 tmpvar_130; - tmpvar_130 = gl_Vertex.xyzw; - vec4 tmpvar_131; - tmpvar_131 = tmpvar_130; - xlt_v_128.vertex = tmpvar_131; - vec4 tmpvar_132; - tmpvar_132 = TANGENT.xyzw; - vec4 tmpvar_133; - tmpvar_133 = tmpvar_132; - xlt_v_128.tangent = tmpvar_133; - vec3 tmpvar_134; - tmpvar_134 = gl_Normal.xyz; - vec3 tmpvar_135; - tmpvar_135 = tmpvar_134; - xlt_v_128.normal = tmpvar_135; - vec4 tmpvar_136; - tmpvar_136 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_137; - tmpvar_137 = tmpvar_136; - xlt_v_128.texcoord = tmpvar_137; - vec4 tmpvar_138; - tmpvar_138 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_139; - tmpvar_139 = tmpvar_138; - xlt_v_128.texcoord1 = tmpvar_139; - vec4 tmpvar_140; - tmpvar_140 = gl_Color.xyzw; - vec4 tmpvar_141; - tmpvar_141 = tmpvar_140; - xlt_v_128.color = tmpvar_141; - v2f_surf tmpvar_142; - tmpvar_142 = vert_surf (xlt_v_128); - v2f_surf tmpvar_143; - tmpvar_143 = tmpvar_142; - xl_retval_129 = tmpvar_143; - vec4 tmpvar_144; - tmpvar_144 = xl_retval_129.pos.xyzw; - vec4 tmpvar_145; - tmpvar_145 = tmpvar_144; - gl_Position = tmpvar_145; - vec4 tmpvar_146; - tmpvar_146.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_146.x = xl_retval_129.fog; - vec4 tmpvar_147; - tmpvar_147 = tmpvar_146; - xlv_FOG = tmpvar_147; - vec4 tmpvar_148; - tmpvar_148.zw = vec2(0.0, 0.0); - tmpvar_148.xy = xl_retval_129.hip_pack0.xy; - vec4 tmpvar_149; - tmpvar_149 = tmpvar_148; - gl_TexCoord[0] = tmpvar_149; - vec4 tmpvar_150; - tmpvar_150 = xl_retval_129.lop_color.xyzw; - vec4 tmpvar_151; - tmpvar_151 = tmpvar_150; - gl_FrontColor = tmpvar_151; - vec4 tmpvar_152; - tmpvar_152.w = 0.0; - tmpvar_152.xyz = xl_retval_129.lightDir.xyz; - vec4 tmpvar_153; - tmpvar_153 = tmpvar_152; - gl_TexCoord[1] = tmpvar_153; - vec4 tmpvar_154; - tmpvar_154.w = 0.0; - tmpvar_154.xyz = xl_retval_129.viewDir.xyz; - vec4 tmpvar_155; - tmpvar_155 = tmpvar_154; - gl_TexCoord[2] = tmpvar_155; - vec4 tmpvar_156; - tmpvar_156.w = 0.0; - tmpvar_156.xyz = xl_retval_129._LightCoord.xyz; - vec4 tmpvar_157; - tmpvar_157 = tmpvar_156; - gl_TexCoord[3] = tmpvar_157; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt index 27635dfc2..1dbc26587 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt @@ -15,116 +15,142 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; + vec3 binormal_1; vec4 tmpvar_2; - float tmpvar_3; - tmpvar_3 = (1.0 - abs(TANGENT.w)); - vec4 tmpvar_4; - tmpvar_4.w = 0.0; - tmpvar_4.xyz = gl_Normal; - vec4 tmpvar_5; - tmpvar_5.yw = vec2(0.0, 0.0); - tmpvar_5.x = gl_Normal.z; - tmpvar_5.z = -(gl_Normal.x); + vec4 tmpvar_3; + vec4 pos_4; + float isBillboard_5; + isBillboard_5 = (1.0 - abs(TANGENT.w)); vec4 tmpvar_6; - tmpvar_6 = (gl_Vertex + ((TANGENT * gl_ModelViewMatrixInverseTranspose) * tmpvar_3)); - vec3 tmpvar_7; - tmpvar_7 = mix (gl_Normal, normalize((tmpvar_4 * gl_ModelViewMatrixInverseTranspose)).xyz, vec3(tmpvar_3)); - vec4 tmpvar_8; - tmpvar_8.w = -1.0; - tmpvar_8.xyz = normalize((tmpvar_5 * gl_ModelViewMatrixInverseTranspose)).xyz; + tmpvar_6.w = 0.0; + tmpvar_6.xyz = gl_Normal; + vec4 tmpvar_7; + tmpvar_7.yw = vec2(0.0, 0.0); + tmpvar_7.x = gl_Normal.z; + tmpvar_7.z = -(gl_Normal.x); + pos_4 = (gl_Vertex + ((TANGENT * gl_ModelViewMatrixInverseTranspose) * isBillboard_5)); + vec3 tmpvar_8; + tmpvar_8 = mix (gl_Normal, normalize((tmpvar_6 * gl_ModelViewMatrixInverseTranspose)).xyz, vec3(isBillboard_5)); vec4 tmpvar_9; - tmpvar_9 = mix (TANGENT, tmpvar_8, vec4(tmpvar_3)); - tmpvar_1.w = tmpvar_6.w; - tmpvar_2.w = tmpvar_9.w; - tmpvar_1.xyz = (tmpvar_6.xyz * _Scale.xyz); - vec4 pos_10; - pos_10.w = tmpvar_1.w; - vec3 bend_11; - float tmpvar_12; - tmpvar_12 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x); - vec2 tmpvar_13; - tmpvar_13.x = dot (tmpvar_1.xyz, vec3((gl_Color.y + tmpvar_12))); - tmpvar_13.y = tmpvar_12; - vec4 tmpvar_14; - tmpvar_14 = abs((( - fract(((( - fract(((_TimeX + tmpvar_13).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) - * 2.0) - 1.0) + 0.5)) - * 2.0) - 1.0)); - vec4 tmpvar_15; - tmpvar_15 = ((tmpvar_14 * tmpvar_14) * (3.0 - (2.0 * tmpvar_14))); + tmpvar_9.w = -1.0; + tmpvar_9.xyz = normalize((tmpvar_7 * gl_ModelViewMatrixInverseTranspose)).xyz; + vec4 tmpvar_10; + tmpvar_10 = mix (TANGENT, tmpvar_9, vec4(isBillboard_5)); + tmpvar_2.w = pos_4.w; + tmpvar_3.w = tmpvar_10.w; + tmpvar_2.xyz = (pos_4.xyz * _Scale.xyz); + vec4 pos_11; + pos_11.w = tmpvar_2.w; + vec3 bend_12; + vec2 vWavesSum_13; + vec4 vWaves_14; + float fBranchPhase_15; + fBranchPhase_15 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x); vec2 tmpvar_16; - tmpvar_16 = (tmpvar_15.xz + tmpvar_15.yw); - bend_11.xz = ((gl_Color.y * 0.1) * tmpvar_7).xz; - bend_11.y = (gl_MultiTexCoord1.y * 0.3); - pos_10.xyz = (tmpvar_1.xyz + (( - (tmpvar_16.xyx * bend_11) + tmpvar_16.x = dot (tmpvar_2.xyz, vec3((gl_Color.y + fBranchPhase_15))); + tmpvar_16.y = fBranchPhase_15; + vWaves_14 = ((fract( + ((_TimeX + tmpvar_16).xxyy * vec4(1.975, 0.793, 0.375, 0.193)) + ) * 2.0) - 1.0); + vec4 tmpvar_17; + tmpvar_17 = abs((( + fract((vWaves_14 + 0.5)) + * 2.0) - 1.0)); + vec4 tmpvar_18; + tmpvar_18 = ((tmpvar_17 * tmpvar_17) * (3.0 - (2.0 * tmpvar_17))); + vWaves_14 = tmpvar_18; + vWavesSum_13 = (tmpvar_18.xz + tmpvar_18.yw); + bend_12.xz = ((gl_Color.y * 0.1) * tmpvar_8).xz; + bend_12.y = (gl_MultiTexCoord1.y * 0.3); + pos_11.xyz = (tmpvar_2.xyz + (( + (vWavesSum_13.xyx * bend_12) + - ((_Wind.xyz * tmpvar_16.y) * gl_MultiTexCoord1.y) + ((_Wind.xyz * vWavesSum_13.y) * gl_MultiTexCoord1.y) ) * _Wind.w)); - pos_10.xyz = (pos_10.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); - vec3 tmpvar_17; - tmpvar_17.xz = vec2(0.0, 0.0); - tmpvar_17.y = _SquashPlaneNormal.w; - vec3 tmpvar_18; - tmpvar_18 = mix ((pos_10.xyz + ( - dot (_SquashPlaneNormal.xyz, (tmpvar_17 - pos_10.xyz)) - * _SquashPlaneNormal.xyz)), pos_10.xyz, vec3(_SquashAmount)); - vec4 tmpvar_19; - tmpvar_19.w = 1.0; - tmpvar_19.xyz = tmpvar_18; - tmpvar_1 = tmpvar_19; - vec4 tmpvar_20; - tmpvar_20.xyz = (gl_Color.w * _Color.xyz); - tmpvar_20.w = _Color.w; - vec3 tmpvar_21; - tmpvar_21 = normalize(tmpvar_7); - tmpvar_2.xyz = normalize(tmpvar_9.xyz); + pos_11.xyz = (pos_11.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); + vec3 tmpvar_19; + tmpvar_19.xz = vec2(0.0, 0.0); + tmpvar_19.y = _SquashPlaneNormal.w; + vec3 tmpvar_20; + tmpvar_20 = mix ((pos_11.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_19 - pos_11.xyz)) + * _SquashPlaneNormal.xyz)), pos_11.xyz, vec3(_SquashAmount)); + vec4 tmpvar_21; + tmpvar_21.w = 1.0; + tmpvar_21.xyz = tmpvar_20; + tmpvar_2 = tmpvar_21; vec4 tmpvar_22; - tmpvar_22 = (gl_ModelViewProjectionMatrix * tmpvar_19); + tmpvar_22.xyz = (gl_Color.w * _Color.xyz); + tmpvar_22.w = _Color.w; vec3 tmpvar_23; - tmpvar_23 = (((tmpvar_21.yzx * tmpvar_2.zxy) - (tmpvar_21.zxy * tmpvar_2.yzx)) * tmpvar_9.w); - mat3 tmpvar_24; - tmpvar_24[0].x = tmpvar_2.x; - tmpvar_24[0].y = tmpvar_23.x; - tmpvar_24[0].z = tmpvar_21.x; - tmpvar_24[1].x = tmpvar_2.y; - tmpvar_24[1].y = tmpvar_23.y; - tmpvar_24[1].z = tmpvar_21.y; - tmpvar_24[2].x = tmpvar_2.z; - tmpvar_24[2].y = tmpvar_23.z; - tmpvar_24[2].z = tmpvar_21.z; - vec4 tmpvar_25; - tmpvar_25.w = 1.0; - tmpvar_25.xyz = _WorldSpaceCameraPos; - gl_Position = tmpvar_22; + tmpvar_23 = normalize(tmpvar_8); + tmpvar_3.xyz = normalize(tmpvar_10.xyz); + vec4 pos_24; + pos_24 = (gl_ModelViewProjectionMatrix * tmpvar_21); + binormal_1 = (((tmpvar_23.yzx * tmpvar_3.zxy) - (tmpvar_23.zxy * tmpvar_3.yzx)) * tmpvar_10.w); + mat3 tmpvar_25; + tmpvar_25[0].x = tmpvar_3.x; + tmpvar_25[0].y = binormal_1.x; + tmpvar_25[0].z = tmpvar_23.x; + tmpvar_25[1].x = tmpvar_3.y; + tmpvar_25[1].y = binormal_1.y; + tmpvar_25[1].z = tmpvar_23.y; + tmpvar_25[2].x = tmpvar_3.z; + tmpvar_25[2].y = binormal_1.z; + tmpvar_25[2].z = tmpvar_23.z; vec4 tmpvar_26; - tmpvar_26.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_26.x = tmpvar_22.z; - xlv_FOG = tmpvar_26; + tmpvar_26.w = 1.0; + tmpvar_26.xyz = _WorldSpaceCameraPos; + gl_Position = pos_24; vec4 tmpvar_27; - tmpvar_27.zw = vec2(0.0, 0.0); - tmpvar_27.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_27; - gl_FrontColor = tmpvar_20; + tmpvar_27.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_27.x = pos_24.z; + xlv_FOG = tmpvar_27; vec4 tmpvar_28; - tmpvar_28.w = 0.0; - tmpvar_28.xyz = (tmpvar_24 * (( - (_World2Object * _WorldSpaceLightPos0) - .xyz * unity_Scale.w) - tmpvar_18)); - gl_TexCoord[1] = tmpvar_28; + tmpvar_28.zw = vec2(0.0, 0.0); + tmpvar_28.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_28; + gl_FrontColor = tmpvar_22; vec4 tmpvar_29; tmpvar_29.w = 0.0; - tmpvar_29.xyz = (tmpvar_24 * (( - (_World2Object * tmpvar_25) - .xyz * unity_Scale.w) - tmpvar_18)); - gl_TexCoord[2] = tmpvar_29; + tmpvar_29.xyz = (tmpvar_25 * (( + (_World2Object * _WorldSpaceLightPos0) + .xyz * unity_Scale.w) - tmpvar_20)); + gl_TexCoord[1] = tmpvar_29; vec4 tmpvar_30; tmpvar_30.w = 0.0; - tmpvar_30.xyz = (_LightMatrix0 * (_Object2World * tmpvar_19)).xyz; - gl_TexCoord[3] = tmpvar_30; + tmpvar_30.xyz = (tmpvar_25 * (( + (_World2Object * tmpvar_26) + .xyz * unity_Scale.w) - tmpvar_20)); + gl_TexCoord[2] = tmpvar_30; + vec4 tmpvar_31; + tmpvar_31.w = 0.0; + tmpvar_31.xyz = (_LightMatrix0 * (_Object2World * tmpvar_21)).xyz; + gl_TexCoord[3] = tmpvar_31; } -// inputs: 6, stats: 79 alu 0 tex 0 flow +// stats: 79 alu 0 tex 0 flow +// inputs: 6 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #2: gl_Color (high float) 4x1 [-1] loc 3 +// #3: gl_Normal (high float) 3x1 [-1] loc 2 +// #4: gl_Vertex (high float) 4x1 [-1] loc 0 +// #5: TANGENT (high float) 4x1 [-1] +// uniforms: 15 (total size: 0) +// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] +// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #2: _Color (high float) 4x1 [-1] +// #3: _LightMatrix0 (high float) 4x4 [-1] +// #4: _MainTex_ST (high float) 4x1 [-1] +// #5: _Object2World (high float) 4x4 [-1] +// #6: _Scale (high float) 4x1 [-1] +// #7: _SquashAmount (high float) 1x1 [-1] +// #8: _SquashPlaneNormal (high float) 4x1 [-1] +// #9: _TimeX (high float) 1x1 [-1] +// #10: _Wind (high float) 4x1 [-1] +// #11: _World2Object (high float) 4x4 [-1] +// #12: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #13: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #14: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Twist_Effect-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Twist_Effect-ir.txt deleted file mode 100644 index 9bcbb06b4..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Twist_Effect-ir.txt +++ /dev/null @@ -1,90 +0,0 @@ -struct appdata_img { - vec4 vertex; - vec2 texcoord; -}; -struct v2f { - vec4 pos; - vec2 uv; - vec2 uvOrig; -}; -uniform vec4 _CenterRadius; -vec2 MultiplyUV ( - in mat4 mat_1, - in vec2 inUV_2 -) -{ - vec4 temp_3; - vec4 tmpvar_4; - tmpvar_4.zw = vec2(0.0, 0.0); - tmpvar_4.x = inUV_2.x; - tmpvar_4.y = inUV_2.y; - vec4 tmpvar_5; - tmpvar_5 = tmpvar_4; - temp_3 = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6 = (mat_1 * temp_3); - temp_3 = tmpvar_6; - return temp_3.xy; -} - -v2f vert ( - in appdata_img v_7 -) -{ - vec2 uv_8; - v2f o_9; - vec4 tmpvar_10; - tmpvar_10 = (gl_ModelViewProjectionMatrix * v_7.vertex); - o_9.pos = tmpvar_10; - vec2 tmpvar_11; - tmpvar_11 = (v_7.texcoord.xy - _CenterRadius.xy); - uv_8 = tmpvar_11; - vec2 tmpvar_12; - tmpvar_12 = MultiplyUV (gl_TextureMatrix[0], uv_8); - vec2 tmpvar_13; - tmpvar_13 = tmpvar_12; - o_9.uv = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = uv_8; - o_9.uvOrig = tmpvar_14; - return o_9; -} - -void main () -{ - appdata_img xlt_v_15; - v2f xl_retval_16; - vec4 tmpvar_17; - tmpvar_17 = gl_Vertex.xyzw; - vec4 tmpvar_18; - tmpvar_18 = tmpvar_17; - xlt_v_15.vertex = tmpvar_18; - vec2 tmpvar_19; - tmpvar_19 = gl_MultiTexCoord0.xy; - vec2 tmpvar_20; - tmpvar_20 = tmpvar_19; - xlt_v_15.texcoord = tmpvar_20; - v2f tmpvar_21; - tmpvar_21 = vert (xlt_v_15); - v2f tmpvar_22; - tmpvar_22 = tmpvar_21; - xl_retval_16 = tmpvar_22; - vec4 tmpvar_23; - tmpvar_23 = xl_retval_16.pos.xyzw; - vec4 tmpvar_24; - tmpvar_24 = tmpvar_23; - gl_Position = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25.zw = vec2(0.0, 0.0); - tmpvar_25.xy = xl_retval_16.uv.xy; - vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; - gl_TexCoord[0] = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27.zw = vec2(0.0, 0.0); - tmpvar_27.xy = xl_retval_16.uvOrig.xy; - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - gl_TexCoord[1] = tmpvar_28; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Twist_Effect-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Twist_Effect-out.txt index 74ca25ee6..338641afa 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Twist_Effect-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Twist_Effect-out.txt @@ -1,11 +1,11 @@ uniform vec4 _CenterRadius; void main () { - vec2 tmpvar_1; - tmpvar_1 = (gl_MultiTexCoord0.xy - _CenterRadius.xy); + vec2 uv_1; + uv_1 = (gl_MultiTexCoord0.xy - _CenterRadius.xy); vec4 tmpvar_2; tmpvar_2.zw = vec2(0.0, 0.0); - tmpvar_2.xy = tmpvar_1; + tmpvar_2.xy = uv_1; gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); vec4 tmpvar_3; tmpvar_3.zw = vec2(0.0, 0.0); @@ -13,9 +13,16 @@ void main () gl_TexCoord[0] = tmpvar_3; vec4 tmpvar_4; tmpvar_4.zw = vec2(0.0, 0.0); - tmpvar_4.xy = tmpvar_1; + tmpvar_4.xy = uv_1; gl_TexCoord[1] = tmpvar_4; } -// inputs: 2, stats: 6 alu 0 tex 0 flow +// stats: 6 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 3 (total size: 0) +// #0: gl_TextureMatrix (high float) 4x4 [16] +// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #2: _CenterRadius (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-ir.txt deleted file mode 100644 index c05b093ad..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-ir.txt +++ /dev/null @@ -1,178 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 lightDir; - vec2 _LightCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _BumpMap_ST; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform mat4 _World2Object; -uniform vec4 _WorldSpaceLightPos0; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec3 ObjSpaceLightDir ( - in vec4 v_6 -) -{ - vec3 objSpaceLightPos_7; - vec3 tmpvar_8; - tmpvar_8 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_7 = tmpvar_8; - return objSpaceLightPos_7.xyz; -} - -v2f_surf vert_surf ( - in appdata_full v_9 -) -{ - mat3 rotation_10; - vec3 binormal_11; - v2f_surf o_12; - PositionFog (v_9.vertex, o_12.pos, o_12.fog); - vec2 tmpvar_13; - tmpvar_13 = ((v_9.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_12.hip_pack0.xy = tmpvar_13.xy.xy; - vec2 tmpvar_14; - tmpvar_14 = ((v_9.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_12.hip_pack0.zw = tmpvar_14.xxxy.zw; - vec3 tmpvar_15; - tmpvar_15 = cross (v_9.normal, v_9.tangent.xyz); - vec3 tmpvar_16; - tmpvar_16 = (tmpvar_15 * v_9.tangent.w); - binormal_11 = tmpvar_16; - mat3 tmpvar_17; - float tmpvar_18; - tmpvar_18 = v_9.tangent.x; - tmpvar_17[0].x = tmpvar_18; - float tmpvar_19; - tmpvar_19 = binormal_11.x; - tmpvar_17[0].y = tmpvar_19; - float tmpvar_20; - tmpvar_20 = v_9.normal.x; - tmpvar_17[0].z = tmpvar_20; - float tmpvar_21; - tmpvar_21 = v_9.tangent.y; - tmpvar_17[1].x = tmpvar_21; - float tmpvar_22; - tmpvar_22 = binormal_11.y; - tmpvar_17[1].y = tmpvar_22; - float tmpvar_23; - tmpvar_23 = v_9.normal.y; - tmpvar_17[1].z = tmpvar_23; - float tmpvar_24; - tmpvar_24 = v_9.tangent.z; - tmpvar_17[2].x = tmpvar_24; - float tmpvar_25; - tmpvar_25 = binormal_11.z; - tmpvar_17[2].y = tmpvar_25; - float tmpvar_26; - tmpvar_26 = v_9.normal.z; - tmpvar_17[2].z = tmpvar_26; - mat3 tmpvar_27; - tmpvar_27 = tmpvar_17; - rotation_10 = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = ObjSpaceLightDir (v_9.vertex); - vec3 tmpvar_29; - tmpvar_29 = (rotation_10 * tmpvar_28); - o_12.lightDir = tmpvar_29; - vec2 tmpvar_30; - tmpvar_30 = (_LightMatrix0 * (_Object2World * v_9.vertex)).xy; - o_12._LightCoord = tmpvar_30; - return o_12; -} - -void main () -{ - appdata_full xlt_v_31; - v2f_surf xl_retval_32; - vec4 tmpvar_33; - tmpvar_33 = gl_Vertex.xyzw; - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - xlt_v_31.vertex = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35 = TANGENT.xyzw; - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlt_v_31.tangent = tmpvar_36; - vec3 tmpvar_37; - tmpvar_37 = gl_Normal.xyz; - vec3 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlt_v_31.normal = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_v_31.texcoord = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_v_31.texcoord1 = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43 = gl_Color.xyzw; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_v_31.color = tmpvar_44; - v2f_surf tmpvar_45; - tmpvar_45 = vert_surf (xlt_v_31); - v2f_surf tmpvar_46; - tmpvar_46 = tmpvar_45; - xl_retval_32 = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = xl_retval_32.pos.xyzw; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - gl_Position = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_49.x = xl_retval_32.fog; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlv_FOG = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = xl_retval_32.hip_pack0.xyzw; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - gl_TexCoord[0] = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53.w = 0.0; - tmpvar_53.xyz = xl_retval_32.lightDir.xyz; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - gl_TexCoord[1] = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55.zw = vec2(0.0, 0.0); - tmpvar_55.xy = xl_retval_32._LightCoord.xy; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - gl_TexCoord[2] = tmpvar_56; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt index b22e77338..8191af76f 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt @@ -8,29 +8,29 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; + vec3 binormal_1; vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); - tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - vec3 tmpvar_3; - tmpvar_3 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + vec4 pos_3; + pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_4; tmpvar_4[0].x = TANGENT.x; - tmpvar_4[0].y = tmpvar_3.x; + tmpvar_4[0].y = binormal_1.x; tmpvar_4[0].z = gl_Normal.x; tmpvar_4[1].x = TANGENT.y; - tmpvar_4[1].y = tmpvar_3.y; + tmpvar_4[1].y = binormal_1.y; tmpvar_4[1].z = gl_Normal.y; tmpvar_4[2].x = TANGENT.z; - tmpvar_4[2].y = tmpvar_3.z; + tmpvar_4[2].y = binormal_1.z; tmpvar_4[2].z = gl_Normal.z; - gl_Position = tmpvar_2; + gl_Position = pos_3; vec4 tmpvar_5; tmpvar_5.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_5.x = tmpvar_2.z; + tmpvar_5.x = pos_3.z; xlv_FOG = tmpvar_5; - gl_TexCoord[0] = tmpvar_1; + gl_TexCoord[0] = tmpvar_2; vec4 tmpvar_6; tmpvar_6.w = 0.0; tmpvar_6.xyz = (tmpvar_4 * (_World2Object * _WorldSpaceLightPos0).xyz); @@ -42,4 +42,17 @@ void main () } -// inputs: 4, stats: 16 alu 0 tex 0 flow +// stats: 16 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 7 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _BumpMap_ST (high float) 4x1 [-1] +// #2: _LightMatrix0 (high float) 4x4 [-1] +// #3: _MainTex_ST (high float) 4x1 [-1] +// #4: _Object2World (high float) 4x4 [-1] +// #5: _World2Object (high float) 4x4 [-1] +// #6: _WorldSpaceLightPos0 (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-ir.txt deleted file mode 100644 index 60d4eac64..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-ir.txt +++ /dev/null @@ -1,251 +0,0 @@ -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec4 _LightCoord; -}; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _Scale; -uniform float _SquashAmount; -uniform vec4 _SquashPlaneNormal; -uniform mat4 _TerrainEngineBendTree; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec4 Squash ( - in vec4 pos_9 -) -{ - vec3 planeNormal_10; - vec3 planePoint_11; - vec3 projectedVertex_12; - vec3 tmpvar_13; - tmpvar_13 = pos_9.xyz; - projectedVertex_12 = tmpvar_13; - vec3 tmpvar_14; - tmpvar_14.xz = vec2(0.0, 0.0); - tmpvar_14.y = _SquashPlaneNormal.w; - vec3 tmpvar_15; - tmpvar_15 = tmpvar_14; - planePoint_11 = tmpvar_15; - vec3 tmpvar_16; - tmpvar_16 = _SquashPlaneNormal.xyz; - planeNormal_10 = tmpvar_16; - vec3 tmpvar_17; - tmpvar_17 = pos_9.xyz; - float tmpvar_18; - tmpvar_18 = dot (planeNormal_10, (planePoint_11 - tmpvar_17)); - vec3 tmpvar_19; - tmpvar_19 = (projectedVertex_12 + (tmpvar_18 * planeNormal_10)); - projectedVertex_12 = tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = vec3(_SquashAmount); - vec3 tmpvar_21; - tmpvar_21 = mix (projectedVertex_12, pos_9.xyz, tmpvar_20); - vec4 tmpvar_22; - tmpvar_22.w = 1.0; - tmpvar_22.xyz = tmpvar_21.xyz; - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - pos_9 = tmpvar_23; - return pos_9; -} - -void TerrainAnimateTree ( - inout vec4 pos_24, - in float alpha_25 -) -{ - vec3 bent_26; - vec3 tmpvar_27; - tmpvar_27 = (pos_24.xyz * _Scale.xyz); - pos_24.xyz = tmpvar_27.xyz.xyz; - vec4 tmpvar_28; - tmpvar_28.w = 0.0; - tmpvar_28.xyz = pos_24.xyz.xyz; - vec3 tmpvar_29; - tmpvar_29 = (_TerrainEngineBendTree * tmpvar_28).xyz; - bent_26 = tmpvar_29; - vec3 tmpvar_30; - tmpvar_30 = vec3(alpha_25); - vec3 tmpvar_31; - tmpvar_31 = mix (pos_24.xyz, bent_26, tmpvar_30); - vec3 tmpvar_32; - tmpvar_32 = tmpvar_31; - pos_24.xyz = tmpvar_32.xyz.xyz; - vec4 tmpvar_33; - tmpvar_33 = Squash (pos_24); - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - pos_24 = tmpvar_34; -} - -void treevertex ( - inout appdata_full v_35 -) -{ - TerrainAnimateTree (v_35.vertex, v_35.color.w); -} - -vec3 WorldSpaceLightDir ( - in vec4 v_36 -) -{ - vec3 worldPos_37; - vec3 tmpvar_38; - tmpvar_38 = (_Object2World * v_36).xyz; - worldPos_37 = tmpvar_38; - return (_WorldSpaceLightPos0.xyz - worldPos_37); -} - -void PositionFog ( - in vec4 v_39, - out vec4 pos_40, - out float fog_41 -) -{ - vec4 tmpvar_42; - tmpvar_42 = (gl_ModelViewProjectionMatrix * v_39); - pos_40 = tmpvar_42; - float tmpvar_43; - tmpvar_43 = pos_40.z; - fog_41 = tmpvar_43; -} - -v2f_surf vert_surf ( - in appdata_full v_44 -) -{ - v2f_surf o_45; - treevertex (v_44); - PositionFog (v_44.vertex, o_45.pos, o_45.fog); - vec2 tmpvar_46; - tmpvar_46 = ((v_44.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_45.hip_pack0 = tmpvar_46.xy.xy; - mat3 tmpvar_47; - tmpvar_47 = xll_constructMat3 (_Object2World); - vec3 tmpvar_48; - tmpvar_48 = (tmpvar_47 * (v_44.normal * unity_Scale.w)); - o_45.normal = tmpvar_48; - vec3 tmpvar_49; - tmpvar_49 = WorldSpaceLightDir (v_44.vertex); - vec3 tmpvar_50; - tmpvar_50 = tmpvar_49; - o_45.lightDir = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = (_LightMatrix0 * (_Object2World * v_44.vertex)); - o_45._LightCoord = tmpvar_51; - return o_45; -} - -void main () -{ - appdata_full xlt_v_52; - v2f_surf xl_retval_53; - vec4 tmpvar_54; - tmpvar_54 = gl_Vertex.xyzw; - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - xlt_v_52.vertex = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = TANGENT.xyzw; - vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - xlt_v_52.tangent = tmpvar_57; - vec3 tmpvar_58; - tmpvar_58 = gl_Normal.xyz; - vec3 tmpvar_59; - tmpvar_59 = tmpvar_58; - xlt_v_52.normal = tmpvar_59; - vec4 tmpvar_60; - tmpvar_60 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_61; - tmpvar_61 = tmpvar_60; - xlt_v_52.texcoord = tmpvar_61; - vec4 tmpvar_62; - tmpvar_62 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_63; - tmpvar_63 = tmpvar_62; - xlt_v_52.texcoord1 = tmpvar_63; - vec4 tmpvar_64; - tmpvar_64 = gl_Color.xyzw; - vec4 tmpvar_65; - tmpvar_65 = tmpvar_64; - xlt_v_52.color = tmpvar_65; - v2f_surf tmpvar_66; - tmpvar_66 = vert_surf (xlt_v_52); - v2f_surf tmpvar_67; - tmpvar_67 = tmpvar_66; - xl_retval_53 = tmpvar_67; - vec4 tmpvar_68; - tmpvar_68 = xl_retval_53.pos.xyzw; - vec4 tmpvar_69; - tmpvar_69 = tmpvar_68; - gl_Position = tmpvar_69; - vec4 tmpvar_70; - tmpvar_70.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_70.x = xl_retval_53.fog; - vec4 tmpvar_71; - tmpvar_71 = tmpvar_70; - xlv_FOG = tmpvar_71; - vec4 tmpvar_72; - tmpvar_72.zw = vec2(0.0, 0.0); - tmpvar_72.xy = xl_retval_53.hip_pack0.xy; - vec4 tmpvar_73; - tmpvar_73 = tmpvar_72; - gl_TexCoord[0] = tmpvar_73; - vec4 tmpvar_74; - tmpvar_74.w = 0.0; - tmpvar_74.xyz = xl_retval_53.normal.xyz; - vec4 tmpvar_75; - tmpvar_75 = tmpvar_74; - gl_TexCoord[1] = tmpvar_75; - vec4 tmpvar_76; - tmpvar_76.w = 0.0; - tmpvar_76.xyz = xl_retval_53.lightDir.xyz; - vec4 tmpvar_77; - tmpvar_77 = tmpvar_76; - gl_TexCoord[2] = tmpvar_77; - vec4 tmpvar_78; - tmpvar_78 = xl_retval_53._LightCoord.xyzw; - vec4 tmpvar_79; - tmpvar_79 = tmpvar_78; - gl_TexCoord[3] = tmpvar_79; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-out.txt index 4da97fe10..aa705808d 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-out.txt @@ -26,16 +26,16 @@ void main () dot (_SquashPlaneNormal.xyz, (tmpvar_3 - pos_1.xyz)) * _SquashPlaneNormal.xyz)), pos_1.xyz, vec3(_SquashAmount)); pos_1 = tmpvar_4; - vec4 tmpvar_5; - tmpvar_5 = (gl_ModelViewProjectionMatrix * tmpvar_4); + vec4 pos_5; + pos_5 = (gl_ModelViewProjectionMatrix * tmpvar_4); mat3 tmpvar_6; tmpvar_6[0] = _Object2World[0].xyz; tmpvar_6[1] = _Object2World[1].xyz; tmpvar_6[2] = _Object2World[2].xyz; - gl_Position = tmpvar_5; + gl_Position = pos_5; vec4 tmpvar_7; tmpvar_7.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_7.x = tmpvar_5.z; + tmpvar_7.x = pos_5.z; xlv_FOG = tmpvar_7; vec4 tmpvar_8; tmpvar_8.zw = vec2(0.0, 0.0); @@ -53,4 +53,20 @@ void main () } -// inputs: 4, stats: 24 alu 0 tex 0 flow +// stats: 24 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Color (high float) 4x1 [-1] loc 3 +// #2: gl_Normal (high float) 3x1 [-1] loc 2 +// #3: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 10 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _LightMatrix0 (high float) 4x4 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _Scale (high float) 4x1 [-1] +// #5: _SquashAmount (high float) 1x1 [-1] +// #6: _SquashPlaneNormal (high float) 4x1 [-1] +// #7: _TerrainEngineBendTree (high float) 4x4 [-1] +// #8: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #9: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-ir.txt deleted file mode 100644 index 6c82fc12f..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-ir.txt +++ /dev/null @@ -1,161 +0,0 @@ -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - vec3 vec; -}; -uniform vec4 _LightPositionRange; -uniform mat4 _Object2World; -uniform vec4 _Scale; -uniform float _SquashAmount; -uniform vec4 _SquashPlaneNormal; -uniform mat4 _TerrainEngineBendTree; -attribute vec4 TANGENT; -vec4 Squash ( - in vec4 pos_1 -) -{ - vec3 planeNormal_2; - vec3 planePoint_3; - vec3 projectedVertex_4; - vec3 tmpvar_5; - tmpvar_5 = pos_1.xyz; - projectedVertex_4 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6.xz = vec2(0.0, 0.0); - tmpvar_6.y = _SquashPlaneNormal.w; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_6; - planePoint_3 = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = _SquashPlaneNormal.xyz; - planeNormal_2 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = pos_1.xyz; - float tmpvar_10; - tmpvar_10 = dot (planeNormal_2, (planePoint_3 - tmpvar_9)); - vec3 tmpvar_11; - tmpvar_11 = (projectedVertex_4 + (tmpvar_10 * planeNormal_2)); - projectedVertex_4 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = vec3(_SquashAmount); - vec3 tmpvar_13; - tmpvar_13 = mix (projectedVertex_4, pos_1.xyz, tmpvar_12); - vec4 tmpvar_14; - tmpvar_14.w = 1.0; - tmpvar_14.xyz = tmpvar_13.xyz; - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - pos_1 = tmpvar_15; - return pos_1; -} - -void TerrainAnimateTree ( - inout vec4 pos_16, - in float alpha_17 -) -{ - vec3 bent_18; - vec3 tmpvar_19; - tmpvar_19 = (pos_16.xyz * _Scale.xyz); - pos_16.xyz = tmpvar_19.xyz.xyz; - vec4 tmpvar_20; - tmpvar_20.w = 0.0; - tmpvar_20.xyz = pos_16.xyz.xyz; - vec3 tmpvar_21; - tmpvar_21 = (_TerrainEngineBendTree * tmpvar_20).xyz; - bent_18 = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = vec3(alpha_17); - vec3 tmpvar_23; - tmpvar_23 = mix (pos_16.xyz, bent_18, tmpvar_22); - vec3 tmpvar_24; - tmpvar_24 = tmpvar_23; - pos_16.xyz = tmpvar_24.xyz.xyz; - vec4 tmpvar_25; - tmpvar_25 = Squash (pos_16); - vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; - pos_16 = tmpvar_26; -} - -void treevertex ( - inout appdata_full v_27 -) -{ - TerrainAnimateTree (v_27.vertex, v_27.color.w); -} - -v2f_surf vert_surf ( - in appdata_full v_28 -) -{ - v2f_surf o_29; - treevertex (v_28); - vec3 tmpvar_30; - tmpvar_30 = ((_Object2World * v_28.vertex).xyz - _LightPositionRange.xyz); - o_29.vec = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = (gl_ModelViewProjectionMatrix * v_28.vertex); - o_29.pos = tmpvar_31; - return o_29; -} - -void main () -{ - appdata_full xlt_v_32; - v2f_surf xl_retval_33; - vec4 tmpvar_34; - tmpvar_34 = gl_Vertex.xyzw; - vec4 tmpvar_35; - tmpvar_35 = tmpvar_34; - xlt_v_32.vertex = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36 = TANGENT.xyzw; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlt_v_32.tangent = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = gl_Normal.xyz; - vec3 tmpvar_39; - tmpvar_39 = tmpvar_38; - xlt_v_32.normal = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - xlt_v_32.texcoord = tmpvar_41; - vec4 tmpvar_42; - tmpvar_42 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - xlt_v_32.texcoord1 = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44 = gl_Color.xyzw; - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - xlt_v_32.color = tmpvar_45; - v2f_surf tmpvar_46; - tmpvar_46 = vert_surf (xlt_v_32); - v2f_surf tmpvar_47; - tmpvar_47 = tmpvar_46; - xl_retval_33 = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48 = xl_retval_33.pos.xyzw; - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - gl_Position = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50.w = 0.0; - tmpvar_50.xyz = xl_retval_33.vec.xyz; - vec4 tmpvar_51; - tmpvar_51 = tmpvar_50; - gl_TexCoord[0] = tmpvar_51; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-out.txt index 636e490cf..b8f445383 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-out.txt @@ -30,4 +30,15 @@ void main () } -// inputs: 2, stats: 15 alu 0 tex 0 flow +// stats: 15 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 3 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 7 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _LightPositionRange (high float) 4x1 [-1] +// #2: _Object2World (high float) 4x4 [-1] +// #3: _Scale (high float) 4x1 [-1] +// #4: _SquashAmount (high float) 1x1 [-1] +// #5: _SquashPlaneNormal (high float) 4x1 [-1] +// #6: _TerrainEngineBendTree (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-ir.txt deleted file mode 100644 index 6fa7e7b58..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-ir.txt +++ /dev/null @@ -1,216 +0,0 @@ -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - vec3 _ShadowCoord0; - vec3 _ShadowCoord1; - vec3 _ShadowCoord2; - vec3 _ShadowCoord3; - vec2 _ShadowZFade; -}; -uniform vec4 _LightShadowData; -uniform mat4 _Object2World; -uniform vec4 _Scale; -uniform float _SquashAmount; -uniform vec4 _SquashPlaneNormal; -uniform mat4 _TerrainEngineBendTree; -uniform mat4 _World2Shadow; -uniform mat4 _World2Shadow1; -uniform mat4 _World2Shadow2; -uniform mat4 _World2Shadow3; -attribute vec4 TANGENT; -vec4 Squash ( - in vec4 pos_1 -) -{ - vec3 planeNormal_2; - vec3 planePoint_3; - vec3 projectedVertex_4; - vec3 tmpvar_5; - tmpvar_5 = pos_1.xyz; - projectedVertex_4 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6.xz = vec2(0.0, 0.0); - tmpvar_6.y = _SquashPlaneNormal.w; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_6; - planePoint_3 = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = _SquashPlaneNormal.xyz; - planeNormal_2 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = pos_1.xyz; - float tmpvar_10; - tmpvar_10 = dot (planeNormal_2, (planePoint_3 - tmpvar_9)); - vec3 tmpvar_11; - tmpvar_11 = (projectedVertex_4 + (tmpvar_10 * planeNormal_2)); - projectedVertex_4 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = vec3(_SquashAmount); - vec3 tmpvar_13; - tmpvar_13 = mix (projectedVertex_4, pos_1.xyz, tmpvar_12); - vec4 tmpvar_14; - tmpvar_14.w = 1.0; - tmpvar_14.xyz = tmpvar_13.xyz; - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - pos_1 = tmpvar_15; - return pos_1; -} - -void TerrainAnimateTree ( - inout vec4 pos_16, - in float alpha_17 -) -{ - vec3 bent_18; - vec3 tmpvar_19; - tmpvar_19 = (pos_16.xyz * _Scale.xyz); - pos_16.xyz = tmpvar_19.xyz.xyz; - vec4 tmpvar_20; - tmpvar_20.w = 0.0; - tmpvar_20.xyz = pos_16.xyz.xyz; - vec3 tmpvar_21; - tmpvar_21 = (_TerrainEngineBendTree * tmpvar_20).xyz; - bent_18 = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = vec3(alpha_17); - vec3 tmpvar_23; - tmpvar_23 = mix (pos_16.xyz, bent_18, tmpvar_22); - vec3 tmpvar_24; - tmpvar_24 = tmpvar_23; - pos_16.xyz = tmpvar_24.xyz.xyz; - vec4 tmpvar_25; - tmpvar_25 = Squash (pos_16); - vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; - pos_16 = tmpvar_26; -} - -void treevertex ( - inout appdata_full v_27 -) -{ - TerrainAnimateTree (v_27.vertex, v_27.color.w); -} - -v2f_surf vert_surf ( - in appdata_full v_28 -) -{ - vec4 wpos_29; - float z_30; - v2f_surf o_31; - treevertex (v_28); - vec4 tmpvar_32; - tmpvar_32 = (gl_ModelViewProjectionMatrix * v_28.vertex); - o_31.pos = tmpvar_32; - float tmpvar_33; - tmpvar_33 = -((gl_ModelViewMatrix * v_28.vertex).z); - z_30 = tmpvar_33; - float tmpvar_34; - tmpvar_34 = z_30; - o_31._ShadowZFade.x = tmpvar_34; - float tmpvar_35; - tmpvar_35 = ((z_30 * _LightShadowData.z) + _LightShadowData.w); - o_31._ShadowZFade.y = vec2(tmpvar_35).y; - vec4 tmpvar_36; - tmpvar_36 = (_Object2World * v_28.vertex); - wpos_29 = tmpvar_36; - vec3 tmpvar_37; - tmpvar_37 = (_World2Shadow * wpos_29).xyz; - o_31._ShadowCoord0 = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = (_World2Shadow1 * wpos_29).xyz; - o_31._ShadowCoord1 = tmpvar_38; - vec3 tmpvar_39; - tmpvar_39 = (_World2Shadow2 * wpos_29).xyz; - o_31._ShadowCoord2 = tmpvar_39; - vec3 tmpvar_40; - tmpvar_40 = (_World2Shadow3 * wpos_29).xyz; - o_31._ShadowCoord3 = tmpvar_40; - return o_31; -} - -void main () -{ - appdata_full xlt_v_41; - v2f_surf xl_retval_42; - vec4 tmpvar_43; - tmpvar_43 = gl_Vertex.xyzw; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_v_41.vertex = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = TANGENT.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_v_41.tangent = tmpvar_46; - vec3 tmpvar_47; - tmpvar_47 = gl_Normal.xyz; - vec3 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_v_41.normal = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_v_41.texcoord = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - xlt_v_41.texcoord1 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = gl_Color.xyzw; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - xlt_v_41.color = tmpvar_54; - v2f_surf tmpvar_55; - tmpvar_55 = vert_surf (xlt_v_41); - v2f_surf tmpvar_56; - tmpvar_56 = tmpvar_55; - xl_retval_42 = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = xl_retval_42.pos.xyzw; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - gl_Position = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59.w = 0.0; - tmpvar_59.xyz = xl_retval_42._ShadowCoord0.xyz; - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - gl_TexCoord[0] = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61.w = 0.0; - tmpvar_61.xyz = xl_retval_42._ShadowCoord1.xyz; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - gl_TexCoord[1] = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63.w = 0.0; - tmpvar_63.xyz = xl_retval_42._ShadowCoord2.xyz; - vec4 tmpvar_64; - tmpvar_64 = tmpvar_63; - gl_TexCoord[2] = tmpvar_64; - vec4 tmpvar_65; - tmpvar_65.w = 0.0; - tmpvar_65.xyz = xl_retval_42._ShadowCoord3.xyz; - vec4 tmpvar_66; - tmpvar_66 = tmpvar_65; - gl_TexCoord[3] = tmpvar_66; - vec4 tmpvar_67; - tmpvar_67.zw = vec2(0.0, 0.0); - tmpvar_67.xy = xl_retval_42._ShadowZFade.xy; - vec4 tmpvar_68; - tmpvar_68 = tmpvar_67; - gl_TexCoord[4] = tmpvar_68; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-out.txt index 160b5ca5d..50f0b9f6a 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-out.txt @@ -10,51 +10,67 @@ uniform mat4 _World2Shadow2; uniform mat4 _World2Shadow3; void main () { - vec2 tmpvar_1; - vec4 pos_2; - pos_2.w = gl_Vertex.w; - pos_2.xyz = (gl_Vertex.xyz * _Scale.xyz); - vec4 tmpvar_3; - tmpvar_3.w = 0.0; - tmpvar_3.xyz = pos_2.xyz; - pos_2.xyz = mix (pos_2.xyz, (_TerrainEngineBendTree * tmpvar_3).xyz, gl_Color.www); - vec3 tmpvar_4; - tmpvar_4.xz = vec2(0.0, 0.0); - tmpvar_4.y = _SquashPlaneNormal.w; + vec4 wpos_1; + float z_2; + vec2 tmpvar_3; + vec4 pos_4; + pos_4.w = gl_Vertex.w; + pos_4.xyz = (gl_Vertex.xyz * _Scale.xyz); vec4 tmpvar_5; - tmpvar_5.w = 1.0; - tmpvar_5.xyz = mix ((pos_2.xyz + ( - dot (_SquashPlaneNormal.xyz, (tmpvar_4 - pos_2.xyz)) - * _SquashPlaneNormal.xyz)), pos_2.xyz, vec3(_SquashAmount)); - pos_2 = tmpvar_5; - float tmpvar_6; - tmpvar_6 = -((gl_ModelViewMatrix * tmpvar_5).z); - tmpvar_1.x = tmpvar_6; - tmpvar_1.y = ((tmpvar_6 * _LightShadowData.z) + _LightShadowData.w); + tmpvar_5.w = 0.0; + tmpvar_5.xyz = pos_4.xyz; + pos_4.xyz = mix (pos_4.xyz, (_TerrainEngineBendTree * tmpvar_5).xyz, gl_Color.www); + vec3 tmpvar_6; + tmpvar_6.xz = vec2(0.0, 0.0); + tmpvar_6.y = _SquashPlaneNormal.w; vec4 tmpvar_7; - tmpvar_7 = (_Object2World * tmpvar_5); - gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_5); + tmpvar_7.w = 1.0; + tmpvar_7.xyz = mix ((pos_4.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_6 - pos_4.xyz)) + * _SquashPlaneNormal.xyz)), pos_4.xyz, vec3(_SquashAmount)); + pos_4 = tmpvar_7; + z_2 = -((gl_ModelViewMatrix * tmpvar_7).z); + tmpvar_3.x = z_2; + tmpvar_3.y = ((z_2 * _LightShadowData.z) + _LightShadowData.w); + wpos_1 = (_Object2World * tmpvar_7); + gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_7); vec4 tmpvar_8; tmpvar_8.w = 0.0; - tmpvar_8.xyz = (_World2Shadow * tmpvar_7).xyz; + tmpvar_8.xyz = (_World2Shadow * wpos_1).xyz; gl_TexCoord[0] = tmpvar_8; vec4 tmpvar_9; tmpvar_9.w = 0.0; - tmpvar_9.xyz = (_World2Shadow1 * tmpvar_7).xyz; + tmpvar_9.xyz = (_World2Shadow1 * wpos_1).xyz; gl_TexCoord[1] = tmpvar_9; vec4 tmpvar_10; tmpvar_10.w = 0.0; - tmpvar_10.xyz = (_World2Shadow2 * tmpvar_7).xyz; + tmpvar_10.xyz = (_World2Shadow2 * wpos_1).xyz; gl_TexCoord[2] = tmpvar_10; vec4 tmpvar_11; tmpvar_11.w = 0.0; - tmpvar_11.xyz = (_World2Shadow3 * tmpvar_7).xyz; + tmpvar_11.xyz = (_World2Shadow3 * wpos_1).xyz; gl_TexCoord[3] = tmpvar_11; vec4 tmpvar_12; tmpvar_12.zw = vec2(0.0, 0.0); - tmpvar_12.xy = tmpvar_1; + tmpvar_12.xy = tmpvar_3; gl_TexCoord[4] = tmpvar_12; } -// inputs: 2, stats: 26 alu 0 tex 0 flow +// stats: 26 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_Color (high float) 4x1 [-1] loc 3 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 12 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: gl_ModelViewMatrix (high float) 4x4 [-1] +// #2: _LightShadowData (high float) 4x1 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _Scale (high float) 4x1 [-1] +// #5: _SquashAmount (high float) 1x1 [-1] +// #6: _SquashPlaneNormal (high float) 4x1 [-1] +// #7: _TerrainEngineBendTree (high float) 4x4 [-1] +// #8: _World2Shadow (high float) 4x4 [-1] +// #9: _World2Shadow1 (high float) 4x4 [-1] +// #10: _World2Shadow2 (high float) 4x4 [-1] +// #11: _World2Shadow3 (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-ir.txt deleted file mode 100644 index 5643d1a4d..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-ir.txt +++ /dev/null @@ -1,212 +0,0 @@ -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 hip_screen; -}; -uniform vec4 _MainTex_ST; -uniform vec4 _ProjectionParams; -uniform vec4 _Scale; -uniform float _SquashAmount; -uniform vec4 _SquashPlaneNormal; -uniform mat4 _TerrainEngineBendTree; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -vec4 Squash ( - in vec4 pos_1 -) -{ - vec3 planeNormal_2; - vec3 planePoint_3; - vec3 projectedVertex_4; - vec3 tmpvar_5; - tmpvar_5 = pos_1.xyz; - projectedVertex_4 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6.xz = vec2(0.0, 0.0); - tmpvar_6.y = _SquashPlaneNormal.w; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_6; - planePoint_3 = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = _SquashPlaneNormal.xyz; - planeNormal_2 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = pos_1.xyz; - float tmpvar_10; - tmpvar_10 = dot (planeNormal_2, (planePoint_3 - tmpvar_9)); - vec3 tmpvar_11; - tmpvar_11 = (projectedVertex_4 + (tmpvar_10 * planeNormal_2)); - projectedVertex_4 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = vec3(_SquashAmount); - vec3 tmpvar_13; - tmpvar_13 = mix (projectedVertex_4, pos_1.xyz, tmpvar_12); - vec4 tmpvar_14; - tmpvar_14.w = 1.0; - tmpvar_14.xyz = tmpvar_13.xyz; - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - pos_1 = tmpvar_15; - return pos_1; -} - -void TerrainAnimateTree ( - inout vec4 pos_16, - in float alpha_17 -) -{ - vec3 bent_18; - vec3 tmpvar_19; - tmpvar_19 = (pos_16.xyz * _Scale.xyz); - pos_16.xyz = tmpvar_19.xyz.xyz; - vec4 tmpvar_20; - tmpvar_20.w = 0.0; - tmpvar_20.xyz = pos_16.xyz.xyz; - vec3 tmpvar_21; - tmpvar_21 = (_TerrainEngineBendTree * tmpvar_20).xyz; - bent_18 = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = vec3(alpha_17); - vec3 tmpvar_23; - tmpvar_23 = mix (pos_16.xyz, bent_18, tmpvar_22); - vec3 tmpvar_24; - tmpvar_24 = tmpvar_23; - pos_16.xyz = tmpvar_24.xyz.xyz; - vec4 tmpvar_25; - tmpvar_25 = Squash (pos_16); - vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; - pos_16 = tmpvar_26; -} - -void treevertex ( - inout appdata_full v_27 -) -{ - TerrainAnimateTree (v_27.vertex, v_27.color.w); -} - -void PositionFog ( - in vec4 v_28, - out vec4 pos_29, - out float fog_30 -) -{ - vec4 tmpvar_31; - tmpvar_31 = (gl_ModelViewProjectionMatrix * v_28); - pos_29 = tmpvar_31; - float tmpvar_32; - tmpvar_32 = pos_29.z; - fog_30 = tmpvar_32; -} - -vec4 ComputeScreenPos ( - in vec4 pos_33 -) -{ - vec4 o_34; - vec4 tmpvar_35; - tmpvar_35 = (pos_33 * 0.5); - o_34 = tmpvar_35; - vec2 tmpvar_36; - tmpvar_36.x = o_34.x; - tmpvar_36.y = (o_34.y * _ProjectionParams.x); - vec2 tmpvar_37; - tmpvar_37 = (tmpvar_36 + o_34.w); - o_34.xy = tmpvar_37.xy.xy; - vec2 tmpvar_38; - tmpvar_38 = pos_33.zw; - o_34.zw = tmpvar_38.xxxy.zw; - return o_34; -} - -v2f_surf vert_surf ( - in appdata_full v_39 -) -{ - v2f_surf o_40; - treevertex (v_39); - PositionFog (v_39.vertex, o_40.pos, o_40.fog); - vec2 tmpvar_41; - tmpvar_41 = ((v_39.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_40.hip_pack0 = tmpvar_41.xy.xy; - vec4 tmpvar_42; - tmpvar_42 = ComputeScreenPos (o_40.pos); - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - o_40.hip_screen = tmpvar_43; - return o_40; -} - -void main () -{ - appdata_full xlt_v_44; - v2f_surf xl_retval_45; - vec4 tmpvar_46; - tmpvar_46 = gl_Vertex.xyzw; - vec4 tmpvar_47; - tmpvar_47 = tmpvar_46; - xlt_v_44.vertex = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48 = TANGENT.xyzw; - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - xlt_v_44.tangent = tmpvar_49; - vec3 tmpvar_50; - tmpvar_50 = gl_Normal.xyz; - vec3 tmpvar_51; - tmpvar_51 = tmpvar_50; - xlt_v_44.normal = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - xlt_v_44.texcoord = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - xlt_v_44.texcoord1 = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = gl_Color.xyzw; - vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - xlt_v_44.color = tmpvar_57; - v2f_surf tmpvar_58; - tmpvar_58 = vert_surf (xlt_v_44); - v2f_surf tmpvar_59; - tmpvar_59 = tmpvar_58; - xl_retval_45 = tmpvar_59; - vec4 tmpvar_60; - tmpvar_60 = xl_retval_45.pos.xyzw; - vec4 tmpvar_61; - tmpvar_61 = tmpvar_60; - gl_Position = tmpvar_61; - vec4 tmpvar_62; - tmpvar_62.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_62.x = xl_retval_45.fog; - vec4 tmpvar_63; - tmpvar_63 = tmpvar_62; - xlv_FOG = tmpvar_63; - vec4 tmpvar_64; - tmpvar_64.zw = vec2(0.0, 0.0); - tmpvar_64.xy = xl_retval_45.hip_pack0.xy; - vec4 tmpvar_65; - tmpvar_65 = tmpvar_64; - gl_TexCoord[0] = tmpvar_65; - vec4 tmpvar_66; - tmpvar_66 = xl_retval_45.hip_screen.xyzw; - vec4 tmpvar_67; - tmpvar_67 = tmpvar_66; - gl_TexCoord[1] = tmpvar_67; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-out.txt index 7e0010b79..838b07ee8 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-out.txt @@ -23,27 +23,38 @@ void main () dot (_SquashPlaneNormal.xyz, (tmpvar_3 - pos_1.xyz)) * _SquashPlaneNormal.xyz)), pos_1.xyz, vec3(_SquashAmount)); pos_1 = tmpvar_4; - vec4 tmpvar_5; - tmpvar_5 = (gl_ModelViewProjectionMatrix * tmpvar_4); + vec4 pos_5; + pos_5 = (gl_ModelViewProjectionMatrix * tmpvar_4); vec4 o_6; - vec4 tmpvar_7; - tmpvar_7 = (tmpvar_5 * 0.5); - vec2 tmpvar_8; - tmpvar_8.x = tmpvar_7.x; - tmpvar_8.y = (tmpvar_7.y * _ProjectionParams.x); - o_6.xy = (tmpvar_8 + tmpvar_7.w); - o_6.zw = tmpvar_5.zw; - gl_Position = tmpvar_5; + o_6 = (pos_5 * 0.5); + vec2 tmpvar_7; + tmpvar_7.x = o_6.x; + tmpvar_7.y = (o_6.y * _ProjectionParams.x); + o_6.xy = (tmpvar_7 + o_6.w); + o_6.zw = pos_5.zw; + gl_Position = pos_5; + vec4 tmpvar_8; + tmpvar_8.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_8.x = pos_5.z; + xlv_FOG = tmpvar_8; vec4 tmpvar_9; - tmpvar_9.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_9.x = tmpvar_5.z; - xlv_FOG = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10.zw = vec2(0.0, 0.0); - tmpvar_10.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_10; + tmpvar_9.zw = vec2(0.0, 0.0); + tmpvar_9.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_9; gl_TexCoord[1] = o_6; } -// inputs: 3, stats: 19 alu 0 tex 0 flow +// stats: 19 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Color (high float) 4x1 [-1] loc 3 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 7 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _MainTex_ST (high float) 4x1 [-1] +// #2: _ProjectionParams (high float) 4x1 [-1] +// #3: _Scale (high float) 4x1 [-1] +// #4: _SquashAmount (high float) 1x1 [-1] +// #5: _SquashPlaneNormal (high float) 4x1 [-1] +// #6: _TerrainEngineBendTree (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-ir.txt deleted file mode 100644 index e3f79d8c5..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-ir.txt +++ /dev/null @@ -1,172 +0,0 @@ -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - vec3 vec; - vec2 hip_pack0; -}; -uniform vec4 _LightPositionRange; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _Scale; -uniform float _SquashAmount; -uniform vec4 _SquashPlaneNormal; -uniform mat4 _TerrainEngineBendTree; -attribute vec4 TANGENT; -vec4 Squash ( - in vec4 pos_1 -) -{ - vec3 planeNormal_2; - vec3 planePoint_3; - vec3 projectedVertex_4; - vec3 tmpvar_5; - tmpvar_5 = pos_1.xyz; - projectedVertex_4 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6.xz = vec2(0.0, 0.0); - tmpvar_6.y = _SquashPlaneNormal.w; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_6; - planePoint_3 = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = _SquashPlaneNormal.xyz; - planeNormal_2 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = pos_1.xyz; - float tmpvar_10; - tmpvar_10 = dot (planeNormal_2, (planePoint_3 - tmpvar_9)); - vec3 tmpvar_11; - tmpvar_11 = (projectedVertex_4 + (tmpvar_10 * planeNormal_2)); - projectedVertex_4 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = vec3(_SquashAmount); - vec3 tmpvar_13; - tmpvar_13 = mix (projectedVertex_4, pos_1.xyz, tmpvar_12); - vec4 tmpvar_14; - tmpvar_14.w = 1.0; - tmpvar_14.xyz = tmpvar_13.xyz; - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - pos_1 = tmpvar_15; - return pos_1; -} - -void TerrainAnimateTree ( - inout vec4 pos_16, - in float alpha_17 -) -{ - vec3 bent_18; - vec3 tmpvar_19; - tmpvar_19 = (pos_16.xyz * _Scale.xyz); - pos_16.xyz = tmpvar_19.xyz.xyz; - vec4 tmpvar_20; - tmpvar_20.w = 0.0; - tmpvar_20.xyz = pos_16.xyz.xyz; - vec3 tmpvar_21; - tmpvar_21 = (_TerrainEngineBendTree * tmpvar_20).xyz; - bent_18 = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = vec3(alpha_17); - vec3 tmpvar_23; - tmpvar_23 = mix (pos_16.xyz, bent_18, tmpvar_22); - vec3 tmpvar_24; - tmpvar_24 = tmpvar_23; - pos_16.xyz = tmpvar_24.xyz.xyz; - vec4 tmpvar_25; - tmpvar_25 = Squash (pos_16); - vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; - pos_16 = tmpvar_26; -} - -void treevertex ( - inout appdata_full v_27 -) -{ - TerrainAnimateTree (v_27.vertex, v_27.color.w); -} - -v2f_surf vert_surf ( - in appdata_full v_28 -) -{ - v2f_surf o_29; - treevertex (v_28); - vec2 tmpvar_30; - tmpvar_30 = ((v_28.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_29.hip_pack0 = tmpvar_30.xy.xy; - vec3 tmpvar_31; - tmpvar_31 = ((_Object2World * v_28.vertex).xyz - _LightPositionRange.xyz); - o_29.vec = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = (gl_ModelViewProjectionMatrix * v_28.vertex); - o_29.pos = tmpvar_32; - return o_29; -} - -void main () -{ - appdata_full xlt_v_33; - v2f_surf xl_retval_34; - vec4 tmpvar_35; - tmpvar_35 = gl_Vertex.xyzw; - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlt_v_33.vertex = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37 = TANGENT.xyzw; - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlt_v_33.tangent = tmpvar_38; - vec3 tmpvar_39; - tmpvar_39 = gl_Normal.xyz; - vec3 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_v_33.normal = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_v_33.texcoord = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_v_33.texcoord1 = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = gl_Color.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_v_33.color = tmpvar_46; - v2f_surf tmpvar_47; - tmpvar_47 = vert_surf (xlt_v_33); - v2f_surf tmpvar_48; - tmpvar_48 = tmpvar_47; - xl_retval_34 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = xl_retval_34.pos.xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - gl_Position = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51.w = 0.0; - tmpvar_51.xyz = xl_retval_34.vec.xyz; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - gl_TexCoord[0] = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53.zw = vec2(0.0, 0.0); - tmpvar_53.xy = xl_retval_34.hip_pack0.xy; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - gl_TexCoord[1] = tmpvar_54; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-out.txt index d7edb37e9..731bd8c2a 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-out.txt @@ -35,4 +35,17 @@ void main () } -// inputs: 3, stats: 18 alu 0 tex 0 flow +// stats: 18 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Color (high float) 4x1 [-1] loc 3 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 8 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _LightPositionRange (high float) 4x1 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _Scale (high float) 4x1 [-1] +// #5: _SquashAmount (high float) 1x1 [-1] +// #6: _SquashPlaneNormal (high float) 4x1 [-1] +// #7: _TerrainEngineBendTree (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-ir.txt deleted file mode 100644 index 20ca719ca..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-ir.txt +++ /dev/null @@ -1,439 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec3 lightDir; - vec3 vlight; - vec4 _ShadowCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _BumpMap_ST; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _ProjectionParams; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_4LightAtten0; -uniform vec4 unity_4LightPosX0; -uniform vec4 unity_4LightPosY0; -uniform vec4 unity_4LightPosZ0; -uniform vec3 unity_LightColor0; -uniform vec3 unity_LightColor1; -uniform vec3 unity_LightColor2; -uniform vec3 unity_LightColor3; -uniform vec4 unity_SHAb; -uniform vec4 unity_SHAg; -uniform vec4 unity_SHAr; -uniform vec4 unity_SHBb; -uniform vec4 unity_SHBg; -uniform vec4 unity_SHBr; -uniform vec4 unity_SHC; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec3 ShadeSH9 ( - in vec4 normal_9 -) -{ - vec3 x3_10; - float vC_11; - vec3 x2_12; - vec4 vB_13; - vec3 x1_14; - float tmpvar_15; - tmpvar_15 = dot (unity_SHAr, normal_9); - float tmpvar_16; - tmpvar_16 = tmpvar_15; - x1_14.x = tmpvar_16; - float tmpvar_17; - tmpvar_17 = dot (unity_SHAg, normal_9); - float tmpvar_18; - tmpvar_18 = tmpvar_17; - x1_14.y = vec2(tmpvar_18).y; - float tmpvar_19; - tmpvar_19 = dot (unity_SHAb, normal_9); - float tmpvar_20; - tmpvar_20 = tmpvar_19; - x1_14.z = vec3(tmpvar_20).z; - vec4 tmpvar_21; - tmpvar_21 = (normal_9.xyzz * normal_9.yzzx); - vB_13 = tmpvar_21; - float tmpvar_22; - tmpvar_22 = dot (unity_SHBr, vB_13); - float tmpvar_23; - tmpvar_23 = tmpvar_22; - x2_12.x = tmpvar_23; - float tmpvar_24; - tmpvar_24 = dot (unity_SHBg, vB_13); - float tmpvar_25; - tmpvar_25 = tmpvar_24; - x2_12.y = vec2(tmpvar_25).y; - float tmpvar_26; - tmpvar_26 = dot (unity_SHBb, vB_13); - float tmpvar_27; - tmpvar_27 = tmpvar_26; - x2_12.z = vec3(tmpvar_27).z; - float tmpvar_28; - tmpvar_28 = ((normal_9.x * normal_9.x) - (normal_9.y * normal_9.y)); - vC_11 = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = (unity_SHC.xyz * vC_11); - x3_10 = tmpvar_29; - return ((x1_14 + x2_12) + x3_10); -} - -vec3 Shade4PointLights ( - in vec4 lightPosX_30, - in vec4 lightPosY_31, - in vec4 lightPosZ_32, - in vec3 lightColor0_33, - in vec3 lightColor1_34, - in vec3 lightColor2_35, - in vec3 lightColor3_36, - in vec4 lightAttenSq_37, - in vec3 pos_38, - in vec3 normal_39 -) -{ - vec3 col_40; - vec4 diff_41; - vec4 atten_42; - vec4 corr_43; - vec4 ndotl_44; - vec4 lengthSq_45; - vec4 toLightZ_46; - vec4 toLightY_47; - vec4 toLightX_48; - vec4 tmpvar_49; - tmpvar_49 = (lightPosX_30 - pos_38.x); - toLightX_48 = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50 = (lightPosY_31 - pos_38.y); - toLightY_47 = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = (lightPosZ_32 - pos_38.z); - toLightZ_46 = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = vec4(0.0, 0.0, 0.0, 0.0); - lengthSq_45 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = (lengthSq_45 + (toLightX_48 * toLightX_48)); - lengthSq_45 = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54 = (lengthSq_45 + (toLightY_47 * toLightY_47)); - lengthSq_45 = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = (lengthSq_45 + (toLightZ_46 * toLightZ_46)); - lengthSq_45 = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = vec4(0.0, 0.0, 0.0, 0.0); - ndotl_44 = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = (ndotl_44 + (toLightX_48 * normal_39.x)); - ndotl_44 = tmpvar_57; - vec4 tmpvar_58; - tmpvar_58 = (ndotl_44 + (toLightY_47 * normal_39.y)); - ndotl_44 = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59 = (ndotl_44 + (toLightZ_46 * normal_39.z)); - ndotl_44 = tmpvar_59; - vec4 tmpvar_60; - tmpvar_60 = inversesqrt (lengthSq_45); - vec4 tmpvar_61; - tmpvar_61 = tmpvar_60; - corr_43 = tmpvar_61; - vec4 tmpvar_62; - tmpvar_62 = max (vec4(0.0, 0.0, 0.0, 0.0), (ndotl_44 * corr_43)); - vec4 tmpvar_63; - tmpvar_63 = tmpvar_62; - ndotl_44 = tmpvar_63; - vec4 tmpvar_64; - tmpvar_64 = (1.0 / (1.0 + (lengthSq_45 * lightAttenSq_37))); - atten_42 = tmpvar_64; - vec4 tmpvar_65; - tmpvar_65 = (ndotl_44 * atten_42); - diff_41 = tmpvar_65; - vec3 tmpvar_66; - tmpvar_66 = vec3(0.0, 0.0, 0.0); - col_40 = tmpvar_66; - vec3 tmpvar_67; - tmpvar_67 = (col_40 + (lightColor0_33 * diff_41.x)); - col_40 = tmpvar_67; - vec3 tmpvar_68; - tmpvar_68 = (col_40 + (lightColor1_34 * diff_41.y)); - col_40 = tmpvar_68; - vec3 tmpvar_69; - tmpvar_69 = (col_40 + (lightColor2_35 * diff_41.z)); - col_40 = tmpvar_69; - vec3 tmpvar_70; - tmpvar_70 = (col_40 + (lightColor3_36 * diff_41.w)); - col_40 = tmpvar_70; - return col_40; -} - -void PositionFog ( - in vec4 v_71, - out vec4 pos_72, - out float fog_73 -) -{ - vec4 tmpvar_74; - tmpvar_74 = (gl_ModelViewProjectionMatrix * v_71); - pos_72 = tmpvar_74; - float tmpvar_75; - tmpvar_75 = pos_72.z; - fog_73 = tmpvar_75; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_76 -) -{ - vec3 objSpaceCameraPos_77; - vec4 tmpvar_78; - tmpvar_78.w = 1.0; - tmpvar_78.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_79; - tmpvar_79 = ((_World2Object * tmpvar_78).xyz * unity_Scale.w); - objSpaceCameraPos_77 = tmpvar_79; - return (objSpaceCameraPos_77 - v_76.xyz); -} - -vec3 ObjSpaceLightDir ( - in vec4 v_80 -) -{ - vec3 objSpaceLightPos_81; - vec3 tmpvar_82; - tmpvar_82 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_81 = tmpvar_82; - return objSpaceLightPos_81.xyz; -} - -vec4 ComputeScreenPos ( - in vec4 pos_83 -) -{ - vec4 o_84; - vec4 tmpvar_85; - tmpvar_85 = (pos_83 * 0.5); - o_84 = tmpvar_85; - vec2 tmpvar_86; - tmpvar_86.x = o_84.x; - tmpvar_86.y = (o_84.y * _ProjectionParams.x); - vec2 tmpvar_87; - tmpvar_87 = (tmpvar_86 + o_84.w); - o_84.xy = tmpvar_87.xy.xy; - vec2 tmpvar_88; - tmpvar_88 = pos_83.zw; - o_84.zw = tmpvar_88.xxxy.zw; - return o_84; -} - -v2f_surf vert_surf ( - in appdata_full v_89 -) -{ - vec3 worldPos_90; - vec3 shlight_91; - mat3 rotation_92; - vec3 binormal_93; - vec3 worldN_94; - v2f_surf o_95; - PositionFog (v_89.vertex, o_95.pos, o_95.fog); - vec2 tmpvar_96; - tmpvar_96 = ((v_89.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_95.hip_pack0.xy = tmpvar_96.xy.xy; - vec2 tmpvar_97; - tmpvar_97 = ((v_89.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_95.hip_pack0.zw = tmpvar_97.xxxy.zw; - mat3 tmpvar_98; - tmpvar_98 = xll_constructMat3 (_Object2World); - vec3 tmpvar_99; - tmpvar_99 = (tmpvar_98 * (v_89.normal * unity_Scale.w)); - worldN_94 = tmpvar_99; - vec3 tmpvar_100; - tmpvar_100 = cross (v_89.normal, v_89.tangent.xyz); - vec3 tmpvar_101; - tmpvar_101 = (tmpvar_100 * v_89.tangent.w); - binormal_93 = tmpvar_101; - mat3 tmpvar_102; - float tmpvar_103; - tmpvar_103 = v_89.tangent.x; - tmpvar_102[0].x = tmpvar_103; - float tmpvar_104; - tmpvar_104 = binormal_93.x; - tmpvar_102[0].y = tmpvar_104; - float tmpvar_105; - tmpvar_105 = v_89.normal.x; - tmpvar_102[0].z = tmpvar_105; - float tmpvar_106; - tmpvar_106 = v_89.tangent.y; - tmpvar_102[1].x = tmpvar_106; - float tmpvar_107; - tmpvar_107 = binormal_93.y; - tmpvar_102[1].y = tmpvar_107; - float tmpvar_108; - tmpvar_108 = v_89.normal.y; - tmpvar_102[1].z = tmpvar_108; - float tmpvar_109; - tmpvar_109 = v_89.tangent.z; - tmpvar_102[2].x = tmpvar_109; - float tmpvar_110; - tmpvar_110 = binormal_93.z; - tmpvar_102[2].y = tmpvar_110; - float tmpvar_111; - tmpvar_111 = v_89.normal.z; - tmpvar_102[2].z = tmpvar_111; - mat3 tmpvar_112; - tmpvar_112 = tmpvar_102; - rotation_92 = tmpvar_112; - vec3 tmpvar_113; - tmpvar_113 = ObjSpaceLightDir (v_89.vertex); - vec3 tmpvar_114; - tmpvar_114 = (rotation_92 * tmpvar_113); - o_95.lightDir = tmpvar_114; - vec3 tmpvar_115; - tmpvar_115 = ObjSpaceViewDir (v_89.vertex); - vec3 tmpvar_116; - tmpvar_116 = (rotation_92 * tmpvar_115); - o_95.viewDir = tmpvar_116; - vec4 tmpvar_117; - tmpvar_117.w = 1.0; - tmpvar_117.xyz = worldN_94.xyz; - vec3 tmpvar_118; - tmpvar_118 = ShadeSH9 (tmpvar_117); - vec3 tmpvar_119; - tmpvar_119 = tmpvar_118; - shlight_91 = tmpvar_119; - vec3 tmpvar_120; - tmpvar_120 = shlight_91; - o_95.vlight = tmpvar_120; - vec3 tmpvar_121; - tmpvar_121 = (_Object2World * v_89.vertex).xyz; - worldPos_90 = tmpvar_121; - vec3 tmpvar_122; - tmpvar_122 = Shade4PointLights (unity_4LightPosX0, unity_4LightPosY0, unity_4LightPosZ0, unity_LightColor0, unity_LightColor1, unity_LightColor2, unity_LightColor3, unity_4LightAtten0, worldPos_90, worldN_94); - vec3 tmpvar_123; - tmpvar_123 = (o_95.vlight + tmpvar_122); - o_95.vlight = tmpvar_123; - vec4 tmpvar_124; - tmpvar_124 = ComputeScreenPos (o_95.pos); - vec4 tmpvar_125; - tmpvar_125 = tmpvar_124; - o_95._ShadowCoord = tmpvar_125; - return o_95; -} - -void main () -{ - appdata_full xlt_v_126; - v2f_surf xl_retval_127; - vec4 tmpvar_128; - tmpvar_128 = gl_Vertex.xyzw; - vec4 tmpvar_129; - tmpvar_129 = tmpvar_128; - xlt_v_126.vertex = tmpvar_129; - vec4 tmpvar_130; - tmpvar_130 = TANGENT.xyzw; - vec4 tmpvar_131; - tmpvar_131 = tmpvar_130; - xlt_v_126.tangent = tmpvar_131; - vec3 tmpvar_132; - tmpvar_132 = gl_Normal.xyz; - vec3 tmpvar_133; - tmpvar_133 = tmpvar_132; - xlt_v_126.normal = tmpvar_133; - vec4 tmpvar_134; - tmpvar_134 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_135; - tmpvar_135 = tmpvar_134; - xlt_v_126.texcoord = tmpvar_135; - vec4 tmpvar_136; - tmpvar_136 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_137; - tmpvar_137 = tmpvar_136; - xlt_v_126.texcoord1 = tmpvar_137; - vec4 tmpvar_138; - tmpvar_138 = gl_Color.xyzw; - vec4 tmpvar_139; - tmpvar_139 = tmpvar_138; - xlt_v_126.color = tmpvar_139; - v2f_surf tmpvar_140; - tmpvar_140 = vert_surf (xlt_v_126); - v2f_surf tmpvar_141; - tmpvar_141 = tmpvar_140; - xl_retval_127 = tmpvar_141; - vec4 tmpvar_142; - tmpvar_142 = xl_retval_127.pos.xyzw; - vec4 tmpvar_143; - tmpvar_143 = tmpvar_142; - gl_Position = tmpvar_143; - vec4 tmpvar_144; - tmpvar_144.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_144.x = xl_retval_127.fog; - vec4 tmpvar_145; - tmpvar_145 = tmpvar_144; - xlv_FOG = tmpvar_145; - vec4 tmpvar_146; - tmpvar_146 = xl_retval_127.hip_pack0.xyzw; - vec4 tmpvar_147; - tmpvar_147 = tmpvar_146; - gl_TexCoord[0] = tmpvar_147; - vec4 tmpvar_148; - tmpvar_148.w = 0.0; - tmpvar_148.xyz = xl_retval_127.viewDir.xyz; - vec4 tmpvar_149; - tmpvar_149 = tmpvar_148; - gl_TexCoord[1] = tmpvar_149; - vec4 tmpvar_150; - tmpvar_150.w = 0.0; - tmpvar_150.xyz = xl_retval_127.lightDir.xyz; - vec4 tmpvar_151; - tmpvar_151 = tmpvar_150; - gl_TexCoord[2] = tmpvar_151; - vec4 tmpvar_152; - tmpvar_152.w = 0.0; - tmpvar_152.xyz = xl_retval_127.vlight.xyz; - vec4 tmpvar_153; - tmpvar_153 = tmpvar_152; - gl_TexCoord[3] = tmpvar_153; - vec4 tmpvar_154; - tmpvar_154 = xl_retval_127._ShadowCoord.xyzw; - vec4 tmpvar_155; - tmpvar_155 = tmpvar_154; - gl_TexCoord[4] = tmpvar_155; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-out.txt index 1ced1167a..c32d58fed 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-out.txt @@ -25,99 +25,134 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); - tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - mat3 tmpvar_3; - tmpvar_3[0] = _Object2World[0].xyz; - tmpvar_3[1] = _Object2World[1].xyz; - tmpvar_3[2] = _Object2World[2].xyz; - vec3 tmpvar_4; - tmpvar_4 = (tmpvar_3 * (gl_Normal * unity_Scale.w)); - vec3 tmpvar_5; - tmpvar_5 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + vec3 worldPos_1; + vec3 binormal_2; + vec3 worldN_3; + vec4 tmpvar_4; + vec4 pos_5; + pos_5 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_4.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + tmpvar_4.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); mat3 tmpvar_6; - tmpvar_6[0].x = TANGENT.x; - tmpvar_6[0].y = tmpvar_5.x; - tmpvar_6[0].z = gl_Normal.x; - tmpvar_6[1].x = TANGENT.y; - tmpvar_6[1].y = tmpvar_5.y; - tmpvar_6[1].z = gl_Normal.y; - tmpvar_6[2].x = TANGENT.z; - tmpvar_6[2].y = tmpvar_5.z; - tmpvar_6[2].z = gl_Normal.z; - vec4 tmpvar_7; - tmpvar_7.w = 1.0; - tmpvar_7.xyz = _WorldSpaceCameraPos; + tmpvar_6[0] = _Object2World[0].xyz; + tmpvar_6[1] = _Object2World[1].xyz; + tmpvar_6[2] = _Object2World[2].xyz; + worldN_3 = (tmpvar_6 * (gl_Normal * unity_Scale.w)); + binormal_2 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + mat3 tmpvar_7; + tmpvar_7[0].x = TANGENT.x; + tmpvar_7[0].y = binormal_2.x; + tmpvar_7[0].z = gl_Normal.x; + tmpvar_7[1].x = TANGENT.y; + tmpvar_7[1].y = binormal_2.y; + tmpvar_7[1].z = gl_Normal.y; + tmpvar_7[2].x = TANGENT.z; + tmpvar_7[2].y = binormal_2.z; + tmpvar_7[2].z = gl_Normal.z; vec4 tmpvar_8; tmpvar_8.w = 1.0; - tmpvar_8.xyz = tmpvar_4; - vec3 x2_9; - vec3 x1_10; - x1_10.x = dot (unity_SHAr, tmpvar_8); - x1_10.y = dot (unity_SHAg, tmpvar_8); - x1_10.z = dot (unity_SHAb, tmpvar_8); - vec4 tmpvar_11; - tmpvar_11 = (tmpvar_4.xyzz * tmpvar_4.yzzx); - x2_9.x = dot (unity_SHBr, tmpvar_11); - x2_9.y = dot (unity_SHBg, tmpvar_11); - x2_9.z = dot (unity_SHBb, tmpvar_11); - vec3 tmpvar_12; - tmpvar_12 = (_Object2World * gl_Vertex).xyz; - vec4 tmpvar_13; - tmpvar_13 = (unity_4LightPosX0 - tmpvar_12.x); - vec4 tmpvar_14; - tmpvar_14 = (unity_4LightPosY0 - tmpvar_12.y); - vec4 tmpvar_15; - tmpvar_15 = (unity_4LightPosZ0 - tmpvar_12.z); - vec4 tmpvar_16; - tmpvar_16 = (((tmpvar_13 * tmpvar_13) + (tmpvar_14 * tmpvar_14)) + (tmpvar_15 * tmpvar_15)); - vec4 tmpvar_17; - tmpvar_17 = (max (vec4(0.0, 0.0, 0.0, 0.0), ( - (((tmpvar_13 * tmpvar_4.x) + (tmpvar_14 * tmpvar_4.y)) + (tmpvar_15 * tmpvar_4.z)) - * - inversesqrt(tmpvar_16) - )) * (1.0/((1.0 + - (tmpvar_16 * unity_4LightAtten0) + tmpvar_8.xyz = _WorldSpaceCameraPos; + vec4 tmpvar_9; + tmpvar_9.w = 1.0; + tmpvar_9.xyz = worldN_3; + vec3 x2_10; + vec4 vB_11; + vec3 x1_12; + x1_12.x = dot (unity_SHAr, tmpvar_9); + x1_12.y = dot (unity_SHAg, tmpvar_9); + x1_12.z = dot (unity_SHAb, tmpvar_9); + vB_11 = (worldN_3.xyzz * worldN_3.yzzx); + x2_10.x = dot (unity_SHBr, vB_11); + x2_10.y = dot (unity_SHBg, vB_11); + x2_10.z = dot (unity_SHBb, vB_11); + worldPos_1 = (_Object2World * gl_Vertex).xyz; + vec3 col_13; + vec4 diff_14; + vec4 ndotl_15; + vec4 lengthSq_16; + vec4 toLightZ_17; + vec4 toLightY_18; + vec4 toLightX_19; + toLightX_19 = (unity_4LightPosX0 - worldPos_1.x); + toLightY_18 = (unity_4LightPosY0 - worldPos_1.y); + toLightZ_17 = (unity_4LightPosZ0 - worldPos_1.z); + lengthSq_16 = (toLightX_19 * toLightX_19); + lengthSq_16 = (lengthSq_16 + (toLightY_18 * toLightY_18)); + lengthSq_16 = (lengthSq_16 + (toLightZ_17 * toLightZ_17)); + ndotl_15 = (toLightX_19 * worldN_3.x); + ndotl_15 = (ndotl_15 + (toLightY_18 * worldN_3.y)); + ndotl_15 = (ndotl_15 + (toLightZ_17 * worldN_3.z)); + vec4 tmpvar_20; + tmpvar_20 = max (vec4(0.0, 0.0, 0.0, 0.0), (ndotl_15 * inversesqrt(lengthSq_16))); + ndotl_15 = tmpvar_20; + diff_14 = (tmpvar_20 * (1.0/((1.0 + + (lengthSq_16 * unity_4LightAtten0) )))); - vec4 o_18; - vec4 tmpvar_19; - tmpvar_19 = (tmpvar_2 * 0.5); - vec2 tmpvar_20; - tmpvar_20.x = tmpvar_19.x; - tmpvar_20.y = (tmpvar_19.y * _ProjectionParams.x); - o_18.xy = (tmpvar_20 + tmpvar_19.w); - o_18.zw = tmpvar_2.zw; - gl_Position = tmpvar_2; - vec4 tmpvar_21; - tmpvar_21.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_21.x = tmpvar_2.z; - xlv_FOG = tmpvar_21; - gl_TexCoord[0] = tmpvar_1; - vec4 tmpvar_22; - tmpvar_22.w = 0.0; - tmpvar_22.xyz = (tmpvar_6 * (( - (_World2Object * tmpvar_7) - .xyz * unity_Scale.w) - gl_Vertex.xyz)); - gl_TexCoord[1] = tmpvar_22; + col_13 = (unity_LightColor0 * diff_14.x); + col_13 = (col_13 + (unity_LightColor1 * diff_14.y)); + col_13 = (col_13 + (unity_LightColor2 * diff_14.z)); + col_13 = (col_13 + (unity_LightColor3 * diff_14.w)); + vec4 o_21; + o_21 = (pos_5 * 0.5); + vec2 tmpvar_22; + tmpvar_22.x = o_21.x; + tmpvar_22.y = (o_21.y * _ProjectionParams.x); + o_21.xy = (tmpvar_22 + o_21.w); + o_21.zw = pos_5.zw; + gl_Position = pos_5; vec4 tmpvar_23; - tmpvar_23.w = 0.0; - tmpvar_23.xyz = (tmpvar_6 * (_World2Object * _WorldSpaceLightPos0).xyz); - gl_TexCoord[2] = tmpvar_23; + tmpvar_23.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_23.x = pos_5.z; + xlv_FOG = tmpvar_23; + gl_TexCoord[0] = tmpvar_4; vec4 tmpvar_24; tmpvar_24.w = 0.0; - tmpvar_24.xyz = (((x1_10 + x2_9) + (unity_SHC.xyz * - ((tmpvar_4.x * tmpvar_4.x) - (tmpvar_4.y * tmpvar_4.y)) - )) + (( - ((unity_LightColor0 * tmpvar_17.x) + (unity_LightColor1 * tmpvar_17.y)) - + - (unity_LightColor2 * tmpvar_17.z) - ) + (unity_LightColor3 * tmpvar_17.w))); - gl_TexCoord[3] = tmpvar_24; - gl_TexCoord[4] = o_18; + tmpvar_24.xyz = (tmpvar_7 * (( + (_World2Object * tmpvar_8) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); + gl_TexCoord[1] = tmpvar_24; + vec4 tmpvar_25; + tmpvar_25.w = 0.0; + tmpvar_25.xyz = (tmpvar_7 * (_World2Object * _WorldSpaceLightPos0).xyz); + gl_TexCoord[2] = tmpvar_25; + vec4 tmpvar_26; + tmpvar_26.w = 0.0; + tmpvar_26.xyz = (((x1_12 + x2_10) + (unity_SHC.xyz * + ((worldN_3.x * worldN_3.x) - (worldN_3.y * worldN_3.y)) + )) + col_13); + gl_TexCoord[3] = tmpvar_26; + gl_TexCoord[4] = o_21; } -// inputs: 4, stats: 68 alu 0 tex 0 flow +// stats: 68 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 24 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _BumpMap_ST (high float) 4x1 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _ProjectionParams (high float) 4x1 [-1] +// #5: _World2Object (high float) 4x4 [-1] +// #6: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #7: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #8: unity_4LightAtten0 (high float) 4x1 [-1] +// #9: unity_4LightPosX0 (high float) 4x1 [-1] +// #10: unity_4LightPosY0 (high float) 4x1 [-1] +// #11: unity_4LightPosZ0 (high float) 4x1 [-1] +// #12: unity_LightColor0 (high float) 3x1 [-1] +// #13: unity_LightColor1 (high float) 3x1 [-1] +// #14: unity_LightColor2 (high float) 3x1 [-1] +// #15: unity_LightColor3 (high float) 3x1 [-1] +// #16: unity_SHAb (high float) 4x1 [-1] +// #17: unity_SHAg (high float) 4x1 [-1] +// #18: unity_SHAr (high float) 4x1 [-1] +// #19: unity_SHBb (high float) 4x1 [-1] +// #20: unity_SHBg (high float) 4x1 [-1] +// #21: unity_SHBr (high float) 4x1 [-1] +// #22: unity_SHC (high float) 4x1 [-1] +// #23: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-ir.txt deleted file mode 100644 index ab619d425..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-ir.txt +++ /dev/null @@ -1,202 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec4 hip_screen; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _BumpMap_ST; -uniform vec4 _MainTex_ST; -uniform vec4 _ProjectionParams; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_6 -) -{ - vec3 objSpaceCameraPos_7; - vec4 tmpvar_8; - tmpvar_8.w = 1.0; - tmpvar_8.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_9; - tmpvar_9 = ((_World2Object * tmpvar_8).xyz * unity_Scale.w); - objSpaceCameraPos_7 = tmpvar_9; - return (objSpaceCameraPos_7 - v_6.xyz); -} - -vec4 ComputeScreenPos ( - in vec4 pos_10 -) -{ - vec4 o_11; - vec4 tmpvar_12; - tmpvar_12 = (pos_10 * 0.5); - o_11 = tmpvar_12; - vec2 tmpvar_13; - tmpvar_13.x = o_11.x; - tmpvar_13.y = (o_11.y * _ProjectionParams.x); - vec2 tmpvar_14; - tmpvar_14 = (tmpvar_13 + o_11.w); - o_11.xy = tmpvar_14.xy.xy; - vec2 tmpvar_15; - tmpvar_15 = pos_10.zw; - o_11.zw = tmpvar_15.xxxy.zw; - return o_11; -} - -v2f_surf vert_surf ( - in appdata_full v_16 -) -{ - mat3 rotation_17; - vec3 binormal_18; - v2f_surf o_19; - PositionFog (v_16.vertex, o_19.pos, o_19.fog); - vec2 tmpvar_20; - tmpvar_20 = ((v_16.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_19.hip_pack0.xy = tmpvar_20.xy.xy; - vec2 tmpvar_21; - tmpvar_21 = ((v_16.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_19.hip_pack0.zw = tmpvar_21.xxxy.zw; - vec4 tmpvar_22; - tmpvar_22 = ComputeScreenPos (o_19.pos); - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - o_19.hip_screen = tmpvar_23; - vec3 tmpvar_24; - tmpvar_24 = cross (v_16.normal, v_16.tangent.xyz); - vec3 tmpvar_25; - tmpvar_25 = (tmpvar_24 * v_16.tangent.w); - binormal_18 = tmpvar_25; - mat3 tmpvar_26; - float tmpvar_27; - tmpvar_27 = v_16.tangent.x; - tmpvar_26[0].x = tmpvar_27; - float tmpvar_28; - tmpvar_28 = binormal_18.x; - tmpvar_26[0].y = tmpvar_28; - float tmpvar_29; - tmpvar_29 = v_16.normal.x; - tmpvar_26[0].z = tmpvar_29; - float tmpvar_30; - tmpvar_30 = v_16.tangent.y; - tmpvar_26[1].x = tmpvar_30; - float tmpvar_31; - tmpvar_31 = binormal_18.y; - tmpvar_26[1].y = tmpvar_31; - float tmpvar_32; - tmpvar_32 = v_16.normal.y; - tmpvar_26[1].z = tmpvar_32; - float tmpvar_33; - tmpvar_33 = v_16.tangent.z; - tmpvar_26[2].x = tmpvar_33; - float tmpvar_34; - tmpvar_34 = binormal_18.z; - tmpvar_26[2].y = tmpvar_34; - float tmpvar_35; - tmpvar_35 = v_16.normal.z; - tmpvar_26[2].z = tmpvar_35; - mat3 tmpvar_36; - tmpvar_36 = tmpvar_26; - rotation_17 = tmpvar_36; - vec3 tmpvar_37; - tmpvar_37 = ObjSpaceViewDir (v_16.vertex); - vec3 tmpvar_38; - tmpvar_38 = (rotation_17 * tmpvar_37); - o_19.viewDir = tmpvar_38; - return o_19; -} - -void main () -{ - appdata_full xlt_v_39; - v2f_surf xl_retval_40; - vec4 tmpvar_41; - tmpvar_41 = gl_Vertex.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_v_39.vertex = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43 = TANGENT.xyzw; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_v_39.tangent = tmpvar_44; - vec3 tmpvar_45; - tmpvar_45 = gl_Normal.xyz; - vec3 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_v_39.normal = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_v_39.texcoord = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_v_39.texcoord1 = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = gl_Color.xyzw; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - xlt_v_39.color = tmpvar_52; - v2f_surf tmpvar_53; - tmpvar_53 = vert_surf (xlt_v_39); - v2f_surf tmpvar_54; - tmpvar_54 = tmpvar_53; - xl_retval_40 = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = xl_retval_40.pos.xyzw; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - gl_Position = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_57.x = xl_retval_40.fog; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - xlv_FOG = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59 = xl_retval_40.hip_pack0.xyzw; - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - gl_TexCoord[0] = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61.w = 0.0; - tmpvar_61.xyz = xl_retval_40.viewDir.xyz; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - gl_TexCoord[1] = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63 = xl_retval_40.hip_screen.xyzw; - vec4 tmpvar_64; - tmpvar_64 = tmpvar_63; - gl_TexCoord[2] = tmpvar_64; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-out.txt index 37fadb916..724d93ce3 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-out.txt @@ -8,48 +8,60 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; + vec3 binormal_1; vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); - tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - vec4 o_3; - vec4 tmpvar_4; - tmpvar_4 = (tmpvar_2 * 0.5); + vec4 pos_3; + pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); + vec4 o_4; + o_4 = (pos_3 * 0.5); vec2 tmpvar_5; - tmpvar_5.x = tmpvar_4.x; - tmpvar_5.y = (tmpvar_4.y * _ProjectionParams.x); - o_3.xy = (tmpvar_5 + tmpvar_4.w); - o_3.zw = tmpvar_2.zw; - vec3 tmpvar_6; - tmpvar_6 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); - mat3 tmpvar_7; - tmpvar_7[0].x = TANGENT.x; - tmpvar_7[0].y = tmpvar_6.x; - tmpvar_7[0].z = gl_Normal.x; - tmpvar_7[1].x = TANGENT.y; - tmpvar_7[1].y = tmpvar_6.y; - tmpvar_7[1].z = gl_Normal.y; - tmpvar_7[2].x = TANGENT.z; - tmpvar_7[2].y = tmpvar_6.z; - tmpvar_7[2].z = gl_Normal.z; + tmpvar_5.x = o_4.x; + tmpvar_5.y = (o_4.y * _ProjectionParams.x); + o_4.xy = (tmpvar_5 + o_4.w); + o_4.zw = pos_3.zw; + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + mat3 tmpvar_6; + tmpvar_6[0].x = TANGENT.x; + tmpvar_6[0].y = binormal_1.x; + tmpvar_6[0].z = gl_Normal.x; + tmpvar_6[1].x = TANGENT.y; + tmpvar_6[1].y = binormal_1.y; + tmpvar_6[1].z = gl_Normal.y; + tmpvar_6[2].x = TANGENT.z; + tmpvar_6[2].y = binormal_1.z; + tmpvar_6[2].z = gl_Normal.z; + vec4 tmpvar_7; + tmpvar_7.w = 1.0; + tmpvar_7.xyz = _WorldSpaceCameraPos; + gl_Position = pos_3; vec4 tmpvar_8; - tmpvar_8.w = 1.0; - tmpvar_8.xyz = _WorldSpaceCameraPos; - gl_Position = tmpvar_2; + tmpvar_8.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_8.x = pos_3.z; + xlv_FOG = tmpvar_8; + gl_TexCoord[0] = tmpvar_2; vec4 tmpvar_9; - tmpvar_9.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_9.x = tmpvar_2.z; - xlv_FOG = tmpvar_9; - gl_TexCoord[0] = tmpvar_1; - vec4 tmpvar_10; - tmpvar_10.w = 0.0; - tmpvar_10.xyz = (tmpvar_7 * (( - (_World2Object * tmpvar_8) + tmpvar_9.w = 0.0; + tmpvar_9.xyz = (tmpvar_6 * (( + (_World2Object * tmpvar_7) .xyz * unity_Scale.w) - gl_Vertex.xyz)); - gl_TexCoord[1] = tmpvar_10; - gl_TexCoord[2] = o_3; + gl_TexCoord[1] = tmpvar_9; + gl_TexCoord[2] = o_4; } -// inputs: 4, stats: 19 alu 0 tex 0 flow +// stats: 19 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 7 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _BumpMap_ST (high float) 4x1 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _ProjectionParams (high float) 4x1 [-1] +// #4: _World2Object (high float) 4x4 [-1] +// #5: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #6: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-ir.txt deleted file mode 100644 index bbdd26fd8..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-ir.txt +++ /dev/null @@ -1,219 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec4 hip_screen; - vec3 hip_lmapFade; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _BumpMap_ST; -uniform vec4 _MainTex_ST; -uniform vec4 _ProjectionParams; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 unity_LightmapFade; -uniform vec4 unity_LightmapST; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_6 -) -{ - vec3 objSpaceCameraPos_7; - vec4 tmpvar_8; - tmpvar_8.w = 1.0; - tmpvar_8.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_9; - tmpvar_9 = ((_World2Object * tmpvar_8).xyz * unity_Scale.w); - objSpaceCameraPos_7 = tmpvar_9; - return (objSpaceCameraPos_7 - v_6.xyz); -} - -vec4 ComputeScreenPos ( - in vec4 pos_10 -) -{ - vec4 o_11; - vec4 tmpvar_12; - tmpvar_12 = (pos_10 * 0.5); - o_11 = tmpvar_12; - vec2 tmpvar_13; - tmpvar_13.x = o_11.x; - tmpvar_13.y = (o_11.y * _ProjectionParams.x); - vec2 tmpvar_14; - tmpvar_14 = (tmpvar_13 + o_11.w); - o_11.xy = tmpvar_14.xy.xy; - vec2 tmpvar_15; - tmpvar_15 = pos_10.zw; - o_11.zw = tmpvar_15.xxxy.zw; - return o_11; -} - -v2f_surf vert_surf ( - in appdata_full v_16 -) -{ - mat3 rotation_17; - vec3 binormal_18; - v2f_surf o_19; - PositionFog (v_16.vertex, o_19.pos, o_19.fog); - vec2 tmpvar_20; - tmpvar_20 = ((v_16.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_19.hip_pack0.xy = tmpvar_20.xy.xy; - vec2 tmpvar_21; - tmpvar_21 = ((v_16.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_19.hip_pack0.zw = tmpvar_21.xxxy.zw; - vec4 tmpvar_22; - tmpvar_22 = ComputeScreenPos (o_19.pos); - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - o_19.hip_screen = tmpvar_23; - vec2 tmpvar_24; - tmpvar_24 = ((v_16.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - o_19.hip_lmapFade.xy = tmpvar_24.xy.xy; - float tmpvar_25; - tmpvar_25 = ((-( - (gl_ModelViewMatrix * v_16.vertex) - .z) * unity_LightmapFade.z) + unity_LightmapFade.w); - o_19.hip_lmapFade.z = vec3(tmpvar_25).z; - vec3 tmpvar_26; - tmpvar_26 = cross (v_16.normal, v_16.tangent.xyz); - vec3 tmpvar_27; - tmpvar_27 = (tmpvar_26 * v_16.tangent.w); - binormal_18 = tmpvar_27; - mat3 tmpvar_28; - float tmpvar_29; - tmpvar_29 = v_16.tangent.x; - tmpvar_28[0].x = tmpvar_29; - float tmpvar_30; - tmpvar_30 = binormal_18.x; - tmpvar_28[0].y = tmpvar_30; - float tmpvar_31; - tmpvar_31 = v_16.normal.x; - tmpvar_28[0].z = tmpvar_31; - float tmpvar_32; - tmpvar_32 = v_16.tangent.y; - tmpvar_28[1].x = tmpvar_32; - float tmpvar_33; - tmpvar_33 = binormal_18.y; - tmpvar_28[1].y = tmpvar_33; - float tmpvar_34; - tmpvar_34 = v_16.normal.y; - tmpvar_28[1].z = tmpvar_34; - float tmpvar_35; - tmpvar_35 = v_16.tangent.z; - tmpvar_28[2].x = tmpvar_35; - float tmpvar_36; - tmpvar_36 = binormal_18.z; - tmpvar_28[2].y = tmpvar_36; - float tmpvar_37; - tmpvar_37 = v_16.normal.z; - tmpvar_28[2].z = tmpvar_37; - mat3 tmpvar_38; - tmpvar_38 = tmpvar_28; - rotation_17 = tmpvar_38; - vec3 tmpvar_39; - tmpvar_39 = ObjSpaceViewDir (v_16.vertex); - vec3 tmpvar_40; - tmpvar_40 = (rotation_17 * tmpvar_39); - o_19.viewDir = tmpvar_40; - return o_19; -} - -void main () -{ - appdata_full xlt_v_41; - v2f_surf xl_retval_42; - vec4 tmpvar_43; - tmpvar_43 = gl_Vertex.xyzw; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_v_41.vertex = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = TANGENT.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_v_41.tangent = tmpvar_46; - vec3 tmpvar_47; - tmpvar_47 = gl_Normal.xyz; - vec3 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_v_41.normal = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_v_41.texcoord = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - xlt_v_41.texcoord1 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = gl_Color.xyzw; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - xlt_v_41.color = tmpvar_54; - v2f_surf tmpvar_55; - tmpvar_55 = vert_surf (xlt_v_41); - v2f_surf tmpvar_56; - tmpvar_56 = tmpvar_55; - xl_retval_42 = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = xl_retval_42.pos.xyzw; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - gl_Position = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_59.x = xl_retval_42.fog; - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - xlv_FOG = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61 = xl_retval_42.hip_pack0.xyzw; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - gl_TexCoord[0] = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63.w = 0.0; - tmpvar_63.xyz = xl_retval_42.viewDir.xyz; - vec4 tmpvar_64; - tmpvar_64 = tmpvar_63; - gl_TexCoord[1] = tmpvar_64; - vec4 tmpvar_65; - tmpvar_65 = xl_retval_42.hip_screen.xyzw; - vec4 tmpvar_66; - tmpvar_66 = tmpvar_65; - gl_TexCoord[2] = tmpvar_66; - vec4 tmpvar_67; - tmpvar_67.w = 0.0; - tmpvar_67.xyz = xl_retval_42.hip_lmapFade.xyz; - vec4 tmpvar_68; - tmpvar_68 = tmpvar_67; - gl_TexCoord[3] = tmpvar_68; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-out.txt index c7012b9c6..c7de6c9cb 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-out.txt @@ -10,57 +10,73 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - vec3 tmpvar_2; - vec4 tmpvar_3; - tmpvar_3 = (gl_ModelViewProjectionMatrix * gl_Vertex); - tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - vec4 o_4; - vec4 tmpvar_5; - tmpvar_5 = (tmpvar_3 * 0.5); + vec3 binormal_1; + vec4 tmpvar_2; + vec3 tmpvar_3; + vec4 pos_4; + pos_4 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); + vec4 o_5; + o_5 = (pos_4 * 0.5); vec2 tmpvar_6; - tmpvar_6.x = tmpvar_5.x; - tmpvar_6.y = (tmpvar_5.y * _ProjectionParams.x); - o_4.xy = (tmpvar_6 + tmpvar_5.w); - o_4.zw = tmpvar_3.zw; - tmpvar_2.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - tmpvar_2.z = ((-( + tmpvar_6.x = o_5.x; + tmpvar_6.y = (o_5.y * _ProjectionParams.x); + o_5.xy = (tmpvar_6 + o_5.w); + o_5.zw = pos_4.zw; + tmpvar_3.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); + tmpvar_3.z = ((-( (gl_ModelViewMatrix * gl_Vertex) .z) * unity_LightmapFade.z) + unity_LightmapFade.w); - vec3 tmpvar_7; - tmpvar_7 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); - mat3 tmpvar_8; - tmpvar_8[0].x = TANGENT.x; - tmpvar_8[0].y = tmpvar_7.x; - tmpvar_8[0].z = gl_Normal.x; - tmpvar_8[1].x = TANGENT.y; - tmpvar_8[1].y = tmpvar_7.y; - tmpvar_8[1].z = gl_Normal.y; - tmpvar_8[2].x = TANGENT.z; - tmpvar_8[2].y = tmpvar_7.z; - tmpvar_8[2].z = gl_Normal.z; + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + mat3 tmpvar_7; + tmpvar_7[0].x = TANGENT.x; + tmpvar_7[0].y = binormal_1.x; + tmpvar_7[0].z = gl_Normal.x; + tmpvar_7[1].x = TANGENT.y; + tmpvar_7[1].y = binormal_1.y; + tmpvar_7[1].z = gl_Normal.y; + tmpvar_7[2].x = TANGENT.z; + tmpvar_7[2].y = binormal_1.z; + tmpvar_7[2].z = gl_Normal.z; + vec4 tmpvar_8; + tmpvar_8.w = 1.0; + tmpvar_8.xyz = _WorldSpaceCameraPos; + gl_Position = pos_4; vec4 tmpvar_9; - tmpvar_9.w = 1.0; - tmpvar_9.xyz = _WorldSpaceCameraPos; - gl_Position = tmpvar_3; + tmpvar_9.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_9.x = pos_4.z; + xlv_FOG = tmpvar_9; + gl_TexCoord[0] = tmpvar_2; vec4 tmpvar_10; - tmpvar_10.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_10.x = tmpvar_3.z; - xlv_FOG = tmpvar_10; - gl_TexCoord[0] = tmpvar_1; + tmpvar_10.w = 0.0; + tmpvar_10.xyz = (tmpvar_7 * (( + (_World2Object * tmpvar_8) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); + gl_TexCoord[1] = tmpvar_10; + gl_TexCoord[2] = o_5; vec4 tmpvar_11; tmpvar_11.w = 0.0; - tmpvar_11.xyz = (tmpvar_8 * (( - (_World2Object * tmpvar_9) - .xyz * unity_Scale.w) - gl_Vertex.xyz)); - gl_TexCoord[1] = tmpvar_11; - gl_TexCoord[2] = o_4; - vec4 tmpvar_12; - tmpvar_12.w = 0.0; - tmpvar_12.xyz = tmpvar_2; - gl_TexCoord[3] = tmpvar_12; + tmpvar_11.xyz = tmpvar_3; + gl_TexCoord[3] = tmpvar_11; } -// inputs: 5, stats: 26 alu 0 tex 0 flow +// stats: 26 alu 0 tex 0 flow +// inputs: 5 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #2: gl_Normal (high float) 3x1 [-1] loc 2 +// #3: gl_Vertex (high float) 4x1 [-1] loc 0 +// #4: TANGENT (high float) 4x1 [-1] +// uniforms: 10 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: gl_ModelViewMatrix (high float) 4x4 [-1] +// #2: _BumpMap_ST (high float) 4x1 [-1] +// #3: _MainTex_ST (high float) 4x1 [-1] +// #4: _ProjectionParams (high float) 4x1 [-1] +// #5: _World2Object (high float) 4x4 [-1] +// #6: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #7: unity_LightmapFade (high float) 4x1 [-1] +// #8: unity_LightmapST (high float) 4x1 [-1] +// #9: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Particles_Blend-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Particles_Blend-ir.txt deleted file mode 100644 index 848c01530..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Particles_Blend-ir.txt +++ /dev/null @@ -1,70 +0,0 @@ -struct v2f { - vec4 vertex; - vec4 color; - vec2 texcoord; -}; -struct appdata_t { - vec4 vertex; - vec4 color; - vec2 texcoord; -}; -uniform vec4 _MainTex_ST; -v2f vert ( - in appdata_t v_1 -) -{ - v2f o_2; - vec4 tmpvar_3; - tmpvar_3 = (gl_ModelViewProjectionMatrix * v_1.vertex); - o_2.vertex = tmpvar_3; - vec4 tmpvar_4; - tmpvar_4 = v_1.color; - o_2.color = tmpvar_4; - vec2 tmpvar_5; - tmpvar_5 = ((v_1.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_2.texcoord = tmpvar_5; - return o_2; -} - -void main () -{ - appdata_t xlt_v_6; - v2f xl_retval_7; - vec4 tmpvar_8; - tmpvar_8 = gl_Vertex.xyzw; - vec4 tmpvar_9; - tmpvar_9 = tmpvar_8; - xlt_v_6.vertex = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10 = gl_Color.xyzw; - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - xlt_v_6.color = tmpvar_11; - vec2 tmpvar_12; - tmpvar_12 = gl_MultiTexCoord0.xy; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_12; - xlt_v_6.texcoord = tmpvar_13; - v2f tmpvar_14; - tmpvar_14 = vert (xlt_v_6); - v2f tmpvar_15; - tmpvar_15 = tmpvar_14; - xl_retval_7 = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = xl_retval_7.vertex.xyzw; - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - gl_Position = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = xl_retval_7.color.xyzw; - vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - gl_FrontColor = tmpvar_19; - vec4 tmpvar_20; - tmpvar_20.zw = vec2(0.0, 0.0); - tmpvar_20.xy = xl_retval_7.texcoord.xy; - vec4 tmpvar_21; - tmpvar_21 = tmpvar_20; - gl_TexCoord[0] = tmpvar_21; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Particles_Blend-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Particles_Blend-out.txt index f7208562b..6a7d4dd16 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Particles_Blend-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Particles_Blend-out.txt @@ -10,4 +10,11 @@ void main () } -// inputs: 3, stats: 4 alu 0 tex 0 flow +// stats: 4 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Color (high float) 4x1 [-1] loc 3 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 2 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _MainTex_ST (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-ir.txt deleted file mode 100644 index c05b093ad..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-ir.txt +++ /dev/null @@ -1,178 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 lightDir; - vec2 _LightCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _BumpMap_ST; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform mat4 _World2Object; -uniform vec4 _WorldSpaceLightPos0; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec3 ObjSpaceLightDir ( - in vec4 v_6 -) -{ - vec3 objSpaceLightPos_7; - vec3 tmpvar_8; - tmpvar_8 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_7 = tmpvar_8; - return objSpaceLightPos_7.xyz; -} - -v2f_surf vert_surf ( - in appdata_full v_9 -) -{ - mat3 rotation_10; - vec3 binormal_11; - v2f_surf o_12; - PositionFog (v_9.vertex, o_12.pos, o_12.fog); - vec2 tmpvar_13; - tmpvar_13 = ((v_9.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_12.hip_pack0.xy = tmpvar_13.xy.xy; - vec2 tmpvar_14; - tmpvar_14 = ((v_9.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_12.hip_pack0.zw = tmpvar_14.xxxy.zw; - vec3 tmpvar_15; - tmpvar_15 = cross (v_9.normal, v_9.tangent.xyz); - vec3 tmpvar_16; - tmpvar_16 = (tmpvar_15 * v_9.tangent.w); - binormal_11 = tmpvar_16; - mat3 tmpvar_17; - float tmpvar_18; - tmpvar_18 = v_9.tangent.x; - tmpvar_17[0].x = tmpvar_18; - float tmpvar_19; - tmpvar_19 = binormal_11.x; - tmpvar_17[0].y = tmpvar_19; - float tmpvar_20; - tmpvar_20 = v_9.normal.x; - tmpvar_17[0].z = tmpvar_20; - float tmpvar_21; - tmpvar_21 = v_9.tangent.y; - tmpvar_17[1].x = tmpvar_21; - float tmpvar_22; - tmpvar_22 = binormal_11.y; - tmpvar_17[1].y = tmpvar_22; - float tmpvar_23; - tmpvar_23 = v_9.normal.y; - tmpvar_17[1].z = tmpvar_23; - float tmpvar_24; - tmpvar_24 = v_9.tangent.z; - tmpvar_17[2].x = tmpvar_24; - float tmpvar_25; - tmpvar_25 = binormal_11.z; - tmpvar_17[2].y = tmpvar_25; - float tmpvar_26; - tmpvar_26 = v_9.normal.z; - tmpvar_17[2].z = tmpvar_26; - mat3 tmpvar_27; - tmpvar_27 = tmpvar_17; - rotation_10 = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = ObjSpaceLightDir (v_9.vertex); - vec3 tmpvar_29; - tmpvar_29 = (rotation_10 * tmpvar_28); - o_12.lightDir = tmpvar_29; - vec2 tmpvar_30; - tmpvar_30 = (_LightMatrix0 * (_Object2World * v_9.vertex)).xy; - o_12._LightCoord = tmpvar_30; - return o_12; -} - -void main () -{ - appdata_full xlt_v_31; - v2f_surf xl_retval_32; - vec4 tmpvar_33; - tmpvar_33 = gl_Vertex.xyzw; - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - xlt_v_31.vertex = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35 = TANGENT.xyzw; - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlt_v_31.tangent = tmpvar_36; - vec3 tmpvar_37; - tmpvar_37 = gl_Normal.xyz; - vec3 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlt_v_31.normal = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_v_31.texcoord = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_v_31.texcoord1 = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43 = gl_Color.xyzw; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_v_31.color = tmpvar_44; - v2f_surf tmpvar_45; - tmpvar_45 = vert_surf (xlt_v_31); - v2f_surf tmpvar_46; - tmpvar_46 = tmpvar_45; - xl_retval_32 = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = xl_retval_32.pos.xyzw; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - gl_Position = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_49.x = xl_retval_32.fog; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlv_FOG = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = xl_retval_32.hip_pack0.xyzw; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - gl_TexCoord[0] = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53.w = 0.0; - tmpvar_53.xyz = xl_retval_32.lightDir.xyz; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - gl_TexCoord[1] = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55.zw = vec2(0.0, 0.0); - tmpvar_55.xy = xl_retval_32._LightCoord.xy; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - gl_TexCoord[2] = tmpvar_56; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-out.txt index b22e77338..8191af76f 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-out.txt @@ -8,29 +8,29 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; + vec3 binormal_1; vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); - tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - vec3 tmpvar_3; - tmpvar_3 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + vec4 pos_3; + pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_4; tmpvar_4[0].x = TANGENT.x; - tmpvar_4[0].y = tmpvar_3.x; + tmpvar_4[0].y = binormal_1.x; tmpvar_4[0].z = gl_Normal.x; tmpvar_4[1].x = TANGENT.y; - tmpvar_4[1].y = tmpvar_3.y; + tmpvar_4[1].y = binormal_1.y; tmpvar_4[1].z = gl_Normal.y; tmpvar_4[2].x = TANGENT.z; - tmpvar_4[2].y = tmpvar_3.z; + tmpvar_4[2].y = binormal_1.z; tmpvar_4[2].z = gl_Normal.z; - gl_Position = tmpvar_2; + gl_Position = pos_3; vec4 tmpvar_5; tmpvar_5.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_5.x = tmpvar_2.z; + tmpvar_5.x = pos_3.z; xlv_FOG = tmpvar_5; - gl_TexCoord[0] = tmpvar_1; + gl_TexCoord[0] = tmpvar_2; vec4 tmpvar_6; tmpvar_6.w = 0.0; tmpvar_6.xyz = (tmpvar_4 * (_World2Object * _WorldSpaceLightPos0).xyz); @@ -42,4 +42,17 @@ void main () } -// inputs: 4, stats: 16 alu 0 tex 0 flow +// stats: 16 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 7 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _BumpMap_ST (high float) 4x1 [-1] +// #2: _LightMatrix0 (high float) 4x4 [-1] +// #3: _MainTex_ST (high float) 4x1 [-1] +// #4: _Object2World (high float) 4x4 [-1] +// #5: _World2Object (high float) 4x4 [-1] +// #6: _WorldSpaceLightPos0 (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-ir.txt deleted file mode 100644 index de25a2da5..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-ir.txt +++ /dev/null @@ -1,279 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec4 hip_screen; - vec4 TtoW0; - vec4 TtoW1; - vec4 TtoW2; - vec3 hip_lmapFade; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _BumpMap_ST; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _ProjectionParams; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 unity_LightmapFade; -uniform vec4 unity_LightmapST; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -void PositionFog ( - in vec4 v_9, - out vec4 pos_10, - out float fog_11 -) -{ - vec4 tmpvar_12; - tmpvar_12 = (gl_ModelViewProjectionMatrix * v_9); - pos_10 = tmpvar_12; - float tmpvar_13; - tmpvar_13 = pos_10.z; - fog_11 = tmpvar_13; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_14 -) -{ - vec3 objSpaceCameraPos_15; - vec4 tmpvar_16; - tmpvar_16.w = 1.0; - tmpvar_16.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_17; - tmpvar_17 = ((_World2Object * tmpvar_16).xyz * unity_Scale.w); - objSpaceCameraPos_15 = tmpvar_17; - return (objSpaceCameraPos_15 - v_14.xyz); -} - -vec4 ComputeScreenPos ( - in vec4 pos_18 -) -{ - vec4 o_19; - vec4 tmpvar_20; - tmpvar_20 = (pos_18 * 0.5); - o_19 = tmpvar_20; - vec2 tmpvar_21; - tmpvar_21.x = o_19.x; - tmpvar_21.y = (o_19.y * _ProjectionParams.x); - vec2 tmpvar_22; - tmpvar_22 = (tmpvar_21 + o_19.w); - o_19.xy = tmpvar_22.xy.xy; - vec2 tmpvar_23; - tmpvar_23 = pos_18.zw; - o_19.zw = tmpvar_23.xxxy.zw; - return o_19; -} - -v2f_surf vert_surf ( - in appdata_full v_24 -) -{ - mat3 rotation_25; - vec3 binormal_26; - vec3 worldRefl_27; - vec3 viewDir_28; - v2f_surf o_29; - PositionFog (v_24.vertex, o_29.pos, o_29.fog); - vec2 tmpvar_30; - tmpvar_30 = ((v_24.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_29.hip_pack0.xy = tmpvar_30.xy.xy; - vec2 tmpvar_31; - tmpvar_31 = ((v_24.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_29.hip_pack0.zw = tmpvar_31.xxxy.zw; - vec3 tmpvar_32; - tmpvar_32 = ObjSpaceViewDir (v_24.vertex); - vec3 tmpvar_33; - tmpvar_33 = -(tmpvar_32); - viewDir_28 = tmpvar_33; - mat3 tmpvar_34; - tmpvar_34 = xll_constructMat3 (_Object2World); - vec3 tmpvar_35; - tmpvar_35 = (tmpvar_34 * viewDir_28); - worldRefl_27 = tmpvar_35; - vec3 tmpvar_36; - tmpvar_36 = cross (v_24.normal, v_24.tangent.xyz); - vec3 tmpvar_37; - tmpvar_37 = (tmpvar_36 * v_24.tangent.w); - binormal_26 = tmpvar_37; - mat3 tmpvar_38; - float tmpvar_39; - tmpvar_39 = v_24.tangent.x; - tmpvar_38[0].x = tmpvar_39; - float tmpvar_40; - tmpvar_40 = binormal_26.x; - tmpvar_38[0].y = tmpvar_40; - float tmpvar_41; - tmpvar_41 = v_24.normal.x; - tmpvar_38[0].z = tmpvar_41; - float tmpvar_42; - tmpvar_42 = v_24.tangent.y; - tmpvar_38[1].x = tmpvar_42; - float tmpvar_43; - tmpvar_43 = binormal_26.y; - tmpvar_38[1].y = tmpvar_43; - float tmpvar_44; - tmpvar_44 = v_24.normal.y; - tmpvar_38[1].z = tmpvar_44; - float tmpvar_45; - tmpvar_45 = v_24.tangent.z; - tmpvar_38[2].x = tmpvar_45; - float tmpvar_46; - tmpvar_46 = binormal_26.z; - tmpvar_38[2].y = tmpvar_46; - float tmpvar_47; - tmpvar_47 = v_24.normal.z; - tmpvar_38[2].z = tmpvar_47; - mat3 tmpvar_48; - tmpvar_48 = tmpvar_38; - rotation_25 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49.xyz = (rotation_25 * _Object2World[0].xyz).xyz; - tmpvar_49.w = worldRefl_27.x; - vec4 tmpvar_50; - tmpvar_50 = (tmpvar_49 * unity_Scale.w); - o_29.TtoW0 = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51.xyz = (rotation_25 * _Object2World[1].xyz).xyz; - tmpvar_51.w = worldRefl_27.y; - vec4 tmpvar_52; - tmpvar_52 = (tmpvar_51 * unity_Scale.w); - o_29.TtoW1 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53.xyz = (rotation_25 * _Object2World[2].xyz).xyz; - tmpvar_53.w = worldRefl_27.z; - vec4 tmpvar_54; - tmpvar_54 = (tmpvar_53 * unity_Scale.w); - o_29.TtoW2 = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = ComputeScreenPos (o_29.pos); - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - o_29.hip_screen = tmpvar_56; - vec2 tmpvar_57; - tmpvar_57 = ((v_24.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - o_29.hip_lmapFade.xy = tmpvar_57.xy.xy; - float tmpvar_58; - tmpvar_58 = ((-( - (gl_ModelViewMatrix * v_24.vertex) - .z) * unity_LightmapFade.z) + unity_LightmapFade.w); - o_29.hip_lmapFade.z = vec3(tmpvar_58).z; - return o_29; -} - -void main () -{ - appdata_full xlt_v_59; - v2f_surf xl_retval_60; - vec4 tmpvar_61; - tmpvar_61 = gl_Vertex.xyzw; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - xlt_v_59.vertex = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63 = TANGENT.xyzw; - vec4 tmpvar_64; - tmpvar_64 = tmpvar_63; - xlt_v_59.tangent = tmpvar_64; - vec3 tmpvar_65; - tmpvar_65 = gl_Normal.xyz; - vec3 tmpvar_66; - tmpvar_66 = tmpvar_65; - xlt_v_59.normal = tmpvar_66; - vec4 tmpvar_67; - tmpvar_67 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_68; - tmpvar_68 = tmpvar_67; - xlt_v_59.texcoord = tmpvar_68; - vec4 tmpvar_69; - tmpvar_69 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_70; - tmpvar_70 = tmpvar_69; - xlt_v_59.texcoord1 = tmpvar_70; - vec4 tmpvar_71; - tmpvar_71 = gl_Color.xyzw; - vec4 tmpvar_72; - tmpvar_72 = tmpvar_71; - xlt_v_59.color = tmpvar_72; - v2f_surf tmpvar_73; - tmpvar_73 = vert_surf (xlt_v_59); - v2f_surf tmpvar_74; - tmpvar_74 = tmpvar_73; - xl_retval_60 = tmpvar_74; - vec4 tmpvar_75; - tmpvar_75 = xl_retval_60.pos.xyzw; - vec4 tmpvar_76; - tmpvar_76 = tmpvar_75; - gl_Position = tmpvar_76; - vec4 tmpvar_77; - tmpvar_77.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_77.x = xl_retval_60.fog; - vec4 tmpvar_78; - tmpvar_78 = tmpvar_77; - xlv_FOG = tmpvar_78; - vec4 tmpvar_79; - tmpvar_79 = xl_retval_60.hip_pack0.xyzw; - vec4 tmpvar_80; - tmpvar_80 = tmpvar_79; - gl_TexCoord[0] = tmpvar_80; - vec4 tmpvar_81; - tmpvar_81 = xl_retval_60.hip_screen.xyzw; - vec4 tmpvar_82; - tmpvar_82 = tmpvar_81; - gl_TexCoord[1] = tmpvar_82; - vec4 tmpvar_83; - tmpvar_83 = xl_retval_60.TtoW0.xyzw; - vec4 tmpvar_84; - tmpvar_84 = tmpvar_83; - gl_TexCoord[2] = tmpvar_84; - vec4 tmpvar_85; - tmpvar_85 = xl_retval_60.TtoW1.xyzw; - vec4 tmpvar_86; - tmpvar_86 = tmpvar_85; - gl_TexCoord[3] = tmpvar_86; - vec4 tmpvar_87; - tmpvar_87 = xl_retval_60.TtoW2.xyzw; - vec4 tmpvar_88; - tmpvar_88 = tmpvar_87; - gl_TexCoord[4] = tmpvar_88; - vec4 tmpvar_89; - tmpvar_89.w = 0.0; - tmpvar_89.xyz = xl_retval_60.hip_lmapFade.xyz; - vec4 tmpvar_90; - tmpvar_90 = tmpvar_89; - gl_TexCoord[5] = tmpvar_90; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-out.txt index 2d8db42c0..f517daddc 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-out.txt @@ -11,71 +11,88 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - vec3 tmpvar_2; + vec3 binormal_1; + vec3 worldRefl_2; vec4 tmpvar_3; - tmpvar_3 = (gl_ModelViewProjectionMatrix * gl_Vertex); - tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - vec4 tmpvar_4; - tmpvar_4.w = 1.0; - tmpvar_4.xyz = _WorldSpaceCameraPos; - mat3 tmpvar_5; - tmpvar_5[0] = _Object2World[0].xyz; - tmpvar_5[1] = _Object2World[1].xyz; - tmpvar_5[2] = _Object2World[2].xyz; - vec3 tmpvar_6; - tmpvar_6 = (tmpvar_5 * (gl_Vertex.xyz - ( - (_World2Object * tmpvar_4) + vec3 tmpvar_4; + vec4 pos_5; + pos_5 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_3.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + tmpvar_3.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); + vec4 tmpvar_6; + tmpvar_6.w = 1.0; + tmpvar_6.xyz = _WorldSpaceCameraPos; + mat3 tmpvar_7; + tmpvar_7[0] = _Object2World[0].xyz; + tmpvar_7[1] = _Object2World[1].xyz; + tmpvar_7[2] = _Object2World[2].xyz; + worldRefl_2 = (tmpvar_7 * (gl_Vertex.xyz - ( + (_World2Object * tmpvar_6) .xyz * unity_Scale.w))); - vec3 tmpvar_7; - tmpvar_7 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_8; tmpvar_8[0].x = TANGENT.x; - tmpvar_8[0].y = tmpvar_7.x; + tmpvar_8[0].y = binormal_1.x; tmpvar_8[0].z = gl_Normal.x; tmpvar_8[1].x = TANGENT.y; - tmpvar_8[1].y = tmpvar_7.y; + tmpvar_8[1].y = binormal_1.y; tmpvar_8[1].z = gl_Normal.y; tmpvar_8[2].x = TANGENT.z; - tmpvar_8[2].y = tmpvar_7.z; + tmpvar_8[2].y = binormal_1.z; tmpvar_8[2].z = gl_Normal.z; vec4 tmpvar_9; tmpvar_9.xyz = (tmpvar_8 * _Object2World[0].xyz); - tmpvar_9.w = tmpvar_6.x; + tmpvar_9.w = worldRefl_2.x; vec4 tmpvar_10; tmpvar_10.xyz = (tmpvar_8 * _Object2World[1].xyz); - tmpvar_10.w = tmpvar_6.y; + tmpvar_10.w = worldRefl_2.y; vec4 tmpvar_11; tmpvar_11.xyz = (tmpvar_8 * _Object2World[2].xyz); - tmpvar_11.w = tmpvar_6.z; + tmpvar_11.w = worldRefl_2.z; vec4 o_12; - vec4 tmpvar_13; - tmpvar_13 = (tmpvar_3 * 0.5); - vec2 tmpvar_14; - tmpvar_14.x = tmpvar_13.x; - tmpvar_14.y = (tmpvar_13.y * _ProjectionParams.x); - o_12.xy = (tmpvar_14 + tmpvar_13.w); - o_12.zw = tmpvar_3.zw; - tmpvar_2.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - tmpvar_2.z = ((-( + o_12 = (pos_5 * 0.5); + vec2 tmpvar_13; + tmpvar_13.x = o_12.x; + tmpvar_13.y = (o_12.y * _ProjectionParams.x); + o_12.xy = (tmpvar_13 + o_12.w); + o_12.zw = pos_5.zw; + tmpvar_4.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); + tmpvar_4.z = ((-( (gl_ModelViewMatrix * gl_Vertex) .z) * unity_LightmapFade.z) + unity_LightmapFade.w); - gl_Position = tmpvar_3; - vec4 tmpvar_15; - tmpvar_15.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_15.x = tmpvar_3.z; - xlv_FOG = tmpvar_15; - gl_TexCoord[0] = tmpvar_1; + gl_Position = pos_5; + vec4 tmpvar_14; + tmpvar_14.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_14.x = pos_5.z; + xlv_FOG = tmpvar_14; + gl_TexCoord[0] = tmpvar_3; gl_TexCoord[1] = o_12; gl_TexCoord[2] = (tmpvar_9 * unity_Scale.w); gl_TexCoord[3] = (tmpvar_10 * unity_Scale.w); gl_TexCoord[4] = (tmpvar_11 * unity_Scale.w); - vec4 tmpvar_16; - tmpvar_16.w = 0.0; - tmpvar_16.xyz = tmpvar_2; - gl_TexCoord[5] = tmpvar_16; + vec4 tmpvar_15; + tmpvar_15.w = 0.0; + tmpvar_15.xyz = tmpvar_4; + gl_TexCoord[5] = tmpvar_15; } -// inputs: 5, stats: 31 alu 0 tex 0 flow +// stats: 31 alu 0 tex 0 flow +// inputs: 5 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #2: gl_Normal (high float) 3x1 [-1] loc 2 +// #3: gl_Vertex (high float) 4x1 [-1] loc 0 +// #4: TANGENT (high float) 4x1 [-1] +// uniforms: 11 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: gl_ModelViewMatrix (high float) 4x4 [-1] +// #2: _BumpMap_ST (high float) 4x1 [-1] +// #3: _MainTex_ST (high float) 4x1 [-1] +// #4: _Object2World (high float) 4x4 [-1] +// #5: _ProjectionParams (high float) 4x1 [-1] +// #6: _World2Object (high float) 4x4 [-1] +// #7: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #8: unity_LightmapFade (high float) 4x1 [-1] +// #9: unity_LightmapST (high float) 4x1 [-1] +// #10: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-ir.txt deleted file mode 100644 index 54759a7fb..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-ir.txt +++ /dev/null @@ -1,206 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 lightDir; - vec3 viewDir; - vec3 _LightCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _BumpMap_ST; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_6 -) -{ - vec3 objSpaceCameraPos_7; - vec4 tmpvar_8; - tmpvar_8.w = 1.0; - tmpvar_8.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_9; - tmpvar_9 = ((_World2Object * tmpvar_8).xyz * unity_Scale.w); - objSpaceCameraPos_7 = tmpvar_9; - return (objSpaceCameraPos_7 - v_6.xyz); -} - -vec3 ObjSpaceLightDir ( - in vec4 v_10 -) -{ - vec3 objSpaceLightPos_11; - vec3 tmpvar_12; - tmpvar_12 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_11 = tmpvar_12; - return ((objSpaceLightPos_11.xyz * unity_Scale.w) - v_10.xyz); -} - -v2f_surf vert_surf ( - in appdata_full v_13 -) -{ - mat3 rotation_14; - vec3 binormal_15; - v2f_surf o_16; - PositionFog (v_13.vertex, o_16.pos, o_16.fog); - vec2 tmpvar_17; - tmpvar_17 = ((v_13.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_16.hip_pack0.xy = tmpvar_17.xy.xy; - vec2 tmpvar_18; - tmpvar_18 = ((v_13.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_16.hip_pack0.zw = tmpvar_18.xxxy.zw; - vec3 tmpvar_19; - tmpvar_19 = cross (v_13.normal, v_13.tangent.xyz); - vec3 tmpvar_20; - tmpvar_20 = (tmpvar_19 * v_13.tangent.w); - binormal_15 = tmpvar_20; - mat3 tmpvar_21; - float tmpvar_22; - tmpvar_22 = v_13.tangent.x; - tmpvar_21[0].x = tmpvar_22; - float tmpvar_23; - tmpvar_23 = binormal_15.x; - tmpvar_21[0].y = tmpvar_23; - float tmpvar_24; - tmpvar_24 = v_13.normal.x; - tmpvar_21[0].z = tmpvar_24; - float tmpvar_25; - tmpvar_25 = v_13.tangent.y; - tmpvar_21[1].x = tmpvar_25; - float tmpvar_26; - tmpvar_26 = binormal_15.y; - tmpvar_21[1].y = tmpvar_26; - float tmpvar_27; - tmpvar_27 = v_13.normal.y; - tmpvar_21[1].z = tmpvar_27; - float tmpvar_28; - tmpvar_28 = v_13.tangent.z; - tmpvar_21[2].x = tmpvar_28; - float tmpvar_29; - tmpvar_29 = binormal_15.z; - tmpvar_21[2].y = tmpvar_29; - float tmpvar_30; - tmpvar_30 = v_13.normal.z; - tmpvar_21[2].z = tmpvar_30; - mat3 tmpvar_31; - tmpvar_31 = tmpvar_21; - rotation_14 = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = ObjSpaceLightDir (v_13.vertex); - vec3 tmpvar_33; - tmpvar_33 = (rotation_14 * tmpvar_32); - o_16.lightDir = tmpvar_33; - vec3 tmpvar_34; - tmpvar_34 = ObjSpaceViewDir (v_13.vertex); - vec3 tmpvar_35; - tmpvar_35 = (rotation_14 * tmpvar_34); - o_16.viewDir = tmpvar_35; - vec3 tmpvar_36; - tmpvar_36 = (_LightMatrix0 * (_Object2World * v_13.vertex)).xyz; - o_16._LightCoord = tmpvar_36; - return o_16; -} - -void main () -{ - appdata_full xlt_v_37; - v2f_surf xl_retval_38; - vec4 tmpvar_39; - tmpvar_39 = gl_Vertex.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_v_37.vertex = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = TANGENT.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_v_37.tangent = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = gl_Normal.xyz; - vec3 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_v_37.normal = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_v_37.texcoord = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_v_37.texcoord1 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = gl_Color.xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_v_37.color = tmpvar_50; - v2f_surf tmpvar_51; - tmpvar_51 = vert_surf (xlt_v_37); - v2f_surf tmpvar_52; - tmpvar_52 = tmpvar_51; - xl_retval_38 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = xl_retval_38.pos.xyzw; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - gl_Position = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_55.x = xl_retval_38.fog; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - xlv_FOG = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = xl_retval_38.hip_pack0.xyzw; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - gl_TexCoord[0] = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59.w = 0.0; - tmpvar_59.xyz = xl_retval_38.lightDir.xyz; - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - gl_TexCoord[1] = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61.w = 0.0; - tmpvar_61.xyz = xl_retval_38.viewDir.xyz; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - gl_TexCoord[2] = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63.w = 0.0; - tmpvar_63.xyz = xl_retval_38._LightCoord.xyz; - vec4 tmpvar_64; - tmpvar_64 = tmpvar_63; - gl_TexCoord[3] = tmpvar_64; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-out.txt index 9bf1599ee..d566b0fe2 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-out.txt @@ -10,32 +10,32 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; + vec3 binormal_1; vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); - tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - vec3 tmpvar_3; - tmpvar_3 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + vec4 pos_3; + pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_4; tmpvar_4[0].x = TANGENT.x; - tmpvar_4[0].y = tmpvar_3.x; + tmpvar_4[0].y = binormal_1.x; tmpvar_4[0].z = gl_Normal.x; tmpvar_4[1].x = TANGENT.y; - tmpvar_4[1].y = tmpvar_3.y; + tmpvar_4[1].y = binormal_1.y; tmpvar_4[1].z = gl_Normal.y; tmpvar_4[2].x = TANGENT.z; - tmpvar_4[2].y = tmpvar_3.z; + tmpvar_4[2].y = binormal_1.z; tmpvar_4[2].z = gl_Normal.z; vec4 tmpvar_5; tmpvar_5.w = 1.0; tmpvar_5.xyz = _WorldSpaceCameraPos; - gl_Position = tmpvar_2; + gl_Position = pos_3; vec4 tmpvar_6; tmpvar_6.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_6.x = tmpvar_2.z; + tmpvar_6.x = pos_3.z; xlv_FOG = tmpvar_6; - gl_TexCoord[0] = tmpvar_1; + gl_TexCoord[0] = tmpvar_2; vec4 tmpvar_7; tmpvar_7.w = 0.0; tmpvar_7.xyz = (tmpvar_4 * (( @@ -55,4 +55,19 @@ void main () } -// inputs: 4, stats: 24 alu 0 tex 0 flow +// stats: 24 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 9 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _BumpMap_ST (high float) 4x1 [-1] +// #2: _LightMatrix0 (high float) 4x4 [-1] +// #3: _MainTex_ST (high float) 4x1 [-1] +// #4: _Object2World (high float) 4x4 [-1] +// #5: _World2Object (high float) 4x4 [-1] +// #6: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #7: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #8: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-ir.txt deleted file mode 100644 index 978cd6068..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-ir.txt +++ /dev/null @@ -1,177 +0,0 @@ -struct v2f_surf { - vec4 pos; - vec2 hip_pack0; - vec3 TtoV0; - vec3 TtoV1; - vec3 TtoV2; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _BumpMap_ST; -attribute vec4 TANGENT; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -v2f_surf vert_surf ( - in appdata_full v_9 -) -{ - mat3 rotation_10; - vec3 binormal_11; - v2f_surf o_12; - vec4 tmpvar_13; - tmpvar_13 = (gl_ModelViewProjectionMatrix * v_9.vertex); - o_12.pos = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = ((v_9.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_12.hip_pack0 = tmpvar_14.xy.xy; - vec3 tmpvar_15; - tmpvar_15 = cross (v_9.normal, v_9.tangent.xyz); - vec3 tmpvar_16; - tmpvar_16 = (tmpvar_15 * v_9.tangent.w); - binormal_11 = tmpvar_16; - mat3 tmpvar_17; - float tmpvar_18; - tmpvar_18 = v_9.tangent.x; - tmpvar_17[0].x = tmpvar_18; - float tmpvar_19; - tmpvar_19 = binormal_11.x; - tmpvar_17[0].y = tmpvar_19; - float tmpvar_20; - tmpvar_20 = v_9.normal.x; - tmpvar_17[0].z = tmpvar_20; - float tmpvar_21; - tmpvar_21 = v_9.tangent.y; - tmpvar_17[1].x = tmpvar_21; - float tmpvar_22; - tmpvar_22 = binormal_11.y; - tmpvar_17[1].y = tmpvar_22; - float tmpvar_23; - tmpvar_23 = v_9.normal.y; - tmpvar_17[1].z = tmpvar_23; - float tmpvar_24; - tmpvar_24 = v_9.tangent.z; - tmpvar_17[2].x = tmpvar_24; - float tmpvar_25; - tmpvar_25 = binormal_11.z; - tmpvar_17[2].y = tmpvar_25; - float tmpvar_26; - tmpvar_26 = v_9.normal.z; - tmpvar_17[2].z = tmpvar_26; - mat3 tmpvar_27; - tmpvar_27 = tmpvar_17; - rotation_10 = tmpvar_27; - mat3 tmpvar_28; - tmpvar_28 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose); - vec3 tmpvar_29; - tmpvar_29 = (rotation_10 * tmpvar_28[0].xyz); - o_12.TtoV0 = tmpvar_29; - mat3 tmpvar_30; - tmpvar_30 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose); - vec3 tmpvar_31; - tmpvar_31 = (rotation_10 * tmpvar_30[1].xyz); - o_12.TtoV1 = tmpvar_31; - mat3 tmpvar_32; - tmpvar_32 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose); - vec3 tmpvar_33; - tmpvar_33 = (rotation_10 * tmpvar_32[2].xyz); - o_12.TtoV2 = tmpvar_33; - return o_12; -} - -void main () -{ - appdata_full xlt_v_34; - v2f_surf xl_retval_35; - vec4 tmpvar_36; - tmpvar_36 = gl_Vertex.xyzw; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlt_v_34.vertex = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = TANGENT.xyzw; - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - xlt_v_34.tangent = tmpvar_39; - vec3 tmpvar_40; - tmpvar_40 = gl_Normal.xyz; - vec3 tmpvar_41; - tmpvar_41 = tmpvar_40; - xlt_v_34.normal = tmpvar_41; - vec4 tmpvar_42; - tmpvar_42 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - xlt_v_34.texcoord = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - xlt_v_34.texcoord1 = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46 = gl_Color.xyzw; - vec4 tmpvar_47; - tmpvar_47 = tmpvar_46; - xlt_v_34.color = tmpvar_47; - v2f_surf tmpvar_48; - tmpvar_48 = vert_surf (xlt_v_34); - v2f_surf tmpvar_49; - tmpvar_49 = tmpvar_48; - xl_retval_35 = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50 = xl_retval_35.pos.xyzw; - vec4 tmpvar_51; - tmpvar_51 = tmpvar_50; - gl_Position = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52.zw = vec2(0.0, 0.0); - tmpvar_52.xy = xl_retval_35.hip_pack0.xy; - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - gl_TexCoord[0] = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54.w = 0.0; - tmpvar_54.xyz = xl_retval_35.TtoV0.xyz; - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - gl_TexCoord[1] = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56.w = 0.0; - tmpvar_56.xyz = xl_retval_35.TtoV1.xyz; - vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - gl_TexCoord[2] = tmpvar_57; - vec4 tmpvar_58; - tmpvar_58.w = 0.0; - tmpvar_58.xyz = xl_retval_35.TtoV2.xyz; - vec4 tmpvar_59; - tmpvar_59 = tmpvar_58; - gl_TexCoord[3] = tmpvar_59; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-out.txt index d5d4cef51..d1e731e77 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-out.txt @@ -2,17 +2,17 @@ uniform vec4 _BumpMap_ST; attribute vec4 TANGENT; void main () { - vec3 tmpvar_1; - tmpvar_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + vec3 binormal_1; + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_2; tmpvar_2[0].x = TANGENT.x; - tmpvar_2[0].y = tmpvar_1.x; + tmpvar_2[0].y = binormal_1.x; tmpvar_2[0].z = gl_Normal.x; tmpvar_2[1].x = TANGENT.y; - tmpvar_2[1].y = tmpvar_1.y; + tmpvar_2[1].y = binormal_1.y; tmpvar_2[1].z = gl_Normal.y; tmpvar_2[2].x = TANGENT.z; - tmpvar_2[2].y = tmpvar_1.z; + tmpvar_2[2].y = binormal_1.z; tmpvar_2[2].z = gl_Normal.z; gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); vec4 tmpvar_3; @@ -34,4 +34,13 @@ void main () } -// inputs: 4, stats: 14 alu 0 tex 0 flow +// stats: 14 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 3 (total size: 0) +// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] +// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #2: _BumpMap_ST (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-ir.txt deleted file mode 100644 index ec9ac2bda..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-ir.txt +++ /dev/null @@ -1,262 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec4 hip_screen; - vec4 TtoW0; - vec4 TtoW1; - vec4 TtoW2; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _BumpMap_ST; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _ProjectionParams; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -void PositionFog ( - in vec4 v_9, - out vec4 pos_10, - out float fog_11 -) -{ - vec4 tmpvar_12; - tmpvar_12 = (gl_ModelViewProjectionMatrix * v_9); - pos_10 = tmpvar_12; - float tmpvar_13; - tmpvar_13 = pos_10.z; - fog_11 = tmpvar_13; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_14 -) -{ - vec3 objSpaceCameraPos_15; - vec4 tmpvar_16; - tmpvar_16.w = 1.0; - tmpvar_16.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_17; - tmpvar_17 = ((_World2Object * tmpvar_16).xyz * unity_Scale.w); - objSpaceCameraPos_15 = tmpvar_17; - return (objSpaceCameraPos_15 - v_14.xyz); -} - -vec4 ComputeScreenPos ( - in vec4 pos_18 -) -{ - vec4 o_19; - vec4 tmpvar_20; - tmpvar_20 = (pos_18 * 0.5); - o_19 = tmpvar_20; - vec2 tmpvar_21; - tmpvar_21.x = o_19.x; - tmpvar_21.y = (o_19.y * _ProjectionParams.x); - vec2 tmpvar_22; - tmpvar_22 = (tmpvar_21 + o_19.w); - o_19.xy = tmpvar_22.xy.xy; - vec2 tmpvar_23; - tmpvar_23 = pos_18.zw; - o_19.zw = tmpvar_23.xxxy.zw; - return o_19; -} - -v2f_surf vert_surf ( - in appdata_full v_24 -) -{ - mat3 rotation_25; - vec3 binormal_26; - vec3 worldRefl_27; - vec3 viewDir_28; - v2f_surf o_29; - PositionFog (v_24.vertex, o_29.pos, o_29.fog); - vec2 tmpvar_30; - tmpvar_30 = ((v_24.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_29.hip_pack0.xy = tmpvar_30.xy.xy; - vec2 tmpvar_31; - tmpvar_31 = ((v_24.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_29.hip_pack0.zw = tmpvar_31.xxxy.zw; - vec3 tmpvar_32; - tmpvar_32 = ObjSpaceViewDir (v_24.vertex); - vec3 tmpvar_33; - tmpvar_33 = -(tmpvar_32); - viewDir_28 = tmpvar_33; - mat3 tmpvar_34; - tmpvar_34 = xll_constructMat3 (_Object2World); - vec3 tmpvar_35; - tmpvar_35 = (tmpvar_34 * viewDir_28); - worldRefl_27 = tmpvar_35; - vec3 tmpvar_36; - tmpvar_36 = cross (v_24.normal, v_24.tangent.xyz); - vec3 tmpvar_37; - tmpvar_37 = (tmpvar_36 * v_24.tangent.w); - binormal_26 = tmpvar_37; - mat3 tmpvar_38; - float tmpvar_39; - tmpvar_39 = v_24.tangent.x; - tmpvar_38[0].x = tmpvar_39; - float tmpvar_40; - tmpvar_40 = binormal_26.x; - tmpvar_38[0].y = tmpvar_40; - float tmpvar_41; - tmpvar_41 = v_24.normal.x; - tmpvar_38[0].z = tmpvar_41; - float tmpvar_42; - tmpvar_42 = v_24.tangent.y; - tmpvar_38[1].x = tmpvar_42; - float tmpvar_43; - tmpvar_43 = binormal_26.y; - tmpvar_38[1].y = tmpvar_43; - float tmpvar_44; - tmpvar_44 = v_24.normal.y; - tmpvar_38[1].z = tmpvar_44; - float tmpvar_45; - tmpvar_45 = v_24.tangent.z; - tmpvar_38[2].x = tmpvar_45; - float tmpvar_46; - tmpvar_46 = binormal_26.z; - tmpvar_38[2].y = tmpvar_46; - float tmpvar_47; - tmpvar_47 = v_24.normal.z; - tmpvar_38[2].z = tmpvar_47; - mat3 tmpvar_48; - tmpvar_48 = tmpvar_38; - rotation_25 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49.xyz = (rotation_25 * _Object2World[0].xyz).xyz; - tmpvar_49.w = worldRefl_27.x; - vec4 tmpvar_50; - tmpvar_50 = (tmpvar_49 * unity_Scale.w); - o_29.TtoW0 = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51.xyz = (rotation_25 * _Object2World[1].xyz).xyz; - tmpvar_51.w = worldRefl_27.y; - vec4 tmpvar_52; - tmpvar_52 = (tmpvar_51 * unity_Scale.w); - o_29.TtoW1 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53.xyz = (rotation_25 * _Object2World[2].xyz).xyz; - tmpvar_53.w = worldRefl_27.z; - vec4 tmpvar_54; - tmpvar_54 = (tmpvar_53 * unity_Scale.w); - o_29.TtoW2 = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = ComputeScreenPos (o_29.pos); - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - o_29.hip_screen = tmpvar_56; - return o_29; -} - -void main () -{ - appdata_full xlt_v_57; - v2f_surf xl_retval_58; - vec4 tmpvar_59; - tmpvar_59 = gl_Vertex.xyzw; - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - xlt_v_57.vertex = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61 = TANGENT.xyzw; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - xlt_v_57.tangent = tmpvar_62; - vec3 tmpvar_63; - tmpvar_63 = gl_Normal.xyz; - vec3 tmpvar_64; - tmpvar_64 = tmpvar_63; - xlt_v_57.normal = tmpvar_64; - vec4 tmpvar_65; - tmpvar_65 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_66; - tmpvar_66 = tmpvar_65; - xlt_v_57.texcoord = tmpvar_66; - vec4 tmpvar_67; - tmpvar_67 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_68; - tmpvar_68 = tmpvar_67; - xlt_v_57.texcoord1 = tmpvar_68; - vec4 tmpvar_69; - tmpvar_69 = gl_Color.xyzw; - vec4 tmpvar_70; - tmpvar_70 = tmpvar_69; - xlt_v_57.color = tmpvar_70; - v2f_surf tmpvar_71; - tmpvar_71 = vert_surf (xlt_v_57); - v2f_surf tmpvar_72; - tmpvar_72 = tmpvar_71; - xl_retval_58 = tmpvar_72; - vec4 tmpvar_73; - tmpvar_73 = xl_retval_58.pos.xyzw; - vec4 tmpvar_74; - tmpvar_74 = tmpvar_73; - gl_Position = tmpvar_74; - vec4 tmpvar_75; - tmpvar_75.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_75.x = xl_retval_58.fog; - vec4 tmpvar_76; - tmpvar_76 = tmpvar_75; - xlv_FOG = tmpvar_76; - vec4 tmpvar_77; - tmpvar_77 = xl_retval_58.hip_pack0.xyzw; - vec4 tmpvar_78; - tmpvar_78 = tmpvar_77; - gl_TexCoord[0] = tmpvar_78; - vec4 tmpvar_79; - tmpvar_79 = xl_retval_58.hip_screen.xyzw; - vec4 tmpvar_80; - tmpvar_80 = tmpvar_79; - gl_TexCoord[1] = tmpvar_80; - vec4 tmpvar_81; - tmpvar_81 = xl_retval_58.TtoW0.xyzw; - vec4 tmpvar_82; - tmpvar_82 = tmpvar_81; - gl_TexCoord[2] = tmpvar_82; - vec4 tmpvar_83; - tmpvar_83 = xl_retval_58.TtoW1.xyzw; - vec4 tmpvar_84; - tmpvar_84 = tmpvar_83; - gl_TexCoord[3] = tmpvar_84; - vec4 tmpvar_85; - tmpvar_85 = xl_retval_58.TtoW2.xyzw; - vec4 tmpvar_86; - tmpvar_86 = tmpvar_85; - gl_TexCoord[4] = tmpvar_86; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-out.txt index 21397b28a..da8cbd002 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-out.txt @@ -9,57 +9,56 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); - tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); + vec3 binormal_1; + vec3 worldRefl_2; vec4 tmpvar_3; - tmpvar_3.w = 1.0; - tmpvar_3.xyz = _WorldSpaceCameraPos; - mat3 tmpvar_4; - tmpvar_4[0] = _Object2World[0].xyz; - tmpvar_4[1] = _Object2World[1].xyz; - tmpvar_4[2] = _Object2World[2].xyz; - vec3 tmpvar_5; - tmpvar_5 = (tmpvar_4 * (gl_Vertex.xyz - ( - (_World2Object * tmpvar_3) + vec4 pos_4; + pos_4 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_3.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + tmpvar_3.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); + vec4 tmpvar_5; + tmpvar_5.w = 1.0; + tmpvar_5.xyz = _WorldSpaceCameraPos; + mat3 tmpvar_6; + tmpvar_6[0] = _Object2World[0].xyz; + tmpvar_6[1] = _Object2World[1].xyz; + tmpvar_6[2] = _Object2World[2].xyz; + worldRefl_2 = (tmpvar_6 * (gl_Vertex.xyz - ( + (_World2Object * tmpvar_5) .xyz * unity_Scale.w))); - vec3 tmpvar_6; - tmpvar_6 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_7; tmpvar_7[0].x = TANGENT.x; - tmpvar_7[0].y = tmpvar_6.x; + tmpvar_7[0].y = binormal_1.x; tmpvar_7[0].z = gl_Normal.x; tmpvar_7[1].x = TANGENT.y; - tmpvar_7[1].y = tmpvar_6.y; + tmpvar_7[1].y = binormal_1.y; tmpvar_7[1].z = gl_Normal.y; tmpvar_7[2].x = TANGENT.z; - tmpvar_7[2].y = tmpvar_6.z; + tmpvar_7[2].y = binormal_1.z; tmpvar_7[2].z = gl_Normal.z; vec4 tmpvar_8; tmpvar_8.xyz = (tmpvar_7 * _Object2World[0].xyz); - tmpvar_8.w = tmpvar_5.x; + tmpvar_8.w = worldRefl_2.x; vec4 tmpvar_9; tmpvar_9.xyz = (tmpvar_7 * _Object2World[1].xyz); - tmpvar_9.w = tmpvar_5.y; + tmpvar_9.w = worldRefl_2.y; vec4 tmpvar_10; tmpvar_10.xyz = (tmpvar_7 * _Object2World[2].xyz); - tmpvar_10.w = tmpvar_5.z; + tmpvar_10.w = worldRefl_2.z; vec4 o_11; - vec4 tmpvar_12; - tmpvar_12 = (tmpvar_2 * 0.5); - vec2 tmpvar_13; - tmpvar_13.x = tmpvar_12.x; - tmpvar_13.y = (tmpvar_12.y * _ProjectionParams.x); - o_11.xy = (tmpvar_13 + tmpvar_12.w); - o_11.zw = tmpvar_2.zw; - gl_Position = tmpvar_2; - vec4 tmpvar_14; - tmpvar_14.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_14.x = tmpvar_2.z; - xlv_FOG = tmpvar_14; - gl_TexCoord[0] = tmpvar_1; + o_11 = (pos_4 * 0.5); + vec2 tmpvar_12; + tmpvar_12.x = o_11.x; + tmpvar_12.y = (o_11.y * _ProjectionParams.x); + o_11.xy = (tmpvar_12 + o_11.w); + o_11.zw = pos_4.zw; + gl_Position = pos_4; + vec4 tmpvar_13; + tmpvar_13.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_13.x = pos_4.z; + xlv_FOG = tmpvar_13; + gl_TexCoord[0] = tmpvar_3; gl_TexCoord[1] = o_11; gl_TexCoord[2] = (tmpvar_8 * unity_Scale.w); gl_TexCoord[3] = (tmpvar_9 * unity_Scale.w); @@ -67,4 +66,18 @@ void main () } -// inputs: 4, stats: 24 alu 0 tex 0 flow +// stats: 24 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 8 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _BumpMap_ST (high float) 4x1 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _ProjectionParams (high float) 4x1 [-1] +// #5: _World2Object (high float) 4x4 [-1] +// #6: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #7: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-ir.txt deleted file mode 100644 index 2b086cde2..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-ir.txt +++ /dev/null @@ -1,189 +0,0 @@ -struct v2f { - vec4 pos; - float fog; - vec2 uv; - vec2 uv2; - vec3 I; - vec3 TtoW0; - vec3 TtoW1; - vec3 TtoW2; -}; -struct appdata_tan { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; -}; -uniform vec4 _BumpMap_ST; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -vec3 WorldSpaceViewDir ( - in vec4 v_1 -) -{ - return (_WorldSpaceCameraPos.xyz - (_Object2World * v_1).xyz); -} - -void PositionFog ( - in vec4 v_2, - out vec4 pos_3, - out float fog_4 -) -{ - vec4 tmpvar_5; - tmpvar_5 = (gl_ModelViewProjectionMatrix * v_2); - pos_3 = tmpvar_5; - float tmpvar_6; - tmpvar_6 = pos_3.z; - fog_4 = tmpvar_6; -} - -v2f vert ( - in appdata_tan v_7 -) -{ - mat3 rotation_8; - vec3 binormal_9; - v2f o_10; - PositionFog (v_7.vertex, o_10.pos, o_10.fog); - vec2 tmpvar_11; - tmpvar_11 = ((v_7.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_10.uv = tmpvar_11; - vec2 tmpvar_12; - tmpvar_12 = ((v_7.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_10.uv2 = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13 = WorldSpaceViewDir (v_7.vertex); - vec3 tmpvar_14; - tmpvar_14 = -(tmpvar_13); - o_10.I = tmpvar_14; - vec3 tmpvar_15; - tmpvar_15 = cross (v_7.normal, v_7.tangent.xyz); - vec3 tmpvar_16; - tmpvar_16 = (tmpvar_15 * v_7.tangent.w); - binormal_9 = tmpvar_16; - mat3 tmpvar_17; - float tmpvar_18; - tmpvar_18 = v_7.tangent.x; - tmpvar_17[0].x = tmpvar_18; - float tmpvar_19; - tmpvar_19 = binormal_9.x; - tmpvar_17[0].y = tmpvar_19; - float tmpvar_20; - tmpvar_20 = v_7.normal.x; - tmpvar_17[0].z = tmpvar_20; - float tmpvar_21; - tmpvar_21 = v_7.tangent.y; - tmpvar_17[1].x = tmpvar_21; - float tmpvar_22; - tmpvar_22 = binormal_9.y; - tmpvar_17[1].y = tmpvar_22; - float tmpvar_23; - tmpvar_23 = v_7.normal.y; - tmpvar_17[1].z = tmpvar_23; - float tmpvar_24; - tmpvar_24 = v_7.tangent.z; - tmpvar_17[2].x = tmpvar_24; - float tmpvar_25; - tmpvar_25 = binormal_9.z; - tmpvar_17[2].y = tmpvar_25; - float tmpvar_26; - tmpvar_26 = v_7.normal.z; - tmpvar_17[2].z = tmpvar_26; - mat3 tmpvar_27; - tmpvar_27 = tmpvar_17; - rotation_8 = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = (rotation_8 * (_Object2World[0].xyz * unity_Scale.w)); - o_10.TtoW0 = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = (rotation_8 * (_Object2World[1].xyz * unity_Scale.w)); - o_10.TtoW1 = tmpvar_29; - vec3 tmpvar_30; - tmpvar_30 = (rotation_8 * (_Object2World[2].xyz * unity_Scale.w)); - o_10.TtoW2 = tmpvar_30; - return o_10; -} - -void main () -{ - appdata_tan xlt_v_31; - v2f xl_retval_32; - vec4 tmpvar_33; - tmpvar_33 = gl_Vertex.xyzw; - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - xlt_v_31.vertex = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35 = TANGENT.xyzw; - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlt_v_31.tangent = tmpvar_36; - vec3 tmpvar_37; - tmpvar_37 = gl_Normal.xyz; - vec3 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlt_v_31.normal = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_v_31.texcoord = tmpvar_40; - v2f tmpvar_41; - tmpvar_41 = vert (xlt_v_31); - v2f tmpvar_42; - tmpvar_42 = tmpvar_41; - xl_retval_32 = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43 = xl_retval_32.pos.xyzw; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - gl_Position = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_45.x = xl_retval_32.fog; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlv_FOG = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47.zw = vec2(0.0, 0.0); - tmpvar_47.xy = xl_retval_32.uv.xy; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - gl_TexCoord[0] = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49.zw = vec2(0.0, 0.0); - tmpvar_49.xy = xl_retval_32.uv2.xy; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - gl_TexCoord[1] = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51.w = 0.0; - tmpvar_51.xyz = xl_retval_32.I.xyz; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - gl_TexCoord[2] = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53.w = 0.0; - tmpvar_53.xyz = xl_retval_32.TtoW0.xyz; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - gl_TexCoord[3] = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55.w = 0.0; - tmpvar_55.xyz = xl_retval_32.TtoW1.xyz; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - gl_TexCoord[4] = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57.w = 0.0; - tmpvar_57.xyz = xl_retval_32.TtoW2.xyz; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - gl_TexCoord[5] = tmpvar_58; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-out.txt index 1fb57ad5b..10bf3c4a4 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-out.txt @@ -7,24 +7,24 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); - vec3 tmpvar_2; - tmpvar_2 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + vec3 binormal_1; + vec4 pos_2; + pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_3; tmpvar_3[0].x = TANGENT.x; - tmpvar_3[0].y = tmpvar_2.x; + tmpvar_3[0].y = binormal_1.x; tmpvar_3[0].z = gl_Normal.x; tmpvar_3[1].x = TANGENT.y; - tmpvar_3[1].y = tmpvar_2.y; + tmpvar_3[1].y = binormal_1.y; tmpvar_3[1].z = gl_Normal.y; tmpvar_3[2].x = TANGENT.z; - tmpvar_3[2].y = tmpvar_2.z; + tmpvar_3[2].y = binormal_1.z; tmpvar_3[2].z = gl_Normal.z; - gl_Position = tmpvar_1; + gl_Position = pos_2; vec4 tmpvar_4; tmpvar_4.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_4.x = tmpvar_1.z; + tmpvar_4.x = pos_2.z; xlv_FOG = tmpvar_4; vec4 tmpvar_5; tmpvar_5.zw = vec2(0.0, 0.0); @@ -53,4 +53,16 @@ void main () } -// inputs: 4, stats: 24 alu 0 tex 0 flow +// stats: 24 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 6 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _BumpMap_ST (high float) 4x1 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #5: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-ir.txt deleted file mode 100644 index 124993e25..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-ir.txt +++ /dev/null @@ -1,171 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec4 _LightCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec3 WorldSpaceLightDir ( - in vec4 v_9 -) -{ - vec3 worldPos_10; - vec3 tmpvar_11; - tmpvar_11 = (_Object2World * v_9).xyz; - worldPos_10 = tmpvar_11; - return (_WorldSpaceLightPos0.xyz - worldPos_10); -} - -void PositionFog ( - in vec4 v_12, - out vec4 pos_13, - out float fog_14 -) -{ - vec4 tmpvar_15; - tmpvar_15 = (gl_ModelViewProjectionMatrix * v_12); - pos_13 = tmpvar_15; - float tmpvar_16; - tmpvar_16 = pos_13.z; - fog_14 = tmpvar_16; -} - -v2f_surf vert_surf ( - in appdata_full v_17 -) -{ - v2f_surf o_18; - PositionFog (v_17.vertex, o_18.pos, o_18.fog); - vec2 tmpvar_19; - tmpvar_19 = ((v_17.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_18.hip_pack0 = tmpvar_19.xy.xy; - mat3 tmpvar_20; - tmpvar_20 = xll_constructMat3 (_Object2World); - vec3 tmpvar_21; - tmpvar_21 = (tmpvar_20 * (v_17.normal * unity_Scale.w)); - o_18.normal = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = WorldSpaceLightDir (v_17.vertex); - vec3 tmpvar_23; - tmpvar_23 = tmpvar_22; - o_18.lightDir = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = (_LightMatrix0 * (_Object2World * v_17.vertex)); - o_18._LightCoord = tmpvar_24; - return o_18; -} - -void main () -{ - appdata_full xlt_v_25; - v2f_surf xl_retval_26; - vec4 tmpvar_27; - tmpvar_27 = gl_Vertex.xyzw; - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - xlt_v_25.vertex = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = TANGENT.xyzw; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - xlt_v_25.tangent = tmpvar_30; - vec3 tmpvar_31; - tmpvar_31 = gl_Normal.xyz; - vec3 tmpvar_32; - tmpvar_32 = tmpvar_31; - xlt_v_25.normal = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - xlt_v_25.texcoord = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlt_v_25.texcoord1 = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37 = gl_Color.xyzw; - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlt_v_25.color = tmpvar_38; - v2f_surf tmpvar_39; - tmpvar_39 = vert_surf (xlt_v_25); - v2f_surf tmpvar_40; - tmpvar_40 = tmpvar_39; - xl_retval_26 = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = xl_retval_26.pos.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - gl_Position = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_43.x = xl_retval_26.fog; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlv_FOG = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45.zw = vec2(0.0, 0.0); - tmpvar_45.xy = xl_retval_26.hip_pack0.xy; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - gl_TexCoord[0] = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47.w = 0.0; - tmpvar_47.xyz = xl_retval_26.normal.xyz; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - gl_TexCoord[1] = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49.w = 0.0; - tmpvar_49.xyz = xl_retval_26.lightDir.xyz; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - gl_TexCoord[2] = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = xl_retval_26._LightCoord.xyzw; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - gl_TexCoord[3] = tmpvar_52; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-out.txt index 888a0e793..236ce480d 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-out.txt @@ -6,16 +6,16 @@ uniform vec4 unity_Scale; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_1; + pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); mat3 tmpvar_2; tmpvar_2[0] = _Object2World[0].xyz; tmpvar_2[1] = _Object2World[1].xyz; tmpvar_2[2] = _Object2World[2].xyz; - gl_Position = tmpvar_1; + gl_Position = pos_1; vec4 tmpvar_3; tmpvar_3.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_3.x = tmpvar_1.z; + tmpvar_3.x = pos_1.z; xlv_FOG = tmpvar_3; vec4 tmpvar_4; tmpvar_4.zw = vec2(0.0, 0.0); @@ -27,12 +27,23 @@ void main () gl_TexCoord[1] = tmpvar_5; vec4 tmpvar_6; tmpvar_6.w = 0.0; - vec4 cse_7; - cse_7 = (_Object2World * gl_Vertex); - tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - cse_7.xyz); + vec4 tmpvar_7; + tmpvar_7 = (_Object2World * gl_Vertex); + tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - tmpvar_7.xyz); gl_TexCoord[2] = tmpvar_6; - gl_TexCoord[3] = (_LightMatrix0 * cse_7); + gl_TexCoord[3] = (_LightMatrix0 * tmpvar_7); } -// inputs: 3, stats: 12 alu 0 tex 0 flow +// stats: 12 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 6 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _LightMatrix0 (high float) 4x4 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #5: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-ir.txt deleted file mode 100644 index 51b487d10..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-ir.txt +++ /dev/null @@ -1,197 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 worldRefl; - vec4 hip_screen; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _ProjectionParams; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -void PositionFog ( - in vec4 v_9, - out vec4 pos_10, - out float fog_11 -) -{ - vec4 tmpvar_12; - tmpvar_12 = (gl_ModelViewProjectionMatrix * v_9); - pos_10 = tmpvar_12; - float tmpvar_13; - tmpvar_13 = pos_10.z; - fog_11 = tmpvar_13; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_14 -) -{ - vec3 objSpaceCameraPos_15; - vec4 tmpvar_16; - tmpvar_16.w = 1.0; - tmpvar_16.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_17; - tmpvar_17 = ((_World2Object * tmpvar_16).xyz * unity_Scale.w); - objSpaceCameraPos_15 = tmpvar_17; - return (objSpaceCameraPos_15 - v_14.xyz); -} - -vec4 ComputeScreenPos ( - in vec4 pos_18 -) -{ - vec4 o_19; - vec4 tmpvar_20; - tmpvar_20 = (pos_18 * 0.5); - o_19 = tmpvar_20; - vec2 tmpvar_21; - tmpvar_21.x = o_19.x; - tmpvar_21.y = (o_19.y * _ProjectionParams.x); - vec2 tmpvar_22; - tmpvar_22 = (tmpvar_21 + o_19.w); - o_19.xy = tmpvar_22.xy.xy; - vec2 tmpvar_23; - tmpvar_23 = pos_18.zw; - o_19.zw = tmpvar_23.xxxy.zw; - return o_19; -} - -v2f_surf vert_surf ( - in appdata_full v_24 -) -{ - vec3 viewRefl_25; - vec3 viewDir_26; - v2f_surf o_27; - PositionFog (v_24.vertex, o_27.pos, o_27.fog); - vec2 tmpvar_28; - tmpvar_28 = ((v_24.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_27.hip_pack0 = tmpvar_28.xy.xy; - vec3 tmpvar_29; - tmpvar_29 = ObjSpaceViewDir (v_24.vertex); - vec3 tmpvar_30; - tmpvar_30 = -(tmpvar_29); - viewDir_26 = tmpvar_30; - vec3 tmpvar_31; - tmpvar_31 = reflect (viewDir_26, v_24.normal); - vec3 tmpvar_32; - tmpvar_32 = tmpvar_31; - viewRefl_25 = tmpvar_32; - mat3 tmpvar_33; - tmpvar_33 = xll_constructMat3 (_Object2World); - vec3 tmpvar_34; - tmpvar_34 = (tmpvar_33 * viewRefl_25); - o_27.worldRefl = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35 = ComputeScreenPos (o_27.pos); - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - o_27.hip_screen = tmpvar_36; - return o_27; -} - -void main () -{ - appdata_full xlt_v_37; - v2f_surf xl_retval_38; - vec4 tmpvar_39; - tmpvar_39 = gl_Vertex.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_v_37.vertex = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = TANGENT.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_v_37.tangent = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = gl_Normal.xyz; - vec3 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_v_37.normal = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_v_37.texcoord = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_v_37.texcoord1 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = gl_Color.xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_v_37.color = tmpvar_50; - v2f_surf tmpvar_51; - tmpvar_51 = vert_surf (xlt_v_37); - v2f_surf tmpvar_52; - tmpvar_52 = tmpvar_51; - xl_retval_38 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = xl_retval_38.pos.xyzw; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - gl_Position = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_55.x = xl_retval_38.fog; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - xlv_FOG = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57.zw = vec2(0.0, 0.0); - tmpvar_57.xy = xl_retval_38.hip_pack0.xy; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - gl_TexCoord[0] = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59.w = 0.0; - tmpvar_59.xyz = xl_retval_38.worldRefl.xyz; - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - gl_TexCoord[1] = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61 = xl_retval_38.hip_screen.xyzw; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - gl_TexCoord[2] = tmpvar_62; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-out.txt index 268d24ac1..759d073c5 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-out.txt @@ -7,42 +7,53 @@ uniform vec4 unity_Scale; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); - vec4 tmpvar_2; - tmpvar_2.w = 1.0; - tmpvar_2.xyz = _WorldSpaceCameraPos; - vec3 tmpvar_3; - tmpvar_3 = (gl_Vertex.xyz - ((_World2Object * tmpvar_2).xyz * unity_Scale.w)); + vec3 viewDir_1; + vec4 pos_2; + pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 tmpvar_3; + tmpvar_3.w = 1.0; + tmpvar_3.xyz = _WorldSpaceCameraPos; + viewDir_1 = (gl_Vertex.xyz - ((_World2Object * tmpvar_3).xyz * unity_Scale.w)); mat3 tmpvar_4; tmpvar_4[0] = _Object2World[0].xyz; tmpvar_4[1] = _Object2World[1].xyz; tmpvar_4[2] = _Object2World[2].xyz; vec4 o_5; - vec4 tmpvar_6; - tmpvar_6 = (tmpvar_1 * 0.5); - vec2 tmpvar_7; - tmpvar_7.x = tmpvar_6.x; - tmpvar_7.y = (tmpvar_6.y * _ProjectionParams.x); - o_5.xy = (tmpvar_7 + tmpvar_6.w); - o_5.zw = tmpvar_1.zw; - gl_Position = tmpvar_1; + o_5 = (pos_2 * 0.5); + vec2 tmpvar_6; + tmpvar_6.x = o_5.x; + tmpvar_6.y = (o_5.y * _ProjectionParams.x); + o_5.xy = (tmpvar_6 + o_5.w); + o_5.zw = pos_2.zw; + gl_Position = pos_2; + vec4 tmpvar_7; + tmpvar_7.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_7.x = pos_2.z; + xlv_FOG = tmpvar_7; vec4 tmpvar_8; - tmpvar_8.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_8.x = tmpvar_1.z; - xlv_FOG = tmpvar_8; + tmpvar_8.zw = vec2(0.0, 0.0); + tmpvar_8.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_8; vec4 tmpvar_9; - tmpvar_9.zw = vec2(0.0, 0.0); - tmpvar_9.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10.w = 0.0; - tmpvar_10.xyz = (tmpvar_4 * (tmpvar_3 - (2.0 * - (dot (gl_Normal, tmpvar_3) * gl_Normal) + tmpvar_9.w = 0.0; + tmpvar_9.xyz = (tmpvar_4 * (viewDir_1 - (2.0 * + (dot (gl_Normal, viewDir_1) * gl_Normal) ))); - gl_TexCoord[1] = tmpvar_10; + gl_TexCoord[1] = tmpvar_9; gl_TexCoord[2] = o_5; } -// inputs: 3, stats: 18 alu 0 tex 0 flow +// stats: 18 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 7 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _MainTex_ST (high float) 4x1 [-1] +// #2: _Object2World (high float) 4x4 [-1] +// #3: _ProjectionParams (high float) 4x1 [-1] +// #4: _World2Object (high float) 4x4 [-1] +// #5: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #6: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-ir.txt deleted file mode 100644 index f447ceceb..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-ir.txt +++ /dev/null @@ -1,205 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec3 lightDir; - vec4 _LightCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _BumpMap_ST; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_6 -) -{ - vec3 objSpaceCameraPos_7; - vec4 tmpvar_8; - tmpvar_8.w = 1.0; - tmpvar_8.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_9; - tmpvar_9 = ((_World2Object * tmpvar_8).xyz * unity_Scale.w); - objSpaceCameraPos_7 = tmpvar_9; - return (objSpaceCameraPos_7 - v_6.xyz); -} - -vec3 ObjSpaceLightDir ( - in vec4 v_10 -) -{ - vec3 objSpaceLightPos_11; - vec3 tmpvar_12; - tmpvar_12 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_11 = tmpvar_12; - return ((objSpaceLightPos_11.xyz * unity_Scale.w) - v_10.xyz); -} - -v2f_surf vert_surf ( - in appdata_full v_13 -) -{ - mat3 rotation_14; - vec3 binormal_15; - v2f_surf o_16; - PositionFog (v_13.vertex, o_16.pos, o_16.fog); - vec2 tmpvar_17; - tmpvar_17 = ((v_13.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_16.hip_pack0.xy = tmpvar_17.xy.xy; - vec2 tmpvar_18; - tmpvar_18 = ((v_13.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_16.hip_pack0.zw = tmpvar_18.xxxy.zw; - vec3 tmpvar_19; - tmpvar_19 = cross (v_13.normal, v_13.tangent.xyz); - vec3 tmpvar_20; - tmpvar_20 = (tmpvar_19 * v_13.tangent.w); - binormal_15 = tmpvar_20; - mat3 tmpvar_21; - float tmpvar_22; - tmpvar_22 = v_13.tangent.x; - tmpvar_21[0].x = tmpvar_22; - float tmpvar_23; - tmpvar_23 = binormal_15.x; - tmpvar_21[0].y = tmpvar_23; - float tmpvar_24; - tmpvar_24 = v_13.normal.x; - tmpvar_21[0].z = tmpvar_24; - float tmpvar_25; - tmpvar_25 = v_13.tangent.y; - tmpvar_21[1].x = tmpvar_25; - float tmpvar_26; - tmpvar_26 = binormal_15.y; - tmpvar_21[1].y = tmpvar_26; - float tmpvar_27; - tmpvar_27 = v_13.normal.y; - tmpvar_21[1].z = tmpvar_27; - float tmpvar_28; - tmpvar_28 = v_13.tangent.z; - tmpvar_21[2].x = tmpvar_28; - float tmpvar_29; - tmpvar_29 = binormal_15.z; - tmpvar_21[2].y = tmpvar_29; - float tmpvar_30; - tmpvar_30 = v_13.normal.z; - tmpvar_21[2].z = tmpvar_30; - mat3 tmpvar_31; - tmpvar_31 = tmpvar_21; - rotation_14 = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = ObjSpaceLightDir (v_13.vertex); - vec3 tmpvar_33; - tmpvar_33 = (rotation_14 * tmpvar_32); - o_16.lightDir = tmpvar_33; - vec3 tmpvar_34; - tmpvar_34 = ObjSpaceViewDir (v_13.vertex); - vec3 tmpvar_35; - tmpvar_35 = (rotation_14 * tmpvar_34); - o_16.viewDir = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36 = (_LightMatrix0 * (_Object2World * v_13.vertex)); - o_16._LightCoord = tmpvar_36; - return o_16; -} - -void main () -{ - appdata_full xlt_v_37; - v2f_surf xl_retval_38; - vec4 tmpvar_39; - tmpvar_39 = gl_Vertex.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_v_37.vertex = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = TANGENT.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_v_37.tangent = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = gl_Normal.xyz; - vec3 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_v_37.normal = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_v_37.texcoord = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_v_37.texcoord1 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = gl_Color.xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_v_37.color = tmpvar_50; - v2f_surf tmpvar_51; - tmpvar_51 = vert_surf (xlt_v_37); - v2f_surf tmpvar_52; - tmpvar_52 = tmpvar_51; - xl_retval_38 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = xl_retval_38.pos.xyzw; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - gl_Position = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_55.x = xl_retval_38.fog; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - xlv_FOG = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = xl_retval_38.hip_pack0.xyzw; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - gl_TexCoord[0] = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59.w = 0.0; - tmpvar_59.xyz = xl_retval_38.viewDir.xyz; - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - gl_TexCoord[1] = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61.w = 0.0; - tmpvar_61.xyz = xl_retval_38.lightDir.xyz; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - gl_TexCoord[2] = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63 = xl_retval_38._LightCoord.xyzw; - vec4 tmpvar_64; - tmpvar_64 = tmpvar_63; - gl_TexCoord[3] = tmpvar_64; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-out.txt index fa28b13aa..509c4ec30 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-out.txt @@ -10,32 +10,32 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; + vec3 binormal_1; vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); - tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - vec3 tmpvar_3; - tmpvar_3 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + vec4 pos_3; + pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_4; tmpvar_4[0].x = TANGENT.x; - tmpvar_4[0].y = tmpvar_3.x; + tmpvar_4[0].y = binormal_1.x; tmpvar_4[0].z = gl_Normal.x; tmpvar_4[1].x = TANGENT.y; - tmpvar_4[1].y = tmpvar_3.y; + tmpvar_4[1].y = binormal_1.y; tmpvar_4[1].z = gl_Normal.y; tmpvar_4[2].x = TANGENT.z; - tmpvar_4[2].y = tmpvar_3.z; + tmpvar_4[2].y = binormal_1.z; tmpvar_4[2].z = gl_Normal.z; vec4 tmpvar_5; tmpvar_5.w = 1.0; tmpvar_5.xyz = _WorldSpaceCameraPos; - gl_Position = tmpvar_2; + gl_Position = pos_3; vec4 tmpvar_6; tmpvar_6.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_6.x = tmpvar_2.z; + tmpvar_6.x = pos_3.z; xlv_FOG = tmpvar_6; - gl_TexCoord[0] = tmpvar_1; + gl_TexCoord[0] = tmpvar_2; vec4 tmpvar_7; tmpvar_7.w = 0.0; tmpvar_7.xyz = (tmpvar_4 * (( @@ -52,4 +52,19 @@ void main () } -// inputs: 4, stats: 23 alu 0 tex 0 flow +// stats: 23 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 9 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _BumpMap_ST (high float) 4x1 [-1] +// #2: _LightMatrix0 (high float) 4x4 [-1] +// #3: _MainTex_ST (high float) 4x1 [-1] +// #4: _Object2World (high float) 4x4 [-1] +// #5: _World2Object (high float) 4x4 [-1] +// #6: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #7: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #8: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-ir.txt deleted file mode 100644 index 6296db159..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-ir.txt +++ /dev/null @@ -1,274 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec4 hip_screen; - vec4 TtoW0; - vec4 TtoW1; - vec4 TtoW2; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _BumpMap_ST; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _ProjectionParams; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -void PositionFog ( - in vec4 v_9, - out vec4 pos_10, - out float fog_11 -) -{ - vec4 tmpvar_12; - tmpvar_12 = (gl_ModelViewProjectionMatrix * v_9); - pos_10 = tmpvar_12; - float tmpvar_13; - tmpvar_13 = pos_10.z; - fog_11 = tmpvar_13; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_14 -) -{ - vec3 objSpaceCameraPos_15; - vec4 tmpvar_16; - tmpvar_16.w = 1.0; - tmpvar_16.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_17; - tmpvar_17 = ((_World2Object * tmpvar_16).xyz * unity_Scale.w); - objSpaceCameraPos_15 = tmpvar_17; - return (objSpaceCameraPos_15 - v_14.xyz); -} - -vec4 ComputeScreenPos ( - in vec4 pos_18 -) -{ - vec4 o_19; - vec4 tmpvar_20; - tmpvar_20 = (pos_18 * 0.5); - o_19 = tmpvar_20; - vec2 tmpvar_21; - tmpvar_21.x = o_19.x; - tmpvar_21.y = (o_19.y * _ProjectionParams.x); - vec2 tmpvar_22; - tmpvar_22 = (tmpvar_21 + o_19.w); - o_19.xy = tmpvar_22.xy.xy; - vec2 tmpvar_23; - tmpvar_23 = pos_18.zw; - o_19.zw = tmpvar_23.xxxy.zw; - return o_19; -} - -v2f_surf vert_surf ( - in appdata_full v_24 -) -{ - mat3 rotation_25; - vec3 binormal_26; - vec3 worldRefl_27; - vec3 viewDir_28; - v2f_surf o_29; - PositionFog (v_24.vertex, o_29.pos, o_29.fog); - vec2 tmpvar_30; - tmpvar_30 = ((v_24.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_29.hip_pack0.xy = tmpvar_30.xy.xy; - vec2 tmpvar_31; - tmpvar_31 = ((v_24.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_29.hip_pack0.zw = tmpvar_31.xxxy.zw; - vec3 tmpvar_32; - tmpvar_32 = ObjSpaceViewDir (v_24.vertex); - vec3 tmpvar_33; - tmpvar_33 = -(tmpvar_32); - viewDir_28 = tmpvar_33; - mat3 tmpvar_34; - tmpvar_34 = xll_constructMat3 (_Object2World); - vec3 tmpvar_35; - tmpvar_35 = (tmpvar_34 * viewDir_28); - worldRefl_27 = tmpvar_35; - vec3 tmpvar_36; - tmpvar_36 = cross (v_24.normal, v_24.tangent.xyz); - vec3 tmpvar_37; - tmpvar_37 = (tmpvar_36 * v_24.tangent.w); - binormal_26 = tmpvar_37; - mat3 tmpvar_38; - float tmpvar_39; - tmpvar_39 = v_24.tangent.x; - tmpvar_38[0].x = tmpvar_39; - float tmpvar_40; - tmpvar_40 = binormal_26.x; - tmpvar_38[0].y = tmpvar_40; - float tmpvar_41; - tmpvar_41 = v_24.normal.x; - tmpvar_38[0].z = tmpvar_41; - float tmpvar_42; - tmpvar_42 = v_24.tangent.y; - tmpvar_38[1].x = tmpvar_42; - float tmpvar_43; - tmpvar_43 = binormal_26.y; - tmpvar_38[1].y = tmpvar_43; - float tmpvar_44; - tmpvar_44 = v_24.normal.y; - tmpvar_38[1].z = tmpvar_44; - float tmpvar_45; - tmpvar_45 = v_24.tangent.z; - tmpvar_38[2].x = tmpvar_45; - float tmpvar_46; - tmpvar_46 = binormal_26.z; - tmpvar_38[2].y = tmpvar_46; - float tmpvar_47; - tmpvar_47 = v_24.normal.z; - tmpvar_38[2].z = tmpvar_47; - mat3 tmpvar_48; - tmpvar_48 = tmpvar_38; - rotation_25 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49.xyz = (rotation_25 * _Object2World[0].xyz).xyz; - tmpvar_49.w = worldRefl_27.x; - vec4 tmpvar_50; - tmpvar_50 = (tmpvar_49 * unity_Scale.w); - o_29.TtoW0 = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51.xyz = (rotation_25 * _Object2World[1].xyz).xyz; - tmpvar_51.w = worldRefl_27.y; - vec4 tmpvar_52; - tmpvar_52 = (tmpvar_51 * unity_Scale.w); - o_29.TtoW1 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53.xyz = (rotation_25 * _Object2World[2].xyz).xyz; - tmpvar_53.w = worldRefl_27.z; - vec4 tmpvar_54; - tmpvar_54 = (tmpvar_53 * unity_Scale.w); - o_29.TtoW2 = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = ComputeScreenPos (o_29.pos); - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - o_29.hip_screen = tmpvar_56; - vec3 tmpvar_57; - tmpvar_57 = ObjSpaceViewDir (v_24.vertex); - vec3 tmpvar_58; - tmpvar_58 = (rotation_25 * tmpvar_57); - o_29.viewDir = tmpvar_58; - return o_29; -} - -void main () -{ - appdata_full xlt_v_59; - v2f_surf xl_retval_60; - vec4 tmpvar_61; - tmpvar_61 = gl_Vertex.xyzw; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - xlt_v_59.vertex = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63 = TANGENT.xyzw; - vec4 tmpvar_64; - tmpvar_64 = tmpvar_63; - xlt_v_59.tangent = tmpvar_64; - vec3 tmpvar_65; - tmpvar_65 = gl_Normal.xyz; - vec3 tmpvar_66; - tmpvar_66 = tmpvar_65; - xlt_v_59.normal = tmpvar_66; - vec4 tmpvar_67; - tmpvar_67 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_68; - tmpvar_68 = tmpvar_67; - xlt_v_59.texcoord = tmpvar_68; - vec4 tmpvar_69; - tmpvar_69 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_70; - tmpvar_70 = tmpvar_69; - xlt_v_59.texcoord1 = tmpvar_70; - vec4 tmpvar_71; - tmpvar_71 = gl_Color.xyzw; - vec4 tmpvar_72; - tmpvar_72 = tmpvar_71; - xlt_v_59.color = tmpvar_72; - v2f_surf tmpvar_73; - tmpvar_73 = vert_surf (xlt_v_59); - v2f_surf tmpvar_74; - tmpvar_74 = tmpvar_73; - xl_retval_60 = tmpvar_74; - vec4 tmpvar_75; - tmpvar_75 = xl_retval_60.pos.xyzw; - vec4 tmpvar_76; - tmpvar_76 = tmpvar_75; - gl_Position = tmpvar_76; - vec4 tmpvar_77; - tmpvar_77.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_77.x = xl_retval_60.fog; - vec4 tmpvar_78; - tmpvar_78 = tmpvar_77; - xlv_FOG = tmpvar_78; - vec4 tmpvar_79; - tmpvar_79 = xl_retval_60.hip_pack0.xyzw; - vec4 tmpvar_80; - tmpvar_80 = tmpvar_79; - gl_TexCoord[0] = tmpvar_80; - vec4 tmpvar_81; - tmpvar_81.w = 0.0; - tmpvar_81.xyz = xl_retval_60.viewDir.xyz; - vec4 tmpvar_82; - tmpvar_82 = tmpvar_81; - gl_TexCoord[1] = tmpvar_82; - vec4 tmpvar_83; - tmpvar_83 = xl_retval_60.hip_screen.xyzw; - vec4 tmpvar_84; - tmpvar_84 = tmpvar_83; - gl_TexCoord[2] = tmpvar_84; - vec4 tmpvar_85; - tmpvar_85 = xl_retval_60.TtoW0.xyzw; - vec4 tmpvar_86; - tmpvar_86 = tmpvar_85; - gl_TexCoord[3] = tmpvar_86; - vec4 tmpvar_87; - tmpvar_87 = xl_retval_60.TtoW1.xyzw; - vec4 tmpvar_88; - tmpvar_88 = tmpvar_87; - gl_TexCoord[4] = tmpvar_88; - vec4 tmpvar_89; - tmpvar_89 = xl_retval_60.TtoW2.xyzw; - vec4 tmpvar_90; - tmpvar_90 = tmpvar_89; - gl_TexCoord[5] = tmpvar_90; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-out.txt index 6849eeb38..962b77757 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-out.txt @@ -9,66 +9,65 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); - tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); + vec3 binormal_1; + vec3 worldRefl_2; vec4 tmpvar_3; - tmpvar_3.w = 1.0; - tmpvar_3.xyz = _WorldSpaceCameraPos; - mat3 tmpvar_4; - tmpvar_4[0] = _Object2World[0].xyz; - tmpvar_4[1] = _Object2World[1].xyz; - tmpvar_4[2] = _Object2World[2].xyz; - vec3 tmpvar_5; - tmpvar_5 = (tmpvar_4 * (gl_Vertex.xyz - ( - (_World2Object * tmpvar_3) + vec4 pos_4; + pos_4 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_3.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + tmpvar_3.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); + vec4 tmpvar_5; + tmpvar_5.w = 1.0; + tmpvar_5.xyz = _WorldSpaceCameraPos; + mat3 tmpvar_6; + tmpvar_6[0] = _Object2World[0].xyz; + tmpvar_6[1] = _Object2World[1].xyz; + tmpvar_6[2] = _Object2World[2].xyz; + worldRefl_2 = (tmpvar_6 * (gl_Vertex.xyz - ( + (_World2Object * tmpvar_5) .xyz * unity_Scale.w))); - vec3 tmpvar_6; - tmpvar_6 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_7; tmpvar_7[0].x = TANGENT.x; - tmpvar_7[0].y = tmpvar_6.x; + tmpvar_7[0].y = binormal_1.x; tmpvar_7[0].z = gl_Normal.x; tmpvar_7[1].x = TANGENT.y; - tmpvar_7[1].y = tmpvar_6.y; + tmpvar_7[1].y = binormal_1.y; tmpvar_7[1].z = gl_Normal.y; tmpvar_7[2].x = TANGENT.z; - tmpvar_7[2].y = tmpvar_6.z; + tmpvar_7[2].y = binormal_1.z; tmpvar_7[2].z = gl_Normal.z; vec4 tmpvar_8; tmpvar_8.xyz = (tmpvar_7 * _Object2World[0].xyz); - tmpvar_8.w = tmpvar_5.x; + tmpvar_8.w = worldRefl_2.x; vec4 tmpvar_9; tmpvar_9.xyz = (tmpvar_7 * _Object2World[1].xyz); - tmpvar_9.w = tmpvar_5.y; + tmpvar_9.w = worldRefl_2.y; vec4 tmpvar_10; tmpvar_10.xyz = (tmpvar_7 * _Object2World[2].xyz); - tmpvar_10.w = tmpvar_5.z; + tmpvar_10.w = worldRefl_2.z; vec4 o_11; - vec4 tmpvar_12; - tmpvar_12 = (tmpvar_2 * 0.5); - vec2 tmpvar_13; - tmpvar_13.x = tmpvar_12.x; - tmpvar_13.y = (tmpvar_12.y * _ProjectionParams.x); - o_11.xy = (tmpvar_13 + tmpvar_12.w); - o_11.zw = tmpvar_2.zw; + o_11 = (pos_4 * 0.5); + vec2 tmpvar_12; + tmpvar_12.x = o_11.x; + tmpvar_12.y = (o_11.y * _ProjectionParams.x); + o_11.xy = (tmpvar_12 + o_11.w); + o_11.zw = pos_4.zw; + vec4 tmpvar_13; + tmpvar_13.w = 1.0; + tmpvar_13.xyz = _WorldSpaceCameraPos; + gl_Position = pos_4; vec4 tmpvar_14; - tmpvar_14.w = 1.0; - tmpvar_14.xyz = _WorldSpaceCameraPos; - gl_Position = tmpvar_2; + tmpvar_14.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_14.x = pos_4.z; + xlv_FOG = tmpvar_14; + gl_TexCoord[0] = tmpvar_3; vec4 tmpvar_15; - tmpvar_15.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_15.x = tmpvar_2.z; - xlv_FOG = tmpvar_15; - gl_TexCoord[0] = tmpvar_1; - vec4 tmpvar_16; - tmpvar_16.w = 0.0; - tmpvar_16.xyz = (tmpvar_7 * (( - (_World2Object * tmpvar_14) + tmpvar_15.w = 0.0; + tmpvar_15.xyz = (tmpvar_7 * (( + (_World2Object * tmpvar_13) .xyz * unity_Scale.w) - gl_Vertex.xyz)); - gl_TexCoord[1] = tmpvar_16; + gl_TexCoord[1] = tmpvar_15; gl_TexCoord[2] = o_11; gl_TexCoord[3] = (tmpvar_8 * unity_Scale.w); gl_TexCoord[4] = (tmpvar_9 * unity_Scale.w); @@ -76,4 +75,18 @@ void main () } -// inputs: 4, stats: 30 alu 0 tex 0 flow +// stats: 30 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 8 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _BumpMap_ST (high float) 4x1 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _ProjectionParams (high float) 4x1 [-1] +// #5: _World2Object (high float) 4x4 [-1] +// #6: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #7: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-ir.txt deleted file mode 100644 index b4bd5df69..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-ir.txt +++ /dev/null @@ -1,206 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec3 lightDir; - vec3 _LightCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _BumpMap_ST; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_6 -) -{ - vec3 objSpaceCameraPos_7; - vec4 tmpvar_8; - tmpvar_8.w = 1.0; - tmpvar_8.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_9; - tmpvar_9 = ((_World2Object * tmpvar_8).xyz * unity_Scale.w); - objSpaceCameraPos_7 = tmpvar_9; - return (objSpaceCameraPos_7 - v_6.xyz); -} - -vec3 ObjSpaceLightDir ( - in vec4 v_10 -) -{ - vec3 objSpaceLightPos_11; - vec3 tmpvar_12; - tmpvar_12 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_11 = tmpvar_12; - return ((objSpaceLightPos_11.xyz * unity_Scale.w) - v_10.xyz); -} - -v2f_surf vert_surf ( - in appdata_full v_13 -) -{ - mat3 rotation_14; - vec3 binormal_15; - v2f_surf o_16; - PositionFog (v_13.vertex, o_16.pos, o_16.fog); - vec2 tmpvar_17; - tmpvar_17 = ((v_13.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_16.hip_pack0.xy = tmpvar_17.xy.xy; - vec2 tmpvar_18; - tmpvar_18 = ((v_13.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_16.hip_pack0.zw = tmpvar_18.xxxy.zw; - vec3 tmpvar_19; - tmpvar_19 = cross (v_13.normal, v_13.tangent.xyz); - vec3 tmpvar_20; - tmpvar_20 = (tmpvar_19 * v_13.tangent.w); - binormal_15 = tmpvar_20; - mat3 tmpvar_21; - float tmpvar_22; - tmpvar_22 = v_13.tangent.x; - tmpvar_21[0].x = tmpvar_22; - float tmpvar_23; - tmpvar_23 = binormal_15.x; - tmpvar_21[0].y = tmpvar_23; - float tmpvar_24; - tmpvar_24 = v_13.normal.x; - tmpvar_21[0].z = tmpvar_24; - float tmpvar_25; - tmpvar_25 = v_13.tangent.y; - tmpvar_21[1].x = tmpvar_25; - float tmpvar_26; - tmpvar_26 = binormal_15.y; - tmpvar_21[1].y = tmpvar_26; - float tmpvar_27; - tmpvar_27 = v_13.normal.y; - tmpvar_21[1].z = tmpvar_27; - float tmpvar_28; - tmpvar_28 = v_13.tangent.z; - tmpvar_21[2].x = tmpvar_28; - float tmpvar_29; - tmpvar_29 = binormal_15.z; - tmpvar_21[2].y = tmpvar_29; - float tmpvar_30; - tmpvar_30 = v_13.normal.z; - tmpvar_21[2].z = tmpvar_30; - mat3 tmpvar_31; - tmpvar_31 = tmpvar_21; - rotation_14 = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = ObjSpaceLightDir (v_13.vertex); - vec3 tmpvar_33; - tmpvar_33 = (rotation_14 * tmpvar_32); - o_16.lightDir = tmpvar_33; - vec3 tmpvar_34; - tmpvar_34 = ObjSpaceViewDir (v_13.vertex); - vec3 tmpvar_35; - tmpvar_35 = (rotation_14 * tmpvar_34); - o_16.viewDir = tmpvar_35; - vec3 tmpvar_36; - tmpvar_36 = (_LightMatrix0 * (_Object2World * v_13.vertex)).xyz; - o_16._LightCoord = tmpvar_36; - return o_16; -} - -void main () -{ - appdata_full xlt_v_37; - v2f_surf xl_retval_38; - vec4 tmpvar_39; - tmpvar_39 = gl_Vertex.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_v_37.vertex = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = TANGENT.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_v_37.tangent = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = gl_Normal.xyz; - vec3 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_v_37.normal = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_v_37.texcoord = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_v_37.texcoord1 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = gl_Color.xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_v_37.color = tmpvar_50; - v2f_surf tmpvar_51; - tmpvar_51 = vert_surf (xlt_v_37); - v2f_surf tmpvar_52; - tmpvar_52 = tmpvar_51; - xl_retval_38 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = xl_retval_38.pos.xyzw; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - gl_Position = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_55.x = xl_retval_38.fog; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - xlv_FOG = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = xl_retval_38.hip_pack0.xyzw; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - gl_TexCoord[0] = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59.w = 0.0; - tmpvar_59.xyz = xl_retval_38.viewDir.xyz; - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - gl_TexCoord[1] = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61.w = 0.0; - tmpvar_61.xyz = xl_retval_38.lightDir.xyz; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - gl_TexCoord[2] = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63.w = 0.0; - tmpvar_63.xyz = xl_retval_38._LightCoord.xyz; - vec4 tmpvar_64; - tmpvar_64 = tmpvar_63; - gl_TexCoord[3] = tmpvar_64; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-out.txt index a130481e9..0772d9201 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-out.txt @@ -10,32 +10,32 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; + vec3 binormal_1; vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); - tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - vec3 tmpvar_3; - tmpvar_3 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + vec4 pos_3; + pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_4; tmpvar_4[0].x = TANGENT.x; - tmpvar_4[0].y = tmpvar_3.x; + tmpvar_4[0].y = binormal_1.x; tmpvar_4[0].z = gl_Normal.x; tmpvar_4[1].x = TANGENT.y; - tmpvar_4[1].y = tmpvar_3.y; + tmpvar_4[1].y = binormal_1.y; tmpvar_4[1].z = gl_Normal.y; tmpvar_4[2].x = TANGENT.z; - tmpvar_4[2].y = tmpvar_3.z; + tmpvar_4[2].y = binormal_1.z; tmpvar_4[2].z = gl_Normal.z; vec4 tmpvar_5; tmpvar_5.w = 1.0; tmpvar_5.xyz = _WorldSpaceCameraPos; - gl_Position = tmpvar_2; + gl_Position = pos_3; vec4 tmpvar_6; tmpvar_6.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_6.x = tmpvar_2.z; + tmpvar_6.x = pos_3.z; xlv_FOG = tmpvar_6; - gl_TexCoord[0] = tmpvar_1; + gl_TexCoord[0] = tmpvar_2; vec4 tmpvar_7; tmpvar_7.w = 0.0; tmpvar_7.xyz = (tmpvar_4 * (( @@ -55,4 +55,19 @@ void main () } -// inputs: 4, stats: 24 alu 0 tex 0 flow +// stats: 24 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 9 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _BumpMap_ST (high float) 4x1 [-1] +// #2: _LightMatrix0 (high float) 4x4 [-1] +// #3: _MainTex_ST (high float) 4x1 [-1] +// #4: _Object2World (high float) 4x4 [-1] +// #5: _World2Object (high float) 4x4 [-1] +// #6: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #7: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #8: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-ir.txt deleted file mode 100644 index b84c5cf0c..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-ir.txt +++ /dev/null @@ -1,206 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec3 lightDir; - vec2 _LightCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _BumpMap_ST; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_6 -) -{ - vec3 objSpaceCameraPos_7; - vec4 tmpvar_8; - tmpvar_8.w = 1.0; - tmpvar_8.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_9; - tmpvar_9 = ((_World2Object * tmpvar_8).xyz * unity_Scale.w); - objSpaceCameraPos_7 = tmpvar_9; - return (objSpaceCameraPos_7 - v_6.xyz); -} - -vec3 ObjSpaceLightDir ( - in vec4 v_10 -) -{ - vec3 objSpaceLightPos_11; - vec3 tmpvar_12; - tmpvar_12 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_11 = tmpvar_12; - return objSpaceLightPos_11.xyz; -} - -v2f_surf vert_surf ( - in appdata_full v_13 -) -{ - mat3 rotation_14; - vec3 binormal_15; - v2f_surf o_16; - PositionFog (v_13.vertex, o_16.pos, o_16.fog); - vec2 tmpvar_17; - tmpvar_17 = ((v_13.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_16.hip_pack0.xy = tmpvar_17.xy.xy; - vec2 tmpvar_18; - tmpvar_18 = ((v_13.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_16.hip_pack0.zw = tmpvar_18.xxxy.zw; - vec3 tmpvar_19; - tmpvar_19 = cross (v_13.normal, v_13.tangent.xyz); - vec3 tmpvar_20; - tmpvar_20 = (tmpvar_19 * v_13.tangent.w); - binormal_15 = tmpvar_20; - mat3 tmpvar_21; - float tmpvar_22; - tmpvar_22 = v_13.tangent.x; - tmpvar_21[0].x = tmpvar_22; - float tmpvar_23; - tmpvar_23 = binormal_15.x; - tmpvar_21[0].y = tmpvar_23; - float tmpvar_24; - tmpvar_24 = v_13.normal.x; - tmpvar_21[0].z = tmpvar_24; - float tmpvar_25; - tmpvar_25 = v_13.tangent.y; - tmpvar_21[1].x = tmpvar_25; - float tmpvar_26; - tmpvar_26 = binormal_15.y; - tmpvar_21[1].y = tmpvar_26; - float tmpvar_27; - tmpvar_27 = v_13.normal.y; - tmpvar_21[1].z = tmpvar_27; - float tmpvar_28; - tmpvar_28 = v_13.tangent.z; - tmpvar_21[2].x = tmpvar_28; - float tmpvar_29; - tmpvar_29 = binormal_15.z; - tmpvar_21[2].y = tmpvar_29; - float tmpvar_30; - tmpvar_30 = v_13.normal.z; - tmpvar_21[2].z = tmpvar_30; - mat3 tmpvar_31; - tmpvar_31 = tmpvar_21; - rotation_14 = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = ObjSpaceLightDir (v_13.vertex); - vec3 tmpvar_33; - tmpvar_33 = (rotation_14 * tmpvar_32); - o_16.lightDir = tmpvar_33; - vec3 tmpvar_34; - tmpvar_34 = ObjSpaceViewDir (v_13.vertex); - vec3 tmpvar_35; - tmpvar_35 = (rotation_14 * tmpvar_34); - o_16.viewDir = tmpvar_35; - vec2 tmpvar_36; - tmpvar_36 = (_LightMatrix0 * (_Object2World * v_13.vertex)).xy; - o_16._LightCoord = tmpvar_36; - return o_16; -} - -void main () -{ - appdata_full xlt_v_37; - v2f_surf xl_retval_38; - vec4 tmpvar_39; - tmpvar_39 = gl_Vertex.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_v_37.vertex = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = TANGENT.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_v_37.tangent = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = gl_Normal.xyz; - vec3 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_v_37.normal = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_v_37.texcoord = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_v_37.texcoord1 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = gl_Color.xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_v_37.color = tmpvar_50; - v2f_surf tmpvar_51; - tmpvar_51 = vert_surf (xlt_v_37); - v2f_surf tmpvar_52; - tmpvar_52 = tmpvar_51; - xl_retval_38 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = xl_retval_38.pos.xyzw; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - gl_Position = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_55.x = xl_retval_38.fog; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - xlv_FOG = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = xl_retval_38.hip_pack0.xyzw; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - gl_TexCoord[0] = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59.w = 0.0; - tmpvar_59.xyz = xl_retval_38.viewDir.xyz; - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - gl_TexCoord[1] = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61.w = 0.0; - tmpvar_61.xyz = xl_retval_38.lightDir.xyz; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - gl_TexCoord[2] = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63.zw = vec2(0.0, 0.0); - tmpvar_63.xy = xl_retval_38._LightCoord.xy; - vec4 tmpvar_64; - tmpvar_64 = tmpvar_63; - gl_TexCoord[3] = tmpvar_64; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-out.txt index 9f858c9af..13804cd10 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-out.txt @@ -10,32 +10,32 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; + vec3 binormal_1; vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); - tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - vec3 tmpvar_3; - tmpvar_3 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + vec4 pos_3; + pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_4; tmpvar_4[0].x = TANGENT.x; - tmpvar_4[0].y = tmpvar_3.x; + tmpvar_4[0].y = binormal_1.x; tmpvar_4[0].z = gl_Normal.x; tmpvar_4[1].x = TANGENT.y; - tmpvar_4[1].y = tmpvar_3.y; + tmpvar_4[1].y = binormal_1.y; tmpvar_4[1].z = gl_Normal.y; tmpvar_4[2].x = TANGENT.z; - tmpvar_4[2].y = tmpvar_3.z; + tmpvar_4[2].y = binormal_1.z; tmpvar_4[2].z = gl_Normal.z; vec4 tmpvar_5; tmpvar_5.w = 1.0; tmpvar_5.xyz = _WorldSpaceCameraPos; - gl_Position = tmpvar_2; + gl_Position = pos_3; vec4 tmpvar_6; tmpvar_6.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_6.x = tmpvar_2.z; + tmpvar_6.x = pos_3.z; xlv_FOG = tmpvar_6; - gl_TexCoord[0] = tmpvar_1; + gl_TexCoord[0] = tmpvar_2; vec4 tmpvar_7; tmpvar_7.w = 0.0; tmpvar_7.xyz = (tmpvar_4 * (( @@ -53,4 +53,19 @@ void main () } -// inputs: 4, stats: 22 alu 0 tex 0 flow +// stats: 22 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 9 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _BumpMap_ST (high float) 4x1 [-1] +// #2: _LightMatrix0 (high float) 4x4 [-1] +// #3: _MainTex_ST (high float) 4x1 [-1] +// #4: _Object2World (high float) 4x4 [-1] +// #5: _World2Object (high float) 4x4 [-1] +// #6: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #7: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #8: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-ir.txt deleted file mode 100644 index e4f737453..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-ir.txt +++ /dev/null @@ -1,191 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec3 viewDir; - vec4 _LightCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec3 WorldSpaceViewDir ( - in vec4 v_9 -) -{ - return (_WorldSpaceCameraPos.xyz - (_Object2World * v_9).xyz); -} - -vec3 WorldSpaceLightDir ( - in vec4 v_10 -) -{ - vec3 worldPos_11; - vec3 tmpvar_12; - tmpvar_12 = (_Object2World * v_10).xyz; - worldPos_11 = tmpvar_12; - return (_WorldSpaceLightPos0.xyz - worldPos_11); -} - -void PositionFog ( - in vec4 v_13, - out vec4 pos_14, - out float fog_15 -) -{ - vec4 tmpvar_16; - tmpvar_16 = (gl_ModelViewProjectionMatrix * v_13); - pos_14 = tmpvar_16; - float tmpvar_17; - tmpvar_17 = pos_14.z; - fog_15 = tmpvar_17; -} - -v2f_surf vert_surf ( - in appdata_full v_18 -) -{ - v2f_surf o_19; - PositionFog (v_18.vertex, o_19.pos, o_19.fog); - vec2 tmpvar_20; - tmpvar_20 = ((v_18.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_19.hip_pack0 = tmpvar_20.xy.xy; - mat3 tmpvar_21; - tmpvar_21 = xll_constructMat3 (_Object2World); - vec3 tmpvar_22; - tmpvar_22 = (tmpvar_21 * (v_18.normal * unity_Scale.w)); - o_19.normal = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = WorldSpaceLightDir (v_18.vertex); - vec3 tmpvar_24; - tmpvar_24 = tmpvar_23; - o_19.lightDir = tmpvar_24; - vec3 tmpvar_25; - tmpvar_25 = WorldSpaceViewDir (v_18.vertex); - vec3 tmpvar_26; - tmpvar_26 = tmpvar_25; - o_19.viewDir = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = (_LightMatrix0 * (_Object2World * v_18.vertex)); - o_19._LightCoord = tmpvar_27; - return o_19; -} - -void main () -{ - appdata_full xlt_v_28; - v2f_surf xl_retval_29; - vec4 tmpvar_30; - tmpvar_30 = gl_Vertex.xyzw; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - xlt_v_28.vertex = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = TANGENT.xyzw; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - xlt_v_28.tangent = tmpvar_33; - vec3 tmpvar_34; - tmpvar_34 = gl_Normal.xyz; - vec3 tmpvar_35; - tmpvar_35 = tmpvar_34; - xlt_v_28.normal = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlt_v_28.texcoord = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - xlt_v_28.texcoord1 = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = gl_Color.xyzw; - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - xlt_v_28.color = tmpvar_41; - v2f_surf tmpvar_42; - tmpvar_42 = vert_surf (xlt_v_28); - v2f_surf tmpvar_43; - tmpvar_43 = tmpvar_42; - xl_retval_29 = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44 = xl_retval_29.pos.xyzw; - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - gl_Position = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_46.x = xl_retval_29.fog; - vec4 tmpvar_47; - tmpvar_47 = tmpvar_46; - xlv_FOG = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48.zw = vec2(0.0, 0.0); - tmpvar_48.xy = xl_retval_29.hip_pack0.xy; - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - gl_TexCoord[0] = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50.w = 0.0; - tmpvar_50.xyz = xl_retval_29.normal.xyz; - vec4 tmpvar_51; - tmpvar_51 = tmpvar_50; - gl_TexCoord[1] = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52.w = 0.0; - tmpvar_52.xyz = xl_retval_29.lightDir.xyz; - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - gl_TexCoord[2] = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54.w = 0.0; - tmpvar_54.xyz = xl_retval_29.viewDir.xyz; - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - gl_TexCoord[3] = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = xl_retval_29._LightCoord.xyzw; - vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - gl_TexCoord[4] = tmpvar_57; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-out.txt index 12b706993..3a372de70 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-out.txt @@ -7,16 +7,16 @@ uniform vec4 unity_Scale; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_1; + pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); mat3 tmpvar_2; tmpvar_2[0] = _Object2World[0].xyz; tmpvar_2[1] = _Object2World[1].xyz; tmpvar_2[2] = _Object2World[2].xyz; - gl_Position = tmpvar_1; + gl_Position = pos_1; vec4 tmpvar_3; tmpvar_3.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_3.x = tmpvar_1.z; + tmpvar_3.x = pos_1.z; xlv_FOG = tmpvar_3; vec4 tmpvar_4; tmpvar_4.zw = vec2(0.0, 0.0); @@ -28,16 +28,28 @@ void main () gl_TexCoord[1] = tmpvar_5; vec4 tmpvar_6; tmpvar_6.w = 0.0; - vec4 cse_7; - cse_7 = (_Object2World * gl_Vertex); - tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - cse_7.xyz); + vec4 tmpvar_7; + tmpvar_7 = (_Object2World * gl_Vertex); + tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - tmpvar_7.xyz); gl_TexCoord[2] = tmpvar_6; vec4 tmpvar_8; tmpvar_8.w = 0.0; - tmpvar_8.xyz = (_WorldSpaceCameraPos - cse_7.xyz); + tmpvar_8.xyz = (_WorldSpaceCameraPos - tmpvar_7.xyz); gl_TexCoord[3] = tmpvar_8; - gl_TexCoord[4] = (_LightMatrix0 * cse_7); + gl_TexCoord[4] = (_LightMatrix0 * tmpvar_7); } -// inputs: 3, stats: 14 alu 0 tex 0 flow +// stats: 14 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 7 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _LightMatrix0 (high float) 4x4 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #5: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #6: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular1-ir.txt deleted file mode 100644 index f4a15b02e..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular1-ir.txt +++ /dev/null @@ -1,104 +0,0 @@ -struct v2f_surf { - vec4 pos; - vec3 normal; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -attribute vec4 TANGENT; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -v2f_surf vert_surf ( - in appdata_full v_9 -) -{ - v2f_surf o_10; - vec4 tmpvar_11; - tmpvar_11 = (gl_ModelViewProjectionMatrix * v_9.vertex); - o_10.pos = tmpvar_11; - mat3 tmpvar_12; - tmpvar_12 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose); - vec3 tmpvar_13; - tmpvar_13 = (tmpvar_12 * v_9.normal); - o_10.normal = tmpvar_13; - return o_10; -} - -void main () -{ - appdata_full xlt_v_14; - v2f_surf xl_retval_15; - vec4 tmpvar_16; - tmpvar_16 = gl_Vertex.xyzw; - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - xlt_v_14.vertex = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = TANGENT.xyzw; - vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - xlt_v_14.tangent = tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = gl_Normal.xyz; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_20; - xlt_v_14.normal = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - xlt_v_14.texcoord = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_25; - tmpvar_25 = tmpvar_24; - xlt_v_14.texcoord1 = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = gl_Color.xyzw; - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - xlt_v_14.color = tmpvar_27; - v2f_surf tmpvar_28; - tmpvar_28 = vert_surf (xlt_v_14); - v2f_surf tmpvar_29; - tmpvar_29 = tmpvar_28; - xl_retval_15 = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = xl_retval_15.pos.xyzw; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - gl_Position = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32.w = 0.0; - tmpvar_32.xyz = xl_retval_15.normal.xyz; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - gl_TexCoord[0] = tmpvar_33; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular1-out.txt index 9b51150cc..d87780097 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular1-out.txt @@ -12,4 +12,10 @@ void main () } -// inputs: 2, stats: 3 alu 0 tex 0 flow +// stats: 3 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_Normal (high float) 3x1 [-1] loc 2 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 2 (total size: 0) +// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] +// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-ir.txt deleted file mode 100644 index 51b487d10..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-ir.txt +++ /dev/null @@ -1,197 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 worldRefl; - vec4 hip_screen; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _ProjectionParams; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -void PositionFog ( - in vec4 v_9, - out vec4 pos_10, - out float fog_11 -) -{ - vec4 tmpvar_12; - tmpvar_12 = (gl_ModelViewProjectionMatrix * v_9); - pos_10 = tmpvar_12; - float tmpvar_13; - tmpvar_13 = pos_10.z; - fog_11 = tmpvar_13; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_14 -) -{ - vec3 objSpaceCameraPos_15; - vec4 tmpvar_16; - tmpvar_16.w = 1.0; - tmpvar_16.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_17; - tmpvar_17 = ((_World2Object * tmpvar_16).xyz * unity_Scale.w); - objSpaceCameraPos_15 = tmpvar_17; - return (objSpaceCameraPos_15 - v_14.xyz); -} - -vec4 ComputeScreenPos ( - in vec4 pos_18 -) -{ - vec4 o_19; - vec4 tmpvar_20; - tmpvar_20 = (pos_18 * 0.5); - o_19 = tmpvar_20; - vec2 tmpvar_21; - tmpvar_21.x = o_19.x; - tmpvar_21.y = (o_19.y * _ProjectionParams.x); - vec2 tmpvar_22; - tmpvar_22 = (tmpvar_21 + o_19.w); - o_19.xy = tmpvar_22.xy.xy; - vec2 tmpvar_23; - tmpvar_23 = pos_18.zw; - o_19.zw = tmpvar_23.xxxy.zw; - return o_19; -} - -v2f_surf vert_surf ( - in appdata_full v_24 -) -{ - vec3 viewRefl_25; - vec3 viewDir_26; - v2f_surf o_27; - PositionFog (v_24.vertex, o_27.pos, o_27.fog); - vec2 tmpvar_28; - tmpvar_28 = ((v_24.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_27.hip_pack0 = tmpvar_28.xy.xy; - vec3 tmpvar_29; - tmpvar_29 = ObjSpaceViewDir (v_24.vertex); - vec3 tmpvar_30; - tmpvar_30 = -(tmpvar_29); - viewDir_26 = tmpvar_30; - vec3 tmpvar_31; - tmpvar_31 = reflect (viewDir_26, v_24.normal); - vec3 tmpvar_32; - tmpvar_32 = tmpvar_31; - viewRefl_25 = tmpvar_32; - mat3 tmpvar_33; - tmpvar_33 = xll_constructMat3 (_Object2World); - vec3 tmpvar_34; - tmpvar_34 = (tmpvar_33 * viewRefl_25); - o_27.worldRefl = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35 = ComputeScreenPos (o_27.pos); - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - o_27.hip_screen = tmpvar_36; - return o_27; -} - -void main () -{ - appdata_full xlt_v_37; - v2f_surf xl_retval_38; - vec4 tmpvar_39; - tmpvar_39 = gl_Vertex.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_v_37.vertex = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = TANGENT.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_v_37.tangent = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = gl_Normal.xyz; - vec3 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_v_37.normal = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_v_37.texcoord = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_v_37.texcoord1 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = gl_Color.xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_v_37.color = tmpvar_50; - v2f_surf tmpvar_51; - tmpvar_51 = vert_surf (xlt_v_37); - v2f_surf tmpvar_52; - tmpvar_52 = tmpvar_51; - xl_retval_38 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = xl_retval_38.pos.xyzw; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - gl_Position = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_55.x = xl_retval_38.fog; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - xlv_FOG = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57.zw = vec2(0.0, 0.0); - tmpvar_57.xy = xl_retval_38.hip_pack0.xy; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - gl_TexCoord[0] = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59.w = 0.0; - tmpvar_59.xyz = xl_retval_38.worldRefl.xyz; - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - gl_TexCoord[1] = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61 = xl_retval_38.hip_screen.xyzw; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - gl_TexCoord[2] = tmpvar_62; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-out.txt index 268d24ac1..759d073c5 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-out.txt @@ -7,42 +7,53 @@ uniform vec4 unity_Scale; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); - vec4 tmpvar_2; - tmpvar_2.w = 1.0; - tmpvar_2.xyz = _WorldSpaceCameraPos; - vec3 tmpvar_3; - tmpvar_3 = (gl_Vertex.xyz - ((_World2Object * tmpvar_2).xyz * unity_Scale.w)); + vec3 viewDir_1; + vec4 pos_2; + pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 tmpvar_3; + tmpvar_3.w = 1.0; + tmpvar_3.xyz = _WorldSpaceCameraPos; + viewDir_1 = (gl_Vertex.xyz - ((_World2Object * tmpvar_3).xyz * unity_Scale.w)); mat3 tmpvar_4; tmpvar_4[0] = _Object2World[0].xyz; tmpvar_4[1] = _Object2World[1].xyz; tmpvar_4[2] = _Object2World[2].xyz; vec4 o_5; - vec4 tmpvar_6; - tmpvar_6 = (tmpvar_1 * 0.5); - vec2 tmpvar_7; - tmpvar_7.x = tmpvar_6.x; - tmpvar_7.y = (tmpvar_6.y * _ProjectionParams.x); - o_5.xy = (tmpvar_7 + tmpvar_6.w); - o_5.zw = tmpvar_1.zw; - gl_Position = tmpvar_1; + o_5 = (pos_2 * 0.5); + vec2 tmpvar_6; + tmpvar_6.x = o_5.x; + tmpvar_6.y = (o_5.y * _ProjectionParams.x); + o_5.xy = (tmpvar_6 + o_5.w); + o_5.zw = pos_2.zw; + gl_Position = pos_2; + vec4 tmpvar_7; + tmpvar_7.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_7.x = pos_2.z; + xlv_FOG = tmpvar_7; vec4 tmpvar_8; - tmpvar_8.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_8.x = tmpvar_1.z; - xlv_FOG = tmpvar_8; + tmpvar_8.zw = vec2(0.0, 0.0); + tmpvar_8.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_8; vec4 tmpvar_9; - tmpvar_9.zw = vec2(0.0, 0.0); - tmpvar_9.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10.w = 0.0; - tmpvar_10.xyz = (tmpvar_4 * (tmpvar_3 - (2.0 * - (dot (gl_Normal, tmpvar_3) * gl_Normal) + tmpvar_9.w = 0.0; + tmpvar_9.xyz = (tmpvar_4 * (viewDir_1 - (2.0 * + (dot (gl_Normal, viewDir_1) * gl_Normal) ))); - gl_TexCoord[1] = tmpvar_10; + gl_TexCoord[1] = tmpvar_9; gl_TexCoord[2] = o_5; } -// inputs: 3, stats: 18 alu 0 tex 0 flow +// stats: 18 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 7 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _MainTex_ST (high float) 4x1 [-1] +// #2: _Object2World (high float) 4x4 [-1] +// #3: _ProjectionParams (high float) 4x1 [-1] +// #4: _World2Object (high float) 4x4 [-1] +// #5: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #6: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-RenderFX_Skybox_Cubed-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-RenderFX_Skybox_Cubed-ir.txt deleted file mode 100644 index 6ce0c9bcf..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-RenderFX_Skybox_Cubed-ir.txt +++ /dev/null @@ -1,54 +0,0 @@ -struct v2f { - vec4 vertex; - vec3 texcoord; -}; -struct appdata_t { - vec4 vertex; - vec3 texcoord; -}; -v2f vert ( - in appdata_t v_1 -) -{ - v2f o_2; - vec4 tmpvar_3; - tmpvar_3 = (gl_ModelViewProjectionMatrix * v_1.vertex); - o_2.vertex = tmpvar_3; - vec3 tmpvar_4; - tmpvar_4 = v_1.texcoord; - o_2.texcoord = tmpvar_4; - return o_2; -} - -void main () -{ - appdata_t xlt_v_5; - v2f xl_retval_6; - vec4 tmpvar_7; - tmpvar_7 = gl_Vertex.xyzw; - vec4 tmpvar_8; - tmpvar_8 = tmpvar_7; - xlt_v_5.vertex = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = gl_MultiTexCoord0.xyz; - vec3 tmpvar_10; - tmpvar_10 = tmpvar_9; - xlt_v_5.texcoord = tmpvar_10; - v2f tmpvar_11; - tmpvar_11 = vert (xlt_v_5); - v2f tmpvar_12; - tmpvar_12 = tmpvar_11; - xl_retval_6 = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13 = xl_retval_6.vertex.xyzw; - vec4 tmpvar_14; - tmpvar_14 = tmpvar_13; - gl_Position = tmpvar_14; - vec4 tmpvar_15; - tmpvar_15.w = 0.0; - tmpvar_15.xyz = xl_retval_6.texcoord.xyz; - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - gl_TexCoord[0] = tmpvar_16; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-RenderFX_Skybox_Cubed-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-RenderFX_Skybox_Cubed-out.txt index e85b98a3f..8521c7dad 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-RenderFX_Skybox_Cubed-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-RenderFX_Skybox_Cubed-out.txt @@ -8,4 +8,9 @@ void main () } -// inputs: 2, stats: 2 alu 0 tex 0 flow +// stats: 2 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 1 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-ir.txt deleted file mode 100644 index 8d904e645..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-ir.txt +++ /dev/null @@ -1,178 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 lightDir; - vec4 _LightCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _BumpMap_ST; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform mat4 _World2Object; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec3 ObjSpaceLightDir ( - in vec4 v_6 -) -{ - vec3 objSpaceLightPos_7; - vec3 tmpvar_8; - tmpvar_8 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_7 = tmpvar_8; - return ((objSpaceLightPos_7.xyz * unity_Scale.w) - v_6.xyz); -} - -v2f_surf vert_surf ( - in appdata_full v_9 -) -{ - mat3 rotation_10; - vec3 binormal_11; - v2f_surf o_12; - PositionFog (v_9.vertex, o_12.pos, o_12.fog); - vec2 tmpvar_13; - tmpvar_13 = ((v_9.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_12.hip_pack0.xy = tmpvar_13.xy.xy; - vec2 tmpvar_14; - tmpvar_14 = ((v_9.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_12.hip_pack0.zw = tmpvar_14.xxxy.zw; - vec3 tmpvar_15; - tmpvar_15 = cross (v_9.normal, v_9.tangent.xyz); - vec3 tmpvar_16; - tmpvar_16 = (tmpvar_15 * v_9.tangent.w); - binormal_11 = tmpvar_16; - mat3 tmpvar_17; - float tmpvar_18; - tmpvar_18 = v_9.tangent.x; - tmpvar_17[0].x = tmpvar_18; - float tmpvar_19; - tmpvar_19 = binormal_11.x; - tmpvar_17[0].y = tmpvar_19; - float tmpvar_20; - tmpvar_20 = v_9.normal.x; - tmpvar_17[0].z = tmpvar_20; - float tmpvar_21; - tmpvar_21 = v_9.tangent.y; - tmpvar_17[1].x = tmpvar_21; - float tmpvar_22; - tmpvar_22 = binormal_11.y; - tmpvar_17[1].y = tmpvar_22; - float tmpvar_23; - tmpvar_23 = v_9.normal.y; - tmpvar_17[1].z = tmpvar_23; - float tmpvar_24; - tmpvar_24 = v_9.tangent.z; - tmpvar_17[2].x = tmpvar_24; - float tmpvar_25; - tmpvar_25 = binormal_11.z; - tmpvar_17[2].y = tmpvar_25; - float tmpvar_26; - tmpvar_26 = v_9.normal.z; - tmpvar_17[2].z = tmpvar_26; - mat3 tmpvar_27; - tmpvar_27 = tmpvar_17; - rotation_10 = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = ObjSpaceLightDir (v_9.vertex); - vec3 tmpvar_29; - tmpvar_29 = (rotation_10 * tmpvar_28); - o_12.lightDir = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = (_LightMatrix0 * (_Object2World * v_9.vertex)); - o_12._LightCoord = tmpvar_30; - return o_12; -} - -void main () -{ - appdata_full xlt_v_31; - v2f_surf xl_retval_32; - vec4 tmpvar_33; - tmpvar_33 = gl_Vertex.xyzw; - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - xlt_v_31.vertex = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35 = TANGENT.xyzw; - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlt_v_31.tangent = tmpvar_36; - vec3 tmpvar_37; - tmpvar_37 = gl_Normal.xyz; - vec3 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlt_v_31.normal = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_v_31.texcoord = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_v_31.texcoord1 = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43 = gl_Color.xyzw; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_v_31.color = tmpvar_44; - v2f_surf tmpvar_45; - tmpvar_45 = vert_surf (xlt_v_31); - v2f_surf tmpvar_46; - tmpvar_46 = tmpvar_45; - xl_retval_32 = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = xl_retval_32.pos.xyzw; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - gl_Position = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_49.x = xl_retval_32.fog; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlv_FOG = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = xl_retval_32.hip_pack0.xyzw; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - gl_TexCoord[0] = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53.w = 0.0; - tmpvar_53.xyz = xl_retval_32.lightDir.xyz; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - gl_TexCoord[1] = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = xl_retval_32._LightCoord.xyzw; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - gl_TexCoord[2] = tmpvar_56; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-out.txt index efec9e38c..e858730a7 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-out.txt @@ -9,29 +9,29 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; + vec3 binormal_1; vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); - tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - vec3 tmpvar_3; - tmpvar_3 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + vec4 pos_3; + pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_4; tmpvar_4[0].x = TANGENT.x; - tmpvar_4[0].y = tmpvar_3.x; + tmpvar_4[0].y = binormal_1.x; tmpvar_4[0].z = gl_Normal.x; tmpvar_4[1].x = TANGENT.y; - tmpvar_4[1].y = tmpvar_3.y; + tmpvar_4[1].y = binormal_1.y; tmpvar_4[1].z = gl_Normal.y; tmpvar_4[2].x = TANGENT.z; - tmpvar_4[2].y = tmpvar_3.z; + tmpvar_4[2].y = binormal_1.z; tmpvar_4[2].z = gl_Normal.z; - gl_Position = tmpvar_2; + gl_Position = pos_3; vec4 tmpvar_5; tmpvar_5.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_5.x = tmpvar_2.z; + tmpvar_5.x = pos_3.z; xlv_FOG = tmpvar_5; - gl_TexCoord[0] = tmpvar_1; + gl_TexCoord[0] = tmpvar_2; vec4 tmpvar_6; tmpvar_6.w = 0.0; tmpvar_6.xyz = (tmpvar_4 * (( @@ -42,4 +42,18 @@ void main () } -// inputs: 4, stats: 17 alu 0 tex 0 flow +// stats: 17 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 8 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _BumpMap_ST (high float) 4x1 [-1] +// #2: _LightMatrix0 (high float) 4x4 [-1] +// #3: _MainTex_ST (high float) 4x1 [-1] +// #4: _Object2World (high float) 4x4 [-1] +// #5: _World2Object (high float) 4x4 [-1] +// #6: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #7: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-ir.txt deleted file mode 100644 index 6803ca019..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-ir.txt +++ /dev/null @@ -1,135 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec4 hip_screen; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _Illum_ST; -uniform vec4 _MainTex_ST; -uniform vec4 _ProjectionParams; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec4 ComputeScreenPos ( - in vec4 pos_6 -) -{ - vec4 o_7; - vec4 tmpvar_8; - tmpvar_8 = (pos_6 * 0.5); - o_7 = tmpvar_8; - vec2 tmpvar_9; - tmpvar_9.x = o_7.x; - tmpvar_9.y = (o_7.y * _ProjectionParams.x); - vec2 tmpvar_10; - tmpvar_10 = (tmpvar_9 + o_7.w); - o_7.xy = tmpvar_10.xy.xy; - vec2 tmpvar_11; - tmpvar_11 = pos_6.zw; - o_7.zw = tmpvar_11.xxxy.zw; - return o_7; -} - -v2f_surf vert_surf ( - in appdata_full v_12 -) -{ - v2f_surf o_13; - PositionFog (v_12.vertex, o_13.pos, o_13.fog); - vec2 tmpvar_14; - tmpvar_14 = ((v_12.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_13.hip_pack0.xy = tmpvar_14.xy.xy; - vec2 tmpvar_15; - tmpvar_15 = ((v_12.texcoord.xy * _Illum_ST.xy) + _Illum_ST.zw); - o_13.hip_pack0.zw = tmpvar_15.xxxy.zw; - vec4 tmpvar_16; - tmpvar_16 = ComputeScreenPos (o_13.pos); - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - o_13.hip_screen = tmpvar_17; - return o_13; -} - -void main () -{ - appdata_full xlt_v_18; - v2f_surf xl_retval_19; - vec4 tmpvar_20; - tmpvar_20 = gl_Vertex.xyzw; - vec4 tmpvar_21; - tmpvar_21 = tmpvar_20; - xlt_v_18.vertex = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22 = TANGENT.xyzw; - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - xlt_v_18.tangent = tmpvar_23; - vec3 tmpvar_24; - tmpvar_24 = gl_Normal.xyz; - vec3 tmpvar_25; - tmpvar_25 = tmpvar_24; - xlt_v_18.normal = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - xlt_v_18.texcoord = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - xlt_v_18.texcoord1 = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = gl_Color.xyzw; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - xlt_v_18.color = tmpvar_31; - v2f_surf tmpvar_32; - tmpvar_32 = vert_surf (xlt_v_18); - v2f_surf tmpvar_33; - tmpvar_33 = tmpvar_32; - xl_retval_19 = tmpvar_33; - vec4 tmpvar_34; - tmpvar_34 = xl_retval_19.pos.xyzw; - vec4 tmpvar_35; - tmpvar_35 = tmpvar_34; - gl_Position = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_36.x = xl_retval_19.fog; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlv_FOG = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = xl_retval_19.hip_pack0.xyzw; - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - gl_TexCoord[0] = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = xl_retval_19.hip_screen.xyzw; - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - gl_TexCoord[1] = tmpvar_41; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-out.txt index 45095b64f..2a958175c 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-out.txt @@ -5,26 +5,33 @@ varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; - vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_2; + pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _Illum_ST.xy) + _Illum_ST.zw); vec4 o_3; - vec4 tmpvar_4; - tmpvar_4 = (tmpvar_2 * 0.5); - vec2 tmpvar_5; - tmpvar_5.x = tmpvar_4.x; - tmpvar_5.y = (tmpvar_4.y * _ProjectionParams.x); - o_3.xy = (tmpvar_5 + tmpvar_4.w); - o_3.zw = tmpvar_2.zw; - gl_Position = tmpvar_2; - vec4 tmpvar_6; - tmpvar_6.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_6.x = tmpvar_2.z; - xlv_FOG = tmpvar_6; + o_3 = (pos_2 * 0.5); + vec2 tmpvar_4; + tmpvar_4.x = o_3.x; + tmpvar_4.y = (o_3.y * _ProjectionParams.x); + o_3.xy = (tmpvar_4 + o_3.w); + o_3.zw = pos_2.zw; + gl_Position = pos_2; + vec4 tmpvar_5; + tmpvar_5.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_5.x = pos_2.z; + xlv_FOG = tmpvar_5; gl_TexCoord[0] = tmpvar_1; gl_TexCoord[1] = o_3; } -// inputs: 2, stats: 9 alu 0 tex 0 flow +// stats: 9 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 4 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _Illum_ST (high float) 4x1 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _ProjectionParams (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-ir.txt deleted file mode 100644 index 5fa4e515d..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-ir.txt +++ /dev/null @@ -1,152 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec4 hip_screen; - vec3 hip_lmapFade; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _Illum_ST; -uniform vec4 _MainTex_ST; -uniform vec4 _ProjectionParams; -uniform vec4 unity_LightmapFade; -uniform vec4 unity_LightmapST; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec4 ComputeScreenPos ( - in vec4 pos_6 -) -{ - vec4 o_7; - vec4 tmpvar_8; - tmpvar_8 = (pos_6 * 0.5); - o_7 = tmpvar_8; - vec2 tmpvar_9; - tmpvar_9.x = o_7.x; - tmpvar_9.y = (o_7.y * _ProjectionParams.x); - vec2 tmpvar_10; - tmpvar_10 = (tmpvar_9 + o_7.w); - o_7.xy = tmpvar_10.xy.xy; - vec2 tmpvar_11; - tmpvar_11 = pos_6.zw; - o_7.zw = tmpvar_11.xxxy.zw; - return o_7; -} - -v2f_surf vert_surf ( - in appdata_full v_12 -) -{ - v2f_surf o_13; - PositionFog (v_12.vertex, o_13.pos, o_13.fog); - vec2 tmpvar_14; - tmpvar_14 = ((v_12.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_13.hip_pack0.xy = tmpvar_14.xy.xy; - vec2 tmpvar_15; - tmpvar_15 = ((v_12.texcoord.xy * _Illum_ST.xy) + _Illum_ST.zw); - o_13.hip_pack0.zw = tmpvar_15.xxxy.zw; - vec4 tmpvar_16; - tmpvar_16 = ComputeScreenPos (o_13.pos); - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - o_13.hip_screen = tmpvar_17; - vec2 tmpvar_18; - tmpvar_18 = ((v_12.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - o_13.hip_lmapFade.xy = tmpvar_18.xy.xy; - float tmpvar_19; - tmpvar_19 = ((-( - (gl_ModelViewMatrix * v_12.vertex) - .z) * unity_LightmapFade.z) + unity_LightmapFade.w); - o_13.hip_lmapFade.z = vec3(tmpvar_19).z; - return o_13; -} - -void main () -{ - appdata_full xlt_v_20; - v2f_surf xl_retval_21; - vec4 tmpvar_22; - tmpvar_22 = gl_Vertex.xyzw; - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - xlt_v_20.vertex = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = TANGENT.xyzw; - vec4 tmpvar_25; - tmpvar_25 = tmpvar_24; - xlt_v_20.tangent = tmpvar_25; - vec3 tmpvar_26; - tmpvar_26 = gl_Normal.xyz; - vec3 tmpvar_27; - tmpvar_27 = tmpvar_26; - xlt_v_20.normal = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - xlt_v_20.texcoord = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - xlt_v_20.texcoord1 = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = gl_Color.xyzw; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - xlt_v_20.color = tmpvar_33; - v2f_surf tmpvar_34; - tmpvar_34 = vert_surf (xlt_v_20); - v2f_surf tmpvar_35; - tmpvar_35 = tmpvar_34; - xl_retval_21 = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36 = xl_retval_21.pos.xyzw; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - gl_Position = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_38.x = xl_retval_21.fog; - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - xlv_FOG = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = xl_retval_21.hip_pack0.xyzw; - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - gl_TexCoord[0] = tmpvar_41; - vec4 tmpvar_42; - tmpvar_42 = xl_retval_21.hip_screen.xyzw; - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - gl_TexCoord[1] = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44.w = 0.0; - tmpvar_44.xyz = xl_retval_21.hip_lmapFade.xyz; - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - gl_TexCoord[2] = tmpvar_45; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-out.txt index 3ff7ba068..9a18604c8 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-out.txt @@ -8,34 +8,45 @@ void main () { vec4 tmpvar_1; vec3 tmpvar_2; - vec4 tmpvar_3; - tmpvar_3 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_3; + pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex); tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _Illum_ST.xy) + _Illum_ST.zw); vec4 o_4; - vec4 tmpvar_5; - tmpvar_5 = (tmpvar_3 * 0.5); - vec2 tmpvar_6; - tmpvar_6.x = tmpvar_5.x; - tmpvar_6.y = (tmpvar_5.y * _ProjectionParams.x); - o_4.xy = (tmpvar_6 + tmpvar_5.w); - o_4.zw = tmpvar_3.zw; + o_4 = (pos_3 * 0.5); + vec2 tmpvar_5; + tmpvar_5.x = o_4.x; + tmpvar_5.y = (o_4.y * _ProjectionParams.x); + o_4.xy = (tmpvar_5 + o_4.w); + o_4.zw = pos_3.zw; tmpvar_2.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); tmpvar_2.z = ((-( (gl_ModelViewMatrix * gl_Vertex) .z) * unity_LightmapFade.z) + unity_LightmapFade.w); - gl_Position = tmpvar_3; - vec4 tmpvar_7; - tmpvar_7.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_7.x = tmpvar_3.z; - xlv_FOG = tmpvar_7; + gl_Position = pos_3; + vec4 tmpvar_6; + tmpvar_6.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_6.x = pos_3.z; + xlv_FOG = tmpvar_6; gl_TexCoord[0] = tmpvar_1; gl_TexCoord[1] = o_4; - vec4 tmpvar_8; - tmpvar_8.w = 0.0; - tmpvar_8.xyz = tmpvar_2; - gl_TexCoord[2] = tmpvar_8; + vec4 tmpvar_7; + tmpvar_7.w = 0.0; + tmpvar_7.xyz = tmpvar_2; + gl_TexCoord[2] = tmpvar_7; } -// inputs: 3, stats: 16 alu 0 tex 0 flow +// stats: 16 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 7 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: gl_ModelViewMatrix (high float) 4x4 [-1] +// #2: _Illum_ST (high float) 4x1 [-1] +// #3: _MainTex_ST (high float) 4x1 [-1] +// #4: _ProjectionParams (high float) 4x1 [-1] +// #5: unity_LightmapFade (high float) 4x1 [-1] +// #6: unity_LightmapST (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-ir.txt deleted file mode 100644 index f447ceceb..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-ir.txt +++ /dev/null @@ -1,205 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec3 lightDir; - vec4 _LightCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _BumpMap_ST; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_6 -) -{ - vec3 objSpaceCameraPos_7; - vec4 tmpvar_8; - tmpvar_8.w = 1.0; - tmpvar_8.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_9; - tmpvar_9 = ((_World2Object * tmpvar_8).xyz * unity_Scale.w); - objSpaceCameraPos_7 = tmpvar_9; - return (objSpaceCameraPos_7 - v_6.xyz); -} - -vec3 ObjSpaceLightDir ( - in vec4 v_10 -) -{ - vec3 objSpaceLightPos_11; - vec3 tmpvar_12; - tmpvar_12 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_11 = tmpvar_12; - return ((objSpaceLightPos_11.xyz * unity_Scale.w) - v_10.xyz); -} - -v2f_surf vert_surf ( - in appdata_full v_13 -) -{ - mat3 rotation_14; - vec3 binormal_15; - v2f_surf o_16; - PositionFog (v_13.vertex, o_16.pos, o_16.fog); - vec2 tmpvar_17; - tmpvar_17 = ((v_13.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_16.hip_pack0.xy = tmpvar_17.xy.xy; - vec2 tmpvar_18; - tmpvar_18 = ((v_13.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_16.hip_pack0.zw = tmpvar_18.xxxy.zw; - vec3 tmpvar_19; - tmpvar_19 = cross (v_13.normal, v_13.tangent.xyz); - vec3 tmpvar_20; - tmpvar_20 = (tmpvar_19 * v_13.tangent.w); - binormal_15 = tmpvar_20; - mat3 tmpvar_21; - float tmpvar_22; - tmpvar_22 = v_13.tangent.x; - tmpvar_21[0].x = tmpvar_22; - float tmpvar_23; - tmpvar_23 = binormal_15.x; - tmpvar_21[0].y = tmpvar_23; - float tmpvar_24; - tmpvar_24 = v_13.normal.x; - tmpvar_21[0].z = tmpvar_24; - float tmpvar_25; - tmpvar_25 = v_13.tangent.y; - tmpvar_21[1].x = tmpvar_25; - float tmpvar_26; - tmpvar_26 = binormal_15.y; - tmpvar_21[1].y = tmpvar_26; - float tmpvar_27; - tmpvar_27 = v_13.normal.y; - tmpvar_21[1].z = tmpvar_27; - float tmpvar_28; - tmpvar_28 = v_13.tangent.z; - tmpvar_21[2].x = tmpvar_28; - float tmpvar_29; - tmpvar_29 = binormal_15.z; - tmpvar_21[2].y = tmpvar_29; - float tmpvar_30; - tmpvar_30 = v_13.normal.z; - tmpvar_21[2].z = tmpvar_30; - mat3 tmpvar_31; - tmpvar_31 = tmpvar_21; - rotation_14 = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = ObjSpaceLightDir (v_13.vertex); - vec3 tmpvar_33; - tmpvar_33 = (rotation_14 * tmpvar_32); - o_16.lightDir = tmpvar_33; - vec3 tmpvar_34; - tmpvar_34 = ObjSpaceViewDir (v_13.vertex); - vec3 tmpvar_35; - tmpvar_35 = (rotation_14 * tmpvar_34); - o_16.viewDir = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36 = (_LightMatrix0 * (_Object2World * v_13.vertex)); - o_16._LightCoord = tmpvar_36; - return o_16; -} - -void main () -{ - appdata_full xlt_v_37; - v2f_surf xl_retval_38; - vec4 tmpvar_39; - tmpvar_39 = gl_Vertex.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_v_37.vertex = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = TANGENT.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_v_37.tangent = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = gl_Normal.xyz; - vec3 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_v_37.normal = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_v_37.texcoord = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_v_37.texcoord1 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = gl_Color.xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_v_37.color = tmpvar_50; - v2f_surf tmpvar_51; - tmpvar_51 = vert_surf (xlt_v_37); - v2f_surf tmpvar_52; - tmpvar_52 = tmpvar_51; - xl_retval_38 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = xl_retval_38.pos.xyzw; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - gl_Position = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_55.x = xl_retval_38.fog; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - xlv_FOG = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = xl_retval_38.hip_pack0.xyzw; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - gl_TexCoord[0] = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59.w = 0.0; - tmpvar_59.xyz = xl_retval_38.viewDir.xyz; - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - gl_TexCoord[1] = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61.w = 0.0; - tmpvar_61.xyz = xl_retval_38.lightDir.xyz; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - gl_TexCoord[2] = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63 = xl_retval_38._LightCoord.xyzw; - vec4 tmpvar_64; - tmpvar_64 = tmpvar_63; - gl_TexCoord[3] = tmpvar_64; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-out.txt index fa28b13aa..509c4ec30 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-out.txt @@ -10,32 +10,32 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; + vec3 binormal_1; vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); - tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - vec3 tmpvar_3; - tmpvar_3 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + vec4 pos_3; + pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_4; tmpvar_4[0].x = TANGENT.x; - tmpvar_4[0].y = tmpvar_3.x; + tmpvar_4[0].y = binormal_1.x; tmpvar_4[0].z = gl_Normal.x; tmpvar_4[1].x = TANGENT.y; - tmpvar_4[1].y = tmpvar_3.y; + tmpvar_4[1].y = binormal_1.y; tmpvar_4[1].z = gl_Normal.y; tmpvar_4[2].x = TANGENT.z; - tmpvar_4[2].y = tmpvar_3.z; + tmpvar_4[2].y = binormal_1.z; tmpvar_4[2].z = gl_Normal.z; vec4 tmpvar_5; tmpvar_5.w = 1.0; tmpvar_5.xyz = _WorldSpaceCameraPos; - gl_Position = tmpvar_2; + gl_Position = pos_3; vec4 tmpvar_6; tmpvar_6.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_6.x = tmpvar_2.z; + tmpvar_6.x = pos_3.z; xlv_FOG = tmpvar_6; - gl_TexCoord[0] = tmpvar_1; + gl_TexCoord[0] = tmpvar_2; vec4 tmpvar_7; tmpvar_7.w = 0.0; tmpvar_7.xyz = (tmpvar_4 * (( @@ -52,4 +52,19 @@ void main () } -// inputs: 4, stats: 23 alu 0 tex 0 flow +// stats: 23 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 9 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _BumpMap_ST (high float) 4x1 [-1] +// #2: _LightMatrix0 (high float) 4x4 [-1] +// #3: _MainTex_ST (high float) 4x1 [-1] +// #4: _Object2World (high float) 4x4 [-1] +// #5: _World2Object (high float) 4x4 [-1] +// #6: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #7: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #8: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-ir.txt deleted file mode 100644 index b4bd5df69..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-ir.txt +++ /dev/null @@ -1,206 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 viewDir; - vec3 lightDir; - vec3 _LightCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _BumpMap_ST; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_6 -) -{ - vec3 objSpaceCameraPos_7; - vec4 tmpvar_8; - tmpvar_8.w = 1.0; - tmpvar_8.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_9; - tmpvar_9 = ((_World2Object * tmpvar_8).xyz * unity_Scale.w); - objSpaceCameraPos_7 = tmpvar_9; - return (objSpaceCameraPos_7 - v_6.xyz); -} - -vec3 ObjSpaceLightDir ( - in vec4 v_10 -) -{ - vec3 objSpaceLightPos_11; - vec3 tmpvar_12; - tmpvar_12 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_11 = tmpvar_12; - return ((objSpaceLightPos_11.xyz * unity_Scale.w) - v_10.xyz); -} - -v2f_surf vert_surf ( - in appdata_full v_13 -) -{ - mat3 rotation_14; - vec3 binormal_15; - v2f_surf o_16; - PositionFog (v_13.vertex, o_16.pos, o_16.fog); - vec2 tmpvar_17; - tmpvar_17 = ((v_13.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_16.hip_pack0.xy = tmpvar_17.xy.xy; - vec2 tmpvar_18; - tmpvar_18 = ((v_13.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_16.hip_pack0.zw = tmpvar_18.xxxy.zw; - vec3 tmpvar_19; - tmpvar_19 = cross (v_13.normal, v_13.tangent.xyz); - vec3 tmpvar_20; - tmpvar_20 = (tmpvar_19 * v_13.tangent.w); - binormal_15 = tmpvar_20; - mat3 tmpvar_21; - float tmpvar_22; - tmpvar_22 = v_13.tangent.x; - tmpvar_21[0].x = tmpvar_22; - float tmpvar_23; - tmpvar_23 = binormal_15.x; - tmpvar_21[0].y = tmpvar_23; - float tmpvar_24; - tmpvar_24 = v_13.normal.x; - tmpvar_21[0].z = tmpvar_24; - float tmpvar_25; - tmpvar_25 = v_13.tangent.y; - tmpvar_21[1].x = tmpvar_25; - float tmpvar_26; - tmpvar_26 = binormal_15.y; - tmpvar_21[1].y = tmpvar_26; - float tmpvar_27; - tmpvar_27 = v_13.normal.y; - tmpvar_21[1].z = tmpvar_27; - float tmpvar_28; - tmpvar_28 = v_13.tangent.z; - tmpvar_21[2].x = tmpvar_28; - float tmpvar_29; - tmpvar_29 = binormal_15.z; - tmpvar_21[2].y = tmpvar_29; - float tmpvar_30; - tmpvar_30 = v_13.normal.z; - tmpvar_21[2].z = tmpvar_30; - mat3 tmpvar_31; - tmpvar_31 = tmpvar_21; - rotation_14 = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = ObjSpaceLightDir (v_13.vertex); - vec3 tmpvar_33; - tmpvar_33 = (rotation_14 * tmpvar_32); - o_16.lightDir = tmpvar_33; - vec3 tmpvar_34; - tmpvar_34 = ObjSpaceViewDir (v_13.vertex); - vec3 tmpvar_35; - tmpvar_35 = (rotation_14 * tmpvar_34); - o_16.viewDir = tmpvar_35; - vec3 tmpvar_36; - tmpvar_36 = (_LightMatrix0 * (_Object2World * v_13.vertex)).xyz; - o_16._LightCoord = tmpvar_36; - return o_16; -} - -void main () -{ - appdata_full xlt_v_37; - v2f_surf xl_retval_38; - vec4 tmpvar_39; - tmpvar_39 = gl_Vertex.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_v_37.vertex = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = TANGENT.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_v_37.tangent = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = gl_Normal.xyz; - vec3 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_v_37.normal = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_v_37.texcoord = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_v_37.texcoord1 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = gl_Color.xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_v_37.color = tmpvar_50; - v2f_surf tmpvar_51; - tmpvar_51 = vert_surf (xlt_v_37); - v2f_surf tmpvar_52; - tmpvar_52 = tmpvar_51; - xl_retval_38 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = xl_retval_38.pos.xyzw; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - gl_Position = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_55.x = xl_retval_38.fog; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - xlv_FOG = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = xl_retval_38.hip_pack0.xyzw; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - gl_TexCoord[0] = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59.w = 0.0; - tmpvar_59.xyz = xl_retval_38.viewDir.xyz; - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - gl_TexCoord[1] = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61.w = 0.0; - tmpvar_61.xyz = xl_retval_38.lightDir.xyz; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - gl_TexCoord[2] = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63.w = 0.0; - tmpvar_63.xyz = xl_retval_38._LightCoord.xyz; - vec4 tmpvar_64; - tmpvar_64 = tmpvar_63; - gl_TexCoord[3] = tmpvar_64; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-out.txt index a130481e9..0772d9201 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-out.txt @@ -10,32 +10,32 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; + vec3 binormal_1; vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); - tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - vec3 tmpvar_3; - tmpvar_3 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + vec4 pos_3; + pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_4; tmpvar_4[0].x = TANGENT.x; - tmpvar_4[0].y = tmpvar_3.x; + tmpvar_4[0].y = binormal_1.x; tmpvar_4[0].z = gl_Normal.x; tmpvar_4[1].x = TANGENT.y; - tmpvar_4[1].y = tmpvar_3.y; + tmpvar_4[1].y = binormal_1.y; tmpvar_4[1].z = gl_Normal.y; tmpvar_4[2].x = TANGENT.z; - tmpvar_4[2].y = tmpvar_3.z; + tmpvar_4[2].y = binormal_1.z; tmpvar_4[2].z = gl_Normal.z; vec4 tmpvar_5; tmpvar_5.w = 1.0; tmpvar_5.xyz = _WorldSpaceCameraPos; - gl_Position = tmpvar_2; + gl_Position = pos_3; vec4 tmpvar_6; tmpvar_6.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_6.x = tmpvar_2.z; + tmpvar_6.x = pos_3.z; xlv_FOG = tmpvar_6; - gl_TexCoord[0] = tmpvar_1; + gl_TexCoord[0] = tmpvar_2; vec4 tmpvar_7; tmpvar_7.w = 0.0; tmpvar_7.xyz = (tmpvar_4 * (( @@ -55,4 +55,19 @@ void main () } -// inputs: 4, stats: 24 alu 0 tex 0 flow +// stats: 24 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 9 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _BumpMap_ST (high float) 4x1 [-1] +// #2: _LightMatrix0 (high float) 4x4 [-1] +// #3: _MainTex_ST (high float) 4x1 [-1] +// #4: _Object2World (high float) 4x4 [-1] +// #5: _World2Object (high float) 4x4 [-1] +// #6: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #7: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #8: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Specular1-ir.txt deleted file mode 100644 index f4a15b02e..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Specular1-ir.txt +++ /dev/null @@ -1,104 +0,0 @@ -struct v2f_surf { - vec4 pos; - vec3 normal; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -attribute vec4 TANGENT; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -v2f_surf vert_surf ( - in appdata_full v_9 -) -{ - v2f_surf o_10; - vec4 tmpvar_11; - tmpvar_11 = (gl_ModelViewProjectionMatrix * v_9.vertex); - o_10.pos = tmpvar_11; - mat3 tmpvar_12; - tmpvar_12 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose); - vec3 tmpvar_13; - tmpvar_13 = (tmpvar_12 * v_9.normal); - o_10.normal = tmpvar_13; - return o_10; -} - -void main () -{ - appdata_full xlt_v_14; - v2f_surf xl_retval_15; - vec4 tmpvar_16; - tmpvar_16 = gl_Vertex.xyzw; - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - xlt_v_14.vertex = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = TANGENT.xyzw; - vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - xlt_v_14.tangent = tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = gl_Normal.xyz; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_20; - xlt_v_14.normal = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - xlt_v_14.texcoord = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_25; - tmpvar_25 = tmpvar_24; - xlt_v_14.texcoord1 = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = gl_Color.xyzw; - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - xlt_v_14.color = tmpvar_27; - v2f_surf tmpvar_28; - tmpvar_28 = vert_surf (xlt_v_14); - v2f_surf tmpvar_29; - tmpvar_29 = tmpvar_28; - xl_retval_15 = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = xl_retval_15.pos.xyzw; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - gl_Position = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32.w = 0.0; - tmpvar_32.xyz = xl_retval_15.normal.xyz; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - gl_TexCoord[0] = tmpvar_33; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Specular1-out.txt index 9b51150cc..d87780097 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Specular1-out.txt @@ -12,4 +12,10 @@ void main () } -// inputs: 2, stats: 3 alu 0 tex 0 flow +// stats: 3 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_Normal (high float) 3x1 [-1] loc 2 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 2 (total size: 0) +// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] +// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-ShowDestAlpha-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-ShowDestAlpha-ir.txt deleted file mode 100644 index cb1cce1b7..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-ShowDestAlpha-ir.txt +++ /dev/null @@ -1,38 +0,0 @@ -struct v2f { - vec4 vertex; -}; -struct appdata_t { - vec4 vertex; -}; -v2f vert ( - in appdata_t v_1 -) -{ - v2f o_2; - vec4 tmpvar_3; - tmpvar_3 = (gl_ModelViewProjectionMatrix * v_1.vertex); - o_2.vertex = tmpvar_3; - return o_2; -} - -void main () -{ - appdata_t xlt_v_4; - v2f xl_retval_5; - vec4 tmpvar_6; - tmpvar_6 = gl_Vertex.xyzw; - vec4 tmpvar_7; - tmpvar_7 = tmpvar_6; - xlt_v_4.vertex = tmpvar_7; - v2f tmpvar_8; - tmpvar_8 = vert (xlt_v_4); - v2f tmpvar_9; - tmpvar_9 = tmpvar_8; - xl_retval_5 = tmpvar_9; - vec4 tmpvar_10; - tmpvar_10 = xl_retval_5.vertex.xyzw; - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - gl_Position = tmpvar_11; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-ShowDestAlpha-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-ShowDestAlpha-out.txt index 0bb88373a..54aa9f532 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-ShowDestAlpha-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-ShowDestAlpha-out.txt @@ -4,4 +4,8 @@ void main () } -// inputs: 1, stats: 1 alu 0 tex 0 flow +// stats: 1 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 1 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-ir.txt deleted file mode 100644 index e4f737453..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-ir.txt +++ /dev/null @@ -1,191 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec3 viewDir; - vec4 _LightCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec3 WorldSpaceViewDir ( - in vec4 v_9 -) -{ - return (_WorldSpaceCameraPos.xyz - (_Object2World * v_9).xyz); -} - -vec3 WorldSpaceLightDir ( - in vec4 v_10 -) -{ - vec3 worldPos_11; - vec3 tmpvar_12; - tmpvar_12 = (_Object2World * v_10).xyz; - worldPos_11 = tmpvar_12; - return (_WorldSpaceLightPos0.xyz - worldPos_11); -} - -void PositionFog ( - in vec4 v_13, - out vec4 pos_14, - out float fog_15 -) -{ - vec4 tmpvar_16; - tmpvar_16 = (gl_ModelViewProjectionMatrix * v_13); - pos_14 = tmpvar_16; - float tmpvar_17; - tmpvar_17 = pos_14.z; - fog_15 = tmpvar_17; -} - -v2f_surf vert_surf ( - in appdata_full v_18 -) -{ - v2f_surf o_19; - PositionFog (v_18.vertex, o_19.pos, o_19.fog); - vec2 tmpvar_20; - tmpvar_20 = ((v_18.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_19.hip_pack0 = tmpvar_20.xy.xy; - mat3 tmpvar_21; - tmpvar_21 = xll_constructMat3 (_Object2World); - vec3 tmpvar_22; - tmpvar_22 = (tmpvar_21 * (v_18.normal * unity_Scale.w)); - o_19.normal = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = WorldSpaceLightDir (v_18.vertex); - vec3 tmpvar_24; - tmpvar_24 = tmpvar_23; - o_19.lightDir = tmpvar_24; - vec3 tmpvar_25; - tmpvar_25 = WorldSpaceViewDir (v_18.vertex); - vec3 tmpvar_26; - tmpvar_26 = tmpvar_25; - o_19.viewDir = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = (_LightMatrix0 * (_Object2World * v_18.vertex)); - o_19._LightCoord = tmpvar_27; - return o_19; -} - -void main () -{ - appdata_full xlt_v_28; - v2f_surf xl_retval_29; - vec4 tmpvar_30; - tmpvar_30 = gl_Vertex.xyzw; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - xlt_v_28.vertex = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = TANGENT.xyzw; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - xlt_v_28.tangent = tmpvar_33; - vec3 tmpvar_34; - tmpvar_34 = gl_Normal.xyz; - vec3 tmpvar_35; - tmpvar_35 = tmpvar_34; - xlt_v_28.normal = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlt_v_28.texcoord = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - xlt_v_28.texcoord1 = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = gl_Color.xyzw; - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - xlt_v_28.color = tmpvar_41; - v2f_surf tmpvar_42; - tmpvar_42 = vert_surf (xlt_v_28); - v2f_surf tmpvar_43; - tmpvar_43 = tmpvar_42; - xl_retval_29 = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44 = xl_retval_29.pos.xyzw; - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - gl_Position = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_46.x = xl_retval_29.fog; - vec4 tmpvar_47; - tmpvar_47 = tmpvar_46; - xlv_FOG = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48.zw = vec2(0.0, 0.0); - tmpvar_48.xy = xl_retval_29.hip_pack0.xy; - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - gl_TexCoord[0] = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50.w = 0.0; - tmpvar_50.xyz = xl_retval_29.normal.xyz; - vec4 tmpvar_51; - tmpvar_51 = tmpvar_50; - gl_TexCoord[1] = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52.w = 0.0; - tmpvar_52.xyz = xl_retval_29.lightDir.xyz; - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - gl_TexCoord[2] = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54.w = 0.0; - tmpvar_54.xyz = xl_retval_29.viewDir.xyz; - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - gl_TexCoord[3] = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56 = xl_retval_29._LightCoord.xyzw; - vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - gl_TexCoord[4] = tmpvar_57; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-out.txt index 12b706993..3a372de70 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-out.txt @@ -7,16 +7,16 @@ uniform vec4 unity_Scale; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_1; + pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); mat3 tmpvar_2; tmpvar_2[0] = _Object2World[0].xyz; tmpvar_2[1] = _Object2World[1].xyz; tmpvar_2[2] = _Object2World[2].xyz; - gl_Position = tmpvar_1; + gl_Position = pos_1; vec4 tmpvar_3; tmpvar_3.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_3.x = tmpvar_1.z; + tmpvar_3.x = pos_1.z; xlv_FOG = tmpvar_3; vec4 tmpvar_4; tmpvar_4.zw = vec2(0.0, 0.0); @@ -28,16 +28,28 @@ void main () gl_TexCoord[1] = tmpvar_5; vec4 tmpvar_6; tmpvar_6.w = 0.0; - vec4 cse_7; - cse_7 = (_Object2World * gl_Vertex); - tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - cse_7.xyz); + vec4 tmpvar_7; + tmpvar_7 = (_Object2World * gl_Vertex); + tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - tmpvar_7.xyz); gl_TexCoord[2] = tmpvar_6; vec4 tmpvar_8; tmpvar_8.w = 0.0; - tmpvar_8.xyz = (_WorldSpaceCameraPos - cse_7.xyz); + tmpvar_8.xyz = (_WorldSpaceCameraPos - tmpvar_7.xyz); gl_TexCoord[3] = tmpvar_8; - gl_TexCoord[4] = (_LightMatrix0 * cse_7); + gl_TexCoord[4] = (_LightMatrix0 * tmpvar_7); } -// inputs: 3, stats: 14 alu 0 tex 0 flow +// stats: 14 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 7 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _LightMatrix0 (high float) 4x4 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #5: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #6: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Specular1-ir.txt deleted file mode 100644 index f4a15b02e..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Specular1-ir.txt +++ /dev/null @@ -1,104 +0,0 @@ -struct v2f_surf { - vec4 pos; - vec3 normal; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -attribute vec4 TANGENT; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -v2f_surf vert_surf ( - in appdata_full v_9 -) -{ - v2f_surf o_10; - vec4 tmpvar_11; - tmpvar_11 = (gl_ModelViewProjectionMatrix * v_9.vertex); - o_10.pos = tmpvar_11; - mat3 tmpvar_12; - tmpvar_12 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose); - vec3 tmpvar_13; - tmpvar_13 = (tmpvar_12 * v_9.normal); - o_10.normal = tmpvar_13; - return o_10; -} - -void main () -{ - appdata_full xlt_v_14; - v2f_surf xl_retval_15; - vec4 tmpvar_16; - tmpvar_16 = gl_Vertex.xyzw; - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - xlt_v_14.vertex = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = TANGENT.xyzw; - vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - xlt_v_14.tangent = tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = gl_Normal.xyz; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_20; - xlt_v_14.normal = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - xlt_v_14.texcoord = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_25; - tmpvar_25 = tmpvar_24; - xlt_v_14.texcoord1 = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = gl_Color.xyzw; - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - xlt_v_14.color = tmpvar_27; - v2f_surf tmpvar_28; - tmpvar_28 = vert_surf (xlt_v_14); - v2f_surf tmpvar_29; - tmpvar_29 = tmpvar_28; - xl_retval_15 = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = xl_retval_15.pos.xyzw; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - gl_Position = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32.w = 0.0; - tmpvar_32.xyz = xl_retval_15.normal.xyz; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - gl_TexCoord[0] = tmpvar_33; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Specular1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Specular1-out.txt index 9b51150cc..d87780097 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Specular1-out.txt @@ -12,4 +12,10 @@ void main () } -// inputs: 2, stats: 3 alu 0 tex 0 flow +// stats: 3 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_Normal (high float) 3x1 [-1] loc 2 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 2 (total size: 0) +// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] +// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-ir.txt deleted file mode 100644 index ec3cdf973..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-ir.txt +++ /dev/null @@ -1,149 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 hip_screen; - vec3 hip_lmapFade; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _MainTex_ST; -uniform vec4 _ProjectionParams; -uniform vec4 unity_LightmapFade; -uniform vec4 unity_LightmapST; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec4 ComputeScreenPos ( - in vec4 pos_6 -) -{ - vec4 o_7; - vec4 tmpvar_8; - tmpvar_8 = (pos_6 * 0.5); - o_7 = tmpvar_8; - vec2 tmpvar_9; - tmpvar_9.x = o_7.x; - tmpvar_9.y = (o_7.y * _ProjectionParams.x); - vec2 tmpvar_10; - tmpvar_10 = (tmpvar_9 + o_7.w); - o_7.xy = tmpvar_10.xy.xy; - vec2 tmpvar_11; - tmpvar_11 = pos_6.zw; - o_7.zw = tmpvar_11.xxxy.zw; - return o_7; -} - -v2f_surf vert_surf ( - in appdata_full v_12 -) -{ - v2f_surf o_13; - PositionFog (v_12.vertex, o_13.pos, o_13.fog); - vec2 tmpvar_14; - tmpvar_14 = ((v_12.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_13.hip_pack0 = tmpvar_14.xy.xy; - vec4 tmpvar_15; - tmpvar_15 = ComputeScreenPos (o_13.pos); - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - o_13.hip_screen = tmpvar_16; - vec2 tmpvar_17; - tmpvar_17 = ((v_12.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - o_13.hip_lmapFade.xy = tmpvar_17.xy.xy; - float tmpvar_18; - tmpvar_18 = ((-( - (gl_ModelViewMatrix * v_12.vertex) - .z) * unity_LightmapFade.z) + unity_LightmapFade.w); - o_13.hip_lmapFade.z = vec3(tmpvar_18).z; - return o_13; -} - -void main () -{ - appdata_full xlt_v_19; - v2f_surf xl_retval_20; - vec4 tmpvar_21; - tmpvar_21 = gl_Vertex.xyzw; - vec4 tmpvar_22; - tmpvar_22 = tmpvar_21; - xlt_v_19.vertex = tmpvar_22; - vec4 tmpvar_23; - tmpvar_23 = TANGENT.xyzw; - vec4 tmpvar_24; - tmpvar_24 = tmpvar_23; - xlt_v_19.tangent = tmpvar_24; - vec3 tmpvar_25; - tmpvar_25 = gl_Normal.xyz; - vec3 tmpvar_26; - tmpvar_26 = tmpvar_25; - xlt_v_19.normal = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - xlt_v_19.texcoord = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - xlt_v_19.texcoord1 = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = gl_Color.xyzw; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_31; - xlt_v_19.color = tmpvar_32; - v2f_surf tmpvar_33; - tmpvar_33 = vert_surf (xlt_v_19); - v2f_surf tmpvar_34; - tmpvar_34 = tmpvar_33; - xl_retval_20 = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35 = xl_retval_20.pos.xyzw; - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - gl_Position = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_37.x = xl_retval_20.fog; - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlv_FOG = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39.zw = vec2(0.0, 0.0); - tmpvar_39.xy = xl_retval_20.hip_pack0.xy; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - gl_TexCoord[0] = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = xl_retval_20.hip_screen.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - gl_TexCoord[1] = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43.w = 0.0; - tmpvar_43.xyz = xl_retval_20.hip_lmapFade.xyz; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - gl_TexCoord[2] = tmpvar_44; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-out.txt index e8a9b9657..1ddacd635 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-out.txt @@ -6,35 +6,45 @@ varying vec4 xlv_FOG; void main () { vec3 tmpvar_1; - vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_2; + pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); vec4 o_3; - vec4 tmpvar_4; - tmpvar_4 = (tmpvar_2 * 0.5); - vec2 tmpvar_5; - tmpvar_5.x = tmpvar_4.x; - tmpvar_5.y = (tmpvar_4.y * _ProjectionParams.x); - o_3.xy = (tmpvar_5 + tmpvar_4.w); - o_3.zw = tmpvar_2.zw; + o_3 = (pos_2 * 0.5); + vec2 tmpvar_4; + tmpvar_4.x = o_3.x; + tmpvar_4.y = (o_3.y * _ProjectionParams.x); + o_3.xy = (tmpvar_4 + o_3.w); + o_3.zw = pos_2.zw; tmpvar_1.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); tmpvar_1.z = ((-( (gl_ModelViewMatrix * gl_Vertex) .z) * unity_LightmapFade.z) + unity_LightmapFade.w); - gl_Position = tmpvar_2; + gl_Position = pos_2; + vec4 tmpvar_5; + tmpvar_5.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_5.x = pos_2.z; + xlv_FOG = tmpvar_5; vec4 tmpvar_6; - tmpvar_6.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_6.x = tmpvar_2.z; - xlv_FOG = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7.zw = vec2(0.0, 0.0); - tmpvar_7.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_7; + tmpvar_6.zw = vec2(0.0, 0.0); + tmpvar_6.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_6; gl_TexCoord[1] = o_3; - vec4 tmpvar_8; - tmpvar_8.w = 0.0; - tmpvar_8.xyz = tmpvar_1; - gl_TexCoord[2] = tmpvar_8; + vec4 tmpvar_7; + tmpvar_7.w = 0.0; + tmpvar_7.xyz = tmpvar_1; + gl_TexCoord[2] = tmpvar_7; } -// inputs: 3, stats: 15 alu 0 tex 0 flow +// stats: 15 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 6 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: gl_ModelViewMatrix (high float) 4x4 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _ProjectionParams (high float) 4x1 [-1] +// #4: unity_LightmapFade (high float) 4x1 [-1] +// #5: unity_LightmapST (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-ir.txt deleted file mode 100644 index 514cced93..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-ir.txt +++ /dev/null @@ -1,174 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 normal; - vec3 lightDir; - vec4 _LightCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _Detail_ST; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec3 WorldSpaceLightDir ( - in vec4 v_9 -) -{ - vec3 worldPos_10; - vec3 tmpvar_11; - tmpvar_11 = (_Object2World * v_9).xyz; - worldPos_10 = tmpvar_11; - return (_WorldSpaceLightPos0.xyz - worldPos_10); -} - -void PositionFog ( - in vec4 v_12, - out vec4 pos_13, - out float fog_14 -) -{ - vec4 tmpvar_15; - tmpvar_15 = (gl_ModelViewProjectionMatrix * v_12); - pos_13 = tmpvar_15; - float tmpvar_16; - tmpvar_16 = pos_13.z; - fog_14 = tmpvar_16; -} - -v2f_surf vert_surf ( - in appdata_full v_17 -) -{ - v2f_surf o_18; - PositionFog (v_17.vertex, o_18.pos, o_18.fog); - vec2 tmpvar_19; - tmpvar_19 = ((v_17.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_18.hip_pack0.xy = tmpvar_19.xy.xy; - vec2 tmpvar_20; - tmpvar_20 = ((v_17.texcoord1.xy * _Detail_ST.xy) + _Detail_ST.zw); - o_18.hip_pack0.zw = tmpvar_20.xxxy.zw; - mat3 tmpvar_21; - tmpvar_21 = xll_constructMat3 (_Object2World); - vec3 tmpvar_22; - tmpvar_22 = (tmpvar_21 * (v_17.normal * unity_Scale.w)); - o_18.normal = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = WorldSpaceLightDir (v_17.vertex); - vec3 tmpvar_24; - tmpvar_24 = tmpvar_23; - o_18.lightDir = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25 = (_LightMatrix0 * (_Object2World * v_17.vertex)); - o_18._LightCoord = tmpvar_25; - return o_18; -} - -void main () -{ - appdata_full xlt_v_26; - v2f_surf xl_retval_27; - vec4 tmpvar_28; - tmpvar_28 = gl_Vertex.xyzw; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - xlt_v_26.vertex = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = TANGENT.xyzw; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - xlt_v_26.tangent = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = gl_Normal.xyz; - vec3 tmpvar_33; - tmpvar_33 = tmpvar_32; - xlt_v_26.normal = tmpvar_33; - vec4 tmpvar_34; - tmpvar_34 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_35; - tmpvar_35 = tmpvar_34; - xlt_v_26.texcoord = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlt_v_26.texcoord1 = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = gl_Color.xyzw; - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - xlt_v_26.color = tmpvar_39; - v2f_surf tmpvar_40; - tmpvar_40 = vert_surf (xlt_v_26); - v2f_surf tmpvar_41; - tmpvar_41 = tmpvar_40; - xl_retval_27 = tmpvar_41; - vec4 tmpvar_42; - tmpvar_42 = xl_retval_27.pos.xyzw; - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - gl_Position = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_44.x = xl_retval_27.fog; - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - xlv_FOG = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46 = xl_retval_27.hip_pack0.xyzw; - vec4 tmpvar_47; - tmpvar_47 = tmpvar_46; - gl_TexCoord[0] = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48.w = 0.0; - tmpvar_48.xyz = xl_retval_27.normal.xyz; - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - gl_TexCoord[1] = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50.w = 0.0; - tmpvar_50.xyz = xl_retval_27.lightDir.xyz; - vec4 tmpvar_51; - tmpvar_51 = tmpvar_50; - gl_TexCoord[2] = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52 = xl_retval_27._LightCoord.xyzw; - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - gl_TexCoord[3] = tmpvar_53; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-out.txt index 77137c987..f602f14ed 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-out.txt @@ -8,18 +8,18 @@ varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; - vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_2; + pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); tmpvar_1.zw = ((gl_MultiTexCoord1.xy * _Detail_ST.xy) + _Detail_ST.zw); mat3 tmpvar_3; tmpvar_3[0] = _Object2World[0].xyz; tmpvar_3[1] = _Object2World[1].xyz; tmpvar_3[2] = _Object2World[2].xyz; - gl_Position = tmpvar_2; + gl_Position = pos_2; vec4 tmpvar_4; tmpvar_4.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_4.x = tmpvar_2.z; + tmpvar_4.x = pos_2.z; xlv_FOG = tmpvar_4; gl_TexCoord[0] = tmpvar_1; vec4 tmpvar_5; @@ -28,12 +28,25 @@ void main () gl_TexCoord[1] = tmpvar_5; vec4 tmpvar_6; tmpvar_6.w = 0.0; - vec4 cse_7; - cse_7 = (_Object2World * gl_Vertex); - tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - cse_7.xyz); + vec4 tmpvar_7; + tmpvar_7 = (_Object2World * gl_Vertex); + tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - tmpvar_7.xyz); gl_TexCoord[2] = tmpvar_6; - gl_TexCoord[3] = (_LightMatrix0 * cse_7); + gl_TexCoord[3] = (_LightMatrix0 * tmpvar_7); } -// inputs: 4, stats: 13 alu 0 tex 0 flow +// stats: 13 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #2: gl_Normal (high float) 3x1 [-1] loc 2 +// #3: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 7 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _Detail_ST (high float) 4x1 [-1] +// #2: _LightMatrix0 (high float) 4x4 [-1] +// #3: _MainTex_ST (high float) 4x1 [-1] +// #4: _Object2World (high float) 4x4 [-1] +// #5: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #6: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-ir.txt deleted file mode 100644 index 05d5189c8..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-ir.txt +++ /dev/null @@ -1,135 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec4 hip_screen; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _Detail_ST; -uniform vec4 _MainTex_ST; -uniform vec4 _ProjectionParams; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec4 ComputeScreenPos ( - in vec4 pos_6 -) -{ - vec4 o_7; - vec4 tmpvar_8; - tmpvar_8 = (pos_6 * 0.5); - o_7 = tmpvar_8; - vec2 tmpvar_9; - tmpvar_9.x = o_7.x; - tmpvar_9.y = (o_7.y * _ProjectionParams.x); - vec2 tmpvar_10; - tmpvar_10 = (tmpvar_9 + o_7.w); - o_7.xy = tmpvar_10.xy.xy; - vec2 tmpvar_11; - tmpvar_11 = pos_6.zw; - o_7.zw = tmpvar_11.xxxy.zw; - return o_7; -} - -v2f_surf vert_surf ( - in appdata_full v_12 -) -{ - v2f_surf o_13; - PositionFog (v_12.vertex, o_13.pos, o_13.fog); - vec2 tmpvar_14; - tmpvar_14 = ((v_12.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_13.hip_pack0.xy = tmpvar_14.xy.xy; - vec2 tmpvar_15; - tmpvar_15 = ((v_12.texcoord1.xy * _Detail_ST.xy) + _Detail_ST.zw); - o_13.hip_pack0.zw = tmpvar_15.xxxy.zw; - vec4 tmpvar_16; - tmpvar_16 = ComputeScreenPos (o_13.pos); - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - o_13.hip_screen = tmpvar_17; - return o_13; -} - -void main () -{ - appdata_full xlt_v_18; - v2f_surf xl_retval_19; - vec4 tmpvar_20; - tmpvar_20 = gl_Vertex.xyzw; - vec4 tmpvar_21; - tmpvar_21 = tmpvar_20; - xlt_v_18.vertex = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22 = TANGENT.xyzw; - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - xlt_v_18.tangent = tmpvar_23; - vec3 tmpvar_24; - tmpvar_24 = gl_Normal.xyz; - vec3 tmpvar_25; - tmpvar_25 = tmpvar_24; - xlt_v_18.normal = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - xlt_v_18.texcoord = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - xlt_v_18.texcoord1 = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = gl_Color.xyzw; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - xlt_v_18.color = tmpvar_31; - v2f_surf tmpvar_32; - tmpvar_32 = vert_surf (xlt_v_18); - v2f_surf tmpvar_33; - tmpvar_33 = tmpvar_32; - xl_retval_19 = tmpvar_33; - vec4 tmpvar_34; - tmpvar_34 = xl_retval_19.pos.xyzw; - vec4 tmpvar_35; - tmpvar_35 = tmpvar_34; - gl_Position = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_36.x = xl_retval_19.fog; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlv_FOG = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = xl_retval_19.hip_pack0.xyzw; - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - gl_TexCoord[0] = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = xl_retval_19.hip_screen.xyzw; - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - gl_TexCoord[1] = tmpvar_41; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-out.txt index 1abd95879..ee8abb889 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-out.txt @@ -5,26 +5,34 @@ varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; - vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_2; + pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); tmpvar_1.zw = ((gl_MultiTexCoord1.xy * _Detail_ST.xy) + _Detail_ST.zw); vec4 o_3; - vec4 tmpvar_4; - tmpvar_4 = (tmpvar_2 * 0.5); - vec2 tmpvar_5; - tmpvar_5.x = tmpvar_4.x; - tmpvar_5.y = (tmpvar_4.y * _ProjectionParams.x); - o_3.xy = (tmpvar_5 + tmpvar_4.w); - o_3.zw = tmpvar_2.zw; - gl_Position = tmpvar_2; - vec4 tmpvar_6; - tmpvar_6.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_6.x = tmpvar_2.z; - xlv_FOG = tmpvar_6; + o_3 = (pos_2 * 0.5); + vec2 tmpvar_4; + tmpvar_4.x = o_3.x; + tmpvar_4.y = (o_3.y * _ProjectionParams.x); + o_3.xy = (tmpvar_4 + o_3.w); + o_3.zw = pos_2.zw; + gl_Position = pos_2; + vec4 tmpvar_5; + tmpvar_5.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_5.x = pos_2.z; + xlv_FOG = tmpvar_5; gl_TexCoord[0] = tmpvar_1; gl_TexCoord[1] = o_3; } -// inputs: 3, stats: 9 alu 0 tex 0 flow +// stats: 9 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 4 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _Detail_ST (high float) 4x1 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _ProjectionParams (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-ir.txt deleted file mode 100644 index 1434d1ff1..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-ir.txt +++ /dev/null @@ -1,194 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 normal; - vec3 lightDir; - vec3 viewDir; - vec4 _LightCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _SpecMap_ST; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec3 WorldSpaceViewDir ( - in vec4 v_9 -) -{ - return (_WorldSpaceCameraPos.xyz - (_Object2World * v_9).xyz); -} - -vec3 WorldSpaceLightDir ( - in vec4 v_10 -) -{ - vec3 worldPos_11; - vec3 tmpvar_12; - tmpvar_12 = (_Object2World * v_10).xyz; - worldPos_11 = tmpvar_12; - return (_WorldSpaceLightPos0.xyz - worldPos_11); -} - -void PositionFog ( - in vec4 v_13, - out vec4 pos_14, - out float fog_15 -) -{ - vec4 tmpvar_16; - tmpvar_16 = (gl_ModelViewProjectionMatrix * v_13); - pos_14 = tmpvar_16; - float tmpvar_17; - tmpvar_17 = pos_14.z; - fog_15 = tmpvar_17; -} - -v2f_surf vert_surf ( - in appdata_full v_18 -) -{ - v2f_surf o_19; - PositionFog (v_18.vertex, o_19.pos, o_19.fog); - vec2 tmpvar_20; - tmpvar_20 = ((v_18.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_19.hip_pack0.xy = tmpvar_20.xy.xy; - vec2 tmpvar_21; - tmpvar_21 = ((v_18.texcoord.xy * _SpecMap_ST.xy) + _SpecMap_ST.zw); - o_19.hip_pack0.zw = tmpvar_21.xxxy.zw; - mat3 tmpvar_22; - tmpvar_22 = xll_constructMat3 (_Object2World); - vec3 tmpvar_23; - tmpvar_23 = (tmpvar_22 * (v_18.normal * unity_Scale.w)); - o_19.normal = tmpvar_23; - vec3 tmpvar_24; - tmpvar_24 = WorldSpaceLightDir (v_18.vertex); - vec3 tmpvar_25; - tmpvar_25 = tmpvar_24; - o_19.lightDir = tmpvar_25; - vec3 tmpvar_26; - tmpvar_26 = WorldSpaceViewDir (v_18.vertex); - vec3 tmpvar_27; - tmpvar_27 = tmpvar_26; - o_19.viewDir = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = (_LightMatrix0 * (_Object2World * v_18.vertex)); - o_19._LightCoord = tmpvar_28; - return o_19; -} - -void main () -{ - appdata_full xlt_v_29; - v2f_surf xl_retval_30; - vec4 tmpvar_31; - tmpvar_31 = gl_Vertex.xyzw; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_31; - xlt_v_29.vertex = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = TANGENT.xyzw; - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - xlt_v_29.tangent = tmpvar_34; - vec3 tmpvar_35; - tmpvar_35 = gl_Normal.xyz; - vec3 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlt_v_29.normal = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlt_v_29.texcoord = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_v_29.texcoord1 = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = gl_Color.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_v_29.color = tmpvar_42; - v2f_surf tmpvar_43; - tmpvar_43 = vert_surf (xlt_v_29); - v2f_surf tmpvar_44; - tmpvar_44 = tmpvar_43; - xl_retval_30 = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = xl_retval_30.pos.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - gl_Position = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_47.x = xl_retval_30.fog; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlv_FOG = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = xl_retval_30.hip_pack0.xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - gl_TexCoord[0] = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51.w = 0.0; - tmpvar_51.xyz = xl_retval_30.normal.xyz; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - gl_TexCoord[1] = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53.w = 0.0; - tmpvar_53.xyz = xl_retval_30.lightDir.xyz; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - gl_TexCoord[2] = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55.w = 0.0; - tmpvar_55.xyz = xl_retval_30.viewDir.xyz; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - gl_TexCoord[3] = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = xl_retval_30._LightCoord.xyzw; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - gl_TexCoord[4] = tmpvar_58; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-out.txt index 6f3f81b98..d18ed2b33 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-out.txt @@ -9,18 +9,18 @@ varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; - vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_2; + pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _SpecMap_ST.xy) + _SpecMap_ST.zw); mat3 tmpvar_3; tmpvar_3[0] = _Object2World[0].xyz; tmpvar_3[1] = _Object2World[1].xyz; tmpvar_3[2] = _Object2World[2].xyz; - gl_Position = tmpvar_2; + gl_Position = pos_2; vec4 tmpvar_4; tmpvar_4.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_4.x = tmpvar_2.z; + tmpvar_4.x = pos_2.z; xlv_FOG = tmpvar_4; gl_TexCoord[0] = tmpvar_1; vec4 tmpvar_5; @@ -29,16 +29,29 @@ void main () gl_TexCoord[1] = tmpvar_5; vec4 tmpvar_6; tmpvar_6.w = 0.0; - vec4 cse_7; - cse_7 = (_Object2World * gl_Vertex); - tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - cse_7.xyz); + vec4 tmpvar_7; + tmpvar_7 = (_Object2World * gl_Vertex); + tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - tmpvar_7.xyz); gl_TexCoord[2] = tmpvar_6; vec4 tmpvar_8; tmpvar_8.w = 0.0; - tmpvar_8.xyz = (_WorldSpaceCameraPos - cse_7.xyz); + tmpvar_8.xyz = (_WorldSpaceCameraPos - tmpvar_7.xyz); gl_TexCoord[3] = tmpvar_8; - gl_TexCoord[4] = (_LightMatrix0 * cse_7); + gl_TexCoord[4] = (_LightMatrix0 * tmpvar_7); } -// inputs: 3, stats: 15 alu 0 tex 0 flow +// stats: 15 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 8 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _LightMatrix0 (high float) 4x4 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _SpecMap_ST (high float) 4x1 [-1] +// #5: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #6: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #7: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular1-ir.txt deleted file mode 100644 index f4a15b02e..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular1-ir.txt +++ /dev/null @@ -1,104 +0,0 @@ -struct v2f_surf { - vec4 pos; - vec3 normal; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -attribute vec4 TANGENT; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -v2f_surf vert_surf ( - in appdata_full v_9 -) -{ - v2f_surf o_10; - vec4 tmpvar_11; - tmpvar_11 = (gl_ModelViewProjectionMatrix * v_9.vertex); - o_10.pos = tmpvar_11; - mat3 tmpvar_12; - tmpvar_12 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose); - vec3 tmpvar_13; - tmpvar_13 = (tmpvar_12 * v_9.normal); - o_10.normal = tmpvar_13; - return o_10; -} - -void main () -{ - appdata_full xlt_v_14; - v2f_surf xl_retval_15; - vec4 tmpvar_16; - tmpvar_16 = gl_Vertex.xyzw; - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - xlt_v_14.vertex = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = TANGENT.xyzw; - vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - xlt_v_14.tangent = tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = gl_Normal.xyz; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_20; - xlt_v_14.normal = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - xlt_v_14.texcoord = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_25; - tmpvar_25 = tmpvar_24; - xlt_v_14.texcoord1 = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = gl_Color.xyzw; - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - xlt_v_14.color = tmpvar_27; - v2f_surf tmpvar_28; - tmpvar_28 = vert_surf (xlt_v_14); - v2f_surf tmpvar_29; - tmpvar_29 = tmpvar_28; - xl_retval_15 = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = xl_retval_15.pos.xyzw; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - gl_Position = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32.w = 0.0; - tmpvar_32.xyz = xl_retval_15.normal.xyz; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - gl_TexCoord[0] = tmpvar_33; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular1-out.txt index 9b51150cc..d87780097 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular1-out.txt @@ -12,4 +12,10 @@ void main () } -// inputs: 2, stats: 3 alu 0 tex 0 flow +// stats: 3 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_Normal (high float) 3x1 [-1] loc 2 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 2 (total size: 0) +// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] +// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-ir.txt deleted file mode 100644 index ed242d2be..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-ir.txt +++ /dev/null @@ -1,186 +0,0 @@ -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -struct Input { - vec3 foo; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec3 cust_foo; - vec3 normal; - vec3 lightDir; - vec3 _LightCoord; -}; -uniform mat4 _LightMatrix0; -uniform mat4 _Object2World; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -void vert ( - inout appdata_full v_9, - out Input o_10 -) -{ - vec3 tmpvar_11; - tmpvar_11 = ((v_9.normal * 0.5) + 0.5); - o_10.foo = tmpvar_11; -} - -vec3 WorldSpaceLightDir ( - in vec4 v_12 -) -{ - vec3 worldPos_13; - vec3 tmpvar_14; - tmpvar_14 = (_Object2World * v_12).xyz; - worldPos_13 = tmpvar_14; - return (_WorldSpaceLightPos0.xyz - worldPos_13); -} - -void PositionFog ( - in vec4 v_15, - out vec4 pos_16, - out float fog_17 -) -{ - vec4 tmpvar_18; - tmpvar_18 = (gl_ModelViewProjectionMatrix * v_15); - pos_16 = tmpvar_18; - float tmpvar_19; - tmpvar_19 = pos_16.z; - fog_17 = tmpvar_19; -} - -v2f_surf vert_surf ( - in appdata_full v_20 -) -{ - v2f_surf o_21; - Input customInputData_22; - vert (v_20, customInputData_22); - vec3 tmpvar_23; - tmpvar_23 = customInputData_22.foo; - o_21.cust_foo = tmpvar_23; - PositionFog (v_20.vertex, o_21.pos, o_21.fog); - mat3 tmpvar_24; - tmpvar_24 = xll_constructMat3 (_Object2World); - vec3 tmpvar_25; - tmpvar_25 = (tmpvar_24 * (v_20.normal * unity_Scale.w)); - o_21.normal = tmpvar_25; - vec3 tmpvar_26; - tmpvar_26 = WorldSpaceLightDir (v_20.vertex); - vec3 tmpvar_27; - tmpvar_27 = tmpvar_26; - o_21.lightDir = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = (_LightMatrix0 * (_Object2World * v_20.vertex)).xyz; - o_21._LightCoord = tmpvar_28; - return o_21; -} - -void main () -{ - appdata_full xlt_v_29; - v2f_surf xl_retval_30; - vec4 tmpvar_31; - tmpvar_31 = gl_Vertex.xyzw; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_31; - xlt_v_29.vertex = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = TANGENT.xyzw; - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - xlt_v_29.tangent = tmpvar_34; - vec3 tmpvar_35; - tmpvar_35 = gl_Normal.xyz; - vec3 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlt_v_29.normal = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlt_v_29.texcoord = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_v_29.texcoord1 = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = gl_Color.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_v_29.color = tmpvar_42; - v2f_surf tmpvar_43; - tmpvar_43 = vert_surf (xlt_v_29); - v2f_surf tmpvar_44; - tmpvar_44 = tmpvar_43; - xl_retval_30 = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = xl_retval_30.pos.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - gl_Position = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_47.x = xl_retval_30.fog; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlv_FOG = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49.w = 0.0; - tmpvar_49.xyz = xl_retval_30.cust_foo.xyz; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - gl_TexCoord[0] = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51.w = 0.0; - tmpvar_51.xyz = xl_retval_30.normal.xyz; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - gl_TexCoord[1] = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53.w = 0.0; - tmpvar_53.xyz = xl_retval_30.lightDir.xyz; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - gl_TexCoord[2] = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55.w = 0.0; - tmpvar_55.xyz = xl_retval_30._LightCoord.xyz; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - gl_TexCoord[3] = tmpvar_56; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-out.txt index d4ffef871..d3849d5ee 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-out.txt @@ -5,16 +5,16 @@ uniform vec4 unity_Scale; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_1; + pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); mat3 tmpvar_2; tmpvar_2[0] = _Object2World[0].xyz; tmpvar_2[1] = _Object2World[1].xyz; tmpvar_2[2] = _Object2World[2].xyz; - gl_Position = tmpvar_1; + gl_Position = pos_1; vec4 tmpvar_3; tmpvar_3.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_3.x = tmpvar_1.z; + tmpvar_3.x = pos_1.z; xlv_FOG = tmpvar_3; vec4 tmpvar_4; tmpvar_4.w = 0.0; @@ -26,15 +26,24 @@ void main () gl_TexCoord[1] = tmpvar_5; vec4 tmpvar_6; tmpvar_6.w = 0.0; - vec4 cse_7; - cse_7 = (_Object2World * gl_Vertex); - tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - cse_7.xyz); + vec4 tmpvar_7; + tmpvar_7 = (_Object2World * gl_Vertex); + tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - tmpvar_7.xyz); gl_TexCoord[2] = tmpvar_6; vec4 tmpvar_8; tmpvar_8.w = 0.0; - tmpvar_8.xyz = (_LightMatrix0 * cse_7).xyz; + tmpvar_8.xyz = (_LightMatrix0 * tmpvar_7).xyz; gl_TexCoord[3] = tmpvar_8; } -// inputs: 2, stats: 13 alu 0 tex 0 flow +// stats: 13 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_Normal (high float) 3x1 [-1] loc 2 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 5 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _LightMatrix0 (high float) 4x4 [-1] +// #2: _Object2World (high float) 4x4 [-1] +// #3: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #4: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-ir.txt deleted file mode 100644 index c26d5d803..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-ir.txt +++ /dev/null @@ -1,186 +0,0 @@ -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -struct Input { - vec3 foo; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec3 cust_foo; - vec3 normal; - vec3 lightDir; - vec2 _LightCoord; -}; -uniform mat4 _LightMatrix0; -uniform mat4 _Object2World; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -void vert ( - inout appdata_full v_9, - out Input o_10 -) -{ - vec3 tmpvar_11; - tmpvar_11 = ((v_9.normal * 0.5) + 0.5); - o_10.foo = tmpvar_11; -} - -vec3 WorldSpaceLightDir ( - in vec4 v_12 -) -{ - vec3 worldPos_13; - vec3 tmpvar_14; - tmpvar_14 = (_Object2World * v_12).xyz; - worldPos_13 = tmpvar_14; - return _WorldSpaceLightPos0.xyz; -} - -void PositionFog ( - in vec4 v_15, - out vec4 pos_16, - out float fog_17 -) -{ - vec4 tmpvar_18; - tmpvar_18 = (gl_ModelViewProjectionMatrix * v_15); - pos_16 = tmpvar_18; - float tmpvar_19; - tmpvar_19 = pos_16.z; - fog_17 = tmpvar_19; -} - -v2f_surf vert_surf ( - in appdata_full v_20 -) -{ - v2f_surf o_21; - Input customInputData_22; - vert (v_20, customInputData_22); - vec3 tmpvar_23; - tmpvar_23 = customInputData_22.foo; - o_21.cust_foo = tmpvar_23; - PositionFog (v_20.vertex, o_21.pos, o_21.fog); - mat3 tmpvar_24; - tmpvar_24 = xll_constructMat3 (_Object2World); - vec3 tmpvar_25; - tmpvar_25 = (tmpvar_24 * (v_20.normal * unity_Scale.w)); - o_21.normal = tmpvar_25; - vec3 tmpvar_26; - tmpvar_26 = WorldSpaceLightDir (v_20.vertex); - vec3 tmpvar_27; - tmpvar_27 = tmpvar_26; - o_21.lightDir = tmpvar_27; - vec2 tmpvar_28; - tmpvar_28 = (_LightMatrix0 * (_Object2World * v_20.vertex)).xy; - o_21._LightCoord = tmpvar_28; - return o_21; -} - -void main () -{ - appdata_full xlt_v_29; - v2f_surf xl_retval_30; - vec4 tmpvar_31; - tmpvar_31 = gl_Vertex.xyzw; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_31; - xlt_v_29.vertex = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = TANGENT.xyzw; - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - xlt_v_29.tangent = tmpvar_34; - vec3 tmpvar_35; - tmpvar_35 = gl_Normal.xyz; - vec3 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlt_v_29.normal = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlt_v_29.texcoord = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_v_29.texcoord1 = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = gl_Color.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_v_29.color = tmpvar_42; - v2f_surf tmpvar_43; - tmpvar_43 = vert_surf (xlt_v_29); - v2f_surf tmpvar_44; - tmpvar_44 = tmpvar_43; - xl_retval_30 = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = xl_retval_30.pos.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - gl_Position = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_47.x = xl_retval_30.fog; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlv_FOG = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49.w = 0.0; - tmpvar_49.xyz = xl_retval_30.cust_foo.xyz; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - gl_TexCoord[0] = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51.w = 0.0; - tmpvar_51.xyz = xl_retval_30.normal.xyz; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - gl_TexCoord[1] = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53.w = 0.0; - tmpvar_53.xyz = xl_retval_30.lightDir.xyz; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - gl_TexCoord[2] = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55.zw = vec2(0.0, 0.0); - tmpvar_55.xy = xl_retval_30._LightCoord.xy; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - gl_TexCoord[3] = tmpvar_56; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-out.txt index b73629a41..40009b349 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-out.txt @@ -5,16 +5,16 @@ uniform vec4 unity_Scale; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_1; + pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); mat3 tmpvar_2; tmpvar_2[0] = _Object2World[0].xyz; tmpvar_2[1] = _Object2World[1].xyz; tmpvar_2[2] = _Object2World[2].xyz; - gl_Position = tmpvar_1; + gl_Position = pos_1; vec4 tmpvar_3; tmpvar_3.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_3.x = tmpvar_1.z; + tmpvar_3.x = pos_1.z; xlv_FOG = tmpvar_3; vec4 tmpvar_4; tmpvar_4.w = 0.0; @@ -35,4 +35,13 @@ void main () } -// inputs: 2, stats: 12 alu 0 tex 0 flow +// stats: 12 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_Normal (high float) 3x1 [-1] loc 2 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 5 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _LightMatrix0 (high float) 4x4 [-1] +// #2: _Object2World (high float) 4x4 [-1] +// #3: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #4: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-ir.txt deleted file mode 100644 index aea7e61b0..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-ir.txt +++ /dev/null @@ -1,163 +0,0 @@ -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -struct Input { - vec3 foo; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec3 cust_foo; - vec4 hip_screen; - vec3 hip_lmapFade; -}; -uniform vec4 _ProjectionParams; -uniform vec4 unity_LightmapFade; -uniform vec4 unity_LightmapST; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void vert ( - inout appdata_full v_1, - out Input o_2 -) -{ - vec3 tmpvar_3; - tmpvar_3 = ((v_1.normal * 0.5) + 0.5); - o_2.foo = tmpvar_3; -} - -void PositionFog ( - in vec4 v_4, - out vec4 pos_5, - out float fog_6 -) -{ - vec4 tmpvar_7; - tmpvar_7 = (gl_ModelViewProjectionMatrix * v_4); - pos_5 = tmpvar_7; - float tmpvar_8; - tmpvar_8 = pos_5.z; - fog_6 = tmpvar_8; -} - -vec4 ComputeScreenPos ( - in vec4 pos_9 -) -{ - vec4 o_10; - vec4 tmpvar_11; - tmpvar_11 = (pos_9 * 0.5); - o_10 = tmpvar_11; - vec2 tmpvar_12; - tmpvar_12.x = o_10.x; - tmpvar_12.y = (o_10.y * _ProjectionParams.x); - vec2 tmpvar_13; - tmpvar_13 = (tmpvar_12 + o_10.w); - o_10.xy = tmpvar_13.xy.xy; - vec2 tmpvar_14; - tmpvar_14 = pos_9.zw; - o_10.zw = tmpvar_14.xxxy.zw; - return o_10; -} - -v2f_surf vert_surf ( - in appdata_full v_15 -) -{ - v2f_surf o_16; - Input customInputData_17; - vert (v_15, customInputData_17); - vec3 tmpvar_18; - tmpvar_18 = customInputData_17.foo; - o_16.cust_foo = tmpvar_18; - PositionFog (v_15.vertex, o_16.pos, o_16.fog); - vec4 tmpvar_19; - tmpvar_19 = ComputeScreenPos (o_16.pos); - vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - o_16.hip_screen = tmpvar_20; - vec2 tmpvar_21; - tmpvar_21 = ((v_15.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - o_16.hip_lmapFade.xy = tmpvar_21.xy.xy; - float tmpvar_22; - tmpvar_22 = ((-( - (gl_ModelViewMatrix * v_15.vertex) - .z) * unity_LightmapFade.z) + unity_LightmapFade.w); - o_16.hip_lmapFade.z = vec3(tmpvar_22).z; - return o_16; -} - -void main () -{ - appdata_full xlt_v_23; - v2f_surf xl_retval_24; - vec4 tmpvar_25; - tmpvar_25 = gl_Vertex.xyzw; - vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; - xlt_v_23.vertex = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = TANGENT.xyzw; - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - xlt_v_23.tangent = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = gl_Normal.xyz; - vec3 tmpvar_30; - tmpvar_30 = tmpvar_29; - xlt_v_23.normal = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_31; - xlt_v_23.texcoord = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - xlt_v_23.texcoord1 = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35 = gl_Color.xyzw; - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlt_v_23.color = tmpvar_36; - v2f_surf tmpvar_37; - tmpvar_37 = vert_surf (xlt_v_23); - v2f_surf tmpvar_38; - tmpvar_38 = tmpvar_37; - xl_retval_24 = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = xl_retval_24.pos.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - gl_Position = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_41.x = xl_retval_24.fog; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlv_FOG = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43.w = 0.0; - tmpvar_43.xyz = xl_retval_24.cust_foo.xyz; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - gl_TexCoord[0] = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = xl_retval_24.hip_screen.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - gl_TexCoord[1] = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47.w = 0.0; - tmpvar_47.xyz = xl_retval_24.hip_lmapFade.xyz; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - gl_TexCoord[2] = tmpvar_48; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-out.txt index 84158b70b..eafc976c2 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-out.txt @@ -5,35 +5,44 @@ varying vec4 xlv_FOG; void main () { vec3 tmpvar_1; - vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_2; + pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); vec4 o_3; - vec4 tmpvar_4; - tmpvar_4 = (tmpvar_2 * 0.5); - vec2 tmpvar_5; - tmpvar_5.x = tmpvar_4.x; - tmpvar_5.y = (tmpvar_4.y * _ProjectionParams.x); - o_3.xy = (tmpvar_5 + tmpvar_4.w); - o_3.zw = tmpvar_2.zw; + o_3 = (pos_2 * 0.5); + vec2 tmpvar_4; + tmpvar_4.x = o_3.x; + tmpvar_4.y = (o_3.y * _ProjectionParams.x); + o_3.xy = (tmpvar_4 + o_3.w); + o_3.zw = pos_2.zw; tmpvar_1.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); tmpvar_1.z = ((-( (gl_ModelViewMatrix * gl_Vertex) .z) * unity_LightmapFade.z) + unity_LightmapFade.w); - gl_Position = tmpvar_2; + gl_Position = pos_2; + vec4 tmpvar_5; + tmpvar_5.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_5.x = pos_2.z; + xlv_FOG = tmpvar_5; vec4 tmpvar_6; - tmpvar_6.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_6.x = tmpvar_2.z; - xlv_FOG = tmpvar_6; + tmpvar_6.w = 0.0; + tmpvar_6.xyz = ((gl_Normal * 0.5) + 0.5); + gl_TexCoord[0] = tmpvar_6; + gl_TexCoord[1] = o_3; vec4 tmpvar_7; tmpvar_7.w = 0.0; - tmpvar_7.xyz = ((gl_Normal * 0.5) + 0.5); - gl_TexCoord[0] = tmpvar_7; - gl_TexCoord[1] = o_3; - vec4 tmpvar_8; - tmpvar_8.w = 0.0; - tmpvar_8.xyz = tmpvar_1; - gl_TexCoord[2] = tmpvar_8; + tmpvar_7.xyz = tmpvar_1; + gl_TexCoord[2] = tmpvar_7; } -// inputs: 3, stats: 15 alu 0 tex 0 flow +// stats: 15 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 5 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: gl_ModelViewMatrix (high float) 4x4 [-1] +// #2: _ProjectionParams (high float) 4x1 [-1] +// #3: unity_LightmapFade (high float) 4x1 [-1] +// #4: unity_LightmapST (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-ir.txt deleted file mode 100644 index f53223c90..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-ir.txt +++ /dev/null @@ -1,161 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec3 WorldSpaceLightDir ( - in vec4 v_9 -) -{ - vec3 worldPos_10; - vec3 tmpvar_11; - tmpvar_11 = (_Object2World * v_9).xyz; - worldPos_10 = tmpvar_11; - return _WorldSpaceLightPos0.xyz; -} - -void PositionFog ( - in vec4 v_12, - out vec4 pos_13, - out float fog_14 -) -{ - vec4 tmpvar_15; - tmpvar_15 = (gl_ModelViewProjectionMatrix * v_12); - pos_13 = tmpvar_15; - float tmpvar_16; - tmpvar_16 = pos_13.z; - fog_14 = tmpvar_16; -} - -v2f_surf vert_surf ( - in appdata_full v_17 -) -{ - v2f_surf o_18; - PositionFog (v_17.vertex, o_18.pos, o_18.fog); - vec2 tmpvar_19; - tmpvar_19 = ((v_17.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_18.hip_pack0 = tmpvar_19.xy.xy; - mat3 tmpvar_20; - tmpvar_20 = xll_constructMat3 (_Object2World); - vec3 tmpvar_21; - tmpvar_21 = (tmpvar_20 * (v_17.normal * unity_Scale.w)); - o_18.normal = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = WorldSpaceLightDir (v_17.vertex); - vec3 tmpvar_23; - tmpvar_23 = tmpvar_22; - o_18.lightDir = tmpvar_23; - return o_18; -} - -void main () -{ - appdata_full xlt_v_24; - v2f_surf xl_retval_25; - vec4 tmpvar_26; - tmpvar_26 = gl_Vertex.xyzw; - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - xlt_v_24.vertex = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = TANGENT.xyzw; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - xlt_v_24.tangent = tmpvar_29; - vec3 tmpvar_30; - tmpvar_30 = gl_Normal.xyz; - vec3 tmpvar_31; - tmpvar_31 = tmpvar_30; - xlt_v_24.normal = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - xlt_v_24.texcoord = tmpvar_33; - vec4 tmpvar_34; - tmpvar_34 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_35; - tmpvar_35 = tmpvar_34; - xlt_v_24.texcoord1 = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36 = gl_Color.xyzw; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlt_v_24.color = tmpvar_37; - v2f_surf tmpvar_38; - tmpvar_38 = vert_surf (xlt_v_24); - v2f_surf tmpvar_39; - tmpvar_39 = tmpvar_38; - xl_retval_25 = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = xl_retval_25.pos.xyzw; - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - gl_Position = tmpvar_41; - vec4 tmpvar_42; - tmpvar_42.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_42.x = xl_retval_25.fog; - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - xlv_FOG = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44.zw = vec2(0.0, 0.0); - tmpvar_44.xy = xl_retval_25.hip_pack0.xy; - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - gl_TexCoord[0] = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46.w = 0.0; - tmpvar_46.xyz = xl_retval_25.normal.xyz; - vec4 tmpvar_47; - tmpvar_47 = tmpvar_46; - gl_TexCoord[1] = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48.w = 0.0; - tmpvar_48.xyz = xl_retval_25.lightDir.xyz; - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - gl_TexCoord[2] = tmpvar_49; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-out.txt index cba56ee87..aaaaddc73 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-out.txt @@ -5,16 +5,16 @@ uniform vec4 unity_Scale; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_1; + pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); mat3 tmpvar_2; tmpvar_2[0] = _Object2World[0].xyz; tmpvar_2[1] = _Object2World[1].xyz; tmpvar_2[2] = _Object2World[2].xyz; - gl_Position = tmpvar_1; + gl_Position = pos_1; vec4 tmpvar_3; tmpvar_3.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_3.x = tmpvar_1.z; + tmpvar_3.x = pos_1.z; xlv_FOG = tmpvar_3; vec4 tmpvar_4; tmpvar_4.zw = vec2(0.0, 0.0); @@ -31,4 +31,14 @@ void main () } -// inputs: 3, stats: 9 alu 0 tex 0 flow +// stats: 9 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 5 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _MainTex_ST (high float) 4x1 [-1] +// #2: _Object2World (high float) 4x4 [-1] +// #3: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #4: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-ir.txt deleted file mode 100644 index 9afae106c..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-ir.txt +++ /dev/null @@ -1,132 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 hip_screen; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _MainTex_ST; -uniform vec4 _ProjectionParams; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec4 ComputeScreenPos ( - in vec4 pos_6 -) -{ - vec4 o_7; - vec4 tmpvar_8; - tmpvar_8 = (pos_6 * 0.5); - o_7 = tmpvar_8; - vec2 tmpvar_9; - tmpvar_9.x = o_7.x; - tmpvar_9.y = (o_7.y * _ProjectionParams.x); - vec2 tmpvar_10; - tmpvar_10 = (tmpvar_9 + o_7.w); - o_7.xy = tmpvar_10.xy.xy; - vec2 tmpvar_11; - tmpvar_11 = pos_6.zw; - o_7.zw = tmpvar_11.xxxy.zw; - return o_7; -} - -v2f_surf vert_surf ( - in appdata_full v_12 -) -{ - v2f_surf o_13; - PositionFog (v_12.vertex, o_13.pos, o_13.fog); - vec2 tmpvar_14; - tmpvar_14 = ((v_12.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_13.hip_pack0 = tmpvar_14.xy.xy; - vec4 tmpvar_15; - tmpvar_15 = ComputeScreenPos (o_13.pos); - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - o_13.hip_screen = tmpvar_16; - return o_13; -} - -void main () -{ - appdata_full xlt_v_17; - v2f_surf xl_retval_18; - vec4 tmpvar_19; - tmpvar_19 = gl_Vertex.xyzw; - vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - xlt_v_17.vertex = tmpvar_20; - vec4 tmpvar_21; - tmpvar_21 = TANGENT.xyzw; - vec4 tmpvar_22; - tmpvar_22 = tmpvar_21; - xlt_v_17.tangent = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = gl_Normal.xyz; - vec3 tmpvar_24; - tmpvar_24 = tmpvar_23; - xlt_v_17.normal = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; - xlt_v_17.texcoord = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - xlt_v_17.texcoord1 = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = gl_Color.xyzw; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - xlt_v_17.color = tmpvar_30; - v2f_surf tmpvar_31; - tmpvar_31 = vert_surf (xlt_v_17); - v2f_surf tmpvar_32; - tmpvar_32 = tmpvar_31; - xl_retval_18 = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = xl_retval_18.pos.xyzw; - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - gl_Position = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_35.x = xl_retval_18.fog; - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlv_FOG = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37.zw = vec2(0.0, 0.0); - tmpvar_37.xy = xl_retval_18.hip_pack0.xy; - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - gl_TexCoord[0] = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = xl_retval_18.hip_screen.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - gl_TexCoord[1] = tmpvar_40; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-out.txt index 5f8bfc54f..d66048d59 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-out.txt @@ -3,27 +3,33 @@ uniform vec4 _ProjectionParams; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_1; + pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); vec4 o_2; - vec4 tmpvar_3; - tmpvar_3 = (tmpvar_1 * 0.5); - vec2 tmpvar_4; - tmpvar_4.x = tmpvar_3.x; - tmpvar_4.y = (tmpvar_3.y * _ProjectionParams.x); - o_2.xy = (tmpvar_4 + tmpvar_3.w); - o_2.zw = tmpvar_1.zw; - gl_Position = tmpvar_1; + o_2 = (pos_1 * 0.5); + vec2 tmpvar_3; + tmpvar_3.x = o_2.x; + tmpvar_3.y = (o_2.y * _ProjectionParams.x); + o_2.xy = (tmpvar_3 + o_2.w); + o_2.zw = pos_1.zw; + gl_Position = pos_1; + vec4 tmpvar_4; + tmpvar_4.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_4.x = pos_1.z; + xlv_FOG = tmpvar_4; vec4 tmpvar_5; - tmpvar_5.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_5.x = tmpvar_1.z; - xlv_FOG = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6.zw = vec2(0.0, 0.0); - tmpvar_6.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_6; + tmpvar_5.zw = vec2(0.0, 0.0); + tmpvar_5.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_5; gl_TexCoord[1] = o_2; } -// inputs: 2, stats: 8 alu 0 tex 0 flow +// stats: 8 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 3 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _MainTex_ST (high float) 4x1 [-1] +// #2: _ProjectionParams (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-ir.txt deleted file mode 100644 index 5fe44c3a0..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-ir.txt +++ /dev/null @@ -1,183 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec2 hip_lmap; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _DecalBump_ST; -uniform vec4 _Decal_ST; -uniform mat4 _Object2World; -uniform vec4 unity_LightmapST; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -void PositionFog ( - in vec4 v_9, - out vec4 pos_10, - out float fog_11 -) -{ - vec4 tmpvar_12; - tmpvar_12 = (gl_ModelViewProjectionMatrix * v_9); - pos_10 = tmpvar_12; - float tmpvar_13; - tmpvar_13 = pos_10.z; - fog_11 = tmpvar_13; -} - -v2f_surf vert_surf ( - in appdata_full v_14 -) -{ - mat3 rotation_15; - vec3 binormal_16; - vec3 worldN_17; - v2f_surf o_18; - PositionFog (v_14.vertex, o_18.pos, o_18.fog); - vec2 tmpvar_19; - tmpvar_19 = ((v_14.texcoord.xy * _Decal_ST.xy) + _Decal_ST.zw); - o_18.hip_pack0.xy = tmpvar_19.xy.xy; - vec2 tmpvar_20; - tmpvar_20 = ((v_14.texcoord.xy * _DecalBump_ST.xy) + _DecalBump_ST.zw); - o_18.hip_pack0.zw = tmpvar_20.xxxy.zw; - vec2 tmpvar_21; - tmpvar_21 = ((v_14.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - o_18.hip_lmap = tmpvar_21.xy.xy; - mat3 tmpvar_22; - tmpvar_22 = xll_constructMat3 (_Object2World); - vec3 tmpvar_23; - tmpvar_23 = (tmpvar_22 * (v_14.normal * unity_Scale.w)); - worldN_17 = tmpvar_23; - vec3 tmpvar_24; - tmpvar_24 = cross (v_14.normal, v_14.tangent.xyz); - vec3 tmpvar_25; - tmpvar_25 = (tmpvar_24 * v_14.tangent.w); - binormal_16 = tmpvar_25; - mat3 tmpvar_26; - float tmpvar_27; - tmpvar_27 = v_14.tangent.x; - tmpvar_26[0].x = tmpvar_27; - float tmpvar_28; - tmpvar_28 = binormal_16.x; - tmpvar_26[0].y = tmpvar_28; - float tmpvar_29; - tmpvar_29 = v_14.normal.x; - tmpvar_26[0].z = tmpvar_29; - float tmpvar_30; - tmpvar_30 = v_14.tangent.y; - tmpvar_26[1].x = tmpvar_30; - float tmpvar_31; - tmpvar_31 = binormal_16.y; - tmpvar_26[1].y = tmpvar_31; - float tmpvar_32; - tmpvar_32 = v_14.normal.y; - tmpvar_26[1].z = tmpvar_32; - float tmpvar_33; - tmpvar_33 = v_14.tangent.z; - tmpvar_26[2].x = tmpvar_33; - float tmpvar_34; - tmpvar_34 = binormal_16.z; - tmpvar_26[2].y = tmpvar_34; - float tmpvar_35; - tmpvar_35 = v_14.normal.z; - tmpvar_26[2].z = tmpvar_35; - mat3 tmpvar_36; - tmpvar_36 = tmpvar_26; - rotation_15 = tmpvar_36; - return o_18; -} - -void main () -{ - appdata_full xlt_v_37; - v2f_surf xl_retval_38; - vec4 tmpvar_39; - tmpvar_39 = gl_Vertex.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_v_37.vertex = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = TANGENT.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_v_37.tangent = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = gl_Normal.xyz; - vec3 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_v_37.normal = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_v_37.texcoord = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_v_37.texcoord1 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = gl_Color.xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_v_37.color = tmpvar_50; - v2f_surf tmpvar_51; - tmpvar_51 = vert_surf (xlt_v_37); - v2f_surf tmpvar_52; - tmpvar_52 = tmpvar_51; - xl_retval_38 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = xl_retval_38.pos.xyzw; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - gl_Position = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_55.x = xl_retval_38.fog; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - xlv_FOG = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = xl_retval_38.hip_pack0.xyzw; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - gl_TexCoord[0] = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59.zw = vec2(0.0, 0.0); - tmpvar_59.xy = xl_retval_38.hip_lmap.xy; - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - gl_TexCoord[1] = tmpvar_60; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-out.txt index 5c68e342c..d08d35009 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-out.txt @@ -5,14 +5,14 @@ varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; - vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_2; + pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _Decal_ST.xy) + _Decal_ST.zw); tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _DecalBump_ST.xy) + _DecalBump_ST.zw); - gl_Position = tmpvar_2; + gl_Position = pos_2; vec4 tmpvar_3; tmpvar_3.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_3.x = tmpvar_2.z; + tmpvar_3.x = pos_2.z; xlv_FOG = tmpvar_3; gl_TexCoord[0] = tmpvar_1; vec4 tmpvar_4; @@ -22,4 +22,13 @@ void main () } -// inputs: 3, stats: 9 alu 0 tex 0 flow +// stats: 9 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 4 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _DecalBump_ST (high float) 4x1 [-1] +// #2: _Decal_ST (high float) 4x1 [-1] +// #3: unity_LightmapST (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-ir.txt deleted file mode 100644 index 81d24600d..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-ir.txt +++ /dev/null @@ -1,306 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 lightDir; - vec3 vlight; - vec4 _ShadowCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _DecalBump_ST; -uniform vec4 _Decal_ST; -uniform mat4 _Object2World; -uniform vec4 _ProjectionParams; -uniform mat4 _World2Object; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_SHAb; -uniform vec4 unity_SHAg; -uniform vec4 unity_SHAr; -uniform vec4 unity_SHBb; -uniform vec4 unity_SHBg; -uniform vec4 unity_SHBr; -uniform vec4 unity_SHC; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec3 ShadeSH9 ( - in vec4 normal_9 -) -{ - vec3 x3_10; - float vC_11; - vec3 x2_12; - vec4 vB_13; - vec3 x1_14; - float tmpvar_15; - tmpvar_15 = dot (unity_SHAr, normal_9); - float tmpvar_16; - tmpvar_16 = tmpvar_15; - x1_14.x = tmpvar_16; - float tmpvar_17; - tmpvar_17 = dot (unity_SHAg, normal_9); - float tmpvar_18; - tmpvar_18 = tmpvar_17; - x1_14.y = vec2(tmpvar_18).y; - float tmpvar_19; - tmpvar_19 = dot (unity_SHAb, normal_9); - float tmpvar_20; - tmpvar_20 = tmpvar_19; - x1_14.z = vec3(tmpvar_20).z; - vec4 tmpvar_21; - tmpvar_21 = (normal_9.xyzz * normal_9.yzzx); - vB_13 = tmpvar_21; - float tmpvar_22; - tmpvar_22 = dot (unity_SHBr, vB_13); - float tmpvar_23; - tmpvar_23 = tmpvar_22; - x2_12.x = tmpvar_23; - float tmpvar_24; - tmpvar_24 = dot (unity_SHBg, vB_13); - float tmpvar_25; - tmpvar_25 = tmpvar_24; - x2_12.y = vec2(tmpvar_25).y; - float tmpvar_26; - tmpvar_26 = dot (unity_SHBb, vB_13); - float tmpvar_27; - tmpvar_27 = tmpvar_26; - x2_12.z = vec3(tmpvar_27).z; - float tmpvar_28; - tmpvar_28 = ((normal_9.x * normal_9.x) - (normal_9.y * normal_9.y)); - vC_11 = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = (unity_SHC.xyz * vC_11); - x3_10 = tmpvar_29; - return ((x1_14 + x2_12) + x3_10); -} - -void PositionFog ( - in vec4 v_30, - out vec4 pos_31, - out float fog_32 -) -{ - vec4 tmpvar_33; - tmpvar_33 = (gl_ModelViewProjectionMatrix * v_30); - pos_31 = tmpvar_33; - float tmpvar_34; - tmpvar_34 = pos_31.z; - fog_32 = tmpvar_34; -} - -vec3 ObjSpaceLightDir ( - in vec4 v_35 -) -{ - vec3 objSpaceLightPos_36; - vec3 tmpvar_37; - tmpvar_37 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_36 = tmpvar_37; - return objSpaceLightPos_36.xyz; -} - -vec4 ComputeScreenPos ( - in vec4 pos_38 -) -{ - vec4 o_39; - vec4 tmpvar_40; - tmpvar_40 = (pos_38 * 0.5); - o_39 = tmpvar_40; - vec2 tmpvar_41; - tmpvar_41.x = o_39.x; - tmpvar_41.y = (o_39.y * _ProjectionParams.x); - vec2 tmpvar_42; - tmpvar_42 = (tmpvar_41 + o_39.w); - o_39.xy = tmpvar_42.xy.xy; - vec2 tmpvar_43; - tmpvar_43 = pos_38.zw; - o_39.zw = tmpvar_43.xxxy.zw; - return o_39; -} - -v2f_surf vert_surf ( - in appdata_full v_44 -) -{ - vec3 shlight_45; - mat3 rotation_46; - vec3 binormal_47; - vec3 worldN_48; - v2f_surf o_49; - PositionFog (v_44.vertex, o_49.pos, o_49.fog); - vec2 tmpvar_50; - tmpvar_50 = ((v_44.texcoord.xy * _Decal_ST.xy) + _Decal_ST.zw); - o_49.hip_pack0.xy = tmpvar_50.xy.xy; - vec2 tmpvar_51; - tmpvar_51 = ((v_44.texcoord.xy * _DecalBump_ST.xy) + _DecalBump_ST.zw); - o_49.hip_pack0.zw = tmpvar_51.xxxy.zw; - mat3 tmpvar_52; - tmpvar_52 = xll_constructMat3 (_Object2World); - vec3 tmpvar_53; - tmpvar_53 = (tmpvar_52 * (v_44.normal * unity_Scale.w)); - worldN_48 = tmpvar_53; - vec3 tmpvar_54; - tmpvar_54 = cross (v_44.normal, v_44.tangent.xyz); - vec3 tmpvar_55; - tmpvar_55 = (tmpvar_54 * v_44.tangent.w); - binormal_47 = tmpvar_55; - mat3 tmpvar_56; - float tmpvar_57; - tmpvar_57 = v_44.tangent.x; - tmpvar_56[0].x = tmpvar_57; - float tmpvar_58; - tmpvar_58 = binormal_47.x; - tmpvar_56[0].y = tmpvar_58; - float tmpvar_59; - tmpvar_59 = v_44.normal.x; - tmpvar_56[0].z = tmpvar_59; - float tmpvar_60; - tmpvar_60 = v_44.tangent.y; - tmpvar_56[1].x = tmpvar_60; - float tmpvar_61; - tmpvar_61 = binormal_47.y; - tmpvar_56[1].y = tmpvar_61; - float tmpvar_62; - tmpvar_62 = v_44.normal.y; - tmpvar_56[1].z = tmpvar_62; - float tmpvar_63; - tmpvar_63 = v_44.tangent.z; - tmpvar_56[2].x = tmpvar_63; - float tmpvar_64; - tmpvar_64 = binormal_47.z; - tmpvar_56[2].y = tmpvar_64; - float tmpvar_65; - tmpvar_65 = v_44.normal.z; - tmpvar_56[2].z = tmpvar_65; - mat3 tmpvar_66; - tmpvar_66 = tmpvar_56; - rotation_46 = tmpvar_66; - vec3 tmpvar_67; - tmpvar_67 = ObjSpaceLightDir (v_44.vertex); - vec3 tmpvar_68; - tmpvar_68 = (rotation_46 * tmpvar_67); - o_49.lightDir = tmpvar_68; - vec4 tmpvar_69; - tmpvar_69.w = 1.0; - tmpvar_69.xyz = worldN_48.xyz; - vec3 tmpvar_70; - tmpvar_70 = ShadeSH9 (tmpvar_69); - vec3 tmpvar_71; - tmpvar_71 = tmpvar_70; - shlight_45 = tmpvar_71; - vec3 tmpvar_72; - tmpvar_72 = shlight_45; - o_49.vlight = tmpvar_72; - vec4 tmpvar_73; - tmpvar_73 = ComputeScreenPos (o_49.pos); - vec4 tmpvar_74; - tmpvar_74 = tmpvar_73; - o_49._ShadowCoord = tmpvar_74; - return o_49; -} - -void main () -{ - appdata_full xlt_v_75; - v2f_surf xl_retval_76; - vec4 tmpvar_77; - tmpvar_77 = gl_Vertex.xyzw; - vec4 tmpvar_78; - tmpvar_78 = tmpvar_77; - xlt_v_75.vertex = tmpvar_78; - vec4 tmpvar_79; - tmpvar_79 = TANGENT.xyzw; - vec4 tmpvar_80; - tmpvar_80 = tmpvar_79; - xlt_v_75.tangent = tmpvar_80; - vec3 tmpvar_81; - tmpvar_81 = gl_Normal.xyz; - vec3 tmpvar_82; - tmpvar_82 = tmpvar_81; - xlt_v_75.normal = tmpvar_82; - vec4 tmpvar_83; - tmpvar_83 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_84; - tmpvar_84 = tmpvar_83; - xlt_v_75.texcoord = tmpvar_84; - vec4 tmpvar_85; - tmpvar_85 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_86; - tmpvar_86 = tmpvar_85; - xlt_v_75.texcoord1 = tmpvar_86; - vec4 tmpvar_87; - tmpvar_87 = gl_Color.xyzw; - vec4 tmpvar_88; - tmpvar_88 = tmpvar_87; - xlt_v_75.color = tmpvar_88; - v2f_surf tmpvar_89; - tmpvar_89 = vert_surf (xlt_v_75); - v2f_surf tmpvar_90; - tmpvar_90 = tmpvar_89; - xl_retval_76 = tmpvar_90; - vec4 tmpvar_91; - tmpvar_91 = xl_retval_76.pos.xyzw; - vec4 tmpvar_92; - tmpvar_92 = tmpvar_91; - gl_Position = tmpvar_92; - vec4 tmpvar_93; - tmpvar_93.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_93.x = xl_retval_76.fog; - vec4 tmpvar_94; - tmpvar_94 = tmpvar_93; - xlv_FOG = tmpvar_94; - vec4 tmpvar_95; - tmpvar_95 = xl_retval_76.hip_pack0.xyzw; - vec4 tmpvar_96; - tmpvar_96 = tmpvar_95; - gl_TexCoord[0] = tmpvar_96; - vec4 tmpvar_97; - tmpvar_97.w = 0.0; - tmpvar_97.xyz = xl_retval_76.lightDir.xyz; - vec4 tmpvar_98; - tmpvar_98 = tmpvar_97; - gl_TexCoord[1] = tmpvar_98; - vec4 tmpvar_99; - tmpvar_99.w = 0.0; - tmpvar_99.xyz = xl_retval_76.vlight.xyz; - vec4 tmpvar_100; - tmpvar_100 = tmpvar_99; - gl_TexCoord[2] = tmpvar_100; - vec4 tmpvar_101; - tmpvar_101 = xl_retval_76._ShadowCoord.xyzw; - vec4 tmpvar_102; - tmpvar_102 = tmpvar_101; - gl_TexCoord[3] = tmpvar_102; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-out.txt index ba79fd91b..72939f006 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-out.txt @@ -16,70 +16,90 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); - tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _Decal_ST.xy) + _Decal_ST.zw); - tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _DecalBump_ST.xy) + _DecalBump_ST.zw); - mat3 tmpvar_3; - tmpvar_3[0] = _Object2World[0].xyz; - tmpvar_3[1] = _Object2World[1].xyz; - tmpvar_3[2] = _Object2World[2].xyz; - vec3 tmpvar_4; - tmpvar_4 = (tmpvar_3 * (gl_Normal * unity_Scale.w)); - vec3 tmpvar_5; - tmpvar_5 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + vec3 binormal_1; + vec3 worldN_2; + vec4 tmpvar_3; + vec4 pos_4; + pos_4 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_3.xy = ((gl_MultiTexCoord0.xy * _Decal_ST.xy) + _Decal_ST.zw); + tmpvar_3.zw = ((gl_MultiTexCoord0.xy * _DecalBump_ST.xy) + _DecalBump_ST.zw); + mat3 tmpvar_5; + tmpvar_5[0] = _Object2World[0].xyz; + tmpvar_5[1] = _Object2World[1].xyz; + tmpvar_5[2] = _Object2World[2].xyz; + worldN_2 = (tmpvar_5 * (gl_Normal * unity_Scale.w)); + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_6; tmpvar_6[0].x = TANGENT.x; - tmpvar_6[0].y = tmpvar_5.x; + tmpvar_6[0].y = binormal_1.x; tmpvar_6[0].z = gl_Normal.x; tmpvar_6[1].x = TANGENT.y; - tmpvar_6[1].y = tmpvar_5.y; + tmpvar_6[1].y = binormal_1.y; tmpvar_6[1].z = gl_Normal.y; tmpvar_6[2].x = TANGENT.z; - tmpvar_6[2].y = tmpvar_5.z; + tmpvar_6[2].y = binormal_1.z; tmpvar_6[2].z = gl_Normal.z; vec4 tmpvar_7; tmpvar_7.w = 1.0; - tmpvar_7.xyz = tmpvar_4; + tmpvar_7.xyz = worldN_2; vec3 x2_8; - vec3 x1_9; - x1_9.x = dot (unity_SHAr, tmpvar_7); - x1_9.y = dot (unity_SHAg, tmpvar_7); - x1_9.z = dot (unity_SHAb, tmpvar_7); - vec4 tmpvar_10; - tmpvar_10 = (tmpvar_4.xyzz * tmpvar_4.yzzx); - x2_8.x = dot (unity_SHBr, tmpvar_10); - x2_8.y = dot (unity_SHBg, tmpvar_10); - x2_8.z = dot (unity_SHBb, tmpvar_10); + vec4 vB_9; + vec3 x1_10; + x1_10.x = dot (unity_SHAr, tmpvar_7); + x1_10.y = dot (unity_SHAg, tmpvar_7); + x1_10.z = dot (unity_SHAb, tmpvar_7); + vB_9 = (worldN_2.xyzz * worldN_2.yzzx); + x2_8.x = dot (unity_SHBr, vB_9); + x2_8.y = dot (unity_SHBg, vB_9); + x2_8.z = dot (unity_SHBb, vB_9); vec4 o_11; - vec4 tmpvar_12; - tmpvar_12 = (tmpvar_2 * 0.5); - vec2 tmpvar_13; - tmpvar_13.x = tmpvar_12.x; - tmpvar_13.y = (tmpvar_12.y * _ProjectionParams.x); - o_11.xy = (tmpvar_13 + tmpvar_12.w); - o_11.zw = tmpvar_2.zw; - gl_Position = tmpvar_2; + o_11 = (pos_4 * 0.5); + vec2 tmpvar_12; + tmpvar_12.x = o_11.x; + tmpvar_12.y = (o_11.y * _ProjectionParams.x); + o_11.xy = (tmpvar_12 + o_11.w); + o_11.zw = pos_4.zw; + gl_Position = pos_4; + vec4 tmpvar_13; + tmpvar_13.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_13.x = pos_4.z; + xlv_FOG = tmpvar_13; + gl_TexCoord[0] = tmpvar_3; vec4 tmpvar_14; - tmpvar_14.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_14.x = tmpvar_2.z; - xlv_FOG = tmpvar_14; - gl_TexCoord[0] = tmpvar_1; + tmpvar_14.w = 0.0; + tmpvar_14.xyz = (tmpvar_6 * (_World2Object * _WorldSpaceLightPos0).xyz); + gl_TexCoord[1] = tmpvar_14; vec4 tmpvar_15; tmpvar_15.w = 0.0; - tmpvar_15.xyz = (tmpvar_6 * (_World2Object * _WorldSpaceLightPos0).xyz); - gl_TexCoord[1] = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16.w = 0.0; - tmpvar_16.xyz = ((x1_9 + x2_8) + (unity_SHC.xyz * ( - (tmpvar_4.x * tmpvar_4.x) + tmpvar_15.xyz = ((x1_10 + x2_8) + (unity_SHC.xyz * ( + (worldN_2.x * worldN_2.x) - - (tmpvar_4.y * tmpvar_4.y) + (worldN_2.y * worldN_2.y) ))); - gl_TexCoord[2] = tmpvar_16; + gl_TexCoord[2] = tmpvar_15; gl_TexCoord[3] = o_11; } -// inputs: 4, stats: 33 alu 0 tex 0 flow +// stats: 33 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 15 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _DecalBump_ST (high float) 4x1 [-1] +// #2: _Decal_ST (high float) 4x1 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _ProjectionParams (high float) 4x1 [-1] +// #5: _World2Object (high float) 4x4 [-1] +// #6: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #7: unity_SHAb (high float) 4x1 [-1] +// #8: unity_SHAg (high float) 4x1 [-1] +// #9: unity_SHAr (high float) 4x1 [-1] +// #10: unity_SHBb (high float) 4x1 [-1] +// #11: unity_SHBg (high float) 4x1 [-1] +// #12: unity_SHBr (high float) 4x1 [-1] +// #13: unity_SHC (high float) 4x1 [-1] +// #14: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-ir.txt deleted file mode 100644 index 1ea6bd8b9..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-ir.txt +++ /dev/null @@ -1,172 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec2 _LightCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec3 WorldSpaceLightDir ( - in vec4 v_9 -) -{ - vec3 worldPos_10; - vec3 tmpvar_11; - tmpvar_11 = (_Object2World * v_9).xyz; - worldPos_10 = tmpvar_11; - return _WorldSpaceLightPos0.xyz; -} - -void PositionFog ( - in vec4 v_12, - out vec4 pos_13, - out float fog_14 -) -{ - vec4 tmpvar_15; - tmpvar_15 = (gl_ModelViewProjectionMatrix * v_12); - pos_13 = tmpvar_15; - float tmpvar_16; - tmpvar_16 = pos_13.z; - fog_14 = tmpvar_16; -} - -v2f_surf vert_surf ( - in appdata_full v_17 -) -{ - v2f_surf o_18; - PositionFog (v_17.vertex, o_18.pos, o_18.fog); - vec2 tmpvar_19; - tmpvar_19 = ((v_17.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_18.hip_pack0 = tmpvar_19.xy.xy; - mat3 tmpvar_20; - tmpvar_20 = xll_constructMat3 (_Object2World); - vec3 tmpvar_21; - tmpvar_21 = (tmpvar_20 * (v_17.normal * unity_Scale.w)); - o_18.normal = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = WorldSpaceLightDir (v_17.vertex); - vec3 tmpvar_23; - tmpvar_23 = tmpvar_22; - o_18.lightDir = tmpvar_23; - vec2 tmpvar_24; - tmpvar_24 = (_LightMatrix0 * (_Object2World * v_17.vertex)).xy; - o_18._LightCoord = tmpvar_24; - return o_18; -} - -void main () -{ - appdata_full xlt_v_25; - v2f_surf xl_retval_26; - vec4 tmpvar_27; - tmpvar_27 = gl_Vertex.xyzw; - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - xlt_v_25.vertex = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = TANGENT.xyzw; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - xlt_v_25.tangent = tmpvar_30; - vec3 tmpvar_31; - tmpvar_31 = gl_Normal.xyz; - vec3 tmpvar_32; - tmpvar_32 = tmpvar_31; - xlt_v_25.normal = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - xlt_v_25.texcoord = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlt_v_25.texcoord1 = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37 = gl_Color.xyzw; - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlt_v_25.color = tmpvar_38; - v2f_surf tmpvar_39; - tmpvar_39 = vert_surf (xlt_v_25); - v2f_surf tmpvar_40; - tmpvar_40 = tmpvar_39; - xl_retval_26 = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = xl_retval_26.pos.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - gl_Position = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_43.x = xl_retval_26.fog; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlv_FOG = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45.zw = vec2(0.0, 0.0); - tmpvar_45.xy = xl_retval_26.hip_pack0.xy; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - gl_TexCoord[0] = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47.w = 0.0; - tmpvar_47.xyz = xl_retval_26.normal.xyz; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - gl_TexCoord[1] = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49.w = 0.0; - tmpvar_49.xyz = xl_retval_26.lightDir.xyz; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - gl_TexCoord[2] = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51.zw = vec2(0.0, 0.0); - tmpvar_51.xy = xl_retval_26._LightCoord.xy; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - gl_TexCoord[3] = tmpvar_52; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-out.txt index 9941a8469..76da8d253 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-out.txt @@ -6,16 +6,16 @@ uniform vec4 unity_Scale; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_1; + pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); mat3 tmpvar_2; tmpvar_2[0] = _Object2World[0].xyz; tmpvar_2[1] = _Object2World[1].xyz; tmpvar_2[2] = _Object2World[2].xyz; - gl_Position = tmpvar_1; + gl_Position = pos_1; vec4 tmpvar_3; tmpvar_3.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_3.x = tmpvar_1.z; + tmpvar_3.x = pos_1.z; xlv_FOG = tmpvar_3; vec4 tmpvar_4; tmpvar_4.zw = vec2(0.0, 0.0); @@ -36,4 +36,15 @@ void main () } -// inputs: 3, stats: 12 alu 0 tex 0 flow +// stats: 12 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 6 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _LightMatrix0 (high float) 4x4 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #5: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-ir.txt deleted file mode 100644 index f53223c90..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-ir.txt +++ /dev/null @@ -1,161 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec3 WorldSpaceLightDir ( - in vec4 v_9 -) -{ - vec3 worldPos_10; - vec3 tmpvar_11; - tmpvar_11 = (_Object2World * v_9).xyz; - worldPos_10 = tmpvar_11; - return _WorldSpaceLightPos0.xyz; -} - -void PositionFog ( - in vec4 v_12, - out vec4 pos_13, - out float fog_14 -) -{ - vec4 tmpvar_15; - tmpvar_15 = (gl_ModelViewProjectionMatrix * v_12); - pos_13 = tmpvar_15; - float tmpvar_16; - tmpvar_16 = pos_13.z; - fog_14 = tmpvar_16; -} - -v2f_surf vert_surf ( - in appdata_full v_17 -) -{ - v2f_surf o_18; - PositionFog (v_17.vertex, o_18.pos, o_18.fog); - vec2 tmpvar_19; - tmpvar_19 = ((v_17.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_18.hip_pack0 = tmpvar_19.xy.xy; - mat3 tmpvar_20; - tmpvar_20 = xll_constructMat3 (_Object2World); - vec3 tmpvar_21; - tmpvar_21 = (tmpvar_20 * (v_17.normal * unity_Scale.w)); - o_18.normal = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = WorldSpaceLightDir (v_17.vertex); - vec3 tmpvar_23; - tmpvar_23 = tmpvar_22; - o_18.lightDir = tmpvar_23; - return o_18; -} - -void main () -{ - appdata_full xlt_v_24; - v2f_surf xl_retval_25; - vec4 tmpvar_26; - tmpvar_26 = gl_Vertex.xyzw; - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - xlt_v_24.vertex = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = TANGENT.xyzw; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - xlt_v_24.tangent = tmpvar_29; - vec3 tmpvar_30; - tmpvar_30 = gl_Normal.xyz; - vec3 tmpvar_31; - tmpvar_31 = tmpvar_30; - xlt_v_24.normal = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - xlt_v_24.texcoord = tmpvar_33; - vec4 tmpvar_34; - tmpvar_34 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_35; - tmpvar_35 = tmpvar_34; - xlt_v_24.texcoord1 = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36 = gl_Color.xyzw; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlt_v_24.color = tmpvar_37; - v2f_surf tmpvar_38; - tmpvar_38 = vert_surf (xlt_v_24); - v2f_surf tmpvar_39; - tmpvar_39 = tmpvar_38; - xl_retval_25 = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = xl_retval_25.pos.xyzw; - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - gl_Position = tmpvar_41; - vec4 tmpvar_42; - tmpvar_42.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_42.x = xl_retval_25.fog; - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - xlv_FOG = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44.zw = vec2(0.0, 0.0); - tmpvar_44.xy = xl_retval_25.hip_pack0.xy; - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - gl_TexCoord[0] = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46.w = 0.0; - tmpvar_46.xyz = xl_retval_25.normal.xyz; - vec4 tmpvar_47; - tmpvar_47 = tmpvar_46; - gl_TexCoord[1] = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48.w = 0.0; - tmpvar_48.xyz = xl_retval_25.lightDir.xyz; - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - gl_TexCoord[2] = tmpvar_49; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-out.txt index cba56ee87..aaaaddc73 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-out.txt @@ -5,16 +5,16 @@ uniform vec4 unity_Scale; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_1; + pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); mat3 tmpvar_2; tmpvar_2[0] = _Object2World[0].xyz; tmpvar_2[1] = _Object2World[1].xyz; tmpvar_2[2] = _Object2World[2].xyz; - gl_Position = tmpvar_1; + gl_Position = pos_1; vec4 tmpvar_3; tmpvar_3.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_3.x = tmpvar_1.z; + tmpvar_3.x = pos_1.z; xlv_FOG = tmpvar_3; vec4 tmpvar_4; tmpvar_4.zw = vec2(0.0, 0.0); @@ -31,4 +31,14 @@ void main () } -// inputs: 3, stats: 9 alu 0 tex 0 flow +// stats: 9 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 5 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _MainTex_ST (high float) 4x1 [-1] +// #2: _Object2World (high float) 4x4 [-1] +// #3: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #4: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-ir.txt deleted file mode 100644 index dc4e3734e..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-ir.txt +++ /dev/null @@ -1,209 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 viewDir; - vec4 hip_screen; - vec3 normal; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _MainTex_ST; -uniform vec4 _ProjectionParams; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_6 -) -{ - vec3 objSpaceCameraPos_7; - vec4 tmpvar_8; - tmpvar_8.w = 1.0; - tmpvar_8.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_9; - tmpvar_9 = ((_World2Object * tmpvar_8).xyz * unity_Scale.w); - objSpaceCameraPos_7 = tmpvar_9; - return (objSpaceCameraPos_7 - v_6.xyz); -} - -vec4 ComputeScreenPos ( - in vec4 pos_10 -) -{ - vec4 o_11; - vec4 tmpvar_12; - tmpvar_12 = (pos_10 * 0.5); - o_11 = tmpvar_12; - vec2 tmpvar_13; - tmpvar_13.x = o_11.x; - tmpvar_13.y = (o_11.y * _ProjectionParams.x); - vec2 tmpvar_14; - tmpvar_14 = (tmpvar_13 + o_11.w); - o_11.xy = tmpvar_14.xy.xy; - vec2 tmpvar_15; - tmpvar_15 = pos_10.zw; - o_11.zw = tmpvar_15.xxxy.zw; - return o_11; -} - -v2f_surf vert_surf ( - in appdata_full v_16 -) -{ - mat3 rotation_17; - vec3 binormal_18; - v2f_surf o_19; - PositionFog (v_16.vertex, o_19.pos, o_19.fog); - vec2 tmpvar_20; - tmpvar_20 = ((v_16.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_19.hip_pack0 = tmpvar_20.xy.xy; - vec4 tmpvar_21; - tmpvar_21 = ComputeScreenPos (o_19.pos); - vec4 tmpvar_22; - tmpvar_22 = tmpvar_21; - o_19.hip_screen = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = cross (v_16.normal, v_16.tangent.xyz); - vec3 tmpvar_24; - tmpvar_24 = (tmpvar_23 * v_16.tangent.w); - binormal_18 = tmpvar_24; - mat3 tmpvar_25; - float tmpvar_26; - tmpvar_26 = v_16.tangent.x; - tmpvar_25[0].x = tmpvar_26; - float tmpvar_27; - tmpvar_27 = binormal_18.x; - tmpvar_25[0].y = tmpvar_27; - float tmpvar_28; - tmpvar_28 = v_16.normal.x; - tmpvar_25[0].z = tmpvar_28; - float tmpvar_29; - tmpvar_29 = v_16.tangent.y; - tmpvar_25[1].x = tmpvar_29; - float tmpvar_30; - tmpvar_30 = binormal_18.y; - tmpvar_25[1].y = tmpvar_30; - float tmpvar_31; - tmpvar_31 = v_16.normal.y; - tmpvar_25[1].z = tmpvar_31; - float tmpvar_32; - tmpvar_32 = v_16.tangent.z; - tmpvar_25[2].x = tmpvar_32; - float tmpvar_33; - tmpvar_33 = binormal_18.z; - tmpvar_25[2].y = tmpvar_33; - float tmpvar_34; - tmpvar_34 = v_16.normal.z; - tmpvar_25[2].z = tmpvar_34; - mat3 tmpvar_35; - tmpvar_35 = tmpvar_25; - rotation_17 = tmpvar_35; - vec3 tmpvar_36; - tmpvar_36 = (rotation_17 * (v_16.normal * unity_Scale.w)); - o_19.normal = tmpvar_36; - vec3 tmpvar_37; - tmpvar_37 = ObjSpaceViewDir (v_16.vertex); - vec3 tmpvar_38; - tmpvar_38 = (rotation_17 * tmpvar_37); - o_19.viewDir = tmpvar_38; - return o_19; -} - -void main () -{ - appdata_full xlt_v_39; - v2f_surf xl_retval_40; - vec4 tmpvar_41; - tmpvar_41 = gl_Vertex.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_v_39.vertex = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43 = TANGENT.xyzw; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_v_39.tangent = tmpvar_44; - vec3 tmpvar_45; - tmpvar_45 = gl_Normal.xyz; - vec3 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_v_39.normal = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_v_39.texcoord = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_v_39.texcoord1 = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = gl_Color.xyzw; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - xlt_v_39.color = tmpvar_52; - v2f_surf tmpvar_53; - tmpvar_53 = vert_surf (xlt_v_39); - v2f_surf tmpvar_54; - tmpvar_54 = tmpvar_53; - xl_retval_40 = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55 = xl_retval_40.pos.xyzw; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - gl_Position = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_57.x = xl_retval_40.fog; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - xlv_FOG = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59.zw = vec2(0.0, 0.0); - tmpvar_59.xy = xl_retval_40.hip_pack0.xy; - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - gl_TexCoord[0] = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61.w = 0.0; - tmpvar_61.xyz = xl_retval_40.viewDir.xyz; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - gl_TexCoord[1] = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63 = xl_retval_40.hip_screen.xyzw; - vec4 tmpvar_64; - tmpvar_64 = tmpvar_63; - gl_TexCoord[2] = tmpvar_64; - vec4 tmpvar_65; - tmpvar_65.w = 0.0; - tmpvar_65.xyz = xl_retval_40.normal.xyz; - vec4 tmpvar_66; - tmpvar_66 = tmpvar_65; - gl_TexCoord[3] = tmpvar_66; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-out.txt index a9bb87d49..5f95d672c 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-out.txt @@ -7,52 +7,63 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); - vec4 o_2; - vec4 tmpvar_3; - tmpvar_3 = (tmpvar_1 * 0.5); + vec3 binormal_1; + vec4 pos_2; + pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 o_3; + o_3 = (pos_2 * 0.5); vec2 tmpvar_4; - tmpvar_4.x = tmpvar_3.x; - tmpvar_4.y = (tmpvar_3.y * _ProjectionParams.x); - o_2.xy = (tmpvar_4 + tmpvar_3.w); - o_2.zw = tmpvar_1.zw; - vec3 tmpvar_5; - tmpvar_5 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); - mat3 tmpvar_6; - tmpvar_6[0].x = TANGENT.x; - tmpvar_6[0].y = tmpvar_5.x; - tmpvar_6[0].z = gl_Normal.x; - tmpvar_6[1].x = TANGENT.y; - tmpvar_6[1].y = tmpvar_5.y; - tmpvar_6[1].z = gl_Normal.y; - tmpvar_6[2].x = TANGENT.z; - tmpvar_6[2].y = tmpvar_5.z; - tmpvar_6[2].z = gl_Normal.z; + tmpvar_4.x = o_3.x; + tmpvar_4.y = (o_3.y * _ProjectionParams.x); + o_3.xy = (tmpvar_4 + o_3.w); + o_3.zw = pos_2.zw; + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + mat3 tmpvar_5; + tmpvar_5[0].x = TANGENT.x; + tmpvar_5[0].y = binormal_1.x; + tmpvar_5[0].z = gl_Normal.x; + tmpvar_5[1].x = TANGENT.y; + tmpvar_5[1].y = binormal_1.y; + tmpvar_5[1].z = gl_Normal.y; + tmpvar_5[2].x = TANGENT.z; + tmpvar_5[2].y = binormal_1.z; + tmpvar_5[2].z = gl_Normal.z; + vec4 tmpvar_6; + tmpvar_6.w = 1.0; + tmpvar_6.xyz = _WorldSpaceCameraPos; + gl_Position = pos_2; vec4 tmpvar_7; - tmpvar_7.w = 1.0; - tmpvar_7.xyz = _WorldSpaceCameraPos; - gl_Position = tmpvar_1; + tmpvar_7.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_7.x = pos_2.z; + xlv_FOG = tmpvar_7; vec4 tmpvar_8; - tmpvar_8.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_8.x = tmpvar_1.z; - xlv_FOG = tmpvar_8; + tmpvar_8.zw = vec2(0.0, 0.0); + tmpvar_8.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_8; vec4 tmpvar_9; - tmpvar_9.zw = vec2(0.0, 0.0); - tmpvar_9.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_9; + tmpvar_9.w = 0.0; + tmpvar_9.xyz = (tmpvar_5 * (( + (_World2Object * tmpvar_6) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); + gl_TexCoord[1] = tmpvar_9; + gl_TexCoord[2] = o_3; vec4 tmpvar_10; tmpvar_10.w = 0.0; - tmpvar_10.xyz = (tmpvar_6 * (( - (_World2Object * tmpvar_7) - .xyz * unity_Scale.w) - gl_Vertex.xyz)); - gl_TexCoord[1] = tmpvar_10; - gl_TexCoord[2] = o_2; - vec4 tmpvar_11; - tmpvar_11.w = 0.0; - tmpvar_11.xyz = (tmpvar_6 * (gl_Normal * unity_Scale.w)); - gl_TexCoord[3] = tmpvar_11; + tmpvar_10.xyz = (tmpvar_5 * (gl_Normal * unity_Scale.w)); + gl_TexCoord[3] = tmpvar_10; } -// inputs: 4, stats: 21 alu 0 tex 0 flow +// stats: 21 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 6 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _MainTex_ST (high float) 4x1 [-1] +// #2: _ProjectionParams (high float) 4x1 [-1] +// #3: _World2Object (high float) 4x4 [-1] +// #4: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #5: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-ir.txt deleted file mode 100644 index 1e2b15b76..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-ir.txt +++ /dev/null @@ -1,226 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 viewDir; - vec4 hip_screen; - vec3 normal; - vec3 hip_lmapFade; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _MainTex_ST; -uniform vec4 _ProjectionParams; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 unity_LightmapFade; -uniform vec4 unity_LightmapST; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_6 -) -{ - vec3 objSpaceCameraPos_7; - vec4 tmpvar_8; - tmpvar_8.w = 1.0; - tmpvar_8.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_9; - tmpvar_9 = ((_World2Object * tmpvar_8).xyz * unity_Scale.w); - objSpaceCameraPos_7 = tmpvar_9; - return (objSpaceCameraPos_7 - v_6.xyz); -} - -vec4 ComputeScreenPos ( - in vec4 pos_10 -) -{ - vec4 o_11; - vec4 tmpvar_12; - tmpvar_12 = (pos_10 * 0.5); - o_11 = tmpvar_12; - vec2 tmpvar_13; - tmpvar_13.x = o_11.x; - tmpvar_13.y = (o_11.y * _ProjectionParams.x); - vec2 tmpvar_14; - tmpvar_14 = (tmpvar_13 + o_11.w); - o_11.xy = tmpvar_14.xy.xy; - vec2 tmpvar_15; - tmpvar_15 = pos_10.zw; - o_11.zw = tmpvar_15.xxxy.zw; - return o_11; -} - -v2f_surf vert_surf ( - in appdata_full v_16 -) -{ - mat3 rotation_17; - vec3 binormal_18; - v2f_surf o_19; - PositionFog (v_16.vertex, o_19.pos, o_19.fog); - vec2 tmpvar_20; - tmpvar_20 = ((v_16.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_19.hip_pack0 = tmpvar_20.xy.xy; - vec4 tmpvar_21; - tmpvar_21 = ComputeScreenPos (o_19.pos); - vec4 tmpvar_22; - tmpvar_22 = tmpvar_21; - o_19.hip_screen = tmpvar_22; - vec2 tmpvar_23; - tmpvar_23 = ((v_16.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - o_19.hip_lmapFade.xy = tmpvar_23.xy.xy; - float tmpvar_24; - tmpvar_24 = ((-( - (gl_ModelViewMatrix * v_16.vertex) - .z) * unity_LightmapFade.z) + unity_LightmapFade.w); - o_19.hip_lmapFade.z = vec3(tmpvar_24).z; - vec3 tmpvar_25; - tmpvar_25 = cross (v_16.normal, v_16.tangent.xyz); - vec3 tmpvar_26; - tmpvar_26 = (tmpvar_25 * v_16.tangent.w); - binormal_18 = tmpvar_26; - mat3 tmpvar_27; - float tmpvar_28; - tmpvar_28 = v_16.tangent.x; - tmpvar_27[0].x = tmpvar_28; - float tmpvar_29; - tmpvar_29 = binormal_18.x; - tmpvar_27[0].y = tmpvar_29; - float tmpvar_30; - tmpvar_30 = v_16.normal.x; - tmpvar_27[0].z = tmpvar_30; - float tmpvar_31; - tmpvar_31 = v_16.tangent.y; - tmpvar_27[1].x = tmpvar_31; - float tmpvar_32; - tmpvar_32 = binormal_18.y; - tmpvar_27[1].y = tmpvar_32; - float tmpvar_33; - tmpvar_33 = v_16.normal.y; - tmpvar_27[1].z = tmpvar_33; - float tmpvar_34; - tmpvar_34 = v_16.tangent.z; - tmpvar_27[2].x = tmpvar_34; - float tmpvar_35; - tmpvar_35 = binormal_18.z; - tmpvar_27[2].y = tmpvar_35; - float tmpvar_36; - tmpvar_36 = v_16.normal.z; - tmpvar_27[2].z = tmpvar_36; - mat3 tmpvar_37; - tmpvar_37 = tmpvar_27; - rotation_17 = tmpvar_37; - vec3 tmpvar_38; - tmpvar_38 = (rotation_17 * (v_16.normal * unity_Scale.w)); - o_19.normal = tmpvar_38; - vec3 tmpvar_39; - tmpvar_39 = ObjSpaceViewDir (v_16.vertex); - vec3 tmpvar_40; - tmpvar_40 = (rotation_17 * tmpvar_39); - o_19.viewDir = tmpvar_40; - return o_19; -} - -void main () -{ - appdata_full xlt_v_41; - v2f_surf xl_retval_42; - vec4 tmpvar_43; - tmpvar_43 = gl_Vertex.xyzw; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_v_41.vertex = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = TANGENT.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_v_41.tangent = tmpvar_46; - vec3 tmpvar_47; - tmpvar_47 = gl_Normal.xyz; - vec3 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_v_41.normal = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_v_41.texcoord = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - xlt_v_41.texcoord1 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = gl_Color.xyzw; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - xlt_v_41.color = tmpvar_54; - v2f_surf tmpvar_55; - tmpvar_55 = vert_surf (xlt_v_41); - v2f_surf tmpvar_56; - tmpvar_56 = tmpvar_55; - xl_retval_42 = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = xl_retval_42.pos.xyzw; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - gl_Position = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_59.x = xl_retval_42.fog; - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - xlv_FOG = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61.zw = vec2(0.0, 0.0); - tmpvar_61.xy = xl_retval_42.hip_pack0.xy; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - gl_TexCoord[0] = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63.w = 0.0; - tmpvar_63.xyz = xl_retval_42.viewDir.xyz; - vec4 tmpvar_64; - tmpvar_64 = tmpvar_63; - gl_TexCoord[1] = tmpvar_64; - vec4 tmpvar_65; - tmpvar_65 = xl_retval_42.hip_screen.xyzw; - vec4 tmpvar_66; - tmpvar_66 = tmpvar_65; - gl_TexCoord[2] = tmpvar_66; - vec4 tmpvar_67; - tmpvar_67.w = 0.0; - tmpvar_67.xyz = xl_retval_42.normal.xyz; - vec4 tmpvar_68; - tmpvar_68 = tmpvar_67; - gl_TexCoord[3] = tmpvar_68; - vec4 tmpvar_69; - tmpvar_69.w = 0.0; - tmpvar_69.xyz = xl_retval_42.hip_lmapFade.xyz; - vec4 tmpvar_70; - tmpvar_70 = tmpvar_69; - gl_TexCoord[4] = tmpvar_70; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-out.txt index 8f06a8358..618238a66 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-out.txt @@ -9,61 +9,76 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec3 tmpvar_1; - vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); - vec4 o_3; - vec4 tmpvar_4; - tmpvar_4 = (tmpvar_2 * 0.5); + vec3 binormal_1; + vec3 tmpvar_2; + vec4 pos_3; + pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 o_4; + o_4 = (pos_3 * 0.5); vec2 tmpvar_5; - tmpvar_5.x = tmpvar_4.x; - tmpvar_5.y = (tmpvar_4.y * _ProjectionParams.x); - o_3.xy = (tmpvar_5 + tmpvar_4.w); - o_3.zw = tmpvar_2.zw; - tmpvar_1.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - tmpvar_1.z = ((-( + tmpvar_5.x = o_4.x; + tmpvar_5.y = (o_4.y * _ProjectionParams.x); + o_4.xy = (tmpvar_5 + o_4.w); + o_4.zw = pos_3.zw; + tmpvar_2.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); + tmpvar_2.z = ((-( (gl_ModelViewMatrix * gl_Vertex) .z) * unity_LightmapFade.z) + unity_LightmapFade.w); - vec3 tmpvar_6; - tmpvar_6 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); - mat3 tmpvar_7; - tmpvar_7[0].x = TANGENT.x; - tmpvar_7[0].y = tmpvar_6.x; - tmpvar_7[0].z = gl_Normal.x; - tmpvar_7[1].x = TANGENT.y; - tmpvar_7[1].y = tmpvar_6.y; - tmpvar_7[1].z = gl_Normal.y; - tmpvar_7[2].x = TANGENT.z; - tmpvar_7[2].y = tmpvar_6.z; - tmpvar_7[2].z = gl_Normal.z; + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + mat3 tmpvar_6; + tmpvar_6[0].x = TANGENT.x; + tmpvar_6[0].y = binormal_1.x; + tmpvar_6[0].z = gl_Normal.x; + tmpvar_6[1].x = TANGENT.y; + tmpvar_6[1].y = binormal_1.y; + tmpvar_6[1].z = gl_Normal.y; + tmpvar_6[2].x = TANGENT.z; + tmpvar_6[2].y = binormal_1.z; + tmpvar_6[2].z = gl_Normal.z; + vec4 tmpvar_7; + tmpvar_7.w = 1.0; + tmpvar_7.xyz = _WorldSpaceCameraPos; + gl_Position = pos_3; vec4 tmpvar_8; - tmpvar_8.w = 1.0; - tmpvar_8.xyz = _WorldSpaceCameraPos; - gl_Position = tmpvar_2; + tmpvar_8.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_8.x = pos_3.z; + xlv_FOG = tmpvar_8; vec4 tmpvar_9; - tmpvar_9.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_9.x = tmpvar_2.z; - xlv_FOG = tmpvar_9; + tmpvar_9.zw = vec2(0.0, 0.0); + tmpvar_9.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_9; vec4 tmpvar_10; - tmpvar_10.zw = vec2(0.0, 0.0); - tmpvar_10.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_10; + tmpvar_10.w = 0.0; + tmpvar_10.xyz = (tmpvar_6 * (( + (_World2Object * tmpvar_7) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); + gl_TexCoord[1] = tmpvar_10; + gl_TexCoord[2] = o_4; vec4 tmpvar_11; tmpvar_11.w = 0.0; - tmpvar_11.xyz = (tmpvar_7 * (( - (_World2Object * tmpvar_8) - .xyz * unity_Scale.w) - gl_Vertex.xyz)); - gl_TexCoord[1] = tmpvar_11; - gl_TexCoord[2] = o_3; + tmpvar_11.xyz = (tmpvar_6 * (gl_Normal * unity_Scale.w)); + gl_TexCoord[3] = tmpvar_11; vec4 tmpvar_12; tmpvar_12.w = 0.0; - tmpvar_12.xyz = (tmpvar_7 * (gl_Normal * unity_Scale.w)); - gl_TexCoord[3] = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13.w = 0.0; - tmpvar_13.xyz = tmpvar_1; - gl_TexCoord[4] = tmpvar_13; + tmpvar_12.xyz = tmpvar_2; + gl_TexCoord[4] = tmpvar_12; } -// inputs: 5, stats: 28 alu 0 tex 0 flow +// stats: 28 alu 0 tex 0 flow +// inputs: 5 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #2: gl_Normal (high float) 3x1 [-1] loc 2 +// #3: gl_Vertex (high float) 4x1 [-1] loc 0 +// #4: TANGENT (high float) 4x1 [-1] +// uniforms: 9 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: gl_ModelViewMatrix (high float) 4x4 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _ProjectionParams (high float) 4x1 [-1] +// #4: _World2Object (high float) 4x4 [-1] +// #5: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #6: unity_LightmapFade (high float) 4x1 [-1] +// #7: unity_LightmapST (high float) 4x1 [-1] +// #8: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-ir.txt deleted file mode 100644 index c4e2aced5..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-ir.txt +++ /dev/null @@ -1,175 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 lightDir; - vec4 _LightCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _BumpMap_ST; -uniform mat4 _LightMatrix0; -uniform mat4 _Object2World; -uniform mat4 _World2Object; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec3 ObjSpaceLightDir ( - in vec4 v_6 -) -{ - vec3 objSpaceLightPos_7; - vec3 tmpvar_8; - tmpvar_8 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_7 = tmpvar_8; - return ((objSpaceLightPos_7.xyz * unity_Scale.w) - v_6.xyz); -} - -v2f_surf vert_surf ( - in appdata_full v_9 -) -{ - mat3 rotation_10; - vec3 binormal_11; - v2f_surf o_12; - PositionFog (v_9.vertex, o_12.pos, o_12.fog); - vec2 tmpvar_13; - tmpvar_13 = ((v_9.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_12.hip_pack0 = tmpvar_13.xy.xy; - vec3 tmpvar_14; - tmpvar_14 = cross (v_9.normal, v_9.tangent.xyz); - vec3 tmpvar_15; - tmpvar_15 = (tmpvar_14 * v_9.tangent.w); - binormal_11 = tmpvar_15; - mat3 tmpvar_16; - float tmpvar_17; - tmpvar_17 = v_9.tangent.x; - tmpvar_16[0].x = tmpvar_17; - float tmpvar_18; - tmpvar_18 = binormal_11.x; - tmpvar_16[0].y = tmpvar_18; - float tmpvar_19; - tmpvar_19 = v_9.normal.x; - tmpvar_16[0].z = tmpvar_19; - float tmpvar_20; - tmpvar_20 = v_9.tangent.y; - tmpvar_16[1].x = tmpvar_20; - float tmpvar_21; - tmpvar_21 = binormal_11.y; - tmpvar_16[1].y = tmpvar_21; - float tmpvar_22; - tmpvar_22 = v_9.normal.y; - tmpvar_16[1].z = tmpvar_22; - float tmpvar_23; - tmpvar_23 = v_9.tangent.z; - tmpvar_16[2].x = tmpvar_23; - float tmpvar_24; - tmpvar_24 = binormal_11.z; - tmpvar_16[2].y = tmpvar_24; - float tmpvar_25; - tmpvar_25 = v_9.normal.z; - tmpvar_16[2].z = tmpvar_25; - mat3 tmpvar_26; - tmpvar_26 = tmpvar_16; - rotation_10 = tmpvar_26; - vec3 tmpvar_27; - tmpvar_27 = ObjSpaceLightDir (v_9.vertex); - vec3 tmpvar_28; - tmpvar_28 = (rotation_10 * tmpvar_27); - o_12.lightDir = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = (_LightMatrix0 * (_Object2World * v_9.vertex)); - o_12._LightCoord = tmpvar_29; - return o_12; -} - -void main () -{ - appdata_full xlt_v_30; - v2f_surf xl_retval_31; - vec4 tmpvar_32; - tmpvar_32 = gl_Vertex.xyzw; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - xlt_v_30.vertex = tmpvar_33; - vec4 tmpvar_34; - tmpvar_34 = TANGENT.xyzw; - vec4 tmpvar_35; - tmpvar_35 = tmpvar_34; - xlt_v_30.tangent = tmpvar_35; - vec3 tmpvar_36; - tmpvar_36 = gl_Normal.xyz; - vec3 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlt_v_30.normal = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - xlt_v_30.texcoord = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - xlt_v_30.texcoord1 = tmpvar_41; - vec4 tmpvar_42; - tmpvar_42 = gl_Color.xyzw; - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - xlt_v_30.color = tmpvar_43; - v2f_surf tmpvar_44; - tmpvar_44 = vert_surf (xlt_v_30); - v2f_surf tmpvar_45; - tmpvar_45 = tmpvar_44; - xl_retval_31 = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46 = xl_retval_31.pos.xyzw; - vec4 tmpvar_47; - tmpvar_47 = tmpvar_46; - gl_Position = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_48.x = xl_retval_31.fog; - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - xlv_FOG = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50.zw = vec2(0.0, 0.0); - tmpvar_50.xy = xl_retval_31.hip_pack0.xy; - vec4 tmpvar_51; - tmpvar_51 = tmpvar_50; - gl_TexCoord[0] = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52.w = 0.0; - tmpvar_52.xyz = xl_retval_31.lightDir.xyz; - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - gl_TexCoord[1] = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54 = xl_retval_31._LightCoord.xyzw; - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - gl_TexCoord[2] = tmpvar_55; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-out.txt index a29d637f9..7ee0a0a0b 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-out.txt @@ -8,24 +8,24 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); - vec3 tmpvar_2; - tmpvar_2 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + vec3 binormal_1; + vec4 pos_2; + pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_3; tmpvar_3[0].x = TANGENT.x; - tmpvar_3[0].y = tmpvar_2.x; + tmpvar_3[0].y = binormal_1.x; tmpvar_3[0].z = gl_Normal.x; tmpvar_3[1].x = TANGENT.y; - tmpvar_3[1].y = tmpvar_2.y; + tmpvar_3[1].y = binormal_1.y; tmpvar_3[1].z = gl_Normal.y; tmpvar_3[2].x = TANGENT.z; - tmpvar_3[2].y = tmpvar_2.z; + tmpvar_3[2].y = binormal_1.z; tmpvar_3[2].z = gl_Normal.z; - gl_Position = tmpvar_1; + gl_Position = pos_2; vec4 tmpvar_4; tmpvar_4.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_4.x = tmpvar_1.z; + tmpvar_4.x = pos_2.z; xlv_FOG = tmpvar_4; vec4 tmpvar_5; tmpvar_5.zw = vec2(0.0, 0.0); @@ -41,4 +41,17 @@ void main () } -// inputs: 4, stats: 16 alu 0 tex 0 flow +// stats: 16 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 7 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _BumpMap_ST (high float) 4x1 [-1] +// #2: _LightMatrix0 (high float) 4x4 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _World2Object (high float) 4x4 [-1] +// #5: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #6: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-ir.txt deleted file mode 100644 index 10c8cc4a3..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-ir.txt +++ /dev/null @@ -1,176 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 lightDir; - vec3 _LightCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _BumpMap_ST; -uniform mat4 _LightMatrix0; -uniform mat4 _Object2World; -uniform mat4 _World2Object; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec3 ObjSpaceLightDir ( - in vec4 v_6 -) -{ - vec3 objSpaceLightPos_7; - vec3 tmpvar_8; - tmpvar_8 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_7 = tmpvar_8; - return ((objSpaceLightPos_7.xyz * unity_Scale.w) - v_6.xyz); -} - -v2f_surf vert_surf ( - in appdata_full v_9 -) -{ - mat3 rotation_10; - vec3 binormal_11; - v2f_surf o_12; - PositionFog (v_9.vertex, o_12.pos, o_12.fog); - vec2 tmpvar_13; - tmpvar_13 = ((v_9.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_12.hip_pack0 = tmpvar_13.xy.xy; - vec3 tmpvar_14; - tmpvar_14 = cross (v_9.normal, v_9.tangent.xyz); - vec3 tmpvar_15; - tmpvar_15 = (tmpvar_14 * v_9.tangent.w); - binormal_11 = tmpvar_15; - mat3 tmpvar_16; - float tmpvar_17; - tmpvar_17 = v_9.tangent.x; - tmpvar_16[0].x = tmpvar_17; - float tmpvar_18; - tmpvar_18 = binormal_11.x; - tmpvar_16[0].y = tmpvar_18; - float tmpvar_19; - tmpvar_19 = v_9.normal.x; - tmpvar_16[0].z = tmpvar_19; - float tmpvar_20; - tmpvar_20 = v_9.tangent.y; - tmpvar_16[1].x = tmpvar_20; - float tmpvar_21; - tmpvar_21 = binormal_11.y; - tmpvar_16[1].y = tmpvar_21; - float tmpvar_22; - tmpvar_22 = v_9.normal.y; - tmpvar_16[1].z = tmpvar_22; - float tmpvar_23; - tmpvar_23 = v_9.tangent.z; - tmpvar_16[2].x = tmpvar_23; - float tmpvar_24; - tmpvar_24 = binormal_11.z; - tmpvar_16[2].y = tmpvar_24; - float tmpvar_25; - tmpvar_25 = v_9.normal.z; - tmpvar_16[2].z = tmpvar_25; - mat3 tmpvar_26; - tmpvar_26 = tmpvar_16; - rotation_10 = tmpvar_26; - vec3 tmpvar_27; - tmpvar_27 = ObjSpaceLightDir (v_9.vertex); - vec3 tmpvar_28; - tmpvar_28 = (rotation_10 * tmpvar_27); - o_12.lightDir = tmpvar_28; - vec3 tmpvar_29; - tmpvar_29 = (_LightMatrix0 * (_Object2World * v_9.vertex)).xyz; - o_12._LightCoord = tmpvar_29; - return o_12; -} - -void main () -{ - appdata_full xlt_v_30; - v2f_surf xl_retval_31; - vec4 tmpvar_32; - tmpvar_32 = gl_Vertex.xyzw; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - xlt_v_30.vertex = tmpvar_33; - vec4 tmpvar_34; - tmpvar_34 = TANGENT.xyzw; - vec4 tmpvar_35; - tmpvar_35 = tmpvar_34; - xlt_v_30.tangent = tmpvar_35; - vec3 tmpvar_36; - tmpvar_36 = gl_Normal.xyz; - vec3 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlt_v_30.normal = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - xlt_v_30.texcoord = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - xlt_v_30.texcoord1 = tmpvar_41; - vec4 tmpvar_42; - tmpvar_42 = gl_Color.xyzw; - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - xlt_v_30.color = tmpvar_43; - v2f_surf tmpvar_44; - tmpvar_44 = vert_surf (xlt_v_30); - v2f_surf tmpvar_45; - tmpvar_45 = tmpvar_44; - xl_retval_31 = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46 = xl_retval_31.pos.xyzw; - vec4 tmpvar_47; - tmpvar_47 = tmpvar_46; - gl_Position = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_48.x = xl_retval_31.fog; - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - xlv_FOG = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50.zw = vec2(0.0, 0.0); - tmpvar_50.xy = xl_retval_31.hip_pack0.xy; - vec4 tmpvar_51; - tmpvar_51 = tmpvar_50; - gl_TexCoord[0] = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52.w = 0.0; - tmpvar_52.xyz = xl_retval_31.lightDir.xyz; - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - gl_TexCoord[1] = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54.w = 0.0; - tmpvar_54.xyz = xl_retval_31._LightCoord.xyz; - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - gl_TexCoord[2] = tmpvar_55; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-out.txt index c936a3ae3..049b503d0 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-out.txt @@ -8,24 +8,24 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); - vec3 tmpvar_2; - tmpvar_2 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + vec3 binormal_1; + vec4 pos_2; + pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_3; tmpvar_3[0].x = TANGENT.x; - tmpvar_3[0].y = tmpvar_2.x; + tmpvar_3[0].y = binormal_1.x; tmpvar_3[0].z = gl_Normal.x; tmpvar_3[1].x = TANGENT.y; - tmpvar_3[1].y = tmpvar_2.y; + tmpvar_3[1].y = binormal_1.y; tmpvar_3[1].z = gl_Normal.y; tmpvar_3[2].x = TANGENT.z; - tmpvar_3[2].y = tmpvar_2.z; + tmpvar_3[2].y = binormal_1.z; tmpvar_3[2].z = gl_Normal.z; - gl_Position = tmpvar_1; + gl_Position = pos_2; vec4 tmpvar_4; tmpvar_4.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_4.x = tmpvar_1.z; + tmpvar_4.x = pos_2.z; xlv_FOG = tmpvar_4; vec4 tmpvar_5; tmpvar_5.zw = vec2(0.0, 0.0); @@ -44,4 +44,17 @@ void main () } -// inputs: 4, stats: 17 alu 0 tex 0 flow +// stats: 17 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 7 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _BumpMap_ST (high float) 4x1 [-1] +// #2: _LightMatrix0 (high float) 4x4 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _World2Object (high float) 4x4 [-1] +// #5: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #6: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-ir.txt deleted file mode 100644 index 527205299..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-ir.txt +++ /dev/null @@ -1,160 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec3 normal; - vec3 lightDir; - vec4 _LightCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform mat4 _LightMatrix0; -uniform mat4 _Object2World; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec3 WorldSpaceLightDir ( - in vec4 v_9 -) -{ - vec3 worldPos_10; - vec3 tmpvar_11; - tmpvar_11 = (_Object2World * v_9).xyz; - worldPos_10 = tmpvar_11; - return (_WorldSpaceLightPos0.xyz - worldPos_10); -} - -void PositionFog ( - in vec4 v_12, - out vec4 pos_13, - out float fog_14 -) -{ - vec4 tmpvar_15; - tmpvar_15 = (gl_ModelViewProjectionMatrix * v_12); - pos_13 = tmpvar_15; - float tmpvar_16; - tmpvar_16 = pos_13.z; - fog_14 = tmpvar_16; -} - -v2f_surf vert_surf ( - in appdata_full v_17 -) -{ - v2f_surf o_18; - PositionFog (v_17.vertex, o_18.pos, o_18.fog); - mat3 tmpvar_19; - tmpvar_19 = xll_constructMat3 (_Object2World); - vec3 tmpvar_20; - tmpvar_20 = (tmpvar_19 * (v_17.normal * unity_Scale.w)); - o_18.normal = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = WorldSpaceLightDir (v_17.vertex); - vec3 tmpvar_22; - tmpvar_22 = tmpvar_21; - o_18.lightDir = tmpvar_22; - vec4 tmpvar_23; - tmpvar_23 = (_LightMatrix0 * (_Object2World * v_17.vertex)); - o_18._LightCoord = tmpvar_23; - return o_18; -} - -void main () -{ - appdata_full xlt_v_24; - v2f_surf xl_retval_25; - vec4 tmpvar_26; - tmpvar_26 = gl_Vertex.xyzw; - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - xlt_v_24.vertex = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = TANGENT.xyzw; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - xlt_v_24.tangent = tmpvar_29; - vec3 tmpvar_30; - tmpvar_30 = gl_Normal.xyz; - vec3 tmpvar_31; - tmpvar_31 = tmpvar_30; - xlt_v_24.normal = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - xlt_v_24.texcoord = tmpvar_33; - vec4 tmpvar_34; - tmpvar_34 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_35; - tmpvar_35 = tmpvar_34; - xlt_v_24.texcoord1 = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36 = gl_Color.xyzw; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlt_v_24.color = tmpvar_37; - v2f_surf tmpvar_38; - tmpvar_38 = vert_surf (xlt_v_24); - v2f_surf tmpvar_39; - tmpvar_39 = tmpvar_38; - xl_retval_25 = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = xl_retval_25.pos.xyzw; - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - gl_Position = tmpvar_41; - vec4 tmpvar_42; - tmpvar_42.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_42.x = xl_retval_25.fog; - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - xlv_FOG = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44.w = 0.0; - tmpvar_44.xyz = xl_retval_25.normal.xyz; - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - gl_TexCoord[0] = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46.w = 0.0; - tmpvar_46.xyz = xl_retval_25.lightDir.xyz; - vec4 tmpvar_47; - tmpvar_47 = tmpvar_46; - gl_TexCoord[1] = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48 = xl_retval_25._LightCoord.xyzw; - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - gl_TexCoord[2] = tmpvar_49; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-out.txt index e54094068..8ae2ed55e 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-out.txt @@ -5,16 +5,16 @@ uniform vec4 unity_Scale; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_1; + pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); mat3 tmpvar_2; tmpvar_2[0] = _Object2World[0].xyz; tmpvar_2[1] = _Object2World[1].xyz; tmpvar_2[2] = _Object2World[2].xyz; - gl_Position = tmpvar_1; + gl_Position = pos_1; vec4 tmpvar_3; tmpvar_3.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_3.x = tmpvar_1.z; + tmpvar_3.x = pos_1.z; xlv_FOG = tmpvar_3; vec4 tmpvar_4; tmpvar_4.w = 0.0; @@ -22,12 +22,21 @@ void main () gl_TexCoord[0] = tmpvar_4; vec4 tmpvar_5; tmpvar_5.w = 0.0; - vec4 cse_6; - cse_6 = (_Object2World * gl_Vertex); - tmpvar_5.xyz = (_WorldSpaceLightPos0.xyz - cse_6.xyz); + vec4 tmpvar_6; + tmpvar_6 = (_Object2World * gl_Vertex); + tmpvar_5.xyz = (_WorldSpaceLightPos0.xyz - tmpvar_6.xyz); gl_TexCoord[1] = tmpvar_5; - gl_TexCoord[2] = (_LightMatrix0 * cse_6); + gl_TexCoord[2] = (_LightMatrix0 * tmpvar_6); } -// inputs: 2, stats: 9 alu 0 tex 0 flow +// stats: 9 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_Normal (high float) 3x1 [-1] loc 2 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 5 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _LightMatrix0 (high float) 4x4 [-1] +// #2: _Object2World (high float) 4x4 [-1] +// #3: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #4: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-ir.txt deleted file mode 100644 index 1e71632f9..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-ir.txt +++ /dev/null @@ -1,161 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec3 normal; - vec3 lightDir; - vec3 _LightCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform mat4 _LightMatrix0; -uniform mat4 _Object2World; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec3 WorldSpaceLightDir ( - in vec4 v_9 -) -{ - vec3 worldPos_10; - vec3 tmpvar_11; - tmpvar_11 = (_Object2World * v_9).xyz; - worldPos_10 = tmpvar_11; - return (_WorldSpaceLightPos0.xyz - worldPos_10); -} - -void PositionFog ( - in vec4 v_12, - out vec4 pos_13, - out float fog_14 -) -{ - vec4 tmpvar_15; - tmpvar_15 = (gl_ModelViewProjectionMatrix * v_12); - pos_13 = tmpvar_15; - float tmpvar_16; - tmpvar_16 = pos_13.z; - fog_14 = tmpvar_16; -} - -v2f_surf vert_surf ( - in appdata_full v_17 -) -{ - v2f_surf o_18; - PositionFog (v_17.vertex, o_18.pos, o_18.fog); - mat3 tmpvar_19; - tmpvar_19 = xll_constructMat3 (_Object2World); - vec3 tmpvar_20; - tmpvar_20 = (tmpvar_19 * (v_17.normal * unity_Scale.w)); - o_18.normal = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = WorldSpaceLightDir (v_17.vertex); - vec3 tmpvar_22; - tmpvar_22 = tmpvar_21; - o_18.lightDir = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = (_LightMatrix0 * (_Object2World * v_17.vertex)).xyz; - o_18._LightCoord = tmpvar_23; - return o_18; -} - -void main () -{ - appdata_full xlt_v_24; - v2f_surf xl_retval_25; - vec4 tmpvar_26; - tmpvar_26 = gl_Vertex.xyzw; - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - xlt_v_24.vertex = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = TANGENT.xyzw; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - xlt_v_24.tangent = tmpvar_29; - vec3 tmpvar_30; - tmpvar_30 = gl_Normal.xyz; - vec3 tmpvar_31; - tmpvar_31 = tmpvar_30; - xlt_v_24.normal = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - xlt_v_24.texcoord = tmpvar_33; - vec4 tmpvar_34; - tmpvar_34 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_35; - tmpvar_35 = tmpvar_34; - xlt_v_24.texcoord1 = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36 = gl_Color.xyzw; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlt_v_24.color = tmpvar_37; - v2f_surf tmpvar_38; - tmpvar_38 = vert_surf (xlt_v_24); - v2f_surf tmpvar_39; - tmpvar_39 = tmpvar_38; - xl_retval_25 = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = xl_retval_25.pos.xyzw; - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - gl_Position = tmpvar_41; - vec4 tmpvar_42; - tmpvar_42.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_42.x = xl_retval_25.fog; - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - xlv_FOG = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44.w = 0.0; - tmpvar_44.xyz = xl_retval_25.normal.xyz; - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - gl_TexCoord[0] = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46.w = 0.0; - tmpvar_46.xyz = xl_retval_25.lightDir.xyz; - vec4 tmpvar_47; - tmpvar_47 = tmpvar_46; - gl_TexCoord[1] = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48.w = 0.0; - tmpvar_48.xyz = xl_retval_25._LightCoord.xyz; - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - gl_TexCoord[2] = tmpvar_49; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-out.txt index 3c4d9ac3b..8ad1a4353 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-out.txt @@ -5,16 +5,16 @@ uniform vec4 unity_Scale; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_1; + pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); mat3 tmpvar_2; tmpvar_2[0] = _Object2World[0].xyz; tmpvar_2[1] = _Object2World[1].xyz; tmpvar_2[2] = _Object2World[2].xyz; - gl_Position = tmpvar_1; + gl_Position = pos_1; vec4 tmpvar_3; tmpvar_3.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_3.x = tmpvar_1.z; + tmpvar_3.x = pos_1.z; xlv_FOG = tmpvar_3; vec4 tmpvar_4; tmpvar_4.w = 0.0; @@ -22,15 +22,24 @@ void main () gl_TexCoord[0] = tmpvar_4; vec4 tmpvar_5; tmpvar_5.w = 0.0; - vec4 cse_6; - cse_6 = (_Object2World * gl_Vertex); - tmpvar_5.xyz = (_WorldSpaceLightPos0.xyz - cse_6.xyz); + vec4 tmpvar_6; + tmpvar_6 = (_Object2World * gl_Vertex); + tmpvar_5.xyz = (_WorldSpaceLightPos0.xyz - tmpvar_6.xyz); gl_TexCoord[1] = tmpvar_5; vec4 tmpvar_7; tmpvar_7.w = 0.0; - tmpvar_7.xyz = (_LightMatrix0 * cse_6).xyz; + tmpvar_7.xyz = (_LightMatrix0 * tmpvar_6).xyz; gl_TexCoord[2] = tmpvar_7; } -// inputs: 2, stats: 10 alu 0 tex 0 flow +// stats: 10 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_Normal (high float) 3x1 [-1] loc 2 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 5 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _LightMatrix0 (high float) 4x4 [-1] +// #2: _Object2World (high float) 4x4 [-1] +// #3: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #4: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos2-ir.txt deleted file mode 100644 index f4a15b02e..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos2-ir.txt +++ /dev/null @@ -1,104 +0,0 @@ -struct v2f_surf { - vec4 pos; - vec3 normal; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -attribute vec4 TANGENT; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -v2f_surf vert_surf ( - in appdata_full v_9 -) -{ - v2f_surf o_10; - vec4 tmpvar_11; - tmpvar_11 = (gl_ModelViewProjectionMatrix * v_9.vertex); - o_10.pos = tmpvar_11; - mat3 tmpvar_12; - tmpvar_12 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose); - vec3 tmpvar_13; - tmpvar_13 = (tmpvar_12 * v_9.normal); - o_10.normal = tmpvar_13; - return o_10; -} - -void main () -{ - appdata_full xlt_v_14; - v2f_surf xl_retval_15; - vec4 tmpvar_16; - tmpvar_16 = gl_Vertex.xyzw; - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - xlt_v_14.vertex = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = TANGENT.xyzw; - vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - xlt_v_14.tangent = tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = gl_Normal.xyz; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_20; - xlt_v_14.normal = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - xlt_v_14.texcoord = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_25; - tmpvar_25 = tmpvar_24; - xlt_v_14.texcoord1 = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = gl_Color.xyzw; - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - xlt_v_14.color = tmpvar_27; - v2f_surf tmpvar_28; - tmpvar_28 = vert_surf (xlt_v_14); - v2f_surf tmpvar_29; - tmpvar_29 = tmpvar_28; - xl_retval_15 = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = xl_retval_15.pos.xyzw; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - gl_Position = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32.w = 0.0; - tmpvar_32.xyz = xl_retval_15.normal.xyz; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - gl_TexCoord[0] = tmpvar_33; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos2-out.txt index 9b51150cc..d87780097 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos2-out.txt @@ -12,4 +12,10 @@ void main () } -// inputs: 2, stats: 3 alu 0 tex 0 flow +// stats: 3 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_Normal (high float) 3x1 [-1] loc 2 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 2 (total size: 0) +// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] +// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo-ir.txt deleted file mode 100644 index f4a15b02e..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo-ir.txt +++ /dev/null @@ -1,104 +0,0 @@ -struct v2f_surf { - vec4 pos; - vec3 normal; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -attribute vec4 TANGENT; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -v2f_surf vert_surf ( - in appdata_full v_9 -) -{ - v2f_surf o_10; - vec4 tmpvar_11; - tmpvar_11 = (gl_ModelViewProjectionMatrix * v_9.vertex); - o_10.pos = tmpvar_11; - mat3 tmpvar_12; - tmpvar_12 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose); - vec3 tmpvar_13; - tmpvar_13 = (tmpvar_12 * v_9.normal); - o_10.normal = tmpvar_13; - return o_10; -} - -void main () -{ - appdata_full xlt_v_14; - v2f_surf xl_retval_15; - vec4 tmpvar_16; - tmpvar_16 = gl_Vertex.xyzw; - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - xlt_v_14.vertex = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = TANGENT.xyzw; - vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - xlt_v_14.tangent = tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = gl_Normal.xyz; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_20; - xlt_v_14.normal = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - xlt_v_14.texcoord = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_25; - tmpvar_25 = tmpvar_24; - xlt_v_14.texcoord1 = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = gl_Color.xyzw; - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - xlt_v_14.color = tmpvar_27; - v2f_surf tmpvar_28; - tmpvar_28 = vert_surf (xlt_v_14); - v2f_surf tmpvar_29; - tmpvar_29 = tmpvar_28; - xl_retval_15 = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = xl_retval_15.pos.xyzw; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - gl_Position = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32.w = 0.0; - tmpvar_32.xyz = xl_retval_15.normal.xyz; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - gl_TexCoord[0] = tmpvar_33; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo-out.txt index 9b51150cc..d87780097 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo-out.txt @@ -12,4 +12,10 @@ void main () } -// inputs: 2, stats: 3 alu 0 tex 0 flow +// stats: 3 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_Normal (high float) 3x1 [-1] loc 2 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 2 (total size: 0) +// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] +// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-ir.txt deleted file mode 100644 index 3521a37c7..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-ir.txt +++ /dev/null @@ -1,132 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_screenPos; - vec4 hip_screen; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _ProjectionParams; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec4 ComputeScreenPos ( - in vec4 pos_6 -) -{ - vec4 o_7; - vec4 tmpvar_8; - tmpvar_8 = (pos_6 * 0.5); - o_7 = tmpvar_8; - vec2 tmpvar_9; - tmpvar_9.x = o_7.x; - tmpvar_9.y = (o_7.y * _ProjectionParams.x); - vec2 tmpvar_10; - tmpvar_10 = (tmpvar_9 + o_7.w); - o_7.xy = tmpvar_10.xy.xy; - vec2 tmpvar_11; - tmpvar_11 = pos_6.zw; - o_7.zw = tmpvar_11.xxxy.zw; - return o_7; -} - -v2f_surf vert_surf ( - in appdata_full v_12 -) -{ - v2f_surf o_13; - PositionFog (v_12.vertex, o_13.pos, o_13.fog); - vec4 tmpvar_14; - tmpvar_14 = ComputeScreenPos (o_13.pos); - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - o_13.hip_screenPos = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = ComputeScreenPos (o_13.pos); - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - o_13.hip_screen = tmpvar_17; - return o_13; -} - -void main () -{ - appdata_full xlt_v_18; - v2f_surf xl_retval_19; - vec4 tmpvar_20; - tmpvar_20 = gl_Vertex.xyzw; - vec4 tmpvar_21; - tmpvar_21 = tmpvar_20; - xlt_v_18.vertex = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22 = TANGENT.xyzw; - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - xlt_v_18.tangent = tmpvar_23; - vec3 tmpvar_24; - tmpvar_24 = gl_Normal.xyz; - vec3 tmpvar_25; - tmpvar_25 = tmpvar_24; - xlt_v_18.normal = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - xlt_v_18.texcoord = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - xlt_v_18.texcoord1 = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = gl_Color.xyzw; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - xlt_v_18.color = tmpvar_31; - v2f_surf tmpvar_32; - tmpvar_32 = vert_surf (xlt_v_18); - v2f_surf tmpvar_33; - tmpvar_33 = tmpvar_32; - xl_retval_19 = tmpvar_33; - vec4 tmpvar_34; - tmpvar_34 = xl_retval_19.pos.xyzw; - vec4 tmpvar_35; - tmpvar_35 = tmpvar_34; - gl_Position = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_36.x = xl_retval_19.fog; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlv_FOG = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = xl_retval_19.hip_screenPos.xyzw; - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - gl_TexCoord[0] = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = xl_retval_19.hip_screen.xyzw; - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - gl_TexCoord[1] = tmpvar_41; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-out.txt index f999bcb56..bfdafda3e 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-out.txt @@ -2,32 +2,35 @@ uniform vec4 _ProjectionParams; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_1; + pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); vec4 o_2; - vec4 tmpvar_3; - tmpvar_3 = (tmpvar_1 * 0.5); - vec2 tmpvar_4; - tmpvar_4.x = tmpvar_3.x; - tmpvar_4.y = (tmpvar_3.y * _ProjectionParams.x); - o_2.xy = (tmpvar_4 + tmpvar_3.w); - o_2.zw = tmpvar_1.zw; - vec4 o_5; + o_2 = (pos_1 * 0.5); + vec2 tmpvar_3; + tmpvar_3.x = o_2.x; + tmpvar_3.y = (o_2.y * _ProjectionParams.x); + o_2.xy = (tmpvar_3 + o_2.w); + o_2.zw = pos_1.zw; + vec4 o_4; + o_4 = (pos_1 * 0.5); + vec2 tmpvar_5; + tmpvar_5.x = o_4.x; + tmpvar_5.y = (o_4.y * _ProjectionParams.x); + o_4.xy = (tmpvar_5 + o_4.w); + o_4.zw = pos_1.zw; + gl_Position = pos_1; vec4 tmpvar_6; - tmpvar_6 = (tmpvar_1 * 0.5); - vec2 tmpvar_7; - tmpvar_7.x = tmpvar_6.x; - tmpvar_7.y = (tmpvar_6.y * _ProjectionParams.x); - o_5.xy = (tmpvar_7 + tmpvar_6.w); - o_5.zw = tmpvar_1.zw; - gl_Position = tmpvar_1; - vec4 tmpvar_8; - tmpvar_8.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_8.x = tmpvar_1.z; - xlv_FOG = tmpvar_8; + tmpvar_6.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_6.x = pos_1.z; + xlv_FOG = tmpvar_6; gl_TexCoord[0] = o_2; - gl_TexCoord[1] = o_5; + gl_TexCoord[1] = o_4; } -// inputs: 1, stats: 8 alu 0 tex 0 flow +// stats: 8 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 2 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _ProjectionParams (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-ir.txt deleted file mode 100644 index 9a534c980..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-ir.txt +++ /dev/null @@ -1,181 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 worldPos; - vec3 normal; - vec3 lightDir; - vec4 _LightCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec3 WorldSpaceLightDir ( - in vec4 v_9 -) -{ - vec3 worldPos_10; - vec3 tmpvar_11; - tmpvar_11 = (_Object2World * v_9).xyz; - worldPos_10 = tmpvar_11; - return (_WorldSpaceLightPos0.xyz - worldPos_10); -} - -void PositionFog ( - in vec4 v_12, - out vec4 pos_13, - out float fog_14 -) -{ - vec4 tmpvar_15; - tmpvar_15 = (gl_ModelViewProjectionMatrix * v_12); - pos_13 = tmpvar_15; - float tmpvar_16; - tmpvar_16 = pos_13.z; - fog_14 = tmpvar_16; -} - -v2f_surf vert_surf ( - in appdata_full v_17 -) -{ - v2f_surf o_18; - PositionFog (v_17.vertex, o_18.pos, o_18.fog); - vec2 tmpvar_19; - tmpvar_19 = ((v_17.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_18.hip_pack0 = tmpvar_19.xy.xy; - vec3 tmpvar_20; - tmpvar_20 = (_Object2World * v_17.vertex).xyz; - o_18.worldPos = tmpvar_20; - mat3 tmpvar_21; - tmpvar_21 = xll_constructMat3 (_Object2World); - vec3 tmpvar_22; - tmpvar_22 = (tmpvar_21 * (v_17.normal * unity_Scale.w)); - o_18.normal = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = WorldSpaceLightDir (v_17.vertex); - vec3 tmpvar_24; - tmpvar_24 = tmpvar_23; - o_18.lightDir = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25 = (_LightMatrix0 * (_Object2World * v_17.vertex)); - o_18._LightCoord = tmpvar_25; - return o_18; -} - -void main () -{ - appdata_full xlt_v_26; - v2f_surf xl_retval_27; - vec4 tmpvar_28; - tmpvar_28 = gl_Vertex.xyzw; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - xlt_v_26.vertex = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = TANGENT.xyzw; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - xlt_v_26.tangent = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = gl_Normal.xyz; - vec3 tmpvar_33; - tmpvar_33 = tmpvar_32; - xlt_v_26.normal = tmpvar_33; - vec4 tmpvar_34; - tmpvar_34 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_35; - tmpvar_35 = tmpvar_34; - xlt_v_26.texcoord = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlt_v_26.texcoord1 = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = gl_Color.xyzw; - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - xlt_v_26.color = tmpvar_39; - v2f_surf tmpvar_40; - tmpvar_40 = vert_surf (xlt_v_26); - v2f_surf tmpvar_41; - tmpvar_41 = tmpvar_40; - xl_retval_27 = tmpvar_41; - vec4 tmpvar_42; - tmpvar_42 = xl_retval_27.pos.xyzw; - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - gl_Position = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_44.x = xl_retval_27.fog; - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - xlv_FOG = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46.zw = vec2(0.0, 0.0); - tmpvar_46.xy = xl_retval_27.hip_pack0.xy; - vec4 tmpvar_47; - tmpvar_47 = tmpvar_46; - gl_TexCoord[0] = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48.w = 0.0; - tmpvar_48.xyz = xl_retval_27.worldPos.xyz; - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - gl_TexCoord[1] = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50.w = 0.0; - tmpvar_50.xyz = xl_retval_27.normal.xyz; - vec4 tmpvar_51; - tmpvar_51 = tmpvar_50; - gl_TexCoord[2] = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52.w = 0.0; - tmpvar_52.xyz = xl_retval_27.lightDir.xyz; - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - gl_TexCoord[3] = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54 = xl_retval_27._LightCoord.xyzw; - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - gl_TexCoord[4] = tmpvar_55; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-out.txt index 381f83ba3..a25317854 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-out.txt @@ -6,16 +6,16 @@ uniform vec4 unity_Scale; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_1; + pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); mat3 tmpvar_2; tmpvar_2[0] = _Object2World[0].xyz; tmpvar_2[1] = _Object2World[1].xyz; tmpvar_2[2] = _Object2World[2].xyz; - gl_Position = tmpvar_1; + gl_Position = pos_1; vec4 tmpvar_3; tmpvar_3.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_3.x = tmpvar_1.z; + tmpvar_3.x = pos_1.z; xlv_FOG = tmpvar_3; vec4 tmpvar_4; tmpvar_4.zw = vec2(0.0, 0.0); @@ -23,9 +23,9 @@ void main () gl_TexCoord[0] = tmpvar_4; vec4 tmpvar_5; tmpvar_5.w = 0.0; - vec4 cse_6; - cse_6 = (_Object2World * gl_Vertex); - tmpvar_5.xyz = cse_6.xyz; + vec4 tmpvar_6; + tmpvar_6 = (_Object2World * gl_Vertex); + tmpvar_5.xyz = tmpvar_6.xyz; gl_TexCoord[1] = tmpvar_5; vec4 tmpvar_7; tmpvar_7.w = 0.0; @@ -33,10 +33,21 @@ void main () gl_TexCoord[2] = tmpvar_7; vec4 tmpvar_8; tmpvar_8.w = 0.0; - tmpvar_8.xyz = (_WorldSpaceLightPos0.xyz - cse_6.xyz); + tmpvar_8.xyz = (_WorldSpaceLightPos0.xyz - tmpvar_6.xyz); gl_TexCoord[3] = tmpvar_8; - gl_TexCoord[4] = (_LightMatrix0 * cse_6); + gl_TexCoord[4] = (_LightMatrix0 * tmpvar_6); } -// inputs: 3, stats: 13 alu 0 tex 0 flow +// stats: 13 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 6 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _LightMatrix0 (high float) 4x4 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #5: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-ir.txt deleted file mode 100644 index eecc238a2..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-ir.txt +++ /dev/null @@ -1,143 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 worldPos; - vec4 hip_screen; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _ProjectionParams; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec4 ComputeScreenPos ( - in vec4 pos_6 -) -{ - vec4 o_7; - vec4 tmpvar_8; - tmpvar_8 = (pos_6 * 0.5); - o_7 = tmpvar_8; - vec2 tmpvar_9; - tmpvar_9.x = o_7.x; - tmpvar_9.y = (o_7.y * _ProjectionParams.x); - vec2 tmpvar_10; - tmpvar_10 = (tmpvar_9 + o_7.w); - o_7.xy = tmpvar_10.xy.xy; - vec2 tmpvar_11; - tmpvar_11 = pos_6.zw; - o_7.zw = tmpvar_11.xxxy.zw; - return o_7; -} - -v2f_surf vert_surf ( - in appdata_full v_12 -) -{ - v2f_surf o_13; - PositionFog (v_12.vertex, o_13.pos, o_13.fog); - vec2 tmpvar_14; - tmpvar_14 = ((v_12.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_13.hip_pack0 = tmpvar_14.xy.xy; - vec3 tmpvar_15; - tmpvar_15 = (_Object2World * v_12.vertex).xyz; - o_13.worldPos = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = ComputeScreenPos (o_13.pos); - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - o_13.hip_screen = tmpvar_17; - return o_13; -} - -void main () -{ - appdata_full xlt_v_18; - v2f_surf xl_retval_19; - vec4 tmpvar_20; - tmpvar_20 = gl_Vertex.xyzw; - vec4 tmpvar_21; - tmpvar_21 = tmpvar_20; - xlt_v_18.vertex = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22 = TANGENT.xyzw; - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - xlt_v_18.tangent = tmpvar_23; - vec3 tmpvar_24; - tmpvar_24 = gl_Normal.xyz; - vec3 tmpvar_25; - tmpvar_25 = tmpvar_24; - xlt_v_18.normal = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - xlt_v_18.texcoord = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - xlt_v_18.texcoord1 = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = gl_Color.xyzw; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - xlt_v_18.color = tmpvar_31; - v2f_surf tmpvar_32; - tmpvar_32 = vert_surf (xlt_v_18); - v2f_surf tmpvar_33; - tmpvar_33 = tmpvar_32; - xl_retval_19 = tmpvar_33; - vec4 tmpvar_34; - tmpvar_34 = xl_retval_19.pos.xyzw; - vec4 tmpvar_35; - tmpvar_35 = tmpvar_34; - gl_Position = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_36.x = xl_retval_19.fog; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlv_FOG = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38.zw = vec2(0.0, 0.0); - tmpvar_38.xy = xl_retval_19.hip_pack0.xy; - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - gl_TexCoord[0] = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40.w = 0.0; - tmpvar_40.xyz = xl_retval_19.worldPos.xyz; - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - gl_TexCoord[1] = tmpvar_41; - vec4 tmpvar_42; - tmpvar_42 = xl_retval_19.hip_screen.xyzw; - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - gl_TexCoord[2] = tmpvar_43; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-out.txt index 4d7c43d31..28176145d 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-out.txt @@ -4,31 +4,38 @@ uniform vec4 _ProjectionParams; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_1; + pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); vec4 o_2; - vec4 tmpvar_3; - tmpvar_3 = (tmpvar_1 * 0.5); - vec2 tmpvar_4; - tmpvar_4.x = tmpvar_3.x; - tmpvar_4.y = (tmpvar_3.y * _ProjectionParams.x); - o_2.xy = (tmpvar_4 + tmpvar_3.w); - o_2.zw = tmpvar_1.zw; - gl_Position = tmpvar_1; + o_2 = (pos_1 * 0.5); + vec2 tmpvar_3; + tmpvar_3.x = o_2.x; + tmpvar_3.y = (o_2.y * _ProjectionParams.x); + o_2.xy = (tmpvar_3 + o_2.w); + o_2.zw = pos_1.zw; + gl_Position = pos_1; + vec4 tmpvar_4; + tmpvar_4.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_4.x = pos_1.z; + xlv_FOG = tmpvar_4; vec4 tmpvar_5; - tmpvar_5.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_5.x = tmpvar_1.z; - xlv_FOG = tmpvar_5; + tmpvar_5.zw = vec2(0.0, 0.0); + tmpvar_5.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_5; vec4 tmpvar_6; - tmpvar_6.zw = vec2(0.0, 0.0); - tmpvar_6.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7.w = 0.0; - tmpvar_7.xyz = (_Object2World * gl_Vertex).xyz; - gl_TexCoord[1] = tmpvar_7; + tmpvar_6.w = 0.0; + tmpvar_6.xyz = (_Object2World * gl_Vertex).xyz; + gl_TexCoord[1] = tmpvar_6; gl_TexCoord[2] = o_2; } -// inputs: 2, stats: 10 alu 0 tex 0 flow +// stats: 10 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 4 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _MainTex_ST (high float) 4x1 [-1] +// #2: _Object2World (high float) 4x4 [-1] +// #3: _ProjectionParams (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-ir.txt deleted file mode 100644 index 86ab7adfd..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-ir.txt +++ /dev/null @@ -1,160 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 worldPos; - vec4 hip_screen; - vec3 hip_lmapFade; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _ProjectionParams; -uniform vec4 unity_LightmapFade; -uniform vec4 unity_LightmapST; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec4 ComputeScreenPos ( - in vec4 pos_6 -) -{ - vec4 o_7; - vec4 tmpvar_8; - tmpvar_8 = (pos_6 * 0.5); - o_7 = tmpvar_8; - vec2 tmpvar_9; - tmpvar_9.x = o_7.x; - tmpvar_9.y = (o_7.y * _ProjectionParams.x); - vec2 tmpvar_10; - tmpvar_10 = (tmpvar_9 + o_7.w); - o_7.xy = tmpvar_10.xy.xy; - vec2 tmpvar_11; - tmpvar_11 = pos_6.zw; - o_7.zw = tmpvar_11.xxxy.zw; - return o_7; -} - -v2f_surf vert_surf ( - in appdata_full v_12 -) -{ - v2f_surf o_13; - PositionFog (v_12.vertex, o_13.pos, o_13.fog); - vec2 tmpvar_14; - tmpvar_14 = ((v_12.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_13.hip_pack0 = tmpvar_14.xy.xy; - vec3 tmpvar_15; - tmpvar_15 = (_Object2World * v_12.vertex).xyz; - o_13.worldPos = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16 = ComputeScreenPos (o_13.pos); - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - o_13.hip_screen = tmpvar_17; - vec2 tmpvar_18; - tmpvar_18 = ((v_12.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - o_13.hip_lmapFade.xy = tmpvar_18.xy.xy; - float tmpvar_19; - tmpvar_19 = ((-( - (gl_ModelViewMatrix * v_12.vertex) - .z) * unity_LightmapFade.z) + unity_LightmapFade.w); - o_13.hip_lmapFade.z = vec3(tmpvar_19).z; - return o_13; -} - -void main () -{ - appdata_full xlt_v_20; - v2f_surf xl_retval_21; - vec4 tmpvar_22; - tmpvar_22 = gl_Vertex.xyzw; - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - xlt_v_20.vertex = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = TANGENT.xyzw; - vec4 tmpvar_25; - tmpvar_25 = tmpvar_24; - xlt_v_20.tangent = tmpvar_25; - vec3 tmpvar_26; - tmpvar_26 = gl_Normal.xyz; - vec3 tmpvar_27; - tmpvar_27 = tmpvar_26; - xlt_v_20.normal = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - xlt_v_20.texcoord = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - xlt_v_20.texcoord1 = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = gl_Color.xyzw; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - xlt_v_20.color = tmpvar_33; - v2f_surf tmpvar_34; - tmpvar_34 = vert_surf (xlt_v_20); - v2f_surf tmpvar_35; - tmpvar_35 = tmpvar_34; - xl_retval_21 = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36 = xl_retval_21.pos.xyzw; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - gl_Position = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_38.x = xl_retval_21.fog; - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - xlv_FOG = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40.zw = vec2(0.0, 0.0); - tmpvar_40.xy = xl_retval_21.hip_pack0.xy; - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - gl_TexCoord[0] = tmpvar_41; - vec4 tmpvar_42; - tmpvar_42.w = 0.0; - tmpvar_42.xyz = xl_retval_21.worldPos.xyz; - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - gl_TexCoord[1] = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44 = xl_retval_21.hip_screen.xyzw; - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - gl_TexCoord[2] = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46.w = 0.0; - tmpvar_46.xyz = xl_retval_21.hip_lmapFade.xyz; - vec4 tmpvar_47; - tmpvar_47 = tmpvar_46; - gl_TexCoord[3] = tmpvar_47; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-out.txt index eee2df817..289717dd8 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-out.txt @@ -7,39 +7,50 @@ varying vec4 xlv_FOG; void main () { vec3 tmpvar_1; - vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_2; + pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); vec4 o_3; - vec4 tmpvar_4; - tmpvar_4 = (tmpvar_2 * 0.5); - vec2 tmpvar_5; - tmpvar_5.x = tmpvar_4.x; - tmpvar_5.y = (tmpvar_4.y * _ProjectionParams.x); - o_3.xy = (tmpvar_5 + tmpvar_4.w); - o_3.zw = tmpvar_2.zw; + o_3 = (pos_2 * 0.5); + vec2 tmpvar_4; + tmpvar_4.x = o_3.x; + tmpvar_4.y = (o_3.y * _ProjectionParams.x); + o_3.xy = (tmpvar_4 + o_3.w); + o_3.zw = pos_2.zw; tmpvar_1.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); tmpvar_1.z = ((-( (gl_ModelViewMatrix * gl_Vertex) .z) * unity_LightmapFade.z) + unity_LightmapFade.w); - gl_Position = tmpvar_2; + gl_Position = pos_2; + vec4 tmpvar_5; + tmpvar_5.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_5.x = pos_2.z; + xlv_FOG = tmpvar_5; vec4 tmpvar_6; - tmpvar_6.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_6.x = tmpvar_2.z; - xlv_FOG = tmpvar_6; + tmpvar_6.zw = vec2(0.0, 0.0); + tmpvar_6.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_6; vec4 tmpvar_7; - tmpvar_7.zw = vec2(0.0, 0.0); - tmpvar_7.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_7; + tmpvar_7.w = 0.0; + tmpvar_7.xyz = (_Object2World * gl_Vertex).xyz; + gl_TexCoord[1] = tmpvar_7; + gl_TexCoord[2] = o_3; vec4 tmpvar_8; tmpvar_8.w = 0.0; - tmpvar_8.xyz = (_Object2World * gl_Vertex).xyz; - gl_TexCoord[1] = tmpvar_8; - gl_TexCoord[2] = o_3; - vec4 tmpvar_9; - tmpvar_9.w = 0.0; - tmpvar_9.xyz = tmpvar_1; - gl_TexCoord[3] = tmpvar_9; + tmpvar_8.xyz = tmpvar_1; + gl_TexCoord[3] = tmpvar_8; } -// inputs: 3, stats: 17 alu 0 tex 0 flow +// stats: 17 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 7 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: gl_ModelViewMatrix (high float) 4x4 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _ProjectionParams (high float) 4x1 [-1] +// #5: unity_LightmapFade (high float) 4x1 [-1] +// #6: unity_LightmapST (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-ir.txt deleted file mode 100644 index f244019bc..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-ir.txt +++ /dev/null @@ -1,146 +0,0 @@ -struct v2f_surf { - vec4 pos; - vec3 _ShadowCoord0; - vec3 _ShadowCoord1; - vec3 _ShadowCoord2; - vec3 _ShadowCoord3; - vec2 _ShadowZFade; - vec3 worldPos; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _LightShadowData; -uniform mat4 _Object2World; -uniform mat4 _World2Shadow; -uniform mat4 _World2Shadow1; -uniform mat4 _World2Shadow2; -uniform mat4 _World2Shadow3; -attribute vec4 TANGENT; -v2f_surf vert_surf ( - in appdata_full v_1 -) -{ - vec4 wpos_2; - float z_3; - v2f_surf o_4; - vec3 tmpvar_5; - tmpvar_5 = (_Object2World * v_1.vertex).xyz; - o_4.worldPos = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6 = (gl_ModelViewProjectionMatrix * v_1.vertex); - o_4.pos = tmpvar_6; - float tmpvar_7; - tmpvar_7 = -((gl_ModelViewMatrix * v_1.vertex).z); - z_3 = tmpvar_7; - float tmpvar_8; - tmpvar_8 = z_3; - o_4._ShadowZFade.x = tmpvar_8; - float tmpvar_9; - tmpvar_9 = ((z_3 * _LightShadowData.z) + _LightShadowData.w); - o_4._ShadowZFade.y = vec2(tmpvar_9).y; - vec4 tmpvar_10; - tmpvar_10 = (_Object2World * v_1.vertex); - wpos_2 = tmpvar_10; - vec3 tmpvar_11; - tmpvar_11 = (_World2Shadow * wpos_2).xyz; - o_4._ShadowCoord0 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = (_World2Shadow1 * wpos_2).xyz; - o_4._ShadowCoord1 = tmpvar_12; - vec3 tmpvar_13; - tmpvar_13 = (_World2Shadow2 * wpos_2).xyz; - o_4._ShadowCoord2 = tmpvar_13; - vec3 tmpvar_14; - tmpvar_14 = (_World2Shadow3 * wpos_2).xyz; - o_4._ShadowCoord3 = tmpvar_14; - return o_4; -} - -void main () -{ - appdata_full xlt_v_15; - v2f_surf xl_retval_16; - vec4 tmpvar_17; - tmpvar_17 = gl_Vertex.xyzw; - vec4 tmpvar_18; - tmpvar_18 = tmpvar_17; - xlt_v_15.vertex = tmpvar_18; - vec4 tmpvar_19; - tmpvar_19 = TANGENT.xyzw; - vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - xlt_v_15.tangent = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = gl_Normal.xyz; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_21; - xlt_v_15.normal = tmpvar_22; - vec4 tmpvar_23; - tmpvar_23 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_24; - tmpvar_24 = tmpvar_23; - xlt_v_15.texcoord = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; - xlt_v_15.texcoord1 = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = gl_Color.xyzw; - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - xlt_v_15.color = tmpvar_28; - v2f_surf tmpvar_29; - tmpvar_29 = vert_surf (xlt_v_15); - v2f_surf tmpvar_30; - tmpvar_30 = tmpvar_29; - xl_retval_16 = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = xl_retval_16.pos.xyzw; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_31; - gl_Position = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33.w = 0.0; - tmpvar_33.xyz = xl_retval_16._ShadowCoord0.xyz; - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - gl_TexCoord[0] = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35.w = 0.0; - tmpvar_35.xyz = xl_retval_16._ShadowCoord1.xyz; - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - gl_TexCoord[1] = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37.w = 0.0; - tmpvar_37.xyz = xl_retval_16._ShadowCoord2.xyz; - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - gl_TexCoord[2] = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39.w = 0.0; - tmpvar_39.xyz = xl_retval_16._ShadowCoord3.xyz; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - gl_TexCoord[3] = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41.zw = vec2(0.0, 0.0); - tmpvar_41.xy = xl_retval_16._ShadowZFade.xy; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - gl_TexCoord[4] = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43.w = 0.0; - tmpvar_43.xyz = xl_retval_16.worldPos.xyz; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - gl_TexCoord[5] = tmpvar_44; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-out.txt index 00652d53a..68b10aa5d 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-out.txt @@ -6,39 +6,50 @@ uniform mat4 _World2Shadow2; uniform mat4 _World2Shadow3; void main () { - vec2 tmpvar_1; - float tmpvar_2; - tmpvar_2 = -((gl_ModelViewMatrix * gl_Vertex).z); - tmpvar_1.x = tmpvar_2; - tmpvar_1.y = ((tmpvar_2 * _LightShadowData.z) + _LightShadowData.w); - vec4 cse_3; - cse_3 = (_Object2World * gl_Vertex); + float z_1; + vec2 tmpvar_2; + z_1 = -((gl_ModelViewMatrix * gl_Vertex).z); + tmpvar_2.x = z_1; + tmpvar_2.y = ((z_1 * _LightShadowData.z) + _LightShadowData.w); + vec4 tmpvar_3; + tmpvar_3 = (_Object2World * gl_Vertex); gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); vec4 tmpvar_4; tmpvar_4.w = 0.0; - tmpvar_4.xyz = (_World2Shadow * cse_3).xyz; + tmpvar_4.xyz = (_World2Shadow * tmpvar_3).xyz; gl_TexCoord[0] = tmpvar_4; vec4 tmpvar_5; tmpvar_5.w = 0.0; - tmpvar_5.xyz = (_World2Shadow1 * cse_3).xyz; + tmpvar_5.xyz = (_World2Shadow1 * tmpvar_3).xyz; gl_TexCoord[1] = tmpvar_5; vec4 tmpvar_6; tmpvar_6.w = 0.0; - tmpvar_6.xyz = (_World2Shadow2 * cse_3).xyz; + tmpvar_6.xyz = (_World2Shadow2 * tmpvar_3).xyz; gl_TexCoord[2] = tmpvar_6; vec4 tmpvar_7; tmpvar_7.w = 0.0; - tmpvar_7.xyz = (_World2Shadow3 * cse_3).xyz; + tmpvar_7.xyz = (_World2Shadow3 * tmpvar_3).xyz; gl_TexCoord[3] = tmpvar_7; vec4 tmpvar_8; tmpvar_8.zw = vec2(0.0, 0.0); - tmpvar_8.xy = tmpvar_1; + tmpvar_8.xy = tmpvar_2; gl_TexCoord[4] = tmpvar_8; vec4 tmpvar_9; tmpvar_9.w = 0.0; - tmpvar_9.xyz = cse_3.xyz; + tmpvar_9.xyz = tmpvar_3.xyz; gl_TexCoord[5] = tmpvar_9; } -// inputs: 1, stats: 16 alu 0 tex 0 flow +// stats: 16 alu 0 tex 0 flow +// inputs: 1 +// #0: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 8 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: gl_ModelViewMatrix (high float) 4x4 [-1] +// #2: _LightShadowData (high float) 4x1 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _World2Shadow (high float) 4x4 [-1] +// #5: _World2Shadow1 (high float) 4x4 [-1] +// #6: _World2Shadow2 (high float) 4x4 [-1] +// #7: _World2Shadow3 (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-ir.txt deleted file mode 100644 index 9fc806e7b..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-ir.txt +++ /dev/null @@ -1,190 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec3 worldRefl; - vec3 normal; - vec3 lightDir; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform mat4 _Object2World; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec3 WorldSpaceLightDir ( - in vec4 v_9 -) -{ - vec3 worldPos_10; - vec3 tmpvar_11; - tmpvar_11 = (_Object2World * v_9).xyz; - worldPos_10 = tmpvar_11; - return _WorldSpaceLightPos0.xyz; -} - -void PositionFog ( - in vec4 v_12, - out vec4 pos_13, - out float fog_14 -) -{ - vec4 tmpvar_15; - tmpvar_15 = (gl_ModelViewProjectionMatrix * v_12); - pos_13 = tmpvar_15; - float tmpvar_16; - tmpvar_16 = pos_13.z; - fog_14 = tmpvar_16; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_17 -) -{ - vec3 objSpaceCameraPos_18; - vec4 tmpvar_19; - tmpvar_19.w = 1.0; - tmpvar_19.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_20; - tmpvar_20 = ((_World2Object * tmpvar_19).xyz * unity_Scale.w); - objSpaceCameraPos_18 = tmpvar_20; - return (objSpaceCameraPos_18 - v_17.xyz); -} - -v2f_surf vert_surf ( - in appdata_full v_21 -) -{ - vec3 viewRefl_22; - vec3 viewDir_23; - v2f_surf o_24; - PositionFog (v_21.vertex, o_24.pos, o_24.fog); - vec3 tmpvar_25; - tmpvar_25 = ObjSpaceViewDir (v_21.vertex); - vec3 tmpvar_26; - tmpvar_26 = -(tmpvar_25); - viewDir_23 = tmpvar_26; - vec3 tmpvar_27; - tmpvar_27 = reflect (viewDir_23, v_21.normal); - vec3 tmpvar_28; - tmpvar_28 = tmpvar_27; - viewRefl_22 = tmpvar_28; - mat3 tmpvar_29; - tmpvar_29 = xll_constructMat3 (_Object2World); - vec3 tmpvar_30; - tmpvar_30 = (tmpvar_29 * viewRefl_22); - o_24.worldRefl = tmpvar_30; - mat3 tmpvar_31; - tmpvar_31 = xll_constructMat3 (_Object2World); - vec3 tmpvar_32; - tmpvar_32 = (tmpvar_31 * (v_21.normal * unity_Scale.w)); - o_24.normal = tmpvar_32; - vec3 tmpvar_33; - tmpvar_33 = WorldSpaceLightDir (v_21.vertex); - vec3 tmpvar_34; - tmpvar_34 = tmpvar_33; - o_24.lightDir = tmpvar_34; - return o_24; -} - -void main () -{ - appdata_full xlt_v_35; - v2f_surf xl_retval_36; - vec4 tmpvar_37; - tmpvar_37 = gl_Vertex.xyzw; - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlt_v_35.vertex = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = TANGENT.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_v_35.tangent = tmpvar_40; - vec3 tmpvar_41; - tmpvar_41 = gl_Normal.xyz; - vec3 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_v_35.normal = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_v_35.texcoord = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_v_35.texcoord1 = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = gl_Color.xyzw; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_v_35.color = tmpvar_48; - v2f_surf tmpvar_49; - tmpvar_49 = vert_surf (xlt_v_35); - v2f_surf tmpvar_50; - tmpvar_50 = tmpvar_49; - xl_retval_36 = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = xl_retval_36.pos.xyzw; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - gl_Position = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_53.x = xl_retval_36.fog; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - xlv_FOG = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55.w = 0.0; - tmpvar_55.xyz = xl_retval_36.worldRefl.xyz; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - gl_TexCoord[0] = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57.w = 0.0; - tmpvar_57.xyz = xl_retval_36.normal.xyz; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - gl_TexCoord[1] = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59.w = 0.0; - tmpvar_59.xyz = xl_retval_36.lightDir.xyz; - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - gl_TexCoord[2] = tmpvar_60; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-out.txt index ed1f25362..94ad7f123 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-out.txt @@ -6,13 +6,13 @@ uniform vec4 unity_Scale; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); - vec4 tmpvar_2; - tmpvar_2.w = 1.0; - tmpvar_2.xyz = _WorldSpaceCameraPos; - vec3 tmpvar_3; - tmpvar_3 = (gl_Vertex.xyz - ((_World2Object * tmpvar_2).xyz * unity_Scale.w)); + vec3 viewDir_1; + vec4 pos_2; + pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 tmpvar_3; + tmpvar_3.w = 1.0; + tmpvar_3.xyz = _WorldSpaceCameraPos; + viewDir_1 = (gl_Vertex.xyz - ((_World2Object * tmpvar_3).xyz * unity_Scale.w)); mat3 tmpvar_4; tmpvar_4[0] = _Object2World[0].xyz; tmpvar_4[1] = _Object2World[1].xyz; @@ -21,15 +21,15 @@ void main () tmpvar_5[0] = _Object2World[0].xyz; tmpvar_5[1] = _Object2World[1].xyz; tmpvar_5[2] = _Object2World[2].xyz; - gl_Position = tmpvar_1; + gl_Position = pos_2; vec4 tmpvar_6; tmpvar_6.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_6.x = tmpvar_1.z; + tmpvar_6.x = pos_2.z; xlv_FOG = tmpvar_6; vec4 tmpvar_7; tmpvar_7.w = 0.0; - tmpvar_7.xyz = (tmpvar_4 * (tmpvar_3 - (2.0 * - (dot (gl_Normal, tmpvar_3) * gl_Normal) + tmpvar_7.xyz = (tmpvar_4 * (viewDir_1 - (2.0 * + (dot (gl_Normal, viewDir_1) * gl_Normal) ))); gl_TexCoord[0] = tmpvar_7; vec4 tmpvar_8; @@ -43,4 +43,14 @@ void main () } -// inputs: 2, stats: 16 alu 0 tex 0 flow +// stats: 16 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_Normal (high float) 3x1 [-1] loc 2 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 6 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _Object2World (high float) 4x4 [-1] +// #2: _World2Object (high float) 4x4 [-1] +// #3: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #4: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #5: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl1-ir.txt deleted file mode 100644 index f4a15b02e..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl1-ir.txt +++ /dev/null @@ -1,104 +0,0 @@ -struct v2f_surf { - vec4 pos; - vec3 normal; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -attribute vec4 TANGENT; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -v2f_surf vert_surf ( - in appdata_full v_9 -) -{ - v2f_surf o_10; - vec4 tmpvar_11; - tmpvar_11 = (gl_ModelViewProjectionMatrix * v_9.vertex); - o_10.pos = tmpvar_11; - mat3 tmpvar_12; - tmpvar_12 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose); - vec3 tmpvar_13; - tmpvar_13 = (tmpvar_12 * v_9.normal); - o_10.normal = tmpvar_13; - return o_10; -} - -void main () -{ - appdata_full xlt_v_14; - v2f_surf xl_retval_15; - vec4 tmpvar_16; - tmpvar_16 = gl_Vertex.xyzw; - vec4 tmpvar_17; - tmpvar_17 = tmpvar_16; - xlt_v_14.vertex = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = TANGENT.xyzw; - vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - xlt_v_14.tangent = tmpvar_19; - vec3 tmpvar_20; - tmpvar_20 = gl_Normal.xyz; - vec3 tmpvar_21; - tmpvar_21 = tmpvar_20; - xlt_v_14.normal = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - xlt_v_14.texcoord = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_25; - tmpvar_25 = tmpvar_24; - xlt_v_14.texcoord1 = tmpvar_25; - vec4 tmpvar_26; - tmpvar_26 = gl_Color.xyzw; - vec4 tmpvar_27; - tmpvar_27 = tmpvar_26; - xlt_v_14.color = tmpvar_27; - v2f_surf tmpvar_28; - tmpvar_28 = vert_surf (xlt_v_14); - v2f_surf tmpvar_29; - tmpvar_29 = tmpvar_28; - xl_retval_15 = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = xl_retval_15.pos.xyzw; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - gl_Position = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32.w = 0.0; - tmpvar_32.xyz = xl_retval_15.normal.xyz; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - gl_TexCoord[0] = tmpvar_33; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl1-out.txt index 9b51150cc..d87780097 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl1-out.txt @@ -12,4 +12,10 @@ void main () } -// inputs: 2, stats: 3 alu 0 tex 0 flow +// stats: 3 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_Normal (high float) 3x1 [-1] loc 2 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 2 (total size: 0) +// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] +// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Test_CgNormals-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Test_CgNormals-ir.txt deleted file mode 100644 index a769709e6..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Test_CgNormals-ir.txt +++ /dev/null @@ -1,91 +0,0 @@ -struct v2f { - vec4 pos; - vec4 color; -}; -struct appdata_base { - vec4 vertex; - vec3 normal; - vec4 texcoord; -}; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -v2f vert ( - in appdata_base v_9 -) -{ - vec3 normal_10; - v2f o_11; - vec4 tmpvar_12; - tmpvar_12 = (gl_ModelViewProjectionMatrix * v_9.vertex); - o_11.pos = tmpvar_12; - mat3 tmpvar_13; - tmpvar_13 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose); - vec3 tmpvar_14; - tmpvar_14 = (tmpvar_13 * v_9.normal); - normal_10 = tmpvar_14; - vec4 tmpvar_15; - tmpvar_15.w = 1.0; - tmpvar_15.xyz = ((normal_10 * 0.5) + 0.5).xyz; - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - o_11.color = tmpvar_16; - return o_11; -} - -void main () -{ - appdata_base xlt_v_17; - v2f xl_retval_18; - vec4 tmpvar_19; - tmpvar_19 = gl_Vertex.xyzw; - vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - xlt_v_17.vertex = tmpvar_20; - vec3 tmpvar_21; - tmpvar_21 = gl_Normal.xyz; - vec3 tmpvar_22; - tmpvar_22 = tmpvar_21; - xlt_v_17.normal = tmpvar_22; - vec4 tmpvar_23; - tmpvar_23 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_24; - tmpvar_24 = tmpvar_23; - xlt_v_17.texcoord = tmpvar_24; - v2f tmpvar_25; - tmpvar_25 = vert (xlt_v_17); - v2f tmpvar_26; - tmpvar_26 = tmpvar_25; - xl_retval_18 = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = xl_retval_18.pos.xyzw; - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - gl_Position = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = xl_retval_18.color.xyzw; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - gl_FrontColor = tmpvar_30; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Test_CgNormals-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Test_CgNormals-out.txt index e6140fa0f..8e85c479d 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Test_CgNormals-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Test_CgNormals-out.txt @@ -12,4 +12,10 @@ void main () } -// inputs: 2, stats: 5 alu 0 tex 0 flow +// stats: 5 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_Normal (high float) 3x1 [-1] loc 2 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 2 (total size: 0) +// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] +// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderDepthTexture-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderDepthTexture-ir.txt deleted file mode 100644 index b0cddc3e7..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderDepthTexture-ir.txt +++ /dev/null @@ -1,83 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; -}; -struct appdata_base { - vec4 vertex; - vec3 normal; - vec4 texcoord; -}; -uniform sampler2D _CameraDepthTexture; -vec4 xll_tex2Dlod ( - in sampler2D s_1, - in vec4 coord_2 -) -{ - vec4 tmpvar_3; - tmpvar_3 = texture2DLod (s_1, coord_2.xy, coord_2.w); - return tmpvar_3; -} - -v2f vert ( - in appdata_base v_4 -) -{ - v2f o_5; - float tex_6; - vec4 tmpvar_7; - tmpvar_7.zw = vec2(0.0, 0.0); - tmpvar_7.xy = v_4.texcoord.xy.xy; - vec4 tmpvar_8; - tmpvar_8 = xll_tex2Dlod (_CameraDepthTexture, tmpvar_7); - float tmpvar_9; - tmpvar_9 = tmpvar_8.x; - tex_6 = tmpvar_9; - float tmpvar_10; - tmpvar_10 = (v_4.vertex.y + ((1.0 - tex_6) * 3.0)); - v_4.vertex.y = vec2(tmpvar_10).y; - vec4 tmpvar_11; - tmpvar_11 = (gl_ModelViewProjectionMatrix * v_4.vertex); - o_5.pos = tmpvar_11; - vec2 tmpvar_12; - tmpvar_12 = v_4.texcoord.xy; - o_5.uv = tmpvar_12; - return o_5; -} - -void main () -{ - appdata_base xlt_v_13; - v2f xl_retval_14; - vec4 tmpvar_15; - tmpvar_15 = gl_Vertex.xyzw; - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - xlt_v_13.vertex = tmpvar_16; - vec3 tmpvar_17; - tmpvar_17 = gl_Normal.xyz; - vec3 tmpvar_18; - tmpvar_18 = tmpvar_17; - xlt_v_13.normal = tmpvar_18; - vec4 tmpvar_19; - tmpvar_19 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - xlt_v_13.texcoord = tmpvar_20; - v2f tmpvar_21; - tmpvar_21 = vert (xlt_v_13); - v2f tmpvar_22; - tmpvar_22 = tmpvar_21; - xl_retval_14 = tmpvar_22; - vec4 tmpvar_23; - tmpvar_23 = xl_retval_14.pos.xyzw; - vec4 tmpvar_24; - tmpvar_24 = tmpvar_23; - gl_Position = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25.zw = vec2(0.0, 0.0); - tmpvar_25.xy = xl_retval_14.uv.xy; - vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; - gl_TexCoord[0] = tmpvar_26; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderDepthTexture-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderDepthTexture-out.txt index 47e13aeb5..424b7a36d 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderDepthTexture-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderDepthTexture-out.txt @@ -12,4 +12,11 @@ void main () } -// inputs: 2, stats: 5 alu 1 tex 0 flow +// stats: 5 alu 1 tex 0 flow +// inputs: 2 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 1 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// textures: 1 +// #0: _CameraDepthTexture (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderTexture-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderTexture-ir.txt deleted file mode 100644 index 181e337f2..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderTexture-ir.txt +++ /dev/null @@ -1,83 +0,0 @@ -struct v2f { - vec4 pos; - vec2 uv; -}; -struct appdata_base { - vec4 vertex; - vec3 normal; - vec4 texcoord; -}; -uniform sampler2D _MainTex; -vec4 xll_tex2Dlod ( - in sampler2D s_1, - in vec4 coord_2 -) -{ - vec4 tmpvar_3; - tmpvar_3 = texture2DLod (s_1, coord_2.xy, coord_2.w); - return tmpvar_3; -} - -v2f vert ( - in appdata_base v_4 -) -{ - v2f o_5; - vec4 tex_6; - vec4 tmpvar_7; - tmpvar_7.zw = vec2(0.0, 0.0); - tmpvar_7.xy = v_4.texcoord.xy.xy; - vec4 tmpvar_8; - tmpvar_8 = xll_tex2Dlod (_MainTex, tmpvar_7); - vec4 tmpvar_9; - tmpvar_9 = tmpvar_8; - tex_6 = tmpvar_9; - float tmpvar_10; - tmpvar_10 = (v_4.vertex.y + (tex_6.x * 2.0)); - v_4.vertex.y = vec2(tmpvar_10).y; - vec4 tmpvar_11; - tmpvar_11 = (gl_ModelViewProjectionMatrix * v_4.vertex); - o_5.pos = tmpvar_11; - vec2 tmpvar_12; - tmpvar_12 = v_4.texcoord.xy; - o_5.uv = tmpvar_12; - return o_5; -} - -void main () -{ - appdata_base xlt_v_13; - v2f xl_retval_14; - vec4 tmpvar_15; - tmpvar_15 = gl_Vertex.xyzw; - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - xlt_v_13.vertex = tmpvar_16; - vec3 tmpvar_17; - tmpvar_17 = gl_Normal.xyz; - vec3 tmpvar_18; - tmpvar_18 = tmpvar_17; - xlt_v_13.normal = tmpvar_18; - vec4 tmpvar_19; - tmpvar_19 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - xlt_v_13.texcoord = tmpvar_20; - v2f tmpvar_21; - tmpvar_21 = vert (xlt_v_13); - v2f tmpvar_22; - tmpvar_22 = tmpvar_21; - xl_retval_14 = tmpvar_22; - vec4 tmpvar_23; - tmpvar_23 = xl_retval_14.pos.xyzw; - vec4 tmpvar_24; - tmpvar_24 = tmpvar_23; - gl_Position = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25.zw = vec2(0.0, 0.0); - tmpvar_25.xy = xl_retval_14.uv.xy; - vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; - gl_TexCoord[0] = tmpvar_26; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderTexture-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderTexture-out.txt index 1ff76b834..dca4fac01 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderTexture-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderTexture-out.txt @@ -12,4 +12,11 @@ void main () } -// inputs: 2, stats: 4 alu 1 tex 0 flow +// stats: 4 alu 1 tex 0 flow +// inputs: 2 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 1 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// textures: 1 +// #0: _MainTex (high 2d) 0x0 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-ir.txt deleted file mode 100644 index 5638731df..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-ir.txt +++ /dev/null @@ -1,104 +0,0 @@ -struct v2f { - vec4 vertex; - vec4 color; - vec3 texcoord; -}; -struct appdata_t { - vec4 vertex; - vec4 color; - vec3 normal; -}; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 unity_Scale; -vec3 ObjSpaceViewDir ( - in vec4 v_1 -) -{ - vec3 objSpaceCameraPos_2; - vec4 tmpvar_3; - tmpvar_3.w = 1.0; - tmpvar_3.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_4; - tmpvar_4 = ((_World2Object * tmpvar_3).xyz * unity_Scale.w); - objSpaceCameraPos_2 = tmpvar_4; - return (objSpaceCameraPos_2 - v_1.xyz); -} - -v2f vert ( - in appdata_t v_5 -) -{ - vec3 viewDir_6; - v2f o_7; - vec4 tmpvar_8; - tmpvar_8 = (gl_ModelViewProjectionMatrix * v_5.vertex); - o_7.vertex = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = ObjSpaceViewDir (v_5.vertex); - vec3 tmpvar_10; - tmpvar_10 = normalize (tmpvar_9); - vec3 tmpvar_11; - tmpvar_11 = -(tmpvar_10); - viewDir_6 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = reflect (viewDir_6, v_5.normal); - vec3 tmpvar_13; - tmpvar_13 = tmpvar_12; - o_7.texcoord = tmpvar_13; - vec4 tmpvar_14; - tmpvar_14.w = 0.0; - tmpvar_14.xyz = o_7.texcoord.xyz; - vec3 tmpvar_15; - tmpvar_15 = (gl_ModelViewMatrix * tmpvar_14).xyz; - vec3 tmpvar_16; - tmpvar_16 = tmpvar_15; - o_7.texcoord = tmpvar_16; - vec4 tmpvar_17; - tmpvar_17 = v_5.color; - o_7.color = tmpvar_17; - return o_7; -} - -void main () -{ - appdata_t xlt_v_18; - v2f xl_retval_19; - vec4 tmpvar_20; - tmpvar_20 = gl_Vertex.xyzw; - vec4 tmpvar_21; - tmpvar_21 = tmpvar_20; - xlt_v_18.vertex = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22 = gl_Color.xyzw; - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - xlt_v_18.color = tmpvar_23; - vec3 tmpvar_24; - tmpvar_24 = gl_Normal.xyz; - vec3 tmpvar_25; - tmpvar_25 = tmpvar_24; - xlt_v_18.normal = tmpvar_25; - v2f tmpvar_26; - tmpvar_26 = vert (xlt_v_18); - v2f tmpvar_27; - tmpvar_27 = tmpvar_26; - xl_retval_19 = tmpvar_27; - vec4 tmpvar_28; - tmpvar_28 = xl_retval_19.vertex.xyzw; - vec4 tmpvar_29; - tmpvar_29 = tmpvar_28; - gl_Position = tmpvar_29; - vec4 tmpvar_30; - tmpvar_30 = xl_retval_19.color.xyzw; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - gl_FrontColor = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32.w = 0.0; - tmpvar_32.xyz = xl_retval_19.texcoord.xyz; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - gl_TexCoord[0] = tmpvar_33; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-out.txt index 2df96c608..259a2c8b4 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-out.txt @@ -3,17 +3,17 @@ uniform vec3 _WorldSpaceCameraPos; uniform vec4 unity_Scale; void main () { - vec4 tmpvar_1; - tmpvar_1.w = 1.0; - tmpvar_1.xyz = _WorldSpaceCameraPos; - vec3 tmpvar_2; - tmpvar_2 = -(normalize(( - ((_World2Object * tmpvar_1).xyz * unity_Scale.w) + vec3 viewDir_1; + vec4 tmpvar_2; + tmpvar_2.w = 1.0; + tmpvar_2.xyz = _WorldSpaceCameraPos; + viewDir_1 = -(normalize(( + ((_World2Object * tmpvar_2).xyz * unity_Scale.w) - gl_Vertex.xyz))); vec4 tmpvar_3; tmpvar_3.w = 0.0; - tmpvar_3.xyz = (tmpvar_2 - (2.0 * ( - dot (gl_Normal, tmpvar_2) + tmpvar_3.xyz = (viewDir_1 - (2.0 * ( + dot (gl_Normal, viewDir_1) * gl_Normal))); gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); gl_FrontColor = gl_Color; @@ -24,4 +24,14 @@ void main () } -// inputs: 3, stats: 14 alu 0 tex 0 flow +// stats: 14 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_Color (high float) 4x1 [-1] loc 3 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 5 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: gl_ModelViewMatrix (high float) 4x4 [-1] +// #2: _World2Object (high float) 4x4 [-1] +// #3: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #4: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Toon_Basic-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Toon_Basic-ir.txt deleted file mode 100644 index 186cd8011..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Toon_Basic-ir.txt +++ /dev/null @@ -1,76 +0,0 @@ -struct v2f { - vec4 pos; - vec2 texcoord; - vec3 cubenormal; -}; -struct appdata { - vec4 vertex; - vec2 texcoord; - vec3 normal; -}; -uniform vec4 _MainTex_ST; -v2f vert ( - in appdata v_1 -) -{ - v2f o_2; - vec4 tmpvar_3; - tmpvar_3 = (gl_ModelViewProjectionMatrix * v_1.vertex); - o_2.pos = tmpvar_3; - vec2 tmpvar_4; - tmpvar_4 = ((v_1.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_2.texcoord = tmpvar_4; - vec4 tmpvar_5; - tmpvar_5.w = 0.0; - tmpvar_5.xyz = v_1.normal.xyz; - vec3 tmpvar_6; - tmpvar_6 = (gl_ModelViewMatrix * tmpvar_5).xyz; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_6; - o_2.cubenormal = tmpvar_7; - return o_2; -} - -void main () -{ - appdata xlt_v_8; - v2f xl_retval_9; - vec4 tmpvar_10; - tmpvar_10 = gl_Vertex.xyzw; - vec4 tmpvar_11; - tmpvar_11 = tmpvar_10; - xlt_v_8.vertex = tmpvar_11; - vec2 tmpvar_12; - tmpvar_12 = gl_MultiTexCoord0.xy; - vec2 tmpvar_13; - tmpvar_13 = tmpvar_12; - xlt_v_8.texcoord = tmpvar_13; - vec3 tmpvar_14; - tmpvar_14 = gl_Normal.xyz; - vec3 tmpvar_15; - tmpvar_15 = tmpvar_14; - xlt_v_8.normal = tmpvar_15; - v2f tmpvar_16; - tmpvar_16 = vert (xlt_v_8); - v2f tmpvar_17; - tmpvar_17 = tmpvar_16; - xl_retval_9 = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18 = xl_retval_9.pos.xyzw; - vec4 tmpvar_19; - tmpvar_19 = tmpvar_18; - gl_Position = tmpvar_19; - vec4 tmpvar_20; - tmpvar_20.zw = vec2(0.0, 0.0); - tmpvar_20.xy = xl_retval_9.texcoord.xy; - vec4 tmpvar_21; - tmpvar_21 = tmpvar_20; - gl_TexCoord[0] = tmpvar_21; - vec4 tmpvar_22; - tmpvar_22.w = 0.0; - tmpvar_22.xyz = xl_retval_9.cubenormal.xyz; - vec4 tmpvar_23; - tmpvar_23 = tmpvar_22; - gl_TexCoord[1] = tmpvar_23; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Toon_Basic-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Toon_Basic-out.txt index 431e0d7c8..fca4052fa 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Toon_Basic-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Toon_Basic-out.txt @@ -16,4 +16,12 @@ void main () } -// inputs: 3, stats: 7 alu 0 tex 0 flow +// stats: 7 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 3 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: gl_ModelViewMatrix (high float) 4x4 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-ir.txt deleted file mode 100644 index 54759a7fb..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-ir.txt +++ /dev/null @@ -1,206 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 lightDir; - vec3 viewDir; - vec3 _LightCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _BumpMap_ST; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_6 -) -{ - vec3 objSpaceCameraPos_7; - vec4 tmpvar_8; - tmpvar_8.w = 1.0; - tmpvar_8.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_9; - tmpvar_9 = ((_World2Object * tmpvar_8).xyz * unity_Scale.w); - objSpaceCameraPos_7 = tmpvar_9; - return (objSpaceCameraPos_7 - v_6.xyz); -} - -vec3 ObjSpaceLightDir ( - in vec4 v_10 -) -{ - vec3 objSpaceLightPos_11; - vec3 tmpvar_12; - tmpvar_12 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_11 = tmpvar_12; - return ((objSpaceLightPos_11.xyz * unity_Scale.w) - v_10.xyz); -} - -v2f_surf vert_surf ( - in appdata_full v_13 -) -{ - mat3 rotation_14; - vec3 binormal_15; - v2f_surf o_16; - PositionFog (v_13.vertex, o_16.pos, o_16.fog); - vec2 tmpvar_17; - tmpvar_17 = ((v_13.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_16.hip_pack0.xy = tmpvar_17.xy.xy; - vec2 tmpvar_18; - tmpvar_18 = ((v_13.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_16.hip_pack0.zw = tmpvar_18.xxxy.zw; - vec3 tmpvar_19; - tmpvar_19 = cross (v_13.normal, v_13.tangent.xyz); - vec3 tmpvar_20; - tmpvar_20 = (tmpvar_19 * v_13.tangent.w); - binormal_15 = tmpvar_20; - mat3 tmpvar_21; - float tmpvar_22; - tmpvar_22 = v_13.tangent.x; - tmpvar_21[0].x = tmpvar_22; - float tmpvar_23; - tmpvar_23 = binormal_15.x; - tmpvar_21[0].y = tmpvar_23; - float tmpvar_24; - tmpvar_24 = v_13.normal.x; - tmpvar_21[0].z = tmpvar_24; - float tmpvar_25; - tmpvar_25 = v_13.tangent.y; - tmpvar_21[1].x = tmpvar_25; - float tmpvar_26; - tmpvar_26 = binormal_15.y; - tmpvar_21[1].y = tmpvar_26; - float tmpvar_27; - tmpvar_27 = v_13.normal.y; - tmpvar_21[1].z = tmpvar_27; - float tmpvar_28; - tmpvar_28 = v_13.tangent.z; - tmpvar_21[2].x = tmpvar_28; - float tmpvar_29; - tmpvar_29 = binormal_15.z; - tmpvar_21[2].y = tmpvar_29; - float tmpvar_30; - tmpvar_30 = v_13.normal.z; - tmpvar_21[2].z = tmpvar_30; - mat3 tmpvar_31; - tmpvar_31 = tmpvar_21; - rotation_14 = tmpvar_31; - vec3 tmpvar_32; - tmpvar_32 = ObjSpaceLightDir (v_13.vertex); - vec3 tmpvar_33; - tmpvar_33 = (rotation_14 * tmpvar_32); - o_16.lightDir = tmpvar_33; - vec3 tmpvar_34; - tmpvar_34 = ObjSpaceViewDir (v_13.vertex); - vec3 tmpvar_35; - tmpvar_35 = (rotation_14 * tmpvar_34); - o_16.viewDir = tmpvar_35; - vec3 tmpvar_36; - tmpvar_36 = (_LightMatrix0 * (_Object2World * v_13.vertex)).xyz; - o_16._LightCoord = tmpvar_36; - return o_16; -} - -void main () -{ - appdata_full xlt_v_37; - v2f_surf xl_retval_38; - vec4 tmpvar_39; - tmpvar_39 = gl_Vertex.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_v_37.vertex = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = TANGENT.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_v_37.tangent = tmpvar_42; - vec3 tmpvar_43; - tmpvar_43 = gl_Normal.xyz; - vec3 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_v_37.normal = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_v_37.texcoord = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_v_37.texcoord1 = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49 = gl_Color.xyzw; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - xlt_v_37.color = tmpvar_50; - v2f_surf tmpvar_51; - tmpvar_51 = vert_surf (xlt_v_37); - v2f_surf tmpvar_52; - tmpvar_52 = tmpvar_51; - xl_retval_38 = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = xl_retval_38.pos.xyzw; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - gl_Position = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_55.x = xl_retval_38.fog; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - xlv_FOG = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57 = xl_retval_38.hip_pack0.xyzw; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - gl_TexCoord[0] = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59.w = 0.0; - tmpvar_59.xyz = xl_retval_38.lightDir.xyz; - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - gl_TexCoord[1] = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61.w = 0.0; - tmpvar_61.xyz = xl_retval_38.viewDir.xyz; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - gl_TexCoord[2] = tmpvar_62; - vec4 tmpvar_63; - tmpvar_63.w = 0.0; - tmpvar_63.xyz = xl_retval_38._LightCoord.xyz; - vec4 tmpvar_64; - tmpvar_64 = tmpvar_63; - gl_TexCoord[3] = tmpvar_64; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-out.txt index 9bf1599ee..d566b0fe2 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-out.txt @@ -10,32 +10,32 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; + vec3 binormal_1; vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); - tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - vec3 tmpvar_3; - tmpvar_3 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + vec4 pos_3; + pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_4; tmpvar_4[0].x = TANGENT.x; - tmpvar_4[0].y = tmpvar_3.x; + tmpvar_4[0].y = binormal_1.x; tmpvar_4[0].z = gl_Normal.x; tmpvar_4[1].x = TANGENT.y; - tmpvar_4[1].y = tmpvar_3.y; + tmpvar_4[1].y = binormal_1.y; tmpvar_4[1].z = gl_Normal.y; tmpvar_4[2].x = TANGENT.z; - tmpvar_4[2].y = tmpvar_3.z; + tmpvar_4[2].y = binormal_1.z; tmpvar_4[2].z = gl_Normal.z; vec4 tmpvar_5; tmpvar_5.w = 1.0; tmpvar_5.xyz = _WorldSpaceCameraPos; - gl_Position = tmpvar_2; + gl_Position = pos_3; vec4 tmpvar_6; tmpvar_6.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_6.x = tmpvar_2.z; + tmpvar_6.x = pos_3.z; xlv_FOG = tmpvar_6; - gl_TexCoord[0] = tmpvar_1; + gl_TexCoord[0] = tmpvar_2; vec4 tmpvar_7; tmpvar_7.w = 0.0; tmpvar_7.xyz = (tmpvar_4 * (( @@ -55,4 +55,19 @@ void main () } -// inputs: 4, stats: 24 alu 0 tex 0 flow +// stats: 24 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 9 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _BumpMap_ST (high float) 4x1 [-1] +// #2: _LightMatrix0 (high float) 4x4 [-1] +// #3: _MainTex_ST (high float) 4x1 [-1] +// #4: _Object2World (high float) 4x4 [-1] +// #5: _World2Object (high float) 4x4 [-1] +// #6: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #7: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #8: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-ir.txt deleted file mode 100644 index 8c147cede..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-ir.txt +++ /dev/null @@ -1,166 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec4 hip_pack0; - vec3 lightDir; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _BumpMap_ST; -uniform vec4 _MainTex_ST; -uniform mat4 _World2Object; -uniform vec4 _WorldSpaceLightPos0; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec3 ObjSpaceLightDir ( - in vec4 v_6 -) -{ - vec3 objSpaceLightPos_7; - vec3 tmpvar_8; - tmpvar_8 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_7 = tmpvar_8; - return objSpaceLightPos_7.xyz; -} - -v2f_surf vert_surf ( - in appdata_full v_9 -) -{ - mat3 rotation_10; - vec3 binormal_11; - v2f_surf o_12; - PositionFog (v_9.vertex, o_12.pos, o_12.fog); - vec2 tmpvar_13; - tmpvar_13 = ((v_9.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_12.hip_pack0.xy = tmpvar_13.xy.xy; - vec2 tmpvar_14; - tmpvar_14 = ((v_9.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_12.hip_pack0.zw = tmpvar_14.xxxy.zw; - vec3 tmpvar_15; - tmpvar_15 = cross (v_9.normal, v_9.tangent.xyz); - vec3 tmpvar_16; - tmpvar_16 = (tmpvar_15 * v_9.tangent.w); - binormal_11 = tmpvar_16; - mat3 tmpvar_17; - float tmpvar_18; - tmpvar_18 = v_9.tangent.x; - tmpvar_17[0].x = tmpvar_18; - float tmpvar_19; - tmpvar_19 = binormal_11.x; - tmpvar_17[0].y = tmpvar_19; - float tmpvar_20; - tmpvar_20 = v_9.normal.x; - tmpvar_17[0].z = tmpvar_20; - float tmpvar_21; - tmpvar_21 = v_9.tangent.y; - tmpvar_17[1].x = tmpvar_21; - float tmpvar_22; - tmpvar_22 = binormal_11.y; - tmpvar_17[1].y = tmpvar_22; - float tmpvar_23; - tmpvar_23 = v_9.normal.y; - tmpvar_17[1].z = tmpvar_23; - float tmpvar_24; - tmpvar_24 = v_9.tangent.z; - tmpvar_17[2].x = tmpvar_24; - float tmpvar_25; - tmpvar_25 = binormal_11.z; - tmpvar_17[2].y = tmpvar_25; - float tmpvar_26; - tmpvar_26 = v_9.normal.z; - tmpvar_17[2].z = tmpvar_26; - mat3 tmpvar_27; - tmpvar_27 = tmpvar_17; - rotation_10 = tmpvar_27; - vec3 tmpvar_28; - tmpvar_28 = ObjSpaceLightDir (v_9.vertex); - vec3 tmpvar_29; - tmpvar_29 = (rotation_10 * tmpvar_28); - o_12.lightDir = tmpvar_29; - return o_12; -} - -void main () -{ - appdata_full xlt_v_30; - v2f_surf xl_retval_31; - vec4 tmpvar_32; - tmpvar_32 = gl_Vertex.xyzw; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - xlt_v_30.vertex = tmpvar_33; - vec4 tmpvar_34; - tmpvar_34 = TANGENT.xyzw; - vec4 tmpvar_35; - tmpvar_35 = tmpvar_34; - xlt_v_30.tangent = tmpvar_35; - vec3 tmpvar_36; - tmpvar_36 = gl_Normal.xyz; - vec3 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlt_v_30.normal = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - xlt_v_30.texcoord = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - xlt_v_30.texcoord1 = tmpvar_41; - vec4 tmpvar_42; - tmpvar_42 = gl_Color.xyzw; - vec4 tmpvar_43; - tmpvar_43 = tmpvar_42; - xlt_v_30.color = tmpvar_43; - v2f_surf tmpvar_44; - tmpvar_44 = vert_surf (xlt_v_30); - v2f_surf tmpvar_45; - tmpvar_45 = tmpvar_44; - xl_retval_31 = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46 = xl_retval_31.pos.xyzw; - vec4 tmpvar_47; - tmpvar_47 = tmpvar_46; - gl_Position = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_48.x = xl_retval_31.fog; - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - xlv_FOG = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50 = xl_retval_31.hip_pack0.xyzw; - vec4 tmpvar_51; - tmpvar_51 = tmpvar_50; - gl_TexCoord[0] = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52.w = 0.0; - tmpvar_52.xyz = xl_retval_31.lightDir.xyz; - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - gl_TexCoord[1] = tmpvar_53; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-out.txt index b902f3406..aae5c1a70 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-out.txt @@ -6,29 +6,29 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; + vec3 binormal_1; vec4 tmpvar_2; - tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); - tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - vec3 tmpvar_3; - tmpvar_3 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + vec4 pos_3; + pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_4; tmpvar_4[0].x = TANGENT.x; - tmpvar_4[0].y = tmpvar_3.x; + tmpvar_4[0].y = binormal_1.x; tmpvar_4[0].z = gl_Normal.x; tmpvar_4[1].x = TANGENT.y; - tmpvar_4[1].y = tmpvar_3.y; + tmpvar_4[1].y = binormal_1.y; tmpvar_4[1].z = gl_Normal.y; tmpvar_4[2].x = TANGENT.z; - tmpvar_4[2].y = tmpvar_3.z; + tmpvar_4[2].y = binormal_1.z; tmpvar_4[2].z = gl_Normal.z; - gl_Position = tmpvar_2; + gl_Position = pos_3; vec4 tmpvar_5; tmpvar_5.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_5.x = tmpvar_2.z; + tmpvar_5.x = pos_3.z; xlv_FOG = tmpvar_5; - gl_TexCoord[0] = tmpvar_1; + gl_TexCoord[0] = tmpvar_2; vec4 tmpvar_6; tmpvar_6.w = 0.0; tmpvar_6.xyz = (tmpvar_4 * (_World2Object * _WorldSpaceLightPos0).xyz); @@ -36,4 +36,15 @@ void main () } -// inputs: 4, stats: 13 alu 0 tex 0 flow +// stats: 13 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 5 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _BumpMap_ST (high float) 4x1 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _World2Object (high float) 4x4 [-1] +// #4: _WorldSpaceLightPos0 (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-ir.txt deleted file mode 100644 index 9afae106c..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-ir.txt +++ /dev/null @@ -1,132 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 hip_screen; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _MainTex_ST; -uniform vec4 _ProjectionParams; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec4 ComputeScreenPos ( - in vec4 pos_6 -) -{ - vec4 o_7; - vec4 tmpvar_8; - tmpvar_8 = (pos_6 * 0.5); - o_7 = tmpvar_8; - vec2 tmpvar_9; - tmpvar_9.x = o_7.x; - tmpvar_9.y = (o_7.y * _ProjectionParams.x); - vec2 tmpvar_10; - tmpvar_10 = (tmpvar_9 + o_7.w); - o_7.xy = tmpvar_10.xy.xy; - vec2 tmpvar_11; - tmpvar_11 = pos_6.zw; - o_7.zw = tmpvar_11.xxxy.zw; - return o_7; -} - -v2f_surf vert_surf ( - in appdata_full v_12 -) -{ - v2f_surf o_13; - PositionFog (v_12.vertex, o_13.pos, o_13.fog); - vec2 tmpvar_14; - tmpvar_14 = ((v_12.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_13.hip_pack0 = tmpvar_14.xy.xy; - vec4 tmpvar_15; - tmpvar_15 = ComputeScreenPos (o_13.pos); - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - o_13.hip_screen = tmpvar_16; - return o_13; -} - -void main () -{ - appdata_full xlt_v_17; - v2f_surf xl_retval_18; - vec4 tmpvar_19; - tmpvar_19 = gl_Vertex.xyzw; - vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - xlt_v_17.vertex = tmpvar_20; - vec4 tmpvar_21; - tmpvar_21 = TANGENT.xyzw; - vec4 tmpvar_22; - tmpvar_22 = tmpvar_21; - xlt_v_17.tangent = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = gl_Normal.xyz; - vec3 tmpvar_24; - tmpvar_24 = tmpvar_23; - xlt_v_17.normal = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; - xlt_v_17.texcoord = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - xlt_v_17.texcoord1 = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = gl_Color.xyzw; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - xlt_v_17.color = tmpvar_30; - v2f_surf tmpvar_31; - tmpvar_31 = vert_surf (xlt_v_17); - v2f_surf tmpvar_32; - tmpvar_32 = tmpvar_31; - xl_retval_18 = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = xl_retval_18.pos.xyzw; - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - gl_Position = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_35.x = xl_retval_18.fog; - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlv_FOG = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37.zw = vec2(0.0, 0.0); - tmpvar_37.xy = xl_retval_18.hip_pack0.xy; - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - gl_TexCoord[0] = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = xl_retval_18.hip_screen.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - gl_TexCoord[1] = tmpvar_40; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt index 5f8bfc54f..d66048d59 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt @@ -3,27 +3,33 @@ uniform vec4 _ProjectionParams; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_1; + pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); vec4 o_2; - vec4 tmpvar_3; - tmpvar_3 = (tmpvar_1 * 0.5); - vec2 tmpvar_4; - tmpvar_4.x = tmpvar_3.x; - tmpvar_4.y = (tmpvar_3.y * _ProjectionParams.x); - o_2.xy = (tmpvar_4 + tmpvar_3.w); - o_2.zw = tmpvar_1.zw; - gl_Position = tmpvar_1; + o_2 = (pos_1 * 0.5); + vec2 tmpvar_3; + tmpvar_3.x = o_2.x; + tmpvar_3.y = (o_2.y * _ProjectionParams.x); + o_2.xy = (tmpvar_3 + o_2.w); + o_2.zw = pos_1.zw; + gl_Position = pos_1; + vec4 tmpvar_4; + tmpvar_4.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_4.x = pos_1.z; + xlv_FOG = tmpvar_4; vec4 tmpvar_5; - tmpvar_5.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_5.x = tmpvar_1.z; - xlv_FOG = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6.zw = vec2(0.0, 0.0); - tmpvar_6.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_6; + tmpvar_5.zw = vec2(0.0, 0.0); + tmpvar_5.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_5; gl_TexCoord[1] = o_2; } -// inputs: 2, stats: 8 alu 0 tex 0 flow +// stats: 8 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 3 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _MainTex_ST (high float) 4x1 [-1] +// #2: _ProjectionParams (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-ir.txt deleted file mode 100644 index 62ff8c157..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-ir.txt +++ /dev/null @@ -1,180 +0,0 @@ -struct v2f_surf { - vec4 pos; - vec4 hip_pack0; - vec3 TtoV0; - vec3 TtoV1; - vec3 TtoV2; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _BumpMap_ST; -uniform vec4 _MainTex_ST; -attribute vec4 TANGENT; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -v2f_surf vert_surf ( - in appdata_full v_9 -) -{ - mat3 rotation_10; - vec3 binormal_11; - v2f_surf o_12; - vec4 tmpvar_13; - tmpvar_13 = (gl_ModelViewProjectionMatrix * v_9.vertex); - o_12.pos = tmpvar_13; - vec2 tmpvar_14; - tmpvar_14 = ((v_9.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_12.hip_pack0.xy = tmpvar_14.xy.xy; - vec2 tmpvar_15; - tmpvar_15 = ((v_9.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - o_12.hip_pack0.zw = tmpvar_15.xxxy.zw; - vec3 tmpvar_16; - tmpvar_16 = cross (v_9.normal, v_9.tangent.xyz); - vec3 tmpvar_17; - tmpvar_17 = (tmpvar_16 * v_9.tangent.w); - binormal_11 = tmpvar_17; - mat3 tmpvar_18; - float tmpvar_19; - tmpvar_19 = v_9.tangent.x; - tmpvar_18[0].x = tmpvar_19; - float tmpvar_20; - tmpvar_20 = binormal_11.x; - tmpvar_18[0].y = tmpvar_20; - float tmpvar_21; - tmpvar_21 = v_9.normal.x; - tmpvar_18[0].z = tmpvar_21; - float tmpvar_22; - tmpvar_22 = v_9.tangent.y; - tmpvar_18[1].x = tmpvar_22; - float tmpvar_23; - tmpvar_23 = binormal_11.y; - tmpvar_18[1].y = tmpvar_23; - float tmpvar_24; - tmpvar_24 = v_9.normal.y; - tmpvar_18[1].z = tmpvar_24; - float tmpvar_25; - tmpvar_25 = v_9.tangent.z; - tmpvar_18[2].x = tmpvar_25; - float tmpvar_26; - tmpvar_26 = binormal_11.z; - tmpvar_18[2].y = tmpvar_26; - float tmpvar_27; - tmpvar_27 = v_9.normal.z; - tmpvar_18[2].z = tmpvar_27; - mat3 tmpvar_28; - tmpvar_28 = tmpvar_18; - rotation_10 = tmpvar_28; - mat3 tmpvar_29; - tmpvar_29 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose); - vec3 tmpvar_30; - tmpvar_30 = (rotation_10 * tmpvar_29[0].xyz); - o_12.TtoV0 = tmpvar_30; - mat3 tmpvar_31; - tmpvar_31 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose); - vec3 tmpvar_32; - tmpvar_32 = (rotation_10 * tmpvar_31[1].xyz); - o_12.TtoV1 = tmpvar_32; - mat3 tmpvar_33; - tmpvar_33 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose); - vec3 tmpvar_34; - tmpvar_34 = (rotation_10 * tmpvar_33[2].xyz); - o_12.TtoV2 = tmpvar_34; - return o_12; -} - -void main () -{ - appdata_full xlt_v_35; - v2f_surf xl_retval_36; - vec4 tmpvar_37; - tmpvar_37 = gl_Vertex.xyzw; - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlt_v_35.vertex = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = TANGENT.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_v_35.tangent = tmpvar_40; - vec3 tmpvar_41; - tmpvar_41 = gl_Normal.xyz; - vec3 tmpvar_42; - tmpvar_42 = tmpvar_41; - xlt_v_35.normal = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlt_v_35.texcoord = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlt_v_35.texcoord1 = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = gl_Color.xyzw; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - xlt_v_35.color = tmpvar_48; - v2f_surf tmpvar_49; - tmpvar_49 = vert_surf (xlt_v_35); - v2f_surf tmpvar_50; - tmpvar_50 = tmpvar_49; - xl_retval_36 = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = xl_retval_36.pos.xyzw; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - gl_Position = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53 = xl_retval_36.hip_pack0.xyzw; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - gl_TexCoord[0] = tmpvar_54; - vec4 tmpvar_55; - tmpvar_55.w = 0.0; - tmpvar_55.xyz = xl_retval_36.TtoV0.xyz; - vec4 tmpvar_56; - tmpvar_56 = tmpvar_55; - gl_TexCoord[1] = tmpvar_56; - vec4 tmpvar_57; - tmpvar_57.w = 0.0; - tmpvar_57.xyz = xl_retval_36.TtoV1.xyz; - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - gl_TexCoord[2] = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59.w = 0.0; - tmpvar_59.xyz = xl_retval_36.TtoV2.xyz; - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - gl_TexCoord[3] = tmpvar_60; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-out.txt index 8a617abb5..725a323c1 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-out.txt @@ -3,23 +3,23 @@ uniform vec4 _MainTex_ST; attribute vec4 TANGENT; void main () { - vec4 tmpvar_1; - tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); - vec3 tmpvar_2; - tmpvar_2 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); + vec3 binormal_1; + vec4 tmpvar_2; + tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); + binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_3; tmpvar_3[0].x = TANGENT.x; - tmpvar_3[0].y = tmpvar_2.x; + tmpvar_3[0].y = binormal_1.x; tmpvar_3[0].z = gl_Normal.x; tmpvar_3[1].x = TANGENT.y; - tmpvar_3[1].y = tmpvar_2.y; + tmpvar_3[1].y = binormal_1.y; tmpvar_3[1].z = gl_Normal.y; tmpvar_3[2].x = TANGENT.z; - tmpvar_3[2].y = tmpvar_2.z; + tmpvar_3[2].y = binormal_1.z; tmpvar_3[2].z = gl_Normal.z; gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); - gl_TexCoord[0] = tmpvar_1; + gl_TexCoord[0] = tmpvar_2; vec4 tmpvar_4; tmpvar_4.w = 0.0; tmpvar_4.xyz = (tmpvar_3 * gl_ModelViewMatrixInverseTranspose[0].xyz); @@ -35,4 +35,14 @@ void main () } -// inputs: 4, stats: 15 alu 0 tex 0 flow +// stats: 15 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// #3: TANGENT (high float) 4x1 [-1] +// uniforms: 4 (total size: 0) +// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] +// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #2: _BumpMap_ST (high float) 4x1 [-1] +// #3: _MainTex_ST (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-ir.txt deleted file mode 100644 index 9afae106c..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-ir.txt +++ /dev/null @@ -1,132 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 hip_screen; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _MainTex_ST; -uniform vec4 _ProjectionParams; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -vec4 ComputeScreenPos ( - in vec4 pos_6 -) -{ - vec4 o_7; - vec4 tmpvar_8; - tmpvar_8 = (pos_6 * 0.5); - o_7 = tmpvar_8; - vec2 tmpvar_9; - tmpvar_9.x = o_7.x; - tmpvar_9.y = (o_7.y * _ProjectionParams.x); - vec2 tmpvar_10; - tmpvar_10 = (tmpvar_9 + o_7.w); - o_7.xy = tmpvar_10.xy.xy; - vec2 tmpvar_11; - tmpvar_11 = pos_6.zw; - o_7.zw = tmpvar_11.xxxy.zw; - return o_7; -} - -v2f_surf vert_surf ( - in appdata_full v_12 -) -{ - v2f_surf o_13; - PositionFog (v_12.vertex, o_13.pos, o_13.fog); - vec2 tmpvar_14; - tmpvar_14 = ((v_12.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_13.hip_pack0 = tmpvar_14.xy.xy; - vec4 tmpvar_15; - tmpvar_15 = ComputeScreenPos (o_13.pos); - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - o_13.hip_screen = tmpvar_16; - return o_13; -} - -void main () -{ - appdata_full xlt_v_17; - v2f_surf xl_retval_18; - vec4 tmpvar_19; - tmpvar_19 = gl_Vertex.xyzw; - vec4 tmpvar_20; - tmpvar_20 = tmpvar_19; - xlt_v_17.vertex = tmpvar_20; - vec4 tmpvar_21; - tmpvar_21 = TANGENT.xyzw; - vec4 tmpvar_22; - tmpvar_22 = tmpvar_21; - xlt_v_17.tangent = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = gl_Normal.xyz; - vec3 tmpvar_24; - tmpvar_24 = tmpvar_23; - xlt_v_17.normal = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; - xlt_v_17.texcoord = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - xlt_v_17.texcoord1 = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = gl_Color.xyzw; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - xlt_v_17.color = tmpvar_30; - v2f_surf tmpvar_31; - tmpvar_31 = vert_surf (xlt_v_17); - v2f_surf tmpvar_32; - tmpvar_32 = tmpvar_31; - xl_retval_18 = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = xl_retval_18.pos.xyzw; - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - gl_Position = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_35.x = xl_retval_18.fog; - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlv_FOG = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37.zw = vec2(0.0, 0.0); - tmpvar_37.xy = xl_retval_18.hip_pack0.xy; - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - gl_TexCoord[0] = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = xl_retval_18.hip_screen.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - gl_TexCoord[1] = tmpvar_40; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-out.txt index 5f8bfc54f..d66048d59 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-out.txt @@ -3,27 +3,33 @@ uniform vec4 _ProjectionParams; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_1; + pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); vec4 o_2; - vec4 tmpvar_3; - tmpvar_3 = (tmpvar_1 * 0.5); - vec2 tmpvar_4; - tmpvar_4.x = tmpvar_3.x; - tmpvar_4.y = (tmpvar_3.y * _ProjectionParams.x); - o_2.xy = (tmpvar_4 + tmpvar_3.w); - o_2.zw = tmpvar_1.zw; - gl_Position = tmpvar_1; + o_2 = (pos_1 * 0.5); + vec2 tmpvar_3; + tmpvar_3.x = o_2.x; + tmpvar_3.y = (o_2.y * _ProjectionParams.x); + o_2.xy = (tmpvar_3 + o_2.w); + o_2.zw = pos_1.zw; + gl_Position = pos_1; + vec4 tmpvar_4; + tmpvar_4.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_4.x = pos_1.z; + xlv_FOG = tmpvar_4; vec4 tmpvar_5; - tmpvar_5.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_5.x = tmpvar_1.z; - xlv_FOG = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6.zw = vec2(0.0, 0.0); - tmpvar_6.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_6; + tmpvar_5.zw = vec2(0.0, 0.0); + tmpvar_5.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_5; gl_TexCoord[1] = o_2; } -// inputs: 2, stats: 8 alu 0 tex 0 flow +// stats: 8 alu 0 tex 0 flow +// inputs: 2 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 3 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _MainTex_ST (high float) 4x1 [-1] +// #2: _ProjectionParams (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-ir.txt deleted file mode 100644 index 124993e25..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-ir.txt +++ /dev/null @@ -1,171 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec4 _LightCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec3 WorldSpaceLightDir ( - in vec4 v_9 -) -{ - vec3 worldPos_10; - vec3 tmpvar_11; - tmpvar_11 = (_Object2World * v_9).xyz; - worldPos_10 = tmpvar_11; - return (_WorldSpaceLightPos0.xyz - worldPos_10); -} - -void PositionFog ( - in vec4 v_12, - out vec4 pos_13, - out float fog_14 -) -{ - vec4 tmpvar_15; - tmpvar_15 = (gl_ModelViewProjectionMatrix * v_12); - pos_13 = tmpvar_15; - float tmpvar_16; - tmpvar_16 = pos_13.z; - fog_14 = tmpvar_16; -} - -v2f_surf vert_surf ( - in appdata_full v_17 -) -{ - v2f_surf o_18; - PositionFog (v_17.vertex, o_18.pos, o_18.fog); - vec2 tmpvar_19; - tmpvar_19 = ((v_17.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_18.hip_pack0 = tmpvar_19.xy.xy; - mat3 tmpvar_20; - tmpvar_20 = xll_constructMat3 (_Object2World); - vec3 tmpvar_21; - tmpvar_21 = (tmpvar_20 * (v_17.normal * unity_Scale.w)); - o_18.normal = tmpvar_21; - vec3 tmpvar_22; - tmpvar_22 = WorldSpaceLightDir (v_17.vertex); - vec3 tmpvar_23; - tmpvar_23 = tmpvar_22; - o_18.lightDir = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24 = (_LightMatrix0 * (_Object2World * v_17.vertex)); - o_18._LightCoord = tmpvar_24; - return o_18; -} - -void main () -{ - appdata_full xlt_v_25; - v2f_surf xl_retval_26; - vec4 tmpvar_27; - tmpvar_27 = gl_Vertex.xyzw; - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - xlt_v_25.vertex = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29 = TANGENT.xyzw; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - xlt_v_25.tangent = tmpvar_30; - vec3 tmpvar_31; - tmpvar_31 = gl_Normal.xyz; - vec3 tmpvar_32; - tmpvar_32 = tmpvar_31; - xlt_v_25.normal = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_34; - tmpvar_34 = tmpvar_33; - xlt_v_25.texcoord = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlt_v_25.texcoord1 = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37 = gl_Color.xyzw; - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlt_v_25.color = tmpvar_38; - v2f_surf tmpvar_39; - tmpvar_39 = vert_surf (xlt_v_25); - v2f_surf tmpvar_40; - tmpvar_40 = tmpvar_39; - xl_retval_26 = tmpvar_40; - vec4 tmpvar_41; - tmpvar_41 = xl_retval_26.pos.xyzw; - vec4 tmpvar_42; - tmpvar_42 = tmpvar_41; - gl_Position = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_43.x = xl_retval_26.fog; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - xlv_FOG = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45.zw = vec2(0.0, 0.0); - tmpvar_45.xy = xl_retval_26.hip_pack0.xy; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - gl_TexCoord[0] = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47.w = 0.0; - tmpvar_47.xyz = xl_retval_26.normal.xyz; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - gl_TexCoord[1] = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49.w = 0.0; - tmpvar_49.xyz = xl_retval_26.lightDir.xyz; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - gl_TexCoord[2] = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51 = xl_retval_26._LightCoord.xyzw; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - gl_TexCoord[3] = tmpvar_52; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-out.txt index 888a0e793..236ce480d 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-out.txt @@ -6,16 +6,16 @@ uniform vec4 unity_Scale; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_1; + pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); mat3 tmpvar_2; tmpvar_2[0] = _Object2World[0].xyz; tmpvar_2[1] = _Object2World[1].xyz; tmpvar_2[2] = _Object2World[2].xyz; - gl_Position = tmpvar_1; + gl_Position = pos_1; vec4 tmpvar_3; tmpvar_3.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_3.x = tmpvar_1.z; + tmpvar_3.x = pos_1.z; xlv_FOG = tmpvar_3; vec4 tmpvar_4; tmpvar_4.zw = vec2(0.0, 0.0); @@ -27,12 +27,23 @@ void main () gl_TexCoord[1] = tmpvar_5; vec4 tmpvar_6; tmpvar_6.w = 0.0; - vec4 cse_7; - cse_7 = (_Object2World * gl_Vertex); - tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - cse_7.xyz); + vec4 tmpvar_7; + tmpvar_7 = (_Object2World * gl_Vertex); + tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - tmpvar_7.xyz); gl_TexCoord[2] = tmpvar_6; - gl_TexCoord[3] = (_LightMatrix0 * cse_7); + gl_TexCoord[3] = (_LightMatrix0 * tmpvar_7); } -// inputs: 3, stats: 12 alu 0 tex 0 flow +// stats: 12 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 6 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _LightMatrix0 (high float) 4x4 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #5: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-ir.txt deleted file mode 100644 index 1e7ab371b..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-ir.txt +++ /dev/null @@ -1,181 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec3 viewDir; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec3 WorldSpaceViewDir ( - in vec4 v_9 -) -{ - return (_WorldSpaceCameraPos.xyz - (_Object2World * v_9).xyz); -} - -vec3 WorldSpaceLightDir ( - in vec4 v_10 -) -{ - vec3 worldPos_11; - vec3 tmpvar_12; - tmpvar_12 = (_Object2World * v_10).xyz; - worldPos_11 = tmpvar_12; - return _WorldSpaceLightPos0.xyz; -} - -void PositionFog ( - in vec4 v_13, - out vec4 pos_14, - out float fog_15 -) -{ - vec4 tmpvar_16; - tmpvar_16 = (gl_ModelViewProjectionMatrix * v_13); - pos_14 = tmpvar_16; - float tmpvar_17; - tmpvar_17 = pos_14.z; - fog_15 = tmpvar_17; -} - -v2f_surf vert_surf ( - in appdata_full v_18 -) -{ - v2f_surf o_19; - PositionFog (v_18.vertex, o_19.pos, o_19.fog); - vec2 tmpvar_20; - tmpvar_20 = ((v_18.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_19.hip_pack0 = tmpvar_20.xy.xy; - mat3 tmpvar_21; - tmpvar_21 = xll_constructMat3 (_Object2World); - vec3 tmpvar_22; - tmpvar_22 = (tmpvar_21 * (v_18.normal * unity_Scale.w)); - o_19.normal = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = WorldSpaceLightDir (v_18.vertex); - vec3 tmpvar_24; - tmpvar_24 = tmpvar_23; - o_19.lightDir = tmpvar_24; - vec3 tmpvar_25; - tmpvar_25 = WorldSpaceViewDir (v_18.vertex); - vec3 tmpvar_26; - tmpvar_26 = tmpvar_25; - o_19.viewDir = tmpvar_26; - return o_19; -} - -void main () -{ - appdata_full xlt_v_27; - v2f_surf xl_retval_28; - vec4 tmpvar_29; - tmpvar_29 = gl_Vertex.xyzw; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - xlt_v_27.vertex = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31 = TANGENT.xyzw; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_31; - xlt_v_27.tangent = tmpvar_32; - vec3 tmpvar_33; - tmpvar_33 = gl_Normal.xyz; - vec3 tmpvar_34; - tmpvar_34 = tmpvar_33; - xlt_v_27.normal = tmpvar_34; - vec4 tmpvar_35; - tmpvar_35 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_36; - tmpvar_36 = tmpvar_35; - xlt_v_27.texcoord = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_38; - tmpvar_38 = tmpvar_37; - xlt_v_27.texcoord1 = tmpvar_38; - vec4 tmpvar_39; - tmpvar_39 = gl_Color.xyzw; - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - xlt_v_27.color = tmpvar_40; - v2f_surf tmpvar_41; - tmpvar_41 = vert_surf (xlt_v_27); - v2f_surf tmpvar_42; - tmpvar_42 = tmpvar_41; - xl_retval_28 = tmpvar_42; - vec4 tmpvar_43; - tmpvar_43 = xl_retval_28.pos.xyzw; - vec4 tmpvar_44; - tmpvar_44 = tmpvar_43; - gl_Position = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_45.x = xl_retval_28.fog; - vec4 tmpvar_46; - tmpvar_46 = tmpvar_45; - xlv_FOG = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47.zw = vec2(0.0, 0.0); - tmpvar_47.xy = xl_retval_28.hip_pack0.xy; - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - gl_TexCoord[0] = tmpvar_48; - vec4 tmpvar_49; - tmpvar_49.w = 0.0; - tmpvar_49.xyz = xl_retval_28.normal.xyz; - vec4 tmpvar_50; - tmpvar_50 = tmpvar_49; - gl_TexCoord[1] = tmpvar_50; - vec4 tmpvar_51; - tmpvar_51.w = 0.0; - tmpvar_51.xyz = xl_retval_28.lightDir.xyz; - vec4 tmpvar_52; - tmpvar_52 = tmpvar_51; - gl_TexCoord[2] = tmpvar_52; - vec4 tmpvar_53; - tmpvar_53.w = 0.0; - tmpvar_53.xyz = xl_retval_28.viewDir.xyz; - vec4 tmpvar_54; - tmpvar_54 = tmpvar_53; - gl_TexCoord[3] = tmpvar_54; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-out.txt index ff7e63e61..07eebdc24 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-out.txt @@ -6,16 +6,16 @@ uniform vec4 unity_Scale; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_1; + pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); mat3 tmpvar_2; tmpvar_2[0] = _Object2World[0].xyz; tmpvar_2[1] = _Object2World[1].xyz; tmpvar_2[2] = _Object2World[2].xyz; - gl_Position = tmpvar_1; + gl_Position = pos_1; vec4 tmpvar_3; tmpvar_3.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_3.x = tmpvar_1.z; + tmpvar_3.x = pos_1.z; xlv_FOG = tmpvar_3; vec4 tmpvar_4; tmpvar_4.zw = vec2(0.0, 0.0); @@ -36,4 +36,15 @@ void main () } -// inputs: 3, stats: 12 alu 0 tex 0 flow +// stats: 12 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 6 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _MainTex_ST (high float) 4x1 [-1] +// #2: _Object2World (high float) 4x4 [-1] +// #3: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #4: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #5: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-ir.txt deleted file mode 100644 index 4c73a9d04..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-ir.txt +++ /dev/null @@ -1,192 +0,0 @@ -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec3 normal; - vec3 lightDir; - vec3 viewDir; - vec2 _LightCoord; -}; -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -mat3 xll_constructMat3 ( - in mat4 m_1 -) -{ - vec3 tmpvar_2; - tmpvar_2 = m_1[0].xyz; - vec3 tmpvar_3; - tmpvar_3 = m_1[1].xyz; - vec3 tmpvar_4; - tmpvar_4 = m_1[2].xyz; - mat3 tmpvar_5; - vec3 tmpvar_6; - tmpvar_6 = tmpvar_2; - tmpvar_5[0] = tmpvar_6; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_3; - tmpvar_5[1] = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = tmpvar_4; - tmpvar_5[2] = tmpvar_8; - return tmpvar_5; -} - -vec3 WorldSpaceViewDir ( - in vec4 v_9 -) -{ - return (_WorldSpaceCameraPos.xyz - (_Object2World * v_9).xyz); -} - -vec3 WorldSpaceLightDir ( - in vec4 v_10 -) -{ - vec3 worldPos_11; - vec3 tmpvar_12; - tmpvar_12 = (_Object2World * v_10).xyz; - worldPos_11 = tmpvar_12; - return _WorldSpaceLightPos0.xyz; -} - -void PositionFog ( - in vec4 v_13, - out vec4 pos_14, - out float fog_15 -) -{ - vec4 tmpvar_16; - tmpvar_16 = (gl_ModelViewProjectionMatrix * v_13); - pos_14 = tmpvar_16; - float tmpvar_17; - tmpvar_17 = pos_14.z; - fog_15 = tmpvar_17; -} - -v2f_surf vert_surf ( - in appdata_full v_18 -) -{ - v2f_surf o_19; - PositionFog (v_18.vertex, o_19.pos, o_19.fog); - vec2 tmpvar_20; - tmpvar_20 = ((v_18.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_19.hip_pack0 = tmpvar_20.xy.xy; - mat3 tmpvar_21; - tmpvar_21 = xll_constructMat3 (_Object2World); - vec3 tmpvar_22; - tmpvar_22 = (tmpvar_21 * (v_18.normal * unity_Scale.w)); - o_19.normal = tmpvar_22; - vec3 tmpvar_23; - tmpvar_23 = WorldSpaceLightDir (v_18.vertex); - vec3 tmpvar_24; - tmpvar_24 = tmpvar_23; - o_19.lightDir = tmpvar_24; - vec3 tmpvar_25; - tmpvar_25 = WorldSpaceViewDir (v_18.vertex); - vec3 tmpvar_26; - tmpvar_26 = tmpvar_25; - o_19.viewDir = tmpvar_26; - vec2 tmpvar_27; - tmpvar_27 = (_LightMatrix0 * (_Object2World * v_18.vertex)).xy; - o_19._LightCoord = tmpvar_27; - return o_19; -} - -void main () -{ - appdata_full xlt_v_28; - v2f_surf xl_retval_29; - vec4 tmpvar_30; - tmpvar_30 = gl_Vertex.xyzw; - vec4 tmpvar_31; - tmpvar_31 = tmpvar_30; - xlt_v_28.vertex = tmpvar_31; - vec4 tmpvar_32; - tmpvar_32 = TANGENT.xyzw; - vec4 tmpvar_33; - tmpvar_33 = tmpvar_32; - xlt_v_28.tangent = tmpvar_33; - vec3 tmpvar_34; - tmpvar_34 = gl_Normal.xyz; - vec3 tmpvar_35; - tmpvar_35 = tmpvar_34; - xlt_v_28.normal = tmpvar_35; - vec4 tmpvar_36; - tmpvar_36 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_37; - tmpvar_37 = tmpvar_36; - xlt_v_28.texcoord = tmpvar_37; - vec4 tmpvar_38; - tmpvar_38 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_39; - tmpvar_39 = tmpvar_38; - xlt_v_28.texcoord1 = tmpvar_39; - vec4 tmpvar_40; - tmpvar_40 = gl_Color.xyzw; - vec4 tmpvar_41; - tmpvar_41 = tmpvar_40; - xlt_v_28.color = tmpvar_41; - v2f_surf tmpvar_42; - tmpvar_42 = vert_surf (xlt_v_28); - v2f_surf tmpvar_43; - tmpvar_43 = tmpvar_42; - xl_retval_29 = tmpvar_43; - vec4 tmpvar_44; - tmpvar_44 = xl_retval_29.pos.xyzw; - vec4 tmpvar_45; - tmpvar_45 = tmpvar_44; - gl_Position = tmpvar_45; - vec4 tmpvar_46; - tmpvar_46.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_46.x = xl_retval_29.fog; - vec4 tmpvar_47; - tmpvar_47 = tmpvar_46; - xlv_FOG = tmpvar_47; - vec4 tmpvar_48; - tmpvar_48.zw = vec2(0.0, 0.0); - tmpvar_48.xy = xl_retval_29.hip_pack0.xy; - vec4 tmpvar_49; - tmpvar_49 = tmpvar_48; - gl_TexCoord[0] = tmpvar_49; - vec4 tmpvar_50; - tmpvar_50.w = 0.0; - tmpvar_50.xyz = xl_retval_29.normal.xyz; - vec4 tmpvar_51; - tmpvar_51 = tmpvar_50; - gl_TexCoord[1] = tmpvar_51; - vec4 tmpvar_52; - tmpvar_52.w = 0.0; - tmpvar_52.xyz = xl_retval_29.lightDir.xyz; - vec4 tmpvar_53; - tmpvar_53 = tmpvar_52; - gl_TexCoord[2] = tmpvar_53; - vec4 tmpvar_54; - tmpvar_54.w = 0.0; - tmpvar_54.xyz = xl_retval_29.viewDir.xyz; - vec4 tmpvar_55; - tmpvar_55 = tmpvar_54; - gl_TexCoord[3] = tmpvar_55; - vec4 tmpvar_56; - tmpvar_56.zw = vec2(0.0, 0.0); - tmpvar_56.xy = xl_retval_29._LightCoord.xy; - vec4 tmpvar_57; - tmpvar_57 = tmpvar_56; - gl_TexCoord[4] = tmpvar_57; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-out.txt index fae31daf6..57c25b543 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-out.txt @@ -7,40 +7,52 @@ uniform vec4 unity_Scale; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 pos_1; + pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); mat3 tmpvar_2; tmpvar_2[0] = _Object2World[0].xyz; tmpvar_2[1] = _Object2World[1].xyz; tmpvar_2[2] = _Object2World[2].xyz; - vec4 cse_3; - cse_3 = (_Object2World * gl_Vertex); - gl_Position = tmpvar_1; + gl_Position = pos_1; + vec4 tmpvar_3; + tmpvar_3.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_3.x = pos_1.z; + xlv_FOG = tmpvar_3; vec4 tmpvar_4; - tmpvar_4.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_4.x = tmpvar_1.z; - xlv_FOG = tmpvar_4; + tmpvar_4.zw = vec2(0.0, 0.0); + tmpvar_4.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_4; vec4 tmpvar_5; - tmpvar_5.zw = vec2(0.0, 0.0); - tmpvar_5.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_5; + tmpvar_5.w = 0.0; + tmpvar_5.xyz = (tmpvar_2 * (gl_Normal * unity_Scale.w)); + gl_TexCoord[1] = tmpvar_5; vec4 tmpvar_6; tmpvar_6.w = 0.0; - tmpvar_6.xyz = (tmpvar_2 * (gl_Normal * unity_Scale.w)); - gl_TexCoord[1] = tmpvar_6; + tmpvar_6.xyz = _WorldSpaceLightPos0.xyz; + gl_TexCoord[2] = tmpvar_6; vec4 tmpvar_7; tmpvar_7.w = 0.0; - tmpvar_7.xyz = _WorldSpaceLightPos0.xyz; - gl_TexCoord[2] = tmpvar_7; vec4 tmpvar_8; - tmpvar_8.w = 0.0; - tmpvar_8.xyz = (_WorldSpaceCameraPos - cse_3.xyz); - gl_TexCoord[3] = tmpvar_8; + tmpvar_8 = (_Object2World * gl_Vertex); + tmpvar_7.xyz = (_WorldSpaceCameraPos - tmpvar_8.xyz); + gl_TexCoord[3] = tmpvar_7; vec4 tmpvar_9; tmpvar_9.zw = vec2(0.0, 0.0); - tmpvar_9.xy = (_LightMatrix0 * cse_3).xy; + tmpvar_9.xy = (_LightMatrix0 * tmpvar_8).xy; gl_TexCoord[4] = tmpvar_9; } -// inputs: 3, stats: 14 alu 0 tex 0 flow +// stats: 14 alu 0 tex 0 flow +// inputs: 3 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Normal (high float) 3x1 [-1] loc 2 +// #2: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 7 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _LightMatrix0 (high float) 4x4 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #5: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #6: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-ir.txt deleted file mode 100644 index 67be5b70b..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-ir.txt +++ /dev/null @@ -1,276 +0,0 @@ -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -struct v2f { - vec4 pos; - vec2 uv; - vec3 color; - vec3 backContrib; - vec3 nl; - vec3 nh; -}; -uniform vec3 _TerrainTreeLightDirections[4]; -uniform float _TranslucencyViewDependency; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -float xll_saturate ( - in float x_1 -) -{ - float tmpvar_2; - tmpvar_2 = clamp (x_1, 0.0, 1.0); - return tmpvar_2; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_3 -) -{ - vec3 objSpaceCameraPos_4; - vec4 tmpvar_5; - tmpvar_5.w = 1.0; - tmpvar_5.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_6; - tmpvar_6 = ((_World2Object * tmpvar_5).xyz * unity_Scale.w); - objSpaceCameraPos_4 = tmpvar_6; - return (objSpaceCameraPos_4 - v_3.xyz); -} - -void ExpandBillboard ( - in mat4 mat_7, - inout vec4 pos_8, - inout vec3 normal_9, - inout vec4 tangent_10 -) -{ - vec3 tanb_11; - vec3 norb_12; - float isBillboard_13; - float tmpvar_14; - tmpvar_14 = abs (tangent_10.w); - float tmpvar_15; - tmpvar_15 = (1.0 - tmpvar_14); - isBillboard_13 = tmpvar_15; - vec4 tmpvar_16; - tmpvar_16.w = 0.0; - tmpvar_16.xyz = normal_9.xyz; - vec4 tmpvar_17; - tmpvar_17 = normalize ((tmpvar_16 * mat_7)); - vec3 tmpvar_18; - tmpvar_18 = tmpvar_17.xyz; - vec3 tmpvar_19; - tmpvar_19 = tmpvar_18; - norb_12 = tmpvar_19; - vec4 tmpvar_20; - tmpvar_20.w = 0.0; - tmpvar_20.xyz = tangent_10.xyz.xyz; - vec4 tmpvar_21; - tmpvar_21 = normalize ((tmpvar_20 * mat_7)); - vec3 tmpvar_22; - tmpvar_22 = tmpvar_21.xyz; - vec3 tmpvar_23; - tmpvar_23 = tmpvar_22; - tanb_11 = tmpvar_23; - vec4 tmpvar_24; - tmpvar_24.zw = vec2(0.0, 0.0); - tmpvar_24.xy = normal_9.xy.xy; - vec4 tmpvar_25; - tmpvar_25 = (pos_8 + ((tmpvar_24 * mat_7) * isBillboard_13)); - pos_8 = tmpvar_25; - vec3 tmpvar_26; - tmpvar_26 = vec3(isBillboard_13); - vec3 tmpvar_27; - tmpvar_27 = mix (normal_9, norb_12, tmpvar_26); - vec3 tmpvar_28; - tmpvar_28 = tmpvar_27; - normal_9 = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29.w = -1.0; - tmpvar_29.xyz = tanb_11.xyz; - vec4 tmpvar_30; - tmpvar_30 = vec4(isBillboard_13); - vec4 tmpvar_31; - tmpvar_31 = mix (tangent_10, tmpvar_29, tmpvar_30); - vec4 tmpvar_32; - tmpvar_32 = tmpvar_31; - tangent_10 = tmpvar_32; -} - -v2f vert ( - in appdata_full v_33 -) -{ - float nh_34; - vec3 h_35; - float backContrib_36; - float nl_37; - vec3 lightDir_38; - int j_39; - vec3 viewDir_40; - v2f o_41; - int tmpvar_42; - tmpvar_42 = 0; - j_39 = tmpvar_42; - ExpandBillboard (gl_ModelViewMatrixInverseTranspose, v_33.vertex, v_33.normal, v_33.tangent); - vec4 tmpvar_43; - tmpvar_43 = (gl_ModelViewProjectionMatrix * v_33.vertex); - o_41.pos = tmpvar_43; - vec2 tmpvar_44; - tmpvar_44 = v_33.texcoord.xy; - o_41.uv = tmpvar_44; - vec3 tmpvar_45; - tmpvar_45 = ObjSpaceViewDir (v_33.vertex); - vec3 tmpvar_46; - tmpvar_46 = normalize (tmpvar_45); - vec3 tmpvar_47; - tmpvar_47 = tmpvar_46; - viewDir_40 = tmpvar_47; - while (true) { - if (!((j_39 < 3))) { - break; - }; - vec3 tmpvar_48; - tmpvar_48 = _TerrainTreeLightDirections[j_39]; - lightDir_38 = tmpvar_48; - float tmpvar_49; - tmpvar_49 = dot (v_33.normal, lightDir_38); - float tmpvar_50; - tmpvar_50 = tmpvar_49; - nl_37 = tmpvar_50; - float tmpvar_51; - tmpvar_51 = dot (viewDir_40, -(lightDir_38)); - float tmpvar_52; - tmpvar_52 = xll_saturate (tmpvar_51); - float tmpvar_53; - tmpvar_53 = tmpvar_52; - backContrib_36 = tmpvar_53; - float tmpvar_54; - tmpvar_54 = xll_saturate (-(nl_37)); - float tmpvar_55; - tmpvar_55 = mix (tmpvar_54, backContrib_36, _TranslucencyViewDependency); - float tmpvar_56; - tmpvar_56 = tmpvar_55; - backContrib_36 = tmpvar_56; - vec3 tmpvar_57; - tmpvar_57 = o_41.backContrib; tmpvar_57[j_39] = (backContrib_36 * 2.0); - o_41.backContrib = tmpvar_57; - float tmpvar_58; - tmpvar_58 = max (0.0, ((nl_37 * 0.6) + 0.4)); - float tmpvar_59; - tmpvar_59 = tmpvar_58; - nl_37 = tmpvar_59; - vec3 tmpvar_60; - tmpvar_60 = o_41.nl; tmpvar_60[j_39] = nl_37; - o_41.nl = tmpvar_60; - vec3 tmpvar_61; - tmpvar_61 = normalize ((lightDir_38 + viewDir_40)); - vec3 tmpvar_62; - tmpvar_62 = tmpvar_61; - h_35 = tmpvar_62; - float tmpvar_63; - tmpvar_63 = dot (v_33.normal, h_35); - float tmpvar_64; - tmpvar_64 = max (0.0, tmpvar_63); - float tmpvar_65; - tmpvar_65 = tmpvar_64; - nh_34 = tmpvar_65; - vec3 tmpvar_66; - tmpvar_66 = o_41.nh; tmpvar_66[j_39] = nh_34; - o_41.nh = tmpvar_66; - int _post_incdec_tmp_67; - _post_incdec_tmp_67 = j_39; - int tmpvar_68; - tmpvar_68 = (j_39 + 1); - j_39 = tmpvar_68; - }; - vec3 tmpvar_69; - tmpvar_69 = vec3(v_33.color.w); - vec3 tmpvar_70; - tmpvar_70 = tmpvar_69; - o_41.color = tmpvar_70; - return o_41; -} - -void main () -{ - appdata_full xlt_v_71; - v2f xl_retval_72; - vec4 tmpvar_73; - tmpvar_73 = gl_Vertex.xyzw; - vec4 tmpvar_74; - tmpvar_74 = tmpvar_73; - xlt_v_71.vertex = tmpvar_74; - vec4 tmpvar_75; - tmpvar_75 = TANGENT.xyzw; - vec4 tmpvar_76; - tmpvar_76 = tmpvar_75; - xlt_v_71.tangent = tmpvar_76; - vec3 tmpvar_77; - tmpvar_77 = gl_Normal.xyz; - vec3 tmpvar_78; - tmpvar_78 = tmpvar_77; - xlt_v_71.normal = tmpvar_78; - vec4 tmpvar_79; - tmpvar_79 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_80; - tmpvar_80 = tmpvar_79; - xlt_v_71.texcoord = tmpvar_80; - vec4 tmpvar_81; - tmpvar_81 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_82; - tmpvar_82 = tmpvar_81; - xlt_v_71.texcoord1 = tmpvar_82; - vec4 tmpvar_83; - tmpvar_83 = gl_Color.xyzw; - vec4 tmpvar_84; - tmpvar_84 = tmpvar_83; - xlt_v_71.color = tmpvar_84; - v2f tmpvar_85; - tmpvar_85 = vert (xlt_v_71); - v2f tmpvar_86; - tmpvar_86 = tmpvar_85; - xl_retval_72 = tmpvar_86; - vec4 tmpvar_87; - tmpvar_87 = xl_retval_72.pos.xyzw; - vec4 tmpvar_88; - tmpvar_88 = tmpvar_87; - gl_Position = tmpvar_88; - vec4 tmpvar_89; - tmpvar_89.zw = vec2(0.0, 0.0); - tmpvar_89.xy = xl_retval_72.uv.xy; - vec4 tmpvar_90; - tmpvar_90 = tmpvar_89; - gl_TexCoord[0] = tmpvar_90; - vec4 tmpvar_91; - tmpvar_91.w = 0.0; - tmpvar_91.xyz = xl_retval_72.color.xyz; - vec4 tmpvar_92; - tmpvar_92 = tmpvar_91; - gl_TexCoord[1] = tmpvar_92; - vec4 tmpvar_93; - tmpvar_93.w = 0.0; - tmpvar_93.xyz = xl_retval_72.backContrib.xyz; - vec4 tmpvar_94; - tmpvar_94 = tmpvar_93; - gl_TexCoord[2] = tmpvar_94; - vec4 tmpvar_95; - tmpvar_95.w = 0.0; - tmpvar_95.xyz = xl_retval_72.nl.xyz; - vec4 tmpvar_96; - tmpvar_96 = tmpvar_95; - gl_TexCoord[3] = tmpvar_96; - vec4 tmpvar_97; - tmpvar_97.w = 0.0; - tmpvar_97.xyz = xl_retval_72.nh.xyz; - vec4 tmpvar_98; - tmpvar_98 = tmpvar_97; - gl_TexCoord[4] = tmpvar_98; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-out.txt index 72484e1c9..9a84d06a7 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-out.txt @@ -6,89 +6,122 @@ uniform vec4 unity_Scale; attribute vec4 TANGENT; void main () { - vec3 viewDir_1; - vec3 tmpvar_2; + vec3 lightDir_1; + vec3 viewDir_2; vec3 tmpvar_3; vec3 tmpvar_4; - float tmpvar_5; - tmpvar_5 = (1.0 - abs(TANGENT.w)); - vec4 tmpvar_6; - tmpvar_6.w = 0.0; - tmpvar_6.xyz = gl_Normal; - vec4 tmpvar_7; - tmpvar_7.zw = vec2(0.0, 0.0); - tmpvar_7.xy = gl_Normal.xy; + vec3 tmpvar_5; + vec4 pos_6; + float isBillboard_7; + isBillboard_7 = (1.0 - abs(TANGENT.w)); vec4 tmpvar_8; - tmpvar_8 = (gl_Vertex + ((tmpvar_7 * gl_ModelViewMatrixInverseTranspose) * tmpvar_5)); - vec3 tmpvar_9; - tmpvar_9 = mix (gl_Normal, normalize((tmpvar_6 * gl_ModelViewMatrixInverseTranspose)).xyz, vec3(tmpvar_5)); - vec4 tmpvar_10; - tmpvar_10.w = 1.0; - tmpvar_10.xyz = _WorldSpaceCameraPos; - viewDir_1 = normalize((( - (_World2Object * tmpvar_10) - .xyz * unity_Scale.w) - tmpvar_8.xyz)); - vec3 tmpvar_11; - tmpvar_11 = _TerrainTreeLightDirections[0]; + tmpvar_8.w = 0.0; + tmpvar_8.xyz = gl_Normal; + vec4 tmpvar_9; + tmpvar_9.zw = vec2(0.0, 0.0); + tmpvar_9.xy = gl_Normal.xy; + pos_6 = (gl_Vertex + ((tmpvar_9 * gl_ModelViewMatrixInverseTranspose) * isBillboard_7)); + vec3 tmpvar_10; + tmpvar_10 = mix (gl_Normal, normalize((tmpvar_8 * gl_ModelViewMatrixInverseTranspose)).xyz, vec3(isBillboard_7)); + vec4 tmpvar_11; + tmpvar_11.w = 1.0; + tmpvar_11.xyz = _WorldSpaceCameraPos; + viewDir_2 = normalize((( + (_World2Object * tmpvar_11) + .xyz * unity_Scale.w) - pos_6.xyz)); + lightDir_1 = _TerrainTreeLightDirections[0]; float tmpvar_12; - tmpvar_12 = dot (tmpvar_9, tmpvar_11); - tmpvar_2.x = (mix (clamp ( + tmpvar_12 = dot (tmpvar_10, lightDir_1); + vec3 tmpvar_13; + tmpvar_13.yz = tmpvar_3.yz; + tmpvar_13.x = (mix (clamp ( -(tmpvar_12) , 0.0, 1.0), clamp ( - dot (viewDir_1, -(tmpvar_11)) + dot (viewDir_2, -(lightDir_1)) , 0.0, 1.0), _TranslucencyViewDependency) * 2.0); - tmpvar_3.x = max (0.0, ((tmpvar_12 * 0.6) + 0.4)); - tmpvar_4.x = max (0.0, dot (tmpvar_9, normalize( - (tmpvar_11 + viewDir_1) - ))); - vec3 tmpvar_13; - tmpvar_13 = _TerrainTreeLightDirections[1]; - float tmpvar_14; - tmpvar_14 = dot (tmpvar_9, tmpvar_13); - tmpvar_2.y = (mix (clamp ( - -(tmpvar_14) - , 0.0, 1.0), clamp ( - dot (viewDir_1, -(tmpvar_13)) - , 0.0, 1.0), _TranslucencyViewDependency) * 2.0); - tmpvar_3.y = max (0.0, ((tmpvar_14 * 0.6) + 0.4)); - tmpvar_4.y = max (0.0, dot (tmpvar_9, normalize( - (tmpvar_13 + viewDir_1) - ))); + vec3 tmpvar_14; + tmpvar_14.yz = tmpvar_4.yz; + tmpvar_14.x = max (0.0, ((tmpvar_12 * 0.6) + 0.4)); vec3 tmpvar_15; - tmpvar_15 = _TerrainTreeLightDirections[2]; + tmpvar_15.yz = tmpvar_5.yz; + tmpvar_15.x = max (0.0, dot (tmpvar_10, normalize( + (lightDir_1 + viewDir_2) + ))); + lightDir_1 = _TerrainTreeLightDirections[1]; float tmpvar_16; - tmpvar_16 = dot (tmpvar_9, tmpvar_15); - tmpvar_2.z = (mix (clamp ( + tmpvar_16 = dot (tmpvar_10, lightDir_1); + vec3 tmpvar_17; + tmpvar_17.xz = tmpvar_13.xz; + tmpvar_17.y = (mix (clamp ( -(tmpvar_16) , 0.0, 1.0), clamp ( - dot (viewDir_1, -(tmpvar_15)) + dot (viewDir_2, -(lightDir_1)) , 0.0, 1.0), _TranslucencyViewDependency) * 2.0); - tmpvar_3.z = max (0.0, ((tmpvar_16 * 0.6) + 0.4)); - tmpvar_4.z = max (0.0, dot (tmpvar_9, normalize( - (tmpvar_15 + viewDir_1) + vec3 tmpvar_18; + tmpvar_18.xz = tmpvar_14.xz; + tmpvar_18.y = max (0.0, ((tmpvar_16 * 0.6) + 0.4)); + vec3 tmpvar_19; + tmpvar_19.xz = tmpvar_15.xz; + tmpvar_19.y = max (0.0, dot (tmpvar_10, normalize( + (lightDir_1 + viewDir_2) ))); - gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_8); - vec4 tmpvar_17; - tmpvar_17.zw = vec2(0.0, 0.0); - tmpvar_17.xy = gl_MultiTexCoord0.xy; - gl_TexCoord[0] = tmpvar_17; - vec4 tmpvar_18; - tmpvar_18.w = 0.0; - tmpvar_18.xyz = gl_Color.www; - gl_TexCoord[1] = tmpvar_18; - vec4 tmpvar_19; - tmpvar_19.w = 0.0; - tmpvar_19.xyz = tmpvar_2; - gl_TexCoord[2] = tmpvar_19; - vec4 tmpvar_20; - tmpvar_20.w = 0.0; - tmpvar_20.xyz = tmpvar_3; - gl_TexCoord[3] = tmpvar_20; - vec4 tmpvar_21; - tmpvar_21.w = 0.0; - tmpvar_21.xyz = tmpvar_4; - gl_TexCoord[4] = tmpvar_21; + lightDir_1 = _TerrainTreeLightDirections[2]; + float tmpvar_20; + tmpvar_20 = dot (tmpvar_10, lightDir_1); + vec3 tmpvar_21; + tmpvar_21.xy = tmpvar_17.xy; + tmpvar_21.z = (mix (clamp ( + -(tmpvar_20) + , 0.0, 1.0), clamp ( + dot (viewDir_2, -(lightDir_1)) + , 0.0, 1.0), _TranslucencyViewDependency) * 2.0); + tmpvar_3 = tmpvar_21; + vec3 tmpvar_22; + tmpvar_22.xy = tmpvar_18.xy; + tmpvar_22.z = max (0.0, ((tmpvar_20 * 0.6) + 0.4)); + tmpvar_4 = tmpvar_22; + vec3 tmpvar_23; + tmpvar_23.xy = tmpvar_19.xy; + tmpvar_23.z = max (0.0, dot (tmpvar_10, normalize( + (lightDir_1 + viewDir_2) + ))); + tmpvar_5 = tmpvar_23; + gl_Position = (gl_ModelViewProjectionMatrix * pos_6); + vec4 tmpvar_24; + tmpvar_24.zw = vec2(0.0, 0.0); + tmpvar_24.xy = gl_MultiTexCoord0.xy; + gl_TexCoord[0] = tmpvar_24; + vec4 tmpvar_25; + tmpvar_25.w = 0.0; + tmpvar_25.xyz = gl_Color.www; + gl_TexCoord[1] = tmpvar_25; + vec4 tmpvar_26; + tmpvar_26.w = 0.0; + tmpvar_26.xyz = tmpvar_21; + gl_TexCoord[2] = tmpvar_26; + vec4 tmpvar_27; + tmpvar_27.w = 0.0; + tmpvar_27.xyz = tmpvar_22; + gl_TexCoord[3] = tmpvar_27; + vec4 tmpvar_28; + tmpvar_28.w = 0.0; + tmpvar_28.xyz = tmpvar_23; + gl_TexCoord[4] = tmpvar_28; } -// inputs: 5, stats: 75 alu 0 tex 0 flow +// stats: 66 alu 0 tex 0 flow +// inputs: 5 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Color (high float) 4x1 [-1] loc 3 +// #2: gl_Normal (high float) 3x1 [-1] loc 2 +// #3: gl_Vertex (high float) 4x1 [-1] loc 0 +// #4: TANGENT (high float) 4x1 [-1] +// uniforms: 7 (total size: 0) +// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] +// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #2: _TerrainTreeLightDirections (high float) 3x1 [4] +// #3: _TranslucencyViewDependency (high float) 1x1 [-1] +// #4: _World2Object (high float) 4x4 [-1] +// #5: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #6: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-ir.txt deleted file mode 100644 index aa11c3947..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-ir.txt +++ /dev/null @@ -1,388 +0,0 @@ -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 lop_color; - vec3 lightDir; - vec3 viewDir; -}; -uniform vec4 _Color; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _Scale; -uniform float _SquashAmount; -uniform vec4 _SquashPlaneNormal; -uniform float _TimeX; -uniform vec4 _Wind; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -vec4 Squash ( - in vec4 pos_1 -) -{ - vec3 planeNormal_2; - vec3 planePoint_3; - vec3 projectedVertex_4; - vec3 tmpvar_5; - tmpvar_5 = pos_1.xyz; - projectedVertex_4 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6.xz = vec2(0.0, 0.0); - tmpvar_6.y = _SquashPlaneNormal.w; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_6; - planePoint_3 = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = _SquashPlaneNormal.xyz; - planeNormal_2 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = pos_1.xyz; - float tmpvar_10; - tmpvar_10 = dot (planeNormal_2, (planePoint_3 - tmpvar_9)); - vec3 tmpvar_11; - tmpvar_11 = (projectedVertex_4 + (tmpvar_10 * planeNormal_2)); - projectedVertex_4 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = vec3(_SquashAmount); - vec3 tmpvar_13; - tmpvar_13 = mix (projectedVertex_4, pos_1.xyz, tmpvar_12); - vec4 tmpvar_14; - tmpvar_14.w = 1.0; - tmpvar_14.xyz = tmpvar_13.xyz; - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - pos_1 = tmpvar_15; - return pos_1; -} - -vec4 TriangleWave ( - in vec4 x_16 -) -{ - vec4 tmpvar_17; - tmpvar_17 = fract ((x_16 + 0.5)); - vec4 tmpvar_18; - tmpvar_18 = abs (((tmpvar_17 * 2.0) - 1.0)); - return tmpvar_18; -} - -vec4 SmoothCurve ( - in vec4 x_19 -) -{ - return ((x_19 * x_19) * (3.0 - (2.0 * x_19))); -} - -vec4 SmoothTriangleWave ( - in vec4 x_20 -) -{ - vec4 tmpvar_21; - tmpvar_21 = TriangleWave (x_20); - vec4 tmpvar_22; - tmpvar_22 = SmoothCurve (tmpvar_21); - return tmpvar_22; -} - -vec4 AnimateVertex ( - in vec4 pos_23, - in vec3 normal_24, - in vec4 animParams_25 -) -{ - vec3 bend_26; - vec2 vWavesSum_27; - vec4 vWaves_28; - vec2 vWavesIn_29; - float fVtxPhase_30; - float fBranchPhase_31; - float fObjPhase_32; - float fBranchAmp_33; - float fDetailAmp_34; - float tmpvar_35; - tmpvar_35 = 0.1; - fDetailAmp_34 = tmpvar_35; - float tmpvar_36; - tmpvar_36 = 0.3; - fBranchAmp_33 = tmpvar_36; - float tmpvar_37; - tmpvar_37 = dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)); - float tmpvar_38; - tmpvar_38 = tmpvar_37; - fObjPhase_32 = tmpvar_38; - float tmpvar_39; - tmpvar_39 = (fObjPhase_32 + animParams_25.x); - fBranchPhase_31 = tmpvar_39; - vec3 tmpvar_40; - tmpvar_40 = vec3((animParams_25.y + fBranchPhase_31)); - float tmpvar_41; - tmpvar_41 = dot (pos_23.xyz, tmpvar_40); - float tmpvar_42; - tmpvar_42 = tmpvar_41; - fVtxPhase_30 = tmpvar_42; - vec2 tmpvar_43; - tmpvar_43.x = fVtxPhase_30; - tmpvar_43.y = fBranchPhase_31; - vec2 tmpvar_44; - tmpvar_44 = (_TimeX + tmpvar_43); - vWavesIn_29 = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = fract ((vWavesIn_29.xxyy * vec4(1.975, 0.793, 0.375, 0.193))); - vec4 tmpvar_46; - tmpvar_46 = ((tmpvar_45 * 2.0) - 1.0); - vWaves_28 = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = SmoothTriangleWave (vWaves_28); - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - vWaves_28 = tmpvar_48; - vec2 tmpvar_49; - tmpvar_49 = (vWaves_28.xz + vWaves_28.yw); - vWavesSum_27 = tmpvar_49; - vec3 tmpvar_50; - tmpvar_50 = ((animParams_25.y * fDetailAmp_34) * normal_24.xyz); - bend_26 = tmpvar_50; - float tmpvar_51; - tmpvar_51 = (animParams_25.w * fBranchAmp_33); - bend_26.y = vec2(tmpvar_51).y; - vec3 tmpvar_52; - tmpvar_52 = (pos_23.xyz + (( - (vWavesSum_27.xyx * bend_26) - + - ((_Wind.xyz * vWavesSum_27.y) * animParams_25.w) - ) * _Wind.w)); - pos_23.xyz = tmpvar_52.xyz.xyz; - vec3 tmpvar_53; - tmpvar_53 = (pos_23.xyz + (animParams_25.z * _Wind.xyz)); - pos_23.xyz = tmpvar_53.xyz.xyz; - return pos_23; -} - -void TreeVertBark ( - inout appdata_full v_54 -) -{ - vec3 tmpvar_55; - tmpvar_55 = (v_54.vertex.xyz * _Scale.xyz); - v_54.vertex.xyz = tmpvar_55.xyz.xyz; - vec4 tmpvar_56; - tmpvar_56.xy = v_54.color.xy.xy; - tmpvar_56.zw = v_54.texcoord1.xy.xy; - vec4 tmpvar_57; - tmpvar_57 = AnimateVertex (v_54.vertex, v_54.normal, tmpvar_56); - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - v_54.vertex = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59 = Squash (v_54.vertex); - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - v_54.vertex = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61.xyz = (v_54.color.w * _Color.xyz).xyz; - tmpvar_61.w = _Color.w; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - v_54.color = tmpvar_62; - vec3 tmpvar_63; - tmpvar_63 = normalize (v_54.normal); - vec3 tmpvar_64; - tmpvar_64 = tmpvar_63; - v_54.normal = tmpvar_64; - vec3 tmpvar_65; - tmpvar_65 = normalize (v_54.tangent.xyz); - vec3 tmpvar_66; - tmpvar_66 = tmpvar_65; - v_54.tangent.xyz = tmpvar_66.xyz.xyz; -} - -void PositionFog ( - in vec4 v_67, - out vec4 pos_68, - out float fog_69 -) -{ - vec4 tmpvar_70; - tmpvar_70 = (gl_ModelViewProjectionMatrix * v_67); - pos_68 = tmpvar_70; - float tmpvar_71; - tmpvar_71 = pos_68.z; - fog_69 = tmpvar_71; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_72 -) -{ - vec3 objSpaceCameraPos_73; - vec4 tmpvar_74; - tmpvar_74.w = 1.0; - tmpvar_74.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_75; - tmpvar_75 = ((_World2Object * tmpvar_74).xyz * unity_Scale.w); - objSpaceCameraPos_73 = tmpvar_75; - return (objSpaceCameraPos_73 - v_72.xyz); -} - -vec3 ObjSpaceLightDir ( - in vec4 v_76 -) -{ - vec3 objSpaceLightPos_77; - vec3 tmpvar_78; - tmpvar_78 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_77 = tmpvar_78; - return objSpaceLightPos_77.xyz; -} - -v2f_surf vert_surf ( - in appdata_full v_79 -) -{ - mat3 rotation_80; - vec3 binormal_81; - v2f_surf o_82; - TreeVertBark (v_79); - PositionFog (v_79.vertex, o_82.pos, o_82.fog); - vec2 tmpvar_83; - tmpvar_83 = ((v_79.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_82.hip_pack0 = tmpvar_83.xy.xy; - vec4 tmpvar_84; - tmpvar_84 = v_79.color; - o_82.lop_color = tmpvar_84; - vec3 tmpvar_85; - tmpvar_85 = cross (v_79.normal, v_79.tangent.xyz); - vec3 tmpvar_86; - tmpvar_86 = (tmpvar_85 * v_79.tangent.w); - binormal_81 = tmpvar_86; - mat3 tmpvar_87; - float tmpvar_88; - tmpvar_88 = v_79.tangent.x; - tmpvar_87[0].x = tmpvar_88; - float tmpvar_89; - tmpvar_89 = binormal_81.x; - tmpvar_87[0].y = tmpvar_89; - float tmpvar_90; - tmpvar_90 = v_79.normal.x; - tmpvar_87[0].z = tmpvar_90; - float tmpvar_91; - tmpvar_91 = v_79.tangent.y; - tmpvar_87[1].x = tmpvar_91; - float tmpvar_92; - tmpvar_92 = binormal_81.y; - tmpvar_87[1].y = tmpvar_92; - float tmpvar_93; - tmpvar_93 = v_79.normal.y; - tmpvar_87[1].z = tmpvar_93; - float tmpvar_94; - tmpvar_94 = v_79.tangent.z; - tmpvar_87[2].x = tmpvar_94; - float tmpvar_95; - tmpvar_95 = binormal_81.z; - tmpvar_87[2].y = tmpvar_95; - float tmpvar_96; - tmpvar_96 = v_79.normal.z; - tmpvar_87[2].z = tmpvar_96; - mat3 tmpvar_97; - tmpvar_97 = tmpvar_87; - rotation_80 = tmpvar_97; - vec3 tmpvar_98; - tmpvar_98 = ObjSpaceLightDir (v_79.vertex); - vec3 tmpvar_99; - tmpvar_99 = (rotation_80 * tmpvar_98); - o_82.lightDir = tmpvar_99; - vec3 tmpvar_100; - tmpvar_100 = ObjSpaceViewDir (v_79.vertex); - vec3 tmpvar_101; - tmpvar_101 = (rotation_80 * tmpvar_100); - o_82.viewDir = tmpvar_101; - return o_82; -} - -void main () -{ - appdata_full xlt_v_102; - v2f_surf xl_retval_103; - vec4 tmpvar_104; - tmpvar_104 = gl_Vertex.xyzw; - vec4 tmpvar_105; - tmpvar_105 = tmpvar_104; - xlt_v_102.vertex = tmpvar_105; - vec4 tmpvar_106; - tmpvar_106 = TANGENT.xyzw; - vec4 tmpvar_107; - tmpvar_107 = tmpvar_106; - xlt_v_102.tangent = tmpvar_107; - vec3 tmpvar_108; - tmpvar_108 = gl_Normal.xyz; - vec3 tmpvar_109; - tmpvar_109 = tmpvar_108; - xlt_v_102.normal = tmpvar_109; - vec4 tmpvar_110; - tmpvar_110 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_111; - tmpvar_111 = tmpvar_110; - xlt_v_102.texcoord = tmpvar_111; - vec4 tmpvar_112; - tmpvar_112 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_113; - tmpvar_113 = tmpvar_112; - xlt_v_102.texcoord1 = tmpvar_113; - vec4 tmpvar_114; - tmpvar_114 = gl_Color.xyzw; - vec4 tmpvar_115; - tmpvar_115 = tmpvar_114; - xlt_v_102.color = tmpvar_115; - v2f_surf tmpvar_116; - tmpvar_116 = vert_surf (xlt_v_102); - v2f_surf tmpvar_117; - tmpvar_117 = tmpvar_116; - xl_retval_103 = tmpvar_117; - vec4 tmpvar_118; - tmpvar_118 = xl_retval_103.pos.xyzw; - vec4 tmpvar_119; - tmpvar_119 = tmpvar_118; - gl_Position = tmpvar_119; - vec4 tmpvar_120; - tmpvar_120.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_120.x = xl_retval_103.fog; - vec4 tmpvar_121; - tmpvar_121 = tmpvar_120; - xlv_FOG = tmpvar_121; - vec4 tmpvar_122; - tmpvar_122.zw = vec2(0.0, 0.0); - tmpvar_122.xy = xl_retval_103.hip_pack0.xy; - vec4 tmpvar_123; - tmpvar_123 = tmpvar_122; - gl_TexCoord[0] = tmpvar_123; - vec4 tmpvar_124; - tmpvar_124 = xl_retval_103.lop_color.xyzw; - vec4 tmpvar_125; - tmpvar_125 = tmpvar_124; - gl_FrontColor = tmpvar_125; - vec4 tmpvar_126; - tmpvar_126.w = 0.0; - tmpvar_126.xyz = xl_retval_103.lightDir.xyz; - vec4 tmpvar_127; - tmpvar_127 = tmpvar_126; - gl_TexCoord[1] = tmpvar_127; - vec4 tmpvar_128; - tmpvar_128.w = 0.0; - tmpvar_128.xyz = xl_retval_103.viewDir.xyz; - vec4 tmpvar_129; - tmpvar_129 = tmpvar_128; - gl_TexCoord[2] = tmpvar_129; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-out.txt index d930e3b8d..9830d8ad7 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-out.txt @@ -14,92 +14,116 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; + vec3 binormal_1; vec4 tmpvar_2; - tmpvar_1.w = gl_Vertex.w; - tmpvar_2.w = TANGENT.w; - tmpvar_1.xyz = (gl_Vertex.xyz * _Scale.xyz); - vec4 pos_3; - pos_3.w = tmpvar_1.w; - vec3 bend_4; - float tmpvar_5; - tmpvar_5 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x); - vec2 tmpvar_6; - tmpvar_6.x = dot (tmpvar_1.xyz, vec3((gl_Color.y + tmpvar_5))); - tmpvar_6.y = tmpvar_5; - vec4 tmpvar_7; - tmpvar_7 = abs((( - fract(((( - fract(((_TimeX + tmpvar_6).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) - * 2.0) - 1.0) + 0.5)) - * 2.0) - 1.0)); - vec4 tmpvar_8; - tmpvar_8 = ((tmpvar_7 * tmpvar_7) * (3.0 - (2.0 * tmpvar_7))); + vec4 tmpvar_3; + tmpvar_2.w = gl_Vertex.w; + tmpvar_3.w = TANGENT.w; + tmpvar_2.xyz = (gl_Vertex.xyz * _Scale.xyz); + vec4 pos_4; + pos_4.w = tmpvar_2.w; + vec3 bend_5; + vec2 vWavesSum_6; + vec4 vWaves_7; + float fBranchPhase_8; + fBranchPhase_8 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x); vec2 tmpvar_9; - tmpvar_9 = (tmpvar_8.xz + tmpvar_8.yw); - bend_4.xz = ((gl_Color.y * 0.1) * gl_Normal).xz; - bend_4.y = (gl_MultiTexCoord1.y * 0.3); - pos_3.xyz = (tmpvar_1.xyz + (( - (tmpvar_9.xyx * bend_4) + tmpvar_9.x = dot (tmpvar_2.xyz, vec3((gl_Color.y + fBranchPhase_8))); + tmpvar_9.y = fBranchPhase_8; + vWaves_7 = ((fract( + ((_TimeX + tmpvar_9).xxyy * vec4(1.975, 0.793, 0.375, 0.193)) + ) * 2.0) - 1.0); + vec4 tmpvar_10; + tmpvar_10 = abs((( + fract((vWaves_7 + 0.5)) + * 2.0) - 1.0)); + vec4 tmpvar_11; + tmpvar_11 = ((tmpvar_10 * tmpvar_10) * (3.0 - (2.0 * tmpvar_10))); + vWaves_7 = tmpvar_11; + vWavesSum_6 = (tmpvar_11.xz + tmpvar_11.yw); + bend_5.xz = ((gl_Color.y * 0.1) * gl_Normal).xz; + bend_5.y = (gl_MultiTexCoord1.y * 0.3); + pos_4.xyz = (tmpvar_2.xyz + (( + (vWavesSum_6.xyx * bend_5) + - ((_Wind.xyz * tmpvar_9.y) * gl_MultiTexCoord1.y) + ((_Wind.xyz * vWavesSum_6.y) * gl_MultiTexCoord1.y) ) * _Wind.w)); - pos_3.xyz = (pos_3.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); - vec3 tmpvar_10; - tmpvar_10.xz = vec2(0.0, 0.0); - tmpvar_10.y = _SquashPlaneNormal.w; - vec3 tmpvar_11; - tmpvar_11 = mix ((pos_3.xyz + ( - dot (_SquashPlaneNormal.xyz, (tmpvar_10 - pos_3.xyz)) - * _SquashPlaneNormal.xyz)), pos_3.xyz, vec3(_SquashAmount)); - vec4 tmpvar_12; - tmpvar_12.w = 1.0; - tmpvar_12.xyz = tmpvar_11; - tmpvar_1 = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13.xyz = (gl_Color.w * _Color.xyz); - tmpvar_13.w = _Color.w; - vec3 tmpvar_14; - tmpvar_14 = normalize(gl_Normal); - tmpvar_2.xyz = normalize(TANGENT.xyz); + pos_4.xyz = (pos_4.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); + vec3 tmpvar_12; + tmpvar_12.xz = vec2(0.0, 0.0); + tmpvar_12.y = _SquashPlaneNormal.w; + vec3 tmpvar_13; + tmpvar_13 = mix ((pos_4.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_12 - pos_4.xyz)) + * _SquashPlaneNormal.xyz)), pos_4.xyz, vec3(_SquashAmount)); + vec4 tmpvar_14; + tmpvar_14.w = 1.0; + tmpvar_14.xyz = tmpvar_13; + tmpvar_2 = tmpvar_14; vec4 tmpvar_15; - tmpvar_15 = (gl_ModelViewProjectionMatrix * tmpvar_12); + tmpvar_15.xyz = (gl_Color.w * _Color.xyz); + tmpvar_15.w = _Color.w; vec3 tmpvar_16; - tmpvar_16 = (((tmpvar_14.yzx * tmpvar_2.zxy) - (tmpvar_14.zxy * tmpvar_2.yzx)) * TANGENT.w); - mat3 tmpvar_17; - tmpvar_17[0].x = tmpvar_2.x; - tmpvar_17[0].y = tmpvar_16.x; - tmpvar_17[0].z = tmpvar_14.x; - tmpvar_17[1].x = tmpvar_2.y; - tmpvar_17[1].y = tmpvar_16.y; - tmpvar_17[1].z = tmpvar_14.y; - tmpvar_17[2].x = tmpvar_2.z; - tmpvar_17[2].y = tmpvar_16.z; - tmpvar_17[2].z = tmpvar_14.z; - vec4 tmpvar_18; - tmpvar_18.w = 1.0; - tmpvar_18.xyz = _WorldSpaceCameraPos; - gl_Position = tmpvar_15; + tmpvar_16 = normalize(gl_Normal); + tmpvar_3.xyz = normalize(TANGENT.xyz); + vec4 pos_17; + pos_17 = (gl_ModelViewProjectionMatrix * tmpvar_14); + binormal_1 = (((tmpvar_16.yzx * tmpvar_3.zxy) - (tmpvar_16.zxy * tmpvar_3.yzx)) * TANGENT.w); + mat3 tmpvar_18; + tmpvar_18[0].x = tmpvar_3.x; + tmpvar_18[0].y = binormal_1.x; + tmpvar_18[0].z = tmpvar_16.x; + tmpvar_18[1].x = tmpvar_3.y; + tmpvar_18[1].y = binormal_1.y; + tmpvar_18[1].z = tmpvar_16.y; + tmpvar_18[2].x = tmpvar_3.z; + tmpvar_18[2].y = binormal_1.z; + tmpvar_18[2].z = tmpvar_16.z; vec4 tmpvar_19; - tmpvar_19.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_19.x = tmpvar_15.z; - xlv_FOG = tmpvar_19; + tmpvar_19.w = 1.0; + tmpvar_19.xyz = _WorldSpaceCameraPos; + gl_Position = pos_17; vec4 tmpvar_20; - tmpvar_20.zw = vec2(0.0, 0.0); - tmpvar_20.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_20; - gl_FrontColor = tmpvar_13; + tmpvar_20.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_20.x = pos_17.z; + xlv_FOG = tmpvar_20; vec4 tmpvar_21; - tmpvar_21.w = 0.0; - tmpvar_21.xyz = (tmpvar_17 * (_World2Object * _WorldSpaceLightPos0).xyz); - gl_TexCoord[1] = tmpvar_21; + tmpvar_21.zw = vec2(0.0, 0.0); + tmpvar_21.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_21; + gl_FrontColor = tmpvar_15; vec4 tmpvar_22; tmpvar_22.w = 0.0; - tmpvar_22.xyz = (tmpvar_17 * (( - (_World2Object * tmpvar_18) - .xyz * unity_Scale.w) - tmpvar_11)); - gl_TexCoord[2] = tmpvar_22; + tmpvar_22.xyz = (tmpvar_18 * (_World2Object * _WorldSpaceLightPos0).xyz); + gl_TexCoord[1] = tmpvar_22; + vec4 tmpvar_23; + tmpvar_23.w = 0.0; + tmpvar_23.xyz = (tmpvar_18 * (( + (_World2Object * tmpvar_19) + .xyz * unity_Scale.w) - tmpvar_13)); + gl_TexCoord[2] = tmpvar_23; } -// inputs: 6, stats: 59 alu 0 tex 0 flow +// stats: 59 alu 0 tex 0 flow +// inputs: 6 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #2: gl_Color (high float) 4x1 [-1] loc 3 +// #3: gl_Normal (high float) 3x1 [-1] loc 2 +// #4: gl_Vertex (high float) 4x1 [-1] loc 0 +// #5: TANGENT (high float) 4x1 [-1] +// uniforms: 13 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _Color (high float) 4x1 [-1] +// #2: _MainTex_ST (high float) 4x1 [-1] +// #3: _Object2World (high float) 4x4 [-1] +// #4: _Scale (high float) 4x1 [-1] +// #5: _SquashAmount (high float) 1x1 [-1] +// #6: _SquashPlaneNormal (high float) 4x1 [-1] +// #7: _TimeX (high float) 1x1 [-1] +// #8: _Wind (high float) 4x1 [-1] +// #9: _World2Object (high float) 4x4 [-1] +// #10: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #11: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #12: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-ir.txt deleted file mode 100644 index 4acacc687..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-ir.txt +++ /dev/null @@ -1,399 +0,0 @@ -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 lop_color; - vec3 lightDir; - vec3 viewDir; - vec3 _LightCoord; -}; -uniform vec4 _Color; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _Scale; -uniform float _SquashAmount; -uniform vec4 _SquashPlaneNormal; -uniform float _TimeX; -uniform vec4 _Wind; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -vec4 Squash ( - in vec4 pos_1 -) -{ - vec3 planeNormal_2; - vec3 planePoint_3; - vec3 projectedVertex_4; - vec3 tmpvar_5; - tmpvar_5 = pos_1.xyz; - projectedVertex_4 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6.xz = vec2(0.0, 0.0); - tmpvar_6.y = _SquashPlaneNormal.w; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_6; - planePoint_3 = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = _SquashPlaneNormal.xyz; - planeNormal_2 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = pos_1.xyz; - float tmpvar_10; - tmpvar_10 = dot (planeNormal_2, (planePoint_3 - tmpvar_9)); - vec3 tmpvar_11; - tmpvar_11 = (projectedVertex_4 + (tmpvar_10 * planeNormal_2)); - projectedVertex_4 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = vec3(_SquashAmount); - vec3 tmpvar_13; - tmpvar_13 = mix (projectedVertex_4, pos_1.xyz, tmpvar_12); - vec4 tmpvar_14; - tmpvar_14.w = 1.0; - tmpvar_14.xyz = tmpvar_13.xyz; - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - pos_1 = tmpvar_15; - return pos_1; -} - -vec4 TriangleWave ( - in vec4 x_16 -) -{ - vec4 tmpvar_17; - tmpvar_17 = fract ((x_16 + 0.5)); - vec4 tmpvar_18; - tmpvar_18 = abs (((tmpvar_17 * 2.0) - 1.0)); - return tmpvar_18; -} - -vec4 SmoothCurve ( - in vec4 x_19 -) -{ - return ((x_19 * x_19) * (3.0 - (2.0 * x_19))); -} - -vec4 SmoothTriangleWave ( - in vec4 x_20 -) -{ - vec4 tmpvar_21; - tmpvar_21 = TriangleWave (x_20); - vec4 tmpvar_22; - tmpvar_22 = SmoothCurve (tmpvar_21); - return tmpvar_22; -} - -vec4 AnimateVertex ( - in vec4 pos_23, - in vec3 normal_24, - in vec4 animParams_25 -) -{ - vec3 bend_26; - vec2 vWavesSum_27; - vec4 vWaves_28; - vec2 vWavesIn_29; - float fVtxPhase_30; - float fBranchPhase_31; - float fObjPhase_32; - float fBranchAmp_33; - float fDetailAmp_34; - float tmpvar_35; - tmpvar_35 = 0.1; - fDetailAmp_34 = tmpvar_35; - float tmpvar_36; - tmpvar_36 = 0.3; - fBranchAmp_33 = tmpvar_36; - float tmpvar_37; - tmpvar_37 = dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)); - float tmpvar_38; - tmpvar_38 = tmpvar_37; - fObjPhase_32 = tmpvar_38; - float tmpvar_39; - tmpvar_39 = (fObjPhase_32 + animParams_25.x); - fBranchPhase_31 = tmpvar_39; - vec3 tmpvar_40; - tmpvar_40 = vec3((animParams_25.y + fBranchPhase_31)); - float tmpvar_41; - tmpvar_41 = dot (pos_23.xyz, tmpvar_40); - float tmpvar_42; - tmpvar_42 = tmpvar_41; - fVtxPhase_30 = tmpvar_42; - vec2 tmpvar_43; - tmpvar_43.x = fVtxPhase_30; - tmpvar_43.y = fBranchPhase_31; - vec2 tmpvar_44; - tmpvar_44 = (_TimeX + tmpvar_43); - vWavesIn_29 = tmpvar_44; - vec4 tmpvar_45; - tmpvar_45 = fract ((vWavesIn_29.xxyy * vec4(1.975, 0.793, 0.375, 0.193))); - vec4 tmpvar_46; - tmpvar_46 = ((tmpvar_45 * 2.0) - 1.0); - vWaves_28 = tmpvar_46; - vec4 tmpvar_47; - tmpvar_47 = SmoothTriangleWave (vWaves_28); - vec4 tmpvar_48; - tmpvar_48 = tmpvar_47; - vWaves_28 = tmpvar_48; - vec2 tmpvar_49; - tmpvar_49 = (vWaves_28.xz + vWaves_28.yw); - vWavesSum_27 = tmpvar_49; - vec3 tmpvar_50; - tmpvar_50 = ((animParams_25.y * fDetailAmp_34) * normal_24.xyz); - bend_26 = tmpvar_50; - float tmpvar_51; - tmpvar_51 = (animParams_25.w * fBranchAmp_33); - bend_26.y = vec2(tmpvar_51).y; - vec3 tmpvar_52; - tmpvar_52 = (pos_23.xyz + (( - (vWavesSum_27.xyx * bend_26) - + - ((_Wind.xyz * vWavesSum_27.y) * animParams_25.w) - ) * _Wind.w)); - pos_23.xyz = tmpvar_52.xyz.xyz; - vec3 tmpvar_53; - tmpvar_53 = (pos_23.xyz + (animParams_25.z * _Wind.xyz)); - pos_23.xyz = tmpvar_53.xyz.xyz; - return pos_23; -} - -void TreeVertBark ( - inout appdata_full v_54 -) -{ - vec3 tmpvar_55; - tmpvar_55 = (v_54.vertex.xyz * _Scale.xyz); - v_54.vertex.xyz = tmpvar_55.xyz.xyz; - vec4 tmpvar_56; - tmpvar_56.xy = v_54.color.xy.xy; - tmpvar_56.zw = v_54.texcoord1.xy.xy; - vec4 tmpvar_57; - tmpvar_57 = AnimateVertex (v_54.vertex, v_54.normal, tmpvar_56); - vec4 tmpvar_58; - tmpvar_58 = tmpvar_57; - v_54.vertex = tmpvar_58; - vec4 tmpvar_59; - tmpvar_59 = Squash (v_54.vertex); - vec4 tmpvar_60; - tmpvar_60 = tmpvar_59; - v_54.vertex = tmpvar_60; - vec4 tmpvar_61; - tmpvar_61.xyz = (v_54.color.w * _Color.xyz).xyz; - tmpvar_61.w = _Color.w; - vec4 tmpvar_62; - tmpvar_62 = tmpvar_61; - v_54.color = tmpvar_62; - vec3 tmpvar_63; - tmpvar_63 = normalize (v_54.normal); - vec3 tmpvar_64; - tmpvar_64 = tmpvar_63; - v_54.normal = tmpvar_64; - vec3 tmpvar_65; - tmpvar_65 = normalize (v_54.tangent.xyz); - vec3 tmpvar_66; - tmpvar_66 = tmpvar_65; - v_54.tangent.xyz = tmpvar_66.xyz.xyz; -} - -void PositionFog ( - in vec4 v_67, - out vec4 pos_68, - out float fog_69 -) -{ - vec4 tmpvar_70; - tmpvar_70 = (gl_ModelViewProjectionMatrix * v_67); - pos_68 = tmpvar_70; - float tmpvar_71; - tmpvar_71 = pos_68.z; - fog_69 = tmpvar_71; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_72 -) -{ - vec3 objSpaceCameraPos_73; - vec4 tmpvar_74; - tmpvar_74.w = 1.0; - tmpvar_74.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_75; - tmpvar_75 = ((_World2Object * tmpvar_74).xyz * unity_Scale.w); - objSpaceCameraPos_73 = tmpvar_75; - return (objSpaceCameraPos_73 - v_72.xyz); -} - -vec3 ObjSpaceLightDir ( - in vec4 v_76 -) -{ - vec3 objSpaceLightPos_77; - vec3 tmpvar_78; - tmpvar_78 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_77 = tmpvar_78; - return ((objSpaceLightPos_77.xyz * unity_Scale.w) - v_76.xyz); -} - -v2f_surf vert_surf ( - in appdata_full v_79 -) -{ - mat3 rotation_80; - vec3 binormal_81; - v2f_surf o_82; - TreeVertBark (v_79); - PositionFog (v_79.vertex, o_82.pos, o_82.fog); - vec2 tmpvar_83; - tmpvar_83 = ((v_79.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_82.hip_pack0 = tmpvar_83.xy.xy; - vec4 tmpvar_84; - tmpvar_84 = v_79.color; - o_82.lop_color = tmpvar_84; - vec3 tmpvar_85; - tmpvar_85 = cross (v_79.normal, v_79.tangent.xyz); - vec3 tmpvar_86; - tmpvar_86 = (tmpvar_85 * v_79.tangent.w); - binormal_81 = tmpvar_86; - mat3 tmpvar_87; - float tmpvar_88; - tmpvar_88 = v_79.tangent.x; - tmpvar_87[0].x = tmpvar_88; - float tmpvar_89; - tmpvar_89 = binormal_81.x; - tmpvar_87[0].y = tmpvar_89; - float tmpvar_90; - tmpvar_90 = v_79.normal.x; - tmpvar_87[0].z = tmpvar_90; - float tmpvar_91; - tmpvar_91 = v_79.tangent.y; - tmpvar_87[1].x = tmpvar_91; - float tmpvar_92; - tmpvar_92 = binormal_81.y; - tmpvar_87[1].y = tmpvar_92; - float tmpvar_93; - tmpvar_93 = v_79.normal.y; - tmpvar_87[1].z = tmpvar_93; - float tmpvar_94; - tmpvar_94 = v_79.tangent.z; - tmpvar_87[2].x = tmpvar_94; - float tmpvar_95; - tmpvar_95 = binormal_81.z; - tmpvar_87[2].y = tmpvar_95; - float tmpvar_96; - tmpvar_96 = v_79.normal.z; - tmpvar_87[2].z = tmpvar_96; - mat3 tmpvar_97; - tmpvar_97 = tmpvar_87; - rotation_80 = tmpvar_97; - vec3 tmpvar_98; - tmpvar_98 = ObjSpaceLightDir (v_79.vertex); - vec3 tmpvar_99; - tmpvar_99 = (rotation_80 * tmpvar_98); - o_82.lightDir = tmpvar_99; - vec3 tmpvar_100; - tmpvar_100 = ObjSpaceViewDir (v_79.vertex); - vec3 tmpvar_101; - tmpvar_101 = (rotation_80 * tmpvar_100); - o_82.viewDir = tmpvar_101; - vec3 tmpvar_102; - tmpvar_102 = (_LightMatrix0 * (_Object2World * v_79.vertex)).xyz; - o_82._LightCoord = tmpvar_102; - return o_82; -} - -void main () -{ - appdata_full xlt_v_103; - v2f_surf xl_retval_104; - vec4 tmpvar_105; - tmpvar_105 = gl_Vertex.xyzw; - vec4 tmpvar_106; - tmpvar_106 = tmpvar_105; - xlt_v_103.vertex = tmpvar_106; - vec4 tmpvar_107; - tmpvar_107 = TANGENT.xyzw; - vec4 tmpvar_108; - tmpvar_108 = tmpvar_107; - xlt_v_103.tangent = tmpvar_108; - vec3 tmpvar_109; - tmpvar_109 = gl_Normal.xyz; - vec3 tmpvar_110; - tmpvar_110 = tmpvar_109; - xlt_v_103.normal = tmpvar_110; - vec4 tmpvar_111; - tmpvar_111 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_112; - tmpvar_112 = tmpvar_111; - xlt_v_103.texcoord = tmpvar_112; - vec4 tmpvar_113; - tmpvar_113 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_114; - tmpvar_114 = tmpvar_113; - xlt_v_103.texcoord1 = tmpvar_114; - vec4 tmpvar_115; - tmpvar_115 = gl_Color.xyzw; - vec4 tmpvar_116; - tmpvar_116 = tmpvar_115; - xlt_v_103.color = tmpvar_116; - v2f_surf tmpvar_117; - tmpvar_117 = vert_surf (xlt_v_103); - v2f_surf tmpvar_118; - tmpvar_118 = tmpvar_117; - xl_retval_104 = tmpvar_118; - vec4 tmpvar_119; - tmpvar_119 = xl_retval_104.pos.xyzw; - vec4 tmpvar_120; - tmpvar_120 = tmpvar_119; - gl_Position = tmpvar_120; - vec4 tmpvar_121; - tmpvar_121.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_121.x = xl_retval_104.fog; - vec4 tmpvar_122; - tmpvar_122 = tmpvar_121; - xlv_FOG = tmpvar_122; - vec4 tmpvar_123; - tmpvar_123.zw = vec2(0.0, 0.0); - tmpvar_123.xy = xl_retval_104.hip_pack0.xy; - vec4 tmpvar_124; - tmpvar_124 = tmpvar_123; - gl_TexCoord[0] = tmpvar_124; - vec4 tmpvar_125; - tmpvar_125 = xl_retval_104.lop_color.xyzw; - vec4 tmpvar_126; - tmpvar_126 = tmpvar_125; - gl_FrontColor = tmpvar_126; - vec4 tmpvar_127; - tmpvar_127.w = 0.0; - tmpvar_127.xyz = xl_retval_104.lightDir.xyz; - vec4 tmpvar_128; - tmpvar_128 = tmpvar_127; - gl_TexCoord[1] = tmpvar_128; - vec4 tmpvar_129; - tmpvar_129.w = 0.0; - tmpvar_129.xyz = xl_retval_104.viewDir.xyz; - vec4 tmpvar_130; - tmpvar_130 = tmpvar_129; - gl_TexCoord[2] = tmpvar_130; - vec4 tmpvar_131; - tmpvar_131.w = 0.0; - tmpvar_131.xyz = xl_retval_104._LightCoord.xyz; - vec4 tmpvar_132; - tmpvar_132 = tmpvar_131; - gl_TexCoord[3] = tmpvar_132; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-out.txt index 6019b9c9d..a11d06d2f 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-out.txt @@ -15,98 +15,123 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; + vec3 binormal_1; vec4 tmpvar_2; - tmpvar_1.w = gl_Vertex.w; - tmpvar_2.w = TANGENT.w; - tmpvar_1.xyz = (gl_Vertex.xyz * _Scale.xyz); - vec4 pos_3; - pos_3.w = tmpvar_1.w; - vec3 bend_4; - float tmpvar_5; - tmpvar_5 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x); - vec2 tmpvar_6; - tmpvar_6.x = dot (tmpvar_1.xyz, vec3((gl_Color.y + tmpvar_5))); - tmpvar_6.y = tmpvar_5; - vec4 tmpvar_7; - tmpvar_7 = abs((( - fract(((( - fract(((_TimeX + tmpvar_6).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) - * 2.0) - 1.0) + 0.5)) - * 2.0) - 1.0)); - vec4 tmpvar_8; - tmpvar_8 = ((tmpvar_7 * tmpvar_7) * (3.0 - (2.0 * tmpvar_7))); + vec4 tmpvar_3; + tmpvar_2.w = gl_Vertex.w; + tmpvar_3.w = TANGENT.w; + tmpvar_2.xyz = (gl_Vertex.xyz * _Scale.xyz); + vec4 pos_4; + pos_4.w = tmpvar_2.w; + vec3 bend_5; + vec2 vWavesSum_6; + vec4 vWaves_7; + float fBranchPhase_8; + fBranchPhase_8 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x); vec2 tmpvar_9; - tmpvar_9 = (tmpvar_8.xz + tmpvar_8.yw); - bend_4.xz = ((gl_Color.y * 0.1) * gl_Normal).xz; - bend_4.y = (gl_MultiTexCoord1.y * 0.3); - pos_3.xyz = (tmpvar_1.xyz + (( - (tmpvar_9.xyx * bend_4) + tmpvar_9.x = dot (tmpvar_2.xyz, vec3((gl_Color.y + fBranchPhase_8))); + tmpvar_9.y = fBranchPhase_8; + vWaves_7 = ((fract( + ((_TimeX + tmpvar_9).xxyy * vec4(1.975, 0.793, 0.375, 0.193)) + ) * 2.0) - 1.0); + vec4 tmpvar_10; + tmpvar_10 = abs((( + fract((vWaves_7 + 0.5)) + * 2.0) - 1.0)); + vec4 tmpvar_11; + tmpvar_11 = ((tmpvar_10 * tmpvar_10) * (3.0 - (2.0 * tmpvar_10))); + vWaves_7 = tmpvar_11; + vWavesSum_6 = (tmpvar_11.xz + tmpvar_11.yw); + bend_5.xz = ((gl_Color.y * 0.1) * gl_Normal).xz; + bend_5.y = (gl_MultiTexCoord1.y * 0.3); + pos_4.xyz = (tmpvar_2.xyz + (( + (vWavesSum_6.xyx * bend_5) + - ((_Wind.xyz * tmpvar_9.y) * gl_MultiTexCoord1.y) + ((_Wind.xyz * vWavesSum_6.y) * gl_MultiTexCoord1.y) ) * _Wind.w)); - pos_3.xyz = (pos_3.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); - vec3 tmpvar_10; - tmpvar_10.xz = vec2(0.0, 0.0); - tmpvar_10.y = _SquashPlaneNormal.w; - vec3 tmpvar_11; - tmpvar_11 = mix ((pos_3.xyz + ( - dot (_SquashPlaneNormal.xyz, (tmpvar_10 - pos_3.xyz)) - * _SquashPlaneNormal.xyz)), pos_3.xyz, vec3(_SquashAmount)); - vec4 tmpvar_12; - tmpvar_12.w = 1.0; - tmpvar_12.xyz = tmpvar_11; - tmpvar_1 = tmpvar_12; - vec4 tmpvar_13; - tmpvar_13.xyz = (gl_Color.w * _Color.xyz); - tmpvar_13.w = _Color.w; - vec3 tmpvar_14; - tmpvar_14 = normalize(gl_Normal); - tmpvar_2.xyz = normalize(TANGENT.xyz); + pos_4.xyz = (pos_4.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); + vec3 tmpvar_12; + tmpvar_12.xz = vec2(0.0, 0.0); + tmpvar_12.y = _SquashPlaneNormal.w; + vec3 tmpvar_13; + tmpvar_13 = mix ((pos_4.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_12 - pos_4.xyz)) + * _SquashPlaneNormal.xyz)), pos_4.xyz, vec3(_SquashAmount)); + vec4 tmpvar_14; + tmpvar_14.w = 1.0; + tmpvar_14.xyz = tmpvar_13; + tmpvar_2 = tmpvar_14; vec4 tmpvar_15; - tmpvar_15 = (gl_ModelViewProjectionMatrix * tmpvar_12); + tmpvar_15.xyz = (gl_Color.w * _Color.xyz); + tmpvar_15.w = _Color.w; vec3 tmpvar_16; - tmpvar_16 = (((tmpvar_14.yzx * tmpvar_2.zxy) - (tmpvar_14.zxy * tmpvar_2.yzx)) * TANGENT.w); - mat3 tmpvar_17; - tmpvar_17[0].x = tmpvar_2.x; - tmpvar_17[0].y = tmpvar_16.x; - tmpvar_17[0].z = tmpvar_14.x; - tmpvar_17[1].x = tmpvar_2.y; - tmpvar_17[1].y = tmpvar_16.y; - tmpvar_17[1].z = tmpvar_14.y; - tmpvar_17[2].x = tmpvar_2.z; - tmpvar_17[2].y = tmpvar_16.z; - tmpvar_17[2].z = tmpvar_14.z; - vec4 tmpvar_18; - tmpvar_18.w = 1.0; - tmpvar_18.xyz = _WorldSpaceCameraPos; - gl_Position = tmpvar_15; + tmpvar_16 = normalize(gl_Normal); + tmpvar_3.xyz = normalize(TANGENT.xyz); + vec4 pos_17; + pos_17 = (gl_ModelViewProjectionMatrix * tmpvar_14); + binormal_1 = (((tmpvar_16.yzx * tmpvar_3.zxy) - (tmpvar_16.zxy * tmpvar_3.yzx)) * TANGENT.w); + mat3 tmpvar_18; + tmpvar_18[0].x = tmpvar_3.x; + tmpvar_18[0].y = binormal_1.x; + tmpvar_18[0].z = tmpvar_16.x; + tmpvar_18[1].x = tmpvar_3.y; + tmpvar_18[1].y = binormal_1.y; + tmpvar_18[1].z = tmpvar_16.y; + tmpvar_18[2].x = tmpvar_3.z; + tmpvar_18[2].y = binormal_1.z; + tmpvar_18[2].z = tmpvar_16.z; vec4 tmpvar_19; - tmpvar_19.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_19.x = tmpvar_15.z; - xlv_FOG = tmpvar_19; + tmpvar_19.w = 1.0; + tmpvar_19.xyz = _WorldSpaceCameraPos; + gl_Position = pos_17; vec4 tmpvar_20; - tmpvar_20.zw = vec2(0.0, 0.0); - tmpvar_20.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_20; - gl_FrontColor = tmpvar_13; + tmpvar_20.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_20.x = pos_17.z; + xlv_FOG = tmpvar_20; vec4 tmpvar_21; - tmpvar_21.w = 0.0; - tmpvar_21.xyz = (tmpvar_17 * (( - (_World2Object * _WorldSpaceLightPos0) - .xyz * unity_Scale.w) - tmpvar_11)); - gl_TexCoord[1] = tmpvar_21; + tmpvar_21.zw = vec2(0.0, 0.0); + tmpvar_21.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_21; + gl_FrontColor = tmpvar_15; vec4 tmpvar_22; tmpvar_22.w = 0.0; - tmpvar_22.xyz = (tmpvar_17 * (( - (_World2Object * tmpvar_18) - .xyz * unity_Scale.w) - tmpvar_11)); - gl_TexCoord[2] = tmpvar_22; + tmpvar_22.xyz = (tmpvar_18 * (( + (_World2Object * _WorldSpaceLightPos0) + .xyz * unity_Scale.w) - tmpvar_13)); + gl_TexCoord[1] = tmpvar_22; vec4 tmpvar_23; tmpvar_23.w = 0.0; - tmpvar_23.xyz = (_LightMatrix0 * (_Object2World * tmpvar_12)).xyz; - gl_TexCoord[3] = tmpvar_23; + tmpvar_23.xyz = (tmpvar_18 * (( + (_World2Object * tmpvar_19) + .xyz * unity_Scale.w) - tmpvar_13)); + gl_TexCoord[2] = tmpvar_23; + vec4 tmpvar_24; + tmpvar_24.w = 0.0; + tmpvar_24.xyz = (_LightMatrix0 * (_Object2World * tmpvar_14)).xyz; + gl_TexCoord[3] = tmpvar_24; } -// inputs: 6, stats: 64 alu 0 tex 0 flow +// stats: 64 alu 0 tex 0 flow +// inputs: 6 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #2: gl_Color (high float) 4x1 [-1] loc 3 +// #3: gl_Normal (high float) 3x1 [-1] loc 2 +// #4: gl_Vertex (high float) 4x1 [-1] loc 0 +// #5: TANGENT (high float) 4x1 [-1] +// uniforms: 14 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _Color (high float) 4x1 [-1] +// #2: _LightMatrix0 (high float) 4x4 [-1] +// #3: _MainTex_ST (high float) 4x1 [-1] +// #4: _Object2World (high float) 4x4 [-1] +// #5: _Scale (high float) 4x1 [-1] +// #6: _SquashAmount (high float) 1x1 [-1] +// #7: _SquashPlaneNormal (high float) 4x1 [-1] +// #8: _TimeX (high float) 1x1 [-1] +// #9: _Wind (high float) 4x1 [-1] +// #10: _World2Object (high float) 4x4 [-1] +// #11: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #12: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #13: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-ir.txt deleted file mode 100644 index 916639786..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-ir.txt +++ /dev/null @@ -1,458 +0,0 @@ -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - float fog; - vec2 hip_pack0; - vec4 lop_color; - vec3 lightDir; - vec3 viewDir; - vec3 _LightCoord; -}; -uniform vec4 _Color; -uniform mat4 _LightMatrix0; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _Scale; -uniform float _SquashAmount; -uniform vec4 _SquashPlaneNormal; -uniform float _TimeX; -uniform vec4 _Wind; -uniform mat4 _World2Object; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 unity_Scale; -attribute vec4 TANGENT; -varying vec4 xlv_FOG; -vec4 Squash ( - in vec4 pos_1 -) -{ - vec3 planeNormal_2; - vec3 planePoint_3; - vec3 projectedVertex_4; - vec3 tmpvar_5; - tmpvar_5 = pos_1.xyz; - projectedVertex_4 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6.xz = vec2(0.0, 0.0); - tmpvar_6.y = _SquashPlaneNormal.w; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_6; - planePoint_3 = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = _SquashPlaneNormal.xyz; - planeNormal_2 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = pos_1.xyz; - float tmpvar_10; - tmpvar_10 = dot (planeNormal_2, (planePoint_3 - tmpvar_9)); - vec3 tmpvar_11; - tmpvar_11 = (projectedVertex_4 + (tmpvar_10 * planeNormal_2)); - projectedVertex_4 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = vec3(_SquashAmount); - vec3 tmpvar_13; - tmpvar_13 = mix (projectedVertex_4, pos_1.xyz, tmpvar_12); - vec4 tmpvar_14; - tmpvar_14.w = 1.0; - tmpvar_14.xyz = tmpvar_13.xyz; - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - pos_1 = tmpvar_15; - return pos_1; -} - -void ExpandBillboard ( - in mat4 mat_16, - inout vec4 pos_17, - inout vec3 normal_18, - inout vec4 tangent_19 -) -{ - vec3 tanb_20; - vec3 norb_21; - float isBillboard_22; - float tmpvar_23; - tmpvar_23 = abs (tangent_19.w); - float tmpvar_24; - tmpvar_24 = (1.0 - tmpvar_23); - isBillboard_22 = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25.w = 0.0; - tmpvar_25.xyz = normal_18.xyz; - vec4 tmpvar_26; - tmpvar_26 = normalize ((tmpvar_25 * mat_16)); - vec3 tmpvar_27; - tmpvar_27 = tmpvar_26.xyz; - vec3 tmpvar_28; - tmpvar_28 = tmpvar_27; - norb_21 = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29.yw = vec2(0.0, 0.0); - tmpvar_29.x = normal_18.z; - tmpvar_29.z = -(normal_18.x); - vec4 tmpvar_30; - tmpvar_30 = normalize ((tmpvar_29 * mat_16)); - vec3 tmpvar_31; - tmpvar_31 = tmpvar_30.xyz; - vec3 tmpvar_32; - tmpvar_32 = tmpvar_31; - tanb_20 = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = (pos_17 + ((tangent_19 * mat_16) * isBillboard_22)); - pos_17 = tmpvar_33; - vec3 tmpvar_34; - tmpvar_34 = vec3(isBillboard_22); - vec3 tmpvar_35; - tmpvar_35 = mix (normal_18, norb_21, tmpvar_34); - vec3 tmpvar_36; - tmpvar_36 = tmpvar_35; - normal_18 = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37.w = -1.0; - tmpvar_37.xyz = tanb_20.xyz; - vec4 tmpvar_38; - tmpvar_38 = vec4(isBillboard_22); - vec4 tmpvar_39; - tmpvar_39 = mix (tangent_19, tmpvar_37, tmpvar_38); - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - tangent_19 = tmpvar_40; -} - -vec4 TriangleWave ( - in vec4 x_41 -) -{ - vec4 tmpvar_42; - tmpvar_42 = fract ((x_41 + 0.5)); - vec4 tmpvar_43; - tmpvar_43 = abs (((tmpvar_42 * 2.0) - 1.0)); - return tmpvar_43; -} - -vec4 SmoothCurve ( - in vec4 x_44 -) -{ - return ((x_44 * x_44) * (3.0 - (2.0 * x_44))); -} - -vec4 SmoothTriangleWave ( - in vec4 x_45 -) -{ - vec4 tmpvar_46; - tmpvar_46 = TriangleWave (x_45); - vec4 tmpvar_47; - tmpvar_47 = SmoothCurve (tmpvar_46); - return tmpvar_47; -} - -vec4 AnimateVertex ( - in vec4 pos_48, - in vec3 normal_49, - in vec4 animParams_50 -) -{ - vec3 bend_51; - vec2 vWavesSum_52; - vec4 vWaves_53; - vec2 vWavesIn_54; - float fVtxPhase_55; - float fBranchPhase_56; - float fObjPhase_57; - float fBranchAmp_58; - float fDetailAmp_59; - float tmpvar_60; - tmpvar_60 = 0.1; - fDetailAmp_59 = tmpvar_60; - float tmpvar_61; - tmpvar_61 = 0.3; - fBranchAmp_58 = tmpvar_61; - float tmpvar_62; - tmpvar_62 = dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)); - float tmpvar_63; - tmpvar_63 = tmpvar_62; - fObjPhase_57 = tmpvar_63; - float tmpvar_64; - tmpvar_64 = (fObjPhase_57 + animParams_50.x); - fBranchPhase_56 = tmpvar_64; - vec3 tmpvar_65; - tmpvar_65 = vec3((animParams_50.y + fBranchPhase_56)); - float tmpvar_66; - tmpvar_66 = dot (pos_48.xyz, tmpvar_65); - float tmpvar_67; - tmpvar_67 = tmpvar_66; - fVtxPhase_55 = tmpvar_67; - vec2 tmpvar_68; - tmpvar_68.x = fVtxPhase_55; - tmpvar_68.y = fBranchPhase_56; - vec2 tmpvar_69; - tmpvar_69 = (_TimeX + tmpvar_68); - vWavesIn_54 = tmpvar_69; - vec4 tmpvar_70; - tmpvar_70 = fract ((vWavesIn_54.xxyy * vec4(1.975, 0.793, 0.375, 0.193))); - vec4 tmpvar_71; - tmpvar_71 = ((tmpvar_70 * 2.0) - 1.0); - vWaves_53 = tmpvar_71; - vec4 tmpvar_72; - tmpvar_72 = SmoothTriangleWave (vWaves_53); - vec4 tmpvar_73; - tmpvar_73 = tmpvar_72; - vWaves_53 = tmpvar_73; - vec2 tmpvar_74; - tmpvar_74 = (vWaves_53.xz + vWaves_53.yw); - vWavesSum_52 = tmpvar_74; - vec3 tmpvar_75; - tmpvar_75 = ((animParams_50.y * fDetailAmp_59) * normal_49.xyz); - bend_51 = tmpvar_75; - float tmpvar_76; - tmpvar_76 = (animParams_50.w * fBranchAmp_58); - bend_51.y = vec2(tmpvar_76).y; - vec3 tmpvar_77; - tmpvar_77 = (pos_48.xyz + (( - (vWavesSum_52.xyx * bend_51) - + - ((_Wind.xyz * vWavesSum_52.y) * animParams_50.w) - ) * _Wind.w)); - pos_48.xyz = tmpvar_77.xyz.xyz; - vec3 tmpvar_78; - tmpvar_78 = (pos_48.xyz + (animParams_50.z * _Wind.xyz)); - pos_48.xyz = tmpvar_78.xyz.xyz; - return pos_48; -} - -void TreeVertLeaf ( - inout appdata_full v_79 -) -{ - ExpandBillboard (gl_ModelViewMatrixInverseTranspose, v_79.vertex, v_79.normal, v_79.tangent); - vec3 tmpvar_80; - tmpvar_80 = (v_79.vertex.xyz * _Scale.xyz); - v_79.vertex.xyz = tmpvar_80.xyz.xyz; - vec4 tmpvar_81; - tmpvar_81.xy = v_79.color.xy.xy; - tmpvar_81.zw = v_79.texcoord1.xy.xy; - vec4 tmpvar_82; - tmpvar_82 = AnimateVertex (v_79.vertex, v_79.normal, tmpvar_81); - vec4 tmpvar_83; - tmpvar_83 = tmpvar_82; - v_79.vertex = tmpvar_83; - vec4 tmpvar_84; - tmpvar_84 = Squash (v_79.vertex); - vec4 tmpvar_85; - tmpvar_85 = tmpvar_84; - v_79.vertex = tmpvar_85; - vec4 tmpvar_86; - tmpvar_86.xyz = (v_79.color.w * _Color.xyz).xyz; - tmpvar_86.w = _Color.w; - vec4 tmpvar_87; - tmpvar_87 = tmpvar_86; - v_79.color = tmpvar_87; - vec3 tmpvar_88; - tmpvar_88 = normalize (v_79.normal); - vec3 tmpvar_89; - tmpvar_89 = tmpvar_88; - v_79.normal = tmpvar_89; - vec3 tmpvar_90; - tmpvar_90 = normalize (v_79.tangent.xyz); - vec3 tmpvar_91; - tmpvar_91 = tmpvar_90; - v_79.tangent.xyz = tmpvar_91.xyz.xyz; -} - -void PositionFog ( - in vec4 v_92, - out vec4 pos_93, - out float fog_94 -) -{ - vec4 tmpvar_95; - tmpvar_95 = (gl_ModelViewProjectionMatrix * v_92); - pos_93 = tmpvar_95; - float tmpvar_96; - tmpvar_96 = pos_93.z; - fog_94 = tmpvar_96; -} - -vec3 ObjSpaceViewDir ( - in vec4 v_97 -) -{ - vec3 objSpaceCameraPos_98; - vec4 tmpvar_99; - tmpvar_99.w = 1.0; - tmpvar_99.xyz = _WorldSpaceCameraPos.xyz.xyz; - vec3 tmpvar_100; - tmpvar_100 = ((_World2Object * tmpvar_99).xyz * unity_Scale.w); - objSpaceCameraPos_98 = tmpvar_100; - return (objSpaceCameraPos_98 - v_97.xyz); -} - -vec3 ObjSpaceLightDir ( - in vec4 v_101 -) -{ - vec3 objSpaceLightPos_102; - vec3 tmpvar_103; - tmpvar_103 = (_World2Object * _WorldSpaceLightPos0).xyz; - objSpaceLightPos_102 = tmpvar_103; - return ((objSpaceLightPos_102.xyz * unity_Scale.w) - v_101.xyz); -} - -v2f_surf vert_surf ( - in appdata_full v_104 -) -{ - mat3 rotation_105; - vec3 binormal_106; - v2f_surf o_107; - TreeVertLeaf (v_104); - PositionFog (v_104.vertex, o_107.pos, o_107.fog); - vec2 tmpvar_108; - tmpvar_108 = ((v_104.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_107.hip_pack0 = tmpvar_108.xy.xy; - vec4 tmpvar_109; - tmpvar_109 = v_104.color; - o_107.lop_color = tmpvar_109; - vec3 tmpvar_110; - tmpvar_110 = cross (v_104.normal, v_104.tangent.xyz); - vec3 tmpvar_111; - tmpvar_111 = (tmpvar_110 * v_104.tangent.w); - binormal_106 = tmpvar_111; - mat3 tmpvar_112; - float tmpvar_113; - tmpvar_113 = v_104.tangent.x; - tmpvar_112[0].x = tmpvar_113; - float tmpvar_114; - tmpvar_114 = binormal_106.x; - tmpvar_112[0].y = tmpvar_114; - float tmpvar_115; - tmpvar_115 = v_104.normal.x; - tmpvar_112[0].z = tmpvar_115; - float tmpvar_116; - tmpvar_116 = v_104.tangent.y; - tmpvar_112[1].x = tmpvar_116; - float tmpvar_117; - tmpvar_117 = binormal_106.y; - tmpvar_112[1].y = tmpvar_117; - float tmpvar_118; - tmpvar_118 = v_104.normal.y; - tmpvar_112[1].z = tmpvar_118; - float tmpvar_119; - tmpvar_119 = v_104.tangent.z; - tmpvar_112[2].x = tmpvar_119; - float tmpvar_120; - tmpvar_120 = binormal_106.z; - tmpvar_112[2].y = tmpvar_120; - float tmpvar_121; - tmpvar_121 = v_104.normal.z; - tmpvar_112[2].z = tmpvar_121; - mat3 tmpvar_122; - tmpvar_122 = tmpvar_112; - rotation_105 = tmpvar_122; - vec3 tmpvar_123; - tmpvar_123 = ObjSpaceLightDir (v_104.vertex); - vec3 tmpvar_124; - tmpvar_124 = (rotation_105 * tmpvar_123); - o_107.lightDir = tmpvar_124; - vec3 tmpvar_125; - tmpvar_125 = ObjSpaceViewDir (v_104.vertex); - vec3 tmpvar_126; - tmpvar_126 = (rotation_105 * tmpvar_125); - o_107.viewDir = tmpvar_126; - vec3 tmpvar_127; - tmpvar_127 = (_LightMatrix0 * (_Object2World * v_104.vertex)).xyz; - o_107._LightCoord = tmpvar_127; - return o_107; -} - -void main () -{ - appdata_full xlt_v_128; - v2f_surf xl_retval_129; - vec4 tmpvar_130; - tmpvar_130 = gl_Vertex.xyzw; - vec4 tmpvar_131; - tmpvar_131 = tmpvar_130; - xlt_v_128.vertex = tmpvar_131; - vec4 tmpvar_132; - tmpvar_132 = TANGENT.xyzw; - vec4 tmpvar_133; - tmpvar_133 = tmpvar_132; - xlt_v_128.tangent = tmpvar_133; - vec3 tmpvar_134; - tmpvar_134 = gl_Normal.xyz; - vec3 tmpvar_135; - tmpvar_135 = tmpvar_134; - xlt_v_128.normal = tmpvar_135; - vec4 tmpvar_136; - tmpvar_136 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_137; - tmpvar_137 = tmpvar_136; - xlt_v_128.texcoord = tmpvar_137; - vec4 tmpvar_138; - tmpvar_138 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_139; - tmpvar_139 = tmpvar_138; - xlt_v_128.texcoord1 = tmpvar_139; - vec4 tmpvar_140; - tmpvar_140 = gl_Color.xyzw; - vec4 tmpvar_141; - tmpvar_141 = tmpvar_140; - xlt_v_128.color = tmpvar_141; - v2f_surf tmpvar_142; - tmpvar_142 = vert_surf (xlt_v_128); - v2f_surf tmpvar_143; - tmpvar_143 = tmpvar_142; - xl_retval_129 = tmpvar_143; - vec4 tmpvar_144; - tmpvar_144 = xl_retval_129.pos.xyzw; - vec4 tmpvar_145; - tmpvar_145 = tmpvar_144; - gl_Position = tmpvar_145; - vec4 tmpvar_146; - tmpvar_146.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_146.x = xl_retval_129.fog; - vec4 tmpvar_147; - tmpvar_147 = tmpvar_146; - xlv_FOG = tmpvar_147; - vec4 tmpvar_148; - tmpvar_148.zw = vec2(0.0, 0.0); - tmpvar_148.xy = xl_retval_129.hip_pack0.xy; - vec4 tmpvar_149; - tmpvar_149 = tmpvar_148; - gl_TexCoord[0] = tmpvar_149; - vec4 tmpvar_150; - tmpvar_150 = xl_retval_129.lop_color.xyzw; - vec4 tmpvar_151; - tmpvar_151 = tmpvar_150; - gl_FrontColor = tmpvar_151; - vec4 tmpvar_152; - tmpvar_152.w = 0.0; - tmpvar_152.xyz = xl_retval_129.lightDir.xyz; - vec4 tmpvar_153; - tmpvar_153 = tmpvar_152; - gl_TexCoord[1] = tmpvar_153; - vec4 tmpvar_154; - tmpvar_154.w = 0.0; - tmpvar_154.xyz = xl_retval_129.viewDir.xyz; - vec4 tmpvar_155; - tmpvar_155 = tmpvar_154; - gl_TexCoord[2] = tmpvar_155; - vec4 tmpvar_156; - tmpvar_156.w = 0.0; - tmpvar_156.xyz = xl_retval_129._LightCoord.xyz; - vec4 tmpvar_157; - tmpvar_157 = tmpvar_156; - gl_TexCoord[3] = tmpvar_157; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-out.txt index 27635dfc2..1dbc26587 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-out.txt @@ -15,116 +15,142 @@ attribute vec4 TANGENT; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; + vec3 binormal_1; vec4 tmpvar_2; - float tmpvar_3; - tmpvar_3 = (1.0 - abs(TANGENT.w)); - vec4 tmpvar_4; - tmpvar_4.w = 0.0; - tmpvar_4.xyz = gl_Normal; - vec4 tmpvar_5; - tmpvar_5.yw = vec2(0.0, 0.0); - tmpvar_5.x = gl_Normal.z; - tmpvar_5.z = -(gl_Normal.x); + vec4 tmpvar_3; + vec4 pos_4; + float isBillboard_5; + isBillboard_5 = (1.0 - abs(TANGENT.w)); vec4 tmpvar_6; - tmpvar_6 = (gl_Vertex + ((TANGENT * gl_ModelViewMatrixInverseTranspose) * tmpvar_3)); - vec3 tmpvar_7; - tmpvar_7 = mix (gl_Normal, normalize((tmpvar_4 * gl_ModelViewMatrixInverseTranspose)).xyz, vec3(tmpvar_3)); - vec4 tmpvar_8; - tmpvar_8.w = -1.0; - tmpvar_8.xyz = normalize((tmpvar_5 * gl_ModelViewMatrixInverseTranspose)).xyz; + tmpvar_6.w = 0.0; + tmpvar_6.xyz = gl_Normal; + vec4 tmpvar_7; + tmpvar_7.yw = vec2(0.0, 0.0); + tmpvar_7.x = gl_Normal.z; + tmpvar_7.z = -(gl_Normal.x); + pos_4 = (gl_Vertex + ((TANGENT * gl_ModelViewMatrixInverseTranspose) * isBillboard_5)); + vec3 tmpvar_8; + tmpvar_8 = mix (gl_Normal, normalize((tmpvar_6 * gl_ModelViewMatrixInverseTranspose)).xyz, vec3(isBillboard_5)); vec4 tmpvar_9; - tmpvar_9 = mix (TANGENT, tmpvar_8, vec4(tmpvar_3)); - tmpvar_1.w = tmpvar_6.w; - tmpvar_2.w = tmpvar_9.w; - tmpvar_1.xyz = (tmpvar_6.xyz * _Scale.xyz); - vec4 pos_10; - pos_10.w = tmpvar_1.w; - vec3 bend_11; - float tmpvar_12; - tmpvar_12 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x); - vec2 tmpvar_13; - tmpvar_13.x = dot (tmpvar_1.xyz, vec3((gl_Color.y + tmpvar_12))); - tmpvar_13.y = tmpvar_12; - vec4 tmpvar_14; - tmpvar_14 = abs((( - fract(((( - fract(((_TimeX + tmpvar_13).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) - * 2.0) - 1.0) + 0.5)) - * 2.0) - 1.0)); - vec4 tmpvar_15; - tmpvar_15 = ((tmpvar_14 * tmpvar_14) * (3.0 - (2.0 * tmpvar_14))); + tmpvar_9.w = -1.0; + tmpvar_9.xyz = normalize((tmpvar_7 * gl_ModelViewMatrixInverseTranspose)).xyz; + vec4 tmpvar_10; + tmpvar_10 = mix (TANGENT, tmpvar_9, vec4(isBillboard_5)); + tmpvar_2.w = pos_4.w; + tmpvar_3.w = tmpvar_10.w; + tmpvar_2.xyz = (pos_4.xyz * _Scale.xyz); + vec4 pos_11; + pos_11.w = tmpvar_2.w; + vec3 bend_12; + vec2 vWavesSum_13; + vec4 vWaves_14; + float fBranchPhase_15; + fBranchPhase_15 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x); vec2 tmpvar_16; - tmpvar_16 = (tmpvar_15.xz + tmpvar_15.yw); - bend_11.xz = ((gl_Color.y * 0.1) * tmpvar_7).xz; - bend_11.y = (gl_MultiTexCoord1.y * 0.3); - pos_10.xyz = (tmpvar_1.xyz + (( - (tmpvar_16.xyx * bend_11) + tmpvar_16.x = dot (tmpvar_2.xyz, vec3((gl_Color.y + fBranchPhase_15))); + tmpvar_16.y = fBranchPhase_15; + vWaves_14 = ((fract( + ((_TimeX + tmpvar_16).xxyy * vec4(1.975, 0.793, 0.375, 0.193)) + ) * 2.0) - 1.0); + vec4 tmpvar_17; + tmpvar_17 = abs((( + fract((vWaves_14 + 0.5)) + * 2.0) - 1.0)); + vec4 tmpvar_18; + tmpvar_18 = ((tmpvar_17 * tmpvar_17) * (3.0 - (2.0 * tmpvar_17))); + vWaves_14 = tmpvar_18; + vWavesSum_13 = (tmpvar_18.xz + tmpvar_18.yw); + bend_12.xz = ((gl_Color.y * 0.1) * tmpvar_8).xz; + bend_12.y = (gl_MultiTexCoord1.y * 0.3); + pos_11.xyz = (tmpvar_2.xyz + (( + (vWavesSum_13.xyx * bend_12) + - ((_Wind.xyz * tmpvar_16.y) * gl_MultiTexCoord1.y) + ((_Wind.xyz * vWavesSum_13.y) * gl_MultiTexCoord1.y) ) * _Wind.w)); - pos_10.xyz = (pos_10.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); - vec3 tmpvar_17; - tmpvar_17.xz = vec2(0.0, 0.0); - tmpvar_17.y = _SquashPlaneNormal.w; - vec3 tmpvar_18; - tmpvar_18 = mix ((pos_10.xyz + ( - dot (_SquashPlaneNormal.xyz, (tmpvar_17 - pos_10.xyz)) - * _SquashPlaneNormal.xyz)), pos_10.xyz, vec3(_SquashAmount)); - vec4 tmpvar_19; - tmpvar_19.w = 1.0; - tmpvar_19.xyz = tmpvar_18; - tmpvar_1 = tmpvar_19; - vec4 tmpvar_20; - tmpvar_20.xyz = (gl_Color.w * _Color.xyz); - tmpvar_20.w = _Color.w; - vec3 tmpvar_21; - tmpvar_21 = normalize(tmpvar_7); - tmpvar_2.xyz = normalize(tmpvar_9.xyz); + pos_11.xyz = (pos_11.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); + vec3 tmpvar_19; + tmpvar_19.xz = vec2(0.0, 0.0); + tmpvar_19.y = _SquashPlaneNormal.w; + vec3 tmpvar_20; + tmpvar_20 = mix ((pos_11.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_19 - pos_11.xyz)) + * _SquashPlaneNormal.xyz)), pos_11.xyz, vec3(_SquashAmount)); + vec4 tmpvar_21; + tmpvar_21.w = 1.0; + tmpvar_21.xyz = tmpvar_20; + tmpvar_2 = tmpvar_21; vec4 tmpvar_22; - tmpvar_22 = (gl_ModelViewProjectionMatrix * tmpvar_19); + tmpvar_22.xyz = (gl_Color.w * _Color.xyz); + tmpvar_22.w = _Color.w; vec3 tmpvar_23; - tmpvar_23 = (((tmpvar_21.yzx * tmpvar_2.zxy) - (tmpvar_21.zxy * tmpvar_2.yzx)) * tmpvar_9.w); - mat3 tmpvar_24; - tmpvar_24[0].x = tmpvar_2.x; - tmpvar_24[0].y = tmpvar_23.x; - tmpvar_24[0].z = tmpvar_21.x; - tmpvar_24[1].x = tmpvar_2.y; - tmpvar_24[1].y = tmpvar_23.y; - tmpvar_24[1].z = tmpvar_21.y; - tmpvar_24[2].x = tmpvar_2.z; - tmpvar_24[2].y = tmpvar_23.z; - tmpvar_24[2].z = tmpvar_21.z; - vec4 tmpvar_25; - tmpvar_25.w = 1.0; - tmpvar_25.xyz = _WorldSpaceCameraPos; - gl_Position = tmpvar_22; + tmpvar_23 = normalize(tmpvar_8); + tmpvar_3.xyz = normalize(tmpvar_10.xyz); + vec4 pos_24; + pos_24 = (gl_ModelViewProjectionMatrix * tmpvar_21); + binormal_1 = (((tmpvar_23.yzx * tmpvar_3.zxy) - (tmpvar_23.zxy * tmpvar_3.yzx)) * tmpvar_10.w); + mat3 tmpvar_25; + tmpvar_25[0].x = tmpvar_3.x; + tmpvar_25[0].y = binormal_1.x; + tmpvar_25[0].z = tmpvar_23.x; + tmpvar_25[1].x = tmpvar_3.y; + tmpvar_25[1].y = binormal_1.y; + tmpvar_25[1].z = tmpvar_23.y; + tmpvar_25[2].x = tmpvar_3.z; + tmpvar_25[2].y = binormal_1.z; + tmpvar_25[2].z = tmpvar_23.z; vec4 tmpvar_26; - tmpvar_26.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_26.x = tmpvar_22.z; - xlv_FOG = tmpvar_26; + tmpvar_26.w = 1.0; + tmpvar_26.xyz = _WorldSpaceCameraPos; + gl_Position = pos_24; vec4 tmpvar_27; - tmpvar_27.zw = vec2(0.0, 0.0); - tmpvar_27.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_27; - gl_FrontColor = tmpvar_20; + tmpvar_27.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_27.x = pos_24.z; + xlv_FOG = tmpvar_27; vec4 tmpvar_28; - tmpvar_28.w = 0.0; - tmpvar_28.xyz = (tmpvar_24 * (( - (_World2Object * _WorldSpaceLightPos0) - .xyz * unity_Scale.w) - tmpvar_18)); - gl_TexCoord[1] = tmpvar_28; + tmpvar_28.zw = vec2(0.0, 0.0); + tmpvar_28.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_28; + gl_FrontColor = tmpvar_22; vec4 tmpvar_29; tmpvar_29.w = 0.0; - tmpvar_29.xyz = (tmpvar_24 * (( - (_World2Object * tmpvar_25) - .xyz * unity_Scale.w) - tmpvar_18)); - gl_TexCoord[2] = tmpvar_29; + tmpvar_29.xyz = (tmpvar_25 * (( + (_World2Object * _WorldSpaceLightPos0) + .xyz * unity_Scale.w) - tmpvar_20)); + gl_TexCoord[1] = tmpvar_29; vec4 tmpvar_30; tmpvar_30.w = 0.0; - tmpvar_30.xyz = (_LightMatrix0 * (_Object2World * tmpvar_19)).xyz; - gl_TexCoord[3] = tmpvar_30; + tmpvar_30.xyz = (tmpvar_25 * (( + (_World2Object * tmpvar_26) + .xyz * unity_Scale.w) - tmpvar_20)); + gl_TexCoord[2] = tmpvar_30; + vec4 tmpvar_31; + tmpvar_31.w = 0.0; + tmpvar_31.xyz = (_LightMatrix0 * (_Object2World * tmpvar_21)).xyz; + gl_TexCoord[3] = tmpvar_31; } -// inputs: 6, stats: 79 alu 0 tex 0 flow +// stats: 79 alu 0 tex 0 flow +// inputs: 6 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #2: gl_Color (high float) 4x1 [-1] loc 3 +// #3: gl_Normal (high float) 3x1 [-1] loc 2 +// #4: gl_Vertex (high float) 4x1 [-1] loc 0 +// #5: TANGENT (high float) 4x1 [-1] +// uniforms: 15 (total size: 0) +// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] +// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #2: _Color (high float) 4x1 [-1] +// #3: _LightMatrix0 (high float) 4x4 [-1] +// #4: _MainTex_ST (high float) 4x1 [-1] +// #5: _Object2World (high float) 4x4 [-1] +// #6: _Scale (high float) 4x1 [-1] +// #7: _SquashAmount (high float) 1x1 [-1] +// #8: _SquashPlaneNormal (high float) 4x1 [-1] +// #9: _TimeX (high float) 1x1 [-1] +// #10: _Wind (high float) 4x1 [-1] +// #11: _World2Object (high float) 4x4 [-1] +// #12: _WorldSpaceCameraPos (high float) 3x1 [-1] +// #13: _WorldSpaceLightPos0 (high float) 4x1 [-1] +// #14: unity_Scale (high float) 4x1 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-ir.txt deleted file mode 100644 index 5ff357e71..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-ir.txt +++ /dev/null @@ -1,402 +0,0 @@ -struct appdata_full { - vec4 vertex; - vec4 tangent; - vec3 normal; - vec4 texcoord; - vec4 texcoord1; - vec4 color; -}; -struct v2f_surf { - vec4 pos; - vec3 _ShadowCoord0; - vec3 _ShadowCoord1; - vec3 _ShadowCoord2; - vec3 _ShadowCoord3; - vec2 _ShadowZFade; - vec2 hip_pack0; - vec4 lop_color; -}; -uniform vec4 _Color; -uniform vec4 _LightShadowData; -uniform vec4 _MainTex_ST; -uniform mat4 _Object2World; -uniform vec4 _Scale; -uniform float _SquashAmount; -uniform vec4 _SquashPlaneNormal; -uniform float _TimeX; -uniform vec4 _Wind; -uniform mat4 _World2Shadow; -uniform mat4 _World2Shadow1; -uniform mat4 _World2Shadow2; -uniform mat4 _World2Shadow3; -attribute vec4 TANGENT; -vec4 Squash ( - in vec4 pos_1 -) -{ - vec3 planeNormal_2; - vec3 planePoint_3; - vec3 projectedVertex_4; - vec3 tmpvar_5; - tmpvar_5 = pos_1.xyz; - projectedVertex_4 = tmpvar_5; - vec3 tmpvar_6; - tmpvar_6.xz = vec2(0.0, 0.0); - tmpvar_6.y = _SquashPlaneNormal.w; - vec3 tmpvar_7; - tmpvar_7 = tmpvar_6; - planePoint_3 = tmpvar_7; - vec3 tmpvar_8; - tmpvar_8 = _SquashPlaneNormal.xyz; - planeNormal_2 = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = pos_1.xyz; - float tmpvar_10; - tmpvar_10 = dot (planeNormal_2, (planePoint_3 - tmpvar_9)); - vec3 tmpvar_11; - tmpvar_11 = (projectedVertex_4 + (tmpvar_10 * planeNormal_2)); - projectedVertex_4 = tmpvar_11; - vec3 tmpvar_12; - tmpvar_12 = vec3(_SquashAmount); - vec3 tmpvar_13; - tmpvar_13 = mix (projectedVertex_4, pos_1.xyz, tmpvar_12); - vec4 tmpvar_14; - tmpvar_14.w = 1.0; - tmpvar_14.xyz = tmpvar_13.xyz; - vec4 tmpvar_15; - tmpvar_15 = tmpvar_14; - pos_1 = tmpvar_15; - return pos_1; -} - -void ExpandBillboard ( - in mat4 mat_16, - inout vec4 pos_17, - inout vec3 normal_18, - inout vec4 tangent_19 -) -{ - vec3 tanb_20; - vec3 norb_21; - float isBillboard_22; - float tmpvar_23; - tmpvar_23 = abs (tangent_19.w); - float tmpvar_24; - tmpvar_24 = (1.0 - tmpvar_23); - isBillboard_22 = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25.w = 0.0; - tmpvar_25.xyz = normal_18.xyz; - vec4 tmpvar_26; - tmpvar_26 = normalize ((tmpvar_25 * mat_16)); - vec3 tmpvar_27; - tmpvar_27 = tmpvar_26.xyz; - vec3 tmpvar_28; - tmpvar_28 = tmpvar_27; - norb_21 = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29.yw = vec2(0.0, 0.0); - tmpvar_29.x = normal_18.z; - tmpvar_29.z = -(normal_18.x); - vec4 tmpvar_30; - tmpvar_30 = normalize ((tmpvar_29 * mat_16)); - vec3 tmpvar_31; - tmpvar_31 = tmpvar_30.xyz; - vec3 tmpvar_32; - tmpvar_32 = tmpvar_31; - tanb_20 = tmpvar_32; - vec4 tmpvar_33; - tmpvar_33 = (pos_17 + ((tangent_19 * mat_16) * isBillboard_22)); - pos_17 = tmpvar_33; - vec3 tmpvar_34; - tmpvar_34 = vec3(isBillboard_22); - vec3 tmpvar_35; - tmpvar_35 = mix (normal_18, norb_21, tmpvar_34); - vec3 tmpvar_36; - tmpvar_36 = tmpvar_35; - normal_18 = tmpvar_36; - vec4 tmpvar_37; - tmpvar_37.w = -1.0; - tmpvar_37.xyz = tanb_20.xyz; - vec4 tmpvar_38; - tmpvar_38 = vec4(isBillboard_22); - vec4 tmpvar_39; - tmpvar_39 = mix (tangent_19, tmpvar_37, tmpvar_38); - vec4 tmpvar_40; - tmpvar_40 = tmpvar_39; - tangent_19 = tmpvar_40; -} - -vec4 TriangleWave ( - in vec4 x_41 -) -{ - vec4 tmpvar_42; - tmpvar_42 = fract ((x_41 + 0.5)); - vec4 tmpvar_43; - tmpvar_43 = abs (((tmpvar_42 * 2.0) - 1.0)); - return tmpvar_43; -} - -vec4 SmoothCurve ( - in vec4 x_44 -) -{ - return ((x_44 * x_44) * (3.0 - (2.0 * x_44))); -} - -vec4 SmoothTriangleWave ( - in vec4 x_45 -) -{ - vec4 tmpvar_46; - tmpvar_46 = TriangleWave (x_45); - vec4 tmpvar_47; - tmpvar_47 = SmoothCurve (tmpvar_46); - return tmpvar_47; -} - -vec4 AnimateVertex ( - in vec4 pos_48, - in vec3 normal_49, - in vec4 animParams_50 -) -{ - vec3 bend_51; - vec2 vWavesSum_52; - vec4 vWaves_53; - vec2 vWavesIn_54; - float fVtxPhase_55; - float fBranchPhase_56; - float fObjPhase_57; - float fBranchAmp_58; - float fDetailAmp_59; - float tmpvar_60; - tmpvar_60 = 0.1; - fDetailAmp_59 = tmpvar_60; - float tmpvar_61; - tmpvar_61 = 0.3; - fBranchAmp_58 = tmpvar_61; - float tmpvar_62; - tmpvar_62 = dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)); - float tmpvar_63; - tmpvar_63 = tmpvar_62; - fObjPhase_57 = tmpvar_63; - float tmpvar_64; - tmpvar_64 = (fObjPhase_57 + animParams_50.x); - fBranchPhase_56 = tmpvar_64; - vec3 tmpvar_65; - tmpvar_65 = vec3((animParams_50.y + fBranchPhase_56)); - float tmpvar_66; - tmpvar_66 = dot (pos_48.xyz, tmpvar_65); - float tmpvar_67; - tmpvar_67 = tmpvar_66; - fVtxPhase_55 = tmpvar_67; - vec2 tmpvar_68; - tmpvar_68.x = fVtxPhase_55; - tmpvar_68.y = fBranchPhase_56; - vec2 tmpvar_69; - tmpvar_69 = (_TimeX + tmpvar_68); - vWavesIn_54 = tmpvar_69; - vec4 tmpvar_70; - tmpvar_70 = fract ((vWavesIn_54.xxyy * vec4(1.975, 0.793, 0.375, 0.193))); - vec4 tmpvar_71; - tmpvar_71 = ((tmpvar_70 * 2.0) - 1.0); - vWaves_53 = tmpvar_71; - vec4 tmpvar_72; - tmpvar_72 = SmoothTriangleWave (vWaves_53); - vec4 tmpvar_73; - tmpvar_73 = tmpvar_72; - vWaves_53 = tmpvar_73; - vec2 tmpvar_74; - tmpvar_74 = (vWaves_53.xz + vWaves_53.yw); - vWavesSum_52 = tmpvar_74; - vec3 tmpvar_75; - tmpvar_75 = ((animParams_50.y * fDetailAmp_59) * normal_49.xyz); - bend_51 = tmpvar_75; - float tmpvar_76; - tmpvar_76 = (animParams_50.w * fBranchAmp_58); - bend_51.y = vec2(tmpvar_76).y; - vec3 tmpvar_77; - tmpvar_77 = (pos_48.xyz + (( - (vWavesSum_52.xyx * bend_51) - + - ((_Wind.xyz * vWavesSum_52.y) * animParams_50.w) - ) * _Wind.w)); - pos_48.xyz = tmpvar_77.xyz.xyz; - vec3 tmpvar_78; - tmpvar_78 = (pos_48.xyz + (animParams_50.z * _Wind.xyz)); - pos_48.xyz = tmpvar_78.xyz.xyz; - return pos_48; -} - -void TreeVertLeaf ( - inout appdata_full v_79 -) -{ - ExpandBillboard (gl_ModelViewMatrixInverseTranspose, v_79.vertex, v_79.normal, v_79.tangent); - vec3 tmpvar_80; - tmpvar_80 = (v_79.vertex.xyz * _Scale.xyz); - v_79.vertex.xyz = tmpvar_80.xyz.xyz; - vec4 tmpvar_81; - tmpvar_81.xy = v_79.color.xy.xy; - tmpvar_81.zw = v_79.texcoord1.xy.xy; - vec4 tmpvar_82; - tmpvar_82 = AnimateVertex (v_79.vertex, v_79.normal, tmpvar_81); - vec4 tmpvar_83; - tmpvar_83 = tmpvar_82; - v_79.vertex = tmpvar_83; - vec4 tmpvar_84; - tmpvar_84 = Squash (v_79.vertex); - vec4 tmpvar_85; - tmpvar_85 = tmpvar_84; - v_79.vertex = tmpvar_85; - vec4 tmpvar_86; - tmpvar_86.xyz = (v_79.color.w * _Color.xyz).xyz; - tmpvar_86.w = _Color.w; - vec4 tmpvar_87; - tmpvar_87 = tmpvar_86; - v_79.color = tmpvar_87; - vec3 tmpvar_88; - tmpvar_88 = normalize (v_79.normal); - vec3 tmpvar_89; - tmpvar_89 = tmpvar_88; - v_79.normal = tmpvar_89; - vec3 tmpvar_90; - tmpvar_90 = normalize (v_79.tangent.xyz); - vec3 tmpvar_91; - tmpvar_91 = tmpvar_90; - v_79.tangent.xyz = tmpvar_91.xyz.xyz; -} - -v2f_surf vert_surf ( - in appdata_full v_92 -) -{ - vec4 wpos_93; - float z_94; - v2f_surf o_95; - TreeVertLeaf (v_92); - vec2 tmpvar_96; - tmpvar_96 = ((v_92.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_95.hip_pack0 = tmpvar_96.xy.xy; - vec4 tmpvar_97; - tmpvar_97 = v_92.color; - o_95.lop_color = tmpvar_97; - vec4 tmpvar_98; - tmpvar_98 = (gl_ModelViewProjectionMatrix * v_92.vertex); - o_95.pos = tmpvar_98; - float tmpvar_99; - tmpvar_99 = -((gl_ModelViewMatrix * v_92.vertex).z); - z_94 = tmpvar_99; - float tmpvar_100; - tmpvar_100 = z_94; - o_95._ShadowZFade.x = tmpvar_100; - float tmpvar_101; - tmpvar_101 = ((z_94 * _LightShadowData.z) + _LightShadowData.w); - o_95._ShadowZFade.y = vec2(tmpvar_101).y; - vec4 tmpvar_102; - tmpvar_102 = (_Object2World * v_92.vertex); - wpos_93 = tmpvar_102; - vec3 tmpvar_103; - tmpvar_103 = (_World2Shadow * wpos_93).xyz; - o_95._ShadowCoord0 = tmpvar_103; - vec3 tmpvar_104; - tmpvar_104 = (_World2Shadow1 * wpos_93).xyz; - o_95._ShadowCoord1 = tmpvar_104; - vec3 tmpvar_105; - tmpvar_105 = (_World2Shadow2 * wpos_93).xyz; - o_95._ShadowCoord2 = tmpvar_105; - vec3 tmpvar_106; - tmpvar_106 = (_World2Shadow3 * wpos_93).xyz; - o_95._ShadowCoord3 = tmpvar_106; - return o_95; -} - -void main () -{ - appdata_full xlt_v_107; - v2f_surf xl_retval_108; - vec4 tmpvar_109; - tmpvar_109 = gl_Vertex.xyzw; - vec4 tmpvar_110; - tmpvar_110 = tmpvar_109; - xlt_v_107.vertex = tmpvar_110; - vec4 tmpvar_111; - tmpvar_111 = TANGENT.xyzw; - vec4 tmpvar_112; - tmpvar_112 = tmpvar_111; - xlt_v_107.tangent = tmpvar_112; - vec3 tmpvar_113; - tmpvar_113 = gl_Normal.xyz; - vec3 tmpvar_114; - tmpvar_114 = tmpvar_113; - xlt_v_107.normal = tmpvar_114; - vec4 tmpvar_115; - tmpvar_115 = gl_MultiTexCoord0.xyzw; - vec4 tmpvar_116; - tmpvar_116 = tmpvar_115; - xlt_v_107.texcoord = tmpvar_116; - vec4 tmpvar_117; - tmpvar_117 = gl_MultiTexCoord1.xyzw; - vec4 tmpvar_118; - tmpvar_118 = tmpvar_117; - xlt_v_107.texcoord1 = tmpvar_118; - vec4 tmpvar_119; - tmpvar_119 = gl_Color.xyzw; - vec4 tmpvar_120; - tmpvar_120 = tmpvar_119; - xlt_v_107.color = tmpvar_120; - v2f_surf tmpvar_121; - tmpvar_121 = vert_surf (xlt_v_107); - v2f_surf tmpvar_122; - tmpvar_122 = tmpvar_121; - xl_retval_108 = tmpvar_122; - vec4 tmpvar_123; - tmpvar_123 = xl_retval_108.pos.xyzw; - vec4 tmpvar_124; - tmpvar_124 = tmpvar_123; - gl_Position = tmpvar_124; - vec4 tmpvar_125; - tmpvar_125.w = 0.0; - tmpvar_125.xyz = xl_retval_108._ShadowCoord0.xyz; - vec4 tmpvar_126; - tmpvar_126 = tmpvar_125; - gl_TexCoord[0] = tmpvar_126; - vec4 tmpvar_127; - tmpvar_127.w = 0.0; - tmpvar_127.xyz = xl_retval_108._ShadowCoord1.xyz; - vec4 tmpvar_128; - tmpvar_128 = tmpvar_127; - gl_TexCoord[1] = tmpvar_128; - vec4 tmpvar_129; - tmpvar_129.w = 0.0; - tmpvar_129.xyz = xl_retval_108._ShadowCoord2.xyz; - vec4 tmpvar_130; - tmpvar_130 = tmpvar_129; - gl_TexCoord[2] = tmpvar_130; - vec4 tmpvar_131; - tmpvar_131.w = 0.0; - tmpvar_131.xyz = xl_retval_108._ShadowCoord3.xyz; - vec4 tmpvar_132; - tmpvar_132 = tmpvar_131; - gl_TexCoord[3] = tmpvar_132; - vec4 tmpvar_133; - tmpvar_133.zw = vec2(0.0, 0.0); - tmpvar_133.xy = xl_retval_108._ShadowZFade.xy; - vec4 tmpvar_134; - tmpvar_134 = tmpvar_133; - gl_TexCoord[4] = tmpvar_134; - vec4 tmpvar_135; - tmpvar_135.zw = vec2(0.0, 0.0); - tmpvar_135.xy = xl_retval_108.hip_pack0.xy; - vec4 tmpvar_136; - tmpvar_136 = tmpvar_135; - gl_TexCoord[5] = tmpvar_136; - vec4 tmpvar_137; - tmpvar_137 = xl_retval_108.lop_color.xyzw; - vec4 tmpvar_138; - tmpvar_138 = tmpvar_137; - gl_FrontColor = tmpvar_138; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-out.txt index 2a42c5189..346541083 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-out.txt @@ -14,90 +14,117 @@ uniform mat4 _World2Shadow3; attribute vec4 TANGENT; void main () { - vec2 tmpvar_1; - vec4 tmpvar_2; - float tmpvar_3; - tmpvar_3 = (1.0 - abs(TANGENT.w)); + vec4 wpos_1; + float z_2; + vec2 tmpvar_3; vec4 tmpvar_4; - tmpvar_4.w = 0.0; - tmpvar_4.xyz = gl_Normal; - vec4 tmpvar_5; - tmpvar_5 = (gl_Vertex + ((TANGENT * gl_ModelViewMatrixInverseTranspose) * tmpvar_3)); - tmpvar_2.w = tmpvar_5.w; - tmpvar_2.xyz = (tmpvar_5.xyz * _Scale.xyz); - vec4 pos_6; - pos_6.w = tmpvar_2.w; - vec3 bend_7; - float tmpvar_8; - tmpvar_8 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x); - vec2 tmpvar_9; - tmpvar_9.x = dot (tmpvar_2.xyz, vec3((gl_Color.y + tmpvar_8))); - tmpvar_9.y = tmpvar_8; - vec4 tmpvar_10; - tmpvar_10 = abs((( - fract(((( - fract(((_TimeX + tmpvar_9).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) - * 2.0) - 1.0) + 0.5)) - * 2.0) - 1.0)); - vec4 tmpvar_11; - tmpvar_11 = ((tmpvar_10 * tmpvar_10) * (3.0 - (2.0 * tmpvar_10))); - vec2 tmpvar_12; - tmpvar_12 = (tmpvar_11.xz + tmpvar_11.yw); - bend_7.xz = ((gl_Color.y * 0.1) * mix (gl_Normal, normalize( - (tmpvar_4 * gl_ModelViewMatrixInverseTranspose) - ).xyz, vec3(tmpvar_3))).xz; - bend_7.y = (gl_MultiTexCoord1.y * 0.3); - pos_6.xyz = (tmpvar_2.xyz + (( - (tmpvar_12.xyx * bend_7) - + - ((_Wind.xyz * tmpvar_12.y) * gl_MultiTexCoord1.y) - ) * _Wind.w)); - pos_6.xyz = (pos_6.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); - vec3 tmpvar_13; - tmpvar_13.xz = vec2(0.0, 0.0); - tmpvar_13.y = _SquashPlaneNormal.w; + vec4 pos_5; + float isBillboard_6; + isBillboard_6 = (1.0 - abs(TANGENT.w)); + vec4 tmpvar_7; + tmpvar_7.w = 0.0; + tmpvar_7.xyz = gl_Normal; + pos_5 = (gl_Vertex + ((TANGENT * gl_ModelViewMatrixInverseTranspose) * isBillboard_6)); + tmpvar_4.w = pos_5.w; + tmpvar_4.xyz = (pos_5.xyz * _Scale.xyz); + vec4 pos_8; + pos_8.w = tmpvar_4.w; + vec3 bend_9; + vec2 vWavesSum_10; + vec4 vWaves_11; + float fBranchPhase_12; + fBranchPhase_12 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x); + vec2 tmpvar_13; + tmpvar_13.x = dot (tmpvar_4.xyz, vec3((gl_Color.y + fBranchPhase_12))); + tmpvar_13.y = fBranchPhase_12; + vWaves_11 = ((fract( + ((_TimeX + tmpvar_13).xxyy * vec4(1.975, 0.793, 0.375, 0.193)) + ) * 2.0) - 1.0); vec4 tmpvar_14; - tmpvar_14.w = 1.0; - tmpvar_14.xyz = mix ((pos_6.xyz + ( - dot (_SquashPlaneNormal.xyz, (tmpvar_13 - pos_6.xyz)) - * _SquashPlaneNormal.xyz)), pos_6.xyz, vec3(_SquashAmount)); - tmpvar_2 = tmpvar_14; + tmpvar_14 = abs((( + fract((vWaves_11 + 0.5)) + * 2.0) - 1.0)); vec4 tmpvar_15; - tmpvar_15.xyz = (gl_Color.w * _Color.xyz); - tmpvar_15.w = _Color.w; - float tmpvar_16; - tmpvar_16 = -((gl_ModelViewMatrix * tmpvar_14).z); - tmpvar_1.x = tmpvar_16; - tmpvar_1.y = ((tmpvar_16 * _LightShadowData.z) + _LightShadowData.w); + tmpvar_15 = ((tmpvar_14 * tmpvar_14) * (3.0 - (2.0 * tmpvar_14))); + vWaves_11 = tmpvar_15; + vWavesSum_10 = (tmpvar_15.xz + tmpvar_15.yw); + bend_9.xz = ((gl_Color.y * 0.1) * mix (gl_Normal, normalize( + (tmpvar_7 * gl_ModelViewMatrixInverseTranspose) + ).xyz, vec3(isBillboard_6))).xz; + bend_9.y = (gl_MultiTexCoord1.y * 0.3); + pos_8.xyz = (tmpvar_4.xyz + (( + (vWavesSum_10.xyx * bend_9) + + + ((_Wind.xyz * vWavesSum_10.y) * gl_MultiTexCoord1.y) + ) * _Wind.w)); + pos_8.xyz = (pos_8.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); + vec3 tmpvar_16; + tmpvar_16.xz = vec2(0.0, 0.0); + tmpvar_16.y = _SquashPlaneNormal.w; vec4 tmpvar_17; - tmpvar_17 = (_Object2World * tmpvar_14); - gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_14); + tmpvar_17.w = 1.0; + tmpvar_17.xyz = mix ((pos_8.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_16 - pos_8.xyz)) + * _SquashPlaneNormal.xyz)), pos_8.xyz, vec3(_SquashAmount)); + tmpvar_4 = tmpvar_17; vec4 tmpvar_18; - tmpvar_18.w = 0.0; - tmpvar_18.xyz = (_World2Shadow * tmpvar_17).xyz; - gl_TexCoord[0] = tmpvar_18; + tmpvar_18.xyz = (gl_Color.w * _Color.xyz); + tmpvar_18.w = _Color.w; + z_2 = -((gl_ModelViewMatrix * tmpvar_17).z); + tmpvar_3.x = z_2; + tmpvar_3.y = ((z_2 * _LightShadowData.z) + _LightShadowData.w); + wpos_1 = (_Object2World * tmpvar_17); + gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_17); vec4 tmpvar_19; tmpvar_19.w = 0.0; - tmpvar_19.xyz = (_World2Shadow1 * tmpvar_17).xyz; - gl_TexCoord[1] = tmpvar_19; + tmpvar_19.xyz = (_World2Shadow * wpos_1).xyz; + gl_TexCoord[0] = tmpvar_19; vec4 tmpvar_20; tmpvar_20.w = 0.0; - tmpvar_20.xyz = (_World2Shadow2 * tmpvar_17).xyz; - gl_TexCoord[2] = tmpvar_20; + tmpvar_20.xyz = (_World2Shadow1 * wpos_1).xyz; + gl_TexCoord[1] = tmpvar_20; vec4 tmpvar_21; tmpvar_21.w = 0.0; - tmpvar_21.xyz = (_World2Shadow3 * tmpvar_17).xyz; - gl_TexCoord[3] = tmpvar_21; + tmpvar_21.xyz = (_World2Shadow2 * wpos_1).xyz; + gl_TexCoord[2] = tmpvar_21; vec4 tmpvar_22; - tmpvar_22.zw = vec2(0.0, 0.0); - tmpvar_22.xy = tmpvar_1; - gl_TexCoord[4] = tmpvar_22; + tmpvar_22.w = 0.0; + tmpvar_22.xyz = (_World2Shadow3 * wpos_1).xyz; + gl_TexCoord[3] = tmpvar_22; vec4 tmpvar_23; tmpvar_23.zw = vec2(0.0, 0.0); - tmpvar_23.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[5] = tmpvar_23; - gl_FrontColor = tmpvar_15; + tmpvar_23.xy = tmpvar_3; + gl_TexCoord[4] = tmpvar_23; + vec4 tmpvar_24; + tmpvar_24.zw = vec2(0.0, 0.0); + tmpvar_24.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[5] = tmpvar_24; + gl_FrontColor = tmpvar_18; } -// inputs: 6, stats: 66 alu 0 tex 0 flow +// stats: 66 alu 0 tex 0 flow +// inputs: 6 +// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9 +// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #2: gl_Color (high float) 4x1 [-1] loc 3 +// #3: gl_Normal (high float) 3x1 [-1] loc 2 +// #4: gl_Vertex (high float) 4x1 [-1] loc 0 +// #5: TANGENT (high float) 4x1 [-1] +// uniforms: 16 (total size: 0) +// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] +// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #2: gl_ModelViewMatrix (high float) 4x4 [-1] +// #3: _Color (high float) 4x1 [-1] +// #4: _LightShadowData (high float) 4x1 [-1] +// #5: _MainTex_ST (high float) 4x1 [-1] +// #6: _Object2World (high float) 4x4 [-1] +// #7: _Scale (high float) 4x1 [-1] +// #8: _SquashAmount (high float) 1x1 [-1] +// #9: _SquashPlaneNormal (high float) 4x1 [-1] +// #10: _TimeX (high float) 1x1 [-1] +// #11: _Wind (high float) 4x1 [-1] +// #12: _World2Shadow (high float) 4x4 [-1] +// #13: _World2Shadow1 (high float) 4x4 [-1] +// #14: _World2Shadow2 (high float) 4x4 [-1] +// #15: _World2Shadow3 (high float) 4x4 [-1] diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-ir.txt deleted file mode 100644 index 151560403..000000000 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-ir.txt +++ /dev/null @@ -1,106 +0,0 @@ -struct v2f { - vec4 pos; - float fog; - vec4 color; - vec2 texcoord; - vec3 normal; -}; -struct appdata_t { - vec4 vertex; - vec4 color; - vec3 normal; - vec2 texcoord; -}; -uniform vec4 _MainTex_ST; -varying vec4 xlv_FOG; -void PositionFog ( - in vec4 v_1, - out vec4 pos_2, - out float fog_3 -) -{ - vec4 tmpvar_4; - tmpvar_4 = (gl_ModelViewProjectionMatrix * v_1); - pos_2 = tmpvar_4; - float tmpvar_5; - tmpvar_5 = pos_2.z; - fog_3 = tmpvar_5; -} - -v2f vert ( - in appdata_t v_6 -) -{ - v2f o_7; - PositionFog (v_6.vertex, o_7.pos, o_7.fog); - vec4 tmpvar_8; - tmpvar_8 = v_6.color; - o_7.color = tmpvar_8; - vec3 tmpvar_9; - tmpvar_9 = v_6.normal; - o_7.normal = tmpvar_9; - vec2 tmpvar_10; - tmpvar_10 = ((v_6.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - o_7.texcoord = tmpvar_10; - return o_7; -} - -void main () -{ - appdata_t xlt_v_11; - v2f xl_retval_12; - vec4 tmpvar_13; - tmpvar_13 = gl_Vertex.xyzw; - vec4 tmpvar_14; - tmpvar_14 = tmpvar_13; - xlt_v_11.vertex = tmpvar_14; - vec4 tmpvar_15; - tmpvar_15 = gl_Color.xyzw; - vec4 tmpvar_16; - tmpvar_16 = tmpvar_15; - xlt_v_11.color = tmpvar_16; - vec3 tmpvar_17; - tmpvar_17 = gl_Normal.xyz; - vec3 tmpvar_18; - tmpvar_18 = tmpvar_17; - xlt_v_11.normal = tmpvar_18; - vec2 tmpvar_19; - tmpvar_19 = gl_MultiTexCoord0.xy; - vec2 tmpvar_20; - tmpvar_20 = tmpvar_19; - xlt_v_11.texcoord = tmpvar_20; - v2f tmpvar_21; - tmpvar_21 = vert (xlt_v_11); - v2f tmpvar_22; - tmpvar_22 = tmpvar_21; - xl_retval_12 = tmpvar_22; - vec4 tmpvar_23; - tmpvar_23 = xl_retval_12.pos.xyzw; - vec4 tmpvar_24; - tmpvar_24 = tmpvar_23; - gl_Position = tmpvar_24; - vec4 tmpvar_25; - tmpvar_25.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_25.x = xl_retval_12.fog; - vec4 tmpvar_26; - tmpvar_26 = tmpvar_25; - xlv_FOG = tmpvar_26; - vec4 tmpvar_27; - tmpvar_27 = xl_retval_12.color.xyzw; - vec4 tmpvar_28; - tmpvar_28 = tmpvar_27; - gl_FrontColor = tmpvar_28; - vec4 tmpvar_29; - tmpvar_29.zw = vec2(0.0, 0.0); - tmpvar_29.xy = xl_retval_12.texcoord.xy; - vec4 tmpvar_30; - tmpvar_30 = tmpvar_29; - gl_TexCoord[0] = tmpvar_30; - vec4 tmpvar_31; - tmpvar_31.w = 0.0; - tmpvar_31.xyz = xl_retval_12.normal.xyz; - vec4 tmpvar_32; - tmpvar_32 = tmpvar_31; - gl_TexCoord[1] = tmpvar_32; -} - diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-out.txt index 62e1344c0..94e58e60e 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-out.txt @@ -2,12 +2,12 @@ uniform vec4 _MainTex_ST; varying vec4 xlv_FOG; void main () { - vec4 tmpvar_1; - tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); - gl_Position = tmpvar_1; + vec4 pos_1; + pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + gl_Position = pos_1; vec4 tmpvar_2; tmpvar_2.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_2.x = tmpvar_1.z; + tmpvar_2.x = pos_1.z; xlv_FOG = tmpvar_2; gl_FrontColor = gl_Color; vec4 tmpvar_3; @@ -21,4 +21,12 @@ void main () } -// inputs: 4, stats: 6 alu 0 tex 0 flow +// stats: 6 alu 0 tex 0 flow +// inputs: 4 +// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 +// #1: gl_Color (high float) 4x1 [-1] loc 3 +// #2: gl_Normal (high float) 3x1 [-1] loc 2 +// #3: gl_Vertex (high float) 4x1 [-1] loc 0 +// uniforms: 2 (total size: 0) +// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] +// #1: _MainTex_ST (high float) 4x1 [-1] diff --git a/examples/02-metaballs/fs_metaballs.bin.h b/examples/02-metaballs/fs_metaballs.bin.h index 45d5d6533..c7649ff60 100644 --- a/examples/02-metaballs/fs_metaballs.bin.h +++ b/examples/02-metaballs/fs_metaballs.bin.h @@ -1,31 +1,30 @@ -static const uint8_t fs_metaballs_glsl[401] = +static const uint8_t fs_metaballs_glsl[393] = { - 0x46, 0x53, 0x48, 0x03, 0x03, 0x2c, 0xf5, 0x3f, 0x00, 0x00, 0x82, 0x01, 0x00, 0x00, 0x76, 0x61, // FSH..,.?......va - 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, // rying mediump ve - 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, // c4 v_color0;.var - 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, // ying mediump vec - 0x33, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, // 3 v_normal;.void - 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x64, // main ().{. med - 0x69, 0x75, 0x6d, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // iump float tmpva - 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, // r_1;. tmpvar_1 - 0x3d, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, // = dot (normalize - 0x28, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, // (v_normal), vec3 - 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, // (0.0, 0.0, -1.0) - 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, // );. mediump vec - 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // 4 tmpvar_2;. tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, // pvar_2.w = 1.0;. - 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, // tmpvar_2.xyz = - 0x20, 0x70, 0x6f, 0x77, 0x20, 0x28, 0x28, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x6f, 0x77, // pow (((. pow - 0x20, 0x28, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, // (v_color0.xyz, - 0x76, 0x65, 0x63, 0x33, 0x28, 0x32, 0x2e, 0x32, 0x2c, 0x20, 0x32, 0x2e, 0x32, 0x2c, 0x20, 0x32, // vec3(2.2, 2.2, 2 - 0x2e, 0x32, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // .2)). * tmpvar - 0x5f, 0x31, 0x29, 0x20, 0x2b, 0x20, 0x70, 0x6f, 0x77, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, // _1) + pow (tmpva - 0x72, 0x5f, 0x31, 0x2c, 0x20, 0x33, 0x30, 0x2e, 0x30, 0x29, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, // r_1, 30.0)), vec - 0x33, 0x28, 0x30, 0x2e, 0x34, 0x35, 0x34, 0x35, 0x34, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x35, // 3(0.454545, 0.45 - 0x34, 0x35, 0x34, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x35, 0x34, 0x35, 0x34, 0x35, 0x29, 0x29, // 4545, 0.454545)) - 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // ;. gl_FragColor - 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, // = tmpvar_2;.}.. - 0x00, // . + 0x46, 0x53, 0x48, 0x03, 0x03, 0x2c, 0xf5, 0x3f, 0x00, 0x00, 0x7a, 0x01, 0x00, 0x00, 0x76, 0x61, // FSH..,.?..z...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_ + 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, // normal;.void mai + 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, // n ().{. highp f + 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, // loat tmpvar_1;. + 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;.}... }; static const uint8_t fs_metaballs_dx9[429] = { diff --git a/examples/02-metaballs/vs_metaballs.bin.h b/examples/02-metaballs/vs_metaballs.bin.h index 40084a0d3..98e538318 100644 --- a/examples/02-metaballs/vs_metaballs.bin.h +++ b/examples/02-metaballs/vs_metaballs.bin.h @@ -1,32 +1,31 @@ -static const uint8_t vs_metaballs_glsl[553] = +static const uint8_t vs_metaballs_glsl[537] = { 0x56, 0x53, 0x48, 0x03, 0x03, 0x2c, 0xf5, 0x3f, 0x02, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH..,.?...u_mod 0x65, 0x6c, 0x09, 0x20, 0x00, 0x00, 0x20, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // el. .. ..u_model - 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, 0xf6, 0x01, // ViewProj........ - 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6d, 0x65, 0x64, 0x69, // ..attribute medi - 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // ump vec4 a_color - 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6d, 0x65, 0x64, // 0;.attribute med - 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, // iump vec3 a_norm - 0x61, 0x6c, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6d, 0x65, // al;.attribute me - 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, // diump vec3 a_pos - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6d, // ition;.varying m - 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, // ediump vec4 v_co - 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, // lor0;.varying me - 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, // diump vec3 v_nor - 0x6d, 0x61, 0x6c, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x61, 0x74, // mal;.uniform mat - 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5b, 0x33, 0x32, 0x5d, 0x3b, 0x0a, 0x75, // 4 u_model[32];.u - 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x6d, // niform mediump m - 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, // at4 u_modelViewP - 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, // roj;.void main ( - 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, // ).{. mediump ve - 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, // c4 tmpvar_1;. t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, // mpvar_1.w = 1.0; - 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, // . tmpvar_1.xyz - 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, // = a_position;. - 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, // gl_Position = (u - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, // _modelViewProj * - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6d, 0x65, // tmpvar_1);. me - 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // diump vec4 tmpva + 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, 0xe6, 0x01, // ViewProj........ + 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, // ..attribute high + 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, // p vec4 a_color0; + 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // .attribute highp + 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, 0x0a, // vec3 a_normal;. + 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // attribute highp + 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, // vec3 a_position; + 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // .varying highp v + 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, // ec4 v_color0;.va + 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, // rying highp vec3 + 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, // v_normal;.unifo + 0x72, 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5b, // rm mat4 u_model[ + 0x33, 0x32, 0x5d, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, // 32];.uniform hig + 0x68, 0x70, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, // hp mat4 u_modelV + 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, // iewProj;.void ma + 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // in ().{. highp + 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, // vec4 tmpvar_1;. + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, // tmpvar_1.w = 1. + 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, // 0;. tmpvar_1.xy + 0x7a, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, // z = a_position;. + 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, // gl_Position = + 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, // (u_modelViewProj + 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, // * tmpvar_1);. + 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // highp vec4 tmpva 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, // r_2;. tmpvar_2. 0x77, 0x20, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // w = 0.0;. tmpva 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, // r_2.xyz = a_norm diff --git a/examples/17-drawstress/fs_drawstress.bin.h b/examples/17-drawstress/fs_drawstress.bin.h index 300aadb4a..f560f76a4 100644 --- a/examples/17-drawstress/fs_drawstress.bin.h +++ b/examples/17-drawstress/fs_drawstress.bin.h @@ -1,11 +1,11 @@ -static const uint8_t fs_drawstress_glsl[91] = +static const uint8_t fs_drawstress_glsl[89] = { - 0x46, 0x53, 0x48, 0x03, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x76, 0x61, // FSH....I..L...va - 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, // rying mediump ve - 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x6f, 0x69, // c4 v_color0;.voi - 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x67, 0x6c, // d main ().{. gl - 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x63, // _FragColor = v_c - 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // olor0;.}... + 0x46, 0x53, 0x48, 0x03, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x76, 0x61, // FSH....I..J...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, 0x6f, 0x69, 0x64, 0x20, // v_color0;.void + 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, // main ().{. gl_F + 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // ragColor = v_col + 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // or0;.}... }; static const uint8_t fs_drawstress_dx9[137] = { diff --git a/examples/17-drawstress/vs_drawstress.bin.h b/examples/17-drawstress/vs_drawstress.bin.h index e50aa29e1..1422f1a3c 100644 --- a/examples/17-drawstress/vs_drawstress.bin.h +++ b/examples/17-drawstress/vs_drawstress.bin.h @@ -1,26 +1,26 @@ -static const uint8_t vs_drawstress_glsl[335] = +static const uint8_t vs_drawstress_glsl[325] = { 0x56, 0x53, 0x48, 0x03, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH....I...u_mod 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, // elViewProj...... - 0x2a, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6d, 0x65, // *...attribute me - 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, // diump vec4 a_col - 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6d, // or0;.attribute m - 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, // ediump vec3 a_po - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, // sition;.varying - 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, // mediump vec4 v_c - 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, // olor0;.uniform m - 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, // ediump mat4 u_mo - 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, // delViewProj;.voi - 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x6d, 0x65, // d main ().{. me - 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // diump vec4 tmpva - 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, // r_1;. tmpvar_1. - 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // w = 1.0;. tmpva - 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, // r_1.xyz = a_posi - 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, // tion;. gl_Posit - 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, // ion = (u_modelVi - 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ewProj * tmpvar_ - 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, // 1);. v_color0 = - 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // a_color0;.}... + 0x20, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, // ...attribute hi + 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // ghp vec4 a_color + 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, // 0;.attribute hig + 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, // hp vec3 a_positi + 0x6f, 0x6e, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, // on;.varying high + 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, // p vec4 v_color0; + 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x6d, // .uniform highp m + 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, // at4 u_modelViewP + 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, // roj;.void main ( + 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // ).{. highp vec4 + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_1;. tmp + 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, // var_1.w = 1.0;. + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, // tmpvar_1.xyz = + 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, // a_position;. gl + 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, // _Position = (u_m + 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, // odelViewProj * t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, // mpvar_1);. v_co + 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, // lor0 = a_color0; + 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // .}... }; static const uint8_t vs_drawstress_dx9[319] = { diff --git a/examples/common/font/fs_font_basic.bin.h b/examples/common/font/fs_font_basic.bin.h index 4e3a09589..c99b362e8 100644 --- a/examples/common/font/fs_font_basic.bin.h +++ b/examples/common/font/fs_font_basic.bin.h @@ -1,40 +1,40 @@ -static const uint8_t fs_font_basic_glsl[546] = +static const uint8_t fs_font_basic_glsl[547] = { 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, 0x02, 0x02, 0x00, 0x00, 0x76, // Color..........v - 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, // arying mediump v - 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, // ec4 v_color0;.va - 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, // rying mediump ve - 0x63, 0x34, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, // c4 v_texcoord0;. - 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x43, // uniform samplerC - 0x75, 0x62, 0x65, 0x20, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, // ube u_texColor;. - 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, // void main ().{. - 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x72, 0x67, 0x62, 0x61, // lowp float rgba - 0x5f, 0x31, 0x5b, 0x34, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, // _1[4];. lowp ve - 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, // c4 tmpvar_2;. t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, // mpvar_2 = textur - 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // eCube (u_texColo - 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, // r, v_texcoord0.x - 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // yz);. int tmpva - 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x20, // r_3;. tmpvar_3 - 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // = int(((v_texcoo - 0x72, 0x64, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x30, // rd0.w * 4.0) + 0 - 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x30, // .5));. rgba_1[0 - 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x7a, 0x3b, 0x0a, // ] = tmpvar_2.z;. - 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x31, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, // rgba_1[1] = tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, // pvar_2.y;. rgba - 0x5f, 0x31, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, // _1[2] = tmpvar_2 - 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x33, 0x5d, 0x20, // .x;. rgba_1[3] - 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, // = tmpvar_2.w;. - 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // lowp vec4 tmpvar - 0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, // _4;. tmpvar_4.x - 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, // yz = v_color0.xy - 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x77, 0x20, // z;. tmpvar_4.w - 0x3d, 0x20, 0x28, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, // = (v_color0.w * - 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x5d, // rgba_1[tmpvar_3] - 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, // .. + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x03, 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 + 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, // _texcoord0;.unif + 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, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x72, 0x67, 0x62, // lowp float rgb + 0x61, 0x5f, 0x31, 0x5b, 0x34, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, // a_1[4];. lowp v + 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, // ec4 tmpvar_2;. + 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, // ... }; static const uint8_t fs_font_basic_dx9[445] = { diff --git a/examples/common/font/fs_font_distance_field.bin.h b/examples/common/font/fs_font_distance_field.bin.h index bf0902217..5dd3fb1af 100644 --- a/examples/common/font/fs_font_distance_field.bin.h +++ b/examples/common/font/fs_font_distance_field.bin.h @@ -1,69 +1,69 @@ -static const uint8_t fs_font_distance_field_glsl[1020] = +static const uint8_t fs_font_distance_field_glsl[1013] = { 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, 0xdc, 0x03, 0x00, 0x00, 0x76, // Color..........v - 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, // arying mediump v - 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, // ec4 v_color0;.va - 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, // rying mediump ve - 0x63, 0x34, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, // c4 v_texcoord0;. - 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x43, // uniform samplerC - 0x75, 0x62, 0x65, 0x20, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, // ube u_texColor;. - 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, // void main ().{. - 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x72, 0x67, 0x62, 0x61, // lowp float rgba - 0x5f, 0x31, 0x5b, 0x34, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, // _1[4];. lowp ve - 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, // c4 tmpvar_2;. t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, // mpvar_2 = textur - 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // eCube (u_texColo - 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, // r, v_texcoord0.x - 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // yz);. int tmpva - 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x20, // r_3;. tmpvar_3 - 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // = int(((v_texcoo - 0x72, 0x64, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x30, // rd0.w * 4.0) + 0 - 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x30, // .5));. rgba_1[0 - 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x7a, 0x3b, 0x0a, // ] = tmpvar_2.z;. - 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x31, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, // rgba_1[1] = tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, // pvar_2.y;. rgba - 0x5f, 0x31, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, // _1[2] = tmpvar_2 - 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x33, 0x5d, 0x20, // .x;. rgba_1[3] - 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, // = tmpvar_2.w;. - 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, // mediump vec3 tmp - 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // var_4;. tmpvar_ - 0x34, 0x20, 0x3d, 0x20, 0x64, 0x46, 0x64, 0x78, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // 4 = dFdx(v_texco - 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x64, // ord0.xyz);. med - 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // iump vec3 tmpvar - 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x3d, // _5;. tmpvar_5 = - 0x20, 0x64, 0x46, 0x64, 0x79, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // dFdy(v_texcoord - 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, // 0.xyz);. medium - 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, // p float tmpvar_6 - 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x20, 0x3d, 0x20, 0x28, // ;. tmpvar_6 = ( - 0x38, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x28, 0x73, 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, 0x20, // 8.0 * (sqrt(. - 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2c, 0x20, // dot (tmpvar_4, - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x20, 0x2b, 0x20, // tmpvar_4). ) + - 0x73, 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, // sqrt(. dot (t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // mpvar_5, tmpvar_ - 0x35, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x64, 0x69, // 5). )));. medi - 0x75, 0x6d, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, // ump float edge0_ - 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x37, 0x20, 0x3d, 0x20, 0x28, // 7;. edge0_7 = ( - 0x30, 0x2e, 0x35, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x29, 0x3b, // 0.5 - tmpvar_6); - 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, // . lowp float tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // pvar_8;. tmpvar - 0x5f, 0x38, 0x20, 0x3d, 0x20, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x28, 0x28, 0x72, 0x67, // _8 = clamp (((rg - 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x5d, 0x20, 0x2d, // ba_1[tmpvar_3] - - 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x37, 0x29, 0x20, 0x2f, 0x20, 0x28, 0x0a, 0x20, 0x20, // edge0_7) / (. - 0x20, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // (0.5 + tmpvar_ - 0x36, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x37, 0x29, // 6). - edge0_7) - 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, // ), 0.0, 1.0);. - 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // lowp vec4 tmpvar - 0x5f, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x78, // _9;. tmpvar_9.x - 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, // yz = v_color0.xy - 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x77, 0x20, // z;. tmpvar_9.w - 0x3d, 0x20, 0x28, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, // = (v_color0.w * - 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, // (tmpvar_8 * (tmp - 0x76, 0x61, 0x72, 0x5f, 0x38, 0x20, 0x2a, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x33, 0x2e, // var_8 * . (3. - 0x30, 0x20, 0x2d, 0x20, 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // 0 - (2.0 * tmpva - 0x72, 0x5f, 0x38, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, // r_8)). )));. g - 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, // l_FragColor = tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // pvar_9;.}... + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0xd5, 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 + 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, // _texcoord0;.unif + 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, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x72, 0x67, 0x62, // lowp float rgb + 0x61, 0x5f, 0x31, 0x5b, 0x34, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, // a_1[4];. lowp v + 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, // ec4 tmpvar_2;. + 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, // .}... }; static const uint8_t fs_font_distance_field_dx9[737] = { diff --git a/examples/common/font/fs_font_distance_field_subpixel.bin.h b/examples/common/font/fs_font_distance_field_subpixel.bin.h index 6a4614f6d..e65033d57 100644 --- a/examples/common/font/fs_font_distance_field_subpixel.bin.h +++ b/examples/common/font/fs_font_distance_field_subpixel.bin.h @@ -1,88 +1,84 @@ -static const uint8_t fs_font_distance_field_subpixel_glsl[1320] = +static const uint8_t fs_font_distance_field_subpixel_glsl[1262] = { 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, 0x08, 0x05, 0x00, 0x00, 0x76, // Color..........v - 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, // arying mediump v - 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, // ec4 v_color0;.va - 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, // rying mediump ve - 0x63, 0x34, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, // c4 v_texcoord0;. - 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x43, // uniform samplerC - 0x75, 0x62, 0x65, 0x20, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, // ube u_texColor;. - 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, // void main ().{. - 0x20, 0x69, 0x6e, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, // int tmpvar_1;. - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, // tmpvar_1 = int( - 0x28, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x77, 0x20, // ((v_texcoord0.w - 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, // * 4.0) + 0.5));. - 0x20, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, // mediump vec3 t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_2;. tmpva - 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x64, 0x46, 0x64, 0x78, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, // r_2 = dFdx(v_tex - 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6d, // coord0.xyz);. m - 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, // ediump vec3 tmpv - 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, // ar_3;. tmpvar_3 - 0x20, 0x3d, 0x20, 0x64, 0x46, 0x64, 0x79, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // = dFdy(v_texcoo - 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x64, 0x69, // rd0.xyz);. medi - 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ump vec3 tmpvar_ - 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x20, 0x3d, 0x20, // 4;. tmpvar_4 = - 0x28, 0x30, 0x2e, 0x31, 0x36, 0x36, 0x36, 0x36, 0x37, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, // (0.166667 * tmpv - 0x61, 0x72, 0x5f, 0x32, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, // ar_2);. lowp fl - 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, // oat tmpvar_5;. - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, // tmpvar_5 = textu - 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, // reCube (u_texCol - 0x6f, 0x72, 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // or, (v_texcoord0 - 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, // .xyz - tmpvar_4) - 0x29, 0x2e, 0x7a, 0x79, 0x78, 0x77, 0x5b, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x5d, // ).zyxw[tmpvar_1] + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0xce, 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 + 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, // _texcoord0;.unif + 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, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_6;. tmpva - 0x72, 0x5f, 0x36, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, // r_6 = textureCub + 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 - 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, 0x29, 0x2e, 0x7a, 0x79, 0x78, // + tmpvar_4)).zyx + 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, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x20, 0x3d, // _7;. tmpvar_7 = - 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // (0.5 * (tmpvar_ - 0x35, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x29, 0x29, 0x3b, 0x0a, // 5 + tmpvar_6));. - 0x20, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, // mediump float - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // tmpvar_8;. tmpv - 0x61, 0x72, 0x5f, 0x38, 0x20, 0x3d, 0x20, 0x28, 0x38, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x28, 0x73, // ar_8 = (8.0 * (s - 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, // qrt(. dot (tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, // pvar_2, tmpvar_2 - 0x29, 0x0a, 0x20, 0x20, 0x29, 0x20, 0x2b, 0x20, 0x73, 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, // ). ) + sqrt(. - 0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2c, // dot (tmpvar_3, - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x29, 0x29, // tmpvar_3). ))) - 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, // ;. lowp vec3 tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // pvar_9;. tmpvar - 0x5f, 0x39, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, // _9.x = tmpvar_5; - 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x79, 0x20, 0x3d, 0x20, // . tmpvar_9.y = - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // tmpvar_7;. tmpv - 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ar_9.z = tmpvar_ - 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x66, 0x6c, 0x6f, // 6;. mediump flo - 0x61, 0x74, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x31, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x65, // at edge0_10;. e - 0x64, 0x67, 0x65, 0x30, 0x5f, 0x31, 0x30, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2d, // dge0_10 = (0.5 - - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, // tmpvar_8);. lo + 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 - 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x20, 0x3d, // 1;. tmpvar_11 = - 0x20, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x28, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // clamp (((tmpvar - 0x5f, 0x39, 0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x31, 0x30, 0x29, 0x20, 0x2f, // _9 - edge0_10) / - 0x20, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2b, 0x20, 0x74, 0x6d, // (. (0.5 + tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, // pvar_8). - edg - 0x65, 0x30, 0x5f, 0x31, 0x30, 0x29, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, // e0_10)), 0.0, 1. - 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, // 0);. lowp vec3 - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_12;. tmp - 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, // var_12 = ((tmpva - 0x72, 0x5f, 0x31, 0x31, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // r_11 * (tmpvar_1 - 0x31, 0x20, 0x2a, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x33, 0x2e, 0x30, 0x20, 0x2d, 0x20, // 1 * . (3.0 - - 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, // (2.0 * tmpvar_11 - 0x29, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // )). )) * v_colo - 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // r0.w);. gl_Frag - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, // Color.xyz = tmpv - 0x61, 0x72, 0x5f, 0x31, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, // ar_12;. lowp fl - 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x33, 0x3b, 0x0a, 0x20, // oat tmpvar_13;. - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, // tmpvar_13 = (tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x20, 0x2a, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // pvar_7 * v_color - 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, // 0.w);. gl_FragC - 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // olor.w = tmpvar_ - 0x31, 0x33, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // 13;.}... + 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);.}... }; static const uint8_t fs_font_distance_field_subpixel_dx9[885] = { diff --git a/examples/common/font/vs_font_basic.bin.h b/examples/common/font/vs_font_basic.bin.h index 7ba53b6eb..a7bf10dd3 100644 --- a/examples/common/font/vs_font_basic.bin.h +++ b/examples/common/font/vs_font_basic.bin.h @@ -1,33 +1,32 @@ -static const uint8_t vs_font_basic_glsl[445] = +static const uint8_t vs_font_basic_glsl[431] = { 0x56, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, // elViewProj...... - 0x98, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6d, 0x65, // ....attribute me - 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, // diump vec4 a_col - 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6d, // or0;.attribute m - 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, // ediump vec2 a_po - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, // sition;.attribut - 0x65, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, // e mediump vec4 a - 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, // _texcoord0;.vary - 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // ing mediump vec4 - 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, // v_color0;.varyi - 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, // ng mediump vec4 - 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, // v_texcoord0;.uni - 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x6d, 0x61, 0x74, // form mediump mat - 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // 4 u_modelViewPro - 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, // j;.void main (). - 0x7b, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // {. mediump vec4 - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_1;. tmp - 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x32, 0x28, // var_1.zw = vec2( - 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // 0.0, 1.0);. tmp - 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, // var_1.xy = a_pos - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, // ition;. gl_Posi - 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, // tion = (u_modelV - 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // iewProj * tmpvar - 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // _1);. v_texcoor - 0x64, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // d0 = a_texcoord0 - 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x61, // ;. v_color0 = a - 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // _color0;.}... + 0x8a, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, // ....attribute hi + 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // ghp vec4 a_color + 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, // 0;.attribute hig + 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, // hp vec2 a_positi + 0x6f, 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, // on;.attribute hi + 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // ghp vec4 a_texco + 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, // ord0;.varying hi + 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // ghp vec4 v_color + 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // 0;.varying highp + 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // vec4 v_texcoord + 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // 0;.uniform highp + 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, // mat4 u_modelVie + 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, // wProj;.void main + 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // ().{. highp ve + 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, // c4 tmpvar_1;. t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, // mpvar_1.zw = vec + 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, // 2(0.0, 1.0);. t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, // mpvar_1.xy = a_p + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, // osition;. gl_Po + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, // sition = (u_mode + 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, // lViewProj * tmpv + 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // ar_1);. v_texco + 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // ord0 = a_texcoor + 0x64, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, // d0;. v_color0 = + 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // a_color0;.}... }; static const uint8_t vs_font_basic_dx9[335] = { diff --git a/examples/common/font/vs_font_distance_field.bin.h b/examples/common/font/vs_font_distance_field.bin.h index c11bfd5c9..57f7b223c 100644 --- a/examples/common/font/vs_font_distance_field.bin.h +++ b/examples/common/font/vs_font_distance_field.bin.h @@ -1,33 +1,32 @@ -static const uint8_t vs_font_distance_field_glsl[445] = +static const uint8_t vs_font_distance_field_glsl[431] = { 0x56, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, // elViewProj...... - 0x98, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6d, 0x65, // ....attribute me - 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, // diump vec4 a_col - 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6d, // or0;.attribute m - 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, // ediump vec2 a_po - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, // sition;.attribut - 0x65, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, // e mediump vec4 a - 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, // _texcoord0;.vary - 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // ing mediump vec4 - 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, // v_color0;.varyi - 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, // ng mediump vec4 - 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, // v_texcoord0;.uni - 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x6d, 0x61, 0x74, // form mediump mat - 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // 4 u_modelViewPro - 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, // j;.void main (). - 0x7b, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // {. mediump vec4 - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_1;. tmp - 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x32, 0x28, // var_1.zw = vec2( - 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // 0.0, 1.0);. tmp - 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, // var_1.xy = a_pos - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, // ition;. gl_Posi - 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, // tion = (u_modelV - 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // iewProj * tmpvar - 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // _1);. v_texcoor - 0x64, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // d0 = a_texcoord0 - 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x61, // ;. v_color0 = a - 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // _color0;.}... + 0x8a, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, // ....attribute hi + 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // ghp vec4 a_color + 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, // 0;.attribute hig + 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, // hp vec2 a_positi + 0x6f, 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, // on;.attribute hi + 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // ghp vec4 a_texco + 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, // ord0;.varying hi + 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // ghp vec4 v_color + 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // 0;.varying highp + 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // vec4 v_texcoord + 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // 0;.uniform highp + 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, // mat4 u_modelVie + 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, // wProj;.void main + 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // ().{. highp ve + 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, // c4 tmpvar_1;. t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, // mpvar_1.zw = vec + 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, // 2(0.0, 1.0);. t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, // mpvar_1.xy = a_p + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, // osition;. gl_Po + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, // sition = (u_mode + 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, // lViewProj * tmpv + 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // ar_1);. v_texco + 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // ord0 = a_texcoor + 0x64, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, // d0;. v_color0 = + 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // a_color0;.}... }; static const uint8_t vs_font_distance_field_dx9[335] = { diff --git a/examples/common/font/vs_font_distance_field_subpixel.bin.h b/examples/common/font/vs_font_distance_field_subpixel.bin.h index 1d0b8988b..0b5e1315a 100644 --- a/examples/common/font/vs_font_distance_field_subpixel.bin.h +++ b/examples/common/font/vs_font_distance_field_subpixel.bin.h @@ -1,33 +1,32 @@ -static const uint8_t vs_font_distance_field_subpixel_glsl[445] = +static const uint8_t vs_font_distance_field_subpixel_glsl[431] = { 0x56, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH........u_mod 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, // elViewProj...... - 0x98, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6d, 0x65, // ....attribute me - 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, // diump vec4 a_col - 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6d, // or0;.attribute m - 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, // ediump vec2 a_po - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, // sition;.attribut - 0x65, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, // e mediump vec4 a - 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, // _texcoord0;.vary - 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // ing mediump vec4 - 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, // v_color0;.varyi - 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, // ng mediump vec4 - 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, // v_texcoord0;.uni - 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x6d, 0x61, 0x74, // form mediump mat - 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // 4 u_modelViewPro - 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, // j;.void main (). - 0x7b, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // {. mediump vec4 - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_1;. tmp - 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x32, 0x28, // var_1.zw = vec2( - 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // 0.0, 1.0);. tmp - 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, // var_1.xy = a_pos - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, // ition;. gl_Posi - 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, // tion = (u_modelV - 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // iewProj * tmpvar - 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // _1);. v_texcoor - 0x64, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // d0 = a_texcoord0 - 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x61, // ;. v_color0 = a - 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // _color0;.}... + 0x8a, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, // ....attribute hi + 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // ghp vec4 a_color + 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, // 0;.attribute hig + 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, // hp vec2 a_positi + 0x6f, 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, // on;.attribute hi + 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // ghp vec4 a_texco + 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, // ord0;.varying hi + 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // ghp vec4 v_color + 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // 0;.varying highp + 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // vec4 v_texcoord + 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // 0;.uniform highp + 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, // mat4 u_modelVie + 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, // wProj;.void main + 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // ().{. highp ve + 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, // c4 tmpvar_1;. t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, // mpvar_1.zw = vec + 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, // 2(0.0, 1.0);. t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, // mpvar_1.xy = a_p + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, // osition;. gl_Po + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, // sition = (u_mode + 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, // lViewProj * tmpv + 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // ar_1);. v_texco + 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // ord0 = a_texcoor + 0x64, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, // d0;. v_color0 = + 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // a_color0;.}... }; static const uint8_t vs_font_distance_field_subpixel_dx9[335] = { diff --git a/examples/common/imgui/fs_imgui_color.bin.h b/examples/common/imgui/fs_imgui_color.bin.h index a1dd157c1..b907325de 100644 --- a/examples/common/imgui/fs_imgui_color.bin.h +++ b/examples/common/imgui/fs_imgui_color.bin.h @@ -1,11 +1,11 @@ -static const uint8_t fs_imgui_color_glsl[91] = +static const uint8_t fs_imgui_color_glsl[89] = { - 0x46, 0x53, 0x48, 0x03, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x76, 0x61, // FSH....I..L...va - 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, // rying mediump ve - 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x6f, 0x69, // c4 v_color0;.voi - 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x67, 0x6c, // d main ().{. gl - 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x63, // _FragColor = v_c - 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // olor0;.}... + 0x46, 0x53, 0x48, 0x03, 0xa4, 0x8b, 0xef, 0x49, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x76, 0x61, // FSH....I..J...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, 0x6f, 0x69, 0x64, 0x20, // v_color0;.void + 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, // main ().{. gl_F + 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // ragColor = v_col + 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // or0;.}... }; static const uint8_t fs_imgui_color_dx9[137] = { diff --git a/examples/common/imgui/fs_imgui_cubemap.bin.h b/examples/common/imgui/fs_imgui_cubemap.bin.h index a2b2644f4..6d9272845 100644 --- a/examples/common/imgui/fs_imgui_cubemap.bin.h +++ b/examples/common/imgui/fs_imgui_cubemap.bin.h @@ -1,23 +1,23 @@ -static const uint8_t fs_imgui_cubemap_glsl[280] = +static const uint8_t fs_imgui_cubemap_glsl[281] = { 0x46, 0x53, 0x48, 0x03, 0xe3, 0xc2, 0x5c, 0x65, 0x02, 0x00, 0x0a, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH....e...u_ima 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, // geLod.......s_te - 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0xe7, 0x00, 0x00, 0x00, // xColor.......... - 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, // varying mediump - 0x76, 0x65, 0x63, 0x33, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, 0x0a, 0x75, // vec3 v_normal;.u - 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x66, // niform mediump f - 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x3b, // loat u_imageLod; - 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // .uniform sampler - 0x43, 0x75, 0x62, 0x65, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, // Cube 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 - 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, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x2c, 0x20, 0x75, 0x5f, 0x69, 0x6d, // , v_normal, u_im - 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, // ageLod);. 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;.}... + 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0xe8, 0x00, 0x00, 0x00, // xColor.......... + 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // varying highp ve + 0x63, 0x33, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, 0x0a, 0x75, 0x6e, 0x69, // c3 v_normal;.uni + 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // form highp float + 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x3b, 0x0a, 0x75, 0x6e, 0x69, // u_imageLod;.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, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, // . lowp vec4 tmp + 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // var_1;. tmpvar_ + 0x31, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x4c, // 1 = textureCubeL + 0x6f, 0x64, 0x20, 0x20, 0x20, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // od (s_texColo + 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x2c, 0x20, 0x75, 0x5f, 0x69, // r, v_normal, u_i + 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, // mageLod);. 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;.}... }; static const uint8_t fs_imgui_cubemap_dx9[290] = { diff --git a/examples/common/imgui/fs_imgui_image.bin.h b/examples/common/imgui/fs_imgui_image.bin.h index e650339f0..a7f3744e9 100644 --- a/examples/common/imgui/fs_imgui_image.bin.h +++ b/examples/common/imgui/fs_imgui_image.bin.h @@ -1,25 +1,25 @@ -static const uint8_t fs_imgui_image_glsl[310] = +static const uint8_t fs_imgui_image_glsl[306] = { 0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x02, 0x00, 0x0a, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x74, 0x65, // geLod.......u_te - 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x05, 0x01, 0x00, 0x00, // xColor.......... - 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, // varying mediump - 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // vec2 v_texcoord0 - 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, // ;.uniform medium - 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, // p float u_imageL - 0x6f, 0x64, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, // od;.uniform samp - 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // ler2D u_texColor - 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, // ;.void main ().{ - 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, // . lowp vec4 tmp - 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // var_1;. tmpvar_ - 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // 1.w = 1.0;. tmp - 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, // var_1.xyz = text - 0x75, 0x72, 0x65, 0x32, 0x44, 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, 0x20, 0x28, 0x75, 0x5f, 0x74, // ure2DLod (u_t - 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // exColor, v_texco - 0x6f, 0x72, 0x64, 0x30, 0x2c, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, // ord0, u_imageLod - 0x29, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // ).xyz;. gl_Frag - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // Color = tmpvar_1 - 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // ;.}... + 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, // xColor.......... + 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // varying highp ve + 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, // c2 v_texcoord0;. + 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, // uniform highp fl + 0x6f, 0x61, 0x74, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x3b, 0x0a, // oat u_imageLod;. + 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, // uniform sampler2 + 0x44, 0x20, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x76, 0x6f, // D u_texColor;.vo + 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x6c, // id main ().{. l + 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // owp vec4 tmpvar_ + 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, // 1;. tmpvar_1.w + 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // = 1.0;. tmpvar_ + 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, // 1.xyz = texture2 + 0x44, 0x4c, 0x6f, 0x64, 0x20, 0x20, 0x20, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, // DLod (u_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, 0x29, 0x2e, 0x78, 0x79, // , u_imageLod).xy + 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, // z;. 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_image_dx9[342] = { diff --git a/examples/common/imgui/fs_imgui_image_swizz.bin.h b/examples/common/imgui/fs_imgui_image_swizz.bin.h index 5df2bfd96..f905013a7 100644 --- a/examples/common/imgui/fs_imgui_image_swizz.bin.h +++ b/examples/common/imgui/fs_imgui_image_swizz.bin.h @@ -1,29 +1,29 @@ -static const uint8_t fs_imgui_image_swizz_glsl[377] = +static const uint8_t fs_imgui_image_swizz_glsl[371] = { 0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x03, 0x00, 0x0a, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x09, 0x75, 0x5f, 0x73, 0x77, // geLod.......u_sw 0x69, 0x7a, 0x7a, 0x6c, 0x65, 0x07, 0x01, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, // izzle.......s_te - 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x38, 0x01, 0x00, 0x00, // xColor......8... - 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, // varying mediump - 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // vec2 v_texcoord0 - 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, // ;.uniform medium - 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, // p float u_imageL - 0x6f, 0x64, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x65, 0x64, 0x69, // od;.uniform medi - 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, // ump vec4 u_swizz - 0x6c, 0x65, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, // le;.uniform samp - 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // ler2D s_texColor - 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, // ;.void main ().{ - 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, // . lowp vec4 tmp - 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // var_1;. tmpvar_ - 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // 1.w = 1.0;. tmp - 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x33, // var_1.xyz = vec3 - 0x28, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x4c, // (dot (texture2DL - 0x6f, 0x64, 0x20, 0x20, 0x20, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // od (s_texColo - 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2c, 0x20, // r, v_texcoord0, - 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x29, 0x2c, 0x20, 0x75, 0x5f, 0x73, // u_imageLod), u_s - 0x77, 0x69, 0x7a, 0x7a, 0x6c, 0x65, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, // wizzle));. 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;.}... + 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x32, 0x01, 0x00, 0x00, // xColor......2... + 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // varying highp ve + 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, // c2 v_texcoord0;. + 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, // uniform highp fl + 0x6f, 0x61, 0x74, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x3b, 0x0a, // oat u_imageLod;. + 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // uniform highp ve + 0x63, 0x34, 0x20, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, 0x6c, 0x65, 0x3b, 0x0a, 0x75, 0x6e, // c4 u_swizzle;.un + 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, // iform sampler2D + 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, // s_texColor;.void + 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, // main ().{. low + 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 = + 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, 0x76, 0x65, 0x63, 0x33, 0x28, 0x64, 0x6f, 0x74, 0x20, 0x28, // xyz = vec3(dot ( + 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, 0x29, 0x2c, 0x20, 0x75, 0x5f, 0x73, 0x77, 0x69, 0x7a, 0x7a, 0x6c, 0x65, // eLod), u_swizzle + 0x29, 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, 0x31, 0x3b, 0x0a, 0x7d, // or = tmpvar_1;.} + 0x0a, 0x0a, 0x00, // ... }; static const uint8_t fs_imgui_image_swizz_dx9[410] = { diff --git a/examples/common/imgui/fs_imgui_texture.bin.h b/examples/common/imgui/fs_imgui_texture.bin.h index 5ce3fd233..dcb5d4490 100644 --- a/examples/common/imgui/fs_imgui_texture.bin.h +++ b/examples/common/imgui/fs_imgui_texture.bin.h @@ -1,24 +1,24 @@ -static const uint8_t fs_imgui_texture_glsl[294] = +static const uint8_t fs_imgui_texture_glsl[290] = { 0x46, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, // FSH........s_tex - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x06, 0x01, 0x00, 0x00, 0x76, // Color..........v - 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, // arying mediump v - 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, // ec4 v_color0;.va - 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, // rying mediump ve - 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, // c2 v_texcoord0;. - 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, // uniform sampler2 - 0x44, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x76, 0x6f, // D s_texColor;.vo - 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x6c, // id main ().{. l - 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // owp vec4 tmpvar_ - 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, // 1;. tmpvar_1.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, 0x31, 0x2e, 0x77, 0x20, 0x3d, // ;. tmpvar_1.w = - 0x20, 0x28, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x74, // (v_color0.w * t - 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, // exture2D (s_texC - 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // olor, v_texcoord - 0x30, 0x29, 0x2e, 0x78, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // 0).x);. gl_Frag - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // Color = tmpvar_1 - 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // ;.}... + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x02, 0x01, 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, 0x32, 0x20, 0x76, // ing highp vec2 v + 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, // _texcoord0;.unif + 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, 0x73, 0x5f, // orm sampler2D s_ + 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, // texColor;.void m + 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, // ain ().{. lowp + 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, // vec4 tmpvar_1;. + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, // tmpvar_1.xyz = + 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, // v_color0.xyz;. + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x5f, // tmpvar_1.w = (v_ + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, // color0.w * textu + 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // re2D (s_texColor + 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, 0x2e, 0x78, // , v_texcoord0).x + 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_texture_dx9[241] = { diff --git a/examples/common/imgui/vs_imgui_color.bin.h b/examples/common/imgui/vs_imgui_color.bin.h index b138a3944..03e45a23b 100644 --- a/examples/common/imgui/vs_imgui_color.bin.h +++ b/examples/common/imgui/vs_imgui_color.bin.h @@ -1,26 +1,26 @@ -static const uint8_t vs_imgui_color_glsl[334] = +static const uint8_t vs_imgui_color_glsl[324] = { 0x56, 0x53, 0x48, 0x03, 0xa4, 0x8b, 0xef, 0x49, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH....I...u_vie - 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, 0x2e, 0x01, 0x00, 0x00, 0x61, // wProj..........a - 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, // ttribute mediump - 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, // vec4 a_color0;. - 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, // attribute medium - 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // p vec3 a_positio - 0x6e, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, // n;.varying mediu - 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, // mp vec4 v_color0 - 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, // ;.uniform medium - 0x70, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // p mat4 u_viewPro - 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, // j;.void main (). - 0x7b, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // {. mediump vec4 - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_1;. tmp - 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x32, 0x28, // var_1.zw = vec2( - 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // 0.0, 1.0);. tmp - 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, // var_1.xy = a_pos - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, // ition.xy;. gl_P - 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x76, 0x69, 0x65, // osition = (u_vie - 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // wProj * tmpvar_1 - 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, // );. v_color0 = - 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // a_color0;.}... + 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, 0x24, 0x01, 0x00, 0x00, 0x61, // wProj......$...a + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // ttribute highp v + 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, // ec4 a_color0;.at + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // tribute highp ve + 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x76, // c3 a_position;.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, 0x75, 0x6e, 0x69, 0x66, // 4 v_color0;.unif + 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, // orm highp mat4 u + 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, // _viewProj;.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, 0x7a, 0x77, 0x20, 0x3d, // . tmpvar_1.zw = + 0x20, 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, // vec2(0.0, 1.0); + 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, // . tmpvar_1.xy = + 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x79, 0x3b, 0x0a, // a_position.xy;. + 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, // gl_Position = + 0x28, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, // (u_viewProj * tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // pvar_1);. v_col + 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, // or0 = a_color0;. + 0x7d, 0x0a, 0x0a, 0x00, // }... }; static const uint8_t vs_imgui_color_dx9[290] = { diff --git a/examples/common/imgui/vs_imgui_cubemap.bin.h b/examples/common/imgui/vs_imgui_cubemap.bin.h index e98b40f8a..fe043f59e 100644 --- a/examples/common/imgui/vs_imgui_cubemap.bin.h +++ b/examples/common/imgui/vs_imgui_cubemap.bin.h @@ -1,28 +1,27 @@ -static const uint8_t vs_imgui_cubemap_glsl[355] = +static const uint8_t vs_imgui_cubemap_glsl[345] = { 0x56, 0x53, 0x48, 0x03, 0xe3, 0xc2, 0x5c, 0x65, 0x01, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH....e...u_mod 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, // elViewProj...... - 0x3e, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6d, 0x65, // >...attribute me - 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x6e, 0x6f, 0x72, // diump vec4 a_nor - 0x6d, 0x61, 0x6c, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6d, // mal;.attribute m - 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, // ediump vec3 a_po - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, // sition;.varying - 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x76, 0x5f, 0x6e, // mediump vec3 v_n - 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, // ormal;.uniform m - 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, // ediump mat4 u_mo - 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, // delViewProj;.voi - 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x6d, 0x65, // d main ().{. me - 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // diump vec4 tmpva - 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, // r_1;. tmpvar_1. - 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // w = 1.0;. tmpva - 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, // r_1.xyz = a_posi - 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, // tion;. gl_Posit - 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, // ion = (u_modelVi - 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ewProj * tmpvar_ - 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x20, 0x3d, // 1);. v_normal = - 0x20, 0x28, 0x28, 0x61, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x2e, 0x78, 0x79, 0x7a, 0x20, // ((a_normal.xyz - 0x2a, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x20, 0x2d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x7d, // * 2.0) - 1.0);.} - 0x0a, 0x0a, 0x00, // ... + 0x34, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, // 4...attribute hi + 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, // ghp vec4 a_norma + 0x6c, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, // l;.attribute hig + 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, // hp vec3 a_positi + 0x6f, 0x6e, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, // on;.varying high + 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, // p vec3 v_normal; + 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x6d, // .uniform highp m + 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, // at4 u_modelViewP + 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, // roj;.void main ( + 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // ).{. highp vec4 + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_1;. tmp + 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, // var_1.w = 1.0;. + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, // tmpvar_1.xyz = + 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, // a_position;. gl + 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, // _Position = (u_m + 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, // odelViewProj * t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x6e, 0x6f, // mpvar_1);. v_no + 0x72, 0x6d, 0x61, 0x6c, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x61, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, // rmal = ((a_norma + 0x6c, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2a, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x20, 0x2d, 0x20, 0x31, // l.xyz * 2.0) - 1 + 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // .0);.}... }; static const uint8_t vs_imgui_cubemap_dx9[351] = { diff --git a/examples/common/imgui/vs_imgui_image.bin.h b/examples/common/imgui/vs_imgui_image.bin.h index 6fa02f6f7..af81b12d5 100644 --- a/examples/common/imgui/vs_imgui_image.bin.h +++ b/examples/common/imgui/vs_imgui_image.bin.h @@ -1,27 +1,26 @@ -static const uint8_t vs_imgui_image_glsl[346] = +static const uint8_t vs_imgui_image_glsl[336] = { 0x56, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH.o.><...u_vie - 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, 0x3a, 0x01, 0x00, 0x00, 0x61, // wProj......:...a - 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, // ttribute mediump - 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, // vec3 a_position - 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6d, 0x65, 0x64, 0x69, // ;.attribute medi - 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // ump vec2 a_texco - 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, // ord0;.varying me - 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, // diump vec2 v_tex - 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, // coord0;.uniform - 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x76, // mediump mat4 u_v - 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, // iewProj;.void ma - 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, // in ().{. medium - 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, 0x7a, 0x77, 0x20, 0x3d, // . tmpvar_1.zw = - 0x20, 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, // vec2(0.0, 1.0); - 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, // . tmpvar_1.xy = - 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x79, 0x3b, 0x0a, // a_position.xy;. - 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, // gl_Position = - 0x28, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, // (u_viewProj * tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, // pvar_1);. v_tex - 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // coord0 = a_texco - 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // ord0;.}... + 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, 0x30, 0x01, 0x00, 0x00, 0x61, // wProj......0...a + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // ttribute highp v + 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, // ec3 a_position;. + 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // attribute highp + 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // vec2 a_texcoord0 + 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // ;.varying highp + 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // vec2 v_texcoord0 + 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // ;.uniform highp + 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, // mat4 u_viewProj; + 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, // .void main ().{. + 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, // highp vec4 tmp + 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // var_1;. tmpvar_ + 0x31, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, // 1.zw = vec2(0.0, + 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // 1.0);. tmpvar_ + 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // 1.xy = a_positio + 0x6e, 0x2e, 0x78, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, // n.xy;. gl_Posit + 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // ion = (u_viewPro + 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, // j * tmpvar_1);. + 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x61, // v_texcoord0 = a + 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // _texcoord0;.}... }; static const uint8_t vs_imgui_image_dx9[290] = { diff --git a/examples/common/imgui/vs_imgui_texture.bin.h b/examples/common/imgui/vs_imgui_texture.bin.h index a13770212..fe914299a 100644 --- a/examples/common/imgui/vs_imgui_texture.bin.h +++ b/examples/common/imgui/vs_imgui_texture.bin.h @@ -1,33 +1,32 @@ -static const uint8_t vs_imgui_texture_glsl[433] = +static const uint8_t vs_imgui_texture_glsl[419] = { 0x56, 0x53, 0x48, 0x03, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH........u_vie - 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, 0x91, 0x01, 0x00, 0x00, 0x61, // wProj..........a - 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, // ttribute mediump - 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, // vec4 a_color0;. - 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, // attribute medium - 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // p vec3 a_positio - 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6d, 0x65, 0x64, // n;.attribute med - 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, // iump vec2 a_texc - 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6d, // oord0;.varying m - 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, // ediump vec4 v_co - 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, // lor0;.varying me - 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, // diump vec2 v_tex - 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, // coord0;.uniform - 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x76, // mediump mat4 u_v - 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, // iewProj;.void ma - 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, // in ().{. medium - 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, 0x7a, 0x77, 0x20, 0x3d, // . tmpvar_1.zw = - 0x20, 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, // vec2(0.0, 1.0); - 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, // . tmpvar_1.xy = - 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x79, 0x3b, 0x0a, // a_position.xy;. - 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, // gl_Position = - 0x28, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, // (u_viewProj * tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, // pvar_1);. v_tex - 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // coord0 = a_texco - 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, // ord0;. v_color0 - 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, // = a_color0;.}.. - 0x00, // . + 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x09, 0x01, 0x00, 0x00, 0x01, 0x00, 0x83, 0x01, 0x00, 0x00, 0x61, // wProj..........a + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // ttribute highp v + 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, // ec4 a_color0;.at + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // tribute highp ve + 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x61, // c3 a_position;.a + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // ttribute highp v + 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, // ec2 a_texcoord0; + 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // .varying highp v + 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, // ec4 v_color0;.va + 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, // rying highp vec2 + 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, // v_texcoord0;.un + 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x6d, 0x61, 0x74, 0x34, // iform highp mat4 + 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, // u_viewProj;.voi + 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x69, // d main ().{. hi + 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ghp vec4 tmpvar_ + 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, // 1;. tmpvar_1.zw + 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, // = vec2(0.0, 1.0 + 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, // );. tmpvar_1.xy + 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x79, // = a_position.xy + 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, // ;. gl_Position + 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, // = (u_viewProj * + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, // tmpvar_1);. v_t + 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, // excoord0 = a_tex + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // coord0;. v_colo + 0x72, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, // r0 = a_color0;.} + 0x0a, 0x0a, 0x00, // ... }; static const uint8_t vs_imgui_texture_dx9[326] = { diff --git a/examples/common/nanovg/fs_nanovg_fill.bin.h b/examples/common/nanovg/fs_nanovg_fill.bin.h index c5abb36bd..a0ef3e042 100644 --- a/examples/common/nanovg/fs_nanovg_fill.bin.h +++ b/examples/common/nanovg/fs_nanovg_fill.bin.h @@ -1,4 +1,4 @@ -static const uint8_t fs_nanovg_fill_glsl[3149] = +static const uint8_t fs_nanovg_fill_glsl[3095] = { 0x46, 0x53, 0x48, 0x03, 0xcf, 0xda, 0x1b, 0x94, 0x08, 0x00, 0x0c, 0x75, 0x5f, 0x73, 0x63, 0x69, // FSH........u_sci 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x08, 0x01, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x75, 0x5f, // ssorMat.......u_ @@ -9,194 +9,191 @@ static const uint8_t fs_nanovg_fill_glsl[3149] = 0x6c, 0x65, 0x07, 0x01, 0x00, 0x00, 0x01, 0x00, 0x0e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, // le.......u_exten 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x07, 0x01, 0x00, 0x00, 0x01, 0x00, 0x08, 0x75, 0x5f, // tRadius.......u_ 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x07, 0x01, 0x00, 0x00, 0x01, 0x00, 0x05, 0x73, 0x5f, 0x74, // params.......s_t - 0x65, 0x78, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0xb0, 0x0b, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, // ex..........vary - 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, // ing mediump vec2 - 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x76, 0x61, 0x72, // v_position;.var - 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, // ying mediump vec - 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, // 2 v_texcoord0;.u - 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x6d, // niform mediump m - 0x61, 0x74, 0x33, 0x20, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, // at3 u_scissorMat - 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, // ;.uniform medium - 0x70, 0x20, 0x6d, 0x61, 0x74, 0x33, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, // p mat3 u_paintMa - 0x74, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, // t;.uniform mediu - 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, // mp vec4 u_innerC - 0x6f, 0x6c, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x65, 0x64, 0x69, // ol;.uniform medi - 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, // ump vec4 u_outer - 0x43, 0x6f, 0x6c, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x65, 0x64, // Col;.uniform med - 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, // iump vec4 u_scis - 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x3b, 0x0a, 0x75, 0x6e, 0x69, // sorExtScale;.uni - 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, // form mediump vec + 0x65, 0x78, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x7a, 0x0b, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, // ex......z...vary + 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, // ing highp vec2 v + 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, // _position;.varyi + 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, // ng highp vec2 v_ + 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, // texcoord0;.unifo + 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x6d, 0x61, 0x74, 0x33, 0x20, 0x75, 0x5f, // rm highp mat3 u_ + 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, // scissorMat;.unif + 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x6d, 0x61, 0x74, 0x33, 0x20, 0x75, // orm highp mat3 u + 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, // _paintMat;.unifo + 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, // rm highp vec4 u_ + 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, // innerCol;.unifor + 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x6f, // m highp vec4 u_o + 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, // uterCol;.uniform + 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x73, 0x63, // highp vec4 u_sc + 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x3b, 0x0a, 0x75, // issorExtScale;.u + 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // niform highp vec 0x34, 0x20, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, // 4 u_extentRadius - 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, // ;.uniform medium - 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3b, // p vec4 u_params; - 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, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, // 2D s_tex;.void m - 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, // ain ().{. lowp - 0x76, 0x65, 0x63, 0x34, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x3b, 0x0a, 0x20, // vec4 result_1;. - 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, // mediump float t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, // mpvar_2;. mediu - 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, // mp vec3 tmpvar_3 - 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2e, 0x7a, 0x20, 0x3d, // ;. tmpvar_3.z = - 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, // 1.0;. tmpvar_3 - 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, // .xy = v_position - 0x3b, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, // ;. mediump vec2 - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_4;. tmp - 0x76, 0x61, 0x72, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, // var_4 = (vec2(0. + 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, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3b, 0x0a, 0x75, // vec4 u_params;.u + 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, // niform sampler2D + 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, // s_tex;.void mai + 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, // n ().{. lowp ve + 0x63, 0x34, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x68, // c4 result_1;. h + 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ighp float tmpva + 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // r_2;. highp vec + 0x32, 0x20, 0x73, 0x63, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // 2 sc_3;. highp + 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, // vec3 tmpvar_4;. + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x31, 0x2e, // tmpvar_4.z = 1. + 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, 0x79, // 0;. tmpvar_4.xy + 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, // = v_position;. + 0x20, 0x73, 0x63, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, // sc_3 = (vec2(0. 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x20, 0x2d, 0x20, 0x28, 0x28, 0x0a, 0x20, 0x20, 0x20, // 5, 0.5) - ((. 0x20, 0x61, 0x62, 0x73, 0x28, 0x28, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, // abs((u_scissorM - 0x61, 0x74, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x2e, 0x78, // at * tmpvar_3).x + 0x61, 0x74, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, 0x2e, 0x78, // at * tmpvar_4).x 0x79, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2d, 0x20, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, // y). - u_scisso 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x78, 0x79, 0x29, 0x20, 0x2a, 0x20, // rExtScale.xy) * 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, // u_scissorExtScal 0x65, 0x2e, 0x7a, 0x77, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // e.zw));. tmpvar - 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x74, 0x6d, 0x70, // _2 = (clamp (tmp - 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, // var_4.x, 0.0, 1. - 0x30, 0x29, 0x20, 0x2a, 0x20, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, // 0) * clamp (tmpv - 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x79, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, // ar_4.y, 0.0, 1.0 - 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x66, 0x6c, // ));. mediump fl - 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, // oat tmpvar_5;. - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x28, 0x6d, 0x69, 0x6e, 0x20, // tmpvar_5 = (min - 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x31, 0x2e, 0x30, // (1.0, (. (1.0 - 0x20, 0x2d, 0x20, 0x61, 0x62, 0x73, 0x28, 0x28, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // - abs(((v_texco - 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x20, 0x2d, 0x20, // ord0.x * 2.0) - - 0x31, 0x2e, 0x30, 0x29, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x70, 0x61, // 1.0))). * u_pa - 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x6d, 0x69, 0x6e, 0x20, 0x28, // rams.y)) * min ( - 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // 1.0, v_texcoord0 - 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, // .y));. if ((u_p - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x29, // arams.w == 0.0)) - 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, // {. mediump v - 0x65, 0x63, 0x34, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, // ec4 color_6;. - 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, // mediump vec3 tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // pvar_7;. tmpv - 0x61, 0x72, 0x5f, 0x37, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, // ar_7.z = 1.0;. - 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, // tmpvar_7.xy = - 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // v_position;. - 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, 0x6d, 0x70, // mediump vec2 tmp + 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x73, 0x63, 0x5f, // _2 = (clamp (sc_ + 0x33, 0x2e, 0x78, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x20, 0x2a, // 3.x, 0.0, 1.0) * + 0x20, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x73, 0x63, 0x5f, 0x33, 0x2e, 0x79, 0x2c, 0x20, // clamp (sc_3.y, + 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, // 0.0, 1.0));. hi + 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // ghp float tmpvar + 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x3d, // _5;. tmpvar_5 = + 0x20, 0x28, 0x6d, 0x69, 0x6e, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x28, 0x0a, 0x20, 0x20, // (min (1.0, (. + 0x20, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x61, 0x62, 0x73, 0x28, 0x28, 0x28, 0x76, // (1.0 - abs(((v + 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x32, // _texcoord0.x * 2 + 0x2e, 0x30, 0x29, 0x20, 0x2d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, // .0) - 1.0))). + 0x2a, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x29, 0x29, 0x20, 0x2a, // * u_params.y)) * + 0x20, 0x6d, 0x69, 0x6e, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, // min (1.0, v_tex + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x69, 0x66, // coord0.y));. if + 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, // ((u_params.w == + 0x20, 0x30, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x68, 0x69, 0x67, // 0.0)) {. hig + 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x36, 0x3b, // hp vec4 color_6; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, // . highp vec3 + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, // tmpvar_7;. tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, // pvar_7.z = 1.0;. + 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x2e, 0x78, 0x79, 0x20, // tmpvar_7.xy + 0x3d, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, // = v_position;. + 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, 0x6d, 0x70, // highp vec2 tmp 0x76, 0x61, 0x72, 0x5f, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // var_8;. tmpva 0x72, 0x5f, 0x38, 0x20, 0x3d, 0x20, 0x28, 0x61, 0x62, 0x73, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, // r_8 = (abs((u_pa 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // intMat * tmpvar_ 0x37, 0x29, 0x2e, 0x78, 0x79, 0x29, 0x20, 0x2d, 0x20, 0x28, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, // 7).xy) - (u_exte 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x78, 0x79, 0x20, 0x2d, 0x20, 0x75, 0x5f, // ntRadius.xy - u_ 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x7a, 0x7a, 0x29, // extentRadius.zz) - 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, // );. mediump v - 0x65, 0x63, 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x3b, 0x0a, 0x20, 0x20, // ec2 tmpvar_9;. - 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x20, 0x3d, 0x20, 0x6d, 0x61, 0x78, // tmpvar_9 = max - 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x29, // (tmpvar_8, 0.0) - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, // ;. mediump ve - 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x3b, 0x0a, 0x20, 0x20, // c4 tmpvar_10;. - 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x20, 0x3d, 0x20, 0x6d, 0x69, // tmpvar_10 = mi - 0x78, 0x20, 0x28, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x2c, 0x20, 0x75, // x (u_innerCol, u - 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x2c, 0x20, 0x63, 0x6c, 0x61, 0x6d, 0x70, // _outerCol, clamp - 0x20, 0x28, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x28, 0x28, 0x6d, 0x69, 0x6e, // ((. (((min - 0x20, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x78, 0x20, 0x28, // (. max ( - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x2e, 0x78, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, // tmpvar_8.x, tmpv - 0x61, 0x72, 0x5f, 0x38, 0x2e, 0x79, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2c, 0x20, // ar_8.y). , - 0x30, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x73, 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, 0x20, // 0.0) + sqrt(. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // dot (tmpvar - 0x5f, 0x39, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x29, 0x0a, 0x20, 0x20, // _9, tmpvar_9). - 0x20, 0x20, 0x20, 0x20, 0x29, 0x29, 0x20, 0x2d, 0x20, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, // )) - u_exten - 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x7a, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x75, 0x5f, // tRadius.z) + (u_ - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, // params.x * 0.5)) - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, // . / u_params - 0x2e, 0x78, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, // .x), 0.0, 1.0)); - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x36, 0x2e, 0x78, 0x79, 0x7a, // . color_6.xyz - 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x2e, 0x78, 0x79, 0x7a, // = tmpvar_10.xyz - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x36, 0x2e, 0x77, 0x20, // ;. color_6.w - 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x2e, 0x77, 0x20, 0x2a, // = (tmpvar_10.w * - 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, // (tmpvar_5 * tmp - 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, // var_2));. res - 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x36, 0x3b, // ult_1 = color_6; - 0x0a, 0x20, 0x20, 0x7d, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, // . } else {. - 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, // if ((u_params.w - 0x3d, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // == 1.0)) {. - 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // lowp vec4 color - 0x5f, 0x31, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, // _11;. mediu - 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // mp vec3 tmpvar_1 - 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // 2;. tmpvar_ - 0x31, 0x32, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 12.z = 1.0;. - 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x2e, 0x78, 0x79, 0x20, 0x3d, // tmpvar_12.xy = - 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x20, // v_position;. - 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, // lowp vec4 tmp - 0x76, 0x61, 0x72, 0x5f, 0x31, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, // var_13;. tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x33, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, // pvar_13 = textur - 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x28, 0x28, 0x75, 0x5f, // e2D (s_tex, ((u_ - 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // paintMat * tmpva - 0x72, 0x5f, 0x31, 0x32, 0x29, 0x2e, 0x78, 0x79, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x65, 0x78, 0x74, // r_12).xy / u_ext - 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x78, 0x79, 0x29, 0x29, 0x3b, 0x0a, // entRadius.xy));. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x31, 0x20, 0x3d, // color_11 = - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // tmpvar_13;. - 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, // lowp vec4 tmpv - 0x61, 0x72, 0x5f, 0x31, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, // ar_14;. if - 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, // ((u_params.z == - 0x30, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 0.0)) {. - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, // tmpvar_14 = tmpv - 0x61, 0x72, 0x5f, 0x31, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x65, // ar_13;. } e - 0x6c, 0x73, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, // lse {. lo - 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // wp vec4 tmpvar_1 - 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // 5;. tmpva - 0x72, 0x5f, 0x31, 0x35, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, // r_15.xyz = vec3( - 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, // 1.0, 1.0, 1.0);. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // tmpvar_1 - 0x35, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x33, 0x2e, // 5.w = tmpvar_13. - 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // x;. tmpva - 0x72, 0x5f, 0x31, 0x34, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x35, // r_14 = tmpvar_15 - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // ;. };. - 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, // color_11.xyz = - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, // tmpvar_14.xyz;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x31, 0x2e, 0x77, 0x20, // color_11.w - 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, 0x2e, 0x77, 0x20, 0x2a, // = (tmpvar_14.w * - 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, // (tmpvar_5 * tmp - 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, // var_2));. r - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, // esult_1 = color_ - 0x31, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x7b, // 11;. } else { + 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // );. highp vec + 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 2 tmpvar_9;. + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x20, 0x3d, 0x20, 0x6d, 0x61, 0x78, 0x20, 0x28, // tmpvar_9 = max ( + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x3b, 0x0a, // tmpvar_8, 0.0);. + 0x20, 0x20, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, // highp vec4 t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, // mpvar_10;. tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x20, 0x3d, 0x20, 0x6d, 0x69, 0x78, 0x20, 0x28, 0x75, // pvar_10 = mix (u + 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x2c, 0x20, 0x75, 0x5f, 0x6f, 0x75, 0x74, // _innerCol, u_out + 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x2c, 0x20, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x28, 0x0a, // erCol, clamp ((. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x28, 0x28, 0x6d, 0x69, 0x6e, 0x20, 0x28, 0x0a, 0x20, // (((min (. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x78, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, // max (tmpv + 0x61, 0x72, 0x5f, 0x38, 0x2e, 0x78, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, // ar_8.x, tmpvar_8 + 0x2e, 0x79, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x29, // .y). , 0.0) + 0x20, 0x2b, 0x20, 0x73, 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // + sqrt(. + 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2c, 0x20, // dot (tmpvar_9, + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // tmpvar_9). + 0x29, 0x29, 0x20, 0x2d, 0x20, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, // )) - u_extentRad + 0x69, 0x75, 0x73, 0x2e, 0x7a, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // ius.z) + (u_para + 0x6d, 0x73, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, // ms.x * 0.5)). + 0x20, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x78, 0x29, 0x2c, // / u_params.x), + 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, // 0.0, 1.0));. + 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x36, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x74, // color_6.xyz = t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, // mpvar_10.xyz;. + 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x36, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x74, // color_6.w = (t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, // mpvar_10.w * (tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // pvar_5 * tmpvar_ + 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, // 2));. result_ + 0x31, 0x20, 0x3d, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x7d, // 1 = color_6;. } + 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, // else {. if ( + 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x31, // (u_params.w == 1 + 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, // .0)) {. low + 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x31, 0x3b, // p vec4 color_11; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // . highp vec + 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, // 3 tmpvar_12;. + 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x2e, 0x7a, 0x20, 0x3d, // tmpvar_12.z = + 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // 1.0;. tmpv + 0x61, 0x72, 0x5f, 0x31, 0x32, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, // ar_12.xy = v_pos + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, // ition;. low + 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x33, // p vec4 tmpvar_13 + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // ;. tmpvar_1 + 0x33, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, // 3 = texture2D (s + 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, // _tex, ((u_paintM + 0x61, 0x74, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x29, 0x2e, // at * tmpvar_12). + 0x78, 0x79, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, // xy / u_extentRad + 0x69, 0x75, 0x73, 0x2e, 0x78, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ius.xy));. + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x31, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // color_11 = tmpva + 0x72, 0x5f, 0x31, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, // r_13;. lowp + 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, 0x3b, // vec4 tmpvar_14; 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, // . if ((u_pa - 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x29, 0x20, // rams.w == 2.0)) - 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, // {. result - 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, // _1 = vec4(1.0, 1 - 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, // .0, 1.0, 1.0);. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, // } else {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, // if ((u_par - 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x33, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, // ams.w == 3.0)) { - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, // . lowp - 0x76, 0x65, 0x63, 0x34, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x36, 0x3b, 0x0a, 0x20, // vec4 color_16;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, // lowp ve - 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x37, 0x3b, 0x0a, 0x20, 0x20, // c4 tmpvar_17;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // tmpvar_1 - 0x37, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, // 7 = texture2D (s - 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // _tex, v_texcoord - 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, // 0);. co - 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x36, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // lor_16 = tmpvar_ - 0x31, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, // 17;. lo - 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // wp vec4 tmpvar_1 - 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, // 8;. if - 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, // ((u_params.z == - 0x30, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 0.0)) {. - 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x38, 0x20, 0x3d, 0x20, // tmpvar_18 = - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // tmpvar_17;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, // } else {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, // lowp v - 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x39, 0x3b, 0x0a, 0x20, // ec4 tmpvar_19;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // tmpva - 0x72, 0x5f, 0x31, 0x39, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, // r_19.xyz = vec3( - 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, // 1.0, 1.0, 1.0);. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // tmpv - 0x61, 0x72, 0x5f, 0x31, 0x39, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // ar_19.w = tmpvar - 0x5f, 0x31, 0x37, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _17.x;. - 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x38, 0x20, 0x3d, 0x20, 0x74, // tmpvar_18 = t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // mpvar_19;. - 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // };. - 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x36, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, // color_16.xyz = - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x38, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, // tmpvar_18.xyz;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, // color_1 - 0x36, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x38, // 6.w = (tmpvar_18 - 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x3b, 0x0a, // .w * tmpvar_2);. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, // result - 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x36, 0x20, 0x2a, // _1 = (color_16 * - 0x20, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x29, 0x3b, 0x0a, 0x20, 0x20, // u_innerCol);. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, // };. } - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, // ;. };. };. - 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x72, // gl_FragColor = r - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // esult_1;.}... + 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x29, 0x20, // rams.z == 0.0)) + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // {. tmpvar + 0x5f, 0x31, 0x34, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x33, 0x3b, // _14 = tmpvar_13; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x7b, 0x0a, // . } else {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, // lowp vec + 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, // 4 tmpvar_15;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x35, 0x2e, 0x78, // tmpvar_15.x + 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, // yz = vec3(1.0, 1 + 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // .0, 1.0);. + 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x35, 0x2e, 0x77, 0x20, 0x3d, 0x20, // tmpvar_15.w = + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x33, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, // tmpvar_13.x;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, 0x20, 0x3d, // tmpvar_14 = + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // tmpvar_15;. + 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // };. color + 0x5f, 0x31, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // _11.xyz = tmpvar + 0x5f, 0x31, 0x34, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, // _14.xyz;. c + 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, // olor_11.w = (tmp + 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, // var_14.w * (tmpv + 0x61, 0x72, 0x5f, 0x35, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, // ar_5 * tmpvar_2) + 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, // );. result_ + 0x31, 0x20, 0x3d, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x31, 0x3b, 0x0a, 0x20, 0x20, // 1 = color_11;. + 0x20, 0x20, 0x7d, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // } else {. + 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, // if ((u_params.w + 0x20, 0x3d, 0x3d, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, // == 2.0)) {. + 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x76, // result_1 = v + 0x65, 0x63, 0x34, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, // ec4(1.0, 1.0, 1. + 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, // 0, 1.0);. } + 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // else {. + 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, // if ((u_params.w + 0x3d, 0x3d, 0x20, 0x33, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // == 3.0)) {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x63, // lowp vec4 c + 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // olor_16;. + 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, // lowp vec4 tmp + 0x76, 0x61, 0x72, 0x5f, 0x31, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // var_17;. + 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x37, 0x20, 0x3d, 0x20, 0x74, 0x65, // tmpvar_17 = te + 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, // xture2D (s_tex, + 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, // v_texcoord0);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x36, // color_16 + 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x37, 0x3b, 0x0a, 0x20, 0x20, // = tmpvar_17;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, // lowp vec + 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, // 4 tmpvar_18;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, // if ((u_pa + 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x29, 0x20, // rams.z == 0.0)) + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, // {. tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x38, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // pvar_18 = tmpvar + 0x5f, 0x31, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, // _17;. } + 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // else {. + 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, // lowp vec4 tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // pvar_19;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x39, 0x2e, 0x78, // tmpvar_19.x + 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, // yz = vec3(1.0, 1 + 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // .0, 1.0);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x39, 0x2e, // tmpvar_19. + 0x77, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x37, 0x2e, 0x78, 0x3b, // w = tmpvar_17.x; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, // . tmp + 0x76, 0x61, 0x72, 0x5f, 0x31, 0x38, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // var_18 = tmpvar_ + 0x31, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, // 19;. }; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // . color + 0x5f, 0x31, 0x36, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // _16.xyz = tmpvar + 0x5f, 0x31, 0x38, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _18.xyz;. + 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x36, 0x2e, 0x77, 0x20, 0x3d, 0x20, // color_16.w = + 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x38, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x74, // (tmpvar_18.w * t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // mpvar_2);. + 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x28, // result_1 = ( + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x36, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6e, 0x6e, // color_16 * u_inn + 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // erCol);. + 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // };. };. + 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, // };. };. gl_Fra + 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, // gColor = result_ + 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // 1;.}... }; static const uint8_t fs_nanovg_fill_dx9[1531] = { diff --git a/examples/common/nanovg/vs_nanovg_fill.bin.h b/examples/common/nanovg/vs_nanovg_fill.bin.h index d0f71d7f3..fc604a7e0 100644 --- a/examples/common/nanovg/vs_nanovg_fill.bin.h +++ b/examples/common/nanovg/vs_nanovg_fill.bin.h @@ -1,40 +1,39 @@ -static const uint8_t vs_nanovg_fill_glsl[555] = +static const uint8_t vs_nanovg_fill_glsl[541] = { 0x56, 0x53, 0x48, 0x03, 0xcf, 0xda, 0x1b, 0x94, 0x02, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, // VSH........u_vie 0x77, 0x53, 0x69, 0x7a, 0x65, 0x05, 0x01, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x75, 0x5f, 0x68, 0x61, // wSize.......u_ha - 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x07, 0x01, 0x00, 0x00, 0x01, 0x00, 0xf9, 0x01, 0x00, // lfTexel......... - 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, // .attribute mediu - 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, // mp vec2 a_positi - 0x6f, 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6d, 0x65, // on;.attribute me - 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, // diump vec2 a_tex - 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, // coord0;.varying - 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x70, // mediump vec2 v_p - 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, // osition;.varying - 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, // mediump vec2 v_ - 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, // texcoord0;.unifo - 0x72, 0x6d, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, // rm mediump vec2 - 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, // u_viewSize;.unif - 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // orm mediump vec4 - 0x20, 0x75, 0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x3b, 0x0a, 0x76, 0x6f, // u_halfTexel;.vo - 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x76, // id main ().{. v - 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, // _position = a_po - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // sition;. v_texc - 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x28, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // oord0 = (a_texco - 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2b, 0x20, 0x75, 0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, // ord0 + u_halfTex - 0x65, 0x6c, 0x2e, 0x78, 0x79, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, // el.xy);. medium - 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, 0x7a, 0x77, 0x20, 0x3d, // . tmpvar_1.zw = - 0x20, 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, // vec2(0.0, 1.0); - 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x20, 0x3d, 0x20, // . tmpvar_1.x = - 0x28, 0x28, 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, // (((2.0 * a_posit - 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x29, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, // ion.x) / u_viewS - 0x69, 0x7a, 0x65, 0x2e, 0x78, 0x29, 0x20, 0x2d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, // ize.x) - 1.0);. - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x28, 0x31, // tmpvar_1.y = (1 - 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x28, 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x61, 0x5f, 0x70, // .0 - ((2.0 * a_p - 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x79, 0x29, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x76, // osition.y) / u_v - 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, // iewSize.y));. g - 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, // l_Position = tmp - 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // var_1;.}... + 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x07, 0x01, 0x00, 0x00, 0x01, 0x00, 0xeb, 0x01, 0x00, // lfTexel......... + 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // .attribute highp + 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, // vec2 a_position + 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, // ;.attribute high + 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // p vec2 a_texcoor + 0x64, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, // d0;.varying high + 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // p vec2 v_positio + 0x6e, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // n;.varying highp + 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // vec2 v_texcoord + 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // 0;.uniform highp + 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, // vec2 u_viewSize + 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, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, // vec4 u_halfTexel + 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, // ;.void main ().{ + 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, // . v_position = + 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, // a_position;. v_ + 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x28, 0x61, 0x5f, 0x74, // texcoord0 = (a_t + 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2b, 0x20, 0x75, 0x5f, 0x68, 0x61, 0x6c, // excoord0 + u_hal + 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x2e, 0x78, 0x79, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, // fTexel.xy);. hi + 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ghp vec4 tmpvar_ + 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, // 1;. tmpvar_1.zw + 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, // = vec2(0.0, 1.0 + 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x20, // );. tmpvar_1.x + 0x3d, 0x20, 0x28, 0x28, 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, // = (((2.0 * a_pos + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x29, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, // ition.x) / u_vie + 0x77, 0x53, 0x69, 0x7a, 0x65, 0x2e, 0x78, 0x29, 0x20, 0x2d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, // wSize.x) - 1.0); + 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x79, 0x20, 0x3d, 0x20, // . tmpvar_1.y = + 0x28, 0x31, 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x28, 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x61, // (1.0 - ((2.0 * a + 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x79, 0x29, 0x20, 0x2f, 0x20, 0x75, // _position.y) / u + 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, // _viewSize.y));. + 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x74, // gl_Position = t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // mpvar_1;.}... }; static const uint8_t vs_nanovg_fill_dx9[448] = { diff --git a/examples/runtime/shaders/gles/fs_bump.bin b/examples/runtime/shaders/gles/fs_bump.bin index 3172f9cd73694ebc402275472c5059713f24c295..bd1b0b39a342bd9f377ccc89cdddf4099613017b 100644 GIT binary patch literal 4780 zcmbVQ+iv4F6m-!51>BdSU%*ExOEJ z^gH?`okNk*QAF8Jksxc6hlhv5nIX9!e*fvq@jrk6d)4XgCV6^%pDnUY=Zg-0zcvlO zW}9WQC|bVRO&0Un=lr*9d!J0_yX{w3oz7LqHQ&!3e_pN9&3)1Q%eS4*KG{6aS2OV$ z!`5P-K54O^JkIlEHA`3dUDw;cGE=s6whvWEjTJm)*=8EGjNZ@FLrd3Too(;ByVd*? zrWe~}xn86j^`od@Y3(gAs=Bex7~|?#eT*Oc5hZLUVxP^YVwucWA_%*Gc7<4E2aBA^ zXEtae?`k~-ViQHJ1=PzV*CJo80q{gqv-|updJykKF<}0Z2EeS?jIb6ZUq_XjR*zG! z83)PE4aVsSLp{mM6FUYg~W0MB~x)3nU zauJlh$LE_W^!OZxW-z0k#UN%Yjgj%zrYPVbinNXFvypvTQ)82(2dv-)rR^s~C|1Fz zMV90uozBu|GN3&6BhuI`6%mjHG*az~n=j#ynIg2oXJ+ga=o!Rv}D05;UF zt!~V+jFF|b!R1Ou2398wK&25PRR43hxlkxyMjhoy+sh*L&aqCY z9c>DB^}3mW7TLyPX?(&}peS{N$MPZ`OJgksNu)-i29uGejmeVhP?8YOaapPoeTl8` zv6<$pv03T{ozZlj&ys6h8nIi%w2#qL4{ceK($a|Cp*_Gd{iK%tDgp7OBotS?9CB9I zQxBW8M%{j1%fZ`;%@r<3=ZHNr)ij8Wi8-@JK4#0oX=-Dk7HqnV*aMMR95^1=oRs|d zS{Qq@1aq4qdpI#lUqb{*$vU5jcUl`#yB%ddYjgYrHLn=rz#&vY%Mc#k(s%v=Cbp7RYLojTxvL5mCUYqDR7meyWVppq|B zBFI`PvH0RsqLSy7sQ3w?=!9r0QD3G+b5>X-((SOJMC55zA~$$Ncery(RD)89YT#EQ z%~x0Au&G2iCxe`r(X=bY?MfNDI;BLa$FD@qZ;6`hszr(8Dgjrb=7yzl!9xaDNi8)_ z7nj_f9jM!{L>;|ZiJDuJR%eum0Iw1;F;gOt-VU5k{K;d9M2#t zQ=<9eRpO|wME8KG9?IOLHJS7}JBT28+&12>=GM`8y1szN;EKk@09RG_hcS^lOSW)J z*L43iwlK;`M*uwp#mS`?^@q z#VSSkY9sdPb0qfDr$wHu=jl4XYd1u!^{|c2=ejElfSEjJ*>=`%%&=dihsMUkCfnV$ zU)GDykRf)-YO_qY>PJyo)Yw}1RW)PAG5Wc_eTpCb5v7GXVxKK$VwEh`A_&`mwuM+` z2jgMk&s5&wtu=R*ZCJdG-s$&FK|aYbew zWOen9uNX22un_snHidTq!>P-cD5ThqP`!RAZiU1zQdK5;L!R9q+dK%+gn(I=i=b>h zzILn7<7*h|&ejo)n{gpxbB&Pm)+8wmAsm|f#;k8l^QtXq{}HozgS`Ee;Bi!ZUS>%y z(%C%iPY0CAJR*_FQ!P940LyAki@s(GLndR0-p@;r36leK5F*enX?sk3+_ebAVJN<{ zqm|niT=Whhb-uNlD9jjbREA+!^n3koxiUU;M@-p>46^89VT-jQo2{(EXbrP7zcI@) zMiytO%ejoSxppfkJH-j>Jn0?L-3-UGPI`o;&TG|-FnMDj5QJXaO&eq7PbK+anj%L* zY+p-Mn{w01e(!j|SU^ybp_P9o2?9vVDmjWk`&*9dW+DCqZ4-7=vAM_M`+HgwENZ8o z0CQ|6S?Y>mB}mF$V_9CwveZSUz(gvfs?m&0%`{8CBPDIgOFTuF7Z9`^NoQy;G>=ga5*?jI6OFqIN$J+>PQ`NbuHq$su;v4KE#o!8F9rc zg6dy`__#uR>_?nNbP=D_5uaRzxZ>47>1uEmaVYX5uAK7*)dD}_N>≪)>S-6>-Gf z)KMLA==LM7)VmQ^e9x=+0^$hpmT(Nr5J!{;aiz{84iC;Cu6RXJR8i`PM^_@Qbag2Z zS9GeVRdHlGgE%h=ioX4qs<;}Ih^v7gaT?J>)c*OU7BrhP206*drjyR%xh)>QU zP7`Hj!>jW467g~pQ8@|pIf-KEumpmtpP;~;-*6JH!D|lY9ih+2!qREK#?Ziyw>pLn zRptn6`q*>VkXlSn{T%5VN#L9tfn}%{MS$%OIGxudne$bXBz!lomxOaurK$LbPn3+9 zss>r+o7g$Ah>9H3!`!h};KNqV#d#O_q$nI)tv|)Xhhl9!PMI2ZDv6-HAZf&GK~<{s zc_ocpMOe6w*klJ0Bu~5A6;}TjN$m#v1`IWxs;9cR%oaZ|RjMZQ<@Dn=nd_eVo>*@E zf^?^yZVk9FP(OCnDsLGP|5Qf!RN~rsU#WFcq0P$b_u>KlA>U4)3XukEq$CAS9$o(V O8w8Z$ckRF0?biS5SbdoQ diff --git a/examples/runtime/shaders/gles/fs_callback.bin b/examples/runtime/shaders/gles/fs_callback.bin index 245069ead0e635e6c6693da8dd4b2856c0bbe429..1f0a41a0aff0cbf034cbd26fe90043e344e766ed 100644 GIT binary patch delta 67 zcmey${F+(HE!cy(W$~Rq3=DS|85qhEiz+ko(iJi?(=#T@NV0%wYefj1qz|E|L+FiX GG#LRis2Ah_ delta 98 zcmaFO{FT|-E!cy(W$~Rq3=Gd085qhEiz+ko(iL)3Q!-0)3lz#ylT8%L;*;}p@{0_t ZxlpAink%wF6i$rMhq3x$tc`~>836@iBtHNE diff --git a/examples/runtime/shaders/gles/fs_cubes.bin b/examples/runtime/shaders/gles/fs_cubes.bin index 2626de727c403a3da2f9c3da7aad1133f63e2cb4..e3c452fb1ef586e57c127b138dddc47d22880a47 100644 GIT binary patch delta 32 ncma!!lyVF9U|!Pw-jjjBi-CcmEU~CEGcR2sBQrf?qKrKNpt}kX delta 34 pcma!ymT?RAU|!Pw-jjjBhk=2iEU~CEGcR2sH#H@*GdWm&{y3jHv28Oc4qRPy?bcNj1l+4oHjpj3%0G4YCLI3~& diff --git a/examples/runtime/shaders/gles/fs_deferred_debug.bin b/examples/runtime/shaders/gles/fs_deferred_debug.bin index 3e22830eb65ff67b3e1b997e0987131ca937954f..2853d847a0d5e9451bf4afaa7b69ae8b6068da35 100644 GIT binary patch delta 26 hcmcc0c$sm6w7_Nt28Oc4qRPy?bcKw}^o)tRD*$(v2|oY; delta 28 jcmcc2c$IO2w9r-t28Oc4qRPy?bcNj1l+4oHiP|dwi;)T< diff --git a/examples/runtime/shaders/gles/fs_deferred_debug_line.bin b/examples/runtime/shaders/gles/fs_deferred_debug_line.bin index 2626de727c403a3da2f9c3da7aad1133f63e2cb4..e3c452fb1ef586e57c127b138dddc47d22880a47 100644 GIT binary patch delta 32 ncma!!lyVF9U|!Pw-jjjBi-CcmEU~CEGcR2sBQrf?qKrKNpt}kX delta 34 pcma!ymT?RAU|!Pw-jjjBhk=2iEU~CEGcR2sH#H@*GE E08jrJF#rGn delta 80 zcmaFM{*!%ztJ428Oc4qRPy?bcKw}^o)rOGAv+v(Ihav*^1GV3Bu}R-p3388j}-R delta 62 zcmdnbcbsoRp3oIG28Oc4qRPy?bcNj1l+4oHiFGn;P}aOjP}XJ>Mo%UfyODVxGXT?B B7TN#+ diff --git a/examples/runtime/shaders/gles/fs_hdr_blur.bin b/examples/runtime/shaders/gles/fs_hdr_blur.bin index 7778548f3dad881ced8bc260612abee7262d1cd1..c3c7a756438eba54f89d3406cf14ce0ae30baf20 100644 GIT binary patch literal 950 zcmb`GF;2rU6oy@O^C{k#0E+BqS1qcTKovU&h(a4uOHN#wCT&4ngUd0pasw7jNs}Ok zpt_O=OTYc;`{n1^-Ro`WbC0O8ZCd8Y`yAnIQ|i3>(ymtI-c1i+y6*6o`;Ej Hp_F_98GR`! delta 244 zcmdnSevNH{w2&Dy14CJ2QDtUcxQxI2KC82OaegK9ISZ(lQ0)Z3ZfOLQF-zkCLtD}5J;`+WD90t SFx|qe#s_nhHCHVc7XtviVm;je diff --git a/examples/runtime/shaders/gles/fs_hdr_bright.bin b/examples/runtime/shaders/gles/fs_hdr_bright.bin index e329f4ec3630c4cd625f1a11e9e8bc418a129cb9..18080eaa428e6463bd7e8516db663268e4a978f6 100644 GIT binary patch literal 2376 zcmb7`O>f#j5QZJKQc|Dt3#vJ;6XNWyKM|#uR#6YV^;kv7A%-Af)-qovRsVQTo%Pyg zX>sHQWbJxpXPz0uygdB)_D+2K{OP@QwVjCBY@Kc{uPy7^`mmjB#462_{PM!GE-V}O zY57GgMS(l~pg-RDzRlG3&y{8ElH#yf&EaJ+f5~B&PC4wP(^QD!nU3u3YB3W3*{C@n~v~N{1TYXk8~+zDx`LRT^uWPAj5~?44LVLzXO7Kpgv*4X_mZ3eAIJ{xo4D z?UoOlEXNuqT;6TgFa}Ju*%m3LB~8%-y)x%)6ikF|Q1KE&(|V)iz1JHXZA2B^!b*XejCSyG}Nq*ISjmk!WNU7P`^!Ksel9i`EIl~dlq zk>9GNTRLzLWV%GHgi~?gZrQ3vGlTg#az{p$`I)>#4(bxJP|8ka#A`&7>59oXJ^(_R zQVDY@p4SVw*Juw_0Tr@xtj?Y4Uh`zDEdOa3(}k8PZ5%@`_CS)SbyFwf*u}cFejwkn mw0~DBZdh(5Qd3bDJiG?f@+RS;u4l`D|Iieq8@tdv5G8eW6P2;2pii;)!)#++*#ON zhK5jKTh@NeKKstFFZ=NQ>zn-jr;l%qt7@LFR{QjDd2JZi#=B~M$aiU$6qgrR(X{<$)YV^ThCc5BGe<)+FCIHn61jv{Q4=jGD5H>=%dm6w^A z@j-3)gNKjp6j>}nq=`VjV4I(6aXuWf z0!7dHJ&vk2%mBHEs!VYYrm~#SL@W{ig5na2+e4{~HvvW}0=I1yoJafoWc8yxg7(Iv z`2gA{Xn#D~9Y6;J9gIhN1L%;T!|`Z;038u@G#(ucpksoL$D_jm^pv2du0yaz>Y=3y(RrGXeEyO#pQO1~67PI?cKxJ?x^Bp5X@4bK$Dc zW~B}|;j|kBwqwBu;BJf!$po-0^d*y_-v3yhJdhxhvGKA)RZLcA1DhkH z2?RhfO$BWQgx!{6$aca_Gea@$Bb(b~78YYU3#c=pCWCdtwO9bPh%$0b&S$aWvqVui v`5C+FPCigN+@oQ*k00k8kfHa6Pc_EuQw;@n*m4cQ6i2smH zgwb%aBZ~-!CRiO%$dT2I+Xz+3WCs>e7LbC;Hmuf@C$fl4Ud*B@qM)D&1Q2c7Ak%KVZ7QqWZ}G_nBlVdhL0WY=Ybnv};XHo2Qs zjvZ5!A;Bi!CrLMzt1XsR-Co km{Tnw#!U`kSDpNk-GvhtRR)t88O0|Da+o2B^l+pA0Mkf(IsgCw diff --git a/examples/runtime/shaders/gles/fs_hdr_lumavg.bin b/examples/runtime/shaders/gles/fs_hdr_lumavg.bin index 234272e2a9fe855826500bc50b7cab91d0bf1c85..cecee380bcee27eb343122f6935390703f454989 100644 GIT binary patch literal 3230 zcmbW4-;a|(5P(r1G{lGd3(P!%o*c6U3aR>X=Hk1L=F&7h%8@{~q0k>*{NEkQ0jqZ7 zPLrk~J3F)AChdH~-S=;=NbY5n@jvaT$*OH`ASx08wsGV_XDH*F|=KjnT!s^B<1sds?)kRCR|A$(8+dkTm!^n4dS0*aU(Xp8F- zb)P-aWlua^_W2tI$_)el4aJ!oc2^x)108F?WDOP8kk2|XU=4MwA(J&ySR+1bV89yb zSR*FuRAHU+SwjQXsg8BZWQ`Tpn9mv+u*N#pn8}(btO=iWYQUQ4SQ92IQr{lBDEfTb z*nk#&9WF(9eG5-6cbst_LzjOBc z2UsgIy)@Br8{)APZ;RQlN6QiM4X%t}st5U-YtcE69L#@{+!UR^$ zh8L&}P27fBxl!c*z}ONrf# Y+j=J}=6BU1JH2Pn{vms2|FUiCHyseLp#T5? literal 3137 zcmbW4-*3|}5XS>NfFd3y{s831gpH6(^HT#}KojpgqN%Fdw2G88Rn~Sb6aPEsIJVEF zcuJ*dYwYvqzP{eq@$P>9c-6lD`uU~vW;bn@%ZGCN`pR*x9CtU}mWOX`-FD6k2Y=qZ zb)5aIJ67uzYsy8nYc_0O&Lg(xf%CTQ7U8YCTUX1rYxqpeB=Hxd_j>AK)@@PV)$L=SAZFWUgNdhbi=*;0`@(STcGs22@igd$c|;Gp)*8b5 z;BfSP4*3Ti5p*;j4Hoo-peN(ekp&$SbUYqCv7i%zPR65S3pyp}bUZq-pfiHb#-mdU zIw$CSJUX+W3xY1jqjL)y(2?3R;dppqgByl~@o=zN5~wHP5>wh-3DlNwfiJ;kOrXw$ z3#UAN{svUYKjeem#CNs)F>5h>^9L-Q~)V$at@^e&BCP`CBHuUC8PwU2wI-6ibhH% zca#yd9m=pitlpMPqx*Cy zk}8o}1_Vk5HB0YJFbqke=ZAD=eSo&RhV-#Ud4P2FKvLDgxid-zhM`2Xw&7*99op9- z!%1O=vZw{5xwVwDE!}sYAw+a@pXQ_>w2_U1U^zZ9Nbx}7@7n%qX`XoW>Hz%iFfXgx ztJ_tiBxnD*mjb;TKoJ~&<8prK_QD{%Vfd?0Di1u~t9YQw#|(w_yO0C9NFyJ4_ww^s iKIeEIilY%1igS~1X;n|}y4kA#R{-N>G)nv9y3Su%Xm~>a diff --git a/examples/runtime/shaders/gles/fs_hdr_mesh.bin b/examples/runtime/shaders/gles/fs_hdr_mesh.bin index 28dde2811ce45fb86f469d2f0effbcff508c4442..ce1cbecac17d439e187348988ccc289d43594100 100644 GIT binary patch delta 197 zcmcc2yN`E*deS5|28Oc4qRPy?bcKw}^o#<9veaZ_g|hg({G!~%9BVGDk_Gw2IAqE) zQ_HQnO7k+)fcn8EPMj#gl9OLvFmZ(@3&@6v*G<9nWFbal2*aDv9m1Hw*bQN5GMPab YsZ9M4#xJIC5XLv=vtY*NlPp|J06Jes1ONa4 delta 219 zcmdnTdzp8Fy6#OMxV_A++E em@-UeFlHE2KaBa3=^KpsnE5P}xp@l<7ZU(c7*MtV diff --git a/examples/runtime/shaders/gles/fs_hdr_skybox.bin b/examples/runtime/shaders/gles/fs_hdr_skybox.bin index 06bc41132fc3c45d381bafd486beaad5620b77ed..d60ebffb91e58579d92649197223fb5ae409700c 100644 GIT binary patch delta 87 zcmeBY?O~muCXmR)z)+T0RGFEVu8@(Lo-xrvMk6P`yg;EiF}ENmwaB?NDOI5~z9h8* e#Ioip&C5*7FUp0et(0d0>zNkYUy@ppoS$EmVqncxnwOcD aUz9sBOo0ueXkwK-j5Rj|%G&sKIwJu5E+1$B diff --git a/examples/runtime/shaders/gles/fs_hdr_tonemap.bin b/examples/runtime/shaders/gles/fs_hdr_tonemap.bin index 812c69900a0b07f731a00f8dfe3942fa91865011..4057ab20740e929c1f33bab1b33750d7afa299f6 100644 GIT binary patch delta 543 zcmew&bX;VDm%tBB28Oc4qRPy?bcKw}^o)ryGAv-a4oWYOaRKoQ6v|SQO%%%FOHwP6 z^Ye>RjIFtl^u@WDP0F zEdZJmZ)j-ErJw-k=v7o!DcC9$KDQIYD zfVn^c1QW=a#I88`CL7=6hwLgUhCrhLK{`|>zvd7I(-xejx`rn$+FDUa%-;A zyv#J9Dug~0h0^$f#G=I9Vsy#e#1fEXZb=2I%*6i^EFfzq%Q8wq7`8x0PJVg8|D1n9nO_b&14CJ2QDtUcx)pb`ZI4KqC>AO|Ks*_T~H(h?{Dkwlkm nVAoNHDm63!*^!*wGM}S diff --git a/examples/runtime/shaders/gles/fs_ibl_skybox.bin b/examples/runtime/shaders/gles/fs_ibl_skybox.bin index 95067f466fa1d5c04c0c0c891b0a0c718474a0be..210b17f129ea98e59077cf28c272828024344a96 100644 GIT binary patch delta 97 zcmZ3=vWR7Zrq&lm28Oc4qRPy?bcKw}^o#<9veaZ_g|hgR%pz;9(!9*H{Gwcioc!{F qi2({MAQcnKboi6=bMlMg4XwEp6hO?0oBLTn^kjF&%@D?aMl}F-f+C0j delta 128 zcmZ3)vXo_lrtfz~28Oc4qRPy?bcNj1l+4oH0)?{FWMhT0_>{~dYp&9~%(VQXT!rGq z+=86cBInYiRE5&`lGF+i3n2~BI0EKP|XaE2J diff --git a/examples/runtime/shaders/gles/fs_oit_wb_separate.bin b/examples/runtime/shaders/gles/fs_oit_wb_separate.bin index d0bfb9f8052a7cb19ff4fc3db5a3f05e85784240..22899332c34a819b0849012f08ffec32289b9e7d 100644 GIT binary patch delta 60 zcmX@cbbx7sgqAWR14CJ2QDtUcxX^ delta 95 zcmX@Wbc|_&M5rbs14CJ2QDtUcx0EKP|XaE2J diff --git a/examples/runtime/shaders/gles/fs_raymarching.bin b/examples/runtime/shaders/gles/fs_raymarching.bin index 4a6dfb7589f131068db4d773c68070091d183d1a..f8bc5713a8dd7951263c2dbd42cbea58e4c6ca75 100644 GIT binary patch delta 2185 zcmZuzU1(fI6z--?HrbzKv&lADk|vX6m%VrQ?)J{zzl2SdVyqO!Mo<(HE}Ko#u4Hr9 z-P?3y(1=eJQ5(h|1X~45pG1*>2-b%xSReI4qzHoOgW8AE2PydE%$zg3+gbw2nQy-H zopa`#nVUZ-d}lYS>rSI4-S^&&WxHhDTHU54AL*9n7}vBd0V{j&m+1*B)7mD-cw~32 zRdJlgDi1ChHf7W^;I3ka_tRST9)1NM4tek z`}^0)`i4_>Rc-|p72HY7E((PI;mK-PK%QOf87mby(tM%eYO9V*G|n&tO}{4rB|MMi ziNly@w|gSHd6HI}+5dUjjq2x35?1E|22wsoprN2XXPf+k|mX+f0nWZLQ=f~RB2O!IAx?$BH14co%ekuAF3Ux?0&K~c`#!@|Y~9)Z@a4Ll9T zHvg7NwcvVWR+EijLBDOz(IEMZsq4BSt}lT6o+cF^PQLpJ!ncwAel(VY me1&H&FMhC>?K0GxZo;E3{{vv(n%@O1_-2dGUV*(sPyGkCSC_p2 delta 2528 zcmZuzU1%It6z&GyX8-fEiD=Tz-EC}Uy3_5<>|d5_s$hRaL8~Bw2;+9MNd|T^+ucdB zStzCzSIYcp!j4_Sp1=Vs~{)}MGD$C3-zgpFU7u9@7%fP%&aYeoE%|aRIq^ll#nBMOkq~XN-n42qXq3Ga`M&2#&scUa_QxkVD3N2}lIIDF zSY<})p6}Swnq?D-IVp~(?5j!03Vy|xbA|bCv9{HkX1^gp_9Kx%X8?1NCq}2XXK1YH z1WYC))bkHiW2~91nY^3A^w>NX*jTYEwxMwm+c6kb&GASBHeN(Bw`^jXhNe3UE5fXj zQbE|+tW4fyc|p@f=|50Xl7`?_LPX-F~*3=;YE_2{`GzGw24z#C{QGL{LnM@$#Ee`xU zeMo@~g#P+ihTab*>3gY#h*p913VohPaa|SPx+=?InoiBp*A7O)8lW1r z4rb^J#QBFLKPIs7)5kWcLvNp z3nO=dG@9Lp7$84I%pi~H3cGg{^FP4`w1~Q*-~I8@T*bSF^#6?${c-#ZG(H)66-+Di z44B`9PJ(&gLr;YfeLsxc8y-3zLEViA>RyW=HxxyMm!gPX^w2*%bSZ{hD~7sPVyHV4 zM}^np$oc4& z3b|v`sPNo0qWd0t(?dxTxtmGU9VSsXK7$Ic%pmt;554W7$}Dobv%no*oxK@?eqSV2 zFn=e&pd|fnydvgb4B6M|RUrP8zJxEYd&sSN-6-?x749(lRR%-f%V6>^A4c?}!x-+C zhf0fxwikgr{C4q90HS|>1Yr8t5fpxQ3DFOhP~tZaO-YEZOTZmomZru)`1_*(({L7r z8(BoZ$fCsE>?v?tRZfHXjsocLx-vf&8@Vv(Q|c3g0=og))-Jm&B>p-OBB?pw*)5l4 z7taz{=X7yBl$UdTg=qS6PLZVHi_?h~~Y2YRdG6`r?0X$|fiP diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm.bin index af818d5fded9309d0a3731526cfa4daf860fa5ed..6ce89f652fd0ae2f52bce95689962eedb8ff02db 100644 GIT binary patch delta 635 zcmZ3e_(WlYHlu(EKLbNqVo_ygUb;d?W_reCTSiG1Fe8Rh4#H?)6o)Y8GD<-hdtr>b zj1mx$-;A;lh8z==;Rs`-FeyN!x|mcTj4d$6JtkF%2q&`^gki}X3TAAc!pzGA5n9fg z2@w)wV}%MSa#)0d+*qJcmYQs=P?B2!^g_I$ku{eB*b`{t#t8AWoczQRxCRrD1YEa* zt-@qQPGMeTLF38OISd$0CZFIi;DjrjEX%15ahn&XiMo*{NCUzgW1u-OrKS)maCk1~ zjD%=n<1&>s(t)cn(nK@BWOD?U7}TdFJQiHWV0o|^J9suT8c)vQ^?;bPi`Rk61R=}D zmn5vAQIKD*paFJKVp6dN5KNxPBs_UNpRA68mV!oUd~RY%YEfolj&~xEUmBmBpOast zS5aA|si~l?paIdTpfLF_pP3S}>J*@AsJDy^^eUjLCl~OGPR`<2Kry%&WE_g}O3leD O`7@Xlv?dD)^aB7L0KfYH delta 775 zcmaiyy-UMD7{;5Fsx4^)1x1nSt0*RIsQIc0qPQuzxQIHH>z4)_Q`7Xz-Pz$52N!X1 z6uSFAI5;@DxONeoTuhqW8H-?s@Z9_S-Y557?j7zH9&=3kf{#Sn$nF{ECty}9M$5z- z%*+eWpsk!YP8HOn@GmZ7ObtJpv`GMmajzB=mTXJ(pwa=>JW zOtDn1{>Xh62;i_wMBcJXTxh2{mibBi#wLhAV6#NdMh^nnccMv_l&@k2DSyObwEQ)` zz7-1Az%d){ffW^Z3ZV1X>K1aSrFj+d9{=#Yq8=hPt)B;9j;M#YE8U6Oa7+~%|} zF-Vp))98ZW-3vj^%My^6D1p$hIv@<^LZznQK0^(FQA$yKopmpaiJYo!p!yyX!CRND zx@G6Py-N{tK$`^olv-O1(G`yl4p^1*U7r@P;{Nm;5Az|k>8FM99zNqw8417e*Waij B_R0VN diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_csm.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_csm.bin index 32d7a0f34aa7a5c0ee1a70c03a73272ff8b634d0..1d0b0afc4e7969c54bb35ea41c883317afb785ad 100644 GIT binary patch delta 940 zcmdlKaNU1H3S)hq8UsUFVo_ygUb;d?W_m_}LRo6Eu|ipVUVc$-VvaQzhNKBlvLv-4 zIX}NB#gKr!5dnGQ$*&o?SU~np{>>-@VaPIxLl{;}QV>QIlN7>jCJLqT$@w|?Mb=!U zd6{WISAyjx&tQ^;sNM}@+=DR~nH3;X>dYz-Mj(t)&8*4|_qK_`WCLYMQB;G$0Roiy zs3<-82lHu&{*x?D5QZQtgt0l2btf}eXtM-oIuk^)S4ML3Jnl${@L%p^i16k#zAhvM z{DSci1to&*Pz8)4n~@Y;7E6UFuoIsERd7WTp`Z>TDJTn-oV;A#q8{!gV}+930$>!z zo0?g3DIh`-A#RQkPs_Nva;nE)#{)_~iVY{32_v(!9(xpslDbDUHuf zEJ-cOOw934B&;L_s}hhMa8rt{x%g0Rn*5we0p>bxW)&FI7{QEYR^>%;^JGS4NpT!@ zO_o=Zo_vM*G|ZgEEKV@yOE`10KI=|qsPN`D9O+CjB@JSdlMA>bVNz$glVMVuP58QC z?8zWyw*}&1%IpN&VN#n<3U7w7fy(M&N|?kaz=StXlSEb`IXO)x6{hUG3|!gdWO)la zBySrll;jow(?h(enKhRJJetyS@)JwoQsy8jxVpI>eklN}WdRIwUl0aA@nZ!x(_ zK^^Ln$x9VXG%Yky6__d5!VR~CNI}e5VjU_f=tv@0P(?@K(C^*N>f2w0j^17vYMJ1vg#C& lYH0YHndnu3RZp%_GnYqB;}CO@6;@8ZtX9mZGucDE9{@dWQ!@Yn diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear.bin index af1e6596eee82001b822efa26d04240d5944c611..675f34b4617ee632ace1b64b3d7608e696016cf6 100644 GIT binary patch delta 676 zcmX@BI6-lPHlsiSKLbNqVo_ygUb;d?W_reCTSiG1Fe8Rh4#H?)6o)Y8GD<-hdtr>b zj1mx$-;A;lh8z==;Rs`-Fez|>3@lJ6OHDSJ{E$zC&zh?=FEcH_C>LVo7A6&l=6g)4 z5C$i+7KCBR913P^p2Ez_1QA-!S_=`uq@D9J4VdMVz}$eK$5Yy;S8 zgt#$6JS`_bu>`Kc1SA31tzfHA8lMAnc}YNiab`(oex6=MWfig#W1tdUjXa=75+|SK zP-8Ti{Ds4S2ibth7db>GCvXZtoLWxy<V?sxZ;FOjzR@fKr2ofu4bm0*uhqQP3#JFIUh2`ztZ2SOW;a zYz2kMy?lm-5VjUDndByxq!wi+=6EM+DuDRO`8oMTdKHybnhM$qa7`MMU-6kCt4;x_ lh6b>afnEhz^<)Qrb9p2qiy`J9E3BM6oj-$7XELKeKLGek@B{z= diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_csm.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_csm.bin index db41287408a8e1004f80503bfc91edd90f7776e5..9c599c7e86498c741780d2dfebe1f706c9c97fbe 100644 GIT binary patch delta 908 zcmeAR+8nqcg|XgCoq?e&v8XaLFI^!cGd-g~p)57oSfMOFFTW@^F~^z)2fd)q`|@|49}n2t$w+!q^KSV9b;R0w^ zQ^A1IVzQQ^0ViDBsvZ!NWYiqEED*98YDq#G8U^{~3L0P+ zB_73M(}yb88ecDQHcu*XRcTYV9bQ delta 1028 zcmdlS*cY@Rh0$=SIs-#lVo_ygUb;eVYD#8lZh=BsYO=9HS$tl8QEp<6H5aP%K zmZTPCCgyl25>}FeRSC!rxGBZfTzsfDO@7X#0COETvkHu9j9^AHtMa0_dGcLlNpT!@ zP2R60J^2drX_z^SS)5?ZmvH80eb$}KP~pvQIMSJ5O2WCDVa$4Q$<5!nvtd%3)A+hz z?8#pQx{;O55u6B<+H5GY8OEOcLTob3l6vv2FyYM>QV1pQWnfAsgDjjcI|rt0vb}-?uSP`^O$$v_1!fAiaKkMjQV??|-%*T&X|z-_m9@};tFzEVGsJvzw~`p#lS@@B zc+9{mpe8+6+01A*dA6zt%)IBS4m{?_Dh$<w@Gy_9fVo_ygUb;d?W_rft`HYe*V8%X1X$a#!qYQ+>$Rtw_k}6Or zOHDRWD2p#itw_$#FG?}C=0Y|DL*4|7yfILJS!QavHCJg~W?FtxF4%gg*3$Tb#G=I9 zVncM3uQznKVas9$bDeef-n?VbRdi%7G(&dngyzVDT@+B(JrqmoF1x}4O#Ude^ zEW}M^O?2RDOf=C9Fx%WEE(Z1JGD!?7L`0LBG5djJ3c delta 946 zcmZp&zHPmsmr=-5hJm3hv8XaLFI^!wH6^n&ck*0DNj4~R7o#+cd6Q8F#{7w3N;1Jk zEtzDJA=(NQ%2Jb!70TkvGE>W~xk~dg)AEaQp~izHO%zJw3lfVGbBhfL$Qz-{Pu{>J z0dvS1CRrHsErQ9%3>VdBR^UN$lgZ?X(jt>{nYm!Ps+m<_%*D*AFyKlo2NE#C96W+$_kxmI=l_#Q7S| z-pKPD&Yr`62*#eAB-98~{#-~6E-WZ&VTa^dV}+930$|j}8=F{jDZoQNEhj&*1TJL? zl7g$7yie4C(RA{AQ3F-12AP3WBh;Hs)(}&N`6pP+MAJ+YRe_0uE!=Q(h!n)!$?L=- zVH&x`O=Zn=;OfjY(F`%&94jsc_hh-G1&;|>1=OUSlA9S#Cg)0dz|7kz<-lW#tb$oO z$v8K&LO}zRDm4uB40IG=gr<&yMnQhLf(F=MiAlv8KmcYdC`>MwHZ*~-wSdVrH?btO zC^Ip~J5f^s#81x8$uH8YsI1ad&{lwJ0_mUp5tztcOUol`N&#tthO>#0UIkdwWGxwU Yc_fpIA;uvqteo5^Q^2S*`Lj$v060iB2LJ#7 diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_omni.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_omni.bin index cd149891eb39f8e86008c7775ec0b874c2283fd4..f9d0f7f7284d0da030c18bee291c5107e5004fc8 100644 GIT binary patch delta 957 zcmZ2$eZ^`+FQdRAX$FR}#G=Z~ymW<(%=C=O^BE;sz>Iy2(h$adMi~f$kx8Z=BvqhL zmYQs$P!?a3T9KTeUzB2O&4p|RhP(+Dd1Ijdvdq+SYp&9~%(VQXT(I>}t)=k=iA9OI z#fIpz^fd!@wtg5sYRKIIo^qc6r^BLFj<#b0umVB%nA@j zA+rjEF&oA>%B%_z`M|6NVJNWZKo~(R$`D313sl!q7A1(tSr#t{LzWd{#b#?(Q$~nT z8QWow1FDC-9QAqZ>o0-+p;G9h7JsF13t1tRv06-sgofN>UY z42&BEM9?F|O%dX0Ir)hta1CZ43AkJU%*iJ7RIXo9pN%m-kffMIyu}Fv}E^$*? z6CJo36HPP&%r?h}i$O!6LehfE6f6%mV~^x!M$^d!QXUYK_DMN#nIUAkq?3d+Gz#*| z6*RyuN=z!&(9oDXU)oSdK}$gcIUxc0rSaf22lBh7rh>MD21JvB!emAnGZfV+K-Ewm jnHcF+fK^WpmoZ0CR17i*MPa4p^CqJVjQJD6lw^X7 zS~AHbL$nnrl%*ycE0o2TWu}%}bCu?0rsWsqLX8JYnkbaU7bF%X<`x?gkT*h?pS*!d z0_Ko2OtLWMTLhDj87`{NtN>FG%&Y=qRwI~;nN?w;XPC8M%wNnpFlHc&$YeVfegqe8 z3P`4xg%2SkGI=wL8I1du1?I}loUEpdFkvUQ(@^GSLH4ywF!mwN*Kqbmp677(9R5R0 zys$t`%gIkHncN^GGPzbL5T^5z5HC#i+v57U80zCM^#wfs~ zOhHmGj>+T+q6UnnlMjj-sA4t945S*N-fZ$OQFWNtRK-j*%`{OJm?+r74L65KLCl@p zAQlPJcvs9+)=USk&P)@{5Yx^2;$m=5dP-XGn1EG4P3o51%xE&%UdjVzUbmD3k14W> zt5QkExtSFT8lXVYFwis5QGgMeItm&E`Q-{4V1Feh6>9(in602N*;Crk5W?01rq|rW zlGLKi#2oKLO$87?IX@@ANUx%@N>f2w0j^17@-k^NWYsAk)zAPoG1995tDgKv+FTyV W$YO{&$OP$W=(+>bq|1{MA diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard.bin index ebdc5df9fdf15d056f0eccdeed22fbd9ef0a31e7..013ee50c43192d4ebc29bd2fb503916e991acfb9 100644 GIT binary patch delta 644 zcmbQQ@I-!tHlx56J_d%e#G=Z~ymW<(%=C=Owv3W2U`7n19E8!pC=OxFWt4(2_QDu< z86_YhzZqpA3^^t!!x6?vVN!rdbupg;|9O!rI4r zn-L;8pWUJ!V)pz%>|yB;dLgY!yo5 zbAZN{1mqWImSpDV=~Yx#AuBNgD$&)*%P-1JoGj0w#%Mg*jl+NwZouT(9O@7Up5QQ1 zH`D}aMVJrL3{z?Xkpc&=DrY1_Qwyi5tf3BEjiDx*0mhrJaf(60V)7?$3oawDJlG5~ zp3RI#lV9<8KuogWb>K2a$hPn%32SH+PuAs=)ltw=&?t@1 zO)N<*%1q4hP6YBx( zc<$V}Q-=;AbPMTUXgc4yBxr~6ygZ-p^X}REeuf`l5J&6ZtjE)q^`6qW0<~IEOciI* z*78hVqMfoWo6xS7C1@AhO0|>qn+>I=>FR7`YNo*~Hf3E_TjD={YSG89C`h&(qY#lS z<;a7%yr6&p1{Ec;PemEmm!|Q6-M}A|pZH@cM&!0PKa)el8>NWuFTEpz+^%GDt~3b@ zwQ2pOqG(kEr*y5Z$%bQDt-x7`n4<-h!UbB``!h(I&~skG_w+v5{h3bl68{?z;lv3~ z+m@Y+gT4Y8G<}C5DdBJuzYvldzW6ptVLV#RFyfS$B}JGa67d^zM)D$oQzqpm)Idp6 zl`e3T%fJaqApzvYCxB~e9pI+Dc-TeSy^z*|2 diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_csm.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_csm.bin index 8f0546ad1aa5f5a9e8614369785f64f50f28e509..c451c2a6774ad3b13ab77f872646265778ed676a 100644 GIT binary patch delta 857 zcmeD3+3vj|g|XgGg@K_gv8XaLFI^!cGd-g~p)57oSfMOFFTW@^F~^z$rWEMwM!Fs?Dbg)mOCI6)YK ztPsZLNY(I&;>?oF z{5-vi$|__f#y};y8sMm&{9jg$(PXlkoB=1?fXUTz>X0y4A!nj)qzTfBFdw8DrqmQ7 z1&&Ep`ACSS6nRrwBOSOJBTX~|Og3+m7lVY# zz-5AvO;Jt~($FZ#FIUh2yC^ZKSVKc&@=s+$9R)1~jneqs#FEsa%)}h;L?9oUUO;}= z)Kt(`(12)CP?#L8VuqqR1*jV8BQpcN3b5+Q8&%9v6cvLELQz<$IhkFxm`OovaK zmZTPCCgyl25>}FeRSC!rxGBZfTzsfDO@7X#0COETvkHu9j9^AHtMa0_dGbRANpT!@ zP5v)0J^2drX_z^SS)5?ZmvH80eb$}KP~pvQI2xH?>_ToEIC~@SGB`V0AOX(aFLV*k zo+6qFXERD5#IH%g#V0$r>sOx1rQ&cn)NCw zt27m~72ujQCbOxSA*)USsfGrynSovfSoP!>6?1vy#0oJ7Sz+bm%__x=I+Hb2`vHJz BL5BbU diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear.bin index 6baabcc30c7958f143721594f6d0ac307a0a32ae..8f9e052fcb34ce7db2463f85471b1259ac50f3f8 100644 GIT binary patch delta 644 zcmdn5(4w$Gn^E8j9|J>KVo_ygUb;d?W_reCTSiG1Fe8Rh4#H?)6o)Y8GD<-hdtr>b zj1mx$-;A;lh8z==;Rs`-FeyN!x|mcTj4d$6JtkF%2q&`^gki}X3TAAc!pzGAVJ&AB zg0Lp^rixQKHHGp99L?+?MzI?Je3R(&prSZ9m zC81W*)8ml zOfyy}$t?heQoJG1YYK2rr{&})mcXTezEXg53@3YV7%&=5uH-OK#cGf-NHs#e@#IY$ z>M#f1+yo*8F?X^BXCzGHR8CV_V;#6UV@)(ej5a^#6oY$`k;j6^ z5Uc`fk~7a{M#IV9c|2g|IrBR37$K|Zdl^Kfh x$MKmdA*oIQsfI;_rCtR@wZ`O&z?eSGry!4{v>0L6$XZ~#G=Z~ymW<(%=C-`g|gISV}-K#y!@iv#2jlb3`rB9WJzj8 za(;eMiXj1cBLecqlV3A(v4HHI{F_k*!jNSWhcK*|q#%qaCMks5OcYAvlk;=(i>$dy z^D@(bt^~_Xp1~vwQN0_+xCdh}GAlr&)R|Qvj6fKpnpu?_?rjr=$rBVMMNtg~2MACm zP(ga~59ZSl{U=$RAPhlP2xD_3>rQ5{&}IqFbS4O^mAeAUV&?0DvL*}6gR;zpH$zz; zL{~yt^Ce(n5z8N|E0p9G0HY+{6d1G$h)_X@8zaQia`F>P;2KOo5^&uL zw!m=A0S0_YKz?y%NoIbYUPWaUvJzvU5?u{&GML;hr^aY9d7YdAC)|L^%<}4xFffoe zQ8&^AX+@Y1(hO5-3XuZGa<64TJs>76P14D9A5Y&;YwAF{xNXLt}EIilM%OmV!oUd~RY% zYEfolj&~xE4^2xTziVnLXe($yG${ZX8k1B-CjU~AN70i4)C2XGnSovfSkGijRdWrtkw?z<{cqR delta 984 zcmdn*Gs$;D3ZtQ>Dg#4VVo_ygUb;eVYD#8lZh=BsYO=9HS$tl8QEp<6H5aP%K zmZTPCCgyl25>}FeRSC!rxGBZfTzsfDO@7X#0COETvkEVY>n2ZB5uWVJ%mq^r&8&*1 zKu%Fo9EY`&C&)`rzQTMOrg<@o6O8#1&fKiex|10yy!j1BIunc?&Rqd#U*_$Cvl9j8 z!P(5ho8jzTqATI-bP0sGoHSf~@@ZKMJ0$-ZE0p9G0HZkG)X17k0Uq*cIr)hta4BPu z6kOfp3ONHtavICDXvWmUR zNyfRE6$%=l$Rtw_k}6Or zOHDRWD2p#itw_$#FG?}C=0Y|DL*4|7yfILJS!QavHCJg~W?FtxF4%gg*3$Tb#G=I9 zVncMCAkH_sERiRMwtR4 z#1Z1asDg>7<>V)pz%`hHB;dLgY=J?U1567g0r|z5C7JnodKHyb$VyCrN^~{yfDxNG z*-cc9(R6aIr~xP3fXRnM)ggX+FKVK0tO?SJFdw8Drqm1~1x}MbVv!I{tHn%ZjdkE^ zj5W~=Fx~uDObi+Vl9Co&CSZB68L^U^8BHb&N_jv`ikEWWGDXO)mP!)R&?v|+SI_{v zC^4y6LqlV-gS4TJf|h~?a{2-COXI;w4di!CO$BWQ4TvTMg~^Mg%}`XQ098YMWMZgS g0aiWvhqO70qGFIiC<-ezC;Q11FezwF-Y?S+05K#vu>b%7 delta 936 zcmexvdCqD>FQd>NX$FR}#G=Z~ymW=!)RfH9+{tqpCE1|NU5wH&=1oQ!81pBBDaiyE zwPcb>hG;8LC`(N?Rw#=v%SMRKW$!sLb0B9r$qbHNmxVb+2%e=+O8 zn1L)JlkHge5nQ-|AemkkK7@?OLt1FDFDzG)*;8)fofT!R#=DNI{IB ztSlA@)7T(pDr>3(S7)k;W{An=OJZVhzrK;M;4ucPfSRNyxtY;;@*_zPn0b0q4m>8v zDk`LsjB_(96f{6dQo}&cKt};aXzD0v6y%pHXn?(!m{hC*1Yov;!sItnhK3Nf7BH>m zCYGcYWhUl$Cu%By_{sS>`9*pal~tMw+6r(@8k0Sx&5%{6fK)@nz{F6m0<3!Sd}(ue XBqNI<<{&Gqocv9?fKg|1hD<*I%iA&H diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_omni.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_omni.bin index 91b80ff35f372b01d3176761576b86b366071ce9..2009361d971fdee0be0939fe8ca0be6025789133 100644 GIT binary patch delta 937 zcmZ2ub=7i1FQb67Gy_9fVo_ygUb;d?W_rft`HYe*V8%X1X$a#!qYQ+>$Rtw_k}6Or zOHDRWD2p#itw_$#FG?}C=0Y|DL*4|7yfILJS!QavHCJg~W?FtxF4%gg*3$Tb#G=I9 zVncMI^=owV&5)lhTq!}xe%i3* zYidrOC@Q@9zL*ds049Hzu;4NQn+n!wExDP|Wb%7S4~TYKDF-f7glwl&l8}Z*L4LV{ z2G|*iNyQo(8k6Ou4RsW>6f}?%4Uk_N4^Ceo4{K^FXe($yG$|-dZjd%ZQJn%*4fTeJ ipbX$FR}#G=Z~ymW=!)RfH9+{tqpCE1|NU5wH&=1oQ!81pBBDaiyE zwPcb>hG;8LC`(N?Rw#=v%SwGpoWx&oFDjn7^2HV9Y=kk;!%}{0J`G z6p&0W3m-y8Wb$SfGZ^?)yWaAQ(LEMO)s5D`&<1$$afeqxD2Np1l!M&pf5thp569OKD?q6Um6lbu8j#9+$7 zu>@0XI(ea(@Z^so!eR=#(5TY{8K3}57Ry9UG)t4WVlZz`J|$tnV+>XSO@lm=n;DHKACUBbna3mLz+-}}B1|gDI5)FG zK?CF=4Ff#`9R(PnsiUA#kYBE#0rp8^Qn3aQfY}NPlTS$*8ba7w!1S1#SdvjYf6JwIi&+g`r3hGH~J$O;XuqJ5}OtLXa+q78f z!HboG}w@(v;B;&d-}e8+JwdK&PzDB z-I>LK;CxQp_g#)ekB7ISk{hHN@|Gj}3<#U#O_mo4v|j6wtmB(^-hw1s+)- zJ_L8;0^EvQEIeOU7ZI2-c^(cX1ix0#vlo^2dp@P#X}vfGW0A|4kZE#To! z!Uk)J!!1P_W)o3gT`z*Igw&E$ZTMOem)tOt%$bk}){;U$+lmkfz*aKE3Gg@R`Ujx* B0Eqwq delta 1708 zcmZ{kO=uHA6vw+MrX(ar(}a|!4O0`F-8QD#eC+0{R;{9-wcbRihP6pGlCS2gNwJ9D zJQRd?5=4qU2p&qIiWKx9o)Fgg!dNS0=VX_T z46HHz`ZfojnEvxBmoTcOW{bIE`JhiHbS;&as+n?D%3YKWBH+~xV%ZDS%<2$6UDkQ9 z`HGr5y5sm%-#ud1WCKqH=aGK`rMoY6JT_i-PwBAtA^i+CGx`iR=Y2N#uAjyZksdv9 zm@sIlHwHpkj5b1fO=-2(s)b;dxUu_!ds+~|T z?38-v&_o>XBh;flNP|{64{9ibi%>HzN>z}C+C_vqGeoIt?pbxew%vsC zdMI^rSVL_N6UyYJl$%pUw8IK_8Q+J6z9hfKR4jnT5HI)xT*8R7&lVHB z@`Y?<-xF;6J!cm)Y(1sCSnmJcLACB&t|(QFL@Wf&NCEfWDI9~nh{vRQPa#+m26|~Q zoJ1I|2u^cEQN}sLmf(iRf`HW~Vs;VUa^4 z85>}t z@Huu$ULA3c;o)>VDdH&d7!6`iJ`hkvk$1{%=A{O$D+cRv$1wKQWXK29w<+)7XFPna zbw{1V_&`t=%x7giWq7jzf53Fnm3H diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_csm.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_csm.bin index a85b7706771a54f41a4a18c389e3755c365e90bc..6379dc2a92cf456dde5c2e2b56c3c645a587601e 100644 GIT binary patch literal 63329 zcmcJY&5q>Aae!AaV8IImhJP-GFXf9+BhB;{|49fdK+r<4AQ%#`zBg)TYGw=Q?rQhX z^vo=D@O$_b{7ild-yIobW=3X4kdf>z*cffGg3Kf{zx>GRim2az|8IZw`~Ui%|Ni^0 z{^s%Wc7M0OzAt|Mv#-ATnSWi5uYdk{`Sx^mx*K2p?c?S3{^4+U++Y21|JS$!-SjTq zbU*I+caN7>#}7X~{P}c$d^nzN#;yN2ZT;=_568m|y!mvP8nW+vcYOc;@%}*G`KM{0 z?{5!pAFuXzb7K$sFSfadhr`X|-n{$$?djo9k8nm~hyLO5 z^8Wh!{q^nD@#e#y@w&JZzyERn?)3EU``aB{Cis6iakr^RHepW49%k2lBn&`aO%dgCV0?7Pq{c3+%a%zG6a*H5*jfOkxQ>6tsiy$}#g%DEUiMd#w^ zgq@2Ertf@UJelXBf6Gj5AwHhyKJ4BAaJVbKgDdE!_-^5Sn3r~d+5O1`VBa_M@^pN+ zx!xadHrrQU|Mc}{b9H*U-Mqg#?H@KDkN3wPj#tNr&zI2B^cHf1Gw64xkB7Vchr=Z_ zv+=XD+&o<00#283^o{%P&9|E^0qWw@=gl{iu#2Zx{84}nca%CjN*N!e6pzx7qcq`B zs`x0?bd(?9RNcw6S~hL`WplW?KTKViBF$drB(}RT#KZ-?8_bp|c;GHgt++G=%=Pfv3_%YE z>Dm-HHC+daLby7<6T;OgcI5IDMbJ9DlrIqOID3T(BxJfoMaf;GMstmjC^~-%K!8jj zcqz=F0x|Me$&kd&A>R$@Dpm9<)nW7X+*L9=##hOli=Ae6<~u!?8z%Obgu}~m21k&GJCpH&I74J01UrL~c)zECev8VmgIRR1Hot@=sKzCOnqxXd ziMYE%lslM6-)`Qx{fB8s7k=>>-sjtgoxiX#VJBEg z$16c*rtKGk?N7s?z1^lav=?8V;Ck4*w({c37ju2+AvH4=8pHWoED5|qd7m)?ai;;0V_Jx z6jnfv9a8`FI%7=_$pR@0JXW|%}l1^0)zHq22_ znZ*o+Fi!!-u@tyw6ckitLP2G2$QCHTm>deK;^iqAz&|<)hItCC{>sKLtkrni&6%MJ z%}_0y0YVZcGLfh_F;vl$SwZ?Qi=m2XcVehQF;uA-D!BDbkbsSx7%GJrDvcN_r5G@d zN5VFvK_V4Hr4R$gWFhhLVt|2AB7s9TBZjTFguB)S@QpP!n~kiJH>{Y-E{G zXri|3_uQRRt<(g@@l4oeG)$zLs1=&Pm@Fn-bqS1JwQF;R7SSDOE3MQJ=6OFs)>fv1Z-rHP-vpD z>-U@{8l@&Mjz_{aqd_9oM5E9I#$+M!@|u8wP$GdtmZ^zG)7 zB^uchjckclv_uuKxZAODcYKc~135>}?;^i#?1EE9$hb+?)t!#-lv_!jX2?$A$$h>iCIZL#% zC0f}MooIi?5}hoGPL@O`N}>xT(WR2;I7z@pmI#F;I=gz$NupCq z0^@ihY%>}nQb}|QNnlJC5ic(Z7zia1IAocU=wwNBp(MIxNkB+UMCOx3$2p>t9nr~- z=tW2Lp(Fa#5gq3U*vJvlD;&{l9MLNsfpIJmt{DXped>r_;RuY$A)^EQwx}L?23`PbJZFl7NjY5(-K5cJ-cqlW;95olIRtZz?du~US1L~5K1I)$TB6-%aZ6rN%YH-fRF@<%=@OEvqUdjqL(c( zh?W>aOAM(cdd?ECkwaooSYpsvVo+KF<5(nIGYTYz)DnZj5*U+%#PIT#fPv5=vBDCA zY>6SX#IS4$2#Jx%Bx2wsG02h_WJwI7B!*BDLn?`ZlLTyJiBL#lu&ei+BnG7R}lVzeTq#X!^ zW{1IRnunBhZZeYT_Vj)HVrR7E(;K+Hd7Ie2k=@N=ZokzG2aEb+@}lfc!5{@)FvkcI zlU!;No1Cs_xH zy9VnQa9o`KWClvo+=d@jdml*Fuz*_E-*j#fl-x?~!dn$eumGFoX(lB~hmu?OqS=fK zt$5Zx`YyB^UJwX9;MRUn+54oNv3TSETClD z)1p+8yBOa>VbX|ID4D=Kl!mjQ)a9ULMs*1#ci#caipw1-3j1inO3LQ{`U_dABn43k zS>dM+DzM7wfhBfSIpe6(FWn4SHhY+yt#_17@+D`>II5g(a6{Z+t9|B*990H)qoSiq z>x>0QK{8whShAyBdup&)N0nMfVPFFt+6ne zHs&r2i94P1p}1ShL2m+2bCpN@XmFqQ(MQC4Ws-k!ADE zV`X7lxbRp7N!a!lpHY@gYbNW6SC&mbCa23Nt74S}TP3n|%Bqyg!W3LJS+cTRdup;+ zWmQ^bVPFRLZJCWsPL5xEZu*>j_yi&Z=geWwWDs zvJz*FDa_$*U&T5LwhCm~gyscjRZ3@JCa;z(4CbBX+S8H+3AT*0Dy_3HFpsRWI12_U zgRJ$=aw+a)s`;Bio6GLWs#VT{sKi+-z_Q8jF<6+RE+`8!!e^9abF9hPdS%&EXmYlU zvT9aYuvG#}r>t73EKCPhgC#4=wWkJ)RaUK476xX4Ri8y!Fi?81a8%bR%jL zESrWO8w<1L1+XADea2We+nb!N2g_zL=+VP>)#EZJDDJvCUY zu^O$hFfa?O<}Aj7fzpG8qq@#mE@hugH3C**tVU%lh)Td(aVyve#=@L?39MOT*_?55 zwgjxiSYu*$Xsm`c7Hk#3vT5E6#%h$t!u)0}SQyM3%eAKk3(}4mV>Mc1VPGCuXE7EG zR0de7!n{+GC#^_9(DCnrm|N_;h@n1{YKN?~Ebwi+y1Sgt)a zSgf!*t*|gK3#{%e!h(U)gN38IPFSvz0hww9tVCFyN>~t;fVJXIuoH}hr3fUjW{qW2 z>B-p=uo7d93Gbn?I@VaQRRGJTzb_c8QyL5NzO`UsFmEi^o)#=f$7YPxX^n+}d0?Hz zSTIl-V68WnD~Ld*ng`2PKJaUJuQC=y#bB-A%2rBKhLLOwZJ&y`J_ zCnw7Yt7nA;TP3b^!s?a6!sKx^SF*5Ndupy&Vf9*JVPFO9_zJ5cNLx?ln_;t7_j<}Lfs&q;GW=GO~ zpr+EM^P8af9diZ9DnPPu;MY<86(vJ4UD4830tlLR)+}vezj@p3f;lpA7tAd|lwJv4 zCf*E}h|*_#&$|=4FrODjI%c4b>^Vm-^Z|BY4eDEE3>pAV7IHWqUCBwuOnC*8BR1bD z6TIwFxGH`?UL;Q}PP#P1C)+ehyBtT`-=_vw$&(K!=lVTWp$O)l!>;r>{NzePF%SiI zurIwuov@1@{*>5}1uvTOxMs81LHi5Xxm#~SJi(4EknU>Xw~^y6u-G*-*pU^~OkFek z1K<1R)YzE?I14+ogMeL^++vUm=`x(hCBt>K7qBxm71Y?7;5_WQGhx@{VP{5LgPpzI zfi>R?qTKmMDl!!bh3>hDP^gn%xx*SV#!deBQCC6eizvkI8;dCj5H7gS7fK*!?jiJb z4E&joH4H)s3;0dl)P1nkKQl(|D_qX`g8K@!`!J(F2SVI|htRc}tTs96xIO~^yIV8VhiVWBi3#L>q|?2fP=)5_^HR#An%Y{G&HOSKBI9zc!?aR;74*J=)hkf2XKOeI$==P|I% zehe(nq(T_J913x?*Q=0J*&tKVtI(IyAQx7t!ZK9hNa3m*QeS!_p>W29Pl`e$1#D%LM^kq6?2(gHUpu%!Ng}%-MIdc!8FT>#1pRoi( z2w}yl5Vndc^yL^9Agt6X#5w~x5aJHJ3SFx?5JKWVtHLTrg&3R#VRa@I!tmulh@-t; zg`|21nTj4lU!sFdMWqVi=in0vS3MP0;^(7SoI`*R%2~{s(3gZDXHFnwOjt2bg%xW; z*eXM)eJZT1lNL>gB?+=1luhVb&4N%cVU=S-49#L^rRgbOD0)g#E6dkB4X2fzG`l^sG8)~pF(s|ca5@~~jS zT5UosUyuVK?!cSSwVDGV)DvJ$Sm&4!gR>y4&tyUvz8nZ~wAY)E6a^tu(L?Afe~_uD zG$H)reFEXC+tFGyA=dm5AcQIzvnH(P|5E5HL69?NOjxrfgsn1!S`*f46Jn`@EC^*2 zx>mCw6iis>m=J^WAUu-^VfeBje4YvGh0jN8#)P%fgb)`)xQanvQzRB4R{W3{To9oz zN8up)%5B7?qo#DWMLwFt2)LJott1200?Y7T=?rhpY;lOsY5 z&SJ1RlL%q>au~$XUN1sYYlKWiFG62XgiJ-H2%A)dtDXoO(Suk?L|_nVZ_IkInfIWt zFF{V6@nFMx5Vpz;YCYJfJ%|MqvKW*-=vvKUQ1D=r<3SA0WAIEKgyG9#@Od6=7ChK6 z9&D5zggD|sz;ErJ34N)OScF(eM1pWZgud1VS$(_+eK86T;aG?w6k*GX5VndC`l1vI zB5c(n#A*vU5aJHJ2wkf=5JLF_R)lSi2r)Pd!uCuegyGA95J!8x2uTeSG8MfDeW4OE z6_p}v0}+l8uDTm-MH6C)5&=Re>M?7=cHV@(as@ea#)K_vLf9%ps5N1$HX)W~$bwKd zp=&h@LcxS>jtMb155hB<5QZ-c!snT=T`*zGn6Oov5aMDJu42&FK#4_&6-p!q7ewfb zXpq&%i_jOj@C=RxECnen!_NJRbWNf<%kf2 zvl#5oBtjUz90qZ;*Nc$UMj=zti_jN9AyZK)!Y&ozswcuu^dMF~5g3G8A+sLr<~``^ zVUQDNJlL@wgsn1zS`T(=4`RWGECyu{x>mCo6g=4Fco2j07(9~)VfeBbe4Yn8>OtX` zQVU3M3=)EwBruozM}Hf&?1)8uHZE+2gcX7gvPyG*{SR21?^XxDk6QXVD;^H4e-h*Z z1+68CIUY_kaa~rIuhuad%B7w3AUl%#3w@Z+{Vjdv4RZoE+Xw4zaJj#5MUs>y-$!x) zqZQw)Fe4cnRp$Pdy*UmttIqu`ed!OZMnz(I{ z-V7lw@fUhUR$3Aj{D5j0CFcGHogxXR(^sy`p18nogYLj;46Owey z!RSlxFe_}d1Ai0iTFnvY0L1>}erVOVgH=Yf`A-I^Z;hXT;vFxd_-Q16U$+)CtEW$ZI;F|5z4r_wlP|jmF zkdhXzX@VVDAnnx}@Jr=!7dY&Ou$n<&W?GeD9y^#OO6<(-Va|Q)V0I9&v#n-f*Yem6 zrb37oI}Falt~n2OFnl@K;b?2H^S3(#ovHK*%S}Z>A@eoMK`B3oODJ3iA$i)02r$n; zg8POA_tBaj?#vy86)ml9!rlNzeVoI>UHkArZTms>m8_Co zL*_y#nh;KMLO%;a-h^-kG6rUWL_;yA}5o(%KtVg=5u?Xd&oX3TISE>u=0bSg2Kq1tfA* zh&%8qbgkx42$dYT$3VEqITU8AusDwjVP54?_$(E|MVhCOsmM|lN)KI|EB!F0q9s1u0z@ceTv#wJELa!9R?&sD0LMIq)=G;m#0nBw6v{3v zY^zxm3N9>iT!_J0E-cRELKwar7vgBIcVSSm#Z5);!h&&Op>!d{B^0iMP*fq-RFNQD zP$4bx;m+JcNNaCc6^>OmqIG~(VKJjZT7P2}!cwh5EFh5sA@0Dd(6yQaAyjf;RaoSx z5QDQIEYGAu7``kBpQpm0V2hiI9zv!fOI0dW2yqF7tDXvJ@s^MPEU6+u2z5$kO-L(z zxHBgZGA1k;6PBzAVXJ6DT7F|5LhGbO6Jq^{EC^*2nh)>8KRF3&yy?4Jo&*z?IVQy5 zJP6NZLKwar2ywK9t3*DGfe$dqEBDb%71V2SQ;|T(n6Olu5aI}g&v+=LwOb+xXC4Zn zOvyZi^AClz^oE^kW6_Pc3+61NzYSL9j0tJ^jadjQwF$9)L=J?w18+jtYK{q^kOOPN zGRK4%oCRTZCKJN&WkL8n69)BK7zmkyELEj6A;cvRuDTtiwOc|0u%e1!LMT%*3n4A= z;m+Kfke1$X5HcpLSQEll(S)@8#yo`9NsA`L`VmtT zd^r%}Xsl_hca2ABknM4S~mj&VTL|89~kg3N~HA)deTms>$yHQ%YB_sd~ zst6E5m6BN#()u18gv@87W6_Pc3+622k7b$}6Vmb<^AK7mEt(MPM`S@Lo3OF1W4M_-moGZYi>jgvLb9|L`bV|%re-jMTq4iau~!NcoDi*a~Om=4y*{991&u07K81X zLm4o8v(Y&SUUQ9)#h`VGu`qy$6G8Ekf?E zNqvfQf5+*Kzi5a5xLI7;9I0xoW%Z1CaCacz|!7nF)fuD0tI<$GSnXbinQJHhL^*Zdauv&z_ly-C5Ps@(m zV9w9Jum@o;T{*VxV$F}FzCGQW7ZJ^bnM;c$2Hgg@}RE4sRY zO8HaU?BS<0UUzu&t^51`ynEQbJ3aWn_P3DvXG7pzqLUd5o^0Xbf3vm8f3w~D1i3=9 z0iS&)YXwz2UX2-rzuJudi z@B&N?ZhTU61%)xDt*>o=HXA?W)3BJa`0jXjcxwjc4>vb3C@{tCp3wdqcR`_E2vEGm zL3Qn2A8*_xVvhCn+Py1GfH#<&S=ej0ffI()vNIxVe(V;ebB@Uf`0wi}Yi8=x?0`L) z#Lod57!Nh2t&jyMS`aW*(axyO_y8~W$IJ0TlG!%iia7NA{qR`)!yN;vZBV4b1{zFE z-%hi0vWeTZHk~(p$Ikz99M#*?(w8m(!d%U1=^NK=9GSzX+Y&~mxaiuh!W3`X(=M1nFpbTug}DrK oYf51p~QI+1ekIMDDA&|{q58)%7_y7O^ literal 64042 zcmcJYOOG5ma)4)HzzYio3_mW0FXhXkwIlUbzB93y1qL%1c(E{cfbqRil1iEay1Ux_ zP)i!@!T-ZQz!(2NA03QLl0h;^2D7`ohA^GQB$-Km{FvPtQ9u0jZ-4c}fBo-&|NU2g z^KfyqyWL&gRlok#S6}_g{#?&L|N7zL?eX$>JOA{z4;NRv`~B@h&xNB?m-`t8-5!~PmReB3V$=}*2tynp|2wtd-R19JFdw(@@%{eO+vD-}U6n0SXG=8M5-nRob@St4 z|M>eC57&qH&|i8D?Z!-}%;(U-$oV+k*iRd%-A=!Jk#}qn)kjmyU9^ZZUDKuL^i7wf z(>Yzznclgg{&Y{5|CX8l(KCD;Y{5H)$^N$f9`2_BVVn6JX09G~_Ixre*w59hJs#d| zu6Bp(&DqNrzr5INE{~5loA;N;-Tmg{;qLI}aCx}@d;u*jA0b;ftG+va+~4j#>@T31 z4V}03=Kksipu2$jH|D=L-)znZbmyNwZ+=H9Jb!!{s|VOI^|Wq1wO>!2sHY?KbZ$M3 zUr)2t^9C;1Tu@Ic=%Iqk{oUPv{Jevkr?2>xT72rW?fEpl+NghD;#Ivl9xwHs7*r*P z_nR|)Qh)ww^PAu3kNfk_FJEqcfijzo)A*>)GxuSH=0Du-l|Ldq*jB0s+iLECIdM=I zzI1nVS{|Wg)y7{o`^&ri(uJj@I!j%|*>*0X$~nE8)RCp|#NC=!aBC`<@$S8uoE}cG zdsE>AH65s`$lbA>h}@lOOKwk9IjzHw@f(CECht&%oGiDfs=0gAN$wF+Mdwci5ReH3 zKSpLyg&^6xq*&tSknKk7E;aNnwQlom>Mp4h{kx>DMNcz5^NGsqjZyVQg$Qq)BdRNc zg~gk%6|!vag~Hjn7qn3`EL%iM6Gf@65NmhxRxa7_qa7H(I}6>mLke)azA(M1&Y?H( zkM4~R;8WE>bTynOs-9S#}}csU7k~y(}EwL3NF!>zl7ll?@&6 zc{ib3TL>nN8NJpnleJ><%xiP@w0}_FG)iPmh}>O&K6B{Sz3CUUElftf_BI>&Rm){L zhIGrRmMpe@Gcbpi6-3uGj}}=1YhdOVB+gc>HY?D>xoo6yRc40o?A`GmR@D8c`-j^- z>?qYVG>==a%oz1A@!H$7?tJREZNGoL-HvKS>FRDA)lV>2pu^i{+V(a4H?B3CKfstQ z-P?qt^JVke%x_s2=kyz*4A|4~KG8 z=T1Rf`*;?{C<{$uL229_O`~=+9t*HHQhR8xBg?)O{6hAe&9XeHc@|@#f&C(`5-AoM zwXmTc(kx&(mIc#{fQ6n+C4uF5 zFmy8#FhWT*0!d(*A~2p`5-<=#FmT8ck~p)*FguT?TUJ}Lzc9*ZTxB$QWk8VtjN;u> z!x^KA8>5LEqfHp2b&b)6#%MTWz(Ed-R$z=)VvJU33@pcjVVV(u(T2uo1;)TKC1AAA zZwwd+DHu6pFkrMPW3;X@+PpEK2n7RVvF5p=<&@FJmC?qP(I%A9y2@xnWwe|!;2=we zKpCxG%Ts%)R;Uat$CII(k&qE8qZKFv%M_9E{K|lV5R!pIR;Y|NrHs~9Mw?d#6bZ>F z-b}TeGupT_+PE{igflwV8C~d%mU9Li=77T$h zI=z;sl+g*5f#rBGbTbk#LS=LUWnh^iFrHr-Fc3m8aL5Xk(WR8pxytDB%77vP7{yN+ z9cPR#Zj3H&j6PwE-Ze%a8l&Tk0S7rSdVw)|i7|SiF|Zs9hG|9sMjslZ7Z?M}lz`Dc zzcFASq+qNtMxQc9?;4}e8v}|EFjhWf^qevJxH0;;G5Ultde<0zXpEjS1{`F;5E!G^ zOL@u|z0ep~jt4_GBLO2cMlUc1mMH?``HcYsAp`@5tk4*J${4+Cj6QD+C=!5Cyp`%X zWAt%j^l@Vh31bYdF^13>J!cF!$bm5kj4?=zF$j%; z0RtfgV}&t>lraX^7(?C|P{aqLn2UiE#t;|A5EsUf5XRsNV+e&YaKeCtEEfV{408bgu)mE!oV^`Ts*%pU?7BC;E)vxV@L^OaD_4Cg#kr;E{dNp2F@2l z+!sUK7h}Q~qw9+?^u@sW0uFLqi~?Vb5?_o$Utl?w3)75%i!t=YDDVZADdA##eqX>q zNV!VT_?LMot)TkOe~^j8U)T zDPfF4VPH8P4Bd>mTVT>tZjIJ=oyfC0h07mgnYUGSD z#*Hz?jWH#RF}cQ=LSu}aG2kEv#w0MtBr(P$GzOMq!7$ATz?ec~OafzInG!Ij=Qjon zgcOVw#+XvZm|SB_d1F8kABIq)5g`1au z%XThQf(Z2M+26B;5s@;&xPwG~EU%nbTh|Eivzi*r8&z=q%e#j5LmQi-tD!-Zsv_GA zyt)k$L316>JN+aWpxWB8A#XG~AyL~!CQek;){{vzPEv*TIDvfCb}@U) zgd=T9Oq~-Q<-UPlZ5J7NAyV7UjUI!aX^>RVxkW;%+vZj(pV*iSu5VUHa}0%ZI%?5Y z=JjVV0aHQ96zPJh!-<+QaZ_yM)OJ~3NewFA%Zr}c_HOtT6F^mMmnD8ugtzKt0n`kf<=?S4~L8F=@JJoHsN1zX|KIs8*rnm0Aj_b5nhoPPE$SR0+ znKLk`&?+FTR`GF8gq02uR(&CDnwNyDIZji3Y7m!lV#Llj9r@`rYhJ0ZbXX<17=^qWZvxFL z!+QZI>Zn$tN4yTPoQYSaa@G)Ycj0#~@wgMxCBvA#iO#y|44Ep-%dyh!1#%?J(lxjO z40S{n>5f`qVO`PlH{KOhFt1729N0VZ44U+Vv(!MvOu6AlRc|QCeR1eD{WS*Sfii2h zIbje1HP9X90+jo#B?Zc?fgVt}=-RL?2dE(llv#GkC0n3$WT~Alwc1hnK;f1-0BVc@ zrK3_aK-I87Nr0-=rq_w(N*E3c^FW#Qq(Idb3zXXDi-1xEi-4-PCjkl`iXtIi3{YxR zb3mEhVb#*5T}MGXtG5+ay*zx7$tDt3jhjMc6dN173NIa&?E9)t_^M9&N(US}S4{8< zwx|#s7vNR1zJj9>U+M7U9A4TVc2h}WhRGn5_zGj4BY5fd#CWm3s-?cdf@OGhr@#va zN{$zfY8EeIFB36V)jB(YGua4Ufxc>yzMxdFA9Q~sBD7Z>u~(h27etZkjS1O}YyZ}1 zd+E4jJC`w{*0UExTr=B2I2yrAM>J>fYJ~Q}h-j(3urQC8X-|q51Pe3U!CGoBELemW z1pA`UpA@MdYzI}qyx3kisw?rz*h`0|lgTEsSL50X#1;JMR>+r*m-hA5B=iN5=?T7c zD73SpSbgd6W^&1lzUH88e|HE+V|+QkU{RBuecWoaPBQw!z-lpH@y9LGo|rFIUl>R( z*&SlRGQLitFBNt#<_kx49bZjGUpm5_Og53e8dqO4U#qruLE1UIg!;lDZ!unReYLthFN7mn&myfXIEA^T*qiR{%m z_L?_`tMJlcCiaG=`V#;j7a&fw{UQ)MI~l zi1FrPyyEsU?TPVX?S=9661=crk-Z?4`UH5XYy@I^;i#^|tIOD{3+&a2>;h7cR)g3 zI#@kMS0FD8o%ZOO!{&W?!O<99GI{kvd12_gn69|IOnYLwSb1Tnzl1IOKKo zDlvjsUO1}j=;|}_>H~T8B6&e6UtX)WhB_=hpey07KItwU@gAW|N3q-G1mmxLx>$EX zM1F)W9sizj*C2Ek#?MRX!os|}OnXwgAheuu7v>8P(N*j&2n|04T_x_qQC&$_#$7s* z0hw$fcMXoa0Iaot_R_)iK3+pYUXaEhAuk;`AHyq<7lv_rc+C;~zP#XQ3@@3y2BEw# z3}1{_TwbOUM2RzQC*2w#$GzD0-0=!erPBojbS2z1Cf%ho0YvE1(fxKg!MJpvF4kR; zsUSj^&I^!n*Ccco<`t0Ag@t){nf9b~LC8JhF3h7KqN~_l5Hf!Xx=P%Iqsq|5yv?c; zHjv4qVrX^DCd8hRm+40PoT?DT-0_I{Y8PB1`2qAZhR9a%AIj3gnBTRblo9~{v|o&8s)JCB#>9c?Abjz=JFsJnHiMP-Vw*>ss)5`khxW|uBk&Okn3H-Te6Y5wWsU~0y>=fbqHaZJ~oAn@5c zAp)OnwFEwz4nwVHX2PiF5;1(La2b5liQt2Wy6EF31D_gg34D4>25Uc^t2T*)GZ`(5 zHrs-|weY3aiQETHxq!u$DB1)Jz6bGJvm+iPsTH`bS#6UlI9G2yXmccxt71H;zHU48 zARKkJ#DkclLW&|5E<&+7kq2S;N>Ien7NJP2 zXhKe5E)s2!O&LLv(IR9ElA*|G(fu`$*oyjF&DCP-TCqx45fWzDtv+MLDrd!tv0}wo zv0|+VN24g(#0)tUwV&+6W@Jl>nH@^Dq(Yr*7)l#euoOVHj*sb+zk;e+EfhW z@)<48*(CfODjbcoX#S*MBfC5kqGgs;UWp+!jIk<_Bi2@yfjrg$J%&uDQ@Q{kfs zN26M_*&#A0HexN}_r4dQ7}ug{wFt$C7BR(!6h$mtq(#V$a1t%T@Rgv5qrF~>O;(Ey z^R(CqwFu<`6jwei+Efz(iU}(=87tcK5it}QD`GkW&x&(KivY!h6>TDk9E#dcSu0{D ziV_s@1m22`ZnXqO$i~20u_<|4#KL7Lp2&(Ys6{9~&5BLdiZ)A#^+GGOB9tR2KIvi6 zW~J~^Y!g<5)F4SK+Efz}6m8}Ra`lWA=j0bYif}Y)#a8;T*ov))Su2WAj9byPT7+W6 zikP`WYDFwugd(I|IEfWu_)1X3(Oz%GHfu$jQG`rJp%q)licfl0v>7Y{6cbi#Ggh=| zDPkxxR>U+3o)zar83Bq3E7}AV87sEhPgyHshKmvu@dVzArqvP@A!sLbrPwi#ik(o3P|hcD<&&b#ixH5RaAKEnqD^)YBav|;CSUNJIH%tTNK81 zIYJ^pxc<+IHiw3fVxN#ABr-`#(PqYoplB0akgI2;IH&6HQG}yWDfUt+_F^ewl8qu1 z<5D!O7NHoCA|@JS=g7>bM)F|C7V#W}A>fMUXmHlaqwioMv1n31CdMLdDGqG`1RMaW9QTCp#& zA{H(~@kCZsDP0Pz2*sab#Xf6An=Qq9VGvpo%K0d+B+(}4@JSpJQiKdCNh#Wl8xaz1 z0u6HUj1=b_AU=t3G%CeGD#bx8MNHmNL}FZurqv=6BT~c!CQ>P4;UW?t^TbJ{2*X!G zB98WYDGpgF4vZ8Bp%kH%}woFhge<3vmr;W=?m7ZQ+|aH37q zk#XW6b|U8aC?OF~;GJk%Eg=zdU9e6ZN}Py=%Sb$t6IG^|0w+T8s1upDpKV4JyU1gv z6BDou-*{}_6(6WF$*VdhZnLHpMuL{1j2pDfgr|}B(CPQf);84#5O}};^!9kXeRlze zG4jeBS-wf!zJ+SPMO?i-?tI5=ZPRyLH zKBVK5>ybET3i%+(Fw14if+W}Gm3SEaTjqdl~LZia?WVlf12vSeuOG!W;H}{w| z9g~K*@ySrPAU?UaX)4Io!7KUDFLQZZgYcEQP{f2V*CSo6&6x_qXsKv?vePMY2NrT_ zo7%#}C&Mvl2-Z70S`G`QM~o9N34=U7xeelzT}nv1HWtJt$FR3~+R9=K8 zA~-hmrck4V6r)Cu8(wLKS~EQXIP zq~5$&2{U5wbs6}`d+cQGA@GqeLV?^YWNCJoJU)P zqTLr;6ydtbTqTo{pcrbg*~+x2$^|HTza0{z7_(xtjav~qKrW9%F=NGM8(I;LF(`6Y zgsvq}6j~9Q6QfvY#bz6|qHVPZMc#_dw!n&W;W89YV?{N5MJTG#egcYFE7C+S+6$G? zicpTC2to{BB#^R5vxm4wsuEg+lrE{q!-ggUAuEy9BF*bzE}zjNBr*wis0|#A?NA$< z5G1L^O031IREu~5uSL^p35$?FgL^!L+gzYUEL_AQB)q`o>Y3w{)$ou@^C+ zNXZrzPl&LnTPxE*nmxor zF=53zV?~+^gh!FFBIcm*tT-nq2~bQ}v6en9*4j@nm$~m9HGf!YFr7$=74d`!in`Sz z6eCu|#42JGOMi#jK)#F9pjc)_m;+C-Vx6@jP4uF@&tl=?We32F`Y<>74d`!in`Sz6eCt_N`8lmh09Ppkrh>Pni3SB zX2m9JMVjbEqu2_q2<3b$u6$IaxkFqM+k_M$p-WPVG!+O-BF*YyE}oI%oSwud5spTs zNYjBNrPzw4*p^BWPvA*3t(K4o*)v!vVqO)g6tQp-iIDE%BvMqlX$nZh(OxgbHY-J% z=fzA$p%mLtiYuQKY3dM<#Do*uj1y@l5S~QFiI`NvbK;zxBp@;2#8&FWR@*7-L`)`9 z;zT?lLZWW9h{T8!+Y%>Y;W83WR~RPk>Z@5 z#3vDsMx{v8fh48ai>26?N)b=sNi?mNkO285Rb%!6Z?!4X(kY!M8=7jRKj!OoSh^fG2z5s>cn2# zDeFW`CQ{-=JRw4&ZncQSh!gt~Ct~3;5>Mnrm71o6#Do)>x1VX!7R?nVQPJ_qDuT*{ zZ8SYqCV89O#DF%m!bp5FlnLUKXH{W5EB-?`Fkg||%;`c*HLc{P`IFr9Z;a)iG_&oUX&vt=^ENbw6BO9zOhh|KsuQaDO;ngWA8$4Vg2P z8JBflIZb`H^5$Q^+4v_y{}xZ^e$a0LZgf%*Q?2sanO_OC4pU;e-uc$?wJon=nA%i0 zv%O*Fu>OX6b3k3b`C+Lf1>KiwSf|NL;j zzde7%FGSu}L)*b00GEwQq=DuAeA9r!`0hV%@6X;H?>9QS2yUE-PlW&0RhpA<-*N`y z^SiUNC15hy!A~&hlLbD*6`0zGmoMi^zuxG|lP7<1Pj-L88sH^zIC^#Xv^jfwxx2dA zm|mYl$!-s)@b#GDI7H-K45 z=AP?ADjSKqKHB9uagDyS?f}iHF!b4&Rl}|e^Wq45V;lqo%)orK#r*5_XU$7Fvt?+X|sJd@KQ#N-TljWx($C7dBl9Yx>cIgAQOpYYaCz~=?e4>O c$IBxwk1#>(Y*AC)Dewp%;~wBIFJ650|Hh80*#H0l diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear.bin index 05e3ed060cc52bb34085cc8d56e24f4503d3124f..219b0f19b1c615e5c3df8414e108f3a92c02c271 100644 GIT binary patch delta 1624 zcmZ{kPfXKL9LL!}2$g>soBY{;HyzRq80|Xxhi!=o#Hf(qMU0v-3ma^4TW8k+LkSlz z+?01UA$lUlgM^bNXyO@SZ=Lc zIuos_SrX+^I=2W?>BUqYEG6d|uoTZpa#qYli2q<1!9q$*NXzq*BqypwsOd}Thw^XLUN3~O${O+gPX1iYK z$C*8S@v{D!zBsO5&=;wOS#7bq-%yXEKR04FL14B`I5B(Ql+^Qvn=yOR+>Y6cR?J*& zn3dWLw&}o{e;t_3wHxe#3$t%7%qGtnEYXQIKXhWobQx^QZ88_!cVE?gxIG3B_hP=) zi*sxH4Ce8g%mtr%aqf}V;B~%)?lb4ZxraW39bLri#sFro2Ml)T$GWiqX3qi!dozSt z|1f47!v=dkf;F2c%<`1MHbR*F31N1V`Duget-UnQ`y&JZN;Z#9Pn-uaK+4HNF{8u< zFal^cNNL>s$rw02+6}*qc6zK&Mz(-X0?-c7ChOGAce6bmAtYLiXV6crT$c)IB`xKG zE2UL9$mSYxT_FVDvIBa`7JI&3Khf#cBxwZz&g~dg3+N^CU?C%k3jD=-;60AjbFXk0 zdJFeug-l2auyTj29m4Ni*2cjZKGMSZLBIqY+~UV=qwp&~ZDS!LtfA+QFuSh1)JmDL zd|Af?wPjj0;~uh#F_osS_bd&9=4+(zM0Hov}+c9{wKl z+i2*CMD-rr8tZeYNm+5lYJmVBM>>2}%+M6N-OTx;H+T>U_iKa1TcRm-fFzlhmVv$x zajt;2L_!f=MR%f}A=E~){7OUb#kh9+sdM)G!5~W48~^~fqpY_)I$;fgrl{bG77kCM zTt!qtRjQ0E`Qc0~Wd{NHE=IS~Wy4fmoWz(u&BbCSepwb5$JNU?xQv|8K`KJ55k$>D DSQi=1 delta 1760 zcmZXU-%C?r7{@ykXDyd9e>8NiS6zC}n%mCVcDA#l5oo_O2)y&gG2N`i=H}eyl)@wk zg7W712c(-KA`I)YpbMdkf`l%UhzKGmx|V{@+4lajUA#Q+`+lD9^PK0|`}|qkySY6f z$VbPH9H}IWtC_`XD3?xU%DDonq~}AZl32_abIGi3!a1S0LE1C3)ZYwWl77Uk$ z3_KHhtaT3F2|X7XmoO?P=JVNn@vu)LbUBermeR#cGCP$#jKHv^56fPnX2yc>=>v-g zn=h%kZ#j)mtxaA#mkqpEd)xmDlxn)t@Ys3LWVc}N-R4)=ylb7r=11!SHaDD|Fx`T0 zcD7oq#P`WDjuLHzs@OUSwb`0xwT{~fHDm7}RH2Qdezp-xZ>Q9>gNyjVK`3_zr6OG% zwbMl?p_@`pClhhDk>bu*CnXMg7@`ZRy_Yey+e@iWeGJtJGj0;?k(*Ml5l89$gu2&H zsja~jTPv4`P&Yi3+8E-fze9wY8m82o#6|op5o*LssRMA-sth=OVd4 z0VJ#bpkxBfzdeL$O<`O$#qb>w>n}dDmKG}s^G!>fw^W-8I6#OMUdZN?C88XL$B{+c zmPvI022@Wgn*%&mT^%$SmW;r<+G|%$VVpBqqJ!{ORmu3^BgN`07BDNYyi_cSseFl+ zBH|;NMPNLd6Jqc@s-K8S$V)C_a1b3AR5%;EDnwy3cFR~>wOJ3&nh&e7rPJWPMuyLJ z{FKXIWg5hyaxe(rHJ6}4bNrmKUWiMA0)_Z!42Ll)tl*sFAlqDHXSO$&tdb8i<-WvE z4q<05M>)v$*Vute51+3!tx+vG7%~)d8AH%)tQhnMeF!g-4~d2R3KDC*NX{*b#;;~0 z1SMUT>$caJ1#L`re|2?DLT3~f)0t77t3xXj5>-$FUOzmz1eHiy) zP77W5J?uyD^ZC|4Ba>v13}yziyC7k(l@*y}lKlCR)fs>O{@Z{1tKa|E|Ni&ifAKeu z=kG4=F0SvZpa1NOFMj4f*VE^pKc2t2y}G@dKKW>$HO(*a}Z_`8f z(}{ogcz$*H!;cStzP-PExV*iYj{f6(^tadFT^?`n<%i>3kp1SH%kRH`yg#yU{%Jnv z+jqw|k5?CW?5lrvU)?@@b9r}sV@mqN&5gb2zu4j)9*#GU7v|e<-`zg^=@EA{Rp=ic z&+o6ly|{jNb$Ro{pQ&Bkjo<%x@%Hw^zhAuDqnYr3+_*bbrHAVDP%|C+pa1*fi}x3I zpHRf^M>NX2-TUL4X7~R5=JxLT;_6plCSSJr^5OXL&F$^o+iKzI?p7{2sOR^=@}=04;utYKiC4;1a%Ta9uyt)&kxN0j6f|3ip|SU{Ef_@FBVs z#|P|ETrhl>1LMKG6#ZLaXlLT%f$qcZjR1~!^*3liH^lcV-(y_b4i?X613>)VjLX~0 zx4Y|$%bVTVi!Xora<{v>{qS!0{nhQo!|wg%{pEL;SCFAMY-H zIG&@Jogba`?&10!%TXi?nvkUaNz}4~o{y%=aK(pDqeQBnY`fUGt9AECtzc1*HzPr7> zvaK+fi(G!cJF_SCuRrd7@eBKP|N7I57rUPjv)cuQAIy2K6%Hu=hr6R;LZ$}$%G6+A zO*L>Q4(7(^>K=lU4=CA`@t584>i#%aVU9FsnVUGkB8ALNRMk=&b(%IJMe*@d zK>}<5;bUe5RU{+dN=8Z281mJ~wNk@dsSS&7ms-i37`KwS7dy=C$ai?IcMibk6$yA3 z95EG9OexW5tw_nfC5)JZmf(fDPT7;7te&{0D-v}$bgNL;_~^SOuFkA&Um+uJKf4IE zsa~Tt_{Y}9pUMSZg$l>VX#__i4^L+OgE*te00?#jlj8lEM)YTd4BMI2@M8BBrl6Ll z3{H;u5;e))U83G&ApLsx%AG&XC%W+0pYXk0K2H8Do*YriU%-~`hFWVcU5B$tUA_K* z)6m#cTiEJgb};qP4L^U9sU{z>pOY58JKjHDJ)GAxVeEG9BTmGGK83qlJ2=%eG5FRb zji$@$*PlP2SM1uce*O9L+{*5Xz8%8(qHfK(sQg5@Sq)*EU@n;2#KgR+USldT|C)hd zTcAnHn-@F3Gt2Dr+Nyk70ojA5rR^oE-7nqcg3&cCS!~!Wa(83Csb;y_K$1*UiD^L) zADk8_kS_yzJ*(HuV;47{&Vq@=6*12uUbl|&zRQg2NqyDaMgfY$I8&0JA>v{%PUgwV zUTNwlHrLh%JK6dRn|aWU^Gx9;X43iD+uH|p%JJjFA*a4Ny#p2AcZWHGtkxY5=!N{Ch> z1P)58q*g(QRzrwZNeGG)1>uTO2%=31(JBZ*F(ra%pPvxu2&EvX%L)b2<_Xb;glN|Z zfeas#cba_T}AtSnV zMj#|nM5!PoM07bsba_N{SwwUpBDxe2orDM+6a}F`L}%yjB}8;eL{OY82wRLs5Gf)$ z1tKV>ND$AD2y}#25E~HDe5~5ED(MyED zK}it3f)Kri5WSKR6ekM86{8SDpAw>15Q1V#1kpb~A%2!Vs5AQXh??bN+Qh+atuijxIli_r)oB}A_v z1jQ5y;`s@Ij?fBX10ni6A^MOI{W>8Kk_e)3$uvlW7;=Q@^Mn|(gcw3X3@IT7i4Zs_ z31UzXV$cv`P!fXTL_xS>6oMF1LJSH*P)vy+hUX^)IzlN3>as#Y40%EfAt8o!LLej- zM5!JmKnyuR40%8dSwIXSAchnWg9Hd16!oA0#9(LcB|r>HKv0~l2V0Cr4=Er91t2J< zNDt2s2y}#24;uh6b1;i);0tZDsC;&0qnR^KkqY@AlC+oo$qtQbOh*1Fu ziYd~=^8*4Mq1D3%K#X}nj3FS#bwD5_)4O}OA@D+`RN&j1mPeCQ}K)s&**;msgN`XwhS4a%pi|vcgX0Ov*CEc9DBmP+WSU! z&(Q`6P5YTYK~B?No8f34j1Q9Vs{PCs_e4LApxQx30!t>^vwXN9w<&zMyV}pBi4vUl zfCx`K!)Ko2lvHk}lBu>6tU;4cW030Ri82k$;B+&g+exC@4^e#vm+q7#Jh3X6YXmt@ zF6&9md)m)9WLGd;i*ld#eVF_tq(4>rdA4O&!fc9bxzgUx67tN zv6{GX>Yn$mrmRff>=kB2)WXdb{s!>Pj04w|*#zC_ieX+95|eCqv#f?$ewEGlbjeXT zf(l{gvnRRxaL;#FQvzmCDls6JBZYL9$)Uj{Nr4JA&$e^dXYDlefVD=G&lU-y7(&IQ zDb(HdA}cw_%&2U7Cngh~I)&qC8YdDYs=9}otI8&0i6h zm6?p0Y9hw6dYiy?$|A$tx5zV4HqNuc(8+Rkm#mYhS1oB-yLi#!rd)j;sn~dSUncV& zGFP*?hpgF?U2a>x`PF%LAq%o%? zn?1Usq#9$05;{F*Sz;oql9?*CN~%q;tRz>SR!Ma&DXBKQ1C5d>ut-UDbrL0EE0sxE z6qICobxlcr9CmC*ucsxcp`0KrnlX{bzy3V-%c>8ke2-GESao>287 zp=_=&yIIfs+O1lh3QA97la#L374_<>t{AWUN~!Lo1(+LH39xDvun?61EByIHr>hLF>O8NI{cV@Z z02gHA-GJCA^|wSy!$+t*(&jE3Et|cU!|N z3M|qUQgsR8Ps*=PR(>YYU9T$@uS8uni@dUF_c-4fw0;-ZfabDiTYRg(u6 zQp%Tvl`eZduxxHJyITQRQ#N({BPEVzfMxTV*MwyOva%4QylCx0kb*P9vgN6TB?60b zz*WL3-clju_XNT+`SNOEQLk6Vl{bUHH*Zu`OqS< zY>u-R7Ukzg#G10Q6JceEW%Hv~gw-mEMfufQVNtLwELWaZSV%nN8evgj5wVau zd^S z6|cI0SDQCjHVr)1RhQ=#vh5dm)h%tXY}z)vSz&`UC7Q>)!qJ?rbiW98mLDs;qLgv9 zuJXKc<*9Wg@`}>qRk|wX6|$jEpeth~pyn0z>PB5H@~TUC)v0)eD8{SJ`zxDGp6Dvi zt8S53Hd9>WmCgS4x}wbGh*wj-dZMc=uWaV{3a@%4uPF0et1AkYdF9H}>IzBO0f* zpvD#T>NZ^Ui@53&T=gnkAu7hzhTWCTY)@pBr&Yg5E1R`0%F1S<`zeI7sAE})yDMbW zXJlow*jHpVC}~Am@LE|>uuLmgo>o>!5Ep1g8UGqtQD70Rkl=j^S(VU=dUczuhDBOg zGXgf$RJ0lbT0v3U{(NN<i@dU#@m^Py)gAF_O65;J0M!zU4 zo2Bok5Xvx*WhL&e;5LwvmCf*9k=3ZA6*&ZGWktaPq{%NONAC_h?N9%s2Ld;n5&1NNoyAqb@VAk+g4dvXF}&MjzdNY!Zgc2{1MVJT()a z!_>^Al8%N!HO&T2OwSyfxsDjN(TnJU3m6XgT1BtK8_hfM{H-PFP^`Vobx5#&M6eVi zF@4RtAO!U>h>TJ-M|wS(e@~r>r)Q#(?9ligb8|SW73ODLkG-*OV7KG?8gJcGMVSmp zcaq!oF6C{GtWrX{hfU`XS^#q_%3-q&yC0gBOGdh@u9*<{d+o4n^c~BdFrOc(s%_H0 zshU5AOJL0V6Wu+zhh%G;;?M30$8e%~`&je}X_GVdmH8sb<7{{yCz}XdCTDHE0)jG- z1!@{jdiz}z$Cxc}Yx6d^rHnK;TyaS>Lqzce072iF6GW2x zQvICE8ghPfoVgYQ3M#;9&MIbR_dsF!sSQ1X;B}_MN5Xf=voJk==HGN*ezBZnsZG7@ zxgJc%fuvo%UHTUrdrWm~%5$d-O4T9t-%PSRLG4wz1=XsKO{vkCr!@b$X4N=y)$w^> zQk{F;nccZpozJlMV`zF4aa;pYb%(s_e4_k{>MBrNr#i~CFHs$xAgj)mTB5qD%Barl zXVj`Q!9}Wrn+G+~6Z33R)nO}`-J%MrGrg@*o#lg>U|b$sy|?Z;W-epsv4Zm^32Z1T z(Pv&n9gA?21}o>J5RNXx<6+as_WXBrg9NBR2U&b6-QwSTBg9Q8ZbhQkeqZ2Y3w51klFhf4_n$T*Hg3C16okoM`z7h>mZ>u!OIOsK4Sx>i|1_cmS zN)RG0(O~$Sk&=T|mV;HEgRs5ui+6#8)iMXYO@g0%D1krLApI^DuRh@sk=3C0SXj|u zt>z$^G?Z|VPLMU|N-fbKj0)IqNxsFZ5)M*ukp|%~a1st0i;n^hQg1&&gDV{L_8Gom zYb6H}$2AB9CV#$HiqQKt#2~EmAcSMaq6obUg9t+Jsle`B*aA+T5U~hxG%rH-8`F|` zLTz3Gu3L=Or68meG9t947KtzeLb9~bf{=pCM0g?)qWeljNWHyXg!Kvtz1IdCib@dH zAqXcCZd#4jSrXQH64omutd~jX4H*2LPw#&Z*PWArL?Xfk5_dR(;AA!tYY<1XAoNBLYZ|mj!XTEOYGXZ83PO5i zdq#t{)FKULKuA^@S`AWg5eQ*(a1sro`${xOy}ccT%?b#;hX?C%B?ub)>yEddq#JL2*Y2w~DL=y(h$q23s`;$yB0*gLHzdL04*t24Soq za*$j#)EX@2ARG}+qrox`Qg1&&gDV{Lb{}jgDmmB&9DKrt(A!JI8f^0%gu%xm2fb;8 ztU-Z;PN4#GX* zBpO8bm2i-Hd%FhP6%Kl95T-#T2it&yPuLH7D~d#ec@DNK9P|bgq6WQPguihzGKe)O zau6mMSq*xxi4_iZY7UZFMTrLK1et@b)DjKCutDTtTk^{&1s7=$P79~eU>OIgx1XTF z6%KkE5jGT+9PCmKZrTod*NRwzT^@t*4OzsX_o9#`C}5Dx5h4jr&KNNUaWpSMEe1O^ z2D{SjAf1qrpe?mXf*A~wv4<9e6kI036JZeDSAs$6?d=lmRxsEJe<19X7(^WV;{;)F z({9ikTqF|AQ?Og1ptr3MCFo5k{M1AC2(bi33c^|=D?#sIu|mOKO+m82D4`&oAWP7d zS|UN%K!_CVN+?LdMG}O6!$~M;{8I{k6{X&Of&^D6=*>ykP*hT|4=4!rZT<70H^YcE z*yk|_JCa2VdXEcPg8~N0bRp8YXzZ4dyx6uW-;CVu%{_ z_7?ue$#@~wpvXaZc4Rf^y)jleIH);D<{Bj$q!VNgx>8Ft2!jccgMA4HDY!_3aE3Su z2aPdH0SBqKpP<1N4tm=YHWZZ{98wN$lAw3lh$T4WF$kZNMGSiH3|WE#2Fc7JlHlaz z5n~WX^Aglza8P4#DBTUx2^k66Qi~**!5|rtXfa5^WfD9Q2GM;b5~SYVF2P|1gM+Xe z9F!PD9NP^N1~=^ny&*>;!8`?r6$*Nr4N-#LG{a9lWakh|P^2KNK(Z3_jvFf!Jg6y1 zmK`M&q!VNbx>8Fd2-^ygf$))etdI#d-wJnhbf`S9hqNL<+G5v2}P98TYD!DCJsZxOwut*qkdXX zIDbrNZ~Q#N*#)>?2nva6W!_Tj zPg}^$Bi|9ytUBqqJ}`Q_8#4F}laA4d@%v$gq~qGViLkrFl#T28i~DLILSrHE4P^se9Uy&dv;zj$!uU8-t}E z*yrB76NXPZKA8Cr6RAJZ-IGra@{Sk&p2&+qopju;CLMd@3|2;^OMe_Ij&V8Zn0YBM zoW@DV-e@BRIoV)%tshuY8B8X8^Raff9mQQ0q}FA5q3#sYaQKkVNc)9&EsdjDkjMTA zhNr;<=!=_YKR>es_HnFBoD%`R>4jNjG$+U)AJg}5vxdwh9UHrXpWLfuS;frk9w=<7 zQYLsEgEp!@?qx(ugPQASXa+0*GH_Ih-W6#f4qcC5?mO_>4k2tn?o>dp^V3n$4 zOZaHalVOFunM0sDKB-HpW6!O-J7;qmdjj2FA4$!ah~pZVyG&F!WL4L2Z->P^k8xD0 z4wpp53YO2)2^rPdQVW*PxL!teW_zPnoe3^e-FPC^VSiY#d>&12YgFg>FgBbI-cBk& z&phlJ!P5iBR3bESi3qo7u;Hd3fdcT2QH9kA*C0w~6LzY>hI@FV8f>^5hiidX1~b6W}k8p$4qI_ zEI>b%MI1!E@*3o}9?KfEL|R*YHslIY!a+JAqd{A0i3Z_esO z;MChs(BKLOxm%0XV5Q_B;y4F^!1SpCod~%FNGO3S4?>u-ENuZBZt3A>AGa87xH*Tr za{+{t#Yikd9L<8T(t@y3gOF@NibR+Pp)0jWgc%T$JBo5KiXMSti$Dn93R){Xvja|p z?kfQy_4alVRx2Rnb}eowDnVF!61q}LL39A#4&=}05h<2kTvK^Ez)2HgyfE*)gT2Ife^kGCjp@`m?_X8_4alU)+->a)1OA0 zS_wkLB^uncBjgq!kp}Y|tXDY59X%us3LGRWiHL)f#Ym#T1rBmsk7W(2IY_P`B^;y^ zG8(j{mS_+z7$OJB97V0cVh+N#;xrm8;~>VsQ#e?!aFDyTSR6D;4kC_e@Ch42?f?>M zu*q`}o-B(TAcYnBgFq zqi8iq!9^T|ZN*76i0&)lAocck4mK+skO(aBjV-lAgK)tRIoOo^GD^W^ z8axpP(Wylmd>RLv6%KN@7OTNl$w9=$9Ne@W2q|A_>B^;v^VE_mxPHdV4zt z+Z7D9!gjD#Vi0k$1UKylx&KEb!8`@q6$)}c4@rUo1<4yCqTu8&l1OlYg51<&k%Fz| z(JBSW6Qo3fbb?GlS89m_;ejDiuq~k=1(!+iL=;4)7D@1F6l_;0$h}%D4LT(S5yvD5 z^=UZxk&CDY!_2aIH8A2GM;b5~SYV zj=_EfgS~*kUWq}(#S+}K8|3~Ukp%M;>{lqr{X8TI3KS%7h=_udzepm%1qyOgk3|ah zY6_AkNQngL1et=a)Dj8814E=>UqV3&E|cJiD2PrilHk)Q*mDZzl8%w<6ukb}y@ipo z$LJq7irvd>o5|+IB7_WAUY*_C-d$f@U4A|y6Z8G$5db%=lFqJkUr?^qbOv>p%^qte zHw{;yA>`xv)#VRAKK%Li{_^4S_6Ab|C2zVI^LQe!ln_7F(4ApOIM3@wK<4$yyMIj! z!i~*?(w#}f77Df^&d~T@pPkLQiHp_yh|Gk=fKRBuyZZ3r#dOhM?(D@E zPyQU99DbrJAejkAuP;CD&fZ*IT)*47TAy8C;2=$M)BtmVJD*M64BcFv-Ah}a9qaPB zTTEYkb9r}sV>;#!H#g`M3~_rV%75i=5cVivqb8zRe7PS7rbp zLCF@08)hRSEPjf4X#%D{v(djV=jVfMqc0D*-~4(v;{54SbG8_pfT9V3k}_Nm8y-+| zzdxU};}TDsVOohe>G_AoCw~xk4ZOUXODZg2q>T8pxqWAvxKj^1RNmB`D*x5gtM6_< z?Bda2yXWkz#^l0==)sI9Tlu-gSqC>*6S~sSB`-1kU0*<`mls!myvMp6O>C|}m;Gh@ zr5POu)GnBIeLGA>DE9J`1qzK~duYIl!Q36M@MJ0@%?OkGi9MHmNc?;-O@~40Jz#U4M6Zya5P4OcFsY?Lgz-e4zGW&2~Y7pOKH-#lJj+zFTc_8tE!x$eEG zY!3@=Q=6|MV!#EW25QM(7V$=fA(Z_~CcASGP3fF;PzAA_(|^ NuL;_J`SQyz{vU3i_mKbq literal 64496 zcmcJYU5_KVb%xgn5F?8KK|XGR+$cAO+MelEktL}Lh7BydFk%=%3~cTjniu5!pKlIM_zu6Ot7rGNG>9Up%<-0$C-n*MNm>u&lluDZv^{q57vy!zwa@$o;Nphr`K{^9BB z;pWHP&E56k_QRj-xcH7g{Iq*_eE#>{-3o>Y{vSH-FLmi9m0r@*rQ84e=9`bZ`_E9t z;%5Ku@N{#x__%+o7ay-~kM}pb>tBD%yxhafkNZz=kH`CWUA2U&meAD_JzK&w^W$Ov z{OfO@ZV&IFy|@qk!Y`-F>(Ic=`|WaLU)6B;u>9&p-myhY8~t4#vPH;pEtkT}w_Fl0 z=WDVM0W-EU-*A7ezRC2(OrJ}y!Z~Q@bdX0cOTG>zfVu^qvHFh!hP20K5Kd( z9p6XK_jv;y_8r=w8*JbP*ZYTu|NLnOgXenu%4|Mrxw;(3R}1ss3)`zV$K$mdiLJTG z;r(Li-n6;=wD`p@+{>HG&leYqKSPb`3_xW)cp!yH@d&7@R3s#+J!K#~D;NQ44 z9iN*!keUam+0^lu#s2zXKR016Y2IZzv0P0>OgYlJ(Oj7ekKEAof}!bP#nZ7FNejo^ z*mQP*`UZ4eW^_U$GNaS2(C~B}sU3dI50HIhafCXnlX-|b#f{NgGDcQac>Q!B0 zAJ>}jRxI(3Y8-x?)^H?q`ermkP|j$QfWfU{tNHLwBm1RAhnvoBd$IT>Y(l-=G%!Kt zTPQ1de+#vOrSzM{YybXnexomb`59j4>xVagVc#6lD%`-;juu<*Zm#H#qPojxcq0t= zG#ai!utS&@$rfOElW8bkvtN=izTZDQT|ZtayJ;*I{zrHtZ0b{S)NYR`Ww(bgqE@Nt zLHzQ|Gt7)TU#iP5U*?fU_Y7k}_YKvXcS8pz(#@Kn;{toaG%lvh>+TY^6!TxR9NZ{q zuEzQB^E-1ezfw-^(}~DkG~?}V(k*`FZ%9_zbcAumX0fBrg#nv|>xx?OM9r8E2l2(} zzyd->a96XA&7QWq{k$YwimzhcPlAFy@x#O!{aYP&^EeSK({iS!uvf&@zvM4Q}yUm~y)dnVo1EPsEqSYrm91kQc7xcZ;~> z^M%_j=Uol!%8gsPSb`GhmZ!$L65s@rC}GvA1U)OB^he{fio!~8+a@~9&z;lrw#F$z z&wGt4YK|y$tTpV<=GY!JV?HWVCFpr0Dk(uLffBSoGnAEJ%dtxE)d-ZJb)p1qPLmZS z*fK3j(CX|;fY}i$0ZJB?;J4RJ*j}|8eYAAEE;J>Ct`h=^B)Vvq1qTRiAMKo&kt}o` z5IWVo2ZW}8&?zAFnv=zvmxTZjdMlBI5D?mw<7MHhk;ozigcbn8mT8j3`2hj5Bb9}j zvH~EMffoMMp*P$y#%-Y#7rKrMD3Zvc`P|fVwCHoR(0N+)1zPl!7JW*Ko}&d^V&*7ra;iAvuqA%d0r?}`-T=X0+;3BIF0WNyCkC&b&dLb@sIbIj88i_7aT=W85 z*fLGJI6p36BBZ)F0T+D<7d^#AU&jR$Np;bDj9PQNSm$`r=XtR%@M2AQu}*oh=6C@Y zIbEy;yjV+ku@>^emSc6{s}bm8o$_KW;Ds&IqKozUc>xn4)PX-4 zz=bW-B#ZOo0wzK#ixY6MF5zNLaj~xB0*WNEXnwlbaJ1OuXtB=IVpE{ShSFk_(qhBW z0xoj0*a&E`kRL9fQgXG;sjc3O0?KeT5RgHfFg-3nh#N1juzV-EjD>tYzws5Qd(?N zT5LI5z(r0LTLCS$5?XA9w6Nt^S@>!Mve>4y*a~Q2%e2U1dwyELLv0{+Y&9d zlos1MEucs&i*{9Tu-N8cvCYF`TY$xu!eX1kV#~n-F0!f+z+&rm@e(YyLRi>xyeeEZ z5>=$I*a~1_%QUIt{IGzDkgDPYSZqtM*iu+*>#%?#u_~IMEC!AhLyi^OJS&C*D+bDn zA!WtDu>vk~su%>U7$mG1gsiaTSXKCH1gaQPRty4G*fK4u7|zcMm5WV7z?x* zDJ{m779&RsxX8(36wqRn&|(zQ!j@xY;j0nIVoYf<3TR==w8&ySKP_M)gtD+x)<}!7 zM2nHqVyx2wio~*LR|N-)F$aq=4~ww?i;==&Okpu{uz-uKDg>|?-7a2&#VCY@Eyt_E zRU=VF3X4$y3tOg173YTqOoUVwC%|GX!D6Ja80)ZrBC#r(pDel+2Mf4rzT(P!RS&bhoW!MnyZ{Rx|M(#P>tXlgK#TojNm)vQ$bcBp(cSs z;6BNhX<_)F5uoB}eEIK{PlZ}U0_{5c_i4?P2xT(OUPO=d+t=NSG68-z%Y*q^A&kJh z0>g{J_~LGZ9h&Aweu?(5yufZWoAt1t4}IysTZP#{U+N`(tJRDXV!2vboCN<$)`V%k ztxsHn-D;+aw;8|{XgRS-Ag_~g15lgEJSz0N=G|%rQslo{MFuSR89T6&#?2ry&GtiS zm=e4dT-ySYrZr98ZqXQSMy+zI;KoY)Sf~l+9>kL6OzS0z%}J297%oFYd6_F&De!2&>+}0-J4KP{FlwUZr<)ud(EzG z>@-o9!errs7pBMwgiQrI zyWqO%X&CQdKIl4kP-R!VGjsAb^v-!RQD4#%E7ZuypA8%og#Ci&wF50_Xmz?=E zqbFxd4Si9}G1r)R(_=1N&FINFS0{#>#Z68HzHP;$E^1P8*ext#WeW3pQm#I!o)kLt zqUMleZ>cG!V3VHIIgY-Go~)gk_f@8Pva?##Q`p&&t*le-pi358z?DjHRq`LB0Vf}( zO!7KSUEv5!Xr=PBQbk%RZa)bp0OilJe#tYmQY@|DYEE4;S}7r|R12+a;f%UmePVU7 zv{F)9*@A8AdJ$T|M9FDoXSJ#>#4hhn>y-N}Ca10hUL{X6QWpa+`l*bNUC!AYvx}IU zDZ5mWUC!Z5IvmvHOwOSznqe1fbndKe)}7w5>%Vhm=L);L5ji|EBIiG9QVYBCzUR)@ zCsh}AKcnVI*(G#AqqE>yY|sh23Qp*hUBnEXI}5tcXyCC9oua%ank=@!E@z8ILn(UH zippK{Qh8&CLFD-*t**A?Qp#@%f z|8(c;6U&Q*7d28Bj)p=vHI~X5@u`gU~3i3cPdzuad(W%|C_LB(IashR$gn z(~Fp`BY73+=HV}5xdS}5l`4v zaEYhtB1Z8xc6q-zS!_XF&N7aMQp7H59RG?3uXTo9#6M2ekJMFUm-C{N4hMBPJ9_8}<4EsVOS-w5QJ1r&SJ>q( z;}v$L=Jdjn&O6jQU!PQ6*r$$0NXjmuUmdaQEQa-jT?Nm2sxD$%Z)2Btuam_V)a4B9 zXedSOVr=XuJ$5-Kdm^s(w3GfKaV6+teC-`;Y&TbP;*z1O>~BX?(1NbK z&%N{YiN(dDiyGcbI&VhT=0(s|aK1C*Ivri!15Xwk5?6w*k`o@ye~PY?p1PbLJ{A|T z#8Yy4Q#>m!=Zh!(4dQav_|Ox^9pAC`cyl!)E@zRikjvZGE96Rz@`V+hcguIaKB>5{ zXC94^lw3mZJR;Xw%<~Dk3jX<2T*N}(MlSE9CyOnJ%bDrXP>RS!E%l(QQ-9sH%{+Ax zYduw$H`nv(Dt}kQS?p1VnNJK^n|+6T_R%MXTN%2_ZhO?E7IfuZ_nog#tS%N^)P7$Q zdNaDVFM_Uu51&!j>FDx~{G7THbd`MhX#NShCUu>3Fm(R>m|eu8AE~SO)a88oq{D$- z&Z-}}!npN2)~;`^X4vH{`xSP1JAH*+sd2xsr1S3m&etbZ7xwU@5t6b?=;cT3I*XY< zVOPP=pQ?*k`rFv$o&9971$H@eKN?CAyBLfAY2wPDix~Z>xV+V$MVE8?ll~%cB~M+9 z=f7i3|K@5=TrzZ(z5i$mTF{lx0O)*uVsWwPqG13foj0RvcoB3JQUMroosKS_4?q?h z5?6w*Qc3`t{}f#(J$1RPfS6n)E+7(Dkz6h_fb=(r%f$wSo-oM)9UC2Bu4csL;sYw= z^49(exzZ4U!ivr(33R?bskm^S02(1FxrDg_h+Jn07D&id$QDS&MdAezxfu6_3l2a- zgKeVpD~LXVAo7{H?~aF?<;a1L511=o0eLkt)}EYRV(MO340829H53VNA1#n0&ReiV_iL=R^~)N zwj2Z(xL=4PAgj{s^U(aTprg=;q;TEe1D-xVi|09b$EO1`eR+pZaz2=5J9vD^C=qG< zcJr$bX%B6G{!K+^Dq0NW+|7DZ#o7xY0@3#_vcC@CQbU^!GB&QmjHzF;FbWK%lijp*TsA{sL4?#gGLN zQ<0=WL{h9!G2}sHq!I%|MZfk5FuUgt?kmqV!48M>^D%*b2pbkc9HJHYqU!#W+r)2t{F} z1Xkh;L9rMr!6@(C31Na#YLaboKU{j7A4Z$2{d9YOcbV1ASIqDeIj9E zF@GXeVw6D9%0!exK^9|RV#uLDLn~w=&7%0K2gN?iM3P5Am5A~vSSE%<3ex$&#E?mW zI?p^PvZ)k`q*6o=iXoSxrbO}Y5N+H<%jq3p8RaOcbVC zASRwE)gn=1G1nqxVw7w__A8`4_~r@vDJT)8Tad*Vlo;|Y(9jB*$Yflc_?Q?%E)pT; zzgB}{E?6XnpbOG>Bt+&hkqNs{Y}kdlnirzmkn3#{fP`=hCA!d*mhhLO; zhh`+6DF7oCVjB|eY@d!q6of$*BN8Hm#Bvx05^RdZ6Q2@89!4xgl88ZxxULW}WMYuM z2O)-3jL;`07eleR80KnLh#?uHLPVccQ57PWj!|6m`GgGRYi$uCP02tb)|pc_m7b=z}flN^C`9K2AgVTAP%ZL1G-LQQjV!k$9$HjZ}$k zNVKzkIucR923d?qi3}3UAsa}s1c{RpPduE4q>WgKBx{2*5oK+#N(^Zmr1L?EA#Wpe zib>p1Y~qHwnpI-R+^8_or(jf-$mMPn7kxf^L-|@;lt}Y8(1^7#QJBJkn0TfXjzo#Y z9FCNUQ4&Wh6HyumS&Tu6A&&zMt&oXKCda8l%zki6VmYV~Q7i{9ME>jVNQev)x6B8p zY&eG^;T+Kiry-uBCPeWEr#5w?<%83FOouAPbdV*6KRDfHkQj$`ly`?_B%Ud-BNbvB z676iCjzkpPkrN_=#Bz8C5^RdZ6Q2@8en(71lHd^uvGSA{GCWA%gAhZCN9YriZ)wYCtErh1?eYayaA+XE5tOxYfZ5R2&^DG{T5 z53*e`E})Rvfd&eDrRmqhQ3OcjmvlxAe8Y@iS`Cq3npqyiaT#36YQQA))@Zm4UlLvh zYqb4#>vs!$foQ<|MO^P+3o##P49rHHu|`8}LTj`d5JC+sy!~aM)@TJk7p>81Ku?jV zndU)|vqpzD2EhjVAG(3%xt~00jfP60RpD)gua4W~6N}&JFD9Gs&Q{kRv!xHIH5vx- zV)08bHc+pctkJ!| z8XbZeP%Xl<`AEP2&VFD8AscKzd-_Lr6^Uygrm!ioALn2UhkCygk#`+HxouGpF;>?DMcihKVk0 za<*{Y6sChU8d4oBD*EO6a@?%?&HnXjHN1iv*J?cs<|kkYbY!K+)keX;p)Fu9|1Hq$ z+i4G-{u_C2VftF^nRd1-r*kW9zmWK6L$q&kTdDB7eIq%J^VVpg_B0N}Ab|z&3e2qM zEhOHAUk;CWi$^=(+QM!Xai%7Hdk}n(>PS3q&;Xt`Hy1zEfH=B z1JUqgJiUR{UZ}M}dvHJ28V$oN*WOgPMSIZJ7tx-Xz6R}0vn|nHSgXhy4gJnR$S=G! zAw;ia7&PVZ*K92YqtB?sO2j8~OhHWpLa-8{e$+coiTpm~Pa1laQV^~g!o@ntAzrmsnfX0}C23`gKV4d^#os|X7o zih7ko5w2Z+d4~09o;a6&uEKG{tC)de^dXg0iP^XiP2)nS5-Uus#f4}lE(ETnN@U|g zpk;X_O5;MHI;j#{<3e;kE+o|IXE(FP(5J<4Kc0zQ3lnYOCMCX5T!@*z79~pJLZ-M! zR*BWP5Y5Dez%`i?qqq>jVftMLu@tjVqA?9lKc-l#! z=#x9b$4`7}mbUR9EyvS*UI=u2-T<1Un1NzTUI@$y>~w8Xd?6^d<%LYMo!PLE_~1Z= ze)5k}(C-=)nY<7!%nLE)@bPq#;)&t>RG!qvB*JMnjaUoyzps2GS1?*|-o*<3gwsD@?4#g=i)&1g@n@WaC1hWqBq_<3gZ1DHB`cLUcYZB-Gl% z#7ta>wh16oCJN(15EEZ0F2qb<%jr}S7gBgmtj2|CCN2c7$&|>%g`D`9m`w}OG%bV( zv62>|YiS{xNeh8%j1XBQ7SckrG%W%?qYh+Y$GG*MzDEkxJSLiC#XO=R5lC zSaUV|$?019l<0Fis!xeF{G;V5F`pI!9Y5hIah*Y8OIirbNh=axC@sWHUy~BQ4vE#Y z5WQxQC`=21_hKYYN<8s!nvDz5G%kcHvBJb!T!?1kLf~4;L^du2T9#L$G%f_HlQOY2 zE=1?!LPD)AOw7cEXqx~cWuh=H1Tpc2;zG>ywJ1>%7gAtiH7-OmaUpO`#zZDA-8`76KhV0g0Oo5?j(j zU`|?*_(EwRX8M|h_;pCEriJJYgG6Ck2)s8z;)!R|Y*>hsby6a>hK1;SSV*X~g@~E35Ey0{F)0y+VIhc!FBBGHrmsbarLYjj zd%#40=q<5E13tqy;YgMU`mUU}pTe8N*S<5>Xj8#=i*5rZFjw|3(?9J0*#Drfp8G!x zthW|}?#tvh73B5u_IQ7@yFPr`gERW$VGmz^H}~S-Z;cl2CHw6u_jIba7IyyLW*^4) ze!99oeE8|{PsfMD_-Yp# z;%{p{{9ML2f!Y_Z!T4?aI}IIww|Ud_cQeN0Fkt@jFi(WPV7l*rm~Y~0pyTGkB3x-3 z5%Ko;uyl?7{_$~t`?NEo_T%00@jsp(_xG32*6Y0Lw*4A@^*`61si2!W=qoTXe)zBZ z$K|`@qxZhSzTZ&|&D7TNAYUsae)VI@w3@DYC(_!HkqT2tl;deOM_m-7mpzuoCyRi*=`{k8+Y zoM!g!_`HZ$gkRuG1$&VH08T@A2mIukKTmX+WQeChU0PqjPfu4jJCN&Pcm2l)I7Gm3 zm^;|p{wjXatdL>e()p3FWboawkg;poUjmw%{-GvA@DJY2qX{B7u<00KUzj#WIJ6)r zSpJdic1p$Y4KUlD)to8hjZ9OkU^&~twrg$o1~#~KC%JiZ*xv#qo+m9qM`o>kk6*C^ z365v;svqB->Gso=O0!^*L0);DZs%|R4v*>phR6$hf2Wuq z@Ahw>u6Os$ZRtz#eIKT_qD9u5jE_l>QHNmd9UcyE4%dgr&sQLOQ_7wy%~1Di^M7Wj zdYB6t<(;jc@-+#JOFiG9zcC*#ig^pI%fIpko@RMEL sa35HKvq9agybsq`zrWvo_}%gPXtzf!UVEA#1&jyIo&o;y?YH0jKPVIil>h($ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_omni.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_omni.bin index 0e84da1b256ea1911bfb7569321bfcea2de92a9a..97783d626ca7bd36e0085e6cb588b345dfbb2fc1 100644 GIT binary patch delta 1648 zcmZXU%}*0S7{=Lct5`xXwiQz;Oofsyl+xLjmQRDBlztHLu3=rEl*U49TMC#E#RDeB zi+PQjs0mz5JSl2Cm}uh1!RSB0MS};!!FW+58e`(NGt=E-5A3aea8QwPl1_qE}2iJ=PEJ$;u`ct z6R`4B^fNKe#3jC-)ZF8(M7&_)BY%Xf{NZgxH0r20!Nimf5p-48Lc~)hKIt4}<$%78 zh#tL*h;#a8B5pA8LQmVb^~VURGen7y3^c~FAy8U*^4!qF5%zoE2eR~j|6`u0%f_!% zL!Q~s^qLV2|{uJ&KC zQod}{vlLFe8ykWin!HZVr`&jH5KpoXsxQocL*mjkICLB~+F zD?gi2u9M`&XaEV>cy2zGm%JkCMA+~4IQxu9a|K~==#ia}IWhhfyQ3YJkY(^c* z>!1{==t4FCr-LnKHL}_SpM$nT-D+V5m7>7IU?X^j{bal~!w$GUY^v>YX+puqaGLXg zJ=9<4aiX>|5j~I!1-Wk62#xW$2l$cY;@8T^cnf)(Rqj>9+P#Vx3}L&m{Mr*?EPSL< zbT29+V4?SPh%ghjaTr#^CzQYM!tI<7cEbH6xhve{FP`kIyoiLdf#^aW<#aWnaX@o? zWCHz>26zy`a4T}iBnX-G0uoB&lqYh6@`39*6L_OGm*OJKOS5u5o=wWBn5_IiFHNRX z>1^?goKDn^1k#BRtVI2GZS|BUgXncHmdar>8mOqs6`d+8mz>ZU%kZcT)?&EMr`?O_ ggRPjisr0i;q@++*P7IaeEGUz}Zcm?a*=Vf#2k>GPr~m)} delta 2086 zcmai#O>7fK6vwl%187C+P@5zKj3*GIO&k`_?%GL6Tt575D5-kk64hE_$68@$jqNxN z5)G|coRS1b|Z&g*=N=52{OQnj!uFZTbGT_7dKRdto z=KbGjXKsHfT>nb={)({vajvJQsn^zwhlnl)WD z>qf&cmtP7rimgS{tQGJpi1iMlyaMSE>T3zDD`6XH8pYLFab?+9vK;X)H3VPudbf0Z z!?oU#b*=>(TFEb(WwX{bRJCR+dZSn~^zsS)^+=&BVy{87)MrJQb8RE#WL${IvTLm0 zQ5jsydSSyQ5@6F6B=Vta;stg`a`(WCt3%wqpF~`8``~@IhYiP=^uc}i8~pIGJ4%KJ z`-X|k_DwyPH$Lo}5yMx6{gR{S|gso?{R!jgm9kSO&;V$@*BK|zR8zl9j}-$4h} zk}36*%&1?(1-@Skm{Qj;qwcC4wG)nMIkH2aX^i?d%B`3uL}Q8(pUiNC55&W#2(@rH zNcZrgxe{NKJ2p?K(=kR}JmR399--8`N1q4~IqLIRhX+E9O4T~+@)&F2k%quLz71{+ zdgrY%H>+Y4LlQ&LA%vrHc-%&~Z&YR3B3v}a5!gJwd$cC#=FZX}_Sr&Ga$r`7|98A`r^V@oiDyR%XwDRMA_^iK4>g z%<#+VacqzhfnPFOvb`0wh^SRj#jq0ESECe`!;^?S#wU?fHCK_;?zVoWE?K{}MhI{g zg>%18tL~az0hlOL63N6w0eGJgQs3(tU(lT0%(+lopl5nAFw3`@ zwFk_oG*VKsASV{Xu^BKMo|%nxSsjw0&#_$)@sLPtb zdJPe7D#od}rZM4|RZTq>8&rJK)Z&$WjTwt3EfE7$gtP#oWob zsypm5q+{V})Jm>7=+t%Lq&Zz17AsV2=!oBrt`(ySeELA8FqX2Qn+<#VknzS~N;r;YM+7M1@83*p^I zDG#tJzR42aWTo8Msp9LMgqL?w&e~M`p^fn0Hp)$0i1t5;XZM|>OfTkHHM}97!u-8R z`HvozcfvuuUppxO;#6_DcMRvh=xrgh-*(T?y^T=nJA?UppM~(R{VE>v5WeC0!@xCn z%P42Jx(ooMqH%P)B*6~)0GpUfrXwjy;6OLvdTcl%|2YdZnBxRhDtd$C-UeJtzqcBT zt5n?eHk(9bo|Yo$R;I?tt+izqFT%&(xPcVFaU%5kj^X51Uprj!RWTxb}WH$rk z&oCWPp9Li66Dc;NqySrR?kZF+!pvYy!#Ux%L02W` zw1SQTb3$Rr$2eeSXpA`lH;1mEr+;|79Zw*)b3T~2t4F}w;oIRBPkvNXP_bG2GQ zCrZy{0s#Gio)&dw;m<%^13KVLkgE{XXNS6Y7!=S4 I^D)@;7g}u?C;$Ke delta 2123 zcmai#O>7fa5XafraoUJLB%46MiC=HK5?_;Y3d|1uf`OSac zoAJK+^t$x-4e9omQg^AaXV1Fc*f45qs9G)=?P?vZmy0S|U#Xdms$NM9@8H&myKXj( zmSNU*1zP1!(KH(+{1T#TA<9b-i%?%lXgdKfixH{l=S?7kY z1`c6%|G2mD)ND6 zhz3G&Odt-xv#}*gX$KE5>Yed2*YUuU@pmaTahOvvuZ`OBGRifhd(Bew^mibH6QPJ;10(0Z#q&hK)KSGwN%ZQ{T+ksAPyy*Fv1SHD{wjVMc9+ zIdvma66@v0j9SH<>Z&&CUzJfy8mHD`wv0c=7!{9mYI)v9J)K{s9hy2Z#rl|CSfl&8 z!^|!3$p9lVrvzdQzCHCG)j9Ike-b!PxS^eNgFor*Hp>_y$$VV@$3i7EM+pd``A*RO3=vwl1aMcDzrxcUg`o*M=XG zJ{V8Ye?8nu`Qb{+zgNr*htiWCo`A{3;n&o}$nl;S-73`60cX){%8zTB49PVY7 zrFn2=H_7wk?73sRWG8cjS5Uz)l$%OYl#D2a3zP97kV?2Cv{A9kDDYu!Lc;J#?rrjX zoC`@B{FPe}OR2z>yf-RW^$tIyqRgTQ>9=qk9J6)5Upn|c?}ab&IMZ()t6P-pr)m(n z-ei@DPG8JYoJDfoyols}fAsTBnf&@TLhw%>W6Pcq2Zi3-#`bUucQ!5sQ3$ah8Qx!v xO$lSAByL(!!<{}3w-)1~X44W9x}}CUz*VSAv(PEv{hCchgZl+lio)-O$rqJt)BXSe diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm.bin index 249555ac26eeda320bb5238d4bb336fbb007fea5..25450fc12ac7d4090066d6e5c2cd1a953b251dbc 100644 GIT binary patch delta 663 zcmX@9(xb9Ln^EA700To=Vo_ygUb;d?W_reCTSiG1Fe8Rh4#H?)6o)Y8GD<-hdtr>b zj1mx$-;A;lh8z==;Rs`-FeyN!x|meBKqeO`l%*z{Og<>sdY2yqL9 zcv?<=VhLP>B}f9UTftVLG(HFD){=ny;>?oF{5-vi$|__f7CUChF#zAgu`VL7JgTjSL`C;2`(sj)Z7h$89QWt^-qJXs(H7 zfaNA0F=znD@L6zKfTh7kB=Bu!w3sZy?*TC=iQj?C5+S>eKS@|aqaeRrK?Cfd#H3;k zAecOnNqBO&fUJ&!mV!oUd~RY%YEfolj&~xEUmBmBpOaq%^1r60g0_MNM5ltn<0k7UeAL7 delta 760 zcmeBCIjOQin^8zokb$8rv8XaLFI^!wH6^n&cd|93BpZ|&!6=suVHPNqr6wCIl*N~2 zrj}cCmF8upTcr1`rOyy59&dsb)&;TU|4Ff#`9R(PnsiUA#kYBE#0rpp7 zQn3aQfY}NPlQ{(p4IykTU^>Z7EJ-cOOw934)KmcRlk;=(i}Wfgt27m~72ujQCZ`FQ qA*)USsfGryk*QtS|1xev3S&Kk9s@&JVo_ygUb;d?W_m_}LRo6Eu|ipVUVc$-VvaQzhNKBlvLv-4 zIX}NB#gKr!5dnGQ$*&o?SU~np{>>-@VaPIxLl{;}QV>QIlN7>jCJLqT$@w|?Mb=!U zd6{WISAyjx&tQ^;sNM}@+=DR~nH3;X>dYz-Mj(t)&8!L$S;nlz4fnr^!sG{<(vyEM zpN2@DWO0Hp1X&@B&5^7-nZZJvB{&L)yuBoY@t)KzXq@XZaRL=}WbqY{5)JGO3 hdKF;Rle6{AQ4|$}3_?*@sX6(eUNMt`)?`!tegFx$Djom; delta 1002 zcmaiy&ui0A9Ke^viF9>C9UFAYzUZ_sYZ_D9C6ORZ@gREIQ3{4^%|@_kVt=jmA_MP3 z-+7k_Uc7YlqIYkehMxQf#y}7cqQ~V&zb}ah=J5Eum(TaddwfryelkZ5u2Pq$rutTU z=(KjgwHr>)^`UQXRiSUTytZpKja>FOea&4xADi?j!Q%vfCU}WoL|5Vqh>!Tf%T%oz z^vo@<>9vhqujOn9RkNM+OxNn#ZO3Xpw*Id){;7mDSeA~Fo6T0DCp=(xGr|gDHNm=Y z6Hi|Ws~0ov(<5<-eic5W@b=tZaj+tVL~$?^F6g*_hm`HaCKkMa+g^JnfIa}FDY0lIKP6o+irSR7rL$=jDV?W zMh@6UrH4g@)99C?LQs$925mjG6JLkBKu5*-1tb zj1mx$-;A;lh8z==;Rs`-FeyN!x|mcTj4d$6JtkF%2q&`^gki}X3TAAc!pzGAVJ&AZ zVT7<0+0Q}5CV%C$s0TT+K%p!(*;t_@w*csectdk*E(NeJ(8Mhe;%Pbgi6w9imLLhZ zZUtL~()b*pu_Xcd#hE3U`FVO3l~u?}EPzUMHS+R{auX+)a;Y&|PM*VMzzH{C@<%Rp zh(F}GP1MabL0S>!gET{x8W}*OzyV#&9SPBNi`!JzTnDDc&|DME0L#rfJYvug@ZhuH zvH;72&FJCV%xE#$f!_mSQXjtqmnA~>7JrhkhDJetxq=4RMTtqp8bC04B9rjsW&v3p z1uX@Q()irOlGLKi#2oKLAip#|IX@@A2owOCnhM$q8W5cd3X?Ain4zdn0jh?1%T%ud fta`G#pgD@7Vvs>73M(}y*9vAZDQHc8CfE-E5Y5Z> delta 765 zcmdm?@>OMnHlvWMAOk~LVo_ygUb;eVYD#8l?qq95Nj4}mf>ACR!YoiIOHDRbD2p%4 zOf9$OD$UDG%P-1>Y5_}{D3rz*Bo-y+78??fH$s=6e34NCX60K(Ss0U#3C`3L_Rwd7wz%;k}cEQXkatgv#jy$dy z^D@(bt^~_Xp1~vwQN0_+xCdh}GAlr&)R|Qvj6fKpnpu?_?rjr=$@8=&MNtg~2MAE6 zK}&k_59ZSl{U=$RAPhlP2xD_3>rQ5{&}IqFbS4O^m3tZ^gr&%93YCo!=z_|=5!wWm zT_TbQmF1S$43#}1bq*>!L#7BSE1&?AJ*fnfovQ+soh+(hQ4jZuu|i310Wj*~&CRU2 z6cC|@5I0ANr{&})mcTVwfF$6$6>Ndwodb-Zl7Rf;%#zIfJiUs_Dr6<*Kqa~w;N&uS zs)ib)#pFF22ApsMCJSn+L&C~V(?s1&6QmVkK1ef6sU<`ToEm0pMnW|G(lnJd(}Alo z(?m1CVzZBy7$nRlXXsdPnS|4UK~Qas>^r zixQKHH8eCP_v;zzC}=5Yl*Z>KmZTPCCgyl20{PH12lBh7rh>MD21JvB!sL&7W+K zmZTPCCgyl25>}FeRSC!rxGBZfTzsfDO@7X#0COETvkDKg>n3l|6PfJG%mtH=W>)1z zmRFdZuPrH#!`8`xTGErRFrS8LUd-YIW4?qlH|w+RWQGcFe#4Q@1Y?JDPh*6!Kk}Hu z)o2NH!PV>#+5}gVCz1$Pb6I>dTuqnMIk=h_nIgEFOY#Ucok|Eb(JF8?lP{`U*dck> zSfM1h0GJ};&CRU26yOn+mXn`Y0+%ueNx{`kuG27JG@ra)!$1|QK^7p@2=x||UudYq z0!diYMAJeORe_m;E!=QRh!n)!$$6TQFpZ}*O=T@~;OZi4Ds?t9noZW#^?;dIsq4UFj;!LaZjy0sW`%+VD7R=B=o#oJzz9tp1&xCIas>^r zzY>#*HGlxjR#2F1u4iZhVQV3$$wW;B5FeZm^eQT=G!?WJ;F>`CCvOBM!_|87$eL0> lnxNrqVWL+7)-?H*p1C}7YKItytgv#jqkb`?&g5$Rtw_k}6Or zOHDRWD2p#itw_$#FG?}C=0Y|DL*4|7yfILJS!QavHCJg~W?FtxF4%gg*3$Tb#G=I9 zVncMlf#1DC;%Pb13Tu{~;)AflvcP>t;2Pix9ENf5j{i zF=?z&l3M_bzj$LyYc2&uG{D783=raJIr)htFbyWa_)&myj4c&xf#I72Odurz`Nf$f znfZBo6_r&;N=yuZN^~{yfU%u8xmH|_(Qxt-aRVN>^+4Iljp8Dc1tbI@o>h}D)-blz z1Q`Lh2W$vbiwQ6VfTX|)wpk()qU(`_iJY;e4#HuYXeJnLHjxyA21S6hIk$-cSOM6S zDbkymObjM_$ap{unf3Vvs>73M(}yx5^bT LDQHdpCf5%DCP_l! delta 950 zcmZ2u*J{6^mr>}mECWMXVo_ygUb;eVYD#8l?&P_Ql59}sE=Fk>^CqJVjQJD6lw^X7 zS~AHbL$nnrl%*ycE0o2TWu}%}bCu?0rsWsqLX8JYnkbaU7bF%X<`x?gkT*h?pS*!d z0_Ko2OtLWMTLhDj87`{NtN>FG%&Y=qRx_*cAi30J@&{Sb$@`eOVDe{}wP4I&%sMb; zAdARkI~INf7j7O%rk8~eAtN$*Gm9CF`<4af-p!n>ri?IQC$`g2=4L_mwM;PfA z7?mK+5Q8U2NJPSPZj~^RGcnYGD>T$ZHO0hWGrOc1+?$Hh=Dfz1U?otqlBG8>8Cy;k zm+^oZnJnYLV}Pt=txS?}Zf1po1}JH280Z=3D8L9!9R-bo{Bi{iu=5g=iZy@$%vMmC ztSD<}2w`gh(`;^HNorAMVvcvBrUHncoS&0lq*qZ{rKzB;0N123xlYzh2}yMdNHr|b m%=IcDsx>Bm1g5*!vI_D@N{b<;AuF$(tSwi-s55!4Tt5KENH=Q$ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_omni.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_omni.bin index e07d46d4183deeae44f718501dc4a7bc8a9011a7..e75b23cb1ce7aa4081ca2295a491f02b9e3962a1 100644 GIT binary patch delta 962 zcmca^_s@1iFQY(?ECWMXVo_ygUb;d?W_rft`HYe*V8%X1X$a#!qYQ+>$Rtw_k}6Or zOHDRWD2p#itw_$#FG?}C=0Y|DL*4|7yfILJS!QavHCJg~W?FtxF4%gg*3$Tb#G=I9 zVncMI^NE4!U^K;=x5V6VU#ViofXRJ_?TL6r- zcwC}=5YAg3lEzce14@Ie08)Kt(`(12)C vP?)@0)(k~;3Q#r7Q|5XVVAYcu<;+nO6@v^yQCO)tIb5!QNkMD!3Aug%u^Bz% delta 934 zcmexod);nBFQd>=Sq6r(#G=Z~ymW=!)RfH9+{tqpCE1|NU5wH&=1oQ!81pBBDaiyE zwPcb>hG;8LC`(N?Rw#=v%SwGpoWx&oFDjn7^2HV9Y=kk;!%}{0J`G z6p&0W3m-y8Wb$SfGZ^?$Emm@%7|3qOL1Pwo}7utN#=lH3AdjK&*VT5~DD13fJ#Ke0psDrI5-l7g$7Y$a~M zXfQcj+&~qZK_7=a+o&;+F=5ed`T zE@2{PVyFXGXsC&5iiyGIn-XGhZ+@0C=QXwjD}kD2D!qxx*mCkqX%Co@rZNsZ2FOb4 zWs;0@Gb=T8{ zRPBOxp<69G%gH%C0B+qkJKugj9{FN#wErtq!9);jo`j>nMRfb)v_LG2 zGStA_5v+b!6{Y5Hs4)q!uQkMmDvB%1+MVyt7EP3RzVEZNi|9Mx3E_GK9blrq)j+C^ yZ|7`Kc<9(W)?~R{tu^>++G(PF$66C{$J(~*#-lvESJCKJ=2GeQdq1zHX?y|U(9SXd delta 377 zcmZqU-ODpUR!EwSfuSt1s4_DzT_HC$C9^blqOJ@Zl;sO&<-%FLaMoI{$vatjEDf!> z6ckEw3xKA?8!Ff;q!lG5muP5c07VrPfHZ^wW~StqD8RT13X=_4RVG_8^09+e0{IVE zOeWVba&SWVP!%f}1(8&kGAn2+OcrF+oUF&>HkprEZ}K)K7e0s%Z3PHDS%5iT6wK5F zDn_;xY~=xFAy%*~&_aZ9?kw(bqtCIpbAwbs4Fp>k%Id}f6w{pih}B^77FI!3BP4$t a0sXB34+C8Ud$IwW7avptsG*jNiva*CNL-!( diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_hblur_vsm.bin b/examples/runtime/shaders/gles/fs_shadowmaps_hblur_vsm.bin index f08767e65581f01288b60889505c285234d92c27..5d803164d9c4a26b897c5374ee69a6b4dca26aec 100644 GIT binary patch literal 2648 zcmb`J&5qMB6ooTl7x55xnaq^PKl#;&6==kU6%P=Fw$nyR>nf8rZ4pn(k}Yq*hKmyi zm(C;;D^eF#uY7twU;7?EeEIa|$IsutZmhTa^l6U5ya2I_pE?%&({ZT=|A4LoI=U9l|LN6#b@=U`dF5Cj~81oqo z+)Kr3v%@V)kpw_}_l_vM5EVGmf_FTj8t$w^JVJOvLKe(`dc>7l-Kx{&s&n19N-Dq7 zKSc*E0-;gjKaYT$-68l!2);K8p=pL>Xg3k=)E+h-$3dR!VaPy(42&QHQ^*##Lu^jc z7(~|fkuuI{{Cpon4KXxA45va2rNeQEs*8Pyk%kxk4;8e2@= zfLLRUjTqyp7@LDOrj6WFZR}-CG{(e;F`0@n8Qn*mk?m9^eaS#EM7z04i4i3(Gn}md z4;@MjIJ;i}S}!;E6&T&CHpG7y(d#YrXS)vcm3{FO_F9v{nWUO7&)QRw=%iE0*v z9%)nh1t~rADZi3B4NCdyu2VgG>EDB;r6OhU4xcGaL{iLv&Lci2X80~qZwmL~J%KXk gT9@Iv3=W|InN^WKl-cToC`5@e>i^N{ciXo90Eg8BUH||9 literal 2845 zcmb7`OK#gR5QY_WC*%-ZN{uUUDC&ivs}?~wUG)HlU^}h>%Q6%{Q}m==cH0|d(~&Gv zlTfiJAb=T%{4<{@ew>FN-#+~L`||I`x!q5ne&+M?_&wip=f=UG7uRtPd39cGmaJIJ zSNmei4vU#!hv{x{nw4cW=l5>U3`u6d;0!T1BOII|@7?`o^;lK~d&-OLdQpk5j1pl& zxtg;gUu~G@yT4q<*5$F`k!)9Nkz$IaGCgLWnTM3SeYL9{1Tt#seXwfXJ@{ zRIE@@$fsjPaKhkuxx?`Gp9ZHh2I6D&c))p>@mNF?1_Ae*xOSQd&c?#$zmq_P13kv65A`*3C^Pjq2S$@p>wv9x>XUCnO2q@F zdB9RVxb*Fo;?j}w0cszx)ejb}_Vn5v0#ra?8VD>Egi8(5(Gmh`A+Xhu?Dq63DHRcz zCIU+p;ZlRtRz~{j25KY7>T~LOC=phFUIsW+S2Vj*SHAR{N!=H*-;Gl;2J9d7DiF=G z?srN5NF&~pxS)y?9P53o^4ZQ)B?3AQ`<15K5K$cPw$bPpiJ+DewWW--^I)28KLpj1 zs4t~PdzUTw2?{1E!cy(U`o*s1_mWY28Oc4qRPy?bcNj1l+4oHiBc+TP?pnc08!o#sQ>@~ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_linear.bin b/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_linear.bin index d7c6cab1d25ca8990c69bbd18b12e4c943480313..bca6b5763d8737329cb10c2a2e066f7b83f1e9fc 100644 GIT binary patch delta 42 ucmZo<`pYQg7VN>iMB1~8f#Dqk14CJ2QDtUcxiMB1~8f#DMa14CJ2QDtUcxn+a diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm.bin b/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm.bin index 459b9da4f4de57256dc94ef5c4fc9d32bbd39007..e10f6b04bd61ed97f815dc0b902620ced356ac9e 100644 GIT binary patch delta 67 zcmey#{GM6LE!cy(U`o*s28IWW3=Cz7MU|O(=?WQ{=@}DcR9L{YTL6Tf;|8H$1cT|x Hj*L41Cm$G4 delta 77 zcmaFQ{F7P6E!cy(U`o*s28LIR3=Cz7MU|O(=?b~2DVe3Y6Qxwxpe&~V7;BmvjP)QG K%9?D>xB~z_tQ@NV diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm_linear.bin b/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm_linear.bin index 5ca54c7906d36ec1aabd8aa9ec6e88ecd9ed135f..695cbd809cbc4934e6cb98e0a33faaadc81342ec 100644 GIT binary patch delta 58 zcmbQoJdIh(E!cy3iL_@G14BC_14CJ2QDtUcxT8{ zRPBOxp<69G%gH%C0B+qkJKugj9{FN#wErtq!9);jo`j>nMRfb)v_LG2 zGStA_5v+b!6{Y5Hs4)q!uQkMmDvB%1+MVyt7EP3RzVEZNi|9Mx3E_GK9blrq)j+C^ yZ|7`Kc<9(W)?~R{tu^>++G(PF$66C{$J(~*#-lvESJCKJ=2GeQdq1zHX?y|U(9SXd delta 377 zcmZqU-ODpUR!EwSfuSt1s4_DzT_HC$C9^blqOJ@Zl;sO&<-%FLaMoI{$vatjEDf!> z6ckEw3xKA?8!Ff;q!lG5muP5c07VrPfHZ^wW~StqD8RT13X=_4RVG_8^09+e0{IVE zOeWVba&SWVP!%f}1(8&kGAn2+OcrF+oUF&>HkprEZ}K)K7e0s%Z3PHDS%5iT6wK5F zDn_;xY~=xFAy%*~&_aZ9?kw(bqtCIpbAwbs4Fp>k%Id}f6w{pih}B^77FI!3BP4$t a0sXB34+C8Ud$IwW7avptsG*jNiva*CNL-!( diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_vblur_vsm.bin b/examples/runtime/shaders/gles/fs_shadowmaps_vblur_vsm.bin index f08767e65581f01288b60889505c285234d92c27..5d803164d9c4a26b897c5374ee69a6b4dca26aec 100644 GIT binary patch literal 2648 zcmb`J&5qMB6ooTl7x55xnaq^PKl#;&6==kU6%P=Fw$nyR>nf8rZ4pn(k}Yq*hKmyi zm(C;;D^eF#uY7twU;7?EeEIa|$IsutZmhTa^l6U5ya2I_pE?%&({ZT=|A4LoI=U9l|LN6#b@=U`dF5Cj~81oqo z+)Kr3v%@V)kpw_}_l_vM5EVGmf_FTj8t$w^JVJOvLKe(`dc>7l-Kx{&s&n19N-Dq7 zKSc*E0-;gjKaYT$-68l!2);K8p=pL>Xg3k=)E+h-$3dR!VaPy(42&QHQ^*##Lu^jc z7(~|fkuuI{{Cpon4KXxA45va2rNeQEs*8Pyk%kxk4;8e2@= zfLLRUjTqyp7@LDOrj6WFZR}-CG{(e;F`0@n8Qn*mk?m9^eaS#EM7z04i4i3(Gn}md z4;@MjIJ;i}S}!;E6&T&CHpG7y(d#YrXS)vcm3{FO_F9v{nWUO7&)QRw=%iE0*v z9%)nh1t~rADZi3B4NCdyu2VgG>EDB;r6OhU4xcGaL{iLv&Lci2X80~qZwmL~J%KXk gT9@Iv3=W|InN^WKl-cToC`5@e>i^N{ciXo90Eg8BUH||9 literal 2845 zcmb7`OK#gR5QY_WC*%-ZN{uUUDC&ivs}?~wUG)HlU^}h>%Q6%{Q}m==cH0|d(~&Gv zlTfiJAb=T%{4<{@ew>FN-#+~L`||I`x!q5ne&+M?_&wip=f=UG7uRtPd39cGmaJIJ zSNmei4vU#!hv{x{nw4cW=l5>U3`u6d;0!T1BOII|@7?`o^;lK~d&-OLdQpk5j1pl& zxtg;gUu~G@yT4q<*5$F`k!)9Nkz$IaGCgLWnTM3SeYL9{1Tt#seXwfXJ@{ zRIE@@$fsjPaKhkuxx?`Gp9ZHh2I6D&c))p>@mNF?1_Ae*xOSQd&c?#$zmq_P13kv65A`*3C^Pjq2S$@p>wv9x>XUCnO2q@F zdB9RVxb*Fo;?j}w0cszx)ejb}_Vn5v0#ra?8VD>Egi8(5(Gmh`A+Xhu?Dq63DHRcz zCIU+p;ZlRtRz~{j25KY7>T~LOC=phFUIsW+S2Vj*SHAR{N!=H*-;Gl;2J9d7DiF=G z?srN5NF&~pxS)y?9P53o^4ZQ)B?3AQ`<15K5K$cPw$bPpiJ+DewWW--^I)28KLpj1 zs4t~PdzUT>y5JrffnbIr+bI06CP#9B%K delta 402 zcmZn{+AB2SzEC6w14CJ2QDtUcxzj1F&NX5NfE}3WAcJA*D#sFm`|DfU`%sn z7Z|gi8LnUlvo%z7^LJ(&Mwkk7R$G{G1uG}Bjs}+k7-*Enr{$;Xl`CigT?%GtLS(cQ VN^%Q;0UvLvIe7tx_~acN{s1~Ii;w^S diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_color_texture.bin b/examples/runtime/shaders/gles/fs_shadowvolume_color_texture.bin index 10384556268ba6cf0cbfc3d266642f2652f48f3b..b0e14f9631486154c238da22aca41e7353f933a5 100644 GIT binary patch delta 35 ocmZo*{lhXrQ^1djfuSt1s4_DzT_GbgJ!7J^3=4?f7^}<#0LCW^9smFU delta 39 qcmeyv(!e@FQz(dufuSt1s4_DzT_HC$C9^blqNNNQgtakJnF#>=|mTAA(YL)z)+f(nU-IatB{+Tl3AKNQ6mljbeah6 diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex1.bin b/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex1.bin index 8bd3be60f069d5692ec8100c727ae7b283d7e727..4def09326e545ce5f2ef2519dc7318cc2cd1c136 100644 GIT binary patch delta 52 zcmdnZyq#IuE!cyZ0Ss0!GBA|oXQn9RCT8X-XlQa(b15ifWTt0KRP|v2(HqNM7y(1Z B4U+%> delta 56 zcmdnayqj6oE!cyZ0SwkKGBA|oXQn9RCT8X-XlQa(b15j~rlw?;=1x@hVS}(X7P~M4 E0D_1QR{#J2 diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex2.bin b/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex2.bin index 2ef998ea14b1b3e9e4812ad6b9f3bb1aa4ddb988..737f259a53c754c703fa66f0b6ae65b21265a2d6 100644 GIT binary patch delta 52 zcmdnZyq#IuE!cyZ0Ss0!GBA|oXQn9RCT8X-XlQa(b15ifWTt0KRP|v2(HqNM7y(1Z B4U+%> delta 56 zcmdnayqj6oE!cyZ0SwkKGBA|oXQn9RCT8X-XlQa(b15j~rlw?;=1x@hVS}(X7P~M4 E0D_1QR{#J2 diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_svfrontcolor.bin b/examples/runtime/shaders/gles/fs_shadowvolume_svfrontcolor.bin index fce4cd1750cb15f13a922c2510f17e61584d21b2..5fcd8ee14e2ed2126848f723df5699424231663f 100644 GIT binary patch delta 26 hcmeBRY-5}tA&|+yz)+f(nU-IatB{eIo-t7?4gg|p2nzrJ delta 28 jcmZo;>|mTAA(YL)z)+f(nU-IatB{+Tl3AKNQ6mljbeah6 diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex1.bin b/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex1.bin index 25fd3351b62563c188c821d5011dfe8293d89f21..aefbc4af22e34380bfcbff243d645866eea4d6b1 100644 GIT binary patch delta 52 zcmdnNyoFiWE!cyZ0SuNhGBA|oXQn9RCT8X-XlQa(b15ifWTt0KRP|&5(Hl!#7y&{4 B4TJyy delta 56 zcmdnOyn|WQE!cyZ0Ss0$GBA|oXQn9RCT8X-XlQa(b15j~rlw?;=1x@hWP`9a7Pv41 E0DzVcNB{r; diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex2.bin b/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex2.bin index 50dc6911215b5cf5bf56bc58c0f32f5d9742382a..2593088770939e576e445dc47664dcf054e0c090 100644 GIT binary patch delta 52 zcmdnNyoFiWE!cyZ0SuNhGBA|oXQn9RCT8X-XlQa(b15ifWTt0KRP|&5(Hl!#7y&{4 B4TJyy delta 56 zcmdnOyn|WQE!cyZ0Ss0$GBA|oXQn9RCT8X-XlQa(b15j~rlw?;=1x@hWP`9a7Pv41 E0DzVcNB{r; diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_svside.bin b/examples/runtime/shaders/gles/fs_shadowvolume_svside.bin index 5654d2d0ff3132d9f3337de8936d816b9c5f28fe..0bca79b19a3e564d06700956b34d0aa65053b612 100644 GIT binary patch delta 51 zcmcb?e2H1gE!cy3@Aj|R3=D@E85qhEiz+ko(iJi?(=#T@$gzNF2R|^qaf%Bg0Mca< A!vFvP delta 57 zcmcb_e1loWE!cy3@Aj|R3=Ah385qhEiz+ko(iL)3Q!-0)CrZh&L0L9_P}asi7e)Y0 C_!MRU diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_svsidecolor.bin b/examples/runtime/shaders/gles/fs_shadowvolume_svsidecolor.bin index a2f79c0587505e9b8871e3e4d909ba75b35f8238..898606a1d01cee1b84e1af5d9a29f82d9428a204 100644 GIT binary patch delta 26 hcmeBRY-5}tA&|+yz)+f(nU-IatB{eIo-t7?4gg|p2nzrJ delta 28 jcmZo;>|mTAA(YL)z)+f(nU-IatB{+Tl3AKNQ6mljbeah6 diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_svsidetex.bin b/examples/runtime/shaders/gles/fs_shadowvolume_svsidetex.bin index f8ea3dac10a15948595cb93bee9d9e8be4b17250..4aba4fd2f1d19e19dbecb15f97dfe4ae99042568 100644 GIT binary patch delta 68 zcmX@WvV&!Uw59|T14CJ2QDtUcxj|(FJ3S}4g delta 76 zcmdnNa)4!mw5|dZ14CJ2QDtUcx!8s{ERYe z5S5el8O32tFGiVUnEu?v5)*~e__EB@a%-;Ayv#J9LCA)KBnuLY5_5}jN*9-5S1|b? zqZG`_`v~S=MpY%4?LgOqEJ({wM>l=41Ct_5b1G8?jCqmC6vpIY_Jc8Fm|bAZCCqRI zcbToBqMKz{Y#3qe7*-w@M-46oFwg*7u2-(01#yO6xh6zLOQ9sU02rF_mYP60WVWH6 MiHVW<Am4(on05+m0|B8yFnhK@7sT< zf6lLO#rGdS{P^?X?+-srruXap?&|vP&;0b$i^=503VaS zKmM^f;4A+9BPNrF&GBh>dnK+Bdk_!X&q_S3Z}a2LX8&gDUDUW(B>9}@$ICzjb${4x zAKy&xZ+Bmir^&2EGo|M8K7Txj)8^)|-yY?=k8Xwttfz`G^4+Dl+3apbGMj#ziYB8J z`_Jq2O}j~nyPE^%y_VEm{Vd*!S4nYKyXS4v%wzub>3KG5GJM(Ro4cx;YNb#}ahczV zq*|SeDoVDxWBp{+u3NqJ{44sGvuUT*^Cw(Lk_3|#!i}CJRh;0fJ2Q%SKk8W0<@_b+Q zTT+hQ7m;jkpOUNNc5}Bq{&l^@lJo$8^N7@AThsmuOdZ1<i&fta8yz9ggmj`Ayh`T=y9u8(YI&n8cl&I(vYvk@ z*I1{nWQ90ubV=LxB3@P*(_$yKQr2~zx z|Dat~JWg7>swp<-Q_U=w{o*Zs@dj#FdI#V8g@u%D?or;-ZrQ1w8d+fz({NJ z)paMib4cxJC&}eJpG0eS-O17!D($Fpk+=Fv*2A?kTszp;NOdPoL_2Od64l=GkV8mY zJCxkuhny@eiHqkGPE&Z&b{8IZ4oS4aA99i`&lfL?iC0=fr52TLOFXh3F5ZfZ2m2aJ zyj8b&ihGXgClrME;tg|66(STx6x>yLs+&+0w+`hKiXzYR#6xR$Wc zM=L5qD~fxL>ZcWic-jqn;;GV-m}#mQt*CBV(cC$-Pb(@&D`@T3PIFq(oL00)D+p+7 zhk&u_PDf}(bIZ~Fw1SY9cK_#rr$e-&W3-~XX+?A6&_1o`Ag!P^q8+Cd&1pq@w1NPp z-FUR3BebHq<>-D|L5Qc_FwfK>SkW<9(cQ43xp8P8R&)?n&>GQ>!;0pxqCHqa0Ml+f zSkVz!G2C)YKdd0+T)Sb?nGmX&7^;|VR59E)jE^cNh$?99mdntI8^$LU6C@S1Mx^7UVmPT7k5mxAq#KV^ zOoUVnHyqPXDhO#w2h|4udS^nUVq&CXx=F=y+ps>Vm>{X3wOc#ONyTzfu^y=)psgJO z#wt4-Ar;FV$M%y7LOkt;S*8tyZiqn0Dil zij9zp<(6anNd+P2+6|O01S&QLDz+O`EcXrTgNhA;3R)x5aZs@wRICRo2w>8U2P!rK zDj9d2tRGYmaxUGlr(G5Tl`IA-SvRO;+%_^FRI(tbptW1NjDt$XK_&A*1p#g85HOZw zW;LjkFXtQ-)aMYdMQY2#+3)m<&Yhv-Jgz=z$ebyaeKS3$*PZ22W79~loZgB<{)lta zPp5>U7mh_=tc1{XUu8uaA%0n`^P(Ty5|62XVjoq{RK|rabP~yI0e|WsS>KqEBUcyb8up ziu>*6;nno+X8Rer`uVl!O6vl4<-Ki2O}|Y= zKc^JCPpkYDA5`LYf4~Y>k}fpw#cS~*tJb%D+GJfV^RJIjvspjK=UutJZEjS(BnnBc z%3F~&J9W`SNtOV+DVr<0cfX#0MTWYfequd;#Dy%&P_Phg{w!5%Af~z1-9k4t1<%Bb=AxWkupOzSo8b>;nBg9UImJt{#DBB~ z+G!N&X0G$=3s;!CN;(iXOXRM z9<%G?W_`Ok{_|yxXQVF8UeGfwvz+z_FSIW44L7w5PkM#+j47a- z-MeJDFXvAWNbk0*UC9ot@Z{i?CaqVxbn73?R=fBO^@~;RmMz3!(53A+ z7V*5vdFkhDt(`m5x7(A`lbH=tldL)$TlXI^Cz0Q z-US3a!C)kj@r!S_KX=yeW>KR8xWt{xB{0$1rWeYfPRu-0?8dLVV#jKgb=R{o!f9a zA-R(!{eZwdAgP6TZ3v?=56If7jRNE&WNtoEGhl55>PYX5-hm{XecQX za0knA6eGl!;M_i>LM&Dbr);xphIEP#jUJ-7ONnOF&b5XvsiH!E04tpU<#zMSaAodaTX)Q zQ{Y?@s1S=)jKwO(V#S@Td={%9i!mBgKywyr&SK@U7y(RyG!|=aU_H)ag!B~nF%akw zi*<~}I>utnjjVkZ>mZ9U8dZR^SaTL@kHrY+D}aEME~L4E^*Dlli4 z48@uoS^Fr~K@?*&ssKl^<|x)4iV?sRNJFva2G-*!M#xZsa|JLV5Sti?bqvIY``Gv( zHbD?$G$w%IAT}Jt#se_|`T`&z#R7)=*NlT0AwvPqrGN=>*u*$&VjMQy#>VHc333>t zQ2{uI4d<}&IE(-$KpKY)x33xJFhY6)VDEq6*8vmau!(Wl6p`PF4Y#rJIc$O)#%N3d z%QqT#&|s+#yohej2PRrA(8!9Gkcti{(^hChVn66se%a zycD^uPcOgIw{`BY8HZTyNlf8bRokFYbNc?XKA`Ic>6@$9;!r-|wDIF9qca$VW4N5o z->MhdHn)Q6T1H2uIO=`w&P?ZzsH8n8GwyU1N3V4jZRjth8osN}q_20YcgOYhn{rnk NyYC;V?(fs-c!|K*p__+go?Zf^O=x5-t$ z|2J8~pYXf+b2NHPHqWd38+HqI*X%L96zp+%pKtDx?0npKDB)pYgCGcCu#8dfL15~!zb{xg4JQ+P_!pxpcgYhApzyR9jc&+T zz^5V9F-@rnHZsGVuru?JPfo4bC@4+f2YQ%58v%W?k1U4&@EvfDVUX0bwl7adxwgt_nq#pxJIA@OmKE@Uk=R9h8rAna&rG`*ZLF?Ykla59 zH=8usrJHZJ2`m_6_!QSO4#}SLZf(!a+F6p|Rxg0! z>9Cx8S5pMG*J+LoU2@X)?&NOHL^xfWxs-5g!L&61X9!j5&Jea_Z)eE0vfD5*+_WR1YGd*u;`BK~ zt`*zBB&~KVdtr(rz(hHJmw#*%SuXp)wEYbSf$oBdUV-MFBAWtcKb7TL+3hKx9fGM^ zRhDbXHZV!79m`&rvm?MnJs%e4ybny<;c!ssE|};R9GE>>YGt=)ya>K^8J&D<8#8WY zDeO2~kXSpGy(|~QvlOW3gR%sRZ&z7iI~)ND-N6#7G+6fYm_jSNHRFPg3f4)fVkwGq zpig9l9g7RnYR9sVrQk!*JEi`zUYT2TBKLsRqycfW@~< ztg^k0>dyN>6_;gCl)kKwI+XQM?O7jXN8zfO^-<^&8r~90hetVh)<^Zp`Y7AmsP3!} zRB=)E^Onk&^HGO#KB_(EqwFADkx*MPtU{O2M0tdqj~YDZ0~XtMrA~5DbWq;yd}Pr~ zUqZj)%~*za&3NBt?gbS&B-0k+c<^ibO0_D)>AGO+d=K}--?sr?Tne~4jqql!_?W=C zpMtgGS%5d*aASW$SKrfTxGOI2HWgix7m+<$kqZBzDfe4(nRk;dKW~zoPkEMaU=-!3 K&d0Cg@#rUnfQ9P- literal 8277 zcmb_h*>2-D6!o+ZE!>|V&=jKaK-X2Zxrxp}h^Ixl zzwAFgEN%hI#plFQvlF((YP~Es^iQ~3^91l}aYI(c;(=s?{`Wp{fhbvC&+|)vkdfVL z4YcPJZ1?IySxRGTU5GF*fpJiqq`QwU=hNHm%Z~jK)lvVLeG8jBpeDs5aWOO)! zIp$IM2tH&856FeNNeAbiBI)$#c**WIWw9$a|K1m1BbwUy z91WRfIcfwSxG(Y@9;z*30!t%gmP_}-`D&Tm#u;R#=V|T%u z;;^VVY?u^BdbEWV?c#{0IGweT;Ud(g88;klM9OevbMSX<8iLS1E572dW4s;wW*tdKJ~a>~8?`)1in%dBUrx zc2Xmbbk6`gDvn5t<2x&zw2L!oiqlye?aMxYm4Wq`tb1+5p_7z0ezv93Jp=5hHq)dw z%y(8cYSjj&Gz_O}#9`W(J^oB)U$6YI+Avi;#+{1!`IbrV46tL`usp4e@2iZpYl8_< zTED8XP6;?nyRy$;Cf`Hau!P+(Kix9voB?)J8=lt2cU3lS*9H?}piNhwV%n2^{xbO< z(q^2}#!t6QI%j|#)n<~`#&=cLUKzubP@AsO@K|BYW$ryBO{y~HezxV!%9vvuXjH~9 znkxRd@2R}KGKMLkG+m<&kJZIIRTuMAUCjMl%bRsEkJiO7nv}+ORNh_}!xTpvQ00X3 zhR5n+o~ny^sxIb!s^!hPm`Cek7)@&9J1TFli(yJbo6as3tBbizya!y0r|M$ir&`gh zi+QvzhS8KZ!uM3sUKhiZP@AsOh*(uDQdO}?RmH;3w4zxR3k(B|Xal23X?#x=?Nu>M z38m>8ZA7dl7O9$8q-tW}CtA_0i3Ns%rZl!D*5$OMU|W2qO^EFw_^x_}c+t3o0o_ZK zUCUkhynEb~&|ro3XWe0~dzd*|7c>Q-%fmA?zuC^j37 zDSVf$HSAED#v7o#LX#2a2<*9?nRez;6!0y+p8}YRLqRt|l|pB#f2uC(R_jsR@TbN5 zxxsH3hnwv2DKb_nXAs`tG2AGo^mlUu6o;F`!hMa-Fj39t7PF$5Q%~aNE(I3mUe@LY z=$5lHqqFHzOm8RAbgdsyEFIur8F_}+!7C}ImiP05QZ{CGQKLJ`jALkynRPHS{vn|sP+U%0 zqKJtdWnlb6asi+?oD3z)$!5=EjEkR~1B|`6re#tlpjwVKMTg@t)WnCR06?)+YO|`1 zs)I?1lf%Ai=78ezk>Xfkv{px%llYMM4k!*EMF$T_^RYf9eZzyZB_4)i8D);Lg#2}7 z$~kC4Ks!Yr1lmEY1+U1u+QX^lw{3=}Z48e4axA#i2ku<1sqSTXBnwB%XYy=z_ySS0 rK9Cdg6jy~AMBxJeB2@TIoqgXe=U+C(-REjqZGc71>azdV@Av)(z3Mbd diff --git a/examples/runtime/shaders/gles/fs_sms_shadow_pd.bin b/examples/runtime/shaders/gles/fs_sms_shadow_pd.bin index 52fbfae8af73b476ab2dd3c67bf791512526dfdb..56f31d5a23e8b302b2d5f2e563a453ad9a587866 100644 GIT binary patch delta 42 ucmdnUw3bQAE!cy(U`o*s1_n7s28Oc4qRPy?bcKw}^o)rzDlA~y?KJ=tzzyX9 delta 46 wcmZ3>w2?{1E!cy(U`o*s1_mWY28Oc4qRPy?bcNj1l+4oHiBc+TP?pnc08!o#sQ>@~ diff --git a/examples/runtime/shaders/gles/fs_stencil_color_lightning.bin b/examples/runtime/shaders/gles/fs_stencil_color_lightning.bin index ae4ea813a886e3dee7bf15b2a423a493a89242cb..e0c5a4d87a9e9fc949807b5bb593eb1d94aa46c9 100644 GIT binary patch delta 322 zcmdlY_&{L7T!DS;3=Cz7MU|O(=?WQ{=@}E(OR|9JbK>S&k_ZW@|N5H;l=}{0heW!5jr+hOv0S zn2T5}Va)q1j!@=i6;?SWB^39R={N`W;OD3qlpn<$jVC+Fwn7g=+a=4Gbk7v+NGChuUJ08#D7BrXH80<79tp)51C z+$FOp-q@N;0iv>%DH5Xc2~#(OQOf)Z!boL_f-sJ_U^1IRyEPK$eu`7682*Z)h~xg2QIA76+fCUPWb>`H*p9!)-CX>H&=rS5luHw|29Ly;skpuKyi8Ck+ U;*Auv;5tDHA{k94U*S{%0JHUdDF6Tf delta 529 zcmZ1^{6l!cIw4n128Oc4qRPy?bcNj1l+4oHiTfnkpsd?64iHv>LRo6Eu|ipVS!Qav zHCJg~W?FtxE>uH-LT+M-i9#t>$;pO{FykisF-k#Ao}9xdrGjKMNOy96PJR)(*^`$s zPOwE%XsnQvnVwPN3{o3!WX+`jcLT(MK6Iaw7@Y228Oc4qRPy?bcKw}^o)tRy8(R235x&# delta 28 jcmaFH_=0hQw9p9#28Oc4qRPy?bcNj1l+4oHiQ2mXku?f# diff --git a/examples/runtime/shaders/gles/vs_bump.bin b/examples/runtime/shaders/gles/vs_bump.bin index b2879056c877c935cb8710ee9521eb36cbb94c05..584a06a416a72b17d6f5776afacc106a9ec4fc35 100644 GIT binary patch delta 375 zcmZqVJI_18OlS%l14Cj-Nl|7}X-TR=MrL}(L@#L;Fr6(6q5EVY^ah!Fka&SYS!%Me zLRoxLW=UdRdTL&YHCI_;QDtUcI#@qkJ} zF3U_UN0oz1l^5g}TXU7>Wu^h`2fJu;KchI<3zOF{+Cdl}7+oL?D<)eAqn0Tf!g$9N z24Q$HTSFM#%x)0Ib>>hA!-xf{y@n-}3lS)j_p^#k{>-8UQKZaT0%6Q$t${G)*&YD^ DA|!;u delta 397 zcmX@l+sHS;%=8!=14Cj-Nl|7}X-TR=ZfZ(qX>Nf+S!%M0LSlSgeo<~>jx`s$f{E#} zY!IarJ7i$26>!!G8DAuWj1|h@29+fiRc7X;BijR#E=kNwPt7Z_=E5Rxq);|-gNQPk zfn}Mg<><;M$1#e-)#WCZm?)ISL)4Y#Wu^hW0=0JX6h=F!qbFZubb&GDm~3Ipc&2O^ x^BhwcjH$tF4P&M=yTOp-qFdZukp&MlCLHq)RveaZFg~a%h z)QaT%{Gt>CYc5osU==0`nei!!C5iZD4e{zVLX)kBSPnDV*qW;>v8XaLFCFY)u(iet zW${UwC5d_Isd*(h}jlamu04w<1o3rAivm}t28e&4QM~u z#giGC#KB=ZS&m5s!th`!f-nv+xj-0P%vKPF7jrg*v70#z!VqV%hA<*n+#rl4EI|;) f9~P)~H`Y*y$U;_k2;&`V351csRs&(YVtWJtXIr*s delta 464 zcmbQhe};d8hRA$&28P6vlA_F{(vnn#+|-oJ(%gww(ri#xq%4e8B?Dv4l7q4KNWoaQ zr0O9$3KYsxlT8#d<5Ln#5{<06(9K4XH@4;~ODw9)%u9#b43;%kD2q?ZEJ@5uPt7aA zsUk1GC^s<&Aq{oOWu^g5g4>^)SYo13 z8ef)~T8=I``5&VS%oa7KA{cWHlM9UbgvkoVRASDCF()#I!I-a^tzk?p7B?8Pge3^Z fJjDVxOo%lUCYsIa4r6X(ErBuh*lJ+Rb!?9S!7!+3 diff --git a/examples/runtime/shaders/gles/vs_callback.bin b/examples/runtime/shaders/gles/vs_callback.bin index 6012599efa7881bd38fb144f887a3c037a848f61..904e7a0b540f251852f47499aaa547132ef4a204 100644 GIT binary patch delta 163 zcmeBR`Ncdzul_hA14Cj-Nl|7}X-TR=MrL|OfkIhovWY@sd~$wHevyGS7Zzz_pmafg zab`(oex5Z~Sz=LTW?nk7?lQP;3`t{!viS1+qMQ_KuF|}TTNPM9mQK8_38p7=F&04> HO^j^-%g#Ei delta 91 zcmeyx+`%$IPvj~i14Cj-Nl|7}X-TR=ZfZ(qY3@V^X*MV;9?q(hgo({Ig0U`Y!dU-` KpsdLyjBNn!86s!^ diff --git a/examples/runtime/shaders/gles/vs_cubes.bin b/examples/runtime/shaders/gles/vs_cubes.bin index 910796e8d3d9ec56c27ddb23cd8267cbe20dd6ba..74daaf97ddfdee7a73e03ea37bc8fc43bbeaa17b 100644 GIT binary patch delta 145 zcmX@lbd+g=LcIbb14Cj-Nl|7}X-TR=MrL|OfkIhovWY@sd~$wHevyGS7Zzz_pmafg zab`(oex5Z~Sz=LTW?nk7?lQRU(!9*H{Gwc_WNu=Ki9%_7ZhlH?PFQAY`NZYoEFeoK H9_a=EjVUyy delta 93 zcmX@gbe?H~f~giG14Cj-Nl|7}X-TR=ZfZ(qX>Nf+S!%M0LSlS!eolUofi)Mpf{B6B SY!Iar3nXEzUQHNlS2qCXMATN6T`ng{?xc_+{S delta 147 zcmcb}bem~{LcJLy14Cj-Nl|7}X-TR=ZfZ(qX>Nf+S!%MeLSlSDesN|=W`3SE7gi-k zKqV!q70LPeMJWc>TxE$xm6>_z$c7jxlp(7q&C5*7FUp0h$W5F$U6l=D>BIvQ0bpD< AfdBvi diff --git a/examples/runtime/shaders/gles/vs_deferred_debug.bin b/examples/runtime/shaders/gles/vs_deferred_debug.bin index 9ae9c94b11cbb638dede435ee304f40ee09c4051..efe27355d507f42c9ab56827c16db4553dd04728 100644 GIT binary patch delta 109 zcmcc3bdhO-La+`a14Cj-Nl|7}X-TR=MrL|OfkIhovav#9d_jJ3W=Up#o;4R11x7#x mC8-t3`T0dD2G(3ATN6T`ng{?xc_+{S delta 147 zcmcb}bem~{LcJLy14Cj-Nl|7}X-TR=ZfZ(qX>Nf+S!%MeLSlSDesN|=W`3SE7gi-k zKqV!q70LPeMJWc>TxE$xm6>_z$c7jxlp(7q&C5*7FUp0h$W5F$U6l=D>BIvQ0bpD< AfdBvi diff --git a/examples/runtime/shaders/gles/vs_deferred_debug_line.bin b/examples/runtime/shaders/gles/vs_deferred_debug_line.bin index 910796e8d3d9ec56c27ddb23cd8267cbe20dd6ba..74daaf97ddfdee7a73e03ea37bc8fc43bbeaa17b 100644 GIT binary patch delta 145 zcmX@lbd+g=LcIbb14Cj-Nl|7}X-TR=MrL|OfkIhovWY@sd~$wHevyGS7Zzz_pmafg zab`(oex5Z~Sz=LTW?nk7?lQRU(!9*H{Gwc_WNu=Ki9%_7ZhlH?PFQAY`NZYoEFeoK H9_a=EjVUyy delta 93 zcmX@gbe?H~f~giG14Cj-Nl|7}X-TR=ZfZ(qX>Nf+S!%M0LSlS!eolUofi)Mpf{B6B SY!Iar3nXEzUQHNlS2qCXM zF3U_UN0oz1l^5g}TXU7>Wu^h`2fJu;KchI<3zOF{+Cdl}7+oL?D<)eAqn0Tf!g$9N z24Q$HTSFM#%x)0Ib>>hA!-xf{y@n-}3lS)j_p^#k{>-8UQKZaT0%6Q$t${G)*&YD^ DA|!;u delta 397 zcmX@l+sHS;%=8!=14Cj-Nl|7}X-TR=ZfZ(qX>Nf+S!%M0LSlSgeo<~>jx`s$f{E#} zY!IarJ7i$26>!!G8DAuWj1|h@29+fiRc7X;BijR#E=kNwPt7Z_=E5Rxq);|-gNQPk zfn}Mg<><;M$1#e-)#WCZm?)ISL)4Y#Wu^hW0=0JX6h=F!qbFZubb&GDm~3Ipc&2O^ x^BhwcjH$tF4P&M=yTOATN6T`ng{?xc_+{S delta 147 zcmcb}bem~{LcJLy14Cj-Nl|7}X-TR=ZfZ(qX>Nf+S!%MeLSlSDesN|=W`3SE7gi-k zKqV!q70LPeMJWc>TxE$xm6>_z$c7jxlp(7q&C5*7FUp0h$W5F$U6l=D>BIvQ0bpD< AfdBvi diff --git a/examples/runtime/shaders/gles/vs_hdr_blur.bin b/examples/runtime/shaders/gles/vs_hdr_blur.bin index d32a31d6b0b7b3f408de6ca0159ab737d2b70728..df79ac88ae181e64dc66f1fa46383bea72070ee3 100644 GIT binary patch delta 382 zcmX@jeU^KIk?}NE28P6vlA_F{(vnn#jLh_m0)?{FWMhTI_=5c6%#zIfJZmmg1rsx6 zSU?IVc0=j4Q2IQS{wU)DH^@YxEWRYQA~`?5D8rp*{&8VVFNzJ+h+(yedc#sLak z=+JgY?wmQC?_5|sKVE+S{QX`?w~-Z7vU?#3aj$!l)RXQa%VQ347kvB_u(z9h`gJ8q zb{GcqH3|uM#G#S5ftV~cu&oW-(vUKLE(;|pmxLr)G8Q=Fxg6U;O8qr9Q6WB|(2-&y z^uP-Bq(VEX(C2dG(-jLmoKy!?*rCF+!%WdAkiUsh2Rxhl&>zSjGBgcCZ^J9GI2Azo ztnA7C_5->6<5@U2%kni!|NwsM&r z!g5P2{vkl|kVQi4=YT^{l`+QB`0yb3sJPzL9mCi1{U6}xXAb)|%KxH}(``8%MWpbYmAT^|rMdJEs$2n+V%H7kgG>&qUaI6Wi>@o?&eB UD7M*+UAWZPdX3HLK4n?@2WkoEmjD0& diff --git a/examples/runtime/shaders/gles/vs_hdr_bright.bin b/examples/runtime/shaders/gles/vs_hdr_bright.bin index 9ae9c94b11cbb638dede435ee304f40ee09c4051..efe27355d507f42c9ab56827c16db4553dd04728 100644 GIT binary patch delta 109 zcmcc3bdhO-La+`a14Cj-Nl|7}X-TR=MrL|OfkIhovav#9d_jJ3W=Up#o;4R11x7#x mC8-t3`T0dD2G(3ATN6T`ng{?xc_+{S delta 147 zcmcb}bem~{LcJLy14Cj-Nl|7}X-TR=ZfZ(qX>Nf+S!%MeLSlSDesN|=W`3SE7gi-k zKqV!q70LPeMJWc>TxE$xm6>_z$c7jxlp(7q&C5*7FUp0h$W5F$U6l=D>BIvQ0bpD< AfdBvi diff --git a/examples/runtime/shaders/gles/vs_hdr_lum.bin b/examples/runtime/shaders/gles/vs_hdr_lum.bin index 9ae9c94b11cbb638dede435ee304f40ee09c4051..efe27355d507f42c9ab56827c16db4553dd04728 100644 GIT binary patch delta 109 zcmcc3bdhO-La+`a14Cj-Nl|7}X-TR=MrL|OfkIhovav#9d_jJ3W=Up#o;4R11x7#x mC8-t3`T0dD2G(3ATN6T`ng{?xc_+{S delta 147 zcmcb}bem~{LcJLy14Cj-Nl|7}X-TR=ZfZ(qX>Nf+S!%MeLSlSDesN|=W`3SE7gi-k zKqV!q70LPeMJWc>TxE$xm6>_z$c7jxlp(7q&C5*7FUp0h$W5F$U6l=D>BIvQ0bpD< AfdBvi diff --git a/examples/runtime/shaders/gles/vs_hdr_lumavg.bin b/examples/runtime/shaders/gles/vs_hdr_lumavg.bin index 9ae9c94b11cbb638dede435ee304f40ee09c4051..efe27355d507f42c9ab56827c16db4553dd04728 100644 GIT binary patch delta 109 zcmcc3bdhO-La+`a14Cj-Nl|7}X-TR=MrL|OfkIhovav#9d_jJ3W=Up#o;4R11x7#x mC8-t3`T0dD2G(3ATN6T`ng{?xc_+{S delta 147 zcmcb}bem~{LcJLy14Cj-Nl|7}X-TR=ZfZ(qX>Nf+S!%MeLSlSDesN|=W`3SE7gi-k zKqV!q70LPeMJWc>TxE$xm6>_z$c7jxlp(7q&C5*7FUp0h$W5F$U6l=D>BIvQ0bpD< AfdBvi diff --git a/examples/runtime/shaders/gles/vs_hdr_mesh.bin b/examples/runtime/shaders/gles/vs_hdr_mesh.bin index 0461008e79407d021ee0fc7d05239bc411088a91..c6c2ac997260b61ccafcc293e77162efa528ce2f 100644 GIT binary patch delta 242 zcmaFJx`=gxQ9w2m14Cj-Nl|7}X-TR=MrL|OfkIhovav#9d|rN0Zeor#7Y^xy{Nl`# z%=|oSuCm0U%FMiUusDGT}4QL{a;mQGwB5 UvH+9l%DR;gU)A>|LQJWa-*&11QRKW6 z4d~)71x9Px3RY!!wxN-aTya@vShIG|>vHO#M~C5h%ge2^*VL$Ih1zguxU2cSVHjNn zQv|#@{_n7pnh?oz5RBIlg!l!+XlMo{phRQ%=qfW8!#Uc)6|ACoQhVAzn<}&5ZtTNO ziKj}8BJhwc5S))Wp=~WIx^|YP+adHO{gS*|WDu;vd#I5=^-|LV{HYcH;@8x!`Um7U qU>g1vNxVqXN5+$t5f>Q*!)G$iNfd{0VVBzvKYWr|1mX~0F-D&ng7NnN diff --git a/examples/runtime/shaders/gles/vs_hdr_skybox.bin b/examples/runtime/shaders/gles/vs_hdr_skybox.bin index 9ae9c94b11cbb638dede435ee304f40ee09c4051..efe27355d507f42c9ab56827c16db4553dd04728 100644 GIT binary patch delta 109 zcmcc3bdhO-La+`a14Cj-Nl|7}X-TR=MrL|OfkIhovav#9d_jJ3W=Up#o;4R11x7#x mC8-t3`T0dD2G(3ATN6T`ng{?xc_+{S delta 147 zcmcb}bem~{LcJLy14Cj-Nl|7}X-TR=ZfZ(qX>Nf+S!%MeLSlSDesN|=W`3SE7gi-k zKqV!q70LPeMJWc>TxE$xm6>_z$c7jxlp(7q&C5*7FUp0h$W5F$U6l=D>BIvQ0bpD< AfdBvi diff --git a/examples/runtime/shaders/gles/vs_hdr_tonemap.bin b/examples/runtime/shaders/gles/vs_hdr_tonemap.bin index c5a1b765a9f8722ccb90081e895e4bcc66bb3935..b9b599d4a0363ba125bda3dc6c5dd476b216efa4 100644 GIT binary patch delta 220 zcmbQq{hMook+BOa14Cj-Nl|7}X-TR=MrL|OfkIhovav#9d_jJ3W=Up#o;4S$f{B?j zEFgswyP@=2D19DEf0S{78)TwT7GIKDk({4jlwxAdRhpNXmS2>Mu*gKAG`=h|wLB!X qA~gq9esVaYCfK6MZHyKW#u3JT2qThdKZGI2d>+F13}c*Nxd;GRdr=Mm delta 372 zcmey(HIsXSQGF6C14Cj-Nl|7}X-TR=ZfZ(qX>Nf+S!%MeLSlSDesN|=W`3SE7gi-k zKqV!q70LPeMJWc>TxE$xm6>_z$c7jxl;KxVpKOAp#1N|?$SRBosxT&~!o-@ZG%qtP zzbIEBR~_MD6NS?Fvdq--kkpFQ93&-R6_Z^VHQ6AcGr5S-0>)g&*biemGVO;kS(wkm LnAZ`^RV)_)CIg8~ diff --git a/examples/runtime/shaders/gles/vs_ibl_mesh.bin b/examples/runtime/shaders/gles/vs_ibl_mesh.bin index d5bf93d0caa3f0d69c8724b085c50d686fb855bb..c38a2a61125526fd5aa9f64b908f6658b2d9c69b 100644 GIT binary patch delta 140 zcmdnax|DT-txz%(14Cj-Nl|7}X-TR=MrL}(#6W2W5M7{9mYQs=kQiT(Uz}NznV)CP zRhC#(nVFXkRtA+Wi_gn1%1z8cm7KWAkOgekO9e1JnV(S!!Z2qnf-u%I)<77BOl<&z C_%TWV delta 114 zcmZ3=x}9}`tw<>o14Cj-Nl|7}X-TR=ZfZ(qY3@XSX*MV;56&%jpORT*%~hJ0nU-Ia3o&7#0t?urvXK28P6vlA_F{(vnn#+|-oJ(%gx5vTRURybO$0F9u`HRDiMe%EMR> LilD5?VT>&R@(>~x diff --git a/examples/runtime/shaders/gles/vs_instancing.bin b/examples/runtime/shaders/gles/vs_instancing.bin index 7a9f94142ded8b0e183b8f4d7975d71e6d441e0b..f3bb319f202d0fad4c0490d675b1ac75f1d2ff05 100644 GIT binary patch delta 221 zcmeysa*Jhxw2&1O14Cj-Nl|7}X-TR=MrL}(M15%%FdZOU526bc%2Ja}6f)ye5=#;d zthrECqsSWKl{LaEYm7x!5@E54HCI_;QDtUcI@pnu1sNs5uAFSZr~+X`F&04>ml)>( E00nJK0ssI2 delta 198 zcmcb`@_}W7v`7FG14Cj-Nl|7}X-TR=ZfZ(qY3@W_X*MX!M;6A)m4dOlrBWcW1qx-U z$tDV!@hOQViAL63=;olv8xxQ>vF0jEEUL`RONY8*G9#lT)XK?nj4Cju8)FfSxrcEc E03Q8C#sB~S diff --git a/examples/runtime/shaders/gles/vs_mesh.bin b/examples/runtime/shaders/gles/vs_mesh.bin index bb024feeb0b3304cb793388455530ce69f4a18c8..65a0ff078de37ce0e9ed3c447824a8d4be91f12d 100644 GIT binary patch literal 1488 zcmb7EO;4jx6s0km3@-c&ZwZbPC?9RpxSV8`CMIqPwpgD5UZt;SHS-TZe??=YzHqON|&2D-6{9|MoBjb!%u1oP)TTiyJVH4r;zf#cf5IYy_o;e`bW3_cUoLW%6W zK)64Kc=ofcWkZ+^cGn5fjIRL-0YM2A%0g@opzOYjqE@BpEhHcz5Wdnxl`uNU*>w&| zD|B9wnAQ@AG@k)!io!(%E>b<|m4#fT)Fty8fz{YBrc)FIvou=Np@EX;>HsX)aia?m zRX=UJPbAO;Cxpnvc?KAO?b%*-*ju|ht1P~5=8Bxi^5SxKTqX)o9R$RYEC&iAKzpt& zmnp%W9^f*?RLZ4_@u>D_bQGrcFxHG<%@h`h)w9)D%^cOd^yv=*&h`L%7v|COo{L4S z%~L7sOdh(5XFjGsr1mlut!J}#K+o>W#w3@$4HTKMbswFR=~QjkhoQUMvwh<{TaP< zW?^BlajRZzG#~H1dCc%||MB9-&kw&ZthaTX%WaxHi1hi*%(7xl~x{j5| z)0r;$^~$mmrAqOsRw>KVt*G-oYtl``lDLp%o@8tLY{6buLJ3){?ItM?qS#Rc&YE~5 zGgz;r)}-BZWj!~lM_v4I)ac3p@^kl2&viQH=FfzZJEmVAU_V)Cz(x^#vz9F1G{BT3&}1S_k0&KrWun?B?<>(3?37l zUR&$EKzS5GJ$v5*xlrRm(D&vT!@pDR4mcttktW&5YJ%kOpCo!gIu1@aILN*2ry3;= zLxQT}-dEJs8*yp6qtR59a87XNdMLB1FokyNngyM~qmAxJ7NmcH{e#=!r(?9t0nLnv zexn4(_x!~bcy4}O_gE%3O-n+v^qzqTM2%uE2b`U%B65428`5)wa><6{{thyiTFWkr z@4Dp~&^3s@DH8KQ0D@1kt_bUDLj4Mx2Q2Mr6XRVTNgU*@+`kb9)SJN9l;AUw0l^Wc z-UIUyIm;UOC$!_k)t77bFF+ip`ckU)O14t<%gL|IyW+zQ^7aN7XV)Omp8$g&PFNX) cqpKO|2|aQ*!BL9%-=@q5cX%(z{@u2%Kl~KyW&i*H diff --git a/examples/runtime/shaders/gles/vs_oit.bin b/examples/runtime/shaders/gles/vs_oit.bin index 79a85c245e90d2974ca995697e40ca4d866ea7bf..c8981989e5d5f7be73290905b743669bcdeb7573 100644 GIT binary patch delta 166 zcmbQvdWU6#nUEqA14Cj-Nl|7}X-TR=MrL}(L@!f$5M7{3UIc9t%62rd|75{c|cKqmVy>c!dMfeDm^DY zAip@XBr`t`s1R9yS$si$v0i0WIg&Vt3(|$KR2yNdDUz+GdLV6vdIrd1lU11XxJ)(m Ls;s$cxwser6_r?q diff --git a/examples/runtime/shaders/gles/vs_oit_blit.bin b/examples/runtime/shaders/gles/vs_oit_blit.bin index 9ae9c94b11cbb638dede435ee304f40ee09c4051..efe27355d507f42c9ab56827c16db4553dd04728 100644 GIT binary patch delta 109 zcmcc3bdhO-La+`a14Cj-Nl|7}X-TR=MrL|OfkIhovav#9d_jJ3W=Up#o;4R11x7#x mC8-t3`T0dD2G(3ATN6T`ng{?xc_+{S delta 147 zcmcb}bem~{LcJLy14Cj-Nl|7}X-TR=ZfZ(qX>Nf+S!%MeLSlSDesN|=W`3SE7gi-k zKqV!q70LPeMJWc>TxE$xm6>_z$c7jxlp(7q&C5*7FUp0h$W5F$U6l=D>BIvQ0bpD< AfdBvi diff --git a/examples/runtime/shaders/gles/vs_raymarching.bin b/examples/runtime/shaders/gles/vs_raymarching.bin index 0c4bba5f499e5171518dafd00111436c046154d7..048425644b39af942f3387d33d9b161fcb08aba5 100644 GIT binary patch delta 146 zcmdnQyo7mzLQp*;14Cj-Nl|7}X-TR=MrL|OfkIhovWY@sd~$wHevyGS7Zzz_pmafg uab`(oejd7li4`)6NamEm%_&PPs?5ww2U{|6rwj{7(Zt)DV0tna;|c)BXEbI2 delta 158 zcmZ3&yoq^&f@v=!14Cj-Nl|7}X-TR=ZfZ(qX>Nf+S!%M0LSlS!eolUofi)Mpf{B5$ w?np|FfJ#eJE0Xi`i&B89%Myz!GxO3>4J(5ihAKUAy$l<~sEOw_VXQwZ0Cx{MsQ>@~ diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_color.bin b/examples/runtime/shaders/gles/vs_shadowmaps_color.bin index 9a3c7c4064e11385a674e9321ff5897eb1cc096b..f6c7b8c409a3b6a04d8768479e6cfa7926f13581 100644 GIT binary patch delta 67 zcmeyt_=$0Xg5g;P28P6vlA_F{(vnn#jLh_m0)?{FWMhTI_=5c6%#zIfJZrAfyv(%x RqFk`_#86EZkg|y_B>+J&7{&kq delta 73 zcmeyw_=9nRg6U-j28P6vlA_F{(vnn#+|-oJ(%b@tveaZ_g~a%R{Nl`#%=|oSuF|~B TwEUu6sDg=snrslI6YEL<=m#5X diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning.bin b/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning.bin index 5926c328292f37352723aba98789df3e7c5b0a91..dcf941255a0499f64798c8b9f1d4758b97f234b4 100644 GIT binary patch delta 245 zcmcb`zK?xEaD5sx14Cj-Nl|7}X-TR=MrL|OfkIhovWY@sd|rN0Zeor#7Zzz_pmafg zab`(oex5Z~Sz=LTW?ni%x3NMQTsMZK2~e^)BQYhvJUKsq;w>I|xTPR%Wtpkv)?B4| znQ1`V!6r`TWRzh6shONf+S!%M0LSlSgeo<~>jx`rn1;#)H z1^LC9C7Jno)?8(YMU|O(>BuG+E0n=az#?q|lrEllN<V>&WQ!KnU`zl2 diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_csm.bin b/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_csm.bin index f715642b64627ac6f8074be1ab4963d63fa22644..d977615dd26e352895753618a4c69fc181706cb3 100644 GIT binary patch delta 295 zcmcb{vx;ZJ3ZYt728P6vlA_F{(vnn#jLh_miF>43!1P@x{ZA6ipDfD=5twYpC<75m zV3ctIDJ@VaOHDRWD2p#itw_$#FG?}C<|<1ps?5ww2OEhYZ-Od6`52=i#KgZaqve?t zl#q-rjW0+nO3W=bwB{Hq)$ delta 400 zcmZ3*bB$-h3Xzqp3=D}SB}JJ@r6s8fxv43crMVM#NwYy&H>GtUtOA9y)MR6YviQ9G zqTIwBYp$}yqRPy?bf^}vw24C5#D~K5NE(15@g=Dh$@%$3DTcW8z*QI#RAEd|g^4vk zn$sq4VKjt#XYxx%85on3Ndd;xWs-t1^O-~^Copj%xNt>489|@}OY<_*fFS_&_GFOy mGfW~d^-q|JV9Y3HD;RSIa}A6s!IBGOcCz$AnVY3q`56J!bdL}K diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear.bin b/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear.bin index de0d1675e58d51e27cedf118069a3a5e942cbdfe..ecfac75ed0e8ec3369fd77488ab23f7e45f947c2 100644 GIT binary patch delta 297 zcmdnR@tS=?aQ$Rv28P6vlA_F{(vnn#jLh_m0)?{FWD|wN_`Lk0+{7GfE-cc?oF{5)%}vc#gw%)E4jZexWqxNZzd6QE>qMq)~Sd2)XK#9KV_a7#hj$}&^St+`6` zGSh&zgH4>w$tc4DQZrebQ31jTWR!+5iWrq4jM43!1P@x{ZA6ipDfD=5twYpC<75m zV3ctIDJ@VaOHDRWD2p#itw_$#FG?}C<|<1ps?5ww2OEhYZ-Od6`52=i#KgZaqve?t zl#q-rjW0+nO3W=bwB{bs{L%k{m vTLledg#qkxNE(eM2e6Az?qz335;F#gDVm^b1qo;?80eX5T65KMaWMb@viFQZ literal 2002 zcma)6$&S-N5bY6%5Od%c>Vjl5!t$C$5m&@zq>+&3f<~5^n4wX;$g#5w;=q6K3;ZM1 zal2g}yOX)Ot6$Z7RsG6$Up~M3^ylB-*KATpX}(T2Q(z3(8+p3p$$omp*cE$ABDZD! zvx!dYsEErr-MW(&wfzyV^ZiX++*Aig<$HGf z@(@5AWqFy#o0TyN@DWhtTVC-zTN%5!Jo4<3R`6k`DvVqQczrfs0IKBhkmu#v9c7>h z?;^s#hzLdzqK_Ru*UG3f{vAgGXhjcQ5kaD2ij z^%cP5Cc2e2!#nfYw!nK;(GsP44wk&wh2ro;4YRd2W_z|{!3Uv4n~(jeeE+1|>FM_E zMt4gmjv}SCKT;EfW}k`f|1DuQbB)mjcuO|t>X+%oTBpB&_Y5P zj!=e@5@*?NF3JiK zE`rn5naMuXuL((omu2U3anucUL0A?;7FW;W^;s6@SeArkIb`wlEW*j8m*qJYx3{{^ zkjK~a2)_~@*J+8!AKw9AkU@v*`T*oQm~R` z>*%IdxmB{_i=}*$I~}%Ovboqku>!%+ibhs6wxXm#|9*BHCS}QADw)C(Jqy^RuM}94 zi!x)YscWGL(uG)a$wfYOH>}+Ae9=b}*y!jJk|KE_R?#xuy$VszBTH_RkFW6L3QsM( zs(pjonz~ia-*5zNTN#rSjNM)1)ozEHda!!aL$-D3_I`#wx`O}E;0&#en0auHS2b#u zg3lpiJO|Hr-(BbzPC;e`ZaP6X(7%H%JU|qLN7!zEK-4@RfW<0#Zm$VB&zQ2BB7D;s zeU-{M($*F0*RHY3;C0uFv2hUkaIfk(6OEneXj0c49@R{OrsmE}eX5Y|#?i2OD*TXo zX7PRD#8*LQ{P7C4Kefz^w*JR6Yp!%KuHKQ>jwN}|b!YvvZmQ}Ixi4zc>h$|=gyt!RsO}RD^!0A5#MDQZ^yD;ud`VAF_2iO13e+uo h#vc{}V+ey`qw!Fv0Gp5ug$l3<=}@SEPWa)v&ObEQBv}9e literal 1968 zcma)+$!?rL5QedGa7+$=GzWeg~@1OV9hc?N}G}}JX>~M2sSy$Gr6nUu2AAR(uO)658 zd>34ID!Wa#bo0{OH%F1Sdm(9gxF;0`eQh+*Mni2h>Z8`RWs#<->G!tDAkR|T<`wL- zrx-|5lyy$FYg;RbP*9aS+R(CC+j~-pUr22CObZrWt|3Ef~*KH zDx!;uSgT-j?D6}p?Y5xLxDqjBPMR2`?|E6lzW7wtty?%?dOmQtBa8yYA#YOQUJXOZ zwQ#p@P_g}%G=-ed0vy-=X@l5QH(`@k=z|2A0Q}iIz-I_NUx^)0uNal>1+dvB4};tA z%#pUvb_yRwMVFOQj6AS#3c(Fo4Tn1%vqR5!;S=k`n2+;`{HW{OSNe{;zHg3WuPlY% z0z~!~ioRx!Jiyp|%koKgZaB~&TPbCi`tSxqUSnZn#D&9XX236$&TPdSm9!#pT)0-uAV opSj1bH}}W_-|oQo_?P9&4;9tYpo$dL%AkrB74|eDf7!P64;MFyb^rhX diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_omni.bin b/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_omni.bin index 56b4063f7b42ff8253fec801c9d07b9d2d0716ff..b73a33f1e45f624b271f504c06b0a8ebcac7b62f 100644 GIT binary patch delta 450 zcmdnO^MHH8Y9Rww28P6vlA_F{(vnn#jLh_miTkBl!1MzMJ(-bF5-c!Tfe|X=$S6|} zQc|E$mYQs$P!?a3T9KTeUzB2G%~h6IRGFEV4mJuy-k5;A2^M){p!sE)spZyOrFofY z`9-;4qZJAiauZ8T6iVZB^HWlD!Y~v}=3r8QI9rcN3c~PXg1Y}9lPJFds(F)vVv|=f zaYIysI2RBcO^B!fa}k8m!E6O#oM5hjFuYiDA&k8&sVZgh1^LC9C7Jno3bqOwrSUny ypepe#sZh{TD9J4V22i}I=HxO~RW5|W$%|RlkhvF8x&K+!1QCigt+{HsxEKJkUYyzh literal 1588 zcma)6%TD7k6b(Y78NyN6K;kp_1^$ui zJRFBQw7d5D+;i?dKF-7apVOPykN02Jc@<|oNtX{S-JG3R)`|67tK60RZ&N+1;)0em zTLnLBlwHM3HeZNau~luW1x@(omKIp_jn%+d4UJXORNsDB78RmokCjLvOA}UQ1+3Gj z2xy%1GNa3xZ3GYm6nw=5=`XlOJ-C=pxx(TguL;6RBg9P!2Wrw(yKp5Z8STgYR6nWb_6KtlubI1(lYeDP_X<$5 zc~I;nb@T=L;fX7oMkm00stF>4b5T3N(77hPUrg&Yqgqokn@pQ%k`sgEq?JT3yT=Td z;OHKpl*+cZb4RzEYEsi?+%EC`w3E8M|8gL%)vDXIFGjATN6T`ng{?xc_+{S delta 147 zcmcb}bem~{LcJLy14Cj-Nl|7}X-TR=ZfZ(qX>Nf+S!%MeLSlSDesN|=W`3SE7gi-k zKqV!q70LPeMJWc>TxE$xm6>_z$c7jxlp(7q&C5*7FUp0h$W5F$U6l=D>BIvQ0bpD< AfdBvi diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_depth.bin b/examples/runtime/shaders/gles/vs_shadowmaps_depth.bin index 9a3c7c4064e11385a674e9321ff5897eb1cc096b..f6c7b8c409a3b6a04d8768479e6cfa7926f13581 100644 GIT binary patch delta 67 zcmeyt_=$0Xg5g;P28P6vlA_F{(vnn#jLh_m0)?{FWMhTI_=5c6%#zIfJZrAfyv(%x RqFk`_#86EZkg|y_B>+J&7{&kq delta 73 zcmeyw_=9nRg6U-j28P6vlA_F{(vnn#+|-oJ(%b@tveaZ_g~a%R{Nl`#%=|oSuF|~B TwEUu6sDg=snrslI6YEL<=m#5X diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_hblur.bin b/examples/runtime/shaders/gles/vs_shadowmaps_hblur.bin index acf50452fce1c202e92d764a7d4f7e3f932f12db..d50626daf3d2fb4fe642d6c7aee08fc32102478a 100644 GIT binary patch delta 231 zcmaFEeTI92w@?i$14Cj-Nl|7}X-TR=MrL}(#CX{h5M7{9mYQs&kQiT*T9KTeUzB2C z%~h6IRGFEV4ps-1FT*QuqJWS$MAbj>g$xVGp2=K{P=*eS;Rjo6FitRf cLKxyq{Sd|)ru`5`A@g|%!;J;XkY>FI0Pz7)8vpLXWfId{=rz2 zzO`p7p(G$k}&)5%RPGZ^*V}>%HhcPu+ J;LP7F7Xi!OO2GgC diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_packdepth.bin b/examples/runtime/shaders/gles/vs_shadowmaps_packdepth.bin index dd3ba26351b1df93009caaf95c41ebff3274a0b5..226acce4d6032e043e3f81d30e41e81083844280 100644 GIT binary patch delta 91 zcmaFBw3catf)EEI14Cj-Nl|7}X-TR=MrL}(L=!6(FkPYvp%=Swr{}~6^nhuCf`~OE14Cj-Nl|7}X-TR=ZfZ(qY3@WLD>f*rKoiEA>!Jt|D^Ms)O*T;| v$t@^LEQ&X>=2C#OC%#cOP0xuB$S=+;$;{7Fu!YNjRF%aSV3Vlj;$i>*xg0Q_ diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_packdepth_linear.bin b/examples/runtime/shaders/gles/vs_shadowmaps_packdepth_linear.bin index 3b4af8d43546da6013bb5c99c451082145b1e8fe..139680a26441a68f8af39cb3935797934e9f848c 100644 GIT binary patch delta 106 zcmaFMw2Ntif{-X914Cj-Nl|7}X-TR=MrL}(L=y`ZFkPexp%=Pvr{}~6=2C#OC%#g4NzaK7$S=+;$;{7Fu!YNjRF%c2q!yH907W%4V7m3H6tol! R^h`Asw84}$S1lJ80|2ShGO+*v diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_texture.bin b/examples/runtime/shaders/gles/vs_shadowmaps_texture.bin index 9ae9c94b11cbb638dede435ee304f40ee09c4051..efe27355d507f42c9ab56827c16db4553dd04728 100644 GIT binary patch delta 109 zcmcc3bdhO-La+`a14Cj-Nl|7}X-TR=MrL|OfkIhovav#9d_jJ3W=Up#o;4R11x7#x mC8-t3`T0dD2G(3ATN6T`ng{?xc_+{S delta 147 zcmcb}bem~{LcJLy14Cj-Nl|7}X-TR=ZfZ(qX>Nf+S!%MeLSlSDesN|=W`3SE7gi-k zKqV!q70LPeMJWc>TxE$xm6>_z$c7jxlp(7q&C5*7FUp0h$W5F$U6l=D>BIvQ0bpD< AfdBvi diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_texture_lightning.bin b/examples/runtime/shaders/gles/vs_shadowmaps_texture_lightning.bin index 5504480753803fb075326b16c83a43858510cb45..3dfde4d71386ceaef0d242323775a814ba3502a9 100644 GIT binary patch delta 136 zcmaFHdVzIN}x28P6vlA_F{(vnn#jLh_m0)?{FWD|wN_`Lk0+{7GfE>!7>>9Q;! sWfQw(AoLnZ2z?sLe=82=Pv&BT2u#*t)P#scGZsM@ml+!&j3}la0P@l>0RR91 delta 228 zcmcb>`iymgQT=)*28P6vlA_F{(vnn#+|-oJ(%b@tveaY~g~a&0{G!~%9BVGD3XFjY z3i69HOEUBGa40bXDk({=NY2kMN-?nJDoZS?%*;ziwnfTVp$u*fs{F)*GHej{OnfK~ cWBq}NO_pKQgbGgfWGsR)_cJ!am@Z5`0I>>GWdHyG diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_unpackdepth.bin b/examples/runtime/shaders/gles/vs_shadowmaps_unpackdepth.bin index 9ae9c94b11cbb638dede435ee304f40ee09c4051..efe27355d507f42c9ab56827c16db4553dd04728 100644 GIT binary patch delta 109 zcmcc3bdhO-La+`a14Cj-Nl|7}X-TR=MrL|OfkIhovav#9d_jJ3W=Up#o;4R11x7#x mC8-t3`T0dD2G(3ATN6T`ng{?xc_+{S delta 147 zcmcb}bem~{LcJLy14Cj-Nl|7}X-TR=ZfZ(qX>Nf+S!%MeLSlSDesN|=W`3SE7gi-k zKqV!q70LPeMJWc>TxE$xm6>_z$c7jxlp(7q&C5*7FUp0h$W5F$U6l=D>BIvQ0bpD< AfdBvi diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_vblur.bin b/examples/runtime/shaders/gles/vs_shadowmaps_vblur.bin index 7a56d9e25c32ed2606ba3dea2c2913a7d431f3ca..4deb8068b72c909ba7620ec551aeb50165c0c4b3 100644 GIT binary patch delta 231 zcmaFEeTI92w@?i$14Cj-Nl|7}X-TR=MrL}(#CX{h5M7{9mYQs&kQiT*T9KTeUzB2C z%~h6IRGFEV4ps-1FT*QuqJWS$MAbj>g$xVGp2=K{P=*eS;Rjo6FitRf cLKxyq{Sd|)ru`5`A@g|%!;J;XkY>FI0Pz7)8vpLXWfId{=rz2 zzO`p7p(G$k}&)5%RPGZ^*V}>%HhcPu+ J;LP7F7Xi!OO2GgC diff --git a/examples/runtime/shaders/gles/vs_shadowvolume_color_lightning.bin b/examples/runtime/shaders/gles/vs_shadowvolume_color_lightning.bin index 6856f44c009d27488d7d17ef613abbcef4f1b9e9..d34be5b2e4093f59449724ee1fb87cb30b859ae0 100644 GIT binary patch delta 206 zcmZo>{m3%GsNRZ+fg!P^q$o3~v?Ns_BQrgtK%p!(*+d~RJ}Is cm;$)`#Ali;Am>dMWh{a)dKnub3=yV$0KAe(od5s; delta 190 zcmey!(#$%+sNRQ(fg!P^q$o3~v?Ns_H#H@*G`B#ZEH&9gAu&ELzbH2`$C?YP0%M?p zg8bsllFa-(Yp$}yqRPy?bYv5Z70Tcy;E*nxxRRF*V(G+PGBDOHO(<(JJ7W=ySATN6T`ng{?xc_+{S delta 147 zcmcb}bem~{LcJLy14Cj-Nl|7}X-TR=ZfZ(qX>Nf+S!%MeLSlSDesN|=W`3SE7gi-k zKqV!q70LPeMJWc>TxE$xm6>_z$c7jxlp(7q&C5*7FUp0h$W5F$U6l=D>BIvQ0bpD< AfdBvi diff --git a/examples/runtime/shaders/gles/vs_shadowvolume_svback.bin b/examples/runtime/shaders/gles/vs_shadowvolume_svback.bin index 0915a972eb31fe1ccf6050bc316340a2e5b02e8a..61065e02a930cea3aa008f98c773a04bdccf2feb 100644 GIT binary patch delta 52 vcmX@YyoY&$n@}Mm14Cj-Nl|7}X-TR=MrL}(#3*SNFkP(xp%+?0=m$>#)U*>* delta 83 zcmdnPe1v&|n`tE@14Cj-Nl|7}X-TR=ZfZ(qX>Nf+S!%MeLSlSDesN|=W`3SES7}~m XT7FS3RKdh@1vZG%iL)(XtQ$`N;KCoJ diff --git a/examples/runtime/shaders/gles/vs_shadowvolume_svfront.bin b/examples/runtime/shaders/gles/vs_shadowvolume_svfront.bin index 9a3c7c4064e11385a674e9321ff5897eb1cc096b..f6c7b8c409a3b6a04d8768479e6cfa7926f13581 100644 GIT binary patch delta 67 zcmeyt_=$0Xg5g;P28P6vlA_F{(vnn#jLh_m0)?{FWMhTI_=5c6%#zIfJZrAfyv(%x RqFk`_#86EZkg|y_B>+J&7{&kq delta 73 zcmeyw_=9nRg6U-j28P6vlA_F{(vnn#+|-oJ(%b@tveaZ_g~a%R{Nl`#%=|oSuF|~B TwEUu6sDg=snrslI6YEL<=m#5X diff --git a/examples/runtime/shaders/gles/vs_shadowvolume_svside.bin b/examples/runtime/shaders/gles/vs_shadowvolume_svside.bin index 5d329fd4dacc3f8c3d471c7517c7a58fd8ea44ae..b0c3dcf266d66d063761bcc028335c313a65109e 100644 GIT binary patch delta 78 zcmZo-{lYTAO-Pf8fg!P^q$o3~v?Ns_BQrf?Vw5Zkn68z9(DOwh^ezPm{lF4TPnKuA K4q^OZYy$uqn;a_u delta 147 zcmeyu(!@H!O~jmufg!P^q$o3~v?Ns_H#H@*GATN6T`ng{?xc_+{S delta 147 zcmcb}bem~{LcJLy14Cj-Nl|7}X-TR=ZfZ(qX>Nf+S!%MeLSlSDesN|=W`3SE7gi-k zKqV!q70LPeMJWc>TxE$xm6>_z$c7jxlp(7q&C5*7FUp0h$W5F$U6l=D>BIvQ0bpD< AfdBvi diff --git a/examples/runtime/shaders/gles/vs_shadowvolume_texture_lightning.bin b/examples/runtime/shaders/gles/vs_shadowvolume_texture_lightning.bin index 5504480753803fb075326b16c83a43858510cb45..3dfde4d71386ceaef0d242323775a814ba3502a9 100644 GIT binary patch delta 136 zcmaFHdVzIN}x28P6vlA_F{(vnn#jLh_m0)?{FWD|wN_`Lk0+{7GfE>!7>>9Q;! sWfQw(AoLnZ2z?sLe=82=Pv&BT2u#*t)P#scGZsM@ml+!&j3}la0P@l>0RR91 delta 228 zcmcb>`iymgQT=)*28P6vlA_F{(vnn#+|-oJ(%b@tveaY~g~a&0{G!~%9BVGD3XFjY z3i69HOEUBGa40bXDk({=NY2kMN-?nJDoZS?%*;ziwnfTVp$u*fs{F)*GHej{OnfK~ cWBq}NO_pKQgbGgfWGsR)_cJ!am@Z5`0I>>GWdHyG diff --git a/examples/runtime/shaders/gles/vs_sms_mesh.bin b/examples/runtime/shaders/gles/vs_sms_mesh.bin index f668cef1d41cf54c6a8a72c8007b23da5a626407..a56af6e5fd7510f75c014eaba83c1a12721d9180 100644 GIT binary patch delta 235 zcmZ3&-o-w_x!#GHfg!P^q$o3~v?Ns_BQrgtK%p!(*+d~RJ}nw_W%H)l~YCl delta 253 zcmeBTU&21Yxju%Ofg!P^q$o3~v?Ns_H#H@*G`B#ZEH&9gAu&ELzbH2`$C?YP0%M?p zg8bsllFa-(Yp$}yqRPy?bYv5Z70TcyV39TfN*7PuC8CUEDM(9MW@@=LS7}~m8qjvA sc@y8tutAhf=4DiXF%212V9ZFyA{g^LqZN$F%Txnn_A=$dnE#l109O24>Hq)$ diff --git a/examples/runtime/shaders/gles/vs_sms_shadow.bin b/examples/runtime/shaders/gles/vs_sms_shadow.bin index 9a3c7c4064e11385a674e9321ff5897eb1cc096b..f6c7b8c409a3b6a04d8768479e6cfa7926f13581 100644 GIT binary patch delta 67 zcmeyt_=$0Xg5g;P28P6vlA_F{(vnn#jLh_m0)?{FWMhTI_=5c6%#zIfJZrAfyv(%x RqFk`_#86EZkg|y_B>+J&7{&kq delta 73 zcmeyw_=9nRg6U-j28P6vlA_F{(vnn#+|-oJ(%b@tveaZ_g~a%R{Nl`#%=|oSuF|~B TwEUu6sDg=snrslI6YEL<=m#5X diff --git a/examples/runtime/shaders/gles/vs_sms_shadow_pd.bin b/examples/runtime/shaders/gles/vs_sms_shadow_pd.bin index dd3ba26351b1df93009caaf95c41ebff3274a0b5..226acce4d6032e043e3f81d30e41e81083844280 100644 GIT binary patch delta 91 zcmaFBw3catf)EEI14Cj-Nl|7}X-TR=MrL}(L=!6(FkPYvp%=Swr{}~6^nhuCf`~OE14Cj-Nl|7}X-TR=ZfZ(qY3@WLD>f*rKoiEA>!Jt|D^Ms)O*T;| v$t@^LEQ&X>=2C#OC%#cOP0xuB$S=+;$;{7Fu!YNjRF%aSV3Vlj;$i>*xg0Q_ diff --git a/examples/runtime/shaders/gles/vs_stencil_color.bin b/examples/runtime/shaders/gles/vs_stencil_color.bin index 9a3c7c4064e11385a674e9321ff5897eb1cc096b..f6c7b8c409a3b6a04d8768479e6cfa7926f13581 100644 GIT binary patch delta 67 zcmeyt_=$0Xg5g;P28P6vlA_F{(vnn#jLh_m0)?{FWMhTI_=5c6%#zIfJZrAfyv(%x RqFk`_#86EZkg|y_B>+J&7{&kq delta 73 zcmeyw_=9nRg6U-j28P6vlA_F{(vnn#+|-oJ(%b@tveaZ_g~a%R{Nl`#%=|oSuF|~B TwEUu6sDg=snrslI6YEL<=m#5X diff --git a/examples/runtime/shaders/gles/vs_stencil_color_lightning.bin b/examples/runtime/shaders/gles/vs_stencil_color_lightning.bin index 6856f44c009d27488d7d17ef613abbcef4f1b9e9..d34be5b2e4093f59449724ee1fb87cb30b859ae0 100644 GIT binary patch delta 206 zcmZo>{m3%GsNRZ+fg!P^q$o3~v?Ns_BQrgtK%p!(*+d~RJ}Is cm;$)`#Ali;Am>dMWh{a)dKnub3=yV$0KAe(od5s; delta 190 zcmey!(#$%+sNRQ(fg!P^q$o3~v?Ns_H#H@*G`B#ZEH&9gAu&ELzbH2`$C?YP0%M?p zg8bsllFa-(Yp$}yqRPy?bYv5Z70Tcy;E*nxxRRF*V(G+PGBDOHO(<(JJ7W=ySATN6T`ng{?xc_+{S delta 147 zcmcb}bem~{LcJLy14Cj-Nl|7}X-TR=ZfZ(qX>Nf+S!%MeLSlSDesN|=W`3SE7gi-k zKqV!q70LPeMJWc>TxE$xm6>_z$c7jxlp(7q&C5*7FUp0h$W5F$U6l=D>BIvQ0bpD< AfdBvi diff --git a/examples/runtime/shaders/gles/vs_stencil_texture.bin b/examples/runtime/shaders/gles/vs_stencil_texture.bin index 9ae9c94b11cbb638dede435ee304f40ee09c4051..efe27355d507f42c9ab56827c16db4553dd04728 100644 GIT binary patch delta 109 zcmcc3bdhO-La+`a14Cj-Nl|7}X-TR=MrL|OfkIhovav#9d_jJ3W=Up#o;4R11x7#x mC8-t3`T0dD2G(3ATN6T`ng{?xc_+{S delta 147 zcmcb}bem~{LcJLy14Cj-Nl|7}X-TR=ZfZ(qX>Nf+S!%MeLSlSDesN|=W`3SE7gi-k zKqV!q70LPeMJWc>TxE$xm6>_z$c7jxlp(7q&C5*7FUp0h$W5F$U6l=D>BIvQ0bpD< AfdBvi diff --git a/examples/runtime/shaders/gles/vs_stencil_texture_lightning.bin b/examples/runtime/shaders/gles/vs_stencil_texture_lightning.bin index 5504480753803fb075326b16c83a43858510cb45..3dfde4d71386ceaef0d242323775a814ba3502a9 100644 GIT binary patch delta 136 zcmaFHdVzIN}x28P6vlA_F{(vnn#jLh_m0)?{FWD|wN_`Lk0+{7GfE>!7>>9Q;! sWfQw(AoLnZ2z?sLe=82=Pv&BT2u#*t)P#scGZsM@ml+!&j3}la0P@l>0RR91 delta 228 zcmcb>`iymgQT=)*28P6vlA_F{(vnn#+|-oJ(%b@tveaY~g~a&0{G!~%9BVGD3XFjY z3i69HOEUBGa40bXDk({=NY2kMN-?nJDoZS?%*;ziwnfTVp$u*fs{F)*GHej{OnfK~ cWBq}NO_pKQgbGgfWGsR)_cJ!am@Z5`0I>>GWdHyG diff --git a/examples/runtime/shaders/gles/vs_tree.bin b/examples/runtime/shaders/gles/vs_tree.bin index 4f56d478dc89b7af0c9deb357fbc0b70ba90def9..73e62d45f53991545d73a5b007dffd394603be61 100644 GIT binary patch literal 787 zcmaiyO-{ow5QW{c!YsJLEE6O`>QrnZ_ADzQb!(X>O^xC>3Xao)I00AW0^9;SO%u1I z>du;<_r4j=^5yyJS3G`C(M?T-OwxSG)8=}D&;;E&kwqon_R*gyLQJWOzt$>+4bL_u z=yVkUqlK&l%VT^dUCMW^xGY8si0N19b|qz%gfZ5v+VLWD^>wd5nl$PoZ3Og1S#2hc zab57W;qM#;Q*&_Uzm&K8G4_%tAQ&&e^YJH!0e=okl!lwmViP{Rg9e^p7MOXR*mn0} zqKppf0?2Z@=(cBao&#o$;jUNot(3OCw$5n_tn7m;6f|vd|ARduad5~8B5Acw5jC}Y zJfR!Nh;O^B@_)m~F^pQn@MtGdXXtr{8#B5j2z|J>+v{fDU*B1Ps0VN^!c-rf-518_ E4+dNWCIA2c literal 851 zcma)4%}#?r5Z>C8>%kZBFh?*EDG)EjyT>Lby^^(HyM|>6F56b)6ZoXQg|i6jwt?u4 z%zpFzF{{Ui`Ior+JR=uvCS+ceD_-o*XN1hir88MJ^5tiGH7A5A)$pfQ6(EY7x1t7J ztYctVB^$xYluiO_`N|cS)dVC$4pr>eQZ{**Qq7tJuQtaj+NuoCTfW)$7IcORql*#f ze^6^opVGGC&zQvO3Z@cp+V~q``a&C$=O7rb!1L)l1xtu^C7?u&39?0s55sq`gL_y6 znBAG}4{tbSCR$(KI8)?oMY!QPmW?5}wmQCnZpv)gQzE*z(2;aC8irvQ7!S7=6YM$y z=kMD%v11}0i4%8Jr*U*o@kzmSG-~OdQFilMIgNf+S!%MeLSlSDesN|=W`3SE7fvN5 wsTIlj`9&!P)?8(YMU|O(>8OU3#UrUG&C5*7FUp0h$W5F$U6l=D>BIvQ0btrTg8%>k diff --git a/examples/runtime/shaders/glsl/fs_bump.bin b/examples/runtime/shaders/glsl/fs_bump.bin index 2f8608b734e55765caa25197415d41afb587da38..dd51243c4ea6339832dd4518d009a3393bb58ad3 100644 GIT binary patch literal 4462 zcmbVP+ioj06b+&hQjie*fgfi|I*jefP1WHAbObL5mB*uMG;QXDNJ*w7(tCzwT`^lcZ@;+e^{#qm_-_92^Lkxw?waARzUlRL#pY$Pp0i!~ zDA_K5Sk%ROUasrg{?U`QD&q}@!UYlm>0?!GW~n!0w)J%O@Z(t!E=A-!ksSQENK5Z{5Y!J1~*O|$2FN%kinB2UQjZM zumSb+rUZwPC6j@@H8I6rGm)e*yI~yv2vwWt6?wLQZ0ab&BLvKY z66pEeHe){I$5=B*LmgXX$C&lFgaScggh0k3#e!PCjvo%p77yc?eP^n)w!^+B`N0jpJRzN_tOmvetJRD_Qvhn_DJBf=T+qVxqs-LL%m`N&(~mh%4ttaV zGlIzLxatB3#;Q25NO9Sgv{%6s(sHEufioJTPTBYGh<|M0wV#02=gX5TyPMjAl6nH= z7X->xhiEjwB~o}2MFwA@+_n=ZKV1?j7cI>koQGsel^mIJ>FE?h=Y+~_%W~ye&5sO8 zm5|WZI9lb(w1(CZ))rPP9~!xIa<#3?$F^MEtYcrVKpPe;AH7MjwpaP&l42(ch^JW8 zv?V(UNtTb!YZhy4*tJhA5@}>)>hwYCqt{HeIIShK1w27_Z+jCW$RoOYsd!_eF^%h4 z>a$cwMdbK@jKhHlg$BO`mXO|0Ljhf%1_hqzuryynV0hM|F=A@ZZtiqA>Y4^@*V)Ad zdkfV+8+(fsDZJ$(gKuwPw>`lz@1nh@oxP`Fds8LH-U286(J_RfbM_W?#}lgKowYZR zc=i_dok&p23)@==vm>p&h28Z;X4~7%n)&ty+OWNae2cw>-QdLVg1r$CJdjY+vNxgv zClaVRcO+r?C+zLmJ!mnl+MwGB@~2r0y6i00dcE>V1pJOBPc-Ut5f> zYo5iBAz(4PPYb$KU9y-MwH6bju*Im7Yq7C!F*HDnVA6qo)f0Bt5vuE)vlt=qEGF$+ zo20gL!eUd;V$$wB5*IE^HuasXI224?)AE5fY%!U>#bVNKGE!Wy7y^P8Lru$KhzeK? z)SR;zmjAykrd1oX7(uoaaOOaTE-j0xFF}hVS1+mR{RqBNR}2yw-Hh?Z z(*1=R?Uq4@`%|@NQSq?#-Wyd)@3rw2DO75a;Ff9r02A$i1BR~exVdZ5x7U1Wp9xZG q%qB@vEJ9$(~utzMV1I}Ole(yhV@hlYp literal 4368 zcmb7{+iv4F5QbeeKmqq=AAy&W*HJ~vCn4D0v{a`(Zd#YeAF5@w>3r3}zi;Kh zFV$vMEY--n-E_H_|6c!EZSRZOVz>R~rqj9UnBn{Rv_4Z@46>%)-sGY95NShgiN2RYBNi{8T&TB2EgDIr#lBk1*s55pSrm8w>@p>bTKbgVVPI9% z8LL;%P-iM=z&w9SAJ_+`Oc$?Z1PPRqv17$gts2E$J8^2KJWC^!PjY-g$S8u=^=?x_ zuE-*yZ|_1(wml}2G-kJq<3Gx(ar6p5+dnpS6yX&NW>w9i=I!yN-2ydQ^dlVT`R$Hk zK1gFs&C#ijtgs`@dRhWDh#0|;u}G>Qm#^&yeY3@bIA-6OC{2Z7-;+a3lW$EfWTu7G z*~M|6rAgXvl()qjTN#Z>2!j+hOzi>5Xwp$aI!l^Z4kmEm>|T@p*zB4x3(Bo|d2+-| z9mIB+Cj^;vX>u52sah@og)Gf9DT7IR%4ya5Rc3+@%m~NH&{Pjklj8wlAd4X7TA}oO z7*HCk;>aQ?WE0Z$LLf&{9F&Es(h2+i1Bs8_>-i3_JReOiOWlO#2@gJ=+%6?fwR8%)*1utguU2q+i19q-AyzW|ktk%;r9``9)@hUB*I| z@kM5liN~yPE_tfsFtdVt%nG}dMP@VWdd+-hk!_e+A>P8Qu&Y)Kt}qLO;312c7PGJl zFe}7GX0iMLv%)?Q1RV%Iv)L79g*+J)vw|*k@0^8)0JC;A3%Yi%owH)tFe`>(W+{@x ztQdLBV(8L2E9^2BvWzb=OPTo0+84W^IzGef#A7zIOF6@>jL9ax?G>*G6{jsgwr7~l z-@Bmhmm!Dp;B?YLm6`?kc`VpYf{>Jv| z?g(9_N26|PdrbD5%wT73MZ~mPMQKBQi*6_N9Mjs2=#8E!pEKFLM^0A;-eRdg1GMka z>3S*YR_0tvxXHdeCA2JUPU??PQarP=I+K>Zt$HUC(J5u+W2s}Lz!lW2#Tko2sR(q2 zMj!R?UhPdlDSa57rbG~4Noj1!g5##mFPPHU%?KOUW6#xrMaARR``nXQdS835z)<2T z64A$ppZbNR(sAJcO^r8tZW_mgra{l_n=ccZ`z8y=1wPYExHK6I>4)?6h>!L7B z2C@izxrYPy%WVGMy?kE3I)vu_Hr!8CqBQ9cb2eQW?`0EE-nTD9r!58 diff --git a/examples/runtime/shaders/glsl/fs_hdr_bright.bin b/examples/runtime/shaders/glsl/fs_hdr_bright.bin index 9d0cd2aa5e30700ceb1bbf0ed9d7591e4a579eb5..57f4ab09e73e13928e0e378e4f5d5c51e22711a4 100644 GIT binary patch literal 2299 zcmb7_U2obj6oyl6QoCIB7fk2UX=!RZpNO%WR@E+cx67$QDGdmT5EMQdTJ0z8KknGZ z!E~f@07bTsea_vEA7+4B6%an2kU z=Xrfs&dUmC_`&_S@N-kB>E8>-*=E&lwwS^;A9L7>@VG3iXF6~*#d~?zPTW(22f3(Mr@#FA*_of(vG-T z&|??^7Fchp9E%Zsy`Fg!?|p*6ND!PzARE>LVsrzp4;`S7e!cT#R>_AM$Q~!a$SYhy zUN1QzhzUmM1p_>aeCmn74KSYKSS6A@-X{qSys$eSJAtP-uN#=qrIsPkwwg!;6HyVS$$fl@_v{6^TAGFJapsJDkwepsqKxCJtv zqv^r1=yShr+&~K~KSl0|tfD>>kHka2K^96`V-JD0JZAbI-VmA)P0*t>m0!$`cvh2D=;NnI+yjtl{b Z#6Ms literal 2193 zcmb7_OK;Oa5XW7C)Z$Y=0h;5w4X)SkD1=K<#eo|~R7ECrqDXNZIgh4Ae0OHoyX!Go zKu)4)pTGIfc*gVa?aQ0`{ily_ovXvFUMzOy{_@&!uAO&>*}mSCRk6LiaGVRr#d&$U zuh(^hGyLIsT=;sZ+Ufn3;~b0TWwlwtv7Co+6x;KJ4^4@9 zrX3nl?VdO6$X2Yq8othJBKAf7`sbfMN52t2!D#!BcGCmm2&3oL)6i=^`IC2@Q ziW4S&IgeQ22P4pb-Uv_v-~qFTF(DRJQ+cp-`D|I*N!L|N`5D7@Zskl_# zH+E(Cmrt#J?9ty-R<3OAL+ zgMO6yF~VINMvB9%y1`uL@*}bi8%5h1{a5i=#df!J^572Ge2r}jTFnxK40_7GwQH?R4(6oczQRg~YP-c*BWL{3qTOpX|kGKiQa3eDVSy-3g?>0qOfd z+K0)0vMH1JQ|tDvEw!KDBM z8k0A&7*5V-;h4OiO;p54uUtV(!N}B9&p=Z_SHaN8LeF4w6`SqkM=T1_tpsj#pC!-lyHkD0uay45MlLo{g zdh8sN1K30vEhhJ~NKF=EGh?)z>GeR`g-LueE0g`?SwK1(NPhs*8-cVNv-o6oX8XzWn7NJ9a`F>P;D#C? z+hCwztDvEw0kl&AL_-)r=H&S-Mhb>{6_r&AS_)uUkc!lb0wbUzm{TY3W0PW1P?-FY z)lAF?tJ=x`ndK%su(M58VDX)t&7vx*pr8o^5CgSg22WnVVrK=j8fZDxd=tHLpyfuU zrg{cY9SRD%3Wi1&Kt9Y6O$BWQpmt3ws2gE=O`*;~b+IXuiEyJPUu3goG@HDTO=j{n zR#Bj9Z6~XQ@NNzrvT9%EHUEn7vGmG3isGJCS+Qf5 zZT>PD+ms?}*rBabSmAA7u&MU=>Xdg6#%uP8VU?z>bF661C9jz!k+JtPjeF;u&bIxy zswY+T^sB;LwTH$EmNh~;C-#ozr#-ijoXLR)4DcXuT$_Dhz+=3?BespeW45Qt_8e9A zMRUH?oUh*;f1SOu@%ut0H(lH|mGt$Ql z2$+!yGooY05@xKA84@sK6=qDwOeD-iA2T9gCMwK?jtMx0r|Af;K4?q;1y@Ci5%N%i zezO0akpTLr2?Z6DsGxx=I|sNvDoECu{P1{$0#~wf4OZD?uta4~x$J^fsU^_x63AkL z1!e+@nn39$jL?6svYlXoo`B*fPznkobXHkWu)tA3krXH`g%LWd>?v3vDxjDOl&ZqW ze_4l3bR1K%t)SDDHT*Mf820S;i`TyivNxa;$2u=cs}x&4E_e`MZlhct3~!i^KXk{Z^9in-!}5uV!#dhoWLu`Ub++xd Oe>^{Bugu@3Y5W0K;g1afP75YC1l+E)dCmLiaSTNs;X{URZ5#G+m;r@6Y-La6(RnS?3QcgXI|)Z=Wut*e%Q!Fh$g^$*SJ zfvsn&4GTj5m(L_&x87o|Dcs_KdS)LPF5B(f3K4-}+^~R1Vb>;od>r!X$#^PvQxif>##1M5YD%c-cxvLNW`vrJr>1UdPN?~KYUZXEgj$TJ=5A_9 zsO5NS;idxm%h(_u&n*YImc3v+7X}Ol)M0Rm#RfbE)MRjh%V5A}Kz#-m7!3xT2GnYB zf!AQbY(U)x7uXGm-xhT<+v$UrIu3;8f*`;KWa7VkupZA|#H%{8qa%CEs^gaHbpnGC zI^YKe@HCC$u*)E)**gZjz_BpI<6H&vr)WHSibj%LGm=oHn2;1^%utCiy_!l)y7hXB z^?O&Sga|Y!9d7M5HBxi{DQ)UP=|H=1nL(+qkA4XmL1}`K7wV#slBpf#1Z~FtS1?+x z!Y-F=6on~>ETg6uXqBooBD8+pgQW|jDO3%_hGXia`gK(NwVkrbas7!w!49Ju~vD2bahYC)xkN3lAd8Hk*#fcS#O8-wajo*-xPTXuJJj91Yp?YHlHe*s2EQUm}1 diff --git a/examples/runtime/shaders/glsl/fs_hdr_tonemap.bin b/examples/runtime/shaders/glsl/fs_hdr_tonemap.bin index bb6f61bca354551ceada0db1020c3487bc91010e..0f0c0daad828153598cc4c1f3230bbf7865462b8 100644 GIT binary patch delta 471 zcmeAbdL%r-i)k|FMxQ^dB1t)=Me&A))?5k-P^NwJp&U1V^a%rP25gVn;g#} zh}$spdXOi|Qj<*-N^%Rz5`kf51QLOB^vV@%6%6$ZPz5V0tAN59Md?ZLh6W1S3K|A_ zW4rO+rwpuPO F1^~nog>C=< delta 257 zcmaDP+$%J}i)kOnMxQ^dAtkv5Wr;=chKAN$3JP$JUPWbY<@(xaAcAy_?xwser5#u_= diff --git a/examples/runtime/shaders/glsl/fs_ibl_skybox.bin b/examples/runtime/shaders/glsl/fs_ibl_skybox.bin index ffe50be07b849fc387a61c58b95bc76200109b86..8a3b35647bda3a15470ccffe365d9be372e26367 100644 GIT binary patch delta 48 vcmZo>`OiE-lkwt2tz`b>{G9xvctdM01qBdu;=Fbi5ItFoaUFzlmr)G>qR0_G delta 52 wcmey*+{`jTlkw_Atz^NH+=8;iqIg4VE(HZJd*YmSRxo3-I^#Mh>n5Wb0QYJWDF6Tf diff --git a/examples/runtime/shaders/glsl/fs_raymarching.bin b/examples/runtime/shaders/glsl/fs_raymarching.bin index 7c0de0c388123c4cbd5060998953800bc4265f1c..46dd45cbc5158a0f9238e6bcf1af432abe1d67b9 100644 GIT binary patch delta 1157 zcmY*YO-~d-5Y4c#i_5MOVfkFMZGxc(hH<)gWP?aPGGa6A5K6;`Thy??$3b_Bsn#dV zs`m+O^;7tnny|{Sm#0AcC#7|ipM^*Llkj86h6DKxb0aXEEx>POm*9nyALZ&s^^$We z3?7^tgR6xz@L`~s^PQw`%!ls-PBw5%WdR&bIYX?H{8wNlJ(HCq)0(RAtw^Df9)*`< zC3u(4TUlror{QyY3{GXvyNp~W@|Jqcw#ie~0I33df(_Hge3F_oxRWXQY6#7B*%^&5 zC3vOBVP?#cMR)ihGkFRBWG?LUGkj?dvq4-533?QI=-c6j;N?a5m8s`zIIhI|kPm(u zw`#EOj2`|ey~^!rPgG6i+SQMJt5uuGk(=6D(T-Xbyq(pW+m-9dYjQy~JV%V1p1kLB z4E0=0ts)If2$fq+77{(xplBF~Ljp->+YXkh4{cak7=h=GJEuh=ELD U@|fp?Soo6TdjC;t1-N_tA25?Wy8r+H delta 1162 zcmY*ZU279T6lH6Zmh{WoTHB^JmrBX3Nwzza>~5B}ioOXVBKROEYiv^pG~Jr4Z5ok+ z{(+_!-wOKfWBmaNg5Z-rh>uc#L4ScbGnq+N@{l|Co^$5TxikCr$=}CES>r*6v?uo} zjexGE0HXS?j60t*2JM_(F6>n|N;=D82nOpwUIg{11=n?*;)Jn0E%?l89kgLZ7Z~0) z9?r$3oS2k@C&u!j8_T#tT(#o-FXdSKra*3Ohm}a{dm_W-i_i+nBIbWF2^R_)S(IcY z?Qu-=c_Sj5VRRD+C*=jxlo%!}k&0WC^-5palYNs+Cv0i?DQL9G^0VYa=h!ZmP9D$eChc*%EE zhYxncWBryho_gRoJN264(HS>Eg+=wtVxtA9$i>D z9-K8wcs88HTZ3~v`Y}cDwT#Xuv-m|u^b)~DLR9Zx%+51ufa-<`3wnB;i;K9P7@v~2 zs<$~4XGP=M41SuKz&DA7Q75l$qYi#Z5IJiAVp}n^=b7Dn4s?At-0wXpuWYsRKv~(cO}<5U)HXMP-w)d= z^ORx%NE)G*-G4%!W9Gr()D%#0(ZJ+uZXUN+t~gy0!i|l<^SkAeBYr0C6~2xZ`(FkR I?^t*L0Y1M&l>h($ diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm.bin index 91d408157b36463afc0db4389f815e6a40a51977..5def00474f2843faf96c8ac156a4ba84ed0e6425 100644 GIT binary patch delta 336 zcmew*_g!v-HY20^W*x>EY=LE|$;JvLxdmm3Me&Bl)?5k-X*v0cC2%1VkPuAXNWoU2 zG(IOYJ);{Y`lLa{pIN{nR$8kh58ciC+Fwn7lB-+si~l?paIdOpfLFxuNjK!6rgITBaIC7 gD!{5I`|z2gC@KaSgrcxgbMhj-3?>Dw$=v+;0K}VT`Tzg` delta 351 zcmew^_e*YrHY20gW*x>EY%*y%`H3Y8CAkGFu2C`+T z$;NOA6Obx|I+Mxu9Fc-1ny8{ilV5Voku}jl=+Z<}VZ3<}rwrDoq7#1-K@S$sc*mkX5IER71nU$Uv_Gta`FLpSe7e Wk;M>mkQG)=p2wHLs56;^KOX?n>}FU1 diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_csm.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_csm.bin index 7b42850f25920f59fce6840667e33ea61f4a25f3..9f554ea54d3b16f8f5a61d3a7fc7657d46ccd7cd 100644 GIT binary patch delta 354 zcmccPbJJ%-3M1o(&8duLvVmo($;JvLxdmm3Me(NQ)?5k-X*v0cC2%1NkPuAXOu<&6 zG(IOYJ)6&ONEH+0d_%Jb=PhP6D4M@f)w*d`)tQ;z&p;3@uuAl)nE-|TCLqlV7wu+&S zf|i0tX?$*CNorAMVvctrkY5^~oS&0l1ahUOrh>MD21JvB!sN3mW=hDaQ-G?W4mLB< ltAMJW?4T+-*-BLb#o%I)aVW|wH78f97BeYmO@6DI4*-Of2w0j^17@(C3)WYsAk)zGjoGtsL6tDY>UYA%mt WWHH1XWQCQJOI3>*btb=3%?AJiqG-|p diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear.bin index eecf78f6e539d00539283bd44de3efc18d2375ea..d2179d9c6c7593040e9ee8b1468fe0f761d8eb41 100644 GIT binary patch delta 348 zcmZ1`zgT{QHX~#4W*x>OY=LE|$;JvLxdmm3Me&Bl)?5k-X*v0cC2%1VkPuAXNWoU2 zG(IOYJ)6eV7=HC;#H!1|&D~v;hsa;0+bh&?v|+SI__(mzY$np`kJP0I#8r zf|i0tX?$*CNorAMVvctrkY5^~oS&0l1ahUOrh>MD21JvB!ek{rGZfV+K-EwO8yV2R17i*MPa4pOY%*y%`H3Y8CAkGKmZTPCCgyl2YAS&E$@w|?MS2yLRhkOg3UEytlV$nLl#o=XfK)@n#K=Ie k0-{=D@&rE7$z6O3@<>XHA*LZKubg~}FN0BMvI&1a0Ef_MSpWb4 diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_csm.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_csm.bin index 6741a99efa0d4082ddcffa8b1ecf45f1dabdac93..0c017ecf7993e99f1b384c9c24d28bd2afce822f 100644 GIT binary patch delta 348 zcmdntx7BY$3M1p0&8dt+a)D*3$;JvLxdmm3Me(NQ)?5k-X*v0cC2%1NkPuAXOu<&6 zG(IOYJ)U(=97QQ8_1TW zCL6;gEI_Id>MSN3DMSidXrhXmO`fALN7h0Ip-U4@h56=CMIRpb2BRxG(a|L80Z=3D8L9!9R-bo{Bi{iurDoq7#1-K@V{>cYbMJDf7l}FZ;0@4Hx5;GIM3b3Zh bzf{fTkxVXz7>BH|a&n+rF{94pV`}*T{nl%R diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_omni.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_omni.bin index 39add6c3d4b13ef2b7016f2d8b0b1eff787f6b9d..13b128e20ad952ce58f5538d8ee718bca9919dce 100644 GIT binary patch delta 334 zcmZ2zG0$Q{FC$~m=03)&LWX6j$;JvLxdmm3Me)X_)?5k-X*v0cC2%1#kPuAXM8Q^J zGNY(4FS4NNDf{Og5G>)KSn<&?t@1O)N<*%1q4h zP6YBx?mEpq@XodYp~iAD;VX`+gnOzse!BWtFE(4~o{!gRBvm=6=9$>ctXZ9vjhvJGh2 z8Oc!N+{_9E4Uml*26_fM3NS)bM?s??zg$5BYf2w0j^17@&qX}WYsAk)zGjoG1995tDgK!%3L1F W$YO{&$OP%iQoeuzxf@mWE diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_omni.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_omni.bin index e20e83509a51669608ac89d22d68f7c6e2bb436d..f35ea55e60addd6ce5ee6c695a22b6ec460dbd32 100644 GIT binary patch delta 353 zcmext{=s}hFC$~z=03*dLV;ze$;JvLxdmm3Me)X_)?5k-X*v0cC2%1#kPuAXM8Q^} zG(IOYJ)BQj0PZbG#FQ{L=X3{G9wEkW)1^6|@yJAUYKkCZ|i8p{Py)s)oAS j#7M6Kta|cZDRUG>#UO)F6jo|Z7M3nxQqY>*BApKaDX?w) delta 356 zcmexh{@Hv(FC$~(=03*dLNaMN`H3Y8CAkGaoyZ9r07vJGh2 zJjqa#+{_9E4Uml*26_fM3NS)bM?s??zg$5BYyCQC`l7(xWJ z6iVZB6H8KyG81#W6Ezh;{N((c{35-I$|_9-Z3QHqNm6FWs#8F!p#frIq*nn}J$Z+e Zxjd4Q#Sn9l6;@8>mo8w`ncOIy4*)oNXdD0l diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard.bin index 3ec9cbb463c5a589fa6a548ebfbb91242d65fbc2..4d8ecc1ebec58d6b081765f6ce6f9fc92c942b77 100644 GIT binary patch delta 354 zcmZpW`zyOao00MCW*tU3w!pH~WMhSr+=8;iqIg3iYc2(aw4D6J61b2tNC+lxs9>v5 z8lRJyo>3BzUz}NznV+XuQCWqo#AtFFy8)x|nAq+E`?8h-j z)=&pwx+a+aR|=o00LtW*tU3Hkq`X{KOK4lH7u_#G-gZBWo@NILC1EY<2@iqseF34P?tw zla1jL#voM)b;grfIU)s(HBm(kC+Bm_ku}yq=+Z<}VYFF;(}#)CaB?a4HXy0P(+0F` zGf${-Zf1po2FOMY13d#B1sI{Jqo7fcU#_45wmmVaSOW;aYz2kMQoM$S5Vn>=X?$*C zNorAMVvcvBrUHncoS&0lq*qZ{rKzB;0N123xt!MwS#=6XH7qPF^(w%sC!ggtmq#+P U7-9~x!pg}id>M>7ll%Dc0dDPNy8r+H diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_csm.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_csm.bin index ee8a812f13910f983cd02ab5495e8215ea612d7b..d4aabf41bffaefa6e48c27138b670cac5becc8c1 100644 GIT binary patch delta 334 zcmccOanWN#3M1o-&8duf(uQTJ$;JvLxdmm3Me(M_)?5k-X*v0cC2%1VkPuAXNWoTN zvZ1UnFS4NVy^-RoDh3LloP92H#c;71Gcs$S+sW02`N>RIH()F*#YuP)9*aL8CN2H?btOC^Ip~ zI}yk)jZep3`KPcP&L%SW(Il{VAYeQmCaEU6@v^y TQCO)txlp;7NkMD!Q{{XBpYLYT delta 351 zcmccUam8ap3M1p|&8duf(lTi|`H3Y8CAkGEoxtSFT8Xy}r4D<|i6kvp=j)F!(ez}4M*!IMvVhtbwvlSF3Co35mLfBdgrSZ9m zC8P&v5oDTs0@@VM* diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear.bin index 1d98c4fd37d01fc4767403822d305ff7e95fcecf..3d6183e55d596a3d696786c63f9c19ba824c7f69 100644 GIT binary patch delta 354 zcmZ1=H&nAq+E`oX0Uo z)=&pwx+aWn9=azqLmYodx8PVVQJBWtXK(4~o{!f3MxrwU*$S;jg&dVn4P?tw zla1jLCLmP^btaRq$wmsAXrhW5O?Hr*BWt3A(4~o{!g%vfIUgoQqseZH+koU>#WtX2 zElQ!rxtSFT8Xy}r4D<|i6kvp=j)F!(ez}4M*!IMvVhtbwvlSF3zg99dgs`;~O5<}A zOHzw66LY*1H5EYorDoq7#1-K@S$sWpP$f{F7s-amkQG)={;FKes53cBB_9B`u4(xI diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_omni.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_omni.bin index df2ae7e3b8e545c357552f9075851352f0709d5a..98b8c4db0cc8a0d0f09844a867eec274eacaf363 100644 GIT binary patch delta 364 zcmbPZKGS?dFC!!S=03&%p}?}#WMhSr+=8;iqIhEyYc2(aw4D6J61b2lNC+lxtYE89 z8lRJyo>3BzUz}NznV+XuQCWqo#ANa>VFO0f$=V_YoN#TED?}n?jWt2)5Qdom4TGsL zoBWVncrv4Ct*o&QT+mn(O^4~`*`hv7j3$#`h;IXu^CjAV7O6>w3TbE*J*@AsPjw=^(w%sC#Ol7qbMo{8HA#+QgiYisRAYit;xF5`2delaF751 delta 367 zcmbPfKF54RFC!z@=03&%A(^zC{KOK4lH7u_#G-g(6KgI7ILCOhzK8*%$>anP1KG0F zWMjC5DM%GUo$2J6B9XGDny8}23bt?!W|JSX3r|)Ot(7&^feV^yqUkW%yhqfBiP3m6 zr^GfOc|f8KXt}#&sBvy)g@Oji1sVo=2098bLQ_XUqaeRrK?CfX#H3;kAON!!6eh2e zG&F>;wG>L@a}!Hai!u{)yc0DQK>XzVoctoaipnZY1#JbmCXLD5QfA1iQ$VVrVPj&b gR{>T%IZ?`79?8gJh&jj#D<|)eDqz%^tRb%7 diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_omni.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_omni.bin index 239eebae1e3d2751e7cb24186202bcd725611344..e8a151776cae409b47fd8d85b7930d1a7a0c3eba 100644 GIT binary patch delta 354 zcmexm_T6klFC*jA&3%k|LV;ze$;JvLxdmm3Me)Wa)?5k-X*v0cC2%2AkPuAXSix4I zG(IOYJ)2C`+T z$;NOAQ;;fzI@8JJB9Vfony8}2lOKxA;WgDk=+c~gQABw2Tv1OZM&rrP#kT>;c@k|v z3sfaTjdL?A6f{7#Xc*`j=qSJlO&tY|g8Xs?4X}-gNyQpK0A?#FOzx31G=#9V6iVZB z6H8KyG81#W6Ezh;{N((c{35-I$|_9-Z3Va{jma-1&5%{6fK)^MZ(^ud0aiWPUdmh^ X$;e`eImiktCr^_qVAPq+A)OBZX5(cZ diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf.bin index fa7d8e2e2a8a7630cad43942f484da3ffd7a71df..f1b4e1736cd856c76a5cfa034165893b95626145 100644 GIT binary patch delta 566 zcmY+AO-lk%6o$D$K`j(CXi?-{)g9AmF7t8kC`FWk5%jTcF-$5sFyq*KmL@(9wUScfh_UM7%{XQ3?TmuNH~G;Hgl9-O$o6R|`BNOdNSw;$cD2qUpG~6jAxKYxp{-qa?svF=5 znH&3|FsC|5gFr1NGy!MFf(GyEUNjA9$4G@!?K-Monw?^oj66-z z9G=(;V(`XxqWZ%GB*8i_L&%b;L3obYo_OSN&)1UixTqw-Cs$I0G~FvqqU13)&wWA& zh&s(h-brXUW>E7i(>^q#cW6{x+w}%13Ig811xYe~Ox*EG&7u!P``Z}9}{K23p Yup_{Bp+1AN@LZrtDVE>BY`;K%0j^E4@Bjb+ delta 651 zcmY+A&ui2`9K{*2h=L9HqnCnw!BQt0vzca+$!u8=v>d~mG8XXq7I4B_3R3m3uvV03QjM>*mW=@K<*kK5nsbh?=az9OSI|)l zPD5Ab@|Rh`x6-0VARqL?arz`I4|=PJ&#jU@H$I`V|9;3_@QhjupB+aQFP7XiJ3OuG+sxm zR=X|X34DyCpNvYZ>Xdt~=g_}lJH&U>S2Vw9Hp?>pUMIruNQg5hWwLQUF~u+&nfQ^Z zl8*a>G)^;jI@`19PU(3L62~(g-fYoZtzLxZxzjn$ajLK5i>9`6K9{R|toRu&cDI>> Oyelm6pO(N$SNs8wEXa}o diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_csm.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_csm.bin index bc0e6fbcdeaea855729554d08bd618dc9fd9255a..28433127f6331addde801bdf7f6b85c2f2cc564c 100644 GIT binary patch literal 61490 zcmcItTdO3=ab97t@M18&ycoZL)_Sg5t&wuvSS3iq?m*d|*f4qEsdv$v^{`I$ym)HA;!`*Rz^~e2R;{mkk&AjP; zJn-)xFRza8eth`z?fvoLczZLp{^Qj8+v^{Wha33t<6-K^fAZb&?c2xu1Nr2irenT; ze|Y_PwZ9`D{d4%}_TjtZ-Ql(C=?^zI{-ponyL)&z+&u2xr{BN7efZNOT+uk7e|WsS zzy5xI{r>8B^X|_$FX6)Pf84*h{rKkqs)titOLOXPv#bcTztreUlri=X1o8%+ccR1>P_EC~X{HHXX_z0R-d_AZKxh3oI3`*(K-$HKx0c7+?kt{6uU4(!~8Ps8n#o_pxo_3@X@;p+Y{ z4PlCON4bmG?#2)omyB+3EmQEoO--$snga4Uotq&U;ULXTfjJlkP!z)K#6bwNQ|!p} z6h+cI{3%Zm9=JF|1>#|vqN3#HsL{+3qKM{C0m)Ai2>ui@s6YV4S#lWSawrZ%nx%@) zQk`~RFU^uWFrOuNEk4bB<|FEY@Ld)N-OYx!xFIMAB+JtRF&yW>!8n-%+C^B79YV#B|A2d%#UBj8F{l%3C>Uj3bo#tDwB~$i|gYuJuisc~S^yXD@0ibpNb-nqJ zGOj_rnKli-a~sLaa$gHGBRMm8}Y;o6p+>seTmg1k(tNAfRzZgMby&l_V;c#<`v%1oLhnJtj8rXBroV&{zo|_zBSy zPwX}vFv2lb=-kDOXxhHHeE?QGe0q4iJHVdLWm>rLco~+ZeSz0rZ<~vu-PP^k)o#~2 zc4*3`@7-UJ7BJvlHSF3F{*An``3-*fNcXCorF-S}Q7h?=F_v_% zisw)F0c1p%?!$7rdlf62NSoETTTZ#YO1ZvT=Xwa4CBHiND~{@`?DnZ3V`izoiYN|u zLsd%k)tu@p*c#4q9~wETuM|{YX{f$ZQa#4;x$nEty-HGIq}yV@k1k<{0ic)JtHq|dTJ%{V;rCSz8g*Q z&xyZQ5I@G4lK=UM9~MHH{J3OB;;%X4uT$c$*NGoO=E<+#_0$~m*D~|hEb})E^EWB; zH*@B%Ip&8(F8Lb;^EVpiZck4t7G{)Qv|CMEu6o%kVSmiy`*f5Y*9BlCX4@_x(k zew*@sJLmm|<9%r4a=%sZeyidAR>}Jq$L4^eOL%>?w`Q> zEyw$9%KPm)??VX5edC6|<#@l9dB0_Ozh!v8O?kha^M1?mJ~Xnqui*XG6Y>)8w@Ti} zI6n7%H=5j^^M0$~eT*^X{`2!bEQB)mamkFl-*UX)ro7*-^FD;ka$mjYX*u3+W!`UD z-tQRR?^53H=Dgo>ybq0B?sp2_?=-yMDS02`*xV1@D007>^M0q`eT=c>e)s&m4-28q z{S$b<<9NSIdB0odeF({OU!D3LNBf;j`yEUB9YgzFO8ecM_B)RDp^;5}1?_j9kC$k_ zQ_?=h@u}~-(WL&I_B#dbV~i>FpP%+&A(W|)OJ=0~j-&l9rTuQ5_8}xsef4g?<5<6w zS-)dhzh_v#Pg%d8vwp|1J~VQv-z!+Z*RX!CWPOZdQ$KX0Nd11!`n`hnF~*Ym{qwUv zEQB`oPhkC?WBop5{eGSGA%vtpWWD9<{hp)!UZ(w?rTw0v{XV7reop&6NBhvo=DvdV zd(X#9wBIXfALIDk_uXi6e@^?og7z`Sl>5(5`>+to+{Yy|(tgj;exK5QzfSuQGRuAS zmZ#@rbJ`y`+J{Cq z^%b-~cs^dD{Xt3l7{{l+??#jQbJ`yiw2v{S)PH{3hlNn4J}#M&_6Lskhm`h*b=rrJ zJoVMP{effsL1z7dW&L8u(0;K?c_03sJ;*t5#1D;J_7^(^^Ft?!M>*kCx@S4ZKo$Y9 zCj|uHJhR6+Vba#0=NyA9D1dQ2`xBk8B3c-npa5`<{;@VWTiDB#LMeYoUSb2y=#gCQtDfqovOcC~tQe zK+qZ=uZGcvGmbOtm$(SHPiJxl-vW1gd5=z4GnWC3FQ`+7UT>%y(d$Gb;e#+HZsmD>O^oAE|}M;!uJ=+C(PDlF&Rf31_-$N$s1GxS_;ROFl3*a@=#phx?+J& zhYss!P^{c^;}%L1tqs4be)~pvDMA%4DvXzARd^1&@HR-YgsloQK&Os&7JN8smXg$qG{qIP`g@{G zb;@MVD5_5BRbUN47S#b?mZUnNKQ)3_)hV^AgMlUlm1j{MSSY>f;Hs`7h-gqmQ0c#e z$`KSc|DL8xl?Xx93_j6L1o8j5VQ&i@*dO`4Jy4R ztRM(2m|6|OU|xele_8~AGm_c2m0AtLKpTS2qCv1w1_Y@zh)0m1LEe5GX}VHr5JXV~ zf&9#VdR&2!w<_l%gpOiCguuV+cjT!Ec}r|2Lf*Pcu8t9*iWMPfl^~=Op-L%2=;TyG zNEV^cpBh4}2vu4U!ax&*sd#P$h_vcQKPBQ;ATOiqHrl(>~5So@WqR zP@zgvA@8isAv9B=(f*q5*eX_qpjCj7cf_u!P^DBMG=yp)gu%QDh5ob<0-q+MLX}p9 zFwh2}v#1a(lmSAgt5C2-bRVoBgGZiu+$or;q1fjiI5Fs!V^CIN^xfz1I zjh0*-BSJMRLeMH9NGC$IQiRY|sz#73LZLr3f>;r%wIYOpCIr=I5g}M8J%VsmPZOcw zvCa`RyA!HaA_P%01exxHYT-@@J<<|_Bn|Q=-yA_R4H}KOsRq@o20^QUAn(mx(V$wX zL1<0YA_#+d4GR5f5d@A=MuTdt24SELL1)n*SSSO6PS>Dd)Xos(ZP}5g8iy#cIL~tc%_OK*Nf1Qk z05aVLwSoenaa;nBq(I*JoC9d4K%+f5RiKttAZQf;Z^3e+kU2o1Yh0AVn%K%qY^ zfWSw~C{U|aAPlqt=qw5Z3uOS%=?WC=>luK&Sv|6Jr&1t@A^-yHSbq-kzV=*#(0(o; z2+ZER1bP2-h9GZrCKty@P{&FTv`PrlNl>ShAoTsJ5hP1c=ueFxR)RXM1Yw{FLETv- z2o_3@AY9ecBq+Gxa|F#Ks8dN0M9mOn+QfB&2BC{xLXf0E-iDncXr@7U(DK!Y~!&(GkFt0(OKP`g5)yrs5r_~?~v?1s$8UzbvK+x$L6wLG)g1mJ; z(sZxVAc)ElWCD;k+2<03UU&gO;5_Fg$eXz{0D03jxi&_EdRBsdzuUuuysc;i{e{LBWxq1862ey-I>0DhH71E~pn22o3cT zfFuR-j_@2nGX)xL+o=NetO7x+03h$=UQwW4sX%CC)&dBFc?AmnX#oWOVn%^_tpZ`7 z4M1m6AXq2^fKFGSVC#n@d2*K#x$oqAAo_YFUoJ0jv*q6~dysU&Ugk_Hs8JGiVriDw0gfYMY ztRBW*!&1hLQvzB-%Wyu*%Vc2Ap-=ou%Y$;k>&ghT5*OrIJWILL&n=& z`?z$3?83C*GqriYEWVlrdnf;Nykj+ikPg;1%$;&$*gGYrLn+)GQj}SI}0d)eMc{7PR33JlaC97PJ+Dn&BIZ zwP?d&6WWUMJZOXEv#1%awhC=T+k%gmXj5w&k2X=;3P#%srM5vFMH|T4{HNwMxWz&YIoz;J0)MMk7P7cS zD}M&JXtj@7J=*Nkt)zRE^<3PbRTQ`AyI&EvQY~(1E4PRn9>Bvb^lE_{_`J#2mt@8) zw`!&NR;@gfxZx|t`FF!Qoyl*^akWnuH&US?6Sr84flR4V+{#qkMz|UGlCf&T3~meR z1|o67j;$8bx)q*zgkF(;2 zuYA{{4TDW+gLkW+1#Pf=7PR4NpN=+C`5_axSmS{tp;Fw&*Nca*{ZZVEcW(Z@=8liD ztY6SJsDvPCTP!D#qm8+9!&i`JG+43P2CXvMw0CZmSD969Lub1QZL+q7UQK8dv<+V} zuST2sTgmE7+6K#KLfg~s+(?m#9Bs^h2|b@<4)3uwpceJM;lgk5VWn5 zwJla2$j}xm14LRGs{*7buUTz_RuOHnOu&k^)oN`+7rX^+cmS_$p;rsqz?RNx8@|?F zi#7~4X&byh{w&%C%V$9wuJ-BLMhZ$~Xp5yIND?ZwZG3}ziZf7 zSdg^MzxUmpF!{wTRuLc<%6uzXv)Tr>OA-R;#rQ9rGr%$=VirHK9$=w%YQoBnI2i zb|!6u#a_ zEI1Iab1XKHN?XH98?=gGi`55Kq^(g)8=C7aV8a7=X$!qtzy@x2R@xfNcaj)v0$Xz? zX@ljnfDKpsbZH}XDl%z{6)8v(Dy40FM|=V{<37^Ao8Cb^OZtVoHYnR5DVu+>y*pu| zY_T>0xlTse8dlk$RR)_@*&4O7p%32#Hd)z1uO_ew%GOwv4TEi9JCm}(@|nQ)G-Yc< zW%Dn!ciHKc&ArZCqio|#={?v0XZD}lVwH;=ZCHaskhVsawpb@2Lt89l5HEBrVvwS| zWu*;TMYP4L1}oCms-+E0`xdm}0lc(@UM*+?7dR)8i7AswlBveWpygr@$x;>)JxRGqd=OnSZg@87w2O()&EB)FQs~(UGWwfnjwGCQj zv}v`iRcjkM{7q<+wJr2&LYts%twq}~*oL+Hlr7d$AlJz#TgNIJw8~)9DqE*kHmn<90-LOCp;r^w1ZC?i%7(!< zu$@WSVEIg7dz!L!iLwbURB-4dE>y;=gx@+uuV>j2T}+z6XhD#IprnS=_%>d5x0t*M zvW$f~A}p|ghF~~_K}BxnGfC^%QsDA9153<|Hu8&1ofaQ*ajF|sM=UAY?f2+d2IVtVkDr2^IF9;`tlv22VX_EiBr_Y!Bg8AkvIW_rCq2HLIe)GdT17dews>dSbX&lL zO#Ik}-NYmjrGjYyE%g>T!~^)fXXrKZ7n!~ALdlV`!cYNvx71|%eF?d}L zt7tfd+7D;>F&vi9B8Rxz%X`le$bP!|H0vV1nDPcClp9dt%ati`yp@kPkaPYb>gKEu~Am50bjvw$zciOcwc?{(dnq?b;{ zG#(tKn(*Zg5b))DHQ}q}@in-b5?Xv=unk|$dGG~`YQYzTuNh89e8s)WK+}`n4JC3$ zOFV=mRLa?a^>$LYSgYJ}QgHyu53}_n7i>WrjP*=tv#A-bwnojiWRn^V zr%81WinfZW;Q?(badUAqaZA5SS<|+P7WzoC9zJnMV6_c8mb9&+)ge-}&9$xC;g9Tj zzYN-7G@`auJEgWkcWSg5wGGAqvn8O-_i92LuWc~BdbEwfHng2b+uZUQv~67NlhFp( zP0}+(+x*%2YNyjS7e~w9*xK%q@+@NQ2J;_$G+NGQ3P)(ttbsN06jTIX* zxN)~?Fd7+dw1C5+xD{$~!#V^Oal-?6xP@LVaD##X+^rf+uLW*qaVyRvZf^NZaC58u z1h~;(u@bm3B|WM_DQ*xqhnsCLS<%8DY1(5s4nf_Z#zp*QDTNy?50R)FE!+^`#;9At z-MPUy7vQE9xR=+%NYCtE6O4a;a#Ya5m!FriJ>w$k@% zLYts%rA6B?*oL+mx-Qqiv;9+aQjh?W7wwTJ|GD+ro_-RJah) zCf&HvvJGC_#)1ubzwV;4ZzZd8LEC8khDEehYHh#-Pzplwj$LP8rY4v}aZ zE!z;##%No`Y8$kQ+D7X)EThe<%<6p`)+{igP1d%`_i93$ply{!+c4OMwlirPET08! zxZ0;{TT<&IMH{1Sl~UUvE=QXcY~pPj7VnV2CQDl-NgJ)&;K4T5Ysf&(-nLZ>(niZS zEP}08OB+@puz(E@;H53}Y5^OR17M}CvPc^So4{6|N!nofOkjJOv?ZlJ60k7^J*rwM zZ4j4(&3M;Fi+-d@kEJ*Sut9wbN!e&=h(y_F(S`svM%ijs*`QTaHd?)58Ejr-R+SBl z5SYLwD_iY*HGxe~w%Vd>7;FREnUoEd&jL1F?bDSlsq~S8jZwB*scaBOzy>(8|J+uK z(uTD=B(%xWMoU8^XromdJle*34H?Q=X{#5cjh1g%L|dblHmpKmK^q>xOIzsGf;K1z zz)D+fkv0rAp{+TSw88S3(DpQGtHqz&n1UWvqm(v?o1x9Pk)%~W(yYf?90J;)z=fo3 zv^GSFHs%}2hS9c$)i!7qwT;$qSVo&ynN@AWG6W{H$=cTVUQK8dw5_pd8wT6Zb|!6u z<+Gp-SNn8rOKN>2+QwA$s2ZiVL0pbDE7(M7!{Qwh*koy=wILF)(W(tz+Qxbf8OT{_ zYZj!9mTy=DTdS5ftU_P`8y>(*Tjp!Sb2F_B3frN_`|? zV+wjyty0<`E(e?Ou8kJ`NRu8*aR^|8`WBM1(b5np*cfFS%QfWvx@*e6{cjhPjaF}1 z2AkKIRb|5>1SYV_%GUZ`O<)t0t+gl{2HU`PCS`-=vw#g(`*dYXDt!pAJ#`L(+;BSP zGD^CnkC#`+cRxP-`S$+!aJ;<%SbTA34>68+=@6LsaXkJAEZ6|K@6O_YvW1M? z{Oi0UxQvPE{gGH&1m0aa8_?#}X1elm@{;THl^*Yp*;9pq`_zWWtXNRGW zC;ipNpM3G)FX_SQUw8(1MiN@DkDoT%*H`=N_nR>4?e!iSk-BgKrVcmJ30pxig{k$W zAJ1kJmw8$cw+i1K?+&lslKkQ329^U7+8+u1zls-Fz5r})aXCYO*TOQ_hZaU7x2g-&|v2H&c?oicK~6mOxby4nrc zjTZ;}%W);&-+tWW84y#W1o|LpS-Twa!=7e2E^6!EqwNRUb}!(s$II(I!1B1i`r|#^ zxWcr$Gi=>yf0cjeGNOmkIoPK&fKQS76Jw2qam1ks^w(V%9qM?VY$5O)y>OHx_=x+F zX#U;RAB%0+EY@vOOICsQB7=tm~}`RcS)u|qPo0gPZE>Z_lH&$a#h^T*3K$E)L={q*;bm)E<8{oP@A^~c@c;sLbjZQgWm z5B!J6%d5k?A0NIy-X9(g#~a)F&vWZvdNr2po+dwAI2Jnqc5uWpYIe}053vIF|3$IJWc zSG()mtHaH^?{QxIh2Q_Udwcxwr`_!qrV0KJ7w(&?ys6Hc8r$^W|M%5b?{{~fpo`7> z{hMa<{_^H{cfGs%_1C1ih31F-$2Z60-P@}8OZO-4iBF$p_7fxU|jp(9pCTocJKC=aB^&~HxJjhkkXfMwvGSq&9|Ei zlG-mne%gFPbN%IqXX){fvHtirKE6(mubJaJa(ovb-=xPk^YO0%2L1wia)KUCaJ9d` z|IZ(HFg5N9pPPxOFSakI>G{U|`wXw*_3?P+u6!^jIsCA>a0m4-KW={U3-@*Z^3$_t zo1Y+Nvxzz%&2j$vN9g|D-QKWpVFcUCj9^>Y5%>cKbK&!F$EfEKdNzIhb+f;^-_Jvs zBh69fA}+Qz#Kc9Tn@r0bJaJRg3Z|xle2(X4ibgn<=BC0N^aH4>!t8`W6lSN|lIf|c zsCW2So*+DMafT|y!#qV*&CO9KnIl9I&7TUApCk}`EM!oH01C5YFvR6h7)EK98ahjD z+iSs`>c8`@%qARv$=PbemS-XC5I%6 z<_h5)Cv6oY8a{>vNry9|It<7FJMaoKn(8Ht2L5rQ35QZ>S24EXqs`p}-toa?WgyOA z(b2t2TZDNy$RPa!1;MRgH9Xt=5_qRYo|tuEKDtJD`=jeEB+j>+7yi&`KE{W?`~=_g zUBkhj*@F`e3MX*ATm8D*-#=bGT-Gyj_>T||q-igmQh$x;4P!U>y|~Eti7!8Yfa`bL zruyaQ&t^Voo?2bQnQ7g{)d=cv_Qss%Tc;&+_Sr$X$w9?35HNc4qIwCSHUFC4Tu2?( zpxw-yhToZugJ+S`ln<-9Su8l zbvKUY6Ql(Uc-u_dzJ~us-q`#G)?^;uCSRS;n-@NTK>?q+$Zygdf-RCGp_wcwjNH71 zBnjyr?`7(7J>7xM3>ie}z7?nYOj~ivA$jrXK62^aFtpIb8;{0pJd$*WEsWXPCVkJ_ zOOOMyHEd>*F{xBa_Xf6gi20>-Zwx&ln=hw3#Mqb`V|U9j*EccOH|tyvAzAW^bHCxJzDaJMDl%r4>YIRKe>c>` zRNv%O-@w)|%YA6%sJ;|&jGQ8i$yx-=$-*CJSja=@x z0^V;Wyx$6WALH2E_uU9`zs-5S74SaBXmY=OdftbHkmmjx?=!jIa=hQhyx*?#K7`QR z2g=v%@mr4g+cNRDEb+Gt@wYMYw>j~*9PvXVoBRUeZyh5qZF*WE@namH{H_~G^5?|g z3Wy(LRLTGJ#19K0OnzK4CGoc$@wYMYx9h|YA$jtPcRek~{B4=}TbB7dhWWdg`MaF? zTaNjmkxTwg!2F$r`8y%=V;r0Oz8gXEcRBNS0_MjUP4ah7&-}0u(&RsZ`8$sJyO{aA zb>@eVEcwN`-*Lp>m5IM&iN9lrzl({#%Zb0^h#wl++!qjk=NNg3_&Xu-V;rCRt{X}2 z=fvL$h#zBAx&QRU4+|m8eOxjn@pl~YcQNsI>%{2j;pU77bgmiK#x_xqUl z`<(YXj`yLF%l%%!`@Mwsdm-;*9Gm;T8$s^(Iq&xZ-p3eC?)Oj6`>+tw+&_W$dye<} znD_g2-iHv9`^pV}&+&d==KY@K{hs0dKIZ*C=l!1JeQ0EJU%>mlBjhFC?}faNaeVH( zZX~&%^L{VjeT-4%{?qe5EQB!kamkdt-*dd*$GqRK^FD-Rxi8-H^c?T^W!~>u-X9p= zA7b7ga^CMb-iJmm_Xh#*4-(!VguIV&Z0`GR1i3%tygvwdA7eDRKRi9}!$L@N{{-G2 zINl#(-XGR^A41aH7pMNf(f&}T{eh+Zfua2&ru`wO{eh!>Xk=4gK>LH^<0aZ3gtU)w zeCoSyB&na%{ve=zj8Ucj)6+gIgfR7S$&|D|aI`icd4sXykdKMGhMV>GEhK0WKhLP%5p z1lAup)*oZmAJ$DFcS?-IsJR`^Z zW106ymiH%y_otZmr=0gkj`yLF%l%2f`;&zCCn4`+9Gm;T8$s?*Iqy#b-p3eC?oUt8 z`>+tw+&_W$Cyw{0nD?i3-iMGh_r<9{akM{`X@6pAe`08VifMn!X@BBq9~#-z7tsFX z_;`u-Cn4=)9H08G8%gTtv_A=GA7fOh|MavE3n5H>Trwr?PaN$}G3`(5v=1R^>Wg># z6UX{fne``@^{XvI`_(q)efXR`$T@Mu4~<;*S6cz|LnneqIpI{YXE|*ki-6FR00MBH z>~T(*wDspXZIA{9Fs>(mq7zm`3Ij#~aP;o+>S`NPJA5`-!94H-mp(u37QPJ51$P?i znKLJvpO7}E{bmC$5qpm4*>Lhud9@A8f=}ENZ^(95g~%bZO;n-ikux@r$jnu3XMOOG zuR{xrIC}g(>V8h-kY4sV_xSPVYCB6zVwc%=v4aRcQ^QO)xLI1vu>BMol?c!5b7Ko4 z@j;#Pnr1Uo_<9?6E$`ZLA^<0+A z`pKDE!ulJwgdw}sjA%GY6cf0va-i+L!|n-GE;Z_yg(?Z%hF?{;wcP z<2P|tO9|UqSrgfDE>eb?ODxsY|Nk+@p!=)Y+yHyigf} zYF2fiwV*n6v}Y`;jxjfi5TsEZbgvc=AY9c|1Q8AL z?xCu72J#d^nF!S)5rU{};}-wrVMT-Lf(F$K8U#LIx1ESJsOB}uIZOjRphq&%Ah63a z`!;ATAjo-CS2U;*Y7lx{r5c36Jc4|GQUrnhli9b`QVqgD6@tLNiKOyH_UdfkX57wV z4Z>AD5kUnFawcPvWFie}VhsZM$$qX}fsk{)rXtiVh!A*-c?daQYa&9IbE4Myql@&v%eCy-;6GMmw4g#wNrjv}Hi3}yyN0Vn$7Z5J)|i_?sHj5DF}tEd ztx$!~aVv!o2J6ZXOd(h z6>1q3QX$CMa8m@e3nBzYXI_My$2LV!b|-|k&jdl%-kTx_S_>lNY`1F&5{eMocEt!P zi%{$O6C;QfA#^575QKp$5duf*84zR)++qabs-7l7Z9#`tf^i4a85J0TPy)t!*@ z@@5EH(4e-YLC&a~Ajmmy13jR3G(`}5Cj`#n0)m`(cLhP6P=nC>D@70n^BUy)lOhOg zv5W?xy;+1HwFZH$^&AM&Xb`UIi3loakTYMCBok>+7io~)#iAD4MAN&gSt$EI*|rJ6wx4yAk{9;*@`m+Eoe|z(jaFVP7vf= zz=0mn$C@ID)gUl27ZBup#48%q3pEIR$WjDhFt0(rKPiI1qRVIyTCGJ0Qfm-cY|nup zjRxVWo`|4=200@*NivZJ^|=PA0OY*MDS-L~2?F;wFG0?EoB}A5AT+}!0J5IvRDz(j z1R$9N^+E|kGqV^#WeM{Ai2=k)5c;(x0K!0(1c6WY3;;5&cCiHEs-6a*z92z;CPBSO zf*>lDAk`ku8Jsf!Ehtc5QXpqvP5|Wm$blTtQJVsYRUoia7XaiO%_|Bt2o(q&(NX|m zFt0$qKPiB~EX*hnn!ZH)f^h$0eX5v1D0Ik$C&pal&YN*d(M)Cq!| zJ37z<`g>CZu^I&4?gE0Gzj{T3Mxh3wKU<0*4CXb+_a{XVSeF?MLJPVGL23;G>+v}d zq|qQ;)e{j^&>&}!CrKvKpfT4V6@Z*)I|b0VAVJ`Y=OxHFvQq$M5`-q<1VGjco=On3 zmH;G^piwA6Xz~^Vs4PLgKQVw<2|^#c1V9+5k|6Lep8-I|?Jt%fT-DP6G!`Ui%p_nlrKnn^qmK4a@x)T67pLQSzbQ-4sVigE%<^=#br}v5iO+p1ir??bA z7|bh>?@tOKFi|rKgl2dVfYb^ECg^hjNTWcwstkaT2)ymWx$jBd7%Qdo?}0suJh43n zWg^cp1T$4QS;@r*-h1NW%e*Yq$=A>&Ll*)utT{iq@tj1>X6(W1Fh5338$zb1mO1Ad zr#==mjYkfis5e|=^Cmk00Q?hXJ8=a$E4ewfxkmp$ym5=u*OI~K*wvQ}(o0%2Od~d| zvu|qVF+!dvZ^VjDfY1Lq%gU6zn+raF@_L>vT6P{pxbu3NZ@t4P_4rMmkxBj;mtx}b z17kH<*1`+3%t;|7nvll+!DDhFAUik}d39Fc)F|qcD9U*L`~;D4mo0zJ`E5pPQRh(O zT-xTF&;}hq61ja-Oz^dHWSc|gVL%%kBDelEne~tEoUlLt5{lZHy`%oBB`Xsd7rYV4 zOe%F^r0?DGW?<6+tY!N0EoTllUq^|0qfukCRc#A z;Ivc(5iV8l->K0u4Dcl%!Lx*^B=Vt2$WN=$hw_xI5gPYTtRdvHE z02;XA0ld1^u2&7*zzNT)8x}th!%eMj^_kSol#Ed9B_UjR=fwp;wtxn0cmS_$ zjq6o|Ht^T8+SX|9+%Q;&wlirPEUF4^U#4yTjp+td_@{V>tWfVEpsf{Z8^jT`opj?C z>I4M@-yY5q zZCHmug|@P`wXRnc+6vl+DuOB(VnA?`N^#nY8%95 zXjASaLoI>~Z427gmbER^7)a5^Xq$bncdTu;%0Y&<1#Jr@2iDN$RAyD%ux5brv1SU>ml%9 z^S!FTR**KV>L8Ui3|4^+y!mI5HdsCl*l@K^mp1$j<x+Mp>=|k6h0+Fb8QPQ^$xu2WL)(J3^<`}fH4##@ zG1_L|&K_%z&H1Y8%#A(4Y+u;I+;7szDpn8DO=o*Jv9C>(F*4 zZ8P;a6xs&iU!rY&@z=Ic_aadKAk;R9OVOqTTPU-Tf^ArMk_2j8l%y?`Pe{NPN+FQz zWTed&a7e)htwm{bFNt53wm~dySdKvjwz9POUR7W#NE=q6kV+c{tH1`e1kNIDuzVV@ z;cA~QZ9`Go21eQjp|n9<3O40kTd2s8fo(zAhO)ASN((927-h3>ppTW!)_TamwxDdG z@WP6+4Ps@($_*N@;Q_p|`Cc_(gX#sWvJDz#!(biQ&ZKOn%!fkRAiSt-cs>4S=};ac zP&k&Y@a9!`?`e2id7zp{o#k$;q#(b zwI0bcm1LMkn>ep3%*Z^(u=@a^x3ktGWnzD%L0d7Z=v9pdWv_dNNFAyd zc&{q7K_9?rVR_>0Wcc2`c^=+Id4K(CcYS+xxOw;e?rwK|Z#+1^+@!CmY%{NFc!hTM z2boa(Ak65rm6>}Wj_4@+vdWtH-ci|7uWBfhkSZw_F`ytPgydh8ZmuWJwP2)Al$843 z-I7mOhb30h3Af^@l0s`lDb(FV-S3OPqce{3g5Lnm^BN_^19&C%y=s(n0x16EUt&pe z!%(ku+X^KMBwjl3*@p!=&$bnoPot!`+RNKk3uHg;`F-3uz6g=~;7*7y;OErN^CGz| zT*Vim!z9m5;e!&s+}qe0d=c| Y*}@2}L5UGl`UsgRJn=b*KWFT#n-_!=`6EaA%- zja2wD2Ndw-dR5_TD&Wi9KZx;Vf|33%F5Vs=;Emt=j}MP``}#X03ikECf7;zre2r(q z7unl-eP14UayOES!8gErGg+Ao7P7)=pv4Xx?0gf{3-h&DJS3`~JGdjN~J(5nJ% za6T4oFugD^A=+%P25m6bv!Kl^p8{=mwMA$P8`pp~xNef3G1_u*Yqm0RGjSQ(lE1>N zXj`)_X&ZdAfVQHxHQR!=HCtk0^=Qkr4f}p4h8umQN#YxZ09^p-|ka zSlle!lzT~92qJ;og1S{@b)%&nVz@EthNS|My`(KKk^E((fz~qIr0P~Voq>GiUg+fi z0MTHH2+dv+4=BLR^{RqfLEW%Eh8S*Yb*s*#Zm@hRxP6(rRYi59MLQhaYN5J8T&8YH zw9!HkG1}?{af7NHC2^yb9U`>R3Jv~38F91aB~r9OYY}a<#KWSv)nak0wc>^c@M!bB zYS0E15m<4<@)%OIVX#WvpoGC$#Ld(ek^h~f!PP!p-0GsZ)y$n+EfhD1%h0C0bE9=2 z60|L7TV2*RTG$~*8>4MlRUpweTU{bU+k&>$Qf;f9%B*S|7KqSj8y-+Vo9k7Dwt}`{ zbqq1u)Y=9W49=2=i7HIGn%4nM{E|H=QT8r97D?BV}TO-!CMyqXj0FO4`s|IaQ5P{V;td1c?8wRVi z4JsI%1#PCXh(grmStWutSVCM%%DZ zK%#B7xI~7w1#N4j+SWLgS=BZy5TVgFJfMI!*Q*L`1#N3If0e{w9oo*MZKkq_25n!a zZB0?zXvq$TwpOTZ5SMD3^0tjufr!D@E=U`cU{}P!EBXHY|=Il{O4kfei{6oJHD9VG#w`aJ5gDwzep3 zv|@)(LZP&^xwI+o+S=mpZS8`xwPj_aWgTL$G0KKz0up7jr6n@3Eht+nRkqe?%&M|s zc?gZN;Qx9Y%aYWewXZoMp zXc355+PVd4gNhs_X`^)=BDB%^4E{nHX|tszQnW#9QQByMhec`Y#M0Jjr40|@(dK*A zpbhFFu+oObF{ILl!78*t0fVzho2e_JKpU?1>C)B}rHxkX@JT3?wl0!3i#Fv(vMXv^ zx1eoZS=(q~hZt>)wqc=wMB8j_i41KE+SW<6t#c}~s%=;xLZfYXKml#8R~6a{+SX~b z4TE)PJCnAV!Xg^9eVMj(MQx)cI~>}2p|(L>s%=WJ(JBzJwDk+p1|>O4(njk#L|~)! z8T@rJ(q?N*q+o;AqO{Qh4~x>)i>0mCN*f-)gU$D<0UOjqV5JRRI0tRQ1 zHd9zc0XAIi)1|F1N*k@%;ge7(ZGA3n%DXmN1R??3g0l5xWus*sVz4pFhGha0WwWIv zGO#TuTQ60%-f7ILvSE1$jk4hZ1+ckZRbVS9Tdz?z4Az0|Ov+~JifF*LploUN1m|s4#DVz1+OZ^WL{OPJ?L@7e<1b!OEeo>`@s*-sMw2(o8#T} z?&|P)56}I-KkVVRMRSh$IP?uA7mV+{^XD>;sMB*jUS1vE{rK?x@&52|INpF3f3_#~ zM;LvZ+1e|S&+JKmwQ(n3Jos~baQq3+0Pl>0*6YK^&BdE5u$ON9s4uQ} z(1@Id?xMNFO)%0nLpKj+^W2SRLza175VH#39q#sT%#!@!<_4C-WbJ%D=>J8yKzLvK zH!u>joW8&7!;POJ=3F11`)>()EYK; zek`yI&w-4tcL2-7?&^>Cu*rsLHD|!n{wn>_WW)%go7pqWfGuI+PK?DQ?1){HDI#I6 ziw@P66p0tYmM?HeVI_osdrNY#LnS2s?&|XQce{7LJ6;_zmtk@dL52hUJFRWskeoP` zm^r)Gkk>x5eHLB6KJ0IR(mz;az;GRv(Qj~?z>#Ub^|QA#7x#FH_H;y*p_8yqo)o`3 z{P4r${hsL~`sRZ@oj?6sI(H-7`8~t)yOF=T-M@Lf+TAgyjlW9IdvC`YQV7lsB@ryV zk_&>&I@}*#AFd7$pDrPLOcdTQn5k|%^FK4y>3;#Qz*MBZeRJ+xbkEnO!{?is^ekgz x|ND=(H7ru~a_EO<|6&X80Vdgw83{dwOAFFg?PURP4q$ z^vX3Suo<4iB-p7`-O%QcSBK$6>4yz<8Y$qZv_lbh$Y=v_sUCLyakv6wng)GhThh`* z`O#}Ba#c{8NWJkD#=EZXgs`lQc5eF>Lf|bi0+-L*im7^deB|pTZNm8;cz5;pO zLnd75#iS`=xpgq%U0*;t$i^Bn;M6!1^UH9PES8Nk2+XX^d3?unQOw^zIEN>56fyWP z=f#wmgea`D6}UE2=|)YS6SYlpxMwpd8k4343ZG0ALdyOzCO^TQEfJT%CZ}0po>Xnm z33q~h$6a;AyJ~Oyt{>#0lT%5;vzYvnForvBOvcfrc63@O Y_!9{Zti1%5;n|`o8Y{A4day{p0X{vdvH$=8 delta 604 zcmY+Ay-LGS6vw%v4y}qHXq78My{RGQ=Huqx7E!P+b?^~N`XLsRM$@#m1vkOPrJNUV za#X?9)dz5J(4jau`UnmtEltxi91iFF&+mK;I&YolB0_&JN9cw^$x5YYVIJeaz3A9} zSx|V_)(yYjYCAz$;Js-fq2ghl#2t7SQ>Lh}udmEak{U=lfvS$-L9YNeFf1E1%Ob{f z77H;=&v$L7(XYom6V8n_#9(M_!=q88e6}f?-MaJxQuBi85~dt4YQmQ3A`Szykm3@~ z#RU#u=3xllU?<3eCc6&(FLP2NahVWsYRPcN7c)vXaeY!lRTW;X3=;5Z9fW?BOGtwv zFTn?2S|G07jrWSAPduB}5+kUp!4Efdw-M?(^{P%(MV0ZyNirrE-W4XJSJ{;o32hW( z3^_sRIL_gA*|meZ->{uyJ36ynu6mB=E8SjS!aF!_B5*6%W5k+u6jqYi a8iV5ZMamwq{27wrK2Ouy3`K+QJpBg^dbtAt diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_csm.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_csm.bin index e291b611bde36e3b710cec1ba5d264f9081abef0..a99b9f953b78c429978c386adb69f4c5c5332957 100644 GIT binary patch literal 61912 zcmcIt+m0kRa@E3s7ZwZ{zPuQIDZeagq?uObJrfHpAV?6rSQsl{48Jx?Gc}_Ey1T}G znVYZ={ty3x|IMG^U@%Dr$%x8ebr*IqP-O*^Oft?n%<4RmKfe68zxwgN|M!3X{)@kP zxO}(0-Co~Szx~Y@U;HL~uI=aFK3u*!Tpe!hr@wu;yx!jLZui@(KW+aS8_+|q^Fw#G z;om)6UhUuha{treZhyZ&+}NZ4I3NA)`se-b2EP2Tn>%vf{IGxX=HYHfzWJxQ&C7SY zR}WX)Tk_RE`>zi7KkRRJuS`#Wyt#2F{TJ8W{r&FdVQap9`R;K4=LfhVJD`7fxV*c5 zxxIdOwZD1$6V8jj@Vj5OuMZ#oefw?$(**yA3-^br{7{`AYV4u^{J$^0c)z{<1YNA& z?_M>l_m?+^+w1Ms@4qC6TR42b`}pc`xP4uT-_+tajrdI)ePgaA(qScU%7e^Wqb3v+zA+j9VVIJy|~Xdy_qf{p;2Bc7L;4Kl}36FITHK zSBLHW>izz1|MUK8fB)$cI$7Ba#lYuMrR^bOefu_UU#IPBrhP}+cX9hBZQso8e+C%%3+TxSdN{$=?(XhC ze%Zp*xGQ{aCZb+%E~e@E%KZBbuj1#!;mTe4U{11svs$}G{l&-C?|$dL?k_$)d$#%& zVpglD^U<{P*FQq{Z*O;og@qApDl>vjWk=u}4(7t=;f_(yBlK+g_{(Z{b+?;`Fh`nJ z<|5V`8)D+3(M{&a96WJT(<-K>f_#qWW{O5QNpn+S4*CI9l`uPD5W?(K8!|mr74;4u z_Um1O@J*+=jSs*01mE*rL*vhE z<3xkP30&{EuW?<(yir#dAD{tDuDy02Wz<2NZlRGGAkEOvbVhG?cMn(hmo>7&YUMvd z8(?i4Nwud&+=t0S2(qkM1nt(Ucfuidz~gJw!y<7)M_KatBFyVGzHGjO9hnZf5m z5CBQfR@l>nc5?w>B*I+JSTuaJz4^3`Xu)?eb3#C&SL?7g2E&M@YMzovQsX$&Q^0%L z4Wz0)SqNv=qa)35V#8`ai-pcjjD_y{_2C{?V)ya>;dTcb%r)I%KKIKqJi}{m z*WJa`Z`ywMVzU_y6?Jttj^-021q^u8Oq;%j|3;Ep{Q*`PnZ&TkI$em*s~0|7L2jS9 z$Zu9@{D!6ZCLq|~b~Q20H#yBW9hdnXpZN-!Zw5`~D`~zlaeU^xZZw&n(|n_#d5kH_ z{HLdRSRHNVn6FF(&2+e$;`;xtV%aML7k$%gPe#?-48qe9MIqA0w(#M#h)PH)?hlS9l{t2Yta-`qJq~9)+K7{0{uio!;9P4)y>$fcH zcMR)yG3$3Z>vtUM!$B_fI|b`^8rJWWtdDVQ>icdKso&+S-ziuhV@guLdwSM~g;1tG zE?FV#cO2_?G3$5BtPdes>gzL~BmGVy{f;I5jv@UnCjBla{f;AjILKzcg7iDb#>Ys% zQ<6T$@tN31>dcgv&?Az9|DcltfY`Mt#X z9n1MW!})#8`F+m$J;(WQkjwmD!TG(0^Lr)dV;r0Lz8gj6_c`bH3eLxvlFaX)p7UWL zl$no9R>=81$N7EC`Ta8ILkP+I!i|2)zI_{?|RXfi+N{9eKN7*mw_PtWzP*6U`6ea%CQ$8$&Ht|oO{DGtVA*TFcnerhdO?>q( zf8-c{lo)?t8GmFLe~cM_%o%^=7#|LDi9aeBf7CGksAPPMV-w$Zqe%QQXZ%sY_!v`? z_~X+vJ}iVX@o~ut8Gqy$e~cM_TxNU-A&Cz;U-EPQ$Wi_%QU1tM{>V`N7*qb3Q~t)rKMcY7?_Qe9j)%gpSPEljk+fQ7-?h zje_~18^wcba4Hy#;sIqF$YLP$qyPb&CwpuYrVR!GK($lKKcsAfN^k(gYGf!?u zZm()HYleU19FD+%qeteW?&q`&$zqp1eki%x%rcVrX*Qq})Zql5siP(v+$=n1*dC-t zeZq70+}MI>xUrGuhO-?fRGT3g&*0rPnZG7EM`W?_CY#h|vzf(?G&ZW0SZy|a?6ryA zHq~Y(Q*sg@OE`_6le`yj*ewObwwuj3r|xPcI&a8G=+nuSwfoUks(|~Tf6oeG=&u4PR*oFg^7`MF0E6#aSIS--t;=mCY3uLT|r%&To*3K7og%mGYa==t!9rnhP z1EgP52Uk2TGtrZaZ)DFx6h)+v_2|H;{c>TSkyW5_20>s6>ePYbFcCic!RqKAzO5?f z`bksRS@vQJaOM1WWY`F;v_noAtJW)H!W+(oXL-X2R>VXu;j8|bI+7t7vWWEY2&^j; z%xk3YFVLQ!{@KK0N9+d(?zvx`1;*pFGSo^ik!U3uw+UQUOE3oe4*Mri%hc8b`6BA& zD%Y9U0ZT9dQ$Y5X*Wa{cHkbzqr!3xJf#;ocRWJ2)UxK(lIA#{X$l~}tMo`?GzVO;%-t9qb$4Tl=G1)hY>s zs7!+5Uoe&cBq&fVD-c+Q-JUj9Am?380OahbfgI3KnJ5rAYdHXk3gir}3kuXI6$lNn zS_Q&j9zec7Er7r)%52)u@vBiF3@ic=cs)^+ALYc(Hf_cjtp|`wfmi@Ff&w{5GD$L( z0yVJ$f%s&9?_5BTv&p6s)W{M9K4bwwbc5<0td+C1l8a*`$hvRS9|Ym3AVJO;yM!Po z2@88TG}fvSB;WQlu0J(`SP4SsunIxNw>{t)Jp+P_zgmqTT-DPgs1YQn$t0*zNf1O) z39<+(+Qc=21~sw~IY({^pzJOPZK4T)tQj~35F8aG$k}w40OTZLL4wfcs|JuPL9Odg4Ioy6 z(8sI-P_YDogY^smGInpZ1mUWlCPA$rL2V{MtxAF*DwCk1yCCQN%>X1TP%9~r^YtbG za#r0y4rn$_0mR+~fzen1kTd%(0H{+c5SoRx0K#BifqZ{j0D+H|Q6O|fYXF3SMG6Ey z*mD4=M1gQsPXkaVD3Eh&lO$6qP!}oC2{%E`L7W1plNAUo+PngF{7sN^{E};9Zi1{a zIaMGyDgj9MJ6z`!VL^e=bF2oCtU$g$HGo(JLQ}O0K*b6KcG@!l$XL(S3WTeAB7g)1 z>M{lDR0;%9M1fAY2XaQ_3_!91b&>)(mvN#%&Nv(Zgx1$Yfvmqd1CXdd&U(C{K)q6d z(7LPz5C-!KOD{|D3J4xlO$6qP@gMM z(Jhd(GpG3JWdQ=eI4?lXtDNE|y9Gi6ZGs=`l1}jhM+E_L2IeLFC0@P;$)T;ytqEZ1Wx&v~i=nOxy{`8Xm zILC8>A7^3?)POeJ6hG`85IC>}{5Tu*0)7Ui{-BLoiysW;^~d+8#Sb`)8T~<@xCTEM zSfoGT5IzTfO7sU;^)&npg8n!kJ4rH?{tS`+0CYmZs91o&X?z9% z8B@MmfN)h$1dt#=Lnc6jN`N4W2#^I((GJdev@-z73N%Ox}S5J~mr9fk@Kt=d*R__!)qbxw+rRN36`M6X3WOqPlE>7@c9pou~;HV%#&fL9( zAEf}HIb4k&S%5~@pBg``0HOO`g`Z*p0^jo)@MCHOs09dD^)vw*1pyi}0UA{T1W~B~ z72N?j!+3@tS${@Jf1DdU!H+X|2Wmiza*7}J4hY=o0)CuDd;vd`Qh(55uEh@q^ZMia z)8Yr**Npz4hhBpp3@p+ga8I8DKPCEut9lxKCZa#Q@z0nai1ROVp-}f9u~^PY>zz`U zl`9)yp8Jjt8zVt@M-d7beGQ*`4W4P2+U%T5-F)L7te%WiMc$jJH(V_9dOY`58z)}L zv(=NoeX@}7&$1hzJ9PrW=hz9D4blrE!Meof|$ zU*Xa+zYdu%a~_0h$OYnoNljJGQXdV)2w>t2obbg=;VoPy9-dZi!a8}1CSw8mg;SCD zaSh}m{0hUH#8gqncIO-UJJe$~!HEnidbZlx!lTOuHiaGtuaGN2{w>LDKTrdG`qnPk z_=SZ;ZgPgf+PTNgsOG1P;25-q^bT!|FT%}3?X2SDLf{xQF|S-o-Z*RgOJA8UBHLg? zZG*U|{%tR{^PER#2fLw}Co_zIyD+@@!l5nIUe-JaBPIEO3lv$9YUfZl{iolUYYdYd z3@OktIjNmsKPGQlj#ao0?qk2^aLja(c55yw*~h{#i4MoaQwIa`aV>`KGMqaKMz8p?HbeOV-);9K z+MGV8ZkA8p-DX}XyV^mYBXW&U>&G2u9f21iF&{iA;RTLyLz~nl^&-AGT!t5+$0X0u z96pb!nkEV_%HavT{6o75yn-(~B#V79YT7LeuTh3q@K`Uvs{-*w$_g?pzza>_2uH&`Wuj%lYQF?FwU$+-T80e-u(@7~z$R!JRw&Sd4THVJ!wV*ou`6EcNFBTbZ)qYCi&OqOyfb5hMwf%GO58 zcG68-s7#Q84PUa(D;rdWkd!SH97w^&D4TtqcMLXL@*q_bqI-=76+uzV%ThO2!#*!;`jGi3`^B?#D*%GO58cG5jt zsA7?(kG(iMgC|0nbY@J%!u-ZWh*suYwY`)hL zuz};BRkpU|_ecyb0vlNM&jYqHWy95e1lUAn3l%6x5-OFg%ayJ0mMs)KNU?_Rk>`aC zicLtu7U~$JSYw3EzOp>VnysXe3L6}iv8ENaPAzQsGVda+$-?G)Ey9{0Y*-FLD{L5C zhP5*Z8!TUmu;FT-jy3slyz zkYFv;F9?@uUy`0+jny?M#UNrWlt5U}wO*}jSVN%%YuJF-HQ#Fq)}W36t7~0}u3>Ny z)}R2uS#-_R+bH-g5?A{XSQB+E)U_Zo{Dr|662AfvcdbO}&!G$8Q$-?G)EdrY$Y*=POD{L5C2DUQ^8!TT5 z*l@K^2U{=xnJpB-AYfApTOSFV1zX`RG8A3Nz$PnOFDqLprjURwR7MEbXY*?M41Z>!VS2o{k3D}@Q0jq3%iLzmE5!j%#z*&^d6!IugHeBsT zfK61kP%(ofp;Fm~T-ge-778?^SQ}(vgW?#Hu!Xt{Db^Tavu~e|v1Thjq{0SAWvpq1 zZBPpvzL&iSYqGHUUW>3M2pg8K& zhQd~O#};ZiWLT4RZIE>>lxRq>7V0eoO0h4zPq4=78kCL@u@*`;Ea=*()-|m8P=YmV z!0VdtwFGNW_kh*4p+wg(xCm=du;47ZX6l0!=o+r}Bd`|f8gG0xM!LxO$~dOXbA80j zT8AngfR+2*$5)5L?dwZ8jJ_LxWPZ(0Ful^U28n&N4y7OnER4zt9#`lMSBQA+i0+w` z^*{TBY7Z6{?w3yJGxE5a&qqD3b*S|~e^$b>1)Rqk82&OQjoO+Muye%=ivH+mw7^nx52`I z$aVUbAOUie_$th3P?6sy6ipzb1zLqpBJuVEKq5AdGHqs)ma)eb%0+~Q#7Xvk)=*L* zcw9$Aa=@0M4IzrZd6Ii1&+?E3E*s@QiRrRxki^VA11>@bc^rOcHE&Q>ZaCOUj&Z4O0#R zj;YXQ;xe?AfvutSA|kNCHwFm~7ZhyJFJa>dYz?jdK*838x6gaghGV9Sv|Dpc3D{sT zN5DpYB02^(=uQnbUy_AhsVo}}R-RzN7J4lL8?R+By?U_O;1aOGSkD4BvwQ_$v#YJq zvbFQL0`xrC;JQhALK1puYiMZ?4?vx?LE9W`$uBtz%GPWoWrJ^Iu!+jnYy@R%Ho3CF zF$Qd$vcX_vu+h2@$HC?_W@+QtU|ES0Wy1yn*j%qAV1qIW+{O{6w*+jZ$_5K^Ca@JL zn_cZkfK603TIj=ptx_r*#8G7fQOp1MzJxYfJtEeaN|rXLI7 z%U2?8xZ0{ zZAY|?R)#pLZIx4*MQy{v5+&M(4Ft5gUQ5shg%ntA!=f5$v=wVxbtY{y1xfUGZ4HDg z@7manWF=}FE%o8hRx7m);xcV31RE_M5ldSwOB4gNVRJ>pJ-BWTeg3q)5RA zM@4C)g&~fDtyW80T`FzZfCroJwFqp2v|&vRE!Z%)NZO$A!C9mYmahbCxZ0;nTP;dk zo&O-&)JkcCxD0HCcWtzKL;^Nh*=kwYXf=o!Y>cvDErLYZY)Og?Y)6!h)`d6@Hm5O* z%7$enN|X&72w-!)mVgb)D6q=DjURQU@P24(&7;b z*komEWM!k(AY!mF%7(QF5@oX$DKfAfQ8ro^;yBox#w;oumX#<08#WNY=6Wpw84*oJ3VY3A(QmnyIQP^7TuaT`<*s!WZ5!Pg3^Su^fO%OJ$sG$`$3@*YNls!0$ zu)*?`U=3IMbYW{nVQU#-Yn8$VaVgdc@7QSRhy-i0uC=nR(OM8O))-yG;sS}T*?JTi z){f{JtqO5e*IK7Ai@JtIB}%Y{4R~Giy_R4NiYTzU)|TiR2A5&&Ou7b(T7fm zR@geVuwhk+BCyHA=6fvyn;>jhQ9~0UNIN>B82D!qzdu)+vPz z;xe!m?jmXJhy-l1vUReu(P|Je*cfHQ@&bvn*@6@q*p4V0tqXBf**dkdVOfb1uwesU z*?g}hV1qIWtg>|_%7(#ZU^|ntnQ9~je`SO4$NZJ86P1k?`f!ZjE0qo6Qm_?bjn4*oJ3VY3A(QmnyIQP_H|u=Q$T!>STRSd)d#_gaKCLD;aO zhE~`xxCm=d_TVhS2Fq81HC*k}g{>Ebt!IR-R|*@%rC2MxW22=b60FI(*2}s^YeB?V zV{{FR3naQ`>rrG_JECi}D#TG;>(#o3MI}nGh7EXK^Szc}4T>nRy4IKI8U~kP?M%7` zi&})W$LU%h>6+kig$I{YkE_)WG&$ivkiXv0*w_joP9?Bb$BXsN;r4oawg0>WBjEe} z4#e1;BW_pchtL3o3**d8jjhArPj7VY;qq$#_Luvg4tM+e{ow|Xj!r=zW1dK-Ltx_V zczg>ZZ8K3DpqN)uuKqRe2rgqzKHm~`m+1gDEAy4x$%`+27D0a&BS>M&{9#v}!XGeK z=0D6QNv3NiO&?|IIlMaDt-UeD&1qXYX0578eD z_yi;OXCI!;j+w7l?&L=se~uf+pYROu5;-_}z5lpczq;C9zgziHudlao5UC3%VD4}g zEV|9mIRnpgH=Y$)=6ONPD*Uj&-MunP^2eJSSPn>N*An`F5iSslX?z1CG0W-uyWZdU zDPqp`;ko}-So#-c>A^tbx`YcRxe#}6W1gD;>(R!4pU(y=H|fVy?GN9sCTMR@HNT|~ zX(dTGv=aEWHT;ef{r=J-#rqwb!EPZURkbB0d~101E`?5f>ItpY>v>Lb6l-TQYKCzI z12*Hu0e@vz^4;OXD$M}5B()CRV3exR@n&w=2sw*bri_Ucb} zu$6{sHD|!new}`4GGc_$&1CA|>f6}b8ScckY6j-4J2Zgmo9m)OwFO7wg|MYETq`VE z5pZuw4)&ph=HFgj{&>56`~BhSfVm7azh2{vVS;RbhV%`5bp7*wcLQYp!6rV8#-$Ja z<^#?EnV2mGqNN@2^2{(rSOSOpANFtFJlyS=(?{QAr+-amW!!)j&z|37cK7PxYJ1C^ z_T@YJRd(JxGuZgtP)1=+3Ule9y1$1|{ z`=XY#*a!cIf59K;KX8zlBqPWOX0WH)Hst9nW|B$9IfvPu=hP2B{>R_^@ZbOYKmYjE z-#uL1>~42gcik_4@zqzqNI#qL=U+ZtyggnXZ^xhh{^8@NSX`&)kkKJ>0U zbT^*(4-XfYhYvs9|M_@#xIY}P$D{u|9sTy|&0&8HA3pA0G3AKt%zxZ9&o{$)Dn z$D94zhs)h9`siQdN5}i`54ZcbuBYE$Ux$nSTj=ioet-S2bD#crbG-l41KiO#pnrO} zxV!pscXe}lxc=~GKQHmd?|$07J3jt#ce8|Pg8zdXkB7SQkSPz@@zC&pUw!p)cl#N- zSbW^SwTq7z*T>td-Q{mzpu;^JzTba(dpzF0>%>ot_=y!i>B%Rq`;UkH<8NO)Tp!-U zINX@}MJx;9ICPw~_hmwkTDVFo7x|-iKFV0@R_{)pM z;{D}ucfa^}xI4T#TpsQ}UqB~|v4Z{De|P-2zukS=^9^(U3Z1{A=iB^zJDvXqU=VL$jV`c;3taB+ z?*8+q9ZXHQ!&h!1%-QmM7+x*hzc2k=yg42(!<}#3MGo&5XW^vv`KQINeic4mpMQS& za`6{vvsjSMx9+@n|6Az(!|mR&urPvU=SHyX#u3C5H}1x#;ciLKTj<&K@z=%v@@_v3 zVQT5layN0d9GkdyWORc&GBqB!sp%C{(?LDcxf#d^2Wf6PUxRS~T_?;=8iX)A-4abt z*OA`gM|pz$iPahEJRYVg>I^qWE6p5v6yf^mp!iV%!H+@(bsj)zmK=t-8cM^EX364N z>S_0VZI;}L`7F7631t>4-=i)H-$m!4yI9~OZU_nj$?CN87*2EGU`*x!cM+Fk>7f*m zgwfo2IMbr-D5BxVv>^F#CRC>ZIbbJVVMf!P!)V~2Fq(8KhIU7>4L^>xo57o&j8+EP zIV=Xc4`u6No=$Q|Kl6eRRKh%r}sQD>B4lj@$imknG-oPYU}7NQSxX($nx-kk+w9i?k3 zb~*(B@^K1Wo7deraD@BUEq1tJi+h^(DBrn#>xBvM9XBrFpqtWga<}+Ryill}aiw>Ru`jj7ZYS`P@msvF zFu2$Q>5*c$6EERnw-ZxLw`$!Ef=;IeLUp_7tmkPbON-r3bW$sJYZS$9qomi1-M3?l zJ$9ogc591bw{EjHQ|!J?OR-yX@?wY8Q5HM2tQLDD&2=J88)hF$CYHXXJa6ZD9-0)T zudjTL=B<(!6!;_{tC6Xez&? zd8?p#-=?YZPfzo(I@-#2OID%zv&8vvyI|LN-x1i6lD?fMeP~itzIubxbDZBxoNrmq z?-|bTDd+bk=l2}v!$EF?(2 z@0YBx@_UZ+d&>F!Jm*6bT=_uvEqnW(BmG_?{hlTLo+167l73&3e$SCU9AryhLHd1Q zGulK_idU=|Ma8}3!yFjCy;*6k$z7}zn>?4Xi}EGdcU*c zSbrt4e$TT0iedc~W&Ksj`YVq0;UHJ~D+TMXG_1c;vc7M}mVWF;QTnTr^;Zhk_ib8A ze|37+hlNm&b`X{!9wb3QDDw(_6A`D>2z z*Oc?u^PCS&ipp2-b~YU6ZzRrNvz)(SIDbPqe^YY)hU0uV$W{JE!TB2v=Wmpp@7uAJ zAG=Xh{-)&oje_%io0iJooSySxA(WNxm#mTVHyr10DCckHIUkzjm9H;+j`BAWXM9))W#RiJYh?T_$M{>y_}h8LhbE}-q2^nD zoxkNMe=AY`mZkhHL-|`u`P-86w;bieLALT0l)nvJT%-K0lJb2!zVbsin#wOJf2*K; z-=?YZPfz)<5ZcOr0_ATx%HLAT-_BD$G$|@yz1bN!&L1Ss-?E%PFq}V7&L2w7A2`m3 zgIwhg3eF!ioIfZz-?w8cKX#+2{GsIhLBaXHO-tnur{{cF2xaB_C2QpTf#dvva{e&S z`OqYDn$#T*KV!K&-T}ZA5(RkPhaG7|1(F-(iFUwaOP^-=|@aSS8x^>V<@EgrtaQdaY1Y6!C^dFgod@^Z6T)Jwx zhFgFuQtJ-bXu|T2Se^jcjh;R?UFisn1u8bQ$8Yd=-9+JNh>nS!-y*Y{k2W6oV07g> z9}mFUVAmI&mWfo*l`ES@(hA8Z>+6A0Pc-CfrKk3SE?Dz`C9t~(j=MWcQ<`2?@4B#s z%u6_!^QdjO3m!W(>~b#&9dc?4M}wMXywOF(*E|r=c}-E#kcw?(1=gKw%k_9BWXvfx zr3GZX2bQ}Z2(F;Q=&OW)*K^g zj=}5@Ek~V+yUKXCjOG|tbKs~1Af4tIrRJCx&GC%|0EPb40Ae-AXf?+-Yy;446ptyS8zgc3E$!xA5KE>Zi=MW@F5V5;b1VzJZ z{@4>duQ`GW31XbD9cz7cM+hF5kZ0k*+PP9URkv6RDwnXHErU8XExU$Vw=qnBxz9a&SnS-_SrOS#zEV$ z7Fu^yKv1yJ&S+4yxXx%$X{N1|t?a1nVt-l$VP7qpA*}`}{j~@|Co$L-8dUMvmIxv? z+cpG6w{50D!ElSFP^Cef?Y0d-f&>xsEd@}t-{uk&9Jo1v3JGF-xE*W6bw?!t=_IJ` z$3@fKB0;h*w~PI$0mMoWHR#r`-29uj{#hib;?!jT^mGY|p4}Wkg#^`{yJ+1R32J%@ z3jW<(fry1S1CXRZ!N;2cC|G&Zs2MkJ$J%+_Q2{`~(mSI-(QZ4VK&7#_Qnj+Xw~PI0 z0fariXoj>3r1bhC1v-h@w@{#p-?s!1vHZ3vP;~xg01D<`G=(Y!q88vMJOr%-1tLyh z3ZUo(&J`%wfpY*A3dER#JJuEKj!FR1DNx-UjHbIqfn<|#7yDBKh*co!7Or8rS%Fs1 zqCgefFaw~cD^N5L=Kv}csAeNZ>rNEt3C}>mO`IzbF%)M2k`ySoiZcKOV{sZa<1Ox3 zbFn)r04NxYXA~%!e`ge^v>8{bR`wcqu|F+9b}V0ixFB8kCy_X#Fe#RPit~_<6bjMK^PfpF)6Yo@TV}r2sWO z0R?Asjvr!fruq}@%{hL8!#TrGFgd3|Gd|~zH9EVa0)B$oc}9Pt5qU;`O3QPlXl37X z7yHxV2fLrq3~BX8>4HZ3a}pbLp+6NTbcr8ghHlfJ=!wqo6Kv6F3RU_;&Cvjz);|Mn zgeM?klBNKPHt7OD{F?~DERF7sc@u#(On1mJoxT0G(Fsu9H;snWB0#c#x{Lj(0mKRr zHB#5G+$=zwXAz)^qnZKG(*-Dct8)Mq0#tKYqje_&GyojV{cipkZYj;#opkTh9QJ`pyo>8FEf?cUv*@xZ5{Lz4l>#wl?Kb=f0z@p^6hG0loeNO#ZRhwYo`4wl zcE{Sc-BAfYIsvM?xY2C42$1aN?qYvx{ICKi~VWwgPq}MhP3*lbciGUIf+HQ(4UG+yu=SNiX;7@ul5HQIGPn~6{K&- zMIU))MG9{(r;AC3!GRbCi`B=bLGt>%cQ{3Z)kQZ%MFLEPudZ~5;iY->gJLa`#ERBgdS?e?WQ@&4by4P;jZcOS^lFufPwPfe?PC2Et;HQPIdSoiMQ`!U3K( z-Q=AmXa?69xqyG#i+7!Uuh)QWgvFv2*U7AesP^*BK(JzyOE8AQp)eGB`mTml+>I(7gKmLkQ_XlJ#>+>qAsTFx+t6aSA(d+r+{a{^svBN3 z3da7Cf0q~-#>stUu0xZ&$(eA&CvG+3EFcpV3>saOaIHz+WGdb!xr@;al)rz0ZW$|; zJDTL15|3FTx~Mr2VF(3JkeAufz?e;NjT2xDFj=f8B=yP&IiU?C3~;?FB;FgL%?JfSNSws;#}0-^2z>?Le|ICP7V<=O9ZuX-0?SlIlK^w#l}^4A}Rv1 zBWC@HW)5D-2A;!O{|C>a_)4;KZK3me=704J_L&*9YYqH^HkrjeD_x7c5^3 zy!>iw;FZ`Pxfo5CT#Omo!uR5mDOHMD$A}sI1q{-m9QLx71;ZBXQIQsO$!?N^jghuaDQ(cMNUNZ~?U@Bz^4{ml zM%?!q*zj`)-8d%yeWq;5fuF#}c<>GD!FNYRWlJvn8D)#U_*t-dbA1cgWH-Kvy|ySD zb>yQNYf(1%Ue!irJCQHHP`0WwzXV(6&2I%8^5deTp_@)z76Zne}tD#lKOY8(^f3HS8N=*v}r*!nZ=ZDXc!G&6)Pmz*-;EWb3|( zy*8mukha{wU)5Wsi61?tnP-x=s*RsP8~y7=GulLHGmNy=4gIJlsI-k}YurdCSAVW; z#MhspP1d&L?9b4ay#4707|1)h%-hVWu%BMEY|KAEWQQAlZ00kS0 z0LY~+g#hGWW2B7<0x)b4fIBLKP5aaq&H3|SYn3)R62Qb>o4_VWTOJHhX8_$FQs0lBh~w15n3va+STfDCLY zF(BP1lNn&x%m8;(1Y1fCm{GRq0SY#hERZW($`;7M#wZ(; zFJRbw0e4gen^xJP=YJk-t;!}R4Vc(#6W9c0%ku{64A87>C(0Zs!PfS-HNV=bU;d-N zw8aEAgR%#5urUv9_51+@O7hS)f~|2InKB4+Wg{sB8Q5fHOF0A?*isTf8b6aoVAw1I zcT@yhN+Xz2wwMnv3pOs1pjy{*DuIc;wt$T$6QCJuQ8r~h0aCUT@sm@T$gr034bt$LgagAS9Jr$*)>6j7jIPDhfmy6^IS19Uma`5_ z?6n1JH17b-Sc|SHQxA}?ohbF7z*;r;pwzW2`Jh$TQ2IfJwUmE=rc|kGGy?%(*8XR< z6oXKJO@12^1tH|ZmZA`Hurb2M#32|q4#6Fj!KM|q7*Q|}wpL-2gAq*ZwFzv3u;uXx zbp~h_wi87plwfNUHow|W7d8}?kb{j8wt8Fw0woc)5p0dS$ds9ogN>vnP-R1@2|3tO zZbAmOl$?;p&txYUHao!`6~UI$6K0ex<{8X_jZ09d*0r3XU}CQ=V53P2XvSKUO_`^F zlnizx}SSmSaTs%0%_Gnm+Gi>}dp1~g+Wx~5ENK)QCKl!gLp)trV> z*RrGr!btQ*+!Vlo<_P;`=?lsz$04)Sh4;Vl1qIKn*=C+urZT)KFF8}q7E4;R$HHNF zcNLik{mYkMFVYun_O$GY*DnP(pnG@pD%fM8x8jBPWX*E#0Y_`q7CrGf35ec`Ew#rQ z__=D2HCyzAhlc62jI+n4F(!?Xl1)j4GX0dF#t(TBz-@CVV-)ds8BI zUfN>~q%|yl4K__|J%qJO_Sh6akS^r10AO0ub<-V$W6*?nV_`t(K2a<3)tj`H_~n}h z4~o18k|GY!Xe;*Ep|r=&RCXMCZjXgcXPSl)`{7T0DPbXD*=H;O(WY|j@dV}-}G+KSG~JF3GobwE~@Wc*T3}LT{jM_b>A$11-yy9wrKev?3?K~!n+|? zh)Vg@@HW|F!J_Z!zCT-?59?*W-oIWhx39pEyE3co*8K!}05`Izn~$qKvv2mOjq639*7~%N%tpEPUGZ)-@uFm-%-dsU;AL^7 z0r}Qj_{7P0?2Et)6EuOB#i0WjUKacQr;EZd*G1kfV~>Tw&^-gvbsN4--c3ynUeKM= zeGZp|fi;+j#uHfgdFr(RUT{6u9t+b81A~%Ilqth&Z0wik?Cjm~9u{-|>Hgt%Z@%~6 z)BMx!-SP2{yPE_r80)jZ%Pn7nJ$77e4ZKo$B6}>{cP=Th;NsVOMikklPRv}p!m*eA z4rmr^c*Bgf%+ja_tYy$Ix|irG<*0|$ zYZKUbEwfAa+@S`W?sq^KY|o=*Zuy$P=2lw;wzNl0TP>I*RGxT)ZI`9A!7=xB@ZXGK zL2-=|n?;~9($=2@brag$3H&}X_S%FtLE2i9A7CwDP;F>?CTVL+ei&C<;3R}E5Cim6{4E09HxdIP zZ5<Sd(k3TAq+XlACP-UL z@&l|ztF%2+@`G(lesIly&QqHarHx5`u*&2I*RB9t<5Qa${9tMD0|lF`Y*O%pWr82z zSP3>Z_yGnZE1Nd>0lL$Itu^?;%E1q**A}n|!4KAFIcSwl8T^2h?U{lf-14<3na_)I zLhyt2Sq@rdQwBdEWqYRJ2e*7J%BBf^s3@Bl{9u{j2RNn!8x#D{iZxN#Xzl~SnwRSnEPOR=C_f`+y^)pKeBmYYurSNu@9EUK2WU5x+cXwSSI!Xj+MH`#y-Gc zWUOgpAD}y}uC>NKSUL6~_1dCqLhOU}Ne)_FQ^r0ZU3;e32e*7JSkuHlRCG;@eXvaI z102)o8jXDbn6>|zZ6yjD&3zzXlXD-el>1;;jIc4e50=e+a7RU9TWN(YCNRtjn~!m5 z5jHvZ0dD*W!nP8GttIyX)}mF|o+52%9qZ0nWw3HiE5j7bylm zSQ`95!6qx46#QVB;0HKXDjOU80E3airVW08?zGC*8vJ18;D^*}i?Rv957uWnXq8PF z{D740nSvkO^0k0X6Z}w7HZl0YGQkgUOs8y2@Ix!sL}6Q#+y{a+IrqUzxes>D2pg08 zVAiAZ`51>5VUu$o;KrXIY->T-T5=y?En0=`nQ|Z8@-<=Y=Lwsb z`(W3MuqksN;M_vk8lTw2*au5vA1KyjU6W!TEED?x$4XseV;^8JGS;-Q573=f*IHvA ztQ`B0dTr4)A@;%gBnPdoDPtdyu02!igIm59tkq&4=!>{aj)UD0do1W*dW(w$LZJ7& zqA3whPA?z}_E^`!*NbiqW}?t``mQDa|NKAjhFJ7M+Ktz<@H(@PczAtweZ0NeT^_#d z!5#bYu!le3yNl8D{Ckht4SUIo*K%x%uk~c;R@4dxvBy zAa8tys$Bg0H;ep47|-;bY;;JIuEoo_H$TqulcCqeYcTox`x@tnUS*=ZcopX`O%oCi zZ>I^42i)z(AEt}Y`3ZLa(8`=P7kwZUf?dFT(!-!DgF+iw<=!L5GVU+Bs7Cw~Pn1HjR%!>7gB+sob6O?1wkon7tV zpyxF2Cz?83r0=!0n_(Kx;#C;W0xk1YHEtEYKiux$x+VGj^))PqtJ>*$(EsangUgqI zyfeR?vA?Usb(|vRT92>dr^3>|_8!4FcMG^-xUEnNwEJ;b-c>l-3H`sXrZ-}zF;y4r z(fJR-=DZv)HMuQ3X=DXwT*1Y)byDdk`s2lj6jW#93p@a^v1J-j*pAH0%Ad*8Q>IDmd4dk81}TVX;C3K1l`K& zCH(YoakT?j9(I?1xC7mXX>eEYm;Futp{t1PM8$LlJd?+p^rGNvHXZ`ubN7XY3Q;U> z(zAsi^z9Q367ENmgM9@e@eh|5KiuvMH;4T-Q2OJD3>fZ&oNw_bewx7b=su0Jw{ti5aN!;C9#xJ`(mF+U`2O(z{lnd! z>4SXoI9@JZ{vDpXExcX%(qBK+|BpBOw-1-QTjsL#qx`ye<5*D%^)7|MPf~tEP+5n& z!<)n9;r{alfY`P2+dMbb{mT8Xo9g_(fLCBD@~8keSvR}e-PN6O9llyjq&G6Q?|=X4 v#=s(V=bQD$dXF)TD3;WU%m@@Soa3(J7aVAR6a-Qrk5C?7kpKGP#aI6i#tnrs diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_omni.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_omni.bin index 2d9e195fead330795e134e8ae0f074b29336124c..39f26b5c35aa8bf8971193fe39b882c66a8ae6a5 100644 GIT binary patch delta 566 zcmY+A%}T>S6or{CMF`Z2B3MQRowT)f(nJ*hk~V2Y7rGWoh_-4lacYukTkr*RQ@JYz zw@Nof@i_#S>e`);pbHa!YPuRO_uMnzIp-JXrG@Tp5b8YKB54^iJdRUJ`Gr1=J-d2r zIC_@iB}|-(TeCbpE5MpO0`DtPIF=`o1ZT21B>94xZkc=g-X?QR&t!+`dZP*Va<%W* zgi;A)MS>Y67CU5)ZCGZrLPE=HWwd`T_!Z+_iy0mqC~9F+1K5jqc@{Aut^t2ReN38_G#t{9}?Xk?%3CDTqQ@OCk|k+8R8o+(2+(8})y3L4Z$f3SPA+NCg@tq{>e4 zkE5~e`sQ$1pea8Dsp+=iRUFf>)(wBI={w9~PS7mRT|60K-8X_Hp&hHipWiER%miK$6i+k-=J zbx`??E>5~0+#jF_B8Y>lo1>GflVH-)HeKEiJ|8~6e!gZe->{SSjQu+Oz|6ZicFse$ zE@8E@j(_*gQPhnGe$vt z&<`VRG(J-KUYdGJ0^rN~&|K)YjxFC* zWmpC3*Mqhbnks`uU^z(^i^BlN^*t3I)~C@Z&5U2 delta 605 zcmY+AKTq307{+xp69YjZh%OBW2yrHn<2$>g5dy`Dok#^$?H6d|h9CvSICTt782AYM z(Nk4I9lEt_ATf06RH@&9p{#T*ONXvKCr#okr+e>x?s3=(DAFfMmH$?U&t2CQog2YN+>z3*Ytsob0hLg zR!9^SyeKTIzVyf!`+Q}|&nJr!E$ zIb`7?glWI^1GeJ@5vp8fgpot4xIZB@oD|omg{IKeVNX8(ELw6-s`QfN;gyc%`A~9k zVa2g$W%1FD$J7qpz^V0kUZ~x0b;f!KyG_pt*brH8+*>B$Shmx|z$^PXe%Xm><~p4b zmk{`7uf)fK5eEL)hVC|`F3gW z{E<_b7g^9^az3X4qvhlUoCch5g_GZMMhcp1g47|jTTBk;nj>qjgD_7MO@-xV0d5~A zMvKX@yxV}J2wxk};MshkLK+$c`Q-{4VB->#iZwJeCM)wB>L_R_Xq3k1CYGcYWhUl$ zCj$AU@yYo)`9*pal~tOW3fc-95KRgSlUw=CP*kS?RYM(YWU5yIRz3MPzd4GcVvs>7 T3M(}y8wzAFDQHceC6EsQI$~qi delta 351 zcmZou>QvgG&B%Cjvks#=hfG>deqxD2Np3+|Vo|)Ig*BG~oMS$D38w+0#pJ7;2C`+T z$;NOAOOPsrI?Ks?T#VmQvt+J&dgkk2B&#KLl zHPb=X?$*C zNorAMVvcvBrUHncoS&0lq*qZ{rKzB;0N123`J1*Gvg#C&YG_zknCMl2RZsTOF_%X& WvKV3xvck&Ai*3BzUz}NznV+XuQCWqo#A5PnP6I~E$!9nXIN{nROL9dDnrnj8Aq=ya+{`sc z)?5c+x+aGz#*|6*R!cB_f2w0j^17@)~|KB_!1;Al1;YFf!GvfT-4(EH5BB cSyDhj9!Y62#582(m6Ia{G8lCx9~Q_50G?!KSO5S3 diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_csm.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_csm.bin index 5584e47ae63f32eab43b9c754ff1d8f7a20a835c..77a9847dadd7b91e8d002cfb591940730eb33666 100644 GIT binary patch delta 353 zcmaDB^EhTh3M1pM&8dtIs)1#x$;JvLxdmm3Me*k5)?5k-X*v0cC2%1NkPuAXOu<&6 zG(IOYJ)6&ONEH)=;_%Jb=PhPLJ4M?VGw*d`)s~sw=p;3@uuAl)nE-|TC0|+Kh&=Hy3 zr6Z%GprxQu8lRh3l3J9RnB$!YYAe{Dh3&ZqOekPa`9*pal~tMw+6qWIFX@;et4;x_h6ad*iCzU*^<)iQ Zb9p2qiy`J9E3BMcuUpKhGx>{dJ^(KAYpMVM diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_omni.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_omni.bin index 6f0a257c0638b75f8ba466310ed26da1fda093a0..d81fea06f256d6b6239b2ada4b32b546f7a4ef55 100644 GIT binary patch delta 340 zcmdmFz2165FC(Mu=03(Wk-)OlWMhSr+=8;iqIeSnYc2(aw4D6J61b2dNC+x#Y^h+Y zP#T|;nVwM+kYAixl9`{US5aAoq{PHvvVfQYqv2#nF#}Gxw#j{B5lqIGlNX8$PyQ`7 zL(bSz2VthBCP+Wr5);GC8^yhun1CkzliUiTwo0`D4YZLC71Gcs$S+sW04q;SD%Q}@ zn0!RqP)9*aL8CN2H?btOC^Ip~I}yk)jZeJ*@A knE%c7D!{5I*T|ToC@KaSgrcxgbMhsb0wx8m$Rl`8fKt};aXzD0v6y%pHXn7Q+<~O#~L71qiIXO^F zcyqhBI};O7{(|II5Y;Z#1~idRI#gIgqaeRrK?7_|Vp6dN5KP`EEi!qvw2Y2|mV!oU zd~RY%YEfolj&~xEUmBmBpOastS5aA|si~l?paIdTpfLG|v>A%(6rgIDzs>b3z^W(v b$(W-kDh3&ZqOekP@)DT>CIzj@qO$n_r2l2G delta 367 zcmZp)Zn56b%gFd?b04FHh)h~eeqxD2Np3+|Vo|(_fi;%`jALv$SzOG3(O|NNn1O6r zYO*m*!o(1y3a-w?aB`zqgpi4$CWRl`8fKt};aXzD0v6y%pHXnH(jt>r zOUsx*1hf=N<8u>BQj0PZbG#EZ6+ryt{G9wEy^6{zO$BWQgifF#lLcf%CUeQiBWp?l lX@Z4~xn2cW(_~K>b9p3_iy_7#E3BNnK&F6EXR?rNJ^-&|YJUI# diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_hblur.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_hblur.bin index 927c8becb1a1e2637cbc1c0270eb623d38c239b3..db2306e10195908198d0cb1fb2e33193322c1919 100644 GIT binary patch delta 336 zcmaFNy`5)*ER!hPMER{!X*v0cB??J7rA6_E)?5lumV&K<#^jI8nv-oA`6kb2F`1mm zqBD6nqu^v$CQ}hqWe}}k1tv^xxFwh2lT=}L71hLP?jmNP$vP}}ES6$%$7OLbE(yKK zT&ym7U`xwVlT8##atq25i{gzyu7I(D!H`yzm|UWv0rh1Nt2?ieg06xFOvU77thNB! C9AO;* delta 277 zcmdna^O$>rEYm^OiSk=r%Tkj~6iRXn$`Xs>4XwEp;A{n3g|wo?PkeqF}BjnsHz&=Q0bif@Oggf{fFftj6LBHf}YGI~Pa>V%X$H7M;l^ btS&4-API8{9H!)C{5BI*&9$A3{Lx-e38KyS@A`-e2P@lsjV}Bj_c|n z7Xs6(>cs|KY(*E3MHjc`2GMo3>!C{wy2Oeu8H+9%Oeb{hSja?_Dur|VRL4Fw@KP(h zbSylzvj!AT=!4gXml=4O6<#(LUN*RT)CyJKWIb&kY4qvNiOdR+!Yq5|-@OHy1!8yn zdJ&t!sdg*UD7lcHkkkb?uDq1rxekbe9AF;$lEDr@bj7Od0Ah Z|BzXf`J*fr@2awrB-4GLoPKj%=MT%1-ktye literal 2695 zcmb7`OK#gR5QY_WC-e|pO06q!M$`*IR}F%0y6OQ8!B!jtwq+>tD?v`0Ww*USHyz1( zOv1>a00X8?&+qv}@e^-<|NQjw=ilEe>+^2@EJtt*ROnQdA7v^Xs{3$f2; zDE8AbJI?aFn9FOM%_uelgEKfd;}6cLYkRj@-sQzwJf!RGDl70t@J^{RU(UrkU2cTq z+E2EqT2-Q4Z>hm4btAg5_%0j*D0f9hDGraBFaqg{FG6~V3L$W-fEvC@B#JH(y(4AL z^OAC#|MQL~%A$+qNKZ;Xks$^X0iJa0q&CDmX@!r6ONAVYE?3urZwLj{Si>bDN|eS$ zSGo&T8kcXzr8F+zGv^9e3xP4$pv?#$s^toF>+y{q*m{W zbXGcTcRrEYm^OiSk=r%Tkj~6iRXn$`Xs>4XwEp;A{n3g|wo?PkeqF}BjnsHz&=Q0bif@Oggf{fFftj6LBHf}YGI~Pa>V%X$H7M;l^ btS&4-API8{9H!)C{5BI*&9$A3{Lx-e38KyS@A`-e2P@lsjV}Bj_c|n z7Xs6(>cs|KY(*E3MHjc`2GMo3>!C{wy2Oeu8H+9%Oeb{hSja?_Dur|VRL4Fw@KP(h zbSylzvj!AT=!4gXml=4O6<#(LUN*RT)CyJKWIb&kY4qvNiOdR+!Yq5|-@OHy1!8yn zdJ&t!sdg*UD7lcHkkkb?uDq1rxekbe9AF;$lEDr@bj7Od0Ah Z|BzXf`J*fr@2awrB-4GLoPKj%=MT%1-ktye literal 2695 zcmb7`OK#gR5QY_WC-e|pO06q!M$`*IR}F%0y6OQ8!B!jtwq+>tD?v`0Ww*USHyz1( zOv1>a00X8?&+qv}@e^-<|NQjw=ilEe>+^2@EJtt*ROnQdA7v^Xs{3$f2; zDE8AbJI?aFn9FOM%_uelgEKfd;}6cLYkRj@-sQzwJf!RGDl70t@J^{RU(UrkU2cTq z+E2EqT2-Q4Z>hm4btAg5_%0j*D0f9hDGraBFaqg{FG6~V3L$W-fEvC@B#JH(y(4AL z^OAC#|MQL~%A$+qNKZ;Xks$^X0iJa0q&CDmX@!r6ONAVYE?3urZwLj{Si>bDN|eS$ zSGo&T8kcXzr8F+zGv^9e3xP4$pv?#$s^toF>+y{q*m{W zbXGcTcR3Zb~S_)8>CXlJ2QIcCwmRJ;T0p!4#APGY~6B8qI J&B?bp3;|Ql7FqxR delta 82 zcmZn=>Jggoh*5Rp#5$ NJrffn^U3Eq3<3I77rFod diff --git a/examples/runtime/shaders/glsl/fs_sms_mesh.bin b/examples/runtime/shaders/glsl/fs_sms_mesh.bin index b5db9cb0de1fd5cc311b1a73a229acdadddcc320..69a26dab6fd385fb76a68c3301399130e5f3e8b0 100644 GIT binary patch literal 7911 zcmb`M+iu%N5QdfZqJ{bn#a>d4qlkN=gdn|15agynf%INbV#QG*TZZIw;K%Cw^`GTZ z$De<_{`ccggW>Iby}I~z^Y>==%ZtI_#o)Kw`R?1| zd~^TT;u>G^@4w#%gS*A{admZ}?v`JSx|?5ZwwH_bn_>3TZTP^S3 z3~#SiUon>ASXHO4FYFeV*X!k0zyA~_0iXSB5OT9RSC@;`mC8oL??Xjlv|4|e=Wog{ zM%`RqV^VWXhU#baR=vu~DX*TES)F$L@c1+uk?Ys>W^q#uFpa?mgU>fNDywe#tn$)f zV3G6)4ph;SVy5FvcLKdab7TkM4n16q5{@t9v^O6HC_0 z)t2pYce}osd$Kf_r65BLQ_#J$jRFmjnVaszEIw~G>uTJTVywQZY;pCNU2K<&o8|VO zZwqXMD)3pzndP)l_@J9p-!W*PdWzH(GRs5sXSH1KmZ=LRSTA=wF?x_82vo+XW)&wf zJxJ-05_2Ihmae%vGrGE;ZWc$t!>U-7@2J%0c_=@1Xbj<+Jwd&!V&zqO z1l!ka9*VY}wWa_EiKt?+T@J0~h6#&MhYM9#hco3J#=FTizVan7<0r~kJ3OI+NCp@0 zyxQRKDw~piuh32Q4Qk&Sax)q~l)=MlRUt!zsApumWkDNBWSN{QOQ_95S!hr43T((? zYmMu535yOHL#uWcfcrUsQXH&~@A z(y_KHiKqe*vHD7FgG=PNL})#IRFQTq67im)QM4ToAh^b}3>b_A43^ivO@YCPzyPZxk>$W(IWX7+7~s&92oAkek!=A6%X^0H z1_rn^B>J(3k(GeK9s>p|0fXhGZ&P5fA~3)zO2mP|a$v9tFu;LH)Dtk+7GSWvXV`9F zfJ-9Lsg2G`ykL*6auO}LW3=ETT5!DbT}lg1qy<uLU8D%&$$*_aJ*%>Zd!oL zp+cuViJSxr?iegM2^JhLe3!z46JY^XQ6UZsj>CdWU;z$Hp`KvDwZMYo9m93Q0$dsj zL7X4>wa7`Z;Eut9lVHK~!uKgGI1v_Ll_c^U7CeUqpTGhfni9dGmm=~lu;6*i@ZGQg zmqemd`<$0x!5@PKFTsN6mG4tn@FFb0DoVs*!E;#f2`s>YNz@Z8_!e03yl41sSb)o+ zL?CcR`4yXQ1F&fbh83n4i!4} zNmNLzP#j~0LSlu27k-hlLLssOtdc?nXN7{ZLXofn9GVKjp_evSG*}_Nhzif>{fqL~ zD);d;=$T$eH4iL`&{pEG!j9=3UOdmLjr6kRt-9Xa<8bctE~679gHxuQj;+d%5#GCn zL$2~#M#qad9(@_k8OM(}sM{Yhxo{$h3ND Jyq|}|!T(!UBm)2d literal 7561 zcmb7}U2oeq6o%dHVuSY^2Jli|6W8LG92D72i=sCJ26VtK4YzSq4^9-=`Djw)zwbSi zWa)?pl#&LnMIDldug=S-6+e9X`17wf|9$*vGQC^vwwK>-|1J-|yqZj2O@6yu9lotE z%7?$!H@L*_zrRl=_v`)R_WDxYZ@w6Hzq&5>SL@x|X{Xtux$5|(EcX}e9(B3jZXVuF z@2^6J-{!>T-F~@8$WVyXiSL^My%4X9aQ$@pQwfnNl-&Pk! z-Co@wsgXZ<`LL)7hZ&MR}{TX3-~2lnxz3 z2K7X?)6dSoqi21iJD{CE;zpKbn6;ia%bGa#=eb(U7qc1N{6mG1tMzx4q4A{3qwc6w zrsoU9G+jd%>eM7UQ>V>MJv(6vR8M1uAIvaAAA>p78@0q=v<6ZXNrsu5wVi~-BCQ;? zbVcwT5j?Gwl?4>XJiO^4%=x)2cTK(pjj{czvi0?2cDdiIZ#VmYzOC`t>umffyiq*c|>0(ud62=rhm zIVu4A-^4dfkk5){b>_XCC}|lp&{L%X;&W zH&H76)~Z;70PS$W?d@=ys_baKJjW#yAlLIJnz3Fj0-oR%dIYXb_9$;2+}nk$CF;?NQi}V$?359dhX5DHMjM-*Q#o3b>Ta+NNor@9&Terh`F0qRw_FQ6@mN*!` z9laQqxQHblt#EBZURsqGZlNn!50{47>@DJr}a71p)0>Y~&OuJBo3VFa)uhVK(a zthwVfN`7FMKuEMrjNK)4ZAhlD)`=R{)i%w2t-13wv6$DeCaXu=1X`sU*0r-5g{l5A zVslBRW!r?dOkoYHRldut^d|$8;>)Mc9;uyH?MyxxV+i{!F+ygB0m8#fq*clEx6TuDv-F*T9DTxiYoEe54LL!MrD=e|jq*!Mp)){U+6SK~U ztV64)FlU|NtTPeo5Wo~pv(9kGnPJu;BvN?nPHZIBnH1}c#5%*BXJXbFk#%U56tl+9W(ToFC>KLi!4i7FfcZPhrkWnDg9s zKE|9EF^5)BV2(M@G3O)9A%F>-#+>JV^TU`!NMGQwyKo_4u1I0dOPDLT?TQ$4g@`${ zN&*)ga|Op-5n&DiU4aqMui*NHMxaA`TF{(0(CcS>uZ|z+BDzFFb>^bqD;$;_&tHxw zAGx04bmO%ei1LW4PbI2(hI;4)^%xvj+i_vbQDKG_(@AqENfVYen4}%I7CUY&HmoHa z9YD&V6kS--aM-w&_;D-oVI@_HLkaqEkEW>B@kZsoKErsXw@2YrqAv0x;N*BQr&n(E z8BE(qFIUdhP5FQWrO$_qUdtPtjpTIHQhiX-h19Ei86ALy5)WSA6m+#75xo=;EQQptf>EwTa@TznG diff --git a/examples/runtime/shaders/glsl/fs_sms_mesh_pd.bin b/examples/runtime/shaders/glsl/fs_sms_mesh_pd.bin index 9623b98d5586f822f2d93963c3e66a7f87406287..24fe61aa39df201c1340ae16f0c5d51e708b4dd2 100644 GIT binary patch literal 8249 zcmcJUO>f&c5Qg2|Ll@pZ!6Us%T!|mHj39eyQS`FF0`1*U6D9FNi2~dCEb`xXW<*M& zL|aTCw}op{*O;LJ!SeHEd|LjHYbx1bysK8iIrD zLMQCRUKEpKX9r3S6Ziu&Okj+JIoT(cz<+oTxTCO0n%UmlF)ggKSGsOlXPf(cyPRQ5 zb6e)vV9d<%-knDT7{JVK(<80oXHn#KT!J=MmyD;k&-`kgrQ2-%<2r>0!5TiMIeCm5 z1s`~G>=z8GrcPjLG|6MK{>rj^lXbh`1bMdEc&!r#0#w?tt1^p7T2pG664rvfoavgo zv%ss>A{Vqj@Khu5C|+n8OWJw!9bx(QigsMt-HK_-%4i%-Umn3QPFp@ncni+F&;>Xk z8|-ruPc=L-@QL%8n_HL>&_glfm7mecmod2?Yd4a)rW&v#Yb&l;}eBQW$l1w|TY?o%ZOZFtTgWk>Iv$deO}efDV;; zSakC+bZ*cPpt61FP}*DQg2@?mc6Yfd=;@sN{lzAH&^TQU1sLX?s z1B)SgDcztUL1lZ$L6;7>&`2kZIy<{8DP?!wPik_qeD8AQQo1>@B)x6f^pTU|0OT;+ z9+n)W_|+@H?no!ym?1%A`^cfPS3dW)KqrkjySq$j{VsCK=W}jKEJ$hj%8B)M(b^pZ;sKn|1bVaY*; zA3#pIAw%_-NT5rbTqro@E08G4>UV%sz5(kSJ92&T9d*4*pu8-d!`P?WERqTGB~b!#ZfTSI}?;lT}FLs4Nh6y*jC)n7w_ zE)8(N>GH5BEop+M{K;u-d96Wz8Z>l(_!7Mp=fUn1zHCurw6a0fW;88)NaJk{WTQm(k2%S&R0Rv`zk2f zS3%KkHmti96pe!3iE_|7Jh;ItC_1cyqTPt0`zt8Wr424L%4uKyMDMGgXkYzAyUDO7 zv32rFje_0hMm}NpG2G kqZOs`FPdt9D^ISj^5xfcdiA-;i#4pGTGi?Jbvz#Z4;Kjl`2YX_ literal 7803 zcmb_h+iv4F5cReXE!=-7_$W7tYw_X>g7jq3bgNrHc=86P88VAb&-GX%#adE zX>7?(vVqs4$eE*~Ih@Jx^FLpH{`Ky^FF*DA_w(iA>U#5cvHs;lulJ$%+x>ifom~`< z-?BTngx{~f_j(W6>UnW{B_8r~B_8It#p)(op7w)b4a0Wfc~Pt`qIFKpiOtO&z?n-N zD8Gv{agtcDiftloNRkA+I=@L$&J%x~iP3O07~su61Wmcgo%stuE zEr1zXI01e{JG3vMqN1|IoCPBjUtY9&p~SU3PSBkpzXq=)=d%=OM)7*B#;ulInz#pX_C;H z1Cn{2gQngC4h$Cvq;wA&Ra*;$G0VZ2=OC6>I&J4*+T@_K7M$?n5S{IcgFskS97rcA zr#(4paxh~#n6VtlSX(k}UI(!VFx>cC84Vtq|;su81uol9YJbF4bq9KB!T2qv&oWRcoJf9$w@m2lO_qB zIdIyG@!AaM#;7FpJA#~W9K_j7lALNbSq`Qw2Pzhq8nto&QyPKLbw^N6dl6nm*)2-r zo�pW=OTwj-cXvrbtaSn;Zu!YPL>*OSh~GVged_9@br6>2b!xB^{zTmb9JJQQ<-koiJGkwVU*<{ z7M5O@V6ZHp8%S0|b{m6>LpsM$IZMmY{ltSr-BC&H9E2VE&JT$N~c zRf&eH5>1@ROtVTfDA&er0HZ7gv9e5il?YSn6m;DU3|AwXT{WWNYD5z!GSjRP4a&7i zfv*u=c}cE)H>vDMVS56;+x8S*G%jI)+GR;Xjj>Jsw7Fm9(5r*aTGgzp+GHt44fLO| zmynp@Y&_EA{A4tmV&le0Go9iU>?zm+QM1ul!gp%vU^A?2_<)rc=x5;^gT0<3+p+5i z0pHr&AwYNp5L~~_GIV5Hb@rm_>UE+AOYXO0gW5j8Mm;7A##0px!W-;@O=4<&Gd8di zU<*)$uQ3=Fw$IrTRuXgGLD)i95MkkE6>ebNV-9BQ9eNVe(m^o8=m#qv4q)(zqQKij zl@e3M+i^h&$%P#obe%#@;r{(*Two=@Rk5`t;JQdb;ih^JuF5;UP=8T{8d&yNtNVKg zn!*C*Ab??@ffWxX2(%!~_6RclE?YlX2{Ac}m=Nm}VESEh0aytzm5@9ppFO(-mp(WL zl<^XVR+%!vs>fJC3@~DZm!yy5{4oyL^K8~s64T@3Na$DKX-K`aB$#9i?S2Wj8e2_E<;I1@^- z*0LY?(B#hEOYqfh{%>eX`od6iv#ESALz NP*kW+`>*|e?|&hZ{W$vOwTBB&d4UMe16yTi6580F@ax&91N}Tg^@{8h) X6l~#gMw8eZChM`YGa63rX3qownmrqN diff --git a/examples/runtime/shaders/glsl/fs_stencil_texture_lightning.bin b/examples/runtime/shaders/glsl/fs_stencil_texture_lightning.bin index fb8a5c2b79b77b6b9df0ccd68cb218a6da932143..da513dea90cedb0e3fe9de030e8113423db84d29 100644 GIT binary patch delta 155 zcmbOy^i6QWI!5P>>kHT>Phgdu?9DDHU6z_`qEM1sP?lH}Z)jxArGVf}p3H8pZj3Bs ztXEN4rC_U2kYBE#k(gAh0oOSBBfC1kv0gb)5+SC};ml|}`2dIBXa870p7 QIr&BLMhaSRWgrD{0GHJ={Qv*} delta 128 zcmew+I8SK8I>zjc>kHUe%2Jb!CkL`iP1a+VpS+EUpR**lpe(T{-q2`rA5bKN-JH+F znoB_eCTuc!ExQDx@#JId>ii~p-s_`4@8Gz)V>Wn8VFp5q-z$njXJoy2msG*&!YmOM`fs^sj@ zFcK+C{;-iLtJ1m8lDH6Mo@7(Amv|CuF1aYCW|fp%UaYVqU{yR9nJC>(*oUwNBGniM zm|kfGs;B0r;7cH9c_ITw)c>8qx!UY96N!XI91ti3UjP&@m}Q&qCadQI_Sl=kUv;s} zpFmzb>_vQxG+CcrGpmMW=PYnsnOe522o2?67Povmx#} zA%^j*M;;LTK;h5DdJq2g|M+UT%{(E24?*O$7N=~`Mb5TOP(h*dhLW^%Affpgs6i-E zM2I3ahdwXpQodXlA+xu81gk_>wz?x31W@$vJ?dWIvC)H#})p;=<1@>HQx7N?4tgmz-dh(5XFjGsr1mlut!Kz#KPK+W%(E>$4HfOMbswIR=}pPcH%_&89C;c=F*vk zWrx_2da?0*y!YlYJuQcG1Y{axPdWqpSog6*=kDpeDY!YPC; z5UIv6z#NqBK=sn!*76p}S(R(Si2BbnIG4-bmMYiKhywzJk{f`MH48%j*=MXv>*^i^ zWqdhA)@_j`_|rVF6$?5DcFIH)hnTTVm<(E32M}ZMnBz3Yl;{!4(*)|-SqBtCO$fm_ znqmyU9A^)h67bZ3uT^^leE*-|<`wqXf?x}fw;HAxCH5{s)rjZ`^$dfb+V0d$L5ZdW zZ)%3HO9ZNoBR?7Mjih}u(l^6C=O*|SSnesH*pbjrgb3m&o}GiI_A?BvEMbf11b!Yp z00D>?#UA%KV~=gr0QS&-L255h9@$9TJ11*yxbMpBx?cu|YCz1+lUM}A2u|4+gl%y| z?E;$|MyEEzyZIo^$y$WRh&c6t$A$`gB=is*ahdmP&-qg}9uIWmLo=6V_lRSE(Ee?7 zx8)n9hb0r|_FV{fJEFUt*}?1O=435ya>O#8jJAHHBZo>NteYJ;$L?%}= o%8KZLBnzgt$yK M^{TA7YPq-=0P%!5d;kCd diff --git a/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear.bin b/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear.bin index beacf4423c72806bf4324985be576160276ca7cf..6819ef3d4047ce8630f616ce8da005e0451c8d69 100644 GIT binary patch delta 63 zcmX@aKAn9+Fr)p(kXKAR@x>X5Df#8e`T0dDlf#&G6sr_$6*S6_h4rcwv=t2WOf{{! IYPq-=0K#??^8f$< delta 106 zcmbQveu#ZSFk{xnkXK9+smUe^CAkGr)wJfS<>F!h0EQnS%m4rY diff --git a/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear_csm.bin b/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear_csm.bin index 24df604dab684edf72bf5a89f01a498c15dae367..4235cd8b83a223ab2fc126b530b5ff35ad647216 100644 GIT binary patch delta 139 zcmZqTJH<0$1=C#CjjNnlxZ+DvE0Xi`i&6|Hv$E@&Q&k7{>z05ue1y4&z&b`0^%tRX|^AKs5l3s8Y~YFwisAwC1Yi;$i>* D`V3*0 diff --git a/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear_omni.bin b/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear_omni.bin index 032c709c56f044926c733bf671fce0c9cf53ceff..bf2e228f5b05ecddb4495d1a2b853243624b4d49 100644 GIT binary patch delta 335 zcmcb?+rTqnHB$iV#&8)c;;OxmYEDH4n`Nf$fnfZANws3Kf znldC!=17{%f$B6$r|1G`=X_63KK+Ow;R)a2s!oYP=;j;|&dv%r`W^w7?j* z`6fUE^^k(c&;V`&QV3Ro%!Edt`Q-Vm;*)z>**TyB7C-?x7{?MUd!LnE0xAnMuu4H& O!9dRx7%#P4TnqrrC$NG5 diff --git a/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_omni.bin b/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_omni.bin index d83c92aa863b44d7051152a1c0fbcc28d7bb76b5..0970d2fae5f2799aa1ae96c452cc480c4c6d4f4d 100644 GIT binary patch delta 93 zcmeyvb%$%hYQ{Ai*Boc&j4#M9&Me8y&zs!MqA>Xgi#%5uLg+P%8ZuXs6@}~0swRj~ MtZB_v%f-b20NLmwZvX%Q delta 120 zcmcb^^@nT1YQ{4g*Bob-NKH0TD9J4-ODu{vv*uEOvnSWEC7_yTMawOm{b0PBSxH2?qr diff --git a/examples/runtime/shaders/glsl/vs_shadowmaps_packdepth_linear.bin b/examples/runtime/shaders/glsl/vs_shadowmaps_packdepth_linear.bin index 54b236d5065ef5536d006b2f7cef34d1ba87c868..364806d8795557bb0df5488e44e3732e54c647f4 100644 GIT binary patch delta 55 zcmX@kw1{bf0@GiHiAqbk({thj@{2P|GV}8$K2R1fi%&@{D9KQ;RnX8tlA3JDC7_>|Owk_@1zh6YTxUX_BDf`Oi?rh+z@vgWGg;$i>*(f}b$ diff --git a/examples/runtime/shaders/glsl/vs_sms_shadow_pd.bin b/examples/runtime/shaders/glsl/vs_sms_shadow_pd.bin index 6f88405f42f76f64f1498c76fafcc678289bd32d..fa560bbcc50694acae68fefff173fd1c460eefbf 100644 GIT binary patch delta 58 zcmdnRG?i(B0@DYEiAu}4({thj@{2P|GV}8$K2nw|i!Xrk6l@ic7_yTMawOm{b0PBSxH2?qr diff --git a/examples/runtime/shaders/glsl/vs_tree.bin b/examples/runtime/shaders/glsl/vs_tree.bin index b8d2d8cf281eb95a1b66d01980a029aadb36e5d0..f72bb603e292c12d4c65a83518e4d970a5dc13b2 100644 GIT binary patch delta 124 zcmaFMdYW~D5#yAN#ukj+={fNM`Nf$fnfZB>TNstq%Hj+1ixq4YG>|0pDk`fK^c9dq zCO>2po?OnzJDHJ5n9*pmD3b}BktRsl^CVMh* JPd?8i2LMDqC=37q delta 184 zcmX@j`j&Nq5#zRv#uki{WvR&~3MIJ(Wr;=cM%G*kaQ5UfMrGUdocMtJ;>?oF{5%C) zxD-fPS$si$F;GkcrdO|`vPwZ8u12q1bFwaz5~Jbd04CANzZiARjWt0^z