summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* nir: move data.image.access to data.accessMarek Olšák2019-11-191-1/+1
| | | | | | The size of the data structure doesn't change. Reviewed-by: Connor Abbott <[email protected]>
* st/mesa: call nir_serialize only once per shaderMarek Olšák2019-11-193-22/+25
| | | | | | It was called twice. Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
* st/mesa: keep serialized NIR instead of nir_shader in st_programMarek Olšák2019-11-194-11/+69
| | | | | | | | | | This decreases memory usage, because serialized NIR is more compact. If shader_has_one_variant is true and the shader is uncached, the first variant is created from nir_shader, otherwise the first variant and all other variants are created from serialized NIR. Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
* st/mesa: call nir_sweep in st_finalize_nirMarek Olšák2019-11-192-2/+3
| | | | | This is invoked sooner before (pre-)compiling the first variant and is also applied to fixed-func and ARB programs.
* st/mesa: subclass st_vertex_program for VP-specific membersMarek Olšák2019-11-199-80/+92
| | | | | | | Inheritance: gl_program -> st_program -> st_vertex_program Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
* st/mesa: more cleanups after unification of st_vertex/common_programMarek Olšák2019-11-191-44/+19
| | | | Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
* st/mesa: rename occurences of stcp to stp to correspond to st_programMarek Olšák2019-11-193-23/+23
| | | | Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
* st/mesa: cleanups after unification of st_vertex/common programMarek Olšák2019-11-194-140/+55
| | | | Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
* st/mesa: rename st_common_program to st_programMarek Olšák2019-11-1917-131/+131
| | | | Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
* st/mesa: trivially merge st_vertex_program into st_common_programMarek Olšák2019-11-1914-103/+69
| | | | | | | a later commit will add back st_vertex_program as a subclass of st_common_program Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
* st/mesa: consolidate and simplify code flagging program::affected_statesMarek Olšák2019-11-195-30/+20
| | | | Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
* st/mesa: initialize affected_states and uniform storage earlier in deserializeMarek Olšák2019-11-191-3/+3
| | | | | | | | | | This matches the uncached codepath. affected_states was used before initialization, which was technically a bug, but probably not reproducible due to _NEW_PROGRAM rebinding everything. Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
* st/mesa: start deduplicating some program codeMarek Olšák2019-11-194-13/+13
| | | | Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
* st/mesa: decrease the size of st_fp_variant_key from 48 to 40 bytesMarek Olšák2019-11-191-3/+3
| | | | Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
* st/mesa: rename delete_basic_variant -> delete_common_variantMarek Olšák2019-11-191-4/+4
| | | | Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
* mesa: fix warning in 32 bits buildPierre-Eric Pelloux-Prayer2019-11-191-1/+1
| | | | | Fixes: febedee4f6c ("mesa: add EXT_dsa glGetVertexArray* 4 functions") Reviewed-by: Marek Olšák <[email protected]>
* mesa: enable EXT_direct_state_accessPierre-Eric Pelloux-Prayer2019-11-191-0/+1
| | | | | | | | | | Always enabled; this doesn't require any driver work, it's just core mesa bits. quick_gl.txt is also updated because previously piglit ext_dsa tests were skipped. Reviewed-by: Marek Olšák <[email protected]>
* mesa: add ARB_sparse_buffer NamedBufferPageCommitmentEXT functionPierre-Eric Pelloux-Prayer2019-11-193-0/+25
| | | | | | | The spec is unclear on how to handle the buffer argument so we reuse the logic from the EXT_direct_state_access spec. Reviewed-by: Marek Olšák <[email protected]>
* mesa: add ARB_vertex_attrib_binding glVertexArray* functionsPierre-Eric Pelloux-Prayer2019-11-193-5/+120
| | | | | | | We can't simply alias ARB_direct_state_access functions because those fail if the vao has never been bound before. Reviewed-by: Marek Olšák <[email protected]>
* mesa: extend vertex_array_attrib_format to support EXT_dsaPierre-Eric Pelloux-Prayer2019-11-191-12/+6
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: implement ARB_texture_storage_multisample + EXT_dsa functionsPierre-Eric Pelloux-Prayer2019-11-193-2/+60
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add ARB_texture_buffer_range glTextureBufferRangeEXT functionPierre-Eric Pelloux-Prayer2019-11-193-1/+51
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add ARB_instanced_arrays EXT_dsa functionPierre-Eric Pelloux-Prayer2019-11-193-0/+52
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add ARB_clear_buffer_object named functionsPierre-Eric Pelloux-Prayer2019-11-193-2/+46
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add ARB_vertex_attrib_64bit VertexArrayVertexAttribLOffsetEXTPierre-Eric Pelloux-Prayer2019-11-193-0/+39
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add ARB_framebuffer_no_attachments named functionsPierre-Eric Pelloux-Prayer2019-11-193-2/+86
| | | | | | | | | | | The wording in ARB_framebuffer_no_attachments and EXT_direct_state_access is different. In the former framebuffer names must have been generated using glGenFramebuffers before using the named functions. In the latter framebuffer names have no such constraints, so we can't use the _mesa_lookup_framebuffer_dsa function. Reviewed-by: Marek Olšák <[email protected]>
* i965: Ensure that all 2101010 image imports can pass framebuffer completeness.Miguel Casas-Sanchez2019-11-191-2/+6
| | | | | | | | | | | Chrome OS would like to import and render to any supported format that has a corresponding display plane format, and this prevents throwing framebuffer incomplete for FBOs using these textures. See: crbug.com/949260 Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* Call shmget() with permission 0600 instead of 0777Brian Paul2019-11-181-1/+2
| | | | | | | | | | | | | | A security advisory (TALOS-2019-0857/CVE-2019-5068) found that creating shared memory regions with permission mode 0777 could allow any user to access that memory. Several Mesa drivers use shared- memory XImages to implement back buffers for improved performance. This path changes the shmget() calls to use 0600 (user r/w). Tested with legacy Xlib driver and llvmpipe. Cc: [email protected] Reviewed-by: Kristian H. Kristensen <[email protected]>
* intel/compiler: Add a flag to avoid compacting push constantsJason Ekstrand2019-11-181-0/+1
| | | | | | | In vec4, we can just not run the pass. In fs, things are a bit more deeply intertwined. Reviewed-by: Lionel Landwerlin <[email protected]>
* i965: Unify CC_STATE and BLEND_STATE atoms on Haswell as a workaroundDanylo Piliaiev2019-11-181-2/+35
| | | | | | | | | | | | | | | | | | | Re-emitting 3DSTATE_CC_STATE_POINTERS after emitting 3DSTATE_BLEND_STATE_POINTERS fixes the shadow flickering in SuperTuxCart and Tropico 6 which was seen only on Haswell. The reason for this is unknown and fix was found empirically. The closest mention in PRM is that it should improve performance. From the HSW PRM, volume 2b, page 823 (3DSTATE_BLEND_STATE_POINTERS): "When the BLEND_STATE pointer changes but not the CC_STATE pointer, driver needs to force a CC_STATE pointer change to improve blend performance in pixel backend." Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1834 Fixes: eca4a654 ("i965: Disable dual source blending when shader doesn't support it on gen8+") Cc: <[email protected]> Signed-off-by: Danylo Piliaiev <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/st: Reuse st_choose_matching_format from st_choose_format().Eric Anholt2019-11-155-94/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | We had this ad-hoc exact size matching for unsized internalformats, but st_choose_matching_format() can do exactly what we want. This means, that, for example, we'll now prefer the matching ordering for 565/565_REV if the driver supports both orders. We also pass Unpack.SwapBytes through from ChooseTextureFormat so that we can hit the memcpy path for 8888 formats when that flag is set. Some interesting format choice changes from this (on softpipe): intf/form/type before after ---------------------------------------------------- RGBA/RGBA/USHORT: R8G8B8A8_UNORM -> RGBA_UNORM16 RGB/RGBA/8888: X8B8G8R8_UNORM -> R8G8B8X8_UNORM RGB/ABGR/8888_REV: X8B8G8R8_UNORM -> R8G8B8X8_UNORM RGBA/RGBA/5551: B5G5R5A1_UNORM -> A1B5G5R5_UNORM RGBA/RGBA/4444: R8G8B8A8_UNORM -> A4B4G4R4_UNORM RGBA/GL_RGBA/1010102: R8G8B8A8_UNORM -> A2B10G10R10_UNORM DEPTH/DEPTH/UINT: Z24X8 -> Z_UNORM32 DEPTH/DEPTH/USHORT: Z24X8 -> Z_UNORM16 v2: Make sure that the baseformat still matches. v1 would pick MESA_FORMAT_L16_UNORM for RED/LUMINANCE/SHORT, when we clearly want a red format. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Don't put sRGB formats in the array format table.Eric Anholt2019-11-151-8/+6
| | | | | | | | | | sRGB vs unorm was the only conflict case being guarded against in this function. Before the PIPE_FORMAT conversion, we always listed the unorm before the sRGB in the enums, but PIPE_FORMAT_A8B8G8R8_SRGB happens to be before _UNORM. We always want the unorm result here. Fixes: 807a800d8c3e ("mesa: Redefine MESA_FORMAT_* in terms of PIPE_FORMAT_*.") Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/st: Simplify st_choose_matching_format().Eric Anholt2019-11-151-27/+11
| | | | | | | | | | | | | | We now have a nice helper function for finding those memcpy formats, without needing to go through each entry of the mesa format table to see if it happens to match. While looking at sysprof of a softpipe GLES2 CTS run, we were spending ~8% of the CPU on ChooseTextureFormat. With this, roughly the same region of the testsuite was .4%. v2: Add Ken's fix for canonicalizing array formats. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Handle GL_COLOR_INDEX in _mesa_format_from_format_and_type().Kenneth Graunke2019-11-151-0/+3
| | | | | | | | | | | Just return MESA_FORMAT_NONE to avoid triggering unreachable; there's really no sensible thing to return for this case anyway. This prevents regressions in the next commit, which makes st/mesa start using this function to find a reasonable format from GL format and type enums. Reviewed-by: Eric Anholt <[email protected]>
* mesa: allow bit queries for EXT_disjoint_timer_queryTapani Pälli2019-11-151-4/+14
| | | | | | Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2090 Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Move compile of common Mesa core files to a static lib.Eric Anholt2019-11-141-18/+32
| | | | | | | | | | | | | | | We were compiling them twice, costing extra build time. Reduces my ccache-hot clean build time by a second (24.3s to 23.3s, 3 runs each). The windows args are a little strange -- it's not clear to me that they're actually used for building these files, but keep them in place just in case, since we don't have a good windows CI story yet. We should want them on both gallium and classic regardless: Only osmesa could be built for windows in classic, and classic OSMesa's scons build defines these flags too. Closes: #2052 Acked-by: Dylan Baker <[email protected]>
* util: Move gallium's PIPE_FORMAT utils to /util/format/Eric Anholt2019-11-1419-19/+19
| | | | | | | | | | | | | | | To make PIPE_FORMATs usable from non-gallium parts of Mesa, I want to move their helpers out of gallium. Since u_format used util_copy_rect(), I moved that in there, too. I've put it in a separate directory in util/ because it's a big chunk of related code, and it's not clear to me whether we might want it as a separate library from libmesa_util at some point. Closes: #1905 Acked-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* Revert "mesa: allow bit queries for EXT_disjoint_timer_query"Tapani Pälli2019-11-141-14/+4
| | | | | | | This reverts commit 66d24a9ef705b8f9f15dab8059b63781f9fb28ca. This commit made Mesa CI red because commit depends on a Piglit test change.
* mesa/st: make sure we remove dead IO variables before handing NIR to backendsIago Toral Quiroga2019-11-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | Commit "1c2bf82d24a glsl: disable lower_fragdata_array() for NIR drivers" disabled the GLSL IR lowering that turned gl_FragData from an array into a collection of scalar outputs under the assumption that this was already being handled properly elsewhere, however there are some corner cases where NIR would fail to do this, leaving gl_FragData[] as an array variable. This can break backends that assume that all their outputs will be scalar and use the variable definitions from the shader to do their output setup, such as the case of V3D. At least one corner case was found in some Portal shaders from shader-db, where NIR would optimize out the full body of a fragment shader. In this scenario, the empty shader would keep the original array definition of gl_FragData[], causing the backend to assert. We need to do this late enough for it to be effective, since doing it in st_nir_preprocess does not fix the original problem. Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2091 Fixes: 1c2bf82d ("glsl: disable lower_fragdata_array() for NIR drivers") Reviewed-by: Marek Olšák <[email protected]>
* mesa: allow bit queries for EXT_disjoint_timer_queryTapani Pälli2019-11-141-4/+14
| | | | | | Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2090 Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* s/APIENTRY/GLAPIENTRY/ in teximage.cBrian Paul2019-11-121-1/+1
| | | | | | The later is the right symbol for entrypoint functions. Reviewed-by: Kristian H. Kristensen <[email protected]>
* android: mesa: Revert "android: mesa: revert "Enable asm unconditionally""Lepton Wu2019-11-122-4/+0
| | | | | | | | | | Commit 45206d7673adb1484cbdb3eadaf82e0849c9cdcf fixed PIC issue of x86 asm stub. We can enable asm for Android x86 now. This should sightly improve performance. Acked-by: Eric Anholt <[email protected]> Acked-by: Eric Engestrom <[email protected]> Acked-by: Tapani Pälli <[email protected]> Signed-off-by: Lepton Wu <[email protected]>
* i965/program_cache: Lift restriction on shader key sizeDanylo Piliaiev2019-11-121-12/+4
| | | | | | | | This will allow usage of packed structs which may have size not divisible by 4. Signed-off-by: Danylo Piliaiev <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* st/mesa: remove unused TGSI-only debug printing functionsMarek Olšák2019-11-116-64/+0
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa: add ST_DEBUG=nir to print NIR shadersMarek Olšák2019-11-112-1/+11
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa: print TCS/TES/GS/CS TGSI in the right place & keep disk cache enabledMarek Olšák2019-11-112-6/+5
| | | | | | | The old place only printed on a disk cache miss, which is why the disk cache was disabled. Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa: remove \n being only printed in debug builds after printed TGSIMarek Olšák2019-11-111-12/+4
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa: rename DEBUG_TGSI -> DEBUG_PRINT_IRMarek Olšák2019-11-114-7/+7
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa: fix Sanctuary and Tropics by disabling ARB_gpu_shader5 for themMarek Olšák2019-11-111-1/+1
| | | | | | | They use the "sample" keyword as a variable name. Cc: 19.2 19.3 <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: check framebuffer completeness only after state updateLionel Landwerlin2019-11-111-6/+6
| | | | | | | | | | | | The change made in 88d665830f27 ("mesa: check draw buffer completeness on glClearBufferfi/glClearBufferiv") correctly updated the state prior to checking the framebuffer completeness on glClearBufferiv but not in glClearBufferfi. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> Fixes: 88d665830f27 ("mesa: check draw buffer completeness on glClearBufferfi/glClearBufferiv") Gitlab: https://gitlab.freedesktop.org/mesa/mesa/issues/2072