Commit Graph

210 Commits

Author SHA1 Message Date
Eric Anholt 92e8e94ee9 mesa: Move the rest of format_unpack.py out of code generation.
There's nothing conditional any more in the template, so just move it
to plain .c code at last.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6297>
2021-01-15 18:58:50 +00:00
Jose Fonseca 2e92d33819 scons: Prune out unnecessary targets.
This prunes out all targets except libgl-gdi, libgl-xlib, and svga, as
suggested by Marek Olšák.

libgl-xlib will be remove once I have had time to confirm no automated
tests we have rely upon it.

There are also a bunch of Makefile.sources which become orphaned as
result, that are not taken care of in this change.

v2: Prune remainders of swr support.

Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4348>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4348>
2020-03-30 13:38:01 +00:00
Marek Olšák 8a3e2cd9b2 glthread: compile marshal_generated.c faster by breaking it up into 8 files
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4270>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4270>
2020-03-24 16:28:30 -04:00
Eric Anholt 52a39a332f mesa: Replace gen_matypes with a simple header for V4F/mat layout.
We can greatly simplify our builds by just hardcoding GLvector4f and
GLmatrix's layouts.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2019-07-01 11:12:15 -07:00
Jose Fonseca 45bacc4b63 scons: Remove gles option.
It's broken, and WGL state tracker is always built with GLES support
noawadays.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2018-10-19 16:50:26 +01:00
Vinson Lee 26ddc4f9e1 scons: Add PROGRAM_NIR_FILES.
Fix SCons build error.

  Linking build/linux-x86_64-debug/gallium/targets/libgl-xlib/libGL.so.1.5 ...
build/linux-x86_64-debug/mesa/libmesa.a(st_program.os): In function `st_translate_prog_to_nir':
src/mesa/state_tracker/st_program.c:392: undefined reference to `prog_to_nir'

Fixes: 5c33e8c772 ("st/nir: use NIR for asm programs")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2018-05-12 00:50:05 -07:00
Matt Turner 74b5568978 build: Remove HAVE_DLOPEN
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-10-02 19:41:22 -07:00
Brian Paul 7bbcf3ac70 scons: add code to generate format_fallback.c file
Fixes: a1983223d8 "mesa: Add _mesa_format_fallback_rgbx_to_rgba() [v2]"

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-06-28 04:12:25 -06:00
Jose Fonseca 2ba991cbcd scons: Fix dependencies of marshal_generated.[ch].
These generated source files depend not only upon gl_and_es_API.xml, but
all other XML files that are included by it.

