Commit Graph

136854 Commits

Author SHA1 Message Date
Emma Anholt 3ffd6f3fa6 nir_to_tgsi: Set the TGSI Precise flag for exact ALU instructions.
This flag is used by the nv50, r600, and svga backends for instruction
exactness.  It was easier to plumb it in as an override in tgsi_ureg than
to make all of ALU instruction emit do it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14201>
2021-12-15 21:58:04 +00:00
Ian Romanick af4d277ccc mesa: OpenGL 1.3 and OpenGL ES 1.0 are not optional
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14203>
2021-12-15 20:25:19 +00:00
Ian Romanick 5f14e98780 mesa: OpenGL 1.3 feature GL_ARB_texture_env_dot3 is not optional
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14203>
2021-12-15 20:25:19 +00:00
Ian Romanick 61a3e68767 mesa: OpenGL 1.3 feature GL_ARB_texture_env_combine is not optional
v2: GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, and GL_ONE_MINUS_SRC_ALPHA
should always be supported now. Noticed by Marek.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14203>
2021-12-15 20:25:19 +00:00
Ian Romanick 7649ab1f03 mesa: OpenGL 1.3 feature GL_ARB_texture_cube_map is not optional
Cheatsheet:

_mesa_has_ARB_texture_cube_map() becomes (true &&
ctx->Extensions.Version >=
_mesa_extension_table[...].version[ctx->API]).  The last value is 0 when
ctx->API is API_OPENGL_COMPAT and ~0 otherwise.  The whole function
effectively becomes (ctx->API == API_OPENGL_COMPAT).

_mesa_has_OES_texture_cube_map() becomes (true &&
ctx->Extensions.Version >=
_mesa_extension_table[...].version[ctx->API]).  The last value is 0 when
ctx->API is API_OPENGLES and ~0 otherwise.  The whole function
effectively becomes (ctx->API == API_OPENGLES).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14203>
2021-12-15 20:25:19 +00:00
Ian Romanick c11641ab24 mesa: OpenGL 1.3 feature GL_ARB_texture_border_clamp is not optional
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14203>
2021-12-15 20:25:19 +00:00
Ian Romanick 2ca13abcce intel/fs: Use HF as destination type for F32TOF16 in fquantize2f16
Having an integer destination type instead of a float destination type
confuses the SWSB code.  This causes problems on some Intel GPUs.  Fix
this by using the correct type in the destination of the F32TOF16
opcode.

Gfx7 doesn't have the HF type, so continue to emit W on that platform.
The assertions in brw_F32TO16 (brw_eu_emit.c) are updated to reflect
this.  In scalar mode, UD is never emitted as a destination type for
this opcode, so remove it from the allowed types in the assertion.

