summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* configure.ac: Remove stale comment about --x-* arguments.Matt Turner2013-03-051-6/+0
| | | | | | | Should have been removed with e273ed37. Note: This is a candidate for the 9.1 branch. Reviewed-by: Brian Paul <[email protected]>
* configure.ac: Don't check for X11 unconditionally.Matt Turner2013-03-051-8/+0
| | | | | | | | | X11 is already checked conditionally below. Fixes OSMesa-only configurations to not require X11. Note: This is a candidate for the 9.1 branch. Reviewed-by: Brian Paul <[email protected]>
* Add missing GL_TEXTURE_CUBE_MAP entry in _mesa_legal_texture_dimensionsAlan Hourihane2013-03-051-0/+1
| | | | | | | | | This was hit on the glTexStorage2D() path. Note: this is a candidate for the stable branches Signed-off-by: Alan Hourihane <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* Fix out-of-tree build of 'make check' in src/mesa/main/testsJon TURNEY2013-03-051-4/+4
| | | | | Signed-off-by: Jon TURNEY <[email protected]> Reviewed-by: Andreas Boll <[email protected]>
* u_blitter: don't create illegal shaders for 1D/3D/RECT/CUBE MSAADave Airlie2013-03-041-0/+5
| | | | | Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* Fix build of swrast only without libdrmDaniel Martin2013-03-041-1/+1
| | | | | Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Daniel Martin <[email protected]>
* mesa: flush current state when querying GL_EDGE_FLAGBrian Paul2013-03-041-1/+1
| | | | | | | | Fixes http://bugs.freedesktop.org/show_bug.cgi?id=61395 Note: This is a candidate for the stable branches. Reviewed-by: Jose Fonseca <[email protected]>
* vdpau-softpipe: Build correct source file - vl_winsys_xsp.cJakub Bogusz2013-03-031-1/+1
| | | | | | Copy-and-paste problem introduced by commit 7f24483e. Reviewed-by: Matt Turner <[email protected]>
* i965: Fix Crystal Well PCI IDs.Kenneth Graunke2013-03-032-18/+18
| | | | | | | | | The second digit was off by one, which meant we accidentally treated GTn as GT(n-1). This also meant no support for GT1 at all. NOTE: This is a candidate for stable branches. Signed-off-by: Kenneth Graunke <[email protected]>
* r600g: Check comp_mask before merging export instructionsVincent Lejeune2013-03-031-0/+1
| | | | | Fixes a llvm uncovered (rare) bug where consecutive exports were merged even if they have incompatible mask.
* r600g: fix check_and_set_bank_swizzle for caymanVadim Girlin2013-03-031-7/+3
| | | | | Tested-by: Vincent Lejeune <vljn at ovi.com> Reviewed-by: Vincent Lejeune <vljn at ovi.com>
* st/mesa: add switch case for ir_txf_ms to silence warningBrian Paul2013-03-021-0/+3
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: add switch case for ir_txf_ms to silence warningBrian Paul2013-03-021-0/+3
| | | | | Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: Pull query BO reallocation out into a helper function.Kenneth Graunke2013-03-011-23/+33
| | | | | | | | | We'll want to reuse this for non-occlusion queries in the future. Plus, it's a single logical task, so having it as a helper function clarifies the code somewhat. Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Replace the global brw->query.bo variable with query->bo.Kenneth Graunke2013-03-012-16/+7
| | | | | | | | | | Again, eliminating a global variable in favor of a per-query object variable will help in a future where we have more queries in hardware. Personally, I find this clearer: there's just the query object's BO, rather than two variables that usually shadow each other. Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Turn if (query->bo) into an assertion.Kenneth Graunke2013-03-011-5/+5
| | | | | | | The code a few lines above calls brw_emit_query_begin() if !query->bo, and that creates query->bo. So it should always be non-NULL. Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Unify query object BO reallocation code.Kenneth Graunke2013-03-011-11/+10
| | | | | | | | | | | | | If we haven't allocated a BO yet, we need to do that. Or, if there isn't enough room to write another pair of values, we need to gather up the existing results and start a new one. This is simple enough. However, the old code was awkwardly split into two blocks, with a write_depth_count() placed in the middle. The new depth count isn't relevant to gathering the old BO's data, so that can go after the reallocation is done. With the two blocks adjacent, we can merge them. Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Use query->last_index instead of the global brw->query.index.Kenneth Graunke2013-03-012-7/+6
| | | | | | | | | | | | Since we already have an index in the brw_query_object, there's no need to also keep a global variable that shadows it. Plus, if we ever add support for more types of queries that still need the per-batch before/after treatment we do for occlusion queries, we won't be able to use a single global variable. In contrast, per-query object variables will work fine. Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Remove brw_query_object::first_index field as it's always 0.Kenneth Graunke2013-03-012-6/+3
| | | | | | | | | | | brw->query.index is initialized to 0 just a few lines before it's copied to first_index. Presumably the idea here was to reuse the query BO for subsequent queries of the same type, but since that doesn't happen, there's no need to have the extra code complexity. Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Add a pile of comments to brw_queryobj.c.Kenneth Graunke2013-03-011-16/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | This code was really difficult to follow, for a number of reasons: - Queries were handled in four different ways (TIMESTAMP writes a single value, TIME_ELAPSED writes a single pair of values, occlusion queries write pairs of values for the start and end of each batch, and other queries are done entirely in software. It turns out that there are very good reasons each query is handled the way it is, but insufficient comments explaining the rationale. - It wasn't immediately obvious which functions were driver hooks and which were helper functions. For example, brw_query_begin() is a driver hook that implements glBeginQuery() for all query types, but the similarly named brw_emit_query_begin() is a helper function that's only relevant for occlusion queries. Extra explanatory comments should save me and others from constantly having to ask how this code works and why various query types are handled differently. v2: Incorporate Eric's feedback: change "as soon as possible" to "the results will be present when mapped." Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Write TIMESTAMP query values into the first buffer element.Kenneth Graunke2013-03-011-4/+3
| | | | | | | | | | For timestamp queries, we just write a single value to a BO. The natural place to write that is element 0, so we should do that. Previously, we wrote it into element 1 (the second slot) leaving element 0 filled with garbage. Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Implement the new QueryCounter() hook.Kenneth Graunke2013-03-011-6/+21
| | | | | | This moves the GL_TIMESTAMP handling out of EndQuery. Signed-off-by: Kenneth Graunke <[email protected]>
* mesa: Add a new QueryCounter() hook for TIMESTAMP queries.Kenneth Graunke2013-03-012-3/+9
| | | | | | | | | | | | | | | | | | | | In OpenGL, most queries record statistics about operations performed between a defined beginning and ending point. However, TIMESTAMP queries are different: they immediately return a single value, and there is no start/stop mechanism. Previously, Mesa implemented TIMESTAMP queries by calling EndQuery without first calling BeginQuery. Apparently this is DirectX convention, and Gallium followed suit. I personally find the asymmetry jarring, however---having BeginQuery and EndQuery handle a different set of enum values looks like a bug. It's also a bit confusing to mix the one-shot query with the start/stop model. So, add a new QueryCounter driver hook for implementing TIMESTAMP. For now, fall back to EndQuery to support drivers that don't do the new mechanism. Signed-off-by: Kenneth Graunke <[email protected]>
* tgsi: add texel offsets and derivatives to sampler interfaceRoland Scheidegger2013-03-023-80/+194
| | | | | | | | | | | | | | | | | | | | | | | | Something I never got around to implement, but this is the tgsi execution side for implementing texel offsets (for ordinary texturing) and explicit derivatives for sampling (though I guess the ordering of the components for the derivs parameters is debatable). There is certainly a runtime cost associated with this. Unless there are different interfaces used depending on the "complexity" of the texture instructions, this is impossible to avoid. Offsets are always active (I think checking if they are active or not is probably not worth it since it should mostly be an add), whereas the sampler_control is extended for explicit derivatives. For now softpipe (the only user of this) just drops all those new values on the floor (which is the part I never implemented...). Additionally this also fixes (discovered by accident) inconsistent projective divide for the comparison coord - the code did do the projection for shadow2d targets, but not shadow1d ones. This also drops checking for projection modifier on array targets, since they aren't possible in any extension I know of (hence we don't actually know if the array layer should also be divided or not). Reviewed-by: Brian Paul <[email protected]>
* draw: additional fix for the no-position case with llvmRoland Scheidegger2013-03-021-20/+20
| | | | | | | | Similar fix to what is done for the non-llvm case, we could otherwise still hit the stages (near certainly with gs) which crash. It is probably a much better idea to skip trying to draw at that point anyway. Reviewed-by: Brian Paul <[email protected]>
* draw: fix no position output in non-llvm pipeline.Roland Scheidegger2013-03-021-19/+19
| | | | | | | | | | It seems easiest (and best) if we simply skip all the later stages (after stream output). (This is different to the llvm case at least for now where we will simply try to render garbage, though both behaviors should be correct.) Fixes piglit glsl-1.40-tf-no-position with softpipe. Reviewed-by: Brian Paul <[email protected]>
* draw/llvm: skip clipping and viewport transform if there's no position outputRoland Scheidegger2013-03-021-26/+31
| | | | | | | | | | | | | With glsl 1.40 writing position is not required (useful for transform feedback, though in fact it's still possible to rasterize such geometry even if the results aren't too well defined). Prevents crashes in that case. Fixes piglit glsl-1.40-tf-no-position. Not quite sure this is 100% correct as it also skips clipdistance clipping which could still work (but not sure if the result would really be needed?) Reviewed-by: Jose Fonseca <[email protected] Reviewed-by: Brian Paul <[email protected]>
* llvmpipe: don't assert on illegal surface creation.Roland Scheidegger2013-03-022-4/+4
| | | | | | | | | | | | Since c8eb2d0e829d0d2aea6a982620da0d3cfb5982e2 llvmpipe checks if it's actually legal to create a surface. The opengl state tracker doesn't quite obey this so for now just warn instead of assert. Also warn instead of disabled assert when creating sampler views (same reasoning). Addresses https://bugs.freedesktop.org/show_bug.cgi?id=61647. Reviewed-by: Jose Fonseca <[email protected]>
* llvmpipe: bump glsl version to 140Roland Scheidegger2013-03-022-12/+5
| | | | | | | | | | | | | texel offsets should have been the last missing feature for 130, and in fact 140 as well (last there were texture buffers). In any case we still don't do OpenGL 3.0 (missing MSAA which will be difficult, plus EXT_packed_float, ARB_depth_buffer_float and EXT_framebuffer_sRGB). v2: bump to 140 instead - we have everything except we crash when not writing to gl_Position (but softpipe crashes as well) so let's just say this is a bug instead. Also (by Dave Airlie's suggestion) update llvm-todo.txt. Reviewed-by: Jose Fonseca <[email protected]>
* gallivm: add support for texel offsets for ordinary texturing.Roland Scheidegger2013-03-023-53/+210
| | | | | | | | | | | | | | | | | | This was previously only handled for texelFetch (much easier). Depending on the wrap mode this works slightly differently (for somewhat efficient implementation), hence have to do that separately in all roughly 137 places - it is easy if we use fixed point coords for wrapping, however some wrapping modes are near impossible with fixed point (the repeat stuff) hence we have to normalize the offsets if we can't do the wrapping in unnormalized space (which is a division which is slow but should still be much better than the alternative, which would be integer modulo for wrapping which is just unusable). This should still give accurate results in all cases that really matter, though it might be not quite conformant behavior for some apis (but we have much worse problems there anyway even without using offsets). (Untested, no piglit test.) Reviewed-by: Jose Fonseca <[email protected]>
* svga: always link with C++Brian Paul2013-03-011-5/+1
| | | | | | | | | Even when we don't have LLVM since there's other C++ code in the resulting DRI driver object. Note: This is a candidate for the stable branches. Reviewed-by: Matt Turner <[email protected]>
* st/mesa: convert ir_triop_lrp to TGSI_OPCODE_LRPBrian Paul2013-03-011-1/+4
| | | | | | | AFAICT, all gallium drivers implement TGSI_OPCODE_LRP. Tested with softpipe, llvmpipe, svga drivers. Reviewed-by: Matt Turner <[email protected]>
* docs: Mark some things done in GL3.txtChris Forbes2013-03-021-2/+2
|
* winsys/radeon: Only add bo to hash table when creating flinkMartin Andersson2013-03-011-4/+4
| | | | | | | | | | | | | The problem is that we mix bo handles and flinked names in the hash table. Because kms type handles are not flinked they should not be added to the hash table. If we do that we will sooner or later get a situation where we will overwrite a correct entry because the bo handle was the same as a flinked name. Note: this is a candidate for the stable branches. Reviewed-by: Jerome Glisse <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* i965: enable ARB_texture_multisample on Gen6+Chris Forbes2013-03-021-0/+1
| | | | | | | | V2: Works on Ivy Bridge now too, so this can be 6+. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/fs: add support for ir_txf_ms on Gen6+Chris Forbes2013-03-023-13/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | On Gen6, lower this to `ld` with lod=0 and an extra sample_index parameter. On Gen7, use `ld2dms`. We don't support CMS yet for multisample textures, so we just hardcode MCS=0. This is ignored for IMS and UMS surfaces. Note: If we do end up emitting specialized shaders based on the MSAA layout, we can emit a slightly shorter message here in the UMS case. Note: According to the PRM, `ld2dms` takes one more parameter, lod. However, it's always zero, and including it would make the message too long for SIMD16, so we just omit it. V2: Reworked completely, added support for Gen7. V3: - Introduce sample_index parameter rather than reusing lod - Removed spurious whitespace change - Clarify commit message V4: - Fix comment style - Emit SHADER_OPCODE_TXF_MS on Gen6. This was benignly wrong since it lowers to `ld` anyway on this gen, but still wrong. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/vs: add support for ir_txf_ms on Gen6+Chris Forbes2013-03-021-4/+21
| | | | | | | | | | | | | | | | | | On Gen6, lower this to `ld` with lod=0 and an extra sample_index parameter. On Gen7, use `ld2dms`. This takes an additional MCS parameter to support compressed multisample surfaces, but we're not enabling them for multisample textures for now, so it's always ignored and can be safely omitted. V2: Reworked completely, added support for Gen7. V3: - Use new sample_index, sample_index_type rather than reusing lod - Clarify commit message. V4: - Fix comment style Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: add a new virtual opcode: SHADER_OPCODE_TXF_MSChris Forbes2013-03-025-0/+18
| | | | | | | | | | | | | This is very similar to the TXF opcode, but lowers to `ld2dms` rather than `ld` on Gen7. V4: - add SHADER_OPCODE_TXF_MS to is_tex() functions, so regalloc thinks it actually writes the correct number of registers. Otherwise in nontrivial shaders some of the registers tend to get clobbered, producing bad results. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* i965: take the target into account for Gen7 MSAA modesChris Forbes2013-03-021-3/+19
| | | | | | | | | | | | | | | | | | | | | Gen7 has an erratum affecting the ld_mcs message, making it unsafe to use when the surface doesn't have an associated MCS. From the Ivy Bridge PRM, Vol4 Part1 p77 ("MCS Enable"): "If this field is disabled and the sampling engine <ld_mcs> message is issued on this surface, the MCS surface may be accessed. Software must ensure that the surface is defined to avoid GTT errors." To allow the shader to treat all surfaces uniformly, force UMS if the surface is to be used as a multisample texture, even if CMS would have been possible. V3: - Quoted erratum text Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Support multisampling in surface_state for texturesChris Forbes2013-03-022-5/+6
| | | | | | | | | | | | | | | | | | | The surface_state setup for renderbuffers already worked; only the texturing side needed work. BLORP does something similar, but does its own surface_state setup. On Gen6, we just need to set the correct sample count. On Gen7: - set the correct sample count - set the correct layout mode - set GEN7_SURFACE_ARYSPC_LOD0 if it's set in the miptree. V2: - Clarify commit message - Rebased onto Paul's physical/logical dims cleanup - Added Gen7 support Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* i965: add support for multisample texturesChris Forbes2013-03-026-7/+55
| | | | | | | | | | | V2: - Fix for state moving from texobj to image - Rebased onto Paul's logical/physical cleanup - Fixed missing quantization of sample count - Fold in IMS renderbuffer wrapper fixes from later in the series - Use correct physical slice offset for UMS/CMS surfaces on Gen7 Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* mesa: implement TexImage*MultisampleChris Forbes2013-03-021-4/+163
| | | | | | | | | | | | | | | | V2: - fix formatting issues - generate GL_OUT_OF_MEMORY if teximage cannot be allocated - fix for state moving from texobj to image V3: - remove ridiculous stencil hack - alter format check to not allow a base format of STENCIL_INDEX - allow width/height/depth to be zero, to deallocate the texture - dont forget to call _mesa_update_fbo_texture V4: - fix indentation - don't throw errors on proxy texture targets Signed-off-by: Chris Forbes <[email protected]>
* mesa: support multisample textures in framebuffer completeness checkChris Forbes2013-03-021-14/+37
| | | | | | | | | | | | | | | | | | | | | | | - sample count must be the same on all attachments - fixedsamplepositions must be the same on all attachments (renderbuffers have fixedsamplepositions=true implicitly; only multisample textures can choose to have it false) V2: - fix wrapping to 80 columns, debug message, fix for state moving from texobj to image. - stencil texturing tweaks tidied up and folded in here. V3: - Removed silly stencil hacks entirely; the extension doesn't actually make stencil-only textures legal at all. - Moved sample count / fixed sample locations checks into existing attachment-type-specific blocks, as suggested by Eric V4: - Removed stencil hacks which were missed in V3 (thanks Eric) - Don't move the declaration of texImg; only required pre-V3. Signed-off-by: Chris Forbes <[email protected]> [V2] Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: expose sample positionsChris Forbes2013-03-023-43/+82
| | | | | | | | | | | | Moves the definition of the sample positions out of gen6_emit_3dstate_multisample, and unpacks them in gen6_get_sample_position. V2: Be consistent about `sample position` rather than `location`. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Paul Berry <[email protected]> Acked-by: Ian Romanick <[email protected]>
* i965: add support for sample mask on Gen6+Chris Forbes2013-03-024-9/+16
| | | | | | | Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: implement sample maskChris Forbes2013-03-025-2/+53
| | | | | | | | | | | | | | | | V2: - fix multiline comment style - stop using ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH since that doesn't exist anymore. V3: - check for the extension being enabled - tidier flagging of _NEW_MULTISAMPLE - fix weird indentation in get.c V4: - move flush later in SampleMaski() Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: implement GetMultisamplefvChris Forbes2013-03-023-2/+34
| | | | | | | | | | | | | | | Actual sample locations deferred to a driverfunc since only the driver really knows where they will be. V2: - pass the draw buffer to the driverfunc; don't fallback to pixel center if driverfunc is missing. - rename GetSampleLocation to GetSamplePosition - invert y sample position for winsys FBOs, at Paul's suggestion Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: expose new max sample countsChris Forbes2013-03-021-2/+10
| | | | | | | | | | V2: For now, only expose a depth sample count of 1, since there are possible unresolved interactions with HiZ. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: add new max sample count stateChris Forbes2013-03-023-0/+13
| | | | | | | | | | | | | | - GL_MAX_COLOR_TEXTURE_SAMPLES - GL_MAX_DEPTH_TEXTURE_SAMPLES - GL_MAX_INTEGER_SAMPLES V2: initialize limits to 1 in _mesa_init_constants as suggested by Brian and Paul Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: add support for ARB_texture_multisampleChris Forbes2013-03-0220-26/+153
| | | | | | | | | | | | | | | | | | V2: - emit `sample` parameter properly for multisample texelFetch() - fix spurious whitespace change - introduce a new opcode ir_txf_ms rather than overloading the existing ir_txf further. This makes doing the right thing in the driver somewhat simpler. V3: - fix weird whitespace V4: - don't forget to include the new opcode in tex_opcode_strs[] (thanks Kenneth for spotting this) Signed-off-by: Chris Forbes <[email protected]> [V2] Reviewed-by: Eric Anholt <[email protected]> [V2] Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Ian Romanick <[email protected]>