summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* mesa: set up gl_vert_result and gl_frag_attrib values for gl_ClipDistance.Paul Berry2011-09-231-6/+10
| | | | | | | | | | | | This patch assigns enumerated values for gl_ClipDistance in the gl_vert_result and gl_frag_attrib enums, so that driver back-ends can assign gl_ClipDistance to the appropriate hardware registers. It also adjusts the functions _mesa_vert_result_to_frag_attrib() and _mesa_frag_attrib_to_vert_result() (which translate between the two enums) to correctly translate the new enumerated values. Reviewed-by: Eric Anholt <[email protected]> Tested-by: Brian Paul <[email protected]>
* mesa: Add a flag to indicate whether a program uses gl_ClipDistance.Paul Berry2011-09-232-0/+8
| | | | | | | | | | | | | | | | | | GLSL 1.30 requires us to use gl_ClipDistance for clipping if the vertex shader contains a static write to it, and otherwise use user-defined clipping planes. Since the driver needs to behave differently in these two cases, we need a flag to record whether the shader has written to gl_ClipDistance. The new flag is called UsesClipDistance. We initially store it in gl_shader_program (since that is the data structure that is available when we check to see whethe gl_ClipDistance was written to), and we later copy it to a flag with the same name in gl_vertex_program, since that is a more convenient place for the driver to access it (in i965, at least). Reviewed-by: Eric Anholt <[email protected]> Tested-by: Brian Paul <[email protected]>
* glsl: Implement a lowering pass for gl_ClipDistance.Paul Berry2011-09-231-0/+1
| | | | | | | | | | | | | | | | | | | In i965 GEN6+ (and I suspect most other hardware), gl_ClipDistance needs to be laid out as a pair of vec4's (the first containing clip distances 0-3, and the second containing clip distances 4-7). However, it is declared in GLSL as an array of 8 floats. This lowering pass acts at the GLSL level, modifying the declaration of gl_ClipDistance so that it is an array of vec4's rather than an array of floats, and renaming it to gl_ClipDistanceMESA. In addition, it modifies all accesses to the array so that they access the appropiate component of one of the vec4's. Since some hardware may not internally represent gl_ClipDistance as a pair of vec4's, this lowering pass is optional. To enable it, set the LowerClipDistance flag in gl_shader_compiler_options to true. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add missing includes to meta.hChad Versace2011-09-231-0/+2
| | | | | | Include mtypes.h. Signed-off-by: Chad Versace <[email protected]>
* intel: fix the wrong code to detect null texture.Yuanhan Liu2011-09-231-1/+1
| | | | | | | | | | | | There is already comments show how to detect a null texture. Fix the code to match the comments. This would fix the oglc divzero(basic.texQOrWEqualsZero) and divzero(basic.texTrivialPrim) test case fail. Signed-off-by: Yuanhan Liu <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: fix the constant interp bitmask for flat modeYuanhan Liu2011-09-232-12/+26
| | | | | | | | | | | | | | | Fix the constant interpolation enable bit mask for flat light mode. FRAG_BIT_COL0 attribute bit might be 0, in which case we need to shift one more bit right. This would fix the oglc specularColor test fail on both Sandybridge and Ivybridge. v2: move the constant interp bitmask setup code into for(; attr < FRAG_ATTRIB_MAX; attr++) loop suggested by Eric. Signed-off-by: Yuanhan Liu <[email protected]> Signed-off-by: Xiang, Haihao <[email protected]>
* st/mesa: remove unnecessary st_texture_match_image() parametersBrian Paul2011-09-223-11/+7
| | | | | We didn't use the face parameter and the level parameter can be found in the gl_texture_image.
* intel: Unindent the blit call in PBO blit uploads.Eric Anholt2011-09-221-17/+12
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Drop gratuitous flush in PBO blit upload.Eric Anholt2011-09-221-3/+0
| | | | | | | | Since the blit gets sequenced after other batchbuffer rendering like normal, there's no need to push things out early. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel: Clean up check_pbo_format to ignore internalFormat.Eric Anholt2011-09-221-25/+13
| | | | | | | | | | All that matters here is the format of the texture, not the internalformat (which might mean various different pixel formats). In one case, the pbo upload for MESA_FORMAT_YCBCR would have swapped the channels for MESA_FORMAT_YCBCR_REV. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel: Move more of the PBO blit upload logic into that function.Eric Anholt2011-09-221-26/+33
| | | | | | | | | This also improves the debugging output in the failure paths so you get more than just "failed", and don't get spammed with "failed" when you didn't even have a PBO to try. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel: Remove stale comment about non-intel gl_buffer_objects.Eric Anholt2011-09-221-8/+1
| | | | | | | | This hasn't been true since dd26899ca39111e0866afed9df94bfb1618dd363 in 2009. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel: Remove the pbo zero-copy code.Eric Anholt2011-09-225-247/+0
| | | | | | | | | | | There were notes about the possibility of slowdowns due to zcopy from a PBO due to thrashing around of the region. Slowdowns are even more likely now that textures are generally tiled, which a zcopy wouldn't get. Additionally, there were no checks on the buffer size to ensure that the hardware-required rounding was present, which could result in GPU hangs on large zcopy PBOs. Reviewed-by: Ian Romanick <[email protected]>
* intel: Remove extra FreeTextureImageBuffer() from glTexImage*.Eric Anholt2011-09-221-1/+0
| | | | | | | The core code does this before calling in to us. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: Add support for GL_EXT_packed_float.Eric Anholt2011-09-223-0/+5
| | | | | | | | | | | This doesn't cover support for this format as a renderbuffer yet. The spec allows implementations to not support it, though it is something we do want to support. Only one failure in piglit on gen6, which is texwrap with bordercolor (as usual). Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Add support for GL_EXT_texture_shared_exponent.Eric Anholt2011-09-223-0/+5
| | | | | | | Only one failure in piglit on gen6, which is texwrap with bordercolor (as usual). Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: remove support for GL_APPLE_client_storage extensionBrian Paul2011-09-228-18/+2
| | | | | | | AFAIK, there are few users of this extension and I can see a couple reasons why this is probably broken in Mesa anyway. Reviewed-by: Ian Romanick <[email protected]>
* mesa: move gl_texture_image::Width/Height/DepthScale fields to swrastBrian Paul2011-09-227-25/+30
| | | | | | | These fields were only used for swrast so move them into swrast_texture_image. Reviewed-by: Ian Romanick <[email protected]>
* mesa: move gl_texture_image::_IsPowerOfTwo into swrastBrian Paul2011-09-226-19/+32
| | | | | | It's only used by swrast. Reviewed-by: Ian Romanick <[email protected]>
* st/mesa: Finalize texture on render-to-texture.Michel Dänzer2011-09-221-3/+6
| | | | | | | | | | | | This makes sure that stObj->pt exists and is up to date. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39193 and piglit fbo-incomplete-texture-03. Signed-off-by: Michel Dänzer <[email protected]> Reviewed-by: Brian Paul <[email protected]> NOTE: This is a candidate for the 7.11 branch.
* st/mesa: Convert size assertions to conditionals in st_texture_image_copy.Brian Paul2011-09-221-3/+9
| | | | | | Prevents potential assertion failures in piglit fbo-incomplete-texture-03 test. NOTE: This is a candidate for the 7.11 branch.
* meta: Don't hang on to program refcounts after metaops are done.Eric Anholt2011-09-211-0/+5
| | | | | | | Fixes piglit ARB_shader_objects/clear-with-deleted. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39577 Reviewed-by: Brian Paul <[email protected]>
* i965/vs: Return a dummy value when visiting ir_texture.Eric Anholt2011-09-211-0/+1
| | | | | | While the program won't successfully link in the end, this avoids possible assertion failure in the driver during linking if this->result isn't initialized with something already.
* i965/gen6+: When only BFC is written, use BFC as the color.Eric Anholt2011-09-211-0/+9
| | | | Fixes piglit vertex-program-two-side enabled back back2
* i965/gen6+: Respect the VERTEX_PROGRAM_TWO_SIDE flag for shaders.Eric Anholt2011-09-213-9/+8
| | | | | | | Fixes piglit: vertex-program-two-side enabled front back front2 back2 vertex-program-two-side enabled front back vertex-program-two-side enabled front2 back2
* mesa: Add a context flag indicating whether two-sided lighting should happen.Eric Anholt2011-09-212-1/+19
| | | | | The 965 driver was ignoring the VERTEX_PROGRAM_TWO_SIDE flag and only looking at fixed-function state.
* mesa: check glBegin()/glDrawArrays()/etc mode with _mesa_valid_prim_mode()Brian Paul2011-09-214-7/+41
| | | | | | | | | We now raise an GL_INVALID_ENUM in glBegin() if mode is illegal, as was done in Yuanhan Liu's original patch. Take geometry shaders support into account too. Reviewed-by: Yuanhan Liu <[email protected]>
* tnl: include swrast/s_chan.h to fix sse buildBrian Paul2011-09-211-0/+1
|
* swrast: s/GLubyte/GLchan/ in a castBrian Paul2011-09-201-1/+1
|
* meta: use _mesa_set_enable() in more placesBrian Paul2011-09-201-5/+5
| | | | | | Avoids an extra context lookup. Reviewed-by: Eric Anholt <[email protected]>
* meta: use _mesa_set_enable(), fix decompress_texture_image()Brian Paul2011-09-201-1/+4
| | | | | | | | | Use _mesa_set_enable() to avoid a redudant context lookup. Need to disable the texture target in decompress_texture_image() so the unit isn't still enabled after glGetTexImage() returns. Arguably, the meta restore code should do this, but it doesn't. Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: specify source mipmap level in decompress_with_blit()Brian Paul2011-09-201-0/+3
| | | | | This, along with the previous patch, fixes glGetTexImage() of compressed textures for level > 0.
* meta: fix broken sRGB mipmap generationBrian Paul2011-09-201-0/+28
| | | | | | | | | | If we're generating a mipmap for an sRGB texture we need to bypass sRGB->linear conversion. Otherwise the destination mipmap level (drawn with a textured quad) will have the wrong colors. If we can't turn of sRGB->linear conversion (GL_EXT_texture_sRGB_decode) we need to use the software fallback for mipmap generation. Note: This is a candidate for the 7.11 branch.
* mesa: fix PACK_COLOR_5551(), PACK_COLOR_1555() macrosBrian Paul2011-09-201-2/+2
| | | | | | | | | | | The 1-bit alpha channel was incorrectly encoded. Previously, any non-zero alpha value for the ubyte alpha value would set A=1. Instead, use the most significant bit of the ubyte alpha to determine the A bit. This is consistent with the other channels and other OpenGL implementations. Note: This is a candidate for the 7.11 branch. Reviewed-by: Michel Dänzer <[email protected]>
* mesa: move last bits of GLchan stuff into swrastBrian Paul2011-09-2010-102/+127
| | | | | This removes the last remnants of the GLchan datatype and associated macros out of core Mesa and into swrast.
* mesa: remove CHAN_TYPE cruft from debug.cBrian Paul2011-09-201-4/+0
|
* mesa: remove unused interp/stride chan macrosBrian Paul2011-09-201-27/+0
|
* mesa: remove unused UNCLAMPED_FLOAT_TO_RGB_CHAN() macroBrian Paul2011-09-201-16/+0
|
* radeon: use _mesa_unclamped_float_rgba_to_ubyte()Brian Paul2011-09-202-3/+3
|
* r200: use _mesa_unclamped_float_rgba_to_ubyte()Brian Paul2011-09-202-3/+3
|
* mesa: remove unused <type>_TO_CHAN() macrosBrian Paul2011-09-201-40/+0
|
* mesa: convert _mesa_unpack_color_span_chan() to ubyteBrian Paul2011-09-203-55/+53
|
* mesa: replace GLchan with GLubyte in texcompress_s3tc.cBrian Paul2011-09-201-59/+57
|
* mesa/gallium: remove GLchan from latc, rgtc codeBrian Paul2011-09-202-15/+15
|
* mesa: remove GLchan in texcompress_fxt1.cBrian Paul2011-09-201-74/+53
|
* mesa: s/_mesa_make_temp_chan_image()/_mesa_make_temp_ubyte_image()Brian Paul2011-09-205-123/+123
| | | | Another step toward eliminating the GLchan type.
* mesa: move _mesa_upscale_teximage2d() to texcompress_fxt1.cBrian Paul2011-09-203-43/+38
| | | | Was used by no other code.
* mesa: s/GLchan/GLubyte/ in mipmap generation codeBrian Paul2011-09-201-3/+3
|
* mesa: Don't expose compressed paletted formats via ↵Ian Romanick2011-09-201-15/+17
| | | | | | | | | | | | GL_{NUM_,}COMPRESSED_TEXTURE_FORMATS Fixes a bug introduced by commit faf5d65. These formats should only be exposed in OpenGL ES 1.x. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Cc: Xun Fang <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40860
* Increase MAX_CLIP_PLANES to 8Paul Berry2011-09-201-2/+5
| | | | | | | | | | | | This will allow drivers to increase ctx->Const.MaxClipPlanes to 8, which is required for GLSL-1.30 compliance. No driver behavior should be affected. However, many data structures use MAX_CLIP_PLANES as an array size, so these arrays will get slightly larger. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>