summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* glapi: regenerated API files for GL_ARB_texture_storageBrian Paul2011-10-313-5079/+5196
|
* mesa: add new driver hook for AllocTextureStorage()Brian Paul2011-10-311-0/+9
|
* mesa: add new fields for GL_ARB_texture_storageBrian Paul2011-10-311-0/+2
|
* mesa: Don't do [0, 1] clamping on glGetTexImage() of packed float formats.Eric Anholt2011-10-281-4/+6
| | | | | | | | | | | | | | | | | | | | From the GL_EXT_packed_float spec: For an RGBA color, if <type> is not one of FLOAT, UNSIGNED_INT_5_9_9_9_REV_EXT, or UNSIGNED_INT_10F_11F_11F_REV_EXT, or if the CLAMP_READ_COLOR_ARB is TRUE, or CLAMP_READ_COLOR_ARB is FIXED_ONLY_ARB and the selected color (or texture) buffer is a fixed-point buffer, each component is first clamped to [0,1]. Then the appropriate conversion formula from table 4.7 is applied the component." (but we previously resolved that the CLAMP_READ_COLOR bit is not relevant to glGetTexImage()) This fixes most of the cases in piglit GL_EXT_packed_float/pack. Reviewed-by: Marek Ol ák <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Distinguish between no interpolation qualifier and 'smooth'Paul Berry2011-10-271-1/+5
| | | | | | | | | | | | | | | Previously, we treated the 'smooth' qualifier as equivalent to no qualifier at all. However, this is incorrect for the built-in color variables (gl_FrontColor, gl_BackColor, gl_FrontSecondaryColor, and gl_BackSecondaryColor). For those variables, if there is no qualifier at all, interpolation should be flat if the shade model is GL_FLAT, and smooth if the shade model is GL_SMOOTH. To make this possible, I added a new value to the glsl_interp_qualifier enum, INTERP_QUALIFIER_NONE. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Expose GLSL interpolation qualifiers in gl_fragment_program.Paul Berry2011-10-271-0/+19
| | | | | | | | | | | | | | | | | This patch makes GLSL interpolation qualifiers visible to drivers via the array InterpQualifier[] in gl_fragment_program, so that they can easily be used by driver back-ends to select the correct interpolation mode. Previous to this patch, the GLSL compiler was using the enum ir_variable_interpolation to represent interpolation types. Rather than make a duplicate enum in core mesa to represent the same thing, I moved the enum into mtypes.h and renamed it to be more consistent with the other enums defined there. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: initialize ARB_transform_feedback2 dispatchMarek Olšák2011-10-272-1/+10
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: improve EXT_transform_feedback display list supportMarek Olšák2011-10-271-10/+9
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: fix GL error checking in TransformFeedbackVaryingsMarek Olšák2011-10-271-1/+3
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glsl: Rename remaining internal builtins from gl_MESA* to gl_*MESA.Eric Anholt2011-10-261-3/+3
| | | | | | This matches the usual convention for extension builtin variables. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Apply StripTextureBorder to CopyTexImage as well.Eric Anholt2011-10-261-0/+10
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Fold gallium's texture border stripping into a core Mesa option.Eric Anholt2011-10-262-3/+68
| | | | | | | | | We wanted to reuse this in the Intel driver. v2: Move the flag to ctx->Const Reviewed-by: Kenneth Graunke <[email protected]> (v1) Reviewed-by: Brian Paul <[email protected]>
* mesa: Skip texstore for 0-sized texture data.Eric Anholt2011-10-261-0/+9
| | | | | | | | | | | The intel driver (and gallium, it looks like, though it doesn't use these texstore functions at this point) doesn't bother making storage for textures with 0 width, height, or depth. This avoids them having to deal with returning a mapping for that nonexistent data. Fixes assertion failures with an upcoming intel driver change. Reviewed-by: Brian Paul <[email protected]>
* glsl: Add uniform_locations_assigned parameter to do_dead_code opt passIan Romanick2011-10-251-1/+1
| | | | | | | | | | | | | | | | | Setting this flag prevents declarations of uniforms from being removed from the IR. Since the IR is directly used by several API functions that query uniforms in shaders, uniform declarations cannot be removed after the locations have been set. However, it should still be safe to reorder the declarations (this is not tested). Signed-off-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41980 Tested-by: Brian Paul <[email protected]> Reviewed-by: Bryan Cain <[email protected]> Cc: Vinson Lee <[email protected]> Cc: José Fonseca <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Yuanhan Liu <[email protected]>
* mesa: Remove unnecessary and incorrect TexEnv parameter validation.Kenneth Graunke2011-10-251-6/+0
| | | | | | | | | | | | | | | | | For GL_RGB_SCALE and GL_ALPHA_SCALE targets, the API wrapper code attempts to ensure the parameter is 1.0, 2.0, or 4.0. This is unnecessary: set_combiner_scale in texenv.c (called by _mesa_TexEnvfv) already checks this and raises an appropriate error. It's also incorrect: For glTexEnvx, the API validation code directly compares the GLfixed input parameter with a floating point constant, prior to converting fixed-point to floating point. Fixes an issue in the OpenGL ES 1.1 conformance suite. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: fix comment languageBrian Paul2011-10-251-2/+2
|
* mesa: Fix memory leak in out-of-memory path.Vinson Lee2011-10-241-0/+1
| | | | | | Fixes Coverity resource leak defect. Reviewed-by: Brian Paul <[email protected]>
* Only use gcc visibility support with gcc4+.Tom Fogal2011-10-241-1/+1
| | | | | | | | | I had a colleague hitting issues compiling with an old gcc3.2 system. These patches got them through. NOTE: This is a candidate for the 7.11 branch. Reviewed-by: Brian Paul <[email protected]>
* mesa: Avoid ABA problem on buffer object bind.Mathias Fröhlich2011-10-242-1/+13
| | | | | | | | | | | | | | Make sure we do not run into the classic ABA problem on buffer object bind, reusing this name and may be never rebind since we get an new name that was just deleted and never rebound in between. The explicit rebinding to the debault object in the current context prevents the above in the current context, but another context sharing the same objects might suffer from this problem. Minor var renaming and comments edited by Brian. Signed-off-by: Mathias Fröhlich <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* mesa: remove dead code from teximage.cBrian Paul2011-10-231-29/+0
|
* mesa: Fix multithreaded buffer object refcounting.Mathias Fröhlich2011-10-231-72/+151
| | | | | | | | | | Buffer objects may be shared across contexts. Rework the array attrib push/pop implementation to be thread safe. Make use of more library functions for this purpose. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove _mesa_alloc_texmemory(), _mesa_free_texmemory()Brian Paul2011-10-232-57/+0
| | | | Core Mesa no longer does any texture memory allocation.
* mesa: move gl_texture_image::Data, RowStride, ImageOffsets to swrastBrian Paul2011-10-237-38/+32
| | | | | | Only swrast and the drivers that fall back to swrast need these fields now. This removes the last of the fields related to software rendering from gl_texture_image.
* mesa: improve the warning message in _mesa_choose_tex_format()Brian Paul2011-10-231-1/+3
| | | | Bug 42128 hits this _mesa_warning() call.
* Convert additional GNUC_MINOR checks to multiplied versionAlan Coopersmith2011-10-211-3/+3
| | | | | | Signed-off-by: Alan Coopersmith <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* Fix gcc version checks for _mesa_bitcountAlan Coopersmith2011-10-212-2/+2
| | | | | | | | | | | | | | - Fix _GNUC__ typo in both checks - Fix logic error in check for gcc < 3.4 that breaks for gcc 2.x & older Without this fix, builds with gcc 3.4.x end up depending on undefined _mesa_bitcount instead of gcc's __builtin_popcount. NOTE: This is a candidate for the stable branches. Signed-off-by: Alan Coopersmith <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix detection of whether an ARB_vp is enabled for two sided lighting.Eric Anholt2011-10-201-1/+1
| | | | | | | | | | When there is no ARB_vertex_program program enabled, the Current pointer points at a default program, so we were always using VERTEX_PROGRAM_TWO_SIDE, even for fixed function lighting. Fixes piglit two-sided-lighting* Reviewed-by: Brian Paul <[email protected]>
* mesa: Round the argument to PixelStoref instead of truncating.Eric Anholt2011-10-202-1/+9
| | | | | | | | | | | | | | | From the GL 2.1 specification, page 114 (page 128 of the PDF): "The version of PixelStore that takes a floating-point value may be used to set any type of parameter; if the parameter is boolean, then it is set to FALSE if the passed value is 0.0 and TRUE otherwise, while if the parameter is an integer, then the passed value is rounded to the nearest integer." Fixes piglit roundmode-pixelstore. Note: This is a candidate for the 7.11 branch. Reviewed-by: Brian Paul <[email protected]>
* mesa: handle PBO access error in display list modeYuanhan Liu2011-10-201-0/+2
| | | | | | | | | Simply generate GL_INVALID_OPERATION error at display list mode. As explained by Brian, we are going to access PBO data at compile time. No need to defer the error at execution time. Signed-off-by: Yuanhan Liu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: better debug messages in _mesa_test_texobj_completeness()Brian Paul2011-10-191-19/+22
| | | | And use a gl_texture_image var to simplify the code a bit.
* mesa: handle the pbo case for save_BitmapYuanhan Liu2011-10-191-7/+15
| | | | | | | | | | Wrap _mesa_unpack_bitmap to handle the case that data is stored in pixel buffer object. This would make calling Bitmap with data stored in PBO by display list work. Signed-off-by: Yuanhan Liu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: fix inverted pbo test error at _mesa_GetnCompressedTexImageARBYuanhan Liu2011-10-191-1/+1
| | | | | | | It seems like a typo. Signed-off-by: Yuanhan Liu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: generate error if pbo offset is not aligned with the size of specified ↵Yuanhan Liu2011-10-191-0/+13
| | | | | | | | | | | | | | | | type v2: quote the spec; explicitly exclude the GL_BITMAP case to make code more readable. (comments from Ian) v3: Cast the offset by GLintptr to remove the compile warning(comments from Brian). I also found that I should use _mesa_sizeof_packed_type() instead, as it includes packed pixel type, like GL_UNSIGNED_SHORT_5_6_5. Signed-off-by: Yuanhan Liu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: use format string in _mesa_error() call to silence warningBrian Paul2011-10-181-1/+1
|
* mesa: Use glsl_type::gl_type in glGetActiveUniformIan Romanick2011-10-181-2/+4
| | | | | | | This has the same value has gl_program_parameter::DataType field. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Move _mesa_GetActiveUniformARB to uniform_query.cppIan Romanick2011-10-183-60/+82
| | | | | | | | Fold _mesa_get_active_uniform into its only caller in the process. More changes are coming soon. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Simplify uniform debug logging logicIan Romanick2011-10-181-19/+3
| | | | | | | | | This simplificiation was enabled by the earlier refactors that eliminated the references to the assembly shaders stored in the gl_shader_program structure. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add dd_function_table::PrepareExecBeginChad Versace2011-10-181-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This hook allows the driver to prepare for a glBegin/glEnd. i965 will use the hook to avoid avoid recursive calls to FLUSH_VERTICES during a buffer resolve meta-op. Detailed Justification ---------------------- When vertices are queued during a glBegin/glEnd block, those vertices must of course be drawn before any rendering state changes. To enusure this, Mesa calls FLUSH_VERTICES as a prehook to such state changes. Therefore, FLUSH_VERTICES itself cannot change rendering state without falling into a recursive trap. This precludes meta-ops, namely i965 buffer resolves, from occuring while any vertices are queued. To avoid that situation, i965 must satisfy the following condition: that it queues no vertex if a buffer needs resolving. To satisfy this, i965 will use the PrepareExecBegin hook to resolve all buffers on entering a glBegin/glEnd block. -------- v2: Don't add dd_function_table::CleanupExecEnd. Anholt and I discovered that hook to be unnecessary. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* mesa: Declare _mesa_RenderMode as non-staticChad Versace2011-10-182-1/+4
| | | | | | | | This is required in order for meta-ops to save/restore the GL_RENDER_MODE state. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* mesa: Make the program texel offsets limits available with GLSL 1.30.Eric Anholt2011-10-181-5/+12
| | | | | | | | | | It was previously under gpu_shader4, but I'm pretty sure everyone's going to be doing GLSL 1.30 first (since gpu_shader4 is basically 1.30 plus a bunch of extra stuff). Fixes piglit glsl-1.30/texel-offset-limits. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Convert fixed function fragment program generator to GLSL IR.Eric Anholt2011-10-183-753/+687
| | | | | | | | This is a step towards providing a direct route for drivers accepting GLSL IR for codegen. Perhaps more importantly, it runs the fixed function fragment program through the GLSL IR optimization. Having seen how easy it is to make ugly fixed function texenv code that can do unnecessary work, this may improve real applicatinos.
* mesa: Add a flag for shader programs to allow SSO linkage in GLES2.Eric Anholt2011-10-181-0/+11
| | | | | | | | On converting fixed function programs to generate GLSL, the linker became cranky that we were trying to make something that wasn't a linked vertex+fragment program. Given that the Mesa GLES2 drivers also support desktop GL with EXT_sso, just telling the linker to shut up seems like the easiest solution.
* ff_fragment_shader: Use FRAG_RESULT_COLOR to write all our colors at once.Eric Anholt2011-10-181-12/+3
| | | | | This is a slight simplification on the way to actually generating GLSL fragment shaders.
* mesa: add a function to do the image data copy stuff for ↵Yuanhan Liu2011-10-171-75/+27
| | | | | | | | | | | | save_CompressedTex(Sub)Image Introuduce a simple function called copy_data to do the image data copy stuff for all the save_CompressedTex*Image function. The function check the NULL data case to avoid some potential segfault. This also would make the code a bit simpler and less redundance. Signed-off-by: Yuanhan Liu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove unused gl_sampler_object::_CompleteTexture fieldBrian Paul2011-10-131-3/+0
|
* s/format/baseFormat/ to be more explicitBrian Paul2011-10-131-5/+5
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove redundant buffer checks in copytexsubimage_error_check2()Brian Paul2011-10-131-17/+0
| | | | | | | Again, there was already a call to _mesa_source_buffer_exists() earlier in the function. Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove redundant buffer checks in copytexture_error_check()Brian Paul2011-10-131-16/+0
| | | | | | | There was already a call to _mesa_source_buffer_exists() earlier in the function. Reviewed-by: Eric Anholt <[email protected]>
* mesa: check attachment Type field in renderbuffer_exists()Brian Paul2011-10-131-10/+4
| | | | | | Instead of the renderbuffer pointer. In the future, attaching a texture may not mean the renderbuffer pointer gets set too. Plus, remove some commented-out assertions.
* mesa: consolidate _mesa_source/dest_buffer_exists()Brian Paul2011-10-131-87/+43
| | | | | | v2: add a 'reading' parameter to distinguish between reading and writing to the renderbuffer (we don't want to check if _ColorReadBuffer is null when we're about to draw). Eric found this mistake.