summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* meta: Add on demand compilation of per target shader programsAnuj Phogat2012-09-211-57/+84
| | | | | | | | | | | | | | | | | A call to glGenerateMipmap() follows the generation of a relevant shader program in setup_glsl_generate_mipmap(). To support all texture targets and to avoid compiling shaders everytime, per target shader programs are compiled on demand and saved for the next call. Fixes float-texture(mipmap.manual): See Comment 6: https://bugs.freedesktop.org/show_bug.cgi?id=54296 NOTE: This is a candidate for stable branches. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* i965/blorp: Fix narrowing warnings.Paul Berry2012-09-211-3/+3
| | | | | | | | | | | Blorp has to convert rectangle coordinates from integers to floats in order to send them down the GPU pipeline. Recent versions of GCC issue a warning for this, since a float is not capable of precisely representing all possible 32-bit integer values. Suppress the warning with an explicit type cast in the case of blorp, since rectangle coordinates will never be large enough to cause a loss of precision. Reviewed-by: Eric Anholt <[email protected]>
* i965: Remove brw_set_predicate_inverse(p, true) from scratch offset codeKenneth Graunke2012-09-211-1/+0
| | | | | | | | | | | | | | Given that it exists between a push/pop of instruction state, this call can only affect the MOV or ADD instruction generated just below it. Neither of those instructions are predicated, so it makes no sense to ask for the inverse predicate. This fixes grumblings from the simulator debugger, which was complaining about an invalid predicate. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Don't override S3TC internalFormat if data is pre-compressed.Kenneth Graunke2012-09-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Commit 42723d88d intended to override an S3TC internalFormat to a generic compressed format when the application requested online compression of uncompressed data. Unfortunately, it also broke pre-compressed textures when libtxc_dxtn isn't installed but the extensions are forced on. Both glCompressedTexImage2D() and glTexImage2D() call teximage(), which calls _mesa_choose_texture_format(), hitting this override code. If we have actual S3TC source data, we can't treat it as any other format, and need to avoid the override. Since glCompressedTexImage2D() passes in a format of GL_NONE (which is illegal for glTexImage), we can use that to detect the pre-compressed case and avoid the overrides. Fixes a regression since 42723d88d370a7599398cc1c2349aeb951ba1c57. NOTE: This is a candidate for the 9.0 branch. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-and-tested-by: Jordan Justen <[email protected]>
* i965/blorp: Add support for blits between SRGB and linear formats.Kenneth Graunke2012-09-202-4/+8
| | | | | | | | | | | | Fixes colorspace issues in L4D2 when multisampling is enabled (the scene was far too dark, but the flashlight area was way too bright). The nVidia and AMD binary drivers both allow this kind of blit. NOTE: This is a candidate for the 9.0 branch. Reviewed-by: Paul Berry <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* mesa: Ignore SRGB when determining compatible resolve formats.Kenneth Graunke2012-09-201-1/+2
| | | | | | | | | | | | | | | MSAA resolves and other blit-like operations ignore SRGB state anyway, so we should be able to safely allow resolves between compatible SRGB/linear formats like SRGBA8 and RGBA8888. This matches the behavior of the nVidia and AMD binary drivers. Fixes completely black rendering when using multisampling in L4D2. NOTE: This is a candidate for the 9.0 branch. Reviewed-by: Paul Berry <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* mesa: Allow glGetTexParameter of GL_TEXTURE_SRGB_DECODE_EXTIan Romanick2012-09-201-0/+12
| | | | | | | | | This was already (correctly) supported for glGetSamplerParameter paths. NOTE: This is a candidate for stable branches. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* ra: Add q_values parameter to ra_set_finalize()Tom Stellard2012-09-194-4/+17
| | | | | | This allows the user to pass precomputed q values to the allocator. Reviewed-by: Kenneth Graunke <[email protected]>
* ra: Clarify usage of ra_set_node_reg()Tom Stellard2012-09-191-0/+2
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* Revert "mesa: consolidate subtexture x/y/width/height error checking code"Brian Paul2012-09-191-73/+84
| | | | | | This reverts commit 5b807400a87d5efefc481017eb420b772933e1da. accidentally pushed.
* Revert "more comment"Brian Paul2012-09-191-2/+4
| | | | | | This reverts commit 5205db6a7ce623a7fca72e6dc6391bd12be3f6aa. accidentally pushed
* Revert "mesa: clean-up and fix glCompressedTexSubImage error checking"Brian Paul2012-09-191-81/+64
| | | | | | This reverts commit 0c67fe5d2dc6d8066fc23c39184d9614abf63992. accidentally pushed.
* mesa: clean-up and fix glCompressedTexSubImage error checkingBrian Paul2012-09-191-64/+81
|
* more commentBrian Paul2012-09-191-4/+2
|
* mesa: consolidate subtexture x/y/width/height error checking codeBrian Paul2012-09-191-84/+73
| | | | | This is the code that checks if a subtexure region is aligned to the compressed format's block size.
* st/mesa: implement new proxy texture codeBrian Paul2012-09-172-1/+73
| | | | | | | If the gallium driver implements the can_create_resource() function, call it to do proxy texture size checks. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: take cube faces into account in _mesa_test_proxy_teximage()Brian Paul2012-09-171-0/+1
| | | | | There will always be six cube faces so take that into consideration when computing the texture size and comparing against the limit.
* mesa: handle GL_PROXY_TEXTURE_CUBE_MAP in _mesa_num_tex_faces()Brian Paul2012-09-171-1/+7
|
* mesa: move/fix levels check for glTexStorage()Brian Paul2012-09-171-8/+8
| | | | | | Fix copy&paste error and move min levels check closer to max levels check. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: rewrite glTexStorage() codeBrian Paul2012-09-171-74/+79
| | | | | | | | Simplify the code and make it more like the other glTexImage commands. Call _mesa_legal_texture_dimensions() to validate width, height, depth. Call ctx->Driver.TestProxyTexImage() to make sure texture is not too large. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: rework texture size error checkingBrian Paul2012-09-174-225/+161
| | | | | | | | | | | | | | | | | | | | | | There are two aspects to texture image size checking: 1. Are the width, height, depth legal values (not negative, not larger than the max size for the mipmap level, etc)? 2. Is the texture just too large to handle? For example, we might not be able to really allocate memory for a 3D texture of maxSize x maxSize x maxSize. Previously, we did (1) via the ctx->Driver.TestProxyTextureImage() hook but those tests are really device-independent. Now we do (2) via that hook since the max texture memory and texture shape are device-dependent. Also, (1) is now done outside the general texture parameter error checking functions because of the special interaction with proxy textures. The recently introduced PROXY_ERROR token is removed. The teximage() and copyteximage() functions are bit simpler now (less if-then nesting, etc.) Reviewed-by: Jose Fonseca <[email protected]>
* mesa: refactor _mesa_test_proxy_teximage() codeBrian Paul2012-09-172-30/+56
| | | | | | | Basically, move the body into a new _mesa_legal_texture_dimensions() function. More refactoring to come. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: move glTexImage 'level' error checkingBrian Paul2012-09-171-22/+10
| | | | | | | Move level checking out of _mesa_test_proxy_teximage() and into the other error-checking functions. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: change create_version_string() return type to voidBrian Paul2012-09-171-1/+1
| | | | Fixes "warning: no return statement in function returning non-void"
* glsl: make _mesa_builtin_uniform_desc staticDave Airlie2012-09-181-2/+0
| | | | | | | I can't see any reason this is global (unless for debugging) Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* main/version: consolodate version string creation for ES/Desktop GLJordan Justen2012-09-171-34/+24
| | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965: Stop putting 8 NOPs after each prorgam.Eric Anholt2012-09-171-8/+0
| | | | | | | | | | | | | As far as I can see, the intention of the requirement that we do so is to prevent instruction prefetch from wandering out into either unmapped memory or memory with a different caching type, and hanging the chip. The kernel makes sure that the page after your BO has a valid page of the same caching type, which meets this requirement, so there's no need to waste space between our programs (and in instruction cache) on this. Saves another 9kb instructions in l4d2 shaders. Acked-by: Kenneth Graunke <[email protected]>
* i965: Test instruction compaction on gen7Eric Anholt2012-09-172-10/+23
|
* i965: Add support for instruction compaction on Gen7.Kenneth Graunke2012-09-173-33/+220
| | | | | | | | | | Reduces l4d2 program size from 1195kb to 919kb. Improves performance by 0.22% +/- 0.11% (n=70). v2: Rebase on compaction v2, fix up flag reg handling (by anholt). v3: Fix uncompaction of the flag register number. Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Support instruction compaction between control flow.Eric Anholt2012-09-171-28/+92
| | | | Reviewed-by: Paul Berry <[email protected]>
* i965: Add support for instruction compaction.Eric Anholt2012-09-1710-8/+946
| | | | | | | | | | | | | | | This reduces program size by using some smaller encodings for common bit patterns in the Gen ISA, with the hope of making programs fit in the instruction cache better. v2: Use larger bitshifts for the uncompressed field setups, in line with the way it's described in the spec. Consistently name a brw_compile "p" like all other code. Add a couple more tests. Consistently call things "compacted" not "compressed" (which is a different feature). Drop the explicit check for not compacting SENDs, which is unjustified and already implied by our lack of support for immediate values. Reviewed-by: Paul Berry <[email protected]>
* i965: Prepare the break/cont uip/jip setting for compacted instructions.Eric Anholt2012-09-171-14/+43
| | | | | | | | | The first cut at instruction compaction won't compact things that would change control flow jump distances, but we do need to still be able to walk the instruction stream, which involves jumping by 8 or 16 bytes between instructions. Reviewed-by: Paul Berry <[email protected]>
* i965: Move program dump to a helper function in brw_eu.c.Eric Anholt2012-09-177-55/+40
| | | | | | | | | It's going to get more complicated when we do instruction compaction. This also introduces putting the program offset in the output. v2: Use next_insn_offset in brw_get_program(), too. Reviewed-by: Paul Berry <[email protected]>
* i965: Make a linkable library for the contents of i965_dri.so.Eric Anholt2012-09-172-5/+13
| | | | | | | | To do unit testing of i965, we want to be able to link against the driver's symbols and prod them. If we don't have a separate lib from our loadable module, libtool gets super whiny. Acked-by: Paul Berry <[email protected]>
* dri: Reuse dri_test.c for stub glapi symbols for unit testing.Eric Anholt2012-09-172-1/+9
| | | | | | | | This file is used to provide stubs for the link test in gallium dri drivers. But the same stubs without the main can be used for making unit tests for code in a dri driver. Acked-by: Paul Berry <[email protected]>
* i965: Clear brw_compile on setup.Eric Anholt2012-09-171-0/+2
| | | | | | | | I noticed in valgrind that p->single_program_flow was used while uninitialized. Everything else zeroed out brw_compile, but this is better API. Reviewed-by: Paul Berry <[email protected]>
* mesa/es: Define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT enum for all GLsTomeu Vizoso2012-09-161-5/+5
| | | | | | | instead of just for GL and ES1. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: fix dropped && in glGetStringi()Chris Forbes2012-09-161-1/+1
| | | | | | | | | | This fixes glGetStringi(GL_EXTENSIONS,.. for core contexts. Previously, all extension names returned would be NULL. NOTE: This is a candidate for release branches. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Don't _mesa_set_enable() invalid targets in ES 1.Kenneth Graunke2012-09-151-8/+13
| | | | | | | | | | | | | | | | | | | | | GL_TEXTURE_1D, GL_TEXTURE_3D, GL_TEXTURE_RECTANGLE, and GL_TEXTURE_GEN_S/T/R/Q don't exist in ES 1 contexts, so any meta ops that used _mesa_meta_begin with MESA_META_TEXTURE would trigger GL errors. One such operation is _mesa_meta_Clear(). On ES 1, we want to disable GL_TEXTURE_GEN_STR_OES instead. Fixes the ES1 conformance test miplin.c, which was regressed by commit 08be1d288f216232d3974f5997b266a8dd720928. NOTE: This is a candidate for the 9.0 branch. v2: Also blacklist GL_TEXTURE_3D, per Brian's comment. v3: Disable GL_TEXTURE_GEN_STR_OES, per Ian's comment. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54297 Reviewed-by: Brian Paul <[email protected]> [v1] Signed-off-by: Kenneth Graunke <[email protected]>
* Temporarily revert "mesa: remove remaining FEATURE_* defines where protected ↵José Fonseca2012-09-158-2/+27
| | | | | | | | by API check." This reverts commit 9f37b405a3de8668a5f74c9681829688475ac3b7. Fixes windows builds.
* scons: add new -p (prefix) options for yaccBrian Paul2012-09-151-1/+1
| | | | These were recently added to the Makefiles.
* swrast: remove unused ati_fs_opcodes arrayBrian Paul2012-09-151-15/+0
|
* mesa: remove FEATURE_ES test in texcompress_cpal.cBrian Paul2012-09-151-4/+0
| | | | Fixes a regression after removing the #if FEATURE_x tests.
* mesa: remove never-defined FEATURE_histogram conditional.Oliver McFadden2012-09-152-15/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove remaining FEATURE_* defines where protected by API check.Oliver McFadden2012-09-158-27/+2
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove obsolete comments from mfeatures.hOliver McFadden2012-09-151-27/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_ATI_fragment_shader define.Oliver McFadden2012-09-158-56/+2
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_APPLE_object_purgeable define.Oliver McFadden2012-09-157-16/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_EXT_transform_feedback define.Oliver McFadden2012-09-1516-137/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_EXT_texture_sRGB define.Oliver McFadden2012-09-1510-39/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>