Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/opengl/gl_debug.cc
| Show First 20 Lines • Show All 201 Lines • ▼ Show 20 Lines | void check_gl_resources(const char *info) | ||||
| /* NOTE: This only check binding. To be valid, the bound ubo needs to | /* NOTE: This only check binding. To be valid, the bound ubo needs to | ||||
| * be big enough to feed the data range the shader awaits. */ | * be big enough to feed the data range the shader awaits. */ | ||||
| uint16_t ubo_needed = interface->enabled_ubo_mask_; | uint16_t ubo_needed = interface->enabled_ubo_mask_; | ||||
| ubo_needed &= ~ctx->bound_ubo_slots; | ubo_needed &= ~ctx->bound_ubo_slots; | ||||
| /* NOTE: This only check binding. To be valid, the bound texture needs to | /* NOTE: This only check binding. To be valid, the bound texture needs to | ||||
| * be the same format/target the shader expects. */ | * be the same format/target the shader expects. */ | ||||
| uint64_t tex_needed = interface->enabled_tex_mask_; | uint64_t tex_needed = interface->enabled_tex_mask_; | ||||
| tex_needed &= ~ctx->state_manager_active_get()->bound_texture_slots(); | tex_needed &= ~GLContext::state_manager_active_get()->bound_texture_slots(); | ||||
| if (ubo_needed == 0 && tex_needed == 0) { | if (ubo_needed == 0 && tex_needed == 0) { | ||||
| return; | return; | ||||
| } | } | ||||
| for (int i = 0; ubo_needed != 0; i++, ubo_needed >>= 1) { | for (int i = 0; ubo_needed != 0; i++, ubo_needed >>= 1) { | ||||
| if ((ubo_needed & 1) != 0) { | if ((ubo_needed & 1) != 0) { | ||||
| const ShaderInput *ubo_input = interface->ubo_get(i); | const ShaderInput *ubo_input = interface->ubo_get(i); | ||||
| Show All 12 Lines | if ((tex_needed & 1) != 0) { | ||||
| const char *sh_name = ctx->shader->name_get(); | const char *sh_name = ctx->shader->name_get(); | ||||
| char msg[256]; | char msg[256]; | ||||
| SNPRINTF(msg, "Missing Texture bind at slot %d : %s > %s : %s", i, sh_name, tex_name, info); | SNPRINTF(msg, "Missing Texture bind at slot %d : %s > %s : %s", i, sh_name, tex_name, info); | ||||
| debug_callback(0, GL_DEBUG_TYPE_ERROR, 0, GL_DEBUG_SEVERITY_HIGH, 0, msg, NULL); | debug_callback(0, GL_DEBUG_TYPE_ERROR, 0, GL_DEBUG_SEVERITY_HIGH, 0, msg, NULL); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void raise_gl_error(const char *msg) | void raise_gl_error(const char *info) | ||||
| { | { | ||||
| debug_callback(0, GL_DEBUG_TYPE_ERROR, 0, GL_DEBUG_SEVERITY_HIGH, 0, msg, NULL); | debug_callback(0, GL_DEBUG_TYPE_ERROR, 0, GL_DEBUG_SEVERITY_HIGH, 0, info, NULL); | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| } // namespace blender::gpu::debug | } // namespace blender::gpu::debug | ||||