summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
Commit message (Collapse)AuthorAgeFilesLines
* st_cb_bitmap: check NULL return from u_upload_allocJulien Isorce2017-03-281-0/+6
| | | | | | Signed-off-by: Julien Isorce <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: move duplicated st_ws_framebuffer() function into header fileBrian Paul2017-03-273-28/+18
| | | | Reviewed-by: Marek Olšák <[email protected]>
* glsl, st/shader_cache: check the whole sha1 for zeroGrazvydas Ignotas2017-03-271-1/+2
| | | | | | | | | | | | The checks were only looking at the first byte, while the intention seems to be to check if the whole sha1 is zero. This prevented all shaders with first byte zero in their sha1 from being saved. This shaves around a second from Deus Ex load time on a hot cache. Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* glsl_to_tgsi: don't rely on glsl types when visiting tex instructionsSamuel Pitoiset2017-03-241-7/+6
| | | | | | | Instead add is_cube_shadow like is_cube_array. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/glsl_to_tgsi: enable lower_sqrt() conditionallySamuel Pitoiset2017-03-221-0/+1
| | | | | | | It relies on the force_glsl_abs_sqrt driconf option. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* driconf: add force_glsl_abs_sqrt optionSamuel Pitoiset2017-03-221-0/+2
| | | | | | | | | This will allow to force computing the absolute value for sqrt() and inversesqrt() in order to follow D3D9 behaviour for buggy apps that rely on it. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* util/disk_cache: use a helper to compute cache keysGrazvydas Ignotas2017-03-211-6/+6
| | | | | | | | | | This will allow to hash additional data into the cache keys or even change the hashing algorithm easily, should we decide to do so. v2: don't try to compute key (and crash) if cache is disabled Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa: set result writemask based on ir typeIlia Mirkin2017-03-181-0/+1
| | | | | | | | | | This prevents textureQueryLevels, which maps as LODQ, from ending up with a xyzw writemask, which is illegal. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100061 Signed-off-by: Ilia Mirkin <[email protected]> Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]>
* 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]>