This commit is contained in:
Surma
2021-05-27 11:40:50 +01:00
parent e4832644f2
commit dc86b33634
6 changed files with 91 additions and 5934 deletions

View File

@@ -7,8 +7,7 @@ ENVIRONMENT = worker
OUT_JS := enc/basis_enc.js dec/basis_dec.js OUT_JS := enc/basis_enc.js dec/basis_dec.js
OUT_WASM := $(OUT_JS:.js=.wasm) OUT_WASM := $(OUT_JS:.js=.wasm)
# TODO: Go back to -O3 COMMON_FLAGS := -O3 -fno-strict-aliasing
COMMON_FLAGS := -O0 -g -fno-strict-aliasing
override CXXFLAGS += $(COMMON_FLAGS) override CXXFLAGS += $(COMMON_FLAGS)
override CFLAGS += $(COMMAN_FLAGS) override CFLAGS += $(COMMAN_FLAGS)
@@ -37,9 +36,6 @@ CODEC_C_SOURCE_FILES := \
encoder/apg_bmp.c \ encoder/apg_bmp.c \
zstd/zstd.c zstd/zstd.c
# TODO: Remove me
override CXXFLAGS += -DBASISU_FORCE_DEVEL_MESSAGES=1
.PHONY: all clean .PHONY: all clean
all: $(CODEC_DIR) $(OUT_JS) all: $(CODEC_DIR) $(OUT_JS)

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -58,17 +58,14 @@ val encode(std::string image_in, int image_width, int image_height, BasisOptions
params.m_compression_level = opts.compression; params.m_compression_level = opts.compression;
params.m_source_images.push_back(img); params.m_source_images.push_back(img);
printf("%d\n", __LINE__);
if (!compressor.init(params)) { if (!compressor.init(params)) {
return val(std::string("Well something went wrong during init")); return val(std::string("Well something went wrong during init"));
} }
printf("%d\n", __LINE__);
if (compressor.process() != 0) { if (compressor.process() != 0) {
return val(std::string("Well something went wrong during processing")); return val(std::string("Well something went wrong during processing"));
} }
printf("%d\n", __LINE__);
auto comp_data = compressor.get_output_ktx2_file(); auto comp_data = compressor.get_output_ktx2_file();
auto js_result = Uint8Array.new_(typed_memory_view(comp_data.size(), &comp_data[0])); auto js_result = Uint8Array.new_(typed_memory_view(comp_data.size(), &comp_data[0]));
// Not sure if there is anything to free here // Not sure if there is anything to free here

File diff suppressed because it is too large Load Diff

Binary file not shown.