-
Notifications
You must be signed in to change notification settings - Fork 59
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
Porting to new API 3 #172
Porting to new API 3 #172
Conversation
…rectly (needs testing)
@AnastaZIuk and @Erfan-Ahmadi ' TODO:
@sadiuk 's TODO #166 (comment)
|
@sadiuk what is the status? |
@AnastaZIuk according to #166 (comment) obj Loader, png and jpeg writers and loaders are tested, also shader loading was fixed when i was doing ex6, but i'm about to start that CWD work, so it'll most likely need a rework and a new round of testing. |
very nice |
@sadiuk perhaps found a new bug for you to fix, there is something definitely wrong with getting shader assets, I think I get infinite loop when trying to execute this one https://github.com/Devsh-Graphics-Programming/Nabla/blob/examplesPort/examples_tests/09.ColorSpaceTest/main.cpp#L86 |
…a implementation). I need to check built-in glsl headers as well, they probably has changed!
added #15 (comment) |
TODO: add camera header after @Erfan-Ahmadi adjusts to following Matt's review c20e00c |
@AnastaZIuk fixed that. Tag me if (or rather when XD) you find more bugs. |
you guys should merge the latest |
that one is curious @sadiuk |
@Erfan-Ahmadi you can use |
…s_port Erfan examples port
…. example. TODO: launch it and test it
…geometry creator probably, most of objects are drawn wrong.
@sadiuk GLI writer doesn't work at all, dds files have 0 bytes |
fixed |
fixed |
… synchronization chad-like, correct pointer const qualifiers in IGPUObjectFromAssetConverter
…example work, remove cpu2gpu params from CommonAPI - it must not be there
@devshgraphicsprogramming changed the base of PR, ready for you |
did you test all the samples which are supposed to work so far (previously ported) ? |
yes, they work but because of changes I need to test and adjust compute shaders sample and megatexture sample |
auto updateCpu2GpuSignalizatorsWithPureObjects = [&]() -> void //! reset the state by creating new gpu objects after cpu2gpu conversion | ||
{ | ||
gpuTransferFence = logicalDevice->createFence(static_cast<video::IGPUFence::E_CREATE_FLAGS>(0)); | ||
gpuTransferSemaphore = logicalDevice->createSemaphore(); | ||
|
||
gpuComputeFence = logicalDevice->createFence(static_cast<video::IGPUFence::E_CREATE_FLAGS>(0)); | ||
gpuComputeSemaphore = logicalDevice->createSemaphore(); | ||
}; |
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.
same question as before
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.
what do you mean?
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.
this sample works
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.
ok, GitHub failed me again
didn't we solve the fence thing last week?
Also you can reuse semaphores just fine, you just need each signal and wait to come in pairs and always happen (signal must be consumed).
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.
like we shouldn't need to create fresh fences anymore, just use the same one for all transfers and await at the end after the last and manual submit.
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.
ok, GitHub failed me again
didn't we solve the fence thing last week?
Also you can reuse semaphores just fine, you just need each signal and wait to come in pairs and always happen (signal must be consumed).
yeah we did it, actually I should use those semaphoes, fences because they do nothing at all (I should use their signalized state for some wait)
…sualStudio merge tool)
…ystem TODO), add byteswap utility
include/nbl/core/Byteswap.h
Outdated
class Byteswap | ||
{ | ||
Byteswap() = delete; | ||
public: | ||
|
||
#if defined(_NBL_WINDOWS_API_) && defined(_MSC_VER) && (_MSC_VER > 1298) | ||
#include <stdlib.h> | ||
#define bswap_16(X) _byteswap_ushort(X) | ||
#define bswap_32(X) _byteswap_ulong(X) | ||
#elif defined(_NBL_OSX_PLATFORM_) | ||
#include <libkern/OSByteOrder.h> | ||
#define bswap_16(X) OSReadSwapInt16(&X,0) | ||
#define bswap_32(X) OSReadSwapInt32(&X,0) | ||
#elif defined(__FreeBSD__) || defined(__OpenBSD__) | ||
#include <sys/endian.h> | ||
#define bswap_16(X) bswap16(X) | ||
#define bswap_32(X) bswap32(X) | ||
#else | ||
#define bswap_16(X) ((((X)&0xFF) << 8) | (((X)&0xFF00) >> 8)) | ||
#define bswap_32(X) ( (((X)&0x000000FF)<<24) | (((X)&0xFF000000) >> 24) | (((X)&0x0000FF00) << 8) | (((X) &0x00FF0000) >> 8)) | ||
#endif | ||
|
||
template<typename NUM_TYPE> | ||
static inline NUM_TYPE byteswap(NUM_TYPE number) | ||
{ | ||
if constexpr (std::is_same<NUM_TYPE, int8_t>::value) | ||
return number; | ||
else if (std::is_same<NUM_TYPE, uint8_t>::value) | ||
return number; | ||
else if (std::is_same<NUM_TYPE, uint16_t>::value) | ||
return bswap_16(number); | ||
else if (std::is_same<NUM_TYPE, int16_t>::value) | ||
return bswap_16(number); | ||
else if (std::is_same<NUM_TYPE, uint32_t>::value) | ||
return bswap_32(number); | ||
else if (std::is_same<NUM_TYPE, int32_t>::value) | ||
return bswap_32(number); | ||
else if (std::is_same<NUM_TYPE, float>::value) | ||
{ | ||
uint32_t value = core::IR(number); | ||
value = bswap_32(value); | ||
return core::FR(value); | ||
} | ||
else | ||
static_assert(false, "there are not another supported types!"); | ||
} | ||
}; |
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.
I f***ing hate this class/implementation, can you find something cleaner online using C++11 or C++20 that doesnt do this macro fuckery?
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.
also should be a free floating function, not some weird class
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.
wtf is #include stdlib.h
inside class definition XD
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.
wtf is
#include stdlib.h
inside class definition XD
XD
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.
copy paste magic
…some dependencies. Either changing input file and adding cmake definitions works.
…template from byteswap class, change contextes
…t for supporting virtual files input (NEEEDS TESTING!)
… to begin with 0 index resource
@Erfan-Ahmadi we can continue our work here