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/Sky/Sky.cpp

Diff revisions: vs.
  @@ -6,13 +6,15 @@
6 6 #include "Managers/Headers/SceneManager.h"
7 7 #include "Platform/Video/Headers/GFXDevice.h"
8 8 #include "Geometry/Material/Headers/Material.h"
9 + #include "Platform/File/Headers/FileManagement.h"
9 10 #include "Platform/Video/Headers/RenderStateBlock.h"
10 11 #include "Geometry/Shapes/Headers/Predefined/Sphere3D.h"
11 12
12 13 namespace Divide {
13 14
14 - Sky::Sky(ResourceCache& parentCache, size_t descriptorHash, const stringImpl& name, U32 diameter)
15 + Sky::Sky(GFXDevice& context, ResourceCache& parentCache, size_t descriptorHash, const stringImpl& name, U32 diameter)
15 16 : SceneNode(parentCache, descriptorHash, name, SceneNodeType::TYPE_SKY),
17 + _context(context),
16 18 _sky(nullptr),
17 19 _skyShader(nullptr),
18 20 _skyShaderPrePass(nullptr),
  @@ -129,17 +131,20 @@
129 131 const SceneRenderState& sceneRenderState,
130 132 GenericDrawCommands& drawCommandsInOut) {
131 133
134 + PipelineDescriptor pipeDesc;
135 +
132 136 GenericDrawCommand& cmd = drawCommandsInOut.front();
133 137 if (renderStagePass.pass() == RenderPassType::DEPTH_PASS) {
134 - cmd.stateHash(_skyboxRenderStateHashPrePass);
135 - cmd.shaderProgram(_skyShaderPrePass);
138 + pipeDesc._stateHash = _skyboxRenderStateHashPrePass;
139 + pipeDesc._shaderProgram = _skyShaderPrePass;
136 140 } else {
137 - cmd.stateHash(renderStagePass.stage() == RenderStage::REFLECTION
138 - ? _skyboxRenderStateReflectedHash
139 - : _skyboxRenderStateHash);
140 - cmd.shaderProgram(_skyShader);
141 + pipeDesc._stateHash = (renderStagePass.stage() == RenderStage::REFLECTION
142 + ? _skyboxRenderStateReflectedHash
143 + : _skyboxRenderStateHash);
144 + pipeDesc._shaderProgram = _skyShader;
141 145 }
142 146
147 + cmd.pipeline(_context.newPipeline(pipeDesc));
143 148 SceneNode::updateDrawCommands(sgn, renderStagePass, sceneRenderState, drawCommandsInOut);
144 149 }
145 150