Skip to content

Commit

Permalink
updated from dagor4 repo on 2023/11/27, rev 5c60bace2d9f412c90ae82100…
Browse files Browse the repository at this point in the history
…4b0c3ee648309e7
  • Loading branch information
NicSavichev committed Nov 27, 2023
1 parent ab4586c commit 347bcab
Show file tree
Hide file tree
Showing 896 changed files with 66,947 additions and 26,650 deletions.
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@
*.tis text
*.png binary
*.jpg binary
*.sh text text
*.sh text eol=lf
*.plist text eol=lf
*compile_shaders*.sh text eol=lf
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
/_output/
*.pyc
*.das.inl
*.sh.log
*.dshl.log
ShaderLog-*
2 changes: 1 addition & 1 deletion DagorEngine.rev.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7c0d114dca5d924ef032d22d724c67eaea1faf30
5c60bace2d9f412c90ae821004b0c3ee648309e7
8 changes: 8 additions & 0 deletions build_all.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,26 @@ pushd prog\tools\dargbox
call create_vfsroms.bat
cd shaders
call compile_shaders_pc11.bat
call compile_shaders_metal.bat
call compile_shaders_spirV.bat
popd

pushd prog\samples\physTest
jam
jam -f jamfile-test-jolt
cd shaders
call compile_game_shaders-dx11.bat
call compile_game_shaders-metal.bat
call compile_game_shaders-spirv.bat
popd

pushd samples\skiesSample\prog
jam
cd shaders
call compile_shaders_dx12.bat
call compile_shaders_pc11.bat
call compile_shaders_metal.bat
call compile_shaders_spirv.bat
call compile_shaders_tools.bat
popd

Expand All @@ -36,5 +42,7 @@ jam
cd shaders
call compile_shaders_dx12.bat
call compile_shaders_pc11.bat
call compile_shaders_metal.bat
call compile_shaders_spirv.bat
call compile_shaders_tools.bat
popd
20 changes: 20 additions & 0 deletions build_all_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
pushd prog/tools
./build_dagor3_cdk_mini_linux.sh
popd

pushd prog/tools/dargbox
../../../tools/dagor3_cdk/util-linux64/vromfsPacker-dev darg.vromfs.blk -platform:PC
popd

pushd prog/samples/physTest
jam
jam -f jamfile-test-jolt
popd

pushd samples/skiesSample/prog
jam
popd

pushd samples/testGI/prog
jam
popd
20 changes: 20 additions & 0 deletions build_all_macOS.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
pushd prog/tools
./build_dagor3_cdk_mini_macOS.sh
popd

pushd prog/tools/dargbox
../../../tools/dagor3_cdk/util-macosx/vromfsPacker-dev darg.vromfs.blk -platform:PC
popd

pushd prog/samples/physTest
jam
jam -f jamfile-test-jolt
popd

pushd samples/skiesSample/prog
jam
popd

