aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
Commit message (Collapse)AuthorAgeFilesLines
...
* 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]>
* st/mesa: add an entirely separate codepath for setting up buffer viewsMarek Olšák2017-06-226-100/+134
| | | | | | | | | | | | Remove handling of buffers from all texture paths. This simplifies things for both buffers and textures. get_sampler_view_format is also cleaned up not to call util_format_is_depth_and_stencil. v2: also update st_NewTextureHandle Reviewed-by: Nicolai Hähnle <[email protected]> (v1)
* st/mesa: don't return an error from update_single_textureMarek Olšák2017-06-223-11/+7
| | | | | | | It can just return a NULL sampler view, which is better than not doing anything at all. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: clean up trivial dereferences in update_texturesMarek Olšák2017-06-221-6/+7
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: don't check MaxTextureImageUnits in update_texturesMarek Olšák2017-06-221-12/+2
| | | | | | The linker takes care of it. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: don't call st_shader_stage_to_ptarget in update_texturesMarek Olšák2017-06-221-8/+7
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: sink and simplify texBaseFormat getting for sampler statesMarek Olšák2017-06-221-9/+9
| | | | | Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: don't set sampler states for TBOsMarek Olšák2017-06-222-4/+12
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: optimize sampler state translation codeMarek Olšák2017-06-221-48/+20
| | | | | Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: sink code needed for apply_texture_swizzle_to_border_colorMarek Olšák2017-06-221-28/+33
| | | | | Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: simplify update_shader_samplersMarek Olšák2017-06-221-16/+8
| | | | | Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: when binding sampler states, don't check the max sampler limitMarek Olšák2017-06-221-8/+1
| | | | | | | The GLSL linker takes care of it. Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: don't unbind sampler states if none are usedMarek Olšák2017-06-221-1/+1
| | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa: unify update_gp/tcp/tep codeMarek Olšák2017-06-221-63/+28
| | | | | Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: don't search through shader variants if there is only oneMarek Olšák2017-06-221-51/+90
| | | | | Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: don't track shader variants in st_contextMarek Olšák2017-06-222-23/+14
| | | | | Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: move blend color into its own state atomMarek Olšák2017-06-223-6/+10
| | | | | | | This is now sensible thanks to the NewBlendColor flag. Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: check correctly if multisampling is enabledMarek Olšák2017-06-222-3/+4
| | | | | Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: don't invoke st_finalize_texture & st_convert_sampler for TBOsMarek Olšák2017-06-221-4/+6
| | | | | | This is a v2 of the previous patch (v1 didn't skip st_finalize_texture). Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: don't flag _NEW_PROGRAM_CONSTANTS for GLSL programs for st/mesaMarek Olšák2017-06-221-3/+0
| | | | | | | | | v2: also update _mesa_uniform_handle for bindless textures Reviewed-by: Nicolai Hähnle <[email protected]> (v1) Reviewed-by: Brian Paul <[email protected]> (v1) Reviewed-by: Timothy Arceri <[email protected]> (v1) Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: don't flag _NEW_PROGRAM_CONSTANTS for non-GLSL programs for st/mesaMarek Olšák2017-06-221-0/+10
| | | | | | | | | This has the benefit that we get to set up constants for exactly the shader stage that needs it. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: don't flag _NEW_POLYGON_STIPPLE for st/mesaMarek Olšák2017-06-221-3/+1
| | | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: don't flag _NEW_LINE for st/mesaMarek Olšák2017-06-221-1/+1
| | | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>