summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Make mode_string function globally availableIan Romanick2013-10-303-23/+46
| | | | | | | | | | | | | | | | | | I made this a function (instead of a method of ir_variable) because it made the change set smaller, and I expect that there will be an overload that takes an ir_var_mode enum. Having both functions used the same way seemed better. v2: Add missing case for ir_var_system_value. v3: Change the ir_var_mode_count case to just break. Move the assertion and the return outside the switch-statment. In the unlikely event that var->mode is an invalid value other than ir_var_mode_count, the assertion will still fire, and in release builds we won't wind up returning a garbage pointer. Suggested by Paul. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Eliminate the global check in validate_explicit_locationIan Romanick2013-10-301-3/+2
| | | | | | | | | Since the separation of ir_var_function_in and ir_var_shader_in (similar for out), this check is no longer necessary. Previously, global_scope was the only way to tell which was which. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Extract explicit location code from apply_type_qualifier_to_variableIan Romanick2013-10-301-75/+84
| | | | | | | | | | | | Future patches will add some extra code to this path, and some of that code will want to exit from the explicit location code early. v2: Change a geometry shader "break" to a "return" so that try to apply a bogus geometry shader location qualifier (which could cause cascading errors). Suggested by Paul. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* mesa: Drop unused return value from use_shader_programGregory Hainaut2013-10-301-5/+3
| | | | | | | | | | | | The return value has been unused since commit d348b0c. This was originally included in another patch, but it was split out by Ian Romanick. v2: Drop unnecessary final return. Suggested by Paul. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Paul Berry <[email protected]> Cc: Eric Anholt <[email protected]>
* wayland: silence unused var warningFabio Pedretti2013-10-301-2/+0
| | | | Reviewed-by: Chad Versace <[email protected]>
* ilo: Fix out-of-tree build.Johannes Obermayr2013-10-301-1/+1
| | | | [olv: use $(srcdir) instead of $(top_srcdir)]
* scons: Add missing dependencies to src/mapi/glapi/gen/*.xmlJosé Fonseca2013-10-302-8/+10
| | | | | | | | Incremental builds were failing because not all generated source files were missing dependencies to src/mapi/glapi/gen/*.xml. Hopefully this change will be the end of these incremental build failures.
* glsl: fix crash introduced by the previous commitMarek Olšák2013-10-301-1/+1
|
* glsl: break the gl_FragData array into separate gl_FragData[i] variablesMarek Olšák2013-10-291-33/+134
| | | | | | | | | | | | | | | | This avoids a defect in lower_output_reads. The problem is lower_output_reads treats the gl_FragData array as a single variable. It first redirects all output writes to a temporary variable (array) and then writes the whole temporary variable to the output, generating assignments to all elements of gl_FragData. BTW this pass can be modified to lower all arrays, not just inputs and outputs. The question is whether it is worth it. Reviewed-by: Paul Berry <[email protected]> v2: addressed Paul Berry's comments
* automake: properly handle non-default expat installationEmil Velikov2013-10-292-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Use PKG_CHECK_MODULE over requesting the user to setup the option at configure time. Drop unused EXPAT_INCLUDE and update all targets. NOTE: The this commit removes the --with-expat configure option. One should ensure that the expat they wish to use has expat.pc file accessible by pkg-config. v2: * Add note about the removal of --with-expat (per Tom Stellard) * Drop EXPAT_CFLAGS for targets that do not build DRI_COMMON (spotted by Matt Turner) v3: * Rebase on top of megadrivers (drop EXPAT_CFLAGS from swrast) Acked-by: Matt Turner <[email protected]> (v2) Reviewed-by: Tom Stellard <[email protected]> (v2) Signed-off-by: Emil Velikov <[email protected]> Conflicts: configure.ac src/mesa/drivers/dri/common/Makefile.am
* targets/xorg-nouveau: drop usage of dri1 function DRICreatePCIBusIDEmil Velikov2013-10-291-13/+14
| | | | | | | | | | | The function should have never used it in the first place as it was a left over from the DRI1 days of the nouveau ddx. While we're around check if KMS is supported before opening the nouveau device, and add support for Fermi & Kepler cards. Compile tested only due to the lack of a Fermi/Kepler card. Signed-off-by: Emil Velikov <[email protected]>
* gallium/targets/xorg: drop set but unused variable entityEmil Velikov2013-10-294-12/+0
| | | | | | | | The function xf86GetEntityInfo() retrieves the entity rather than doing any changes. Remove this no-op code. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Tom Stellard <[email protected]>
* st/xorg: drop set but unsused variables dxo, dyoEmil Velikov2013-10-291-4/+0
| | | | | | | | Commit a9f8baf00b264 removed the first and only use of the variables but forgot to remove them. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/xorg: add sanity checks after mallocEmil Velikov2013-10-291-0/+6
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/xorg: remove unnecessary headersEmil Velikov2013-10-292-8/+0
| | | | | | | v2: Remove xf86PciInfo.h, all drivers provide their own PCI ID list Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* freedreno: emulated unsupported primitive typesRob Clark2013-10-295-25/+74
| | | | | | | Use u_primconvert to convert unsupported primitives into supported primitive plus index buffer. Signed-off-by: Rob Clark <[email protected]>
* gallium/auxiliary/indices: add u_primconvertRob Clark2013-10-293-0/+227
| | | | | | | | | | A convenient front end to indices generate/translate code, for emulating primitives which are not supported natively by the driver. This handles saving/restoring index buffer state, etc. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/auxiliary/indices: add start paramRob Clark2013-10-297-28/+56
| | | | | | | Add 'start' parameter to generator/translator. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* freedreno: update generated headersRob Clark2013-10-296-125/+238
| | | | | | pull in some fixes to draw-initiator/prim-type. Signed-off-by: Rob Clark <[email protected]>
* i965/fs: Drop our dead push constants before overflowing to pull constants.Eric Anholt2013-10-291-2/+1
| | | | | | | | | | | | | | | | The idea of the original order was that you'd dead code eliminate accesses to push constants. But I've never seen a case of that (nor has shader-db), while we frequently see sparse accesses of large constant arrays that would overflow into pull constants. Cuts pull constant use on csgo, serious sam, planeshift, and the cave: total instructions in shared programs: 1695103 -> 1688795 (-0.37%) instructions in affected programs: 92024 -> 85716 (-6.85%) GAINED: 339 LOST: 0 Reviewed-by: Kenneth Graunke <[email protected]>
* haiku-softpipe: Minor cleanup and color space fixesAlexander von Gluck IV2013-10-292-20/+13
| | | | | | | | | | * Use more consistant data sources * Fix improper color space assignments * Remove unnecessary comments and code * Drop unnecessary round_up function (this was leftover from moving winsys code out of renderer) Acked-by: Brian Paul <[email protected]>
* winsys: Correct Haiku winsys display target codeAlexander von Gluck IV2013-10-294-8/+41
| | | | | | | | | * Instead of assuming the displaytarget is the same stride / colorspace as the destination, lets actually check the source bitmap. * Fixes random stride issues in rendering Acked-by: Brian Paul <[email protected]>
* clover: Use context device list for error checking in clGetProgramBuildInfo.Francisco Jerez2013-10-291-1/+1
| | | | | | Fixes https://bugs.freedesktop.org/show_bug.cgi?id=70891. Reported-by: Bruno Jiménez <[email protected]>
* i965: Simplify the shader time code by using atomic counter helpers.Francisco Jerez2013-10-294-41/+7
| | | | Reviewed-by: Paul Berry <[email protected]>
* i965: Add brw_reg constructors taking a dynamically determined vector width.Francisco Jerez2013-10-291-0/+24
| | | | | | | | The MRF variant is going to be used extensively by the atomic counter intrinsics to assemble untyped atomic and surface read messages easily. Reviewed-by: Paul Berry <[email protected]>
* i965/gen7: Implement code generation for untyped surface read instructions.Francisco Jerez2013-10-299-0/+112
|
* i965/gen7: Implement code generation for untyped atomic instructions.Francisco Jerez2013-10-299-0/+130
| | | | Reviewed-by: Paul Berry <[email protected]>
* i965: Implement ABO surface state emission.Francisco Jerez2013-10-297-0/+122
| | | | | | | | | | | | The maximum number of atomic buffer objects is somewhat arbitrary, we can change it in the future easily if it turns out it's not enough... v2: Add comments with the relevant mesa dirty bits. Fix usage of BRW_NEW_UNIFORM_BUFFER in the GS ABO state atom. v3: Update binding table layout diagrams. v4: Resolve conflicts with the recent dynamic surface index assignment changes. Reviewed-by: Paul Berry <[email protected]>
* i965: Define vtbl method that initializes an untyped R/W surface.Francisco Jerez2013-10-292-5/+37
| | | | | | | | And add Gen7 implementation. v2: Fix off by one error in buffer size calculation. Reviewed-by: Paul Berry <[email protected]>
* glsl: Fix the function inlining pass to deal with general opaque arguments.Francisco Jerez2013-10-291-33/+33
| | | | | | | Almost a trivial change, it boils down to renaming a few identifiers so their names still make sense for opaque types other than sampler. Reviewed-by: Ian Romanick <[email protected]>
* glsl: Add built-in functions and constants required for ↵Francisco Jerez2013-10-295-0/+89
| | | | | | | | ARB_shader_atomic_counters. v2: Represent atomics as GLSL intrinsics. Reviewed-by: Ian Romanick <[email protected]>
* glsl: Basic support for built-in intrinsics.Francisco Jerez2013-10-294-11/+64
| | | | | | | | | | | | | | | | | Fix the linker to deal with intrinsic functions which are undefined all the way down to the driver back-end, and introduce intrinsic definition helpers in the built-in generator. We still need to figure out what kind of interface we want for drivers to communicate to the GLSL front-end which of the supported intrinsics should use a default GLSL implementation and which should use a hardware-specific override. As there's no default GLSL implementation for atomic ops, this seems like something we can worry about later on. Reviewed-by: Ian Romanick <[email protected]> v2: Define local helper function to generate ir_call nodes in the builtin generator.
* glsl: Add type predicate to check whether a type contains any opaque types.Francisco Jerez2013-10-293-0/+27
| | | | | | | | | | | And use it to forbid comparisons of opaque operands. According to the GL 4.2 specification: > Except for array indexing, structure member selection, and > parentheses, opaque variables are not allowed to be operands in > expressions. Reviewed-by: Ian Romanick <[email protected]>
* glsl: Add new atomic_uint built-in GLSL type.Francisco Jerez2013-10-2916-1/+58
| | | | | | | | | v2: Fix GLSL version in which the type became available. Add contains_atomic() convenience method. Split off atomic counter comparison error checking to a separate patch that will handle all opaque types. Include new ir_variable fields for atomic types. Reviewed-by: Ian Romanick <[email protected]>
* glsl: Add extension enables for ARB_shader_atomic_counters.Francisco Jerez2013-10-292-0/+3
| | | | | Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add support for ARB_shader_atomic_counters.Francisco Jerez2013-10-2912-3/+271
| | | | | | | | | | | | | | | This patch implements the common support code required for the ARB_shader_atomic_counters extension. It defines the necessary data structures for tracking atomic counter buffer objects (from now on "ABOs") associated with some specific context or shader program, it implements support for binding buffers to an ABO binding point and querying the existing atomic counters and buffers declared by GLSL shaders. v2: Fix extension checks. Drop unused MAX_ATOMIC_BUFFERS constant. Acked-by: Paul Berry <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glapi: Add support for ARB_shader_atomic_counters.Francisco Jerez2013-10-296-1/+60
| | | | | | | | Add XML file for the dispatch code generator, update the dispatch_sanity test and add stub definition for the new entry point. Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: Handle deallocation of some private ralloc contexts explicitly.Francisco Jerez2013-10-294-4/+4
| | | | | | | | | These ralloc contexts belong to a specific object and are being deallocated manually from the class destructor. Now that we've hooked up destructors to ralloc there's no reason for them to be children of any other context, and doing so might to lead to double frees under some circumstances. The class destructor has all the responsibility of freeing class memory resources now.
* ralloc: Hook up C++ destructors to ralloc when necessary.Francisco Jerez2013-10-291-0/+14
| | | | | | | | | | | | | This patch makes sure that class destructors are called as they should be when a C++ object allocated by ralloc is released. Based on a previous patch by Kenneth Graunke, but it doesn't exhibit the ~0.8% performance regression in shader compilation times because we now use the HAS_TRIVIAL_DESTRUCTOR() macro to detect the typical case where the indirect function call can be avoided because the object's destructor doesn't need to do anything. Reviewed-by: Ian Romanick <[email protected]>
* mesa: Define introspection macro to determine whether a type is trivially ↵Francisco Jerez2013-10-291-1/+23
| | | | | | | | | | destructible. Only implemented on GCC and Clang for now. Other compilers use a dummy implementation that always returns false, which should be a safe [but slightly inefficient] assumption in all cases. Reviewed-by: Ian Romanick <[email protected]>
* glsl: Generalize MSVC fix for strcasecmp().Paul Berry2013-10-292-7/+2
| | | | | | | | This will let us use strcasecmp() from anywhere inside Mesa without having to worry about the fact that it doesn't exist in MSVC. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* llvmpipe: fix bogus layer clamping in setupRoland Scheidegger2013-10-292-8/+25
| | | | | | | | | | | | | | | | | | | | | The layer coming from GS needs to be clamped (not sure if that's actually the correct error behavior but we need something) as the number can be higher than the amount of layers in the fb. However, this code was using the layer calculation from the scene, and this was actually calculated in lp_scene_begin_rasterization() hence too late (so setup was using the value from the _previous_ scene or just zero if it was the first scene). Since the value is used in both rasterization and setup, move calculation up to lp_scene_begin_binning() though it's a bit more inconvenient to calculate there. (Theoretically could move _all_ code which was in lp_scene_begin_rasterization() to there, because ever since we got rid of swizzled render/depth buffers our "map" functions preparing the fb data for render don't actually change the data in there at all, but it feels like it would be a hack.) v2: improve comments Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* util,llvmpipe: correctly set the minimum representable depth valueMatthew McClure2013-10-293-19/+64
| | | | | Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: move out of memory check in st_draw_vbo()Brian Paul2013-10-291-3/+4
| | | | | | | | | | | Before we were only checking the st->vertex_array_out_of_memory flag after updating array state. But if there's two consecutive glDrawArrays calls and the first one is skipped because of OOM, the second one should be skipped too. Cc: 9.2 <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* svga: reindent drawing codeBrian Paul2013-10-293-266/+199
|
* i965/vec4: Reduce working set size of live variables computation.Eric Anholt2013-10-292-23/+28
| | | | | | | | | | | | | | | | Orbital Explorer was generating a 4000 instruction geometry shader, which was taking 275 trips through dead code elimination and register coalescing, each of which updated live variables to get its work done, and invalidated those live variables afterwards. By using bitfields instead of bools (reducing the working set size by a factor of 8) in live variables analysis, it drops from 88% of the profile to 57%, and reduces overall runtime from I-got-bored-and-killed-it (Paul says 3+ minutes) to 10.5 seconds. Compare to f179f419d1d0a03fad36c2b0a58e8b853bae6118 on the FS side. Reviewed-by: Paul Berry <[email protected]>
* r600g/sb: fix value::is_fixed()Vadim Girlin2013-10-291-2/+2
| | | | | | | | | | | This prevents unnecessary (and wrong) register allocation in the scheduler for preloaded values in fixed registers. Fixes interpolation-mixed.shader_test on rv770 (and probably on all other pre-evergreen chips). Signed-off-by: Vadim Girlin <[email protected]> Tested-by: Andreas Boll <[email protected]>
* glsl: Drop no-op shifts involving 0.Eric Anholt2013-10-281-0/+10
| | | | | | | | | | | | I noticed this in a shader in Unigine Heaven that was spilling. While it doesn't really reduce register pressure, it shaves a few instructions anyway (7955 -> 7882). v2: Fix turning "0 >> x" into "x" instead of "0" (caught by Erik Faye-Lund). Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Use ir_builder more in opt_algebraic.Eric Anholt2013-10-281-30/+10
| | | | | | | | | While ir_builder is slightly less efficient, we're only increasing the work when there's actual optimization being done, and it's way more readable code. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Move common code out of opt_algebraic's handle_expression().Eric Anholt2013-10-281-78/+39
| | | | | | | | | | Matt and I had each screwed up these common required patterns recently, in ways that wouldn't have been noticed for a long time if not for code review. Just enforce it in the caller so that we don't rely on code review catching these bugs. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>