react-native-cesium 1.2.15 → 1.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# spv_to_header.cmake — Convert a .spv binary to a C header with an embedded uint32_t array.
|
|
2
|
+
# Input variables: SPV_FILE, SPV_HEADER, ARRAY_NAME
|
|
3
|
+
|
|
4
|
+
file(READ "${SPV_FILE}" SPV_DATA HEX)
|
|
5
|
+
string(LENGTH "${SPV_DATA}" SPV_HEX_LEN)
|
|
6
|
+
|
|
7
|
+
# Validate SPIR-V magic (0x07230203, little-endian on disk → "03022307")
|
|
8
|
+
string(SUBSTRING "${SPV_DATA}" 0 8 SPV_MAGIC)
|
|
9
|
+
string(TOLOWER "${SPV_MAGIC}" SPV_MAGIC_LC)
|
|
10
|
+
if(NOT SPV_MAGIC_LC STREQUAL "03022307")
|
|
11
|
+
message(FATAL_ERROR "spv_to_header: '${SPV_FILE}' does not start with the SPIR-V magic number (got '${SPV_MAGIC}'). The file may be corrupt or not a valid SPIR-V binary.")
|
|
12
|
+
endif()
|
|
13
|
+
math(EXPR SPV_BYTE_COUNT "${SPV_HEX_LEN} / 2")
|
|
14
|
+
math(EXPR SPV_WORD_COUNT "${SPV_BYTE_COUNT} / 4")
|
|
15
|
+
|
|
16
|
+
set(HEADER_CONTENT "#pragma once\n#include <cstdint>\nstatic const uint32_t ${ARRAY_NAME}[] = {\n")
|
|
17
|
+
|
|
18
|
+
set(I 0)
|
|
19
|
+
while(I LESS SPV_HEX_LEN)
|
|
20
|
+
# Read 8 hex chars (4 bytes = 1 uint32_t word, little-endian in SPIR-V)
|
|
21
|
+
string(SUBSTRING "${SPV_DATA}" ${I} 8 WORD_HEX)
|
|
22
|
+
# SPIR-V is stored little-endian; file(READ HEX) gives bytes in order,
|
|
23
|
+
# so we need to reverse byte order for the uint32_t literal.
|
|
24
|
+
string(SUBSTRING "${WORD_HEX}" 0 2 B0)
|
|
25
|
+
string(SUBSTRING "${WORD_HEX}" 2 2 B1)
|
|
26
|
+
string(SUBSTRING "${WORD_HEX}" 4 2 B2)
|
|
27
|
+
string(SUBSTRING "${WORD_HEX}" 6 2 B3)
|
|
28
|
+
set(WORD "0x${B3}${B2}${B1}${B0}")
|
|
29
|
+
|
|
30
|
+
math(EXPR NEXT_I "${I} + 8")
|
|
31
|
+
if(NEXT_I LESS SPV_HEX_LEN)
|
|
32
|
+
string(APPEND HEADER_CONTENT " ${WORD},\n")
|
|
33
|
+
else()
|
|
34
|
+
string(APPEND HEADER_CONTENT " ${WORD}\n")
|
|
35
|
+
endif()
|
|
36
|
+
set(I ${NEXT_I})
|
|
37
|
+
endwhile()
|
|
38
|
+
|
|
39
|
+
string(APPEND HEADER_CONTENT "};\nstatic const uint32_t ${ARRAY_NAME}_size = sizeof(${ARRAY_NAME});\n")
|
|
40
|
+
|
|
41
|
+
file(WRITE "${SPV_HEADER}" "${HEADER_CONTENT}")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-cesium",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.16",
|
|
4
4
|
"description": "Experimental Cesium rendering for React Native via Nitro",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/module/index.js",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"android/fix-prefab.gradle",
|
|
42
42
|
"android/gradle.properties",
|
|
43
43
|
"android/CMakeLists.txt",
|
|
44
|
+
"android/cmake",
|
|
44
45
|
"android/src",
|
|
45
46
|
"example/react-native-cesium-example.jpg",
|
|
46
47
|
"ios/**/*.h",
|