summaryrefslogtreecommitdiff
path: root/servers/visual/shader_language.cpp
AgeCommit message (Collapse)Author
2019-08-23Implements switch to shadersYuri Roubinski
2019-08-13Implemented do/while loops for shadersYuri Roubinski
2019-08-13Force user to initialize local shader constantsYuri Roubinski
2019-08-09Show that identifier found in function namesCameron Reikes
2019-08-05Implemented local shader constantsYuri Roubinski
2019-07-23Fix some code found by Coverity Scan and PVS Studioqarmin
2019-07-16Allows to use non-constants in the local shader array initializerChaosus
2019-07-16Added local array initializerChaosus
2019-07-15Implemented local shader arraysChaosus
2019-07-15Added missed "textureProjLod" shader built-in overload for 3D texturesChaosus
2019-07-11Make the default return value on crash explicithbina085
Noticed that the error condition will return a NULL instead of something more explicit like "false". Should make the code more readable at a glance.
2019-07-11Removed invalid mix shader overloadsChaosus
2019-07-09Fix "not" shader function return typeChaosus
2019-07-06Fix code completion for shader editorgeequlim
2019-06-01Added constant support to shadersChaosus
Co-authored-by: DavidSichma <sichmada@gmail.com>
2019-05-24Merge pull request #28829 from vreon/swizzle-upRémi Verschelde
Allow constructing larger data types by swizzling
2019-05-19Fix typos with codespellRémi Verschelde
Using codespell 1.15.0. Method: ``` $ cat > ../godot-word-whitelist.txt << EOF ang curvelinear doubleclick leapyear lod merchantibility nd numer ois ony que seeked synching te uint unselect webp EOF $ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po" $ git diff // undo unwanted changes ```
2019-05-11Allow constructing larger data types by swizzlingJesse Dubay
GLSL allows the construction of larger data types by swizzling smaller ones, but Godot shading language treated this as an error: vec2 test2 = vec2(0.0, 1.0); vec3 test3 = test2.xxx; // error: Invalid member for vec2 expression This commit updates the expression parser for the 2 and 3-component data types accordingly. Fixes #10496
2019-04-09Style: Apply new changes from clang-format 8.0Rémi Verschelde
It seems to stay compatible with formatting done by clang-format 6.0 and 7.0, so contributors can keep using those versions for now (they will not undo those changes).
2019-02-26Ensure implicit conversions for scalar constants work in shaders, closes #26239Juan Linietsky
2019-02-23-Treat scalar conversions when calling functions as error, closes #24261Juan Linietsky
-Make shader editor display errors if exist when just opening it -Make ShaderMaterial not lose parameters if opened in error.
2019-02-20Add -Wshadow=local to warnings and fix reported issues.marxin
Fixes #25316.
2019-01-30Fix many asan and ubsan reported issuesHein-Pieter van Braam
This allows most demos to run without any ubsan or asan errors. There are still some things in thirdpart/ and some things in AudioServer that needs a look but this fixes a lot of issues. This should help debug less obvious issues, hopefully. This fixes #25217 and fixes #25218
2019-01-01Update copyright statements to 2019Rémi Verschelde
Happy new year to the wonderful Godot community!
2018-12-30Always treat exponent as floatBastiaan Olij
2018-11-24Allow *= operator between vec and mat types in shadersKanabenki
2018-11-21Removed noperspective (not in GLSL ES 3.0), do not write smooth if not ↵Juan Linietsky
specified. Fixes #20435
2018-11-16Use hint_color when getting shader default paramsJFonS
2018-11-14Proper validation of out arguments in built-in shader functions, closes #16244Juan Linietsky
2018-11-12Do not allow samplers where they dont belong (variables/return types), fixes ↵Juan Linietsky
#15133
2018-10-25fixed uninitialized variables and false positives found by CppCheckSimon Wenner
2018-10-19Fixing warnings generated by MSVCDualtagh Murray
Fixes #22684.
2018-09-27Fix warnings about unhandled enum value in switch [-Wswitch]Rémi Verschelde
Fixes GCC 5 warnings of the form: core/io/http_client.cpp:288:9: warning: enumeration value 'STATUS_SSL_HANDSHAKE_ERROR' not handled in switch [-Wswitch] core/io/marshalls.cpp:806:9: warning: enumeration value 'AABB' not handled in switch [-Wswitch] Those can be trivial cases where adding a default fallback is the solution, or more complex issues/hidden bugs where missed values are actually meant to be handled.
2018-09-27Fix warnings about set but unused variables [-Wunused-but-set-variable]Rémi Verschelde
Fixes the following GCC 5 warnings: ``` drivers/gles2/rasterizer_canvas_gles2.cpp:814:8: warning: variable 'rt_size' set but not used [-Wunused-but-set-variable] drivers/gles2/rasterizer_scene_gles2.cpp:2270:11: warning: variable 'vp_height' set but not used [-Wunused-but-set-variable] drivers/gles2/rasterizer_scene_gles2.cpp:2673:22: warning: variable 'e' set but not used [-Wunused-but-set-variable] drivers/gles2/rasterizer_scene_gles2.cpp:715:7: warning: variable 'no_cull' set but not used [-Wunused-but-set-variable] drivers/gles2/shader_gles2.cpp:693:14: warning: variable 'cc' set but not used [-Wunused-but-set-variable] drivers/gles3/rasterizer_canvas_gles3.cpp:1226:8: warning: variable 'rt_size' set but not used [-Wunused-but-set-variable] drivers/gles3/rasterizer_scene_gles3.cpp:3039:10: warning: variable 'contrib' set but not used [-Wunused-but-set-variable] drivers/gles3/rasterizer_scene_gles3.cpp:4504:32: warning: variable 'vp_height' set but not used [-Wunused-but-set-variable] editor/editor_inspector.cpp:272:9: warning: variable 'guide_color' set but not used [-Wunused-but-set-variable] editor/editor_themes.cpp:1067:14: warning: variable 'alpha3' set but not used [-Wunused-but-set-variable] editor/editor_themes.cpp:263:8: warning: variable 'script_bg_color' set but not used [-Wunused-but-set-variable] editor/plugins/collision_shape_2d_editor_plugin.cpp:326:11: warning: variable 'cpoint' set but not used [-Wunused-but-set-variable] editor/plugins/mesh_editor_plugin.cpp:72:9: warning: variable 'size' set but not used [-Wunused-but-set-variable] editor/plugins/shader_editor_plugin.cpp:471:12: warning: variable 'mpos' set but not used [-Wunused-but-set-variable] editor/plugins/shader_editor_plugin.cpp:89:8: warning: variable 'basetype_color' set but not used [-Wunused-but-set-variable] editor/plugins/shader_editor_plugin.cpp:90:8: warning: variable 'type_color' set but not used [-Wunused-but-set-variable] editor/plugins/shader_editor_plugin.cpp:92:8: warning: variable 'string_color' set but not used [-Wunused-but-set-variable] modules/visual_script/visual_script_editor.cpp:2521:7: warning: variable 'seq_connect' set but not used [-Wunused-but-set-variable] platform/android/export/export.cpp:580:12: warning: variable 'styles_count' set but not used [-Wunused-but-set-variable] platform/android/export/export.cpp:584:12: warning: variable 'styles_offset' set but not used [-Wunused-but-set-variable] platform/osx/export/export.cpp:464:9: warning: variable 'zerr' set but not used [-Wunused-but-set-variable] scene/2d/tile_map.cpp:260:10: warning: variable 'tcenter' set but not used [-Wunused-but-set-variable] scene/3d/light.cpp:166:7: warning: variable 'editor_ok' set but not used [-Wunused-but-set-variable] scene/3d/navigation.cpp:566:11: warning: variable 'closest_navmesh' set but not used [-Wunused-but-set-variable] scene/gui/rich_text_label.cpp:869:8: warning: variable 'size' set but not used [-Wunused-but-set-variable] scene/main/viewport.cpp:705:14: warning: variable 'xform' set but not used [-Wunused-but-set-variable] scene/main/viewport.cpp:706:8: warning: variable 'ss' set but not used [-Wunused-but-set-variable] scene/main/viewport.cpp:726:14: warning: variable 'xform' set but not used [-Wunused-but-set-variable] scene/main/viewport.cpp:727:8: warning: variable 'ss' set but not used [-Wunused-but-set-variable] scene/resources/material.cpp:430:7: warning: variable 'using_world' set but not used [-Wunused-but-set-variable] servers/visual/shader_language.cpp:2026:7: warning: variable 'all_const' set but not used [-Wunused-but-set-variable] servers/visual/visual_server_scene.cpp:1383:28: warning: variable 'z_max_cam' set but not used [-Wunused-but-set-variable] ``` Also fixes two [-Wunused-value] warnings: ``` scene/gui/text_edit.cpp:4405:20: warning: statement has no effect [-Wunused-value] servers/visual/visual_server_scene.cpp:905:48: warning: value computed is not used [-Wunused-value] ``` Some of those are bugs and need further work, they are identified with `// FIXME` comments.
2018-09-21Added missed min/max shader overloadsChaosus
2018-09-19Fixed an access after free in ShaderLanguage::_reduce_expression.Ibrahn Sahir
Passing an element reference of a vector to a push_back call to that same vector can cause an access after free. This is because push_back will resize the vector, reallocating if necessary, leaving the reference referring to the freed memory. Removed an instance of this usage here.
2018-09-13Set uniform default values in inspectorJFonS
2018-09-12Make core/ includes absolute, remove subfolders from include pathRémi Verschelde
This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
2018-08-31Fix handling of shader constants that caused crash, closes #15166JFonS
2018-08-24Make some debug prints verbose-only, remove othersRémi Verschelde
2018-08-19Allow matrixes in varyingsChaosus
2018-08-10Merge pull request #20149 from Overblob/shader_float_typingJuan Linietsky
Shader language - Add optional float typings
2018-07-30add 3D texturesThomas Herzog
2018-07-29Manually fix, merge and close #15168Juan Linietsky
2018-07-26Reduce unnecessary COW on Vector by make writing explicitHein-Pieter van Braam
This commit makes operator[] on Vector const and adds a write proxy to it. From now on writes to Vectors need to happen through the .write proxy. So for instance: Vector<int> vec; vec.push_back(10); std::cout << vec[0] << std::endl; vec.write[0] = 20; Failing to use the .write proxy will cause a compilation error. In addition COWable datatypes can now embed a CowData pointer to their data. This means that String, CharString, and VMap no longer use or derive from Vector. _ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug builds. This is a lot faster for Vector in the editor and while running tests. The reason why this difference used to exist is because force-inlined methods used to give a bad debugging experience. After extensive testing with modern compilers this is no longer the case.
2018-07-26allow comments and whitespace before shader_type declarationTodd Ross
2018-07-25Added conversions between matrixes in shadersChaosus
2018-07-17Merge pull request #20158 from Overblob/Fixed_shader_parsing_error_logRémi Verschelde
Fixed shader parsing error log
2018-07-15* Small hex/float/integer parsing refactoringOverblob
* Potential bug fix on hex (cannot be used atm) * Added optional typing for floats, eg: "1f" -> "1.0" "1.f" -> "1.0" "1.99f" -> "1.99" "1." -> "1.0"
2018-07-14Visual Shaders are back.Juan Linietsky