summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
Commit message (Collapse)AuthorAgeFilesLines
* glsl_to_tgsi: skip UARL for 1D registers if the driver doesn't need itMarek Olšák2017-10-062-9/+44
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl_to_tgsi: handle reladdr as TEMP in rename_temp_registers and dead_codeMarek Olšák2017-10-061-16/+44
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl_to_tgsi: each reladdr object should have only one parentMarek Olšák2017-10-062-5/+65
| | | | | | required by rename_temp_registers. Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl_to_tgsi: fix instruction order for bindless texturesMarek Olšák2017-10-061-4/+14
| | | | | | | | | We emitted instructions loading the bindless handle after the memory instruction. Cc: 17.2 <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl_to_tgsi: enable copy propagation for tessellation shadersMarek Olšák2017-10-061-4/+3
| | | | | | just don't propagate output reads Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/st: Drop has_lib_dxtc argument from st_init_extensions()Matt Turner2017-10-024-11/+4
| | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa: Drop Mesa_DXTn from gl_contextMatt Turner2017-10-022-3/+3
| | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* st/mesa: don't use pipe_surface for passing information about EGLImageMarek Olšák2017-10-031-46/+50
| | | | | | | | | | Use st_egl_image instead. radeonsi doesn't like when we create a pipe_surface with PIPE_FORMAT_NV12. This fixes NV12 texturing on radeonsi using kmscube. Cc: 17.1 17.2 <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: use R10G10B10X2 format where applicableNicolai Hähnle2017-10-021-3/+8
| | | | | | | | This is the last step of fixing dEQP-GLES3.functional.fbo.completeness.renderable.texture.color0.rgb_unsigned_int_2_10_10_10_rev for radeonsi. Reviewed-by: Marek Olšák <[email protected]>
* st/glsl_to_tgsi: use LDEXP when availableNicolai Hähnle2017-09-291-3/+7
| | | | | Reviewed-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* st/glsl_to_tgsi: fix conditional assignments to packed shader outputsNicolai Hähnle2017-09-291-1/+9
| | | | | | | | | | | | | | | | Overriding the default (no-op) swizzle is clearly counter-productive, since the whole point is putting the destination register as one of the source operands so that it remains unmodified when the assignment condition is false. Fragment depth and stencil outputs are a special case due to how their source swizzles are manipulated in translate_src when compiling to TGSI. Fixes dEQP-GLES2.functional.shaders.conditionals.if.*_vertex Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* st/glsl_to_tgsi: fix a use-after-free in merge_two_dstsNicolai Hähnle2017-09-291-1/+2
| | | | | | | | | | | | | Found by address sanitizer. The loop here tries to be safe, but in doing so, it ends up doing exactly the wrong thing: the safe foreach is for when the loop variable (inst) could be deleted and nothing else. However, this particular can delete inst's successor, but not inst itself. Fixes: 8c6a0ebaad72 ("st/mesa: add st fp64 support (v7.1)") Reviewed-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* st/mesa: don't call close() on WindowsBrian Paul2017-09-281-0/+2
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: fix infinite loopsTimothy Arceri2017-09-211-1/+1
| | | | | Fixes: 9ac8fece63a9 (glsl: Unify ir_constant::const_elements and ::components) Reviewed-by: Dylan Baker <[email protected]
* glsl: Unify ir_constant::const_elements and ::componentsIan Romanick2017-09-191-1/+2
| | | | | | | | | | There was no reason to treat array types and record types differently. Unifying them saves a bunch of code and saves a few bytes in every ir_constant. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Elie Tournier <[email protected]>
* glsl: Rename ir_constant::array_elements to ::const_elementsIan Romanick2017-09-191-1/+1
| | | | | | | | | | | The next patch will unify ::array_elements and ::components, so the name ::array_elements wouldn't be appropriate. A lot of things use the names array_elements and components, so grepping for either is pretty useless. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Elie Tournier <[email protected]>
* gallium: add PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVENicolai Hähnle2017-09-181-1/+4
| | | | | | | | | | | | | | | | | To be able to properly distinguish between GL_ANY_SAMPLES_PASSED and GL_ANY_SAMPLES_PASSED_CONSERVATIVE. This patch goes through all drivers, having them treat the two query types identically, except: 1. radeon incorrectly enabled conservative mode on PIPE_QUERY_OCCLUSION_PREDICATE. We now do it correctly, only on PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE. 2. st/mesa uses the new query type. Fixes dEQP-GLES31.functional.fbo.no_attachments.* Reviewed-by: Marek Olšák <[email protected]>
* st/glsl_to_tgsi: fix theoretical memory leakNicolai Hähnle2017-09-181-2/+5
| | | | | | | | It can't *really* happen since we don't use subroutines. CID: 1417491 Reviewed-by: Timothy Arceri <[email protected]> Reviewed-By: Gert Wollny <[email protected]>
* mesa/st/tests: Correct build flags and force -std=c++11Gert Wollny2017-09-151-9/+5
| | | | | | | | | | | | Include src/gallium/Automake.inc, correct the build flags accordingly. Force -std=c++11 (extensively used by the test) as otherwise it gets defined only when building against llvm >= 3.9. Fixes: 7be6d8fe12 ("mesa/st: glsl_to_tgsi: add tests for the new temporary lifetime tracker") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102665 Reviewed-by: Emil Velikov <[email protected]> (v1)
* st/mesa: set UseSTD430AsDefaultPacking const based on CAPTimothy Arceri2017-09-151-0/+3
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: add LOAD support for UBOsTimothy Arceri2017-09-151-79/+119
| | | | | | | This will allow us to use STD430 packing by default if the driver supports it. Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: create add_buffer_to_load_and_stores() helperTimothy Arceri2017-09-151-19/+27
| | | | | | Will be used to add LOAD support to UBOs. Reviewed-by: Marek Olšák <[email protected]>
* st/glsl->tgsi: fix u64 to bool comparisons.Dave Airlie2017-09-151-1/+15
| | | | | | | | | | | Otherwise we end up using a 32-bit comparison which didn't end well. Timothy caught this while playing around with some opt passes. Fixes: 278580729a (st/glsl_to_tgsi: add support for 64-bit integers) Reviewed-by: Timothy Arceri <[email protected]> Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/glsl_to_tgsi: remove unused code in temprenameNicolai Hähnle2017-09-131-15/+1
| | | | | Reviewed-By: Gert Wollny <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* st/glsl_to_tgsi: be precise about merging scopesNicolai Hähnle2017-09-131-2/+2
| | | | | | | | | | enclosing_scope already contains enclosing_scope_first_read. What we really want to check here -- not for correctness, but for speed -- is whether last_read_scope already contains enclosing_scope. Reviewed-By: Gert Wollny <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa/st: Include builddir/src/compiler/glsl to fix make checkAaron Watry2017-09-111-0/+1
| | | | | | | | | | | | | | | | | | | | | Otherwise, when doing an out-of-tree build you can expect the following: make[6]: Entering directory \ '${MESA_SRC}/build/src/mesa/state_tracker/tests' CXX test_glsl_to_tgsi_lifetime.o In file included from \ ${MESA_SRC}/src/mesa/src/mesa/state_tracker/st_glsl_to_tgsi_private.h:31:0, from \ ${MESA_SRC}/src/mesa/src/mesa/state_tracker/st_glsl_to_tgsi_temprename.h:27, from \ ${MESA_SRC}/src/mesa/src/mesa/state_tracker/tests/test_glsl_to_tgsi_lifetime.cpp:24: ${MESA_SRC}/src/compiler/glsl/ir.h:1502:37: \ fatal error: ir_expression_operation.h: No such file or directory #include "ir_expression_operation.h" Signed-off-by: Aaron Watry <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Tested-by: Gert Wollny <[email protected]>
* st/glsl_to_tgsi: only the first (inner-most) array reference can be a 2D indexNicolai Hähnle2017-09-111-1/+1
| | | | | | | | | Don't get distracted by record dereferences between array references. Fixes dEQP-GLES31.functional.tessellation.user_defined_io.per_vertex_block.* Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: Fix frontbuffer rendering regressionThomas Hellstrom2017-09-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | This fixes a regression introduced with commit "mesa/st: Reduce the number of frontbuffer flush calls" where we, after flushing the front buffer marked it as not-rendered-to, the idea being that it should be marked as "rendered-to" again as soon as any rendering was touching the front. Now the latter part never happened, because it was part of a state validation and we never marked that part of the state as dirty. So mark the framebuffer state dirty after a frontbuffer flush. (fdo bugzilla 102496) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102496 Fixes: eceb671002 (mesa/st: Reduce the number of frontbuffer flush calls) Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Bruce Cherniak <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]> Tested-by: Bruce Cherniak <[email protected]> Tested-By: Gert Wollny <[email protected]>
* mesa/st/tests: Fix regressions with libunwind enabled introduced with 7be6d8fe12Gert Wollny2017-09-071-0/+1
| | | | | | | | Add the according flags to link with libunwind. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=102565 Tested-by: Michel Dänzer <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: skip draw calls with pipe_draw_info::count == 0Marek Olšák2017-09-071-1/+6
| | | | | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102502 Cc: 17.2 <[email protected]> Tested-by: Alexandre Demers <[email protected]> Tested-by: Dieter Nützel <[email protected]> Acked-by: Timothy Arceri <[email protected]>
* mesa/st/st_glsl_to_tgsi_temprename.cpp: Fix compilation with MSVCGert Wollny2017-09-061-1/+9
| | | | | | | | | | If <windows.h> is included then max is a macro that clashes with std::numeric_limits::max, hence undefine it. For some reason the struct access_record is not recognizes outside the anonymouse namespace, make it a class. The patch successfully was tested on AppVeyor. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/st: glsl_to_tgsi: tie in new temporary register merge approachGert Wollny2017-09-061-50/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces the old register lifetime estiamtion and rename mapping evaluation with the new one. Performance to compare between the current and the new implementation were measured by running the shader-db in one thread. ----------------------------------------------------------- old new(std::sort) ---------------- time ./run -j1 shaders -------------------- real 5.80s 5.75s user 5.75s 5.70s sys 0.05s 0.05s ---- valgrind --tool=callgrind --dump-instr=yes------------ merge 0.08% 0.18% estimate lifetime 0.02% 0.11% evaluate mapping (incl=0.3%) 0.04% apply mapping 0.03% 0.02% --- perf (approximate because of statistic sampling) ---- merge (total) 0.09% 0.16% estimate lifetime 0.03% 0.10% evaluate mapping (incl=0.02%) 0.04% apply mapping 0.04% 0.04% Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/st: glsl_to_tgsi: Add test set for evaluation of rename mappingGert Wollny2017-09-061-0/+169
| | | | | | | The patch adds tests for the register rename mapping evaluation and combined life time estimation and renaming. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/st: glsl_to_tgsi: add register rename mapping evaluatorGert Wollny2017-09-063-5/+137
| | | | | | | | | | | | | | | The remapping evaluator first sorts the temporary registers ascending based on their first life time instruction, and then uses a binary search to find merge canidates. For the initial sorting it uses std::sort because qsort is quite slow in comparison. By removing the define USE_STL_SORT in src/mesa/state_tracker/st_glsl_to_tgsi_temprename.cpp one can enable the alternative code path that uses qsort. Registers that are not written to are not considered for renaming since in glsl_to_tgsi_visitor::renumber_registers they are eliminated anyway. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/st: glsl_to_tgsi: add tests for the new temporary lifetime trackerGert Wollny2017-09-064-3/+1481
| | | | | | This patch adds a set of unit tests for the new lifetime tracker. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/st: glsl_to_tgsi: implement new temporary register lifetime trackerGert Wollny2017-09-062-0/+941
| | | | | | | | | | | | | | | | | | This patch adds a class for tracking the life times of temporary registers in the glsl to tgsi translation. The algorithm runs in three steps: First, in order to minimize the number of needed memory allocations the program is scanned to evaluate the number of scopes. Then, the program is scanned second time to record the important register access time points: first and last reads and writes and their link to the execution scope (loop, if/else branch, switch case). In the third step for each register the actual minimal life time is evaluated. In addition, when compiled in debug mode (i.e. NDEBUG is not defined) the shaders and estimated temporary life times can be logged to stderr by setting the environment variable GLSL_TO_TGSI_RENAME_DEBUG. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/st: glsl_to_tgsi move some helper classes to extra filesGert Wollny2017-09-063-287/+366
| | | | | | | | | | | | | | | | | | | | | | | To prepare the implementation of a temp register lifetime tracker some of the classes are moved into seperate header/implementation files to make them accessible from other files. Specifically these are: class st_src_reg; class st_dst_reg; class glsl_to_tgsi_instruction; struct rename_reg_pair; int swizzle_for_type(const glsl_type *type, int component); as inline: bool is_resource_instruction(unsigned opcode); unsigned num_inst_dst_regs(const glsl_to_tgsi_instruction *op); unsigned num_inst_src_regs(const glsl_to_tgsi_instruction *op); Reviewed-by: Nicolai Hähnle <[email protected]>
* st_glsl_to_tgsi: rewrite rename registers to use array fully.Dave Airlie2017-09-061-29/+26
| | | | | | | | | | Instead of having to search the whole array, just use the whole thing and store a valid bit in there with the rename. Removes this from the profile on some of the fp64 tests Reviewed-by: Timothy Arceri <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* st/glsl_to_tgsi: inline src_register into translate_srcNicolai Hähnle2017-09-041-75/+77
| | | | | | | | | | | src_register has no meaningful standalone use, it only makes sense when called from translate_src. v2: fix input array handling Acked-by: Roland Scheidegger <[email protected]> (v1) Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* st/glsl_to_tgsi: ir_load_ubo always has a second indexNicolai Hähnle2017-09-041-2/+1
| | | | | | Acked-by: Roland Scheidegger <[email protected]> Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* st/drawpixels: always use two-dimensional constant referencesNicolai Hähnle2017-09-041-0/+2
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa: fix view template initialization in try_pbo_readpixelsRoland Scheidegger2017-09-031-1/+1
| | | | | | | | | | | | I think this is what the code was meant to do, albeit as far as I can tell the redundant initialization some analyzers complain about should work as well just fine (only the first layer will be used, if the view contains one or more layers doesn't really matter). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102467 Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Cc: [email protected]
* st/mesa: only try to create 1x msaa surfaces for "fake" msaa driversBrian Paul2017-08-313-14/+24
| | | | | | | | | | | | | | | | | | | | For software drivers where we want "fake" msaa support for GL 3.x, we treat 1 sample as being msaa. For drivers with real msaa support, start format probing at 2x msaa. For drivers with fake msaa support, start format probing at 1x msaa. This also tweaks the MaxSamples code in st_init_extensions() so that we use MaxSamples=1 for fake msaa. This allows the format proble loops to run at least one iteration. This fixes a llvmpipe/VTK regression from commit 6839d3369905eb02151. And for drivers with fake msaa support, calls such as glTexImage2DMultisample(samples=1) will now succeed. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102038 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102125 Reviewed-by: Roland Scheidegger <[email protected]>
* mesa/st: remove unwanted backup fileEric Engestrom2017-08-301-479/+0
| | | | | | | Fixes: 0ac78dc92582a59d4319 "util: move string_to_uint_map to glsl" Cc: Emil Velikov <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* util: move string_to_uint_map to glslEmil Velikov2017-08-292-1/+480
| | | | | | | | | | | | | | | | | | The functionality is used by glsl and mesa. With the latter already depending on the former. With this in place the src/util/ static library libmesautil.la no longer has a C++ dependency. Thus objects which use it (like libEGL) don't need the C++ link. Cc: "17.2" <[email protected]> Fixes: 02cc35937277 ("egl/wayland: Use linux-dmabuf interface for buffers") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101851 Signed-off-by: Emil Velikov <[email protected]> Suggested-by: Jason Ekstrand <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Tested-by: Mike Lothian <[email protected]> Tested-by: James Harvey <[email protected]>
* st/mesa: fix XPD lowering - don't read dstMarek Olšák2017-08-291-3/+6
| | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102461 Reviewed-by: Brian Paul <[email protected]>
* st/mesa: fix handling of vertex array double inputsIlia Mirkin2017-08-281-1/+3
| | | | | | | | | | | | | The is_double_vertex_input needs to be set for arrays of doubles as well. Fixes KHR-GL45.enhanced_layouts.varying_array_locations Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: [email protected]
* mesa: Implement GL_ARB_polygon_offset_clampAdam Jackson2017-08-251-1/+1
| | | | | | | | | | | Semantically identical to the EXT version (whose string is still valid for GLES), so rename the bit but expose both extension strings. (Suggested by Ilia Mirkin and Ian Romanick.) v3: Fix the entrypoint alias in GL4x.xml (Ilia) Signed-off-by: Adam Jackson <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: Implement GL_ARB_texture_filter_anisotropicAdam Jackson2017-08-251-0/+4
| | | | | | | | | | | The only difference from the EXT version is bumping the minmax to 16, so just hit all the drivers at once. v2: Fix driver names, add to 17.3 release notes (Ilia Mirkin) Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Adam Jackson <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: pass shader source keys to the disk cacheTimothy Arceri2017-08-251-1/+1
| | | | | | | We don't actually write them to disk here. That will happen in the following commit. Reviewed-by: Nicolai Hähnle <[email protected]>