From 38e26dd12e8643ee112a1214ba764fc47a3c4920 Mon Sep 17 00:00:00 2001 From: Chloe Rhodes Date: Wed, 20 Feb 2013 19:47:55 -0500 Subject: [PATCH] Implement plShaderAssembler --- .../plSurface/ShaderSrc/AssShader.zip | Bin 9590 -> 0 bytes Sources/Tools/CMakeLists.txt | 1 + .../Tools/plShaderAssembler/CMakeLists.txt | 16 ++ Sources/Tools/plShaderAssembler/main.cpp | 207 ++++++++++++++++++ 4 files changed, 224 insertions(+) delete mode 100644 Sources/Plasma/PubUtilLib/plSurface/ShaderSrc/AssShader.zip create mode 100644 Sources/Tools/plShaderAssembler/CMakeLists.txt create mode 100644 Sources/Tools/plShaderAssembler/main.cpp diff --git a/Sources/Plasma/PubUtilLib/plSurface/ShaderSrc/AssShader.zip b/Sources/Plasma/PubUtilLib/plSurface/ShaderSrc/AssShader.zip deleted file mode 100644 index 40e75b970508b403c7a182eaa2f71b032d8ac94d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9590 zcmaKS1y~%*5-tRH2`&MGy95a?!GgQHyDq^YSO~5Gf?IHRCwPG1?yifw?d~Jz-gk2D zeYvmqo0*=T>VK!Ydj77d8YNj6SY)VQCG3+e+h3J`?|!w4y1J@b8Jn5Auqypq4iQQ{ zAwtMzD7P*E4hkv&7YYjhKji-I!D8y<)UIW(y2XtN&NR%C4ebfg6YH)UAc;kf-Huj> z=1|(@gF!X5BeWfj10>1k@I2jCZ1d13i9K!{V$AO^=pR>*3CD4gY zil~xcg~JV*M6!)cTJ{p=5Qb}&^uLgVlV!W$Rg_-044x3Re0v1&d(A0*fteR{;LybL znRfTbl)-lurqFulxRBuDYAH!EfLFYUa8Fj%&w+$D=5(Jy02JJ@7(cIFR%f#MoX=EE z-**cm7VyG7$e2e9Tc?C$Dt9jz;IK=680>i?bm5-kgog`Q&$j3A)GaNY(uvP{LDDzi z3ihk6ym;e6D?Xz>nNgubv)g^>S~?V+FuR6K0H`?V;+gqc=@7qbpQjd zxZ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3k;meVa5tshn_lcURWGYb?)6*MEZiDdX`A;$I*s&uaeN^*=z|{{`|pX7Jy6gZ~TiF(4V`&mhlP zg#QNl@4&+^5a?%hJ_e+{{4>aN7~-Gm{K;AQzjp!!RYv@0kZ0HBpCEr)b$)};z4|A} z?=|S32!CR>-w5#J|3vuBbN@v66J7j9xcn1>m69wR{4W{g=U?hG#q_`ab@qP%%Fe!! diff --git a/Sources/Tools/CMakeLists.txt b/Sources/Tools/CMakeLists.txt index 67111a9a..d677e844 100644 --- a/Sources/Tools/CMakeLists.txt +++ b/Sources/Tools/CMakeLists.txt @@ -1,5 +1,6 @@ add_subdirectory(plLocalizationEditor) add_subdirectory(plResBrowser) +add_subdirectory(plShaderAssembler) if(FREETYPE_FOUND) add_subdirectory(plFontConverter) diff --git a/Sources/Tools/plShaderAssembler/CMakeLists.txt b/Sources/Tools/plShaderAssembler/CMakeLists.txt new file mode 100644 index 00000000..c56f4697 --- /dev/null +++ b/Sources/Tools/plShaderAssembler/CMakeLists.txt @@ -0,0 +1,16 @@ +include_directories("../../Plasma/CoreLib") + +if(WIN32) + include_directories(${DirectX_INCLUDE_DIR}) +endif(WIN32) + +set(plShaderAssembler_SOURCES + main.cpp +) + + +add_executable(plShaderAssembler ${plShaderAssembler_SOURCES}) +target_link_libraries(plShaderAssembler ${DirectX_LIBRARIES}) +target_link_libraries(plShaderAssembler CoreLib) + +source_group("Source Files" FILES ${plShaderAssembler_SOURCES}) diff --git a/Sources/Tools/plShaderAssembler/main.cpp b/Sources/Tools/plShaderAssembler/main.cpp new file mode 100644 index 00000000..ad170efb --- /dev/null +++ b/Sources/Tools/plShaderAssembler/main.cpp @@ -0,0 +1,207 @@ +// AssShader.cpp : Defines the entry point for the console application. +// + +#include +#include + +#include "plFileSystem.h" + +void ICreateHeader(const char* const varName, const char* const fileName, FILE* fp, LPD3DXBUFFER shader) +{ + fprintf(fp, "\n\n\n"); + + int byteLen = shader->GetBufferSize(); + int quadLen = byteLen >> 2; + + unsigned char* codes = (unsigned char*)shader->GetBufferPointer(); + + fprintf(fp, "static const uint32_t %sbyteLen = %d;\n\n", varName, byteLen); + fprintf(fp, "static const uint8_t %sCodes[] = {\n", varName); + + int i; + for( i = 0; i < quadLen-1; i++ ) + { + fprintf(fp, "\t0x%x,", *codes++); + fprintf(fp, "\t0x%x,", *codes++); + fprintf(fp, "\t0x%x,", *codes++); + fprintf(fp, "\t0x%x,\n", *codes++); + } + fprintf(fp, "\t0x%x,", *codes++); + fprintf(fp, "\t0x%x,", *codes++); + fprintf(fp, "\t0x%x,", *codes++); + fprintf(fp, "\t0x%x\n", *codes++); + fprintf(fp, "\t};"); + fprintf(fp, "\n\n"); + + fprintf(fp, "static const plShaderDecl %sDecl(\"%s\", %s, %sbyteLen, %sCodes);\n\n", varName, fileName, varName, varName, varName); + fprintf(fp, "static const plShaderRegister %sRegister(&%sDecl);\n\n", varName, varName); +} + +int main(int argc, char* argv[]) +{ + if( argc < 2 ) + { + printf("%s ...\n", argv[0]); + return 0; + } + const char* const * nameList = 0L; + int numNames = 0; + if( !_stricmp(argv[1], "all") ) + { + // Cut and paste enum and add kNumEnumNames to end + // so you don't have to count. + enum { + vs_WaveFixedFin6, + ps_WaveFixed, + vs_CompCosines, + ps_CompCosines, + vs_ShoreLeave6, + ps_ShoreLeave6, + vs_WaveRip, + ps_WaveRip, + vs_WaveDec1Lay, + vs_WaveDec2Lay11, + vs_WaveDec2Lay12, + vs_WaveDecEnv, + ps_CbaseAbase, + ps_CalphaAbase, + ps_CalphaAMult, + ps_CalphaAadd, + ps_CaddAbase, + ps_CaddAMult, + ps_CaddAAdd, + ps_CmultAbase, + ps_CmultAMult, + ps_CmultAAdd, + ps_WaveDecEnv, + vs_WaveGraph2, + ps_WaveGraph, + vs_WaveGridFin, + ps_WaveGrid, + vs_BiasNormals, + ps_BiasNormals, + vs_ShoreLeave7, + vs_WaveRip7, + ps_MoreCosines, + vs_WaveDec1Lay_7, + vs_WaveDec2Lay11_7, + vs_WaveDec2Lay12_7, + vs_WaveDecEnv_7, + vs_WaveFixedFin7, + vs_GrassShader, + ps_GrassShader, + + kNumEnumNames + }; + + // Just copy in the enum and use Replace on + // vs_ => "vs_ + // ps_ => "ps_ + // , => ", + const char* kEnumNames[kNumEnumNames] = { + "vs_WaveFixedFin6", + "ps_WaveFixed", + "vs_CompCosines", + "ps_CompCosines", + "vs_ShoreLeave6", + "ps_ShoreLeave6", + "vs_WaveRip", + "ps_WaveRip", + "vs_WaveDec1Lay", + "vs_WaveDec2Lay11", + "vs_WaveDec2Lay12", + "vs_WaveDecEnv", + "ps_CbaseAbase", + "ps_CalphaAbase", + "ps_CalphaAMult", + "ps_CalphaAadd", + "ps_CaddAbase", + "ps_CaddAMult", + "ps_CaddAAdd", + "ps_CmultAbase", + "ps_CmultAMult", + "ps_CmultAAdd", + "ps_WaveDecEnv", + "vs_WaveGraph2", + "ps_WaveGraph", + "vs_WaveGridFin", + "ps_WaveGrid", + "vs_BiasNormals", + "ps_BiasNormals", + "vs_ShoreLeave7", + "vs_WaveRip7", + "ps_MoreCosines", + "vs_WaveDec1Lay_7", + "vs_WaveDec2Lay11_7", + "vs_WaveDec2Lay12_7", + "vs_WaveDecEnv_7", + "vs_WaveFixedFin7", + "vs_GrassShader", + "ps_GrassShader" + }; + + nameList = kEnumNames; + numNames = kNumEnumNames; + } + else + { + nameList = argv+1; + numNames = argc-1; + } + int i; + for( i = 0; i < numNames; i++ ) + { + const char* name = nameList[i]; + + char varName[512]; + strcpy(varName, name); + char* p = strrchr(varName, '.'); + if( p ) + *p = 0; + + char inFile[512]; + sprintf(inFile, "%s.inl", varName); + + char outFile[512]; + sprintf(outFile, "%s.h", varName); + + printf("Processing %s into %s\n", name, outFile); + FILE* fp = fopen(outFile, "w"); + if( !fp ) + { + printf("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n"); + printf("Error opening file %s for output\n"); + printf("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n"); + continue; + } + + LPD3DXBUFFER compiledShader = 0L; + LPD3DXBUFFER compilationErrors = 0L; + DWORD flags = 0; + LPD3DXINCLUDE include = 0L; + + HRESULT hr = D3DXAssembleShaderFromFile( + inFile, + 0L, + include, + flags, + &compiledShader, + &compilationErrors); + + if( FAILED(hr) ) + { + printf("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n"); + printf(compilationErrors ? (char*)compilationErrors->GetBufferPointer() : "File not found"); + continue; + } + sprintf(inFile, "sha/%s.inl", varName); + + ICreateHeader(varName, inFile, fp, compiledShader); + + fclose(fp); + + } + + return 0; +} +