summaryrefslogtreecommitdiffstats
path: root/src/libs/dxvk-native-1.9.2a/src/d3d9/shaders/d3d9_convert_a2w10v10u10.comp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/dxvk-native-1.9.2a/src/d3d9/shaders/d3d9_convert_a2w10v10u10.comp')
-rw-r--r--src/libs/dxvk-native-1.9.2a/src/d3d9/shaders/d3d9_convert_a2w10v10u10.comp44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/libs/dxvk-native-1.9.2a/src/d3d9/shaders/d3d9_convert_a2w10v10u10.comp b/src/libs/dxvk-native-1.9.2a/src/d3d9/shaders/d3d9_convert_a2w10v10u10.comp
new file mode 100644
index 00000000..2d489e3d
--- /dev/null
+++ b/src/libs/dxvk-native-1.9.2a/src/d3d9/shaders/d3d9_convert_a2w10v10u10.comp
@@ -0,0 +1,44 @@
+#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 u10 = bitfieldExtract(int (value), 0, 10);
+ int v10 = bitfieldExtract(int (value), 10, 10);
+ int w10 = bitfieldExtract(int (value), 20, 10);
+ uint a2 = bitfieldExtract(uint(value), 30, 2);
+
+ vec4 color = vec4(
+ snormalize(u10, 10),
+ snormalize(v10, 10),
+ snormalize(w10, 10),
+ unormalize(a2, 2));
+
+ imageStore(dst, thread_id.xy, color);
+ }
+} \ No newline at end of file