summaryrefslogtreecommitdiffstats
path: root/src/video_core/host_shaders/astc_decoder.comp
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-02-13 22:49:24 +0100
committerameerj <52414509+ameerj@users.noreply.github.com>2021-03-13 18:16:03 +0100
commit20eb368e147e1c27f05d6923c51596f8dfe24e89 (patch)
treea8b1c8eb79eb55e189a10dfd43b8b6bb1449220f /src/video_core/host_shaders/astc_decoder.comp
parenthost_shaders: Modify shader cmake integration to allow for larger shaders (diff)
downloadyuzu-20eb368e147e1c27f05d6923c51596f8dfe24e89.tar
yuzu-20eb368e147e1c27f05d6923c51596f8dfe24e89.tar.gz
yuzu-20eb368e147e1c27f05d6923c51596f8dfe24e89.tar.bz2
yuzu-20eb368e147e1c27f05d6923c51596f8dfe24e89.tar.lz
yuzu-20eb368e147e1c27f05d6923c51596f8dfe24e89.tar.xz
yuzu-20eb368e147e1c27f05d6923c51596f8dfe24e89.tar.zst
yuzu-20eb368e147e1c27f05d6923c51596f8dfe24e89.zip
Diffstat (limited to 'src/video_core/host_shaders/astc_decoder.comp')
-rw-r--r--src/video_core/host_shaders/astc_decoder.comp43
1 files changed, 22 insertions, 21 deletions
diff --git a/src/video_core/host_shaders/astc_decoder.comp b/src/video_core/host_shaders/astc_decoder.comp
index 070190a5c..2ddac2e1d 100644
--- a/src/video_core/host_shaders/astc_decoder.comp
+++ b/src/video_core/host_shaders/astc_decoder.comp
@@ -16,7 +16,7 @@
#define BINDING_7_TO_8_BUFFER 4
#define BINDING_8_TO_8_BUFFER 5
#define BINDING_BYTE_TO_16_BUFFER 6
-#define BINDING_OUTPUT_IMAGE 3
+#define BINDING_OUTPUT_IMAGE 7
#else // ^^^ Vulkan ^^^ // vvv OpenGL vvv
@@ -85,7 +85,26 @@ layout(binding = BINDING_SWIZZLE_BUFFER, std430) readonly buffer SwizzleTable {
layout(binding = BINDING_INPUT_BUFFER, std430) buffer InputBufferU32 {
uint astc_data[];
};
-layout(binding = BINDING_OUTPUT_IMAGE) uniform writeonly image2D dest_image;
+
+// ASTC Encodings data
+layout(binding = BINDING_ENC_BUFFER, std430) readonly buffer EncodingsValues {
+ EncodingData encoding_values[];
+};
+// ASTC Precompiled tables
+layout(binding = BINDING_6_TO_8_BUFFER, std430) readonly buffer REPLICATE_6_BIT_TO_8 {
+ uint REPLICATE_6_BIT_TO_8_TABLE[];
+};
+layout(binding = BINDING_7_TO_8_BUFFER, std430) readonly buffer REPLICATE_7_BIT_TO_8 {
+ uint REPLICATE_7_BIT_TO_8_TABLE[];
+};
+layout(binding = BINDING_8_TO_8_BUFFER, std430) readonly buffer REPLICATE_8_BIT_TO_8 {
+ uint REPLICATE_8_BIT_TO_8_TABLE[];
+};
+layout(binding = BINDING_BYTE_TO_16_BUFFER, std430) readonly buffer REPLICATE_BYTE_TO_16 {
+ uint REPLICATE_BYTE_TO_16_TABLE[];
+};
+
+layout(binding = BINDING_OUTPUT_IMAGE, rgba8) uniform writeonly image2D dest_image;
const uint GOB_SIZE_X = 64;
const uint GOB_SIZE_Y = 8;
@@ -109,23 +128,6 @@ uint ReadTexel(uint offset) {
return bitfieldExtract(astc_data[offset / 4], int((offset * 8) & 24), 8);
}
-// ASTC Encodings data
-layout(binding = BINDING_ENC_BUFFER, std430) readonly buffer EncodingsValues {
- EncodingData encoding_values[256];
-};
-// ASTC Precompiled tables
-layout(binding = BINDING_6_TO_8_BUFFER, std430) readonly buffer REPLICATE_6_BIT_TO_8 {
- uint REPLICATE_6_BIT_TO_8_TABLE[];
-};
-layout(binding = BINDING_7_TO_8_BUFFER, std430) readonly buffer REPLICATE_7_BIT_TO_8 {
- uint REPLICATE_7_BIT_TO_8_TABLE[];
-};
-layout(binding = BINDING_8_TO_8_BUFFER, std430) readonly buffer REPLICATE_8_BIT_TO_8 {
- uint REPLICATE_8_BIT_TO_8_TABLE[];
-};
-layout(binding = BINDING_BYTE_TO_16_BUFFER, std430) readonly buffer REPLICATE_BYTE_TO_16 {
- uint REPLICATE_BYTE_TO_16_TABLE[];
-};
const int BLOCK_SIZE_IN_BYTES = 16;
@@ -1275,8 +1277,7 @@ void main() {
offset += (pos.x >> GOB_SIZE_X_SHIFT) << x_shift;
offset += swizzle;
- const ivec3 invocation_destination = ivec3(gl_GlobalInvocationID + destination);
- const ivec3 coord = ivec3(invocation_destination * uvec3(block_dims, 1.0));
+ const ivec3 coord = ivec3(gl_GlobalInvocationID * uvec3(block_dims, 1.0));
uint block_index =
layer * num_image_blocks.x * num_image_blocks.y + pos.y * num_image_blocks.x + pos.x;
current_index = 0;