[Mesa-dev] [PATCH v2 1/2] gallium: add scalar isa shader cap
Marek Olšák
maraeo at gmail.com
Fri Jun 8 19:54:39 UTC 2018
FYI, r600 prefers vectors.
Marek
On Fri, Jun 8, 2018 at 5:10 AM, Christian Gmeiner <
christian.gmeiner at gmail.com> wrote:
> v1 -> v2:
> - nv30 is _NOT_ scalar as suggested by Ilia Mirkin.
> - Change from a screen cap to a shader cap as suggested
> by Eric Anholt.
> - radeonsi is scalar as suggested by Marek Olšák.
> - Change missing ones to be scalar.
>
> Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
> ---
> src/gallium/auxiliary/gallivm/lp_bld_limits.h | 2 ++
> src/gallium/auxiliary/tgsi/tgsi_exec.h | 2 ++
> src/gallium/docs/source/screen.rst | 1 +
> src/gallium/drivers/etnaviv/etnaviv_screen.c | 1 +
> src/gallium/drivers/freedreno/freedreno_screen.c | 3 ++-
> src/gallium/drivers/nouveau/nv30/nv30_screen.c | 2 ++
> src/gallium/drivers/nouveau/nv50/nv50_screen.c | 2 ++
> src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 2 ++
> src/gallium/drivers/r600/r600_pipe.c | 2 ++
> src/gallium/drivers/radeonsi/si_get.c | 2 ++
> src/gallium/drivers/svga/svga_screen.c | 6 ++++++
> src/gallium/drivers/v3d/v3d_screen.c | 2 ++
> src/gallium/drivers/vc4/vc4_screen.c | 2 ++
> src/gallium/drivers/virgl/virgl_screen.c | 3 +++
> src/gallium/include/pipe/p_defines.h | 1 +
> 15 files changed, 32 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/auxiliary/gallivm/lp_bld_limits.h
> b/src/gallium/auxiliary/gallivm/lp_bld_limits.h
> index c7755bfe1d..7b66b75872 100644
> --- a/src/gallium/auxiliary/gallivm/lp_bld_limits.h
> +++ b/src/gallium/auxiliary/gallivm/lp_bld_limits.h
> @@ -143,6 +143,8 @@ gallivm_get_shader_param(enum pipe_shader_cap param)
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS:
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS:
> return 0;
> + case PIPE_SHADER_CAP_SCALAR_ISA:
> + return 1;
> case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT:
> return 32;
> }
> diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.h
> b/src/gallium/auxiliary/tgsi/tgsi_exec.h
> index 0fac7ea456..ed8b9e8869 100644
> --- a/src/gallium/auxiliary/tgsi/tgsi_exec.h
> +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.h
> @@ -544,6 +544,8 @@ tgsi_exec_get_shader_param(enum pipe_shader_cap param)
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS:
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS:
> return 0;
> + case PIPE_SHADER_CAP_SCALAR_ISA:
> + return 1;
> case PIPE_SHADER_CAP_MAX_SHADER_BUFFERS:
> return PIPE_MAX_SHADER_BUFFERS;
> case PIPE_SHADER_CAP_MAX_SHADER_IMAGES:
> diff --git a/src/gallium/docs/source/screen.rst
> b/src/gallium/docs/source/screen.rst
> index 0f18b7a94b..a044099873 100644
> --- a/src/gallium/docs/source/screen.rst
> +++ b/src/gallium/docs/source/screen.rst
> @@ -546,6 +546,7 @@ MOV OUT[0], CONST[0][3] # copy vector 3 of constbuf 0
> how many HW counters are available for this stage. (0 uses SSBO
> atomics).
> * ``PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS``: If atomic counters
> are
> separate, how many atomic counter buffers are available for this stage.
> +* ``PIPE_SHADER_CAP_SCALAR_ISA``: Whether the ISA is a scalar one.
>
> .. _pipe_compute_cap:
>
> diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c
> b/src/gallium/drivers/etnaviv/etnaviv_screen.c
> index e031807117..e426514cc6 100644
> --- a/src/gallium/drivers/etnaviv/etnaviv_screen.c
> +++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c
> @@ -473,6 +473,7 @@ etna_screen_get_shader_param(struct pipe_screen
> *pscreen,
> case PIPE_SHADER_CAP_TGSI_SKIP_MERGE_REGISTERS:
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS:
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS:
> + case PIPE_SHADER_CAP_SCALAR_ISA:
> return 0;
> }
>
> diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c
> b/src/gallium/drivers/freedreno/freedreno_screen.c
> index a414cb6d60..97eec73238 100644
> --- a/src/gallium/drivers/freedreno/freedreno_screen.c
> +++ b/src/gallium/drivers/freedreno/freedreno_screen.c
> @@ -592,7 +592,8 @@ fd_screen_get_shader_param(struct pipe_screen
> *pscreen,
> case PIPE_SHADER_CAP_TGSI_SKIP_MERGE_REGISTERS:
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS:
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS:
> - return 0;
> + case PIPE_SHADER_CAP_SCALAR_ISA:
> + return 1;
> case PIPE_SHADER_CAP_MAX_SHADER_BUFFERS:
> case PIPE_SHADER_CAP_MAX_SHADER_IMAGES:
> if (is_a5xx(screen)) {
> diff --git a/src/gallium/drivers/nouveau/nv30/nv30_screen.c
> b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
> index a77f70e6bb..dce88e1b1a 100644
> --- a/src/gallium/drivers/nouveau/nv30/nv30_screen.c
> +++ b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
> @@ -343,6 +343,7 @@ nv30_screen_get_shader_param(struct pipe_screen
> *pscreen,
> case PIPE_SHADER_CAP_TGSI_SKIP_MERGE_REGISTERS:
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS:
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS:
> + case PIPE_SHADER_CAP_SCALAR_ISA:
> return 0;
> default:
> debug_printf("unknown vertex shader param %d\n", param);
> @@ -395,6 +396,7 @@ nv30_screen_get_shader_param(struct pipe_screen
> *pscreen,
> case PIPE_SHADER_CAP_TGSI_SKIP_MERGE_REGISTERS:
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS:
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS:
> + case PIPE_SHADER_CAP_SCALAR_ISA:
> return 0;
> default:
> debug_printf("unknown fragment shader param %d\n", param);
> diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
> b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
> index 2495a545fd..0aa227799d 100644
> --- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
> +++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
> @@ -386,6 +386,8 @@ nv50_screen_get_shader_param(struct pipe_screen
> *pscreen,
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS:
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS:
> return 0;
> + case PIPE_SHADER_CAP_SCALAR_ISA:
> + return 1;
> default:
> NOUVEAU_ERR("unknown PIPE_SHADER_CAP %d\n", param);
> return 0;
> diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
> b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
> index f679cbdba3..055872a1d6 100644
> --- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
> +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
> @@ -425,6 +425,8 @@ nvc0_screen_get_shader_param(struct pipe_screen
> *pscreen,
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS:
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS:
> return 0;
> + case PIPE_SHADER_CAP_SCALAR_ISA:
> + return 1;
> case PIPE_SHADER_CAP_MAX_SHADER_BUFFERS:
> return NVC0_MAX_BUFFERS;
> case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
> diff --git a/src/gallium/drivers/r600/r600_pipe.c
> b/src/gallium/drivers/r600/r600_pipe.c
> index ff7306998b..2ba5457448 100644
> --- a/src/gallium/drivers/r600/r600_pipe.c
> +++ b/src/gallium/drivers/r600/r600_pipe.c
> @@ -652,6 +652,8 @@ static int r600_get_shader_param(struct pipe_screen*
> pscreen,
> return EG_MAX_ATOMIC_BUFFERS;
> }
> return 0;
> + case PIPE_SHADER_CAP_SCALAR_ISA:
> + return 1;
> case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT:
> /* due to a bug in the shader compiler, some loops hang
> * if they are not unrolled, see:
> diff --git a/src/gallium/drivers/radeonsi/si_get.c
> b/src/gallium/drivers/radeonsi/si_get.c
> index 01050cf02b..cbde0fe3c3 100644
> --- a/src/gallium/drivers/radeonsi/si_get.c
> +++ b/src/gallium/drivers/radeonsi/si_get.c
> @@ -492,6 +492,8 @@ static int si_get_shader_param(struct pipe_screen*
> pscreen,
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS:
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS:
> return 0;
> + case PIPE_SHADER_CAP_SCALAR_ISA:
> + return 1;
> }
> return 0;
> }
> diff --git a/src/gallium/drivers/svga/svga_screen.c
> b/src/gallium/drivers/svga/svga_screen.c
> index 2744f3100e..3fbf748a6e 100644
> --- a/src/gallium/drivers/svga/svga_screen.c
> +++ b/src/gallium/drivers/svga/svga_screen.c
> @@ -555,6 +555,8 @@ vgpu9_get_shader_param(struct pipe_screen *screen,
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS:
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS:
> return 0;
> + case PIPE_SHADER_CAP_SCALAR_ISA:
> + return 1;
> case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT:
> return 32;
> }
> @@ -622,6 +624,8 @@ vgpu9_get_shader_param(struct pipe_screen *screen,
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS:
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS:
> return 0;
> + case PIPE_SHADER_CAP_SCALAR_ISA:
> + return 1;
> case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT:
> return 32;
> }
> @@ -723,6 +727,8 @@ vgpu10_get_shader_param(struct pipe_screen *screen,
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS:
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS:
> return 0;
> + case PIPE_SHADER_CAP_SCALAR_ISA:
> + return 1;
> case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT:
> return 32;
> default:
> diff --git a/src/gallium/drivers/v3d/v3d_screen.c
> b/src/gallium/drivers/v3d/v3d_screen.c
> index d578265eef..bf1af7e404 100644
> --- a/src/gallium/drivers/v3d/v3d_screen.c
> +++ b/src/gallium/drivers/v3d/v3d_screen.c
> @@ -410,6 +410,8 @@ v3d_screen_get_shader_param(struct pipe_screen
> *pscreen, unsigned shader,
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS:
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS:
> return 0;
> + case PIPE_SHADER_CAP_SCALAR_ISA:
> + return 1;
> case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
> case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:
> case PIPE_SHADER_CAP_MAX_SHADER_IMAGES:
> diff --git a/src/gallium/drivers/vc4/vc4_screen.c
> b/src/gallium/drivers/vc4/vc4_screen.c
> index 6415d95746..d7577ed90a 100644
> --- a/src/gallium/drivers/vc4/vc4_screen.c
> +++ b/src/gallium/drivers/vc4/vc4_screen.c
> @@ -464,6 +464,8 @@ vc4_screen_get_shader_param(struct pipe_screen
> *pscreen,
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS:
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS:
> return 0;
> + case PIPE_SHADER_CAP_SCALAR_ISA:
> + return 1;
> default:
> fprintf(stderr, "unknown shader param %d\n", param);
> return 0;
> diff --git a/src/gallium/drivers/virgl/virgl_screen.c
> b/src/gallium/drivers/virgl/virgl_screen.c
> index e8d1c75177..7a33ca1be5 100644
> --- a/src/gallium/drivers/virgl/virgl_screen.c
> +++ b/src/gallium/drivers/virgl/virgl_screen.c
> @@ -363,6 +363,9 @@ virgl_get_shader_param(struct pipe_screen *screen,
> case PIPE_SHADER_CAP_FP16:
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS:
> case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS:
> + return 0;
> + case PIPE_SHADER_CAP_SCALAR_ISA:
> + return 1;
> default:
> return 0;
> }
> diff --git a/src/gallium/include/pipe/p_defines.h
> b/src/gallium/include/pipe/p_defines.h
> index 6cc73a31bf..62d2bd3abb 100644
> --- a/src/gallium/include/pipe/p_defines.h
> +++ b/src/gallium/include/pipe/p_defines.h
> @@ -897,6 +897,7 @@ enum pipe_shader_cap
> PIPE_SHADER_CAP_TGSI_LDEXP_SUPPORTED,
> PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS,
> PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS,
> + PIPE_SHADER_CAP_SCALAR_ISA,
> };
>
> /**
> --
> 2.17.1
>
> _______________________________________________
> 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/20180608/508dbb52/attachment-0001.html>
More information about the mesa-dev
mailing list