summaryrefslogtreecommitdiff
path: root/servers/visual/shader_language.cpp
AgeCommit message (Collapse)Author
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
2018-07-14Fixed error due to bad cursor handling when parsing shader codeOverblob
Fixed completion error log thrown on "no auto-completion found" for typings with no completion.
2018-06-01Fix return type of isnan and isinf in the shader languageOliver Rausch
2018-05-16Fix bad operator check in `ShaderLanguage::_validate_assign`nemerle
2018-05-07Merge pull request #18533 from JFonS/fix_shader_compileJuan Linietsky
Fix vector reduction in shader language
2018-05-07Fix vector reduction in shader languageJFonS
2018-05-01Merge pull request #18321 from Crazy-P/Fixes-logically-dead-codeRémi Verschelde
Fixes logically dead code (Coverity)
2018-04-22Change ".." punctuation for "..." in editor strings (#16507)Hugo Locurcio
2018-04-21Fixes logically dead code (Coverity)Crazy-P
Fixes reported logically dead codes by Coverity * image.cpp: Doesn't really need any modification. But to remove the bug report then we have to move the MAX call away from the for loop statement. * rasterizer_gles3.cpp: Removes unnecessary elif condition since it is checked earlier in the function * collada.cpp: If stamement never reached due to macro ERR_CONTINUE does the same. * navigation_mesh.cpp: Variables should always be null - however, also checked for the very same condition in their function call. Leaving this for review (whether the function call is necessary or not) * path_editor_plugin.cpp: If cancel is true, then it should restore the edited value to the original provided. http://docs.godotengine.org/en/3.0/classes/class_editorspatialgizmo.html#class-editorspatialgizmo-commit-handle * spatial_editor_gizmos.cpp: the very condition of i >= 3 is predetermined in the if case right before it. Thus case 1 is always '1' and case 2 is always '-1' * grid_map_editor.cpp: Same as above in spatial_editor_gizmos.cpp * voxel_light_baker.cpp: Same as above in spatial_editor_gizmos.cpp * visual_server.cpp: Same as above in spatial_editor_gizmos.cpp * visual_script_expression.cpp: char '-' is already true in the switch case mechanism. Thus it can never reach to default case. * particles.cpp: Case 'PARAM_MAX' is unreachable due to index checking right before the switch execution. * shader_language.cpp: Invalid index is handled in switch default case. `type < TYPE_FLOAT && type > TYPE_VEC4` -> `(type < TYPE_FLOAT || type > TYPE_VEC4`) Fixes the "always false problem" in TODO comment.
2018-04-17Fix typos in shader_language.cppPoommetee Ketson
2018-03-28Removed redundant abs shader builtinChaosus
2018-03-15Hinted shader uniforms can have a default valueJFonS
2018-03-10Fix invalid mix function overloadChaosus
2018-03-07Make the shader token names consistent.Saracen
2018-03-03Fix floatBitsToUint functionChaosus
2018-02-20Revert "Handle single-argument constructors in uniform default values"Juan Linietsky
2018-02-20Merge pull request #15985 from Nallebeorn/uniforms-single-argument-constructorsRémi Verschelde
Handle single-argument constructors in uniform default values
2018-02-18Added missing shader functionsChaosus
2018-01-22Handle single-argument constructors in shaders.Benjamin
Expand these (fill vectors, fill matrix diagonals) in _reduce_expression() so they're handled properly even as uniform default values (where they previously caused a crash).
2018-01-05Add missing copyright headers and fix formattingRémi Verschelde
Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
2018-01-03Fix premature declaration of shader variables created with assignmentbinbitten
2018-01-01Update copyright statements to 2018Rémi Verschelde
Happy new year to the wonderful Godot community!
2017-12-29Fixed wrong highlighted line when erroring and using single-line comments, ↵binbitten
fixes #15167
2017-12-17Cleanup some #if 0'd codeRémi Verschelde
2017-12-17Shader Language: Add in-for declared variables within for-block scope.Enzo Nocera
2017-12-15Made built-in identifiers properly constant in shaders. Fixes #14449, closes ↵Juan Linietsky
#14629
2017-11-27Added interpolation modifiers to shaderlangScayze
2017-11-27Added overloads of vector parameters for shader Trig functions.RaXaR
Ammend: Removed whitespace from blank lines. Ammend2: Removed extra spaces in an attempt to make Clang happy. :)
2017-11-25Made Vector::ptrw explicit for writing, compiler was sometimes using the ↵Juan Linietsky
wrong function, leading to unnecesary copy on writes and reduced performance.
2017-11-23Rename two-parameter arc-tangent function to atan in shader language, as it ↵Ferenc Arn
is in GLSL. Fixes #13214.
2017-10-16Fix crash in shader parsingPedro J. Estébanez
...that would happen if incorrect syntax was found just after an opening square bracket. Fixes #12046.
2017-09-27Fixes to light shaders, should work now..Juan Linietsky
2017-09-24Discarding now works in shadersDaniel Doran
"discard" has been added to the list of recognised keywords. A flag specifing when discarding is allowed is now set correctly.
2017-09-21Add inversesqrt to shader language.Ferenc Arn
2017-09-08Fix unused variable warningsHein-Pieter van Braam
The forth in my quest to make Godot 3.x compile with -Werror on GCC7
2017-09-05Added support for for, break and continue. Closes #10560, closes #10661Juan Linietsky