Commit Graph

119 Commits

Author SHA1 Message Date
Rob Clark f4bbf29d76 gallium/aux: Update scons build for u_tracepoints.[ch]
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7974>
2020-12-08 16:02:10 +00:00
Marijn Suijten f21dd3bc5a scons: gallium/auxiliary: Unconditionally compile NIR regardless of LLVM
NIR sources are not depending on LLVM (anymore?) as can be seen in the
equivalent unconditional inclusion of nir/ source files in meson.build.
Symbols in these files are necessary to compile softpipe:

    Linking build/linux-x86_64-debug/gallium/targets/libgl-xlib/libGL.so.1.5 ...
    /usr/bin/ld: build/linux-x86_64-debug/gallium/drivers/softpipe/libsoftpipe.a(sp_state_shader.os): in function `softpipe_create_shader_state':
    src/gallium/drivers/softpipe/sp_state_shader.c:146: undefined reference to `nir_to_tgsi'
    /usr/bin/ld: build/linux-x86_64-debug/gallium/drivers/softpipe/libsoftpipe.a(sp_state_shader.os): in function `softpipe_create_compute_state':
    src/gallium/drivers/softpipe/sp_state_shader.c:435: undefined reference to `nir_to_tgsi'

Fixes: fa483d8cd1 ("android: gallium/auxiliary: Deduplicate nir_to_tgsi.c inclusion")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3669

Tested-by: Vinson Lee <vlee@freedesktop.org>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7250>
2020-10-23 17:34:31 +00:00
Dave Airlie 3b9950098b gallivm: nir->tgsi info convertor (v2)
This is a port of the old radeonsi code to be used for llvmpipe NIR support.

Once we remove TGSI support from llvmpipe (I can dream? :-), then
we should be able to refine most of this down and remove it.

v2: port to later radeonsi code for vertex inputs and sampler/io parsing.

Acked-by: Roland Scheidegger <sroland@vmware.com>
2019-11-28 14:48:11 +10:00
Eric Anholt 882ca6dfb0 util: Move gallium's PIPE_FORMAT utils to /util/format/
To make PIPE_FORMATs usable from non-gallium parts of Mesa, I want to
move their helpers out of gallium.  Since u_format used
util_copy_rect(), I moved that in there, too.

I've put it in a separate directory in util/ because it's a big chunk
of related code, and it's not clear to me whether we might want it as
a separate library from libmesa_util at some point.

Closes: #1905
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-11-14 10:47:20 -08:00
Giuseppe Bilotta 8c00fe3970 scons: whitespace cleanup
This text transformation was done automatically via the following shell
command:

$ find -name SCons\* -exec sed -i s/\\s\\+$// '{}' \;

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-05-25 12:23:12 -06:00
Jose Fonseca a97a955b92 scons: Eliminate MSVC2008 compatibility.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2016-02-11 21:36:00 +00:00
Jose Fonseca 00faf9f000 scons: Use -Werror MSVC compatibility flags per-directory.
Matching what we already do with autotools builds.

Reviewed-by: Brian Paul <brianp@vmware.com>
2015-03-04 15:12:06 +00:00
Emil Velikov c642e87d9f auxiliary/vl: rework the build of the VL code
Rather than shoving all the VL code for non-VL targets, increasing
their size, just split it out and use it when needed. This gives us
the side effect of building vl_winsys_dri.c once, dropping a few
automake warnings, and reducing the size of the dri modules as below

   text    data     bss     dec     hex filename
5850573  187549 1977928 8016050  7a50b2 before/nouveau_dri.so
5508486  187100  391240 6086826  5ce0aa after/nouveau_dri.so

The above data is for a nouveau + swrast + kms_swrast 'megadriver'.

v2: Do not include the vl sources in the auxiliary library.
v3: Rebase. Add nine.

Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-11-26 20:09:09 +00:00
Emil Velikov 86a51eb861 auxiliary/vl: split the vl sources list into VL_SOURCES
With follow up commit we'll split vl static lib from the auxiliary one,
and choose the appropriate vl (galliumvl or galliumvl_stub) for the
respective targets to link against.

v2: Rebase.

Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-11-26 20:09:09 +00:00
José Fonseca 4784623b3e gallium/auxiliary: Remove GALLIVM_CPP_SOURCES
Redundant.

