Showing the changes to libraries/render-utils/src/DeferredLightingEffect.cpp (1 of 2 files). Show all
Unified · Split
| @@ -496,10 +496,11 @@ void DeferredLightingEffect::loadLightProgram(const char* fragSource, bool limit · 495 unmodified lines | ||
| 496 | 496 | GLint loc = -1; |
| 497 | 497 | |
| 498 | 498 | #if (GPU_FEATURE_PROFILE == GPU_CORE) |
| 499 | + const GLint LIGHT_GPU_SLOT = 3; | |
| 499 | 500 | loc = glGetUniformBlockIndex(program.programId(), "lightBuffer"); |
| 500 | 501 | if (loc >= 0) { |
| 501 | − glUniformBlockBinding(program.programId(), loc, 3); | |
| 502 | − locations.lightBufferUnit = 3; | |
| 502 | + glUniformBlockBinding(program.programId(), loc, LIGHT_GPU_SLOT); | |
| 503 | + locations.lightBufferUnit = LIGHT_GPU_SLOT; | |
| 503 | 504 | } else { |
| 504 | 505 | locations.lightBufferUnit = -1; |
| 505 | 506 | } |
| @@ -513,10 +514,11 @@ void DeferredLightingEffect::loadLightProgram(const char* fragSource, bool limit · 7 unmodified lines | ||
| 513 | 514 | #endif |
| 514 | 515 | |
| 515 | 516 | #if (GPU_FEATURE_PROFILE == GPU_CORE) |
| 517 | + const GLint ATMOSPHERE_GPU_SLOT = 4; | |
| 516 | 518 | loc = glGetUniformBlockIndex(program.programId(), "atmosphereBufferUnit"); |
| 517 | 519 | if (loc >= 0) { |
| 518 | − glUniformBlockBinding(program.programId(), loc, 4); | |
| 519 | − locations.atmosphereBufferUnit = 4; | |
| 520 | + glUniformBlockBinding(program.programId(), loc, ATMOSPHERE_GPU_SLOT); | |
| 521 | + locations.atmosphereBufferUnit = ATMOSPHERE_GPU_SLOT; | |
| 520 | 522 | } else { |
| 521 | 523 | locations.atmosphereBufferUnit = -1; |
| 522 | 524 | } |