-
-
Notifications
You must be signed in to change notification settings - Fork 79
Fix multiple configuration errors #1781
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,11 +33,13 @@ | |
|
|
||
| using namespace gpu; | ||
|
|
||
| #if defined(NVTT_API) | ||
| #include <nvtt/nvtt.h> | ||
|
|
||
| #undef _CRT_SECURE_NO_WARNINGS | ||
| #include <Etc.h> | ||
| #include <EtcFilter.h> | ||
| #endif | ||
|
|
||
| static const glm::uvec2 SPARSE_PAGE_SIZE(128); | ||
| static const glm::uvec2 MAX_TEXTURE_SIZE_GLES(2048); | ||
|
|
@@ -353,7 +355,7 @@ std::pair<gpu::TexturePointer, glm::ivec2> processImage(std::shared_ptr<QIODevic | |
| // Validate that the image loaded | ||
| if (imageWidth == 0 || imageHeight == 0 || image.getFormat() == Image::Format_Invalid) { | ||
| QString reason(image.getFormat() == Image::Format_Invalid ? "(Invalid Format)" : "(Size is invalid)"); | ||
| qCWarning(imagelogging) << "Failed to load" << QString::fromStdString(filename) << ":" << qPrintable(reason); | ||
| qCWarning(imagelogging) << "Failed to load" << QString::fromStdString(filename) << ":" << qPrintable(reason); | ||
| return { nullptr, { imageWidth, imageHeight } }; | ||
| } | ||
|
|
||
|
|
@@ -500,11 +502,9 @@ struct MyErrorHandler : public nvtt::ErrorHandler { | |
| } | ||
| }; | ||
|
|
||
| #if defined(NVTT_API) | ||
| class SequentialTaskDispatcher : public nvtt::TaskDispatcher { | ||
| public: | ||
| SequentialTaskDispatcher(const std::atomic<bool>& abortProcessing = false) : _abortProcessing(abortProcessing) { | ||
| } | ||
| SequentialTaskDispatcher(const std::atomic<bool>& abortProcessing = false) : _abortProcessing(abortProcessing) {} | ||
|
|
||
| const std::atomic<bool>& _abortProcessing; | ||
|
|
||
|
|
@@ -518,7 +518,6 @@ class SequentialTaskDispatcher : public nvtt::TaskDispatcher { | |
| } | ||
| } | ||
| }; | ||
| #endif | ||
|
|
||
| void convertToFloatFromPacked(const unsigned char* source, int width, int height, size_t srcLineByteStride, gpu::Element sourceFormat, | ||
| glm::vec4* output, size_t outputLinePixelStride) { | ||
|
|
@@ -771,12 +770,12 @@ void convertImageToLDRTexture(gpu::Texture* texture, Image&& image, BackendTarge | |
| } | ||
| } else { | ||
| int numMips = 1; | ||
|
|
||
| if (buildMips) { | ||
| numMips += (int)log2(std::max(width, height)) - baseMipLevel; | ||
| } | ||
| assert(numMips > 0); | ||
| Etc::RawImage *mipMaps = new Etc::RawImage[numMips]; | ||
| Etc::RawImage* mipMaps = new Etc::RawImage[numMips]; | ||
|
Member
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. Someone more knowledgable in C++ than I should review this single line.
Collaborator
Author
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. Sorry that was something I missed. My auto-formatter changed it and I forgot to revert it |
||
| Etc::Image::Format etcFormat = Etc::Image::Format::DEFAULT; | ||
|
|
||
| if (mipFormat == gpu::Element::COLOR_COMPRESSED_ETC2_RGB) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,4 +13,4 @@ target_opengl() | |
|
|
||
| if (WIN32) | ||
| add_compile_definitions(_USE_MATH_DEFINES) | ||
| endif() | ||
| endif() | ||
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 don't think you can remove that if-statement there, since you changed it so if NVTT_API is not defined, nvtt.h won't be included. Meaning nvtt::TaskDispatcher won't be available if NVTT_API is not defined and the build will fail.
Uh oh!
There was an error while loading. Please reload this page.
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 is-statement is encased in another
NVTT_APIcheck, which I think might be an error, becauseconvertImageToLDRTextureandconvertImageToHDRTextureare referenced in non-NVTT_API-checked code, meaning we have a hard dependency to nvtt.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 see.
Yeah, I wouldn't be surprised if we depend on NVTT. We never tried without it, and it is actually a huge library with a LOT of functionality. We do depend on GLM though, so maybe that can take over? I don't know too much about those things.