[Mesa-dev] [PATCH 4/9] st/mesa: Accelerate PBO uploads

Nicolai Hähnle nhaehnle at gmail.com
Mon Jan 18 15:54:20 PST 2016


On 18.01.2016 17:22, Nicolai Hähnle wrote:
> +static void *
> +create_pbo_upload_shader(struct pipe_context *pipe)
> +{
> +   struct ureg_program *ureg;
> +   struct ureg_dst out;
> +   struct ureg_src sampler;
> +   struct ureg_src pos;
> +   struct ureg_src const0;
> +   struct ureg_dst temp0;
> +
> +   ureg    = ureg_create(TGSI_PROCESSOR_FRAGMENT);
> +   out     = ureg_DECL_output(ureg, TGSI_SEMANTIC_COLOR, 0);
> +   sampler = ureg_DECL_sampler(ureg, 0);
> +   pos     = ureg_DECL_fs_input(ureg, TGSI_SEMANTIC_POSITION, 0,
> +                                TGSI_INTERPOLATE_LINEAR);

I tested this against an older version of master; going to replace the 
last line with

    if (screen->get_param(screen, PIPE_CAP_TGSI_FS_POSITION_IS_SYSVAL)) {
       pos = ureg_DECL_system_value(ureg, TGSI_SEMANTIC_POSITION, 0);
    } else {
       pos = ureg_DECL_fs_input(ureg, TGSI_SEMANTIC_POSITION, 0,
                                TGSI_INTERPOLATE_LINEAR);
    }

Cheers,
Nicolai


More information about the mesa-dev mailing list