mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-06 12:34:24 +00:00
Format all C++ and Java code via clang-format
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
#import <MetalKit/MetalKit.h>
|
||||
|
||||
#include "drape/graphics_context.hpp"
|
||||
#include "drape/gpu_program.hpp"
|
||||
#include "drape/graphics_context.hpp"
|
||||
#include "drape/metal/metal_cleaner.hpp"
|
||||
#include "drape/metal/metal_states.hpp"
|
||||
#include "drape/metal/metal_texture.hpp"
|
||||
@@ -22,10 +22,9 @@ class MetalBaseContext : public dp::GraphicsContext
|
||||
{
|
||||
public:
|
||||
using DrawableRequest = std::function<id<CAMetalDrawable>()>;
|
||||
|
||||
MetalBaseContext(id<MTLDevice> device, m2::PointU const & screenSize,
|
||||
DrawableRequest && drawableRequest);
|
||||
|
||||
|
||||
MetalBaseContext(id<MTLDevice> device, m2::PointU const & screenSize, DrawableRequest && drawableRequest);
|
||||
|
||||
bool BeginRendering() override;
|
||||
void EndRendering() override;
|
||||
void Present() override;
|
||||
@@ -44,7 +43,7 @@ public:
|
||||
void DebugSynchronizeWithCPU() override;
|
||||
void PushDebugLabel(std::string const & label) override;
|
||||
void PopDebugLabel() override;
|
||||
|
||||
|
||||
void SetClearColor(Color const & color) override;
|
||||
void Clear(uint32_t clearBits, uint32_t storeBits) override;
|
||||
void Flush() override {}
|
||||
@@ -54,9 +53,12 @@ public:
|
||||
void SetDepthTestFunction(TestFunction depthFunction) override;
|
||||
void SetStencilTestEnabled(bool enabled) override;
|
||||
void SetStencilFunction(StencilFace face, TestFunction stencilFunction) override;
|
||||
void SetStencilActions(StencilFace face, StencilAction stencilFailAction,
|
||||
StencilAction depthFailAction, StencilAction passAction) override;
|
||||
void SetStencilReferenceValue(uint32_t stencilReferenceValue) override { m_stencilReferenceValue = stencilReferenceValue; }
|
||||
void SetStencilActions(StencilFace face, StencilAction stencilFailAction, StencilAction depthFailAction,
|
||||
StencilAction passAction) override;
|
||||
void SetStencilReferenceValue(uint32_t stencilReferenceValue) override
|
||||
{
|
||||
m_stencilReferenceValue = stencilReferenceValue;
|
||||
}
|
||||
void SetCullingEnabled(bool enabled) override;
|
||||
|
||||
id<MTLDevice> GetMetalDevice() const;
|
||||
@@ -64,19 +66,17 @@ public:
|
||||
id<MTLRenderCommandEncoder> GetCommandEncoder() const;
|
||||
id<MTLDepthStencilState> GetDepthStencilState();
|
||||
id<MTLRenderPipelineState> GetPipelineState(ref_ptr<GpuProgram> program, bool blendingEnabled);
|
||||
id<MTLSamplerState> GetSamplerState(TextureFilter filter, TextureWrapping wrapSMode,
|
||||
TextureWrapping wrapTMode);
|
||||
|
||||
void SetSystemPrograms(drape_ptr<GpuProgram> && programClearColor,
|
||||
drape_ptr<GpuProgram> && programClearDepth,
|
||||
id<MTLSamplerState> GetSamplerState(TextureFilter filter, TextureWrapping wrapSMode, TextureWrapping wrapTMode);
|
||||
|
||||
void SetSystemPrograms(drape_ptr<GpuProgram> && programClearColor, drape_ptr<GpuProgram> && programClearDepth,
|
||||
drape_ptr<GpuProgram> && programClearColorAndDepth);
|
||||
|
||||
|
||||
void ApplyPipelineState(id<MTLRenderPipelineState> state);
|
||||
bool HasAppliedPipelineState() const;
|
||||
void ResetPipelineStatesCache();
|
||||
|
||||
MTLRenderPassDescriptor * GetRenderPassDescriptor() const;
|
||||
|
||||
|
||||
protected:
|
||||
void RecreateDepthTexture(m2::PointU const & screenSize);
|
||||
void RequestFrameDrawable();
|
||||
@@ -91,15 +91,15 @@ protected:
|
||||
ref_ptr<dp::BaseFramebuffer> m_currentFramebuffer;
|
||||
MetalStates::DepthStencilKey m_currentDepthStencilKey;
|
||||
MetalStates m_metalStates;
|
||||
|
||||
|
||||
// These objects are recreated each frame. They MUST NOT be stored anywhere.
|
||||
id<CAMetalDrawable> m_frameDrawable;
|
||||
id<MTLCommandBuffer> m_frameCommandBuffer;
|
||||
id<MTLRenderCommandEncoder> m_currentCommandEncoder;
|
||||
id<MTLRenderPipelineState> m_lastPipelineState;
|
||||
|
||||
|
||||
MetalCleaner m_cleaner;
|
||||
|
||||
|
||||
uint32_t m_stencilReferenceValue = 1;
|
||||
};
|
||||
} // namespace metal
|
||||
|
||||
Reference in New Issue
Block a user