src/mesa: add GL_NV_half_float extension support (v2) This patch adds support for GL_NV_half_float extension. v2: fix main_test failure Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6219>
mesa: inline vbo_context inside gl_context to remove vbo_context dereferences The number of lines in the disassembly of vbo_exec_api.c.o decreased by 4.5%, which roughly corresponds to a decrease in instructions for immediate mode thanks to the removal of ctx->vbo_context dereferences. It increases performance in one Viewperf11 subtest by 2.8%. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
mesa: extend _mesa_bind_vertex_buffer to take ownership of the buffer reference This reduces overhead of _mesa_reference_buffer_object_ from 6% to 4% with glthread when profiling the game "torcs" with non-VBO data uploaded by glthread. Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4758>
mesa: add offset_is_int32 param into _mesa_bind_vertex_buffer for glthread glthread will pass signed integer offsets, so don't reset negative offsets to 0 there. Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4758>
mesa: avoid redundant VBO updates Avoids re-emitting unchanged VBO state, which is a big chunk of the state updates in gfxbench driver2 Signed-off-by: Rob Clark <robdclark@chromium.org> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4619>
remove final imports.h and imports.c bits This moves the fi_types to a new mesa_private.h and removes the imports.c file. The vast majority of this patch is just removing pound includes of imports.h and fixing up the recursive includes. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
mesa|mapi: replace _mesa_[v]snprintf with [v]snprintf MSVC 2015 and newer has perfectly valid snprintf and vsnprintf implementations, let's just use those. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
replace imports memory functions with utils memory functions Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
replace malloc macros in imports.h with u_memory.h versions Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
vbo: avoid including wingdi.h on win32 On Windows, main/glheader.h ends up including windows.h which in turn includes wingdi.h unless the NOGDI macro is defined. And wingdi.h defines a macro called "ERROR", which we end up redefining below. To avoid a warning on the redefinition, we can define NOGDI to prevent wingdi.h from implicitly being included. Reviewed-by: Brian Paul <brianp@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4577>
mesa: precompute _mesa_primitive_restart_index during state changes Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4466>
mesa: remove no longer needed _mesa_is_bufferobj function All buffers have Name != 0. Note that there is no longer the pointer dereference to get Name, so it's faster. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4466>
mesa: don't ever bind NullBufferObj for glBindBuffer targets Since VAOs don't use NullBufferObj for vertex attribs anymore, let's remove more uses of NullBufferObj. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4466>
mesa: don't ever set NullBufferObj in gl_vertex_array_binding This improves performance by 5% in the game "torcs", FPS: 98.83 -> 103.73 It does a lot of glPush/PopClientAttrib, which exacerbates the overhead of setting NullBufferObj. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4466>
Move compiler.h and imports.h/c from src/mesa/main into src/util Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4324>
vbo,gallium: make glBegin/End buffer size configurable by drivers The default is 512 KB, but radeonsi wants 4 MB. Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4154> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4154>
vbo: fix vbo_copy_vertices for GL_PATCHES and adjacency primitive types Fixes: 4c6323c49f1 - vbo: handle GS and tess primitive types when splitting Begin/End Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3591>