From ca733d398d1a80924d8328214fe740d20d6f867f Mon Sep 17 00:00:00 2001 From: Harrand Date: Fri, 20 Jan 2023 01:20:46 +0000 Subject: [PATCH] * More lowercasing of some stuff I had missed earlier --- demo/core/engine_info_demo.cpp | 2 +- demo/gl/vk2/vk2_triangle_demo_large.cpp | 4 +-- demo/gl/vk2/vk2_triangle_demo_medium.cpp | 4 +-- src/tz/core/data/basic_list.hpp | 18 +++++----- src/tz/core/data/enum_field.hpp | 20 +++++------ src/tz/core/data/enum_field.inl | 36 +++++++++---------- src/tz/core/data/grid_view.hpp | 8 ++--- src/tz/core/data/grid_view.inl | 20 +++++------ src/tz/core/data/polymorphic_list.hpp | 2 +- src/tz/gl/api/renderer.hpp | 2 +- src/tz/gl/api/resource.hpp | 2 +- src/tz/gl/impl/opengl/detail/framebuffer.hpp | 2 +- src/tz/gl/impl/opengl/detail/shader.hpp | 2 +- src/tz/gl/impl/opengl/detail/tz_opengl.cpp | 6 ++-- src/tz/gl/impl/opengl/renderer.cpp | 4 +-- src/tz/gl/impl/vulkan/detail/buffer.hpp | 2 +- src/tz/gl/impl/vulkan/detail/command.cpp | 2 +- src/tz/gl/impl/vulkan/detail/command.hpp | 10 +++--- src/tz/gl/impl/vulkan/detail/descriptors.hpp | 10 +++--- src/tz/gl/impl/vulkan/detail/extensions.hpp | 6 ++-- src/tz/gl/impl/vulkan/detail/features.hpp | 2 +- .../gl/impl/vulkan/detail/fixed_function.hpp | 12 +++---- src/tz/gl/impl/vulkan/detail/framebuffer.cpp | 6 ++-- src/tz/gl/impl/vulkan/detail/framebuffer.hpp | 6 ++-- .../detail/hardware/physical_device.cpp | 10 +++--- .../detail/hardware/physical_device.hpp | 12 +++---- .../gl/impl/vulkan/detail/hardware/queue.hpp | 8 ++--- src/tz/gl/impl/vulkan/detail/image.hpp | 4 +-- .../gl/impl/vulkan/detail/logical_device.hpp | 8 ++--- src/tz/gl/impl/vulkan/detail/render_pass.hpp | 10 +++--- src/tz/gl/impl/vulkan/detail/shader.hpp | 6 ++-- src/tz/gl/impl/vulkan/renderer.cpp | 16 ++++----- src/tz/gl/impl/vulkan/renderer.hpp | 4 +-- src/tz/gl/output.hpp | 2 +- src/tz/tz.hpp | 2 +- 35 files changed, 135 insertions(+), 135 deletions(-) diff --git a/demo/core/engine_info_demo.cpp b/demo/core/engine_info_demo.cpp index 864b39f50d..82c64a09ab 100644 --- a/demo/core/engine_info_demo.cpp +++ b/demo/core/engine_info_demo.cpp @@ -4,6 +4,6 @@ int main() { - constexpr tz::EngineInfo info = tz::info(); + constexpr tz::engine_info info = tz::info(); tz::report("Engine Info: %s", info.to_string().c_str()); } \ No newline at end of file diff --git a/demo/gl/vk2/vk2_triangle_demo_large.cpp b/demo/gl/vk2/vk2_triangle_demo_large.cpp index 0c775e7a53..e8932f5a32 100644 --- a/demo/gl/vk2/vk2_triangle_demo_large.cpp +++ b/demo/gl/vk2/vk2_triangle_demo_large.cpp @@ -187,7 +187,7 @@ int main() }, .logical_device = &ldev, }}; - tz::BasicList alloc_layout_list; + tz::basic_list alloc_layout_list; for(std::size_t i = 0; i < swapchain.get_images().size(); i++) { alloc_layout_list.add(&dlayout); @@ -325,7 +325,7 @@ int main() .pipeline = &graphics_pipeline, .pipeline_context = PipelineContext::graphics }); - tz::BasicList sets; + tz::basic_list sets; sets.resize(dpool_alloc.sets.length()); std::transform(dpool_alloc.sets.begin(), dpool_alloc.sets.end(), sets.begin(), [](const DescriptorSet& set){return &set;}); diff --git a/demo/gl/vk2/vk2_triangle_demo_medium.cpp b/demo/gl/vk2/vk2_triangle_demo_medium.cpp index bddbc531aa..ee501dfba6 100644 --- a/demo/gl/vk2/vk2_triangle_demo_medium.cpp +++ b/demo/gl/vk2/vk2_triangle_demo_medium.cpp @@ -170,7 +170,7 @@ int main() }, .logical_device = &ldev, }}; - tz::BasicList alloc_layout_list; + tz::basic_list alloc_layout_list; for(std::size_t i = 0; i < swapchain.get_images().size(); i++) { alloc_layout_list.add(&dlayout); @@ -302,7 +302,7 @@ int main() .pipeline = &graphics_pipeline, .pipeline_context = PipelineContext::graphics }); - tz::BasicList sets; + tz::basic_list sets; sets.resize(dpool_alloc.sets.length()); std::transform(dpool_alloc.sets.begin(), dpool_alloc.sets.end(), sets.begin(), [](const DescriptorSet& set){return &set;}); diff --git a/src/tz/core/data/basic_list.hpp b/src/tz/core/data/basic_list.hpp index 527410ad25..e9cb987e2f 100644 --- a/src/tz/core/data/basic_list.hpp +++ b/src/tz/core/data/basic_list.hpp @@ -17,7 +17,7 @@ namespace tz * @tparam Allocator Allocator type. */ template> - class BasicList + class basic_list { private: using UnderlyingList = std::vector; @@ -27,14 +27,14 @@ namespace tz using ConstIterator = typename UnderlyingList::const_iterator; /** - * Construct a BasicList using existing elements via copy. + * Construct a basic_list using existing elements via copy. */ - BasicList(std::initializer_list elements): + basic_list(std::initializer_list elements): elements(elements){} /** - * Construct an empty BasicList. + * Construct an empty basic_list. */ - BasicList() = default; + basic_list() = default; /** * Retrieve a span over the entire list. @@ -113,7 +113,7 @@ namespace tz * Copy the elements of another list to the end of this list. * @param other Second list whose elements should be appended to the end of this list. */ - void append(const BasicList& other) + void append(const basic_list& other) { this->elements.insert(this->elements.end(), other.elements.begin(), other.elements.end()); } @@ -210,7 +210,7 @@ namespace tz */ const T& operator[](std::size_t index) const { - tz::assert(this->length() > index, "tz::BasicList::operator[%zu]: Out of range (length = %zu)", index, this->length()); + tz::assert(this->length() > index, "tz::basic_list::operator[%zu]: Out of range (length = %zu)", index, this->length()); return this->elements[index]; } @@ -222,11 +222,11 @@ namespace tz */ T& operator[](std::size_t index) { - tz::assert(this->length() > index, "tz::BasicList::operator[%zu]: Out of range (length = %zu)", index, this->length()); + tz::assert(this->length() > index, "tz::basic_list::operator[%zu]: Out of range (length = %zu)", index, this->length()); return this->elements[index]; } - auto operator<=>(const tz::BasicList& rhs) const = default; + auto operator<=>(const tz::basic_list& rhs) const = default; /** * Erase the element at the given position. diff --git a/src/tz/core/data/enum_field.hpp b/src/tz/core/data/enum_field.hpp index 7634fe49f5..e5cf237b44 100644 --- a/src/tz/core/data/enum_field.hpp +++ b/src/tz/core/data/enum_field.hpp @@ -12,22 +12,22 @@ namespace tz * @tparam E Enum class type. */ template - class EnumField + class enum_field { public: /** * Create an empty field. */ - constexpr EnumField() = default; + constexpr enum_field() = default; /** * Create a field from the provided values. */ - constexpr EnumField(std::initializer_list types); + constexpr enum_field(std::initializer_list types); /** * Create a field from a single value. */ - constexpr EnumField(E type); - constexpr ~EnumField() = default; + constexpr enum_field(E type); + constexpr ~enum_field() = default; /** * Query as to whether the field contains the given value. * @note The value is only contained if the exact value was inserted into the field, not if the field contains elements forming a bitwise equivalent. @@ -41,7 +41,7 @@ namespace tz * Query as to whether the field contains each element within another field. * @return True if for each element `x` in the parameter field, `this->contains(x)`, otherwise false. */ - bool contains(const EnumField& field) const; + bool contains(const enum_field& field) const; /** * Retrieve the number of elements within the field. * @return number of elements within the field. @@ -57,17 +57,17 @@ namespace tz * @param type Element to add to the field. * @return This. */ - EnumField& operator|=(E type); + enum_field& operator|=(E type); /** * Add a field to another field. If this field contains 'C' and other field is comprised of 'A | B', this field will become 'C | A | B'. */ - EnumField& operator|=(const EnumField& field); + enum_field& operator|=(const enum_field& field); /** * Create a copy of this field, but with the parameter element added. The cumulative value `C` of the field becomes `C | E`. * @param type Element to add to the new field. * @return A copy of this. */ - EnumField operator|(E type) const; + enum_field operator|(E type) const; /** * Remove the enum value from the field, if it exists. */ @@ -104,7 +104,7 @@ namespace tz * Query as to whether the elements of the field exactly match that of another field. This may return false even if the cumulative values are equivalent. * @return True if fields contain same elements, otherwise false. */ - bool operator==(const EnumField& rhs) const = default; + bool operator==(const enum_field& rhs) const = default; /** * Retrieve the cumulative value of the field. */ diff --git a/src/tz/core/data/enum_field.inl b/src/tz/core/data/enum_field.inl index 8533ce9f03..6a4d777439 100644 --- a/src/tz/core/data/enum_field.inl +++ b/src/tz/core/data/enum_field.inl @@ -3,23 +3,23 @@ namespace tz { template - constexpr EnumField::EnumField(E type): + constexpr enum_field::enum_field(E type): elements(type) {} template - constexpr EnumField::EnumField(std::initializer_list types): + constexpr enum_field::enum_field(std::initializer_list types): elements(types) {} template - bool EnumField::contains(E type) const + bool enum_field::contains(E type) const { return std::find(this->elements.begin(), this->elements.end(), type) != this->elements.end(); } template - bool EnumField::contains(const EnumField& field) const + bool enum_field::contains(const enum_field& field) const { for(E type : field.elements) { @@ -32,19 +32,19 @@ namespace tz } template - std::size_t EnumField::count() const + std::size_t enum_field::count() const { return this->elements.size(); } template - bool EnumField::empty() const + bool enum_field::empty() const { return this->count() == 0; } template - EnumField& EnumField::operator|=(E type) + enum_field& enum_field::operator|=(E type) { { this->elements.push_back(type); @@ -53,7 +53,7 @@ namespace tz } template - EnumField& EnumField::operator|=(const EnumField& field) + enum_field& enum_field::operator|=(const enum_field& field) { for(E val : field) { @@ -63,56 +63,56 @@ namespace tz } template - EnumField EnumField::operator|(E type) const + enum_field enum_field::operator|(E type) const { - EnumField cpy = *this; + enum_field cpy = *this; return cpy |= type; } template - void EnumField::remove(E type) + void enum_field::remove(E type) { this->elements.erase(std::remove(this->elements.begin(), this->elements.end(), type), this->elements.end()); } template - auto EnumField::begin() const + auto enum_field::begin() const { return this->elements.begin(); } template - auto EnumField::begin() + auto enum_field::begin() { return this->elements.begin(); } template - auto EnumField::end() const + auto enum_field::end() const { return this->elements.end(); } template - auto EnumField::end() + auto enum_field::end() { return this->elements.end(); } template - const E& EnumField::front() const + const E& enum_field::front() const { return this->elements.front(); } template - const E& EnumField::back() const + const E& enum_field::back() const { return this->elements.back(); } template - EnumField::operator E() const + enum_field::operator E() const { using UnderlyingType = std::underlying_type_t; if(this->elements.empty()) diff --git a/src/tz/core/data/grid_view.hpp b/src/tz/core/data/grid_view.hpp index 39b5290099..09c07ec656 100644 --- a/src/tz/core/data/grid_view.hpp +++ b/src/tz/core/data/grid_view.hpp @@ -10,12 +10,12 @@ namespace tz * @ingroup tz_core_data * A view into an array representing a flattened grid of data. * - * Elements are interpreted as a tightly-packed array of rows. Each element is expected to be equivalent to a T[N]. For example, GridView on an RGBA32 image might be a `GridView`. + * Elements are interpreted as a tightly-packed array of rows. Each element is expected to be equivalent to a T[N]. For example, grid_view on an RGBA32 image might be a `grid_view`. * @tparam T Underlying type of the element. * @tparam N number of T's per element. Default 1. */ template - class GridView + class grid_view { public: /** @@ -23,13 +23,13 @@ namespace tz * @param data View over grid data. * @param dimensions {x, y} where x is number of columns, and y is number of rows. */ - GridView(std::span data, tz::vec2ui dimensions); + grid_view(std::span data, tz::vec2ui dimensions); /** * Create a view over an existing array of square grid data. * @param data View over grid data. * @param length Represents the number of columns and rows. */ - GridView(std::span data, unsigned int length); + grid_view(std::span data, unsigned int length); /** * Retrieve the dimensions of the grid, in elements. * @return {width, height}. diff --git a/src/tz/core/data/grid_view.inl b/src/tz/core/data/grid_view.inl index a0ff7d80df..abf88f7604 100644 --- a/src/tz/core/data/grid_view.inl +++ b/src/tz/core/data/grid_view.inl @@ -3,44 +3,44 @@ namespace tz { template - GridView::GridView(std::span data, tz::vec2ui dimensions): + grid_view::grid_view(std::span data, tz::vec2ui dimensions): data(data), dimensions(dimensions) { if(this->data.size_bytes() < (this->dimensions[0] * this->dimensions[1] * sizeof(T) * N)) { - tz::report("GridView passed a span of unexpected size. View is %ux%u where each element is %zu bytes, for a expected buffer size of %zu, but buffer provided has %zu bytes.", this->dimensions[0], this->dimensions[1], sizeof(T) * N, (this->dimensions[0] * this->dimensions[1] * sizeof(T) * N), this->data.size_bytes()); + tz::report("grid_view passed a span of unexpected size. View is %ux%u where each element is %zu bytes, for a expected buffer size of %zu, but buffer provided has %zu bytes.", this->dimensions[0], this->dimensions[1], sizeof(T) * N, (this->dimensions[0] * this->dimensions[1] * sizeof(T) * N), this->data.size_bytes()); } } template - GridView::GridView(std::span data, unsigned int length): - GridView(data, {length, length}){} + grid_view::grid_view(std::span data, unsigned int length): + grid_view(data, {length, length}){} template - tz::vec2ui GridView::get_dimensions() const + tz::vec2ui grid_view::get_dimensions() const { return this->dimensions; } template - std::span GridView::span() + std::span grid_view::span() { return this->data; } template - std::span GridView::span() const + std::span grid_view::span() const { return this->data; } template - std::conditional_t> GridView::operator()(unsigned int x, unsigned int y) + std::conditional_t> grid_view::operator()(unsigned int x, unsigned int y) { std::size_t idx = ((y * this->dimensions[0]) + x) * N; - tz::assert(x < this->dimensions[0] && y < this->dimensions[1], "GridView access out of bounds. Dimensions = {%u, %u} must be > {%u, %u} which was requested", this->dimensions[0], this->dimensions[1], x, y); - tz::assert(idx < this->data.size(), "GridView access out of bounds. About to invoke UB."); + tz::assert(x < this->dimensions[0] && y < this->dimensions[1], "grid_view access out of bounds. Dimensions = {%u, %u} must be > {%u, %u} which was requested", this->dimensions[0], this->dimensions[1], x, y); + tz::assert(idx < this->data.size(), "grid_view access out of bounds. About to invoke UB."); if constexpr(N == 1) { return this->data[idx]; diff --git a/src/tz/core/data/polymorphic_list.hpp b/src/tz/core/data/polymorphic_list.hpp index 2e0859e401..4cf9572533 100644 --- a/src/tz/core/data/polymorphic_list.hpp +++ b/src/tz/core/data/polymorphic_list.hpp @@ -71,7 +71,7 @@ namespace tz private: using SmartPointer = std::unique_ptr; using SmartPointerConst = std::unique_ptr; - BasicList elements; + basic_list elements; }; template diff --git a/src/tz/gl/api/renderer.hpp b/src/tz/gl/api/renderer.hpp index 1c291d3b40..c76f38da9a 100644 --- a/src/tz/gl/api/renderer.hpp +++ b/src/tz/gl/api/renderer.hpp @@ -85,7 +85,7 @@ namespace tz::gl * @ingroup tz_gl2_renderer * Represents a collection of renderer options. */ - using renderer_options = tz::EnumField; + using renderer_options = tz::enum_field; template concept renderer_info_type = requires(T t, renderer_handle ren, resource_handle r, const iresource& resource, icomponent* component, ioutput& output, renderer_options options, tz::vec4 vec4, tz::vec3ui vec3ui, std::string str) diff --git a/src/tz/gl/api/resource.hpp b/src/tz/gl/api/resource.hpp index dec9697439..559a2b157d 100644 --- a/src/tz/gl/api/resource.hpp +++ b/src/tz/gl/api/resource.hpp @@ -51,7 +51,7 @@ namespace tz::gl Count }; - using resource_flags = tz::EnumField; + using resource_flags = tz::enum_field; /** * @ingroup tz_gl2_res diff --git a/src/tz/gl/impl/opengl/detail/framebuffer.hpp b/src/tz/gl/impl/opengl/detail/framebuffer.hpp index 21bd0d07cf..e668c70ddf 100644 --- a/src/tz/gl/impl/opengl/detail/framebuffer.hpp +++ b/src/tz/gl/impl/opengl/detail/framebuffer.hpp @@ -26,7 +26,7 @@ namespace tz::gl::ogl2 /// Depth attachment, if one exists. Default nullopt. std::optional maybe_depth_attachment = std::nullopt; /// List of colour attachments in-order. Default empty. - tz::BasicList colour_attachments = {}; + tz::basic_list colour_attachments = {}; }; /** diff --git a/src/tz/gl/impl/opengl/detail/shader.hpp b/src/tz/gl/impl/opengl/detail/shader.hpp index 9faa14e35c..acf8e204bf 100644 --- a/src/tz/gl/impl/opengl/detail/shader.hpp +++ b/src/tz/gl/impl/opengl/detail/shader.hpp @@ -43,7 +43,7 @@ namespace tz::gl::ogl2 struct ShaderInfo { /// List of all modules. - tz::BasicList modules; + tz::basic_list modules; }; /** diff --git a/src/tz/gl/impl/opengl/detail/tz_opengl.cpp b/src/tz/gl/impl/opengl/detail/tz_opengl.cpp index cbf11da225..ea2011b888 100644 --- a/src/tz/gl/impl/opengl/detail/tz_opengl.cpp +++ b/src/tz/gl/impl/opengl/detail/tz_opengl.cpp @@ -7,7 +7,7 @@ namespace tz::gl::ogl2 { - tz::BasicList get_supported_ogl_extensions(); + tz::basic_list get_supported_ogl_extensions(); bool initialised = false; @@ -52,11 +52,11 @@ namespace tz::gl::ogl2 return initialised; } - tz::BasicList get_supported_ogl_extensions() + tz::basic_list get_supported_ogl_extensions() { GLint extension_count; glGetIntegerv(GL_NUM_EXTENSIONS, &extension_count); - tz::BasicList exts; + tz::basic_list exts; exts.resize(extension_count); for(std::size_t i = 0; std::cmp_less(i, extension_count); i++) { diff --git a/src/tz/gl/impl/opengl/renderer.cpp b/src/tz/gl/impl/opengl/renderer.cpp index 5d4a4338bf..d7f353a6c4 100644 --- a/src/tz/gl/impl/opengl/renderer.cpp +++ b/src/tz/gl/impl/opengl/renderer.cpp @@ -311,7 +311,7 @@ namespace tz::gl ogl2::Shader ShaderManager::make_shader(const ShaderInfo& sinfo) const { - tz::BasicList modules; + tz::basic_list modules; if(sinfo.has_shader(shader_stage::compute)) { // Compute, we only care about the compute shader. @@ -378,7 +378,7 @@ namespace tz::gl { auto* out = static_cast(this->output.get()); tz::assert(!out->has_depth_attachment(), "image_output with depth attachment is not yet implemented."); - tz::BasicList colour_attachments; + tz::basic_list colour_attachments; colour_attachments.resize(out->colour_attachment_count()); for(std::size_t i = 0; i < colour_attachments.length(); i++) { diff --git a/src/tz/gl/impl/vulkan/detail/buffer.hpp b/src/tz/gl/impl/vulkan/detail/buffer.hpp index 59832d27dc..ec6acde09c 100644 --- a/src/tz/gl/impl/vulkan/detail/buffer.hpp +++ b/src/tz/gl/impl/vulkan/detail/buffer.hpp @@ -30,7 +30,7 @@ namespace tz::gl::vk2 index_buffer = VK_BUFFER_USAGE_INDEX_BUFFER_BIT }; - using BufferUsageField = tz::EnumField; + using BufferUsageField = tz::enum_field; /** * @ingroup tz_gl_vk_buffer diff --git a/src/tz/gl/impl/vulkan/detail/command.cpp b/src/tz/gl/impl/vulkan/detail/command.cpp index d1b55c45b7..f4485a684f 100644 --- a/src/tz/gl/impl/vulkan/detail/command.cpp +++ b/src/tz/gl/impl/vulkan/detail/command.cpp @@ -396,7 +396,7 @@ namespace tz::gl::vk2 return arg.framebuffer->get_pass().get_info().attachments[attachment_idx].final_layout; }; // We end a framebuffer, which has some number of attachments. Firstly we check if any of them are this image. If it is, we query the render pass to find out what the layout was meant to be. - const tz::BasicList& framebuffer_attachments = arg.framebuffer->get_attachment_views(); + const tz::basic_list& framebuffer_attachments = arg.framebuffer->get_attachment_views(); auto iter = std::find_if(framebuffer_attachments.begin(), framebuffer_attachments.end(), [&image](ImageView* const & view_ptr)->bool { diff --git a/src/tz/gl/impl/vulkan/detail/command.hpp b/src/tz/gl/impl/vulkan/detail/command.hpp index 2556068245..1375ae1a53 100644 --- a/src/tz/gl/impl/vulkan/detail/command.hpp +++ b/src/tz/gl/impl/vulkan/detail/command.hpp @@ -104,7 +104,7 @@ namespace tz::gl::vk2 /// Pipeline bind point. PipelineContext context; /// List of DescriptorSet to bind. - const tz::BasicList descriptor_sets; + const tz::basic_list descriptor_sets; /// The operation causes the sets [first_set_id, first_set_id + descriptor_sets.length() + 1] to refer to the DescriptorSets within `descriptor_sets`. std::uint32_t first_set_id; }; @@ -210,9 +210,9 @@ namespace tz::gl::vk2 ImageAspectFlags image_aspects; /// List of affected mip levels. Must be in ascending-order and with no gaps. E.g {0, 1, 2} is fine, {0, 2, 3} is not and neither is {0, 2, 1}. Default is {0}. - tz::BasicList affected_mip_levels = {0u}; + tz::basic_list affected_mip_levels = {0u}; /// List of affected array layers. Must be in ascending-order and with no gaps. E.g {0, 1, 2} is fine, {0, 2, 3} is not and neither is {0, 2, 1}. Default is {0}. - tz::BasicList affected_layers = {0u}; + tz::basic_list affected_layers = {0u}; }; struct SetScissorDynamic @@ -237,7 +237,7 @@ namespace tz::gl::vk2 { Reusable = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT }; - using CommandPoolFlags = tz::EnumField; + using CommandPoolFlags = tz::enum_field; /** * @ingroup tz_gl_vk_commands * Specifies creation flags for a @ref CommandPool. @@ -451,7 +451,7 @@ namespace tz::gl::vk2 }; /// List of newly-allocated buffers. - tz::BasicList buffers; + tz::basic_list buffers; /// Result description for this specific allocation. AllocationResultType type; }; diff --git a/src/tz/gl/impl/vulkan/detail/descriptors.hpp b/src/tz/gl/impl/vulkan/detail/descriptors.hpp index 52227d5a4c..5abb4be005 100644 --- a/src/tz/gl/impl/vulkan/detail/descriptors.hpp +++ b/src/tz/gl/impl/vulkan/detail/descriptors.hpp @@ -46,7 +46,7 @@ namespace tz::gl::vk2 VariableCount = VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT }; - using DescriptorFlags = tz::EnumField; + using DescriptorFlags = tz::enum_field; /** * @ingroup tz_gl_vk_descriptors @@ -73,7 +73,7 @@ namespace tz::gl::vk2 DescriptorFlags flags; }; /// List of all descriptor bindings in the layout. - tz::BasicList bindings; + tz::basic_list bindings; /// LogicalDevice which will be creating the resultant @ref DescriptorLayout. This must not be null or a null LogicalDevice. const LogicalDevice* logical_device; }; @@ -263,7 +263,7 @@ namespace tz::gl::vk2 /// List of writes to the descriptor array std::vector write_infos; }; - using WriteList = tz::BasicList; + using WriteList = tz::basic_list; /** * Request structure representing zero or more descriptor changes for this set. @@ -342,7 +342,7 @@ namespace tz::gl::vk2 struct Allocation { /// List of layouts for each set. When an allocation is performed, a list of DescriptorSets is returned. The list has size matching `set_layouts.length()` and the i'th element of the list will have layout matching `set_layouts[i]`. - tz::BasicList set_layouts; + tz::basic_list set_layouts; }; /// Specifies information about the resultant of an invocation to @ref DescriptorPool::allocate_sets @@ -365,7 +365,7 @@ namespace tz::gl::vk2 }; /// List of allocated sets. If `type` == `AllocationResultType::Success`, this contains a list of valid DescriptorSets which can now be used. - tz::BasicList sets; + tz::basic_list sets; /// Describes how the allocation went. Allocations can fail. AllocationResultType type; }; diff --git a/src/tz/gl/impl/vulkan/detail/extensions.hpp b/src/tz/gl/impl/vulkan/detail/extensions.hpp index 817f07aee2..72362b0b07 100644 --- a/src/tz/gl/impl/vulkan/detail/extensions.hpp +++ b/src/tz/gl/impl/vulkan/detail/extensions.hpp @@ -36,8 +36,8 @@ namespace tz::gl::vk2 Count }; - using InstanceExtensionList = tz::EnumField; - using DeviceExtensionList = tz::EnumField; + using InstanceExtensionList = tz::enum_field; + using DeviceExtensionList = tz::enum_field; /** * @} @@ -84,7 +84,7 @@ namespace tz::gl::vk2 return DeviceExtension::Count; } - using VkExtensionList = tz::BasicList; + using VkExtensionList = tz::basic_list; } } diff --git a/src/tz/gl/impl/vulkan/detail/features.hpp b/src/tz/gl/impl/vulkan/detail/features.hpp index 76e346040e..3d531727de 100644 --- a/src/tz/gl/impl/vulkan/detail/features.hpp +++ b/src/tz/gl/impl/vulkan/detail/features.hpp @@ -33,7 +33,7 @@ namespace tz::gl::vk2 FragmentShaderResourceWrite }; - using DeviceFeatureField = tz::EnumField; + using DeviceFeatureField = tz::enum_field; namespace detail { diff --git a/src/tz/gl/impl/vulkan/detail/fixed_function.hpp b/src/tz/gl/impl/vulkan/detail/fixed_function.hpp index ecd78f5751..f5a9fa12f7 100644 --- a/src/tz/gl/impl/vulkan/detail/fixed_function.hpp +++ b/src/tz/gl/impl/vulkan/detail/fixed_function.hpp @@ -74,8 +74,8 @@ namespace tz::gl::vk2 std::uint32_t element_offset; }; - tz::BasicList bindings = {}; - tz::BasicList attributes = {}; + tz::basic_list bindings = {}; + tz::basic_list attributes = {}; }; /** @@ -86,8 +86,8 @@ namespace tz::gl::vk2 */ struct ViewportState { - tz::BasicList viewports; - tz::BasicList scissors; + tz::basic_list viewports; + tz::basic_list scissors; using NativeType = VkPipelineViewportStateCreateInfo; NativeType native() const; @@ -215,7 +215,7 @@ namespace tz::gl::vk2 static AttachmentState no_blending(); static AttachmentState alpha_blending(); - tz::BasicList attachment_states = {no_blending()}; + tz::basic_list attachment_states = {no_blending()}; std::optional logical_operator = std::nullopt; tz::vec4 blend_constants = tz::vec4{0.0f, 0.0f, 0.0f, 0.0f}; @@ -229,7 +229,7 @@ namespace tz::gl::vk2 Scissor = VK_DYNAMIC_STATE_SCISSOR }; - using DynamicStateTypes = tz::EnumField; + using DynamicStateTypes = tz::enum_field; /** * @ingroup tz_gl_vk_graphics_pipeline_fixed diff --git a/src/tz/gl/impl/vulkan/detail/framebuffer.cpp b/src/tz/gl/impl/vulkan/detail/framebuffer.cpp index 9b974816e6..ef975b801f 100644 --- a/src/tz/gl/impl/vulkan/detail/framebuffer.cpp +++ b/src/tz/gl/impl/vulkan/detail/framebuffer.cpp @@ -97,15 +97,15 @@ namespace tz::gl::vk2 return this->get_pass().get_device(); } - tz::BasicList Framebuffer::get_attachment_views() const + tz::basic_list Framebuffer::get_attachment_views() const { - tz::BasicList views_const; + tz::basic_list views_const; views_const.resize(this->info.attachments.length()); std::transform(this->info.attachments.begin(), this->info.attachments.end(), views_const.begin(), [](ImageView* view){return view;}); return views_const; } - tz::BasicList Framebuffer::get_attachment_views() + tz::basic_list Framebuffer::get_attachment_views() { return this->info.attachments; } diff --git a/src/tz/gl/impl/vulkan/detail/framebuffer.hpp b/src/tz/gl/impl/vulkan/detail/framebuffer.hpp index 6d2483d607..21709aa060 100644 --- a/src/tz/gl/impl/vulkan/detail/framebuffer.hpp +++ b/src/tz/gl/impl/vulkan/detail/framebuffer.hpp @@ -19,7 +19,7 @@ namespace tz::gl::vk2 /// RenderPass that will target the frame buffer. const RenderPass* render_pass; /// List of output attachments from the RenderPass. - tz::BasicList attachments; + tz::basic_list attachments; /// Dimensions of the frame buffer. tz::vector dimensions; }; @@ -58,12 +58,12 @@ namespace tz::gl::vk2 * Retrieve a list of imageviews corresponding to each attachment. * @return List of ImageViews. The i'th @ref ImageView corresponds to the i'th output attachment from the @ref RenderPass referenced by `this->get_pass()`. */ - tz::BasicList get_attachment_views() const; + tz::basic_list get_attachment_views() const; /** * Retrieve a list of imageviews corresponding to each attachment. * @return List of ImageViews. The i'th @ref ImageView corresponds to the i'th output attachment from the @ref RenderPass referenced by `this->get_pass()`. */ - tz::BasicList get_attachment_views(); + tz::basic_list get_attachment_views(); void set_render_pass(RenderPass& render_pass); using NativeType = VkFramebuffer; diff --git a/src/tz/gl/impl/vulkan/detail/hardware/physical_device.cpp b/src/tz/gl/impl/vulkan/detail/hardware/physical_device.cpp index 36baf4686b..8d19cfcf42 100644 --- a/src/tz/gl/impl/vulkan/detail/hardware/physical_device.cpp +++ b/src/tz/gl/impl/vulkan/detail/hardware/physical_device.cpp @@ -207,14 +207,14 @@ namespace tz::gl::vk2 return ret; } - tz::BasicList PhysicalDevice::get_supported_surface_formats() const + tz::basic_list PhysicalDevice::get_supported_surface_formats() const { tz::assert(!this->is_null(), "This was PhysicalDevice::null()"); tz::assert(this->instance != nullptr, "PhysicalDevice is not aware of its vulkan instance"); tz::assert(this->instance->has_surface(), "PhysicalDevice belongs to a VulkanInstance that does not have a WindowSurface attached. Please submit a bug report"); const WindowSurface& surface = this->instance->get_surface(); // We can assume that this->instance == surface.get->instance() meaning that the VulkanInstance supports the "VK_KHR_surface" util::VkExtension which is what we need for vkGetPhysicalDeviceSurfaceFormatsKHR. For this reason we don't check for the extensions availability and assume everything is ok. - tz::BasicList fmts; + tz::basic_list fmts; std::vector surf_fmts; std::uint32_t num_supported_formats; @@ -229,15 +229,15 @@ namespace tz::gl::vk2 return fmts; } - tz::BasicList PhysicalDevice::get_supported_surface_present_modes() const + tz::basic_list PhysicalDevice::get_supported_surface_present_modes() const { tz::assert(!this->is_null(), "This was PhysicalDevice::null()"); tz::assert(this->instance != nullptr, "PhysicalDevice is not aware of its vulkan instance"); tz::assert(this->instance->has_surface(), "PhysicalDevice belongs to a VulkanInstance that does not have a WindowSurface attached. Please submit a bug report"); const WindowSurface& surface = this->instance->get_surface(); // We can assume that this->instance == surface.get->instance() meaning that the VulkanInstance supports the "VK_KHR_surface" util::VkExtension which is what we need for vkGetPhysicalDeviceSurfaceFormatsKHR. For this reason we don't check for the extensions availability and assume everything is ok. - tz::BasicList presents; - tz::BasicList present_natives; + tz::basic_list presents; + tz::basic_list present_natives; std::uint32_t present_mode_count = 0; vkGetPhysicalDeviceSurfacePresentModesKHR(this->dev, surface.native(), &present_mode_count, nullptr); diff --git a/src/tz/gl/impl/vulkan/detail/hardware/physical_device.hpp b/src/tz/gl/impl/vulkan/detail/hardware/physical_device.hpp index de3c15beba..9bba2df5a3 100644 --- a/src/tz/gl/impl/vulkan/detail/hardware/physical_device.hpp +++ b/src/tz/gl/impl/vulkan/detail/hardware/physical_device.hpp @@ -89,12 +89,12 @@ namespace tz::gl::vk2 PhysicalDevice(VkPhysicalDevice native, const VulkanInstance& instance); /** * @brief PhysicalDevices do not necessarily support all available DeviceFeatures. - * @return An EnumField containing all the features supported by this Physical device. + * @return An enum_field containing all the features supported by this Physical device. */ DeviceFeatureField get_supported_features() const; /** * @brief PhysicalDevices support various extensions, but not necessarily all of them. - * @return An EnumField containing all the extensions supported by this PhysicalDevice. + * @return An enum_field containing all the extensions supported by this PhysicalDevice. */ DeviceExtensionList get_supported_extensions() const; /** @@ -106,13 +106,13 @@ namespace tz::gl::vk2 * Retrieve a list of all image_formats that could represent the given window surface. * @return List of acceptable image_formats for a window surface. */ - tz::BasicList get_supported_surface_formats() const; + tz::basic_list get_supported_surface_formats() const; /** * Retrieve a list of all SurfacePresentModes that could be used to present images to the @ref WindowSurface attached to the @ref VulkanInstance owning this device. * This is guaranteed to contain every element within @ref present_traits::get_mandatory_present_modes(). * @return List of acceptable SurfacePresentModes for a window surface. */ - tz::BasicList get_supported_surface_present_modes() const; + tz::basic_list get_supported_surface_present_modes() const; PhysicalDeviceSurfaceCapabilityInfo get_surface_capabilities() const; /** * Query as to whether the given image_format can be used as a framebuffer colour attachment and as an input attachment format. @@ -154,7 +154,7 @@ namespace tz::gl::vk2 const VulkanInstance* instance; }; - using PhysicalDeviceList = tz::BasicList; + using PhysicalDeviceList = tz::basic_list; /* * @ingroup tz_gl_vk @@ -164,7 +164,7 @@ namespace tz::gl::vk2 * @ingroup tz_gl_vk * @brief Retrieve a list of all physical devices available on the machine for the given @ref VulkanInstance. * If no VulkanInstance is provided, the global instance @ref vk2::get() will be used. - * @return BasicList of all PhysicalDevices. These have not been filtered in any way. + * @return basic_list of all PhysicalDevices. These have not been filtered in any way. */ PhysicalDeviceList get_all_devices(const VulkanInstance& instance); } diff --git a/src/tz/gl/impl/vulkan/detail/hardware/queue.hpp b/src/tz/gl/impl/vulkan/detail/hardware/queue.hpp index 8bcacd5d8c..d7ef33d1f6 100644 --- a/src/tz/gl/impl/vulkan/detail/hardware/queue.hpp +++ b/src/tz/gl/impl/vulkan/detail/hardware/queue.hpp @@ -83,11 +83,11 @@ namespace tz::gl::vk2 }; /// List of command buffers to submit. - tz::BasicList command_buffers; + tz::basic_list command_buffers; /// List of wait semaphores. Command buffers for this submission batch will not begin execution until these semaphores are signalled. Note that when the wait is complete, each semaphore will be automatically set to unsignalled again. - tz::BasicList waits; + tz::basic_list waits; /// List of signal semaphores. Once the command buffers associated with this submission have completed execution, these semaphores are signalled. - tz::BasicList signal_semaphores; + tz::basic_list signal_semaphores; /// Optional fence which is signalled once all command buffers have finished execution. If this is nullptr, there is no way to verify that the command buffers associated with this submission have completed. const Fence* execution_complete_fence; }; @@ -115,7 +115,7 @@ namespace tz::gl::vk2 struct PresentInfo { /// List of wait semaphores. The present request will not be issued until all of these semaphores are signalled. Note that once they are signalled, they are automatically set to unsignalled again. - tz::BasicList wait_semaphores; + tz::basic_list wait_semaphores; /// Pointer to a swapchain from which an image will be sourced. This must not be nullptr. const Swapchain* swapchain; /// Index to the swapchain's images which will be presented to the surface. The index must have value such that `swapchain_image_index < swapchain.get_image_views().size()` diff --git a/src/tz/gl/impl/vulkan/detail/image.hpp b/src/tz/gl/impl/vulkan/detail/image.hpp index 1abb867032..93add8b835 100644 --- a/src/tz/gl/impl/vulkan/detail/image.hpp +++ b/src/tz/gl/impl/vulkan/detail/image.hpp @@ -85,7 +85,7 @@ namespace tz::gl::vk2 InputAttachment = VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT }; - using ImageUsageField = tz::EnumField; + using ImageUsageField = tz::enum_field; /** * @ingroup tz_gl_vk_image @@ -98,7 +98,7 @@ namespace tz::gl::vk2 Stencil = VK_IMAGE_ASPECT_STENCIL_BIT }; - using ImageAspectFlags = tz::EnumField; + using ImageAspectFlags = tz::enum_field; ImageAspectFlags derive_aspect_from_format(image_format fmt); diff --git a/src/tz/gl/impl/vulkan/detail/logical_device.hpp b/src/tz/gl/impl/vulkan/detail/logical_device.hpp index 1ce4283bec..ccc50ef3bf 100644 --- a/src/tz/gl/impl/vulkan/detail/logical_device.hpp +++ b/src/tz/gl/impl/vulkan/detail/logical_device.hpp @@ -21,9 +21,9 @@ namespace tz::gl::vk2 }; /** - * An @ref EnumField of QueueFamilyType. Can wholly describe the usage of one of a PhysicalDevice's queue families. + * An @ref enum_field of QueueFamilyType. Can wholly describe the usage of one of a PhysicalDevice's queue families. */ - using QueueFamilyTypeField = tz::EnumField; + using QueueFamilyTypeField = tz::enum_field; struct QueueFamilyInfo { @@ -83,8 +83,8 @@ namespace tz::gl::vk2 bool operator==(const QueueData& rhs); }; - using List = tz::BasicList; - tz::BasicList hardware_queue_families; + using List = tz::basic_list; + tz::basic_list hardware_queue_families; }; /** diff --git a/src/tz/gl/impl/vulkan/detail/render_pass.hpp b/src/tz/gl/impl/vulkan/detail/render_pass.hpp index 12bd9e74cf..e8b4e635bd 100644 --- a/src/tz/gl/impl/vulkan/detail/render_pass.hpp +++ b/src/tz/gl/impl/vulkan/detail/render_pass.hpp @@ -90,7 +90,7 @@ namespace tz::gl::vk2 }; - using AccessFlagField = tz::EnumField; + using AccessFlagField = tz::enum_field; /** * @ingroup tz_gl_vk_graphics_pipeline_render_pass @@ -165,17 +165,17 @@ namespace tz::gl::vk2 /// Specifies how this subpass binds to the graphics pipeline. PipelineContext context = PipelineContext::graphics; /// List of all attachments which will be input attachments during this subpass. - tz::BasicList input_attachments; + tz::basic_list input_attachments; /// List of all attachments which will be colour attachments during this subpass. - tz::BasicList colour_attachments; + tz::basic_list colour_attachments; /// Optional reference to an attachment which will be the depth-stencil attachment during this subpass. std::optional depth_stencil_attachment = std::nullopt; }; /// List of all attachments. These attachments are referenced throughout the subpasses. - tz::BasicList attachments; + tz::basic_list attachments; /// List of all subpasses, in order. - tz::BasicList subpasses; + tz::basic_list subpasses; /// @ref LogicalDevice which will be used to create the @ref RenderPass. It must point to a valid device. const LogicalDevice* logical_device = nullptr; }; diff --git a/src/tz/gl/impl/vulkan/detail/shader.hpp b/src/tz/gl/impl/vulkan/detail/shader.hpp index 722dbf8203..ef0cf19dd2 100644 --- a/src/tz/gl/impl/vulkan/detail/shader.hpp +++ b/src/tz/gl/impl/vulkan/detail/shader.hpp @@ -20,7 +20,7 @@ namespace tz::gl::vk2 compute = VK_SHADER_STAGE_COMPUTE_BIT }; - using ShaderTypeField = tz::EnumField; + using ShaderTypeField = tz::enum_field; /** * @ingroup tz_gl_vk_graphics_pipeline_shader @@ -78,12 +78,12 @@ namespace tz::gl::vk2 /// LogicalDevice owner. Must not be null. const LogicalDevice* device; /// Information about the Shader's modules. Must be a valid combination of modules. - tz::BasicList modules; + tz::basic_list modules; }; struct ShaderPipelineData { - tz::BasicList create_infos; + tz::basic_list create_infos; }; /** diff --git a/src/tz/gl/impl/vulkan/renderer.cpp b/src/tz/gl/impl/vulkan/renderer.cpp index dc21805a92..7c0dca7c5f 100644 --- a/src/tz/gl/impl/vulkan/renderer.cpp +++ b/src/tz/gl/impl/vulkan/renderer.cpp @@ -233,7 +233,7 @@ namespace tz::gl .logical_device = &ldev }}; { - tz::BasicList alloc_layout_list; + tz::basic_list alloc_layout_list; for(std::size_t i = 0; i < this->frame_in_flight_count; i++) { alloc_layout_list.add(&this->descriptor_layout); @@ -735,7 +735,7 @@ namespace tz::gl for(std::size_t i = 0; i < this->output_imageviews.size(); i++) { tz::vec2ui dims = this->output_imageviews[i].colour_views.front().get_image().get_dimensions(); - tz::BasicList attachments; + tz::basic_list attachments; attachments.resize(this->output_imageviews[i].colour_views.length()); std::transform(this->output_imageviews[i].colour_views.begin(), this->output_imageviews[i].colour_views.end(), attachments.begin(), [](vk2::ImageView& colour_view) @@ -861,7 +861,7 @@ namespace tz::gl { TZ_PROFZONE("Vulkan Frontend - renderer_vulkan GraphicsPipelineManager (Shader Create)", 0xFFAAAA00); std::vector vtx_src, frg_src, tesscon_src, tesseval_src, cmp_src; - tz::BasicList modules; + tz::basic_list modules; if(sinfo.has_shader(shader_stage::compute)) { tz::assert(!sinfo.has_shader(shader_stage::vertex), "Shader has compute shader and vertex shader. These are mutually exclusive."); @@ -953,7 +953,7 @@ namespace tz::gl vk2::GraphicsPipelineInfo GraphicsPipelineManager::make_graphics_pipeline(tz::vec2ui viewport_dimensions, bool depth_testing_enabled, bool alpha_blending_enabled, const vk2::RenderPass& render_pass) const { - tz::BasicList alpha_blending_options; + tz::basic_list alpha_blending_options; alpha_blending_options.resize(render_pass.get_info().total_colour_attachment_count()); std::fill(alpha_blending_options.begin(), alpha_blending_options.end(), alpha_blending_enabled ? vk2::ColourBlendState::alpha_blending() : vk2::ColourBlendState::no_blending()); return @@ -1124,7 +1124,7 @@ namespace tz::gl } this->device_scheduler->get_frame_fences()[this->current_frame].unsignal(); - tz::BasicList waits; + tz::basic_list waits; if(requires_present && !already_have_image) { waits = @@ -1136,7 +1136,7 @@ namespace tz::gl } }; } - tz::BasicList sem_signals; + tz::basic_list sem_signals; if(requires_present && !this->options.contains(renderer_option::no_present)) { sem_signals = {&this->device_scheduler->get_render_work_signals()[this->current_frame]}; @@ -1781,7 +1781,7 @@ namespace tz::gl ({ .pipeline = &this->pipeline.get_pipeline(), }); - tz::BasicList sets; + tz::basic_list sets; if(!this->resources.descriptor_empty()) { std::span resource_sets = this->resources.get_descriptor_sets(); @@ -1885,7 +1885,7 @@ namespace tz::gl ({ .pipeline = &this->pipeline.get_pipeline(), }); - tz::BasicList sets; + tz::basic_list sets; if(!this->resources.empty()) { std::span resource_sets = this->resources.get_descriptor_sets(); diff --git a/src/tz/gl/impl/vulkan/renderer.hpp b/src/tz/gl/impl/vulkan/renderer.hpp index 13268bc963..5cd3015209 100644 --- a/src/tz/gl/impl/vulkan/renderer.hpp +++ b/src/tz/gl/impl/vulkan/renderer.hpp @@ -123,7 +123,7 @@ namespace tz::gl */ struct OutputImageState { - tz::BasicList colour_attachments = {}; + tz::basic_list colour_attachments = {}; vk2::Image* depth_attachment = nullptr; }; @@ -132,7 +132,7 @@ namespace tz::gl */ struct OutputImageViewState { - tz::BasicList colour_views = {}; + tz::basic_list colour_views = {}; }; /** diff --git a/src/tz/gl/output.hpp b/src/tz/gl/output.hpp index 40f9009177..5e73bf80a2 100644 --- a/src/tz/gl/output.hpp +++ b/src/tz/gl/output.hpp @@ -9,7 +9,7 @@ namespace tz::gl { struct image_output_info { - tz::BasicList colours; + tz::basic_list colours; icomponent* depth = nullptr; }; diff --git a/src/tz/tz.hpp b/src/tz/tz.hpp index 9dec6a2b0c..3c34cbd51d 100644 --- a/src/tz/tz.hpp +++ b/src/tz/tz.hpp @@ -55,7 +55,7 @@ namespace tz window_transparent, }; - using application_flags = tz::EnumField; + using application_flags = tz::enum_field; /** * @ingroup tz_core