mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 08:50:09 +01:00
i965: define, use BRW_MAX_DRAW_BUFFERS
i965 might support more than 4 color draw buffers. But if not, this protects from breakage if the Mesa limit is raised.
This commit is contained in:
parent
7648c80ac8
commit
198ec96d36
3 changed files with 8 additions and 4 deletions
|
|
@ -105,6 +105,7 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis,
|
|||
|
||||
TNL_CONTEXT(ctx)->Driver.RunPipeline = _tnl_run_pipeline;
|
||||
|
||||
ctx->Const.MaxDrawBuffers = BRW_MAX_DRAW_BUFFERS;
|
||||
ctx->Const.MaxTextureImageUnits = BRW_MAX_TEX_UNIT;
|
||||
ctx->Const.MaxTextureCoordUnits = 8; /* Mesa limit */
|
||||
ctx->Const.MaxTextureUnits = MIN2(ctx->Const.MaxTextureCoordUnits,
|
||||
|
|
|
|||
|
|
@ -252,20 +252,23 @@ struct brw_vs_ouput_sizes {
|
|||
/** Number of texture sampler units */
|
||||
#define BRW_MAX_TEX_UNIT 16
|
||||
|
||||
/** Max number of render targets in a shader */
|
||||
#define BRW_MAX_DRAW_BUFFERS 4
|
||||
|
||||
/**
|
||||
* Size of our surface binding table for the WM.
|
||||
* This contains pointers to the drawing surfaces and current texture
|
||||
* objects and shader constant buffers (+2).
|
||||
*/
|
||||
#define BRW_WM_MAX_SURF (MAX_DRAW_BUFFERS + BRW_MAX_TEX_UNIT + 1)
|
||||
#define BRW_WM_MAX_SURF (BRW_MAX_DRAW_BUFFERS + BRW_MAX_TEX_UNIT + 1)
|
||||
|
||||
/**
|
||||
* Helpers to convert drawing buffers, textures and constant buffers
|
||||
* to surface binding table indexes, for WM.
|
||||
*/
|
||||
#define SURF_INDEX_DRAW(d) (d)
|
||||
#define SURF_INDEX_FRAG_CONST_BUFFER (MAX_DRAW_BUFFERS)
|
||||
#define SURF_INDEX_TEXTURE(t) (MAX_DRAW_BUFFERS + 1 + (t))
|
||||
#define SURF_INDEX_FRAG_CONST_BUFFER (BRW_MAX_DRAW_BUFFERS)
|
||||
#define SURF_INDEX_TEXTURE(t) (BRW_MAX_DRAW_BUFFERS + 1 + (t))
|
||||
|
||||
/**
|
||||
* Size of surface binding table for the VS.
|
||||
|
|
|
|||
|
|
@ -709,7 +709,7 @@ static void prepare_wm_surfaces(struct brw_context *brw )
|
|||
}
|
||||
|
||||
old_nr_surfaces = brw->wm.nr_surfaces;
|
||||
brw->wm.nr_surfaces = MAX_DRAW_BUFFERS;
|
||||
brw->wm.nr_surfaces = BRW_MAX_DRAW_BUFFERS;
|
||||
|
||||
if (brw->wm.surf_bo[SURF_INDEX_FRAG_CONST_BUFFER] != NULL)
|
||||
brw->wm.nr_surfaces = SURF_INDEX_FRAG_CONST_BUFFER + 1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue