aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* st/mesa: release tgsi tokens for shader statesNeha Bhende2019-12-191-0/+4
| | | | | | | | | | | | Since we are using st_common_variant while creating variant for vertext program, we can release tokens created in st_create_vp_variant which are already stored in respective states. This fix memory leak found with piglit tests Fixes bc99b22a305b ('st/mesa: use a separate VS variant for the draw module') Reviewed-by: Charmaine Lee <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* i965/iris/perf: factor out frequency register captureLionel Landwerlin2019-12-181-22/+18
| | | | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Mark Janes <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3113> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3113>
* mesa: avoid triggering assert in implementationLionel Landwerlin2019-12-171-0/+6
| | | | | | | | | | | | | | | | When tearing down a GL context with an active performance query, the implementation can be confused by a query marked active when it's being deleted. This shouldn't happen in the implementation because the context will already be idle. Signed-off-by: Lionel Landwerlin <[email protected]> Cc: <[email protected]> Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2235 Reviewed-by: Tapani Pälli <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3115> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3115>
* i965: expose MESA_FORMAT_B8G8R8X8_SRGB visualTapani Pälli2019-12-171-7/+14
| | | | | | | | | | | | | | | | | | Patch adds BGRX sRGB visuals, required format translation information to the __DRI_IMAGE_FOURCC_SXRGB8888 format and makes all BGRX visuals sRGB capable just like is done with BGRA. squashed patches from Yevhenii Kolesnikov: dri: Add __DRI_IMAGE_FOURCC_SXRGB8888 conversion i965: force visuals without alpha bits to use sRGB Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1501 Cc: <[email protected]> Signed-off-by: Tapani Pälli <[email protected]> Signed-off-by: Yevhenii Kolesnikov <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3077> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3077>
* dri: add __DRI_IMAGE_FORMAT_SXRGB8Tapani Pälli2019-12-171-0/+4
| | | | | | | | | Add format definition and required plumbing to create images. Cc: <[email protected]> Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3077>
* gallium: refuse to create buffers larger than UINT32_MAXPierre-Eric Pelloux-Prayer2019-12-161-0/+9
| | | | | | | | | | | pipe_resource.width0 is 32 bits and hardware support for bigger buffer is limited (eg: AMD hardware doesn't support buffer shader resources bigger than 4GB). Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2053 Reviewed-by: Marek Olšák <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2948> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2948>
* st/glsl_to_nir: fix SSO validation regressionTimothy Arceri2019-12-131-3/+11
| | | | | | | Fixes: b77907edb554 ("st/glsl_to_nir: use nir based program resource list builder") Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2216 Reviewed-by: Marek Olšák <[email protected]>
* i965/iris: perf-queries: don't invalidate/flush 3d pipelineLionel Landwerlin2019-12-131-1/+9
| | | | | | | | | | | | | | | | | | | Our current implementation of performance queries is fairly harsh because it completely flushes and invalidates the 3d pipeline caches at the beginning and end of each query. An argument can be made that this is how performance should be measured but it probably doesn't reflect what the application is actually doing and the actual cost of draw calls. A more appropriate approach is to just stall the pipeline at scoreboard, so that we measure the effect of a draw call without having the pipeline in a completely pristine state for every draw call. v2: Use end of pipe PIPE_CONTROL instruction for Iris (Ken) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* st/glsl_to_nir: use nir based program resource list builderTimothy Arceri2019-12-134-5/+8
| | | | | | | | | | | | | | | | | Here we use the NIR based builder to add everything to the resource list execpt for SSO packed varyings. Since the details of those varyings get lost during packing we leave the special handing to the GLSL IR pass for now. In order to do this we add some bools to the build resource list functions. Using the NIR based resource list builder gets us a step closer to using a native NIR based linker. It should also be faster than the GLSL IR builder, one because the NIR optimisations should mean we add less entries due to better optimisations, and two because nir gives us better lists to work with and we don't need to walk the entire IR to find the resources. Ack-by: Alejandro Piñeiro <[email protected]>
* st/glsl_to_nir: call gl_nir_lower_buffers() a little laterTimothy Arceri2019-12-131-1/+2
| | | | | | | In a following commit we will use a NIR based builder to build the OpenGL resource list, so we want to delay this call a little. Ack-by: Alejandro Piñeiro <[email protected]>
* glsl: move nir_remap_dual_slot_attributes() call out of glsl_to_nir()Timothy Arceri2019-12-132-0/+16
| | | | | | | | | In order to be able to implement a NIR based glsl linker we need to build the program resource list with NIR. This change delays the remaping so that a later commit can call the NIR based resource list builder. Reviewed-by: Alejandro Piñeiro <[email protected]>
* i965: Enable GL_EXT_gpu_shader4 on Gen6+Jason Ekstrand2019-12-121-0/+1
| | | | | | | It's already enabled for all gallium drivers that support GLSL 1.40 or above and we already support everything in our compiler on SNB+ Reviewed-by: Ian Romanick <[email protected]>
* st/mesa: Don't access members of NULL pointersTomeu Vizoso2019-12-122-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Should be harmless, but UBSAN complains about it and fills the logs with noise. ../src/mesa/state_tracker/st_manager.c:523:27: runtime error: member access within null pointer of type 'struct st_framebuffer'"} #0 0xaad4e89c in st_framebuffer_reference ../src/mesa/state_tracker/st_manager.c:523"} #1 0xaad4e89c in st_api_make_current ../src/mesa/state_tracker/st_manager.c:1091"} #2 0xaab69e0e in dri_make_current ../src/gallium/state_trackers/dri/dri_context.c:301"} #3 0xaab48fd2 in driBindContext ../src/mesa/drivers/dri/common/dri_util.c:581"} #4 0xb682a122 in dri2_make_current ../src/egl/drivers/dri2/egl_dri2.c:1625"} #5 0xb67f95a4 in eglMakeCurrent ../src/egl/main/eglapi.c:884"} #6 0x4c2b0e in tcu::surfaceless::EglRenderContext::EglRenderContext(glu::RenderConfig const&, tcu::CommandLine const&) (/deqp/modules/gles2/deqp-gles2+0x29b0e)"} #7 0x4c3302 in tcu::surfaceless::ContextFactory::createContext(glu::RenderConfig const&, tcu::CommandLine const&, glu::RenderContext const*) const (/deqp/modules/gles2/deqp-gles2+0x2a302)"} #8 0x73a9b0 in glu::createRenderContext(tcu::Platform&, tcu::CommandLine const&, glu::RenderConfig const&, glu::RenderContext const*) (/deqp/modules/gles2/deqp-gles2+0x2a19b0)"} #9 0x73ad86 in glu::createDefaultRenderContext(tcu::Platform&, tcu::CommandLine const&, glu::ApiType) (/deqp/modules/gles2/deqp-gles2+0x2a1d86)"} #10 0x4c6a78 in deqp::gles2::Context::Context(tcu::TestContext&) (/deqp/modules/gles2/deqp-gles2+0x2da78)"} #11 0x4c3ba0 in deqp::gles2::TestPackage::init() (/deqp/modules/gles2/deqp-gles2+0x2aba0)"} #12 0x852fd8 in tcu::TestHierarchyIterator::next() (/deqp/modules/gles2/deqp-gles2+0x3b9fd8)"} #13 0x829660 in tcu::TestSessionExecutor::iterate() (/deqp/modules/gles2/deqp-gles2+0x390660)"} #14 0x810aac in tcu::App::iterate() (/deqp/modules/gles2/deqp-gles2+0x377aac)"} #15 0x4c1d4c in main (/deqp/modules/gles2/deqp-gles2+0x28d4c)"} #16 0xb64b6aa8 in __libc_start_main (/lib/arm-linux-gnueabihf/libc.so.6+0x1aaa8)"} ../src/mesa/state_tracker/st_atom.c:115:8: runtime error: member access within null pointer of type 'struct st_program'"} #0 0xaae11a58 in check_program_state ../src/mesa/state_tracker/st_atom.c:115"} #1 0xaae128f6 in st_validate_state ../src/mesa/state_tracker/st_atom.c:192"} #2 0xaadc58c2 in prepare_draw ../src/mesa/state_tracker/st_draw.c:132"} #3 0xaadc58c2 in st_draw_vbo ../src/mesa/state_tracker/st_draw.c:184"} #4 0xabc4f924 in _mesa_validated_drawrangeelements ../src/mesa/main/draw.c:816"} #5 0xabc50240 in _mesa_DrawElements ../src/mesa/main/draw.c:970"} #6 0x73ebd2 in glu::CallLogWrapper::glDrawElements(unsigned int, int, unsigned int, void const*) (/deqp/modules/gles2/deqp-gles2+0x2d4bd2)"} #7 0x6d86b2 in deqp::gls::FragOpInteractionCase::iterate() (/deqp/modules/gles2/deqp-gles2+0x26e6b2)"} #8 0x494d16 in deqp::gles2::TestCaseWrapper::iterate(tcu::TestCase*) (/deqp/modules/gles2/deqp-gles2+0x2ad16)"} #9 0x7f9cf2 in tcu::TestSessionExecutor::iterateTestCase(tcu::TestCase*) (/deqp/modules/gles2/deqp-gles2+0x38fcf2)"} #10 0x7fa5f0 in tcu::TestSessionExecutor::iterate() (/deqp/modules/gles2/deqp-gles2+0x3905f0)"} #11 0x7e1aac in tcu::App::iterate() (/deqp/modules/gles2/deqp-gles2+0x377aac)"} #12 0x492d4c in main (/deqp/modules/gles2/deqp-gles2+0x28d4c)"} #13 0xb64b9aa8 in __libc_start_main (/lib/arm-linux-gnueabihf/libc.so.6+0x1aaa8)"} Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* intel/decoder: Make get_state_size take a full 64-bit address and a baseKenneth Graunke2019-12-101-3/+4
| | | | | | | | | | | | i965 wants to use an offset from a base because everything is in a single buffer whose address may be relocated, and all base addresses are set to the start of that buffer. iris wants to use a full 64-bit address, because state lives in separate buffers which may be in the shader, surface, and dynamic memory zones, where addresses grow downward from the top of a 4GB zone, So it's very possible for a 32-bit offset to exist relative to multiple bases, leading to the wrong state size.
* gallium: enable INTEL_PERFORMANCE_QUERYDongwon Kim2019-12-105-0/+274
| | | | | | | | | | | | | | | | | new state tracker APIs added for INTEL_performance_query This extension is enabled if all vendor specific functions for it exist. v2: add st_cb_perfquery.* to the list of sources in Makefile v3: minor code clean-up v4: - add driver hooks for intel-performance-query apis - add PIPE level performance counter and type enums that match to OpenGL enums - do conversion of pipe_perf_counter_type and pipe_perf_counter_data_type enums to GL defines in state_tracker Signed-off-by: Dongwon Kim <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: add a notify_before_flush callback param to flushPierre-Eric Pelloux-Prayer2019-12-101-1/+6
| | | | | | | | | | The new callback is called right before the flush is done to allow users of st->flush to do some work after all the previous work has been flushed. This will be used by dri_flush in the next commit. Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: release the draw shader properly to fix driver crashes (iris)Marek Olšák2019-12-091-1/+5
| | | | Reviewed-by: Dave Airlie <[email protected]>
* draw, st/mesa: generate TGSI for ffvp/ARB_vp if draw lacks LLVMMarek Olšák2019-12-091-2/+7
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* st/mesa: don't generate VS TGSI if NIR is enabledMarek Olšák2019-12-091-22/+14
| | | | | | it's no longer needed Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: remove struct st_vp_variant in favor of st_common_variantMarek Olšák2019-12-097-43/+24
| | | | Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: remove st_vp_variant::num_inputsMarek Olšák2019-12-093-11/+5
| | | | Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: use a separate VS variant for the draw moduleMarek Olšák2019-12-093-44/+22
| | | | | | | | instead of keeping the IR indefinitely in st_vp_variant. This trivially fixes Selection/Feedback/RasterPos for NIR. Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: support shader images for Selection/Feedback/RasterPosMarek Olšák2019-12-091-0/+55
| | | | Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: support SSBOs for Selection/Feedback/RasterPosMarek Olšák2019-12-091-0/+40
| | | | Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: support samplers for Selection/Feedback/RasterPosMarek Olšák2019-12-091-0/+107
| | | | Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: save currently bound vertex samplers and sampler views in st_contextMarek Olšák2019-12-094-3/+11
| | | | | | for st_draw_feedback.c Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: support UBOs for Selection/Feedback/RasterPosMarek Olšák2019-12-091-2/+37
| | | | Reviewed-by: Dave Airlie <[email protected]>
* main: Change u_mmAllocMem align2 from bytes (old API) to bits (new API)Kenneth Graunke2019-12-051-1/+1
| | | | | | | | | | | The main and Gallium implementations were recently merged, and the align2 parameter in the Gallium one is in bits. execmem.c expected bytes still. This led to every call here asserting. Fixes: b6fd679a9e("mesa/main/util: moving gallium u_mm to util, remove main/mm") Reviewed-by: Alejandro Piñeiro <[email protected]> Tested-by: Clayton Craft <[email protected]>
* blorp: Pass the VB size to the VF cache workaroundJason Ekstrand2019-12-051-0/+1
| | | | | Reviewed-by: Ivan Briano <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* mesa: Silence unused parameter warningIan Romanick2019-12-049-14/+14
| | | | | | | | | | | | | Unused since e4da8b9c331 ("mesa/compiler: rework tear down of builtin/types"). src/mesa/main/context.c: In function ‘_mesa_free_context_data’: src/mesa/main/context.c:1321:54: warning: unused parameter ‘destroy_compiler_types’ [-Wunused-parameter] 1321 | _mesa_free_context_data(struct gl_context *ctx, bool destroy_compiler_types) | ^ Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* mesa: Silence 'left shift of negative value' warning in BPTC compression codeIan Romanick2019-12-041-4/+3
| | | | | | | | | | | | | | src/util/format/../../mesa/main/texcompress_bptc_tmp.h:830:31: warning: left shift of negative value [-Wshift-negative-value] 830 | value |= (~(int32_t) 0) << n_bits; | ^~ v2: Rewrite to just shift left then shift right. Based on conversation with Neil in https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2792#note_320272, this should be fine. Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> [v1] Reviewed-by: Neil Roberts <[email protected]>
* mesa/main/util: moving gallium u_mm to util, remove main/mmAlejandro Piñeiro2019-12-025-382/+6
| | | | | | | | | | | | | | | | | | | | Right now there are two copies of mm: * mesa/main/mm.[ch] * gallium/auxiliary/util/u_mm.[ch] At some point they splitted, and from the commit message it was not clear why it was not possible to have only one copy at a common place. Taking into account that was several years ago, Im assuming that it was not possible then. This change would allow to have one copy of the same code, and also being able to use that code out of mesa/main or gallium, if needed. This commit moves u_mm and removes mm, as u_mm has slightly more changes. Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: Add GL_TDFX_texture_compression_FXT1 supportKenneth Graunke2019-12-013-4/+8
| | | | | | | | | | | | | Eric recently added PIPE_FORMAT_FXT1_RGB[A] as part of his format unification work. This was really most of the work of implementing the extension. We just need to handle it in a couple of places and expose the extension. v2: Reject the new formats in llvmpipe_is_format_supported to prevent crashes because it doesn't know how to handle the new formats. Reviewed-by: Marek Olšák <[email protected]> [v1] Reviewed-by: Eric Anholt <[email protected]> [v1]
* i965: update Makefile.sources for perf changesJonathan Gray2019-11-291-2/+0
| | | | | | | | | | | | | | brw_performance_query_metrics.h was removed in 134e750e16bfc53480e0bba6f0ae3e1d2a7fb87c and brw_performance_query.h was removed in 8ae6667992ccca41d08884d863b8aeb22a4c4e65 remove reference to these files from Makefile.sources Signed-off-by: Jonathan Gray <[email protected]> Fixes: 134e750e16bfc53480e0 ("i965: extract performance query metrics") Fixes: 8ae6667992ccca41d088 ("intel/perf: move query_object into perf") Reviewed-by: Eric Engestrom <[email protected]>
* st/mesa: unmap pbo after updating cacheErik Faye-Lund2019-11-291-2/+2
| | | | | | | Unmapping first leads to accessing an invalid pointer. So let's switch these lines around. Reviewed-by: Marek Olšák <[email protected]>
* driconf, glsl: Add a vs_position_always_invariant optionKenneth Graunke2019-11-273-0/+8
| | | | | | | | | | | | | | | | | | | | Many applications use multi-pass rendering and require their vertex shader position to be computed the same way each time. Optimizations may consider, say, fusing a multiply-add based on global usage of an expression in a shader. But a second shader with the same expression may have different code, causing that optimization to make the other choice the second time around. The correct solution is for applications to mark their VS outputs 'invariant', indicating they need multiple shaders to compute that output in the same manner. However, most applications fail to do so. So, we add a new driconf option - vs_position_always_invariant - which forces the gl_Position output in vertex shaders to be marked invariant. Fixes: 7025dbe794b ("nir: Skip emitting no-op movs from the builder.") Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* st/mesa: add st_variant base class to simplify code for shader variantsMarek Olšák2019-11-268-307/+149
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa: don't use ** in the st_nir_link_shaders signatureMarek Olšák2019-11-261-20/+20
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa: simplify looping over linked shaders when linking NIRMarek Olšák2019-11-261-48/+28
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa: propagate gl_PatchVerticesIn from TCS to TES before linking for NIRMarek Olšák2019-11-261-2/+2
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa: don't call ProgramStringNotify in glsl_to_nirMarek Olšák2019-11-262-13/+16
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa: don't use redundant stp->state.ir.nirMarek Olšák2019-11-263-25/+12
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa: don't serialize all streamout state if there are no SO outputsMarek Olšák2019-11-261-4/+15
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* mapi: add GetInteger64vEXT with EXT_disjoint_timer_queryTapani Pälli2019-11-261-1/+3
| | | | | | | | | | | | | From EXT_disjoint_timer_query spec: "Interaction: This extension adds GetInteger64vEXT if OpenGL ES 3.0 is not supported" See https://github.com/KhronosGroup/OpenGL-Registry/issues/326. Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2090 Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* Revert "st/mesa: keep serialized NIR instead of nir_shader in st_program"Mark Janes2019-11-204-69/+11
| | | | | | | This reverts commit db0c89d4bffa01ab15dfa819dbb518739131e1a9. Gitlab: mesa/mesa#2128 Acked-by: Marek Olšák <[email protected]>
* Revert "st/mesa: call nir_serialize only once per shader"Mark Janes2019-11-203-25/+22
| | | | | | This reverts commit 3a8d6868897c7dfe72bac09c1eddd551144ca751. Acked-by: Marek Olšák <[email protected]>
* mesa: enable ARB_shading_language_includeTimothy Arceri2019-11-201-1/+1
| | | | | | Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/999 Reviewed-by: Witold Baryluk <[email protected]>
* mesa: implement glCompileShaderIncludeARB()Timothy Arceri2019-11-201-3/+63
| | | | Reviewed-by: Witold Baryluk <[email protected]>
* mesa: add shader include lookup support for relative pathsTimothy Arceri2019-11-201-10/+75
| | | | Reviewed-by: Witold Baryluk <[email protected]>
* mesa: add support cursor support for relative path shader includesTimothy Arceri2019-11-202-0/+19
| | | | | | | | | | | | | This will allow us to continue searching the current path for relative shader includes. From the ARB_shading_language_include spec: "If it is quoted with double quotes in a previously included string, then the first search point will be the tree location where the previously included string had been found." Reviewed-by: Witold Baryluk <[email protected]>