-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use typeless textures and linear light chroma
- Loading branch information
Showing
8 changed files
with
222 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#include "dx_helpers.h" | ||
|
||
namespace dx_helpers { | ||
|
||
DXGI_FORMAT | ||
unorm_from_typeless_texture_format(DXGI_FORMAT typeless_format) { | ||
switch (typeless_format) { | ||
case DXGI_FORMAT_B8G8R8A8_TYPELESS: | ||
return DXGI_FORMAT_B8G8R8A8_UNORM; | ||
|
||
case DXGI_FORMAT_B8G8R8X8_TYPELESS: | ||
return DXGI_FORMAT_B8G8R8X8_UNORM; | ||
|
||
case DXGI_FORMAT_R8G8B8A8_TYPELESS: | ||
return DXGI_FORMAT_R8G8B8A8_UNORM; | ||
|
||
default: | ||
return DXGI_FORMAT_UNKNOWN; | ||
} | ||
} | ||
|
||
DXGI_FORMAT | ||
srgb_from_typeless_texture_format(DXGI_FORMAT typeless_format) { | ||
switch (typeless_format) { | ||
case DXGI_FORMAT_B8G8R8A8_TYPELESS: | ||
return DXGI_FORMAT_B8G8R8A8_UNORM_SRGB; | ||
|
||
case DXGI_FORMAT_B8G8R8X8_TYPELESS: | ||
return DXGI_FORMAT_B8G8R8X8_UNORM_SRGB; | ||
|
||
case DXGI_FORMAT_R8G8B8A8_TYPELESS: | ||
return DXGI_FORMAT_R8G8B8A8_UNORM_SRGB; | ||
|
||
default: | ||
return DXGI_FORMAT_UNKNOWN; | ||
} | ||
} | ||
|
||
DXGI_FORMAT | ||
typeless_from_unorm_texture_format(DXGI_FORMAT unorm_format) { | ||
switch (unorm_format) { | ||
case DXGI_FORMAT_B8G8R8A8_UNORM: | ||
return DXGI_FORMAT_B8G8R8A8_TYPELESS; | ||
|
||
case DXGI_FORMAT_B8G8R8X8_UNORM: | ||
return DXGI_FORMAT_B8G8R8X8_TYPELESS; | ||
|
||
case DXGI_FORMAT_R8G8B8A8_UNORM: | ||
return DXGI_FORMAT_R8G8B8A8_TYPELESS; | ||
|
||
default: | ||
return DXGI_FORMAT_UNKNOWN; | ||
} | ||
} | ||
|
||
} // namespace dx_helpers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#pragma once | ||
|
||
#include <d3d11.h> | ||
|
||
namespace dx_helpers { | ||
|
||
DXGI_FORMAT | ||
unorm_from_typeless_texture_format(DXGI_FORMAT typeless_format); | ||
DXGI_FORMAT | ||
srgb_from_typeless_texture_format(DXGI_FORMAT typeless_format); | ||
DXGI_FORMAT | ||
typeless_from_unorm_texture_format(DXGI_FORMAT unorm_format); | ||
|
||
} // namespace dx_helpers |
5 changes: 0 additions & 5 deletions
5
src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0_ps.hlsl
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...s/directx/convert_yuv420_planar_y_ps.hlsl → ...ectx/convert_yuv420_planar_y_ps_srgb.hlsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#include "include/convert_base.hlsl" | ||
#include "include/convert_srgb_base.hlsl" | ||
|
||
#include "include/convert_yuv420_planar_y_ps_base.hlsl" |
File renamed without changes.