shader: rename some shader info and key vars.

These names reflect more of the meaning, and allow for tuning
some stuff.

Tested-by: Jakob Bornecrantz <jakob@collabora.com>
macos/master
Dave Airlie 7 years ago
parent 74d3e0f2cf
commit 6aebabf36c
  1. 4
      src/vrend_renderer.c
  2. 9
      src/vrend_shader.c
  3. 7
      src/vrend_shader.h

@ -2128,8 +2128,8 @@ static inline void vrend_fill_shader_key(struct vrend_context *ctx,
key->gs_present = true; key->gs_present = true;
if (type == PIPE_SHADER_GEOMETRY && ctx->sub->shaders[PIPE_SHADER_VERTEX]) { if (type == PIPE_SHADER_GEOMETRY && ctx->sub->shaders[PIPE_SHADER_VERTEX]) {
key->vs_has_pervertex = ctx->sub->shaders[PIPE_SHADER_VERTEX]->sinfo.num_pervertex_clip > 0; key->prev_stage_pervertex_out = ctx->sub->shaders[PIPE_SHADER_VERTEX]->sinfo.has_pervertex_out;
key->vs_pervertex_num_clip = ctx->sub->shaders[PIPE_SHADER_VERTEX]->sinfo.num_pervertex_clip; key->prev_stage_num_clip_out = ctx->sub->shaders[PIPE_SHADER_VERTEX]->sinfo.num_clip_out;
} }
} }

@ -2545,11 +2545,11 @@ static char *emit_ios(struct dump_ctx *ctx, char *glsl_hdr)
if (ctx->prog_type == TGSI_PROCESSOR_GEOMETRY) { if (ctx->prog_type == TGSI_PROCESSOR_GEOMETRY) {
snprintf(buf, 255, "uniform float winsys_adjust_y;\n"); snprintf(buf, 255, "uniform float winsys_adjust_y;\n");
STRCAT_WITH_RET(glsl_hdr, buf); STRCAT_WITH_RET(glsl_hdr, buf);
if (ctx->num_in_clip_dist || ctx->key->clip_plane_enable || ctx->key->vs_has_pervertex) { if (ctx->num_in_clip_dist || ctx->key->clip_plane_enable || ctx->key->prev_stage_pervertex_out) {
int clip_dist; int clip_dist;
if (ctx->key->vs_has_pervertex) if (ctx->key->prev_stage_pervertex_out)
clip_dist = ctx->key->vs_pervertex_num_clip; clip_dist = ctx->key->prev_stage_num_clip_out;
else if (ctx->num_in_clip_dist) else if (ctx->num_in_clip_dist)
clip_dist = ctx->num_in_clip_dist; clip_dist = ctx->num_in_clip_dist;
else else
@ -2772,7 +2772,8 @@ char *vrend_convert_shader(struct vrend_shader_cfg *cfg,
free(ctx.glsl_main); free(ctx.glsl_main);
free(glsl_hdr); free(glsl_hdr);
sinfo->num_ucp = ctx.key->clip_plane_enable ? 8 : 0; sinfo->num_ucp = ctx.key->clip_plane_enable ? 8 : 0;
sinfo->num_pervertex_clip = (ctx.vs_has_pervertex ? (ctx.num_clip_dist ? ctx.num_clip_dist : 8) : 0); sinfo->has_pervertex_out = ctx.vs_has_pervertex;
sinfo->num_clip_out = (ctx.num_clip_dist ? ctx.num_clip_dist : 8);
sinfo->samplers_used_mask = ctx.samplers_used; sinfo->samplers_used_mask = ctx.samplers_used;
sinfo->num_consts = ctx.num_consts; sinfo->num_consts = ctx.num_consts;
sinfo->num_ubos = ctx.num_ubo; sinfo->num_ubos = ctx.num_ubo;

@ -43,7 +43,8 @@ struct vrend_shader_info {
int num_ubos; int num_ubos;
int num_ucp; int num_ucp;
int glsl_ver; int glsl_ver;
uint8_t num_pervertex_clip; bool has_pervertex_out;
uint8_t num_clip_out;
uint32_t shadow_samp_mask; uint32_t shadow_samp_mask;
int gs_out_prim; int gs_out_prim;
uint32_t attrib_input_mask; uint32_t attrib_input_mask;
@ -63,8 +64,8 @@ struct vrend_shader_key {
uint8_t clip_plane_enable; uint8_t clip_plane_enable;
bool gs_present; bool gs_present;
bool flatshade; bool flatshade;
bool vs_has_pervertex; bool prev_stage_pervertex_out;
uint8_t vs_pervertex_num_clip; uint8_t prev_stage_num_clip_out;
float alpha_ref_val; float alpha_ref_val;
uint32_t cbufs_are_a8_bitmask; uint32_t cbufs_are_a8_bitmask;
}; };

Loading…
Cancel
Save