summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-09-30 16:25:18 +0200
committerMarek Olšák <[email protected]>2014-10-04 15:16:14 +0200
commit54de7099115502c561f5f51095e08dc0a52c71b7 (patch)
treeb1cfd3f02f00bf12f88ca6ec98227774fee9c50e
parent6c9f61c97e4d06afc5d86e50a83d22d60c35834a (diff)
radeonsi: always compile shaders on demand
The first compiled shader is sometimes useless, because the key doesn't match the key for the draw call where it's used. Reviewed-by: Michel Dänzer <[email protected]>
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index eb256063811..da5fcb09423 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -2305,19 +2305,12 @@ static void *si_create_shader_state(struct pipe_context *ctx,
unsigned pipe_shader_type)
{
struct si_shader_selector *sel = CALLOC_STRUCT(si_shader_selector);
- int r;
sel->type = pipe_shader_type;
sel->tokens = tgsi_dup_tokens(state->tokens);
sel->so = state->stream_output;
tgsi_scan_shader(state->tokens, &sel->info);
- r = si_shader_select(ctx, sel);
- if (r) {
- free(sel);
- return NULL;
- }
-
return sel;
}
@@ -2344,10 +2337,7 @@ static void si_bind_vs_shader(struct pipe_context *ctx, void *state)
struct si_context *sctx = (struct si_context *)ctx;
struct si_shader_selector *sel = state;
- if (sctx->vs_shader == sel)
- return;
-
- if (!sel || !sel->current)
+ if (sctx->vs_shader == sel || !sel)
return;
sctx->vs_shader = sel;
@@ -2373,8 +2363,8 @@ static void si_bind_ps_shader(struct pipe_context *ctx, void *state)
if (sctx->ps_shader == sel)
return;
- /* use dummy shader if supplied shader is corrupt */
- if (!sel || !sel->current) {
+ /* use a dummy shader if binding a NULL shader */
+ if (!sel) {
if (!sctx->dummy_pixel_shader) {
sctx->dummy_pixel_shader =
util_make_fragment_cloneinput_shader(&sctx->b.b, 0,