I also condidered doing something like de55fd358f ("intel/fs/xehp:
Teach SWSB pass about the exec pipeline of
FS_OPCODE_PACK_HALF_2x16_SPLIT."), but Curro recommended that just using
the correct types is a better fix.  I agree.

v2: Add missing changes to fs_generator::generate_pack_half_2x16_split.
I'm not sure how I (and the Intel CI) missed that the first time. :(

v3: Fix copy-and-paste issue in the v2 fix. Noticed by Tapani.

Reviewed-by: Francisco Jerez <currojerez@riseup.net> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14181>
2021-12-15 20:03:51 +00:00
Chia-I Wu 9c81de7df2 venus: cache shmems
Shmems are allocated internally and are only for CPU access.  They can
be easily cached.

Venus have 4 sources of shmem allocations

 - the ring buffer
 - the reply stream
 - the indirection submission upload cs
 - one cs for each vn_command_buffer

The first one is allocated only once.  The other three reallocate
occasionally.  The frequencies depend on the workloads.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14179>
2021-12-15 19:02:29 +00:00
Chia-I Wu 7bec2a0b23 venus: add VN_CS_ENCODER_STORAGE_SHMEM_POOL for VkCommandBuffer
It suballocates from a shmem pool owned by vn_instance.  The goals are
to speed up shmem allocations for VkCommandBuffer and to reduce the
number of BOs.  Both are crucial when shmems are HOST3D BOs, because
they require roundtrips to the renderer to allocate and they take up KVM
memslots.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14179>
2021-12-15 19:02:29 +00:00
Chia-I Wu 487926aa86 venus: add vn_cs_encoder_storage_type
It generalizes cs->indirect.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14179>
2021-12-15 19:02:29 +00:00
Chia-I Wu 1fe8f0fea0 venus: use vn_renderer_shmem_pool for reply shmems
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14179>
2021-12-15 19:02:29 +00:00
Chia-I Wu 35c430e75a venus: add vn_renderer_shmem_pool
It provides shmem suballocations.  It is designed to be used with
short-lived shmems.  A long-lived shmem can hold on to some large
allocation while only using a likely small region of the large
allocation.

v2: cleanups suggested by Yiwei

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com> (v1)
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14179>
2021-12-15 19:02:29 +00:00
Chia-I Wu 511fb6b8e9 venus: add vn_renderer_util.[ch]
Move helpers built on top of vn_renderer.h to the new files.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14179>
2021-12-15 19:02:29 +00:00
Dave Airlie ee283c49b7 mesa: inline mesa_initialize_buffer_object.
This has no other users now.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
2021-12-15 13:29:33 +00:00
Dave Airlie 131efc204d mesa/st: remove st_cb_bufferobjects*
this has all been merged into mesa now

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
2021-12-15 13:29:33 +00:00
Dave Airlie 8c1472bc84 mesa/bufferobj: move invalidate buffer to optional feature
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
2021-12-15 13:29:33 +00:00
Dave Airlie a79f5d9016 mesa/st: rename access flag to transfer flag function
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
2021-12-15 13:29:33 +00:00
Dave Airlie fdd31298d3 bufferobj: cleanup subdata copies
This moves the common dst min/max invalidation and renames
to be a bit more consistent

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
2021-12-15 13:29:33 +00:00
Dave Airlie 955ddc02e4 bufferobj: inline page commitment
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
2021-12-15 13:29:33 +00:00
Dave Airlie 55bb6cc8e1 bufferobj: inline buffer clearing
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
2021-12-15 13:29:33 +00:00
Dave Airlie 22e516b846 bufferobj: make sw clear buffer static, move it and rename it
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
2021-12-15 13:29:33 +00:00
Dave Airlie ff8c2a1748 mesa/bufferobj: rename bufferobj functions to be more consistent.
After all the refactoring, start consolidating a bit and get the API
names more consistent

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
2021-12-15 13:29:33 +00:00
Dave Airlie f6840bb940 mesa/st: make static the buffer object funcs that can be
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
2021-12-15 13:29:33 +00:00
Dave Airlie 7288fcdc72 mesa/st: migrate most of state tracker buffer objects into mesa
This moves all of non-optional st functions into the main bufferobj.c
file.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
2021-12-15 13:29:33 +00:00
Dave Airlie 8232cf1b4d mesa: add pointer to cso_context to gl_context
Makes migrating code easier

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
2021-12-15 13:29:33 +00:00
Dave Airlie 22607020f5 mesa: add a pointer to st_config_options to gl_context
Allows porting out of st code easier

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
2021-12-15 13:29:33 +00:00
Dave Airlie f6c608dd24 mesa: add a pipe_context pointer to gl context
This will be used to move more code over

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
2021-12-15 13:29:33 +00:00
Dave Airlie 90cb1493b7 mesa/st: start moving bufferobject alloc/free/reference to main.
This moves these out of the state tracker code

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
2021-12-15 13:29:33 +00:00
Dave Airlie 970daedb1d mesa/st: merge st buffer object into GL
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14133>
2021-12-15 13:29:33 +00:00
Alejandro Piñeiro 1c4f76672d broadcom/compiler: avoid unneeded sint/unorm clamping when lowering stores
They are being used on integer to integer stores. From Vulkan sec,
final paragraph of 16.4.4 "Texel Output Format Conversion":
    "Each component is converted based on its type and size (as
     defined in the Format Definition section for each
     VkFormat). ... Integer outputs are converted such that their value
     is preserved. The converted value of any integer that cannot be
     represented in the target format is undefined."

I didn't find a equivalent quote for OpenGL as all conversion entries
are forcused on float to integer, fixed-point to integer, etc, and not
on integer to integer. Didn't find any test failure with this change.

