Add Android Vulkan backend (#2711)

Co-authored-by: Bart Louwers <bart.louwers@gmail.com>
This commit is contained in:
Adrian Cojocaru
2024-09-06 17:40:57 +03:00
committed by GitHub
parent 4b5d06d908
commit ea09bdf2b6
79 changed files with 2580 additions and 1400 deletions

View File

@@ -8,7 +8,7 @@ const std::array<UniformBlockInfo, 2> ShaderSource<BuiltIn::BackgroundShader, gf
UniformBlockInfo{false, true, sizeof(BackgroundLayerUBO), idBackgroundLayerUBO},
};
const std::array<AttributeInfo, 1> ShaderSource<BuiltIn::BackgroundShader, gfx::Backend::Type::Vulkan>::attributes = {
AttributeInfo{0, gfx::AttributeDataType::Float3, idBackgroundPosVertexAttribute},
AttributeInfo{0, gfx::AttributeDataType::Short2, idBackgroundPosVertexAttribute},
};
const std::array<UniformBlockInfo, 3>
@@ -19,7 +19,7 @@ const std::array<UniformBlockInfo, 3>
};
const std::array<AttributeInfo, 1>
ShaderSource<BuiltIn::BackgroundPatternShader, gfx::Backend::Type::Vulkan>::attributes = {
AttributeInfo{0, gfx::AttributeDataType::Float3, idBackgroundPosVertexAttribute},
AttributeInfo{0, gfx::AttributeDataType::Short2, idBackgroundPosVertexAttribute},
};
const std::array<TextureInfo, 1> ShaderSource<BuiltIn::BackgroundPatternShader, gfx::Backend::Type::Vulkan>::textures =
{TextureInfo{0, idBackgroundImageTexture}};

View File

@@ -185,7 +185,7 @@ const vk::UniquePipeline& ShaderProgram::getPipeline(const PipelineInfo& pipelin
// vk::DynamicState::eDepthBias,
// vk::DynamicState::eDepthBounds,
const auto& dynamicValues = pipelineInfo.getDynamicStates();
const auto& dynamicValues = pipelineInfo.getDynamicStates(backend);
const vk::PipelineDynamicStateCreateInfo dynamicState({}, dynamicValues);
const auto& device = backend.getDevice();

View File

@@ -0,0 +1,22 @@
#include <mbgl/shaders/vulkan/widevector.hpp>
namespace mbgl {
namespace shaders {
const std::array<UniformBlockInfo, 2> ShaderSource<BuiltIn::WideVectorShader, gfx::Backend::Type::Vulkan>::uniforms = {
UniformBlockInfo{true, false, sizeof(WideVectorUniformsUBO), idWideVectorUniformsUBO},
UniformBlockInfo{true, false, sizeof(WideVectorUniformWideVecUBO), idWideVectorUniformWideVecUBO},
};
const std::array<AttributeInfo, 3> ShaderSource<BuiltIn::WideVectorShader, gfx::Backend::Type::Vulkan>::attributes = {
AttributeInfo{0, gfx::AttributeDataType::Float3, idWideVectorScreenPos},
AttributeInfo{1, gfx::AttributeDataType::Float4, idWideVectorColor},
AttributeInfo{2, gfx::AttributeDataType::Int, idWideVectorIndex}};
const std::array<AttributeInfo, 4>
ShaderSource<BuiltIn::WideVectorShader, gfx::Backend::Type::Vulkan>::instanceAttributes = {
AttributeInfo{3, gfx::AttributeDataType::Float3, idWideVectorInstanceCenter},
AttributeInfo{4, gfx::AttributeDataType::Float4, idWideVectorInstanceColor},
AttributeInfo{5, gfx::AttributeDataType::Int, idWideVectorInstancePrevious},
AttributeInfo{6, gfx::AttributeDataType::Int, idWideVectorInstanceNext}};
} // namespace shaders
} // namespace mbgl