Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_manager_exec.c
| Show First 20 Lines • Show All 229 Lines • ▼ Show 20 Lines | /* Stencil Test */ | ||||
| } | } | ||||
| } | } | ||||
| /* Wire Width */ | /* Wire Width */ | ||||
| { | { | ||||
| int test; | int test; | ||||
| if ((test = CHANGED_TO(DRW_STATE_WIRE_SMOOTH))) { | if ((test = CHANGED_TO(DRW_STATE_WIRE_SMOOTH))) { | ||||
| if (test == 1) { | if (test == 1) { | ||||
| GPU_line_width(2.0f); | |||||
| GPU_line_smooth(true); | GPU_line_smooth(true); | ||||
| } | } | ||||
| else { | else { | ||||
| GPU_line_width(1.0f); | |||||
| GPU_line_smooth(false); | GPU_line_smooth(false); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* Blending (all buffer) */ | /* Blending (all buffer) */ | ||||
| { | { | ||||
| int test; | int test; | ||||
| ▲ Show 20 Lines • Show All 938 Lines • ▼ Show 20 Lines | static void draw_call_batching_finish(DRWShadingGroup *shgroup, DRWCommandsState *state) | ||||
| if (state->obmats_loc != -1) { | if (state->obmats_loc != -1) { | ||||
| GPU_uniformbuffer_unbind(DST.vmempool->matrices_ubo[state->resource_chunk]); | GPU_uniformbuffer_unbind(DST.vmempool->matrices_ubo[state->resource_chunk]); | ||||
| } | } | ||||
| if (state->obinfos_loc != -1) { | if (state->obinfos_loc != -1) { | ||||
| GPU_uniformbuffer_unbind(DST.vmempool->obinfos_ubo[state->resource_chunk]); | GPU_uniformbuffer_unbind(DST.vmempool->obinfos_ubo[state->resource_chunk]); | ||||
| } | } | ||||
| } | } | ||||
| static void draw_shgroup(DRWShadingGroup *shgroup, DRWState pass_state) | static void draw_shgroup(DRWShadingGroup *shgroup, DRWState pass_state, float line_width) | ||||
| { | { | ||||
| BLI_assert(shgroup->shader); | BLI_assert(shgroup->shader); | ||||
| DRWCommandsState state = { | DRWCommandsState state = { | ||||
| .obmats_loc = -1, | .obmats_loc = -1, | ||||
| .obinfos_loc = -1, | .obinfos_loc = -1, | ||||
| .baseinst_loc = -1, | .baseinst_loc = -1, | ||||
| .chunkid_loc = -1, | .chunkid_loc = -1, | ||||
| Show All 21 Lines | static void draw_shgroup(DRWShadingGroup *shgroup, DRWState pass_state, float line_width) | ||||
| } | } | ||||
| release_ubo_slots(shader_changed); | release_ubo_slots(shader_changed); | ||||
| release_texture_slots(shader_changed); | release_texture_slots(shader_changed); | ||||
| draw_update_uniforms(shgroup, &state, &use_tfeedback); | draw_update_uniforms(shgroup, &state, &use_tfeedback); | ||||
| drw_state_set(pass_state); | drw_state_set(pass_state); | ||||
| if (pass_state & DRW_STATE_WIRE_SMOOTH) { | |||||
| GPU_line_width(line_width); | |||||
| } | |||||
| /* Rendering Calls */ | /* Rendering Calls */ | ||||
| { | { | ||||
| DRWCommandIterator iter; | DRWCommandIterator iter; | ||||
| DRWCommand *cmd; | DRWCommand *cmd; | ||||
| eDRWCommandType cmd_type; | eDRWCommandType cmd_type; | ||||
| draw_command_iter_begin(&iter, shgroup); | draw_command_iter_begin(&iter, shgroup); | ||||
| ▲ Show 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | static void drw_draw_pass_ex(DRWPass *pass, | ||||
| drw_state_set(DST.state | DRW_STATE_WRITE_DEPTH | DRW_STATE_WRITE_COLOR); | drw_state_set(DST.state | DRW_STATE_WRITE_DEPTH | DRW_STATE_WRITE_COLOR); | ||||
| drw_state_set(pass->state); | drw_state_set(pass->state); | ||||
| drw_state_validate(); | drw_state_validate(); | ||||
| DRW_stats_query_start(pass->name); | DRW_stats_query_start(pass->name); | ||||
| for (DRWShadingGroup *shgroup = start_group; shgroup; shgroup = shgroup->next) { | for (DRWShadingGroup *shgroup = start_group; shgroup; shgroup = shgroup->next) { | ||||
| draw_shgroup(shgroup, pass->state); | draw_shgroup(shgroup, pass->state, pass->line_width); | ||||
| /* break if upper limit */ | /* break if upper limit */ | ||||
| if (shgroup == end_group) { | if (shgroup == end_group) { | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| /* Clear Bound textures */ | /* Clear Bound textures */ | ||||
| for (int i = 0; i < DST_MAX_SLOTS; i++) { | for (int i = 0; i < DST_MAX_SLOTS; i++) { | ||||
| ▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines | |||||