diff options
author | Jason Ekstrand <[email protected]> | 2016-10-21 13:10:52 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-11-16 10:11:29 -0800 |
commit | f7f768d19506dc9e480531ce41d03dba9b4fc792 (patch) | |
tree | e6cc92d16e46529d0c38b3d675bc833c2bfac9bc /src/intel/blorp/blorp.c | |
parent | 768c8dd71894fb3f57a758814946d745a426d7e5 (diff) |
intel/blorp: Add support for vertex shaders
Signed-off-by: Jason Ekstrand <[email protected]>
Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/intel/blorp/blorp.c')
-rw-r--r-- | src/intel/blorp/blorp.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/intel/blorp/blorp.c b/src/intel/blorp/blorp.c index 5952a117eb5..08ce97d9e5d 100644 --- a/src/intel/blorp/blorp.c +++ b/src/intel/blorp/blorp.c @@ -190,6 +190,37 @@ blorp_compile_fs(struct blorp_context *blorp, void *mem_ctx, return program; } +const unsigned * +blorp_compile_vs(struct blorp_context *blorp, void *mem_ctx, + struct nir_shader *nir, + struct brw_vs_prog_data *vs_prog_data, + unsigned *program_size) +{ + const struct brw_compiler *compiler = blorp->compiler; + + nir->options = + compiler->glsl_compiler_options[MESA_SHADER_VERTEX].NirOptions; + + nir = brw_preprocess_nir(compiler, nir); + nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir)); + + vs_prog_data->inputs_read = nir->info->inputs_read; + + brw_compute_vue_map(compiler->devinfo, + &vs_prog_data->base.vue_map, + nir->info->outputs_written, + nir->info->separate_shader); + + struct brw_vs_prog_key vs_key = { 0, }; + + const unsigned *program = + brw_compile_vs(compiler, blorp->driver_ctx, mem_ctx, + &vs_key, vs_prog_data, nir, + NULL, false, -1, program_size, NULL); + + return program; +} + void blorp_gen6_hiz_op(struct blorp_batch *batch, struct blorp_surf *surf, unsigned level, unsigned layer, |