Skip to content

Commit

Permalink
[Misc] Update order of preferred modules for static-lib builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasBanana committed Feb 15, 2025
1 parent b74a9e2 commit b1add83
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
11 changes: 7 additions & 4 deletions include/LLGL/ImageFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ struct LLGL_DEPRECATED("LLGL::DstImageDescriptor is deprecated since 0.04b; Use
\param[in] extent Specifies the extent of the image. This is required
\param[in] threadCount Specifies the number of threads to use for conversion.
If this is less than 2, no multi-threading is used. If this is equal to \c LLGL_MAX_THREAD_COUNT,
the maximal count of threads the system supports will be used (e.g. 4 on a quad-core processor). By default 0.
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).
Note that this does not guarantee the maximum number of threads the system supports if the workload does not demand it. By default 0.
\param[in] copyUnchangedImage Specifies whether to copy the source buffer into the destination buffer if no conversion was necessary. By default false.
\return Number of bytes that have been written to the destination buffer.
Expand Down Expand Up @@ -247,7 +248,7 @@ LLGL_EXPORT std::size_t ConvertImageBuffer(
\brief Converts the image format and data type of the source image (only uncompressed color formats).
\remarks Same as the primary version of ConvertImageBuffer where the \c extent parameter is implied as 1-dimensional size.
This must only be used for tightly packed image buffer, i.e. with a row stride of zero.
\see ConvertImageBuffer(const ImageView&, const MutableImageView&, const Extent3D&, unsigned)
\see ConvertImageBuffer(const ImageView&, const MutableImageView&, const Extent3D&, unsigned, bool)
*/
LLGL_EXPORT std::size_t ConvertImageBuffer(
const ImageView& srcImageView,
Expand All @@ -265,7 +266,8 @@ LLGL_EXPORT std::size_t ConvertImageBuffer(
\param[in] extent Specifies the extent of the image. This is required
\param[in] threadCount Specifies the number of threads to use for conversion.
If this is less than 2, no multi-threading is used. If this is equal to \c LLGL_MAX_THREAD_COUNT,
the maximal count of threads the system supports will be used (e.g. 4 on a quad-core processor). By default 0.
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).
Note that this does not guarantee the maximum number of threads the system supports if the workload does not demand it. By default 0.
\return Byte buffer with the converted image data or null if no conversion is necessary.
This can be casted to the respective target data type (e.g. <code>unsigned char</code>, <code>int</code>, <code>float</code> etc.).
Expand Down Expand Up @@ -315,7 +317,8 @@ LLGL_EXPORT DynamicByteArray DecompressImageBufferToRGBA8UNorm(
\param[in] extent Specifies the image extent. This is required as most compression formats work in block sizes.
\param[in] threadCount Specifies the number of threads to use for decompression.
If this is less than 2, no multi-threading is used. If this is equal to \c LLGL_MAX_THREAD_COUNT,
the maximal count of threads the system supports will be used (e.g. 4 on a quad-core processor). By default 0.
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).
Note that this does not guarantee the maximum number of threads the system supports if the workload does not demand it. By default 0.
\return Byte buffer with the decompressed image data or null if the compression format is not supported for decompression.
*/
LLGL_EXPORT DynamicByteArray DecompressImageBufferToRGBA8UNorm(
Expand Down
4 changes: 3 additions & 1 deletion sources/Core/ImageFlags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,9 @@ LLGL_EXPORT DynamicByteArray ConvertImageBuffer(
unsigned threadCount)
{
LLGL_ASSERT(srcImageView.rowStride == 0, "parameter 'srcImageView.rowStride' must be zero for this version of ConvertImageBuffer()");
const Extent3D extent1D{ static_cast<std::uint32_t>(srcImageView.dataSize / GetMemoryFootprint(srcImageView.format, srcImageView.dataType, 1)), 1u, 1u };
const std::size_t bytesPerPixel = GetMemoryFootprint(srcImageView.format, srcImageView.dataType, 1);
LLGL_ASSERT(bytesPerPixel > 0, "image format and data type not suitable for byte size per pixel");
const Extent3D extent1D{ static_cast<std::uint32_t>(srcImageView.dataSize / bytesPerPixel), 1u, 1u };
return ConvertImageBuffer(srcImageView, dstFormat, dstDataType, extent1D, threadCount);
}

Expand Down
26 changes: 13 additions & 13 deletions sources/Renderer/StaticModuleInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,17 @@ std::vector<std::string> GetStaticModules()
{
return
{
#if LLGL_BUILD_RENDERER_NULL
ModuleNull::GetModuleName(),
#if LLGL_BUILD_RENDERER_DIRECT3D12
ModuleDirect3D12::GetModuleName(),
#endif
#if LLGL_BUILD_RENDERER_DIRECT3D11
ModuleDirect3D11::GetModuleName(),
#endif
#if LLGL_BUILD_RENDERER_VULKAN
ModuleVulkan::GetModuleName(),
#endif
#if LLGL_BUILD_RENDERER_METAL
ModuleMetal::GetModuleName(),
#endif
#if LLGL_BUILD_RENDERER_OPENGL
ModuleOpenGL::GetModuleName(),
Expand All @@ -81,17 +90,8 @@ std::vector<std::string> GetStaticModules()
#if LLGL_BUILD_RENDERER_WEBGL
ModuleWebGL::GetModuleName(),
#endif
#if LLGL_BUILD_RENDERER_VULKAN
ModuleVulkan::GetModuleName(),
#endif
#if LLGL_BUILD_RENDERER_METAL
ModuleMetal::GetModuleName(),
#endif
#if LLGL_BUILD_RENDERER_DIRECT3D11
ModuleDirect3D11::GetModuleName(),
#endif
#if LLGL_BUILD_RENDERER_DIRECT3D12
ModuleDirect3D12::GetModuleName(),
#if LLGL_BUILD_RENDERER_NULL
ModuleNull::GetModuleName(),
#endif
};
}
Expand Down

0 comments on commit b1add83

Please sign in to comment.