Move compiler.h and imports.h/c from src/mesa/main into src/util
authorMarek Olšák <marek.olsak@amd.com>
Thu, 26 Mar 2020 01:11:44 +0000 (21:11 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 27 Mar 2020 21:00:09 +0000 (21:00 +0000)
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4324>

247 files changed:
src/compiler/SConscript.glsl
src/compiler/glsl/gl_nir_lower_buffers.c
src/compiler/glsl/gl_nir_lower_samplers_as_deref.c
src/compiler/glsl/glsl_to_nir.cpp
src/compiler/glsl/ir_clone.cpp
src/compiler/glsl/linker.cpp
src/compiler/glsl/tests/builtin_variable_test.cpp
src/compiler/glsl/tests/copy_constant_to_storage_tests.cpp
src/compiler/glsl/tests/general_ir_test.cpp
src/compiler/glsl/tests/invalidate_locations_test.cpp
src/compiler/glsl/tests/lower_int64_test.cpp
src/compiler/glsl/tests/sampler_types_test.cpp
src/compiler/glsl/tests/set_uniform_initializer_tests.cpp
src/compiler/glsl/tests/varyings_test.cpp
src/compiler/nir/nir_opt_copy_propagate.c
src/gallium/state_trackers/glx/xlib/glx_api.c
src/gallium/state_trackers/glx/xlib/xm_api.c
src/intel/compiler/brw_reg.h
src/mapi/glapi/gen/gl_enums.py
src/mapi/glapi/gen/gl_genexec.py
src/mapi/glapi/gen/gl_table.py
src/mesa/Android.libmesa_glsl_utils.mk
src/mesa/Makefile.sources
src/mesa/drivers/common/driverfuncs.c
src/mesa/drivers/common/meta.c
src/mesa/drivers/common/meta_blit.c
src/mesa/drivers/dri/i915/i830_context.c
src/mesa/drivers/dri/i915/i915_context.c
src/mesa/drivers/dri/i915/i915_debug_fp.c
src/mesa/drivers/dri/i915/i915_vtbl.c
src/mesa/drivers/dri/i915/intel_buffer_objects.c
src/mesa/drivers/dri/i915/intel_context.c
src/mesa/drivers/dri/i915/intel_fbo.c
src/mesa/drivers/dri/i915/intel_render.c
src/mesa/drivers/dri/i915/intel_syncobj.c
src/mesa/drivers/dri/i965/brw_conditional_render.c
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/brw_object_purgeable.c
src/mesa/drivers/dri/i965/brw_primitive_restart.c
src/mesa/drivers/dri/i965/brw_program.c
src/mesa/drivers/dri/i965/brw_program_cache.c
src/mesa/drivers/dri/i965/brw_queryobj.c
src/mesa/drivers/dri/i965/brw_sync.c
src/mesa/drivers/dri/i965/brw_vs.c
src/mesa/drivers/dri/i965/gen6_queryobj.c
src/mesa/drivers/dri/i965/hsw_queryobj.c
src/mesa/drivers/dri/i965/intel_buffer_objects.c
src/mesa/drivers/dri/i965/intel_fbo.c
src/mesa/drivers/dri/i965/intel_upload.c
src/mesa/drivers/dri/nouveau/nouveau_driver.h
src/mesa/drivers/dri/r200/r200_cmdbuf.c
src/mesa/drivers/dri/r200/r200_context.c
src/mesa/drivers/dri/r200/r200_ioctl.c
src/mesa/drivers/dri/r200/r200_maos_arrays.c
src/mesa/drivers/dri/r200/r200_sanity.c
src/mesa/drivers/dri/r200/r200_state.c
src/mesa/drivers/dri/r200/r200_state_init.c
src/mesa/drivers/dri/r200/r200_swtcl.c
src/mesa/drivers/dri/r200/r200_tcl.c
src/mesa/drivers/dri/r200/r200_tex.c
src/mesa/drivers/dri/r200/r200_texstate.c
src/mesa/drivers/dri/radeon/radeon_buffer_objects.c
src/mesa/drivers/dri/radeon/radeon_common.c
src/mesa/drivers/dri/radeon/radeon_context.c
src/mesa/drivers/dri/radeon/radeon_fbo.c
src/mesa/drivers/dri/radeon/radeon_fog.c
src/mesa/drivers/dri/radeon/radeon_ioctl.c
src/mesa/drivers/dri/radeon/radeon_maos_arrays.c
src/mesa/drivers/dri/radeon/radeon_maos_verts.c
src/mesa/drivers/dri/radeon/radeon_queryobj.c
src/mesa/drivers/dri/radeon/radeon_queryobj.h
src/mesa/drivers/dri/radeon/radeon_screen.c
src/mesa/drivers/dri/radeon/radeon_state.c
src/mesa/drivers/dri/radeon/radeon_state_init.c
src/mesa/drivers/dri/radeon/radeon_swtcl.c
src/mesa/drivers/dri/radeon/radeon_tcl.c
src/mesa/drivers/dri/radeon/radeon_tex.c
src/mesa/drivers/dri/radeon/radeon_texstate.c
src/mesa/drivers/dri/radeon/radeon_texture.c
src/mesa/drivers/dri/swrast/swrast.c
src/mesa/drivers/osmesa/osmesa.c
src/mesa/drivers/x11/fakeglx.c
src/mesa/drivers/x11/xfonts.c
src/mesa/drivers/x11/xm_api.c
src/mesa/drivers/x11/xm_buffer.c
src/mesa/drivers/x11/xm_dd.c
src/mesa/drivers/x11/xm_tri.c
src/mesa/main/accum.c
src/mesa/main/api_arrayelt.c
src/mesa/main/arbprogram.c
src/mesa/main/arrayobj.c
src/mesa/main/atifragshader.c
src/mesa/main/attrib.c
src/mesa/main/bufferobj.c
src/mesa/main/compiler.h [deleted file]
src/mesa/main/context.c
src/mesa/main/context.h
src/mesa/main/cpuinfo.c
src/mesa/main/debug.c
src/mesa/main/debug_output.c
src/mesa/main/depth.c
src/mesa/main/dlist.c
src/mesa/main/draw_validate.c
src/mesa/main/drawpix.c
src/mesa/main/drawtex.c
src/mesa/main/errors.c
src/mesa/main/es1_conversion.c
src/mesa/main/eval.c
src/mesa/main/execmem.c
src/mesa/main/extensions.c
src/mesa/main/ff_fragment_shader.cpp
src/mesa/main/format_utils.h
src/mesa/main/formats.c
src/mesa/main/framebuffer.c
src/mesa/main/hash.h
src/mesa/main/hint.c
src/mesa/main/image.c
src/mesa/main/imports.c [deleted file]
src/mesa/main/imports.h [deleted file]
src/mesa/main/light.c
src/mesa/main/macros.h
src/mesa/main/matrix.c
src/mesa/main/mipmap.c
src/mesa/main/objectpurge.c
src/mesa/main/pack.c
src/mesa/main/pbo.c
src/mesa/main/pixeltransfer.c
src/mesa/main/polygon.c
src/mesa/main/queryobj.c
src/mesa/main/readpix.c
src/mesa/main/remap.c
src/mesa/main/renderbuffer.c
src/mesa/main/shared.c
src/mesa/main/stencil.c
src/mesa/main/syncobj.c
src/mesa/main/tests/dispatch_sanity.cpp
src/mesa/main/texcompress.c
src/mesa/main/texcompress_cpal.c
src/mesa/main/texcompress_fxt1.c
src/mesa/main/texcompress_rgtc.c
src/mesa/main/texcompress_s3tc.c
src/mesa/main/teximage.c
src/mesa/main/texobj.c
src/mesa/main/texstorage.c
src/mesa/main/texstore.c
src/mesa/main/texturebindless.c
src/mesa/main/textureview.c
src/mesa/main/transformfeedback.h
src/mesa/main/varray.c
src/mesa/main/version.c
src/mesa/main/vtxfmt.c
src/mesa/math/m_debug_clip.c
src/mesa/math/m_debug_norm.c
src/mesa/math/m_debug_xform.c
src/mesa/math/m_matrix.c
src/mesa/math/m_vector.c
src/mesa/math/m_xform.h
src/mesa/meson.build
src/mesa/program/arbprogparse.c
src/mesa/program/prog_cache.c
src/mesa/program/prog_instruction.c
src/mesa/program/prog_noise.c
src/mesa/program/prog_parameter.c
src/mesa/program/prog_parameter_layout.c
src/mesa/program/prog_print.c
src/mesa/program/prog_statevars.c
src/mesa/program/prog_to_nir.c
src/mesa/program/program_lexer.l
src/mesa/program/program_parse.y
src/mesa/program/symbol_table.c
src/mesa/state_tracker/st_atom_atomicbuf.c
src/mesa/state_tracker/st_atom_constbuf.c
src/mesa/state_tracker/st_atom_image.c
src/mesa/state_tracker/st_atom_shader.c
src/mesa/state_tracker/st_atom_storagebuf.c
src/mesa/state_tracker/st_cb_bitmap.c
src/mesa/state_tracker/st_cb_blit.c
src/mesa/state_tracker/st_cb_bufferobjects.c
src/mesa/state_tracker/st_cb_condrender.c
src/mesa/state_tracker/st_cb_drawpixels.c
src/mesa/state_tracker/st_cb_drawtex.c
src/mesa/state_tracker/st_cb_fbo.c
src/mesa/state_tracker/st_cb_feedback.c
src/mesa/state_tracker/st_cb_memoryobjects.c
src/mesa/state_tracker/st_cb_msaa.c
src/mesa/state_tracker/st_cb_queryobj.c
src/mesa/state_tracker/st_cb_rasterpos.c
src/mesa/state_tracker/st_cb_readpixels.c
src/mesa/state_tracker/st_cb_semaphoreobjects.c
src/mesa/state_tracker/st_cb_semaphoreobjects.h
src/mesa/state_tracker/st_cb_texture.c
src/mesa/state_tracker/st_cb_texturebarrier.c
src/mesa/state_tracker/st_context.c
src/mesa/state_tracker/st_draw.c
src/mesa/state_tracker/st_draw_feedback.c
src/mesa/state_tracker/st_extensions.c
src/mesa/state_tracker/st_format.c
src/mesa/state_tracker/st_gen_mipmap.c
src/mesa/state_tracker/st_program.c
src/mesa/swrast/s_aaline.c
src/mesa/swrast/s_aatriangle.c
src/mesa/swrast/s_clear.c
src/mesa/swrast/s_context.c
src/mesa/swrast/s_copypix.c
src/mesa/swrast/s_depth.c
src/mesa/swrast/s_drawpix.c
src/mesa/swrast/s_logic.c
src/mesa/swrast/s_renderbuffer.c
src/mesa/swrast/s_span.c
src/mesa/swrast/s_stencil.c
src/mesa/swrast/s_texcombine.c
src/mesa/swrast/s_texfilter.c
src/mesa/swrast/s_triangle.c
src/mesa/swrast/s_zoom.c
src/mesa/swrast_setup/ss_context.c
src/mesa/tnl/t_context.c
src/mesa/tnl/t_context.h
src/mesa/tnl/t_draw.c
src/mesa/tnl/t_pipeline.c
src/mesa/tnl/t_rebase.c
src/mesa/tnl/t_split_copy.c
src/mesa/tnl/t_vb_fog.c
src/mesa/tnl/t_vb_light.c
src/mesa/tnl/t_vb_normals.c
src/mesa/tnl/t_vb_points.c
src/mesa/tnl/t_vb_program.c
src/mesa/tnl/t_vb_render.c
src/mesa/tnl/t_vb_texgen.c
src/mesa/tnl/t_vb_texmat.c
src/mesa/tnl/t_vb_vertex.c
src/mesa/vbo/vbo_exec.h
src/mesa/vbo/vbo_primitive_restart.c
src/mesa/vbo/vbo_save_draw.c
src/mesa/vbo/vbo_save_loopback.c
src/mesa/x86/common_x86.c
src/mesa/x86/mmx.h
src/mesa/x86/rtasm/x86sse.c
src/meson.build
src/panfrost/bifrost/bifrost_compile.c
src/panfrost/midgard/midgard_compile.c
src/util/Makefile.sources
src/util/compiler.h [new file with mode: 0644]
src/util/disk_cache.c
src/util/imports.c [new file with mode: 0644]
src/util/imports.h [new file with mode: 0644]
src/util/meson.build
src/util/register_allocate.c

index 7de4ff8c45aa3e4d91f31722d9a2b5428f51f9eb..85abfbac78ad677155dcc538a790f3c6c4b13e4d 100644 (file)
@@ -71,7 +71,6 @@ if env['msvc']:
 
 # Copy these files to avoid generation object files into src/mesa/program
 env.Prepend(CPPPATH = ['#src/mesa/main'])
-env.Command('glsl/imports.c', '#src/mesa/main/imports.c', Copy('$TARGET', '$SOURCE'))
 env.Command('glsl/extensions_table.c', '#src/mesa/main/extensions_table.c', Copy('$TARGET', '$SOURCE'))
 # Copy these files to avoid generation object files into src/mesa/program
 env.Prepend(CPPPATH = ['#src/mesa/program'])
@@ -82,7 +81,6 @@ compiler_objs = env.StaticObject(source_lists['GLSL_COMPILER_CXX_FILES'])
 
 mesa_objs = env.StaticObject([
     'glsl/extensions_table.c',
-    'glsl/imports.c',
     'glsl/symbol_table.c',
     'glsl/dummy_errors.c',
 ])
index 60ac141735532833f6ec2d2f4090ae55b7cc7754..b83df08a86769976af5bdb90b03da170b34f9acf 100644 (file)
@@ -26,7 +26,7 @@
 #include "gl_nir.h"
 #include "ir_uniform.h"
 
-#include "main/compiler.h"
+#include "util/compiler.h"
 #include "main/mtypes.h"
 
 static nir_ssa_def *
index a0a5f018ad72e1be202d757bafddf5558186e80d..49a06cfabb615f7238d48e1ce6ee055bc0ebc365 100644 (file)
@@ -61,7 +61,7 @@
 #include "gl_nir.h"
 #include "ir_uniform.h"
 
-#include "main/compiler.h"
+#include "util/compiler.h"
 #include "main/mtypes.h"
 
 struct lower_samplers_as_deref_state {
index e6baf2add066d00a8360f8ee166569a2369f04f5..fe045eaca9bf5e5ea59b3e9afeacc5db048d3096 100644 (file)
@@ -37,7 +37,7 @@
 #include "compiler/nir/nir_builtin_builder.h"
 #include "compiler/nir/nir_deref.h"
 #include "main/errors.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/shaderobj.h"
 #include "util/u_math.h"
index eb24ffe9be2e3faf5041c6d21ec15e3412ea1e34..e46d07d6f43405f94e44ee8405205774e6a71ccd 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #include <string.h>
-#include "main/compiler.h"
+#include "util/compiler.h"
 #include "ir.h"
 #include "compiler/glsl_types.h"
 #include "util/hash_table.h"
index 77e7489a0a6e00ada462cb072677dc4dbdf64046..e0f9c3d06de89636e9094d5ce5ade72c60e11630 100644 (file)
@@ -86,7 +86,7 @@
 #include "util/u_string.h"
 #include "util/u_math.h"
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/shaderobj.h"
 #include "main/enums.h"
 #include "main/mtypes.h"
index cbaa9a385d79fa6da765d9b613e60d0804ddf8a2..6d97ce5b0ba967672aba955a5e05c24db2e7512e 100644 (file)
@@ -22,7 +22,7 @@
  */
 #include <gtest/gtest.h>
 #include "standalone_scaffolding.h"
-#include "main/compiler.h"
+#include "util/compiler.h"
 #include "main/mtypes.h"
 #include "main/macros.h"
 #include "ir.h"
index 2cce7238503ebe12bcfff2191c6aeaec304baae3..9f8bd112ce5d855cf06c5a3a8e3652c0e9f24d55 100644 (file)
@@ -21,7 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 #include <gtest/gtest.h>
-#include "main/compiler.h"
+#include "util/compiler.h"
 #include "main/mtypes.h"
 #include "main/macros.h"
 #include "util/ralloc.h"
index e05ecf9c3d5c29335f272d9e225a13f4e827dc3f..275cff2a999c37851b93808a5a76cfe6ceacef13 100644 (file)
@@ -21,7 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 #include <gtest/gtest.h>
-#include "main/compiler.h"
+#include "util/compiler.h"
 #include "main/mtypes.h"
 #include "main/macros.h"
 #include "ir.h"
index 48c8884d5e488949222b34c061dd424465fdbbae..7b8317f87f2aa529343519aa35edc8e0204bff56 100644 (file)
@@ -21,7 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 #include <gtest/gtest.h>
-#include "main/compiler.h"
+#include "util/compiler.h"
 #include "main/mtypes.h"
 #include "main/macros.h"
 #include "util/ralloc.h"
index a7e8186e41b8a97a5ce489091fbd38b62ff7a215..196710a3c6c27cbc61689c94af800058a7a96e18 100644 (file)
@@ -21,7 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 #include <gtest/gtest.h>
-#include "main/compiler.h"
+#include "util/compiler.h"
 #include "main/mtypes.h"
 #include "main/macros.h"
 #include "ir.h"
index ef03158bba94e71be0644eb602e79c9b570fb1fe..d44d840f694c07681851da7a990ccbaddcfc6058 100644 (file)
@@ -21,7 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 #include <gtest/gtest.h>
-#include "main/compiler.h"
+#include "util/compiler.h"
 #include "main/mtypes.h"
 #include "main/macros.h"
 #include "ir.h"
index 2bcb25d466c36125fbd413a0619d5a01f94cce5a..dfb7235fa8b6101deb283e4ab4f8f2a515c325b9 100644 (file)
@@ -21,7 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 #include <gtest/gtest.h>
-#include "main/compiler.h"
+#include "util/compiler.h"
 #include "main/mtypes.h"
 #include "main/macros.h"
 #include "util/ralloc.h"
index 4ad73be381eb98b9ba1daa7614dc20c232cdac25..30df36acb2b7305f0bf91e613678a05abad9f29e 100644 (file)
@@ -21,7 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 #include <gtest/gtest.h>
-#include "main/compiler.h"
+#include "util/compiler.h"
 #include "main/mtypes.h"
 #include "main/macros.h"
 #include "util/ralloc.h"
index 0961d6bbf2910b4d8b6921b493d685c56df11092..00c78f384510df9024b21932b4e0616fd09dc91e 100644 (file)
@@ -26,7 +26,7 @@
  */
 
 #include "nir.h"
-#include <main/imports.h>
+#include <util/imports.h>
 
 /**
  * SSA-based copy propagation
index 147f928f3c3ea392228e2fcd3bd5508df54d25d0..c820926790f49223dca56fc851872ec9ae99c515 100644 (file)
@@ -39,7 +39,7 @@
 #include <GL/glxproto.h>
 
 #include "xm_api.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/errors.h"
 #include "util/u_math.h"
 
index 3e9d313138b812488cc766e5f8bcd04c0927a358..094b16721abc8c6ae4161fa15a6a848f545a3045 100644 (file)
@@ -70,7 +70,7 @@
 #include "hud/hud_context.h"
 
 #include "main/errors.h"
-#include "main/imports.h"
+#include "util/imports.h"
 
 #include "xm_public.h"
 #include <GL/glx.h>
index a85b10e09f9e3602bf412323abc8862905e25d36..60dc2778eddc19f2a125951da2c7434ada92a6ed 100644 (file)
@@ -43,7 +43,7 @@
 #define BRW_REG_H
 
 #include <stdbool.h>
-#include "main/compiler.h"
+#include "util/compiler.h"
 #include "main/macros.h"
 #include "program/prog_instruction.h"
 #include "brw_eu_defines.h"
index 00f8134bae287dc40d149376fd16a0958b6ba168..539878136421444982bf9d68372c3a5b7b5b511c 100644 (file)
@@ -52,7 +52,7 @@ class PrintGlEnums(gl_XML.gl_print_base):
     def printRealHeader(self):
         print('#include "main/glheader.h"')
         print('#include "main/enums.h"')
-        print('#include "main/imports.h"')
+        print('#include "util/imports.h"')
         print('#include "main/mtypes.h"')
         print('')
         print('typedef struct PACKED {')
index bd14bff4f273af30df51f467055f01fa20a7815a..0309ae58465b4f000b78a0f30bb6e2d514ceb7f6 100644 (file)
@@ -89,7 +89,7 @@ header = """/**
 #include "main/genmipmap.h"
 #include "main/hint.h"
 #include "main/histogram.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/light.h"
 #include "main/lines.h"
 #include "main/matrix.h"
index 4b89ef8a8564b7440c6660dec743ea80e1b7047e..e9fc0538cbe68021a9699edbc676e228b9a630ac 100644 (file)
@@ -100,6 +100,8 @@ class PrintRemapTable(gl_XML.gl_print_base):
  * can SET_FuncName, are used to get and set the dispatch pointer for the
  * named function in the specified dispatch table.
  */
+
+#include "main/glheader.h"
 """)
         return
 
index 0d83cd5a9bfa08d92c76af00672d7692043ff959..e4e8b47d0e3a905a5661e7c5351d21c806a9cb4f 100644 (file)
@@ -43,7 +43,6 @@ LOCAL_C_INCLUDES := \
 
 LOCAL_SRC_FILES := \
        main/extensions_table.c \
-       main/imports.c \
        program/symbol_table.c \
        program/dummy_errors.c
 
index cb4aab1d10aecd2458afa7d49232b891153642ba..bce32e70e35cd4dd788e43c0b4fc20aa8bf9040a 100644 (file)
@@ -43,7 +43,6 @@ MAIN_FILES = \
        main/colortab.h \
        main/compute.c \
        main/compute.h \
-       main/compiler.h \
        main/condrender.c \
        main/condrender.h \
        main/config.h \
@@ -138,8 +137,6 @@ MAIN_FILES = \
        main/histogram.h \
        main/image.c \
        main/image.h \
-       main/imports.c \
-       main/imports.h \
        main/light.c \
        main/light.h \
        main/lines.c \
index e36a80f6a55da28d3e32e0e52058a4af27d2704b..89b21ec9b3f5e21a30809d4dc98de8596292ed94 100644 (file)
@@ -24,7 +24,7 @@
 
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/accum.h"
 #include "main/arrayobj.h"
 #include "main/context.h"
index 41722a38b38d20758bd9addecc386bd7f5b0870b..617f6ea4a84798f74e8c03b63c4423c46ab3b336 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "main/glheader.h"
 #include "main/mtypes.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/arbprogram.h"
 #include "main/arrayobj.h"
 #include "main/blend.h"
index fec4db3af5ce1515b7fbab94feb0403c373f06f5..96f1cba9d6f1e8f30839ea115e705c96217a46cb 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "main/glheader.h"
 #include "main/mtypes.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/arbprogram.h"
 #include "main/arrayobj.h"
 #include "main/blend.h"
index 166c60190b7bc6005d9bbc3b135ac6c67fb683d4..865a3809c66d1518f419ff0382dcb6056eb1d9ea 100644 (file)
@@ -28,7 +28,7 @@
 #include "i830_context.h"
 #include "main/api_exec.h"
 #include "main/extensions.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/version.h"
 #include "main/vtxfmt.h"
 #include "tnl/tnl.h"
index 2e19e57ae6ce4f7fcf56ba52ac06a83c2b376df0..d8db4ab42a319840059d1ad334997cfdebf47040 100644 (file)
@@ -29,7 +29,7 @@
 #include "main/api_exec.h"
 #include "main/framebuffer.h"
 #include "main/extensions.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/version.h"
 #include "main/vtxfmt.h"
index d107c5afb381c28591e71befd0dd49ff07e97227..474394e0df7150b850440cfe9271973b923ec6a6 100644 (file)
@@ -29,7 +29,8 @@
 
 #include "i915_reg.h"
 #include "i915_debug.h"
-#include "main/imports.h"
+#include "util/imports.h"
+#include "main/glheader.h"
 
 static const char *opcodes[0x20] = {
    "NOP",
index 562c83a665f21afd820e704ff14eb5cff041486f..44c41bb43dcc45055b8b3a63fd25edf8cc388ce0 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "main/glheader.h"
 #include "main/mtypes.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/renderbuffer.h"
 #include "main/framebuffer.h"
index e6760964909e72124f2f582d2c4646e5e56b34da..6353c11ea3256c29ebb85467e7c6e2922fc710ad 100644 (file)
@@ -26,7 +26,7 @@
  **************************************************************************/
 
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/macros.h"
 #include "main/bufferobj.h"
index ab4a0bf496166c806bf2ad7936046f0bd9a03205..2c3c488ee22380f46db3b2767591b1fa102c658e 100644 (file)
@@ -31,7 +31,7 @@
 #include "main/extensions.h"
 #include "main/fbobject.h"
 #include "main/framebuffer.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/points.h"
 #include "main/renderbuffer.h"
 
index 880fd7cfba1eb86f0e4ca3468d027faaee57fc6b..4f4a2fe96b904fd4e70be4a7d22f888b624c0ce4 100644 (file)
@@ -27,7 +27,7 @@
 
 
 #include "main/enums.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/mtypes.h"
 #include "main/fbobject.h"
index a3952826246a7e52aea686cfa765cd25fc704713..9d90a5499fc1f487cc92726a9d9d3a00a5ebee2e 100644 (file)
@@ -33,7 +33,7 @@
 #include "main/glheader.h"
 #include "main/context.h"
 #include "main/macros.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/enums.h"
 
index 4839164ed97bd23846bc7ba8bc139a9cf9a40dda..b5e363872ad5b100b6e34cb55e40c56548fe8635 100644 (file)
@@ -38,7 +38,7 @@
  * performance bottleneck, though.
  */
 
-#include "main/imports.h"
+#include "util/imports.h"
 
 #include "intel_context.h"
 #include "intel_batchbuffer.h"
index 5de6778430ca1029ecc69a5d52455a292417dcb4..2450e707a2b50550ddabcb6d99779f1b3caed119 100644 (file)
@@ -30,7 +30,7 @@
  * (GL_NV_conditional_render, GL_ARB_conditional_render_inverted) on Gen7+.
  */
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/condrender.h"
 
 #include "brw_context.h"
index 21566893ec81f57eff17d558b5d33fffc31dffab..5082657deacf3dc8f5156b7451f605a55a9ad5ad 100644 (file)
@@ -37,7 +37,7 @@
 #include "main/fbobject.h"
 #include "main/extensions.h"
 #include "main/glthread.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/points.h"
 #include "main/version.h"
index c6d4a085f0fdaca6df8b8aa6b3051322b32561b4..fd55fe27e72cb1360cde986f0c12b5447894c3a4 100644 (file)
@@ -27,7 +27,7 @@
  * The driver implementation of the GL_APPLE_object_purgeable extension.
  */
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/macros.h"
 #include "main/bufferobj.h"
index 336c7f6131db466f5a12a106b36bd911cb942cbd..a780df31809591790a49a0572e4557227a292192 100644 (file)
@@ -25,7 +25,7 @@
  *
  */
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/bufferobj.h"
 #include "main/varray.h"
 #include "vbo/vbo.h"
index d250f02825b7baf59d2cd5af15cad3ee3618bd5e..54f700b7b11d60643979fd391257923b1d455580 100644 (file)
@@ -30,7 +30,7 @@
   */
 
 #include <pthread.h>
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/glspirv.h"
 #include "program/prog_parameter.h"
 #include "program/prog_print.h"
index e4b321bcc4c4e0966821d4e787e3459dd3a826ea..62d5c4dc991cde6f794220460c28d6dff8742dfa 100644 (file)
@@ -44,7 +44,7 @@
  * big we throw out all of the cache data and let it get regenerated.
  */
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/streaming-load-memcpy.h"
 #include "x86/common_x86_asm.h"
 #include "intel_batchbuffer.h"
index c48f85392759dec332b31a3499659e287df11b18..b27a685d052ef9169365e9c4679e01c13bdc6d28 100644 (file)
@@ -35,7 +35,7 @@
  * appropriately synced with the stage of the pipeline for our extensions'
  * needs.
  */
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/queryobj.h"
 
 #include "brw_context.h"
index d5e2d079380aa5cfda651f634597935300bfc943..73764834c6c51f2473f0575ecf919667b7ce418b 100644 (file)
@@ -40,7 +40,7 @@
 
 #include <libsync.h> /* Requires Android or libdrm-2.4.72 */
 
-#include "main/imports.h"
+#include "util/imports.h"
 
 #include "brw_context.h"
 #include "intel_batchbuffer.h"
index b68a2fcaf28f668a34e94f2c3675a3abab63aa20..1e9cecf9f904722e1d2cc6019cd9e9c39bfcc27d 100644 (file)
@@ -30,7 +30,7 @@
   */
 
 
-#include "main/compiler.h"
+#include "util/compiler.h"
 #include "main/context.h"
 #include "brw_context.h"
 #include "brw_vs.h"
index db6ae21da474203cb8af3f01c33ea3293fae0da0..08fe90b8c029a22aff55a618f288193981c2e9e9 100644 (file)
@@ -31,7 +31,7 @@
  * GL_EXT_transform_feedback, and friends) on platforms that support
  * hardware contexts (Gen6+).
  */
-#include "main/imports.h"
+#include "util/imports.h"
 
 #include "brw_context.h"
 #include "brw_defines.h"
index 0f6c48379367005790557e8b584bcfb65924ced2..4af64f029d534a096711ad965230317fe6aa605f 100644 (file)
@@ -26,7 +26,7 @@
  *
  * Support for query buffer objects (GL_ARB_query_buffer_object) on Haswell+.
  */
-#include "main/imports.h"
+#include "util/imports.h"
 
 #include "brw_context.h"
 #include "brw_defines.h"
index 054ba6b22ff8a08533feb3f9b30523f3d45b7c3a..7528248f62ebc5b1e2bd5740aa33675b8b94d111 100644 (file)
@@ -29,7 +29,7 @@
  * This provides core GL buffer object functionality.
  */
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/macros.h"
 #include "main/streaming-load-memcpy.h"
index c644ade0fd3ed608dd6c523b0bfc8f650ec9dccc..000717173832183fd5b1079830c51b64006a4db5 100644 (file)
@@ -24,7 +24,7 @@
  */
 
 #include "main/enums.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/mtypes.h"
 #include "main/fbobject.h"
index d81ae43e8a066aff303f20a086b824bbde94babd..595e330f3b6e589152549866aa5d78c2a9f415af 100644 (file)
@@ -28,7 +28,7 @@
  * Batched upload via BOs.
  */
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "brw_bufmgr.h"
 #include "brw_context.h"
index 237e9563246023a4cee21069fe2800e7312bc0c8..3230d7e0881a8a722f71aa4e4b0bcaa1be6a04ee 100644 (file)
@@ -27,7 +27,7 @@
 #ifndef __NOUVEAU_DRIVER_H__
 #define __NOUVEAU_DRIVER_H__
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/macros.h"
 #include "main/formats.h"
index 5816709dc5fbc748f04cda27b373f1b070f9ab93..3390e0a66724542ada3946a88c58763ad106cf8b 100644 (file)
@@ -32,7 +32,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/context.h"
 #include "util/simple_list.h"
index 4db7e9d005a3be81771f00860a4e35acf4ad3d93..91ce34c6c42877c0f102270c497b57de8db49e80 100644 (file)
@@ -37,7 +37,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "main/api_arrayelt.h"
 #include "main/api_exec.h"
 #include "main/context.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/extensions.h"
 #include "main/version.h"
 #include "main/vtxfmt.h"
index 90232d45e9eb338244375e047362ce0e0829c0aa..293bec216c845675779ec4183343e454d4df2f72 100644 (file)
@@ -36,7 +36,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include <errno.h>
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/context.h"
 #include "swrast/swrast.h"
index a3d45cf736975e86c9a8c532cc4e1a89f1a262c0..646f8bfc973fd43bb662ff352cfdeee806c19b99 100644 (file)
@@ -34,7 +34,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include "main/glheader.h"
 #include "main/mtypes.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/state.h"
 
index 6628674431c469337df312c6dfc4abc13150c1d8..ade7aaf007ab55459ce09a2df685bb8527e33e0f 100644 (file)
@@ -35,7 +35,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include <errno.h> 
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 
 #include "r200_context.h"
 #include "r200_sanity.h"
index b4cff8c259247bd5602d51345ec2ef05f3acff0f..eff71dbd0515898c720d1e77600521894a0e9d5f 100644 (file)
@@ -34,7 +34,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/enums.h"
 #include "main/light.h"
 #include "main/framebuffer.h"
index 47ecaffc8f7ed7aa24974993582e107a92e9f42b..9febc20363af2815cd211440f10e1f76620953f3 100644 (file)
@@ -33,7 +33,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include "main/errors.h"
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/enums.h"
 #include "main/api_arrayelt.h"
 #include "main/state.h"
index 0fda58656c730f4b78514c5e127179a29c00d7ee..d951bee4fa25a560bcd9fbb432ec3d08ac0ed2ee 100644 (file)
@@ -36,7 +36,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "main/mtypes.h"
 #include "main/enums.h"
 #include "main/image.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/state.h"
 
index 662c041c79f2e707c2a8e9aead19a4e4e828b979..1802711eef0f0cdccc698d27c5632e044ad0995b 100644 (file)
@@ -33,7 +33,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/enums.h"
 #include "main/light.h"
index 1b217b9ed2bcb55fa2828632441d3d232ab8c7b1..425ad538c04052b42d8f566683387bf92ae79c7e 100644 (file)
@@ -32,7 +32,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/context.h"
 #include "main/enums.h"
 #include "main/image.h"
index b227fbbfdf925be6e55a7a92a05e19a39630d2b2..f98fadf560ab1e6e58cba4513e3d7c5978bead1d 100644 (file)
@@ -33,7 +33,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/context.h"
 #include "main/macros.h"
 #include "main/state.h"
index 2b76305dd45c59d65a7f37b4150c03d8bae0b4a0..4bb0078aba54d13b96eb2aedde258b5c86d699bc 100644 (file)
@@ -25,7 +25,7 @@
  *
  */
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/bufferobj.h"
 
index a3bf00b09f7749db02bd3aaeb6bfb533b7b63a1d..ad63ea2d2402f43e26328b6993ceeef1f9168676 100644 (file)
@@ -43,7 +43,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include <errno.h>
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/context.h"
 #include "main/enums.h"
 #include "main/fbobject.h"
index d7ab93f5b87e83b5e2d0ee1e94fe695097222460..5435d0f34bea5915d05c7e43be020102d5949cc5 100644 (file)
@@ -40,7 +40,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "main/api_exec.h"
 #include "main/context.h"
 #include "util/simple_list.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/extensions.h"
 #include "main/version.h"
 #include "main/vtxfmt.h"
index 439b95bf7b1ecb49b494a1563090286d24cde562..e04ae54ad809752205e6879d78e57cf0b6d7c795 100644 (file)
@@ -26,7 +26,7 @@
  **************************************************************************/
 
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/mtypes.h"
 #include "main/enums.h"
index d5c6537036eb03f5df7a1ef19e14d51a411bae8d..c4df8d28ccee484ad9c097e33bd22bd0a9969ec6 100644 (file)
@@ -34,7 +34,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include "c99_math.h"
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/context.h"
 #include "main/mtypes.h"
 #include "main/enums.h"
index 8734fea9a92e38bf31eece9d849476e1c3cb031d..f5092a414bb8514c353cf2c9706db407c9ded2e7 100644 (file)
@@ -42,7 +42,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "swrast/swrast.h"
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "util/simple_list.h"
 
 #include "radeon_context.h"
index b6520c3d172565af1cfd40be54c64ca1c494cf1a..bdfa0a8ca1ca0b0368fe642770e150b768d8443d 100644 (file)
@@ -33,7 +33,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/macros.h"
 
index c9c91f8640c4490908f57504e78b9c750c8c11a1..443068e06d96754288227be08da4b43e3de4785e 100644 (file)
@@ -33,7 +33,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/state.h"
 
index c75c1e03a4aacd5749be940972d8efc6beb65b8c..5225c99145d53a673002cc1fa1c9b217b9f5d421 100644 (file)
@@ -28,7 +28,7 @@
 #include "radeon_queryobj.h"
 #include "radeon_debug.h"
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/queryobj.h"
 
 #include <inttypes.h>
index a2e7724da14925c3af1f7e65345eff55686e504e..e1cda17b005778b92cd812a865bea3b37d0acb52 100644 (file)
@@ -25,7 +25,7 @@
  *
  */
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "util/simple_list.h"
 #include "radeon_common_context.h"
 
index cde35d3abf6047909666a7509375d616efc7274a..2bf004e4f904b47354aad0a33c6d1a393032a25f 100644 (file)
@@ -37,7 +37,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include <errno.h>
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/framebuffer.h"
 #include "main/renderbuffer.h"
index 410a78fc0848647365ec0d9775f228d390a4d51d..b3873e2c0ec48cdd93e18832d2434f29d55ee76e 100644 (file)
@@ -33,7 +33,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/enums.h"
 #include "main/light.h"
 #include "main/context.h"
index accf360e7ce1780c72beccb4cbfe58b979f238d9..18e0fea490ecd6ddc2e60a5b2f6725de3ffb0a10 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "main/errors.h"
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/api_arrayelt.h"
 
 #include "swrast/swrast.h"
index 860bba6d32f99821eeba05aa81e618fb8b47a313..84e216281e350bcfd4cfab700c0bd199be01d112 100644 (file)
@@ -35,7 +35,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "main/glheader.h"
 #include "main/mtypes.h"
 #include "main/enums.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/state.h"
 
index 61ff2311e95109c4856f19cc9d2aa1ca5b264538..0a228d21aaf571d158653648cd48b2f0413295de 100644 (file)
@@ -33,7 +33,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/light.h"
 #include "main/enums.h"
index da5d469e04c994d706f1b6b966f175f0523ba512..3db6cbeb71ec7fde26d2bb8078887981dd260801 100644 (file)
@@ -32,7 +32,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/context.h"
 #include "main/enums.h"
 #include "main/image.h"
index 1cfca191375bb6e2cfb417c0ede72a924e569d95..30cdc56bf1ede9cca9c630b17b267269c010d5b7 100644 (file)
@@ -34,7 +34,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/context.h"
 #include "main/macros.h"
 #include "main/teximage.h"
index 069edc93a42148a18c72dc17f263a7dce03f7a69..a2c43aa7b5b13b08793e31d2741cdefb63f79ab6 100644 (file)
@@ -30,7 +30,7 @@
  */
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/context.h"
 #include "main/enums.h"
 #include "main/mipmap.h"
index 20ba8ff510663b6733129bfb91f120dcf1217e86..827f22cb5ccc1352c336951bbd80dca3f41e043e 100644 (file)
@@ -39,7 +39,7 @@
 #include "main/fbobject.h"
 #include "main/formats.h"
 #include "main/framebuffer.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/renderbuffer.h"
 #include "main/version.h"
 #include "main/vtxfmt.h"
index 30e6c07e6aadaf46a87e90c1786184d4c8590fd1..3635e305b8b13952d1ed73418ec825b4a6411089 100644 (file)
@@ -41,7 +41,7 @@
 #include "main/extensions.h"
 #include "main/formats.h"
 #include "main/framebuffer.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/mipmap.h"
 #include "main/mtypes.h"
index 593c8d1f7eb292cb5d97070f19e39c7acbd77ff0..4201a05df8f6c8703122a5170d968edfcb093e3b 100644 (file)
@@ -47,7 +47,7 @@
 #include "main/context.h"
 #include "main/config.h"
 #include "main/macros.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/version.h"
 #include "xfonts.h"
index 8405013b85c707deb43179c961d359a9255517eb..04f397bd27de3dfc244f67946d1836f63f1d56b0 100644 (file)
@@ -31,7 +31,7 @@
 #include <stdio.h>
 #include "glxheader.h"
 #include "main/context.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "xfonts.h"
 
 
index 88f6630ed6a713a56939f462954ac9e1b74cc523..c71448750f26d224b8e7c090af4341977fdba30f 100644 (file)
@@ -69,7 +69,7 @@
 #include "main/context.h"
 #include "main/extensions.h"
 #include "main/framebuffer.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/renderbuffer.h"
 #include "main/teximage.h"
index 0da08a6e64d483fbcc2f5251acb60ee5f3cf1437..9e16726535c130991b4389e706cbf969fbab72a5 100644 (file)
@@ -32,7 +32,7 @@
 #include "glxheader.h"
 #include "xmesaP.h"
 #include "main/errors.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/formats.h"
 #include "main/framebuffer.h"
 #include "main/renderbuffer.h"
index 3c576c7cd8bad91c247640a9e990b4b05c5e8d80..790cbccf50534dd4660194cf8e26a59d3fcc7be6 100644 (file)
@@ -37,7 +37,7 @@
 #include "main/macros.h"
 #include "main/mipmap.h"
 #include "main/image.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/pbo.h"
 #include "main/texformat.h"
index da26235ff045460042b2d7c22f26e9c9ed58dd32..d5a27a981dc54cf1c14f866f2a388ba15cfde594 100644 (file)
@@ -32,7 +32,7 @@
 
 #include <stdio.h>
 #include "c99_math.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 #include "glxheader.h"
 #include "xmesaP.h"
index 89ae31556d324d6b6c8433f9a635fcc54bce7a31..86d19c57d9200b08765741472b38134bf320dbd6 100644 (file)
@@ -29,7 +29,7 @@
 #include "format_unpack.h"
 #include "format_pack.h"
 #include "framebuffer.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "macros.h"
 #include "state.h"
 #include "mtypes.h"
index 51a7d63b83e93ae26f75c01a18c2eab966f64854..022a1285c26577f65eb0f14d71df44b547e668d3 100644 (file)
@@ -39,7 +39,7 @@
 #include "api_arrayelt.h"
 #include "bufferobj.h"
 #include "context.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "macros.h"
 #include "mtypes.h"
 #include "main/dispatch.h"
index 1c8cc13d0610508b590bc9aea36518f8e5880779..25de173784c87ca9f8352b77634fab3bb66ed9ed 100644 (file)
@@ -32,7 +32,7 @@
 #include "main/glheader.h"
 #include "main/context.h"
 #include "main/hash.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/mtypes.h"
 #include "main/arbprogram.h"
index 6dbd09b39ec431ceb936b3aef7343f6d02e289af..371ca7b04e37aa0ede9fe5daf169d2a054dcddc8 100644 (file)
@@ -43,7 +43,7 @@
 #include "glheader.h"
 #include "hash.h"
 #include "image.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "context.h"
 #include "bufferobj.h"
 #include "arrayobj.h"
index 71c8ce5efdf324d817c0bfaab2dfdd24b0e5abac..75998f97bb821c087161dc4e0e52edc1b4eb5261 100644 (file)
@@ -24,7 +24,7 @@
 #include "main/glheader.h"
 #include "main/context.h"
 #include "main/hash.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/enums.h"
 #include "main/mtypes.h"
index 133f1a8c424fcbc475a861ce9fb498287c5772b8..c39412e9fe0ab3cb1140718fab0808e28619d0d3 100644 (file)
@@ -24,7 +24,7 @@
  */
 
 #include "glheader.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "accum.h"
 #include "arrayobj.h"
 #include "attrib.h"
index b5d6bb188d93aa3cd6f9a1291d5347957fae1c01..881a9d3e00e0488434c15f761f97981ff5bd0894 100644 (file)
@@ -36,7 +36,7 @@
 #include "glheader.h"
 #include "enums.h"
 #include "hash.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "context.h"
 #include "bufferobj.h"
 #include "externalobjects.h"
diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h
deleted file mode 100644 (file)
index 43a06b4..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Mesa 3-D graphics library
- *
- * Copyright (C) 1999-2008  Brian Paul   All Rights Reserved.
- * Copyright (C) 2009  VMware, Inc.  All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \file compiler.h
- * Compiler-related stuff.
- */
-
-
-#ifndef COMPILER_H
-#define COMPILER_H
-
-
-#include <assert.h>
-
-#include "util/macros.h"
-
-#include "c99_compat.h" /* inline, __func__, etc. */
-
-
-/**
- * Either define MESA_BIG_ENDIAN or MESA_LITTLE_ENDIAN, and CPU_TO_LE32.
- * Do not use these unless absolutely necessary!
- * Try to use a runtime test instead.
- * For now, only used by some DRI hardware drivers for color/texel packing.
- */
-#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
-#if defined(__linux__)
-#include <byteswap.h>
-#define CPU_TO_LE32( x )       bswap_32( x )
-#elif defined(__APPLE__)
-#include <CoreFoundation/CFByteOrder.h>
-#define CPU_TO_LE32( x )       CFSwapInt32HostToLittle( x )
-#elif defined(__OpenBSD__)
-#include <sys/types.h>
-#define CPU_TO_LE32( x )       htole32( x )
-#else /*__linux__ */
-#include <sys/endian.h>
-#define CPU_TO_LE32( x )       bswap32( x )
-#endif /*__linux__*/
-#define MESA_BIG_ENDIAN 1
-#else
-#define CPU_TO_LE32( x )       ( x )
-#define MESA_LITTLE_ENDIAN 1
-#endif
-#define LE32_TO_CPU( x )       CPU_TO_LE32( x )
-
-
-
-#define IEEE_ONE 0x3f800000
-
-
-#endif /* COMPILER_H */
index c183378d1d3516692a96099f5cdff87b3eb380cf..f9c8d22820a5fe9e9661b24485fbeb0557dc7cf3 100644 (file)
@@ -77,7 +77,7 @@
 
 
 #include "glheader.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "accum.h"
 #include "api_exec.h"
 #include "api_loopback.h"
index bf39ef2d08ee8c008a2383276881b7fca9e10e61..a816131742e2a4b8011fa5d7525bb69d9e0cc49e 100644 (file)
@@ -50,7 +50,7 @@
 
 
 #include "errors.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "extensions.h"
 #include "mtypes.h"
 #include "vbo/vbo.h"
index 67f22ab9c81759fe509c46bc9127d59600792709..c085d3430d4e85643e1530f11f74cf1c2c92e3bf 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/cpuinfo.h"
 
 
index c27d1b80357d4b2d05101ae26a41e5da8c4cb240..66ee2841b0314c178897ea55449ca7723ab23f32 100644 (file)
@@ -30,7 +30,7 @@
 #include "enums.h"
 #include "formats.h"
 #include "hash.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "macros.h"
 #include "debug.h"
 #include "get.h"
index cd08015b73f02184997847218630df0f07e12e6e..d643866c55a3b23944742d16eac9cc5dde5a2ba5 100644 (file)
@@ -28,7 +28,7 @@
 #include "context.h"
 #include "debug_output.h"
 #include "enums.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "hash.h"
 #include "mtypes.h"
 #include "version.h"
index 27bd4958253466e6151929757f9eeac0aa1d0b2a..f37d175b88851faaf59708d89f0a84f758bfefa6 100644 (file)
@@ -24,7 +24,7 @@
 
 
 #include "glheader.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "context.h"
 #include "depth.h"
 #include "enums.h"
index 0fe027f0afce0443bd4ddf26d8542f9bd741df0a..3abac73ebb9786964f6f4d22f1d75c3dd9d3e2d4 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "c99_math.h"
 #include "glheader.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "api_arrayelt.h"
 #include "api_exec.h"
 #include "api_loopback.h"
index 779cd1c12c74d9146850d937fa34d74e073e9737..523281f7012824bcf767054200cad1cd0640bc70 100644 (file)
@@ -28,7 +28,7 @@
 #include "arrayobj.h"
 #include "bufferobj.h"
 #include "context.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "mtypes.h"
 #include "pipelineobj.h"
 #include "enums.h"
index 2f55dde7b8092fa37525288dcb7c52c5e0c7f1d6..320081911bb33cf1057ba0652ed81ea66277b847 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "glheader.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "draw_validate.h"
 #include "bufferobj.h"
 #include "context.h"
index 6114b3277b03399b5a6abf77d6b272e9c0e0b4ac..304c74879b51a4098a24c930557d5f67bbe5bc61 100644 (file)
@@ -24,7 +24,7 @@
 #include "main/errors.h"
 #include "main/drawtex.h"
 #include "main/state.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 
 
index 071b75c47279f31f277561c81e315c0fcab21e27..7c8cb3886d97811370252c60fad2d23bb5b24015 100644 (file)
@@ -32,7 +32,7 @@
 #include <stdio.h>
 #include "errors.h"
 #include "enums.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "context.h"
 #include "debug_output.h"
 
index 1dfe8278e715dc4fc806db6a86b729f076f627af..020d891ae336f24671237a6464b1068d06d9e562 100644 (file)
@@ -9,7 +9,7 @@
 #include "context.h"
 #include "depth.h"
 #include "fog.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "light.h"
 #include "lines.h"
 #include "matrix.h"
index 86c8f75a1d25df5542d79fcf6378b80998e7cf46..e970265e2c3d25cca8b5c7afe65e2c2864a78a48 100644 (file)
@@ -38,7 +38,7 @@
 
 
 #include "glheader.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "context.h"
 #include "eval.h"
 #include "macros.h"
index 35d4574ba2bdc8c4e48e0d9a1fe4daa5253a8d83..3b08f42a3dd6056d3a7bd5c6aeb0efa44236c501 100644 (file)
@@ -32,7 +32,8 @@
 
 
 #include <stdio.h>
-#include "imports.h"
+#include "util/imports.h"
+#include "main/glheader.h"
 #include "execmem.h"
 #include "c11/threads.h"
 
index 0aeda39cc22152073f52e41582fb83174c4b4a42..6c1551687b2c6161571a012a5b2071dc204d3a13 100644 (file)
@@ -31,7 +31,7 @@
 
 
 #include "glheader.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "context.h"
 #include "extensions.h"
 #include "macros.h"
index 8f2b4e9de4818e35225bf2ac19229daf083297d2..9ae86f4ee139bd4c801ef7508f00f6340b2829e6 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "main/glheader.h"
 #include "main/context.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/samplerobj.h"
 #include "main/shaderobj.h"
index 3a528ceb3db613c820dc85923d45c6115daad08d..c298d0477ad36cf21f4310215f00b30bbba6f38e 100644 (file)
@@ -32,7 +32,7 @@
 #define FORMAT_UTILS_H
 
 #include "formats.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "macros.h"
 #include "util/rounding.h"
 #include "util/half_float.h"
index 370859d37ca1595357495dd0340dc30f4cf9fa3a..53f01ffc18a0ced67776a5ce505b878ba8ef37f9 100644 (file)
@@ -25,7 +25,7 @@
 
 
 #include "errors.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "formats.h"
 #include "macros.h"
 #include "glformats.h"
index 1c72f446b0d8b313647ba81a585fc97fb55d9536..1cfc472c8fa96680364f9067133fb76ba800ad02 100644 (file)
@@ -31,7 +31,7 @@
 
 #include <stdio.h>
 #include "glheader.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "blend.h"
 #include "buffers.h"
 #include "context.h"
index 64f2962aba6b054447356b1238e3b813aacfd556..040c6cb5824a541d37b17cfea69ddbe499891dd0 100644 (file)
@@ -33,7 +33,7 @@
 
 
 #include "glheader.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "c11/threads.h"
 
 /**
index 2bcaeebc4aa90d99201d6d2e83f083de39355aac..5a09a7362a9f2ecd3dcb9c12c69b9a8440381f1d 100644 (file)
@@ -28,7 +28,7 @@
 #include "enums.h"
 #include "context.h"
 #include "hint.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "mtypes.h"
 
 
index ad6b378f7f62d8f7bbd137b5d66e377861224627..0ec1d09853ef5ba26558ac88c45fc5350494bd29 100644 (file)
@@ -34,7 +34,7 @@
 #include "colormac.h"
 #include "glformats.h"
 #include "image.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "macros.h"
 #include "mtypes.h"
 
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
deleted file mode 100644 (file)
index 96f8ad4..0000000
+++ /dev/null
@@ -1,234 +0,0 @@
-/**
- * \file imports.c
- * Standard C library function wrappers.
- * 
- * Imports are services which the device driver or window system or
- * operating system provides to the core renderer.  The core renderer (Mesa)
- * will call these functions in order to do memory allocation, simple I/O,
- * etc.
- *
- * Some drivers will want to override/replace this file with something
- * specialized, but that'll be rare.
- *
- * Eventually, I want to move roll the glheader.h file into this.
- *
- * \todo Functions still needed:
- * - scanf
- * - qsort
- * - rand and RAND_MAX
- */
-
-/*
- * Mesa 3-D graphics library
- *
- * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <stdio.h>
-#include <stdarg.h>
-#include "c99_math.h"
-#include "imports.h"
-#include "context.h"
-#include "version.h"
-
-#ifdef _GNU_SOURCE
-#include <locale.h>
-#ifdef __APPLE__
-#include <xlocale.h>
-#endif
-#endif
-
-
-#ifdef _WIN32
-#define vsnprintf _vsnprintf
-#elif defined(__IBMC__) || defined(__IBMCPP__)
-extern int vsnprintf(char *str, size_t count, const char *fmt, va_list arg);
-#endif
-
-/**********************************************************************/
-/** \name Memory */
-/*@{*/
-
-/**
- * Allocate aligned memory.
- *
- * \param bytes number of bytes to allocate.
- * \param alignment alignment (must be greater than zero).
- * 
- * Allocates extra memory to accommodate rounding up the address for
- * alignment and to record the real malloc address.
- *
- * \sa _mesa_align_free().
- */
-void *
-_mesa_align_malloc(size_t bytes, unsigned long alignment)
-{
-#if defined(HAVE_POSIX_MEMALIGN)
-   void *mem;
-   int err = posix_memalign(& mem, alignment, bytes);
-   if (err)
-      return NULL;
-   return mem;
-#elif defined(_WIN32)
-   return _aligned_malloc(bytes, alignment);
-#else
-   uintptr_t ptr, buf;
-
-   assert( alignment > 0 );
-
-   ptr = (uintptr_t)malloc(bytes + alignment + sizeof(void *));
-   if (!ptr)
-      return NULL;
-
-   buf = (ptr + alignment + sizeof(void *)) & ~(uintptr_t)(alignment - 1);
-   *(uintptr_t *)(buf - sizeof(void *)) = ptr;
-
-#ifndef NDEBUG
-   /* mark the non-aligned area */
-   while ( ptr < buf - sizeof(void *) ) {
-      *(unsigned long *)ptr = 0xcdcdcdcd;
-      ptr += sizeof(unsigned long);
-   }
-#endif
-
-   return (void *) buf;
-#endif /* defined(HAVE_POSIX_MEMALIGN) */
-}
-
-/**
- * Same as _mesa_align_malloc(), but using calloc(1, ) instead of
- * malloc()
- */
-void *
-_mesa_align_calloc(size_t bytes, unsigned long alignment)
-{
-#if defined(HAVE_POSIX_MEMALIGN)
-   void *mem;
-   
-   mem = _mesa_align_malloc(bytes, alignment);
-   if (mem != NULL) {
-      (void) memset(mem, 0, bytes);
-   }
-
-   return mem;
-#elif defined(_WIN32)
-   void *mem;
-
-   mem = _aligned_malloc(bytes, alignment);
-   if (mem != NULL) {
-      (void) memset(mem, 0, bytes);
-   }
-
-   return mem;
-#else
-   uintptr_t ptr, buf;
-
-   assert( alignment > 0 );
-
-   ptr = (uintptr_t)calloc(1, bytes + alignment + sizeof(void *));
-   if (!ptr)
-      return NULL;
-
-   buf = (ptr + alignment + sizeof(void *)) & ~(uintptr_t)(alignment - 1);
-   *(uintptr_t *)(buf - sizeof(void *)) = ptr;
-
-#ifndef NDEBUG
-   /* mark the non-aligned area */
-   while ( ptr < buf - sizeof(void *) ) {
-      *(unsigned long *)ptr = 0xcdcdcdcd;
-      ptr += sizeof(unsigned long);
-   }
-#endif
-
-   return (void *)buf;
-#endif /* defined(HAVE_POSIX_MEMALIGN) */
-}
-
-/**
- * Free memory which was allocated with either _mesa_align_malloc()
- * or _mesa_align_calloc().
- * \param ptr pointer to the memory to be freed.
- * The actual address to free is stored in the word immediately before the
- * address the client sees.
- * Note that it is legal to pass NULL pointer to this function and will be
- * handled accordingly.
- */
-void
-_mesa_align_free(void *ptr)
-{
-#if defined(HAVE_POSIX_MEMALIGN)
-   free(ptr);
-#elif defined(_WIN32)
-   _aligned_free(ptr);
-#else
-   if (ptr) {
-      void **cubbyHole = (void **) ((char *) ptr - sizeof(void *));
-      void *realAddr = *cubbyHole;
-      free(realAddr);
-   }
-#endif /* defined(HAVE_POSIX_MEMALIGN) */
-}
-
-/**
- * Reallocate memory, with alignment.
- */
-void *
-_mesa_align_realloc(void *oldBuffer, size_t oldSize, size_t newSize,
-                    unsigned long alignment)
-{
-#if defined(_WIN32)
-   (void) oldSize;
-   return _aligned_realloc(oldBuffer, newSize, alignment);
-#else
-   const size_t copySize = (oldSize < newSize) ? oldSize : newSize;
-   void *newBuf = _mesa_align_malloc(newSize, alignment);
-   if (newBuf && oldBuffer && copySize > 0) {
-      memcpy(newBuf, oldBuffer, copySize);
-   }
-
-   _mesa_align_free(oldBuffer);
-   return newBuf;
-#endif
-}
-
-/*@}*/
-
-
-/** Needed due to #ifdef's, above. */
-int
-_mesa_vsnprintf(char *str, size_t size, const char *fmt, va_list args)
-{
-   return vsnprintf( str, size, fmt, args);
-}
-
-/** Wrapper around vsnprintf() */
-int
-_mesa_snprintf( char *str, size_t size, const char *fmt, ... )
-{
-   int r;
-   va_list args;
-   va_start( args, fmt );  
-   r = vsnprintf( str, size, fmt, args );
-   va_end( args );
-   return r;
-}
-
-
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
deleted file mode 100644 (file)
index 7cf5f24..0000000
+++ /dev/null
@@ -1,321 +0,0 @@
-/*
- * Mesa 3-D graphics library
- *
- * Copyright (C) 1999-2008  Brian Paul   All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \file imports.h
- * Standard C library function wrappers.
- *
- * This file provides wrappers for all the standard C library functions
- * like malloc(), free(), printf(), getenv(), etc.
- */
-
-
-#ifndef IMPORTS_H
-#define IMPORTS_H
-
-
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include "compiler.h"
-#include "glheader.h"
-#include "util/bitscan.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/**********************************************************************/
-/** Memory macros */
-/*@{*/
-
-/** Allocate a structure of type \p T */
-#define MALLOC_STRUCT(T)   (struct T *) malloc(sizeof(struct T))
-/** Allocate and zero a structure of type \p T */
-#define CALLOC_STRUCT(T)   (struct T *) calloc(1, sizeof(struct T))
-
-/*@}*/
-
-
-/*
- * For GL_ARB_vertex_buffer_object we need to treat vertex array pointers
- * as offsets into buffer stores.  Since the vertex array pointer and
- * buffer store pointer are both pointers and we need to add them, we use
- * this macro.
- * Both pointers/offsets are expressed in bytes.
- */
-#define ADD_POINTERS(A, B)  ( (GLubyte *) (A) + (uintptr_t) (B) )
-
-
-/**
- * Sometimes we treat GLfloats as GLints.  On x86 systems, moving a float
- * as an int (thereby using integer registers instead of FP registers) is
- * a performance win.  Typically, this can be done with ordinary casts.
- * But with gcc's -fstrict-aliasing flag (which defaults to on in gcc 3.0)
- * these casts generate warnings.
- * The following union typedef is used to solve that.
- */
-typedef union { GLfloat f; GLint i; GLuint u; } fi_type;
-
-
-
-/*@}*/
-
-
-/***
- *** LOG2: Log base 2 of float
- ***/
-static inline GLfloat LOG2(GLfloat x)
-{
-#if 0
-   /* This is pretty fast, but not accurate enough (only 2 fractional bits).
-    * Based on code from http://www.stereopsis.com/log2.html
-    */
-   const GLfloat y = x * x * x * x;
-   const GLuint ix = *((GLuint *) &y);
-   const GLuint exp = (ix >> 23) & 0xFF;
-   const GLint log2 = ((GLint) exp) - 127;
-   return (GLfloat) log2 * (1.0 / 4.0);  /* 4, because of x^4 above */
-#endif
-   /* Pretty fast, and accurate.
-    * Based on code from http://www.flipcode.com/totd/
-    */
-   fi_type num;
-   GLint log_2;
-   num.f = x;
-   log_2 = ((num.i >> 23) & 255) - 128;
-   num.i &= ~(255 << 23);
-   num.i += 127 << 23;
-   num.f = ((-1.0f/3) * num.f + 2) * num.f - 2.0f/3;
-   return num.f + log_2;
-}
-
-
-
-/**
- * finite macro.
- */
-#if defined(_MSC_VER)
-#  define finite _finite
-#endif
-
-
-/***
- *** IS_INF_OR_NAN: test if float is infinite or NaN
- ***/
-#if defined(isfinite)
-#define IS_INF_OR_NAN(x)        (!isfinite(x))
-#elif defined(finite)
-#define IS_INF_OR_NAN(x)        (!finite(x))
-#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-#define IS_INF_OR_NAN(x)        (!isfinite(x))
-#else
-#define IS_INF_OR_NAN(x)        (!finite(x))
-#endif
-
-
-/**
- * Convert float to int by rounding to nearest integer, away from zero.
- */
-static inline int IROUND(float f)
-{
-   return (int) ((f >= 0.0F) ? (f + 0.5F) : (f - 0.5F));
-}
-
-/**
- * Convert double to int by rounding to nearest integer, away from zero.
- */
-static inline int IROUNDD(double d)
-{
-   return (int) ((d >= 0.0) ? (d + 0.5) : (d - 0.5));
-}
-
-/**
- * Convert float to int64 by rounding to nearest integer.
- */
-static inline GLint64 IROUND64(float f)
-{
-   return (GLint64) ((f >= 0.0F) ? (f + 0.5F) : (f - 0.5F));
-}
-
-
-/**
- * Convert positive float to int by rounding to nearest integer.
- */
-static inline int IROUND_POS(float f)
-{
-   assert(f >= 0.0F);
-   return (int) (f + 0.5F);
-}
-
-/** Return (as an integer) floor of float */
-static inline int IFLOOR(float f)
-{
-#if defined(USE_X86_ASM) && defined(__GNUC__) && defined(__i386__)
-   /*
-    * IEEE floor for computers that round to nearest or even.
-    * 'f' must be between -4194304 and 4194303.
-    * This floor operation is done by "(iround(f + .5) + iround(f - .5)) >> 1",
-    * but uses some IEEE specific tricks for better speed.
-    * Contributed by Josh Vanderhoof
-    */
-   int ai, bi;
-   double af, bf;
-   af = (3 << 22) + 0.5 + (double)f;
-   bf = (3 << 22) + 0.5 - (double)f;
-   /* GCC generates an extra fstp/fld without this. */
-   __asm__ ("fstps %0" : "=m" (ai) : "t" (af) : "st");
-   __asm__ ("fstps %0" : "=m" (bi) : "t" (bf) : "st");
-   return (ai - bi) >> 1;
-#else
-   int ai, bi;
-   double af, bf;
-   fi_type u;
-   af = (3 << 22) + 0.5 + (double)f;
-   bf = (3 << 22) + 0.5 - (double)f;
-   u.f = (float) af;  ai = u.i;
-   u.f = (float) bf;  bi = u.i;
-   return (ai - bi) >> 1;
-#endif
-}
-
-
-/**
- * Is x a power of two?
- */
-static inline int
-_mesa_is_pow_two(int x)
-{
-   return !(x & (x - 1));
-}
-
-/**
- * Round given integer to next higer power of two
- * If X is zero result is undefined.
- *
- * Source for the fallback implementation is
- * Sean Eron Anderson's webpage "Bit Twiddling Hacks"
- * http://graphics.stanford.edu/~seander/bithacks.html
- *
- * When using builtin function have to do some work
- * for case when passed values 1 to prevent hiting
- * undefined result from __builtin_clz. Undefined
- * results would be different depending on optimization
- * level used for build.
- */
-static inline int32_t
-_mesa_next_pow_two_32(uint32_t x)
-{
-#ifdef HAVE___BUILTIN_CLZ
-       uint32_t y = (x != 1);
-       return (1 + y) << ((__builtin_clz(x - y) ^ 31) );
-#else
-       x--;
-       x |= x >> 1;
-       x |= x >> 2;
-       x |= x >> 4;
-       x |= x >> 8;
-       x |= x >> 16;
-       x++;
-       return x;
-#endif
-}
-
-static inline int64_t
-_mesa_next_pow_two_64(uint64_t x)
-{
-#ifdef HAVE___BUILTIN_CLZLL
-       uint64_t y = (x != 1);
-       STATIC_ASSERT(sizeof(x) == sizeof(long long));
-       return (1 + y) << ((__builtin_clzll(x - y) ^ 63));
-#else
-       x--;
-       x |= x >> 1;
-       x |= x >> 2;
-       x |= x >> 4;
-       x |= x >> 8;
-       x |= x >> 16;
-       x |= x >> 32;
-       x++;
-       return x;
-#endif
-}
-
-
-/*
- * Returns the floor form of binary logarithm for a 32-bit integer.
- */
-static inline GLuint
-_mesa_logbase2(GLuint n)
-{
-#ifdef HAVE___BUILTIN_CLZ
-   return (31 - __builtin_clz(n | 1));
-#else
-   GLuint pos = 0;
-   if (n >= 1<<16) { n >>= 16; pos += 16; }
-   if (n >= 1<< 8) { n >>=  8; pos +=  8; }
-   if (n >= 1<< 4) { n >>=  4; pos +=  4; }
-   if (n >= 1<< 2) { n >>=  2; pos +=  2; }
-   if (n >= 1<< 1) {           pos +=  1; }
-   return pos;
-#endif
-}
-
-
-/**********************************************************************
- * Functions
- */
-
-extern void *
-_mesa_align_malloc( size_t bytes, unsigned long alignment );
-
-extern void *
-_mesa_align_calloc( size_t bytes, unsigned long alignment );
-
-extern void
-_mesa_align_free( void *ptr );
-
-extern void *
-_mesa_align_realloc(void *oldBuffer, size_t oldSize, size_t newSize,
-                    unsigned long alignment);
-
-extern int
-_mesa_snprintf( char *str, size_t size, const char *fmt, ... ) PRINTFLIKE(3, 4);
-
-extern int
-_mesa_vsnprintf(char *str, size_t size, const char *fmt, va_list arg);
-
-
-#if defined(_WIN32) && !defined(HAVE_STRTOK_R)
-#define strtok_r strtok_s
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* IMPORTS_H */
index 67faf8a14528227255e8c607e2e6ed3fd1240a1b..bae17c76f60da0a57a0f52098ba5c019e1cf6b8f 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "c99_math.h"
 #include "glheader.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "context.h"
 #include "enums.h"
 #include "light.h"
index efdb0a0957060015450035a52aad43a357065129..a54ade1fc9bd217c5af2c39ae12924252c53fb74 100644 (file)
@@ -34,7 +34,8 @@
 #include "util/macros.h"
 #include "util/u_math.h"
 #include "util/rounding.h"
-#include "imports.h"
+#include "util/imports.h"
+#include "main/glheader.h"
 
 
 /**
index 7d75a900e1b0a5ca5f6ab4920349f07da62ab951..58a48ed9933f3710e5606e7965dca71d216984fa 100644 (file)
@@ -36,7 +36,7 @@
 
 
 #include "glheader.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "context.h"
 #include "enums.h"
 #include "macros.h"
index 88e6baa08ad15240359521f2ba00c825dbd8d378..dc606877d013d91d8df6256646253791b335b4a2 100644 (file)
@@ -28,7 +28,7 @@
  */
 
 #include "errors.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "formats.h"
 #include "glformats.h"
 #include "mipmap.h"
index d730f46b8ec1c4d5bc6b2cf8ab715182f0e131e2..28d046b565c27e25bc909edd93c11b421d3eaed2 100644 (file)
@@ -31,7 +31,7 @@
 #include "glheader.h"
 #include "enums.h"
 #include "hash.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "context.h"
 #include "bufferobj.h"
 #include "fbobject.h"
index 64ad115f8b5a25d6c9427e4279d81695aae2dff0..818fcf8538475099b0199bbe82702adb934eb403 100644 (file)
 #include "glheader.h"
 #include "enums.h"
 #include "image.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "macros.h"
 #include "mtypes.h"
 #include "pack.h"
 #include "pixeltransfer.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "glformats.h"
 #include "format_utils.h"
 #include "format_pack.h"
index cea55f2a0d29eb7fe55969bdf644b1323980a838..6af815759f1c9e516ce70d271b4f5fc8700aa37f 100644 (file)
@@ -36,7 +36,7 @@
 #include "bufferobj.h"
 #include "glformats.h"
 #include "image.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "mtypes.h"
 #include "pbo.h"
 
index 22eac00a7dfafd672dfe086ec695c410815d2a4d..1b8abd87a618944718ac0d4b5ccda5be651f5bcc 100644 (file)
@@ -33,7 +33,7 @@
 #include "glheader.h"
 #include "macros.h"
 #include "pixeltransfer.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "mtypes.h"
 #include "util/rounding.h"
 
index ae8f2a8564574597a407135dde84409850a57722..f44542385b970d98eb459ac8ee51f71f8460c1af 100644 (file)
@@ -29,7 +29,7 @@
 
 
 #include "glheader.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "context.h"
 #include "image.h"
 #include "enums.h"
index 981ccf8f9c0433dda6be5e451c1b8eaabadf6e86..032f9e9a43719204f2071e2bd18d35da7da5b65b 100644 (file)
@@ -28,7 +28,7 @@
 #include "context.h"
 #include "enums.h"
 #include "hash.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "queryobj.h"
 #include "mtypes.h"
 
index 6b3685dd82b11d7abbba9470bd9311a4abbcafbf..45e5754d9a43ef6fa82c93915321d58061f2cb3c 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "glheader.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "blend.h"
 #include "bufferobj.h"
 #include "context.h"
index fa412c0c4f7c1c3988c18378e22299990b198f8b..c8b01fb1a58e354a7a104f3353c771973b3f0a02 100644 (file)
@@ -37,7 +37,7 @@
 
 #include <stdbool.h>
 #include "remap.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "glapi/glapi.h"
 
 #define MAX_ENTRY_POINTS 16
index 0e017125ac08142e3391a7efa3bbc4bfa83e486e..34959776a6f68aac794276bc50b00a4ed50f773d 100644 (file)
@@ -24,7 +24,7 @@
 
 
 #include "glheader.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "context.h"
 #include "fbobject.h"
 #include "formats.h"
index 07fdc76ee5650c169f9ad43e78eaf5cb8bb6367b..3da48f3e747dc14424a56af43f1d736e8cc36914 100644 (file)
@@ -27,7 +27,7 @@
  * Shared-context state
  */
 
-#include "imports.h"
+#include "util/imports.h"
 #include "mtypes.h"
 #include "hash.h"
 #include "atifragshader.h"
index d89312ce12ddd9ae0335d58446483a12fdfa8bee..6ef6833bb710e4034ca77ad4158ad00534088a47 100644 (file)
@@ -48,7 +48,7 @@
 
 
 #include "glheader.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "context.h"
 #include "macros.h"
 #include "stencil.h"
index 736f043f90c4fd4925de09750f5f43b0d7e03ed2..41b7b22b0aeb2881346fcfb46652f36df972291e 100644 (file)
@@ -57,7 +57,7 @@
 
 #include <inttypes.h>
 #include "glheader.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "context.h"
 #include "macros.h"
 #include "get.h"
index e0324bd54d28750eaa8c42a584064bc71cc5f58a..f03317a2d5fa9110a9009877d7c1b4bfb6349080 100644 (file)
@@ -43,7 +43,7 @@
 
 #include "GL/gl.h"
 #include "GL/glext.h"
-#include "main/compiler.h"
+#include "util/compiler.h"
 #include "main/api_exec.h"
 #include "main/context.h"
 #include "main/remap.h"
index 48d794ddfd2c4e11787bf4637666631608f4ae5b..6b97695c8ef76a1cb9b2a87e93d22cd855795350 100644 (file)
@@ -31,7 +31,7 @@
 
 
 #include "glheader.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "context.h"
 #include "formats.h"
 #include "mtypes.h"
index c46ef8c53fb2677c617f41645e9a171fe9743ae6..db99649e2bfd020e9282c358add122f9112575c5 100644 (file)
@@ -34,7 +34,7 @@
 #include "glheader.h"
 #include "context.h"
 #include "mtypes.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "pixelstore.h"
 #include "texcompress_cpal.h"
 #include "teximage.h"
index bd284b36113c4182a13cab8649cb899fe66fbb70..5b93eee343928d68deb2bf3f43c446bd96bc2e41 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "errors.h"
 #include "glheader.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "image.h"
 #include "macros.h"
 #include "mipmap.h"
index ef5c2bbfd8d02247cf66a4c2529fee40a5d276de..e6f6075ecff6f383ab3b283c8b3b71b6d28d0ec4 100644 (file)
@@ -35,7 +35,7 @@
 
 #include "config.h"
 #include "glheader.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "image.h"
 #include "macros.h"
 #include "mipmap.h"
index 78f03bf29203e36f1015babfbf834e2b26542cc8..faec72f365d5a645ff54c88f0eb751022ac142eb 100644 (file)
@@ -30,7 +30,7 @@
  */
 
 #include "glheader.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "image.h"
 #include "macros.h"
 #include "mtypes.h"
index 65952bca5fafa0f019390fd75ce47d82d9a51aac..86de72d75933c8d99e98c260bb34f3e72b35df06 100644 (file)
@@ -38,7 +38,7 @@
 #include "framebuffer.h"
 #include "hash.h"
 #include "image.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "macros.h"
 #include "mipmap.h"
 #include "multisample.h"
index c5459f4540f6475dc0d114908f497fde26067152..4dc1bb1eed03c69f524ed68b33dd0f5f3e8af359 100644 (file)
@@ -35,7 +35,7 @@
 #include "fbobject.h"
 #include "formats.h"
 #include "hash.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "macros.h"
 #include "shaderimage.h"
 #include "teximage.h"
index d2e0e52ecabe3c8ef809290d4fef354c36196fee..5f2d78e07d42794081c521621a5c4a9221f11c55 100644 (file)
@@ -30,7 +30,7 @@
 #include "glheader.h"
 #include "context.h"
 #include "enums.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "macros.h"
 #include "teximage.h"
 #include "texobj.h"
index 9bbac5f1512fb75efdf2165422328a0ffdf10acf..5c5331a6402e491e2c81dcbc8434f39554bdf179 100755 (executable)
@@ -62,7 +62,7 @@
 #include "mtypes.h"
 #include "pack.h"
 #include "pbo.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "texcompress.h"
 #include "texcompress_fxt1.h"
 #include "texcompress_rgtc.h"
index 9aaa0367c2daf1007a0671e058193583ee763ff3..eddf0ee46848ad24a92eadddaec88642a9b5fd68 100644 (file)
@@ -24,7 +24,7 @@
 #include "glheader.h"
 #include "context.h"
 #include "enums.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "hash.h"
 #include "mtypes.h"
 #include "shaderimage.h"
index 62c86eb5f0359a09a0d373217bea8324e81f8389..da09c1e3c58d4d14632ef6904c30a0c5be4f4f6c 100644 (file)
@@ -34,7 +34,7 @@
 #include "glheader.h"
 #include "context.h"
 #include "enums.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "macros.h"
 #include "teximage.h"
 #include "texobj.h"
index 063e295a2ecf63dc4086824165d692acdb582544..729b790ed6f95826309a8b12e7d10009ed8222ff 100644 (file)
@@ -28,7 +28,7 @@
 
 #include <stdbool.h>
 #include "bufferobj.h"
-#include "compiler.h"
+#include "util/compiler.h"
 #include "glheader.h"
 #include "mtypes.h"
 
index 2f6aefc9ccb86106918e6eadb7959f5fd2239d00..3c9c6f3d31ad11db02c71cb0872258d2ebcdad39 100644 (file)
@@ -28,7 +28,7 @@
 #include <inttypes.h>  /* for PRId64 macro */
 
 #include "glheader.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "bufferobj.h"
 #include "context.h"
 #include "enable.h"
index 58deb4b3cf8ca5381dbddc9b112b321917e52230..cacf22e7950fd2c6a1ee78fbdd059dce08395ad1 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <stdio.h>
 #include "context.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "mtypes.h"
 #include "version.h"
 #include "git_sha1.h"
index f5ef0ac56c3462ac6243efe70937ff865dabdada..666124e1ca6134847741ff5d2210fd7172c0f956 100644 (file)
@@ -28,7 +28,7 @@
 #include "glheader.h"
 #include "api_arrayelt.h"
 #include "context.h"
-#include "imports.h"
+#include "util/imports.h"
 #include "mtypes.h"
 #include "vtxfmt.h"
 #include "eval.h"
index 044768dbdd2d071feb112eea0140d7f24270cb4d..adb731ca8c0f83815e5ba862dffe65e40dc46eb7 100644 (file)
@@ -28,7 +28,7 @@
 #include "main/glheader.h"
 #include "main/context.h"
 #include "main/macros.h"
-#include "main/imports.h"
+#include "util/imports.h"
 
 #include "m_matrix.h"
 #include "m_xform.h"
index 8be07eecbe3eb92d1a5c242c41827a8463627c40..7ad5b6f6b295336599f45a9d0dc67bdf213366a6 100644 (file)
@@ -30,7 +30,7 @@
 #include "main/glheader.h"
 #include "main/context.h"
 #include "main/macros.h"
-#include "main/imports.h"
+#include "util/imports.h"
 
 #include "m_matrix.h"
 #include "m_xform.h"
index 632c82ea2585f1135fc52c10c774fbed6bb62b61..f6e0bb24f54238faf49c0024969289ef4d1c8adc 100644 (file)
@@ -29,7 +29,7 @@
 #include "main/glheader.h"
 #include "main/context.h"
 #include "main/macros.h"
-#include "main/imports.h"
+#include "util/imports.h"
 
 #include "m_matrix.h"
 #include "m_xform.h"
index d3f89ee7cb7bae4b394e6ad53bc736b50e96a936..cc3af6870f8ed6ae415ed864bc481bfc7d662ba2 100644 (file)
@@ -38,7 +38,7 @@
 #include "c99_math.h"
 #include "main/errors.h"
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #define MATH_ASM_PTR_SIZE sizeof(void *)
 #include "math/m_vector_asm.h"
index f25b7b20642df81f8c105c6e6b7650eeccbd0fcf..af4eceaf0144f4e5292f94d9968ee6f8c3625713 100644 (file)
@@ -30,7 +30,7 @@
 #include <stddef.h>
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 
 #include "m_vector.h"
index 0bb8e9bd8612320a19b73e1420f51f3ca9d1aed0..d3a5c81d648df4a679426a387d867651877109d9 100644 (file)
@@ -27,7 +27,7 @@
 #define _M_XFORM_H
 
 
-#include "main/compiler.h"
+#include "util/compiler.h"
 #include "main/glheader.h"
 #include "math/m_matrix.h"
 #include "math/m_vector.h"
index 11c176686cc3696cdb0bf4e87ce1daf952c178cb..5c2ca120333761f84d586b52671e1cbf5b1a805b 100644 (file)
@@ -92,7 +92,6 @@ files_libmesa_common = files(
   'main/colortab.h',
   'main/compute.c',
   'main/compute.h',
-  'main/compiler.h',
   'main/condrender.c',
   'main/condrender.h',
   'main/config.h',
@@ -180,8 +179,6 @@ files_libmesa_common = files(
   'main/histogram.h',
   'main/image.c',
   'main/image.h',
-  'main/imports.c',
-  'main/imports.h',
   'main/light.c',
   'main/light.h',
   'main/lines.c',
index 99aa6914624e6d0f8f83cecac49b7b6693d827a1..7216f9fdcce123fe3015ecd6f1b026bce136a22b 100644 (file)
@@ -52,7 +52,7 @@ having three separate program parameter arrays.
 
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/context.h"
 #include "main/mtypes.h"
 #include "arbprogparse.h"
index ed93af7f13ad10d202947709718e14400e23e633..33f74cd7ab2d6424e2dba345ce6371567eed73d9 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "main/glheader.h"
 #include "main/mtypes.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/shaderobj.h"
 #include "program/prog_cache.h"
 #include "program/program.h"
index 91830d87f25d9b928560fb1d14beb1ba5c2d451c..a999fd516a1fb26dc305b93dd42fa4f9c28decd8 100644 (file)
@@ -25,7 +25,7 @@
 
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "prog_instruction.h"
 #include "prog_parameter.h"
 
index e2e209e5bd3b58202ff9805ab43a03acb5b40845..75a22d8b9914527b102e745c0ae0494fb7d6b685 100644 (file)
@@ -49,7 +49,7 @@
  */
 
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "prog_noise.h"
 
 #define FASTFLOOR(x) ( ((x)>0) ? ((int)x) : (((int)x)-1) )
index 2f3520bf750055bbefc98df429ed0ca20a1ddab3..80733e2b2f3019be94e99374b61daee91df6ac88 100644 (file)
@@ -30,7 +30,7 @@
 
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "prog_instruction.h"
 #include "prog_parameter.h"
index d28a6675c06cb6e9c127852207a32fc200baff92..a254dc072af1e03fddc3fe517b443968083af005 100644 (file)
@@ -28,7 +28,7 @@
  * \author Ian Romanick <ian.d.romanick@intel.com>
  */
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 #include "prog_parameter.h"
 #include "prog_parameter_layout.h"
index e8d087c506b3b23d3548acaad0768c3654afc878..049bef2c634125865988137a85cf653a16b0a370 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "main/glheader.h"
 #include "main/context.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "prog_instruction.h"
 #include "prog_parameter.h"
 #include "prog_print.h"
index 54afc1bf678f6f858c63926154a1ce36a45470fb..06da12074cb21222f0fc4c66760bc41861f0b8c8 100644 (file)
@@ -33,7 +33,7 @@
 #include "main/glheader.h"
 #include "main/context.h"
 #include "main/blend.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/mtypes.h"
 #include "main/fbobject.h"
index 95bcde2937eb77e237c9db64e8d7a2758c70d16d..c0c9ba66544ba3902f4dad91cd9394beb03a32a6 100644 (file)
@@ -26,7 +26,7 @@
 #include "compiler/nir/nir.h"
 #include "compiler/nir/nir_builder.h"
 #include "compiler/glsl/list.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 #include "util/ralloc.h"
 
index c4973fd279146515086c6e347150b77cf2014ec3..2c2a66812c754cbb38ffe7740a6668ee2b20bfb8 100644 (file)
@@ -27,7 +27,7 @@
 #endif
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "program/prog_instruction.h"
 #include "program/prog_statevars.h"
 #include "program/symbol_table.h"
index f468e3b9b596c83a25a8f6af0b108fc1a1ee4f8a..4e8e2eaf11e766a60f6537395913872637dc2b76 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "main/errors.h"
 #include "main/mtypes.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "program/program.h"
 #include "program/prog_parameter.h"
 #include "program/prog_parameter_layout.h"
index ae7a1175e4048744146a8aad63d61010022e6f6c..dcb32895828bf874e66e03945e681cc2a4c2e6b6 100644 (file)
@@ -21,7 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/errors.h"
 #include "symbol_table.h"
 #include "../../util/hash_table.h"
index 1855c771d0c3385c4732ae197ca8df0752153c3a..1dd868b5095681a2f5a3eab2115d40e307e9663f 100644 (file)
@@ -24,7 +24,7 @@
  *
  **************************************************************************/
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "program/prog_parameter.h"
 #include "program/prog_print.h"
 #include "compiler/glsl/ir_uniform.h"
index ffe4b414477eeed5151c93309ba64008e48cdca5..530e2f2ce2ef665db143998fcc0f0b49fa0d3081 100644 (file)
@@ -31,7 +31,7 @@
  *   Brian Paul
  */
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "program/prog_parameter.h"
 #include "program/prog_print.h"
 #include "main/shaderapi.h"
index db3539259cecd47a5b9a44ac819aa68072c75054..598109d24f469f2f81b448524c9c767d7520feea 100644 (file)
@@ -24,7 +24,7 @@
  *
  **************************************************************************/
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/shaderimage.h"
 #include "program/prog_parameter.h"
 #include "program/prog_print.h"
index e47124b122f403710892d8379200378e6b2eaeb2..fde2eb55f62feabcd89b3b2f7cbf47773ca14930 100644 (file)
@@ -35,7 +35,7 @@
  *   Brian Paul
  */
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/framebuffer.h"
 #include "main/state.h"
index 0355c988529000739a3c95b68fabcba98e8e8202..b12c9164464d1446c00bd19cd4fe8b9bd47e915f 100644 (file)
@@ -24,7 +24,7 @@
  *
  **************************************************************************/
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "program/prog_parameter.h"
 #include "program/prog_print.h"
 #include "compiler/glsl/ir_uniform.h"
index 788e004d65143b64d1666c425a14fc6632e95543..44ad533417511a66e7fde6cba6716e9bbd09815d 100644 (file)
@@ -31,7 +31,7 @@
   */
 
 #include "main/errors.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/image.h"
 #include "main/bufferobj.h"
 #include "main/dlist.h"
index 91bf029faf2805861581284a4003737b1ac05939..73068b795f6879060ddba65394992fde5c8f7243 100644 (file)
@@ -30,7 +30,7 @@
   *   Brian Paul
   */
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/image.h"
 #include "main/macros.h"
 
index 7776bf6ef914689813ecdc65f4db04132b40aee3..ea0861d340cba8b29c8218058542ce3aaf81f902 100644 (file)
@@ -34,7 +34,7 @@
 #include <inttypes.h>  /* for PRId64 macro */
 
 #include "main/errors.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/arrayobj.h"
 #include "main/bufferobj.h"
index f02472aec8b632a7c8a2ebbcc1744056850412f2..b2897bacb284f2560b27d00222b90e069dd0c8a5 100644 (file)
@@ -33,7 +33,7 @@
  */
 
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/context.h"
 
 #include "pipe/p_context.h"
index 6e1b2f11f73a857452a3ba1a9c38b48a43f8b4ac..ea9551be3a05993a0867023615819b65d306128b 100644 (file)
@@ -31,7 +31,7 @@
   */
 
 #include "main/errors.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/image.h"
 #include "main/bufferobj.h"
 #include "main/blit.h"
index 5982904d3ba9b2d2f60cd1dc62ae462084e1c222..4be1195279bb1cd3d12b160b6ecd82d8fb73f71d 100644 (file)
@@ -12,7 +12,7 @@
 
 
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/image.h"
 #include "main/macros.h"
 #include "main/teximage.h"
index bff917c84f699d9dbfe20c8d93badb107e107d38..81a099795bc06f5cc93f5c02dc60b6bed3324bef 100644 (file)
@@ -33,7 +33,7 @@
  */
 
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/context.h"
 #include "main/fbobject.h"
 #include "main/framebuffer.h"
index 1a02d8c5524eb3b9b91605e2856f9d844a02141c..f8a7629be0c0f09611e2f8cdf2403985006573ca 100644 (file)
@@ -37,7 +37,7 @@
  *   Brian Paul
  */
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/context.h"
 #include "main/feedback.h"
 #include "main/varray.h"
index 7e5cd2a04cbee7a0b21f66c0e60bf92211a4fcdc..6a2f524836dd5064615c5c3c865177bf8c898e25 100644 (file)
@@ -22,7 +22,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 
 #include "main/externalobjects.h"
index 6c5dc1fd43e2e9a4ed03999bdba427c03966dcd8..720a24e7254c8c54d20f3fee74d2acb7842f2eb2 100644 (file)
@@ -26,7 +26,7 @@
  **************************************************************************/
 
 #include "main/bufferobj.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/framebuffer.h"
 
 #include "state_tracker/st_cb_msaa.h"
index bce56e200c34a85dc1fac014746e7dbb57296b5e..cee49f4eb1475de1c8beeb2d671e8af1f2a8e620 100644 (file)
@@ -33,8 +33,8 @@
  */
 
 
-#include "main/imports.h"
-#include "main/compiler.h"
+#include "util/imports.h"
+#include "util/compiler.h"
 #include "main/context.h"
 #include "main/queryobj.h"
 
index f45e616abfaa2404d979243ce69b12748deb0b16..823fb2005876d37c709d55278d70b786ee6ed1c1 100644 (file)
@@ -36,7 +36,7 @@
  */
 
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/arrayobj.h"
 #include "main/feedback.h"
index 33a29aa12828390814e5aba420985247b197ddf8..9b3b9c4d6b63ca8b06d71a2d891849ca59d61668 100644 (file)
@@ -28,7 +28,7 @@
 #include "main/bufferobj.h"
 #include "main/image.h"
 #include "main/pbo.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/readpix.h"
 #include "main/enums.h"
 #include "main/framebuffer.h"
index 4b1f21e6b1736b47a58f5f3cc4b89f418efd11a9..d32de094fc120f75bfa54b3961b3ba1a46f9889d 100644 (file)
@@ -21,7 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/context.h"
 
index 6e87b82c803b82070d5aa10ac8d4794e8e495ab3..dba0b7021ea8a061392f348891a07bc835708c57 100644 (file)
@@ -24,7 +24,7 @@
 #ifndef ST_CB_SEMAPHOREOBJECTS_H
 #define ST_CB_SEMAPHOREOBJECTS_H
 
-#include "main/compiler.h"
+#include "util/compiler.h"
 #include "main/mtypes.h"
 
 struct dd_function_table;
index d5dd61935bc9e51d189362ef126004c6e1ab51a4..e585e40caa79240ef9d1d9a34a8874c11283a91b 100644 (file)
@@ -34,7 +34,7 @@
 #include "main/format_utils.h"
 #include "main/glformats.h"
 #include "main/image.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/mipmap.h"
 #include "main/pack.h"
index 4a9c72f2c6256a860f489b2d928e976dde5e4a74..45db0a3a576542b46dd85bbb7c69b14320f4d8bc 100644 (file)
@@ -33,7 +33,7 @@
  */
 
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/context.h"
 
 #include "pipe/p_context.h"
index 8bb94bac0531d0ca4aaa83a33f8b8b574dbd241d..846a76c173358f2c9d236bed2519b58ce07f4899 100644 (file)
@@ -25,7 +25,7 @@
  *
  **************************************************************************/
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/accum.h"
 #include "main/api_exec.h"
 #include "main/context.h"
index 86767151026b9d5f4b0934ac8e5129a73d541992..e3bea305a51e83e48932565fe8f86a0d680da1e3 100644 (file)
@@ -37,7 +37,7 @@
 
 
 #include "main/errors.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/image.h"
 #include "main/bufferobj.h"
 #include "main/macros.h"
index 47e43f856d53e98d700d1e0d3e3ea8e6c3ec0bd6..8d82884ba8d661e281f3c7872e7b65bc932a2b3e 100644 (file)
@@ -25,7 +25,7 @@
  * 
  **************************************************************************/
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/arrayobj.h"
 #include "main/image.h"
 #include "main/macros.h"
index b52606398b323d13156bbece96d5fa92f8c7a0de..7d77ed4151d860d578ec7f9296b1b9c35b0f7f3f 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "compiler/nir/nir.h"
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/context.h"
 #include "main/macros.h"
 #include "main/spirv_extensions.h"
index fb071beb64b67c74d341e500e7e4fdb296ba20af..310c5b62ab7b21adc63a7500199510329b292cda 100644 (file)
@@ -32,7 +32,7 @@
  * \author Brian Paul
  */
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/context.h"
 #include "main/enums.h"
 #include "main/formats.h"
index d267b7a30552e084a7c16c8f8783b423b1b64638..1983bbc76c225ebbf5295391763c68f96aa42ab0 100644 (file)
@@ -27,7 +27,7 @@
 
 
 #include "main/errors.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mipmap.h"
 #include "main/teximage.h"
 
index a060880092eac2f2c2723b095be7e5b0614245b1..466c3f1a29e5028f97c0aa9c1177b0155fa8a8b6 100644 (file)
@@ -32,7 +32,7 @@
 
 
 #include "main/errors.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/hash.h"
 #include "main/mtypes.h"
 #include "program/prog_parameter.h"
index cdd860a41bc7b16743d987e6d77967493bd72075..6ee61f738e9ea6c53523f218028bee11e2248d14 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "c99_math.h"
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/mtypes.h"
 #include "main/teximage.h"
index b51098704371a520f4bf7f67640f1f1f04bc0dec..952bfb1a177c18d602a21c4bc6322cb7922e70f4 100644 (file)
@@ -31,7 +31,7 @@
 #include "main/glheader.h"
 #include "main/context.h"
 #include "main/macros.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/state.h"
 #include "s_aatriangle.h"
 #include "s_context.h"
index 4542761e248809a03457e0a21c9dcf754fd59e84..158e5dace16fa28a6c3dde502837ce0ba3e3790f 100644 (file)
@@ -27,7 +27,7 @@
 #include "main/condrender.h"
 #include "main/format_pack.h"
 #include "main/macros.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 
 #include "s_context.h"
index 5506ed5190540b5092e92e5a83e54120b25ba370..0f58376382fc06d444dd30dd1f2384164671645d 100644 (file)
@@ -26,7 +26,7 @@
  */
 
 #include "main/errors.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/bufferobj.h"
 #include "main/mtypes.h"
 #include "main/samplerobj.h"
index d0703fa07a63cf45333c70ba71c7e941778dd36e..acfa472066f8d4b12cbf06cd9fcc33cc57b8ab0f 100644 (file)
@@ -29,7 +29,7 @@
 #include "main/macros.h"
 #include "main/blit.h"
 #include "main/pixeltransfer.h"
-#include "main/imports.h"
+#include "util/imports.h"
 
 #include "s_context.h"
 #include "s_depth.h"
index 6bc737c79568e16e3852caac7b39f0d22c16f18d..fcf534428a1cf72af2ecc5986b2a1c81ac18d3ec 100644 (file)
@@ -29,7 +29,7 @@
 #include "main/format_unpack.h"
 #include "main/format_pack.h"
 #include "main/macros.h"
-#include "main/imports.h"
+#include "util/imports.h"
 
 #include "s_context.h"
 #include "s_depth.h"
index 7ee401b2d4ce0f9e3065b910a612502da77d07ca..253d70cbbf2f85123b2485a332aaa6a8e703b4a8 100644 (file)
@@ -32,7 +32,7 @@
 #include "main/format_utils.h"
 #include "main/glformats.h"
 #include "main/image.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/pack.h"
 #include "main/pbo.h"
index c7cac2e40163e49a218395fad7c169438089e57a..6571acbba69cca41f3df9c21914c567e0c2d28d7 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "main/glheader.h"
 #include "main/context.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 
 #include "s_context.h"
index 6a0376cfef18c03c6c1c8491dbbf36a1e16f3911..cf04eb093cb7c437c5f2528501af5a2a39a77437 100644 (file)
@@ -31,7 +31,7 @@
 
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/context.h"
 #include "main/fbobject.h"
 #include "main/formats.h"
index 16b5c61480c87bf00a212f829ebff66fad5f3308..c5bb058a3b898edc53df36faaaff484d1a88fa8c 100644 (file)
@@ -37,7 +37,7 @@
 #include "main/format_pack.h"
 #include "main/format_unpack.h"
 #include "main/macros.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/image.h"
 #include "main/samplerobj.h"
 #include "main/state.h"
index ce3d77c79a91b55a0d2e41a23b6ed3a08f6e6940..2c59d2e7b3c15799fb6d1d58380277ad20dbfe0d 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "main/glheader.h"
 #include "main/context.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/format_pack.h"
 #include "main/format_unpack.h"
 #include "main/stencil.h"
index 743ee4015bb9db3636f90edc973c5f76d83c49e6..36574f9361055867813370d0f8a24a140f4997c9 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "main/glheader.h"
 #include "main/context.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/pixeltransfer.h"
 #include "main/samplerobj.h"
index 314170fc7518da0f52d7a0b0fe33d9cc70ce06cc..f73037791de1bd6dae6d0e5c0791c795b32d396a 100644 (file)
@@ -26,7 +26,7 @@
 #include "c99_math.h"
 #include "main/glheader.h"
 #include "main/context.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/samplerobj.h"
 #include "main/teximage.h"
index e724367ecf0a5f1d974c1de11ce13fc7d74e33bd..65b10a89dfa81ff027548c43e84e3ffdaf360a63 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "main/glheader.h"
 #include "main/context.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/mtypes.h"
 #include "main/state.h"
index 2472aa730f94da8d8e8b8891fdf58d87a4e430c3..973e8cfedcec1dd1f8b2b24655048340f15699dc 100644 (file)
@@ -25,7 +25,7 @@
 #include "main/errors.h"
 #include "main/glheader.h"
 #include "main/macros.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/format_pack.h"
 
 #include "s_context.h"
index ec20d6c35a1098c856cb96e85beab55f1f451b47..0cddb0f1467b25d73bfe8e05b88cc4ef965352e3 100644 (file)
@@ -26,7 +26,7 @@
  */
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/state.h"
 #include "tnl/tnl.h"
index 3383b23525043c55503b6d699b69b2bdc5546584..ed068f708d00a28f83f09992527febd287a08f55 100644 (file)
@@ -27,7 +27,7 @@
 
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/context.h"
 #include "main/macros.h"
 #include "main/mtypes.h"
index eca9f66037a8afa35ed4ae2bd560e6c225237bf8..21a5156708d3fc7ceb4583493ae324692e08e621 100644 (file)
@@ -50,7 +50,7 @@
 #define _T_CONTEXT_H
 
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 
 #include "math/m_vector.h"
index ee77e802678d319212632de783a418045bf3490d..33d39a7bd20a9ed647b41e3f25e2ba39c29ce9be 100644 (file)
@@ -32,7 +32,7 @@
 #include "main/bufferobj.h"
 #include "main/condrender.h"
 #include "main/context.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 #include "main/macros.h"
 #include "main/enums.h"
index 0adbef01264252298627c160256c6ceac774b761..b0b46aa267878aa7d724e36078986251ae5109df 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "main/glheader.h"
 #include "main/context.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 
 #include "t_context.h"
index 54d39df733ba207b55607cface35fc31d2ce3c65..07e603b010703e180100324ac7abbe28c0f8cf13 100644 (file)
@@ -50,7 +50,7 @@
 #include "main/bufferobj.h"
 #include "main/errors.h"
 #include "main/glheader.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 #include "vbo/vbo.h"
 
index 9d5c324ebefbf81eae8f4f7aa2e29b35f794cd81..57ff5bf0e038371b1112e74adb05aab300928ef1 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "main/glheader.h"
 #include "main/bufferobj.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/glformats.h"
 #include "main/macros.h"
 #include "main/mtypes.h"
index c224a4192a4c966dfb7439125300c5b143b0c5eb..f6ccd49d6bb316a1fc873bc4d78f4ed0d891792f 100644 (file)
@@ -30,7 +30,7 @@
 #include "main/errors.h"
 #include "main/glheader.h"
 #include "main/macros.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 
 #include "math/m_xform.h"
index 8d13712e218b3a71cc96094dc1a11daf33048bbb..cd0a5544c9399d3796a5ff15217766ce570a3ca5 100644 (file)
@@ -27,7 +27,7 @@
 #include "main/glheader.h"
 #include "main/light.h"
 #include "main/macros.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "util/simple_list.h"
 #include "main/mtypes.h"
 
index 6fc89c23b3331362d63e28d9da0ea8cf3011fdd8..a4fd8e94065bc962b5e02b826295030fa006f7be 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "main/glheader.h"
 #include "main/macros.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 
 #include "math/m_xform.h"
index 0f8578daa185abcd5ee34352e4a604f1203198da..17da53949d88cd4afd51aab1d2c918ab7560ddcc 100644 (file)
@@ -29,7 +29,7 @@
 #include "main/glheader.h"
 #include "main/mtypes.h"
 #include "main/dd.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "t_context.h"
 #include "t_pipeline.h"
 
index 8d8aca614e3cf950a070d5ac64b6597640655bf2..099d37eed7264d68f5d5c711630fd0eb46a269c3 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "main/glheader.h"
 #include "main/macros.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/samplerobj.h"
 #include "main/state.h"
 #include "math/m_xform.h"
index 9ff1f18f53b59b6416a216c649c277ebf4e3a8ef..d58f050e94d9a41b2f8f3624a30945ff06c4157e 100644 (file)
@@ -43,7 +43,7 @@
 #include "main/context.h"
 #include "main/enums.h"
 #include "main/macros.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 #include "math/m_xform.h"
 #include "util/bitscan.h"
index bd585324e2b53b1b18aef4ae3463e29c40ae5c5a..de0a9995e73db9ea1c7e3741d1610af45a01e4be 100644 (file)
@@ -37,7 +37,7 @@
 #include "main/errors.h"
 #include "main/glheader.h"
 #include "main/macros.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 
 #include "math/m_xform.h"
index ef034d643bf2d4ce4b52dce089567b50f199e8ab..49875ead3e8ab499afd39b488a2ac85531d9abf7 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "main/glheader.h"
 #include "main/macros.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 
 #include "math/m_xform.h"
index 4fb3659a3583d8757f7fd063e15208d9ed02afce..1a55f7e69572451642c4a3086c7dd33043aceaa4 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "main/glheader.h"
 #include "main/macros.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/mtypes.h"
 
 #include "math/m_xform.h"
index 336765c9117527fd8259f41180240e93f7a7d46f..24f0aa3384a52e4a0372e6e12be6e3e0ef25b357 100644 (file)
@@ -35,7 +35,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define VBO_EXEC_H
 
 #include "main/dd.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "vbo.h"
 #include "vbo_attrib.h"
 
index d43d22856ab39a6a916a981ff464506423e7f379..830f658d29cbf0548ef7fb6bf0d09501e80fcbb9 100644 (file)
@@ -29,7 +29,7 @@
  */
 
 #include "main/errors.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/varray.h"
 
index e193a5a32af4bff8aee13ae7a0feeac053369ecd..115e9626ade9bbdb5e45b27be8e98d20dccc83b4 100644 (file)
@@ -31,7 +31,7 @@
 #include "main/glheader.h"
 #include "main/bufferobj.h"
 #include "main/context.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "main/light.h"
 #include "main/state.h"
index 26a9f94facbe27fd0b611a1fe1c097202a076efd..83885922495d1816bef6dcf9d9009d049c73e7cd 100644 (file)
@@ -29,7 +29,7 @@
 #include "main/context.h"
 #include "main/glheader.h"
 #include "main/enums.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/dispatch.h"
 #include "glapi/glapi.h"
 
index 36b2e82fb6329887f9278d5276f57c1557ed1900..bdc1417f5ee39d963df60b8e60d0e8a21098fd36 100644 (file)
@@ -55,7 +55,7 @@
 #endif
 
 #include "main/errors.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "common_x86_asm.h"
 
 
index 0c354907fa88376daa7f3b957c0725f0ed5638f9..0befe1de471a80d276e1d792c75baeb4b571f64f 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef ASM_MMX_H
 #define ASM_MMX_H
 
-#include "main/compiler.h"
+#include "util/compiler.h"
 #include "main/glheader.h"
 
 struct gl_context;
index ddb2ec37380196e7064509a5fb2e053c7a70f894..14107bae6c6c413d2614d816fa7040a1fd468bb1 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <stdio.h>
 
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/execmem.h"
 #include "x86sse.h"
 
index 53b999ad22aeea92c917e2faffbd323a8f17c348..accb7a9806d13ac14ebb8eace54e7ca0e9dfbdb4 100644 (file)
@@ -31,7 +31,7 @@ inc_amd_common_llvm = include_directories('amd/llvm')
 libglsl_util = static_library(
   'glsl_util',
   files(
-    'mesa/main/extensions_table.c', 'mesa/main/imports.c',
+    'mesa/main/extensions_table.c',
     'mesa/program/prog_parameter.c', 'mesa/program/symbol_table.c',
     'mesa/program/dummy_errors.c',
   ),
index 42ce6a456214860e9cfa3068a264e6aa46f8db14..23e451f0761d8c26c436f8682cbbc80b49e3566d 100644 (file)
@@ -27,7 +27,7 @@
 #include "main/mtypes.h"
 #include "compiler/glsl/glsl_to_nir.h"
 #include "compiler/nir_types.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "compiler/nir/nir_builder.h"
 
 #include "disassemble.h"
index 5d3bcba15ea8eff7bdbd37e221d3e39137b75e83..954f073af7c3ba0e44e6ee9e25833763d0e0ecc7 100644 (file)
@@ -33,7 +33,7 @@
 #include "main/mtypes.h"
 #include "compiler/glsl/glsl_to_nir.h"
 #include "compiler/nir_types.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "compiler/nir/nir_builder.h"
 #include "util/half_float.h"
 #include "util/u_math.h"
index 575bb5fb6e7f9c9f2836e0581ee76f0ac8a7c44c..644839bd09a306975e747ed7210d396d748ad93a 100644 (file)
@@ -9,6 +9,7 @@ MESA_UTIL_FILES := \
        blob.h \
        build_id.c \
        build_id.h \
+        compiler.h \
        crc32.c \
        crc32.h \
        dag.c \
@@ -50,6 +51,8 @@ MESA_UTIL_FILES := \
        half_float.h \
        hash_table.c \
        hash_table.h \
+        imports.c \
+        imports.h \
        list.h \
        macros.h \
        mesa-sha1.c \
diff --git a/src/util/compiler.h b/src/util/compiler.h
new file mode 100644 (file)
index 0000000..43a06b4
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * Mesa 3-D graphics library
+ *
+ * Copyright (C) 1999-2008  Brian Paul   All Rights Reserved.
+ * Copyright (C) 2009  VMware, Inc.  All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * \file compiler.h
+ * Compiler-related stuff.
+ */
+
+
+#ifndef COMPILER_H
+#define COMPILER_H
+
+
+#include <assert.h>
+
+#include "util/macros.h"
+
+#include "c99_compat.h" /* inline, __func__, etc. */
+
+
+/**
+ * Either define MESA_BIG_ENDIAN or MESA_LITTLE_ENDIAN, and CPU_TO_LE32.
+ * Do not use these unless absolutely necessary!
+ * Try to use a runtime test instead.
+ * For now, only used by some DRI hardware drivers for color/texel packing.
+ */
+#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
+#if defined(__linux__)
+#include <byteswap.h>
+#define CPU_TO_LE32( x )       bswap_32( x )
+#elif defined(__APPLE__)
+#include <CoreFoundation/CFByteOrder.h>
+#define CPU_TO_LE32( x )       CFSwapInt32HostToLittle( x )
+#elif defined(__OpenBSD__)
+#include <sys/types.h>
+#define CPU_TO_LE32( x )       htole32( x )
+#else /*__linux__ */
+#include <sys/endian.h>
+#define CPU_TO_LE32( x )       bswap32( x )
+#endif /*__linux__*/
+#define MESA_BIG_ENDIAN 1
+#else
+#define CPU_TO_LE32( x )       ( x )
+#define MESA_LITTLE_ENDIAN 1
+#endif
+#define LE32_TO_CPU( x )       CPU_TO_LE32( x )
+
+
+
+#define IEEE_ONE 0x3f800000
+
+
+#endif /* COMPILER_H */
index 74fc51b63053e2549407170b8e53d608c33bb513..04320568537782db1dd83cb7da17cbeafa4569c8 100644 (file)
@@ -51,7 +51,7 @@
 #include "util/u_queue.h"
 #include "util/mesa-sha1.h"
 #include "util/ralloc.h"
-#include "main/compiler.h"
+#include "util/compiler.h"
 #include "main/errors.h"
 
 #include "disk_cache.h"
diff --git a/src/util/imports.c b/src/util/imports.c
new file mode 100644 (file)
index 0000000..f264e72
--- /dev/null
@@ -0,0 +1,232 @@
+/**
+ * \file imports.c
+ * Standard C library function wrappers.
+ * 
+ * Imports are services which the device driver or window system or
+ * operating system provides to the core renderer.  The core renderer (Mesa)
+ * will call these functions in order to do memory allocation, simple I/O,
+ * etc.
+ *
+ * Some drivers will want to override/replace this file with something
+ * specialized, but that'll be rare.
+ *
+ * Eventually, I want to move roll the glheader.h file into this.
+ *
+ * \todo Functions still needed:
+ * - scanf
+ * - qsort
+ * - rand and RAND_MAX
+ */
+
+/*
+ * Mesa 3-D graphics library
+ *
+ * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdarg.h>
+#include "c99_math.h"
+#include "imports.h"
+
+#ifdef _GNU_SOURCE
+#include <locale.h>
+#ifdef __APPLE__
+#include <xlocale.h>
+#endif
+#endif
+
+
+#ifdef _WIN32
+#define vsnprintf _vsnprintf
+#elif defined(__IBMC__) || defined(__IBMCPP__)
+extern int vsnprintf(char *str, size_t count, const char *fmt, va_list arg);
+#endif
+
+/**********************************************************************/
+/** \name Memory */
+/*@{*/
+
+/**
+ * Allocate aligned memory.
+ *
+ * \param bytes number of bytes to allocate.
+ * \param alignment alignment (must be greater than zero).
+ * 
+ * Allocates extra memory to accommodate rounding up the address for
+ * alignment and to record the real malloc address.
+ *
+ * \sa _mesa_align_free().
+ */
+void *
+_mesa_align_malloc(size_t bytes, unsigned long alignment)
+{
+#if defined(HAVE_POSIX_MEMALIGN)
+   void *mem;
+   int err = posix_memalign(& mem, alignment, bytes);
+   if (err)
+      return NULL;
+   return mem;
+#elif defined(_WIN32)
+   return _aligned_malloc(bytes, alignment);
+#else
+   uintptr_t ptr, buf;
+
+   assert( alignment > 0 );
+
+   ptr = (uintptr_t)malloc(bytes + alignment + sizeof(void *));
+   if (!ptr)
+      return NULL;
+
+   buf = (ptr + alignment + sizeof(void *)) & ~(uintptr_t)(alignment - 1);
+   *(uintptr_t *)(buf - sizeof(void *)) = ptr;
+
+#ifndef NDEBUG
+   /* mark the non-aligned area */
+   while ( ptr < buf - sizeof(void *) ) {
+      *(unsigned long *)ptr = 0xcdcdcdcd;
+      ptr += sizeof(unsigned long);
+   }
+#endif
+
+   return (void *) buf;
+#endif /* defined(HAVE_POSIX_MEMALIGN) */
+}
+
+/**
+ * Same as _mesa_align_malloc(), but using calloc(1, ) instead of
+ * malloc()
+ */
+void *
+_mesa_align_calloc(size_t bytes, unsigned long alignment)
+{
+#if defined(HAVE_POSIX_MEMALIGN)
+   void *mem;
+   
+   mem = _mesa_align_malloc(bytes, alignment);
+   if (mem != NULL) {
+      (void) memset(mem, 0, bytes);
+   }
+
+   return mem;
+#elif defined(_WIN32)
+   void *mem;
+
+   mem = _aligned_malloc(bytes, alignment);
+   if (mem != NULL) {
+      (void) memset(mem, 0, bytes);
+   }
+
+   return mem;
+#else
+   uintptr_t ptr, buf;
+
+   assert( alignment > 0 );
+
+   ptr = (uintptr_t)calloc(1, bytes + alignment + sizeof(void *));
+   if (!ptr)
+      return NULL;
+
+   buf = (ptr + alignment + sizeof(void *)) & ~(uintptr_t)(alignment - 1);
+   *(uintptr_t *)(buf - sizeof(void *)) = ptr;
+
+#ifndef NDEBUG
+   /* mark the non-aligned area */
+   while ( ptr < buf - sizeof(void *) ) {
+      *(unsigned long *)ptr = 0xcdcdcdcd;
+      ptr += sizeof(unsigned long);
+   }
+#endif
+
+   return (void *)buf;
+#endif /* defined(HAVE_POSIX_MEMALIGN) */
+}
+
+/**
+ * Free memory which was allocated with either _mesa_align_malloc()
+ * or _mesa_align_calloc().
+ * \param ptr pointer to the memory to be freed.
+ * The actual address to free is stored in the word immediately before the
+ * address the client sees.
+ * Note that it is legal to pass NULL pointer to this function and will be
+ * handled accordingly.
+ */
+void
+_mesa_align_free(void *ptr)
+{
+#if defined(HAVE_POSIX_MEMALIGN)
+   free(ptr);
+#elif defined(_WIN32)
+   _aligned_free(ptr);
+#else
+   if (ptr) {
+      void **cubbyHole = (void **) ((char *) ptr - sizeof(void *));
+      void *realAddr = *cubbyHole;
+      free(realAddr);
+   }
+#endif /* defined(HAVE_POSIX_MEMALIGN) */
+}
+
+/**
+ * Reallocate memory, with alignment.
+ */
+void *
+_mesa_align_realloc(void *oldBuffer, size_t oldSize, size_t newSize,
+                    unsigned long alignment)
+{
+#if defined(_WIN32)
+   (void) oldSize;
+   return _aligned_realloc(oldBuffer, newSize, alignment);
+#else
+   const size_t copySize = (oldSize < newSize) ? oldSize : newSize;
+   void *newBuf = _mesa_align_malloc(newSize, alignment);
+   if (newBuf && oldBuffer && copySize > 0) {
+      memcpy(newBuf, oldBuffer, copySize);
+   }
+
+   _mesa_align_free(oldBuffer);
+   return newBuf;
+#endif
+}
+
+/*@}*/
+
+
+/** Needed due to #ifdef's, above. */
+int
+_mesa_vsnprintf(char *str, size_t size, const char *fmt, va_list args)
+{
+   return vsnprintf( str, size, fmt, args);
+}
+
+/** Wrapper around vsnprintf() */
+int
+_mesa_snprintf( char *str, size_t size, const char *fmt, ... )
+{
+   int r;
+   va_list args;
+   va_start( args, fmt );  
+   r = vsnprintf( str, size, fmt, args );
+   va_end( args );
+   return r;
+}
+
+
diff --git a/src/util/imports.h b/src/util/imports.h
new file mode 100644 (file)
index 0000000..1e547c3
--- /dev/null
@@ -0,0 +1,320 @@
+/*
+ * Mesa 3-D graphics library
+ *
+ * Copyright (C) 1999-2008  Brian Paul   All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * \file imports.h
+ * Standard C library function wrappers.
+ *
+ * This file provides wrappers for all the standard C library functions
+ * like malloc(), free(), printf(), getenv(), etc.
+ */
+
+
+#ifndef IMPORTS_H
+#define IMPORTS_H
+
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include "util/compiler.h"
+#include "util/bitscan.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/**********************************************************************/
+/** Memory macros */
+/*@{*/
+
+/** Allocate a structure of type \p T */
+#define MALLOC_STRUCT(T)   (struct T *) malloc(sizeof(struct T))
+/** Allocate and zero a structure of type \p T */
+#define CALLOC_STRUCT(T)   (struct T *) calloc(1, sizeof(struct T))
+
+/*@}*/
+
+
+/*
+ * For GL_ARB_vertex_buffer_object we need to treat vertex array pointers
+ * as offsets into buffer stores.  Since the vertex array pointer and
+ * buffer store pointer are both pointers and we need to add them, we use
+ * this macro.
+ * Both pointers/offsets are expressed in bytes.
+ */
+#define ADD_POINTERS(A, B)  ( (uint8_t *) (A) + (uintptr_t) (B) )
+
+
+/**
+ * Sometimes we treat floats as ints.  On x86 systems, moving a float
+ * as an int (thereby using integer registers instead of FP registers) is
+ * a performance win.  Typically, this can be done with ordinary casts.
+ * But with gcc's -fstrict-aliasing flag (which defaults to on in gcc 3.0)
+ * these casts generate warnings.
+ * The following union typedef is used to solve that.
+ */
+typedef union { float f; int i; unsigned u; } fi_type;
+
+
+
+/*@}*/
+
+
+/***
+ *** LOG2: Log base 2 of float
+ ***/
+static inline float LOG2(float x)
+{
+#if 0
+   /* This is pretty fast, but not accurate enough (only 2 fractional bits).
+    * Based on code from http://www.stereopsis.com/log2.html
+    */
+   const float y = x * x * x * x;
+   const unsigned ix = *((unsigned *) &y);
+   const unsigned exp = (ix >> 23) & 0xFF;
+   const int log2 = ((int) exp) - 127;
+   return (float) log2 * (1.0 / 4.0);  /* 4, because of x^4 above */
+#endif
+   /* Pretty fast, and accurate.
+    * Based on code from http://www.flipcode.com/totd/
+    */
+   fi_type num;
+   int log_2;
+   num.f = x;
+   log_2 = ((num.i >> 23) & 255) - 128;
+   num.i &= ~(255 << 23);
+   num.i += 127 << 23;
+   num.f = ((-1.0f/3) * num.f + 2) * num.f - 2.0f/3;
+   return num.f + log_2;
+}
+
+
+
+/**
+ * finite macro.
+ */
+#if defined(_MSC_VER)
+#  define finite _finite
+#endif
+
+
+/***
+ *** IS_INF_OR_NAN: test if float is infinite or NaN
+ ***/
+#if defined(isfinite)
+#define IS_INF_OR_NAN(x)        (!isfinite(x))
+#elif defined(finite)
+#define IS_INF_OR_NAN(x)        (!finite(x))
+#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#define IS_INF_OR_NAN(x)        (!isfinite(x))
+#else
+#define IS_INF_OR_NAN(x)        (!finite(x))
+#endif
+
+
+/**
+ * Convert float to int by rounding to nearest integer, away from zero.
+ */
+static inline int IROUND(float f)
+{
+   return (int) ((f >= 0.0F) ? (f + 0.5F) : (f - 0.5F));
+}
+
+/**
+ * Convert double to int by rounding to nearest integer, away from zero.
+ */
+static inline int IROUNDD(double d)
+{
+   return (int) ((d >= 0.0) ? (d + 0.5) : (d - 0.5));
+}
+
+/**
+ * Convert float to int64 by rounding to nearest integer.
+ */
+static inline int64_t IROUND64(float f)
+{
+   return (int64_t) ((f >= 0.0F) ? (f + 0.5F) : (f - 0.5F));
+}
+
+
+/**
+ * Convert positive float to int by rounding to nearest integer.
+ */
+static inline int IROUND_POS(float f)
+{
+   assert(f >= 0.0F);
+   return (int) (f + 0.5F);
+}
+
+/** Return (as an integer) floor of float */
+static inline int IFLOOR(float f)
+{
+#if defined(USE_X86_ASM) && defined(__GNUC__) && defined(__i386__)
+   /*
+    * IEEE floor for computers that round to nearest or even.
+    * 'f' must be between -4194304 and 4194303.
+    * This floor operation is done by "(iround(f + .5) + iround(f - .5)) >> 1",
+    * but uses some IEEE specific tricks for better speed.
+    * Contributed by Josh Vanderhoof
+    */
+   int ai, bi;
+   double af, bf;
+   af = (3 << 22) + 0.5 + (double)f;
+   bf = (3 << 22) + 0.5 - (double)f;
+   /* GCC generates an extra fstp/fld without this. */
+   __asm__ ("fstps %0" : "=m" (ai) : "t" (af) : "st");
+   __asm__ ("fstps %0" : "=m" (bi) : "t" (bf) : "st");
+   return (ai - bi) >> 1;
+#else
+   int ai, bi;
+   double af, bf;
+   fi_type u;
+   af = (3 << 22) + 0.5 + (double)f;
+   bf = (3 << 22) + 0.5 - (double)f;
+   u.f = (float) af;  ai = u.i;
+   u.f = (float) bf;  bi = u.i;
+   return (ai - bi) >> 1;
+#endif
+}
+
+
+/**
+ * Is x a power of two?
+ */
+static inline int
+_mesa_is_pow_two(int x)
+{
+   return !(x & (x - 1));
+}
+
+/**
+ * Round given integer to next higer power of two
+ * If X is zero result is undefined.
+ *
+ * Source for the fallback implementation is
+ * Sean Eron Anderson's webpage "Bit Twiddling Hacks"
+ * http://graphics.stanford.edu/~seander/bithacks.html
+ *
+ * When using builtin function have to do some work
+ * for case when passed values 1 to prevent hiting
+ * undefined result from __builtin_clz. Undefined
+ * results would be different depending on optimization
+ * level used for build.
+ */
+static inline int32_t
+_mesa_next_pow_two_32(uint32_t x)
+{
+#ifdef HAVE___BUILTIN_CLZ
+       uint32_t y = (x != 1);
+       return (1 + y) << ((__builtin_clz(x - y) ^ 31) );
+#else
+       x--;
+       x |= x >> 1;
+       x |= x >> 2;
+       x |= x >> 4;
+       x |= x >> 8;
+       x |= x >> 16;
+       x++;
+       return x;
+#endif
+}
+
+static inline int64_t
+_mesa_next_pow_two_64(uint64_t x)
+{
+#ifdef HAVE___BUILTIN_CLZLL
+       uint64_t y = (x != 1);
+       STATIC_ASSERT(sizeof(x) == sizeof(long long));
+       return (1 + y) << ((__builtin_clzll(x - y) ^ 63));
+#else
+       x--;
+       x |= x >> 1;
+       x |= x >> 2;
+       x |= x >> 4;
+       x |= x >> 8;
+       x |= x >> 16;
+       x |= x >> 32;
+       x++;
+       return x;
+#endif
+}
+
+
+/*
+ * Returns the floor form of binary logarithm for a 32-bit integer.
+ */
+static inline unsigned
+_mesa_logbase2(unsigned n)
+{
+#ifdef HAVE___BUILTIN_CLZ
+   return (31 - __builtin_clz(n | 1));
+#else
+   unsigned pos = 0;
+   if (n >= 1<<16) { n >>= 16; pos += 16; }
+   if (n >= 1<< 8) { n >>=  8; pos +=  8; }
+   if (n >= 1<< 4) { n >>=  4; pos +=  4; }
+   if (n >= 1<< 2) { n >>=  2; pos +=  2; }
+   if (n >= 1<< 1) {           pos +=  1; }
+   return pos;
+#endif
+}
+
+
+/**********************************************************************
+ * Functions
+ */
+
+extern void *
+_mesa_align_malloc( size_t bytes, unsigned long alignment );
+
+extern void *
+_mesa_align_calloc( size_t bytes, unsigned long alignment );
+
+extern void
+_mesa_align_free( void *ptr );
+
+extern void *
+_mesa_align_realloc(void *oldBuffer, size_t oldSize, size_t newSize,
+                    unsigned long alignment);
+
+extern int
+_mesa_snprintf( char *str, size_t size, const char *fmt, ... ) PRINTFLIKE(3, 4);
+
+extern int
+_mesa_vsnprintf(char *str, size_t size, const char *fmt, va_list arg);
+
+
+#if defined(_WIN32) && !defined(HAVE_STRTOK_R)
+#define strtok_r strtok_s
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* IMPORTS_H */
index e30029063c0e8d81914e1c1dd47defd92d4ea788..d6647c0c5c38d3ccb6809ed5bea2d9a579b78d69 100644 (file)
@@ -34,6 +34,7 @@ files_mesa_util = files(
   'blob.h',
   'build_id.c',
   'build_id.h',
+  'compiler.h',
   'crc32.c',
   'crc32.h',
   'dag.c',
@@ -54,6 +55,8 @@ files_mesa_util = files(
   'half_float.h',
   'hash_table.c',
   'hash_table.h',
+  'imports.c',
+  'imports.h',
   'list.h',
   'macros.h',
   'mesa-sha1.c',
index 4e97d82f23ed9aa6e659423127fda4b6e60ae9c6..9c654080a09a8e4b2449a2e396f20b6323d35c2c 100644 (file)
@@ -73,7 +73,7 @@
 #include <stdbool.h>
 
 #include "ralloc.h"
-#include "main/imports.h"
+#include "util/imports.h"
 #include "main/macros.h"
 #include "util/bitset.h"
 #include "register_allocate.h"