Commit graph

704 commits

Author SHA1 Message Date
Sascha Willems
144c0b66c0 Create empty texture to be used with materials that miss e.g. normal maps 2020-09-12 12:48:26 +02:00
daemyung jang
ad6e36023f
Run on MacOS (#762)
* Run on MacOS

* Update BUILD.md
2020-09-11 20:19:28 +02:00
Sascha Willems
85bf87125b Added additional flags for binding texture maps and only rendering opaque/masked/blended meshes 2020-09-05 12:12:47 +02:00
Sascha Willems
5d594acb02 Bugfix for checking enabled instance extensions 2020-08-29 11:32:48 +02:00
Sascha Willems
af49951afb Removed unused include 2020-08-29 10:43:01 +02:00
Sascha Willems
1d815e6ced Better handling of device creation failure 2020-08-27 22:32:49 +02:00
Sascha Willems
8374d6cd68 Code cleanup, changed message for missing enabled device extensions 2020-08-27 22:24:43 +02:00
Sascha Willems
de61539799 Store instance extensions, reworked support check 2020-08-27 19:56:02 +02:00
Jérôme Leclercq
3298455373
Output warning to stderr if an extension is not supported (#756) 2020-08-27 19:36:24 +02:00
Sascha Willems
d5be770f55 Merge branch 'master' of https://github.com/SaschaWillems/Vulkan 2020-08-24 20:04:53 +02:00
Sascha Willems
236a424955 Fixed full screen mode for resolutions different than current desktop size 2020-08-24 20:04:46 +02:00
datenwolf
fd202bfc76
xcb_connect always returns nonnull pointer, errors must be checked with xcb_connection_has_error (#720)
* xcb_connect always returns nonnull pointer, errors must be checked with xcb_connection_has_error: Fixed the error check to conform to XCB and assert nonnull pointer

* merged with newest master from upstream (tagged ktx)

Co-authored-by: Wolfgang Draxinger <code@datenwolf.net>
Co-authored-by: datenwolf <dw@kraeh.datenwolf.net>
2020-08-24 08:01:23 +02:00
Sascha Willems
d32663d569 Merged #729 2020-08-23 18:05:39 +02:00
Hanif Ariffin
8b521e2cd9
Don't perform unecessary copy (#727) 2020-08-22 09:21:12 +02:00
Francesco
2210ca22a9
add FreeBSD support (#752)
Signed-off-by: Lucas Francesco <uramekus@cirno.dev>
2020-08-21 16:23:01 +02:00
Sascha Willems
2083a9839c Added Android build files and screenshot for order independent transparency sample 2020-08-21 10:12:55 +02:00
Sascha Willems
9e22fe7b0d Add resized flag to base class 2020-08-16 10:22:45 +02:00
Sascha Willems
ee946e2abf
Update ray tracing samples to use VK_KHR_ray_tracing (#753)
* Started updating ray tracing samples to KHR extension

* Updated GLSL shaders to use GL_EXT_ray_tracing

* Code cleanup, naming

* Fix include directories to use Vulkan headers from repository instead of NDK for the Android build

* Added new Android function pointers

* Renamed basic ray tracing sample

Added android build files

* Remove unused batch file

* Replaced remaining NV identifiers

* Updating ray tracing shadow sample to KHR extension

* Updated shaders to use KHR instead of NV extension

Fixed shader bindings

* Updating ray tracing reflections sample to KHR extension

* Renamed ray tracing reflections sample

* Renamed ray tracing shadows sample

Added android build files

* Removed no-longer used batch files for shader generation

* Proper alignment for the shader binding table

* Updated readme

* Reworked shader group setup

* Cleanup

* Reworked shader group setup

* Reworked shader group setup

* Code cleanup
2020-08-15 17:59:02 +02:00
Sascha Willems
e6956acfbd Enable VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT_KHR flag on buffers that are allocated with VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT 2020-08-12 20:51:18 +02:00
Sascha Willems
b0376aea5e Fixed some compiler warnings and obvious errors 2020-08-09 15:10:28 +02:00
Sascha Willems
583e61ac35 Fixed typos 2020-08-09 14:39:32 +02:00
Sascha Willems
a465bad5aa Cleaned up includes
Fixed typos
2020-08-09 13:16:35 +02:00
Sascha Willems
76331af78f Remove pragma once from implementation files 2020-08-09 11:56:19 +02:00
Sascha Willems
361535b29e Split texture class into header and implementation
Moved include to base class
2020-08-08 22:54:34 +02:00
Sascha Willems
231e97b8c0 Split device class into header and implementation
Moved include to base class
2020-08-08 22:36:01 +02:00
Sascha Willems
122288fe25 Split buffer class into header and implementation
Moved include to base class
2020-08-08 22:18:35 +02:00
Sascha Willems
abd68cc451 Split swap chain class into header and implementation 2020-08-08 18:48:00 +02:00
Sascha Willems
e1ec3b6c78 Fixed typos 2020-08-08 13:25:58 +02:00
Sascha Willems
14536c6ec7 Removed unused Android code 2020-08-06 08:02:27 +02:00
Sascha Willems
011109020b
Merge pull request #730 from hbina/small_change_in_vkdevice
Use explicit ctor, remove unreachable code, and make functions const
2020-07-30 21:02:14 +02:00
Sascha Willems
29b5ba5abe
Merge pull request #704 from MattGuerrette/master
Update WM_CLASS property on Linux using xcb
2020-07-30 19:54:09 +02:00
Sascha Willems
feb939096f
Merge glTF branch (#747)
* Added helper function for easy pipeline vertex input state create info structure setup from glTF model vertex class

* Split glTF loader into header and implementation

* Updated sample to use glTF

* Removed collada files

Replaced assets are now part of the asset pack

* Return value for glTF model vertex input state create info helper

* Removed unused assets

* Use glTF assets

* Added default material for glTF node's without materials

* Use glTF assets

* Apply pre-transforms to normals

* Use glTF assets

* Use glTF assets

* Use vertex input state from glTF model class

* Scene setup

* Use glTF assets

* Use glTF assets

* Display error message and exit if glTF file could not be loaded

* Use glTF assets

* Use glTF assets

* Use glTF assets

* Remove unused buffer binds

* Use glTF assets

* Remove no longer used model files

* Remove no longer used model files

* Added support for rendering glTF models with images

* glTF model normal pre-transform ignores translation

* Use glTF assets

* Use glTF assets

* Use glTF assets

* Use glTF assets

* Use glTF assets

* Only add combined image samplers to pool if actually used in the scene

* Use global descriptor set layouts

* Use global descriptor set layouts

* Use glTF assets

* Use glTF assets

* Use glTF assets

Code cleanup
Updated GLSL and HLSL shaders

* Use glTF assets

Code cleanup

* Use glTF assets

Code cleanup
Updated GLSL and HLSL shaders

* Remove no-longer used model

* Use glTF assets

Code cleanup
Updated GLSL and HLSL shaders

* Use glTF assets

Code cleanup
Updated GLSL and HLSL shaders
Removed no-longer used model

* Use glTF assets

Code cleanup
Use RGBA texture instead of different compressed formats
Removed no-longer used assets

* Adnrdoid build file

* Use glTF assets

Code cleanup and refactoring
Updated GLSL and HLSL shaders

* Added vertex count and way of passing additional memory property type flags to glTF loader

* Use glTF assets

Updated GLSL and HLSL shaders
Removed no-longer used assets

* Use glTF assets

Updated GLSL and HLSL shaders

* Remove unfinished sample

* Completely reworked push constants sample

Use glTF assets
Updated GLSL and HLSL shaders
Removed no-longer used assets

* Android CMake build files

* Removed un-used asset

* Explicit buffer binding function

* Use glTF assets

Code cleanup
Updated GLSL and HLSL shaders

* Use glTF assets

Code cleanup

* Use glTF assets

Code cleanup
Removed no-longer used assets

* Use glTF assets

Code cleanup
Updated GLSL and HLSL shaders
Removed no-longer used assets

* Remove no-longer used asset

* Use glTF assets

Code cleanup and refactoring
Performance optimizations
Updated GLSL and HLSL shaders
Removed no-longer used assets

* Use glTF assets

Code cleanup and refactoring
Updated GLSL and HLSL shaders
Removed no-longer used assets

* Use glTF assets

Code cleanup and refactoring
Updated GLSL and HLSL shaders
Removed no-longer used assets

* Use glTF assets

Code cleanup and refactoring
Removed no-longer used assets

* Use glTF assets

Code cleanup and refactoring
Removed no-longer used assets

* Use glTF assets

Code cleanup and refactoring

* Use glTF assets

Code cleanup and refactoring

* Use glTF assets

Code cleanup and refactoring
Removed no-longer used assets

* Pass vertex size and calculate multiplier in shaders instead of hard-coding

With this, changes to the glTF vertex structure won't break the ray tracing samples

* Load tangents (if present)

* Use glTF assets

Code cleanup and heavy refactoring
Reworked debug display code

* Android build

* Normal mapping fixes

Udpated HLSL shaders

* Use glTF assets

Code cleanup and heavy refactoring
Reworked debug display code
Updated GLSL and HLSL shaders

* Code cleanup, comments

* Use glTF assets

Code cleanup and heavy refactoring
Reworked debug display code
Updated GLSL and HLSL shaders

* Added sample count to framebuffer create info

* Removed no-longer used assets

* Android build

Removed no-longer used assets

* Code cleanup and heavy refactoring

Updated GLSL and HLSL shaders
Use tangents stored in GLSL instead of calculating them in the fragment shader

* Renamed textured PBR sample main cpp file

* Use glTF assets

Code cleanup and refactoring
Updated GLSL and HLSL shaders
Removed no-longer used assets

* Use glTF assets

Removed no-longer used assets

* Android build files

* Android build files

* Use glTF assets

Removed no-longer used assets

* Fixed HLSL shaders

* Android build files

* Use glTF assets

Updated GLSL and HLSL shaders
Removed no-longer used assets

* Use glTF assets

Updated GLSL and HLSL shaders
Removed no-longer used assets

* Added flag to disable glTF image loading

Useful for samples that use their own textures or don't use textures at all to speed up loading

* Use glTF assets

Code cleanup
Use Sponza scene instead of Sibenik to better highlight the effect
Updated GLSL and HLSL shaders

* Updated Android build files

* Removed left-over comment

* Use Sponza scene for the SSAO sample

* Removed unused code

* Removed ASSIMP

No longer required as all samples now use the glTF file format

* Added missing vertex shader stage

* Removed old ASSIMP-based model loader

* Added support for loading external glTF images from ktx

Android fixes for loading external buffer files

* Scene setup

* Added missing shader stages

* Removed ASSIMP from build files

* Fixed compiler warning

* Removed ASSIMP from readmes

* Android build files cleanup

* Replaced ktx submodule with only the files required for this repo

The ktx submodule was a tad too big and contained lots of files not required for this repo

* Moved ktx build files into base project

* Use glTF assets

* Use glTF assets

* Removed license files, will be moved to asset pack

* Use RGBA textures

* Use RGBA cubemp texture with face assignment based on original images

Refs #679

* Android build files

* Removed textures

All textures will be moved to the asset pack

* Ignore asset folders

* Removed font

Fonts will be moved to the asset pack

* Link to gltf asset pack

* Updated gitignore

* Android build file
2020-07-28 20:20:38 +02:00
Sascha Willems
e370e6d169
Merge glTF scene rendering sample (#744)
* Started reworking the scene rendering to sample
Use glTF instead of ASSIMP, per-material pipelines, material loading, etc.

* Visibility toggle for scene nodes

* Fixed lighting, updated GLSL and HLSL shaders

* Renamed sample

* Code-Cleanup, comments, validation fixes

* Android build

* Started on tutorial for glTF scene rendering sample

* Minor code cleanup

* Adding new chapters to the tutorial for glTF scene rendering sample

* Added info on normal map shader bindings, spelling

* Added drawing chapter

* Getter for texture descriptors

Makes code a easier to read

* Renamed glTF scene sample

* Add markdown files to projects

* Updated readme, separate chapter for glTF samples

* Comments

* Removed unused screenshot
2020-07-04 14:20:45 +02:00
Alejandro Piñeiro
d33bc6c75e shadowmappping: check if depth format supports LINEAR filtering
The test uses the format VK_FORMAT_D16_UNORM for the shadow map, and
it sets unconditionally VK_FILTER_LINEAR when using it.

But by spec, it is not mandatory that format to support
filtering. Explained here:

https://www.khronos.org/registry/vulkan/specs/1.2/html/chap32.html

table 51, VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT.

This commit checks if that flag is present with that format to decide
between LINEAR (the default value) or NEAREST (if LINEAR is not
supported). Adds a auxiliar method on VulkanTools just in case it
could be useful for other demos.

This is not detected by the Validation Layers, but raise an assertion
with one of the development tools we use to implement the Mesa v3dv
driver (rpi4 vulkan driver).
2020-06-20 00:08:13 +02:00
Hanif Bin Ariffin
050ccf469e Use explicit ctor, remove unreachable code, and make functions const 2020-06-03 10:40:46 -04:00
Ben Clayton
301e8abf12 Add command flag for picking between shaders
The new `-s`, `--shaders` command line flag allows you to specify whether you want to load the glsl or hlsl shaders.
Defaults to glsl.

Issue: #723
2020-06-01 12:22:28 +01:00
Ben Clayton
ca884587a4 Move shaders into glsl and hlsl directories
Move `data/shaders` to `data/shaders/glsl`
Move `data/hlsl` to `data/shaders/hlsl`

Fix up shader paths in the cpp files to point to the new glsl location.

`data/shaders/hlsl/compile.py` still overwrites the glsl .spv files (for
now).

Issue: #723
2020-06-01 12:22:28 +01:00
Matt Guerrette
ddf70467d4 Update WM_CLASS property on Linux using xcb
This commit updates the WM_CLASS property to display a better
title than "Unknown" for each example in the dash and application menu.

Update WM_CLASS property on Linux using xcb

This commit updates the WM_CLASS property to display a better
title than "Unknown" for each example in the dash and application menu.
2020-04-30 11:29:50 -04:00
Sascha Willems
f5dbf162a7 Added helper function to get vertex input attribute descriptions from requested vertexattributes as a vector
That vector can directly be used for a pipeline's vertex attribute setup
2020-04-25 17:09:31 +02:00
Sascha Willems
2b28a60e17 Added flag to flip vertex position y coordinates 2020-04-25 12:28:16 +02:00
Sascha Willems
7b46e71f33 Added flag to flip vertex position y coordinates 2020-04-25 12:01:21 +02:00
Sascha Willems
5df36d7b19 Added flag to pre-multiply vertex colors by material base color 2020-04-25 10:50:24 +02:00
Sascha Willems
107aa35b9e Extracted vertex into separate class with easy component to Vulkan vertex attribute mappings
Load vertex colors if present
Added flag to pre-transform vertices
2020-04-25 08:23:32 +02:00
Sascha Willems
ab38f8b150 Code-Cleanup: All samples now use the camera class and it's matrices
Cleaned up base class
2020-04-22 20:58:24 +02:00
Sascha Willems
53846d8b1d Code cleanup 2020-04-20 22:13:51 +02:00
Sascha Willems
4b9f10d644 Code cleanup 2020-04-20 21:39:30 +02:00
Sascha Willems
458c149c71 Code cleanup 2020-04-20 20:29:15 +02:00
Sascha Willems
4e610c56ce Also apply vertical flip option on aspect ratio change 2020-04-19 16:42:38 +02:00
Sascha Willems
0ca5f41308 Added missing include 2020-04-19 10:11:50 +02:00
Sascha Willems
cbe751d26e Base class cleanup and restructuring 2020-04-19 10:05:47 +02:00