We didn't get any shader-db stats change with shaderdb (even
overriding to OpenGL 4.4 to get more shaders built), so as a reference
Vulkan shader-db stats with the pattern
dEQP-VK.image.*.with_format.*.*
   total instructions in shared programs: 37534 -> 36522 (-2.70%)
   instructions in affected programs: 12080 -> 11068 (-8.38%)
   helped: 241
   HURT: 0
   Instructions are helped.

   total uniforms in shared programs: 9100 -> 8550 (-6.04%)
   uniforms in affected programs: 3004 -> 2454 (-18.31%)
   helped: 229
   HURT: 0

   total max-temps in shared programs: 6110 -> 6014 (-1.57%)
   max-temps in affected programs: 402 -> 306 (-23.88%)
   helped: 43
   HURT: 0
   Max-temps are helped.

   total nops in shared programs: 1523 -> 1526 (0.20%)
   nops in affected programs: 21 -> 24 (14.29%)
   helped: 3
   HURT: 6
   Inconclusive result (value mean confidence interval includes 0).

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14194>
2021-12-15 11:53:20 +00:00
Samuel Pitoiset cca8803e6b radv/winsys: update sparse mappings with OP_REPLACE instead of OP_MAP/OP_UNMAP
When the BO is NULL, AMDGPU will reset the PTE VA range to the initial
state. Otherwise, it will first unmap all existing VA that overlap the
requested range and then map. This seems better than using MAP/UNMAP.

This reduces stuttering in Forza Horizon 5.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14116>
2021-12-15 08:17:29 +01:00
Samuel Pitoiset a6ca0a8c52 radv/winsys: stop using reference counting for virtual BOs
This shouldn't be necessary because applications have to manage
resources and memory themselves.

This also prevented memory to be freed if an application doesn't unbind
a sparse memory object and free it, which is legal as long as the
resource isn't used afterwards.

This was introduced to unmap the sparse mappings when destroying
a virtual BO, but now that the driver uses OP_CLEAR it's no longer
needed.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14116>
2021-12-15 08:17:26 +01:00
Samuel Pitoiset a931d5a4a4 radv/winsys: clear the PRT VA range when destroying a virtual BO
Instead of unmapping every range.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14116>
2021-12-15 08:17:24 +01:00
Samuel Pitoiset 782474782b radv/winsys: remove useless has_sparse_vm_mappings checks
Sparse is only exposed on GFX8+, so this is always TRUE.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14116>
2021-12-15 08:17:22 +01:00
Jason Ekstrand b05d228695 Revert "anv: Stop doing too much per-sample shading"
This reverts commit 1f559930b6.  Turns
out, this approach won't work.

Fixes: 1f559930b6 ("anv: Stop doing too much per-sample shading")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14196>
2021-12-14 18:09:03 +00:00
Marek Olšák ae4065f0b2 mesa: use nop dispatch for ColorTable/Convolution/Histogram
The nop dispatch generates GL_INVALID_OPERATION too.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:29:00 -05:00
Marek Olšák 7994b6c893 mesa: remove all GL func forward declarations because they are autogenerated
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:28:58 -05:00
Marek Olšák 0ca96f5cf6 mesa,vbo: make ES wrapper functions static
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:28:57 -05:00
Marek Olšák 4c91c6162b glapi: add missing no_error settings for implemented functions
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:28:49 -05:00
Marek Olšák 9a9d14fa4d mesa: remove COPY_DISPATCH code that doesn't do anything
When we get into create_beginend_table, ctx->Exec only contains nops
set by _mesa_alloc_dispatch_table. This function calls
_mesa_alloc_dispatch_table too, so table and ctx->Exec are identical,
and then it copies identical entries from one table to the other.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:01:09 -05:00
Marek Olšák 933a88f76c mesa: rename _ae_ArrayElement -> _mesa_ArrayElement to match glapi
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:01:08 -05:00
Marek Olšák e49d9c0fed mesa: use ctx->GLThread.enabled now that it's correct
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:01:07 -05:00
Marek Olšák d052612317 glthread: disable glthread if the context is lost
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:01:06 -05:00
Marek Olšák 9d8301d602 glthread: fix restoring the dispatch in destroy when the context is not current
also remove an invalid comment in mtypes.h

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:01:05 -05:00
Marek Olšák 670759a208 glthread: inline _mesa_glthread_restore_dispatch and merge disable & destroy
No change in behavior.

This fixes ctx->GLThread.enabled, which was only set to false by destroy.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:01:02 -05:00
Marek Olšák 7b123ad16a glthread: set marshal functions in dispatch only if they exist in the API
We now have proper nop dispatch for the unset functions.

