Change SRGB to be a component type, not a ResourceFormat flag

* This allows us to have sRGB as a type hint, and better matches API format
  types.
* It's currently impossible and unlikely to ever be the case that srgb is
  applied to anything other than UNorm, so having it be independent from the
  component type was a degree of freedom that was unused.
This commit is contained in:
baldurk
2019-01-14 13:19:59 +00:00
parent d72d924c39
commit 44da10be06
10 changed files with 108 additions and 133 deletions
+1 -3
View File
@@ -461,14 +461,12 @@ void ImageViewer::RefreshFile()
ResourceFormat rgba8_unorm;
rgba8_unorm.compByteWidth = 1;
rgba8_unorm.compCount = 4;
rgba8_unorm.compType = CompType::UNorm;
rgba8_unorm.compType = CompType::UNormSRGB;
rgba8_unorm.type = ResourceFormatType::Regular;
rgba8_unorm.SetSRGBCorrected(true);
ResourceFormat rgba32_float = rgba8_unorm;
rgba32_float.compByteWidth = 4;
rgba32_float.compType = CompType::Float;
rgba32_float.SetSRGBCorrected(false);
texDetails.creationFlags = TextureCategory::SwapBuffer | TextureCategory::ColorTarget;
texDetails.cubemap = false;