2424
2525#include < algorithm>
2626
27- #include " InstancedBuffer.h"
2827#include " Define.h"
28+ #include " InstancedBuffer.h"
29+ #include " base/StringUtil.h"
2930#include " gfx-base/GFXBuffer.h"
3031#include " gfx-base/GFXCommandBuffer.h"
3132#include " gfx-base/GFXDescriptorSet.h"
3233#include " gfx-base/GFXDevice.h"
3334#include " gfx-base/GFXInputAssembler.h"
34- #include " base/StringUtil.h"
3535
3636namespace cc {
3737namespace pipeline {
@@ -71,8 +71,8 @@ void InstancedBuffer::merge(scene::SubModel *subModel, uint32_t passIdx, gfx::Sh
7171 auto *reflectionProbeCubemap = descriptorSet->getTexture (REFLECTIONPROBECUBEMAP ::BINDING );
7272 auto *reflectionProbePlanarMap = descriptorSet->getTexture (REFLECTIONPROBEPLANARMAP ::BINDING );
7373 auto *reflectionProbeBlendCubemap = ENABLE_PROBE_BLEND
74- ? descriptorSet->getTexture (REFLECTIONPROBEBLENDCUBEMAP ::BINDING )
75- : nullptr ;
74+ ? descriptorSet->getTexture (REFLECTIONPROBEBLENDCUBEMAP ::BINDING )
75+ : nullptr ;
7676 const uint32_t reflectionProbeType = subModel->getReflectionProbeType ();
7777 auto *shader = shaderImplant;
7878 if (!shader) {
@@ -117,14 +117,13 @@ void InstancedBuffer::merge(scene::SubModel *subModel, uint32_t passIdx, gfx::Sh
117117 reflectionProbeType,
118118 reflectionProbeCubemap,
119119 reflectionProbePlanarMap,
120- reflectionProbeBlendCubemap
121- );
120+ reflectionProbeBlendCubemap);
122121}
123122
124123void InstancedBuffer::appendInstance (InstancedItem &instance,
125- Uint8Array& buffer,
126- gfx::Shader *shader,
127- gfx::DescriptorSet *descriptorSet) {
124+ Uint8Array & buffer,
125+ gfx::Shader *shader,
126+ gfx::DescriptorSet *descriptorSet) {
128127 if (instance.drawInfo .instanceCount >= instance.capacity ) { // resize buffers
129128 instance.capacity = std::min (instance.capacity << 1 , MAX_CAPACITY );
130129 const auto newSize = instance.stride * instance.capacity ;
@@ -146,17 +145,17 @@ void InstancedBuffer::appendInstance(InstancedItem &instance,
146145}
147146
148147void InstancedBuffer::createInstance (const ccstd::string &key,
149- gfx::InputAssembler *sourceIA,
150- const ccstd::vector<gfx::Attribute> &attributes,
151- Uint8Array &buffer,
152- uint32_t stride,
153- gfx::Shader *shader,
154- gfx::DescriptorSet *descriptorSet,
155- gfx::Texture *lightingMap,
156- uint32_t reflectionProbeType,
157- gfx::Texture *reflectionProbeCubemap,
158- gfx::Texture *reflectionProbePlanarMap,
159- gfx::Texture *reflectionProbeBlendCubemap) {
148+ gfx::InputAssembler *sourceIA,
149+ const ccstd::vector<gfx::Attribute> &attributes,
150+ Uint8Array &buffer,
151+ uint32_t stride,
152+ gfx::Shader *shader,
153+ gfx::DescriptorSet *descriptorSet,
154+ gfx::Texture *lightingMap,
155+ uint32_t reflectionProbeType,
156+ gfx::Texture *reflectionProbeCubemap,
157+ gfx::Texture *reflectionProbePlanarMap,
158+ gfx::Texture *reflectionProbeBlendCubemap) {
160159 const auto newSize = stride * INITIAL_CAPACITY ;
161160 auto *vb = _device->createBuffer ({
162161 gfx::BufferUsageBit::VERTEX | gfx::BufferUsageBit::TRANSFER_DST ,
0 commit comments