The autogenerated code looks like this:

   if ((ctx->API == API_OPENGLES2 && ctx->Version >= 31)) {
      if (_gloffset_DepthRangeArrayfvOES >= 0)
         ((_glapi_proc *)(ctx->MarshalExec))[_gloffset_DepthRangeArrayfvOES] = (_glapi_proc)_mesa_marshal_DepthRangeArrayfvOES;
      if (_gloffset_DepthRangeIndexedfOES >= 0)
         ((_glapi_proc *)(ctx->MarshalExec))[_gloffset_DepthRangeIndexedfOES] = (_glapi_proc)_mesa_marshal_DepthRangeIndexedfOES;
   }
   if (_mesa_is_desktop_gl(ctx)) {
      if (_gloffset_AlphaToCoverageDitherControlNV >= 0)
         ((_glapi_proc *)(ctx->MarshalExec))[_gloffset_AlphaToCoverageDitherControlNV] = (_glapi_proc)_mesa_marshal_AlphaToCoverageDitherControlNV;
      if (_gloffset_AttachObjectARB >= 0)
         ((_glapi_proc *)(ctx->MarshalExec))[_gloffset_AttachObjectARB] = (_glapi_proc)_mesa_marshal_AttachObjectARB;
      if (_gloffset_BeginQueryIndexed >= 0)
         ((_glapi_proc *)(ctx->MarshalExec))[_gloffset_BeginQueryIndexed] = (_glapi_proc)_mesa_marshal_BeginQueryIndexed;
      if (_gloffset_BindBufferOffsetEXT >= 0)
         ((_glapi_proc *)(ctx->MarshalExec))[_gloffset_BindBufferOffsetEXT] = (_glapi_proc)_mesa_marshal_BindBufferOffsetEXT;
   ...

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:00:42 -05:00
Marek Olšák e93a9b422c glthread: add nop dispatch
so that glthread behaves the same as the main dispatch.

Also fix the SetError function for GLES 1.0.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:00:40 -05:00
Marek Olšák dd3709dcfd vbo: expose all exec entrypoints for glthread and match api_exec_decl.h names
Autogenerated glthread code will call these directly.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:00:38 -05:00
Marek Olšák bade2407fa mesa: remove GLvertexformat
Function pointers were first set in GLvertexformat, and then
GLvertexformat was copied to the dispatch.

This just sets the function pointers in the dispatch directly,
skipping the intermediate GLvertexformat structure.

The code with SET_* calls is autogenerated by api_vtxfmt_init_h.py.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:00:35 -05:00
Marek Olšák a87e5d437e glapi: autogenerate install_vtxfmt with python
This is a prerequisite for the GLvertexformat removal.

The autogenerated file looks like this:

if (_mesa_is_desktop_gl(ctx) || (ctx->API == API_OPENGLES2 && ctx->Version >= 30)) {
   SET_VertexAttribI4iEXT(tab, NAME(VertexAttribI4iEXT));
   SET_VertexAttribI4ivEXT(tab, NAME(VertexAttribI4ivEXT));
   SET_VertexAttribI4uiEXT(tab, NAME(VertexAttribI4uiEXT));
   SET_VertexAttribI4uivEXT(tab, NAME(VertexAttribI4uivEXT));
}
if (ctx->API == API_OPENGLES2) {
   SET_VertexAttrib1fARB(tab, NAME_ES(VertexAttrib1fARB));
   SET_VertexAttrib1fvARB(tab, NAME_ES(VertexAttrib1fvARB));
   SET_VertexAttrib2fARB(tab, NAME_ES(VertexAttrib2fARB));
   SET_VertexAttrib2fvARB(tab, NAME_ES(VertexAttrib2fvARB));
   SET_VertexAttrib3fARB(tab, NAME_ES(VertexAttrib3fARB));
   SET_VertexAttrib3fvARB(tab, NAME_ES(VertexAttrib3fvARB));
   SET_VertexAttrib4fARB(tab, NAME_ES(VertexAttrib4fARB));
   SET_VertexAttrib4fvARB(tab, NAME_ES(VertexAttrib4fvARB));
}
if (ctx->API == API_OPENGL_COMPAT) {
   SET_ArrayElement(tab, NAME_AE(ArrayElement));
   SET_Begin(tab, NAME(Begin));
   SET_CallList(tab, NAME_CALLLIST(CallList));
   SET_CallLists(tab, NAME_CALLLIST(CallLists));
   SET_Color3b(tab, NAME(Color3b));
   SET_Color3bv(tab, NAME(Color3bv));
   ...

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:00:29 -05:00