diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-11 08:17:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-11 08:17:27 +0000 |
commit | f215e02bf85f68d3a6106c2a1f4f7f063f819064 (patch) | |
tree | 6bb5b92c046312c4e95ac2620b10ddf482d3fa8b /src/libs/dxvk-native-1.9.2a/src/d3d9/shaders/d3d9_convert_x8l8v8u8.comp | |
parent | Initial commit. (diff) | |
download | virtualbox-f215e02bf85f68d3a6106c2a1f4f7f063f819064.tar.xz virtualbox-f215e02bf85f68d3a6106c2a1f4f7f063f819064.zip |
Adding upstream version 7.0.14-dfsg.upstream/7.0.14-dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/libs/dxvk-native-1.9.2a/src/d3d9/shaders/d3d9_convert_x8l8v8u8.comp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/libs/dxvk-native-1.9.2a/src/d3d9/shaders/d3d9_convert_x8l8v8u8.comp b/src/libs/dxvk-native-1.9.2a/src/d3d9/shaders/d3d9_convert_x8l8v8u8.comp new file mode 100644 index 00000000..a9257cb5 --- /dev/null +++ b/src/libs/dxvk-native-1.9.2a/src/d3d9/shaders/d3d9_convert_x8l8v8u8.comp @@ -0,0 +1,43 @@ +#version 450 +#extension GL_GOOGLE_include_directive : enable + +#include "d3d9_convert_common.h" + +layout( + local_size_x = 8, + local_size_y = 8, + local_size_z = 1) in; + +layout(binding = 0) +writeonly uniform image2D dst; + +layout(binding = 1) uniform usamplerBuffer src; + +layout(push_constant) +uniform u_info_t { + uvec2 extent; +} u_info; + +void main() { + ivec3 thread_id = ivec3(gl_GlobalInvocationID); + + if (all(lessThan(thread_id.xy, u_info.extent))) { + uint offset = thread_id.x + + thread_id.y * u_info.extent.x; + + uint value = texelFetch(src, int(offset)).r; + + // Sign-extend magic! + int u8 = bitfieldExtract(int (value), 0, 8); + int v8 = bitfieldExtract(int (value), 8, 8); + uint l8 = bitfieldExtract(uint(value), 16, 8); + + vec4 color = vec4( + snormalize(u8, 8), + snormalize(v8, 8), + unormalize(l8, 8), + 1.0f); + + imageStore(dst, thread_id.xy, color); + } +}
\ No newline at end of file |