summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
Commit message (Collapse)AuthorAgeFilesLines
* state_tracker: replace __FUNCTION__ with __func__Marius Predut2015-04-148-18/+18
| | | | | | | | | | | Consistently just use C99's __func__ everywhere. The patch was verified with Microsoft Visual studio 2013 redistributable package(RTM version number: 18.0.21005.1) Next MSVC versions intends to support __func__. No functional changes. Acked-by: Matt Turner <[email protected]> Signed-off-by: Marius Predut <[email protected]>
* st/mesa: align cube map arrays layersDave Airlie2015-04-141-1/+1
| | | | | | | | | | | | | | | | | We create textures internally for texsubimage, and we use the values from sub image to create a new texture, however we don't align these to valid sizes, and cube map arrays must have an array size aligned to 6. This fixes texsubimage cube_map_array on CAYMAN at least, (it was causing GPU hang and bad values), it probably also fixes it on radeonsi and evergreen. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89957 Tested-by: Tom Stellard <[email protected]> Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* st/mesa: convert sub image for cube map arrays to 2d arrays for uploadDave Airlie2015-04-141-0/+5
| | | | | | | | | | | | | | | Since we can subimage upload a number of cube map array layers, that aren't a complete cube map array, we should specify things as a 2D array and blit from that. Suggested by Ilia Mirkin as an alternate fix for texsubimage cube map array issues. seems to work just as well. Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* st/mesa: Remove unused emit_scs().Matt Turner2015-04-061-98/+0
| | | | | | | Was only used by the sin_reduced/cos_reduced cases, which themselves were impossible to reach. Reviewed-by: Jason Ekstrand <[email protected]>
* glsl: Remove never used sin_reduced/cos_reduced.Matt Turner2015-04-061-6/+0
| | | | | | | | These were added in commit f2616e56, presumably in preparation for translating ARB vp/fp into GLSL IR. That never happened, and neither did a lowering pass that actually generated these instructions. Reviewed-by: Jason Ekstrand <[email protected]>
* st/mesa: initialize have_fma in constructorIlia Mirkin2015-03-261-0/+1
| | | | | | | Spotted by Coverity. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: update arrays when the current attrib has been updatedIlia Mirkin2015-03-261-1/+1
| | | | | | | | | | | Fixes the recently-sent gl-2.0-vertex-const-attr piglit test. Makes sure to revalidate arrays when only the current attribute has been updated via glVertexAttrib*. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89754 Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Cc: "10.4 10.5" <[email protected]>
* st_glsl_to_tgsi: only do mov copy propagation on temps (v2)Dave Airlie2015-03-261-0/+1
| | | | | | | | | | | | Don't propagate ARRAYs This should fix: https://bugs.freedesktop.org/show_bug.cgi?id=89759 v2: just specify arrays so we get input propagation Signed-off-by: Dave Airlie <[email protected]> Cc: [email protected] Reviewed-by: Ilia Mirkin <[email protected]>
* st/vdpau: Avoid constness cast warnings.Jose Fonseca2015-03-221-1/+1
| | | | | | | | | Fixes MSVC warning C4090: '=' : different 'const' qualifiers Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Christian König <[email protected]>
* main: Refactor ClearBuffer[Sub]Data.Laura Ekstrand2015-03-171-2/+2
| | | | | | | | v2: review by Jason Ekstrand - Split refactor of clear buffer sub data from addition of DSA entry points. Reviewed-by: Martin Peres <[email protected]>
* gallium: add FMA and DFMA opcodes (v3)Marek Olšák2015-03-161-4/+9
| | | | | | | | | Needed by ARB_gpu_shader5. v2: select DMAD for FMA with double precision v3: add and select DFMA Reviewed-by: Ilia Mirkin <[email protected]>
* st/mesa: drop unused texture functionDave Airlie2015-03-092-50/+0
| | | | | | | This has no users. Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa/st: remove unused TexDataDave Airlie2015-03-092-27/+0
| | | | | | | | | | this isn't hooked up to anything at all from what I can see. Seems like a left over from commit 5d67d4fbebb(st/mesa: remove st_TexImage(), use core Mesa code instead). Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* st/mesa: include stdio.h where neededBrian Paul2015-03-052-0/+2
| | | | | Acked-by: Matt Turner <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* st/mesa: replace Elements() with ARRAY_SIZE()Brian Paul2015-03-0210-45/+45
| | | | Acked-by: Ilia Mirkin <[email protected]>
* st/mesa: replace INLINE with inlineBrian Paul2015-02-2615-37/+37
| | | | Reviewed-by: Alex Deucher <[email protected]>
* st/mesa: remove unused/broken function st_print_shadersMarek Olšák2015-02-242-49/+0
| | | | Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: remove struct qualifier from st_src_reg parameterBrian Paul2015-02-241-1/+1
| | | | It's a class. Silences MSVC warning.
* st/mesa: cleanup st_translate_geometry_programMarek Olšák2015-02-241-102/+30
| | | | | | | | | Mostly dead code or code that didn't do anything. Computing gs_num_outputs at the end was also useless. It's already set correctly. Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: inline st_free_tokensMarek Olšák2015-02-243-17/+3
| | | | Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: cleanup st_geometry_program structureMarek Olšák2015-02-243-74/+36
| | | | | | | It's full of unused variables and variables only used in st_translate_geometry_program. Reviewed-by: Dave Airlie <[email protected]>
* mesa: Use assert() instead of ASSERT wrapper.Matt Turner2015-02-232-7/+7
| | | | Acked-by: Eric Anholt <[email protected]>
* st/mesa: lower DFRACEXP/DLDEXP when they are not supportedIlia Mirkin2015-02-191-0/+3
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: disable lowering of dops to dfrac when dround is availableIlia Mirkin2015-02-191-7/+6
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: add support for new double opcodesIlia Mirkin2015-02-191-1/+5
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* st/mesa: add st fp64 support (v7.1)Dave Airlie2015-02-202-125/+460
| | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support to the state tracker for ARB_gpu_shader_fp64. The details are explained in comments within the code. v2 : add double to int/unsigned conversion v3: handle fp64 consts better v4: use DRSQ v4.1: add d2b v4.2: drop DDIV v5: split out some prep patches. v5.1: add some comments. v5.2: more comments v6: simplify down the double instruction generation loop. v7: Merge Ilia's two cleanup patches. v7.1: minor fixups for Ilia patch + cleanups Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa/st_tgsi_to_glsl: prepare add_constant for fp64Dave Airlie2015-02-201-20/+21
| | | | | | | | This just moves stuff around a little to make the next patch cleaner. Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* st/glsl_to_tgsi: convert dst to an arrayDave Airlie2015-02-201-65/+65
| | | | | | | | This is just prep work for fp64 support where we need an array of 2 dst values. Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* st/mesa: add GSL_TYPE_DOUBLE, new ir_unop_* switch casesBrian Paul2015-02-191-0/+12
| | | | | | | | To silence compiler warnings about unhandled switch cases. v2: move GSL_TYPE_DOUBLE case to the "Invalid type in type_size" section, per Ilia. Reviewed-by: Ilia Mirkin <[email protected]>
* st/mesa: fix sampler view reference counting bug in glDraw/CopyPixelsBrian Paul2015-02-191-6/+9
| | | | | | | | | | | Use pipe_sampler_view_reference() instead of ordinary assignment. Also add a new sanity check assertion. Fixes piglit gl-1.0-drawpixels-color-index test crash. But note that the test still fails. Cc: "10.4, 10.5" <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* st/mesa: don't die for ETC2 formats when no driver supportIlia Mirkin2015-02-191-0/+3
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* st/mesa: pass etc2 textures to driver if supportedIlia Mirkin2015-02-194-11/+40
| | | | | | | If the driver actually supports ETC2, don't decode it in software. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: add ARB_pipeline_statistics_query supportIlia Mirkin2015-02-182-4/+55
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: add interface and state tracker support for GL_AMD_pinned_memoryMarek Olšák2015-02-172-5/+14
| | | | | | v2: add alignment restrictions to docs, fix indentation in headers Reviewed-by: Christian König <[email protected]>
* st/glsl_to_tgsi: fix whitespaceDave Airlie2015-02-171-202/+178
| | | | | | | | | | | | | everytime I open this file in emacs with show trailing whitespace or git add from it my screen flares with red. Just do a general cleanup, makes working on fp64 support not as jarring. I'm not saying this is perfect, its just better than before. Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* st/mesa: treat resource-less xfb buffers as if they weren't thereIlia Mirkin2015-02-141-1/+1
| | | | | | | | | | | | If a transform feedback buffer's size is 0, st_bufferobj_data doesn't end up creating a buffer for it. There's no point in trying to write to such a buffer, so just pretend as if it's not really there. This fixes arb_gpu_shader5-xfb-streams-without-invocations on nvc0. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Cc: "10.4 10.5" <[email protected]>
* st/mesa: Don't use PIPE_USAGE_STREAM for GL_PIXEL_UNPACK_BUFFER_ARBMichel Dänzer2015-02-061-2/+9
| | | | | | | | | | | | | | The latter currently implies CPU read access, so only PIPE_USAGE_STAGING can be expected to be fast. Mesa demos src/tests/streaming_rect on Kaveri (radeonsi): Unpatched: 42 frames in 1.023 seconds = 41.056 FPS Patched: 615 frames in 1.000 seconds = 615.000 FPS Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88658 Cc: "10.3 10.4" <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: mark constant array of swizzles as static constNils Wallménius2015-02-041-1/+1
| | | | | | | This saves about 0.5k in the text section for a gallium driver on amd64. Reviewed-by: Chris Forbes <[email protected]>
* glsl: Improve precision of mod(x,y)Iago Toral Quiroga2015-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, Mesa uses the lowering pass MOD_TO_FRACT to implement mod(x,y) as y * fract(x/y). This implementation has a down side though: it introduces precision errors due to the fract() operation. Even worse, since the result of fract() is multiplied by y, the larger y gets the larger the precision error we produce, so for large enough numbers the precision loss is significant. Some examples on i965: Operation Precision error ----------------------------------------------------- mod(-1.951171875, 1.9980468750) 0.0000000447 mod(121.57, 13.29) 0.0000023842 mod(3769.12, 321.99) 0.0000762939 mod(3769.12, 1321.99) 0.0001220703 mod(-987654.125, 123456.984375) 0.0160663128 mod( 987654.125, 123456.984375) 0.0312500000 This patch replaces the current lowering pass with a different one (MOD_TO_FLOOR) that follows the recommended implementation in the GLSL man pages: mod(x,y) = x - y * floor(x/y) This implementation eliminates the precision errors at the expense of an additional add instruction on some systems. On systems that can do negate with multiply-add in a single operation this new implementation would come at no additional cost. v2 (Ian Romanick) - Do not clone operands because when they are expressions we would be duplicating them and that can lead to suboptimal code. Fixes the following 16 dEQP tests: dEQP-GLES3.functional.shaders.builtin_functions.precision.mod.mediump_* dEQP-GLES3.functional.shaders.builtin_functions.precision.mod.highp_* Reviewed-by: Ian Romanick <[email protected]>
* st/mesa: add EXT_polygon_offset_clamp supportIlia Mirkin2015-02-022-0/+2
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Glenn Kennard <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* DD: Refactor BlitFramebuffer.Laura Ekstrand2015-02-021-3/+3
| | | | | | | | | In preparation for glBlitNamedFramebuffer, the DD table function BlitFramebuffer needs to accept two arbitrary framebuffer objects rather than assuming ctx->ReadBuffer and ctx->DrawBuffer. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add assert to check number of vector elementsJan Vesely2015-01-211-0/+1
| | | | | | | | The below code crashes when vector_elements <= 0 Fixes Warray-bounds warnings Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* mesa: Fix some signed-unsigned comparison warningsJan Vesely2015-01-219-12/+14
| | | | | | | | v2: s/unsigned int/unsigned/ in prog_optimize.c Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: don't set vs.key.clamp_color if a shader doesn't write any colorsMarek Olšák2015-01-193-5/+10
| | | | And update some comments.
* mesa: rename RGBA8888_* format constants to something appropriate.Iago Toral Quiroga2015-01-141-2/+2
| | | | | | | | The 8888 suggests 8-bit components which is not correct, so replace that with the actual size of the components in each format. Reviewed-by: Jason Ekstrand <[email protected]>
* st/mesa: Use _mesa_format_convert to implement st_GetTexImage.Iago Toral Quiroga2015-01-121-4/+13
| | | | | | | Instead of using _mesa_pack_rgba_span_float. This should allow us to remove that function in a later patch. Reviewed-by: Jason Ekstrand <[email protected]>
* state_tracker: Fix assertion failures in conditional block movs.Eric Anholt2015-01-101-31/+26
| | | | | | | | | | | | | If you had a conditional assignment of an array or struct (say, from the if-lowering pass), we'd try doing swizzle_for_size() on the aggregate type, and it would assertion fail due to vector_elements==0. Instead, extend emit_block_mov() to handle emitting the conditional operations, which also means we'll have appropriate writemasks/swizzles on the CMPs within a struct containing various-sized members. Fixes 20 testcases in es3conform on vc4. Reviewed-by: Jose Fonseca <[email protected]>
* main: Renamed _mesa_get_compressed_teximage to _mesa_GetCompressedTexImage_sw.Laura Ekstrand2015-01-081-1/+1
| | | | | | | | This reflects the new naming convention for software fallbacks. To avoid confusion with ARB_DIRECT_STATE_ACCESS backend functions, software fallbacks now have the form _mesa_[Driver function name]_sw. Reviewed-by: Anuj Phogat <[email protected]>
* main: Renamed _mesa_get_teximage to _mesa_GetTexImage_sw.Laura Ekstrand2015-01-081-5/+5
| | | | | | | | This reflects the new naming convention for software fallbacks. To avoid confusion with ARB_DIRECT_STATE_ACCESS backend functions, software fallbacks now have the form _mesa_[Driver function name]_sw. Reviewed-by: Anuj Phogat <[email protected]>
* st/mesa: fix GL_PRIMITIVE_RESTART_FIXED_INDEXMarek Olšák2015-01-071-1/+2
| | | | | Cc: 10.2 10.3 10.4 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>