diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-10-05 10:42:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-11 12:03:44 +0100 |
commit | 6075c5f9bf6cf3362c51e0915555361d34954215 (patch) | |
tree | 83b2ae5a23a17548f1c563074f5ab566b9a94eae | |
parent | fb739f9da78214e172334e39145b9e066541e220 (diff) | |
parent | 26318f3bd1b9fa9c7b7708cbef95b4cee56f1718 (diff) |
Merge pull request #32560 from bruvzg/vlk_v3_fix
[Vulkan] Fix Vector3 ambiguities and out of bounds init.
-rw-r--r-- | core/math/vector3.cpp | 4 | ||||
-rw-r--r-- | editor/import/editor_scene_importer_gltf.cpp | 2 | ||||
-rw-r--r-- | main/tests/test_math.cpp | 4 | ||||
-rw-r--r-- | modules/assimp/editor_scene_importer_assimp.cpp | 3 | ||||
-rw-r--r-- | servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp | 3 |
5 files changed, 7 insertions, 9 deletions
diff --git a/core/math/vector3.cpp b/core/math/vector3.cpp index 71ff79c0fc..353b2acd16 100644 --- a/core/math/vector3.cpp +++ b/core/math/vector3.cpp @@ -103,7 +103,7 @@ Vector3 Vector3::cubic_interpolaten(const Vector3 &p_b, const Vector3 &p_pre_a, Vector3 out; out = 0.5 * ((p1 * 2.0) + (-p0 + p2) * t + - (2.0 * p0 - 5.0 * p1 + 4 * p2 - p3) * t2 + + (2.0 * p0 - 5.0 * p1 + 4.0 * p2 - p3) * t2 + (-p0 + 3.0 * p1 - 3.0 * p2 + p3) * t3); return out; } @@ -122,7 +122,7 @@ Vector3 Vector3::cubic_interpolate(const Vector3 &p_b, const Vector3 &p_pre_a, c Vector3 out; out = 0.5 * ((p1 * 2.0) + (-p0 + p2) * t + - (2.0 * p0 - 5.0 * p1 + 4 * p2 - p3) * t2 + + (2.0 * p0 - 5.0 * p1 + 4.0 * p2 - p3) * t2 + (-p0 + 3.0 * p1 - 3.0 * p2 + p3) * t3); return out; } diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index 65da85b684..c0d84b61b4 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -2618,7 +2618,7 @@ struct EditorSceneImporterGLTFInterpolate { const float t2 = t * t; const float t3 = t2 * t; - return 0.5f * ((2.0f * p1) + (-p0 + p2) * t + (2.0f * p0 - 5.0f * p1 + 4 * p2 - p3) * t2 + (-p0 + 3.0f * p1 - 3.0f * p2 + p3) * t3); + return 0.5f * ((2.0f * p1) + (-p0 + p2) * t + (2.0f * p0 - 5.0f * p1 + 4.0f * p2 - p3) * t2 + (-p0 + 3.0f * p1 - 3.0f * p2 + p3) * t3); } T bezier(T start, T control_1, T control_2, T end, float t) { diff --git a/main/tests/test_math.cpp b/main/tests/test_math.cpp index af537fb3f4..2c4ba08c6d 100644 --- a/main/tests/test_math.cpp +++ b/main/tests/test_math.cpp @@ -618,8 +618,8 @@ MainLoop *test() { print_line("minus: " + (Vector3(1, 2, 3) - Vector3(Vector3(4, 5, 7)))); print_line("mul: " + (Vector3(1, 2, 3) * Vector3(Vector3(4, 5, 7)))); print_line("div: " + (Vector3(1, 2, 3) / Vector3(Vector3(4, 5, 7)))); - print_line("mul scalar: " + (Vector3(1, 2, 3) * 2)); - print_line("premul scalar: " + (2 * Vector3(1, 2, 3))); + print_line("mul scalar: " + (Vector3(1, 2, 3) * 2.0)); + print_line("premul scalar: " + (2.0 * Vector3(1, 2, 3))); print_line("div scalar: " + (Vector3(1, 2, 3) / 3.0)); print_line("length: " + rtos(Vector3(1, 2, 3).length())); print_line("length squared: " + rtos(Vector3(1, 2, 3).length_squared())); diff --git a/modules/assimp/editor_scene_importer_assimp.cpp b/modules/assimp/editor_scene_importer_assimp.cpp index 7a84a5329d..2e653f4c5d 100644 --- a/modules/assimp/editor_scene_importer_assimp.cpp +++ b/modules/assimp/editor_scene_importer_assimp.cpp @@ -167,8 +167,7 @@ struct EditorSceneImporterAssetImportInterpolate { float t2 = t * t; float t3 = t2 * t; - return 0.5f * ((2.0f * p1) + (-p0 + p2) * t + (2.0f * p0 - 5.0f * p1 + 4 * p2 - p3) * t2 + - (-p0 + 3.0f * p1 - 3.0f * p2 + p3) * t3); + return 0.5f * ((2.0f * p1) + (-p0 + p2) * t + (2.0f * p0 - 5.0f * p1 + 4.0f * p2 - p3) * t2 + (-p0 + 3.0f * p1 - 3.0f * p2 + p3) * t3); } T bezier(T start, T control_1, T control_2, T end, float t) { diff --git a/servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp b/servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp index b6228bf165..000fdfda0c 100644 --- a/servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp +++ b/servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp @@ -517,9 +517,8 @@ void RasterizerCanvasRD::_render_item(RD::DrawListID p_draw_list, const Item *p_ push_constant.color_texture_pixel_size[0] = 0; push_constant.color_texture_pixel_size[1] = 0; + push_constant.pad[0] = 0; push_constant.pad[1] = 0; - push_constant.pad[2] = 0; - push_constant.pad[3] = 0; push_constant.lights[0] = 0; push_constant.lights[1] = 0; |