Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/vlc
  • chouquette/vlc
  • bakiewicz.marek122/vlc
  • devnexen/vlc
  • rohanrajpal/vlc
  • blurrrb/vlc
  • gsoc/gsoc2019/darkapex/vlc
  • b1ue/vlc
  • fkuehne/vlc
  • magsoft/vlc
  • chub/vlc
  • cramiro9/vlc
  • robUx4/vlc
  • rom1v/vlc
  • akshayaky/vlc
  • tmk907/vlc
  • akymaster/vlc
  • govind.sharma/vlc
  • psilokos/vlc
  • xjbeta/vlc
  • jahan/vlc
  • 1480c1/vlc
  • amanchande/vlc
  • aaqib/vlc
  • rist/vlc
  • apol/vlc
  • mindfreeze/vlc
  • alexandre-janniaux/vlc
  • sandsmark/vlc
  • jagannatharjun/vlc
  • gsoc/gsoc2020/matiaslgonzalez/vlc
  • gsoc/gsoc2020/jagannatharjun/vlc
  • mstorsjo/vlc
  • gsoc/gsoc2020/vedenta/vlc
  • gsoc/gsoc2020/arnav-ishaan/vlc
  • gsoc/gsoc2020/andreduong/vlc
  • fuzun/vlc
  • gsoc/gsoc2020/vatsin/vlc
  • gsoc/gsoc2020/sagid/vlc
  • yaron/vlc
  • Phoenix/vlc
  • Garf/vlc
  • ePiratWorkarounds/vlc
  • tguillem/vlc
  • jnqnfe/vlc
  • mdc/vlc
  • Vedaa/vlc
  • rasa/vlc
  • quink/vlc
  • yealo/vlc
  • aleksey_ak/vlc
  • ePirat/vlc
  • ilya.yanok/vlc
  • asenat/vlc
  • m/vlc
  • bunjee/vlc
  • BLumia/vlc
  • sagudev/vlc
  • hamedmonji30/vlc
  • nullgemm/vlc
  • DivyamAhuja/vlc
  • thesamesam/vlc
  • dag7/vlc
  • snehil101/vlc
  • haasn/vlc
  • jbk/vlc
  • ValZapod/vlc
  • mfkl/vlc
  • WangChuan/vlc
  • core1024/vlc
  • GhostVaibhav/vlc
  • dfuhrmann/vlc
  • davide.prade/vlc
  • tmatth/vlc
  • Courmisch/vlc
  • zouya/vlc
  • hpi/vlc
  • EwoutH/vlc
  • aleung27/vlc
  • hengwu0/vlc
  • saladin/vlc
  • ashuio/vlc
  • richselwood/vlc
  • verma16Ayush/vlc
  • chemicalflash/vlc
  • PoignardAzur/vlc
  • huangjieNT/vlc
  • Blake-Haydon/vlc
  • AnuthaDev/vlc
  • gsoc/gsoc2021/mpd/vlc
  • nicolas_lequec/vlc
  • sambassaly/vlc
  • thresh/vlc
  • bonniegong/vlc
  • myaashish/vlc
  • stavros.vagionitis/vlc
  • ileoo/vlc
  • louis-santucci/vlc
  • cchristiansen/vlc
  • sabyasachi07/vlc
  • AbduAmeen/vlc
  • ashishb0410/vlc
  • urbanhusky/vlc
  • davidepietrasanta/vlc
  • riksleutelstad/vlc
  • jeremyVignelles/vlc
  • komh/vlc
  • iamjithinjohn/vlc
  • JohannesKauffmann/vlc2
  • kunglao/vlc
  • natzberg/vlc
  • jill/vlc
  • cwendling/vlc
  • adufou/vlc
  • ErwanAirone/vlc
  • HasinduDilshan10/vlc
  • vagrantc/vlc
  • rafiv/macos-bigsur-icon
  • Aymeriic/vlc
  • saranshg20/vlc
  • metzlove24/vlc
  • linkfanel/vlc
  • Ds886/vlc
  • metehan-arslan/vlc
  • Skantes/vlc
  • kgsandundananjaya96/vlc
  • mitchcapper/vlc
  • advaitgupta/vlc
  • StefanBruens/vlc
  • ratajs/vlc
  • T.M.F.B.3761/vlc
  • m222059/vlc
  • casemerrick/vlc
  • joshuaword2alt/vlc
  • sjwaddy/vlc
  • dima/vlc
  • Ybalrid/vlc
  • umxprime/vlc
  • eschmidt/vlc
  • vannieuwenhuysenmichelle/vlc
  • badcf00d/vlc
  • wesinator/vlc
  • louis/vlc
  • xqq/vlc
  • EmperorYP7/vlc
  • NicoLiam/vlc
  • loveleen/vlc
  • rofferom/vlc
  • rbultje/vlc
  • TheUnamed/vlc
  • pratiksharma341/vlc
  • Saurab17/vlc
  • purist.coder/vlc
  • Shuicheng/vlc
  • mdrrubel292/vlc
  • silverbleu00/vlc
  • metif12/vlc
  • asher-m/vlc
  • jeffk/vlc
  • Brandonbr1/vlc
  • beautyyuyanli/vlc
  • rego21/vlc
  • muyangren907/vlc
  • collectionbylawrencejason/vlc
  • evelez/vlc
  • GSMgeeth/vlc
  • Oneric/vlc
  • TJ5/vlc
  • XuanTung95/vlc
  • darrenjenny21/vlc
  • Trenly/vlc
  • RockyTDR/vlc
  • mjakubowski/vlc
  • caprica/vlc
  • ForteFrankie/vlc
  • seannamiller19/vlc
  • junlon2006/vlc
  • kiwiren6666/vlc
  • iuseiphonexs/vlc
  • fenngtun/vlc
  • Rajdutt999/vlc
  • typx/vlc
  • leon.vitanos/vlc
  • robertogarci0938/vlc
  • gsoc/gsoc2022/luc65r/vlc-mpd
  • skeller/vlc
  • MCJack123/vlc
  • luc65r/vlc-mpd
  • popov895/vlc
  • claucambra/vlc
  • brad/vlc
  • matthewmurua88/vlc
  • Tomas8874/vlc
  • philenotfound/vlc
  • makita-do3/vlc
  • LZXCorp/vlc
  • mar0x/vlc
  • senojetkennedy0102/vlc
  • shaneb243/vlc
  • ahmadbader/vlc
  • rajduttcse26/vlc-audio-filters
  • Juniorzito8415/vlc
  • achernyakov/vlc
  • lucasjetgroup/vlc
  • pupdoggy666/vlc
  • gmde9363/vlc
  • alexnwayne/vlc
  • bahareebrahimi781/vlc
  • hamad633666/vlc
  • umghof3112/vlc
  • joe0199771874/vlc
  • Octocats66666666/vlc
  • jjm_223/vlc
  • btech10110.19/vlc
  • sunnykfc028/vlc-audio-filters
  • loic/vlc
  • nguyenminhducmx1/vlc
  • JanekKrueger/vlc
  • bstubbington2/vlc
  • rcombs/vlc
  • Ordissimo/vlc
  • king7532/vlc
  • noobsauce101/vlc
  • schong0525/vlc
  • myQwil/vlc
  • apisbg91/vlc
  • geeboy0101017/vlc
  • kim.faughey/vlc
  • nurupo/vlc
  • yyusea/vlc
  • 0711235879.khco/vlc
  • ialo/vlc
  • iloveyeye2/vlc
  • gdtdftdqtd/vlc
  • leandroconsiglio/vlc
  • AndyHTML2012/vlc
  • ncz/vlc
  • lucenticus/vlc
  • knr1931/vlc
  • kjoonlee/vlc
  • chandrakant100/vlc-qt
  • johge42/vlc
  • polter/vlc
  • hexchain/vlc
  • Tushwrld/vlc
  • mztea928/vlc
  • jbelloncastro/vlc
  • alvinhochun/vlc
  • ghostpiratecrow/vlc
  • ujjwaltwitx/vlc
  • alexsonarin06/vlc
  • adrianbon76/vlc
  • altsod/vlc
  • damien.lucas44/vlc
  • dmytrivtaisa/vlc
  • utk202/vlc
  • aaxhrj/vlc
  • thomas.hermes/vlc
  • structurenewworldorder/vlc
  • slomo/vlc
  • wantlamy/vlc
  • musc.o3cminc/vlc
  • thebarshablog/vlc
  • kerrick/vlc
  • kratos142518/vlc
  • leogps/vlc
  • vacantron/vlc
  • luna_koly/vlc
  • Ratio2/vlc
  • anuoshemohammad/vlc
  • apsun/vlc
  • aaa1115910/vlc
  • alimotmoyo/vlc
  • Ambossmann/vlc
  • Sam-LearnsToCode/vlc
  • Chilledheart/vlc
  • Labnann/vlc
  • ktcoooot1/vlc
  • mohit-marathe/vlc
  • johnddx/vlc
  • manstabuk/vlc
  • Omar-ahmed314/vlc
  • vineethkm/vlc
  • 9Enemi86/vlc
  • radoslav.m.panteleev/vlc
  • ashishami2002/vlc
  • Corbax/vlc
  • firnasahmed/vlc
  • pelayarmalam4/vlc
  • c0ff330k/vlc
  • shikhindahikar/vlc
  • l342723951/vlc
  • christianschwandner/vlc
  • douniwan5788/vlc
  • 7damian7/vlc
  • ferdnyc/vlc
  • f.ales1/vlc
  • pandagby/vlc
  • BaaBaa/vlc
  • jewe37/vlc
  • w00drow/vlc
  • russelltg/vlc
  • ironicallygod/vlc
  • soumyaDghosh/vlc
  • linzihao1999/vlc
  • deyayush6/vlc
  • mibi88/vlc
  • newabdallah10/vlc
  • jhorbincolombia/vlc
  • rimvihaqueshupto/vlc
  • andrewkhon98/vlc
  • fab78/vlc
  • lapaz17/vlc
  • amanna13/vlc
  • mdakram28/vlc
  • 07jw1980/vlc
  • sohamgupta/vlc
  • Eson-Jia1/vlc
  • Sumou/vlc
  • vikram-kangotra/vlc
  • chalice191/vlc
  • olivercalder/vlc
  • aaasg4001/vlc
  • zipdox/vlc
  • kwizart/vlc
  • Dragon-S/vlc
  • jdemeule/vlc
  • gabriel_lt/vlc
  • locutusofborg/vlc
  • sammirata/vlc-librist
  • another/vlc
  • Benjamin_Loison/vlc
  • ahmedmoselhi/vlc
  • petergaal/vlc
  • huynhsontung/vlc
  • dariusmihut/vlc
  • tvermaashutosh/vlc
  • buti/vlc
  • Niram7777/vlc
  • rohan-here/vlc
  • balaji-sivasakthi/vlc
  • rlindner81/vlc
  • Kakadus/vlc
  • djain/vlc
  • ABBurmeister/vlc
  • craighuggins/vlc
  • orbea/vlc
  • maxos/vlc
  • aakarshmj/vlc
  • kblaschke/vlc
  • ankitm/vlc
  • advait-0/vlc
  • mohak2003/vlc
  • yselkowitz/vlc
  • AZM999/vlc-azm
  • andrey.turkin/vlc
  • Disha-Baghel/vlc
  • nowrep/vlc
  • Apeng/vlc
  • Choucroute_melba/vlc
  • autra/vlc
  • eclipseo/vlc
  • fhuber/vlc
  • olafhering/vlc
  • sdasda7777/vlc
  • 1div0/vlc
  • skosnits/vlc-extended-playlist-support
  • dnicolson/vlc
  • Timshel/vlc
  • octopols/vlc
  • MangalK/vlc
  • nima64/vlc
  • misawai/vlc
  • Alexander-Wilms/vlc
  • Maxime2/vlc-fork-for-visualizer
  • ww/vlc
  • jeske/vlc
  • sgross-emlix/vlc
  • morenonatural/vlc
  • freakingLovesVLC/vlc
  • borisgolovnev/vlc
  • mpromonet/vlc
  • diogo.simao-marques/vlc
  • masstock/vlc
  • pratikpatel8982/vlc
  • hugok79/vlc
  • longervision/vlc
  • abhiudaysurya/vlc
  • rishabhgarg/vlc
  • tumic/vlc
  • cart/vlc
  • shubham442/vlc
  • Aditya692005/vlc
  • sammirata/vlc4
  • syrykh/vlc
  • Vvorcun/macos-new-icon
  • AyaanshC/vlc
  • nasso/vlc
  • Quark/vlc
  • sebastinas/vlc
  • rhstone/vlc
  • talregev/vlc
  • Managor/vlc
