These files are variants of simplifier.cpp from https://github.com/zeux/meshoptimizer, created for the article https://zeuxcg.org/2019/01/17/is-c-fast/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| a1.medium $ ./build/release/meshoptimizer buddha.obj | |
| # buddha.obj: 549409 vertices, 1087474 triangles; read in 483.46 msec; indexed in 354.61 msec | |
| Original : ACMR 1.556966 ATVR 3.081784 (NV 3.124747 AMD 3.277660 Intel 2.289651) Overfetch 2.105950 Overdraw 1.200370 in 0.00 msec | |
| Random : ACMR 2.999919 ATVR 5.937897 (NV 5.937882 AMD 5.937935 Intel 5.936783) Overfetch 10.839888 Overdraw 1.218682 in 33.38 msec | |
| Cache : ACMR 0.661465 ATVR 1.309272 (NV 1.590738 AMD 1.434356 Intel 1.138871) Overfetch 1.509062 Overdraw 1.206893 in 477.86 msec | |
| CacheFifo: ACMR 0.689948 ATVR 1.365651 (NV 1.706663 AMD 1.516610 Intel 1.229416) Overfetch 1.552013 Overdraw 1.197034 in 146.00 msec | |
| Overdraw : ACMR 2.776432 ATVR 5.495538 (NV 5.508446 AMD 5.527603 Intel 5.314811) Overfetch 8.624212 Overdraw 1.086317 in 209.29 msec | |
| Fetch : ACMR 1.556966 ATVR 3.081784 (NV 3.124747 AMD 3.277660 Intel 2.289651) Overfetch 2.105950 Overdraw 1.200370 in 25.13 msec | |
| FetchMap : ACMR 1.556966 ATVR 3.081784 (NV 3.124747 AMD 3.277660 Intel 2.289651) O |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ~/pugixml$ cat ucd.cpp | |
| #include "pugixml.hpp" | |
| #include <malloc.h> | |
| int main() | |
| { | |
| pugi::xml_document doc; | |
| doc.load_file("ucd.all.grouped.xml"); | |
| malloc_stats(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class RemapInterfaceIdsPass : public spvtools::opt::Pass | |
| { | |
| public: | |
| const char* name() const override { return "remap-interface-ids"; } | |
| RemapInterfaceIdsPass(uint32_t start_id): start_id(start_id) | |
| { | |
| } | |
| Status Process() override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| #include <string> | |
| namespace fmt { | |
| #define KIND(X) \ | |
| X(bool,bool) \ | |
| X(signed char,schar) \ | |
| X(unsigned char,uchar) \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace tstd | |
| { | |
| template <typename T> | |
| class vector | |
| { | |
| public: | |
| typedef T* iterator; | |
| typedef const T* const_iterator; | |
| iterator begin() { return begin_; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdint.h> | |
| __declspec(noinline) | |
| uint32_t giveMeRand() | |
| { | |
| static uint32_t result = 0xdeadbeef; | |
| result *= 17; | |
| return ++result; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/src/indexcodec.cpp b/src/indexcodec.cpp | |
| index 4ab92cb..18ccd43 100644 | |
| --- a/src/indexcodec.cpp | |
| +++ b/src/indexcodec.cpp | |
| @@ -7,9 +7,6 @@ | |
| // This work is based on: | |
| // Fabian Giesen. Simple lossless index buffer compression & follow-up. 2013 | |
| // Conor Stokes. Vertex Cache Optimised Index Buffer Compression. 2014 | |
| -namespace meshopt | |
| -{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Using fixed-point encoding for position (14 bits per component) and texture coordinates (12 bits per component), with 32-bit index buffer | |
| and this vertex format: | |
| // 12 bytes | |
| struct PackedVertexOct | |
| { | |
| unsigned short px, py, pz; | |
| unsigned char nu, nv; // octahedron encoded normal, aliases .pw | |
| unsigned short tx, ty; | |
| }; |