├── .gitattributes ├── .gitignore ├── .npmignore ├── .travis.yml ├── CMakeLists.txt ├── Changelog.md ├── README.md ├── autogen.sh ├── binding.gyp ├── contrib ├── glslopt │ ├── Main.cpp │ ├── Makefile │ ├── Readme │ ├── SourceFiles │ ├── glslopt.bdgcfg │ ├── glslopt.sln │ └── glslopt.vcproj └── staticlib │ └── Build │ └── Tool │ ├── SourceFiles │ ├── glsloptlib.bdgcfg │ └── glsloptlib.vcproj ├── generateParsers.sh ├── include ├── c99 │ ├── inttypes.h │ ├── stdbool.h │ └── stdint.h └── c99_compat.h ├── license.txt ├── package.json ├── projects ├── vs2010 │ ├── glsl_optimizer.sln │ ├── glsl_optimizer_lib.vcxproj │ ├── glsl_optimizer_lib.vcxproj.filters │ └── glsl_optimizer_tests.vcxproj └── xcode5 │ ├── glsl_optimizer_lib.xcodeproj │ └── project.pbxproj │ └── glsl_optimizer_tests.xcodeproj │ └── project.pbxproj ├── removeDeletedByUs.sh ├── src ├── getopt │ ├── SConscript │ ├── getopt.h │ └── getopt_long.c ├── glsl │ ├── .gitignore │ ├── .npmignore │ ├── Makefile │ ├── README │ ├── SConscript │ ├── TODO │ ├── ast.h │ ├── ast_array_index.cpp │ ├── ast_expr.cpp │ ├── ast_function.cpp │ ├── ast_to_hir.cpp │ ├── ast_type.cpp │ ├── builtin_functions.cpp │ ├── builtin_type_macros.h │ ├── builtin_types.cpp │ ├── builtin_variables.cpp │ ├── glcpp │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── README │ │ ├── glcpp-lex.c │ │ ├── glcpp-lex.l │ │ ├── glcpp-parse.c │ │ ├── glcpp-parse.h │ │ ├── glcpp-parse.y │ │ ├── glcpp.h │ │ └── pp.c │ ├── glsl_lexer.cpp │ ├── glsl_lexer.ll │ ├── glsl_optimizer.cpp │ ├── glsl_optimizer.h │ ├── glsl_parser.cpp │ ├── glsl_parser.h │ ├── glsl_parser.yy │ ├── glsl_parser_extras.cpp │ ├── glsl_parser_extras.h │ ├── glsl_symbol_table.cpp │ ├── glsl_symbol_table.h │ ├── glsl_types.cpp │ ├── glsl_types.h │ ├── hir_field_selection.cpp │ ├── ir.cpp │ ├── ir.h │ ├── ir_basic_block.cpp │ ├── ir_basic_block.h │ ├── ir_builder.cpp │ ├── ir_builder.h │ ├── ir_clone.cpp │ ├── ir_constant_expression.cpp │ ├── ir_equals.cpp │ ├── ir_expression_flattening.cpp │ ├── ir_expression_flattening.h │ ├── ir_function.cpp │ ├── ir_function_can_inline.cpp │ ├── ir_function_detect_recursion.cpp │ ├── ir_function_inlining.h │ ├── ir_hierarchical_visitor.cpp │ ├── ir_hierarchical_visitor.h │ ├── ir_hv_accept.cpp │ ├── ir_import_prototypes.cpp │ ├── ir_optimization.h │ ├── ir_print_glsl_visitor.cpp │ ├── ir_print_glsl_visitor.h │ ├── ir_print_metal_visitor.cpp │ ├── ir_print_metal_visitor.h │ ├── ir_print_visitor.cpp │ ├── ir_print_visitor.h │ ├── ir_rvalue_visitor.cpp │ ├── ir_rvalue_visitor.h │ ├── ir_stats.cpp │ ├── ir_stats.h │ ├── ir_uniform.h │ ├── ir_unused_structs.cpp │ ├── ir_unused_structs.h │ ├── ir_validate.cpp │ ├── ir_variable_refcount.cpp │ ├── ir_variable_refcount.h │ ├── ir_visitor.h │ ├── link_atomics.cpp │ ├── link_functions.cpp │ ├── link_interface_blocks.cpp │ ├── link_uniform_block_active_visitor.cpp │ ├── link_uniform_block_active_visitor.h │ ├── link_uniform_blocks.cpp │ ├── link_uniform_initializers.cpp │ ├── link_uniforms.cpp │ ├── link_varyings.cpp │ ├── link_varyings.h │ ├── linker.cpp │ ├── linker.h │ ├── list.h │ ├── loop_analysis.cpp │ ├── loop_analysis.h │ ├── loop_controls.cpp │ ├── loop_unroll.cpp │ ├── lower_clip_distance.cpp │ ├── lower_discard.cpp │ ├── lower_discard_flow.cpp │ ├── lower_if_to_cond_assign.cpp │ ├── lower_instructions.cpp │ ├── lower_jumps.cpp │ ├── lower_mat_op_to_vec.cpp │ ├── lower_named_interface_blocks.cpp │ ├── lower_noise.cpp │ ├── lower_offset_array.cpp │ ├── lower_output_reads.cpp │ ├── lower_packed_varyings.cpp │ ├── lower_packing_builtins.cpp │ ├── lower_ubo_reference.cpp │ ├── lower_variable_index_to_cond_assign.cpp │ ├── lower_vec_index_to_cond_assign.cpp │ ├── lower_vec_index_to_swizzle.cpp │ ├── lower_vector.cpp │ ├── lower_vector_insert.cpp │ ├── lower_vertex_id.cpp │ ├── 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_variables.cpp │ ├── opt_dead_builtin_varyings.cpp │ ├── opt_dead_code.cpp │ ├── opt_dead_code_local.cpp │ ├── opt_dead_functions.cpp │ ├── opt_flatten_nested_if_blocks.cpp │ ├── opt_flip_matrices.cpp │ ├── opt_function_inlining.cpp │ ├── opt_if_simplification.cpp │ ├── opt_minmax.cpp │ ├── opt_noop_swizzle.cpp │ ├── opt_rebalance_tree.cpp │ ├── opt_redundant_jumps.cpp │ ├── opt_structure_splitting.cpp │ ├── opt_swizzle_swizzle.cpp │ ├── opt_tree_grafting.cpp │ ├── opt_vectorize.cpp │ ├── program.h │ ├── s_expression.cpp │ ├── s_expression.h │ ├── standalone_scaffolding.cpp │ ├── standalone_scaffolding.h │ ├── strtod.c │ └── strtod.h ├── glsl_optimizer_lib.gyp ├── mesa │ ├── main │ │ ├── .gitignore │ │ ├── compiler.h │ │ ├── config.h │ │ ├── context.h │ │ ├── core.h │ │ ├── dd.h │ │ ├── errors.h │ │ ├── glheader.h │ │ ├── glminimal.h │ │ ├── imports.c │ │ ├── imports.h │ │ ├── macros.h │ │ ├── mtypes.h │ │ └── simple_list.h │ └── program │ │ ├── .gitignore │ │ ├── hash_table.h │ │ ├── prog_hash_table.c │ │ ├── prog_instruction.h │ │ ├── prog_parameter.h │ │ ├── prog_statevars.h │ │ ├── symbol_table.c │ │ └── symbol_table.h ├── node │ ├── binding.cpp │ ├── compiler.cpp │ ├── compiler.h │ ├── shader.cpp │ └── shader.h └── util │ ├── .gitignore │ ├── Makefile.sources │ ├── SConscript │ ├── hash_table.c │ ├── hash_table.h │ ├── macros.h │ ├── ralloc.c │ └── ralloc.h ├── target_defaults.gypi └── tests ├── fragment ├── array-const-in.txt ├── array-const-inES.txt ├── array-const-inES3.txt ├── array-const-out.txt ├── array-const-outES.txt ├── array-const-outES3.txt ├── array-const-outES3Metal.txt ├── array-constconst-in.txt ├── array-constconst-inES.txt ├── array-constconst-inES3.txt ├── array-constconst-out.txt ├── array-constconst-outES.txt ├── array-constconst-outES3.txt ├── array-constconst-outES3Metal.txt ├── ast-in.txt ├── ast-inES3.txt ├── ast-out.txt ├── ast-outES3.txt ├── ast-outES3Metal.txt ├── basic-in.txt ├── basic-inES.txt ├── basic-out.txt ├── basic-outES.txt ├── bug-bad-framebufferfetch-metal-translation-inES3.txt ├── bug-bad-framebufferfetch-metal-translation-outES3.txt ├── bug-bad-framebufferfetch-metal-translation-outES3Metal.txt ├── bug-const-variable-in.txt ├── bug-const-variable-out.txt ├── bug-global-init-in.txt ├── bug-global-init-out.txt ├── bug-inline-names-in.txt ├── bug-inline-names-out.txt ├── bug-loop-null-from-in.txt ├── bug-loop-null-from-out.txt ├── bug-loop-share-index-in.txt ├── bug-loop-share-index-out.txt ├── bug-loop-undeclaredinductor-inES3.txt ├── bug-loop-undeclaredinductor-outES3.txt ├── bug-loop-undeclaredinductor-outES3Metal.txt ├── bug-op-parens-in.txt ├── bug-op-parens-out.txt ├── bug-sampler-highp-inES3.txt ├── bug-sampler-highp-outES3.txt ├── bug-sampler-highp-outES3Metal.txt ├── bug-sampler-highpfull-inES3.txt ├── bug-sampler-highpfull-outES3.txt ├── bug-sampler-highpfull-outES3Metal.txt ├── bug-vectorize-tex-in.txt ├── bug-vectorize-tex-out.txt ├── builtin-vars-inES3.txt ├── builtin-vars-outES3.txt ├── builtin-vars-outES3Metal.txt ├── const-precision-inES3.txt ├── const-precision-outES3.txt ├── const-precision-outES3Metal.txt ├── derivatives-in.txt ├── derivatives-inES.txt ├── derivatives-out.txt ├── derivatives-outES.txt ├── estest1-in.txt ├── estest1-out.txt ├── float-literals-in.txt ├── float-literals-out.txt ├── fragdepth-in.txt ├── fragdepth-inES.txt ├── fragdepth-inES3.txt ├── fragdepth-out.txt ├── fragdepth-outES.txt ├── fragdepth-outES3.txt ├── fragdepth-outES3Metal.txt ├── framebuffer_fetch-inES.txt ├── framebuffer_fetch-inES3.txt ├── framebuffer_fetch-outES.txt ├── framebuffer_fetch-outES3.txt ├── framebuffer_fetch-outES3Metal.txt ├── global-struct-constant-init-metal-inES3.txt ├── global-struct-constant-init-metal-outES3.txt ├── global-struct-constant-init-metal-outES3Metal.txt ├── glsl120-basic-in.txt ├── glsl120-basic-inES3.txt ├── glsl120-basic-out.txt ├── glsl120-basic-outES3.txt ├── glsl120-basic-outES3Metal.txt ├── glsl140-basic-in.txt ├── glsl140-basic-out.txt ├── in-struct-ret-vals-in.txt ├── in-struct-ret-vals-inES.txt ├── in-struct-ret-vals-out.txt ├── in-struct-ret-vals-outES.txt ├── in-vals-ret-vals-inES.txt ├── in-vals-ret-vals-outES.txt ├── intrinsics-in.txt ├── intrinsics-inES.txt ├── intrinsics-inES3.txt ├── intrinsics-out.txt ├── intrinsics-outES.txt ├── intrinsics-outES3.txt ├── intrinsics-outES3Metal.txt ├── loop-for-inES.txt ├── loop-for-inES3.txt ├── loop-for-outES.txt ├── loop-for-outES3.txt ├── loop-for-outES3Metal.txt ├── loop-forafterdiscard-inES.txt ├── loop-forafterdiscard-inES3.txt ├── loop-forafterdiscard-outES.txt ├── loop-forafterdiscard-outES3.txt ├── loop-forafterdiscard-outES3Metal.txt ├── loop-foraliasinductor-inES.txt ├── loop-foraliasinductor-outES.txt ├── loop-forarounddiscard-inES.txt ├── loop-forarounddiscard-outES.txt ├── loop-fornounroll-inES.txt ├── loop-fornounroll-outES.txt ├── loop-forunbounded-inES.txt ├── loop-forunbounded-outES.txt ├── loop-forvariants-in.txt ├── loop-forvariants-out.txt ├── loop-forwronginductor-inES.txt ├── loop-forwronginductor-outES.txt ├── matrix-cast-types-inES3.txt ├── matrix-cast-types-outES3.txt ├── matrix-cast-types-outES3Metal.txt ├── matrix-ops-inES3.txt ├── matrix-ops-outES3.txt ├── matrix-ops-outES3Metal.txt ├── mrt-in.txt ├── mrt-inES.txt ├── mrt-inES3.txt ├── mrt-mixed-array-inES3.txt ├── mrt-mixed-array-outES3.txt ├── mrt-mixed-array-outES3Metal.txt ├── mrt-out.txt ├── mrt-outES.txt ├── mrt-outES3.txt ├── mrt-outES3Metal.txt ├── mrt-unused-inES3.txt ├── mrt-unused-outES3.txt ├── mrt-unused-outES3Metal.txt ├── nested-inlining-in.txt ├── nested-inlining-out.txt ├── opt-copyprop-struct-in.txt ├── opt-copyprop-struct-out.txt ├── opt-copypropelems-swizzle-in.txt ├── opt-copypropelems-swizzle-out.txt ├── opt-dead-texloads-in.txt ├── opt-dead-texloads-out.txt ├── opt-dead-texloadstreeshadow-inES3.txt ├── opt-dead-texloadstreeshadow-outES3.txt ├── opt-dead-texloadstreeshadow-outES3Metal.txt ├── opt-deadcode-in.txt ├── opt-deadcode-out.txt ├── opt-deadcodestruct-in.txt ├── opt-deadcodestruct-out.txt ├── opt-grafting-precision-inES.txt ├── opt-grafting-precision-inES3.txt ├── opt-grafting-precision-outES.txt ├── opt-grafting-precision-outES3.txt ├── opt-grafting-precision-outES3Metal.txt ├── opt-ifs-in.txt ├── opt-ifs-out.txt ├── opt-inline-inoutstruct-in.txt ├── opt-inline-inoutstruct-out.txt ├── opt-movevars-sideeffect-inES.txt ├── opt-movevars-sideeffect-outES.txt ├── opt-movevars-sideeffect2-inES.txt ├── opt-movevars-sideeffect2-outES.txt ├── opt-movevars-simple-inES.txt ├── opt-movevars-simple-outES.txt ├── opt-vec-var-index-in.txt ├── opt-vec-var-index-out.txt ├── opt-vectorize-ifs-in.txt ├── opt-vectorize-ifs-out.txt ├── opt-vectorize-retval-in.txt ├── opt-vectorize-retval-out.txt ├── opt-vectorize-types-in.txt ├── opt-vectorize-types-out.txt ├── pp-basic-in.txt ├── pp-basic-out.txt ├── prec-default-inES.txt ├── prec-default-outES.txt ├── prec-expressions-inES3.txt ├── prec-expressions-outES3.txt ├── prec-expressions-outES3Metal.txt ├── prec-inlineexpr1-inES.txt ├── prec-inlineexpr1-outES.txt ├── prec-inlineexpr2-inES.txt ├── prec-inlineexpr2-outES.txt ├── prec-matrix-constr-inES3.txt ├── prec-matrix-constr-outES3.txt ├── prec-matrix-constr-outES3Metal.txt ├── prec-temps-inES.txt ├── prec-temps-outES.txt ├── prec-tempssimple-inES.txt ├── prec-tempssimple-outES.txt ├── prec-treegrafting-inES.txt ├── prec-treegrafting-outES.txt ├── qualifiers-layout-inES3.txt ├── qualifiers-layout-outES3.txt ├── qualifiers-layout-outES3Metal.txt ├── sampler-precision-inES.txt ├── sampler-precision-inES3.txt ├── sampler-precision-outES.txt ├── sampler-precision-outES3.txt ├── sampler-precision-outES3Metal.txt ├── small-float-in.txt ├── small-float-out.txt ├── struct-array-var-index-in.txt ├── struct-array-var-index-out.txt ├── struct-initializer-in.txt ├── struct-initializer-out.txt ├── struct-unused-in.txt ├── struct-unused-out.txt ├── swizzle-writemask-in.txt ├── swizzle-writemask-out.txt ├── syntax-inES.txt ├── syntax-outES.txt ├── ternary-in.txt ├── ternary-inES.txt ├── ternary-inES3.txt ├── ternary-out.txt ├── ternary-outES.txt ├── ternary-outES3.txt ├── ternary-outES3Metal.txt ├── ternary-vec4-in.txt ├── ternary-vec4-inES.txt ├── ternary-vec4-inES3.txt ├── ternary-vec4-out.txt ├── ternary-vec4-outES.txt ├── ternary-vec4-outES3.txt ├── ternary-vec4-outES3Metal.txt ├── tex2DArray-in.txt ├── tex2DArray-inES3.txt ├── tex2DArray-out.txt ├── tex2DArray-outES3.txt ├── tex2DArray-outES3Metal.txt ├── tex2dgrad-in.txt ├── tex2dgrad-inES.txt ├── tex2dgrad-inES3.txt ├── tex2dgrad-out.txt ├── tex2dgrad-outES.txt ├── tex2dgrad-outES3.txt ├── tex2dgrad-outES3Metal.txt ├── tex2dlod-in.txt ├── tex2dlod-inES.txt ├── tex2dlod-inES3.txt ├── tex2dlod-out.txt ├── tex2dlod-outES.txt ├── tex2dlod-outES3.txt ├── tex2dlod-outES3Metal.txt ├── tex2dshadow-in.txt ├── tex2dshadow-inES.txt ├── tex2dshadow-inES3.txt ├── tex2dshadow-out.txt ├── tex2dshadow-outES.txt ├── tex2dshadow-outES3.txt ├── tex2dshadow-outES3Metal.txt ├── tex3D-in.txt ├── tex3D-inES3.txt ├── tex3D-inES__.txt ├── tex3D-out.txt ├── tex3D-outES3.txt ├── tex3D-outES3Metal.txt ├── texCubeShadow-inES3.txt ├── texCubeShadow-outES3.txt ├── texCubeShadow-outES3Metal.txt ├── texOffset-inES3.txt ├── texOffset-outES3.txt ├── texOffset-outES3Metal.txt ├── texProj-inES.txt ├── texProj-inES3.txt ├── texProj-outES.txt ├── texProj-outES3.txt ├── texProj-outES3Metal.txt ├── texSize-inES3.txt ├── texSize-outES3.txt ├── texSize-outES3Metal.txt ├── texelFetchMSAA-in.txt ├── texelFetchMSAA-out.txt ├── types-writemask-in.txt ├── types-writemask-out.txt ├── variables-initialization-inES3.txt ├── variables-initialization-outES3.txt ├── variables-initialization-outES3Metal.txt ├── varyings-in.txt ├── varyings-inES.txt ├── varyings-out.txt ├── varyings-outES.txt ├── vface-in.txt ├── vface-inES.txt ├── vface-out.txt ├── vface-outES.txt ├── vpos-in.txt ├── vpos-inES.txt ├── vpos-out.txt ├── vpos-outES.txt ├── z-DirLMBasis-inES3.txt ├── z-DirLMBasis-outES3.txt ├── z-DirLMBasis-outES3Metal.txt ├── z-LightShaftsCoord-inES3.txt ├── z-LightShaftsCoord-outES3.txt ├── z-LightShaftsCoord-outES3Metal.txt ├── z-alphabumpspec-in.txt ├── z-alphabumpspec-inES3.txt ├── z-alphabumpspec-out.txt ├── z-alphabumpspec-outES3.txt ├── z-alphabumpspec-outES3Metal.txt ├── z-collectshadows-in.txt ├── z-collectshadows-inES.txt ├── z-collectshadows-inES3.txt ├── z-collectshadows-out.txt ├── z-collectshadows-outES.txt ├── z-collectshadows-outES3.txt ├── z-collectshadows-outES3Metal.txt ├── z-flare-in.txt ├── z-flare-inES.txt ├── z-flare-out.txt ├── z-flare-outES.txt ├── z-fxaa-preset1-in.txt ├── z-fxaa-preset1-out.txt ├── z-fxaa-preset3-in.txt ├── z-fxaa-preset3-inES3.txt ├── z-fxaa-preset3-out.txt ├── z-fxaa-preset3-outES3.txt ├── z-fxaa-preset3-outES3Metal.txt ├── z-fxaa3-11-consolepc-in.txt ├── z-fxaa3-11-consolepc-inES.txt ├── z-fxaa3-11-consolepc-out.txt ├── z-fxaa3-11-consolepc-outES.txt ├── z-fxaa3-11-pc39-in.txt ├── z-fxaa3-11-pc39-inES.txt ├── z-fxaa3-11-pc39-out.txt ├── z-fxaa3-11-pc39-outES.txt ├── z-particle-in.txt ├── z-particle-inES.txt ├── z-particle-out.txt ├── z-particle-outES.txt ├── z-prepasslight-in.txt ├── z-prepasslight-inES.txt ├── z-prepasslight-inES3.txt ├── z-prepasslight-out.txt ├── z-prepasslight-outES.txt ├── z-prepasslight-outES3.txt ├── z-prepasslight-outES3Metal.txt ├── z-tonemap-usercurve-inES3.txt ├── z-tonemap-usercurve-outES3.txt ├── z-tonemap-usercurve-outES3Metal.txt ├── z-treeleaf-in.txt ├── z-treeleaf-inES.txt ├── z-treeleaf-out.txt ├── z-treeleaf-outES.txt ├── z-treeleafloop-inES.txt ├── z-treeleafloop-inES3.txt ├── z-treeleafloop-outES.txt ├── z-treeleafloop-outES3.txt ├── z-treeleafloop-outES3Metal.txt ├── z-unishader-dirlm-in.txt ├── z-unishader-dirlm-inES3.txt ├── z-unishader-dirlm-out.txt ├── z-unishader-dirlm-outES3.txt ├── z-unishader-dirlm-outES3Metal.txt ├── z-unity-spot-inES3.txt ├── z-unity-spot-outES3.txt ├── z-unity-spot-outES3Metal.txt ├── zun-Bumped_Diffuse-in.txt ├── zun-Bumped_Diffuse-out.txt ├── zun-Bumped_Diffuse1-in.txt ├── zun-Bumped_Diffuse1-out.txt ├── zun-Bumped_Specular-in.txt ├── zun-Bumped_Specular-out.txt ├── zun-Bumped_Specular1-in.txt ├── zun-Bumped_Specular1-out.txt ├── zun-Bumped_Specular2-in.txt ├── zun-Bumped_Specular2-out.txt ├── zun-Decal-in.txt ├── zun-Decal-out.txt ├── zun-Decal1-in.txt ├── zun-Decal1-out.txt ├── zun-Decal2-in.txt ├── zun-Decal2-out.txt ├── zun-Diffuse-in.txt ├── zun-Diffuse-out.txt ├── zun-Diffuse1-in.txt ├── zun-Diffuse1-out.txt ├── zun-Diffuse2-in.txt ├── zun-Diffuse2-out.txt ├── zun-Diffuse_Alpha_Shadowed_ZWrite-in.txt ├── zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt ├── zun-Diffuse_Detail-in.txt ├── zun-Diffuse_Detail-out.txt ├── zun-Diffuse_Detail1-in.txt ├── zun-Diffuse_Detail1-out.txt ├── zun-FX_Glass_Stained_BumpDistort-in.txt ├── zun-FX_Glass_Stained_BumpDistort-out.txt ├── zun-FX_Water_(simple)-in.txt ├── zun-FX_Water_(simple)-out.txt ├── zun-Grab_Invert-in.txt ├── zun-Grab_Invert-out.txt ├── zun-Hidden_Camera-DepthNormalTexture-in.txt ├── zun-Hidden_Camera-DepthNormalTexture-out.txt ├── zun-Hidden_Camera-DepthNormalTexture1-in.txt ├── zun-Hidden_Camera-DepthNormalTexture1-out.txt ├── zun-Hidden_Camera-DepthTexture-in.txt ├── zun-Hidden_Camera-DepthTexture-out.txt ├── zun-Hidden_Color_Correction_Effect-in.txt ├── zun-Hidden_Color_Correction_Effect-out.txt ├── zun-Hidden_Edge_Detect_X-in.txt ├── zun-Hidden_Edge_Detect_X-out.txt ├── zun-Hidden_GlowConeTap-in.txt ├── zun-Hidden_GlowConeTap-out.txt ├── zun-Hidden_Glow_Downsample-in.txt ├── zun-Hidden_Glow_Downsample-out.txt ├── zun-Hidden_Grayscale_Effect-in.txt ├── zun-Hidden_Grayscale_Effect-out.txt ├── zun-Hidden_Internal-CombineDepthNormals-in.txt ├── zun-Hidden_Internal-CombineDepthNormals-out.txt ├── zun-Hidden_Internal-GUITextureBlit-in.txt ├── zun-Hidden_Internal-GUITextureBlit-out.txt ├── zun-Hidden_Internal-GUITextureClip-in.txt ├── zun-Hidden_Internal-GUITextureClip-out.txt ├── zun-Hidden_Internal-Halo-in.txt ├── zun-Hidden_Internal-Halo-out.txt ├── zun-Hidden_Internal-PrePassCollectShadows-in.txt ├── zun-Hidden_Internal-PrePassCollectShadows-out.txt ├── zun-Hidden_Internal-PrePassLighting-in.txt ├── zun-Hidden_Internal-PrePassLighting-out.txt ├── zun-Hidden_Noise_Shader_RGB-in.txt ├── zun-Hidden_Noise_Shader_RGB-out.txt ├── zun-Hidden_Noise_Shader_YUV-in.txt ├── zun-Hidden_Noise_Shader_YUV-out.txt ├── zun-Hidden_Sepiatone_Effect-in.txt ├── zun-Hidden_Sepiatone_Effect-out.txt ├── zun-Hidden_Shadow-ScreenBlur-in.txt ├── zun-Hidden_Shadow-ScreenBlur-out.txt ├── zun-Hidden_ShowDepthNTexture-in.txt ├── zun-Hidden_ShowDepthNTexture-out.txt ├── zun-Hidden_ShowDepthTexture-in.txt ├── zun-Hidden_ShowDepthTexture-out.txt ├── zun-Hidden_TerrainEngine_BillboardTree-in.txt ├── zun-Hidden_TerrainEngine_BillboardTree-out.txt ├── zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-in.txt ├── zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt ├── zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-in.txt ├── zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt ├── zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-in.txt ├── zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt ├── zun-Hidden_TerrainEngine_Details_Vertexlit-in.txt ├── zun-Hidden_TerrainEngine_Details_Vertexlit-out.txt ├── zun-Hidden_TerrainEngine_Details_Vertexlit1-in.txt ├── zun-Hidden_TerrainEngine_Details_Vertexlit1-out.txt ├── zun-Hidden_TerrainEngine_Details_WavingDoublePass-in.txt ├── zun-Hidden_TerrainEngine_Details_WavingDoublePass-out.txt ├── zun-Hidden_TerrainEngine_Details_WavingDoublePass1-in.txt ├── zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt ├── zun-Hidden_TerrainEngine_Details_WavingDoublePass2-in.txt ├── zun-Hidden_TerrainEngine_Details_WavingDoublePass2-out.txt ├── zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-in.txt ├── zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-out.txt ├── zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-in.txt ├── zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt ├── zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-in.txt ├── zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt ├── zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-in.txt ├── zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt ├── zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-in.txt ├── zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-out.txt ├── zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-in.txt ├── zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-out.txt ├── zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-in.txt ├── zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt ├── zun-Hidden_Tree_Bark_Shader_Rendertex-in.txt ├── zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt ├── zun-Hidden_Tree_Leaf_Shader_Rendertex-in.txt ├── zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt ├── zun-Hidden_Tree_Optimized_Bark_Shader-in.txt ├── zun-Hidden_Tree_Optimized_Bark_Shader-out.txt ├── zun-Hidden_Tree_Optimized_Bark_Shader1-in.txt ├── zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt ├── zun-Hidden_Tree_Optimized_Leaf_Shader-in.txt ├── zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt ├── zun-Hidden_Tree_Optimized_Leaf_Shader1-in.txt ├── zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt ├── zun-Hidden_Twirt_Effect_Shader-in.txt ├── zun-Hidden_Twirt_Effect_Shader-out.txt ├── zun-Hidden_Twist_Effect-in.txt ├── zun-Hidden_Twist_Effect-out.txt ├── zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-in.txt ├── zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt ├── zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-in.txt ├── zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-out.txt ├── zun-Legacy_Shaders_Lightmapped_Diffuse-in.txt ├── zun-Legacy_Shaders_Lightmapped_Diffuse-out.txt ├── zun-MobileBumpSpec-inES.txt ├── zun-MobileBumpSpec-inES3.txt ├── zun-MobileBumpSpec-outES.txt ├── zun-MobileBumpSpec-outES3.txt ├── zun-MobileBumpSpec-outES3Metal.txt ├── zun-Nature_My_Soft_Occlusion_Leaves-in.txt ├── zun-Nature_My_Soft_Occlusion_Leaves-out.txt ├── zun-Nature_Soft_Occlusion_Bark-in.txt ├── zun-Nature_Soft_Occlusion_Bark-out.txt ├── zun-Nature_Soft_Occlusion_Bark1-in.txt ├── zun-Nature_Soft_Occlusion_Bark1-out.txt ├── zun-Nature_Soft_Occlusion_Bark2-in.txt ├── zun-Nature_Soft_Occlusion_Bark2-out.txt ├── zun-Nature_Soft_Occlusion_Bark3-in.txt ├── zun-Nature_Soft_Occlusion_Bark3-out.txt ├── zun-Nature_Soft_Occlusion_Leaves-in.txt ├── zun-Nature_Soft_Occlusion_Leaves-out.txt ├── zun-Nature_Soft_Occlusion_Leaves1-in.txt ├── zun-Nature_Soft_Occlusion_Leaves1-out.txt ├── zun-Nature_Soft_Occlusion_Leaves2-in.txt ├── zun-Nature_Soft_Occlusion_Leaves2-out.txt ├── zun-Nature_Soft_Occlusion_Leaves3-in.txt ├── zun-Nature_Soft_Occlusion_Leaves3-out.txt ├── zun-Nature_Vegetation_Two_Pass_unlit-in.txt ├── zun-Nature_Vegetation_Two_Pass_unlit-out.txt ├── zun-Parallax_Diffuse-in.txt ├── zun-Parallax_Diffuse-out.txt ├── zun-Parallax_Diffuse1-in.txt ├── zun-Parallax_Diffuse1-out.txt ├── zun-Parallax_Diffuse2-in.txt ├── zun-Parallax_Diffuse2-out.txt ├── zun-Parallax_Specular-in.txt ├── zun-Parallax_Specular-out.txt ├── zun-Particles_Additive-in.txt ├── zun-Particles_Additive-out.txt ├── zun-Particles_Additive_(Soft)-in.txt ├── zun-Particles_Additive_(Soft)-out.txt ├── zun-Particles_Alpha_Blended_Premultiply-in.txt ├── zun-Particles_Alpha_Blended_Premultiply-out.txt ├── zun-Particles_Multiply-in.txt ├── zun-Particles_Multiply-out.txt ├── zun-Particles_Multiply_(Double)-in.txt ├── zun-Particles_Multiply_(Double)-out.txt ├── zun-Particles__Additive-Multiply-in.txt ├── zun-Particles__Additive-Multiply-out.txt ├── zun-Reflective_Bumped_Diffuse-in.txt ├── zun-Reflective_Bumped_Diffuse-out.txt ├── zun-Reflective_Bumped_Diffuse1-in.txt ├── zun-Reflective_Bumped_Diffuse1-out.txt ├── zun-Reflective_Bumped_Specular-in.txt ├── zun-Reflective_Bumped_Specular-out.txt ├── zun-Reflective_Bumped_Specular1-in.txt ├── zun-Reflective_Bumped_Specular1-out.txt ├── zun-Reflective_Bumped_Specular2-in.txt ├── zun-Reflective_Bumped_Specular2-out.txt ├── zun-Reflective_Bumped_Unlit-in.txt ├── zun-Reflective_Bumped_Unlit-out.txt ├── zun-Reflective_Diffuse-in.txt ├── zun-Reflective_Diffuse-out.txt ├── zun-Reflective_Diffuse1-in.txt ├── zun-Reflective_Diffuse1-out.txt ├── zun-Reflective_Parallax_Diffuse-in.txt ├── zun-Reflective_Parallax_Diffuse-out.txt ├── zun-Reflective_Parallax_Diffuse1-in.txt ├── zun-Reflective_Parallax_Diffuse1-out.txt ├── zun-Reflective_Parallax_Specular-in.txt ├── zun-Reflective_Parallax_Specular-out.txt ├── zun-Reflective_Parallax_Specular1-in.txt ├── zun-Reflective_Parallax_Specular1-out.txt ├── zun-Reflective_Specular-in.txt ├── zun-Reflective_Specular-out.txt ├── zun-Reflective_Specular1-in.txt ├── zun-Reflective_Specular1-out.txt ├── zun-Reflective_Specular2-in.txt ├── zun-Reflective_Specular2-out.txt ├── zun-RenderFX_Skybox-in.txt ├── zun-RenderFX_Skybox-out.txt ├── zun-RenderFX_Skybox_Cubed-in.txt ├── zun-RenderFX_Skybox_Cubed-out.txt ├── zun-SSAO24-in.txt ├── zun-SSAO24-inES3.txt ├── zun-SSAO24-out.txt ├── zun-SSAO24-outES3.txt ├── zun-SSAO24-outES3Metal.txt ├── zun-SSAO8-inES.txt ├── zun-SSAO8-outES.txt ├── zun-Self-Illumin_Bumped_Diffuse-in.txt ├── zun-Self-Illumin_Bumped_Diffuse-out.txt ├── zun-Self-Illumin_Bumped_Diffuse1-in.txt ├── zun-Self-Illumin_Bumped_Diffuse1-out.txt ├── zun-Self-Illumin_Bumped_Diffuse2-in.txt ├── zun-Self-Illumin_Bumped_Diffuse2-out.txt ├── zun-Self-Illumin_Bumped_Specular-in.txt ├── zun-Self-Illumin_Bumped_Specular-out.txt ├── zun-Self-Illumin_Bumped_Specular1-in.txt ├── zun-Self-Illumin_Bumped_Specular1-out.txt ├── zun-Self-Illumin_Diffuse-in.txt ├── zun-Self-Illumin_Diffuse-out.txt ├── zun-Self-Illumin_Diffuse1-in.txt ├── zun-Self-Illumin_Diffuse1-out.txt ├── zun-Self-Illumin_Parallax_Diffuse-in.txt ├── zun-Self-Illumin_Parallax_Diffuse-out.txt ├── zun-Self-Illumin_Parallax_Diffuse1-in.txt ├── zun-Self-Illumin_Parallax_Diffuse1-out.txt ├── zun-Self-Illumin_Parallax_Diffuse2-in.txt ├── zun-Self-Illumin_Parallax_Diffuse2-out.txt ├── zun-Self-Illumin_Parallax_Specular-in.txt ├── zun-Self-Illumin_Parallax_Specular-out.txt ├── zun-Self-Illumin_Parallax_Specular1-in.txt ├── zun-Self-Illumin_Parallax_Specular1-out.txt ├── zun-Self-Illumin_Specular-in.txt ├── zun-Self-Illumin_Specular-out.txt ├── zun-Self-Illumin_Specular1-in.txt ├── zun-Self-Illumin_Specular1-out.txt ├── zun-Self-Illumin_Specular2-in.txt ├── zun-Self-Illumin_Specular2-out.txt ├── zun-Specular-in.txt ├── zun-Specular-out.txt ├── zun-Specular1-in.txt ├── zun-Specular1-out.txt ├── zun-Specular2-in.txt ├── zun-Specular2-out.txt ├── zun-Surface_2UV-in.txt ├── zun-Surface_2UV-out.txt ├── zun-Surface_2UV1-in.txt ├── zun-Surface_2UV1-out.txt ├── zun-Surface_Colored_Specular-in.txt ├── zun-Surface_Colored_Specular-out.txt ├── zun-Surface_Colored_Specular1-in.txt ├── zun-Surface_Colored_Specular1-out.txt ├── zun-Surface_Custom_Data-in.txt ├── zun-Surface_Custom_Data-out.txt ├── zun-Surface_Custom_Data1-in.txt ├── zun-Surface_Custom_Data1-out.txt ├── zun-Surface_Custom_Data2-in.txt ├── zun-Surface_Custom_Data2-out.txt ├── zun-Surface_DecalAdd-in.txt ├── zun-Surface_DecalAdd-out.txt ├── zun-Surface_DecalAddBump3-in.txt ├── zun-Surface_DecalAddBump3-out.txt ├── zun-Surface_DecalAddBump5-in.txt ├── zun-Surface_DecalAddBump5-out.txt ├── zun-Surface_Diffuse_Wrapped-in.txt ├── zun-Surface_Diffuse_Wrapped-out.txt ├── zun-Surface_Rim-in.txt ├── zun-Surface_Rim-out.txt ├── zun-Surface_Rim1-in.txt ├── zun-Surface_Rim1-out.txt ├── zun-Surface_Rim2-in.txt ├── zun-Surface_Rim2-out.txt ├── zun-Surface_Rim_Bump-in.txt ├── zun-Surface_Rim_Bump-out.txt ├── zun-Surface_Rim_Bump1-in.txt ├── zun-Surface_Rim_Bump1-out.txt ├── zun-Surface_ScreenPos-in.txt ├── zun-Surface_ScreenPos-out.txt ├── zun-Surface_ScreenPos1-in.txt ├── zun-Surface_ScreenPos1-out.txt ├── zun-Surface_ScreenPos2-in.txt ├── zun-Surface_ScreenPos2-out.txt ├── zun-Surface_ScreenPosAlbedo-in.txt ├── zun-Surface_ScreenPosAlbedo-out.txt ├── zun-Surface_ScreenPosAlbedo1-in.txt ├── zun-Surface_ScreenPosAlbedo1-out.txt ├── zun-Surface_Slices-in.txt ├── zun-Surface_Slices-out.txt ├── zun-Surface_Slices1-in.txt ├── zun-Surface_Slices1-out.txt ├── zun-Surface_Slices2-in.txt ├── zun-Surface_Slices2-out.txt ├── zun-Surface_Slices3-in.txt ├── zun-Surface_Slices3-out.txt ├── zun-Surface_WorldRefl-in.txt ├── zun-Surface_WorldRefl-out.txt ├── zun-Surface_WorldRefl1-in.txt ├── zun-Surface_WorldRefl1-out.txt ├── zun-Test_CgNormals-in.txt ├── zun-Test_CgNormals-out.txt ├── zun-Test_FontShaderCull-in.txt ├── zun-Test_FontShaderCull-out.txt ├── zun-Test_VertexShaderDepthTexture-in.txt ├── zun-Test_VertexShaderDepthTexture-out.txt ├── zun-Test_VertexShaderTexture-in.txt ├── zun-Test_VertexShaderTexture-out.txt ├── zun-Tests_Blend_Many_Textures-in.txt ├── zun-Tests_Blend_Many_Textures-out.txt ├── zun-Tests_Fwd-Def-Vert-in.txt ├── zun-Tests_Fwd-Def-Vert-out.txt ├── zun-Tests_Fwd-Def-Vert1-in.txt ├── zun-Tests_Fwd-Def-Vert1-out.txt ├── zun-TexGen_Cube_Refl-in.txt ├── zun-TexGen_Cube_Refl-out.txt ├── zun-Toon_Basic-in.txt ├── zun-Toon_Basic-out.txt ├── zun-Toon_Lighted-in.txt ├── zun-Toon_Lighted-out.txt ├── zun-Transparent_Bumped_Specular-in.txt ├── zun-Transparent_Bumped_Specular-out.txt ├── zun-Transparent_Cutout_Bumped_Diffuse-in.txt ├── zun-Transparent_Cutout_Bumped_Diffuse-out.txt ├── zun-Transparent_Cutout_Bumped_Diffuse1-in.txt ├── zun-Transparent_Cutout_Bumped_Diffuse1-out.txt ├── zun-Transparent_Cutout_Bumped_Specular-in.txt ├── zun-Transparent_Cutout_Bumped_Specular-out.txt ├── zun-Transparent_Cutout_Bumped_Specular1-in.txt ├── zun-Transparent_Cutout_Bumped_Specular1-out.txt ├── zun-Transparent_Cutout_Diffuse-in.txt ├── zun-Transparent_Cutout_Diffuse-out.txt ├── zun-Transparent_Cutout_Specular-in.txt ├── zun-Transparent_Cutout_Specular-out.txt ├── zun-Transparent_Cutout_Specular1-in.txt ├── zun-Transparent_Cutout_Specular1-out.txt ├── zun-Transparent_Cutout_Specular2-in.txt ├── zun-Transparent_Cutout_Specular2-out.txt ├── zun-Transparent_Diffuse-in.txt ├── zun-Transparent_Diffuse-out.txt ├── zun-Transparent_Specular-in.txt ├── zun-Transparent_Specular-out.txt ├── zun-TreeCreatorLeavesRT-in.txt ├── zun-TreeCreatorLeavesRT-out.txt ├── zun-Tree_Editor_Bark_Shader-in.txt ├── zun-Tree_Editor_Bark_Shader-out.txt ├── zun-Tree_Editor_Bark_Shader1-in.txt ├── zun-Tree_Editor_Bark_Shader1-out.txt ├── zun-Tree_Editor_Leaf_Shader-in.txt ├── zun-Tree_Editor_Leaf_Shader-out.txt ├── zun-Tree_Editor_Leaf_Shader1-in.txt ├── zun-Tree_Editor_Leaf_Shader1-out.txt ├── zun-Vertex_Colored-in.txt ├── zun-Vertex_Colored-out.txt ├── zun-currently_adapted-in.txt ├── zun-currently_adapted-out.txt ├── zunity-MotionBlur-TileMax-in.txt └── zunity-MotionBlur-TileMax-out.txt ├── global-mutable-inES.txt ├── global-mutable-inES3.txt ├── global-mutable-outES.txt ├── global-mutable-outES3.txt ├── global-mutable-outES3Metal.txt ├── glsl_optimizer_tests.cpp ├── tests.gyp ├── tests.js └── vertex ├── MF-GodRays-inES.txt ├── MF-GodRays-inES3.txt ├── MF-GodRays-outES.txt ├── MF-GodRays-outES3.txt ├── MF-GodRays-outES3Metal.txt ├── bug-chained-assign-in.txt ├── bug-chained-assign-out.txt ├── bug-loops-for-while-in.txt ├── bug-loops-for-while-out.txt ├── bug-struct-uniform-in.txt ├── bug-struct-uniform-out.txt ├── bug-swizzle-lhs-cast-inES3.txt ├── bug-swizzle-lhs-cast-outES3.txt ├── bug-swizzle-lhs-cast-outES3Metal.txt ├── bug-varying-const-in.txt ├── bug-varying-const-out.txt ├── builtin-vars-in.txt ├── builtin-vars-inES.txt ├── builtin-vars-inES3.txt ├── builtin-vars-out.txt ├── builtin-vars-outES.txt ├── builtin-vars-outES3.txt ├── builtin-vars-outES3Metal.txt ├── estest1-in.txt ├── estest1-out.txt ├── glsl140-basic-in.txt ├── glsl140-basic-out.txt ├── glsl140-integers-in.txt ├── glsl140-integers-out.txt ├── inputs-inES3.txt ├── inputs-outES3.txt ├── inputs-outES3Metal.txt ├── loops-for-in.txt ├── loops-for-out.txt ├── loops-for-withvec4-in.txt ├── loops-for-withvec4-inES3.txt ├── loops-for-withvec4-out.txt ├── loops-for-withvec4-outES3.txt ├── loops-for-withvec4-outES3Metal.txt ├── loops-for-withvec4inductorW-inES3.txt ├── loops-for-withvec4inductorW-outES3.txt ├── loops-for-withvec4inductorW-outES3Metal.txt ├── loops-forlimitbreak-inES.txt ├── loops-forlimitbreak-inES3.txt ├── loops-forlimitbreak-outES.txt ├── loops-forlimitbreak-outES3.txt ├── loops-forlimitbreak-outES3Metal.txt ├── loops-forsimple-in.txt ├── loops-forsimple-out.txt ├── loops-forvarious-inES.txt ├── loops-forvarious-inES3.txt ├── loops-forvarious-outES.txt ├── loops-forvarious-outES3.txt ├── loops-forvarious-outES3Metal.txt ├── loops-forwithcalls-in.txt ├── loops-forwithcalls-out.txt ├── matrix-casts-inES3.txt ├── matrix-casts-outES3.txt ├── matrix-casts-outES3Metal.txt ├── opt-inline-varnames-in.txt ├── opt-inline-varnames-out.txt ├── opt-matrix-constr-in.txt ├── opt-matrix-constr-out.txt ├── opt-matrix-transpose-mul-inES.txt ├── opt-matrix-transpose-mul-inES3.txt ├── opt-matrix-transpose-mul-outES.txt ├── opt-matrix-transpose-mul-outES3.txt ├── opt-matrix-transpose-mul-outES3Metal.txt ├── opt-negsub-in.txt ├── opt-negsub-out.txt ├── opt-normalize-in.txt ├── opt-normalize-out.txt ├── opt-unroll-in.txt ├── opt-unroll-out.txt ├── opt-unusedvars-in.txt ├── opt-unusedvars-out.txt ├── swizzle-casts-inES3.txt ├── swizzle-casts-outES3.txt ├── swizzle-casts-outES3Metal.txt ├── swizzlemask-in.txt ├── swizzlemask-out.txt ├── types-in.txt ├── types-inES.txt ├── types-inES3.txt ├── types-out.txt ├── types-outES.txt ├── types-outES3.txt ├── types-outES3Metal.txt ├── uniforms-arrays-inES3.txt ├── uniforms-arrays-outES3.txt ├── uniforms-arrays-outES3Metal.txt ├── z-NichsHybridLight-in.txt ├── z-NichsHybridLight-out.txt ├── z-NichsHybridLightVectorInsertBug-in.txt ├── z-NichsHybridLightVectorInsertBug-inES.txt ├── z-NichsHybridLightVectorInsertBug-inES3.txt ├── z-NichsHybridLightVectorInsertBug-out.txt ├── z-NichsHybridLightVectorInsertBug-outES.txt ├── z-NichsHybridLightVectorInsertBug-outES3.txt ├── z-NichsHybridLightVectorInsertBug-outES3Metal.txt ├── z-alphabumpspec-in.txt ├── z-alphabumpspec-out.txt ├── z-particle-in.txt ├── z-particle-inES.txt ├── z-particle-out.txt ├── z-particle-outES.txt ├── z-prepasslight-in.txt ├── z-prepasslight-inES.txt ├── z-prepasslight-inES3.txt ├── z-prepasslight-out.txt ├── z-prepasslight-outES.txt ├── z-prepasslight-outES3.txt ├── z-prepasslight-outES3Metal.txt ├── z-treeleaf-in.txt ├── z-treeleaf-inES.txt ├── z-treeleaf-inES3.txt ├── z-treeleaf-out.txt ├── z-treeleaf-outES.txt ├── z-treeleaf-outES3.txt ├── z-treeleaf-outES3Metal.txt ├── z-unishader-dirlm-in.txt ├── z-unishader-dirlm-out.txt ├── zun-Bumped_Diffuse-in.txt ├── zun-Bumped_Diffuse-out.txt ├── zun-Bumped_Diffuse1-in.txt ├── zun-Bumped_Diffuse1-out.txt ├── zun-Bumped_Specular-in.txt ├── zun-Bumped_Specular-out.txt ├── zun-Bumped_Specular2-in.txt ├── zun-Bumped_Specular2-out.txt ├── zun-Decal-in.txt ├── zun-Decal-out.txt ├── zun-Diffuse-in.txt ├── zun-Diffuse-out.txt ├── zun-Diffuse2-in.txt ├── zun-Diffuse2-out.txt ├── zun-Diffuse_Alpha_Shadowed_ZWrite-in.txt ├── zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt ├── zun-FX_Glass_Stained_BumpDistort-in.txt ├── zun-FX_Glass_Stained_BumpDistort-out.txt ├── zun-FX_Water_(simple)-in.txt ├── zun-FX_Water_(simple)-out.txt ├── zun-Grab_Invert-in.txt ├── zun-Grab_Invert-out.txt ├── zun-Hidden_Camera-DepthNormalTexture-in.txt ├── zun-Hidden_Camera-DepthNormalTexture-out.txt ├── zun-Hidden_Camera-DepthNormalTexture1-in.txt ├── zun-Hidden_Camera-DepthNormalTexture1-out.txt ├── zun-Hidden_Camera-DepthTexture-in.txt ├── zun-Hidden_Camera-DepthTexture-out.txt ├── zun-Hidden_Glow_Downsample-in.txt ├── zun-Hidden_Glow_Downsample-out.txt ├── zun-Hidden_Internal-GUITextureClip-in.txt ├── zun-Hidden_Internal-GUITextureClip-out.txt ├── zun-Hidden_Internal-PrePassLighting-in.txt ├── zun-Hidden_Internal-PrePassLighting-out.txt ├── zun-Hidden_Noise_Shader_RGB-in.txt ├── zun-Hidden_Noise_Shader_RGB-out.txt ├── zun-Hidden_TerrainEngine_BillboardTree-in.txt ├── zun-Hidden_TerrainEngine_BillboardTree-out.txt ├── zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-in.txt ├── zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt ├── zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-in.txt ├── zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt ├── zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-in.txt ├── zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt ├── zun-Hidden_TerrainEngine_Details_WavingDoublePass1-in.txt ├── zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt ├── zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-in.txt ├── zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt ├── zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-in.txt ├── zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt ├── zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-in.txt ├── zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt ├── zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-in.txt ├── zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt ├── zun-Hidden_Tree_Bark_Shader_Rendertex-in.txt ├── zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt ├── zun-Hidden_Tree_Leaf_Shader_Rendertex-in.txt ├── zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt ├── zun-Hidden_Tree_Optimized_Bark_Shader-in.txt ├── zun-Hidden_Tree_Optimized_Bark_Shader-out.txt ├── zun-Hidden_Tree_Optimized_Bark_Shader1-in.txt ├── zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt ├── zun-Hidden_Tree_Optimized_Leaf_Shader-in.txt ├── zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt ├── zun-Hidden_Tree_Optimized_Leaf_Shader1-in.txt ├── zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt ├── zun-Hidden_Twist_Effect-in.txt ├── zun-Hidden_Twist_Effect-out.txt ├── zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-in.txt ├── zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt ├── zun-Nature_Soft_Occlusion_Bark-in.txt ├── zun-Nature_Soft_Occlusion_Bark-out.txt ├── zun-Nature_Soft_Occlusion_Bark2-in.txt ├── zun-Nature_Soft_Occlusion_Bark2-out.txt ├── zun-Nature_Soft_Occlusion_Bark3-in.txt ├── zun-Nature_Soft_Occlusion_Bark3-out.txt ├── zun-Nature_Soft_Occlusion_Leaves1-in.txt ├── zun-Nature_Soft_Occlusion_Leaves1-out.txt ├── zun-Nature_Soft_Occlusion_Leaves3-in.txt ├── zun-Nature_Soft_Occlusion_Leaves3-out.txt ├── zun-Parallax_Diffuse-in.txt ├── zun-Parallax_Diffuse-out.txt ├── zun-Parallax_Diffuse1-in.txt ├── zun-Parallax_Diffuse1-out.txt ├── zun-Parallax_Diffuse2-in.txt ├── zun-Parallax_Diffuse2-out.txt ├── zun-Particles_Blend-in.txt ├── zun-Particles_Blend-out.txt ├── zun-Reflective_Bumped_Diffuse-in.txt ├── zun-Reflective_Bumped_Diffuse-out.txt ├── zun-Reflective_Bumped_Diffuse1-in.txt ├── zun-Reflective_Bumped_Diffuse1-out.txt ├── zun-Reflective_Bumped_Specular-in.txt ├── zun-Reflective_Bumped_Specular-out.txt ├── zun-Reflective_Bumped_Specular1-in.txt ├── zun-Reflective_Bumped_Specular1-out.txt ├── zun-Reflective_Bumped_Specular2-in.txt ├── zun-Reflective_Bumped_Specular2-out.txt ├── zun-Reflective_Bumped_Unlit-in.txt ├── zun-Reflective_Bumped_Unlit-out.txt ├── zun-Reflective_Diffuse-in.txt ├── zun-Reflective_Diffuse-out.txt ├── zun-Reflective_Diffuse1-in.txt ├── zun-Reflective_Diffuse1-out.txt ├── zun-Reflective_Parallax_Diffuse-in.txt ├── zun-Reflective_Parallax_Diffuse-out.txt ├── zun-Reflective_Parallax_Diffuse1-in.txt ├── zun-Reflective_Parallax_Diffuse1-out.txt ├── zun-Reflective_Parallax_Specular-in.txt ├── zun-Reflective_Parallax_Specular-out.txt ├── zun-Reflective_Parallax_Specular1-in.txt ├── zun-Reflective_Parallax_Specular1-out.txt ├── zun-Reflective_Specular-in.txt ├── zun-Reflective_Specular-out.txt ├── zun-Reflective_Specular1-in.txt ├── zun-Reflective_Specular1-out.txt ├── zun-Reflective_Specular2-in.txt ├── zun-Reflective_Specular2-out.txt ├── zun-RenderFX_Skybox_Cubed-in.txt ├── zun-RenderFX_Skybox_Cubed-out.txt ├── zun-Self-Illumin_Bumped_Diffuse-in.txt ├── zun-Self-Illumin_Bumped_Diffuse-out.txt ├── zun-Self-Illumin_Bumped_Specular1-in.txt ├── zun-Self-Illumin_Bumped_Specular1-out.txt ├── zun-Self-Illumin_Diffuse1-in.txt ├── zun-Self-Illumin_Diffuse1-out.txt ├── zun-Self-Illumin_Parallax_Diffuse-in.txt ├── zun-Self-Illumin_Parallax_Diffuse-out.txt ├── zun-Self-Illumin_Parallax_Specular1-in.txt ├── zun-Self-Illumin_Parallax_Specular1-out.txt ├── zun-Self-Illumin_Specular1-in.txt ├── zun-Self-Illumin_Specular1-out.txt ├── zun-ShowDestAlpha-in.txt ├── zun-ShowDestAlpha-out.txt ├── zun-Specular-in.txt ├── zun-Specular-out.txt ├── zun-Specular1-in.txt ├── zun-Specular1-out.txt ├── zun-Specular2-in.txt ├── zun-Specular2-out.txt ├── zun-Surface_2UV-in.txt ├── zun-Surface_2UV-out.txt ├── zun-Surface_2UV1-in.txt ├── zun-Surface_2UV1-out.txt ├── zun-Surface_Colored_Specular-in.txt ├── zun-Surface_Colored_Specular-out.txt ├── zun-Surface_Colored_Specular1-in.txt ├── zun-Surface_Colored_Specular1-out.txt ├── zun-Surface_Custom_Data-in.txt ├── zun-Surface_Custom_Data-out.txt ├── zun-Surface_Custom_Data1-in.txt ├── zun-Surface_Custom_Data1-out.txt ├── zun-Surface_Custom_Data2-in.txt ├── zun-Surface_Custom_Data2-out.txt ├── zun-Surface_DecalAddBump-in.txt ├── zun-Surface_DecalAddBump-out.txt ├── zun-Surface_DecalAddBump1-in.txt ├── zun-Surface_DecalAddBump1-out.txt ├── zun-Surface_DecalAddBump2-in.txt ├── zun-Surface_DecalAddBump2-out.txt ├── zun-Surface_DecalAddBump3-in.txt ├── zun-Surface_DecalAddBump3-out.txt ├── zun-Surface_Diffuse_Wrapped-in.txt ├── zun-Surface_Diffuse_Wrapped-out.txt ├── zun-Surface_Rim-in.txt ├── zun-Surface_Rim-out.txt ├── zun-Surface_Rim1-in.txt ├── zun-Surface_Rim1-out.txt ├── zun-Surface_Rim2-in.txt ├── zun-Surface_Rim2-out.txt ├── zun-Surface_Rim_Bump-in.txt ├── zun-Surface_Rim_Bump-out.txt ├── zun-Surface_Rim_Bump1-in.txt ├── zun-Surface_Rim_Bump1-out.txt ├── zun-Surface_ScreenPos-in.txt ├── zun-Surface_ScreenPos-out.txt ├── zun-Surface_ScreenPos1-in.txt ├── zun-Surface_ScreenPos1-out.txt ├── zun-Surface_ScreenPos2-in.txt ├── zun-Surface_ScreenPos2-out.txt ├── zun-Surface_ScreenPosAlbedo-in.txt ├── zun-Surface_ScreenPosAlbedo-out.txt ├── zun-Surface_ScreenPosAlbedo1-in.txt ├── zun-Surface_ScreenPosAlbedo1-out.txt ├── zun-Surface_Slices-in.txt ├── zun-Surface_Slices-out.txt ├── zun-Surface_Slices1-in.txt ├── zun-Surface_Slices1-out.txt ├── zun-Surface_Slices2-in.txt ├── zun-Surface_Slices2-out.txt ├── zun-Surface_Slices3-in.txt ├── zun-Surface_Slices3-out.txt ├── zun-Surface_WorldRefl-in.txt ├── zun-Surface_WorldRefl-out.txt ├── zun-Surface_WorldRefl1-in.txt ├── zun-Surface_WorldRefl1-out.txt ├── zun-Test_CgNormals-in.txt ├── zun-Test_CgNormals-out.txt ├── zun-Test_VertexShaderDepthTexture-in.txt ├── zun-Test_VertexShaderDepthTexture-out.txt ├── zun-Test_VertexShaderTexture-in.txt ├── zun-Test_VertexShaderTexture-out.txt ├── zun-TexGen_Cube_Refl-in.txt ├── zun-TexGen_Cube_Refl-out.txt ├── zun-Toon_Basic-in.txt ├── zun-Toon_Basic-out.txt ├── zun-Transparent_Bumped_Specular-in.txt ├── zun-Transparent_Bumped_Specular-out.txt ├── zun-Transparent_Cutout_Bumped_Diffuse-in.txt ├── zun-Transparent_Cutout_Bumped_Diffuse-out.txt ├── zun-Transparent_Cutout_Bumped_Diffuse1-in.txt ├── zun-Transparent_Cutout_Bumped_Diffuse1-out.txt ├── zun-Transparent_Cutout_Bumped_Specular-in.txt ├── zun-Transparent_Cutout_Bumped_Specular-out.txt ├── zun-Transparent_Cutout_Bumped_Specular1-in.txt ├── zun-Transparent_Cutout_Bumped_Specular1-out.txt ├── zun-Transparent_Cutout_Diffuse-in.txt ├── zun-Transparent_Cutout_Diffuse-out.txt ├── zun-Transparent_Cutout_Specular-in.txt ├── zun-Transparent_Cutout_Specular-out.txt ├── zun-Transparent_Specular-in.txt ├── zun-Transparent_Specular-out.txt ├── zun-TreeCreatorLeavesRT-in.txt ├── zun-TreeCreatorLeavesRT-out.txt ├── zun-Tree_Editor_Bark_Shader-in.txt ├── zun-Tree_Editor_Bark_Shader-out.txt ├── zun-Tree_Editor_Bark_Shader1-in.txt ├── zun-Tree_Editor_Bark_Shader1-out.txt ├── zun-Tree_Editor_Leaf_Shader-in.txt ├── zun-Tree_Editor_Leaf_Shader-out.txt ├── zun-Tree_Editor_Leaf_Shader1-in.txt ├── zun-Tree_Editor_Leaf_Shader1-out.txt ├── zun-Vertex_Colored-in.txt └── zun-Vertex_Colored-out.txt /.gitattributes: -------------------------------------------------------------------------------- 1 | *.dsp -crlf 2 | *.dsw -crlf 3 | *.sln -crlf 4 | *.vcproj -crlf 5 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | projects 2 | tests 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 4 | - '7' 5 | - '6' 6 | - '5' 7 | - '4' 8 | - '0.12' 9 | env: 10 | - CXX=g++-4.8 11 | addons: 12 | apt: 13 | sources: 14 | - ubuntu-toolchain-r-test 15 | packages: 16 | - g++-4.8 17 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | srcdir=`dirname "$0"` 4 | test -z "$srcdir" && srcdir=. 5 | 6 | ORIGDIR=`pwd` 7 | cd "$srcdir" 8 | 9 | autoreconf -v --install || exit 1 10 | cd $ORIGDIR || exit $? 11 | 12 | if test -z "$NOCONFIGURE"; then 13 | "$srcdir"/configure "$@" 14 | fi 15 | -------------------------------------------------------------------------------- /binding.gyp: -------------------------------------------------------------------------------- 1 | { 2 | 'includes': [ 3 | 'target_defaults.gypi', 4 | ], 5 | 'targets': [ 6 | { 7 | "include_dirs" : [ 8 | " $TARGET' 22 | ) 23 | 24 | # parse Makefile.sources 25 | source_lists = env.ParseSourceList('Makefile.sources') 26 | 27 | mesautil_sources = ( 28 | source_lists['MESA_UTIL_FILES'] + 29 | source_lists['MESA_UTIL_GENERATED_FILES'] 30 | ) 31 | 32 | mesautil = env.ConvenienceLibrary( 33 | target = 'mesautil', 34 | source = mesautil_sources, 35 | ) 36 | 37 | env.Alias('mesautil', mesautil) 38 | Export('mesautil') 39 | -------------------------------------------------------------------------------- /target_defaults.gypi: -------------------------------------------------------------------------------- 1 | { 2 | 'target_defaults': { 3 | 'configurations': { 4 | 'Debug': { 5 | 'defines': [ 6 | 'DEBUG', 7 | '_DEBUG', 8 | ], 9 | }, 10 | 'Release': { 11 | 'defines': [ 12 | 'NDEBUG', 13 | ], 14 | }, 15 | }, 16 | 'conditions': [ 17 | ['OS=="win"', { 18 | 'target_defaults': { 19 | 'msvs_settings': { 20 | 'VCCLCompilerTool': { 21 | 'ExceptionHandling': '0', 22 | }, 23 | }, 24 | }, 25 | }], 26 | ], 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /tests/fragment/array-const-in.txt: -------------------------------------------------------------------------------- 1 | vec4 xlat_main( ); 2 | vec4 xlat_main( ) { 3 | vec2 poisson[8]; 4 | poisson[0] = vec2( 0.000000, 0.000000); 5 | poisson[1] = vec2( 0.527837, -0.0858680); 6 | poisson[2] = vec2( -0.0400880, 0.536087); 7 | poisson[3] = vec2( -0.670445, -0.179949); 8 | poisson[4] = vec2( -0.419418, -0.616039); 9 | poisson[5] = vec2( 0.440453, -0.639399); 10 | poisson[6] = vec2( -0.757088, 0.349334); 11 | poisson[7] = vec2( 0.574619, 0.685879); 12 | vec4 c; 13 | int i = 0; 14 | c = vec4( 0.000000); 15 | for ( ; (i < 8); ( ++i )) { 16 | c.xy += poisson[ i ]; 17 | } 18 | return c; 19 | } 20 | void main() { 21 | vec4 xl_retval; 22 | xl_retval = xlat_main( ); 23 | gl_FragData[0] = vec4( xl_retval); 24 | } 25 | -------------------------------------------------------------------------------- /tests/fragment/array-const-inES.txt: -------------------------------------------------------------------------------- 1 | mediump vec4 xlat_main( ); 2 | mediump vec4 xlat_main( ) { 3 | highp vec2 poisson[8]; 4 | poisson[0] = vec2( 0.000000, 0.000000); 5 | poisson[1] = vec2( 0.527837, -0.0858680); 6 | poisson[2] = vec2( -0.0400880, 0.536087); 7 | poisson[3] = vec2( -0.670445, -0.179949); 8 | poisson[4] = vec2( -0.419418, -0.616039); 9 | poisson[5] = vec2( 0.440453, -0.639399); 10 | poisson[6] = vec2( -0.757088, 0.349334); 11 | poisson[7] = vec2( 0.574619, 0.685879); 12 | mediump vec4 c; 13 | highp int i = 0; 14 | c = vec4( 0.000000); 15 | for ( ; (i < 8); ( ++i )) { 16 | c.xy += poisson[ i ]; 17 | } 18 | return c; 19 | } 20 | void main() { 21 | mediump vec4 xl_retval; 22 | xl_retval = xlat_main( ); 23 | gl_FragData[0] = vec4( xl_retval); 24 | } 25 | -------------------------------------------------------------------------------- /tests/fragment/array-const-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | mediump vec4 xlat_main( ) { 3 | highp vec2 poisson[8]; 4 | poisson[0] = vec2( 0.000000, 0.000000); 5 | poisson[1] = vec2( 0.527837, -0.0858680); 6 | poisson[2] = vec2( -0.0400880, 0.536087); 7 | poisson[3] = vec2( -0.670445, -0.179949); 8 | poisson[4] = vec2( -0.419418, -0.616039); 9 | poisson[5] = vec2( 0.440453, -0.639399); 10 | poisson[6] = vec2( -0.757088, 0.349334); 11 | poisson[7] = vec2( 0.574619, 0.685879); 12 | mediump vec4 c; 13 | highp int i = 0; 14 | c = vec4( 0.000000); 15 | for ( ; (i < 8); ( ++i )) { 16 | c.xy += poisson[ i ]; 17 | } 18 | return c; 19 | } 20 | out lowp vec4 _fragData; 21 | void main() { 22 | mediump vec4 xl_retval = xlat_main(); 23 | _fragData = vec4(xl_retval); 24 | } 25 | -------------------------------------------------------------------------------- /tests/fragment/array-const-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | vec4 c_1; 4 | c_1.zw = vec2(0.0, 0.0); 5 | c_1.xy = vec2(-0.3441301, 0.05004501); 6 | gl_FragData[0] = c_1; 7 | } 8 | 9 | 10 | // stats: 2 alu 0 tex 0 flow 11 | -------------------------------------------------------------------------------- /tests/fragment/array-const-outES.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | mediump vec4 c_1; 4 | c_1.zw = vec2(0.0, 0.0); 5 | c_1.xy = vec2(-0.3441301, 0.05004501); 6 | gl_FragData[0] = c_1; 7 | } 8 | 9 | 10 | // stats: 2 alu 0 tex 0 flow 11 | -------------------------------------------------------------------------------- /tests/fragment/array-const-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | out lowp vec4 _fragData; 3 | void main () 4 | { 5 | mediump vec4 c_1; 6 | c_1.zw = vec2(0.0, 0.0); 7 | c_1.xy = vec2(-0.3441301, 0.05004501); 8 | _fragData = c_1; 9 | } 10 | 11 | 12 | // stats: 2 alu 0 tex 0 flow 13 | -------------------------------------------------------------------------------- /tests/fragment/array-const-outES3Metal.txt: -------------------------------------------------------------------------------- 1 | #include 2 | #pragma clang diagnostic ignored "-Wparentheses-equality" 3 | using namespace metal; 4 | struct xlatMtlShaderInput { 5 | }; 6 | struct xlatMtlShaderOutput { 7 | half4 _fragData [[color(0)]]; 8 | }; 9 | struct xlatMtlShaderUniform { 10 | }; 11 | fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) 12 | { 13 | xlatMtlShaderOutput _mtl_o; 14 | half4 c_1 = 0; 15 | c_1.zw = half2(float2(0.0, 0.0)); 16 | c_1.xy = half2(float2(-0.3441301, 0.05004501)); 17 | _mtl_o._fragData = c_1; 18 | return _mtl_o; 19 | } 20 | 21 | 22 | // stats: 2 alu 0 tex 0 flow 23 | -------------------------------------------------------------------------------- /tests/fragment/array-constconst-in.txt: -------------------------------------------------------------------------------- 1 | vec4 xlat_main( ); 2 | vec4 xlat_main( ) { 3 | vec2 poisson[8]; 4 | poisson[0] = vec2( 0.000000, 0.000000); 5 | poisson[1] = vec2( 0.527837, -0.0858680); 6 | poisson[2] = vec2( -0.0400880, 0.536087); 7 | poisson[3] = vec2( -0.670445, -0.179949); 8 | poisson[4] = vec2( -0.419418, -0.616039); 9 | poisson[5] = vec2( 0.440453, -0.639399); 10 | poisson[6] = vec2( -0.757088, 0.349334); 11 | poisson[7] = vec2( 0.574619, 0.685879); 12 | vec4 c; 13 | int i = 0; 14 | c = vec4( 0.000000); 15 | for ( ; (i < 8); ( ++i )) { 16 | c.xy += poisson[ i ]; 17 | } 18 | return c; 19 | } 20 | void main() { 21 | vec4 xl_retval; 22 | xl_retval = xlat_main( ); 23 | gl_FragData[0] = vec4( xl_retval); 24 | } 25 | -------------------------------------------------------------------------------- /tests/fragment/array-constconst-inES.txt: -------------------------------------------------------------------------------- 1 | mediump vec4 xlat_main( ); 2 | mediump vec4 xlat_main( ) { 3 | highp vec2 poisson[8]; 4 | poisson[0] = vec2( 0.000000, 0.000000); 5 | poisson[1] = vec2( 0.527837, -0.0858680); 6 | poisson[2] = vec2( -0.0400880, 0.536087); 7 | poisson[3] = vec2( -0.670445, -0.179949); 8 | poisson[4] = vec2( -0.419418, -0.616039); 9 | poisson[5] = vec2( 0.440453, -0.639399); 10 | poisson[6] = vec2( -0.757088, 0.349334); 11 | poisson[7] = vec2( 0.574619, 0.685879); 12 | mediump vec4 c; 13 | highp int i = 0; 14 | c = vec4( 0.000000); 15 | for ( ; (i < 8); ( ++i )) { 16 | c.xy += poisson[ i ]; 17 | } 18 | return c; 19 | } 20 | void main() { 21 | mediump vec4 xl_retval; 22 | xl_retval = xlat_main( ); 23 | gl_FragData[0] = vec4( xl_retval); 24 | } 25 | -------------------------------------------------------------------------------- /tests/fragment/array-constconst-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | out mediump vec4 _fragData; 3 | mediump vec4 xlat_main( ); 4 | mediump vec4 xlat_main( ) { 5 | highp vec2 poisson[8]; 6 | poisson[0] = vec2( 0.000000, 0.000000); 7 | poisson[1] = vec2( 0.527837, -0.0858680); 8 | poisson[2] = vec2( -0.0400880, 0.536087); 9 | poisson[3] = vec2( -0.670445, -0.179949); 10 | poisson[4] = vec2( -0.419418, -0.616039); 11 | poisson[5] = vec2( 0.440453, -0.639399); 12 | poisson[6] = vec2( -0.757088, 0.349334); 13 | poisson[7] = vec2( 0.574619, 0.685879); 14 | mediump vec4 c; 15 | highp int i = 0; 16 | c = vec4( 0.000000); 17 | for ( ; (i < 8); ( ++i )) { 18 | c.xy += poisson[ i ]; 19 | } 20 | return c; 21 | } 22 | void main() { 23 | mediump vec4 xl_retval; 24 | xl_retval = xlat_main( ); 25 | _fragData = vec4( xl_retval); 26 | } 27 | -------------------------------------------------------------------------------- /tests/fragment/array-constconst-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | vec4 c_1; 4 | c_1.zw = vec2(0.0, 0.0); 5 | c_1.xy = vec2(-0.3441301, 0.05004501); 6 | gl_FragData[0] = c_1; 7 | } 8 | 9 | 10 | // stats: 2 alu 0 tex 0 flow 11 | -------------------------------------------------------------------------------- /tests/fragment/array-constconst-outES.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | mediump vec4 c_1; 4 | c_1.zw = vec2(0.0, 0.0); 5 | c_1.xy = vec2(-0.3441301, 0.05004501); 6 | gl_FragData[0] = c_1; 7 | } 8 | 9 | 10 | // stats: 2 alu 0 tex 0 flow 11 | -------------------------------------------------------------------------------- /tests/fragment/array-constconst-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | out mediump vec4 _fragData; 3 | void main () 4 | { 5 | mediump vec4 c_1; 6 | c_1.zw = vec2(0.0, 0.0); 7 | c_1.xy = vec2(-0.3441301, 0.05004501); 8 | _fragData = c_1; 9 | } 10 | 11 | 12 | // stats: 2 alu 0 tex 0 flow 13 | -------------------------------------------------------------------------------- /tests/fragment/array-constconst-outES3Metal.txt: -------------------------------------------------------------------------------- 1 | #include 2 | #pragma clang diagnostic ignored "-Wparentheses-equality" 3 | using namespace metal; 4 | struct xlatMtlShaderInput { 5 | }; 6 | struct xlatMtlShaderOutput { 7 | half4 _fragData [[color(0)]]; 8 | }; 9 | struct xlatMtlShaderUniform { 10 | }; 11 | fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) 12 | { 13 | xlatMtlShaderOutput _mtl_o; 14 | half4 c_1 = 0; 15 | c_1.zw = half2(float2(0.0, 0.0)); 16 | c_1.xy = half2(float2(-0.3441301, 0.05004501)); 17 | _mtl_o._fragData = c_1; 18 | return _mtl_o; 19 | } 20 | 21 | 22 | // stats: 2 alu 0 tex 0 flow 23 | -------------------------------------------------------------------------------- /tests/fragment/ast-in.txt: -------------------------------------------------------------------------------- 1 | void main() { 2 | if (gl_FragCoord.x==1.0) 3 | discard; 4 | float a; 5 | if (2==3) 6 | a = 2.0; 7 | if (3==4) 8 | a = 3.0; 9 | else 10 | a = 4.0; 11 | for (int i = 0; i < 10; ++i) 12 | a += 1.0; 13 | do { 14 | a += 2.0; 15 | } while (0==1); 16 | a += 1.0; 17 | a *= a; 18 | a = -a; 19 | --a; 20 | a = sqrt(a); 21 | a = 1.0 / a; 22 | gl_FragColor = vec4(a); 23 | } 24 | -------------------------------------------------------------------------------- /tests/fragment/ast-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | out lowp vec4 _fragData; 3 | void main() 4 | { 5 | if (gl_FragCoord.x==1.0) 6 | discard; 7 | float a; 8 | if (2==3) 9 | a = 2.0; 10 | if (3==4) 11 | a = 3.0; 12 | else 13 | a = 4.0; 14 | for (int i = 0; i < 10; ++i) 15 | a += 1.0; 16 | do { 17 | a += 2.0; 18 | } while (0==1); 19 | a += 1.0; 20 | a *= a; 21 | a = -a; 22 | --a; 23 | a = sqrt(a); 24 | a = 1.0 / a; 25 | _fragData = vec4(a); 26 | } 27 | -------------------------------------------------------------------------------- /tests/fragment/ast-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | float a_2; 4 | if ((gl_FragCoord.x == 1.0)) { 5 | discard; 6 | }; 7 | a_2 = 4.0; 8 | for (int i_1 = 0; i_1 < 10; i_1++) { 9 | a_2 += 1.0; 10 | }; 11 | while (true) { 12 | a_2 += 2.0; 13 | break; 14 | }; 15 | a_2 += 1.0; 16 | a_2 = (a_2 * a_2); 17 | a_2 = -(a_2); 18 | a_2 = (a_2 - 1.0); 19 | a_2 = inversesqrt(a_2); 20 | gl_FragColor = vec4(a_2); 21 | } 22 | 23 | 24 | // stats: 12 alu 1 tex 4 flow 25 | // inputs: 1 26 | // #0: gl_FragCoord (high float) 4x1 [-1] loc 0 27 | -------------------------------------------------------------------------------- /tests/fragment/ast-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | out lowp vec4 _fragData; 3 | void main () 4 | { 5 | highp float a_2; 6 | if ((gl_FragCoord.x == 1.0)) { 7 | discard; 8 | }; 9 | a_2 = 4.0; 10 | for (highp int i_1 = 0; i_1 < 10; i_1++) { 11 | a_2 += 1.0; 12 | }; 13 | while (true) { 14 | a_2 += 2.0; 15 | break; 16 | }; 17 | a_2 += 1.0; 18 | a_2 = (a_2 * a_2); 19 | a_2 = -(a_2); 20 | a_2 = (a_2 - 1.0); 21 | a_2 = inversesqrt(a_2); 22 | _fragData = vec4(a_2); 23 | } 24 | 25 | 26 | // stats: 12 alu 1 tex 4 flow 27 | // inputs: 1 28 | // #0: gl_FragCoord (high float) 4x1 [-1] loc 0 29 | -------------------------------------------------------------------------------- /tests/fragment/basic-in.txt: -------------------------------------------------------------------------------- 1 | vec4 xlat_main() { 2 | return vec4(1.0, 1e7, 1e-6, 1.5); 3 | } 4 | void main() { 5 | vec4 x = xlat_main(); 6 | gl_FragData[0] = x; 7 | gl_FragData[1] = vec4(1.0/0.0, -1.0/0.0, 0.0/0.0, -0.0/0.0); 8 | } 9 | -------------------------------------------------------------------------------- /tests/fragment/basic-inES.txt: -------------------------------------------------------------------------------- 1 | mediump vec4 xlat_main( ); 2 | mediump vec4 xlat_main( ) { 3 | return vec4( 1.00000); 4 | } 5 | void main() { 6 | mediump vec4 xl_retval; 7 | xl_retval = xlat_main( ); 8 | gl_FragData[0] = vec4( xl_retval); 9 | } 10 | -------------------------------------------------------------------------------- /tests/fragment/basic-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | gl_FragData[0] = vec4(1.0, 1e+07, 1e-06, 1.5); 4 | gl_FragData[1] = vec4((1.0/0.0), (-1.0/0.0), (0.0/0.0), (0.0/0.0)); 5 | } 6 | 7 | 8 | // stats: 2 alu 0 tex 0 flow 9 | -------------------------------------------------------------------------------- /tests/fragment/basic-outES.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | gl_FragData[0] = vec4(1.0, 1.0, 1.0, 1.0); 4 | } 5 | 6 | 7 | // stats: 1 alu 0 tex 0 flow 8 | -------------------------------------------------------------------------------- /tests/fragment/bug-bad-framebufferfetch-metal-translation-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | #extension GL_EXT_shader_framebuffer_fetch : require 3 | 4 | // had a bug where if shader framebuffer fetch extension is enabled, 5 | // but not actually used, then translated shader would end up 6 | // being empty, since all writes to gl_FragData were wrongly removed. 7 | 8 | #define gl_FragData _glesFragData 9 | layout(location = 0) inout mediump vec4 _glesFragData[4]; 10 | 11 | in highp vec2 inUV; 12 | void main() { 13 | gl_FragData[0] = vec4(inUV.x); 14 | } 15 | -------------------------------------------------------------------------------- /tests/fragment/bug-bad-framebufferfetch-metal-translation-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | #extension GL_EXT_shader_framebuffer_fetch : enable 3 | layout(location=0) inout mediump vec4 _glesFragData[4]; 4 | in highp vec2 inUV; 5 | void main () 6 | { 7 | highp vec4 tmpvar_1; 8 | tmpvar_1 = inUV.xxxx; 9 | _glesFragData[0] = tmpvar_1; 10 | } 11 | 12 | 13 | // stats: 0 alu 0 tex 0 flow 14 | // inputs: 1 15 | // #0: inUV (high float) 2x1 [-1] 16 | -------------------------------------------------------------------------------- /tests/fragment/bug-bad-framebufferfetch-metal-translation-outES3Metal.txt: -------------------------------------------------------------------------------- 1 | #include 2 | #pragma clang diagnostic ignored "-Wparentheses-equality" 3 | using namespace metal; 4 | struct xlatMtlShaderInput { 5 | float2 inUV; 6 | half4 _glesFragData_0 [[color(0)]]; 7 | }; 8 | struct xlatMtlShaderOutput { 9 | half4 _glesFragData_0 [[color(0)]]; 10 | }; 11 | struct xlatMtlShaderUniform { 12 | }; 13 | fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) 14 | { 15 | xlatMtlShaderOutput _mtl_o; 16 | float4 tmpvar_1 = 0; 17 | tmpvar_1 = _mtl_i.inUV.xxxx; 18 | _mtl_o._glesFragData_0 = half4(tmpvar_1); 19 | return _mtl_o; 20 | } 21 | 22 | 23 | // stats: 0 alu 0 tex 0 flow 24 | // inputs: 1 25 | // #0: inUV (high float) 2x1 [-1] 26 | -------------------------------------------------------------------------------- /tests/fragment/bug-const-variable-in.txt: -------------------------------------------------------------------------------- 1 | // Used to expose bugs in constant variable optimization, 2 | // when variables were deemed constant not taking into 3 | // account branches or previous dereferences of them. 4 | 5 | uniform float mode; 6 | float func (float c) { 7 | if (mode == 2.0) 8 | return c; 9 | if (mode == 3.0) 10 | discard; 11 | if (mode == 10.0) 12 | c = 0.1; 13 | return c; 14 | } 15 | void main() { 16 | vec4 c = gl_FragCoord; 17 | c.x = func(c.x); 18 | gl_FragColor = c; 19 | } 20 | -------------------------------------------------------------------------------- /tests/fragment/bug-const-variable-out.txt: -------------------------------------------------------------------------------- 1 | uniform float mode; 2 | void main () 3 | { 4 | vec4 c_1; 5 | c_1 = gl_FragCoord; 6 | float c_2; 7 | c_2 = gl_FragCoord.x; 8 | float tmpvar_3; 9 | if ((mode == 2.0)) { 10 | tmpvar_3 = c_2; 11 | } else { 12 | if ((mode == 3.0)) { 13 | discard; 14 | }; 15 | if ((mode == 10.0)) { 16 | c_2 = 0.1; 17 | }; 18 | tmpvar_3 = c_2; 19 | }; 20 | c_1.x = tmpvar_3; 21 | gl_FragColor = c_1; 22 | } 23 | 24 | 25 | // stats: 4 alu 1 tex 3 flow 26 | // inputs: 1 27 | // #0: gl_FragCoord (high float) 4x1 [-1] loc 0 28 | // uniforms: 1 (total size: 0) 29 | // #0: mode (high float) 1x1 [-1] 30 | -------------------------------------------------------------------------------- /tests/fragment/bug-global-init-in.txt: -------------------------------------------------------------------------------- 1 | uniform float value; 2 | float otherValue = log(value); 3 | void main() 4 | { 5 | gl_FragColor = vec4(otherValue); 6 | } 7 | -------------------------------------------------------------------------------- /tests/fragment/bug-global-init-out.txt: -------------------------------------------------------------------------------- 1 | uniform float value; 2 | void main () 3 | { 4 | gl_FragColor = vec4(log(value)); 5 | } 6 | 7 | 8 | // stats: 1 alu 0 tex 0 flow 9 | // uniforms: 1 (total size: 0) 10 | // #0: value (high float) 1x1 [-1] 11 | -------------------------------------------------------------------------------- /tests/fragment/bug-inline-names-in.txt: -------------------------------------------------------------------------------- 1 | float foo (float v) 2 | { 3 | float a, b; 4 | a = v; 5 | { 6 | float a; 7 | a = sin(v); 8 | b = a; 9 | } 10 | a += b; 11 | return a; 12 | } 13 | 14 | varying float vv; 15 | 16 | void main() 17 | { 18 | gl_FragColor = vec4(foo(vv)); 19 | } 20 | -------------------------------------------------------------------------------- /tests/fragment/bug-inline-names-out.txt: -------------------------------------------------------------------------------- 1 | varying float vv; 2 | void main () 3 | { 4 | gl_FragColor = vec4((vv + sin(vv))); 5 | } 6 | 7 | 8 | // stats: 2 alu 0 tex 0 flow 9 | // inputs: 1 10 | // #0: vv (high float) 1x1 [-1] 11 | -------------------------------------------------------------------------------- /tests/fragment/bug-loop-null-from-in.txt: -------------------------------------------------------------------------------- 1 | void main() { 2 | float a = 0.0; 3 | int k = 0; 4 | for (int i = 0; i < 3; ++i) 5 | a += 1.0; 6 | for ( ; k < 3; ++k) 7 | a += 3.0; 8 | gl_FragColor = vec4(a); 9 | } 10 | -------------------------------------------------------------------------------- /tests/fragment/bug-loop-null-from-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | gl_FragColor = vec4(12.0, 12.0, 12.0, 12.0); 4 | } 5 | 6 | 7 | // stats: 1 alu 0 tex 0 flow 8 | -------------------------------------------------------------------------------- /tests/fragment/bug-loop-share-index-in.txt: -------------------------------------------------------------------------------- 1 | // https://github.com/aras-p/glsl-optimizer/issues/49 2 | 3 | uniform int loopNum; 4 | 5 | void main() { 6 | int myIdx; 7 | vec4 r = vec4(0.0); 8 | myIdx = 1; 9 | for ( ; myIdx < loopNum; ++myIdx) { 10 | r.x += 1.0; 11 | r.y += 2.0; 12 | r.z += 3.0; 13 | } 14 | myIdx = 2; 15 | for ( ; myIdx < loopNum; ++myIdx) { 16 | r.x += 1.0; 17 | r.y += 2.0; 18 | r.z += 3.0; 19 | } 20 | gl_FragColor = r; 21 | } 22 | -------------------------------------------------------------------------------- /tests/fragment/bug-loop-share-index-out.txt: -------------------------------------------------------------------------------- 1 | uniform int loopNum; 2 | void main () 3 | { 4 | vec4 r_1; 5 | int myIdx_2; 6 | r_1 = vec4(0.0, 0.0, 0.0, 0.0); 7 | myIdx_2 = 1; 8 | while (true) { 9 | if ((myIdx_2 >= loopNum)) { 10 | break; 11 | }; 12 | r_1.x = (r_1.x + 1.0); 13 | r_1.y = (r_1.y + 2.0); 14 | r_1.z = (r_1.z + 3.0); 15 | myIdx_2++; 16 | }; 17 | myIdx_2 = 2; 18 | while (true) { 19 | if ((myIdx_2 >= loopNum)) { 20 | break; 21 | }; 22 | r_1.x = (r_1.x + 1.0); 23 | r_1.y = (r_1.y + 2.0); 24 | r_1.z = (r_1.z + 3.0); 25 | myIdx_2++; 26 | }; 27 | gl_FragColor = r_1; 28 | } 29 | 30 | 31 | // stats: 13 alu 0 tex 4 flow 32 | // uniforms: 1 (total size: 0) 33 | // #0: loopNum (high int) 1x1 [-1] 34 | -------------------------------------------------------------------------------- /tests/fragment/bug-op-parens-in.txt: -------------------------------------------------------------------------------- 1 | uniform float value; 2 | uniform float otherValue; 3 | void main() 4 | { 5 | float invValue = 1.0 / value; 6 | float result = otherValue / invValue; 7 | gl_FragColor = vec4(result); 8 | } 9 | -------------------------------------------------------------------------------- /tests/fragment/bug-op-parens-out.txt: -------------------------------------------------------------------------------- 1 | uniform float value; 2 | uniform float otherValue; 3 | void main () 4 | { 5 | gl_FragColor = vec4((otherValue / (1.0/(value)))); 6 | } 7 | 8 | 9 | // stats: 2 alu 0 tex 0 flow 10 | // uniforms: 2 (total size: 0) 11 | // #0: value (high float) 1x1 [-1] 12 | // #1: otherValue (high float) 1x1 [-1] 13 | -------------------------------------------------------------------------------- /tests/fragment/bug-sampler-highp-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | 3 | // There was a bug where due to xll_tex2Dlod sampling of a _CameraDepthTexture (that is a highp sampler) 4 | // was producing a missing cast between half4 and float4 on Metal output. 5 | // Shader is a minimal part of Unity's camera motion blur shader that exposes the bug 6 | 7 | vec4 xll_tex2Dlod(sampler2D s, vec4 coord) { return textureLod(s, coord.xy, coord.w); } 8 | uniform highp sampler2D _CameraDepthTexture; 9 | in highp vec2 varUV; 10 | out mediump vec4 _fragData; 11 | void main() 12 | { 13 | highp float z = xll_tex2Dlod(_CameraDepthTexture, vec4(varUV, 0.0, 0.0)).x; 14 | _fragData = vec4(z); 15 | } 16 | -------------------------------------------------------------------------------- /tests/fragment/bug-sampler-highp-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | uniform highp sampler2D _CameraDepthTexture; 3 | in highp vec2 varUV; 4 | out mediump vec4 _fragData; 5 | void main () 6 | { 7 | highp vec4 tmpvar_1; 8 | tmpvar_1 = textureLod (_CameraDepthTexture, varUV, 0.0).xxxx; 9 | _fragData = tmpvar_1; 10 | } 11 | 12 | 13 | // stats: 0 alu 1 tex 0 flow 14 | // inputs: 1 15 | // #0: varUV (high float) 2x1 [-1] 16 | // textures: 1 17 | // #0: _CameraDepthTexture (high 2d) 0x0 [-1] 18 | -------------------------------------------------------------------------------- /tests/fragment/bug-vectorize-tex-in.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | uniform sampler2D _RampTex; 3 | varying vec2 varUV; 4 | void main() 5 | { 6 | vec4 orig = texture2D (_MainTex, varUV); 7 | 8 | // There was a bug where these three texture 9 | // samples were "vectorized" in a wrong way, like 10 | // t.xyz = texture2DProj (_RampTex, t.xyz).xyz; 11 | 12 | float rr = texture2D (_RampTex, orig.xx).x; 13 | float gg = texture2D (_RampTex, orig.yy).y; 14 | float bb = texture2D (_RampTex, orig.zz).z; 15 | vec4 color = vec4 (rr, gg, bb, orig.w); 16 | gl_FragData[0] = color; 17 | } 18 | -------------------------------------------------------------------------------- /tests/fragment/bug-vectorize-tex-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | uniform sampler2D _RampTex; 3 | varying vec2 varUV; 4 | void main () 5 | { 6 | vec4 tmpvar_1; 7 | tmpvar_1 = texture2D (_MainTex, varUV); 8 | vec4 tmpvar_2; 9 | tmpvar_2.x = texture2D (_RampTex, tmpvar_1.xx).x; 10 | tmpvar_2.y = texture2D (_RampTex, tmpvar_1.yy).y; 11 | tmpvar_2.z = texture2D (_RampTex, tmpvar_1.zz).z; 12 | tmpvar_2.w = tmpvar_1.w; 13 | gl_FragData[0] = tmpvar_2; 14 | } 15 | 16 | 17 | // stats: 0 alu 4 tex 0 flow 18 | // inputs: 1 19 | // #0: varUV (high float) 2x1 [-1] 20 | // textures: 2 21 | // #0: _MainTex (high 2d) 0x0 [-1] 22 | // #1: _RampTex (high 2d) 0x0 [-1] 23 | -------------------------------------------------------------------------------- /tests/fragment/builtin-vars-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | out mediump vec4 _fragData; 3 | 4 | in mediump vec4 uv; 5 | 6 | void main() 7 | { 8 | mediump vec4 c; 9 | c = uv; 10 | c += gl_FragCoord; 11 | c.x += gl_FrontFacing ? 1.0 : 0.0; 12 | c.xy += gl_PointCoord; 13 | _fragData = c; 14 | } 15 | -------------------------------------------------------------------------------- /tests/fragment/builtin-vars-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | out mediump vec4 _fragData; 3 | in mediump vec4 uv; 4 | void main () 5 | { 6 | mediump vec4 c_1; 7 | c_1 = (uv + gl_FragCoord); 8 | highp float tmpvar_2; 9 | if (gl_FrontFacing) { 10 | tmpvar_2 = 1.0; 11 | } else { 12 | tmpvar_2 = 0.0; 13 | }; 14 | c_1.x = (c_1.x + tmpvar_2); 15 | c_1.xy = (c_1.xy + gl_PointCoord); 16 | _fragData = c_1; 17 | } 18 | 19 | 20 | // stats: 5 alu 0 tex 1 flow 21 | // inputs: 4 22 | // #0: gl_PointCoord (medium float) 2x1 [-1] loc 23 23 | // #1: gl_FrontFacing (low bool) 1x1 [-1] loc 22 24 | // #2: gl_FragCoord (high float) 4x1 [-1] loc 0 25 | // #3: uv (medium float) 4x1 [-1] 26 | -------------------------------------------------------------------------------- /tests/fragment/derivatives-out.txt: -------------------------------------------------------------------------------- 1 | varying vec4 xlv_TEXCOORD0; 2 | void main () 3 | { 4 | vec4 res_1; 5 | vec2 tmpvar_2; 6 | tmpvar_2 = dFdx(xlv_TEXCOORD0.xy); 7 | res_1.xy = tmpvar_2; 8 | res_1.zw = (abs(tmpvar_2) + abs(dFdy(xlv_TEXCOORD0.xy))); 9 | gl_FragData[0] = res_1; 10 | } 11 | 12 | 13 | // stats: 5 alu 0 tex 0 flow 14 | // inputs: 1 15 | // #0: xlv_TEXCOORD0 (high float) 4x1 [-1] 16 | -------------------------------------------------------------------------------- /tests/fragment/derivatives-outES.txt: -------------------------------------------------------------------------------- 1 | #extension GL_OES_standard_derivatives : enable 2 | varying highp vec4 xlv_TEXCOORD0; 3 | void main () 4 | { 5 | mediump vec4 tmpvar_1; 6 | lowp vec4 res_2; 7 | highp float tmpvar_3; 8 | tmpvar_3 = dFdx(xlv_TEXCOORD0.x); 9 | res_2.x = tmpvar_3; 10 | highp float tmpvar_4; 11 | tmpvar_4 = dFdx(xlv_TEXCOORD0.y); 12 | res_2.y = tmpvar_4; 13 | highp float tmpvar_5; 14 | tmpvar_5 = (abs(dFdx(xlv_TEXCOORD0.z)) + abs(dFdy(xlv_TEXCOORD0.z))); 15 | res_2.z = tmpvar_5; 16 | res_2.w = 1.0; 17 | tmpvar_1 = res_2; 18 | gl_FragData[0] = tmpvar_1; 19 | } 20 | 21 | 22 | // stats: 8 alu 0 tex 0 flow 23 | // inputs: 1 24 | // #0: xlv_TEXCOORD0 (high float) 4x1 [-1] 25 | -------------------------------------------------------------------------------- /tests/fragment/estest1-in.txt: -------------------------------------------------------------------------------- 1 | struct v2f { 2 | vec4 pos; 3 | vec2 uv0; 4 | vec2 uv1; 5 | }; 6 | 7 | uniform vec4 _Color; 8 | uniform sampler2D _Detail; 9 | uniform sampler2D _MainTex; 10 | vec4 frag( in v2f i ); 11 | vec4 frag( in v2f i ) { 12 | vec4 c; 13 | c = (_Color * texture2D( _MainTex, i.uv0)); 14 | c = ((c * texture2D( _Detail, i.uv1)) * 2.00000); 15 | return c; 16 | } 17 | varying vec4 xlv_TEXCOORD0; 18 | varying vec4 xlv_TEXCOORD1; 19 | void main() { 20 | vec4 xl_retval; 21 | v2f xlt_i; 22 | xlt_i.uv0 = vec2( xlv_TEXCOORD0); 23 | xlt_i.uv1 = vec2( xlv_TEXCOORD1); 24 | xl_retval = frag( xlt_i); 25 | gl_FragData[0] = vec4( xl_retval); 26 | } 27 | -------------------------------------------------------------------------------- /tests/fragment/estest1-out.txt: -------------------------------------------------------------------------------- 1 | uniform vec4 _Color; 2 | uniform sampler2D _Detail; 3 | uniform sampler2D _MainTex; 4 | varying vec4 xlv_TEXCOORD0; 5 | varying vec4 xlv_TEXCOORD1; 6 | void main () 7 | { 8 | vec4 c_1; 9 | c_1 = (_Color * texture2D (_MainTex, xlv_TEXCOORD0.xy)); 10 | c_1 = ((c_1 * texture2D (_Detail, xlv_TEXCOORD1.xy)) * 2.0); 11 | gl_FragData[0] = c_1; 12 | } 13 | 14 | 15 | // stats: 3 alu 2 tex 0 flow 16 | // inputs: 2 17 | // #0: xlv_TEXCOORD0 (high float) 4x1 [-1] 18 | // #1: xlv_TEXCOORD1 (high float) 4x1 [-1] 19 | // uniforms: 1 (total size: 0) 20 | // #0: _Color (high float) 4x1 [-1] 21 | // textures: 2 22 | // #0: _Detail (high 2d) 0x0 [-1] 23 | // #1: _MainTex (high 2d) 0x0 [-1] 24 | -------------------------------------------------------------------------------- /tests/fragment/float-literals-in.txt: -------------------------------------------------------------------------------- 1 | varying vec2 uv; 2 | 3 | void main() 4 | { 5 | vec4 c = vec4(0.0); 6 | float a, b; 7 | 8 | a = uv.y * 1.111111e+6; 9 | b = uv.y * 1.111110e+6; 10 | c.x = a-b; 11 | 12 | a = uv.y * 1.23456789; 13 | b = uv.y * 1.23456765; 14 | c.y = a-b; 15 | 16 | a = uv.y * -1.234567e-6; 17 | b = uv.y * -1.234565e-6; 18 | c.z = a-b; 19 | 20 | gl_FragColor = c; 21 | } 22 | -------------------------------------------------------------------------------- /tests/fragment/float-literals-out.txt: -------------------------------------------------------------------------------- 1 | varying vec2 uv; 2 | void main () 3 | { 4 | float b_1; 5 | float a_2; 6 | vec4 c_3; 7 | c_3.w = 0.0; 8 | a_2 = (uv.y * 1111111.0); 9 | b_1 = (uv.y * 1111110.0); 10 | c_3.x = (a_2 - b_1); 11 | a_2 = (uv.y * 1.234568); 12 | b_1 = (uv.y * 1.234568); 13 | c_3.y = (a_2 - b_1); 14 | a_2 = (uv.y * -1.234567e-06); 15 | b_1 = (uv.y * -1.234565e-06); 16 | c_3.z = (a_2 - b_1); 17 | gl_FragColor = c_3; 18 | } 19 | 20 | 21 | // stats: 10 alu 0 tex 0 flow 22 | // inputs: 1 23 | // #0: uv (high float) 2x1 [-1] 24 | -------------------------------------------------------------------------------- /tests/fragment/fragdepth-in.txt: -------------------------------------------------------------------------------- 1 | void xlat_main( out vec4 ocol, out float oz ) { 2 | ocol = vec4( 0.5); 3 | oz = 0.9; 4 | } 5 | void main() { 6 | vec4 xlt_ocol; 7 | float xlt_oz; 8 | xlat_main( xlt_ocol, xlt_oz); 9 | gl_FragData[0] = vec4(xlt_ocol); 10 | gl_FragDepth = float(xlt_oz); 11 | } 12 | -------------------------------------------------------------------------------- /tests/fragment/fragdepth-inES.txt: -------------------------------------------------------------------------------- 1 | #extension GL_EXT_frag_depth : require 2 | void xlat_main( out lowp vec4 ocol, out mediump float oz ) { 3 | ocol = vec4( 0.5); 4 | oz = 0.9; 5 | } 6 | void main() { 7 | lowp vec4 xlt_ocol; 8 | mediump float xlt_oz; 9 | xlat_main( xlt_ocol, xlt_oz); 10 | gl_FragData[0] = vec4(xlt_ocol); 11 | gl_FragDepthEXT = float(xlt_oz); 12 | } 13 | -------------------------------------------------------------------------------- /tests/fragment/fragdepth-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | void xlat_main( out lowp vec4 ocol, out mediump float oz ) { 3 | ocol = vec4( 0.5); 4 | oz = 0.9; 5 | } 6 | out lowp vec4 _fragData; 7 | void main() { 8 | lowp vec4 xlt_ocol; 9 | mediump float xlt_oz; 10 | xlat_main( xlt_ocol, xlt_oz); 11 | _fragData = vec4(xlt_ocol); 12 | gl_FragDepth = float(xlt_oz); 13 | } 14 | -------------------------------------------------------------------------------- /tests/fragment/fragdepth-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | gl_FragData[0] = vec4(0.5, 0.5, 0.5, 0.5); 4 | gl_FragDepth = 0.9; 5 | } 6 | 7 | 8 | // stats: 2 alu 0 tex 0 flow 9 | -------------------------------------------------------------------------------- /tests/fragment/fragdepth-outES.txt: -------------------------------------------------------------------------------- 1 | #extension GL_EXT_frag_depth : enable 2 | void main () 3 | { 4 | gl_FragData[0] = vec4(0.5, 0.5, 0.5, 0.5); 5 | gl_FragDepthEXT = 0.9; 6 | } 7 | 8 | 9 | // stats: 2 alu 0 tex 0 flow 10 | -------------------------------------------------------------------------------- /tests/fragment/fragdepth-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | out lowp vec4 _fragData; 3 | void main () 4 | { 5 | _fragData = vec4(0.5, 0.5, 0.5, 0.5); 6 | gl_FragDepth = 0.9; 7 | } 8 | 9 | 10 | // stats: 2 alu 0 tex 0 flow 11 | -------------------------------------------------------------------------------- /tests/fragment/fragdepth-outES3Metal.txt: -------------------------------------------------------------------------------- 1 | #include 2 | #pragma clang diagnostic ignored "-Wparentheses-equality" 3 | using namespace metal; 4 | struct xlatMtlShaderInput { 5 | }; 6 | struct xlatMtlShaderOutput { 7 | float gl_FragDepth [[depth(any)]]; 8 | half4 _fragData [[color(0)]]; 9 | }; 10 | struct xlatMtlShaderUniform { 11 | }; 12 | fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) 13 | { 14 | xlatMtlShaderOutput _mtl_o; 15 | _mtl_o._fragData = half4(float4(0.5, 0.5, 0.5, 0.5)); 16 | _mtl_o.gl_FragDepth = 0.9; 17 | return _mtl_o; 18 | } 19 | 20 | 21 | // stats: 2 alu 0 tex 0 flow 22 | -------------------------------------------------------------------------------- /tests/fragment/framebuffer_fetch-inES.txt: -------------------------------------------------------------------------------- 1 | #extension GL_EXT_shader_framebuffer_fetch : require 2 | 3 | struct v2f { 4 | highp vec4 vertex; 5 | lowp vec4 color; 6 | }; 7 | void frag (in v2f i, inout lowp vec4 ocol) 8 | { 9 | ocol.xy = i.color.xy; 10 | ocol.z *= 2.0; 11 | } 12 | varying lowp vec4 xlv_TEXCOORD0; 13 | void main() { 14 | v2f xlt_i; 15 | xlt_i.vertex = vec4(0.0); 16 | xlt_i.color = vec4(xlv_TEXCOORD0); 17 | lowp vec4 xlt_ocol = vec4(gl_LastFragData[0]); 18 | frag (xlt_i, xlt_ocol); 19 | gl_FragData[0] = vec4(xlt_ocol); 20 | } 21 | -------------------------------------------------------------------------------- /tests/fragment/framebuffer_fetch-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | #extension GL_EXT_shader_framebuffer_fetch : require 3 | #define gl_FragColor _glesFragData[0] 4 | #define gl_FragData _glesFragData 5 | layout(location = 0) inout mediump vec4 _glesFragData[4]; 6 | 7 | struct v2f { 8 | highp vec4 vertex; 9 | lowp vec4 color; 10 | }; 11 | void frag (in v2f i, inout lowp vec4 ocol) 12 | { 13 | ocol.xy = i.color.xy; 14 | ocol.z *= 2.0; 15 | } 16 | in lowp vec4 xlv_TEXCOORD0; 17 | void main() { 18 | v2f xlt_i; 19 | xlt_i.vertex = vec4(0.0); 20 | xlt_i.color = vec4(xlv_TEXCOORD0); 21 | lowp vec4 xlt_ocol = vec4(gl_FragData[0]); 22 | frag (xlt_i, xlt_ocol); 23 | gl_FragData[0] = vec4(xlt_ocol); 24 | } 25 | -------------------------------------------------------------------------------- /tests/fragment/framebuffer_fetch-outES.txt: -------------------------------------------------------------------------------- 1 | #extension GL_EXT_shader_framebuffer_fetch : enable 2 | varying lowp vec4 xlv_TEXCOORD0; 3 | void main () 4 | { 5 | lowp vec4 xlt_ocol_1; 6 | mediump vec4 tmpvar_2; 7 | tmpvar_2 = gl_LastFragData[0]; 8 | xlt_ocol_1 = tmpvar_2; 9 | lowp vec4 ocol_3; 10 | ocol_3.w = xlt_ocol_1.w; 11 | ocol_3.xy = xlv_TEXCOORD0.xy; 12 | ocol_3.z = (xlt_ocol_1.z * 2.0); 13 | xlt_ocol_1 = ocol_3; 14 | gl_FragData[0] = ocol_3; 15 | } 16 | 17 | 18 | // stats: 1 alu 0 tex 0 flow 19 | // inputs: 2 20 | // #0: gl_LastFragData (medium float) 4x1 [4] loc 24 21 | // #1: xlv_TEXCOORD0 (low float) 4x1 [-1] 22 | -------------------------------------------------------------------------------- /tests/fragment/framebuffer_fetch-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | #extension GL_EXT_shader_framebuffer_fetch : enable 3 | layout(location=0) inout mediump vec4 _glesFragData[4]; 4 | in lowp vec4 xlv_TEXCOORD0; 5 | void main () 6 | { 7 | lowp vec4 xlt_ocol_1; 8 | mediump vec4 tmpvar_2; 9 | tmpvar_2 = _glesFragData[0]; 10 | xlt_ocol_1 = tmpvar_2; 11 | lowp vec4 ocol_3; 12 | ocol_3.w = xlt_ocol_1.w; 13 | ocol_3.xy = xlv_TEXCOORD0.xy; 14 | ocol_3.z = (xlt_ocol_1.z * 2.0); 15 | xlt_ocol_1 = ocol_3; 16 | _glesFragData[0] = ocol_3; 17 | } 18 | 19 | 20 | // stats: 1 alu 0 tex 0 flow 21 | // inputs: 1 22 | // #0: xlv_TEXCOORD0 (low float) 4x1 [-1] 23 | -------------------------------------------------------------------------------- /tests/fragment/glsl120-basic-in.txt: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | uniform float inInit = 13.0; // accept uniform initializers 4 | uniform mat4x3 nonSqMat; // non square matrices 5 | uniform vec4 uniInit = vec4(1.0,2.0,3.0,4.0); 6 | 7 | void main() 8 | { 9 | const float cosPI = cos(3.1415); // built-in calls in constant initializers 10 | 11 | vec4 v; 12 | v.x = 1.2f; // accepts 'f' suffix 13 | v.y = 5; // automatic int-to-float 14 | v.z = inInit; 15 | v.w = cosPI; 16 | v.x += nonSqMat[0][0]; 17 | 18 | float arr[4] = float[](1,2,3,4); // array initializer 19 | v.y += arr[0]; 20 | v.z += arr.length(); // array length 21 | 22 | v.w += uniInit.w; 23 | 24 | gl_FragColor = v; 25 | } 26 | -------------------------------------------------------------------------------- /tests/fragment/glsl120-basic-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | out lowp vec4 _fragData; 3 | 4 | uniform mat4x3 nonSqMat; // non square matrices 5 | 6 | 7 | void main() 8 | { 9 | const float cosPI = cos(3.1415); // built-in calls in constant initializers 10 | 11 | mediump vec4 v; 12 | v.x = 1.2f; // accepts 'f' suffix 13 | v.y = 5.0f; 14 | v.z = 0.0; 15 | v.w = cosPI; 16 | v.x += nonSqMat[0][0]; 17 | 18 | float arr[4] = float[](1,2,3,4); // array initializer 19 | v.y += arr[0]; 20 | v.z += float(arr.length()); // array length 21 | 22 | _fragData = v; 23 | } 24 | -------------------------------------------------------------------------------- /tests/fragment/glsl120-basic-out.txt: -------------------------------------------------------------------------------- 1 | #version 120 2 | uniform float inInit = 13.0; 3 | uniform mat4x3 nonSqMat; 4 | uniform vec4 uniInit = vec4(1.0, 2.0, 3.0, 4.0); 5 | void main () 6 | { 7 | vec4 v_1; 8 | v_1.x = (1.2 + nonSqMat[0].x); 9 | v_1.y = 6.0; 10 | v_1.z = (inInit + 4.0); 11 | v_1.w = (-1.0 + uniInit.w); 12 | gl_FragColor = v_1; 13 | } 14 | 15 | 16 | // stats: 4 alu 0 tex 0 flow 17 | // uniforms: 3 (total size: 0) 18 | // #0: inInit (high float) 1x1 [-1] 19 | // #1: nonSqMat (high float) 3x4 [-1] 20 | // #2: uniInit (high float) 4x1 [-1] 21 | -------------------------------------------------------------------------------- /tests/fragment/glsl120-basic-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | out lowp vec4 _fragData; 3 | uniform highp mat4x3 nonSqMat; 4 | void main () 5 | { 6 | mediump vec4 v_1; 7 | v_1.w = -1.0; 8 | v_1.x = (1.2 + nonSqMat[0].x); 9 | v_1.y = 6.0; 10 | v_1.z = 4.0; 11 | _fragData = v_1; 12 | } 13 | 14 | 15 | // stats: 4 alu 0 tex 0 flow 16 | // uniforms: 1 (total size: 0) 17 | // #0: nonSqMat (high float) 3x4 [-1] 18 | -------------------------------------------------------------------------------- /tests/fragment/glsl120-basic-outES3Metal.txt: -------------------------------------------------------------------------------- 1 | #include 2 | #pragma clang diagnostic ignored "-Wparentheses-equality" 3 | using namespace metal; 4 | struct xlatMtlShaderInput { 5 | }; 6 | struct xlatMtlShaderOutput { 7 | half4 _fragData [[color(0)]]; 8 | }; 9 | struct xlatMtlShaderUniform { 10 | float4x3 nonSqMat; 11 | }; 12 | fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) 13 | { 14 | xlatMtlShaderOutput _mtl_o; 15 | half4 v_1 = 0; 16 | v_1.w = half(-1.0); 17 | v_1.x = ((half)(1.2 + _mtl_u.nonSqMat[0].x)); 18 | v_1.y = half(6.0); 19 | v_1.z = half(4.0); 20 | _mtl_o._fragData = v_1; 21 | return _mtl_o; 22 | } 23 | 24 | 25 | // stats: 4 alu 0 tex 0 flow 26 | // uniforms: 1 (total size: 64) 27 | // #0: nonSqMat (high float) 3x4 [-1] loc 0 28 | -------------------------------------------------------------------------------- /tests/fragment/glsl140-basic-in.txt: -------------------------------------------------------------------------------- 1 | #version 140 2 | 3 | in vec4 col; 4 | 5 | out vec4 fragCol; 6 | 7 | void main(void) 8 | { 9 | fragCol = col; 10 | } 11 | -------------------------------------------------------------------------------- /tests/fragment/glsl140-basic-out.txt: -------------------------------------------------------------------------------- 1 | #version 140 2 | in vec4 col; 3 | out vec4 fragCol; 4 | void main () 5 | { 6 | fragCol = col; 7 | } 8 | 9 | 10 | // stats: 0 alu 0 tex 0 flow 11 | // inputs: 1 12 | // #0: col (high float) 4x1 [-1] 13 | -------------------------------------------------------------------------------- /tests/fragment/in-struct-ret-vals-in.txt: -------------------------------------------------------------------------------- 1 | struct v2f { 2 | vec4 pos; 3 | vec2 uv; 4 | vec4 color; 5 | }; 6 | vec4 xlat_main( in v2f i ); 7 | vec4 xlat_main( in v2f i ) { 8 | vec4 c; 9 | c = i.color; 10 | c.xy += i.uv; 11 | return c; 12 | } 13 | void main() { 14 | vec4 xl_retval; 15 | v2f xlt_i; 16 | xlt_i.pos = vec4(0.0); 17 | xlt_i.uv = vec2( gl_TexCoord[0]); 18 | xlt_i.color = vec4( gl_Color); 19 | xl_retval = xlat_main( xlt_i); 20 | gl_FragData[0] = vec4( xl_retval); 21 | } 22 | -------------------------------------------------------------------------------- /tests/fragment/in-struct-ret-vals-inES.txt: -------------------------------------------------------------------------------- 1 | struct v2f { 2 | highp vec4 pos; 3 | highp vec2 uv; 4 | highp vec4 color; 5 | }; 6 | mediump vec4 xlat_main( in v2f i ); 7 | mediump vec4 xlat_main( in v2f i ) { 8 | mediump vec4 c; 9 | c = i.color; 10 | c.xy += i.uv; 11 | return c; 12 | } 13 | varying highp vec2 xlv_TEXCOORD0; 14 | varying highp vec4 xlv_COLOR; 15 | void main() { 16 | mediump vec4 xl_retval; 17 | v2f xlt_i; 18 | xlt_i.pos = vec4(0.0); 19 | xlt_i.uv = vec2( xlv_TEXCOORD0); 20 | xlt_i.color = vec4( xlv_COLOR); 21 | xl_retval = xlat_main( xlt_i); 22 | gl_FragData[0] = vec4( xl_retval); 23 | } 24 | -------------------------------------------------------------------------------- /tests/fragment/in-struct-ret-vals-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | vec4 c_1; 4 | c_1.zw = gl_Color.zw; 5 | c_1.xy = (gl_Color.xy + gl_TexCoord[0].xy); 6 | gl_FragData[0] = c_1; 7 | } 8 | 9 | 10 | // stats: 1 alu 0 tex 0 flow 11 | // inputs: 2 12 | // #0: gl_Color (high float) 4x1 [-1] loc 1 13 | // #1: gl_TexCoord (high float) 4x1 [1] loc 4 14 | -------------------------------------------------------------------------------- /tests/fragment/in-struct-ret-vals-outES.txt: -------------------------------------------------------------------------------- 1 | varying highp vec2 xlv_TEXCOORD0; 2 | varying highp vec4 xlv_COLOR; 3 | void main () 4 | { 5 | mediump vec4 c_1; 6 | c_1 = xlv_COLOR; 7 | c_1.xy = (c_1.xy + xlv_TEXCOORD0); 8 | gl_FragData[0] = c_1; 9 | } 10 | 11 | 12 | // stats: 1 alu 0 tex 0 flow 13 | // inputs: 2 14 | // #0: xlv_TEXCOORD0 (high float) 2x1 [-1] 15 | // #1: xlv_COLOR (high float) 4x1 [-1] 16 | -------------------------------------------------------------------------------- /tests/fragment/in-vals-ret-vals-inES.txt: -------------------------------------------------------------------------------- 1 | mediump vec4 xlat_main( in highp vec2 uv, in highp vec4 color ); 2 | mediump vec4 xlat_main( in highp vec2 uv, in highp vec4 color ) { 3 | mediump vec4 c; 4 | c = color; 5 | c.xy += uv; 6 | return c; 7 | } 8 | varying highp vec2 xlv_TEXCOORD0; 9 | varying highp vec4 xlv_COLOR; 10 | void main() { 11 | mediump vec4 xl_retval; 12 | xl_retval = xlat_main( vec2(xlv_TEXCOORD0), vec4(xlv_COLOR)); 13 | gl_FragData[0] = vec4( xl_retval); 14 | } 15 | -------------------------------------------------------------------------------- /tests/fragment/in-vals-ret-vals-outES.txt: -------------------------------------------------------------------------------- 1 | varying highp vec2 xlv_TEXCOORD0; 2 | varying highp vec4 xlv_COLOR; 3 | void main () 4 | { 5 | mediump vec4 c_1; 6 | c_1 = xlv_COLOR; 7 | c_1.xy = (c_1.xy + xlv_TEXCOORD0); 8 | gl_FragData[0] = c_1; 9 | } 10 | 11 | 12 | // stats: 1 alu 0 tex 0 flow 13 | // inputs: 2 14 | // #0: xlv_TEXCOORD0 (high float) 2x1 [-1] 15 | // #1: xlv_COLOR (high float) 4x1 [-1] 16 | -------------------------------------------------------------------------------- /tests/fragment/loop-for-inES.txt: -------------------------------------------------------------------------------- 1 | struct v2f { 2 | highp vec2 uv; 3 | highp vec3 nl; 4 | }; 5 | uniform sampler2D _MainTex; 6 | uniform highp vec4 _TerrainTreeLightColors[4]; 7 | lowp vec4 xlat_main (in v2f i) { 8 | highp int j = 0; 9 | lowp vec4 col = texture2D( _MainTex, i.uv); 10 | mediump vec3 light = vec3(0.0); 11 | for ( ; (j < 3); (j++)) { 12 | light += col.xyz * i.nl[j] * _TerrainTreeLightColors[j].xyz; 13 | } 14 | return vec4(light, 1.0); 15 | } 16 | varying highp vec2 xlv_uv; 17 | varying highp vec3 xlv_nl; 18 | void main() { 19 | v2f i; 20 | i.uv = xlv_uv; 21 | i.nl = xlv_nl; 22 | gl_FragData[0] = xlat_main(i); 23 | } 24 | -------------------------------------------------------------------------------- /tests/fragment/loop-for-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | out lowp vec4 _fragData; 3 | struct v2f { 4 | highp vec2 uv; 5 | mediump vec3 nl; 6 | }; 7 | uniform sampler2D _MainTex; 8 | uniform mediump vec4 _TerrainTreeLightColors[4]; 9 | lowp vec4 xlat_main (in v2f i) { 10 | highp int j = 0; 11 | lowp vec4 col = texture( _MainTex, i.uv); 12 | mediump vec3 light = vec3(0.0); 13 | for ( ; (j < 3); (j++)) { 14 | light += col.xyz * i.nl[j] * _TerrainTreeLightColors[j].xyz; 15 | } 16 | return vec4(light, 1.0); 17 | } 18 | in highp vec2 xlv_uv; 19 | in mediump vec3 xlv_nl; 20 | void main() { 21 | v2f i; 22 | i.uv = xlv_uv; 23 | i.nl = xlv_nl; 24 | _fragData = xlat_main(i); 25 | } 26 | -------------------------------------------------------------------------------- /tests/fragment/loop-forafterdiscard-inES.txt: -------------------------------------------------------------------------------- 1 | struct v2f { 2 | highp vec2 uv; 3 | highp vec3 nl; 4 | }; 5 | uniform sampler2D _MainTex; 6 | uniform highp vec4 _TerrainTreeLightColors[4]; 7 | lowp vec4 xlat_main (in v2f i) { 8 | lowp vec4 col = texture2D( _MainTex, i.uv); 9 | if (col.w < 0.5) 10 | discard; 11 | mediump vec3 light = vec3(0.0); 12 | for (int j = 0; j < 3; ++j) { 13 | light += col.xyz * i.nl[j] * _TerrainTreeLightColors[j].xyz; 14 | } 15 | return vec4(light, 1.0); 16 | } 17 | varying highp vec2 xlv_uv; 18 | varying highp vec3 xlv_nl; 19 | void main() { 20 | v2f i; 21 | i.uv = xlv_uv; 22 | i.nl = xlv_nl; 23 | gl_FragData[0] = xlat_main(i); 24 | } 25 | -------------------------------------------------------------------------------- /tests/fragment/loop-forafterdiscard-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | out lowp vec4 _fragData; 3 | struct v2f { 4 | highp vec2 uv; 5 | mediump vec3 nl; 6 | }; 7 | uniform sampler2D _MainTex; 8 | uniform mediump vec4 _TerrainTreeLightColors[4]; 9 | lowp vec4 xlat_main (in v2f i) { 10 | lowp vec4 col = texture( _MainTex, i.uv); 11 | if (col.w < 0.5) 12 | discard; 13 | mediump vec3 light = vec3(0.0); 14 | for (int j = 0; j < 3; ++j) { 15 | light += col.xyz * i.nl[j] * _TerrainTreeLightColors[j].xyz; 16 | } 17 | return vec4(light, 1.0); 18 | } 19 | in highp vec2 xlv_uv; 20 | in mediump vec3 xlv_nl; 21 | void main() { 22 | v2f i; 23 | i.uv = xlv_uv; 24 | i.nl = xlv_nl; 25 | _fragData = xlat_main(i); 26 | } 27 | -------------------------------------------------------------------------------- /tests/fragment/loop-foraliasinductor-inES.txt: -------------------------------------------------------------------------------- 1 | struct v2f { 2 | highp vec2 uv; 3 | highp vec3 nl; 4 | }; 5 | uniform sampler2D _MainTex; 6 | uniform highp vec4 _TerrainTreeLightColors[4]; 7 | lowp vec4 xlat_main (in v2f i) { 8 | lowp vec4 col = texture2D( _MainTex, i.uv); 9 | mediump vec3 light = vec3(0.0); 10 | if(col.x >= 0.0) { 11 | for (float j = 0.0; (j < i.uv.x); (j++)) { 12 | light += col.xyz; 13 | } 14 | } 15 | if(col.x >= 1.0) { 16 | float j = i.uv.y; 17 | j *= sin(j); 18 | light += col.xyz*j; 19 | } 20 | return vec4(light, 1.0); 21 | } 22 | varying highp vec2 xlv_uv; 23 | varying highp vec3 xlv_nl; 24 | void main() { 25 | v2f i; 26 | i.uv = xlv_uv; 27 | i.nl = xlv_nl; 28 | gl_FragData[0] = xlat_main(i); 29 | } 30 | -------------------------------------------------------------------------------- /tests/fragment/loop-forarounddiscard-inES.txt: -------------------------------------------------------------------------------- 1 | struct v2f { 2 | highp vec2 uv; 3 | highp vec3 nl; 4 | }; 5 | uniform sampler2D _MainTex; 6 | uniform highp vec4 _TerrainTreeLightColors[4]; 7 | lowp vec4 xlat_main (in v2f i) { 8 | highp int j = 0; // loop init before discard 9 | lowp vec4 col = texture2D( _MainTex, i.uv); 10 | if (col.w < 0.5) 11 | discard; 12 | mediump vec3 light = vec3(0.0); 13 | for ( ; (j < 3); (j++)) { // loop body after discard 14 | light += col.xyz * i.nl[j] * _TerrainTreeLightColors[j].xyz; 15 | } 16 | return vec4(light, 1.0); 17 | } 18 | varying highp vec2 xlv_uv; 19 | varying highp vec3 xlv_nl; 20 | void main() { 21 | v2f i; 22 | i.uv = xlv_uv; 23 | i.nl = xlv_nl; 24 | gl_FragData[0] = xlat_main(i); 25 | } 26 | -------------------------------------------------------------------------------- /tests/fragment/loop-fornounroll-inES.txt: -------------------------------------------------------------------------------- 1 | void main() { 2 | int i = 0; 3 | float f = 0.0; 4 | for (; i < 32; (++i)) 5 | f += gl_FragCoord.x * float(i); 6 | gl_FragColor = vec4(f); 7 | } 8 | -------------------------------------------------------------------------------- /tests/fragment/loop-fornounroll-outES.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | highp float f_1; 4 | f_1 = 0.0; 5 | for (highp int i_2 = 0; i_2 < 32; i_2++) { 6 | f_1 = (f_1 + (gl_FragCoord.x * float(i_2))); 7 | }; 8 | highp vec4 tmpvar_3; 9 | tmpvar_3 = vec4(f_1); 10 | gl_FragColor = tmpvar_3; 11 | } 12 | 13 | 14 | // stats: 7 alu 0 tex 2 flow 15 | // inputs: 1 16 | // #0: gl_FragCoord (high float) 4x1 [-1] loc 0 17 | -------------------------------------------------------------------------------- /tests/fragment/loop-forunbounded-inES.txt: -------------------------------------------------------------------------------- 1 | struct v2f { 2 | highp vec2 uv; 3 | highp vec3 nl; 4 | }; 5 | uniform sampler2D _MainTex; 6 | uniform highp vec4 _TerrainTreeLightColors[4]; 7 | lowp vec4 xlat_main (in v2f i) { 8 | lowp vec4 col = texture2D( _MainTex, i.uv); 9 | mediump vec3 light = vec3(0.0); 10 | int loopCount = int(col.a*10.0); 11 | for (int j = 0; j < loopCount; ++j) 12 | { 13 | light += col.xyz * i.nl[j] * _TerrainTreeLightColors[j].xyz; 14 | } 15 | return vec4(light, 1.0); 16 | } 17 | varying highp vec2 xlv_uv; 18 | varying highp vec3 xlv_nl; 19 | void main() { 20 | v2f i; 21 | i.uv = xlv_uv; 22 | i.nl = xlv_nl; 23 | gl_FragData[0] = xlat_main(i); 24 | } 25 | -------------------------------------------------------------------------------- /tests/fragment/loop-forvariants-in.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D mainTex; 2 | varying vec2 uv; 3 | 4 | void main() 5 | { 6 | vec4 c = vec4(0.0); 7 | 8 | // various loop forms 9 | for (int i = 0; i < 100; ++i) 10 | c.x += texture2D (mainTex, uv + vec2(i,i)).r; 11 | for (int i = 0; i <= 100; i += 3) 12 | c.x += texture2D (mainTex, uv + vec2(i,i)).r; 13 | for (int i = 100; i >= 0; --i) 14 | c.x += texture2D (mainTex, uv + vec2(i,i)).r; 15 | int n = int(c.x * 10.0); 16 | for (int i = 3; i < n; ++i) 17 | c.x += texture2D (mainTex, uv + vec2(i,i)).r; 18 | for (int i = 1, j = 2; i < 100 && j < 50; i += 2, j += 3) 19 | c.x += texture2D (mainTex, uv + vec2(i,j)).r; 20 | gl_FragColor = c; 21 | } 22 | -------------------------------------------------------------------------------- /tests/fragment/loop-forwronginductor-inES.txt: -------------------------------------------------------------------------------- 1 | struct v2f { 2 | highp vec2 uv; 3 | highp vec3 nl; 4 | }; 5 | uniform sampler2D _MainTex; 6 | uniform highp vec4 _TerrainTreeLightColors[4]; 7 | lowp vec4 xlat_main (in v2f i) { 8 | lowp vec4 col = texture2D( _MainTex, i.uv); 9 | mediump vec3 light = vec3(0.0); 10 | if(col.x >= 0.0) { 11 | for (float j = 0.0; (j < i.uv.x); (j++)) { 12 | light += col.xyz; 13 | } 14 | } 15 | return vec4(light, 1.0); 16 | } 17 | varying highp vec2 xlv_uv; 18 | varying highp vec3 xlv_nl; 19 | void main() { 20 | v2f i; 21 | i.uv = xlv_uv; 22 | i.nl = xlv_nl; 23 | gl_FragData[0] = xlat_main(i); 24 | } 25 | -------------------------------------------------------------------------------- /tests/fragment/loop-forwronginductor-outES.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | varying highp vec2 xlv_uv; 3 | void main () 4 | { 5 | lowp vec4 tmpvar_1; 6 | highp vec2 tmpvar_2; 7 | tmpvar_2 = xlv_uv; 8 | mediump vec3 light_3; 9 | lowp vec4 col_4; 10 | lowp vec4 tmpvar_5; 11 | tmpvar_5 = texture2D (_MainTex, xlv_uv); 12 | col_4 = tmpvar_5; 13 | light_3 = vec3(0.0, 0.0, 0.0); 14 | if ((tmpvar_5.x >= 0.0)) { 15 | for (highp float j_6 = 0.0; j_6 < tmpvar_2.x; j_6 += 1.0) { 16 | light_3 = (light_3 + col_4.xyz); 17 | }; 18 | }; 19 | mediump vec4 tmpvar_7; 20 | tmpvar_7.w = 1.0; 21 | tmpvar_7.xyz = light_3; 22 | tmpvar_1 = tmpvar_7; 23 | gl_FragData[0] = tmpvar_1; 24 | } 25 | 26 | 27 | // stats: 7 alu 1 tex 3 flow 28 | // inputs: 1 29 | // #0: xlv_uv (high float) 2x1 [-1] 30 | // textures: 1 31 | // #0: _MainTex (low 2d) 0x0 [-1] 32 | -------------------------------------------------------------------------------- /tests/fragment/mrt-in.txt: -------------------------------------------------------------------------------- 1 | void main() 2 | { 3 | gl_FragData[0] = vec4(0.0); 4 | gl_FragData[1] = vec4(0.1); 5 | gl_FragData[2] = vec4(0.2); 6 | gl_FragData[3] = vec4(0.3); 7 | } 8 | -------------------------------------------------------------------------------- /tests/fragment/mrt-inES.txt: -------------------------------------------------------------------------------- 1 | #extension GL_EXT_draw_buffers : require 2 | 3 | void main() 4 | { 5 | gl_FragData[0] = vec4(0.0); 6 | gl_FragData[1] = vec4(0.1); 7 | gl_FragData[2] = vec4(0.2); 8 | gl_FragData[3] = vec4(0.3); 9 | } 10 | -------------------------------------------------------------------------------- /tests/fragment/mrt-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | out lowp vec4 _fragData[4]; 3 | void main() 4 | { 5 | _fragData[0] = vec4(0.0); 6 | _fragData[1] = vec4(0.1); 7 | _fragData[2] = vec4(0.2); 8 | _fragData[3] = vec4(0.3); 9 | } 10 | -------------------------------------------------------------------------------- /tests/fragment/mrt-mixed-array-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | 3 | // Defines output as an array (uses only 1st index), 4 | // and two vectors (1st unused). 5 | layout(location = 0) out mediump vec4 _colArr[2]; 6 | layout(location = 2) out mediump vec4 _colVecUnused; 7 | layout(location = 3) out mediump vec4 _colVec; 8 | 9 | void main() 10 | { 11 | _colArr[0] = vec4(0.0); 12 | _colVec = vec4(1.0); 13 | } 14 | -------------------------------------------------------------------------------- /tests/fragment/mrt-mixed-array-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | layout(location=0) out mediump vec4 _colArr[2]; 3 | layout(location=3) out mediump vec4 _colVec; 4 | void main () 5 | { 6 | _colArr[0] = vec4(0.0, 0.0, 0.0, 0.0); 7 | _colVec = vec4(1.0, 1.0, 1.0, 1.0); 8 | } 9 | 10 | 11 | // stats: 2 alu 0 tex 0 flow 12 | -------------------------------------------------------------------------------- /tests/fragment/mrt-mixed-array-outES3Metal.txt: -------------------------------------------------------------------------------- 1 | #include 2 | #pragma clang diagnostic ignored "-Wparentheses-equality" 3 | using namespace metal; 4 | struct xlatMtlShaderInput { 5 | }; 6 | struct xlatMtlShaderOutput { 7 | half4 _colArr_0 [[color(0)]]; 8 | half4 _colVec [[color(3)]]; 9 | }; 10 | struct xlatMtlShaderUniform { 11 | }; 12 | fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) 13 | { 14 | xlatMtlShaderOutput _mtl_o; 15 | _mtl_o._colArr_0 = half4(float4(0.0, 0.0, 0.0, 0.0)); 16 | _mtl_o._colVec = half4(float4(1.0, 1.0, 1.0, 1.0)); 17 | return _mtl_o; 18 | } 19 | 20 | 21 | // stats: 2 alu 0 tex 0 flow 22 | -------------------------------------------------------------------------------- /tests/fragment/mrt-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0); 4 | gl_FragData[1] = vec4(0.1, 0.1, 0.1, 0.1); 5 | gl_FragData[2] = vec4(0.2, 0.2, 0.2, 0.2); 6 | gl_FragData[3] = vec4(0.3, 0.3, 0.3, 0.3); 7 | } 8 | 9 | 10 | // stats: 4 alu 0 tex 0 flow 11 | -------------------------------------------------------------------------------- /tests/fragment/mrt-outES.txt: -------------------------------------------------------------------------------- 1 | #extension GL_EXT_draw_buffers : enable 2 | void main () 3 | { 4 | gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0); 5 | gl_FragData[1] = vec4(0.1, 0.1, 0.1, 0.1); 6 | gl_FragData[2] = vec4(0.2, 0.2, 0.2, 0.2); 7 | gl_FragData[3] = vec4(0.3, 0.3, 0.3, 0.3); 8 | } 9 | 10 | 11 | // stats: 4 alu 0 tex 0 flow 12 | -------------------------------------------------------------------------------- /tests/fragment/mrt-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | out lowp vec4 _fragData[4]; 3 | void main () 4 | { 5 | _fragData[0] = vec4(0.0, 0.0, 0.0, 0.0); 6 | _fragData[1] = vec4(0.1, 0.1, 0.1, 0.1); 7 | _fragData[2] = vec4(0.2, 0.2, 0.2, 0.2); 8 | _fragData[3] = vec4(0.3, 0.3, 0.3, 0.3); 9 | } 10 | 11 | 12 | // stats: 4 alu 0 tex 0 flow 13 | -------------------------------------------------------------------------------- /tests/fragment/mrt-unused-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | 3 | // Defines output as an array of 4 colors, 4 | // but writes to only one. 5 | #define gl_FragColor _glesFragData[0] 6 | #define gl_FragData _glesFragData 7 | layout(location = 0) out mediump vec4 _glesFragData[4]; 8 | 9 | uniform highp vec4 _Color; 10 | in lowp vec4 xlv_COLOR0; 11 | 12 | void main() { 13 | lowp vec4 c = xlv_COLOR0 * _Color; 14 | gl_FragData[0] = c; 15 | } 16 | -------------------------------------------------------------------------------- /tests/fragment/mrt-unused-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | layout(location=0) out mediump vec4 _glesFragData[4]; 3 | uniform highp vec4 _Color; 4 | in lowp vec4 xlv_COLOR0; 5 | void main () 6 | { 7 | lowp vec4 c_1; 8 | highp vec4 tmpvar_2; 9 | tmpvar_2 = (xlv_COLOR0 * _Color); 10 | c_1 = tmpvar_2; 11 | _glesFragData[0] = c_1; 12 | } 13 | 14 | 15 | // stats: 1 alu 0 tex 0 flow 16 | // inputs: 1 17 | // #0: xlv_COLOR0 (low float) 4x1 [-1] 18 | // uniforms: 1 (total size: 0) 19 | // #0: _Color (high float) 4x1 [-1] 20 | -------------------------------------------------------------------------------- /tests/fragment/nested-inlining-in.txt: -------------------------------------------------------------------------------- 1 | 2 | void xll_clip(float x) { 3 | if ( x<0.0 ) discard; 4 | } 5 | 6 | uniform vec3 uniVal; 7 | 8 | void main() { 9 | vec2 val; 10 | bool useZero = uniVal.x > 1.; 11 | if (useZero){ 12 | gl_FragData[0] = vec4(0.); 13 | } 14 | else{ 15 | val = uniVal.xy; 16 | xll_clip( (0.00100000 - val.x ) ); 17 | xll_clip( (0.00100000 - val.y ) ); 18 | gl_FragData[0] = vec4(1.); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/fragment/nested-inlining-out.txt: -------------------------------------------------------------------------------- 1 | uniform vec3 uniVal; 2 | void main () 3 | { 4 | if ((uniVal.x > 1.0)) { 5 | gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0); 6 | } else { 7 | float x_1; 8 | x_1 = (0.001 - uniVal.x); 9 | if ((x_1 < 0.0)) { 10 | discard; 11 | }; 12 | float x_2; 13 | x_2 = (0.001 - uniVal.y); 14 | if ((x_2 < 0.0)) { 15 | discard; 16 | }; 17 | gl_FragData[0] = vec4(1.0, 1.0, 1.0, 1.0); 18 | }; 19 | } 20 | 21 | 22 | // stats: 7 alu 2 tex 3 flow 23 | // uniforms: 1 (total size: 0) 24 | // #0: uniVal (high float) 3x1 [-1] 25 | -------------------------------------------------------------------------------- /tests/fragment/opt-copyprop-struct-in.txt: -------------------------------------------------------------------------------- 1 | struct v2f { 2 | float f; 3 | }; 4 | varying float var; 5 | void main() { 6 | v2f i; 7 | i.f = var; 8 | v2f i2 = i; 9 | gl_FragColor = vec4(abs(i2.f)); 10 | } 11 | -------------------------------------------------------------------------------- /tests/fragment/opt-copyprop-struct-out.txt: -------------------------------------------------------------------------------- 1 | varying float var; 2 | void main () 3 | { 4 | gl_FragColor = vec4(abs(var)); 5 | } 6 | 7 | 8 | // stats: 1 alu 0 tex 0 flow 9 | // inputs: 1 10 | // #0: var (high float) 1x1 [-1] 11 | -------------------------------------------------------------------------------- /tests/fragment/opt-copypropelems-swizzle-in.txt: -------------------------------------------------------------------------------- 1 | varying vec2 uv; 2 | uniform sampler2D tex; 3 | void main() { 4 | vec4 v = texture2D (tex, uv); 5 | v.xy = v.yx; 6 | v.x = -v.x; 7 | gl_FragColor = v; 8 | } 9 | -------------------------------------------------------------------------------- /tests/fragment/opt-copypropelems-swizzle-out.txt: -------------------------------------------------------------------------------- 1 | varying vec2 uv; 2 | uniform sampler2D tex; 3 | void main () 4 | { 5 | vec4 v_1; 6 | vec4 tmpvar_2; 7 | tmpvar_2 = texture2D (tex, uv); 8 | v_1.zw = tmpvar_2.zw; 9 | v_1.y = tmpvar_2.x; 10 | v_1.x = -(tmpvar_2.y); 11 | gl_FragColor = v_1; 12 | } 13 | 14 | 15 | // stats: 1 alu 1 tex 0 flow 16 | // inputs: 1 17 | // #0: uv (high float) 2x1 [-1] 18 | // textures: 1 19 | // #0: tex (high 2d) 0x0 [-1] 20 | -------------------------------------------------------------------------------- /tests/fragment/opt-dead-texloads-in.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | 3 | // presence of inout parameters with discard used inside 4 | // the function, and the variables not being trivially the same 5 | // type (vec4 vs vec3), can cause the actually unused 6 | // texture sample to be left in. 7 | void surf (vec2 uv, inout vec3 oo) 8 | { 9 | if (uv.x < 0.0) 10 | discard; 11 | oo = texture2D(_MainTex, uv).xyz; 12 | } 13 | 14 | void main() 15 | { 16 | vec3 oo; 17 | surf(gl_TexCoord[0].xy, oo); 18 | 19 | gl_FragData[0] = vec4(0.5); 20 | } 21 | -------------------------------------------------------------------------------- /tests/fragment/opt-dead-texloads-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | vec2 uv_1; 4 | uv_1 = gl_TexCoord[0].xy; 5 | if ((uv_1.x < 0.0)) { 6 | discard; 7 | }; 8 | gl_FragData[0] = vec4(0.5, 0.5, 0.5, 0.5); 9 | } 10 | 11 | 12 | // stats: 2 alu 1 tex 1 flow 13 | // inputs: 1 14 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 15 | -------------------------------------------------------------------------------- /tests/fragment/opt-dead-texloadstreeshadow-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | layout(location=0) out mediump vec4 _glesFragData[4]; 3 | void main () 4 | { 5 | _glesFragData[0] = vec4(0.0, 0.0, 0.0, 0.0); 6 | } 7 | 8 | 9 | // stats: 1 alu 0 tex 0 flow 10 | -------------------------------------------------------------------------------- /tests/fragment/opt-dead-texloadstreeshadow-outES3Metal.txt: -------------------------------------------------------------------------------- 1 | #include 2 | #pragma clang diagnostic ignored "-Wparentheses-equality" 3 | using namespace metal; 4 | struct xlatMtlShaderInput { 5 | }; 6 | struct xlatMtlShaderOutput { 7 | half4 _glesFragData_0 [[color(0)]]; 8 | }; 9 | struct xlatMtlShaderUniform { 10 | }; 11 | fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) 12 | { 13 | xlatMtlShaderOutput _mtl_o; 14 | _mtl_o._glesFragData_0 = half4(float4(0.0, 0.0, 0.0, 0.0)); 15 | return _mtl_o; 16 | } 17 | 18 | 19 | // stats: 1 alu 0 tex 0 flow 20 | -------------------------------------------------------------------------------- /tests/fragment/opt-deadcode-in.txt: -------------------------------------------------------------------------------- 1 | struct v2f { 2 | vec4 pos; 3 | float unusedmember; 4 | }; 5 | void main() { 6 | float f = gl_FragCoord.x; 7 | 8 | v2f sused; 9 | sused.pos = vec4(f); 10 | sused.unusedmember = f*6.0; 11 | v2f sunused; 12 | sunused.pos = vec4(f); 13 | sunused.unusedmember = f*7.0; 14 | 15 | float fused = f*2.0; 16 | float funused = f*3.0; 17 | 18 | float arrused[3]; 19 | arrused[0] = f*4.0; 20 | float arrunused[3]; 21 | arrunused[0] = f*5.0; 22 | 23 | gl_FragColor = vec4(fused+sused.pos.x+arrused[0]); 24 | } 25 | -------------------------------------------------------------------------------- /tests/fragment/opt-deadcode-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | gl_FragColor = vec4((((gl_FragCoord.x * 2.0) + gl_FragCoord.x) + (gl_FragCoord.x * 4.0))); 4 | } 5 | 6 | 7 | // stats: 4 alu 0 tex 0 flow 8 | // inputs: 1 9 | // #0: gl_FragCoord (high float) 4x1 [-1] loc 0 10 | -------------------------------------------------------------------------------- /tests/fragment/opt-deadcodestruct-in.txt: -------------------------------------------------------------------------------- 1 | struct foo { 2 | float used; 3 | float unused; 4 | }; 5 | void main() { 6 | float f = 1.0; 7 | foo s; 8 | s.used = f; 9 | s.unused = f; 10 | gl_FragColor = vec4(s.used); 11 | } 12 | -------------------------------------------------------------------------------- /tests/fragment/opt-deadcodestruct-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); 4 | } 5 | 6 | 7 | // stats: 1 alu 0 tex 0 flow 8 | -------------------------------------------------------------------------------- /tests/fragment/opt-grafting-precision-inES.txt: -------------------------------------------------------------------------------- 1 | varying lowp vec3 normal; 2 | varying lowp vec3 halfDir; 3 | uniform mediump float specPower; 4 | 5 | void main() 6 | { 7 | lowp float nh = dot (normal, halfDir); 8 | mediump float spec = pow (nh, specPower); 9 | 10 | lowp vec4 c; 11 | c = vec4(spec); 12 | gl_FragColor = c; 13 | } 14 | -------------------------------------------------------------------------------- /tests/fragment/opt-grafting-precision-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | out lowp vec4 _fragData; 3 | in lowp vec3 normal; 4 | in lowp vec3 halfDir; 5 | uniform mediump float specPower; 6 | 7 | void main() 8 | { 9 | lowp float nh = dot (normal, halfDir); 10 | mediump float spec = pow (nh, specPower); 11 | 12 | lowp vec4 c; 13 | c = vec4(spec); 14 | _fragData = c; 15 | } 16 | -------------------------------------------------------------------------------- /tests/fragment/opt-grafting-precision-outES.txt: -------------------------------------------------------------------------------- 1 | varying lowp vec3 normal; 2 | varying lowp vec3 halfDir; 3 | uniform mediump float specPower; 4 | void main () 5 | { 6 | lowp vec4 c_1; 7 | lowp float tmpvar_2; 8 | tmpvar_2 = dot (normal, halfDir); 9 | mediump vec4 tmpvar_3; 10 | tmpvar_3 = vec4(pow (tmpvar_2, specPower)); 11 | c_1 = tmpvar_3; 12 | gl_FragColor = c_1; 13 | } 14 | 15 | 16 | // stats: 2 alu 0 tex 0 flow 17 | // inputs: 2 18 | // #0: normal (low float) 3x1 [-1] 19 | // #1: halfDir (low float) 3x1 [-1] 20 | // uniforms: 1 (total size: 0) 21 | // #0: specPower (medium float) 1x1 [-1] 22 | -------------------------------------------------------------------------------- /tests/fragment/opt-grafting-precision-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | out lowp vec4 _fragData; 3 | in lowp vec3 normal; 4 | in lowp vec3 halfDir; 5 | uniform mediump float specPower; 6 | void main () 7 | { 8 | lowp vec4 c_1; 9 | lowp float tmpvar_2; 10 | tmpvar_2 = dot (normal, halfDir); 11 | mediump vec4 tmpvar_3; 12 | tmpvar_3 = vec4(pow (tmpvar_2, specPower)); 13 | c_1 = tmpvar_3; 14 | _fragData = c_1; 15 | } 16 | 17 | 18 | // stats: 2 alu 0 tex 0 flow 19 | // inputs: 2 20 | // #0: normal (low float) 3x1 [-1] 21 | // #1: halfDir (low float) 3x1 [-1] 22 | // uniforms: 1 (total size: 0) 23 | // #0: specPower (medium float) 1x1 [-1] 24 | -------------------------------------------------------------------------------- /tests/fragment/opt-ifs-in.txt: -------------------------------------------------------------------------------- 1 | void main() { 2 | vec4 c = vec4(0.0); 3 | 4 | // nested ifs 5 | if (gl_FragCoord.x > 0.5) { 6 | if (gl_FragCoord.y > 0.5) { 7 | c = vec4(0.5); 8 | } 9 | } 10 | gl_FragColor = c; 11 | } 12 | -------------------------------------------------------------------------------- /tests/fragment/opt-ifs-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | vec4 c_1; 4 | c_1 = vec4(0.0, 0.0, 0.0, 0.0); 5 | if (((gl_FragCoord.x > 0.5) && (gl_FragCoord.y > 0.5))) { 6 | c_1 = vec4(0.5, 0.5, 0.5, 0.5); 7 | }; 8 | gl_FragColor = c_1; 9 | } 10 | 11 | 12 | // stats: 5 alu 0 tex 1 flow 13 | // inputs: 1 14 | // #0: gl_FragCoord (high float) 4x1 [-1] loc 0 15 | -------------------------------------------------------------------------------- /tests/fragment/opt-inline-inoutstruct-in.txt: -------------------------------------------------------------------------------- 1 | struct SurfaceOutput { 2 | vec4 color; 3 | }; 4 | void surf(inout SurfaceOutput o) { 5 | o.color = vec4(1); 6 | } 7 | void main() { 8 | SurfaceOutput o; 9 | surf(o); 10 | gl_FragColor = o.color; 11 | } 12 | -------------------------------------------------------------------------------- /tests/fragment/opt-inline-inoutstruct-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); 4 | } 5 | 6 | 7 | // stats: 1 alu 0 tex 0 flow 8 | -------------------------------------------------------------------------------- /tests/fragment/opt-movevars-sideeffect-inES.txt: -------------------------------------------------------------------------------- 1 | varying lowp float xx; 2 | 3 | int func(inout float x) 4 | { 5 | x = x*2.0; 6 | return 0; 7 | } 8 | 9 | void main() 10 | { 11 | lowp float x = xx; 12 | 13 | int i = func(x); // side effects! 14 | 15 | if (x < 0.0) 16 | discard; 17 | 18 | lowp float c = 0.0; 19 | for (; i < 4; ++i) 20 | c += xx; 21 | gl_FragColor = vec4(c); 22 | } 23 | -------------------------------------------------------------------------------- /tests/fragment/opt-movevars-sideeffect-outES.txt: -------------------------------------------------------------------------------- 1 | varying lowp float xx; 2 | void main () 3 | { 4 | lowp float c_1; 5 | lowp float x_2; 6 | x_2 = (xx * 2.0); 7 | if ((x_2 < 0.0)) { 8 | discard; 9 | }; 10 | c_1 = (xx + xx); 11 | c_1 = (c_1 + xx); 12 | c_1 = (c_1 + xx); 13 | lowp vec4 tmpvar_3; 14 | tmpvar_3 = vec4(c_1); 15 | gl_FragColor = tmpvar_3; 16 | } 17 | 18 | 19 | // stats: 5 alu 1 tex 1 flow 20 | // inputs: 1 21 | // #0: xx (low float) 1x1 [-1] 22 | -------------------------------------------------------------------------------- /tests/fragment/opt-movevars-sideeffect2-inES.txt: -------------------------------------------------------------------------------- 1 | varying lowp float xx; 2 | 3 | void main() 4 | { 5 | int x; 6 | 7 | int i = (x=(xx>0.5?2:4)); // side effects! 8 | 9 | if (x < 2) 10 | discard; 11 | 12 | lowp float c = 0.0; 13 | for (; i < 4; ++i) 14 | c += xx; 15 | gl_FragColor = vec4(c); 16 | } 17 | -------------------------------------------------------------------------------- /tests/fragment/opt-movevars-sideeffect2-outES.txt: -------------------------------------------------------------------------------- 1 | varying lowp float xx; 2 | void main () 3 | { 4 | lowp float c_1; 5 | highp int tmpvar_3; 6 | if ((xx > 0.5)) { 7 | tmpvar_3 = 2; 8 | } else { 9 | tmpvar_3 = 4; 10 | }; 11 | if ((tmpvar_3 < 2)) { 12 | discard; 13 | }; 14 | c_1 = 0.0; 15 | for (highp int i_2 = tmpvar_3; i_2 < 4; i_2++) { 16 | c_1 = (c_1 + xx); 17 | }; 18 | lowp vec4 tmpvar_4; 19 | tmpvar_4 = vec4(c_1); 20 | gl_FragColor = tmpvar_4; 21 | } 22 | 23 | 24 | // stats: 8 alu 1 tex 4 flow 25 | // inputs: 1 26 | // #0: xx (low float) 1x1 [-1] 27 | -------------------------------------------------------------------------------- /tests/fragment/opt-movevars-simple-inES.txt: -------------------------------------------------------------------------------- 1 | varying lowp float xx; 2 | 3 | void main() 4 | { 5 | int i = 0; 6 | 7 | if (xx < 0.0) 8 | discard; 9 | 10 | lowp float c = 0.0; 11 | for (; i < 4; ++i) 12 | c += xx; 13 | gl_FragColor = vec4(c); 14 | } 15 | -------------------------------------------------------------------------------- /tests/fragment/opt-movevars-simple-outES.txt: -------------------------------------------------------------------------------- 1 | varying lowp float xx; 2 | void main () 3 | { 4 | lowp float c_1; 5 | if ((xx < 0.0)) { 6 | discard; 7 | }; 8 | c_1 = (xx + xx); 9 | c_1 = (c_1 + xx); 10 | c_1 = (c_1 + xx); 11 | lowp vec4 tmpvar_2; 12 | tmpvar_2 = vec4(c_1); 13 | gl_FragColor = tmpvar_2; 14 | } 15 | 16 | 17 | // stats: 4 alu 1 tex 1 flow 18 | // inputs: 1 19 | // #0: xx (low float) 1x1 [-1] 20 | -------------------------------------------------------------------------------- /tests/fragment/opt-vec-var-index-in.txt: -------------------------------------------------------------------------------- 1 | void main() { 2 | vec2 c = vec2(0.0); 3 | for (int j = 0; j < 2; ++j) { 4 | c += abs (vec2(vec2(0.0)[j])); 5 | } 6 | gl_FragColor = vec4(c,0.0,0.0); 7 | } 8 | -------------------------------------------------------------------------------- /tests/fragment/opt-vec-var-index-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | vec4 tmpvar_1; 4 | tmpvar_1.zw = vec2(0.0, 0.0); 5 | tmpvar_1.xy = vec2(0.0, 0.0); 6 | gl_FragColor = tmpvar_1; 7 | } 8 | 9 | 10 | // stats: 2 alu 0 tex 0 flow 11 | -------------------------------------------------------------------------------- /tests/fragment/opt-vectorize-ifs-in.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D maintex; 2 | uniform float factor; 3 | varying vec2 uv; 4 | void main() 5 | { 6 | vec4 c = texture2D (maintex, uv); 7 | vec2 coord = c.xy; 8 | bool cond = c.w >= 0.5; 9 | if (!cond) 10 | coord.x += factor; 11 | if (cond) 12 | coord.y += factor; 13 | gl_FragColor = vec4(coord,0,0); 14 | } 15 | -------------------------------------------------------------------------------- /tests/fragment/opt-vectorize-ifs-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D maintex; 2 | uniform float factor; 3 | varying vec2 uv; 4 | void main () 5 | { 6 | vec2 coord_1; 7 | vec4 tmpvar_2; 8 | tmpvar_2 = texture2D (maintex, uv); 9 | coord_1 = tmpvar_2.xy; 10 | bool tmpvar_3; 11 | tmpvar_3 = (tmpvar_2.w >= 0.5); 12 | if (!(tmpvar_3)) { 13 | coord_1.x = (tmpvar_2.x + factor); 14 | }; 15 | if (tmpvar_3) { 16 | coord_1.y = (tmpvar_2.y + factor); 17 | }; 18 | vec4 tmpvar_4; 19 | tmpvar_4.zw = vec2(0.0, 0.0); 20 | tmpvar_4.xy = coord_1; 21 | gl_FragColor = tmpvar_4; 22 | } 23 | 24 | 25 | // stats: 5 alu 1 tex 2 flow 26 | // inputs: 1 27 | // #0: uv (high float) 2x1 [-1] 28 | // uniforms: 1 (total size: 0) 29 | // #0: factor (high float) 1x1 [-1] 30 | // textures: 1 31 | // #0: maintex (high 2d) 0x0 [-1] 32 | -------------------------------------------------------------------------------- /tests/fragment/opt-vectorize-retval-in.txt: -------------------------------------------------------------------------------- 1 | uniform float _Fresnel; 2 | uniform float _SpecIntensity; 3 | float saturate (float f) { return max(0.0, min(1.0,f)); } 4 | float splineFresnel (in vec3 N, in vec3 E, in float specIntensity, in float fresnel) 5 | { 6 | float factor = (1.0 - saturate(dot(N,E))); 7 | float factor3 = ((factor * factor) * factor); 8 | vec3 p = vec3(1.0, factor, factor3); 9 | vec2 t = vec2(1.0 - fresnel, fresnel); 10 | p.x = dot(p.xy, t); 11 | p.y = dot(p.yz, t); 12 | factor = (0.05 + (0.95 * dot(p.xy, t))); 13 | factor *= specIntensity; 14 | return factor; 15 | } 16 | varying vec3 inN; 17 | varying vec3 inE; 18 | void main() 19 | { 20 | float f = splineFresnel (inN, inE, _SpecIntensity, _Fresnel); 21 | gl_FragColor = vec4(f); 22 | } 23 | -------------------------------------------------------------------------------- /tests/fragment/opt-vectorize-types-in.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D maintex; 2 | uniform float factor; 3 | varying vec2 uv; 4 | void main() { 5 | vec4 c = texture2D(maintex, uv); 6 | vec4 r; 7 | // when these become vectorized, they need to turn scalar 8 | // arguments into proper types as well 9 | r.x = max(0.123, c.x); 10 | r.y = max(0.123, c.y); 11 | r.z = min(c.z, factor); 12 | r.w = min(c.w, factor); 13 | gl_FragColor = r; 14 | } 15 | -------------------------------------------------------------------------------- /tests/fragment/opt-vectorize-types-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D maintex; 2 | uniform float factor; 3 | varying vec2 uv; 4 | void main () 5 | { 6 | vec4 r_1; 7 | vec4 tmpvar_2; 8 | tmpvar_2 = texture2D (maintex, uv); 9 | r_1.xy = max (vec2(0.123, 0.123), tmpvar_2.xy); 10 | r_1.zw = min (tmpvar_2.zw, vec2(factor)); 11 | gl_FragColor = r_1; 12 | } 13 | 14 | 15 | // stats: 2 alu 1 tex 0 flow 16 | // inputs: 1 17 | // #0: uv (high float) 2x1 [-1] 18 | // uniforms: 1 (total size: 0) 19 | // #0: factor (high float) 1x1 [-1] 20 | // textures: 1 21 | // #0: maintex (high 2d) 0x0 [-1] 22 | -------------------------------------------------------------------------------- /tests/fragment/pp-basic-in.txt: -------------------------------------------------------------------------------- 1 | #define FRAGMENT 2 | 3 | #ifdef VERTEX 4 | foo bar baz 5 | #endif 6 | 7 | #ifdef FRAGMENT 8 | vec4 xlat_main () { 9 | return vec4(1.0); 10 | } 11 | #endif 12 | 13 | void main() { 14 | vec4 xl_retval; 15 | xl_retval = xlat_main(); 16 | gl_FragData[0] = vec4(xl_retval); 17 | } 18 | -------------------------------------------------------------------------------- /tests/fragment/pp-basic-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | gl_FragData[0] = vec4(1.0, 1.0, 1.0, 1.0); 4 | } 5 | 6 | 7 | // stats: 1 alu 0 tex 0 flow 8 | -------------------------------------------------------------------------------- /tests/fragment/prec-default-inES.txt: -------------------------------------------------------------------------------- 1 | precision highp float; 2 | precision lowp int; 3 | 4 | struct MyStruct { 5 | float f; 6 | int i; 7 | }; 8 | uniform MyStruct s1; 9 | 10 | uniform float fh1; 11 | uniform highp float fh2; 12 | uniform mediump float fm; 13 | 14 | uniform int il1; 15 | uniform lowp int il2; 16 | uniform mediump int im; 17 | 18 | 19 | void main() { 20 | lowp float f = fh1 + fh2 + fm + s1.f; 21 | highp int i = il1 + il2 + im + s1.i; 22 | float z = 0.0; 23 | z += gl_FragCoord.x > 0.5 ? 0.9 : 0.1; 24 | gl_FragColor = vec4(f, i, z, 0.0); 25 | } 26 | -------------------------------------------------------------------------------- /tests/fragment/prec-expressions-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | out lowp vec4 _fragData; 3 | 4 | uniform mediump mat4 _LightMatrix; 5 | uniform highp vec3 _WorldPos; 6 | 7 | void main() 8 | { 9 | // Used to expose bug in Metal output where it was inserting cast in the wrong place, 10 | // i.e. it was doing a v3 = (float4)(mat * vec).xyz 11 | mediump vec3 lightCoord = vec3 ( (_LightMatrix * vec4(_WorldPos, 1.0)) ); 12 | 13 | mediump vec4 r; 14 | r.xyz = lightCoord; 15 | r.w = 1.0; 16 | _fragData = r; 17 | } 18 | -------------------------------------------------------------------------------- /tests/fragment/prec-expressions-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | out lowp vec4 _fragData; 3 | uniform mediump mat4 _LightMatrix; 4 | uniform highp vec3 _WorldPos; 5 | void main () 6 | { 7 | mediump vec4 r_1; 8 | mediump vec3 lightCoord_2; 9 | highp vec4 tmpvar_3; 10 | tmpvar_3.w = 1.0; 11 | tmpvar_3.xyz = _WorldPos; 12 | highp vec3 tmpvar_4; 13 | tmpvar_4 = (_LightMatrix * tmpvar_3).xyz; 14 | lightCoord_2 = tmpvar_4; 15 | r_1.xyz = lightCoord_2; 16 | r_1.w = 1.0; 17 | _fragData = r_1; 18 | } 19 | 20 | 21 | // stats: 3 alu 0 tex 0 flow 22 | // uniforms: 2 (total size: 0) 23 | // #0: _LightMatrix (medium float) 4x4 [-1] 24 | // #1: _WorldPos (high float) 3x1 [-1] 25 | -------------------------------------------------------------------------------- /tests/fragment/prec-inlineexpr1-inES.txt: -------------------------------------------------------------------------------- 1 | float xll_saturate(float x) { 2 | return clamp(x, 0.0, 1.0); 3 | } 4 | vec3 xll_saturate(vec3 x) { 5 | return clamp(x, 0.0, 1.0); 6 | } 7 | uniform sampler2D _MainTex; 8 | uniform sampler2D _BurntTex; 9 | uniform mediump float _EmberFadeEnd; 10 | uniform mediump float _EmberFadeStart; 11 | lowp vec4 frag (mediump vec2 uv) { 12 | lowp vec3 base = texture2D(_MainTex, uv).xyz; 13 | lowp vec3 burn = texture2D(_BurntTex, uv).xyz; 14 | lowp float t; 15 | t = xll_saturate( ((_EmberFadeStart - 0.05) / (_EmberFadeStart - _EmberFadeEnd)) ); 16 | return vec4(mix(base, burn, vec3(t)), 1.0); 17 | } 18 | varying mediump vec2 xlv_TEXCOORD0; 19 | void main() { 20 | gl_FragColor = frag(xlv_TEXCOORD0); 21 | } 22 | -------------------------------------------------------------------------------- /tests/fragment/prec-inlineexpr2-inES.txt: -------------------------------------------------------------------------------- 1 | float xll_saturate(float x) { 2 | return clamp(x, 0.0, 1.0); 3 | } 4 | vec3 xll_saturate(vec3 x) { 5 | return clamp(x, 0.0, 1.0); 6 | } 7 | uniform sampler2D _MainTex; 8 | uniform sampler2D _BurntTex; 9 | uniform mediump float _EmberFadeEnd; 10 | uniform mediump float _EmberFadeStart; 11 | lowp vec4 frag (mediump vec2 uv) { 12 | lowp vec3 base = texture2D(_MainTex, uv).xyz; 13 | lowp vec3 burn = texture2D(_BurntTex, uv).xyz; 14 | lowp vec3 t; 15 | t = vec3( xll_saturate( ((_EmberFadeStart - 0.05) / (_EmberFadeStart - _EmberFadeEnd)) ) ); 16 | return vec4(mix(base, burn, t), 1.0); 17 | } 18 | varying mediump vec2 xlv_TEXCOORD0; 19 | void main() { 20 | gl_FragColor = frag(xlv_TEXCOORD0); 21 | } 22 | -------------------------------------------------------------------------------- /tests/fragment/prec-matrix-constr-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | 3 | // A very cut down variant of Unity's directional lightmap; 4 | // has an inline medium precision matrix constructor, 5 | // but even if dirBasis is declared as mediump 6 | // some code was promoting it to high precision. 7 | 8 | out mediump vec4 _glesFragData; 9 | 10 | mat3 transposem3(mat3 m) { 11 | return mat3( m[0][0], m[1][0], m[2][0], 12 | m[0][1], m[1][1], m[2][1], 13 | m[0][2], m[1][2], m[2][2]); 14 | } 15 | 16 | in mediump vec3 inNormal; 17 | 18 | void main() 19 | { 20 | mediump mat3 dirBasis = transposem3(mat3( 21 | vec3( 0.8164966, 0.0, 0.5773503), 22 | vec3( -0.4082483, 0.7071068, 0.5773503), 23 | vec3( -0.4082483, -0.7071068, 0.5773503))); 24 | mediump vec4 c; 25 | c.xyz = dirBasis * inNormal; 26 | c.w = 0.0; 27 | _glesFragData = c; 28 | } 29 | -------------------------------------------------------------------------------- /tests/fragment/prec-matrix-constr-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | out mediump vec4 _glesFragData; 3 | in mediump vec3 inNormal; 4 | void main () 5 | { 6 | mediump vec4 c_1; 7 | mediump mat3 tmpvar_2; 8 | tmpvar_2[uint(0)].x = 0.8164966; 9 | tmpvar_2[uint(0)].y = -0.4082483; 10 | tmpvar_2[uint(0)].z = -0.4082483; 11 | tmpvar_2[1u].x = 0.0; 12 | tmpvar_2[1u].y = 0.7071068; 13 | tmpvar_2[1u].z = -0.7071068; 14 | tmpvar_2[2u].x = 0.5773503; 15 | tmpvar_2[2u].y = 0.5773503; 16 | tmpvar_2[2u].z = 0.5773503; 17 | c_1.xyz = (tmpvar_2 * inNormal); 18 | c_1.w = 0.0; 19 | _glesFragData = c_1; 20 | } 21 | 22 | 23 | // stats: 11 alu 0 tex 0 flow 24 | // inputs: 1 25 | // #0: inNormal (medium float) 3x1 [-1] 26 | -------------------------------------------------------------------------------- /tests/fragment/prec-tempssimple-inES.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D tex_def; 2 | uniform lowp sampler2D tex_lowp; 3 | uniform highp sampler2D tex_highp; 4 | varying lowp vec2 var_lowp; 5 | varying mediump vec2 var_mediump; 6 | void main() 7 | { 8 | lowp vec4 c1; 9 | c1 = texture2D (tex_def, var_lowp) * 2.0; 10 | lowp vec4 c2; 11 | c2 = texture2D (tex_def, var_mediump) * 2.0; 12 | lowp vec4 c3; 13 | c3 = texture2D (tex_highp, var_mediump) * 2.0; 14 | lowp vec4 c4; 15 | c4 = texture2D (tex_lowp, var_mediump) * 2.0; 16 | 17 | lowp vec4 a1; 18 | a1 = abs(var_lowp.xxxx); 19 | 20 | gl_FragColor = c1 + c2 + c3 + c4 + a1; 21 | } 22 | -------------------------------------------------------------------------------- /tests/fragment/prec-treegrafting-inES.txt: -------------------------------------------------------------------------------- 1 | uniform mediump float med_a; 2 | uniform mediump float med_b; 3 | uniform lowp float low_c; 4 | 5 | void main() 6 | { 7 | // must be computed at mediump since some args are mediump 8 | lowp float t = (med_a + low_c / med_b); 9 | // computed at lowp 10 | lowp vec4 c = clamp(vec4(t), 0.0, 1.0); 11 | 12 | gl_FragColor = c; 13 | } 14 | -------------------------------------------------------------------------------- /tests/fragment/prec-treegrafting-outES.txt: -------------------------------------------------------------------------------- 1 | uniform mediump float med_a; 2 | uniform mediump float med_b; 3 | uniform lowp float low_c; 4 | void main () 5 | { 6 | lowp float t_1; 7 | mediump float tmpvar_2; 8 | tmpvar_2 = (med_a + (low_c / med_b)); 9 | t_1 = tmpvar_2; 10 | lowp vec4 tmpvar_3; 11 | tmpvar_3 = clamp (vec4(t_1), 0.0, 1.0); 12 | gl_FragColor = tmpvar_3; 13 | } 14 | 15 | 16 | // stats: 3 alu 0 tex 0 flow 17 | // uniforms: 3 (total size: 0) 18 | // #0: med_a (medium float) 1x1 [-1] 19 | // #1: med_b (medium float) 1x1 [-1] 20 | // #2: low_c (low float) 1x1 [-1] 21 | -------------------------------------------------------------------------------- /tests/fragment/qualifiers-layout-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | precision mediump float; 3 | 4 | layout(location=0) out vec4 final_color0; 5 | layout(location=1) out vec4 final_color1; 6 | layout(location=2) out vec4 final_color2; 7 | 8 | void main() 9 | { 10 | final_color0 = vec4(1,0,0,1); 11 | final_color1 = vec4(0,1,0,1); 12 | final_color2 = vec4(0,0,1,1); 13 | } 14 | -------------------------------------------------------------------------------- /tests/fragment/qualifiers-layout-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | precision mediump float; 3 | layout(location=0) out vec4 final_color0; 4 | layout(location=1) out vec4 final_color1; 5 | layout(location=2) out vec4 final_color2; 6 | void main () 7 | { 8 | final_color0 = vec4(1.0, 0.0, 0.0, 1.0); 9 | final_color1 = vec4(0.0, 1.0, 0.0, 1.0); 10 | final_color2 = vec4(0.0, 0.0, 1.0, 1.0); 11 | } 12 | 13 | 14 | // stats: 3 alu 0 tex 0 flow 15 | -------------------------------------------------------------------------------- /tests/fragment/qualifiers-layout-outES3Metal.txt: -------------------------------------------------------------------------------- 1 | #include 2 | #pragma clang diagnostic ignored "-Wparentheses-equality" 3 | using namespace metal; 4 | struct xlatMtlShaderInput { 5 | }; 6 | struct xlatMtlShaderOutput { 7 | float4 final_color0 [[color(0)]]; 8 | float4 final_color1 [[color(1)]]; 9 | float4 final_color2 [[color(2)]]; 10 | }; 11 | struct xlatMtlShaderUniform { 12 | }; 13 | ; 14 | fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]) 15 | { 16 | xlatMtlShaderOutput _mtl_o; 17 | _mtl_o.final_color0 = float4(1.0, 0.0, 0.0, 1.0); 18 | _mtl_o.final_color1 = float4(0.0, 1.0, 0.0, 1.0); 19 | _mtl_o.final_color2 = float4(0.0, 0.0, 1.0, 1.0); 20 | return _mtl_o; 21 | } 22 | 23 | 24 | // stats: 3 alu 0 tex 0 flow 25 | -------------------------------------------------------------------------------- /tests/fragment/sampler-precision-inES.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D texlow; 2 | uniform mediump sampler2D texmed; 3 | uniform highp sampler2D texhigh; 4 | uniform samplerCube cubelow; 5 | uniform mediump samplerCube cubemed; 6 | uniform highp samplerCube cubehigh; 7 | 8 | mediump vec4 xlat_main(in highp vec4 uv) { 9 | mediump vec4 c; 10 | c = texture2D(texlow, uv.xy); 11 | c += texture2D(texmed, uv.xy); 12 | c += texture2D(texhigh, uv.xy); 13 | c += textureCube(cubelow, uv.xyz); 14 | c += textureCube(cubemed, uv.xyz); 15 | c += textureCube(cubehigh, uv.xyz); 16 | return c; 17 | } 18 | varying highp vec4 varUV; 19 | void main() { 20 | mediump vec4 r; 21 | r = xlat_main(varUV); 22 | gl_FragData[0] = r; 23 | } 24 | -------------------------------------------------------------------------------- /tests/fragment/sampler-precision-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | out lowp vec4 _fragData; 3 | uniform sampler2D texlow; 4 | uniform mediump sampler2D texmed; 5 | uniform highp sampler2D texhigh; 6 | uniform samplerCube cubelow; 7 | uniform mediump samplerCube cubemed; 8 | uniform highp samplerCube cubehigh; 9 | 10 | mediump vec4 xlat_main(in highp vec4 uv) { 11 | mediump vec4 c; 12 | c = texture(texlow, uv.xy); 13 | c += texture(texmed, uv.xy); 14 | c += texture(texhigh, uv.xy); 15 | c += texture(cubelow, uv.xyz); 16 | c += texture(cubemed, uv.xyz); 17 | c += texture(cubehigh, uv.xyz); 18 | return c; 19 | } 20 | in highp vec4 varUV; 21 | void main() { 22 | mediump vec4 r; 23 | r = xlat_main(varUV); 24 | _fragData = r; 25 | } 26 | -------------------------------------------------------------------------------- /tests/fragment/small-float-in.txt: -------------------------------------------------------------------------------- 1 | uniform float inFloat; 2 | 3 | void main() 4 | { 5 | gl_FragColor = vec4(inFloat * 4.36e-6); 6 | } 7 | -------------------------------------------------------------------------------- /tests/fragment/small-float-out.txt: -------------------------------------------------------------------------------- 1 | uniform float inFloat; 2 | void main () 3 | { 4 | gl_FragColor = vec4((inFloat * 4.36e-06)); 5 | } 6 | 7 | 8 | // stats: 1 alu 0 tex 0 flow 9 | // uniforms: 1 (total size: 0) 10 | // #0: inFloat (high float) 1x1 [-1] 11 | -------------------------------------------------------------------------------- /tests/fragment/struct-array-var-index-in.txt: -------------------------------------------------------------------------------- 1 | struct str { 2 | float params[3]; 3 | }; 4 | void main() { 5 | str s; 6 | for (int i = 0; i < 3; ++i) 7 | s.params[i] = 1.0; 8 | gl_FragColor = vec4(0.0); 9 | } 10 | -------------------------------------------------------------------------------- /tests/fragment/struct-array-var-index-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); 4 | } 5 | 6 | 7 | // stats: 1 alu 0 tex 0 flow 8 | -------------------------------------------------------------------------------- /tests/fragment/struct-unused-in.txt: -------------------------------------------------------------------------------- 1 | struct SurfaceOutput { 2 | vec4 color; 3 | }; 4 | void main() { 5 | SurfaceOutput o; 6 | gl_FragColor = vec4(0.0); 7 | } 8 | -------------------------------------------------------------------------------- /tests/fragment/struct-unused-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); 4 | } 5 | 6 | 7 | // stats: 1 alu 0 tex 0 flow 8 | -------------------------------------------------------------------------------- /tests/fragment/swizzle-writemask-in.txt: -------------------------------------------------------------------------------- 1 | void main () { 2 | vec4 c; 3 | c.x = dot (gl_FragCoord.xyz, vec3(1.0, 2.0, 3.0)); 4 | c.yzw = vec3(4.0,5.0,6.0); 5 | gl_FragColor = c; 6 | } 7 | -------------------------------------------------------------------------------- /tests/fragment/swizzle-writemask-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | vec4 c_1; 4 | c_1.x = dot (gl_FragCoord.xyz, vec3(1.0, 2.0, 3.0)); 5 | c_1.yzw = vec3(4.0, 5.0, 6.0); 6 | gl_FragColor = c_1; 7 | } 8 | 9 | 10 | // stats: 2 alu 0 tex 0 flow 11 | // inputs: 1 12 | // #0: gl_FragCoord (high float) 4x1 [-1] loc 0 13 | -------------------------------------------------------------------------------- /tests/fragment/syntax-inES.txt: -------------------------------------------------------------------------------- 1 | mediump vec4 xlat_main( ); 2 | mediump vec4 xlat_main( ) { 3 | highp float foo = 1.00000; 4 | foo += 1.00000; 5 | foo += 100000.; 6 | foo += -0.00100000; 7 | foo += 2.00000; 8 | foo += 3.00000; 9 | return vec4( foo); 10 | } 11 | void main() { 12 | mediump vec4 xl_retval; 13 | xl_retval = xlat_main( ); 14 | gl_FragData[0] = vec4( xl_retval); 15 | } 16 | -------------------------------------------------------------------------------- /tests/fragment/syntax-outES.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | gl_FragData[0] = vec4(100007.0, 100007.0, 100007.0, 100007.0); 4 | } 5 | 6 | 7 | // stats: 1 alu 0 tex 0 flow 8 | -------------------------------------------------------------------------------- /tests/fragment/ternary-in.txt: -------------------------------------------------------------------------------- 1 | vec4 xlat_main( in vec4 uv ); 2 | vec4 xlat_main( in vec4 uv ) { 3 | vec4 c; 4 | c = vec4( 0.000000); 5 | c += ( (uv.x > 0.500000) ) ? ( 0.900000 ) : ( 0.100000 ); 6 | c += ( (uv.x > 0.500000) ) ? ( vec4( 0.900000, 0.900000, 0.900000, 0.900000) ) : ( vec4( 0.100000, 0.100000, 0.100000, 0.100000) ); 7 | c.xyz += ( (uv.x > 0.500000) ) ? ( vec3( 0.900000, 0.900000, 0.900000) ) : ( vec3( 0.100000, 0.100000, 0.100000) ); 8 | c.xy += ( (uv.x > 0.500000) ) ? ( vec2( 0.900000, 0.900000) ) : ( vec2( 0.100000, 0.100000) ); 9 | c.x += ( bool( fract( uv.x ) ) ) ? ( 0.900000 ) : ( 0.100000 ); 10 | return c; 11 | } 12 | varying vec4 xlv_TEXCOORD0; 13 | void main() { 14 | vec4 xl_retval; 15 | xl_retval = xlat_main( vec4(xlv_TEXCOORD0)); 16 | gl_FragData[0] = vec4( xl_retval); 17 | } 18 | -------------------------------------------------------------------------------- /tests/fragment/ternary-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | mediump vec4 xlat_main( in highp vec4 uv ) { 3 | mediump vec4 c; 4 | c = vec4( 0.000000); 5 | c += ( (uv.x > 0.500000) ) ? ( 0.900000 ) : ( 0.100000 ); 6 | c += ( (uv.x > 0.500000) ) ? ( vec4( 0.900000, 0.900000, 0.900000, 0.900000) ) : ( vec4( 0.100000, 0.100000, 0.100000, 0.100000) ); 7 | c.xyz += ( (uv.x > 0.500000) ) ? ( vec3( 0.900000, 0.900000, 0.900000) ) : ( vec3( 0.100000, 0.100000, 0.100000) ); 8 | c.xy += ( (uv.x > 0.500000) ) ? ( vec2( 0.900000, 0.900000) ) : ( vec2( 0.100000, 0.100000) ); 9 | c.x += ( bool( fract( uv.x ) ) ) ? ( 0.900000 ) : ( 0.100000 ); 10 | return c; 11 | } 12 | in highp vec4 xlv_TEXCOORD0; 13 | out mediump vec4 _fragData; 14 | void main() { 15 | mediump vec4 xl_retval; 16 | xl_retval = xlat_main( vec4(xlv_TEXCOORD0)); 17 | _fragData = vec4( xl_retval); 18 | } 19 | -------------------------------------------------------------------------------- /tests/fragment/tex2DArray-in.txt: -------------------------------------------------------------------------------- 1 | #extension GL_EXT_texture_array : require 2 | 3 | vec4 xll_tex2DArray(sampler2DArray s, vec3 coord) { return texture2DArray (s, coord); } 4 | vec4 xll_tex2DArrayBias(sampler2DArray s, vec4 coord) { return texture2DArray (s, coord.xyz, coord.w); } 5 | 6 | uniform sampler2DArray myarr; 7 | 8 | vec4 xlat_main( in vec4 uv ) { 9 | vec4 s = xll_tex2DArray( myarr, uv.xyz); 10 | vec4 sswiz = xll_tex2DArray( myarr, uv.xyw); 11 | vec4 sbias = xll_tex2DArrayBias( myarr, vec4( uv.xyz, 1.5)); 12 | return s + sswiz + sbias; 13 | } 14 | 15 | varying vec4 uv; 16 | void main() { 17 | vec4 xl_retval; 18 | xl_retval = xlat_main(uv); 19 | gl_FragData[0] = vec4(xl_retval); 20 | } 21 | -------------------------------------------------------------------------------- /tests/fragment/tex2DArray-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | out lowp vec4 _fragData; 3 | 4 | vec4 xll_tex2DArray(sampler2DArray s, vec3 coord) { return texture (s, coord); } 5 | vec4 xll_tex2DArrayBias(sampler2DArray s, vec4 coord) { return texture (s, coord.xyz, coord.w); } 6 | 7 | uniform lowp sampler2DArray myarr; 8 | 9 | lowp vec4 xlat_main( in highp vec4 uv ) { 10 | highp vec4 s = xll_tex2DArray( myarr, uv.xyz); 11 | highp vec4 sswiz = xll_tex2DArray( myarr, uv.xyw); 12 | highp vec4 sbias = xll_tex2DArrayBias( myarr, vec4( uv.xyz, 1.5)); 13 | highp vec4 slod = textureLod(myarr, uv.xyz, 2.5); 14 | return (((s + sswiz) + sbias) + slod); 15 | } 16 | in highp vec4 uv; 17 | void main() { 18 | _fragData = xlat_main(uv); 19 | } 20 | -------------------------------------------------------------------------------- /tests/fragment/tex2DArray-out.txt: -------------------------------------------------------------------------------- 1 | #extension GL_EXT_texture_array : enable 2 | uniform sampler2DArray myarr; 3 | varying vec4 uv; 4 | void main () 5 | { 6 | gl_FragData[0] = ((texture2DArray (myarr, uv.xyz) + texture2DArray (myarr, uv.xyw)) + texture2DArray (myarr, uv.xyz, 1.5)); 7 | } 8 | 9 | 10 | // stats: 2 alu 3 tex 0 flow 11 | // inputs: 1 12 | // #0: uv (high float) 4x1 [-1] 13 | // textures: 1 14 | // #0: myarr (high 2darray) 0x0 [-1] 15 | -------------------------------------------------------------------------------- /tests/fragment/tex2dgrad-in.txt: -------------------------------------------------------------------------------- 1 | #extension GL_ARB_shader_texture_lod : require 2 | uniform sampler2D tex; 3 | uniform samplerCube cub; 4 | varying vec3 uv; 5 | void main() { 6 | gl_FragColor = texture2DGradARB(tex,uv.xy,dFdx(uv.xy),dFdy(uv.xy)) + textureCubeGradARB(cub,uv,dFdx(uv),dFdy(uv)); 7 | } 8 | -------------------------------------------------------------------------------- /tests/fragment/tex2dgrad-inES.txt: -------------------------------------------------------------------------------- 1 | #extension GL_EXT_shader_texture_lod : require 2 | #extension GL_OES_standard_derivatives : require 3 | uniform sampler2D tex; 4 | uniform samplerCube cub; 5 | varying vec3 uv; 6 | void main() { 7 | gl_FragColor = texture2DGradEXT(tex,uv.xy,dFdx(uv.xy),dFdy(uv.xy)) + textureCubeGradEXT(cub,uv,dFdx(uv),dFdy(uv)); 8 | } 9 | -------------------------------------------------------------------------------- /tests/fragment/tex2dgrad-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | precision mediump float; 3 | uniform sampler2D tex; 4 | uniform samplerCube cub; 5 | in mediump vec3 uv1; 6 | in highp vec3 uv2; 7 | out vec4 _fragColor; 8 | void main() { 9 | vec4 g1 = textureGrad(tex,uv1.xy,dFdx(uv1.xy),dFdy(uv1.xy)); // mediump UV 10 | vec4 g2 = textureGrad(tex,uv2.xy,dFdx(uv2.xy),dFdy(uv2.xy)); // highp UV 11 | vec4 g3 = textureGrad(tex,uv2.xy,uv1.xy,uv1.xy); // mediump gradient 12 | _fragColor = g1 + g2 + g3; 13 | } 14 | -------------------------------------------------------------------------------- /tests/fragment/tex2dgrad-out.txt: -------------------------------------------------------------------------------- 1 | #extension GL_ARB_shader_texture_lod : enable 2 | uniform sampler2D tex; 3 | uniform samplerCube cub; 4 | varying vec3 uv; 5 | void main () 6 | { 7 | gl_FragColor = (texture2DGradARB (tex, uv.xy, dFdx(uv.xy), dFdy(uv.xy)) + textureCubeGradARB (cub, uv, dFdx(uv), dFdy(uv))); 8 | } 9 | 10 | 11 | // stats: 5 alu 2 tex 0 flow 12 | // inputs: 1 13 | // #0: uv (high float) 3x1 [-1] 14 | // textures: 2 15 | // #0: tex (high 2d) 0x0 [-1] 16 | // #1: cub (high cube) 0x0 [-1] 17 | -------------------------------------------------------------------------------- /tests/fragment/tex2dgrad-outES.txt: -------------------------------------------------------------------------------- 1 | #extension GL_EXT_shader_texture_lod : enable 2 | #extension GL_OES_standard_derivatives : enable 3 | uniform sampler2D tex; 4 | uniform lowp samplerCube cub; 5 | varying highp vec3 uv; 6 | void main () 7 | { 8 | lowp vec4 tmpvar_1; 9 | tmpvar_1 = texture2DGradEXT (tex, uv.xy, dFdx(uv.xy), dFdy(uv.xy)); 10 | lowp vec4 tmpvar_2; 11 | tmpvar_2 = textureCubeGradEXT (cub, uv, dFdx(uv), dFdy(uv)); 12 | gl_FragColor = (tmpvar_1 + tmpvar_2); 13 | } 14 | 15 | 16 | // stats: 5 alu 2 tex 0 flow 17 | // inputs: 1 18 | // #0: uv (high float) 3x1 [-1] 19 | // textures: 2 20 | // #0: tex (low 2d) 0x0 [-1] 21 | // #1: cub (low cube) 0x0 [-1] 22 | -------------------------------------------------------------------------------- /tests/fragment/tex2dgrad-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | precision mediump float; 3 | uniform sampler2D tex; 4 | in mediump vec3 uv1; 5 | in highp vec3 uv2; 6 | out lowp vec4 _fragColor; 7 | void main () 8 | { 9 | mediump vec2 tmpvar_1; 10 | tmpvar_1 = dFdx(uv1.xy); 11 | mediump vec2 tmpvar_2; 12 | tmpvar_2 = dFdy(uv1.xy); 13 | highp vec2 tmpvar_3; 14 | tmpvar_3 = dFdx(uv2.xy); 15 | highp vec2 tmpvar_4; 16 | tmpvar_4 = dFdy(uv2.xy); 17 | _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)); 18 | } 19 | 20 | 21 | // stats: 6 alu 3 tex 0 flow 22 | // inputs: 2 23 | // #0: uv1 (medium float) 3x1 [-1] 24 | // #1: uv2 (high float) 3x1 [-1] 25 | // textures: 1 26 | // #0: tex (low 2d) 0x0 [-1] 27 | -------------------------------------------------------------------------------- /tests/fragment/tex2dlod-in.txt: -------------------------------------------------------------------------------- 1 | #extension GL_ARB_shader_texture_lod : require 2 | vec4 xll_tex2Dlod(sampler2D s, vec4 coord) { 3 | return texture2DLod( s, coord.xy, coord.w); 4 | } 5 | uniform sampler2D tex; 6 | vec4 xlat_main( in vec4 uv ); 7 | vec4 xlat_main( in vec4 uv ) { 8 | return xll_tex2Dlod( tex, vec4( uv.xy , 0.0, 0.0)); 9 | } 10 | varying vec4 xlv_TEXCOORD0; 11 | void main() { 12 | vec4 xl_retval; 13 | xl_retval = xlat_main( vec4(xlv_TEXCOORD0)); 14 | gl_FragData[0] = vec4( xl_retval); 15 | } 16 | -------------------------------------------------------------------------------- /tests/fragment/tex2dlod-inES.txt: -------------------------------------------------------------------------------- 1 | #extension GL_EXT_shader_texture_lod : require 2 | vec4 xll_tex2Dlod(sampler2D s, vec4 coord) { 3 | return texture2DLodEXT( s, coord.xy, coord.w); 4 | } 5 | uniform sampler2D tex; 6 | mediump vec4 xlat_main( in highp vec4 uv ); 7 | mediump vec4 xlat_main( in highp vec4 uv ) { 8 | return xll_tex2Dlod( tex, vec4( uv.xy , 0.0, 0.0)); 9 | } 10 | varying highp vec4 xlv_TEXCOORD0; 11 | void main() { 12 | mediump vec4 xl_retval; 13 | xl_retval = xlat_main( vec4(xlv_TEXCOORD0)); 14 | gl_FragData[0] = vec4( xl_retval); 15 | } 16 | -------------------------------------------------------------------------------- /tests/fragment/tex2dlod-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | precision mediump float; 3 | 4 | vec4 xll_tex2Dlod(sampler2D s, vec4 coord) { 5 | return textureLod (s, coord.xy, coord.w); 6 | } 7 | uniform sampler2D tex; 8 | mediump vec4 xlat_main (in highp vec4 uv) { 9 | return xll_tex2Dlod( tex, vec4( uv.xy , 0.0, 0.0)); 10 | } 11 | in highp vec4 uvHi; 12 | in mediump vec4 uvMed; 13 | out vec4 _fragColor; 14 | void main() { 15 | mediump vec4 r; 16 | r = xlat_main(uvHi); 17 | r += textureLod (tex, uvMed.xy, uvMed.z); // mediump arguments 18 | _fragColor = r; 19 | } 20 | -------------------------------------------------------------------------------- /tests/fragment/tex2dlod-out.txt: -------------------------------------------------------------------------------- 1 | #extension GL_ARB_shader_texture_lod : enable 2 | uniform sampler2D tex; 3 | varying vec4 xlv_TEXCOORD0; 4 | void main () 5 | { 6 | gl_FragData[0] = texture2DLod (tex, xlv_TEXCOORD0.xy, 0.0); 7 | } 8 | 9 | 10 | // stats: 0 alu 1 tex 0 flow 11 | // inputs: 1 12 | // #0: xlv_TEXCOORD0 (high float) 4x1 [-1] 13 | // textures: 1 14 | // #0: tex (high 2d) 0x0 [-1] 15 | -------------------------------------------------------------------------------- /tests/fragment/tex2dlod-outES.txt: -------------------------------------------------------------------------------- 1 | #extension GL_EXT_shader_texture_lod : enable 2 | lowp vec4 impl_low_texture2DLodEXT(lowp sampler2D sampler, highp vec2 coord, mediump float lod) 3 | { 4 | #if defined(GL_EXT_shader_texture_lod) 5 | return texture2DLodEXT(sampler, coord, lod); 6 | #else 7 | return texture2D(sampler, coord, lod); 8 | #endif 9 | } 10 | 11 | uniform sampler2D tex; 12 | varying highp vec4 xlv_TEXCOORD0; 13 | void main () 14 | { 15 | mediump vec4 tmpvar_1; 16 | lowp vec4 tmpvar_2; 17 | tmpvar_2 = impl_low_texture2DLodEXT (tex, xlv_TEXCOORD0.xy, 0.0); 18 | tmpvar_1 = tmpvar_2; 19 | gl_FragData[0] = tmpvar_1; 20 | } 21 | 22 | 23 | // stats: 0 alu 1 tex 0 flow 24 | // inputs: 1 25 | // #0: xlv_TEXCOORD0 (high float) 4x1 [-1] 26 | // textures: 1 27 | // #0: tex (low 2d) 0x0 [-1] 28 | -------------------------------------------------------------------------------- /tests/fragment/tex2dlod-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | precision mediump float; 3 | uniform sampler2D tex; 4 | in highp vec4 uvHi; 5 | in mediump vec4 uvMed; 6 | out mediump vec4 _fragColor; 7 | void main () 8 | { 9 | mediump vec4 tmpvar_1; 10 | lowp vec4 tmpvar_2; 11 | tmpvar_2 = textureLod (tex, uvHi.xy, 0.0); 12 | tmpvar_1 = tmpvar_2; 13 | lowp vec4 tmpvar_3; 14 | tmpvar_3 = textureLod (tex, uvMed.xy, uvMed.z); 15 | _fragColor = (tmpvar_1 + tmpvar_3); 16 | } 17 | 18 | 19 | // stats: 1 alu 2 tex 0 flow 20 | // inputs: 2 21 | // #0: uvHi (high float) 4x1 [-1] 22 | // #1: uvMed (medium float) 4x1 [-1] 23 | // textures: 1 24 | // #0: tex (low 2d) 0x0 [-1] 25 | -------------------------------------------------------------------------------- /tests/fragment/tex2dshadow-in.txt: -------------------------------------------------------------------------------- 1 | float xll_shadow2D(sampler2DShadow s, vec3 coord) { return shadow2D (s, coord).r; } 2 | float xll_shadow2Dproj(sampler2DShadow s, vec4 coord) { return shadow2DProj (s, coord).r; } 3 | uniform sampler2DShadow shadowmap; 4 | vec4 xlat_main( in vec4 uv ); 5 | #line 4 6 | vec4 xlat_main( in vec4 uv ) { 7 | float s1; 8 | float s2; 9 | s1 = xll_shadow2D( shadowmap, uv.xyz); 10 | s2 = xll_shadow2Dproj( shadowmap, uv); 11 | #line 8 12 | return vec4( (s1 + s2)); 13 | } 14 | varying vec4 xlv_TEXCOORD0; 15 | void main() { 16 | vec4 xl_retval; 17 | xl_retval = xlat_main( vec4(xlv_TEXCOORD0)); 18 | gl_FragData[0] = vec4( xl_retval); 19 | } 20 | -------------------------------------------------------------------------------- /tests/fragment/tex2dshadow-inES.txt: -------------------------------------------------------------------------------- 1 | #extension GL_EXT_shadow_samplers : require 2 | float xll_shadow2D(sampler2DShadow s, vec3 coord) { return shadow2DEXT (s, coord); } 3 | float xll_shadow2Dproj(sampler2DShadow s, vec4 coord) { return shadow2DProjEXT (s, coord); } 4 | uniform sampler2DShadow shadowmap; 5 | lowp vec4 xlat_main( in highp vec4 uv ); 6 | #line 4 7 | lowp vec4 xlat_main( in highp vec4 uv ) { 8 | lowp float s1; 9 | lowp float s2; 10 | s1 = xll_shadow2D( shadowmap, uv.xyz); 11 | s2 = xll_shadow2Dproj( shadowmap, uv); 12 | #line 8 13 | return vec4( (s1 + s2)); 14 | } 15 | varying highp vec4 xlv_TEXCOORD0; 16 | void main() { 17 | lowp vec4 xl_retval; 18 | xl_retval = xlat_main( vec4(xlv_TEXCOORD0)); 19 | gl_FragData[0] = vec4( xl_retval); 20 | } 21 | -------------------------------------------------------------------------------- /tests/fragment/tex2dshadow-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | precision mediump float; 3 | 4 | float xll_shadow2D(sampler2DShadow s, vec3 coord) { return texture (s, coord); } 5 | float xll_shadow2Dproj(sampler2DShadow s, vec4 coord) { return textureProj (s, coord); } 6 | uniform sampler2DShadow shadowmap; 7 | lowp vec4 xlat_main (in highp vec4 uv) { 8 | lowp float s1; 9 | lowp float s2; 10 | s1 = xll_shadow2D( shadowmap, uv.xyz); 11 | s2 = xll_shadow2Dproj( shadowmap, uv); 12 | #line 8 13 | return vec4( (s1 + s2)); 14 | } 15 | in highp vec4 uvHi; 16 | in mediump vec4 uvMed; 17 | out vec4 _fragColor; 18 | void main() { 19 | lowp vec4 r; 20 | r = xlat_main(uvHi); 21 | r.x += texture (shadowmap, uvMed.xyz); 22 | _fragColor = r; 23 | } 24 | -------------------------------------------------------------------------------- /tests/fragment/tex2dshadow-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2DShadow shadowmap; 2 | varying vec4 xlv_TEXCOORD0; 3 | void main () 4 | { 5 | gl_FragData[0] = vec4((shadow2D (shadowmap, xlv_TEXCOORD0.xyz).x + shadow2DProj (shadowmap, xlv_TEXCOORD0).x)); 6 | } 7 | 8 | 9 | // stats: 1 alu 2 tex 0 flow 10 | // inputs: 1 11 | // #0: xlv_TEXCOORD0 (high float) 4x1 [-1] 12 | // textures: 1 13 | // #0: shadowmap (high 2dshadow) 0x0 [-1] 14 | -------------------------------------------------------------------------------- /tests/fragment/tex2dshadow-outES.txt: -------------------------------------------------------------------------------- 1 | #extension GL_EXT_shadow_samplers : enable 2 | uniform lowp sampler2DShadow shadowmap; 3 | varying highp vec4 xlv_TEXCOORD0; 4 | void main () 5 | { 6 | lowp vec4 tmpvar_1; 7 | tmpvar_1 = vec4((shadow2DEXT (shadowmap, xlv_TEXCOORD0.xyz) + shadow2DProjEXT (shadowmap, xlv_TEXCOORD0))); 8 | gl_FragData[0] = tmpvar_1; 9 | } 10 | 11 | 12 | // stats: 1 alu 2 tex 0 flow 13 | // inputs: 1 14 | // #0: xlv_TEXCOORD0 (high float) 4x1 [-1] 15 | // textures: 1 16 | // #0: shadowmap (low 2dshadow) 0x0 [-1] 17 | -------------------------------------------------------------------------------- /tests/fragment/tex2dshadow-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | precision mediump float; 3 | uniform lowp sampler2DShadow shadowmap; 4 | in highp vec4 uvHi; 5 | in mediump vec4 uvMed; 6 | out lowp vec4 _fragColor; 7 | void main () 8 | { 9 | lowp vec4 r_1; 10 | lowp vec4 tmpvar_2; 11 | tmpvar_2 = vec4((texture (shadowmap, uvHi.xyz) + textureProj (shadowmap, uvHi))); 12 | r_1.yzw = tmpvar_2.yzw; 13 | r_1.x = (tmpvar_2.x + texture (shadowmap, uvMed.xyz)); 14 | _fragColor = r_1; 15 | } 16 | 17 | 18 | // stats: 2 alu 3 tex 0 flow 19 | // inputs: 2 20 | // #0: uvHi (high float) 4x1 [-1] 21 | // #1: uvMed (medium float) 4x1 [-1] 22 | // textures: 1 23 | // #0: shadowmap (low 2dshadow) 0x0 [-1] 24 | -------------------------------------------------------------------------------- /tests/fragment/tex3D-in.txt: -------------------------------------------------------------------------------- 1 | uniform sampler3D tex; 2 | varying vec3 uv; 3 | void main() { 4 | gl_FragColor = texture3D(tex, uv); 5 | } 6 | -------------------------------------------------------------------------------- /tests/fragment/tex3D-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | precision mediump float; 3 | uniform sampler3D tex; 4 | in vec3 uv; 5 | out vec4 _fragColor; 6 | void main() { 7 | _fragColor = texture(tex, uv); 8 | } 9 | -------------------------------------------------------------------------------- /tests/fragment/tex3D-inES__.txt: -------------------------------------------------------------------------------- 1 | #extension GL_OES_texture_3D : require 2 | 3 | uniform sampler3D tex; 4 | varying vec3 uv; 5 | void main() { 6 | gl_FragColor = texture3D(tex, uv); 7 | } 8 | -------------------------------------------------------------------------------- /tests/fragment/tex3D-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler3D tex; 2 | varying vec3 uv; 3 | void main () 4 | { 5 | gl_FragColor = texture3D (tex, uv); 6 | } 7 | 8 | 9 | // stats: 0 alu 1 tex 0 flow 10 | // inputs: 1 11 | // #0: uv (high float) 3x1 [-1] 12 | // textures: 1 13 | // #0: tex (high 3d) 0x0 [-1] 14 | -------------------------------------------------------------------------------- /tests/fragment/tex3D-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | precision mediump float; 3 | uniform lowp sampler3D tex; 4 | in vec3 uv; 5 | out lowp vec4 _fragColor; 6 | void main () 7 | { 8 | _fragColor = texture (tex, uv); 9 | } 10 | 11 | 12 | // stats: 0 alu 1 tex 0 flow 13 | // inputs: 1 14 | // #0: uv (high float) 3x1 [-1] 15 | // textures: 1 16 | // #0: tex (low 3d) 0x0 [-1] 17 | -------------------------------------------------------------------------------- /tests/fragment/tex3D-outES3Metal.txt: -------------------------------------------------------------------------------- 1 | #include 2 | #pragma clang diagnostic ignored "-Wparentheses-equality" 3 | using namespace metal; 4 | struct xlatMtlShaderInput { 5 | float3 uv; 6 | }; 7 | struct xlatMtlShaderOutput { 8 | half4 _fragColor [[color(0)]]; 9 | }; 10 | struct xlatMtlShaderUniform { 11 | }; 12 | ; 13 | fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] 14 | , texture3d tex [[texture(0)]], sampler _mtlsmp_tex [[sampler(0)]]) 15 | { 16 | xlatMtlShaderOutput _mtl_o; 17 | _mtl_o._fragColor = tex.sample(_mtlsmp_tex, (float3)(_mtl_i.uv)); 18 | return _mtl_o; 19 | } 20 | 21 | 22 | // stats: 0 alu 1 tex 0 flow 23 | // inputs: 1 24 | // #0: uv (high float) 3x1 [-1] 25 | // textures: 1 26 | // #0: tex (low 3d) 0x0 [-1] loc 0 27 | -------------------------------------------------------------------------------- /tests/fragment/texCubeShadow-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | precision mediump float; 3 | 4 | uniform samplerCubeShadow shadowmap; 5 | 6 | in mediump vec4 uv; 7 | out mediump vec4 _fragColor; 8 | 9 | void main() 10 | { 11 | float s = texture (shadowmap, uv); 12 | _fragColor = vec4(s); 13 | } 14 | -------------------------------------------------------------------------------- /tests/fragment/texCubeShadow-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | precision mediump float; 3 | uniform lowp samplerCubeShadow shadowmap; 4 | in mediump vec4 uv; 5 | out mediump vec4 _fragColor; 6 | void main () 7 | { 8 | lowp vec4 tmpvar_1; 9 | tmpvar_1 = vec4(texture (shadowmap, uv)); 10 | _fragColor = tmpvar_1; 11 | } 12 | 13 | 14 | // stats: 0 alu 1 tex 0 flow 15 | // inputs: 1 16 | // #0: uv (medium float) 4x1 [-1] 17 | // textures: 1 18 | // #0: shadowmap (low cube) 0x0 [-1] 19 | -------------------------------------------------------------------------------- /tests/fragment/texOffset-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | in mediump vec3 uv; 3 | out lowp vec4 outColor; 4 | uniform sampler2D tex; 5 | uniform sampler3D vol; 6 | void main() 7 | { 8 | lowp vec4 c; 9 | 10 | // texture offset forms 11 | c = textureOffset (tex, uv.xy, ivec2(-2,-3)); 12 | c += textureOffset (tex, uv.xy, ivec2(4,5), 0.5); 13 | c += textureOffset (vol, uv.xyz, ivec3(-2,-3,-4)); 14 | c += textureOffset (vol, uv.xyz, ivec3(4,5,6), -0.5); 15 | 16 | // texelFetch forms 17 | c += texelFetch (tex, ivec2(1,2), 1); 18 | c += texelFetch (vol, ivec3(1,2,3), 2); 19 | c += texelFetchOffset (tex, ivec2(1,2), 3, ivec2(-2,-3)); 20 | c += texelFetchOffset (vol, ivec3(1,2,3), 0, ivec3(-2,-3,-4)); 21 | 22 | outColor = c; 23 | } 24 | -------------------------------------------------------------------------------- /tests/fragment/texProj-inES.txt: -------------------------------------------------------------------------------- 1 | #extension GL_EXT_shadow_samplers : require 2 | #extension GL_EXT_shader_texture_lod : require 3 | 4 | uniform sampler2D tex; 5 | uniform sampler2DShadow shadowmap; 6 | 7 | varying highp vec4 uv; 8 | 9 | void main() { 10 | lowp vec4 c; 11 | c = texture2DProj(tex, uv); 12 | c += texture2DProj(tex, uv.xyz); 13 | c += texture2DProjLodEXT(tex, uv, 1.0); 14 | c += texture2DProjLodEXT(tex, uv.xyz, 1.0); 15 | 16 | c += vec4(shadow2DEXT(shadowmap, uv.xyz)); 17 | c += vec4(shadow2DProjEXT(shadowmap, uv)); 18 | 19 | gl_FragColor = c; 20 | } 21 | -------------------------------------------------------------------------------- /tests/fragment/texProj-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | out mediump vec4 _fragData; 3 | 4 | uniform sampler2D tex; 5 | uniform sampler2DShadow shadowmap; 6 | 7 | in highp vec4 uv; 8 | 9 | void main() { 10 | lowp vec4 c; 11 | c = textureProj(tex, uv); 12 | c += textureProj(tex, uv.xyz); 13 | c += textureProjLod(tex, uv, 1.0); 14 | c += textureProjLod(tex, uv.xyz, 1.0); 15 | 16 | c += vec4(texture(shadowmap, uv.xyz)); 17 | c += vec4(textureProj(shadowmap, uv)); 18 | 19 | _fragData = c; 20 | } 21 | -------------------------------------------------------------------------------- /tests/fragment/texProj-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | out mediump vec4 _fragData; 3 | uniform sampler2D tex; 4 | uniform lowp sampler2DShadow shadowmap; 5 | in highp vec4 uv; 6 | void main () 7 | { 8 | lowp vec4 c_1; 9 | c_1 = (textureProj (tex, uv) + textureProj (tex, uv.xyz)); 10 | c_1 = (c_1 + textureProjLod (tex, uv, 1.0)); 11 | c_1 = (c_1 + textureProjLod (tex, uv.xyz, 1.0)); 12 | c_1 = (c_1 + vec4(texture (shadowmap, uv.xyz))); 13 | c_1 = (c_1 + vec4(textureProj (shadowmap, uv))); 14 | _fragData = c_1; 15 | } 16 | 17 | 18 | // stats: 5 alu 6 tex 0 flow 19 | // inputs: 1 20 | // #0: uv (high float) 4x1 [-1] 21 | // textures: 2 22 | // #0: tex (low 2d) 0x0 [-1] 23 | // #1: shadowmap (low 2dshadow) 0x0 [-1] 24 | -------------------------------------------------------------------------------- /tests/fragment/texSize-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | uniform highp sampler2D map; 3 | layout ( location = 0 ) out mediump vec4 out_color; 4 | void main () { 5 | vec2 map_size = vec2(textureSize(map, 0)); 6 | out_color = vec4(map_size.x, map_size.y, 0.0, 0.0); 7 | } 8 | -------------------------------------------------------------------------------- /tests/fragment/texSize-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | uniform highp sampler2D map; 3 | layout(location=0) out mediump vec4 out_color; 4 | void main () 5 | { 6 | highp vec4 tmpvar_1; 7 | tmpvar_1.zw = vec2(0.0, 0.0); 8 | tmpvar_1.xy = vec2(textureSize (map, 0)); 9 | out_color = tmpvar_1; 10 | } 11 | 12 | 13 | // stats: 2 alu 1 tex 0 flow 14 | // textures: 1 15 | // #0: map (high 2d) 0x0 [-1] 16 | -------------------------------------------------------------------------------- /tests/fragment/texSize-outES3Metal.txt: -------------------------------------------------------------------------------- 1 | #include 2 | #pragma clang diagnostic ignored "-Wparentheses-equality" 3 | using namespace metal; 4 | struct xlatMtlShaderInput { 5 | }; 6 | struct xlatMtlShaderOutput { 7 | half4 out_color [[color(0)]]; 8 | }; 9 | struct xlatMtlShaderUniform { 10 | }; 11 | fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]] 12 | , texture2d map [[texture(0)]], sampler _mtlsmp_map [[sampler(0)]]) 13 | { 14 | xlatMtlShaderOutput _mtl_o; 15 | float4 tmpvar_1 = 0; 16 | tmpvar_1.zw = float2(0.0, 0.0); 17 | tmpvar_1.xy = float2(map.get_width(0), map.get_height(0)); 18 | _mtl_o.out_color = half4(tmpvar_1); 19 | return _mtl_o; 20 | } 21 | 22 | 23 | // stats: 2 alu 1 tex 0 flow 24 | // textures: 1 25 | // #0: map (high 2d) 0x0 [-1] loc 0 26 | -------------------------------------------------------------------------------- /tests/fragment/texelFetchMSAA-in.txt: -------------------------------------------------------------------------------- 1 | #version 150 2 | uniform sampler2DMS tex; 3 | in vec2 uv; 4 | out vec4 color; 5 | void main() { 6 | color = texelFetch(tex, ivec2(uv), 3); 7 | } 8 | -------------------------------------------------------------------------------- /tests/fragment/texelFetchMSAA-out.txt: -------------------------------------------------------------------------------- 1 | #version 150 2 | uniform sampler2DMS tex; 3 | in vec2 uv; 4 | out vec4 color; 5 | void main () 6 | { 7 | color = texelFetch (tex, ivec2(uv), 3); 8 | } 9 | 10 | 11 | // stats: 1 alu 1 tex 0 flow 12 | // inputs: 1 13 | // #0: uv (high float) 2x1 [-1] 14 | // textures: 1 15 | // #0: tex (high other) 0x0 [-1] 16 | -------------------------------------------------------------------------------- /tests/fragment/types-writemask-in.txt: -------------------------------------------------------------------------------- 1 | void main () { 2 | vec4 c; 3 | c.x = gl_FragCoord.y; 4 | c.yzw = vec3(4.0,5.0,6.0); 5 | gl_FragColor = c; 6 | } 7 | -------------------------------------------------------------------------------- /tests/fragment/types-writemask-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | vec4 c_1; 4 | c_1.x = gl_FragCoord.y; 5 | c_1.yzw = vec3(4.0, 5.0, 6.0); 6 | gl_FragColor = c_1; 7 | } 8 | 9 | 10 | // stats: 1 alu 0 tex 0 flow 11 | // inputs: 1 12 | // #0: gl_FragCoord (high float) 4x1 [-1] loc 0 13 | -------------------------------------------------------------------------------- /tests/fragment/varyings-in.txt: -------------------------------------------------------------------------------- 1 | vec4 xlat_main( in vec4 uv, in vec4 foobar_xlv_foo ); 2 | vec4 xlat_main( in vec4 uv, in vec4 foobar_xlv_foo ) { 3 | vec4 c; 4 | c = vec4( 0.000000); 5 | return c; 6 | } 7 | varying vec4 xlv_TEXCOORD0; 8 | varying vec4 xlv_TEXCOORD1; 9 | void main() { 10 | vec4 xl_retval; 11 | xl_retval = xlat_main( vec4(xlv_TEXCOORD0), vec4(xlv_TEXCOORD1)); 12 | gl_FragData[0] = vec4( xl_retval); 13 | } 14 | -------------------------------------------------------------------------------- /tests/fragment/varyings-inES.txt: -------------------------------------------------------------------------------- 1 | mediump vec4 xlat_main( in highp vec4 uv, in highp vec4 foobar_xlv_foo ); 2 | mediump vec4 xlat_main( in highp vec4 uv, in highp vec4 foobar_xlv_foo ) { 3 | mediump vec4 c; 4 | c = vec4( 0.000000); 5 | return c; 6 | } 7 | varying highp vec4 xlv_TEXCOORD0; 8 | varying highp vec4 xlv_TEXCOORD1; 9 | void main() { 10 | mediump vec4 xl_retval; 11 | xl_retval = xlat_main( vec4(xlv_TEXCOORD0), vec4(xlv_TEXCOORD1)); 12 | gl_FragData[0] = vec4( xl_retval); 13 | } 14 | -------------------------------------------------------------------------------- /tests/fragment/varyings-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0); 4 | } 5 | 6 | 7 | // stats: 1 alu 0 tex 0 flow 8 | -------------------------------------------------------------------------------- /tests/fragment/varyings-outES.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0); 4 | } 5 | 6 | 7 | // stats: 1 alu 0 tex 0 flow 8 | -------------------------------------------------------------------------------- /tests/fragment/vface-in.txt: -------------------------------------------------------------------------------- 1 | vec4 xlat_main( in float face ); 2 | vec4 xlat_main( in float face ) { 3 | return vec4( face); 4 | } 5 | varying float xlv_VFACE; 6 | void main() { 7 | vec4 xl_retval; 8 | xl_retval = xlat_main( float(xlv_VFACE)); 9 | gl_FragData[0] = vec4( xl_retval); 10 | } 11 | -------------------------------------------------------------------------------- /tests/fragment/vface-inES.txt: -------------------------------------------------------------------------------- 1 | mediump vec4 xlat_main( in highp float face ); 2 | mediump vec4 xlat_main( in highp float face ) { 3 | return vec4( face); 4 | } 5 | varying highp float xlv_VFACE; 6 | void main() { 7 | mediump vec4 xl_retval; 8 | xl_retval = xlat_main( float(xlv_VFACE)); 9 | gl_FragData[0] = vec4( xl_retval); 10 | } 11 | -------------------------------------------------------------------------------- /tests/fragment/vface-out.txt: -------------------------------------------------------------------------------- 1 | varying float xlv_VFACE; 2 | void main () 3 | { 4 | gl_FragData[0] = vec4(xlv_VFACE); 5 | } 6 | 7 | 8 | // stats: 0 alu 0 tex 0 flow 9 | // inputs: 1 10 | // #0: xlv_VFACE (high float) 1x1 [-1] 11 | -------------------------------------------------------------------------------- /tests/fragment/vface-outES.txt: -------------------------------------------------------------------------------- 1 | varying highp float xlv_VFACE; 2 | void main () 3 | { 4 | mediump vec4 tmpvar_1; 5 | highp vec4 tmpvar_2; 6 | tmpvar_2 = vec4(xlv_VFACE); 7 | tmpvar_1 = tmpvar_2; 8 | gl_FragData[0] = tmpvar_1; 9 | } 10 | 11 | 12 | // stats: 0 alu 0 tex 0 flow 13 | // inputs: 1 14 | // #0: xlv_VFACE (high float) 1x1 [-1] 15 | -------------------------------------------------------------------------------- /tests/fragment/vpos-in.txt: -------------------------------------------------------------------------------- 1 | vec4 xlat_main( in vec2 pos ); 2 | vec4 xlat_main( in vec2 pos ) { 3 | return vec4( pos, 0.000000, 0.000000); 4 | } 5 | varying vec2 xlv_VPOS; 6 | void main() { 7 | vec4 xl_retval; 8 | xl_retval = xlat_main( vec2(xlv_VPOS)); 9 | gl_FragData[0] = vec4( xl_retval); 10 | } 11 | -------------------------------------------------------------------------------- /tests/fragment/vpos-inES.txt: -------------------------------------------------------------------------------- 1 | mediump vec4 xlat_main( in highp vec2 pos ); 2 | mediump vec4 xlat_main( in highp vec2 pos ) { 3 | return vec4( pos, 0.000000, 0.000000); 4 | } 5 | varying highp vec2 xlv_VPOS; 6 | void main() { 7 | mediump vec4 xl_retval; 8 | xl_retval = xlat_main( vec2(xlv_VPOS)); 9 | gl_FragData[0] = vec4( xl_retval); 10 | } 11 | -------------------------------------------------------------------------------- /tests/fragment/vpos-out.txt: -------------------------------------------------------------------------------- 1 | varying vec2 xlv_VPOS; 2 | void main () 3 | { 4 | vec4 tmpvar_1; 5 | tmpvar_1.zw = vec2(0.0, 0.0); 6 | tmpvar_1.xy = xlv_VPOS; 7 | gl_FragData[0] = tmpvar_1; 8 | } 9 | 10 | 11 | // stats: 1 alu 0 tex 0 flow 12 | // inputs: 1 13 | // #0: xlv_VPOS (high float) 2x1 [-1] 14 | -------------------------------------------------------------------------------- /tests/fragment/vpos-outES.txt: -------------------------------------------------------------------------------- 1 | varying highp vec2 xlv_VPOS; 2 | void main () 3 | { 4 | mediump vec4 tmpvar_1; 5 | highp vec4 tmpvar_2; 6 | tmpvar_2.zw = vec2(0.0, 0.0); 7 | tmpvar_2.xy = xlv_VPOS; 8 | tmpvar_1 = tmpvar_2; 9 | gl_FragData[0] = tmpvar_1; 10 | } 11 | 12 | 13 | // stats: 1 alu 0 tex 0 flow 14 | // inputs: 1 15 | // #0: xlv_VPOS (high float) 2x1 [-1] 16 | -------------------------------------------------------------------------------- /tests/fragment/z-flare-in.txt: -------------------------------------------------------------------------------- 1 | struct v2f_vertex_lit { 2 | vec2 uv; 3 | vec4 diff; 4 | vec4 spec; 5 | }; 6 | struct v2f_img { 7 | vec4 pos; 8 | vec2 uv; 9 | }; 10 | struct appdata_img { 11 | vec4 vertex; 12 | vec2 texcoord; 13 | }; 14 | uniform sampler2D _FlareTexture; 15 | vec4 xlat_main( in vec4 color, in vec2 texcoord ); 16 | vec4 xlat_main( in vec4 color, in vec2 texcoord ) { 17 | return (texture2D( _FlareTexture, texcoord) * color); 18 | } 19 | void main() { 20 | vec4 xl_retval; 21 | xl_retval = xlat_main( vec4(gl_Color), vec2(gl_TexCoord[0])); 22 | gl_FragData[0] = vec4( xl_retval); 23 | } 24 | -------------------------------------------------------------------------------- /tests/fragment/z-flare-inES.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _FlareTexture; 2 | lowp vec4 xlat_main( in lowp vec4 color, in highp vec2 texcoord ) { 3 | return (texture2D( _FlareTexture, texcoord) * color); 4 | } 5 | varying lowp vec4 xlv_COLOR; 6 | varying highp vec2 xlv_TEXCOORD0; 7 | void main() { 8 | lowp vec4 xl_retval; 9 | xl_retval = xlat_main( vec4(xlv_COLOR), vec2(xlv_TEXCOORD0)); 10 | gl_FragData[0] = vec4( xl_retval); 11 | } 12 | -------------------------------------------------------------------------------- /tests/fragment/z-flare-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _FlareTexture; 2 | void main () 3 | { 4 | gl_FragData[0] = (texture2D (_FlareTexture, gl_TexCoord[0].xy) * gl_Color); 5 | } 6 | 7 | 8 | // stats: 1 alu 1 tex 0 flow 9 | // inputs: 2 10 | // #0: gl_Color (high float) 4x1 [-1] loc 1 11 | // #1: gl_TexCoord (high float) 4x1 [1] loc 4 12 | // textures: 1 13 | // #0: _FlareTexture (high 2d) 0x0 [-1] 14 | -------------------------------------------------------------------------------- /tests/fragment/z-flare-outES.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _FlareTexture; 2 | varying lowp vec4 xlv_COLOR; 3 | varying highp vec2 xlv_TEXCOORD0; 4 | void main () 5 | { 6 | lowp vec4 tmpvar_1; 7 | tmpvar_1 = (texture2D (_FlareTexture, xlv_TEXCOORD0) * xlv_COLOR); 8 | gl_FragData[0] = tmpvar_1; 9 | } 10 | 11 | 12 | // stats: 1 alu 1 tex 0 flow 13 | // inputs: 2 14 | // #0: xlv_COLOR (low float) 4x1 [-1] 15 | // #1: xlv_TEXCOORD0 (high float) 2x1 [-1] 16 | // textures: 1 17 | // #0: _FlareTexture (low 2d) 0x0 [-1] 18 | -------------------------------------------------------------------------------- /tests/fragment/z-particle-in.txt: -------------------------------------------------------------------------------- 1 | struct v2f { 2 | vec4 vertex; 3 | vec4 color; 4 | vec2 texcoord; 5 | }; 6 | uniform sampler2D _MainTex; 7 | vec4 xlat_main( in v2f i ); 8 | vec4 xlat_main( in v2f i ) { 9 | return (i.color * texture2D( _MainTex, i.texcoord)); 10 | } 11 | varying vec4 xlv_COLOR; 12 | varying vec2 xlv_TEXCOORD0; 13 | void main() { 14 | vec4 xl_retval; 15 | v2f xlt_i; 16 | xlt_i.vertex = vec4(0.0); 17 | xlt_i.color = vec4( xlv_COLOR); 18 | xlt_i.texcoord = vec2( xlv_TEXCOORD0); 19 | xl_retval = xlat_main( xlt_i); 20 | gl_FragData[0] = vec4( xl_retval); 21 | } 22 | -------------------------------------------------------------------------------- /tests/fragment/z-particle-inES.txt: -------------------------------------------------------------------------------- 1 | struct v2f { 2 | highp vec4 vertex; 3 | lowp vec4 color; 4 | mediump vec2 texcoord; 5 | }; 6 | uniform sampler2D _MainTex; 7 | lowp vec4 xlat_main( in v2f i ) { 8 | return (i.color * texture2D( _MainTex, i.texcoord)); 9 | } 10 | varying lowp vec4 xlv_COLOR; 11 | varying mediump vec2 xlv_TEXCOORD0; 12 | void main() { 13 | lowp vec4 xl_retval; 14 | v2f xlt_i; 15 | xlt_i.vertex = vec4(0.0); 16 | xlt_i.color = vec4( xlv_COLOR); 17 | xlt_i.texcoord = vec2( xlv_TEXCOORD0); 18 | xl_retval = xlat_main( xlt_i); 19 | gl_FragData[0] = vec4( xl_retval); 20 | } 21 | -------------------------------------------------------------------------------- /tests/fragment/z-particle-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | varying vec4 xlv_COLOR; 3 | varying vec2 xlv_TEXCOORD0; 4 | void main () 5 | { 6 | gl_FragData[0] = (xlv_COLOR * texture2D (_MainTex, xlv_TEXCOORD0)); 7 | } 8 | 9 | 10 | // stats: 1 alu 1 tex 0 flow 11 | // inputs: 2 12 | // #0: xlv_COLOR (high float) 4x1 [-1] 13 | // #1: xlv_TEXCOORD0 (high float) 2x1 [-1] 14 | // textures: 1 15 | // #0: _MainTex (high 2d) 0x0 [-1] 16 | -------------------------------------------------------------------------------- /tests/fragment/z-particle-outES.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | varying lowp vec4 xlv_COLOR; 3 | varying mediump vec2 xlv_TEXCOORD0; 4 | void main () 5 | { 6 | lowp vec4 tmpvar_1; 7 | tmpvar_1 = (xlv_COLOR * texture2D (_MainTex, xlv_TEXCOORD0)); 8 | gl_FragData[0] = tmpvar_1; 9 | } 10 | 11 | 12 | // stats: 1 alu 1 tex 0 flow 13 | // inputs: 2 14 | // #0: xlv_COLOR (low float) 4x1 [-1] 15 | // #1: xlv_TEXCOORD0 (medium float) 2x1 [-1] 16 | // textures: 1 17 | // #0: _MainTex (low 2d) 0x0 [-1] 18 | -------------------------------------------------------------------------------- /tests/fragment/zun-Bumped_Diffuse-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _BumpMap; 2 | void main () 3 | { 4 | vec4 res_1; 5 | vec3 viewN_2; 6 | vec4 normal_3; 7 | normal_3.xy = ((texture2D (_BumpMap, gl_TexCoord[0].xy).wy * 2.0) - 1.0); 8 | normal_3.z = sqrt(((1.0 - 9 | (normal_3.x * normal_3.x) 10 | ) - (normal_3.y * normal_3.y))); 11 | viewN_2.x = dot (gl_TexCoord[1].xyz, normal_3.xyz); 12 | viewN_2.y = dot (gl_TexCoord[2].xyz, normal_3.xyz); 13 | viewN_2.z = dot (gl_TexCoord[3].xyz, normal_3.xyz); 14 | res_1.xyz = ((viewN_2 * vec3(0.5, 0.5, -0.5)) + 0.5); 15 | res_1.w = 0.0; 16 | gl_FragData[0] = res_1; 17 | } 18 | 19 | 20 | // stats: 13 alu 1 tex 0 flow 21 | // inputs: 1 22 | // #0: gl_TexCoord (high float) 4x1 [4] loc 4 23 | // textures: 1 24 | // #0: _BumpMap (high 2d) 0x0 [-1] 25 | -------------------------------------------------------------------------------- /tests/fragment/zun-Bumped_Diffuse1-out.txt: -------------------------------------------------------------------------------- 1 | uniform vec4 _Color; 2 | uniform sampler2D _LightBuffer; 3 | uniform sampler2D _MainTex; 4 | uniform vec4 unity_Ambient; 5 | void main () 6 | { 7 | vec4 light_1; 8 | vec4 c_2; 9 | c_2 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); 10 | light_1 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); 11 | light_1.xyz = (light_1.xyz + unity_Ambient.xyz); 12 | vec4 c_3; 13 | c_3.xyz = (c_2.xyz * light_1.xyz); 14 | c_3.w = c_2.w; 15 | gl_FragData[0] = c_3; 16 | } 17 | 18 | 19 | // stats: 5 alu 2 tex 0 flow 20 | // inputs: 1 21 | // #0: gl_TexCoord (high float) 4x1 [2] loc 4 22 | // uniforms: 2 (total size: 0) 23 | // #0: _Color (high float) 4x1 [-1] 24 | // #1: unity_Ambient (high float) 4x1 [-1] 25 | // textures: 2 26 | // #0: _LightBuffer (high 2d) 0x0 [-1] 27 | // #1: _MainTex (high 2d) 0x0 [-1] 28 | -------------------------------------------------------------------------------- /tests/fragment/zun-Diffuse1-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | vec4 res_1; 4 | res_1.xyz = ((gl_TexCoord[0].xyz * vec3(0.5, 0.5, -0.5)) + 0.5); 5 | res_1.w = 0.0; 6 | gl_FragData[0] = res_1; 7 | } 8 | 9 | 10 | // stats: 3 alu 0 tex 0 flow 11 | // inputs: 1 12 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 13 | -------------------------------------------------------------------------------- /tests/fragment/zun-Diffuse_Detail1-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | vec4 res_1; 4 | res_1.xyz = ((gl_TexCoord[0].xyz * vec3(0.5, 0.5, -0.5)) + 0.5); 5 | res_1.w = 0.0; 6 | gl_FragData[0] = res_1; 7 | } 8 | 9 | 10 | // stats: 3 alu 0 tex 0 flow 11 | // inputs: 1 12 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 13 | -------------------------------------------------------------------------------- /tests/fragment/zun-Grab_Invert-in.txt: -------------------------------------------------------------------------------- 1 | struct v2f_vertex_lit { 2 | vec2 uv; 3 | vec4 diff; 4 | vec4 spec; 5 | }; 6 | struct v2f_img { 7 | vec4 pos; 8 | vec2 uv; 9 | }; 10 | struct appdata_img { 11 | vec4 vertex; 12 | vec2 texcoord; 13 | }; 14 | struct v2f { 15 | vec4 vertex; 16 | vec4 uv; 17 | }; 18 | uniform sampler2D _GrabTexture; 19 | vec4 frag( in v2f i ); 20 | vec4 frag( in v2f i ) { 21 | return (1.00000 - texture2DProj( _GrabTexture, i.uv)); 22 | } 23 | void main() { 24 | vec4 xl_retval; 25 | v2f xlt_i; 26 | xlt_i.vertex = vec4(0.0); 27 | xlt_i.uv = vec4( gl_TexCoord[0]); 28 | xl_retval = frag( xlt_i); 29 | gl_FragData[0] = vec4( xl_retval); 30 | } 31 | -------------------------------------------------------------------------------- /tests/fragment/zun-Grab_Invert-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _GrabTexture; 2 | void main () 3 | { 4 | gl_FragData[0] = (1.0 - texture2DProj (_GrabTexture, gl_TexCoord[0])); 5 | } 6 | 7 | 8 | // stats: 1 alu 1 tex 0 flow 9 | // inputs: 1 10 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 11 | // textures: 1 12 | // #0: _GrabTexture (high 2d) 0x0 [-1] 13 | -------------------------------------------------------------------------------- /tests/fragment/zun-Hidden_Camera-DepthTexture-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | void main () 3 | { 4 | float x_1; 5 | x_1 = (texture2D (_MainTex, gl_TexCoord[0].xy).w - 0.001); 6 | if ((x_1 < 0.0)) { 7 | discard; 8 | }; 9 | gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0); 10 | } 11 | 12 | 13 | // stats: 3 alu 2 tex 1 flow 14 | // inputs: 1 15 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 16 | // textures: 1 17 | // #0: _MainTex (high 2d) 0x0 [-1] 18 | -------------------------------------------------------------------------------- /tests/fragment/zun-Hidden_Color_Correction_Effect-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | uniform sampler2D _RampTex; 3 | void main () 4 | { 5 | vec4 tmpvar_1; 6 | tmpvar_1 = texture2D (_MainTex, gl_TexCoord[0].xy); 7 | vec4 tmpvar_2; 8 | tmpvar_2.x = (texture2D (_RampTex, tmpvar_1.xx).x + 1e-05); 9 | tmpvar_2.y = (texture2D (_RampTex, tmpvar_1.yy).y + 2e-05); 10 | tmpvar_2.z = (texture2D (_RampTex, tmpvar_1.zz).z + 3e-05); 11 | tmpvar_2.w = tmpvar_1.w; 12 | gl_FragData[0] = tmpvar_2; 13 | } 14 | 15 | 16 | // stats: 3 alu 4 tex 0 flow 17 | // inputs: 1 18 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 19 | // textures: 2 20 | // #0: _MainTex (high 2d) 0x0 [-1] 21 | // #1: _RampTex (high 2d) 0x0 [-1] 22 | -------------------------------------------------------------------------------- /tests/fragment/zun-Hidden_Edge_Detect_X-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | uniform float _Treshold; 3 | void main () 4 | { 5 | vec3 diff_1; 6 | vec4 original_2; 7 | vec4 tmpvar_3; 8 | tmpvar_3 = texture2D (_MainTex, gl_TexCoord[0].xy); 9 | original_2 = tmpvar_3; 10 | diff_1 = (((tmpvar_3.xyz * 2.0) - texture2D (_MainTex, gl_TexCoord[1].xy).xyz) - texture2D (_MainTex, gl_TexCoord[2].xy).xyz); 11 | float tmpvar_4; 12 | tmpvar_4 = dot (diff_1, diff_1); 13 | if ((tmpvar_4 >= _Treshold)) { 14 | original_2.xyz = vec3(0.0, 0.0, 0.0); 15 | }; 16 | gl_FragData[0] = original_2; 17 | } 18 | 19 | 20 | // stats: 6 alu 3 tex 1 flow 21 | // inputs: 1 22 | // #0: gl_TexCoord (high float) 4x1 [3] loc 4 23 | // uniforms: 1 (total size: 0) 24 | // #0: _Treshold (high float) 1x1 [-1] 25 | // textures: 1 26 | // #0: _MainTex (high 2d) 0x0 [-1] 27 | -------------------------------------------------------------------------------- /tests/fragment/zun-Hidden_GlowConeTap-out.txt: -------------------------------------------------------------------------------- 1 | uniform vec4 _Color; 2 | uniform sampler2D _MainTex; 3 | void main () 4 | { 5 | vec4 tmpvar_1; 6 | vec4 tmpvar_2; 7 | tmpvar_1 = gl_TexCoord[0]; 8 | tmpvar_2 = gl_TexCoord[1]; 9 | vec4 c_3; 10 | c_3 = (texture2D (_MainTex, tmpvar_1.xy) + texture2D (_MainTex, tmpvar_1.zw)); 11 | c_3 = (c_3 + texture2D (_MainTex, tmpvar_2.xy)); 12 | c_3 = (c_3 + texture2D (_MainTex, tmpvar_2.zw)); 13 | c_3.xyz = (c_3.xyz * _Color.xyz); 14 | gl_FragData[0] = (c_3 * _Color.w); 15 | } 16 | 17 | 18 | // stats: 5 alu 4 tex 0 flow 19 | // inputs: 1 20 | // #0: gl_TexCoord (high float) 4x1 [2] loc 4 21 | // uniforms: 1 (total size: 0) 22 | // #0: _Color (high float) 4x1 [-1] 23 | // textures: 1 24 | // #0: _MainTex (high 2d) 0x0 [-1] 25 | -------------------------------------------------------------------------------- /tests/fragment/zun-Hidden_Glow_Downsample-out.txt: -------------------------------------------------------------------------------- 1 | uniform vec4 _Color; 2 | uniform sampler2D _MainTex; 3 | void main () 4 | { 5 | vec4 c_1; 6 | c_1 = (texture2D (_MainTex, gl_TexCoord[0].xy) + texture2D (_MainTex, gl_TexCoord[1].xy)); 7 | c_1 = (c_1 + texture2D (_MainTex, gl_TexCoord[2].xy)); 8 | c_1 = (c_1 + texture2D (_MainTex, gl_TexCoord[3].xy)); 9 | c_1 = (c_1 / 4.0); 10 | c_1.xyz = (c_1.xyz * _Color.xyz); 11 | c_1.xyz = (c_1.xyz * (c_1.w + _Color.w)); 12 | c_1.w = 0.0; 13 | gl_FragData[0] = c_1; 14 | } 15 | 16 | 17 | // stats: 8 alu 4 tex 0 flow 18 | // inputs: 1 19 | // #0: gl_TexCoord (high float) 4x1 [4] loc 4 20 | // uniforms: 1 (total size: 0) 21 | // #0: _Color (high float) 4x1 [-1] 22 | // textures: 1 23 | // #0: _MainTex (high 2d) 0x0 [-1] 24 | -------------------------------------------------------------------------------- /tests/fragment/zun-Hidden_Grayscale_Effect-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | uniform float _RampOffset; 3 | uniform sampler2D _RampTex; 4 | void main () 5 | { 6 | vec4 xlat_var_output_1; 7 | vec4 tmpvar_2; 8 | tmpvar_2 = texture2D (_MainTex, gl_TexCoord[0].xy); 9 | vec2 tmpvar_3; 10 | tmpvar_3.y = 0.5; 11 | tmpvar_3.x = (dot (tmpvar_2.xyz, vec3(0.22, 0.707, 0.071)) + _RampOffset); 12 | xlat_var_output_1.xyz = texture2D (_RampTex, tmpvar_3).xyz; 13 | xlat_var_output_1.w = tmpvar_2.w; 14 | gl_FragData[0] = xlat_var_output_1; 15 | } 16 | 17 | 18 | // stats: 3 alu 2 tex 0 flow 19 | // inputs: 1 20 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 21 | // uniforms: 1 (total size: 0) 22 | // #0: _RampOffset (high float) 1x1 [-1] 23 | // textures: 2 24 | // #0: _MainTex (high 2d) 0x0 [-1] 25 | // #1: _RampTex (high 2d) 0x0 [-1] 26 | -------------------------------------------------------------------------------- /tests/fragment/zun-Hidden_Internal-GUITextureBlit-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _GUIClipTexture; 2 | uniform sampler2D _MainTex; 3 | void main () 4 | { 5 | vec4 col_1; 6 | col_1.xyz = (texture2D (_MainTex, gl_TexCoord[0].xy).xyz * gl_Color.xyz); 7 | col_1.w = (gl_Color.w * texture2D (_GUIClipTexture, gl_TexCoord[1].xy).w); 8 | gl_FragData[0] = col_1; 9 | } 10 | 11 | 12 | // stats: 2 alu 2 tex 0 flow 13 | // inputs: 2 14 | // #0: gl_Color (high float) 4x1 [-1] loc 1 15 | // #1: gl_TexCoord (high float) 4x1 [2] loc 4 16 | // textures: 2 17 | // #0: _GUIClipTexture (high 2d) 0x0 [-1] 18 | // #1: _MainTex (high 2d) 0x0 [-1] 19 | -------------------------------------------------------------------------------- /tests/fragment/zun-Hidden_Internal-GUITextureClip-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _GUIClipTexture; 2 | uniform sampler2D _MainTex; 3 | void main () 4 | { 5 | vec4 col_1; 6 | col_1 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color); 7 | col_1.w = (col_1.w * texture2D (_GUIClipTexture, gl_TexCoord[1].xy).w); 8 | gl_FragData[0] = col_1; 9 | } 10 | 11 | 12 | // stats: 2 alu 2 tex 0 flow 13 | // inputs: 2 14 | // #0: gl_Color (high float) 4x1 [-1] loc 1 15 | // #1: gl_TexCoord (high float) 4x1 [2] loc 4 16 | // textures: 2 17 | // #0: _GUIClipTexture (high 2d) 0x0 [-1] 18 | // #1: _MainTex (high 2d) 0x0 [-1] 19 | -------------------------------------------------------------------------------- /tests/fragment/zun-Hidden_Internal-Halo-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _HaloFalloff; 2 | void main () 3 | { 4 | vec4 tmpvar_1; 5 | tmpvar_1 = texture2D (_HaloFalloff, gl_TexCoord[0].xy); 6 | vec4 tmpvar_2; 7 | tmpvar_2.xyz = (gl_Color.xyz * tmpvar_1.w); 8 | tmpvar_2.w = tmpvar_1.w; 9 | gl_FragData[0] = tmpvar_2; 10 | } 11 | 12 | 13 | // stats: 1 alu 1 tex 0 flow 14 | // inputs: 2 15 | // #0: gl_Color (high float) 4x1 [-1] loc 1 16 | // #1: gl_TexCoord (high float) 4x1 [1] loc 4 17 | // textures: 1 18 | // #0: _HaloFalloff (high 2d) 0x0 [-1] 19 | -------------------------------------------------------------------------------- /tests/fragment/zun-Hidden_Sepiatone_Effect-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | void main () 3 | { 4 | vec4 xlat_var_output_1; 5 | vec4 tmpvar_2; 6 | tmpvar_2 = texture2D (_MainTex, gl_TexCoord[0].xy); 7 | xlat_var_output_1.xyz = (vec4(0.191, -0.054, -0.221, 0.0) + dot (vec3(0.299, 0.587, 0.114), tmpvar_2.xyz)).xyz; 8 | xlat_var_output_1.w = tmpvar_2.w; 9 | gl_FragData[0] = xlat_var_output_1; 10 | } 11 | 12 | 13 | // stats: 2 alu 1 tex 0 flow 14 | // inputs: 1 15 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 16 | // textures: 1 17 | // #0: _MainTex (high 2d) 0x0 [-1] 18 | -------------------------------------------------------------------------------- /tests/fragment/zun-Hidden_ShowDepthTexture-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _CameraDepthTexture; 2 | uniform sampler2D _MainTex; 3 | uniform vec4 _ZBufferParams; 4 | void main () 5 | { 6 | vec2 tmpvar_1; 7 | tmpvar_1 = gl_TexCoord[0].xy; 8 | vec4 col_2; 9 | col_2.zw = texture2D (_MainTex, tmpvar_1).zw; 10 | col_2.xy = vec2(((1.0/(( 11 | (_ZBufferParams.z * texture2D (_CameraDepthTexture, tmpvar_1).x) 12 | + _ZBufferParams.w))) * 0.01)); 13 | gl_FragData[0] = col_2; 14 | } 15 | 16 | 17 | // stats: 4 alu 2 tex 0 flow 18 | // inputs: 1 19 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 20 | // uniforms: 1 (total size: 0) 21 | // #0: _ZBufferParams (high float) 4x1 [-1] 22 | // textures: 2 23 | // #0: _CameraDepthTexture (high 2d) 0x0 [-1] 24 | // #1: _MainTex (high 2d) 0x0 [-1] 25 | -------------------------------------------------------------------------------- /tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | void main () 3 | { 4 | vec4 col_1; 5 | vec4 tmpvar_2; 6 | tmpvar_2 = texture2D (_MainTex, gl_TexCoord[0].xy); 7 | col_1.w = tmpvar_2.w; 8 | col_1.xyz = (tmpvar_2.xyz * gl_Color.xyz); 9 | if ((tmpvar_2.w < 0.0)) { 10 | discard; 11 | }; 12 | gl_FragData[0] = col_1; 13 | } 14 | 15 | 16 | // stats: 2 alu 2 tex 1 flow 17 | // inputs: 2 18 | // #0: gl_Color (high float) 4x1 [-1] loc 1 19 | // #1: gl_TexCoord (high float) 4x1 [1] loc 4 20 | // textures: 1 21 | // #0: _MainTex (high 2d) 0x0 [-1] 22 | -------------------------------------------------------------------------------- /tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt: -------------------------------------------------------------------------------- 1 | uniform float _Cutoff; 2 | uniform sampler2D _MainTex; 3 | void main () 4 | { 5 | float x_1; 6 | x_1 = ((texture2D (_MainTex, gl_TexCoord[1].xy) * gl_Color).w - _Cutoff); 7 | if ((x_1 < 0.0)) { 8 | discard; 9 | }; 10 | gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0); 11 | } 12 | 13 | 14 | // stats: 4 alu 2 tex 1 flow 15 | // inputs: 2 16 | // #0: gl_Color (high float) 4x1 [-1] loc 1 17 | // #1: gl_TexCoord (high float) 4x1 [2] loc 4 18 | // uniforms: 1 (total size: 0) 19 | // #0: _Cutoff (high float) 1x1 [-1] 20 | // textures: 1 21 | // #0: _MainTex (high 2d) 0x0 [-1] 22 | -------------------------------------------------------------------------------- /tests/fragment/zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | void main () 3 | { 4 | gl_FragData[0] = (texture2D (_MainTex, gl_TexCoord[0].xy) * vec4(1.0, 0.0, 0.0, 1.0)); 5 | } 6 | 7 | 8 | // stats: 1 alu 1 tex 0 flow 9 | // inputs: 1 10 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 11 | // textures: 1 12 | // #0: _MainTex (high 2d) 0x0 [-1] 13 | -------------------------------------------------------------------------------- /tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | void main () 3 | { 4 | vec4 col_1; 5 | col_1.w = gl_Color.w; 6 | col_1.xyz = (gl_Color.xyz * (2.0 * texture2D (_MainTex, gl_TexCoord[0].xy).xyz)); 7 | gl_FragData[0] = col_1; 8 | } 9 | 10 | 11 | // stats: 2 alu 1 tex 0 flow 12 | // inputs: 2 13 | // #0: gl_Color (high float) 4x1 [-1] loc 1 14 | // #1: gl_TexCoord (high float) 4x1 [1] loc 4 15 | // textures: 1 16 | // #0: _MainTex (high 2d) 0x0 [-1] 17 | -------------------------------------------------------------------------------- /tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt: -------------------------------------------------------------------------------- 1 | uniform float _HalfOverCutoff; 2 | uniform sampler2D _MainTex; 3 | void main () 4 | { 5 | vec4 col_1; 6 | vec4 tmpvar_2; 7 | tmpvar_2 = texture2D (_MainTex, gl_TexCoord[0].xy); 8 | col_1.xyz = (tmpvar_2.xyz * (2.0 * gl_Color.xyz)); 9 | col_1.w = (tmpvar_2.w * (2.0 * _HalfOverCutoff)); 10 | float x_3; 11 | x_3 = (col_1.w - 1.0); 12 | if ((x_3 < 0.0)) { 13 | discard; 14 | }; 15 | gl_FragData[0] = col_1; 16 | } 17 | 18 | 19 | // stats: 6 alu 2 tex 1 flow 20 | // inputs: 2 21 | // #0: gl_Color (high float) 4x1 [-1] loc 1 22 | // #1: gl_TexCoord (high float) 4x1 [1] loc 4 23 | // uniforms: 1 (total size: 0) 24 | // #0: _HalfOverCutoff (high float) 1x1 [-1] 25 | // textures: 1 26 | // #0: _MainTex (high 2d) 0x0 [-1] 27 | -------------------------------------------------------------------------------- /tests/fragment/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | void main () 3 | { 4 | vec4 col_1; 5 | col_1.xyz = (texture2D (_MainTex, gl_TexCoord[0].xy).xyz * (gl_TexCoord[1].xyz * 2.0)); 6 | col_1.w = 1.0; 7 | gl_FragData[0] = col_1; 8 | } 9 | 10 | 11 | // stats: 3 alu 1 tex 0 flow 12 | // inputs: 1 13 | // #0: gl_TexCoord (high float) 4x1 [2] loc 4 14 | // textures: 1 15 | // #0: _MainTex (high 2d) 0x0 [-1] 16 | -------------------------------------------------------------------------------- /tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt: -------------------------------------------------------------------------------- 1 | uniform float _HalfOverCutoff; 2 | uniform sampler2D _MainTex; 3 | void main () 4 | { 5 | vec4 col_1; 6 | vec4 tmpvar_2; 7 | tmpvar_2 = texture2D (_MainTex, gl_TexCoord[0].xy); 8 | col_1.xyz = (tmpvar_2.xyz * (gl_TexCoord[1].xyz * 2.0)); 9 | col_1.w = (tmpvar_2.w * (2.0 * _HalfOverCutoff)); 10 | float x_3; 11 | x_3 = (col_1.w - 1.0); 12 | if ((x_3 < 0.0)) { 13 | discard; 14 | }; 15 | gl_FragData[0] = col_1; 16 | } 17 | 18 | 19 | // stats: 6 alu 2 tex 1 flow 20 | // inputs: 1 21 | // #0: gl_TexCoord (high float) 4x1 [2] loc 4 22 | // uniforms: 1 (total size: 0) 23 | // #0: _HalfOverCutoff (high float) 1x1 [-1] 24 | // textures: 1 25 | // #0: _MainTex (high 2d) 0x0 [-1] 26 | -------------------------------------------------------------------------------- /tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0); 4 | } 5 | 6 | 7 | // stats: 1 alu 0 tex 0 flow 8 | -------------------------------------------------------------------------------- /tests/fragment/zun-Hidden_Twirt_Effect_Shader-out.txt: -------------------------------------------------------------------------------- 1 | uniform vec4 _CenterRadius; 2 | uniform sampler2D _MainTex; 3 | uniform mat4 _RotationMatrix; 4 | void main () 5 | { 6 | vec2 tmpvar_1; 7 | tmpvar_1 = gl_TexCoord[0].xy; 8 | vec2 tmp_2; 9 | vec4 tmpvar_3; 10 | tmpvar_3.zw = vec2(0.0, 0.0); 11 | tmpvar_3.xy = tmpvar_1; 12 | tmp_2 = (tmpvar_1 / _CenterRadius.zw); 13 | gl_FragData[0] = texture2D (_MainTex, (mix ((_RotationMatrix * tmpvar_3).xy, tmpvar_1, vec2(min (1.0, 14 | sqrt(dot (tmp_2, tmp_2)) 15 | ))) + _CenterRadius.xy)); 16 | } 17 | 18 | 19 | // stats: 8 alu 1 tex 0 flow 20 | // inputs: 1 21 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 22 | // uniforms: 2 (total size: 0) 23 | // #0: _CenterRadius (high float) 4x1 [-1] 24 | // #1: _RotationMatrix (high float) 4x4 [-1] 25 | // textures: 1 26 | // #0: _MainTex (high 2d) 0x0 [-1] 27 | -------------------------------------------------------------------------------- /tests/fragment/zun-Nature_My_Soft_Occlusion_Leaves-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | void main () 3 | { 4 | gl_FragData[0] = (texture2D (_MainTex, gl_TexCoord[0].xy) * vec4(1.0, 0.0, 0.0, 1.0)); 5 | } 6 | 7 | 8 | // stats: 1 alu 1 tex 0 flow 9 | // inputs: 1 10 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 11 | // textures: 1 12 | // #0: _MainTex (high 2d) 0x0 [-1] 13 | -------------------------------------------------------------------------------- /tests/fragment/zun-Nature_Soft_Occlusion_Bark2-out.txt: -------------------------------------------------------------------------------- 1 | uniform vec4 _LightPositionRange; 2 | void main () 3 | { 4 | vec3 tmpvar_1; 5 | tmpvar_1 = gl_TexCoord[0].xyz; 6 | vec4 enc_2; 7 | enc_2 = (vec4(1.0, 255.0, 65025.0, 1.60581e+08) * (sqrt( 8 | dot (tmpvar_1, tmpvar_1) 9 | ) * _LightPositionRange.w)); 10 | vec4 tmpvar_3; 11 | tmpvar_3 = fract(enc_2); 12 | enc_2 = (tmpvar_3 - (tmpvar_3.yzww * 0.00392157)); 13 | gl_FragData[0] = enc_2; 14 | } 15 | 16 | 17 | // stats: 7 alu 0 tex 0 flow 18 | // inputs: 1 19 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 20 | // uniforms: 1 (total size: 0) 21 | // #0: _LightPositionRange (high float) 4x1 [-1] 22 | -------------------------------------------------------------------------------- /tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-out.txt: -------------------------------------------------------------------------------- 1 | uniform vec4 _Color; 2 | uniform float _Cutoff; 3 | uniform sampler2D _MainTex; 4 | void main () 5 | { 6 | vec4 col_1; 7 | col_1 = (_Color * texture2D (_MainTex, gl_TexCoord[0].xy)); 8 | float x_2; 9 | x_2 = (col_1.w - _Cutoff); 10 | if ((x_2 < 0.0)) { 11 | discard; 12 | }; 13 | gl_FragData[0] = col_1; 14 | } 15 | 16 | 17 | // stats: 3 alu 2 tex 1 flow 18 | // inputs: 1 19 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 20 | // uniforms: 2 (total size: 0) 21 | // #0: _Color (high float) 4x1 [-1] 22 | // #1: _Cutoff (high float) 1x1 [-1] 23 | // textures: 1 24 | // #0: _MainTex (high 2d) 0x0 [-1] 25 | -------------------------------------------------------------------------------- /tests/fragment/zun-Particles_Additive-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | uniform vec4 _TintColor; 3 | void main () 4 | { 5 | gl_FragData[0] = (((2.0 * gl_Color) * _TintColor) * texture2D (_MainTex, gl_TexCoord[0].xy)); 6 | } 7 | 8 | 9 | // stats: 3 alu 1 tex 0 flow 10 | // inputs: 2 11 | // #0: gl_Color (high float) 4x1 [-1] loc 1 12 | // #1: gl_TexCoord (high float) 4x1 [1] loc 4 13 | // uniforms: 1 (total size: 0) 14 | // #0: _TintColor (high float) 4x1 [-1] 15 | // textures: 1 16 | // #0: _MainTex (high 2d) 0x0 [-1] 17 | -------------------------------------------------------------------------------- /tests/fragment/zun-Particles_Additive_(Soft)-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | void main () 3 | { 4 | vec4 prev_1; 5 | prev_1 = (gl_Color * texture2D (_MainTex, gl_TexCoord[0].xy)); 6 | prev_1.xyz = (prev_1.xyz * prev_1.w); 7 | gl_FragData[0] = prev_1; 8 | } 9 | 10 | 11 | // stats: 2 alu 1 tex 0 flow 12 | // inputs: 2 13 | // #0: gl_Color (high float) 4x1 [-1] loc 1 14 | // #1: gl_TexCoord (high float) 4x1 [1] loc 4 15 | // textures: 1 16 | // #0: _MainTex (high 2d) 0x0 [-1] 17 | -------------------------------------------------------------------------------- /tests/fragment/zun-Particles_Alpha_Blended_Premultiply-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | void main () 3 | { 4 | gl_FragData[0] = ((gl_Color * texture2D (_MainTex, gl_TexCoord[0].xy)) * gl_Color.w); 5 | } 6 | 7 | 8 | // stats: 2 alu 1 tex 0 flow 9 | // inputs: 2 10 | // #0: gl_Color (high float) 4x1 [-1] loc 1 11 | // #1: gl_TexCoord (high float) 4x1 [1] loc 4 12 | // textures: 1 13 | // #0: _MainTex (high 2d) 0x0 [-1] 14 | -------------------------------------------------------------------------------- /tests/fragment/zun-Particles_Multiply-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | void main () 3 | { 4 | vec4 prev_1; 5 | prev_1 = (gl_Color * texture2D (_MainTex, gl_TexCoord[0].xy)); 6 | gl_FragData[0] = mix (vec4(1.0, 1.0, 1.0, 1.0), prev_1, prev_1.wwww); 7 | } 8 | 9 | 10 | // stats: 2 alu 1 tex 0 flow 11 | // inputs: 2 12 | // #0: gl_Color (high float) 4x1 [-1] loc 1 13 | // #1: gl_TexCoord (high float) 4x1 [1] loc 4 14 | // textures: 1 15 | // #0: _MainTex (high 2d) 0x0 [-1] 16 | -------------------------------------------------------------------------------- /tests/fragment/zun-Particles_Multiply_(Double)-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | void main () 3 | { 4 | vec4 col_1; 5 | vec4 tmpvar_2; 6 | tmpvar_2 = texture2D (_MainTex, gl_TexCoord[0].xy); 7 | col_1.xyz = ((tmpvar_2.xyz * gl_Color.xyz) * 2.0); 8 | col_1.w = (gl_Color.w * tmpvar_2.w); 9 | gl_FragData[0] = mix (vec4(0.5, 0.5, 0.5, 0.5), col_1, col_1.wwww); 10 | } 11 | 12 | 13 | // stats: 4 alu 1 tex 0 flow 14 | // inputs: 2 15 | // #0: gl_Color (high float) 4x1 [-1] loc 1 16 | // #1: gl_TexCoord (high float) 4x1 [1] loc 4 17 | // textures: 1 18 | // #0: _MainTex (high 2d) 0x0 [-1] 19 | -------------------------------------------------------------------------------- /tests/fragment/zun-Particles__Additive-Multiply-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | uniform vec4 _TintColor; 3 | void main () 4 | { 5 | vec4 col_1; 6 | vec4 tmpvar_2; 7 | tmpvar_2 = texture2D (_MainTex, gl_TexCoord[0].xy); 8 | col_1.xyz = ((_TintColor.xyz * tmpvar_2.xyz) * (gl_Color.xyz * 2.0)); 9 | col_1.w = ((1.0 - tmpvar_2.w) * ((_TintColor.w * gl_Color.w) * 2.0)); 10 | gl_FragData[0] = col_1; 11 | } 12 | 13 | 14 | // stats: 7 alu 1 tex 0 flow 15 | // inputs: 2 16 | // #0: gl_Color (high float) 4x1 [-1] loc 1 17 | // #1: gl_TexCoord (high float) 4x1 [1] loc 4 18 | // uniforms: 1 (total size: 0) 19 | // #0: _TintColor (high float) 4x1 [-1] 20 | // textures: 1 21 | // #0: _MainTex (high 2d) 0x0 [-1] 22 | -------------------------------------------------------------------------------- /tests/fragment/zun-Reflective_Specular1-out.txt: -------------------------------------------------------------------------------- 1 | uniform float _Shininess; 2 | void main () 3 | { 4 | vec4 res_1; 5 | res_1.xyz = ((gl_TexCoord[0].xyz * vec3(0.5, 0.5, -0.5)) + 0.5); 6 | res_1.w = _Shininess; 7 | gl_FragData[0] = res_1; 8 | } 9 | 10 | 11 | // stats: 2 alu 0 tex 0 flow 12 | // inputs: 1 13 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 14 | // uniforms: 1 (total size: 0) 15 | // #0: _Shininess (high float) 1x1 [-1] 16 | -------------------------------------------------------------------------------- /tests/fragment/zun-RenderFX_Skybox-out.txt: -------------------------------------------------------------------------------- 1 | uniform vec4 _Tint; 2 | uniform sampler2D _UpTex; 3 | void main () 4 | { 5 | vec4 col_1; 6 | vec4 tmpvar_2; 7 | tmpvar_2 = texture2D (_UpTex, gl_TexCoord[0].xy); 8 | col_1.xyz = ((tmpvar_2.xyz + _Tint.xyz) - 0.5); 9 | col_1.w = (tmpvar_2.w * _Tint.w); 10 | gl_FragData[0] = col_1; 11 | } 12 | 13 | 14 | // stats: 3 alu 1 tex 0 flow 15 | // inputs: 1 16 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 17 | // uniforms: 1 (total size: 0) 18 | // #0: _Tint (high float) 4x1 [-1] 19 | // textures: 1 20 | // #0: _UpTex (high 2d) 0x0 [-1] 21 | -------------------------------------------------------------------------------- /tests/fragment/zun-RenderFX_Skybox_Cubed-out.txt: -------------------------------------------------------------------------------- 1 | uniform samplerCube _Tex; 2 | uniform vec4 _Tint; 3 | void main () 4 | { 5 | vec4 col_1; 6 | vec4 tmpvar_2; 7 | tmpvar_2 = textureCube (_Tex, gl_TexCoord[0].xyz); 8 | col_1.xyz = ((tmpvar_2.xyz + _Tint.xyz) - 0.5); 9 | col_1.w = (tmpvar_2.w * _Tint.w); 10 | gl_FragData[0] = col_1; 11 | } 12 | 13 | 14 | // stats: 3 alu 1 tex 0 flow 15 | // inputs: 1 16 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 17 | // uniforms: 1 (total size: 0) 18 | // #0: _Tint (high float) 4x1 [-1] 19 | // textures: 1 20 | // #0: _Tex (high cube) 0x0 [-1] 21 | -------------------------------------------------------------------------------- /tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _BumpMap; 2 | void main () 3 | { 4 | vec4 res_1; 5 | vec3 viewN_2; 6 | vec4 normal_3; 7 | normal_3.xy = ((texture2D (_BumpMap, gl_TexCoord[0].xy).wy * 2.0) - 1.0); 8 | normal_3.z = sqrt(((1.0 - 9 | (normal_3.x * normal_3.x) 10 | ) - (normal_3.y * normal_3.y))); 11 | viewN_2.x = dot (gl_TexCoord[1].xyz, normal_3.xyz); 12 | viewN_2.y = dot (gl_TexCoord[2].xyz, normal_3.xyz); 13 | viewN_2.z = dot (gl_TexCoord[3].xyz, normal_3.xyz); 14 | res_1.xyz = ((viewN_2 * vec3(0.5, 0.5, -0.5)) + 0.5); 15 | res_1.w = 0.0; 16 | gl_FragData[0] = res_1; 17 | } 18 | 19 | 20 | // stats: 13 alu 1 tex 0 flow 21 | // inputs: 1 22 | // #0: gl_TexCoord (high float) 4x1 [4] loc 4 23 | // textures: 1 24 | // #0: _BumpMap (high 2d) 0x0 [-1] 25 | -------------------------------------------------------------------------------- /tests/fragment/zun-Self-Illumin_Specular1-out.txt: -------------------------------------------------------------------------------- 1 | uniform float _Shininess; 2 | void main () 3 | { 4 | vec4 res_1; 5 | res_1.xyz = ((gl_TexCoord[0].xyz * vec3(0.5, 0.5, -0.5)) + 0.5); 6 | res_1.w = _Shininess; 7 | gl_FragData[0] = res_1; 8 | } 9 | 10 | 11 | // stats: 2 alu 0 tex 0 flow 12 | // inputs: 1 13 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 14 | // uniforms: 1 (total size: 0) 15 | // #0: _Shininess (high float) 1x1 [-1] 16 | -------------------------------------------------------------------------------- /tests/fragment/zun-Specular1-out.txt: -------------------------------------------------------------------------------- 1 | uniform float _Shininess; 2 | void main () 3 | { 4 | vec4 res_1; 5 | res_1.xyz = ((gl_TexCoord[0].xyz * vec3(0.5, 0.5, -0.5)) + 0.5); 6 | res_1.w = _Shininess; 7 | gl_FragData[0] = res_1; 8 | } 9 | 10 | 11 | // stats: 2 alu 0 tex 0 flow 12 | // inputs: 1 13 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 14 | // uniforms: 1 (total size: 0) 15 | // #0: _Shininess (high float) 1x1 [-1] 16 | -------------------------------------------------------------------------------- /tests/fragment/zun-Surface_Colored_Specular1-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | vec4 res_1; 4 | res_1.xyz = ((gl_TexCoord[0].xyz * vec3(0.5, 0.5, -0.5)) + 0.5); 5 | res_1.w = 0.25; 6 | gl_FragData[0] = res_1; 7 | } 8 | 9 | 10 | // stats: 3 alu 0 tex 0 flow 11 | // inputs: 1 12 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 13 | -------------------------------------------------------------------------------- /tests/fragment/zun-Surface_Custom_Data1-out.txt: -------------------------------------------------------------------------------- 1 | uniform vec4 _LightColor0; 2 | uniform sampler2D _LightTexture0; 3 | void main () 4 | { 5 | vec4 c_1; 6 | vec4 c_2; 7 | c_2.xyz = ((gl_TexCoord[0].xyz * _LightColor0.xyz) * (( 8 | max (0.0, dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz)) 9 | * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0)); 10 | c_2.w = 0.0; 11 | c_1.xyz = c_2.xyz; 12 | c_1.w = 0.0; 13 | gl_FragData[0] = c_1; 14 | } 15 | 16 | 17 | // stats: 8 alu 1 tex 0 flow 18 | // inputs: 1 19 | // #0: gl_TexCoord (high float) 4x1 [4] loc 4 20 | // uniforms: 1 (total size: 0) 21 | // #0: _LightColor0 (high float) 4x1 [-1] 22 | // textures: 1 23 | // #0: _LightTexture0 (high 2d) 0x0 [-1] 24 | -------------------------------------------------------------------------------- /tests/fragment/zun-Surface_DecalAdd-out.txt: -------------------------------------------------------------------------------- 1 | uniform vec4 _LightColor0; 2 | uniform sampler2D _LightTexture0; 3 | uniform sampler2D _MainTex; 4 | void main () 5 | { 6 | vec4 c_1; 7 | vec4 c_2; 8 | c_2.xyz = (((texture2D (_MainTex, gl_TexCoord[0].xy).xyz * 0.5) * _LightColor0.xyz) * (( 9 | max (0.0, dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz)) 10 | * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0)); 11 | c_2.w = 0.0; 12 | c_1.xyz = c_2.xyz; 13 | c_1.w = 0.0; 14 | gl_FragData[0] = c_1; 15 | } 16 | 17 | 18 | // stats: 9 alu 2 tex 0 flow 19 | // inputs: 1 20 | // #0: gl_TexCoord (high float) 4x1 [4] loc 4 21 | // uniforms: 1 (total size: 0) 22 | // #0: _LightColor0 (high float) 4x1 [-1] 23 | // textures: 2 24 | // #0: _LightTexture0 (high 2d) 0x0 [-1] 25 | // #1: _MainTex (high 2d) 0x0 [-1] 26 | -------------------------------------------------------------------------------- /tests/fragment/zun-Surface_Diffuse_Wrapped-out.txt: -------------------------------------------------------------------------------- 1 | uniform vec4 _LightColor0; 2 | uniform sampler2D _LightTexture0; 3 | uniform sampler2D _MainTex; 4 | void main () 5 | { 6 | vec4 c_1; 7 | vec4 c_2; 8 | c_2.xyz = ((texture2D (_MainTex, gl_TexCoord[0].xy).xyz * _LightColor0.xyz) * (( 9 | ((dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz) * 0.5) + 0.5) 10 | * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0)); 11 | c_2.w = 0.0; 12 | c_1.xyz = c_2.xyz; 13 | c_1.w = 0.0; 14 | gl_FragData[0] = c_1; 15 | } 16 | 17 | 18 | // stats: 9 alu 2 tex 0 flow 19 | // inputs: 1 20 | // #0: gl_TexCoord (high float) 4x1 [4] loc 4 21 | // uniforms: 1 (total size: 0) 22 | // #0: _LightColor0 (high float) 4x1 [-1] 23 | // textures: 2 24 | // #0: _LightTexture0 (high 2d) 0x0 [-1] 25 | // #1: _MainTex (high 2d) 0x0 [-1] 26 | -------------------------------------------------------------------------------- /tests/fragment/zun-Surface_Rim-out.txt: -------------------------------------------------------------------------------- 1 | uniform vec4 _LightColor0; 2 | uniform sampler2D _MainTex; 3 | void main () 4 | { 5 | vec4 c_1; 6 | vec4 c_2; 7 | c_2.xyz = ((texture2D (_MainTex, gl_TexCoord[0].xy).xyz * _LightColor0.xyz) * (max (0.0, 8 | dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz) 9 | ) * 2.0)); 10 | c_2.w = 0.0; 11 | c_1.xyz = c_2.xyz; 12 | c_1.w = 0.0; 13 | gl_FragData[0] = c_1; 14 | } 15 | 16 | 17 | // stats: 7 alu 1 tex 0 flow 18 | // inputs: 1 19 | // #0: gl_TexCoord (high float) 4x1 [3] loc 4 20 | // uniforms: 1 (total size: 0) 21 | // #0: _LightColor0 (high float) 4x1 [-1] 22 | // textures: 1 23 | // #0: _MainTex (high 2d) 0x0 [-1] 24 | -------------------------------------------------------------------------------- /tests/fragment/zun-Surface_ScreenPos2-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | vec4 res_1; 4 | res_1.xyz = ((gl_TexCoord[0].xyz * vec3(0.5, 0.5, -0.5)) + 0.5); 5 | res_1.w = 0.0; 6 | gl_FragData[0] = res_1; 7 | } 8 | 9 | 10 | // stats: 3 alu 0 tex 0 flow 11 | // inputs: 1 12 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 13 | -------------------------------------------------------------------------------- /tests/fragment/zun-Surface_ScreenPosAlbedo-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | vec4 res_1; 4 | res_1.xyz = ((gl_TexCoord[0].xyz * vec3(0.5, 0.5, -0.5)) + 0.5); 5 | res_1.w = 0.0; 6 | gl_FragData[0] = res_1; 7 | } 8 | 9 | 10 | // stats: 3 alu 0 tex 0 flow 11 | // inputs: 1 12 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 13 | -------------------------------------------------------------------------------- /tests/fragment/zun-Surface_WorldRefl-out.txt: -------------------------------------------------------------------------------- 1 | uniform samplerCube _Cube; 2 | uniform vec4 _LightColor0; 3 | void main () 4 | { 5 | vec4 c_1; 6 | vec4 c_2; 7 | c_2.xyz = ((textureCube (_Cube, gl_TexCoord[0].xyz).xyz * _LightColor0.xyz) * (max (0.0, 8 | dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz) 9 | ) * 2.0)); 10 | c_2.w = 0.0; 11 | c_1.xyz = c_2.xyz; 12 | c_1.w = 0.0; 13 | gl_FragData[0] = c_1; 14 | } 15 | 16 | 17 | // stats: 7 alu 1 tex 0 flow 18 | // inputs: 1 19 | // #0: gl_TexCoord (high float) 4x1 [3] loc 4 20 | // uniforms: 1 (total size: 0) 21 | // #0: _LightColor0 (high float) 4x1 [-1] 22 | // textures: 1 23 | // #0: _Cube (high cube) 0x0 [-1] 24 | -------------------------------------------------------------------------------- /tests/fragment/zun-Surface_WorldRefl1-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | vec4 res_1; 4 | res_1.xyz = ((gl_TexCoord[0].xyz * vec3(0.5, 0.5, -0.5)) + 0.5); 5 | res_1.w = 0.0; 6 | gl_FragData[0] = res_1; 7 | } 8 | 9 | 10 | // stats: 3 alu 0 tex 0 flow 11 | // inputs: 1 12 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 13 | -------------------------------------------------------------------------------- /tests/fragment/zun-Test_CgNormals-in.txt: -------------------------------------------------------------------------------- 1 | struct v2f_vertex_lit { 2 | vec2 uv; 3 | vec4 diff; 4 | vec4 spec; 5 | }; 6 | struct v2f_img { 7 | vec4 pos; 8 | vec2 uv; 9 | }; 10 | struct appdata_img { 11 | vec4 vertex; 12 | vec2 texcoord; 13 | }; 14 | struct v2f { 15 | vec4 pos; 16 | vec4 color; 17 | }; 18 | struct appdata_base { 19 | vec4 vertex; 20 | vec3 normal; 21 | vec4 texcoord; 22 | }; 23 | vec4 frag( in v2f i ); 24 | vec4 frag( in v2f i ) { 25 | return i.color; 26 | } 27 | void main() { 28 | vec4 xl_retval; 29 | v2f xlt_i; 30 | xlt_i.pos = vec4(0.0); 31 | xlt_i.color = vec4( gl_Color); 32 | xl_retval = frag( xlt_i); 33 | gl_FragData[0] = vec4( xl_retval); 34 | } 35 | -------------------------------------------------------------------------------- /tests/fragment/zun-Test_CgNormals-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | gl_FragData[0] = gl_Color; 4 | } 5 | 6 | 7 | // stats: 0 alu 0 tex 0 flow 8 | // inputs: 1 9 | // #0: gl_Color (high float) 4x1 [-1] loc 1 10 | -------------------------------------------------------------------------------- /tests/fragment/zun-Test_FontShaderCull-in.txt: -------------------------------------------------------------------------------- 1 | struct v2f_vertex_lit { 2 | vec2 uv; 3 | vec4 diff; 4 | vec4 spec; 5 | }; 6 | struct v2f_img { 7 | vec4 pos; 8 | vec2 uv; 9 | }; 10 | struct appdata_img { 11 | vec4 vertex; 12 | vec2 texcoord; 13 | }; 14 | struct v2f { 15 | vec4 vertex; 16 | vec2 texcoord; 17 | }; 18 | struct appdata_t { 19 | vec4 vertex; 20 | vec2 texcoord; 21 | }; 22 | uniform vec4 _Color; 23 | uniform sampler2D _MainTex; 24 | vec4 frag( in v2f i ); 25 | vec4 frag( in v2f i ) { 26 | return (texture2D( _MainTex, i.texcoord) * _Color); 27 | } 28 | void main() { 29 | vec4 xl_retval; 30 | v2f xlt_i; 31 | xlt_i.vertex = vec4(0.0); 32 | xlt_i.texcoord = vec2( gl_TexCoord[0]); 33 | xl_retval = frag( xlt_i); 34 | gl_FragData[0] = vec4( xl_retval); 35 | } 36 | -------------------------------------------------------------------------------- /tests/fragment/zun-Test_FontShaderCull-out.txt: -------------------------------------------------------------------------------- 1 | uniform vec4 _Color; 2 | uniform sampler2D _MainTex; 3 | void main () 4 | { 5 | gl_FragData[0] = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); 6 | } 7 | 8 | 9 | // stats: 1 alu 1 tex 0 flow 10 | // inputs: 1 11 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 12 | // uniforms: 1 (total size: 0) 13 | // #0: _Color (high float) 4x1 [-1] 14 | // textures: 1 15 | // #0: _MainTex (high 2d) 0x0 [-1] 16 | -------------------------------------------------------------------------------- /tests/fragment/zun-Test_VertexShaderDepthTexture-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _CameraDepthTexture; 2 | uniform vec4 _ZBufferParams; 3 | void main () 4 | { 5 | gl_FragData[0] = vec4((1.0 - (1.0/(( 6 | (_ZBufferParams.x * texture2D (_CameraDepthTexture, gl_TexCoord[0].xy).x) 7 | + _ZBufferParams.y))))); 8 | } 9 | 10 | 11 | // stats: 4 alu 1 tex 0 flow 12 | // inputs: 1 13 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 14 | // uniforms: 1 (total size: 0) 15 | // #0: _ZBufferParams (high float) 4x1 [-1] 16 | // textures: 1 17 | // #0: _CameraDepthTexture (high 2d) 0x0 [-1] 18 | -------------------------------------------------------------------------------- /tests/fragment/zun-Test_VertexShaderTexture-in.txt: -------------------------------------------------------------------------------- 1 | struct v2f_vertex_lit { 2 | vec2 uv; 3 | vec4 diff; 4 | vec4 spec; 5 | }; 6 | struct v2f_img { 7 | vec4 pos; 8 | vec2 uv; 9 | }; 10 | struct appdata_img { 11 | vec4 vertex; 12 | vec2 texcoord; 13 | }; 14 | struct v2f { 15 | vec4 pos; 16 | vec2 uv; 17 | }; 18 | struct appdata_base { 19 | vec4 vertex; 20 | vec3 normal; 21 | vec4 texcoord; 22 | }; 23 | uniform sampler2D _MainTex; 24 | vec4 frag( in v2f i ); 25 | vec4 frag( in v2f i ) { 26 | return texture2D( _MainTex, i.uv); 27 | } 28 | void main() { 29 | vec4 xl_retval; 30 | v2f xlt_i; 31 | xlt_i.pos = vec4(0.0); 32 | xlt_i.uv = vec2( gl_TexCoord[0]); 33 | xl_retval = frag( xlt_i); 34 | gl_FragData[0] = vec4( xl_retval); 35 | } 36 | -------------------------------------------------------------------------------- /tests/fragment/zun-Test_VertexShaderTexture-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | void main () 3 | { 4 | gl_FragData[0] = texture2D (_MainTex, gl_TexCoord[0].xy); 5 | } 6 | 7 | 8 | // stats: 0 alu 1 tex 0 flow 9 | // inputs: 1 10 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 11 | // textures: 1 12 | // #0: _MainTex (high 2d) 0x0 [-1] 13 | -------------------------------------------------------------------------------- /tests/fragment/zun-Tests_Fwd-Def-Vert-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | vec4 c_1; 4 | c_1.xyz = vec3(0.0, 0.0, 0.0); 5 | c_1.w = 0.0; 6 | gl_FragData[0] = c_1; 7 | } 8 | 9 | 10 | // stats: 2 alu 0 tex 0 flow 11 | -------------------------------------------------------------------------------- /tests/fragment/zun-Tests_Fwd-Def-Vert1-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | vec4 res_1; 4 | res_1.xyz = ((gl_TexCoord[0].xyz * vec3(0.5, 0.5, -0.5)) + 0.5); 5 | res_1.w = 0.0; 6 | gl_FragData[0] = res_1; 7 | } 8 | 9 | 10 | // stats: 3 alu 0 tex 0 flow 11 | // inputs: 1 12 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 13 | -------------------------------------------------------------------------------- /tests/fragment/zun-TexGen_Cube_Refl-in.txt: -------------------------------------------------------------------------------- 1 | struct v2f_vertex_lit { 2 | vec2 uv; 3 | vec4 diff; 4 | vec4 spec; 5 | }; 6 | struct v2f_img { 7 | vec4 pos; 8 | vec2 uv; 9 | }; 10 | struct appdata_img { 11 | vec4 vertex; 12 | vec2 texcoord; 13 | }; 14 | struct v2f { 15 | vec4 vertex; 16 | vec4 color; 17 | vec3 texcoord; 18 | }; 19 | struct appdata_t { 20 | vec4 vertex; 21 | vec4 color; 22 | vec3 normal; 23 | }; 24 | uniform samplerCube _MainTex; 25 | vec4 frag( in v2f i ); 26 | vec4 frag( in v2f i ) { 27 | return textureCube( _MainTex, i.texcoord); 28 | } 29 | void main() { 30 | vec4 xl_retval; 31 | v2f xlt_i; 32 | xlt_i.vertex = vec4(0.0); 33 | xlt_i.color = vec4( gl_Color); 34 | xlt_i.texcoord = vec3( gl_TexCoord[0]); 35 | xl_retval = frag( xlt_i); 36 | gl_FragData[0] = vec4( xl_retval); 37 | } 38 | -------------------------------------------------------------------------------- /tests/fragment/zun-TexGen_Cube_Refl-out.txt: -------------------------------------------------------------------------------- 1 | uniform samplerCube _MainTex; 2 | void main () 3 | { 4 | gl_FragData[0] = textureCube (_MainTex, gl_TexCoord[0].xyz); 5 | } 6 | 7 | 8 | // stats: 0 alu 1 tex 0 flow 9 | // inputs: 1 10 | // #0: gl_TexCoord (high float) 4x1 [1] loc 4 11 | // textures: 1 12 | // #0: _MainTex (high cube) 0x0 [-1] 13 | -------------------------------------------------------------------------------- /tests/fragment/zun-Toon_Basic-out.txt: -------------------------------------------------------------------------------- 1 | uniform vec4 _Color; 2 | uniform sampler2D _MainTex; 3 | uniform samplerCube _ToonShade; 4 | void main () 5 | { 6 | vec4 col_1; 7 | col_1 = (_Color * texture2D (_MainTex, gl_TexCoord[0].xy)); 8 | vec4 tmpvar_2; 9 | tmpvar_2.xyz = ((2.0 * textureCube (_ToonShade, gl_TexCoord[1].xyz).xyz) * col_1.xyz); 10 | tmpvar_2.w = col_1.w; 11 | gl_FragData[0] = tmpvar_2; 12 | } 13 | 14 | 15 | // stats: 3 alu 2 tex 0 flow 16 | // inputs: 1 17 | // #0: gl_TexCoord (high float) 4x1 [2] loc 4 18 | // uniforms: 1 (total size: 0) 19 | // #0: _Color (high float) 4x1 [-1] 20 | // textures: 2 21 | // #0: _MainTex (high 2d) 0x0 [-1] 22 | // #1: _ToonShade (high cube) 0x0 [-1] 23 | -------------------------------------------------------------------------------- /tests/fragment/zun-Vertex_Colored-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | void main () 3 | { 4 | gl_FragData[0] = (gl_Color * texture2D (_MainTex, gl_TexCoord[0].xy)); 5 | } 6 | 7 | 8 | // stats: 1 alu 1 tex 0 flow 9 | // inputs: 2 10 | // #0: gl_Color (high float) 4x1 [-1] loc 1 11 | // #1: gl_TexCoord (high float) 4x1 [2] loc 4 12 | // textures: 1 13 | // #0: _MainTex (high 2d) 0x0 [-1] 14 | -------------------------------------------------------------------------------- /tests/global-mutable-inES.txt: -------------------------------------------------------------------------------- 1 | uniform highp float uni1; 2 | uniform mediump vec4 uni4; 3 | uniform sampler2D tex1; 4 | 5 | // global variables that aren't uniforms 6 | highp float mut_uni1; 7 | mediump vec4 mut_uni4; 8 | 9 | highp vec3 SampleDiffuse(in highp vec2 uv) 10 | { 11 | mut_uni4.xy = uv; 12 | return vec3(texture2D(tex1,mut_uni4.xy)); 13 | } 14 | lowp vec4 xlat_main(in highp vec4 uv) 15 | { 16 | lowp vec4 c = vec4(0.0); 17 | c.x += mut_uni4.x; 18 | c.xyz += SampleDiffuse(uv.xy); 19 | c.z += mut_uni1; 20 | mut_uni1 += 2.0; 21 | c.w += mut_uni1; 22 | return c; 23 | } 24 | varying highp vec4 var_uv; 25 | void main() 26 | { 27 | mut_uni1 = uni1; 28 | mut_uni4 = uni4; 29 | lowp vec4 r = xlat_main(var_uv); 30 | gl_FragData[0] = r; 31 | } 32 | -------------------------------------------------------------------------------- /tests/tests.gyp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aras-p/glsl-optimizer/d78c3d2f249aa870368ad320905bc954c47704f6/tests/tests.gyp -------------------------------------------------------------------------------- /tests/vertex/bug-chained-assign-in.txt: -------------------------------------------------------------------------------- 1 | // https://github.com/aras-p/glsl-optimizer/issues/48 2 | 3 | attribute vec3 _in_position; 4 | 5 | uniform mat4 mtx; 6 | 7 | void main() 8 | { 9 | mat4 m = mtx; 10 | // chained assignments used to not work, #48 11 | m[0][1] = m[0][2] = m[0][3] = 0.0; 12 | gl_Position = m * vec4(_in_position,1); 13 | } 14 | -------------------------------------------------------------------------------- /tests/vertex/bug-chained-assign-out.txt: -------------------------------------------------------------------------------- 1 | attribute vec3 _in_position; 2 | uniform mat4 mtx; 3 | void main () 4 | { 5 | mat4 m_1; 6 | m_1 = mtx; 7 | vec4 tmpvar_2; 8 | tmpvar_2.xyz = mtx[0].xyz; 9 | tmpvar_2.w = 0.0; 10 | m_1[0] = tmpvar_2; 11 | vec4 tmpvar_3; 12 | tmpvar_3.xyw = m_1[0].xyw; 13 | tmpvar_3.z = tmpvar_2.w; 14 | m_1[0] = tmpvar_3; 15 | vec4 tmpvar_4; 16 | tmpvar_4.xzw = m_1[0].xzw; 17 | tmpvar_4.y = tmpvar_3.z; 18 | m_1[0] = tmpvar_4; 19 | vec4 tmpvar_5; 20 | tmpvar_5.w = 1.0; 21 | tmpvar_5.xyz = _in_position; 22 | gl_Position = (m_1 * tmpvar_5); 23 | } 24 | 25 | 26 | // stats: 3 alu 0 tex 0 flow 27 | // inputs: 1 28 | // #0: _in_position (high float) 3x1 [-1] 29 | // uniforms: 1 (total size: 0) 30 | // #0: mtx (high float) 4x4 [-1] 31 | -------------------------------------------------------------------------------- /tests/vertex/bug-loops-for-while-in.txt: -------------------------------------------------------------------------------- 1 | #define MAX_ITER 5 2 | 3 | attribute vec4 a_position; 4 | 5 | uniform int u_iter; 6 | uniform vec4 u_deltas[MAX_ITER]; 7 | 8 | int my_min(int a, int b) { 9 | if (a < b) { 10 | return a; 11 | } else { 12 | return b; 13 | } 14 | } 15 | 16 | void main() { 17 | gl_Position = a_position; 18 | for (int i = 0; i < my_min(u_iter, MAX_ITER); i++) { 19 | gl_Position += u_deltas[i]; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/vertex/bug-loops-for-while-out.txt: -------------------------------------------------------------------------------- 1 | attribute vec4 a_position; 2 | uniform int u_iter; 3 | uniform vec4 u_deltas[5]; 4 | void main () 5 | { 6 | int i_1; 7 | gl_Position = a_position; 8 | i_1 = 0; 9 | while (true) { 10 | int tmpvar_2; 11 | if ((u_iter < 5)) { 12 | tmpvar_2 = u_iter; 13 | } else { 14 | tmpvar_2 = 5; 15 | }; 16 | if ((i_1 >= tmpvar_2)) { 17 | break; 18 | }; 19 | gl_Position = (gl_Position + u_deltas[i_1]); 20 | i_1++; 21 | }; 22 | } 23 | 24 | 25 | // stats: 6 alu 0 tex 3 flow 26 | // inputs: 1 27 | // #0: a_position (high float) 4x1 [-1] 28 | // uniforms: 2 (total size: 0) 29 | // #0: u_iter (high int) 1x1 [-1] 30 | // #1: u_deltas (high float) 4x1 [5] 31 | -------------------------------------------------------------------------------- /tests/vertex/bug-struct-uniform-in.txt: -------------------------------------------------------------------------------- 1 | // https://github.com/aras-p/glsl-optimizer/issues/18 2 | 3 | struct shadow_map_t 4 | { 5 | mat4 transform; 6 | }; 7 | 8 | uniform shadow_map_t ShadowMaps[1]; 9 | attribute vec3 _in_position; 10 | 11 | void main() 12 | { 13 | gl_Position = ShadowMaps[0].transform * vec4(_in_position,1); 14 | } 15 | -------------------------------------------------------------------------------- /tests/vertex/bug-struct-uniform-out.txt: -------------------------------------------------------------------------------- 1 | struct shadow_map_t { 2 | mat4 transform; 3 | }; 4 | uniform shadow_map_t ShadowMaps[1]; 5 | attribute vec3 _in_position; 6 | void main () 7 | { 8 | vec4 tmpvar_1; 9 | tmpvar_1.w = 1.0; 10 | tmpvar_1.xyz = _in_position; 11 | gl_Position = (ShadowMaps[0].transform * tmpvar_1); 12 | } 13 | 14 | 15 | // stats: 2 alu 0 tex 0 flow 16 | // inputs: 1 17 | // #0: _in_position (high float) 3x1 [-1] 18 | // uniforms: 1 (total size: 0) 19 | // #0: ShadowMaps (high other) 0x0 [1] 20 | -------------------------------------------------------------------------------- /tests/vertex/bug-varying-const-in.txt: -------------------------------------------------------------------------------- 1 | varying vec4 var4; 2 | varying float var1; 3 | varying vec4 var4ok; 4 | 5 | void main() 6 | { 7 | var4 = vec4(0.0); 8 | var1 = 0.5; 9 | var4ok = gl_Vertex; 10 | } 11 | -------------------------------------------------------------------------------- /tests/vertex/bug-varying-const-out.txt: -------------------------------------------------------------------------------- 1 | varying vec4 var4; 2 | varying float var1; 3 | varying vec4 var4ok; 4 | void main () 5 | { 6 | var4 = vec4(0.0, 0.0, 0.0, 0.0); 7 | var1 = 0.5; 8 | var4ok = gl_Vertex; 9 | } 10 | 11 | 12 | // stats: 2 alu 0 tex 0 flow 13 | // inputs: 1 14 | // #0: gl_Vertex (high float) 4x1 [-1] loc 0 15 | -------------------------------------------------------------------------------- /tests/vertex/builtin-vars-in.txt: -------------------------------------------------------------------------------- 1 | #extension GL_ARB_draw_instanced : require 2 | #extension GL_EXT_gpu_shader4 : require 3 | 4 | attribute vec3 _inPos; 5 | attribute vec3 _inNor; 6 | 7 | void main() 8 | { 9 | vec3 p; 10 | p = _inPos; 11 | p.y += float(gl_VertexID); 12 | p.y += float(gl_InstanceIDARB); 13 | p += _inNor; 14 | gl_Position = vec4(p,1.0); 15 | gl_PointSize = p.x; 16 | } 17 | -------------------------------------------------------------------------------- /tests/vertex/builtin-vars-inES.txt: -------------------------------------------------------------------------------- 1 | #extension GL_EXT_draw_instanced : require 2 | 3 | attribute highp vec3 _inPos; 4 | attribute highp vec3 _inNor; 5 | 6 | void main() 7 | { 8 | highp vec3 p; 9 | p = _inPos; 10 | p.y += float(gl_InstanceIDEXT); 11 | p += _inNor; 12 | gl_Position = vec4(p,1.0); 13 | gl_PointSize = p.x; 14 | } 15 | -------------------------------------------------------------------------------- /tests/vertex/builtin-vars-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | 3 | in highp vec3 _inPos; 4 | in highp vec3 _inNor; 5 | 6 | void main() 7 | { 8 | highp vec3 p; 9 | p = _inPos; 10 | p.x += float(gl_VertexID); 11 | p.y += float(gl_InstanceID); 12 | p += _inNor; 13 | gl_Position = vec4(p,1.0); 14 | gl_PointSize = p.x; 15 | } 16 | -------------------------------------------------------------------------------- /tests/vertex/builtin-vars-out.txt: -------------------------------------------------------------------------------- 1 | #extension GL_ARB_draw_instanced : enable 2 | #extension GL_EXT_gpu_shader4 : enable 3 | attribute vec3 _inPos; 4 | attribute vec3 _inNor; 5 | void main () 6 | { 7 | vec3 p_1; 8 | p_1.xz = _inPos.xz; 9 | p_1.y = (_inPos.y + float(gl_VertexID)); 10 | p_1.y = (p_1.y + float(gl_InstanceIDARB)); 11 | p_1 = (p_1 + _inNor); 12 | vec4 tmpvar_2; 13 | tmpvar_2.w = 1.0; 14 | tmpvar_2.xyz = p_1; 15 | gl_Position = tmpvar_2; 16 | gl_PointSize = p_1.x; 17 | } 18 | 19 | 20 | // stats: 6 alu 0 tex 0 flow 21 | // inputs: 2 22 | // #0: _inPos (high float) 3x1 [-1] 23 | // #1: _inNor (high float) 3x1 [-1] 24 | -------------------------------------------------------------------------------- /tests/vertex/builtin-vars-outES.txt: -------------------------------------------------------------------------------- 1 | #extension GL_EXT_draw_instanced : enable 2 | attribute highp vec3 _inPos; 3 | attribute highp vec3 _inNor; 4 | void main () 5 | { 6 | highp vec3 p_1; 7 | p_1.xz = _inPos.xz; 8 | p_1.y = (_inPos.y + float(gl_InstanceIDEXT)); 9 | p_1 = (p_1 + _inNor); 10 | highp vec4 tmpvar_2; 11 | tmpvar_2.w = 1.0; 12 | tmpvar_2.xyz = p_1; 13 | gl_Position = tmpvar_2; 14 | gl_PointSize = p_1.x; 15 | } 16 | 17 | 18 | // stats: 4 alu 0 tex 0 flow 19 | // inputs: 2 20 | // #0: _inPos (high float) 3x1 [-1] 21 | // #1: _inNor (high float) 3x1 [-1] 22 | -------------------------------------------------------------------------------- /tests/vertex/builtin-vars-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | in highp vec3 _inPos; 3 | in highp vec3 _inNor; 4 | void main () 5 | { 6 | highp vec3 p_1; 7 | p_1.z = _inPos.z; 8 | p_1.x = (_inPos.x + float(gl_VertexID)); 9 | p_1.y = (_inPos.y + float(gl_InstanceID)); 10 | p_1 = (p_1 + _inNor); 11 | highp vec4 tmpvar_2; 12 | tmpvar_2.w = 1.0; 13 | tmpvar_2.xyz = p_1; 14 | gl_Position = tmpvar_2; 15 | gl_PointSize = p_1.x; 16 | } 17 | 18 | 19 | // stats: 6 alu 0 tex 0 flow 20 | // inputs: 2 21 | // #0: _inPos (high float) 3x1 [-1] 22 | // #1: _inNor (high float) 3x1 [-1] 23 | -------------------------------------------------------------------------------- /tests/vertex/estest1-in.txt: -------------------------------------------------------------------------------- 1 | struct v2f { 2 | vec4 pos; 3 | vec2 uv0; 4 | vec2 uv1; 5 | }; 6 | 7 | attribute vec4 position; 8 | 9 | uniform mat4 modelViewProjectionMatrix; 10 | 11 | varying vec4 xlv_TEXCOORD0; 12 | varying vec4 xlv_TEXCOORD1; 13 | 14 | void main() 15 | { 16 | gl_Position = modelViewProjectionMatrix * position; 17 | xlv_TEXCOORD0 = vec4(position.xy * vec2(4.0), 0.0, 0.0); 18 | xlv_TEXCOORD1 = vec4(position.xy, 0.0, 0.0); 19 | } 20 | -------------------------------------------------------------------------------- /tests/vertex/estest1-out.txt: -------------------------------------------------------------------------------- 1 | attribute vec4 position; 2 | uniform mat4 modelViewProjectionMatrix; 3 | varying vec4 xlv_TEXCOORD0; 4 | varying vec4 xlv_TEXCOORD1; 5 | void main () 6 | { 7 | gl_Position = (modelViewProjectionMatrix * position); 8 | vec4 tmpvar_1; 9 | tmpvar_1.zw = vec2(0.0, 0.0); 10 | tmpvar_1.xy = (position.xy * vec2(4.0, 4.0)); 11 | xlv_TEXCOORD0 = tmpvar_1; 12 | vec4 tmpvar_2; 13 | tmpvar_2.zw = vec2(0.0, 0.0); 14 | tmpvar_2.xy = position.xy; 15 | xlv_TEXCOORD1 = tmpvar_2; 16 | } 17 | 18 | 19 | // stats: 4 alu 0 tex 0 flow 20 | // inputs: 1 21 | // #0: position (high float) 4x1 [-1] 22 | // uniforms: 1 (total size: 0) 23 | // #0: modelViewProjectionMatrix (high float) 4x4 [-1] 24 | -------------------------------------------------------------------------------- /tests/vertex/glsl140-basic-in.txt: -------------------------------------------------------------------------------- 1 | #version 140 2 | 3 | uniform vec2 p; 4 | 5 | in vec4 position; 6 | in vec4 icol; 7 | 8 | out vec4 col; 9 | 10 | void main (void) 11 | { 12 | col = icol; 13 | gl_Position = vec4(p, 0.0, 0.0) + position; 14 | } 15 | -------------------------------------------------------------------------------- /tests/vertex/glsl140-basic-out.txt: -------------------------------------------------------------------------------- 1 | #version 140 2 | uniform vec2 p; 3 | in vec4 position; 4 | in vec4 icol; 5 | out vec4 col; 6 | void main () 7 | { 8 | col = icol; 9 | vec4 tmpvar_1; 10 | tmpvar_1.zw = vec2(0.0, 0.0); 11 | tmpvar_1.xy = p; 12 | gl_Position = (tmpvar_1 + position); 13 | } 14 | 15 | 16 | // stats: 2 alu 0 tex 0 flow 17 | // inputs: 2 18 | // #0: position (high float) 4x1 [-1] 19 | // #1: icol (high float) 4x1 [-1] 20 | // uniforms: 1 (total size: 0) 21 | // #0: p (high float) 2x1 [-1] 22 | -------------------------------------------------------------------------------- /tests/vertex/glsl140-integers-in.txt: -------------------------------------------------------------------------------- 1 | #version 140 2 | 3 | uniform vec2 p; 4 | 5 | in vec4 position; 6 | in vec4 icol; 7 | 8 | out vec4 col; 9 | flat out ivec4 colint; 10 | 11 | void main (void) 12 | { 13 | gl_Position = vec4(p, 0.0, 0.0) + position; 14 | 15 | // integers & vertex ID & instance ID 16 | colint.x = gl_VertexID; 17 | colint.y = gl_InstanceID ^ gl_InstanceID; 18 | colint.z = gl_InstanceID << 2; 19 | colint.w = colint.x + colint.y; 20 | 21 | // new built-ins 22 | col.x = trunc(position.x); 23 | col.y = round(position.y); 24 | col.z = roundEven(position.y); 25 | col.w = cosh(position.w); 26 | } 27 | -------------------------------------------------------------------------------- /tests/vertex/glsl140-integers-out.txt: -------------------------------------------------------------------------------- 1 | #version 140 2 | uniform vec2 p; 3 | in vec4 position; 4 | out vec4 col; 5 | flat out ivec4 colint; 6 | void main () 7 | { 8 | vec4 tmpvar_1; 9 | tmpvar_1.zw = vec2(0.0, 0.0); 10 | tmpvar_1.xy = p; 11 | gl_Position = (tmpvar_1 + position); 12 | colint.x = gl_VertexID; 13 | colint.y = (gl_InstanceID ^ gl_InstanceID); 14 | colint.z = (gl_InstanceID << 2); 15 | colint.w = (gl_VertexID + colint.y); 16 | col.x = trunc(position.x); 17 | float tmpvar_2; 18 | tmpvar_2 = roundEven(position.y); 19 | col.y = tmpvar_2; 20 | col.z = tmpvar_2; 21 | col.w = (0.5 * (exp(position.w) + exp( 22 | -(position.w) 23 | ))); 24 | } 25 | 26 | 27 | // stats: 12 alu 0 tex 0 flow 28 | // inputs: 1 29 | // #0: position (high float) 4x1 [-1] 30 | // uniforms: 1 (total size: 0) 31 | // #0: p (high float) 2x1 [-1] 32 | -------------------------------------------------------------------------------- /tests/vertex/loops-forsimple-in.txt: -------------------------------------------------------------------------------- 1 | uniform vec4 uniColors[4]; 2 | varying vec4 varColor; 3 | void main() { 4 | gl_Position = gl_Vertex; 5 | vec4 col = vec4(0.0); 6 | for (int i = 0; i < 4; ++i) 7 | col += uniColors[i]; 8 | varColor = col; 9 | } 10 | -------------------------------------------------------------------------------- /tests/vertex/loops-forsimple-out.txt: -------------------------------------------------------------------------------- 1 | uniform vec4 uniColors[4]; 2 | varying vec4 varColor; 3 | void main () 4 | { 5 | vec4 col_1; 6 | gl_Position = gl_Vertex; 7 | col_1 = uniColors[0]; 8 | col_1 = (col_1 + uniColors[1]); 9 | col_1 = (col_1 + uniColors[2]); 10 | col_1 = (col_1 + uniColors[3]); 11 | varColor = col_1; 12 | } 13 | 14 | 15 | // stats: 3 alu 0 tex 0 flow 16 | // inputs: 1 17 | // #0: gl_Vertex (high float) 4x1 [-1] loc 0 18 | // uniforms: 1 (total size: 0) 19 | // #0: uniColors (high float) 4x1 [4] 20 | -------------------------------------------------------------------------------- /tests/vertex/loops-forwithcalls-in.txt: -------------------------------------------------------------------------------- 1 | uniform vec4 uniColors[4]; 2 | varying vec4 varColor; 3 | void main() { 4 | gl_Position = gl_Vertex; 5 | vec4 col = vec4(0.0); 6 | for (int i = 0; i < 4; ++i) 7 | col += max (vec4(0.0), uniColors[i]); 8 | varColor = col; 9 | } 10 | -------------------------------------------------------------------------------- /tests/vertex/loops-forwithcalls-out.txt: -------------------------------------------------------------------------------- 1 | uniform vec4 uniColors[4]; 2 | varying vec4 varColor; 3 | void main () 4 | { 5 | vec4 col_1; 6 | gl_Position = gl_Vertex; 7 | col_1 = max (vec4(0.0, 0.0, 0.0, 0.0), uniColors[0]); 8 | col_1 = (col_1 + max (vec4(0.0, 0.0, 0.0, 0.0), uniColors[1])); 9 | col_1 = (col_1 + max (vec4(0.0, 0.0, 0.0, 0.0), uniColors[2])); 10 | col_1 = (col_1 + max (vec4(0.0, 0.0, 0.0, 0.0), uniColors[3])); 11 | varColor = col_1; 12 | } 13 | 14 | 15 | // stats: 7 alu 0 tex 0 flow 16 | // inputs: 1 17 | // #0: gl_Vertex (high float) 4x1 [-1] loc 0 18 | // uniforms: 1 (total size: 0) 19 | // #0: uniColors (high float) 4x1 [4] 20 | -------------------------------------------------------------------------------- /tests/vertex/matrix-casts-inES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | 3 | uniform highp mat4 uniMat4F; 4 | uniform mediump mat4 uniMat4H; 5 | uniform highp mat3 uniMat3F; 6 | uniform mediump mat3 uniMat3H; 7 | uniform highp mat2 uniMat2F; 8 | uniform mediump mat2 uniMat2H; 9 | 10 | in highp vec4 inf; 11 | in mediump vec4 inh; 12 | 13 | void main() 14 | { 15 | highp vec4 r = vec4(0.0); 16 | 17 | mediump mat4 ftoh4 = uniMat4F; 18 | r.x += ftoh4[0][0]; 19 | mediump mat3 ftoh3 = uniMat3F; 20 | r.x += ftoh4[0][0]; 21 | mediump mat2 ftoh2 = uniMat2F; 22 | r.x += ftoh2[0][0]; 23 | 24 | highp mat4 htof4 = uniMat4H; 25 | r.x += htof4[0][0]; 26 | highp mat3 htof3 = uniMat3H; 27 | r.x += htof3[0][0]; 28 | highp mat2 htof2 = uniMat2H; 29 | r.x += htof2[0][0]; 30 | 31 | gl_Position = r; 32 | } 33 | -------------------------------------------------------------------------------- /tests/vertex/opt-inline-varnames-in.txt: -------------------------------------------------------------------------------- 1 | float foo (float a, float b, float c) { 2 | return a+b+c; 3 | } 4 | float bar (float a, float b) { 5 | float c = a*b; 6 | return foo (a, b, c); 7 | } 8 | float har (float a) { 9 | float b = sqrt(a); 10 | float c = sqrt(b); 11 | return bar (a, b) + c; 12 | } 13 | void main () 14 | { 15 | gl_Position = vec4(har(gl_Vertex.x)); 16 | } 17 | -------------------------------------------------------------------------------- /tests/vertex/opt-inline-varnames-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | float tmpvar_1; 4 | tmpvar_1 = sqrt(gl_Vertex.x); 5 | gl_Position = vec4((((gl_Vertex.x + tmpvar_1) + (gl_Vertex.x * tmpvar_1)) + sqrt(tmpvar_1))); 6 | } 7 | 8 | 9 | // stats: 6 alu 0 tex 0 flow 10 | // inputs: 1 11 | // #0: gl_Vertex (high float) 4x1 [-1] loc 0 12 | -------------------------------------------------------------------------------- /tests/vertex/opt-matrix-constr-in.txt: -------------------------------------------------------------------------------- 1 | void main() { 2 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; 3 | mat3 m = mat3 (0.1, 0.8, 0.1, 0.3, 0.3, 0.5, 0.9, 0.0, 0.1); 4 | vec3 n = m * gl_Normal; 5 | gl_FrontColor = vec4(n*0.5+0.5, 1.0); 6 | } 7 | -------------------------------------------------------------------------------- /tests/vertex/opt-matrix-constr-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); 4 | vec4 tmpvar_1; 5 | tmpvar_1.w = 1.0; 6 | tmpvar_1.xyz = (((mat3(0.1, 0.8, 0.1, 0.3, 0.3, 0.5, 0.9, 0.0, 0.1) * gl_Normal) * 0.5) + 0.5); 7 | gl_FrontColor = tmpvar_1; 8 | } 9 | 10 | 11 | // stats: 5 alu 0 tex 0 flow 12 | // inputs: 2 13 | // #0: gl_Normal (high float) 3x1 [-1] loc 2 14 | // #1: gl_Vertex (high float) 4x1 [-1] loc 0 15 | // uniforms: 1 (total size: 0) 16 | // #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] 17 | -------------------------------------------------------------------------------- /tests/vertex/opt-negsub-in.txt: -------------------------------------------------------------------------------- 1 | uniform mat4 mvp; 2 | uniform mat3 m3a, m3b, m3c; 3 | uniform vec4 v3a, v3b, v3c; 4 | 5 | void main() { 6 | gl_Position = mvp * gl_Vertex; 7 | 8 | vec3 ta = -(v3a.xyz - gl_Vertex.xyz); 9 | vec3 ra = m3a * ta; 10 | 11 | vec3 tb = -((mvp * v3b).xyz - gl_Vertex.xyz); 12 | vec3 rb = m3b * tb; 13 | 14 | vec3 rc = m3c * (-(v3c.xyz - gl_Vertex.xyz)); 15 | 16 | gl_FrontColor = vec4(ra+rb+rc,1.0); 17 | } 18 | -------------------------------------------------------------------------------- /tests/vertex/opt-normalize-in.txt: -------------------------------------------------------------------------------- 1 | varying vec3 var_a; 2 | 3 | void main() { 4 | gl_Position = gl_Vertex * normalize(vec4(1.0,2.0,3.0,4.0)); 5 | var_a = gl_Vertex.xyz * normalize(vec3(0.0)); 6 | } 7 | -------------------------------------------------------------------------------- /tests/vertex/opt-normalize-out.txt: -------------------------------------------------------------------------------- 1 | varying vec3 var_a; 2 | void main () 3 | { 4 | gl_Position = (gl_Vertex * vec4(0.1825742, 0.3651484, 0.5477225, 0.7302967)); 5 | var_a = (gl_Vertex.xyz * normalize(vec3(0.0, 0.0, 0.0))); 6 | } 7 | 8 | 9 | // stats: 3 alu 0 tex 0 flow 10 | // inputs: 1 11 | // #0: gl_Vertex (high float) 4x1 [-1] loc 0 12 | -------------------------------------------------------------------------------- /tests/vertex/opt-unusedvars-in.txt: -------------------------------------------------------------------------------- 1 | uniform mat4 mvp; 2 | uniform mat4 unusedMatrix; 3 | uniform float unusedFloat; 4 | attribute vec4 myColor; 5 | attribute vec3 myUnused; 6 | 7 | void main() { 8 | gl_Position = mvp * gl_Vertex; 9 | gl_FrontColor = myColor; 10 | } 11 | -------------------------------------------------------------------------------- /tests/vertex/opt-unusedvars-out.txt: -------------------------------------------------------------------------------- 1 | uniform mat4 mvp; 2 | attribute vec4 myColor; 3 | void main () 4 | { 5 | gl_Position = (mvp * gl_Vertex); 6 | gl_FrontColor = myColor; 7 | } 8 | 9 | 10 | // stats: 1 alu 0 tex 0 flow 11 | // inputs: 2 12 | // #0: gl_Vertex (high float) 4x1 [-1] loc 0 13 | // #1: myColor (high float) 4x1 [-1] 14 | // uniforms: 1 (total size: 0) 15 | // #0: mvp (high float) 4x4 [-1] 16 | -------------------------------------------------------------------------------- /tests/vertex/swizzlemask-in.txt: -------------------------------------------------------------------------------- 1 | varying vec4 texcoord; 2 | void main() 3 | { 4 | gl_Position.zw = gl_Vertex.xy*2.0; 5 | gl_Position.xy = gl_Vertex.xy; 6 | texcoord.x = gl_Vertex.z; 7 | texcoord.yz = gl_Vertex.zw; 8 | texcoord.w = gl_Vertex.x; 9 | } 10 | -------------------------------------------------------------------------------- /tests/vertex/swizzlemask-out.txt: -------------------------------------------------------------------------------- 1 | varying vec4 texcoord; 2 | void main () 3 | { 4 | gl_Position.zw = (gl_Vertex.xy * 2.0); 5 | gl_Position.xy = gl_Vertex.xy; 6 | texcoord.x = gl_Vertex.z; 7 | texcoord.yz = gl_Vertex.zw; 8 | texcoord.w = gl_Vertex.x; 9 | } 10 | 11 | 12 | // stats: 1 alu 0 tex 0 flow 13 | // inputs: 1 14 | // #0: gl_Vertex (high float) 4x1 [-1] loc 0 15 | -------------------------------------------------------------------------------- /tests/vertex/types-out.txt: -------------------------------------------------------------------------------- 1 | uniform mat4 mvp; 2 | varying vec2 xlv_TEXCOORD0; 3 | varying vec4 xlv_COLOR; 4 | void main () 5 | { 6 | vec4 tmpvar_1; 7 | tmpvar_1.w = gl_Color.w; 8 | tmpvar_1.xyz = (gl_Color.xyz + gl_Normal); 9 | gl_Position = (mvp * gl_Vertex); 10 | xlv_TEXCOORD0 = gl_MultiTexCoord0.xy; 11 | xlv_COLOR = tmpvar_1; 12 | } 13 | 14 | 15 | // stats: 2 alu 0 tex 0 flow 16 | // inputs: 4 17 | // #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 18 | // #1: gl_Color (high float) 4x1 [-1] loc 3 19 | // #2: gl_Normal (high float) 3x1 [-1] loc 2 20 | // #3: gl_Vertex (high float) 4x1 [-1] loc 0 21 | // uniforms: 1 (total size: 0) 22 | // #0: mvp (high float) 4x4 [-1] 23 | -------------------------------------------------------------------------------- /tests/vertex/types-outES3.txt: -------------------------------------------------------------------------------- 1 | #version 300 es 2 | uniform highp mat4 mvp; 3 | in highp vec4 _inVertex; 4 | in mediump vec3 _inNormal; 5 | in highp vec2 _uv0; 6 | in lowp vec4 _color; 7 | out mediump vec2 xlv_TEXCOORD0; 8 | out lowp vec4 xlv_COLOR; 9 | void main () 10 | { 11 | mediump vec2 tmpvar_1; 12 | lowp vec4 tmpvar_2; 13 | tmpvar_2.w = _color.w; 14 | tmpvar_2.xyz = (_color.xyz + _inNormal); 15 | tmpvar_1 = _uv0; 16 | gl_Position = (mvp * _inVertex); 17 | xlv_TEXCOORD0 = tmpvar_1; 18 | xlv_COLOR = tmpvar_2; 19 | } 20 | 21 | 22 | // stats: 2 alu 0 tex 0 flow 23 | // inputs: 4 24 | // #0: _inVertex (high float) 4x1 [-1] 25 | // #1: _inNormal (medium float) 3x1 [-1] 26 | // #2: _uv0 (high float) 2x1 [-1] 27 | // #3: _color (low float) 4x1 [-1] 28 | // uniforms: 1 (total size: 0) 29 | // #0: mvp (high float) 4x4 [-1] 30 | -------------------------------------------------------------------------------- /tests/vertex/z-particle-out.txt: -------------------------------------------------------------------------------- 1 | uniform vec4 _MainTex_ST; 2 | uniform mat4 glstate_matrix_mvp; 3 | varying vec4 xlv_COLOR; 4 | varying vec2 xlv_TEXCOORD0; 5 | void main () 6 | { 7 | gl_Position = (glstate_matrix_mvp * gl_Vertex); 8 | xlv_COLOR = gl_Color; 9 | xlv_TEXCOORD0 = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); 10 | } 11 | 12 | 13 | // stats: 3 alu 0 tex 0 flow 14 | // inputs: 3 15 | // #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 16 | // #1: gl_Color (high float) 4x1 [-1] loc 3 17 | // #2: gl_Vertex (high float) 4x1 [-1] loc 0 18 | // uniforms: 2 (total size: 0) 19 | // #0: _MainTex_ST (high float) 4x1 [-1] 20 | // #1: glstate_matrix_mvp (high float) 4x4 [-1] 21 | -------------------------------------------------------------------------------- /tests/vertex/zun-Grab_Invert-in.txt: -------------------------------------------------------------------------------- 1 | struct v2f_vertex_lit { 2 | vec2 uv; 3 | vec4 diff; 4 | vec4 spec; 5 | }; 6 | struct v2f_img { 7 | vec4 pos; 8 | vec2 uv; 9 | }; 10 | struct appdata_img { 11 | vec4 vertex; 12 | vec2 texcoord; 13 | }; 14 | struct v2f { 15 | vec4 vertex; 16 | vec4 uv; 17 | }; 18 | 19 | v2f vert( in vec4 vertex, in vec2 uv ); 20 | v2f vert( in vec4 vertex, in vec2 uv ) { 21 | v2f o; 22 | float scale = 1.00000; 23 | o.vertex = ( gl_ModelViewProjectionMatrix * vertex ); 24 | o.uv.xy = ((vec2( o.vertex.x , (o.vertex.y * scale)) + o.vertex.w ) * 0.500000); 25 | o.uv.zw = o.vertex.zw ; 26 | return o; 27 | } 28 | void main() { 29 | v2f xl_retval; 30 | xl_retval = vert( vec4(gl_Vertex), vec2(gl_MultiTexCoord0)); 31 | gl_Position = vec4( xl_retval.vertex); 32 | gl_TexCoord[0] = vec4( xl_retval.uv); 33 | } 34 | -------------------------------------------------------------------------------- /tests/vertex/zun-Grab_Invert-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | vec4 tmpvar_1; 4 | vec4 tmpvar_2; 5 | tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); 6 | tmpvar_2.xy = ((tmpvar_1.xy + tmpvar_1.w) * 0.5); 7 | tmpvar_2.zw = tmpvar_1.zw; 8 | gl_Position = tmpvar_1; 9 | gl_TexCoord[0] = tmpvar_2; 10 | } 11 | 12 | 13 | // stats: 3 alu 0 tex 0 flow 14 | // inputs: 1 15 | // #0: gl_Vertex (high float) 4x1 [-1] loc 0 16 | // uniforms: 1 (total size: 0) 17 | // #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] 18 | -------------------------------------------------------------------------------- /tests/vertex/zun-Particles_Blend-out.txt: -------------------------------------------------------------------------------- 1 | uniform vec4 _MainTex_ST; 2 | void main () 3 | { 4 | gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); 5 | gl_FrontColor = gl_Color; 6 | vec4 tmpvar_1; 7 | tmpvar_1.zw = vec2(0.0, 0.0); 8 | tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); 9 | gl_TexCoord[0] = tmpvar_1; 10 | } 11 | 12 | 13 | // stats: 4 alu 0 tex 0 flow 14 | // inputs: 3 15 | // #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 16 | // #1: gl_Color (high float) 4x1 [-1] loc 3 17 | // #2: gl_Vertex (high float) 4x1 [-1] loc 0 18 | // uniforms: 2 (total size: 0) 19 | // #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] 20 | // #1: _MainTex_ST (high float) 4x1 [-1] 21 | -------------------------------------------------------------------------------- /tests/vertex/zun-Reflective_Specular1-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | mat3 tmpvar_1; 4 | tmpvar_1[0] = gl_ModelViewMatrixInverseTranspose[0].xyz; 5 | tmpvar_1[1] = gl_ModelViewMatrixInverseTranspose[1].xyz; 6 | tmpvar_1[2] = gl_ModelViewMatrixInverseTranspose[2].xyz; 7 | gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); 8 | vec4 tmpvar_2; 9 | tmpvar_2.w = 0.0; 10 | tmpvar_2.xyz = (tmpvar_1 * gl_Normal); 11 | gl_TexCoord[0] = tmpvar_2; 12 | } 13 | 14 | 15 | // stats: 3 alu 0 tex 0 flow 16 | // inputs: 2 17 | // #0: gl_Normal (high float) 3x1 [-1] loc 2 18 | // #1: gl_Vertex (high float) 4x1 [-1] loc 0 19 | // uniforms: 2 (total size: 0) 20 | // #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] 21 | // #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] 22 | -------------------------------------------------------------------------------- /tests/vertex/zun-RenderFX_Skybox_Cubed-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); 4 | vec4 tmpvar_1; 5 | tmpvar_1.w = 0.0; 6 | tmpvar_1.xyz = gl_MultiTexCoord0.xyz; 7 | gl_TexCoord[0] = tmpvar_1; 8 | } 9 | 10 | 11 | // stats: 2 alu 0 tex 0 flow 12 | // inputs: 2 13 | // #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 14 | // #1: gl_Vertex (high float) 4x1 [-1] loc 0 15 | // uniforms: 1 (total size: 0) 16 | // #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] 17 | -------------------------------------------------------------------------------- /tests/vertex/zun-Self-Illumin_Specular1-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | mat3 tmpvar_1; 4 | tmpvar_1[0] = gl_ModelViewMatrixInverseTranspose[0].xyz; 5 | tmpvar_1[1] = gl_ModelViewMatrixInverseTranspose[1].xyz; 6 | tmpvar_1[2] = gl_ModelViewMatrixInverseTranspose[2].xyz; 7 | gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); 8 | vec4 tmpvar_2; 9 | tmpvar_2.w = 0.0; 10 | tmpvar_2.xyz = (tmpvar_1 * gl_Normal); 11 | gl_TexCoord[0] = tmpvar_2; 12 | } 13 | 14 | 15 | // stats: 3 alu 0 tex 0 flow 16 | // inputs: 2 17 | // #0: gl_Normal (high float) 3x1 [-1] loc 2 18 | // #1: gl_Vertex (high float) 4x1 [-1] loc 0 19 | // uniforms: 2 (total size: 0) 20 | // #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] 21 | // #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] 22 | -------------------------------------------------------------------------------- /tests/vertex/zun-ShowDestAlpha-in.txt: -------------------------------------------------------------------------------- 1 | struct v2f_vertex_lit { 2 | vec2 uv; 3 | vec4 diff; 4 | vec4 spec; 5 | }; 6 | struct v2f_img { 7 | vec4 pos; 8 | vec2 uv; 9 | }; 10 | struct appdata_img { 11 | vec4 vertex; 12 | vec2 texcoord; 13 | }; 14 | struct v2f { 15 | vec4 vertex; 16 | }; 17 | struct appdata_t { 18 | vec4 vertex; 19 | }; 20 | 21 | v2f vert( in appdata_t v ); 22 | v2f vert( in appdata_t v ) { 23 | v2f o; 24 | o.vertex = ( gl_ModelViewProjectionMatrix * v.vertex ); 25 | return o; 26 | } 27 | void main() { 28 | v2f xl_retval; 29 | appdata_t xlt_v; 30 | xlt_v.vertex = vec4( gl_Vertex); 31 | xl_retval = vert( xlt_v); 32 | gl_Position = vec4( xl_retval.vertex); 33 | } 34 | -------------------------------------------------------------------------------- /tests/vertex/zun-ShowDestAlpha-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); 4 | } 5 | 6 | 7 | // stats: 1 alu 0 tex 0 flow 8 | // inputs: 1 9 | // #0: gl_Vertex (high float) 4x1 [-1] loc 0 10 | // uniforms: 1 (total size: 0) 11 | // #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] 12 | -------------------------------------------------------------------------------- /tests/vertex/zun-Specular1-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | mat3 tmpvar_1; 4 | tmpvar_1[0] = gl_ModelViewMatrixInverseTranspose[0].xyz; 5 | tmpvar_1[1] = gl_ModelViewMatrixInverseTranspose[1].xyz; 6 | tmpvar_1[2] = gl_ModelViewMatrixInverseTranspose[2].xyz; 7 | gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); 8 | vec4 tmpvar_2; 9 | tmpvar_2.w = 0.0; 10 | tmpvar_2.xyz = (tmpvar_1 * gl_Normal); 11 | gl_TexCoord[0] = tmpvar_2; 12 | } 13 | 14 | 15 | // stats: 3 alu 0 tex 0 flow 16 | // inputs: 2 17 | // #0: gl_Normal (high float) 3x1 [-1] loc 2 18 | // #1: gl_Vertex (high float) 4x1 [-1] loc 0 19 | // uniforms: 2 (total size: 0) 20 | // #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] 21 | // #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] 22 | -------------------------------------------------------------------------------- /tests/vertex/zun-Surface_Colored_Specular1-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | mat3 tmpvar_1; 4 | tmpvar_1[0] = gl_ModelViewMatrixInverseTranspose[0].xyz; 5 | tmpvar_1[1] = gl_ModelViewMatrixInverseTranspose[1].xyz; 6 | tmpvar_1[2] = gl_ModelViewMatrixInverseTranspose[2].xyz; 7 | gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); 8 | vec4 tmpvar_2; 9 | tmpvar_2.w = 0.0; 10 | tmpvar_2.xyz = (tmpvar_1 * gl_Normal); 11 | gl_TexCoord[0] = tmpvar_2; 12 | } 13 | 14 | 15 | // stats: 3 alu 0 tex 0 flow 16 | // inputs: 2 17 | // #0: gl_Normal (high float) 3x1 [-1] loc 2 18 | // #1: gl_Vertex (high float) 4x1 [-1] loc 0 19 | // uniforms: 2 (total size: 0) 20 | // #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] 21 | // #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] 22 | -------------------------------------------------------------------------------- /tests/vertex/zun-Surface_ScreenPos2-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | mat3 tmpvar_1; 4 | tmpvar_1[0] = gl_ModelViewMatrixInverseTranspose[0].xyz; 5 | tmpvar_1[1] = gl_ModelViewMatrixInverseTranspose[1].xyz; 6 | tmpvar_1[2] = gl_ModelViewMatrixInverseTranspose[2].xyz; 7 | gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); 8 | vec4 tmpvar_2; 9 | tmpvar_2.w = 0.0; 10 | tmpvar_2.xyz = (tmpvar_1 * gl_Normal); 11 | gl_TexCoord[0] = tmpvar_2; 12 | } 13 | 14 | 15 | // stats: 3 alu 0 tex 0 flow 16 | // inputs: 2 17 | // #0: gl_Normal (high float) 3x1 [-1] loc 2 18 | // #1: gl_Vertex (high float) 4x1 [-1] loc 0 19 | // uniforms: 2 (total size: 0) 20 | // #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] 21 | // #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] 22 | -------------------------------------------------------------------------------- /tests/vertex/zun-Surface_ScreenPosAlbedo-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | mat3 tmpvar_1; 4 | tmpvar_1[0] = gl_ModelViewMatrixInverseTranspose[0].xyz; 5 | tmpvar_1[1] = gl_ModelViewMatrixInverseTranspose[1].xyz; 6 | tmpvar_1[2] = gl_ModelViewMatrixInverseTranspose[2].xyz; 7 | gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); 8 | vec4 tmpvar_2; 9 | tmpvar_2.w = 0.0; 10 | tmpvar_2.xyz = (tmpvar_1 * gl_Normal); 11 | gl_TexCoord[0] = tmpvar_2; 12 | } 13 | 14 | 15 | // stats: 3 alu 0 tex 0 flow 16 | // inputs: 2 17 | // #0: gl_Normal (high float) 3x1 [-1] loc 2 18 | // #1: gl_Vertex (high float) 4x1 [-1] loc 0 19 | // uniforms: 2 (total size: 0) 20 | // #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] 21 | // #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] 22 | -------------------------------------------------------------------------------- /tests/vertex/zun-Surface_WorldRefl1-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | mat3 tmpvar_1; 4 | tmpvar_1[0] = gl_ModelViewMatrixInverseTranspose[0].xyz; 5 | tmpvar_1[1] = gl_ModelViewMatrixInverseTranspose[1].xyz; 6 | tmpvar_1[2] = gl_ModelViewMatrixInverseTranspose[2].xyz; 7 | gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); 8 | vec4 tmpvar_2; 9 | tmpvar_2.w = 0.0; 10 | tmpvar_2.xyz = (tmpvar_1 * gl_Normal); 11 | gl_TexCoord[0] = tmpvar_2; 12 | } 13 | 14 | 15 | // stats: 3 alu 0 tex 0 flow 16 | // inputs: 2 17 | // #0: gl_Normal (high float) 3x1 [-1] loc 2 18 | // #1: gl_Vertex (high float) 4x1 [-1] loc 0 19 | // uniforms: 2 (total size: 0) 20 | // #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] 21 | // #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] 22 | -------------------------------------------------------------------------------- /tests/vertex/zun-Test_CgNormals-out.txt: -------------------------------------------------------------------------------- 1 | void main () 2 | { 3 | mat3 tmpvar_1; 4 | tmpvar_1[0] = gl_ModelViewMatrixInverseTranspose[0].xyz; 5 | tmpvar_1[1] = gl_ModelViewMatrixInverseTranspose[1].xyz; 6 | tmpvar_1[2] = gl_ModelViewMatrixInverseTranspose[2].xyz; 7 | vec4 tmpvar_2; 8 | tmpvar_2.w = 1.0; 9 | tmpvar_2.xyz = (((tmpvar_1 * gl_Normal) * 0.5) + 0.5); 10 | gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); 11 | gl_FrontColor = tmpvar_2; 12 | } 13 | 14 | 15 | // stats: 5 alu 0 tex 0 flow 16 | // inputs: 2 17 | // #0: gl_Normal (high float) 3x1 [-1] loc 2 18 | // #1: gl_Vertex (high float) 4x1 [-1] loc 0 19 | // uniforms: 2 (total size: 0) 20 | // #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1] 21 | // #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] 22 | -------------------------------------------------------------------------------- /tests/vertex/zun-Test_VertexShaderDepthTexture-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _CameraDepthTexture; 2 | void main () 3 | { 4 | vec4 tmpvar_1; 5 | tmpvar_1.xzw = gl_Vertex.xzw; 6 | tmpvar_1.y = (gl_Vertex.y + ((1.0 - texture2DLod (_CameraDepthTexture, gl_MultiTexCoord0.xy, 0.0).x) * 3.0)); 7 | gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_1); 8 | vec4 tmpvar_2; 9 | tmpvar_2.zw = vec2(0.0, 0.0); 10 | tmpvar_2.xy = gl_MultiTexCoord0.xy; 11 | gl_TexCoord[0] = tmpvar_2; 12 | } 13 | 14 | 15 | // stats: 5 alu 1 tex 0 flow 16 | // inputs: 2 17 | // #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 18 | // #1: gl_Vertex (high float) 4x1 [-1] loc 0 19 | // uniforms: 1 (total size: 0) 20 | // #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] 21 | // textures: 1 22 | // #0: _CameraDepthTexture (high 2d) 0x0 [-1] 23 | -------------------------------------------------------------------------------- /tests/vertex/zun-Test_VertexShaderTexture-out.txt: -------------------------------------------------------------------------------- 1 | uniform sampler2D _MainTex; 2 | void main () 3 | { 4 | vec4 tmpvar_1; 5 | tmpvar_1.xzw = gl_Vertex.xzw; 6 | tmpvar_1.y = (gl_Vertex.y + (texture2DLod (_MainTex, gl_MultiTexCoord0.xy, 0.0).x * 2.0)); 7 | gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_1); 8 | vec4 tmpvar_2; 9 | tmpvar_2.zw = vec2(0.0, 0.0); 10 | tmpvar_2.xy = gl_MultiTexCoord0.xy; 11 | gl_TexCoord[0] = tmpvar_2; 12 | } 13 | 14 | 15 | // stats: 4 alu 1 tex 0 flow 16 | // inputs: 2 17 | // #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8 18 | // #1: gl_Vertex (high float) 4x1 [-1] loc 0 19 | // uniforms: 1 (total size: 0) 20 | // #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1] 21 | // textures: 1 22 | // #0: _MainTex (high 2d) 0x0 [-1] 23 | --------------------------------------------------------------------------------