GPU/HW: Simplify shader compile progress updates

This commit is contained in:
Connor McLaughlin
2021-07-11 13:21:41 +10:00
parent 98af6e7228
commit 096a92ba84
6 changed files with 84 additions and 107 deletions

View File

@@ -163,6 +163,23 @@ protected:
u32 num_uniform_buffer_updates;
};
class ShaderCompileProgressTracker
{
public:
ShaderCompileProgressTracker(std::string title, u32 total);
void Increment();
private:
std::string m_title;
u64 m_start_time;
u64 m_last_update_time;
u64 m_min_time;
u64 m_update_interval;
u32 m_progress;
u32 m_total;
};
static constexpr std::tuple<float, float, float, float> RGBA8ToFloat(u32 rgba)
{
return std::make_tuple(static_cast<float>(rgba & UINT32_C(0xFF)) * (1.0f / 255.0f),