path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2013-08-12i965/fs: Explicitly disallow CSE on predicated instructions.Kenneth Graunke1-1/+3
The existing inst->is_partial_write() already disallows predicated instructions, so this has no functional change. However, it's worth doing explicitly since the CSE pass does not consider the flag register. This means it could blindly factor out operations that use the same sources, but which have different condition codes set. This prevents a regression in the next commit. Signed-off-by: Kenneth Graunke <> Reviewed-by: Matt Turner <>
2013-08-12i965/fs: Log a performance warning if skipping 16-wide due to pulls.Kenneth Graunke1-7/+11
Usually, the driver creates both 8-wide and 16-wide variants of every fragment shader. When 16-wide compilation fails, it logs a performance warning explaining why only an 8-wide program exists. However, when there are pull parameters, the driver won't even bother trying the 16-wide compile (since it would fail). In this case, it failed to emit a performance warning, leaving no explanation for the missing 16-wide program. Signed-off-by: Kenneth Graunke <> Reviewed-by: Matt Turner <>
2013-08-12ilo: initialize constant buffer SURFACE_STATE earlyChia-I Wu4-27/+32
Fix ilo_gpe_init_view_surface_for_buffer to allow buffer to be NULL, and add ilo_gpe_set_view_surface_bo to set it later. This allows us to set up SURFACE_STATE early for constant buffers backed by user buffers.
2013-08-10ilo: 3DSTATE_INDEX_BUFFER may be wrongly skippedChia-I Wu1-1/+5
In finalize_index_buffer(), when the current index buffer was destroyed due to u_upload_data(), it may happen that the new index buffer is at the same address as the old one. Comparing the pointers to the two buffers could fail to work, and 3DSTATE_INDEX_BUFFER would be incorrectly skipped. Holding a reference to the current index buffer before calling u_upload_data() should fix the problem.
2013-08-10i965: add missing BRW_NEW_INTERPOLATION_MAP to state dumpChris Forbes1-0/+1
Makes this flag appear in the output for INTEL_DEBUG=state Signed-off-by: Chris Forbes <> Reviewed-by: Kenneth Graunke <>
2013-08-10i965: Add a new debug mode for the VUE mapChris Forbes3-0/+29
INTEL_DEBUG=vue now emits a listing of each slot in the VUE map, and the corresponding interpolation mode. V2: Fix whitespace issues. Signed-off-by: Chris Forbes <> Reviewed-by: Kenneth Graunke <>
2013-08-09glsl: Don't allow const on out or inout function parametersIan Romanick1-0/+15
Fixes piglit tests const-inout-parameter.frag and const-out-parameter.frag. Signed-off-by: Ian Romanick <> Reviewed-by: Matt Turner <> Cc: "9.2" <>
2013-08-09gallivm: set non-existing values really to zero in size queries for d3d10Roland Scheidegger4-22/+22
My previous attempt at doing so double-failed miserably (minification of zero still gives one, and even if it would not the value was never written anyway). While here also rename the confusingly named int_vec bld as we have int vecs of different sizes, and rename need_nr_mips (as this also changes out-of-bounds behavior) to is_sviewinfo too. Reviewed-by: Zack Rusin <>
2013-08-09gallivm: use texture target from shader instead of static state for size queryRoland Scheidegger6-4/+77
d3d10 has no notion of distinct array resources neither at the resource nor sampler view level. However, shader dcl of resources certainly has, and d3d10 expects resinfo to return the values according to that - in particular a resource might have been a 1d texture with some array layers, then the sampler view might have only used 1 layer so it can be accessed both as 1d or 1d array texture (I think - the former definitely works). resinfo of a resource decleared as array needs to return number of array layers but non-array resource needs to return 0 (and not 1). Hence fix this by passing the target from the shader decl to emit_size_query and use that (in case of OpenGL the target will come from the instruction itself). Could probably do the same for actual sampling, though it may not matter there (as the bogus components will essentially get clamped away), possibly could wreak havoc though if it REALLY doesn't match (which is of course an error but still). Reviewed-by: Zack Rusin <>
2013-08-09gallivm: honor d3d10's wishes of out-of-bounds behavior for texture size queryRoland Scheidegger1-8/+27
Specifically, must return 0 for non-existent mip levels (and non-existent textures which is an unsolved problem) for everything but total mip count. Reviewed-by: Zack Rusin <>
2013-08-09glsl: Enable ARB_fragment_coord_conventions functionality in GLSL 1.50.Paul Berry2-2/+4
GLSL 1.50 incorporates the functionality of the ARB_fragment_coord_conventions extension, so we need to make this functionality available even if the extension isn't enabled. Reviewed-by: Kenneth Graunke <> Reviewed-by: Matt Turner <>
2013-08-09main: Fix deprecation of glLineWidth()Paul Berry1-1/+2
From section E.1 (Profiles and Deprecated Features of OpenGL 3.0) of the OpenGL 3.0 spec: "LineWidth is not deprecated, but values greater than 1.0 will generate an INVALID VALUE error" From context it is clear that values greater than 1.0 should only generate an INVALID VALUE error in a forward-compatible context. The code was correctly quoting this spec text, but it was disallowing all line widths in forward-compatible contexts, instead of just widths greater than 1.0. This patch introduces the correct check, so that setting a line width of 1.0 or less is permitted. Reviewed-by: Matt Turner <> Reviewed-by: Ian Romanick <>
2013-08-09util: (trivial) fix asm input/output list for fxsaveRoland Scheidegger1-1/+1
Otherwise gcc might do very unsafe optimizations, spotted by Uros Bizjak. Hopefully this time it's finally right?
2013-08-09r600g: disable GPUVM by defaultAlex Deucher1-1/+1
Cayman and trinity systems still seem to suffer from stability problems with GPUVM. This also fixes compute on these asics. It can still be enabled for testing by setting env var RADEON_VA=true. Fixes: Signed-off-by: Alex Deucher <> CC: "9.2" <> CC: "9.1" <> Reviewed-by: Christian König <>
2013-08-08softpipe: fix the regressionsZack Rusin1-2/+0
softpipe has a really weird handling of the draw attrs, lets just not inject outputs in its data. Trivial.
2013-08-08draw: rewrite primitive assemblerZack Rusin9-297/+180
We can't be injecting the primitive id's in the pipeline because by that time the primitives have already been decomposed. To properly number the primitives we need to handle the adjacency primitives by hand. This patch moves the prim id injection into the original primitive assembler and completely removes the useless pipeline stage. Signed-off-by: Zack Rusin <> Reviewed-by: Roland Scheidegger <>
2013-08-08draw: reset the vertex id when injecting new primitive idZack Rusin1-0/+9
Without reseting the vertex id, with primitives where the same vertex is used with different primitives (e.g. tri/lines strips) our vbuf module won't re-emit those vertices with the changed primitive id. So lets reset the vertex id whenever injecting new primitive id to make sure that the vertex data is correctly emitted. Signed-off-by: Zack Rusin <> Reviewed-by: Roland Scheidegger <>
2013-08-08draw: cleanup the extra attribsZack Rusin1-0/+1
Before inserting new front face and prim id outputs cleanup the old extra outputs, otherwise our cache will use previous output slots which will break as soon as outputs of the current shader don't match the last. Signed-off-by: Zack Rusin <> Reviewed-by: Roland Scheidegger <>
2013-08-09util: (trivial) fix more compile errors in u_cpu_detect (gcc/x86 this time).Dieter Nützel1-1/+1
Oops. Should fix
2013-08-08egl: Do not export private symbolsChad Versace5-0/+5
libEGL was incorrectly exporting *all* symbols, public and private. This patch adds -fvisibility=hidden to libEGL's linker flags to ensure that only symbols annotated with __attribute__((visibility("default"))) get exported. Sanity-checked with libEGL's builtin DRI2 driver and the i965 DRI driver by running Piglit on X/EGL and by running weston-gears on Weston as an X client. Sanity-checked with libEGL's Gallium driver (which is not built-in) and the swrast Gallium driver by running es2gears_x11. Kristian reviewed the symbol diff in `nm`. CC: "9.2" <> CC: Ian Romanick <> Acked-by: Kristian Høgsberg <> Reviewed-by: Jakob Bornecrantz <> Signed-off-by: Chad Versace <>
2013-08-08i965: Remember to call intel_prepare_render() before blitting.Kenneth Graunke1-0/+5
Otherwise, blits to the window system buffer may cause crashes, since dst_irb->mt may be NULL. This code is lifted straight out of brw_blorp_framebuffer()'s try_blorp_blit() helper. Fixes crashes in Piglit's fbo-sys-blit on systems without BLORP. Bugzilla: Signed-off-by: Kenneth Graunke <> Reviewed-by: Ian Romanick <> Reviewed-by: Chad Versace <> Cc: "9.2" <>
2013-08-08util: (trivial) fix compile error with MSVC on x86Roland Scheidegger1-1/+1
2013-08-08gallivm: honor d3d10 floating point rules for shadow comparisonsRoland Scheidegger1-3/+17
d3d10 specifies ordered comparisons for everything but not_equal which is unordered ( OpenGL probably doesn't care. Reviewed-by: Zack Rusin <>
2013-08-08softpipe: don't clamp reference value for shadow comparison for float formatsRoland Scheidegger1-12/+32
Clamping is only done for fixed-point formats as part of conversion to texture format. Reviewed-by: Zack Rusin <>
2013-08-08gallivm: don't clamp reference value for shadow comparison for float formatsRoland Scheidegger1-4/+17
This is wrong both for OpenGL and d3d. (In fact clamping is a side effect of converting to depth format, so this should really do quantization too at least in d3d10 for the comparisons to be truly correct.) Reviewed-by: Zack Rusin <>
2013-08-08gallivm: propagate scalar_lod to emit_size_query tooRoland Scheidegger6-0/+12
Clearly the returned values need to be per-element if the lod is per element. Does not actually change behavior yet. Reviewed-by: Zack Rusin <>
2013-08-08gallium: clarify SVIEWINFO opcodeRoland Scheidegger1-1/+9
This opcode is quite problematic in tgsi, while it tries to mirror d3d10 resinfo it can't really do what's stated there due to missing the crazy return type modifiers. Hence specify this is ignored along with the swizzle. (Other options would be to have multiple opcodes or specify the ret type modifier maybe in dst_reg as there's padding bits left there but it is the only instruction allowing this.) Reviewed-by: Zack Rusin <>
2013-08-08gallivm: fix out-of-bounds behavior for fetch/ldRoland Scheidegger3-30/+88
For d3d10 and ARB_robust_buffer_access_behavior, we are required to return 0 for out-of-bounds coordinates (for which we can just enable the code already there was just disabled). Additionally, also need to return 0 for out-of-bounds mip level and out-of-bounds layer. This changes the logic so instead of clamping the level/layer, an out-of-bound mask is computed instead in this case (actual clamping then can be omitted just like with coordinates, since we set the fetch offset to zero if that happens anyway). Reviewed-by: Zack Rusin <>
2013-08-08util: try much harder to set DAZ flagRoland Scheidegger3-1/+31
While so far this only causes some harmless test failures, there's lots more cpus with DAZ. All 64bit capable ones can do it (particularly relevant for AMD cpus as they supported sse3 very very late) but if really necessary we can check support for that for real with some more magic. (In fact just about ANY cpu with sse2 can support DAZ, I believe the only exception are first gen P4 (Willamette) and from those only early steppings which can't do it it's almost like intel forgot to add it... - a real pity though docs say you can't just try to set it as they will throw a GPF.) While this was meant to address it does not fix it. Most likely the tests need fixing as I don't think there's any guarantee about denorm handling in the reference math library functions if the flags aren't set to standard values. Nevertheless enabling DAZ on all cpus which can do it should be the right thing to do. Reviewed-by: Jose Fonseca <>
2013-08-08util: implement table-based + linear interpolation linear-to-srgb conversionRoland Scheidegger2-11/+102
Should be much faster, seems to work in softpipe. While here (also it's now disabled) fix up the pow factor - the former value is what is in GL core it is however not actually accurate to fp32 standard (as it is 1.0/2.4), and if someone would do all the accurate math there's no reason to waste 8 mantissa bits or so... v2: use real table generating function instead of just printing the values (might take a bit longer as it does calculations on some 3+ million floats but much more descriptive obviously). Also fix up another inaccurate pow factor (this time in the python code) - wondering where the couple one bit errors came from :-(. Reviewed-by: Jose Fonseca <> Reviewed-by: Zack Rusin <>
2013-08-08gallivm: fix comment wrt srgb accuracy.Roland Scheidegger1-2/+4
I think it's actually not good enough now...
2013-08-08ilo: get rid of GPE tables completelyChia-I Wu6-108/+54
Move the estimate functions out of the tables and kill the tables.
2013-08-08ilo: clean up GPE header inclusionsChia-I Wu6-14/+8
This reduces the number of source files need to be recompiled when GPE functions are changed other than regular clean ups.
2013-08-08ilo: initialize alpha test state in ilo_gpe_init_dsaChia-I Wu5-38/+46
This could speed up BLEND_STATE and COLOR_CALC_STATE emission a bit.
2013-08-08ilo: fold gen6_translate_index_size into the callerChia-I Wu1-17/+15
There is only one caller so fold it.
2013-08-08ilo: fold gen6_translate_depth_format into the callerChia-I Wu1-33/+9
There is only one caller so fold it.
2013-08-08ilo: Call GPE emit functions directly.Courtney Goeltzenleuchter8-1248/+141
Eliminate pipeline and GPE function vectors and have the pipeline functions call the GPE emit functions directly.
2013-08-08ilo: move emit functions so that they can be inlined.Courtney Goeltzenleuchter4-3467/+3453
2013-08-07r300g/compiler/tests: Pass the required LDFLAGS when building the test programTom Stellard1-1/+2
CC: "9.2 <>"
2013-08-07r300g/compiler/tests: Fix segfaultTom Stellard3-4/+4
CC: "9.2" <>
2013-08-07gallium-egl: Commit the rest of the native_wayland_drm_bufmgr_helper v2 patchKristian Høgsberg3-7/+4
I missed Anders v2 on the list which fixed non-wayland compilation: Signed-off-by: Kristian Høgsberg <>
2013-08-07egl: Update to Wayland 1.2 server APIAnder Conselvan de Oliveira11-64/+90
Since Wayland 1.2, struct wl_buffer and a few functions are deprecated. References to wl_buffer are replaced with wl_resource and some getter functions and calls to deprecated functions are replaced with the proper new API. The latter changes are related to resource versioning. Signed-off-by: Ander Conselvan de Oliveira <>
2013-08-07gallium-egl: Don't add a listener for wl_drm twice in wayland platformAnder Conselvan de Oliveira1-1/+0
A listener is added just after the interface is bound, in registry_handle_global(). Signed-off-by: Ander Conselvan de Oliveira <>
2013-08-07gallium-egl: Simplify native_wayland_drm_bufmgr_helper interfaceAnder Conselvan de Oliveira9-308/+276
The helper provides a series of functions to easy the implementation of the WL_bind_wayland_display extension on different platforms. But even with the helpers there was still a bit of duplicated code between platforms, with the drm authentication being the only part that differs. This patch changes the bufmgr interface to provide a self contained object with a create function that takes a drm authentication callback as an argument. That way all the helper functions are made static and the "_helper" suffix was removed from the sources file name. This change also removes the mix of Wayland client and server code in the wayland drm platform source file. All the uses of libwayland-server are now contained in native_wayland_drm_bufmgr.c. Changes to the drm platform are only compile tested. Signed-off-by: Ander Conselvan de Oliveira <>
2013-08-07ilo: speed up 3DSTATE_VERTEX_BUFFERS emission a bitChia-I Wu3-26/+12
Ignore vbuffer_mask which does not gain us anything.
2013-08-07ilo: skip state emission when reducing sampler countChia-I Wu1-19/+29
When the number of sampler states bound is reduced, we are good to keep referencing the old SAMPLER_STATE array and skip emitting a new one.
2013-08-07ilo: simplify setting of shader samplers and viewsChia-I Wu1-44/+33
Remove the special path that unbinds all samplers/views not in the range. Just make another call to unbind them.
2013-08-07ilo: correctly check for stencil ref changeChia-I Wu1-1/+1
I intended to do a memcmp(), not a memcpy()...
2013-08-06draw: fix slot detectionZack Rusin2-2/+1
Nowadays -1 for slots means that the semantic is not present, so we need to store it in a signed variables, otherwise <0 comparisons are pointless. Fixes (at least with softpipe, edgeflags don't work wit llvmpipe) Signed-off-by: Zack Rusin <> Reviewed-by: Brian Paul <> Reviewed-by: Roland Scheidegger <>
2013-08-06gallivm: Fix build - Remove TargetOptions.RealignStack for llvm>=3.4Laurent Carlier1-0/+2
Since llvm -3.4svn r187618, TargetOptions doesn't provide RealignStack, so only enable it with llvm<3.4 This option must now be specified using function attributes, see LLVM commit r187618 Reviewed-by: Tom Stellard <>