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/Rendering/PostFX/CustomOperators/SSAOPreRenderOperator.cpp

Diff revisions: vs.
  @@ -123,10 +123,12 @@
123 123 }
124 124
125 125 void SSAOPreRenderOperator::execute() {
126 + PipelineDescriptor pipelineDescriptor;
127 + pipelineDescriptor._stateHash = _context.getDefaultStateBlock(true);
128 +
126 129 GenericDrawCommand triangleCmd;
127 130 triangleCmd.primitiveType(PrimitiveType::TRIANGLES);
128 131 triangleCmd.drawCount(1);
129 - triangleCmd.stateHash(_context.getDefaultStateBlock(true));
130 132
131 133 _ssaoGenerateShader->Uniform("projectionMatrix", PreRenderOperator::s_mainCamProjectionMatrixCache);
132 134 _ssaoGenerateShader->Uniform("invProjectionMatrix", PreRenderOperator::s_mainCamProjectionMatrixCache.getInverse());
  @@ -139,14 +141,16 @@
139 141 screen->bind(to_U8(ShaderProgram::TextureUsage::NORMALMAP), RTAttachment::Type::Colour, to_U8(GFXDevice::ScreenTargets::NORMALS)); // normals
140 142
141 143 _ssaoOutput._rt->begin(RenderTarget::defaultPolicy());
142 - triangleCmd.shaderProgram(_ssaoGenerateShader);
144 + pipelineDescriptor._shaderProgram = _ssaoGenerateShader;
145 + triangleCmd.pipeline(_context.newPipeline(pipelineDescriptor));
143 146 _context.draw(triangleCmd);
144 147 _ssaoOutput._rt->end();
145 148
146 149
147 150 _ssaoOutput._rt->bind(to_U8(ShaderProgram::TextureUsage::UNIT0), RTAttachment::Type::Colour, 0); // AO texture
148 151 _ssaoOutputBlurred._rt->begin(RenderTarget::defaultPolicy());
149 - triangleCmd.shaderProgram(_ssaoBlurShader);
152 + pipelineDescriptor._shaderProgram = _ssaoBlurShader;
153 + triangleCmd.pipeline(_context.newPipeline(pipelineDescriptor));
150 154 _context.draw(triangleCmd);
151 155 _ssaoOutputBlurred._rt->end();
152 156
  @@ -155,7 +159,8 @@
155 159 _ssaoOutputBlurred._rt->bind(to_U8(ShaderProgram::TextureUsage::UNIT1), RTAttachment::Type::Colour, 0); // AO texture
156 160
157 161 screen->begin(_screenOnlyDraw);
158 - triangleCmd.shaderProgram(_ssaoApplyShader);
162 + pipelineDescriptor._shaderProgram = _ssaoApplyShader;
163 + triangleCmd.pipeline(_context.newPipeline(pipelineDescriptor));
159 164 _context.draw(triangleCmd);
160 165 screen->end();
161 166