d3d11: Simplify HLSL build

Unify source/header/entrypoint names

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5457>
This commit is contained in:
Seungha Yang 2023-10-06 20:46:23 +09:00 committed by GStreamer Marge Bot
parent a56aabc773
commit 8fe26c8a10
14 changed files with 40 additions and 39 deletions

View file

@ -28,7 +28,7 @@
#include <versionhelpers.h> #include <versionhelpers.h>
#include <wrl.h> #include <wrl.h>
#include "hlsl/gstd3d11-hlsl.h" #include "hlsl/gstd3d11plugin-hlsl.h"
GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_plugin_utils_debug); GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_plugin_utils_debug);
#define GST_CAT_DEFAULT gst_d3d11_plugin_utils_debug #define GST_CAT_DEFAULT gst_d3d11_plugin_utils_debug

View file

@ -20,17 +20,17 @@
#pragma once #pragma once
#ifdef HLSL_PRECOMPILED #ifdef HLSL_PRECOMPILED
#include "ps-checker-luma.h" #include "PSMain_checker_luma.h"
#include "ps-checker-rgb.h" #include "PSMain_checker_rgb.h"
#include "ps-checker-vuya.h" #include "PSMain_checker_vuya.h"
#include "ps-checker.h" #include "PSMain_checker.h"
#include "ps-color.h" #include "PSMain_color.h"
#include "ps-sample-premul.h" #include "PSMain_sample_premul.h"
#include "ps-sample.h" #include "PSMain_sample.h"
#include "ps-snow.h" #include "PSMain_snow.h"
#include "vs-color.h" #include "VSMain_color.h"
#include "vs-coord.h" #include "VSMain_coord.h"
#include "vs-pos.h" #include "VSMain_pos.h"
#else #else
const BYTE g_PSMain_checker_luma[] = { 0 }; const BYTE g_PSMain_checker_luma[] = { 0 };
const BYTE g_PSMain_checker_rgb[] = { 0 }; const BYTE g_PSMain_checker_rgb[] = { 0 };
@ -45,14 +45,14 @@ const BYTE g_VSMain_coord[] = { 0 };
const BYTE g_VSMain_pos[] = { 0 }; const BYTE g_VSMain_pos[] = { 0 };
#endif #endif
#include "ps-checker-luma.hlsl" #include "PSMain_checker_luma.hlsl"
#include "ps-checker-rgb.hlsl" #include "PSMain_checker_rgb.hlsl"
#include "ps-checker-vuya.hlsl" #include "PSMain_checker_vuya.hlsl"
#include "ps-checker.hlsl" #include "PSMain_checker.hlsl"
#include "ps-color.hlsl" #include "PSMain_color.hlsl"
#include "ps-sample-premul.hlsl" #include "PSMain_sample_premul.hlsl"
#include "ps-sample.hlsl" #include "PSMain_sample.hlsl"
#include "ps-snow.hlsl" #include "PSMain_snow.hlsl"
#include "vs-color.hlsl" #include "VSMain_color.hlsl"
#include "vs-coord.hlsl" #include "VSMain_coord.hlsl"
#include "vs-pos.hlsl" #include "VSMain_pos.hlsl"

View file

@ -1,28 +1,29 @@
hlsl_sources = [ hlsl_sources = [
['ps-checker-luma', 'PSMain_checker_luma', 'ps_5_0'], ['PSMain_checker_luma', 'ps_5_0'],
['ps-checker-rgb', 'PSMain_checker_rgb', 'ps_5_0'], ['PSMain_checker_rgb', 'ps_5_0'],
['ps-checker-vuya', 'PSMain_checker_vuya', 'ps_5_0'], ['PSMain_checker_vuya', 'ps_5_0'],
['ps-checker', 'PSMain_checker', 'ps_5_0'], ['PSMain_checker', 'ps_5_0'],
['ps-color', 'PSMain_color', 'ps_5_0'], ['PSMain_color', 'ps_5_0'],
['ps-sample-premul', 'PSMain_sample_premul', 'ps_5_0'], ['PSMain_sample_premul', 'ps_5_0'],
['ps-sample', 'PSMain_sample', 'ps_5_0'], ['PSMain_sample', 'ps_5_0'],
['ps-snow', 'PSMain_snow', 'ps_5_0'], ['PSMain_snow', 'ps_5_0'],
['vs-color', 'VSMain_color', 'vs_5_0'], ['VSMain_color', 'vs_5_0'],
['vs-coord', 'VSMain_coord', 'vs_5_0'], ['VSMain_coord', 'vs_5_0'],
['vs-pos', 'VSMain_pos', 'vs_5_0'], ['VSMain_pos', 'vs_5_0'],
] ]
foreach shader : hlsl_sources foreach shader : hlsl_sources
basename = shader.get(0) entry_point = shader.get(0)
source = files('@0@.hlsl'.format(basename)) source = files('@0@.hlsl'.format(entry_point))
header = '@0@.h'.format(basename) header = '@0@.h'.format(entry_point)
compiled_shader = custom_target(header, compiled_shader = custom_target(header,
input : source, input : source,
output : header, output : header,
command : [fxc, '/Fh', '@OUTPUT@', command : [fxc, '/Fh', '@OUTPUT@',
'/E', shader.get(1), '/E', entry_point,
'/T', shader.get(2), '/T', shader.get(1),
'/D', 'BUILDING_HLSL=1', '/D', 'BUILDING_HLSL=1',
'/nologo',
'@INPUT@']) '@INPUT@'])
hlsl_precompiled += [compiled_shader] hlsl_precompiled += [compiled_shader]
endforeach endforeach