From 8fe26c8a106dccb5d2d671094877382559e52969 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Fri, 6 Oct 2023 20:46:23 +0900 Subject: [PATCH] d3d11: Simplify HLSL build Unify source/header/entrypoint names Part-of: --- .../sys/d3d11/gstd3d11pluginutils.cpp | 2 +- .../{ps-checker.hlsl => PSMain_checker.hlsl} | 0 ...ker-luma.hlsl => PSMain_checker_luma.hlsl} | 0 ...ecker-rgb.hlsl => PSMain_checker_rgb.hlsl} | 0 ...ker-vuya.hlsl => PSMain_checker_vuya.hlsl} | 0 .../hlsl/{ps-color.hlsl => PSMain_color.hlsl} | 0 .../{ps-sample.hlsl => PSMain_sample.hlsl} | 0 ...-premul.hlsl => PSMain_sample_premul.hlsl} | 0 .../hlsl/{ps-snow.hlsl => PSMain_snow.hlsl} | 0 .../hlsl/{vs-color.hlsl => VSMain_color.hlsl} | 0 .../hlsl/{vs-coord.hlsl => VSMain_coord.hlsl} | 0 .../hlsl/{vs-pos.hlsl => VSMain_pos.hlsl} | 0 ...{gstd3d11-hlsl.h => gstd3d11plugin-hlsl.h} | 44 +++++++++---------- .../sys/d3d11/hlsl/meson.build | 33 +++++++------- 14 files changed, 40 insertions(+), 39 deletions(-) rename subprojects/gst-plugins-bad/sys/d3d11/hlsl/{ps-checker.hlsl => PSMain_checker.hlsl} (100%) rename subprojects/gst-plugins-bad/sys/d3d11/hlsl/{ps-checker-luma.hlsl => PSMain_checker_luma.hlsl} (100%) rename subprojects/gst-plugins-bad/sys/d3d11/hlsl/{ps-checker-rgb.hlsl => PSMain_checker_rgb.hlsl} (100%) rename subprojects/gst-plugins-bad/sys/d3d11/hlsl/{ps-checker-vuya.hlsl => PSMain_checker_vuya.hlsl} (100%) rename subprojects/gst-plugins-bad/sys/d3d11/hlsl/{ps-color.hlsl => PSMain_color.hlsl} (100%) rename subprojects/gst-plugins-bad/sys/d3d11/hlsl/{ps-sample.hlsl => PSMain_sample.hlsl} (100%) rename subprojects/gst-plugins-bad/sys/d3d11/hlsl/{ps-sample-premul.hlsl => PSMain_sample_premul.hlsl} (100%) rename subprojects/gst-plugins-bad/sys/d3d11/hlsl/{ps-snow.hlsl => PSMain_snow.hlsl} (100%) rename subprojects/gst-plugins-bad/sys/d3d11/hlsl/{vs-color.hlsl => VSMain_color.hlsl} (100%) rename subprojects/gst-plugins-bad/sys/d3d11/hlsl/{vs-coord.hlsl => VSMain_coord.hlsl} (100%) rename subprojects/gst-plugins-bad/sys/d3d11/hlsl/{vs-pos.hlsl => VSMain_pos.hlsl} (100%) rename subprojects/gst-plugins-bad/sys/d3d11/hlsl/{gstd3d11-hlsl.h => gstd3d11plugin-hlsl.h} (66%) diff --git a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11pluginutils.cpp b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11pluginutils.cpp index 25d0dc8b07..29a001db50 100644 --- a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11pluginutils.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11pluginutils.cpp @@ -28,7 +28,7 @@ #include #include -#include "hlsl/gstd3d11-hlsl.h" +#include "hlsl/gstd3d11plugin-hlsl.h" GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_plugin_utils_debug); #define GST_CAT_DEFAULT gst_d3d11_plugin_utils_debug diff --git a/subprojects/gst-plugins-bad/sys/d3d11/hlsl/ps-checker.hlsl b/subprojects/gst-plugins-bad/sys/d3d11/hlsl/PSMain_checker.hlsl similarity index 100% rename from subprojects/gst-plugins-bad/sys/d3d11/hlsl/ps-checker.hlsl rename to subprojects/gst-plugins-bad/sys/d3d11/hlsl/PSMain_checker.hlsl diff --git a/subprojects/gst-plugins-bad/sys/d3d11/hlsl/ps-checker-luma.hlsl b/subprojects/gst-plugins-bad/sys/d3d11/hlsl/PSMain_checker_luma.hlsl similarity index 100% rename from subprojects/gst-plugins-bad/sys/d3d11/hlsl/ps-checker-luma.hlsl rename to subprojects/gst-plugins-bad/sys/d3d11/hlsl/PSMain_checker_luma.hlsl diff --git a/subprojects/gst-plugins-bad/sys/d3d11/hlsl/ps-checker-rgb.hlsl b/subprojects/gst-plugins-bad/sys/d3d11/hlsl/PSMain_checker_rgb.hlsl similarity index 100% rename from subprojects/gst-plugins-bad/sys/d3d11/hlsl/ps-checker-rgb.hlsl rename to subprojects/gst-plugins-bad/sys/d3d11/hlsl/PSMain_checker_rgb.hlsl diff --git a/subprojects/gst-plugins-bad/sys/d3d11/hlsl/ps-checker-vuya.hlsl b/subprojects/gst-plugins-bad/sys/d3d11/hlsl/PSMain_checker_vuya.hlsl similarity index 100% rename from subprojects/gst-plugins-bad/sys/d3d11/hlsl/ps-checker-vuya.hlsl rename to subprojects/gst-plugins-bad/sys/d3d11/hlsl/PSMain_checker_vuya.hlsl diff --git a/subprojects/gst-plugins-bad/sys/d3d11/hlsl/ps-color.hlsl b/subprojects/gst-plugins-bad/sys/d3d11/hlsl/PSMain_color.hlsl similarity index 100% rename from subprojects/gst-plugins-bad/sys/d3d11/hlsl/ps-color.hlsl rename to subprojects/gst-plugins-bad/sys/d3d11/hlsl/PSMain_color.hlsl diff --git a/subprojects/gst-plugins-bad/sys/d3d11/hlsl/ps-sample.hlsl b/subprojects/gst-plugins-bad/sys/d3d11/hlsl/PSMain_sample.hlsl similarity index 100% rename from subprojects/gst-plugins-bad/sys/d3d11/hlsl/ps-sample.hlsl rename to subprojects/gst-plugins-bad/sys/d3d11/hlsl/PSMain_sample.hlsl diff --git a/subprojects/gst-plugins-bad/sys/d3d11/hlsl/ps-sample-premul.hlsl b/subprojects/gst-plugins-bad/sys/d3d11/hlsl/PSMain_sample_premul.hlsl similarity index 100% rename from subprojects/gst-plugins-bad/sys/d3d11/hlsl/ps-sample-premul.hlsl rename to subprojects/gst-plugins-bad/sys/d3d11/hlsl/PSMain_sample_premul.hlsl diff --git a/subprojects/gst-plugins-bad/sys/d3d11/hlsl/ps-snow.hlsl b/subprojects/gst-plugins-bad/sys/d3d11/hlsl/PSMain_snow.hlsl similarity index 100% rename from subprojects/gst-plugins-bad/sys/d3d11/hlsl/ps-snow.hlsl rename to subprojects/gst-plugins-bad/sys/d3d11/hlsl/PSMain_snow.hlsl diff --git a/subprojects/gst-plugins-bad/sys/d3d11/hlsl/vs-color.hlsl b/subprojects/gst-plugins-bad/sys/d3d11/hlsl/VSMain_color.hlsl similarity index 100% rename from subprojects/gst-plugins-bad/sys/d3d11/hlsl/vs-color.hlsl rename to subprojects/gst-plugins-bad/sys/d3d11/hlsl/VSMain_color.hlsl diff --git a/subprojects/gst-plugins-bad/sys/d3d11/hlsl/vs-coord.hlsl b/subprojects/gst-plugins-bad/sys/d3d11/hlsl/VSMain_coord.hlsl similarity index 100% rename from subprojects/gst-plugins-bad/sys/d3d11/hlsl/vs-coord.hlsl rename to subprojects/gst-plugins-bad/sys/d3d11/hlsl/VSMain_coord.hlsl diff --git a/subprojects/gst-plugins-bad/sys/d3d11/hlsl/vs-pos.hlsl b/subprojects/gst-plugins-bad/sys/d3d11/hlsl/VSMain_pos.hlsl similarity index 100% rename from subprojects/gst-plugins-bad/sys/d3d11/hlsl/vs-pos.hlsl rename to subprojects/gst-plugins-bad/sys/d3d11/hlsl/VSMain_pos.hlsl diff --git a/subprojects/gst-plugins-bad/sys/d3d11/hlsl/gstd3d11-hlsl.h b/subprojects/gst-plugins-bad/sys/d3d11/hlsl/gstd3d11plugin-hlsl.h similarity index 66% rename from subprojects/gst-plugins-bad/sys/d3d11/hlsl/gstd3d11-hlsl.h rename to subprojects/gst-plugins-bad/sys/d3d11/hlsl/gstd3d11plugin-hlsl.h index 3d356d7050..140836f929 100644 --- a/subprojects/gst-plugins-bad/sys/d3d11/hlsl/gstd3d11-hlsl.h +++ b/subprojects/gst-plugins-bad/sys/d3d11/hlsl/gstd3d11plugin-hlsl.h @@ -20,17 +20,17 @@ #pragma once #ifdef HLSL_PRECOMPILED -#include "ps-checker-luma.h" -#include "ps-checker-rgb.h" -#include "ps-checker-vuya.h" -#include "ps-checker.h" -#include "ps-color.h" -#include "ps-sample-premul.h" -#include "ps-sample.h" -#include "ps-snow.h" -#include "vs-color.h" -#include "vs-coord.h" -#include "vs-pos.h" +#include "PSMain_checker_luma.h" +#include "PSMain_checker_rgb.h" +#include "PSMain_checker_vuya.h" +#include "PSMain_checker.h" +#include "PSMain_color.h" +#include "PSMain_sample_premul.h" +#include "PSMain_sample.h" +#include "PSMain_snow.h" +#include "VSMain_color.h" +#include "VSMain_coord.h" +#include "VSMain_pos.h" #else const BYTE g_PSMain_checker_luma[] = { 0 }; const BYTE g_PSMain_checker_rgb[] = { 0 }; @@ -45,14 +45,14 @@ const BYTE g_VSMain_coord[] = { 0 }; const BYTE g_VSMain_pos[] = { 0 }; #endif -#include "ps-checker-luma.hlsl" -#include "ps-checker-rgb.hlsl" -#include "ps-checker-vuya.hlsl" -#include "ps-checker.hlsl" -#include "ps-color.hlsl" -#include "ps-sample-premul.hlsl" -#include "ps-sample.hlsl" -#include "ps-snow.hlsl" -#include "vs-color.hlsl" -#include "vs-coord.hlsl" -#include "vs-pos.hlsl" +#include "PSMain_checker_luma.hlsl" +#include "PSMain_checker_rgb.hlsl" +#include "PSMain_checker_vuya.hlsl" +#include "PSMain_checker.hlsl" +#include "PSMain_color.hlsl" +#include "PSMain_sample_premul.hlsl" +#include "PSMain_sample.hlsl" +#include "PSMain_snow.hlsl" +#include "VSMain_color.hlsl" +#include "VSMain_coord.hlsl" +#include "VSMain_pos.hlsl" diff --git a/subprojects/gst-plugins-bad/sys/d3d11/hlsl/meson.build b/subprojects/gst-plugins-bad/sys/d3d11/hlsl/meson.build index 7f1d3b2117..9c47250dc3 100644 --- a/subprojects/gst-plugins-bad/sys/d3d11/hlsl/meson.build +++ b/subprojects/gst-plugins-bad/sys/d3d11/hlsl/meson.build @@ -1,28 +1,29 @@ hlsl_sources = [ - ['ps-checker-luma', 'PSMain_checker_luma', 'ps_5_0'], - ['ps-checker-rgb', 'PSMain_checker_rgb', 'ps_5_0'], - ['ps-checker-vuya', 'PSMain_checker_vuya', 'ps_5_0'], - ['ps-checker', 'PSMain_checker', 'ps_5_0'], - ['ps-color', 'PSMain_color', 'ps_5_0'], - ['ps-sample-premul', 'PSMain_sample_premul', 'ps_5_0'], - ['ps-sample', 'PSMain_sample', 'ps_5_0'], - ['ps-snow', 'PSMain_snow', 'ps_5_0'], - ['vs-color', 'VSMain_color', 'vs_5_0'], - ['vs-coord', 'VSMain_coord', 'vs_5_0'], - ['vs-pos', 'VSMain_pos', 'vs_5_0'], + ['PSMain_checker_luma', 'ps_5_0'], + ['PSMain_checker_rgb', 'ps_5_0'], + ['PSMain_checker_vuya', 'ps_5_0'], + ['PSMain_checker', 'ps_5_0'], + ['PSMain_color', 'ps_5_0'], + ['PSMain_sample_premul', 'ps_5_0'], + ['PSMain_sample', 'ps_5_0'], + ['PSMain_snow', 'ps_5_0'], + ['VSMain_color', 'vs_5_0'], + ['VSMain_coord', 'vs_5_0'], + ['VSMain_pos', 'vs_5_0'], ] foreach shader : hlsl_sources - basename = shader.get(0) - source = files('@0@.hlsl'.format(basename)) - header = '@0@.h'.format(basename) + entry_point = shader.get(0) + source = files('@0@.hlsl'.format(entry_point)) + header = '@0@.h'.format(entry_point) compiled_shader = custom_target(header, input : source, output : header, command : [fxc, '/Fh', '@OUTPUT@', - '/E', shader.get(1), - '/T', shader.get(2), + '/E', entry_point, + '/T', shader.get(1), '/D', 'BUILDING_HLSL=1', + '/nologo', '@INPUT@']) hlsl_precompiled += [compiled_shader] endforeach