History

Remove non batch call to bind/releaseSimpleProgram

Atlante45 committed 11 years ago

Commit 5d2187c1 parent 314486a3 files · +1 −28Browse files

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

Unified · Split

libraries/render-utils/src/DeferredLightingEffect.cpp+0−19
@@ -92,13 +92,6 @@ void DeferredLightingEffect::init(AbstractViewStateInterface* viewState) { · 91 unmodified lines
92 lp->setAmbientSpherePreset(gpu::SphericalHarmonics::Preset(_ambientLightMode % gpu::SphericalHarmonics::NUM_PRESET));92 lp->setAmbientSpherePreset(gpu::SphericalHarmonics::Preset(_ambientLightMode % gpu::SphericalHarmonics::NUM_PRESET));
93}93}
94 94
95void DeferredLightingEffect::bindSimpleProgram() {
96 DependencyManager::get<TextureCache>()->setPrimaryDrawBuffers(true, true, true);
97 _simpleProgram.bind();
98 _simpleProgram.setUniformValue(_glowIntensityLocation, DependencyManager::get<GlowEffect>()->getIntensity());
99 glDisable(GL_BLEND);
100}
101
102void DeferredLightingEffect::bindSimpleProgram(gpu::Batch& batch) {95void DeferredLightingEffect::bindSimpleProgram(gpu::Batch& batch) {
103 DependencyManager::get<TextureCache>()->setPrimaryDrawBuffers(batch, true, true, true);96 DependencyManager::get<TextureCache>()->setPrimaryDrawBuffers(batch, true, true, true);
104 batch._glUseProgram(_simpleProgram.programId());97 batch._glUseProgram(_simpleProgram.programId());
@@ -106,12 +99,6 @@ void DeferredLightingEffect::bindSimpleProgram(gpu::Batch& batch) { · 1 unmodified line
106 batch._glDisable(GL_BLEND);99 batch._glDisable(GL_BLEND);
107}100}
108 101
109void DeferredLightingEffect::releaseSimpleProgram() {
110 glEnable(GL_BLEND);
111 _simpleProgram.release();
112 DependencyManager::get<TextureCache>()->setPrimaryDrawBuffers(true, false, false);
113}
114
115void DeferredLightingEffect::releaseSimpleProgram(gpu::Batch& batch) {102void DeferredLightingEffect::releaseSimpleProgram(gpu::Batch& batch) {
116 batch._glEnable(GL_BLEND);103 batch._glEnable(GL_BLEND);
117 batch._glUseProgram(0);104 batch._glUseProgram(0);
@@ -136,12 +123,6 @@ void DeferredLightingEffect::renderSolidCube(gpu::Batch& batch, float size, cons · 18 unmodified lines
136 releaseSimpleProgram(batch);123 releaseSimpleProgram(batch);
137}124}
138 125
139void DeferredLightingEffect::renderWireCube(float size, const glm::vec4& color) {
140 gpu::Batch batch;
141 renderWireCube(batch, size, color);
142 gpu::GLBackend::renderBatch(batch);
143}
144
145void DeferredLightingEffect::renderWireCube(gpu::Batch& batch, float size, const glm::vec4& color) {126void DeferredLightingEffect::renderWireCube(gpu::Batch& batch, float size, const glm::vec4& color) {
146 bindSimpleProgram(batch);127 bindSimpleProgram(batch);
147 DependencyManager::get<GeometryCache>()->renderWireCube(batch, size, color);128 DependencyManager::get<GeometryCache>()->renderWireCube(batch, size, color);