aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* glthread: handle POS vs GENERIC0 aliasingMarek Olšák2020-04-302-3/+10
| | | | Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
* glthread: initialize VAOs properlyMarek Olšák2020-04-303-0/+33
| | | | Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
* glthread: track primitive restart stateMarek Olšák2020-04-303-0/+63
| | | | Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
* glthread: track instance divisor changesMarek Olšák2020-04-302-11/+35
| | | | Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
* glthread: track pointers and strides for Pointer & EXT_dsa attrib functionsMarek Olšák2020-04-302-12/+59
| | | | Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
* glthread: don't use atomics for refcounting to decrease overhead on AMD ZenMarek Olšák2020-04-302-1/+33
| | | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
* glthread: do glBufferSubData as unsynchronized upload + GPU copyMarek Olšák2020-04-304-2/+138
| | | | | | | | | | | | 1. glthread has a private upload buffer (as struct gl_buffer_object *) 2. the new function glInternalBufferSubDataCopyMESA is used to execute the copy (the source buffer parameter type is struct gl_buffer_object * as GLintptr) Now glthread can handle arbitrary glBufferSubData sizes without syncing. This is a good exercise for uploading data outside of the driver thread. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
* mesa: add _mesa_InternalBind{ElementBuffer,VertexBuffers} for glthreadMarek Olšák2020-04-305-0/+62
| | | | | | Uploaded non-VBO user data will be set via these functions. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
* mesa: add glInternalBufferSubDataCopyMESA for glthreadMarek Olšák2020-04-304-1/+51
| | | | Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
* mesa: inline vbo_context inside gl_context to remove vbo_context dereferencesMarek Olšák2020-04-306-157/+151
| | | | | | | | | | 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,st/mesa: add a fast path for non-static VAOsMarek Olšák2020-04-305-0/+64
| | | | | | | | | | | | | Skip most of _mesa_update_vao_derived_arrays if the VAO is not static. Drivers need a separate codepath for this. This increases performance by 7% with glthread and the game "torcs". The reason is that glthread uploads vertices and sets vertex buffers every draw call, so the overhead is very noticable. glthread doesn't hide the overhead, because the driver thread is the busiest thread. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
* mesa: don't update shaders on fixed-func state changes if user shaders are boundMarek Olšák2020-04-302-3/+28
| | | | Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
* mesa: don't set unnecessary program flags in _mesa_update_stateMarek Olšák2020-04-301-2/+1
| | | | | | | _NEW_PROGRAM is already set. _NEW_FRAG_CLAMP is not used by the fixed-func fragment shader. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
* mesa: set _NEW_FRAG_CLAMP only when neededMathias Fröhlich2020-04-301-3/+5
| | | | | Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
* mesa: don't call _mesa_update_state for _mesa_get_clamp_fragment_colorMarek Olšák2020-04-304-18/+4
| | | | | | It's not needed. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
* st/mesa: Move _NEW_FRAG_CLAMP to NewFragClamp driver flag.Mathias Fröhlich2020-04-305-12/+21
| | | | | Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
* mesa: optimize glPush/PopClientAttrib by removing malloc overheadMarek Olšák2020-04-304-137/+46
| | | | | | | | just declare all structures needed by the stack in gl_context. This improves performance by 5.6% in the game "torcs". FPS: 101.01 -> 106.73 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
* i965: remove unused variableMarcin Ślusarz2020-04-291-2/+0
| | | | | | | | Last use was removed in 54525808aa58. Signed-off-by: Marcin Ślusarz <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4809>
* gallium: add pipe cap for scissored clears and pass scissor state to clear() ↵Mike Blumenkrantz2020-04-293-2/+32
| | | | | | | | | | | | | | | | hook this adds a new pipe cap that drivers can support which enables passing buffer clears with scissor test enabled through to be handled by the driver instead of having mesa draw a quad also adjust all existing clear() hooks to have the new parameter Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Vasily Khoruzhick <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4310>
* i965: Use correct constant for max_variable_local_sizeCaio Marcelo de Oliveira Filho2020-04-291-1/+1
| | | | | | Fixes: 5664bd6db38 ("i965: Implement ARB_compute_variable_group_size") Reviewed-by: Jordan Justen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4799>
* st/mesa: expose more SPIR-V capabilitiesMarek Olšák2020-04-291-0/+12
| | | | | Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4760>
* mesa: report GL_INVALID_OPERATION for invalid glTextureBuffer targetMarek Olšák2020-04-291-9/+9
| | | | | | | | | | | This fixes: KHR-GL46.direct_state_access.textures_buffer_errors KHR-GL46.direct_state_access.textures_buffer_range_errors Fixes: 98e64e538af - main: Added entry point for glTextureBuffer Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4759>
* mesa: Follow OpenGL conversion rules for values that exceed storage sizeDylan Baker2020-04-291-4/+33
| | | | | | | | | | | | | | | | | | | Section 2.2.2 (Data Conversions For State Query Commands) of the OpenGL 4.5 spec says: Following these steps, if a value is so large in magnitude that it cannot be represented by the returned data type, then the nearest value representable using that type is returned. The current code doesn't do the correct thing, because it truncates a long (potentially a 64bit values) to an int. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2828 Fixes: 53c36dfcfe3eb3749a53267f054870280afb0d71 ("replace IROUND with util functions") Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4673>
* mesa/st: call _mesa_initialize() earlyErik Faye-Lund2020-04-271-0/+2
| | | | | | | | This allows drivers to reliably do things like using the GLSL type-system during initialization. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4765>
* mesa/main: one_time_init() -> _mesa_initialize()Erik Faye-Lund2020-04-272-3/+6
| | | | | | | | | | | | This exposes the logic inside one_time_init() as _mesa_initialize(), so drivers who needs to use functionality initialized in one_time_init earlier if they need. This means we can reliably use the GLSL type-system when compiling driver built-in shaders. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4765>
* mesa/main: Do not pass context to one_time_initErik Faye-Lund2020-04-271-6/+6
| | | | | | | | | There's no longer any reason to pass the context down to one_time_init, because we always do the same thing regardless of the context, and we don't change the context. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4765>
* mesa/main: do not init remap-table per apiErik Faye-Lund2020-04-271-3/+0
| | | | | | | | | | This hasn't really been nessecary since 8386088e3dc ("dispatch: stop using _mesa_create_exec_table_es1() for GLES1."), when we stopped diverging the logic here based on the context-API. So let's simplify the code a bit. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4765>
* mesa/main: do not pass context to one-time extension initErik Faye-Lund2020-04-273-7/+7
| | | | | | | | | _mesa_problem doesn't use the ctx argument for anything, so there's no reason to pass it. This saves us from needing a context passed down this code-path in the first place. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4765>
* mesa/main: do not store unrecognized extensions in contextErik Faye-Lund2020-04-272-19/+18
| | | | | | | | | | | | | We process extension overrides only when we initialize the first context, which means that unrecognized extensions only appear in the first context created. Let's instead store them in a global array, so we can apply them to all contexts. This has the added benefit of making the initialization of the first context less special, which allows us to clean up code a bit more. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4765>
* mesa: Skip 3-byte array formats in _mesa_array_format_flip_channelsMichel Dänzer2020-04-271-1/+1
| | | | | | | | | | | | | Byte swapping makes no sense for 3-byte formats: Swapping the order of 2 or 4 bytes at a time would inevitably result in bytes getting mixed up between neighbouring pixels. Fixes crash with a debugging build on a big endian machine due hitting the unreachable() at the end of the function. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2665 Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4735>
* mesa: replace GLenum target with gl_shader_stage in NewProgramMarek Olšák2020-04-2711-64/+51
| | | | | | | | So that the GLSL compiler doesn't have to use the GLenum conversion functions. Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4756>
* mesa: extend _mesa_bind_vertex_buffer to take ownership of the buffer referenceMarek Olšák2020-04-276-17/+28
| | | | | | | | | 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 <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4758>
* mesa: add offset_is_int32 param into _mesa_bind_vertex_buffer for glthreadMarek Olšák2020-04-276-17/+21
| | | | | | | | glthread will pass signed integer offsets, so don't reset negative offsets to 0 there. Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4758>
* mesa: add Const.BufferCreateMapUnsynchronizedThreadSafe & MESA_MAP_THREAD_SAFEMarek Olšák2020-04-274-0/+14
| | | | | Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4758>
* glthread: reduce dereferences of the next batchMarek Olšák2020-04-273-4/+9
| | | | | Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4758>
* glthread: use 32-bit align instead of 64-bit ALIGNMarek Olšák2020-04-271-1/+1
| | | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4758>
* mesa: remove exec="dynamic" from Draw functions that are not really dynamicMarek Olšák2020-04-274-115/+151
| | | | | Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4758>
* mesa: reset primitive restart state in glClientAttribDefaultEXTMarek Olšák2020-04-271-0/+9
| | | | | Reviewed-by: Erik Faye-Lund <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4758>
* mesa: replace _NEW_EVAL with vbo_exec_update_eval_mapsMarek Olšák2020-04-279-34/+52
| | | | | Reviewed-by: Erik Faye-Lund <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4758>
* st/mesa: Treat vertex inputs absent in inputMapping as zero in mesa_to_tgsiDanylo Piliaiev2020-04-271-2/+6
| | | | | | | | | | | | | | | | After updating vertex inputs being read based on optimized NIR, they may go out of sync with inputs in mesa IR. Which is translated to TGSI and used together with NIR if draw doesn't have llvm. It's much easier to treat such inputs as zero because there is no pass to entirely get rid of them and they don't contribute to shader's output. Fixes: d684fb37bfbc47d098158cb03c0672119a4469fe Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2815 Signed-off-by: Danylo Piliaiev <[email protected]> Reviewed-by: Jose Maria Casanova Crespo <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4705>
* st/nir: Fix assigning PointCoord location with !PIPE_CAP_TEXCOORDConnor Abbott2020-04-251-0/+2
| | | | | | | | This was trying to emulate the effect of mapping GL -> TGSI -> NIR, but failed to handle VARYING_SLOT_PNTC which led to a kludgy workaround in freedreno. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4732>
* spirv: Use nir_const_value for spec constantsJason Ekstrand2020-04-241-2/+2
| | | | | | | | | | | When we originally wrote spirv_to_nir we didn't have a good scalar value union to handily use so we rolled our own thing for spec constants. Now that we have nir_const_value, we can use that and simplify a bunch of the spec constant logic. Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]> Acked-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4675>
* mesa: add support for AlphaToCoverageDitherControlNVIndrajit Kumar Das2020-04-239-0/+55
| | | | | Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4543>
* gallium: add # of MRT to blend stateRob Clark2020-04-232-0/+3
| | | | | | | | | | | | To make it possible for drivers to avoid unnecessary blend state change for unused MRTs. Otherwise the driver would have to manage different blend CSOs for different potential #s of render targets. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4619>
* mesa/st: avoid u_vbuf for GLESRob Clark2020-04-231-2/+14
| | | | | | | | | | | 64b VBO types are not required for GLES. So avoid u_vbuf if that was otherwise the only reason it was used. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4619>
* mesa: avoid redundant VBO updatesRob Clark2020-04-232-15/+15
| | | | | | | | | | | Avoids re-emitting unchanged VBO state, which is a big chunk of the state updates in gfxbench driver2 Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4619>
* mesa: enable GL_EXT_draw_instanced for gles2Simon Zeni2020-04-231-1/+1
| | | | | | Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3204>
* meta,i965: Rip GL_EXT_texture_multisample_blit_scaled support out of metaJason Ekstrand2020-04-226-318/+1
| | | | | | | | | | | i965 is the only driver that ever linked to this code and it's been doing it in BLORP for a long time now. The only possible case where it would have fallen back to meta was for depth/stencil but that should have ended starting with 6cec618e82aa2. Rip out the dead code. Acked-by: Lionel Landwerlin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4622>
* mesa/gallium: do not use enum for bit-allocated memberErik Faye-Lund2020-04-211-1/+1
| | | | | | | | | | | The signedness of enums are undefined, so on platforms with signed enums, this isn't going to work. One such platform is Microsoft Windows. So let's just use an unsigned here instead. Fixes: b1c4c4c7f53 ("mesa/gallium: automatically lower alpha-testing") Acked-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4648>
* remove final imports.h and imports.c bitsDylan Baker2020-04-21201-838/+866
| | | | | | | | | | | 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 <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>