summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
Commit message (Collapse)AuthorAgeFilesLines
* mesa/st: fix yuv EGLImage'sRob Clark2017-05-161-2/+30
| | | | | | | | | | | | Don't reject YUV formats that the driver doesn't handle natively, since mesa/st already knows how to lower this in shader. Reported-by: Nicolas Dechesne <[email protected]> Fixes: 83e9de2 ("st/mesa: EGLImageTarget* error handling") Cc: 17.1 <[email protected] Signed-off-by: Rob Clark <[email protected]> Tested-by: Nicolas Dechesne <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium: add flag PIPE_CONTEXT_PREFER_THREADEDMarek Olšák2017-05-151-1/+1
| | | | | | | | State trackers can set this to tell the driver when u_threaded_context is desirable. Reviewed-by: Nicolai Hähnle <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* st/mesa: move the logic of all_varyings_in_vbos into st_update_arrayMarek Olšák2017-05-103-25/+12
| | | | | | | | | | The function was pretty slow. This brings a substantial decrease in draw call overhead when min/max index bounds are not needed: Before: DrawElements (1 VBO) w/ no state change: 5.75 million After: DrawElements (1 VBO) w/ no state change: 7.03 million Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: unify common code in st_draw_vbo functionsMarek Olšák2017-05-101-27/+21
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: make st_draw_vbo staticMarek Olšák2017-05-103-14/+2
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: upload zero-stride vertex attributes hereMarek Olšák2017-05-103-16/+48
| | | | | | | | | | | This is the best place to do it. Now drivers without u_vbuf don't have to do it. v2: use correct upload size and optimal alignment Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: simplify the signature of get_client_arrayMarek Olšák2017-05-101-10/+8
| | | | | | Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: remove vpv->num_inputs dereferences in st_update_arrayMarek Olšák2017-05-101-20/+20
| | | | | | Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: fold error handling into setup_(non_)interleaved_attribsMarek Olšák2017-05-101-18/+10
| | | | | | Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: fold cso calls into setup_(non_)interleaved_attribsMarek Olšák2017-05-101-46/+45
| | | | | | Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: don't call util_draw_init_info in st_draw_vboMarek Olšák2017-05-101-2/+8
|
* gallium: remove pipe_index_buffer and set_index_bufferMarek Olšák2017-05-102-57/+40
| | | | | | | | | | | | | | pipe_draw_info::indexed is replaced with index_size. index_size == 0 means non-indexed. Instead of pipe_index_buffer::offset, pipe_draw_info::start is used. For indexed indirect draws, pipe_draw_info::start is added to the indirect start. This is the only case when "start" affects indirect draws. pipe_draw_info::index is a union. Use either index::resource or index::user depending on the value of pipe_draw_info::has_user_indices. v2: fixes for nine, svga
* gallium: separate indirect stuff from pipe_draw_info - 80 -> 56 bytesMarek Olšák2017-05-101-8/+11
| | | | For faster initialization of non-indirect draws.
* gallium: decrease the size of pipe_vertex_buffer - 24 -> 16 bytesMarek Olšák2017-05-105-30/+28
|
* st/glsl_to_tgsi: make sure resource file for samplers is PROGRAM_SAMPLERSamuel Pitoiset2017-05-101-9/+9
| | | | | | | | Similar to how image resources are handled. That way we are sure that inst->resource.file is PROGRAM_SAMPLER for "bound" samplers. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: remove never used gl_shader_compiler_options::EmitNoFunctionsSamuel Pitoiset2017-05-101-1/+0
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Elie Tournier <[email protected]>
* st/mesa: remove unused st parameter in init_velement_loweredMarek Olšák2017-05-081-4/+3
| | | | | | Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: use PIPE_MAX_ATTRIBS as the max number of vertex buffersMarek Olšák2017-05-081-1/+1
| | | | | | Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: simplify code due to unification to st_common_programMarek Olšák2017-05-084-99/+35
| | | | | | | | v2: use the st_common_program() helper Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: simplify update_constants functionsMarek Olšák2017-05-084-38/+17
| | | | | Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: unify TCS, TES, GS st_*_program structuresMarek Olšák2017-05-0810-160/+94
| | | | | | Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: decrease the size of remaining st_translate_program array paramsMarek Olšák2017-05-087-11/+11
| | | | | | Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: remove unused outputSlotToAttrMarek Olšák2017-05-083-11/+0
| | | | | | Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: remove st_context::vertex_result_to_slotMarek Olšák2017-05-084-8/+4
| | | | | | Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: decrease the size of st_vertex_programMarek Olšák2017-05-0810-36/+36
| | | | | Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: remove struct st_tracked_stateMarek Olšák2017-05-0822-398/+118
| | | | | | | | | It contains only one member: the update function. Let's use the update function directly. Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/glsl_to_tgsi: don't use rzalloc_array() when it's unnecessarySamuel Pitoiset2017-05-081-6/+6
| | | | | | | | When the arrays are initialized later on with -1, that's useless to use rzalloc_array(). Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa: stop calling _mesa_init_buffer_object_functions()Timothy Arceri2017-05-071-3/+0
| | | | | | | After calling this we were then overriding all the functions with st versions. Reviewed-by: Eric Anholt <[email protected]>
* glsl: add ARB_bindless_texture operationsSamuel Pitoiset2017-05-061-0/+5
| | | | | | | | For the explicit pack/unpack conversions. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/glsl_to_tgsi: fix renumber_registers() in presence of dead codeSamuel Pitoiset2017-05-051-5/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The TGSI DCE pass doesn't eliminate dead assignments like MOV TEMP[0], TEMP[1] in presence of loops because it assumes that the visitor doesn't emit dead code. This assumption is actually wrong and this situation happens. However, it appears that the merge_registers() pass accidentally takes care of this for some weird reasons. But since this pass has been disabled for RadeonSI and Nouveau, the renumber_registers() pass which is called *after*, can't do its job correctly. This is because it assumes that no dead code is present. But if there is still a dead assignment, it might re-use the TEMP register id incorrectly and emits wrong code. This patches fixes the issue by recording writes instead of reads, and this has the advantage to be faster. This should fix Unigine Heaven on RadeonSI and Nouveau. shader-db results with RadeonSI: 47109 shaders in 29632 tests Totals: SGPRS: 1923308 -> 1923316 (0.00 %) VGPRS: 1133843 -> 1133847 (0.00 %) Spilled SGPRs: 2516 -> 2518 (0.08 %) Spilled VGPRs: 65 -> 65 (0.00 %) Private memory VGPRs: 1184 -> 1184 (0.00 %) Scratch size: 1308 -> 1308 (0.00 %) dwords per thread Code Size: 60095968 -> 60096256 (0.00 %) bytes LDS: 1077 -> 1077 (0.00 %) blocks Max Waves: 431889 -> 431889 (0.00 %) Wait states: 0 -> 0 (0.00 %) It's still interesting to disable the merge_registers() pass. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/st: compute support for glsl_to_nirRob Clark2017-05-044-1/+32
| | | | | Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glsl: rename image_* qualifiers to memory_*Samuel Pitoiset2017-05-041-3/+3
| | | | | | | | | It doesn't make sense to prefix them with 'image' because they are called "Memory Qualifiers" and they can be applied to members of storage buffer blocks. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Andres Gomez <[email protected]>
* st/glsl_to_tgsi: remove unrequired tgsi_get_opcode_info() callTimothy Arceri2017-05-041-1/+1
| | | | | | | This is already set for the instruction at initialisation. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: use min_index and max_index directly from vboMarek Olšák2017-04-281-7/+2
| | | | | | also remove the incorrect comment about primitive restart. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: add more fallback gallium formats for GL integer formatsBrian Paul2017-04-281-25/+25
| | | | | | | | | | | | | | | The VMware driver has a limited set of integer texture formats. We often have to fall back to 4-component formats when 1- or 2-component formats are missing. This fixes about 8 integer texture Piglit tests with the VMware driver on Linux. We've had this code in-house for a long time but I guess it was never up-streamed to Mesa master. This shouldn't regress any other drivers since we're either choosing an earlier format in the list, or failing anyway. Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: whitespace clean-ups in st_manager.cBrian Paul2017-04-281-7/+8
| | | | Trivial.
* st/mesa: remove redundant stfb->iface checksNicolai Hähnle2017-04-282-9/+2
| | | | | | | | | | stfb->iface is always non-NULL for an st_framebuffer. These checks were incorrect, relying on out-of-bounds memory access in the surface-less case of EGL_KHR_surfaceless_context. v2: remove redundant stread check (Marek) Reviewed-by: Marek Olšák <marek@[email protected]> (v2)
* st/mesa: don't cast the incomplete framebufer to st_framebufferNicolai Hähnle2017-04-282-2/+4
| | | | | | | | | | | | | | | | | | | The incomplete framebuffer is set for a surfaceless context. This leads to the following error in piglit spec@egl_khr_surfaceless_context@viewport: ==26703==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f6886e43240 at pc 0x7f68854db0fd bp 0x7ffca404b3b0 sp 0x7ffca404b3a0 READ of size 8 at 0x7f6886e43240 thread T0 #0 0x7f68854db0fc in st_viewport ../../../mesa-src/src/mesa/state_tracker/st_cb_viewport.c:57 #1 0x556840176cdb in main tests/egl/spec/egl_khr_surfaceless_context/viewport.c:101 #2 0x7f688edcf3f0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x203f0) #3 0x556840176e19 in _start (/home/nha/amd/piglit/bin/egl-surfaceless-context-viewport+0xe19) 0x7f6886e43240 is located 32 bytes to the left of global variable 'DummyRenderbuffer' defined in '../../../mesa-src/src/mesa/main/fbobject.c:69:31' (0x7f6886e43260) of size 112 0x7f6886e43240 is located 8 bytes to the right of global variable 'IncompleteFramebuffer' defined in '../../../mesa-src/src/mesa/main/fbobject.c:73:30' (0x7f6886e42de0) of size 1112 SUMMARY: AddressSanitizer: global-buffer-overflow ../../../mesa-src/src/mesa/state_tracker/st_cb_viewport.c:57 in st_viewport Cc: [email protected] Reviewed-by: Marek Olšák <marek@[email protected]>
* st/glsl_to_tgsi: make undef_src and undef_dst constNicolai Hähnle2017-04-281-2/+2
|
* st/glsl_to_tgsi: cleanup using visit_generic_intrinsicNicolai Hähnle2017-04-281-8/+2
| | | | | It turns out that explicitly setting the writemask isn't actually needed; emit_asm does the right thing based on looking at the types.
* glsl: remove the shader_group_vote and shader_ballot expression opsNicolai Hähnle2017-04-281-18/+0
| | | | They are now no longer used.
* st/glsl_to_tgsi: implement shader_group_vote and shader_ballot intrinsicsNicolai Hähnle2017-04-281-0/+36
| | | | | Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* glsl: add intrinsics for ARB_shader_group_vote and ARB_shader_ballotNicolai Hähnle2017-04-281-0/+6
| | | | | | | | | | These operations are currently implemented as IR expressions. However, they cannot be transformed and moved in the way that other IR expressions can because they have non-trivial interactions with control-flow. Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: minor clean-ups in st_update_renderbuffer_surface()Brian Paul2017-04-261-9/+8
| | | | | | | | Remove unneeded parens. Add const qualifiers. Move var decls closer to where they're used. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Neha Bhende<[email protected]>
* st/glsl_to_tgsi: disable the merge registers pass conditionallySamuel Pitoiset2017-04-261-1/+6
| | | | | | | | | | | | | | | | | | | | | The main goal of this pass to merge temporary registers in order to reduce the total number of registers and also to produce optimal TGSI code. In fact, compilers seem to be confused when temporary variables are already merged, maybe because it's done too early in the process. Skipping the pass, reduce both the register pressure and the code size, at least for Nouveau and RadeonSI because they have a real backend compiler. Found by luck while fixing an issue in the TGSI dead code elimination pass which affects tex instructions with bindless samplers. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: replace _mesa_index_buffer::type with index_sizeMarek Olšák2017-04-222-11/+9
| | | | | | | This avoids repeated translations of the enum. Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: make use of glsl_type::is_double()Samuel Pitoiset2017-04-211-1/+1
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* glsl: make use of glsl_type::is_boolean()Samuel Pitoiset2017-04-211-1/+1
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* glsl: make use of glsl_type::is_record()Samuel Pitoiset2017-04-211-2/+2
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* glsl: make use of glsl_type::is_array()Samuel Pitoiset2017-04-211-1/+1
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>