svga: Rebind shaders when tokens change.

Even shader ID doesn't change. Otherwise the token change is not
effective.

This reverts regression from commit
cdb445f3a9. Regression could be seen in
Quake3's loading screen -- the upper right corner of the screen would
be black.
This commit is contained in:
José Fonseca 2010-01-05 17:32:19 +00:00
parent ef1b942691
commit 8ebef37c7b
3 changed files with 10 additions and 18 deletions

View File

@ -268,8 +268,6 @@ struct svga_hw_draw_state
unsigned ts[16][TS_MAX];
float cb[PIPE_SHADER_TYPES][CB_MAX][4];
unsigned shader_id[PIPE_SHADER_TYPES];
struct svga_shader_result *fs;
struct svga_shader_result *vs;
struct svga_hw_view_state views[PIPE_MAX_SAMPLERS];

View File

@ -268,16 +268,13 @@ static int emit_hw_fs( struct svga_context *svga,
assert(id != SVGA3D_INVALID_ID);
if (result != svga->state.hw_draw.fs) {
if (id != svga->state.hw_draw.shader_id[PIPE_SHADER_FRAGMENT]) {
ret = SVGA3D_SetShader(svga->swc,
SVGA3D_SHADERTYPE_PS,
id );
if (ret)
return ret;
}
ret = SVGA3D_SetShader(svga->swc,
SVGA3D_SHADERTYPE_PS,
id );
if (ret)
return ret;
svga->dirty |= SVGA_NEW_FS_RESULT;
svga->state.hw_draw.shader_id[PIPE_SHADER_FRAGMENT] = id;
svga->state.hw_draw.fs = result;
}

View File

@ -149,16 +149,13 @@ static int emit_hw_vs( struct svga_context *svga,
}
if (result != svga->state.hw_draw.vs) {
if (id != svga->state.hw_draw.shader_id[PIPE_SHADER_VERTEX]) {
ret = SVGA3D_SetShader(svga->swc,
SVGA3D_SHADERTYPE_VS,
id );
if (ret)
return ret;
}
ret = SVGA3D_SetShader(svga->swc,
SVGA3D_SHADERTYPE_VS,
id );
if (ret)
return ret;
svga->dirty |= SVGA_NEW_VS_RESULT;
svga->state.hw_draw.shader_id[PIPE_SHADER_VERTEX] = id;
svga->state.hw_draw.vs = result;
}