summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* mesa: remove GLvertexformat::Rectf()Brian Paul2013-05-027-56/+24
| | | | | | As with the glDraw* functions, this doesn't have to be in GLvertexformat. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: simplify dispatch for glDraw* functionsBrian Paul2013-05-028-401/+17
| | | | | | | | | | | | Remove all the glDraw* functions from the GLvertexformat structure. The point of that dispatch struct is to handle all the functions which dispatch differently depending on whether we're inside glBegin/End. glDraw* are never allowed inside glBegin/End so we can remove those entries. This simplifies the code paths and gets rid of quite a bit of code. Reviewed-by: Jose Fonseca <[email protected]>
* vbo: add new vbo_initialize_exec_dispatch(), vbo_initialize_save_dispatch()Brian Paul2013-05-023-0/+68
| | | | | | First step in simplifying the vertex array / glDraw dispatch code. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: remove _MESA_INIT_EVAL_VTXFMT() macroBrian Paul2013-05-025-16/+32
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* mesa: remove _MESA_INIT_ARRAYELT_VTXFMT() macroBrian Paul2013-05-025-8/+4
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* mesa: remove _MESA_INIT_DLIST_VTXFMT() macroBrian Paul2013-05-025-10/+9
| | | | | | Just expand the code. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: change _mesa_inside_dlist_begin_end() to handle PRIM_UNKNOWNBrian Paul2013-05-022-5/+3
| | | | | | | | | | | | If the currently compiled primitive state is PRIM_UNKNOWN we should not return true from _mesa_inside_dlist_begin_end(). This lets us simplify the calls to that function. Note, the call to _mesa_inside_dlist_begin_end() in vbo_save_EndList() should have probably been checking for PRIM_UNKNOWN too, but it wasn't. So there's no code change change. Reviewed-by: Jose Fonseca <[email protected]>
* vbo: fix initial value of ctx->Driver.CurrentSavePrimitiveBrian Paul2013-05-021-1/+1
| | | | | | | This is set during context creation/initialization. We know we're not inside glBegin/glEnd at this point so use PRIM_OUTSIDE_BEGIN_END. Reviewed-by: Jose Fonseca <[email protected]>
* vbo: fix error detection in vbo_save_playback_vertex_list()Brian Paul2013-05-021-11/+6
| | | | | | | | | | | The old code didn't make sense. The clause in question did the same thing as the next else-if clause. If we're already executing a glBegin/End pair and we're starting a new primitive, that's an error. Fixes more failures in piglit gl-1.0-beginend-coverage test. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: comments, formatting fixes in dlist codeBrian Paul2013-05-021-3/+10
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* vbo: remove redundant vfmt->Begin = _save_Begin assignmentBrian Paul2013-05-021-1/+0
| | | | | | The same assignment appears later in the function. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: don't install glDraw* functions into the BeginEnd dispatch tableBrian Paul2013-05-021-30/+43
| | | | | | | | | Functions like glDrawArrays, glDrawElements, etc. are illegal between glBegin/glEnd and should generate GL_INVALID_OPERATION. Fixes several piglit gl-1.0-beginend-coverage failures. Reviewed-by: Jose Fonseca <[email protected]>
* vbo: fix parameter validation for saving dlist glDraw* functionsBrian Paul2013-05-021-4/+39
| | | | | | | | | | | | | | | | The _save_OBE_DrawArrays/Elements/RangeElements() functions are called when building a display list and we know we're outside glBegin/End. We shouldn't call the normal _mesa_validate_DrawArrays/Elements() functions here because those functions only work properly in immediate mode or during dlist execution. At dlist compile time, we can't call _mesa_update_state(), etc. and examine the current state since it won't apply when the list is executed later. Fixes several failures in piglit's gl-1.0-beginend-coverage test. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: add missing error check in _mesa_EndList()Brian Paul2013-05-021-0/+6
| | | | | | | | | If we're in GL_COMPILE_AND_EXECUTE mode and inside glBegin, calling glEndList() should generate an error. Fixes a failure in piglit's gl-1.0-beginend-coverage test. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: remove unused PRIM_INSIDE_UNKNOWN_PRIM constantBrian Paul2013-05-024-12/+7
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* mesa: simplify save_Begin() error checkingBrian Paul2013-05-021-20/+13
| | | | | | | | The old code was hard to understand and not entirely correct. Note that PRIM_INSIDE_UNKNOWN_PRIM is no longer set anywhere so we'll be able to remove that next. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: refactor _mesa_valid_prim_mode()Brian Paul2013-05-022-14/+24
| | | | | | | ...in terms of new _mesa_is_valid_prim_mode(). We need a mode validater function that doesn't depend on current state for the display list code. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: fix CurrentSavePrimitive <= GL_POLYGON testsBrian Paul2013-05-022-3/+3
| | | | | | | Use the new PRIM_MAX value instead so that new geometry shader primitive types are accounted for. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: adjust PRIM_x constants for geometry shadersBrian Paul2013-05-021-3/+4
| | | | | | | | | These values pertain to display lists, and the new types of geometry shader primitives can be used in display lists. And add new PRIM_MAX constant for follow-on changes. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: fix save_ShadeModel() logic and add new commentsBrian Paul2013-05-021-4/+5
| | | | | | | | | | | | | | | | This removes the test for _mesa_inside_dlist_begin_end(). If ctx->Driver.CurrentSavePrimitive==PRIM_UNKNOWN (the initial value), _mesa_inside_dlist_begin_end() will, confusingly, return TRUE. So we didn't set the ctx->ListState.Current.ShadeModel value and it remained in its indeterminate state. This didn't effect correctness, but it defeated the intended optimization of dropping redundant glShadeModel() state changes in order to coalesce sequences of drawing commands. Verified with new piglit gl-1.0-dlist-shademodel test. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: implement glFramebufferTextureJordan Justen2013-05-012-0/+20
| | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add Layered field to framebuffersJordan Justen2013-05-012-0/+22
| | | | | | | | | | | When checking framebuffer completeness, we test each attachment. We verify that all attachments are consistent in terms of layers. 1. They must all be layered, or all non-layered 2. If they are layered, they must match in depth Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add renderbuffer attachment Layered fieldJordan Justen2013-05-013-8/+12
| | | | | | | | If glFramebufferTexture is used, then the framebuffer attachment is layered. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add renderbuffer Depth fieldJordan Justen2013-05-012-0/+2
| | | | | | | | | | With glFramebufferTexture, a renderbuffer may support all layers of the texture, so we need the depth of the renderbuffer to check for consistency which is required for framebuffer completeness. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* scons: remove IN_DRI_DRIVERAndreas Boll2013-05-011-1/+0
| | | | Not used anymore.
* build: remove unused API_DEFINESAndreas Boll2013-05-0114-15/+5
| | | | Reviewed-by: Matt Turner <[email protected]>
* intel: use automake conditionals for defining FEATURE_{ES1,ES2}Andreas Boll2013-05-012-2/+20
| | | | | | Removes the need of API_DEFINES. Reviewed-by: Matt Turner <[email protected]>
* intel: remove executable bit from C fileAndreas Boll2013-05-011-0/+0
| | | | Reviewed-by: Matt Turner <[email protected]>
* vbo: fix possible use-after-free segfault after a VAO is deletedMarek Olšák2013-05-013-4/+25
| | | | | | | | | | | | | This like the fifth attempt to fix the issue. Also with the new "validating" flag, we can set recalculate_inputs to FALSE earlier in vbo_bind_arrays, because _mesa_update_state won't change it. NOTE: This is a candidate for the stable branches. v2: fixed a typo Reviewed-by: Brian Paul <[email protected]>
* i965/vs: Fix textureGrad() with shadow samplers on Haswell.Kenneth Graunke2013-05-011-2/+8
| | | | | | | | | | | | The shadow comparitor needs to be loaded into the Z component of the last DWord. Fixes es3conform's shadow_execution_vert and oglconform's shadow-grad advanced.textureGrad.1D tests on Haswell. NOTE: This is a candidate for stable branches. Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Lower textureGrad() for samplerCubeShadow.Kenneth Graunke2013-05-013-6/+27
| | | | | | | | | | | | | | | | | | | | | | | According to the Ivybridge PRM, Volume 4 Part 1, page 130, in the section for the sample_d message: "The r coordinate contains the faceid, and the r gradients are ignored by hardware." This doesn't match GLSL, which provides gradients for all of the coordinates. So we would need to do some math to compute the face ID before using sample_d. We currently don't have any code to do that. However, we do have a lowering pass that converts textureGrad to textureLod, which solves this problem. Since textureGrad on three components is sufficiently obscure, it's not a performance path. For now, only handle samplerCubeShadow; we need tests for samplerCube and samplerCubeArray. Fixes es3conform's shadow_comparison_frag test on Haswell. NOTE: This is a candidate for stable branches. Signed-off-by: Kenneth Graunke <[email protected]>
* swrast: add casts for ImageSlices pointer arithmeticBrian Paul2013-05-012-4/+4
| | | | | | MSVC doesn't like pointer arithmetic with void * so use GLubyte *. Reviewed-by: Jose Fonseca<[email protected]>
* i965: Stop passing num_samples to intel_miptree_alloc_hiz().Paul Berry2013-04-303-8/+6
| | | | | | | | | | | | | The number of samples is already available in the miptree data structure, so there's no need to pass it in. I suspect this may fix a subtle bug because in one case (intel_renderbuffer_update_wrapper) we were always passing zero for num_samples, even though the buffer in question was not guaranteed to be single-sampled. But I wasn't able to find a failing test case. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Implement color clears using a simple shader in blorp.Eric Anholt2013-04-308-14/+344
| | | | | | | | | | | | | | | | | | | | | | | The upside is less CPU overhead in fiddling with GL error handling, the ability to use the constant color write message in most cases, and no GLSL clear shaders appearing in MESA_GLSL=dump output. The downside is more batch flushing and a total recompute of GL state at the end of blorp. However, if we're ever going to use the fast color clear feature of CMS surfaces, we'll need this anyway since it requires very special state setup. This increases the fail rate of some the GLES3conform ARB_sync tests, because of the initial flush at the start of blorp. The tests already intermittently failed (because it's just a bad testing procedure), and we can return it to its previous fail rate by fixing the initial flush. Improves GLB2.7 performance 0.37% +/- 0.11% (n=71/70, outlier removed). v2: Rename the key member, use the core helper for sRGB, and use BRW_MASK_* enums, fix comment and indentation (review by Paul). v3: Rewrite a comment, drop a silly temporary variable (review by Ken) Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Make a Mesa core function for sRGB render encoding handling.Eric Anholt2013-04-304-41/+36
| | | | | | | | v2: const-qualify ctx, and add a comment about the function (recommended by Brian and Kenneth). Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> (v1)
* i965: Don't flush the batch at the end of blorp.Eric Anholt2013-04-303-18/+19
| | | | | | | | | | Improves GLB2.7 performance 0.13% +/- 0.09% (n=104/105, outliers removed). More importantly, once color glClear()s are done through blorp in the next commit, this reduces regression in GLES3 conformance tests that rely on queueing up many glClear()s and having the GPU report being still busy in an ARB_sync query after that. Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Remove the last spans code!Eric Anholt2013-04-3011-148/+6
| | | | | | | | The remaining bits happen to do nothing that _swrast_span_render_start()/finish() don't do. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* intel: Move the S8 offset calc function near its remaining usage.Eric Anholt2013-04-303-58/+56
| | | | | | | It's not really span code ever since we stopped using spans for S8. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* intel: Ensure renderbuffers are current when mapping them.Eric Anholt2013-04-301-6/+1
| | | | | | | | | | | | In the case of renering to windows in X, we would render to stale buffers (or not render at all!) if you hit a MapRenderbuffer as the first thing done to your window after new buffers are ready to be collected in DRI2. I think this also covers the weird comment about irb->mt being missing sometimes. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add a clarifying comment about rowStride of compressed textures.Eric Anholt2013-04-301-1/+3
| | | | | | | I always forget how we do this for compressed textures. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Remove the Map field from texture images.Eric Anholt2013-04-301-1/+0
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* swrast: Always use MapTextureImage for mapping textures for swrast.Eric Anholt2013-04-3011-300/+64
| | | | | | | | | | | | | | | Now that everything goes through ImageSlices[], we can rely on the driver's existing texture mapping function. A big block of code goes away on Radeon that looks like it was to deal with the validate that happened at SpanRenderStart, which no longer occurs since we don't need validation for the MapTextureImage hook. v2: Rewrite comment about ImageSlices, fix duplicated swImages, touch up unmap loop. Reviewed-by: Kenneth Graunke <[email protected]> (v1) Reviewed-by: Brian Paul <[email protected]>
* nouveau: Replace swrast_texture_image->Map usage with ->Buffer.Eric Anholt2013-04-301-3/+1
| | | | | | | | This code is trying to deal with providing a map in the case that AllocTexImageBuffer was called, which is hooked up to the swrast variant. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* nouveau: Just use MapTextureImage instead of duplicating the logic.Eric Anholt2013-04-301-81/+18
| | | | | | | | MapTextureImage has the exact same logic, except it can also handle swrast-allocated buffers. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* swrast: Make a teximage's stored RowStride be in terms of bytes per row.Eric Anholt2013-04-306-9/+30
| | | | | | | | | | | | | For hardware drivers with pitch alignment requirements, a non-power-of-two-sized texture format won't end up being an integer number of pixels per row. Also, avoids having to change our units between MapTextureImage's rowStride and swrast's RowStride. This doesn't fully convert the compressed texel fetch path, but does make sure we don't drop any bits (not that we'd expect to). Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* swrast: Replace use of teximage Map in 1D/2D paths with ImageSlices[0].Eric Anholt2013-04-303-8/+8
| | | | | | | This gets us ready for the Map field to die. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* swrast: Replace ImageOffsets with an ImageSlices pointer.Eric Anholt2013-04-3013-185/+123
| | | | | | | | | | | | | This is a step toward allowing drivers to use their normal mapping paths, instead of requiring that all slice mappings come from an aligned offset from the first slice's map. This incidentally fixes missing slice handling in FXT1 swrast. v2: Use slice height helper function. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* swrast: Reuse _swrast_free_texture_image_buffer from drivers.Eric Anholt2013-04-302-15/+2
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* swrast: Move ImageOffsets allocation to shared code.Eric Anholt2013-04-304-44/+17
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* swrast: Clean up and explain the mapping process.Eric Anholt2013-04-302-10/+17
| | | | | | | v2: Move slice height calculation to a helper function (recommeded by Brian). Reviewed-by: Kenneth Graunke <[email protected]> (v1) Reviewed-by: Brian Paul <[email protected]>