return b.shader;
}
-static void
+static bool
brw_blorp_get_blit_kernel(struct blorp_context *blorp,
struct blorp_params *params,
const struct brw_blorp_blit_prog_key *prog_key)
{
if (blorp->lookup_shader(blorp, prog_key, sizeof(*prog_key),
¶ms->wm_prog_kernel, ¶ms->wm_prog_data))
- return;
+ return true;
void *mem_ctx = ralloc_context(NULL);
program = blorp_compile_fs(blorp, mem_ctx, nir, &wm_key, false,
&prog_data, &program_size);
- blorp->upload_shader(blorp, prog_key, sizeof(*prog_key),
- program, program_size,
- &prog_data.base, sizeof(prog_data),
- ¶ms->wm_prog_kernel, ¶ms->wm_prog_data);
+ bool result =
+ blorp->upload_shader(blorp, prog_key, sizeof(*prog_key),
+ program, program_size,
+ &prog_data.base, sizeof(prog_data),
+ ¶ms->wm_prog_kernel, ¶ms->wm_prog_data);
ralloc_free(mem_ctx);
+ return result;
}
static void
/* For some texture types, we need to pass the layer through the sampler. */
params->wm_inputs.src_z = params->src.z_offset;
- brw_blorp_get_blit_kernel(batch->blorp, params, wm_prog_key);
+ if (!brw_blorp_get_blit_kernel(batch->blorp, params, wm_prog_key))
+ return 0;
unsigned result = 0;
unsigned max_surface_size = get_max_surface_size(devinfo, params);
bool pad[3];
};
-static void
+static bool
blorp_params_get_clear_kernel(struct blorp_context *blorp,
struct blorp_params *params,
bool use_replicated_data)
if (blorp->lookup_shader(blorp, &blorp_key, sizeof(blorp_key),
¶ms->wm_prog_kernel, ¶ms->wm_prog_data))
- return;
+ return true;
void *mem_ctx = ralloc_context(NULL);
blorp_compile_fs(blorp, mem_ctx, b.shader, &wm_key, use_replicated_data,
&prog_data, &program_size);
- blorp->upload_shader(blorp, &blorp_key, sizeof(blorp_key),
- program, program_size,
- &prog_data.base, sizeof(prog_data),
- ¶ms->wm_prog_kernel, ¶ms->wm_prog_data);
+ bool result =
+ blorp->upload_shader(blorp, &blorp_key, sizeof(blorp_key),
+ program, program_size,
+ &prog_data.base, sizeof(prog_data),
+ ¶ms->wm_prog_kernel, ¶ms->wm_prog_data);
ralloc_free(mem_ctx);
+ return result;
}
struct layer_offset_vs_key {
* no real concept of "base instance", so we have to do it manually in a
* vertex shader.
*/
-static void
+static bool
blorp_params_get_layer_offset_vs(struct blorp_context *blorp,
struct blorp_params *params)
{
if (blorp->lookup_shader(blorp, &blorp_key, sizeof(blorp_key),
¶ms->vs_prog_kernel, ¶ms->vs_prog_data))
- return;
+ return true;
void *mem_ctx = ralloc_context(NULL);
const unsigned *program =
blorp_compile_vs(blorp, mem_ctx, b.shader, &vs_prog_data, &program_size);
- blorp->upload_shader(blorp, &blorp_key, sizeof(blorp_key),
- program, program_size,
- &vs_prog_data.base.base, sizeof(vs_prog_data),
- ¶ms->vs_prog_kernel, ¶ms->vs_prog_data);
+ bool result =
+ blorp->upload_shader(blorp, &blorp_key, sizeof(blorp_key),
+ program, program_size,
+ &vs_prog_data.base.base, sizeof(vs_prog_data),
+ ¶ms->vs_prog_kernel, ¶ms->vs_prog_data);
ralloc_free(mem_ctx);
+ return result;
}
/* The x0, y0, x1, and y1 parameters must already be populated with the render
get_fast_clear_rect(batch->blorp->isl_dev, surf->aux_surf,
¶ms.x0, ¶ms.y0, ¶ms.x1, ¶ms.y1);
- blorp_params_get_clear_kernel(batch->blorp, ¶ms, true);
+ if (!blorp_params_get_clear_kernel(batch->blorp, ¶ms, true))
+ return;
brw_blorp_surface_info_init(batch->blorp, ¶ms.dst, surf, level,
start_layer, format, true);
}
}
- blorp_params_get_clear_kernel(batch->blorp, ¶ms,
- use_simd16_replicated_data);
+ if (!blorp_params_get_clear_kernel(batch->blorp, ¶ms,
+ use_simd16_replicated_data))
+ return;
while (num_layers > 0) {
brw_blorp_surface_info_init(batch->blorp, ¶ms.dst, surf, level,
* is tiled or not, we have to assume it may be linear. This means no
* SIMD16_REPDATA for us. :-(
*/
- blorp_params_get_clear_kernel(batch->blorp, ¶ms, false);
+ if (!blorp_params_get_clear_kernel(batch->blorp, ¶ms, false))
+ return;
}
if (clear_depth) {
params.stencil_ref = stencil_value;
}
- blorp_params_get_layer_offset_vs(batch->blorp, ¶ms);
+ if (!blorp_params_get_layer_offset_vs(batch->blorp, ¶ms))
+ return;
+
params.vs_inputs.base_layer = start_layer;
batch->blorp->exec(batch, ¶ms);
* color" message.
*/
- blorp_params_get_clear_kernel(batch->blorp, ¶ms, true);
+ if (!blorp_params_get_clear_kernel(batch->blorp, ¶ms, true))
+ return;
batch->blorp->exec(batch, ¶ms);
}