Should fix ttps://bugs.freedesktop.org/show_bug.cgi?id=86330
2014-11-16 10:16:47 +00:00
Jason Ekstrand 992e1ea8e4 gallium: Move sRGB <-> RGB handling to libmesautil
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-04 11:07:15 -07:00
José Fonseca 40ddd8b659 Revert "scons: Fix build when rtti is disabled"
This reverts commit 94d05bf87a as it has a
few problems:

- it breaks windows builds becuase env[LLVM_CXXFLAGS] is never set there

- it is merging not only rtti, but the whole cxxflags (defines etc)
  which has proven to be a source of troubles (breaks debugging etc.)
2013-10-16 15:05:51 -07:00
Alexander von Gluck IV 94d05bf87a scons: Fix build when rtti is disabled
* The rtti fix actually dug up a bug in the scons build scripts.
* Autotools took the LLVM cpp and cxx flags, while scons only took
  the cpp flags.
* This grabs the cxx flags and applies them where needed. We may
  want to make the same change for the llvm cpp flags in scons.
* The only linux platform I can find with LLVM no-rtti is Ubuntu.
* Fixes bug #70471

Tested-by: Vinson Lee <vlee@freedesktop.org>
2013-10-15 22:12:18 -05:00
José Fonseca 8cabc7be1d scons: Don't force stabs debug format for Mingw.
- recent gdb handles DWARF fine (tested both with version
  7.1.90.20100730 from mingw-w64 project, and 7.5-1 from mingw project)

- http://people.freedesktop.org/~jrfonseca/bfdhelp/ was updated to
  handle DWARF

- stabs requires ugly hacks to prevent compilation failures

- mixing stabs/dwarf prevents proper backtraces (which is inevitable,
  given that the MinGW C runtime is pre-built with DWARF)

For example, without this change I get:

  (gdb) bt
  #0  _wassert (_Message=0xf925060 L"Num < NumOperands && \"Invalid child # of SDNode!\"",
      _File=0xf60b488 L"llvm/include/llvm/CodeGen/SelectionDAGNodes.h", _Line=534)
      at ../../../../mingw-w64-crt/misc/wassert.c:51
  #1  0x0368996b in _assert (_Message=0x39d7ee4 "Num < NumOperands && \"Invalid child # of SDNode!\"",
      _File=0x39d7e94 "llvm/include/llvm/CodeGen/SelectionDAGNodes.h", _Line=534)
      at ../../../../mingw-w64-crt/misc/wassert.c:44
  #2  0x00000004 in ?? ()
  #3  0x00000004 in ?? ()
  #4  0x0f60b488 in ?? ()
  #5  0x00000000 in ?? ()

While with this change I get:

  (gdb) bt
  #0  _wassert (_Message=0xfb982e8 L"Num < NumOperands && \"Invalid child # of SDNode!\"",
      _File=0xefbcb40 L"llvm/include/llvm/CodeGen/SelectionDAGNodes.h", _Line=534)
      at ../../../../mingw-w64-crt/misc/wassert.c:51
  #1  0x039c996b in _assert (_Message=0x3d17f24 "Num < NumOperands && \"Invalid child # of SDNode!\"",
      _File=0x3d17ed4 "llvm/include/llvm/CodeGen/SelectionDAGNodes.h", _Line=534)
      at ../../../../mingw-w64-crt/misc/wassert.c:44
  #2  0x033111cc in getOperand (Num=4, this=<optimized out>)
      at llvm/include/llvm/CodeGen/SelectionDAGNodes.h:534
  #3  getOperand (i=4, this=<optimized out>)
      at llvm/include/llvm/CodeGen/SelectionDAGNodes.h:779
  #4  llvm::SelectionDAG::getNode (this=0xf00cb08, Opcode=79, DL=..., VT=..., N1=..., N2=...)
      at llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2859
  #5  0x03377b20 in llvm::SelectionDAGBuilder::visitExtractElement (this=0xfb45028, I=...)
      at llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:2803
  [...]

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-05-21 12:34:19 +01:00
James Benton 6dd8e6f9cb util: Reimplement half <-> float conversions.
Removed u_half.py used to generate the table for previous method.

