Skip to content

Instantly share code, notes, and snippets.

View devshgraphicsprogramming's full-sized avatar

Mateusz Kielan devshgraphicsprogramming

View GitHub Profile
# 0 "/app/example.cpp"
# 1 "/app//"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/opt/compiler-explorer/arm64/gcc-trunk-20231027/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "/app/example.cpp"
# 1 "/app/example.cpp"
# 1 "D:\\work\\Nabla\\examples_tests\\48.ArithmeticUnitTest\\hlsl\\shaderCommon.hlsl"
# 1 "D:\\work\\Nabla\\examples_tests\\48.ArithmeticUnitTest\\hlsl\\common.hlsl"
@devshgraphicsprogramming
devshgraphicsprogramming / preprocess_this.hlsl
Created October 27, 2023 18:02
Clang 3.7 Preprocessor Stress Test
This file has been truncated, but you can view the full file.
#define NBL_GLSL_LIMIT_MAX_IMAGE_DIMENSION_1D 32768
#define NBL_GLSL_LIMIT_MAX_IMAGE_DIMENSION_2D 32768
#define NBL_GLSL_LIMIT_MAX_IMAGE_DIMENSION_3D 16384
#define NBL_GLSL_LIMIT_MAX_IMAGE_DIMENSION_CUBE 32768
#define NBL_GLSL_LIMIT_MAX_IMAGE_ARRAY_LAYERS 2048
#define NBL_GLSL_LIMIT_MAX_BUFFER_VIEW_TEXELS 134217728
#define NBL_GLSL_LIMIT_MAX_UBO_SIZE 65536
#define NBL_GLSL_LIMIT_MAX_SSBO_SIZE 4294967295
#define NBL_GLSL_LIMIT_MAX_PUSH_CONSTANTS_SIZE 256
#define NBL_GLSL_LIMIT_MAX_MEMORY_ALLOCATION_COUNT 4096
@devshgraphicsprogramming
devshgraphicsprogramming / bait.md
Created October 23, 2023 22:48
Don't even dream of reprojecting last frame depth for occlusion culling, you will fail!

Originally posted as a reply to: https://gist.github.com/reduz/c5769d0e705d8ab7ac187d63be0099b5

Turned into a gist due to high likelihood of deletion. Also edited down to not include irrelevant trolling as to be useful to someone else considering Depth Reprojection.

Yes I know SSR and Parallax Corrected Shadowmaps work, but the consequences of errors in those depth tests aren't as high.

Lack of Generality (oh the irony)

You yourself state that this is general purpose engine, how is a technique that will have trouble with:

  • deformables (cloth, vegetation, skinned meshes, etc.)
# 1 "direct.comp"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "direct.comp"
layout(local_size_x = 256) in;
# 1 "../../../../nbl/builtin/glsl/scan/descriptors.glsl" 1
# 13 "../../../../nbl/builtin/glsl/scan/descriptors.glsl"
# 1 "../../../../nbl/builtin/glsl/scan/declarations.glsl" 1

[Company] Devsh Graphics Programming

[Location] Remote/Consulting (optional: Assistance with Relocation To Poland)

[Hiring] Vulkan/WebGPU/Emscripten Associate/Mid/Senior Developers Hourly rates Depend on Experience and Location

Who we are and what we do:

We develop an Open Source Apache 2.0 GPU Framework called Nabla, which we then use for consulting projects with external clients.

@devshgraphicsprogramming
devshgraphicsprogramming / visibilityBufferShading.comp
Created May 8, 2021 12:21
Dump of a preprocessed shader from Nabla
#version 460 core
#extension GL_GOOGLE_include_directive : enable
#line 1 "C:/work/Nabla/examples_tests/41.VisibilityBuffer/shadeVBuffer.comp"
#define NBL_IMPL_GL_NV_viewport_array2
#define NBL_IMPL_GL_NV_stereo_view_rendering
#define NBL_IMPL_GL_NV_sample_mask_override_coverage
#define NBL_IMPL_GL_NV_geometry_shader_passthrough
#define NBL_IMPL_GL_NV_shader_subgroup_partitioned
@devshgraphicsprogramming
devshgraphicsprogramming / balls.frag
Created November 19, 2020 17:43
Raytraced BALLS
#version 460
struct Sphere
{
vec3 position;
float radius2;
uint bsdfLightIDs;
};
struct Rectangle
struct SphQuad {
vec2 lo,hi;
vec2 loSq,hiSq;
float z, zSq; //
float b0, b1, b0sq, k; // misc precomputed constants
float S; // solid angle of ’Q’
};
#version 430 core
layout (location = 0) out vec4 OutColor;
in vec3 WorldPos;
in vec2 TexCoords;
in vec3 Normal;
layout (location = 0) uniform vec3 uEmissive;
layout (location = 1) uniform vec3 uAlbedo;
#version 430 core
layout (location = 0) out vec4 OutColor;
in vec3 WorldPos;
in vec2 TexCoords;
in vec3 Normal;
layout (location = 0) uniform vec3 uEmissive;
layout (location = 1) uniform vec3 uAlbedo;