summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* i965/vs: Add support for splitting virtual GRFs.Eric Anholt2012-10-103-0/+62
| | | | | | | | | | This should improve our ability to register allocate without spilling. Unfortuantely, due to the live variable analysis being ignorant of loops, we still have register allocation failures on some programs. v2: Add more context to the comment explaining the function. Reviewed-by: Kenneth Graunke <[email protected]> (v1)
* i965/vs: Try again when we've successfully spilled a reg.Eric Anholt2012-10-103-10/+16
| | | | | | | | Before, we'd spill one reg, then continue on without actually register allocating, then assertion fail when we tried to use a vgrf number as a register number. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vs: Implement register spilling.Kenneth Graunke2012-10-103-1/+144
| | | | | | | | | | | | | | To validate this code, I ran piglit -t vs quick.tests with the "go spill everything" debugging code enabled. There was only one regression: glsl-vs-unroll-explosion simply ran out of registers. This should be fine in the real world, since no one actually spills every single register. NOTE: This is a candidate for the 9.0 branch. Even if it proves to have bugs, it's likely better than simply failing to compile. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/vs: Fix unit mismatch in scratch base_offset parameter.Kenneth Graunke2012-10-103-4/+8
| | | | | | | | | | | | | | | | | | | | | move_grf_array_access_to_scratch() calculates scratch buffer offsets in bytes. However, emit_scratch_read/write() expects the base_offset parameter to be measured in OWords. As a result, a shader using a scratch read/write offset greater than zero (in practice, a shader containing more than one variable in scratch) would use too large an offset, frequently exceeding the available scratch space. This patch corrects the mismatch by removing spurious conversion from OWords to bytes in move_grf_array_access_to_scratch(). This is based on a patch by Paul Berry. NOTE: This is a candidate for stable release branches. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Avoid C99 indexed initializers.José Fonseca2012-10-102-5/+29
| | | | | | Not supported by MSVC. Reviewed-by: Imre Deak <[email protected]>
* mesa: Prevent CONST macro re-definition.José Fonseca2012-10-101-0/+1
| | | | | | | Should fix MSVC build, as windows.h also defines CONST. CONST usage in get.c is not new, so probably this just appeared now due to changes in the includes.
* mesa: Silence 'assignment makes integer from pointer without a cast' warnings.José Fonseca2012-10-101-2/+2
|
* glget: fix make check for glGet GL_POLYGON_OFFSET_BIASImre Deak2012-10-101-1/+1
| | | | | | | | | | | This got broken by: 7182a1f glapi: rename/move GL_POLYGON_OFFSET_BIAS to its extension section Fix it by appending the _EXT suffix to the enum in the test too. Signed-off-by: Imre Deak <[email protected]> Reviewed-by: Oliver McFadden <[email protected]>
* mesa: glGet: remove the unused TYPE_API_MASK flagsImre Deak2012-10-101-6/+0
| | | | | | | | | Since we generate the hash tables in build time, these flags aren't used any more, remove them. Signed-off-by: Imre Deak <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Oliver McFadden <[email protected]>
* mesa: glGet: use the build time generated hash tablesImre Deak2012-10-102-1015/+13
| | | | | | Signed-off-by: Imre Deak <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Oliver McFadden <[email protected]>
* mesa: glGet: add script to generate hash tables in build timeImre Deak2012-10-106-2/+984
| | | | | | | | | | | | | | | This will be needed by the next patch, which will switch to using the parameter descriptor- and hash tables generated by the script. The hash algorithm remains the same, the output parameter descriptor table format changes slightly. There the TYPE_API_MASK entries are removed and an invalid NULL entry is inserted at the beginning. This is ok, as get.c:find_value() doesn't rely on TYPE_API_MASK any more to detect an invalid enum. Signed-off-by: Imre Deak <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Oliver McFadden <[email protected]>
* scons/android: add flag to check for enabled GL APIsImre Deak2012-10-102-9/+9
| | | | | | | | Needed by the next patch. Signed-off-by: Imre Deak <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Oliver McFadden <[email protected]>
* mesa: glGet: rename *{_EXT,_ARB} enums missing from the XML specImre Deak2012-10-101-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following enums used to be extensions but later became part of the core specification. The _EXT/_ARB versions of these are not present in in the current XML spec files, only defined in GL/glext.h Later we'll need to look up these in a python script using the XML spec. As a preparation for that remove the _EXT,_ARB suffix from these enums and rename GL_DISTANCE_ATTENUATION_EXT to GL_POINT_DISTANCE_ATTENUATION. Naturally, all enums keep their numerical values. Note that similar renames shouldn't be necessary in the future: in case of a new extension the XML spec is updated with the new _EXT/_ARB etc. name and this name is added to the enum table in get.c. Later the extension may become part of the core spec, at which point the name w/o the _EXT/_ARB suffix is added to the XML spec and the table in get.c remains the same. GL_BLEND_DST_ALPHA_EXT GL_BLEND_DST_RGB_EXT GL_BLEND_SRC_ALPHA_EXT GL_BLEND_SRC_RGB_EXT GL_COLOR_SUM_EXT GL_COMPRESSED_TEXTURE_FORMATS_ARB GL_CURRENT_FOG_COORDINATE_EXT GL_CURRENT_SECONDARY_COLOR_EXT GL_DISTANCE_ATTENUATION_EXT GL_FOG_COORDINATE_ARRAY_EXT GL_FOG_COORDINATE_ARRAY_STRIDE_EXT GL_FOG_COORDINATE_ARRAY_TYPE_EXT GL_FOG_COORDINATE_SOURCE_EXT GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB GL_PACK_IMAGE_HEIGHT_EXT GL_PACK_SKIP_IMAGES_EXT GL_SECONDARY_COLOR_ARRAY_EXT GL_SECONDARY_COLOR_ARRAY_SIZE_EXT GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT GL_SECONDARY_COLOR_ARRAY_TYPE_EXT GL_UNPACK_IMAGE_HEIGHT_EXT GL_UNPACK_SKIP_IMAGES_EXT Signed-off-by: Imre Deak <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Oliver McFadden <[email protected]>
* mesa: glGet: simplify the 'enum not found' conditionImre Deak2012-10-101-3/+5
| | | | | | | | | | | | | | | | | When traversing the hash table looking up an enum that is invalid we eventually reach the first element in the descriptor array. By looking at the type of that element, which is always TYPE_API_MASK, we know that we can stop the search and return error. Since this element is always the first it's enough to check for its index being 0 without looking at its type. Later in this patchset, when we generate the hash tables during build time, this will allow us to remove the TYPE_API_MASK and related flags completly. Signed-off-by: Imre Deak <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Oliver McFadden <[email protected]>
* mesa: glGet: fix parameter lookup for apps using multiple APIsImre Deak2012-10-103-18/+33
| | | | | | | | | | | | | The glGet hash was initialized only once for a single GL API, even if the application later created a context for a different API. This resulted in glGet failing for otherwise valid parameters in a context if that parameter was invalid in another context created earlier. Fix this by using a separate hash table for each API. Signed-off-by: Imre Deak <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Oliver McFadden <[email protected]>
* mesa/tests: Remove driverCtx parameter from call to _mesa_initialize_contextIan Romanick2012-10-091-2/+1
| | | | | | Fixes 'make check' breakage since 733dba2. Signed-off-by: Ian Romanick <[email protected]>
* intel: Add missing #include <time.h>Quentin Glidic2012-10-091-0/+1
| | | | | | | | Commit 006c1a3c652803e2ff8d5f7ea55c9cb5d8353279 introduced a call to clock_gettime, but failed to include <time.h>, breaking the build in some cases. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Delete some dead code from brw_eu_emit.c.Kenneth Graunke2012-10-092-120/+0
| | | | Presumably some of this was used by the old fragment shader backend.
* mesa: remove unused _mesa_cpal_compressed_format_type() functionBrian Paul2012-10-092-18/+0
| | | | Reviewed-by: Ian Romanick <[email protected]>
* teximage: Remove unnecessary compressed format checkDaniel Stone2012-10-091-4/+0
| | | | | | | | | Ever since df4a88ac, the check for compressed formats has been unnecessary. And ever since cb72ec5f, the build has been broken with FEATURE_ES. Remove it, as it does nothing. Signed-off-by: Daniel Stone <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* Revert "st/mesa: remove unused variables to fix compile warnings"Brian Paul2012-10-081-0/+2
| | | | | | | This reverts commit 810d2e167c5a507084d1865a260809b847ca3201. The pscreen variable is used in an assertion. Use "(void) pscreen;" to silence the warning.
* mesa: minor whitespace fixes in teximage.cBrian Paul2012-10-081-2/+2
|
* st/mesa: remove unused variables to fix compile warningsMarek Olšák2012-10-091-1/+0
|
* mesa: remove unused variables to fix compile warningsMarek Olšák2012-10-091-7/+0
|
* i965/fs: Improve performance of copy/constant propagation.Eric Anholt2012-10-082-18/+30
| | | | | | | | Use a simple chaining hash table for the ACP. This is not really very good, because we still do a full walk of the tree per destination write, but it still reduces fp-long-alu runtime from 5.3 to 3.9s. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Move constant propagation to the same codebase as copy prop.Eric Anholt2012-10-083-165/+124
| | | | | | | | | | This means that we don't get constant prop across into the first block after a BRW_OPCODE_IF or a BRW_OPCODE_DO, but we have hope for properly doing it across control flow at some point. More importantly, with the next commit it will help avoid O(n^2) with instruction count runtime for shaders that have many constant moves. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Remove the old ARB_fragment_program backend.Eric Anholt2012-10-089-4810/+0
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Replace brw_wm_* with dumping code into the fs_visitor.Eric Anholt2012-10-0810-109/+860
| | | | | | | | | | | This makes a giant pile of code newly dead. It also fixes TXB on newer chipsets, which has been totally broken (I now have a piglit test for that). It passes the same set of Ian's ARB_fragment_program tests. It also improves high-settings ETQW performance by 3.2 +/- 1.9% (n=3), thanks to better optimization and having 8-wide along with 16-wide shaders. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=24355 Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Reduce maximum GL_ARB_fragment_program instruction count to 1024.Eric Anholt2012-10-081-4/+4
| | | | | | | | | I don't know of any programs that would need more than this. The larger programs I've seen have neared 100 instructions. This prevent excessive runtimes of automatic tests that attempt to test up to the exposed maximums (like fp-long-alu). Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Add a couple more algebraic cases that help some ARB_fp patterns.Eric Anholt2012-10-081-0/+23
| | | | | | | ARB_fp doesn't go through the GLSL optimizer, and these were things you see frequently thanks to conditionals being lowered to SLT/SGE and MUL. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Pull ir_binop_min/ir_binop_max handling to a separate function.Eric Anholt2012-10-082-31/+23
| | | | | | | | | | | | | This will be reused from the ARB_fp compiler. I touched up the pre-gen6 path to not overwrite dst in the first instruction, which prevents the need for aliasing checks (we'll need that in the ARB_fp compiler, but it actually hasn't been needed in this codebase since the revert of the nasty old MOV-avoidance code). I also made the conditional_mod between gen6 and pre-gen6 consistent, which shouldn't matter except for denorm/(+/-)0 comparisons where the choice between left and right hand side of the comparison changes. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Refactor rectangle/GL_CLAMP texture coordinate adjustment.Eric Anholt2012-10-082-21/+16
| | | | | | | | We'll want to reuse this for ARB_fp handling. v2: Fold the remaining bit of emit_texcoord back into visit(ir_texture). Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Pass fragment depth to the fb write as a fs_reg, not an ir_variable.Eric Anholt2012-10-082-7/+4
| | | | | | This will be used for the ARB_fp change to use this backend. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Note that OPCODE_RFL is not part of ARB_fp (it's NV_fp only).Eric Anholt2012-10-081-1/+1
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Make shader template literal strings be parameters to asprintfIan Romanick2012-10-071-25/+18
| | | | | | | | | | This enables the C compiler to generate warnings if the formats and the arguments don't match. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* meta: Always enable GL_EXT_texture_array in mipmap shaderIan Romanick2012-10-071-7/+2
| | | | | | | | | | | '#extension foo: enable' is harmless. The functionality is only actually enabled if the extension is supported. The shader won't use the functionality if it's not supported, so we're fine. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* meta: Since mipmap output type is always vec4, don't sprintf itIan Romanick2012-10-071-2/+2
| | | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* meta: Don't use GLSL 1.30 shader on OpenGL ES 2Ian Romanick2012-10-071-1/+1
| | | | | | | | | | | Fixes GLES2 CoverageGL conformance test. NOTE: This is a candidate for the 9.0 branch. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* meta: Rearrange shader creation in setup_glsl_generate_mipmapIan Romanick2012-10-071-42/+43
| | | | | | | | | | | | | The diff looks weird, but this moves the code from the first 'if (ctx->Const.GLSLVersion < 130)' block down into the second block. It also moves some variable decalarations closer to their use. NOTE: This is a candidate for the 9.0 branch. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* meta: Remove unsafe global mem_ctx pointerIan Romanick2012-10-071-1/+1
| | | | | | | | | NOTE: This is a candidate for the 9.0 branch. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: remove the driverCtx parameter to _mesa_create/initialize_context()Brian Paul2012-10-0510-21/+13
| | | | No longer used.
* mesa: remove unused gl_context::DriverCtx fieldBrian Paul2012-10-053-4/+0
|
* radeon/r200: remove use of gl_context::DriverCtx fieldBrian Paul2012-10-054-8/+16
|
* radeon/r200: make radeon_context subclass of gl_contextBrian Paul2012-10-0527-105/+106
| | | | | radeon_context now contains a gl_context, rather than a pointer to one. This will allow some minor core Mesa clean-up.
* mesa: Flag _NEW_VARYING_VP_INPUTS when TexEnv programs are active.Kenneth Graunke2012-10-051-1/+2
| | | | | | | | | | | | | | | | | The idea here is to not flag _NEW_VARYING_VP_INPUTS when shaders (either GLSL or ARB vp/fp) are in use. If either TNL or TexEnv programs are active, at least one stage is using fixed function. On Pineview, fixes 20 Piglit, 60 oglconforms, and 7 ES 1.1 conformance tests, as well as missing textures in Xonotic. These were all regressions since commit fb4a34e60eb4c1bdc7b0fdcd98d1bf3038c354e8. NOTE: This is a candidate for the 9.0 branch. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49127 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54807 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: don't enable glVertexPointer() when using API_OPENGLES2.Paul Berry2012-10-041-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This function is only present in GLES1 and in the OpenGL compatibility profile. Fixes the following "make check" failure: [----------] 1 test from DispatchSanity_test [ RUN ] DispatchSanity_test.GLES2 Mesa warning: couldn't open libtxc_dxtn.so, software DXTn compression/decompression unavailable dispatch_sanity.cpp:122: Failure Value of: table[i] Actual: 0x4de54e Expected: (_glapi_proc) _mesa_generic_nop Which is: 0x41af72 i = 321 [ FAILED ] DispatchSanity_test.GLES2 (4 ms) [----------] 1 test from DispatchSanity_test (4 ms total) NOTE: This is a candidate for stable release branches. Reviewed-by: Oliver McFadden <[email protected]> Tested-by: Oliver McFadden <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: don't call TexImage driver hooks for zero-sized imagesBrian Paul2012-10-041-7/+9
| | | | | | | This simply avoids some failed assertions but there's no reason to call the driver hooks for storing a tex image if its size is zero. Note: This is a candidate for the stable branches.
* intel: Fix intel_texsubimage_tiled_memcpy to skip GL_EXT_unpack_subimage caseRob Bradford2012-10-031-1/+4
| | | | | | | | | 413c49141 added an optimisation to improve the performance of teximage under a limited set of circumstances. If GL_EXT_unpack_subimage has been used then we we must also skip this optimisation since the optimised codepath does not take the packing values into consideration. Reviewed-by: Chad Versace <[email protected]>
* dri drivers: Link dricommon before dynamic librariesMatt Turner2012-10-035-10/+10
| | | | | | | | | I think libtool should be handling this for us, but the build fails for Jordan because libdricommon (a static library, which uses expat) appears before -lexpat on the linker command. Reviewed-by: Jordan Justen <[email protected]> Tested-by: Jordan Justen <[email protected]>
* register_allocate: don't consider trivially colorable registers for spilling.Paul Berry2012-10-031-0/+7
| | | | | | | | | | | | | | | | | Previously, we considered all registers as candidates for spilling. This was counterproductive--for any registers that have already been removed from the interference graph, there is no benefit to spilling them, since they don't contribute to register pressure. This patch ensures that we will only try to spill registers that are still in the interference graph after register allocation has failed. This is consistent with the recommendations of the paper "Retargetable Graph-Coloring Register Allocation for Irregular Architectures", on which our register allocator is based. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Eric Anholt <[email protected]>