swr/rasterizer: Add tessellator implementation to the rasterizer
[mesa.git] / src / gallium / drivers / swr / meson.build
index 4d6af87af086dcbb18c4592ac6cef2afb6b967d1..5a5c46dcbddb9de5e8d85c60bc20f43e70bf09d0 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright © 2017 Intel Corporation
+# Copyright © 2017-2018 Intel Corporation
 
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -70,6 +70,8 @@ files_swr_mesa = files(
   'rasterizer/jitter/builder_math.h',
   'rasterizer/jitter/builder_mem.cpp',
   'rasterizer/jitter/builder_mem.h',
+  'rasterizer/jitter/builder_gfx_mem.cpp',
+  'rasterizer/jitter/builder_gfx_mem.h',
   'rasterizer/jitter/builder_misc.cpp',
   'rasterizer/jitter/builder_misc.h',
   'rasterizer/jitter/fetch_jit.cpp',
@@ -79,6 +81,10 @@ files_swr_mesa = files(
   'rasterizer/jitter/JitManager.h',
   'rasterizer/jitter/streamout_jit.cpp',
   'rasterizer/jitter/streamout_jit.h',
+  'rasterizer/jitter/shader_lib/DebugOutput.cpp',
+  'rasterizer/jitter/shader_lib/Scatter.cpp',
+  'rasterizer/jitter/functionpasses/lower_x86.cpp',
+  'rasterizer/memory/SurfaceState.h'
 )
 
 files_swr_arch = files(
@@ -123,10 +129,13 @@ files_swr_arch = files(
   'rasterizer/core/state.h',
   'rasterizer/core/state_funcs.h',
   'rasterizer/core/tessellator.h',
+  'rasterizer/core/tessellator.hpp',
+  'rasterizer/core/tessellator.cpp',
   'rasterizer/core/threads.cpp',
   'rasterizer/core/threads.h',
   'rasterizer/core/tilemgr.cpp',
   'rasterizer/core/tilemgr.h',
+  'rasterizer/core/tileset.h',
   'rasterizer/core/utils.h',
   'rasterizer/memory/ClearTile.cpp',
   'rasterizer/memory/Convert.h',
@@ -146,11 +155,16 @@ files_swr_arch = files(
   'rasterizer/memory/StoreTile_TileY.cpp',
   'rasterizer/memory/TilingFunctions.h',
   'rasterizer/memory/tilingtraits.h',
+  'rasterizer/memory/InitMemory.h',
+  'rasterizer/memory/InitMemory.cpp',
+  'rasterizer/memory/SurfaceState.h'
 )
 
 swr_context_files = files('swr_context.h')
 swr_state_files = files('rasterizer/core/state.h')
+swr_surf_state_files = files('rasterizer/memory/SurfaceState.h')
 swr_event_proto_files = files('rasterizer/archrast/events.proto')
+swr_event_pproto_files = files('rasterizer/archrast/events_private.proto')
 swr_gen_backend_files = files('rasterizer/codegen/templates/gen_backend.cpp')
 swr_gen_rasterizer_files = files('rasterizer/codegen/templates/gen_rasterizer.cpp')
 swr_gen_header_init_files = files('rasterizer/codegen/templates/gen_header_init.hpp')
@@ -183,10 +197,7 @@ swr_arch_defines = []
 
 swr_avx_args = cpp.first_supported_argument(
   '-target-cpu=sandybridge', '-mavx', '-march=core-avx', '-tp=sandybridge',
-  prefix : '''
-    #if !defined(__AVX__)
-    # error
-    #endif ''',
+  '/arch:AVX',
 )
 if swr_avx_args == []
   error('Cannot find AVX support for swr. (these are required for SWR an all architectures.)')
@@ -196,28 +207,25 @@ if with_swr_arches.contains('avx')
   swr_arch_libs += shared_library(
     'swrAVX',
     [files_swr_common, files_swr_arch],
-    cpp_args : [swr_cpp_args, swr_avx_args, '-DKNOB_ARCH=KNOB_ARCH_AVX'],
+    cpp_args : [
+      cpp_msvc_compat_args, swr_cpp_args, swr_avx_args,
+      '-DKNOB_ARCH=KNOB_ARCH_AVX',
+    ],
     link_args : [ld_args_gc_sections],
     include_directories : [swr_incs],
     dependencies : [dep_thread, dep_llvm],
+    version : '0.0.0',
+    soversion : host_machine.system() == 'windows' ? '' : '0',
     install : true,
   )
 endif
 
 if with_swr_arches.contains('avx2')
   swr_avx2_args = cpp.first_supported_argument(
-    '-target-cpu=haswell', '-march=core-avx2', '-tp=haswell',
-    prefix : '''
-      #if !defined(__AVX2__)
-      # error
-      #endif ''',
+    '-target-cpu=haswell', '-march=core-avx2', '-tp=haswell', '/arch:AVX2',
   )
   if swr_avx2_args == []
-    if cpp.has_argument(['-mavx2', '-mfma', '-mbmi2', '-mf16c'],
-                        prefix : '''
-                          #if !defined(__AVX2__)
-                          # error
-                          #endif ''')
+    if cpp.has_argument(['-mavx2', '-mfma', '-mbmi2', '-mf16c'])
       swr_avx2_args = ['-mavx2', '-mfma', '-mbmi2', '-mf16c']
     else
       error('Cannot find AVX2 support for swr.')
@@ -228,21 +236,22 @@ if with_swr_arches.contains('avx2')
   swr_arch_libs += shared_library(
     'swrAVX2',
     [files_swr_common, files_swr_arch],
-    cpp_args : [swr_cpp_args, swr_avx2_args, '-DKNOB_ARCH=KNOB_ARCH_AVX2'],
+    cpp_args : [
+      cpp_msvc_compat_args, swr_cpp_args, swr_avx2_args,
+      '-DKNOB_ARCH=KNOB_ARCH_AVX2',
+    ],
     link_args : [ld_args_gc_sections],
     include_directories : [swr_incs],
     dependencies : [dep_thread, dep_llvm],
+    version : '0.0.0',
+    soversion : host_machine.system() == 'windows' ? '' : '0',
     install : true,
   )
 endif
 
 if with_swr_arches.contains('knl')
   swr_knl_args = cpp.first_supported_argument(
-    '-target-cpu=mic-knl', '-march=knl', '-xMIC-AVX512',
-    prefix : '''
-      #if !defined(__AVX512F__) || !defined(__AVX512ER__)
-      # error
-      #endif ''',
+    '-march=knl', '-target-cpu=mic-knl', '-xMIC-AVX512',
   )
   if swr_knl_args == []
     error('Cannot find KNL support for swr.')
@@ -253,23 +262,21 @@ if with_swr_arches.contains('knl')
     'swrKNL',
     [files_swr_common, files_swr_arch],
     cpp_args : [
-      swr_cpp_args, swr_knl_args, '-DKNOB_ARCH=KNOB_ARCH_AVX512',
-      '-DKNOB_ARCH_KNIGHTS',
+      cpp_msvc_compat_args, swr_cpp_args, swr_knl_args,
+      '-DKNOB_ARCH=KNOB_ARCH_AVX512', '-DSIMD_ARCH_KNIGHTS',
     ],
     link_args : [ld_args_gc_sections],
     include_directories : [swr_incs],
     dependencies : [dep_thread, dep_llvm],
+    version : '0.0.0',
+    soversion : host_machine.system() == 'windows' ? '' : '0',
     install : true,
   )
 endif
 
 if with_swr_arches.contains('skx')
   swr_skx_args = cpp.first_supported_argument(
-    '-target-cpu=x86-skylake', '-march=skylake-avx512', '-xCORE-AVX512',
-    prefix : '''
-      #if !defined(__AVX512F__) || !defined(__AVX512BW__)
-      # error
-      #endif ''',
+    '-march=skylake-avx512', '-target-cpu=x86-skylake', '-xCORE-AVX512',
   )
   if swr_skx_args == []
     error('Cannot find SKX support for swr.')
@@ -279,10 +286,15 @@ if with_swr_arches.contains('skx')
   swr_arch_libs += shared_library(
     'swrSKX',
     [files_swr_common, files_swr_arch],
-    cpp_args : [swr_cpp_args, swr_skx_args, '-DKNOB_ARCH=KNOB_ARCH_AVX512'],
+    cpp_args : [
+      cpp_msvc_compat_args, swr_cpp_args, swr_skx_args,
+      '-DKNOB_ARCH=KNOB_ARCH_AVX512',
+    ],
     link_args : [ld_args_gc_sections],
     include_directories : [swr_incs],
     dependencies : [dep_thread, dep_llvm],
+    version : '0.0.0',
+    soversion : host_machine.system() == 'windows' ? '' : '0',
     install : true,
   )
 endif
@@ -295,13 +307,16 @@ endif
 libmesaswr = static_library(
   'mesaswr',
   [files_swr_mesa, files_swr_common, gen_knobs_h, gen_knobs_cpp,
-   gen_builder_hpp, gen_builder_x86_hpp],
-  cpp_args : [cpp_vis_args, swr_cpp_args, swr_avx_args, swr_arch_defines],
+   gen_builder_hpp, gen_builder_meta_hpp, gen_builder_intrin_hpp],
+  cpp_args : [
+    cpp_msvc_compat_args, cpp_vis_args, swr_cpp_args, swr_avx_args,
+    swr_arch_defines,
+  ],
   include_directories : [inc_common, swr_incs],
   dependencies : dep_llvm,
 )
 
 driver_swr = declare_dependency(
   compile_args : '-DGALLIUM_SWR',
-  link_with : libmesaswr,
+  link_with : libmesaswr
 )