fix bug in cellular test
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good

This commit is contained in:
austin 2024-12-06 23:27:39 -05:00
parent 03729abc7b
commit d6939ba8dd
3 changed files with 73 additions and 49 deletions

37
.vscode/launch.json vendored
View File

@ -1,7 +1,4 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
@ -36,7 +33,7 @@
"request": "launch",
"mainClass": "electrosphere.engine.Main",
"env": {
"ALSOFT_LOGLEVEL": 4,
"ALSOFT_LOGLEVEL": 4
},
"vmArgs": "-Xmx4G -Xms1024m -Djava.library.path=./shared-folder -XX:+UseZGC -XX:SoftMaxHeapSize=3G -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=\"./tmp/heap.hprof\"",
"projectName": "Renderer"
@ -55,7 +52,7 @@
"request": "launch",
"mainClass": "electrosphere.engine.Main",
"projectName": "Renderer",
"args" : "--headless"
"args": "--headless"
},
{
"type": "java",
@ -63,7 +60,35 @@
"request": "launch",
"mainClass": "electrosphere.engine.Main",
"projectName": "Renderer",
"args" : "--simulate"
"args": "--simulate"
},
{
"name": "C/C++: gcc.exe build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${cwd}/out/build/test_runner.exe",
"args": [
"${cmake.testArgs}"
],
"stopAtEntry": false,
"cwd": "${cmake.testWorkingDirectory}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:\\ProgramData\\mingw64\\mingw64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "CMake: clean rebuild"
}
]
}

75
.vscode/tasks.json vendored
View File

@ -1,40 +1,39 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "Install Native Lib",
"command": "cp ./out/build/libStormEngine.* ./shared-folder",
"group": "build",
"detail": "Installs the native lib locally",
"dependsOn": ["CMake: build",]
},
{
"type": "cmake",
"label": "CMake: build",
"command": "build",
"targets": [
"all"
],
"preset": "${command:cmake.activeBuildPresetName}",
"group": "build",
"problemMatcher": [],
"detail": "CMake template build task"
},
{
"type": "cmake",
"label": "CMake: clean rebuild",
"command": "cleanRebuild",
"targets": [
"all"
],
"preset": "${command:cmake.activeBuildPresetName}",
"group": "build",
"problemMatcher": [],
"detail": "CMake template clean rebuild task"
}
]
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "Install Native Lib",
"command": "cp ./out/build/libStormEngine.* ./shared-folder",
"group": "build",
"detail": "Installs the native lib locally",
"dependsOn": [
"CMake: build"
]
},
{
"type": "cmake",
"label": "CMake: build",
"command": "build",
"targets": [
"all"
],
"preset": "${command:cmake.activeBuildPresetName}",
"group": "build",
"problemMatcher": [],
"detail": "CMake template build task"
},
{
"type": "cmake",
"label": "CMake: clean rebuild",
"command": "cleanRebuild",
"targets": [
"all"
],
"preset": "${command:cmake.activeBuildPresetName}",
"group": "build",
"problemMatcher": [],
"detail": "CMake template clean rebuild task"
}
]
}

View File

@ -68,8 +68,8 @@ int fluid_sim_cellular_bounds_tests(){
fluid_solve_bounds(chunkCount,queue,env);
{
int borderVal = queue[0]->d[CENTER_LOC][IX(1,1,DIM-2)];
int transferedVal = queue[1]->d[CENTER_LOC][IX(1,1,0)];
float borderVal = queue[0]->d[CENTER_LOC][IX(1,1,DIM-2)];
float transferedVal = queue[1]->d[CENTER_LOC][IX(1,1,0)];
rVal += assertEqualsFloat(borderVal,CELLULAR_TEST_PLACE_VAL,"Border value was overwritten! -- %f %f \n");
rVal += assertEqualsFloat(transferedVal,CELLULAR_TEST_PLACE_VAL,"Value want not transfered from border! -- %f %f \n");
}
@ -80,9 +80,9 @@ int fluid_sim_cellular_bounds_tests(){
//assert that the density moved
{
int borderVal = queue[0]->d[CENTER_LOC][IX(1,1,DIM-2)];
int orderBorderVal = queue[0]->d[CENTER_LOC][IX(1,1,DIM-3)];
int transferedVal = queue[1]->d[CENTER_LOC][IX(1,1,0)];
float borderVal = queue[0]->d[CENTER_LOC][IX(1,1,DIM-2)];
float orderBorderVal = queue[0]->d[CENTER_LOC][IX(1,1,DIM-3)];
float transferedVal = queue[1]->d[CENTER_LOC][IX(1,1,0)];
rVal += assertEqualsFloat(borderVal,MIN_FLUID_VALUE,"Border value has not changed! -- %f %f \n");
rVal += assertEqualsFloat(orderBorderVal,CELLULAR_TEST_PLACE_VAL,"Border value has not moved! -- %f %f \n");
rVal += assertEqualsFloat(transferedVal,CELLULAR_TEST_PLACE_VAL,"Value want not transfered from border! -- %f %f \n");