-
Notifications
You must be signed in to change notification settings - Fork 13
Ex builtin archives #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
devshgraphicsprogramming
wants to merge
12
commits into
master
Choose a base branch
from
exBuiltinArchives
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Ex builtin archives #200
Changes from 2 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
bb68b7b
create REGISTER_COMMON_BUILTINS, register example API source & includ…
AnastaZIuk cbcc1c9
create INTERFACE_TO_BUILTINS, add NblExtExamplesAPIBuiltinsSPIRV targ…
AnastaZIuk c71e386
update CMake to support (NOT NBL_EMBED_BUILTIN_RESOURCES) mode but it…
AnastaZIuk 229b521
remove my tests and assume pre-compiled SPIRV for CSimpleDebugRendere…
AnastaZIuk 0cd6f7e
Merge branch 'master' of github.com:Devsh-Graphics-Programming/Nabla-…
AnastaZIuk 9eb0615
Merge branch 'master' of github.com:Devsh-Graphics-Programming/Nabla-…
AnastaZIuk 60bdf1b
use NBL_REGISTER_BUILD_MOUNT_POINT, update BuiltinResourcesApplicatio…
AnastaZIuk 767e6c4
update common/src/nbl/examples/CMakeLists.txt
AnastaZIuk c573951
update some examples after moving spirv target field
AnastaZIuk 89ab539
update CMakeLists.txt files after changes, remove .hlsl ext part from…
AnastaZIuk e074ad3
use json canonical KEY field, update common/src/nbl/examples/CMakeLis…
AnastaZIuk a6271a4
adjust to new API changes
AnastaZIuk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,20 +4,25 @@ | |
#ifndef _NBL_EXAMPLES_BUILTIN_RESOURCE_APPLICATION_HPP_INCLUDED_ | ||
#define _NBL_EXAMPLES_BUILTIN_RESOURCE_APPLICATION_HPP_INCLUDED_ | ||
|
||
|
||
// we need a system, logger and an asset manager | ||
#include "nbl/application_templates/MonoAssetManagerApplication.hpp" | ||
|
||
#ifdef NBL_EMBED_BUILTIN_RESOURCES | ||
// TODO: the include/header `nbl/examples` archive | ||
// TODO: the source `nbl/examples` archive | ||
// TODO: the build `nbl/examples` archive | ||
#if __has_include("nbl/this_example/builtin/CArchive.h") | ||
#include "nbl/this_example/builtin/CArchive.h" | ||
#endif | ||
#include "nbl/builtin/examples/include/CArchive.h" | ||
#include "nbl/builtin/examples/src/CArchive.h" | ||
#include "nbl/builtin/examples/build/spirv/CArchive.h" | ||
#if __has_include("nbl/this_example/builtin/CArchive.h") | ||
#include "nbl/this_example/builtin/CArchive.h" | ||
#endif | ||
// TODO: (**) there should be also 5th arch "nbl/this_example/builtin/build/spirv/CArchive.h" | ||
/* | ||
#if __has_include("nbl/this_example/builtin/build/spirv/CArchive.h") | ||
#include "nbl/this_example/builtin/build/spirv/CArchive.h" | ||
#endif | ||
*/ | ||
//! this ain't meant to be the same as this_example ordinary archive | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you need 3 (include,src,build) to keep symmetry with rest, then |
||
#endif | ||
|
||
|
||
namespace nbl::examples | ||
{ | ||
|
||
|
@@ -40,29 +45,35 @@ class BuiltinResourcesApplication : public virtual application_templates::MonoAs | |
|
||
using namespace core; | ||
|
||
smart_refctd_ptr<system::IFileArchive> examplesHeaderArch,examplesSourceArch,examplesBuildArch,thisExampleArch; | ||
#ifdef NBL_EMBED_BUILTIN_RESOURCES | ||
// TODO: the 3 examples archives | ||
smart_refctd_ptr<system::IFileArchive> examplesHeaderArch,examplesSourceArch,examplesBuildSpirvArch,thisExampleArch; | ||
#ifdef NBL_EMBED_BUILTIN_RESOURCES | ||
examplesHeaderArch = core::make_smart_refctd_ptr<nbl::builtin::examples::include::CArchive>(smart_refctd_ptr(m_logger)); | ||
examplesSourceArch = core::make_smart_refctd_ptr<nbl::builtin::examples::src::CArchive>(smart_refctd_ptr(m_logger)); | ||
examplesBuildSpirvArch = core::make_smart_refctd_ptr<nbl::builtin::examples::build::spirv::CArchive>(smart_refctd_ptr(m_logger)); | ||
|
||
#ifdef _NBL_THIS_EXAMPLE_BUILTIN_C_ARCHIVE_H_ | ||
thisExampleArch = make_smart_refctd_ptr<nbl::this_example::builtin::CArchive>(smart_refctd_ptr(m_logger)); | ||
#endif | ||
#else | ||
// TODO: (**) | ||
#else | ||
examplesHeaderArch = make_smart_refctd_ptr<system::CMountDirectoryArchive>(localInputCWD/"../common/include/nbl/examples",smart_refctd_ptr(m_logger),m_system.get()); | ||
examplesSourceArch = make_smart_refctd_ptr<system::CMountDirectoryArchive>(localInputCWD/"../common/src/nbl/examples",smart_refctd_ptr(m_logger),m_system.get()); | ||
// TODO: examplesBuildArch = | ||
examplesBuildSpirvArch = make_smart_refctd_ptr<system::CMountDirectoryArchive>(NBL_EXAMPLES_BUILD_SPIRV_MOUNT_POINT, smart_refctd_ptr(m_logger), m_system.get()); | ||
thisExampleArch = make_smart_refctd_ptr<system::CMountDirectoryArchive>(localInputCWD/"app_resources",smart_refctd_ptr(m_logger),m_system.get()); | ||
#endif | ||
// TODO: (**) | ||
#endif | ||
// yes all 3 aliases are meant to be the same | ||
m_system->mount(std::move(examplesHeaderArch),"nbl/examples"); | ||
m_system->mount(std::move(examplesSourceArch),"nbl/examples"); | ||
// m_system->mount(std::move(examplesBuildArch),"nbl/examples"); | ||
m_system->mount(std::move(examplesBuildSpirvArch),"nbl/examples"); | ||
if (thisExampleArch) | ||
m_system->mount(std::move(thisExampleArch),"app_resources"); | ||
// TODO: (**) | ||
|
||
return true; | ||
} | ||
}; | ||
|
||
} | ||
|
||
#endif // _CAMERA_IMPL_ | ||
#endif // _NBL_EXAMPLES_BUILTIN_RESOURCE_APPLICATION_HPP_INCLUDED_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,21 @@ | ||
# TODO builtin SPIR-V shaders | ||
# add_subdirectory(geometry EXCLUDE_FROM_ALL) | ||
set(SPIRV_TARGET_V 6_8) | ||
|
||
# TODO: make docs once I get n4ce embed SPIRV tool to build system and then use the tool with Matts new shader | ||
set(COMMON_OPTIONS | ||
-I "${COMMON_INCLUDE_DIRECTORY}" | ||
) | ||
|
||
NBL_REGISTER_SPIRV_SHADERS( | ||
MOUNT_POINT_DEFINE | ||
NBL_EXAMPLES_BUILD_SPIRV_MOUNT_POINT | ||
|
||
ARCHIVE | ||
TARGET NblExtExamplesAPIBuiltinsSPIRV | ||
INPUT_DIRECTORY . | ||
NAMESPACE nbl::builtin::examples::build::spirv | ||
|
||
INPUTS | ||
KEY shaders/geometry/unified.hlsl COMPILE_OPTIONS ${COMMON_OPTIONS} -T lib_${SPIRV_TARGET_V} | ||
# KEY <xyz> COMPILE_OPTIONS ${COMMON_OPTIONS} -T <target>_${SPIRV_TARGET_V} | ||
) | ||
|
||
INTERFACE_TO_BUILTINS(NblExtExamplesAPIBuiltinsSPIRV) |
This file was deleted.
Oops, something went wrong.
43 changes: 0 additions & 43 deletions
43
common/src/nbl/examples/geometry/shaders/template/grid.common.hlsl
This file was deleted.
Oops, something went wrong.
File renamed without changes.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why SPIR-V, could be anything in the build dir really