- const struct brw_compiler *compiler = brw->intelScreen->compiler;
- GLuint program_size;
- const GLuint *program;
- struct brw_vs_prog_data prog_data;
- struct brw_stage_prog_data *stage_prog_data = &prog_data.base.base;
- void *mem_ctx;
- int i;
- struct brw_shader *vs = NULL;
- bool start_busy = false;
- double start_time = 0;
-
- if (prog)
- vs = (struct brw_shader *) prog->_LinkedShaders[MESA_SHADER_VERTEX];
-
- memset(&prog_data, 0, sizeof(prog_data));
-
- /* Use ALT floating point mode for ARB programs so that 0^0 == 1. */
- if (!prog)
- stage_prog_data->use_alt_mode = true;
-
- mem_ctx = ralloc_context(NULL);
-
- brw_assign_common_binding_table_offsets(MESA_SHADER_VERTEX,
- brw->intelScreen->devinfo,
- prog, &vp->program.Base,
- &prog_data.base.base, 0);
-
- /* Allocate the references to the uniforms that will end up in the
- * prog_data associated with the compiled program, and which will be freed
- * by the state cache.
- */
- int param_count = vp->program.Base.nir->num_uniforms;
- if (!compiler->scalar_stage[MESA_SHADER_VERTEX])
- param_count *= 4;
-
- if (vs)
- prog_data.base.base.nr_image_params = vs->base.NumImages;
-
- /* vec4_visitor::setup_uniform_clipplane_values() also uploads user clip
- * planes as uniforms.
- */
- param_count += key->nr_userclip_plane_consts * 4;
-
- stage_prog_data->param =
- rzalloc_array(NULL, const gl_constant_value *, param_count);
- stage_prog_data->pull_param =
- rzalloc_array(NULL, const gl_constant_value *, param_count);
- stage_prog_data->image_param =
- rzalloc_array(NULL, struct brw_image_param,
- stage_prog_data->nr_image_params);
- stage_prog_data->nr_params = param_count;
-
- if (prog) {
- brw_nir_setup_glsl_uniforms(vp->program.Base.nir, prog, &vp->program.Base,
- &prog_data.base.base,
- compiler->scalar_stage[MESA_SHADER_VERTEX]);
+ if (ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX]) {
+ /* There is currently a GLSL vertex shader, so clip according to GLSL
+ * rules, which means compare gl_ClipVertex (or gl_Position, if
+ * gl_ClipVertex wasn't assigned) against the eye-coordinate clip planes
+ * that were stored in EyeUserPlane at the time the clip planes were
+ * specified.
+ */
+ return ctx->Transform.EyeUserPlane;