diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index d1be721..038a9dc 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -2127,7 +2127,7 @@ static inline void vrend_fill_shader_key(struct vrend_context *ctx, if (ctx->sub->shaders[PIPE_SHADER_GEOMETRY]) key->gs_present = true; - if (type == PIPE_SHADER_GEOMETRY && ctx->sub->shaders[PIPE_SHADER_VERTEX]) { + if ((type == PIPE_SHADER_GEOMETRY || type == PIPE_SHADER_FRAGMENT) && ctx->sub->shaders[PIPE_SHADER_VERTEX]) { key->prev_stage_pervertex_out = ctx->sub->shaders[PIPE_SHADER_VERTEX]->sinfo.has_pervertex_out; key->prev_stage_num_clip_out = ctx->sub->shaders[PIPE_SHADER_VERTEX]->sinfo.num_clip_out; } diff --git a/src/vrend_shader.c b/src/vrend_shader.c index 21717f1..a7afb83 100644 --- a/src/vrend_shader.c +++ b/src/vrend_shader.c @@ -2566,6 +2566,13 @@ static char *emit_ios(struct dump_ctx *ctx, char *glsl_hdr) } } + if (ctx->prog_type == TGSI_PROCESSOR_FRAGMENT && ctx->num_in_clip_dist) { + if (ctx->key->prev_stage_num_clip_out) { + snprintf(buf, 255, "in float gl_ClipDistance[%d];\n", ctx->key->prev_stage_num_clip_out); + STRCAT_WITH_RET(glsl_hdr, buf); + } + } + if (ctx->so) { char outtype[6] = {0}; for (i = 0; i < ctx->so->num_outputs; i++) {