summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Convert piles of foreach_iter to foreach_list_safe.Kenneth Graunke2014-01-1312-36/+36
| | | | | | | | | In these cases, we edit the list (or at least might be), so we use the foreach_list_safe variant. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Convert piles of foreach_iter to the newer foreach_list macro.Kenneth Graunke2014-01-1326-178/+170
| | | | | | | | | | | | | foreach_iter and exec_list_iterators have been deprecated for some time now; we just hadn't ever bothered to convert code to the newer foreach_list and foreach_list_safe macros. In these cases, we aren't editing the list, so we can use foreach_list rather than foreach_list_safe. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: Ensure that all necessary state is re-emitted if we run out of aperture.Paul Berry2014-01-133-0/+21
| | | | | | | | | | | | | | | | | | | | | Prior to this patch, if we ran out of aperture space during brw_try_draw_prims(), we would rewind the batch buffer pointer (potentially throwing some state that may have been emitted by brw_upload_state()), flush the batch, and then try again. However, we wouldn't reset the dirty bits to the state they had before the call to brw_upload_state(). As a result, when we tried again, there was a danger that we wouldn't re-emit all the necessary state. (Note: prior to the introduction of hardware contexts, this wasn't a problem because flushing the batch forced all state to be re-emitted). This patch fixes the problem by leaving the dirty bits set at the end of brw_upload_state(); we only clear them after we have determined that we don't need to rewind the batch buffer. Cc: 10.0 9.2 <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* r600g: fix glClearBuffer by handling PIPE_CLEAR_COLORi flags correctlyMarek Olšák2014-01-131-38/+31
| | | | also restructure the code
* r600g: handle NULL colorbuffers correctly on R600-R700Marek Olšák2014-01-131-65/+55
|
* r600g: handle NULL colorbuffers correctly on EvergreenMarek Olšák2014-01-132-28/+54
|
* radeonsi: handle NULL colorbuffers correctlyMarek Olšák2014-01-131-9/+11
| | | | Reviewed-by: Michel Dänzer <[email protected]>
* gallium/util: easy fixes for NULL colorbuffersMarek Olšák2014-01-132-1/+7
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: bind NULL colorbuffers as specified by glDrawBuffersMarek Olšák2014-01-136-14/+40
| | | | | | | | | | | | | | | | | | | | An example why it is required: Let's say there's a fragment shader writing to gl_FragData[0..1]. The user calls: glDrawBuffers(2, {GL_NONE, GL_COLOR_ATTACHMENT0}); That means gl_FragData[0] is unused and gl_FragData[1] is written to GL_COLOR_ATTACHMENT0. st/mesa was skipping the GL_NONE draw buffer, therefore gl_FragData[0] was written to GL_COLOR_ATTACHMENT0, which was wrong. This commit fixes it, but drivers must also be fixed not to crash when binding NULL colorbuffers. There is also a new set of piglit tests for this. The MSAA state also had to be fixed not to crash when reading fb->cbufs[0]. Reviewed-by: Brian Paul <[email protected]>
* mesa: handle GL_NONE draw buffers correctly in glClearMarek Olšák2014-01-131-1/+5
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: use sRGB formats for MSAA resolving if destination is sRGBMarek Olšák2014-01-131-0/+32
| | | | | | Copied from the i965 driver, including the big comment. Cc: 9.2 10.0 <[email protected]>
* st/mesa: check depth and stencil writemask before clearingMarek Olšák2014-01-131-2/+15
|
* st/mesa: always prefer pipe->clear over clear_with_quad (v2)Marek Olšák2014-01-131-5/+14
| | | | v2: clear depth and stencil together
* st/egl: Flush resources before presentationMartin Andersson2014-01-133-0/+24
| | | | | | | Fixes wayland regression on r600g due to fast clear introduced by commit edbbfac6. Signed-off-by: Marek Olšák <[email protected]>
* dri: set yInverted default to GL_TRUETapani Pälli2014-01-131-0/+1
| | | | | | | | | | | | yInverted is used by EGL_NOK_texture_from_pixmap to indicate that window system rendering is y-inverted compared to OpenGL texture representation. This extension is only known to be used with X11 window system where sane default is GL_TRUE. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73371 Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl_dri2: call dri2_add_configs_for_visuals after extensions setTapani Pälli2014-01-131-5/+6
| | | | | | | | dri2_add_config makes decisions based on NOK_texture_from_pixmap so it needs to be enabled before calling dri2_add_configs_for_visuals. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa: Set the correct error in _mesa_BeginConditionalRenderIan Romanick2014-01-101-11/+30
| | | | | | | | | | | | Piglit was recently changed to expect the correct error code (piglit commit 271b998), so it started failing on Mesa. This corrects that failing and adds some spec quotations to justify the errrors set. The code was rearranged a little bit to match the order listed in the spec. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965: Delete duplicate write_timestamp function.Kenneth Graunke2014-01-103-39/+8
| | | | | | | | | | brw_queryobj.c needs a version of write_timestamp that works on all generations for the QueryCounter() driver hook. So there's no point in duplicating it in gen6_queryobj.c. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Fix clears of layered framebuffers with mismatched layer counts.Paul Berry2014-01-108-30/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, Mesa enforced the following rule (from ARB_geometry_shader4's list of criteria for framebuffer completeness): * If any framebuffer attachment is layered, all attachments must have the same layer count. For three-dimensional textures, the layer count is the depth of the attached volume. For cube map textures, the layer count is always six. For one- and two-dimensional array textures, the layer count is simply the number of layers in the array texture. { FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB } However, when ARB_geometry_shader4 was adopted into GL 3.2, this rule was dropped; GL 3.2 permits different attachments to have different layer counts. This patch brings Mesa in line with GL 3.2. In order to ensure that layered clears properly clear all layers, we now have to keep track of the maximum number of layers in a layered framebuffer. Fixes the following piglit tests in spec/!OpenGL 3.2/layered-rendering: - clear-color-all-types 1d_array mipmapped - clear-color-all-types 1d_array single_level - clear-color-mismatched-layer-count - framebuffer-layer-count-mismatch Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
* main: check texture target when validating layered framebuffers.Paul Berry2014-01-101-3/+9
| | | | | | | | | | | | | | From section 4.4.4 (Framebuffer Completeness) of the GL 3.2 spec: If any framebuffer attachment is layered, all populated attachments must be layered. Additionally, all populated color attachments must be from textures of the same target. We weren't checking that the attachments were from textures of the same target. Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
* i965/gen6/blorp: Remove redundant HiZ workaroundChad Versace2014-01-091-14/+0
| | | | | | | | | | | | | | | Commit 1a92881 added extra flushes to fix a HiZ hang in WebGL Google Maps. With the extra flushes emitted by the previous two patches, the flushes added by 1a92881 are redundant. Tested with the same criteria as in 1a92881: by zooming in and out continuously for 2 hours on Sandybridge Chrome OS (codename Stumpy) without a hang. CC: Kenneth Graunke <[email protected]> CC: Stéphane Marchesin <[email protected]> Reviewed-by: Paul Berry <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* i965/gen6/blorp: Set need_workaround_flush at top of blorpChad Versace2014-01-091-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unconditionally set brw->need_workaround_flush at the top of gen6 blorp state emission. The art of emitting workaround flushes on Sandybridge is mysterious and not fully understood. Ken and I believe that intel_emit_post_sync_nonzero_flush() may be required when switching from regular drawing to blorp. This is an extra safety measure to prevent undiscovered difficult-to-diagnose gpu hangs. I verified that on ChromeOS, pre-patch, need_workaround_flush was not set at the top of blorp, as Paul expected. To verify, I inserted the following debug code at the top of gen6_blorp_exec(), restarted the ui, and inspected the logs in /var/log/ui. The abort gets triggered so early that the browser never appears on the display. static void gen6_blorp_exec(...) { if (!brw->need_workaround_flush) { fprintf(stderr, "chadv: %s:%d\n", __FILE__, __LINE__); abort(); } ... } CC: Kenneth Graunke <[email protected]> CC: Stéphane Marchesin <[email protected]> Reviewed-by: Paul Berry <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* i965/gen6/blorp: Set need_workaround_flush immediately after primitiveChad Versace2014-01-092-1/+3
| | | | | | | | | | | | | | | | | | | | This patch makes the workaround code in gen6 blorp follow the pattern established in the regular draw path. It shouldn't result in any behavioral change. On gen6, there are two places where we emit 3D_CMD_PRIM: brw_emit_prim() and gen6_blorp_emit_primitive(). brw_emit_prim() sets need_workaround_flush immediately after emitting the primitive, but blorp does not. Blorp sets need_workaround_flush at the bottom of brw_blorp_exec(). This patch moves the need_workaround_flush from brw_blorp_exec() to gen6_blorp_emit_primitive(). There is no need to set need_workaround_flush in gen7_blorp_emit_primitive() because the workaround applies only to gen6. Reviewed-by: Paul Berry <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* docs: Import 10.0.2 release notes, add news item.Carl Worth2014-01-093-1/+169
|
* mesa: add missing SNORM formats in _mesa_base_fbo_format()Brian Paul2014-01-091-0/+16
| | | | | | | | | | | | We weren't handling the LUMINANCE_SNORM, LUMINANCE_ALPHA_SNORM and INTENSITY_SNORM cases. Note that adding these cases here does not require a driver to support rendering to these surface types. If the driver can't do it we'll report an incomplete framebuffer. NVIDIA doesn't support GL_EXT_texture_snorm but their driver accepts these formats in glRenderBufferStorage(). Reviewed-by: Jose Fonseca <[email protected]>
* mesa: remove dead geom shader codeBrian Paul2014-01-091-4/+0
| | | | | | I doubt the swrast-based drivers will ever support GS. Reviewed-by: Matt Turner <[email protected]>
* docs: minor updates to VMware SVGA3D driver pageBrian Paul2014-01-091-3/+11
| | | | Signed-off-by: Brian Paul <[email protected]>
* mesa: check bits per channel for GL_RGBA_SIGNED_COMPONENTS_EXT queryBrian Paul2014-01-091-7/+30
| | | | | | | | | | | If a channel has zero bits it's not signed. v2: also check for luminance and intensity format bits. Bruce Merry's proposed piglit test hits the luminance case. Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=73096 Cc: 10.0 <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: check for MESA_FORMAT_RGB9_E5_FLOAT in _mesa_is_format_signed()Brian Paul2014-01-091-2/+3
| | | | | | | | | | This packed floating point format only stores positive values. Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=73096 Cc: 10.0 <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* st/mesa: fix breakage from gl_constant::Program[] changeBrian Paul2014-01-091-13/+13
|
* mesa: Use functions to convert gl_shader_stage to PROGRAM enum or pipe target.Paul Berry2014-01-093-36/+39
| | | | | | | | Suggested-by: Brian Paul <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> v2: Improve assert message.
* main: Change init_program_limits() to use gl_shader_stage.Paul Berry2014-01-091-9/+9
| | | | | | | | This allows the caller to execute it in a loop rather than hand-rolling a separate call for each stage. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Index into ctx->Const.Program[] rather than using ad-hoc code.Paul Berry2014-01-094-87/+17
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Index into ctx->Const.Program[] rather than using ad-hoc code.Paul Berry2014-01-091-15/+2
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: replace ctx->Const.{Vertex,Fragment,Geomtery}Program with an array.Paul Berry2014-01-0938-305/+303
| | | | | | | | | | | | | | | | | | | | These are replaced with ctx->Const.Program[MESA_SHADER_{VERTEX,FRAGMENT,GEOMETRY}]. In patches to follow, this will allow us to replace a lot of ad-hoc logic with a variable index into the array. With the exception of the changes to mtypes.h, this patch was generated entirely by the command: find src -type f '(' -iname '*.c' -o -iname '*.cpp' -o -iname '*.py' \ -o -iname '*.y' ')' -print0 | xargs -0 sed -i \ -e 's/Const\.VertexProgram/Const.Program[MESA_SHADER_VERTEX]/g' \ -e 's/Const\.GeometryProgram/Const.Program[MESA_SHADER_GEOMETRY]/g' \ -e 's/Const\.FragmentProgram/Const.Program[MESA_SHADER_FRAGMENT]/g' Suggested-by: Brian Paul <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* llvmpipe: Honour pipe_rasterizer::point_quad_rasterization.José Fonseca2014-01-091-10/+57
| | | | | | | | | | | | Commit eda21d2a3010d9fc5a68b55a843c5e44b2abf8dd fixed the rasterization of points for Direct3D but ended up breaking the rasterization of OpenGL non-sprite points, in particular conform's pntrast.c test. The only way to get both working is to properly honour pipe_rasterizer::point_quad_rasterization, and follow the weird OpenGL rule when it is false. Reviewed-by: Roland Scheidegger <[email protected]>
* i965: Don't do the temporary-and-blit-copy for INVALIDATE_RANGE maps.Eric Anholt2014-01-091-1/+2
| | | | | | | | | | | | | | | | We definitely want to fall through to the unsynchronized map case, instead of wasting bandwidth on a copy. Prevents a -43.2407% +/- 1.06113% (n=49) performance regression on aa10perf when teaching glamor to provide the GL_INVALIDATE_RANGE_BIT information. This is a performance fix, which I usually wouldn't cherry-pick to stable. But this was really was just a bug in the code, its presence would discourage developers from giving us the best information they can, and I think we've got fairly high confidence in the unsynchronized map path already. Cc: 10.0 9.2 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Fix handling of MESA_pack_invert in blit (PBO) readpixels.Eric Anholt2014-01-091-1/+3
| | | | | | | | | | Fixes piglit GL_MESA_pack_invert/readpixels and GPU hangs with glamor and cairo-gl. Cc: 10.0 9.2 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* i965: Fix incorrect bounds tracking for blit readpixels's GPU access.Eric Anholt2014-01-091-2/+1
| | | | | | | | | | | While incorrect, it probably wouldn't affect anyone ever: You'd have to do an appropriately-formatted readpixels into a PBO, then overwrite the tail end of the updated area of the PBO with glBufferSubData(), and you wouldn't get appropriate synchronization. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* i965: Use SET_FIELD to safety check our x/y offsets in blits.Eric Anholt2014-01-092-7/+14
| | | | | | | | | | | | | | The earlier assert made sure that our math didn't exceed our bounds, but this makes sure that we don't overflow from the high bits X into the low bits of Y. We've already put checks in intel_miptree_blit(), but I've wanted to expand the type in our protoype from short to uint32_t, and we could get in trouble with intel_emit_linear_blit() if we did. v2: Add Ken's comment about the funny language extension used. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> (v1) Reviewed-by: Anuj Phogat <[email protected]> (v1)
* i965: Add an assert for when SET_FIELD's value exceeds the field size.Eric Anholt2014-01-091-1/+7
| | | | | | | | | This was one of the things we always wanted to do to this, to make it more useful than just (value << FIELD_MASK). Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* i965: Add a safety check for emitting blits.Eric Anholt2014-01-091-0/+4
| | | | | | | | | | | | With all of the flipping and pitch twiddling and miptree layout involved in our blits, there are lots of ways for us to scribble outside of a buffer. Put in a check that we're not about to do so. This catches a bug that glamor was running into. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* i965: Don't call the blitter on addresses it can't handle.Eric Anholt2014-01-092-3/+40
| | | | | | | | | Noticed by tex3d-maxsize on my next commit to check that our addresses don't overflow. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: Namespace qualify fma to override ambiguity with fma from math.hThomas Sondergaard2014-01-081-1/+1
| | | | | | | MSVC 2013 version of math.h includes an fma() function. Cc: "10.0" <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Work around internal compiler errorThomas Sondergaard2014-01-081-2/+2
| | | | | | | | | This small rearrangement avoids MSVC 2013 ICE. Also, this should be a better memory access order. Cc: "10.0" <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix compile error with MSVC 2013Thomas Sondergaard2014-01-081-1/+1
| | | | | | | | | This fixes the following compile error: src\glsl\ir_constant_expression.cpp(1405) : error C2666: 'copysign' : 3 overloads have similar conversions Cc: "10.0" <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Preliminary support for MSVC_VERSION=12.0Thomas Sondergaard2014-01-081-1/+1
| | | | | Cc: "10.0" <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* freedreno: add basic query supportRob Clark2014-01-088-1/+275
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add for now some simple/basic query support (ie. things not actually requiring the GPU). Might change around a bit when I actually add GPU queries, but for now this enables some useful performance info in the GALLIUM_HUD. For example: GALLIUM_HUD=fps+batches+batches-sysmem+batches-gmem+restores,draw-calls The driver specific specific queries are: + draw-calls + batches - number of batches per second, sum of batches-sysmem plus batches-gmem + batches-gmem - render a set of tiles in GMEM, for each tile (optionally) system mem -> gmem (restore), plus N draws, plus gmem -> system mem (resolve) per second + batches-sysmem - N draws to system memory (GMEM bypass) per second + restores - number of GMEM batches that required restore per second Ideally for GMEM rendering, you want batches-gmem to equal fps. If the app is doing something that triggers multiple passes (ie. requires extra round trip gmem <-> system memory) then the # of batches per second will go up relative to fps. Signed-off-by: Rob Clark <[email protected]>
* freedreno/a3xx: use cs patch instead of RFI+RMWRob Clark2014-01-088-52/+46
| | | | | | | | Since we now have the cmdstream patch mechanism needed for hw binning, might as well also use it for RB_RENDER_CONTROL updates. This avoids the need to use RMW (and associated WFI) to update RB_RENDER_CONTROL. Signed-off-by: Rob Clark <[email protected]>
* freedreno/a3xx: support for hw binning passRob Clark2014-01-0816-159/+707
| | | | | | | | | | | | | | | | | | | | | | | The binning pass sorts vertices into which bins/tiles they apply to. The visibility information generated during the binning pass can be used to speed up the rendering pass by filtering out vertices which do not apply to the current tile. See: https://github.com/freedreno/freedreno/wiki/Adreno-tiling#optimized-approach This brings a significant fps boost. A rough assortment of tests (supertuxkart, etracer, tremulous, glmark2 'build' test, etc) seems to yield a ~35-45% fps improvement. For now, to be conservative, the binning pass is not enabled yet by default. To enable it use: FD_MESA_DEBUG=binning So far I haven't found anything that breaks with binning enabled, but I'd like a bit more testing before I enable it as default. Signed-off-by: Rob Clark <[email protected]>