Helpers

Helper functions used throughout Cauldron.

Functions

Return type

Description

std::string

WStringToString (const std::wstring& string)
Converts an std::wstring to std::string.

std::wstring

StringToWString (const std::string& string)
Converts an std::string to std::wstring.

template <typename T> T

AlignUp (T val, T alignment)
Aligns a size up to the specified amount.

constexpr uint32_t

DivideRoundingUp (uint32_t a, uint32_t b)
Computes the rounded-up integer division of two unsigned integers.

uint8_t

CountBitsSet (uint32_t val)
Computes the number of bits set to 1 in a integer.

Macros

Detailed description

Helper functions used throughout Cauldron.

Global functions

WStringToString

Copied!

std::string WStringToString (const std::wstring& string)

Converts an std::wstring to std::string.

Parameters:

string

The std::wstring to convert to std::string.

Returns:

The std::string representation of the std::wstring.


StringToWString

Copied!

std::wstring StringToWString (const std::string& string)

Converts an std::string to std::wstring.

Parameters:

string

The std::string to convert to std::wstring.

Returns:

The std::wstring representation of the std::string.


AlignUp

Copied!

template <typename T>   T AlignUp (T val, T alignment)

Aligns a size up to the specified amount.

Parameters:

val

The value to align.

alignment

The alignment to align the value to.

Returns:

The new aligned (if not already aligned) value.


DivideRoundingUp

Copied!

constexpr uint32_t DivideRoundingUp (uint32_t a, uint32_t b)

Computes the rounded-up integer division of two unsigned integers.

Parameters:

a

The dividend.

b

The divisor.

Returns:

The smallest integer greater than or equal to the exact division of a and b.


CountBitsSet

Copied!

uint8_t CountBitsSet (uint32_t val)

Computes the number of bits set to 1 in a integer.

Parameters:

val

Integer mask.

Returns:

Number of bits set to 1 in provided val.


Macros

NO_COPY

Copied!

#define NO_COPY (typeName)     typeName(const typeName&) = delete; \\
typeName& operator=(const typeName&) = delete;

Deletes copy constructors from typeName class so the class can not be copied.


NO_MOVE

Copied!

#define NO_MOVE (typeName)     typeName(const typeName&&) = delete; \\
typeName& operator=(const typeName&&) = delete;

Deletes move constructors from typeName class so the class can not be moved.


Related pages

  • Visit the FidelityFX SDK product page for download links and more information.

Looking for more documentation on GPUOpen?

AMD GPUOpen software blogs

Our handy software release blogs will help you make good use of our tools, SDKs, and effects, as well as sharing the latest features with new releases.

GPUOpen Manuals

Don’t miss our manual documentation! And if slide decks are what you’re after, you’ll find 100+ of our finest presentations here.

AMD GPUOpen Performance Guides

The home of great performance and optimization advice for AMD RDNAâ„¢ 2 GPUs, AMD Ryzenâ„¢ CPUs, and so much more.

Getting started: AMD GPUOpen software

New or fairly new to AMD’s tools, libraries, and effects? This is the best place to get started on GPUOpen!

AMD GPUOpen Getting Started Development and Performance

Looking for tips on getting started with developing and/or optimizing your game, whether on AMD hardware or generally? We’ve got you covered!

AMD GPUOpen Technical blogs

Browse our technical blogs, and find valuable advice on developing with AMD hardware, ray tracing, Vulkan®, DirectX®, Unreal Engine, and lots more.

Find out more about our software!

AMD GPUOpen Effects - AMD FidelityFX technologies

Create wonder. No black boxes. Meet the AMD FidelityFX SDK!

AMD GPUOpen Samples

Browse all our useful samples. Perfect for when you’re needing to get started, want to integrate one of our libraries, and much more.

AMD GPUOpen developer SDKs

Discover what our SDK technologies can offer you. Query hardware or software, manage memory, create rendering applications or machine learning, and much more!

AMD GPUOpen Developer Tools

Analyze, Optimize, Profile, Benchmark. We provide you with the developer tools you need to make sure your game is the best it can be!