Previous implementation of float to half conversion was faulty for
denormalised and NaNs and would require extra logic to fix,
thus making the speedup of using tables irrelevant.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-06-29 12:21:02 +01:00
Brian Paul cdb7396390 scons: don't compile some files with -gstabs if using mingw32
Compiling some (large) files with i686-pc-mingw32-gcc 4.2.2 (at least)
and the -gstabs option triggers a compiler error.  Use this work-around
to simply compile the effected files without -gstabs.
2011-08-26 08:05:36 -06:00
Chia-I Wu dd250e6045 auxiliary: share the source lists
Factor out source lists from Makefile to Makefile.sources, and let
Makefile, SConscript, and Android.mk share it.

Note that files in $(GENERATED_SOURCES) are removed from $(C_SOURCES).

Acked-by: José Fonseca <jfonseca@vmware.com>
Acked-by: Chad Versace <chad@chad-versace.us>
2011-08-23 09:12:08 +08:00
Christian König 3d1057f243 [g3dvl] sync SConscript with Makefile 2011-07-11 13:55:56 +02:00
Christian König 003401f95c Merge remote-tracking branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/tests/unit/u_format_test.c
	src/gallium/winsys/r600/drm/r600_hw_context.c
2011-06-09 09:35:09 +02:00
Brian Paul b3e75a61ee draw: rename draw_vs_varient.c to draw_vs_variant.c 2011-06-07 07:57:26 -06:00
Christian König fa31b1095e Merge remote branch 'origin/master' into pipe-video
Conflicts:
	configs/linux-dri
	src/gallium/drivers/r600/r600_pipe.c
	src/gallium/drivers/r600/r600_state.c
	src/gallium/include/pipe/p_format.h
	src/gallium/tests/graw/fragment-shader/frag-abs.sh
	src/gallium/tests/graw/fragment-shader/frag-add.sh
	src/gallium/tests/graw/fragment-shader/frag-cb-1d.sh
	src/gallium/tests/graw/fragment-shader/frag-cb-2d.sh
	src/gallium/tests/graw/fragment-shader/frag-dp3.sh
	src/gallium/tests/graw/fragment-shader/frag-dp4.sh
	src/gallium/tests/graw/fragment-shader/frag-dst.sh
	src/gallium/tests/graw/fragment-shader/frag-ex2.sh
	src/gallium/tests/graw/fragment-shader/frag-face.sh
	src/gallium/tests/graw/fragment-shader/frag-flr.sh
	src/gallium/tests/graw/fragment-shader/frag-frc.sh
	src/gallium/tests/graw/fragment-shader/frag-kil.sh
	src/gallium/tests/graw/fragment-shader/frag-lg2.sh
	src/gallium/tests/graw/fragment-shader/frag-lit.sh
	src/gallium/tests/graw/fragment-shader/frag-lrp.sh
	src/gallium/tests/graw/fragment-shader/frag-mad-immx.sh
	src/gallium/tests/graw/fragment-shader/frag-mad.sh
	src/gallium/tests/graw/fragment-shader/frag-max.sh
	src/gallium/tests/graw/fragment-shader/frag-min.sh
	src/gallium/tests/graw/fragment-shader/frag-mov.sh
	src/gallium/tests/graw/fragment-shader/frag-mul.sh
	src/gallium/tests/graw/fragment-shader/frag-rcp.sh
	src/gallium/tests/graw/fragment-shader/frag-rsq.sh
	src/gallium/tests/graw/fragment-shader/frag-sge.sh
	src/gallium/tests/graw/fragment-shader/frag-slt.sh
	src/gallium/tests/graw/fragment-shader/frag-srcmod-abs.sh
	src/gallium/tests/graw/fragment-shader/frag-srcmod-absneg.sh
	src/gallium/tests/graw/fragment-shader/frag-srcmod-neg.sh
	src/gallium/tests/graw/fragment-shader/frag-srcmod-swz.sh
	src/gallium/tests/graw/fragment-shader/frag-sub.sh
	src/gallium/tests/graw/fragment-shader/frag-tempx.sh
	src/gallium/tests/graw/fragment-shader/frag-xpd.sh
	src/gallium/tests/graw/vertex-shader/vert-abs.sh
	src/gallium/tests/graw/vertex-shader/vert-add.sh
	src/gallium/tests/graw/vertex-shader/vert-arl.sh
	src/gallium/tests/graw/vertex-shader/vert-arr.sh
	src/gallium/tests/graw/vertex-shader/vert-cb-1d.sh
	src/gallium/tests/graw/vertex-shader/vert-cb-2d.sh
	src/gallium/tests/graw/vertex-shader/vert-dp3.sh
	src/gallium/tests/graw/vertex-shader/vert-dp4.sh
	src/gallium/tests/graw/vertex-shader/vert-dst.sh
	src/gallium/tests/graw/vertex-shader/vert-ex2.sh
	src/gallium/tests/graw/vertex-shader/vert-flr.sh
	src/gallium/tests/graw/vertex-shader/vert-frc.sh
	src/gallium/tests/graw/vertex-shader/vert-lg2.sh
	src/gallium/tests/graw/vertex-shader/vert-lit.sh
	src/gallium/tests/graw/vertex-shader/vert-lrp.sh
	src/gallium/tests/graw/vertex-shader/vert-mad.sh
	src/gallium/tests/graw/vertex-shader/vert-max.sh
	src/gallium/tests/graw/vertex-shader/vert-min.sh
	src/gallium/tests/graw/vertex-shader/vert-mov.sh
	src/gallium/tests/graw/vertex-shader/vert-mul.sh
	src/gallium/tests/graw/vertex-shader/vert-rcp.sh
	src/gallium/tests/graw/vertex-shader/vert-rsq.sh
	src/gallium/tests/graw/vertex-shader/vert-sge.sh
	src/gallium/tests/graw/vertex-shader/vert-slt.sh
	src/gallium/tests/graw/vertex-shader/vert-srcmod-abs.sh
	src/gallium/tests/graw/vertex-shader/vert-srcmod-absneg.sh
	src/gallium/tests/graw/vertex-shader/vert-srcmod-neg.sh
	src/gallium/tests/graw/vertex-shader/vert-srcmod-swz.sh
	src/gallium/tests/graw/vertex-shader/vert-sub.sh
	src/gallium/tests/graw/vertex-shader/vert-xpd.sh
	src/gallium/tools/trace/dump.py
	src/gallium/tools/trace/format.py
	src/gallium/tools/trace/model.py
	src/gallium/tools/trace/parse.py
