summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
Commit message (Collapse)AuthorAgeFilesLines
* st/mesa: call glthread_destroy() before _vbo_DestroyContext()Timothy Arceri2017-03-171-0/+3
| | | | | | | | | Otherwise we have a race condition between vbo calls in the glthread and the _vbo_DestroyContext() call. This fixes a bunch of piglit crashes. Reviewed-by: Marek Olšák <[email protected]>
* gallium: implement the backend of threaded GL dispatchMarek Olšák2017-03-162-0/+32
| | | | | | Acked-by: Timothy Arceri <[email protected]> Tested-by: Dieter Nützel <[email protected]> Tested-by: Mike Lothian <[email protected]>
* glsl_to_tgsi: use TEX_LZ and TXF_LZ when availableMarek Olšák2017-03-151-6/+20
|
* glsl_to_tgsi: remove a redundant statementMarek Olšák2017-03-151-2/+0
| | | | it's the same as the last "else".
* st/mesa: disable the shader cache if dumping shadersMarek Olšák2017-03-131-4/+4
| | | | | | otherwise, cached shaders aren't dumped. Reviewed-by: Timothy Arceri <[email protected]>
* glsl: don't use ralloc for blob creationTimothy Arceri2017-03-131-2/+2
| | | | | | There is no need to use ralloc here. Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: don't propagate uniforms when restoring from cacheTimothy Arceri2017-03-083-3/+6
| | | | | | | We will have already loaded the uniforms when the parameter list was restored from cache. Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: inform the driver of framebuffer changes before compute dispatchesNicolai Hähnle2017-03-011-1/+9
| | | | | | | | | | | | | | | | | | | Even though compute shaders cannot access the framebuffer, there is a synchronization issue when a compute dispatch accesses a texture that was previously bound and drawn to as a framebuffer. Section 9.3 (Feedback Loops Between Textures and the Framebuffer) of the OpenGL 4.5 spec rather implicitly clarifies that undefined behavior results if the texture is still attached to the currently bound framebuffer. However, the feedback loop is broken when the application changes the framebuffer binding before a compute dispatch, and the state tracker needs to let the driver known about this. Fixes GL45-CTS.compute_shader.pipeline-post-fs on SI family Radeons. Cc: [email protected] Signed-off-by: Marek Olšák <[email protected]>
* st/glsl_to_tgsi: avoid iterating past the head of the instruction listNicolai Hähnle2017-03-011-2/+9
| | | | | | | | | | | exec_node::get_prev() does not guard against going past the beginning of the list, so we need to add explicit checks here. Found by ASAN in piglit arb_shader_storage_buffer_object-rendering. Cc: [email protected] Signed-off-by: Marek Olšák <[email protected]>
* st/mesa: don't update unrelated states in non-draw calls such as ClearMarek Olšák2017-02-256-4/+21
| | | | | | | | | | If a VAO isn't bound and u_vbuf isn't enabled because of the Core profile, we'll get user vertex buffers in drivers if we update vertex buffers in glClear. So don't do that. This fixes a regression since disabling u_vbuf for Core profiles. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: set blend state for PBO readbacksMarek Olšák2017-02-251-0/+6
| | | | | | | v2: restore the state Cc: 13.0 17.0 <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: reset sample_mask, min_sample, and render_condition for PBO opsMarek Olšák2017-02-252-0/+13
| | | | | Cc: 13.0 17.0 <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: don't check st->vp in update_clipMarek Olšák2017-02-251-4/+2
| | | | | | | The clip state is updated before VS, so it can be NULL for the first draw call. Just remove the unnecessary dependency on st->vp. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: assume all drivers support user index buffersMarek Olšák2017-02-253-40/+13
| | | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]> (VMware driver only)
* st/mesa: free shader cache buffer on fallbackTimothy Arceri2017-02-241-1/+3
| | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Tested-by: Michel Dänzer <[email protected]>
* st/mesa: fix crash in shader cache cased by race conditionTimothy Arceri2017-02-241-6/+8
| | | | | | | | | | If a thread doesn't load GLSL IR from cache but does load TGSI from cache (that was created by another thread) than it will crash due to expecting gl_program_parameter_list to have been restored from the GLSL IR cache and not be null. Reviewed-by: Edward O'Callaghan <[email protected]> Tested-by: Michel Dänzer <[email protected]>
* st: add ST_FLUSH_WAIT to st_context_flush()Charmaine Lee2017-02-181-0/+7
| | | | | | | When st_context_flush() is called with ST_FLUSH_WAIT, the function will return after the fence is completed. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: get on-disk shader cacheTimothy Arceri2017-02-231-0/+3
| | | | | | Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: implement a tgsi on-disk shader cacheTimothy Arceri2017-02-234-6/+479
| | | | | | | | Implements a tgsi cache for the OpenGL state tracker. V2: add support for compute shaders Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: add sha1 field to st program structsTimothy Arceri2017-02-231-0/+18
| | | | | | | This will be used to share the sha1 computed by the tgsi load function with the tgsi write function. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: move set_prog_affected_state_flags() to st_program.cTimothy Arceri2017-02-233-141/+144
| | | | | | | We want to use this in the new tgsi shader cache so we move it here and make it available externally. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: Track transform feedback overflow query objects.Rafael Antognolli2017-02-211-0/+6
| | | | | | | Also update checks on conditional rendering. Signed-off-by: Rafael Antognolli <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: move extern C wrappers where applicableEmil Velikov2017-02-212-7/+7
| | | | | | | | | Namely, after the include directives. The headers are properly annotated so keeping things as-is is only asking for trouble. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: stop using TGSI_OPCODE_CLAMPMarek Olšák2017-02-181-10/+4
| | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa/glsl: build string of dri options and use as input to building sha ↵Timothy Arceri2017-02-171-0/+2
| | | | | | for shaders Reviewed-by: Nicolai Hähnle <[email protected]>
* driconf: add allow_higher_compat_version optionSamuel Pitoiset2017-02-151-0/+2
| | | | | | | | | | | | | | | | | | | Mesa currently doesn't allow to create 3.1+ compatibility profiles mainly because various features are unimplemented and bugs can happen. However, some buggy apps request a compat profile without using any old features unimplemented in mesa, and they fail to start. This option should help some games to run but it's not enough for all (eg. Dying Light). v2: - s/force_compat_profile/allow_higher_compat_version Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Edmondo Tommasina <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: tell u_vbuf that GL core doesn't have user VBOsMarek Olšák2017-02-141-1/+8
| | | | | | | I think this only affects radeonsi - VI, because all other drivers using u_vbuf probably don't support GL_DOUBLE, so they won't be affected by this. Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium: let state trackers tell u_vbuf whether user VBOs are possibleMarek Olšák2017-02-141-1/+1
| | | | | | This can affect whether u_vbuf will be enabled or not. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: use the common uploader (v2)Marek Olšák2017-02-147-44/+25
| | | | | | | | v2: use const_uploader Reviewed-by: Nicolai Hähnle <[email protected]> Tested-by: Edmondo Tommasina <[email protected]> (v1) Tested-by: Charmaine Lee <[email protected]>
* st/mesa: don't pass compare mode for stencil-sampled texturesIlia Mirkin2017-02-121-1/+1
| | | | | | | | Fixes dEQP-GLES31.functional.stencil_texturing.misc.compare_mode_effect Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Cc: [email protected]
* gallium: add separate PIPE_CAP_INT64_DIVMODIlia Mirkin2017-02-091-0/+3
| | | | | | | | | | | Nouveau does not currently have logic to implement this as a library function. Even though such a library could be written, there's no big advantage to do it that way for now given that int64 is a very uncommon use-case. Allow a driver to expose INT64 without supporting division and modulo operations. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa/i965: create link status enumTimothy Arceri2017-02-091-1/+1
| | | | | | | | | | | | For the on-disk shader cache we want to be able to differentiate between a program that was linked and one that was loaded from cache. V2: - don't return the new enum directly to the application when queried, instead return GL_TRUE or GL_FALSE as required. Fixes google-chrome corruptions when using cache. Reviewed-by: Anuj Phogat <[email protected]>
* mesa/st: fix strict aliasing issue in int64 code.Dave Airlie2017-02-081-4/+2
| | | | | | | This fixes the int64 code same as the double code. Reviewed-by: Timothy Arceri <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* st/mesa: MAX_VARYING is the max supported number of patch varyings, not minIlia Mirkin2017-02-021-1/+1
| | | | | | | | | | | This fixes GL45-CTS.tessellation_shader.tessellation_shader_tessellation.max_in_out_attributes on nouveau. We only support 30 patch varyings (as 2 vec4 slots end up being used for tess level settings), but were getting 32 exposed. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Cc: "13.0 17.0" <[email protected]>
* gallium: turn PIPE_SHADER_CAP_DOUBLES into a screen capabilityNicolai Hähnle2017-02-021-4/+1
| | | | | | | | | | | | | | | | | | | Make the cap consistent with PIPE_CAP_INT64. Aside from the hypothetical case of using draw for vertex shaders (and actually caring about doubles...), every implementation supports doubles either nowhere or everywhere. Also, st/mesa didn't even check the cap correctly in all supported shader stages. While at it, add a missing LLVM version check for 64-bit integers in radeonsi. This is conservative: judging by the log, LLVM 3.8 might be sufficient, but there are probably bugs that have been fixed since then. v2: fix clover (Marek) Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: inline get_mesa_program()Timothy Arceri2017-02-021-37/+23
| | | | | | | | | | In the past I've gotten this function confused with the one in ir_to_mesa.cpp of the same name. Now that the affected flag setting has move into a helper it makes sense just to inline this remaining code. Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: create set_prog_affected_state_flags() helperTimothy Arceri2017-02-021-106/+111
| | | | | | | | This will be used when restoring tgsi from the on-disk shader cache. Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: st_atom_shader.c C99 tidy upTimothy Arceri2017-02-021-3/+1
| | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: remove pre C99 statement block for variable declarationTimothy Arceri2017-02-021-60/+58
| | | | Acked-by: Marek Olšák <[email protected]>
* st/mesa: make st_texture_get_sampler_view() staticSamuel Pitoiset2017-01-302-5/+1
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: use correct return statement for a void functionEmil Velikov2017-01-271-1/+2
| | | | | | | | Analogous to previous commit. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: add support for enabling ARB_gpu_shader_int64.Dave Airlie2017-01-271-0/+1
| | | | | | Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/glsl_to_tgsi: add support for 64-bit integersDave Airlie2017-01-271-18/+202
| | | | | | | | | | | | | | | | | v2: add conversion opcodes. v3 (idr): Rebase on replacemtn of TGSI_OPCODE_I2U64 with TGSI_OPCODE_I2I64. v4 (idr): "cut them down later" => Remove ir_unop_b2u64 and ir_unop_u642b. Handle these with extra i2u or u2i casts just like uint(bool) and bool(uint) conversion is done. v5 (nha): add clarifying comment about a subtle assumption Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: destroy pipe_context before destroying st_context (v2)Marek Olšák2017-01-241-6/+7
| | | | | | | | | | | | | | | | | If radeonsi starts compiling an optimized shader variant asynchronously with a GL debug callback set and the application destroys the GL context, radeonsi crashes when trying to write shader stats into the debug output of a non-existent context after compilation, because st/mesa was destroyed before pipe_context. Firefox with WebGL2 enabled hits this bug. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99456 v2: protect against a double destroy in st_create_context_priv and callers. Cc: 17.0 <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/glsl_to_tgsi: fix compilation warnings since int64 typesSamuel Pitoiset2017-01-241-3/+3
| | | | | | | | | | state_tracker/st_glsl_to_tgsi.cpp:302:28: warning: ‘glsl_to_tgsi_instruction::tex_type’ is too small to hold all values of ‘enum glsl_base_type’ glsl_base_type tex_type:4; Fixes: 8ce53d4a2f3 ("glsl: Add basic ARB_gpu_shader_int64 types") Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/glsl_to_tgsi: use DDIV instead of DRCP + DMULNicolai Hähnle2017-01-231-6/+3
| | | | | | | | | | | | Fixes GL45-CTS.gpu_shader_fp64.built_in_functions. v2: use DDIV unconditionally (Roland) Reviewed-by: Roland Scheidegger <[email protected]> (v1) Reviewed-by: Marek Olšák <[email protected]> (v1) Tested-by: Glenn Kennard <[email protected]> Tested-by: James Harvey <[email protected]> Cc: 17.0 <[email protected]>
* mesa/glsl: set {clip,cull}_distance_array_size directly in gl_programTimothy Arceri2017-01-231-8/+8
| | | | | | | There are some line wrapping violations here but those lines will get deleted in the following patch. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa/glsl: change xfb_program field to last_vert_progTimothy Arceri2017-01-232-4/+11
| | | | | | | | | | Now that the i965 backend doesn't depend on this field we can make it more generic and short circuit a bunch of code paths. The new field will be used in a following patch for another clean-up. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: use gl_program for CurrentProgram rather than gl_shader_programTimothy Arceri2017-01-235-109/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes much more sense and should be more performant in some critical paths such as SSO validation which is called at draw time. Previously the CurrentProgram array could have contained multiple pointers to the same struct which was confusing and we would often need to fish out the information we were really after from the gl_program anyway. Also it was error prone to depend on the _LinkedShader array for programs in current use because a failed linking attempt will lose the infomation about the current program in use which is still valid. V2: fix validate_io() to compare linked_stages rather than the consumer and producer to decide if we are looking at inward facing shader interfaces which don't need validation. Acked-by: Edward O'Callaghan <[email protected]> To avoid build regressions the following 2 patches were squashed in to this commit: mesa/meta: rewrite _mesa_shader_program_use() and _mesa_program_use() These are rewritten to do what the function name suggests, that is _mesa_shader_program_use() sets the use of all stage and _mesa_program_use() sets the use of a single stage. Reviewed-by: Lionel Landwerlin <[email protected]> Acked-by: Edward O'Callaghan <[email protected]> mesa: update active relinked program This likely fixes a subroutine bug were _mesa_shader_program_init_subroutine_defaults() would never have been called for the relinked program as we previously just set _NEW_PROGRAM as dirty and never called the _mesa_use* functions when linking. Acked-by: Edward O'Callaghan <[email protected]>
* glsl: Add basic ARB_gpu_shader_int64 typesDave Airlie2017-01-201-0/+6
| | | | | | | | | | | | | This adds the builtins and the lexer support. To avoid too many warnings, it adds basic support to the type in a few other places in mesa, mostly in the trivial places. It also adds a query to be used later for if a type is an integer 32 or 64. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>