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 | GLint loc = -1; | 496 | GLint loc = -1; |
| 497 | 497 | ||
| 498 | #if (GPU_FEATURE_PROFILE == GPU_CORE) | 498 | #if (GPU_FEATURE_PROFILE == GPU_CORE) |
| 499 | const GLint LIGHT_GPU_SLOT = 3; | ||
| 499 | loc = glGetUniformBlockIndex(program.programId(), "lightBuffer"); | 500 | loc = glGetUniformBlockIndex(program.programId(), "lightBuffer"); |
| 500 | if (loc >= 0) { | 501 | if (loc >= 0) { |
| 501 | glUniformBlockBinding(program.programId(), loc, 3); | 502 | glUniformBlockBinding(program.programId(), loc, LIGHT_GPU_SLOT); |
| 502 | locations.lightBufferUnit = 3; | 503 | locations.lightBufferUnit = LIGHT_GPU_SLOT; |
| 503 | } else { | 504 | } else { |
| 504 | locations.lightBufferUnit = -1; | 505 | locations.lightBufferUnit = -1; |
| 505 | } | 506 | } |
| @@ -513,10 +514,11 @@ void DeferredLightingEffect::loadLightProgram(const char* fragSource, bool limit · 7 unmodified lines | |||
| 513 | #endif | 514 | #endif |
| 514 | 515 | ||
| 515 | #if (GPU_FEATURE_PROFILE == GPU_CORE) | 516 | #if (GPU_FEATURE_PROFILE == GPU_CORE) |
| 517 | const GLint ATMOSPHERE_GPU_SLOT = 4; | ||
| 516 | loc = glGetUniformBlockIndex(program.programId(), "atmosphereBufferUnit"); | 518 | loc = glGetUniformBlockIndex(program.programId(), "atmosphereBufferUnit"); |
| 517 | if (loc >= 0) { | 519 | if (loc >= 0) { |
| 518 | glUniformBlockBinding(program.programId(), loc, 4); | 520 | glUniformBlockBinding(program.programId(), loc, ATMOSPHERE_GPU_SLOT); |
| 519 | locations.atmosphereBufferUnit = 4; | 521 | locations.atmosphereBufferUnit = ATMOSPHERE_GPU_SLOT; |
| 520 | } else { | 522 | } else { |
| 521 | locations.atmosphereBufferUnit = -1; | 523 | locations.atmosphereBufferUnit = -1; |
| 522 | } | 524 | } |