}
static bool
-brw_blorp_get_blit_kernel(struct blorp_context *blorp,
+brw_blorp_get_blit_kernel(struct blorp_batch *batch,
struct blorp_params *params,
const struct brw_blorp_blit_prog_key *prog_key)
{
- if (blorp->lookup_shader(blorp, prog_key, sizeof(*prog_key),
+ struct blorp_context *blorp = batch->blorp;
+
+ if (blorp->lookup_shader(batch, prog_key, sizeof(*prog_key),
¶ms->wm_prog_kernel, ¶ms->wm_prog_data))
return true;
&prog_data);
bool result =
- blorp->upload_shader(blorp, prog_key, sizeof(*prog_key),
+ blorp->upload_shader(batch, prog_key, sizeof(*prog_key),
program, prog_data.base.program_size,
&prog_data.base, sizeof(prog_data),
¶ms->wm_prog_kernel, ¶ms->wm_prog_data);
/* For some texture types, we need to pass the layer through the sampler. */
params->wm_inputs.src_z = params->src.z_offset;
- if (!brw_blorp_get_blit_kernel(batch->blorp, params, wm_prog_key))
+ if (!brw_blorp_get_blit_kernel(batch, params, wm_prog_key))
return 0;
- if (!blorp_ensure_sf_program(batch->blorp, params))
+ if (!blorp_ensure_sf_program(batch, params))
return 0;
unsigned result = 0;
};
static bool
-blorp_params_get_clear_kernel(struct blorp_context *blorp,
+blorp_params_get_clear_kernel(struct blorp_batch *batch,
struct blorp_params *params,
bool use_replicated_data,
bool clear_rgb_as_red)
{
+ struct blorp_context *blorp = batch->blorp;
+
const struct brw_blorp_const_color_prog_key blorp_key = {
.shader_type = BLORP_SHADER_TYPE_CLEAR,
.use_simd16_replicated_data = use_replicated_data,
.clear_rgb_as_red = clear_rgb_as_red,
};
- if (blorp->lookup_shader(blorp, &blorp_key, sizeof(blorp_key),
+ if (blorp->lookup_shader(batch, &blorp_key, sizeof(blorp_key),
¶ms->wm_prog_kernel, ¶ms->wm_prog_data))
return true;
&prog_data);
bool result =
- blorp->upload_shader(blorp, &blorp_key, sizeof(blorp_key),
+ blorp->upload_shader(batch, &blorp_key, sizeof(blorp_key),
program, prog_data.base.program_size,
&prog_data.base, sizeof(prog_data),
¶ms->wm_prog_kernel, ¶ms->wm_prog_data);
* vertex shader.
*/
static bool
-blorp_params_get_layer_offset_vs(struct blorp_context *blorp,
+blorp_params_get_layer_offset_vs(struct blorp_batch *batch,
struct blorp_params *params)
{
+ struct blorp_context *blorp = batch->blorp;
struct layer_offset_vs_key blorp_key = {
.shader_type = BLORP_SHADER_TYPE_LAYER_OFFSET_VS,
};
if (params->wm_prog_data)
blorp_key.num_inputs = params->wm_prog_data->num_varying_inputs;
- if (blorp->lookup_shader(blorp, &blorp_key, sizeof(blorp_key),
+ if (blorp->lookup_shader(batch, &blorp_key, sizeof(blorp_key),
¶ms->vs_prog_kernel, ¶ms->vs_prog_data))
return true;
blorp_compile_vs(blorp, mem_ctx, b.shader, &vs_prog_data);
bool result =
- blorp->upload_shader(blorp, &blorp_key, sizeof(blorp_key),
+ blorp->upload_shader(batch, &blorp_key, sizeof(blorp_key),
program, vs_prog_data.base.base.program_size,
&vs_prog_data.base.base, sizeof(vs_prog_data),
¶ms->vs_prog_kernel, ¶ms->vs_prog_data);
get_fast_clear_rect(batch->blorp->isl_dev, surf->aux_surf,
¶ms.x0, ¶ms.y0, ¶ms.x1, ¶ms.y1);
- if (!blorp_params_get_clear_kernel(batch->blorp, ¶ms, true, false))
+ if (!blorp_params_get_clear_kernel(batch, ¶ms, true, false))
return;
brw_blorp_surface_info_init(batch->blorp, ¶ms.dst, surf, level,
}
}
- if (!blorp_params_get_clear_kernel(batch->blorp, ¶ms,
+ if (!blorp_params_get_clear_kernel(batch, ¶ms,
use_simd16_replicated_data,
clear_rgb_as_red))
return;
- if (!blorp_ensure_sf_program(batch->blorp, ¶ms))
+ if (!blorp_ensure_sf_program(batch, ¶ms))
return;
while (num_layers > 0) {
* we disable statistics in 3DSTATE_WM. Give it the usual clear shader
* to work around the issue.
*/
- if (!blorp_params_get_clear_kernel(batch->blorp, ¶ms, false, false))
+ if (!blorp_params_get_clear_kernel(batch, ¶ms, false, false))
return;
}
* is tiled or not, we have to assume it may be linear. This means no
* SIMD16_REPDATA for us. :-(
*/
- if (!blorp_params_get_clear_kernel(batch->blorp, ¶ms, false, false))
+ if (!blorp_params_get_clear_kernel(batch, ¶ms, false, false))
return;
}
params.stencil_ref = stencil_value;
}
- if (!blorp_params_get_layer_offset_vs(batch->blorp, ¶ms))
+ if (!blorp_params_get_layer_offset_vs(batch, ¶ms))
return;
params.vs_inputs.base_layer = start_layer;
* color" message.
*/
- if (!blorp_params_get_clear_kernel(batch->blorp, ¶ms, true, false))
+ if (!blorp_params_get_clear_kernel(batch, ¶ms, true, false))
return;
batch->blorp->exec(batch, ¶ms);
};
static bool
-blorp_params_get_mcs_partial_resolve_kernel(struct blorp_context *blorp,
+blorp_params_get_mcs_partial_resolve_kernel(struct blorp_batch *batch,
struct blorp_params *params)
{
+ struct blorp_context *blorp = batch->blorp;
const struct blorp_mcs_partial_resolve_key blorp_key = {
.shader_type = BLORP_SHADER_TYPE_MCS_PARTIAL_RESOLVE,
.indirect_clear_color = params->dst.clear_color_addr.buffer != NULL,
.num_samples = params->num_samples,
};
- if (blorp->lookup_shader(blorp, &blorp_key, sizeof(blorp_key),
+ if (blorp->lookup_shader(batch, &blorp_key, sizeof(blorp_key),
¶ms->wm_prog_kernel, ¶ms->wm_prog_data))
return true;
&prog_data);
bool result =
- blorp->upload_shader(blorp, &blorp_key, sizeof(blorp_key),
+ blorp->upload_shader(batch, &blorp_key, sizeof(blorp_key),
program, prog_data.base.program_size,
&prog_data.base, sizeof(prog_data),
¶ms->wm_prog_kernel, ¶ms->wm_prog_data);
memcpy(¶ms.wm_inputs.clear_color,
surf->clear_color.f32, sizeof(float) * 4);
- if (!blorp_params_get_mcs_partial_resolve_kernel(batch->blorp, ¶ms))
+ if (!blorp_params_get_mcs_partial_resolve_kernel(batch, ¶ms))
return;
batch->blorp->exec(batch, ¶ms);
memset(¶ms.wm_inputs.clear_color, 0,
sizeof(params.wm_inputs.clear_color));
- if (!blorp_params_get_clear_kernel(batch->blorp, ¶ms, true, false))
+ if (!blorp_params_get_clear_kernel(batch, ¶ms, true, false))
return;
batch->blorp->exec(batch, ¶ms);
#define FILE_DEBUG_FLAG DEBUG_BLORP
static bool
-brw_blorp_lookup_shader(struct blorp_context *blorp,
+brw_blorp_lookup_shader(struct blorp_batch *batch,
const void *key, uint32_t key_size,
uint32_t *kernel_out, void *prog_data_out)
{
- struct brw_context *brw = blorp->driver_ctx;
+ struct brw_context *brw = batch->driver_batch;
return brw_search_cache(&brw->cache, BRW_CACHE_BLORP_PROG, key, key_size,
kernel_out, prog_data_out, true);
}
static bool
-brw_blorp_upload_shader(struct blorp_context *blorp,
+brw_blorp_upload_shader(struct blorp_batch *batch,
const void *key, uint32_t key_size,
const void *kernel, uint32_t kernel_size,
const struct brw_stage_prog_data *prog_data,
uint32_t prog_data_size,
uint32_t *kernel_out, void *prog_data_out)
{
- struct brw_context *brw = blorp->driver_ctx;
+ struct brw_context *brw = batch->driver_batch;
brw_upload_cache(&brw->cache, BRW_CACHE_BLORP_PROG, key, key_size,
kernel, kernel_size, prog_data, prog_data_size,
kernel_out, prog_data_out);