aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
Commit message (Collapse)AuthorAgeFilesLines
...
* glsl_to_tgsi: clean up opcode translationMarek Olšák2017-08-221-62/+30
| | | | | | An island of beauty in the middle of chaos. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: pass ctx to add_uniform_to_shader constructorTimothy Arceri2017-08-222-2/+2
| | | | | | Fixes: 4c2422067b5c ("glsl: pass UseSTD430AsDefaultPacking to where it will be used") Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa/st: simplify some UBO index logicTimothy Arceri2017-08-221-3/+2
| | | | Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: remove Windows hack for glFinishBrian Paul2017-08-161-12/+0
| | | | | | | | | | | | | | I see no evidence that opengl32.dll's wglSwapBuffers calls glFinish. It looks like Jose removed that dependency years ago, but this hack remained. Removing this code also fixes the Piglit sync_api test since commit eceb6710024716. No piglit regressions. No glretrace regressions, per Charmaine. Fixes VMware bug 1937990. Reviewed-by: Charmaine Lee <[email protected]>
* st/mesa: fix a null pointer accessFrank Richter2017-08-161-1/+1
| | | | | | | | Fixes crash with llvmpipe on Windows. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102148 Cc: [email protected] Reviewed-by: Brian Paul <[email protected]>
* st/mesa: correctly calculate the storage offsetTimothy Arceri2017-08-153-2/+163
| | | | | | | | | | When generating the storage offset for struct members we need to skip opaque types as they no longer have backing storage. Fixes: fcbb93e86024 ("mesa: stop assigning unused storage for non-bindless opaque types") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101983 Reviewed-by: Dave Airlie <[email protected]>
* glsl: pass mem_ctx to constant_expression_value(...) and friendsTimothy Arceri2017-08-111-2/+5
| | | | | | | | | | | | | | | | | | | | The main motivation for this is that threaded compilation can fall over if we were to allocate IR inside constant_expression_value() when calling it on a builtin. This is because builtins are shared across the whole OpenGL context. f81ede469910d worked around the problem by cloning the entire builtin before constant_expression_value() could be called on it. However cloning the whole function each time we referenced it lead to a significant reduction in the GLSL IR compiler performance. This change along with the following patch helps fix that performance regression. Other advantages are that we reduce the number of calls to ralloc_parent(), and for loop unrolling we free constants after they are used rather than leaving them hanging around. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: stop copying struct and interface member namesTimothy Arceri2017-08-111-18/+16
| | | | | | | | | | | We are currently copying the name for each member dereference but we can just share a single instance of the string provided by the type. This change also stops us recalculating the field index repeatedly. Reviewed-by: Thomas Helland <[email protected]>
* glsl: calculate number of operands in an expression onceTimothy Arceri2017-08-111-3/+3
| | | | | | | | | | | | | | | | | | | Extra validation is added to ir_validate to make sure this is always updated to the correct numer of operands, as passes like lower_instructions modify the instructions directly rather then generating a new one. The reduction in time is so small that it is not really measurable. However callgrind was reporting this function as being called just under 34 million times while compiling the Deus Ex shaders (just pre-linking was profiled) with 0.20% spent in this function. v2: - make num_operands a unit8_t - fix unsigned/signed mismatches Reviewed-by: Thomas Helland <[email protected]>
* mesa: hook up UUID queries for driver and deviceAndres Rodriguez2017-08-061-0/+22
| | | | | | | | | v2: respective changes for new gallium interface v3: fix UUID size asserts Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa/st: expose EXT_memory_object and EXT_memory_object_fdAndres Rodriguez2017-08-061-0/+2
| | | | | | | | | | | v2: use PIPE_CAP_MEMOBJ to guard the extension v3 (Timothy Arceri): - expose extensions via the cap_mappings array Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa/st: implement memory objects as a backend for buffer objectsAndres Rodriguez2017-08-061-17/+49
| | | | | | | | Use a memory object instead of user memory. Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa/st: implement memory objects as a backend for texture storageDave Airlie2017-08-062-12/+106
| | | | | | | | | | | | Instead of allocating memory to back a texture, use the provided memory object. v2: split off extension exposure logic v3: de-duplicate code with st_AllocTextureStorage Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa/st: factor out st_AllocTextureStorage into a helperAndres Rodriguez2017-08-061-7/+19
| | | | | | | | Plumbing for using memory objects as texture storage. Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: start adding memory object supportDave Airlie2017-08-063-0/+91
| | | | | | | | | | | | v2: pass dedicated flag v3 (Timothy Arceri): - remove unrequired _mesa_init_memory_object_functions() call in the state tracker. Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Marek Olšák <[email protected]> (v2) Reviewed-by: Samuel Pitoiset <[email protected]>
* st/mesa: fix handling of NumSamples=1 (v2)Brian Paul2017-08-032-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Mesa we use the convention that if gl_renderbuffer::NumSamples or gl_texture_image::NumSamples is zero, it's a non-MSAA surface. Otherwise, it's an MSAA surface. But in gallium nr_samples=1 is a non-MSAA surface. Before, if the user called glRenderbufferStorageMultisample() or glTexImage2DMultisample() with samples=1 we skipped the search for the next higher number of supported samples and asked the gallium driver to create a surface with nr_samples=1. So we got a non-MSAA surface. This failed to meet the expection of the user making those calls. This patch changes the sample count checks in st_AllocTextureStorage() and st_renderbuffer_alloc_storage() to test for samples > 0 instead of > 1. And we now start querying for MSAA support at samples=2 since gallium has no concept of a 1x MSAA surface. A specific example of this problem is the Piglit arb_framebuffer_srgb-blit test. It calls glRenderbufferStorageMultisample() with samples=1 to request an MSAA renderbuffer with the minimum supported number of MSAA samples. Instead of creating a 4x or 8x, etc. MSAA surface, we wound up creating a non-MSAA surface. Finally, add a comment on the gl_renderbuffer::NumSamples field. There is one piglit regression with the VMware driver: ext_framebuffer_multisample-blit-mismatched-formats fails because now we're actually creating 4x MSAA surfaces (the requested sample count is 1) and we're hitting some sort of bug in the blitter code. That will have to be fixed separately. Other drivers may find regressions too now that MSAA surfaces are really being created. v2: start quering for MSAA support with samples=2 instead of 1. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: minor clean-ups in st_atom_msaa.cBrian Paul2017-08-031-16/+18
| | | | | Whitespace, formatting, combine nr_bits assignment with declaration. Trivial.
* gallium/st: Add a method to flush outstanding swapbuffersThomas Hellstrom2017-08-033-0/+27
| | | | | | | | | | | | | Add a state tracker interface method to flush outstanding swapbuffers, and add a call to it from the mesa state tracker during glFinish(). This doesn't strictly mean the outstanding swapbuffers have actually finished executing but is sufficient for glFinish() to be able to be used as a replacement for glXWaitGL(). Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]>
* st/mesa: replace st_shader_stage_to_ptargetNicolai Hähnle2017-08-025-31/+8
| | | | | | | Use pipe_shader_type_from_mesa instead. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: Reduce the number of frontbuffer flush callsThomas Hellstrom2017-08-022-39/+10
| | | | | | | | | | | | | The mesa state tracker was needlessly flushing the front buffer even if it hadn't been drawn to since the last flush. This was happening during glXSwapBuffers if we at some point previously had set that frontbuffer as a read- or draw renderbuffer, or at glFlush() or glFinish() if we at some point previously had rendered to the front buffer. Since the frontbuffer flush typically means a full drawable copy, it's a pretty big waste. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]>
* st/mesa: implement ARB_transform_feedback_overflow_queryNicolai Hähnle2017-08-022-1/+4
| | | | | | v2: update for new cap name Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: fix conditional jump depends on uninitialised valueTimothy Arceri2017-08-021-0/+1
| | | | | | | | | | | | Reported by valgrind at: glsl_to_tgsi_visitor::visit(ir_expression*) (st_glsl_to_tgsi.cpp:1560) When compiling the Deus Ex shaders. Fixes: 28a5e7104 ("st/glsl_to_tgsi: handle precise modifier") Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Karol Herbst <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* Revert "st_glsl_to_tgsi: rewrite rename registers to use array fully."Dave Airlie2017-08-011-26/+29
| | | | | | | | | | | | | | This reverts commit 3008161d28e38336ba39aba4769a2deaf9732f55, which caused a regression for VMWare. The initial code had some recursion in it, that I removed by accident trying to add back the recursion broke lots of things, take the high road and revert for now. Fixes: 3008161d (st_glsl_to_tgsi: rewrite rename registers to use array fully.) Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* Revert "st/mesa: release sampler views when redefining a texture in ↵Marek Olšák2017-07-311-2/+0
| | | | | | | | | | st_context_teximage" This reverts commit 5c1241268ba9b240cb79ab9a30c5255b176c83c9. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101961 Cc: 17.2 <[email protected]>
* st/glsl_to_nir: move nir_lower_io to driversNicolai Hähnle2017-07-311-2/+1
| | | | | | | This allows drivers more freedom in how exactly they want to lower I/O, e.g. first lowering I/O to temporaries. Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: get rid of st_glsl_typesNicolai Hähnle2017-07-314-160/+13
| | | | | | | It's a duplicate of glsl_type::count_attribute_slots. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/glsl_to_nir: use nir_lower_samplers_as_deref when requested by the driverNicolai Hähnle2017-07-311-1/+6
| | | | Reviewed-by: Marek Olšák <[email protected]>
* st/glsl_to_nir: fix the case where NIR clone testing is enabledNicolai Hähnle2017-07-311-1/+2
| | | | | | | In that case, prog->nir must be assigned at the end. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* 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]>