Skip to content

Commit

Permalink
Fix code alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
egorodet committed Feb 8, 2023
1 parent 07f7439 commit 36a5657
Show file tree
Hide file tree
Showing 24 changed files with 60 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ struct SkyBoxVertex
class SkyBox::Impl
{
private:
using Uniforms = SkyBoxUniforms;
using Vertex = SkyBoxVertex;
using Uniforms = SkyBoxUniforms;
using Vertex = SkyBoxVertex;
using TexMeshBuffers = TexturedMeshBuffers<hlslpp::SkyBoxUniforms>;

Settings m_settings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ class CommandKit final
[[nodiscard]] Rhi::IFence& GetFence(Rhi::CommandListId fence_id) const override;

private:
using CommandListIndex = uint32_t;
using CommandListSetId = std::pair<Opt<Data::Index>, uint32_t>;
using CommandListIndex = uint32_t;
using CommandListSetId = std::pair<Opt<Data::Index>, uint32_t>;
using CommandListIndexById = std::map<Rhi::CommandListId, uint32_t>;
using CommandListSetById = std::map<CommandListSetId, Ptr<Rhi::ICommandListSet>>;
using CommandListSetById = std::map<CommandListSetId, Ptr<Rhi::ICommandListSet>>;

CommandListIndex GetCommandListIndexById(Rhi::CommandListId cmd_list_id) const noexcept;
CommandListSetId GetCommandListSetId(const std::vector<Rhi::CommandListId>& cmd_list_ids, Opt<Data::Index> frame_index_opt) const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ bool RenderCommandList::SetIndexBuffer(Rhi::IBuffer& index_buffer, bool set_reso
}

void RenderCommandList::DrawIndexed(Primitive primitive_type, uint32_t index_count, uint32_t start_index, uint32_t start_vertex,
uint32_t instance_count, uint32_t start_instance)
uint32_t instance_count, uint32_t start_instance)
{
META_FUNCTION_TASK();
VerifyEncodingState();
Expand Down Expand Up @@ -230,7 +230,7 @@ void RenderCommandList::DrawIndexed(Primitive primitive_type, uint32_t index_cou
}

void RenderCommandList::Draw(Primitive primitive_type, uint32_t vertex_count, uint32_t start_vertex,
uint32_t instance_count, uint32_t start_instance)
uint32_t instance_count, uint32_t start_instance)
{
META_FUNCTION_TASK();
VerifyEncodingState();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ProgramArgumentBinding final // NOSONAR - custom destructor is required
: public Base::ProgramArgumentBinding
{
public:
using Type = ProgramArgumentBindingType;
using Type = ProgramArgumentBindingType;
using Settings = ProgramArgumentBindingSettings;

struct DescriptorRange
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ bool RenderCommandList::SetIndexBuffer(Rhi::IBuffer& index_buffer, bool set_reso
}

void RenderCommandList::DrawIndexed(Primitive primitive, uint32_t index_count, uint32_t start_index, uint32_t start_vertex,
uint32_t instance_count, uint32_t start_instance)
uint32_t instance_count, uint32_t start_instance)
{
META_FUNCTION_TASK();

Expand All @@ -205,7 +205,7 @@ void RenderCommandList::DrawIndexed(Primitive primitive, uint32_t index_count, u
}

void RenderCommandList::Draw(Primitive primitive, uint32_t vertex_count, uint32_t start_vertex,
uint32_t instance_count, uint32_t start_instance)
uint32_t instance_count, uint32_t start_instance)
{
META_FUNCTION_TASK();
Base::RenderCommandList::Draw(primitive, vertex_count, start_vertex, instance_count, start_instance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class ParallelRenderCommandList // NOSONAR - class has more than 35 methods, con
META_PIMPL_API void Reset(const DebugGroup* debug_group_ptr = nullptr) const;
META_PIMPL_API void ResetOnce(const DebugGroup* debug_group_ptr = nullptr) const;
META_PIMPL_API void SetProgramBindings(IProgramBindings& program_bindings,
ProgramBindingsApplyBehaviorMask apply_behavior = ProgramBindingsApplyBehaviorMask(~0U)) const;
ProgramBindingsApplyBehaviorMask apply_behavior = ProgramBindingsApplyBehaviorMask(~0U)) const;
META_PIMPL_API void SetResourceBarriers(const ResourceBarriers& resource_barriers) const;
META_PIMPL_API void Commit() const;
META_PIMPL_API void WaitUntilCompleted(uint32_t timeout_ms = 0U) const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class RenderCommandList // NOSONAR - class has more than 35 methods, constructor
META_PIMPL_API void Reset(const DebugGroup* debug_group_ptr = nullptr) const;
META_PIMPL_API void ResetOnce(const DebugGroup* debug_group_ptr = nullptr) const;
META_PIMPL_API void SetProgramBindings(const ProgramBindings& program_bindings,
ProgramBindingsApplyBehaviorMask apply_behavior = ProgramBindingsApplyBehaviorMask(~0U)) const;
ProgramBindingsApplyBehaviorMask apply_behavior = ProgramBindingsApplyBehaviorMask(~0U)) const;
META_PIMPL_API void SetResourceBarriers(const ResourceBarriers& resource_barriers) const;
META_PIMPL_API void Commit() const;
META_PIMPL_API void WaitUntilCompleted(uint32_t timeout_ms = 0U) const;
Expand All @@ -102,9 +102,9 @@ class RenderCommandList // NOSONAR - class has more than 35 methods, constructor
META_PIMPL_API bool SetVertexBuffers(const BufferSet& vertex_buffers, bool set_resource_barriers = true) const;
META_PIMPL_API bool SetIndexBuffer(const Buffer& index_buffer, bool set_resource_barriers = true) const;
META_PIMPL_API void DrawIndexed(Primitive primitive, uint32_t index_count = 0U, uint32_t start_index = 0U, uint32_t start_vertex = 0U,
uint32_t instance_count = 1U, uint32_t start_instance = 0U) const;
uint32_t instance_count = 1U, uint32_t start_instance = 0U) const;
META_PIMPL_API void Draw(Primitive primitive, uint32_t vertex_count, uint32_t start_vertex = 0U,
uint32_t instance_count = 1U, uint32_t start_instance = 0U) const;
uint32_t instance_count = 1U, uint32_t start_instance = 0U) const;

