summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
Commit message (Collapse)AuthorAgeFilesLines
* st/mesa: remove useless st_bufferobj_validate_usage()Samuel Pitoiset2017-07-282-19/+0
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* st/mesa: remove st_cache.hSamuel Pitoiset2017-07-281-69/+0
| | | | | | | It contains unused prototypes. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* st/glsl_to_tgsi: fix getting the image type for array of structsSamuel Pitoiset2017-07-281-1/+1
| | | | | | | | | | | | | | | | Since array splitting for AoA is disabled, we have to retrieve the type of the first non-array type when an array of images is declared inside a structure. Otherwise, it will hit an assert in glsl_type::sampler_index() because it expects either a sampler or an image type. This fixes a regression in the following piglit test: arb_bindless_texture/compiler/images/arrays-of-struct.frag Fixes: 57165f2ef8 ("glsl: disable array splitting for AoA") Cc: 17.2 <[email protected]> Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: drop fence type parameter from NewSyncObject()Samuel Pitoiset2017-07-281-9/+4
| | | | | | | This is useless. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: release sampler views when redefining a texture in st_context_teximageMarek Olšák2017-07-281-0/+2
| | | | | | | Noticed randomly. Cc: 17.2 <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: always unconditionally revalidate main framebuffer after SwapBuffersMarek Olšák2017-07-281-0/+10
| | | | | | | | | This fixes the black Feral launcher window. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101867 Cc: 17.2 <[email protected]> Tested-by: Edmondo Tommasina <[email protected]>
* st/mesa: Fix inversed test in st_api_destroy_drawableMichel Dänzer2017-07-271-1/+1
| | | | | | | | | | Fixes a drawable leak. Fixes: bbc29393d3be ("st/mesa: create framebuffer iface hash table per st manager") Bugzilla: https://bugs.freedesktop.org/101930 Tested-by: Nick Sarnie <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: also clamp and quantize per-unit lod biasMarek Olšák2017-07-263-4/+6
| | | | | Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: fix unconditional return in st_framebuffer_iface_removeMarek Olšák2017-07-261-1/+1
| | | | | | | Noticed by James Legg @ Feral. Cc: 17.2 <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa/st: fix inconsistent indentation of st_cb_bufferobjects.cAndres Rodriguez2017-07-261-18/+18
| | | | | | | No changes, just re-indent. Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa/st: fix unused variable warningsTimothy Arceri2017-07-264-10/+11
| | | | | Reviewed-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: move st_pipe_format_to_mesa_format() call to where its usedTimothy Arceri2017-07-261-2/+1
| | | | | Reviewed-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: create framebuffer iface hash table per st managerCharmaine Lee2017-07-241-27/+80
| | | | | | | | | | | | | | | | With commit 5124bf98239, a framebuffer interface hash table is created in st_gl_api_create(), which is called in dri_init_screen_helper() for each screen. When the hash table is overwritten with multiple calls to st_gl_api_create(), it can cause race condition. This patch fixes the problem by creating a framebuffer interface hash table per state tracker manager. Fixes crash with steam. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101876 Fixes: 5124bf98239 ("st/mesa: add destroy_drawable interface") Tested-by: Christoph Haag <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: use proper resource target type in st_AllocTextureStorage()Brian Paul2017-07-221-1/+4
| | | | | | | | | | | When we validate the texture sample count, pass the correct pipe_texture_target for the texture, rather than PIPE_TEXTURE_2D. Also add more comments about MSAA. No piglit regressions with VMware driver. Reviewed-by: Samuel Pitoiset <[email protected]>
* st/glsl_to_tgsi: don't optimize mul+add to mad if expression is preciseKarol Herbst2017-07-211-1/+1
| | | | | Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* tgsi: populate preciseKarol Herbst2017-07-213-24/+24
| | | | | | | | | Only implemented for glsl->tgsi. Other converters just set precise to 0. v2: remove precise paramter from ureg_tex_insn and ureg_memory_insn Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/glsl_to_tgsi: handle precise modifierKarol Herbst2017-07-211-0/+13
| | | | | | | | | all subexpression inside an ir_assignment needs to be tagged as precise. v2: make precise handling more global inside the visitor Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: add destroy_drawable interfaceCharmaine Lee2017-07-202-1/+99
| | | | | | | | | | | | | | | With this patch, the st manager will maintain a hash table for the active framebuffer interface objects. A destroy_drawable interface is added to allow the state tracker to notify the st manager to remove the associated framebuffer interface object from the hash table, so the associated framebuffer and its resources can be deleted at framebuffers purge time. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101829 Fixes: 147d7fb772a ("st/mesa: add a winsys buffers list in st_context") Tested-by: Brad King <[email protected]> Tested-by: Gert Wollny <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: init winsys buffers list only if context creation succeedsCharmaine Lee2017-07-111-3/+3
| | | | | | | | Fixes piglit test crash when context creation fails. v2: As suggested by Brian, move the init to st_create_context_priv() Reviewed-by: Brian Paul <[email protected]>
* st/mesa: Add support for KHR_no_error flagGrigori Goronzy2017-07-143-5/+14
| | | | | | | Add a new context flag and plumb it through the various layers of the context creation code to set up dispatch tables for the no-error mode. Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: handle stfbi being NULL on entry of st_framebuffer_reuse_or_createLucas Stach2017-07-141-0/+3
| | | | | | | | | | | Apparently this can happen. Just bail out early in that case, as all the called functions return NULL in that case. Fixes weston-terminal for me. Fixes: 147d7fb772a7 ("st/mesa: add a winsys buffers list in st_context") Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* st/mesa: Handle st_framebuffer_create returning NULLMichel Dänzer2017-07-131-3/+5
| | | | | | | | | | | | | st_framebuffer_create returns NULL if stfbi == NULL or st_framebuffer_add_renderbuffer returns false for the colour buffer. Fixes Xorg crashing on startup using glamor on radeonsi. Fixes: 147d7fb772a7 ("st/mesa: add a winsys buffers list in st_context") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101775 Signed-off-by: Michel Dänzer <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: add a winsys buffers list in st_contextCharmaine Lee2017-07-114-10/+81
| | | | | | | | | | | | | | | | | | | | | Commit a5e733c6b52e93de3000647d075f5ca2f55fcb71 fixes the dangling framebuffer object by unreferencing the window system draw/read buffers when context is released. However this can prematurely destroy the resources associated with these window system buffers. The problem is reproducible with Turbine Demo running with VMware driver. In this case, the depth buffer content was lost when the context is rebound to a drawable. To prevent premature destroy of the resources associated with window system buffers, this patch maintains a list of these buffers in the context, making sure the reference counts of these buffers will not reach zero until the associated framebuffer interface objects no longer exist. This also helps to avoid unnecessary destruction and re-construction of the resources associated with the framebuffer. Fixes VMware bug 1909807. Reviewed-by: Brian Paul <[email protected]>
* gallium: use "ull" number suffix to keep the QtCreator parser happyMarek Olšák2017-07-101-2/+2
| | | | | | | It can't parse "llu". Reviewed-by: Thomas Helland <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* st/mesa: Fix grabbing the wrong variant if glDrawPixels is calledMatias N. Goldberg2017-07-082-4/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | By design pixel shaders can have up to 3 variants: * The standard one. * glDrawPixels variant. * glBitmap variant. However "shader_has_one_variant" ignores this fact, and therefore st_update_fp would select the wrong variant if glDrawPixels or glBitmap was ever called. This patch fixes the problem. If the standard variant has been created, calling glDrawPixels or glBitmap will append the variant to the second entry of the linked list, so that st_update_fp still selects the right one if shader_has_one_variant is set. If the standard variant hasn't been created yet and glDrawPixel/Bitmap has been called, st_update_fp will will see this and take the slow path instead. The standard variant will then be added at the front of the linked list, so that the next time the fast path is taken. Blender in particular is hit by this bug. v2: Marek - cosmetic changes Fixes https://bugs.freedesktop.org/show_bug.cgi?id=101596 Signed-off-by: Marek Olšák <[email protected]>
* st/mesa: remove unused st_framebuffer::Private fieldBrian Paul2017-07-071-1/+0
| | | | | Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* st/mesa: find proper mipmap level in st_ClearTexSubImage()Brian Paul2017-07-061-4/+56
| | | | | | | | | | | | | | | | | | | | The Piglit arb_clear_texture-error test creates a texture with only a 1x1 image at level=1, then tries to clear level 0 (nonexistent) and level 1 (exists). The test only checks that the former generates an error but the later doesn't. The test passes, but when we try to clear the level=1 image we're passing an invalid level to pipe_context::clear_texture(). level=1, but since there's only one mipmap level in the texture, it should be zero. This fixes the code to search the gallium texture resource for the correct mipmap level. Also, add an assertion to make sure we're not passing an invalid level to pipe_context::clear_texture(). Fixes device errors with VMware driver. No Piglit regressions. v2: don't do the level search when using immutable textures. Reviewed-by: Charmaine Lee <[email protected]>
* st/mesa: whitespace fixes in st_cb_fbo.cBrian Paul2017-07-061-29/+19
| | | | Trivial.
* st/mesa: whitespace fixes in st_texture.cBrian Paul2017-07-061-13/+15
| | | | Trivial.
* st/glsl_to_nir: fix edgeflag passthroughNicolai Hähnle2017-07-052-1/+6
| | | | | | | | | | We have to mark the additional shader input as used, otherwise it will be eliminated, and we have to setup its index correctly. This is a bit of a hack, but so is everything surrounding edgeflag passthrough. Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: use pipe_shader_type_from_mesaNicolai Hähnle2017-07-051-21/+2
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* tgsi,st/mesa: move varying slot to semantic mapping into a helper for VSNicolai Hähnle2017-07-052-99/+8
| | | | | | | We will use this helper in radeonsi's NIR path. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: release EGLImage on EGLImageTarget* errorPhilipp Zabel2017-07-041-0/+1
| | | | | | | | | | | | | The smapi->get_egl_image() call in st_egl_image_get_surface() stores a reference to the EGLImage's texture in stimg.texture. That reference is released via pipe_resource_reference(&stimg.texture, NULL) before stimg goes out of scope at the end of the function, but not in the error path if !is_format_supported(). Fixes: 83e9de25f325 ("st/mesa: EGLImageTarget* error handling") Cc: [email protected] Signed-off-by: Philipp Zabel <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: fix tessellation shaders with no support for shareable shadersMarek Olšák2017-07-031-2/+2
| | | | | | | | Broken by: b43c887a9bf1e3fb99b0dc22bfea5db81375a06e Reported by Gert Wollny. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: remove an obsolete commentNicolai Hähnle2017-07-031-1/+0
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa: fix texture image resource selection in st_render_texture()Brian Paul2017-06-301-1/+18
| | | | | | | | | | | | | | If we're rendering to an incomplete/inconsistent (cube) texture, the different faces/levels of the texture may be stored in different resources. Before, we always used the texture object resource. Now, we use the texture image resource. In normal circumstances, that's the same resource. But in some cases, such as the Piglit fbo-incomplete-texture-03 test, the cube faces are in different resources and we need to render to the texture image resource. Fixes fbo-incomplete-texture-03 with VMware driver. Reviewed-by: Roland Scheidegger <[email protected]>
* st/mesa: check for incomplete texture in st_finalize_texture()Brian Paul2017-06-301-0/+12
| | | | | | | | | | | | | | | | | | | | | | | Return early from st_finalize_texture() if we have an incomplete texture. This avoids trying to create a texture resource with invalid parameters (too many mipmap levels given the base dimension). Specifically, the Piglit fbo-incomplete-texture-03 test winds up calling pipe_screen::resource_create() with width0=32, height0=32 and last_level=6 because the first five cube faces are 32x32 but the sixth face is 64x64. Some drivers handle this, but others (like VMware svga) do not (generates device errors). Note that this code is on the path that's usually not taken (we normally build consistent textures). No Piglit regressions. v2: only need to check for base-level completeness since that's what has to be consistent in order to specify the dimensions for a new gallium texture. Per Roland. Reviewed-by: Roland Scheidegger <[email protected]>
* mesa/glthread: add glthread "perf" counters and pass them to gallium HUDMarek Olšák2017-06-261-2/+3
| | | | | | | | | | | for HUD integration in following commits. This valuable profiling data will allow us to see on the HUD how well glthread is able to utilize parallelism. This is better than benchmarking, because you can see exactly what's happening and you don't have to be CPU-bound. u_threaded_context has the same counters. Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa: don't set the border color if it's unusedMarek Olšák2017-06-221-4/+18
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: don't set 16 scissors and 16 viewports if they're unusedMarek Olšák2017-06-224-6/+34
| | | | | | | Only do so if there is a shader writing gl_ViewportIndex. This removes a lot of CPU overhead for the most common case. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: fix pipe_rasterizer_state::scissor with multiple viewportsMarek Olšák2017-06-221-1/+1
| | | | | Cc: 17.1 <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: simplify st_update_viewportMarek Olšák2017-06-221-25/+10
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: remove redundant sample_mask checkingMarek Olšák2017-06-222-7/+1
| | | | | | cso does that too Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: use precomputed st_fb_orientationMarek Olšák2017-06-224-8/+8
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: set st_context::...num_samplers to 0 when there are no samplersMarek Olšák2017-06-221-1/+3
| | | | | | This was missed during my st/mesa series. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: unify fail paths for update_single_textureMarek Olšák2017-06-222-7/+2
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: don't call u_sampler_view_default_template for sampler viewsMarek Olšák2017-06-221-1/+2
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: always set sampler swizzle according to the texture base formatMarek Olšák2017-06-221-32/+9
| | | | | | | | | Mainly don't (indirectly) call util_format_description here. If the driver supports texture swizzling, this will always do the right thing. If the driver doesn't support it, it doesn't matter. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: samplers only need to track whether GLSL >= 130Marek Olšák2017-06-225-22/+25
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: simplify get_texture_format_swizzleMarek Olšák2017-06-221-23/+20
| | | | | | | - Don't check GL_NONE (that was only for buffers). - Don't use util_format_is_depth_or_stencil. Reviewed-by: Nicolai Hähnle <[email protected]>