mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
@@ -88,6 +88,17 @@ void DescriptorSetAgent::update() {
|
||||
});
|
||||
}
|
||||
|
||||
void DescriptorSetAgent::forceUpdate() {
|
||||
_isDirty = false;
|
||||
ENQUEUE_MESSAGE_1(
|
||||
DeviceAgent::getInstance()->getMessageQueue(),
|
||||
DescriptorSetForceUpdate,
|
||||
actor, getActor(),
|
||||
{
|
||||
actor->forceUpdate();
|
||||
});
|
||||
}
|
||||
|
||||
void DescriptorSetAgent::bindBuffer(uint32_t binding, Buffer *buffer, uint32_t index) {
|
||||
DescriptorSet::bindBuffer(binding, buffer, index);
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ public:
|
||||
~DescriptorSetAgent() override;
|
||||
|
||||
void update() override;
|
||||
void forceUpdate() override;
|
||||
|
||||
void bindBuffer(uint32_t binding, Buffer *buffer, uint32_t index) override;
|
||||
void bindTexture(uint32_t binding, Texture *texture, uint32_t index) override;
|
||||
|
||||
@@ -48,11 +48,6 @@ void DescriptorSet::initialize(const DescriptorSetInfo &info) {
|
||||
doInit(info);
|
||||
}
|
||||
|
||||
void DescriptorSet::forceUpdate() {
|
||||
_isDirty = true;
|
||||
update();
|
||||
}
|
||||
|
||||
void DescriptorSet::destroy() {
|
||||
doDestroy();
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
void destroy();
|
||||
|
||||
virtual void update() = 0;
|
||||
void forceUpdate();
|
||||
virtual void forceUpdate() = 0;
|
||||
|
||||
virtual void bindBuffer(uint32_t binding, Buffer *buffer, uint32_t index);
|
||||
virtual void bindTexture(uint32_t binding, Texture *texture, uint32_t index);
|
||||
|
||||
@@ -37,5 +37,8 @@ void EmptyDescriptorSet::doDestroy() {
|
||||
void EmptyDescriptorSet::update() {
|
||||
}
|
||||
|
||||
void EmptyDescriptorSet::forceUpdate() {
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace cc
|
||||
|
||||
@@ -33,6 +33,7 @@ namespace gfx {
|
||||
class CC_DLL EmptyDescriptorSet final : public DescriptorSet {
|
||||
public:
|
||||
void update() override;
|
||||
void forceUpdate() override;
|
||||
|
||||
protected:
|
||||
void doInit(const DescriptorSetInfo &info) override;
|
||||
|
||||
@@ -94,5 +94,10 @@ void GLES2DescriptorSet::update() {
|
||||
}
|
||||
}
|
||||
|
||||
void GLES2DescriptorSet::forceUpdate() {
|
||||
_isDirty = true;
|
||||
update();
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace cc
|
||||
|
||||
@@ -39,6 +39,7 @@ public:
|
||||
~GLES2DescriptorSet() override;
|
||||
|
||||
void update() override;
|
||||
void forceUpdate() override;
|
||||
|
||||
inline GLES2GPUDescriptorSet *gpuDescriptorSet() const { return _gpuDescriptorSet; }
|
||||
|
||||
|
||||
@@ -86,5 +86,10 @@ void GLES3DescriptorSet::update() {
|
||||
}
|
||||
}
|
||||
|
||||
void GLES3DescriptorSet::forceUpdate() {
|
||||
_isDirty = true;
|
||||
update();
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace cc
|
||||
|
||||
@@ -39,6 +39,7 @@ public:
|
||||
~GLES3DescriptorSet() override;
|
||||
|
||||
void update() override;
|
||||
void forceUpdate() override;
|
||||
|
||||
inline GLES3GPUDescriptorSet *gpuDescriptorSet() const { return _gpuDescriptorSet; }
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ public:
|
||||
CCMTLDescriptorSet &operator=(CCMTLDescriptorSet &&) = delete;
|
||||
|
||||
void update() override;
|
||||
void forceUpdate() override;
|
||||
|
||||
inline CCMTLGPUDescriptorSet *gpuDescriptorSet() const { return _gpuDescriptorSet; }
|
||||
|
||||
|
||||
@@ -86,5 +86,11 @@ void CCMTLDescriptorSet::update() {
|
||||
_isDirty = false;
|
||||
}
|
||||
}
|
||||
|
||||
void CCMTLDescriptorSet::forceUpdate() {
|
||||
_isDirty = true;
|
||||
update();
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace cc
|
||||
|
||||
@@ -105,6 +105,12 @@ void DescriptorSetValidator::update() {
|
||||
_isDirty = false;
|
||||
}
|
||||
|
||||
void DescriptorSetValidator::forceUpdate() {
|
||||
_isDirty = true;
|
||||
_actor->forceUpdate();
|
||||
_isDirty = false;
|
||||
}
|
||||
|
||||
void DescriptorSetValidator::updateReferenceStamp() {
|
||||
_referenceStamp = DeviceValidator::getInstance()->currentFrame();
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ public:
|
||||
~DescriptorSetValidator() override;
|
||||
|
||||
void update() override;
|
||||
void forceUpdate() override;
|
||||
|
||||
void bindBuffer(uint32_t binding, Buffer *buffer, uint32_t index) override;
|
||||
void bindTexture(uint32_t binding, Texture *texture, uint32_t index) override;
|
||||
|
||||
@@ -258,5 +258,10 @@ void CCVKDescriptorSet::update() {
|
||||
}
|
||||
}
|
||||
|
||||
void CCVKDescriptorSet::forceUpdate() {
|
||||
_isDirty = true;
|
||||
update();
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace cc
|
||||
|
||||
@@ -39,6 +39,7 @@ public:
|
||||
~CCVKDescriptorSet() override;
|
||||
|
||||
void update() override;
|
||||
void forceUpdate() override;
|
||||
|
||||
inline CCVKGPUDescriptorSet *gpuDescriptorSet() const { return _gpuDescriptorSet; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user