1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-27 22:30:49 +00:00

Corrects R4G4B4 and R2G2B2 output.

This commit is contained in:
Thomas Harte 2020-11-07 22:19:27 -05:00
parent d27fb5f199
commit 93968d267d

View File

@ -332,12 +332,12 @@ half3 convertRed8Green8Blue8(SourceInterpolator vert, texture2d<half> texture) {
half3 convertRed4Green4Blue4(SourceInterpolator vert, texture2d<ushort> texture) {
const auto sample = texture.sample(standardSampler, vert.textureCoordinates).rg;
return clamp(half3(sample.r&15, (sample.g >> 4)&15, sample.g&15), half(0.0f), half(1.0f));
return half3(sample.r&15, (sample.g >> 4)&15, sample.g&15) / 15.0f;
}
half3 convertRed2Green2Blue2(SourceInterpolator vert, texture2d<ushort> texture) {
const auto sample = texture.sample(standardSampler, vert.textureCoordinates).r;
return clamp(half3((sample >> 4)&3, (sample >> 2)&3, sample&3), half(0.0f), half(1.0f));
return half3((sample >> 4)&3, (sample >> 2)&3, sample&3) / 3.0f;
}
half3 convertRed1Green1Blue1(SourceInterpolator vert, texture2d<ushort> texture) {