aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/blorp/blorp_blit.c
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2017-03-14 13:12:22 +0100
committerIago Toral Quiroga <[email protected]>2017-03-16 11:40:05 +0100
commite2f707ce5b569e40c2a3821149f87659553467f9 (patch)
tree6039a8acdac044540ca7a644be34084d4ae754b8 /src/intel/blorp/blorp_blit.c
parent808503b8f8c0732fccd875ed9183a56672430097 (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.c17
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),
&params->wm_prog_kernel, &params->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),
- &params->wm_prog_kernel, &params->wm_prog_data);
+ bool result =
+ blorp->upload_shader(blorp, prog_key, sizeof(*prog_key),
+ program, program_size,
+ &prog_data.base, sizeof(prog_data),
+ &params->wm_prog_kernel, &params->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);