Module: Mesa Branch: master Commit: 987fef5f0ec5792dee840eaa9178fe84300543c2 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=987fef5f0ec5792dee840eaa9178fe84300543c2
Author: Ilia Mirkin <[email protected]> Date: Tue Mar 9 16:11:29 2021 -0500 nvc0: enable minmax reductions on gm200+ Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Karol Herbst <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9487> --- src/gallium/drivers/nouveau/nv50/g80_texture.xml.h | 21 +++++++++++++-------- src/gallium/drivers/nouveau/nv50/nv50_state.c | 7 +++++++ src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 1 + 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/gallium/drivers/nouveau/nv50/g80_texture.xml.h b/src/gallium/drivers/nouveau/nv50/g80_texture.xml.h index 542963ca452..72f480401c2 100644 --- a/src/gallium/drivers/nouveau/nv50/g80_texture.xml.h +++ b/src/gallium/drivers/nouveau/nv50/g80_texture.xml.h @@ -4,17 +4,17 @@ /* Autogenerated file, DO NOT EDIT manually! This file was generated by the rules-ng-ng headergen tool in this git repository: -http://github.com/envytools/envytools/ +https://github.com/envytools/envytools/ git clone https://github.com/envytools/envytools.git The rules-ng-ng source files this header was generated from are: -- /home/skeggsb/git/envytools/rnndb/../rnndb/graph/g80_texture.xml ( 18837 bytes, from 2016-01-14 23:54:22) -- /home/skeggsb/git/envytools/rnndb/copyright.xml ( 6456 bytes, from 2015-09-10 02:57:40) -- /home/skeggsb/git/envytools/rnndb/nvchipsets.xml ( 2908 bytes, from 2016-02-02 23:45:00) -- /home/skeggsb/git/envytools/rnndb/g80_defs.xml ( 21739 bytes, from 2016-02-04 00:29:42) -- /home/skeggsb/git/envytools/rnndb/nv_defs.xml ( 5388 bytes, from 2016-01-14 23:54:22) +- envytools/rnndb/./graph/g80_texture.xml ( 19104 bytes, from 2021-03-09 21:53:05) +- envytools/rnndb/copyright.xml ( 6431 bytes, from 2021-03-01 01:32:28) +- envytools/rnndb-generated/nvchipsets.xml ( 3335 bytes, from 2020-04-11 17:28:38) +- envytools/rnndb/g80_defs.xml ( 21781 bytes, from 2021-03-09 21:57:03) +- envytools/rnndb/nv_defs.xml ( 5522 bytes, from 2021-03-01 01:32:28) -Copyright (C) 2006-2016 by the following authors: +Copyright (C) 2006-2021 by the following authors: - Artur Huillet <[email protected]> (ahuillet) - Ben Skeggs (darktama, darktama_) - B. R. <[email protected]> (koala_br) @@ -32,7 +32,7 @@ Copyright (C) 2006-2016 by the following authors: - Laurent Carlier <[email protected]> (lordheavy) - Luca Barbieri <[email protected]> (lb, lb1) - Maarten Maathuis <[email protected]> (stillunknown) -- Marcin KoĆcielnicki <[email protected]> (mwk, koriakin) +- Marcelina KoĆcielnicka <[email protected]> (mwk) - Mark Carey <[email protected]> (careym) - Matthieu Castet <[email protected]> (mat-c) - nvidiaman <[email protected]> (nvidiaman) @@ -405,6 +405,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define G80_TSC_1_MIP_FILTER_NEAREST 0x00000080 #define G80_TSC_1_MIP_FILTER_LINEAR 0x000000c0 #define GK104_TSC_1_CUBEMAP_INTERFACE_FILTERING 0x00000200 +#define GM204_TSC_1_REDUCTION_MODE__MASK 0x00000c00 +#define GM204_TSC_1_REDUCTION_MODE__SHIFT 10 +#define GM204_TSC_1_REDUCTION_MODE_WEIGHTED_AVERAGE 0x00000000 +#define GM204_TSC_1_REDUCTION_MODE_MIN 0x00000400 +#define GM204_TSC_1_REDUCTION_MODE_MAX 0x00000800 #define G80_TSC_1_MIP_LOD_BIAS__MASK 0x01fff000 #define G80_TSC_1_MIP_LOD_BIAS__SHIFT 12 #define G80_TSC_1_MIP_LOD_BIAS__RADIX 0x00000008 diff --git a/src/gallium/drivers/nouveau/nv50/nv50_state.c b/src/gallium/drivers/nouveau/nv50/nv50_state.c index 72f0a9aaceb..93bb3a724db 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_state.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_state.c @@ -536,6 +536,13 @@ nv50_sampler_state_create(struct pipe_context *pipe, so->seamless_cube_map = cso->seamless_cube_map; } + if (nouveau_screen(pipe->screen)->class_3d >= GM200_3D_CLASS) { + if (cso->reduction_mode == PIPE_TEX_REDUCTION_MIN) + so->tsc[1] |= GM204_TSC_1_REDUCTION_MODE_MIN; + if (cso->reduction_mode == PIPE_TEX_REDUCTION_MAX) + so->tsc[1] |= GM204_TSC_1_REDUCTION_MODE_MAX; + } + if (cso->max_anisotropy >= 16) so->tsc[0] |= (7 << 20); else diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c index c4b66894996..e1d4dc8fddd 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c @@ -323,6 +323,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) case PIPE_CAP_PROGRAMMABLE_SAMPLE_LOCATIONS: case PIPE_CAP_VIEWPORT_SWIZZLE: case PIPE_CAP_VIEWPORT_MASK: + case PIPE_CAP_SAMPLER_REDUCTION_MINMAX: return class_3d >= GM200_3D_CLASS; case PIPE_CAP_CONSERVATIVE_RASTER_PRE_SNAP_TRIANGLES: return class_3d >= GP100_3D_CLASS; _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
