[Bf-blender-cvs] [60f7652a928] tmp-gpu-shader-descriptor-2: Reduce compile units for shader_builder.

Jeroen Bakker noreply at git.blender.org
Wed Jan 5 14:17:55 CET 2022


Commit: 60f7652a9285601fa32dae199c449cafdaac219f
Author: Jeroen Bakker
Date:   Wed Jan 5 14:17:14 2022 +0100
Branches: tmp-gpu-shader-descriptor-2
https://developer.blender.org/rB60f7652a9285601fa32dae199c449cafdaac219f

Reduce compile units for shader_builder.

===================================================================

M	source/blender/gpu/CMakeLists.txt
M	source/blender/gpu/intern/gpu_shader_builder.cc
D	source/blender/gpu/intern/gpu_shader_builder.hh
D	source/blender/gpu/intern/gpu_shader_builder_main.cc
R100	source/blender/gpu/intern/gpu_shader_builder_stubs.hh	source/blender/gpu/intern/gpu_shader_builder_stubs.cc

===================================================================

diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt
index 35103075e7f..d8ccc00af24 100644
--- a/source/blender/gpu/CMakeLists.txt
+++ b/source/blender/gpu/CMakeLists.txt
@@ -454,8 +454,8 @@ set(GPU_SHADER_INFO_SRC
 
 if(WITH_GPU_SHADER_BUILDER)
   add_executable(shader_builder
-    intern/gpu_shader_builder_main.cc
     intern/gpu_shader_builder.cc
+    intern/gpu_shader_builder_stubs.cc
     intern/gpu_shader_info_baked_stub.cc
     ${shader_create_info_list_file}
   )
diff --git a/source/blender/gpu/intern/gpu_shader_builder.cc b/source/blender/gpu/intern/gpu_shader_builder.cc
index d81f9a48ede..2a99bbf94fc 100644
--- a/source/blender/gpu/intern/gpu_shader_builder.cc
+++ b/source/blender/gpu/intern/gpu_shader_builder.cc
@@ -25,8 +25,6 @@
 
 #include <iostream>
 
-#include "gpu_shader_builder.hh"
-
 #include "GHOST_C-api.h"
 
 #include "GPU_context.h"
@@ -49,24 +47,6 @@ class ShaderBuilder {
   void exit();
 };
 
-int main(int argc, const char *argv[])
-{
-  printf("shader-builder started\n");
-  if (argc < 2) {
-    printf("Usage: shader_builder <data_file_to>\n");
-    exit(1);
-  }
-
-  (void)argv;
-
-  ShaderBuilder builder;
-  builder.init();
-  builder.bake_create_infos();
-  builder.exit();
-
-  return 0;
-}
-
 void ShaderBuilder::bake_create_infos()
 {
   gpu_shader_create_info_compile_all();
@@ -99,3 +79,19 @@ void ShaderBuilder::exit()
 }
 
 }  // namespace blender::gpu::shader_builder
+
+/** \brief Entry point for the shader_builder. */
+int main(int argc, const char *argv[])
+{
+  if (argc < 2) {
+    printf("Usage: %s <data_file_to>\n", argv[0]);
+    exit(1);
+  }
+
+  blender::gpu::shader_builder::ShaderBuilder builder;
+  builder.init();
+  builder.bake_create_infos();
+  builder.exit();
+
+  return 0;
+}
diff --git a/source/blender/gpu/intern/gpu_shader_builder.hh b/source/blender/gpu/intern/gpu_shader_builder.hh
deleted file mode 100644
index b6e5b7502e7..00000000000
--- a/source/blender/gpu/intern/gpu_shader_builder.hh
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2021 Blender Foundation.
- * All rights reserved.
- */
-
-/** \file
- * \ingroup gpu
- *
- * Compile time automation of shader compilation and validation.
- */
-
-#pragma once
-
-namespace blender::gpu::shader_builder {
-
-/** \brief Entry point for the shader_builder executable. */
-int main(int argc, const char *argv[]);
-
-}  // namespace blender::gpu::shader_builder
\ No newline at end of file
diff --git a/source/blender/gpu/intern/gpu_shader_builder_main.cc b/source/blender/gpu/intern/gpu_shader_builder_main.cc
deleted file mode 100644
index f7ce43ffd52..00000000000
--- a/source/blender/gpu/intern/gpu_shader_builder_main.cc
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2021 Blender Foundation.
- * All rights reserved.
- */
-
-/** \file
- * \ingroup gpu
- *
- * Entry point of the shader_builder executable.
- */
-#include <cstdio>
-#include <cstdlib>
-
-#include "gpu_shader_builder.hh"
-#include "gpu_shader_builder_stubs.hh"
-
-int main(int argc, char const *argv[])
-{
-  return blender::gpu::shader_builder::main(argc, argv);
-}
diff --git a/source/blender/gpu/intern/gpu_shader_builder_stubs.hh b/source/blender/gpu/intern/gpu_shader_builder_stubs.cc
similarity index 100%
rename from source/blender/gpu/intern/gpu_shader_builder_stubs.hh
rename to source/blender/gpu/intern/gpu_shader_builder_stubs.cc



More information about the Bf-blender-cvs mailing list