mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
crocus: expose ARB_blend_func_extended on gen 45/50
In theory the docs say 965gm can support this but the original 965 can't, but we can't distinguish that yet. Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11693>
This commit is contained in:
parent
64f65fe8a8
commit
c71daec260
2 changed files with 23 additions and 2 deletions
|
|
@ -263,7 +263,8 @@ crocus_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
|||
case PIPE_CAP_FBFETCH:
|
||||
return devinfo->verx10 >= 45 ? BRW_MAX_DRAW_BUFFERS : 0;
|
||||
case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
|
||||
return devinfo->ver >= 6 ? 1 : 0;
|
||||
/* in theory CL (965gm) can do this */
|
||||
return devinfo->verx10 >= 45 ? 1 : 0;
|
||||
case PIPE_CAP_MAX_RENDER_TARGETS:
|
||||
return BRW_MAX_DRAW_BUFFERS;
|
||||
case PIPE_CAP_MAX_TEXTURE_2D_SIZE:
|
||||
|
|
|
|||
|
|
@ -1565,6 +1565,23 @@ set_blend_entry_bits(struct crocus_batch *batch, BLEND_ENTRY_GENXML *entry,
|
|||
entry->DestinationBlendFactor = (int) dst_rgb;
|
||||
entry->DestinationAlphaBlendFactor = (int) dst_alpha;
|
||||
}
|
||||
#if GFX_VER <= 5
|
||||
/*
|
||||
* Gen4/GM45/ILK can't handle have ColorBufferBlendEnable == 0
|
||||
* when a dual src blend shader is in use. Setup dummy blending.
|
||||
*/
|
||||
struct crocus_compiled_shader *shader = ice->shaders.prog[MESA_SHADER_FRAGMENT];
|
||||
struct brw_wm_prog_data *wm_prog_data = (void *) shader->prog_data;
|
||||
if (idx == 0 && !blend_enabled && wm_prog_data->dual_src_blend) {
|
||||
entry->ColorBufferBlendEnable = 1;
|
||||
entry->ColorBlendFunction = PIPE_BLEND_ADD;
|
||||
entry->AlphaBlendFunction = PIPE_BLEND_ADD;
|
||||
entry->SourceBlendFactor = PIPE_BLENDFACTOR_ONE;
|
||||
entry->SourceAlphaBlendFactor = PIPE_BLENDFACTOR_ONE;
|
||||
entry->DestinationBlendFactor = PIPE_BLENDFACTOR_ZERO;
|
||||
entry->DestinationAlphaBlendFactor = PIPE_BLENDFACTOR_ZERO;
|
||||
}
|
||||
#endif
|
||||
return independent_alpha_blend;
|
||||
}
|
||||
|
||||
|
|
@ -5341,11 +5358,14 @@ crocus_populate_binding_table(struct crocus_context *ice,
|
|||
#if GFX_VER <= 5
|
||||
const struct pipe_rt_blend_state *rt =
|
||||
&ice->state.cso_blend->cso.rt[ice->state.cso_blend->cso.independent_blend_enable ? i : 0];
|
||||
struct crocus_compiled_shader *shader = ice->shaders.prog[MESA_SHADER_FRAGMENT];
|
||||
struct brw_wm_prog_data *wm_prog_data = (void *) shader->prog_data;
|
||||
write_disables |= (rt->colormask & PIPE_MASK_A) ? 0x0 : 0x8;
|
||||
write_disables |= (rt->colormask & PIPE_MASK_R) ? 0x0 : 0x4;
|
||||
write_disables |= (rt->colormask & PIPE_MASK_G) ? 0x0 : 0x2;
|
||||
write_disables |= (rt->colormask & PIPE_MASK_B) ? 0x0 : 0x1;
|
||||
blend_enable = rt->blend_enable;
|
||||
/* Gen4/5 can't handle blending off when a dual src blend wm is enabled. */
|
||||
blend_enable = rt->blend_enable || wm_prog_data->dual_src_blend;
|
||||
#endif
|
||||
if (cso_fb->cbufs[i]) {
|
||||
surf_offsets[s] = emit_surface(batch,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue