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 <cstdio> | |
#include <cstdlib> | |
#include <unistd.h> | |
// A board is uniquely determined by its height, width and cell data. | |
// The timestep is not part of the board. | |
template<int height, int width, int... cells> | |
struct board_t { | |
// Convert the cell data to a string constant. | |
static const char string[] { |
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
import generators ; | |
using clang : : /usr/bin/circle ; | |
generators.override clang.compile.c.pch : pch.default-c-pch-generator ; | |
generators.override clang.compile.c++.pch : pch.default-cpp-pch-generator ; |
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 <memory> | |
#include <iostream> | |
#include <fstream> | |
#include <vulkan/common.h> | |
// Shader interface helper variables. | |
template<auto index, typename type_t = @enum_type(index)> | |
[[using spirv: in, location((int)index)]] | |
type_t shader_in; |
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 <stb_image.h> | |
#include <string> | |
#include <vector> | |
#include <gl3w/GL/gl3w.h> | |
#include <GLFW/glfw3.h> | |
template<typename type_t> | |
const char* enum_to_string(type_t e) { | |
static_assert(std::is_enum_v<type_t>); | |
switch(e) { |
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 <imgui.h> | |
// #include <examples/imgui_impl_glfw.h> | |
// #include <examples/imgui_impl_opengl3.h> | |
#include <stb_image.h> | |
#include <gl3w/GL/gl3w.h> | |
#include <GLFW/glfw3.h> | |
#include <cmath> | |
#include <cstdio> | |
#include <cfloat> |
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
$ glslc --target-env=opengl --target-spv=spv1.5 -o vert.spv vert.vert | |
$ glslc --target-env=opengl --target-spv=spv1.5 -o tesc.spv tesc.tesc | |
$ spirv-link vert.spv tesc.spv -o program.spv | |
$ clang++-9 segfault.cxx -lGL -lgl3w -lsfml-system -lsfml-window -lsfml-graphics -o segfault | |
$ ./segfault | |
Loaded spv: 1908 bytes | |
spv loaded | |
Program received signal SIGSEGV, Segmentation fault. | |
0x00007ffff1dc7a54 in ?? () from /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.450.57 |
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 <cstdio> | |
int read_value(const char* prompt) { | |
puts(prompt); | |
int x = 0; | |
scanf("%d", &x); | |
return x; | |
} | |
struct S { |
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 <cstdio> | |
#include <type_traits> | |
#include <algorithm> | |
#include <utility> | |
#include <map> | |
#include <vector> | |
#include <tuple> | |
template<typename type_t> | |
struct foo_t { |
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
'A,E Au aoeu | |
aoe | |
u | |
aoeu | |
aoe | |
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
count = 2048 ( 0) { 2, 4, 8, 16, 32, 32, 32, 32, 32} = 190 | |
count = 2049 ( 1) { 1, 2, 4, 8, 16, 32, 32, 32, 32} = 159 | |
count = 2050 ( 2) { 1, 2, 4, 8, 16, 32, 32, 32, 32} = 159 | |
count = 2051 ( 3) { 1, 1, 2, 4, 8, 16, 16, 16, 16} = 80 | |
count = 2052 ( 4) { 1, 1, 2, 4, 8, 16, 16, 16, 24} = 88 | |
count = 2053 ( 5) { 1, 1, 2, 4, 8, 16, 16, 16, 24} = 88 | |
count = 2054 ( 6) { 1, 1, 2, 4, 8, 16, 16, 16, 24} = 88 | |
count = 2055 ( 7) { 1, 1, 1, 2, 4, 8, 8, 8, 16} = 49 | |
count = 2056 ( 8) { 1, 1, 1, 2, 4, 8, 8, 12, 20} = 57 | |
count = 2057 ( 9) { 1, 1, 1, 2, 4, 8, 8, 12, 20} = 57 |