535f6b0adc
Modify game capture shared textures to be typeless if they could potentially need SRGB and non-SRGB views in the future. These capture APIs have been updated: D3D 10/11/12, Vulkan. D3D8 capture does not use shared textures. D3D9 and GL interop do not support typeless textures. The new game capture DLL should be compatible with old versions of OBS. Also removed a lot of dead code around pointless SRV/RTV support.
29 lines
641 B
C++
29 lines
641 B
C++
#pragma once
|
|
|
|
static inline DXGI_FORMAT strip_dxgi_format_srgb(DXGI_FORMAT format)
|
|
{
|
|
switch ((unsigned long)format) {
|
|
case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
|
|
return DXGI_FORMAT_B8G8R8A8_UNORM;
|
|
case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
|
|
return DXGI_FORMAT_R8G8B8A8_UNORM;
|
|
}
|
|
|
|
return format;
|
|
}
|
|
|
|
static inline DXGI_FORMAT apply_dxgi_format_typeless(DXGI_FORMAT format,
|
|
bool allow_srgb_alias)
|
|
{
|
|
if (allow_srgb_alias) {
|
|
switch ((unsigned long)format) {
|
|
case DXGI_FORMAT_B8G8R8A8_UNORM:
|
|
return DXGI_FORMAT_B8G8R8A8_TYPELESS;
|
|
case DXGI_FORMAT_R8G8B8A8_UNORM:
|
|
return DXGI_FORMAT_R8G8B8A8_TYPELESS;
|
|
}
|
|
}
|
|
|
|
return format;
|
|
}
|