diff options
author | Iago Toral Quiroga <[email protected]> | 2017-03-14 13:12:22 +0100 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2017-03-16 11:40:05 +0100 |
commit | e2f707ce5b569e40c2a3821149f87659553467f9 (patch) | |
tree | 6039a8acdac044540ca7a644be34084d4ae754b8 /src/intel/blorp/blorp_blit.c | |
parent | 808503b8f8c0732fccd875ed9183a56672430097 (diff) |
intel/blorp: make upload_shader() return a bool indicating success or failure
For now we always return true, follow-up patches will handle fail scenarios.
Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/intel/blorp/blorp_blit.c')
-rw-r--r-- | src/intel/blorp/blorp_blit.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c index e650d5e7bf1..280b76ab70c 100644 --- a/src/intel/blorp/blorp_blit.c +++ b/src/intel/blorp/blorp_blit.c @@ -1285,14 +1285,14 @@ brw_blorp_build_nir_shader(struct blorp_context *blorp, void *mem_ctx, 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); @@ -1313,12 +1313,14 @@ brw_blorp_get_blit_kernel(struct blorp_context *blorp, 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 @@ -1821,7 +1823,8 @@ try_blorp_blit(struct blorp_batch *batch, /* 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); |