Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_manager_data.cc
| Show First 20 Lines • Show All 1,708 Lines • ▼ Show 20 Lines | drw_shgroup_uniform_create_ex(shgroup, | ||||
| DRW_UNIFORM_BLOCK, | DRW_UNIFORM_BLOCK, | ||||
| G_draw.clipping_ubo, | G_draw.clipping_ubo, | ||||
| GPU_SAMPLER_DEFAULT, | GPU_SAMPLER_DEFAULT, | ||||
| 0, | 0, | ||||
| 1); | 1); | ||||
| } | } | ||||
| #ifdef DEBUG | #ifdef DEBUG | ||||
| /* TODO(Metal): Support Shader debug print. | |||||
| * This is not currently supported by Metal Backend. */ | |||||
| if (GPU_backend_get_type() != GPU_BACKEND_METAL) { | |||||
| int debug_print_location = GPU_shader_get_builtin_ssbo(shader, GPU_STORAGE_BUFFER_DEBUG_PRINT); | int debug_print_location = GPU_shader_get_builtin_ssbo(shader, GPU_STORAGE_BUFFER_DEBUG_PRINT); | ||||
| if (debug_print_location != -1) { | if (debug_print_location != -1) { | ||||
| GPUStorageBuf *buf = drw_debug_gpu_print_buf_get(); | GPUStorageBuf *buf = drw_debug_gpu_print_buf_get(); | ||||
| drw_shgroup_uniform_create_ex( | drw_shgroup_uniform_create_ex(shgroup, | ||||
| shgroup, debug_print_location, DRW_UNIFORM_STORAGE_BLOCK, buf, GPU_SAMPLER_DEFAULT, 0, 1); | debug_print_location, | ||||
| DRW_UNIFORM_STORAGE_BLOCK, | |||||
| buf, | |||||
| GPU_SAMPLER_DEFAULT, | |||||
| 0, | |||||
| 1); | |||||
| # ifndef DISABLE_DEBUG_SHADER_PRINT_BARRIER | # ifndef DISABLE_DEBUG_SHADER_PRINT_BARRIER | ||||
| /* Add a barrier to allow multiple shader writing to the same buffer. */ | /* Add a barrier to allow multiple shader writing to the same buffer. */ | ||||
| DRW_shgroup_barrier(shgroup, GPU_BARRIER_SHADER_STORAGE); | DRW_shgroup_barrier(shgroup, GPU_BARRIER_SHADER_STORAGE); | ||||
| # endif | # endif | ||||
| } | } | ||||
| int debug_draw_location = GPU_shader_get_builtin_ssbo(shader, GPU_STORAGE_BUFFER_DEBUG_VERTS); | int debug_draw_location = GPU_shader_get_builtin_ssbo(shader, GPU_STORAGE_BUFFER_DEBUG_VERTS); | ||||
| if (debug_draw_location != -1) { | if (debug_draw_location != -1) { | ||||
| GPUStorageBuf *buf = drw_debug_gpu_draw_buf_get(); | GPUStorageBuf *buf = drw_debug_gpu_draw_buf_get(); | ||||
| drw_shgroup_uniform_create_ex( | drw_shgroup_uniform_create_ex( | ||||
| shgroup, debug_draw_location, DRW_UNIFORM_STORAGE_BLOCK, buf, GPU_SAMPLER_DEFAULT, 0, 1); | shgroup, debug_draw_location, DRW_UNIFORM_STORAGE_BLOCK, buf, GPU_SAMPLER_DEFAULT, 0, 1); | ||||
| /* NOTE(fclem): No barrier as ordering is not important. */ | /* NOTE(fclem): No barrier as ordering is not important. */ | ||||
| } | } | ||||
| } | |||||
| #endif | #endif | ||||
| /* Not supported. */ | /* Not supported. */ | ||||
| BLI_assert(GPU_shader_get_builtin_uniform(shader, GPU_UNIFORM_MODELVIEW_INV) == -1); | BLI_assert(GPU_shader_get_builtin_uniform(shader, GPU_UNIFORM_MODELVIEW_INV) == -1); | ||||
| BLI_assert(GPU_shader_get_builtin_uniform(shader, GPU_UNIFORM_MODELVIEW) == -1); | BLI_assert(GPU_shader_get_builtin_uniform(shader, GPU_UNIFORM_MODELVIEW) == -1); | ||||
| BLI_assert(GPU_shader_get_builtin_uniform(shader, GPU_UNIFORM_NORMAL) == -1); | BLI_assert(GPU_shader_get_builtin_uniform(shader, GPU_UNIFORM_NORMAL) == -1); | ||||
| BLI_assert(GPU_shader_get_builtin_uniform(shader, GPU_UNIFORM_VIEW) == -1); | BLI_assert(GPU_shader_get_builtin_uniform(shader, GPU_UNIFORM_VIEW) == -1); | ||||
| BLI_assert(GPU_shader_get_builtin_uniform(shader, GPU_UNIFORM_VIEW_INV) == -1); | BLI_assert(GPU_shader_get_builtin_uniform(shader, GPU_UNIFORM_VIEW_INV) == -1); | ||||
| ▲ Show 20 Lines • Show All 790 Lines • Show Last 20 Lines | |||||