Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/intern/gpu_select_sample_query.c
| Show First 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | void gpu_select_query_begin( | ||||
| * get rejected before the depth test. Should probably cull rect against | * get rejected before the depth test. Should probably cull rect against | ||||
| * the viewport but this is a rare case I think */ | * the viewport but this is a rare case I think */ | ||||
| glGetFloatv(GL_VIEWPORT, viewport); | glGetFloatv(GL_VIEWPORT, viewport); | ||||
| glViewport(viewport[0], viewport[1], BLI_rcti_size_x(input), BLI_rcti_size_y(input)); | glViewport(viewport[0], viewport[1], BLI_rcti_size_x(input), BLI_rcti_size_y(input)); | ||||
| /* occlusion queries operates on fragments that pass tests and since we are interested on all | /* occlusion queries operates on fragments that pass tests and since we are interested on all | ||||
| * objects in the view frustum independently of their order, we need to disable the depth test */ | * objects in the view frustum independently of their order, we need to disable the depth test */ | ||||
| if (mode == GPU_SELECT_ALL) { | if (mode == GPU_SELECT_ALL) { | ||||
| glDisable(GL_DEPTH_TEST); | /* glQueries on Windows+Intel drivers only works with depth testing turned on. | ||||
| glDepthMask(GL_FALSE); | * See T62947 for details */ | ||||
| glEnable(GL_DEPTH_TEST); | |||||
| glDepthFunc(GL_ALWAYS); | |||||
| glDepthMask(GL_TRUE); | |||||
| } | } | ||||
| else if (mode == GPU_SELECT_NEAREST_FIRST_PASS) { | else if (mode == GPU_SELECT_NEAREST_FIRST_PASS) { | ||||
| glClear(GL_DEPTH_BUFFER_BIT); | glClear(GL_DEPTH_BUFFER_BIT); | ||||
| glEnable(GL_DEPTH_TEST); | glEnable(GL_DEPTH_TEST); | ||||
| glDepthMask(GL_TRUE); | glDepthMask(GL_TRUE); | ||||
| glDepthFunc(GL_LEQUAL); | glDepthFunc(GL_LEQUAL); | ||||
| } | } | ||||
| else if (mode == GPU_SELECT_NEAREST_SECOND_PASS) { | else if (mode == GPU_SELECT_NEAREST_SECOND_PASS) { | ||||
| ▲ Show 20 Lines • Show All 104 Lines • Show Last 20 Lines | |||||