This change updates the generation rules to depend on all gen/*.xml
files, like done for other SCons generation rules, and should fix
incremental broken SCons builds due to missing dependencies.

Trivial.
2017-03-26 21:30:34 +01:00
Paul Berry 05dd4a1104 glapi: Generate GL API marshalling code from the XML.
This is not yet used in the build, just generated.

v2: Add missing build dependencies.
v3: Avoid mixing declarations and code, remove logic for avoiding emitting
    code that the compiler's optimizer can deal with anyway.
v4: (Timothy Arceri) move safe_mul() genereation here from a later patch.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Acked-by: Marek Olšák <maraeo@gmail.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Tested-by: Mike Lothian <mike@fireburn.co.uk>
2017-03-16 14:14:18 +11:00
Ian Romanick 7d6af9e599 glsl: Generate ir_expression_operation.h from Python
There are differences in where end-of-line comments are placed, but
'diff -wud' is clean.

v2: Massive rebase.

v3: With much help from José Fonseca, fix SCons build.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Dylan Baker <dylan@pnwbakers.com>
2016-08-30 16:28:00 -07:00
Jose Fonseca 09dafb9630 scons: Take indirect gl_and_es_API.xml dependencies in consideration.
Same as 26a8f76ba1.

Trivial.
2016-08-27 22:59:06 +01:00
Emil Velikov ae9a2baaa6 mesa: scons: remove left over src/glsl include
The path no longer exists.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-07-20 13:33:43 +01:00
Emil Velikov 1c7c0d77ac mesa: scons: list builddir before srcdir
Analogous to previous commit.

Note: scons always uses OOT builds, while the in-tree generated files
could be created either manually or by the autoconf build.

Cc: "11.2 12.0" <mesa-stable@lists.freedesktop.org>
Cc: Alexander von Gluck IV <kallisti5@unixzen.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-07-20 13:32:24 +01:00
Brian Paul ace3124f22 scons: put the generated git_sha1.h file in top-level src/ directory
To match what's done in the automake build.

v2: Use git rev-parse to get a 10-character hash ID
    Fix Python imports

Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2016-06-17 10:33:00 -06:00
Rob Clark 1e93b0caa1 mesa/st: add support for NIR as possible driver IR
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Acked-by: Eric Anholt <eric@anholt.net>
2016-05-17 14:22:46 -04:00
Jose Fonseca 9a25c8af1b scons: Whenever possible decide what to do based on platform and not compiler.
Because compilers like GCC and Clang are effectively available everywhere
so their presence/absence is seldom conclusive.

Furthermore, all compilers we use now have stdint.h.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-04-26 17:17:00 +01:00
Emil Velikov 24f984f64a nir: move glsl_types.{cpp,h} to compiler
Allows us to remove the SCons workaround :-)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-01-26 16:08:24 +00:00
Rob Clark b9b40ef9b7 nir: remove dependency on glsl
Move glsl_types into NIR, now that the dependency on glsl_symbol_table
has been split out.

Possibly makes sense to rename things at this point, but if we do that
I'd like to keep it split out into a separate patch to make git history
easier to follow (IMHO).

v2: fix android build
v3: I f***ing hate scons.. but at least it builds

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-10-16 19:33:38 -04:00
Jose Fonseca 5db57b8a55 scons: Fix git_sha1.h generation fallback.
I didn't meant to remove the 'if not os.path.exists(filename)' statement.

Reviewed-by: Brian Paul <brianp@vmware.com>
2015-03-25 10:42:26 +00:00
Jose Fonseca 31e47a59ad scons: Cleanup flex/bison settings specification.
Reviewed-by: Brian Paul <brianp@vmware.com>
2015-03-22 08:23:24 +00:00
Jose Fonseca e6330f9f56 scons: Ensure git_sha1.h's directory exists.
Reviewed-by: Brian Paul <brianp@vmware.com>
2015-03-22 08:23:24 +00:00
Jose Fonseca d3e9aa8d88 scons: Don't link program_lexer.l/y twice.
program/lex.yy.c and program/program_parse.tab.c is already included in
the PROGRAM_FILES variable.

We still need to specify the dependency relationship though.

Reviewed-by: Brian Paul <brianp@vmware.com>
2015-03-18 21:51:54 +00:00
Emil Velikov 3f6c28f2a9 mesa: rename format_info.c to format_info.h
The file is auto-generated, and #included by formats.c. Let's rename it
to reflect the latter. This will also help up fix the dependency
tracking by adding it to the _SOURCES variable, without the side effect
of it being compiled (twice).

v2: Update .gitignore to reflect the rename.

Cc: "10.4, 10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-05 14:45:54 +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
Eric Anholt e8c5cbfd92 mesa: Add gallium include dirs to more parts of the tree.
v2: Try to patch up the scons bits.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2015-02-20 11:36:34 -08:00
Jason Ekstrand e1fdcddafe mesa: Autogenerate format_unpack.c
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>

v2 by Samuel Iglesias <siglesias@igalia.com>:
- Add usage of INDENT_FLAGS in Makefile.am

v3 by Samuel Iglesias <siglesias@igalia.com>:
- Modify unpack_float_*() and unpack_ubyte_*() function generation
to use c.datatype() and f.datatype()
- Fix out-of-tree build

v4 by Samuel Iglesias <siglesias@igalia.com>:
- format_unpack.c.mako is now format_unpack.py, with the template code
  inlined. It now auto-generates format_unpack.c
- Add format_unpack.c to gitignore.
- Simplify Makefile.am change
- Modify SConscript to build format_unpack.c with scons

v5 by Samuel Iglesias <siglesias@igalia.com>:
- Don't allow float to non-normalized integer format conversions.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2015-01-12 11:20:28 +01:00
Jason Ekstrand e0439f7505 mesa: Autogenerate most of format_pack.c
We were auto-generating it before.  The problem was that the autogeneration
tool we were using was called "copy, paste, and edit".  Let's use a more
sensible solution.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>

v2 by Samuel Iglesias <siglesias@igalia.com>
- Remove format_pack.c as it is now autogenerated
- Add usage of INDENT_FLAGS in Makefile.am
- Remove trailing blank line

v3 by Samuel Iglesias <siglesias@igalia.com>
- Merge format_convert.py into format_parser.py
   - Adapt pack_*_* function generations
- Fix out-of-tree build

v4 by Samuel Iglesias <siglesias@igalia.com>
- _get_datatype() is now a helper function

v5 by Samuel Iglesias <siglesias@igalia.com>
- format_pack.c.mako is now format_pack.py, with the template code
  inlined. It now auto-generates format_pack.c
- Simplify Makefile.am change.
- Modify SConscript to build format_pack.c with scons.
- Remove run_mako.py
- Add format_pack.c to gitignore

v6 by Samuel Iglesias <siglesias@igalia.com>:
- Don't allow float to non-normalized integer format conversions.
- Add non-normalized formats support for ubyte packing functions. Merge
the previously separated patch.
- Add clamping for non-normalized integer formats in pack_ubyte*()

v7 by Samuel Iglesias <siglesias@igalia.com>:
- Add assert to check that sRGB formats are 8-bit size.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2015-01-12 11:20:28 +01:00
Jason Ekstrand 12610ffcf7 mesa/formats: Autogenerate the format_info structure from a CSV file
Instead of a having all of the format metadata in a gigantic hard-to-edit
array of type struct format_info, we now have a human-readable CSV file.
The CSV file also contains more format information than the format_info
struct contained so we can potentially make format_info more detailed later.

The python to generate the format information was added the previous
commit.  This commit turns it on in both automake and scons builds.

v2: Split into two commits and stuff to generate format_info.c from scons

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:15 -07:00
Kenneth Graunke 1e0da6233b util: Move ralloc to a new src/util directory.
For a long time, we've wanted a place to put utility code which isn't
directly tied to Mesa or Gallium internals.  This patch creates a new
src/util directory for exactly that purpose, and builds the contents as
libmesautil.la.

ralloc seemed like a good first candidate.  These days, it's directly
used by mesa/main, i965, i915, and r300g, so keeping it in src/glsl
didn't make much sense.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

v2 (Jason Ekstrand): More realloc uses and some scons fixes

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-04 11:06:58 -07:00
Jason Ekstrand dcc29c18b4 mesa/SConscript: Use Makefile.sources instead of duplicating the file lists
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-04 11:06:52 -07:00
José Fonseca c59c8f0363 scons: Fix x86_64 build.
x86/common_x86.c is required also for x86_64 builds.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-22 22:39:42 +01:00
Vinson Lee 98fb8c95c0 scons: Add drivers/common/meta_generate_mipmap.c to src/mesa/SConscript.
This patch fixes this SCons build error introduced with commit
70e7905608.

build/linux-x86_64-debug/mesa/libmesa.a(driverfuncs.os): In function `_mesa_init_driver_functions':
src/mesa/drivers/common/driverfuncs.c:99: undefined reference to `_mesa_meta_GenerateMipmap'

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-03-07 23:39:29 -08:00
Vinson Lee 34587e4a00 scons: Add main/pipelineobj.c to src/mesa/SConscript.
This patch fixes this SCons build error.

build/linux-x86_64-debug/mesa/libmesa.a(context.os): In function `init_attrib_groups':
src/mesa/main/context.c:815: undefined reference to `_mesa_init_pipeline'

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-02-21 17:00:47 -08:00
Brian Paul f0e967f212 scons: add meta_blit.c to src/mesa/SConscript 2014-02-12 17:46:11 -07:00
Paul Berry 79134cb516 mesa/cs: Add dispatch API stubs for ARB_compute_shader.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-05 09:00:14 -08:00
Brian Paul 3abd4f4d90 mesa: move glGenerateMipmap() code into new genmipmap.c file
Mipmap generation has nothing to do with FBOs.
v2: update gl_genexec.py too (not api_exec.c)

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-02 06:52:37 -07:00
Brian Paul bfcb9bb204 mesa: move glBlitFramebuffer code into new blit.c file
Just for better organization.
v2: update gl_genexec.py too (not api_exec.c)

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-02 06:52:37 -07:00
Brian Paul bf27d02390 scons: add new shaderimage.c file to the build 2014-01-15 09:17:04 -07:00
Courtney Goeltzenleuchter d77d2af20a mesa: Add API definitions for ARB_texture_view
Stub in glTextureView API call to go with the
glTextureView API xml definition.
Includes dispatch test for glTextureView

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-13 12:31:53 -07:00
Emil Velikov c5062726f1 scons: drop obsolete enabled_apis variable
The variable was forgotten during the FEATURE_* removal.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-11-16 14:00:15 +00:00
Brian Paul bc23944091 mesa: add vdpau.c and st_vdpau.c to src/mesa/SConscript
Fixes SCons build.
2013-10-26 07:24:17 -06:00
Kenneth Graunke b2e327e08f mesa: Add core support for the GL_AMD_performance_monitor extension.
This provides an interface for applications (and OpenGL-based tools) to
access GPU performance counters.  Since the exact performance counters
available vary between vendors and hardware generations, the extension
provides an API the application can use to get the names, types, and
minimum/maximum values of all available counters.  Counters are also
organized into groups.

Applications create "performance monitor" objects, select the counters
they want to track, and Begin/End monitoring, much like OpenGL's query
API.  Multiple monitors can be in flight simultaneously.

v2: Pass ctx to all driver hooks (suggested by Christoph), and attempt
    to fix overallocation of bitsets (caught by Christoph).  Incomplete.

v3: Significantly rework core data structures.  Store counters in groups
    rather than in a global list.  Use their array index in the group's
    counter list as the ID rather than trying to store a globally unique
    counter ID.  Use bitsets for active counters within a group, and
    also track which groups are active so that's easy to query.

v4: Remove _mesa_ prefix on static functions; detect out of memory
    conditions in new_performance_monitor(); make BeginPerfMonitor hook
    return a boolean rather than setting m->Active or raising an error.
    Switch to GLuint/unsigned for NumGroups, NumCounters, and
    MaxActiveCounters (which also means switching a bunch of temporary
    variable types).  All suggested by Brian Paul.  Also, remove
    commented out code at the bottom of the block.  Finally, fix the
    dispatch sanity test (noticed by Ian Romanick).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com> [v3]
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-09-26 16:55:18 -07:00
Timothy Arceri a7f5eb8ebb mesa: Update builds scripts to build object labels
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-09-04 07:47:49 -06:00
José Fonseca fa3040c117 scons: Fix dependencies of enums.c and api_exec.c. 2013-07-01 12:04:59 +01:00
Andreas Boll f6aab27d43 scons: remove IN_DRI_DRIVER
Not used anymore.
2013-05-01 21:34:48 +02:00
José Fonseca 1687932d2b scons: Support clang.
clang is supports most gcc options / extensions, with a some exceptions.

The biggest advantage of using clang is that compilation times are much
short.

One can tell scons to use clang when building by invoking it as

   CC=clang CXX=clang++ scons libgl-xlib
2013-04-25 11:59:01 +01:00
Brian Paul 815ca0bf38 mesa: generate glGetInteger/Boolean/Float/Doublev() code for all APIs
No longer pass -a flag to the get_hash_generate.py script to specify
OpenGL, ES1, ES2, etc.  This updates the autoconf, scons and android
build files too (so we can bisect).

This is the last of the API-dependent conditional compilation in
core Mesa.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-04-17 17:33:40 -06:00
José Fonseca ed9687cf1b scons: Add st_cb_msaa.c to source list. 2013-04-11 22:37:34 +01:00
José Fonseca cff70dcfb2 scons: Define PACKAGE_VERSION/BUGREPORT globally.
Fixes the scons build.
2013-03-13 13:13:37 +00:00