mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
ide: GLSL fixed dependencies
This commit is contained in:
parent
8534e4aae5
commit
08d5e19fdd
8 changed files with 28 additions and 19 deletions
|
|
@ -51,7 +51,7 @@ void BlitzFile(String& blitz, const String& sourceFile, const Vector<String>& de
|
|||
|
||||
BlitzBuilderComponent::BlitzBuilderComponent(Builder* builder)
|
||||
: BuilderComponent(builder)
|
||||
, workingDir(builder->outdir)
|
||||
, outDir(builder->outdir)
|
||||
, blitzFileName("$blitz")
|
||||
{
|
||||
}
|
||||
|
|
@ -75,7 +75,7 @@ Blitz BlitzBuilderComponent::MakeBlitzStep(
|
|||
|
||||
Vector<String> excluded;
|
||||
Vector<String> excludedoptions;
|
||||
b.object = CatAnyPath(workingDir, blitzFileName + String(objext));
|
||||
b.object = CatAnyPath(outDir, blitzFileName + String(objext));
|
||||
Time blitztime = GetFileTime(b.object);
|
||||
String blitz;
|
||||
if(!IdeGetOneFile().IsEmpty())
|
||||
|
|
@ -83,7 +83,7 @@ Blitz BlitzBuilderComponent::MakeBlitzStep(
|
|||
for(int i = 0; i < sourceFiles.GetCount(); i++) {
|
||||
String sourceFile = sourceFiles[i];
|
||||
String ext = ToLower(GetFileExt(sourceFile));
|
||||
String objfile = CatAnyPath(workingDir, GetFileTitle(sourceFile) + objext);
|
||||
String objfile = CatAnyPath(outDir, GetFileTitle(sourceFile) + objext);
|
||||
Time sourceFileTime = GetFileTime(sourceFile);
|
||||
if((ext == ".cpp" || ext == ".cc" || ext == ".cxx" || ext == ".icpp")
|
||||
&& HdependBlitzApproved(sourceFile) && IsNull(soptions[i])
|
||||
|
|
@ -101,7 +101,7 @@ Blitz BlitzBuilderComponent::MakeBlitzStep(
|
|||
}
|
||||
}
|
||||
|
||||
b.path = CatAnyPath(workingDir, blitzFileName + ".cpp");
|
||||
b.path = CatAnyPath(outDir, blitzFileName + ".cpp");
|
||||
if(b.count > 1) {
|
||||
sourceFiles = pick(excluded);
|
||||
soptions = pick(excludedoptions);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class BlitzBuilderComponent : public BuilderComponent {
|
|||
public:
|
||||
BlitzBuilderComponent(Builder *builder);
|
||||
|
||||
void SetWorkingDir(const String& workingDir) { this->workingDir = workingDir; }
|
||||
void SetWorkingDir(const String& workingDir) { this->outDir = workingDir; }
|
||||
void SetBlitzFileName(const String& blitzFileName) { this->blitzFileName = blitzFileName; }
|
||||
|
||||
Blitz MakeBlitzStep(
|
||||
|
|
@ -47,7 +47,7 @@ public:
|
|||
const String& package = Null);
|
||||
|
||||
private:
|
||||
String workingDir;
|
||||
String outDir;
|
||||
String blitzFileName;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ bool GccBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V
|
|||
String ext = GetSrcType(fn);
|
||||
if(IsGLSLExt(ext)) {
|
||||
PutConsole(GetFileName(fn));
|
||||
// TODO: Use HDepend....
|
||||
String spv = CatAnyPath(outdir, SourceToObjName(package, fn)) + ".spv";
|
||||
if(host->Execute("glslc " + fn + " -o " + spv))
|
||||
error = true;
|
||||
|
|
@ -102,7 +103,7 @@ bool GccBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V
|
|||
c << "};\n";
|
||||
c << "static const uint32_t *pCode = (uint32_t *)spv_data;\n";
|
||||
c << "static const int codeSize = " << m.GetCount() << ";\n";
|
||||
SaveFile(ForceExt(spv, ".i"), c);
|
||||
SaveChangedFile(ForceExt(spv, ""), c);
|
||||
}
|
||||
if(findarg(ext, ".c", ".cpp", ".cc", ".cxx", ".brc", ".s", ".ss") >= 0 ||
|
||||
objectivec && findarg(ext, ".mm", ".m") >= 0 ||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ VectorMap<String, String> Builder::cmdx_cache;
|
|||
Time Builder::HdependFileTime(const String& path)
|
||||
{
|
||||
return onefile.GetCount() ? path == onefile ? GetSysTime() : Time::Low()
|
||||
: HdependGetFileTime(path);
|
||||
: HdependGetFileTime(path, outdir);
|
||||
}
|
||||
|
||||
String Builder::CmdX(const char *s)
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ public:
|
|||
ArrayMap<String, Index<String>>& define_includes,
|
||||
bool speculative = true);
|
||||
|
||||
Time GetTime(const String& path);
|
||||
Time GetTime(const String& path, const String& additional_include_path);
|
||||
|
||||
const VectorMap<String, String>& GetFileDefines(const String& path) { return File(NormalizePath(path)).all_defines; }
|
||||
const Vector<Tuple<String, int>>& GetFileFlags(const String& path) { return File(NormalizePath(path)).flags; }
|
||||
|
|
@ -121,7 +121,7 @@ void HdependSetDirs(Vector<String>&& id);
|
|||
void HdependTimeDirty();
|
||||
void HdependClearDependencies();
|
||||
void HdependAddDependency(const String& file, const String& depends);
|
||||
Time HdependGetFileTime(const String& path);
|
||||
Time HdependGetFileTime(const String& path, const String& additional_include_path);
|
||||
Vector<String> HdependGetDependencies(const String& file, bool bydefine_too = true);
|
||||
bool HdependBlitzApproved(const String& path);
|
||||
const Vector<String>& HdependGetDefines(const String& path);
|
||||
|
|
|
|||
|
|
@ -298,6 +298,7 @@ String PPInfo::FindIncludeFile(const char *s, const String& filedir)
|
|||
if(q >= 0)
|
||||
return inc_cache[q];
|
||||
String r = FindIncludeFile(s, filedir, includes);
|
||||
DLOG(s << " -> " << r);
|
||||
inc_cache.Add(key, r);
|
||||
return r;
|
||||
}
|
||||
|
|
@ -430,8 +431,13 @@ void PPInfo::GatherDependencies(const String& path, VectorMap<String, Time>& res
|
|||
GatherDependencies(path, result, define_includes, flags, speculative);
|
||||
}
|
||||
|
||||
Time PPInfo::GetTime(const String& path)
|
||||
Time PPInfo::GetTime(const String& path, const String& additional_include_path)
|
||||
{
|
||||
int inc_cache_bak = inc_cache.GetCount();
|
||||
int includes_bak = includes.GetCount();
|
||||
|
||||
includes.Append(Split(additional_include_path, ';'));
|
||||
|
||||
String p = NormalizePath(path);
|
||||
|
||||
VectorMap<String, Time> result;
|
||||
|
|
@ -449,6 +455,9 @@ Time PPInfo::GetTime(const String& path)
|
|||
}
|
||||
}
|
||||
|
||||
inc_cache.Trim(inc_cache_bak);
|
||||
includes.Trim(includes_bak);
|
||||
|
||||
return ftm;
|
||||
}
|
||||
|
||||
|
|
@ -500,9 +509,9 @@ void HdependAddDependency(const String& file, const String& depends)
|
|||
hdepend.AddDependency(file, depends);
|
||||
}
|
||||
|
||||
Time HdependGetFileTime(const String& path)
|
||||
Time HdependGetFileTime(const String& path, const String& additional_include_path)
|
||||
{
|
||||
return hdepend.GetTime(path);
|
||||
return hdepend.GetTime(path, additional_include_path);
|
||||
}
|
||||
|
||||
Vector<String> HdependGetDependencies(const String& path, bool bydefine_too)
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
|
||||
using namespace Upp;
|
||||
|
||||
const int WIDTH = 32000; // Size of rendered mandelbrot set.
|
||||
const int HEIGHT = 24000; // Size of renderered mandelbrot set.
|
||||
const int WIDTH = 3200; // Size of rendered mandelbrot set.
|
||||
const int HEIGHT = 2400; // Size of renderered mandelbrot set.
|
||||
const int WORKGROUP_SIZE = 32; // Workgroup size in compute shader.
|
||||
|
||||
const bool enableValidationLayers = false;
|
||||
|
|
@ -592,7 +592,7 @@ public:
|
|||
createInfo.pCode = pCode;
|
||||
createInfo.codeSize = codeSize;
|
||||
*/
|
||||
#define SHADER shader.comp
|
||||
#define SHADER <shader.comp>
|
||||
#define CREATE_INFO createInfo // if omitted, createInfo is used
|
||||
#include "import_vulkan_shader.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,16 @@
|
|||
#ifndef assist_parser__
|
||||
|
||||
#define SHADER_FN <SHADER.i>
|
||||
#include SHADER_FN
|
||||
#include SHADER
|
||||
|
||||
#ifdef CREATE_INFO
|
||||
CREATE_INFO.pCode = pCode;
|
||||
CREATE_INFO.codeSize = codeSize;
|
||||
#undef CREATE_INFO
|
||||
#else
|
||||
createInfo.pCode = pCode;
|
||||
createInfo.codeSize = codeSize;
|
||||
#endif
|
||||
|
||||
#undef SHADER_FN
|
||||
#undef SHADER
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue