aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
...
* st/mesa: fix GetTexImage for compressed cubemapsMarek Olšák2013-01-041-1/+1
| | | | | | I'll deal with 2D arrays later. NOTE: This is a candidate for the stable branches.
* mesa: allow TEXTURE_CUBE_MAP_ARRAY in GetTexImageMarek Olšák2013-01-041-0/+2
| | | | Reviewed-by: Brian Paul <[email protected]>
* gallium: extend pipe_context::flush for it to accept an END_OF_FRAME flagMarek Olšák2013-01-044-8/+16
| | | | | | | | | | | | | | | | | Usage with pipe_context: pipe->flush(pipe, NULL, PIPE_FLUSH_END_OF_FRAME); Usage with st_context_iface: st->flush(st, ST_FLUSH_END_OF_FRAME, NULL); The flag is only a hint for drivers. Radeon will use it for buffer eviction heuristics in the kernel (e.g. for queries like how many frames have passed since a buffer was used). The flag is currently only generated by st/dri on SwapBuffers. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Stéphane Marchesin <[email protected]>
* i965: Replace structs with bit-shifting for Gen7 SURFACE_STATE entries.Kenneth Graunke2013-01-036-360/+252
| | | | | | | | | | | | | | | | | Every generation except Gen7 creates SURFACE_STATE entries via a uint32_t array. Only Gen7 uses the older bitfield structure, which we moved away from because it was less efficient. Convert it for consistency. This reduces the compiled size of gen7_wm_surface_state.o by 2.86% in a release build. v2: Fix accidental use of BRW_SURFACE_WIDTH/HEIGHT in brw_state_dump.c; switch back to gen7_set_surface_mcs_info setting surf[6] directly (both per Eric's review comments). Acked-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* radeon/r200: Fix tcl cullingsmoki2013-01-032-18/+8
| | | | | Should fix: https://bugs.freedesktop.org/show_bug.cgi?id=57842
* i965: Add break statement at end of BRW_OPCODE_CONTINUE case.Vinson Lee2013-01-021-0/+1
| | | | | | | | Fixes missing break in switch defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add missing ASSERT_OUTSIDE_BEGIN_END to GetSamplerParameter*Matt Turner2013-01-021-0/+8
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add missing ASSERT_OUTSIDE_BEGIN_END to SamplerParameter*Matt Turner2013-01-021-0/+8
| | | | | | | Commit f22d49de added the SamplerParamter* functions but only used ASSERT_OUTSIDE_BEGIN_END inside the -f and -fv versions. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Mark _mesa_{init,delete}_sampler_object as staticMatt Turner2013-01-022-9/+2
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Implement compressed 2D array textures.Paul Berry2013-01-022-30/+40
| | | | | | | | | | | | | This patch adds functionality to Mesa to upload compressed 2-dimensional array textures, using the glCompressedTexImage3D and glCompressedTexSubImage3D calls. Fixes piglit tests "EXT_texture_array/compressed *" and "!OpenGL ES 3.0/ext_texture_array-compressed_gles3 *". Also partially fixes GLES3 conformance test "CoverageES30.test". Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Fix error reporting in _mesa_invalidate_pbo_{compressed_,}teximage.Paul Berry2013-01-024-10/+16
| | | | | | | | | | | The old error reporting was completely bogus, passing _mesa_error() a format string that didn't even match the remaining arguments. Also, in many cases the number of dimensions in the TexImage call was not preserved in the error message (e.g. an error in glTexImage2D was reported simply as an error in glTexImage). Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: fix signed/unsignd mix-up in fetch_signed_l_latc1()Brian Paul2013-01-021-2/+3
| | | | Fixes https://bugs.freedesktop.org/show_bug.cgi?id=58844
* glsl: add cast to silence signed/unsigned comparision warningBrian Paul2013-01-011-1/+1
|
* xlib: handle _mesa_initialize_visual()'s return valueBrian Paul2012-12-311-9/+12
| | | | | | | | | If the call fails, we should return NULL from XMesaCreateVisual(). This was found when Waffle tried to create a visual with depth/stencil bits = -1. That's an illegal value for glXChooseFBConfig() and we should return NULL in that situation. Note: This is a candidate for the stable branches.
* i965: Fail to blit rather than assert on invalid pitch requirements.Kenneth Graunke2012-12-291-2/+2
| | | | | | | | | | | | | | | | | | | Dungeon Defenders hits TexImage()'s try_pbo_upload() path where image->Width == 2, which doesn't meet intelEmitCopyBlit's requirement that the pitch needs to be a multiple of 4. Since intelEmitCopyBlit can already fail for a myriad of other reasons, and it's not clear that other callers are immune to this failure mode, simply make it return false rather than assert. Fixes Dungeon Defenders on i965/Ivybridge. Now playable (aside from having to work around the EXT_bindable_uniform issue). NOTE: This is probably a candidate for the 9.0 branch. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* intel: Skip texture validation logic when nothing has changed.Eric Anholt2012-12-285-2/+30
| | | | | | Improves GLBenchmark 2.1 offscreen performance by 3.2% +/- 1.5% (n=52). Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Turn a test in miptree_match_image into an assert.Eric Anholt2012-12-281-2/+5
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Stop making a copy of non-builtin uniforms in ParameterValues[].Eric Anholt2012-12-281-3/+0
| | | | | | | | We don't need them now that our set of parameter pointers points at the GL core storage for them. This should save memory/bandwidth/overhead in uniform updates. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Consistently use nr_pull_params instead of NumParameters.Eric Anholt2012-12-282-4/+3
| | | | | | | | | | NumParameters used to be an upper bound on the number of vec4s to be uploaded, which was basically safe (unless your buffer was bound near the top of address space *and* you array indexed outside the buffer, in which case I think you might GPU hang). As I migrate the driver away from ParameterValues[], this is no longer true. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vs: Reference the core GL uniform storage for non-builtin uniforms.Eric Anholt2012-12-282-54/+35
| | | | | | | Like in the FS, there's no reason to use an external copy if the ParameterValues[] relayout of it isn't the layout we need. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Reference the core GL uniform storage for non-builtin uniforms.Eric Anholt2012-12-283-44/+30
| | | | | | | There's no reason to use an external copy if the relayout in the external copy isn't serving us. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Remove the param_index/param_offset indirection.Eric Anholt2012-12-284-46/+10
| | | | | | | Now that ParameterValues doesn't change across the visitor, we don't need to go through this. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Add asserts to check that we don't realloc ParameterValues.Eric Anholt2012-12-284-0/+19
| | | | | | | Things are even more restrictive than they used to be, so I've made mistakes in this area. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Add texrect scale parameters before pointers to ParameterValues.Eric Anholt2012-12-283-0/+24
| | | | | | | | | | | | | If adding scale parameters during program compile caused a realloc of ParameterValues, then the driver uniform storage set up by _mesa_associate_uniform_storage() would point to potentially freed memory. Note that this uses TexturesUsed, which may change at runtime for GLSL when sampler uniforms change. This is a flaw in our handling of texrect in general, and not one I'm fixing currently. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Fix a typo in a comment.Eric Anholt2012-12-281-1/+1
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Add a note about a bug from the no-recompile-on-sampler-updates change.Eric Anholt2012-12-281-0/+4
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add missing texel fetch code for sRGB DXT formatsBrian Paul2012-12-262-0/+86
| | | | Fixes http://bugs.freedesktop.org/show_bug.cgi?id=58548
* i965: Fix border color handling for deprecated SNORM formats.Eric Anholt2012-12-261-2/+29
| | | | | | | | | | We don't have native hardware support for these, so they get promoted to RGBA, in which case we don't have hardware dealing with the channel swizzling for us. Fixes piglit EXT_texture_snorm/texwrap formats bordercolor (-swizzled). Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Start using HIZ for Z16 textures.Eric Anholt2012-12-261-0/+1
| | | | | | | | | | I had left this out for a long time because it regressed some depthstencil-render-miplevels cases when it was enabled. Now that the bugs causing those are fixed, there's nothing stopping us. Improves glbenchmark 2.1 offscreen performance by 7.3% +/- 2.8% (n=10). Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Use the parent miptree's format for setting up HiZ miptrees.Eric Anholt2012-12-261-1/+1
| | | | | | | This worked out before because the parent was always 4 bytes so it didn't affect the layout, but now we want to support Z16 too. Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Remove a couple of dead function prototypes.Eric Anholt2012-12-221-5/+0
| | | | Reviewed-by: Jordan Justen <[email protected]>
* i965: Add perf debug for depth/stencil alignment workaround.Eric Anholt2012-12-221-0/+16
| | | | | | | | Fixing these rendering bugs has been implicated in performance regressions (which may be unfixable), but at least knowing that it's happening should help diagnose those regressions. Reviewed-by: Jordan Justen <[email protected]>
* i965: Assert that relayout laid out something that won't need it again.Eric Anholt2012-12-221-0/+6
| | | | | | | | The ETC1 changes failed at this, so let's make sure it will be caught in testing next time. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* i965: Also fix validation of Z32F_S8 textures.Eric Anholt2012-12-221-0/+2
| | | | | | | | | This was caught by the assertion in the next commit. It fixes the remaining piglit depthstencil-render-miplevels cases, probably by avoiding broken stencil copies in the validation path. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* i965: Fix validation of ETC miptrees.Eric Anholt2012-12-221-5/+7
| | | | | | | | | | | When comparing to the teximage's format, we have to look at the format-the-mt-was-created-for not the format-actually-stored-in-the-mt. Improves glbenchmark 2.1 offscreen test performance 159% +/- 17% (n=3). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54582 Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* qi965: Add perf debug for texture relayout.Eric Anholt2012-12-221-0/+5
| | | | | | | | Relayout is expensive, so it's something developers (both us and others) should know about when it happens. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: Fix hiz resolves getting stomped by depth offset validation.Eric Anholt2012-12-221-5/+5
| | | | | | | Fixes all the remaining non-Z32F_S8 depthstencil-render-miplevels tests in piglit. Reviewed-by: Jordan Justen <[email protected]>
* Make IsVertexArray() return false before BindVertexArray()Matt Turner2012-12-212-4/+6
| | | | | | | | | | | | | | | | | | | | | Rename existing _Used flag to EverBound. The GL 4.3 and ES 3.0 specs say These names are marked as used, for the purposes of GenVertexArrays only, but they do not acquire array state until they are first bound. This also affects Apple VAOs, which is fine since the APPLE_vertex_array_object spec says A vertex array object is created by binding an unused name. This binding is accomplished by calling BindVertexArrayAPPLE with id set to the name of the new vertex array object. Fixes arb_vertex_array_object_isvertexarray. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* Make IsTransformFeedback() return false before BindTransformFeedback()Matt Turner2012-12-212-3/+11
| | | | | | | | | | | | | | The GL 4.3 an ES 3.0 specs say A transform feedback object is created by binding a name returned by GenTransformFeedbacks with the command void BindTransformFeedback( enum target, uint id ); Fixes arb_transform_feedback2-istransformfeedback and part of es3conform's CoverageES30.test. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add bounds checking for uniform array accessFrank Henigman2012-12-211-13/+13
| | | | | | | | | | | | | | | | | | No piglit regressions and now passes glsl-uniform-out-of-bounds-2. validate_uniform_parameters now checks that the array index is valid. This means if an index is out of bounds, glGetUniform* now fails with GL_INVALID_OPERATION, as it should. _mesa_uniform and _mesa_uniform_matrix also call validate_uniform_parameters so the bounds checks there became redundant and were removed. The test in glGetUniformLocation is modified to check array bounds so it now returns GL_INVALID_INDEX (-1) if you ask for the location of a non-existent array element, as it should. Signed-off-by: Frank Henigman <[email protected]> Reviewed-by: Stéphane Marchesin <[email protected]>
* mesa: Allow glReadBuffer(GL_NONE) for winsys framebuffers.Paul Berry2012-12-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | Previously, Mesa code assumed that glReadBuffer(GL_NONE) was only valid for user-created framebuffer objects. However, the spec is quite clear that is should also be valid for the default framebuffer. From section 18.2.1 ("Obtaining Pixels from the Framebuffer") of the GL 4.3 spec: "When READ_FRAMEBUFFER_BINDING is zero, i.e. the default framebuffer, src must be one of the values listed in table 17.4, including NONE." Similar language exists in the GLES 3.0 spec, and in desktop GL all the way back to ARB_framebuffer_object. Partially fixes GLES3 conformance test "CoverageES30.test". NOTE: This is a candidate for stable branches. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa/st: Implement GL_TIME_ELAPSED w/ PIPE_QUERY_TIMESTAMP.José Fonseca2012-12-204-22/+79
| | | | | | | | | | | | | | | | | | ARB/EXT_timer_query's definition of GL_TIME_ELAPSED match precisely the subtraction of two GL_TIMESTAMP queries. And for a lot of drivers, that's precisely how they have to implement internally -- by emitting two hardware timestamp queries. So, to simplify driver implementation, simply allow doing so in the state tracker. Eventually if no driver implements PIPE_QUERY_TIME_ELAPSED then we could retire it. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium: s/PIPE_CAP_TIMER_QUERY/PIPE_CAP_QUERY_TIME_ELAPSED/José Fonseca2012-12-201-2/+2
| | | | | | | | To better reflect what it is being advertised. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* i965: Fix gl_VertexID when there are no other vertex inputs.Paul Berry2012-12-181-3/+3
| | | | | | | | | | | | brw_emit_vertices contains special case logic to handle the case where a vertex shader doesn't read any inputs. This special case logic was incorrectly activating in the case were the only vertex input is gl_VertexID. As a result, if a shader used gl_VertexID but used no other inputs, then all vertices got a gl_VertexID of zero. Fixes oglconform test "ubo-usage advanced.transform_feedback". Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Make a function is_transform_feedback_active_and_unpaused.Paul Berry2012-12-189-31/+29
| | | | | | | | | | The rather unweildy logic for determining this condition was repeated in a large number of places. This patch consolidates it to a single inline function. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix corner cases of BindBufferBase with transform feedback.Paul Berry2012-12-183-17/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements the following behaviours, which are mandated by the GL 4.3 and GLES3 specs. 1. Regarding the GL_TRANSFORM_FEEDBACK_BUFFER_SIZE query: "If the ... size was not specified when the buffer object was bound (e.g. if it was bound with BindBufferBase), ... zero is returned." (GL 4.3 section 6.7.1 "Indexed Buffer Object Limits and Binding Queries"). 2. "BindBufferBase binds the entire buffer, even when the size of the buffer is changed after the binding is established. It is equivalent to calling BindBufferRange with offset zero, while size is determined by the size of the bound buffer at the time the binding is used." (GL 4.3 section 6.1.1 "Binding Buffer Objects to Indexed Targets"). I interpret "at the time the binding is used" to mean "at the time of the call to glBeginTransformFeedback". 3. "Regardless of the size specified with BindBufferRange, or indirectly with BindBufferBase, the GL will never read or write beyond the end of a bound buffer. In some cases this constraint may result in visibly different behavior when a buffer overflow would otherwise result, such as described for transform feedback operations in section 13.2.2." (GL 4.3 section 6.1.1 "Binding Buffer Objects to Indexed Targets"). Item 1 has been part of the spec all the way back to the inception of the EXT_transform_feedback extension. Items 2 and 3 were added in GL 4.2 and GLES 3. Prior to GL 4.2, in place of items 2 and 3, the spec simply said "BindBufferBase is equivalent to calling BindBufferRange with offset zero and size equal to the size of buffer." For transform feedback, Mesa behaved as though this meant "...equal to the size of buffer at the time of the call to BindBufferBase". However, this was problematic because it left it ambiguous what to do if the buffer is shrunk between the call to BindBuffer{Base,Range} and the call to BeginTransformFeedback. Prior to this patch, Mesa's behaviour was to try to write beyond the end of the buffer, likely resulting in memory corruption. In light of this, I'm interpreting the spec change as a clarification, not an intended behavioural change, so I'm making the change apply regardless of API version. Fixes GLES3 conformance test transform_feedback2_pause_resume.test. Reviewed-by: Jordan Justen <[email protected]>
* mesa/gles3: Generate error on draw call if transform feedback would overflow.Paul Berry2012-12-183-1/+80
| | | | | | | | | | | | | | | | | In desktop GL, if a draw call would cause transform feedback buffers to overflow, the draw call should succeed, and the extra primitives should simply not be recorded in the transform feedback buffers. In GLES3, however, if a draw call would cause transform feedback buffers to overflow, the draw call is supposed to produce an INVALID_OPERATION error and no drawing should occur. This patch implements the GLES3-required behaviour. Fixes GLES3 conformance test "transform_feedback_overflow.test". Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/gles3: Generate error on DrawElements* calls if transform feedback active.Paul Berry2012-12-181-0/+45
| | | | | | | | In GLES3, only glDrawArrays() and glDrawArraysInstanced() calls are allowed when transform feedback is active. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: refactor _mesa_compute_max_transform_feedback_vertices from i965.Paul Berry2012-12-183-12/+38
| | | | | | | | | | | | | | | | | Previously, the i965 driver contained code to compute the maximum number of vertices that could be written without overflowing any transform feedback buffers. This code wasn't driver-specific, and for GLES3 support we're going to need to use it in core mesa. So this patch moves the code into a core mesa function, _mesa_compute_max_transform_feedback_vertices(). Reviewed-by: Ian Romanick <[email protected]> v2: Eliminate C++-style variable declarations, since these won't work with MSVC. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Change args to vbo_count_tessellated_primitives.Paul Berry2012-12-183-17/+24
| | | | | | | | | | | | | | No functional change--this simply paves the way to allow futures patches to call vbo_count_tessellated_primitives() during error checking, before the _mesa_prim struct has been constructed. This will be needed for GLES3, which requires draw calls to fail if there is not enough space available in transform feedback buffers to accommodate the primitives to be drawn. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>