summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Close Doxygen groupChad Versace2011-10-071-0/+1
| | | | | In dd_function_table, close the Doxygen group beginning with \name Support for multiple T&L engines
* mesa: fix software mipmap generation code for packed Z/stencil formatsBrian Paul2011-10-072-5/+41
| | | | | | Fixes https://bugs.freedesktop.org/show_bug.cgi?id=32458 Reviewed-by: Chad Versace <[email protected]>
* mesa: update gl_texture_image commentsBrian Paul2011-10-071-2/+2
|
* mesa: fix image unpacking when storing compressed texturesBrian Paul2011-10-072-6/+19
| | | | | | | | | | | | | | This fixes failures found with the new piglit texsubimage test. Two things were broken: 1. The dxt code doesn't handle sources images where width != row stride. Check for that and take the _mesa_make_temp_ubyte_image() path to get an image where width = rowstride. 2. If we don't take the _mesa_make_temp_ubyte_image() path we need to take the source image unpacking parameters into account in order to get the proper starting memory address of the source texels. Note: This is a candidate for the 7.11 branch.
* mesa: Create _mesa_bitcount_64() to replace i965's brw_count_bits()Paul Berry2011-10-062-0/+16
| | | | | | | | | | | | | | | | The i965 driver already had a function to count bits in a 64-bit uint (brw_count_bits()), but it was buggy (it only counted the bottom 32 bits) and it was clumsy (it had a strange and broken fallback for non-GCC-like compilers, which fortunately was never used). Since Mesa already has a _mesa_bitcount() function, it seems better to just create a _mesa_bitcount_64() function rather than special-case this in the i965 driver. This patch creates the new _mesa_bitcount_64() function and rewrites all of the old brw_count_bits() calls to refer to it. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa/es: Allow GL_CLIP_PLANE0+6 and GL_CLIP_PLANE0+7.Kenneth Graunke2011-10-061-8/+6
| | | | | | | | | | Fixes the ES1 conformance 'userclip' test, which broke when we increased MAX_CLIP_PLANES to 8. Core Mesa already validates incoming values against MAX_CLIP_PLANES; we just need the ES wrapper to pass everything through. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa/get: Move MAX_LIGHTS from GL/ES2 to GL/ES1.Kenneth Graunke2011-10-061-2/+1
| | | | | | | | | | It's required for ES 1.0 and 1.1, and isn't specified for ES 2. While the comment says Mesa depends on it internally, removing it from ES2 doesn't seem to regress any Piglit or ES2 conformance tests. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove some unneeded forward struct declarationsBrian Paul2011-10-051-3/+0
|
* mesa: remove unused _mesa_rescale_teximage2d() functionBrian Paul2011-10-052-84/+0
| | | | It was only used by the old tdfx driver, IIRC.
* mesa: remove unused gl_texture_image::DriverData fieldBrian Paul2011-10-052-8/+0
| | | | Was only used by some older/removed DRI drivers.
* mesa: get rid of imageOffsets arrays in texstore codeBrian Paul2011-10-055-360/+210
| | | | | | | | | | | These were used to find the start of a 3D image slice (or 2D array texture slice) given a base address. Instead, use a simple array of address of image slices instead. This is a step toward getting rid of the gl_texture_image::ImageOffsets field. Reviewed-by: Eric Anholt <[email protected]>
* i965 Gen6: Implement gl_ClipVertex.Paul Berry2011-10-051-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements proper support for gl_ClipVertex by causing the new VS backend to populate the clip distance VUE slots using VERT_RESULT_CLIP_VERTEX when appropriate, and by using the untransformed clip planes in ctx->Transform.EyeUserPlane rather than the transformed clip planes in ctx->Transform._ClipUserPlane when a GLSL-based vertex shader is in use. When not using a GLSL-based vertex shader, we use ctx->Transform._ClipUserPlane (which is what we used prior to this patch). This ensures that clipping is still performed correctly for fixed function and ARB vertex programs. A new function, brw_select_clip_planes() is used to determine whether to use _ClipUserPlane or EyeUserPlane, so that the logic for making this decision is shared between the new and old vertex shaders. Fixes the following Piglit tests on i965 Gen6: - vs-clip-vertex-const-accept - vs-clip-vertex-const-reject - vs-clip-vertex-different-from-position - vs-clip-vertex-equal-to-position - vs-clip-vertex-homogeneity - vs-clip-based-on-position - vs-clip-based-on-position-homogeneity - clip-plane-transformation clipvert_pos - clip-plane-transformation pos_clipvert - clip-plane-transformation pos Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa: Add a gl_vert_result for gl_ClipVertex.Paul Berry2011-10-051-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, clip planes didn't work properly in Mesa when using vertex shaders, because Mesa assigned both gl_ClipVertex and gl_Position to the same gl_vert_result (VERT_RESULT_HPOS). As a result, backends couldn't distinguish between the two variables, so any shader that wrote different values to them would fail to work properly. This patch paves the way for proper support of gl_ClipVertex by creating a new enumerated value in gl_vert_result for it (VERT_RESULT_CLIP_VERTEX). After this patch, a back-end may add support for gl_ClipVertex using the following algorithm: - If using a user-supplied GLSL vertex shader: - If the bit corresponding to VERT_RESULT_CLIP_VERTEX is set in gl_program::OutputsWritten: - Clip using the vertex shader output VERT_RESULT_CLIP_VERTEX and the clip planes defined in gl_context::Transform.EyeUserPlane. - Else: - Clip using the vertex shader output VERT_RESULT_HPOS and the clip planes defined in gl_context::Transform.EyeUserPlane. - Else (either using fixed function or an ARB vertex program): - Clip using the vertex shader output VERT_RESULT_HPOS and the clip planes defined in gl_context::Transform._ClipUserPlane (*) where (*) represents the normal Mesa behavior before this patch. An example of implementing the above algorithm can be found in the patch that follows this one, which implements gl_ClipVertex in i965 Gen6. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: update fbo format tablet for integer types.Dave Airlie2011-10-051-1/+61
| | | | | | This updates the fbo format table for the integer types. Signed-off-by: Dave Airlie <[email protected]>
* mesa/texstore: add texstore paths for all the integer types.Dave Airlie2011-10-051-12/+104
| | | | | | | | | This just adds the entries to the table and fixes the asserts up. The int32 one is definitely wrong, since it uses a float temp which will lose precision, but its no worse than now. Signed-off-by: Dave Airlie <[email protected]>
* mesa/texformat: update choose_tex_format for integer types.Dave Airlie2011-10-051-4/+79
| | | | | | This adds the integer types to the tex format chooser. Signed-off-by: Dave Airlie <[email protected]>
* mesa/formats: add rest of integer formats.Dave Airlie2011-10-052-2/+562
| | | | | | | | | | | | | | | | This is taken from reading EXT_texture_integer + EXT_texture_rg in combination, Comments on necessity of each format, naming of formats and bugs in the formats tables please. Is there any formats I've missed? Eric looked over this to make sure its consistent at least. As I've changed the ordering of things in the format table, the follow patches are required to avoid regression. Signed-off-by: Dave Airlie <[email protected]>
* texstore: create texstore table on first access.Dave Airlie2011-10-051-149/+120
| | | | | | | | As per Brian's suggestion we can generate this table at first start to make sure its correct. This is a sad workaround for compilers which don't support named initialiser. (its 2011). Signed-off-by: Dave Airlie <[email protected]>
* mesa: Remove unused gl_program::AttributesIan Romanick2011-10-042-9/+0
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Determine GL_ACTIVE_ATTRIBUTE_MAX_LENGTH by walking the GLSL IR.Ian Romanick2011-10-043-7/+32
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Determine GL_ACTIVE_ATTRIBUTES by walking the GLSL IR.Ian Romanick2011-10-043-1/+30
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Remove unused gl_shader_program::AttributesIan Romanick2011-10-043-14/+2
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Make _mesa_GetActiveAttribARB use the attributes in the shader IRIan Romanick2011-10-041-13/+38
| | | | | | | | | Instead of relying on the mirror in the Mesa IR assembly shader, just use the variables actually stored in the GLSL IR. This will be a bit slower, but nobody cares about the performance of glGetActiveAttrib. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Move _mesa_GetActiveAttribARB to shader_query.cppIan Romanick2011-10-042-42/+32
| | | | | | | | | This just folds get_active_attrib into _mesa_GetActiveAttribARB and moves the resulting function function to the other source file. More changes are coming soon. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add gl_shader_program::AttributeBindingsIan Romanick2011-10-043-1/+24
| | | | | | | | | This currently mirrors the state tracking gl_shader_program::Attributes, but I'm working towards eliminating that. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Move _mesa_BindAttribLocationARB to shader_query.cppIan Romanick2011-10-042-52/+42
| | | | | | | | | This just folds bind_attrib_location into _mesa_BindAttribLocationARB and moves the resulting function function to the other source file. More changes are coming soon. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Move _mesa_GetAttribLocationARB to shader_query.cppIan Romanick2011-10-042-41/+88
| | | | | | | | This allows querying the linked shader itself rather than the Mesa IR. This is the first step towards removing gl_program::Attributes. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glapi: regen API files for new extensionIan Romanick2011-10-042-3350/+3385
| | | | Signed-off-by: Ian Romanick <[email protected]>
* mesa: Remove ARB_draw_buffers extension enable flagIan Romanick2011-10-043-8/+3
| | | | | | | | | | | | | All drivers in Mesa have supported this extension for eons. This extension is an optional features in desktop OpenGL (via GL_ARB_draw_buffers) and OpenGL ES 2.x (via GL_NV_draw_buffers). The extension is not usable in OpenGL ES 1.x. There is no glDrawBuffers* entry point in OpenGL ES 1.x contexts, and glGet*v generate errors when MAX_DRAW_BUFFERS or DRAW_BUFFERi is queried. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Advertise NV_fbo_color_attachments on OpenGL ES 2.0Ian Romanick2011-10-041-0/+1
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Advertise NV_draw_buffers in OpenGL ES 2.0Ian Romanick2011-10-041-0/+1
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/es: Allow querying GL_DRAW_BUFFERi in OpenGL ES 2.0Ian Romanick2011-10-041-17/+17
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/es: Allow querying GL_MAX_COLOR_ATTACHMENTS in OpenGL ES 2.0Ian Romanick2011-10-041-4/+4
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/es: Allow other color attachments in OpenGL ES 2.0Ian Romanick2011-10-041-1/+5
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/es: Make glDrawBuffersNV available in OpenGL ES 2.0Ian Romanick2011-10-041-0/+13
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/es: Remove redundant renderbuffer target validationIan Romanick2011-10-041-25/+0
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/es: Validate FBO target enum in Mesa code rather than the ES wrapperIan Romanick2011-10-042-32/+4
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/es: Validate FBO attachment enum in Mesa code rather than the ES wrapperIan Romanick2011-10-042-28/+6
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: fix warning (MSVC error) about void pointer arithmeticBrian Paul2011-10-031-1/+1
|
* mesa: Reuse existing make_2d_mipmap for 2D array generation.Eric Anholt2011-10-031-99/+5
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Make the uncompressed sw mipmap gen path do a Map per 1D array slice.Eric Anholt2011-10-031-44/+17
| | | | | | This also fixes what was probably a bug in 1D arrays with border. Reviewed-by: Brian Paul <[email protected]>
* mesa: When storing texture data for a 1D array, map each slice separately.Eric Anholt2011-10-031-16/+52
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Convert _mesa_generate_mipmap to MapTexImage()-based access.Brian Paul2011-10-032-124/+150
| | | | | | | | | | | Now that we can zero-copy generate the mipmaps into brand new glTexImage()-generated storage using MapTextureImage(), we no longer need to allocate image->Data in mipmap generate. This requires deleting the drivers' old overrides of the miptree tracking after calling _mesa_generate_mipmap at the same time, or the drivers promptly lose our newly-generated data. Reviewed-by: Eric Anholt <[email protected]>
* mesa: Respect GL_RASTERIZER_DISCARD for various meta-type operations.Eric Anholt2011-10-013-5/+25
| | | | | | | | | | | | | | | | From the EXT_transform_feedback spec: Primitives can be optionally discarded before rasterization by calling Enable and Disable with RASTERIZER_DISCARD_EXT. When enabled, primitives are discared right before the rasterization stage, but after the optional transform feedback stage. When disabled, primitives are passed through to the rasterization stage to be processed normally. RASTERIZER_DISCARD_EXT applies to the DrawPixels, CopyPixels, Bitmap, Clear and Accum commands as well. And the GL 3.2 spec says it applies to ClearBuffer* as well. Reviewed-by: Brian Paul <[email protected]>
* mesa: Add missing glGetIntegerv() support for ARB_color_buffer_float tokens.Eric Anholt2011-10-011-0/+6
| | | | | | | Fixes piglit ARB_color_buffer_float/api-get Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: number of combiner terms to pop depends on GL_NV_texture_env_combine4Brian Paul2011-10-011-1/+2
| | | | | | | | | | If GL_NV_texture_env_combine4 is not supported, setting the fourth combiner term would generate a GL error. Of course, I noticed this right after committing the previous patch to use a loop in the first place. <sigh> Note that GL_EXT_texture_env_combine is always supported so the first three combiner terms are always accepted.
* mesa: s/INLINE/inline/Brian Paul2011-10-0150-126/+126
| | | | | | | INLINE is still seen in some files (some generated files, etc) but this is a good start. Acked-by: Kenneth Graunke <[email protected]>
* mesa: use !! to simplify some _mesa_set_enable() calls in attrib.cBrian Paul2011-10-011-43/+25
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: use loop in pop_texture_group() to restore 4 combiner termsBrian Paul2011-10-011-24/+13
| | | | | | | There's four combiner terms (not 3) with GL_NV_texture_env_combine4. Use a loop to make the code a little more compact. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Remove unused field gl_program::VaryingIan Romanick2011-09-301-2/+0
| | | | | | | Lots of things set and copy this field around, but nothing uses it. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>