diff --git a/.travis.yml b/.travis.yml index 5d8c8ca4..769bba57 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,16 +26,24 @@ matrix: # - name: "Linux (Clang)" # os: linux # compiler: clang - # - name: "Linux (GCC) with Valgrind" - # os: linux - # compiler: gcc - # addons: - # apt: - # packages: - # - valgrind - # script: - # - make -j - # - valgrind --error-exitcode=99 ./tests + - name: "Linux (GCC 9) with Valgrind" + os: linux + compiler: gcc + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - valgrind + - libglu1-mesa-dev + - g++-9 + before_script: + - mkdir build + - cd build + - cmake -DWARNINGS_AS_ERRORS=OFF -DDECK_ENABLE_GRAPHICS=OFF -DDECK_ENABLE_FORMAT=OFF -DCMAKE_C_COMPILER=gcc-9 -DCMAKE_CXX_COMPILER=g++-9 .. + script: + - make -j + - valgrind --error-exitcode=99 ./deckgl-bundle-tests before_script: # Build out of source diff --git a/cpp/deps b/cpp/deps index a234fd51..2e4acb58 160000 --- a/cpp/deps +++ b/cpp/deps @@ -1 +1 @@ -Subproject commit a234fd5151dfeb623522c06b1b9a35050dfe7c14 +Subproject commit 2e4acb589200a50e72314b763bfac02293bf0806 diff --git a/cpp/modules/deck.gl/core/src/shaderlib/project/viewport-uniforms.cpp b/cpp/modules/deck.gl/core/src/shaderlib/project/viewport-uniforms.cpp index 76d9f622..0c934ee5 100644 --- a/cpp/modules/deck.gl/core/src/shaderlib/project/viewport-uniforms.cpp +++ b/cpp/modules/deck.gl/core/src/shaderlib/project/viewport-uniforms.cpp @@ -172,24 +172,24 @@ auto calculateViewportUniforms(const std::shared_ptr& viewport, double // TODO(ilija@unfolded.ai): wrapLongitude and modelMatrix not set, set them to default values explicitly if they // aren't relevant? ViewportUniforms uniforms = {// Projection mode values + .viewProjectionMatrix = Matrix4{matrixAndOffset.viewProjectionMatrix}, + .center = Vector4{matrixAndOffset.projectionCenter}, + .commonUnitsPerMeter = Vector3{distanceScales.unitsPerMeter}, .coordinateSystem = static_cast(coordinateSystem), + .commonUnitsPerWorldUnit = Vector3{distanceScales.unitsPerMeter}, .projectionMode = static_cast(viewport->projectionMode()), + .commonUnitsPerWorldUnit2 = Vector3{DEFAULT_PIXELS_PER_UNIT2}, .scale = static_cast(viewport->scale), // This is the mercator scale (2 ** zoom) + // This is for lighting calculations + .cameraPosition = Vector3(matrixAndOffset.cameraPosCommon), .antimeridian = static_cast(antimeridian), - .commonUnitsPerMeter = Vector3{distanceScales.unitsPerMeter}, - .commonUnitsPerWorldUnit = Vector3{distanceScales.unitsPerMeter}, - .commonUnitsPerWorldUnit2 = Vector3{DEFAULT_PIXELS_PER_UNIT2}, - .center = Vector4{matrixAndOffset.projectionCenter}, - .viewProjectionMatrix = Matrix4{matrixAndOffset.viewProjectionMatrix}, + .coordinateOrigin = Vector3{matrixAndOffset.shaderCoordinateOrigin}, + .devicePixelRatio = static_cast(devicePixelRatio), // Screen size .viewportSize = Vector2{viewportSize}, - .devicePixelRatio = static_cast(devicePixelRatio), // Distance at which screen pixels are projected // TODO(isaac@unfolded.ai): optional focalDistance - .focalDistance = static_cast(viewport->focalDistance), - // This is for lighting calculations - .cameraPosition = Vector3(matrixAndOffset.cameraPosCommon), - .coordinateOrigin = Vector3{matrixAndOffset.shaderCoordinateOrigin}}; + .focalDistance = static_cast(viewport->focalDistance)}; if (matrixAndOffset.geospatialOrigin.has_value()) { auto distanceScalesAtOrigin = viewport->getDistanceScales(matrixAndOffset.geospatialOrigin.value().toVector2()); diff --git a/cpp/modules/luma.gl/CMakeLists.txt b/cpp/modules/luma.gl/CMakeLists.txt index 3b9913f0..384ff753 100644 --- a/cpp/modules/luma.gl/CMakeLists.txt +++ b/cpp/modules/luma.gl/CMakeLists.txt @@ -93,6 +93,10 @@ target_link_libraries(luma.gl PUBLIC ${DECK_LINK_FLAGS} ${DECK_DEPS_PATH}/webgpu_cpp.o ) target_link_libraries(luma.gl PUBLIC ${DECK_CONFIG_LIBRARY} math.gl probe.gl) +if (NOT APPLE) + # TODO: Check if still needed + target_link_libraries(luma.gl PUBLIC -pthread -ldl -lX11) +endif() # GLFW dependencies if (APPLE) diff --git a/cpp/modules/luma.gl/core/src/model.cpp b/cpp/modules/luma.gl/core/src/model.cpp index 9d8fee86..567876ee 100644 --- a/cpp/modules/luma.gl/core/src/model.cpp +++ b/cpp/modules/luma.gl/core/src/model.cpp @@ -151,7 +151,7 @@ void Model::_initializeVertexState(utils::ComboVertexStateDescriptor* descriptor auto Model::_createBindGroupLayout(wgpu::Device device, const std::vector& uniforms) -> wgpu::BindGroupLayout { std::vector bindings; - for (uint32 i = 0; i < uniforms.size(); i++) { + for (uint32_t i = 0; i < uniforms.size(); i++) { auto binding = wgpu::BindGroupLayoutBinding{i, wgpu::ShaderStage::Vertex, wgpu::BindingType::UniformBuffer, uniforms[i].isDynamic}; bindings.push_back(binding); diff --git a/cpp/modules/luma.gl/webgpu/src/shaderc-utils.cpp b/cpp/modules/luma.gl/webgpu/src/shaderc-utils.cpp index e5a678df..6aac53e9 100644 --- a/cpp/modules/luma.gl/webgpu/src/shaderc-utils.cpp +++ b/cpp/modules/luma.gl/webgpu/src/shaderc-utils.cpp @@ -23,6 +23,7 @@ #include "./shaderc-utils.h" // NOLINT(build/include) +#include #include #include "probe.gl/core.h" diff --git a/cpp/modules/luma.gl/webgpu/src/webgpu-helpers.cpp b/cpp/modules/luma.gl/webgpu/src/webgpu-helpers.cpp index 6cdaf2eb..dd180ad2 100644 --- a/cpp/modules/luma.gl/webgpu/src/webgpu-helpers.cpp +++ b/cpp/modules/luma.gl/webgpu/src/webgpu-helpers.cpp @@ -23,6 +23,7 @@ #include "./webgpu-helpers.h" // NOLINT(build/include) +#include #include #include #include