Subversion Repository Public Repository

Divide-Framework

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

Diff Revisions 892 vs 893 for /trunk/Source Code/Environment/Vegetation/Vegetation.cpp

Diff revisions: vs.
  @@ -117,8 +117,8 @@
117 117 setMaterialTpl(vegMaterial);
118 118
119 119 CreateTask(DELEGATE_BIND(&Vegetation::generateGrass, this, std::placeholders::_1),
120 - DELEGATE_BIND(&Vegetation::uploadGrassData, this))
121 - .startTask(Task::TaskPriority::LOW);
120 + DELEGATE_BIND(&Vegetation::uploadGrassData, this))
121 + .startTask(Task::TaskPriority::LOW);
122 122 setState(ResourceState::RES_LOADED);
123 123 }
124 124
  @@ -356,10 +356,13 @@
356 356 _instanceCountGrass * queryID,
357 357 _instanceCountGrass);
358 358
359 + PipelineDescriptor pipeDesc;
360 + pipeDesc._shaderProgram = _cullShader;
361 +
359 362 _cullDrawCommand.cmd().primCount = _instanceCountGrass;
360 363 _cullDrawCommand.enableOption(GenericDrawCommand::RenderOptions::RENDER_NO_RASTERIZE);
361 364 _cullDrawCommand.drawToBuffer(to_U8(queryID));
362 - _cullDrawCommand.shaderProgram(_cullShader);
365 + _cullDrawCommand.pipeline(_context.newPipeline(pipeDesc));
363 366 _cullDrawCommand.sourceBuffer(buffer);
364 367 buffer->incQueryQueue();
365 368
  @@ -380,7 +383,6 @@
380 383 cmd.cmd().firstIndex = 0;
381 384 cmd.cmd().indexCount = 12 * 3;
382 385 cmd.LoD(1);
383 - cmd.stateHash(_grassStateBlockHash);
384 386 drawCommandsInOut.push_back(cmd);
385 387
386 388 SceneNode::initialiseDrawCommands(sgn, renderStagePass, drawCommandsInOut);
  @@ -400,9 +402,14 @@
400 402 buffer->attribDescriptor(instLocation).offset(_instanceCountGrass * queryID);
401 403
402 404 GenericDrawCommand& cmd = drawCommandsOut.front();
405 +
406 + PipelineDescriptor pipeDesc = cmd.pipeline().toDescriptor();
407 + pipeDesc._stateHash = _grassStateBlockHash;
408 + pipeDesc._shaderProgram->Uniform("grassScale", /*_grassScale*/1.0f);
409 +
403 410 cmd.cmd().primCount = buffer->getFeedbackPrimitiveCount(to_U8(queryID));
404 411 cmd.sourceBuffer(buffer);
405 - cmd.shaderProgram()->Uniform("grassScale", /*_grassScale*/1.0f);
412 + cmd.pipeline(_context.newPipeline(pipeDesc));
406 413
407 414 SceneNode::updateDrawCommands(sgn, renderStagePass, sceneRenderState, drawCommandsOut);
408 415 }