shader: handle declaring fragment shader clip distance input.

We weren't always sizing this correctly, so size it properly now.

Tested-by: Jakob Bornecrantz <jakob@collaboa.com>
macos/master
Dave Airlie 7 years ago
parent 6aebabf36c
commit ee13e4b9b7
  1. 2
      src/vrend_renderer.c
  2. 7
      src/vrend_shader.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;
}

@ -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++) {

Loading…
Cancel
Save