summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-12-12r600g: add some new pci idsHEADmasterAlex Deucher1-0/+10
fixes: https://bugs.freedesktop.org/show_bug.cgi?id=43739 Note: this is a candidate for the stable branches. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-12-12mesa: fix possible precision issues in pack/unpack/fetch functionsMarek Olšák3-16/+16
GLfloat doesn't have enough precision to exactly represent 0xffffff and 0xffffffff. (and a reciprocal of those, if I am not mistaken) If -ffast-math is enabled, using GLfloat causes assertion failures in: - fbo-blit-d24s8 - fbo-depth-sample-compare - fbo-readpixels-depth-formats - glean/depthStencil For example: fbo-depth-sample-compare: main/format_unpack.c:1769: unpack_float_z_Z24_X8: Assertion `dst[i] <= 1.0F' failed. Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-12r300g: integer and fixed-point 16.16 textures are not supportedMarek Olšák1-0/+11
2011-12-12st/mesa: add color varyings to MaxVaryingMarek Olšák1-6/+4
The linker now adds color varyings to the number of used varyings and checks against that limit. NOTE: This is a candidate for the 7.11 branch.
2011-12-11i915g: fix debug dump on 64 bit systemsMichael Karcher1-1/+1
2011-12-11i915g: Fix wrong indices for LINE_LOOP caseFatih Aşıcı1-2/+2
2011-12-11vl: Add missing mpeg fields to pipe_mpeg12_picture_descMaarten Lankhorst2-0/+6
Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-12-11g3dvl/xlib: fix build by changing include orderTobias Droste1-2/+2
fixes the following build error since c83fb4d45f2a47042f395271efe6e5489b2c4aee: /usr/include/strings.h:46:13: error: expected declaration specifiers or ‘...’ before numeric constant /usr/include/strings.h:46:13: error: conflicting types for ‘memset’ In file included from ../../../../src/gallium/winsys/g3dvl/xlib/xsp_winsys.c:34:0: ../../../../src/gallium/auxiliary/util/u_inlines.h: In function ‘pipe_buffer_create’: ../../../../src/gallium/auxiliary/util/u_inlines.h:189:4: error: too many arguments to function ‘memset’ /usr/include/strings.h:46:13: note: declared here bzero is defined in X11 as: #define bzero(b,len) memset(b,0,len) including strings.h after the X11 header results in preprocessor replacing 'bzero' in strings.h and generating unbuildable code. Signed-off-by: Tobias Droste <tdroste@gmx.de>
2011-12-10st/mesa: move frag depth up a level.Dave Airlie2-19/+19
This fixes the segfault, and seems to put this closer to where other properties are being set. Hopefully it still conforms. Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-10Revert "st/mesa: only resolve is number of samples is > 1"Dave Airlie1-1/+1
This reverts commit 8c713626db33c40c18e24c880fe47d7948f4dcd7. Didn't mean to push this at all
2011-12-10st/mesa: only resolve is number of samples is > 1Dave Airlie1-1/+1
This fixes the firefox crash but I've no idea if its correct. Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-10mesa: add missing RG_INTEGER and some RED_INTEGER_EXT checks.Dave Airlie4-0/+21
This just adds the correct checks and asserts in the right places. This doesn't fix all the tests that I've sent to piglit, need to add int paths to go alongside the uint paths that don't go via float to fix it up properly. I'm not sure how much of that could be templated/shared will have a look once I write it the long way. Reviewed-by: Brian Paul <brianp@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-10gallium: implement ARB_conservative_depthMarek Olšák5-1/+50
This adds a new TGSI property to represent the GLSL layout qualifier in TGSI.
2011-12-09util: Add strings.h include on unicesJosé Fonseca1-0/+4
Fixes -Wimplicit-function-declaration for ffs with GCC. Spotted/tested by Kai Wasserbäch.
2011-12-09mesa/st: Don't modify the context draw/read buffers.José Fonseca1-64/+0
It sets the wrong values (GL_XXX_LEFT instead of GL_XXX), and no other Mesa driver does this, given that Mesa sets the right draw/read buffers provided the Mesa visual has the doublebuffer flag filled correctly which is the case. Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-08mesa,intel: use _mesa_image_offset() for PBOsnobled2-15/+19
This avoids forming invalid pointers needlessly, which even if never dereferenced is undefined behavior. It also makes _mesa_validate_pbo_access() more comprehensible. Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-08mesa: add _mesa_image_offset()nobled2-17/+57
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-08mesa/image: assert on bad formatnobled1-11/+9
NULL as an error indicator is meaningless, since it will return NULL on success anyway if the caller passes in zero as the image's address and asks to calculate the offset of the first pixel. For example, _mesa_validate_pbo_access() does this. This also matches the code in the non-GL_BITMAP codepath, which already has an assert like this. v2: Per Brian Paul's review, remove the function call entirely and tighten the assert to only accept the two formats compatible with GL_BITMAP. They always have one component per pixel. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-08mesa/image: delete dead storenobled1-7/+0
The return value here is a) always zero, b) never used. Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-08glsl_to_tgsi: fix a bug in eliminate_dead_code_advanced()Bryan Cain1-10/+8
The bug, reported to me by Vadim Girlin on IRC, was causing overzealous elimination of code in parallel if statements such as the following: if (x) { r = false; } if (y) { r = true; } Before this commit, the assignment inside the first if block would be misdetected as dead code and removed.
2011-12-08llvmpipe: Trim the fragment shader cached based on LLVM IR instruction count.José Fonseca6-11/+62
Number of fragment shader variants is not very representative of the memory used by LLVM, neither is number of shader instructions, as often texture sampling constitutes most of the generated code. This change adds an additional trim criteria: least recently used fragment shader variants will be freed until the total number of LLVM IR instruction falls below a specified threshold. Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-08llvmpipe,draw,gallivm: Ensure we don't walk beyond the end of the shader ↵José Fonseca3-5/+18
variant list. u_simple_list.h uses a sentinel element, and not a NULL element. So ensure list is not empty when reducing the list of shader variants. Something I noticed while trying to free variants more aggressively. Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-08swrast: use malloc instead of MAX_WIDTH arrays in glCopyPixels, zoom codeBrian Paul2-2/+18
Reviewed-by: Jose Fonseca <jfonseca@vmware.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08mesa: use malloc instead of MAX_WIDTH array in glReadPixels()Brian Paul1-9/+14
Reviewed-by: Jose Fonseca <jfonseca@vmware.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08mesa: use malloc instead of MAX_WIDTH array in _mesa_convert_colors()Brian Paul1-1/+7
Reviewed-by: Jose Fonseca <jfonseca@vmware.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08mesa: add MAX_PIXEL_BYTES defineBrian Paul2-0/+10
In a few places we need to allocate space for some number of generic pixels. Use this new define instead of a magic number like 16 or 4 * sizeof(GLuint). Reviewed-by: Jose Fonseca <jfonseca@vmware.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08mesa: simplify _mesa_remove_renderbuffer()Brian Paul1-10/+2
2011-12-08mesa: remove software-based renderbuffer code from core MesaBrian Paul2-2039/+0
We're now using the functions that live in swrast. Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08mesa/drivers: use new swrast renderbuffer functionsBrian Paul12-62/+74
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08mesa: build new s_renderbuffer.c fileBrian Paul2-0/+2
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08swrast: remove core renderbuffer functions from s_renderbuffer.[ch]Brian Paul2-267/+49
We'll use the functions that live in main/ Plus, rename the remaining functions with "swrast_" prefix. Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08swrast: add s_renderbuffer.[ch], copied from main/renderbuffer.[ch]Brian Paul2-0/+2318
Copying these files is the first step in moving the software buffer code from main/renderbuffer.c to swrast/s_renderbuffer.c Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08mesa: remove unused functions in depthstencil.cBrian Paul2-171/+0
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08mesa: make some renderbuffer functions staticBrian Paul2-76/+48
The functions to allocate software color, depth, accum, etc buffers aren't called from anywhere else. Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08swrast: remove dead accum buffer context fieldsBrian Paul2-10/+1
2011-12-08mesa: remove dead swrast and state tracker accum buffer codeBrian Paul5-1049/+0
2011-12-08mesa: rewrite accum buffer supportBrian Paul10-15/+434
Implemented in terms of renderbuffer mapping/unmapping and format packing/unpacking functions. The swrast and state tracker code for implementing accumulation are unused and will be removed in the next commit. v2: don't use memcpy() in _mesa_clear_accum_buffer() v3: don't allocate MAX_WIDTH arrays, be more careful with mapping flags Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08mesa: new format_pack.c codeBrian Paul4-0/+2596
This code packs colors, Z, stencil, etc. in the various mesa pixel formats. Will be used for things like glDrawPixels, glTexImage, glAccum, etc.
2011-12-08mesa: remove the ctx->Driver.IsTextureResident() hookBrian Paul4-30/+5
No driver implemented this and we always returned "True" for residence queries. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-08mesa: remove TextureMemCpy driver hookBrian Paul4-69/+2
There's probably no reason to use a special version of memcpy() anymore.
2011-12-08st/mesa: Use util_blit_pixels_writemask() for depth blits as well in ↵Henri Verbeet1-81/+89
st_copy_texsubimage(). This has no piglit regressions on r600g and softpipe. Signed-off-by: Henri Verbeet <hverbeet@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-08st/xa: Update xa_yuv_planar_blit semanticsThomas Hellstrom5-12/+16
Change and document the interpretation of the color conversion matrix in order to make the function more versatile and to simplify the generated shader. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-12-07i965 gen6: Implement pass-through GS for transform feedback.Paul Berry6-46/+208
In Gen6, transform feedback is accomplished by having the geometry shader send vertex data to the data port using "Streamed Vertex Buffer Write" messages, while simultaneously passing vertices through to the rest of the graphics pipeline (if rendering is enabled). This patch adds a geometry shader program that simply passes vertices through to the rest of the graphics pipeline. The rest of transform feedback functionality will be added in future patches. To make the new geometry shader easier to test, I've added an environment variable "INTEL_FORCE_GS". If this environment variable is enabled, then the pass-through geometry shader will always be used, regardless of whether transform feedback is in effect. On my Sandy Bridge laptop, I'm able to enable INTEL_FORCE_GS with no Piglit regressions. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Acked-by: Eric Anholt <eric@anholt.net>
2011-12-07i965: Clean up misleading defines for DWORD 2 of URB_WRITE header.Paul Berry5-24/+59
R02_PRIM_END and R02_PRIM_START don't actually refer to bits in DWORD 2 of R0 (as the name, and comments in the code, would seem to indicate). Actually they refer to bits in DWORD 2 of the header for URB_WRITE messages. This patch renames the defines to reflect what they actually mean. It also addes a define URB_WRITE_PRIM_TYPE_SHIFT, which previously was just hardcoded in .c files. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-07i965 gs: Clean up dodgy register re-use, at the cost of a few MOVs.Paul Berry2-65/+111
Prior to this patch, in the Gen4 and Gen5 GS, we used GRF 0 (called "R0" in the code) as a staging area to prepare the message header for the FF_SYNC and URB_WRITE messages. This cleverly avoided an unnecessary MOV operation (since the initial value of GRF 0 contains data that needs to be included in the message header), but it made the code confusing, since GRF 0 could no longer be relied upon to contain its initial value once the GS started preparing its first message. This patch avoids confusion by using a separate register ("header") as the staging area, at the cost of one MOV instruction. Worse yet, prior to this patch, the GS would completely overwrite the contents of GRF 0 with the writeback data it received from a completed FF_SYNC or URB_WRITE message. It did this because DWORD 0 of the writeback data contains the new URB handle, and that neds to be included in DWORD 0 of the next URB_WRITE message header. However, that caused the rest of the message header to be corrupted either with undefined data or zeros. Astonishingly, this did not produce any known failures (probably by dumb luck). However, it seems really dodgy--corrupting FFTID in particular seems likely to cause GPU hangs. This patch avoids the corruption by storing the writeback data in a temporary register and then copying just DWORD 0 to the header for the next message. This costs one extra MOV instruction per message sent, except for the final message. Also, this patch moves the logic for overriding DWORD 2 of the header (which contains PrimType, PrimStart, PrimEnd, and some other data that we don't care about yet). This logic is now in the function brw_gs_overwrite_header_dw2() rather than in brw_gs_emit_vue(). This saves one MOV instruction in brw_gs_quads() and brw_gs_quad_strip(), and paves the way for the Gen6 GS, which will need more complex logic to override DWORD 2 of the header. Finally, the function brw_gs_alloc_regs() contained a benign bug: it neglected to increment the register counter when allocating space for the "temp" register. This turned out not to have any effect because the temp register wasn't used on Gen4 and Gen5, the only hardware models (so far) to require a GS program. Now, all the registers allocated by brw_gs_alloc_regs() are actually used, and properly accounted for. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-07i965 gen6: Allocate URB space for GSPaul Berry3-12/+63
When the GS is not in use, the entire URB space is available for the VS. When the GS is in use, we split the URB space 50/50. The 50/50 split is probably not optimal--we'll probably want tune this for performance in a future patch. For example, in most situations, it's probably worth allocating more than 50% of the space to the VS, since VS space is used for vertex caching. But for now this is good enough. Based on previous work by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-07i965: Set the maximum number of GS URB entries on Sandybridge.Kenneth Graunke1-0/+2
We never filled this in before because we didn't care. I'm skeptical these are correct; my sources indicate that both the VS and GS # of entries are 256 on both GT1 and GT2. I'm also loathe to change it and break stuff. Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-12-07i965: Only convert if/else to conditional adds prior to Gen6.Paul Berry1-2/+28
Normally when outputting instructions in SPF (single program flow) mode, we convert IF and ELSE instructions to conditional ADD instructions applied to the IP register. On platforms prior to Gen6, flow control instructions cause an implied thread switch, so this is a significant savings. However, according to the SandyBridge PRM (Volume 4 part 2, p79): [Errata DevSNB{WA}] - When SPF is ON, IP may not be updated by non-flow control instructions. So we have to disable this optimization on Gen6. On later platforms, there is no significant benefit to converting flow control instructions to ADDs, so for the sake of consistency, this patch disables the optimization on later platforms too. The reason we never noticed this problem before is that so far we haven't needed to use SPF mode on Gen6. However, later patches in this series will introduce a Gen6 GS program which uses SPF mode. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-07i965 gs: Remove unnecessary mapping of key->primitive.Paul Berry2-16/+7
Previously, GS generation code contained a lookup table that mapped primitive types POLYGON, TRISTRIP, and TRIFAN to TRILIST, mapped LINESTRIP to LINELIST, and left all other primitives unchanged. This was silly, because we never generate a GS program for those primitive types anyhow. This patch removes the unnecessary lookup table. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-07mesa: Track changes to transform feedback state.Paul Berry2-1/+9
This patch adds a new bit to the ctx->NewState bitfield, _NEW_TRANSFORM_FEEDBACK, to track state changes that affect ctx->TransformFeedback. This bit can be used by driver back-ends to avoid expensive recomputations when transform feedback state has not been modified. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net>