History

Replacing setUniformTexture by setResourceTexture in order to differenciate the 2 types of binding points for the BUffers.

Sam Gateau committed 11 years ago

Commit 7fc9fd91 parent cac239a15 files · +38 −38Browse files

Showing the changes to libraries/render-utils/src/DeferredLightingEffect.cpp (1 of 15 files). Show all

Unified · Split

libraries/render-utils/src/DeferredLightingEffect.cpp+14−14
@@ -147,7 +147,7 @@ void DeferredLightingEffect::bindSimpleProgram(gpu::Batch& batch, bool textured, · 146 unmodified lines
147147
148148 if (!config.isTextured()) {
149149 // If it is not textured, bind white texture and keep using textured pipeline
150− batch.setUniformTexture(0, DependencyManager::get<TextureCache>()->getWhiteTexture());
150+ batch.setResourceTexture(0, DependencyManager::get<TextureCache>()->getWhiteTexture());
151151 }
152152 }
153153
@@ -244,13 +244,13 @@ void DeferredLightingEffect::render(RenderArgs* args) { · 90 unmodified lines
244244
245245 batch.clearColorFramebuffer(freeFBO->getBufferMask(), glm::vec4(0.0f, 0.0f, 0.0f, 0.0f));
246246
247− batch.setUniformTexture(0, textureCache->getPrimaryColorTexture());
247+ batch.setResourceTexture(0, textureCache->getPrimaryColorTexture());
248248
249− batch.setUniformTexture(1, textureCache->getPrimaryNormalTexture());
249+ batch.setResourceTexture(1, textureCache->getPrimaryNormalTexture());
250250
251− batch.setUniformTexture(2, textureCache->getPrimarySpecularTexture());
251+ batch.setResourceTexture(2, textureCache->getPrimarySpecularTexture());
252252
253− batch.setUniformTexture(3, textureCache->getPrimaryDepthTexture());
253+ batch.setResourceTexture(3, textureCache->getPrimaryDepthTexture());
254254
255255 // get the viewport side (left, right, both)
256256 int viewport[4];
@@ -275,7 +275,7 @@ void DeferredLightingEffect::render(RenderArgs* args) { · 18 unmodified lines
275275 const LightLocations* locations = &_directionalLightLocations;
276276 bool shadowsEnabled = _viewState->getShadowsEnabled();
277277 if (shadowsEnabled) {
278− batch.setUniformTexture(4, textureCache->getShadowFramebuffer()->getDepthStencilBuffer());
278+ batch.setResourceTexture(4, textureCache->getShadowFramebuffer()->getDepthStencilBuffer());
279279
280280 program = _directionalLightShadowMap;
281281 locations = &_directionalLightShadowMapLocations;
@@ -329,7 +329,7 @@ void DeferredLightingEffect::render(RenderArgs* args) { · 47 unmodified lines
329329 }
330330
331331 if (useSkyboxCubemap) {
332− batch.setUniformTexture(5, _skybox->getCubemap());
332+ batch.setResourceTexture(5, _skybox->getCubemap());
333333 }
334334
335335 if (locations->lightBufferUnit >= 0) {
@@ -377,11 +377,11 @@ void DeferredLightingEffect::render(RenderArgs* args) { · 41 unmodified lines
377377 }
378378
379379 if (useSkyboxCubemap) {
380− batch.setUniformTexture(5, nullptr);
380+ batch.setResourceTexture(5, nullptr);
381381 }
382382
383383 if (shadowsEnabled) {
384− batch.setUniformTexture(4, nullptr);
384+ batch.setResourceTexture(4, nullptr);
385385 }
386386
387387 glm::vec4 sCoefficients(sWidth / 2.0f, 0.0f, 0.0f, sMin + sWidth / 2.0f);
@@ -530,10 +530,10 @@ void DeferredLightingEffect::render(RenderArgs* args) { · 142 unmodified lines
530530 }
531531
532532 // Probably not necessary in the long run because the gpu layer would unbound this texture if used as render target
533− batch.setUniformTexture(0, nullptr);
534− batch.setUniformTexture(1, nullptr);
535− batch.setUniformTexture(2, nullptr);
536− batch.setUniformTexture(3, nullptr);
533+ batch.setResourceTexture(0, nullptr);
534+ batch.setResourceTexture(1, nullptr);
535+ batch.setResourceTexture(2, nullptr);
536+ batch.setResourceTexture(3, nullptr);
537537
538538 args->_context->syncCache();
539539 args->_context->render(batch);
@@ -551,7 +551,7 @@ void DeferredLightingEffect::copyBack(RenderArgs* args) { · 11 unmodified lines
551551 batch.setFramebuffer(textureCache->getPrimaryFramebuffer());
552552 batch.setPipeline(_blitLightBuffer);
553553
554− batch.setUniformTexture(0, freeFBO->getRenderBuffer(0));
554+ batch.setResourceTexture(0, freeFBO->getRenderBuffer(0));
555555
556556 batch.setProjectionTransform(glm::mat4());
557557 batch.setViewTransform(Transform());