mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-11 08:00:13 +01:00
i965/fs: Consult brw_wm_prog_data::num_varying_inputs when setting up WM state.
Previously, we assumed that the number of varying inputs consumed by the fragment shader was equal to the number of bits set in gl_program::InputsRead. However, we'll soon be making two changes that will cause that not to be true: - We'll stop wasting varying input space for gl_FragCoord and gl_FrontFacing, which aren't varyings. - For fragment shaders that have more than 16 varying inputs, we'll adjust the layout of the inputs to account for the fact that the SF/SBE pipeline stage can't reorder inputs beyond the first 16; if there are GS outputs that the FS doens't use (or vice versa) this may cause the number of FS varying inputs to change. So, instead of trying to guess the number of FS inputs from gl_program::InputsRead, simply read it from brw_wm_prog_data:num_varying_inputs, which is guaranteed to be correct since it's populated by fs_visitor::calculate_urb_setup(). Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
8c69eaba1a
commit
8c2b9bd1df
2 changed files with 5 additions and 3 deletions
|
|
@ -188,7 +188,8 @@ upload_wm_state(struct brw_context *brw)
|
|||
dw5 |= GEN6_WM_DISPATCH_ENABLE;
|
||||
}
|
||||
|
||||
dw6 |= _mesa_bitcount_64(brw->fragment_program->Base.InputsRead) <<
|
||||
/* CACHE_NEW_WM_PROG */
|
||||
dw6 |= brw->wm.prog_data->num_varying_inputs <<
|
||||
GEN6_WM_NUM_SF_OUTPUTS_SHIFT;
|
||||
if (multisampled_fbo) {
|
||||
/* _NEW_MULTISAMPLE */
|
||||
|
|
|
|||
|
|
@ -168,6 +168,7 @@ upload_ps_state(struct brw_context *brw)
|
|||
* rendering, CurrentFragmentProgram is used for this check to
|
||||
* differentiate between the GLSL and non-GLSL cases.
|
||||
*/
|
||||
/* BRW_NEW_FRAGMENT_PROGRAM */
|
||||
if (ctx->Shader.CurrentFragmentProgram == NULL)
|
||||
dw2 |= GEN7_PS_FLOATING_POINT_MODE_ALT;
|
||||
|
||||
|
|
@ -191,8 +192,8 @@ upload_ps_state(struct brw_context *brw)
|
|||
dw4 |= GEN7_PS_DUAL_SOURCE_BLEND_ENABLE;
|
||||
}
|
||||
|
||||
/* BRW_NEW_FRAGMENT_PROGRAM */
|
||||
if (brw->fragment_program->Base.InputsRead != 0)
|
||||
/* CACHE_NEW_WM_PROG */
|
||||
if (brw->wm.prog_data->num_varying_inputs != 0)
|
||||
dw4 |= GEN7_PS_ATTRIBUTE_ENABLE;
|
||||
|
||||
dw4 |= GEN7_PS_8_DISPATCH_ENABLE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue