summaryrefslogtreecommitdiffstats
path: root/src/gallium
Commit message (Collapse)AuthorAgeFilesLines
* r600: Fix llvm build since const buffer changesKai Wasserbäch2015-09-131-1/+1
| | | | | | | | | | | In commit f9caabe8f1bff86d19b53d9ecba5c72b238d9e23: One place in r600_llvm.c was forgotten when replacing R600_UCP_CONST_BUFFER with R600_BUFFER_INFO_CONST_BUFFER. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91985 Signed-off-by: Kai Wasserbäch <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* r600: Enable fp64 on chips with native supportGlenn Kennard2015-09-121-0/+3
| | | | | | | | Cypress/Cayman/Aruba, earlier r6xx/r7xx chips only support a subset of the needed fp64 ops, and don't do GL4 anyway. Signed-off-by: Glenn Kennard <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* r600g: Support I2D/U2D/D2I/D2UGlenn Kennard2015-09-121-8/+98
| | | | | | | | | Only for Cypress/Cayman/Aruba, older chips have only partial fp64 support. Uses float intermediate values so only accurate for int24 range, which matches what the blob does. Signed-off-by: Glenn Kennard <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* r600g: lower number of driver const buffersDave Airlie2015-09-123-70/+131
| | | | | | | | | | | | | | I'm going to want a driver constant buffer for tess to coordinate LDS storage, so before I go tackling that I decided to merge the clip/samplepos and texture info buffers into one. So I can steal the spare one. This creates a single constant buffer between the two, with clip/samplepos taking up a reserved 128 bytes at the start. Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Glenn Kennard <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* r600: define some values for the fetch constant offsets.Dave Airlie2015-09-124-27/+47
| | | | | | | | This just puts these in one place and #defines them. Reviewed-by: Glenn Kennard <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* softpipe: Constify variablesKrzesimir Nowak2015-09-111-242/+199
| | | | | | | | | This commit makes a lot of variables constant - this is basically done by moving the computation to variable definition. Some of them are moved into lower scopes (like in img_filter_2d_ewa). Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* softpipe: Constify sp_tgsi_samplerKrzesimir Nowak2015-09-111-12/+23
| | | | | | | | | | | Add a small inline function doing the casting - this is to make sure we don't do a cast from some completely unrelated type. This commit does not make tgsi_sampler parameters const in vfuncs themselves for now - probably llvmpipe would need looking at before making such a change. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* softpipe: Constify sampler and view parameters in mip filtersKrzesimir Nowak2015-09-112-18/+18
| | | | | | | Those functions actually could always take them as constants. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* softpipe: Constify sampler and view parameters in img filtersKrzesimir Nowak2015-09-112-36/+36
| | | | | | | Those functions actually could always take them as constants. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* tgsi, softpipe: Constify tgsi_sampler in query_lod vfuncKrzesimir Nowak2015-09-112-2/+2
| | | | | | | | | | A followup from previous commit - since all functions called by query_lod take pointers to const sp_sampler_view and const sp_sampler, which are taken from tgsi_sampler subclass, we can the tgsi_sampler as const itself now. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* softpipe: Constify some sampler and view parametersKrzesimir Nowak2015-09-112-27/+28
| | | | | | | | | This is to prepare for making tgsi_sampler parameter in query_lod a const too. These functions do not modify anything in either sampler or view anymore. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* softpipe: Move the faces array from view to filter_argsKrzesimir Nowak2015-09-112-17/+23
| | | | | | | | With that, sp_sampler_view instances are not abused anymore as a local storage, so we can later make them constant. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* tgsi,softpipe: capitalize the tgsi_sampler_control enum valuesBrian Paul2015-09-113-48/+49
| | | | | | | We use capitalized enum values everywhere else. This improves understanding a bit too. Reviewed-by: Roland Scheidegger <[email protected]>
* svga: clean up the compile_vs/gs/fs() functionsBrian Paul2015-09-103-49/+27
| | | | | | Sipmlify structure and remove gotos. Reviewed-by: Charmaine Lee <[email protected]>
* svga: fix shader variant memory leakBrian Paul2015-09-102-0/+6
| | | | | | | Fixes a small leak in a seldom-hit corner case for VS/FS compilation. Found with coverity. Reviewed-by: Charmaine Lee <[email protected]>
* svga: remove useless MAX2() callBrian Paul2015-09-101-1/+1
| | | | | | The sum of two unsigned ints is always >= 0. Found with Coverity. Reviewed-by: Charmaine Lee <[email protected]>
* winsys/svga: remove useless assertionBrian Paul2015-09-101-1/+0
| | | | | | An unsigned int is always >= 0. Found with Coverity. Reviewed-by: Charmaine Lee <[email protected]>
* softpipe: Implement and enable textureQueryLodKrzesimir Nowak2015-09-102-2/+55
| | | | | | | | | | | | | | Passes the shader piglit tests and introduces no regressions. This commit finally makes use of the refactoring in previous commits. v2: - adapted the code to changes in previous commits (renames, need_cube_convert stuff) - splitted too long lines Reviewed-by: Brian Paul <[email protected]>
* tgsi: Add code for handling lodq opcodeKrzesimir Nowak2015-09-102-0/+56
| | | | | | | | | | | | This introduces new vfunc in tgsi_sampler just for this opcode. I decided against extending get_samples vfunc to return the mipmap level and LOD - the function's prototype is already too scary and doing the sampling for textureQueryLod would be a waste of time. v2: - splitted too long lines Reviewed-by: Brian Paul <[email protected]>
* softpipe: Add functions for computing relative mipmap levelKrzesimir Nowak2015-09-102-0/+120
| | | | | | | | | | | | | | | | | These functions will be used by textureQueryLod. v2: - renamed mip_level_* funcs to mip_rel_level_* to indicate that these functions return mip level relative to base level and documented them - renamed a level member in sp_filter_funcs struct to relative_level - changed mip_rel_level_none and mip_rel_level_nearest to return mip level relative to base level, mip_rel_level_linear already did that - documented clamp_lod function Reviewed-by: Brian Paul <[email protected]>
* softpipe: Split 3D to 2D coords conversion into separate functionKrzesimir Nowak2015-09-102-51/+45
| | | | | | | | | | | | | | | | | | | This is to avoid tying the conversion to the sampling - textureQueryLod will need to do the conversion too, but it does not do any sampling. So instead of a "get_samples" vfunc, there is just a bool saying whether the conversion is needed or not. This solution keeps a nice property of not adding any overhead for the common case (2D textures). v2: - replaced the "convert_coords" vfunc with a "need_cube_convert" boolean to avoid overhead of copying arrays in common case - removed an unused typedef - splitted too long lines in convert_cube - const fixes in convert_cube Reviewed-by: Brian Paul <[email protected]>
* softpipe: Split code getting a filter into separate functionKrzesimir Nowak2015-09-101-17/+41
| | | | | | | | | | | | | | This function will be later used by textureQueryLod. The img_filter_func are optional, because textureQueryLod will not need them. v2: - adapted to changes in previous commit (renames) - simplified conditions a bit - updated docs - splitted too long lines Reviewed-by: Brian Paul <[email protected]>
* softpipe: Put mip_filter_func inside a structKrzesimir Nowak2015-09-102-12/+38
| | | | | | | | | | | | | | | | | Putting this function pointer into a struct enables grouping of several related functions in a single place. For now it is just a single function, but the struct will be later extended with a mip_level_func for returning relative mip level. v2: - renamed sp_mip struct to sp_filter_funcs - renamed sp_filter_funcs instances from mip_foo to funcs_foo - splitted too long lines - sp_sampler now holds a pointer to sp_filter_funcs instead of an instance of it - some const fixes Reviewed-by: Brian Paul <[email protected]>
* softpipe: Split compute_lambda_lod into two functionsKrzesimir Nowak2015-09-101-17/+40
| | | | | | | | | | | | textureQueryLod returns a vec2 with a mipmap information and a LOD. The latter needs to be not clamped. v2: - changed the "not_clamped" part to "unclamped" - corrected "clamp into" to "clamp to" - splitted too long lines Reviewed-by: Brian Paul <[email protected]>
* softpipe: Fix textureLod with nonzero GL_TEXTURE_LOD_BIAS valueKrzesimir Nowak2015-09-101-1/+1
| | | | | | | | | The level-of-detail bias wasn't simply added in the explicit LOD case. This case seems to be tested only in piglit's fs-texturequerylod-nearest-biased test, which is currently skipped, as softpipe does not support textureQueryLod at the moment. Reviewed-by: Brian Paul <[email protected]>
* tgsi: Remove trailing backslash in commentKrzesimir Nowak2015-09-101-1/+1
| | | | | | It clearly is here by accident. Reviewed-by: Brian Paul <[email protected]>
* gallium/radeon: handle PIPE_TRANSFER_FLUSH_EXPLICITMarek Olšák2015-09-103-22/+44
| | | | | | | | Basically, do the same thing as for buffer_unmap, but use the explicit range instead. It's for apps which want to map a whole buffer and mark touched ranges explicitly. Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: don't update polygon offset state if it has no effectMarek Olšák2015-09-102-1/+4
| | | | Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: decrease the size of si_pm4_stateMarek Olšák2015-09-101-3/+2
| | | | Acked-by: Michel Dänzer <[email protected]>
* radeonsi/compute: add buffers to the CS directlyMarek Olšák2015-09-101-7/+11
| | | | | | Packets are emitted immediately anyway. Acked-by: Michel Dänzer <[email protected]>
* radeonsi: only use new versions of LLVM image and sample intrinsicsMarek Olšák2015-09-101-283/+186
| | | | | | | | Just a cleanup I had made a long time ago and forgot about. v2: use tgsi_is_shadow_target Reviewed-by: Tom Stellard <[email protected]>
* gallium/radeon: drop support for LLVM 3.4Marek Olšák2015-09-106-25/+7
| | | | | | This allows using the new tex instrinsics unconditionally. Reviewed-by: Michel Dänzer <[email protected]>
* r600/llvm: remove dead code for LLVM 3.3Marek Olšák2015-09-101-106/+0
| | | | | | LLVM 3.3 has been unsupported for quite a while. Reviewed-by: Michel Dänzer <[email protected]>
* r600g: use pipe_resource::width0 instead pb_buffer::sizeMarek Olšák2015-09-102-6/+6
| | | | | | | | | | | pb_buffer::size was aligned by 29aaab2b5f55cc6d9a84f58ce2bb8607e76a9dde, which broke the CMASK code I think. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91881 Cc: 11.0 <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: enable VGPR spilling on VIMarek Olšák2015-09-101-3/+1
| | | | | | | This fixes corruption in Unigine Heaven on VI Cc: 11.0 <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* winsys/amdgpu: calculate the maximum number of compute unitsMarek Olšák2015-09-101-2/+13
| | | | | | | Required for register spilling. Cc: 11.0 <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* clover: Avoid using typename to allow compilation of clover by clangAlbert Freeman2015-09-101-1/+1
| | | | | | | | | | | | | | | | When parsing an variable declaration qualified with the typename keyword, clang attempted to declare a variable with the type of non type member "enum type type" of module::argument (within the header file clover/core/module.hpp) instead of the typed member of module::argument "enum type". Replaced "typename" with "enum" to force clang to declare the variable marg_type with type "enum type" of module::argument. CC: "11.0" <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Albert Freeman <[email protected]>
* nv50/ir: don't fold immediate into mad if registers are too highIlia Mirkin2015-09-101-0/+4
| | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91551 Signed-off-by: Ilia Mirkin <[email protected]> Cc: "11.0" <[email protected]>
* nv50/ir: fix emission of 8-byte wide interp instructionIlia Mirkin2015-09-101-5/+6
| | | | | | | | | This can come up if the target register number is > 63, which is fairly rare. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91551 Signed-off-by: Ilia Mirkin <[email protected]> Cc: "11.0" <[email protected]>
* nv50/ir: r63 is only 0 if we are using less than 63 registersIlia Mirkin2015-09-101-1/+4
| | | | | | | | | It is advantageous to use r63 instead of r127 since r63 can fit into the shorter encoding. However if we've RA'd over 63 registers, we must use r127 as the replacement instead. Signed-off-by: Ilia Mirkin <[email protected]> Cc: "11.0" <[email protected]>
* nv50/ir: make edge splitting fix up phi node sourcesIlia Mirkin2015-09-101-13/+77
| | | | | | | | | | | | | | | | | | | | | Unfortunately nv50_ir phi nodes aren't directly connected to the CFG, so the mapping between source and the actual BB is by inbound edge order. So when manipulating edges one has to be extremely careful. We were insufficiently careful when splitting critical edges which resulted in the phi nodes being confused as to where their sources were coming from. This primarily manifests itself with the TXL-lowering logic on nv50, when it is inside of a conditional. I've been unable to trigger the issue anywhere else so far. This resolves rendering failures in a number of games like Two Worlds 2, Trine: Enchanted Edition, Trine 2, XCOM:Enemy Unknown, Stacking. It also improves the situation in Hearthstone, Sonic Generations, and The Raven: Legacy of a Master Thief. However more work needs to be done there (splitting a lot more edges solves it, so it's some other sort of RA-related issue). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90887 Signed-off-by: Ilia Mirkin <[email protected]> Cc: "11.0" <[email protected]>
* nvc0: remove BGRA4 format supportIlia Mirkin2015-09-091-0/+2
| | | | | | | | | | | Something is wrong with the support somewhere. I couldn't get the blob driver to use it either, although it happily used RGB5_A1. teximage-colors works, but WoW seems to fail in the menus for drawing text. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91526 Signed-off-by: Ilia Mirkin <[email protected]> Cc: "10.6 11.0" <[email protected]>
* gallium/ttn: fix cursor handling vs builderRob Clark2015-09-091-8/+6
| | | | | | | | | | | After inserting instructions the cursor.option becomes _after_instr (even if it started life as an _after_block). So we cannot simply stash the current cursor on the if/loop_stack. Otherwise we end up inserting instructions after the endif/endloop in the block preceeding the if/ loop. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* nvc0: keep track of cb bindings per buffer, use for upload settingsIlia Mirkin2015-09-097-12/+58
| | | | | | | | | | | | | | | | | | | CB updates to bound buffers need to go through the CB_DATA endpoints, otherwise the shader may not notice that the updates happened. Furthermore, these updates have to go in to the same address as the bound buffer, otherwise, again, the shader may not notice updates. So we keep track of all the places where a constbuf is bound, and iterate over all of them when updating data. If a binding is found that encompasses the region to be updated, then we use the settings of that binding for the upload. Otherwise we upload as a regular data update. This fixes piglit 'arb_uniform_buffer_object-rendering offset' as well as blurriness in Witcher2. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91890 Signed-off-by: Ilia Mirkin <[email protected]> Cc: "11.0" <[email protected]>
* nv30: Disable msaa unless requested from the env by NV30_MAX_MSAAHans de Goede2015-09-092-1/+21
| | | | | | | | | | | | | | | | | | | | Some modern apps try to use msaa without keeping in mind the restrictions on videomem of older cards. Resulting in dmesg saying: [ 1197.850642] nouveau E[soffice.bin[3785]] fail ttm_validate [ 1197.850648] nouveau E[soffice.bin[3785]] validating bo list [ 1197.850654] nouveau E[soffice.bin[3785]] validate: -12 Because we are running out of video memory, after which the program using the msaa visual freezes, and eventually the entire system freezes. To work around this we do not allow msaa visauls by default and allow the user to override this via NV30_MAX_MSAA. Signed-off-by: Hans de Goede <[email protected]> [imirkin: move env var lookup to screen so that it's only done once] Signed-off-by: Ilia Mirkin <[email protected]> Cc: "10.6 11.0" <[email protected]>
* nv30: Fix color resolving for nv3x cardsHans de Goede2015-09-091-1/+37
| | | | | | | | | | | | | We do not have a generic blitter on nv3x cards, so we must use the sifm object for color resolving. This commit divides the sources and dest surfaces in to tiles which match the constraints of the sifm object, so that color resolving will work properly on nv3x cards. Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Cc: "11.0" <[email protected]>
* gallium/docs: clairify dmabuf fd ownershipRob Clark2015-09-091-0/+8
| | | | | | | Since debugging issues w/ fd's close()d at the wrong time can be quite fun, this should probably be made more explicit in the docs. Signed-off-by: Rob Clark <[email protected]>
* android: radeonsi: add support for sid_tables.h generated sourcesMauro Rossi2015-09-093-3/+15
| | | | | | | | | | This patch is necessary to avoid building error on android, due to missing sid_tables.h generated sources v2:[Emil Velikov] Correctly split the lists. Fixes: fbbebeae10f(radeonsi: inline si_cmd_context_control) Signed-off-by: Emil Velikov <[email protected]>
* nouveau: android: add space before PRIx64 macroMauro Rossi2015-09-091-1/+1
| | | | | | | | | | | | | | | | | | | | | Otherwise the android build fails with error : unable to find string literal operator ‘operator"" PRIx64’ There are several resources referring to the problem, which is related to c++11, in our case used when building mesa for lollipop. http://comments.gmane.org/gmane.comp.graphics.opensg.user/5883 I've not investigated all the semantics, some people even suggested a bug in the gcc compiler, I just saw the building error was solved with one little space for lollipop and no side effect when c+11 not used. v2: [Emil Velikov] add an alternative commit message from Mauro. Cc: 11.0 <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* svga: pick all the files into the tarballEmil Velikov2015-09-091-5/+26
| | | | Signed-off-by: Emil Velikov <[email protected]>