aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
Commit message (Collapse)AuthorAgeFilesLines
* gallium: add red-alpha texture formats and a couple of util functionsMarek Olšák2013-02-132-0/+129
| | | | | | | | | 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]>
* gallium: fix tgsi SAMPLE_L opcode to use separate source for explicit lodRoland Scheidegger2013-02-125-9/+5
| | | | | | | | | | | | | | | | | | | | | It looks like using coord.w as explicit lod value is a mistake, most likely because some dx10 docs had it specified that way. Seems this was changed though: http://msdn.microsoft.com/en-us/library/windows/desktop/hh447229%28v=vs.85%29.aspx - let's just hope it doesn't depend on runtime build version or something. Not only would this need translation (so go against the stated goal these opcodes should be close to dx10 semantics) but it would prevent usage of this opcode with cube arrays, which is apparently possible: http://msdn.microsoft.com/en-us/library/windows/desktop/bb509699%28v=vs.85%29.aspx (Note not only does this show cube arrays using explicit lod, but also the confusion with this opcode: it lists an explicit lod parameter value, but then states last component of location is used as lod). (For "true" hw drivers, only nv50 had code to handle it, and it appears the code was already right for the new semantics, though fix up the seemingly wrong c/d arguments while there.) v2: fix comment, separate out other changes. Reviewed-by: Jose Fonseca <[email protected]>
* util: fix incorrect Z bit masking in util_clear_depth_stencil()Brian Paul2013-02-121-2/+2
| | | | | | | | | | | | | For PIPE_FORMAT_Z24_UNORM_S8_UINT, the Z bits are in the 24 least significant bits. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=60527 and http://bugs.freedesktop.org/show_bug.cgi?id=60524 and http://bugs.freedesktop.org/show_bug.cgi?id=60047 Note: This is a candidate for the stable branches. Reviewed-by: Jose Fonseca <[email protected]>
* llvmpipe: fix vertex_header mask store in big-endianAdhemerval Zanella2013-02-111-0/+48
| | | | | | | This patch fixes the vertex_header mask bitfield store in big-endian architectures by bit-swap the fields accordingly. Reviewed-by: Adam Jackson <[email protected]>
* softpipe: clean up lod computationRoland Scheidegger2013-02-082-54/+50
| | | | | | | | | | | | | | | This should handle the new lod_zero modifier more correctly. The runtime-conditional is a bit more complex however we now also do scalar lod computation when appropriate which should more than make up for it. The refactoring should also fix an issue with explicit lods (lod clamp wasn't applied to them). Also, always pass lod as the 5th element from tgsi executor, which simplifies things (get rid of annoying conditionals later). v2: based on Brian's feedback, use switch in a couple of places, fix up some function parameter names, fix up comments. Reviewed-by: Brian Paul <[email protected]>
* softpipe: try to beat new dx10-style sample opcodes into shapeRoland Scheidegger2013-02-081-67/+89
| | | | | | | | | | | | | | | | | | | | | | There were several bugs how this was handled, most opcodes wouldn't even have fetched the right arguments. Also, the tex "target" is coming from the sampler view, hence it cannot have information about shadow comparisons - fortunately this is not only sampler state but also needs to have matching instruction, so just use this instead to identify shadow comparisons. Still untested (compiles...). Note that sample_i and sviewinfo are still busted (just assert). (The problem is that the interface for doing the opengl-equivalent functions txf and txq is tied to the specific the sampler itself but these opcodes have no sampler associated with them. Oops...) Also, even the other sample instructions will not work correctly since they always operate on samplers which include the texture state. Fixing this wouldn't be that difficult but most likely make softpipe quite a bit slower when using the OpenGL tex opcodes (as the samplers have pre-baked function calls in the sampler state depending on texture state and that stuff would need to be evaluated at runtime), so leave it for now. Reviewed-by: Jose Fonseca <[email protected]>
* gallivm: fix up size queries for dx10 sviewinfo opcodeRoland Scheidegger2013-02-086-74/+64
| | | | | | | | | | | | | | | Need to calculate the number of mip levels (if it would be worthwile could store it in dynamic state). While here, the query code also used chan 2 for the lod value. This worked with mesa state tracker but it seems safer to use chan 0. Still passes piglit textureSize (with some handwaving), though the non-GL parts are (largely) untested. v2: clarify and expect the sviewinfo opcode to return ints, not floats, just like the OpenGL textureSize (dx10 supports dst modifiers with resinfo). Also simplify some code. Reviewed-by: Jose Fonseca <[email protected]>
* gallivm: hook up dx10 sampling opcodesRoland Scheidegger2013-02-083-6/+419
| | | | | | | | | They are similar to old-style tex opcodes but with separate sampler and texture units (and other arguments in different places). Also adjust the debug tgsi dump code. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* gallivm: fix typo in lp_build_mul_normRoland Scheidegger2013-02-081-1/+1
| | | | | | | | The signed case didn't do what the comment indicated. Should increase rounding precision (at the expense of performance since the former code was effectively a no-op). Reviewed-by: Jose Fonseca <[email protected]>
* gallium: add RGBX formats for existing GL RGB texture formatsMarek Olšák2013-02-072-0/+22
| | | | Reviewed-by: Brian Paul <[email protected]>
* gallium/util: remove duplicated function util_format_is_rgb_no_alphaMarek Olšák2013-02-062-32/+5
| | | | | | It only checks if alpha is present, so it's the same as util_format_has_alpha. Reviewed-by: Brian Paul <[email protected]>
* gallivm: implement support for SQRT opcodeBrian Paul2013-02-043-0/+37
|
* tgsi: add support for new SQRT opcodeBrian Paul2013-02-044-1/+18
|
* draw: fix draw_llvm_variant_key struct padding to avoid recompilesRoland Scheidegger2013-01-293-4/+11
| | | | | | | | | | | | | | The struct padding got broken by c789b981b244333cfc903bcd1e2fefc010500013. This caused serious performance regression because part of the key was uninitialized and hence the shader always recompiled (at least on release builds...). While here also fix key size calculation when the number of samplers and the number of sampler views are different. v2: add comment Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallivm,draw,llvmpipe: mass rename of unit->texture_unit/sampler_unitRoland Scheidegger2013-01-286-79/+79
| | | | | | | | | | | Make it obvious what "unit" this is (no change in functionality). draw still uses "unit" in places where it changes the shader by adding texture sampling itself - it seems like this can't work with shaders using dx10-style sample opcodes (can't mix gl-style and dx10-style sample instructions in a shader). Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* gallivm: split sampler and texture stateRoland Scheidegger2013-01-2811-273/+484
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Split the sampler interface to use separate sampler and texture (sampler_view) state. This is needed to support dx10-style sampling instructions. This is not quite complete since both draw/llvmpipe don't really track textures/samplers independently yet, as well as the gallivm code not quite using the right sampler or texture index respectively (but it should work for the sampling codes used by opengl). We are however losing some optimizations in the process, apply_max_lod will no longer work, and we potentially could end up with more (unnecessary) recompiles (if switching textures with/without mipmaps only so it shouldn't be too bad). v2: don't use different callback structs for sampler/sampler view functions (which just complicates things), fix up sampling code to actually use the right texture or sampler index, and similar for llvmpipe/draw actually distinguish between samplers and sampler views. v3: fix more of PIPE_MAX_SAMPLER / PIPE_MAX_SHADER_SAMPLER_VIEWS mismatches (both in draw and llvmpipe), based on feedback from José get rid of unneeded static sampler derived state.(which also fixes the only 2 piglit regressions due to a forgotten assignment), fix comments based on Brian's feedback. v4: remove some accidental unrelated whitespace changes Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/u_upload_mgr: fix a serious memory leakMarek Olšák2013-01-281-2/+1
| | | | It can eat all memory and crash in a matter of minutes with r600g.
* util: add new error checking code in vbuf helperBrian Paul2013-01-251-27/+49
| | | | | | | | | | | Check the return value of calls to u_upload_alloc() and u_upload_data() and return early if needed. Since we don't have a way to propagate errors all the way up to Mesa through pipe_context::draw_vbo(), call debug_warn_once() so the user might have some clue about OOM errors. Note: This is a candidate for the 9.0 branch.
* util: add some defensive coding in u_upload_alloc()Brian Paul2013-01-251-1/+7
| | | | | | | | | | | | | | Some callers of this function were checking the 'ptr' result to see if the function failed. But the correct way is to check the regular return value for PIPE_ERROR_x. Now we initialize all the returned values at the top of the function in case we do hit an error (like OOM). Callers are more likely to detect OOM conditions now. But there are some callers which don't do any error checking... Note: This is a candidate for the 9.0 branch. Reviewed-by: Jose Fonseca <[email protected]>
* util: silence MSVC signed/unsigned comparison warningsBrian Paul2013-01-251-4/+4
| | | | Reviewed-by: José Fonseca <[email protected]>
* util: silence MSVC double->float conversion warningsBrian Paul2013-01-251-2/+2
| | | | Reviewed-by: José Fonseca <[email protected]>
* util: silence MSVC signed/unsigned warnings in debug_get_flags_option()Brian Paul2013-01-251-1/+1
| | | | Reviewed-by: José Fonseca <[email protected]>
* Revert "Revert "targets/opencl: Link against libgallium.la instead of ↵Tom Stellard2013-01-241-6/+0
| | | | | | | | | libgallium.a"" This reverts commit 7824ab807050c03c6df01c44774914dcbef88248. Now that we force linking with LLVM shared libs when building clover, we can link against libgallium.la with no problems.
* draw: fix MSVC divide-by-zero compilation errorBrian Paul2013-01-221-1/+2
| | | | Kind of lame, but it works.
* draw: fix problem in screen-space interpolation clip codeBrian Paul2013-01-221-3/+3
| | | | | | | | | | | | | | | | | | I don't see how this could have ever worked right. The screen-space interpolation code uses the vertex->data[pos_attr] position which contain window coords. But window coords are only computed for the unclipped vertices; the clipped vertices have undefined window coords (see draw_cliptest_tmp.h). Use the vertex clip coords instead which are always defined. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=55476 (piglit fbo-blit-stretch failure on softpipe) Note: This is a candidate for the 9.0 branch. Reviewed-by: José Fonseca <[email protected]>
* draw: improve the clipper debug/printf codeBrian Paul2013-01-221-1/+20
| | | | Reviewed-by: José Fonseca <[email protected]>
* draw: add new debug code and comments in clip code templateBrian Paul2013-01-221-0/+15
| | | | | | | | In debug builds, set clipped vertex window coordinates to NaN values to help debugging. Otherwise, we're just leaving the coordinate in clip space and it's invalid to use it later expecting it to be a window coord. Reviewed-by: José Fonseca <[email protected]>
* vl: round next_msc to integer frame, and kill skew_mscMaarten Lankhorst2013-01-211-5/+2
| | | | | | | | This reduces jitter slightly in a cleaner way, without desynchronizing mplayer2 as badly when falling behind. Signed-off-by: Maarten Lankhorst <[email protected]> Reviewed-by: Christian König <[email protected]>
* gallium: Remove ppc asm backendAdam Jackson2013-01-207-3077/+0
| | | | | | | | | | | | | | | | | | | | | The vs part hasn't been wired up since tgsi_sse2 was disabled in: commit 4eb3225b38ce12cb34ab3d90804c9683bd7b4ed3 Author: José Fonseca <[email protected]> Date: Tue Nov 8 00:10:47 2011 +0000 Remove tgsi_sse2. And it would certainly not work correctly in its current state: draw/draw_vs_ppc.c: In function ‘draw_create_vs_ppc’: draw/draw_vs_ppc.c:190:24: warning: assignment from incompatible pointer type [enabled by default] As with the sse2 backend, this should be done in llvm anyway. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Adam Jackson <[email protected]>
* vl/video_buffer: fix up surface ordering for the interlaced caseMaarten Lankhorst2013-01-161-6/+6
| | | | | | | | It seems the other code expects surface[0..1] to be the luma field in interlaced case. See for example vdpau/surface.c vlVdpVideoSurfaceClear and vlVdpVideoSurfacePutBitsYCbCr. Signed-off-by: Maarten Lankhorst <[email protected]>
* vl/compositor: fix weave shader bugsMaarten Lankhorst2013-01-161-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Writemask was XY instead of YZ (thanks to calim for spotting it). The pixel calculation resulted in the pixel always being off by one. If y was .5: y' = round(y) + 0.5 = 1.5 Fixing this also means the LRP function has to swap the pixels it, since it's now the other way around for top/bottom. WIth these fixes only chroma for top and bottom pixel rows are wrongly interpolated in my test program: --- nvidia +++ nouveau @@ -1,4 +1,4 @@ -YCbCr[0] = 00c080 +YCbCr[0] = 00b070 YCbCr[1] = 00b070 YCbCr[2] = 029050 YCbCr[3] = 207050 @@ -61,4 +61,4 @@ YCbCr[60] = 0c5070 YCbCr[61] = c05090 YCbCr[62] = 0e70b0 -YCbCr[63] = e080c0 +YCbCr[63] = e070b0 Signed-off-by: Maarten Lankhorst <[email protected]> Reviewed-by: Christian König <[email protected]>
* gallium/util: add a half float array to util_colorMarek Olšák2013-01-151-0/+1
| | | | For convenient packing into half floats.
* Revert "targets/opencl: Link against libgallium.la instead of libgallium.a"Tom Stellard2013-01-151-0/+6
| | | | | | | | | | | | | | | This reverts commit 4148a29ed83d1d85bff3d4e40e847128011c3f20. This is a work-around for bug: https://bugs.freedesktop.org/show_bug.cgi?id=59334 We really should be linking against libgallium.la instead of libgallium.a, but until we can figure why linking against libgallium.la causes runtime failures in clover we will continue to link against libgallium.a Acked-by: Andreas Boll <[email protected]> Tested-by: Aaron Watry <[email protected]>
* gallium/util: fix glClear with MRT by making the FS write to all cbufsMarek Olšák2013-01-152-5/+33
| | | | Reviewed-by: Brian Paul <[email protected]>
* util: add new primitive types to pipe_prim_names[] arrayBrian Paul2013-01-141-0/+4
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* Remove hacks for static MakefilesMatt Turner2013-01-132-15/+0
| | | | | | | | | | | v2: Andreas Boll <[email protected]> - don't remove compatibility with scripts for the old build system v3: Andreas Boll <[email protected]> - remove more obsolete hacks v4: Andreas Boll <[email protected]> - add a previously removed TOP variable to fix vgapi build
* llvmpipe: fix clearing integer color buffersRoland Scheidegger2013-01-101-0/+2
| | | | | | | | | | | | | We get int/uint clear color value in this case, and util_pack_color can't handle these formats at all (even if it could, float input color isn't what we want). Pass through the color union appropriately and handle the packing ourselves (as I couldn't think of a good generic util solution). This gets piglit fbo_integer_precision_clear and fbo_integer_readpixels_sint_uint from the ext_texture_integer test group from segfault to pass (which only leaves fbo-blending from that group not working). v2: fix up comments
* gallivm: fix border color for integer texturesRoland Scheidegger2013-01-101-0/+5
| | | | | | | | Need to bitcast the float border color (luckily we already get the color as int just disguised as float). Fixes piglit texwrap GL_EXT_texture_integer bordercolor. Reviewed-by: José Fonseca <[email protected]>
* gallivm: more integer texture format fetch fixesRoland Scheidegger2013-01-106-35/+74
| | | | | | | | | | | | | | | Change the texel type to int/uint instead of float throughout the sampling code which makes it easier to catch errors (as llvm will complain about wrong types if we mistakenly treat these values as real floats somewhere). This should also get things like e.g. sampler swizzles (for unused channels) right. This fixes piglit texture_integer_glsl130 test. Border color not working (crashing) yet. (These formats are not exposed yet in llvmpipe.) v2: couple cleanups according to José's comments Reviewed-by: José Fonseca <[email protected]>
* Clean up .gitignore filesMatt Turner2013-01-102-2/+0
|
* Remove MESA_PIC_FLAGS macroMatt Turner2013-01-101-3/+1
|
* build: Don't build pipebufferMatt Turner2013-01-102-19/+0
| | | | It's already built by src/gallium/auxiliary.
* libgallium: Convert to automakeTom Stellard2013-01-103-47/+53
|
* r300g: implement MSAAMarek Olšák2013-01-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | This is not as optimized as r600g - the MSAA compression is missing, so r300g needs a lot of bandwidth (more than r600g to do the same thing). However, if the bandwidth is not an issue for you, you can enjoy this unoptimized MSAA support. The only other missing optimization for MSAA is the fast color clear. MSAA is enabled on r500 only, because that's the only GPU family I tested. That said, MSAA should work on r300 and r400 as well (but you must set RADEON_MSAA=1 to allow it, then turn MSAA on in your app or set GALLIUM_MSAA=n, n >= 2, n <= 6) I will enable the support by default on r300-r400 once someone (other than me) tests those chipsets with piglit. The supported modes are 2x, 4x, 6x. The supported MSAA formats are RGBA8, BGRA8, and RGBA16F (r500 only). Those 3 formats are used for all GL internal formats. Tested with piglit. (I have ported all MSAA tests to GL2.1)
* util: fix addressing bug in pipe_put_tile_z() for PIPE_FORMAT_Z32_FLOATBrian Paul2013-01-041-1/+1
| | | | | | The Z32 pixel is 4 bytes so multiply x by 4, not 2. Note: This is a candidate for the stable branches.
* util: add get/put_tile_z() support for PIPE_FORMAT_Z32_FLOAT_S8X24_UINTBrian Paul2013-01-041-0/+36
| | | | | | Fixes https://bugs.freedesktop.org/show_bug.cgi?id=58972 Note: This is a candidate for the stable branches.
* gallivm: support more immediates in lp_build_tgsi_info()Brian Paul2013-01-041-1/+1
| | | | | | Bump limit from 32 to 128. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=58545
* util: move var declaration before loop to fix MSVC errorBrian Paul2013-01-041-1/+2
|
* st/mesa: fix GetTexImage for compressed 2D array texturesMarek Olšák2013-01-041-0/+18
| | | | | | | This uses a 3D blit to decompress the texture and then a 3D transfer to read it. Reviewed-by: Brian Paul <[email protected]>
* gallium/util: remove unused helper util_create_rgba_textureMarek Olšák2013-01-042-61/+0
| | | | Reviewed-by: Brian Paul <[email protected]>