private:
using Impl = Methane::Graphics::META_GFX_NAME::RenderCommandList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ class ResourceBarriers // NOSONAR - constructors and assignment operators are re
META_PIMPL_API explicit ResourceBarriers(IResourceBarriers& interface_ref);
META_PIMPL_API explicit ResourceBarriers(const Set& barriers);
META_PIMPL_API ResourceBarriers(const Refs<IResource>& resources,
const Opt<Barrier::StateChange>& state_change,
const Opt<Barrier::OwnerChange>& owner_change);
const Opt<Barrier::StateChange>& state_change,
const Opt<Barrier::OwnerChange>& owner_change);

META_PIMPL_API bool IsInitialized() const META_PIMPL_NOEXCEPT;
META_PIMPL_API IResourceBarriers& GetInterface() const META_PIMPL_NOEXCEPT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class System // NOSONAR - constructors and assignment operators are required to
META_PIMPL_API void CheckForChanges() const;
META_PIMPL_API const Devices& UpdateGpuDevices(const DeviceCaps& required_device_caps = {}) const;
META_PIMPL_API const Devices& UpdateGpuDevices(const Platform::AppEnvironment& app_env,
const DeviceCaps& required_device_caps = {}) const;
const DeviceCaps& required_device_caps = {}) const;
[[nodiscard]] META_PIMPL_API const Devices& GetGpuDevices() const META_PIMPL_NOEXCEPT;
[[nodiscard]] META_PIMPL_API Device GetNextGpuDevice(const Device& device) const META_PIMPL_NOEXCEPT;
[[nodiscard]] META_PIMPL_API Device GetSoftwareGpuDevice() const META_PIMPL_NOEXCEPT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ struct BufferSettings
struct IBuffer
: virtual IResource // NOSONAR
{
using Type = BufferType;
using Type = BufferType;
using StorageMode = BufferStorageMode;
using Settings = BufferSettings;
using Settings = BufferSettings;

// Create IBuffer instance
[[nodiscard]] static Ptr<IBuffer> Create(const IContext& context, const Settings& settings);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,14 @@ struct IProgramBindings;
struct IProgram
: virtual IObject // NOSONAR
{
using Shaders = ProgramShaders;
using Settings = ProgramSettings;
using InputBufferLayout = ProgramInputBufferLayout;
using InputBufferLayouts = ProgramInputBufferLayouts;
using Argument = ProgramArgument;
using Arguments = ProgramArguments;
using ArgumentAccessor = ProgramArgumentAccessor;
using ArgumentAccessors = ProgramArgumentAccessors;
using Shaders = ProgramShaders;
using Settings = ProgramSettings;
using InputBufferLayout = ProgramInputBufferLayout;
using InputBufferLayouts = ProgramInputBufferLayouts;
using Argument = ProgramArgument;
using Arguments = ProgramArguments;
using ArgumentAccessor = ProgramArgumentAccessor;
using ArgumentAccessors = ProgramArgumentAccessors;
using ResourceViewsByArgument = std::unordered_map<Argument, ResourceViews, Argument::Hash>;

static ArgumentAccessors::const_iterator FindArgumentAccessor(const ArgumentAccessors& argument_accessors, const Argument& argument);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ struct ProgramArgumentBindingSettings
struct IProgramArgumentBinding
: virtual Data::IEmitter<IProgramArgumentBindingCallback> // NOSONAR
{
using ICallback = IProgramArgumentBindingCallback;
using ICallback = IProgramArgumentBindingCallback;
using ConstantModificationException = ProgramArgumentConstantModificationException;
using Settings = ProgramArgumentBindingSettings;
using Settings = ProgramArgumentBindingSettings;

// IProgramArgumentBinding interface
[[nodiscard]] virtual const Settings& GetSettings() const noexcept = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ class ResourceBarrier

struct IResourceBarriers
{
using State = ResourceState;
using State = ResourceState;
using Barrier = ResourceBarrier;
using Set = std::set<ResourceBarrier>;
using Map = std::map<ResourceBarrier::Id, ResourceBarrier>;
using Set = std::set<ResourceBarrier>;
using Map = std::map<ResourceBarrier::Id, ResourceBarrier>;

enum class AddResult
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ struct SamplerLevelOfDetail
{
SamplerLevelOfDetail(float bias = 0.F, float min = 0.F, float max = std::numeric_limits<float>::max());

float min = 0.F;
float max = std::numeric_limits<float>::max();
float bias = 0.F;
float min = 0.F;
float max = std::numeric_limits<float>::max();
float bias = 0.F;
};

enum class SamplerBorderColor : uint32_t
Expand Down Expand Up @@ -115,11 +115,11 @@ struct IContext;
struct ISampler
: virtual IResource // NOSONAR
{
using Filter = SamplerFilter;
using Address = SamplerAddress;
using Filter = SamplerFilter;
using Address = SamplerAddress;
using LevelOfDetail = SamplerLevelOfDetail;
using BorderColor = SamplerBorderColor;
using Settings = SamplerSettings;
using BorderColor = SamplerBorderColor;
using Settings = SamplerSettings;

// Create ISampler instance
[[nodiscard]] static Ptr<ISampler> Create(const IContext& context, const Settings& settings);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ struct IContext;

struct IShader
{
using Type = ShaderType;
using Types = ShaderTypes;
using MacroDefinition = ShaderMacroDefinition;
using Type = ShaderType;
using Types = ShaderTypes;
using MacroDefinition = ShaderMacroDefinition;
using MacroDefinitions = ShaderMacroDefinitions;
using EntryFunction = ShaderEntryFunction;
using Settings = ShaderSettings;
using EntryFunction = ShaderEntryFunction;
using Settings = ShaderSettings;

// Create IShader instance
[[nodiscard]] static Ptr<IShader> Create(Type type, const IContext& context, const Settings& settings);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Methane graphics RHI interfaces: all headers under one umbrella.
#include "IBufferSet.h"
#include "ITexture.h"
#include "ISampler.h"
#include "IQueryPool.h"
#include "ICommandKit.h"
#include "ICommandListSet.h"
#include "ICommandListDebugGroup.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ static bool GetDeviceSupportOfGpuFamilyApple3(CommandQueue& command_queue)
}

void RenderCommandList::DrawIndexed(Primitive primitive, uint32_t index_count, uint32_t start_index, uint32_t start_vertex,
uint32_t instance_count, uint32_t start_instance)
uint32_t instance_count, uint32_t start_instance)
{
META_FUNCTION_TASK();

Expand Down Expand Up @@ -184,7 +184,7 @@ static bool GetDeviceSupportOfGpuFamilyApple3(CommandQueue& command_queue)
}

void RenderCommandList::Draw(Primitive primitive, uint32_t vertex_count, uint32_t start_vertex,
uint32_t instance_count, uint32_t start_instance)
uint32_t instance_count, uint32_t start_instance)
{
META_FUNCTION_TASK();
Base::RenderCommandList::Draw(primitive, vertex_count, start_vertex, instance_count, start_instance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ bool RenderCommandList::SetIndexBuffer(Rhi::IBuffer& index_buffer, bool set_reso
}

void RenderCommandList::DrawIndexed(Primitive primitive, uint32_t index_count, uint32_t start_index, uint32_t start_vertex,
uint32_t instance_count, uint32_t start_instance)
uint32_t instance_count, uint32_t start_instance)
{
META_FUNCTION_TASK();
if (const DrawingState& drawing_state = GetDrawingState();
Expand All @@ -102,7 +102,7 @@ void RenderCommandList::DrawIndexed(Primitive primitive, uint32_t index_count, u
}

void RenderCommandList::Draw(Primitive primitive, uint32_t vertex_count, uint32_t start_vertex,
uint32_t instance_count, uint32_t start_instance)
uint32_t instance_count, uint32_t start_instance)
{
META_FUNCTION_TASK();
Base::RenderCommandList::Draw(primitive, vertex_count, start_vertex, instance_count, start_instance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class ProgramArgumentBinding final
: public Base::ProgramArgumentBinding
{
public:
using Settings = ProgramArgumentBindingSettings;
using Settings = ProgramArgumentBindingSettings;
using ByteCodeMap = ProgramArgumentBindingSettings::ByteCodeMap;

ProgramArgumentBinding(const Base::Context& context, const Settings& settings);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ class QueryPool : public Base::QueryPool
{
public:
QueryPool(CommandQueue& command_queue, Type type,
Data::Size max_query_count, Rhi::IQuery::Count slots_count_per_query,
Data::Size buffer_size, Data::Size query_size);
Data::Size max_query_count, Rhi::IQuery::Count slots_count_per_query,
Data::Size buffer_size, Data::Size query_size);

CommandQueue& GetVulkanCommandQueue() noexcept;
const IContext& GetVulkanContext() const noexcept { return m_context_vk; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ bool RenderCommandList::SetIndexBuffer(Rhi::IBuffer& index_buffer, bool set_reso
}

void RenderCommandList::DrawIndexed(Primitive primitive, uint32_t index_count, uint32_t start_index, uint32_t start_vertex,
uint32_t instance_count, uint32_t start_instance)
uint32_t instance_count, uint32_t start_instance)
{
META_FUNCTION_TASK();
if (const DrawingState& drawing_state = GetDrawingState();
Expand All @@ -170,7 +170,7 @@ void RenderCommandList::DrawIndexed(Primitive primitive, uint32_t index_count, u
}

void RenderCommandList::Draw(Primitive primitive, uint32_t vertex_count, uint32_t start_vertex,
uint32_t instance_count, uint32_t start_instance)
uint32_t instance_count, uint32_t start_instance)
{
META_FUNCTION_TASK();
Base::RenderCommandList::Draw(primitive, vertex_count, start_vertex, instance_count, start_instance);
Expand Down
4 changes: 2 additions & 2 deletions Modules/Platform/App/Include/Methane/Platform/IApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ struct IApp
{
public:
using Settings = AppSettings;
using RunArgs = AppRunArgs;
using Message = AppMessage;
using RunArgs = AppRunArgs;
using Message = AppMessage;

// IApp interface
virtual int Run(const RunArgs& args) = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ class Text::Impl // NOSONAR - class destructor is required
, public Data::Receiver<IFontCallback>
{
private:
using FrameResources = TextFrameResources;
using FrameResources = TextFrameResources;
using PerFrameResources = std::vector<TextFrameResources>;

Context& m_ui_context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ class TextMesh
Data::RawVector2F texcoord;
};

using Index = uint16_t;
using Indices = std::vector<Index>;
using Vertices = std::vector<Vertex>;
using Index = uint16_t;
using Indices = std::vector<Index>;
using Vertices = std::vector<Vertex>;

struct CharPosition : gfx::FramePoint
{
Expand Down

9 comments on commit 36a5657

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Win32_DX_Release Test Results

  • ✅ 2966 tests passed
  • ❌ 0 tests failed
  • ⚠️ 0 tests skipped
  • ⏱️ 135 ms. run duration

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ubuntu_VK_Release Test Results

  • ✅ 2967 tests passed
  • ❌ 0 tests failed
  • ⚠️ 0 tests skipped
  • ⏱️ 12596 ms. run duration

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Win64_DX_Release Test Results

  • ✅ 2966 tests passed
  • ❌ 0 tests failed
  • ⚠️ 0 tests skipped
  • ⏱️ 146 ms. run duration

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MacOS_MTL_Release Test Results

  • ✅ 2966 tests passed
  • ❌ 0 tests failed
  • ⚠️ 0 tests skipped
  • ⏱️ 57 ms. run duration

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Win64_VK_Release Test Results

  • ✅ 2966 tests passed
  • ❌ 0 tests failed
  • ⚠️ 0 tests skipped
  • ⏱️ 144 ms. run duration

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Win32_VK_Release Test Results

  • ✅ 2966 tests passed
  • ❌ 0 tests failed
  • ⚠️ 0 tests skipped
  • ⏱️ 156 ms. run duration

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Win64_DX_SonarScan Tests Code Coverage

Code Coverage

Package Line Rate Branch Rate Health
D:\a\MethaneKit\MethaneKit\Build\Output\Ninja-Win-DX-Scan\Install\Tests\MethaneDataEventsTest.exe 95% 100%
D:\a\MethaneKit\MethaneKit\Build\Output\Ninja-Win-DX-Scan\Install\Tests\MethaneDataRangeSetTest.exe 91% 100%
D:\a\MethaneKit\MethaneKit\Build\Output\Ninja-Win-DX-Scan\Install\Tests\MethaneDataTypesTest.exe 98% 100%
D:\a\MethaneKit\MethaneKit\Build\Output\Ninja-Win-DX-Scan\Install\Tests\MethaneGraphicsCameraTest.exe 61% 100%
D:\a\MethaneKit\MethaneKit\Build\Output\Ninja-Win-DX-Scan\Install\Tests\MethaneGraphicsTypesTest.exe 98% 100%
D:\a\MethaneKit\MethaneKit\Build\Output\Ninja-Win-DX-Scan\Install\Tests\MethanePlatformInputTest.exe 43% 100%
D:\a\MethaneKit\MethaneKit\Build\Output\Ninja-Win-DX-Scan\Install\Tests\MethaneUserInterfaceTypesTest.exe 10% 100%
Summary 30% (2108 / 7141) 100% (0 / 0)

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ubuntu_VK_SonarScan Tests Code Coverage

Code Coverage

Package Line Rate Branch Rate Health
Default 25% 100%
Summary 25% (4527 / 17929) 100% (0 / 0)

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MacOS_MTL_SonarScan Tests Code Coverage

Code Coverage

Package Line Rate Branch Rate Health
Default 36% 19%
Summary 36% (8156 / 22632) 19% (2965 / 15778)

Please sign in to comment.