Skip to content

Commit b1add83

Browse files
committed
[Misc] Update order of preferred modules for static-lib builds.
1 parent b74a9e2 commit b1add83

File tree

3 files changed

+23
-18
lines changed

3 files changed

+23
-18
lines changed

include/LLGL/ImageFlags.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ struct LLGL_DEPRECATED("LLGL::DstImageDescriptor is deprecated since 0.04b; Use
217217
\param[in] extent Specifies the extent of the image. This is required
218218
\param[in] threadCount Specifies the number of threads to use for conversion.
219219
If this is less than 2, no multi-threading is used. If this is equal to \c LLGL_MAX_THREAD_COUNT,
220-
the maximal count of threads the system supports will be used (e.g. 4 on a quad-core processor). By default 0.
220+
the number of threads will be determined by the workload and the available CPU cores the system supports (e.g. 4 on a quad-core processor).
221+
Note that this does not guarantee the maximum number of threads the system supports if the workload does not demand it. By default 0.
221222
\param[in] copyUnchangedImage Specifies whether to copy the source buffer into the destination buffer if no conversion was necessary. By default false.
222223
223224
\return Number of bytes that have been written to the destination buffer.
@@ -247,7 +248,7 @@ LLGL_EXPORT std::size_t ConvertImageBuffer(
247248
\brief Converts the image format and data type of the source image (only uncompressed color formats).
248249
\remarks Same as the primary version of ConvertImageBuffer where the \c extent parameter is implied as 1-dimensional size.
249250
This must only be used for tightly packed image buffer, i.e. with a row stride of zero.
250-
\see ConvertImageBuffer(const ImageView&, const MutableImageView&, const Extent3D&, unsigned)
251+
\see ConvertImageBuffer(const ImageView&, const MutableImageView&, const Extent3D&, unsigned, bool)
251252
*/
252253
LLGL_EXPORT std::size_t ConvertImageBuffer(
253254
const ImageView& srcImageView,
@@ -265,7 +266,8 @@ LLGL_EXPORT std::size_t ConvertImageBuffer(
265266
\param[in] extent Specifies the extent of the image. This is required
266267
\param[in] threadCount Specifies the number of threads to use for conversion.
267268
If this is less than 2, no multi-threading is used. If this is equal to \c LLGL_MAX_THREAD_COUNT,
268-
the maximal count of threads the system supports will be used (e.g. 4 on a quad-core processor). By default 0.
269+
the number of threads will be determined by the workload and the available CPU cores the system supports (e.g. 4 on a quad-core processor).
270+
Note that this does not guarantee the maximum number of threads the system supports if the workload does not demand it. By default 0.
269271
270272
\return Byte buffer with the converted image data or null if no conversion is necessary.
271273
This can be casted to the respective target data type (e.g. <code>unsigned char</code>, <code>int</code>, <code>float</code> etc.).
@@ -315,7 +317,8 @@ LLGL_EXPORT DynamicByteArray DecompressImageBufferToRGBA8UNorm(
315317
\param[in] extent Specifies the image extent. This is required as most compression formats work in block sizes.
316318
\param[in] threadCount Specifies the number of threads to use for decompression.
317319
If this is less than 2, no multi-threading is used. If this is equal to \c LLGL_MAX_THREAD_COUNT,
318-
the maximal count of threads the system supports will be used (e.g. 4 on a quad-core processor). By default 0.
320+
the number of threads will be determined by the workload and the available CPU cores the system supports (e.g. 4 on a quad-core processor).
321+
Note that this does not guarantee the maximum number of threads the system supports if the workload does not demand it. By default 0.
319322
\return Byte buffer with the decompressed image data or null if the compression format is not supported for decompression.
320323
*/
321324
LLGL_EXPORT DynamicByteArray DecompressImageBufferToRGBA8UNorm(

sources/Core/ImageFlags.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,9 @@ LLGL_EXPORT DynamicByteArray ConvertImageBuffer(
880880
unsigned threadCount)
881881
{
882882
LLGL_ASSERT(srcImageView.rowStride == 0, "parameter 'srcImageView.rowStride' must be zero for this version of ConvertImageBuffer()");
883-
const Extent3D extent1D{ static_cast<std::uint32_t>(srcImageView.dataSize / GetMemoryFootprint(srcImageView.format, srcImageView.dataType, 1)), 1u, 1u };
883+
const std::size_t bytesPerPixel = GetMemoryFootprint(srcImageView.format, srcImageView.dataType, 1);
884+
LLGL_ASSERT(bytesPerPixel > 0, "image format and data type not suitable for byte size per pixel");
885+
const Extent3D extent1D{ static_cast<std::uint32_t>(srcImageView.dataSize / bytesPerPixel), 1u, 1u };
884886
return ConvertImageBuffer(srcImageView, dstFormat, dstDataType, extent1D, threadCount);
885887
}
886888

sources/Renderer/StaticModuleInterface.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,17 @@ std::vector<std::string> GetStaticModules()
6969
{
7070
return
7171
{
72-
#if LLGL_BUILD_RENDERER_NULL
73-
ModuleNull::GetModuleName(),
72+
#if LLGL_BUILD_RENDERER_DIRECT3D12
73+
ModuleDirect3D12::GetModuleName(),
74+
#endif
75+
#if LLGL_BUILD_RENDERER_DIRECT3D11
76+
ModuleDirect3D11::GetModuleName(),
77+
#endif
78+
#if LLGL_BUILD_RENDERER_VULKAN
79+
ModuleVulkan::GetModuleName(),
80+
#endif
81+
#if LLGL_BUILD_RENDERER_METAL
82+
ModuleMetal::GetModuleName(),
7483
#endif
7584
#if LLGL_BUILD_RENDERER_OPENGL
7685
ModuleOpenGL::GetModuleName(),
@@ -81,17 +90,8 @@ std::vector<std::string> GetStaticModules()
8190
#if LLGL_BUILD_RENDERER_WEBGL
8291
ModuleWebGL::GetModuleName(),
8392
#endif
84-
#if LLGL_BUILD_RENDERER_VULKAN
85-
ModuleVulkan::GetModuleName(),
86-
#endif
87-
#if LLGL_BUILD_RENDERER_METAL
88-
ModuleMetal::GetModuleName(),
89-
#endif
90-
#if LLGL_BUILD_RENDERER_DIRECT3D11
91-
ModuleDirect3D11::GetModuleName(),
92-
#endif
93-
#if LLGL_BUILD_RENDERER_DIRECT3D12
94-
ModuleDirect3D12::GetModuleName(),
93+
#if LLGL_BUILD_RENDERER_NULL
94+
ModuleNull::GetModuleName(),
9595
#endif
9696
};
9797
}

0 commit comments

Comments
 (0)