403 results
Show changes
Commits on Source (7)
Showing with 321 additions and 323 deletions
......@@ -3959,6 +3959,7 @@ have_qt_quick_test="no"
have_qt_declarative_private="no"
have_qt_gui_private="no"
have_qt_core_private="no"
have_fxc="no"
AS_IF([test "${enable_qt}" != "no"], [
dnl Note that Qt < 6.2.5 does not provide pc files!
QT_MINIMUM_VERSION=6.2
......@@ -4048,6 +4049,13 @@ AS_IF([test "${enable_qt}" != "no"], [
],[
])
AC_PATH_PROGS(FXC, [fxc], [no], [${CONTRIB_DIR}/bin])
AS_IF([test "$FXC" != "no"],[
have_fxc="yes"
FXC_PATH=$(echo $FXC | head -c-5)
AC_SUBST([FXC_PATH])
])
dnl Check private headers availability
VLC_SAVE_FLAGS
CPPFLAGS="${CPPFLAGS} ${QT_CFLAGS}"
......@@ -4127,6 +4135,7 @@ AM_CONDITIONAL([HAVE_QT_QUICK_TEST], [test "${have_qt_quick_test}" = "yes"])
AM_CONDITIONAL([HAVE_QT_DECLARATIVE_PRIVATE], [test "${have_qt_declarative_private}" = "yes"])
AM_CONDITIONAL([HAVE_QT_GUI_PRIVATE], [test "${have_qt_gui_private}" = "yes"])
AM_CONDITIONAL([HAVE_QT_CORE_PRIVATE], [test "${have_qt_core_private}" = "yes"])
AM_CONDITIONAL([HAVE_FXC], [test "${have_fxc}" = "yes"])
dnl
dnl detect kde4-config patch (used for kde solids).
......
From f6c828b27699c7ee8bdd85b79ac519a13e8b3a57 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Fri, 19 Apr 2024 11:22:12 +0200
Subject: [PATCH 1/3] handle -O option to write to a binary file rather than a
header
---
fxc2.cpp | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/fxc2.cpp b/fxc2.cpp
index 205fa16..a4037af 100755
--- a/fxc2.cpp
+++ b/fxc2.cpp
@@ -79,6 +79,7 @@ int main(int argc, char* argv[])
D3D_SHADER_MACRO* defines = new D3D_SHADER_MACRO[numDefines];
defines[numDefines-1].Name = NULL;
defines[numDefines-1].Definition = NULL;
+ bool outputToHeader = true;
int i, c;
static struct option longOptions[] =
@@ -92,7 +93,7 @@ int main(int argc, char* argv[])
D3D_SHADER_MACRO* newDefines;
int optionIndex = 0;
- c = getopt_long_only (argc, argv, "T:E:D:V:F:",
+ c = getopt_long_only (argc, argv, "T:E:D:V:F:O:",
longOptions, &optionIndex);
/* Detect the end of the options. */
@@ -156,6 +157,7 @@ int main(int argc, char* argv[])
{
case 'h':
outputFile = strdup(&optarg[1]);
+ outputToHeader = true;
if(verbose) {
printf ("option -Fh (Output File) with arg %s\n", &optarg[1]);
}
@@ -166,6 +168,14 @@ int main(int argc, char* argv[])
}
break;
+ case 'O':
+ outputFile = strdup(&optarg[0]);
+ outputToHeader = false;
+ if(verbose) {
+ printf ("option -O (Output File) with arg %s\n", &optarg[0]);
+ }
+ break;
+
case '?':
default:
print_usage_arg();
@@ -315,8 +325,12 @@ int main(int argc, char* argv[])
int len = output->GetBufferSize();
FILE* f;
- errno_t err = fopen_s(&f, outputFile, "w");
+ const auto openMode = outputToHeader ? "wb" : "w";
+ errno_t err = fopen_s(&f, outputFile, openMode);
+ if (!outputToHeader) {
+ fwrite(outString, 1, len, f);
+ } else {
fprintf(f, "const BYTE %s[] =\n{\n", variableName);
for (i = 0; i < len; i++) {
fprintf(f, "%4i", outString[i]);
@@ -327,6 +341,7 @@ int main(int argc, char* argv[])
}
fprintf(f, "\n};");
+ }
fclose(f);
if(verbose) {
--
2.37.3.windows.1
From 7c502bc09182958fa7268bfa792a338891c3df7b Mon Sep 17 00:00:00 2001
From: Pierre Lamot <pierre.lamot@yahoo.fr>
Date: Mon, 14 Jan 2019 15:09:36 +0100
Subject: [PATCH 2/4] accept windows style flags and splitted argument value
- accept windows style flags: /opt or -opt
- accept split arguments : -FhFilename.h or -Fh Filename
---
fxc2.cpp | 194 +++++++++++++++++++++++++++----------------------------
1 file changed, 95 insertions(+), 99 deletions(-)
diff --git a/fxc2.cpp b/fxc2.cpp
index 066608c..01a8d07 100755
--- a/fxc2.cpp
+++ b/fxc2.cpp
@@ -2,7 +2,7 @@
#include <d3dcommon.h>
#include <direct.h>
#include <stdio.h>
-#include <getopt.h>
+#include <assert.h>
#include <string>
#include <wchar.h>
@@ -59,7 +58,41 @@ void print_usage_toomany() {
exit(1);
}
-int main(int argc, char* argv[])
+bool parseOpt( const char* option, int argc, const char** argv, int* index, char** argumentOption )
+{
+ assert(option != NULL);
+ if (!index || *index >= argc) {
+ return false;
+ }
+ const char* argument = argv[*index];
+ if (argument[0] == '-' || argument[0] == '/')
+ argument++;
+ else
+ return false;
+
+ size_t optionSize = strlen(option);
+ if (strncmp(argument, option, optionSize) != 0) {
+ return false;
+ }
+
+ if (argumentOption) {
+ argument += optionSize;
+ if (*argument == '\0') {
+ *index += 1;
+ if (*index >= argc) {
+ printf("Error: missing required argument for option %s\n", option);
+ return false;
+ }
+ *argumentOption = strdup(argv[*index]);
+ } else {
+ *argumentOption = strdup(argument);
+ }
+ }
+ *index += 1;
+ return true;
+}
+
+int main(int argc, const char* argv[])
{
// ====================================================================================
// Process Command Line Arguments
@@ -71,114 +104,77 @@ int main(int argc, char* argv[])
char* entryPoint = NULL;
char* variableName = NULL;
char* outputFile = NULL;
+ char* defineOption = NULL;
int numDefines = 1;
D3D_SHADER_MACRO* defines = new D3D_SHADER_MACRO[numDefines];
defines[numDefines-1].Name = NULL;
defines[numDefines-1].Definition = NULL;
- int i, c;
- static struct option longOptions[] =
- {
- /* These options set a flag. */
- {"nologo", no_argument, &verbose, 0},
- {0, 0, 0, 0}
- };
-
+ int index = 1;
while (1) {
D3D_SHADER_MACRO* newDefines;
- int optionIndex = 0;
- c = getopt_long_only (argc, argv, "T:E:D:V:F:",
- longOptions, &optionIndex);
-
/* Detect the end of the options. */
- if (c == -1)
+ if (index >= argc)
break;
- switch (c)
- {
- case 0:
- //printf ("option -nologo (quiet)\n");
- //Technically, this is any flag we define in longOptions
- break;
- case 'T':
- model = strdup(optarg);
- if(verbose) {
- printf ("option -T (Shader Model/Profile) with arg %s\n", optarg);
- }
- break;
- case 'E':
- entryPoint = strdup(optarg);
- if(verbose) {
- printf ("option -E (Entry Point) with arg %s\n", optarg);
- }
- break;
- case 'D':
- numDefines++;
- //Copy the old array into the new array, but put the new definition at the beginning
- newDefines = new D3D_SHADER_MACRO[numDefines];
- for(i=1; i<numDefines; i++)
- newDefines[i] = defines[i-1];
- delete[] defines;
- defines = newDefines;
- defines[0].Name = strdup(optarg);
- defines[0].Definition = "1";
+ if (parseOpt("nologo", argc, argv, &index, NULL)) {
+ continue;
+ } else if (parseOpt("T", argc, argv, &index, &model)) {
+ if(verbose) {
+ printf ("option -T (Shader Model/Profile) with arg '%s'\n", model);
+ }
+ continue;
+ } else if (parseOpt("E", argc, argv, &index, &entryPoint)) {
+ if(verbose) {
+ printf ("option -E (Entry Point) with arg '%s'\n", entryPoint);
+ }
+ continue;
+ } else if (parseOpt("D", argc, argv, &index, &defineOption)) {
+ numDefines++;
+ //Copy the old array into the new array, but put the new definition at the beginning
+ newDefines = new D3D_SHADER_MACRO[numDefines];
+ for(int i=1; i<numDefines; i++)
+ newDefines[i] = defines[i-1];
+ delete[] defines;
+ defines = newDefines;
+ defines[0].Name = defineOption;
+ defines[0].Definition = "1";
+ if(verbose) {
+ printf ("option -D with arg %s\n", defineOption);
+ }
+ continue;
+ } else if (parseOpt("Vn", argc, argv, &index, &variableName)) {
+ if(verbose) {
+ printf ("option -Vn (Variable Name) with arg '%s'\n", variableName);
+ }
+ continue;
+ } else if (parseOpt("Vi", argc, argv, &index, NULL)) {
+ if(verbose) {
+ printf("option -Vi (Output include process details) acknowledged but ignored.\n");
+ }
+ continue;
+ } else if (parseOpt("Fh", argc, argv, &index, &outputFile)) {
+ if(verbose) {
+ printf ("option -Fh (Output File) with arg %s\n", outputFile);
+ }
+ continue;
+ } else if (parseOpt("?", argc, argv, &index, NULL)) {
+ print_usage_arg();
+ continue;
+ } else {
+ if (!inputFile)
+ {
+ inputFile = new wchar_t[strlen(argv[index])+1];
+ mbstowcs(inputFile, argv[index], strlen(argv[index])+1);
if(verbose) {
- printf ("option -D with arg %s\n", optarg);
- }
- break;
-
- case 'V':
- switch(optarg[0])
- {
- case 'n':
- variableName = strdup(&optarg[1]);
- if(verbose) {
- printf ("option -Vn (Variable Name) with arg %s\n", &optarg[1]);
- }
- break;
- case 'i':
- if(verbose) {
- printf("option -Vi (Output include process details) acknowledged but ignored.\n");
- }
- break;
- default:
- print_usage_arg();
- break;
+ wprintf(L"input file: %ls\n", inputFile);
}
- break;
- case 'F':
- switch(optarg[0])
- {
- case 'h':
- outputFile = strdup(&optarg[1]);
- if(verbose) {
- printf ("option -Fh (Output File) with arg %s\n", &optarg[1]);
- }
- break;
- default:
- print_usage_arg();
- break;
- }
- break;
-
- case '?':
- default:
- print_usage_arg();
- break;
- }
- }
-
- if (optind < argc) {
- inputFile = new wchar_t[strlen(argv[optind])+1];
- mbstowcs(inputFile, argv[optind], strlen(argv[optind])+1);
- if(verbose) {
- wprintf(L"input file: %ls\n", inputFile);
- }
-
- optind++;
- if(optind < argc) {
- print_usage_toomany();
+ index += 1;
+ } else {
+ print_usage_toomany();
+ return 1;
+ }
}
}
@@ -243,7 +239,7 @@ int main(int argc, char* argv[])
wprintf(L"\t %ls,\n", inputFile);
printf("\t");
- for(i=0; i<numDefines-1; i++)
+ for(int i=0; i<numDefines-1; i++)
printf(" %s=%s", defines[i].Name, defines[i].Definition);
printf(",\n");
@@ -315,7 +311,7 @@ int main(int argc, char* argv[])
errno_t err = fopen_s(&f, outputFile, "w");
fprintf(f, "const signed char %s[] =\n{\n", variableName);
- for (i = 0; i < len; i++) {
+ for (int i = 0; i < len; i++) {
fprintf(f, "%4i", outString[i]);
if (i != len - 1)
fprintf(f, ",");
--
2.19.1
From 39629169b7c8c2cc7c2fe7fdd057132352482fec Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Fri, 19 Apr 2024 11:43:08 +0200
Subject: [PATCH 2/3] fix redefinition warning
---
fxc2.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fxc2.cpp b/fxc2.cpp
index 2b3f587..17b0ccb 100755
--- a/fxc2.cpp
+++ b/fxc2.cpp
@@ -11,7 +11,9 @@
#include <wchar.h>
+#ifndef D3D_COMPILE_STANDARD_FILE_INCLUDE
#define D3D_COMPILE_STANDARD_FILE_INCLUDE ((ID3DInclude*)(UINT_PTR)1)
+#endif
typedef HRESULT(__stdcall *pCompileFromFileg)(LPCWSTR,
const D3D_SHADER_MACRO[],
ID3DInclude*,
--
2.37.3.windows.1
From b21a639c2c79cf7543d57ef14fe79911ed6be7ae Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Fri, 19 Apr 2024 15:09:41 +0200
Subject: [PATCH 3/3] improve error messages after compilation
---
fxc2.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fxc2.cpp b/fxc2.cpp
index 17b0ccb..dbc5728 100755
--- a/fxc2.cpp
+++ b/fxc2.cpp
@@ -306,10 +306,10 @@ int main(int argc, char* argv[])
if (FAILED(hr)) {
if (errors) {
char* error = (char*)errors->GetBufferPointer();
- printf("Got an error (%i) while compiling:\n%s\n", hr, error);
+ printf("Got an error (0x%lX) while compiling: '%s'\n%s\n", hr, inputFile, error);
errors->Release();
} else {
- printf("Got an error (%i) while compiling, but no error message from the function.\n", hr);
+ printf("Got an error (0x%lX) while compiling '%s', but no error message from the function.\n", hr, inputFile);
LPSTR messageBuffer = nullptr;
size_t size = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
--
2.37.3.windows.1
From 24359310304ceee121489fd785fb31484cf36c0d Mon Sep 17 00:00:00 2001
From cff056e74403c99b8d672cce5b289615a4d7338f Mon Sep 17 00:00:00 2001
From: Pierre Lamot <pierre.lamot@yahoo.fr>
Date: Mon, 14 Jan 2019 15:37:02 +0100
Subject: [PATCH 4/4] Revert "Fix: narrowing conversion from 'int' to 'BYTE'"
......@@ -9,19 +9,19 @@ This reverts commit 82527b81104e5e21390d3ddcd328700c67ce73d4.
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/fxc2.cpp b/fxc2.cpp
index 01a8d07..ac17328 100755
index 5b8c86c..205fa16 100755
--- a/fxc2.cpp
+++ b/fxc2.cpp
@@ -310,7 +310,7 @@ int main(int argc, const char* argv[])
@@ -317,7 +317,7 @@ int main(int argc, char* argv[])
FILE* f;
errno_t err = fopen_s(&f, outputFile, "w");
- fprintf(f, "const signed char %s[] =\n{\n", variableName);
+ fprintf(f, "const BYTE %s[] =\n{\n", variableName);
for (int i = 0; i < len; i++) {
for (i = 0; i < len; i++) {
fprintf(f, "%4i", outString[i]);
if (i != len - 1)
@@ -319,7 +319,7 @@ int main(int argc, const char* argv[])
@@ -326,7 +326,7 @@ int main(int argc, char* argv[])
fprintf(f, "\n");
}
......@@ -31,5 +31,5 @@ index 01a8d07..ac17328 100755
if(verbose) {
--
2.19.1
2.37.3.windows.1
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
import platform
import subprocess
import shutil
def log_error(msg: str):
sys.stderr.write(msg + os.linesep)
def toSystemPath(path: str):
absPath = os.path.abspath(path)
if platform.system() == 'Windows':
return absPath
if platform.system() == 'Linux':
pathCmd = None
if shutil.which('cygpath'):
pathCmd = 'cygpath'
elif shutil.which('wslpath'):
pathCmd = 'wslpath'
else:
pathCmd = 'wine winepath'
# convert to hybrid mode to avoid forward slashes in shell
sub = subprocess.Popen([pathCmd, '-m', absPath], shell=False, stderr=subprocess.DEVNULL, stdout=subprocess.PIPE)
errcode = sub.wait()
if errcode != 0:
log_error('failed to find Windows path using {} for "{}"'.format(pathCmd, absPath))
exit(1)
p, err = sub.communicate()
return p.decode('utf-8').strip()
def main():
this_path = os.path.dirname(os.path.abspath(sys.argv[0]))
if (os.path.exists( os.path.join( this_path, 'fxc2.exe'))):
fxc2 = os.path.join( this_path, 'fxc2.exe')
elif (os.path.exists( os.path.join( this_path, 'fxc2'))):
fxc2 = os.path.join( this_path, 'fxc2')
else:
log_error('fxc2 not found in {}'.format(this_path))
exit(1)
nologo = False
optimized = True
entry_point = None
model = None
output_file = None
input_files = []
argi = 0
while argi < len(sys.argv)-1:
argi = argi+1
option = sys.argv[argi]
# --version
if option == '--version':
print('fxc wrapper 0.0.1')
exit(0)
# /nologo
if option == '/nologo' or option == '-nologo':
nologo = True
# /E
elif option == '/E' or option == '-E':
if argi+1 >= len(sys.argv):
log_error('missing /E parameter')
exit(1)
argi = argi+1
entry_point = sys.argv[argi]
# /T
elif option == '/T' or option == '-T':
if argi+1 >= len(sys.argv):
log_error('missing /T parameter')
exit(1)
argi = argi+1
model = sys.argv[argi]
# /Fo
elif option == '/Fo' or option == '-Fo':
if argi+1 >= len(sys.argv):
log_error('missing /Fo parameter')
exit(1)
argi = argi+1
output_file = sys.argv[argi]
output_mode = '-O'
# /Fh
elif option == '/Fh' or option == '-Fh':
if argi+1 >= len(sys.argv):
log_error('missing /Fo parameter')
exit(1)
argi = argi+1
output_file = sys.argv[argi]
output_mode = '-Fh'
# /Od
elif option == '/Od' or option == '-Od':
optimized = False
elif option.startswith('-'):
log_error('unknown option {}'.format(option))
exit(1)
elif option.startswith('/') and not os.path.exists(option):
log_error('unknown option {}'.format(option))
exit(1)
else:
input_files.append(option)
if len(input_files) == 0:
log_error('missing input file(s)')
exit(1)
fxc2_call = [ fxc2 ]
if nologo:
fxc2_call.append( '-nologo' )
if entry_point:
fxc2_call.append( '-E' )
fxc2_call.append( entry_point )
if model:
fxc2_call.append( '-T' )
fxc2_call.append( model )
if output_file:
fxc2_call.append( output_mode )
fxc2_call.append( toSystemPath(output_file) )
for input in input_files:
fxc2_call.append( toSystemPath(input) )
# disabling optimizations not supported by fxc2
# qsb used this to disable debugging(!)
# if not optimized:
# fxc2_call.append( '-Od' )
if platform.system() == 'Windows':
call = subprocess.Popen(fxc2_call, shell=False, stderr=subprocess.DEVNULL, stdout=subprocess.PIPE)
else:
if not nologo:
print('calling fxc2 through wine')
call = subprocess.Popen(['bash', '-c', 'wine ' +' '.join(fxc2_call)], shell=False, stderr=subprocess.DEVNULL, stdout=subprocess.PIPE)
errcode = call.wait()
p, err = call.communicate()
if not nologo:
print('fxc calling ' + ' '.join(fxc2_call))
if not nologo or errcode != 0:
lines = p.decode('utf-8')
print(lines)
exit(errcode)
if __name__ == "__main__":
main()
......@@ -2,14 +2,7 @@ FXC2_HASH := 654c29d62a02714ea0bacfb118c3e05127f846e0
FXC2_VERSION := git-$(FXC2_HASH)
FXC2_GITURL := $(GITHUB)/mozilla/fxc2.git
ifeq ($(findstring qt,$(PKGS)),)
# match with Qt targets
ifdef HAVE_WIN32
PKGS_TOOLS += fxc2
endif
endif
ifeq ($(call need_pkg,"fxc2"),)
ifneq ($(shell fxc --version >/dev/null 2>&1 || echo FAIL),)
PKGS_FOUND += fxc2
endif
......@@ -22,9 +15,12 @@ $(TARBALLS)/fxc2-$(FXC2_VERSION).tar.xz:
fxc2: fxc2-$(FXC2_VERSION).tar.xz .sum-fxc2
$(UNPACK)
cp $(SRC)/fxc2/fxc $(UNPACK_DIR)
$(APPLY) $(SRC)/fxc2/0001-make-Vn-argument-as-optional-and-provide-default-var.patch
$(APPLY) $(SRC)/fxc2/0002-accept-windows-style-flags-and-splitted-argument-val.patch
$(APPLY) $(SRC)/fxc2/0004-Revert-Fix-narrowing-conversion-from-int-to-BYTE.patch
$(APPLY) $(SRC)/fxc2/0001-handle-O-option-to-write-to-a-binary-file-rather-tha.patch
$(APPLY) $(SRC)/fxc2/0002-fix-redefinition-warning.patch
$(APPLY) $(SRC)/fxc2/0003-improve-error-messages-after-compilation.patch
$(MOVE)
ifeq ($(shell uname -m),aarch64)
......@@ -49,5 +45,8 @@ endif
.fxc2: fxc2
cd $< && $(FXC2_CXX) -static fxc2.cpp -o fxc2.exe
cd $< && mkdir -p $(PREFIX)/bin && cp fxc2.exe $(PREFIX)/bin && cp $(FXC2_DLL) $(PREFIX)/bin/d3dcompiler_47.dll
install -d "$(PREFIX)/bin" && \
install $</fxc2.exe "$(PREFIX)/bin" && \
install $</fxc "$(PREFIX)/bin" && \
install $</$(FXC2_DLL) "$(PREFIX)/bin/d3dcompiler_47.dll"
touch $@
From c596f3a817a22856e36db9df10615a8e722a33f7 Mon Sep 17 00:00:00 2001
From: Fatih Uzunoglu <fuzun54@outlook.com>
Date: Wed, 21 Feb 2024 20:27:36 +0200
Subject: [PATCH] Use fxc2 through wine instead of fxc
---
tools/qsb/qsb.cpp | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/tools/qsb/qsb.cpp b/tools/qsb/qsb.cpp
index bc38e14..d1a96fe 100644
--- a/tools/qsb/qsb.cpp
+++ b/tools/qsb/qsb.cpp
@@ -81,6 +81,7 @@ static bool runProcess(const QString &binary, const QStringList &arguments,
{
#if QT_CONFIG(process)
QProcess p;
+ p.setWorkingDirectory(QCoreApplication::applicationDirPath());
p.start(binary, arguments);
const QString cmd = binary + QLatin1Char(' ') + arguments.join(QLatin1Char(' '));
if (!silent)
@@ -820,14 +821,15 @@ int main(int argc, char **argv)
QLatin1String("/nologo"),
QLatin1String("/E"), QString::fromLocal8Bit(s.entryPoint()),
QLatin1String("/T"), QString::fromLocal8Bit(typeArg),
- QLatin1String("/Fo"), QDir::toNativeSeparators(tmpOut)
+ QLatin1String("/Fo"), "Z:" + QDir::toNativeSeparators(tmpOut)
});
if (cmdLineParser.isSet(debugInfoOption))
arguments << QLatin1String("/Od") << QLatin1String("/Zi");
- arguments.append(QDir::toNativeSeparators(tmpIn));
+ arguments.append("Z:" + QDir::toNativeSeparators(tmpIn));
QByteArray output;
QByteArray errorOutput;
- bool success = runProcess(QLatin1String("fxc"), arguments, &output, &errorOutput);
+ arguments.prepend(QStringLiteral("fxc2"));
+ bool success = runProcess(QLatin1String("wine"), arguments, &output, &errorOutput);
if (success) {
const QByteArray bytecode = readFile(tmpOut, FileType::Binary);
if (!bytecode.isEmpty())
--
2.43.1
......@@ -51,7 +51,6 @@ QT_SHADETOOLS_NATIVE_CONFIG := -DCMAKE_TOOLCHAIN_FILE=$(BUILDPREFIX)/lib/cmake/Q
qtshadertools: qtshadertools-everywhere-src-$(QTSHADERTOOLS_VERSION).tar.xz .sum-qtshadertools
$(UNPACK)
$(APPLY) $(SRC)/qtshadertools/0001-Use-fxc2-through-wine-instead-of-fxc.patch
$(APPLY) $(SRC)/qtshadertools/0001-Backport-a-change-to-SPIRV-Cross-to-add-a-missing-in.patch
$(MOVE)
......
......@@ -1130,11 +1130,16 @@ if HAVE_DARWIN
QSB_PARAMS += --msl=12
endif
QSB_EXTRA_PATH =
if HAVE_FXC
QSB_EXTRA_PATH += $(FXC_PATH):
endif
%.frag.qsb: %.frag
$(AM_V_GEN) $(QSB) $(QSB_PARAMS) -o $@ $<
$(AM_V_GEN) PATH="$(QSB_EXTRA_PATH)$$PATH" $(QSB) $(QSB_PARAMS) -o $@ $<
%.vert.qsb: %.vert
$(AM_V_GEN) $(QSB) $(QSB_PARAMS) -o $@ $<
$(AM_V_GEN) PATH="$(QSB_EXTRA_PATH)$$PATH" $(QSB) $(QSB_PARAMS) -o $@ $<
shaders/shaders.cpp: $(srcdir)/shaders/shaders.qrc $(libqt_plugin_la_SHADER:.frag=.frag.qsb) $(libqt_plugin_la_SHADER:.vert=.vert.qsb)
$(AM_V_GEN) cp -f $(filter %.qrc, $^) $(builddir)/shaders/shaders.qrc || true
......