Skip to content

Commit

Permalink
Removed uniform blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcristici committed Dec 13, 2024
1 parent 906f708 commit e3c2a15
Show file tree
Hide file tree
Showing 114 changed files with 671 additions and 1,314 deletions.
6 changes: 0 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ if(MLN_DRAWABLE_RENDERER)
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/drawable_atlases_tweaker.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/drawable_custom_layer_host_tweaker.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/gpu_expression.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/uniform_block.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/uniform_buffer.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/vertex_attribute.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/texture2d.hpp
Expand All @@ -177,7 +176,6 @@ if(MLN_DRAWABLE_RENDERER)
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/line_drawable_data.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/symbol_drawable_data.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/collision_drawable_data.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/uniform_block.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/uniform_buffer.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/vertex_attribute.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/render_target.cpp
Expand Down Expand Up @@ -1165,7 +1163,6 @@ if(MLN_WITH_OPENGL)
${PROJECT_SOURCE_DIR}/include/mbgl/gl/drawable_gl.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/drawable_gl_builder.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/layer_group_gl.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/uniform_block_gl.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/uniform_buffer_gl.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/vertex_attribute_gl.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/texture2d.hpp
Expand All @@ -1179,7 +1176,6 @@ if(MLN_WITH_OPENGL)
${PROJECT_SOURCE_DIR}/src/mbgl/gl/drawable_gl_impl.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/layer_group_gl.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/texture2d.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/uniform_block_gl.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/uniform_buffer_gl.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/vertex_attribute_gl.cpp
)
Expand Down Expand Up @@ -1210,7 +1206,6 @@ if(MLN_WITH_METAL)
${PROJECT_SOURCE_DIR}/include/mbgl/mtl/renderable_resource.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/mtl/texture2d.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/mtl/tile_layer_group.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/mtl/uniform_block.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/mtl/uniform_buffer.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/mtl/upload_pass.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/mtl/vertex_attribute.hpp
Expand Down Expand Up @@ -1250,7 +1245,6 @@ if(MLN_WITH_METAL)
${PROJECT_SOURCE_DIR}/src/mbgl/mtl/texture2d.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/mtl/render_pass.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/mtl/tile_layer_group.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/mtl/uniform_block.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/mtl/uniform_buffer.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/mtl/upload_pass.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/mtl/vertex_attribute.cpp
Expand Down
6 changes: 0 additions & 6 deletions bazel/core.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,6 @@ MLN_DRAWABLES_SOURCE = [
"src/mbgl/gfx/line_drawable_data.hpp",
"src/mbgl/gfx/symbol_drawable_data.hpp",
"src/mbgl/gfx/collision_drawable_data.hpp",
"src/mbgl/gfx/uniform_block.cpp",
"src/mbgl/gfx/uniform_buffer.cpp",
"src/mbgl/gfx/vertex_attribute.cpp",
"src/mbgl/renderer/change_request.cpp",
Expand Down Expand Up @@ -994,7 +993,6 @@ MLN_DRAWABLES_HEADERS = [
"include/mbgl/gfx/drawable_atlases_tweaker.hpp",
"include/mbgl/gfx/drawable_custom_layer_host_tweaker.hpp",
"include/mbgl/gfx/gpu_expression.hpp",
"include/mbgl/gfx/uniform_block.hpp",
"include/mbgl/gfx/uniform_buffer.hpp",
"include/mbgl/gfx/vertex_attribute.hpp",
"include/mbgl/gfx/texture2d.hpp",
Expand Down Expand Up @@ -1033,7 +1031,6 @@ MLN_DRAWABLES_GL_SOURCE = [
"src/mbgl/gl/drawable_gl_impl.hpp",
"src/mbgl/gl/layer_group_gl.cpp",
"src/mbgl/gl/texture2d.cpp",
"src/mbgl/gl/uniform_block_gl.cpp",
"src/mbgl/gl/uniform_buffer_gl.cpp",
"src/mbgl/gl/vertex_attribute_gl.cpp",
"src/mbgl/shaders/gl/shader_info.cpp",
Expand All @@ -1045,7 +1042,6 @@ MLN_DRAWABLES_GL_HEADERS = [
"include/mbgl/gl/drawable_gl.hpp",
"include/mbgl/gl/drawable_gl_builder.hpp",
"include/mbgl/gl/layer_group_gl.hpp",
"include/mbgl/gl/uniform_block_gl.hpp",
"include/mbgl/gl/uniform_buffer_gl.hpp",
"include/mbgl/gl/vertex_attribute_gl.hpp",
"include/mbgl/gl/texture2d.hpp",
Expand All @@ -1069,7 +1065,6 @@ MLN_DRAWABLES_MTL_SOURCE = [
"src/mbgl/mtl/texture2d.cpp",
"src/mbgl/mtl/render_pass.cpp",
"src/mbgl/mtl/tile_layer_group.cpp",
"src/mbgl/mtl/uniform_block.cpp",
"src/mbgl/mtl/uniform_buffer.cpp",
"src/mbgl/mtl/upload_pass.cpp",
"src/mbgl/mtl/vertex_attribute.cpp",
Expand Down Expand Up @@ -1109,7 +1104,6 @@ MLN_DRAWABLES_MTL_HEADERS = [
"include/mbgl/mtl/renderable_resource.hpp",
"include/mbgl/mtl/texture2d.hpp",
"include/mbgl/mtl/tile_layer_group.hpp",
"include/mbgl/mtl/uniform_block.hpp",
"include/mbgl/mtl/uniform_buffer.hpp",
"include/mbgl/mtl/upload_pass.hpp",
"include/mbgl/mtl/vertex_attribute.hpp",
Expand Down
114 changes: 0 additions & 114 deletions include/mbgl/gfx/uniform_block.hpp

This file was deleted.

21 changes: 5 additions & 16 deletions include/mbgl/gfx/uniform_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,8 @@ class UniformBuffer {
return *this;
}

public:
bool getBindVertex() const { return bindVertex; }
void setBindVertex(bool value) { bindVertex = value; }

bool getBindFragment() const { return bindFragment; }
void setBindFragment(bool value) { bindFragment = value; }

protected:
std::size_t size;
bool bindVertex = false;
bool bindFragment = false;
};

/// Stores a collection of uniform buffers by id
Expand All @@ -72,20 +63,18 @@ class UniformBufferArray {

/// Set a new uniform buffer element or replace the existing one.
virtual const std::shared_ptr<UniformBuffer>& set(const size_t id,
std::shared_ptr<UniformBuffer> uniformBuffer,
bool bindVertex,
bool bindFragment);
std::shared_ptr<UniformBuffer> uniformBuffer);

/// Create and add a new buffer or update an existing one
void createOrUpdate(
const size_t id, const std::vector<uint8_t>& data, gfx::Context&, bool bindVertex, bool bindFragment);
const size_t id, const std::vector<uint8_t>& data, gfx::Context&, bool persistent = false);
virtual void createOrUpdate(
const size_t id, const void* data, std::size_t size, gfx::Context&, bool bindVertex, bool bindFragment);
const size_t id, const void* data, std::size_t size, gfx::Context&, bool persistent = false);
template <typename T>
void createOrUpdate(const size_t id, const T* data, gfx::Context& context, bool bindVertex, bool bindFragment)
void createOrUpdate(const size_t id, const T* data, gfx::Context& context, bool persistent = false)
requires(!std::is_pointer_v<T>)
{
createOrUpdate(id, data, sizeof(T), context, bindVertex, bindFragment);
createOrUpdate(id, data, sizeof(T), context, persistent);
}

UniformBufferArray& operator=(UniformBufferArray&&);
Expand Down
49 changes: 0 additions & 49 deletions include/mbgl/gl/uniform_block_gl.hpp

This file was deleted.

59 changes: 0 additions & 59 deletions include/mbgl/mtl/uniform_block.hpp

This file was deleted.

Loading

0 comments on commit e3c2a15

Please sign in to comment.