Skip to content
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

Merged
merged 60 commits into from
Aug 24, 2021
Merged

Porting to new API 3 #172

merged 60 commits into from
Aug 24, 2021

Conversation

AnastaZIuk
Copy link
Member

@Erfan-Ahmadi we can continue our work here

@AnastaZIuk
Copy link
Member Author

AnastaZIuk commented Aug 5, 2021

@AnastaZIuk and @Erfan-Ahmadi ' TODO:

  • rudimentary camera implementation
  • Sponza examples (all of them)
  • Color Space example
  • Bullet example
  • Any related example
  • ScreenShot extension
  • FullScreenTriangle extension
  • CQuantNormalCache reading/writing
  • Mesh Loaders PLY/STL
  • Mesh Writers PLY/STL

@sadiuk 's TODO #166 (comment)

  • shaders loading
  • loaders (according to the list priority)
  • writers (according to the list priority)

@AnastaZIuk
Copy link
Member Author

@sadiuk what is the status?

@sadiuk
Copy link
Contributor

sadiuk commented Aug 6, 2021

@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.

@AnastaZIuk
Copy link
Member Author

@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

@AnastaZIuk
Copy link
Member Author

@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!
@AnastaZIuk
Copy link
Member Author

added #15 (comment)

@AnastaZIuk
Copy link
Member Author

TODO: add camera header after @Erfan-Ahmadi adjusts to following Matt's review c20e00c

@sadiuk
Copy link
Contributor

sadiuk commented Aug 9, 2021

@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

@AnastaZIuk fixed that. Tag me if (or rather when XD) you find more bugs.

@devshgraphicsprogramming
Copy link
Member

you guys should merge the latest input_channel_demo which includes C++20

@AnastaZIuk
Copy link
Member Author

@AnastaZIuk
Copy link
Member Author

that one is curious @sadiuk
image
seems like something is wrong when destroying objects after returning from main?

@AnastaZIuk
Copy link
Member Author

@Erfan-Ahmadi you can use QToQuitEventReceiver.h in your examples to leave the hot loop by the way

@AnastaZIuk AnastaZIuk changed the title Porting Examples to new API 3 Porting to new API 3 Aug 11, 2021
…geometry creator probably, most of objects are drawn wrong.
@AnastaZIuk
Copy link
Member Author

TODO: GeometryCreator bugs, only 2 of 9 get displayed, and they are displayed wrong, the geometry is screwed!
image

@AnastaZIuk
Copy link
Member Author

@sadiuk GLI writer doesn't work at all, dds files have 0 bytes

@AnastaZIuk
Copy link
Member Author

and what is that? I get this each time
image

@AnastaZIuk
Copy link
Member Author

@sadiuk GLI writer doesn't work at all, dds files have 0 bytes

fixed

@AnastaZIuk
Copy link
Member Author

@sadiuk also there is something wrong with GLI loader, it doesn't load some ktx files, it returns empty assets

fixed

… synchronization chad-like, correct pointer const qualifiers in IGPUObjectFromAssetConverter
@AnastaZIuk
Copy link
Member Author

that one is curious @sadiuk
image
seems like something is wrong when destroying objects after returning from main?

okay I found that it is probably a bug for @Crisspl
something is wrong with destroyGlObjects

@AnastaZIuk AnastaZIuk changed the base branch from criss_android to apis_as_plugins August 15, 2021 21:06
@AnastaZIuk
Copy link
Member Author

@devshgraphicsprogramming changed the base of PR, ready for you

@devshgraphicsprogramming
Copy link
Member

did you test all the samples which are supposed to work so far (previously ported) ?

@AnastaZIuk
Copy link
Member Author

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

Comment on lines +118 to +125
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();
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question as before

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this sample works

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).

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.

Copy link
Member Author

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)

Comment on lines 13 to 59
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!");
}
};
Copy link
Member

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?

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

Copy link
Collaborator

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

Copy link
Member Author

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy paste magic

Base automatically changed from apis_as_plugins to property_pool August 18, 2021 14:44
@AnastaZIuk AnastaZIuk merged commit 958f2fd into property_pool Aug 24, 2021
@AnastaZIuk AnastaZIuk deleted the examplesPort branch August 24, 2021 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants