Marek Olšák
734654a89c
í965: don't use _mesa_prim::is_indirect
...
the vbo change only affects i965
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766 >
2020-02-11 00:34:57 +00:00
Marek Olšák
a7d03103f3
vbo: merge use_buffer_objects into vbo_CreateContext to skip the big malloc
...
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766 >
2020-02-11 00:34:57 +00:00
Marek Olšák
7575a0a251
vbo: clean up resetting vertex attribs
...
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766 >
2020-02-11 00:34:57 +00:00
Marek Olšák
ee5bd8638b
vbo: also map the immediate mode buffer for read
...
because we read from it sometimes and we want cached reads.
We can only do it with the persistent mapping, because the non-persistent
mapping uses incompatible flags.
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766 >
2020-02-11 00:34:57 +00:00
Marek Olšák
27bd241103
vbo: delay flagging FLUSH_STORED_VERTICES until glEnd
...
Only state changes see this, which can't occur before glEnd.
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766 >
2020-02-11 00:34:57 +00:00
Marek Olšák
ca99fe8a60
vbo: add/update unlikely statements in ATTR_UNION
...
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766 >
2020-02-11 00:34:57 +00:00
Marek Olšák
a5f72c91e5
vbo: increase the size of the immediate mode buffer to decrease draw count
...
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766 >
2020-02-11 00:34:57 +00:00
Marek Olšák
2fe771f4e9
vbo: use FlushVertices flags properly and clear NeedFlush correctly
...
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766 >
2020-02-11 00:34:57 +00:00
Marek Olšák
63a241fa32
vbo: fix resizing 64-bit vertex attributes
...
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766 >
2020-02-11 00:34:57 +00:00
Marek Olšák
077a843c27
vbo: optimize resizing vertex attributes during immediate mode
...
Just move data manually instead of copying all attributes back and forth.
This increases performance by 5% for Viewperf11/Catia - first scene.
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766 >
2020-02-11 00:34:57 +00:00
Marek Olšák
1f6e53e243
vbo: don't store glVertex values temporarily into exec
...
This improves performance by 4.3% in Viewperf11/Catia, first scene.
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766 >
2020-02-11 00:34:57 +00:00
Marek Olšák
cd7241c4f8
vbo: pass only either uint32_t or uint64_t into ATTR_UNION
...
This makes the next commit possible.
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766 >
2020-02-11 00:34:57 +00:00
Marek Olšák
afa7f1984a
vbo: don't set FLUSH_UPDATE_CURRENT for glVertex
...
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766 >
2020-02-11 00:34:57 +00:00
Marek Olšák
f8b98d48bf
vbo: keep the immediate mode buffer always mapped for simplicity
...
It only unmaps when it draws with a non-persistent buffer.
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766 >
2020-02-11 00:34:57 +00:00
Marek Olšák
8c76ef5b59
vbo: don't check ctx->NewState twice in glBegin
...
_mesa_valid_to_render does it too.
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766 >
2020-02-11 00:34:57 +00:00
Marek Olšák
f2c6de1eec
vbo: remove a funky recursive call in glBegin
...
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766 >
2020-02-11 00:34:57 +00:00
Marek Olšák
653bd14730
vbo: interleave attrsz, attrtype, and active_sz in memory
...
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766 >
2020-02-11 00:34:57 +00:00
Marek Olšák
2b22e33c10
vbo: remove immediate mode code that doesn't do anything and simplify stuff
...
no change in behavior
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766 >
2020-02-11 00:34:57 +00:00
Marek Olšák
3e0d612f5e
vbo: don't unmap persistent buffer mappings for glBegin/End
...
This significantly improves performance by lowering CPU overhead.
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766 >
2020-02-11 00:34:57 +00:00
Marek Olšák
03ded3d6ce
vbo: skip FlushMappedBufferRange for glBegin/End by using a persistent mapping
...
This is a preparation for the next commit and just isolates the removal
of GL_MAP_FLUSH_EXPLICIT_BIT and other map flags that don't make sense with
UNSYNCHRONIZED.
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766 >
2020-02-11 00:34:57 +00:00
Marek Olšák
10cf7a5113
vbo: create the immediate mode buffer only in vbo_exec_vtx_map
...
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766 >
2020-02-11 00:34:57 +00:00
Marek Olšák
f89ee44ab0
mesa: import PIPE_CAP_SIGNED_VERTEX_BUFFER_OFFSET handling
...
This should decrease overhead in st_update_array.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766 >
2020-02-11 00:34:57 +00:00
Marek Olšák
27dada7ce9
mesa: remove FLUSH_CURRENT calls that have no effect
...
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766 >
2020-02-11 00:34:57 +00:00
Marek Olšák
c7c8fe1cc1
mesa: fix incorrect uses of FLUSH_CURRENT
...
FLUSH_CURRENT is used to copy attributes from the vbo module to
Current.Attrib. It flushes vertices too, but that's a side effect,
not the intent.
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766 >
2020-02-11 00:34:57 +00:00
Marek Olšák
01443dc738
glx: print FPS with 2 decimal places
...
useful if FPS is low.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3590 >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3590 >
2020-02-10 19:02:33 -05:00
Marek Olšák
1082e6fcb8
radeonsi: don't update states for the DCC MSAA bug on GFX6-7
...
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3646 >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3646 >
2020-02-10 17:24:09 -05:00
Marek Olšák
fbb27eebc8
radeonsi: fix the DCC MSAA bug workaround
...
Cc: 19.3 20.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3646 >
2020-02-10 17:24:02 -05:00
Gert Wollny
897a4a0041
r600/sfn: Add some documentation
...
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225 >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225 >
2020-02-10 19:09:08 +00:00
Gert Wollny
7413aab3c8
r600/sfn: Add .editorconfig file
...
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225 >
2020-02-10 19:09:08 +00:00
Gert Wollny
110ee7ff93
r600/sfn: Add support for SSBO load and store
...
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225 >
2020-02-10 19:09:08 +00:00
Gert Wollny
148f0ad4f9
r600/sfn: Add support for atomic instructions
...
v2: fix compilation with gcc-6
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225 >
2020-02-10 19:09:08 +00:00
Gert Wollny
90a7d2e08f
r600: Make sure LLVM is not used for DRAW
...
For some reasone that is not yet clear the piglit
gl-1.0-rendermode-feedback makes use of the LLVM pipe draw module and
fails there with an assertion. Explicietly disabling LLVM fixes this.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225 >
2020-02-10 19:09:08 +00:00
Gert Wollny
37125b7cc2
r600/sfn: Add lowering UBO access to r600 specific codes
...
r600 reads vec4 from the UBO, but the offsets in nir are evaluated to the component.
If the offsets are not literal then all non-vec4 reads must resolve the component
after reading a vec4 component (TODO: figure out whether there is a consistent way
to deduct the component that is actually read).
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225 >
2020-02-10 19:09:08 +00:00
Gert Wollny
32d3435a78
r600/sfn: Add GDS instructions
...
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225 >
2020-02-10 19:09:08 +00:00
Gert Wollny
5aadd809d0
r600/sfn: Add compute shader skeleton
...
This adds some very basic compute shader support.
v2: fix compilation with gcc-6
v3: rebase: correct barrier intrinstic
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225 >
2020-02-10 19:09:08 +00:00
Gert Wollny
7fb5c835f7
r600/sfn: Add VS for TCS shader skeleton
...
This adds the VS shader type that handles the output to tesselation shaders
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225 >
2020-02-10 19:09:08 +00:00
Gert Wollny
e17ac0d774
r600/sfn: Add support for geometry shader
...
v2: fix compilation with gcc-6
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225 >
2020-02-10 19:09:08 +00:00
Gert Wollny
5c7124e134
r600/sfn: add emitVertex instructions
...
More preparation for GS support
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225 >
2020-02-10 19:09:08 +00:00
Gert Wollny
f7ec616bed
r600/sfn: Add MemRingOut instructions
...
Preparing support for Geometry shaders.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225 >
2020-02-10 19:09:08 +00:00
Gert Wollny
1b17316bf3
r600/sfn: Add a load GDS result instruction
...
This is required to read results for atomic SSBO instructions
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225 >
2020-02-10 19:09:08 +00:00
Gert Wollny
31a4dd6451
r600/sfn: Add lowering arrays to scratch and according instructions
...
Make use of the scratch space for arrays that are larger then 100 elements.
Since for IO r600 is vector based, there is a bit of a scratch space waste
here for arrays that use types smaller then vec4.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225 >
2020-02-10 19:09:08 +00:00
Gert Wollny
5c19013904
r600/sfn: add register remapping
...
Make use of the live range evaluation to merge registers. Since the
live ranges are evaluated for register indices, the algorithm is not
optimal, but for most piglits up to glsl-3.3 it does the job.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225 >
2020-02-10 19:09:08 +00:00
Gert Wollny
393655d5cb
r600/sfn: add live range evaluation for the GPR
...
The algoritm is basically a copy of the TGSI implementation without the
array bits.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225 >
2020-02-10 19:09:08 +00:00
Gert Wollny
24f683fe81
r600/sfn: Add the WaitAck instruction
...
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225 >
2020-02-10 19:09:08 +00:00
Gert Wollny
e09cdb3f86
r600/sfn: Add the VS in and FS out vectorization
...
Since the nir default implementation doesn't support vectorizing the VS
inputs and FS outputs, additional lowering passes are added here to do
just that. The work is based on the Timothy Arceri's related work.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225 >
2020-02-10 19:09:08 +00:00
Gert Wollny
c5d9456d84
r600: enable NIR backend DEBUG flag for supported architectures
...
When NIR is enabled, a few features that are not yet supported will be
explicitely disabled.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225 >
2020-02-10 19:09:08 +00:00
Gert Wollny
f718ac6268
r600/sfn: Add a basic nir shader backend
...
This commit adds support for vertex and fragment shaders from NIR, and
support for most TEX and ALU instructions.
Thanks Dave Airlied for adding support for a number of ALU instructions.
v2: fix compilation with gcc-6
v3: rebase: use mesa/core glsl_type_size function
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225 >
2020-02-10 19:09:08 +00:00
Gert Wollny
295be0e8df
r600: Update state code to accept NIR shaders
...
v2: Correct commit message (Konstantin Kharlamov)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225 >
2020-02-10 19:09:08 +00:00
Gert Wollny
51285bf32e
r600: Add NIR compiler options
...
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225 >
2020-02-10 19:09:08 +00:00
Gert Wollny
27cacd28ac
r600: Increase space for IO values to agree with PIPE_MAX_SHADER_IN/OUTPUTS
...
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225 >
2020-02-10 19:09:08 +00:00