Commit Graph

131816 Commits

Author SHA1 Message Date
Jesse Natalie 456620a6ad d3d12: Misc fixes caught by GCC warnings / code inspection
* A const-correctness issue
* Some uninitialized variables
* A missing copyright header
* A comment with a /* in it when only * was needed

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7780>
2020-12-01 17:10:47 +00:00
Jesse Natalie 4e481a1f65 microsoft/compiler: Fix unhandled switch case warnings
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7780>
2020-12-01 17:10:47 +00:00
Jesse Natalie eebb04fca4 d3d12: Fix unhandled switch case warnings
Some D3D enums have invalid values (e.g. NONE) in the enum,
so default: makes sense to catch invalid values in those cases.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7780>
2020-12-01 17:10:47 +00:00
Jesse Natalie 80dcd63f64 d3d12: Clean up d3d12_compiler.h
Move some stuff from d3d12_context.h to d3d12_compiler.h, and
fix d3d12_compiler.h to not include d3d12_context.h.

This serves two purposes:
1. Putting declarations and definitions where they really belong.
2. Making it so only C++ code needs d3d12.h simplifies the helpers
   we need to add to add to support d3d12.h for Linux.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7780>
2020-12-01 17:10:47 +00:00
Jesse Natalie 244a41d6a8 d3d12: Remove Windows-specific macros
These all have trivial standard or Mesa replacements

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7780>
2020-12-01 17:10:47 +00:00
Jesse Natalie 4358af87e7 d3d12: Fix signed-unsigned comparison warnings
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7780>
2020-12-01 17:10:47 +00:00
Jesse Natalie 6060291c0e d3d12: Fix brace-initialization issues
For C++ code, we shouldn't use {0}, instead use {} to default-
initialize everything. For code with nested structs/unions, make
sure there's enough braces to appropriately scope initialization.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7780>
2020-12-01 17:10:46 +00:00
Jesse Natalie c3bf781cb0 microsoft/compiler: Remove dead code/variables
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7780>
2020-12-01 17:10:46 +00:00
Jesse Natalie af6983885b d3d12: Delete unused local variables
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7780>
2020-12-01 17:10:46 +00:00
Michel Zou 89f6b72f19 gallium/tests: fix unused-but-set-variable warning
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7713>
2020-12-01 16:51:01 +00:00
Michel Zou 34e5b46fff softpipe: fix maybe-uninitialized warning
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7713>
2020-12-01 16:51:01 +00:00
Michel Zou 5a702fa4e5 wgl: fix maybe-uninitialized warning
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7713>
2020-12-01 16:51:01 +00:00
Michel Zou def15ad9ab glsl: fix redefinition warning on win32
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7713>
2020-12-01 16:51:01 +00:00
Michel Zou 07a68d27b3 glapi: fix unused-function warning
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7713>
2020-12-01 16:51:01 +00:00
Michel Zou 89b01cc025 util: fix mingw format-extra-args warning
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7713>
2020-12-01 16:51:01 +00:00
Daniel Schürmann 5f6c5e5b86 nir: don't sink instructions into loops
Repeatedly loading constants or evaluating ALU operations
in loops doesn't seem beneficial. This might increase the register
pressure, but the tradeoff seems worth it.

Totals from 13629 (9.77% of 139517) affected shaders (RAVEN):
SGPRs: 1179481 -> 1184697 (+0.44%); split: -0.03%, +0.47%
VGPRs: 978776 -> 978732 (-0.00%); split: -0.02%, +0.02%
SpillSGPRs: 51036 -> 50943 (-0.18%); split: -1.35%, +1.17%
CodeSize: 113775020 -> 113428812 (-0.30%); split: -0.34%, +0.04%
MaxWaves: 49877 -> 49881 (+0.01%); split: +0.02%, -0.01%
Instrs: 22295979 -> 22204936 (-0.41%); split: -0.42%, +0.02%
Cycles: 1637198832 -> 1626916048 (-0.63%); split: -0.64%, +0.01%
VMEM: 2403434 -> 2507645 (+4.34%); split: +4.76%, -0.42%
SMEM: 849676 -> 834576 (-1.78%); split: +0.60%, -2.38%
VClause: 412396 -> 398139 (-3.46%); split: -3.46%, +0.01%
SClause: 810480 -> 817349 (+0.85%); split: -0.19%, +1.04%
Copies: 2188260 -> 2166716 (-0.98%); split: -1.18%, +0.19%
Branches: 761204 -> 760475 (-0.10%); split: -0.15%, +0.05%
PreSGPRs: 972892 -> 981054 (+0.84%); split: -0.05%, +0.89%
PreVGPRs: 925390 -> 925420 (+0.00%); split: -0.02%, +0.02%

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7694>
2020-12-01 17:31:06 +01:00
Erik Faye-Lund b02e15d1a3 d3d12: do not inspect NULL samplers
We can risk having NULL samplers in this range, so let's ignore them
while we're populating the shader-key.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7856>
2020-12-01 15:15:50 +00:00
Timur Kristóf 94f8cb29ee aco: Fix NGG GS assert failure from the WG scan.
There was a temp which was defined in a branch but used outside,
without a phi.

Fixes: 62b5012ec3
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7817>
2020-12-01 15:04:58 +00:00
Marcin Ślusarz c2974a1d45 intel/tools/aubinator_error_decode: allow 0 arguments
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7833>
2020-12-01 14:44:04 +00:00
Marcin Ślusarz 7a7010d4f5 intel/tools/aubinator_error_decode: allow "-" as an input file
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7833>
2020-12-01 14:44:04 +00:00
Marcin Ślusarz 8ffa45a775 intel/tools/aubinator_error_decode: exit with an error on unknown option
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7833>
2020-12-01 14:44:04 +00:00
Erik Faye-Lund f9e4c0ada1 d3d12: lower bitfield_extract to shifts
This wasn't implemented yet, because we hadn't encountered it yet. But
now it seems we can trigger this, thanks to the nv_copy_depth_to_color
piglit tests.

This makes the test go from crash to fail, which isn't perfect, but it's
better than nothing.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7855>
2020-12-01 13:59:30 +00:00
Samuel Pitoiset 3a858ecd40 Revert "radv/llvm,aco: always split typed vertex buffer loads on GFX6 and GFX10+"
It introduces regressions.

This reverts commit 6fb4babfe9.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7852>
2020-12-01 14:31:16 +01:00
Samuel Pitoiset 4c58c68ea6 ci: disable check-commits
Otherwise the CI sanity check fails if the commit title exceed
80 characters

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7852>
2020-12-01 14:31:11 +01:00
Christian Gmeiner 37226269d3 etnaviv/drm: add some locking asserts
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7832>
2020-12-01 12:20:45 +00:00
Christian Gmeiner 034dd948df etnaviv/drm: convert to simple_mtx
We do not need a full blown pthread mutex.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7832>
2020-12-01 12:20:45 +00:00
Christian Gmeiner aad0c7c6b8 etnaviv/drm: fix evil-twin etna_drm_table_lock
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7832>
2020-12-01 12:20:45 +00:00
Iago Toral Quiroga 4f7d4871a6 v3dv: don't log out of pool memory errors for internal driver pools
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7848>
2020-12-01 12:10:11 +00:00
Iago Toral Quiroga 9adbaeff85 v3dv: move error string definition to debug path
No point in computing this if debug is disabled.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7848>
2020-12-01 12:10:11 +00:00
Marek Olšák 4679a3855f mesa: replace ParameterValueOffset[i] with Parameters[i].ValueOffset
to merge both arrays and remove malloc because both arrays have
the same size.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák 1755a5a384 compiler: decrease STATE_LENGTH from 5 to 4
The rework of matrix state vars made the last element unused.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák fdd3a448ae st/mesa: fix uninitialized/random clip plane state vars in lower_ucp
Fixes: 584f27326c - st/mesa: factor ucp-lowering logic into helper

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák f097c8773e mesa: allocate the attribute stack on demand
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák c0456a6565 mesa: remove gl_texture_object references from glPush/PopAttrib stack
I don't see why this is needed and it's not used anywhere.
As long as apps don't call glDeleteTextures, nothing will release them.
And even if they do, we don't use the saved textures anywhere.

Also, BindTexture will fail for deleted textures anyway, so they can't be
popped. The existing code already binds the Name that was saved, not
the texture object that was saved.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák 959380dcb0 mesa: more optimizations in glPopAttrib (colormask, drawbuffers, coord replace)
Acked-by: Adam Jackson <ajax@redhat.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák f6f6d3c0e7 mesa: optimize out no-op calls in glPopAttrib
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák 27b981352a mesa: skip _mesa_set_enable in glPopAttrib if there are no changes
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák b4bf872585 mesa: reduce the size of gl_texture_attrib_node::Texture by about 90%
Let's get rid of the big memcpy.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák d0e18550e2 mesa: optimize saving/restoring bound textures for glPush/PopAttrib
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák 9a8b54285d mesa: reorganize gl_texture and sampler structures for glPush/PopAttrib
Put the fields saved by glPush/PopAttrib into the sub-structure declared
as Attrib. This will make glPush/PopAttrib much faster because it will
only save and restore that structure.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák 7fa9d9d06c mesa: add a fast path for restoring light attributes in glPopAttrib
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák 734af61353 mesa: add a fast path for restoring fixed-func tex state in glPopAttrib
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Marek Olšák 3be42f9ca1 mesa: rewrite glPushAttrib/glPopAttrib to get rid of malloc
This was inevitable. This gets rid of the malloc/free calls and chaining
each push group in a linked list. Now the whole attribute stack is declared
statically in gl_context.

Yes, this improves performance a lot.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák e08b3b74e7 mesa: treat glPopMatrix as a no-op state change if it doesn't change the matrix
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák 0d7347105f mesa: memset matrices at initialization to enable memcpy on it
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák 019f131601 mesa: canonicalize matrix in glPushMatrix to make glPopMatrix possibly a no-op
If there are no changes to the matrix, we can move pop the stack but not
update any state constants.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák f5d17070be mesa: consider glPushMatrix a no-op change from the driver perspective
It doesn't change any states.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák b1982fd3d2 mesa: skip glMultMatrix if the matrix is identity
This happens a lot with viewperf and it causes unnecessary constant buffer
updates.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák 7b50332aef mesa: fix crashes in the no_error case of invalid glUniform calls
I copied error conditions from validate_uniform_parameters.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00
Marek Olšák f94c190581 st/mesa: replace st_context::state::constants with a mask
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:10 +00:00