Subversion Repository Public Repository

Divide-Framework

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

Diff Revisions 890 vs 893 for /trunk/Source Code/Rendering/PostFX/CustomOperators/BloomPreRenderOperator.cpp

Diff revisions: vs.
  @@ -69,10 +69,12 @@
69 69
70 70 // Order: luminance calc -> bloom -> tonemap
71 71 void BloomPreRenderOperator::execute() {
72 + PipelineDescriptor pipelineDescriptor;
73 + pipelineDescriptor._stateHash = _context.getDefaultStateBlock(true);
74 +
72 75 GenericDrawCommand triangleCmd;
73 76 triangleCmd.primitiveType(PrimitiveType::TRIANGLES);
74 77 triangleCmd.drawCount(1);
75 - triangleCmd.stateHash(_context.getDefaultStateBlock(true));
76 78
77 79 RenderTarget* screen = &_parent.inputRT();
78 80
  @@ -81,7 +83,8 @@
81 83
82 84 // render all of the "bright spots"
83 85 _bloomOutput._rt->begin(RenderTarget::defaultPolicy());
84 - triangleCmd.shaderProgram(_bloomCalc);
86 + pipelineDescriptor._shaderProgram = _bloomCalc;
87 + triangleCmd.pipeline(_context.newPipeline(pipelineDescriptor));
85 88 _context.draw(triangleCmd);
86 89 _bloomOutput._rt->end();
87 90
  @@ -91,7 +94,8 @@
91 94 _blur->SetSubroutine(ShaderType::FRAGMENT, _horizBlur);
92 95 _bloomOutput._rt->bind(to_U8(ShaderProgram::TextureUsage::UNIT0), RTAttachment::Type::Colour, 0);
93 96 _bloomBlurBuffer[0]._rt->begin(RenderTarget::defaultPolicy());
94 - triangleCmd.shaderProgram(_blur);
97 + pipelineDescriptor._shaderProgram = _blur;
98 + triangleCmd.pipeline(_context.newPipeline(pipelineDescriptor));
95 99 _context.draw(triangleCmd);
96 100 _bloomBlurBuffer[0]._rt->end();
97 101
  @@ -99,7 +103,6 @@
99 103 _blur->SetSubroutine(ShaderType::FRAGMENT, _vertBlur);
100 104 _bloomBlurBuffer[0]._rt->bind(to_U8(ShaderProgram::TextureUsage::UNIT0), RTAttachment::Type::Colour, 0);
101 105 _bloomBlurBuffer[1]._rt->begin(RenderTarget::defaultPolicy());
102 - triangleCmd.shaderProgram(_blur);
103 106 _context.draw(triangleCmd);
104 107 _bloomBlurBuffer[1]._rt->end();
105 108
  @@ -108,7 +111,8 @@
108 111 _bloomBlurBuffer[0]._rt->bind(to_U8(ShaderProgram::TextureUsage::UNIT0), RTAttachment::Type::Colour, 0); //Screen
109 112 _bloomBlurBuffer[1]._rt->bind(to_U8(ShaderProgram::TextureUsage::UNIT1), RTAttachment::Type::Colour, 0); //Bloom
110 113 screen->begin(_screenOnlyDraw);
111 - triangleCmd.shaderProgram(_bloomApply);
114 + pipelineDescriptor._shaderProgram = _bloomApply;
115 + triangleCmd.pipeline(_context.newPipeline(pipelineDescriptor));
112 116 _context.draw(triangleCmd);
113 117 screen->end();
114 118 }