Compare commits
11 Commits
ebridgewat
...
fgdbg
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
555a1396ca | ||
|
|
57ce236fe4 | ||
|
|
527428a629 | ||
|
|
a5913e2c36 | ||
|
|
48a31f484a | ||
|
|
21cf0f40c4 | ||
|
|
16a351bf15 | ||
|
|
c76b6d7bed | ||
|
|
827f82fa84 | ||
|
|
9d7317a4a9 | ||
|
|
786008c2ed |
BIN
.build.sh.un~
Normal file
BIN
.build.sh.un~
Normal file
Binary file not shown.
@@ -479,6 +479,13 @@ else()
|
||||
option(FILAMENT_ENABLE_MATDBG "Enable the material debugger" OFF)
|
||||
endif()
|
||||
|
||||
# By default, link in fgdbg for Desktop + Debug
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug" AND IS_HOST_PLATFORM)
|
||||
option(FILAMENT_ENABLE_FGDBG "Enable the framegraph debugger" ON)
|
||||
else()
|
||||
option(FILAMENT_ENABLE_FGDBG "Enable the framegraph debugger" OFF)
|
||||
endif()
|
||||
|
||||
# Only optimize materials in Release mode (so error message lines match the source code)
|
||||
if (CMAKE_BUILD_TYPE MATCHES Release)
|
||||
option(FILAMENT_DISABLE_MATOPT "Disable material optimizations" OFF)
|
||||
@@ -711,6 +718,10 @@ if (FILAMENT_BUILD_FILAMAT OR IS_HOST_PLATFORM)
|
||||
if (FILAMENT_ENABLE_MATDBG OR IS_HOST_PLATFORM)
|
||||
add_subdirectory(${LIBRARIES}/matdbg)
|
||||
endif()
|
||||
|
||||
if (FILAMENT_ENABLE_FGDBG OR IS_HOST_PLATFORM)
|
||||
add_subdirectory(${LIBRARIES}/fgdbg)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (FILAMENT_SUPPORTS_VULKAN)
|
||||
|
||||
@@ -312,6 +312,7 @@ and tools.
|
||||
- `bluegl`: OpenGL bindings for macOS, Linux and Windows
|
||||
- `bluevk`: Vulkan bindings for macOS, Linux, Windows and Android
|
||||
- `camutils`: Camera manipulation utilities
|
||||
- `fgdbg`: Frame Graph inspector and debugger (debug builds only)
|
||||
- `filabridge`: Library shared by the Filament engine and host tools
|
||||
- `filaflat`: Serialization/deserialization library used for materials
|
||||
- `filagui`: Helper library for [Dear ImGui](https://github.com/ocornut/imgui)
|
||||
|
||||
6
build.sh
6
build.sh
@@ -172,6 +172,8 @@ MATOPT_GRADLE_OPTION=""
|
||||
|
||||
ASAN_UBSAN_OPTION=""
|
||||
|
||||
FGDBG_OPTION="-DFILAMENT_ENABLE_FGDBG=OFF"
|
||||
|
||||
IOS_BUILD_SIMULATOR=false
|
||||
BUILD_UNIVERSAL_LIBRARIES=false
|
||||
|
||||
@@ -233,6 +235,7 @@ function build_desktop_target {
|
||||
${MATDBG_OPTION} \
|
||||
${MATOPT_OPTION} \
|
||||
${ASAN_UBSAN_OPTION} \
|
||||
${FGDBG_OPTION} \
|
||||
${deployment_target} \
|
||||
${architectures} \
|
||||
../..
|
||||
@@ -360,6 +363,7 @@ function build_android_target {
|
||||
-DCMAKE_TOOLCHAIN_FILE="../../build/toolchain-${arch}-linux-android.cmake" \
|
||||
${MATDBG_OPTION} \
|
||||
${MATOPT_OPTION} \
|
||||
${FGDBG_OPTION} \
|
||||
${VULKAN_ANDROID_OPTION} \
|
||||
../..
|
||||
fi
|
||||
@@ -594,6 +598,7 @@ function build_ios_target {
|
||||
-DCMAKE_TOOLCHAIN_FILE=../../third_party/clang/iOS.cmake \
|
||||
${MATDBG_OPTION} \
|
||||
${MATOPT_OPTION} \
|
||||
${FGDBG_OPTION} \
|
||||
../..
|
||||
fi
|
||||
|
||||
@@ -778,6 +783,7 @@ while getopts ":hacCfgijmp:q:uvslwtedk:b" opt; do
|
||||
PRINT_MATDBG_HELP=true
|
||||
MATDBG_OPTION="-DFILAMENT_ENABLE_MATDBG=ON, -DFILAMENT_BUILD_FILAMAT=ON"
|
||||
MATDBG_GRADLE_OPTION="-Pcom.google.android.filament.matdbg"
|
||||
FGDBG_OPTION="-DFILAMENT_ENABLE_FGDBG=ON"
|
||||
;;
|
||||
f)
|
||||
ISSUE_CMAKE_ALWAYS=true
|
||||
|
||||
@@ -511,6 +511,13 @@ target_link_libraries(${TARGET} PUBLIC filaflat)
|
||||
target_link_libraries(${TARGET} PUBLIC filabridge)
|
||||
target_link_libraries(${TARGET} PUBLIC ibl-lite)
|
||||
|
||||
if (FILAMENT_ENABLE_FGDBG)
|
||||
target_link_libraries(${TARGET} PUBLIC fgdbg)
|
||||
add_definitions(-DFILAMENT_ENABLE_FGDBG=1)
|
||||
else()
|
||||
add_definitions(-DFILAMENT_ENABLE_FGDBG=0)
|
||||
endif()
|
||||
|
||||
if (FILAMENT_ENABLE_MATDBG)
|
||||
target_link_libraries(${TARGET} PUBLIC matdbg)
|
||||
add_definitions(-DFILAMENT_ENABLE_MATDBG=1)
|
||||
|
||||
BIN
filament/src/details/.Material.cpp.un~
Normal file
BIN
filament/src/details/.Material.cpp.un~
Normal file
Binary file not shown.
@@ -230,6 +230,13 @@ uint32_t FEngine::getJobSystemThreadPoolSize() noexcept {
|
||||
void FEngine::init() {
|
||||
SYSTRACE_CALL();
|
||||
|
||||
#if FILAMENT_ENABLE_FGDBG
|
||||
if (!debug.fgdbg) {
|
||||
auto server = std::make_shared<fgdbg::DebugServer>();
|
||||
debug.fgdbg = std::make_unique<fgdbg::Session>("sample", server);
|
||||
}
|
||||
#endif
|
||||
|
||||
// this must be first.
|
||||
assert_invariant( intptr_t(&mDriverApiStorage) % alignof(DriverApi) == 0 );
|
||||
::new(&mDriverApiStorage) DriverApi(*mDriver, mCommandBufferQueue.getCircularBuffer());
|
||||
@@ -590,16 +597,16 @@ int FEngine::loop() {
|
||||
#endif
|
||||
if (portString != nullptr) {
|
||||
const int port = atoi(portString);
|
||||
debug.server = new matdbg::DebugServer(mBackend, port);
|
||||
debug.matdbg = std::make_unique<matdbg::DebugServer>(mBackend, port);
|
||||
|
||||
// Sometimes the server can fail to spin up (e.g. if the above port is already in use).
|
||||
// When this occurs, carry onward, developers can look at civetweb.txt for details.
|
||||
if (!debug.server->isReady()) {
|
||||
delete debug.server;
|
||||
debug.server = nullptr;
|
||||
if (!debug.matdbg->isReady()) {
|
||||
delete debug.matdbg.get();
|
||||
debug.matdbg = nullptr;
|
||||
} else {
|
||||
debug.server->setEditCallback(FMaterial::onEditCallback);
|
||||
debug.server->setQueryCallback(FMaterial::onQueryCallback);
|
||||
debug.matdbg->setEditCallback(FMaterial::onEditCallback);
|
||||
debug.matdbg->setQueryCallback(FMaterial::onQueryCallback);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -624,6 +631,22 @@ int FEngine::loop() {
|
||||
uint32_t const id = std::thread::hardware_concurrency() - 1;
|
||||
|
||||
while (true) {
|
||||
#if FILAMENT_ENABLE_FGDBG
|
||||
// TODO (@feresr): Only for testing purposes, remove
|
||||
if (debug.fgdbg) {
|
||||
debug.fgdbg->clear();
|
||||
debug.fgdbg->addPass({ "Pass 1", 1, { 1, 3 }, { 1 }});
|
||||
debug.fgdbg->addPass({ "Pass 2", 2, { 4 }, { 1, 2 }});
|
||||
debug.fgdbg->addPass({ "Pass 3", 3, { 2 }, { 4 }});
|
||||
debug.fgdbg->addPass({ "Pass 4", 4, {}, { 4 }});
|
||||
debug.fgdbg->addPass({ "Pass 5", 5, {1, 3}, { 1 }});
|
||||
debug.fgdbg->addResource({ "resource 1", 1, 100 });
|
||||
debug.fgdbg->addResource({ "resource 2", 2, 100 });
|
||||
debug.fgdbg->addResource({ "resource 3", 3, 100 });
|
||||
debug.fgdbg->addResource({ "resource 4", 4, 100 });
|
||||
debug.fgdbg->update();
|
||||
}
|
||||
#endif
|
||||
// looks like thread affinity needs to be reset regularly (on Android)
|
||||
JobSystem::setThreadAffinityById(id);
|
||||
if (!execute()) {
|
||||
|
||||
@@ -58,6 +58,14 @@
|
||||
#include <filament/Texture.h>
|
||||
#include <filament/VertexBuffer.h>
|
||||
|
||||
#if FILAMENT_ENABLE_FGDBG
|
||||
#include <fgdbg/Session.h>
|
||||
#else
|
||||
namespace filament::fgdbg {
|
||||
class DebugServer;
|
||||
} // namespace filament::fgdbg
|
||||
#endif
|
||||
|
||||
#if FILAMENT_ENABLE_MATDBG
|
||||
#include <matdbg/DebugServer.h>
|
||||
#else
|
||||
@@ -519,7 +527,8 @@ public:
|
||||
bool doFrameCapture = false;
|
||||
bool disable_buffer_padding = false;
|
||||
} renderer;
|
||||
matdbg::DebugServer* server = nullptr;
|
||||
std::unique_ptr<matdbg::DebugServer> matdbg = nullptr;
|
||||
std::unique_ptr<fgdbg::Session> fgdbg = nullptr;
|
||||
} debug;
|
||||
};
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ FMaterial::FMaterial(FEngine& engine, const Material::Builder& builder)
|
||||
|
||||
#if FILAMENT_ENABLE_MATDBG
|
||||
// Register the material with matdbg.
|
||||
matdbg::DebugServer* server = downcast(engine).debug.server;
|
||||
matdbg::DebugServer* server = downcast(engine).debug.matdbg.get();
|
||||
if (UTILS_UNLIKELY(server)) {
|
||||
auto details = builder.mImpl;
|
||||
mDebuggerId = server->addMaterial(mName, details->mPayload, details->mSize, this);
|
||||
|
||||
22
libs/fgdbg/CMakeLists.txt
Normal file
22
libs/fgdbg/CMakeLists.txt
Normal file
@@ -0,0 +1,22 @@
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
project(fgdbg)
|
||||
|
||||
set(TARGET fgdbg)
|
||||
set(PUBLIC_HDR_DIR include)
|
||||
|
||||
# ==================================================================================================
|
||||
# Sources and headers
|
||||
# ==================================================================================================
|
||||
|
||||
set(PUBLIC_HDRS include/fgdbg/DebugServer.h include/fgdbg/Session.h)
|
||||
|
||||
set(SRCS src/DebugServer.cpp src/Session.cpp)
|
||||
|
||||
# ==================================================================================================
|
||||
# Include and target definitions
|
||||
# ==================================================================================================
|
||||
|
||||
add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS})
|
||||
target_link_libraries(${TARGET} PUBLIC civetweb utils)
|
||||
target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR})
|
||||
include_directories(${PUBLIC_HDR_DIR})
|
||||
1
libs/fgdbg/README.md
Normal file
1
libs/fgdbg/README.md
Normal file
@@ -0,0 +1 @@
|
||||
# FrameGraph Debugger (WIP)
|
||||
9
libs/fgdbg/client/.gitignore
vendored
Normal file
9
libs/fgdbg/client/.gitignore
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/workspace.xml
|
||||
/.idea/libraries
|
||||
/.idea/caches
|
||||
/.idea/gradle.xml
|
||||
.DS_Store
|
||||
/build
|
||||
BIN
libs/fgdbg/client/.gradle/7.3.3/checksums/checksums.lock
Normal file
BIN
libs/fgdbg/client/.gradle/7.3.3/checksums/checksums.lock
Normal file
Binary file not shown.
BIN
libs/fgdbg/client/.gradle/7.3.3/checksums/md5-checksums.bin
Normal file
BIN
libs/fgdbg/client/.gradle/7.3.3/checksums/md5-checksums.bin
Normal file
Binary file not shown.
BIN
libs/fgdbg/client/.gradle/7.3.3/checksums/sha1-checksums.bin
Normal file
BIN
libs/fgdbg/client/.gradle/7.3.3/checksums/sha1-checksums.bin
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
libs/fgdbg/client/.gradle/7.3.3/fileChanges/last-build.bin
Normal file
BIN
libs/fgdbg/client/.gradle/7.3.3/fileChanges/last-build.bin
Normal file
Binary file not shown.
BIN
libs/fgdbg/client/.gradle/7.3.3/fileHashes/fileHashes.bin
Normal file
BIN
libs/fgdbg/client/.gradle/7.3.3/fileHashes/fileHashes.bin
Normal file
Binary file not shown.
BIN
libs/fgdbg/client/.gradle/7.3.3/fileHashes/fileHashes.lock
Normal file
BIN
libs/fgdbg/client/.gradle/7.3.3/fileHashes/fileHashes.lock
Normal file
Binary file not shown.
Binary file not shown.
0
libs/fgdbg/client/.gradle/7.3.3/gc.properties
Normal file
0
libs/fgdbg/client/.gradle/7.3.3/gc.properties
Normal file
Binary file not shown.
@@ -0,0 +1,2 @@
|
||||
#Thu Oct 20 11:28:41 AEDT 2022
|
||||
gradle.version=7.3.3
|
||||
BIN
libs/fgdbg/client/.gradle/buildOutputCleanup/outputFiles.bin
Normal file
BIN
libs/fgdbg/client/.gradle/buildOutputCleanup/outputFiles.bin
Normal file
Binary file not shown.
BIN
libs/fgdbg/client/.gradle/file-system.probe
Normal file
BIN
libs/fgdbg/client/.gradle/file-system.probe
Normal file
Binary file not shown.
0
libs/fgdbg/client/.gradle/vcs-1/gc.properties
Normal file
0
libs/fgdbg/client/.gradle/vcs-1/gc.properties
Normal file
48
libs/fgdbg/client/build.gradle.kts
Normal file
48
libs/fgdbg/client/build.gradle.kts
Normal file
@@ -0,0 +1,48 @@
|
||||
import org.jetbrains.compose.compose
|
||||
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
kotlin("jvm") version "1.8.0"
|
||||
id("org.jetbrains.compose") version "1.3.0"
|
||||
kotlin("plugin.serialization") version "1.4.20"
|
||||
}
|
||||
|
||||
group = "com.google.filament"
|
||||
version = "1.0"
|
||||
val ktorVersion: String by project
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
|
||||
maven {
|
||||
url = uri("https://maven.pkg.jetbrains.space/public/p/ktor/eap")
|
||||
name = "ktor-eap"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(compose.desktop.currentOs)
|
||||
dependencies {
|
||||
implementation("io.ktor:ktor-client-core:$ktorVersion")
|
||||
implementation("io.ktor:ktor-client-cio:$ktorVersion")
|
||||
implementation("io.ktor:ktor-client-websockets:$ktorVersion")
|
||||
implementation("com.charleskorn.kaml:kaml:0.51.0")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
kotlinOptions.jvmTarget = "11"
|
||||
}
|
||||
|
||||
compose.desktop {
|
||||
application {
|
||||
mainClass = "MainKt"
|
||||
nativeDistributions {
|
||||
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
|
||||
packageName = "fgdbg"
|
||||
packageVersion = "1.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
libs/fgdbg/client/build/classes/kotlin/main/Connection.class
Normal file
BIN
libs/fgdbg/client/build/classes/kotlin/main/Connection.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
libs/fgdbg/client/build/classes/kotlin/main/MainKt$App$1$1.class
Normal file
BIN
libs/fgdbg/client/build/classes/kotlin/main/MainKt$App$1$1.class
Normal file
Binary file not shown.
BIN
libs/fgdbg/client/build/classes/kotlin/main/MainKt$App$1.class
Normal file
BIN
libs/fgdbg/client/build/classes/kotlin/main/MainKt$App$1.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
libs/fgdbg/client/build/classes/kotlin/main/MainKt$App$2.class
Normal file
BIN
libs/fgdbg/client/build/classes/kotlin/main/MainKt$App$2.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
libs/fgdbg/client/build/classes/kotlin/main/MainKt$App$3.class
Normal file
BIN
libs/fgdbg/client/build/classes/kotlin/main/MainKt$App$3.class
Normal file
Binary file not shown.
BIN
libs/fgdbg/client/build/classes/kotlin/main/MainKt$App$4.class
Normal file
BIN
libs/fgdbg/client/build/classes/kotlin/main/MainKt$App$4.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
libs/fgdbg/client/build/classes/kotlin/main/MainKt$Grid$3.class
Normal file
BIN
libs/fgdbg/client/build/classes/kotlin/main/MainKt$Grid$3.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
libs/fgdbg/client/build/classes/kotlin/main/MainKt.class
Normal file
BIN
libs/fgdbg/client/build/classes/kotlin/main/MainKt.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
libs/fgdbg/client/build/classes/kotlin/main/Pass$Companion.class
Normal file
BIN
libs/fgdbg/client/build/classes/kotlin/main/Pass$Companion.class
Normal file
Binary file not shown.
BIN
libs/fgdbg/client/build/classes/kotlin/main/Pass.class
Normal file
BIN
libs/fgdbg/client/build/classes/kotlin/main/Pass.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
libs/fgdbg/client/build/classes/kotlin/main/Payload.class
Normal file
BIN
libs/fgdbg/client/build/classes/kotlin/main/Payload.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
libs/fgdbg/client/build/classes/kotlin/main/Resource.class
Normal file
BIN
libs/fgdbg/client/build/classes/kotlin/main/Resource.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
libs/fgdbg/client/build/kotlin/compileKotlin/build-history.bin
Normal file
BIN
libs/fgdbg/client/build/kotlin/compileKotlin/build-history.bin
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
Риииииииииинвввб
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user