mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-25 07:05:48 +00:00
Move CalcNumMips to common header so GL code can access it
This commit is contained in:
@@ -223,6 +223,21 @@ bool FindDiffRange(void *a, void *b, size_t bufSize, size_t &diffStart, size_t &
|
||||
return diffStart < bufSize;
|
||||
}
|
||||
|
||||
uint32_t CalcNumMips(int w, int h, int d)
|
||||
{
|
||||
int mipLevels = 1;
|
||||
|
||||
while(w > 1 || h > 1 || d > 1)
|
||||
{
|
||||
w = RDCMAX(1, w>>1);
|
||||
h = RDCMAX(1, h>>1);
|
||||
d = RDCMAX(1, d>>1);
|
||||
mipLevels++;
|
||||
}
|
||||
|
||||
return mipLevels;
|
||||
}
|
||||
|
||||
static string &logfile()
|
||||
{
|
||||
static string fn;
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "globalconfig.h"
|
||||
|
||||
@@ -84,6 +85,7 @@ inline T AlignUp16(T x) { return (x+0xf) & (~0xf); }
|
||||
#define MAKE_FOURCC(a, b, c, d) (((uint32_t)(d) << 24) | ((uint32_t)(c) << 16) | ((uint32_t)(b) << 8) | (uint32_t)(a))
|
||||
|
||||
bool FindDiffRange(void *a, void *b, size_t bufSize, size_t &diffStart, size_t &diffEnd);
|
||||
uint32_t CalcNumMips(int Width, int Height, int Depth);
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
// Debugging features
|
||||
|
||||
Reference in New Issue
Block a user