Commit Graph

47279 Commits

Author SHA1 Message Date
Yonggang Luo d1d2e0efcd mesa: Fixes -Wundef in arbprogparse.c
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19926>
2022-11-24 04:33:07 +00:00
Yonggang Luo 55b35e6193 mesa: fixes -Werror,-Wunused-but-set-variable for clang-15 in program_parse.y
error message:
src/mesa/program/program_parse.tab.c:1952:9: error: variable 'yynerrs' set but not used [-Werror,-Wunused-but-set-variable]
    int yynerrs = 0;
        ^

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19969>
2022-11-24 02:56:03 +00:00
Yonggang Luo 77c29bfffd mesa: indent fixes after replace tab with 3 space by find and replace in program/program_parse.y
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19969>
2022-11-24 02:56:03 +00:00
Yonggang Luo 59fb86ea6f mesa: replace tab with 3 space in mesa/program/program_parse.y by tools
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19969>
2022-11-24 02:56:03 +00:00
Marek Olšák 3a406688f2 st/mesa: only call st_manager_validate_framebuffers at FBO change or SwapBuffers
Hopefully this doesn't break anything.

There are a lot of places that invalidate drawables, but no place attempted
to call the context directly like this. A few places don't even have
the context.

Explanation:

The DRI frontend uses a global atomic counter per drawable that is
incremented when that drawable changed buffers.
st_manager_validate_framebuffers checks for that atomic counter and
updates the framebuffer state if there is any change. This was called at
every state update, so likely before almost every draw (!!!).

This commit changes that. Everything is the same except that the change
of buffers will not be noticed until the beginning of the next frame or
when the framebuffer state update is triggered by something else.

The effect is that we don't waste time calling
st_manager_validate_framebuffers a million times per frame.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19775>
2022-11-23 20:37:02 +00:00
Marek Olšák d871958702 st/mesa: suppress async glthread flushing for GLX_EXT_texture_from_pixmap
This might fix some window system issues.

