shader: use actual fs_info data as shader key instead of a pointer

Using a pointer for fs_info in the shader key is not really that useful
because the contents of the structure can change even though the pointer
remains the same, and the pointer can be different when the contents are
the same.

Fixes 5f488ed00d

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Tested-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Italo Nicola 3 years ago committed by Gert Wollny
parent a99bde7852
commit 3417d480ab
  1. 2
      src/vrend_renderer.c
  2. 6
      src/vrend_shader.c
  3. 2
      src/vrend_shader.h

@ -3482,7 +3482,7 @@ static inline void vrend_sync_shader_io(struct vrend_sub_context *sub_ctx,
if (sub_ctx->shaders[PIPE_SHADER_FRAGMENT]) { if (sub_ctx->shaders[PIPE_SHADER_FRAGMENT]) {
struct vrend_shader *fs = struct vrend_shader *fs =
sub_ctx->shaders[PIPE_SHADER_FRAGMENT]->current; sub_ctx->shaders[PIPE_SHADER_FRAGMENT]->current;
key->fs_info = &fs->var_sinfo.fs_info; key->fs_info = fs->var_sinfo.fs_info;
next_type = PIPE_SHADER_FRAGMENT; next_type = PIPE_SHADER_FRAGMENT;
} }
} }

@ -7371,21 +7371,21 @@ bool vrend_convert_shader(const struct vrend_context *rctx,
vrend_patch_vertex_shader_interpolants(cfg, vrend_patch_vertex_shader_interpolants(cfg,
shader, shader,
sinfo, sinfo,
key->fs_info, "gso", &key->fs_info, "gso",
key->flatshade); key->flatshade);
} else if (!key->gs_present && } else if (!key->gs_present &&
ctx.prog_type == TGSI_PROCESSOR_TESS_EVAL) { ctx.prog_type == TGSI_PROCESSOR_TESS_EVAL) {
vrend_patch_vertex_shader_interpolants(cfg, vrend_patch_vertex_shader_interpolants(cfg,
shader, shader,
sinfo, sinfo,
key->fs_info, "teo", &key->fs_info, "teo",
key->flatshade); key->flatshade);
} else if (!key->gs_present && !key->tes_present && } else if (!key->gs_present && !key->tes_present &&
ctx.prog_type == TGSI_PROCESSOR_VERTEX) { ctx.prog_type == TGSI_PROCESSOR_VERTEX) {
vrend_patch_vertex_shader_interpolants(cfg, vrend_patch_vertex_shader_interpolants(cfg,
shader, shader,
sinfo, sinfo,
key->fs_info, "vso", &key->fs_info, "vso",
key->flatshade); key->flatshade);
} }

@ -147,7 +147,7 @@ struct vrend_variable_shader_info {
struct vrend_shader_key { struct vrend_shader_key {
uint64_t force_invariant_inputs; uint64_t force_invariant_inputs;
struct vrend_fs_shader_info *fs_info; struct vrend_fs_shader_info fs_info;
struct vrend_shader_info_out input; struct vrend_shader_info_out input;
struct vrend_shader_info_in output; struct vrend_shader_info_in output;
struct vrend_layout_info prev_stage_generic_and_patch_outputs_layout[64]; struct vrend_layout_info prev_stage_generic_and_patch_outputs_layout[64];

Loading…
Cancel
Save