summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* gallium/tests: fix build breakage after pipe_surface::usage removalMarek Olšák2012-12-211-1/+0
|
* 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]>
* util/u_format: Round when converting depth values from float to z16_unorm.José Fonseca2012-12-211-1/+1
| | | | | | This makes the z16_unorm -> float -> z16_unorm conversion lossless. Reviewed-by: Roland Scheidegger <[email protected]>
* r600g: add cs tracing infrastructure for lockup pin pointingJerome Glisse2012-12-205-2/+106
| | | | | | | | It's a build time option you need to set R600_TRACE_CS to 1 and it will print to stderr all cs along as cs trace point value which gave last offset into a cs process by the GPU. Signed-off-by: Jerome Glisse <[email protected]>
* r600g: add htile support v16Jerome Glisse2012-12-2010-24/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | htile is used for HiZ and HiS support and fast Z/S clears. This commit just adds the htile setup and Fast Z clear. We don't take full advantage of HiS with that patch. v2 really use fast clear, still random issue with some tiles need to try more flush combination, fix depth/stencil texture decompression v3 fix random issue on r6xx/r7xx v4 rebase on top of lastest mesa, disable CB export when clearing htile surface to avoid wasting bandwidth v5 resummarize htile surface when uploading z value. Fix z/stencil decompression, the custom blitter with custom dsa is no longer needed. v6 Reorganize render control/override update mecanism, fixing more issues in the process. v7 Add nop after depth surface base update to work around some htile flushing issue. For htile to 8x8 on r6xx/r7xx as other combination have issue. Do not enable hyperz when flushing/uncompressing depth buffer. v8 Fix htile surface, preload and prefetch setup. Only set preload and prefetch on htile surface clear like fglrx. Record depth clear value per level. Support several level for the htile surface. First depth clear can't be a fast clear. v9 Fix comments, properly account new register in emit function, disable fast zclear if clearing different layer of texture array to different value v10 Disable hyperz for texture array making test simpler. Force db_misc_state update when no depth buffer is bound. Remove unused variable, rename depth_clearstencil to depth_clear. Don't allocate htile surface for flushed depth. Something broken the cliprect change, this need to be investigated. v11 Rebase on top of newer mesa v12 Rebase on top of newer mesa v13 Rebase on top of newer mesa, htile surface need to be initialized to zero, somehow special casing first clear to not use fast clear and thus initialize the htile surface with proper value does not work in all case. v14 Use resource not texture for htile buffer make the htile buffer size computation easier and simpler. Disable preload on evergreen as its still troublesome in some case v15 Cleanup some comment and remove some left over v16 Define name for bit 20 of CP_COHER_CNTL Signed-off-by: Pierre-Eric Pelloux-Prayer <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Signed-off-by: Jerome Glisse <[email protected]>
* r600g: rework flusing and synchronization pattern v7Jerome Glisse2012-12-208-162/+89
| | | | | | | | | | | | | | | This bring r600g allmost inline with closed source driver when it comes to flushing and synchronization pattern. v2-v4: history lost somewhere in outer space v5: Fix compute size of flushing, use define for flags, update worst case cs size requirement for flush, treat rs780 and newer as r7xx when it comes to streamout. v6: Fix num dw computation for framebuffer state, remove dead code, use define instead of hardcoded value. v7: Remove dead code Signed-off-by: Jerome Glisse <[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]>
* llvmpipe: Drop PIPE_QUERY_TIME_ELAPSED support.José Fonseca2012-12-203-13/+1
| | | | | | | | | | | | | | | | | It was slightly wrong: we were computing the longest duration of the query among all the rasterizer tasks. Regardless, for tile-based implementations such as llvmpipe, time differences will never be very useful, because rendering before/during/after the query is all interleaved. And this is expected, see ARB_timer_query spec, issue 10. In particular, piglit ext_timer_query-time-elapsed still fails, because it makes assumptions that don't hold true in in tiled architectures. Not sure how to fix that though. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Brian Paul <[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-2014-15/+15
| | | | | | | | 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]>
* r600g: add assertions to prevent creation of invalid surfacesMarek Olšák2012-12-203-16/+18
|
* r600g: refactor and make streamout dumping more informativeMarek Olšák2012-12-201-12/+21
| | | | Reviewed-by: Dave Airlie <[email protected]>
* r600g: try to fix streamout for the cases where BURST_COUNT > 0Marek Olšák2012-12-201-1/+1
| | | | | | | | | | The burst was incorrectly used, because ELEM_SIZE was always 0. I don't know if the burst works, because I don't know of any test which uses it. NOTE: This is a candidate for the stable branches. Reviewed-by: Dave Airlie <[email protected]>
* r600g: lower stream outputs with dst_offset < start_componentMarek Olšák2012-12-201-7/+47
| | | | | | This fixes streamout breakage caused by the varying packing. Reviewed-by: Dave Airlie <[email protected]>
* r600g: use r600_get_temp to get temporaries for CLIPDIST shader outputsMarek Olšák2012-12-201-3/+11
| | | | | | I need this to be able to use r600_get_temp in the function later. Reviewed-by: Dave Airlie <[email protected]>
* softpipe: fix up FS variant unbinding / deletionBrian Paul2012-12-193-11/+9
| | | | | | | | | | | | The old call to tgsi_exec_machine_bind_shader() in softpipe_delete_fs_state() was never called since the shader's original tokens are never passed to the tgsi interpreter (only shader _variant_ tokens are). Now, unbind the variant's tokens from the tgsi interpreter when we free the variant. This doesn't fix any known bugs but it's the right thing to do. Note: This is a candidate for the stable branches.
* softpipe: fix unreliable FS variant binding bugBrian Paul2012-12-193-14/+10
| | | | | | | | | | | | | In exec_prepare() we were comparing pointers to see if the fragment shader variant had changed before calling tgsi_exec_machine_bind_shader(). This didn't work reliably when there was a lot of shader token malloc/ freeing going on because the memory might get reused. Instead, bind the shader variant during regular state validation. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=40404 (fixes a couple of piglit's glsl-max-varyings test) Note: This is a candidate for the stable branches.
* Revert "r600g: work around ddx over alignment"Jerome Glisse2012-12-191-9/+3
| | | | | | This reverts commit d8287bac1fd4a77abc2db38de134f14176740d23. Cause more issue than it fix. Need to think of a proper solution.
* r600g: work around ddx over alignmentJerome Glisse2012-12-181-3/+9
| | | | | | | | | This force surface allocated from ddx to be consider as height aligned on 8 and fix 1D->2D tiling transition that result from this. Signed-off-by: Jerome Glisse <[email protected]> Reviewed-by: Marek Olšák <[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]>
* radeon/llvm: improve cube map handlingVadim Girlin2012-12-184-22/+84
| | | | | | | | Add support for TEX2, TXB2, TXL2, fix SHADOWCUBE Signed-off-by: Vadim Girlin <[email protected]> Reviewed-by: Michel Dänzer <[email protected]> Tested-by: Michel Dänzer <[email protected]>
* radeon/llvm: fix TXQ_LZ handling for cube mapsVadim Girlin2012-12-181-2/+4
| | | | Signed-off-by: Vadim Girlin <[email protected]>
* r600g: initialize inst_mod in r600_tex_from_byte_streamVadim Girlin2012-12-181-0/+2
| | | | Signed-off-by: Vadim Girlin <[email protected]>
* gallivm: fix conversion for pure integer formatsRoland Scheidegger2012-12-181-0/+1
| | | | | | | | | | | Since the idea is to just expand or shrink the bit width but not otherwise do conversion we also need to adjust the sign bit according to src, otherwise the conversion code will incorrectly clamp the values. (Since this only works for casting to ordinary floats the norm and fixed bits should always be fine.) This fixes the remaining piglit attribs GL3 failures. Reviewed-by: José Fonseca <[email protected]>
* glsl: Fix gl_context vs. ralloc context in check_version again, again.Kenneth Graunke2012-12-171-2/+2
| | | | | | Dave found some, but there were more. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58039
* vega: fix for object handle leakAndreas Pokorny2012-12-174-1/+8
| | | | | | | | frees the object handle when a OpenVG is destroyed. Signed-off-by: Andreas Pokorny <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* wmesa: include version.h to silence warningBrian Paul2012-12-171-0/+1
|
* xlib: include headers to fix errors/warningsBrian Paul2012-12-171-0/+2
|
* mesa osmesa/x11: fix build error introduced in 4bea4cb9Jordan Justen2012-12-172-8/+8
| | | | | | | Fixes https://bugs.freedesktop.org/show_bug.cgi?id=58380 Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallivm: fix texel fetch for array textures (2)Roland Scheidegger2012-12-171-2/+3
| | | | | | | | a460aea3f14222af46f88d1bc686f82180b8a872 wasn't entirely correct, since all coords are already ints hence need to skip the iround. Passes piglit texelFetch with sampler1DArray/sampler2DArray. Reviewed-by: Dave Airlie <[email protected]>
* mesa: assert if driver did not compute the versionJordan Justen2012-12-163-1/+4
| | | | | | | | | | Make sure drivers initialize the version before: * _mesa_initialize_exec_table is called * _mesa_initialize_exec_table_vbo is called * A context is made current Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: don't initialize VBO vtxfmt in _vbo_CreateContextJordan Justen2012-12-164-10/+0
| | | | | | | | The driver should call _mesa_initialize_vbo_vtxfmt after computing the context version. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: don't initialize exec dispatch tables in _mesa_initialize_contextJordan Justen2012-12-161-3/+0
| | | | | | | | Drivers must compute the context version, and then call _mesa_initialize_exec_table themselves. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa dispatch_sanity: call new functions to initialize exec tableJordan Justen2012-12-161-1/+6
| | | | | | | | | | | In a future patch the exec functions will no longer set up by _mesa_initialize_context and _vbo_CreateContext. Therefore we must call _mesa_initialize_exec_table and _mesa_initialize_exec_table_vbo. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* drivers: compute version and then initialize exec tableJordan Justen2012-12-1612-2/+81
| | | | | | | | This change forces the context version to be computed before initilizing the exec dispatch tables. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* vbo: add _mesa_initialize_vbo_vtxfmtJordan Justen2012-12-162-0/+19
| | | | | | | | This function initializes the exec/save dispatch tables for VBO vtxfmt. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: separate exec allocation from initializationJordan Justen2012-12-163-16/+15
| | | | | | | | | | | | | | | | | | | In glapi/gl_genexec.py: * Remove _mesa_alloc_dispatch_table call In glapi/gl_genexec.py and api_exec.h: * Rename _mesa_create_exec_table to _mesa_initialize_exec_table In context.c: * Call _mesa_alloc_dispatch_table instead of _mesa_create_exec_table * Call _mesa_initialize_exec_table (this is temporary) Once all drivers have been modified to call _mesa_initialize_exec_table, then the call to _mesa_initialize_context can be removed from context.c. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* r600g: fixup offset types for printingDave Airlie2012-12-162-4/+4
| | | | | | This allows the debug code to at least show the sign properly. Signed-off-by: Dave Airlie <[email protected]>
* gallium/u_blitter: Remove the overlapped blit assert from ↵Henri Verbeet2012-12-161-28/+0
| | | | | | | | | | | | util_blitter_blit_generic(). This is used by st_BlitFramebuffer() / r600_blit(), and ARB_fbo allows overlapped blits, even though the result is undefined. No piglit regressions on r600g / CYPRESS. Signed-off-by: Henri Verbeet <[email protected]> Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* glsl_parser_extras.cpp: fixup gl vs mem contexts again.Dave Airlie2012-12-161-4/+4
| | | | | | | | | This should fix: https://bugs.freedesktop.org/show_bug.cgi?id=58039 Tested-by: Darxus on bug 58039 Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* i965: Move BRW_MAX_GRF and similar defines to brw_reg.h.Kenneth Graunke2012-12-152-18/+17
| | | | | | These don't really belong in brw_structs.h. Reviewed-by: Eric Anholt <[email protected]>
* i965: Split struct brw_reg out from brw_eu.h into its own header.Kenneth Graunke2012-12-152-709/+778
| | | | | | | | | | | | | | | | | | | struct brw_instruction and the related instruction emitting code won't be useful on Gen8+, as the instruction encoding changed. However, the struct brw_reg code is still extremely valuable. While we're at it, fix up some style points: - s/GLuint/unsigned/g - s/GLint/int/g - s/GLshort/int16_t/g - s/GLushort/uint16_t/g - s/INLINE/inline/g - Replace tabs with spaces - Put return types on a separate line from the function name/parameters - Remove trailing whitespace - Remove extraneous whitespace around function parameters Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: add texture buffer object rgb32 support.Dave Airlie2012-12-161-1/+13
| | | | | | | This checks if the pipe driver can support RGB32 formats. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: add support for ARB_texture_buffer_object_rgb32Dave Airlie2012-12-163-0/+15
| | | | | | | | | | This adds the extensions + the tex buffer support for checking the formats. There is a piglit test enhancement sent to that list. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>