From 49ba0ddd67fcd73d8305d091c5c33e5f712be5e3 Mon Sep 17 00:00:00 2001 From: Paulo Coutinho Date: Sat, 25 May 2024 03:39:18 -0300 Subject: [PATCH] Fix descriptor typo (#1928) --- core/renderer/backend/RenderPipeline.h | 2 +- core/renderer/backend/Texture.h | 2 +- .../backend/metal/RenderPipelineMTL.mm | 22 +++++++++---------- .../backend/opengl/CommandBufferGL.cpp | 10 ++++----- .../backend/opengl/RenderPipelineGL.cpp | 8 +++---- .../backend/opengl/RenderPipelineGL.h | 2 +- core/renderer/backend/opengl/TextureGL.h | 4 ++-- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/core/renderer/backend/RenderPipeline.h b/core/renderer/backend/RenderPipeline.h index 458bf3992b07..c4cae9d534a5 100644 --- a/core/renderer/backend/RenderPipeline.h +++ b/core/renderer/backend/RenderPipeline.h @@ -43,7 +43,7 @@ class RenderTarget; class RenderPipeline : public ax::Object { public: - virtual void update(const RenderTarget*, const PipelineDescriptor& pipelineDescirptor) = 0; + virtual void update(const RenderTarget*, const PipelineDescriptor& pipelineDescriptor) = 0; protected: virtual ~RenderPipeline() = default; diff --git a/core/renderer/backend/Texture.h b/core/renderer/backend/Texture.h index 770663f6f61f..181d982c2077 100644 --- a/core/renderer/backend/Texture.h +++ b/core/renderer/backend/Texture.h @@ -105,7 +105,7 @@ class TextureBackend : public Object protected: /** - * @param descriptor Specifies the texture descirptor. + * @param descriptor Specifies the texture descriptor. */ TextureBackend() {} virtual ~TextureBackend(); diff --git a/core/renderer/backend/metal/RenderPipelineMTL.mm b/core/renderer/backend/metal/RenderPipelineMTL.mm index ee7473726f6d..4c84c60c97be 100644 --- a/core/renderer/backend/metal/RenderPipelineMTL.mm +++ b/core/renderer/backend/metal/RenderPipelineMTL.mm @@ -162,7 +162,7 @@ MTLBlendOperation toMTLBlendOperation(BlendOperation operation) RenderPipelineMTL::RenderPipelineMTL(id mtlDevice) : _mtlDevice(mtlDevice) {} -void RenderPipelineMTL::update(const RenderTarget* renderTarget, const PipelineDescriptor& pipelineDescirptor) +void RenderPipelineMTL::update(const RenderTarget* renderTarget, const PipelineDescriptor& pipelineDescriptor) { struct { @@ -183,9 +183,9 @@ MTLBlendOperation toMTLBlendOperation(BlendOperation operation) } hashMe; memset(&hashMe, 0, sizeof(hashMe)); - const auto& blendDescriptor = pipelineDescirptor.blendDescriptor; + const auto& blendDescriptor = pipelineDescriptor.blendDescriptor; chooseAttachmentFormat(renderTarget, _colorAttachmentsFormat, _depthAttachmentFormat, _stencilAttachmentFormat); - auto program = static_cast(pipelineDescirptor.programState->getProgram()); + auto program = static_cast(pipelineDescriptor.programState->getProgram()); hashMe.vertexShaderHash = program->getVertexShader()->getHashValue(); hashMe.fragmentShaderHash = program->getFragmentShader()->getHashValue(); memcpy(&hashMe.colorAttachment, &_colorAttachmentsFormat, sizeof(_colorAttachmentsFormat)); @@ -200,7 +200,7 @@ MTLBlendOperation toMTLBlendOperation(BlendOperation operation) hashMe.sourceAlphaBlendFactor = (unsigned int)blendDescriptor.sourceAlphaBlendFactor; hashMe.destinationAlphaBlendFactor = (unsigned int)blendDescriptor.destinationAlphaBlendFactor; int index = 0; - auto vertexLayout = pipelineDescirptor.programState->getVertexLayout(); + auto vertexLayout = pipelineDescriptor.programState->getVertexLayout(); const auto& attributes = vertexLayout->getAttributes(); for (const auto& it : attributes) { @@ -225,10 +225,10 @@ MTLBlendOperation toMTLBlendOperation(BlendOperation operation) _mtlRenderPipelineDescriptor = [[MTLRenderPipelineDescriptor alloc] init]; - setShaderModules(pipelineDescirptor); - setVertexLayout(_mtlRenderPipelineDescriptor, pipelineDescirptor); + setShaderModules(pipelineDescriptor); + setVertexLayout(_mtlRenderPipelineDescriptor, pipelineDescriptor); - setBlendStateAndFormat(pipelineDescirptor.blendDescriptor); + setBlendStateAndFormat(pipelineDescriptor.blendDescriptor); NSError* error = nil; _mtlRenderPipelineState = [_mtlDevice newRenderPipelineStateWithDescriptor:_mtlRenderPipelineDescriptor @@ -261,18 +261,18 @@ MTLBlendOperation toMTLBlendOperation(BlendOperation operation) toMTLVertexStepFunction(vertexLayout->getVertexStepMode()); const auto& attributes = vertexLayout->getAttributes(); - - + + for (const auto& it : attributes) { auto attribute = it.second; - + vertexDesc.attributes[attribute.index].format = toMTLVertexFormat(attribute.format, attribute.needToBeNormallized); vertexDesc.attributes[attribute.index].offset = attribute.offset; // Buffer index will always be 0; vertexDesc.attributes[attribute.index].bufferIndex = DriverMTL::DEFAULT_ATTRIBS_BINDING_INDEX; - + } } diff --git a/core/renderer/backend/opengl/CommandBufferGL.cpp b/core/renderer/backend/opengl/CommandBufferGL.cpp index e197e399cec7..473adb0ad786 100644 --- a/core/renderer/backend/opengl/CommandBufferGL.cpp +++ b/core/renderer/backend/opengl/CommandBufferGL.cpp @@ -71,21 +71,21 @@ bool CommandBufferGL::beginFrame() return true; } -void CommandBufferGL::beginRenderPass(const RenderTarget* rt, const RenderPassDescriptor& descirptor) +void CommandBufferGL::beginRenderPass(const RenderTarget* rt, const RenderPassDescriptor& descriptor) { auto rtGL = static_cast(rt); rtGL->bindFrameBuffer(); rtGL->update(); - auto clearFlags = descirptor.flags.clear; + auto clearFlags = descriptor.flags.clear; // set clear color, depth and stencil GLbitfield mask = 0; if (bitmask::any(clearFlags, TargetBufferFlags::COLOR)) { mask |= GL_COLOR_BUFFER_BIT; - const auto& clearColor = descirptor.clearColorValue; + const auto& clearColor = descriptor.clearColorValue; glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]); } @@ -103,7 +103,7 @@ void CommandBufferGL::beginRenderPass(const RenderTarget* rt, const RenderPassDe glGetIntegerv(GL_DEPTH_FUNC, &oldDepthFunc); mask |= GL_DEPTH_BUFFER_BIT; - glClearDepth(descirptor.clearDepthValue); + glClearDepth(descriptor.clearDepthValue); __gl->enableDepthTest(); __gl->depthMask(GL_TRUE); @@ -115,7 +115,7 @@ void CommandBufferGL::beginRenderPass(const RenderTarget* rt, const RenderPassDe if (bitmask::any(clearFlags, TargetBufferFlags::STENCIL)) { mask |= GL_STENCIL_BUFFER_BIT; - glClearStencil(descirptor.clearStencilValue); + glClearStencil(descriptor.clearStencilValue); } if (mask) diff --git a/core/renderer/backend/opengl/RenderPipelineGL.cpp b/core/renderer/backend/opengl/RenderPipelineGL.cpp index fd30dc028c88..825380de728e 100644 --- a/core/renderer/backend/opengl/RenderPipelineGL.cpp +++ b/core/renderer/backend/opengl/RenderPipelineGL.cpp @@ -35,16 +35,16 @@ Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md). NS_AX_BACKEND_BEGIN -void RenderPipelineGL::update(const RenderTarget*, const PipelineDescriptor& pipelineDescirptor) +void RenderPipelineGL::update(const RenderTarget*, const PipelineDescriptor& pipelineDescriptor) { - if (_programGL != pipelineDescirptor.programState->getProgram()) + if (_programGL != pipelineDescriptor.programState->getProgram()) { AX_SAFE_RELEASE(_programGL); - _programGL = static_cast(pipelineDescirptor.programState->getProgram()); + _programGL = static_cast(pipelineDescriptor.programState->getProgram()); AX_SAFE_RETAIN(_programGL); } - updateBlendState(pipelineDescirptor.blendDescriptor); + updateBlendState(pipelineDescriptor.blendDescriptor); } void RenderPipelineGL::updateBlendState(const BlendDescriptor& descriptor) diff --git a/core/renderer/backend/opengl/RenderPipelineGL.h b/core/renderer/backend/opengl/RenderPipelineGL.h index d19ea49be0e3..45f052c7c0fe 100644 --- a/core/renderer/backend/opengl/RenderPipelineGL.h +++ b/core/renderer/backend/opengl/RenderPipelineGL.h @@ -50,7 +50,7 @@ class RenderPipelineGL : public RenderPipeline RenderPipelineGL() = default; ~RenderPipelineGL(); - virtual void update(const RenderTarget*, const PipelineDescriptor& pipelineDescirptor) override; + virtual void update(const RenderTarget*, const PipelineDescriptor& pipelineDescriptor) override; /** * Get program instance. * @return Program instance. diff --git a/core/renderer/backend/opengl/TextureGL.h b/core/renderer/backend/opengl/TextureGL.h index ad9663e6f060..57c215f21f19 100644 --- a/core/renderer/backend/opengl/TextureGL.h +++ b/core/renderer/backend/opengl/TextureGL.h @@ -98,7 +98,7 @@ class Texture2DGL : public backend::Texture2DBackend { public: /** - * @param descirptor Specifies the texture description. + * @param descriptor Specifies the texture description. */ Texture2DGL(const TextureDescriptor& descriptor); ~Texture2DGL(); @@ -216,7 +216,7 @@ class TextureCubeGL : public backend::TextureCubemapBackend { public: /** - * @param descirptor Specifies the texture description. + * @param descriptor Specifies the texture description. */ TextureCubeGL(const TextureDescriptor& descriptor); ~TextureCubeGL();