summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* st/mesa: remove what is left from u_blitMarek Olšák2013-02-186-29/+0
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: simplify and improve CopyTexSubImageMarek Olšák2013-02-183-260/+99
| | | | | | | | | | | | | | | | | | | | It has become a bit messy. Changes: - finally correct checking for transfer ops depending on the base format - making sure the base internal format and the texture format match (we were ignoring it, but it's important for correctness) - the way-too-strict rule that both src and dst base formats must be the same was dropped; ensuring the simpler and more permissive rule mentioned above is enough - stop using util_blit_pixels; pipe->blit is flexible enough, and now that we have RGBX and red-alpha formats, pipe->blit can be used for more cases Reviewed-by: Brian Paul <[email protected]>
* st/mesa: don't do sRGB conversion in CopyTexSubImageMarek Olšák2013-02-181-2/+2
| | | | | | | | Assuming I understand EXT_texture_sRGB correctly. NOTE: This is a candidate for the stable branches. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: implement blit-based TexImage and TexSubImageMarek Olšák2013-02-183-4/+239
| | | | | | | | | | | | | | | | | | | A temporary texture is created such that it matches the format and type combination and pixels are copied to it using memcpy. Then the blit is used to copy the temporary texture to the texture image being modified by TexImage or TexSubImage. The blit takes care of the format and type conversion and swizzling. The result is a very fast texture upload involving as little CPU as possible. This improves performance in apps which upload textures during rendering. An example is the Wine OpenGL backend for DirectDraw, which I used to test the game StarCraft. Profiling had shown that TexSubImage was taking 50% of CPU time without this patch, which was the main motivation for this work, and now TexSubImage only takes 14% of CPU time. I had to underclock my CPU to see any difference in the game and this patch does make the game a lot faster if the CPU is slow (or using the powersave cpufreq profile). Reviewed-by: Brian Paul <[email protected]>
* st/mesa: fix blit-based GetTexImage for 1D array texturesMarek Olšák2013-02-181-19/+52
| | | | | | | | | | | | | This is not easy to hit, because we have 3 code paths now (tried in this order): - memcpy-based (skips the blit) -> _mesa_tex_getimage - blit-based - slow pixel packing -> _mesa_tex_getimage The main difference later in the code is the parameters of _mesa_image_address3d. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: fix blit-based GetTexImage for depth/stencil formatsMarek Olšák2013-02-181-1/+1
| | | | | | BTW, we have 0 tests for glGetTexImage(format=GL_DEPTH*). Reviewed-by: Brian Paul <[email protected]>
* st/mesa: factor out code for determining blit.mask from CopyTexSubImageMarek Olšák2013-02-181-42/+66
| | | | | | I'll need this later. Reviewed-by: Brian Paul <[email protected]>
* radeonsi: Fix PIPE_FORMAT_X32_S8X24_UINT sampler hardware formatMichel Dänzer2013-02-181-1/+1
| | | | | | 4 more little piglits. NOTE: This is a candidate for the 9.1 branch.
* radeonsi: Use stencil surface level information for stencil texturingMichel Dänzer2013-02-182-7/+10
| | | | | | 7 more little dwarves^W piglits. NOTE: This is a candidate for the 9.1 branch.
* radeonsi: properly implement S8Z24 depth-stencil formatMichel Dänzer2013-02-181-29/+66
| | | | | | | | Based on r600g commit 2b9659c9e627ad03160899b8be04f96307d098eb . Fixes crashes with 4 piglit tests which are now hitting these formats. NOTE: This is a candidate for the 9.1 branch.
* r600g/llvm: Support for TBOVincent Lejeune2013-02-181-0/+28
| | | | Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
* r600g/llvm: Set Inputs/Outputs count to 32 (api reported value)Vincent Lejeune2013-02-181-2/+2
| | | | Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
* r600g/llvm: Fix alpha_to_one piglit testsVincent Lejeune2013-02-183-0/+4
| | | | Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
* r600g/llvm: Add support for UBOVincent Lejeune2013-02-182-1/+22
| | | | | | NOTE: This is a candidate for the Mesa stable branch. Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
* i965: Fix leak in blorp CopyTexSubImage2DChristopher James Halse Rogers2013-02-161-2/+2
| | | | | | | | | | | | | | | _mesa_delete_renderbuffer does not call the driver-specific renderbuffer delete function, so the blorp code was leaking the Intel-specific bits, including some GEM objects. Call the renderbuffer's ->Delete() method instead, which does the right thing. Fixes Unity rapidly sending the machine into the arms of the OOM-killer Note: This is a candidate for the 9.1 branch. Reviewed-by: Eric Anholt <[email protected]>
* gallivm/tgsi: fix issues with sample opcodesRoland Scheidegger2013-02-167-95/+247
| | | | | | | | We need to encode them as Texture instructions since the NumOffsets field is encoded there. However, we don't encode the actual target in there, this is derived from the sampler view src later. Reviewed-by: Jose Fonseca <[email protected]>
* gallivm/tgsi: fix src modifier fetching with non-float types.Roland Scheidegger2013-02-164-5/+54
| | | | | | | | | | | | | | Need to take the type into account. Also, if we want to allow mov's with modifiers we need to pick a type (assume float). v2: don't allow all modifiers on all type, in particular don't allow absolute on non-float types and don't allow negate on unsigned. Also treat UADD as signed (despite the name) since it is used for handling both signed and unsigned integer arguments and otherwise modifiers don't work. Also add tgsi docs clarifying this. Reviewed-by: Jose Fonseca <[email protected]>
* gallivm: fix issues with trunc/round/floor/ceil with no arch roundingRoland Scheidegger2013-02-162-66/+199
| | | | | | | | | | | | | | | | | | | | The emulation of these if there's no rounding instruction available is a bit more complicated than what the code did. In particular, doing fp-to-int/int-to-fp will not work if the exponent is large enough (and with NaNs, Infs). Hence such values need to be filtered out and the original value returned in this case (which fortunately should always be exact). This comes at the expense of performance (if your cpu doesn't support rounding instructions). Furthermore, floor/ifloor/ceil/iceil were affected by precision issues for values near negative (for floor) or positive (for ceil) zero, fix that as well (fixing this issue might not actually be slower except for ceil/iceil if the type is not signed which is probably rare - note iceil has no callers left in any case). Also add some new rounding test values in lp_test_arit to actually test for that stuff (which previously would have failed without sse41). This fixes https://bugs.freedesktop.org/show_bug.cgi?id=59701.
* gallivm: DIV shouldn't be deprecated.Roland Scheidegger2013-02-161-1/+0
| | | | | | (Though it looks glsl won't emit it.) Reviewed-by: Jose Fonseca <[email protected]>
* mesa: Use PROGRAM_ERROR_STRING_ARB instead of the _NV nameMatt Turner2013-02-151-1/+1
| | | | | | | Since NV_fragment_program is now gone. No functional change, since the values are identical. Reviewed-by: Kenneth Graunke <[email protected]>
* trace: add context pointer sanity checkingBrian Paul2013-02-153-0/+23
| | | | | | | To help catch mixed up context pointer bugs in the future, add a trace_context_check() function and some new assertions. Reviewed-by: Jose Fonseca <[email protected]>
* trace: fix incorrect trace_surface::base.context pointerBrian Paul2013-02-153-4/+7
| | | | | | | | | When a trace_surface object is created in trace_surf_create() we weren't correctly setting the surface's context pointer. Instead of it being the trace context, it was the wrapped driver's context. This caused things to blow up sometimes during surface deallocation. Reviewed-by: Jose Fonseca <[email protected]>
* trace: whitespace, comment clean-upsBrian Paul2013-02-151-6/+2
|
* trace: move struct tr_list to tr_texture.hBrian Paul2013-02-152-5/+8
| | | | That's the only place it's used.
* st/mesa: fix format query for GL_ARB_texture_rgBrian Paul2013-02-151-3/+4
| | | | | | | | | | | The GL_ARB_texture_rg spec says that we need to support both texturing and rendering for the GL_RED and GL_RG formats. So move the format check up into the rendertarget_mapping[] list. Also, add PIPE_FORMAT_R8_UNORM to the list of formats required. Note: This is a candidate for the stable branches. Reviewed-by: Marek Olšák <[email protected]>
* i965/fs: Do a general SEND dependency workaround for the original 965.Eric Anholt2013-02-153-42/+229
| | | | | | | | | | | | | We'd been ad-hoc inserting instructions in some SEND messages with no knowledge of when it was required (so extra instructions), but not all SENDs (so not often enough). This should do much better than that, though it's still flow-control-ignorant. v2: Use BRW_MAX_MRF instead of magic numbers. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58960 Reviewed-by: Kenneth Graunke <[email protected]> NOTE: Candidate for the stable branches.
* egl-wayland: Fix left-over wl_display_roundtrip() usageKristian Høgsberg2013-02-141-1/+1
| | | | | We have to use the EGL wayland event queue for roundtrip, so use the wayland_roundtrip() helper, which does just that.
* i965/gen7: Set up all samplers even if samplers are sparsely used.Eric Anholt2013-02-141-1/+1
| | | | | | | | | | | | | | | | | In GLSL, sampler indices are allocated contiguously from 0. But in the case of ARB_fragment_program (and possibly fixed function), an app that uses texture 0 and 2 will use sampler indices 0 and 2, so we were only allocating space for samplers 0 and 1 and setting up sampler 0. We would read garbage for sampler 2, resulting in flickering textures and an angry simulator. Fixes bad rendering in 0 A.D. and ETQW. This was fixed for pre-gen7 by 28f4be9eb91b12a2c6b1db6660cca71a98c486ec Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=25201 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58680 Reviewed-by: Kenneth Graunke <[email protected]> NOTE: This is a candidate for stable branches.
* r600g: add support for red-alpha render targetsMarek Olšák2013-02-142-0/+44
|
* r300g: add support for red-alpha render targetsMarek Olšák2013-02-143-0/+20
|
* st/mesa: try to find exact format matching user format and type for DrawPixelsMarek Olšák2013-02-144-37/+59
| | | | Reviewed-by: Brian Paul <[email protected]>
* r600g: properly implement S8Z24 depth-stencil format for EvergreenMarek Olšák2013-02-143-18/+47
| | | | | | | | | | | | | | | | | | | | I should say "fix", but it has never been used until now. S8Z24 is the format equivalent to the GL_UNSIGNED_INT_24_8 packing, so we'll start to see it more often with st/mesa now making smart decisions about formats. The DB<->CB copy can change the channel ordering for transfers, other than that, the internal DB format doesn't really matter. R600-R700 support is possible except shadow mapping. FMT_24_8 is broken if the SAMPLE_C instruction is used (no idea why). Also the sampler swizzling was broken in theory and the fact it worked was a lucky coincidence. radeonsi might need to port this. Reviewed-by: Jerome Glisse <[email protected]>
* radeonsi: Handle TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFSMichel Dänzer2013-02-141-0/+29
| | | | | | 8 more little piglits. NOTE: This is a candidate for the 9.1 branch.
* radeonsi: Fix array indices for detecting integer vertex formatsMichel Dänzer2013-02-141-2/+2
|
* glsl: Initialize ir_texture member variable.Vinson Lee2013-02-131-2/+2
| | | | | | | Fixes uninitialized pointer field defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Allow blit readpixels even when the pack alignment is set.Eric Anholt2013-02-131-9/+4
| | | | | | | | | | The default alignment is 4, so this fast path was rarely hit. Rather than introduce logic to handle alignment, just use the Mesa core function. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46632 Cc: [email protected] Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Remove writemask support from brw_SAMPLE().Eric Anholt2013-02-135-109/+18
| | | | | | | | | | The code was rather broken for non-XYZW on 8-wide, but all of our callers were using XYZW anyway. For my experiments with using writemask on texturing, I've been using manual header setup in the compiler backends, since we want to actually know what registers are written for optimization and register allocation. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Use a helper function for checking for flow control instructions.Eric Anholt2013-02-133-23/+22
| | | | | | | In 2 of our checks, we were missing BREAK and CONTINUE. NOTE: Candidate for the stable branches. Reviewed-by: Kenneth Graunke <[email protected]>
* shaderapi: Fix AttachShader errorbma2013-02-131-0/+14
| | | | | | | | | | | | | | | Detect a duplicate Shader type as and error instead of silently allowing it, restrict to ES2 API. v2: Tapani Pälli <[email protected]> - make the check run time instead of compile time v3: chadv - Quote spec on which error to generate. Signed-off-by: bma <[email protected]> Signed-off-by: Tapani Pälli <[email protected]> Reviewed-and-tested-by: Chad Versace <[email protected]>
* i965: Re-enable the -RHW workaround for original gen4 chips.Eric Anholt2013-02-131-12/+8
| | | | | | | | Fixes broken clipping in supertuxkart and presumably many other applications. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51471 NOTE: Candidate for the stable branches. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/gen4: Work around missing sRGB RGB DXT1 support.Eric Anholt2013-02-133-4/+20
| | | | | | | | | | | The hardware just doesn't support it. I suspect this was a regression from the move to fixed MESA_FORMATs for compressed textures and that previously we were storing uncompressed for this or something. Fixes GPU hangs in piglit "texwrap GL_EXT_texture_sRGB-s3tc bordercolor swizzled" on my GM965. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Fix error checking on "flat" keyword to match GLSL ES 3.00, GLSL 1.50.Paul Berry2013-02-131-16/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All of the GLSL specs from GLSL 1.30 (and GLSL ES 3.00) onward contain language requiring certain integer variables to be declared with the "flat" keyword, but they differ in exactly *when* the rule is enforced: (a) GLSL 1.30 and 1.40 say that vertex shader outputs having integral type must be declared as "flat". There is no restriction on fragment shader inputs. (b) GLSL 1.50 through 4.30 say that fragment shader inputs having integral type must be declared as "flat". There is no restriction on vertex shader outputs. (c) GLSL ES 3.00 says that both vertex shader outputs and fragment shader inputs having integral type must be declared as "flat". Previously, Mesa's behaviour was consistent with (a). This patch makes it consistent with (b) when compiling desktop shaders, and (c) when compiling ES shaders. Rationale for desktop shaders: once we add geometry shaders, (b) really seems like the right choice, because it requires "flat" in just the situations where it matters. Since we may want to extend geometry shader support back before GLSL 1.50 (via ARB_geometry_shader4), it seems sensible to apply this rule to all GLSL versions. Also, this matches the behaviour of the nVidia proprietary driver for Linux, and the expectations of Intel's oglconform test suite. Rationale for ES shaders: since the behaviour specified in GLSL ES 3.00 matches neither pre-GLSL-1.50 nor post-GLSL-1.50 behaviour, it seems likely that this was a deliberate choice on the part of the GLES folks to be more restrictive. Also, the argument in favor of (b) doesn't apply to GLES, since it doesn't support geometry shaders at all. Some discussion about this has already happened on the Mesa-dev list. See: http://lists.freedesktop.org/archives/mesa-dev/2013-February/034199.html Fixes piglit tests: - glsl-1.30/compiler/interpolation-qualifiers/nonflat-*.frag - glsl-1.30/compiler/interpolation-qualifiers/vs-flat-int-0{2,3,4,5}.vert - glsl-es-3.00/compiler/interpolation-qualifiers/varying-struct-nonflat-{int,uint}.frag Fixes oglconform tests: - glsl-q-inperpol negative.fragin.{int,uint,ivec,uvec} Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* glsl: don't allow non-flat integral types in varying structs/arrays.Paul Berry2013-02-133-6/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the GLSL 1.30 spec, section 4.3.6 ("Outputs") says: "If a vertex output is a signed or unsigned integer or integer vector, then it must be qualified with the interpolation qualifier flat." The GLSL ES 3.00 spec further clarifies, in section 4.3.6 ("Output Variables"): "Vertex shader outputs that are, *or contain*, signed or unsigned integers or integer vectors must be qualified with the interpolation qualifier flat." (Emphasis mine.) The language in the GLSL ES 3.00 spec is clearly correct and should be applied to all shading language versions, since varyings that contain ints can't be interpolated, regardless of which shading language version is in use. (Note that in GLSL 1.50 the restriction is changed to apply to fragment shader inputs rather than vertex shader outputs, to accommodate the fact that in the presence of geometry shaders, vertex shader outputs are not necessarily interpolated. That will be addressed by a future patch). NOTE: This is a candidate for stable branches. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* glsl: Allow default precision qualifiers to be set for sampler types.Paul Berry2013-02-131-3/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | From GLSL ES 3.00 section 4.5.4 ("Default Precision Qualifiers"): "The precision statement precision precision-qualifier type; can be used to establish a default precision qualifier. The type field can be either int or float or any of the sampler types, and the precision-qualifier can be lowp, mediump, or highp." GLSL ES 1.00 has similar language. GLSL 1.30 doesn't allow precision qualifiers on sampler types, but this seems like an oversight (since the intention of including these in GLSL 1.30 is to allow compatibility with ES shaders). Previously, Mesa followed GLSL 1.30 and only allowed default precision qualifiers to be set for float and int. This patch makes it follow GLSL ES rules in all cases. Fixes Piglit tests default-precision-sampler.{vert,frag}. Partially addresses https://bugs.freedesktop.org/show_bug.cgi?id=60737. NOTE: This is a candidate for stable branches. Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: fix texture buffer objectsMarek Olšák2013-02-131-4/+10
| | | | | | Broken by 624528834f53f54c7a934f929769b7e6b230a0b1. Reviewed-by: Brian Paul <[email protected]>
* i965: Use derived state for Haswell's 3DSTATE_VF packet.Kenneth Graunke2013-02-121-2/+2
| | | | | | | | | | | Otherwise, we fail to correctly handle GL_PRIMITIVE_RESTART_FIXED_INDEX. Fixes gles3conform's primitive_restart_mode test. NOTE: This is a candidate for the 9.1 branch. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: accelerate glGetTexImage for all formats using a blitMarek Olšák2013-02-132-49/+152
| | | | | | | | | | This commit allows using glGetTexImage during rendering and still maintain interactive framerates. This improves performance of WarCraft 3 under Wine. The framerate is improved from 25 fps to 39 fps in the main menu, and from 0.5 fps to 32 fps in the game. v2: fix choosing the format for decompression
* gallium: add red-alpha texture formats and a couple of util functionsMarek Olšák2013-02-133-0/+141
| | | | | | | | | This is for glGetTexImage and it will be used for samplers only (which some drivers already implement by reading util_format_description). v2: incorporate Brian's suggestion Reviewed-by: Brian Paul <[email protected]>
* r600g: fix lockup when hyperz & alpha test are enabled together. v3Jerome Glisse2013-02-123-3/+49
| | | | | | | | | | | | Seems that alpha test being enabled confuse the GPU on the order in which it should perform the Z testing. So force the order programmed throught db shader control. v2: Only force z order when alpha test is enabled v3: Update db shader when binding new dsa + spelling fix Signed-off-by: Jerome Glisse <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* CopyTexImage: Don't check sRGB vs LINEAR for desktop GLJordan Justen2013-02-121-18/+10
| | | | | | | | | | | | | | In OpenGL 4.3, new language was added that would require this check. But, if this check results in broken applications then perhaps it will be reversed. For now, remove this check and re-evaluate when desktop GL 4.3 is closer. NOTE: This is a candidate for the 9.1 branch. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>