pushd samples/testGI/prog
jam
popd
2 changes: 1 addition & 1 deletion prog/1stPartyLibs/daScript/daslib/is_local.das
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def is_shared_expr ( expr:ExpressionPtr )
return false
elif expr is ExprAt
let ea = expr as ExprAt
if ea.subexpr._type!=null && ea.subexpr._type.dim |> length!=0
if ea.subexpr._type!=null && (ea.subexpr._type.baseType==Type tArray || ea.subexpr._type.isArray)
return is_shared_expr(ea.subexpr)
elif expr is ExprField
let ef = expr as ExprField
Expand Down
1 change: 1 addition & 0 deletions prog/1stPartyLibs/daScript/examples/test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ int main( int argc, char * argv[] ) {
#endif
uint64_t timeStamp = ref_time_ticks();
bool ok = true;
// ok = run_all_standalone_context_tests() && ok;
ok = run_compilation_fail_tests(getDasRoot() + "/examples/test/compilation_fail_tests") && ok;
ok = run_unit_tests(getDasRoot() + "/examples/test/unit_tests", true, false) && ok;
ok = run_unit_tests(getDasRoot() + "/examples/test/optimizations", false, false) && ok;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_delete
assert ( pB==null )
invoke(lam)
delete lam
assert(g_counter==2) // b and c were deleted, a stayed do to copy, not move, not clone
assert(g_counter==1) // only C was safe to delete
return true


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ namespace das {
return ret;
}
float3x4 float3x4_neg ( const float3x4 & mat );
float float3x4_det ( const float3x4 & mat );
float3x3 float3x3_inverse( const float3x3 & src);
float3x3 float3x3_neg ( const float3x3 & mat );
float float3x3_det ( const float3x3 & a );
float4x4 float4x4_from_float34 ( const float3x4 & mat );
float3x3 float3x3_from_float44 ( const float4x4 & mat );
float3x3 float3x3_from_float34 ( const float3x4 & mat );
Expand Down Expand Up @@ -70,6 +72,12 @@ namespace das {
return v_mat44_mul_vec4(va, b);
}

inline float float4x4_det(const float4x4 &a) {
mat44f va;
memcpy(&va,&a,sizeof(float4x4));
return v_extract_x(v_mat44_det(va));
}

inline float3 float3x3_mul_vec3(const float3x3 &a, float3 b) {
mat33f va; va.col0 = a.m[0]; va.col1 = a.m[1]; va.col2 = a.m[2];
return v_mat33_mul_vec3(va, b);
Expand Down
5 changes: 5 additions & 0 deletions prog/1stPartyLibs/daScript/jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ if $(daScript_trackAllocations) = 1 {
CPPopt += -DDAS_TRACK_ALLOCATIONS=$(daScript_trackAllocations) ;
}

if $(daScript_sanitizer) = 1 {
Target = $(Target:S=~sa$(daScript_sanitizer).lib) ;
CPPopt += -DDAS_SANITIZER=$(daScript_sanitizer) ;
}

if $(Platform) = macosx {
CPPopt += -Wno-deprecated-declarations ;
}
Expand Down
1 change: 1 addition & 0 deletions prog/1stPartyLibs/daScript/src/ast/ast_generate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ namespace das {
if ( !fl.type->constant && !fl.capturedConstant && fl.type->needDelete() ) {
if ( !fl.doNotDelete && !fl.capturedRef ) {
if ( fl.type->isPointer() && fl.type->firstType && fl.type->firstType->constant ) continue;
if ( ls->isLambda && !fl.type->isSafeToDelete() ) continue; // we don't do unsafe delete for lambda
auto fva = make_smart<ExprVar>(fl.at, "__this");
auto fld = make_smart<ExprField>(fl.at, fva, fl.name);
fld->ignoreCaptureConst = true;
Expand Down
52 changes: 35 additions & 17 deletions prog/1stPartyLibs/daScript/src/ast/ast_infer_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2758,31 +2758,49 @@ namespace das {
if ( classDotMethod->rtti_isField() ) {
auto eField = static_pointer_cast<ExprField>(classDotMethod);
if ( eField->value->type && !eField->value->type->isAutoOrAlias() ) {
Structure * stt = nullptr;
if ( eField->value->type->baseType==Type::tStructure ) {
auto stt = eField->value->type->structType;
stt = eField->value->type->structType;
} else if ( eField->value->type->baseType==Type::tPointer && eField->value->type->firstType && eField->value->type->firstType->baseType==Type::tStructure ) {
stt = eField->value->type->firstType->structType;
}
if ( stt ) {
auto sttf = stt->findField(eField->name);
if ( sttf ) {
if ( sttf->init && sttf->init->rtti_isAddr() ) {
auto fnAddr = static_pointer_cast<ExprAddr>(sttf->init);
if ( fnAddr->func ) {
int fnArgSize = int(fnAddr->func->arguments.size());
int fromFnArgSize = int(expr->arguments.size()-1);
bool allHaveInit = true;
for ( int ai=fromFnArgSize; ai<fnArgSize; ++ai ) {
if ( !fnAddr->func->arguments[ai]->init ) {
allHaveInit = false;
break;
}
if ( sttf->init ) {
smart_ptr<ExprAddr> fnAddr;
if ( sttf->init->rtti_isAddr() ) {
fnAddr = static_pointer_cast<ExprAddr>(sttf->init);
} else if ( sttf->init->rtti_isCast() ) {
auto cast = static_pointer_cast<ExprCast>(sttf->init);
if ( cast->subexpr->rtti_isAddr() ) {
fnAddr = static_pointer_cast<ExprAddr>(cast->subexpr);
}
if ( allHaveInit ) {
}
if ( fnAddr ) {
if ( fnAddr->func ) {
int fnArgSize = int(fnAddr->func->arguments.size());
int fromFnArgSize = int(expr->arguments.size()-1);
bool allHaveInit = true;
for ( int ai=fromFnArgSize; ai<fnArgSize; ++ai ) {
expr->arguments.emplace_back(fnAddr->func->arguments[ai]->init->clone());
if ( !fnAddr->func->arguments[ai]->init ) {
allHaveInit = false;
break;
}
}
if ( allHaveInit ) {
for ( int ai=fromFnArgSize; ai<fnArgSize; ++ai ) {
expr->arguments.emplace_back(fnAddr->func->arguments[ai]->init->clone());
}
reportAstChanged();
return Visitor::visit(expr);
}
reportAstChanged();
return Visitor::visit(expr);
} else {
error(fnAddr->target + " is not fully resolved yet", "", "",
expr->at, CompilationError::invalid_argument_count);
}
} else {
error(fnAddr->target + " is not fully resolved yet", "", "",
error(fnAddr->target + " expecting class_ptr or cast<auto> class_ptr", "", "",
expr->at, CompilationError::invalid_argument_count);
}
} else {
Expand Down
6 changes: 2 additions & 4 deletions prog/1stPartyLibs/daScript/src/ast/ast_parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,9 @@ namespace das {

int64_t file_mtime = access->getFileMtime(fileName.c_str());
int64_t saved_mtime = 0; *serializer_read << saved_mtime;
string saved_filename{}; *serializer_read << saved_filename;

string saved_filename; *serializer_read << saved_filename;
DAS_ASSERTF(saved_filename == fileName, "expected the same order of modules");

if ( file_mtime != saved_mtime ) {
if ( saved_filename != fileName || file_mtime != saved_mtime ) {
serializer_read->seenNewModule = true;
return false;
}
Expand Down
19 changes: 18 additions & 1 deletion prog/1stPartyLibs/daScript/src/builtin/module_builtin_math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,11 @@ namespace das {
return res;
}

float float3x3_det ( const float3x3 & a ) {
mat33f va; va.col0 = a.m[0]; va.col1 = a.m[1]; va.col2 = a.m[2];
return v_extract_x(v_mat33_det(va));
}

float3x4 float3x4_neg ( const float3x4 & mat ) {
float3x4 res;
res.m[0] = v_neg(mat.m[0]);
Expand All @@ -391,6 +396,12 @@ namespace das {
return res;
}

float float3x4_det ( const float3x4 & mat ) {
mat44f res;
v_mat44_make_from_43ca(res, (const float*)&mat);
return v_extract_x(v_mat44_det43(res));
}

float4x4 float4x4_identity_m ( void ) {
float4x4 mat;
matrix_identity<4,4>((float*)&mat);
Expand Down Expand Up @@ -753,6 +764,8 @@ namespace das {
SideEffects::none,"float3x4_mul_vec3p")->args({"x","y"});
addExtern<DAS_BIND_FUN(float4x4_mul_vec4), SimNode_ExtFuncCall>(*this, lib, "*",
SideEffects::none,"float4x4_mul_vec4")->args({"x","y"});
addExtern<DAS_BIND_FUN(float4x4_det)>(*this, lib, "determinant",
SideEffects::none,"float4x4_det")->arg("x");
addExtern<DAS_BIND_FUN(float3x4_inverse), SimNode_ExtFuncCallAndCopyOrMove>(*this, lib,
"inverse", SideEffects::none, "float3x4_inverse")->arg("x");
addExtern<DAS_BIND_FUN(float4x4_inverse), SimNode_ExtFuncCallAndCopyOrMove>(*this, lib,
Expand All @@ -767,6 +780,8 @@ namespace das {
SideEffects::none, "float3x4_nequ")->args({"x","y"});
addExtern<DAS_BIND_FUN(float3x4_neg), SimNode_ExtFuncCallAndCopyOrMove>(*this, lib, "-",
SideEffects::none,"float3x4_neg")->arg("x");
addExtern<DAS_BIND_FUN(float3x4_det)>(*this, lib, "determinant",
SideEffects::none,"float3x4_det")->arg("x");
initFloatNxNIndex(addExtern<DAS_BIND_FUN((floatNxN_ati<float3x4>)), SimNode_ExtFuncCallRef>(*this, lib,
"[]", SideEffects::none, "floatNxN_ati<float4>")->args({"m","i","context","at"}));
initFloatNxNIndex(addExtern<DAS_BIND_FUN((floatNxN_atci<float3x4>)), SimNode_ExtFuncCallRef>(*this, lib,
Expand Down Expand Up @@ -813,7 +828,9 @@ namespace das {
SideEffects::none, "float3x3_nequ")->args({"x","y"});
addExtern<DAS_BIND_FUN(float3x3_neg), SimNode_ExtFuncCallAndCopyOrMove>(*this, lib, "-",
SideEffects::none,"float3x3_neg")->arg("x");
initFloatNxNIndex(addExtern<DAS_BIND_FUN((floatNxN_ati<float3x3>)), SimNode_ExtFuncCallRef>(*this, lib,
addExtern<DAS_BIND_FUN(float3x3_det)>(*this, lib, "-detertminant",
SideEffects::none,"float3x3_det")->arg("x");
initFloatNxNIndex(addExtern<DAS_BIND_FUN((floatNxN_ati<float3x3>)), SimNode_ExtFuncCallRef>(*this, lib,
"[]", SideEffects::none, "floatNxN_ati<float4>")->args({"m","i","context","at"}));
initFloatNxNIndex(addExtern<DAS_BIND_FUN((floatNxN_atci<float3x3>)), SimNode_ExtFuncCallRef>(*this, lib,
"[]", SideEffects::none, "floatNxN_atci<float4>")->args({"m","i","context","at"}));
Expand Down
24 changes: 19 additions & 5 deletions prog/1stPartyLibs/quirrel/quirrel/include/squirrel.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,20 @@ enum CompilationOptions : SQUnsignedInteger {

#undef BIT

typedef struct tagSQCompilerMessage {
int intId;
const char* textId;
int line;
int column;
int columnsWidth;
const char* message;
const char* fileName;
bool isError;
} SQCompilerMessage;

typedef void (*SQ_COMPILER_DIAG_CB)(HSQUIRRELVM v, const SQCompilerMessage *msg);


/*vm*/
SQUIRREL_API HSQUIRRELVM sq_open(SQInteger initialstacksize);
SQUIRREL_API HSQUIRRELVM sq_newthread(HSQUIRRELVM friendvm, SQInteger initialstacksize);
Expand Down Expand Up @@ -264,6 +278,7 @@ SQUIRREL_API SQBool sq_isvartracesupported();
SQUIRREL_API void sq_lineinfo_in_expressions(HSQUIRRELVM v, SQBool enable);
SQUIRREL_API void sq_notifyallexceptions(HSQUIRRELVM v, SQBool enable);
SQUIRREL_API void sq_setcompilererrorhandler(HSQUIRRELVM v,SQCOMPILERERROR f);
SQUIRREL_API void sq_setcompilerdiaghandler(HSQUIRRELVM v, SQ_COMPILER_DIAG_CB f);
SQUIRREL_API SQCOMPILERERROR sq_getcompilererrorhandler(HSQUIRRELVM v);

/*stack operations*/
Expand Down Expand Up @@ -425,12 +440,11 @@ SQUIRREL_API void sq_resetanalyzerconfig();
SQUIRREL_API bool sq_loadanalyzerconfig(const char *configFileName);
SQUIRREL_API bool sq_loadanalyzerconfigblk(const KeyValueFile &config);

SQUIRREL_API bool sq_switchdiagnosticstate_t(const char *diagId, bool state);
SQUIRREL_API bool sq_switchdiagnosticstate_i(int32_t id, bool state);
SQUIRREL_API bool sq_setdiagnosticstatebyname(const char *diagId, bool val);
SQUIRREL_API bool sq_setdiagnosticstatebyid(int32_t id, bool val);
SQUIRREL_API void sq_invertwarningsstate();
SQUIRREL_API void sq_printwarningslist(FILE *ostream);
SQUIRREL_API void sq_disablesyntaxwarnings();
SQUIRREL_API void sq_enablesyntaxwarnings();
SQUIRREL_API void sq_enablesyntaxwarnings(bool on);
SQUIRREL_API void sq_checkglobalnames(HSQUIRRELVM v);
SQUIRREL_API void sq_mergeglobalnames(const HSQOBJECT *bindings);

Expand Down Expand Up @@ -468,7 +482,7 @@ SQUIRREL_API void sq_mergeglobalnames(const HSQOBJECT *bindings);
#if defined(__GNUC__) || defined(__clang__)
# define SQ_UNUSED_ARG(x) x __attribute__((__unused__))
#else
# define SQ_UNUSED_ARG(x) x
# define SQ_UNUSED_ARG(x)
#endif

#ifdef __cplusplus
Expand Down
8 changes: 3 additions & 5 deletions prog/1stPartyLibs/quirrel/quirrel/sq/sq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ SQInteger quit(HSQUIRRELVM v)

void printfunc(HSQUIRRELVM SQ_UNUSED_ARG(v),const SQChar *s,...)
{
(void)v; /* UNUSED */
va_list vl;
va_start(vl, s);
scvprintf(stdout, s, vl);
Expand All @@ -54,7 +53,6 @@ static FILE *errorStream = stderr;

void errorfunc(HSQUIRRELVM SQ_UNUSED_ARG(v),const SQChar *s,...)
{
(void)v; /* UNUSED */
va_list vl;
va_start(vl, s);
scvprintf(errorStream, s, vl);
Expand Down Expand Up @@ -240,7 +238,7 @@ int getargs(HSQUIRRELVM v,int argc, char* argv[],SQInteger *retval)
bool flip_warnigns = false;

if (static_analysis) {
sq_enablesyntaxwarnings();
sq_enablesyntaxwarnings(true);
}

char * output = NULL;
Expand Down Expand Up @@ -346,7 +344,7 @@ int getargs(HSQUIRRELVM v,int argc, char* argv[],SQInteger *retval)
case 'W':
if (isdigit(argv[arg][2])) {
int id = atoi(&argv[arg][2]);
if (!sq_switchdiagnosticstate_i(id, false)) {
if (!sq_setdiagnosticstatebyid(id, false)) {
printf("Unknown warning ID %s\n", &argv[arg][2]);
}
}
Expand All @@ -364,7 +362,7 @@ int getargs(HSQUIRRELVM v,int argc, char* argv[],SQInteger *retval)
}
break;
default:
if (static_analysis && isalpha(argv[arg][1]) && sq_switchdiagnosticstate_t(argv[arg] + 1, false)) {
if (static_analysis && isalpha(argv[arg][1]) && sq_setdiagnosticstatebyname(argv[arg] + 1, false)) {
break;
}
unknown_opt:
Expand Down
Loading

0 comments on commit 347bcab

Please sign in to comment.