Fixes: 3da170faae - glthread: change when glFlush flushes asynchronously

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19809>
2022-11-22 13:04:30 +00:00
Marek Olšák c1a0f4b8fa mesa: add unlikely() and adjust error handling in BindBuffer
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19844>
2022-11-22 11:12:28 +00:00
Marek Olšák c924cfae42 mesa: add no_error support into get_buffer_target()
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19844>
2022-11-22 11:12:28 +00:00
Marek Olšák ba91328444 mesa: remove ctx->Extensions.EXT_pixel_buffer_object capability flag
to get rid of the fail path in get_buffer_target.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19844>
2022-11-22 11:12:28 +00:00
Yonggang Luo 40a9fc57aa tree-wide: Use __func__ instead of __FUNCTION__ in non-gallium code
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19861>
2022-11-22 06:53:46 +00:00
Jose Maria Casanova Crespo 4ea4147935 gallium/dri: Add P030 format
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19639>
2022-11-21 09:08:44 +00:00
Yonggang Luo 94886a2975 util: Move src/gallium/include/pipe/p_format.h to src/util/format/u_formats.h
Because p_format.h shared between vulkan drivers and opengl drivers

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19629>
2022-11-19 03:38:19 +00:00
Yonggang Luo ed4fd1d90e util: cleanup cpuinfo.* and it's related files
_mesa_get_cpu_features is no more a needed thing as all it's usage are
replaced with util_get_cpu_caps in u_cpu_detect.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19564>
2022-11-15 19:06:07 +00:00
Yonggang Luo 7436669d55 mesa/vbo: Replace the usage of cpu_has_sse4_1 with util_get_cpu_caps()->has_sse4_1 in vbo/vbo_minmax_index.c
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19564>
2022-11-15 19:06:07 +00:00
Yonggang Luo e399dc3544 util: normalize include files under src/util/*.h with util/ prefix in mesa code base
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19546>
2022-11-10 06:27:25 +00:00
Yonggang Luo beea3548ce util: Move texcompress template files into util/format
Because these files are accessed in  util/format/u_format_*.c
To make sure util are self contained we need move these files

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19547>
2022-11-10 05:35:41 +00:00
Yonggang Luo 0c12a39682 mesa: include <util/*.h> instead macros.h in texcompress_bptc_tmp.h
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19547>
2022-11-10 05:35:41 +00:00
Yonggang Luo f6ed016fe9 util: Replace the usage of ALIGN16 with alignas(16) and them remove ALIGN16 macro
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19565>
2022-11-10 05:04:12 +00:00
António Monteiro d31375b521 math: remove unused matrix_print & print_matrix_floats
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
António Monteiro c49aca943c math: remove vector class
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
António Monteiro 2d4d4df57a math: remove unused debug classes
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
António Monteiro 94e10ced83 math: remove unused matrix_is_general_scale
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
António Monteiro 18702a28bd math: remove unused matrix_has_rotation
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
António Monteiro c7b70ca61a util: remove fifo class
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
António Monteiro 707d5b5b02 math: drop invert_matrix_perpective
Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19428>
2022-11-04 23:20:02 +00:00
Yonggang Luo 381e0b43d6 mesa: Add test to prevent windows.h to be included in shared headers
This test is hand crafted by running command
find | grep .*h$ >../headers.txt
under src directory, and using find replace to creating
the file list and then removed the files should not be directly included

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>
2022-11-03 16:07:32 +00:00
Yonggang Luo bf338c3d7f mesa: #include "util/glheader.h" instead GL/gl.h in shared code
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>
2022-11-03 16:07:31 +00:00
Yonggang Luo bfa3ce44a6 mesa: Move glheader.h from mesa/main/glheader.h to util/glheader.h
So it's can be accessed in broader places

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>
2022-11-03 16:07:31 +00:00
Yonggang Luo d7b09092d4 mesa: Remove out-dated comment in common_x86.c
Follow up: 8e3696137f ("remove final imports.h and imports.c bits")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>
2022-11-03 16:07:31 +00:00
Yonggang Luo f40afd1363 util: Prevent glheader.h from including <windows.h> by defining APIENTRY
When APIENTRY is not defined, GL/gl.h and GL/glext.h will automatically
include <windows.h>, so we save the macro APIENTRY by push_macro and then
define APIENTRY before include of GL/gl.h and GL/glext.h.
After that we use pop_macro to recover the previous macro again.

Because windows.h is not included by glheader.h, mesa/main/errors.c needs
to include <windows.h> directly to prevent the following error:
errors.c:98:10: error: implicit declaration of function 'OutputDebugStringA' [-Werror=implicit-function-declaration]
   98 |          OutputDebugStringA(buf);

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>
2022-11-03 16:07:31 +00:00
Karol Herbst b8d10d9e87 gallium: split up req_local_mem
This will be required if a frontend has to request additional shared mem
on top of the shader declared one, but wants to create the CSO before
knowing the total amount.

In OpenCL applications can bind additional shared mem through kernel
arguments and this happens quite late.

Note: Clover sets the req_local_mem incorrectly before so we can leave it
as broken.

v2: fix panfrost code (Alyssa)

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>
2022-11-02 23:36:56 +00:00
Jesse Natalie 20bdec1fc4 mesa/st: Query driver for interop data
Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>
2022-11-02 18:11:41 +00:00
Jesse Natalie a86e0e8836 mesa/st: Implement the new flush method
Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>
2022-11-02 18:11:41 +00:00
Jesse Natalie 4f3ccb9f47 mesa/st: Split interop object lookup from export
Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>
2022-11-02 18:11:41 +00:00
Jesse Natalie 7033501eff mesa: Make fence_sync not static
Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>
2022-11-02 18:11:41 +00:00
Jesse Natalie aaf35cb442 mesa, dri2: Move interop helpers from dri2 to state tracker
They're not at all dri2 specific and we'll want to use them from wgl.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>
2022-11-02 18:11:41 +00:00
Illia Abernikhin aa4ac5ff8b utils: Merge util/debug.* into util/u_debug.* and remove util/debug.*
Rename env_var_as_unsigned() -> debug_get_num_option(), because duplicate
Rename env_var_as_bool() -> debug_get_bool_option(), because duplicate

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7177

Signed-off-by: Illia Abernikhin <illia.abernikhin@globallogic.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19336>
2022-11-02 07:25:39 +00:00
Kenneth Graunke fde99747e9 nir: Drop infer_non_readable option for nir_opt_access()
Everybody sets it to true now, and the only reason for the option to
exist was to work around a bug that's now been fixed.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19162>
2022-11-02 03:42:04 +00:00
Kenneth Graunke 1462a61b5d st/mesa: Let nir_opt_access() infer non-readable
In issue #3278, Danylo noted that nir_opt_access() could desynchronize
the prog->sh.ImageAccess[] and prog->sh.BindlessImage[].access fields,
which are filled out as part of uniform linking, prior to running this
optimization pass.  Those fields are used to fill out pipe_image_view's
shader_access field, which is used by a lot of drivers these days.

There's an easy solution to this issue however: we can simply call the
pass prior to linking, a few lines earlier.

This lets us infer that images are non-readable, which may let drivers
do additional optimizations.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3278
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19162>
2022-11-02 03:42:04 +00:00
Rob Clark 2e689e9d9d Revert "mesa/st: ARB_vertex_attrib_64bit depend on glsl>=410"
Turns out this change was unnecessary

This reverts commit 533b87dff0.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19236>
2022-10-28 19:13:27 +00:00
Lionel Landwerlin 5d88ab63e2 st/gallium: plumb protected context creation
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8092>
2022-10-27 10:53:18 +00:00
Giancarlo Devich 6f598fe4e3 mesa: Fix stack corruption for PIPE_QUERY_TIMESTAMP
get_query_result expects a pointer to a union pipe_query_result,
which is larger than GLuint64EXT, causing the memset it does to
overwrite the stack.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19055>
2022-10-24 19:43:03 +00:00
Yonggang Luo 4aef5f8825 st: Remove struct st_api, st_gl_api_create and st_gl_api.h
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19197>
2022-10-24 11:31:20 +00:00
Yonggang Luo 78a8350e8d st: Turn st_api::query_versions to be direct accessed function st_api_query_versions
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19197>
2022-10-24 11:31:20 +00:00
Yonggang Luo 7bd5ff3122 st: Turn st_api::create_context to be direct accessed function st_api_create_context
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19197>
2022-10-24 11:31:20 +00:00
Yonggang Luo 562adc385d st: Turn st_api::make_current to be direct accessed function st_api_make_current
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19197>
2022-10-24 11:31:20 +00:00
Yonggang Luo 26b77dfeb2 st: Turn st_api::get_current to be direct accessed function st_api_get_current
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19197>
2022-10-24 11:31:20 +00:00
Yonggang Luo 40e11ee509 st: Turn st_api::destroy_drawable to be direct accessed function st_api_destroy_drawable
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19197>
2022-10-24 11:31:20 +00:00
Yonggang Luo 3f15ba7d68 st: Remove st_api::destroy
It's a global variable and have no need destroy

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19197>
2022-10-24 11:31:20 +00:00
Yonggang Luo 23388be282 st: OpenVG are removed, remove st_api::feature_mask as it's constant
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19197>
2022-10-24 11:31:20 +00:00