summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* i965/gen5: Fix rendering of depth buffers without stencil [v2]Chad Versace2012-01-171-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | Fixes the following OGLConform tests on gen5: depth-stencil(misc.state_on.depth_int) fbo_db_ARBfp(basic.OnlyDepthBuffDrawBufferRender) The problem was that, if the depth buffer's Mesa format was X8_Z24, then we emitted the hardware format D24_UNORM_X8. But, on gen5, D24_UNORM_S8 must be emitted. This bug was introduced by: commit d84a180417d1eabd680554970f1eaaa93abcd41e Author: Eric Anholt <[email protected]> i965: Base HW depth format setup based on MESA_FORMAT, not bpp. v2: Deref 'intel' directly. Move the branch for newer chipset to top. Quote the PRM. As requested by Ken. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43408 Note: This is a candidate for the 8.0 branch. Reported-by: Xunx Fang <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* intel: Return if pointer to intel_context is nullAnuj Phogat2012-01-171-7/+7
| | | | | | | It is better to test if(intel == NULL) and simply return in that case. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965: Add .gitignore file to exclude automake build artifacts from git.Paul Berry2012-01-171-0/+6
| | | | | | | | | | | | | | | | | | With the conversion to automake in commit e326480e4ebe8687948041c2dc5f5b7595559a2e, several additional build artifacts are created: src/mesa/drivers/dri/i965/.deps/ src/mesa/drivers/dri/i965/.libs/ src/mesa/drivers/dri/i965/Makefile src/mesa/drivers/dri/i965/Makefile.in src/mesa/drivers/dri/i965/i965_dri.la src/mesa/drivers/dri/i965/i965_symbols_test This patch adds all of these files to .gitignore. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add condition in glGetTexImage for zero size texturesAnuj Phogat2012-01-172-1/+14
| | | | | | | | | | | | | | | | | | | | TestMipMaps() function in src/OGLconform/textureNPOT.c calls glTexImage2D() with width = 0. Texture with zero size skips miptree allocation due to a condition in function _mesa_store_teximage3d(). While calling glGetTexImage() it results in assertion failure in intel_map_texture_image() due to null mt pointer. This patch fixes the issue by detecting the zero size texture early in glGetTexImage and glGetCompressedTexImage functions. In such a case function simply returns doing nothing. Verified that below mentioned bug is fixed by this patch. https://bugs.freedesktop.org/show_bug.cgi?id=42334 NOTE: This is a candidate for stable branches Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* radeon: share common fog code between radeon and r200Alex Deucher2012-01-1717-259/+227
| | | | Signed-off-by: Alex Deucher <[email protected]>
* radeon: fix fog coordinate emitAlex Deucher2012-01-171-1/+1
| | | | | | | | | Noticed by dungeon on phoronix: http://phoronix.com/forums/showthread.php?65408-Radeon-R100-R200-Mesa-Driver-Sees-Attention&p=247018#post247018 Signed-off-by: Alex Deucher <[email protected]> Note: this is a candidate for the stable branches.
* r200: fix fog coordinate emitAlex Deucher2012-01-171-1/+1
| | | | | | | | | Noticed by dungeon on phoronix: http://phoronix.com/forums/showthread.php?65408-Radeon-R100-R200-Mesa-Driver-Sees-Attention&p=247018#post247018 Signed-off-by: Alex Deucher <[email protected]> Note: this is a candidate for the stable branches.
* i965: Convert the build to using automake.Eric Anholt2012-01-174-34/+88
| | | | | | | | | | | | | | | | | This does introduce a warning by the automake build system, that the missing-symbols test build is non-portable. That's true -- Mac OS X can't take something built as a loadable module and just link it as a library. Of course, we aren't building this on OS X at all, so it would be nice to be able to suppress it, but I haven't found a way. Still, the build is going to be much quieter than we have ever had before, so I think this is a fair tradeoff until we find a way to shut that warning up. v2: Put a link in /lib to avoid transition pains for people. Reviewed-by: Ian Romanick <[email protected]> (v1) Reviewed-by: Matt Turner <[email protected]> (v1)
* intel: Drop the version override code now that we don't have any left.Eric Anholt2012-01-171-8/+0
| | | | | | | | Fixes a compiler warning. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* intel: Fix warnings of undefined ffs().Eric Anholt2012-01-171-0/+1
| | | | | | | | For some reason these started showing up with the automake conversion. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965: Fix gen6,gen7 when used with a non-HiZ capable DDXChad Versace2012-01-161-4/+13
| | | | | | | | | | | | | | | | | | | | | Nothing works if HiZ is enabled and the DDX is incapable of HiZ (that is, the DDX version is < 2.16). The problem is that the refactoring that eliminated intel_renderbuffer::stencil_rb broke the recovery path in intel_verify_dri2_has_hiz(). Specifically, it broke line intel_context.c:1445, which allocates the region for DRI_BUFFER_DEPTH_STENCIL. That allocation was creating a separate stencil miptree, despite the buffer being a packed depthstencil buffer. Havoc ensued. This patch introduces a bool flag that prevents allocation of that stencil miptree. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44103 Tested-by: Ian Romanick <[email protected]> Note: This is a candidate for the 8.0 branch. Signed-off-by: Chad Versace <[email protected]>
* intel: Fix segfault in glXSwapBuffers with no bound contextAnuj Phogat2012-01-161-5/+7
| | | | | | | | | | | | | | Calling glXSwapBuffers with no bound context causes segmentation fault in function intelDRI2Flush. All the gl calls should be ignored after setting the current context to null. So the contents of framebuffer stay unchanged. But the driver should not seg fault. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44614 Reported-by: Yi Sun <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Tested-by: Yi Sun <[email protected]>
* r200: remove left-over EGL_SOURCES variableMatt Turner2012-01-151-1/+0
| | | | | | Rest was removed in 2a928899e. Signed-off-by: Matt Turner <[email protected]>
* mesa: update compute_version for GL3Marek Olšák2012-01-151-4/+2
| | | | | | only check ARB_fbo, add shader_texture_lod as a requirement Reviewed-by: Ian Romanick <[email protected]>
* gallium: improve the pipe_stream_output_info struct (v2)Marek Olšák2012-01-151-11/+7
| | | | | | | | | | | | | | | | | | | | | There are 3 changes: 1) stride is specified for each buffer, not just one, so that drivers don't have to derive it from the outputs 2) new per-output property dst_offset, which specifies the offset into the buffer in dwords where the output should be stored, so that drivers don't have to compute the offsets manually; this will also be useful for gl_SkipComponents from ARB_transform_feedback3 3) register_mask is removed, instead, there is start_component and num_components; register_mask with non-consecutive 1s doesn't make much sense (some hardware cannot do packing of components) Christoph Bumiller: fixed nvc0. v2: resolve merge conflicts in Draw and clean it up
* i965: Comment gen6_hiz_get_framebuffer_enum()Chad Versace2012-01-131-4/+6
| | | | | | | Make the comments precise. Explain why each branch is needed and correct. Document the potential pitfall in the true-branch. Signed-off-by: Chad Versace <[email protected]>
* gen6_hiz: Don't bind GL_DRAW_FRAMEBUFFER on GLESNeil Roberts2012-01-131-5/+29
| | | | | | | | | | | | When using Mesa with a GLES API, calling _mesa_FramebufferRenderbuffer with GL_DRAW_FRAMEBUFFER will report a 'user error' because get_framebuffer_target validates that this enum from the framebuffer blit extension is only used on GL. To work around it this patch makes it use the GL_FRAMEBUFFER enum instead in that case. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43418 Note: This is a candidate for the 8.0 branch. Signed-off-by: Chad Versace <[email protected]>
* mesa: s/GLushort/GLubyte/ in pack_ubyte_AL44()Brian Paul2012-01-131-1/+1
| | | | | | | | The AL44 format occupies one byte, not two. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
* osmesa: fix renderbuffer format selectionBrian Paul2012-01-131-46/+42
| | | | | | | | | | | | | | | | | The gl_renderbuffer::Format field wasn't always set properly. This didn't matter much in the past but with the recent swrast/renderbuffer mapping changes, core Mesa will be directly touching OSMesa colorbuffers so using the right MESA_FORMAT_x value is important. Unfortunately, there aren't MESA_FORMATs for all the possible OSmesa format/type combinations, such as GL_FLOAT / OSMESA_ARGB. If anyone runs into these we can add new Mesa formats. v2: add warnings for unsupported formats, fix ARGB_REV mix-up. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
* i965: Fix Coverity wrong sizeof argument defect.Vinson Lee2012-01-121-1/+1
| | | | | | | NOTE: This is a candidate for stable release branches. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42542 Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Set pitch of pull constant buffers to 16.Paul Berry2012-01-122-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | We always access pull constant buffers using the message types "OWord Block Read" or "OWord Dual Block Read". According to the Sandy Bridge PRM, Vol 4 Part 1, pages 214 and 218, when using these messages: "the surface pitch is ignored, the surface is treated as a 1-dimensional surface. An element size (pitch) of 16 bytes is used to determine the size of the buffer for out-of-bounds checking if using the surface state model." Previously we were setting the pitch for pull constant buffers to the size of the whole constant buffer--this made no sense and would have led to incorrect behavior if it were not for the fact that the pitch is ignored. For clarity, this patch sets the pitch for pull constant buffers to 16 bytes, consistent with the hardware's behavior. v2: Clarify the meaning of the ignored values by writing them as (16 - 1). Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965 gen4-6: Fix off-by-one errors brw_create_constant_surface()Paul Berry2012-01-121-3/+3
| | | | | | | | | | | | | | | | | | | | | Commit 9bdc44a52804a64219a0ca1a061b18596863e524 (i965: Replace struct with bit shifting for WM pull constant surfaces) accidentally introduced off-by-one errors into the calculation of the surface width, height, and depth. This patch restores the correct computation. The reason this wasn't noticed by Piglit tests is that the size of our constant surfaces is always less than 2^20, therefore the off-by-one error was causing the "depth" field of the surface to be set to all 1's. The hardware interpreted this as an extremely large surface, so overflow checking was effectively disabled. No Piglit regressions on Sandy Bridge. NOTE: This is a candidate for the 7.11 and 8.0 branches. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* osmesa: fix glReadPixels, etcBrian Paul2012-01-121-1/+57
| | | | | | | | | | | Needed to implement the Map/UnmapRenderbuffer() driver hooks. This fixes glRead/Draw/CopyPixels, etc. See https://bugs.freedesktop.org/show_bug.cgi?id=44723 Note: This is a candidate for the 8.0 branch. Tested-by: Kevin Hobbs <[email protected]>
* intel: move declaration before codeBrian Paul2012-01-121-1/+1
|
* intel: fix mapping of malloc'd renderbuffersBrian Paul2012-01-121-0/+15
| | | | | | | | | | | This fixes accum buffer operations. The accumulation buffer is the only malloc-based renderbuffer for the intel drivers. v2: apply x/y offset to returned pointer NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Eric Anholt <[email protected]>
* mesa: Throw the required error for glCopyPixels from multisample FBO.Eric Anholt2012-01-121-0/+6
| | | | | | | Fixes piglit EXT_framebuffer_multisample/negative-copypixels. Reviewed-by: Brian Paul <[email protected]> NOTE: This is a candidate for the 8.0 branch.
* mesa: Throw the required error for glCopyTex{Sub,}Image from multisample FBO.Eric Anholt2012-01-121-0/+14
| | | | | | | Fixes piglit EXT_framebuffer_multisample/negative-copyteximage. Reviewed-by: Brian Paul <[email protected]> NOTE: This is a candidate for the 8.0 branch.
* mesa: Throw the required error for glReadPixels() from a multisampled FBO.Eric Anholt2012-01-121-0/+5
| | | | | | | Fixes piglit EXT_framebuffer_multisample-negative-readpixels. Reviewed-by: Brian Paul <[email protected]> NOTE: This is a candidate for the 8.0 branch.
* mesa: Avoid short-circuiting realloc of renderbuffers to new sample count.Eric Anholt2012-01-121-1/+2
| | | | | | | Fixes piglit EXT_framebuffer_multisample/renderbuffer-samples. Reviewed-by: Brian Paul <[email protected]> NOTE: This is a candidate for the 8.0 branch.
* meta: Add GL_RED/GL_RG support to meta CopyTexImage.Eric Anholt2012-01-121-1/+4
| | | | | | | Fixes some _mesa_problem()s in oglconform. Reviewed-by: Brian Paul <[email protected]> NOTE: This is a candidate for the 8.0 branch.
* i965/gen7: Fix depth buffer rendering to tile offsets.Eric Anholt2012-01-122-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Previously, we were saying that everything from the starting tile to region width+height was part of the limits of our depthbuffer, even if the tile was near the bottom of the depthbuffer. This mean that our range was not clipping to buffer buonds if the start tile was anything but the start of the buffer. In bebc91f0f3a1f2d19d36a7f1a4f7c992ace064e9, this was changed to saying that we're just rendering to a region of the size of the renderbuffer. This is great -- we get a range that should actually match what we want. However, the hardware's range checking occurs after the X/Y offset addition, so we were clipping out rendering to small depth mip levels when an X/Y offset was present. Just add tile_x/y to the width in that case -- the WM won't produce negative x/y values pre-offset, so we just need to get the left/bottom sides of the region to cover our buffer. Fixes the following Piglit regressions on gen7: spec/ARB_depth_buffer_float/fbo-clear-formats spec/ARB_depth_texture/fbo-clear-formats spec/EXT_packed_depth_stencil/fbo-clear-formats NOTE: This is a candidate for the 8.0 branch.
* mesa: remove incorrect (float) cast in mipmap do_row()Brian Paul2012-01-121-1/+1
| | | | | | | | | | | The array holds GLuint values so remove the float cast. Note, however, that to compute the average of four GLuints we really want to do (a+b+c+d)/4 but that could overflow. This change doesn't address that for now. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
* swrast: use BITFIELD64_BIT() macro to fix MSVC warningsBrian Paul2012-01-123-5/+5
| | | | | | NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
* mesa: fix ir_variable declarationBrian Paul2012-01-121-1/+1
| | | | | | | | ir_variable is a class, not a struct. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
* mesa: fix incorrect float vs. int values in a few placesBrian Paul2012-01-121-3/+3
| | | | | | | | | | | In the first case, the newImage[] array contains GLuint values. In the second case, the parameter type is GLuint, but the maxDepth value is never used in this case (GL_FLOAT_32_UNSIGNED_INT_24_8_REV). Pass ~OU just to be safe. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
* meta: fix incorrect argument order in setup_texture_coords() callBrian Paul2012-01-121-1/+1
| | | | | | | | And pass integer width, height values. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
* mesa: use _mesa_is_user_fbo() and _mesa_is_winsys_fbo() functionsBrian Paul2012-01-127-48/+52
| | | | | | Rather than testing the fbo's name against zero. Reviewed-by: José Fonseca <[email protected]>
* mesa: whitespace, 80-column wrapping in buffers.cBrian Paul2012-01-121-2/+6
|
* mesa: remove obsolete comment on _mesa_dest_buffer_exists()Brian Paul2012-01-121-1/+0
|
* st/mesa: whitespace fixes, 80-column wrappingBrian Paul2012-01-121-14/+21
|
* mesa/gallium: add FFS_DEFINED to protect ffs() from multiple definitionsBrian Paul2012-01-121-0/+4
| | | | | | | | We include both imports.h and u_math.h in the state tracker. This leads to multiple, conflicting definitions of ffs() with MSVC. Use FFS_DEFINED to skip the ffs() in u_math.h. Reviewed-by: José Fonseca <[email protected]>
* st/mesa: re-order #includes in st_manager.cBrian Paul2012-01-121-10/+10
| | | | | | | | include mesa headers before gallium headers to avoid problem with ffs() being defined in u_math.h and then again in imports.h The next commit will add some #ifdefs to prevent multiple definitions of ffs().
* st/mesa: fix struct vs. class compilation warningBrian Paul2012-01-121-1/+1
| | | | | | | glsl_to_tgsi_visitor is earlier defined as a class, not a struct. Fixes MSVC warning. NOTE: This is a candidate for the 8.0 branch.
* mesa: remove _mesa_ffs(), implement ffs() for non-GNU platformsBrian Paul2012-01-1214-42/+35
| | | | | | | | | | | Call ffs() and ffsll() everywhere. Define our own ffs(), ffsll() functions when the platform doesn't have them. v2: remove #ifdef _WIN32, __IBMC__, __IBMCPP_ tests inside ffs() implementation. The #else clause was recursive. Reviewed-by: Kenneth Graunke <[email protected]> Tested-by: Alexander von Gluck <[email protected]>
* vbo: fix breakage from previous commitBrian Paul2012-01-111-1/+1
| | | | Don't know how that slipped by.
* vbo: fix void * arithmetic compilation error on MSVCBrian Paul2012-01-111-4/+5
| | | | | Also, call vbo_sizeof_ib_type() once and fix argument cast in MapBufferRange() call.
* vbo: introduce vbo_get_minmax_indices functionYuanhan Liu2012-01-128-17/+53
| | | | | | | | | | | | | | | | | | | | | | | Introduce vbo_get_minmax_indices() function to handle the min/max index computation for nr_prims(>= 1). The old code just compute the first prim's min/max index; this would results an error rendering if user called functions like glMultiDrawElements(). This patch servers as fixing this issue. As when nr_prims = 1, we can pass 1 to paramter nr_prims, thus I made vbo_get_minmax_index() static. v2: per Roland's suggestion, put the indices address compuation into vbo_get_minmax_index() instead. Also do comination if possible to reduce map/unmap count v3: per Brian's suggestion, use a pointer for start_prim to avoid structure copy per loop. Signed-off-by: Yuanhan Liu <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove const qualifier from fProg to silence warningBrian Paul2012-01-111-1/+1
| | | | The args to _mesa_reference_shader_program() can't be const.
* mesa: include uniforms.h to silence warning, remove unused varBrian Paul2012-01-111-2/+1
|
* Enable is_front_buffer_rendering variable in case of GL_FRONT_AND_BACKAnuj Phogat2012-01-111-1/+1
| | | | | | | | | | glDrawBuffer(GL_FRONT_AND_BACK) results in to segmentation fault if intel->is_front_buffer_rendering is not enabled with GL_FRONT_AND_BACK. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44153 Reported-by: Yi Sun <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Eric Anholt <[email protected]>