Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 947 vs 948 for /trunk/Source Code/Environment/Vegetation/Vegetation.cpp

Diff revisions: vs.
  @@ -383,28 +383,31 @@
383 383 cmd.LoD(1);
384 384 GFX::DrawCommand drawCommand;
385 385 drawCommand._drawCommands.push_back(cmd);
386 - GFX::AddDrawCommands(pkgInOut.commands(), drawCommand);
386 + pkgInOut.addDrawCommand(drawCommand);
387 387
388 - const vectorImpl<Pipeline*>& pipelines = pkgInOut.commands().getPipelines();
389 - PipelineDescriptor pipeDesc = pipelines.front()->toDescriptor();
388 + const Pipeline& pipeline = pkgInOut.pipeline(0);
389 + PipelineDescriptor pipeDesc = pipeline.toDescriptor();
390 390 pipeDesc._stateHash = _grassStateBlockHash;
391 - pipelines.front()->fromDescriptor(pipeDesc);
391 + pkgInOut.pipeline(0, _context.newPipeline(pipeDesc));
392 392
393 - PushConstants& constants = *pkgInOut.commands().getPushConstants().front();
393 + PushConstants constants = pkgInOut.pushConstants(0);
394 394 constants.set("grassScale", PushConstantType::FLOAT, 1.0f);
395 395 constants.set("positionOffsets", PushConstantType::VEC3, _grassBlades);
396 396 constants.set("texCoordOffsets", PushConstantType::VEC2, _texCoord);
397 397 constants.set("rotationMatrices", PushConstantType::MAT3, _rotationMatrices, true);
398 398 constants.set("lod_metric", PushConstantType::FLOAT, 100.0f);
399 + pkgInOut.pushConstants(0, constants);
399 400
400 401 SceneNode::buildDrawCommands(sgn, renderStagePass, pkgInOut);
401 402 }
402 403
403 - void Vegetation::updateDrawCommands(SceneGraphNode& sgn,
404 - const RenderStagePass& renderStagePass,
405 - const SceneRenderState& sceneRenderState,
406 - RenderPackage& pkgInOut) {
404 + bool Vegetation::onRender(SceneGraphNode& sgn,
405 + const SceneRenderState& sceneRenderState,
406 + const RenderStagePass& renderStagePass) {
407 + RenderingComponent* renderComp = sgn.get<RenderingComponent>();
408 + RenderPackage& pkg = renderComp->getDrawPackage(renderStagePass);
407 409
410 + ACKNOWLEDGE_UNUSED(sceneRenderState);
408 411 GenericVertexData* buffer = _grassGPUBuffer[_readBuffer];
409 412 U32 queryID = getQueryID();
410 413 gpuCull(sceneRenderState);
  @@ -413,14 +416,11 @@
413 416 buffer->attribDescriptor(scaleLocation).offset(_instanceCountGrass * queryID);
414 417 buffer->attribDescriptor(instLocation).offset(_instanceCountGrass * queryID);
415 418
416 - GenericDrawCommand* cmd = pkgInOut.commands().getDrawCommands().front();
417 - cmd->cmd().primCount = buffer->getFeedbackPrimitiveCount(to_U8(queryID));
418 - cmd->sourceBuffer(buffer);
419 -
420 - SceneNode::updateDrawCommands(sgn, renderStagePass, sceneRenderState, pkgInOut);
421 - }
422 -
423 - bool Vegetation::onRender(const RenderStagePass& renderStagePass) {
419 + GenericDrawCommand cmd = pkg.drawCommand(0);
420 + cmd.cmd().primCount = buffer->getFeedbackPrimitiveCount(to_U8(queryID));
421 + cmd.sourceBuffer(buffer);
422 + pkg.drawCommand(0, cmd);
423 +
424 424 _staticDataUpdated = false;
425 425 return !(!_render || !_success || !_threadedLoadComplete ||
426 426 _parentLoD > 0 ||