Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 19 additions & 20 deletions native/cocos/renderer/pipeline/InstancedBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@

#include <algorithm>

#include "InstancedBuffer.h"
#include "Define.h"
#include "InstancedBuffer.h"
#include "base/StringUtil.h"
#include "gfx-base/GFXBuffer.h"
#include "gfx-base/GFXCommandBuffer.h"
#include "gfx-base/GFXDescriptorSet.h"
#include "gfx-base/GFXDevice.h"
#include "gfx-base/GFXInputAssembler.h"
#include "base/StringUtil.h"

namespace cc {
namespace pipeline {
Expand Down Expand Up @@ -71,8 +71,8 @@ void InstancedBuffer::merge(scene::SubModel *subModel, uint32_t passIdx, gfx::Sh
auto *reflectionProbeCubemap = descriptorSet->getTexture(REFLECTIONPROBECUBEMAP::BINDING);
auto *reflectionProbePlanarMap = descriptorSet->getTexture(REFLECTIONPROBEPLANARMAP::BINDING);
auto *reflectionProbeBlendCubemap = ENABLE_PROBE_BLEND
? descriptorSet->getTexture(REFLECTIONPROBEBLENDCUBEMAP::BINDING)
: nullptr;
? descriptorSet->getTexture(REFLECTIONPROBEBLENDCUBEMAP::BINDING)
: nullptr;
const uint32_t reflectionProbeType = subModel->getReflectionProbeType();
auto *shader = shaderImplant;
if (!shader) {
Expand Down Expand Up @@ -117,14 +117,13 @@ void InstancedBuffer::merge(scene::SubModel *subModel, uint32_t passIdx, gfx::Sh
reflectionProbeType,
reflectionProbeCubemap,
reflectionProbePlanarMap,
reflectionProbeBlendCubemap
);
reflectionProbeBlendCubemap);
}

void InstancedBuffer::appendInstance(InstancedItem &instance,
Uint8Array& buffer,
gfx::Shader *shader,
gfx::DescriptorSet *descriptorSet) {
Uint8Array &buffer,
gfx::Shader *shader,
gfx::DescriptorSet *descriptorSet) {
if (instance.drawInfo.instanceCount >= instance.capacity) { // resize buffers
instance.capacity = std::min(instance.capacity << 1, MAX_CAPACITY);
const auto newSize = instance.stride * instance.capacity;
Expand All @@ -146,17 +145,17 @@ void InstancedBuffer::appendInstance(InstancedItem &instance,
}

void InstancedBuffer::createInstance(const ccstd::string &key,
gfx::InputAssembler *sourceIA,
const ccstd::vector<gfx::Attribute> &attributes,
Uint8Array &buffer,
uint32_t stride,
gfx::Shader *shader,
gfx::DescriptorSet *descriptorSet,
gfx::Texture *lightingMap,
uint32_t reflectionProbeType,
gfx::Texture *reflectionProbeCubemap,
gfx::Texture *reflectionProbePlanarMap,
gfx::Texture *reflectionProbeBlendCubemap) {
gfx::InputAssembler *sourceIA,
const ccstd::vector<gfx::Attribute> &attributes,
Uint8Array &buffer,
uint32_t stride,
gfx::Shader *shader,
gfx::DescriptorSet *descriptorSet,
gfx::Texture *lightingMap,
uint32_t reflectionProbeType,
gfx::Texture *reflectionProbeCubemap,
gfx::Texture *reflectionProbePlanarMap,
gfx::Texture *reflectionProbeBlendCubemap) {
const auto newSize = stride * INITIAL_CAPACITY;
auto *vb = _device->createBuffer({
gfx::BufferUsageBit::VERTEX | gfx::BufferUsageBit::TRANSFER_DST,
Expand Down
28 changes: 14 additions & 14 deletions native/cocos/renderer/pipeline/InstancedBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,21 @@ class InstancedBuffer : public RefCounted {

private:
void appendInstance(InstancedItem &instance,
Uint8Array &buffer,
gfx::Shader *shader,
gfx::DescriptorSet *descriptorSet);
Uint8Array &buffer,
gfx::Shader *shader,
gfx::DescriptorSet *descriptorSet);
void createInstance(const ccstd::string &key,
gfx::InputAssembler *sourceIA,
const ccstd::vector<gfx::Attribute> &attributes,
Uint8Array &buffer,
uint32_t stride,
gfx::Shader *shader,
gfx::DescriptorSet *descriptorSet,
gfx::Texture *lightingMap,
uint32_t reflectionProbeType,
gfx::Texture *reflectionProbeCubemap,
gfx::Texture *reflectionProbePlanarMap,
gfx::Texture *reflectionProbeBlendCubemap);
gfx::InputAssembler *sourceIA,
const ccstd::vector<gfx::Attribute> &attributes,
Uint8Array &buffer,
uint32_t stride,
gfx::Shader *shader,
gfx::DescriptorSet *descriptorSet,
gfx::Texture *lightingMap,
uint32_t reflectionProbeType,
gfx::Texture *reflectionProbeCubemap,
gfx::Texture *reflectionProbePlanarMap,
gfx::Texture *reflectionProbeBlendCubemap);

// weak reference
const scene::Pass *_pass{nullptr};
Expand Down
5 changes: 2 additions & 3 deletions native/cocos/renderer/pipeline/custom/NativeExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#include "details/GslUtils.h"
#include "details/Range.h"
#if CC_USE_DEBUG_RENDERER
#include "cocos/renderer/pipeline/helper/Utils.h"
#include "cocos/renderer/pipeline/helper/Utils.h"
#endif
#if CC_USE_GEOMETRY_RENDERER
#include "cocos/renderer/pipeline/GeometryRenderer.h"
Expand Down Expand Up @@ -796,8 +796,7 @@ struct RenderGraphVisitor : boost::dfs_visitor<> {
}
}
#if CC_USE_DEBUG_RENDERER
if (blit.blitType == BlitType::DRAW_PROFILE)
{
if (blit.blitType == BlitType::DRAW_PROFILE) {
auto* renderPass = ctx.currentPass;
auto* cmdBuff = ctx.cmdBuff;
renderDebugRenderer(renderPass, cmdBuff, ctx.ppl->getPipelineSceneData(), cc::pipeline::profilerCamera);
Expand Down
Loading