mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 09:00:44 +00:00
Support A2B10G10R10_SNORM in buffer viewer.
This commit is contained in:
committed by
Baldur Karlsson
parent
8a477d096a
commit
50dc1d6faa
@@ -544,7 +544,8 @@ QVariantList FormatElement::GetVariants(const byte *&data, const byte *end) cons
|
||||
ret.push_back((float)b);
|
||||
ret.push_back((float)a);
|
||||
}
|
||||
else if(format.compType == CompType::SInt || format.compType == CompType::SScaled)
|
||||
else if(format.compType == CompType::SInt || format.compType == CompType::SScaled ||
|
||||
format.compType == CompType::SNorm)
|
||||
{
|
||||
int ir, ig, ib, ia;
|
||||
|
||||
@@ -584,6 +585,22 @@ QVariantList FormatElement::GetVariants(const byte *&data, const byte *end) cons
|
||||
ret.push_back((float)ib);
|
||||
ret.push_back((float)ia);
|
||||
}
|
||||
else if(format.compType == CompType::SNorm)
|
||||
{
|
||||
if(ir == -512)
|
||||
ir = -511;
|
||||
if(ig == -512)
|
||||
ig = -511;
|
||||
if(ib == -512)
|
||||
ib = -511;
|
||||
if(ia == -2)
|
||||
ia = -1;
|
||||
|
||||
ret.push_back((float)ir / 511.0f);
|
||||
ret.push_back((float)ig / 511.0f);
|
||||
ret.push_back((float)ib / 511.0f);
|
||||
ret.push_back((float)ia / 1.0f);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user