mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-28 20:30:25 +01:00
r300: minor code movement
This commit is contained in:
parent
f8c30793d1
commit
1b49f1ca7f
1 changed files with 21 additions and 21 deletions
|
|
@ -460,6 +460,7 @@ static void r300SetEarlyZState(GLcontext * ctx)
|
|||
{
|
||||
r300ContextPtr r300 = R300_CONTEXT(ctx);
|
||||
GLuint topZ = R300_ZTOP_ENABLE;
|
||||
GLuint w_fmt, fgdepthsrc;
|
||||
|
||||
if (ctx->Color.AlphaEnabled && ctx->Color.AlphaFunc != GL_ALWAYS)
|
||||
topZ = R300_ZTOP_DISABLE;
|
||||
|
|
@ -476,6 +477,26 @@ static void r300SetEarlyZState(GLcontext * ctx)
|
|||
R300_STATECHANGE(r300, zstencil_format);
|
||||
r300->hw.zstencil_format.cmd[2] = topZ;
|
||||
}
|
||||
|
||||
/* w_fmt value is set to get best performance
|
||||
* see p.130 R5xx 3D acceleration guide v1.3 */
|
||||
if (current_fragment_program_writes_depth(ctx)) {
|
||||
fgdepthsrc = R300_FG_DEPTH_SRC_SHADER;
|
||||
w_fmt = R300_W_FMT_W24 | R300_W_SRC_US;
|
||||
} else {
|
||||
fgdepthsrc = R300_FG_DEPTH_SRC_SCAN;
|
||||
w_fmt = R300_W_FMT_W0 | R300_W_SRC_US;
|
||||
}
|
||||
|
||||
if (w_fmt != r300->hw.us_out_fmt.cmd[5]) {
|
||||
R300_STATECHANGE(r300, us_out_fmt);
|
||||
r300->hw.us_out_fmt.cmd[5] = w_fmt;
|
||||
}
|
||||
|
||||
if (fgdepthsrc != r300->hw.fg_depth_src.cmd[1]) {
|
||||
R300_STATECHANGE(r300, fg_depth_src);
|
||||
r300->hw.fg_depth_src.cmd[1] = fgdepthsrc;
|
||||
}
|
||||
}
|
||||
|
||||
static void r300SetAlphaState(GLcontext * ctx)
|
||||
|
|
@ -2405,27 +2426,6 @@ void r300UpdateShaderStates(r300ContextPtr rmesa)
|
|||
|
||||
r300SetEarlyZState(ctx);
|
||||
|
||||
/* w_fmt value is set to get best performance
|
||||
* see p.130 R5xx 3D acceleration guide v1.3 */
|
||||
GLuint w_fmt, fgdepthsrc;
|
||||
if (current_fragment_program_writes_depth(ctx)) {
|
||||
fgdepthsrc = R300_FG_DEPTH_SRC_SHADER;
|
||||
w_fmt = R300_W_FMT_W24 | R300_W_SRC_US;
|
||||
} else {
|
||||
fgdepthsrc = R300_FG_DEPTH_SRC_SCAN;
|
||||
w_fmt = R300_W_FMT_W0 | R300_W_SRC_US;
|
||||
}
|
||||
|
||||
if (w_fmt != rmesa->hw.us_out_fmt.cmd[5]) {
|
||||
R300_STATECHANGE(rmesa, us_out_fmt);
|
||||
rmesa->hw.us_out_fmt.cmd[5] = w_fmt;
|
||||
}
|
||||
|
||||
if (fgdepthsrc != rmesa->hw.fg_depth_src.cmd[1]) {
|
||||
R300_STATECHANGE(rmesa, fg_depth_src);
|
||||
rmesa->hw.fg_depth_src.cmd[1] = fgdepthsrc;
|
||||
}
|
||||
|
||||
r300SetupTextures(ctx);
|
||||
|
||||
rmesa->vtbl.SetupPixelShader(ctx);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue