[Mesa-dev] [PATCH 11/14] i965/fs: Handle compact outputs.

Jason Ekstrand jason at jlekstrand.net
Thu Nov 17 04:49:36 UTC 2016


On Mon, Nov 14, 2016 at 5:41 PM, Kenneth Graunke <kenneth at whitecape.org>
wrote:

> We need to calculate the number of vec4 slots correctly.
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/mesa/drivers/dri/i965/brw_fs.h       | 2 +-
>  src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 4 +++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.h
> b/src/mesa/drivers/dri/i965/brw_fs.h
> index da01174..6446a61 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.h
> +++ b/src/mesa/drivers/dri/i965/brw_fs.h
> @@ -191,7 +191,7 @@ public:
>
>     void emit_nir_code();
>     void nir_setup_single_output_varying(fs_reg *reg, const glsl_type
> *type,
> -                                        unsigned *location);
> +                                        bool is_compact, unsigned
> *location);
>

Something appears to be missing here.  You change a prototype but I don't
see you changing the actual function anywhere.


>     void nir_setup_outputs();
>     void nir_setup_uniforms();
>     void nir_emit_system_values();
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> index e770502..82e22c2 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> @@ -55,7 +55,9 @@ fs_visitor::nir_setup_outputs()
>        return;
>
>     nir_foreach_variable(var, &nir->outputs) {
> -      const unsigned vec4s = type_size_vec4(var->type);
> +      const unsigned vec4s =
> +         var->data.compact ? DIV_ROUND_UP(glsl_get_length(var->type), 4)
> +                           : type_size_vec4(var->type);
>        fs_reg reg = bld.vgrf(BRW_REGISTER_TYPE_F, 4 * vec4s);
>        for (unsigned i = 0; i < vec4s; i++) {
>           if (outputs[var->data.driver_location + i].file == BAD_FILE)
> --
> 2.10.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161116/90790bef/attachment-0001.html>


More information about the mesa-dev mailing list