2011-04-23 14:27:40 +02:00
José Fonseca 3733da31e8 draw: Prevent out-of-bounds vertex buffer access.
Based on some code and ideas from Keith Whitwell.
2011-04-01 20:18:18 +01:00
Christian König 2bf95c519e Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_asm.c
	src/gallium/tests/unit/SConscript
2011-03-19 01:02:40 +01:00
José Fonseca e6314db0ac gallivm: Use LLVM MC disassembler, instead of udis86.
Included in LLVM 2.7+. Unlink udis86, should support all instructions that
LLVM can emit.
2011-03-13 19:24:26 +00:00
Brian Paul 7dcf019af2 gallium/util: new polygon stipple utility helper
The polygon stipple fallback does not have to be implemented in the
draw module (it doesn't need window coords, etc).  Drivers can use
this utility and avoid sw vertex fallbacks if pstipple is enabled.
Note: this is WIP and not used by any driver yet.
2011-03-10 09:44:32 -07:00
Marek Olšák 23f92c20d7 gallium/util: add LATC support
Again, a lot of code is shared with RGTC.

The layout is UTIL_FORMAT_LAYOUT_RGTC, because LATC is just swizzled RGTC.
2011-03-08 23:52:37 +01:00
Christian König 0eccb1038a Merge remote branch 'origin/master' into pipe-video 2011-03-03 00:59:12 +01:00
Vinson Lee 0f29d394a4 gallium: Add u_format_rgtc.c to SConscript. 2011-03-01 23:02:50 -08:00
Christian König b922a0ce12 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	configure.ac
	src/gallium/auxiliary/Makefile
	src/gallium/auxiliary/SConscript
	src/gallium/drivers/r600/r600_asm.c
	src/gallium/drivers/r600/r600_asm.h
	src/gallium/drivers/r600/r600_shader.c
	src/gallium/drivers/r600/r600_state_inlines.h
	src/gallium/drivers/r600/r600_texture.c
2011-02-24 22:02:42 +01:00
Marek Olšák 975320ab76 util: import a new vertex buffer manager
This code has originally matured in r300g and was ported to r600g several
times. It was obvious it's a code duplication.

See also comments in the header file.
2011-02-07 02:23:46 +01:00
Christian König 772b25e1f3 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_pipe.c
	src/gallium/drivers/r600/r600_texture.c
2010-12-11 13:43:44 +01:00
Marek Olšák 80f24c1575 util: rename u_mempool -> u_slab 2010-11-30 10:12:26 +01:00
Jakob Bornecrantz e89e8a4347 gallium: Remove redundant sw and debug target helpers 2010-11-17 23:49:09 +00:00
Christian König 195bbe8ce2 Merge remote branch 'origin/master' into pipe-video 2010-11-11 21:07:42 +01:00
José Fonseca 601498ae73 scons: Revamp how to specify targets to build.
Use scons target and dependency system instead of ad-hoc options.

Now is simply a matter of naming what to build. For example:

  scons libgl-xlib

  scons libgl-gdi

  scons graw-progs

  scons llvmpipe

and so on. And there is also the possibility of scepcified subdirs, e.g.

  scons src/gallium/drivers

If nothing is specified then everything will be build.

There might be some rough corners over the next days. Please bare with me.
2010-11-01 13:30:22 +00:00
Christian König 41ed47d6b8 Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa into pipe-video
Conflicts:
	src/gallium/include/pipe/p_format.h
2010-10-28 20:24:56 +02:00
Christian König 695cc370a2 Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa into pipe-video
Conflicts:
	configure.ac
	src/gallium/drivers/nvfx/Makefile
	src/gallium/include/pipe/p_defines.h
	src/gallium/include/pipe/p_screen.h
	src/gallium/include/state_tracker/dri1_api.h
	src/gallium/include/state_tracker/drm_api.h
	src/gallium/winsys/nouveau/drm/nouveau_drm_api.c
2010-10-12 23:07:29 +02:00
José Fonseca 7c1b5772a8 gallivm: More detailed analysis of tgsi shaders.
To allow more optimizations, in particular for direct textures.
2010-10-11 13:05:32 +01:00
Brian Paul d49f153ab3 Merge branch 'sprite-coord' 2010-09-21 09:57:25 -06:00
Dave Airlie 91b70d8408 util/r300g: split the r300 index buffer modifier functions out to util
These can be used by other drivers, like r600g.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-09-20 09:38:18 +10:00
Brian Paul e22e3927b0 gallium: rework handling of sprite_coord_enable state
Implement the pipe_rasterizer_state::sprite_coord_enable field
in the draw module (and softpipe) according to what's specified
in the documentation.

The draw module can now add any number of extra vertex attributes
to a post-transformed vertex and generate texcoords for those
attributes per sprite_coord_enable.  Auto-generated texcoords
for sprites only worked for one texcoord unit before.

The frag shader gl_PointCoord input is now implemented like any
other generic/texcoord attribute.

The draw module now needs to be informed about fragment shaders
since we need to look at the fragment shader's inputs to know
which ones need auto-generated texcoords.

Only softpipe has been updated so far.
2010-09-17 18:45:13 -06:00
José Fonseca 795eb3d64a gallivm: Start collecting bitwise arithmetic helpers in a new module. 2010-09-16 20:20:49 +01:00
Brian Paul 0a7824862e gallivm: expand AoS sampling to cover all filtering modes
...and all texture targets (1D/2D/3D/CUBE).
2010-09-15 17:04:31 -06:00
José Fonseca 93158622e2 gallivm: Basic AoS TGSI -> LLVM IR.
Essentially a variation of the SoA version.
2010-09-11 13:25:49 +01:00
Vinson Lee 15d558c306 auxiliary: Add missing files to SCons build.
Add u_linear.c and u_linkages.c to SCons build.
Reorder list of files to be more alphabetical.
2010-08-21 12:32:17 -07:00
Luca Barbieri 2ff13fe89e auxiliary: add reference count debugging code 2010-08-20 18:18:28 +02:00
Luca Barbieri b1fa352db8 os_stream: add printf facility 2010-08-20 18:18:28 +02:00
Luca Barbieri d46f91af68 auxiliary: add functions to describe gallium objects 2010-08-20 18:18:28 +02:00
Chia-I Wu a97419a3ba draw: Remove varray and vcache.
They have been deprecated by vsplit.
2010-08-16 20:46:29 +08:00
Chia-I Wu 04bc530dbd draw: Add vsplit frontend.
vsplit is based on varray.  It sets the split flags when a primitive is
splitted.  It also has support for indexed primitives.

For indexed primitives, unlike vcache, vsplit splits the primitives
instead of decomposes them.
2010-08-16 20:46:28 +08:00