Skip to content

Commit

Permalink
optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
Try committed Jun 28, 2021
1 parent cf664c2 commit d6a2a01
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion game/graphics/objectsbucket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,8 @@ void ObjectsBucket::drawShadow(Encoder<CommandBuffer>& cmd, uint8_t fId, int lay
void ObjectsBucket::drawCommon(Encoder<CommandBuffer>& cmd, uint8_t fId,
const RenderPipeline& shader, SceneGlobals::VisCamera c) {
UboPush pushBlock = {};
bool sharedSet = false;
bool sharedSet = false;
bool sharedPush = false;

size_t pushSz = (morphAnim!=nullptr) ? sizeof(pushBlock) : sizeof(Tempest::Matrix4x4);
if(shaderType==Pfx)
Expand All @@ -403,6 +404,12 @@ void ObjectsBucket::drawCommon(Encoder<CommandBuffer>& cmd, uint8_t fId,
uboSetDynamic(v,fId);
cmd.setUniforms(shader, v.ubo.ubo[fId][c], &pushBlock, pushSz);
}
else if(shaderType==Landscape) {
if(!sharedPush) {
sharedPush = true;
cmd.setUniforms(shader, uboShared.ubo[fId][c], &pushBlock, pushSz);
}
}
else if(!sharedSet) {
sharedSet = true;
cmd.setUniforms(shader, uboShared.ubo[fId][c], &pushBlock, pushSz);
Expand Down

0 comments on commit d6a2a01

Please sign in to comment.