summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* egl: Log (debug) native platform typeBenjamin Franzke2011-08-151-12/+25
| | | | Reviewed-by: Kristian Høgsberg <[email protected]>
* egl: Native Display autodetectionBenjamin Franzke2011-08-155-8/+117
| | | | | | | | | | | | | | | | | | | | | | | | EGL doesnt define howto manage different native platforms. So mesa has a builtime configurable default platform, whith non-standard envvar (EGL_PLATFORM) overwrites. This caused unneeded bugreports, when EGL_PLATFORM was forgotten. Detection is grouped into basic types of NativeDisplays (which itself needs to be detected). The final decision is based on characteristcs of these basic types: File Desciptor based platforms (fbdev): - fstat(2) to check for being a fd that belongs to a character device - check kernel subsystem (todo) Pointer to structuctures (x11, wayland, drm/gbm): - mincore(2) to check whether its valid pointer to some memory. - magic elements (e.g. pointers to exported symbols): o wayland display stores interface type pointer (first elm.) o gbm stores pointer to its constructor (first elm.) o x11 as a fallback (FIXME?) Reviewed-by: Kristian Høgsberg <[email protected]>
* Destroy context in dri2/glx driver when apps call eglDestroyContextCooper Yuan2011-08-142-2/+38
|
* glapi: remove gen-esChia-I Wu2011-08-1313-7703/+0
| | | | Not used anymore.
* glapi: generate ES dispatch headers from core mesaChia-I Wu2011-08-134-14/+27
| | | | | | | | | | GLESv1 and GLESv2 have their own dispatch.h and remap_helper.h. These headers are only used by api_exec_es1.c and api_exec_es2.c in core mesa. Move the rules to generate them from glapi to core mesa. Reviewed-by: Brian Paul <[email protected]> [olv: updated after reviewing to fix SCons build]
* glapi: add glapi_gen.mk to help header generationChia-I Wu2011-08-133-17/+61
| | | | | | | | | | | glapi_gen.mk is supposed to be included by glapi users to simplify header generation. This commit also makes es1api, es2api, and shared-glapi use it. Reviewed-by: Brian Paul <[email protected]> [olv: updated after reviewing to prefix all variables in glapi_gen.mk by glapi_gen]
* glapi: use gl_and_es_API.xml to generate GLES headersChia-I Wu2011-08-135-23/+47
| | | | | | | | | | | | glapi/gen-es/ defines two sets of GLAPI XMLs for OpenGL ES 1.1 (es1_API.xml) and 2.0 (es2_API.xml) respectively. They are used to generate dispatch.h and remap_helper.h for GLES. Together with gl_and_es_API.xml, we have to maintain three sets of GLAPI XMLs. This commit makes dispatch.h and remap_helper.h for GLES be generated from gl_and_es_API.xml. Reviewed-by: Brian Paul <[email protected]>
* glapi: add methods to filter functionsChia-I Wu2011-08-131-7/+39
| | | | | | | add gl_api::filter_functions and gl_function::filter_entry_points to filter out unwanted functions and entry points. Reviewed-by: Brian Paul <[email protected]>
* glapi: add gles_api.pyChia-I Wu2011-08-133-417/+464
| | | | | | | | | | | | Move the list of entry points belong to GLES from mapi_abi.py to a new file. Until we figure out how to describe the APIs an entry point belongs to in the XML file, and how to handle the case where an entry point others alias is missing in some APIs, this is an easier solution than maintaining another two sets of XMLs in glapi/gen-es/. Reviewed-by: Brian Paul <[email protected]>
* gallium/gbm: Add dependencies for libraries linked into pipe_*.so.Michel Dänzer2011-08-121-1/+1
| | | | Signed-off-by: Michel Dänzer <[email protected]>
* x86-64: Fix compile error with clangChad Versace2011-08-111-1/+1
| | | | | | | | | | | | | | | Remove the 'f' suffix from a float literal. - .float 0.0f+1.0 + .float 1.0 This fixes the following compile error with clang: error: unexpected token in directive .float 0.0f+1.0 ^ Note: This is a candidate for the stable branches. Reviewed-by: Ben Widawsky <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* mesa: fix initialization of GL_FOG_MODE in _mesa_init_driver_state()Brian Paul2011-08-111-1/+4
|
* mesa: fix ColorMask array index in _mesa_init_driver_state()Brian Paul2011-08-111-4/+4
| | | | | This doesn't really make any difference because all the colormasks are the same upon context set-up, but it makes more sense.
* swrast: don't try to do depth testing if there's no depth bufferBrian Paul2011-08-111-1/+2
| | | | | | | Fixes piglit hiz-depth-stencil-test-fbo-d0-s8 crash. See http://bugs.freedesktop.org/show_bug.cgi?id=37907 NOTE: This is a candidate for the 7.11 branch.
* swrast: initial multi-threaded span renderingAndreas Fänger2011-08-116-36/+91
| | | | | | | | Optional parallel rendering of spans using OpenMP. Initial implementation for aa triangles. A new option for scons is also provided to activate the openmp support (off by default). Signed-off-by: Brian Paul <[email protected]>
* intel: GetBuffer fixBen Widawsky2011-08-101-1/+6
| | | | | | | | | | After copy buffer on preGEN6, it is necessary to wait for the blit to complete before returning data to the user. This should fix the piglit test: copy_buffer_coherency (pre-GEN6). Signed-off-by: Ben Widawsky <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* r600g: Add support for ROUND, v2Lauri Kasanen2011-08-102-3/+5
| | | | | | This is a GLSL 1.3 feature, but also used by MLAA. Signed-off-by: Lauri Kasanen <[email protected]>
* i830: Add missing vtable entry for i830 from the hiz work.Carl Simonson2011-08-101-0/+7
|
* i965: Drop the reg/hw_reg distinction.Eric Anholt2011-08-105-36/+37
| | | | | | | "reg" was set in only one case, virtual GRFs pre register allocation, and would be unset and have hw_reg set after allocation. Since we never bothered with looking at virtual GRF number after allocation anyway, just use the same storage and avoid confusion.
* i965/fs: Factor out the register allocator setup to a separate function.Eric Anholt2011-08-102-66/+105
| | | | | | | Besides separating out a logical step of the giant register allocator function, this now communicates a bunch of the allocator information through entries in brw_context, which will make this code partially reusable for caching the expensive allocator setup.
* i965/fs: Simplify the register allocator using a map from RA reg to GRF.Eric Anholt2011-08-101-41/+38
| | | | | | | It's fewer pointers to track, and when we start caching the register set, should be algorithmically better in the cache hit case (lookup in a byte-per-register array, instead of a linear walk through desctiption of register classes to find how to translate that class).
* i965/fs: Eliminate the magic nature of virtual GRF 0.Eric Anholt2011-08-104-31/+17
| | | | | | | This was a debugging aid at one point -- virtual grf 0 should never be allocated, and it would be used if undefined register access occurred in codegen. However, it made the confusing register allocation code even more confusing by indexing things off of 1 all over.
* i965/fs: Use the new convenience interface for setting up reg conflicts.Eric Anholt2011-08-101-22/+7
| | | | | That code I wrote was impenetrable, and hard to write the first time. This makes things a lot more obvious.
* mesa: Add a convenience interface for register allocator conflicts setup.Eric Anholt2011-08-102-0/+23
|
* glsl_to_tgsi: improve assignment hackHenri Verbeet2011-08-091-3/+5
| | | | Fixes StarCraft 2 and Fallout 3 in Wine.
* r300g: silence some warnings about uninitialized variablesBrian Paul2011-08-093-6/+8
|
* svga: add missing switch case for PIPE_SHADER_CAP_INTEGERSBrian Paul2011-08-091-0/+2
|
* glx: move declarations before codeBrian Paul2011-08-091-3/+7
|
* swrast: silence unused var warningsFabio Pedretti2011-08-091-1/+1
| | | | Signed-off-by: Brian Paul <[email protected]>
* docs: update GL3.txt with new GL 4.2 extensionsDave Airlie2011-08-091-0/+13
|
* glsl: validate IR after linking (debug builds only)Paul Berry2011-08-081-0/+8
| | | | | | | | | | | | | | | | | | | | At least one of the invariants verified by IR validation concerns the relative ordering of toplevel constructs in the IR: references to global variables must come after the declarations of those global variables. Since linking affects the ordering of toplevel constructs in the IR, it's possible that a bug in the linker will cause invalid IR to be generated, even if all the pre-linked shaders are valid. (In fact, such a bug was fixed by the previous commit.) Bugs like this are easily masked by further optimization passes, particularly inlining. So to make them easier to track down, this patch addes an IR validation step right after linking, and before final optimization occurs. The validation only occurs on debug builds. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: When linking, emit functions at the tail of the final linked program.Paul Berry2011-08-081-2/+4
| | | | | | | | | | | | | | | | | | | | | When link_functions.cpp adds a new function to the final linked program, it needs to add it after any global variable declarations that the function refers to, otherwise the IR will be invalid (because variable declarations must occur before variable accesses). The easiest way to do that is to have the linker emit functions to the tail of the final linked program. The linker used to emit functions to the head of the final linked program, in an effort to keep callees sorted before their callers. However, this was not reliable: it didn't work for functions declared or defined in the same compilation unit as main, for diamond-shaped patterns in the call graph, or for some obscure cases involving overloaded functions. And no code currently relies on this sort order. No Piglit regressions with i965 Ironlake. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Check array size is const before asserting that no IR was generated.Paul Berry2011-08-081-5/+8
| | | | | | | | | | | | | process_array_type() contains an assertion to verify that no IR instructions are generated while processing the expression that specifies the size of the array. This assertion needs to happen _after_ checking whether the expression is constant. Otherwise we may crash on an illegal shader rather than reporting an error. Fixes piglit tests array-size-non-builtin-function.vert and array-size-with-side-effect.vert. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Constant-fold built-in functions before outputting IRPaul Berry2011-08-081-2/+14
| | | | | | | | | | | | | | Rearranged the logic for converting the ast for a function call to hir, so that we constant fold before emitting any IR. Previously we would emit some IR, and then only later detect whether we could constant fold. The unnecessary IR would usually get cleaned up by a later optimization step, however in the case of a builtin function being used to compute an array size, it was causing an assertion. Fixes Piglit test array-size-constant-relational.vert. Reviewed-by: Kenneth Graunke <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38625
* glsl: Emit function signatures at toplevel, even for built-ins.Paul Berry2011-08-084-20/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ast-to-hir conversion needs to emit function signatures in two circumstances: when a function declaration (or definition) is encountered, and when a built-in function is encountered. To avoid emitting a function signature in an illegal place (such as inside a function), emit_function() checked whether we were inside a function definition, and if so, emitted the signature before the function definition. However, this didn't cover the case of emitting function signatures for built-in functions when those built-in functions are called from inside the constant integer expression that specifies the length of a global array. This failed because when processing an array length, we are emitting IR into a dummy exec_list (see process_array_type() in ast_to_hir.cpp). process_array_type() later checks (via an assertion) that no instructions were emitted to the dummy exec_list, based on the reasonable assumption that we shouldn't need to emit instructions to calculate the value of a constant. This patch changes emit_function() so that it emits function signatures at toplevel in all cases. This partially fixes bug 38625 (https://bugs.freedesktop.org/show_bug.cgi?id=38625). The remainder of the fix is in the patch that follows. Reviewed-by: Kenneth Graunke <[email protected]>
* Revert "glsl: Skip processing the first function's body in do_dead_functions()."Paul Berry2011-08-081-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | opt_dead_functions contained a shortcut to skip processing the first function's body, based on the assumption that IR functions are topologically sorted, with callees always coming before their callers (therefore the first function cannot contain any calls). This assumption turns out not to be true in general. For example, the following code snippet gets translated to IR that violates this assumption: void f(); void g(); void f() { g(); } void g() { ... } In practice, the shortcut didn't cause bugs because of a coincidence of the circumstances in which opt_dead_functions is called: (a) we do inlining right before dead function elimination, and inlining (when successful) eliminates all calls. (b) for user-defined functions, inlining is always successful, because previous optimization passes (during compilation) have reduced them to a form that is eligible for inlining. (c) the function that appears first in the IR can't possibly call a built-in function, because built-in functions are always emitted before the function that calls them. It seems unnecessarily fragile to have opt_dead_functions depend on these coincidences. And the next patch in this series will break (c). So I'm reverting the shortcut. The consequence will be a slight increase in link time for complex shaders. This reverts commit c75427f4c8767e131e5fb3de44fbc9d904cb992d. Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: inline st_prepare_fragment_program in st_translate_fragment_programBryan Cain2011-08-082-179/+162
| | | | | | | | | This reverts an unnecessary part of commit 4683529048ee and fixes misrendering and an assertion failure in Cogs. Fixes freedesktop.org bug 39888. Reviewed-by: Brian Paul <[email protected]>
* glext: upgrade to version 72Brian Paul2011-08-081-3/+364
|
* glsl: silence warning about trailing comma in enum listBrian Paul2011-08-081-1/+1
|
* gallium: silence warnings about trailing commas in enum listsBrian Paul2011-08-082-2/+2
|
* mesa: whitespace changesBrian Paul2011-08-081-5/+8
|
* d3d1x: adapt to resource_resolve interface changeChristoph Bumiller2011-08-071-3/+20
|
* nv50,nvc0: never convert in resource copy when format sizes matchChristoph Bumiller2011-08-072-2/+16
| | | | | | | If there are any cases left where the st thinks that RGBA -> BGRA will swap components, it will get what it deserves. Now the GPU's 2D engine goes unused. What a shame.
* st/mesa: don't resolve stencil twiceChristoph Bumiller2011-08-071-1/+3
|
* winsys/radeon: disable use of the buffer busy-for-write flagMarek Olšák2011-08-061-0/+12
|
* mesa: In validate_program(), initialize errMsg for safety.Kenneth Graunke2011-08-051-1/+1
| | | | | | | | | | | | | | | validate_program relies on validate_shader_program to fill in errMsg; empirically, there exist cases where that doesn't happen. While tracking those down may be worthwhile, initializing the string so we don't try to ralloc_strdup random garbage also seems wise. Fixes issues caught by valgrind while running some test case. NOTE: This is a candidate for stable release branches. Reviewed-by: Chad Versace <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* intel: Fix warnings from gl_constant_parameter changes.Eric Anholt2011-08-053-11/+9
|
* glsl_to_tgsi: replace open-coded swizzle_for_size()Bryan Cain2011-08-051-8/+1
| | | | This is a port of commit 4c7e215c7bb to glsl_to_tgsi.
* glsl_to_tgsi: try to avoid emitting a MOV_SAT to saturate an expression treeBryan Cain2011-08-051-6/+26
| | | | | This is a port of commit 62722d9 to glsl_to_tgsi, with minor aesthetic changes (moved the declaration and assignment of new_inst inside the if block).
* ir_to_mesa: Replace open-coded swizzle_for_size()Eric Anholt2011-08-051-8/+1
|