blorp_params_init(struct blorp_params *params)
{
memset(params, 0, sizeof(*params));
+ params->num_samples = 1;
params->num_draw_buffers = 1;
params->num_layers = 1;
}
params.dst.surf.samples = params.depth.surf.samples;
params.dst.surf.logical_level0_px = params.depth.surf.logical_level0_px;
params.depth_format = isl_format_get_depth_format(surf->surf->format, false);
+ params.num_samples = params.depth.surf.samples;
batch->blorp->exec(batch, ¶ms);
}
wm_prog_key->persample_msaa_dispatch = true;
}
+ params->num_samples = params->dst.surf.samples;
+
if (params->src.tile_x_sa || params->src.tile_y_sa) {
assert(wm_prog_key->need_src_offset);
surf_get_intratile_offset_px(¶ms->src,
brw_blorp_surface_info_init(batch->blorp, ¶ms.dst, surf, level,
start_layer, format, true);
+ params.num_samples = params.dst.surf.samples;
batch->blorp->exec(batch, ¶ms);
}
start_layer, format, true);
params.dst.view.swizzle = swizzle;
+ params.num_samples = params.dst.surf.samples;
+
/* We may be restricted on the number of layers we can bind at any one
* time. In particular, Sandy Bridge has a maximum number of layers of
* 512 but a maximum 3D texture size is much larger.
params.stencil.surf.logical_level0_px;
params.dst.view = params.depth.view;
+ params.num_samples = params.stencil.surf.samples;
+
/* We may be restricted on the number of layers we can bind at any
* one time. In particular, Sandy Bridge has a maximum number of
* layers of 512 but a maximum 3D texture size is much larger.
params.depth.surf.logical_level0_px;
params.dst.view = params.depth.view;
+ params.num_samples = params.depth.surf.samples;
+
/* We may be restricted on the number of layers we can bind at any
* one time. In particular, Sandy Bridge has a maximum number of
* layers of 512 but a maximum 3D texture size is much larger.
sf.FrontFaceFillMode = FILL_MODE_SOLID;
sf.BackFaceFillMode = FILL_MODE_SOLID;
- sf.MultisampleRasterizationMode = params->dst.surf.samples > 1 ?
+ sf.MultisampleRasterizationMode = params->num_samples > 1 ?
MSRASTMODE_ON_PATTERN : MSRASTMODE_OFF_PIXEL;
#if GEN_GEN == 7
sf.FrontFaceFillMode = FILL_MODE_SOLID;
sf.BackFaceFillMode = FILL_MODE_SOLID;
- sf.MultisampleRasterizationMode = params->dst.surf.samples > 1 ?
+ sf.MultisampleRasterizationMode = params->num_samples > 1 ?
MSRASTMODE_ON_PATTERN : MSRASTMODE_OFF_PIXEL;
sf.VertexURBEntryReadOffset = 1;
if (params->src.enabled)
wm.PixelShaderKillsPixel = true;
- if (params->dst.surf.samples > 1) {
+ if (params->num_samples > 1) {
wm.MultisampleRasterizationMode = MSRASTMODE_ON_PATTERN;
wm.MultisampleDispatchMode =
(prog_data && prog_data->persample_dispatch) ?
wm.PixelShaderKillsPixel = true; /* TODO: temporarily smash on */
}
- if (params->dst.surf.samples > 1) {
+ if (params->num_samples > 1) {
wm.MultisampleRasterizationMode = MSRASTMODE_ON_PATTERN;
wm.MultisampleDispatchMode =
(prog_data && prog_data->persample_dispatch) ?
blorp_emit_3dstate_multisample(struct blorp_batch *batch,
const struct blorp_params *params)
{
- const unsigned samples = params->dst.surf.samples;
-
blorp_emit(batch, GENX(3DSTATE_MULTISAMPLE), ms) {
- ms.NumberofMultisamples = __builtin_ffs(samples) - 1;
+ ms.NumberofMultisamples = __builtin_ffs(params->num_samples) - 1;
#if GEN_GEN >= 8
/* The PRM says that this bit is valid only for DX9:
#elif GEN_GEN >= 7
ms.PixelLocation = PIXLOC_CENTER;
- switch (samples) {
+ switch (params->num_samples) {
case 1:
GEN_SAMPLE_POS_1X(ms.Sample);
break;
blorp_emit_3dstate_multisample(batch, params);
blorp_emit(batch, GENX(3DSTATE_SAMPLE_MASK), mask) {
- mask.SampleMask = (1 << params->dst.surf.samples) - 1;
+ mask.SampleMask = (1 << params->num_samples) - 1;
}
/* From the BSpec, 3D Pipeline > Geometry > Vertex Shader > State,
enum blorp_fast_clear_op fast_clear_op;
bool color_write_disable[4];
struct brw_blorp_wm_inputs wm_inputs;
+ unsigned num_samples;
unsigned num_draw_buffers;
unsigned num_layers;
uint32_t wm_prog_kernel;