[Mesa-dev] [PATCH 1/4] mesa: add header for share bptc decompress functions
Denis Pauk
pauk.denis at gmail.com
Thu Jun 14 20:20:01 UTC 2018
Make functions public:
* fetch_rgba_unorm_from_block
* fetch_rgb_float_from_block
* compress_rgba_unorm
* compress_rgb_float
Functions will be reused in gallium/auxiliary code.
---
src/mesa/Makefile.sources | 1 +
src/mesa/main/texcompress_bptc.c | 9 ++---
src/mesa/main/texcompress_bptc_share.h | 47 ++++++++++++++++++++++++++
3 files changed, 53 insertions(+), 4 deletions(-)
create mode 100644 src/mesa/main/texcompress_bptc_share.h
diff --git a/src/mesa/Makefile.sources b/src/mesa/Makefile.sources
index 00aba0a2f7..d644112e6a 100644
--- a/src/mesa/Makefile.sources
+++ b/src/mesa/Makefile.sources
@@ -216,6 +216,7 @@ MAIN_FILES = \
main/texcompress.c \
main/texcompress_bptc.c \
main/texcompress_bptc.h \
+ main/texcompress_bptc_share.h \
main/texcompress_cpal.c \
main/texcompress_cpal.h \
main/texcompress_etc.c \
diff --git a/src/mesa/main/texcompress_bptc.c b/src/mesa/main/texcompress_bptc.c
index fd37be97f3..6cfd9aece7 100644
--- a/src/mesa/main/texcompress_bptc.c
+++ b/src/mesa/main/texcompress_bptc.c
@@ -29,6 +29,7 @@
#include <stdbool.h>
#include "texcompress.h"
#include "texcompress_bptc.h"
+#include "texcompress_bptc_share.h"
#include "util/format_srgb.h"
#include "util/half_float.h"
#include "texstore.h"
@@ -535,7 +536,7 @@ apply_rotation(int rotation,
result[3] = t;
}
-static void
+void
fetch_rgba_unorm_from_block(const uint8_t *block,
uint8_t *result,
int texel)
@@ -840,7 +841,7 @@ finish_signed_unquantize(int32_t value)
return value * 31 / 32;
}
-static void
+void
fetch_rgb_float_from_block(const uint8_t *block,
float *result,
int texel,
@@ -1247,7 +1248,7 @@ compress_rgba_unorm_block(int src_width, int src_height,
endpoints);
}
-static void
+void
compress_rgba_unorm(int width, int height,
const uint8_t *src, int src_rowstride,
uint8_t *dst, int dst_rowstride)
@@ -1555,7 +1556,7 @@ compress_rgb_float_block(int src_width, int src_height,
endpoints);
}
-static void
+void
compress_rgb_float(int width, int height,
const float *src, int src_rowstride,
uint8_t *dst, int dst_rowstride,
diff --git a/src/mesa/main/texcompress_bptc_share.h b/src/mesa/main/texcompress_bptc_share.h
new file mode 100644
index 0000000000..bf885ef038
--- /dev/null
+++ b/src/mesa/main/texcompress_bptc_share.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2014 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef TEXCOMPRESS_BPTC_SHARE_H
+#define TEXCOMPRESS_BPTC_SHARE_H
+
+void
+fetch_rgba_unorm_from_block(const uint8_t *block,
+ uint8_t *result,
+ int texel);
+void
+fetch_rgb_float_from_block(const uint8_t *block,
+ float *result,
+ int texel,
+ bool is_signed);
+
+void
+compress_rgb_float(int width, int height,
+ const float *src, int src_rowstride,
+ uint8_t *dst, int dst_rowstride,
+ bool is_signed);
+
+void
+compress_rgba_unorm(int width, int height,
+ const uint8_t *src, int src_rowstride,
+ uint8_t *dst, int dst_rowstride);
+#endif
--
2.17.1
More information about the mesa-dev
mailing list